From: marco_giraldi Date: Fri, 10 Jan 2020 13:44:26 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.1 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png//%27?a=commitdiff_plain;h=21a6843818b9d0205b20d9586cc265405dbdb72f;p=motion2.git Built motion from commit (unavailable).|2.4.1 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 321a043..67de759 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T10:49:54.198Z", + "time": "2020-01-10T13:38:36.889Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 359b23b..5019747 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T10:49:54.198Z", + "time": "2020-01-10T13:38:36.889Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 623cbc8..c3d01c8 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 _0x70e0=['TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0xb28715,_0xc1dd7a){var _0x2eb60d=function(_0x195bc7){while(--_0x195bc7){_0xb28715['push'](_0xb28715['shift']());}};_0x2eb60d(++_0xc1dd7a);}(_0x70e0,0x17b));var _0x070e=function(_0x18e0f7,_0x11dbcf){_0x18e0f7=_0x18e0f7-0x0;var _0x42e5c7=_0x70e0[_0x18e0f7];return _0x42e5c7;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')],'get':function(_0x4d95bb){return this['getDataValue'](_0x070e('0x3'));}},'action':{'type':Sequelize[_0x070e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x070e('0x5'),_0x070e('0x6'),'motionbar',_0x070e('0x7'),'urlForward',_0x070e('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x070e('0x9')},'data1':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xa')},'data2':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xb')},'data3':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x070e('0x4')]},'data7':{'type':Sequelize[_0x070e('0xd')]}}; \ No newline at end of file +var _0x9957=['integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'action':{'type':Sequelize[_0x7995('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7995('0x5'),_0x7995('0x6'),'motionbar',_0x7995('0x7'),_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0xb')]],'msg':_0x7995('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7995('0xe')},'data3':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xf')},'data4':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data5':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data6':{'type':Sequelize[_0x7995('0x4')]},'data7':{'type':Sequelize[_0x7995('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index af54145..47476ac 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 _0x7d0c=['../../config/environment','../../mysqldb','sendStatus','json','count','offset','status','set','Content-Range','apply','update','destroy','error','stack','name','send','Action','find','then','catch','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x36ae15,_0x26435f){var _0x3a9497=function(_0x31756c){while(--_0x31756c){_0x36ae15['push'](_0x36ae15['shift']());}};_0x3a9497(++_0x26435f);}(_0x7d0c,0x1b9));var _0xc7d0=function(_0x3a557a,_0xe7c178){_0x3a557a=_0x3a557a-0x0;var _0x4b80cd=_0x7d0c[_0x3a557a];return _0x4b80cd;};'use strict';var pdf=require(_0xc7d0('0x0'));var emlformat=require(_0xc7d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc7d0('0x2'));var jsonpatch=require(_0xc7d0('0x3'));var rp=require(_0xc7d0('0x4'));var moment=require('moment');var BPromise=require(_0xc7d0('0x5'));var Mustache=require('mustache');var util=require(_0xc7d0('0x6'));var path=require(_0xc7d0('0x7'));var sox=require(_0xc7d0('0x8'));var csv=require(_0xc7d0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc7d0('0xa'));var squel=require(_0xc7d0('0xb'));var crypto=require(_0xc7d0('0xc'));var jsforce=require(_0xc7d0('0xd'));var deskjs=require(_0xc7d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc7d0('0xf'));var Papa=require('papaparse');var Redis=require(_0xc7d0('0x10'));var authService=require(_0xc7d0('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc7d0('0x12'));var logger=require(_0xc7d0('0x13'))(_0xc7d0('0x14'));var utils=require('../../config/utils');var config=require(_0xc7d0('0x15'));var db=require(_0xc7d0('0x16'))['db'];function respondWithStatusCode(_0x357309,_0x26473f){_0x26473f=_0x26473f||0xcc;return function(_0x5f3693){if(_0x5f3693){return _0x357309[_0xc7d0('0x17')](_0x26473f);}return _0x357309['status'](_0x26473f)['end']();};}function respondWithResult(_0x2247b3,_0xb82996){_0xb82996=_0xb82996||0xc8;return function(_0xdc4482){if(_0xdc4482){return _0x2247b3['status'](_0xb82996)[_0xc7d0('0x18')](_0xdc4482);}};}function respondWithFilteredResult(_0xc0b988,_0x330cac){return function(_0x213e85){if(_0x213e85){var _0x30d1ee=_0x213e85[_0xc7d0('0x19')],_0x2ca947=_0x330cac[_0xc7d0('0x1a')],_0x262c85=_0x330cac[_0xc7d0('0x1a')]+_0x330cac['limit'],_0x468a05;if(_0x262c85>=_0x30d1ee){_0x262c85=_0x30d1ee;_0x468a05=0xc8;}else{_0x468a05=0xce;}_0xc0b988[_0xc7d0('0x1b')](_0x468a05);return _0xc0b988[_0xc7d0('0x1c')](_0xc7d0('0x1d'),_0x2ca947+'-'+_0x262c85+'/'+_0x30d1ee)[_0xc7d0('0x18')](_0x213e85);}return null;};}function patchUpdates(_0x532da0){return function(_0x407f28){try{jsonpatch[_0xc7d0('0x1e')](_0x407f28,_0x532da0,!![]);}catch(_0x5aa664){return BPromise['reject'](_0x5aa664);}return _0x407f28['save']();};}function saveUpdates(_0x42f920,_0x93339d){return function(_0x1093a0){if(_0x1093a0){return _0x1093a0[_0xc7d0('0x1f')](_0x42f920)['then'](function(_0x286df0){return _0x286df0;});}return null;};}function removeEntity(_0x9d93b2,_0x47324e){return function(_0x3fac7f){if(_0x3fac7f){return _0x3fac7f[_0xc7d0('0x20')]()['then'](function(){_0x9d93b2[_0xc7d0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x381b50,_0x3060c1){return function(_0x7d8353){if(!_0x7d8353){_0x381b50[_0xc7d0('0x17')](0x194);}return _0x7d8353;};}function handleError(_0x5cfe24,_0xf7e737){_0xf7e737=_0xf7e737||0x1f4;return function(_0x2c100e){logger[_0xc7d0('0x21')](_0x2c100e[_0xc7d0('0x22')]);if(_0x2c100e[_0xc7d0('0x23')]){delete _0x2c100e[_0xc7d0('0x23')];}_0x5cfe24[_0xc7d0('0x1b')](_0xf7e737)[_0xc7d0('0x24')](_0x2c100e);};}exports['update']=function(_0x4f6c98,_0x4155ec){if(_0x4f6c98['body']['id']){delete _0x4f6c98['body']['id'];}return db[_0xc7d0('0x25')][_0xc7d0('0x26')]({'where':{'id':_0x4f6c98['params']['id']}})[_0xc7d0('0x27')](handleEntityNotFound(_0x4155ec,null))[_0xc7d0('0x27')](saveUpdates(_0x4f6c98['body'],null))[_0xc7d0('0x27')](respondWithResult(_0x4155ec,null))[_0xc7d0('0x28')](handleError(_0x4155ec,null));};exports[_0xc7d0('0x20')]=function(_0xde906b,_0x579dfc){return db[_0xc7d0('0x25')][_0xc7d0('0x26')]({'where':{'id':_0xde906b[_0xc7d0('0x29')]['id']}})[_0xc7d0('0x27')](handleEntityNotFound(_0x579dfc,null))[_0xc7d0('0x27')](removeEntity(_0x579dfc,null))['catch'](handleError(_0x579dfc,null));}; \ No newline at end of file +var _0xb80c=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then','destroy','end','error','stack','name','update','Action','find','params','body'];(function(_0x105afa,_0x68b544){var _0x2c5e8d=function(_0x26c92a){while(--_0x26c92a){_0x105afa['push'](_0x105afa['shift']());}};_0x2c5e8d(++_0x68b544);}(_0xb80c,0xb0));var _0xcb80=function(_0x5c3dd6,_0x3759a5){_0x5c3dd6=_0x5c3dd6-0x0;var _0x5353fa=_0xb80c[_0x5c3dd6];return _0x5353fa;};'use strict';var pdf=require(_0xcb80('0x0'));var emlformat=require(_0xcb80('0x1'));var rimraf=require(_0xcb80('0x2'));var zipdir=require(_0xcb80('0x3'));var jsonpatch=require(_0xcb80('0x4'));var rp=require(_0xcb80('0x5'));var moment=require(_0xcb80('0x6'));var BPromise=require(_0xcb80('0x7'));var Mustache=require(_0xcb80('0x8'));var util=require('util');var path=require(_0xcb80('0x9'));var sox=require('sox');var csv=require(_0xcb80('0xa'));var ejs=require(_0xcb80('0xb'));var fs=require('fs');var _=require(_0xcb80('0xc'));var squel=require(_0xcb80('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb80('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcb80('0xa'));var querystring=require(_0xcb80('0xf'));var Papa=require(_0xcb80('0x10'));var Redis=require(_0xcb80('0x11'));var authService=require(_0xcb80('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb80('0x13'))(_0xcb80('0x14'));var utils=require(_0xcb80('0x15'));var config=require('../../config/environment');var db=require(_0xcb80('0x16'))['db'];function respondWithStatusCode(_0x3d2135,_0x2e57ff){_0x2e57ff=_0x2e57ff||0xcc;return function(_0x32a674){if(_0x32a674){return _0x3d2135[_0xcb80('0x17')](_0x2e57ff);}return _0x3d2135[_0xcb80('0x18')](_0x2e57ff)['end']();};}function respondWithResult(_0x440bb2,_0x48f420){_0x48f420=_0x48f420||0xc8;return function(_0x5a140c){if(_0x5a140c){return _0x440bb2[_0xcb80('0x18')](_0x48f420)[_0xcb80('0x19')](_0x5a140c);}};}function respondWithFilteredResult(_0x22f526,_0x380ae3){return function(_0x386ea8){if(_0x386ea8){var _0x272fd6=_0x386ea8[_0xcb80('0x1a')],_0x3a9925=_0x380ae3['offset'],_0x5a0fba=_0x380ae3[_0xcb80('0x1b')]+_0x380ae3[_0xcb80('0x1c')],_0x3c79dd;if(_0x5a0fba>=_0x272fd6){_0x5a0fba=_0x272fd6;_0x3c79dd=0xc8;}else{_0x3c79dd=0xce;}_0x22f526['status'](_0x3c79dd);return _0x22f526[_0xcb80('0x1d')]('Content-Range',_0x3a9925+'-'+_0x5a0fba+'/'+_0x272fd6)['json'](_0x386ea8);}return null;};}function patchUpdates(_0x3b033c){return function(_0x502ca2){try{jsonpatch[_0xcb80('0x1e')](_0x502ca2,_0x3b033c,!![]);}catch(_0x496d33){return BPromise[_0xcb80('0x1f')](_0x496d33);}return _0x502ca2[_0xcb80('0x20')]();};}function saveUpdates(_0x3e1d94,_0x396128){return function(_0x448593){if(_0x448593){return _0x448593['update'](_0x3e1d94)[_0xcb80('0x21')](function(_0x5de840){return _0x5de840;});}return null;};}function removeEntity(_0x35fb6c,_0x494f0f){return function(_0xe713a1){if(_0xe713a1){return _0xe713a1[_0xcb80('0x22')]()['then'](function(){_0x35fb6c[_0xcb80('0x18')](0xcc)[_0xcb80('0x23')]();});}};}function handleEntityNotFound(_0xd902a9,_0x92112b){return function(_0x5a5c9d){if(!_0x5a5c9d){_0xd902a9[_0xcb80('0x17')](0x194);}return _0x5a5c9d;};}function handleError(_0x556bc6,_0x54d8de){_0x54d8de=_0x54d8de||0x1f4;return function(_0xffa1d8){logger[_0xcb80('0x24')](_0xffa1d8[_0xcb80('0x25')]);if(_0xffa1d8[_0xcb80('0x26')]){delete _0xffa1d8[_0xcb80('0x26')];}_0x556bc6['status'](_0x54d8de)['send'](_0xffa1d8);};}exports[_0xcb80('0x27')]=function(_0x3d6f7b,_0x53ad68){if(_0x3d6f7b['body']['id']){delete _0x3d6f7b['body']['id'];}return db[_0xcb80('0x28')][_0xcb80('0x29')]({'where':{'id':_0x3d6f7b[_0xcb80('0x2a')]['id']}})[_0xcb80('0x21')](handleEntityNotFound(_0x53ad68,null))[_0xcb80('0x21')](saveUpdates(_0x3d6f7b[_0xcb80('0x2b')],null))[_0xcb80('0x21')](respondWithResult(_0x53ad68,null))['catch'](handleError(_0x53ad68,null));};exports[_0xcb80('0x22')]=function(_0x1bf990,_0x538c12){return db[_0xcb80('0x28')][_0xcb80('0x29')]({'where':{'id':_0x1bf990[_0xcb80('0x2a')]['id']}})[_0xcb80('0x21')](handleEntityNotFound(_0x538c12,null))[_0xcb80('0x21')](removeEntity(_0x538c12,null))['catch'](handleError(_0x538c12,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index c0d39b2..4ec9a78 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 _0x1412=['request-promise','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','../../config/logger','moment'];(function(_0x106b46,_0x5d64bd){var _0x14e43a=function(_0x3623e7){while(--_0x3623e7){_0x106b46['push'](_0x106b46['shift']());}};_0x14e43a(++_0x5d64bd);}(_0x1412,0x147));var _0x2141=function(_0x326c74,_0x3dea14){_0x326c74=_0x326c74-0x0;var _0x2bb4c1=_0x1412[_0x326c74];return _0x2bb4c1;};'use strict';var _=require(_0x2141('0x0'));var util=require('util');var logger=require(_0x2141('0x1'))('api');var moment=require(_0x2141('0x2'));var BPromise=require('bluebird');var rp=require(_0x2141('0x3'));var fs=require('fs');var path=require(_0x2141('0x4'));var rimraf=require(_0x2141('0x5'));var config=require(_0x2141('0x6'));var attributes=require(_0x2141('0x7'));module['exports']=function(_0x4c67fa,_0x12f7bd){return _0x4c67fa['define'](_0x2141('0x8'),attributes,{'tableName':_0x2141('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83ec=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x2d783b,_0x1a295a){var _0x504d6a=function(_0x4ad063){while(--_0x4ad063){_0x2d783b['push'](_0x2d783b['shift']());}};_0x504d6a(++_0x1a295a);}(_0x83ec,0x19e));var _0xc83e=function(_0x38674e,_0xc01fb){_0x38674e=_0x38674e-0x0;var _0x4afa42=_0x83ec[_0x38674e];return _0x4afa42;};'use strict';var _=require(_0xc83e('0x0'));var util=require(_0xc83e('0x1'));var logger=require(_0xc83e('0x2'))(_0xc83e('0x3'));var moment=require('moment');var BPromise=require(_0xc83e('0x4'));var rp=require(_0xc83e('0x5'));var fs=require('fs');var path=require(_0xc83e('0x6'));var rimraf=require(_0xc83e('0x7'));var config=require(_0xc83e('0x8'));var attributes=require('./action.attributes');module[_0xc83e('0x9')]=function(_0xd34933,_0xee441e){return _0xd34933[_0xc83e('0xa')](_0xc83e('0xb'),attributes,{'tableName':_0xc83e('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 af80b07..706e4f4 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 _0x867f=['then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x867f,0xe6));var _0xf867=function(_0x77b868,_0x45ea4b){_0x77b868=_0x77b868-0x0;var _0x1f54ea=_0x867f[_0x77b868];return _0x1f54ea;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});} \ No newline at end of file +var _0xe9e8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x160182,_0x4cf21a){var _0x1c1e78=function(_0x248245){while(--_0x248245){_0x160182['push'](_0x160182['shift']());}};_0x1c1e78(++_0x4cf21a);}(_0xe9e8,0x179));var _0x8e9e=function(_0x19df0b,_0x32de28){_0x19df0b=_0x19df0b-0x0;var _0x2b1cf4=_0xe9e8[_0x19df0b];return _0x2b1cf4;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))('rpc');var config=require(_0x8e9e('0x8'));var jayson=require(_0x8e9e('0x9'));var client=jayson[_0x8e9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dae01,_0x1613ff,_0x2e00d9){return new BPromise(function(_0x3afd97,_0x2745ef){return client[_0x8e9e('0xb')](_0x4dae01,_0x2e00d9)[_0x8e9e('0xc')](function(_0x50d9a1){logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1613ff,_0x8e9e('0xe'),JSON[_0x8e9e('0x11')](_0x50d9a1));if(_0x50d9a1[_0x8e9e('0x12')]){if(_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x13')]===0x1f4){logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x2745ef(_0x50d9a1[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x3afd97(_0x50d9a1['error'][_0x8e9e('0x14')]);}else{logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));_0x3afd97(_0x50d9a1[_0x8e9e('0x15')]['message']);}})['catch'](function(_0x20220a){logger[_0x8e9e('0x12')]('Action,\x20%s,\x20%s',_0x1613ff,_0x20220a);_0x2745ef(_0x20220a);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3c2f5d0..0d94f98 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 _0x3176=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x12c95a,_0x389722){var _0x3f0e3f=function(_0x4d0b23){while(--_0x4d0b23){_0x12c95a['push'](_0x12c95a['shift']());}};_0x3f0e3f(++_0x389722);}(_0x3176,0x1d8));var _0x6317=function(_0x3b419d,_0x204897){_0x3b419d=_0x3b419d-0x0;var _0x2a222a=_0x3176[_0x3b419d];return _0x2a222a;};'use strict';var multer=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var path=require(_0x6317('0x2'));var timeout=require(_0x6317('0x3'));var express=require(_0x6317('0x4'));var router=express[_0x6317('0x5')]();var auth=require(_0x6317('0x6'));var interaction=require(_0x6317('0x7'));var config=require(_0x6317('0x8'));var controller=require(_0x6317('0x9'));router[_0x6317('0xa')](_0x6317('0xb'),auth[_0x6317('0xc')](),controller[_0x6317('0xd')]);router[_0x6317('0xe')](_0x6317('0xb'),auth['isAuthenticated'](),controller[_0x6317('0xf')]);module[_0x6317('0x10')]=router; \ No newline at end of file +var _0xd87e=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./action.controller','put','isAuthenticated'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xd87e,0x1bf));var _0xed87=function(_0x2238f5,_0x3e0089){_0x2238f5=_0x2238f5-0x0;var _0x225e8b=_0xd87e[_0x2238f5];return _0x225e8b;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed87('0x5'));var config=require('../../config/environment');var controller=require(_0xed87('0x6'));router[_0xed87('0x7')]('/:id',auth[_0xed87('0x8')](),controller['update']);router['delete'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);module[_0xed87('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 1665847..ae6bdc4 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 _0x453f=['sequelize','exports','STRING'];(function(_0x34ac09,_0x4c087d){var _0x48ec2f=function(_0x24b7a5){while(--_0x24b7a5){_0x34ac09['push'](_0x34ac09['shift']());}};_0x48ec2f(++_0x4c087d);}(_0x453f,0xb4));var _0xf453=function(_0x17f5ed,_0x408f36){_0x17f5ed=_0x17f5ed-0x0;var _0x4b1692=_0x453f[_0x17f5ed];return _0x4b1692;};'use strict';var Sequelize=require(_0xf453('0x0'));module[_0xf453('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf453('0x2')]},'parent':{'type':Sequelize[_0xf453('0x2')]},'table':{'type':Sequelize[_0xf453('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1b91=['exports','STRING','TEXT','sequelize'];(function(_0x1ca196,_0x574d6c){var _0xc3cc69=function(_0x4a251b){while(--_0x4a251b){_0x1ca196['push'](_0x1ca196['shift']());}};_0xc3cc69(++_0x574d6c);}(_0x1b91,0x18f));var _0x11b9=function(_0x708795,_0x4dbf2a){_0x708795=_0x708795-0x0;var _0x1507e1=_0x1b91[_0x708795];return _0x1507e1;};'use strict';var Sequelize=require(_0x11b9('0x0'));module[_0x11b9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x11b9('0x2')]},'parent':{'type':Sequelize[_0x11b9('0x2')]},'table':{'type':Sequelize[_0x11b9('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x11b9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f221358..f6023c1 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 _0xae1a=['AnalyticMetric','table','DESC','parse','output','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','Limited\x20Query:','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','offset','limit','status','set','json','apply','save','update','destroy','then','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','AnalyticCustomReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0xae1a,0xba));var _0xaae1=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xae1a[_0x1d9aa0];return _0x226868;};'use strict';var pdf=require(_0xaae1('0x0'));var emlformat=require(_0xaae1('0x1'));var rimraf=require(_0xaae1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaae1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaae1('0x4'));var util=require(_0xaae1('0x5'));var path=require(_0xaae1('0x6'));var sox=require(_0xaae1('0x7'));var csv=require(_0xaae1('0x8'));var ejs=require(_0xaae1('0x9'));var fs=require('fs');var _=require(_0xaae1('0xa'));var squel=require('squel');var crypto=require(_0xaae1('0xb'));var jsforce=require(_0xaae1('0xc'));var deskjs=require(_0xaae1('0xd'));var toCsv=require(_0xaae1('0x8'));var querystring=require(_0xaae1('0xe'));var Papa=require(_0xaae1('0xf'));var Redis=require(_0xaae1('0x10'));var authService=require(_0xaae1('0x11'));var qs=require(_0xaae1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaae1('0x13'))(_0xaae1('0x14'));var utils=require(_0xaae1('0x15'));var config=require(_0xaae1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f7a4,_0x2c63c4){_0x2c63c4=_0x2c63c4||0xcc;return function(_0x430564){if(_0x430564){return _0x11f7a4['sendStatus'](_0x2c63c4);}return _0x11f7a4['status'](_0x2c63c4)['end']();};}function respondWithResult(_0x3121c5,_0x5a24a2){_0x5a24a2=_0x5a24a2||0xc8;return function(_0x2e836f){if(_0x2e836f){return _0x3121c5['status'](_0x5a24a2)['json'](_0x2e836f);}};}function respondWithFilteredResult(_0x129623,_0x3aae6b){return function(_0x4fdcb3){if(_0x4fdcb3){var _0x50364c=_0x4fdcb3['count'],_0x2583c1=_0x3aae6b[_0xaae1('0x17')],_0x4ce3e0=_0x3aae6b[_0xaae1('0x17')]+_0x3aae6b[_0xaae1('0x18')],_0x1a4c52;if(_0x4ce3e0>=_0x50364c){_0x4ce3e0=_0x50364c;_0x1a4c52=0xc8;}else{_0x1a4c52=0xce;}_0x129623[_0xaae1('0x19')](_0x1a4c52);return _0x129623[_0xaae1('0x1a')]('Content-Range',_0x2583c1+'-'+_0x4ce3e0+'/'+_0x50364c)[_0xaae1('0x1b')](_0x4fdcb3);}return null;};}function patchUpdates(_0x2624e2){return function(_0x4a3c96){try{jsonpatch[_0xaae1('0x1c')](_0x4a3c96,_0x2624e2,!![]);}catch(_0x2ff25b){return BPromise['reject'](_0x2ff25b);}return _0x4a3c96[_0xaae1('0x1d')]();};}function saveUpdates(_0x130936,_0x493e8f){return function(_0x3f6118){if(_0x3f6118){return _0x3f6118[_0xaae1('0x1e')](_0x130936)['then'](function(_0x396136){return _0x396136;});}return null;};}function removeEntity(_0x414a4a,_0x53877a){return function(_0x584bd6){if(_0x584bd6){return _0x584bd6[_0xaae1('0x1f')]()[_0xaae1('0x20')](function(){var _0x559a90=_0x584bd6['get']({'plain':!![]});var _0x55523d=_0xaae1('0x21');return db[_0xaae1('0x22')][_0xaae1('0x1f')]({'where':{'type':_0x55523d,'resourceId':_0x559a90['id']}})[_0xaae1('0x20')](function(){return _0x584bd6;});})['then'](function(){_0x414a4a[_0xaae1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9454,_0x12fa63){return function(_0x4e4283){if(!_0x4e4283){_0x2b9454[_0xaae1('0x23')](0x194);}return _0x4e4283;};}function handleError(_0x2bcd12,_0x27ecdf){_0x27ecdf=_0x27ecdf||0x1f4;return function(_0x2bcf16){logger[_0xaae1('0x24')](_0x2bcf16[_0xaae1('0x25')]);if(_0x2bcf16[_0xaae1('0x26')]){delete _0x2bcf16[_0xaae1('0x26')];}_0x2bcd12['status'](_0x27ecdf)['send'](_0x2bcf16);};}exports[_0xaae1('0x27')]=function(_0x1e1b98,_0x3f3f19){var _0x2f39d1={},_0x437d75={},_0x3e6427={'count':0x0,'rows':[]};var _0x1dd1d6=db[_0xaae1('0x28')][_0xaae1('0x29')];_0x437d75['model']=_['keys'](_0x1dd1d6);_0x437d75[_0xaae1('0x2a')]=_[_0xaae1('0x2b')](_0x1e1b98[_0xaae1('0x2a')]);_0x437d75[_0xaae1('0x2c')]=_[_0xaae1('0x2d')](_0x437d75[_0xaae1('0x2e')],_0x437d75[_0xaae1('0x2a')]);_0x2f39d1[_0xaae1('0x2f')]=_[_0xaae1('0x2d')](_0x437d75[_0xaae1('0x2e')],qs[_0xaae1('0x30')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x30')]));_0x2f39d1['attributes']=_0x2f39d1[_0xaae1('0x2f')][_0xaae1('0x31')]?_0x2f39d1[_0xaae1('0x2f')]:_0x437d75[_0xaae1('0x2e')];if(!_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x32')](_0xaae1('0x33'))){_0x2f39d1['limit']=qs[_0xaae1('0x18')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x18')]);_0x2f39d1['offset']=qs[_0xaae1('0x17')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x17')]);}_0x2f39d1[_0xaae1('0x34')]=qs[_0xaae1('0x35')](_0x1e1b98['query']['sort']);_0x2f39d1['where']=qs[_0xaae1('0x2c')](_['pick'](_0x1e1b98['query'],_0x437d75['filters']));if(_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x36')]){_0x2f39d1[_0xaae1('0x37')]=_[_0xaae1('0x38')](_0x2f39d1[_0xaae1('0x37')],{'$or':_[_0xaae1('0x39')](_0x1dd1d6,function(_0x5e1726){if(_0x5e1726[_0xaae1('0x3a')]['key']!=='VIRTUAL'){var _0x44b0ac={};_0x44b0ac[_0x5e1726[_0xaae1('0x3b')]]={'$like':'%'+_0x1e1b98['query'][_0xaae1('0x36')]+'%'};return _0x44b0ac;}})});}_0x2f39d1=_[_0xaae1('0x38')]({},_0x2f39d1,_0x1e1b98[_0xaae1('0x3c')]);var _0x375b5c={'where':_0x2f39d1[_0xaae1('0x37')]};return db['AnalyticCustomReport'][_0xaae1('0x3d')](_0x375b5c)[_0xaae1('0x20')](function(_0x4633d5){_0x3e6427[_0xaae1('0x3d')]=_0x4633d5;if(_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x3e')]){_0x2f39d1[_0xaae1('0x3f')]=[{'all':!![]}];}return db[_0xaae1('0x28')][_0xaae1('0x40')](_0x2f39d1);})[_0xaae1('0x20')](function(_0xad861d){_0x3e6427[_0xaae1('0x41')]=_0xad861d;return _0x3e6427;})['then'](respondWithFilteredResult(_0x3f3f19,_0x2f39d1))[_0xaae1('0x42')](handleError(_0x3f3f19,null));};exports[_0xaae1('0x43')]=function(_0x3caee0,_0x256efd){var _0x388ad3={'raw':![],'where':{'id':_0x3caee0[_0xaae1('0x44')]['id']}},_0x466ada={};_0x466ada['model']=_['keys'](db[_0xaae1('0x28')]['rawAttributes']);_0x466ada['query']=_['keys'](_0x3caee0[_0xaae1('0x2a')]);_0x466ada[_0xaae1('0x2c')]=_[_0xaae1('0x2d')](_0x466ada[_0xaae1('0x2e')],_0x466ada['query']);_0x388ad3[_0xaae1('0x2f')]=_[_0xaae1('0x2d')](_0x466ada['model'],qs[_0xaae1('0x30')](_0x3caee0[_0xaae1('0x2a')][_0xaae1('0x30')]));_0x388ad3[_0xaae1('0x2f')]=_0x388ad3['attributes'][_0xaae1('0x31')]?_0x388ad3[_0xaae1('0x2f')]:_0x466ada[_0xaae1('0x2e')];if(_0x3caee0[_0xaae1('0x2a')][_0xaae1('0x3e')]){_0x388ad3[_0xaae1('0x3f')]=[{'all':!![]}];}_0x388ad3=_[_0xaae1('0x38')]({},_0x388ad3,_0x3caee0[_0xaae1('0x3c')]);return db['AnalyticCustomReport']['find'](_0x388ad3)[_0xaae1('0x20')](handleEntityNotFound(_0x256efd,null))[_0xaae1('0x20')](respondWithResult(_0x256efd,null))['catch'](handleError(_0x256efd,null));};exports[_0xaae1('0x45')]=function(_0x5150f3,_0x49c4c7){return db[_0xaae1('0x28')][_0xaae1('0x45')](_0x5150f3[_0xaae1('0x46')],{})[_0xaae1('0x20')](function(_0x545ab1){var _0x47fdb8=_0x5150f3[_0xaae1('0x47')][_0xaae1('0x48')]({'plain':!![]});if(!_0x47fdb8)throw new Error(_0xaae1('0x49'));if(_0x47fdb8[_0xaae1('0x4a')]===_0xaae1('0x47')){var _0x3acd2d=_0x545ab1[_0xaae1('0x48')]({'plain':!![]});var _0xdbd17e='Reports';return db[_0xaae1('0x4b')][_0xaae1('0x4c')]({'where':{'name':_0xdbd17e,'userProfileId':_0x47fdb8[_0xaae1('0x4d')]},'raw':!![]})['then'](function(_0x527c55){if(_0x527c55&&_0x527c55[_0xaae1('0x4e')]===0x0){return db['UserProfileResource'][_0xaae1('0x45')]({'name':_0x3acd2d[_0xaae1('0x26')],'resourceId':_0x3acd2d['id'],'type':_0xaae1('0x21'),'sectionId':_0x527c55['id']},{})[_0xaae1('0x20')](function(){return _0x545ab1;});}else{return _0x545ab1;}})['catch'](function(_0x4389ea){logger[_0xaae1('0x24')](_0xaae1('0x4f'),_0x4389ea);throw _0x4389ea;});}return _0x545ab1;})[_0xaae1('0x20')](respondWithResult(_0x49c4c7,0xc9))[_0xaae1('0x42')](handleError(_0x49c4c7,null));};exports[_0xaae1('0x1e')]=function(_0x3c1d77,_0x348913){if(_0x3c1d77[_0xaae1('0x46')]['id']){delete _0x3c1d77['body']['id'];}return db['AnalyticCustomReport'][_0xaae1('0x4c')]({'where':{'id':_0x3c1d77[_0xaae1('0x44')]['id']}})[_0xaae1('0x20')](handleEntityNotFound(_0x348913,null))[_0xaae1('0x20')](saveUpdates(_0x3c1d77['body'],null))[_0xaae1('0x20')](respondWithResult(_0x348913,null))[_0xaae1('0x42')](handleError(_0x348913,null));};exports['destroy']=function(_0x35909c,_0x5db676){return db['AnalyticCustomReport'][_0xaae1('0x4c')]({'where':{'id':_0x35909c[_0xaae1('0x44')]['id']}})[_0xaae1('0x20')](handleEntityNotFound(_0x5db676,null))[_0xaae1('0x20')](removeEntity(_0x5db676,null))[_0xaae1('0x42')](handleError(_0x5db676,null));};exports[_0xaae1('0x50')]=function(_0x3cbb55,_0x381057){var _0xc05084=0xa;var _0x1e80e4=[_0xaae1('0x51'),_0xaae1('0x52'),_0xaae1('0x53'),_0xaae1('0x54')];var _0x2fc6ac={'SUM':_0xaae1('0x55'),'COUNT':_0xaae1('0x56'),'COUNT DISTINCT':_0xaae1('0x57'),'MAX':_0xaae1('0x58'),'MIN':_0xaae1('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x7b6b6a={'SEC_TO_TIME':_0xaae1('0x5d'),'DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':_0xaae1('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e540f=function(_0x37fefb){return!_[_0xaae1('0x61')]([_0xaae1('0x62'),'IS\x20NOT\x20NULL',_0xaae1('0x63'),_0xaae1('0x64')],_0x37fefb);};var _0x3ca07b=function(_0x3fdd6a){if(!_0x3fdd6a||!_0x3fdd6a[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0x312c13='(',_0xa396b2=0x0;_0xa396b2<_0x3fdd6a[_0xaae1('0x65')][_0xaae1('0x31')];_0xa396b2+=0x1){_0xa396b2>0x0&&(_0x312c13+='\x20'+_0x3fdd6a[_0xaae1('0x66')]+'\x20');_0x312c13+=_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x67')]?_0x3ca07b(_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x67')]):_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x3b')]+'\x20'+_0x3fdd6a['rules'][_0xa396b2][_0xaae1('0x68')]+(_0x2e540f(_0x3fdd6a[_0xaae1('0x65')][_0xa396b2]['condition'])?'\x20'+_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x69')]:'');}return _0x312c13+')';};var _0x379b43={'where':{'id':_0x3cbb55[_0xaae1('0x44')]['id']}},_0x3335de,_0x3cfc77,_0x1d6001,_0x46fd05,_0x5ba908;_0x379b43=_['merge']({},_0x379b43,_0x3cbb55[_0xaae1('0x3c')]);return db['AnalyticCustomReport']['find'](_0x379b43)['then'](function(_0x18932b){if(_0x18932b){_0x3335de=_0x18932b;return _0x18932b[_0xaae1('0x6a')]();}return null;})[_0xaae1('0x20')](function(_0x25c6c5){if(_0x25c6c5){if(!_0x25c6c5[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3cfc77=_0x25c6c5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x207174){if(_0x207174){_0x1d6001=_[_0xaae1('0x6c')](_0x207174,'id');var _0x13e552;var _0xb94576=squel[_0xaae1('0x6d')]();_0xb94576[_0xaae1('0x6e')](_0x3335de['table']);for(var _0x55a98d=0x0;_0x55a98d<_0x3cfc77[_0xaae1('0x31')];_0x55a98d+=0x1){_0x13e552=_0x3cfc77[_0x55a98d]['MetricId']?_0x1d6001[_0x3cfc77[_0x55a98d][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x3cfc77[_0x55a98d][_0xaae1('0x3b')];_0x13e552=_0x3cfc77[_0x55a98d][_0xaae1('0x71')]?_[_0xaae1('0x72')](_0x2fc6ac[_0x3cfc77[_0x55a98d]['function']],'%s',_0x13e552):_0x13e552;_0x13e552=_0x3cfc77[_0x55a98d][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x7b6b6a[_0x3cfc77[_0x55a98d][_0xaae1('0x73')]],'%s',_0x13e552):_0x13e552;if(_0x3cfc77[_0x55a98d][_0xaae1('0x74')]){_0xb94576['group'](_0x13e552);}_0x3cfc77[_0x55a98d][_0xaae1('0x75')]&&_0xb94576[_0xaae1('0x34')](_0x13e552,_0x3cfc77[_0x55a98d][_0xaae1('0x75')]==='DESC'?![]:!![]);_0xb94576[_0xaae1('0x3b')](_0x13e552,_0x3cfc77[_0x55a98d][_0xaae1('0x76')]||_0x13e552);}if(_0x3335de['joins']){_0x3335de[_0xaae1('0x77')]=JSON['parse'](_0x3335de[_0xaae1('0x77')]);for(var _0x1a2e31=0x0;_0x1a2e31<_0x3335de[_0xaae1('0x77')][_0xaae1('0x31')];_0x1a2e31+=0x1){if(_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x3a')]&&_[_0xaae1('0x61')](_0x1e80e4,_0x3335de[_0xaae1('0x77')][_0x1a2e31]['type'])&&_0x3335de[_0xaae1('0x77')][_0x1a2e31]['parentKey']&&_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x78')]&&_0x3335de['joins'][_0x1a2e31][_0xaae1('0x79')]){_0xb94576[_0x3335de['joins'][_0x1a2e31][_0xaae1('0x3a')]](_0x3335de[_0xaae1('0x77')][_0x1a2e31]['foreignTable'],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x3335de['table'],_0x3335de['joins'][_0x1a2e31][_0xaae1('0x7b')],_0x3335de[_0xaae1('0x77')][_0x1a2e31]['foreignTable'],_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x79')]));}}}if(_0x3335de[_0xaae1('0x7c')]){_0x3335de[_0xaae1('0x7c')]=JSON['parse'](_0x3335de[_0xaae1('0x7c')]);_0xb94576[_0xaae1('0x37')](_0x3ca07b(_0x3335de[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x5ba908=_0xb94576[_0xaae1('0x7d')]();_0xb94576['limit'](_0xc05084);_0xb94576['offset'](0x0);logger[_0xaae1('0x7e')]('Limited\x20Query:',_0xb94576[_0xaae1('0x7f')]());return db['sequelize'][_0xaae1('0x2a')](_0xb94576[_0xaae1('0x7f')](),{'type':db[_0xaae1('0x80')][_0xaae1('0x81')][_0xaae1('0x82')]});}})['then'](respondWithResult(_0x381057,null))['catch'](handleError(_0x381057,null));};function runReport(_0x56977f,_0x40fde7,_0x14a42a){var _0xee549b=_0x40fde7['name'];var _0x1799dc=0xa;var _0x354bad=[_0xaae1('0x51'),_0xaae1('0x52'),'right_join',_0xaae1('0x54')];var _0x317967={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaae1('0x57'),'MAX':'MAX(%s)','MIN':_0xaae1('0x59'),'AVG':_0xaae1('0x83'),'GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x373982={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':_0xaae1('0x60'),'UNIX_TIMESTAMP':_0xaae1('0x84')};var _0xdd6af4=function(_0x5865b8){return!_['includes']([_0xaae1('0x62'),_0xaae1('0x85'),_0xaae1('0x63'),_0xaae1('0x64')],_0x5865b8);};var _0x378bf6=function(_0x155670){if(!_0x155670||!_0x155670[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0x47b926='(',_0x36aa99=0x0;_0x36aa99<_0x155670[_0xaae1('0x65')][_0xaae1('0x31')];_0x36aa99+=0x1){_0x36aa99>0x0&&(_0x47b926+='\x20'+_0x155670['operator']+'\x20');_0x47b926+=_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x67')]?_0x378bf6(_0x155670['rules'][_0x36aa99][_0xaae1('0x67')]):_0x155670['rules'][_0x36aa99][_0xaae1('0x3b')]+'\x20'+_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x68')]+(_0xdd6af4(_0x155670['rules'][_0x36aa99][_0xaae1('0x68')])?'\x20'+_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x69')]:'');}return _0x47b926+')';};var _0x543973={'where':{'id':_0x56977f['id']}},_0x168bea,_0x1b0e9f,_0x391db5,_0x35d978,_0x3c20a6;_0x543973=_['merge']({},_0x543973,_0x14a42a);return db['AnalyticCustomReport'][_0xaae1('0x4c')](_0x543973)[_0xaae1('0x20')](function(_0x10f4a1){if(_0x10f4a1){_0x168bea=_0x10f4a1;return _0x10f4a1[_0xaae1('0x6a')]();}return null;})['then'](function(_0x46deaf){if(_0x46deaf){if(!_0x46deaf['length']){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))](_0xaae1('0x87'),0x193);}_0x1b0e9f=_0x46deaf;return db[_0xaae1('0x88')]['findAll']({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x52aeae){if(_0x52aeae){_0x391db5=_[_0xaae1('0x6c')](_0x52aeae,'id');var _0x187272;var _0x5f3795=squel[_0xaae1('0x6d')]();_0x5f3795[_0xaae1('0x6e')](_0x168bea[_0xaae1('0x89')]);for(var _0x24d46f=0x0;_0x24d46f<_0x1b0e9f[_0xaae1('0x31')];_0x24d46f+=0x1){_0x187272=_0x1b0e9f[_0x24d46f]['MetricId']?_0x391db5[_0x1b0e9f[_0x24d46f][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x1b0e9f[_0x24d46f][_0xaae1('0x3b')];_0x187272=_0x1b0e9f[_0x24d46f]['function']?_[_0xaae1('0x72')](_0x317967[_0x1b0e9f[_0x24d46f][_0xaae1('0x71')]],'%s',_0x187272):_0x187272;_0x187272=_0x1b0e9f[_0x24d46f][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x373982[_0x1b0e9f[_0x24d46f][_0xaae1('0x73')]],'%s',_0x187272):_0x187272;if(_0x1b0e9f[_0x24d46f][_0xaae1('0x74')]){_0x5f3795[_0xaae1('0x67')](_0x187272);}_0x1b0e9f[_0x24d46f]['orderBy']&&_0x5f3795['order'](_0x187272,_0x1b0e9f[_0x24d46f][_0xaae1('0x75')]===_0xaae1('0x8a')?![]:!![]);_0x5f3795[_0xaae1('0x3b')](_0x187272,_0x1b0e9f[_0x24d46f][_0xaae1('0x76')]||_0x187272);}if(_0x168bea['joins']){_0x168bea[_0xaae1('0x77')]=JSON[_0xaae1('0x8b')](_0x168bea[_0xaae1('0x77')]);for(var _0xbdb7b9=0x0;_0xbdb7b9<_0x168bea[_0xaae1('0x77')][_0xaae1('0x31')];_0xbdb7b9+=0x1){if(_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x3a')]&&_[_0xaae1('0x61')](_0x354bad,_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x3a')])&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x7b')]&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x78')]&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x79')]){_0x5f3795[_0x168bea[_0xaae1('0x77')][_0xbdb7b9]['type']](_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x78')],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x168bea[_0xaae1('0x89')],_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x7b')],_0x168bea['joins'][_0xbdb7b9][_0xaae1('0x78')],_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x79')]));}}}if(_0x168bea[_0xaae1('0x7c')]){_0x168bea[_0xaae1('0x7c')]=JSON[_0xaae1('0x8b')](_0x168bea[_0xaae1('0x7c')]);_0x5f3795[_0xaae1('0x37')](_0x378bf6(_0x168bea[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x3c20a6=_0x5f3795[_0xaae1('0x7d')]();_0x5f3795[_0xaae1('0x18')](_0x1799dc);_0x5f3795[_0xaae1('0x17')](0x0);logger[_0xaae1('0x7e')]('Limited\x20Query:',_0x5f3795[_0xaae1('0x7f')]());return db[_0xaae1('0x80')]['query'](_0x5f3795[_0xaae1('0x7f')](),{'type':db[_0xaae1('0x80')]['QueryTypes'][_0xaae1('0x82')]});}})[_0xaae1('0x20')](function(_0x511696){if(!_0x511696[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))]('No\x20available\x20data',0xcc);}if(_0x40fde7[_0xaae1('0x8c')]===_0xaae1('0x8d')){return null;}var _0x24809c=_['merge'](_0x40fde7,{'name':_0x40fde7[_0xaae1('0x8e')]||_0x40fde7[_0xaae1('0x26')]||_0x168bea[_0xaae1('0x26')],'basename':_0xee549b,'savename':util['format']('%s-%s.%s',_0x40fde7[_0xaae1('0x26')]||_0x168bea[_0xaae1('0x26')],require(_0xaae1('0x8f'))['generate'](0x4),_0x40fde7[_0xaae1('0x8c')]||_0xaae1('0x90')),'reportId':_0x168bea['id'],'reportType':_0xaae1('0x91')});return db[_0xaae1('0x92')]['create'](_0x24809c,{'raw':!![]});})[_0xaae1('0x20')](function(_0x33c508){if(_0x168bea['table']===_0xaae1('0x93')){_0x3c20a6[_0xaae1('0x37')](_0x168bea[_0xaae1('0x89')]+_0xaae1('0x94'),_0x40fde7[_0xaae1('0x95')],_0x40fde7['endDate']);}else{_0x3c20a6['where'](_0x168bea[_0xaae1('0x89')]+_0xaae1('0x96'),_0x40fde7['startDate'],_0x40fde7[_0xaae1('0x97')]);}if(_0x33c508){logger[_0xaae1('0x98')](_0xaae1('0x99'),_0x3c20a6[_0xaae1('0x7f')]());require('child_process')['fork'](path['join'](__dirname,_0xaae1('0x9a'),_0x33c508[_0xaae1('0x8c')]),[_0x33c508['id'],_0x3c20a6[_0xaae1('0x7f')](),path['join'](__dirname,_0xaae1('0x9b'),_0x33c508['savename']),_0xee549b]);return _0x33c508;}else{var _0x4f7ee0=squel[_0xaae1('0x6d')]();_0x4f7ee0['from']('('+_0x3c20a6[_0xaae1('0x7f')]()+')',_0xaae1('0x9c'));_0x4f7ee0[_0xaae1('0x3b')](_0xaae1('0x9d'),_0xaae1('0x3d'));_0x3c20a6['limit'](_0x40fde7['limit']||_0x1799dc);_0x3c20a6[_0xaae1('0x17')](_0x40fde7['offset']||0x0);return db[_0xaae1('0x80')][_0xaae1('0x2a')](_0x4f7ee0[_0xaae1('0x7f')](),{'type':db['sequelize'][_0xaae1('0x81')][_0xaae1('0x82')]})['then'](function(_0x43d595){if(!_0x43d595[_0xaae1('0x31')]){_0x35d978=0x0;}else{_0x35d978=_0x43d595[0x0]['count']||0x0;}return db['sequelize'][_0xaae1('0x2a')](_0x3c20a6[_0xaae1('0x7f')](),{'type':db['sequelize'][_0xaae1('0x81')][_0xaae1('0x82')]});})['then'](function(_0x30877b){return{'rows':_0x30877b||[],'count':_0x35d978};});}});}exports[_0xaae1('0x9e')]=function(_0x2dc6b5,_0x872475){return runReport(_0x2dc6b5[_0xaae1('0x44')],_0x2dc6b5[_0xaae1('0x2a')],_0x2dc6b5['options'])[_0xaae1('0x20')](respondWithResult(_0x872475,null))[_0xaae1('0x42')](handleError(_0x872475,null));};exports[_0xaae1('0x9f')]=runReport;exports[_0xaae1('0x2a')]=function(_0x2b15cb,_0x156811){var _0x34758a=0xa;var _0x5736be=[_0xaae1('0x51'),'left_join',_0xaae1('0x53'),'cross_join'];var _0x5591e3={'SUM':_0xaae1('0x55'),'COUNT':_0xaae1('0x56'),'COUNT DISTINCT':_0xaae1('0x57'),'MAX':_0xaae1('0x58'),'MIN':_0xaae1('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x5f4713={'SEC_TO_TIME':_0xaae1('0x5d'),'DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10790f=function(_0x55be2b){return!_[_0xaae1('0x61')]([_0xaae1('0x62'),_0xaae1('0x85'),_0xaae1('0x63'),_0xaae1('0x64')],_0x55be2b);};var _0x43cac3=function(_0x32df1f){if(!_0x32df1f||!_0x32df1f[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0xbf3dc7='(',_0x12a976=0x0;_0x12a976<_0x32df1f[_0xaae1('0x65')][_0xaae1('0x31')];_0x12a976+=0x1){_0x12a976>0x0&&(_0xbf3dc7+='\x20'+_0x32df1f[_0xaae1('0x66')]+'\x20');_0xbf3dc7+=_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x67')]?_0x43cac3(_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x67')]):_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x3b')]+'\x20'+_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x68')]+(_0x10790f(_0x32df1f['rules'][_0x12a976]['condition'])?'\x20'+_0x32df1f['rules'][_0x12a976]['value']:'');}return _0xbf3dc7+')';};var _0xcb30f0={'where':{'id':_0x2b15cb[_0xaae1('0x44')]['id']}},_0x1a978c,_0x58b472,_0x50f932,_0x51fb74,_0x122edb;_0xcb30f0=_[_0xaae1('0x38')]({},_0xcb30f0,_0x2b15cb[_0xaae1('0x3c')]);return db[_0xaae1('0x28')][_0xaae1('0x4c')](_0xcb30f0)[_0xaae1('0x20')](function(_0x33a09b){if(_0x33a09b){_0x1a978c=_0x33a09b;return _0x33a09b['getFields']();}return null;})[_0xaae1('0x20')](function(_0x22ed91){if(_0x22ed91){if(!_0x22ed91[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))](_0xaae1('0x87'),0x193);}_0x58b472=_0x22ed91;return db['AnalyticMetric'][_0xaae1('0x40')]({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x1fba42){if(_0x1fba42){_0x50f932=_[_0xaae1('0x6c')](_0x1fba42,'id');var _0x372754;var _0x3a6b7f=squel[_0xaae1('0x6d')]();_0x3a6b7f['from'](_0x1a978c[_0xaae1('0x89')]);for(var _0x4c97f7=0x0;_0x4c97f7<_0x58b472[_0xaae1('0x31')];_0x4c97f7+=0x1){_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x6f')]?_0x50f932[_0x58b472[_0x4c97f7][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x58b472[_0x4c97f7][_0xaae1('0x3b')];_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x71')]?_[_0xaae1('0x72')](_0x5591e3[_0x58b472[_0x4c97f7][_0xaae1('0x71')]],'%s',_0x372754):_0x372754;_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x5f4713[_0x58b472[_0x4c97f7][_0xaae1('0x73')]],'%s',_0x372754):_0x372754;if(_0x58b472[_0x4c97f7][_0xaae1('0x74')]){_0x3a6b7f[_0xaae1('0x67')](_0x372754);}_0x58b472[_0x4c97f7][_0xaae1('0x75')]&&_0x3a6b7f[_0xaae1('0x34')](_0x372754,_0x58b472[_0x4c97f7][_0xaae1('0x75')]===_0xaae1('0x8a')?![]:!![]);_0x3a6b7f['field'](_0x372754,_0x58b472[_0x4c97f7][_0xaae1('0x76')]||_0x372754);}if(_0x1a978c[_0xaae1('0x77')]){_0x1a978c['joins']=JSON[_0xaae1('0x8b')](_0x1a978c['joins']);for(var _0x20c2c1=0x0;_0x20c2c1<_0x1a978c[_0xaae1('0x77')]['length'];_0x20c2c1+=0x1){if(_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')]&&_['includes'](_0x5736be,_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')])&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1]['parentKey']&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1]['foreignTable']&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x79')]){_0x3a6b7f[_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')]](_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x78')],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x1a978c[_0xaae1('0x89')],_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x7b')],_0x1a978c['joins'][_0x20c2c1][_0xaae1('0x78')],_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x79')]));}}}if(_0x1a978c[_0xaae1('0x7c')]){_0x1a978c[_0xaae1('0x7c')]=JSON[_0xaae1('0x8b')](_0x1a978c[_0xaae1('0x7c')]);_0x3a6b7f['where'](_0x43cac3(_0x1a978c[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x122edb=_0x3a6b7f['clone']();_0x3a6b7f['limit'](_0x34758a);_0x3a6b7f['offset'](0x0);logger[_0xaae1('0x7e')](_0xaae1('0xa0'),_0x3a6b7f['toString']());return db['sequelize'][_0xaae1('0x2a')](_0x3a6b7f[_0xaae1('0x7f')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x122edb['toString']()};})['then'](respondWithResult(_0x156811,null))['catch'](handleError(_0x156811,null));}; \ No newline at end of file +var _0xd138=['startDate','info','Run\x20Query:','child_process','join','../../components/export/','../../files/reports','countTable','COUNT(*)','run','order','html-pdf','eml-format','rimraf','moment','util','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','key','VIRTUAL','field','merge','AnalyticCustomReport','include','findAll','catch','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','foreignKey','debug','toString','No\x20available\x20data','output','web','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x3b4ba9,_0x59557e){var _0x266220=function(_0x34cdaa){while(--_0x34cdaa){_0x3b4ba9['push'](_0x3b4ba9['shift']());}};_0x266220(++_0x59557e);}(_0xd138,0x1dc));var _0x8d13=function(_0x2489de,_0x181b41){_0x2489de=_0x2489de-0x0;var _0x34c7a2=_0xd138[_0x2489de];return _0x34c7a2;};'use strict';var pdf=require(_0x8d13('0x0'));var emlformat=require(_0x8d13('0x1'));var rimraf=require(_0x8d13('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d13('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8d13('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8d13('0x5'));var crypto=require(_0x8d13('0x6'));var jsforce=require(_0x8d13('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x8d13('0x8'));var querystring=require('querystring');var Papa=require(_0x8d13('0x9'));var Redis=require(_0x8d13('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8d13('0xb'));var logger=require(_0x8d13('0xc'))(_0x8d13('0xd'));var utils=require('../../config/utils');var config=require(_0x8d13('0xe'));var db=require(_0x8d13('0xf'))['db'];function respondWithStatusCode(_0x21bf55,_0x5aa05e){_0x5aa05e=_0x5aa05e||0xcc;return function(_0x418b69){if(_0x418b69){return _0x21bf55[_0x8d13('0x10')](_0x5aa05e);}return _0x21bf55[_0x8d13('0x11')](_0x5aa05e)[_0x8d13('0x12')]();};}function respondWithResult(_0x3e8c49,_0x362385){_0x362385=_0x362385||0xc8;return function(_0xb43342){if(_0xb43342){return _0x3e8c49[_0x8d13('0x11')](_0x362385)[_0x8d13('0x13')](_0xb43342);}};}function respondWithFilteredResult(_0x4dcc50,_0x344340){return function(_0x545938){if(_0x545938){var _0x562ed9=_0x545938[_0x8d13('0x14')],_0xe697fe=_0x344340[_0x8d13('0x15')],_0x4b4dc9=_0x344340[_0x8d13('0x15')]+_0x344340[_0x8d13('0x16')],_0x1f247a;if(_0x4b4dc9>=_0x562ed9){_0x4b4dc9=_0x562ed9;_0x1f247a=0xc8;}else{_0x1f247a=0xce;}_0x4dcc50[_0x8d13('0x11')](_0x1f247a);return _0x4dcc50[_0x8d13('0x17')](_0x8d13('0x18'),_0xe697fe+'-'+_0x4b4dc9+'/'+_0x562ed9)[_0x8d13('0x13')](_0x545938);}return null;};}function patchUpdates(_0x2c36c4){return function(_0x17148d){try{jsonpatch[_0x8d13('0x19')](_0x17148d,_0x2c36c4,!![]);}catch(_0x212ef2){return BPromise[_0x8d13('0x1a')](_0x212ef2);}return _0x17148d[_0x8d13('0x1b')]();};}function saveUpdates(_0x4200ba,_0x393fff){return function(_0x1cb760){if(_0x1cb760){return _0x1cb760[_0x8d13('0x1c')](_0x4200ba)[_0x8d13('0x1d')](function(_0x3d2f97){return _0x3d2f97;});}return null;};}function removeEntity(_0x346c60,_0x2b6e28){return function(_0x535283){if(_0x535283){return _0x535283[_0x8d13('0x1e')]()[_0x8d13('0x1d')](function(){var _0x3c7524=_0x535283['get']({'plain':!![]});var _0x30fedc=_0x8d13('0x1f');return db[_0x8d13('0x20')][_0x8d13('0x1e')]({'where':{'type':_0x30fedc,'resourceId':_0x3c7524['id']}})[_0x8d13('0x1d')](function(){return _0x535283;});})[_0x8d13('0x1d')](function(){_0x346c60[_0x8d13('0x11')](0xcc)[_0x8d13('0x12')]();});}};}function handleEntityNotFound(_0x5c053f,_0x38f33c){return function(_0x1786b1){if(!_0x1786b1){_0x5c053f[_0x8d13('0x10')](0x194);}return _0x1786b1;};}function handleError(_0x1ed96b,_0x263375){_0x263375=_0x263375||0x1f4;return function(_0x35d5c8){logger[_0x8d13('0x21')](_0x35d5c8[_0x8d13('0x22')]);if(_0x35d5c8[_0x8d13('0x23')]){delete _0x35d5c8[_0x8d13('0x23')];}_0x1ed96b[_0x8d13('0x11')](_0x263375)[_0x8d13('0x24')](_0x35d5c8);};}exports['index']=function(_0x57fc61,_0x58e594){var _0x5f5b7b={},_0x34ed06={},_0x1f1604={'count':0x0,'rows':[]};var _0x39e8bf=db['AnalyticCustomReport'][_0x8d13('0x25')];_0x34ed06[_0x8d13('0x26')]=_[_0x8d13('0x27')](_0x39e8bf);_0x34ed06[_0x8d13('0x28')]=_[_0x8d13('0x27')](_0x57fc61[_0x8d13('0x28')]);_0x34ed06[_0x8d13('0x29')]=_[_0x8d13('0x2a')](_0x34ed06[_0x8d13('0x26')],_0x34ed06['query']);_0x5f5b7b[_0x8d13('0x2b')]=_[_0x8d13('0x2a')](_0x34ed06[_0x8d13('0x26')],qs[_0x8d13('0x2c')](_0x57fc61[_0x8d13('0x28')]['fields']));_0x5f5b7b[_0x8d13('0x2b')]=_0x5f5b7b[_0x8d13('0x2b')][_0x8d13('0x2d')]?_0x5f5b7b[_0x8d13('0x2b')]:_0x34ed06[_0x8d13('0x26')];if(!_0x57fc61[_0x8d13('0x28')][_0x8d13('0x2e')](_0x8d13('0x2f'))){_0x5f5b7b['limit']=qs[_0x8d13('0x16')](_0x57fc61[_0x8d13('0x28')][_0x8d13('0x16')]);_0x5f5b7b[_0x8d13('0x15')]=qs[_0x8d13('0x15')](_0x57fc61[_0x8d13('0x28')][_0x8d13('0x15')]);}_0x5f5b7b['order']=qs['sort'](_0x57fc61['query'][_0x8d13('0x30')]);_0x5f5b7b[_0x8d13('0x31')]=qs[_0x8d13('0x29')](_[_0x8d13('0x32')](_0x57fc61[_0x8d13('0x28')],_0x34ed06[_0x8d13('0x29')]));if(_0x57fc61[_0x8d13('0x28')][_0x8d13('0x33')]){_0x5f5b7b['where']=_['merge'](_0x5f5b7b[_0x8d13('0x31')],{'$or':_[_0x8d13('0x34')](_0x39e8bf,function(_0x4d155a){if(_0x4d155a['type'][_0x8d13('0x35')]!==_0x8d13('0x36')){var _0xccee5b={};_0xccee5b[_0x4d155a[_0x8d13('0x37')]]={'$like':'%'+_0x57fc61[_0x8d13('0x28')][_0x8d13('0x33')]+'%'};return _0xccee5b;}})});}_0x5f5b7b=_[_0x8d13('0x38')]({},_0x5f5b7b,_0x57fc61['options']);var _0xdb12c2={'where':_0x5f5b7b[_0x8d13('0x31')]};return db[_0x8d13('0x39')][_0x8d13('0x14')](_0xdb12c2)[_0x8d13('0x1d')](function(_0x38cf78){_0x1f1604['count']=_0x38cf78;if(_0x57fc61[_0x8d13('0x28')]['includeAll']){_0x5f5b7b[_0x8d13('0x3a')]=[{'all':!![]}];}return db[_0x8d13('0x39')][_0x8d13('0x3b')](_0x5f5b7b);})[_0x8d13('0x1d')](function(_0x202d85){_0x1f1604['rows']=_0x202d85;return _0x1f1604;})['then'](respondWithFilteredResult(_0x58e594,_0x5f5b7b))[_0x8d13('0x3c')](handleError(_0x58e594,null));};exports[_0x8d13('0x3d')]=function(_0x55812d,_0x458dfe){var _0x2ecc77={'raw':![],'where':{'id':_0x55812d[_0x8d13('0x3e')]['id']}},_0x5dbecc={};_0x5dbecc['model']=_[_0x8d13('0x27')](db[_0x8d13('0x39')][_0x8d13('0x25')]);_0x5dbecc['query']=_['keys'](_0x55812d[_0x8d13('0x28')]);_0x5dbecc['filters']=_[_0x8d13('0x2a')](_0x5dbecc[_0x8d13('0x26')],_0x5dbecc[_0x8d13('0x28')]);_0x2ecc77[_0x8d13('0x2b')]=_['intersection'](_0x5dbecc[_0x8d13('0x26')],qs[_0x8d13('0x2c')](_0x55812d[_0x8d13('0x28')][_0x8d13('0x2c')]));_0x2ecc77[_0x8d13('0x2b')]=_0x2ecc77[_0x8d13('0x2b')]['length']?_0x2ecc77[_0x8d13('0x2b')]:_0x5dbecc[_0x8d13('0x26')];if(_0x55812d[_0x8d13('0x28')]['includeAll']){_0x2ecc77[_0x8d13('0x3a')]=[{'all':!![]}];}_0x2ecc77=_[_0x8d13('0x38')]({},_0x2ecc77,_0x55812d['options']);return db[_0x8d13('0x39')]['find'](_0x2ecc77)['then'](handleEntityNotFound(_0x458dfe,null))[_0x8d13('0x1d')](respondWithResult(_0x458dfe,null))[_0x8d13('0x3c')](handleError(_0x458dfe,null));};exports[_0x8d13('0x3f')]=function(_0x2cd91b,_0x277cf7){return db[_0x8d13('0x39')][_0x8d13('0x3f')](_0x2cd91b[_0x8d13('0x40')],{})['then'](function(_0x5cc1f5){var _0x30df88=_0x2cd91b['user'][_0x8d13('0x41')]({'plain':!![]});if(!_0x30df88)throw new Error(_0x8d13('0x42'));if(_0x30df88[_0x8d13('0x43')]===_0x8d13('0x44')){var _0x9b5131=_0x5cc1f5[_0x8d13('0x41')]({'plain':!![]});var _0x234baa=_0x8d13('0x45');return db['UserProfileSection'][_0x8d13('0x46')]({'where':{'name':_0x234baa,'userProfileId':_0x30df88[_0x8d13('0x47')]},'raw':!![]})[_0x8d13('0x1d')](function(_0x3e31ea){if(_0x3e31ea&&_0x3e31ea['autoAssociation']===0x0){return db[_0x8d13('0x20')][_0x8d13('0x3f')]({'name':_0x9b5131['name'],'resourceId':_0x9b5131['id'],'type':_0x8d13('0x1f'),'sectionId':_0x3e31ea['id']},{})['then'](function(){return _0x5cc1f5;});}else{return _0x5cc1f5;}})[_0x8d13('0x3c')](function(_0x29a41f){logger[_0x8d13('0x21')](_0x8d13('0x48'),_0x29a41f);throw _0x29a41f;});}return _0x5cc1f5;})[_0x8d13('0x1d')](respondWithResult(_0x277cf7,0xc9))['catch'](handleError(_0x277cf7,null));};exports[_0x8d13('0x1c')]=function(_0x2ab460,_0x20514a){if(_0x2ab460[_0x8d13('0x40')]['id']){delete _0x2ab460['body']['id'];}return db[_0x8d13('0x39')][_0x8d13('0x46')]({'where':{'id':_0x2ab460['params']['id']}})['then'](handleEntityNotFound(_0x20514a,null))['then'](saveUpdates(_0x2ab460[_0x8d13('0x40')],null))[_0x8d13('0x1d')](respondWithResult(_0x20514a,null))['catch'](handleError(_0x20514a,null));};exports[_0x8d13('0x1e')]=function(_0x4e755b,_0x2f518e){return db['AnalyticCustomReport'][_0x8d13('0x46')]({'where':{'id':_0x4e755b[_0x8d13('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2f518e,null))['then'](removeEntity(_0x2f518e,null))['catch'](handleError(_0x2f518e,null));};exports[_0x8d13('0x49')]=function(_0x52b7cc,_0x3fa7b4){var _0x167ab2=0xa;var _0x766eb3=['join',_0x8d13('0x4a'),'right_join',_0x8d13('0x4b')];var _0x1577e5={'SUM':_0x8d13('0x4c'),'COUNT':_0x8d13('0x4d'),'COUNT DISTINCT':_0x8d13('0x4e'),'MAX':_0x8d13('0x4f'),'MIN':_0x8d13('0x50'),'AVG':_0x8d13('0x51'),'GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':_0x8d13('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xa6fcba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x355a18=function(_0x293087){return!_[_0x8d13('0x57')](['IS\x20NULL',_0x8d13('0x58'),_0x8d13('0x59'),_0x8d13('0x5a')],_0x293087);};var _0x447f6c=function(_0x280304){if(!_0x280304||!_0x280304['rules'][_0x8d13('0x2d')]){return'';}for(var _0x98c47='(',_0x54744b=0x0;_0x54744b<_0x280304[_0x8d13('0x5b')][_0x8d13('0x2d')];_0x54744b+=0x1){_0x54744b>0x0&&(_0x98c47+='\x20'+_0x280304[_0x8d13('0x5c')]+'\x20');_0x98c47+=_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5d')]?_0x447f6c(_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5d')]):_0x280304[_0x8d13('0x5b')][_0x54744b]['field']+'\x20'+_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5e')]+(_0x355a18(_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5e')])?'\x20'+_0x280304[_0x8d13('0x5b')][_0x54744b][_0x8d13('0x5f')]:'');}return _0x98c47+')';};var _0x4a6d41={'where':{'id':_0x52b7cc[_0x8d13('0x3e')]['id']}},_0x5c06a1,_0x47e034,_0xeb7b01,_0x518ab3,_0x39e59c;_0x4a6d41=_[_0x8d13('0x38')]({},_0x4a6d41,_0x52b7cc[_0x8d13('0x60')]);return db['AnalyticCustomReport'][_0x8d13('0x46')](_0x4a6d41)[_0x8d13('0x1d')](function(_0x520d36){if(_0x520d36){_0x5c06a1=_0x520d36;return _0x520d36[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0xfc6856){if(_0xfc6856){if(!_0xfc6856[_0x8d13('0x2d')]){throw new db[(_0x8d13('0x62'))][(_0x8d13('0x63'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x47e034=_0xfc6856;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x56b322){if(_0x56b322){_0xeb7b01=_[_0x8d13('0x65')](_0x56b322,'id');var _0x5b2a18;var _0x553115=squel[_0x8d13('0x66')]();_0x553115[_0x8d13('0x67')](_0x5c06a1[_0x8d13('0x68')]);for(var _0x4853d6=0x0;_0x4853d6<_0x47e034[_0x8d13('0x2d')];_0x4853d6+=0x1){_0x5b2a18=_0x47e034[_0x4853d6]['MetricId']?_0xeb7b01[_0x47e034[_0x4853d6][_0x8d13('0x69')]][_0x8d13('0x6a')]:_0x47e034[_0x4853d6]['field'];_0x5b2a18=_0x47e034[_0x4853d6][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0x1577e5[_0x47e034[_0x4853d6][_0x8d13('0x6b')]],'%s',_0x5b2a18):_0x5b2a18;_0x5b2a18=_0x47e034[_0x4853d6][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0xa6fcba[_0x47e034[_0x4853d6][_0x8d13('0x6d')]],'%s',_0x5b2a18):_0x5b2a18;if(_0x47e034[_0x4853d6][_0x8d13('0x6e')]){_0x553115[_0x8d13('0x5d')](_0x5b2a18);}_0x47e034[_0x4853d6][_0x8d13('0x6f')]&&_0x553115['order'](_0x5b2a18,_0x47e034[_0x4853d6][_0x8d13('0x6f')]===_0x8d13('0x70')?![]:!![]);_0x553115[_0x8d13('0x37')](_0x5b2a18,_0x47e034[_0x4853d6][_0x8d13('0x71')]||_0x5b2a18);}if(_0x5c06a1[_0x8d13('0x72')]){_0x5c06a1[_0x8d13('0x72')]=JSON[_0x8d13('0x73')](_0x5c06a1[_0x8d13('0x72')]);for(var _0x3d9541=0x0;_0x3d9541<_0x5c06a1[_0x8d13('0x72')][_0x8d13('0x2d')];_0x3d9541+=0x1){if(_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x74')]&&_[_0x8d13('0x57')](_0x766eb3,_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x74')])&&_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x75')]&&_0x5c06a1['joins'][_0x3d9541][_0x8d13('0x76')]&&_0x5c06a1['joins'][_0x3d9541]['foreignKey']){_0x553115[_0x5c06a1['joins'][_0x3d9541][_0x8d13('0x74')]](_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x76')],null,util['format'](_0x8d13('0x77'),_0x5c06a1[_0x8d13('0x68')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x75')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541][_0x8d13('0x76')],_0x5c06a1[_0x8d13('0x72')][_0x3d9541]['foreignKey']));}}}if(_0x5c06a1['conditions']){_0x5c06a1['conditions']=JSON[_0x8d13('0x73')](_0x5c06a1[_0x8d13('0x78')]);_0x553115[_0x8d13('0x31')](_0x447f6c(_0x5c06a1[_0x8d13('0x78')][_0x8d13('0x5d')]));}_0x39e59c=_0x553115[_0x8d13('0x79')]();_0x553115['limit'](_0x167ab2);_0x553115[_0x8d13('0x15')](0x0);logger['debug'](_0x8d13('0x7a'),_0x553115['toString']());return db[_0x8d13('0x7b')]['query'](_0x553115['toString'](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});}})[_0x8d13('0x1d')](respondWithResult(_0x3fa7b4,null))['catch'](handleError(_0x3fa7b4,null));};function runReport(_0x521749,_0x4fffc7,_0x3b7df8){var _0x5d2abb=_0x4fffc7['name'];var _0x373bff=0xa;var _0x2ae6a7=['join','left_join',_0x8d13('0x7e'),_0x8d13('0x4b')];var _0x70886b={'SUM':_0x8d13('0x4c'),'COUNT':_0x8d13('0x4d'),'COUNT DISTINCT':_0x8d13('0x4e'),'MAX':_0x8d13('0x4f'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8d13('0x7f')};var _0x1bca49={'SEC_TO_TIME':_0x8d13('0x80'),'DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':_0x8d13('0x81')};var _0x3e90e7=function(_0x3579e8){return!_['includes']([_0x8d13('0x82'),'IS\x20NOT\x20NULL',_0x8d13('0x59'),_0x8d13('0x5a')],_0x3579e8);};var _0x533850=function(_0x43722f){if(!_0x43722f||!_0x43722f[_0x8d13('0x5b')][_0x8d13('0x2d')]){return'';}for(var _0x451b68='(',_0x441f08=0x0;_0x441f08<_0x43722f[_0x8d13('0x5b')]['length'];_0x441f08+=0x1){_0x441f08>0x0&&(_0x451b68+='\x20'+_0x43722f[_0x8d13('0x5c')]+'\x20');_0x451b68+=_0x43722f['rules'][_0x441f08][_0x8d13('0x5d')]?_0x533850(_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x5d')]):_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x37')]+'\x20'+_0x43722f[_0x8d13('0x5b')][_0x441f08]['condition']+(_0x3e90e7(_0x43722f[_0x8d13('0x5b')][_0x441f08][_0x8d13('0x5e')])?'\x20'+_0x43722f[_0x8d13('0x5b')][_0x441f08]['value']:'');}return _0x451b68+')';};var _0x455d98={'where':{'id':_0x521749['id']}},_0x4a5992,_0x4c6e7b,_0x4d10e5,_0xa0eb24,_0x15996c;_0x455d98=_[_0x8d13('0x38')]({},_0x455d98,_0x3b7df8);return db[_0x8d13('0x39')][_0x8d13('0x46')](_0x455d98)['then'](function(_0x195fa7){if(_0x195fa7){_0x4a5992=_0x195fa7;return _0x195fa7[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0x7b5c7e){if(_0x7b5c7e){if(!_0x7b5c7e[_0x8d13('0x2d')]){throw new db[(_0x8d13('0x62'))]['ValidationErrorItem'](_0x8d13('0x83'),0x193);}_0x4c6e7b=_0x7b5c7e;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x5c6f54){if(_0x5c6f54){_0x4d10e5=_[_0x8d13('0x65')](_0x5c6f54,'id');var _0x385d66;var _0x1fad58=squel[_0x8d13('0x66')]();_0x1fad58['from'](_0x4a5992[_0x8d13('0x68')]);for(var _0x159677=0x0;_0x159677<_0x4c6e7b['length'];_0x159677+=0x1){_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x69')]?_0x4d10e5[_0x4c6e7b[_0x159677]['MetricId']][_0x8d13('0x6a')]:_0x4c6e7b[_0x159677][_0x8d13('0x37')];_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0x70886b[_0x4c6e7b[_0x159677][_0x8d13('0x6b')]],'%s',_0x385d66):_0x385d66;_0x385d66=_0x4c6e7b[_0x159677][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0x1bca49[_0x4c6e7b[_0x159677][_0x8d13('0x6d')]],'%s',_0x385d66):_0x385d66;if(_0x4c6e7b[_0x159677][_0x8d13('0x6e')]){_0x1fad58[_0x8d13('0x5d')](_0x385d66);}_0x4c6e7b[_0x159677][_0x8d13('0x6f')]&&_0x1fad58['order'](_0x385d66,_0x4c6e7b[_0x159677][_0x8d13('0x6f')]===_0x8d13('0x70')?![]:!![]);_0x1fad58[_0x8d13('0x37')](_0x385d66,_0x4c6e7b[_0x159677][_0x8d13('0x71')]||_0x385d66);}if(_0x4a5992[_0x8d13('0x72')]){_0x4a5992['joins']=JSON[_0x8d13('0x73')](_0x4a5992[_0x8d13('0x72')]);for(var _0xf62966=0x0;_0xf62966<_0x4a5992[_0x8d13('0x72')]['length'];_0xf62966+=0x1){if(_0x4a5992['joins'][_0xf62966][_0x8d13('0x74')]&&_[_0x8d13('0x57')](_0x2ae6a7,_0x4a5992[_0x8d13('0x72')][_0xf62966][_0x8d13('0x74')])&&_0x4a5992['joins'][_0xf62966][_0x8d13('0x75')]&&_0x4a5992['joins'][_0xf62966][_0x8d13('0x76')]&&_0x4a5992[_0x8d13('0x72')][_0xf62966]['foreignKey']){_0x1fad58[_0x4a5992[_0x8d13('0x72')][_0xf62966]['type']](_0x4a5992[_0x8d13('0x72')][_0xf62966]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4a5992[_0x8d13('0x68')],_0x4a5992[_0x8d13('0x72')][_0xf62966]['parentKey'],_0x4a5992[_0x8d13('0x72')][_0xf62966][_0x8d13('0x76')],_0x4a5992['joins'][_0xf62966][_0x8d13('0x84')]));}}}if(_0x4a5992['conditions']){_0x4a5992[_0x8d13('0x78')]=JSON[_0x8d13('0x73')](_0x4a5992[_0x8d13('0x78')]);_0x1fad58['where'](_0x533850(_0x4a5992['conditions'][_0x8d13('0x5d')]));}_0x15996c=_0x1fad58['clone']();_0x1fad58['limit'](_0x373bff);_0x1fad58[_0x8d13('0x15')](0x0);logger[_0x8d13('0x85')](_0x8d13('0x7a'),_0x1fad58[_0x8d13('0x86')]());return db[_0x8d13('0x7b')][_0x8d13('0x28')](_0x1fad58[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});}})[_0x8d13('0x1d')](function(_0x43b56a){if(!_0x43b56a[_0x8d13('0x2d')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8d13('0x87'),0xcc);}if(_0x4fffc7[_0x8d13('0x88')]===_0x8d13('0x89')){return null;}var _0x34b8f9=_[_0x8d13('0x38')](_0x4fffc7,{'name':_0x4fffc7['fullPath']||_0x4fffc7[_0x8d13('0x23')]||_0x4a5992[_0x8d13('0x23')],'basename':_0x5d2abb,'savename':util[_0x8d13('0x6d')](_0x8d13('0x8a'),_0x4fffc7[_0x8d13('0x23')]||_0x4a5992[_0x8d13('0x23')],require(_0x8d13('0x8b'))['generate'](0x4),_0x4fffc7[_0x8d13('0x88')]||_0x8d13('0x8c')),'reportId':_0x4a5992['id'],'reportType':'custom'});return db[_0x8d13('0x8d')][_0x8d13('0x3f')](_0x34b8f9,{'raw':!![]});})['then'](function(_0x8d944){if(_0x4a5992[_0x8d13('0x68')]===_0x8d13('0x8e')){_0x15996c[_0x8d13('0x31')](_0x4a5992[_0x8d13('0x68')]+_0x8d13('0x8f'),_0x4fffc7[_0x8d13('0x90')],_0x4fffc7['endDate']);}else{_0x15996c['where'](_0x4a5992[_0x8d13('0x68')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4fffc7[_0x8d13('0x90')],_0x4fffc7['endDate']);}if(_0x8d944){logger[_0x8d13('0x91')](_0x8d13('0x92'),_0x15996c[_0x8d13('0x86')]());require(_0x8d13('0x93'))['fork'](path[_0x8d13('0x94')](__dirname,_0x8d13('0x95'),_0x8d944[_0x8d13('0x88')]),[_0x8d944['id'],_0x15996c['toString'](),path[_0x8d13('0x94')](__dirname,_0x8d13('0x96'),_0x8d944['savename']),_0x5d2abb]);return _0x8d944;}else{var _0x5d8e35=squel[_0x8d13('0x66')]();_0x5d8e35[_0x8d13('0x67')]('('+_0x15996c[_0x8d13('0x86')]()+')',_0x8d13('0x97'));_0x5d8e35['field'](_0x8d13('0x98'),_0x8d13('0x14'));_0x15996c[_0x8d13('0x16')](_0x4fffc7[_0x8d13('0x16')]||_0x373bff);_0x15996c[_0x8d13('0x15')](_0x4fffc7[_0x8d13('0x15')]||0x0);return db[_0x8d13('0x7b')]['query'](_0x5d8e35[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')]['SELECT']})[_0x8d13('0x1d')](function(_0x43f795){if(!_0x43f795['length']){_0xa0eb24=0x0;}else{_0xa0eb24=_0x43f795[0x0][_0x8d13('0x14')]||0x0;}return db[_0x8d13('0x7b')][_0x8d13('0x28')](_0x15996c[_0x8d13('0x86')](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')][_0x8d13('0x7d')]});})[_0x8d13('0x1d')](function(_0x5aa381){return{'rows':_0x5aa381||[],'count':_0xa0eb24};});}});}exports[_0x8d13('0x99')]=function(_0x4da895,_0x3aedbd){return runReport(_0x4da895[_0x8d13('0x3e')],_0x4da895[_0x8d13('0x28')],_0x4da895['options'])['then'](respondWithResult(_0x3aedbd,null))[_0x8d13('0x3c')](handleError(_0x3aedbd,null));};exports['runReport']=runReport;exports[_0x8d13('0x28')]=function(_0x41a5fa,_0xa2c8e3){var _0x5edc34=0xa;var _0xa68281=['join',_0x8d13('0x4a'),'right_join',_0x8d13('0x4b')];var _0xab5f5b={'SUM':_0x8d13('0x4c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8d13('0x4f'),'MIN':_0x8d13('0x50'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8d13('0x52'),'GROUP_CONCAT ASC':_0x8d13('0x53'),'GROUP_CONCAT DESC':_0x8d13('0x7f')};var _0x102aec={'SEC_TO_TIME':_0x8d13('0x80'),'DATE':_0x8d13('0x54'),'HOUR':_0x8d13('0x55'),'ROUND':_0x8d13('0x56'),'UNIX_TIMESTAMP':_0x8d13('0x81')};var _0x332a44=function(_0x4d5bc1){return!_[_0x8d13('0x57')](['IS\x20NULL',_0x8d13('0x58'),_0x8d13('0x59'),_0x8d13('0x5a')],_0x4d5bc1);};var _0x56708c=function(_0x11273f){if(!_0x11273f||!_0x11273f[_0x8d13('0x5b')][_0x8d13('0x2d')]){return'';}for(var _0x1bf20c='(',_0x2c7322=0x0;_0x2c7322<_0x11273f['rules'][_0x8d13('0x2d')];_0x2c7322+=0x1){_0x2c7322>0x0&&(_0x1bf20c+='\x20'+_0x11273f['operator']+'\x20');_0x1bf20c+=_0x11273f['rules'][_0x2c7322][_0x8d13('0x5d')]?_0x56708c(_0x11273f[_0x8d13('0x5b')][_0x2c7322]['group']):_0x11273f[_0x8d13('0x5b')][_0x2c7322]['field']+'\x20'+_0x11273f[_0x8d13('0x5b')][_0x2c7322][_0x8d13('0x5e')]+(_0x332a44(_0x11273f[_0x8d13('0x5b')][_0x2c7322][_0x8d13('0x5e')])?'\x20'+_0x11273f[_0x8d13('0x5b')][_0x2c7322]['value']:'');}return _0x1bf20c+')';};var _0x7b277a={'where':{'id':_0x41a5fa[_0x8d13('0x3e')]['id']}},_0x36e02c,_0x55f958,_0x548b17,_0x2c053d,_0x101c28;_0x7b277a=_[_0x8d13('0x38')]({},_0x7b277a,_0x41a5fa[_0x8d13('0x60')]);return db[_0x8d13('0x39')][_0x8d13('0x46')](_0x7b277a)[_0x8d13('0x1d')](function(_0x371fb9){if(_0x371fb9){_0x36e02c=_0x371fb9;return _0x371fb9[_0x8d13('0x61')]();}return null;})[_0x8d13('0x1d')](function(_0x17ce4c){if(_0x17ce4c){if(!_0x17ce4c[_0x8d13('0x2d')]){throw new db['Sequelize'][(_0x8d13('0x63'))](_0x8d13('0x83'),0x193);}_0x55f958=_0x17ce4c;return db[_0x8d13('0x64')][_0x8d13('0x3b')]({'raw':!![]});}return null;})[_0x8d13('0x1d')](function(_0x6faaf4){if(_0x6faaf4){_0x548b17=_[_0x8d13('0x65')](_0x6faaf4,'id');var _0x46a3e6;var _0x45d9f7=squel[_0x8d13('0x66')]();_0x45d9f7[_0x8d13('0x67')](_0x36e02c[_0x8d13('0x68')]);for(var _0x4461a6=0x0;_0x4461a6<_0x55f958[_0x8d13('0x2d')];_0x4461a6+=0x1){_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x69')]?_0x548b17[_0x55f958[_0x4461a6]['MetricId']][_0x8d13('0x6a')]:_0x55f958[_0x4461a6]['field'];_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x6b')]?_[_0x8d13('0x6c')](_0xab5f5b[_0x55f958[_0x4461a6][_0x8d13('0x6b')]],'%s',_0x46a3e6):_0x46a3e6;_0x46a3e6=_0x55f958[_0x4461a6][_0x8d13('0x6d')]?_[_0x8d13('0x6c')](_0x102aec[_0x55f958[_0x4461a6][_0x8d13('0x6d')]],'%s',_0x46a3e6):_0x46a3e6;if(_0x55f958[_0x4461a6]['groupBy']){_0x45d9f7[_0x8d13('0x5d')](_0x46a3e6);}_0x55f958[_0x4461a6][_0x8d13('0x6f')]&&_0x45d9f7[_0x8d13('0x9a')](_0x46a3e6,_0x55f958[_0x4461a6][_0x8d13('0x6f')]==='DESC'?![]:!![]);_0x45d9f7[_0x8d13('0x37')](_0x46a3e6,_0x55f958[_0x4461a6][_0x8d13('0x71')]||_0x46a3e6);}if(_0x36e02c[_0x8d13('0x72')]){_0x36e02c['joins']=JSON[_0x8d13('0x73')](_0x36e02c[_0x8d13('0x72')]);for(var _0x3491e0=0x0;_0x3491e0<_0x36e02c[_0x8d13('0x72')][_0x8d13('0x2d')];_0x3491e0+=0x1){if(_0x36e02c[_0x8d13('0x72')][_0x3491e0]['type']&&_[_0x8d13('0x57')](_0xa68281,_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x74')])&&_0x36e02c['joins'][_0x3491e0][_0x8d13('0x75')]&&_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x76')]&&_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x84')]){_0x45d9f7[_0x36e02c[_0x8d13('0x72')][_0x3491e0][_0x8d13('0x74')]](_0x36e02c[_0x8d13('0x72')][_0x3491e0]['foreignTable'],null,util[_0x8d13('0x6d')](_0x8d13('0x77'),_0x36e02c[_0x8d13('0x68')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x75')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x76')],_0x36e02c['joins'][_0x3491e0][_0x8d13('0x84')]));}}}if(_0x36e02c['conditions']){_0x36e02c[_0x8d13('0x78')]=JSON[_0x8d13('0x73')](_0x36e02c[_0x8d13('0x78')]);_0x45d9f7[_0x8d13('0x31')](_0x56708c(_0x36e02c[_0x8d13('0x78')][_0x8d13('0x5d')]));}_0x101c28=_0x45d9f7[_0x8d13('0x79')]();_0x45d9f7[_0x8d13('0x16')](_0x5edc34);_0x45d9f7[_0x8d13('0x15')](0x0);logger[_0x8d13('0x85')]('Limited\x20Query:',_0x45d9f7['toString']());return db[_0x8d13('0x7b')]['query'](_0x45d9f7['toString'](),{'type':db[_0x8d13('0x7b')][_0x8d13('0x7c')]['SELECT']});}})[_0x8d13('0x1d')](function(){return{'sql':_0x101c28['toString']()};})[_0x8d13('0x1d')](respondWithResult(_0xa2c8e3,null))['catch'](handleError(_0xa2c8e3,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 11adfd7..6b8aa01 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 _0x885d=['analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x885d,0x83));var _0xd885=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x885d[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0xd885('0x0'));var util=require('util');var logger=require(_0xd885('0x1'))(_0xd885('0x2'));var moment=require(_0xd885('0x3'));var BPromise=require(_0xd885('0x4'));var rp=require(_0xd885('0x5'));var fs=require('fs');var path=require(_0xd885('0x6'));var rimraf=require('rimraf');var config=require(_0xd885('0x7'));var attributes=require(_0xd885('0x8'));module[_0xd885('0x9')]=function(_0x5359e3,_0x42d854){return _0x5359e3[_0xd885('0xa')](_0xd885('0xb'),attributes,{'tableName':_0xd885('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd3=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b71c6,_0x5ce7e4){var _0x493849=function(_0x199bd3){while(--_0x199bd3){_0x1b71c6['push'](_0x1b71c6['shift']());}};_0x493849(++_0x5ce7e4);}(_0xcdd3,0x124));var _0x3cdd=function(_0xa4ffee,_0x4f2da7){_0xa4ffee=_0xa4ffee-0x0;var _0x36e0a8=_0xcdd3[_0xa4ffee];return _0x36e0a8;};'use strict';var _=require(_0x3cdd('0x0'));var util=require(_0x3cdd('0x1'));var logger=require(_0x3cdd('0x2'))(_0x3cdd('0x3'));var moment=require(_0x3cdd('0x4'));var BPromise=require(_0x3cdd('0x5'));var rp=require(_0x3cdd('0x6'));var fs=require('fs');var path=require(_0x3cdd('0x7'));var rimraf=require(_0x3cdd('0x8'));var config=require(_0x3cdd('0x9'));var attributes=require(_0x3cdd('0xa'));module[_0x3cdd('0xb')]=function(_0x471540,_0x26763b){return _0x471540[_0x3cdd('0xc')](_0x3cdd('0xd'),attributes,{'tableName':_0x3cdd('0xe'),'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 b0f8f7d..1bf2ba1 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5eaa8a,_0x396d27){var _0x558bc8=function(_0x38e99d){while(--_0x38e99d){_0x5eaa8a['push'](_0x5eaa8a['shift']());}};_0x558bc8(++_0x396d27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\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(_0xaf0dd7,_0x12a87a){var _0x5092bd=function(_0xc19214){while(--_0xc19214){_0xaf0dd7['push'](_0xaf0dd7['shift']());}};_0x5092bd(++_0x12a87a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 4254221..a36050f 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 _0x7d25=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','/:id','isAuthenticated','show','get','/:id/run','/:id/query','query','post'];(function(_0x60a460,_0x56522e){var _0x44c085=function(_0x3ae18b){while(--_0x3ae18b){_0x60a460['push'](_0x60a460['shift']());}};_0x44c085(++_0x56522e);}(_0x7d25,0x8a));var _0x57d2=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7d25[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0x57d2('0x0'));var path=require(_0x57d2('0x1'));var timeout=require(_0x57d2('0x2'));var express=require(_0x57d2('0x3'));var router=express[_0x57d2('0x4')]();var auth=require(_0x57d2('0x5'));var interaction=require(_0x57d2('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x57d2('0x7')]);router['get'](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0xa')]);router['get']('/:id/preview',auth[_0x57d2('0x9')](),controller['preview']);router[_0x57d2('0xb')](_0x57d2('0xc'),auth[_0x57d2('0x9')](),controller['run']);router[_0x57d2('0xb')](_0x57d2('0xd'),auth[_0x57d2('0x9')](),controller[_0x57d2('0xe')]);router[_0x57d2('0xf')]('/',auth[_0x57d2('0x9')](),controller[_0x57d2('0x10')]);router[_0x57d2('0x11')](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0x12')]);router[_0x57d2('0x13')](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0x14')]);module[_0x57d2('0x15')]=router; \ No newline at end of file +var _0xbbbc=['../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x602096,_0x37efbd){_0x602096=_0x602096-0x0;var _0x277084=_0xbbbc[_0x602096];return _0x277084;};'use strict';var multer=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var timeout=require(_0xcbbb('0x3'));var express=require(_0xcbbb('0x4'));var router=express[_0xcbbb('0x5')]();var auth=require(_0xcbbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcbbb('0x7'));var controller=require(_0xcbbb('0x8'));router[_0xcbbb('0x9')]('/',auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xb')]);router['get'](_0xcbbb('0xc'),auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xd')]);router[_0xcbbb('0x9')](_0xcbbb('0xe'),auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xf')]);router['get'](_0xcbbb('0x10'),auth['isAuthenticated'](),controller['run']);router[_0xcbbb('0x9')]('/:id/query',auth[_0xcbbb('0xa')](),controller['query']);router[_0xcbbb('0x11')]('/',auth[_0xcbbb('0xa')](),controller['create']);router[_0xcbbb('0x12')]('/:id',auth[_0xcbbb('0xa')](),controller['update']);router[_0xcbbb('0x13')](_0xcbbb('0xc'),auth[_0xcbbb('0xa')](),controller['destroy']);module[_0xcbbb('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5da2279..aa4f963 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 _0x3009=['exports','STRING','TEXT','sequelize'];(function(_0xb93836,_0x2e7941){var _0x2b3e5b=function(_0x56d0a4){while(--_0x56d0a4){_0xb93836['push'](_0xb93836['shift']());}};_0x2b3e5b(++_0x2e7941);}(_0x3009,0x17f));var _0x9300=function(_0x541d85,_0x847ff1){_0x541d85=_0x541d85-0x0;var _0x217bba=_0x3009[_0x541d85];return _0x217bba;};'use strict';var Sequelize=require(_0x9300('0x0'));module[_0x9300('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9300('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x9300('0x2')]},'conditions':{'type':Sequelize[_0x9300('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb34d=['exports','STRING','TEXT'];(function(_0x188762,_0x5d5da1){var _0x5c849b=function(_0x526396){while(--_0x526396){_0x188762['push'](_0x188762['shift']());}};_0x5c849b(++_0x5d5da1);}(_0xb34d,0x11d));var _0xdb34=function(_0x5cf274,_0x590c70){_0x5cf274=_0x5cf274-0x0;var _0x2c3569=_0xb34d[_0x5cf274];return _0x2c3569;};'use strict';var Sequelize=require('sequelize');module[_0xdb34('0x0')]={'name':{'type':Sequelize[_0xdb34('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdb34('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xdb34('0x1')]},'conditions':{'type':Sequelize[_0xdb34('0x2')]},'joins':{'type':Sequelize[_0xdb34('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d441115..4cbd840 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 _0x5947=['joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','toString','sequelize','QueryTypes','right_join','UNIX_TIMESTAMP(%s)','condition','getFields','AnalyticMetric','keyBy','MetricId','metric','alias','parse','clone','SELECT','No\x20available\x20data','randomstring','generate','output','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','join','../../components/export/','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','Limited\x20Query:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','index','AnalyticDefaultReport','rawAttributes','keys','filters','intersection','attributes','model','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','replace','function','format','groupBy','orderBy','DESC'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x5947,0x16e));var _0x7594=function(_0x3abab5,_0x517ed1){_0x3abab5=_0x3abab5-0x0;var _0x16b442=_0x5947[_0x3abab5];return _0x16b442;};'use strict';var pdf=require(_0x7594('0x0'));var emlformat=require(_0x7594('0x1'));var rimraf=require(_0x7594('0x2'));var zipdir=require(_0x7594('0x3'));var jsonpatch=require(_0x7594('0x4'));var rp=require(_0x7594('0x5'));var moment=require(_0x7594('0x6'));var BPromise=require(_0x7594('0x7'));var Mustache=require(_0x7594('0x8'));var util=require(_0x7594('0x9'));var path=require(_0x7594('0xa'));var sox=require(_0x7594('0xb'));var csv=require(_0x7594('0xc'));var ejs=require(_0x7594('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7594('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7594('0xf'));var toCsv=require(_0x7594('0xc'));var querystring=require(_0x7594('0x10'));var Papa=require(_0x7594('0x11'));var Redis=require(_0x7594('0x12'));var authService=require(_0x7594('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7594('0x14'));var logger=require(_0x7594('0x15'))('api');var utils=require(_0x7594('0x16'));var config=require('../../config/environment');var db=require(_0x7594('0x17'))['db'];function respondWithStatusCode(_0x361622,_0x26584c){_0x26584c=_0x26584c||0xcc;return function(_0x20eb05){if(_0x20eb05){return _0x361622[_0x7594('0x18')](_0x26584c);}return _0x361622[_0x7594('0x19')](_0x26584c)[_0x7594('0x1a')]();};}function respondWithResult(_0x28e909,_0x26db53){_0x26db53=_0x26db53||0xc8;return function(_0x312880){if(_0x312880){return _0x28e909[_0x7594('0x19')](_0x26db53)[_0x7594('0x1b')](_0x312880);}};}function respondWithFilteredResult(_0x540ad2,_0x44d6d9){return function(_0x15fcac){if(_0x15fcac){var _0x5a7968=_0x15fcac[_0x7594('0x1c')],_0x5e248b=_0x44d6d9[_0x7594('0x1d')],_0x45e12e=_0x44d6d9['offset']+_0x44d6d9[_0x7594('0x1e')],_0x44306;if(_0x45e12e>=_0x5a7968){_0x45e12e=_0x5a7968;_0x44306=0xc8;}else{_0x44306=0xce;}_0x540ad2[_0x7594('0x19')](_0x44306);return _0x540ad2[_0x7594('0x1f')](_0x7594('0x20'),_0x5e248b+'-'+_0x45e12e+'/'+_0x5a7968)['json'](_0x15fcac);}return null;};}function patchUpdates(_0x298685){return function(_0x5b8c2b){try{jsonpatch[_0x7594('0x21')](_0x5b8c2b,_0x298685,!![]);}catch(_0x5ee0dd){return BPromise['reject'](_0x5ee0dd);}return _0x5b8c2b[_0x7594('0x22')]();};}function saveUpdates(_0x4e1ba5,_0x1dd800){return function(_0x174cb5){if(_0x174cb5){return _0x174cb5[_0x7594('0x23')](_0x4e1ba5)[_0x7594('0x24')](function(_0x3aaf4f){return _0x3aaf4f;});}return null;};}function removeEntity(_0x90a8e8,_0x385b1b){return function(_0x1b0ad4){if(_0x1b0ad4){return _0x1b0ad4['destroy']()[_0x7594('0x24')](function(){var _0x2600ec=_0x1b0ad4[_0x7594('0x25')]({'plain':!![]});var _0x5bf6a6=_0x7594('0x26');return db[_0x7594('0x27')][_0x7594('0x28')]({'where':{'type':_0x5bf6a6,'resourceId':_0x2600ec['id']}})[_0x7594('0x24')](function(){return _0x1b0ad4;});})[_0x7594('0x24')](function(){_0x90a8e8[_0x7594('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e73db,_0x538961){return function(_0x53f248){if(!_0x53f248){_0x1e73db['sendStatus'](0x194);}return _0x53f248;};}function handleError(_0x5ab31f,_0x5b5b6e){_0x5b5b6e=_0x5b5b6e||0x1f4;return function(_0x4b7165){logger[_0x7594('0x29')](_0x4b7165[_0x7594('0x2a')]);if(_0x4b7165[_0x7594('0x2b')]){delete _0x4b7165['name'];}_0x5ab31f[_0x7594('0x19')](_0x5b5b6e)['send'](_0x4b7165);};}exports[_0x7594('0x2c')]=function(_0x26b1c0,_0x2ef8d8){var _0x42e9bd={},_0x45a19a={},_0x2b0c84={'count':0x0,'rows':[]};var _0x49089a=db[_0x7594('0x2d')][_0x7594('0x2e')];_0x45a19a['model']=_['keys'](_0x49089a);_0x45a19a['query']=_[_0x7594('0x2f')](_0x26b1c0['query']);_0x45a19a[_0x7594('0x30')]=_[_0x7594('0x31')](_0x45a19a['model'],_0x45a19a['query']);_0x42e9bd[_0x7594('0x32')]=_[_0x7594('0x31')](_0x45a19a[_0x7594('0x33')],qs[_0x7594('0x34')](_0x26b1c0[_0x7594('0x35')][_0x7594('0x34')]));_0x42e9bd[_0x7594('0x32')]=_0x42e9bd[_0x7594('0x32')]['length']?_0x42e9bd[_0x7594('0x32')]:_0x45a19a[_0x7594('0x33')];if(!_0x26b1c0[_0x7594('0x35')][_0x7594('0x36')](_0x7594('0x37'))){_0x42e9bd[_0x7594('0x1e')]=qs['limit'](_0x26b1c0[_0x7594('0x35')][_0x7594('0x1e')]);_0x42e9bd[_0x7594('0x1d')]=qs['offset'](_0x26b1c0[_0x7594('0x35')]['offset']);}_0x42e9bd[_0x7594('0x38')]=qs[_0x7594('0x39')](_0x26b1c0['query'][_0x7594('0x39')]);_0x42e9bd[_0x7594('0x3a')]=qs[_0x7594('0x30')](_[_0x7594('0x3b')](_0x26b1c0[_0x7594('0x35')],_0x45a19a[_0x7594('0x30')]));if(_0x26b1c0[_0x7594('0x35')][_0x7594('0x3c')]){_0x42e9bd[_0x7594('0x3a')]=_[_0x7594('0x3d')](_0x42e9bd[_0x7594('0x3a')],{'$or':_[_0x7594('0x3e')](_0x49089a,function(_0x171078){if(_0x171078[_0x7594('0x3f')]['key']!=='VIRTUAL'){var _0x85b159={};_0x85b159[_0x171078[_0x7594('0x40')]]={'$like':'%'+_0x26b1c0[_0x7594('0x35')][_0x7594('0x3c')]+'%'};return _0x85b159;}})});}_0x42e9bd=_['merge']({},_0x42e9bd,_0x26b1c0[_0x7594('0x41')]);var _0x5264c2={'where':_0x42e9bd[_0x7594('0x3a')]};return db[_0x7594('0x2d')][_0x7594('0x1c')](_0x5264c2)[_0x7594('0x24')](function(_0xc5223c){_0x2b0c84[_0x7594('0x1c')]=_0xc5223c;if(_0x26b1c0[_0x7594('0x35')][_0x7594('0x42')]){_0x42e9bd[_0x7594('0x43')]=[{'all':!![]}];}return db[_0x7594('0x2d')][_0x7594('0x44')](_0x42e9bd);})['then'](function(_0x37780f){_0x2b0c84[_0x7594('0x45')]=_0x37780f;return _0x2b0c84;})['then'](respondWithFilteredResult(_0x2ef8d8,_0x42e9bd))[_0x7594('0x46')](handleError(_0x2ef8d8,null));};exports[_0x7594('0x47')]=function(_0x434c25,_0x1a4291){var _0x8b8f34={'raw':!![],'where':{'id':_0x434c25[_0x7594('0x48')]['id']}},_0x2aa835={};_0x2aa835['model']=_[_0x7594('0x2f')](db[_0x7594('0x2d')]['rawAttributes']);_0x2aa835[_0x7594('0x35')]=_['keys'](_0x434c25['query']);_0x2aa835[_0x7594('0x30')]=_['intersection'](_0x2aa835[_0x7594('0x33')],_0x2aa835['query']);_0x8b8f34[_0x7594('0x32')]=_[_0x7594('0x31')](_0x2aa835[_0x7594('0x33')],qs[_0x7594('0x34')](_0x434c25['query']['fields']));_0x8b8f34['attributes']=_0x8b8f34[_0x7594('0x32')][_0x7594('0x49')]?_0x8b8f34['attributes']:_0x2aa835[_0x7594('0x33')];if(_0x434c25[_0x7594('0x35')][_0x7594('0x42')]){_0x8b8f34['include']=[{'all':!![]}];}_0x8b8f34=_[_0x7594('0x3d')]({},_0x8b8f34,_0x434c25[_0x7594('0x41')]);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x8b8f34)['then'](handleEntityNotFound(_0x1a4291,null))['then'](respondWithResult(_0x1a4291,null))[_0x7594('0x46')](handleError(_0x1a4291,null));};exports[_0x7594('0x4b')]=function(_0x3563b9,_0x344510){return db[_0x7594('0x2d')][_0x7594('0x4b')](_0x3563b9['body'],{})[_0x7594('0x24')](function(_0xcf3821){var _0x1f47a0=_0x3563b9[_0x7594('0x4c')][_0x7594('0x25')]({'plain':!![]});if(!_0x1f47a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f47a0[_0x7594('0x4d')]===_0x7594('0x4c')){var _0x123656=_0xcf3821['get']({'plain':!![]});var _0x3ee159='Reports';return db[_0x7594('0x4e')][_0x7594('0x4a')]({'where':{'name':_0x3ee159,'userProfileId':_0x1f47a0['userProfileId']},'raw':!![]})[_0x7594('0x24')](function(_0xe4a086){if(_0xe4a086&&_0xe4a086[_0x7594('0x4f')]===0x0){return db[_0x7594('0x27')][_0x7594('0x4b')]({'name':_0x123656[_0x7594('0x2b')],'resourceId':_0x123656['id'],'type':_0x7594('0x26'),'sectionId':_0xe4a086['id']},{})[_0x7594('0x24')](function(){return _0xcf3821;});}else{return _0xcf3821;}})[_0x7594('0x46')](function(_0x4abd8f){logger['error'](_0x7594('0x50'),_0x4abd8f);throw _0x4abd8f;});}return _0xcf3821;})[_0x7594('0x24')](respondWithResult(_0x344510,0xc9))[_0x7594('0x46')](handleError(_0x344510,null));};exports[_0x7594('0x23')]=function(_0x498267,_0x2423c7){if(_0x498267['body']['id']){delete _0x498267['body']['id'];}return db[_0x7594('0x2d')][_0x7594('0x4a')]({'where':{'id':_0x498267[_0x7594('0x48')]['id']}})[_0x7594('0x24')](handleEntityNotFound(_0x2423c7,null))['then'](saveUpdates(_0x498267[_0x7594('0x51')],null))[_0x7594('0x24')](respondWithResult(_0x2423c7,null))[_0x7594('0x46')](handleError(_0x2423c7,null));};exports[_0x7594('0x28')]=function(_0x419024,_0x47d310){return db['AnalyticDefaultReport'][_0x7594('0x4a')]({'where':{'id':_0x419024[_0x7594('0x48')]['id']}})[_0x7594('0x24')](handleEntityNotFound(_0x47d310,null))[_0x7594('0x24')](removeEntity(_0x47d310,null))[_0x7594('0x46')](handleError(_0x47d310,null));};exports[_0x7594('0x52')]=function(_0x44f557,_0xfdc9aa){var _0x3bef4e=0xa;var _0x1fadcb=['join',_0x7594('0x53'),'right_join',_0x7594('0x54')];var _0xcca3cc={'SUM':_0x7594('0x55'),'COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':_0x7594('0x58'),'MIN':_0x7594('0x59'),'AVG':_0x7594('0x5a'),'GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7594('0x5c')};var _0x8175ee={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':_0x7594('0x5e'),'HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d7be1=function(_0x2f2524){return!_[_0x7594('0x61')]([_0x7594('0x62'),_0x7594('0x63'),'IS\x20EMPTY',_0x7594('0x64')],_0x2f2524);};var _0x54082d=function(_0x3b0f1b){if(!_0x3b0f1b||!_0x3b0f1b[_0x7594('0x65')][_0x7594('0x49')]){return'';}for(var _0x5142ee='(',_0x1b62fc=0x0;_0x1b62fc<_0x3b0f1b[_0x7594('0x65')][_0x7594('0x49')];_0x1b62fc+=0x1){_0x1b62fc>0x0&&(_0x5142ee+='\x20'+_0x3b0f1b[_0x7594('0x66')]+'\x20');_0x5142ee+=_0x3b0f1b[_0x7594('0x65')][_0x1b62fc][_0x7594('0x67')]?_0x54082d(_0x3b0f1b[_0x7594('0x65')][_0x1b62fc][_0x7594('0x67')]):_0x3b0f1b['rules'][_0x1b62fc][_0x7594('0x40')]+'\x20'+_0x3b0f1b[_0x7594('0x65')][_0x1b62fc]['condition']+(_0x2d7be1(_0x3b0f1b[_0x7594('0x65')][_0x1b62fc]['condition'])?'\x20'+_0x3b0f1b['rules'][_0x1b62fc][_0x7594('0x68')]:'');}return _0x5142ee+')';};var _0x1eef6d={'where':{'id':_0x44f557[_0x7594('0x48')]['id']}},_0x5599d0,_0x2838c2,_0xede814,_0x26fe83,_0x3407b4;_0x1eef6d=_[_0x7594('0x3d')]({},_0x1eef6d,_0x44f557[_0x7594('0x41')]);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x1eef6d)[_0x7594('0x24')](function(_0x34a4c0){if(_0x34a4c0){_0x5599d0=_0x34a4c0;return _0x34a4c0['getFields']();}return null;})[_0x7594('0x24')](function(_0x2e67c6){if(_0x2e67c6){if(!_0x2e67c6[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0x2838c2=_0x2e67c6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7594('0x24')](function(_0x3a4225){if(_0x3a4225){_0xede814=_['keyBy'](_0x3a4225,'id');var _0x46ba65;var _0x47ac62=squel[_0x7594('0x6c')]();_0x47ac62[_0x7594('0x6d')](_0x5599d0[_0x7594('0x6e')]);for(var _0x4e2aee=0x0;_0x4e2aee<_0x2838c2['length'];_0x4e2aee+=0x1){_0x46ba65=_0x2838c2[_0x4e2aee]['MetricId']?_0xede814[_0x2838c2[_0x4e2aee]['MetricId']]['metric']:_0x2838c2[_0x4e2aee][_0x7594('0x40')];_0x46ba65=_0x2838c2[_0x4e2aee]['function']?_[_0x7594('0x6f')](_0xcca3cc[_0x2838c2[_0x4e2aee][_0x7594('0x70')]],'%s',_0x46ba65):_0x46ba65;_0x46ba65=_0x2838c2[_0x4e2aee]['format']?_[_0x7594('0x6f')](_0x8175ee[_0x2838c2[_0x4e2aee][_0x7594('0x71')]],'%s',_0x46ba65):_0x46ba65;if(_0x2838c2[_0x4e2aee][_0x7594('0x72')]){_0x47ac62[_0x7594('0x67')](_0x46ba65);}_0x2838c2[_0x4e2aee][_0x7594('0x73')]&&_0x47ac62[_0x7594('0x38')](_0x46ba65,_0x2838c2[_0x4e2aee]['orderBy']===_0x7594('0x74')?![]:!![]);_0x47ac62[_0x7594('0x40')](_0x46ba65,_0x2838c2[_0x4e2aee]['alias']||_0x46ba65);}if(_0x5599d0[_0x7594('0x75')]){_0x5599d0[_0x7594('0x75')]=JSON['parse'](_0x5599d0[_0x7594('0x75')]);for(var _0x3d84b6=0x0;_0x3d84b6<_0x5599d0['joins'][_0x7594('0x49')];_0x3d84b6+=0x1){if(_0x5599d0[_0x7594('0x75')][_0x3d84b6]['type']&&_[_0x7594('0x61')](_0x1fadcb,_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x3f')])&&_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x76')]&&_0x5599d0['joins'][_0x3d84b6][_0x7594('0x77')]&&_0x5599d0[_0x7594('0x75')][_0x3d84b6]['foreignKey']){_0x47ac62[_0x5599d0['joins'][_0x3d84b6]['type']](_0x5599d0['joins'][_0x3d84b6][_0x7594('0x77')],null,util[_0x7594('0x71')](_0x7594('0x78'),_0x5599d0[_0x7594('0x6e')],_0x5599d0[_0x7594('0x75')][_0x3d84b6]['parentKey'],_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x77')],_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x79')]));}}}if(_0x5599d0[_0x7594('0x7a')]){_0x5599d0[_0x7594('0x7a')]=JSON['parse'](_0x5599d0[_0x7594('0x7a')]);_0x47ac62['where'](_0x54082d(_0x5599d0['conditions'][_0x7594('0x67')]));}_0x3407b4=_0x47ac62['clone']();_0x47ac62['limit'](_0x3bef4e);_0x47ac62[_0x7594('0x1d')](0x0);logger[_0x7594('0x7b')]('Limited\x20Query:',_0x47ac62[_0x7594('0x7c')]());return db[_0x7594('0x7d')][_0x7594('0x35')](_0x47ac62[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});}})['then'](respondWithResult(_0xfdc9aa,null))[_0x7594('0x46')](handleError(_0xfdc9aa,null));};function runReport(_0x5d6a71,_0x18e4bf,_0x4c6762){var _0x54c926=_0x18e4bf[_0x7594('0x2b')];var _0x4619f2=0xa;var _0x58b5b8=['join','left_join',_0x7594('0x7f'),'cross_join'];var _0x4546c6={'SUM':'SUM(%s)','COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7594('0x5c')};var _0x3f63f6={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':'DATE(%s)','HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':_0x7594('0x80')};var _0x569aa8=function(_0x354917){return!_['includes']([_0x7594('0x62'),_0x7594('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x354917);};var _0x4ae2ba=function(_0x3268ee){if(!_0x3268ee||!_0x3268ee[_0x7594('0x65')]['length']){return'';}for(var _0x43f625='(',_0x10f787=0x0;_0x10f787<_0x3268ee['rules'][_0x7594('0x49')];_0x10f787+=0x1){_0x10f787>0x0&&(_0x43f625+='\x20'+_0x3268ee[_0x7594('0x66')]+'\x20');_0x43f625+=_0x3268ee[_0x7594('0x65')][_0x10f787]['group']?_0x4ae2ba(_0x3268ee['rules'][_0x10f787][_0x7594('0x67')]):_0x3268ee[_0x7594('0x65')][_0x10f787][_0x7594('0x40')]+'\x20'+_0x3268ee['rules'][_0x10f787][_0x7594('0x81')]+(_0x569aa8(_0x3268ee[_0x7594('0x65')][_0x10f787][_0x7594('0x81')])?'\x20'+_0x3268ee[_0x7594('0x65')][_0x10f787]['value']:'');}return _0x43f625+')';};var _0x4f8b95={'where':{'id':_0x5d6a71['id']}},_0x29dba9,_0x275e61,_0x29c579,_0x323e05,_0x466461;_0x4f8b95=_[_0x7594('0x3d')]({},_0x4f8b95,_0x4c6762);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x4f8b95)[_0x7594('0x24')](function(_0x5d5279){if(_0x5d5279){_0x29dba9=_0x5d5279;return _0x5d5279[_0x7594('0x82')]();}return null;})[_0x7594('0x24')](function(_0x2c49e7){if(_0x2c49e7){if(!_0x2c49e7['length']){throw new db['Sequelize'][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0x275e61=_0x2c49e7;return db[_0x7594('0x83')][_0x7594('0x44')]({'raw':!![]});}return null;})['then'](function(_0x2db21f){if(_0x2db21f){_0x29c579=_[_0x7594('0x84')](_0x2db21f,'id');var _0x485d85;var _0x14fd85=squel[_0x7594('0x6c')]();_0x14fd85[_0x7594('0x6d')](_0x29dba9[_0x7594('0x6e')]);for(var _0x3f363c=0x0;_0x3f363c<_0x275e61['length'];_0x3f363c+=0x1){_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x85')]?_0x29c579[_0x275e61[_0x3f363c][_0x7594('0x85')]][_0x7594('0x86')]:_0x275e61[_0x3f363c]['field'];_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x70')]?_[_0x7594('0x6f')](_0x4546c6[_0x275e61[_0x3f363c]['function']],'%s',_0x485d85):_0x485d85;_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x71')]?_[_0x7594('0x6f')](_0x3f63f6[_0x275e61[_0x3f363c][_0x7594('0x71')]],'%s',_0x485d85):_0x485d85;if(_0x275e61[_0x3f363c][_0x7594('0x72')]){_0x14fd85[_0x7594('0x67')](_0x485d85);}_0x275e61[_0x3f363c][_0x7594('0x73')]&&_0x14fd85[_0x7594('0x38')](_0x485d85,_0x275e61[_0x3f363c][_0x7594('0x73')]===_0x7594('0x74')?![]:!![]);_0x14fd85['field'](_0x485d85,_0x275e61[_0x3f363c][_0x7594('0x87')]||_0x485d85);}if(_0x29dba9[_0x7594('0x75')]){_0x29dba9[_0x7594('0x75')]=JSON[_0x7594('0x88')](_0x29dba9[_0x7594('0x75')]);for(var _0x3203d8=0x0;_0x3203d8<_0x29dba9[_0x7594('0x75')][_0x7594('0x49')];_0x3203d8+=0x1){if(_0x29dba9['joins'][_0x3203d8][_0x7594('0x3f')]&&_[_0x7594('0x61')](_0x58b5b8,_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x3f')])&&_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x76')]&&_0x29dba9[_0x7594('0x75')][_0x3203d8]['foreignTable']&&_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x79')]){_0x14fd85[_0x29dba9[_0x7594('0x75')][_0x3203d8]['type']](_0x29dba9['joins'][_0x3203d8][_0x7594('0x77')],null,util[_0x7594('0x71')](_0x7594('0x78'),_0x29dba9['table'],_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x76')],_0x29dba9['joins'][_0x3203d8][_0x7594('0x77')],_0x29dba9['joins'][_0x3203d8][_0x7594('0x79')]));}}}if(_0x29dba9[_0x7594('0x7a')]){_0x29dba9[_0x7594('0x7a')]=JSON[_0x7594('0x88')](_0x29dba9[_0x7594('0x7a')]);_0x14fd85[_0x7594('0x3a')](_0x4ae2ba(_0x29dba9[_0x7594('0x7a')][_0x7594('0x67')]));}_0x466461=_0x14fd85[_0x7594('0x89')]();_0x14fd85[_0x7594('0x1e')](_0x4619f2);_0x14fd85['offset'](0x0);logger['debug']('Limited\x20Query:',_0x14fd85[_0x7594('0x7c')]());return db[_0x7594('0x7d')][_0x7594('0x35')](_0x14fd85[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')][_0x7594('0x8a')]});}})[_0x7594('0x24')](function(_0xdc3d05){if(!_0xdc3d05[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))]['ValidationErrorItem'](_0x7594('0x8b'),0xcc);}if(_0x18e4bf['output']==='web'){return null;}var _0x1e9e7c=_[_0x7594('0x3d')](_0x18e4bf,{'name':_0x18e4bf['fullPath']||_0x18e4bf[_0x7594('0x2b')]||_0x29dba9[_0x7594('0x2b')],'basename':_0x54c926,'savename':util['format']('%s-%s.%s',_0x18e4bf[_0x7594('0x2b')]||_0x29dba9[_0x7594('0x2b')],require(_0x7594('0x8c'))[_0x7594('0x8d')](0x4),_0x18e4bf[_0x7594('0x8e')]||_0x7594('0x8f')),'reportId':_0x29dba9['id'],'reportType':_0x7594('0x90')});return db['AnalyticExtractedReport']['create'](_0x1e9e7c,{'raw':!![]});})['then'](function(_0x276d20){if(_0x29dba9[_0x7594('0x6e')]===_0x7594('0x91')){_0x466461[_0x7594('0x3a')](_0x29dba9['table']+_0x7594('0x92'),_0x18e4bf['startDate'],_0x18e4bf['endDate']);}else{_0x466461['where'](_0x29dba9[_0x7594('0x6e')]+_0x7594('0x93'),_0x18e4bf['startDate'],_0x18e4bf['endDate']);}if(_0x276d20){logger[_0x7594('0x94')](_0x7594('0x95'),_0x466461[_0x7594('0x7c')]());require(_0x7594('0x96'))[_0x7594('0x97')](path[_0x7594('0x98')](__dirname,_0x7594('0x99'),_0x276d20['output']),[_0x276d20['id'],_0x466461[_0x7594('0x7c')](),path['join'](__dirname,'../../files/reports',_0x276d20['savename']),_0x54c926]);return _0x276d20;}else{var _0x493225=squel[_0x7594('0x6c')]();_0x493225[_0x7594('0x6d')]('('+_0x466461['toString']()+')',_0x7594('0x9a'));_0x493225[_0x7594('0x40')](_0x7594('0x9b'),_0x7594('0x1c'));_0x466461['limit'](_0x18e4bf[_0x7594('0x1e')]||_0x4619f2);_0x466461[_0x7594('0x1d')](_0x18e4bf['offset']||0x0);return db[_0x7594('0x7d')][_0x7594('0x35')](_0x493225[_0x7594('0x7c')](),{'type':db['sequelize'][_0x7594('0x7e')][_0x7594('0x8a')]})[_0x7594('0x24')](function(_0x24a2ff){if(!_0x24a2ff[_0x7594('0x49')]){_0x323e05=0x0;}else{_0x323e05=_0x24a2ff[0x0][_0x7594('0x1c')]||0x0;}return db[_0x7594('0x7d')][_0x7594('0x35')](_0x466461[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});})[_0x7594('0x24')](function(_0x1f6ff3){return{'rows':_0x1f6ff3||[],'count':_0x323e05};});}});}exports[_0x7594('0x9c')]=function(_0x7a1fbc,_0x5bc5e7){return runReport(_0x7a1fbc['params'],_0x7a1fbc[_0x7594('0x35')],_0x7a1fbc['options'])[_0x7594('0x24')](respondWithResult(_0x5bc5e7,null))[_0x7594('0x46')](handleError(_0x5bc5e7,null));};exports[_0x7594('0x9d')]=runReport;exports['query']=function(_0x570f09,_0x59c266){var _0x5c7db2=0xa;var _0x204a5d=[_0x7594('0x98'),'left_join',_0x7594('0x7f'),_0x7594('0x54')];var _0x52f990={'SUM':_0x7594('0x55'),'COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':_0x7594('0x58'),'MIN':_0x7594('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':_0x7594('0x9e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3f91ac={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':_0x7594('0x5e'),'HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':_0x7594('0x80')};var _0x37dae3=function(_0x8bbe4c){return!_[_0x7594('0x61')]([_0x7594('0x62'),'IS\x20NOT\x20NULL',_0x7594('0x9f'),_0x7594('0x64')],_0x8bbe4c);};var _0xc5e24e=function(_0x556947){if(!_0x556947||!_0x556947['rules'][_0x7594('0x49')]){return'';}for(var _0x1da579='(',_0x4ae80d=0x0;_0x4ae80d<_0x556947[_0x7594('0x65')][_0x7594('0x49')];_0x4ae80d+=0x1){_0x4ae80d>0x0&&(_0x1da579+='\x20'+_0x556947[_0x7594('0x66')]+'\x20');_0x1da579+=_0x556947[_0x7594('0x65')][_0x4ae80d]['group']?_0xc5e24e(_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x67')]):_0x556947[_0x7594('0x65')][_0x4ae80d]['field']+'\x20'+_0x556947['rules'][_0x4ae80d][_0x7594('0x81')]+(_0x37dae3(_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x81')])?'\x20'+_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x68')]:'');}return _0x1da579+')';};var _0x3f78f5={'where':{'id':_0x570f09[_0x7594('0x48')]['id']}},_0x4ce050,_0xeaa940,_0x2ad522,_0x266aee,_0x139f54;_0x3f78f5=_['merge']({},_0x3f78f5,_0x570f09[_0x7594('0x41')]);return db[_0x7594('0x2d')]['find'](_0x3f78f5)[_0x7594('0x24')](function(_0x55908e){if(_0x55908e){_0x4ce050=_0x55908e;return _0x55908e[_0x7594('0x82')]();}return null;})[_0x7594('0x24')](function(_0xa745e5){if(_0xa745e5){if(!_0xa745e5[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0xeaa940=_0xa745e5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7594('0x24')](function(_0x111010){if(_0x111010){_0x2ad522=_['keyBy'](_0x111010,'id');var _0xfa18d3;var _0x583d55=squel[_0x7594('0x6c')]();_0x583d55[_0x7594('0x6d')](_0x4ce050[_0x7594('0x6e')]);for(var _0x26daea=0x0;_0x26daea<_0xeaa940[_0x7594('0x49')];_0x26daea+=0x1){_0xfa18d3=_0xeaa940[_0x26daea][_0x7594('0x85')]?_0x2ad522[_0xeaa940[_0x26daea]['MetricId']][_0x7594('0x86')]:_0xeaa940[_0x26daea][_0x7594('0x40')];_0xfa18d3=_0xeaa940[_0x26daea]['function']?_[_0x7594('0x6f')](_0x52f990[_0xeaa940[_0x26daea]['function']],'%s',_0xfa18d3):_0xfa18d3;_0xfa18d3=_0xeaa940[_0x26daea]['format']?_[_0x7594('0x6f')](_0x3f91ac[_0xeaa940[_0x26daea][_0x7594('0x71')]],'%s',_0xfa18d3):_0xfa18d3;if(_0xeaa940[_0x26daea]['groupBy']){_0x583d55[_0x7594('0x67')](_0xfa18d3);}_0xeaa940[_0x26daea]['orderBy']&&_0x583d55['order'](_0xfa18d3,_0xeaa940[_0x26daea][_0x7594('0x73')]===_0x7594('0x74')?![]:!![]);_0x583d55[_0x7594('0x40')](_0xfa18d3,_0xeaa940[_0x26daea][_0x7594('0x87')]||_0xfa18d3);}if(_0x4ce050[_0x7594('0x75')]){_0x4ce050[_0x7594('0x75')]=JSON['parse'](_0x4ce050['joins']);for(var _0x763e86=0x0;_0x763e86<_0x4ce050[_0x7594('0x75')][_0x7594('0x49')];_0x763e86+=0x1){if(_0x4ce050[_0x7594('0x75')][_0x763e86]['type']&&_[_0x7594('0x61')](_0x204a5d,_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x3f')])&&_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x76')]&&_0x4ce050[_0x7594('0x75')][_0x763e86]['foreignTable']&&_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x79')]){_0x583d55[_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x3f')]](_0x4ce050['joins'][_0x763e86][_0x7594('0x77')],null,util['format'](_0x7594('0x78'),_0x4ce050[_0x7594('0x6e')],_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x76')],_0x4ce050['joins'][_0x763e86][_0x7594('0x77')],_0x4ce050[_0x7594('0x75')][_0x763e86]['foreignKey']));}}}if(_0x4ce050[_0x7594('0x7a')]){_0x4ce050[_0x7594('0x7a')]=JSON[_0x7594('0x88')](_0x4ce050[_0x7594('0x7a')]);_0x583d55[_0x7594('0x3a')](_0xc5e24e(_0x4ce050[_0x7594('0x7a')][_0x7594('0x67')]));}_0x139f54=_0x583d55[_0x7594('0x89')]();_0x583d55[_0x7594('0x1e')](_0x5c7db2);_0x583d55[_0x7594('0x1d')](0x0);logger['debug'](_0x7594('0xa0'),_0x583d55[_0x7594('0x7c')]());return db['sequelize'][_0x7594('0x35')](_0x583d55[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});}})[_0x7594('0x24')](function(){return{'sql':_0x139f54[_0x7594('0x7c')]()};})['then'](respondWithResult(_0x59c266,null))[_0x7594('0x46')](handleError(_0x59c266,null));}; \ No newline at end of file +var _0x14bd=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','name','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','key','VIRTUAL','field','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','error','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','operator','value','ValidationErrorItem','AnalyticMetric','keyBy','foreignKey','fullPath','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL'];(function(_0x6489c6,_0x189231){var _0x2103f6=function(_0x4e9742){while(--_0x4e9742){_0x6489c6['push'](_0x6489c6['shift']());}};_0x2103f6(++_0x189231);}(_0x14bd,0x146));var _0xd14b=function(_0x4d95c4,_0x2248cb){_0x4d95c4=_0x4d95c4-0x0;var _0x4fe1bf=_0x14bd[_0x4d95c4];return _0x4fe1bf;};'use strict';var pdf=require(_0xd14b('0x0'));var emlformat=require(_0xd14b('0x1'));var rimraf=require(_0xd14b('0x2'));var zipdir=require(_0xd14b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd14b('0x4'));var moment=require(_0xd14b('0x5'));var BPromise=require(_0xd14b('0x6'));var Mustache=require('mustache');var util=require(_0xd14b('0x7'));var path=require('path');var sox=require(_0xd14b('0x8'));var csv=require(_0xd14b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd14b('0xa'));var crypto=require(_0xd14b('0xb'));var jsforce=require(_0xd14b('0xc'));var deskjs=require(_0xd14b('0xd'));var toCsv=require(_0xd14b('0x9'));var querystring=require(_0xd14b('0xe'));var Papa=require(_0xd14b('0xf'));var Redis=require(_0xd14b('0x10'));var authService=require(_0xd14b('0x11'));var qs=require(_0xd14b('0x12'));var hardwareService=require(_0xd14b('0x13'));var logger=require(_0xd14b('0x14'))(_0xd14b('0x15'));var utils=require(_0xd14b('0x16'));var config=require(_0xd14b('0x17'));var db=require(_0xd14b('0x18'))['db'];function respondWithStatusCode(_0x53f44e,_0x2cdd62){_0x2cdd62=_0x2cdd62||0xcc;return function(_0x5a81d0){if(_0x5a81d0){return _0x53f44e['sendStatus'](_0x2cdd62);}return _0x53f44e[_0xd14b('0x19')](_0x2cdd62)[_0xd14b('0x1a')]();};}function respondWithResult(_0x24fa71,_0x340e2c){_0x340e2c=_0x340e2c||0xc8;return function(_0x2fa7d8){if(_0x2fa7d8){return _0x24fa71[_0xd14b('0x19')](_0x340e2c)[_0xd14b('0x1b')](_0x2fa7d8);}};}function respondWithFilteredResult(_0x406b56,_0x3019e4){return function(_0x121465){if(_0x121465){var _0x99a0c4=_0x121465[_0xd14b('0x1c')],_0x1e0bfa=_0x3019e4[_0xd14b('0x1d')],_0x19b9b5=_0x3019e4['offset']+_0x3019e4[_0xd14b('0x1e')],_0x1c3281;if(_0x19b9b5>=_0x99a0c4){_0x19b9b5=_0x99a0c4;_0x1c3281=0xc8;}else{_0x1c3281=0xce;}_0x406b56[_0xd14b('0x19')](_0x1c3281);return _0x406b56[_0xd14b('0x1f')]('Content-Range',_0x1e0bfa+'-'+_0x19b9b5+'/'+_0x99a0c4)['json'](_0x121465);}return null;};}function patchUpdates(_0x3ea91e){return function(_0xd99382){try{jsonpatch[_0xd14b('0x20')](_0xd99382,_0x3ea91e,!![]);}catch(_0x3e4d67){return BPromise[_0xd14b('0x21')](_0x3e4d67);}return _0xd99382['save']();};}function saveUpdates(_0x1fed2f,_0x18ebc8){return function(_0x5ce9fa){if(_0x5ce9fa){return _0x5ce9fa[_0xd14b('0x22')](_0x1fed2f)[_0xd14b('0x23')](function(_0x400511){return _0x400511;});}return null;};}function removeEntity(_0x473308,_0x372d03){return function(_0x49918d){if(_0x49918d){return _0x49918d[_0xd14b('0x24')]()[_0xd14b('0x23')](function(){var _0x528c0a=_0x49918d[_0xd14b('0x25')]({'plain':!![]});var _0x111ab8=_0xd14b('0x26');return db[_0xd14b('0x27')][_0xd14b('0x24')]({'where':{'type':_0x111ab8,'resourceId':_0x528c0a['id']}})[_0xd14b('0x23')](function(){return _0x49918d;});})[_0xd14b('0x23')](function(){_0x473308[_0xd14b('0x19')](0xcc)[_0xd14b('0x1a')]();});}};}function handleEntityNotFound(_0x558010,_0x39a0eb){return function(_0x3155dd){if(!_0x3155dd){_0x558010[_0xd14b('0x28')](0x194);}return _0x3155dd;};}function handleError(_0x5ad98f,_0x5cb195){_0x5cb195=_0x5cb195||0x1f4;return function(_0x26fc08){logger['error'](_0x26fc08['stack']);if(_0x26fc08[_0xd14b('0x29')]){delete _0x26fc08['name'];}_0x5ad98f[_0xd14b('0x19')](_0x5cb195)['send'](_0x26fc08);};}exports[_0xd14b('0x2a')]=function(_0x3bbbe0,_0x39e7ca){var _0x10f004={},_0x353018={},_0x479b32={'count':0x0,'rows':[]};var _0x2e38ad=db['AnalyticDefaultReport'][_0xd14b('0x2b')];_0x353018[_0xd14b('0x2c')]=_['keys'](_0x2e38ad);_0x353018[_0xd14b('0x2d')]=_[_0xd14b('0x2e')](_0x3bbbe0['query']);_0x353018[_0xd14b('0x2f')]=_[_0xd14b('0x30')](_0x353018['model'],_0x353018['query']);_0x10f004[_0xd14b('0x31')]=_[_0xd14b('0x30')](_0x353018[_0xd14b('0x2c')],qs[_0xd14b('0x32')](_0x3bbbe0[_0xd14b('0x2d')][_0xd14b('0x32')]));_0x10f004['attributes']=_0x10f004[_0xd14b('0x31')][_0xd14b('0x33')]?_0x10f004['attributes']:_0x353018[_0xd14b('0x2c')];if(!_0x3bbbe0['query']['hasOwnProperty'](_0xd14b('0x34'))){_0x10f004['limit']=qs[_0xd14b('0x1e')](_0x3bbbe0[_0xd14b('0x2d')][_0xd14b('0x1e')]);_0x10f004[_0xd14b('0x1d')]=qs[_0xd14b('0x1d')](_0x3bbbe0['query'][_0xd14b('0x1d')]);}_0x10f004['order']=qs['sort'](_0x3bbbe0['query'][_0xd14b('0x35')]);_0x10f004[_0xd14b('0x36')]=qs[_0xd14b('0x2f')](_[_0xd14b('0x37')](_0x3bbbe0[_0xd14b('0x2d')],_0x353018[_0xd14b('0x2f')]));if(_0x3bbbe0['query']['filter']){_0x10f004['where']=_[_0xd14b('0x38')](_0x10f004[_0xd14b('0x36')],{'$or':_[_0xd14b('0x39')](_0x2e38ad,function(_0x1181ec){if(_0x1181ec['type'][_0xd14b('0x3a')]!==_0xd14b('0x3b')){var _0x12df36={};_0x12df36[_0x1181ec[_0xd14b('0x3c')]]={'$like':'%'+_0x3bbbe0['query']['filter']+'%'};return _0x12df36;}})});}_0x10f004=_[_0xd14b('0x38')]({},_0x10f004,_0x3bbbe0[_0xd14b('0x3d')]);var _0x33e15c={'where':_0x10f004[_0xd14b('0x36')]};return db[_0xd14b('0x3e')]['count'](_0x33e15c)[_0xd14b('0x23')](function(_0xaa3313){_0x479b32[_0xd14b('0x1c')]=_0xaa3313;if(_0x3bbbe0['query'][_0xd14b('0x3f')]){_0x10f004[_0xd14b('0x40')]=[{'all':!![]}];}return db[_0xd14b('0x3e')][_0xd14b('0x41')](_0x10f004);})[_0xd14b('0x23')](function(_0x3abfd9){_0x479b32[_0xd14b('0x42')]=_0x3abfd9;return _0x479b32;})[_0xd14b('0x23')](respondWithFilteredResult(_0x39e7ca,_0x10f004))['catch'](handleError(_0x39e7ca,null));};exports[_0xd14b('0x43')]=function(_0x252b3c,_0x334483){var _0x34772a={'raw':!![],'where':{'id':_0x252b3c[_0xd14b('0x44')]['id']}},_0x4efc49={};_0x4efc49[_0xd14b('0x2c')]=_['keys'](db[_0xd14b('0x3e')]['rawAttributes']);_0x4efc49[_0xd14b('0x2d')]=_[_0xd14b('0x2e')](_0x252b3c[_0xd14b('0x2d')]);_0x4efc49[_0xd14b('0x2f')]=_['intersection'](_0x4efc49[_0xd14b('0x2c')],_0x4efc49['query']);_0x34772a[_0xd14b('0x31')]=_[_0xd14b('0x30')](_0x4efc49[_0xd14b('0x2c')],qs['fields'](_0x252b3c[_0xd14b('0x2d')][_0xd14b('0x32')]));_0x34772a['attributes']=_0x34772a[_0xd14b('0x31')]['length']?_0x34772a[_0xd14b('0x31')]:_0x4efc49[_0xd14b('0x2c')];if(_0x252b3c[_0xd14b('0x2d')][_0xd14b('0x3f')]){_0x34772a['include']=[{'all':!![]}];}_0x34772a=_[_0xd14b('0x38')]({},_0x34772a,_0x252b3c[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')][_0xd14b('0x45')](_0x34772a)[_0xd14b('0x23')](handleEntityNotFound(_0x334483,null))[_0xd14b('0x23')](respondWithResult(_0x334483,null))[_0xd14b('0x46')](handleError(_0x334483,null));};exports[_0xd14b('0x47')]=function(_0x407c2c,_0x38dba4){return db[_0xd14b('0x3e')][_0xd14b('0x47')](_0x407c2c[_0xd14b('0x48')],{})['then'](function(_0x410fd9){var _0x42d10d=_0x407c2c[_0xd14b('0x49')][_0xd14b('0x25')]({'plain':!![]});if(!_0x42d10d)throw new Error(_0xd14b('0x4a'));if(_0x42d10d[_0xd14b('0x4b')]===_0xd14b('0x49')){var _0x17b70c=_0x410fd9[_0xd14b('0x25')]({'plain':!![]});var _0x132e68=_0xd14b('0x4c');return db[_0xd14b('0x4d')][_0xd14b('0x45')]({'where':{'name':_0x132e68,'userProfileId':_0x42d10d['userProfileId']},'raw':!![]})[_0xd14b('0x23')](function(_0x114d14){if(_0x114d14&&_0x114d14[_0xd14b('0x4e')]===0x0){return db[_0xd14b('0x27')][_0xd14b('0x47')]({'name':_0x17b70c[_0xd14b('0x29')],'resourceId':_0x17b70c['id'],'type':_0xd14b('0x26'),'sectionId':_0x114d14['id']},{})['then'](function(){return _0x410fd9;});}else{return _0x410fd9;}})['catch'](function(_0x1a4fa0){logger[_0xd14b('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a4fa0);throw _0x1a4fa0;});}return _0x410fd9;})[_0xd14b('0x23')](respondWithResult(_0x38dba4,0xc9))[_0xd14b('0x46')](handleError(_0x38dba4,null));};exports[_0xd14b('0x22')]=function(_0x14e1cb,_0x5c1157){if(_0x14e1cb[_0xd14b('0x48')]['id']){delete _0x14e1cb['body']['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x14e1cb[_0xd14b('0x44')]['id']}})[_0xd14b('0x23')](handleEntityNotFound(_0x5c1157,null))[_0xd14b('0x23')](saveUpdates(_0x14e1cb[_0xd14b('0x48')],null))[_0xd14b('0x23')](respondWithResult(_0x5c1157,null))['catch'](handleError(_0x5c1157,null));};exports[_0xd14b('0x24')]=function(_0x27726c,_0x485fba){return db[_0xd14b('0x3e')][_0xd14b('0x45')]({'where':{'id':_0x27726c[_0xd14b('0x44')]['id']}})[_0xd14b('0x23')](handleEntityNotFound(_0x485fba,null))[_0xd14b('0x23')](removeEntity(_0x485fba,null))[_0xd14b('0x46')](handleError(_0x485fba,null));};exports[_0xd14b('0x50')]=function(_0x317f43,_0x53262a){var _0x46933f=0xa;var _0x1848b6=[_0xd14b('0x51'),_0xd14b('0x52'),_0xd14b('0x53'),'cross_join'];var _0x19f306={'SUM':_0xd14b('0x54'),'COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':_0xd14b('0x57'),'MIN':_0xd14b('0x58'),'AVG':_0xd14b('0x59'),'GROUP_CONCAT':_0xd14b('0x5a'),'GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x288666={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xd14b('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0x3e2c68=function(_0x71b476){return!_[_0xd14b('0x5e')]([_0xd14b('0x5f'),'IS\x20NOT\x20NULL',_0xd14b('0x60'),_0xd14b('0x61')],_0x71b476);};var _0x4dd4cd=function(_0x3cfa84){if(!_0x3cfa84||!_0x3cfa84[_0xd14b('0x62')]['length']){return'';}for(var _0x46ac29='(',_0x45562d=0x0;_0x45562d<_0x3cfa84['rules'][_0xd14b('0x33')];_0x45562d+=0x1){_0x45562d>0x0&&(_0x46ac29+='\x20'+_0x3cfa84['operator']+'\x20');_0x46ac29+=_0x3cfa84['rules'][_0x45562d][_0xd14b('0x63')]?_0x4dd4cd(_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x63')]):_0x3cfa84[_0xd14b('0x62')][_0x45562d]['field']+'\x20'+_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x64')]+(_0x3e2c68(_0x3cfa84[_0xd14b('0x62')][_0x45562d][_0xd14b('0x64')])?'\x20'+_0x3cfa84['rules'][_0x45562d]['value']:'');}return _0x46ac29+')';};var _0x1beaa8={'where':{'id':_0x317f43['params']['id']}},_0x18ba5f,_0x3786cd,_0x124bdf,_0x331bcb,_0x532385;_0x1beaa8=_[_0xd14b('0x38')]({},_0x1beaa8,_0x317f43[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')][_0xd14b('0x45')](_0x1beaa8)['then'](function(_0x106f3a){if(_0x106f3a){_0x18ba5f=_0x106f3a;return _0x106f3a[_0xd14b('0x65')]();}return null;})['then'](function(_0x1fdcd9){if(_0x1fdcd9){if(!_0x1fdcd9[_0xd14b('0x33')]){throw new db[(_0xd14b('0x66'))]['ValidationErrorItem'](_0xd14b('0x67'),0x193);}_0x3786cd=_0x1fdcd9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x1bdc7b){if(_0x1bdc7b){_0x124bdf=_['keyBy'](_0x1bdc7b,'id');var _0x310318;var _0x253d42=squel[_0xd14b('0x68')]();_0x253d42[_0xd14b('0x69')](_0x18ba5f[_0xd14b('0x6a')]);for(var _0x23015e=0x0;_0x23015e<_0x3786cd[_0xd14b('0x33')];_0x23015e+=0x1){_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6b')]?_0x124bdf[_0x3786cd[_0x23015e]['MetricId']][_0xd14b('0x6c')]:_0x3786cd[_0x23015e][_0xd14b('0x3c')];_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6d')]?_[_0xd14b('0x6e')](_0x19f306[_0x3786cd[_0x23015e][_0xd14b('0x6d')]],'%s',_0x310318):_0x310318;_0x310318=_0x3786cd[_0x23015e][_0xd14b('0x6f')]?_[_0xd14b('0x6e')](_0x288666[_0x3786cd[_0x23015e]['format']],'%s',_0x310318):_0x310318;if(_0x3786cd[_0x23015e][_0xd14b('0x70')]){_0x253d42['group'](_0x310318);}_0x3786cd[_0x23015e]['orderBy']&&_0x253d42[_0xd14b('0x71')](_0x310318,_0x3786cd[_0x23015e][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x253d42['field'](_0x310318,_0x3786cd[_0x23015e][_0xd14b('0x74')]||_0x310318);}if(_0x18ba5f[_0xd14b('0x75')]){_0x18ba5f[_0xd14b('0x75')]=JSON[_0xd14b('0x76')](_0x18ba5f['joins']);for(var _0x1addd4=0x0;_0x1addd4<_0x18ba5f[_0xd14b('0x75')][_0xd14b('0x33')];_0x1addd4+=0x1){if(_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x77')]&&_['includes'](_0x1848b6,_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x77')])&&_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x78')]&&_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')]&&_0x18ba5f['joins'][_0x1addd4]['foreignKey']){_0x253d42[_0x18ba5f['joins'][_0x1addd4][_0xd14b('0x77')]](_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')],null,util['format'](_0xd14b('0x7a'),_0x18ba5f[_0xd14b('0x6a')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x78')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4][_0xd14b('0x79')],_0x18ba5f[_0xd14b('0x75')][_0x1addd4]['foreignKey']));}}}if(_0x18ba5f[_0xd14b('0x7b')]){_0x18ba5f[_0xd14b('0x7b')]=JSON[_0xd14b('0x76')](_0x18ba5f[_0xd14b('0x7b')]);_0x253d42[_0xd14b('0x36')](_0x4dd4cd(_0x18ba5f[_0xd14b('0x7b')]['group']));}_0x532385=_0x253d42[_0xd14b('0x7c')]();_0x253d42[_0xd14b('0x1e')](_0x46933f);_0x253d42['offset'](0x0);logger[_0xd14b('0x7d')](_0xd14b('0x7e'),_0x253d42[_0xd14b('0x7f')]());return db['sequelize'][_0xd14b('0x2d')](_0x253d42[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})[_0xd14b('0x23')](respondWithResult(_0x53262a,null))[_0xd14b('0x46')](handleError(_0x53262a,null));};function runReport(_0x4fa4d3,_0x2ddbc7,_0x10c68d){var _0x2abc09=_0x2ddbc7['name'];var _0x16401a=0xa;var _0x40be4e=['join',_0xd14b('0x52'),_0xd14b('0x53'),_0xd14b('0x83')];var _0x197602={'SUM':_0xd14b('0x54'),'COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':_0xd14b('0x57'),'MIN':_0xd14b('0x58'),'AVG':_0xd14b('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x140aef={'SEC_TO_TIME':_0xd14b('0x84'),'DATE':_0xd14b('0x85'),'HOUR':_0xd14b('0x5c'),'ROUND':_0xd14b('0x86'),'UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0xc85614=function(_0x59161d){return!_['includes']([_0xd14b('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd14b('0x61')],_0x59161d);};var _0x4303a5=function(_0x492b1c){if(!_0x492b1c||!_0x492b1c['rules']['length']){return'';}for(var _0x7c2f7d='(',_0x57ad55=0x0;_0x57ad55<_0x492b1c[_0xd14b('0x62')]['length'];_0x57ad55+=0x1){_0x57ad55>0x0&&(_0x7c2f7d+='\x20'+_0x492b1c[_0xd14b('0x87')]+'\x20');_0x7c2f7d+=_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x63')]?_0x4303a5(_0x492b1c[_0xd14b('0x62')][_0x57ad55]['group']):_0x492b1c[_0xd14b('0x62')][_0x57ad55]['field']+'\x20'+_0x492b1c['rules'][_0x57ad55][_0xd14b('0x64')]+(_0xc85614(_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x64')])?'\x20'+_0x492b1c[_0xd14b('0x62')][_0x57ad55][_0xd14b('0x88')]:'');}return _0x7c2f7d+')';};var _0x534f7d={'where':{'id':_0x4fa4d3['id']}},_0x12e1a7,_0x2de0d2,_0x1d4ce2,_0x3c6538,_0x459141;_0x534f7d=_['merge']({},_0x534f7d,_0x10c68d);return db['AnalyticDefaultReport'][_0xd14b('0x45')](_0x534f7d)[_0xd14b('0x23')](function(_0x3851a9){if(_0x3851a9){_0x12e1a7=_0x3851a9;return _0x3851a9[_0xd14b('0x65')]();}return null;})[_0xd14b('0x23')](function(_0xe01d8e){if(_0xe01d8e){if(!_0xe01d8e[_0xd14b('0x33')]){throw new db['Sequelize'][(_0xd14b('0x89'))](_0xd14b('0x67'),0x193);}_0x2de0d2=_0xe01d8e;return db[_0xd14b('0x8a')][_0xd14b('0x41')]({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x141279){if(_0x141279){_0x1d4ce2=_[_0xd14b('0x8b')](_0x141279,'id');var _0x2f630e;var _0x17cd98=squel['select']();_0x17cd98[_0xd14b('0x69')](_0x12e1a7['table']);for(var _0x4c0062=0x0;_0x4c0062<_0x2de0d2[_0xd14b('0x33')];_0x4c0062+=0x1){_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6b')]?_0x1d4ce2[_0x2de0d2[_0x4c0062][_0xd14b('0x6b')]][_0xd14b('0x6c')]:_0x2de0d2[_0x4c0062]['field'];_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6d')]?_[_0xd14b('0x6e')](_0x197602[_0x2de0d2[_0x4c0062][_0xd14b('0x6d')]],'%s',_0x2f630e):_0x2f630e;_0x2f630e=_0x2de0d2[_0x4c0062][_0xd14b('0x6f')]?_['replace'](_0x140aef[_0x2de0d2[_0x4c0062][_0xd14b('0x6f')]],'%s',_0x2f630e):_0x2f630e;if(_0x2de0d2[_0x4c0062][_0xd14b('0x70')]){_0x17cd98[_0xd14b('0x63')](_0x2f630e);}_0x2de0d2[_0x4c0062][_0xd14b('0x72')]&&_0x17cd98[_0xd14b('0x71')](_0x2f630e,_0x2de0d2[_0x4c0062][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x17cd98[_0xd14b('0x3c')](_0x2f630e,_0x2de0d2[_0x4c0062][_0xd14b('0x74')]||_0x2f630e);}if(_0x12e1a7[_0xd14b('0x75')]){_0x12e1a7[_0xd14b('0x75')]=JSON['parse'](_0x12e1a7[_0xd14b('0x75')]);for(var _0x52b50c=0x0;_0x52b50c<_0x12e1a7[_0xd14b('0x75')][_0xd14b('0x33')];_0x52b50c+=0x1){if(_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')]&&_[_0xd14b('0x5e')](_0x40be4e,_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')])&&_0x12e1a7['joins'][_0x52b50c]['parentKey']&&_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')]&&_0x12e1a7[_0xd14b('0x75')][_0x52b50c]['foreignKey']){_0x17cd98[_0x12e1a7['joins'][_0x52b50c][_0xd14b('0x77')]](_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')],null,util['format'](_0xd14b('0x7a'),_0x12e1a7['table'],_0x12e1a7[_0xd14b('0x75')][_0x52b50c]['parentKey'],_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x79')],_0x12e1a7[_0xd14b('0x75')][_0x52b50c][_0xd14b('0x8c')]));}}}if(_0x12e1a7[_0xd14b('0x7b')]){_0x12e1a7[_0xd14b('0x7b')]=JSON[_0xd14b('0x76')](_0x12e1a7[_0xd14b('0x7b')]);_0x17cd98[_0xd14b('0x36')](_0x4303a5(_0x12e1a7[_0xd14b('0x7b')][_0xd14b('0x63')]));}_0x459141=_0x17cd98['clone']();_0x17cd98[_0xd14b('0x1e')](_0x16401a);_0x17cd98[_0xd14b('0x1d')](0x0);logger[_0xd14b('0x7d')](_0xd14b('0x7e'),_0x17cd98[_0xd14b('0x7f')]());return db[_0xd14b('0x80')]['query'](_0x17cd98[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})['then'](function(_0x34d931){if(!_0x34d931[_0xd14b('0x33')]){throw new db[(_0xd14b('0x66'))][(_0xd14b('0x89'))]('No\x20available\x20data',0xcc);}if(_0x2ddbc7['output']==='web'){return null;}var _0x140a52=_['merge'](_0x2ddbc7,{'name':_0x2ddbc7[_0xd14b('0x8d')]||_0x2ddbc7[_0xd14b('0x29')]||_0x12e1a7[_0xd14b('0x29')],'basename':_0x2abc09,'savename':util[_0xd14b('0x6f')]('%s-%s.%s',_0x2ddbc7[_0xd14b('0x29')]||_0x12e1a7[_0xd14b('0x29')],require(_0xd14b('0x8e'))[_0xd14b('0x8f')](0x4),_0x2ddbc7[_0xd14b('0x90')]||'csv'),'reportId':_0x12e1a7['id'],'reportType':_0xd14b('0x91')});return db['AnalyticExtractedReport'][_0xd14b('0x47')](_0x140a52,{'raw':!![]});})[_0xd14b('0x23')](function(_0x4b2af4){if(_0x12e1a7[_0xd14b('0x6a')]===_0xd14b('0x92')){_0x459141[_0xd14b('0x36')](_0x12e1a7['table']+_0xd14b('0x93'),_0x2ddbc7['startDate'],_0x2ddbc7[_0xd14b('0x94')]);}else{_0x459141['where'](_0x12e1a7['table']+_0xd14b('0x95'),_0x2ddbc7[_0xd14b('0x96')],_0x2ddbc7[_0xd14b('0x94')]);}if(_0x4b2af4){logger[_0xd14b('0x97')](_0xd14b('0x98'),_0x459141['toString']());require(_0xd14b('0x99'))[_0xd14b('0x9a')](path[_0xd14b('0x51')](__dirname,_0xd14b('0x9b'),_0x4b2af4[_0xd14b('0x90')]),[_0x4b2af4['id'],_0x459141[_0xd14b('0x7f')](),path[_0xd14b('0x51')](__dirname,'../../files/reports',_0x4b2af4[_0xd14b('0x9c')]),_0x2abc09]);return _0x4b2af4;}else{var _0x1624bf=squel['select']();_0x1624bf[_0xd14b('0x69')]('('+_0x459141['toString']()+')',_0xd14b('0x9d'));_0x1624bf[_0xd14b('0x3c')](_0xd14b('0x9e'),_0xd14b('0x1c'));_0x459141[_0xd14b('0x1e')](_0x2ddbc7['limit']||_0x16401a);_0x459141[_0xd14b('0x1d')](_0x2ddbc7[_0xd14b('0x1d')]||0x0);return db[_0xd14b('0x80')][_0xd14b('0x2d')](_0x1624bf[_0xd14b('0x7f')](),{'type':db['sequelize'][_0xd14b('0x81')][_0xd14b('0x82')]})[_0xd14b('0x23')](function(_0x1c294b){if(!_0x1c294b[_0xd14b('0x33')]){_0x3c6538=0x0;}else{_0x3c6538=_0x1c294b[0x0][_0xd14b('0x1c')]||0x0;}return db[_0xd14b('0x80')][_0xd14b('0x2d')](_0x459141['toString'](),{'type':db[_0xd14b('0x80')]['QueryTypes'][_0xd14b('0x82')]});})[_0xd14b('0x23')](function(_0x3ad3bd){return{'rows':_0x3ad3bd||[],'count':_0x3c6538};});}});}exports[_0xd14b('0x9f')]=function(_0xb54182,_0xa74064){return runReport(_0xb54182['params'],_0xb54182[_0xd14b('0x2d')],_0xb54182[_0xd14b('0x3d')])[_0xd14b('0x23')](respondWithResult(_0xa74064,null))[_0xd14b('0x46')](handleError(_0xa74064,null));};exports[_0xd14b('0xa0')]=runReport;exports[_0xd14b('0x2d')]=function(_0x77935c,_0x78f55){var _0x4e5b63=0xa;var _0x10af20=[_0xd14b('0x51'),_0xd14b('0x52'),_0xd14b('0x53'),_0xd14b('0x83')];var _0x2651f2={'SUM':'SUM(%s)','COUNT':_0xd14b('0x55'),'COUNT DISTINCT':_0xd14b('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd14b('0x5a'),'GROUP_CONCAT ASC':_0xd14b('0x5b'),'GROUP_CONCAT DESC':_0xd14b('0xa1')};var _0x457bd0={'SEC_TO_TIME':_0xd14b('0x84'),'DATE':_0xd14b('0x85'),'HOUR':'HOUR(%s)','ROUND':_0xd14b('0x86'),'UNIX_TIMESTAMP':_0xd14b('0x5d')};var _0x5e2405=function(_0x196c81){return!_[_0xd14b('0x5e')]([_0xd14b('0x5f'),_0xd14b('0xa2'),'IS\x20EMPTY',_0xd14b('0x61')],_0x196c81);};var _0x12e0ee=function(_0xc79889){if(!_0xc79889||!_0xc79889[_0xd14b('0x62')][_0xd14b('0x33')]){return'';}for(var _0x4fa172='(',_0x2cf866=0x0;_0x2cf866<_0xc79889[_0xd14b('0x62')][_0xd14b('0x33')];_0x2cf866+=0x1){_0x2cf866>0x0&&(_0x4fa172+='\x20'+_0xc79889[_0xd14b('0x87')]+'\x20');_0x4fa172+=_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x63')]?_0x12e0ee(_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x63')]):_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x3c')]+'\x20'+_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x64')]+(_0x5e2405(_0xc79889[_0xd14b('0x62')][_0x2cf866][_0xd14b('0x64')])?'\x20'+_0xc79889[_0xd14b('0x62')][_0x2cf866]['value']:'');}return _0x4fa172+')';};var _0x1f09b2={'where':{'id':_0x77935c['params']['id']}},_0x66c4c3,_0x575ce8,_0x49c51c,_0x2d686f,_0x1ce00a;_0x1f09b2=_[_0xd14b('0x38')]({},_0x1f09b2,_0x77935c[_0xd14b('0x3d')]);return db[_0xd14b('0x3e')]['find'](_0x1f09b2)['then'](function(_0xfcc5f){if(_0xfcc5f){_0x66c4c3=_0xfcc5f;return _0xfcc5f['getFields']();}return null;})[_0xd14b('0x23')](function(_0x48a678){if(_0x48a678){if(!_0x48a678[_0xd14b('0x33')]){throw new db['Sequelize'][(_0xd14b('0x89'))](_0xd14b('0x67'),0x193);}_0x575ce8=_0x48a678;return db[_0xd14b('0x8a')]['findAll']({'raw':!![]});}return null;})[_0xd14b('0x23')](function(_0x305c46){if(_0x305c46){_0x49c51c=_[_0xd14b('0x8b')](_0x305c46,'id');var _0x2302e7;var _0x8ed4d8=squel['select']();_0x8ed4d8[_0xd14b('0x69')](_0x66c4c3[_0xd14b('0x6a')]);for(var _0x569b8c=0x0;_0x569b8c<_0x575ce8['length'];_0x569b8c+=0x1){_0x2302e7=_0x575ce8[_0x569b8c][_0xd14b('0x6b')]?_0x49c51c[_0x575ce8[_0x569b8c]['MetricId']][_0xd14b('0x6c')]:_0x575ce8[_0x569b8c]['field'];_0x2302e7=_0x575ce8[_0x569b8c]['function']?_[_0xd14b('0x6e')](_0x2651f2[_0x575ce8[_0x569b8c][_0xd14b('0x6d')]],'%s',_0x2302e7):_0x2302e7;_0x2302e7=_0x575ce8[_0x569b8c][_0xd14b('0x6f')]?_[_0xd14b('0x6e')](_0x457bd0[_0x575ce8[_0x569b8c]['format']],'%s',_0x2302e7):_0x2302e7;if(_0x575ce8[_0x569b8c][_0xd14b('0x70')]){_0x8ed4d8[_0xd14b('0x63')](_0x2302e7);}_0x575ce8[_0x569b8c]['orderBy']&&_0x8ed4d8[_0xd14b('0x71')](_0x2302e7,_0x575ce8[_0x569b8c][_0xd14b('0x72')]===_0xd14b('0x73')?![]:!![]);_0x8ed4d8[_0xd14b('0x3c')](_0x2302e7,_0x575ce8[_0x569b8c][_0xd14b('0x74')]||_0x2302e7);}if(_0x66c4c3[_0xd14b('0x75')]){_0x66c4c3[_0xd14b('0x75')]=JSON[_0xd14b('0x76')](_0x66c4c3['joins']);for(var _0x45f3f3=0x0;_0x45f3f3<_0x66c4c3[_0xd14b('0x75')][_0xd14b('0x33')];_0x45f3f3+=0x1){if(_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x77')]&&_['includes'](_0x10af20,_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x77')])&&_0x66c4c3[_0xd14b('0x75')][_0x45f3f3]['parentKey']&&_0x66c4c3['joins'][_0x45f3f3][_0xd14b('0x79')]&&_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x8c')]){_0x8ed4d8[_0x66c4c3['joins'][_0x45f3f3][_0xd14b('0x77')]](_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x79')],null,util[_0xd14b('0x6f')]('%s.%s\x20=\x20%s.%s',_0x66c4c3[_0xd14b('0x6a')],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3]['parentKey'],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x79')],_0x66c4c3[_0xd14b('0x75')][_0x45f3f3][_0xd14b('0x8c')]));}}}if(_0x66c4c3[_0xd14b('0x7b')]){_0x66c4c3[_0xd14b('0x7b')]=JSON['parse'](_0x66c4c3[_0xd14b('0x7b')]);_0x8ed4d8[_0xd14b('0x36')](_0x12e0ee(_0x66c4c3[_0xd14b('0x7b')][_0xd14b('0x63')]));}_0x1ce00a=_0x8ed4d8[_0xd14b('0x7c')]();_0x8ed4d8[_0xd14b('0x1e')](_0x4e5b63);_0x8ed4d8[_0xd14b('0x1d')](0x0);logger[_0xd14b('0x7d')]('Limited\x20Query:',_0x8ed4d8[_0xd14b('0x7f')]());return db[_0xd14b('0x80')]['query'](_0x8ed4d8[_0xd14b('0x7f')](),{'type':db[_0xd14b('0x80')][_0xd14b('0x81')][_0xd14b('0x82')]});}})[_0xd14b('0x23')](function(){return{'sql':_0x1ce00a['toString']()};})[_0xd14b('0x23')](respondWithResult(_0x78f55,null))[_0xd14b('0x46')](handleError(_0x78f55,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4e55c22..34eb097 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 _0x39b2=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3ac2a9,_0x2ec310){var _0x5053b9=function(_0x5f3fb2){while(--_0x5f3fb2){_0x3ac2a9['push'](_0x3ac2a9['shift']());}};_0x5053b9(++_0x2ec310);}(_0x39b2,0x89));var _0x239b=function(_0x5d3c9,_0x2d49a7){_0x5d3c9=_0x5d3c9-0x0;var _0x54284c=_0x39b2[_0x5d3c9];return _0x54284c;};'use strict';var _=require(_0x239b('0x0'));var util=require(_0x239b('0x1'));var logger=require(_0x239b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x239b('0x3'));var rp=require(_0x239b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x239b('0x5'));var config=require(_0x239b('0x6'));var attributes=require(_0x239b('0x7'));module[_0x239b('0x8')]=function(_0x46a593,_0x13896f){return _0x46a593[_0x239b('0x9')](_0x239b('0xa'),attributes,{'tableName':_0x239b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfbb=['analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticDefaultReport.attributes','define'];(function(_0x5d572c,_0x53581f){var _0x5797cf=function(_0x5dcdd4){while(--_0x5dcdd4){_0x5d572c['push'](_0x5d572c['shift']());}};_0x5797cf(++_0x53581f);}(_0xbfbb,0x10f));var _0xbbfb=function(_0x5ec935,_0x3616fa){_0x5ec935=_0x5ec935-0x0;var _0x42d385=_0xbfbb[_0x5ec935];return _0x42d385;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var logger=require(_0xbbfb('0x2'))(_0xbbfb('0x3'));var moment=require(_0xbbfb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbfb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbfb('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbfb('0x7'));module['exports']=function(_0x216329,_0x161c30){return _0x216329[_0xbbfb('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xbbfb('0x9'),'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 8cc9b45..c8557fb 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x335a40,_0x4a3002){var _0x5d1309=function(_0x2a58f9){while(--_0x2a58f9){_0x335a40['push'](_0x335a40['shift']());}};_0x5d1309(++_0x4a3002);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0xcb91[_0x2351c4];return _0x1dd3f8;};'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')]('AnalyticDefaultReport,\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 _0xe706=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x38b106,_0x55f4be){var _0x3e89e6=function(_0x46f6fb){while(--_0x46f6fb){_0x38b106['push'](_0x38b106['shift']());}};_0x3e89e6(++_0x55f4be);}(_0xe706,0xa3));var _0x6e70=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0xe706[_0xd60cb];return _0x47eecd;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 6b86e5e..fcacb43 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 _0x684c=['multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x684c,0xdc));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var path=require(_0xc684('0x2'));var timeout=require('connect-timeout');var express=require(_0xc684('0x3'));var router=express[_0xc684('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc684('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xc684('0x6')]('/',auth[_0xc684('0x7')](),controller[_0xc684('0x8')]);router[_0xc684('0x6')]('/:id',auth[_0xc684('0x7')](),controller[_0xc684('0x9')]);router['get'](_0xc684('0xa'),auth[_0xc684('0x7')](),controller[_0xc684('0xb')]);router['get'](_0xc684('0xc'),auth[_0xc684('0x7')](),controller['run']);router[_0xc684('0x6')](_0xc684('0xd'),auth['isAuthenticated'](),controller['query']);router[_0xc684('0xe')]('/',auth['isAuthenticated'](),controller[_0xc684('0xf')]);router[_0xc684('0x10')](_0xc684('0x11'),auth[_0xc684('0x7')](),controller[_0xc684('0x12')]);router[_0xc684('0x13')](_0xc684('0x11'),auth['isAuthenticated'](),controller[_0xc684('0x14')]);module[_0xc684('0x15')]=router; \ No newline at end of file +var _0xb3e8=['/:id','isAuthenticated','show','/:id/preview','preview','run','query','post','create','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index'];(function(_0x2744d7,_0xfb0a15){var _0x2ee626=function(_0x29ba4e){while(--_0x29ba4e){_0x2744d7['push'](_0x2744d7['shift']());}};_0x2ee626(++_0xfb0a15);}(_0xb3e8,0x132));var _0x8b3e=function(_0x5105e8,_0x44a2e0){_0x5105e8=_0x5105e8-0x0;var _0x53bbf5=_0xb3e8[_0x5105e8];return _0x53bbf5;};'use strict';var multer=require('multer');var util=require(_0x8b3e('0x0'));var path=require(_0x8b3e('0x1'));var timeout=require(_0x8b3e('0x2'));var express=require(_0x8b3e('0x3'));var router=express[_0x8b3e('0x4')]();var auth=require(_0x8b3e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b3e('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x8b3e('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b3e('0x8')]);router[_0x8b3e('0x7')](_0x8b3e('0x9'),auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xb')]);router[_0x8b3e('0x7')](_0x8b3e('0xc'),auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xd')]);router[_0x8b3e('0x7')]('/:id/run',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xe')]);router[_0x8b3e('0x7')]('/:id/query',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0xf')]);router[_0x8b3e('0x10')]('/',auth[_0x8b3e('0xa')](),controller[_0x8b3e('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8b3e('0x12')]);router[_0x8b3e('0x13')](_0x8b3e('0x9'),auth[_0x8b3e('0xa')](),controller['destroy']);module[_0x8b3e('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 eae12be..1071a19 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 _0x16c5=['manual','scheduled','UNSIGNED','sequelize','moment','exports','ENUM','csv','pdf','STRING','DATE'];(function(_0x34533d,_0x5ad28d){var _0x18a738=function(_0x584858){while(--_0x584858){_0x34533d['push'](_0x34533d['shift']());}};_0x18a738(++_0x5ad28d);}(_0x16c5,0x184));var _0x516c=function(_0x13e42b,_0x55f150){_0x13e42b=_0x13e42b-0x0;var _0x265519=_0x16c5[_0x13e42b];return _0x265519;};'use strict';var Sequelize=require(_0x516c('0x0'));var moment=require(_0x516c('0x1'));module[_0x516c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x516c('0x3')](_0x516c('0x4'),_0x516c('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x516c('0x4')},'savename':{'type':Sequelize[_0x516c('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0x516c('0x7')]},'endDate':{'type':Sequelize[_0x516c('0x7')]},'status':{'type':Sequelize[_0x516c('0x6')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x516c('0x3')](_0x516c('0x8'),_0x516c('0x9')),'allowNull':![],'defaultValue':_0x516c('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x516c('0xa')]},'reportType':{'type':Sequelize[_0x516c('0x6')]}}; \ No newline at end of file +var _0x854a=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','Loading','manual','INTEGER'];(function(_0x5a7cbc,_0x573d85){var _0x44d2cc=function(_0x154862){while(--_0x154862){_0x5a7cbc['push'](_0x5a7cbc['shift']());}};_0x44d2cc(++_0x573d85);}(_0x854a,0xd9));var _0xa854=function(_0x55a12e,_0xc59cc6){_0x55a12e=_0x55a12e-0x0;var _0x431e69=_0x854a[_0x55a12e];return _0x431e69;};'use strict';var Sequelize=require(_0xa854('0x0'));var moment=require(_0xa854('0x1'));module[_0xa854('0x2')]={'name':{'type':Sequelize[_0xa854('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa854('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa854('0x4')](_0xa854('0x5'),_0xa854('0x6'),_0xa854('0x7')),'allowNull':![],'defaultValue':_0xa854('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xa854('0x3')],'defaultValue':_0xa854('0x8')},'type':{'type':Sequelize[_0xa854('0x4')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xa854('0x9')},'reportId':{'type':Sequelize[_0xa854('0xa')](0xb)[_0xa854('0xb')]},'reportType':{'type':Sequelize[_0xa854('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7812d66..9742413 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 _0x3a23=['rows','catch','params','create','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','format','%s.%s','output','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll'];(function(_0xa22961,_0x43b541){var _0x595e29=function(_0x500814){while(--_0x500814){_0xa22961['push'](_0xa22961['shift']());}};_0x595e29(++_0x43b541);}(_0x3a23,0x185));var _0x33a2=function(_0x284278,_0x560a3c){_0x284278=_0x284278-0x0;var _0x4dc622=_0x3a23[_0x284278];return _0x4dc622;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x33a2('0x0'));var zipdir=require(_0x33a2('0x1'));var jsonpatch=require(_0x33a2('0x2'));var rp=require(_0x33a2('0x3'));var moment=require(_0x33a2('0x4'));var BPromise=require(_0x33a2('0x5'));var Mustache=require(_0x33a2('0x6'));var util=require(_0x33a2('0x7'));var path=require(_0x33a2('0x8'));var sox=require(_0x33a2('0x9'));var csv=require(_0x33a2('0xa'));var ejs=require(_0x33a2('0xb'));var fs=require('fs');var _=require(_0x33a2('0xc'));var squel=require('squel');var crypto=require(_0x33a2('0xd'));var jsforce=require(_0x33a2('0xe'));var deskjs=require(_0x33a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x33a2('0x10'));var Papa=require(_0x33a2('0x11'));var Redis=require('ioredis');var authService=require(_0x33a2('0x12'));var qs=require(_0x33a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33a2('0x14'))('api');var utils=require(_0x33a2('0x15'));var config=require(_0x33a2('0x16'));var db=require(_0x33a2('0x17'))['db'];function respondWithStatusCode(_0x3475e7,_0x43bae2){_0x43bae2=_0x43bae2||0xcc;return function(_0x2b7fdf){if(_0x2b7fdf){return _0x3475e7[_0x33a2('0x18')](_0x43bae2);}return _0x3475e7[_0x33a2('0x19')](_0x43bae2)['end']();};}function respondWithResult(_0x14562f,_0x57a9d1){_0x57a9d1=_0x57a9d1||0xc8;return function(_0x234927){if(_0x234927){return _0x14562f[_0x33a2('0x19')](_0x57a9d1)['json'](_0x234927);}};}function respondWithFilteredResult(_0x4e469e,_0x5cb8e4){return function(_0x868c0c){if(_0x868c0c){var _0x4bd2f7=_0x868c0c[_0x33a2('0x1a')],_0x2708d9=_0x5cb8e4['offset'],_0x1efb05=_0x5cb8e4[_0x33a2('0x1b')]+_0x5cb8e4[_0x33a2('0x1c')],_0x2953a2;if(_0x1efb05>=_0x4bd2f7){_0x1efb05=_0x4bd2f7;_0x2953a2=0xc8;}else{_0x2953a2=0xce;}_0x4e469e['status'](_0x2953a2);return _0x4e469e['set'](_0x33a2('0x1d'),_0x2708d9+'-'+_0x1efb05+'/'+_0x4bd2f7)[_0x33a2('0x1e')](_0x868c0c);}return null;};}function patchUpdates(_0x2f3d27){return function(_0x29c8f3){try{jsonpatch[_0x33a2('0x1f')](_0x29c8f3,_0x2f3d27,!![]);}catch(_0x44cb8e){return BPromise['reject'](_0x44cb8e);}return _0x29c8f3[_0x33a2('0x20')]();};}function saveUpdates(_0x3f0059,_0xa5b54e){return function(_0x25ef3d){if(_0x25ef3d){return _0x25ef3d[_0x33a2('0x21')](_0x3f0059)[_0x33a2('0x22')](function(_0x48606f){return _0x48606f;});}return null;};}function removeEntity(_0x1d3ab2,_0x36f15e){return function(_0x4cbe6c){if(_0x4cbe6c){return _0x4cbe6c['destroy']()[_0x33a2('0x22')](function(){var _0x486c04=_0x4cbe6c[_0x33a2('0x23')]({'plain':!![]});var _0x1ea1d1='ExtractedReports';return db[_0x33a2('0x24')][_0x33a2('0x25')]({'where':{'type':_0x1ea1d1,'resourceId':_0x486c04['id']}})[_0x33a2('0x22')](function(){return _0x4cbe6c;});})[_0x33a2('0x22')](function(){_0x1d3ab2[_0x33a2('0x19')](0xcc)[_0x33a2('0x26')]();});}};}function handleEntityNotFound(_0x7a3ab6,_0x180654){return function(_0x56ae0f){if(!_0x56ae0f){_0x7a3ab6[_0x33a2('0x18')](0x194);}return _0x56ae0f;};}function handleError(_0x411b59,_0x2a70b7){_0x2a70b7=_0x2a70b7||0x1f4;return function(_0x4a101f){logger[_0x33a2('0x27')](_0x4a101f[_0x33a2('0x28')]);if(_0x4a101f[_0x33a2('0x29')]){delete _0x4a101f[_0x33a2('0x29')];}_0x411b59[_0x33a2('0x19')](_0x2a70b7)[_0x33a2('0x2a')](_0x4a101f);};}exports['index']=function(_0x8d31f5,_0xd8425){var _0x8c425a={},_0x2f2006={},_0x19a7e0={'count':0x0,'rows':[]};var _0x5a984d=db[_0x33a2('0x2b')][_0x33a2('0x2c')];_0x2f2006['model']=_[_0x33a2('0x2d')](_0x5a984d);_0x2f2006[_0x33a2('0x2e')]=_[_0x33a2('0x2d')](_0x8d31f5[_0x33a2('0x2e')]);_0x2f2006[_0x33a2('0x2f')]=_[_0x33a2('0x30')](_0x2f2006[_0x33a2('0x31')],_0x2f2006[_0x33a2('0x2e')]);_0x8c425a['attributes']=_['intersection'](_0x2f2006['model'],qs['fields'](_0x8d31f5[_0x33a2('0x2e')][_0x33a2('0x32')]));_0x8c425a[_0x33a2('0x33')]=_0x8c425a[_0x33a2('0x33')][_0x33a2('0x34')]?_0x8c425a[_0x33a2('0x33')]:_0x2f2006[_0x33a2('0x31')];if(!_0x8d31f5[_0x33a2('0x2e')]['hasOwnProperty'](_0x33a2('0x35'))){_0x8c425a[_0x33a2('0x1c')]=qs['limit'](_0x8d31f5['query'][_0x33a2('0x1c')]);_0x8c425a[_0x33a2('0x1b')]=qs[_0x33a2('0x1b')](_0x8d31f5[_0x33a2('0x2e')]['offset']);}_0x8c425a[_0x33a2('0x36')]=qs[_0x33a2('0x37')](_0x8d31f5['query'][_0x33a2('0x37')]);_0x8c425a[_0x33a2('0x38')]=qs['filters'](_[_0x33a2('0x39')](_0x8d31f5[_0x33a2('0x2e')],_0x2f2006[_0x33a2('0x2f')]));if(_0x8d31f5['query'][_0x33a2('0x3a')]){_0x8c425a['where']=_[_0x33a2('0x3b')](_0x8c425a[_0x33a2('0x38')],{'$or':_['map'](_0x5a984d,function(_0x1b4d48){if(_0x1b4d48['type'][_0x33a2('0x3c')]!==_0x33a2('0x3d')){var _0x434920={};_0x434920[_0x1b4d48[_0x33a2('0x3e')]]={'$like':'%'+_0x8d31f5['query'][_0x33a2('0x3a')]+'%'};return _0x434920;}})});}_0x8c425a=_['merge']({},_0x8c425a,_0x8d31f5[_0x33a2('0x3f')]);var _0x250272={'where':_0x8c425a['where']};return db['AnalyticExtractedReport'][_0x33a2('0x1a')](_0x250272)[_0x33a2('0x22')](function(_0x7c54e1){_0x19a7e0[_0x33a2('0x1a')]=_0x7c54e1;if(_0x8d31f5[_0x33a2('0x2e')][_0x33a2('0x40')]){_0x8c425a['include']=[{'all':!![]}];}return db[_0x33a2('0x2b')][_0x33a2('0x41')](_0x8c425a);})[_0x33a2('0x22')](function(_0x44119e){_0x19a7e0[_0x33a2('0x42')]=_0x44119e;return _0x19a7e0;})[_0x33a2('0x22')](respondWithFilteredResult(_0xd8425,_0x8c425a))[_0x33a2('0x43')](handleError(_0xd8425,null));};exports['show']=function(_0x4ca03a,_0x112375){var _0x30588e={'raw':!![],'where':{'id':_0x4ca03a[_0x33a2('0x44')]['id']}},_0xef1ece={};_0xef1ece[_0x33a2('0x31')]=_[_0x33a2('0x2d')](db[_0x33a2('0x2b')][_0x33a2('0x2c')]);_0xef1ece['query']=_[_0x33a2('0x2d')](_0x4ca03a[_0x33a2('0x2e')]);_0xef1ece[_0x33a2('0x2f')]=_[_0x33a2('0x30')](_0xef1ece[_0x33a2('0x31')],_0xef1ece[_0x33a2('0x2e')]);_0x30588e[_0x33a2('0x33')]=_['intersection'](_0xef1ece['model'],qs[_0x33a2('0x32')](_0x4ca03a[_0x33a2('0x2e')][_0x33a2('0x32')]));_0x30588e[_0x33a2('0x33')]=_0x30588e[_0x33a2('0x33')][_0x33a2('0x34')]?_0x30588e[_0x33a2('0x33')]:_0xef1ece['model'];if(_0x4ca03a['query']['includeAll']){_0x30588e['include']=[{'all':!![]}];}_0x30588e=_['merge']({},_0x30588e,_0x4ca03a[_0x33a2('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x30588e)['then'](handleEntityNotFound(_0x112375,null))[_0x33a2('0x22')](respondWithResult(_0x112375,null))[_0x33a2('0x43')](handleError(_0x112375,null));};exports[_0x33a2('0x45')]=function(_0x355151,_0x3b083f){return db['AnalyticExtractedReport'][_0x33a2('0x45')](_0x355151['body'],{})[_0x33a2('0x22')](function(_0x41c8b9){var _0x247e98=_0x355151[_0x33a2('0x46')][_0x33a2('0x23')]({'plain':!![]});if(!_0x247e98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x247e98[_0x33a2('0x47')]==='user'){var _0x36aff5=_0x41c8b9['get']({'plain':!![]});var _0x3e208d=_0x33a2('0x48');return db[_0x33a2('0x49')]['find']({'where':{'name':_0x3e208d,'userProfileId':_0x247e98[_0x33a2('0x4a')]},'raw':!![]})[_0x33a2('0x22')](function(_0xbf5a37){if(_0xbf5a37&&_0xbf5a37[_0x33a2('0x4b')]===0x0){return db['UserProfileResource'][_0x33a2('0x45')]({'name':_0x36aff5[_0x33a2('0x29')],'resourceId':_0x36aff5['id'],'type':_0xbf5a37['name'],'sectionId':_0xbf5a37['id']},{})[_0x33a2('0x22')](function(){return _0x41c8b9;});}else{return _0x41c8b9;}})[_0x33a2('0x43')](function(_0x1d1a19){logger[_0x33a2('0x27')](_0x33a2('0x4c'),_0x1d1a19);throw _0x1d1a19;});}return _0x41c8b9;})[_0x33a2('0x22')](respondWithResult(_0x3b083f,0xc9))[_0x33a2('0x43')](handleError(_0x3b083f,null));};exports[_0x33a2('0x21')]=function(_0x154f38,_0x221839){if(_0x154f38[_0x33a2('0x4d')]['id']){delete _0x154f38[_0x33a2('0x4d')]['id'];}return db[_0x33a2('0x2b')][_0x33a2('0x4e')]({'where':{'id':_0x154f38[_0x33a2('0x44')]['id']}})[_0x33a2('0x22')](handleEntityNotFound(_0x221839,null))[_0x33a2('0x22')](saveUpdates(_0x154f38[_0x33a2('0x4d')],null))['then'](respondWithResult(_0x221839,null))['catch'](handleError(_0x221839,null));};exports[_0x33a2('0x25')]=function(_0x1f0386,_0x3c2f7f){return db['AnalyticExtractedReport'][_0x33a2('0x4e')]({'where':{'id':_0x1f0386[_0x33a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c2f7f,null))[_0x33a2('0x22')](removeEntity(_0x3c2f7f,null))[_0x33a2('0x43')](handleError(_0x3c2f7f,null));};exports[_0x33a2('0x4f')]=function(_0x5e5832,_0x29c6f7,_0x442faf){return db[_0x33a2('0x2b')]['find']({'where':{'id':_0x5e5832[_0x33a2('0x44')]['id']},'attributes':[_0x33a2('0x29'),_0x33a2('0x50'),_0x33a2('0x51'),'output'],'raw':!![]})[_0x33a2('0x22')](handleEntityNotFound(_0x29c6f7,null))[_0x33a2('0x22')](function(_0x341186){if(_0x341186){if(!fs[_0x33a2('0x52')](path[_0x33a2('0x53')](config[_0x33a2('0x54')],_0x33a2('0x55'),_0x341186['savename']))){throw new db['Sequelize'][(_0x33a2('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5e5832['query']['exists']){return _0x29c6f7[_0x33a2('0x18')](0xc8);}return _0x29c6f7['download'](path[_0x33a2('0x53')](config[_0x33a2('0x54')],_0x33a2('0x55'),_0x341186[_0x33a2('0x51')]),util[_0x33a2('0x57')](_0x33a2('0x58'),_0x341186[_0x33a2('0x50')]||_0x341186[_0x33a2('0x29')],_0x341186[_0x33a2('0x59')][_0x33a2('0x5a')]()));}})[_0x33a2('0x43')](handleError(_0x29c6f7,null));}; \ No newline at end of file +var _0xc0fc=['format','%s.%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','index','AnalyticExtractedReport','keys','intersection','query','attributes','model','fields','length','order','sort','where','filters','pick','map','type','key','field','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty'];(function(_0x1ca995,_0x458edc){var _0x6c1cbb=function(_0x109124){while(--_0x109124){_0x1ca995['push'](_0x1ca995['shift']());}};_0x6c1cbb(++_0x458edc);}(_0xc0fc,0x166));var _0xcc0f=function(_0x5226ed,_0x2c5a59){_0x5226ed=_0x5226ed-0x0;var _0x2101b6=_0xc0fc[_0x5226ed];return _0x2101b6;};'use strict';var pdf=require(_0xcc0f('0x0'));var emlformat=require(_0xcc0f('0x1'));var rimraf=require(_0xcc0f('0x2'));var zipdir=require(_0xcc0f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc0f('0x4'));var moment=require(_0xcc0f('0x5'));var BPromise=require(_0xcc0f('0x6'));var Mustache=require(_0xcc0f('0x7'));var util=require('util');var path=require(_0xcc0f('0x8'));var sox=require('sox');var csv=require(_0xcc0f('0x9'));var ejs=require(_0xcc0f('0xa'));var fs=require('fs');var _=require(_0xcc0f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc0f('0xc'));var deskjs=require(_0xcc0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcc0f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcc0f('0xf'));var qs=require(_0xcc0f('0x10'));var hardwareService=require(_0xcc0f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xcc0f('0x12'));var config=require(_0xcc0f('0x13'));var db=require(_0xcc0f('0x14'))['db'];function respondWithStatusCode(_0x567cab,_0x17de05){_0x17de05=_0x17de05||0xcc;return function(_0x20f56a){if(_0x20f56a){return _0x567cab[_0xcc0f('0x15')](_0x17de05);}return _0x567cab['status'](_0x17de05)[_0xcc0f('0x16')]();};}function respondWithResult(_0xd9183e,_0x49739f){_0x49739f=_0x49739f||0xc8;return function(_0xd528ca){if(_0xd528ca){return _0xd9183e['status'](_0x49739f)[_0xcc0f('0x17')](_0xd528ca);}};}function respondWithFilteredResult(_0x128ed6,_0x4530dc){return function(_0x26f830){if(_0x26f830){var _0x822369=_0x26f830[_0xcc0f('0x18')],_0x37ed20=_0x4530dc[_0xcc0f('0x19')],_0xe6d2a4=_0x4530dc[_0xcc0f('0x19')]+_0x4530dc[_0xcc0f('0x1a')],_0x5090d8;if(_0xe6d2a4>=_0x822369){_0xe6d2a4=_0x822369;_0x5090d8=0xc8;}else{_0x5090d8=0xce;}_0x128ed6[_0xcc0f('0x1b')](_0x5090d8);return _0x128ed6[_0xcc0f('0x1c')](_0xcc0f('0x1d'),_0x37ed20+'-'+_0xe6d2a4+'/'+_0x822369)[_0xcc0f('0x17')](_0x26f830);}return null;};}function patchUpdates(_0x2269ad){return function(_0xedfedc){try{jsonpatch[_0xcc0f('0x1e')](_0xedfedc,_0x2269ad,!![]);}catch(_0x50b9bc){return BPromise[_0xcc0f('0x1f')](_0x50b9bc);}return _0xedfedc[_0xcc0f('0x20')]();};}function saveUpdates(_0x4db605,_0x358c87){return function(_0x490ad5){if(_0x490ad5){return _0x490ad5['update'](_0x4db605)[_0xcc0f('0x21')](function(_0x14071d){return _0x14071d;});}return null;};}function removeEntity(_0x3f0643,_0x555f58){return function(_0x427176){if(_0x427176){return _0x427176[_0xcc0f('0x22')]()[_0xcc0f('0x21')](function(){var _0x58104f=_0x427176[_0xcc0f('0x23')]({'plain':!![]});var _0x3d3362=_0xcc0f('0x24');return db[_0xcc0f('0x25')][_0xcc0f('0x22')]({'where':{'type':_0x3d3362,'resourceId':_0x58104f['id']}})[_0xcc0f('0x21')](function(){return _0x427176;});})[_0xcc0f('0x21')](function(){_0x3f0643[_0xcc0f('0x1b')](0xcc)[_0xcc0f('0x16')]();});}};}function handleEntityNotFound(_0x5caef5,_0x446e2b){return function(_0x1022c7){if(!_0x1022c7){_0x5caef5[_0xcc0f('0x15')](0x194);}return _0x1022c7;};}function handleError(_0x164e23,_0x4ddaa0){_0x4ddaa0=_0x4ddaa0||0x1f4;return function(_0x49d1d8){logger[_0xcc0f('0x26')](_0x49d1d8['stack']);if(_0x49d1d8[_0xcc0f('0x27')]){delete _0x49d1d8[_0xcc0f('0x27')];}_0x164e23[_0xcc0f('0x1b')](_0x4ddaa0)['send'](_0x49d1d8);};}exports[_0xcc0f('0x28')]=function(_0x2f23dc,_0x3ac31e){var _0x287cd1={},_0x1e4f3c={},_0x59c36a={'count':0x0,'rows':[]};var _0x399e48=db[_0xcc0f('0x29')]['rawAttributes'];_0x1e4f3c['model']=_[_0xcc0f('0x2a')](_0x399e48);_0x1e4f3c['query']=_[_0xcc0f('0x2a')](_0x2f23dc['query']);_0x1e4f3c['filters']=_[_0xcc0f('0x2b')](_0x1e4f3c['model'],_0x1e4f3c[_0xcc0f('0x2c')]);_0x287cd1[_0xcc0f('0x2d')]=_['intersection'](_0x1e4f3c[_0xcc0f('0x2e')],qs[_0xcc0f('0x2f')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x2f')]));_0x287cd1[_0xcc0f('0x2d')]=_0x287cd1['attributes'][_0xcc0f('0x30')]?_0x287cd1[_0xcc0f('0x2d')]:_0x1e4f3c['model'];if(!_0x2f23dc[_0xcc0f('0x2c')]['hasOwnProperty']('nolimit')){_0x287cd1['limit']=qs[_0xcc0f('0x1a')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x1a')]);_0x287cd1[_0xcc0f('0x19')]=qs['offset'](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x19')]);}_0x287cd1[_0xcc0f('0x31')]=qs[_0xcc0f('0x32')](_0x2f23dc[_0xcc0f('0x2c')][_0xcc0f('0x32')]);_0x287cd1[_0xcc0f('0x33')]=qs[_0xcc0f('0x34')](_[_0xcc0f('0x35')](_0x2f23dc[_0xcc0f('0x2c')],_0x1e4f3c[_0xcc0f('0x34')]));if(_0x2f23dc['query']['filter']){_0x287cd1['where']=_['merge'](_0x287cd1[_0xcc0f('0x33')],{'$or':_[_0xcc0f('0x36')](_0x399e48,function(_0x2573bd){if(_0x2573bd[_0xcc0f('0x37')][_0xcc0f('0x38')]!=='VIRTUAL'){var _0x3fc42e={};_0x3fc42e[_0x2573bd[_0xcc0f('0x39')]]={'$like':'%'+_0x2f23dc['query'][_0xcc0f('0x3a')]+'%'};return _0x3fc42e;}})});}_0x287cd1=_[_0xcc0f('0x3b')]({},_0x287cd1,_0x2f23dc[_0xcc0f('0x3c')]);var _0x4b439d={'where':_0x287cd1[_0xcc0f('0x33')]};return db[_0xcc0f('0x29')][_0xcc0f('0x18')](_0x4b439d)[_0xcc0f('0x21')](function(_0x530e25){_0x59c36a[_0xcc0f('0x18')]=_0x530e25;if(_0x2f23dc['query']['includeAll']){_0x287cd1[_0xcc0f('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xcc0f('0x3e')](_0x287cd1);})[_0xcc0f('0x21')](function(_0x3a9496){_0x59c36a[_0xcc0f('0x3f')]=_0x3a9496;return _0x59c36a;})['then'](respondWithFilteredResult(_0x3ac31e,_0x287cd1))[_0xcc0f('0x40')](handleError(_0x3ac31e,null));};exports[_0xcc0f('0x41')]=function(_0x3a238d,_0x19c08b){var _0x1d4e33={'raw':!![],'where':{'id':_0x3a238d[_0xcc0f('0x42')]['id']}},_0x25c875={};_0x25c875[_0xcc0f('0x2e')]=_['keys'](db['AnalyticExtractedReport'][_0xcc0f('0x43')]);_0x25c875['query']=_[_0xcc0f('0x2a')](_0x3a238d[_0xcc0f('0x2c')]);_0x25c875[_0xcc0f('0x34')]=_[_0xcc0f('0x2b')](_0x25c875['model'],_0x25c875['query']);_0x1d4e33['attributes']=_[_0xcc0f('0x2b')](_0x25c875['model'],qs['fields'](_0x3a238d[_0xcc0f('0x2c')][_0xcc0f('0x2f')]));_0x1d4e33[_0xcc0f('0x2d')]=_0x1d4e33['attributes'][_0xcc0f('0x30')]?_0x1d4e33[_0xcc0f('0x2d')]:_0x25c875['model'];if(_0x3a238d[_0xcc0f('0x2c')][_0xcc0f('0x44')]){_0x1d4e33['include']=[{'all':!![]}];}_0x1d4e33=_[_0xcc0f('0x3b')]({},_0x1d4e33,_0x3a238d[_0xcc0f('0x3c')]);return db[_0xcc0f('0x29')][_0xcc0f('0x45')](_0x1d4e33)[_0xcc0f('0x21')](handleEntityNotFound(_0x19c08b,null))[_0xcc0f('0x21')](respondWithResult(_0x19c08b,null))['catch'](handleError(_0x19c08b,null));};exports[_0xcc0f('0x46')]=function(_0x48ee28,_0x50519d){return db[_0xcc0f('0x29')][_0xcc0f('0x46')](_0x48ee28[_0xcc0f('0x47')],{})[_0xcc0f('0x21')](function(_0xd7151d){var _0x2f9df5=_0x48ee28['user'][_0xcc0f('0x23')]({'plain':!![]});if(!_0x2f9df5)throw new Error(_0xcc0f('0x48'));if(_0x2f9df5['role']==='user'){var _0x222cc9=_0xd7151d[_0xcc0f('0x23')]({'plain':!![]});var _0x5443f3=_0xcc0f('0x24');return db['UserProfileSection'][_0xcc0f('0x45')]({'where':{'name':_0x5443f3,'userProfileId':_0x2f9df5[_0xcc0f('0x49')]},'raw':!![]})[_0xcc0f('0x21')](function(_0x532f3f){if(_0x532f3f&&_0x532f3f[_0xcc0f('0x4a')]===0x0){return db[_0xcc0f('0x25')][_0xcc0f('0x46')]({'name':_0x222cc9['name'],'resourceId':_0x222cc9['id'],'type':_0x532f3f[_0xcc0f('0x27')],'sectionId':_0x532f3f['id']},{})[_0xcc0f('0x21')](function(){return _0xd7151d;});}else{return _0xd7151d;}})[_0xcc0f('0x40')](function(_0x24647b){logger[_0xcc0f('0x26')](_0xcc0f('0x4b'),_0x24647b);throw _0x24647b;});}return _0xd7151d;})['then'](respondWithResult(_0x50519d,0xc9))['catch'](handleError(_0x50519d,null));};exports['update']=function(_0x520502,_0x3f01d8){if(_0x520502[_0xcc0f('0x47')]['id']){delete _0x520502[_0xcc0f('0x47')]['id'];}return db[_0xcc0f('0x29')][_0xcc0f('0x45')]({'where':{'id':_0x520502[_0xcc0f('0x42')]['id']}})[_0xcc0f('0x21')](handleEntityNotFound(_0x3f01d8,null))[_0xcc0f('0x21')](saveUpdates(_0x520502[_0xcc0f('0x47')],null))[_0xcc0f('0x21')](respondWithResult(_0x3f01d8,null))[_0xcc0f('0x40')](handleError(_0x3f01d8,null));};exports[_0xcc0f('0x22')]=function(_0xd69659,_0x485a4f){return db['AnalyticExtractedReport'][_0xcc0f('0x45')]({'where':{'id':_0xd69659[_0xcc0f('0x42')]['id']}})[_0xcc0f('0x21')](handleEntityNotFound(_0x485a4f,null))['then'](removeEntity(_0x485a4f,null))[_0xcc0f('0x40')](handleError(_0x485a4f,null));};exports[_0xcc0f('0x4c')]=function(_0xe8d215,_0x2031eb,_0x119a00){return db['AnalyticExtractedReport'][_0xcc0f('0x45')]({'where':{'id':_0xe8d215[_0xcc0f('0x42')]['id']},'attributes':[_0xcc0f('0x27'),_0xcc0f('0x4d'),'savename',_0xcc0f('0x4e')],'raw':!![]})[_0xcc0f('0x21')](handleEntityNotFound(_0x2031eb,null))[_0xcc0f('0x21')](function(_0x5630ed){if(_0x5630ed){if(!fs[_0xcc0f('0x4f')](path[_0xcc0f('0x50')](config[_0xcc0f('0x51')],_0xcc0f('0x52'),_0x5630ed[_0xcc0f('0x53')]))){throw new db[(_0xcc0f('0x54'))][(_0xcc0f('0x55'))](_0xcc0f('0x56'));}if(_0xe8d215[_0xcc0f('0x2c')]['exists']){return _0x2031eb[_0xcc0f('0x15')](0xc8);}return _0x2031eb['download'](path[_0xcc0f('0x50')](config['root'],_0xcc0f('0x52'),_0x5630ed[_0xcc0f('0x53')]),util[_0xcc0f('0x57')](_0xcc0f('0x58'),_0x5630ed[_0xcc0f('0x4d')]||_0x5630ed[_0xcc0f('0x27')],_0x5630ed[_0xcc0f('0x4e')]['toLowerCase']()));}})['catch'](handleError(_0x2031eb,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 171513f..9dd1e14 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 _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x64b474,_0x39e1b3){var _0x132fff=function(_0x2ec1ee){while(--_0x2ec1ee){_0x64b474['push'](_0x64b474['shift']());}};_0x132fff(++_0x39e1b3);}(_0x5d17,0x114));var _0x75d1=function(_0x827d61,_0x127d23){_0x827d61=_0x827d61-0x0;var _0x3d2398=_0x5d17[_0x827d61];return _0x3d2398;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5089=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x241b92,_0x1526dd){var _0x575bb4=function(_0xf8e35d){while(--_0xf8e35d){_0x241b92['push'](_0x241b92['shift']());}};_0x575bb4(++_0x1526dd);}(_0x5089,0x1bb));var _0x9508=function(_0x44b346,_0xeb097d){_0x44b346=_0x44b346-0x0;var _0x1c2f2b=_0x5089[_0x44b346];return _0x1c2f2b;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('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 bacb85a..85aa554 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 _0xdd0b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring'];(function(_0x14b6c0,_0x306bc5){var _0x507e5f=function(_0x2bc320){while(--_0x2bc320){_0x14b6c0['push'](_0x14b6c0['shift']());}};_0x507e5f(++_0x306bc5);}(_0xdd0b,0x123));var _0xbdd0=function(_0x27f398,_0x349e0b){_0x27f398=_0x27f398-0x0;var _0x1dd2b4=_0xdd0b[_0x27f398];return _0x1dd2b4;};'use strict';var _=require(_0xbdd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdd0('0x1'));var rs=require(_0xbdd0('0x2'));var fs=require('fs');var Redis=require(_0xbdd0('0x3'));var db=require(_0xbdd0('0x4'))['db'];var utils=require(_0xbdd0('0x5'));var logger=require(_0xbdd0('0x6'))(_0xbdd0('0x7'));var config=require(_0xbdd0('0x8'));var jayson=require(_0xbdd0('0x9'));var client=jayson[_0xbdd0('0xa')][_0xbdd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9658,_0x2dc7b9,_0x5b9ee1){return new BPromise(function(_0x3a540b,_0x1a3ad4){return client['request'](_0x1c9658,_0x5b9ee1)[_0xbdd0('0xc')](function(_0x4fd231){logger['info'](_0xbdd0('0xd'),_0x2dc7b9,_0xbdd0('0xe'));logger[_0xbdd0('0xf')](_0xbdd0('0x10'),_0x2dc7b9,_0xbdd0('0xe'),JSON[_0xbdd0('0x11')](_0x4fd231));if(_0x4fd231[_0xbdd0('0x12')]){if(_0x4fd231[_0xbdd0('0x12')]['code']===0x1f4){logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4fd231[_0xbdd0('0x12')]['message']);return _0x1a3ad4(_0x4fd231[_0xbdd0('0x12')][_0xbdd0('0x13')]);}logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4fd231[_0xbdd0('0x12')][_0xbdd0('0x13')]);return _0x3a540b(_0x4fd231[_0xbdd0('0x12')]['message']);}else{logger['info'](_0xbdd0('0xd'),_0x2dc7b9,_0xbdd0('0xe'));_0x3a540b(_0x4fd231['result'][_0xbdd0('0x13')]);}})[_0xbdd0('0x14')](function(_0x4a7f97){logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4a7f97);_0x1a3ad4(_0x4a7f97);});});} \ No newline at end of file +var _0x25db=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x25db,0x137));var _0xb25d=function(_0x3aa395,_0x5c8396){_0x3aa395=_0x3aa395-0x0;var _0x5eb46b=_0x25db[_0x3aa395];return _0x5eb46b;};'use strict';var _=require(_0xb25d('0x0'));var util=require(_0xb25d('0x1'));var moment=require(_0xb25d('0x2'));var BPromise=require(_0xb25d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb25d('0x4'));var db=require(_0xb25d('0x5'))['db'];var utils=require(_0xb25d('0x6'));var logger=require(_0xb25d('0x7'))(_0xb25d('0x8'));var config=require(_0xb25d('0x9'));var jayson=require(_0xb25d('0xa'));var client=jayson[_0xb25d('0xb')][_0xb25d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b5d91,_0x433d53,_0x5b26de){return new BPromise(function(_0x4051bc,_0x32f6cb){return client[_0xb25d('0xd')](_0x4b5d91,_0x5b26de)[_0xb25d('0xe')](function(_0xb53a6d){logger[_0xb25d('0xf')](_0xb25d('0x10'),_0x433d53,_0xb25d('0x11'));logger[_0xb25d('0x12')](_0xb25d('0x13'),_0x433d53,_0xb25d('0x11'),JSON[_0xb25d('0x14')](_0xb53a6d));if(_0xb53a6d[_0xb25d('0x15')]){if(_0xb53a6d['error']['code']===0x1f4){logger[_0xb25d('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb53a6d['error'][_0xb25d('0x16')]);return _0x32f6cb(_0xb53a6d[_0xb25d('0x15')][_0xb25d('0x16')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb53a6d[_0xb25d('0x15')]['message']);return _0x4051bc(_0xb53a6d[_0xb25d('0x15')][_0xb25d('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x433d53,_0xb25d('0x11'));_0x4051bc(_0xb53a6d[_0xb25d('0x17')][_0xb25d('0x16')]);}})['catch'](function(_0x3af20e){logger[_0xb25d('0x15')](_0xb25d('0x10'),_0x433d53,_0x3af20e);_0x32f6cb(_0x3af20e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2c50460..c10cae6 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 _0x741a=['./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28ea59,_0x4f6956){var _0x5241b9=function(_0x2d5a07){while(--_0x2d5a07){_0x28ea59['push'](_0x28ea59['shift']());}};_0x5241b9(++_0x4f6956);}(_0x741a,0x1cd));var _0xa741=function(_0x5e99ae,_0x37d21f){_0x5e99ae=_0x5e99ae-0x0;var _0x286019=_0x741a[_0x5e99ae];return _0x286019;};'use strict';var multer=require(_0xa741('0x0'));var util=require(_0xa741('0x1'));var path=require(_0xa741('0x2'));var timeout=require(_0xa741('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xa741('0x4'));var interaction=require(_0xa741('0x5'));var config=require(_0xa741('0x6'));var controller=require(_0xa741('0x7'));router[_0xa741('0x8')]('/',auth[_0xa741('0x9')](),controller['index']);router[_0xa741('0x8')]('/:id',auth[_0xa741('0x9')](),controller[_0xa741('0xa')]);router[_0xa741('0x8')](_0xa741('0xb'),auth[_0xa741('0x9')](),controller[_0xa741('0xc')]);router[_0xa741('0xd')]('/',auth[_0xa741('0x9')](),controller[_0xa741('0xe')]);router[_0xa741('0xf')]('/:id',auth[_0xa741('0x9')](),controller[_0xa741('0x10')]);router[_0xa741('0x11')]('/:id',auth[_0xa741('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x52f6=['../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','put','update','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52f6,0xbb));var _0x652f=function(_0xe386b0,_0x458c4d){_0xe386b0=_0xe386b0-0x0;var _0x2906d5=_0x52f6[_0xe386b0];return _0x2906d5;};'use strict';var multer=require('multer');var util=require(_0x652f('0x0'));var path=require('path');var timeout=require(_0x652f('0x1'));var express=require('express');var router=express[_0x652f('0x2')]();var auth=require(_0x652f('0x3'));var interaction=require(_0x652f('0x4'));var config=require(_0x652f('0x5'));var controller=require(_0x652f('0x6'));router[_0x652f('0x7')]('/',auth['isAuthenticated'](),controller[_0x652f('0x8')]);router[_0x652f('0x7')](_0x652f('0x9'),auth[_0x652f('0xa')](),controller['show']);router['get'](_0x652f('0xb'),auth[_0x652f('0xa')](),controller['download']);router[_0x652f('0xc')]('/',auth[_0x652f('0xa')](),controller['create']);router[_0x652f('0xd')]('/:id',auth[_0x652f('0xa')](),controller[_0x652f('0xe')]);router['delete'](_0x652f('0x9'),auth[_0x652f('0xa')](),controller['destroy']);module[_0x652f('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9e10888..c4f666b 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 _0x7d4a=['TEXT','STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7d4a,0x112));var _0xa7d4=function(_0xd4d36d,_0x446b7c){_0xd4d36d=_0xd4d36d-0x0;var _0x491208=_0x7d4a[_0xd4d36d];return _0x491208;};'use strict';var Sequelize=require(_0xa7d4('0x0'));module[_0xa7d4('0x1')]={'field':{'type':Sequelize[_0xa7d4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa7d4('0x3')]},'format':{'type':Sequelize[_0xa7d4('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x32d4=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xcd7990,_0x570a18){var _0x2b9cfa=function(_0x231aa2){while(--_0x231aa2){_0xcd7990['push'](_0xcd7990['shift']());}};_0x2b9cfa(++_0x570a18);}(_0x32d4,0x94));var _0x432d=function(_0x23ec4c,_0x3cde1e){_0x23ec4c=_0x23ec4c-0x0;var _0x3b58be=_0x32d4[_0x23ec4c];return _0x3b58be;};'use strict';var Sequelize=require(_0x432d('0x0'));module[_0x432d('0x1')]={'field':{'type':Sequelize[_0x432d('0x2')]},'alias':{'type':Sequelize[_0x432d('0x3')]},'function':{'type':Sequelize[_0x432d('0x3')]},'format':{'type':Sequelize[_0x432d('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x432d('0x3')]},'custom':{'type':Sequelize[_0x432d('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9572f29..b2a435d 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 _0x6f33=['attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','transaction','map','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','then','error','stack','name','index','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','fields'];(function(_0x1e373e,_0x236080){var _0x572e59=function(_0x4e97d9){while(--_0x4e97d9){_0x1e373e['push'](_0x1e373e['shift']());}};_0x572e59(++_0x236080);}(_0x6f33,0x162));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x36f3('0x0'));var emlformat=require(_0x36f3('0x1'));var rimraf=require(_0x36f3('0x2'));var zipdir=require(_0x36f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36f3('0x4'));var moment=require(_0x36f3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36f3('0x6'));var util=require(_0x36f3('0x7'));var path=require('path');var sox=require(_0x36f3('0x8'));var csv=require('to-csv');var ejs=require(_0x36f3('0x9'));var fs=require('fs');var _=require(_0x36f3('0xa'));var squel=require(_0x36f3('0xb'));var crypto=require(_0x36f3('0xc'));var jsforce=require(_0x36f3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x36f3('0xe'));var querystring=require('querystring');var Papa=require(_0x36f3('0xf'));var Redis=require(_0x36f3('0x10'));var authService=require(_0x36f3('0x11'));var qs=require(_0x36f3('0x12'));var hardwareService=require(_0x36f3('0x13'));var logger=require('../../config/logger')(_0x36f3('0x14'));var utils=require(_0x36f3('0x15'));var config=require(_0x36f3('0x16'));var db=require(_0x36f3('0x17'))['db'];function respondWithStatusCode(_0x1cadc0,_0x10999c){_0x10999c=_0x10999c||0xcc;return function(_0x9ab9a5){if(_0x9ab9a5){return _0x1cadc0[_0x36f3('0x18')](_0x10999c);}return _0x1cadc0[_0x36f3('0x19')](_0x10999c)[_0x36f3('0x1a')]();};}function respondWithResult(_0x17ac44,_0x2ecec1){_0x2ecec1=_0x2ecec1||0xc8;return function(_0x15f777){if(_0x15f777){return _0x17ac44[_0x36f3('0x19')](_0x2ecec1)[_0x36f3('0x1b')](_0x15f777);}};}function respondWithFilteredResult(_0xc07f9b,_0x3d2b46){return function(_0x35d622){if(_0x35d622){var _0x20890f=_0x35d622['count'],_0x2c877a=_0x3d2b46[_0x36f3('0x1c')],_0x38922b=_0x3d2b46[_0x36f3('0x1c')]+_0x3d2b46[_0x36f3('0x1d')],_0x280a8a;if(_0x38922b>=_0x20890f){_0x38922b=_0x20890f;_0x280a8a=0xc8;}else{_0x280a8a=0xce;}_0xc07f9b[_0x36f3('0x19')](_0x280a8a);return _0xc07f9b[_0x36f3('0x1e')]('Content-Range',_0x2c877a+'-'+_0x38922b+'/'+_0x20890f)[_0x36f3('0x1b')](_0x35d622);}return null;};}function patchUpdates(_0x2f1538){return function(_0x51cdd7){try{jsonpatch[_0x36f3('0x1f')](_0x51cdd7,_0x2f1538,!![]);}catch(_0x301e74){return BPromise['reject'](_0x301e74);}return _0x51cdd7[_0x36f3('0x20')]();};}function saveUpdates(_0x4913c2,_0xc70040){return function(_0x39aa3b){if(_0x39aa3b){return _0x39aa3b['update'](_0x4913c2)[_0x36f3('0x21')](function(_0x215aca){return _0x215aca;});}return null;};}function removeEntity(_0x2d8c3e,_0x5ef623){return function(_0x2df36){if(_0x2df36){return _0x2df36['destroy']()[_0x36f3('0x21')](function(){_0x2d8c3e[_0x36f3('0x19')](0xcc)[_0x36f3('0x1a')]();});}};}function handleEntityNotFound(_0x12ae47,_0x439a58){return function(_0x31f124){if(!_0x31f124){_0x12ae47[_0x36f3('0x18')](0x194);}return _0x31f124;};}function handleError(_0x395970,_0x11169f){_0x11169f=_0x11169f||0x1f4;return function(_0x4b0162){logger[_0x36f3('0x22')](_0x4b0162[_0x36f3('0x23')]);if(_0x4b0162[_0x36f3('0x24')]){delete _0x4b0162[_0x36f3('0x24')];}_0x395970['status'](_0x11169f)['send'](_0x4b0162);};}exports[_0x36f3('0x25')]=function(_0x41d179,_0x4a4e04){var _0x8e6aa2={},_0x137c98={},_0x201c55={'count':0x0,'rows':[]};var _0x3e766f=db[_0x36f3('0x26')][_0x36f3('0x27')];_0x137c98[_0x36f3('0x28')]=_[_0x36f3('0x29')](_0x3e766f);_0x137c98[_0x36f3('0x2a')]=_['keys'](_0x41d179[_0x36f3('0x2a')]);_0x137c98[_0x36f3('0x2b')]=_['intersection'](_0x137c98[_0x36f3('0x28')],_0x137c98[_0x36f3('0x2a')]);_0x8e6aa2['attributes']=_[_0x36f3('0x2c')](_0x137c98['model'],qs[_0x36f3('0x2d')](_0x41d179['query'][_0x36f3('0x2d')]));_0x8e6aa2[_0x36f3('0x2e')]=_0x8e6aa2[_0x36f3('0x2e')][_0x36f3('0x2f')]?_0x8e6aa2[_0x36f3('0x2e')]:_0x137c98[_0x36f3('0x28')];if(!_0x41d179[_0x36f3('0x2a')][_0x36f3('0x30')]('nolimit')){_0x8e6aa2[_0x36f3('0x1d')]=qs['limit'](_0x41d179[_0x36f3('0x2a')]['limit']);_0x8e6aa2['offset']=qs[_0x36f3('0x1c')](_0x41d179[_0x36f3('0x2a')][_0x36f3('0x1c')]);}_0x8e6aa2[_0x36f3('0x31')]=qs[_0x36f3('0x32')](_0x41d179[_0x36f3('0x2a')][_0x36f3('0x32')]);_0x8e6aa2[_0x36f3('0x33')]=qs[_0x36f3('0x2b')](_[_0x36f3('0x34')](_0x41d179[_0x36f3('0x2a')],_0x137c98[_0x36f3('0x2b')]));if(_0x41d179[_0x36f3('0x2a')][_0x36f3('0x35')]){_0x8e6aa2[_0x36f3('0x33')]=_[_0x36f3('0x36')](_0x8e6aa2[_0x36f3('0x33')],{'$or':_['map'](_0x3e766f,function(_0xbd72b9){if(_0xbd72b9[_0x36f3('0x37')][_0x36f3('0x38')]!==_0x36f3('0x39')){var _0x43476e={};_0x43476e[_0xbd72b9[_0x36f3('0x3a')]]={'$like':'%'+_0x41d179[_0x36f3('0x2a')]['filter']+'%'};return _0x43476e;}})});}_0x8e6aa2=_[_0x36f3('0x36')]({},_0x8e6aa2,_0x41d179[_0x36f3('0x3b')]);var _0x3a5417={'where':_0x8e6aa2[_0x36f3('0x33')]};return db[_0x36f3('0x26')][_0x36f3('0x3c')](_0x3a5417)[_0x36f3('0x21')](function(_0x5ea125){_0x201c55[_0x36f3('0x3c')]=_0x5ea125;if(_0x41d179[_0x36f3('0x2a')]['includeAll']){_0x8e6aa2[_0x36f3('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x36f3('0x3e')](_0x8e6aa2);})[_0x36f3('0x21')](function(_0x40a475){_0x201c55[_0x36f3('0x3f')]=_0x40a475;return _0x201c55;})[_0x36f3('0x21')](respondWithFilteredResult(_0x4a4e04,_0x8e6aa2))[_0x36f3('0x40')](handleError(_0x4a4e04,null));};exports[_0x36f3('0x41')]=function(_0x4be3f9,_0x32790d){var _0x5f14d3={'raw':![],'where':{'id':_0x4be3f9[_0x36f3('0x42')]['id']}},_0x4eefbb={};_0x4eefbb[_0x36f3('0x28')]=_[_0x36f3('0x29')](db['AnalyticFieldReport'][_0x36f3('0x27')]);_0x4eefbb[_0x36f3('0x2a')]=_[_0x36f3('0x29')](_0x4be3f9[_0x36f3('0x2a')]);_0x4eefbb[_0x36f3('0x2b')]=_[_0x36f3('0x2c')](_0x4eefbb[_0x36f3('0x28')],_0x4eefbb['query']);_0x5f14d3[_0x36f3('0x2e')]=_[_0x36f3('0x2c')](_0x4eefbb[_0x36f3('0x28')],qs[_0x36f3('0x2d')](_0x4be3f9[_0x36f3('0x2a')][_0x36f3('0x2d')]));_0x5f14d3[_0x36f3('0x2e')]=_0x5f14d3[_0x36f3('0x2e')]['length']?_0x5f14d3[_0x36f3('0x2e')]:_0x4eefbb[_0x36f3('0x28')];if(_0x4be3f9[_0x36f3('0x2a')][_0x36f3('0x43')]){_0x5f14d3[_0x36f3('0x3d')]=[{'all':!![]}];}_0x5f14d3=_[_0x36f3('0x36')]({},_0x5f14d3,_0x4be3f9[_0x36f3('0x3b')]);return db['AnalyticFieldReport']['find'](_0x5f14d3)[_0x36f3('0x21')](handleEntityNotFound(_0x32790d,null))[_0x36f3('0x21')](respondWithResult(_0x32790d,null))[_0x36f3('0x40')](handleError(_0x32790d,null));};exports['create']=function(_0x4cf286,_0x2f8400){return db[_0x36f3('0x26')][_0x36f3('0x44')](_0x4cf286[_0x36f3('0x45')],{})['then'](respondWithResult(_0x2f8400,0xc9))[_0x36f3('0x40')](handleError(_0x2f8400,null));};exports[_0x36f3('0x46')]=function(_0x726898,_0x44bb27){return db[_0x36f3('0x26')][_0x36f3('0x46')](_0x726898[_0x36f3('0x45')],{'raw':![],'individualHooks':!![]})[_0x36f3('0x21')](respondWithResult(_0x44bb27,0xc9))[_0x36f3('0x40')](handleError(_0x44bb27,null));};exports['update']=function(_0x4c55f9,_0x4be95f){if(_0x4c55f9['body']['id']){delete _0x4c55f9[_0x36f3('0x45')]['id'];}return db['AnalyticFieldReport'][_0x36f3('0x47')]({'where':{'id':_0x4c55f9['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x4be95f,null))[_0x36f3('0x21')](saveUpdates(_0x4c55f9[_0x36f3('0x45')],null))[_0x36f3('0x21')](respondWithResult(_0x4be95f,null))['catch'](handleError(_0x4be95f,null));};exports['destroy']=function(_0x3f9114,_0x1ce6f6){return db['AnalyticFieldReport'][_0x36f3('0x47')]({'where':{'id':_0x3f9114['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x1ce6f6,null))['then'](removeEntity(_0x1ce6f6,null))[_0x36f3('0x40')](handleError(_0x1ce6f6,null));};exports[_0x36f3('0x48')]=function(_0x540b3a,_0x1373d6){return db[_0x36f3('0x26')][_0x36f3('0x49')]({'where':{'id':_0x540b3a[_0x36f3('0x2a')][_0x36f3('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1373d6,0xcc))['catch'](handleError(_0x1373d6,null));};exports[_0x36f3('0x4b')]=function(_0x42405d,_0x471c06,_0x398c03){return db[_0x36f3('0x4c')]['findOne']({'where':{'id':_0x42405d['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x471c06,null))[_0x36f3('0x21')](function(_0x3974d8){if(_0x3974d8){return db['sequelize'][_0x36f3('0x4d')](function(_0x4997d7){return db[_0x36f3('0x26')]['destroy']({'where':{'CustomReportId':_0x42405d['params']['id']},'transaction':_0x4997d7})[_0x36f3('0x21')](function(_0x361a89){var _0x3b9d12=_[_0x36f3('0x4e')](_0x42405d[_0x36f3('0x45')],function(_0x3673d2){delete _0x3673d2['id'];_0x3673d2[_0x36f3('0x4f')]=_0x42405d[_0x36f3('0x42')]['id'];return _0x3673d2;});return db[_0x36f3('0x26')]['bulkCreate'](_0x3b9d12,{'transaction':_0x4997d7});});})['then'](function(){return db['AnalyticFieldReport'][_0x36f3('0x3e')]({'where':{'CustomReportId':_0x42405d[_0x36f3('0x42')]['id']}});});}})[_0x36f3('0x21')](respondWithResult(_0x471c06,null))[_0x36f3('0x40')](handleError(_0x471c06,null));}; \ No newline at end of file +var _0xc697=['moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','bulkCreate','bulkDestroy','ids','addFields','transaction','html-pdf','eml-format','zip-dir'];(function(_0x5d1979,_0xb99287){var _0x15d253=function(_0x35b0ec){while(--_0x35b0ec){_0x5d1979['push'](_0x5d1979['shift']());}};_0x15d253(++_0xb99287);}(_0xc697,0x8b));var _0x7c69=function(_0x1cce40,_0x2773c1){_0x1cce40=_0x1cce40-0x0;var _0x444893=_0xc697[_0x1cce40];return _0x444893;};'use strict';var pdf=require(_0x7c69('0x0'));var emlformat=require(_0x7c69('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7c69('0x3'));var BPromise=require(_0x7c69('0x4'));var Mustache=require(_0x7c69('0x5'));var util=require(_0x7c69('0x6'));var path=require(_0x7c69('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c69('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c69('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c69('0xa'));var deskjs=require(_0x7c69('0xb'));var toCsv=require(_0x7c69('0xc'));var querystring=require(_0x7c69('0xd'));var Papa=require('papaparse');var Redis=require(_0x7c69('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c69('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7c69('0x10'));var config=require(_0x7c69('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ce04e,_0x30a8a2){_0x30a8a2=_0x30a8a2||0xcc;return function(_0x4e5c30){if(_0x4e5c30){return _0x3ce04e['sendStatus'](_0x30a8a2);}return _0x3ce04e[_0x7c69('0x12')](_0x30a8a2)[_0x7c69('0x13')]();};}function respondWithResult(_0x4b7b17,_0x4e21f9){_0x4e21f9=_0x4e21f9||0xc8;return function(_0x1b2f8d){if(_0x1b2f8d){return _0x4b7b17['status'](_0x4e21f9)[_0x7c69('0x14')](_0x1b2f8d);}};}function respondWithFilteredResult(_0xe4e023,_0xb8e6a6){return function(_0x53c8ef){if(_0x53c8ef){var _0x3619ea=_0x53c8ef[_0x7c69('0x15')],_0x1cd521=_0xb8e6a6[_0x7c69('0x16')],_0x3ab397=_0xb8e6a6[_0x7c69('0x16')]+_0xb8e6a6[_0x7c69('0x17')],_0xf9f914;if(_0x3ab397>=_0x3619ea){_0x3ab397=_0x3619ea;_0xf9f914=0xc8;}else{_0xf9f914=0xce;}_0xe4e023[_0x7c69('0x12')](_0xf9f914);return _0xe4e023[_0x7c69('0x18')](_0x7c69('0x19'),_0x1cd521+'-'+_0x3ab397+'/'+_0x3619ea)['json'](_0x53c8ef);}return null;};}function patchUpdates(_0x547b85){return function(_0x5444a0){try{jsonpatch[_0x7c69('0x1a')](_0x5444a0,_0x547b85,!![]);}catch(_0x295e18){return BPromise[_0x7c69('0x1b')](_0x295e18);}return _0x5444a0[_0x7c69('0x1c')]();};}function saveUpdates(_0xef2024,_0x5d2f62){return function(_0x4fdfe0){if(_0x4fdfe0){return _0x4fdfe0[_0x7c69('0x1d')](_0xef2024)[_0x7c69('0x1e')](function(_0x24e037){return _0x24e037;});}return null;};}function removeEntity(_0x2a4ae5,_0x18c00b){return function(_0x48b62d){if(_0x48b62d){return _0x48b62d[_0x7c69('0x1f')]()['then'](function(){_0x2a4ae5['status'](0xcc)[_0x7c69('0x13')]();});}};}function handleEntityNotFound(_0x2087ca,_0x39e4c6){return function(_0x477921){if(!_0x477921){_0x2087ca[_0x7c69('0x20')](0x194);}return _0x477921;};}function handleError(_0x29033d,_0x202983){_0x202983=_0x202983||0x1f4;return function(_0x5433b0){logger[_0x7c69('0x21')](_0x5433b0[_0x7c69('0x22')]);if(_0x5433b0[_0x7c69('0x23')]){delete _0x5433b0[_0x7c69('0x23')];}_0x29033d[_0x7c69('0x12')](_0x202983)['send'](_0x5433b0);};}exports['index']=function(_0x2b069b,_0x57a542){var _0x336857={},_0x3e37c6={},_0x283061={'count':0x0,'rows':[]};var _0x1ceca6=db[_0x7c69('0x24')][_0x7c69('0x25')];_0x3e37c6[_0x7c69('0x26')]=_[_0x7c69('0x27')](_0x1ceca6);_0x3e37c6[_0x7c69('0x28')]=_['keys'](_0x2b069b[_0x7c69('0x28')]);_0x3e37c6[_0x7c69('0x29')]=_['intersection'](_0x3e37c6[_0x7c69('0x26')],_0x3e37c6[_0x7c69('0x28')]);_0x336857[_0x7c69('0x2a')]=_[_0x7c69('0x2b')](_0x3e37c6[_0x7c69('0x26')],qs[_0x7c69('0x2c')](_0x2b069b['query']['fields']));_0x336857[_0x7c69('0x2a')]=_0x336857[_0x7c69('0x2a')]['length']?_0x336857[_0x7c69('0x2a')]:_0x3e37c6[_0x7c69('0x26')];if(!_0x2b069b[_0x7c69('0x28')][_0x7c69('0x2d')](_0x7c69('0x2e'))){_0x336857[_0x7c69('0x17')]=qs[_0x7c69('0x17')](_0x2b069b['query'][_0x7c69('0x17')]);_0x336857[_0x7c69('0x16')]=qs[_0x7c69('0x16')](_0x2b069b[_0x7c69('0x28')][_0x7c69('0x16')]);}_0x336857['order']=qs[_0x7c69('0x2f')](_0x2b069b[_0x7c69('0x28')]['sort']);_0x336857[_0x7c69('0x30')]=qs['filters'](_['pick'](_0x2b069b[_0x7c69('0x28')],_0x3e37c6[_0x7c69('0x29')]));if(_0x2b069b[_0x7c69('0x28')]['filter']){_0x336857[_0x7c69('0x30')]=_['merge'](_0x336857[_0x7c69('0x30')],{'$or':_['map'](_0x1ceca6,function(_0x277480){if(_0x277480[_0x7c69('0x31')][_0x7c69('0x32')]!==_0x7c69('0x33')){var _0x352b30={};_0x352b30[_0x277480[_0x7c69('0x34')]]={'$like':'%'+_0x2b069b[_0x7c69('0x28')][_0x7c69('0x35')]+'%'};return _0x352b30;}})});}_0x336857=_[_0x7c69('0x36')]({},_0x336857,_0x2b069b[_0x7c69('0x37')]);var _0x2afea6={'where':_0x336857[_0x7c69('0x30')]};return db[_0x7c69('0x24')][_0x7c69('0x15')](_0x2afea6)[_0x7c69('0x1e')](function(_0x2a22e4){_0x283061[_0x7c69('0x15')]=_0x2a22e4;if(_0x2b069b['query'][_0x7c69('0x38')]){_0x336857[_0x7c69('0x39')]=[{'all':!![]}];}return db[_0x7c69('0x24')][_0x7c69('0x3a')](_0x336857);})['then'](function(_0x6716e9){_0x283061[_0x7c69('0x3b')]=_0x6716e9;return _0x283061;})[_0x7c69('0x1e')](respondWithFilteredResult(_0x57a542,_0x336857))[_0x7c69('0x3c')](handleError(_0x57a542,null));};exports['show']=function(_0x49edc6,_0x25123f){var _0x4d1d1b={'raw':![],'where':{'id':_0x49edc6[_0x7c69('0x3d')]['id']}},_0x571b95={};_0x571b95[_0x7c69('0x26')]=_[_0x7c69('0x27')](db['AnalyticFieldReport'][_0x7c69('0x25')]);_0x571b95[_0x7c69('0x28')]=_[_0x7c69('0x27')](_0x49edc6[_0x7c69('0x28')]);_0x571b95[_0x7c69('0x29')]=_[_0x7c69('0x2b')](_0x571b95['model'],_0x571b95['query']);_0x4d1d1b[_0x7c69('0x2a')]=_[_0x7c69('0x2b')](_0x571b95[_0x7c69('0x26')],qs['fields'](_0x49edc6[_0x7c69('0x28')][_0x7c69('0x2c')]));_0x4d1d1b[_0x7c69('0x2a')]=_0x4d1d1b['attributes'][_0x7c69('0x3e')]?_0x4d1d1b[_0x7c69('0x2a')]:_0x571b95[_0x7c69('0x26')];if(_0x49edc6['query'][_0x7c69('0x38')]){_0x4d1d1b[_0x7c69('0x39')]=[{'all':!![]}];}_0x4d1d1b=_[_0x7c69('0x36')]({},_0x4d1d1b,_0x49edc6[_0x7c69('0x37')]);return db[_0x7c69('0x24')][_0x7c69('0x3f')](_0x4d1d1b)[_0x7c69('0x1e')](handleEntityNotFound(_0x25123f,null))[_0x7c69('0x1e')](respondWithResult(_0x25123f,null))[_0x7c69('0x3c')](handleError(_0x25123f,null));};exports['create']=function(_0xa129d9,_0x4bf88b){return db[_0x7c69('0x24')][_0x7c69('0x40')](_0xa129d9[_0x7c69('0x41')],{})[_0x7c69('0x1e')](respondWithResult(_0x4bf88b,0xc9))['catch'](handleError(_0x4bf88b,null));};exports['bulkCreate']=function(_0x4b204f,_0x4b1cc2){return db[_0x7c69('0x24')][_0x7c69('0x42')](_0x4b204f[_0x7c69('0x41')],{'raw':![],'individualHooks':!![]})[_0x7c69('0x1e')](respondWithResult(_0x4b1cc2,0xc9))[_0x7c69('0x3c')](handleError(_0x4b1cc2,null));};exports[_0x7c69('0x1d')]=function(_0x2b91a4,_0x9ef40){if(_0x2b91a4[_0x7c69('0x41')]['id']){delete _0x2b91a4['body']['id'];}return db[_0x7c69('0x24')][_0x7c69('0x3f')]({'where':{'id':_0x2b91a4[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x9ef40,null))[_0x7c69('0x1e')](saveUpdates(_0x2b91a4[_0x7c69('0x41')],null))[_0x7c69('0x1e')](respondWithResult(_0x9ef40,null))[_0x7c69('0x3c')](handleError(_0x9ef40,null));};exports['destroy']=function(_0x218bb4,_0x58e7de){return db[_0x7c69('0x24')][_0x7c69('0x3f')]({'where':{'id':_0x218bb4[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x58e7de,null))[_0x7c69('0x1e')](removeEntity(_0x58e7de,null))[_0x7c69('0x3c')](handleError(_0x58e7de,null));};exports[_0x7c69('0x43')]=function(_0x3d4fc7,_0x4fb688){return db[_0x7c69('0x24')][_0x7c69('0x1f')]({'where':{'id':_0x3d4fc7[_0x7c69('0x28')][_0x7c69('0x44')]||[]},'raw':![],'individualHooks':!![]})[_0x7c69('0x1e')](respondWithResult(_0x4fb688,0xcc))[_0x7c69('0x3c')](handleError(_0x4fb688,null));};exports[_0x7c69('0x45')]=function(_0x98382,_0x42fc68,_0x53def0){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x98382[_0x7c69('0x3d')]['id']}})[_0x7c69('0x1e')](handleEntityNotFound(_0x42fc68,null))[_0x7c69('0x1e')](function(_0x2f8ae0){if(_0x2f8ae0){return db['sequelize'][_0x7c69('0x46')](function(_0x4f64f1){return db[_0x7c69('0x24')]['destroy']({'where':{'CustomReportId':_0x98382[_0x7c69('0x3d')]['id']},'transaction':_0x4f64f1})['then'](function(_0x4b7426){var _0x1f8fb9=_['map'](_0x98382[_0x7c69('0x41')],function(_0x29836c){delete _0x29836c['id'];_0x29836c['CustomReportId']=_0x98382['params']['id'];return _0x29836c;});return db[_0x7c69('0x24')][_0x7c69('0x42')](_0x1f8fb9,{'transaction':_0x4f64f1});});})[_0x7c69('0x1e')](function(){return db[_0x7c69('0x24')][_0x7c69('0x3a')]({'where':{'CustomReportId':_0x98382[_0x7c69('0x3d')]['id']}});});}})[_0x7c69('0x1e')](respondWithResult(_0x42fc68,null))[_0x7c69('0x3c')](handleError(_0x42fc68,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 514f33c..814ca4f 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 _0x3a73=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a3e02,_0x3da60c){var _0x5d3a3e=function(_0x49a219){while(--_0x49a219){_0x1a3e02['push'](_0x1a3e02['shift']());}};_0x5d3a3e(++_0x3da60c);}(_0x3a73,0x166));var _0x33a7=function(_0x124120,_0x6468a8){_0x124120=_0x124120-0x0;var _0x24ec51=_0x3a73[_0x124120];return _0x24ec51;};'use strict';var _=require(_0x33a7('0x0'));var util=require(_0x33a7('0x1'));var logger=require(_0x33a7('0x2'))(_0x33a7('0x3'));var moment=require(_0x33a7('0x4'));var BPromise=require(_0x33a7('0x5'));var rp=require(_0x33a7('0x6'));var fs=require('fs');var path=require(_0x33a7('0x7'));var rimraf=require('rimraf');var config=require(_0x33a7('0x8'));var attributes=require(_0x33a7('0x9'));module[_0x33a7('0xa')]=function(_0x591799,_0x13f9d4){return _0x591799[_0x33a7('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x33a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6242=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0x6242,0x1a8));var _0x2624=function(_0x370093,_0x2eab7a){_0x370093=_0x370093-0x0;var _0x4859a8=_0x6242[_0x370093];return _0x4859a8;};'use strict';var _=require('lodash');var util=require(_0x2624('0x0'));var logger=require(_0x2624('0x1'))(_0x2624('0x2'));var moment=require(_0x2624('0x3'));var BPromise=require('bluebird');var rp=require(_0x2624('0x4'));var fs=require('fs');var path=require(_0x2624('0x5'));var rimraf=require(_0x2624('0x6'));var config=require(_0x2624('0x7'));var attributes=require(_0x2624('0x8'));module[_0x2624('0x9')]=function(_0x5d4d07,_0x489344){return _0x5d4d07['define'](_0x2624('0xa'),attributes,{'tableName':_0x2624('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 8da36e3..51c3509 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 _0x044a=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3a60bf,_0x3ba9a9){var _0x4f837e=function(_0x5687e6){while(--_0x5687e6){_0x3a60bf['push'](_0x3a60bf['shift']());}};_0x4f837e(++_0x3ba9a9);}(_0x044a,0x173));var _0xa044=function(_0x35b539,_0x16cb3b){_0x35b539=_0x35b539-0x0;var _0x78adfa=_0x044a[_0x35b539];return _0x78adfa;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var moment=require(_0xa044('0x2'));var BPromise=require(_0xa044('0x3'));var rs=require(_0xa044('0x4'));var fs=require('fs');var Redis=require(_0xa044('0x5'));var db=require(_0xa044('0x6'))['db'];var utils=require(_0xa044('0x7'));var logger=require(_0xa044('0x8'))(_0xa044('0x9'));var config=require('../../config/environment');var jayson=require(_0xa044('0xa'));var client=jayson[_0xa044('0xb')][_0xa044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c04bb,_0x59b81b,_0xe12f7d){return new BPromise(function(_0x33f556,_0x936b2c){return client[_0xa044('0xd')](_0x1c04bb,_0xe12f7d)['then'](function(_0x3b1dcd){logger[_0xa044('0xe')](_0xa044('0xf'),_0x59b81b,'request\x20sent');logger[_0xa044('0x10')](_0xa044('0x11'),_0x59b81b,_0xa044('0x12'),JSON[_0xa044('0x13')](_0x3b1dcd));if(_0x3b1dcd['error']){if(_0x3b1dcd[_0xa044('0x14')]['code']===0x1f4){logger['error'](_0xa044('0xf'),_0x59b81b,_0x3b1dcd[_0xa044('0x14')][_0xa044('0x15')]);return _0x936b2c(_0x3b1dcd[_0xa044('0x14')][_0xa044('0x15')]);}logger[_0xa044('0x14')](_0xa044('0xf'),_0x59b81b,_0x3b1dcd['error'][_0xa044('0x15')]);return _0x33f556(_0x3b1dcd['error'][_0xa044('0x15')]);}else{logger[_0xa044('0xe')](_0xa044('0xf'),_0x59b81b,_0xa044('0x12'));_0x33f556(_0x3b1dcd[_0xa044('0x16')]['message']);}})['catch'](function(_0x21b78c){logger['error'](_0xa044('0xf'),_0x59b81b,_0x21b78c);_0x936b2c(_0x21b78c);});});} \ No newline at end of file +var _0x0dee=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x31ba08,_0x33fd95){var _0x3595fb=function(_0x221d9a){while(--_0x221d9a){_0x31ba08['push'](_0x31ba08['shift']());}};_0x3595fb(++_0x33fd95);}(_0x0dee,0xf7));var _0xe0de=function(_0x485efd,_0x1499a1){_0x485efd=_0x485efd-0x0;var _0x5ca6c4=_0x0dee[_0x485efd];return _0x5ca6c4;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var moment=require('moment');var BPromise=require(_0xe0de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0de('0x3'));var db=require(_0xe0de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0de('0x5'))(_0xe0de('0x6'));var config=require(_0xe0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe1fd9,_0x5e5250,_0x349fd2){return new BPromise(function(_0x5b644c,_0x25818f){return client['request'](_0xfe1fd9,_0x349fd2)[_0xe0de('0x9')](function(_0x4a5ecd){logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));logger[_0xe0de('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5e5250,_0xe0de('0xc'),JSON[_0xe0de('0xe')](_0x4a5ecd));if(_0x4a5ecd[_0xe0de('0xf')]){if(_0x4a5ecd[_0xe0de('0xf')]['code']===0x1f4){logger['error'](_0xe0de('0xb'),_0x5e5250,_0x4a5ecd[_0xe0de('0xf')]['message']);return _0x25818f(_0x4a5ecd['error'][_0xe0de('0x10')]);}logger[_0xe0de('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5e5250,_0x4a5ecd['error']['message']);return _0x5b644c(_0x4a5ecd['error'][_0xe0de('0x10')]);}else{logger[_0xe0de('0xa')](_0xe0de('0xb'),_0x5e5250,_0xe0de('0xc'));_0x5b644c(_0x4a5ecd[_0xe0de('0x11')][_0xe0de('0x10')]);}})[_0xe0de('0x12')](function(_0x2d8c3d){logger[_0xe0de('0xf')](_0xe0de('0xb'),_0x5e5250,_0x2d8c3d);_0x25818f(_0x2d8c3d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 45a0583..12a6e2a 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 _0xbf6e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','post','bulkCreate','/:id/create_many','addFields','put','delete','/destroy_many','bulkDestroy','destroy','path'];(function(_0x21d41f,_0x50654b){var _0x43849b=function(_0x3c9493){while(--_0x3c9493){_0x21d41f['push'](_0x21d41f['shift']());}};_0x43849b(++_0x50654b);}(_0xbf6e,0x149));var _0xebf6=function(_0x4219f5,_0x22bfb2){_0x4219f5=_0x4219f5-0x0;var _0x4d3f5b=_0xbf6e[_0x4219f5];return _0x4d3f5b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var auth=require(_0xebf6('0x4'));var interaction=require(_0xebf6('0x5'));var config=require(_0xebf6('0x6'));var controller=require('./analyticFieldReport.controller');router[_0xebf6('0x7')]('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0x9')]);router[_0xebf6('0x7')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller[_0xebf6('0xb')]);router['post']('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0xc')]);router[_0xebf6('0xd')]('/create_many',auth[_0xebf6('0x8')](),controller[_0xebf6('0xe')]);router['post'](_0xebf6('0xf'),auth[_0xebf6('0x8')](),controller[_0xebf6('0x10')]);router[_0xebf6('0x11')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller['update']);router[_0xebf6('0x12')](_0xebf6('0x13'),auth['isAuthenticated'](),controller[_0xebf6('0x14')]);router[_0xebf6('0x12')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller[_0xebf6('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['get','isAuthenticated','/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','put','update','/destroy_many','bulkDestroy','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller'];(function(_0x17e4f5,_0x1ccde6){var _0x5ac1d7=function(_0x56fd14){while(--_0x56fd14){_0x17e4f5['push'](_0x17e4f5['shift']());}};_0x5ac1d7(++_0x1ccde6);}(_0x0bb5,0x148));var _0x50bb=function(_0x34e296,_0x2d9b0a){_0x34e296=_0x34e296-0x0;var _0x58a69f=_0x0bb5[_0x34e296];return _0x58a69f;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var auth=require(_0x50bb('0x4'));var interaction=require(_0x50bb('0x5'));var config=require(_0x50bb('0x6'));var controller=require(_0x50bb('0x7'));router[_0x50bb('0x8')]('/',auth[_0x50bb('0x9')](),controller['index']);router['get'](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0xb')]);router[_0x50bb('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x50bb('0xc')](_0x50bb('0xd'),auth[_0x50bb('0x9')](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x10')]);router[_0x50bb('0x11')](_0x50bb('0xa'),auth[_0x50bb('0x9')](),controller[_0x50bb('0x12')]);router['delete'](_0x50bb('0x13'),auth['isAuthenticated'](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')](_0x50bb('0xa'),auth['isAuthenticated'](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 49b8243..91c3fb7 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 _0x6500=['TEXT','sequelize','exports','STRING','name'];(function(_0x5633ba,_0x2cde5e){var _0x1176ab=function(_0x7acfb1){while(--_0x7acfb1){_0x5633ba['push'](_0x5633ba['shift']());}};_0x1176ab(++_0x2cde5e);}(_0x6500,0x18c));var _0x0650=function(_0x4a0273,_0xfc9a88){_0x4a0273=_0x4a0273-0x0;var _0x21d9ad=_0x6500[_0x4a0273];return _0x21d9ad;};'use strict';var Sequelize=require(_0x0650('0x0'));module[_0x0650('0x1')]={'name':{'type':Sequelize[_0x0650('0x2')],'allowNull':![],'unique':_0x0650('0x3')},'table':{'type':Sequelize[_0x0650('0x2')]},'metric':{'type':Sequelize[_0x0650('0x4')]},'description':{'type':Sequelize[_0x0650('0x2')]}}; \ No newline at end of file +var _0xe0b3=['TEXT','sequelize','exports','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xe0b3,0x149));var _0x3e0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0b3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3e0b('0x0'));module[_0x3e0b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3e0b('0x2')]},'metric':{'type':Sequelize[_0x3e0b('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ee953be..38387df 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 _0x9893=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Metrics','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','type','key','options','AnalyticMetric','findAll','rows','catch','show','params','length','includeAll','include','merge','find','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x9893,0x1c6));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');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(_0x3989('0x4'));var BPromise=require('bluebird');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 _=require(_0x3989('0xa'));var squel=require(_0x3989('0xb'));var crypto=require(_0x3989('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3989('0xd'));var toCsv=require(_0x3989('0x9'));var querystring=require(_0x3989('0xe'));var Papa=require(_0x3989('0xf'));var Redis=require(_0x3989('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3989('0x11'));var hardwareService=require(_0x3989('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3989('0x13'));var config=require(_0x3989('0x14'));var db=require(_0x3989('0x15'))['db'];function respondWithStatusCode(_0x45a0ba,_0x96508b){_0x96508b=_0x96508b||0xcc;return function(_0x3f8fa5){if(_0x3f8fa5){return _0x45a0ba[_0x3989('0x16')](_0x96508b);}return _0x45a0ba[_0x3989('0x17')](_0x96508b)[_0x3989('0x18')]();};}function respondWithResult(_0x1cce35,_0xcd6cec){_0xcd6cec=_0xcd6cec||0xc8;return function(_0x5d43d0){if(_0x5d43d0){return _0x1cce35['status'](_0xcd6cec)[_0x3989('0x19')](_0x5d43d0);}};}function respondWithFilteredResult(_0xde984a,_0x22975b){return function(_0x2b7b4d){if(_0x2b7b4d){var _0x214734=_0x2b7b4d[_0x3989('0x1a')],_0x3212c9=_0x22975b['offset'],_0x140912=_0x22975b[_0x3989('0x1b')]+_0x22975b[_0x3989('0x1c')],_0xd7b791;if(_0x140912>=_0x214734){_0x140912=_0x214734;_0xd7b791=0xc8;}else{_0xd7b791=0xce;}_0xde984a['status'](_0xd7b791);return _0xde984a[_0x3989('0x1d')](_0x3989('0x1e'),_0x3212c9+'-'+_0x140912+'/'+_0x214734)['json'](_0x2b7b4d);}return null;};}function patchUpdates(_0x543f68){return function(_0x22d5de){try{jsonpatch[_0x3989('0x1f')](_0x22d5de,_0x543f68,!![]);}catch(_0x49195f){return BPromise[_0x3989('0x20')](_0x49195f);}return _0x22d5de[_0x3989('0x21')]();};}function saveUpdates(_0x162047,_0x2ce29b){return function(_0x437260){if(_0x437260){return _0x437260[_0x3989('0x22')](_0x162047)['then'](function(_0x1c2f32){return _0x1c2f32;});}return null;};}function removeEntity(_0x5b4cbc,_0x2b52fc){return function(_0x560b67){if(_0x560b67){return _0x560b67[_0x3989('0x23')]()[_0x3989('0x24')](function(){var _0x490b4d=_0x560b67['get']({'plain':!![]});var _0x381bcc=_0x3989('0x25');return db[_0x3989('0x26')][_0x3989('0x23')]({'where':{'type':_0x381bcc,'resourceId':_0x490b4d['id']}})['then'](function(){return _0x560b67;});})[_0x3989('0x24')](function(){_0x5b4cbc[_0x3989('0x17')](0xcc)[_0x3989('0x18')]();});}};}function handleEntityNotFound(_0x326a79,_0x4ec7e9){return function(_0x25a5b3){if(!_0x25a5b3){_0x326a79[_0x3989('0x16')](0x194);}return _0x25a5b3;};}function handleError(_0x5c4958,_0x2f0ce7){_0x2f0ce7=_0x2f0ce7||0x1f4;return function(_0x38a8a4){logger[_0x3989('0x27')](_0x38a8a4[_0x3989('0x28')]);if(_0x38a8a4[_0x3989('0x29')]){delete _0x38a8a4[_0x3989('0x29')];}_0x5c4958[_0x3989('0x17')](_0x2f0ce7)[_0x3989('0x2a')](_0x38a8a4);};}exports['index']=function(_0x103805,_0x173d24){var _0x42571a={},_0x4861a8={},_0x7a325b={'count':0x0,'rows':[]};var _0x3f3bdd=db['AnalyticMetric'][_0x3989('0x2b')];_0x4861a8[_0x3989('0x2c')]=_[_0x3989('0x2d')](_0x3f3bdd);_0x4861a8[_0x3989('0x2e')]=_[_0x3989('0x2d')](_0x103805[_0x3989('0x2e')]);_0x4861a8[_0x3989('0x2f')]=_[_0x3989('0x30')](_0x4861a8['model'],_0x4861a8[_0x3989('0x2e')]);_0x42571a[_0x3989('0x31')]=_[_0x3989('0x30')](_0x4861a8[_0x3989('0x2c')],qs['fields'](_0x103805[_0x3989('0x2e')][_0x3989('0x32')]));_0x42571a[_0x3989('0x31')]=_0x42571a[_0x3989('0x31')]['length']?_0x42571a['attributes']:_0x4861a8[_0x3989('0x2c')];if(!_0x103805[_0x3989('0x2e')]['hasOwnProperty']('nolimit')){_0x42571a[_0x3989('0x1c')]=qs[_0x3989('0x1c')](_0x103805['query']['limit']);_0x42571a['offset']=qs['offset'](_0x103805[_0x3989('0x2e')][_0x3989('0x1b')]);}_0x42571a['order']=qs[_0x3989('0x33')](_0x103805['query']['sort']);_0x42571a[_0x3989('0x34')]=qs['filters'](_[_0x3989('0x35')](_0x103805[_0x3989('0x2e')],_0x4861a8[_0x3989('0x2f')]));if(_0x103805[_0x3989('0x2e')][_0x3989('0x36')]){_0x42571a[_0x3989('0x34')]=_['merge'](_0x42571a[_0x3989('0x34')],{'$or':_['map'](_0x3f3bdd,function(_0xd072b7){if(_0xd072b7[_0x3989('0x37')][_0x3989('0x38')]!=='VIRTUAL'){var _0x1dca5a={};_0x1dca5a[_0xd072b7['field']]={'$like':'%'+_0x103805[_0x3989('0x2e')][_0x3989('0x36')]+'%'};return _0x1dca5a;}})});}_0x42571a=_['merge']({},_0x42571a,_0x103805[_0x3989('0x39')]);var _0x39151d={'where':_0x42571a[_0x3989('0x34')]};return db[_0x3989('0x3a')][_0x3989('0x1a')](_0x39151d)[_0x3989('0x24')](function(_0x4aa46f){_0x7a325b[_0x3989('0x1a')]=_0x4aa46f;if(_0x103805[_0x3989('0x2e')]['includeAll']){_0x42571a['include']=[{'all':!![]}];}return db[_0x3989('0x3a')][_0x3989('0x3b')](_0x42571a);})['then'](function(_0x1933ae){_0x7a325b[_0x3989('0x3c')]=_0x1933ae;return _0x7a325b;})['then'](respondWithFilteredResult(_0x173d24,_0x42571a))[_0x3989('0x3d')](handleError(_0x173d24,null));};exports[_0x3989('0x3e')]=function(_0x37b64d,_0x5bbc1a){var _0x38d5d4={'raw':!![],'where':{'id':_0x37b64d[_0x3989('0x3f')]['id']}},_0x452e7c={};_0x452e7c['model']=_[_0x3989('0x2d')](db['AnalyticMetric'][_0x3989('0x2b')]);_0x452e7c[_0x3989('0x2e')]=_['keys'](_0x37b64d['query']);_0x452e7c[_0x3989('0x2f')]=_['intersection'](_0x452e7c['model'],_0x452e7c[_0x3989('0x2e')]);_0x38d5d4[_0x3989('0x31')]=_[_0x3989('0x30')](_0x452e7c[_0x3989('0x2c')],qs['fields'](_0x37b64d['query'][_0x3989('0x32')]));_0x38d5d4['attributes']=_0x38d5d4['attributes'][_0x3989('0x40')]?_0x38d5d4[_0x3989('0x31')]:_0x452e7c[_0x3989('0x2c')];if(_0x37b64d[_0x3989('0x2e')][_0x3989('0x41')]){_0x38d5d4[_0x3989('0x42')]=[{'all':!![]}];}_0x38d5d4=_[_0x3989('0x43')]({},_0x38d5d4,_0x37b64d[_0x3989('0x39')]);return db[_0x3989('0x3a')][_0x3989('0x44')](_0x38d5d4)['then'](handleEntityNotFound(_0x5bbc1a,null))[_0x3989('0x24')](respondWithResult(_0x5bbc1a,null))[_0x3989('0x3d')](handleError(_0x5bbc1a,null));};exports[_0x3989('0x45')]=function(_0x5c7d63,_0x149ad8){return db['AnalyticMetric'][_0x3989('0x45')](_0x5c7d63[_0x3989('0x46')],{})[_0x3989('0x24')](function(_0x1a5015){var _0x109af0=_0x5c7d63[_0x3989('0x47')][_0x3989('0x48')]({'plain':!![]});if(!_0x109af0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x109af0[_0x3989('0x49')]===_0x3989('0x47')){var _0x59ee68=_0x1a5015[_0x3989('0x48')]({'plain':!![]});var _0x1614cd=_0x3989('0x25');return db[_0x3989('0x4a')][_0x3989('0x44')]({'where':{'name':_0x1614cd,'userProfileId':_0x109af0['userProfileId']},'raw':!![]})[_0x3989('0x24')](function(_0x3d4030){if(_0x3d4030&&_0x3d4030['autoAssociation']===0x0){return db[_0x3989('0x26')]['create']({'name':_0x59ee68[_0x3989('0x29')],'resourceId':_0x59ee68['id'],'type':_0x3d4030['name'],'sectionId':_0x3d4030['id']},{})[_0x3989('0x24')](function(){return _0x1a5015;});}else{return _0x1a5015;}})[_0x3989('0x3d')](function(_0x5b6c21){logger[_0x3989('0x27')](_0x3989('0x4b'),_0x5b6c21);throw _0x5b6c21;});}return _0x1a5015;})[_0x3989('0x24')](respondWithResult(_0x149ad8,0xc9))[_0x3989('0x3d')](handleError(_0x149ad8,null));};exports[_0x3989('0x22')]=function(_0x2129bc,_0x15dd97){if(_0x2129bc[_0x3989('0x46')]['id']){delete _0x2129bc[_0x3989('0x46')]['id'];}return db['AnalyticMetric'][_0x3989('0x44')]({'where':{'id':_0x2129bc[_0x3989('0x3f')]['id']}})[_0x3989('0x24')](handleEntityNotFound(_0x15dd97,null))[_0x3989('0x24')](saveUpdates(_0x2129bc[_0x3989('0x46')],null))[_0x3989('0x24')](respondWithResult(_0x15dd97,null))['catch'](handleError(_0x15dd97,null));};exports[_0x3989('0x23')]=function(_0x29b32c,_0x4cc00c){return db[_0x3989('0x3a')][_0x3989('0x44')]({'where':{'id':_0x29b32c['params']['id']}})[_0x3989('0x24')](handleEntityNotFound(_0x4cc00c,null))[_0x3989('0x24')](removeEntity(_0x4cc00c,null))[_0x3989('0x3d')](handleError(_0x4cc00c,null));}; \ No newline at end of file +var _0x4d82=['user','role','Metrics','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','json','offset','limit','status','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','where','map','key','field','filter','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x38c21f,_0x5d27a5){var _0x2e1b03=function(_0x70cc69){while(--_0x70cc69){_0x38c21f['push'](_0x38c21f['shift']());}};_0x2e1b03(++_0x5d27a5);}(_0x4d82,0x1e9));var _0x24d8=function(_0x334688,_0xf68c2c){_0x334688=_0x334688-0x0;var _0x42dc15=_0x4d82[_0x334688];return _0x42dc15;};'use strict';var pdf=require(_0x24d8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x24d8('0x1'));var zipdir=require(_0x24d8('0x2'));var jsonpatch=require(_0x24d8('0x3'));var rp=require('request-promise');var moment=require(_0x24d8('0x4'));var BPromise=require(_0x24d8('0x5'));var Mustache=require('mustache');var util=require(_0x24d8('0x6'));var path=require(_0x24d8('0x7'));var sox=require(_0x24d8('0x8'));var csv=require(_0x24d8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x24d8('0xa'));var squel=require('squel');var crypto=require(_0x24d8('0xb'));var jsforce=require(_0x24d8('0xc'));var deskjs=require(_0x24d8('0xd'));var toCsv=require(_0x24d8('0x9'));var querystring=require(_0x24d8('0xe'));var Papa=require(_0x24d8('0xf'));var Redis=require('ioredis');var authService=require(_0x24d8('0x10'));var qs=require(_0x24d8('0x11'));var hardwareService=require(_0x24d8('0x12'));var logger=require('../../config/logger')(_0x24d8('0x13'));var utils=require('../../config/utils');var config=require(_0x24d8('0x14'));var db=require(_0x24d8('0x15'))['db'];function respondWithStatusCode(_0x4b1c17,_0x2d7afd){_0x2d7afd=_0x2d7afd||0xcc;return function(_0x3c9bb8){if(_0x3c9bb8){return _0x4b1c17['sendStatus'](_0x2d7afd);}return _0x4b1c17['status'](_0x2d7afd)['end']();};}function respondWithResult(_0x5a7276,_0x46ceb4){_0x46ceb4=_0x46ceb4||0xc8;return function(_0x12563a){if(_0x12563a){return _0x5a7276['status'](_0x46ceb4)[_0x24d8('0x16')](_0x12563a);}};}function respondWithFilteredResult(_0x4f4146,_0x3cf7bc){return function(_0x31fcc8){if(_0x31fcc8){var _0x4cae01=_0x31fcc8['count'],_0x219c71=_0x3cf7bc['offset'],_0x13c1a2=_0x3cf7bc[_0x24d8('0x17')]+_0x3cf7bc[_0x24d8('0x18')],_0x1b50d5;if(_0x13c1a2>=_0x4cae01){_0x13c1a2=_0x4cae01;_0x1b50d5=0xc8;}else{_0x1b50d5=0xce;}_0x4f4146[_0x24d8('0x19')](_0x1b50d5);return _0x4f4146[_0x24d8('0x1a')](_0x24d8('0x1b'),_0x219c71+'-'+_0x13c1a2+'/'+_0x4cae01)[_0x24d8('0x16')](_0x31fcc8);}return null;};}function patchUpdates(_0x175503){return function(_0x55de6d){try{jsonpatch[_0x24d8('0x1c')](_0x55de6d,_0x175503,!![]);}catch(_0x15135d){return BPromise['reject'](_0x15135d);}return _0x55de6d[_0x24d8('0x1d')]();};}function saveUpdates(_0x2bf2ac,_0x1421ac){return function(_0x5722ac){if(_0x5722ac){return _0x5722ac[_0x24d8('0x1e')](_0x2bf2ac)[_0x24d8('0x1f')](function(_0x1947cc){return _0x1947cc;});}return null;};}function removeEntity(_0x11a82a,_0xe1a675){return function(_0x3214b2){if(_0x3214b2){return _0x3214b2['destroy']()[_0x24d8('0x1f')](function(){var _0x4a736e=_0x3214b2[_0x24d8('0x20')]({'plain':!![]});var _0x417f09='Metrics';return db[_0x24d8('0x21')][_0x24d8('0x22')]({'where':{'type':_0x417f09,'resourceId':_0x4a736e['id']}})['then'](function(){return _0x3214b2;});})['then'](function(){_0x11a82a[_0x24d8('0x19')](0xcc)[_0x24d8('0x23')]();});}};}function handleEntityNotFound(_0x207fbb,_0x24d719){return function(_0x4d5a46){if(!_0x4d5a46){_0x207fbb[_0x24d8('0x24')](0x194);}return _0x4d5a46;};}function handleError(_0x3f8405,_0x4b9daf){_0x4b9daf=_0x4b9daf||0x1f4;return function(_0x230740){logger[_0x24d8('0x25')](_0x230740[_0x24d8('0x26')]);if(_0x230740[_0x24d8('0x27')]){delete _0x230740[_0x24d8('0x27')];}_0x3f8405[_0x24d8('0x19')](_0x4b9daf)[_0x24d8('0x28')](_0x230740);};}exports[_0x24d8('0x29')]=function(_0x57a122,_0x1fffe3){var _0x27fce0={},_0x565f21={},_0xd4b507={'count':0x0,'rows':[]};var _0x243a4c=db['AnalyticMetric']['rawAttributes'];_0x565f21[_0x24d8('0x2a')]=_[_0x24d8('0x2b')](_0x243a4c);_0x565f21[_0x24d8('0x2c')]=_[_0x24d8('0x2b')](_0x57a122[_0x24d8('0x2c')]);_0x565f21['filters']=_[_0x24d8('0x2d')](_0x565f21[_0x24d8('0x2a')],_0x565f21[_0x24d8('0x2c')]);_0x27fce0[_0x24d8('0x2e')]=_['intersection'](_0x565f21[_0x24d8('0x2a')],qs[_0x24d8('0x2f')](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x2f')]));_0x27fce0[_0x24d8('0x2e')]=_0x27fce0[_0x24d8('0x2e')][_0x24d8('0x30')]?_0x27fce0[_0x24d8('0x2e')]:_0x565f21[_0x24d8('0x2a')];if(!_0x57a122[_0x24d8('0x2c')][_0x24d8('0x31')]('nolimit')){_0x27fce0['limit']=qs['limit'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x18')]);_0x27fce0[_0x24d8('0x17')]=qs['offset'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x17')]);}_0x27fce0[_0x24d8('0x32')]=qs['sort'](_0x57a122[_0x24d8('0x2c')][_0x24d8('0x33')]);_0x27fce0['where']=qs[_0x24d8('0x34')](_[_0x24d8('0x35')](_0x57a122[_0x24d8('0x2c')],_0x565f21['filters']));if(_0x57a122[_0x24d8('0x2c')]['filter']){_0x27fce0['where']=_[_0x24d8('0x36')](_0x27fce0[_0x24d8('0x37')],{'$or':_[_0x24d8('0x38')](_0x243a4c,function(_0x3822b3){if(_0x3822b3['type'][_0x24d8('0x39')]!=='VIRTUAL'){var _0x101e81={};_0x101e81[_0x3822b3[_0x24d8('0x3a')]]={'$like':'%'+_0x57a122[_0x24d8('0x2c')][_0x24d8('0x3b')]+'%'};return _0x101e81;}})});}_0x27fce0=_[_0x24d8('0x36')]({},_0x27fce0,_0x57a122[_0x24d8('0x3c')]);var _0xe8ce38={'where':_0x27fce0['where']};return db[_0x24d8('0x3d')][_0x24d8('0x3e')](_0xe8ce38)['then'](function(_0x25ac94){_0xd4b507[_0x24d8('0x3e')]=_0x25ac94;if(_0x57a122[_0x24d8('0x2c')][_0x24d8('0x3f')]){_0x27fce0[_0x24d8('0x40')]=[{'all':!![]}];}return db[_0x24d8('0x3d')][_0x24d8('0x41')](_0x27fce0);})[_0x24d8('0x1f')](function(_0x4d1dfe){_0xd4b507[_0x24d8('0x42')]=_0x4d1dfe;return _0xd4b507;})[_0x24d8('0x1f')](respondWithFilteredResult(_0x1fffe3,_0x27fce0))[_0x24d8('0x43')](handleError(_0x1fffe3,null));};exports[_0x24d8('0x44')]=function(_0x2ddd7d,_0x122470){var _0x454d7f={'raw':!![],'where':{'id':_0x2ddd7d['params']['id']}},_0x3fd04e={};_0x3fd04e['model']=_['keys'](db[_0x24d8('0x3d')]['rawAttributes']);_0x3fd04e['query']=_[_0x24d8('0x2b')](_0x2ddd7d[_0x24d8('0x2c')]);_0x3fd04e[_0x24d8('0x34')]=_[_0x24d8('0x2d')](_0x3fd04e[_0x24d8('0x2a')],_0x3fd04e['query']);_0x454d7f[_0x24d8('0x2e')]=_[_0x24d8('0x2d')](_0x3fd04e[_0x24d8('0x2a')],qs['fields'](_0x2ddd7d[_0x24d8('0x2c')]['fields']));_0x454d7f[_0x24d8('0x2e')]=_0x454d7f[_0x24d8('0x2e')][_0x24d8('0x30')]?_0x454d7f[_0x24d8('0x2e')]:_0x3fd04e[_0x24d8('0x2a')];if(_0x2ddd7d['query'][_0x24d8('0x3f')]){_0x454d7f[_0x24d8('0x40')]=[{'all':!![]}];}_0x454d7f=_[_0x24d8('0x36')]({},_0x454d7f,_0x2ddd7d[_0x24d8('0x3c')]);return db['AnalyticMetric'][_0x24d8('0x45')](_0x454d7f)[_0x24d8('0x1f')](handleEntityNotFound(_0x122470,null))['then'](respondWithResult(_0x122470,null))['catch'](handleError(_0x122470,null));};exports['create']=function(_0x47a332,_0x27da3c){return db[_0x24d8('0x3d')][_0x24d8('0x46')](_0x47a332['body'],{})[_0x24d8('0x1f')](function(_0x282433){var _0x5b286d=_0x47a332[_0x24d8('0x47')][_0x24d8('0x20')]({'plain':!![]});if(!_0x5b286d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b286d[_0x24d8('0x48')]===_0x24d8('0x47')){var _0x3db236=_0x282433['get']({'plain':!![]});var _0x4bea33=_0x24d8('0x49');return db[_0x24d8('0x4a')][_0x24d8('0x45')]({'where':{'name':_0x4bea33,'userProfileId':_0x5b286d[_0x24d8('0x4b')]},'raw':!![]})[_0x24d8('0x1f')](function(_0x546c0a){if(_0x546c0a&&_0x546c0a[_0x24d8('0x4c')]===0x0){return db[_0x24d8('0x21')][_0x24d8('0x46')]({'name':_0x3db236[_0x24d8('0x27')],'resourceId':_0x3db236['id'],'type':_0x546c0a['name'],'sectionId':_0x546c0a['id']},{})[_0x24d8('0x1f')](function(){return _0x282433;});}else{return _0x282433;}})[_0x24d8('0x43')](function(_0x3b3761){logger[_0x24d8('0x25')](_0x24d8('0x4d'),_0x3b3761);throw _0x3b3761;});}return _0x282433;})[_0x24d8('0x1f')](respondWithResult(_0x27da3c,0xc9))[_0x24d8('0x43')](handleError(_0x27da3c,null));};exports[_0x24d8('0x1e')]=function(_0x1fe662,_0x3cf867){if(_0x1fe662['body']['id']){delete _0x1fe662[_0x24d8('0x4e')]['id'];}return db[_0x24d8('0x3d')][_0x24d8('0x45')]({'where':{'id':_0x1fe662[_0x24d8('0x4f')]['id']}})[_0x24d8('0x1f')](handleEntityNotFound(_0x3cf867,null))[_0x24d8('0x1f')](saveUpdates(_0x1fe662['body'],null))[_0x24d8('0x1f')](respondWithResult(_0x3cf867,null))[_0x24d8('0x43')](handleError(_0x3cf867,null));};exports[_0x24d8('0x22')]=function(_0x3df7a5,_0x3ca7c0){return db[_0x24d8('0x3d')]['find']({'where':{'id':_0x3df7a5[_0x24d8('0x4f')]['id']}})[_0x24d8('0x1f')](handleEntityNotFound(_0x3ca7c0,null))[_0x24d8('0x1f')](removeEntity(_0x3ca7c0,null))[_0x24d8('0x43')](handleError(_0x3ca7c0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0b7bf7b..0eee5eb 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 _0x1ee4=['analytics_metrics','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x1ee4,0x16c));var _0x41ee=function(_0x1afe1e,_0x9f42c2){_0x1afe1e=_0x1afe1e-0x0;var _0x383c23=_0x1ee4[_0x1afe1e];return _0x383c23;};'use strict';var _=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var logger=require(_0x41ee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x41ee('0x3'));var fs=require('fs');var path=require(_0x41ee('0x4'));var rimraf=require(_0x41ee('0x5'));var config=require(_0x41ee('0x6'));var attributes=require(_0x41ee('0x7'));module[_0x41ee('0x8')]=function(_0x1f1186,_0x44195b){return _0x1f1186[_0x41ee('0x9')]('AnalyticMetric',attributes,{'tableName':_0x41ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63ac=['rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','../../config/logger','api','request-promise','path'];(function(_0x485f74,_0x24de26){var _0x14e0ff=function(_0x407a70){while(--_0x407a70){_0x485f74['push'](_0x485f74['shift']());}};_0x14e0ff(++_0x24de26);}(_0x63ac,0x181));var _0xc63a=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x63ac[_0x5458a6];return _0x2669fc;};'use strict';var _=require(_0xc63a('0x0'));var util=require('util');var logger=require(_0xc63a('0x1'))(_0xc63a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc63a('0x3'));var fs=require('fs');var path=require(_0xc63a('0x4'));var rimraf=require(_0xc63a('0x5'));var config=require(_0xc63a('0x6'));var attributes=require(_0xc63a('0x7'));module[_0xc63a('0x8')]=function(_0x425be2,_0x267a51){return _0x425be2['define'](_0xc63a('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index c8f0c73..bcb3791 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 _0x8d9b=['rpc','../../config/environment','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});} \ No newline at end of file +var _0x8c99=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x8c99,0x1a8));var _0x98c9=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x8c99[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed2b6,_0x538465,_0x4af8a6){return new BPromise(function(_0x5b983e,_0xc789b1){return client[_0x98c9('0xd')](_0x2ed2b6,_0x4af8a6)[_0x98c9('0xe')](function(_0x4052cf){logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));logger[_0x98c9('0x12')](_0x98c9('0x13'),_0x538465,_0x98c9('0x11'),JSON[_0x98c9('0x14')](_0x4052cf));if(_0x4052cf['error']){if(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x16')]===0x1f4){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0xc789b1(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0x5b983e(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}else{logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));_0x5b983e(_0x4052cf[_0x98c9('0x18')][_0x98c9('0x17')]);}})[_0x98c9('0x19')](function(_0x2bb8b6){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x2bb8b6);_0xc789b1(_0x2bb8b6);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index e8ee7c6..fec8cf3 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 _0xd26f=['post','create','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x41f325,_0x4de842){var _0x2f723f=function(_0x4d6d0a){while(--_0x4d6d0a){_0x41f325['push'](_0x41f325['shift']());}};_0x2f723f(++_0x4de842);}(_0xd26f,0x113));var _0xfd26=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xd26f[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd26('0x2'));var router=express[_0xfd26('0x3')]();var auth=require(_0xfd26('0x4'));var interaction=require(_0xfd26('0x5'));var config=require(_0xfd26('0x6'));var controller=require(_0xfd26('0x7'));router[_0xfd26('0x8')]('/',auth[_0xfd26('0x9')](),controller[_0xfd26('0xa')]);router['get'](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller[_0xfd26('0xc')]);router[_0xfd26('0xd')]('/',auth[_0xfd26('0x9')](),controller[_0xfd26('0xe')]);router['put'](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller[_0xfd26('0xf')]);router[_0xfd26('0x10')](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller['destroy']);module[_0xfd26('0x11')]=router; \ No newline at end of file +var _0xf0f4=['./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x517244,_0x384ca3){var _0x490086=function(_0x33d25a){while(--_0x33d25a){_0x517244['push'](_0x517244['shift']());}};_0x490086(++_0x384ca3);}(_0xf0f4,0x182));var _0x4f0f=function(_0x433a86,_0x245383){_0x433a86=_0x433a86-0x0;var _0x2f1983=_0xf0f4[_0x433a86];return _0x2f1983;};'use strict';var multer=require('multer');var util=require(_0x4f0f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f0f('0x1'));var router=express[_0x4f0f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f0f('0x3'));var config=require(_0x4f0f('0x4'));var controller=require(_0x4f0f('0x5'));router[_0x4f0f('0x6')]('/',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x8')]);router[_0x4f0f('0x6')]('/:id',auth[_0x4f0f('0x7')](),controller[_0x4f0f('0x9')]);router[_0x4f0f('0xa')]('/',auth['isAuthenticated'](),controller[_0x4f0f('0xb')]);router[_0x4f0f('0xc')](_0x4f0f('0xd'),auth[_0x4f0f('0x7')](),controller[_0x4f0f('0xe')]);router[_0x4f0f('0xf')](_0x4f0f('0xd'),auth[_0x4f0f('0x7')](),controller['destroy']);module[_0x4f0f('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 89ffe0b..79eb15a 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e8=['TEXT','exports'];(function(_0x4fe416,_0x5a310a){var _0x252725=function(_0x1d67db){while(--_0x1d67db){_0x4fe416['push'](_0x4fe416['shift']());}};_0x252725(++_0x5a310a);}(_0xb7e8,0x13f));var _0x8b7e=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xb7e8[_0x31abee];return _0x3c1761;};'use strict';var Sequelize=require('sequelize');module[_0x8b7e('0x0')]={'tree':{'type':Sequelize[_0x8b7e('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0cc8=['sequelize','exports','TEXT'];(function(_0x488074,_0x54c391){var _0x1eb231=function(_0x5a95b4){while(--_0x5a95b4){_0x488074['push'](_0x488074['shift']());}};_0x1eb231(++_0x54c391);}(_0x0cc8,0x1ad));var _0x80cc=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x0cc8[_0x390a19];return _0x5d8230;};'use strict';var Sequelize=require(_0x80cc('0x0'));module[_0x80cc('0x1')]={'tree':{'type':Sequelize[_0x80cc('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 fe74355..662ae2c 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 _0x8a11=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x41aded,_0x21efc2){var _0x938a2e=function(_0x9c97a4){while(--_0x9c97a4){_0x41aded['push'](_0x41aded['shift']());}};_0x938a2e(++_0x21efc2);}(_0x8a11,0xc2));var _0x18a1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x8a11[_0x49ca18];return _0x145d54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x18a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18a1('0x1'));var jsonpatch=require(_0x18a1('0x2'));var rp=require(_0x18a1('0x3'));var moment=require(_0x18a1('0x4'));var BPromise=require(_0x18a1('0x5'));var Mustache=require(_0x18a1('0x6'));var util=require('util');var path=require(_0x18a1('0x7'));var sox=require(_0x18a1('0x8'));var csv=require(_0x18a1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x18a1('0xa'));var crypto=require(_0x18a1('0xb'));var jsforce=require(_0x18a1('0xc'));var deskjs=require(_0x18a1('0xd'));var toCsv=require(_0x18a1('0x9'));var querystring=require('querystring');var Papa=require(_0x18a1('0xe'));var Redis=require('ioredis');var authService=require(_0x18a1('0xf'));var qs=require(_0x18a1('0x10'));var hardwareService=require(_0x18a1('0x11'));var logger=require(_0x18a1('0x12'))(_0x18a1('0x13'));var utils=require(_0x18a1('0x14'));var config=require(_0x18a1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d2ae,_0x11b25b){_0x11b25b=_0x11b25b||0xcc;return function(_0x332691){if(_0x332691){return _0x12d2ae[_0x18a1('0x16')](_0x11b25b);}return _0x12d2ae[_0x18a1('0x17')](_0x11b25b)[_0x18a1('0x18')]();};}function respondWithResult(_0x2d97c2,_0x47a7ae){_0x47a7ae=_0x47a7ae||0xc8;return function(_0x2323a7){if(_0x2323a7){return _0x2d97c2['status'](_0x47a7ae)[_0x18a1('0x19')](_0x2323a7);}};}function respondWithFilteredResult(_0x5a2efe,_0x5c012d){return function(_0x51795f){if(_0x51795f){var _0xac991e=_0x51795f['count'],_0x1b8b2b=_0x5c012d[_0x18a1('0x1a')],_0x4d8a6f=_0x5c012d[_0x18a1('0x1a')]+_0x5c012d[_0x18a1('0x1b')],_0x27c6e1;if(_0x4d8a6f>=_0xac991e){_0x4d8a6f=_0xac991e;_0x27c6e1=0xc8;}else{_0x27c6e1=0xce;}_0x5a2efe[_0x18a1('0x17')](_0x27c6e1);return _0x5a2efe[_0x18a1('0x1c')]('Content-Range',_0x1b8b2b+'-'+_0x4d8a6f+'/'+_0xac991e)[_0x18a1('0x19')](_0x51795f);}return null;};}function patchUpdates(_0x3fc3a6){return function(_0xa18a08){try{jsonpatch[_0x18a1('0x1d')](_0xa18a08,_0x3fc3a6,!![]);}catch(_0x2e6302){return BPromise[_0x18a1('0x1e')](_0x2e6302);}return _0xa18a08[_0x18a1('0x1f')]();};}function saveUpdates(_0x342ca3,_0x2eddf7){return function(_0x525ab0){if(_0x525ab0){return _0x525ab0[_0x18a1('0x20')](_0x342ca3)[_0x18a1('0x21')](function(_0x47554c){return _0x47554c;});}return null;};}function removeEntity(_0x573156,_0x29c74c){return function(_0x37f75d){if(_0x37f75d){return _0x37f75d['destroy']()[_0x18a1('0x21')](function(){_0x573156[_0x18a1('0x17')](0xcc)[_0x18a1('0x18')]();});}};}function handleEntityNotFound(_0x34cf86,_0xd69d29){return function(_0x242106){if(!_0x242106){_0x34cf86['sendStatus'](0x194);}return _0x242106;};}function handleError(_0x4ac34d,_0x56e42f){_0x56e42f=_0x56e42f||0x1f4;return function(_0x57e1cd){logger[_0x18a1('0x22')](_0x57e1cd[_0x18a1('0x23')]);if(_0x57e1cd[_0x18a1('0x24')]){delete _0x57e1cd[_0x18a1('0x24')];}_0x4ac34d[_0x18a1('0x17')](_0x56e42f)[_0x18a1('0x25')](_0x57e1cd);};}exports[_0x18a1('0x26')]=function(_0x4f0838,_0x121b64){var _0x55329e={},_0x4f9cec={},_0x168b8c={'count':0x0,'rows':[]};var _0x42c62b=db[_0x18a1('0x27')][_0x18a1('0x28')];_0x4f9cec[_0x18a1('0x29')]=_[_0x18a1('0x2a')](_0x42c62b);_0x4f9cec['query']=_[_0x18a1('0x2a')](_0x4f0838[_0x18a1('0x2b')]);_0x4f9cec[_0x18a1('0x2c')]=_[_0x18a1('0x2d')](_0x4f9cec[_0x18a1('0x29')],_0x4f9cec[_0x18a1('0x2b')]);_0x55329e[_0x18a1('0x2e')]=_[_0x18a1('0x2d')](_0x4f9cec['model'],qs['fields'](_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x2f')]));_0x55329e['attributes']=_0x55329e[_0x18a1('0x2e')][_0x18a1('0x30')]?_0x55329e[_0x18a1('0x2e')]:_0x4f9cec[_0x18a1('0x29')];if(!_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x31')]('nolimit')){_0x55329e['limit']=qs[_0x18a1('0x1b')](_0x4f0838[_0x18a1('0x2b')]['limit']);_0x55329e[_0x18a1('0x1a')]=qs[_0x18a1('0x1a')](_0x4f0838['query'][_0x18a1('0x1a')]);}_0x55329e['order']=qs[_0x18a1('0x32')](_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x32')]);_0x55329e[_0x18a1('0x33')]=qs[_0x18a1('0x2c')](_[_0x18a1('0x34')](_0x4f0838[_0x18a1('0x2b')],_0x4f9cec[_0x18a1('0x2c')]));if(_0x4f0838['query'][_0x18a1('0x35')]){_0x55329e[_0x18a1('0x33')]=_[_0x18a1('0x36')](_0x55329e[_0x18a1('0x33')],{'$or':_['map'](_0x42c62b,function(_0x382b61){if(_0x382b61[_0x18a1('0x37')][_0x18a1('0x38')]!=='VIRTUAL'){var _0xde7c46={};_0xde7c46[_0x382b61[_0x18a1('0x39')]]={'$like':'%'+_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x35')]+'%'};return _0xde7c46;}})});}_0x55329e=_['merge']({},_0x55329e,_0x4f0838[_0x18a1('0x3a')]);var _0xff63e2={'where':_0x55329e['where']};return db['AnalyticTreeReport'][_0x18a1('0x3b')](_0xff63e2)[_0x18a1('0x21')](function(_0x5dd659){_0x168b8c[_0x18a1('0x3b')]=_0x5dd659;if(_0x4f0838['query'][_0x18a1('0x3c')]){_0x55329e[_0x18a1('0x3d')]=[{'all':!![]}];}return db[_0x18a1('0x27')][_0x18a1('0x3e')](_0x55329e);})[_0x18a1('0x21')](function(_0x50ac0b){_0x168b8c[_0x18a1('0x3f')]=_0x50ac0b;return _0x168b8c;})['then'](respondWithFilteredResult(_0x121b64,_0x55329e))[_0x18a1('0x40')](handleError(_0x121b64,null));};exports[_0x18a1('0x41')]=function(_0x1b3938,_0x2b628c){var _0x2648fb={'raw':!![],'where':{'id':_0x1b3938[_0x18a1('0x42')]['id']}},_0x2158a5={};_0x2158a5[_0x18a1('0x29')]=_[_0x18a1('0x2a')](db[_0x18a1('0x27')][_0x18a1('0x28')]);_0x2158a5['query']=_['keys'](_0x1b3938[_0x18a1('0x2b')]);_0x2158a5[_0x18a1('0x2c')]=_[_0x18a1('0x2d')](_0x2158a5[_0x18a1('0x29')],_0x2158a5[_0x18a1('0x2b')]);_0x2648fb['attributes']=_[_0x18a1('0x2d')](_0x2158a5[_0x18a1('0x29')],qs[_0x18a1('0x2f')](_0x1b3938[_0x18a1('0x2b')][_0x18a1('0x2f')]));_0x2648fb['attributes']=_0x2648fb[_0x18a1('0x2e')][_0x18a1('0x30')]?_0x2648fb[_0x18a1('0x2e')]:_0x2158a5[_0x18a1('0x29')];if(_0x1b3938[_0x18a1('0x2b')][_0x18a1('0x3c')]){_0x2648fb['include']=[{'all':!![]}];}_0x2648fb=_[_0x18a1('0x36')]({},_0x2648fb,_0x1b3938[_0x18a1('0x3a')]);return db[_0x18a1('0x27')][_0x18a1('0x43')](_0x2648fb)['then'](handleEntityNotFound(_0x2b628c,null))[_0x18a1('0x21')](respondWithResult(_0x2b628c,null))[_0x18a1('0x40')](handleError(_0x2b628c,null));};exports[_0x18a1('0x44')]=function(_0x9e273a,_0x286483){return db[_0x18a1('0x27')][_0x18a1('0x44')](_0x9e273a[_0x18a1('0x45')],{})[_0x18a1('0x21')](respondWithResult(_0x286483,0xc9))[_0x18a1('0x40')](handleError(_0x286483,null));};exports[_0x18a1('0x20')]=function(_0x3539e0,_0x55db3a){if(_0x3539e0[_0x18a1('0x45')]['id']){delete _0x3539e0['body']['id'];}return db[_0x18a1('0x27')][_0x18a1('0x43')]({'where':{'id':_0x3539e0[_0x18a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x55db3a,null))[_0x18a1('0x21')](saveUpdates(_0x3539e0['body'],null))[_0x18a1('0x21')](respondWithResult(_0x55db3a,null))[_0x18a1('0x40')](handleError(_0x55db3a,null));};exports[_0x18a1('0x46')]=function(_0x27f93e,_0x570cd1){return db[_0x18a1('0x27')][_0x18a1('0x43')]({'where':{'id':_0x27f93e['params']['id']}})[_0x18a1('0x21')](handleEntityNotFound(_0x570cd1,null))[_0x18a1('0x21')](removeEntity(_0x570cd1,null))[_0x18a1('0x40')](handleError(_0x570cd1,null));}; \ No newline at end of file +var _0x1a80=['json','apply','reject','save','update','then','destroy','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','options','create','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','set','Content-Range'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1a80,0x11a));var _0x01a8=function(_0x488bf8,_0x36e139){_0x488bf8=_0x488bf8-0x0;var _0x3b57c1=_0x1a80[_0x488bf8];return _0x3b57c1;};'use strict';var pdf=require(_0x01a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x01a8('0x1'));var zipdir=require(_0x01a8('0x2'));var jsonpatch=require(_0x01a8('0x3'));var rp=require(_0x01a8('0x4'));var moment=require(_0x01a8('0x5'));var BPromise=require(_0x01a8('0x6'));var Mustache=require(_0x01a8('0x7'));var util=require(_0x01a8('0x8'));var path=require(_0x01a8('0x9'));var sox=require(_0x01a8('0xa'));var csv=require(_0x01a8('0xb'));var ejs=require(_0x01a8('0xc'));var fs=require('fs');var _=require(_0x01a8('0xd'));var squel=require(_0x01a8('0xe'));var crypto=require('crypto');var jsforce=require(_0x01a8('0xf'));var deskjs=require(_0x01a8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x01a8('0x11'));var Papa=require(_0x01a8('0x12'));var Redis=require(_0x01a8('0x13'));var authService=require(_0x01a8('0x14'));var qs=require(_0x01a8('0x15'));var hardwareService=require(_0x01a8('0x16'));var logger=require(_0x01a8('0x17'))(_0x01a8('0x18'));var utils=require(_0x01a8('0x19'));var config=require(_0x01a8('0x1a'));var db=require(_0x01a8('0x1b'))['db'];function respondWithStatusCode(_0x2a454e,_0x3054d5){_0x3054d5=_0x3054d5||0xcc;return function(_0x5c9027){if(_0x5c9027){return _0x2a454e[_0x01a8('0x1c')](_0x3054d5);}return _0x2a454e['status'](_0x3054d5)[_0x01a8('0x1d')]();};}function respondWithResult(_0x1c5c10,_0x44560d){_0x44560d=_0x44560d||0xc8;return function(_0x2435c1){if(_0x2435c1){return _0x1c5c10[_0x01a8('0x1e')](_0x44560d)['json'](_0x2435c1);}};}function respondWithFilteredResult(_0x14b755,_0x287ff0){return function(_0x2496a8){if(_0x2496a8){var _0x3bf501=_0x2496a8['count'],_0x3fda37=_0x287ff0[_0x01a8('0x1f')],_0x177255=_0x287ff0[_0x01a8('0x1f')]+_0x287ff0['limit'],_0xb30c6c;if(_0x177255>=_0x3bf501){_0x177255=_0x3bf501;_0xb30c6c=0xc8;}else{_0xb30c6c=0xce;}_0x14b755[_0x01a8('0x1e')](_0xb30c6c);return _0x14b755[_0x01a8('0x20')](_0x01a8('0x21'),_0x3fda37+'-'+_0x177255+'/'+_0x3bf501)[_0x01a8('0x22')](_0x2496a8);}return null;};}function patchUpdates(_0x18df47){return function(_0x36f0c7){try{jsonpatch[_0x01a8('0x23')](_0x36f0c7,_0x18df47,!![]);}catch(_0x546162){return BPromise[_0x01a8('0x24')](_0x546162);}return _0x36f0c7[_0x01a8('0x25')]();};}function saveUpdates(_0x362bbe,_0x34f99d){return function(_0x4fa59a){if(_0x4fa59a){return _0x4fa59a[_0x01a8('0x26')](_0x362bbe)[_0x01a8('0x27')](function(_0x5e8284){return _0x5e8284;});}return null;};}function removeEntity(_0x31019d,_0x5b3b90){return function(_0x51c776){if(_0x51c776){return _0x51c776[_0x01a8('0x28')]()[_0x01a8('0x27')](function(){_0x31019d[_0x01a8('0x1e')](0xcc)[_0x01a8('0x1d')]();});}};}function handleEntityNotFound(_0x53281e,_0x58e7bf){return function(_0x21e825){if(!_0x21e825){_0x53281e[_0x01a8('0x1c')](0x194);}return _0x21e825;};}function handleError(_0x3b5d28,_0x2a78a1){_0x2a78a1=_0x2a78a1||0x1f4;return function(_0x277e86){logger['error'](_0x277e86['stack']);if(_0x277e86['name']){delete _0x277e86[_0x01a8('0x29')];}_0x3b5d28[_0x01a8('0x1e')](_0x2a78a1)[_0x01a8('0x2a')](_0x277e86);};}exports[_0x01a8('0x2b')]=function(_0x56ac35,_0x2e7b46){var _0x1b24b9={},_0x4fd44b={},_0x43312d={'count':0x0,'rows':[]};var _0x301df8=db[_0x01a8('0x2c')][_0x01a8('0x2d')];_0x4fd44b[_0x01a8('0x2e')]=_[_0x01a8('0x2f')](_0x301df8);_0x4fd44b[_0x01a8('0x30')]=_[_0x01a8('0x2f')](_0x56ac35[_0x01a8('0x30')]);_0x4fd44b[_0x01a8('0x31')]=_[_0x01a8('0x32')](_0x4fd44b['model'],_0x4fd44b[_0x01a8('0x30')]);_0x1b24b9[_0x01a8('0x33')]=_[_0x01a8('0x32')](_0x4fd44b[_0x01a8('0x2e')],qs[_0x01a8('0x34')](_0x56ac35[_0x01a8('0x30')]['fields']));_0x1b24b9[_0x01a8('0x33')]=_0x1b24b9[_0x01a8('0x33')]['length']?_0x1b24b9[_0x01a8('0x33')]:_0x4fd44b[_0x01a8('0x2e')];if(!_0x56ac35['query'][_0x01a8('0x35')](_0x01a8('0x36'))){_0x1b24b9['limit']=qs[_0x01a8('0x37')](_0x56ac35[_0x01a8('0x30')][_0x01a8('0x37')]);_0x1b24b9[_0x01a8('0x1f')]=qs[_0x01a8('0x1f')](_0x56ac35['query'][_0x01a8('0x1f')]);}_0x1b24b9[_0x01a8('0x38')]=qs[_0x01a8('0x39')](_0x56ac35[_0x01a8('0x30')]['sort']);_0x1b24b9[_0x01a8('0x3a')]=qs[_0x01a8('0x31')](_[_0x01a8('0x3b')](_0x56ac35[_0x01a8('0x30')],_0x4fd44b[_0x01a8('0x31')]));if(_0x56ac35[_0x01a8('0x30')][_0x01a8('0x3c')]){_0x1b24b9[_0x01a8('0x3a')]=_[_0x01a8('0x3d')](_0x1b24b9['where'],{'$or':_[_0x01a8('0x3e')](_0x301df8,function(_0x3617c8){if(_0x3617c8[_0x01a8('0x3f')][_0x01a8('0x40')]!==_0x01a8('0x41')){var _0x5f066e={};_0x5f066e[_0x3617c8[_0x01a8('0x42')]]={'$like':'%'+_0x56ac35[_0x01a8('0x30')][_0x01a8('0x3c')]+'%'};return _0x5f066e;}})});}_0x1b24b9=_['merge']({},_0x1b24b9,_0x56ac35['options']);var _0x489020={'where':_0x1b24b9[_0x01a8('0x3a')]};return db[_0x01a8('0x2c')][_0x01a8('0x43')](_0x489020)[_0x01a8('0x27')](function(_0x27d35d){_0x43312d['count']=_0x27d35d;if(_0x56ac35[_0x01a8('0x30')][_0x01a8('0x44')]){_0x1b24b9[_0x01a8('0x45')]=[{'all':!![]}];}return db[_0x01a8('0x2c')][_0x01a8('0x46')](_0x1b24b9);})[_0x01a8('0x27')](function(_0x403d00){_0x43312d[_0x01a8('0x47')]=_0x403d00;return _0x43312d;})[_0x01a8('0x27')](respondWithFilteredResult(_0x2e7b46,_0x1b24b9))['catch'](handleError(_0x2e7b46,null));};exports[_0x01a8('0x48')]=function(_0x40cfda,_0x51f203){var _0x205935={'raw':!![],'where':{'id':_0x40cfda[_0x01a8('0x49')]['id']}},_0x38f57c={};_0x38f57c['model']=_[_0x01a8('0x2f')](db[_0x01a8('0x2c')]['rawAttributes']);_0x38f57c[_0x01a8('0x30')]=_[_0x01a8('0x2f')](_0x40cfda[_0x01a8('0x30')]);_0x38f57c[_0x01a8('0x31')]=_[_0x01a8('0x32')](_0x38f57c['model'],_0x38f57c[_0x01a8('0x30')]);_0x205935['attributes']=_[_0x01a8('0x32')](_0x38f57c[_0x01a8('0x2e')],qs[_0x01a8('0x34')](_0x40cfda['query'][_0x01a8('0x34')]));_0x205935[_0x01a8('0x33')]=_0x205935[_0x01a8('0x33')]['length']?_0x205935[_0x01a8('0x33')]:_0x38f57c[_0x01a8('0x2e')];if(_0x40cfda[_0x01a8('0x30')][_0x01a8('0x44')]){_0x205935[_0x01a8('0x45')]=[{'all':!![]}];}_0x205935=_['merge']({},_0x205935,_0x40cfda[_0x01a8('0x4a')]);return db['AnalyticTreeReport']['find'](_0x205935)[_0x01a8('0x27')](handleEntityNotFound(_0x51f203,null))[_0x01a8('0x27')](respondWithResult(_0x51f203,null))['catch'](handleError(_0x51f203,null));};exports[_0x01a8('0x4b')]=function(_0x3520f6,_0x5b6066){return db[_0x01a8('0x2c')]['create'](_0x3520f6[_0x01a8('0x4c')],{})[_0x01a8('0x27')](respondWithResult(_0x5b6066,0xc9))[_0x01a8('0x4d')](handleError(_0x5b6066,null));};exports[_0x01a8('0x26')]=function(_0x1a00cc,_0x1cf469){if(_0x1a00cc[_0x01a8('0x4c')]['id']){delete _0x1a00cc['body']['id'];}return db[_0x01a8('0x2c')][_0x01a8('0x4e')]({'where':{'id':_0x1a00cc[_0x01a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x1cf469,null))[_0x01a8('0x27')](saveUpdates(_0x1a00cc['body'],null))['then'](respondWithResult(_0x1cf469,null))['catch'](handleError(_0x1cf469,null));};exports[_0x01a8('0x28')]=function(_0x5ebd69,_0x530dea){return db['AnalyticTreeReport']['find']({'where':{'id':_0x5ebd69[_0x01a8('0x49')]['id']}})[_0x01a8('0x27')](handleEntityNotFound(_0x530dea,null))['then'](removeEntity(_0x530dea,null))['catch'](handleError(_0x530dea,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 0773e07..2f07ef2 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 _0x6392=['bluebird','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment'];(function(_0x293274,_0x1f9041){var _0x21730e=function(_0x56fc27){while(--_0x56fc27){_0x293274['push'](_0x293274['shift']());}};_0x21730e(++_0x1f9041);}(_0x6392,0x7a));var _0x2639=function(_0x2e84f6,_0x5354c8){_0x2e84f6=_0x2e84f6-0x0;var _0x59d210=_0x6392[_0x2e84f6];return _0x59d210;};'use strict';var _=require(_0x2639('0x0'));var util=require('util');var logger=require(_0x2639('0x1'))(_0x2639('0x2'));var moment=require(_0x2639('0x3'));var BPromise=require(_0x2639('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2639('0x5'));var attributes=require(_0x2639('0x6'));module['exports']=function(_0x2116f3,_0x513de8){return _0x2116f3['define'](_0x2639('0x7'),attributes,{'tableName':_0x2639('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf350=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees'];(function(_0xe6cbf9,_0x6123c2){var _0x172772=function(_0x32ca7d){while(--_0x32ca7d){_0xe6cbf9['push'](_0xe6cbf9['shift']());}};_0x172772(++_0x6123c2);}(_0xf350,0xab));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0f35('0x0'));var util=require(_0x0f35('0x1'));var logger=require(_0x0f35('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f35('0x3'));var rp=require(_0x0f35('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f35('0x5'));var config=require('../../config/environment');var attributes=require(_0x0f35('0x6'));module['exports']=function(_0xe6e9fa,_0x476df5){return _0xe6e9fa['define'](_0x0f35('0x7'),attributes,{'tableName':_0x0f35('0x8'),'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 46e6dfc..60db635 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 _0xb284=['jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','util','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x378a1c,_0x1bfad4){var _0xe2c06b=function(_0x367b64){while(--_0x367b64){_0x378a1c['push'](_0x378a1c['shift']());}};_0xe2c06b(++_0x1bfad4);}(_0xb284,0x12d));var _0x4b28=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb284[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4b28('0x0'));var moment=require('moment');var BPromise=require(_0x4b28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b28('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b28('0x3'))(_0x4b28('0x4'));var config=require('../../config/environment');var jayson=require(_0x4b28('0x5'));var client=jayson[_0x4b28('0x6')][_0x4b28('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a13ee,_0x4ba5e9,_0x445a1c){return new BPromise(function(_0x39c4c1,_0x550b7d){return client[_0x4b28('0x8')](_0x3a13ee,_0x445a1c)[_0x4b28('0x9')](function(_0x1ee4b7){logger[_0x4b28('0xa')](_0x4b28('0xb'),_0x4ba5e9,_0x4b28('0xc'));logger[_0x4b28('0xd')](_0x4b28('0xe'),_0x4ba5e9,'request\x20sent',JSON['stringify'](_0x1ee4b7));if(_0x1ee4b7['error']){if(_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x10')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4ba5e9,_0x1ee4b7['error'][_0x4b28('0x11')]);return _0x550b7d(_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x11')]);}logger['error'](_0x4b28('0xb'),_0x4ba5e9,_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x11')]);return _0x39c4c1(_0x1ee4b7['error'][_0x4b28('0x11')]);}else{logger['info'](_0x4b28('0xb'),_0x4ba5e9,'request\x20sent');_0x39c4c1(_0x1ee4b7['result'][_0x4b28('0x11')]);}})['catch'](function(_0xd1a24f){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4ba5e9,_0xd1a24f);_0x550b7d(_0xd1a24f);});});} \ No newline at end of file +var _0x6e02=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x6e02,0x12e));var _0x26e0=function(_0x1d37b5,_0x2b4baf){_0x1d37b5=_0x1d37b5-0x0;var _0xb88348=_0x6e02[_0x1d37b5];return _0xb88348;};'use strict';var _=require(_0x26e0('0x0'));var util=require(_0x26e0('0x1'));var moment=require('moment');var BPromise=require(_0x26e0('0x2'));var rs=require(_0x26e0('0x3'));var fs=require('fs');var Redis=require(_0x26e0('0x4'));var db=require(_0x26e0('0x5'))['db'];var utils=require(_0x26e0('0x6'));var logger=require(_0x26e0('0x7'))(_0x26e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x26e0('0x9'));var client=jayson[_0x26e0('0xa')][_0x26e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11fc5a,_0x490fdf,_0x4b39f2){return new BPromise(function(_0x5ad18d,_0x14ce16){return client[_0x26e0('0xc')](_0x11fc5a,_0x4b39f2)[_0x26e0('0xd')](function(_0x10d24c){logger[_0x26e0('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x490fdf,_0x26e0('0xf'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x490fdf,_0x26e0('0xf'),JSON[_0x26e0('0x10')](_0x10d24c));if(_0x10d24c[_0x26e0('0x11')]){if(_0x10d24c[_0x26e0('0x11')][_0x26e0('0x12')]===0x1f4){logger[_0x26e0('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x490fdf,_0x10d24c[_0x26e0('0x11')]['message']);return _0x14ce16(_0x10d24c['error'][_0x26e0('0x13')]);}logger[_0x26e0('0x11')](_0x26e0('0x14'),_0x490fdf,_0x10d24c[_0x26e0('0x11')][_0x26e0('0x13')]);return _0x5ad18d(_0x10d24c[_0x26e0('0x11')][_0x26e0('0x13')]);}else{logger[_0x26e0('0xe')](_0x26e0('0x14'),_0x490fdf,'request\x20sent');_0x5ad18d(_0x10d24c['result'][_0x26e0('0x13')]);}})[_0x26e0('0x15')](function(_0x422c32){logger['error'](_0x26e0('0x14'),_0x490fdf,_0x422c32);_0x14ce16(_0x422c32);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d2620b2..2c487f2 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 _0x23f4=['isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get'];(function(_0x31fa5c,_0x1c5c11){var _0x3fb703=function(_0x35fc53){while(--_0x35fc53){_0x31fa5c['push'](_0x31fa5c['shift']());}};_0x3fb703(++_0x1c5c11);}(_0x23f4,0x107));var _0x423f=function(_0x1f34a0,_0x43f28d){_0x1f34a0=_0x1f34a0-0x0;var _0x50f307=_0x23f4[_0x1f34a0];return _0x50f307;};'use strict';var multer=require(_0x423f('0x0'));var util=require(_0x423f('0x1'));var path=require(_0x423f('0x2'));var timeout=require('connect-timeout');var express=require(_0x423f('0x3'));var router=express[_0x423f('0x4')]();var auth=require(_0x423f('0x5'));var interaction=require(_0x423f('0x6'));var config=require('../../config/environment');var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller[_0x423f('0xa')]);router[_0x423f('0x8')](_0x423f('0xb'),auth[_0x423f('0x9')](),controller[_0x423f('0xc')]);router[_0x423f('0xd')]('/',auth[_0x423f('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x423f('0xe')]);router[_0x423f('0xf')](_0x423f('0xb'),auth[_0x423f('0x9')](),controller[_0x423f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x862f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x862f,0x10e));var _0xf862=function(_0x53baba,_0x2e88e0){_0x53baba=_0x53baba-0x0;var _0x5b1801=_0x862f[_0x53baba];return _0x5b1801;};'use strict';var multer=require(_0xf862('0x0'));var util=require(_0xf862('0x1'));var path=require(_0xf862('0x2'));var timeout=require(_0xf862('0x3'));var express=require(_0xf862('0x4'));var router=express[_0xf862('0x5')]();var auth=require(_0xf862('0x6'));var interaction=require(_0xf862('0x7'));var config=require(_0xf862('0x8'));var controller=require('./analyticTreeReport.controller');router[_0xf862('0x9')]('/',auth[_0xf862('0xa')](),controller['index']);router['get'](_0xf862('0xb'),auth[_0xf862('0xa')](),controller['show']);router[_0xf862('0xc')]('/',auth[_0xf862('0xa')](),controller[_0xf862('0xd')]);router[_0xf862('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf862('0xf')](_0xf862('0xb'),auth['isAuthenticated'](),controller[_0xf862('0x10')]);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 160d4e6..cb1f7aa 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 _0x8319=['sequelize','exports','STRING'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x8319,0x1ec));var _0x9831=function(_0x5d0a52,_0xa71579){_0x5d0a52=_0x5d0a52-0x0;var _0x35c72f=_0x8319[_0x5d0a52];return _0x35c72f;};'use strict';var Sequelize=require(_0x9831('0x0'));module[_0x9831('0x1')]={'name':{'type':Sequelize[_0x9831('0x2')]},'basename':{'type':Sequelize[_0x9831('0x2')]},'type':{'type':Sequelize[_0x9831('0x2')]}}; \ No newline at end of file +var _0x66b1=['exports','STRING','sequelize'];(function(_0x2866d0,_0x5ace5f){var _0x4f0033=function(_0x2c1231){while(--_0x2c1231){_0x2866d0['push'](_0x2866d0['shift']());}};_0x4f0033(++_0x5ace5f);}(_0x66b1,0xa7));var _0x166b=function(_0x5101c2,_0xea2d47){_0x5101c2=_0x5101c2-0x0;var _0x1ed61b=_0x66b1[_0x5101c2];return _0x1ed61b;};'use strict';var Sequelize=require(_0x166b('0x0'));module[_0x166b('0x1')]={'name':{'type':Sequelize[_0x166b('0x2')]},'basename':{'type':Sequelize[_0x166b('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 4bcf6bd..167fb21 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 _0x3678=['destroy','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','field','filter','count','include','then','rows','catch','body','find','params','create','originalname','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','html-pdf','fast-json-patch','request-promise','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','apply','save','update'];(function(_0x31ba0f,_0x521571){var _0xe991a0=function(_0x4cb146){while(--_0x4cb146){_0x31ba0f['push'](_0x31ba0f['shift']());}};_0xe991a0(++_0x521571);}(_0x3678,0x78));var _0x8367=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0x3678[_0x2920dd];return _0x5d4e52;};'use strict';var pdf=require(_0x8367('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8367('0x1'));var rp=require(_0x8367('0x2'));var moment=require('moment');var BPromise=require(_0x8367('0x3'));var Mustache=require(_0x8367('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8367('0x5'));var fs=require('fs');var _=require(_0x8367('0x6'));var squel=require(_0x8367('0x7'));var crypto=require('crypto');var jsforce=require(_0x8367('0x8'));var deskjs=require(_0x8367('0x9'));var toCsv=require(_0x8367('0xa'));var querystring=require(_0x8367('0xb'));var Papa=require('papaparse');var Redis=require(_0x8367('0xc'));var authService=require(_0x8367('0xd'));var qs=require(_0x8367('0xe'));var hardwareService=require(_0x8367('0xf'));var logger=require('../../config/logger')(_0x8367('0x10'));var utils=require(_0x8367('0x11'));var config=require('../../config/environment');var db=require(_0x8367('0x12'))['db'];function respondWithStatusCode(_0x17d23e,_0x42d73e){_0x42d73e=_0x42d73e||0xcc;return function(_0x59e83b){if(_0x59e83b){return _0x17d23e[_0x8367('0x13')](_0x42d73e);}return _0x17d23e[_0x8367('0x14')](_0x42d73e)[_0x8367('0x15')]();};}function respondWithResult(_0x39e574,_0x39bc2c){_0x39bc2c=_0x39bc2c||0xc8;return function(_0x25b213){if(_0x25b213){return _0x39e574[_0x8367('0x14')](_0x39bc2c)['json'](_0x25b213);}};}function respondWithFilteredResult(_0x3e5efe,_0x4e6c77){return function(_0x109324){if(_0x109324){var _0x347822=_0x109324['count'],_0x828b19=_0x4e6c77['offset'],_0x466618=_0x4e6c77[_0x8367('0x16')]+_0x4e6c77[_0x8367('0x17')],_0x560c47;if(_0x466618>=_0x347822){_0x466618=_0x347822;_0x560c47=0xc8;}else{_0x560c47=0xce;}_0x3e5efe[_0x8367('0x14')](_0x560c47);return _0x3e5efe['set'](_0x8367('0x18'),_0x828b19+'-'+_0x466618+'/'+_0x347822)['json'](_0x109324);}return null;};}function patchUpdates(_0x12964c){return function(_0x583c3a){try{jsonpatch[_0x8367('0x19')](_0x583c3a,_0x12964c,!![]);}catch(_0x1c2f1e){return BPromise['reject'](_0x1c2f1e);}return _0x583c3a[_0x8367('0x1a')]();};}function saveUpdates(_0x163908,_0x101558){return function(_0x8b5f34){if(_0x8b5f34){return _0x8b5f34[_0x8367('0x1b')](_0x163908)['then'](function(_0x4a442e){return _0x4a442e;});}return null;};}function removeEntity(_0xfe106c,_0x964f5e){return function(_0xae19aa){if(_0xae19aa){return _0xae19aa[_0x8367('0x1c')]()['then'](function(){_0xfe106c[_0x8367('0x14')](0xcc)[_0x8367('0x15')]();});}};}function handleEntityNotFound(_0x27e894,_0x304f6d){return function(_0x379e0f){if(!_0x379e0f){_0x27e894[_0x8367('0x13')](0x194);}return _0x379e0f;};}function handleError(_0x21bfe5,_0x1983f9){_0x1983f9=_0x1983f9||0x1f4;return function(_0x46a96){logger[_0x8367('0x1d')](_0x46a96[_0x8367('0x1e')]);if(_0x46a96['name']){delete _0x46a96[_0x8367('0x1f')];}_0x21bfe5[_0x8367('0x14')](_0x1983f9)[_0x8367('0x20')](_0x46a96);};}exports[_0x8367('0x21')]=function(_0x583f13,_0x803d23){var _0x522b9d={},_0x3121b6={},_0x91aa56={'count':0x0,'rows':[]};var _0x25fe4a=db[_0x8367('0x22')][_0x8367('0x23')];_0x3121b6[_0x8367('0x24')]=_[_0x8367('0x25')](_0x25fe4a);_0x3121b6[_0x8367('0x26')]=_['keys'](_0x583f13[_0x8367('0x26')]);_0x3121b6[_0x8367('0x27')]=_[_0x8367('0x28')](_0x3121b6[_0x8367('0x24')],_0x3121b6[_0x8367('0x26')]);_0x522b9d[_0x8367('0x29')]=_[_0x8367('0x28')](_0x3121b6[_0x8367('0x24')],qs[_0x8367('0x2a')](_0x583f13[_0x8367('0x26')][_0x8367('0x2a')]));_0x522b9d[_0x8367('0x29')]=_0x522b9d['attributes'][_0x8367('0x2b')]?_0x522b9d[_0x8367('0x29')]:_0x3121b6[_0x8367('0x24')];if(!_0x583f13[_0x8367('0x26')][_0x8367('0x2c')](_0x8367('0x2d'))){_0x522b9d[_0x8367('0x17')]=qs[_0x8367('0x17')](_0x583f13['query']['limit']);_0x522b9d[_0x8367('0x16')]=qs[_0x8367('0x16')](_0x583f13[_0x8367('0x26')][_0x8367('0x16')]);}_0x522b9d['order']=qs[_0x8367('0x2e')](_0x583f13[_0x8367('0x26')][_0x8367('0x2e')]);_0x522b9d[_0x8367('0x2f')]=qs[_0x8367('0x27')](_[_0x8367('0x30')](_0x583f13[_0x8367('0x26')],_0x3121b6['filters']));if(_0x583f13[_0x8367('0x26')]['filter']){_0x522b9d[_0x8367('0x2f')]=_[_0x8367('0x31')](_0x522b9d[_0x8367('0x2f')],{'$or':_[_0x8367('0x32')](_0x25fe4a,function(_0x562c3f){if(_0x562c3f[_0x8367('0x33')]['key']!==_0x8367('0x34')){var _0x2b74ee={};_0x2b74ee[_0x562c3f[_0x8367('0x35')]]={'$like':'%'+_0x583f13[_0x8367('0x26')][_0x8367('0x36')]+'%'};return _0x2b74ee;}})});}_0x522b9d=_[_0x8367('0x31')]({},_0x522b9d,_0x583f13['options']);var _0x5e57de={'where':_0x522b9d[_0x8367('0x2f')]};return db[_0x8367('0x22')][_0x8367('0x37')](_0x5e57de)['then'](function(_0x3b6388){_0x91aa56[_0x8367('0x37')]=_0x3b6388;if(_0x583f13['query']['includeAll']){_0x522b9d[_0x8367('0x38')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x522b9d);})[_0x8367('0x39')](function(_0x4878ab){_0x91aa56[_0x8367('0x3a')]=_0x4878ab;return _0x91aa56;})[_0x8367('0x39')](respondWithFilteredResult(_0x803d23,_0x522b9d))[_0x8367('0x3b')](handleError(_0x803d23,null));};exports['show']=function(_0x2b055e,_0x20c422){var _0x4081b7={'raw':!![],'where':{'id':_0x2b055e['params']['id']}},_0x4f21e6={};_0x4f21e6[_0x8367('0x24')]=_['keys'](db[_0x8367('0x22')][_0x8367('0x23')]);_0x4f21e6[_0x8367('0x26')]=_[_0x8367('0x25')](_0x2b055e[_0x8367('0x26')]);_0x4f21e6['filters']=_[_0x8367('0x28')](_0x4f21e6[_0x8367('0x24')],_0x4f21e6['query']);_0x4081b7[_0x8367('0x29')]=_[_0x8367('0x28')](_0x4f21e6[_0x8367('0x24')],qs[_0x8367('0x2a')](_0x2b055e[_0x8367('0x26')]['fields']));_0x4081b7[_0x8367('0x29')]=_0x4081b7['attributes'][_0x8367('0x2b')]?_0x4081b7[_0x8367('0x29')]:_0x4f21e6[_0x8367('0x24')];if(_0x2b055e[_0x8367('0x26')]['includeAll']){_0x4081b7[_0x8367('0x38')]=[{'all':!![]}];}_0x4081b7=_['merge']({},_0x4081b7,_0x2b055e['options']);return db[_0x8367('0x22')]['find'](_0x4081b7)['then'](handleEntityNotFound(_0x20c422,null))['then'](respondWithResult(_0x20c422,null))['catch'](handleError(_0x20c422,null));};exports['update']=function(_0x1c3ce1,_0x310742){if(_0x1c3ce1['body']['id']){delete _0x1c3ce1[_0x8367('0x3c')]['id'];}return db['Attachment'][_0x8367('0x3d')]({'where':{'id':_0x1c3ce1[_0x8367('0x3e')]['id']}})[_0x8367('0x39')](handleEntityNotFound(_0x310742,null))['then'](saveUpdates(_0x1c3ce1[_0x8367('0x3c')],null))[_0x8367('0x39')](respondWithResult(_0x310742,null))[_0x8367('0x3b')](handleError(_0x310742,null));};exports[_0x8367('0x1c')]=function(_0x297649,_0x48f44d){return db[_0x8367('0x22')][_0x8367('0x3d')]({'where':{'id':_0x297649[_0x8367('0x3e')]['id']}})[_0x8367('0x39')](handleEntityNotFound(_0x48f44d,null))['then'](removeEntity(_0x48f44d,null))['catch'](handleError(_0x48f44d,null));};exports[_0x8367('0x3f')]=function(_0x297c63,_0x847c4,_0x30d6f4){_0x297c63['body'][_0x8367('0x1f')]=_0x297c63['file'][_0x8367('0x40')];_0x297c63[_0x8367('0x3c')]['basename']=_0x297c63[_0x8367('0x41')][_0x8367('0x42')];_0x297c63[_0x8367('0x3c')]['type']=_0x297c63['file'][_0x8367('0x43')];return db[_0x8367('0x22')][_0x8367('0x3f')](_0x297c63[_0x8367('0x3c')])['then'](respondWithResult(_0x847c4,0xc9))['catch'](handleError(_0x847c4,null));};exports[_0x8367('0x44')]=function(_0x5dc7e4,_0x1d245b,_0x305af3){return db[_0x8367('0x22')][_0x8367('0x45')]({'where':{'id':_0x5dc7e4['params']['id']},'raw':!![]})[_0x8367('0x39')](handleEntityNotFound(_0x1d245b,null))['then'](function(_0x5cdbdc){if(_0x5cdbdc){return _0x1d245b[_0x8367('0x44')](path[_0x8367('0x46')](config[_0x8367('0x47')],_0x8367('0x48'),_0x5cdbdc[_0x8367('0x49')]));}})[_0x8367('0x3b')](handleError(_0x1d245b,null));}; \ No newline at end of file +var _0x1bf2=['bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','end','count','offset','set','json','apply','reject','save','then','destroy','status','name','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','catch','update','body','file','originalname','basename','filename','mimetype','create','download','findOne','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3e6946,_0x29fdd6){var _0x46a25a=function(_0x344719){while(--_0x344719){_0x3e6946['push'](_0x3e6946['shift']());}};_0x46a25a(++_0x29fdd6);}(_0x1bf2,0x94));var _0x21bf=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1bf2[_0x49ca18];return _0x145d54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x21bf('0x0'));var rimraf=require(_0x21bf('0x1'));var zipdir=require(_0x21bf('0x2'));var jsonpatch=require(_0x21bf('0x3'));var rp=require(_0x21bf('0x4'));var moment=require(_0x21bf('0x5'));var BPromise=require(_0x21bf('0x6'));var Mustache=require(_0x21bf('0x7'));var util=require(_0x21bf('0x8'));var path=require(_0x21bf('0x9'));var sox=require(_0x21bf('0xa'));var csv=require(_0x21bf('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x21bf('0xc'));var squel=require('squel');var crypto=require(_0x21bf('0xd'));var jsforce=require(_0x21bf('0xe'));var deskjs=require(_0x21bf('0xf'));var toCsv=require(_0x21bf('0xb'));var querystring=require('querystring');var Papa=require(_0x21bf('0x10'));var Redis=require(_0x21bf('0x11'));var authService=require(_0x21bf('0x12'));var qs=require(_0x21bf('0x13'));var hardwareService=require(_0x21bf('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x21bf('0x15'))['db'];function respondWithStatusCode(_0x506020,_0x4c5ec7){_0x4c5ec7=_0x4c5ec7||0xcc;return function(_0x1efe6f){if(_0x1efe6f){return _0x506020[_0x21bf('0x16')](_0x4c5ec7);}return _0x506020['status'](_0x4c5ec7)[_0x21bf('0x17')]();};}function respondWithResult(_0x33fe23,_0x5574d4){_0x5574d4=_0x5574d4||0xc8;return function(_0x4397f5){if(_0x4397f5){return _0x33fe23['status'](_0x5574d4)['json'](_0x4397f5);}};}function respondWithFilteredResult(_0x208ca5,_0x8e6234){return function(_0xa6a432){if(_0xa6a432){var _0x2b35fb=_0xa6a432[_0x21bf('0x18')],_0x247db6=_0x8e6234[_0x21bf('0x19')],_0x557fb5=_0x8e6234[_0x21bf('0x19')]+_0x8e6234['limit'],_0x51bab6;if(_0x557fb5>=_0x2b35fb){_0x557fb5=_0x2b35fb;_0x51bab6=0xc8;}else{_0x51bab6=0xce;}_0x208ca5['status'](_0x51bab6);return _0x208ca5[_0x21bf('0x1a')]('Content-Range',_0x247db6+'-'+_0x557fb5+'/'+_0x2b35fb)[_0x21bf('0x1b')](_0xa6a432);}return null;};}function patchUpdates(_0x5cbc7d){return function(_0x4ecce2){try{jsonpatch[_0x21bf('0x1c')](_0x4ecce2,_0x5cbc7d,!![]);}catch(_0x2d5380){return BPromise[_0x21bf('0x1d')](_0x2d5380);}return _0x4ecce2[_0x21bf('0x1e')]();};}function saveUpdates(_0x16d709,_0x1c3ff2){return function(_0xe73342){if(_0xe73342){return _0xe73342['update'](_0x16d709)[_0x21bf('0x1f')](function(_0xd417d8){return _0xd417d8;});}return null;};}function removeEntity(_0x36b721,_0x3631c7){return function(_0x2f8dc2){if(_0x2f8dc2){return _0x2f8dc2[_0x21bf('0x20')]()[_0x21bf('0x1f')](function(){_0x36b721[_0x21bf('0x21')](0xcc)[_0x21bf('0x17')]();});}};}function handleEntityNotFound(_0x95d434,_0x5c9f62){return function(_0x402ff1){if(!_0x402ff1){_0x95d434[_0x21bf('0x16')](0x194);}return _0x402ff1;};}function handleError(_0x1f9fee,_0x1a73b2){_0x1a73b2=_0x1a73b2||0x1f4;return function(_0x389373){logger['error'](_0x389373['stack']);if(_0x389373[_0x21bf('0x22')]){delete _0x389373[_0x21bf('0x22')];}_0x1f9fee[_0x21bf('0x21')](_0x1a73b2)['send'](_0x389373);};}exports[_0x21bf('0x23')]=function(_0x37abe4,_0x3f1098){var _0x2a6c62={},_0x48fa47={},_0x36ae0f={'count':0x0,'rows':[]};var _0x1d2098=db[_0x21bf('0x24')][_0x21bf('0x25')];_0x48fa47[_0x21bf('0x26')]=_[_0x21bf('0x27')](_0x1d2098);_0x48fa47[_0x21bf('0x28')]=_[_0x21bf('0x27')](_0x37abe4['query']);_0x48fa47[_0x21bf('0x29')]=_[_0x21bf('0x2a')](_0x48fa47['model'],_0x48fa47['query']);_0x2a6c62[_0x21bf('0x2b')]=_[_0x21bf('0x2a')](_0x48fa47['model'],qs['fields'](_0x37abe4[_0x21bf('0x28')][_0x21bf('0x2c')]));_0x2a6c62[_0x21bf('0x2b')]=_0x2a6c62['attributes'][_0x21bf('0x2d')]?_0x2a6c62['attributes']:_0x48fa47[_0x21bf('0x26')];if(!_0x37abe4[_0x21bf('0x28')][_0x21bf('0x2e')](_0x21bf('0x2f'))){_0x2a6c62['limit']=qs[_0x21bf('0x30')](_0x37abe4[_0x21bf('0x28')]['limit']);_0x2a6c62[_0x21bf('0x19')]=qs[_0x21bf('0x19')](_0x37abe4['query'][_0x21bf('0x19')]);}_0x2a6c62[_0x21bf('0x31')]=qs['sort'](_0x37abe4[_0x21bf('0x28')]['sort']);_0x2a6c62[_0x21bf('0x32')]=qs[_0x21bf('0x29')](_['pick'](_0x37abe4['query'],_0x48fa47['filters']));if(_0x37abe4[_0x21bf('0x28')][_0x21bf('0x33')]){_0x2a6c62[_0x21bf('0x32')]=_[_0x21bf('0x34')](_0x2a6c62[_0x21bf('0x32')],{'$or':_[_0x21bf('0x35')](_0x1d2098,function(_0x4461bd){if(_0x4461bd[_0x21bf('0x36')][_0x21bf('0x37')]!==_0x21bf('0x38')){var _0x4620e6={};_0x4620e6[_0x4461bd[_0x21bf('0x39')]]={'$like':'%'+_0x37abe4[_0x21bf('0x28')][_0x21bf('0x33')]+'%'};return _0x4620e6;}})});}_0x2a6c62=_[_0x21bf('0x34')]({},_0x2a6c62,_0x37abe4[_0x21bf('0x3a')]);var _0x2a285c={'where':_0x2a6c62['where']};return db[_0x21bf('0x24')][_0x21bf('0x18')](_0x2a285c)['then'](function(_0x1ada3c){_0x36ae0f['count']=_0x1ada3c;if(_0x37abe4[_0x21bf('0x28')]['includeAll']){_0x2a6c62[_0x21bf('0x3b')]=[{'all':!![]}];}return db[_0x21bf('0x24')][_0x21bf('0x3c')](_0x2a6c62);})[_0x21bf('0x1f')](function(_0x125cdd){_0x36ae0f['rows']=_0x125cdd;return _0x36ae0f;})[_0x21bf('0x1f')](respondWithFilteredResult(_0x3f1098,_0x2a6c62))['catch'](handleError(_0x3f1098,null));};exports[_0x21bf('0x3d')]=function(_0x491f82,_0x1b105a){var _0x1920c8={'raw':!![],'where':{'id':_0x491f82[_0x21bf('0x3e')]['id']}},_0x3c7f56={};_0x3c7f56[_0x21bf('0x26')]=_[_0x21bf('0x27')](db[_0x21bf('0x24')][_0x21bf('0x25')]);_0x3c7f56[_0x21bf('0x28')]=_[_0x21bf('0x27')](_0x491f82['query']);_0x3c7f56[_0x21bf('0x29')]=_[_0x21bf('0x2a')](_0x3c7f56[_0x21bf('0x26')],_0x3c7f56[_0x21bf('0x28')]);_0x1920c8[_0x21bf('0x2b')]=_[_0x21bf('0x2a')](_0x3c7f56[_0x21bf('0x26')],qs[_0x21bf('0x2c')](_0x491f82[_0x21bf('0x28')][_0x21bf('0x2c')]));_0x1920c8['attributes']=_0x1920c8[_0x21bf('0x2b')]['length']?_0x1920c8[_0x21bf('0x2b')]:_0x3c7f56[_0x21bf('0x26')];if(_0x491f82[_0x21bf('0x28')][_0x21bf('0x3f')]){_0x1920c8[_0x21bf('0x3b')]=[{'all':!![]}];}_0x1920c8=_[_0x21bf('0x34')]({},_0x1920c8,_0x491f82[_0x21bf('0x3a')]);return db[_0x21bf('0x24')][_0x21bf('0x40')](_0x1920c8)[_0x21bf('0x1f')](handleEntityNotFound(_0x1b105a,null))[_0x21bf('0x1f')](respondWithResult(_0x1b105a,null))[_0x21bf('0x41')](handleError(_0x1b105a,null));};exports[_0x21bf('0x42')]=function(_0x156fce,_0x5dd61e){if(_0x156fce[_0x21bf('0x43')]['id']){delete _0x156fce[_0x21bf('0x43')]['id'];}return db[_0x21bf('0x24')][_0x21bf('0x40')]({'where':{'id':_0x156fce[_0x21bf('0x3e')]['id']}})[_0x21bf('0x1f')](handleEntityNotFound(_0x5dd61e,null))[_0x21bf('0x1f')](saveUpdates(_0x156fce[_0x21bf('0x43')],null))[_0x21bf('0x1f')](respondWithResult(_0x5dd61e,null))['catch'](handleError(_0x5dd61e,null));};exports['destroy']=function(_0x1bed6c,_0x1290d6){return db['Attachment'][_0x21bf('0x40')]({'where':{'id':_0x1bed6c[_0x21bf('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1290d6,null))['then'](removeEntity(_0x1290d6,null))[_0x21bf('0x41')](handleError(_0x1290d6,null));};exports['create']=function(_0xdcf314,_0x2d4cfd,_0x5d6da2){_0xdcf314['body'][_0x21bf('0x22')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x45')];_0xdcf314[_0x21bf('0x43')][_0x21bf('0x46')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x47')];_0xdcf314['body'][_0x21bf('0x36')]=_0xdcf314[_0x21bf('0x44')][_0x21bf('0x48')];return db['Attachment'][_0x21bf('0x49')](_0xdcf314[_0x21bf('0x43')])['then'](respondWithResult(_0x2d4cfd,0xc9))[_0x21bf('0x41')](handleError(_0x2d4cfd,null));};exports[_0x21bf('0x4a')]=function(_0x301a2c,_0x54097a,_0x184394){return db[_0x21bf('0x24')][_0x21bf('0x4b')]({'where':{'id':_0x301a2c[_0x21bf('0x3e')]['id']},'raw':!![]})[_0x21bf('0x1f')](handleEntityNotFound(_0x54097a,null))[_0x21bf('0x1f')](function(_0x3c9b58){if(_0x3c9b58){return _0x54097a[_0x21bf('0x4a')](path[_0x21bf('0x4c')](config['root'],'server/files/attachments/',_0x3c9b58[_0x21bf('0x46')]));}})['catch'](handleError(_0x54097a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 39475ff..d1e5373 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 _0x09dd=['exports','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09dd,0x81));var _0xd09d=function(_0x23b85e,_0x39b209){_0x23b85e=_0x23b85e-0x0;var _0x329756=_0x09dd[_0x23b85e];return _0x329756;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe41f=['../../config/logger','api','path','rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','util'];(function(_0x594ff5,_0x47aa57){var _0x5042d6=function(_0x58074f){while(--_0x58074f){_0x594ff5['push'](_0x594ff5['shift']());}};_0x5042d6(++_0x47aa57);}(_0xe41f,0x13e));var _0xfe41=function(_0x4f537a,_0x54ef54){_0x4f537a=_0x4f537a-0x0;var _0x5e3b03=_0xe41f[_0x4f537a];return _0x5e3b03;};'use strict';var _=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var logger=require(_0xfe41('0x2'))(_0xfe41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe41('0x4'));var rimraf=require(_0xfe41('0x5'));var config=require(_0xfe41('0x6'));var attributes=require(_0xfe41('0x7'));module['exports']=function(_0x52d56e,_0x2e8e86){return _0x52d56e['define'](_0xfe41('0x8'),attributes,{'tableName':_0xfe41('0x9'),'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 1b25efe..ed35fef 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 _0x48fa=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','debug','catch','lodash','util'];(function(_0x19d0ea,_0x5e2bc0){var _0x28cc5e=function(_0x52ddb0){while(--_0x52ddb0){_0x19d0ea['push'](_0x19d0ea['shift']());}};_0x28cc5e(++_0x5e2bc0);}(_0x48fa,0x127));var _0xa48f=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x48fa[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xa48f('0x0'));var util=require(_0xa48f('0x1'));var moment=require(_0xa48f('0x2'));var BPromise=require(_0xa48f('0x3'));var rs=require(_0xa48f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa48f('0x5'))(_0xa48f('0x6'));var config=require(_0xa48f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa48f('0x8')][_0xa48f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c2693,_0x5909c4,_0x4c63c5){return new BPromise(function(_0x295c24,_0x560988){return client['request'](_0x1c2693,_0x4c63c5)[_0xa48f('0xa')](function(_0x2d28d1){logger[_0xa48f('0xb')](_0xa48f('0xc'),_0x5909c4,_0xa48f('0xd'));logger['debug'](_0xa48f('0xe'),_0x5909c4,_0xa48f('0xd'),JSON[_0xa48f('0xf')](_0x2d28d1));if(_0x2d28d1['error']){if(_0x2d28d1['error'][_0xa48f('0x10')]===0x1f4){logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);return _0x560988(_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);}logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0x2d28d1['error'][_0xa48f('0x12')]);return _0x295c24(_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x5909c4,_0xa48f('0xd'));_0x295c24(_0x2d28d1[_0xa48f('0x13')][_0xa48f('0x12')]);}})['catch'](function(_0xe042a5){logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0xe042a5);_0x560988(_0xe042a5);});});}exports[_0xa48f('0x14')]=function(_0x5c3bc6){var _0x1972ac=this;return new Promise(function(_0x173ed2,_0x594da0){return db['Attachment'][_0xa48f('0x15')](_0x5c3bc6[_0xa48f('0x16')],{'raw':_0x5c3bc6['options']?_0x5c3bc6[_0xa48f('0x17')][_0xa48f('0x18')]===undefined?!![]:![]:!![]})[_0xa48f('0xa')](function(_0x2e5626){logger[_0xa48f('0xb')](_0xa48f('0x14'),_0x5c3bc6);logger[_0xa48f('0x19')]('CreateAttachment',_0x5c3bc6,JSON[_0xa48f('0xf')](_0x2e5626));_0x173ed2(_0x2e5626);})[_0xa48f('0x1a')](function(_0x21743c){logger['error'](_0xa48f('0x14'),_0x21743c[_0xa48f('0x12')],_0x5c3bc6);_0x594da0(_0x1972ac[_0xa48f('0x11')](0x1f4,_0x21743c[_0xa48f('0x12')]));});});}; \ No newline at end of file +var _0x2452=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash'];(function(_0x51c848,_0x31973b){var _0x4d80b0=function(_0x26a767){while(--_0x26a767){_0x51c848['push'](_0x51c848['shift']());}};_0x4d80b0(++_0x31973b);}(_0x2452,0x179));var _0x2245=function(_0x4acdef,_0x3cc14f){_0x4acdef=_0x4acdef-0x0;var _0x3822f3=_0x2452[_0x4acdef];return _0x3822f3;};'use strict';var _=require(_0x2245('0x0'));var util=require(_0x2245('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2245('0x2'));var fs=require('fs');var Redis=require(_0x2245('0x3'));var db=require(_0x2245('0x4'))['db'];var utils=require(_0x2245('0x5'));var logger=require(_0x2245('0x6'))(_0x2245('0x7'));var config=require(_0x2245('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2245('0x9')][_0x2245('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16bb56,_0x39c7c2,_0x2a8daa){return new BPromise(function(_0x5ec659,_0x4ee962){return client[_0x2245('0xb')](_0x16bb56,_0x2a8daa)[_0x2245('0xc')](function(_0x2ef999){logger[_0x2245('0xd')](_0x2245('0xe'),_0x39c7c2,_0x2245('0xf'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x39c7c2,'request\x20sent',JSON[_0x2245('0x10')](_0x2ef999));if(_0x2ef999['error']){if(_0x2ef999[_0x2245('0x11')][_0x2245('0x12')]===0x1f4){logger[_0x2245('0x11')](_0x2245('0xe'),_0x39c7c2,_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);return _0x4ee962(_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);}logger[_0x2245('0x11')]('Attachment,\x20%s,\x20%s',_0x39c7c2,_0x2ef999[_0x2245('0x11')][_0x2245('0x13')]);return _0x5ec659(_0x2ef999[_0x2245('0x11')]['message']);}else{logger['info'](_0x2245('0xe'),_0x39c7c2,'request\x20sent');_0x5ec659(_0x2ef999[_0x2245('0x14')][_0x2245('0x13')]);}})[_0x2245('0x15')](function(_0x580630){logger[_0x2245('0x11')](_0x2245('0xe'),_0x39c7c2,_0x580630);_0x4ee962(_0x580630);});});}exports[_0x2245('0x16')]=function(_0xe2c3e1){var _0x14b12f=this;return new Promise(function(_0x208c5f,_0x4857bc){return db[_0x2245('0x17')][_0x2245('0x18')](_0xe2c3e1[_0x2245('0x19')],{'raw':_0xe2c3e1['options']?_0xe2c3e1[_0x2245('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2245('0xc')](function(_0x3f99e1){logger['info'](_0x2245('0x16'),_0xe2c3e1);logger['debug'](_0x2245('0x16'),_0xe2c3e1,JSON[_0x2245('0x10')](_0x3f99e1));_0x208c5f(_0x3f99e1);})[_0x2245('0x15')](function(_0x479622){logger['error'](_0x2245('0x16'),_0x479622[_0x2245('0x13')],_0xe2c3e1);_0x4857bc(_0x14b12f[_0x2245('0x11')](0x1f4,_0x479622[_0x2245('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8dccdbb..46c5c44 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 _0xd957=['isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','post','single','file','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get'];(function(_0x473e3f,_0x2f0947){var _0x59399b=function(_0x26dece){while(--_0x26dece){_0x473e3f['push'](_0x473e3f['shift']());}};_0x59399b(++_0x2f0947);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var path=require('path');var timeout=require(_0x7d95('0x2'));var express=require(_0x7d95('0x3'));var router=express['Router']();var auth=require(_0x7d95('0x4'));var interaction=require(_0x7d95('0x5'));var config=require(_0x7d95('0x6'));var controller=require(_0x7d95('0x7'));router[_0x7d95('0x8')]('/',auth[_0x7d95('0x9')](),controller[_0x7d95('0xa')]);router['get'](_0x7d95('0xb'),auth[_0x7d95('0x9')](),controller['show']);router[_0x7d95('0x8')](_0x7d95('0xc'),auth[_0x7d95('0x9')](),controller[_0x7d95('0xd')]);var upload=multer({'storage':multer[_0x7d95('0xe')]({'destination':function(_0x572e5f,_0x2e0589,_0x109cec){_0x109cec(null,path[_0x7d95('0xf')](config[_0x7d95('0x10')],_0x7d95('0x11')));},'filename':function(_0x4bbaf1,_0x5f34b9,_0x2ed92b){_0x2ed92b(null,util[_0x7d95('0x12')]('%s-%s',Date[_0x7d95('0x13')](),_0x5f34b9[_0x7d95('0x14')][_0x7d95('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7d95('0x16')]('/',upload[_0x7d95('0x17')](_0x7d95('0x18')),controller['create']);router[_0x7d95('0x19')]('/:id',auth[_0x7d95('0x9')](),controller['update']);router[_0x7d95('0x1a')]('/:id',auth[_0x7d95('0x9')](),controller[_0x7d95('0x1b')]);module[_0x7d95('0x1c')]=router; \ No newline at end of file +var _0x9c2c=['multer','util','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','single','file','create','put','update','delete','destroy','exports'];(function(_0x1f302d,_0x29aa8b){var _0x598f9d=function(_0x7f535b){while(--_0x7f535b){_0x1f302d['push'](_0x1f302d['shift']());}};_0x598f9d(++_0x29aa8b);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc9c2('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xc9c2('0x3'));var config=require(_0xc9c2('0x4'));var controller=require('./attachment.controller');router['get']('/',auth[_0xc9c2('0x5')](),controller['index']);router[_0xc9c2('0x6')](_0xc9c2('0x7'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0x8')]);router[_0xc9c2('0x6')](_0xc9c2('0x9'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0xa')]);var upload=multer({'storage':multer[_0xc9c2('0xb')]({'destination':function(_0x53e18d,_0x342609,_0x530f6a){_0x530f6a(null,path[_0xc9c2('0xc')](config[_0xc9c2('0xd')],_0xc9c2('0xe')));},'filename':function(_0x275b08,_0x5894a4,_0x4f8453){_0x4f8453(null,util[_0xc9c2('0xf')](_0xc9c2('0x10'),Date['now'](),_0x5894a4[_0xc9c2('0x11')][_0xc9c2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc9c2('0x13')]('/',upload[_0xc9c2('0x14')](_0xc9c2('0x15')),controller[_0xc9c2('0x16')]);router[_0xc9c2('0x17')](_0xc9c2('0x7'),auth[_0xc9c2('0x5')](),controller[_0xc9c2('0x18')]);router[_0xc9c2('0x19')](_0xc9c2('0x7'),auth['isAuthenticated'](),controller[_0xc9c2('0x1a')]);module[_0xc9c2('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 8ea5c72..15e436e 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 _0x4fe0=['authenticate','use','clientID','clientSecret','secret','callbackURL','User','find','map','emails','user','agent','then','Incorrect\x20username\x20and/or\x20password','catch','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','login','google','/login','profile','email'];(function(_0x355de0,_0x3e1d21){var _0xad0de2=function(_0x5ac42d){while(--_0x5ac42d){_0x355de0['push'](_0x355de0['shift']());}};_0xad0de2(++_0x3e1d21);}(_0x4fe0,0x195));var _0x04fe=function(_0x3a176c,_0x1747cb){_0x3a176c=_0x3a176c-0x0;var _0x44d5b5=_0x4fe0[_0x3a176c];return _0x44d5b5;};'use strict';var _=require('lodash');var passport=require(_0x04fe('0x0'));var GoogleStrategy=require(_0x04fe('0x1'))[_0x04fe('0x2')];var db=require(_0x04fe('0x3'))['db'];var config=require(_0x04fe('0x4'));var signToken=require(_0x04fe('0x5'))['signToken'];exports[_0x04fe('0x6')]=passport['authenticate'](_0x04fe('0x7'),{'failureRedirect':_0x04fe('0x8'),'scope':[_0x04fe('0x9'),_0x04fe('0xa')],'session':![]});exports['callback']=passport[_0x04fe('0xb')]('google',{'failureRedirect':_0x04fe('0x8'),'session':![]});passport[_0x04fe('0xc')](new GoogleStrategy({'clientID':config[_0x04fe('0x7')]?config[_0x04fe('0x7')][_0x04fe('0xd')]:'id','clientSecret':config['google']?config['google'][_0x04fe('0xe')]:_0x04fe('0xf'),'callbackURL':config[_0x04fe('0x7')]?config[_0x04fe('0x7')][_0x04fe('0x10')]:''},function(_0x122b91,_0x426eac,_0x1796e3,_0x319794){db[_0x04fe('0x11')][_0x04fe('0x12')]({'where':{'email':_[_0x04fe('0x13')](_0x1796e3[_0x04fe('0x14')],'value'),'role':{'$or':['admin',_0x04fe('0x15'),_0x04fe('0x16')]}}})[_0x04fe('0x17')](function(_0x10bc7e){if(_0x10bc7e){return _0x319794(null,_0x10bc7e);}_0x319794(_0x04fe('0x18'));})[_0x04fe('0x19')](function(_0x310a70){_0x319794(_0x310a70);});})); \ No newline at end of file +var _0xb5bb=['callbackURL','User','find','emails','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport','passport-google-oauth20','../../mysqldb','../../config/environment','profile','email','authenticate','google','/login','use','clientID','clientSecret','secret'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0xfe5d19,_0x105d63){_0xfe5d19=_0xfe5d19-0x0;var _0x126180=_0xb5bb[_0xfe5d19];return _0x126180;};'use strict';var _=require(_0xbb5b('0x0'));var passport=require(_0xbb5b('0x1'));var GoogleStrategy=require(_0xbb5b('0x2'))['Strategy'];var db=require(_0xbb5b('0x3'))['db'];var config=require(_0xbb5b('0x4'));var signToken=require('../../components/auth/service')['signToken'];exports['login']=passport['authenticate']('google',{'failureRedirect':'/login','scope':[_0xbb5b('0x5'),_0xbb5b('0x6')],'session':![]});exports['callback']=passport[_0xbb5b('0x7')](_0xbb5b('0x8'),{'failureRedirect':_0xbb5b('0x9'),'session':![]});passport[_0xbb5b('0xa')](new GoogleStrategy({'clientID':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xb')]:'id','clientSecret':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xc')]:_0xbb5b('0xd'),'callbackURL':config[_0xbb5b('0x8')]?config[_0xbb5b('0x8')][_0xbb5b('0xe')]:''},function(_0x10411c,_0x15e47d,_0x26f627,_0xbd6621){db[_0xbb5b('0xf')][_0xbb5b('0x10')]({'where':{'email':_['map'](_0x26f627[_0xbb5b('0x11')],'value'),'role':{'$or':[_0xbb5b('0x12'),_0xbb5b('0x13'),_0xbb5b('0x14')]}}})[_0xbb5b('0x15')](function(_0x5b026b){if(_0x5b026b){return _0xbd6621(null,_0x5b026b);}_0xbd6621(_0xbb5b('0x16'));})[_0xbb5b('0x17')](function(_0x2aecf7){_0xbd6621(_0x2aecf7);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f5600d9..90345e9 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 _0x8a70=['passport','../../components/auth/service','get','login','/callback','callback','exports','express'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x8a70,0x137));var _0x08a7=function(_0x2d2335,_0x545186){_0x2d2335=_0x2d2335-0x0;var _0x1559e5=_0x8a70[_0x2d2335];return _0x1559e5;};'use strict';var express=require(_0x08a7('0x0'));var passport=require(_0x08a7('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var setTokenCookie=require(_0x08a7('0x2'))['setTokenCookie'];router[_0x08a7('0x3')]('/',controller[_0x08a7('0x4')]);router[_0x08a7('0x3')](_0x08a7('0x5'),controller[_0x08a7('0x6')],setTokenCookie);module[_0x08a7('0x7')]=router; \ No newline at end of file +var _0xad66=['/callback','callback','express','Router','../../components/auth/service','setTokenCookie','get','login'];(function(_0x2a8b5c,_0x429c22){var _0x3bbefe=function(_0xb97fd2){while(--_0xb97fd2){_0x2a8b5c['push'](_0x2a8b5c['shift']());}};_0x3bbefe(++_0x429c22);}(_0xad66,0x1da));var _0x6ad6=function(_0x1199f4,_0x578315){_0x1199f4=_0x1199f4-0x0;var _0x9c268a=_0xad66[_0x1199f4];return _0x9c268a;};'use strict';var express=require(_0x6ad6('0x0'));var passport=require('passport');var router=express[_0x6ad6('0x1')]();var controller=require('./authGoogle.controller');var setTokenCookie=require(_0x6ad6('0x2'))[_0x6ad6('0x3')];router[_0x6ad6('0x4')]('/',controller[_0x6ad6('0x5')]);router[_0x6ad6('0x4')](_0x6ad6('0x6'),controller[_0x6ad6('0x7')],setTokenCookie);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 732d59d..b5148ad 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 _0xe84e=['role','agent','User','count','../../config/license/util','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','use','passport','passport-local','Strategy','bluebird','jayson/promise','../../config/logger','api','randomstring','../../mysqldb','../../components/auth/service','signToken','http'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xe84e,0x124));var _0xee84=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0xe84e[_0xee5d2a];return _0x346948;};'use strict';var util=require('util');var passport=require(_0xee84('0x0'));var LocalStrategy=require(_0xee84('0x1'))[_0xee84('0x2')];var BPromise=require(_0xee84('0x3'));var jayson=require(_0xee84('0x4'));var _=require('lodash');var logger=require(_0xee84('0x5'))(_0xee84('0x6'));var rs=require(_0xee84('0x7'));var db=require(_0xee84('0x8'))['db'];var signToken=require(_0xee84('0x9'))[_0xee84('0xa')];var client=jayson['client'][_0xee84('0xb')]({'port':0x232b});var getLicense=function(_0x57b9ce){return new BPromise(function(_0x1fc49b,_0x2306f3){var _0x3f63d5=0x0;_0x57b9ce[_0xee84('0xc')]!==_0xee84('0xd')&&_0x1fc49b(_0x57b9ce);return db[_0xee84('0xe')][_0xee84('0xf')]({'where':{'role':_0xee84('0xd'),'online':!![],'id':{'$ne':_0x57b9ce['id']}}})['then'](function(_0x9b3836){_0x3f63d5=_0x9b3836;return require(_0xee84('0x10'))[_0xee84('0x11')]();})[_0xee84('0x12')](function(_0x485f51){if(_0x485f51&&_0x485f51[_0xee84('0x13')]&&_0x3f63d5>=_0x485f51['agents']){return _0x2306f3({'message':_0xee84('0x14')});}return _0x1fc49b(_0x57b9ce);})[_0xee84('0x15')](function(_0x281d70){return _0x2306f3(_0x281d70);});});};function localAuthenticate(_0x4cab5c,_0xf6c1b3,_0x110954,_0x4f1578){_0x4cab5c[_0xee84('0x16')]({'where':{'name':_0xf6c1b3,'role':{'$or':['admin',_0xee84('0x17'),_0xee84('0xd')]}}})[_0xee84('0x12')](function(_0x29260e){if(!_0x29260e||_0x29260e&&_0x29260e[_0xee84('0x18')]!==_0xf6c1b3){return _0x4f1578(null,![],{'message':_0xee84('0x19')});}return getLicense(_0x29260e);})['then'](function(_0x2b942e){_0x2b942e[_0xee84('0x1a')](_0x110954,function(_0x15986d,_0x201ed7){if(_0x15986d){return _0x4f1578(_0x15986d);}if(!_0x201ed7){return _0x4f1578(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}else{return _0x4f1578(null,_0x2b942e);}});})[_0xee84('0x15')](function(_0x1226c5){_0x4f1578(_0x1226c5);});}function sendServiceMail(_0x4ecaae){return db[_0xee84('0x1b')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xee84('0x1c')],'include':[{'model':db[_0xee84('0x1d')],'as':'Smtp'}]})[_0xee84('0x12')](function(_0x1f5f8c){if(!_0x1f5f8c){throw new Error(_0xee84('0x1e'));}var _0x461513={'tls':{'rejectUnauthorized':![]}};if(_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x20')]){_0x461513[_0xee84('0x20')]=_0x1f5f8c['Smtp'][_0xee84('0x20')];}else{_0x461513['host']=_0x1f5f8c[_0xee84('0x1f')]['host'];_0x461513[_0xee84('0x21')]=_0x1f5f8c['Smtp']['port'];_0x461513[_0xee84('0x22')]=_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x22')];}if(_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x23')]){_0x461513[_0xee84('0x24')]={'user':_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x17')],'pass':_0x1f5f8c['Smtp']['pass']};}var _0x4ced9b={'account':_0x461513,'message':_[_0xee84('0x25')]({'from':util[_0xee84('0x26')](_0xee84('0x27'),_0x1f5f8c['name'],_0x1f5f8c[_0xee84('0x1c')]||_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x17')])},_0x4ecaae)};return client['request'](_0xee84('0x28'),_0x4ced9b);})['then'](function(_0x135af9){if(_0x135af9[_0xee84('0x29')]){throw new Error(util['format'](_0xee84('0x2a'),_0x135af9['error'][_0xee84('0x2b')]||JSON[_0xee84('0x2c')](_0x135af9['error'])));}return!![];});}function handleError(_0xbc79d7,_0x1b3969,_0x416a95){return _0xbc79d7[_0xee84('0x2d')](_0x1b3969||0x1f4)['send']({'message':_0x416a95?_0x416a95[_0xee84('0x2b')]||_0x416a95:''});}function checkPasswordPattern(_0x274680,_0x3fd652,_0x19bff4){if(_0x19bff4){var _0x4ddec4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ddec4[_0xee84('0x2e')](_0x3fd652)){return _0x274680;}else{throw new Error(_0xee84('0x2f'));}}else{return _0x274680;}}exports[_0xee84('0x30')]=function(_0x417e7a,_0x522318,_0x1d5079){passport[_0xee84('0x1a')]('local',function(_0x15f67d,_0x238ebc,_0x2e7851){var _0x341d35=_0x15f67d||_0x2e7851;if(_0x341d35){return handleError(_0x522318,0x191,_0x341d35);}if(!_0x238ebc){return handleError(_0x522318,0x194,{'message':_0xee84('0x31')});}var _0x4aafb3=signToken(_0x238ebc['id'],_0x238ebc[_0xee84('0xc')]);_0x522318[_0xee84('0x32')]({'id':_0x238ebc['id'],'token':_0x4aafb3,'statusCall':'','isAlreadyLogged':_0x238ebc['online']});})(_0x417e7a,_0x522318,_0x1d5079);};exports[_0xee84('0x33')]=function(_0x2f58ad,_0x58b52c,_0x30e6e4){if(!_0x2f58ad['body'][_0xee84('0x1c')]){return handleError(_0x58b52c,0x1f4,{'message':_0xee84('0x34')});}var _0x43f166=rs['generate']();_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')]=_0x2f58ad['body'][_0xee84('0x1c')][_0xee84('0x36')]()[_0xee84('0x37')]();return db[_0xee84('0xe')][_0xee84('0x16')]({'where':{'email':_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')]}})[_0xee84('0x12')](function(_0x1885ce){if(!_0x1885ce){throw new Error('This\x20email\x20is\x20not\x20registered.');}_0x1885ce[_0xee84('0x38')]=_0x43f166;_0x1885ce[_0xee84('0x39')]=Date[_0xee84('0x3a')]()+0x36ee80;return _0x1885ce[_0xee84('0x3b')]();})[_0xee84('0x12')](function(){return sendServiceMail({'to':_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xee84('0x3c')+_0xee84('0x3d')+_0xee84('0x3e')+_0x2f58ad[_0xee84('0x3f')][_0xee84('0x40')]+_0xee84('0x41')+_0x43f166+'\x0a\x0a'+_0xee84('0x42')});})['then'](function(){_0x58b52c['status'](0xc8)[_0xee84('0x43')]({'message':_0xee84('0x44')});})[_0xee84('0x15')](function(_0xd20e3b){return handleError(_0x58b52c,0x1f4,_0xd20e3b);});};exports[_0xee84('0x45')]=function(_0xacd49d,_0x51f424,_0x4701da){var _0x41bf4d;return db[_0xee84('0xe')][_0xee84('0x16')]({'where':{'resetPasswordToken':_0xacd49d[_0xee84('0x46')][_0xee84('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0xa5de4f){_0x41bf4d=_0xa5de4f;if(!_0x41bf4d){throw new Error(_0xee84('0x48'));}return db['Setting']['findOne']({'attributes':['id',_0xee84('0x49')]});})[_0xee84('0x12')](function(_0x921118){return checkPasswordPattern(_0x921118,_0xacd49d[_0xee84('0x35')]['password'],_0x921118['securePassword']);})[_0xee84('0x12')](function(){_0x41bf4d['password']=_0xacd49d[_0xee84('0x35')][_0xee84('0x4a')];_0x41bf4d[_0xee84('0x38')]=null;_0x41bf4d[_0xee84('0x39')]=null;return _0x41bf4d[_0xee84('0x3b')]();})[_0xee84('0x12')](function(){_0x51f424[_0xee84('0x2d')](0xc8)[_0xee84('0x43')]({'message':'Password\x20reset!'});})[_0xee84('0x15')](function(_0x490963){return handleError(_0x51f424,0x1f4,_0x490963);});};passport[_0xee84('0x4b')](new LocalStrategy({'usernameField':_0xee84('0x18'),'passwordField':_0xee84('0x4a')},function(_0x3061fc,_0x31dd9a,_0x4984f2){return localAuthenticate(db['User'],_0x3061fc,_0x31dd9a,_0x4984f2);})); \ No newline at end of file +var _0x8716=['status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','password','securePassword','resetPasswordToken','util','passport','passport-local','Strategy','bluebird','jayson/promise','lodash','../../config/logger','randomstring','../../components/auth/service','client','agent','User','then','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x3d05f1,_0x10fab4){var _0x38cafd=function(_0x1c1874){while(--_0x1c1874){_0x3d05f1['push'](_0x3d05f1['shift']());}};_0x38cafd(++_0x10fab4);}(_0x8716,0xb3));var _0x6871=function(_0x269928,_0x5a40b2){_0x269928=_0x269928-0x0;var _0x55bbee=_0x8716[_0x269928];return _0x55bbee;};'use strict';var util=require(_0x6871('0x0'));var passport=require(_0x6871('0x1'));var LocalStrategy=require(_0x6871('0x2'))[_0x6871('0x3')];var BPromise=require(_0x6871('0x4'));var jayson=require(_0x6871('0x5'));var _=require(_0x6871('0x6'));var logger=require(_0x6871('0x7'))('api');var rs=require(_0x6871('0x8'));var db=require('../../mysqldb')['db'];var signToken=require(_0x6871('0x9'))['signToken'];var client=jayson[_0x6871('0xa')]['http']({'port':0x232b});var getLicense=function(_0x188a55){return new BPromise(function(_0x5055dc,_0x5d789e){var _0x5d5851=0x0;_0x188a55['role']!==_0x6871('0xb')&&_0x5055dc(_0x188a55);return db[_0x6871('0xc')]['count']({'where':{'role':_0x6871('0xb'),'online':!![],'id':{'$ne':_0x188a55['id']}}})[_0x6871('0xd')](function(_0x2fb88b){_0x5d5851=_0x2fb88b;return require(_0x6871('0xe'))['getLicense']();})[_0x6871('0xd')](function(_0x227764){if(_0x227764&&_0x227764[_0x6871('0xf')]&&_0x5d5851>=_0x227764[_0x6871('0xf')]){return _0x5d789e({'message':_0x6871('0x10')});}return _0x5055dc(_0x188a55);})[_0x6871('0x11')](function(_0x3b0f4d){return _0x5d789e(_0x3b0f4d);});});};function localAuthenticate(_0x1d5553,_0x297cd4,_0x54d0f7,_0x53ce9e){_0x1d5553[_0x6871('0x12')]({'where':{'name':_0x297cd4,'role':{'$or':[_0x6871('0x13'),_0x6871('0x14'),'agent']}}})[_0x6871('0xd')](function(_0x2651ca){if(!_0x2651ca||_0x2651ca&&_0x2651ca[_0x6871('0x15')]!==_0x297cd4){return _0x53ce9e(null,![],{'message':_0x6871('0x16')});}return getLicense(_0x2651ca);})['then'](function(_0x5c1635){_0x5c1635[_0x6871('0x17')](_0x54d0f7,function(_0x1fb0d0,_0x4df34c){if(_0x1fb0d0){return _0x53ce9e(_0x1fb0d0);}if(!_0x4df34c){return _0x53ce9e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}else{return _0x53ce9e(null,_0x5c1635);}});})[_0x6871('0x11')](function(_0x3eae26){_0x53ce9e(_0x3eae26);});}function sendServiceMail(_0x32a532){return db[_0x6871('0x18')][_0x6871('0x12')]({'where':{'service':!![]},'attributes':['id',_0x6871('0x15'),_0x6871('0x19')],'include':[{'model':db[_0x6871('0x1a')],'as':_0x6871('0x1b')}]})[_0x6871('0xd')](function(_0x384995){if(!_0x384995){throw new Error(_0x6871('0x1c'));}var _0x17b0d6={'tls':{'rejectUnauthorized':![]}};if(_0x384995[_0x6871('0x1b')]['service']){_0x17b0d6[_0x6871('0x1d')]=_0x384995[_0x6871('0x1b')][_0x6871('0x1d')];}else{_0x17b0d6[_0x6871('0x1e')]=_0x384995[_0x6871('0x1b')][_0x6871('0x1e')];_0x17b0d6['port']=_0x384995[_0x6871('0x1b')][_0x6871('0x1f')];_0x17b0d6[_0x6871('0x20')]=_0x384995[_0x6871('0x1b')][_0x6871('0x20')];}if(_0x384995[_0x6871('0x1b')][_0x6871('0x21')]){_0x17b0d6[_0x6871('0x22')]={'user':_0x384995[_0x6871('0x1b')]['user'],'pass':_0x384995[_0x6871('0x1b')][_0x6871('0x23')]};}var _0x3a88f5={'account':_0x17b0d6,'message':_[_0x6871('0x24')]({'from':util[_0x6871('0x25')]('\x22%s\x22\x20<%s>',_0x384995[_0x6871('0x15')],_0x384995[_0x6871('0x19')]||_0x384995[_0x6871('0x1b')][_0x6871('0x14')])},_0x32a532)};return client[_0x6871('0x26')](_0x6871('0x27'),_0x3a88f5);})[_0x6871('0xd')](function(_0x3ab8e0){if(_0x3ab8e0[_0x6871('0x28')]){throw new Error(util['format'](_0x6871('0x29'),_0x3ab8e0[_0x6871('0x28')][_0x6871('0x2a')]||JSON['stringify'](_0x3ab8e0[_0x6871('0x28')])));}return!![];});}function handleError(_0x2f8ca6,_0x174020,_0x286166){return _0x2f8ca6[_0x6871('0x2b')](_0x174020||0x1f4)['send']({'message':_0x286166?_0x286166['message']||_0x286166:''});}function checkPasswordPattern(_0x5ba0dd,_0x5bfc4a,_0x351619){if(_0x351619){var _0x4feb3d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4feb3d[_0x6871('0x2c')](_0x5bfc4a)){return _0x5ba0dd;}else{throw new Error(_0x6871('0x2d'));}}else{return _0x5ba0dd;}}exports['login']=function(_0x1f065b,_0x81a232,_0x5f5ae5){passport[_0x6871('0x17')](_0x6871('0x2e'),function(_0x203d65,_0x3fc52a,_0xfe358a){var _0xc2dd64=_0x203d65||_0xfe358a;if(_0xc2dd64){return handleError(_0x81a232,0x191,_0xc2dd64);}if(!_0x3fc52a){return handleError(_0x81a232,0x194,{'message':_0x6871('0x2f')});}var _0x221401=signToken(_0x3fc52a['id'],_0x3fc52a[_0x6871('0x30')]);_0x81a232[_0x6871('0x31')]({'id':_0x3fc52a['id'],'token':_0x221401,'statusCall':'','isAlreadyLogged':_0x3fc52a[_0x6871('0x32')]});})(_0x1f065b,_0x81a232,_0x5f5ae5);};exports['forgot']=function(_0x124928,_0x53c779,_0x4cd3c0){if(!_0x124928[_0x6871('0x33')]['email']){return handleError(_0x53c779,0x1f4,{'message':_0x6871('0x34')});}var _0x379951=rs[_0x6871('0x35')]();_0x124928[_0x6871('0x33')]['email']=_0x124928['body'][_0x6871('0x19')][_0x6871('0x36')]()[_0x6871('0x37')]();return db[_0x6871('0xc')][_0x6871('0x12')]({'where':{'email':_0x124928[_0x6871('0x33')]['email']}})['then'](function(_0x10003f){if(!_0x10003f){throw new Error(_0x6871('0x38'));}_0x10003f['resetPasswordToken']=_0x379951;_0x10003f[_0x6871('0x39')]=Date[_0x6871('0x3a')]()+0x36ee80;return _0x10003f['save']();})[_0x6871('0xd')](function(){return sendServiceMail({'to':_0x124928[_0x6871('0x33')][_0x6871('0x19')],'subject':_0x6871('0x3b'),'text':_0x6871('0x3c')+_0x6871('0x3d')+_0x6871('0x3e')+_0x124928['headers'][_0x6871('0x1e')]+_0x6871('0x3f')+_0x379951+'\x0a\x0a'+_0x6871('0x40')});})[_0x6871('0xd')](function(){_0x53c779['status'](0xc8)[_0x6871('0x41')]({'message':'Reset\x20Email\x20sent!'});})[_0x6871('0x11')](function(_0xd9b57){return handleError(_0x53c779,0x1f4,_0xd9b57);});};exports[_0x6871('0x42')]=function(_0x243ecc,_0xda01e1,_0x1c46a6){var _0xd11c90;return db[_0x6871('0xc')]['find']({'where':{'resetPasswordToken':_0x243ecc[_0x6871('0x43')][_0x6871('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x6871('0xd')](function(_0xf725b7){_0xd11c90=_0xf725b7;if(!_0xd11c90){throw new Error(_0x6871('0x45'));}return db['Setting'][_0x6871('0x46')]({'attributes':['id','securePassword']});})[_0x6871('0xd')](function(_0x13d6cb){return checkPasswordPattern(_0x13d6cb,_0x243ecc[_0x6871('0x33')][_0x6871('0x47')],_0x13d6cb[_0x6871('0x48')]);})[_0x6871('0xd')](function(){_0xd11c90[_0x6871('0x47')]=_0x243ecc[_0x6871('0x33')][_0x6871('0x47')];_0xd11c90[_0x6871('0x49')]=null;_0xd11c90[_0x6871('0x39')]=null;return _0xd11c90['save']();})[_0x6871('0xd')](function(){_0xda01e1[_0x6871('0x2b')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x6871('0x11')](function(_0x430269){return handleError(_0xda01e1,0x1f4,_0x430269);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x6871('0x47')},function(_0x171cf3,_0xf43ad,_0x1ed01d){return localAuthenticate(db[_0x6871('0xc')],_0x171cf3,_0xf43ad,_0x1ed01d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 833ccfd..987025a 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 _0x7ae0=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','exports'];(function(_0x1a5e7b,_0x3a3c12){var _0x1a0b61=function(_0x1b61ae){while(--_0x1b61ae){_0x1a5e7b['push'](_0x1a5e7b['shift']());}};_0x1a0b61(++_0x3a3c12);}(_0x7ae0,0x1a8));var _0x07ae=function(_0x169a60,_0x2f1533){_0x169a60=_0x169a60-0x0;var _0x5c987c=_0x7ae0[_0x169a60];return _0x5c987c;};'use strict';var express=require(_0x07ae('0x0'));var router=express[_0x07ae('0x1')]();var controller=require(_0x07ae('0x2'));router[_0x07ae('0x3')]('/',controller['login']);router[_0x07ae('0x3')](_0x07ae('0x4'),controller[_0x07ae('0x5')]);router[_0x07ae('0x3')](_0x07ae('0x6'),controller['reset']);module[_0x07ae('0x7')]=router; \ No newline at end of file +var _0x0824=['./authLocal.controller','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0824,0xcd));var _0x4082=function(_0x92c4ab,_0x239dcc){_0x92c4ab=_0x92c4ab-0x0;var _0x5bf271=_0x0824[_0x92c4ab];return _0x5bf271;};'use strict';var express=require(_0x4082('0x0'));var router=express[_0x4082('0x1')]();var controller=require(_0x4082('0x2'));router['post']('/',controller[_0x4082('0x3')]);router['post'](_0x4082('0x4'),controller[_0x4082('0x5')]);router['post'](_0x4082('0x6'),controller[_0x4082('0x7')]);module[_0x4082('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 445d42b..d40bac5 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 _0xb2f3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xe1070f,_0x35c2c3){var _0x242e1d=function(_0x276472){while(--_0x276472){_0xe1070f['push'](_0xe1070f['shift']());}};_0x242e1d(++_0x35c2c3);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xb2f3[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x3b2f('0x0'));module[_0x3b2f('0x1')]={'name':{'type':Sequelize[_0x3b2f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3b2f('0x2')]},'description':{'type':Sequelize[_0x3b2f('0x2')]},'status':{'type':Sequelize[_0x3b2f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3b2f('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x110f=['sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x110f,0x1e6));var _0xf110=function(_0x184284,_0x3bc5a8){_0x184284=_0x184284-0x0;var _0x1370a0=_0x110f[_0x184284];return _0x1370a0;};'use strict';var Sequelize=require(_0xf110('0x0'));module[_0xf110('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf110('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 6d48e49..08bcf5c 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 _0xbad0=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','key','field','options','Automation','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','Action','addActions','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x1a89a5,_0x1f895f){var _0x1f351f=function(_0x5c4218){while(--_0x5c4218){_0x1a89a5['push'](_0x1a89a5['shift']());}};_0x1f351f(++_0x1f895f);}(_0xbad0,0x1de));var _0x0bad=function(_0x15a982,_0x2881d7){_0x15a982=_0x15a982-0x0;var _0x475d5a=_0xbad0[_0x15a982];return _0x475d5a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0bad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bad('0x1'));var jsonpatch=require(_0x0bad('0x2'));var rp=require(_0x0bad('0x3'));var moment=require(_0x0bad('0x4'));var BPromise=require(_0x0bad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0bad('0x6'));var sox=require(_0x0bad('0x7'));var csv=require(_0x0bad('0x8'));var ejs=require(_0x0bad('0x9'));var fs=require('fs');var _=require(_0x0bad('0xa'));var squel=require(_0x0bad('0xb'));var crypto=require(_0x0bad('0xc'));var jsforce=require(_0x0bad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bad('0x8'));var querystring=require(_0x0bad('0xe'));var Papa=require(_0x0bad('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bad('0x10'));var hardwareService=require(_0x0bad('0x11'));var logger=require('../../config/logger')(_0x0bad('0x12'));var utils=require(_0x0bad('0x13'));var config=require(_0x0bad('0x14'));var db=require(_0x0bad('0x15'))['db'];function respondWithStatusCode(_0x288f3b,_0x4f85f2){_0x4f85f2=_0x4f85f2||0xcc;return function(_0x11c0fb){if(_0x11c0fb){return _0x288f3b[_0x0bad('0x16')](_0x4f85f2);}return _0x288f3b[_0x0bad('0x17')](_0x4f85f2)[_0x0bad('0x18')]();};}function respondWithResult(_0x2918af,_0x590c8b){_0x590c8b=_0x590c8b||0xc8;return function(_0x14ce94){if(_0x14ce94){return _0x2918af[_0x0bad('0x17')](_0x590c8b)[_0x0bad('0x19')](_0x14ce94);}};}function respondWithFilteredResult(_0x3ad1cc,_0xa428e0){return function(_0x3bcba3){if(_0x3bcba3){var _0x57a5e9=_0x3bcba3[_0x0bad('0x1a')],_0x3a54fd=_0xa428e0['offset'],_0x4348c9=_0xa428e0[_0x0bad('0x1b')]+_0xa428e0[_0x0bad('0x1c')],_0x144ba5;if(_0x4348c9>=_0x57a5e9){_0x4348c9=_0x57a5e9;_0x144ba5=0xc8;}else{_0x144ba5=0xce;}_0x3ad1cc['status'](_0x144ba5);return _0x3ad1cc[_0x0bad('0x1d')](_0x0bad('0x1e'),_0x3a54fd+'-'+_0x4348c9+'/'+_0x57a5e9)['json'](_0x3bcba3);}return null;};}function patchUpdates(_0x5ccd99){return function(_0x4834e5){try{jsonpatch[_0x0bad('0x1f')](_0x4834e5,_0x5ccd99,!![]);}catch(_0x48b4c1){return BPromise[_0x0bad('0x20')](_0x48b4c1);}return _0x4834e5['save']();};}function saveUpdates(_0x33bc26,_0x3f2b1f){return function(_0x16278d){if(_0x16278d){return _0x16278d['update'](_0x33bc26)[_0x0bad('0x21')](function(_0x13d9d6){return _0x13d9d6;});}return null;};}function removeEntity(_0x177b9e,_0x107bcf){return function(_0x405d0a){if(_0x405d0a){return _0x405d0a[_0x0bad('0x22')]()['then'](function(){_0x177b9e[_0x0bad('0x17')](0xcc)[_0x0bad('0x18')]();});}};}function handleEntityNotFound(_0x1a9e94,_0x5b5d9c){return function(_0x3a68fc){if(!_0x3a68fc){_0x1a9e94['sendStatus'](0x194);}return _0x3a68fc;};}function handleError(_0x444579,_0x8e1cfd){_0x8e1cfd=_0x8e1cfd||0x1f4;return function(_0x5f49b5){logger[_0x0bad('0x23')](_0x5f49b5[_0x0bad('0x24')]);if(_0x5f49b5['name']){delete _0x5f49b5[_0x0bad('0x25')];}_0x444579[_0x0bad('0x17')](_0x8e1cfd)[_0x0bad('0x26')](_0x5f49b5);};}exports[_0x0bad('0x27')]=function(_0x3bbc78,_0x3e8215){var _0x4eb944={},_0x198b94={},_0x3ea71e={'count':0x0,'rows':[]};var _0x530651=db['Automation'][_0x0bad('0x28')];_0x198b94[_0x0bad('0x29')]=_['keys'](_0x530651);_0x198b94[_0x0bad('0x2a')]=_[_0x0bad('0x2b')](_0x3bbc78[_0x0bad('0x2a')]);_0x198b94['filters']=_[_0x0bad('0x2c')](_0x198b94['model'],_0x198b94[_0x0bad('0x2a')]);_0x4eb944[_0x0bad('0x2d')]=_['intersection'](_0x198b94[_0x0bad('0x29')],qs['fields'](_0x3bbc78['query'][_0x0bad('0x2e')]));_0x4eb944[_0x0bad('0x2d')]=_0x4eb944['attributes'][_0x0bad('0x2f')]?_0x4eb944[_0x0bad('0x2d')]:_0x198b94[_0x0bad('0x29')];if(!_0x3bbc78[_0x0bad('0x2a')]['hasOwnProperty'](_0x0bad('0x30'))){_0x4eb944['limit']=qs[_0x0bad('0x1c')](_0x3bbc78['query'][_0x0bad('0x1c')]);_0x4eb944[_0x0bad('0x1b')]=qs['offset'](_0x3bbc78[_0x0bad('0x2a')][_0x0bad('0x1b')]);}_0x4eb944[_0x0bad('0x31')]=qs[_0x0bad('0x32')](_0x3bbc78['query']['sort']);_0x4eb944[_0x0bad('0x33')]=qs[_0x0bad('0x34')](_[_0x0bad('0x35')](_0x3bbc78[_0x0bad('0x2a')],_0x198b94[_0x0bad('0x34')]));if(_0x3bbc78['query'][_0x0bad('0x36')]){_0x4eb944[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x4eb944['where'],{'$or':_[_0x0bad('0x38')](_0x530651,function(_0x331722){if(_0x331722['type'][_0x0bad('0x39')]!=='VIRTUAL'){var _0xace013={};_0xace013[_0x331722[_0x0bad('0x3a')]]={'$like':'%'+_0x3bbc78[_0x0bad('0x2a')][_0x0bad('0x36')]+'%'};return _0xace013;}})});}_0x4eb944=_[_0x0bad('0x37')]({},_0x4eb944,_0x3bbc78[_0x0bad('0x3b')]);var _0x131cb1={'where':_0x4eb944['where']};return db[_0x0bad('0x3c')]['count'](_0x131cb1)[_0x0bad('0x21')](function(_0x51203e){_0x3ea71e[_0x0bad('0x1a')]=_0x51203e;if(_0x3bbc78['query'][_0x0bad('0x3d')]){_0x4eb944[_0x0bad('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x0bad('0x3f')](_0x4eb944);})[_0x0bad('0x21')](function(_0x21d6f6){_0x3ea71e[_0x0bad('0x40')]=_0x21d6f6;return _0x3ea71e;})[_0x0bad('0x21')](respondWithFilteredResult(_0x3e8215,_0x4eb944))[_0x0bad('0x41')](handleError(_0x3e8215,null));};exports[_0x0bad('0x42')]=function(_0x2c1d6c,_0x251e86){var _0x58be50={'raw':![],'where':{'id':_0x2c1d6c[_0x0bad('0x43')]['id']}},_0x52a11a={};_0x52a11a['model']=_[_0x0bad('0x2b')](db[_0x0bad('0x3c')]['rawAttributes']);_0x52a11a[_0x0bad('0x2a')]=_['keys'](_0x2c1d6c[_0x0bad('0x2a')]);_0x52a11a[_0x0bad('0x34')]=_[_0x0bad('0x2c')](_0x52a11a[_0x0bad('0x29')],_0x52a11a['query']);_0x58be50[_0x0bad('0x2d')]=_[_0x0bad('0x2c')](_0x52a11a[_0x0bad('0x29')],qs[_0x0bad('0x2e')](_0x2c1d6c['query']['fields']));_0x58be50[_0x0bad('0x2d')]=_0x58be50[_0x0bad('0x2d')][_0x0bad('0x2f')]?_0x58be50['attributes']:_0x52a11a[_0x0bad('0x29')];if(_0x2c1d6c['query'][_0x0bad('0x3d')]){_0x58be50[_0x0bad('0x3e')]=[{'all':!![]}];}_0x58be50=_[_0x0bad('0x37')]({},_0x58be50,_0x2c1d6c[_0x0bad('0x3b')]);return db[_0x0bad('0x3c')][_0x0bad('0x44')](_0x58be50)[_0x0bad('0x21')](handleEntityNotFound(_0x251e86,null))[_0x0bad('0x21')](respondWithResult(_0x251e86,null))[_0x0bad('0x41')](handleError(_0x251e86,null));};exports[_0x0bad('0x45')]=function(_0x353ce1,_0x165a4f){return db['Automation'][_0x0bad('0x45')](_0x353ce1['body'],{})['then'](respondWithResult(_0x165a4f,0xc9))['catch'](handleError(_0x165a4f,null));};exports[_0x0bad('0x46')]=function(_0x3542b9,_0x1594a7){if(_0x3542b9[_0x0bad('0x47')]['id']){delete _0x3542b9[_0x0bad('0x47')]['id'];}return db[_0x0bad('0x3c')][_0x0bad('0x44')]({'where':{'id':_0x3542b9[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x1594a7,null))['then'](saveUpdates(_0x3542b9[_0x0bad('0x47')],null))['then'](respondWithResult(_0x1594a7,null))[_0x0bad('0x41')](handleError(_0x1594a7,null));};exports[_0x0bad('0x22')]=function(_0x2cfe5b,_0x4e91f5){return db[_0x0bad('0x3c')]['find']({'where':{'id':_0x2cfe5b[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x4e91f5,null))['then'](removeEntity(_0x4e91f5,null))[_0x0bad('0x41')](handleError(_0x4e91f5,null));};exports[_0x0bad('0x48')]=function(_0x162d52,_0xe8eb58,_0x168836){return db[_0x0bad('0x49')][_0x0bad('0x44')]({'where':{'id':_0x162d52[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0xe8eb58,null))['then'](function(_0x11c45f){if(_0x11c45f){return _0x11c45f[_0x0bad('0x48')](_0x162d52[_0x0bad('0x47')]['ids'],_['omit'](_0x162d52[_0x0bad('0x47')],[_0x0bad('0x4a'),'id'])||{});}})[_0x0bad('0x21')](respondWithResult(_0xe8eb58,null))['catch'](handleError(_0xe8eb58,null));};exports[_0x0bad('0x4b')]=function(_0x3c62a8,_0x58fb5c,_0x1c71bd){var _0x58d09f={};var _0x3b7948={};var _0x1205f7;var _0x1450aa;return db[_0x0bad('0x3c')][_0x0bad('0x4c')]({'where':{'id':_0x3c62a8[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x58fb5c,null))[_0x0bad('0x21')](function(_0x23109d){if(_0x23109d){_0x1205f7=_0x23109d;_0x3b7948[_0x0bad('0x29')]=_[_0x0bad('0x2b')](db[_0x0bad('0x49')]['rawAttributes']);_0x3b7948['query']=_[_0x0bad('0x2b')](_0x3c62a8[_0x0bad('0x2a')]);_0x3b7948['filters']=_[_0x0bad('0x2c')](_0x3b7948['model'],_0x3b7948[_0x0bad('0x2a')]);_0x58d09f[_0x0bad('0x2d')]=_[_0x0bad('0x2c')](_0x3b7948['model'],qs[_0x0bad('0x2e')](_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x2e')]));_0x58d09f['attributes']=_0x58d09f['attributes'][_0x0bad('0x2f')]?_0x58d09f[_0x0bad('0x2d')]:_0x3b7948[_0x0bad('0x29')];_0x58d09f['order']=qs[_0x0bad('0x32')](_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x32')]);_0x58d09f[_0x0bad('0x33')]=qs[_0x0bad('0x34')](_[_0x0bad('0x35')](_0x3c62a8[_0x0bad('0x2a')],_0x3b7948[_0x0bad('0x34')]));if(_0x3c62a8[_0x0bad('0x2a')]['filter']){_0x58d09f[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x58d09f[_0x0bad('0x33')],{'$or':_[_0x0bad('0x38')](_0x58d09f[_0x0bad('0x2d')],function(_0x539533){var _0x5b4c81={};_0x5b4c81[_0x539533]={'$like':'%'+_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x36')]+'%'};return _0x5b4c81;})});}_0x58d09f=_['merge']({},_0x58d09f,_0x3c62a8[_0x0bad('0x3b')]);return _0x1205f7[_0x0bad('0x4b')](_0x58d09f);}})[_0x0bad('0x21')](function(_0x25a47f){if(_0x25a47f){_0x1450aa=_0x25a47f[_0x0bad('0x2f')];if(!_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x4d')](_0x0bad('0x30'))){_0x58d09f[_0x0bad('0x1c')]=qs['limit'](_0x3c62a8[_0x0bad('0x2a')]['limit']);_0x58d09f['offset']=qs[_0x0bad('0x1b')](_0x3c62a8['query'][_0x0bad('0x1b')]);}return _0x1205f7['getConditions'](_0x58d09f);}})[_0x0bad('0x21')](function(_0x4cdcad){if(_0x4cdcad){return _0x4cdcad?{'count':_0x1450aa,'rows':_0x4cdcad}:null;}})[_0x0bad('0x21')](respondWithResult(_0x58fb5c,null))[_0x0bad('0x41')](handleError(_0x58fb5c,null));};exports['addActions']=function(_0x4debe7,_0x4285e0,_0xa4362e){return db[_0x0bad('0x4e')]['find']({'where':{'id':_0x4debe7[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x4285e0,null))[_0x0bad('0x21')](function(_0x10a688){if(_0x10a688){return _0x10a688[_0x0bad('0x4f')](_0x4debe7[_0x0bad('0x47')]['ids'],_[_0x0bad('0x50')](_0x4debe7[_0x0bad('0x47')],[_0x0bad('0x4a'),'id'])||{});}})[_0x0bad('0x21')](respondWithResult(_0x4285e0,null))['catch'](handleError(_0x4285e0,null));};exports[_0x0bad('0x51')]=function(_0x2a05b2,_0x2b5d0f,_0x79bb72){var _0x762f5b={};var _0x51847b={};var _0x565265;var _0x5c439c;return db[_0x0bad('0x3c')]['findOne']({'where':{'id':_0x2a05b2['params']['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x2b5d0f,null))[_0x0bad('0x21')](function(_0x3ce277){if(_0x3ce277){_0x565265=_0x3ce277;_0x51847b[_0x0bad('0x29')]=_[_0x0bad('0x2b')](db['Action']['rawAttributes']);_0x51847b[_0x0bad('0x2a')]=_[_0x0bad('0x2b')](_0x2a05b2['query']);_0x51847b['filters']=_[_0x0bad('0x2c')](_0x51847b[_0x0bad('0x29')],_0x51847b[_0x0bad('0x2a')]);_0x762f5b['attributes']=_['intersection'](_0x51847b['model'],qs['fields'](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x2e')]));_0x762f5b[_0x0bad('0x2d')]=_0x762f5b[_0x0bad('0x2d')][_0x0bad('0x2f')]?_0x762f5b[_0x0bad('0x2d')]:_0x51847b['model'];_0x762f5b['order']=qs[_0x0bad('0x32')](_0x2a05b2[_0x0bad('0x2a')]['sort']);_0x762f5b[_0x0bad('0x33')]=qs['filters'](_['pick'](_0x2a05b2[_0x0bad('0x2a')],_0x51847b[_0x0bad('0x34')]));if(_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x36')]){_0x762f5b[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x762f5b[_0x0bad('0x33')],{'$or':_['map'](_0x762f5b[_0x0bad('0x2d')],function(_0x5a8c1b){var _0x402a89={};_0x402a89[_0x5a8c1b]={'$like':'%'+_0x2a05b2[_0x0bad('0x2a')]['filter']+'%'};return _0x402a89;})});}_0x762f5b=_['merge']({},_0x762f5b,_0x2a05b2[_0x0bad('0x3b')]);return _0x565265[_0x0bad('0x51')](_0x762f5b);}})[_0x0bad('0x21')](function(_0xe7b2a1){if(_0xe7b2a1){_0x5c439c=_0xe7b2a1[_0x0bad('0x2f')];if(!_0x2a05b2[_0x0bad('0x2a')]['hasOwnProperty']('nolimit')){_0x762f5b['limit']=qs['limit'](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x1c')]);_0x762f5b[_0x0bad('0x1b')]=qs[_0x0bad('0x1b')](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x1b')]);}return _0x565265[_0x0bad('0x51')](_0x762f5b);}})[_0x0bad('0x21')](function(_0x455a49){if(_0x455a49){return _0x455a49?{'count':_0x5c439c,'rows':_0x455a49}:null;}})['then'](respondWithResult(_0x2b5d0f,null))['catch'](handleError(_0x2b5d0f,null));}; \ No newline at end of file +var _0x614c=['limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','key','field','merge','options','includeAll','rows','catch','params','create','body','update','find','addConditions','Condition','omit','ids','findOne','map','getConditions','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x614c,0xd2));var _0xc614=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x614c[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0xc614('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc614('0x1'));var zipdir=require(_0xc614('0x2'));var jsonpatch=require(_0xc614('0x3'));var rp=require(_0xc614('0x4'));var moment=require('moment');var BPromise=require(_0xc614('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc614('0x6'));var sox=require(_0xc614('0x7'));var csv=require(_0xc614('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc614('0x9'));var squel=require(_0xc614('0xa'));var crypto=require(_0xc614('0xb'));var jsforce=require(_0xc614('0xc'));var deskjs=require(_0xc614('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc614('0xe'));var Papa=require(_0xc614('0xf'));var Redis=require('ioredis');var authService=require(_0xc614('0x10'));var qs=require(_0xc614('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc614('0x12'));var utils=require(_0xc614('0x13'));var config=require('../../config/environment');var db=require(_0xc614('0x14'))['db'];function respondWithStatusCode(_0x5db30b,_0x1a664c){_0x1a664c=_0x1a664c||0xcc;return function(_0x561198){if(_0x561198){return _0x5db30b[_0xc614('0x15')](_0x1a664c);}return _0x5db30b[_0xc614('0x16')](_0x1a664c)[_0xc614('0x17')]();};}function respondWithResult(_0x28a082,_0x13e398){_0x13e398=_0x13e398||0xc8;return function(_0x43af8b){if(_0x43af8b){return _0x28a082[_0xc614('0x16')](_0x13e398)[_0xc614('0x18')](_0x43af8b);}};}function respondWithFilteredResult(_0x4d3436,_0x4e41cf){return function(_0x1152fe){if(_0x1152fe){var _0x448e97=_0x1152fe[_0xc614('0x19')],_0xab9119=_0x4e41cf[_0xc614('0x1a')],_0x4a44a5=_0x4e41cf['offset']+_0x4e41cf[_0xc614('0x1b')],_0x5d4d8c;if(_0x4a44a5>=_0x448e97){_0x4a44a5=_0x448e97;_0x5d4d8c=0xc8;}else{_0x5d4d8c=0xce;}_0x4d3436[_0xc614('0x16')](_0x5d4d8c);return _0x4d3436[_0xc614('0x1c')](_0xc614('0x1d'),_0xab9119+'-'+_0x4a44a5+'/'+_0x448e97)[_0xc614('0x18')](_0x1152fe);}return null;};}function patchUpdates(_0x53b6f0){return function(_0x25b4a1){try{jsonpatch[_0xc614('0x1e')](_0x25b4a1,_0x53b6f0,!![]);}catch(_0x44e50e){return BPromise[_0xc614('0x1f')](_0x44e50e);}return _0x25b4a1[_0xc614('0x20')]();};}function saveUpdates(_0x365f38,_0x1b784a){return function(_0x3fade4){if(_0x3fade4){return _0x3fade4['update'](_0x365f38)['then'](function(_0x516509){return _0x516509;});}return null;};}function removeEntity(_0x4e0b02,_0x46685a){return function(_0xeab5bd){if(_0xeab5bd){return _0xeab5bd[_0xc614('0x21')]()[_0xc614('0x22')](function(){_0x4e0b02[_0xc614('0x16')](0xcc)[_0xc614('0x17')]();});}};}function handleEntityNotFound(_0x5b4644,_0x4a02e3){return function(_0xc46c1f){if(!_0xc46c1f){_0x5b4644['sendStatus'](0x194);}return _0xc46c1f;};}function handleError(_0xfd1ebb,_0x2b1783){_0x2b1783=_0x2b1783||0x1f4;return function(_0x29d57d){logger['error'](_0x29d57d[_0xc614('0x23')]);if(_0x29d57d[_0xc614('0x24')]){delete _0x29d57d[_0xc614('0x24')];}_0xfd1ebb[_0xc614('0x16')](_0x2b1783)[_0xc614('0x25')](_0x29d57d);};}exports[_0xc614('0x26')]=function(_0x5f50d5,_0x5f5b3){var _0x35da6c={},_0x3c2fc5={},_0x1ebab4={'count':0x0,'rows':[]};var _0x5efd0d=db[_0xc614('0x27')][_0xc614('0x28')];_0x3c2fc5[_0xc614('0x29')]=_[_0xc614('0x2a')](_0x5efd0d);_0x3c2fc5[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0x5f50d5['query']);_0x3c2fc5[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x3c2fc5[_0xc614('0x29')],_0x3c2fc5[_0xc614('0x2b')]);_0x35da6c[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x3c2fc5['model'],qs[_0xc614('0x2f')](_0x5f50d5[_0xc614('0x2b')][_0xc614('0x2f')]));_0x35da6c[_0xc614('0x2e')]=_0x35da6c[_0xc614('0x2e')][_0xc614('0x30')]?_0x35da6c[_0xc614('0x2e')]:_0x3c2fc5['model'];if(!_0x5f50d5['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x35da6c['limit']=qs[_0xc614('0x1b')](_0x5f50d5['query'][_0xc614('0x1b')]);_0x35da6c['offset']=qs['offset'](_0x5f50d5[_0xc614('0x2b')]['offset']);}_0x35da6c[_0xc614('0x33')]=qs['sort'](_0x5f50d5[_0xc614('0x2b')][_0xc614('0x34')]);_0x35da6c[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0x5f50d5[_0xc614('0x2b')],_0x3c2fc5[_0xc614('0x2c')]));if(_0x5f50d5[_0xc614('0x2b')][_0xc614('0x37')]){_0x35da6c[_0xc614('0x35')]=_['merge'](_0x35da6c[_0xc614('0x35')],{'$or':_['map'](_0x5efd0d,function(_0x3bf285){if(_0x3bf285[_0xc614('0x38')][_0xc614('0x39')]!=='VIRTUAL'){var _0xbf1f4d={};_0xbf1f4d[_0x3bf285[_0xc614('0x3a')]]={'$like':'%'+_0x5f50d5[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0xbf1f4d;}})});}_0x35da6c=_[_0xc614('0x3b')]({},_0x35da6c,_0x5f50d5[_0xc614('0x3c')]);var _0x1ea907={'where':_0x35da6c['where']};return db[_0xc614('0x27')][_0xc614('0x19')](_0x1ea907)[_0xc614('0x22')](function(_0x24c80c){_0x1ebab4[_0xc614('0x19')]=_0x24c80c;if(_0x5f50d5[_0xc614('0x2b')][_0xc614('0x3d')]){_0x35da6c['include']=[{'all':!![]}];}return db[_0xc614('0x27')]['findAll'](_0x35da6c);})[_0xc614('0x22')](function(_0x28ac1c){_0x1ebab4[_0xc614('0x3e')]=_0x28ac1c;return _0x1ebab4;})[_0xc614('0x22')](respondWithFilteredResult(_0x5f5b3,_0x35da6c))[_0xc614('0x3f')](handleError(_0x5f5b3,null));};exports['show']=function(_0x48585c,_0x22c92f){var _0x286b11={'raw':![],'where':{'id':_0x48585c[_0xc614('0x40')]['id']}},_0x16971e={};_0x16971e[_0xc614('0x29')]=_['keys'](db['Automation'][_0xc614('0x28')]);_0x16971e['query']=_[_0xc614('0x2a')](_0x48585c[_0xc614('0x2b')]);_0x16971e[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x16971e['model'],_0x16971e['query']);_0x286b11[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x16971e[_0xc614('0x29')],qs[_0xc614('0x2f')](_0x48585c[_0xc614('0x2b')][_0xc614('0x2f')]));_0x286b11[_0xc614('0x2e')]=_0x286b11[_0xc614('0x2e')][_0xc614('0x30')]?_0x286b11['attributes']:_0x16971e[_0xc614('0x29')];if(_0x48585c[_0xc614('0x2b')]['includeAll']){_0x286b11['include']=[{'all':!![]}];}_0x286b11=_['merge']({},_0x286b11,_0x48585c[_0xc614('0x3c')]);return db[_0xc614('0x27')]['find'](_0x286b11)[_0xc614('0x22')](handleEntityNotFound(_0x22c92f,null))['then'](respondWithResult(_0x22c92f,null))[_0xc614('0x3f')](handleError(_0x22c92f,null));};exports[_0xc614('0x41')]=function(_0x3aa6ff,_0x278663){return db[_0xc614('0x27')]['create'](_0x3aa6ff[_0xc614('0x42')],{})[_0xc614('0x22')](respondWithResult(_0x278663,0xc9))[_0xc614('0x3f')](handleError(_0x278663,null));};exports[_0xc614('0x43')]=function(_0x4efe32,_0x216b17){if(_0x4efe32[_0xc614('0x42')]['id']){delete _0x4efe32['body']['id'];}return db[_0xc614('0x27')][_0xc614('0x44')]({'where':{'id':_0x4efe32[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0x216b17,null))[_0xc614('0x22')](saveUpdates(_0x4efe32[_0xc614('0x42')],null))['then'](respondWithResult(_0x216b17,null))[_0xc614('0x3f')](handleError(_0x216b17,null));};exports[_0xc614('0x21')]=function(_0x160f8a,_0xd8c8c7){return db[_0xc614('0x27')][_0xc614('0x44')]({'where':{'id':_0x160f8a[_0xc614('0x40')]['id']}})['then'](handleEntityNotFound(_0xd8c8c7,null))['then'](removeEntity(_0xd8c8c7,null))[_0xc614('0x3f')](handleError(_0xd8c8c7,null));};exports[_0xc614('0x45')]=function(_0xf8493e,_0x3fb20e,_0xb09fc0){return db[_0xc614('0x46')][_0xc614('0x44')]({'where':{'id':_0xf8493e['params']['id']}})['then'](handleEntityNotFound(_0x3fb20e,null))['then'](function(_0x452167){if(_0x452167){return _0x452167[_0xc614('0x45')](_0xf8493e['body']['ids'],_[_0xc614('0x47')](_0xf8493e[_0xc614('0x42')],[_0xc614('0x48'),'id'])||{});}})[_0xc614('0x22')](respondWithResult(_0x3fb20e,null))[_0xc614('0x3f')](handleError(_0x3fb20e,null));};exports['getConditions']=function(_0x297fde,_0xba5dba,_0x5d1c62){var _0x1a4f52={};var _0x47e50c={};var _0x412a6d;var _0x1f25e8;return db[_0xc614('0x27')][_0xc614('0x49')]({'where':{'id':_0x297fde[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0xba5dba,null))[_0xc614('0x22')](function(_0x1a083c){if(_0x1a083c){_0x412a6d=_0x1a083c;_0x47e50c[_0xc614('0x29')]=_['keys'](db[_0xc614('0x46')][_0xc614('0x28')]);_0x47e50c[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0x297fde[_0xc614('0x2b')]);_0x47e50c['filters']=_[_0xc614('0x2d')](_0x47e50c[_0xc614('0x29')],_0x47e50c['query']);_0x1a4f52['attributes']=_[_0xc614('0x2d')](_0x47e50c[_0xc614('0x29')],qs[_0xc614('0x2f')](_0x297fde[_0xc614('0x2b')][_0xc614('0x2f')]));_0x1a4f52[_0xc614('0x2e')]=_0x1a4f52[_0xc614('0x2e')][_0xc614('0x30')]?_0x1a4f52[_0xc614('0x2e')]:_0x47e50c[_0xc614('0x29')];_0x1a4f52[_0xc614('0x33')]=qs[_0xc614('0x34')](_0x297fde['query']['sort']);_0x1a4f52[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0x297fde[_0xc614('0x2b')],_0x47e50c[_0xc614('0x2c')]));if(_0x297fde[_0xc614('0x2b')][_0xc614('0x37')]){_0x1a4f52['where']=_['merge'](_0x1a4f52[_0xc614('0x35')],{'$or':_[_0xc614('0x4a')](_0x1a4f52[_0xc614('0x2e')],function(_0x2651ea){var _0x379b2d={};_0x379b2d[_0x2651ea]={'$like':'%'+_0x297fde[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0x379b2d;})});}_0x1a4f52=_[_0xc614('0x3b')]({},_0x1a4f52,_0x297fde['options']);return _0x412a6d[_0xc614('0x4b')](_0x1a4f52);}})[_0xc614('0x22')](function(_0x4a781e){if(_0x4a781e){_0x1f25e8=_0x4a781e[_0xc614('0x30')];if(!_0x297fde['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x1a4f52[_0xc614('0x1b')]=qs['limit'](_0x297fde[_0xc614('0x2b')][_0xc614('0x1b')]);_0x1a4f52[_0xc614('0x1a')]=qs[_0xc614('0x1a')](_0x297fde[_0xc614('0x2b')][_0xc614('0x1a')]);}return _0x412a6d[_0xc614('0x4b')](_0x1a4f52);}})[_0xc614('0x22')](function(_0x49c82a){if(_0x49c82a){return _0x49c82a?{'count':_0x1f25e8,'rows':_0x49c82a}:null;}})[_0xc614('0x22')](respondWithResult(_0xba5dba,null))[_0xc614('0x3f')](handleError(_0xba5dba,null));};exports[_0xc614('0x4c')]=function(_0x271efe,_0x5cd74c,_0x4fb04d){return db['Action'][_0xc614('0x44')]({'where':{'id':_0x271efe[_0xc614('0x40')]['id']}})['then'](handleEntityNotFound(_0x5cd74c,null))[_0xc614('0x22')](function(_0x5ed6fe){if(_0x5ed6fe){return _0x5ed6fe[_0xc614('0x4c')](_0x271efe[_0xc614('0x42')][_0xc614('0x48')],_[_0xc614('0x47')](_0x271efe['body'],[_0xc614('0x48'),'id'])||{});}})[_0xc614('0x22')](respondWithResult(_0x5cd74c,null))[_0xc614('0x3f')](handleError(_0x5cd74c,null));};exports['getActions']=function(_0xe152ae,_0x36e853,_0x17ba13){var _0x329623={};var _0x42d868={};var _0x3da8db;var _0x171fec;return db[_0xc614('0x27')][_0xc614('0x49')]({'where':{'id':_0xe152ae[_0xc614('0x40')]['id']}})[_0xc614('0x22')](handleEntityNotFound(_0x36e853,null))[_0xc614('0x22')](function(_0x4bfd57){if(_0x4bfd57){_0x3da8db=_0x4bfd57;_0x42d868['model']=_['keys'](db[_0xc614('0x4d')][_0xc614('0x28')]);_0x42d868[_0xc614('0x2b')]=_[_0xc614('0x2a')](_0xe152ae[_0xc614('0x2b')]);_0x42d868[_0xc614('0x2c')]=_[_0xc614('0x2d')](_0x42d868[_0xc614('0x29')],_0x42d868['query']);_0x329623[_0xc614('0x2e')]=_[_0xc614('0x2d')](_0x42d868[_0xc614('0x29')],qs[_0xc614('0x2f')](_0xe152ae['query'][_0xc614('0x2f')]));_0x329623[_0xc614('0x2e')]=_0x329623[_0xc614('0x2e')][_0xc614('0x30')]?_0x329623['attributes']:_0x42d868[_0xc614('0x29')];_0x329623[_0xc614('0x33')]=qs['sort'](_0xe152ae['query'][_0xc614('0x34')]);_0x329623[_0xc614('0x35')]=qs[_0xc614('0x2c')](_[_0xc614('0x36')](_0xe152ae[_0xc614('0x2b')],_0x42d868['filters']));if(_0xe152ae['query'][_0xc614('0x37')]){_0x329623[_0xc614('0x35')]=_['merge'](_0x329623['where'],{'$or':_['map'](_0x329623['attributes'],function(_0x40c34c){var _0x3ad5f8={};_0x3ad5f8[_0x40c34c]={'$like':'%'+_0xe152ae[_0xc614('0x2b')][_0xc614('0x37')]+'%'};return _0x3ad5f8;})});}_0x329623=_[_0xc614('0x3b')]({},_0x329623,_0xe152ae[_0xc614('0x3c')]);return _0x3da8db[_0xc614('0x4e')](_0x329623);}})[_0xc614('0x22')](function(_0x693d1c){if(_0x693d1c){_0x171fec=_0x693d1c['length'];if(!_0xe152ae['query'][_0xc614('0x31')](_0xc614('0x32'))){_0x329623[_0xc614('0x1b')]=qs[_0xc614('0x1b')](_0xe152ae[_0xc614('0x2b')][_0xc614('0x1b')]);_0x329623[_0xc614('0x1a')]=qs[_0xc614('0x1a')](_0xe152ae[_0xc614('0x2b')][_0xc614('0x1a')]);}return _0x3da8db[_0xc614('0x4e')](_0x329623);}})[_0xc614('0x22')](function(_0x1b30a8){if(_0x1b30a8){return _0x1b30a8?{'count':_0x171fec,'rows':_0x1b30a8}:null;}})[_0xc614('0x22')](respondWithResult(_0x36e853,null))[_0xc614('0x3f')](handleError(_0x36e853,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a067b48..5a37d02 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 _0x7ea3=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x5d1c9d,_0x8bb82d){var _0x8edfe4=function(_0x30fdc4){while(--_0x30fdc4){_0x5d1c9d['push'](_0x5d1c9d['shift']());}};_0x8edfe4(++_0x8bb82d);}(_0x7ea3,0xba));var _0x37ea=function(_0x8b4dd3,_0x120bdc){_0x8b4dd3=_0x8b4dd3-0x0;var _0x1f9fda=_0x7ea3[_0x8b4dd3];return _0x1f9fda;};'use strict';var _=require(_0x37ea('0x0'));var util=require(_0x37ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x37ea('0x2'));var BPromise=require(_0x37ea('0x3'));var rp=require(_0x37ea('0x4'));var fs=require('fs');var path=require(_0x37ea('0x5'));var rimraf=require(_0x37ea('0x6'));var config=require(_0x37ea('0x7'));var attributes=require(_0x37ea('0x8'));module['exports']=function(_0x11f891,_0x1911e7){return _0x11f891[_0x37ea('0x9')]('Automation',attributes,{'tableName':_0x37ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed8d=['bluebird','request-promise','rimraf','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x3bcd5d,_0x8ae30c){var _0x4c7d6d=function(_0x25fe5d){while(--_0x25fe5d){_0x3bcd5d['push'](_0x3bcd5d['shift']());}};_0x4c7d6d(++_0x8ae30c);}(_0xed8d,0xed));var _0xded8=function(_0x329986,_0x53547d){_0x329986=_0x329986-0x0;var _0x23bda6=_0xed8d[_0x329986];return _0x23bda6;};'use strict';var _=require(_0xded8('0x0'));var util=require(_0xded8('0x1'));var logger=require(_0xded8('0x2'))(_0xded8('0x3'));var moment=require(_0xded8('0x4'));var BPromise=require(_0xded8('0x5'));var rp=require(_0xded8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xded8('0x7'));var config=require('../../config/environment');var attributes=require(_0xded8('0x8'));module['exports']=function(_0x78c662,_0x2d1345){return _0x78c662['define'](_0xded8('0x9'),attributes,{'tableName':_0xded8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 5b9065a..83110b4 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 _0x444e=['client','http','request','then','request\x20sent','debug','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x560485,_0x244601){var _0x3e7f69=function(_0x45529f){while(--_0x45529f){_0x560485['push'](_0x560485['shift']());}};_0x3e7f69(++_0x244601);}(_0x444e,0xe8));var _0xe444=function(_0x544b85,_0x4a0924){_0x544b85=_0x544b85-0x0;var _0x183b83=_0x444e[_0x544b85];return _0x183b83;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4834c7,_0xfbd88b,_0x4b5b7d){return new BPromise(function(_0x29a2b7,_0x482b98){return client[_0xe444('0xa')](_0x4834c7,_0x4b5b7d)[_0xe444('0xb')](function(_0x40a368){logger['info']('Automation,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'));logger[_0xe444('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'),JSON['stringify'](_0x40a368));if(_0x40a368['error']){if(_0x40a368[_0xe444('0xe')]['code']===0x1f4){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x482b98(_0x40a368['error']['message']);}logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x29a2b7(_0x40a368['error'][_0xe444('0x10')]);}else{logger[_0xe444('0x11')](_0xe444('0xf'),_0xfbd88b,_0xe444('0xc'));_0x29a2b7(_0x40a368[_0xe444('0x12')][_0xe444('0x10')]);}})[_0xe444('0x13')](function(_0x3e1b57){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x3e1b57);_0x482b98(_0x3e1b57);});});} \ No newline at end of file +var _0x07e8=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x07e8,0x10f));var _0x807e=function(_0x54cf4b,_0x4c56c3){_0x54cf4b=_0x54cf4b-0x0;var _0x41be1d=_0x07e8[_0x54cf4b];return _0x41be1d;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var moment=require(_0x807e('0x2'));var BPromise=require('bluebird');var rs=require(_0x807e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x807e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x807e('0x5'));var config=require(_0x807e('0x6'));var jayson=require(_0x807e('0x7'));var client=jayson['client'][_0x807e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa12efd,_0x30766c,_0x178efb){return new BPromise(function(_0x1845b3,_0x54e3cb){return client[_0x807e('0x9')](_0xa12efd,_0x178efb)[_0x807e('0xa')](function(_0x400374){logger[_0x807e('0xb')](_0x807e('0xc'),_0x30766c,_0x807e('0xd'));logger[_0x807e('0xe')](_0x807e('0xf'),_0x30766c,_0x807e('0xd'),JSON[_0x807e('0x10')](_0x400374));if(_0x400374[_0x807e('0x11')]){if(_0x400374[_0x807e('0x11')][_0x807e('0x12')]===0x1f4){logger[_0x807e('0x11')]('Automation,\x20%s,\x20%s',_0x30766c,_0x400374[_0x807e('0x11')][_0x807e('0x13')]);return _0x54e3cb(_0x400374[_0x807e('0x11')][_0x807e('0x13')]);}logger[_0x807e('0x11')](_0x807e('0xc'),_0x30766c,_0x400374[_0x807e('0x11')]['message']);return _0x1845b3(_0x400374['error'][_0x807e('0x13')]);}else{logger[_0x807e('0xb')](_0x807e('0xc'),_0x30766c,_0x807e('0xd'));_0x1845b3(_0x400374['result'][_0x807e('0x13')]);}})[_0x807e('0x14')](function(_0x1ffc81){logger[_0x807e('0x11')](_0x807e('0xc'),_0x30766c,_0x1ffc81);_0x54e3cb(_0x1ffc81);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 8d207d5..816626f 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 _0x6538=['create','addActions','put','update','delete','exports','util','path','express','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x2da00c,_0x116136){var _0x1abd08=function(_0x52729e){while(--_0x52729e){_0x2da00c['push'](_0x2da00c['shift']());}};_0x1abd08(++_0x116136);}(_0x6538,0x9e));var _0x8653=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x6538[_0x4b2251];return _0x5d22fb;};'use strict';var multer=require('multer');var util=require(_0x8653('0x0'));var path=require(_0x8653('0x1'));var timeout=require('connect-timeout');var express=require(_0x8653('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8653('0x3'));var controller=require('./automation.controller');router[_0x8653('0x4')]('/',auth[_0x8653('0x5')](),controller['index']);router[_0x8653('0x4')](_0x8653('0x6'),auth[_0x8653('0x5')](),controller[_0x8653('0x7')]);router['get'](_0x8653('0x8'),auth['isAuthenticated'](),controller[_0x8653('0x9')]);router[_0x8653('0x4')](_0x8653('0xa'),auth[_0x8653('0x5')](),controller[_0x8653('0xb')]);router[_0x8653('0xc')]('/',auth[_0x8653('0x5')](),controller[_0x8653('0xd')]);router[_0x8653('0xc')](_0x8653('0x8'),auth['isAuthenticated'](),controller['addConditions']);router[_0x8653('0xc')](_0x8653('0xa'),auth[_0x8653('0x5')](),controller[_0x8653('0xe')]);router[_0x8653('0xf')](_0x8653('0x6'),auth['isAuthenticated'](),controller[_0x8653('0x10')]);router[_0x8653('0x11')](_0x8653('0x6'),auth[_0x8653('0x5')](),controller['destroy']);module[_0x8653('0x12')]=router; \ No newline at end of file +var _0x52f1=['isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x52f1,0x175));var _0x152f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x52f1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x152f('0x0'));var util=require(_0x152f('0x1'));var path=require(_0x152f('0x2'));var timeout=require(_0x152f('0x3'));var express=require(_0x152f('0x4'));var router=express['Router']();var auth=require(_0x152f('0x5'));var interaction=require(_0x152f('0x6'));var config=require(_0x152f('0x7'));var controller=require(_0x152f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x152f('0x9')](_0x152f('0xa'),auth[_0x152f('0xb')](),controller[_0x152f('0xc')]);router[_0x152f('0x9')]('/:id/conditions',auth[_0x152f('0xb')](),controller[_0x152f('0xd')]);router[_0x152f('0x9')](_0x152f('0xe'),auth[_0x152f('0xb')](),controller[_0x152f('0xf')]);router[_0x152f('0x10')]('/',auth['isAuthenticated'](),controller[_0x152f('0x11')]);router[_0x152f('0x10')](_0x152f('0x12'),auth[_0x152f('0xb')](),controller[_0x152f('0x13')]);router[_0x152f('0x10')](_0x152f('0xe'),auth[_0x152f('0xb')](),controller[_0x152f('0x14')]);router['put']('/:id',auth[_0x152f('0xb')](),controller[_0x152f('0x15')]);router['delete'](_0x152f('0xa'),auth[_0x152f('0xb')](),controller[_0x152f('0x16')]);module[_0x152f('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 1870499..0a802c4 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 _0xe91c=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','always','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#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)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe91c,0x157));var _0xce91=function(_0x441db4,_0x1fabed){_0x441db4=_0x441db4-0x0;var _0x4bed40=_0xe91c[_0x441db4];return _0x4bed40;};'use strict';var Sequelize=require(_0xce91('0x0'));module[_0xce91('0x1')]={'name':{'type':Sequelize[_0xce91('0x2')],'unique':_0xce91('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xce91('0x4')](_0xce91('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xce91('0x2')]},'active':{'type':Sequelize[_0xce91('0x6')],'defaultValue':0x0,'comment':_0xce91('0x7')},'limitCalls':{'type':Sequelize[_0xce91('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xce91('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xce91('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xce91('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xce91('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xce91('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xce91('0x4')]('always',_0xce91('0x12'),'onlyIfOpen'),'defaultValue':_0xce91('0x13')},'dialAMDActive':{'type':Sequelize[_0xce91('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xce91('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xce91('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xce91('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xce91('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xce91('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xce91('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xce91('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xce91('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xce91('0x1a'),_0xce91('0x1b')),'defaultValue':_0xce91('0x1a')},'dialPrefix':{'type':Sequelize[_0xce91('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce91('0x1c')},'dialCutDigit':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce91('0x1d')}}; \ No newline at end of file +var _0x987f=['STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','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','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports'];(function(_0xd54ede,_0x46aec5){var _0x2d6ae3=function(_0x407f68){while(--_0x407f68){_0xd54ede['push'](_0xd54ede['shift']());}};_0x2d6ae3(++_0x46aec5);}(_0x987f,0xbe));var _0xf987=function(_0x141310,_0x4fb243){_0x141310=_0x141310-0x0;var _0x4680ae=_0x987f[_0x141310];return _0x4680ae;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'name':{'type':Sequelize[_0xf987('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf987('0x3')](_0xf987('0x4')),'allowNull':![],'defaultValue':_0xf987('0x4')},'description':{'type':Sequelize[_0xf987('0x2')]},'active':{'type':Sequelize[_0xf987('0x5')],'defaultValue':0x0,'comment':_0xf987('0x6')},'limitCalls':{'type':Sequelize[_0xf987('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf987('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf987('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xf987('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf987('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf987('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf987('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'defaultValue':0x3,'comment':_0xf987('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf987('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf987('0xf')},'dialTimezone':{'type':Sequelize[_0xf987('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf987('0x2')],'defaultValue':_0xf987('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf987('0x3')](_0xf987('0x11'),_0xf987('0x12'),_0xf987('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf987('0x5')],'defaultValue':0x0,'comment':_0xf987('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf987('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf987('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf987('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf987('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf987('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf987('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf987('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf987('0x7')](0x9)[_0xf987('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf987('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf987('0x7')](0x5)[_0xf987('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf987('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf987('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf987('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf987('0x1d'),'ASC'),'defaultValue':_0xf987('0x1d')},'dialPrefix':{'type':Sequelize[_0xf987('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf987('0x7')](0x3)[_0xf987('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf987('0x1e')},'dialCutDigit':{'type':Sequelize[_0xf987('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf987('0x1f')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index bd9faf6..dfd0f75 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 _0x1152=['push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','Campaign','rawAttributes','model','keys','query','filters','intersection','fields','attributes','order','sort','pick','filter','merge','where','map','type','key','options','includeAll','include','findAll','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','hasOwnProperty','nolimit','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ContactId','cm_contacts'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1152,0x182));var _0x2115=function(_0x299cde,_0x13b449){_0x299cde=_0x299cde-0x0;var _0x54981b=_0x1152[_0x299cde];return _0x54981b;};'use strict';var pdf=require(_0x2115('0x0'));var emlformat=require(_0x2115('0x1'));var rimraf=require(_0x2115('0x2'));var zipdir=require(_0x2115('0x3'));var jsonpatch=require(_0x2115('0x4'));var rp=require(_0x2115('0x5'));var moment=require(_0x2115('0x6'));var BPromise=require(_0x2115('0x7'));var Mustache=require('mustache');var util=require(_0x2115('0x8'));var path=require('path');var sox=require(_0x2115('0x9'));var csv=require(_0x2115('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0xa'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2115('0xe'));var logger=require(_0x2115('0xf'))(_0x2115('0x10'));var utils=require('../../config/utils');var config=require(_0x2115('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x84a7e8,_0x32361a){_0x32361a=_0x32361a||0xcc;return function(_0x2bb885){if(_0x2bb885){return _0x84a7e8[_0x2115('0x12')](_0x32361a);}return _0x84a7e8[_0x2115('0x13')](_0x32361a)['end']();};}function respondWithResult(_0x9e2dd5,_0x48af04){_0x48af04=_0x48af04||0xc8;return function(_0x3727a3){if(_0x3727a3){return _0x9e2dd5[_0x2115('0x13')](_0x48af04)[_0x2115('0x14')](_0x3727a3);}};}function respondWithFilteredResult(_0x2001e6,_0x7f6183){return function(_0x113ce2){if(_0x113ce2){var _0x350969=_0x113ce2[_0x2115('0x15')],_0x5e8f81=_0x7f6183[_0x2115('0x16')],_0xdf3e24=_0x7f6183[_0x2115('0x16')]+_0x7f6183[_0x2115('0x17')],_0x21b589;if(_0xdf3e24>=_0x350969){_0xdf3e24=_0x350969;_0x21b589=0xc8;}else{_0x21b589=0xce;}_0x2001e6[_0x2115('0x13')](_0x21b589);return _0x2001e6[_0x2115('0x18')]('Content-Range',_0x5e8f81+'-'+_0xdf3e24+'/'+_0x350969)[_0x2115('0x14')](_0x113ce2);}return null;};}function patchUpdates(_0x254988){return function(_0x38c26f){try{jsonpatch['apply'](_0x38c26f,_0x254988,!![]);}catch(_0x2dfb3c){return BPromise[_0x2115('0x19')](_0x2dfb3c);}return _0x38c26f[_0x2115('0x1a')]();};}function saveUpdates(_0x244cba,_0x534543){return function(_0xcc2d7b){if(_0xcc2d7b){return _0xcc2d7b[_0x2115('0x1b')](_0x244cba)[_0x2115('0x1c')](function(_0x464af4){return _0x464af4;});}return null;};}function removeEntity(_0x22ebb6,_0x1ddb2a){return function(_0x8b7304){if(_0x8b7304){return _0x8b7304[_0x2115('0x1d')]()[_0x2115('0x1c')](function(){var _0x49d26c=_0x8b7304[_0x2115('0x1e')]({'plain':!![]});var _0x340c42=_0x2115('0x1f');return db[_0x2115('0x20')][_0x2115('0x1d')]({'where':{'type':_0x340c42,'resourceId':_0x49d26c['id']}})[_0x2115('0x1c')](function(){return _0x8b7304;});})['then'](function(){_0x22ebb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x201c94,_0x5e9d07){return function(_0x1a2ec3){if(!_0x1a2ec3){_0x201c94['sendStatus'](0x194);}return _0x1a2ec3;};}function handleError(_0x1283ec,_0x115800){_0x115800=_0x115800||0x1f4;return function(_0x1b7f47){logger[_0x2115('0x21')](_0x1b7f47[_0x2115('0x22')]);if(_0x1b7f47['name']){delete _0x1b7f47[_0x2115('0x23')];}_0x1283ec[_0x2115('0x13')](_0x115800)['send'](_0x1b7f47);};}exports[_0x2115('0x24')]=function(_0x33d81c,_0x26eff7){var _0x1262e7={},_0x59ca70={},_0x19c595={'count':0x0,'rows':[]};var _0x15229e=db[_0x2115('0x25')][_0x2115('0x26')];_0x59ca70[_0x2115('0x27')]=_[_0x2115('0x28')](_0x15229e);_0x59ca70['query']=_['keys'](_0x33d81c[_0x2115('0x29')]);_0x59ca70[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x59ca70[_0x2115('0x27')],_0x59ca70[_0x2115('0x29')]);_0x1262e7['attributes']=_[_0x2115('0x2b')](_0x59ca70[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x33d81c['query'][_0x2115('0x2c')]));_0x1262e7['attributes']=_0x1262e7[_0x2115('0x2d')]['length']?_0x1262e7[_0x2115('0x2d')]:_0x59ca70[_0x2115('0x27')];if(!_0x33d81c[_0x2115('0x29')]['hasOwnProperty']('nolimit')){_0x1262e7[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x33d81c['query'][_0x2115('0x17')]);_0x1262e7[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x33d81c[_0x2115('0x29')]['offset']);}_0x1262e7[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x33d81c[_0x2115('0x29')][_0x2115('0x2f')]);_0x1262e7['where']=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0x33d81c[_0x2115('0x29')],_0x59ca70[_0x2115('0x2a')]));if(_0x33d81c[_0x2115('0x29')][_0x2115('0x31')]){_0x1262e7['where']=_[_0x2115('0x32')](_0x1262e7[_0x2115('0x33')],{'$or':_[_0x2115('0x34')](_0x15229e,function(_0xaf411a){if(_0xaf411a[_0x2115('0x35')][_0x2115('0x36')]!=='VIRTUAL'){var _0x130fee={};_0x130fee[_0xaf411a['field']]={'$like':'%'+_0x33d81c['query'][_0x2115('0x31')]+'%'};return _0x130fee;}})});}_0x1262e7=_[_0x2115('0x32')]({},_0x1262e7,_0x33d81c[_0x2115('0x37')]);var _0x14adc8={'where':_0x1262e7[_0x2115('0x33')]};return db[_0x2115('0x25')]['count'](_0x14adc8)[_0x2115('0x1c')](function(_0x1c2508){_0x19c595[_0x2115('0x15')]=_0x1c2508;if(_0x33d81c[_0x2115('0x29')][_0x2115('0x38')]){_0x1262e7[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x25')][_0x2115('0x3a')](_0x1262e7);})[_0x2115('0x1c')](function(_0x5e30a5){_0x19c595['rows']=_0x5e30a5;return _0x19c595;})['then'](respondWithFilteredResult(_0x26eff7,_0x1262e7))[_0x2115('0x3b')](handleError(_0x26eff7,null));};exports['show']=function(_0xa652de,_0x52d91a){var _0x54ec64={'raw':![],'where':{'id':_0xa652de[_0x2115('0x3c')]['id']}},_0x55be95={};_0x55be95[_0x2115('0x27')]=_[_0x2115('0x28')](db[_0x2115('0x25')][_0x2115('0x26')]);_0x55be95['query']=_[_0x2115('0x28')](_0xa652de['query']);_0x55be95[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x55be95['model'],_0x55be95[_0x2115('0x29')]);_0x54ec64[_0x2115('0x2d')]=_['intersection'](_0x55be95['model'],qs[_0x2115('0x2c')](_0xa652de[_0x2115('0x29')]['fields']));_0x54ec64['attributes']=_0x54ec64[_0x2115('0x2d')][_0x2115('0x3d')]?_0x54ec64['attributes']:_0x55be95['model'];if(_0xa652de[_0x2115('0x29')][_0x2115('0x38')]){_0x54ec64[_0x2115('0x39')]=[{'all':!![]}];}_0x54ec64=_['merge']({},_0x54ec64,_0xa652de[_0x2115('0x37')]);return db['Campaign'][_0x2115('0x3e')](_0x54ec64)[_0x2115('0x1c')](handleEntityNotFound(_0x52d91a,null))[_0x2115('0x1c')](respondWithResult(_0x52d91a,null))[_0x2115('0x3b')](handleError(_0x52d91a,null));};exports[_0x2115('0x3f')]=function(_0x4cf226,_0x11391e){return db['Campaign']['create'](_0x4cf226[_0x2115('0x40')],{})[_0x2115('0x1c')](function(_0x583575){var _0x84739c=_0x4cf226[_0x2115('0x41')][_0x2115('0x1e')]({'plain':!![]});if(!_0x84739c)throw new Error(_0x2115('0x42'));if(_0x84739c[_0x2115('0x43')]===_0x2115('0x41')){var _0x41d1a4=_0x583575[_0x2115('0x1e')]({'plain':!![]});var _0x1c3cd2='IvrCampaigns';return db[_0x2115('0x44')][_0x2115('0x3e')]({'where':{'name':_0x1c3cd2,'userProfileId':_0x84739c[_0x2115('0x45')]},'raw':!![]})['then'](function(_0x31e684){if(_0x31e684&&_0x31e684['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x41d1a4[_0x2115('0x23')],'resourceId':_0x41d1a4['id'],'type':_0x31e684[_0x2115('0x23')],'sectionId':_0x31e684['id']},{})['then'](function(){return _0x583575;});}else{return _0x583575;}})['catch'](function(_0xd2f5cd){logger[_0x2115('0x21')](_0x2115('0x46'),_0xd2f5cd);throw _0xd2f5cd;});}return _0x583575;})[_0x2115('0x1c')](respondWithResult(_0x11391e,0xc9))[_0x2115('0x3b')](handleError(_0x11391e,null));};exports[_0x2115('0x47')]=function(_0x3b8586,_0x9539e2){var _0x5876d3={'raw':![],'where':{'id':_0x3b8586[_0x2115('0x3c')]['id']}},_0x29dbce={};_0x29dbce['model']=_[_0x2115('0x28')](db[_0x2115('0x25')][_0x2115('0x26')]);_0x5876d3[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x29dbce[_0x2115('0x27')],qs['fields'](_0x3b8586[_0x2115('0x29')][_0x2115('0x2c')]));_0x5876d3['attributes']=_0x5876d3['attributes'][_0x2115('0x3d')]?_0x5876d3[_0x2115('0x2d')]:_0x29dbce[_0x2115('0x27')];if(_0x3b8586[_0x2115('0x29')]['includeAll']){_0x5876d3[_0x2115('0x39')]=[{'all':!![]}];}_0x5876d3=_[_0x2115('0x32')]({},_0x5876d3,_0x3b8586[_0x2115('0x37')]);return db[_0x2115('0x25')][_0x2115('0x3e')](_0x5876d3)[_0x2115('0x1c')](handleEntityNotFound(_0x9539e2,null))['then'](function(_0xd1fe41){if(_0xd1fe41){var _0x756733=_0xd1fe41['get']({'plain':!![]});_0x756733=qs[_0x2115('0x48')](_0x756733,['id',_0x2115('0x49'),_0x2115('0x4a')]);_0x3b8586['body']=_[_0x2115('0x48')](_0x3b8586['body'],['id',_0x2115('0x49'),_0x2115('0x4a')]);return db[_0x2115('0x25')][_0x2115('0x3f')](_[_0x2115('0x32')](_0x756733,_0x3b8586[_0x2115('0x40')]),{'include':_0x3b8586['query'][_0x2115('0x38')]?[{'all':!![]}]:undefined})[_0x2115('0x1c')](function(_0x586c15){var _0x33b417=_0x3b8586[_0x2115('0x41')][_0x2115('0x1e')]({'plain':!![]});if(!_0x33b417)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33b417['role']==='user'){var _0x3d7106=_0x586c15['get']({'plain':!![]});var _0x1f15c5=_0x2115('0x1f');return db[_0x2115('0x44')]['find']({'where':{'name':_0x1f15c5,'userProfileId':_0x33b417[_0x2115('0x45')]},'raw':!![]})['then'](function(_0x386f8a){if(_0x386f8a&&_0x386f8a[_0x2115('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x3d7106[_0x2115('0x23')],'resourceId':_0x3d7106['id'],'type':_0x386f8a[_0x2115('0x23')],'sectionId':_0x386f8a['id']},{})['then'](function(){return _0x586c15;});}else{return _0x586c15;}})[_0x2115('0x3b')](function(_0x533c13){logger[_0x2115('0x21')](_0x2115('0x46'),_0x533c13);throw _0x533c13;});}return _0x586c15;});}})['then'](respondWithResult(_0x9539e2,0xc9))[_0x2115('0x3b')](handleError(_0x9539e2,null));};exports[_0x2115('0x1b')]=function(_0x1a7a9d,_0x3d1c53){if(_0x1a7a9d[_0x2115('0x40')]['id']){delete _0x1a7a9d[_0x2115('0x40')]['id'];}return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x1a7a9d[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x3d1c53,null))[_0x2115('0x1c')](saveUpdates(_0x1a7a9d[_0x2115('0x40')],null))[_0x2115('0x1c')](respondWithResult(_0x3d1c53,null))[_0x2115('0x3b')](handleError(_0x3d1c53,null));};exports[_0x2115('0x1d')]=function(_0x21baa7,_0x46a03a){return db[_0x2115('0x25')]['find']({'where':{'id':_0x21baa7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x46a03a,null))[_0x2115('0x1c')](removeEntity(_0x46a03a,null))[_0x2115('0x3b')](handleError(_0x46a03a,null));};exports[_0x2115('0x4c')]=function(_0x225389,_0x2b21c8,_0x5ca331){var _0x96003b={'raw':!![],'where':{}};var _0x19068d={};var _0x126c08={'count':0x0,'rows':[]};return db['Campaign'][_0x2115('0x4d')]({'where':{'id':_0x225389[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x2b21c8,null))[_0x2115('0x1c')](function(_0x181e07){if(_0x181e07){_0x19068d['model']=_[_0x2115('0x28')](db['CmHopper']['rawAttributes']);_0x19068d[_0x2115('0x29')]=_['keys'](_0x225389['query']);_0x19068d['filters']=_['intersection'](_0x19068d[_0x2115('0x27')],_0x19068d['query']);_0x96003b[_0x2115('0x2d')]=_['intersection'](_0x19068d[_0x2115('0x27')],qs['fields'](_0x225389[_0x2115('0x29')]['fields']));_0x96003b['attributes']=_0x96003b['attributes'][_0x2115('0x3d')]?_0x96003b[_0x2115('0x2d')]:_0x19068d['model'];if(!_0x225389[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x96003b[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x225389[_0x2115('0x29')][_0x2115('0x17')]);_0x96003b[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x225389[_0x2115('0x29')][_0x2115('0x16')]);}_0x96003b[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x225389[_0x2115('0x29')][_0x2115('0x2f')]);_0x96003b[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x225389['query'],_0x19068d['filters']));_0x96003b['where'][_0x2115('0x50')]=_0x181e07['id'];if(_0x225389[_0x2115('0x29')][_0x2115('0x31')]){_0x96003b['where']=_[_0x2115('0x32')](_0x96003b[_0x2115('0x33')],{'$or':_['map'](_0x96003b[_0x2115('0x2d')],function(_0x10d172){var _0x2c573a={};_0x2c573a[_0x10d172]={'$like':'%'+_0x225389[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x2c573a;})});}_0x96003b=_[_0x2115('0x32')]({},_0x96003b,_0x225389[_0x2115('0x37')]);return db[_0x2115('0x51')][_0x2115('0x15')]({'where':_0x96003b[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x387c2b){_0x126c08[_0x2115('0x15')]=_0x387c2b;if(_0x225389['query'][_0x2115('0x38')]){_0x96003b[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x51')][_0x2115('0x3a')](_0x96003b);})['then'](function(_0x249b9c){_0x126c08[_0x2115('0x52')]=_0x249b9c;return _0x126c08;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x2b21c8,_0x96003b))[_0x2115('0x3b')](handleError(_0x2b21c8,null));};exports[_0x2115('0x53')]=function(_0x156b1f,_0x34fbb7,_0x332177){var _0x85f3d9={'raw':!![],'where':{}};var _0x956842={};var _0xe87632={'count':0x0,'rows':[]};return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0x156b1f[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x34fbb7,null))[_0x2115('0x1c')](function(_0x354a73){if(_0x354a73){_0x956842['model']=_[_0x2115('0x28')](db[_0x2115('0x54')][_0x2115('0x26')]);_0x956842[_0x2115('0x29')]=_[_0x2115('0x28')](_0x156b1f[_0x2115('0x29')]);_0x956842[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x956842[_0x2115('0x27')],_0x956842[_0x2115('0x29')]);_0x85f3d9[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x956842[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x156b1f[_0x2115('0x29')][_0x2115('0x2c')]));_0x85f3d9[_0x2115('0x2d')]=_0x85f3d9[_0x2115('0x2d')]['length']?_0x85f3d9[_0x2115('0x2d')]:_0x956842[_0x2115('0x27')];if(!_0x156b1f['query'][_0x2115('0x4e')](_0x2115('0x4f'))){_0x85f3d9[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x156b1f[_0x2115('0x29')][_0x2115('0x17')]);_0x85f3d9['offset']=qs[_0x2115('0x16')](_0x156b1f['query'][_0x2115('0x16')]);}_0x85f3d9[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x156b1f[_0x2115('0x29')]['sort']);_0x85f3d9[_0x2115('0x33')]=qs[_0x2115('0x2a')](_['pick'](_0x156b1f[_0x2115('0x29')],_0x956842[_0x2115('0x2a')]));_0x85f3d9[_0x2115('0x33')]['CampaignId']=_0x354a73['id'];if(_0x156b1f[_0x2115('0x29')][_0x2115('0x31')]){_0x85f3d9[_0x2115('0x33')]=_[_0x2115('0x32')](_0x85f3d9['where'],{'$or':_['map'](_0x85f3d9[_0x2115('0x2d')],function(_0x4135bc){var _0x188497={};_0x188497[_0x4135bc]={'$like':'%'+_0x156b1f[_0x2115('0x29')]['filter']+'%'};return _0x188497;})});}_0x85f3d9=_[_0x2115('0x32')]({},_0x85f3d9,_0x156b1f['options']);return db[_0x2115('0x54')]['count']({'where':_0x85f3d9['where']})['then'](function(_0x2fe8dd){_0xe87632['count']=_0x2fe8dd;if(_0x156b1f[_0x2115('0x29')][_0x2115('0x38')]){_0x85f3d9[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x54')][_0x2115('0x3a')](_0x85f3d9);})['then'](function(_0x374d98){_0xe87632[_0x2115('0x52')]=_0x374d98;return _0xe87632;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x34fbb7,_0x85f3d9))['catch'](handleError(_0x34fbb7,null));};exports[_0x2115('0x55')]=function(_0x398969,_0x4b77a0,_0x368d0a){var _0x251458={'raw':!![],'where':{}};var _0x38cd11={};var _0x4deb05={'count':0x0,'rows':[]};return db[_0x2115('0x25')]['findOne']({'where':{'id':_0x398969[_0x2115('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4b77a0,null))[_0x2115('0x1c')](function(_0x384085){if(_0x384085){_0x38cd11['model']=_[_0x2115('0x28')](db[_0x2115('0x56')]['rawAttributes']);_0x38cd11['query']=_[_0x2115('0x28')](_0x398969[_0x2115('0x29')]);_0x38cd11[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x38cd11[_0x2115('0x27')],_0x38cd11[_0x2115('0x29')]);_0x251458[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x38cd11[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x398969['query'][_0x2115('0x2c')]));_0x251458['attributes']=_0x251458[_0x2115('0x2d')][_0x2115('0x3d')]?_0x251458['attributes']:_0x38cd11[_0x2115('0x27')];if(!_0x398969[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x251458[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x398969[_0x2115('0x29')][_0x2115('0x17')]);_0x251458[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x398969[_0x2115('0x29')][_0x2115('0x16')]);}_0x251458[_0x2115('0x2e')]=qs['sort'](_0x398969[_0x2115('0x29')][_0x2115('0x2f')]);_0x251458['where']=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0x398969[_0x2115('0x29')],_0x38cd11[_0x2115('0x2a')]));_0x251458[_0x2115('0x33')]['CampaignId']=_0x384085['id'];if(_0x398969[_0x2115('0x29')][_0x2115('0x31')]){_0x251458['where']=_[_0x2115('0x32')](_0x251458[_0x2115('0x33')],{'$or':_[_0x2115('0x34')](_0x251458[_0x2115('0x2d')],function(_0x3c92a5){var _0x32f75d={};_0x32f75d[_0x3c92a5]={'$like':'%'+_0x398969[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x32f75d;})});}_0x251458=_[_0x2115('0x32')]({},_0x251458,_0x398969[_0x2115('0x37')]);return db['CmHopperFinal'][_0x2115('0x15')]({'where':_0x251458[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0xa1c60c){_0x4deb05[_0x2115('0x15')]=_0xa1c60c;if(_0x398969[_0x2115('0x29')][_0x2115('0x38')]){_0x251458['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x251458);})['then'](function(_0x228e05){_0x4deb05[_0x2115('0x52')]=_0x228e05;return _0x4deb05;});}})['then'](respondWithFilteredResult(_0x4b77a0,_0x251458))[_0x2115('0x3b')](handleError(_0x4b77a0,null));};exports[_0x2115('0x57')]=function(_0x4ce305,_0x56f2d5,_0x420329){var _0x1642a7={'raw':!![],'where':{}};var _0x3f8eaa={};var _0x21162c={'count':0x0,'rows':[]};return db['Campaign'][_0x2115('0x4d')]({'where':{'id':_0x4ce305[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x56f2d5,null))['then'](function(_0x120aea){if(_0x120aea){_0x3f8eaa[_0x2115('0x27')]=_[_0x2115('0x28')](db['CmHopperBlack'][_0x2115('0x26')]);_0x3f8eaa['query']=_[_0x2115('0x28')](_0x4ce305[_0x2115('0x29')]);_0x3f8eaa[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x3f8eaa[_0x2115('0x27')],_0x3f8eaa['query']);_0x1642a7[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x3f8eaa['model'],qs[_0x2115('0x2c')](_0x4ce305[_0x2115('0x29')]['fields']));_0x1642a7[_0x2115('0x2d')]=_0x1642a7[_0x2115('0x2d')][_0x2115('0x3d')]?_0x1642a7[_0x2115('0x2d')]:_0x3f8eaa['model'];if(!_0x4ce305[_0x2115('0x29')]['hasOwnProperty'](_0x2115('0x4f'))){_0x1642a7[_0x2115('0x17')]=qs['limit'](_0x4ce305[_0x2115('0x29')][_0x2115('0x17')]);_0x1642a7[_0x2115('0x16')]=qs['offset'](_0x4ce305['query'][_0x2115('0x16')]);}_0x1642a7[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x4ce305[_0x2115('0x29')]['sort']);_0x1642a7[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x4ce305[_0x2115('0x29')],_0x3f8eaa[_0x2115('0x2a')]));_0x1642a7[_0x2115('0x33')][_0x2115('0x50')]=_0x120aea['id'];if(_0x4ce305['query']['filter']){_0x1642a7['where']=_[_0x2115('0x32')](_0x1642a7['where'],{'$or':_[_0x2115('0x34')](_0x1642a7[_0x2115('0x2d')],function(_0x3a06e5){var _0x254aa3={};_0x254aa3[_0x3a06e5]={'$like':'%'+_0x4ce305[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x254aa3;})});}_0x1642a7=_[_0x2115('0x32')]({},_0x1642a7,_0x4ce305[_0x2115('0x37')]);return db['CmHopperBlack'][_0x2115('0x15')]({'where':_0x1642a7[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x42a34c){_0x21162c['count']=_0x42a34c;if(_0x4ce305['query']['includeAll']){_0x1642a7[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x58')]['findAll'](_0x1642a7);})['then'](function(_0xe092a8){_0x21162c[_0x2115('0x52')]=_0xe092a8;return _0x21162c;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x56f2d5,_0x1642a7))[_0x2115('0x3b')](handleError(_0x56f2d5,null));};exports['getLists']=function(_0xd50b47,_0xdf128b,_0x173153){var _0x432d35={};var _0x2adb2a={};var _0x1ec12b;var _0x58764f;return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0xd50b47['params']['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0xdf128b,null))['then'](function(_0x431539){if(_0x431539){_0x1ec12b=_0x431539;_0x2adb2a[_0x2115('0x27')]=_[_0x2115('0x28')](db[_0x2115('0x59')][_0x2115('0x26')]);_0x2adb2a[_0x2115('0x29')]=_[_0x2115('0x28')](_0xd50b47['query']);_0x2adb2a[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x2adb2a['model'],_0x2adb2a[_0x2115('0x29')]);_0x432d35[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x2adb2a['model'],qs[_0x2115('0x2c')](_0xd50b47[_0x2115('0x29')][_0x2115('0x2c')]));_0x432d35[_0x2115('0x2d')]=_0x432d35[_0x2115('0x2d')]['length']?_0x432d35[_0x2115('0x2d')]:_0x2adb2a[_0x2115('0x27')];_0x432d35[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0xd50b47[_0x2115('0x29')][_0x2115('0x2f')]);_0x432d35[_0x2115('0x33')]=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0xd50b47[_0x2115('0x29')],_0x2adb2a[_0x2115('0x2a')]));if(_0xd50b47[_0x2115('0x29')][_0x2115('0x31')]){_0x432d35[_0x2115('0x33')]=_[_0x2115('0x32')](_0x432d35['where'],{'$or':_[_0x2115('0x34')](_0x432d35[_0x2115('0x2d')],function(_0x503b6d){var _0x4b02a1={};_0x4b02a1[_0x503b6d]={'$like':'%'+_0xd50b47[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x4b02a1;})});}_0x432d35=_[_0x2115('0x32')]({},_0x432d35,_0xd50b47[_0x2115('0x37')]);return _0x1ec12b[_0x2115('0x5a')](_0x432d35);}})[_0x2115('0x1c')](function(_0x5a0ca4){if(_0x5a0ca4){_0x58764f=_0x5a0ca4[_0x2115('0x3d')];if(!_0xd50b47[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x432d35['limit']=qs[_0x2115('0x17')](_0xd50b47[_0x2115('0x29')][_0x2115('0x17')]);_0x432d35[_0x2115('0x16')]=qs['offset'](_0xd50b47[_0x2115('0x29')][_0x2115('0x16')]);}return _0x1ec12b[_0x2115('0x5a')](_0x432d35);}})['then'](function(_0x29f010){if(_0x29f010){return _0x29f010?{'count':_0x58764f,'rows':_0x29f010}:null;}})[_0x2115('0x1c')](respondWithResult(_0xdf128b,null))[_0x2115('0x3b')](handleError(_0xdf128b,null));};exports[_0x2115('0x5b')]=function(_0x24fff5,_0x413fbe,_0x32fe35){var _0x493e74,_0x5a75d1;return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x24fff5[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x413fbe,null))[_0x2115('0x1c')](function(_0x1cc062){if(_0x1cc062){_0x5a75d1=_0x1cc062;return _0x1cc062[_0x2115('0x5b')](_0x24fff5[_0x2115('0x40')]['ids'],_[_0x2115('0x48')](_0x24fff5['body'],[_0x2115('0x5c'),'id'])||{});}return null;})[_0x2115('0x5d')](function(_0x4afc31){var _0x5dbfe0;_0x493e74=_0x4afc31||[];var _0x16f438=[];if(_0x4afc31){for(var _0x2a6e78=0x0;_0x2a6e78<_0x4afc31[_0x2115('0x3d')];_0x2a6e78+=0x1){var _0x381292=_0x4afc31[_0x2a6e78][_0x2115('0x1e')]({'plain':!![]});_0x5a75d1[_0x2115('0x5e')]=_0x24fff5['body'][_0x2115('0x5e')]?_0x24fff5[_0x2115('0x40')][_0x2115('0x5e')]:_0x5a75d1[_0x2115('0x5e')];switch(_0x5a75d1[_0x2115('0x5e')]){case _0x2115('0x5f'):_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x62'))[_0x2115('0x63')]([_0x2115('0x64'),'scheduledAt','ContactId',_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),'updatedAt'],squel[_0x2115('0x66')]()['field'](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x69'))['field']('id','ContactId')[_0x2115('0x67')](_0x381292[_0x2115('0x6a')][_0x2115('0x6b')](),'ListId')['field'](_0x24fff5[_0x2115('0x3c')]['id']['toString'](),'CampaignId')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))[_0x2115('0x67')]('NOW()',_0x2115('0x4a'))[_0x2115('0x6c')]('cm_contacts')[_0x2115('0x33')](_0x2115('0x6d'))['where'](_0x2115('0x6e'),_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())['where'](_0x2115('0x6f'))[_0x2115('0x33')](_0x2115('0x70'),squel[_0x2115('0x66')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x2115('0x6c')](_0x2115('0x71'))[_0x2115('0x33')](_0x2115('0x72'),_0x24fff5[_0x2115('0x3c')]['id']['toString']()))[_0x2115('0x33')](_0x2115('0x70'),squel['select']()[_0x2115('0x67')](_0x2115('0x73'))[_0x2115('0x6c')](_0x2115('0x62'))['where'](_0x2115('0x72'),_0x24fff5[_0x2115('0x3c')]['id'][_0x2115('0x6b')]())))[_0x2115('0x6b')]();break;case'onlyIfOpen':_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x62'))[_0x2115('0x63')]([_0x2115('0x64'),_0x2115('0x69'),'ContactId',_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel[_0x2115('0x66')]()['field'](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),'scheduledAt')['field']('id',_0x2115('0x74'))[_0x2115('0x67')](_0x381292['CmListId']['toString'](),'ListId')[_0x2115('0x67')](_0x24fff5[_0x2115('0x3c')]['id'][_0x2115('0x6b')](),_0x2115('0x50'))[_0x2115('0x67')]('NOW()','createdAt')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x4a'))[_0x2115('0x6c')](_0x2115('0x75'))[_0x2115('0x33')]('deletedAt\x20IS\x20NULL')[_0x2115('0x33')]('ListId\x20=\x20?',_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())[_0x2115('0x33')](_0x2115('0x6f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2115('0x66')]()[_0x2115('0x67')](_0x2115('0x73'))['from'](_0x2115('0x62'))[_0x2115('0x33')]('CampaignId\x20=\x20?',_0x24fff5['params']['id']['toString']())))[_0x2115('0x6b')]();break;default:_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')]('cm_hopper')[_0x2115('0x63')]([_0x2115('0x64'),_0x2115('0x69'),_0x2115('0x74'),_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel['select']()[_0x2115('0x67')](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),'scheduledAt')[_0x2115('0x67')]('id',_0x2115('0x74'))[_0x2115('0x67')](_0x381292[_0x2115('0x6a')][_0x2115('0x6b')](),_0x2115('0x65'))[_0x2115('0x67')](_0x24fff5[_0x2115('0x3c')]['id']['toString'](),_0x2115('0x50'))[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))['field']('NOW()',_0x2115('0x4a'))['from'](_0x2115('0x75'))[_0x2115('0x33')](_0x2115('0x6d'))[_0x2115('0x33')](_0x2115('0x6e'),_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2115('0x6b')]();}_0x16f438[_0x2115('0x76')](db[_0x2115('0x77')][_0x2115('0x29')](_0x5dbfe0));}return BPromise[_0x2115('0x78')](_0x16f438);}})[_0x2115('0x1c')](function(){return _0x493e74;})[_0x2115('0x1c')](respondWithResult(_0x413fbe,null))[_0x2115('0x3b')](handleError(_0x413fbe,null));};exports[_0x2115('0x79')]=function(_0x309fd7,_0x10be54,_0x2265c7){return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x309fd7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x10be54,null))[_0x2115('0x1c')](function(_0x2aef80){if(_0x2aef80){return _0x2aef80['removeLists'](_0x309fd7[_0x2115('0x29')][_0x2115('0x5c')]);}})[_0x2115('0x1c')](function(_0x418610){if(_0x418610){return db[_0x2115('0x51')][_0x2115('0x1d')]({'where':{'ListId':_0x309fd7[_0x2115('0x29')]['ids'],'CampaignId':_0x309fd7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](function(){return _0x418610;});}})[_0x2115('0x1c')](respondWithStatusCode(_0x10be54,null))['catch'](handleError(_0x10be54,null));};exports[_0x2115('0x7a')]=function(_0x3d25e0,_0x5835f3,_0x503e61){var _0x1fa498={'raw':!![],'where':{}};var _0xd3e119={};var _0x1f07df={'count':0x0,'rows':[]};return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0x3d25e0[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x5835f3,null))[_0x2115('0x1c')](function(_0x407e0c){if(_0x407e0c){_0xd3e119[_0x2115('0x27')]=_['keys'](db['CmList'][_0x2115('0x26')]);_0xd3e119['query']=_[_0x2115('0x28')](_0x3d25e0[_0x2115('0x29')]);_0xd3e119[_0x2115('0x2a')]=_['intersection'](_0xd3e119[_0x2115('0x27')],_0xd3e119[_0x2115('0x29')]);_0x1fa498[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0xd3e119[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x3d25e0['query']['fields']));_0x1fa498[_0x2115('0x2d')]=_0x1fa498['attributes']['length']?_0x1fa498[_0x2115('0x2d')]:_0xd3e119[_0x2115('0x27')];if(!_0x3d25e0[_0x2115('0x29')][_0x2115('0x4e')]('nolimit')){_0x1fa498[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x3d25e0[_0x2115('0x29')][_0x2115('0x17')]);_0x1fa498[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x3d25e0[_0x2115('0x29')][_0x2115('0x16')]);}_0x1fa498[_0x2115('0x2e')]=qs['sort'](_0x3d25e0[_0x2115('0x29')][_0x2115('0x2f')]);_0x1fa498[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x3d25e0['query'],_0xd3e119[_0x2115('0x2a')]));_0x1fa498[_0x2115('0x33')][_0x2115('0x50')]=_0x407e0c['id'];if(_0x3d25e0['query'][_0x2115('0x31')]){_0x1fa498['where']=_[_0x2115('0x32')](_0x1fa498['where'],{'$or':_[_0x2115('0x34')](_0x1fa498[_0x2115('0x2d')],function(_0x549695){var _0x23a9b6={};_0x23a9b6[_0x549695]={'$like':'%'+_0x3d25e0[_0x2115('0x29')]['filter']+'%'};return _0x23a9b6;})});}_0x1fa498=_[_0x2115('0x32')]({},_0x1fa498,_0x3d25e0[_0x2115('0x37')]);return db[_0x2115('0x59')][_0x2115('0x15')]({'where':_0x1fa498[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x37fbc7){_0x1f07df[_0x2115('0x15')]=_0x37fbc7;if(_0x3d25e0['query'][_0x2115('0x38')]){_0x1fa498[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x59')][_0x2115('0x3a')](_0x1fa498);})[_0x2115('0x1c')](function(_0x2b19dc){_0x1f07df['rows']=_0x2b19dc;return _0x1f07df;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x5835f3,_0x1fa498))[_0x2115('0x3b')](handleError(_0x5835f3,null));};exports[_0x2115('0x7b')]=function(_0x1a2898,_0x10bc0e,_0x4d8181){var _0x4a1c94,_0x290f5e;return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x1a2898[_0x2115('0x3c')]['id']}})['then'](handleEntityNotFound(_0x10bc0e,null))[_0x2115('0x1c')](function(_0x119968){if(_0x119968){_0x290f5e=_0x119968;return _0x119968['addBlackLists'](_0x1a2898[_0x2115('0x40')][_0x2115('0x5c')],_[_0x2115('0x48')](_0x1a2898['body'],[_0x2115('0x5c'),'id'])||{});}return null;})[_0x2115('0x5d')](function(_0xc88469){var _0x4064a3;_0x4a1c94=_0xc88469||[];var _0x2ccb5c=[];if(_0xc88469){for(var _0x36da75=0x0;_0x36da75<_0xc88469[_0x2115('0x3d')];_0x36da75+=0x1){var _0x1c3c5c=_0xc88469[_0x36da75]['get']({'plain':!![]});_0x4064a3=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x7c'))[_0x2115('0x63')](['phone',_0x2115('0x74'),_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel['select']()[_0x2115('0x67')](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')]('id',_0x2115('0x74'))[_0x2115('0x67')](_0x1c3c5c[_0x2115('0x6a')]['toString'](),_0x2115('0x65'))['field'](_0x1a2898[_0x2115('0x3c')]['id'][_0x2115('0x6b')](),'CampaignId')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))[_0x2115('0x67')]('NOW()',_0x2115('0x4a'))[_0x2115('0x6c')](_0x2115('0x75'))[_0x2115('0x33')]('deletedAt\x20IS\x20NULL')[_0x2115('0x33')]('ListId\x20=\x20?',_0x1c3c5c[_0x2115('0x6a')][_0x2115('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2115('0x6b')]();_0x2ccb5c[_0x2115('0x76')](db['sequelize'][_0x2115('0x29')](_0x4064a3));}return BPromise[_0x2115('0x78')](_0x2ccb5c);}})[_0x2115('0x1c')](function(){return _0x4a1c94;})[_0x2115('0x1c')](respondWithResult(_0x10bc0e,null))['catch'](handleError(_0x10bc0e,null));};exports['removeBlackLists']=function(_0x409772,_0x35a7d8,_0x31686f){return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x409772['params']['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x35a7d8,null))[_0x2115('0x1c')](function(_0x25b465){if(_0x25b465){return _0x25b465[_0x2115('0x7d')](_0x409772[_0x2115('0x29')][_0x2115('0x5c')]);}})[_0x2115('0x1c')](function(_0x1434fb){if(_0x1434fb){return db[_0x2115('0x58')][_0x2115('0x1d')]({'where':{'ListId':_0x409772[_0x2115('0x29')]['ids'],'CampaignId':_0x409772[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](function(){return _0x1434fb;});}})[_0x2115('0x1c')](respondWithStatusCode(_0x35a7d8,null))[_0x2115('0x3b')](handleError(_0x35a7d8,null));}; \ No newline at end of file +var _0x6584=['lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','reject','save','then','destroy','get','IvrCampaigns','error','stack','name','index','Campaign','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','options','count','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','getHoppers','CampaignId','map','CmHopper','rows','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','fromQuery','ListId\x20=\x20?','push','sequelize','removeLists','ids','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0x6584,0x175));var _0x4658=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x6584[_0x15bc81];return _0x59440e;};'use strict';var pdf=require(_0x4658('0x0'));var emlformat=require(_0x4658('0x1'));var rimraf=require(_0x4658('0x2'));var zipdir=require(_0x4658('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4658('0x4'));var moment=require(_0x4658('0x5'));var BPromise=require(_0x4658('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4658('0x7'));var sox=require(_0x4658('0x8'));var csv=require(_0x4658('0x9'));var ejs=require(_0x4658('0xa'));var fs=require('fs');var _=require(_0x4658('0xb'));var squel=require('squel');var crypto=require(_0x4658('0xc'));var jsforce=require(_0x4658('0xd'));var deskjs=require(_0x4658('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4658('0xf'));var Papa=require(_0x4658('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4658('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4658('0x12'))('api');var utils=require(_0x4658('0x13'));var config=require('../../config/environment');var db=require(_0x4658('0x14'))['db'];function respondWithStatusCode(_0x511c40,_0x29a06a){_0x29a06a=_0x29a06a||0xcc;return function(_0x243444){if(_0x243444){return _0x511c40[_0x4658('0x15')](_0x29a06a);}return _0x511c40[_0x4658('0x16')](_0x29a06a)[_0x4658('0x17')]();};}function respondWithResult(_0x41f611,_0x4cbafd){_0x4cbafd=_0x4cbafd||0xc8;return function(_0x4d3821){if(_0x4d3821){return _0x41f611[_0x4658('0x16')](_0x4cbafd)['json'](_0x4d3821);}};}function respondWithFilteredResult(_0x2a7ed1,_0x4ef78b){return function(_0x10c558){if(_0x10c558){var _0x2702b6=_0x10c558['count'],_0x4a506c=_0x4ef78b['offset'],_0x27aede=_0x4ef78b[_0x4658('0x18')]+_0x4ef78b['limit'],_0x56358b;if(_0x27aede>=_0x2702b6){_0x27aede=_0x2702b6;_0x56358b=0xc8;}else{_0x56358b=0xce;}_0x2a7ed1[_0x4658('0x16')](_0x56358b);return _0x2a7ed1[_0x4658('0x19')](_0x4658('0x1a'),_0x4a506c+'-'+_0x27aede+'/'+_0x2702b6)[_0x4658('0x1b')](_0x10c558);}return null;};}function patchUpdates(_0xeabb47){return function(_0x30bf0d){try{jsonpatch['apply'](_0x30bf0d,_0xeabb47,!![]);}catch(_0x5b4c93){return BPromise[_0x4658('0x1c')](_0x5b4c93);}return _0x30bf0d[_0x4658('0x1d')]();};}function saveUpdates(_0xb5b83e,_0x18581f){return function(_0x2e926f){if(_0x2e926f){return _0x2e926f['update'](_0xb5b83e)[_0x4658('0x1e')](function(_0x29a18f){return _0x29a18f;});}return null;};}function removeEntity(_0x2f623f,_0x56bfb1){return function(_0x2eb16d){if(_0x2eb16d){return _0x2eb16d[_0x4658('0x1f')]()[_0x4658('0x1e')](function(){var _0x3d8d65=_0x2eb16d[_0x4658('0x20')]({'plain':!![]});var _0x44f09a=_0x4658('0x21');return db['UserProfileResource'][_0x4658('0x1f')]({'where':{'type':_0x44f09a,'resourceId':_0x3d8d65['id']}})['then'](function(){return _0x2eb16d;});})[_0x4658('0x1e')](function(){_0x2f623f[_0x4658('0x16')](0xcc)[_0x4658('0x17')]();});}};}function handleEntityNotFound(_0x25ccb,_0x2f2f7a){return function(_0x58f99a){if(!_0x58f99a){_0x25ccb[_0x4658('0x15')](0x194);}return _0x58f99a;};}function handleError(_0x20586c,_0x36a9b7){_0x36a9b7=_0x36a9b7||0x1f4;return function(_0x39f885){logger[_0x4658('0x22')](_0x39f885[_0x4658('0x23')]);if(_0x39f885[_0x4658('0x24')]){delete _0x39f885[_0x4658('0x24')];}_0x20586c[_0x4658('0x16')](_0x36a9b7)['send'](_0x39f885);};}exports[_0x4658('0x25')]=function(_0x274edd,_0x36eaaa){var _0xb97c92={},_0x5dfa9c={},_0xb2a131={'count':0x0,'rows':[]};var _0x434e3f=db[_0x4658('0x26')][_0x4658('0x27')];_0x5dfa9c[_0x4658('0x28')]=_['keys'](_0x434e3f);_0x5dfa9c[_0x4658('0x29')]=_['keys'](_0x274edd[_0x4658('0x29')]);_0x5dfa9c[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0x5dfa9c['model'],_0x5dfa9c[_0x4658('0x29')]);_0xb97c92[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x5dfa9c[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x274edd[_0x4658('0x29')]['fields']));_0xb97c92[_0x4658('0x2c')]=_0xb97c92[_0x4658('0x2c')][_0x4658('0x2e')]?_0xb97c92[_0x4658('0x2c')]:_0x5dfa9c['model'];if(!_0x274edd[_0x4658('0x29')][_0x4658('0x2f')](_0x4658('0x30'))){_0xb97c92['limit']=qs['limit'](_0x274edd[_0x4658('0x29')][_0x4658('0x31')]);_0xb97c92[_0x4658('0x18')]=qs['offset'](_0x274edd[_0x4658('0x29')][_0x4658('0x18')]);}_0xb97c92[_0x4658('0x32')]=qs['sort'](_0x274edd[_0x4658('0x29')][_0x4658('0x33')]);_0xb97c92[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0x274edd[_0x4658('0x29')],_0x5dfa9c[_0x4658('0x2a')]));if(_0x274edd[_0x4658('0x29')][_0x4658('0x36')]){_0xb97c92[_0x4658('0x34')]=_[_0x4658('0x37')](_0xb97c92[_0x4658('0x34')],{'$or':_['map'](_0x434e3f,function(_0x3ae10d){if(_0x3ae10d[_0x4658('0x38')][_0x4658('0x39')]!=='VIRTUAL'){var _0x3b6177={};_0x3b6177[_0x3ae10d['field']]={'$like':'%'+_0x274edd[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x3b6177;}})});}_0xb97c92=_['merge']({},_0xb97c92,_0x274edd[_0x4658('0x3a')]);var _0x2b350a={'where':_0xb97c92[_0x4658('0x34')]};return db[_0x4658('0x26')][_0x4658('0x3b')](_0x2b350a)['then'](function(_0x169602){_0xb2a131['count']=_0x169602;if(_0x274edd[_0x4658('0x29')][_0x4658('0x3c')]){_0xb97c92[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x26')][_0x4658('0x3e')](_0xb97c92);})['then'](function(_0x6ab52d){_0xb2a131['rows']=_0x6ab52d;return _0xb2a131;})[_0x4658('0x1e')](respondWithFilteredResult(_0x36eaaa,_0xb97c92))['catch'](handleError(_0x36eaaa,null));};exports[_0x4658('0x3f')]=function(_0x716f9d,_0x3d2698){var _0x47011a={'raw':![],'where':{'id':_0x716f9d[_0x4658('0x40')]['id']}},_0x1eca32={};_0x1eca32[_0x4658('0x28')]=_['keys'](db[_0x4658('0x26')]['rawAttributes']);_0x1eca32[_0x4658('0x29')]=_[_0x4658('0x41')](_0x716f9d[_0x4658('0x29')]);_0x1eca32['filters']=_[_0x4658('0x2b')](_0x1eca32['model'],_0x1eca32['query']);_0x47011a[_0x4658('0x2c')]=_['intersection'](_0x1eca32[_0x4658('0x28')],qs['fields'](_0x716f9d[_0x4658('0x29')]['fields']));_0x47011a[_0x4658('0x2c')]=_0x47011a[_0x4658('0x2c')]['length']?_0x47011a[_0x4658('0x2c')]:_0x1eca32[_0x4658('0x28')];if(_0x716f9d['query'][_0x4658('0x3c')]){_0x47011a[_0x4658('0x3d')]=[{'all':!![]}];}_0x47011a=_['merge']({},_0x47011a,_0x716f9d[_0x4658('0x3a')]);return db[_0x4658('0x26')][_0x4658('0x42')](_0x47011a)[_0x4658('0x1e')](handleEntityNotFound(_0x3d2698,null))[_0x4658('0x1e')](respondWithResult(_0x3d2698,null))[_0x4658('0x43')](handleError(_0x3d2698,null));};exports[_0x4658('0x44')]=function(_0x474696,_0x1a0d3b){return db[_0x4658('0x26')][_0x4658('0x44')](_0x474696[_0x4658('0x45')],{})[_0x4658('0x1e')](function(_0x5b2156){var _0xe1deda=_0x474696['user']['get']({'plain':!![]});if(!_0xe1deda)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe1deda['role']===_0x4658('0x46')){var _0x3bc7e0=_0x5b2156[_0x4658('0x20')]({'plain':!![]});var _0x33fd80=_0x4658('0x21');return db['UserProfileSection'][_0x4658('0x42')]({'where':{'name':_0x33fd80,'userProfileId':_0xe1deda[_0x4658('0x47')]},'raw':!![]})['then'](function(_0x2a516d){if(_0x2a516d&&_0x2a516d[_0x4658('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3bc7e0['name'],'resourceId':_0x3bc7e0['id'],'type':_0x2a516d[_0x4658('0x24')],'sectionId':_0x2a516d['id']},{})[_0x4658('0x1e')](function(){return _0x5b2156;});}else{return _0x5b2156;}})[_0x4658('0x43')](function(_0x3f2f06){logger[_0x4658('0x22')](_0x4658('0x49'),_0x3f2f06);throw _0x3f2f06;});}return _0x5b2156;})['then'](respondWithResult(_0x1a0d3b,0xc9))[_0x4658('0x43')](handleError(_0x1a0d3b,null));};exports[_0x4658('0x4a')]=function(_0x2559f9,_0x3dd15d){var _0x2b2fca={'raw':![],'where':{'id':_0x2559f9['params']['id']}},_0x2f527f={};_0x2f527f[_0x4658('0x28')]=_[_0x4658('0x41')](db[_0x4658('0x26')][_0x4658('0x27')]);_0x2b2fca[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x2f527f[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x2559f9[_0x4658('0x29')][_0x4658('0x2d')]));_0x2b2fca['attributes']=_0x2b2fca[_0x4658('0x2c')][_0x4658('0x2e')]?_0x2b2fca['attributes']:_0x2f527f[_0x4658('0x28')];if(_0x2559f9[_0x4658('0x29')][_0x4658('0x3c')]){_0x2b2fca[_0x4658('0x3d')]=[{'all':!![]}];}_0x2b2fca=_[_0x4658('0x37')]({},_0x2b2fca,_0x2559f9[_0x4658('0x3a')]);return db['Campaign'][_0x4658('0x42')](_0x2b2fca)['then'](handleEntityNotFound(_0x3dd15d,null))['then'](function(_0x7b9a9c){if(_0x7b9a9c){var _0x53bf5f=_0x7b9a9c['get']({'plain':!![]});_0x53bf5f=qs[_0x4658('0x4b')](_0x53bf5f,['id',_0x4658('0x4c'),_0x4658('0x4d')]);_0x2559f9['body']=_['omit'](_0x2559f9[_0x4658('0x45')],['id',_0x4658('0x4c'),_0x4658('0x4d')]);return db['Campaign'][_0x4658('0x44')](_[_0x4658('0x37')](_0x53bf5f,_0x2559f9['body']),{'include':_0x2559f9[_0x4658('0x29')][_0x4658('0x3c')]?[{'all':!![]}]:undefined})[_0x4658('0x1e')](function(_0x270b6b){var _0x351a25=_0x2559f9[_0x4658('0x46')][_0x4658('0x20')]({'plain':!![]});if(!_0x351a25)throw new Error(_0x4658('0x4e'));if(_0x351a25['role']===_0x4658('0x46')){var _0x369620=_0x270b6b[_0x4658('0x20')]({'plain':!![]});var _0x1fdfce=_0x4658('0x21');return db[_0x4658('0x4f')][_0x4658('0x42')]({'where':{'name':_0x1fdfce,'userProfileId':_0x351a25[_0x4658('0x47')]},'raw':!![]})[_0x4658('0x1e')](function(_0x4bbf50){if(_0x4bbf50&&_0x4bbf50[_0x4658('0x48')]===0x0){return db[_0x4658('0x50')][_0x4658('0x44')]({'name':_0x369620[_0x4658('0x24')],'resourceId':_0x369620['id'],'type':_0x4bbf50['name'],'sectionId':_0x4bbf50['id']},{})[_0x4658('0x1e')](function(){return _0x270b6b;});}else{return _0x270b6b;}})['catch'](function(_0x5b0a63){logger[_0x4658('0x22')](_0x4658('0x49'),_0x5b0a63);throw _0x5b0a63;});}return _0x270b6b;});}})['then'](respondWithResult(_0x3dd15d,0xc9))['catch'](handleError(_0x3dd15d,null));};exports['update']=function(_0x2148c5,_0x1ab4b4){if(_0x2148c5[_0x4658('0x45')]['id']){delete _0x2148c5['body']['id'];}return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x2148c5['params']['id']}})['then'](handleEntityNotFound(_0x1ab4b4,null))['then'](saveUpdates(_0x2148c5[_0x4658('0x45')],null))[_0x4658('0x1e')](respondWithResult(_0x1ab4b4,null))[_0x4658('0x43')](handleError(_0x1ab4b4,null));};exports[_0x4658('0x1f')]=function(_0x145ac6,_0x3a93bc){return db['Campaign']['find']({'where':{'id':_0x145ac6[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x3a93bc,null))[_0x4658('0x1e')](removeEntity(_0x3a93bc,null))['catch'](handleError(_0x3a93bc,null));};exports[_0x4658('0x51')]=function(_0x56d6e9,_0x3dd17a,_0xf1c264){var _0x54c47b={'raw':!![],'where':{}};var _0x47ad80={};var _0x590b25={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x56d6e9[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x3dd17a,null))[_0x4658('0x1e')](function(_0x238a07){if(_0x238a07){_0x47ad80['model']=_[_0x4658('0x41')](db['CmHopper']['rawAttributes']);_0x47ad80[_0x4658('0x29')]=_[_0x4658('0x41')](_0x56d6e9[_0x4658('0x29')]);_0x47ad80[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0x47ad80[_0x4658('0x28')],_0x47ad80[_0x4658('0x29')]);_0x54c47b[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x47ad80[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x56d6e9[_0x4658('0x29')][_0x4658('0x2d')]));_0x54c47b[_0x4658('0x2c')]=_0x54c47b[_0x4658('0x2c')]['length']?_0x54c47b[_0x4658('0x2c')]:_0x47ad80[_0x4658('0x28')];if(!_0x56d6e9[_0x4658('0x29')][_0x4658('0x2f')](_0x4658('0x30'))){_0x54c47b['limit']=qs['limit'](_0x56d6e9[_0x4658('0x29')][_0x4658('0x31')]);_0x54c47b[_0x4658('0x18')]=qs[_0x4658('0x18')](_0x56d6e9[_0x4658('0x29')][_0x4658('0x18')]);}_0x54c47b['order']=qs['sort'](_0x56d6e9[_0x4658('0x29')][_0x4658('0x33')]);_0x54c47b[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0x56d6e9[_0x4658('0x29')],_0x47ad80['filters']));_0x54c47b[_0x4658('0x34')][_0x4658('0x52')]=_0x238a07['id'];if(_0x56d6e9[_0x4658('0x29')][_0x4658('0x36')]){_0x54c47b[_0x4658('0x34')]=_[_0x4658('0x37')](_0x54c47b[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x54c47b[_0x4658('0x2c')],function(_0x15d7f8){var _0x5071a1={};_0x5071a1[_0x15d7f8]={'$like':'%'+_0x56d6e9[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x5071a1;})});}_0x54c47b=_[_0x4658('0x37')]({},_0x54c47b,_0x56d6e9['options']);return db[_0x4658('0x54')][_0x4658('0x3b')]({'where':_0x54c47b[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x5ce3bb){_0x590b25[_0x4658('0x3b')]=_0x5ce3bb;if(_0x56d6e9['query']['includeAll']){_0x54c47b[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x54')]['findAll'](_0x54c47b);})['then'](function(_0x109871){_0x590b25[_0x4658('0x55')]=_0x109871;return _0x590b25;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x3dd17a,_0x54c47b))[_0x4658('0x43')](handleError(_0x3dd17a,null));};exports['getHopperHistories']=function(_0x448bd5,_0x14aecf,_0x30d46e){var _0x39ade1={'raw':!![],'where':{}};var _0xff4f5e={};var _0x26eea8={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x448bd5[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x14aecf,null))['then'](function(_0x11a625){if(_0x11a625){_0xff4f5e['model']=_['keys'](db[_0x4658('0x56')][_0x4658('0x27')]);_0xff4f5e['query']=_[_0x4658('0x41')](_0x448bd5[_0x4658('0x29')]);_0xff4f5e[_0x4658('0x2a')]=_['intersection'](_0xff4f5e[_0x4658('0x28')],_0xff4f5e[_0x4658('0x29')]);_0x39ade1[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0xff4f5e['model'],qs['fields'](_0x448bd5[_0x4658('0x29')][_0x4658('0x2d')]));_0x39ade1[_0x4658('0x2c')]=_0x39ade1[_0x4658('0x2c')]['length']?_0x39ade1[_0x4658('0x2c')]:_0xff4f5e[_0x4658('0x28')];if(!_0x448bd5['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x39ade1[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x448bd5[_0x4658('0x29')][_0x4658('0x31')]);_0x39ade1[_0x4658('0x18')]=qs[_0x4658('0x18')](_0x448bd5[_0x4658('0x29')][_0x4658('0x18')]);}_0x39ade1[_0x4658('0x32')]=qs['sort'](_0x448bd5[_0x4658('0x29')][_0x4658('0x33')]);_0x39ade1[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x448bd5[_0x4658('0x29')],_0xff4f5e['filters']));_0x39ade1[_0x4658('0x34')][_0x4658('0x52')]=_0x11a625['id'];if(_0x448bd5[_0x4658('0x29')][_0x4658('0x36')]){_0x39ade1[_0x4658('0x34')]=_[_0x4658('0x37')](_0x39ade1[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x39ade1['attributes'],function(_0x50f427){var _0x2e9716={};_0x2e9716[_0x50f427]={'$like':'%'+_0x448bd5['query']['filter']+'%'};return _0x2e9716;})});}_0x39ade1=_['merge']({},_0x39ade1,_0x448bd5[_0x4658('0x3a')]);return db[_0x4658('0x56')][_0x4658('0x3b')]({'where':_0x39ade1[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x3252b0){_0x26eea8[_0x4658('0x3b')]=_0x3252b0;if(_0x448bd5['query'][_0x4658('0x3c')]){_0x39ade1['include']=[{'all':!![]}];}return db[_0x4658('0x56')][_0x4658('0x3e')](_0x39ade1);})['then'](function(_0x295367){_0x26eea8['rows']=_0x295367;return _0x26eea8;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x14aecf,_0x39ade1))['catch'](handleError(_0x14aecf,null));};exports[_0x4658('0x57')]=function(_0x8d42ee,_0x12c5ac,_0x144eb4){var _0x16848d={'raw':!![],'where':{}};var _0xafb836={};var _0x5413e5={'count':0x0,'rows':[]};return db[_0x4658('0x26')][_0x4658('0x58')]({'where':{'id':_0x8d42ee[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x12c5ac,null))['then'](function(_0x732d3a){if(_0x732d3a){_0xafb836[_0x4658('0x28')]=_[_0x4658('0x41')](db[_0x4658('0x59')][_0x4658('0x27')]);_0xafb836[_0x4658('0x29')]=_['keys'](_0x8d42ee[_0x4658('0x29')]);_0xafb836[_0x4658('0x2a')]=_[_0x4658('0x2b')](_0xafb836[_0x4658('0x28')],_0xafb836[_0x4658('0x29')]);_0x16848d[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0xafb836['model'],qs[_0x4658('0x2d')](_0x8d42ee[_0x4658('0x29')]['fields']));_0x16848d[_0x4658('0x2c')]=_0x16848d[_0x4658('0x2c')][_0x4658('0x2e')]?_0x16848d[_0x4658('0x2c')]:_0xafb836[_0x4658('0x28')];if(!_0x8d42ee['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x16848d[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x8d42ee['query']['limit']);_0x16848d[_0x4658('0x18')]=qs['offset'](_0x8d42ee[_0x4658('0x29')]['offset']);}_0x16848d[_0x4658('0x32')]=qs['sort'](_0x8d42ee[_0x4658('0x29')][_0x4658('0x33')]);_0x16848d[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x8d42ee[_0x4658('0x29')],_0xafb836[_0x4658('0x2a')]));_0x16848d[_0x4658('0x34')]['CampaignId']=_0x732d3a['id'];if(_0x8d42ee[_0x4658('0x29')][_0x4658('0x36')]){_0x16848d['where']=_[_0x4658('0x37')](_0x16848d[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x16848d['attributes'],function(_0x19b155){var _0x54b458={};_0x54b458[_0x19b155]={'$like':'%'+_0x8d42ee[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x54b458;})});}_0x16848d=_[_0x4658('0x37')]({},_0x16848d,_0x8d42ee[_0x4658('0x3a')]);return db[_0x4658('0x59')]['count']({'where':_0x16848d[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x53f214){_0x5413e5['count']=_0x53f214;if(_0x8d42ee[_0x4658('0x29')][_0x4658('0x3c')]){_0x16848d[_0x4658('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4658('0x3e')](_0x16848d);})[_0x4658('0x1e')](function(_0x518be2){_0x5413e5[_0x4658('0x55')]=_0x518be2;return _0x5413e5;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x12c5ac,_0x16848d))[_0x4658('0x43')](handleError(_0x12c5ac,null));};exports[_0x4658('0x5a')]=function(_0x33d6ea,_0x4bc89e,_0x442eb5){var _0x103129={'raw':!![],'where':{}};var _0x48e72c={};var _0x3cd969={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x33d6ea['params']['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x4bc89e,null))[_0x4658('0x1e')](function(_0x558f77){if(_0x558f77){_0x48e72c['model']=_[_0x4658('0x41')](db[_0x4658('0x5b')][_0x4658('0x27')]);_0x48e72c[_0x4658('0x29')]=_[_0x4658('0x41')](_0x33d6ea[_0x4658('0x29')]);_0x48e72c['filters']=_['intersection'](_0x48e72c[_0x4658('0x28')],_0x48e72c[_0x4658('0x29')]);_0x103129[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x48e72c[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x33d6ea[_0x4658('0x29')][_0x4658('0x2d')]));_0x103129[_0x4658('0x2c')]=_0x103129['attributes'][_0x4658('0x2e')]?_0x103129[_0x4658('0x2c')]:_0x48e72c['model'];if(!_0x33d6ea[_0x4658('0x29')][_0x4658('0x2f')]('nolimit')){_0x103129[_0x4658('0x31')]=qs[_0x4658('0x31')](_0x33d6ea['query'][_0x4658('0x31')]);_0x103129['offset']=qs['offset'](_0x33d6ea[_0x4658('0x29')]['offset']);}_0x103129[_0x4658('0x32')]=qs['sort'](_0x33d6ea[_0x4658('0x29')]['sort']);_0x103129[_0x4658('0x34')]=qs[_0x4658('0x2a')](_['pick'](_0x33d6ea[_0x4658('0x29')],_0x48e72c[_0x4658('0x2a')]));_0x103129['where'][_0x4658('0x52')]=_0x558f77['id'];if(_0x33d6ea['query']['filter']){_0x103129[_0x4658('0x34')]=_[_0x4658('0x37')](_0x103129['where'],{'$or':_['map'](_0x103129[_0x4658('0x2c')],function(_0x1a88ea){var _0x509e8c={};_0x509e8c[_0x1a88ea]={'$like':'%'+_0x33d6ea[_0x4658('0x29')]['filter']+'%'};return _0x509e8c;})});}_0x103129=_[_0x4658('0x37')]({},_0x103129,_0x33d6ea[_0x4658('0x3a')]);return db[_0x4658('0x5b')][_0x4658('0x3b')]({'where':_0x103129['where']})[_0x4658('0x1e')](function(_0x39ca44){_0x3cd969[_0x4658('0x3b')]=_0x39ca44;if(_0x33d6ea[_0x4658('0x29')]['includeAll']){_0x103129[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x5b')][_0x4658('0x3e')](_0x103129);})[_0x4658('0x1e')](function(_0x2217e1){_0x3cd969[_0x4658('0x55')]=_0x2217e1;return _0x3cd969;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0x4bc89e,_0x103129))[_0x4658('0x43')](handleError(_0x4bc89e,null));};exports['getLists']=function(_0xb681a5,_0x17f9b5,_0x2ff080){var _0x492044={};var _0x490689={};var _0x6fc227;var _0x17ee93;return db[_0x4658('0x26')][_0x4658('0x58')]({'where':{'id':_0xb681a5[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x17f9b5,null))[_0x4658('0x1e')](function(_0x40d84e){if(_0x40d84e){_0x6fc227=_0x40d84e;_0x490689[_0x4658('0x28')]=_[_0x4658('0x41')](db['CmList']['rawAttributes']);_0x490689[_0x4658('0x29')]=_[_0x4658('0x41')](_0xb681a5[_0x4658('0x29')]);_0x490689['filters']=_[_0x4658('0x2b')](_0x490689[_0x4658('0x28')],_0x490689[_0x4658('0x29')]);_0x492044[_0x4658('0x2c')]=_[_0x4658('0x2b')](_0x490689['model'],qs['fields'](_0xb681a5[_0x4658('0x29')][_0x4658('0x2d')]));_0x492044['attributes']=_0x492044[_0x4658('0x2c')][_0x4658('0x2e')]?_0x492044[_0x4658('0x2c')]:_0x490689['model'];_0x492044['order']=qs[_0x4658('0x33')](_0xb681a5[_0x4658('0x29')][_0x4658('0x33')]);_0x492044[_0x4658('0x34')]=qs[_0x4658('0x2a')](_[_0x4658('0x35')](_0xb681a5[_0x4658('0x29')],_0x490689['filters']));if(_0xb681a5[_0x4658('0x29')][_0x4658('0x36')]){_0x492044[_0x4658('0x34')]=_[_0x4658('0x37')](_0x492044[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x492044[_0x4658('0x2c')],function(_0x48200f){var _0x2893ba={};_0x2893ba[_0x48200f]={'$like':'%'+_0xb681a5['query'][_0x4658('0x36')]+'%'};return _0x2893ba;})});}_0x492044=_['merge']({},_0x492044,_0xb681a5[_0x4658('0x3a')]);return _0x6fc227[_0x4658('0x5c')](_0x492044);}})[_0x4658('0x1e')](function(_0x322130){if(_0x322130){_0x17ee93=_0x322130['length'];if(!_0xb681a5[_0x4658('0x29')]['hasOwnProperty'](_0x4658('0x30'))){_0x492044['limit']=qs['limit'](_0xb681a5[_0x4658('0x29')][_0x4658('0x31')]);_0x492044[_0x4658('0x18')]=qs[_0x4658('0x18')](_0xb681a5[_0x4658('0x29')]['offset']);}return _0x6fc227[_0x4658('0x5c')](_0x492044);}})[_0x4658('0x1e')](function(_0x3197ff){if(_0x3197ff){return _0x3197ff?{'count':_0x17ee93,'rows':_0x3197ff}:null;}})['then'](respondWithResult(_0x17f9b5,null))[_0x4658('0x43')](handleError(_0x17f9b5,null));};exports['addLists']=function(_0x14505b,_0x5e96c1,_0xf9af2e){var _0x204be9,_0x1de01e;return db['Campaign'][_0x4658('0x42')]({'where':{'id':_0x14505b[_0x4658('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e96c1,null))['then'](function(_0x2dd9cc){if(_0x2dd9cc){_0x1de01e=_0x2dd9cc;return _0x2dd9cc[_0x4658('0x5d')](_0x14505b[_0x4658('0x45')]['ids'],_[_0x4658('0x4b')](_0x14505b[_0x4658('0x45')],['ids','id'])||{});}return null;})[_0x4658('0x5e')](function(_0x37f03b){var _0x4a312e;_0x204be9=_0x37f03b||[];var _0x59b974=[];if(_0x37f03b){for(var _0x4ebd30=0x0;_0x4ebd30<_0x37f03b[_0x4658('0x2e')];_0x4ebd30+=0x1){var _0x159fa8=_0x37f03b[_0x4ebd30][_0x4658('0x20')]({'plain':!![]});_0x1de01e[_0x4658('0x5f')]=_0x14505b[_0x4658('0x45')]['dialCheckDuplicateType']?_0x14505b[_0x4658('0x45')][_0x4658('0x5f')]:_0x1de01e[_0x4658('0x5f')];switch(_0x1de01e[_0x4658('0x5f')]){case _0x4658('0x60'):_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')](_0x4658('0x63'))['fromQuery']([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),_0x4658('0x67'),'CampaignId',_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()[_0x4658('0x69')]('phone','phone')[_0x4658('0x69')]('NOW()',_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))['field'](_0x159fa8['CmListId'][_0x4658('0x6a')](),'ListId')[_0x4658('0x69')](_0x14505b[_0x4658('0x40')]['id'][_0x4658('0x6a')](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')]('NOW()',_0x4658('0x4d'))[_0x4658('0x6c')]('cm_contacts')[_0x4658('0x34')](_0x4658('0x6d'))[_0x4658('0x34')]('ListId\x20=\x20?',_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f'))[_0x4658('0x34')](_0x4658('0x70'),squel['select']()[_0x4658('0x69')](_0x4658('0x71'))[_0x4658('0x6c')]('cm_hopper_final')[_0x4658('0x34')](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']()))[_0x4658('0x34')](_0x4658('0x70'),squel[_0x4658('0x68')]()[_0x4658('0x69')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']())))[_0x4658('0x6a')]();break;case _0x4658('0x73'):_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')]('cm_hopper')['fromQuery']([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),'ListId',_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()['field']('phone',_0x4658('0x64'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))[_0x4658('0x69')](_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')](),_0x4658('0x67'))[_0x4658('0x69')](_0x14505b['params']['id']['toString'](),_0x4658('0x52'))[_0x4658('0x69')]('NOW()',_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))['from'](_0x4658('0x74'))['where']('deletedAt\x20IS\x20NULL')[_0x4658('0x34')]('ListId\x20=\x20?',_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f'))[_0x4658('0x34')](_0x4658('0x70'),squel[_0x4658('0x68')]()[_0x4658('0x69')](_0x4658('0x75'))['from'](_0x4658('0x63'))['where'](_0x4658('0x72'),_0x14505b[_0x4658('0x40')]['id']['toString']())))['toString']();break;default:_0x4a312e=squel[_0x4658('0x61')]()[_0x4658('0x62')](_0x4658('0x63'))[_0x4658('0x76')]([_0x4658('0x64'),_0x4658('0x65'),_0x4658('0x66'),_0x4658('0x67'),_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()['field'](_0x4658('0x64'),_0x4658('0x64'))[_0x4658('0x69')]('NOW()',_0x4658('0x65'))[_0x4658('0x69')]('id',_0x4658('0x66'))['field'](_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')](),_0x4658('0x67'))['field'](_0x14505b['params']['id']['toString'](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))[_0x4658('0x6c')](_0x4658('0x74'))[_0x4658('0x34')](_0x4658('0x6d'))[_0x4658('0x34')](_0x4658('0x77'),_0x159fa8[_0x4658('0x6e')][_0x4658('0x6a')]())[_0x4658('0x34')](_0x4658('0x6f')))[_0x4658('0x6a')]();}_0x59b974[_0x4658('0x78')](db[_0x4658('0x79')][_0x4658('0x29')](_0x4a312e));}return BPromise['all'](_0x59b974);}})['then'](function(){return _0x204be9;})['then'](respondWithResult(_0x5e96c1,null))[_0x4658('0x43')](handleError(_0x5e96c1,null));};exports['removeLists']=function(_0x54d3cc,_0x40f2b5,_0xe19a11){return db[_0x4658('0x26')]['find']({'where':{'id':_0x54d3cc[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x40f2b5,null))[_0x4658('0x1e')](function(_0x3f7d61){if(_0x3f7d61){return _0x3f7d61[_0x4658('0x7a')](_0x54d3cc['query'][_0x4658('0x7b')]);}})[_0x4658('0x1e')](function(_0x3f2776){if(_0x3f2776){return db[_0x4658('0x54')][_0x4658('0x1f')]({'where':{'ListId':_0x54d3cc[_0x4658('0x29')]['ids'],'CampaignId':_0x54d3cc[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](function(){return _0x3f2776;});}})[_0x4658('0x1e')](respondWithStatusCode(_0x40f2b5,null))[_0x4658('0x43')](handleError(_0x40f2b5,null));};exports['getBlackLists']=function(_0x1333b1,_0xfcf7ac,_0x8bc559){var _0x302547={'raw':!![],'where':{}};var _0x497806={};var _0x4e78dd={'count':0x0,'rows':[]};return db[_0x4658('0x26')]['findOne']({'where':{'id':_0x1333b1[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0xfcf7ac,null))[_0x4658('0x1e')](function(_0x508bcc){if(_0x508bcc){_0x497806[_0x4658('0x28')]=_['keys'](db[_0x4658('0x7c')][_0x4658('0x27')]);_0x497806[_0x4658('0x29')]=_[_0x4658('0x41')](_0x1333b1[_0x4658('0x29')]);_0x497806['filters']=_[_0x4658('0x2b')](_0x497806[_0x4658('0x28')],_0x497806[_0x4658('0x29')]);_0x302547['attributes']=_[_0x4658('0x2b')](_0x497806[_0x4658('0x28')],qs[_0x4658('0x2d')](_0x1333b1[_0x4658('0x29')][_0x4658('0x2d')]));_0x302547['attributes']=_0x302547[_0x4658('0x2c')][_0x4658('0x2e')]?_0x302547[_0x4658('0x2c')]:_0x497806['model'];if(!_0x1333b1['query'][_0x4658('0x2f')](_0x4658('0x30'))){_0x302547['limit']=qs[_0x4658('0x31')](_0x1333b1[_0x4658('0x29')][_0x4658('0x31')]);_0x302547['offset']=qs[_0x4658('0x18')](_0x1333b1[_0x4658('0x29')][_0x4658('0x18')]);}_0x302547[_0x4658('0x32')]=qs[_0x4658('0x33')](_0x1333b1[_0x4658('0x29')]['sort']);_0x302547[_0x4658('0x34')]=qs['filters'](_[_0x4658('0x35')](_0x1333b1['query'],_0x497806['filters']));_0x302547['where'][_0x4658('0x52')]=_0x508bcc['id'];if(_0x1333b1[_0x4658('0x29')][_0x4658('0x36')]){_0x302547[_0x4658('0x34')]=_[_0x4658('0x37')](_0x302547[_0x4658('0x34')],{'$or':_[_0x4658('0x53')](_0x302547['attributes'],function(_0x515e56){var _0x4c877b={};_0x4c877b[_0x515e56]={'$like':'%'+_0x1333b1[_0x4658('0x29')][_0x4658('0x36')]+'%'};return _0x4c877b;})});}_0x302547=_[_0x4658('0x37')]({},_0x302547,_0x1333b1[_0x4658('0x3a')]);return db['CmList'][_0x4658('0x3b')]({'where':_0x302547[_0x4658('0x34')]})[_0x4658('0x1e')](function(_0x37baa6){_0x4e78dd['count']=_0x37baa6;if(_0x1333b1[_0x4658('0x29')][_0x4658('0x3c')]){_0x302547[_0x4658('0x3d')]=[{'all':!![]}];}return db[_0x4658('0x7c')][_0x4658('0x3e')](_0x302547);})[_0x4658('0x1e')](function(_0x2ec1a4){_0x4e78dd['rows']=_0x2ec1a4;return _0x4e78dd;});}})[_0x4658('0x1e')](respondWithFilteredResult(_0xfcf7ac,_0x302547))[_0x4658('0x43')](handleError(_0xfcf7ac,null));};exports[_0x4658('0x7d')]=function(_0x58505d,_0x353fab,_0x57b32b){var _0x27ead6,_0x5378b3;return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x58505d[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x353fab,null))[_0x4658('0x1e')](function(_0x3eb9c0){if(_0x3eb9c0){_0x5378b3=_0x3eb9c0;return _0x3eb9c0[_0x4658('0x7d')](_0x58505d[_0x4658('0x45')][_0x4658('0x7b')],_['omit'](_0x58505d[_0x4658('0x45')],[_0x4658('0x7b'),'id'])||{});}return null;})[_0x4658('0x5e')](function(_0x1007bb){var _0x3d1ffd;_0x27ead6=_0x1007bb||[];var _0x5e6ed5=[];if(_0x1007bb){for(var _0x370fac=0x0;_0x370fac<_0x1007bb[_0x4658('0x2e')];_0x370fac+=0x1){var _0x519999=_0x1007bb[_0x370fac]['get']({'plain':!![]});_0x3d1ffd=squel['insert']()[_0x4658('0x62')](_0x4658('0x7e'))[_0x4658('0x76')]([_0x4658('0x64'),'ContactId',_0x4658('0x67'),_0x4658('0x52'),_0x4658('0x4c'),_0x4658('0x4d')],squel[_0x4658('0x68')]()[_0x4658('0x69')](_0x4658('0x64'),_0x4658('0x64'))[_0x4658('0x69')]('id',_0x4658('0x66'))[_0x4658('0x69')](_0x519999[_0x4658('0x6e')][_0x4658('0x6a')](),'ListId')['field'](_0x58505d[_0x4658('0x40')]['id'][_0x4658('0x6a')](),_0x4658('0x52'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4c'))[_0x4658('0x69')](_0x4658('0x6b'),_0x4658('0x4d'))[_0x4658('0x6c')](_0x4658('0x74'))[_0x4658('0x34')]('deletedAt\x20IS\x20NULL')[_0x4658('0x34')](_0x4658('0x77'),_0x519999[_0x4658('0x6e')][_0x4658('0x6a')]())['where'](_0x4658('0x6f')))['toString']();_0x5e6ed5[_0x4658('0x78')](db[_0x4658('0x79')][_0x4658('0x29')](_0x3d1ffd));}return BPromise['all'](_0x5e6ed5);}})[_0x4658('0x1e')](function(){return _0x27ead6;})[_0x4658('0x1e')](respondWithResult(_0x353fab,null))[_0x4658('0x43')](handleError(_0x353fab,null));};exports[_0x4658('0x7f')]=function(_0x3bcf72,_0x335d92,_0x8e6b14){return db[_0x4658('0x26')][_0x4658('0x42')]({'where':{'id':_0x3bcf72[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](handleEntityNotFound(_0x335d92,null))['then'](function(_0x353c26){if(_0x353c26){return _0x353c26[_0x4658('0x7f')](_0x3bcf72[_0x4658('0x29')][_0x4658('0x7b')]);}})['then'](function(_0x173d0b){if(_0x173d0b){return db[_0x4658('0x5b')]['destroy']({'where':{'ListId':_0x3bcf72[_0x4658('0x29')][_0x4658('0x7b')],'CampaignId':_0x3bcf72[_0x4658('0x40')]['id']}})[_0x4658('0x1e')](function(){return _0x173d0b;});}})['then'](respondWithStatusCode(_0x335d92,null))[_0x4658('0x43')](handleError(_0x335d92,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index e5618ed..c28511f 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 _0xd406=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./campaign.attributes','exports','define'];(function(_0x27eeca,_0x1315f9){var _0xe87e2f=function(_0x5ce1e3){while(--_0x5ce1e3){_0x27eeca['push'](_0x27eeca['shift']());}};_0xe87e2f(++_0x1315f9);}(_0xd406,0x1dd));var _0x6d40=function(_0x3ba494,_0x39d455){_0x3ba494=_0x3ba494-0x0;var _0x2fe486=_0xd406[_0x3ba494];return _0x2fe486;};'use strict';var _=require('lodash');var util=require(_0x6d40('0x0'));var logger=require(_0x6d40('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6d40('0x2'));var rp=require(_0x6d40('0x3'));var fs=require('fs');var path=require(_0x6d40('0x4'));var rimraf=require('rimraf');var config=require(_0x6d40('0x5'));var attributes=require(_0x6d40('0x6'));module[_0x6d40('0x7')]=function(_0x3d527a,_0x49fb9f){return _0x3d527a[_0x6d40('0x8')]('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcb6=['../../config/logger','api','moment','request-promise','path','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xfcb6,0xa7));var _0x6fcb=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0xfcb6[_0x2caaef];return _0xd011f8;};'use strict';var _=require(_0x6fcb('0x0'));var util=require('util');var logger=require(_0x6fcb('0x1'))(_0x6fcb('0x2'));var moment=require(_0x6fcb('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fcb('0x4'));var fs=require('fs');var path=require(_0x6fcb('0x5'));var rimraf=require('rimraf');var config=require(_0x6fcb('0x6'));var attributes=require(_0x6fcb('0x7'));module[_0x6fcb('0x8')]=function(_0x1b5f17,_0x956bdf){return _0x1b5f17[_0x6fcb('0x9')](_0x6fcb('0xa'),attributes,{'tableName':_0x6fcb('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 fdcdc9a..e5ba7fb 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 _0x656e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2f8297,_0x555956){var _0x2b3580=function(_0x47e085){while(--_0x47e085){_0x2f8297['push'](_0x2f8297['shift']());}};_0x2b3580(++_0x555956);}(_0x656e,0xa3));var _0xe656=function(_0x404a11,_0x5d5647){_0x404a11=_0x404a11-0x0;var _0x471865=_0x656e[_0x404a11];return _0x471865;};'use strict';var _=require(_0xe656('0x0'));var util=require(_0xe656('0x1'));var moment=require(_0xe656('0x2'));var BPromise=require(_0xe656('0x3'));var rs=require(_0xe656('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe656('0x5'))['db'];var utils=require(_0xe656('0x6'));var logger=require('../../config/logger')(_0xe656('0x7'));var config=require(_0xe656('0x8'));var jayson=require(_0xe656('0x9'));var client=jayson[_0xe656('0xa')][_0xe656('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x375b9b,_0x2b6d83,_0x1c43ee){return new BPromise(function(_0x1539f1,_0x159245){return client[_0xe656('0xc')](_0x375b9b,_0x1c43ee)[_0xe656('0xd')](function(_0x19a64f){logger[_0xe656('0xe')](_0xe656('0xf'),_0x2b6d83,_0xe656('0x10'));logger[_0xe656('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2b6d83,'request\x20sent',JSON[_0xe656('0x12')](_0x19a64f));if(_0x19a64f[_0xe656('0x13')]){if(_0x19a64f[_0xe656('0x13')][_0xe656('0x14')]===0x1f4){logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x19a64f[_0xe656('0x13')]['message']);return _0x159245(_0x19a64f[_0xe656('0x13')][_0xe656('0x15')]);}logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x19a64f[_0xe656('0x13')]['message']);return _0x1539f1(_0x19a64f[_0xe656('0x13')]['message']);}else{logger[_0xe656('0xe')]('Campaign,\x20%s,\x20%s',_0x2b6d83,_0xe656('0x10'));_0x1539f1(_0x19a64f['result'][_0xe656('0x15')]);}})[_0xe656('0x16')](function(_0x346f9c){logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x346f9c);_0x159245(_0x346f9c);});});}exports[_0xe656('0x17')]=function(_0x2c4da5){var _0x1bf17f=this;return new Promise(function(_0x571df0,_0x80e691){return db[_0xe656('0x18')][_0xe656('0x19')]({'raw':_0x2c4da5[_0xe656('0x1a')]?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1c')]||null:null,'attributes':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1d')]||null:null,'limit':_0x2c4da5[_0xe656('0x1a')]?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1e')]||null:null,'include':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1f')]?_[_0xe656('0x20')](_0x2c4da5['options'][_0xe656('0x1f')],function(_0x419d2b){return{'model':db[_0x419d2b[_0xe656('0x21')]],'as':_0x419d2b['as'],'attributes':_0x419d2b[_0xe656('0x1d')],'include':_0x419d2b['include']?_[_0xe656('0x20')](_0x419d2b[_0xe656('0x1f')],function(_0x5d8206){return{'model':db[_0x5d8206[_0xe656('0x21')]],'as':_0x5d8206['as'],'attributes':_0x5d8206[_0xe656('0x1d')],'include':_0x5d8206[_0xe656('0x1f')]?_[_0xe656('0x20')](_0x5d8206['include'],function(_0x36e4fb){return{'model':db[_0x36e4fb[_0xe656('0x21')]],'as':_0x36e4fb['as'],'attributes':_0x36e4fb[_0xe656('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe656('0xd')](function(_0x2d93f8){logger['info'](_0xe656('0x17'),_0x2c4da5);logger[_0xe656('0x11')]('GetCampaign',_0x2c4da5,JSON[_0xe656('0x12')](_0x2d93f8));_0x571df0(_0x2d93f8);})[_0xe656('0x16')](function(_0x503725){logger[_0xe656('0x13')](_0xe656('0x17'),_0x503725[_0xe656('0x15')],_0x2c4da5);_0x80e691(_0x1bf17f[_0xe656('0x13')](0x1f4,_0x503725[_0xe656('0x15')]));});});}; \ No newline at end of file +var _0x0d74=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','info','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x35c2ba,_0x6de538){var _0x434b21=function(_0x5da562){while(--_0x5da562){_0x35c2ba['push'](_0x35c2ba['shift']());}};_0x434b21(++_0x6de538);}(_0x0d74,0x15d));var _0x40d7=function(_0x1acf22,_0x52c719){_0x1acf22=_0x1acf22-0x0;var _0x362e9e=_0x0d74[_0x1acf22];return _0x362e9e;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require(_0x40d7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require(_0x40d7('0x4'))['db'];var utils=require(_0x40d7('0x5'));var logger=require(_0x40d7('0x6'))(_0x40d7('0x7'));var config=require(_0x40d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e7a7d,_0x6ce9f9,_0x269657){return new BPromise(function(_0x48aed7,_0x4a1ff6){return client[_0x40d7('0xa')](_0x1e7a7d,_0x269657)[_0x40d7('0xb')](function(_0x309cdb){logger['info']('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x40d7('0xc'));logger[_0x40d7('0xd')](_0x40d7('0xe'),_0x6ce9f9,_0x40d7('0xc'),JSON['stringify'](_0x309cdb));if(_0x309cdb[_0x40d7('0xf')]){if(_0x309cdb[_0x40d7('0xf')][_0x40d7('0x10')]===0x1f4){logger[_0x40d7('0xf')]('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x309cdb[_0x40d7('0xf')]['message']);return _0x4a1ff6(_0x309cdb['error'][_0x40d7('0x11')]);}logger[_0x40d7('0xf')](_0x40d7('0x12'),_0x6ce9f9,_0x309cdb[_0x40d7('0xf')][_0x40d7('0x11')]);return _0x48aed7(_0x309cdb[_0x40d7('0xf')][_0x40d7('0x11')]);}else{logger[_0x40d7('0x13')]('Campaign,\x20%s,\x20%s',_0x6ce9f9,_0x40d7('0xc'));_0x48aed7(_0x309cdb['result'][_0x40d7('0x11')]);}})[_0x40d7('0x14')](function(_0x359656){logger[_0x40d7('0xf')](_0x40d7('0x12'),_0x6ce9f9,_0x359656);_0x4a1ff6(_0x359656);});});}exports[_0x40d7('0x15')]=function(_0x4faf1c){var _0x576d9d=this;return new Promise(function(_0x1fcb3d,_0x127d5f){return db[_0x40d7('0x16')][_0x40d7('0x17')]({'raw':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x19')]===undefined?!![]:![]:!![],'where':_0x4faf1c['options']?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1a')]||null:null,'attributes':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1b')]||null:null,'limit':_0x4faf1c['options']?_0x4faf1c['options'][_0x40d7('0x1c')]||null:null,'include':_0x4faf1c[_0x40d7('0x18')]?_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1d')]?_[_0x40d7('0x1e')](_0x4faf1c[_0x40d7('0x18')][_0x40d7('0x1d')],function(_0x5753d2){return{'model':db[_0x5753d2['model']],'as':_0x5753d2['as'],'attributes':_0x5753d2[_0x40d7('0x1b')],'include':_0x5753d2['include']?_[_0x40d7('0x1e')](_0x5753d2[_0x40d7('0x1d')],function(_0x35c517){return{'model':db[_0x35c517[_0x40d7('0x1f')]],'as':_0x35c517['as'],'attributes':_0x35c517[_0x40d7('0x1b')],'include':_0x35c517['include']?_['map'](_0x35c517[_0x40d7('0x1d')],function(_0x50e899){return{'model':db[_0x50e899[_0x40d7('0x1f')]],'as':_0x50e899['as'],'attributes':_0x50e899[_0x40d7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xb')](function(_0x38369a){logger[_0x40d7('0x13')](_0x40d7('0x15'),_0x4faf1c);logger['debug']('GetCampaign',_0x4faf1c,JSON['stringify'](_0x38369a));_0x1fcb3d(_0x38369a);})['catch'](function(_0x209b58){logger[_0x40d7('0xf')](_0x40d7('0x15'),_0x209b58[_0x40d7('0x11')],_0x4faf1c);_0x127d5f(_0x576d9d[_0x40d7('0xf')](0x1f4,_0x209b58[_0x40d7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index acaeb5a..5257651 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 _0x7be0=['/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get'];(function(_0x3580a1,_0x52d460){var _0xda4fa7=function(_0x18096b){while(--_0x18096b){_0x3580a1['push'](_0x3580a1['shift']());}};_0xda4fa7(++_0x52d460);}(_0x7be0,0x1b4));var _0x07be=function(_0x49fc21,_0x2862f2){_0x49fc21=_0x49fc21-0x0;var _0x16b72c=_0x7be0[_0x49fc21];return _0x16b72c;};'use strict';var multer=require(_0x07be('0x0'));var util=require(_0x07be('0x1'));var path=require(_0x07be('0x2'));var timeout=require(_0x07be('0x3'));var express=require('express');var router=express[_0x07be('0x4')]();var auth=require(_0x07be('0x5'));var interaction=require(_0x07be('0x6'));var config=require(_0x07be('0x7'));var controller=require(_0x07be('0x8'));router['get']('/',auth[_0x07be('0x9')](),controller[_0x07be('0xa')]);router[_0x07be('0xb')](_0x07be('0xc'),auth[_0x07be('0x9')](),controller[_0x07be('0xd')]);router[_0x07be('0xb')]('/:id/hoppers',auth[_0x07be('0x9')](),controller[_0x07be('0xe')]);router[_0x07be('0xb')]('/:id/hopper_histories',auth[_0x07be('0x9')](),controller[_0x07be('0xf')]);router[_0x07be('0xb')](_0x07be('0x10'),auth[_0x07be('0x9')](),controller[_0x07be('0x11')]);router['get']('/:id/hopper_black',auth[_0x07be('0x9')](),controller['getHopperBlacks']);router[_0x07be('0xb')](_0x07be('0x12'),auth[_0x07be('0x9')](),controller[_0x07be('0x13')]);router[_0x07be('0xb')](_0x07be('0x14'),auth[_0x07be('0x9')](),controller[_0x07be('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x07be('0x16')]);router[_0x07be('0x17')]('/:id/clone',auth[_0x07be('0x9')](),controller[_0x07be('0x18')]);router[_0x07be('0x17')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x07be('0x17')]('/:id/blacklists',auth[_0x07be('0x9')](),controller['addBlackLists']);router[_0x07be('0x19')](_0x07be('0xc'),auth[_0x07be('0x9')](),controller[_0x07be('0x1a')]);router[_0x07be('0x1b')]('/:id',auth[_0x07be('0x9')](),controller[_0x07be('0x1c')]);router['delete'](_0x07be('0x12'),auth[_0x07be('0x9')](),controller[_0x07be('0x1d')]);router[_0x07be('0x1b')](_0x07be('0x14'),auth[_0x07be('0x9')](),controller[_0x07be('0x1e')]);module[_0x07be('0x1f')]=router; \ No newline at end of file +var _0x1117=['destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id/hoppers','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','/:id','delete'];(function(_0x1296fe,_0x329852){var _0x10466e=function(_0x2b4b4d){while(--_0x2b4b4d){_0x1296fe['push'](_0x1296fe['shift']());}};_0x10466e(++_0x329852);}(_0x1117,0x143));var _0x7111=function(_0x2feffe,_0x104382){_0x2feffe=_0x2feffe-0x0;var _0x190bb3=_0x1117[_0x2feffe];return _0x190bb3;};'use strict';var multer=require(_0x7111('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7111('0x1'));var express=require(_0x7111('0x2'));var router=express[_0x7111('0x3')]();var auth=require(_0x7111('0x4'));var interaction=require(_0x7111('0x5'));var config=require('../../config/environment');var controller=require(_0x7111('0x6'));router['get']('/',auth[_0x7111('0x7')](),controller[_0x7111('0x8')]);router['get']('/:id',auth[_0x7111('0x7')](),controller['show']);router[_0x7111('0x9')](_0x7111('0xa'),auth[_0x7111('0x7')](),controller['getHoppers']);router[_0x7111('0x9')]('/:id/hopper_histories',auth[_0x7111('0x7')](),controller['getHopperHistories']);router[_0x7111('0x9')]('/:id/hopper_finals',auth[_0x7111('0x7')](),controller['getHopperFinals']);router[_0x7111('0x9')]('/:id/hopper_black',auth[_0x7111('0x7')](),controller[_0x7111('0xb')]);router[_0x7111('0x9')](_0x7111('0xc'),auth['isAuthenticated'](),controller[_0x7111('0xd')]);router[_0x7111('0x9')]('/:id/blacklists',auth[_0x7111('0x7')](),controller[_0x7111('0xe')]);router[_0x7111('0xf')]('/',auth[_0x7111('0x7')](),controller[_0x7111('0x10')]);router[_0x7111('0xf')](_0x7111('0x11'),auth[_0x7111('0x7')](),controller[_0x7111('0x12')]);router['post']('/:id/lists',auth[_0x7111('0x7')](),controller[_0x7111('0x13')]);router[_0x7111('0xf')](_0x7111('0x14'),auth[_0x7111('0x7')](),controller[_0x7111('0x15')]);router[_0x7111('0x16')](_0x7111('0x17'),auth[_0x7111('0x7')](),controller['update']);router[_0x7111('0x18')](_0x7111('0x17'),auth[_0x7111('0x7')](),controller[_0x7111('0x19')]);router[_0x7111('0x18')](_0x7111('0xc'),auth['isAuthenticated'](),controller[_0x7111('0x1a')]);router[_0x7111('0x18')](_0x7111('0x14'),auth[_0x7111('0x7')](),controller[_0x7111('0x1b')]);module[_0x7111('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e9a1d80..5069dcb 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 _0x3847=['sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x572706,_0xadcdb5){var _0x556ee9=function(_0x5c174b){while(--_0x5c174b){_0x572706['push'](_0x572706['shift']());}};_0x556ee9(++_0xadcdb5);}(_0x3847,0x14f));var _0x7384=function(_0x505aac,_0x5377fd){_0x505aac=_0x505aac-0x0;var _0xf2b032=_0x3847[_0x505aac];return _0xf2b032;};'use strict';var Sequelize=require(_0x7384('0x0'));module[_0x7384('0x1')]={'key':{'type':Sequelize[_0x7384('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7384('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x7384('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7384('0x4')]('key');}}}; \ No newline at end of file +var _0x0e04=['STRING','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0e04,0x111));var _0x40e0=function(_0x1059e5,_0x455c2e){_0x1059e5=_0x1059e5-0x0;var _0x512fad=_0x0e04[_0x1059e5];return _0x512fad;};'use strict';var Sequelize=require(_0x40e0('0x0'));module[_0x40e0('0x1')]={'key':{'type':Sequelize[_0x40e0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x40e0('0x2')]},'name':{'type':Sequelize[_0x40e0('0x3')],'get':function(){return this[_0x40e0('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 56c3649..a04de8c 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 _0x8225=['CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','limit','order','sort','pick','where','merge','map','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','set','Content-Range','reject','save','update','then','destroy','get'];(function(_0x5aedbc,_0x41eab8){var _0xc9a701=function(_0x3e965e){while(--_0x3e965e){_0x5aedbc['push'](_0x5aedbc['shift']());}};_0xc9a701(++_0x41eab8);}(_0x8225,0x1db));var _0x5822=function(_0x56574a,_0x230873){_0x56574a=_0x56574a-0x0;var _0x3b9fed=_0x8225[_0x56574a];return _0x3b9fed;};'use strict';var pdf=require(_0x5822('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5822('0x1'));var zipdir=require(_0x5822('0x2'));var jsonpatch=require(_0x5822('0x3'));var rp=require(_0x5822('0x4'));var moment=require(_0x5822('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5822('0x6'));var sox=require(_0x5822('0x7'));var csv=require('to-csv');var ejs=require(_0x5822('0x8'));var fs=require('fs');var _=require(_0x5822('0x9'));var squel=require('squel');var crypto=require(_0x5822('0xa'));var jsforce=require(_0x5822('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5822('0xc'));var querystring=require(_0x5822('0xd'));var Papa=require(_0x5822('0xe'));var Redis=require(_0x5822('0xf'));var authService=require(_0x5822('0x10'));var qs=require(_0x5822('0x11'));var hardwareService=require(_0x5822('0x12'));var logger=require(_0x5822('0x13'))(_0x5822('0x14'));var utils=require(_0x5822('0x15'));var config=require(_0x5822('0x16'));var db=require(_0x5822('0x17'))['db'];function respondWithStatusCode(_0x4f96ff,_0x54f5ea){_0x54f5ea=_0x54f5ea||0xcc;return function(_0x525329){if(_0x525329){return _0x4f96ff['sendStatus'](_0x54f5ea);}return _0x4f96ff[_0x5822('0x18')](_0x54f5ea)[_0x5822('0x19')]();};}function respondWithResult(_0x39a8ea,_0x227683){_0x227683=_0x227683||0xc8;return function(_0x27dd7b){if(_0x27dd7b){return _0x39a8ea[_0x5822('0x18')](_0x227683)['json'](_0x27dd7b);}};}function respondWithFilteredResult(_0x2706d1,_0x1f45a2){return function(_0x2a7349){if(_0x2a7349){var _0x2c3c54=_0x2a7349['count'],_0x3ad048=_0x1f45a2['offset'],_0x57f159=_0x1f45a2[_0x5822('0x1a')]+_0x1f45a2['limit'],_0x6fd1e2;if(_0x57f159>=_0x2c3c54){_0x57f159=_0x2c3c54;_0x6fd1e2=0xc8;}else{_0x6fd1e2=0xce;}_0x2706d1[_0x5822('0x18')](_0x6fd1e2);return _0x2706d1[_0x5822('0x1b')](_0x5822('0x1c'),_0x3ad048+'-'+_0x57f159+'/'+_0x2c3c54)['json'](_0x2a7349);}return null;};}function patchUpdates(_0x5b073c){return function(_0x19231e){try{jsonpatch['apply'](_0x19231e,_0x5b073c,!![]);}catch(_0x5e3ff5){return BPromise[_0x5822('0x1d')](_0x5e3ff5);}return _0x19231e[_0x5822('0x1e')]();};}function saveUpdates(_0x57e58b,_0x3ba835){return function(_0xe64467){if(_0xe64467){return _0xe64467[_0x5822('0x1f')](_0x57e58b)[_0x5822('0x20')](function(_0x434f3c){return _0x434f3c;});}return null;};}function removeEntity(_0xe71c3f,_0x2d17ac){return function(_0xaba6ba){if(_0xaba6ba){return _0xaba6ba[_0x5822('0x21')]()[_0x5822('0x20')](function(){var _0x5062d5=_0xaba6ba[_0x5822('0x22')]({'plain':!![]});var _0x453210=_0x5822('0x23');return db[_0x5822('0x24')][_0x5822('0x21')]({'where':{'type':_0x453210,'resourceId':_0x5062d5['id']}})[_0x5822('0x20')](function(){return _0xaba6ba;});})[_0x5822('0x20')](function(){_0xe71c3f['status'](0xcc)[_0x5822('0x19')]();});}};}function handleEntityNotFound(_0x423d47,_0x91fcd9){return function(_0x512047){if(!_0x512047){_0x423d47[_0x5822('0x25')](0x194);}return _0x512047;};}function handleError(_0xeee8be,_0x2f4ce0){_0x2f4ce0=_0x2f4ce0||0x1f4;return function(_0x798df){logger[_0x5822('0x26')](_0x798df[_0x5822('0x27')]);if(_0x798df[_0x5822('0x28')]){delete _0x798df['name'];}_0xeee8be[_0x5822('0x18')](_0x2f4ce0)[_0x5822('0x29')](_0x798df);};}exports[_0x5822('0x2a')]=function(_0x222a3e,_0x22a15c){var _0x228dcb={},_0x40e9a9={},_0x19b44b={'count':0x0,'rows':[]};var _0xbac2d6=db[_0x5822('0x2b')][_0x5822('0x2c')];_0x40e9a9[_0x5822('0x2d')]=_[_0x5822('0x2e')](_0xbac2d6);_0x40e9a9['query']=_['keys'](_0x222a3e[_0x5822('0x2f')]);_0x40e9a9[_0x5822('0x30')]=_['intersection'](_0x40e9a9[_0x5822('0x2d')],_0x40e9a9[_0x5822('0x2f')]);_0x228dcb['attributes']=_[_0x5822('0x31')](_0x40e9a9[_0x5822('0x2d')],qs[_0x5822('0x32')](_0x222a3e['query'][_0x5822('0x32')]));_0x228dcb['attributes']=_0x228dcb['attributes'][_0x5822('0x33')]?_0x228dcb[_0x5822('0x34')]:_0x40e9a9[_0x5822('0x2d')];if(!_0x222a3e[_0x5822('0x2f')]['hasOwnProperty']('nolimit')){_0x228dcb[_0x5822('0x35')]=qs[_0x5822('0x35')](_0x222a3e[_0x5822('0x2f')][_0x5822('0x35')]);_0x228dcb['offset']=qs[_0x5822('0x1a')](_0x222a3e[_0x5822('0x2f')][_0x5822('0x1a')]);}_0x228dcb[_0x5822('0x36')]=qs['sort'](_0x222a3e[_0x5822('0x2f')][_0x5822('0x37')]);_0x228dcb['where']=qs[_0x5822('0x30')](_[_0x5822('0x38')](_0x222a3e[_0x5822('0x2f')],_0x40e9a9[_0x5822('0x30')]));if(_0x222a3e[_0x5822('0x2f')]['filter']){_0x228dcb[_0x5822('0x39')]=_[_0x5822('0x3a')](_0x228dcb['where'],{'$or':_[_0x5822('0x3b')](_0xbac2d6,function(_0x2d300e){if(_0x2d300e['type']['key']!==_0x5822('0x3c')){var _0x1ecef8={};_0x1ecef8[_0x2d300e[_0x5822('0x3d')]]={'$like':'%'+_0x222a3e['query']['filter']+'%'};return _0x1ecef8;}})});}_0x228dcb=_[_0x5822('0x3a')]({},_0x228dcb,_0x222a3e[_0x5822('0x3e')]);var _0x20128f={'where':_0x228dcb[_0x5822('0x39')]};return db['CannedAnswer'][_0x5822('0x3f')](_0x20128f)[_0x5822('0x20')](function(_0x42a379){_0x19b44b[_0x5822('0x3f')]=_0x42a379;if(_0x222a3e[_0x5822('0x2f')][_0x5822('0x40')]){_0x228dcb[_0x5822('0x41')]=[{'all':!![]}];}return db[_0x5822('0x2b')][_0x5822('0x42')](_0x228dcb);})[_0x5822('0x20')](function(_0x1bb75e){_0x19b44b[_0x5822('0x43')]=_0x1bb75e;return _0x19b44b;})[_0x5822('0x20')](respondWithFilteredResult(_0x22a15c,_0x228dcb))[_0x5822('0x44')](handleError(_0x22a15c,null));};exports[_0x5822('0x45')]=function(_0x227fc7,_0x339f58){var _0x2e3982={'raw':!![],'where':{'id':_0x227fc7[_0x5822('0x46')]['id']}},_0x4d6715={};_0x4d6715[_0x5822('0x2d')]=_[_0x5822('0x2e')](db[_0x5822('0x2b')][_0x5822('0x2c')]);_0x4d6715[_0x5822('0x2f')]=_[_0x5822('0x2e')](_0x227fc7[_0x5822('0x2f')]);_0x4d6715[_0x5822('0x30')]=_['intersection'](_0x4d6715[_0x5822('0x2d')],_0x4d6715[_0x5822('0x2f')]);_0x2e3982['attributes']=_[_0x5822('0x31')](_0x4d6715[_0x5822('0x2d')],qs[_0x5822('0x32')](_0x227fc7[_0x5822('0x2f')][_0x5822('0x32')]));_0x2e3982[_0x5822('0x34')]=_0x2e3982['attributes'][_0x5822('0x33')]?_0x2e3982[_0x5822('0x34')]:_0x4d6715[_0x5822('0x2d')];if(_0x227fc7[_0x5822('0x2f')]['includeAll']){_0x2e3982['include']=[{'all':!![]}];}_0x2e3982=_[_0x5822('0x3a')]({},_0x2e3982,_0x227fc7[_0x5822('0x3e')]);return db[_0x5822('0x2b')][_0x5822('0x47')](_0x2e3982)[_0x5822('0x20')](handleEntityNotFound(_0x339f58,null))['then'](respondWithResult(_0x339f58,null))[_0x5822('0x44')](handleError(_0x339f58,null));};exports[_0x5822('0x1f')]=function(_0x20b674,_0x2c453e){if(_0x20b674[_0x5822('0x48')]['id']){delete _0x20b674[_0x5822('0x48')]['id'];}return db[_0x5822('0x2b')]['find']({'where':{'id':_0x20b674[_0x5822('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c453e,null))[_0x5822('0x20')](saveUpdates(_0x20b674['body'],null))[_0x5822('0x20')](respondWithResult(_0x2c453e,null))[_0x5822('0x44')](handleError(_0x2c453e,null));};exports[_0x5822('0x21')]=function(_0x43bcb1,_0x4f2480){return db['CannedAnswer']['find']({'where':{'id':_0x43bcb1[_0x5822('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f2480,null))[_0x5822('0x20')](removeEntity(_0x4f2480,null))[_0x5822('0x44')](handleError(_0x4f2480,null));};exports['create']=function(_0x4ad12b,_0x115098){var _0x4efa45={'key':_0x4ad12b[_0x5822('0x48')][_0x5822('0x49')]};if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4a')]){_0x4efa45[_0x5822('0x4a')]=_0x4ad12b[_0x5822('0x48')][_0x5822('0x4a')];}else if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4b')]){_0x4efa45[_0x5822('0x4b')]=_0x4ad12b['body'][_0x5822('0x4b')];}else if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4c')]){_0x4efa45['OpenchannelAccountId']=_0x4ad12b['body']['OpenchannelAccountId'];}else if(_0x4ad12b[_0x5822('0x48')]['ChatWebsiteId']){_0x4efa45[_0x5822('0x4d')]=_0x4ad12b[_0x5822('0x48')][_0x5822('0x4d')];}return db['CannedAnswer'][_0x5822('0x47')]({'where':_0x4efa45})['then'](function(_0x240f34){if(_0x240f34){throw new db[(_0x5822('0x4e'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x5822('0x2b')][_0x5822('0x4f')](_0x4ad12b[_0x5822('0x48')]);})[_0x5822('0x20')](function(_0x4e294f){var _0x59e287=_0x4ad12b[_0x5822('0x50')][_0x5822('0x22')]({'plain':!![]});if(!_0x59e287)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59e287[_0x5822('0x51')]==='user'){var _0x29d25a=_0x4e294f[_0x5822('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5822('0x23'),'userProfileId':_0x59e287[_0x5822('0x52')]},'raw':!![]})[_0x5822('0x20')](function(_0x5e82db){if(_0x5e82db&&_0x5e82db[_0x5822('0x53')]===0x0){return db[_0x5822('0x24')][_0x5822('0x4f')]({'name':_0x29d25a[_0x5822('0x28')],'resourceId':_0x29d25a['id'],'type':_0x5e82db[_0x5822('0x28')],'sectionId':_0x5e82db['id']},{})[_0x5822('0x20')](function(){return _0x4e294f;});}else{return _0x4e294f;}})[_0x5822('0x44')](function(_0x114449){logger[_0x5822('0x26')](_0x5822('0x54'),_0x114449);throw _0x114449;});}return _0x4e294f;})[_0x5822('0x20')](respondWithResult(_0x115098,0xc9))[_0x5822('0x44')](handleError(_0x115098,null));}; \ No newline at end of file +var _0x4434=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','CannedAnswer','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','key','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x370b4d,_0x54e291){var _0x22a295=function(_0x4c8307){while(--_0x4c8307){_0x370b4d['push'](_0x370b4d['shift']());}};_0x22a295(++_0x54e291);}(_0x4434,0x1ae));var _0x4443=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4434[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x4443('0x0'));var emlformat=require(_0x4443('0x1'));var rimraf=require(_0x4443('0x2'));var zipdir=require(_0x4443('0x3'));var jsonpatch=require(_0x4443('0x4'));var rp=require(_0x4443('0x5'));var moment=require(_0x4443('0x6'));var BPromise=require(_0x4443('0x7'));var Mustache=require(_0x4443('0x8'));var util=require(_0x4443('0x9'));var path=require(_0x4443('0xa'));var sox=require(_0x4443('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4443('0xc'));var squel=require('squel');var crypto=require(_0x4443('0xd'));var jsforce=require(_0x4443('0xe'));var deskjs=require(_0x4443('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4443('0x10'));var Papa=require(_0x4443('0x11'));var Redis=require(_0x4443('0x12'));var authService=require(_0x4443('0x13'));var qs=require(_0x4443('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4443('0x15'))(_0x4443('0x16'));var utils=require(_0x4443('0x17'));var config=require('../../config/environment');var db=require(_0x4443('0x18'))['db'];function respondWithStatusCode(_0x365c15,_0x320da7){_0x320da7=_0x320da7||0xcc;return function(_0x31bef8){if(_0x31bef8){return _0x365c15[_0x4443('0x19')](_0x320da7);}return _0x365c15[_0x4443('0x1a')](_0x320da7)[_0x4443('0x1b')]();};}function respondWithResult(_0x5c40f6,_0x31997f){_0x31997f=_0x31997f||0xc8;return function(_0x2767a4){if(_0x2767a4){return _0x5c40f6[_0x4443('0x1a')](_0x31997f)[_0x4443('0x1c')](_0x2767a4);}};}function respondWithFilteredResult(_0x3a3108,_0xd40953){return function(_0x4d58dc){if(_0x4d58dc){var _0x45f0e1=_0x4d58dc[_0x4443('0x1d')],_0x237571=_0xd40953[_0x4443('0x1e')],_0xb8af0c=_0xd40953[_0x4443('0x1e')]+_0xd40953[_0x4443('0x1f')],_0x4f49e6;if(_0xb8af0c>=_0x45f0e1){_0xb8af0c=_0x45f0e1;_0x4f49e6=0xc8;}else{_0x4f49e6=0xce;}_0x3a3108[_0x4443('0x1a')](_0x4f49e6);return _0x3a3108[_0x4443('0x20')](_0x4443('0x21'),_0x237571+'-'+_0xb8af0c+'/'+_0x45f0e1)[_0x4443('0x1c')](_0x4d58dc);}return null;};}function patchUpdates(_0x293470){return function(_0x580bed){try{jsonpatch[_0x4443('0x22')](_0x580bed,_0x293470,!![]);}catch(_0x392118){return BPromise[_0x4443('0x23')](_0x392118);}return _0x580bed[_0x4443('0x24')]();};}function saveUpdates(_0x49bbb9,_0x29dfa8){return function(_0x310d2a){if(_0x310d2a){return _0x310d2a[_0x4443('0x25')](_0x49bbb9)[_0x4443('0x26')](function(_0x470076){return _0x470076;});}return null;};}function removeEntity(_0x15ded0,_0x528513){return function(_0x4a3c25){if(_0x4a3c25){return _0x4a3c25['destroy']()[_0x4443('0x26')](function(){var _0x54eb06=_0x4a3c25[_0x4443('0x27')]({'plain':!![]});var _0x4fba97=_0x4443('0x28');return db[_0x4443('0x29')]['destroy']({'where':{'type':_0x4fba97,'resourceId':_0x54eb06['id']}})[_0x4443('0x26')](function(){return _0x4a3c25;});})['then'](function(){_0x15ded0['status'](0xcc)[_0x4443('0x1b')]();});}};}function handleEntityNotFound(_0x871cf2,_0x48bc7f){return function(_0xcb89a3){if(!_0xcb89a3){_0x871cf2['sendStatus'](0x194);}return _0xcb89a3;};}function handleError(_0x5021be,_0x1db727){_0x1db727=_0x1db727||0x1f4;return function(_0x5434d5){logger['error'](_0x5434d5[_0x4443('0x2a')]);if(_0x5434d5[_0x4443('0x2b')]){delete _0x5434d5[_0x4443('0x2b')];}_0x5021be['status'](_0x1db727)[_0x4443('0x2c')](_0x5434d5);};}exports[_0x4443('0x2d')]=function(_0xda2db2,_0x5e4706){var _0x3b8bca={},_0x22bcab={},_0x57e85a={'count':0x0,'rows':[]};var _0x41b30d=db[_0x4443('0x2e')]['rawAttributes'];_0x22bcab[_0x4443('0x2f')]=_[_0x4443('0x30')](_0x41b30d);_0x22bcab['query']=_[_0x4443('0x30')](_0xda2db2[_0x4443('0x31')]);_0x22bcab[_0x4443('0x32')]=_['intersection'](_0x22bcab[_0x4443('0x2f')],_0x22bcab[_0x4443('0x31')]);_0x3b8bca['attributes']=_[_0x4443('0x33')](_0x22bcab[_0x4443('0x2f')],qs[_0x4443('0x34')](_0xda2db2[_0x4443('0x31')]['fields']));_0x3b8bca['attributes']=_0x3b8bca[_0x4443('0x35')][_0x4443('0x36')]?_0x3b8bca[_0x4443('0x35')]:_0x22bcab[_0x4443('0x2f')];if(!_0xda2db2['query'][_0x4443('0x37')](_0x4443('0x38'))){_0x3b8bca[_0x4443('0x1f')]=qs[_0x4443('0x1f')](_0xda2db2['query'][_0x4443('0x1f')]);_0x3b8bca[_0x4443('0x1e')]=qs['offset'](_0xda2db2['query'][_0x4443('0x1e')]);}_0x3b8bca[_0x4443('0x39')]=qs[_0x4443('0x3a')](_0xda2db2[_0x4443('0x31')][_0x4443('0x3a')]);_0x3b8bca[_0x4443('0x3b')]=qs[_0x4443('0x32')](_['pick'](_0xda2db2['query'],_0x22bcab[_0x4443('0x32')]));if(_0xda2db2['query'][_0x4443('0x3c')]){_0x3b8bca[_0x4443('0x3b')]=_['merge'](_0x3b8bca[_0x4443('0x3b')],{'$or':_['map'](_0x41b30d,function(_0x404126){if(_0x404126[_0x4443('0x3d')][_0x4443('0x3e')]!=='VIRTUAL'){var _0x484ba8={};_0x484ba8[_0x404126['field']]={'$like':'%'+_0xda2db2[_0x4443('0x31')]['filter']+'%'};return _0x484ba8;}})});}_0x3b8bca=_[_0x4443('0x3f')]({},_0x3b8bca,_0xda2db2[_0x4443('0x40')]);var _0x14d577={'where':_0x3b8bca[_0x4443('0x3b')]};return db[_0x4443('0x2e')][_0x4443('0x1d')](_0x14d577)[_0x4443('0x26')](function(_0x4aa8a6){_0x57e85a[_0x4443('0x1d')]=_0x4aa8a6;if(_0xda2db2[_0x4443('0x31')][_0x4443('0x41')]){_0x3b8bca[_0x4443('0x42')]=[{'all':!![]}];}return db[_0x4443('0x2e')][_0x4443('0x43')](_0x3b8bca);})[_0x4443('0x26')](function(_0x4ff0d1){_0x57e85a[_0x4443('0x44')]=_0x4ff0d1;return _0x57e85a;})['then'](respondWithFilteredResult(_0x5e4706,_0x3b8bca))[_0x4443('0x45')](handleError(_0x5e4706,null));};exports[_0x4443('0x46')]=function(_0x106a4c,_0x48212b){var _0x5b4799={'raw':!![],'where':{'id':_0x106a4c[_0x4443('0x47')]['id']}},_0x4814c1={};_0x4814c1[_0x4443('0x2f')]=_[_0x4443('0x30')](db[_0x4443('0x2e')][_0x4443('0x48')]);_0x4814c1[_0x4443('0x31')]=_[_0x4443('0x30')](_0x106a4c['query']);_0x4814c1[_0x4443('0x32')]=_[_0x4443('0x33')](_0x4814c1['model'],_0x4814c1[_0x4443('0x31')]);_0x5b4799['attributes']=_['intersection'](_0x4814c1['model'],qs[_0x4443('0x34')](_0x106a4c['query'][_0x4443('0x34')]));_0x5b4799['attributes']=_0x5b4799['attributes']['length']?_0x5b4799['attributes']:_0x4814c1[_0x4443('0x2f')];if(_0x106a4c[_0x4443('0x31')]['includeAll']){_0x5b4799[_0x4443('0x42')]=[{'all':!![]}];}_0x5b4799=_[_0x4443('0x3f')]({},_0x5b4799,_0x106a4c['options']);return db[_0x4443('0x2e')][_0x4443('0x49')](_0x5b4799)[_0x4443('0x26')](handleEntityNotFound(_0x48212b,null))[_0x4443('0x26')](respondWithResult(_0x48212b,null))[_0x4443('0x45')](handleError(_0x48212b,null));};exports[_0x4443('0x25')]=function(_0x49453d,_0x597c5d){if(_0x49453d[_0x4443('0x4a')]['id']){delete _0x49453d[_0x4443('0x4a')]['id'];}return db[_0x4443('0x2e')]['find']({'where':{'id':_0x49453d[_0x4443('0x47')]['id']}})['then'](handleEntityNotFound(_0x597c5d,null))[_0x4443('0x26')](saveUpdates(_0x49453d[_0x4443('0x4a')],null))[_0x4443('0x26')](respondWithResult(_0x597c5d,null))['catch'](handleError(_0x597c5d,null));};exports[_0x4443('0x4b')]=function(_0x5cbf77,_0x3f0598){return db[_0x4443('0x2e')][_0x4443('0x49')]({'where':{'id':_0x5cbf77[_0x4443('0x47')]['id']}})[_0x4443('0x26')](handleEntityNotFound(_0x3f0598,null))['then'](removeEntity(_0x3f0598,null))[_0x4443('0x45')](handleError(_0x3f0598,null));};exports[_0x4443('0x4c')]=function(_0x238ffa,_0x4103ad){var _0x1690a8={'key':_0x238ffa[_0x4443('0x4a')][_0x4443('0x3e')]};if(_0x238ffa['body'][_0x4443('0x4d')]){_0x1690a8[_0x4443('0x4d')]=_0x238ffa['body'][_0x4443('0x4d')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x4e')]){_0x1690a8['SmsAccountId']=_0x238ffa['body'][_0x4443('0x4e')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x4f')]){_0x1690a8[_0x4443('0x4f')]=_0x238ffa[_0x4443('0x4a')][_0x4443('0x4f')];}else if(_0x238ffa[_0x4443('0x4a')][_0x4443('0x50')]){_0x1690a8[_0x4443('0x50')]=_0x238ffa[_0x4443('0x4a')][_0x4443('0x50')];}return db[_0x4443('0x2e')][_0x4443('0x49')]({'where':_0x1690a8})['then'](function(_0x1aee1f){if(_0x1aee1f){throw new db[(_0x4443('0x51'))][(_0x4443('0x52'))](_0x4443('0x53'));}return db[_0x4443('0x2e')]['create'](_0x238ffa[_0x4443('0x4a')]);})[_0x4443('0x26')](function(_0x3ef584){var _0x5aa5d3=_0x238ffa[_0x4443('0x54')][_0x4443('0x27')]({'plain':!![]});if(!_0x5aa5d3)throw new Error(_0x4443('0x55'));if(_0x5aa5d3['role']===_0x4443('0x54')){var _0x514c1e=_0x3ef584[_0x4443('0x27')]({'plain':!![]});return db[_0x4443('0x56')][_0x4443('0x49')]({'where':{'name':_0x4443('0x28'),'userProfileId':_0x5aa5d3[_0x4443('0x57')]},'raw':!![]})[_0x4443('0x26')](function(_0x597ed9){if(_0x597ed9&&_0x597ed9[_0x4443('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x514c1e['name'],'resourceId':_0x514c1e['id'],'type':_0x597ed9[_0x4443('0x2b')],'sectionId':_0x597ed9['id']},{})[_0x4443('0x26')](function(){return _0x3ef584;});}else{return _0x3ef584;}})[_0x4443('0x45')](function(_0x2cd9d3){logger[_0x4443('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cd9d3);throw _0x2cd9d3;});}return _0x3ef584;})['then'](respondWithResult(_0x4103ad,0xc9))[_0x4443('0x45')](handleError(_0x4103ad,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 92bd34e..d1b6500 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 _0x1ad2=['path','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x15f6a4,_0x289ec4){var _0x44b5fc=function(_0x2cc5b0){while(--_0x2cc5b0){_0x15f6a4['push'](_0x15f6a4['shift']());}};_0x44b5fc(++_0x289ec4);}(_0x1ad2,0xcb));var _0x21ad=function(_0xe1b0e1,_0x5dec90){_0xe1b0e1=_0xe1b0e1-0x0;var _0x38fd59=_0x1ad2[_0xe1b0e1];return _0x38fd59;};'use strict';var _=require('lodash');var util=require(_0x21ad('0x0'));var logger=require(_0x21ad('0x1'))(_0x21ad('0x2'));var moment=require('moment');var BPromise=require(_0x21ad('0x3'));var rp=require(_0x21ad('0x4'));var fs=require('fs');var path=require(_0x21ad('0x5'));var rimraf=require(_0x21ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x21ad('0x7'));module[_0x21ad('0x8')]=function(_0x5e8faa,_0x17b1fb){return _0x5e8faa[_0x21ad('0x9')]('CannedAnswer',attributes,{'tableName':_0x21ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21ad('0xb'),'collate':_0x21ad('0xc')});}; \ No newline at end of file +var _0xab63=['request-promise','path','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','../../config/logger','api','bluebird'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xab63,0x11d));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3ab6('0x0'))(_0x3ab6('0x1'));var moment=require('moment');var BPromise=require(_0x3ab6('0x2'));var rp=require(_0x3ab6('0x3'));var fs=require('fs');var path=require(_0x3ab6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x3ab6('0x5')]=function(_0x439176,_0x5a9a79){return _0x439176['define'](_0x3ab6('0x6'),attributes,{'tableName':_0x3ab6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3ab6('0x8')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d6428cc..a6bf55c 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 _0x51b5=['info','request\x20sent','result','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c4d06,_0x452e60){var _0x400506=function(_0x15a00a){while(--_0x15a00a){_0x4c4d06['push'](_0x4c4d06['shift']());}};_0x400506(++_0x452e60);}(_0x51b5,0x11b));var _0x551b=function(_0x269d49,_0x59a326){_0x269d49=_0x269d49-0x0;var _0x505ee2=_0x51b5[_0x269d49];return _0x505ee2;};'use strict';var _=require(_0x551b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x551b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x551b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x551b('0x3'))(_0x551b('0x4'));var config=require(_0x551b('0x5'));var jayson=require(_0x551b('0x6'));var client=jayson[_0x551b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x374a0c,_0x5ba26c,_0x2fbb99){return new BPromise(function(_0x3123e3,_0xcc3c35){return client[_0x551b('0x8')](_0x374a0c,_0x2fbb99)[_0x551b('0x9')](function(_0x9af257){logger['info'](_0x551b('0xa'),_0x5ba26c,'request\x20sent');logger[_0x551b('0xb')](_0x551b('0xc'),_0x5ba26c,'request\x20sent',JSON[_0x551b('0xd')](_0x9af257));if(_0x9af257[_0x551b('0xe')]){if(_0x9af257['error'][_0x551b('0xf')]===0x1f4){logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x9af257[_0x551b('0xe')]['message']);return _0xcc3c35(_0x9af257[_0x551b('0xe')]['message']);}logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x9af257[_0x551b('0xe')][_0x551b('0x10')]);return _0x3123e3(_0x9af257[_0x551b('0xe')][_0x551b('0x10')]);}else{logger[_0x551b('0x11')](_0x551b('0xa'),_0x5ba26c,_0x551b('0x12'));_0x3123e3(_0x9af257[_0x551b('0x13')][_0x551b('0x10')]);}})['catch'](function(_0x4d8df4){logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x4d8df4);_0xcc3c35(_0x4d8df4);});});} \ No newline at end of file +var _0xc4f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0x41e346,_0x490e1d){var _0x505ce5=function(_0x5ec27b){while(--_0x5ec27b){_0x41e346['push'](_0x41e346['shift']());}};_0x505ce5(++_0x490e1d);}(_0xc4f6,0x1f1));var _0x6c4f=function(_0x15e65d,_0x17c026){_0x15e65d=_0x15e65d-0x0;var _0x412ce1=_0xc4f6[_0x15e65d];return _0x412ce1;};'use strict';var _=require(_0x6c4f('0x0'));var util=require('util');var moment=require(_0x6c4f('0x1'));var BPromise=require(_0x6c4f('0x2'));var rs=require(_0x6c4f('0x3'));var fs=require('fs');var Redis=require(_0x6c4f('0x4'));var db=require(_0x6c4f('0x5'))['db'];var utils=require(_0x6c4f('0x6'));var logger=require(_0x6c4f('0x7'))(_0x6c4f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6c4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54d847,_0x24f264,_0x47a128){return new BPromise(function(_0x44b533,_0x2e5415){return client[_0x6c4f('0xa')](_0x54d847,_0x47a128)['then'](function(_0x1c8ebe){logger[_0x6c4f('0xb')](_0x6c4f('0xc'),_0x24f264,_0x6c4f('0xd'));logger[_0x6c4f('0xe')](_0x6c4f('0xf'),_0x24f264,_0x6c4f('0xd'),JSON['stringify'](_0x1c8ebe));if(_0x1c8ebe[_0x6c4f('0x10')]){if(_0x1c8ebe[_0x6c4f('0x10')]['code']===0x1f4){logger[_0x6c4f('0x10')](_0x6c4f('0xc'),_0x24f264,_0x1c8ebe[_0x6c4f('0x10')]['message']);return _0x2e5415(_0x1c8ebe[_0x6c4f('0x10')]['message']);}logger[_0x6c4f('0x10')](_0x6c4f('0xc'),_0x24f264,_0x1c8ebe[_0x6c4f('0x10')][_0x6c4f('0x11')]);return _0x44b533(_0x1c8ebe[_0x6c4f('0x10')]['message']);}else{logger[_0x6c4f('0xb')](_0x6c4f('0xc'),_0x24f264,_0x6c4f('0xd'));_0x44b533(_0x1c8ebe[_0x6c4f('0x12')][_0x6c4f('0x11')]);}})[_0x6c4f('0x13')](function(_0x13697a){logger['error'](_0x6c4f('0xc'),_0x24f264,_0x13697a);_0x2e5415(_0x13697a);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index d4d1752..71ce363 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 _0x10e9=['exports','util','./cannedAnswer.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','destroy'];(function(_0x22b377,_0x34e228){var _0x2168d2=function(_0x33a14a){while(--_0x33a14a){_0x22b377['push'](_0x22b377['shift']());}};_0x2168d2(++_0x34e228);}(_0x10e9,0x1a1));var _0x910e=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x10e9[_0xfedc72];return _0x2c7c78;};'use strict';var multer=require('multer');var util=require(_0x910e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x910e('0x1'));router[_0x910e('0x2')]('/',auth['isAuthenticated'](),controller[_0x910e('0x3')]);router[_0x910e('0x2')](_0x910e('0x4'),auth['isAuthenticated'](),controller[_0x910e('0x5')]);router[_0x910e('0x6')]('/',auth['isAuthenticated'](),controller[_0x910e('0x7')]);router[_0x910e('0x8')](_0x910e('0x4'),auth[_0x910e('0x9')](),controller[_0x910e('0xa')]);router['delete'](_0x910e('0x4'),auth[_0x910e('0x9')](),controller[_0x910e('0xb')]);module[_0x910e('0xc')]=router; \ No newline at end of file +var _0x5ebd=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','create','put'];(function(_0xb27972,_0x3c8833){var _0x3bd30f=function(_0x1cc3f0){while(--_0x1cc3f0){_0xb27972['push'](_0xb27972['shift']());}};_0x3bd30f(++_0x3c8833);}(_0x5ebd,0x9c));var _0xd5eb=function(_0x217112,_0x142e2e){_0x217112=_0x217112-0x0;var _0xfecf1d=_0x5ebd[_0x217112];return _0xfecf1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd5eb('0x0'));var timeout=require(_0xd5eb('0x1'));var express=require(_0xd5eb('0x2'));var router=express[_0xd5eb('0x3')]();var auth=require(_0xd5eb('0x4'));var interaction=require(_0xd5eb('0x5'));var config=require(_0xd5eb('0x6'));var controller=require(_0xd5eb('0x7'));router[_0xd5eb('0x8')]('/',auth['isAuthenticated'](),controller[_0xd5eb('0x9')]);router['get'](_0xd5eb('0xa'),auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xc')]);router['post']('/',auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xd')]);router[_0xd5eb('0xe')](_0xd5eb('0xa'),auth[_0xd5eb('0xb')](),controller[_0xd5eb('0xf')]);router[_0xd5eb('0x10')]('/:id',auth[_0xd5eb('0xb')](),controller[_0xd5eb('0x11')]);module[_0xd5eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 4117c12..247e083 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 _0xfe77=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x513c8b,_0x4a8e73){var _0x32f3e6=function(_0x595821){while(--_0x595821){_0x513c8b['push'](_0x513c8b['shift']());}};_0x32f3e6(++_0x4a8e73);}(_0xfe77,0xcb));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7fe7('0x0')]={'calldate':{'type':Sequelize[_0x7fe7('0x1')],'allowNull':![],'defaultValue':_0x7fe7('0x2')},'clid':{'type':Sequelize[_0x7fe7('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x7fe7('0x3')]},'channel':{'type':Sequelize[_0x7fe7('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7fe7('0x3')]},'lastdata':{'type':Sequelize[_0x7fe7('0x3')]},'duration':{'type':Sequelize[_0x7fe7('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7fe7('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7fe7('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7fe7('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7fe7('0x3')]},'peeraccount':{'type':Sequelize[_0x7fe7('0x3')]},'type':{'type':Sequelize[_0x7fe7('0x3')]},'tag':{'type':Sequelize[_0x7fe7('0x3')]}}; \ No newline at end of file +var _0x1419=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1d5abc,_0x392b36){var _0x68a84f=function(_0x2ea647){while(--_0x2ea647){_0x1d5abc['push'](_0x1d5abc['shift']());}};_0x68a84f(++_0x392b36);}(_0x1419,0x180));var _0x9141=function(_0x362516,_0x30aa64){_0x362516=_0x362516-0x0;var _0x26f00c=_0x1419[_0x362516];return _0x26f00c;};'use strict';var Sequelize=require(_0x9141('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x9141('0x1')},'clid':{'type':Sequelize[_0x9141('0x2')]},'src':{'type':Sequelize[_0x9141('0x2')]},'dst':{'type':Sequelize[_0x9141('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9141('0x2')]},'dstchannel':{'type':Sequelize[_0x9141('0x2')]},'lastapp':{'type':Sequelize[_0x9141('0x2')]},'lastdata':{'type':Sequelize[_0x9141('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9141('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9141('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x9141('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9141('0x2')]},'linkedid':{'type':Sequelize[_0x9141('0x2')]},'sequence':{'type':Sequelize[_0x9141('0x2')]},'peeraccount':{'type':Sequelize[_0x9141('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9141('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f00452f..ff2b0a0 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 _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Cdr','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x22fde5,_0x2b6797){var _0x282da9=function(_0x2e4193){while(--_0x2e4193){_0x22fde5['push'](_0x22fde5['shift']());}};_0x282da9(++_0x2b6797);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Cdr'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Cdr'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x24c859,_0x4a65e7){var _0xa5e5bd=function(_0x383cb7){while(--_0x383cb7){_0x24c859['push'](_0x24c859['shift']());}};_0xa5e5bd(++_0x4a65e7);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 0c43591..d790678 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 _0x21d6=['src','uniqueid','lodash','../../config/logger','api','moment','request-promise','rimraf','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst'];(function(_0x143620,_0x2738da){var _0x24fcec=function(_0x4ce62c){while(--_0x4ce62c){_0x143620['push'](_0x143620['shift']());}};_0x24fcec(++_0x2738da);}(_0x21d6,0x8a));var _0x621d=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x21d6[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x621d('0x0'));var util=require('util');var logger=require(_0x621d('0x1'))(_0x621d('0x2'));var moment=require(_0x621d('0x3'));var BPromise=require('bluebird');var rp=require(_0x621d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x621d('0x5'));var config=require('../../config/environment');var attributes=require(_0x621d('0x6'));module[_0x621d('0x7')]=function(_0x5d4916,_0x3afb2c){return _0x5d4916[_0x621d('0x8')](_0x621d('0x9'),attributes,{'tableName':_0x621d('0xa'),'paranoid':![],'indexes':[{'name':_0x621d('0xb'),'fields':[_0x621d('0xb')]},{'name':_0x621d('0xc'),'fields':[_0x621d('0xc')]},{'name':_0x621d('0xd'),'fields':[_0x621d('0xd')]},{'name':_0x621d('0xe'),'fields':['dst']},{'name':_0x621d('0xf'),'fields':['src']},{'name':_0x621d('0x10'),'fields':[_0x621d('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5ac7=['rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','disposition','dst','src','uniqueid','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2e9266,_0x1f0e21){var _0x144c3c=function(_0xb39e01){while(--_0xb39e01){_0x2e9266['push'](_0x2e9266['shift']());}};_0x144c3c(++_0x1f0e21);}(_0x5ac7,0xf8));var _0x75ac=function(_0x542acc,_0x2d1d68){_0x542acc=_0x542acc-0x0;var _0x2f9d89=_0x5ac7[_0x542acc];return _0x2f9d89;};'use strict';var _=require(_0x75ac('0x0'));var util=require('util');var logger=require(_0x75ac('0x1'))('api');var moment=require('moment');var BPromise=require(_0x75ac('0x2'));var rp=require(_0x75ac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ac('0x4'));var config=require(_0x75ac('0x5'));var attributes=require(_0x75ac('0x6'));module['exports']=function(_0x4b36e4,_0x5047e7){return _0x4b36e4[_0x75ac('0x7')]('Cdr',attributes,{'tableName':_0x75ac('0x8'),'paranoid':![],'indexes':[{'name':_0x75ac('0x9'),'fields':[_0x75ac('0x9')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x75ac('0xa')]},{'name':_0x75ac('0xb'),'fields':[_0x75ac('0xb')]},{'name':_0x75ac('0xc'),'fields':['src']},{'name':_0x75ac('0xd'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index bbf0387..d31f534 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 _0x2922=['info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x56c10d,_0x41c8f2){var _0xeaa0ce=function(_0x1b2a94){while(--_0x1b2a94){_0x56c10d['push'](_0x56c10d['shift']());}};_0xeaa0ce(++_0x41c8f2);}(_0x2922,0x1e6));var _0x2292=function(_0x1f13d8,_0x3cbeb2){_0x1f13d8=_0x1f13d8-0x0;var _0x315e1c=_0x2922[_0x1f13d8];return _0x315e1c;};'use strict';var _=require(_0x2292('0x0'));var util=require(_0x2292('0x1'));var moment=require(_0x2292('0x2'));var BPromise=require(_0x2292('0x3'));var rs=require(_0x2292('0x4'));var fs=require('fs');var Redis=require(_0x2292('0x5'));var db=require(_0x2292('0x6'))['db'];var utils=require(_0x2292('0x7'));var logger=require(_0x2292('0x8'))(_0x2292('0x9'));var config=require(_0x2292('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2292('0xb')][_0x2292('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb87f20,_0x3b6dd4,_0x3cf0ad){return new BPromise(function(_0x304ca,_0x4b150e){return client[_0x2292('0xd')](_0xb87f20,_0x3cf0ad)['then'](function(_0x2d4c44){logger[_0x2292('0xe')]('Cdr,\x20%s,\x20%s',_0x3b6dd4,'request\x20sent');logger[_0x2292('0xf')](_0x2292('0x10'),_0x3b6dd4,_0x2292('0x11'),JSON[_0x2292('0x12')](_0x2d4c44));if(_0x2d4c44[_0x2292('0x13')]){if(_0x2d4c44[_0x2292('0x13')][_0x2292('0x14')]===0x1f4){logger[_0x2292('0x13')](_0x2292('0x15'),_0x3b6dd4,_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);return _0x4b150e(_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);}logger[_0x2292('0x13')](_0x2292('0x15'),_0x3b6dd4,_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);return _0x304ca(_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);}else{logger[_0x2292('0xe')](_0x2292('0x15'),_0x3b6dd4,_0x2292('0x11'));_0x304ca(_0x2d4c44[_0x2292('0x17')]['message']);}})[_0x2292('0x18')](function(_0x5be346){logger[_0x2292('0x13')]('Cdr,\x20%s,\x20%s',_0x3b6dd4,_0x5be346);_0x4b150e(_0x5be346);});});} \ No newline at end of file +var _0x168a=['Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x168a,0x7b));var _0xa168=function(_0x2b2e9d,_0x4bb005){_0x2b2e9d=_0x2b2e9d-0x0;var _0x1fd474=_0x168a[_0x2b2e9d];return _0x1fd474;};'use strict';var _=require(_0xa168('0x0'));var util=require(_0xa168('0x1'));var moment=require(_0xa168('0x2'));var BPromise=require('bluebird');var rs=require(_0xa168('0x3'));var fs=require('fs');var Redis=require(_0xa168('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa168('0x5'));var logger=require(_0xa168('0x6'))(_0xa168('0x7'));var config=require(_0xa168('0x8'));var jayson=require(_0xa168('0x9'));var client=jayson[_0xa168('0xa')][_0xa168('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b2f5,_0x1f6872,_0x1f6d61){return new BPromise(function(_0x69dee5,_0x47868b){return client[_0xa168('0xc')](_0x38b2f5,_0x1f6d61)[_0xa168('0xd')](function(_0x5e7736){logger[_0xa168('0xe')](_0xa168('0xf'),_0x1f6872,'request\x20sent');logger[_0xa168('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x1f6872,_0xa168('0x11'),JSON[_0xa168('0x12')](_0x5e7736));if(_0x5e7736['error']){if(_0x5e7736[_0xa168('0x13')]['code']===0x1f4){logger[_0xa168('0x13')](_0xa168('0xf'),_0x1f6872,_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);return _0x47868b(_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x1f6872,_0x5e7736[_0xa168('0x13')][_0xa168('0x14')]);return _0x69dee5(_0x5e7736[_0xa168('0x13')]['message']);}else{logger[_0xa168('0xe')](_0xa168('0xf'),_0x1f6872,'request\x20sent');_0x69dee5(_0x5e7736[_0xa168('0x15')][_0xa168('0x14')]);}})[_0xa168('0x16')](function(_0x6130ea){logger[_0xa168('0x13')]('Cdr,\x20%s,\x20%s',_0x1f6872,_0x6130ea);_0x47868b(_0x6130ea);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d0bc43a..ce876b1 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 _0xd2ca=['index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xd2ca,0x15a));var _0xad2c=function(_0x54f56c,_0x2953b7){_0x54f56c=_0x54f56c-0x0;var _0x3d86e9=_0xd2ca[_0x54f56c];return _0x3d86e9;};'use strict';var multer=require(_0xad2c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad2c('0x1'));var router=express['Router']();var auth=require(_0xad2c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xad2c('0x3'));var controller=require('./cdr.controller');router[_0xad2c('0x4')]('/',auth[_0xad2c('0x5')](),controller[_0xad2c('0x6')]);router[_0xad2c('0x4')](_0xad2c('0x7'),auth[_0xad2c('0x5')](),controller[_0xad2c('0x8')]);router['get'](_0xad2c('0x9'),auth['isAuthenticated'](),controller[_0xad2c('0xa')]);router[_0xad2c('0xb')]('/',auth[_0xad2c('0x5')](),controller['create']);router[_0xad2c('0xc')]('/:id',auth[_0xad2c('0x5')](),controller[_0xad2c('0xd')]);router['delete'](_0xad2c('0x9'),auth[_0xad2c('0x5')](),controller[_0xad2c('0xe')]);module[_0xad2c('0xf')]=router; \ No newline at end of file +var _0x3649=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','post','create','put'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x3649,0x1d1));var _0x9364=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3649[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x9364('0x0'));var util=require(_0x9364('0x1'));var path=require(_0x9364('0x2'));var timeout=require(_0x9364('0x3'));var express=require(_0x9364('0x4'));var router=express[_0x9364('0x5')]();var auth=require(_0x9364('0x6'));var interaction=require(_0x9364('0x7'));var config=require(_0x9364('0x8'));var controller=require('./cdr.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9364('0x9')]);router[_0x9364('0xa')](_0x9364('0xb'),auth['isAuthenticated'](),controller[_0x9364('0xc')]);router[_0x9364('0xa')](_0x9364('0xd'),auth[_0x9364('0xe')](),controller['show']);router[_0x9364('0xf')]('/',auth[_0x9364('0xe')](),controller[_0x9364('0x10')]);router[_0x9364('0x11')](_0x9364('0xd'),auth[_0x9364('0xe')](),controller[_0x9364('0x12')]);router['delete'](_0x9364('0xd'),auth['isAuthenticated'](),controller[_0x9364('0x13')]);module[_0x9364('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index ef03fe4..c43f04d 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 _0xb9a7=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0xbd3a05,_0xe6c6b7){var _0x101f90=function(_0x34fbcb){while(--_0x34fbcb){_0xbd3a05['push'](_0xbd3a05['shift']());}};_0x101f90(++_0xe6c6b7);}(_0xb9a7,0x172));var _0x7b9a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb9a7[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x7b9a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7b9a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7b9a('0x2')],'allowNull':![],'defaultValue':_0x7b9a('0x3')},'appdata':{'type':Sequelize[_0x7b9a('0x4')]()},'description':{'type':Sequelize[_0x7b9a('0x2')]},'interval':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':_0x7b9a('0x5')}}; \ No newline at end of file +var _0xd4ad=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xd4ad,0x158));var _0xdd4a=function(_0x28eb41,_0x29b5fe){_0x28eb41=_0x28eb41-0x0;var _0x3ad285=_0xd4ad[_0x28eb41];return _0x3ad285;};'use strict';var Sequelize=require(_0xdd4a('0x0'));module[_0xdd4a('0x1')]={'priority':{'type':Sequelize[_0xdd4a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdd4a('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdd4a('0x4')]()},'description':{'type':Sequelize[_0xdd4a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1602a46..3012e4c 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 _0x42ec=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','params','model','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x42ec,0x16a));var _0xc42e=function(_0x22c239,_0x102b65){_0x22c239=_0x22c239-0x0;var _0x234a18=_0x42ec[_0x22c239];return _0x234a18;};'use strict';var pdf=require(_0xc42e('0x0'));var emlformat=require(_0xc42e('0x1'));var rimraf=require(_0xc42e('0x2'));var zipdir=require(_0xc42e('0x3'));var jsonpatch=require(_0xc42e('0x4'));var rp=require(_0xc42e('0x5'));var moment=require(_0xc42e('0x6'));var BPromise=require(_0xc42e('0x7'));var Mustache=require('mustache');var util=require(_0xc42e('0x8'));var path=require(_0xc42e('0x9'));var sox=require(_0xc42e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc42e('0xb'));var squel=require(_0xc42e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc42e('0xd'));var Papa=require(_0xc42e('0xe'));var Redis=require(_0xc42e('0xf'));var authService=require(_0xc42e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc42e('0x11'));var logger=require('../../config/logger')(_0xc42e('0x12'));var utils=require('../../config/utils');var config=require(_0xc42e('0x13'));var db=require(_0xc42e('0x14'))['db'];function respondWithStatusCode(_0x4d0d16,_0x549d04){_0x549d04=_0x549d04||0xcc;return function(_0x5fcb32){if(_0x5fcb32){return _0x4d0d16[_0xc42e('0x15')](_0x549d04);}return _0x4d0d16[_0xc42e('0x16')](_0x549d04)['end']();};}function respondWithResult(_0x50c582,_0x7f94f2){_0x7f94f2=_0x7f94f2||0xc8;return function(_0xf3eedf){if(_0xf3eedf){return _0x50c582[_0xc42e('0x16')](_0x7f94f2)[_0xc42e('0x17')](_0xf3eedf);}};}function respondWithFilteredResult(_0x4a7793,_0x5505d1){return function(_0x115ccc){if(_0x115ccc){var _0x4d11c7=_0x115ccc[_0xc42e('0x18')],_0x178b8e=_0x5505d1['offset'],_0x4097fa=_0x5505d1[_0xc42e('0x19')]+_0x5505d1[_0xc42e('0x1a')],_0x484ce9;if(_0x4097fa>=_0x4d11c7){_0x4097fa=_0x4d11c7;_0x484ce9=0xc8;}else{_0x484ce9=0xce;}_0x4a7793['status'](_0x484ce9);return _0x4a7793[_0xc42e('0x1b')](_0xc42e('0x1c'),_0x178b8e+'-'+_0x4097fa+'/'+_0x4d11c7)[_0xc42e('0x17')](_0x115ccc);}return null;};}function patchUpdates(_0x304964){return function(_0x1e2c01){try{jsonpatch[_0xc42e('0x1d')](_0x1e2c01,_0x304964,!![]);}catch(_0x3fbdfb){return BPromise[_0xc42e('0x1e')](_0x3fbdfb);}return _0x1e2c01[_0xc42e('0x1f')]();};}function saveUpdates(_0x36ffb1,_0x35b5ae){return function(_0x1f3b13){if(_0x1f3b13){return _0x1f3b13[_0xc42e('0x20')](_0x36ffb1)[_0xc42e('0x21')](function(_0x10ad4b){return _0x10ad4b;});}return null;};}function removeEntity(_0x21bc1e,_0x576b76){return function(_0x2a70c5){if(_0x2a70c5){return _0x2a70c5[_0xc42e('0x22')]()[_0xc42e('0x21')](function(){_0x21bc1e['status'](0xcc)[_0xc42e('0x23')]();});}};}function handleEntityNotFound(_0x3df86e,_0x3dd688){return function(_0xffe47a){if(!_0xffe47a){_0x3df86e['sendStatus'](0x194);}return _0xffe47a;};}function handleError(_0x640507,_0x2cae4a){_0x2cae4a=_0x2cae4a||0x1f4;return function(_0x33b5d5){logger[_0xc42e('0x24')](_0x33b5d5[_0xc42e('0x25')]);if(_0x33b5d5['name']){delete _0x33b5d5[_0xc42e('0x26')];}_0x640507['status'](_0x2cae4a)['send'](_0x33b5d5);};}exports['show']=function(_0x4ffa0f,_0x319158){var _0x42e844={'raw':!![],'where':{'id':_0x4ffa0f[_0xc42e('0x27')]['id']}},_0x536a15={};_0x536a15[_0xc42e('0x28')]=_['keys'](db[_0xc42e('0x29')][_0xc42e('0x2a')]);_0x536a15[_0xc42e('0x2b')]=_['keys'](_0x4ffa0f[_0xc42e('0x2b')]);_0x536a15[_0xc42e('0x2c')]=_[_0xc42e('0x2d')](_0x536a15['model'],_0x536a15['query']);_0x42e844['attributes']=_[_0xc42e('0x2d')](_0x536a15[_0xc42e('0x28')],qs[_0xc42e('0x2e')](_0x4ffa0f[_0xc42e('0x2b')][_0xc42e('0x2e')]));_0x42e844[_0xc42e('0x2f')]=_0x42e844[_0xc42e('0x2f')][_0xc42e('0x30')]?_0x42e844['attributes']:_0x536a15['model'];if(_0x4ffa0f['query'][_0xc42e('0x31')]){_0x42e844[_0xc42e('0x32')]=[{'all':!![]}];}_0x42e844=_[_0xc42e('0x33')]({},_0x42e844,_0x4ffa0f[_0xc42e('0x34')]);return db[_0xc42e('0x29')]['find'](_0x42e844)[_0xc42e('0x21')](handleEntityNotFound(_0x319158,null))['then'](respondWithResult(_0x319158,null))['catch'](handleError(_0x319158,null));};exports[_0xc42e('0x20')]=function(_0x2d2c8f,_0x1728c0){if(_0x2d2c8f[_0xc42e('0x35')]['id']){delete _0x2d2c8f[_0xc42e('0x35')]['id'];}return db[_0xc42e('0x29')]['find']({'where':{'id':_0x2d2c8f[_0xc42e('0x27')]['id']}})[_0xc42e('0x21')](handleEntityNotFound(_0x1728c0,null))[_0xc42e('0x21')](saveUpdates(_0x2d2c8f[_0xc42e('0x35')],null))[_0xc42e('0x21')](respondWithResult(_0x1728c0,null))[_0xc42e('0x36')](handleError(_0x1728c0,null));};exports[_0xc42e('0x22')]=function(_0x930b66,_0x4f9afd){return db[_0xc42e('0x29')]['find']({'where':{'id':_0x930b66[_0xc42e('0x27')]['id']}})[_0xc42e('0x21')](handleEntityNotFound(_0x4f9afd,null))[_0xc42e('0x21')](removeEntity(_0x4f9afd,null))[_0xc42e('0x36')](handleError(_0x4f9afd,null));}; \ No newline at end of file +var _0x3faf=['../../mysqldb','end','status','count','offset','limit','set','json','apply','reject','update','then','sendStatus','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x3faf,0x17a));var _0xf3fa=function(_0x30115f,_0x159cb2){_0x30115f=_0x30115f-0x0;var _0x545e81=_0x3faf[_0x30115f];return _0x545e81;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf3fa('0x0'));var rimraf=require(_0xf3fa('0x1'));var zipdir=require(_0xf3fa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3fa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3fa('0x4'));var util=require(_0xf3fa('0x5'));var path=require(_0xf3fa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf3fa('0x7'));var fs=require('fs');var _=require(_0xf3fa('0x8'));var squel=require(_0xf3fa('0x9'));var crypto=require(_0xf3fa('0xa'));var jsforce=require(_0xf3fa('0xb'));var deskjs=require(_0xf3fa('0xc'));var toCsv=require(_0xf3fa('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf3fa('0xe'));var authService=require(_0xf3fa('0xf'));var qs=require(_0xf3fa('0x10'));var hardwareService=require(_0xf3fa('0x11'));var logger=require(_0xf3fa('0x12'))('api');var utils=require(_0xf3fa('0x13'));var config=require(_0xf3fa('0x14'));var db=require(_0xf3fa('0x15'))['db'];function respondWithStatusCode(_0x24bcda,_0x526d43){_0x526d43=_0x526d43||0xcc;return function(_0x4b09ce){if(_0x4b09ce){return _0x24bcda['sendStatus'](_0x526d43);}return _0x24bcda['status'](_0x526d43)[_0xf3fa('0x16')]();};}function respondWithResult(_0x4e7944,_0x94065e){_0x94065e=_0x94065e||0xc8;return function(_0x18c55c){if(_0x18c55c){return _0x4e7944[_0xf3fa('0x17')](_0x94065e)['json'](_0x18c55c);}};}function respondWithFilteredResult(_0x172005,_0x11d30d){return function(_0x4fa30d){if(_0x4fa30d){var _0x1297e2=_0x4fa30d[_0xf3fa('0x18')],_0x198eb4=_0x11d30d[_0xf3fa('0x19')],_0x2e69a2=_0x11d30d[_0xf3fa('0x19')]+_0x11d30d[_0xf3fa('0x1a')],_0x3f617c;if(_0x2e69a2>=_0x1297e2){_0x2e69a2=_0x1297e2;_0x3f617c=0xc8;}else{_0x3f617c=0xce;}_0x172005['status'](_0x3f617c);return _0x172005[_0xf3fa('0x1b')]('Content-Range',_0x198eb4+'-'+_0x2e69a2+'/'+_0x1297e2)[_0xf3fa('0x1c')](_0x4fa30d);}return null;};}function patchUpdates(_0x27395f){return function(_0x152bb0){try{jsonpatch[_0xf3fa('0x1d')](_0x152bb0,_0x27395f,!![]);}catch(_0x4fde03){return BPromise[_0xf3fa('0x1e')](_0x4fde03);}return _0x152bb0['save']();};}function saveUpdates(_0x545763,_0x5a122c){return function(_0x379a84){if(_0x379a84){return _0x379a84[_0xf3fa('0x1f')](_0x545763)[_0xf3fa('0x20')](function(_0x491cd0){return _0x491cd0;});}return null;};}function removeEntity(_0x334284,_0x572aeb){return function(_0x5c481d){if(_0x5c481d){return _0x5c481d['destroy']()[_0xf3fa('0x20')](function(){_0x334284[_0xf3fa('0x17')](0xcc)[_0xf3fa('0x16')]();});}};}function handleEntityNotFound(_0x8c9497,_0x1337b8){return function(_0x2c82d8){if(!_0x2c82d8){_0x8c9497[_0xf3fa('0x21')](0x194);}return _0x2c82d8;};}function handleError(_0x3fbc7d,_0x49c0fa){_0x49c0fa=_0x49c0fa||0x1f4;return function(_0x8834c3){logger['error'](_0x8834c3[_0xf3fa('0x22')]);if(_0x8834c3['name']){delete _0x8834c3[_0xf3fa('0x23')];}_0x3fbc7d[_0xf3fa('0x17')](_0x49c0fa)[_0xf3fa('0x24')](_0x8834c3);};}exports[_0xf3fa('0x25')]=function(_0x35b0b7,_0x5e242c){var _0x38ba7e={'raw':!![],'where':{'id':_0x35b0b7[_0xf3fa('0x26')]['id']}},_0xefeef={};_0xefeef[_0xf3fa('0x27')]=_[_0xf3fa('0x28')](db['ChatApplication'][_0xf3fa('0x29')]);_0xefeef[_0xf3fa('0x2a')]=_[_0xf3fa('0x28')](_0x35b0b7[_0xf3fa('0x2a')]);_0xefeef[_0xf3fa('0x2b')]=_[_0xf3fa('0x2c')](_0xefeef[_0xf3fa('0x27')],_0xefeef['query']);_0x38ba7e[_0xf3fa('0x2d')]=_[_0xf3fa('0x2c')](_0xefeef[_0xf3fa('0x27')],qs[_0xf3fa('0x2e')](_0x35b0b7['query'][_0xf3fa('0x2e')]));_0x38ba7e[_0xf3fa('0x2d')]=_0x38ba7e[_0xf3fa('0x2d')][_0xf3fa('0x2f')]?_0x38ba7e['attributes']:_0xefeef[_0xf3fa('0x27')];if(_0x35b0b7[_0xf3fa('0x2a')][_0xf3fa('0x30')]){_0x38ba7e[_0xf3fa('0x31')]=[{'all':!![]}];}_0x38ba7e=_[_0xf3fa('0x32')]({},_0x38ba7e,_0x35b0b7[_0xf3fa('0x33')]);return db[_0xf3fa('0x34')][_0xf3fa('0x35')](_0x38ba7e)[_0xf3fa('0x20')](handleEntityNotFound(_0x5e242c,null))[_0xf3fa('0x20')](respondWithResult(_0x5e242c,null))[_0xf3fa('0x36')](handleError(_0x5e242c,null));};exports[_0xf3fa('0x1f')]=function(_0x34450f,_0x1c3620){if(_0x34450f[_0xf3fa('0x37')]['id']){delete _0x34450f['body']['id'];}return db[_0xf3fa('0x34')][_0xf3fa('0x35')]({'where':{'id':_0x34450f[_0xf3fa('0x26')]['id']}})[_0xf3fa('0x20')](handleEntityNotFound(_0x1c3620,null))[_0xf3fa('0x20')](saveUpdates(_0x34450f[_0xf3fa('0x37')],null))['then'](respondWithResult(_0x1c3620,null))[_0xf3fa('0x36')](handleError(_0x1c3620,null));};exports[_0xf3fa('0x38')]=function(_0x28152b,_0xc95094){return db[_0xf3fa('0x34')][_0xf3fa('0x35')]({'where':{'id':_0x28152b[_0xf3fa('0x26')]['id']}})[_0xf3fa('0x20')](handleEntityNotFound(_0xc95094,null))['then'](removeEntity(_0xc95094,null))[_0xf3fa('0x36')](handleError(_0xc95094,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 508c47f..e4c4a2e 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 _0x2aff=['./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x8957ed,_0x1b1553){var _0xcc833a=function(_0x1c49e4){while(--_0x1c49e4){_0x8957ed['push'](_0x8957ed['shift']());}};_0xcc833a(++_0x1b1553);}(_0x2aff,0x18b));var _0xf2af=function(_0x1c1bef,_0x126ff5){_0x1c1bef=_0x1c1bef-0x0;var _0x2c5f6a=_0x2aff[_0x1c1bef];return _0x2c5f6a;};'use strict';var _=require(_0xf2af('0x0'));var util=require(_0xf2af('0x1'));var logger=require(_0xf2af('0x2'))(_0xf2af('0x3'));var moment=require(_0xf2af('0x4'));var BPromise=require(_0xf2af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf2af('0x6'));var config=require(_0xf2af('0x7'));var attributes=require(_0xf2af('0x8'));module[_0xf2af('0x9')]=function(_0x21104b,_0x29a4aa){return _0x21104b['define'](_0xf2af('0xa'),attributes,{'tableName':_0xf2af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf2af('0xc')});}; \ No newline at end of file +var _0xb9e2=['./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','util','bluebird','request-promise','../../config/environment'];(function(_0x17f63f,_0x3d3dc1){var _0x288a54=function(_0x38e731){while(--_0x38e731){_0x17f63f['push'](_0x17f63f['shift']());}};_0x288a54(++_0x3d3dc1);}(_0xb9e2,0x9b));var _0x2b9e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb9e2[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x2b9e('0x0'));var util=require(_0x2b9e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2b9e('0x2'));var rp=require(_0x2b9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b9e('0x4'));var attributes=require(_0x2b9e('0x5'));module[_0x2b9e('0x6')]=function(_0x55a169,_0x425211){return _0x55a169[_0x2b9e('0x7')]('ChatApplication',attributes,{'tableName':_0x2b9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b9e('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 6339840..6d8d62e 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 _0x038a=['request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5a70fd,_0x3b4b27){var _0x429466=function(_0xb731d8){while(--_0xb731d8){_0x5a70fd['push'](_0x5a70fd['shift']());}};_0x429466(++_0x3b4b27);}(_0x038a,0x137));var _0xa038=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x038a[_0x22cb5f];return _0x274d36;};'use strict';var _=require(_0xa038('0x0'));var util=require(_0xa038('0x1'));var moment=require(_0xa038('0x2'));var BPromise=require(_0xa038('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa038('0x4'));var db=require(_0xa038('0x5'))['db'];var utils=require(_0xa038('0x6'));var logger=require(_0xa038('0x7'))(_0xa038('0x8'));var config=require('../../config/environment');var jayson=require(_0xa038('0x9'));var client=jayson['client'][_0xa038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaecb0b,_0x348a77,_0xb4aaca){return new BPromise(function(_0x3ba7b9,_0x1e2b86){return client[_0xa038('0xb')](_0xaecb0b,_0xb4aaca)['then'](function(_0x1c5860){logger[_0xa038('0xc')](_0xa038('0xd'),_0x348a77,'request\x20sent');logger[_0xa038('0xe')](_0xa038('0xf'),_0x348a77,_0xa038('0x10'),JSON[_0xa038('0x11')](_0x1c5860));if(_0x1c5860['error']){if(_0x1c5860['error'][_0xa038('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x348a77,_0x1c5860['error'][_0xa038('0x13')]);return _0x1e2b86(_0x1c5860[_0xa038('0x14')]['message']);}logger['error'](_0xa038('0xd'),_0x348a77,_0x1c5860[_0xa038('0x14')]['message']);return _0x3ba7b9(_0x1c5860[_0xa038('0x14')]['message']);}else{logger[_0xa038('0xc')]('ChatApplication,\x20%s,\x20%s',_0x348a77,'request\x20sent');_0x3ba7b9(_0x1c5860[_0xa038('0x15')]['message']);}})[_0xa038('0x16')](function(_0x52bf6d){logger['error'](_0xa038('0xd'),_0x348a77,_0x52bf6d);_0x1e2b86(_0x52bf6d);});});} \ No newline at end of file +var _0x059e=['result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5edb22,_0x136394){var _0x3f9dba=function(_0x9dd4fa){while(--_0x9dd4fa){_0x5edb22['push'](_0x5edb22['shift']());}};_0x3f9dba(++_0x136394);}(_0x059e,0xe6));var _0xe059=function(_0x2d40f0,_0xed5b5){_0x2d40f0=_0x2d40f0-0x0;var _0x3359c6=_0x059e[_0x2d40f0];return _0x3359c6;};'use strict';var _=require(_0xe059('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe059('0x1'));var rs=require(_0xe059('0x2'));var fs=require('fs');var Redis=require(_0xe059('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe059('0x4'));var logger=require(_0xe059('0x5'))('rpc');var config=require(_0xe059('0x6'));var jayson=require(_0xe059('0x7'));var client=jayson['client'][_0xe059('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5467cf,_0x4d717d,_0x3577f4){return new BPromise(function(_0x2fc3e3,_0x1d0c70){return client['request'](_0x5467cf,_0x3577f4)['then'](function(_0x47010b){logger[_0xe059('0x9')](_0xe059('0xa'),_0x4d717d,_0xe059('0xb'));logger[_0xe059('0xc')](_0xe059('0xd'),_0x4d717d,_0xe059('0xb'),JSON['stringify'](_0x47010b));if(_0x47010b['error']){if(_0x47010b[_0xe059('0xe')][_0xe059('0xf')]===0x1f4){logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x47010b['error'][_0xe059('0x10')]);return _0x1d0c70(_0x47010b[_0xe059('0xe')][_0xe059('0x10')]);}logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x47010b['error']['message']);return _0x2fc3e3(_0x47010b[_0xe059('0xe')][_0xe059('0x10')]);}else{logger[_0xe059('0x9')](_0xe059('0xa'),_0x4d717d,'request\x20sent');_0x2fc3e3(_0x47010b[_0xe059('0x11')]['message']);}})[_0xe059('0x12')](function(_0x9268ce){logger[_0xe059('0xe')](_0xe059('0xa'),_0x4d717d,_0x9268ce);_0x1d0c70(_0x9268ce);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f8cbe2e..ede279b 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 _0x52c1=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5d93ba,_0x386640){var _0x2b5bd3=function(_0x5a4971){while(--_0x5a4971){_0x5d93ba['push'](_0x5d93ba['shift']());}};_0x2b5bd3(++_0x386640);}(_0x52c1,0x163));var _0x152c=function(_0x174a1d,_0x580ab8){_0x174a1d=_0x174a1d-0x0;var _0x269f8b=_0x52c1[_0x174a1d];return _0x269f8b;};'use strict';var multer=require('multer');var util=require(_0x152c('0x0'));var path=require(_0x152c('0x1'));var timeout=require(_0x152c('0x2'));var express=require('express');var router=express[_0x152c('0x3')]();var auth=require(_0x152c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x152c('0x5'));var controller=require(_0x152c('0x6'));router[_0x152c('0x7')](_0x152c('0x8'),auth[_0x152c('0x9')](),controller['show']);router[_0x152c('0xa')](_0x152c('0x8'),auth[_0x152c('0x9')](),controller[_0x152c('0xb')]);router[_0x152c('0xc')](_0x152c('0x8'),auth['isAuthenticated'](),controller[_0x152c('0xd')]);module[_0x152c('0xe')]=router; \ No newline at end of file +var _0x9ddf=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9ddf,0x16d));var _0xf9dd=function(_0x221700,_0x57af01){_0x221700=_0x221700-0x0;var _0x185e8f=_0x9ddf[_0x221700];return _0x185e8f;};'use strict';var multer=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var path=require(_0xf9dd('0x2'));var timeout=require(_0xf9dd('0x3'));var express=require(_0xf9dd('0x4'));var router=express[_0xf9dd('0x5')]();var auth=require(_0xf9dd('0x6'));var interaction=require(_0xf9dd('0x7'));var config=require(_0xf9dd('0x8'));var controller=require(_0xf9dd('0x9'));router[_0xf9dd('0xa')](_0xf9dd('0xb'),auth[_0xf9dd('0xc')](),controller['show']);router[_0xf9dd('0xd')]('/:id',auth[_0xf9dd('0xc')](),controller[_0xf9dd('0xe')]);router[_0xf9dd('0xf')]('/:id',auth[_0xf9dd('0xc')](),controller[_0xf9dd('0x10')]);module[_0xf9dd('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 7f49e43..4c3c78b 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 _0x0503=['exports','STRING','BOOLEAN','sequelize'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x0503,0x18f));var _0x3050=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x0503[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x3050('0x0'));module[_0x3050('0x1')]={'name':{'type':Sequelize[_0x3050('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3050('0x2')]},'write':{'type':Sequelize[_0x3050('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x12c9=['STRING','BOOLEAN','exports'];(function(_0x24166f,_0x33e4b8){var _0x280943=function(_0x5301eb){while(--_0x5301eb){_0x24166f['push'](_0x24166f['shift']());}};_0x280943(++_0x33e4b8);}(_0x12c9,0xb9));var _0x912c=function(_0xb69dc5,_0x12c13b){_0xb69dc5=_0xb69dc5-0x0;var _0x532ff8=_0x12c9[_0xb69dc5];return _0x532ff8;};'use strict';var Sequelize=require('sequelize');module[_0x912c('0x0')]={'name':{'type':Sequelize[_0x912c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x912c('0x1')]},'write':{'type':Sequelize[_0x912c('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 0d6fad5..3bf1055 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 _0xe1f4=['hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','length','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','pick','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','./chatGroup.socket','register','jayson/promise','client','http','test','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','save','update','stack','name','index','ChatGroup','model','keys','query','filters','intersection','attributes','fields'];(function(_0x270606,_0x4f6ee2){var _0x1cd9df=function(_0x2c0cac){while(--_0x2c0cac){_0x270606['push'](_0x270606['shift']());}};_0x1cd9df(++_0x4f6ee2);}(_0xe1f4,0x100));var _0x4e1f=function(_0x209e05,_0xc489b4){_0x209e05=_0x209e05-0x0;var _0x18ee7f=_0xe1f4[_0x209e05];return _0x18ee7f;};'use strict';var pdf=require(_0x4e1f('0x0'));var emlformat=require(_0x4e1f('0x1'));var rimraf=require(_0x4e1f('0x2'));var zipdir=require(_0x4e1f('0x3'));var jsonpatch=require(_0x4e1f('0x4'));var rp=require('request-promise');var moment=require(_0x4e1f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e1f('0x6'));var util=require(_0x4e1f('0x7'));var path=require(_0x4e1f('0x8'));var sox=require(_0x4e1f('0x9'));var csv=require(_0x4e1f('0xa'));var ejs=require(_0x4e1f('0xb'));var fs=require('fs');var _=require(_0x4e1f('0xc'));var squel=require(_0x4e1f('0xd'));var crypto=require('crypto');var jsforce=require(_0x4e1f('0xe'));var deskjs=require(_0x4e1f('0xf'));var toCsv=require(_0x4e1f('0xa'));var querystring=require(_0x4e1f('0x10'));var Papa=require(_0x4e1f('0x11'));var Redis=require(_0x4e1f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4e1f('0x13'));var logger=require(_0x4e1f('0x14'))(_0x4e1f('0x15'));var utils=require(_0x4e1f('0x16'));var config=require(_0x4e1f('0x17'));var db=require('../../mysqldb')['db'];config[_0x4e1f('0x18')]=_['defaults'](config[_0x4e1f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e1f('0x18')]));require(_0x4e1f('0x19'))[_0x4e1f('0x1a')](socket);var jayson=require(_0x4e1f('0x1b'));var client=jayson[_0x4e1f('0x1c')][_0x4e1f('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5212b9,_0x15a80a,_0x4b02eb){if(_0x4b02eb){var _0xc7ffbb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc7ffbb[_0x4e1f('0x1e')](_0x15a80a)){return _0x5212b9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5212b9;}}function respondWithRpcPromise(_0x1f00cb,_0x492e8d,_0x2a1008,_0x111dea){return new BPromise(function(_0x1b97ec,_0x4212b9){var _0x638c58=_0x111dea||client;return _0x638c58['request'](_0x1f00cb,_0x2a1008)[_0x4e1f('0x1f')](function(_0x11dd84){logger['info']('ChatGroup,\x20%s,\x20%s',_0x492e8d,'request\x20sent');logger[_0x4e1f('0x20')](_0x4e1f('0x21'),_0x492e8d,_0x4e1f('0x22'),JSON[_0x4e1f('0x23')](_0x11dd84));if(_0x11dd84['error']){if(_0x11dd84['error'][_0x4e1f('0x24')]===0x1f4){logger[_0x4e1f('0x25')](_0x4e1f('0x26'),_0x492e8d,_0x11dd84['error'][_0x4e1f('0x27')]);return _0x4212b9(_0x11dd84[_0x4e1f('0x25')]['message']);}logger[_0x4e1f('0x25')](_0x4e1f('0x26'),_0x492e8d,_0x11dd84[_0x4e1f('0x25')][_0x4e1f('0x27')]);return _0x1b97ec(_0x11dd84[_0x4e1f('0x25')][_0x4e1f('0x27')]);}else{logger[_0x4e1f('0x28')]('ChatGroup,\x20%s,\x20%s',_0x492e8d,_0x4e1f('0x22'));_0x1b97ec(_0x11dd84[_0x4e1f('0x29')][_0x4e1f('0x27')]);}})[_0x4e1f('0x2a')](function(_0x29b856){logger['error'](_0x4e1f('0x26'),_0x492e8d,_0x29b856);_0x4212b9(_0x29b856);});});}function respondWithStatusCode(_0x1362c1,_0x21982b){_0x21982b=_0x21982b||0xcc;return function(_0x5c78cd){if(_0x5c78cd){return _0x1362c1[_0x4e1f('0x2b')](_0x21982b);}return _0x1362c1['status'](_0x21982b)[_0x4e1f('0x2c')]();};}function respondWithResult(_0x596a00,_0xbd4ef6){_0xbd4ef6=_0xbd4ef6||0xc8;return function(_0x31fd4b){if(_0x31fd4b){return _0x596a00[_0x4e1f('0x2d')](_0xbd4ef6)['json'](_0x31fd4b);}};}function respondWithFilteredResult(_0x3233c8,_0x27530d){return function(_0x5ac101){if(_0x5ac101){var _0x500803=_0x5ac101[_0x4e1f('0x2e')],_0x221d37=_0x27530d[_0x4e1f('0x2f')],_0x18c677=_0x27530d['offset']+_0x27530d[_0x4e1f('0x30')],_0x530580;if(_0x18c677>=_0x500803){_0x18c677=_0x500803;_0x530580=0xc8;}else{_0x530580=0xce;}_0x3233c8['status'](_0x530580);return _0x3233c8['set'](_0x4e1f('0x31'),_0x221d37+'-'+_0x18c677+'/'+_0x500803)[_0x4e1f('0x32')](_0x5ac101);}return null;};}function patchUpdates(_0x154c50){return function(_0x3e50c3){try{jsonpatch[_0x4e1f('0x33')](_0x3e50c3,_0x154c50,!![]);}catch(_0x16b052){return BPromise['reject'](_0x16b052);}return _0x3e50c3[_0x4e1f('0x34')]();};}function saveUpdates(_0x2ce2ae,_0x35affc){return function(_0x249ec3){if(_0x249ec3){return _0x249ec3[_0x4e1f('0x35')](_0x2ce2ae)[_0x4e1f('0x1f')](function(_0x23d95f){return _0x23d95f;});}return null;};}function removeEntity(_0x50628d,_0x2c061c){return function(_0x40d587){if(_0x40d587){return _0x40d587['destroy']()[_0x4e1f('0x1f')](function(){_0x50628d[_0x4e1f('0x2d')](0xcc)[_0x4e1f('0x2c')]();});}};}function handleEntityNotFound(_0x11df47,_0x4bf953){return function(_0x13e542){if(!_0x13e542){_0x11df47[_0x4e1f('0x2b')](0x194);}return _0x13e542;};}function handleError(_0x3591a2,_0x3dd1c0){_0x3dd1c0=_0x3dd1c0||0x1f4;return function(_0x198e3f){logger['error'](_0x198e3f[_0x4e1f('0x36')]);if(_0x198e3f['name']){delete _0x198e3f[_0x4e1f('0x37')];}_0x3591a2['status'](_0x3dd1c0)['send'](_0x198e3f);};}exports[_0x4e1f('0x38')]=function(_0x736779,_0x12eb49){var _0x2e7fef={},_0x554918={},_0x294423={'count':0x0,'rows':[]};var _0x765560=db[_0x4e1f('0x39')]['rawAttributes'];_0x554918[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](_0x765560);_0x554918[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x736779[_0x4e1f('0x3c')]);_0x554918[_0x4e1f('0x3d')]=_[_0x4e1f('0x3e')](_0x554918[_0x4e1f('0x3a')],_0x554918['query']);_0x2e7fef[_0x4e1f('0x3f')]=_[_0x4e1f('0x3e')](_0x554918[_0x4e1f('0x3a')],qs['fields'](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x40')]));_0x2e7fef[_0x4e1f('0x3f')]=_0x2e7fef['attributes']['length']?_0x2e7fef[_0x4e1f('0x3f')]:_0x554918['model'];if(!_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x2e7fef['limit']=qs['limit'](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x2e7fef[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x2f')]);}_0x2e7fef[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x736779['query'][_0x4e1f('0x44')]);_0x2e7fef[_0x4e1f('0x45')]=qs[_0x4e1f('0x3d')](_['pick'](_0x736779[_0x4e1f('0x3c')],_0x554918[_0x4e1f('0x3d')]));if(_0x736779['query'][_0x4e1f('0x46')]){_0x2e7fef['where']=_[_0x4e1f('0x47')](_0x2e7fef[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x765560,function(_0x6c119a){if(_0x6c119a[_0x4e1f('0x49')][_0x4e1f('0x4a')]!==_0x4e1f('0x4b')){var _0x56163b={};_0x56163b[_0x6c119a[_0x4e1f('0x4c')]]={'$like':'%'+_0x736779['query'][_0x4e1f('0x46')]+'%'};return _0x56163b;}})});}_0x2e7fef=_['merge']({},_0x2e7fef,_0x736779[_0x4e1f('0x4d')]);var _0x166065={'where':_0x2e7fef['where']};return db[_0x4e1f('0x39')][_0x4e1f('0x2e')](_0x166065)[_0x4e1f('0x1f')](function(_0x500cb8){_0x294423[_0x4e1f('0x2e')]=_0x500cb8;if(_0x736779[_0x4e1f('0x3c')]['includeAll']){_0x2e7fef[_0x4e1f('0x4e')]=[{'all':!![]}];}return db[_0x4e1f('0x39')][_0x4e1f('0x4f')](_0x2e7fef);})[_0x4e1f('0x1f')](function(_0x1991aa){_0x294423[_0x4e1f('0x50')]=_0x1991aa;return _0x294423;})['then'](respondWithFilteredResult(_0x12eb49,_0x2e7fef))[_0x4e1f('0x2a')](handleError(_0x12eb49,null));};exports[_0x4e1f('0x51')]=function(_0x954592,_0x2dbfc2){var _0x2c24ea={'raw':!![],'where':{'id':_0x954592['params']['id']}},_0x34e0ee={};_0x34e0ee[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x39')]['rawAttributes']);_0x34e0ee[_0x4e1f('0x3c')]=_['keys'](_0x954592[_0x4e1f('0x3c')]);_0x34e0ee[_0x4e1f('0x3d')]=_[_0x4e1f('0x3e')](_0x34e0ee[_0x4e1f('0x3a')],_0x34e0ee[_0x4e1f('0x3c')]);_0x2c24ea[_0x4e1f('0x3f')]=_['intersection'](_0x34e0ee[_0x4e1f('0x3a')],qs['fields'](_0x954592[_0x4e1f('0x3c')][_0x4e1f('0x40')]));_0x2c24ea[_0x4e1f('0x3f')]=_0x2c24ea[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x2c24ea[_0x4e1f('0x3f')]:_0x34e0ee[_0x4e1f('0x3a')];if(_0x954592['query']['includeAll']){_0x2c24ea['include']=[{'all':!![]}];}_0x2c24ea=_[_0x4e1f('0x47')]({},_0x2c24ea,_0x954592[_0x4e1f('0x4d')]);return db[_0x4e1f('0x39')]['find'](_0x2c24ea)[_0x4e1f('0x1f')](handleEntityNotFound(_0x2dbfc2,null))[_0x4e1f('0x1f')](respondWithResult(_0x2dbfc2,null))[_0x4e1f('0x2a')](handleError(_0x2dbfc2,null));};exports['create']=function(_0x47e912,_0x205e25){return db[_0x4e1f('0x39')][_0x4e1f('0x53')](_0x47e912['body'],{})[_0x4e1f('0x1f')](respondWithResult(_0x205e25,0xc9))[_0x4e1f('0x2a')](handleError(_0x205e25,null));};exports[_0x4e1f('0x35')]=function(_0x14b34a,_0x1c9029){if(_0x14b34a[_0x4e1f('0x54')]['id']){delete _0x14b34a['body']['id'];}return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x14b34a[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x1c9029,null))[_0x4e1f('0x1f')](saveUpdates(_0x14b34a[_0x4e1f('0x54')],null))[_0x4e1f('0x1f')](respondWithResult(_0x1c9029,null))[_0x4e1f('0x2a')](handleError(_0x1c9029,null));};exports['destroy']=function(_0x5e0100,_0x5e5ecb){return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x5e0100['params']['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x5e5ecb,null))['then'](removeEntity(_0x5e5ecb,null))[_0x4e1f('0x2a')](handleError(_0x5e5ecb,null));};exports[_0x4e1f('0x57')]=function(_0x2d1392,_0x305504){return db['ChatGroup'][_0x4e1f('0x57')]()['then'](respondWithResult(_0x305504,null))[_0x4e1f('0x2a')](handleError(_0x305504,null));};exports[_0x4e1f('0x58')]=function(_0x4abec9,_0xa04d51,_0x4e53f5){return db[_0x4e1f('0x59')][_0x4e1f('0x2e')]({'where':{'ChatGroupId':_0x4abec9['params']['id'],'ToId':_0x4abec9[_0x4e1f('0x5a')]['id'],'read':![]}})[_0x4e1f('0x1f')](function(_0x370a22){return{'id':_[_0x4e1f('0x5b')](_0x4abec9[_0x4e1f('0x56')]['id']),'count':_0x370a22};})[_0x4e1f('0x1f')](respondWithResult(_0xa04d51,null))[_0x4e1f('0x2a')](handleError(_0xa04d51,null));};exports['addMembers']=function(_0x29ecc9,_0x2074b7,_0x2e80a0){return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x29ecc9[_0x4e1f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2074b7,null))['then'](function(_0xaf5abd){if(_0xaf5abd){return _0xaf5abd[_0x4e1f('0x5c')](_0x29ecc9[_0x4e1f('0x54')][_0x4e1f('0x5d')],_[_0x4e1f('0x5e')](_0x29ecc9['body'],[_0x4e1f('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x2074b7,null))['catch'](handleError(_0x2074b7,null));};exports[_0x4e1f('0x5f')]=function(_0x4d7385,_0xad855c,_0x34f095){var _0x1c428e={};var _0x5ca071={};var _0xe5f529;var _0x3b253b;return db[_0x4e1f('0x39')][_0x4e1f('0x60')]({'where':{'id':_0x4d7385[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0xad855c,null))[_0x4e1f('0x1f')](function(_0x5b6580){if(_0x5b6580){_0xe5f529=_0x5b6580;_0x5ca071[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x61')][_0x4e1f('0x62')]);_0x5ca071[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x4d7385[_0x4e1f('0x3c')]);_0x5ca071['filters']=_[_0x4e1f('0x3e')](_0x5ca071[_0x4e1f('0x3a')],_0x5ca071['query']);_0x1c428e[_0x4e1f('0x3f')]=_['intersection'](_0x5ca071[_0x4e1f('0x3a')],qs[_0x4e1f('0x40')](_0x4d7385['query'][_0x4e1f('0x40')]));_0x1c428e[_0x4e1f('0x3f')]=_0x1c428e[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x1c428e[_0x4e1f('0x3f')]:_0x5ca071['model'];_0x1c428e[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x44')]);_0x1c428e['where']=qs[_0x4e1f('0x3d')](_[_0x4e1f('0x63')](_0x4d7385[_0x4e1f('0x3c')],_0x5ca071[_0x4e1f('0x3d')]));if(_0x4d7385['query'][_0x4e1f('0x46')]){_0x1c428e[_0x4e1f('0x45')]=_[_0x4e1f('0x47')](_0x1c428e[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x1c428e[_0x4e1f('0x3f')],function(_0x25e92e){var _0x209410={};_0x209410[_0x25e92e]={'$like':'%'+_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x46')]+'%'};return _0x209410;})});}_0x1c428e=_[_0x4e1f('0x47')]({},_0x1c428e,_0x4d7385[_0x4e1f('0x4d')]);return _0xe5f529['getMembers'](_0x1c428e);}})['then'](function(_0x59c026){if(_0x59c026){_0x3b253b=_0x59c026['length'];if(!_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x1c428e[_0x4e1f('0x30')]=qs[_0x4e1f('0x30')](_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x1c428e[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x4d7385['query'][_0x4e1f('0x2f')]);}return _0xe5f529['getMembers'](_0x1c428e);}})[_0x4e1f('0x1f')](function(_0xe97668){if(_0xe97668){return _0xe97668?{'count':_0x3b253b,'rows':_0xe97668}:null;}})['then'](respondWithResult(_0xad855c,null))[_0x4e1f('0x2a')](handleError(_0xad855c,null));};exports['removeMembers']=function(_0x283b51,_0x5a877c,_0x586274){return db[_0x4e1f('0x39')][_0x4e1f('0x55')]({'where':{'id':_0x283b51[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x5a877c,null))[_0x4e1f('0x1f')](function(_0x356c40){if(_0x356c40){return _0x356c40['removeMembers'](_0x283b51[_0x4e1f('0x3c')][_0x4e1f('0x5d')]);}})[_0x4e1f('0x1f')](respondWithStatusCode(_0x5a877c,null))[_0x4e1f('0x2a')](handleError(_0x5a877c,null));};exports[_0x4e1f('0x64')]=function(_0x1981e3,_0x982196,_0x51dba0){if(_0x1981e3[_0x4e1f('0x54')]['id']){delete _0x1981e3[_0x4e1f('0x54')]['id'];}return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x1981e3[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x982196,null))[_0x4e1f('0x1f')](function(_0x11a409){if(_0x11a409){_0x1981e3[_0x4e1f('0x54')][_0x4e1f('0x65')]=_0x11a409['id'];return db['ChatInternalMessage'][_0x4e1f('0x53')](_0x1981e3[_0x4e1f('0x54')]);}})[_0x4e1f('0x1f')](respondWithResult(_0x982196,null))[_0x4e1f('0x2a')](handleError(_0x982196,null));};exports['getMessages']=function(_0x588b1f,_0x257610,_0x565f09){var _0x3f86c2={};var _0x1dd3f6={};var _0xad7813;var _0x14cd62;return db[_0x4e1f('0x39')][_0x4e1f('0x60')]({'where':{'id':_0x588b1f['params']['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x257610,null))[_0x4e1f('0x1f')](function(_0x378368){if(_0x378368){_0xad7813=_0x378368;_0x1dd3f6[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x59')][_0x4e1f('0x62')]);_0x1dd3f6[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x588b1f[_0x4e1f('0x3c')]);_0x1dd3f6[_0x4e1f('0x3d')]=_['intersection'](_0x1dd3f6[_0x4e1f('0x3a')],_0x1dd3f6[_0x4e1f('0x3c')]);_0x3f86c2[_0x4e1f('0x3f')]=_['intersection'](_0x1dd3f6[_0x4e1f('0x3a')],qs[_0x4e1f('0x40')](_0x588b1f['query'][_0x4e1f('0x40')]));_0x3f86c2[_0x4e1f('0x3f')]=_0x3f86c2[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x3f86c2[_0x4e1f('0x3f')]:_0x1dd3f6['model'];_0x3f86c2[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x588b1f['query'][_0x4e1f('0x44')]);_0x3f86c2[_0x4e1f('0x45')]=qs[_0x4e1f('0x3d')](_['pick'](_0x588b1f['query'],_0x1dd3f6['filters']));if(_0x588b1f[_0x4e1f('0x3c')]['filter']){_0x3f86c2[_0x4e1f('0x45')]=_[_0x4e1f('0x47')](_0x3f86c2[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x3f86c2['attributes'],function(_0x127a60){var _0x1844d3={};_0x1844d3[_0x127a60]={'$like':'%'+_0x588b1f[_0x4e1f('0x3c')][_0x4e1f('0x46')]+'%'};return _0x1844d3;})});}if(_0x588b1f[_0x4e1f('0x3c')]['$gte']){var _0x23d45a=_0x588b1f['query'][_0x4e1f('0x66')][_0x4e1f('0x67')](',');var _0x36465f={};_0x36465f[_0x23d45a[0x0]]={'$gte':moment(_0x23d45a[0x1])[_0x4e1f('0x68')](_0x4e1f('0x69'))};_0x3f86c2[_0x4e1f('0x45')]=_['merge'](_0x3f86c2[_0x4e1f('0x45')],_0x36465f);}_0x3f86c2=_[_0x4e1f('0x47')]({},_0x3f86c2,_0x588b1f[_0x4e1f('0x4d')]);return _0xad7813[_0x4e1f('0x6a')](_0x3f86c2);}})['then'](function(_0x26b33f){if(_0x26b33f){_0x14cd62=_0x26b33f[_0x4e1f('0x52')];if(!_0x588b1f['query'][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x3f86c2[_0x4e1f('0x30')]=qs[_0x4e1f('0x30')](_0x588b1f[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x3f86c2[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x588b1f['query'][_0x4e1f('0x2f')]);}return _0xad7813['getMessages'](_0x3f86c2);}})[_0x4e1f('0x1f')](function(_0x51125a){if(_0x51125a){return _0x51125a?{'count':_0x14cd62,'rows':_0x51125a}:null;}})[_0x4e1f('0x1f')](respondWithResult(_0x257610,null))[_0x4e1f('0x2a')](handleError(_0x257610,null));}; \ No newline at end of file +var _0x0a8d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','order','where','pick','merge','map','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','sort','getMembers','hasOwnProperty','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0x0a8d,0xcb));var _0xd0a8=function(_0x33ac2d,_0x440704){_0x33ac2d=_0x33ac2d-0x0;var _0x131e81=_0x0a8d[_0x33ac2d];return _0x131e81;};'use strict';var pdf=require(_0xd0a8('0x0'));var emlformat=require(_0xd0a8('0x1'));var rimraf=require(_0xd0a8('0x2'));var zipdir=require(_0xd0a8('0x3'));var jsonpatch=require(_0xd0a8('0x4'));var rp=require(_0xd0a8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0a8('0x6'));var util=require(_0xd0a8('0x7'));var path=require(_0xd0a8('0x8'));var sox=require(_0xd0a8('0x9'));var csv=require('to-csv');var ejs=require(_0xd0a8('0xa'));var fs=require('fs');var _=require(_0xd0a8('0xb'));var squel=require(_0xd0a8('0xc'));var crypto=require(_0xd0a8('0xd'));var jsforce=require(_0xd0a8('0xe'));var deskjs=require(_0xd0a8('0xf'));var toCsv=require(_0xd0a8('0x10'));var querystring=require(_0xd0a8('0x11'));var Papa=require(_0xd0a8('0x12'));var Redis=require(_0xd0a8('0x13'));var authService=require(_0xd0a8('0x14'));var qs=require(_0xd0a8('0x15'));var hardwareService=require(_0xd0a8('0x16'));var logger=require(_0xd0a8('0x17'))(_0xd0a8('0x18'));var utils=require(_0xd0a8('0x19'));var config=require('../../config/environment');var db=require(_0xd0a8('0x1a'))['db'];config[_0xd0a8('0x1b')]=_[_0xd0a8('0x1c')](config[_0xd0a8('0x1b')],{'host':_0xd0a8('0x1d'),'port':0x18eb});var socket=require(_0xd0a8('0x1e'))(new Redis(config[_0xd0a8('0x1b')]));require(_0xd0a8('0x1f'))['register'](socket);var jayson=require(_0xd0a8('0x20'));var client=jayson[_0xd0a8('0x21')][_0xd0a8('0x22')]({'port':0x232a});function checkPasswordPattern(_0x257ac0,_0x58d274,_0x3f25fb){if(_0x3f25fb){var _0x40c5b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c5b2[_0xd0a8('0x23')](_0x58d274)){return _0x257ac0;}else{throw new Error(_0xd0a8('0x24'));}}else{return _0x257ac0;}}function respondWithRpcPromise(_0x27b414,_0x35cf07,_0x37665a,_0x227ab6){return new BPromise(function(_0x579f94,_0x15b0a3){var _0x50c5bb=_0x227ab6||client;return _0x50c5bb['request'](_0x27b414,_0x37665a)[_0xd0a8('0x25')](function(_0x1cf260){logger[_0xd0a8('0x26')](_0xd0a8('0x27'),_0x35cf07,_0xd0a8('0x28'));logger[_0xd0a8('0x29')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x35cf07,_0xd0a8('0x28'),JSON[_0xd0a8('0x2a')](_0x1cf260));if(_0x1cf260[_0xd0a8('0x2b')]){if(_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2c')]===0x1f4){logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);return _0x15b0a3(_0x1cf260[_0xd0a8('0x2b')]['message']);}logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);return _0x579f94(_0x1cf260[_0xd0a8('0x2b')][_0xd0a8('0x2d')]);}else{logger[_0xd0a8('0x26')](_0xd0a8('0x27'),_0x35cf07,_0xd0a8('0x28'));_0x579f94(_0x1cf260['result']['message']);}})[_0xd0a8('0x2e')](function(_0x1da79b){logger[_0xd0a8('0x2b')](_0xd0a8('0x27'),_0x35cf07,_0x1da79b);_0x15b0a3(_0x1da79b);});});}function respondWithStatusCode(_0x35c344,_0x10dac3){_0x10dac3=_0x10dac3||0xcc;return function(_0x46ce5f){if(_0x46ce5f){return _0x35c344[_0xd0a8('0x2f')](_0x10dac3);}return _0x35c344[_0xd0a8('0x30')](_0x10dac3)['end']();};}function respondWithResult(_0x13f1a7,_0x3974c0){_0x3974c0=_0x3974c0||0xc8;return function(_0x35a6e5){if(_0x35a6e5){return _0x13f1a7[_0xd0a8('0x30')](_0x3974c0)[_0xd0a8('0x31')](_0x35a6e5);}};}function respondWithFilteredResult(_0x4909d6,_0x335aa6){return function(_0x32186e){if(_0x32186e){var _0x4f5699=_0x32186e[_0xd0a8('0x32')],_0x37c050=_0x335aa6[_0xd0a8('0x33')],_0x2a0dfc=_0x335aa6[_0xd0a8('0x33')]+_0x335aa6['limit'],_0x511069;if(_0x2a0dfc>=_0x4f5699){_0x2a0dfc=_0x4f5699;_0x511069=0xc8;}else{_0x511069=0xce;}_0x4909d6[_0xd0a8('0x30')](_0x511069);return _0x4909d6[_0xd0a8('0x34')](_0xd0a8('0x35'),_0x37c050+'-'+_0x2a0dfc+'/'+_0x4f5699)[_0xd0a8('0x31')](_0x32186e);}return null;};}function patchUpdates(_0x4ef39c){return function(_0xc59b5f){try{jsonpatch[_0xd0a8('0x36')](_0xc59b5f,_0x4ef39c,!![]);}catch(_0x13a185){return BPromise['reject'](_0x13a185);}return _0xc59b5f[_0xd0a8('0x37')]();};}function saveUpdates(_0x991bd2,_0x358200){return function(_0x25a277){if(_0x25a277){return _0x25a277[_0xd0a8('0x38')](_0x991bd2)[_0xd0a8('0x25')](function(_0x9d90c8){return _0x9d90c8;});}return null;};}function removeEntity(_0x4e69a7,_0x335c9e){return function(_0x172726){if(_0x172726){return _0x172726['destroy']()[_0xd0a8('0x25')](function(){_0x4e69a7[_0xd0a8('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b6bb8,_0x1241b6){return function(_0x15e835){if(!_0x15e835){_0x1b6bb8[_0xd0a8('0x2f')](0x194);}return _0x15e835;};}function handleError(_0x5a64eb,_0x422a15){_0x422a15=_0x422a15||0x1f4;return function(_0x5911c2){logger[_0xd0a8('0x2b')](_0x5911c2[_0xd0a8('0x39')]);if(_0x5911c2['name']){delete _0x5911c2[_0xd0a8('0x3a')];}_0x5a64eb[_0xd0a8('0x30')](_0x422a15)[_0xd0a8('0x3b')](_0x5911c2);};}exports[_0xd0a8('0x3c')]=function(_0x43edb6,_0x3e9b1f){var _0x1e3216={},_0x597c60={},_0x4ff3ec={'count':0x0,'rows':[]};var _0x333cbc=db[_0xd0a8('0x3d')][_0xd0a8('0x3e')];_0x597c60[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](_0x333cbc);_0x597c60['query']=_[_0xd0a8('0x40')](_0x43edb6[_0xd0a8('0x41')]);_0x597c60[_0xd0a8('0x42')]=_['intersection'](_0x597c60['model'],_0x597c60['query']);_0x1e3216[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x597c60[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x43edb6[_0xd0a8('0x41')]['fields']));_0x1e3216[_0xd0a8('0x43')]=_0x1e3216[_0xd0a8('0x43')]['length']?_0x1e3216[_0xd0a8('0x43')]:_0x597c60[_0xd0a8('0x3f')];if(!_0x43edb6['query']['hasOwnProperty'](_0xd0a8('0x46'))){_0x1e3216[_0xd0a8('0x47')]=qs[_0xd0a8('0x47')](_0x43edb6['query'][_0xd0a8('0x47')]);_0x1e3216[_0xd0a8('0x33')]=qs['offset'](_0x43edb6[_0xd0a8('0x41')][_0xd0a8('0x33')]);}_0x1e3216[_0xd0a8('0x48')]=qs['sort'](_0x43edb6['query']['sort']);_0x1e3216[_0xd0a8('0x49')]=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x43edb6[_0xd0a8('0x41')],_0x597c60[_0xd0a8('0x42')]));if(_0x43edb6[_0xd0a8('0x41')]['filter']){_0x1e3216[_0xd0a8('0x49')]=_[_0xd0a8('0x4b')](_0x1e3216[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x333cbc,function(_0x500b1e){if(_0x500b1e['type'][_0xd0a8('0x4d')]!==_0xd0a8('0x4e')){var _0x4baba4={};_0x4baba4[_0x500b1e['field']]={'$like':'%'+_0x43edb6['query'][_0xd0a8('0x4f')]+'%'};return _0x4baba4;}})});}_0x1e3216=_[_0xd0a8('0x4b')]({},_0x1e3216,_0x43edb6[_0xd0a8('0x50')]);var _0x3a073b={'where':_0x1e3216[_0xd0a8('0x49')]};return db['ChatGroup'][_0xd0a8('0x32')](_0x3a073b)[_0xd0a8('0x25')](function(_0x454bab){_0x4ff3ec['count']=_0x454bab;if(_0x43edb6[_0xd0a8('0x41')][_0xd0a8('0x51')]){_0x1e3216[_0xd0a8('0x52')]=[{'all':!![]}];}return db[_0xd0a8('0x3d')][_0xd0a8('0x53')](_0x1e3216);})[_0xd0a8('0x25')](function(_0x146d8f){_0x4ff3ec[_0xd0a8('0x54')]=_0x146d8f;return _0x4ff3ec;})['then'](respondWithFilteredResult(_0x3e9b1f,_0x1e3216))[_0xd0a8('0x2e')](handleError(_0x3e9b1f,null));};exports[_0xd0a8('0x55')]=function(_0x5151eb,_0x19f634){var _0x4efddc={'raw':!![],'where':{'id':_0x5151eb[_0xd0a8('0x56')]['id']}},_0x4963a7={};_0x4963a7[_0xd0a8('0x3f')]=_['keys'](db[_0xd0a8('0x3d')][_0xd0a8('0x3e')]);_0x4963a7[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x5151eb['query']);_0x4963a7[_0xd0a8('0x42')]=_['intersection'](_0x4963a7['model'],_0x4963a7[_0xd0a8('0x41')]);_0x4efddc[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x4963a7[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x5151eb[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x4efddc[_0xd0a8('0x43')]=_0x4efddc['attributes'][_0xd0a8('0x57')]?_0x4efddc[_0xd0a8('0x43')]:_0x4963a7[_0xd0a8('0x3f')];if(_0x5151eb['query'][_0xd0a8('0x51')]){_0x4efddc[_0xd0a8('0x52')]=[{'all':!![]}];}_0x4efddc=_[_0xd0a8('0x4b')]({},_0x4efddc,_0x5151eb[_0xd0a8('0x50')]);return db[_0xd0a8('0x3d')][_0xd0a8('0x58')](_0x4efddc)['then'](handleEntityNotFound(_0x19f634,null))[_0xd0a8('0x25')](respondWithResult(_0x19f634,null))[_0xd0a8('0x2e')](handleError(_0x19f634,null));};exports[_0xd0a8('0x59')]=function(_0x5b7763,_0x18568e){return db['ChatGroup'][_0xd0a8('0x59')](_0x5b7763[_0xd0a8('0x5a')],{})[_0xd0a8('0x25')](respondWithResult(_0x18568e,0xc9))['catch'](handleError(_0x18568e,null));};exports[_0xd0a8('0x38')]=function(_0x5a3263,_0x2ea612){if(_0x5a3263[_0xd0a8('0x5a')]['id']){delete _0x5a3263[_0xd0a8('0x5a')]['id'];}return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x5a3263['params']['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x2ea612,null))[_0xd0a8('0x25')](saveUpdates(_0x5a3263['body'],null))[_0xd0a8('0x25')](respondWithResult(_0x2ea612,null))['catch'](handleError(_0x2ea612,null));};exports[_0xd0a8('0x5b')]=function(_0x5fc1f4,_0x42e40f){return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x5fc1f4[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x42e40f,null))[_0xd0a8('0x25')](removeEntity(_0x42e40f,null))[_0xd0a8('0x2e')](handleError(_0x42e40f,null));};exports[_0xd0a8('0x5c')]=function(_0x4866ee,_0x3d08c3){return db['ChatGroup'][_0xd0a8('0x5c')]()[_0xd0a8('0x25')](respondWithResult(_0x3d08c3,null))[_0xd0a8('0x2e')](handleError(_0x3d08c3,null));};exports[_0xd0a8('0x5d')]=function(_0x30c4ff,_0x2f8512,_0x2c467c){return db[_0xd0a8('0x5e')][_0xd0a8('0x32')]({'where':{'ChatGroupId':_0x30c4ff[_0xd0a8('0x56')]['id'],'ToId':_0x30c4ff['user']['id'],'read':![]}})['then'](function(_0x3bbc66){return{'id':_[_0xd0a8('0x5f')](_0x30c4ff[_0xd0a8('0x56')]['id']),'count':_0x3bbc66};})[_0xd0a8('0x25')](respondWithResult(_0x2f8512,null))['catch'](handleError(_0x2f8512,null));};exports[_0xd0a8('0x60')]=function(_0x154560,_0x45ce93,_0x3ca256){return db['ChatGroup'][_0xd0a8('0x58')]({'where':{'id':_0x154560[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x45ce93,null))[_0xd0a8('0x25')](function(_0x1ee5bb){if(_0x1ee5bb){return _0x1ee5bb[_0xd0a8('0x60')](_0x154560[_0xd0a8('0x5a')][_0xd0a8('0x61')],_[_0xd0a8('0x62')](_0x154560[_0xd0a8('0x5a')],['ids','id'])||{});}})[_0xd0a8('0x25')](respondWithResult(_0x45ce93,null))['catch'](handleError(_0x45ce93,null));};exports['getMembers']=function(_0x3a2eec,_0x2c263e,_0x41b056){var _0x3d0073={};var _0x3ebb5f={};var _0x31a0fa;var _0x12a33f;return db['ChatGroup'][_0xd0a8('0x63')]({'where':{'id':_0x3a2eec[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x2c263e,null))[_0xd0a8('0x25')](function(_0x5219be){if(_0x5219be){_0x31a0fa=_0x5219be;_0x3ebb5f[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](db[_0xd0a8('0x64')][_0xd0a8('0x3e')]);_0x3ebb5f[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x3a2eec[_0xd0a8('0x41')]);_0x3ebb5f[_0xd0a8('0x42')]=_[_0xd0a8('0x44')](_0x3ebb5f['model'],_0x3ebb5f[_0xd0a8('0x41')]);_0x3d0073[_0xd0a8('0x43')]=_[_0xd0a8('0x44')](_0x3ebb5f[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x3d0073[_0xd0a8('0x43')]=_0x3d0073[_0xd0a8('0x43')][_0xd0a8('0x57')]?_0x3d0073['attributes']:_0x3ebb5f[_0xd0a8('0x3f')];_0x3d0073['order']=qs[_0xd0a8('0x65')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x65')]);_0x3d0073['where']=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x3a2eec[_0xd0a8('0x41')],_0x3ebb5f[_0xd0a8('0x42')]));if(_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x4f')]){_0x3d0073[_0xd0a8('0x49')]=_[_0xd0a8('0x4b')](_0x3d0073[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x3d0073['attributes'],function(_0x2079e9){var _0x568bc8={};_0x568bc8[_0x2079e9]={'$like':'%'+_0x3a2eec[_0xd0a8('0x41')]['filter']+'%'};return _0x568bc8;})});}_0x3d0073=_[_0xd0a8('0x4b')]({},_0x3d0073,_0x3a2eec[_0xd0a8('0x50')]);return _0x31a0fa[_0xd0a8('0x66')](_0x3d0073);}})['then'](function(_0x50924e){if(_0x50924e){_0x12a33f=_0x50924e['length'];if(!_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x67')](_0xd0a8('0x46'))){_0x3d0073[_0xd0a8('0x47')]=qs['limit'](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x47')]);_0x3d0073[_0xd0a8('0x33')]=qs[_0xd0a8('0x33')](_0x3a2eec[_0xd0a8('0x41')][_0xd0a8('0x33')]);}return _0x31a0fa[_0xd0a8('0x66')](_0x3d0073);}})['then'](function(_0x134ead){if(_0x134ead){return _0x134ead?{'count':_0x12a33f,'rows':_0x134ead}:null;}})[_0xd0a8('0x25')](respondWithResult(_0x2c263e,null))[_0xd0a8('0x2e')](handleError(_0x2c263e,null));};exports['removeMembers']=function(_0x2197b2,_0x9335c,_0x45ac16){return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x2197b2['params']['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x9335c,null))[_0xd0a8('0x25')](function(_0x2151c7){if(_0x2151c7){return _0x2151c7['removeMembers'](_0x2197b2['query'][_0xd0a8('0x61')]);}})['then'](respondWithStatusCode(_0x9335c,null))['catch'](handleError(_0x9335c,null));};exports[_0xd0a8('0x68')]=function(_0x2db41a,_0x31d537,_0x36a780){if(_0x2db41a[_0xd0a8('0x5a')]['id']){delete _0x2db41a['body']['id'];}return db[_0xd0a8('0x3d')][_0xd0a8('0x58')]({'where':{'id':_0x2db41a[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x31d537,null))[_0xd0a8('0x25')](function(_0x22cfcb){if(_0x22cfcb){_0x2db41a['body'][_0xd0a8('0x69')]=_0x22cfcb['id'];return db[_0xd0a8('0x5e')]['create'](_0x2db41a[_0xd0a8('0x5a')]);}})['then'](respondWithResult(_0x31d537,null))[_0xd0a8('0x2e')](handleError(_0x31d537,null));};exports['getMessages']=function(_0x434b4e,_0x87a822,_0x4bfb9d){var _0x10a2aa={};var _0x470f3f={};var _0x593ce5;var _0x5a531f;return db[_0xd0a8('0x3d')][_0xd0a8('0x63')]({'where':{'id':_0x434b4e[_0xd0a8('0x56')]['id']}})[_0xd0a8('0x25')](handleEntityNotFound(_0x87a822,null))['then'](function(_0x2a866c){if(_0x2a866c){_0x593ce5=_0x2a866c;_0x470f3f[_0xd0a8('0x3f')]=_[_0xd0a8('0x40')](db[_0xd0a8('0x5e')][_0xd0a8('0x3e')]);_0x470f3f[_0xd0a8('0x41')]=_[_0xd0a8('0x40')](_0x434b4e['query']);_0x470f3f['filters']=_[_0xd0a8('0x44')](_0x470f3f[_0xd0a8('0x3f')],_0x470f3f['query']);_0x10a2aa[_0xd0a8('0x43')]=_['intersection'](_0x470f3f[_0xd0a8('0x3f')],qs[_0xd0a8('0x45')](_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x45')]));_0x10a2aa[_0xd0a8('0x43')]=_0x10a2aa[_0xd0a8('0x43')][_0xd0a8('0x57')]?_0x10a2aa['attributes']:_0x470f3f[_0xd0a8('0x3f')];_0x10a2aa[_0xd0a8('0x48')]=qs[_0xd0a8('0x65')](_0x434b4e[_0xd0a8('0x41')]['sort']);_0x10a2aa['where']=qs[_0xd0a8('0x42')](_[_0xd0a8('0x4a')](_0x434b4e['query'],_0x470f3f['filters']));if(_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x4f')]){_0x10a2aa[_0xd0a8('0x49')]=_['merge'](_0x10a2aa[_0xd0a8('0x49')],{'$or':_[_0xd0a8('0x4c')](_0x10a2aa[_0xd0a8('0x43')],function(_0x315b69){var _0x1a42eb={};_0x1a42eb[_0x315b69]={'$like':'%'+_0x434b4e['query']['filter']+'%'};return _0x1a42eb;})});}if(_0x434b4e['query'][_0xd0a8('0x6a')]){var _0x17c8ff=_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x6a')][_0xd0a8('0x6b')](',');var _0x16405b={};_0x16405b[_0x17c8ff[0x0]]={'$gte':moment(_0x17c8ff[0x1])[_0xd0a8('0x6c')](_0xd0a8('0x6d'))};_0x10a2aa[_0xd0a8('0x49')]=_['merge'](_0x10a2aa[_0xd0a8('0x49')],_0x16405b);}_0x10a2aa=_[_0xd0a8('0x4b')]({},_0x10a2aa,_0x434b4e[_0xd0a8('0x50')]);return _0x593ce5[_0xd0a8('0x6e')](_0x10a2aa);}})['then'](function(_0x52042b){if(_0x52042b){_0x5a531f=_0x52042b[_0xd0a8('0x57')];if(!_0x434b4e['query'][_0xd0a8('0x67')](_0xd0a8('0x46'))){_0x10a2aa['limit']=qs[_0xd0a8('0x47')](_0x434b4e[_0xd0a8('0x41')]['limit']);_0x10a2aa[_0xd0a8('0x33')]=qs['offset'](_0x434b4e[_0xd0a8('0x41')][_0xd0a8('0x33')]);}return _0x593ce5['getMessages'](_0x10a2aa);}})[_0xd0a8('0x25')](function(_0x5453d7){if(_0x5453d7){return _0x5453d7?{'count':_0x5a531f,'rows':_0x5453d7}:null;}})[_0xd0a8('0x25')](respondWithResult(_0x87a822,null))[_0xd0a8('0x2e')](handleError(_0x87a822,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 251de94..639a814 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 _0x945c=['../../mysqldb','setMaxListeners','save','update','emit','hook','events'];(function(_0x924bed,_0x29479e){var _0x11bd14=function(_0x47fd3c){while(--_0x47fd3c){_0x924bed['push'](_0x924bed['shift']());}};_0x11bd14(++_0x29479e);}(_0x945c,0xd1));var _0xc945=function(_0x56b963,_0x52279f){_0x56b963=_0x56b963-0x0;var _0x144fe4=_0x945c[_0x56b963];return _0x144fe4;};'use strict';var EventEmitter=require(_0xc945('0x0'));var ChatGroup=require(_0xc945('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc945('0x2')](0x0);var events={'afterCreate':_0xc945('0x3'),'afterUpdate':_0xc945('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2aa0e5){return function(_0x4124a4,_0x212e95,_0x23eb98){ChatGroupEvents['emit'](_0x2aa0e5+':'+_0x4124a4['id'],_0x4124a4);ChatGroupEvents[_0xc945('0x5')](_0x2aa0e5,_0x4124a4);_0x23eb98(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xc945('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x0caf=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0x0caf,0xe5));var _0xf0ca=function(_0x70bcd,_0x48003a){_0x70bcd=_0x70bcd-0x0;var _0xaf627b=_0x0caf[_0x70bcd];return _0xaf627b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xf0ca('0x0'))['db'][_0xf0ca('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf0ca('0x2')](0x0);var events={'afterCreate':_0xf0ca('0x3'),'afterUpdate':_0xf0ca('0x4'),'afterDestroy':_0xf0ca('0x5')};function emitEvent(_0x986602){return function(_0x2c4c86,_0x405621,_0x48d898){ChatGroupEvents[_0xf0ca('0x6')](_0x986602+':'+_0x2c4c86['id'],_0x2c4c86);ChatGroupEvents['emit'](_0x986602,_0x2c4c86);_0x48d898(null);};}for(var e in events){if(events[_0xf0ca('0x7')](e)){var event=events[e];ChatGroup[_0xf0ca('0x8')](e,emitEvent(event));}}module[_0xf0ca('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2c552cc..06cd3fc 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 _0x4dba=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x43f210,_0x598447){var _0x367860=function(_0x1a0950){while(--_0x1a0950){_0x43f210['push'](_0x43f210['shift']());}};_0x367860(++_0x598447);}(_0x4dba,0x104));var _0xa4db=function(_0x11df4b,_0x2402cb){_0x11df4b=_0x11df4b-0x0;var _0x1b4be1=_0x4dba[_0x11df4b];return _0x1b4be1;};'use strict';var _=require(_0xa4db('0x0'));var util=require(_0xa4db('0x1'));var logger=require(_0xa4db('0x2'))('api');var moment=require(_0xa4db('0x3'));var BPromise=require(_0xa4db('0x4'));var rp=require(_0xa4db('0x5'));var fs=require('fs');var path=require(_0xa4db('0x6'));var rimraf=require(_0xa4db('0x7'));var config=require(_0xa4db('0x8'));var attributes=require('./chatGroup.attributes');module[_0xa4db('0x9')]=function(_0x265646,_0x234182){return _0x265646['define']('ChatGroup',attributes,{'tableName':_0xa4db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f6a=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util'];(function(_0x530a28,_0x5d3743){var _0x51eb29=function(_0x269519){while(--_0x269519){_0x530a28['push'](_0x530a28['shift']());}};_0x51eb29(++_0x5d3743);}(_0x0f6a,0x174));var _0xa0f6=function(_0x40c6bb,_0x54c8b9){_0x40c6bb=_0x40c6bb-0x0;var _0x1fb8c3=_0x0f6a[_0x40c6bb];return _0x1fb8c3;};'use strict';var _=require(_0xa0f6('0x0'));var util=require(_0xa0f6('0x1'));var logger=require(_0xa0f6('0x2'))('api');var moment=require(_0xa0f6('0x3'));var BPromise=require(_0xa0f6('0x4'));var rp=require(_0xa0f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0f6('0x6'));var attributes=require(_0xa0f6('0x7'));module[_0xa0f6('0x8')]=function(_0x617d7c,_0x3b22cf){return _0x617d7c[_0xa0f6('0x9')](_0xa0f6('0xa'),attributes,{'tableName':'chat_groups','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 7048573..5ccfff7 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 _0x29d4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x29d4,0x1a1));var _0x429d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x29d4[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var moment=require(_0x429d('0x1'));var BPromise=require(_0x429d('0x2'));var rs=require(_0x429d('0x3'));var fs=require('fs');var Redis=require(_0x429d('0x4'));var db=require(_0x429d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x429d('0x6'))(_0x429d('0x7'));var config=require(_0x429d('0x8'));var jayson=require(_0x429d('0x9'));var client=jayson[_0x429d('0xa')][_0x429d('0xb')]({'port':0x232a});config[_0x429d('0xc')]=_[_0x429d('0xd')](config['redis'],{'host':_0x429d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x429d('0xc')]));require(_0x429d('0xf'))[_0x429d('0x10')](socket);function respondWithRpcPromise(_0x5e8430,_0x1f9b3e,_0x8c7cb6){return new BPromise(function(_0x5993cc,_0x31ff87){return client[_0x429d('0x11')](_0x5e8430,_0x8c7cb6)[_0x429d('0x12')](function(_0x5b45c2){logger[_0x429d('0x13')](_0x429d('0x14'),_0x1f9b3e,_0x429d('0x15'));logger[_0x429d('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1f9b3e,_0x429d('0x15'),JSON[_0x429d('0x17')](_0x5b45c2));if(_0x5b45c2[_0x429d('0x18')]){if(_0x5b45c2['error'][_0x429d('0x19')]===0x1f4){logger[_0x429d('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1f9b3e,_0x5b45c2[_0x429d('0x18')][_0x429d('0x1a')]);return _0x31ff87(_0x5b45c2[_0x429d('0x18')][_0x429d('0x1a')]);}logger[_0x429d('0x18')](_0x429d('0x14'),_0x1f9b3e,_0x5b45c2['error'][_0x429d('0x1a')]);return _0x5993cc(_0x5b45c2['error'][_0x429d('0x1a')]);}else{logger[_0x429d('0x13')](_0x429d('0x14'),_0x1f9b3e,_0x429d('0x15'));_0x5993cc(_0x5b45c2['result'][_0x429d('0x1a')]);}})[_0x429d('0x1b')](function(_0x2b9e78){logger['error'](_0x429d('0x14'),_0x1f9b3e,_0x2b9e78);_0x31ff87(_0x2b9e78);});});} \ No newline at end of file +var _0x04de=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35c465,_0x145c45){var _0x265c03=function(_0x37281b){while(--_0x37281b){_0x35c465['push'](_0x35c465['shift']());}};_0x265c03(++_0x145c45);}(_0x04de,0x107));var _0xe04d=function(_0x2fca23,_0x35e9d7){_0x2fca23=_0x2fca23-0x0;var _0x40ee9a=_0x04de[_0x2fca23];return _0x40ee9a;};'use strict';var _=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var moment=require(_0xe04d('0x2'));var BPromise=require(_0xe04d('0x3'));var rs=require(_0xe04d('0x4'));var fs=require('fs');var Redis=require(_0xe04d('0x5'));var db=require(_0xe04d('0x6'))['db'];var utils=require(_0xe04d('0x7'));var logger=require(_0xe04d('0x8'))(_0xe04d('0x9'));var config=require(_0xe04d('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe04d('0xb')](config[_0xe04d('0xc')],{'host':_0xe04d('0xd'),'port':0x18eb});var socket=require(_0xe04d('0xe'))(new Redis(config[_0xe04d('0xc')]));require(_0xe04d('0xf'))[_0xe04d('0x10')](socket);function respondWithRpcPromise(_0x433350,_0x562204,_0x160d4f){return new BPromise(function(_0x21c91c,_0x2576b2){return client[_0xe04d('0x11')](_0x433350,_0x160d4f)[_0xe04d('0x12')](function(_0x3e1837){logger[_0xe04d('0x13')](_0xe04d('0x14'),_0x562204,_0xe04d('0x15'));logger['debug'](_0xe04d('0x16'),_0x562204,_0xe04d('0x15'),JSON[_0xe04d('0x17')](_0x3e1837));if(_0x3e1837[_0xe04d('0x18')]){if(_0x3e1837[_0xe04d('0x18')][_0xe04d('0x19')]===0x1f4){logger[_0xe04d('0x18')](_0xe04d('0x14'),_0x562204,_0x3e1837[_0xe04d('0x18')][_0xe04d('0x1a')]);return _0x2576b2(_0x3e1837[_0xe04d('0x18')][_0xe04d('0x1a')]);}logger['error'](_0xe04d('0x14'),_0x562204,_0x3e1837['error'][_0xe04d('0x1a')]);return _0x21c91c(_0x3e1837['error'][_0xe04d('0x1a')]);}else{logger[_0xe04d('0x13')](_0xe04d('0x14'),_0x562204,_0xe04d('0x15'));_0x21c91c(_0x3e1837[_0xe04d('0x1b')][_0xe04d('0x1a')]);}})[_0xe04d('0x1c')](function(_0x399aa0){logger[_0xe04d('0x18')]('ChatGroup,\x20%s,\x20%s',_0x562204,_0x399aa0);_0x2576b2(_0x399aa0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c68c62e..9ffeec8 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 _0x1120=['./chatGroup.events','save','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1120,0x140));var _0x0112=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x1120[_0x4953da];return _0x2d3780;};'use strict';var ChatGroupEvents=require(_0x0112('0x0'));var events=[_0x0112('0x1'),_0x0112('0x2'),'update'];function createListener(_0x5dd0ed,_0x5190bd){return function(_0x54a1d2){_0x5190bd[_0x0112('0x3')](_0x5dd0ed,_0x54a1d2);};}function removeListener(_0x395145,_0x1d9e34){return function(){ChatGroupEvents[_0x0112('0x4')](_0x395145,_0x1d9e34);};}exports[_0x0112('0x5')]=function(_0x10fdca){for(var _0x408230=0x0,_0x40ad0d=events[_0x0112('0x6')];_0x408230<_0x40ad0d;_0x408230++){var _0x444422=events[_0x408230];var _0x2fd18c=createListener(_0x0112('0x7')+_0x444422,_0x10fdca);ChatGroupEvents['on'](_0x444422,_0x2fd18c);}}; \ No newline at end of file +var _0x8b04=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x33c10d,_0x52ddc5){var _0x299f91=function(_0x13aff1){while(--_0x13aff1){_0x33c10d['push'](_0x33c10d['shift']());}};_0x299f91(++_0x52ddc5);}(_0x8b04,0x130));var _0x48b0=function(_0x275a65,_0x5cc980){_0x275a65=_0x275a65-0x0;var _0x5cde7c=_0x8b04[_0x275a65];return _0x5cde7c;};'use strict';var ChatGroupEvents=require(_0x48b0('0x0'));var events=[_0x48b0('0x1'),'remove',_0x48b0('0x2')];function createListener(_0x4ffa3a,_0x203457){return function(_0x2d610f){_0x203457[_0x48b0('0x3')](_0x4ffa3a,_0x2d610f);};}function removeListener(_0x468c90,_0x423a40){return function(){ChatGroupEvents[_0x48b0('0x4')](_0x468c90,_0x423a40);};}exports[_0x48b0('0x5')]=function(_0x43e21c){for(var _0x357849=0x0,_0x86b615=events['length'];_0x357849<_0x86b615;_0x357849++){var _0xe04bbe=events[_0x357849];var _0x2fe681=createListener(_0x48b0('0x6')+_0xe04bbe,_0x43e21c);ChatGroupEvents['on'](_0xe04bbe,_0x2fe681);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8bb4a1b..e539925 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 _0x316d=['describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','update','destroy','delete','removeMembers','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0xea9aa8,_0x50a1b4){var _0x8992e7=function(_0x578691){while(--_0x578691){_0xea9aa8['push'](_0xea9aa8['shift']());}};_0x8992e7(++_0x50a1b4);}(_0x316d,0x147));var _0xd316=function(_0x173a3f,_0x3681b6){_0x173a3f=_0x173a3f-0x0;var _0x6f031b=_0x316d[_0x173a3f];return _0x6f031b;};'use strict';var multer=require('multer');var util=require(_0xd316('0x0'));var path=require(_0xd316('0x1'));var timeout=require('connect-timeout');var express=require(_0xd316('0x2'));var router=express[_0xd316('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd316('0x4'));var config=require(_0xd316('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd316('0x6')](_0xd316('0x7'),auth[_0xd316('0x8')](),controller[_0xd316('0x9')]);router['get'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0xb')]);router[_0xd316('0x6')]('/:id/unread',auth[_0xd316('0x8')](),controller[_0xd316('0xc')]);router[_0xd316('0x6')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0xe')]);router['get'](_0xd316('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd316('0x10')]('/',auth[_0xd316('0x8')](),controller[_0xd316('0x11')]);router[_0xd316('0x10')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0x12')]);router['post'](_0xd316('0xf'),auth[_0xd316('0x8')](),controller['addMessage']);router['put'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0x13')]);router['delete'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0x14')]);router[_0xd316('0x15')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0x16')]);module[_0xd316('0x17')]=router; \ No newline at end of file +var _0xa960=['isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe'];(function(_0x4805a6,_0x466afa){var _0x5f279d=function(_0x86daac){while(--_0x86daac){_0x4805a6['push'](_0x4805a6['shift']());}};_0x5f279d(++_0x466afa);}(_0xa960,0x1f0));var _0x0a96=function(_0x432b41,_0x5cebde){_0x432b41=_0x432b41-0x0;var _0xa9cbf1=_0xa960[_0x432b41];return _0xa9cbf1;};'use strict';var multer=require(_0x0a96('0x0'));var util=require('util');var path=require(_0x0a96('0x1'));var timeout=require(_0x0a96('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0a96('0x3'));var config=require(_0x0a96('0x4'));var controller=require(_0x0a96('0x5'));router[_0x0a96('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0a96('0x6')](_0x0a96('0x7'),auth[_0x0a96('0x8')](),controller[_0x0a96('0x9')]);router['get'](_0x0a96('0xa'),auth[_0x0a96('0x8')](),controller[_0x0a96('0xb')]);router[_0x0a96('0x6')]('/:id/unread',auth['isAuthenticated'](),controller[_0x0a96('0xc')]);router[_0x0a96('0x6')](_0x0a96('0xd'),auth[_0x0a96('0x8')](),controller[_0x0a96('0xe')]);router[_0x0a96('0x6')](_0x0a96('0xf'),auth['isAuthenticated'](),controller[_0x0a96('0x10')]);router[_0x0a96('0x11')]('/',auth[_0x0a96('0x8')](),controller['create']);router[_0x0a96('0x11')](_0x0a96('0xd'),auth['isAuthenticated'](),controller[_0x0a96('0x12')]);router['post']('/:id/messages',auth[_0x0a96('0x8')](),controller[_0x0a96('0x13')]);router[_0x0a96('0x14')](_0x0a96('0xa'),auth[_0x0a96('0x8')](),controller[_0x0a96('0x15')]);router[_0x0a96('0x16')]('/:id',auth[_0x0a96('0x8')](),controller[_0x0a96('0x17')]);router[_0x0a96('0x16')]('/:id/members',auth[_0x0a96('0x8')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 14cf3fb..e13d92f 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 _0x2547=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports'];(function(_0x5e13af,_0x5461e0){var _0x3dbfa0=function(_0x44c302){while(--_0x44c302){_0x5e13af['push'](_0x5e13af['shift']());}};_0x3dbfa0(++_0x5461e0);}(_0x2547,0x1cd));var _0x7254=function(_0x5267b9,_0x2bc500){_0x5267b9=_0x5267b9-0x0;var _0x3ea9d5=_0x2547[_0x5267b9];return _0x3ea9d5;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'closed':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7254('0x2')]},'ratingType':{'type':Sequelize[_0x7254('0x3')](_0x7254('0x4'),_0x7254('0x5')),'defaultValue':_0x7254('0x4')},'ratingMessage':{'type':Sequelize[_0x7254('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7254('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7254('0x8')]},'disposition':{'type':Sequelize[_0x7254('0x7')]},'note':{'type':Sequelize[_0x7254('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x7254('0x7')]},'osName':{'type':Sequelize[_0x7254('0x7')]},'osVersion':{'type':Sequelize[_0x7254('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7254('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7254('0x6')](_0x7254('0x9'))},'read1stAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x7254('0x3')]('in',_0x7254('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6cb4=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x282993,_0x4c25ae){var _0x432388=function(_0x374b19){while(--_0x374b19){_0x282993['push'](_0x282993['shift']());}};_0x432388(++_0x4c25ae);}(_0x6cb4,0xff));var _0x46cb=function(_0x2bbbdc,_0x40dfa5){_0x2bbbdc=_0x2bbbdc-0x0;var _0x32b36e=_0x6cb4[_0x2bbbdc];return _0x32b36e;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize[_0x46cb('0x8')]},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x46cb('0x8')]},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x46cb('0x9'))},'read1stAt':{'type':Sequelize[_0x46cb('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x46cb('0x4')]('in',_0x46cb('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c0b7fc2..051d97b 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 _0x91a7=['destroy','stack','name','send','ChatInteraction','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','user_has_chat_interactions','left_join','users','chat_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','cm_contacts','chat_websites','expr','parse','value','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','hasOwnProperty','filter','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','SELECT','clone','COUNT(*)','advancedFilter','read','%s\x20=\x200','having','%s\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','ChatInteractionId','Users','Tags','show','rawAttributes','includeAll','include','options','find','body','params','describe','customUpdate','abandon','entity\x20not\x20found','UserId','ValidationError','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','create','closed','findOne','root','server/files/attachments/','close','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','includeAgent','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','download','unix','files','server','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Chat','mkdirSync','N.A.','osName','tail','existsSync','createReadStream','createWriteStream','out','downloadInteraction.html','toFile','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x448773,_0x58fc91){var _0x5edbc7=function(_0x51e6f5){while(--_0x51e6f5){_0x448773['push'](_0x448773['shift']());}};_0x5edbc7(++_0x58fc91);}(_0x91a7,0xe7));var _0x791a=function(_0x57097f,_0x594362){_0x57097f=_0x57097f-0x0;var _0x31f2f4=_0x91a7[_0x57097f];return _0x31f2f4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x791a('0x0'));var rimraf=require(_0x791a('0x1'));var zipdir=require(_0x791a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x791a('0x3'));var moment=require('moment');var BPromise=require(_0x791a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x791a('0x5'));var sox=require(_0x791a('0x6'));var csv=require('to-csv');var ejs=require(_0x791a('0x7'));var fs=require('fs');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('0xb'));var querystring=require(_0x791a('0xc'));var Papa=require(_0x791a('0xd'));var Redis=require(_0x791a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xf'));var hardwareService=require(_0x791a('0x10'));var logger=require('../../config/logger')(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var db=require(_0x791a('0x14'))['db'];config[_0x791a('0x15')]=_[_0x791a('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x791a('0x17'))(new Redis(config[_0x791a('0x15')]));require('./chatInteraction.socket')[_0x791a('0x18')](socket);var jayson=require(_0x791a('0x19'));var client=jayson['client'][_0x791a('0x1a')]({'port':0x232b});var client9004=jayson[_0x791a('0x1b')][_0x791a('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x5cdf2,_0x55e845,_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x575d11[_0x791a('0x1c')](_0x55e845)){return _0x5cdf2;}else{throw new Error(_0x791a('0x1d'));}}else{return _0x5cdf2;}}function respondWithRpcPromise(_0x49ae3e,_0x237adb,_0x5bea2e,_0x35fe48){return new BPromise(function(_0x52941d,_0x4a84ee){var _0x588d00=_0x35fe48||client;return _0x588d00[_0x791a('0x1e')](_0x49ae3e,_0x5bea2e)['then'](function(_0x4cf613){logger[_0x791a('0x1f')](_0x791a('0x20'),_0x237adb,_0x791a('0x21'));logger[_0x791a('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x237adb,_0x791a('0x21'),JSON[_0x791a('0x23')](_0x4cf613));if(_0x4cf613[_0x791a('0x24')]){if(_0x4cf613[_0x791a('0x24')]['code']===0x1f4){logger[_0x791a('0x24')](_0x791a('0x20'),_0x237adb,_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);return _0x4a84ee(_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);}logger[_0x791a('0x24')](_0x791a('0x20'),_0x237adb,_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);return _0x52941d(_0x4cf613[_0x791a('0x24')]['message']);}else{logger[_0x791a('0x1f')](_0x791a('0x20'),_0x237adb,_0x791a('0x21'));_0x52941d(_0x4cf613[_0x791a('0x26')]['message']);}})[_0x791a('0x27')](function(_0x2db3f7){logger['error'](_0x791a('0x20'),_0x237adb,_0x2db3f7);_0x4a84ee(_0x2db3f7);});});}function respondWithStatusCode(_0x1785f5,_0x16dbaf){_0x16dbaf=_0x16dbaf||0xcc;return function(_0x4c1626){if(_0x4c1626){return _0x1785f5[_0x791a('0x28')](_0x16dbaf);}return _0x1785f5[_0x791a('0x29')](_0x16dbaf)[_0x791a('0x2a')]();};}function respondWithResult(_0x395376,_0x4f423){_0x4f423=_0x4f423||0xc8;return function(_0x1a9c6b){if(_0x1a9c6b){return _0x395376[_0x791a('0x29')](_0x4f423)[_0x791a('0x2b')](_0x1a9c6b);}};}function respondWithFilteredResult(_0x58bbc0,_0xbc3436){return function(_0x9e9332){if(_0x9e9332){var _0x1b10a7=_0x9e9332[_0x791a('0x2c')],_0x59d2c0=_0xbc3436[_0x791a('0x2d')],_0x1cdda9=_0xbc3436[_0x791a('0x2d')]+_0xbc3436[_0x791a('0x2e')],_0x5df656;if(_0x1cdda9>=_0x1b10a7){_0x1cdda9=_0x1b10a7;_0x5df656=0xc8;}else{_0x5df656=0xce;}_0x58bbc0[_0x791a('0x29')](_0x5df656);return _0x58bbc0[_0x791a('0x2f')](_0x791a('0x30'),_0x59d2c0+'-'+_0x1cdda9+'/'+_0x1b10a7)['json'](_0x9e9332);}return null;};}function patchUpdates(_0x3662c6){return function(_0x401069){try{jsonpatch[_0x791a('0x31')](_0x401069,_0x3662c6,!![]);}catch(_0x27f758){return BPromise[_0x791a('0x32')](_0x27f758);}return _0x401069['save']();};}function saveUpdates(_0x42d650,_0x8e7002){return function(_0x423a1e){if(_0x423a1e){return _0x423a1e[_0x791a('0x33')](_0x42d650)[_0x791a('0x34')](function(_0x4ef825){return _0x4ef825;});}return null;};}function removeEntity(_0x305836,_0x1f28af){return function(_0x33f998){if(_0x33f998){return _0x33f998[_0x791a('0x35')]()[_0x791a('0x34')](function(){_0x305836['status'](0xcc)[_0x791a('0x2a')]();});}};}function handleEntityNotFound(_0x5d7435,_0x1cf048){return function(_0x4cd047){if(!_0x4cd047){_0x5d7435['sendStatus'](0x194);}return _0x4cd047;};}function handleError(_0x425675,_0x404530){_0x404530=_0x404530||0x1f4;return function(_0x75458d){logger[_0x791a('0x24')](_0x75458d[_0x791a('0x36')]);if(_0x75458d[_0x791a('0x37')]){delete _0x75458d[_0x791a('0x37')];}_0x425675['status'](_0x404530)[_0x791a('0x38')](_0x75458d);};}exports['index']=function(_0x10c5ca,_0x496005){var _0x25e8cc={},_0xe97766={},_0x4ead60={'count':0x0,'rows':[]};var _0x24efa1=db[_0x791a('0x39')]['rawAttributes'];_0xe97766[_0x791a('0x3a')]=_[_0x791a('0x3b')](_0x24efa1);_0xe97766[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x10c5ca[_0x791a('0x3c')]);_0xe97766[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0xe97766[_0x791a('0x3a')],_0xe97766[_0x791a('0x3c')]);_0x25e8cc[_0x791a('0x3f')]=_['intersection'](_0xe97766[_0x791a('0x3a')],qs[_0x791a('0x40')](_0x10c5ca[_0x791a('0x3c')]['fields']));_0x25e8cc[_0x791a('0x3f')]=_0x25e8cc['attributes']['length']?_0x25e8cc['attributes']:_0xe97766[_0x791a('0x3a')];if(!_0x10c5ca[_0x791a('0x3c')]['hasOwnProperty'](_0x791a('0x41'))){_0x25e8cc[_0x791a('0x2e')]=qs[_0x791a('0x2e')](_0x10c5ca[_0x791a('0x3c')]['limit']);_0x25e8cc['offset']=qs['offset'](_0x10c5ca[_0x791a('0x3c')][_0x791a('0x2d')]);}_0x25e8cc['order']=qs[_0x791a('0x42')](_0x10c5ca[_0x791a('0x3c')][_0x791a('0x42')]);_0x25e8cc[_0x791a('0x43')]=qs['filters'](_[_0x791a('0x44')](_0x10c5ca['query'],_0xe97766[_0x791a('0x3d')]));var _0x31e5d3=[];var _0x24633a=squel[_0x791a('0x45')]()[_0x791a('0x46')]('id')['field'](_0x791a('0x37'))[_0x791a('0x46')](_0x791a('0x47'))[_0x791a('0x48')](_0x791a('0x49'));var _0x5064dd=squel[_0x791a('0x45')]()[_0x791a('0x46')]('COUNT(*)')['from'](_0x791a('0x4a'),'me')[_0x791a('0x43')](_0x791a('0x4b'))['where']('me.direction\x20=\x20\x27in\x27')[_0x791a('0x43')](_0x791a('0x4c'));var _0x5d5a01=squel[_0x791a('0x45')]()[_0x791a('0x46')](_0x791a('0x4d'))['field']('ui.ChatInteractionId')[_0x791a('0x48')](_0x791a('0x4e'),'ui')[_0x791a('0x4f')](_0x791a('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x2d7c7d=squel[_0x791a('0x45')]()[_0x791a('0x48')](_0x791a('0x51'),'i')['left_join'](_0x791a('0x4e'),'ui',_0x791a('0x52'))[_0x791a('0x4f')](_0x791a('0x50'),'u',_0x791a('0x53'))[_0x791a('0x4f')](_0x791a('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x791a('0x4f')](_0x791a('0x50'),'o','o.id\x20=\x20i.UserId')[_0x791a('0x4f')](_0x791a('0x55'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x791a('0x4f')](_0x791a('0x4a'),'me',_0x791a('0x4b'));var _0x2e357c=squel[_0x791a('0x56')]();if(_0x10c5ca['query']['advancedFilter']){var _0x7d4955=JSON[_0x791a('0x57')](_0x10c5ca['query']['advancedFilter']);_[_0x791a('0x3b')](_0x7d4955)['forEach'](function(_0x3e0b17){var _0x346467=_0x7d4955[_0x3e0b17];if(_0x3e0b17==='createdAt'){var _0x5166b5=moment(_0x346467[_0x791a('0x58')]['dateStart'])[_0x791a('0x59')](_0x791a('0x5a'))[_0x791a('0x5b')]()['format']();var _0xbcab79=moment(_0xbcab79)[_0x791a('0x5b')]()['endOf'](_0x791a('0x5a'))[_0x791a('0x5c')]();_0x2e357c[_0x791a('0x5d')](_0x791a('0x5e'),_0x5166b5,_0xbcab79);}else{if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x60')])){_0x346467['condition']['forEach'](function(_0x35ccdf){switch(_0x346467['condition'][_0x791a('0x58')]){case'IS':if(_0x3e0b17!==_0x791a('0x61')&&_0x3e0b17!==_0x791a('0x62')){if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x58')])&&_0x346467[_0x791a('0x58')][_0x791a('0x63')]>0x1){_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x65'),_0x346467[_0x791a('0x58')]);}else{_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')][0x0]);}}break;case'=':_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+'\x20=\x20?',_0x346467['value']);break;case _0x791a('0x67'):if(_0x3e0b17===_0x791a('0x68')){_0x2e357c[_0x791a('0x5d')](_0x791a('0x69')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');_0x2e357c['or'](_0x791a('0x6b')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');_0x2e357c['or'](_0x791a('0x6c')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}else{_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}break;case'>':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6d'),_0x346467[_0x791a('0x58')]);break;case'<':_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6e'),_0x346467[_0x791a('0x58')]);break;}});}else{switch(_0x346467[_0x791a('0x60')][_0x791a('0x58')]){case'IS':if(_0x3e0b17!=='TagId'&&_0x3e0b17!==_0x791a('0x62')){if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x58')])&&_0x346467[_0x791a('0x58')]['length']>0x1){_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+'\x20IN\x20?',_0x346467['value']);}else{_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')][0x0]);}}break;case'=':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')]);break;case'LIKE':if(_0x3e0b17==='ContactId'){_0x2e357c[_0x791a('0x5d')](_0x791a('0x69')+'\x20LIKE\x20?','%'+_0x346467['value']+'%');_0x2e357c['or'](_0x791a('0x6b')+_0x791a('0x6a'),'%'+_0x346467['value']+'%');_0x2e357c['or'](_0x791a('0x6c')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}else{_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+'\x20LIKE\x20?','%'+_0x346467[_0x791a('0x58')]+'%');}break;case'>':_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+_0x791a('0x6d'),_0x346467[_0x791a('0x58')]);break;case'<':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+'\x20<\x20?',_0x346467[_0x791a('0x58')]);break;}}}});}else{var _0x4101e1=_(Object[_0x791a('0x3b')](_0x10c5ca[_0x791a('0x3c')]))[_0x791a('0x6f')](function(_0x2ee8b9){return _0x24efa1[_0x791a('0x70')](_0x2ee8b9)?_0x2ee8b9:undefined;})[_0x791a('0x71')](function(_0x5567d3){return!_['isNil'](_0x5567d3);})['value']();if(!_[_0x791a('0x72')](_0x4101e1)){_0x4101e1[_0x791a('0x73')](function(_0x1118a8){if(_0x1118a8===_0x791a('0x74')){_0x2d7c7d[_0x791a('0x43')](_0x791a('0x75'),[][_0x791a('0x76')](_0x10c5ca[_0x791a('0x3c')][_0x1118a8]));}else if(_0x1118a8===_0x791a('0x77')){var _0x13523a=JSON['parse'](_0x10c5ca[_0x791a('0x3c')][_0x1118a8])[_0x791a('0x78')];var _0x50cbb7=JSON[_0x791a('0x57')](_0x10c5ca[_0x791a('0x3c')][_0x1118a8])['$lte'];_0x2d7c7d['where'](_0x791a('0x5e'),_0x13523a,_0x50cbb7);}else{_0x2d7c7d[_0x791a('0x43')]('i.'+_0x1118a8+'\x20=\x20?',_0x10c5ca['query'][_0x1118a8]);}});}if(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x71')]){var _0x46737e=_0x10c5ca['query'][_0x791a('0x71')]['replace']('\x5c','\x5c\x5c')[_0x791a('0x79')]('\x27\x27',_0x791a('0x7a'));if(qs[_0x791a('0x7b')](_0x46737e)){_0x2e357c['or'](_0x791a('0x7c'),_0x46737e+'%');}else{var _0x1de053=[];_0x46737e[_0x791a('0x7d')]('\x20')['forEach'](function(_0x936ebe){_0x1de053[_0x791a('0x7e')]('+'+_0x936ebe[_0x791a('0x7f')]());});var _0x291e8a=_0x1de053[_0x791a('0x80')]('\x20');_0x2e357c['or'](_0x791a('0x81'),_0x291e8a)['or'](_0x791a('0x82'),_0x46737e+'%');}}}_0x2d7c7d[_0x791a('0x43')](_0x2e357c);if(_0x25e8cc[_0x791a('0x83')]){_0x25e8cc[_0x791a('0x83')][_0x791a('0x73')](function(_0x5aaa8e){_0x2d7c7d[_0x791a('0x83')]('i.'+_0x5aaa8e[0x0],_0x5aaa8e[0x1]===_0x791a('0x84')?![]:!![]);});}_0x2d7c7d[_0x791a('0x85')](_0x791a('0x86'));var _0x3272c0={'type':db[_0x791a('0x87')]['QueryTypes'][_0x791a('0x88')],'raw':!![]};var _0xbd35f8=_0x2d7c7d[_0x791a('0x89')]()[_0x791a('0x46')](_0x791a('0x8a'));if(!_0x10c5ca['query'][_0x791a('0x8b')]){if(_0x10c5ca['query'][_0x791a('0x8c')]){if(_0x10c5ca['query'][_0x791a('0x8c')]==0x1){_0xbd35f8[_0x791a('0x43')](util['format'](_0x791a('0x8d'),_0x5064dd[_0x791a('0x7f')]()));_0x2d7c7d[_0x791a('0x8e')]('`Messages.count`\x20=\x200');}else{_0xbd35f8[_0x791a('0x43')](util['format'](_0x791a('0x8f'),_0x5064dd['toString']()));_0x2d7c7d['having']('`Messages.count`\x20>\x200');}}if(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x90')]){var _0x31839a=_[_0x791a('0x5f')](_0x10c5ca['query'][_0x791a('0x90')])?_0x10c5ca[_0x791a('0x3c')]['tag']:new Array(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x90')]);var _0x4b8c18=squel['expr']();_0x31839a['forEach'](function(_0x2ae2af){_0x4b8c18['or'](_0x791a('0x91'),'%,'+_0x2ae2af+',%');});_0x2d7c7d[_0x791a('0x8e')](_0x4b8c18);_0xbd35f8[_0x791a('0x4f')](_0x791a('0x92'),'it',_0x791a('0x93'));_0xbd35f8[_0x791a('0x4f')](_0x791a('0x49'),'t','t.id\x20=\x20it.TagId');_0xbd35f8[_0x791a('0x43')](_0x791a('0x94'),_0x31839a);}}else{var _0x7d4955=JSON[_0x791a('0x57')](_0x10c5ca['query']['advancedFilter']);_[_0x791a('0x3b')](_0x7d4955)[_0x791a('0x73')](function(_0x350d64){var _0x100c74=_0x7d4955[_0x350d64];if(_0x350d64===_0x791a('0x61')){var _0x3f55a5=_0x100c74[_0x791a('0x58')];var _0x3e1b21=squel[_0x791a('0x56')]();_0x3f55a5[_0x791a('0x73')](function(_0x18db1f){_0x3e1b21['or'](_0x791a('0x91'),'%,'+_0x18db1f+',%');});_0x2d7c7d[_0x791a('0x8e')](_0x3e1b21);_0xbd35f8['left_join'](_0x791a('0x95'),'it',_0x791a('0x96'));_0xbd35f8[_0x791a('0x4f')](_0x791a('0x49'),'t',_0x791a('0x97'));_0xbd35f8[_0x791a('0x43')](_0x791a('0x94'),_0x3f55a5);}else if(_0x350d64===_0x791a('0x62')){if(_0x100c74[_0x791a('0x58')][_0x791a('0x63')]===0x1){if(_0x100c74['value'][0x0]===0x1){_0xbd35f8[_0x791a('0x43')](util[_0x791a('0x5c')]('%s\x20=\x200',_0x5064dd[_0x791a('0x7f')]()));_0x2d7c7d[_0x791a('0x8e')](_0x791a('0x98'));}else{_0xbd35f8[_0x791a('0x43')](util[_0x791a('0x5c')]('%s\x20>\x200',_0x5064dd['toString']()));_0x2d7c7d[_0x791a('0x8e')](_0x791a('0x99'));}}}});}db['sequelize']['query'](_0xbd35f8[_0x791a('0x7f')](),_0x3272c0)[_0x791a('0x34')](function(_0x140766){_0x4ead60[_0x791a('0x2c')]=_0x140766[_0x791a('0x63')];if(_0x4ead60[_0x791a('0x2c')]===0x0)return[];return db[_0x791a('0x9a')][_0x791a('0x3c')](_0x24633a['toString'](),_0x3272c0)['then'](function(_0x5a0958){_0x31e5d3=_[_0x791a('0x9b')](_0x5a0958,'id');_0x3272c0=_[_0x791a('0x9c')](_0x3272c0,{'model':db[_0x791a('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2d7c7d['field'](_0x5064dd,'Messages.count');_0x2d7c7d[_0x791a('0x46')](_0x791a('0x9d'),_0x791a('0x9e'));_0x2d7c7d[_0x791a('0x46')]('i.*');_0x2d7c7d[_0x791a('0x46')](_0x791a('0x69'),_0x791a('0x9f'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0x6b'),_0x791a('0xa0'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0x6c'),_0x791a('0xa1'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa2'),'Contact.phone');_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa3'),_0x791a('0xa4'));_0x2d7c7d['field']('c.fax','Contact.fax');_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa5'),_0x791a('0xa6'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa7'),_0x791a('0xa8'));_0x2d7c7d['left_join'](_0x791a('0x92'),'it',_0x791a('0x93'));_0x2d7c7d[_0x791a('0x4f')]('tools_tags','t',_0x791a('0x97'));_0x2d7c7d[_0x791a('0x2e')](_0x25e8cc['limit']);_0x2d7c7d[_0x791a('0x2d')](_0x25e8cc['offset']);return db[_0x791a('0x9a')]['query'](_0x2d7c7d[_0x791a('0x7f')](),_0x3272c0);})['then'](function(_0x4ea270){_0x5d5a01['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x791a('0x6f')](_0x4ea270,'id'));return db[_0x791a('0x9a')][_0x791a('0x3c')](_0x5d5a01['toString'](),_0x3272c0)[_0x791a('0x34')](function(_0x24cbe0){var _0x1599d6=_[_0x791a('0xa9')](_0x24cbe0,_0x791a('0xaa'));_0x4ea270['forEach'](function(_0x4c5bde){if(_0x1599d6[_0x4c5bde['id']]){_0x4c5bde[_0x791a('0xab')]=_[_0x791a('0x6f')](_0x1599d6[_0x4c5bde['id']],function(_0x10f1cf){return{'id':_0x10f1cf['id']};});}if(_0x4c5bde['TagIds']){_0x4c5bde[_0x791a('0xac')]=[];_0x4c5bde['TagIds'][_0x791a('0x7d')](',')[_0x791a('0x73')](function(_0x18d6c6){_0x4c5bde['Tags'][_0x791a('0x7e')](_0x31e5d3[_0x18d6c6]);});}delete _0x4c5bde[_0x791a('0xa8')];});return _0x4ea270;});});})[_0x791a('0x34')](function(_0x480688){_0x4ead60['rows']=_0x480688;return _0x4ead60;})[_0x791a('0x34')](respondWithFilteredResult(_0x496005,_0x25e8cc))[_0x791a('0x27')](handleError(_0x496005,null));};exports[_0x791a('0xad')]=function(_0x14b22f,_0xb39ddf){var _0x5a15c4={'raw':![],'where':{'id':_0x14b22f['params']['id']}},_0x5c24a7={};_0x5c24a7['model']=_[_0x791a('0x3b')](db['ChatInteraction'][_0x791a('0xae')]);_0x5c24a7[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x14b22f[_0x791a('0x3c')]);_0x5c24a7[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0x5c24a7[_0x791a('0x3a')],_0x5c24a7[_0x791a('0x3c')]);_0x5a15c4[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x5c24a7[_0x791a('0x3a')],qs['fields'](_0x14b22f[_0x791a('0x3c')][_0x791a('0x40')]));_0x5a15c4['attributes']=_0x5a15c4[_0x791a('0x3f')][_0x791a('0x63')]?_0x5a15c4[_0x791a('0x3f')]:_0x5c24a7['model'];if(_0x14b22f[_0x791a('0x3c')][_0x791a('0xaf')]){_0x5a15c4[_0x791a('0xb0')]=[{'all':!![]}];}_0x5a15c4=_['merge']({},_0x5a15c4,_0x14b22f[_0x791a('0xb1')]);return db[_0x791a('0x39')][_0x791a('0xb2')](_0x5a15c4)[_0x791a('0x34')](handleEntityNotFound(_0xb39ddf,null))['then'](respondWithResult(_0xb39ddf,null))['catch'](handleError(_0xb39ddf,null));};exports['create']=function(_0x5e5bf5,_0x3fb481){return db[_0x791a('0x39')]['create'](_0x5e5bf5[_0x791a('0xb3')],{})[_0x791a('0x34')](respondWithResult(_0x3fb481,0xc9))[_0x791a('0x27')](handleError(_0x3fb481,null));};exports[_0x791a('0x33')]=function(_0x1a7670,_0x16b60f){if(_0x1a7670[_0x791a('0xb3')]['id']){delete _0x1a7670['body']['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x1a7670['params']['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x16b60f,null))['then'](saveUpdates(_0x1a7670[_0x791a('0xb3')],null))[_0x791a('0x34')](respondWithResult(_0x16b60f,null))[_0x791a('0x27')](handleError(_0x16b60f,null));};exports['destroy']=function(_0x34ae77,_0x7fead2){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x34ae77[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x7fead2,null))[_0x791a('0x34')](removeEntity(_0x7fead2,null))[_0x791a('0x27')](handleError(_0x7fead2,null));};exports[_0x791a('0xb5')]=function(_0x9fe4a5,_0x4f1d72){return db['ChatInteraction'][_0x791a('0xb5')]()[_0x791a('0x34')](respondWithResult(_0x4f1d72,null))[_0x791a('0x27')](handleError(_0x4f1d72,null));};exports[_0x791a('0xb6')]=function(_0x2ff260,_0x4f074c){if(_0x2ff260['body']['id']){delete _0x2ff260[_0x791a('0xb3')]['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x2ff260[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x4f074c,null))[_0x791a('0x34')](saveUpdates(_0x2ff260['body'],null))[_0x791a('0x34')](respondWithResult(_0x4f074c,null))['catch'](handleError(_0x4f074c,null));};exports[_0x791a('0xb7')]=function(_0x526f7e,_0x2994b6,_0x59a5b1){if(_0x526f7e['body']['id']){delete _0x526f7e[_0x791a('0xb3')]['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x526f7e[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](function(_0x1bce38){if(!_0x1bce38){logger[_0x791a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x791a('0xb7'),0x194,_0x791a('0xb8'));_0x2994b6[_0x791a('0x28')](0x194);}else{if(_0x1bce38[_0x791a('0xb9')]){throw new db[(_0x791a('0x87'))][(_0x791a('0xba'))]('Interaction\x20already\x20assigned');}}return _0x1bce38;})[_0x791a('0x34')](function(_0x4b196b){if(_0x4b196b){return _0x4b196b['update']({'closed':_0x526f7e[_0x791a('0xb3')]['closed'],'disposition':_0x526f7e[_0x791a('0xb3')]['disposition']})[_0x791a('0x34')](function(_0x4d9e12){return _0x4d9e12;});}})['then'](function(_0x2c770a){return respondWithRpcPromise(_0x791a('0xbb'),'abandon',_0x526f7e['body'],client9004);})['then'](respondWithResult(_0x2994b6,null))[_0x791a('0x27')](handleError(_0x2994b6,null));};exports[_0x791a('0xbc')]=function(_0x13e1a8,_0x3038d1,_0x2b529a){_0x13e1a8['body']['name']=_0x13e1a8[_0x791a('0xbd')][_0x791a('0xbe')];_0x13e1a8['body'][_0x791a('0xbf')]=_0x13e1a8['file'][_0x791a('0xc0')];_0x13e1a8[_0x791a('0xb3')]['type']=_0x13e1a8[_0x791a('0xbd')][_0x791a('0xc1')];return db[_0x791a('0xc2')][_0x791a('0xc3')](_0x13e1a8[_0x791a('0xb3')])[_0x791a('0x34')](respondWithResult(_0x3038d1,0xc9))[_0x791a('0x27')](handleError(_0x3038d1,null));};exports['attachmentDownload']=function(_0x210629,_0xf52d2c,_0x3583fc){return db['ChatInteraction']['findOne']({'where':{'id':_0x210629['params']['id']},'raw':!![]})[_0x791a('0x34')](handleEntityNotFound(_0xf52d2c,null))[_0x791a('0x34')](function(_0x1932eb){if(_0x1932eb){if(_0x1932eb[_0x791a('0xc4')]){return _0xf52d2c['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x791a('0xc2')][_0x791a('0xc5')]({'where':{'id':_0x210629[_0x791a('0x3c')]['attachId']},'raw':!![]})[_0x791a('0x34')](handleEntityNotFound(_0xf52d2c,null));}})[_0x791a('0x34')](function(_0x220905){if(_0x220905){return _0xf52d2c['download'](path[_0x791a('0x80')](config[_0x791a('0xc6')],_0x791a('0xc7'),_0x220905[_0x791a('0xbf')]));}})[_0x791a('0x27')](handleError(_0xf52d2c,null));};exports[_0x791a('0xc8')]=function(_0x3b8837,_0x3753bf){var _0x263d4c=null;var _0x55676d=null;var _0x137e2a=null;var _0x308094=null;if(_0x3b8837[_0x791a('0xb3')]['id']){delete _0x3b8837[_0x791a('0xb3')]['id'];}if(_0x3b8837[_0x791a('0xb3')]['mailTranscript']){_0x308094=path[_0x791a('0x80')](config[_0x791a('0xc6')],'server/files/chat/upload/',util[_0x791a('0x5c')](_0x791a('0xc9'),Date[_0x791a('0xca')]()));_0x3b8837[_0x791a('0xb3')][_0x791a('0xcb')]=_0x308094;}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x3b8837[_0x791a('0xb4')]['id']},'include':[{'model':db[_0x791a('0xcc')],'as':_0x791a('0xcd'),'include':[{'model':db[_0x791a('0xce')],'as':_0x791a('0xce')}]}]})[_0x791a('0x34')](handleEntityNotFound(_0x3753bf,null))['then'](saveUpdates(_0x3b8837[_0x791a('0xb3')],null))[_0x791a('0x34')](function(_0x370a11){if(_0x370a11){_0x263d4c=_0x370a11;return db[_0x791a('0xcf')][_0x791a('0xb2')]({'where':{'id':_0x263d4c[_0x791a('0x74')]}});}})['then'](function(_0x2728f6){if(_0x2728f6){_0x137e2a=_0x2728f6;return db[_0x791a('0xd0')][_0x791a('0xb2')]({'where':{'id':_0x263d4c[_0x791a('0x68')]}});}})[_0x791a('0x34')](function(_0x41cc4d){if(_0x41cc4d){_0x55676d=_0x41cc4d;if(_0x308094){var _0x49dd2=null;for(var _0x18c311=0x1;_0x18c311<_0x263d4c[_0x791a('0xcd')][_0x791a('0x63')];++_0x18c311){_0x49dd2=_0x263d4c['Messages'][_0x18c311];var _0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')]('%s%d',_0x137e2a[_0x791a('0xd1')],_0x49dd2[_0x791a('0xb9')]):_0x791a('0xd2');var _0x4ac50e=_0x3b8837['body'][_0x791a('0xd3')]||util[_0x791a('0x5c')](_0x791a('0xd4'),_0x791a('0xd5'),_0x49dd2[_0x791a('0x68')]);switch(_0x137e2a[_0x791a('0xd6')]){case _0x791a('0xd7'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')](_0x791a('0xd4'),_0x137e2a[_0x791a('0xd1')],_0x49dd2['UserId']):_0x791a('0xd2');break;case _0x791a('0xd8'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?_0x49dd2[_0x791a('0xce')][_0x791a('0xd9')]||_0x49dd2[_0x791a('0xce')][_0x791a('0xda')]:_0x791a('0xd2');break;case _0x791a('0xdb'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?_0x49dd2[_0x791a('0xce')][_0x791a('0xda')]:_0x791a('0xd2');break;default:_0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')](_0x791a('0xd4'),_0x137e2a[_0x791a('0xd1')],_0x49dd2['UserId']):_0x791a('0xd2');}var _0x412bc0=util[_0x791a('0x5c')](_0x791a('0xdc'),moment(_0x49dd2[_0x791a('0x77')])['format'](_0x791a('0xdd')),_0x49dd2[_0x791a('0xde')]==='in'?_0x4ac50e:_0x43c70e,_0x49dd2[_0x791a('0xb3')]);if(!_0x49dd2['secret']){fs['appendFileSync'](_0x308094,_0x412bc0);}}return db[_0x791a('0xdf')][_0x791a('0xc5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x791a('0xe0'),'raw':!![]}]});}}})[_0x791a('0x34')](function(_0x33fb9a){if(_0x33fb9a&&_0x33fb9a[_0x791a('0xe0')]&&_0x3b8837[_0x791a('0xb3')]){var _0x54d690={'tls':{'rejectUnauthorized':![]}};if(_0x33fb9a['Smtp'][_0x791a('0xe1')]){_0x54d690[_0x791a('0xe1')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe1')];}else{_0x54d690[_0x791a('0xe2')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe2')];_0x54d690[_0x791a('0xe3')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe3')];_0x54d690[_0x791a('0xe4')]=_0x33fb9a['Smtp']['secure'];}if(_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe5')]){_0x54d690[_0x791a('0xe6')]={'user':_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe7')],'pass':_0x33fb9a['Smtp'][_0x791a('0xe8')]};}return respondWithRpcPromise(_0x791a('0xe9'),_0x791a('0xea'),{'account':_0x54d690,'message':{'from':util[_0x791a('0x5c')](_0x791a('0xeb'),_0x33fb9a[_0x791a('0x37')],_0x33fb9a[_0x791a('0xec')]||_0x33fb9a['Smtp'][_0x791a('0xe7')]),'to':_0x3b8837[_0x791a('0xb3')][_0x791a('0xed')],'subject':_0x791a('0xee'),'text':util[_0x791a('0x5c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x3b8837['body']['mailTranscript']),'attachments':[{'path':_0x308094}]}})[_0x791a('0x34')](function(){return _0x263d4c;})[_0x791a('0x27')](function(_0x3bf573){console[_0x791a('0x24')](_0x3bf573);});}else{return _0x263d4c;}})[_0x791a('0x34')](respondWithStatusCode(_0x3753bf,0xc8))['catch'](handleError(_0x3753bf,null));};exports[_0x791a('0xef')]=function(_0x132c6d,_0x5620ef,_0x1c647c){return db['ChatMessage']['find']({'where':{'id':_0x132c6d['params']['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x5620ef,null))[_0x791a('0x34')](function(_0x2800e7){if(_0x2800e7){return _0x2800e7[_0x791a('0xef')](_0x132c6d[_0x791a('0xb3')][_0x791a('0xf0')],_[_0x791a('0xf1')](_0x132c6d[_0x791a('0xb3')],[_0x791a('0xf0'),'id'])||{});}})[_0x791a('0x34')](respondWithResult(_0x5620ef,null))['catch'](handleError(_0x5620ef,null));};exports[_0x791a('0xf2')]=function(_0x145ed4,_0x3f3ed3,_0x5d50a4){var _0xd555={'raw':![],'where':{}};var _0x45bf42={};var _0x2e869b={'count':0x0,'rows':[]};return db[_0x791a('0x39')]['findOne']({'where':{'id':_0x145ed4[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x3f3ed3,null))['then'](function(_0x11ec18){if(_0x11ec18){_0x45bf42['model']=_['keys'](db[_0x791a('0xcc')][_0x791a('0xae')]);_0x45bf42[_0x791a('0x3c')]=_['keys'](_0x145ed4['query']);_0x45bf42[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0x45bf42[_0x791a('0x3a')],_0x45bf42['query']);_0xd555[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x45bf42[_0x791a('0x3a')],qs['fields'](_0x145ed4[_0x791a('0x3c')][_0x791a('0x40')]));_0xd555[_0x791a('0x3f')]=_0xd555['attributes'][_0x791a('0x63')]?_0xd555[_0x791a('0x3f')]:_0x45bf42[_0x791a('0x3a')];if(!_0x145ed4[_0x791a('0x3c')][_0x791a('0x70')](_0x791a('0x41'))){_0xd555[_0x791a('0x2e')]=qs[_0x791a('0x2e')](_0x145ed4['query'][_0x791a('0x2e')]);_0xd555[_0x791a('0x2d')]=qs[_0x791a('0x2d')](_0x145ed4['query'][_0x791a('0x2d')]);}_0xd555['order']=qs[_0x791a('0x42')](_0x145ed4[_0x791a('0x3c')][_0x791a('0x42')]);_0xd555[_0x791a('0x43')]=qs['filters'](_[_0x791a('0x44')](_0x145ed4[_0x791a('0x3c')],_0x45bf42[_0x791a('0x3d')]));_0xd555[_0x791a('0x43')][_0x791a('0xaa')]=_0x11ec18['id'];if(_0x145ed4[_0x791a('0x3c')][_0x791a('0x71')]){_0xd555['where']=_[_0x791a('0x9c')](_0xd555[_0x791a('0x43')],{'$or':_[_0x791a('0x6f')](_0xd555[_0x791a('0x3f')],function(_0x42b3e4){var _0xb0d2d9={};_0xb0d2d9[_0x42b3e4]={'$like':'%'+_0x145ed4[_0x791a('0x3c')][_0x791a('0x71')]+'%'};return _0xb0d2d9;})});}if(_0x145ed4[_0x791a('0x3c')]['$gte']){var _0x23b545=_0x145ed4[_0x791a('0x3c')][_0x791a('0x78')]['split'](',');var _0xa51ffb={};_0xa51ffb[_0x23b545[0x0]]={'$gte':moment(_0x23b545[0x1])[_0x791a('0x5c')](_0x791a('0xf3'))};_0xd555[_0x791a('0x43')]=_['merge'](_0xd555['where'],_0xa51ffb);}_0xd555=_[_0x791a('0x9c')]({},_0xd555,_0x145ed4[_0x791a('0xb1')]);return db[_0x791a('0xcc')][_0x791a('0x2c')]({'where':_0xd555['where']})[_0x791a('0x34')](function(_0x3a5cd1){_0x2e869b[_0x791a('0x2c')]=_0x3a5cd1;if(_0x145ed4[_0x791a('0x3c')][_0x791a('0xaf')]){_0xd555[_0x791a('0xb0')]=[{'all':!![]}];}return db[_0x791a('0xcc')][_0x791a('0xf4')](_0xd555);})[_0x791a('0x34')](function(_0x4608f6){_0x2e869b['rows']=_0x4608f6;return _0x2e869b;});}})[_0x791a('0x34')](respondWithFilteredResult(_0x3f3ed3,_0xd555))[_0x791a('0x27')](handleError(_0x3f3ed3,null));};exports[_0x791a('0xf5')]=function(_0x553538,_0x43d114,_0x265b90){var _0x24a413={'where':{}},_0x14509b={},_0x52ce0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x791a('0xc5')]({'where':{'id':_0x553538[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x43d114,null))['then'](function(_0x58eab0){if(_0x58eab0){_0x14509b[_0x791a('0x3a')]=_[_0x791a('0x3b')](db[_0x791a('0xcc')]['rawAttributes']);_0x14509b[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x553538[_0x791a('0x3c')]);_0x14509b['filters']=_[_0x791a('0x3e')](_0x14509b[_0x791a('0x3a')],_0x14509b['query']);_0x24a413[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x14509b[_0x791a('0x3a')],qs[_0x791a('0x40')](_0x553538[_0x791a('0x3c')][_0x791a('0x40')]));_0x24a413['attributes']=_0x24a413[_0x791a('0x3f')][_0x791a('0x63')]?_0x24a413[_0x791a('0x3f')]:_0x14509b['model'];if(!_0x553538[_0x791a('0x3c')][_0x791a('0x70')](_0x791a('0x41'))){_0x24a413['limit']=qs['limit'](_0x553538['query'][_0x791a('0x2e')]);_0x24a413[_0x791a('0x2d')]=qs[_0x791a('0x2d')](_0x553538[_0x791a('0x3c')][_0x791a('0x2d')]);}_0x24a413[_0x791a('0x83')]=qs[_0x791a('0x42')](_0x553538['query'][_0x791a('0x42')]);_0x24a413[_0x791a('0x43')]=qs['filters'](_['pick'](_0x553538[_0x791a('0x3c')],_0x14509b[_0x791a('0x3d')]));_0x24a413['where']['ChatInteractionId']=_0x58eab0['id'];if(_0x553538[_0x791a('0x3c')][_0x791a('0x71')]){_0x24a413['where']=_[_0x791a('0x9c')](_0x24a413[_0x791a('0x43')],{'$or':_['map'](_0x24a413[_0x791a('0x3f')],function(_0x1007c5){var _0xf51368={};_0xf51368[_0x1007c5]={'$like':'%'+_0x553538[_0x791a('0x3c')][_0x791a('0x71')]+'%'};return _0xf51368;})});}_0x24a413[_0x791a('0x43')][_0x791a('0xf6')]=![];if(_0x553538[_0x791a('0x3c')]['id']){_0x24a413[_0x791a('0x43')]['id']={'$gt':_0x553538[_0x791a('0x3c')]['id']};}_0x24a413=_[_0x791a('0x9c')]({},_0x24a413,_0x553538[_0x791a('0xb1')]);return db[_0x791a('0xcc')]['count']({'where':_0x24a413[_0x791a('0x43')]})[_0x791a('0x34')](function(_0x125593){_0x52ce0e['count']=_0x125593;_0x24a413[_0x791a('0xb0')]=[];if(_0x553538['query'][_0x791a('0xf7')]){_0x24a413[_0x791a('0xb0')][_0x791a('0x7e')]({'model':db[_0x791a('0xce')],'as':_0x791a('0xce'),'attributes':['id',_0x791a('0xda'),_0x791a('0xd9')]});}if(_0x553538[_0x791a('0x3c')][_0x791a('0xaf')]){_0x24a413[_0x791a('0xb0')]=[{'all':!![]}];}return db[_0x791a('0xcc')][_0x791a('0xf4')](_0x24a413);})[_0x791a('0x34')](function(_0x20bd46){_0x52ce0e['rows']=_0x20bd46;return _0x52ce0e;});}})['then'](respondWithFilteredResult(_0x43d114,_0x24a413))['catch'](handleError(_0x43d114,null));};exports[_0x791a('0xf8')]=function(_0x101ae6,_0x5a45b6,_0x4e2a7c){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x101ae6[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x5a45b6,null))[_0x791a('0x34')](function(_0x3f8767){if(_0x3f8767){return _0x3f8767['setTags'](_0x101ae6[_0x791a('0xb3')][_0x791a('0xf0')],_[_0x791a('0xf1')](_0x101ae6['body'],[_0x791a('0xf0'),'id'])||{})[_0x791a('0xf9')](function(){return db[_0x791a('0xfa')][_0x791a('0xf4')]({'attributes':['id',_0x791a('0x37'),_0x791a('0x47')],'where':{'id':_0x101ae6[_0x791a('0xb3')][_0x791a('0xf0')]}});})['then'](function(_0x5aabd1){socket[_0x791a('0xfb')](_0x791a('0xfc'),{'id':Number(_0x101ae6[_0x791a('0xb4')]['id']),'tags':_0x5aabd1||[]});return{'id':Number(_0x101ae6[_0x791a('0xb4')]['id']),'tags':_0x5aabd1||[]};});}})[_0x791a('0x34')](respondWithResult(_0x5a45b6,null))['catch'](handleError(_0x5a45b6,null));};exports[_0x791a('0xfd')]=function(_0x4bff5f,_0x269544,_0x196f3c){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x4bff5f[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x269544,null))['then'](function(_0x4342df){if(_0x4342df){return _0x4342df[_0x791a('0xfd')](_0x4bff5f[_0x791a('0x3c')][_0x791a('0xf0')]);}})['then'](respondWithStatusCode(_0x269544,null))[_0x791a('0x27')](handleError(_0x269544,null));};exports[_0x791a('0xfe')]=function(_0x3652af,_0x3d9b0c){var _0x240038=moment()[_0x791a('0xff')]()[_0x791a('0x7f')]();var _0x378b15=path[_0x791a('0x80')](config[_0x791a('0xc6')],'server',_0x791a('0x100'),'tmp');var _0x1223d0=path['join'](config[_0x791a('0xc6')],_0x791a('0x101'),_0x791a('0x100'),_0x791a('0x102'));var _0xfa6eb8=path[_0x791a('0x80')](_0x378b15,_0x240038);var _0x292de0=util[_0x791a('0x5c')](_0x791a('0x103'),_0x3652af[_0x791a('0xb4')]['id'],_0x240038);var _0xf9e273=path[_0x791a('0x80')](_0x378b15,_0x292de0);var _0x552328=![];return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x3652af[_0x791a('0xb4')]['id']},'include':[{'model':db[_0x791a('0xcc')],'as':'Messages','attributes':['id',_0x791a('0xb3'),_0x791a('0x77'),'direction','secret'],'include':[{'model':db[_0x791a('0xce')],'as':_0x791a('0xce'),'attributes':['id',_0x791a('0xda')],'raw':!![]},{'model':db['CmContact'],'as':_0x791a('0x104'),'attributes':['id',_0x791a('0x105'),_0x791a('0x106')],'raw':!![]},{'model':db[_0x791a('0xc2')],'as':_0x791a('0xc2'),'raw':!![]}]},{'model':db[_0x791a('0xcf')],'as':_0x791a('0x107'),'attributes':['id',_0x791a('0x37')]},{'model':db[_0x791a('0xce')],'as':_0x791a('0x108'),'attributes':['id',_0x791a('0xda')]}]})[_0x791a('0x34')](handleEntityNotFound(_0x3d9b0c,null))[_0x791a('0x34')](function(_0x1ba229){if(_0x1ba229){var _0x5075b5=_0x1ba229[_0x791a('0x109')]({'plain':!![]});_0x552328=!![];var _0x40b552={'format':'A4','border':_0x791a('0x10a'),'header':{'height':_0x791a('0x10b'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x791a('0x10c'),'contents':{'default':util['format'](_0x791a('0x10d'),util[_0x791a('0x5c')]('%s\x20#%d',_0x791a('0x10e'),_0x5075b5['id']),moment()['format']('YYYY-MM-DD')[_0x791a('0x7f')]())}}};fs[_0x791a('0x10f')](_0xfa6eb8);var _0x57f824={'channel':_0x791a('0x10e'),'account':_0x5075b5[_0x791a('0x107')][_0x791a('0x37')],'agent':_0x5075b5['Owner']?_0x5075b5[_0x791a('0x108')][_0x791a('0xda')]:_0x791a('0x110'),'createdAt':moment(_0x5075b5['createdAt'])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')](),'closedAt':_0x5075b5['closed']?moment(_0x5075b5['closedAt'])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')]():'','disposition':_0x5075b5['disposition'],'chatInfo':{'browser':_0x5075b5['browserName'],'os':_0x5075b5[_0x791a('0x111')],'referer':_0x5075b5['referer'],'customerIp':_0x5075b5['customerIp']},'messages':_(_0x5075b5[_0x791a('0xcd')])[_0x791a('0x112')]()[_0x791a('0x71')]({'secret':![]})[_0x791a('0x6f')](function(_0x36fb00){if(_0x36fb00[_0x791a('0xc2')]){var _0x21ac0b=path[_0x791a('0x80')](_0x1223d0,_0x36fb00[_0x791a('0xc2')][_0x791a('0xbf')]);if(fs[_0x791a('0x113')](_0x21ac0b)){fs[_0x791a('0x114')](_0x21ac0b)['pipe'](fs[_0x791a('0x115')](path['join'](_0xfa6eb8,_0x36fb00[_0x791a('0xc2')]['basename'])));}}return{'date':moment(_0x36fb00[_0x791a('0x77')])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')](),'sender':_0x36fb00[_0x791a('0xde')]===_0x791a('0x116')?_0x36fb00[_0x791a('0xce')]?_0x36fb00['User'][_0x791a('0xda')]:'System':_0x36fb00[_0x791a('0x104')][_0x791a('0x105')]+(_0x36fb00[_0x791a('0x104')][_0x791a('0x106')]?'\x20'+_0x36fb00[_0x791a('0x104')][_0x791a('0x106')]:''),'body':_0x36fb00[_0x791a('0xc2')]?_0x36fb00[_0x791a('0xc2')][_0x791a('0xbf')]:_0x36fb00['body'],'direction':_0x36fb00[_0x791a('0xde')]===_0x791a('0x116')?'A':'C','secret':_0x36fb00[_0x791a('0xf6')],'attachment':_0x36fb00[_0x791a('0xc2')]};})['value']()};return ejs['renderFile'](path['join'](config[_0x791a('0xc6')],_0x791a('0x101'),'views',_0x791a('0x117')),{'interaction':_0x57f824})[_0x791a('0x34')](function(_0x50ab30){return new BPromise(function(_0x2a404d,_0x3cdd5e){pdf[_0x791a('0xc3')](_0x50ab30,_0x40b552)[_0x791a('0x118')](path[_0x791a('0x80')](_0xfa6eb8,'transcript-'+_0x5075b5['id']+'-'+_0x240038+_0x791a('0x119')),function(_0x44d954,_0x4367e3){if(_0x44d954)return _0x3cdd5e(_0x44d954);_0x2a404d(_0x4367e3);});});});}})[_0x791a('0x34')](function(){if(_0x552328){return new BPromise(function(_0x5dcc0a,_0xaa0f9a){zipdir(_0xfa6eb8,{'saveTo':_0xf9e273},function(_0x4ade4d,_0x1cb231){if(_0x4ade4d)return _0xaa0f9a(_0x4ade4d);return _0x5dcc0a(_0x1cb231);});})[_0x791a('0x34')](function(){return new BPromise(function(_0x19f669,_0x2b9a90){rimraf(_0xfa6eb8,function(_0x381735){if(_0x381735)_0x2b9a90(_0x381735);return _0x19f669();});});})[_0x791a('0x34')](function(){return _0x3d9b0c[_0x791a('0xfe')](_0xf9e273,_0x292de0,function(_0x399ca1){if(_0x399ca1){console[_0x791a('0x11a')]('err',_0x399ca1);}else{fs[_0x791a('0x11b')](_0xf9e273);}});});}else{return _0x3d9b0c[_0x791a('0x28')](0xc8);}})[_0x791a('0x27')](handleError(_0x3d9b0c,null));}; \ No newline at end of file +var _0x55e0=['me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_chat_interactions','left_join','chat_interactions','ui.UserId\x20=\x20i.UserId','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','expr','advancedFilter','parse','forEach','createdAt','value','dateStart','startOf','day','format','utc','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','c.email','\x20LIKE\x20?','\x20>\x20?','length','\x20IN\x20?','map','hasOwnProperty','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','t.id\x20=\x20it.TagId','sequelize','keyBy','merge','ChatInteraction','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','u.fullname','TagIds','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','Users','Tags','rows','catch','show','params','includeAll','options','find','create','describe','customUpdate','body','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','filename','type','mimetype','Attachment','attachmentDownload','findOne','join','server/files/attachments/','basename','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','\x22%s\x22\x20<%s>','email','user','addMessage','ids','getMessages','pick','$gte','includeAgent','include','findAll','setTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','browserName','osName','referer','customerIp','tail','existsSync','pipe','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','select','field','from','tools_tags','COUNT(*)','chat_messages'];(function(_0x43b92f,_0x41371f){var _0x23cb82=function(_0x241f22){while(--_0x241f22){_0x43b92f['push'](_0x43b92f['shift']());}};_0x23cb82(++_0x41371f);}(_0x55e0,0xdc));var _0x055e=function(_0x210950,_0x12b86c){_0x210950=_0x210950-0x0;var _0x212a5d=_0x55e0[_0x210950];return _0x212a5d;};'use strict';var pdf=require(_0x055e('0x0'));var emlformat=require(_0x055e('0x1'));var rimraf=require(_0x055e('0x2'));var zipdir=require(_0x055e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x055e('0x4'));var BPromise=require(_0x055e('0x5'));var Mustache=require(_0x055e('0x6'));var util=require(_0x055e('0x7'));var path=require(_0x055e('0x8'));var sox=require(_0x055e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x055e('0xa'));var squel=require('squel');var crypto=require(_0x055e('0xb'));var jsforce=require(_0x055e('0xc'));var deskjs=require(_0x055e('0xd'));var toCsv=require(_0x055e('0xe'));var querystring=require(_0x055e('0xf'));var Papa=require('papaparse');var Redis=require(_0x055e('0x10'));var authService=require(_0x055e('0x11'));var qs=require(_0x055e('0x12'));var hardwareService=require(_0x055e('0x13'));var logger=require(_0x055e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x055e('0x15'));var db=require('../../mysqldb')['db'];config[_0x055e('0x16')]=_[_0x055e('0x17')](config[_0x055e('0x16')],{'host':_0x055e('0x18'),'port':0x18eb});var socket=require(_0x055e('0x19'))(new Redis(config[_0x055e('0x16')]));require(_0x055e('0x1a'))['register'](socket);var jayson=require(_0x055e('0x1b'));var client=jayson[_0x055e('0x1c')][_0x055e('0x1d')]({'port':0x232b});var client9004=jayson[_0x055e('0x1c')][_0x055e('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x56af18,_0x230674,_0x2fe55f){if(_0x2fe55f){var _0x111cdb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x111cdb['test'](_0x230674)){return _0x56af18;}else{throw new Error(_0x055e('0x1e'));}}else{return _0x56af18;}}function respondWithRpcPromise(_0x2c377c,_0xb4e6ca,_0x2bad86,_0x2cc84e){return new BPromise(function(_0x4c85dd,_0x36ef10){var _0x2cf3de=_0x2cc84e||client;return _0x2cf3de[_0x055e('0x1f')](_0x2c377c,_0x2bad86)[_0x055e('0x20')](function(_0x5660a7){logger[_0x055e('0x21')](_0x055e('0x22'),_0xb4e6ca,'request\x20sent');logger[_0x055e('0x23')](_0x055e('0x24'),_0xb4e6ca,_0x055e('0x25'),JSON[_0x055e('0x26')](_0x5660a7));if(_0x5660a7[_0x055e('0x27')]){if(_0x5660a7[_0x055e('0x27')]['code']===0x1f4){logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x5660a7[_0x055e('0x27')]['message']);return _0x36ef10(_0x5660a7[_0x055e('0x27')][_0x055e('0x28')]);}logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x5660a7['error'][_0x055e('0x28')]);return _0x4c85dd(_0x5660a7['error'][_0x055e('0x28')]);}else{logger[_0x055e('0x21')](_0x055e('0x22'),_0xb4e6ca,_0x055e('0x25'));_0x4c85dd(_0x5660a7[_0x055e('0x29')][_0x055e('0x28')]);}})['catch'](function(_0x2fb49b){logger[_0x055e('0x27')](_0x055e('0x22'),_0xb4e6ca,_0x2fb49b);_0x36ef10(_0x2fb49b);});});}function respondWithStatusCode(_0x4b5891,_0x408e38){_0x408e38=_0x408e38||0xcc;return function(_0x29078a){if(_0x29078a){return _0x4b5891[_0x055e('0x2a')](_0x408e38);}return _0x4b5891[_0x055e('0x2b')](_0x408e38)['end']();};}function respondWithResult(_0x27f81a,_0x5958ef){_0x5958ef=_0x5958ef||0xc8;return function(_0x1528c3){if(_0x1528c3){return _0x27f81a[_0x055e('0x2b')](_0x5958ef)[_0x055e('0x2c')](_0x1528c3);}};}function respondWithFilteredResult(_0x7822db,_0x1610f1){return function(_0x5c0e76){if(_0x5c0e76){var _0x99a372=_0x5c0e76[_0x055e('0x2d')],_0x453e5e=_0x1610f1[_0x055e('0x2e')],_0x293062=_0x1610f1[_0x055e('0x2e')]+_0x1610f1[_0x055e('0x2f')],_0x1499e1;if(_0x293062>=_0x99a372){_0x293062=_0x99a372;_0x1499e1=0xc8;}else{_0x1499e1=0xce;}_0x7822db['status'](_0x1499e1);return _0x7822db[_0x055e('0x30')](_0x055e('0x31'),_0x453e5e+'-'+_0x293062+'/'+_0x99a372)['json'](_0x5c0e76);}return null;};}function patchUpdates(_0xd9298d){return function(_0x1319bd){try{jsonpatch[_0x055e('0x32')](_0x1319bd,_0xd9298d,!![]);}catch(_0x20717b){return BPromise[_0x055e('0x33')](_0x20717b);}return _0x1319bd[_0x055e('0x34')]();};}function saveUpdates(_0x5e1a92,_0x5ddf59){return function(_0x25d19d){if(_0x25d19d){return _0x25d19d['update'](_0x5e1a92)['then'](function(_0x55a1ee){return _0x55a1ee;});}return null;};}function removeEntity(_0x31ee60,_0x436a3c){return function(_0x35c6cf){if(_0x35c6cf){return _0x35c6cf[_0x055e('0x35')]()[_0x055e('0x20')](function(){_0x31ee60[_0x055e('0x2b')](0xcc)[_0x055e('0x36')]();});}};}function handleEntityNotFound(_0x106543,_0x42a33e){return function(_0x2f60fa){if(!_0x2f60fa){_0x106543[_0x055e('0x2a')](0x194);}return _0x2f60fa;};}function handleError(_0x263a81,_0x54539e){_0x54539e=_0x54539e||0x1f4;return function(_0x571b75){logger[_0x055e('0x27')](_0x571b75[_0x055e('0x37')]);if(_0x571b75[_0x055e('0x38')]){delete _0x571b75[_0x055e('0x38')];}_0x263a81[_0x055e('0x2b')](_0x54539e)[_0x055e('0x39')](_0x571b75);};}exports[_0x055e('0x3a')]=function(_0x4f24f8,_0x18b88e){var _0x265fed={},_0x3e9d25={},_0x14b6ab={'count':0x0,'rows':[]};var _0x44dbd1=db['ChatInteraction'][_0x055e('0x3b')];_0x3e9d25[_0x055e('0x3c')]=_['keys'](_0x44dbd1);_0x3e9d25[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x4f24f8['query']);_0x3e9d25[_0x055e('0x3f')]=_[_0x055e('0x40')](_0x3e9d25['model'],_0x3e9d25[_0x055e('0x3d')]);_0x265fed[_0x055e('0x41')]=_['intersection'](_0x3e9d25[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x4f24f8[_0x055e('0x3d')]['fields']));_0x265fed[_0x055e('0x41')]=_0x265fed[_0x055e('0x41')]['length']?_0x265fed[_0x055e('0x41')]:_0x3e9d25[_0x055e('0x3c')];if(!_0x4f24f8[_0x055e('0x3d')]['hasOwnProperty'](_0x055e('0x43'))){_0x265fed[_0x055e('0x2f')]=qs[_0x055e('0x2f')](_0x4f24f8['query']['limit']);_0x265fed[_0x055e('0x2e')]=qs[_0x055e('0x2e')](_0x4f24f8['query'][_0x055e('0x2e')]);}_0x265fed['order']=qs[_0x055e('0x44')](_0x4f24f8['query'][_0x055e('0x44')]);_0x265fed[_0x055e('0x45')]=qs[_0x055e('0x3f')](_['pick'](_0x4f24f8['query'],_0x3e9d25[_0x055e('0x3f')]));var _0x2e90fb=[];var _0x414884=squel[_0x055e('0x46')]()['field']('id')['field'](_0x055e('0x38'))[_0x055e('0x47')]('color')[_0x055e('0x48')](_0x055e('0x49'));var _0xcb7d81=squel[_0x055e('0x46')]()[_0x055e('0x47')](_0x055e('0x4a'))['from'](_0x055e('0x4b'),'me')[_0x055e('0x45')]('me.ChatInteractionId\x20=\x20i.id')[_0x055e('0x45')](_0x055e('0x4c'))[_0x055e('0x45')](_0x055e('0x4d'));var _0x1bade9=squel[_0x055e('0x46')]()[_0x055e('0x47')]('u.id')[_0x055e('0x47')]('ui.ChatInteractionId')[_0x055e('0x48')](_0x055e('0x4e'),'ui')[_0x055e('0x4f')]('users','u','u.id\x20=\x20ui.UserId');var _0x45845e=squel[_0x055e('0x46')]()[_0x055e('0x48')](_0x055e('0x50'),'i')[_0x055e('0x4f')](_0x055e('0x4e'),'ui',_0x055e('0x51'))[_0x055e('0x4f')](_0x055e('0x52'),'u','u.id\x20=\x20ui.UserId')[_0x055e('0x4f')](_0x055e('0x53'),'c',_0x055e('0x54'))[_0x055e('0x4f')](_0x055e('0x52'),'o','o.id\x20=\x20i.UserId')[_0x055e('0x4f')](_0x055e('0x55'),'a',_0x055e('0x56'))['left_join'](_0x055e('0x4b'),'me','me.ChatInteractionId\x20=\x20i.id');var _0x15e442=squel[_0x055e('0x57')]();if(_0x4f24f8['query'][_0x055e('0x58')]){var _0x5349b4=JSON[_0x055e('0x59')](_0x4f24f8['query']['advancedFilter']);_[_0x055e('0x3e')](_0x5349b4)[_0x055e('0x5a')](function(_0x393717){var _0x248e5f=_0x5349b4[_0x393717];if(_0x393717===_0x055e('0x5b')){var _0x2ceb8d=moment(_0x248e5f[_0x055e('0x5c')][_0x055e('0x5d')])[_0x055e('0x5e')](_0x055e('0x5f'))['utc']()[_0x055e('0x60')]();var _0x7f03ed=moment(_0x7f03ed)[_0x055e('0x61')]()[_0x055e('0x62')]('day')[_0x055e('0x60')]();_0x15e442[_0x055e('0x63')](_0x055e('0x64'),_0x2ceb8d,_0x7f03ed);}else{if(_[_0x055e('0x65')](_0x248e5f['condition'])){_0x248e5f['condition'][_0x055e('0x5a')](function(_0xd3a451){switch(_0x248e5f[_0x055e('0x66')][_0x055e('0x5c')]){case'IS':if(_0x393717!==_0x055e('0x67')&&_0x393717!==_0x055e('0x68')){if(_[_0x055e('0x65')](_0x248e5f[_0x055e('0x5c')])&&_0x248e5f['value']['length']>0x1){_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20IN\x20?',_0x248e5f[_0x055e('0x5c')]);}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f['value'][0x0]);}}break;case'=':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f[_0x055e('0x5c')]);break;case _0x055e('0x6b'):if(_0x393717===_0x055e('0x6c')){_0x15e442[_0x055e('0x63')](_0x055e('0x6d')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6e')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6f')+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}else{_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}break;case'>':_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x71'),_0x248e5f[_0x055e('0x5c')]);break;case'<':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20<\x20?',_0x248e5f[_0x055e('0x5c')]);break;}});}else{switch(_0x248e5f[_0x055e('0x66')][_0x055e('0x5c')]){case'IS':if(_0x393717!==_0x055e('0x67')&&_0x393717!==_0x055e('0x68')){if(_['isArray'](_0x248e5f[_0x055e('0x5c')])&&_0x248e5f[_0x055e('0x5c')][_0x055e('0x72')]>0x1){_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x73'),_0x248e5f[_0x055e('0x5c')]);}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20=\x20?',_0x248e5f[_0x055e('0x5c')][0x0]);}}break;case'=':_0x15e442['and'](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x6a'),_0x248e5f['value']);break;case _0x055e('0x6b'):if(_0x393717===_0x055e('0x6c')){_0x15e442[_0x055e('0x63')](_0x055e('0x6d')+'\x20LIKE\x20?','%'+_0x248e5f['value']+'%');_0x15e442['or'](_0x055e('0x6e')+'\x20LIKE\x20?','%'+_0x248e5f[_0x055e('0x5c')]+'%');_0x15e442['or'](_0x055e('0x6f')+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}else{_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+_0x055e('0x70'),'%'+_0x248e5f[_0x055e('0x5c')]+'%');}break;case'>':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20>\x20?',_0x248e5f['value']);break;case'<':_0x15e442[_0x055e('0x63')](_0x248e5f[_0x055e('0x69')]+'.'+_0x393717+'\x20<\x20?',_0x248e5f[_0x055e('0x5c')]);break;}}}});}else{var _0x55e1d7=_(Object[_0x055e('0x3e')](_0x4f24f8[_0x055e('0x3d')]))[_0x055e('0x74')](function(_0x23acf1){return _0x44dbd1[_0x055e('0x75')](_0x23acf1)?_0x23acf1:undefined;})[_0x055e('0x76')](function(_0x992681){return!_[_0x055e('0x77')](_0x992681);})['value']();if(!_[_0x055e('0x78')](_0x55e1d7)){_0x55e1d7[_0x055e('0x5a')](function(_0x471e26){if(_0x471e26===_0x055e('0x79')){_0x45845e[_0x055e('0x45')](_0x055e('0x7a'),[][_0x055e('0x7b')](_0x4f24f8[_0x055e('0x3d')][_0x471e26]));}else if(_0x471e26===_0x055e('0x5b')){var _0x5763c7=JSON[_0x055e('0x59')](_0x4f24f8[_0x055e('0x3d')][_0x471e26])['$gte'];var _0x2dbc12=JSON[_0x055e('0x59')](_0x4f24f8[_0x055e('0x3d')][_0x471e26])[_0x055e('0x7c')];_0x45845e['where'](_0x055e('0x64'),_0x5763c7,_0x2dbc12);}else{_0x45845e[_0x055e('0x45')]('i.'+_0x471e26+_0x055e('0x6a'),_0x4f24f8[_0x055e('0x3d')][_0x471e26]);}});}if(_0x4f24f8[_0x055e('0x3d')]['filter']){var _0x256c65=_0x4f24f8[_0x055e('0x3d')][_0x055e('0x76')][_0x055e('0x7d')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x055e('0x7e'));if(qs[_0x055e('0x7f')](_0x256c65)){_0x15e442['or'](_0x055e('0x80'),_0x256c65+'%');}else{var _0x8e92b4=[];_0x256c65[_0x055e('0x81')]('\x20')['forEach'](function(_0x3ec891){_0x8e92b4[_0x055e('0x82')]('+'+_0x3ec891[_0x055e('0x83')]());});var _0x1f3ba4=_0x8e92b4['join']('\x20');_0x15e442['or'](_0x055e('0x84'),_0x1f3ba4)['or'](_0x055e('0x85'),_0x256c65+'%');}}}_0x45845e[_0x055e('0x45')](_0x15e442);if(_0x265fed[_0x055e('0x86')]){_0x265fed['order'][_0x055e('0x5a')](function(_0x8e77e0){_0x45845e[_0x055e('0x86')]('i.'+_0x8e77e0[0x0],_0x8e77e0[0x1]===_0x055e('0x87')?![]:!![]);});}_0x45845e[_0x055e('0x88')]('i.id');var _0x26da8f={'type':db[_0x055e('0x89')][_0x055e('0x8a')]['SELECT'],'raw':!![]};var _0x588aea=_0x45845e[_0x055e('0x8b')]()['field'](_0x055e('0x4a'));if(!_0x4f24f8[_0x055e('0x3d')]['advancedFilter']){if(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x8c')]){if(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x8c')]==0x1){_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x8d'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x8f'));}else{_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x90'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x91'));}}if(_0x4f24f8['query'][_0x055e('0x92')]){var _0x50fd59=_['isArray'](_0x4f24f8[_0x055e('0x3d')][_0x055e('0x92')])?_0x4f24f8[_0x055e('0x3d')]['tag']:new Array(_0x4f24f8[_0x055e('0x3d')][_0x055e('0x92')]);var _0x47ed9c=squel[_0x055e('0x57')]();_0x50fd59[_0x055e('0x5a')](function(_0x5c3210){_0x47ed9c['or'](_0x055e('0x93'),'%,'+_0x5c3210+',%');});_0x45845e['having'](_0x47ed9c);_0x588aea[_0x055e('0x4f')](_0x055e('0x94'),'it',_0x055e('0x95'));_0x588aea[_0x055e('0x4f')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x588aea['where'](_0x055e('0x96'),_0x50fd59);}}else{var _0x5349b4=JSON['parse'](_0x4f24f8[_0x055e('0x3d')]['advancedFilter']);_[_0x055e('0x3e')](_0x5349b4)[_0x055e('0x5a')](function(_0x15a107){var _0x1c3a1a=_0x5349b4[_0x15a107];if(_0x15a107==='TagId'){var _0x4f0209=_0x1c3a1a[_0x055e('0x5c')];var _0x2af129=squel[_0x055e('0x57')]();_0x4f0209[_0x055e('0x5a')](function(_0x422f6f){_0x2af129['or'](_0x055e('0x93'),'%,'+_0x422f6f+',%');});_0x45845e[_0x055e('0x8e')](_0x2af129);_0x588aea['left_join'](_0x055e('0x97'),'it','it.MailInteractionId\x20=\x20i.id');_0x588aea['left_join'](_0x055e('0x49'),'t',_0x055e('0x98'));_0x588aea[_0x055e('0x45')]('t.id\x20IN\x20?',_0x4f0209);}else if(_0x15a107===_0x055e('0x68')){if(_0x1c3a1a[_0x055e('0x5c')][_0x055e('0x72')]===0x1){if(_0x1c3a1a['value'][0x0]===0x1){_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x8d'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x8f'));}else{_0x588aea[_0x055e('0x45')](util[_0x055e('0x60')](_0x055e('0x90'),_0xcb7d81[_0x055e('0x83')]()));_0x45845e[_0x055e('0x8e')](_0x055e('0x91'));}}}});}db[_0x055e('0x99')][_0x055e('0x3d')](_0x588aea[_0x055e('0x83')](),_0x26da8f)[_0x055e('0x20')](function(_0x554ef9){_0x14b6ab[_0x055e('0x2d')]=_0x554ef9[_0x055e('0x72')];if(_0x14b6ab[_0x055e('0x2d')]===0x0)return[];return db['sequelize']['query'](_0x414884['toString'](),_0x26da8f)[_0x055e('0x20')](function(_0x10cee9){_0x2e90fb=_[_0x055e('0x9a')](_0x10cee9,'id');_0x26da8f=_[_0x055e('0x9b')](_0x26da8f,{'model':db[_0x055e('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x45845e[_0x055e('0x47')](_0xcb7d81,_0x055e('0x68'));_0x45845e[_0x055e('0x47')]('a.key',_0x055e('0x9d'));_0x45845e[_0x055e('0x47')](_0x055e('0x9e'));_0x45845e[_0x055e('0x47')](_0x055e('0x6d'),_0x055e('0x9f'));_0x45845e[_0x055e('0x47')](_0x055e('0x6e'),_0x055e('0xa0'));_0x45845e[_0x055e('0x47')](_0x055e('0x6f'),_0x055e('0xa1'));_0x45845e['field']('c.phone',_0x055e('0xa2'));_0x45845e[_0x055e('0x47')](_0x055e('0xa3'),'Contact.mobile');_0x45845e[_0x055e('0x47')](_0x055e('0xa4'),_0x055e('0xa5'));_0x45845e['field'](_0x055e('0xa6'),'User.name');_0x45845e[_0x055e('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x055e('0xa7'));_0x45845e[_0x055e('0x4f')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id');_0x45845e[_0x055e('0x4f')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x45845e[_0x055e('0x2f')](_0x265fed[_0x055e('0x2f')]);_0x45845e[_0x055e('0x2e')](_0x265fed[_0x055e('0x2e')]);return db[_0x055e('0x99')]['query'](_0x45845e[_0x055e('0x83')](),_0x26da8f);})[_0x055e('0x20')](function(_0x51f758){_0x1bade9[_0x055e('0x45')](_0x055e('0xa8'),_[_0x055e('0x74')](_0x51f758,'id'));return db[_0x055e('0x99')][_0x055e('0x3d')](_0x1bade9[_0x055e('0x83')](),_0x26da8f)[_0x055e('0x20')](function(_0x1fd7ba){var _0x4be7a6=_[_0x055e('0xa9')](_0x1fd7ba,_0x055e('0xaa'));_0x51f758[_0x055e('0x5a')](function(_0x20383b){if(_0x4be7a6[_0x20383b['id']]){_0x20383b[_0x055e('0xab')]=_[_0x055e('0x74')](_0x4be7a6[_0x20383b['id']],function(_0xf22117){return{'id':_0xf22117['id']};});}if(_0x20383b[_0x055e('0xa7')]){_0x20383b[_0x055e('0xac')]=[];_0x20383b[_0x055e('0xa7')][_0x055e('0x81')](',')['forEach'](function(_0x42d6db){_0x20383b[_0x055e('0xac')][_0x055e('0x82')](_0x2e90fb[_0x42d6db]);});}delete _0x20383b['TagIds'];});return _0x51f758;});});})['then'](function(_0x35e203){_0x14b6ab[_0x055e('0xad')]=_0x35e203;return _0x14b6ab;})[_0x055e('0x20')](respondWithFilteredResult(_0x18b88e,_0x265fed))[_0x055e('0xae')](handleError(_0x18b88e,null));};exports[_0x055e('0xaf')]=function(_0x3cd8e5,_0x505cc4){var _0x2a7994={'raw':![],'where':{'id':_0x3cd8e5[_0x055e('0xb0')]['id']}},_0x2af8ad={};_0x2af8ad[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0x9c')][_0x055e('0x3b')]);_0x2af8ad[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x3cd8e5['query']);_0x2af8ad['filters']=_['intersection'](_0x2af8ad[_0x055e('0x3c')],_0x2af8ad[_0x055e('0x3d')]);_0x2a7994[_0x055e('0x41')]=_['intersection'](_0x2af8ad[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x3cd8e5[_0x055e('0x3d')][_0x055e('0x42')]));_0x2a7994[_0x055e('0x41')]=_0x2a7994[_0x055e('0x41')][_0x055e('0x72')]?_0x2a7994[_0x055e('0x41')]:_0x2af8ad['model'];if(_0x3cd8e5[_0x055e('0x3d')][_0x055e('0xb1')]){_0x2a7994['include']=[{'all':!![]}];}_0x2a7994=_['merge']({},_0x2a7994,_0x3cd8e5[_0x055e('0xb2')]);return db[_0x055e('0x9c')][_0x055e('0xb3')](_0x2a7994)[_0x055e('0x20')](handleEntityNotFound(_0x505cc4,null))['then'](respondWithResult(_0x505cc4,null))['catch'](handleError(_0x505cc4,null));};exports[_0x055e('0xb4')]=function(_0x444091,_0x1ec15a){return db[_0x055e('0x9c')][_0x055e('0xb4')](_0x444091['body'],{})[_0x055e('0x20')](respondWithResult(_0x1ec15a,0xc9))[_0x055e('0xae')](handleError(_0x1ec15a,null));};exports['update']=function(_0xf1ac18,_0x48d2ad){if(_0xf1ac18['body']['id']){delete _0xf1ac18['body']['id'];}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0xf1ac18['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x48d2ad,null))[_0x055e('0x20')](saveUpdates(_0xf1ac18['body'],null))[_0x055e('0x20')](respondWithResult(_0x48d2ad,null))['catch'](handleError(_0x48d2ad,null));};exports[_0x055e('0x35')]=function(_0x4d4521,_0x3d5a6){return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x4d4521[_0x055e('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3d5a6,null))[_0x055e('0x20')](removeEntity(_0x3d5a6,null))[_0x055e('0xae')](handleError(_0x3d5a6,null));};exports['describe']=function(_0x280aeb,_0x116f84){return db[_0x055e('0x9c')][_0x055e('0xb5')]()[_0x055e('0x20')](respondWithResult(_0x116f84,null))[_0x055e('0xae')](handleError(_0x116f84,null));};exports[_0x055e('0xb6')]=function(_0x3b2401,_0x15792f){if(_0x3b2401[_0x055e('0xb7')]['id']){delete _0x3b2401[_0x055e('0xb7')]['id'];}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x3b2401[_0x055e('0xb0')]['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x15792f,null))[_0x055e('0x20')](saveUpdates(_0x3b2401['body'],null))[_0x055e('0x20')](respondWithResult(_0x15792f,null))['catch'](handleError(_0x15792f,null));};exports[_0x055e('0xb8')]=function(_0x146dfb,_0x5ca835,_0xfb3b6d){if(_0x146dfb['body']['id']){delete _0x146dfb[_0x055e('0xb7')]['id'];}return db['ChatInteraction'][_0x055e('0xb3')]({'where':{'id':_0x146dfb[_0x055e('0xb0')]['id']}})['then'](function(_0x25972f){if(!_0x25972f){logger[_0x055e('0x27')](_0x055e('0xb9'),'abandon',0x194,_0x055e('0xba'));_0x5ca835[_0x055e('0x2a')](0x194);}else{if(_0x25972f[_0x055e('0xbb')]){throw new db[(_0x055e('0x89'))][(_0x055e('0xbc'))](_0x055e('0xbd'));}}return _0x25972f;})['then'](function(_0x41b2af){if(_0x41b2af){return _0x41b2af['update']({'closed':_0x146dfb[_0x055e('0xb7')][_0x055e('0xbe')],'disposition':_0x146dfb['body']['disposition']})[_0x055e('0x20')](function(_0x5cb9f6){return _0x5cb9f6;});}})['then'](function(_0x24b914){return respondWithRpcPromise('AbandonInteraction',_0x055e('0xb8'),_0x146dfb['body'],client9004);})[_0x055e('0x20')](respondWithResult(_0x5ca835,null))[_0x055e('0xae')](handleError(_0x5ca835,null));};exports[_0x055e('0xbf')]=function(_0x1f6d63,_0x21cda6,_0x50dc55){_0x1f6d63['body'][_0x055e('0x38')]=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc1')];_0x1f6d63[_0x055e('0xb7')]['basename']=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc2')];_0x1f6d63['body'][_0x055e('0xc3')]=_0x1f6d63[_0x055e('0xc0')][_0x055e('0xc4')];return db[_0x055e('0xc5')][_0x055e('0xb4')](_0x1f6d63[_0x055e('0xb7')])['then'](respondWithResult(_0x21cda6,0xc9))[_0x055e('0xae')](handleError(_0x21cda6,null));};exports[_0x055e('0xc6')]=function(_0x943d86,_0x557c92,_0x38a846){return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x943d86['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x557c92,null))[_0x055e('0x20')](function(_0x1152ff){if(_0x1152ff){if(_0x1152ff['closed']){return _0x557c92['status'](0x193)[_0x055e('0x2c')]({'status':0x193,'message':'Unauthorized'});}return db[_0x055e('0xc5')][_0x055e('0xc7')]({'where':{'id':_0x943d86[_0x055e('0x3d')]['attachId']},'raw':!![]})[_0x055e('0x20')](handleEntityNotFound(_0x557c92,null));}})[_0x055e('0x20')](function(_0x330428){if(_0x330428){return _0x557c92['download'](path[_0x055e('0xc8')](config['root'],_0x055e('0xc9'),_0x330428[_0x055e('0xca')]));}})[_0x055e('0xae')](handleError(_0x557c92,null));};exports[_0x055e('0xcb')]=function(_0x27fb93,_0x16533d){var _0x1f54e3=null;var _0x36fe22=null;var _0xd83a95=null;var _0x2b3b85=null;if(_0x27fb93[_0x055e('0xb7')]['id']){delete _0x27fb93['body']['id'];}if(_0x27fb93['body'][_0x055e('0xcc')]){_0x2b3b85=path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xce'),util[_0x055e('0x60')](_0x055e('0xcf'),Date['now']()));_0x27fb93[_0x055e('0xb7')][_0x055e('0xd0')]=_0x2b3b85;}return db[_0x055e('0x9c')][_0x055e('0xb3')]({'where':{'id':_0x27fb93[_0x055e('0xb0')]['id']},'include':[{'model':db[_0x055e('0xd1')],'as':_0x055e('0xd2'),'include':[{'model':db[_0x055e('0xd3')],'as':'User'}]}]})[_0x055e('0x20')](handleEntityNotFound(_0x16533d,null))[_0x055e('0x20')](saveUpdates(_0x27fb93['body'],null))[_0x055e('0x20')](function(_0x27c819){if(_0x27c819){_0x1f54e3=_0x27c819;return db['ChatWebsite'][_0x055e('0xb3')]({'where':{'id':_0x1f54e3[_0x055e('0x79')]}});}})[_0x055e('0x20')](function(_0x478e91){if(_0x478e91){_0xd83a95=_0x478e91;return db[_0x055e('0xd4')]['find']({'where':{'id':_0x1f54e3['ContactId']}});}})[_0x055e('0x20')](function(_0x400ab5){if(_0x400ab5){_0x36fe22=_0x400ab5;if(_0x2b3b85){var _0x324439=null;for(var _0x1b749a=0x1;_0x1b749a<_0x1f54e3[_0x055e('0xd2')][_0x055e('0x72')];++_0x1b749a){_0x324439=_0x1f54e3[_0x055e('0xd2')][_0x1b749a];var _0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95[_0x055e('0xd6')],_0x324439['UserId']):_0x055e('0xd7');var _0x19fcbe=_0x27fb93[_0x055e('0xb7')][_0x055e('0xd8')]||util[_0x055e('0x60')](_0x055e('0xd5'),_0x055e('0xd9'),_0x324439['ContactId']);switch(_0xd83a95[_0x055e('0xda')]){case _0x055e('0xdb'):_0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95[_0x055e('0xd6')],_0x324439[_0x055e('0xbb')]):_0x055e('0xd7');break;case _0x055e('0xdc'):_0x144713=_0x324439[_0x055e('0xbb')]?_0x324439['User']['alias']||_0x324439[_0x055e('0xd3')][_0x055e('0xdd')]:_0x055e('0xd7');break;case _0x055e('0xde'):_0x144713=_0x324439[_0x055e('0xbb')]?_0x324439['User'][_0x055e('0xdd')]:_0x055e('0xd7');break;default:_0x144713=_0x324439[_0x055e('0xbb')]?util[_0x055e('0x60')](_0x055e('0xd5'),_0xd83a95['agentAlias'],_0x324439[_0x055e('0xbb')]):_0x055e('0xd7');}var _0x187d87=util[_0x055e('0x60')](_0x055e('0xdf'),moment(_0x324439[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0xe0')),_0x324439[_0x055e('0xe1')]==='in'?_0x19fcbe:_0x144713,_0x324439[_0x055e('0xb7')]);if(!_0x324439[_0x055e('0xe2')]){fs['appendFileSync'](_0x2b3b85,_0x187d87);}}return db[_0x055e('0xe3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x055e('0xe4')],'as':_0x055e('0xe5'),'raw':!![]}]});}}})['then'](function(_0x5887c9){if(_0x5887c9&&_0x5887c9['Smtp']&&_0x27fb93[_0x055e('0xb7')]){var _0x3d12ee={'tls':{'rejectUnauthorized':![]}};if(_0x5887c9['Smtp'][_0x055e('0xe6')]){_0x3d12ee[_0x055e('0xe6')]=_0x5887c9[_0x055e('0xe5')][_0x055e('0xe6')];}else{_0x3d12ee[_0x055e('0xe7')]=_0x5887c9[_0x055e('0xe5')]['host'];_0x3d12ee[_0x055e('0xe8')]=_0x5887c9[_0x055e('0xe5')]['port'];_0x3d12ee[_0x055e('0xe9')]=_0x5887c9[_0x055e('0xe5')]['secure'];}if(_0x5887c9[_0x055e('0xe5')][_0x055e('0xea')]){_0x3d12ee['auth']={'user':_0x5887c9[_0x055e('0xe5')]['user'],'pass':_0x5887c9[_0x055e('0xe5')]['pass']};}return respondWithRpcPromise(_0x055e('0xeb'),'sendMail',{'account':_0x3d12ee,'message':{'from':util[_0x055e('0x60')](_0x055e('0xec'),_0x5887c9[_0x055e('0x38')],_0x5887c9[_0x055e('0xed')]||_0x5887c9[_0x055e('0xe5')][_0x055e('0xee')]),'to':_0x27fb93[_0x055e('0xb7')][_0x055e('0xcc')],'subject':'Mail\x20Transcript','text':util[_0x055e('0x60')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x27fb93['body'][_0x055e('0xcc')]),'attachments':[{'path':_0x2b3b85}]}})['then'](function(){return _0x1f54e3;})[_0x055e('0xae')](function(_0x3527b3){console[_0x055e('0x27')](_0x3527b3);});}else{return _0x1f54e3;}})[_0x055e('0x20')](respondWithStatusCode(_0x16533d,0xc8))[_0x055e('0xae')](handleError(_0x16533d,null));};exports[_0x055e('0xef')]=function(_0x2d0361,_0x21e2f1,_0x3c1b2d){return db[_0x055e('0xd1')]['find']({'where':{'id':_0x2d0361[_0x055e('0xb0')]['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x21e2f1,null))[_0x055e('0x20')](function(_0xbce420){if(_0xbce420){return _0xbce420[_0x055e('0xef')](_0x2d0361[_0x055e('0xb7')][_0x055e('0xf0')],_['omit'](_0x2d0361[_0x055e('0xb7')],[_0x055e('0xf0'),'id'])||{});}})['then'](respondWithResult(_0x21e2f1,null))['catch'](handleError(_0x21e2f1,null));};exports[_0x055e('0xf1')]=function(_0x5f1f11,_0x10ddaf,_0x4e2614){var _0xd4c8cf={'raw':![],'where':{}};var _0x50f088={};var _0x29c7a4={'count':0x0,'rows':[]};return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x5f1f11['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x10ddaf,null))[_0x055e('0x20')](function(_0x43038c){if(_0x43038c){_0x50f088[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0xd1')][_0x055e('0x3b')]);_0x50f088[_0x055e('0x3d')]=_[_0x055e('0x3e')](_0x5f1f11['query']);_0x50f088['filters']=_[_0x055e('0x40')](_0x50f088[_0x055e('0x3c')],_0x50f088[_0x055e('0x3d')]);_0xd4c8cf[_0x055e('0x41')]=_['intersection'](_0x50f088[_0x055e('0x3c')],qs['fields'](_0x5f1f11[_0x055e('0x3d')][_0x055e('0x42')]));_0xd4c8cf[_0x055e('0x41')]=_0xd4c8cf[_0x055e('0x41')]['length']?_0xd4c8cf[_0x055e('0x41')]:_0x50f088[_0x055e('0x3c')];if(!_0x5f1f11[_0x055e('0x3d')][_0x055e('0x75')](_0x055e('0x43'))){_0xd4c8cf[_0x055e('0x2f')]=qs['limit'](_0x5f1f11[_0x055e('0x3d')][_0x055e('0x2f')]);_0xd4c8cf[_0x055e('0x2e')]=qs[_0x055e('0x2e')](_0x5f1f11['query'][_0x055e('0x2e')]);}_0xd4c8cf['order']=qs['sort'](_0x5f1f11[_0x055e('0x3d')]['sort']);_0xd4c8cf['where']=qs[_0x055e('0x3f')](_[_0x055e('0xf2')](_0x5f1f11['query'],_0x50f088['filters']));_0xd4c8cf[_0x055e('0x45')][_0x055e('0xaa')]=_0x43038c['id'];if(_0x5f1f11['query'][_0x055e('0x76')]){_0xd4c8cf[_0x055e('0x45')]=_['merge'](_0xd4c8cf[_0x055e('0x45')],{'$or':_[_0x055e('0x74')](_0xd4c8cf[_0x055e('0x41')],function(_0x8557c9){var _0x2ca760={};_0x2ca760[_0x8557c9]={'$like':'%'+_0x5f1f11[_0x055e('0x3d')][_0x055e('0x76')]+'%'};return _0x2ca760;})});}if(_0x5f1f11['query'][_0x055e('0xf3')]){var _0x49d120=_0x5f1f11['query'][_0x055e('0xf3')][_0x055e('0x81')](',');var _0x293731={};_0x293731[_0x49d120[0x0]]={'$gte':moment(_0x49d120[0x1])[_0x055e('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0xd4c8cf['where']=_[_0x055e('0x9b')](_0xd4c8cf[_0x055e('0x45')],_0x293731);}_0xd4c8cf=_['merge']({},_0xd4c8cf,_0x5f1f11[_0x055e('0xb2')]);return db[_0x055e('0xd1')]['count']({'where':_0xd4c8cf[_0x055e('0x45')]})[_0x055e('0x20')](function(_0xe4d59){_0x29c7a4['count']=_0xe4d59;if(_0x5f1f11['query'][_0x055e('0xb1')]){_0xd4c8cf['include']=[{'all':!![]}];}return db[_0x055e('0xd1')]['findAll'](_0xd4c8cf);})['then'](function(_0x1fe5b7){_0x29c7a4[_0x055e('0xad')]=_0x1fe5b7;return _0x29c7a4;});}})[_0x055e('0x20')](respondWithFilteredResult(_0x10ddaf,_0xd4c8cf))[_0x055e('0xae')](handleError(_0x10ddaf,null));};exports['getMyMessages']=function(_0x104f2c,_0x56ac62,_0x5af152){var _0xd3a6c={'where':{}},_0x27a4d7={},_0x69ab07={'count':0x0,'rows':[]};return db[_0x055e('0x9c')][_0x055e('0xc7')]({'where':{'id':_0x104f2c[_0x055e('0xb0')]['id']}})['then'](handleEntityNotFound(_0x56ac62,null))[_0x055e('0x20')](function(_0x1f3b3d){if(_0x1f3b3d){_0x27a4d7[_0x055e('0x3c')]=_[_0x055e('0x3e')](db[_0x055e('0xd1')]['rawAttributes']);_0x27a4d7[_0x055e('0x3d')]=_['keys'](_0x104f2c['query']);_0x27a4d7[_0x055e('0x3f')]=_['intersection'](_0x27a4d7[_0x055e('0x3c')],_0x27a4d7[_0x055e('0x3d')]);_0xd3a6c[_0x055e('0x41')]=_['intersection'](_0x27a4d7[_0x055e('0x3c')],qs[_0x055e('0x42')](_0x104f2c['query'][_0x055e('0x42')]));_0xd3a6c[_0x055e('0x41')]=_0xd3a6c[_0x055e('0x41')][_0x055e('0x72')]?_0xd3a6c[_0x055e('0x41')]:_0x27a4d7[_0x055e('0x3c')];if(!_0x104f2c[_0x055e('0x3d')][_0x055e('0x75')](_0x055e('0x43'))){_0xd3a6c[_0x055e('0x2f')]=qs['limit'](_0x104f2c['query']['limit']);_0xd3a6c[_0x055e('0x2e')]=qs['offset'](_0x104f2c[_0x055e('0x3d')]['offset']);}_0xd3a6c['order']=qs[_0x055e('0x44')](_0x104f2c[_0x055e('0x3d')][_0x055e('0x44')]);_0xd3a6c[_0x055e('0x45')]=qs[_0x055e('0x3f')](_[_0x055e('0xf2')](_0x104f2c['query'],_0x27a4d7['filters']));_0xd3a6c[_0x055e('0x45')][_0x055e('0xaa')]=_0x1f3b3d['id'];if(_0x104f2c[_0x055e('0x3d')][_0x055e('0x76')]){_0xd3a6c['where']=_[_0x055e('0x9b')](_0xd3a6c[_0x055e('0x45')],{'$or':_[_0x055e('0x74')](_0xd3a6c[_0x055e('0x41')],function(_0x716344){var _0x3f0bbe={};_0x3f0bbe[_0x716344]={'$like':'%'+_0x104f2c[_0x055e('0x3d')]['filter']+'%'};return _0x3f0bbe;})});}_0xd3a6c[_0x055e('0x45')][_0x055e('0xe2')]=![];if(_0x104f2c[_0x055e('0x3d')]['id']){_0xd3a6c[_0x055e('0x45')]['id']={'$gt':_0x104f2c['query']['id']};}_0xd3a6c=_[_0x055e('0x9b')]({},_0xd3a6c,_0x104f2c[_0x055e('0xb2')]);return db['ChatMessage'][_0x055e('0x2d')]({'where':_0xd3a6c['where']})[_0x055e('0x20')](function(_0xa82e99){_0x69ab07['count']=_0xa82e99;_0xd3a6c['include']=[];if(_0x104f2c[_0x055e('0x3d')][_0x055e('0xf4')]){_0xd3a6c[_0x055e('0xf5')][_0x055e('0x82')]({'model':db['User'],'as':_0x055e('0xd3'),'attributes':['id',_0x055e('0xdd'),'alias']});}if(_0x104f2c[_0x055e('0x3d')][_0x055e('0xb1')]){_0xd3a6c[_0x055e('0xf5')]=[{'all':!![]}];}return db[_0x055e('0xd1')][_0x055e('0xf6')](_0xd3a6c);})[_0x055e('0x20')](function(_0x455f17){_0x69ab07['rows']=_0x455f17;return _0x69ab07;});}})[_0x055e('0x20')](respondWithFilteredResult(_0x56ac62,_0xd3a6c))[_0x055e('0xae')](handleError(_0x56ac62,null));};exports['addTags']=function(_0x5e68a1,_0x2a0732,_0x40b8cf){return db['ChatInteraction']['find']({'where':{'id':_0x5e68a1['params']['id']}})[_0x055e('0x20')](handleEntityNotFound(_0x2a0732,null))[_0x055e('0x20')](function(_0x2e690d){if(_0x2e690d){return _0x2e690d[_0x055e('0xf7')](_0x5e68a1['body'][_0x055e('0xf0')],_[_0x055e('0xf8')](_0x5e68a1[_0x055e('0xb7')],[_0x055e('0xf0'),'id'])||{})[_0x055e('0xf9')](function(){return db[_0x055e('0xfa')][_0x055e('0xf6')]({'attributes':['id',_0x055e('0x38'),_0x055e('0xfb')],'where':{'id':_0x5e68a1[_0x055e('0xb7')][_0x055e('0xf0')]}});})['then'](function(_0x177661){socket[_0x055e('0xfc')](_0x055e('0xfd'),{'id':Number(_0x5e68a1[_0x055e('0xb0')]['id']),'tags':_0x177661||[]});return{'id':Number(_0x5e68a1['params']['id']),'tags':_0x177661||[]};});}})['then'](respondWithResult(_0x2a0732,null))['catch'](handleError(_0x2a0732,null));};exports['removeTags']=function(_0x55bdef,_0x56a608,_0x348631){return db['ChatInteraction']['find']({'where':{'id':_0x55bdef['params']['id']}})['then'](handleEntityNotFound(_0x56a608,null))[_0x055e('0x20')](function(_0x5a6f8e){if(_0x5a6f8e){return _0x5a6f8e[_0x055e('0xfe')](_0x55bdef['query'][_0x055e('0xf0')]);}})['then'](respondWithStatusCode(_0x56a608,null))[_0x055e('0xae')](handleError(_0x56a608,null));};exports['download']=function(_0x132596,_0x17cb4d){var _0x411090=moment()['unix']()[_0x055e('0x83')]();var _0x55e3e8=path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xff'),_0x055e('0x100'),_0x055e('0x101'));var _0x5eee8e=path[_0x055e('0xc8')](config['root'],_0x055e('0xff'),_0x055e('0x100'),_0x055e('0x102'));var _0x2c482b=path['join'](_0x55e3e8,_0x411090);var _0x597e1d=util[_0x055e('0x60')](_0x055e('0x103'),_0x132596[_0x055e('0xb0')]['id'],_0x411090);var _0x197687=path['join'](_0x55e3e8,_0x597e1d);var _0x1f14d1=![];return db['ChatInteraction'][_0x055e('0xb3')]({'where':{'id':_0x132596[_0x055e('0xb0')]['id']},'include':[{'model':db[_0x055e('0xd1')],'as':_0x055e('0xd2'),'attributes':['id',_0x055e('0xb7'),_0x055e('0x5b'),'direction',_0x055e('0xe2')],'include':[{'model':db[_0x055e('0xd3')],'as':_0x055e('0xd3'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x055e('0xd4')],'as':_0x055e('0x104'),'attributes':['id',_0x055e('0x105'),_0x055e('0x106')],'raw':!![]},{'model':db['Attachment'],'as':_0x055e('0xc5'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x055e('0x107'),'attributes':['id',_0x055e('0x38')]},{'model':db[_0x055e('0xd3')],'as':_0x055e('0x108'),'attributes':['id',_0x055e('0xdd')]}]})[_0x055e('0x20')](handleEntityNotFound(_0x17cb4d,null))['then'](function(_0xedd4a7){if(_0xedd4a7){var _0x3971ec=_0xedd4a7[_0x055e('0x109')]({'plain':!![]});_0x1f14d1=!![];var _0x27e111={'format':'A4','border':_0x055e('0x10a'),'header':{'height':_0x055e('0x10b'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x055e('0x10c'),'contents':{'default':util['format'](_0x055e('0x10d'),util[_0x055e('0x60')](_0x055e('0x10e'),'Chat',_0x3971ec['id']),moment()[_0x055e('0x60')](_0x055e('0x10f'))['toString']())}}};fs[_0x055e('0x110')](_0x2c482b);var _0x4c8dcf={'channel':_0x055e('0x111'),'account':_0x3971ec[_0x055e('0x107')][_0x055e('0x38')],'agent':_0x3971ec[_0x055e('0x108')]?_0x3971ec[_0x055e('0x108')][_0x055e('0xdd')]:_0x055e('0x112'),'createdAt':moment(_0x3971ec[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0x113'))['toString'](),'closedAt':_0x3971ec[_0x055e('0xbe')]?moment(_0x3971ec[_0x055e('0x114')])[_0x055e('0x60')](_0x055e('0x113'))[_0x055e('0x83')]():'','disposition':_0x3971ec[_0x055e('0x115')],'chatInfo':{'browser':_0x3971ec[_0x055e('0x116')],'os':_0x3971ec[_0x055e('0x117')],'referer':_0x3971ec[_0x055e('0x118')],'customerIp':_0x3971ec[_0x055e('0x119')]},'messages':_(_0x3971ec['Messages'])[_0x055e('0x11a')]()[_0x055e('0x76')]({'secret':![]})[_0x055e('0x74')](function(_0x3a14e0){if(_0x3a14e0[_0x055e('0xc5')]){var _0x179782=path[_0x055e('0xc8')](_0x5eee8e,_0x3a14e0['Attachment'][_0x055e('0xca')]);if(fs[_0x055e('0x11b')](_0x179782)){fs['createReadStream'](_0x179782)[_0x055e('0x11c')](fs[_0x055e('0x11d')](path['join'](_0x2c482b,_0x3a14e0[_0x055e('0xc5')][_0x055e('0xca')])));}}return{'date':moment(_0x3a14e0[_0x055e('0x5b')])[_0x055e('0x60')](_0x055e('0x113'))[_0x055e('0x83')](),'sender':_0x3a14e0[_0x055e('0xe1')]==='out'?_0x3a14e0[_0x055e('0xd3')]?_0x3a14e0[_0x055e('0xd3')]['fullname']:_0x055e('0xd7'):_0x3a14e0[_0x055e('0x104')]['firstName']+(_0x3a14e0[_0x055e('0x104')][_0x055e('0x106')]?'\x20'+_0x3a14e0[_0x055e('0x104')][_0x055e('0x106')]:''),'body':_0x3a14e0[_0x055e('0xc5')]?_0x3a14e0[_0x055e('0xc5')]['basename']:_0x3a14e0['body'],'direction':_0x3a14e0['direction']===_0x055e('0x11e')?'A':'C','secret':_0x3a14e0[_0x055e('0xe2')],'attachment':_0x3a14e0['Attachment']};})[_0x055e('0x5c')]()};return ejs[_0x055e('0x11f')](path[_0x055e('0xc8')](config[_0x055e('0xcd')],_0x055e('0xff'),_0x055e('0x120'),_0x055e('0x121')),{'interaction':_0x4c8dcf})['then'](function(_0x516cd1){return new BPromise(function(_0x103006,_0x484ba3){pdf[_0x055e('0xb4')](_0x516cd1,_0x27e111)[_0x055e('0x122')](path['join'](_0x2c482b,'transcript-'+_0x3971ec['id']+'-'+_0x411090+_0x055e('0x123')),function(_0x2e02d0,_0x4f91b1){if(_0x2e02d0)return _0x484ba3(_0x2e02d0);_0x103006(_0x4f91b1);});});});}})[_0x055e('0x20')](function(){if(_0x1f14d1){return new BPromise(function(_0x572f41,_0x5548ae){zipdir(_0x2c482b,{'saveTo':_0x197687},function(_0x21919e,_0x2630d9){if(_0x21919e)return _0x5548ae(_0x21919e);return _0x572f41(_0x2630d9);});})[_0x055e('0x20')](function(){return new BPromise(function(_0x1b2876,_0x34de1a){rimraf(_0x2c482b,function(_0x11088c){if(_0x11088c)_0x34de1a(_0x11088c);return _0x1b2876();});});})[_0x055e('0x20')](function(){return _0x17cb4d[_0x055e('0x124')](_0x197687,_0x597e1d,function(_0x540fd7){if(_0x540fd7){console[_0x055e('0x125')](_0x055e('0x126'),_0x540fd7);}else{fs[_0x055e('0x127')](_0x197687);}});});}else{return _0x17cb4d[_0x055e('0x2a')](0xc8);}})['catch'](handleError(_0x17cb4d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0d70aaa..cfdf499 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 _0x3dbb=['ChatInteraction','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3dbb,0x103));var _0xb3db=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x3dbb[_0x2932cf];return _0x1711dd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb3db('0x0'))['db'][_0xb3db('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb3db('0x2')](0x0);var events={'afterCreate':_0xb3db('0x3'),'afterUpdate':_0xb3db('0x4'),'afterDestroy':_0xb3db('0x5')};function emitEvent(_0x1433fa){return function(_0xf5c7fb,_0x3c9085,_0x2315e6){ChatInteractionEvents[_0xb3db('0x6')](_0x1433fa+':'+_0xf5c7fb['id'],_0xf5c7fb);ChatInteractionEvents['emit'](_0x1433fa,_0xf5c7fb);_0x2315e6(null);};}for(var e in events){if(events[_0xb3db('0x7')](e)){var event=events[e];ChatInteraction[_0xb3db('0x8')](e,emitEvent(event));}}module[_0xb3db('0x9')]=ChatInteractionEvents; \ No newline at end of file +var _0x2162=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatInteraction','setMaxListeners','update'];(function(_0x4323b3,_0x5835b6){var _0x285b28=function(_0x165caf){while(--_0x165caf){_0x4323b3['push'](_0x4323b3['shift']());}};_0x285b28(++_0x5835b6);}(_0x2162,0x1b3));var _0x2216=function(_0x3b90cb,_0xe7a4f3){_0x3b90cb=_0x3b90cb-0x0;var _0x3644d3=_0x2162[_0x3b90cb];return _0x3644d3;};'use strict';var EventEmitter=require(_0x2216('0x0'));var ChatInteraction=require(_0x2216('0x1'))['db'][_0x2216('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2216('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2216('0x4'),'afterDestroy':_0x2216('0x5')};function emitEvent(_0x480587){return function(_0xf34c57,_0x3e9702,_0x218f25){ChatInteractionEvents[_0x2216('0x6')](_0x480587+':'+_0xf34c57['id'],_0xf34c57);ChatInteractionEvents['emit'](_0x480587,_0xf34c57);_0x218f25(null);};}for(var e in events){if(events[_0x2216('0x7')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index d15cb1d..0316f5a 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 _0xb7e7=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x31caf9,_0x6c6a41){var _0x21476d=function(_0x1f1d28){while(--_0x1f1d28){_0x31caf9['push'](_0x31caf9['shift']());}};_0x21476d(++_0x6c6a41);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b871,_0x223587,_0x2917f9){if(_0x42b871[_0x7b7e('0x9')](_0x7b7e('0xa'))){_0x42b871[_0x7b7e('0xb')]=moment()[_0x7b7e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2917f9(null,_0x42b871);}},'charset':_0x7b7e('0xd'),'collate':_0x7b7e('0xe')});}; \ No newline at end of file +var _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x1cad6c,_0x506ef3){var _0x55ce3c=function(_0x46aa5a){while(--_0x46aa5a){_0x1cad6c['push'](_0x1cad6c['shift']());}};_0x55ce3c(++_0x506ef3);}(_0x757a,0xde));var _0xa757=function(_0x545b3a,_0x109c7a){_0x545b3a=_0x545b3a-0x0;var _0x2b9352=_0x757a[_0x545b3a];return _0x2b9352;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 77314f8..1356f67 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 _0xe9e4=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b9199,_0x4b90be){var _0x11beab=function(_0x13d226){while(--_0x13d226){_0x3b9199['push'](_0x3b9199['shift']());}};_0x11beab(++_0x4b90be);}(_0xe9e4,0x163));var _0x4e9e=function(_0x469c1e,_0x885771){_0x469c1e=_0x469c1e-0x0;var _0x1fb2ca=_0xe9e4[_0x469c1e];return _0x1fb2ca;};'use strict';var _=require(_0x4e9e('0x0'));var util=require('util');var moment=require(_0x4e9e('0x1'));var BPromise=require(_0x4e9e('0x2'));var rs=require(_0x4e9e('0x3'));var fs=require('fs');var Redis=require(_0x4e9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e9e('0x5'));var logger=require('../../config/logger')(_0x4e9e('0x6'));var config=require(_0x4e9e('0x7'));var jayson=require(_0x4e9e('0x8'));var client=jayson[_0x4e9e('0x9')][_0x4e9e('0xa')]({'port':0x232a});config[_0x4e9e('0xb')]=_[_0x4e9e('0xc')](config[_0x4e9e('0xb')],{'host':_0x4e9e('0xd'),'port':0x18eb});var socket=require(_0x4e9e('0xe'))(new Redis(config[_0x4e9e('0xb')]));require(_0x4e9e('0xf'))[_0x4e9e('0x10')](socket);function respondWithRpcPromise(_0x536d8f,_0x5c406b,_0x435328){return new BPromise(function(_0x496da4,_0x5deeda){return client[_0x4e9e('0x11')](_0x536d8f,_0x435328)[_0x4e9e('0x12')](function(_0xc92673){logger[_0x4e9e('0x13')](_0x4e9e('0x14'),_0x5c406b,_0x4e9e('0x15'));logger[_0x4e9e('0x16')](_0x4e9e('0x17'),_0x5c406b,_0x4e9e('0x15'),JSON[_0x4e9e('0x18')](_0xc92673));if(_0xc92673[_0x4e9e('0x19')]){if(_0xc92673[_0x4e9e('0x19')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c406b,_0xc92673['error'][_0x4e9e('0x1a')]);return _0x5deeda(_0xc92673['error'][_0x4e9e('0x1a')]);}logger['error'](_0x4e9e('0x14'),_0x5c406b,_0xc92673['error'][_0x4e9e('0x1a')]);return _0x496da4(_0xc92673['error'][_0x4e9e('0x1a')]);}else{logger['info'](_0x4e9e('0x14'),_0x5c406b,'request\x20sent');_0x496da4(_0xc92673['result']['message']);}})[_0x4e9e('0x1b')](function(_0x3c1957){logger[_0x4e9e('0x19')](_0x4e9e('0x14'),_0x5c406b,_0x3c1957);_0x5deeda(_0x3c1957);});});}exports[_0x4e9e('0x1c')]=function(_0x1c411f){var _0x5a38f4=this;return new Promise(function(_0x46a95a,_0x156fe5){return db['ChatInteraction'][_0x4e9e('0x1d')](_0x1c411f[_0x4e9e('0x1e')],{'raw':_0x1c411f[_0x4e9e('0x1f')]?_0x1c411f[_0x4e9e('0x1f')][_0x4e9e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c411f['options']?_0x1c411f[_0x4e9e('0x1f')][_0x4e9e('0x21')]||null:null,'attributes':_0x1c411f[_0x4e9e('0x1f')]?_0x1c411f[_0x4e9e('0x1f')]['attributes']||null:null,'limit':_0x1c411f['options']?_0x1c411f['options'][_0x4e9e('0x22')]||null:null})[_0x4e9e('0x12')](function(_0x4057e6){logger[_0x4e9e('0x13')]('UpdateChatInteraction',_0x1c411f);logger[_0x4e9e('0x16')](_0x4e9e('0x1c'),_0x1c411f,JSON[_0x4e9e('0x18')](_0x4057e6));_0x46a95a(_0x4057e6);})['catch'](function(_0x19702b){logger[_0x4e9e('0x19')](_0x4e9e('0x1c'),_0x19702b['message'],_0x1c411f);_0x156fe5(_0x5a38f4['error'](0x1f4,_0x19702b['message']));});});};exports[_0x4e9e('0x23')]=function(_0x5a1e13){return new Promise(function(_0x32f3a1,_0x5d7e2a){return db[_0x4e9e('0x24')]['find']({'where':_0x5a1e13[_0x4e9e('0x1f')]?_0x5a1e13[_0x4e9e('0x1f')][_0x4e9e('0x21')]||null:null})[_0x4e9e('0x12')](function(_0x9abbd1){if(_0x9abbd1){return _0x9abbd1[_0x4e9e('0x25')](_0x5a1e13[_0x4e9e('0x1e')]['ids'],_[_0x4e9e('0x26')](_0x5a1e13['body'],[_0x4e9e('0x27'),'id'])||{});}})[_0x4e9e('0x28')](function(_0x31670e){logger[_0x4e9e('0x13')]('AddTags',_0x5a1e13);logger[_0x4e9e('0x16')](_0x4e9e('0x29'),_0x5a1e13,JSON[_0x4e9e('0x18')](_0x31670e));_0x32f3a1(_0x31670e);})[_0x4e9e('0x1b')](function(_0x37dcf2){logger[_0x4e9e('0x19')]('AddTags',_0x37dcf2[_0x4e9e('0x1a')],_0x5a1e13);_0x5d7e2a(_this['error'](0x1f4,_0x37dcf2['message']));});});}; \ No newline at end of file +var _0x5ddf=['catch','update','options','where','limit','UpdateChatInteraction','ChatInteraction','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5ddf,0x124));var _0xf5dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5dd('0x0'));var util=require(_0xf5dd('0x1'));var moment=require(_0xf5dd('0x2'));var BPromise=require(_0xf5dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5dd('0x4'));var db=require(_0xf5dd('0x5'))['db'];var utils=require(_0xf5dd('0x6'));var logger=require(_0xf5dd('0x7'))('rpc');var config=require(_0xf5dd('0x8'));var jayson=require(_0xf5dd('0x9'));var client=jayson[_0xf5dd('0xa')][_0xf5dd('0xb')]({'port':0x232a});config['redis']=_[_0xf5dd('0xc')](config[_0xf5dd('0xd')],{'host':_0xf5dd('0xe'),'port':0x18eb});var socket=require(_0xf5dd('0xf'))(new Redis(config[_0xf5dd('0xd')]));require(_0xf5dd('0x10'))[_0xf5dd('0x11')](socket);function respondWithRpcPromise(_0x280e93,_0x5aae56,_0x12285e){return new BPromise(function(_0x163640,_0x2641d8){return client['request'](_0x280e93,_0x12285e)[_0xf5dd('0x12')](function(_0x3b241c){logger['info'](_0xf5dd('0x13'),_0x5aae56,'request\x20sent');logger[_0xf5dd('0x14')](_0xf5dd('0x15'),_0x5aae56,_0xf5dd('0x16'),JSON[_0xf5dd('0x17')](_0x3b241c));if(_0x3b241c['error']){if(_0x3b241c[_0xf5dd('0x18')]['code']===0x1f4){logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);return _0x2641d8(_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);}logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x3b241c[_0xf5dd('0x18')][_0xf5dd('0x19')]);return _0x163640(_0x3b241c['error'][_0xf5dd('0x19')]);}else{logger[_0xf5dd('0x1a')](_0xf5dd('0x13'),_0x5aae56,'request\x20sent');_0x163640(_0x3b241c[_0xf5dd('0x1b')][_0xf5dd('0x19')]);}})[_0xf5dd('0x1c')](function(_0x2ac6d6){logger[_0xf5dd('0x18')](_0xf5dd('0x13'),_0x5aae56,_0x2ac6d6);_0x2641d8(_0x2ac6d6);});});}exports['UpdateChatInteraction']=function(_0x4473c0){var _0x23725a=this;return new Promise(function(_0x57c86c,_0x32a197){return db['ChatInteraction'][_0xf5dd('0x1d')](_0x4473c0['body'],{'raw':_0x4473c0[_0xf5dd('0x1e')]?_0x4473c0[_0xf5dd('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4473c0['options']?_0x4473c0[_0xf5dd('0x1e')][_0xf5dd('0x1f')]||null:null,'attributes':_0x4473c0['options']?_0x4473c0[_0xf5dd('0x1e')]['attributes']||null:null,'limit':_0x4473c0[_0xf5dd('0x1e')]?_0x4473c0[_0xf5dd('0x1e')][_0xf5dd('0x20')]||null:null})[_0xf5dd('0x12')](function(_0x3f873f){logger[_0xf5dd('0x1a')](_0xf5dd('0x21'),_0x4473c0);logger['debug'](_0xf5dd('0x21'),_0x4473c0,JSON[_0xf5dd('0x17')](_0x3f873f));_0x57c86c(_0x3f873f);})[_0xf5dd('0x1c')](function(_0x24e06f){logger[_0xf5dd('0x18')](_0xf5dd('0x21'),_0x24e06f[_0xf5dd('0x19')],_0x4473c0);_0x32a197(_0x23725a[_0xf5dd('0x18')](0x1f4,_0x24e06f[_0xf5dd('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x3c6c13){return new Promise(function(_0x2eaf0c,_0x4c8404){return db[_0xf5dd('0x22')]['find']({'where':_0x3c6c13['options']?_0x3c6c13[_0xf5dd('0x1e')][_0xf5dd('0x1f')]||null:null})[_0xf5dd('0x12')](function(_0x166141){if(_0x166141){return _0x166141[_0xf5dd('0x23')](_0x3c6c13[_0xf5dd('0x24')][_0xf5dd('0x25')],_['omit'](_0x3c6c13['body'],[_0xf5dd('0x25'),'id'])||{});}})[_0xf5dd('0x26')](function(_0x44c47e){logger[_0xf5dd('0x1a')](_0xf5dd('0x27'),_0x3c6c13);logger['debug']('AddTags',_0x3c6c13,JSON[_0xf5dd('0x17')](_0x44c47e));_0x2eaf0c(_0x44c47e);})[_0xf5dd('0x1c')](function(_0x452fd4){logger[_0xf5dd('0x18')](_0xf5dd('0x27'),_0x452fd4[_0xf5dd('0x19')],_0x3c6c13);_0x4c8404(_this['error'](0x1f4,_0x452fd4[_0xf5dd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e2f0ceb..46db272 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 _0x1578=['length','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x5f1d32,_0x47d03f){var _0x49145a=function(_0x5744b1){while(--_0x5744b1){_0x5f1d32['push'](_0x5f1d32['shift']());}};_0x49145a(++_0x47d03f);}(_0x1578,0xfd));var _0x8157=function(_0x1b4c30,_0xbb4527){_0x1b4c30=_0x1b4c30-0x0;var _0x45e83b=_0x1578[_0x1b4c30];return _0x45e83b;};'use strict';var ChatInteractionEvents=require(_0x8157('0x0'));var events=[_0x8157('0x1'),'remove',_0x8157('0x2')];function createListener(_0x240cff,_0x161e91){return function(_0x44b21a){_0x161e91[_0x8157('0x3')](_0x240cff,_0x44b21a);};}function removeListener(_0x35e195,_0x342a5a){return function(){ChatInteractionEvents[_0x8157('0x4')](_0x35e195,_0x342a5a);};}exports['register']=function(_0xaec0f2){for(var _0x179137=0x0,_0x2d445f=events[_0x8157('0x5')];_0x179137<_0x2d445f;_0x179137++){var _0x2ffc26=events[_0x179137];var _0x115b9c=createListener('chatInteraction:'+_0x2ffc26,_0xaec0f2);ChatInteractionEvents['on'](_0x2ffc26,_0x115b9c);}}; \ No newline at end of file +var _0x40fd=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','emit'];(function(_0xfab7d2,_0x3de01e){var _0x5a804e=function(_0x21213e){while(--_0x21213e){_0xfab7d2['push'](_0xfab7d2['shift']());}};_0x5a804e(++_0x3de01e);}(_0x40fd,0x17e));var _0xd40f=function(_0x45dafa,_0x171e29){_0x45dafa=_0x45dafa-0x0;var _0xeb385a=_0x40fd[_0x45dafa];return _0xeb385a;};'use strict';var ChatInteractionEvents=require(_0xd40f('0x0'));var events=['save',_0xd40f('0x1'),'update'];function createListener(_0x50ad20,_0x4e6315){return function(_0x101fa4){_0x4e6315[_0xd40f('0x2')](_0x50ad20,_0x101fa4);};}function removeListener(_0xbe3839,_0x191e08){return function(){ChatInteractionEvents[_0xd40f('0x3')](_0xbe3839,_0x191e08);};}exports[_0xd40f('0x4')]=function(_0x403279){for(var _0x2d0af6=0x0,_0x491d38=events[_0xd40f('0x5')];_0x2d0af6<_0x491d38;_0x2d0af6++){var _0x836f21=events[_0x2d0af6];var _0x18cadb=createListener(_0xd40f('0x6')+_0x836f21,_0x403279);ChatInteractionEvents['on'](_0x836f21,_0x18cadb);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 29b5570..8a8021b 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 _0x8f59=['get','index','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','isAuthenticated','download','post','create','diskStorage','join','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller'];(function(_0x9260ec,_0x24083c){var _0x122945=function(_0x2c744f){while(--_0x2c744f){_0x9260ec['push'](_0x9260ec['shift']());}};_0x122945(++_0x24083c);}(_0x8f59,0x11d));var _0x98f5=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0x8f59[_0x284807];return _0x50c774;};'use strict';var multer=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var path=require(_0x98f5('0x2'));var timeout=require(_0x98f5('0x3'));var express=require(_0x98f5('0x4'));var router=express[_0x98f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x98f5('0x6'));var config=require(_0x98f5('0x7'));var controller=require(_0x98f5('0x8'));router[_0x98f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x98f5('0xa')]);router[_0x98f5('0x9')](_0x98f5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x98f5('0x9')](_0x98f5('0xc'),auth[_0x98f5('0xd')](),controller['show']);router[_0x98f5('0x9')](_0x98f5('0xe'),auth[_0x98f5('0xd')](),controller[_0x98f5('0xf')]);router['get'](_0x98f5('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x98f5('0x9')](_0x98f5('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x98f5('0x12')]);router[_0x98f5('0x9')](_0x98f5('0x13'),auth[_0x98f5('0x14')](),controller[_0x98f5('0x15')]);router[_0x98f5('0x16')]('/',auth['isAuthenticated'](),controller[_0x98f5('0x17')]);var upload=multer({'storage':multer[_0x98f5('0x18')]({'destination':function(_0x5b8bab,_0x9df84,_0x3d6b5c){_0x3d6b5c(null,path[_0x98f5('0x19')](config['root'],_0x98f5('0x1a')));},'filename':function(_0xc7a49b,_0x113545,_0x5bb486){_0x5bb486(null,util[_0x98f5('0x1b')](_0x98f5('0x1c'),Date['now'](),_0x113545[_0x98f5('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x98f5('0x16')](_0x98f5('0x1e'),upload[_0x98f5('0x1f')](_0x98f5('0x20')),controller[_0x98f5('0x21')]);router[_0x98f5('0x16')]('/:id/messages',auth[_0x98f5('0xd')](),controller['addMessage']);router[_0x98f5('0x16')](_0x98f5('0x22'),auth['isAuthenticated'](),interaction[_0x98f5('0x23')](_0x98f5('0x24'),_0x98f5('0x25')),controller[_0x98f5('0x26')]);router[_0x98f5('0x27')](_0x98f5('0xc'),auth[_0x98f5('0x14')](),interaction['tracked'](_0x98f5('0x24'),'chatinteraction:update'),controller[_0x98f5('0x28')]);router['put'](_0x98f5('0x29'),controller[_0x98f5('0x2a')]);router[_0x98f5('0x27')](_0x98f5('0x2b'),auth[_0x98f5('0xd')](),controller[_0x98f5('0x2c')]);router[_0x98f5('0x27')]('/:id/close',controller[_0x98f5('0x2d')]);router[_0x98f5('0x2e')]('/:id',auth[_0x98f5('0x14')](),interaction[_0x98f5('0x23')](_0x98f5('0x24'),_0x98f5('0x2f')),controller[_0x98f5('0x30')]);router[_0x98f5('0x2e')](_0x98f5('0x22'),auth[_0x98f5('0x14')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x0102=['chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','get','isAuthenticated','index','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','create','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','update','/:id/custom_update','/:id/abandon','put','close','delete'];(function(_0xb1619b,_0x45c457){var _0x5170b3=function(_0x28044f){while(--_0x28044f){_0xb1619b['push'](_0xb1619b['shift']());}};_0x5170b3(++_0x45c457);}(_0x0102,0x186));var _0x2010=function(_0x2af33c,_0x4fb7ea){_0x2af33c=_0x2af33c-0x0;var _0x16f4aa=_0x0102[_0x2af33c];return _0x16f4aa;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x2010('0x4')]('/',auth[_0x2010('0x5')](),controller[_0x2010('0x6')]);router[_0x2010('0x4')]('/describe',auth[_0x2010('0x5')](),controller['describe']);router[_0x2010('0x4')](_0x2010('0x7'),auth['isChatInteractionAuthorized'](),controller[_0x2010('0x8')]);router[_0x2010('0x4')](_0x2010('0x9'),auth[_0x2010('0xa')](),controller[_0x2010('0xb')]);router[_0x2010('0x4')](_0x2010('0xc'),auth[_0x2010('0x5')](),controller[_0x2010('0xd')]);router[_0x2010('0x4')](_0x2010('0xe'),auth[_0x2010('0xa')](),controller[_0x2010('0xf')]);router[_0x2010('0x4')](_0x2010('0x10'),auth[_0x2010('0x5')](),controller['download']);router['post']('/',auth[_0x2010('0x5')](),controller[_0x2010('0x11')]);var upload=multer({'storage':multer[_0x2010('0x12')]({'destination':function(_0x10b587,_0x32d791,_0x335be4){_0x335be4(null,path['join'](config[_0x2010('0x13')],_0x2010('0x14')));},'filename':function(_0x5ad412,_0x41e267,_0x11c94b){_0x11c94b(null,util[_0x2010('0x15')](_0x2010('0x16'),Date[_0x2010('0x17')](),_0x41e267[_0x2010('0x18')][_0x2010('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2010('0x1a')](_0x2010('0x1b'),upload['single']('file'),controller[_0x2010('0x1c')]);router[_0x2010('0x1a')](_0x2010('0xc'),auth[_0x2010('0xa')](),controller['addMessage']);router['post'](_0x2010('0x1d'),auth[_0x2010('0x5')](),interaction[_0x2010('0x1e')](_0x2010('0x1f'),_0x2010('0x20')),controller[_0x2010('0x21')]);router['put'](_0x2010('0x7'),auth[_0x2010('0x5')](),interaction['tracked']('chat','chatinteraction:update'),controller[_0x2010('0x22')]);router['put'](_0x2010('0x23'),controller['customUpdate']);router['put'](_0x2010('0x24'),auth[_0x2010('0xa')](),controller['abandon']);router[_0x2010('0x25')]('/:id/close',controller[_0x2010('0x26')]);router[_0x2010('0x27')](_0x2010('0x7'),auth[_0x2010('0x5')](),interaction[_0x2010('0x1e')](_0x2010('0x1f'),_0x2010('0x28')),controller[_0x2010('0x29')]);router[_0x2010('0x27')](_0x2010('0x1d'),auth[_0x2010('0x5')](),controller[_0x2010('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 44d2cff..d813391 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 _0x4991=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x38608a,_0x2599c5){var _0x2d7a03=function(_0x5bfe0f){while(--_0x5bfe0f){_0x38608a['push'](_0x38608a['shift']());}};_0x2d7a03(++_0x2599c5);}(_0x4991,0xf7));var _0x1499=function(_0x30f969,_0x405ffa){_0x30f969=_0x30f969-0x0;var _0x2d23cf=_0x4991[_0x30f969];return _0x2d23cf;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'body':{'type':Sequelize[_0x1499('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1499('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1499('0x3')]}}; \ No newline at end of file +var _0xb511=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x1a1318,_0x54f540){var _0x53da69=function(_0x5940cc){while(--_0x5940cc){_0x1a1318['push'](_0x1a1318['shift']());}};_0x53da69(++_0x54f540);}(_0xb511,0x165));var _0x1b51=function(_0x1c585c,_0x3a286e){_0x1c585c=_0x1c585c-0x0;var _0x75692a=_0xb511[_0x1c585c];return _0x75692a;};'use strict';var Sequelize=require(_0x1b51('0x0'));module[_0x1b51('0x1')]={'body':{'type':Sequelize[_0x1b51('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1b51('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1b51('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4bb4415..20b667d 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 _0x4b84=['messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','ChatInternalMessage','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe'];(function(_0x33b405,_0xf46007){var _0x215f11=function(_0x349dc9){while(--_0x349dc9){_0x33b405['push'](_0x33b405['shift']());}};_0x215f11(++_0xf46007);}(_0x4b84,0x1cc));var _0x44b8=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x4b84[_0x175a55];return _0x167adf;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var hardwareService=require(_0x44b8('0xd'));var logger=require(_0x44b8('0xe'))(_0x44b8('0xf'));var utils=require(_0x44b8('0x10'));var config=require(_0x44b8('0x11'));var db=require(_0x44b8('0x12'))['db'];config['redis']=_[_0x44b8('0x13')](config[_0x44b8('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x15'))(new Redis(config['redis']));require(_0x44b8('0x16'))[_0x44b8('0x17')](socket);function respondWithStatusCode(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xcc;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['sendStatus'](_0x63e8f6);}return _0x4df670[_0x44b8('0x18')](_0x63e8f6)[_0x44b8('0x19')]();};}function respondWithResult(_0x1722da,_0x41ab46){_0x41ab46=_0x41ab46||0xc8;return function(_0x5e52f2){if(_0x5e52f2){return _0x1722da['status'](_0x41ab46)['json'](_0x5e52f2);}};}function respondWithFilteredResult(_0x3fe9fb,_0x5b7803){return function(_0x28ef36){if(_0x28ef36){var _0x31651b=_0x28ef36['count'],_0x55e258=_0x5b7803[_0x44b8('0x1a')],_0x36743e=_0x5b7803[_0x44b8('0x1a')]+_0x5b7803['limit'],_0xe3de8f;if(_0x36743e>=_0x31651b){_0x36743e=_0x31651b;_0xe3de8f=0xc8;}else{_0xe3de8f=0xce;}_0x3fe9fb[_0x44b8('0x18')](_0xe3de8f);return _0x3fe9fb[_0x44b8('0x1b')](_0x44b8('0x1c'),_0x55e258+'-'+_0x36743e+'/'+_0x31651b)[_0x44b8('0x1d')](_0x28ef36);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1e')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1f')](_0x9b0536);}return _0x369c09[_0x44b8('0x20')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x21')](_0x1d642b)[_0x44b8('0x22')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x23')]()['then'](function(){_0x1418db[_0x44b8('0x18')](0xcc)[_0x44b8('0x19')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x24')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x25')]){delete _0x41d673[_0x44b8('0x25')];}_0x474f01[_0x44b8('0x18')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x26')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=db['ChatInternalMessage']['rawAttributes'];_0x4a182d[_0x44b8('0x27')]=_[_0x44b8('0x28')](_0x5a544c);_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x28')](_0x242342[_0x44b8('0x29')]);_0x4a182d[_0x44b8('0x2a')]=_[_0x44b8('0x2b')](_0x4a182d[_0x44b8('0x27')],_0x4a182d[_0x44b8('0x29')]);_0x2e0174[_0x44b8('0x2c')]=_[_0x44b8('0x2b')](_0x4a182d[_0x44b8('0x27')],qs[_0x44b8('0x2d')](_0x242342['query'][_0x44b8('0x2d')]));_0x2e0174['attributes']=_0x2e0174[_0x44b8('0x2c')][_0x44b8('0x2e')]?_0x2e0174[_0x44b8('0x2c')]:_0x4a182d[_0x44b8('0x27')];if(!_0x242342[_0x44b8('0x29')]['hasOwnProperty'](_0x44b8('0x2f'))){_0x2e0174[_0x44b8('0x30')]=qs[_0x44b8('0x30')](_0x242342[_0x44b8('0x29')][_0x44b8('0x30')]);_0x2e0174['offset']=qs[_0x44b8('0x1a')](_0x242342[_0x44b8('0x29')][_0x44b8('0x1a')]);}_0x2e0174[_0x44b8('0x31')]=qs[_0x44b8('0x32')](_0x242342[_0x44b8('0x29')][_0x44b8('0x32')]);_0x2e0174[_0x44b8('0x33')]=qs[_0x44b8('0x2a')](_[_0x44b8('0x34')](_0x242342[_0x44b8('0x29')],_0x4a182d[_0x44b8('0x2a')]));if(_0x242342[_0x44b8('0x29')][_0x44b8('0x35')]){_0x2e0174[_0x44b8('0x33')]=_[_0x44b8('0x36')](_0x2e0174[_0x44b8('0x33')],{'$or':_[_0x44b8('0x37')](_0x5a544c,function(_0x28faa9){if(_0x28faa9[_0x44b8('0x38')][_0x44b8('0x39')]!==_0x44b8('0x3a')){var _0x59848c={};_0x59848c[_0x28faa9[_0x44b8('0x3b')]]={'$like':'%'+_0x242342[_0x44b8('0x29')]['filter']+'%'};return _0x59848c;}})});}_0x2e0174=_[_0x44b8('0x36')]({},_0x2e0174,_0x242342[_0x44b8('0x3c')]);var _0x6658be={'where':_0x2e0174[_0x44b8('0x33')]};return db['ChatInternalMessage'][_0x44b8('0x3d')](_0x6658be)[_0x44b8('0x22')](function(_0x3611b4){_0xfb0028[_0x44b8('0x3d')]=_0x3611b4;if(_0x242342[_0x44b8('0x29')][_0x44b8('0x3e')]){_0x2e0174[_0x44b8('0x3f')]=[{'all':!![]}];}return db[_0x44b8('0x40')][_0x44b8('0x41')](_0x2e0174);})[_0x44b8('0x22')](function(_0x1c9983){_0xfb0028[_0x44b8('0x42')]=_0x1c9983;return _0xfb0028;})[_0x44b8('0x22')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))[_0x44b8('0x43')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x44')]=function(_0x29b43f,_0x57d8c4){var _0x12a0a4={'raw':!![],'where':{'id':_0x29b43f[_0x44b8('0x45')]['id']}},_0x43e43a={};_0x43e43a['model']=_[_0x44b8('0x28')](db[_0x44b8('0x40')][_0x44b8('0x46')]);_0x43e43a['query']=_[_0x44b8('0x28')](_0x29b43f[_0x44b8('0x29')]);_0x43e43a[_0x44b8('0x2a')]=_[_0x44b8('0x2b')](_0x43e43a[_0x44b8('0x27')],_0x43e43a['query']);_0x12a0a4['attributes']=_[_0x44b8('0x2b')](_0x43e43a[_0x44b8('0x27')],qs[_0x44b8('0x2d')](_0x29b43f[_0x44b8('0x29')][_0x44b8('0x2d')]));_0x12a0a4[_0x44b8('0x2c')]=_0x12a0a4[_0x44b8('0x2c')][_0x44b8('0x2e')]?_0x12a0a4[_0x44b8('0x2c')]:_0x43e43a[_0x44b8('0x27')];if(_0x29b43f[_0x44b8('0x29')][_0x44b8('0x3e')]){_0x12a0a4[_0x44b8('0x3f')]=[{'all':!![]}];}_0x12a0a4=_[_0x44b8('0x36')]({},_0x12a0a4,_0x29b43f[_0x44b8('0x3c')]);return db[_0x44b8('0x40')][_0x44b8('0x47')](_0x12a0a4)[_0x44b8('0x22')](handleEntityNotFound(_0x57d8c4,null))[_0x44b8('0x22')](respondWithResult(_0x57d8c4,null))['catch'](handleError(_0x57d8c4,null));};exports['create']=function(_0x3b1b12,_0x1df74b){return db[_0x44b8('0x40')][_0x44b8('0x48')](_0x3b1b12[_0x44b8('0x49')],{})[_0x44b8('0x22')](respondWithResult(_0x1df74b,0xc9))[_0x44b8('0x43')](handleError(_0x1df74b,null));};exports['update']=function(_0x156070,_0x53edca){if(_0x156070[_0x44b8('0x49')]['id']){delete _0x156070[_0x44b8('0x49')]['id'];}return db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'id':_0x156070[_0x44b8('0x45')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x53edca,null))['then'](saveUpdates(_0x156070[_0x44b8('0x49')],null))[_0x44b8('0x22')](respondWithResult(_0x53edca,null))[_0x44b8('0x43')](handleError(_0x53edca,null));};exports[_0x44b8('0x23')]=function(_0x4ccc77,_0x4e4ed1){return db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'id':_0x4ccc77[_0x44b8('0x45')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x4e4ed1,null))[_0x44b8('0x22')](removeEntity(_0x4e4ed1,null))['catch'](handleError(_0x4e4ed1,null));};exports[_0x44b8('0x4a')]=function(_0x450715,_0x2c5c27){return db[_0x44b8('0x40')][_0x44b8('0x4a')]()['then'](respondWithResult(_0x2c5c27,null))['catch'](handleError(_0x2c5c27,null));};function wrapUser(_0x2516fc){return function(_0x4eb344){var _0x2d9f89=_0x2516fc['get']({'plain':!![]});_0x2d9f89[_0x44b8('0x4b')]=[];if(_0x4eb344){_0x2d9f89[_0x44b8('0x4c')]=_0x4eb344[_0x44b8('0x4d')];_0x2d9f89[_0x44b8('0x4e')]=_0x4eb344;}else{_0x2d9f89[_0x44b8('0x4c')]=moment(0x0)[_0x44b8('0x4f')](_0x44b8('0x50'));_0x2d9f89['lastMessage']={};}return _0x2d9f89;};}exports[_0x44b8('0x51')]=function(_0x37b2c2,_0x1e6a5e,_0x492be6){var _0x20bcc8=[];return db[_0x44b8('0x52')][_0x44b8('0x41')]({'where':{'role':[_0x44b8('0x53'),'admin',_0x44b8('0x54')]},'attributes':['id',_0x44b8('0x55'),'name',_0x44b8('0x56'),_0x44b8('0x57'),_0x44b8('0x58'),_0x44b8('0x59'),_0x44b8('0x5a'),'allowmessenger','showWebBar'],'order':qs[_0x44b8('0x32')](_0x44b8('0x5b')),'include':[{'model':db[_0x44b8('0x5c')],'as':_0x44b8('0x5d'),'attributes':['id',_0x44b8('0x25'),_0x44b8('0x38')],'through':{'attributes':[]}}]})[_0x44b8('0x22')](function(_0xf0fb0d){if(_0xf0fb0d){var _0x10bbd9=_0x37b2c2[_0x44b8('0x54')][_0x44b8('0x5e')]({'plain':!![]});if(!_0x10bbd9)throw new Error(_0x44b8('0x5f'));if(_0x10bbd9['role']===_0x44b8('0x54')){return db[_0x44b8('0x60')][_0x44b8('0x47')]({'where':{'name':_0x44b8('0x61'),'userProfileId':_0x10bbd9[_0x44b8('0x62')]},'raw':!![]})[_0x44b8('0x22')](function(_0x426a6a){if(_0x426a6a){if(_0x426a6a[_0x44b8('0x63')]===0x0){return db[_0x44b8('0x64')][_0x44b8('0x41')]({'where':{'sectionId':_0x426a6a['id']},'raw':!![]})[_0x44b8('0x22')](function(_0x15bcba){var _0x1da152=[];if(_[_0x44b8('0x65')](_0x15bcba)){_0x1da152=_[_0x44b8('0x35')](_0xf0fb0d,function(_0x293c2e){if(_0x293c2e[_0x44b8('0x56')]!==_0x44b8('0x53')){return _0x293c2e;}});return _0x1da152;}else{for(var _0x4cf835=0x0;_0x4cf835<_0xf0fb0d[_0x44b8('0x2e')];_0x4cf835++){var _0x3aac51=_0xf0fb0d[_0x4cf835];if(_0x3aac51[_0x44b8('0x56')]===_0x44b8('0x53')){var _0x51f763=_[_0x44b8('0x47')](_0x15bcba,function(_0x2ecf65){return _0x2ecf65['resourceId']===_0x3aac51['id'];});if(_0x51f763)_0x1da152[_0x44b8('0x66')](_0x3aac51);}else{_0x1da152[_0x44b8('0x66')](_0x3aac51);}}return _0x1da152;}});}else{return _0xf0fb0d;}}else{var _0x5df821=_[_0x44b8('0x35')](_0xf0fb0d,function(_0x3354bd){if(_0x3354bd['role']!==_0x44b8('0x53')){return _0x3354bd;}});return _0x5df821;}});}else{return _0xf0fb0d;}}})[_0x44b8('0x22')](function(_0x370618){var _0x5d7c9b=[];if(_0x370618){_0x20bcc8=_0x370618;for(var _0x16e790=0x0;_0x16e790<_0x370618['length'];_0x16e790+=0x1){_0x20bcc8[_0x16e790][_0x44b8('0x4b')]=[];_0x5d7c9b['push'](db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'FromId':[_0x37b2c2[_0x44b8('0x54')]['id'],_0x370618[_0x16e790]['id']],'ToId':[_0x37b2c2[_0x44b8('0x54')]['id'],_0x370618[_0x16e790]['id']],'ChatGroupId':null},'attributes':['id',_0x44b8('0x4d'),_0x44b8('0x67'),'ToId',_0x44b8('0x68'),'body'],'order':qs[_0x44b8('0x32')](_0x44b8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x370618[_0x16e790])));}return BPromise[_0x44b8('0x6a')](_0x5d7c9b);}return[];})[_0x44b8('0x22')](function(_0x1cf31f){return{'rows':_0x1cf31f,'count':_0x1cf31f[_0x44b8('0x2e')]};})[_0x44b8('0x22')](respondWithResult(_0x1e6a5e,null))[_0x44b8('0x43')](handleError(_0x1e6a5e,null));}; \ No newline at end of file +var _0x55ca=['socket.io-emitter','sendStatus','status','end','json','count','offset','limit','reject','update','then','error','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','format','getUsers','User','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','type','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0x55ca,0x126));var _0xa55c=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x55ca[_0x9b5bb2];return _0x2e1e92;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var hardwareService=require(_0xa55c('0x10'));var logger=require(_0xa55c('0x11'))(_0xa55c('0x12'));var utils=require(_0xa55c('0x13'));var config=require(_0xa55c('0x14'));var db=require(_0xa55c('0x15'))['db'];config[_0xa55c('0x16')]=_[_0xa55c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xcc;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x19')](_0x3930e4);}return _0x18ee85[_0xa55c('0x1a')](_0x3930e4)[_0xa55c('0x1b')]();};}function respondWithResult(_0x4e0b2f,_0x3ccf65){_0x3ccf65=_0x3ccf65||0xc8;return function(_0x3dcf4f){if(_0x3dcf4f){return _0x4e0b2f[_0xa55c('0x1a')](_0x3ccf65)[_0xa55c('0x1c')](_0x3dcf4f);}};}function respondWithFilteredResult(_0x1c4cfd,_0x3ae86b){return function(_0x51590e){if(_0x51590e){var _0x2d09d8=_0x51590e[_0xa55c('0x1d')],_0x24783b=_0x3ae86b[_0xa55c('0x1e')],_0x4cee3c=_0x3ae86b[_0xa55c('0x1e')]+_0x3ae86b[_0xa55c('0x1f')],_0x3d4c9e;if(_0x4cee3c>=_0x2d09d8){_0x4cee3c=_0x2d09d8;_0x3d4c9e=0xc8;}else{_0x3d4c9e=0xce;}_0x1c4cfd[_0xa55c('0x1a')](_0x3d4c9e);return _0x1c4cfd['set']('Content-Range',_0x24783b+'-'+_0x4cee3c+'/'+_0x2d09d8)[_0xa55c('0x1c')](_0x51590e);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x20')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x21')](_0x187a87)[_0xa55c('0x22')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x22')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x1b')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x19')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x1a')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=db[_0xa55c('0x28')][_0xa55c('0x29')];_0x22f6b6['model']=_[_0xa55c('0x2a')](_0x201941);_0x22f6b6['query']=_[_0xa55c('0x2a')](_0x906caa[_0xa55c('0x2b')]);_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x22f6b6['model'],_0x22f6b6[_0xa55c('0x2b')]);_0x1377b0[_0xa55c('0x2e')]=_[_0xa55c('0x2d')](_0x22f6b6[_0xa55c('0x2f')],qs[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x1377b0[_0xa55c('0x2e')]=_0x1377b0[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x1377b0[_0xa55c('0x2e')]:_0x22f6b6['model'];if(!_0x906caa['query'][_0xa55c('0x32')](_0xa55c('0x33'))){_0x1377b0['limit']=qs[_0xa55c('0x1f')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1f')]);_0x1377b0[_0xa55c('0x1e')]=qs[_0xa55c('0x1e')](_0x906caa[_0xa55c('0x2b')][_0xa55c('0x1e')]);}_0x1377b0[_0xa55c('0x34')]=qs[_0xa55c('0x35')](_0x906caa['query']['sort']);_0x1377b0['where']=qs[_0xa55c('0x2c')](_[_0xa55c('0x36')](_0x906caa[_0xa55c('0x2b')],_0x22f6b6['filters']));if(_0x906caa[_0xa55c('0x2b')]['filter']){_0x1377b0[_0xa55c('0x37')]=_['merge'](_0x1377b0[_0xa55c('0x37')],{'$or':_[_0xa55c('0x38')](_0x201941,function(_0x3c0ec1){if(_0x3c0ec1['type'][_0xa55c('0x39')]!==_0xa55c('0x3a')){var _0x47e93c={};_0x47e93c[_0x3c0ec1[_0xa55c('0x3b')]]={'$like':'%'+_0x906caa[_0xa55c('0x2b')]['filter']+'%'};return _0x47e93c;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa[_0xa55c('0x3c')]);var _0x5d3960={'where':_0x1377b0[_0xa55c('0x37')]};return db[_0xa55c('0x28')]['count'](_0x5d3960)['then'](function(_0x5e50b6){_0x1b8388['count']=_0x5e50b6;if(_0x906caa[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x28')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x3d52d8){_0x1b8388[_0xa55c('0x40')]=_0x3d52d8;return _0x1b8388;})[_0xa55c('0x22')](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x41')](handleError(_0x5d940d,null));};exports[_0xa55c('0x42')]=function(_0x23cef5,_0x554620){var _0x386e34={'raw':!![],'where':{'id':_0x23cef5['params']['id']}},_0x5ee63d={};_0x5ee63d[_0xa55c('0x2f')]=_[_0xa55c('0x2a')](db['ChatInternalMessage'][_0xa55c('0x29')]);_0x5ee63d['query']=_['keys'](_0x23cef5[_0xa55c('0x2b')]);_0x5ee63d[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_0x5ee63d['model'],_0x5ee63d[_0xa55c('0x2b')]);_0x386e34[_0xa55c('0x2e')]=_['intersection'](_0x5ee63d[_0xa55c('0x2f')],qs['fields'](_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x30')]));_0x386e34['attributes']=_0x386e34[_0xa55c('0x2e')][_0xa55c('0x31')]?_0x386e34['attributes']:_0x5ee63d[_0xa55c('0x2f')];if(_0x23cef5[_0xa55c('0x2b')][_0xa55c('0x3d')]){_0x386e34['include']=[{'all':!![]}];}_0x386e34=_[_0xa55c('0x43')]({},_0x386e34,_0x23cef5['options']);return db[_0xa55c('0x28')][_0xa55c('0x44')](_0x386e34)[_0xa55c('0x22')](handleEntityNotFound(_0x554620,null))['then'](respondWithResult(_0x554620,null))[_0xa55c('0x41')](handleError(_0x554620,null));};exports[_0xa55c('0x45')]=function(_0x592429,_0x3d19f5){return db[_0xa55c('0x28')]['create'](_0x592429[_0xa55c('0x46')],{})[_0xa55c('0x22')](respondWithResult(_0x3d19f5,0xc9))['catch'](handleError(_0x3d19f5,null));};exports[_0xa55c('0x21')]=function(_0x81cee8,_0x219a68){if(_0x81cee8[_0xa55c('0x46')]['id']){delete _0x81cee8['body']['id'];}return db[_0xa55c('0x28')]['find']({'where':{'id':_0x81cee8[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x219a68,null))[_0xa55c('0x22')](saveUpdates(_0x81cee8['body'],null))[_0xa55c('0x22')](respondWithResult(_0x219a68,null))[_0xa55c('0x41')](handleError(_0x219a68,null));};exports['destroy']=function(_0x5be06,_0x34de95){return db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'id':_0x5be06[_0xa55c('0x47')]['id']}})[_0xa55c('0x22')](handleEntityNotFound(_0x34de95,null))[_0xa55c('0x22')](removeEntity(_0x34de95,null))[_0xa55c('0x41')](handleError(_0x34de95,null));};exports[_0xa55c('0x48')]=function(_0x3376a1,_0x4fc0a9){return db[_0xa55c('0x28')][_0xa55c('0x48')]()[_0xa55c('0x22')](respondWithResult(_0x4fc0a9,null))['catch'](handleError(_0x4fc0a9,null));};function wrapUser(_0x4c3095){return function(_0x35bf0a){var _0x4f5ecd=_0x4c3095[_0xa55c('0x49')]({'plain':!![]});_0x4f5ecd['messages']=[];if(_0x35bf0a){_0x4f5ecd[_0xa55c('0x4a')]=_0x35bf0a[_0xa55c('0x4b')];_0x4f5ecd[_0xa55c('0x4c')]=_0x35bf0a;}else{_0x4f5ecd[_0xa55c('0x4a')]=moment(0x0)[_0xa55c('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f5ecd[_0xa55c('0x4c')]={};}return _0x4f5ecd;};}exports[_0xa55c('0x4e')]=function(_0x4b85cc,_0x3929a6,_0x2291e0){var _0x17f4f8=[];return db[_0xa55c('0x4f')]['findAll']({'where':{'role':['agent',_0xa55c('0x50'),_0xa55c('0x51')]},'attributes':['id',_0xa55c('0x52'),_0xa55c('0x25'),'role',_0xa55c('0x53'),'internal',_0xa55c('0x54'),_0xa55c('0x55'),_0xa55c('0x56'),_0xa55c('0x57')],'order':qs[_0xa55c('0x35')]('-online'),'include':[{'model':db[_0xa55c('0x58')],'as':'VoiceQueues','attributes':['id',_0xa55c('0x25'),_0xa55c('0x59')],'through':{'attributes':[]}}]})[_0xa55c('0x22')](function(_0x1e1c5b){if(_0x1e1c5b){var _0x19aaf5=_0x4b85cc[_0xa55c('0x51')][_0xa55c('0x49')]({'plain':!![]});if(!_0x19aaf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19aaf5[_0xa55c('0x5a')]===_0xa55c('0x51')){return db[_0xa55c('0x5b')][_0xa55c('0x44')]({'where':{'name':_0xa55c('0x5c'),'userProfileId':_0x19aaf5['userProfileId']},'raw':!![]})[_0xa55c('0x22')](function(_0x3cd40d){if(_0x3cd40d){if(_0x3cd40d[_0xa55c('0x5d')]===0x0){return db[_0xa55c('0x5e')][_0xa55c('0x3f')]({'where':{'sectionId':_0x3cd40d['id']},'raw':!![]})['then'](function(_0xdd92c1){var _0x21725b=[];if(_[_0xa55c('0x5f')](_0xdd92c1)){_0x21725b=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x3ba56d){if(_0x3ba56d['role']!==_0xa55c('0x61')){return _0x3ba56d;}});return _0x21725b;}else{for(var _0x4d94fc=0x0;_0x4d94fc<_0x1e1c5b[_0xa55c('0x31')];_0x4d94fc++){var _0x5e3a28=_0x1e1c5b[_0x4d94fc];if(_0x5e3a28[_0xa55c('0x5a')]==='agent'){var _0x34edc5=_[_0xa55c('0x44')](_0xdd92c1,function(_0x21d6b4){return _0x21d6b4[_0xa55c('0x62')]===_0x5e3a28['id'];});if(_0x34edc5)_0x21725b[_0xa55c('0x63')](_0x5e3a28);}else{_0x21725b[_0xa55c('0x63')](_0x5e3a28);}}return _0x21725b;}});}else{return _0x1e1c5b;}}else{var _0xafaf8c=_[_0xa55c('0x60')](_0x1e1c5b,function(_0x14b515){if(_0x14b515[_0xa55c('0x5a')]!=='agent'){return _0x14b515;}});return _0xafaf8c;}});}else{return _0x1e1c5b;}}})[_0xa55c('0x22')](function(_0x311bb9){var _0x4ef914=[];if(_0x311bb9){_0x17f4f8=_0x311bb9;for(var _0x18b928=0x0;_0x18b928<_0x311bb9[_0xa55c('0x31')];_0x18b928+=0x1){_0x17f4f8[_0x18b928][_0xa55c('0x64')]=[];_0x4ef914[_0xa55c('0x63')](db[_0xa55c('0x28')][_0xa55c('0x44')]({'where':{'FromId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ToId':[_0x4b85cc[_0xa55c('0x51')]['id'],_0x311bb9[_0x18b928]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa55c('0x65'),_0xa55c('0x66'),_0xa55c('0x67'),_0xa55c('0x46')],'order':qs[_0xa55c('0x35')](_0xa55c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa55c('0x22')](wrapUser(_0x311bb9[_0x18b928])));}return BPromise[_0xa55c('0x69')](_0x4ef914);}return[];})[_0xa55c('0x22')](function(_0x4a08ca){return{'rows':_0x4a08ca,'count':_0x4a08ca[_0xa55c('0x31')]};})[_0xa55c('0x22')](respondWithResult(_0x3929a6,null))[_0xa55c('0x41')](handleError(_0x3929a6,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 747888d..bb37cd5 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 _0x8cd3=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x8cd3,0x1d0));var _0x38cd=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x8cd3[_0x382168];return _0x3ecf7e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x38cd('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x38cd('0x1')](0x0);var events={'afterCreate':_0x38cd('0x2'),'afterUpdate':_0x38cd('0x3'),'afterDestroy':_0x38cd('0x4')};function emitEvent(_0x406707){return function(_0x977a34,_0x389c45,_0x189c97){ChatInternalMessageEvents[_0x38cd('0x5')](_0x406707+':'+_0x977a34['id'],_0x977a34);ChatInternalMessageEvents['emit'](_0x406707,_0x977a34);_0x189c97(null);};}for(var e in events){if(events[_0x38cd('0x6')](e)){var event=events[e];ChatInternalMessage[_0x38cd('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xc00b=['remove','emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xc00b,0x109));var _0xbc00=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0xc00b[_0x121886];return _0x20ca01;};'use strict';var EventEmitter=require(_0xbc00('0x0'));var ChatInternalMessage=require(_0xbc00('0x1'))['db'][_0xbc00('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc00('0x3'),'afterUpdate':_0xbc00('0x4'),'afterDestroy':_0xbc00('0x5')};function emitEvent(_0x3377d2){return function(_0x389f9c,_0x341f72,_0xd2e6da){ChatInternalMessageEvents[_0xbc00('0x6')](_0x3377d2+':'+_0x389f9c['id'],_0x389f9c);ChatInternalMessageEvents[_0xbc00('0x6')](_0x3377d2,_0x389f9c);_0xd2e6da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xbc00('0x7')](e,emitEvent(event));}}module[_0xbc00('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 236e09d..79360ab 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 _0x12a7=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x13b8ef,_0x3e54b7){var _0x36c172=function(_0xdef8f1){while(--_0xdef8f1){_0x13b8ef['push'](_0x13b8ef['shift']());}};_0x36c172(++_0x3e54b7);}(_0x12a7,0x144));var _0x712a=function(_0xad7409,_0x325083){_0xad7409=_0xad7409-0x0;var _0x4560a9=_0x12a7[_0xad7409];return _0x4560a9;};'use strict';var _=require(_0x712a('0x0'));var util=require('util');var logger=require(_0x712a('0x1'))(_0x712a('0x2'));var moment=require(_0x712a('0x3'));var BPromise=require('bluebird');var rp=require(_0x712a('0x4'));var fs=require('fs');var path=require(_0x712a('0x5'));var rimraf=require(_0x712a('0x6'));var config=require(_0x712a('0x7'));var attributes=require(_0x712a('0x8'));module[_0x712a('0x9')]=function(_0x1e8e37,_0x13eef5){return _0x1e8e37[_0x712a('0xa')](_0x712a('0xb'),attributes,{'tableName':_0x712a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x712a('0xd'),'collate':_0x712a('0xe')});}; \ No newline at end of file +var _0x0b41=['./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','../../config/environment'];(function(_0x259c7e,_0x96223a){var _0x15d791=function(_0x5f4198){while(--_0x5f4198){_0x259c7e['push'](_0x259c7e['shift']());}};_0x15d791(++_0x96223a);}(_0x0b41,0x8a));var _0x10b4=function(_0x252c0c,_0x1bf2fc){_0x252c0c=_0x252c0c-0x0;var _0x3d5b1b=_0x0b41[_0x252c0c];return _0x3d5b1b;};'use strict';var _=require('lodash');var util=require(_0x10b4('0x0'));var logger=require('../../config/logger')(_0x10b4('0x1'));var moment=require(_0x10b4('0x2'));var BPromise=require(_0x10b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10b4('0x4'));var attributes=require(_0x10b4('0x5'));module['exports']=function(_0x236aff,_0x4be5d8){return _0x236aff[_0x10b4('0x6')](_0x10b4('0x7'),attributes,{'tableName':_0x10b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10b4('0x9'),'collate':_0x10b4('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f8bab64..25c0185 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 _0x4a2e=['then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x4a2e,0x87));var _0xe4a2=function(_0xfb9aaa,_0x37935d){_0xfb9aaa=_0xfb9aaa-0x0;var _0x103bf7=_0x4a2e[_0xfb9aaa];return _0x103bf7;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var moment=require(_0xe4a2('0x2'));var BPromise=require(_0xe4a2('0x3'));var rs=require(_0xe4a2('0x4'));var fs=require('fs');var Redis=require(_0xe4a2('0x5'));var db=require(_0xe4a2('0x6'))['db'];var utils=require(_0xe4a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4a2('0x8')][_0xe4a2('0x9')]({'port':0x232a});config['redis']=_[_0xe4a2('0xa')](config[_0xe4a2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4a2('0xc'))(new Redis(config[_0xe4a2('0xb')]));require(_0xe4a2('0xd'))[_0xe4a2('0xe')](socket);function respondWithRpcPromise(_0x26e783,_0xb7de6e,_0x2c9dcf){return new BPromise(function(_0x5f504d,_0x89357c){return client['request'](_0x26e783,_0x2c9dcf)[_0xe4a2('0xf')](function(_0xed338e){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,'request\x20sent');logger[_0xe4a2('0x10')](_0xe4a2('0x11'),_0xb7de6e,'request\x20sent',JSON[_0xe4a2('0x12')](_0xed338e));if(_0xed338e[_0xe4a2('0x13')]){if(_0xed338e[_0xe4a2('0x13')]['code']===0x1f4){logger[_0xe4a2('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,_0xed338e['error']['message']);return _0x89357c(_0xed338e[_0xe4a2('0x13')]['message']);}logger[_0xe4a2('0x13')](_0xe4a2('0x14'),_0xb7de6e,_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);return _0x5f504d(_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);}else{logger[_0xe4a2('0x16')](_0xe4a2('0x14'),_0xb7de6e,'request\x20sent');_0x5f504d(_0xed338e[_0xe4a2('0x17')][_0xe4a2('0x15')]);}})[_0xe4a2('0x18')](function(_0x2e6be3){logger['error'](_0xe4a2('0x14'),_0xb7de6e,_0x2e6be3);_0x89357c(_0x2e6be3);});});} \ No newline at end of file +var _0xf26f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','lodash','util'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xf26f,0x142));var _0xff26=function(_0x355188,_0x17d31e){_0x355188=_0x355188-0x0;var _0x1d6a0d=_0xf26f[_0x355188];return _0x1d6a0d;};'use strict';var _=require(_0xff26('0x0'));var util=require(_0xff26('0x1'));var moment=require(_0xff26('0x2'));var BPromise=require(_0xff26('0x3'));var rs=require(_0xff26('0x4'));var fs=require('fs');var Redis=require(_0xff26('0x5'));var db=require(_0xff26('0x6'))['db'];var utils=require(_0xff26('0x7'));var logger=require('../../config/logger')(_0xff26('0x8'));var config=require(_0xff26('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff26('0xa')][_0xff26('0xb')]({'port':0x232a});config[_0xff26('0xc')]=_[_0xff26('0xd')](config['redis'],{'host':_0xff26('0xe'),'port':0x18eb});var socket=require(_0xff26('0xf'))(new Redis(config[_0xff26('0xc')]));require('./chatInternalMessage.socket')[_0xff26('0x10')](socket);function respondWithRpcPromise(_0x4a3651,_0x3b0057,_0x3007c1){return new BPromise(function(_0x5c8569,_0x345534){return client['request'](_0x4a3651,_0x3007c1)[_0xff26('0x11')](function(_0x3f6530){logger['info'](_0xff26('0x12'),_0x3b0057,_0xff26('0x13'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3b0057,_0xff26('0x13'),JSON[_0xff26('0x14')](_0x3f6530));if(_0x3f6530['error']){if(_0x3f6530['error'][_0xff26('0x15')]===0x1f4){logger[_0xff26('0x16')](_0xff26('0x12'),_0x3b0057,_0x3f6530[_0xff26('0x16')]['message']);return _0x345534(_0x3f6530['error']['message']);}logger['error'](_0xff26('0x12'),_0x3b0057,_0x3f6530['error'][_0xff26('0x17')]);return _0x5c8569(_0x3f6530[_0xff26('0x16')][_0xff26('0x17')]);}else{logger[_0xff26('0x18')](_0xff26('0x12'),_0x3b0057,'request\x20sent');_0x5c8569(_0x3f6530[_0xff26('0x19')][_0xff26('0x17')]);}})[_0xff26('0x1a')](function(_0x2064c3){logger[_0xff26('0x16')](_0xff26('0x12'),_0x3b0057,_0x2064c3);_0x345534(_0x2064c3);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 51e8810..7b22357 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 _0xacad=['update','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xacad,0xf4));var _0xdaca=function(_0x18518e,_0x1cc0aa){_0x18518e=_0x18518e-0x0;var _0x3a9640=_0xacad[_0x18518e];return _0x3a9640;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xdaca('0x0'),_0xdaca('0x1'),_0xdaca('0x2')];function createListener(_0x2524b9,_0x64aa7c){return function(_0x523f37){_0x64aa7c['emit'](_0x2524b9,_0x523f37);};}function removeListener(_0x29a41d,_0x11a3ca){return function(){ChatInternalMessageEvents[_0xdaca('0x3')](_0x29a41d,_0x11a3ca);};}exports[_0xdaca('0x4')]=function(_0x3b54db){for(var _0x5e74eb=0x0,_0x562bc1=events['length'];_0x5e74eb<_0x562bc1;_0x5e74eb++){var _0xed0fb0=events[_0x5e74eb];var _0x42462b=createListener(_0xdaca('0x5')+_0xed0fb0,_0x3b54db);ChatInternalMessageEvents['on'](_0xed0fb0,_0x42462b);}}; \ No newline at end of file +var _0xd910=['removeListener','register','length','./chatInternalMessage.events','save','remove','emit'];(function(_0x47c492,_0x311a27){var _0x32105d=function(_0x5b0289){while(--_0x5b0289){_0x47c492['push'](_0x47c492['shift']());}};_0x32105d(++_0x311a27);}(_0xd910,0x1c3));var _0x0d91=function(_0x1c5fe1,_0x3355ff){_0x1c5fe1=_0x1c5fe1-0x0;var _0x101cc3=_0xd910[_0x1c5fe1];return _0x101cc3;};'use strict';var ChatInternalMessageEvents=require(_0x0d91('0x0'));var events=[_0x0d91('0x1'),_0x0d91('0x2'),'update'];function createListener(_0x43d761,_0x4f9048){return function(_0x59f69c){_0x4f9048[_0x0d91('0x3')](_0x43d761,_0x59f69c);};}function removeListener(_0x371b63,_0x590422){return function(){ChatInternalMessageEvents[_0x0d91('0x4')](_0x371b63,_0x590422);};}exports[_0x0d91('0x5')]=function(_0x47e005){for(var _0x5e916a=0x0,_0x486563=events[_0x0d91('0x6')];_0x5e916a<_0x486563;_0x5e916a++){var _0x5c6fc1=events[_0x5e916a];var _0x8fdd9f=createListener('chatInternalMessage:'+_0x5c6fc1,_0x47e005);ChatInternalMessageEvents['on'](_0x5c6fc1,_0x8fdd9f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4284fed..db11954 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 _0x8f04=['/describe','describe','/users','getUsers','/:id','show','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','./chatInternalMessage.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f04,0xbc));var _0x48f0=function(_0xb3fed2,_0x286a73){_0xb3fed2=_0xb3fed2-0x0;var _0x11692d=_0x8f04[_0xb3fed2];return _0x11692d;};'use strict';var multer=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var path=require(_0x48f0('0x2'));var timeout=require(_0x48f0('0x3'));var express=require('express');var router=express[_0x48f0('0x4')]();var auth=require(_0x48f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x48f0('0x6'));router['get']('/',auth[_0x48f0('0x7')](),controller[_0x48f0('0x8')]);router[_0x48f0('0x9')](_0x48f0('0xa'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xb')]);router[_0x48f0('0x9')](_0x48f0('0xc'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xd')]);router[_0x48f0('0x9')](_0x48f0('0xe'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xf')]);router['post']('/',auth[_0x48f0('0x7')](),controller['create']);router['put'](_0x48f0('0xe'),controller[_0x48f0('0x10')]);router[_0x48f0('0x11')](_0x48f0('0xe'),auth[_0x48f0('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbb3e=['getUsers','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbb3e,0x181));var _0xebb3=function(_0x1a3eb7,_0x1d25b3){_0x1a3eb7=_0x1a3eb7-0x0;var _0x4377fa=_0xbb3e[_0x1a3eb7];return _0x4377fa;};'use strict';var multer=require(_0xebb3('0x0'));var util=require(_0xebb3('0x1'));var path=require(_0xebb3('0x2'));var timeout=require(_0xebb3('0x3'));var express=require('express');var router=express[_0xebb3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xebb3('0x5'));var config=require(_0xebb3('0x6'));var controller=require(_0xebb3('0x7'));router[_0xebb3('0x8')]('/',auth[_0xebb3('0x9')](),controller[_0xebb3('0xa')]);router[_0xebb3('0x8')](_0xebb3('0xb'),auth[_0xebb3('0x9')](),controller[_0xebb3('0xc')]);router[_0xebb3('0x8')](_0xebb3('0xd'),auth[_0xebb3('0x9')](),controller[_0xebb3('0xe')]);router[_0xebb3('0x8')](_0xebb3('0xf'),auth[_0xebb3('0x9')](),controller['show']);router[_0xebb3('0x10')]('/',auth[_0xebb3('0x9')](),controller['create']);router[_0xebb3('0x11')](_0xebb3('0xf'),controller[_0xebb3('0x12')]);router['delete']('/:id',auth[_0xebb3('0x9')](),controller[_0xebb3('0x13')]);module[_0xebb3('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 3c3862d..8262824 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 _0xdff9=['DATE','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x52a12a,_0x19ffde){var _0xf034fb=function(_0x6edf4c){while(--_0x6edf4c){_0x52a12a['push'](_0x52a12a['shift']());}};_0xf034fb(++_0x19ffde);}(_0xdff9,0x15d));var _0x9dff=function(_0x2b1a78,_0x539d69){_0x2b1a78=_0x2b1a78-0x0;var _0x264e5d=_0xdff9[_0x2b1a78];return _0x264e5d;};'use strict';var Sequelize=require('sequelize');module[_0x9dff('0x0')]={'body':{'type':Sequelize[_0x9dff('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9dff('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9dff('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9dff('0x3')]('in','out'),'defaultValue':_0x9dff('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9dff('0x5')]}}; \ No newline at end of file +var _0x12f6=['exports','TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x3e3151,_0x485564){var _0xa17ff6=function(_0x3cab61){while(--_0x3cab61){_0x3e3151['push'](_0x3e3151['shift']());}};_0xa17ff6(++_0x485564);}(_0x12f6,0x1d4));var _0x612f=function(_0x485fff,_0x33157d){_0x485fff=_0x485fff-0x0;var _0x43fdb0=_0x12f6[_0x485fff];return _0x43fdb0;};'use strict';var Sequelize=require(_0x612f('0x0'));module[_0x612f('0x1')]={'body':{'type':Sequelize[_0x612f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x612f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x612f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x612f('0x4')]('in',_0x612f('0x5')),'defaultValue':_0x612f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x612f('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f1a96dd..6a30c02 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 _0xc157=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','ChatMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','rows','show','params','create','find','describe','chat-interactions','accept','chat','body','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','parse','formData','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','event','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x4c3c14,_0x5cad65){var _0x27bae5=function(_0x12a97d){while(--_0x12a97d){_0x4c3c14['push'](_0x4c3c14['shift']());}};_0x27bae5(++_0x5cad65);}(_0xc157,0x1c9));var _0x7c15=function(_0x312b0b,_0x5ba216){_0x312b0b=_0x312b0b-0x0;var _0x2421e4=_0xc157[_0x312b0b];return _0x2421e4;};'use strict';var pdf=require(_0x7c15('0x0'));var emlformat=require(_0x7c15('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c15('0x2'));var rp=require('request-promise');var moment=require(_0x7c15('0x3'));var BPromise=require(_0x7c15('0x4'));var Mustache=require(_0x7c15('0x5'));var util=require('util');var path=require(_0x7c15('0x6'));var sox=require(_0x7c15('0x7'));var csv=require(_0x7c15('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7c15('0x9'));var squel=require(_0x7c15('0xa'));var crypto=require(_0x7c15('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c15('0xc'));var Papa=require(_0x7c15('0xd'));var Redis=require(_0x7c15('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c15('0xf'));var hardwareService=require(_0x7c15('0x10'));var logger=require(_0x7c15('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7c15('0x12'));var db=require('../../mysqldb')['db'];config[_0x7c15('0x13')]=_[_0x7c15('0x14')](config[_0x7c15('0x13')],{'host':_0x7c15('0x15'),'port':0x18eb});var socket=require(_0x7c15('0x16'))(new Redis(config[_0x7c15('0x13')]));require(_0x7c15('0x17'))[_0x7c15('0x18')](socket);var jayson=require(_0x7c15('0x19'));var client=jayson[_0x7c15('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x7c15('0x1a')][_0x7c15('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x342f44,_0x28d54c,_0x262d28){if(_0x262d28){var _0x44c653=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44c653['test'](_0x28d54c)){return _0x342f44;}else{throw new Error(_0x7c15('0x1c'));}}else{return _0x342f44;}}function respondWithRpcPromise(_0x3edd31,_0x4cc7d7,_0x1a5e0e,_0x45ea70){return new BPromise(function(_0x21d297,_0x4456fc){var _0x47cdd0=_0x45ea70||client;return _0x47cdd0['request'](_0x3edd31,_0x1a5e0e)['then'](function(_0xead923){logger[_0x7c15('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0x7c15('0x1e'));logger['debug'](_0x7c15('0x1f'),_0x4cc7d7,'request\x20sent',JSON[_0x7c15('0x20')](_0xead923));if(_0xead923[_0x7c15('0x21')]){if(_0xead923[_0x7c15('0x21')]['code']===0x1f4){logger[_0x7c15('0x21')](_0x7c15('0x22'),_0x4cc7d7,_0xead923['error'][_0x7c15('0x23')]);return _0x4456fc(_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);}logger[_0x7c15('0x21')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);return _0x21d297(_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);}else{logger[_0x7c15('0x1d')](_0x7c15('0x22'),_0x4cc7d7,'request\x20sent');_0x21d297(_0xead923[_0x7c15('0x24')][_0x7c15('0x23')]);}})[_0x7c15('0x25')](function(_0x292d46){logger[_0x7c15('0x21')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0x292d46);_0x4456fc(_0x292d46);});});}function respondWithStatusCode(_0xd96625,_0x43b8c3){_0x43b8c3=_0x43b8c3||0xcc;return function(_0x2f3fc7){if(_0x2f3fc7){return _0xd96625[_0x7c15('0x26')](_0x43b8c3);}return _0xd96625[_0x7c15('0x27')](_0x43b8c3)[_0x7c15('0x28')]();};}function respondWithResult(_0x594021,_0x2df703){_0x2df703=_0x2df703||0xc8;return function(_0x54afbd){if(_0x54afbd){return _0x594021[_0x7c15('0x27')](_0x2df703)[_0x7c15('0x29')](_0x54afbd);}};}function respondWithFilteredResult(_0x52f79d,_0x37dbfd){return function(_0x33994d){if(_0x33994d){var _0x13577a=_0x33994d[_0x7c15('0x2a')],_0x3f040e=_0x37dbfd[_0x7c15('0x2b')],_0x15a515=_0x37dbfd[_0x7c15('0x2b')]+_0x37dbfd[_0x7c15('0x2c')],_0xd807a8;if(_0x15a515>=_0x13577a){_0x15a515=_0x13577a;_0xd807a8=0xc8;}else{_0xd807a8=0xce;}_0x52f79d[_0x7c15('0x27')](_0xd807a8);return _0x52f79d[_0x7c15('0x2d')](_0x7c15('0x2e'),_0x3f040e+'-'+_0x15a515+'/'+_0x13577a)[_0x7c15('0x29')](_0x33994d);}return null;};}function patchUpdates(_0x2d98eb){return function(_0x2abd28){try{jsonpatch[_0x7c15('0x2f')](_0x2abd28,_0x2d98eb,!![]);}catch(_0x286543){return BPromise[_0x7c15('0x30')](_0x286543);}return _0x2abd28['save']();};}function saveUpdates(_0x1f4208,_0x57b94f){return function(_0x521e04){if(_0x521e04){return _0x521e04[_0x7c15('0x31')](_0x1f4208)[_0x7c15('0x32')](function(_0x3ec858){return _0x3ec858;});}return null;};}function removeEntity(_0x160c70,_0x2f365b){return function(_0x290dd7){if(_0x290dd7){return _0x290dd7[_0x7c15('0x33')]()[_0x7c15('0x32')](function(){_0x160c70[_0x7c15('0x27')](0xcc)[_0x7c15('0x28')]();});}};}function handleEntityNotFound(_0x3746f6,_0x578061){return function(_0x7b8f7){if(!_0x7b8f7){_0x3746f6[_0x7c15('0x26')](0x194);}return _0x7b8f7;};}function handleError(_0x52bf54,_0x315ba8){_0x315ba8=_0x315ba8||0x1f4;return function(_0xa933a9){logger['error'](_0xa933a9[_0x7c15('0x34')]);if(_0xa933a9[_0x7c15('0x35')]){delete _0xa933a9['name'];}_0x52bf54[_0x7c15('0x27')](_0x315ba8)['send'](_0xa933a9);};}exports[_0x7c15('0x36')]=function(_0x47cc2d,_0x4e82a7){var _0x3a5047={},_0x5e78fd={},_0xd3f19c={'count':0x0,'rows':[]};var _0x598616=db[_0x7c15('0x37')][_0x7c15('0x38')];_0x5e78fd[_0x7c15('0x39')]=_[_0x7c15('0x3a')](_0x598616);_0x5e78fd['query']=_[_0x7c15('0x3a')](_0x47cc2d[_0x7c15('0x3b')]);_0x5e78fd['filters']=_[_0x7c15('0x3c')](_0x5e78fd['model'],_0x5e78fd[_0x7c15('0x3b')]);_0x3a5047[_0x7c15('0x3d')]=_[_0x7c15('0x3c')](_0x5e78fd['model'],qs['fields'](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x3e')]));_0x3a5047['attributes']=_0x3a5047['attributes'][_0x7c15('0x3f')]?_0x3a5047[_0x7c15('0x3d')]:_0x5e78fd[_0x7c15('0x39')];if(!_0x47cc2d['query'][_0x7c15('0x40')](_0x7c15('0x41'))){_0x3a5047[_0x7c15('0x2c')]=qs[_0x7c15('0x2c')](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x2c')]);_0x3a5047[_0x7c15('0x2b')]=qs['offset'](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x2b')]);}_0x3a5047['order']=qs[_0x7c15('0x42')](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x42')]);_0x3a5047['where']=qs['filters'](_[_0x7c15('0x43')](_0x47cc2d[_0x7c15('0x3b')],_0x5e78fd[_0x7c15('0x44')]));if(_0x47cc2d['query'][_0x7c15('0x45')]){_0x3a5047[_0x7c15('0x46')]=_[_0x7c15('0x47')](_0x3a5047[_0x7c15('0x46')],{'$or':_['map'](_0x598616,function(_0x4e1a41){if(_0x4e1a41['type'][_0x7c15('0x48')]!==_0x7c15('0x49')){var _0x369be1={};_0x369be1[_0x4e1a41[_0x7c15('0x4a')]]={'$like':'%'+_0x47cc2d['query'][_0x7c15('0x45')]+'%'};return _0x369be1;}})});}_0x3a5047=_['merge']({},_0x3a5047,_0x47cc2d[_0x7c15('0x4b')]);var _0x9471d1={'where':_0x3a5047[_0x7c15('0x46')]};return db[_0x7c15('0x37')][_0x7c15('0x2a')](_0x9471d1)[_0x7c15('0x32')](function(_0x593179){_0xd3f19c[_0x7c15('0x2a')]=_0x593179;if(_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x4c')]){_0x3a5047[_0x7c15('0x4d')]=[{'all':!![]}];}return db[_0x7c15('0x37')]['findAll'](_0x3a5047);})[_0x7c15('0x32')](function(_0x285b79){_0xd3f19c[_0x7c15('0x4e')]=_0x285b79;return _0xd3f19c;})['then'](respondWithFilteredResult(_0x4e82a7,_0x3a5047))[_0x7c15('0x25')](handleError(_0x4e82a7,null));};exports[_0x7c15('0x4f')]=function(_0x1de89d,_0x44b64b){var _0x3151bb={'raw':!![],'where':{'id':_0x1de89d[_0x7c15('0x50')]['id']}},_0x2aabfe={};_0x2aabfe[_0x7c15('0x39')]=_[_0x7c15('0x3a')](db[_0x7c15('0x37')][_0x7c15('0x38')]);_0x2aabfe[_0x7c15('0x3b')]=_[_0x7c15('0x3a')](_0x1de89d[_0x7c15('0x3b')]);_0x2aabfe[_0x7c15('0x44')]=_['intersection'](_0x2aabfe['model'],_0x2aabfe[_0x7c15('0x3b')]);_0x3151bb[_0x7c15('0x3d')]=_[_0x7c15('0x3c')](_0x2aabfe['model'],qs[_0x7c15('0x3e')](_0x1de89d['query'][_0x7c15('0x3e')]));_0x3151bb['attributes']=_0x3151bb[_0x7c15('0x3d')][_0x7c15('0x3f')]?_0x3151bb['attributes']:_0x2aabfe[_0x7c15('0x39')];if(_0x1de89d[_0x7c15('0x3b')]['includeAll']){_0x3151bb['include']=[{'all':!![]}];}_0x3151bb=_[_0x7c15('0x47')]({},_0x3151bb,_0x1de89d['options']);return db['ChatMessage']['find'](_0x3151bb)[_0x7c15('0x32')](handleEntityNotFound(_0x44b64b,null))[_0x7c15('0x32')](respondWithResult(_0x44b64b,null))[_0x7c15('0x25')](handleError(_0x44b64b,null));};exports['create']=function(_0x3edbe5,_0x6fa0ca){return db[_0x7c15('0x37')][_0x7c15('0x51')](_0x3edbe5['body'],{})[_0x7c15('0x32')](respondWithResult(_0x6fa0ca,0xc9))[_0x7c15('0x25')](handleError(_0x6fa0ca,null));};exports[_0x7c15('0x31')]=function(_0x40936e,_0x55d22f){if(_0x40936e['body']['id']){delete _0x40936e['body']['id'];}return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x40936e[_0x7c15('0x50')]['id']}})[_0x7c15('0x32')](handleEntityNotFound(_0x55d22f,null))['then'](saveUpdates(_0x40936e['body'],null))['then'](respondWithResult(_0x55d22f,null))[_0x7c15('0x25')](handleError(_0x55d22f,null));};exports['destroy']=function(_0x22ec6b,_0x3f8f0f){return db['ChatMessage'][_0x7c15('0x52')]({'where':{'id':_0x22ec6b[_0x7c15('0x50')]['id']}})[_0x7c15('0x32')](handleEntityNotFound(_0x3f8f0f,null))[_0x7c15('0x32')](removeEntity(_0x3f8f0f,null))[_0x7c15('0x25')](handleError(_0x3f8f0f,null));};exports[_0x7c15('0x53')]=function(_0x5810a2,_0x195aae){return db[_0x7c15('0x37')][_0x7c15('0x53')]()[_0x7c15('0x32')](respondWithResult(_0x195aae,null))[_0x7c15('0x25')](handleError(_0x195aae,null));};var interaction_log=require(_0x7c15('0x11'))(_0x7c15('0x54'));exports[_0x7c15('0x55')]=function(_0x341299,_0x5dad2b,_0x3dbde7){var _0x1ae763={'channel':_0x7c15('0x56')};if(_0x341299[_0x7c15('0x57')]['id']){delete _0x341299[_0x7c15('0x57')]['id'];}_0x341299['body'][_0x7c15('0x58')]=!![];_0x341299[_0x7c15('0x57')][_0x7c15('0x59')]=moment()['format'](_0x7c15('0x5a'));_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')]=_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')]||_0x341299[_0x7c15('0x5c')]['id'];return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x341299[_0x7c15('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x7c15('0x5d')],'as':_0x7c15('0x5e')}]})[_0x7c15('0x32')](handleEntityNotFound(_0x5dad2b,null))[_0x7c15('0x32')](saveUpdates(_0x341299[_0x7c15('0x57')],null))[_0x7c15('0x32')](function(_0x143e14){if(_0x143e14){_0x1ae763[_0x7c15('0x23')]=_0x143e14[_0x7c15('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0x7c15('0x52')]({'where':{'id':_0x143e14[_0x7c15('0x60')]}});}return null;})[_0x7c15('0x32')](handleEntityNotFound(_0x5dad2b,null))[_0x7c15('0x32')](function(_0x207558){if(_0x207558){return _0x207558['update']({'UserId':_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')],'read1stAt':_[_0x7c15('0x61')](_0x207558[_0x7c15('0x62')])?moment()[_0x7c15('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7c15('0x32')](function(_0x40964b){if(_0x40964b){_0x1ae763[_0x7c15('0x64')]=_0x40964b[_0x7c15('0x5f')]({'plain':!![]});interaction_log['info'](_0x7c15('0x65'),_0x341299[_0x7c15('0x5c')]['id'],_0x341299[_0x7c15('0x5c')][_0x7c15('0x35')],_0x341299[_0x7c15('0x5c')][_0x7c15('0x66')],_0x1ae763[_0x7c15('0x64')]['id'],_0x341299[_0x7c15('0x57')]?JSON[_0x7c15('0x20')](_0x341299[_0x7c15('0x57')]):_0x7c15('0x67'));return respondWithRpcPromise(_0x7c15('0x68'),_0x7c15('0x69'),_0x1ae763);}return null;})[_0x7c15('0x32')](function(_0x5a39ef){if(_0x5a39ef){if(_0x341299[_0x7c15('0x57')][_0x7c15('0x6a')]){_0x1ae763[_0x7c15('0x23')][_0x7c15('0x6b')]=util[_0x7c15('0x63')]('SIP/%s',_0x341299['user']['name']);_0x1ae763[_0x7c15('0x23')][_0x7c15('0x6c')]=_0x1ae763['channel'];_0x1ae763[_0x7c15('0x23')]['event']=_0x7c15('0x55');return respondWithRpcPromise('EventManager',_0x7c15('0x6d'),{'event':_0x7c15('0x6e'),'message':_[_0x7c15('0x47')](_0x1ae763[_0x7c15('0x23')],JSON[_0x7c15('0x6f')](_0x1ae763[_0x7c15('0x64')][_0x7c15('0x70')]))},client9002)[_0x7c15('0x32')](function(){return _0x1ae763;});}return _0x1ae763;}return null;})[_0x7c15('0x32')](respondWithResult(_0x5dad2b,null))[_0x7c15('0x25')](handleError(_0x5dad2b,null));};var interaction_log=require(_0x7c15('0x11'))(_0x7c15('0x54'));exports['reject']=function(_0x1be51b,_0xf9d86,_0x5cfbac){var _0x126288={'agent':{},'channel':_0x7c15('0x56')};if(_0x1be51b[_0x7c15('0x57')]['id']){delete _0x1be51b['body']['id'];}_0x1be51b['body'][_0x7c15('0x5b')]=_0x1be51b[_0x7c15('0x57')][_0x7c15('0x5b')]||_0x1be51b[_0x7c15('0x5c')]['id'];_0x126288[_0x7c15('0x71')]['id']=_0x1be51b[_0x7c15('0x57')][_0x7c15('0x5b')];return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x1be51b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xf9d86,null))['then'](function(_0x7c8704){if(_0x7c8704){_0x126288['message']=_0x7c8704['get']({'plain':!![]});return db[_0x7c15('0x72')]['find']({'where':{'id':_0x7c8704[_0x7c15('0x60')]}});}return null;})[_0x7c15('0x32')](handleEntityNotFound(_0xf9d86,null))['then'](function(_0x1cf9ae){if(_0x1cf9ae){_0x126288[_0x7c15('0x64')]=_0x1cf9ae[_0x7c15('0x5f')]({'plain':!![]});interaction_log['info'](_0x7c15('0x73'),_0x1be51b[_0x7c15('0x5c')]['id'],_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x35')],_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x66')],_0x126288[_0x7c15('0x64')]['id'],_0x1be51b[_0x7c15('0x57')]?JSON[_0x7c15('0x20')](_0x1be51b[_0x7c15('0x57')]):_0x7c15('0x67'));return respondWithRpcPromise('RejectMessage',_0x7c15('0x74'),_0x126288);}return null;})[_0x7c15('0x32')](function(_0x295afb){if(_0x295afb){_0x295afb['message']['interface']=util['format'](_0x7c15('0x75'),_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x35')]);_0x295afb['message'][_0x7c15('0x6c')]=_0x126288['channel'];_0x295afb[_0x7c15('0x23')][_0x7c15('0x76')]=_0x7c15('0x30');respondWithRpcPromise(_0x7c15('0x6d'),_0x7c15('0x6d'),{'event':'rejectmessage','message':_0x295afb['message']},client9002);return _0x126288;}return null;})['then'](respondWithResult(_0xf9d86,null))[_0x7c15('0x25')](handleError(_0xf9d86,null));}; \ No newline at end of file +var _0x6ea5=['VIRTUAL','field','options','include','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','../../config/logger','agent','ChatInteraction','RejectMessage','rejectMessage','event','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','test','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','ChatMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','key'];(function(_0x408059,_0x35993c){var _0x411648=function(_0x124879){while(--_0x124879){_0x408059['push'](_0x408059['shift']());}};_0x411648(++_0x35993c);}(_0x6ea5,0xa5));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x56ea('0x0'));var emlformat=require(_0x56ea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x56ea('0x2'));var jsonpatch=require(_0x56ea('0x3'));var rp=require('request-promise');var moment=require(_0x56ea('0x4'));var BPromise=require(_0x56ea('0x5'));var Mustache=require('mustache');var util=require(_0x56ea('0x6'));var path=require('path');var sox=require(_0x56ea('0x7'));var csv=require(_0x56ea('0x8'));var ejs=require(_0x56ea('0x9'));var fs=require('fs');var _=require(_0x56ea('0xa'));var squel=require('squel');var crypto=require(_0x56ea('0xb'));var jsforce=require(_0x56ea('0xc'));var deskjs=require(_0x56ea('0xd'));var toCsv=require(_0x56ea('0x8'));var querystring=require('querystring');var Papa=require(_0x56ea('0xe'));var Redis=require(_0x56ea('0xf'));var authService=require(_0x56ea('0x10'));var qs=require(_0x56ea('0x11'));var hardwareService=require(_0x56ea('0x12'));var logger=require('../../config/logger')(_0x56ea('0x13'));var utils=require(_0x56ea('0x14'));var config=require(_0x56ea('0x15'));var db=require(_0x56ea('0x16'))['db'];config['redis']=_[_0x56ea('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x56ea('0x18'))(new Redis(config[_0x56ea('0x19')]));require(_0x56ea('0x1a'))[_0x56ea('0x1b')](socket);var jayson=require(_0x56ea('0x1c'));var client=jayson['client'][_0x56ea('0x1d')]({'port':0x232c});var client9002=jayson[_0x56ea('0x1e')][_0x56ea('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x17f75c,_0x451431,_0x4cea11){if(_0x4cea11){var _0x550645=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x550645[_0x56ea('0x1f')](_0x451431)){return _0x17f75c;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17f75c;}}function respondWithRpcPromise(_0x208855,_0x34ab0e,_0x2e7e9a,_0x39a5d9){return new BPromise(function(_0x36d2b1,_0x1f9acc){var _0x1d9fbe=_0x39a5d9||client;return _0x1d9fbe[_0x56ea('0x20')](_0x208855,_0x2e7e9a)['then'](function(_0x5da2fa){logger[_0x56ea('0x21')](_0x56ea('0x22'),_0x34ab0e,_0x56ea('0x23'));logger[_0x56ea('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x34ab0e,'request\x20sent',JSON[_0x56ea('0x25')](_0x5da2fa));if(_0x5da2fa[_0x56ea('0x26')]){if(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x27')]===0x1f4){logger[_0x56ea('0x26')](_0x56ea('0x22'),_0x34ab0e,_0x5da2fa['error'][_0x56ea('0x28')]);return _0x1f9acc(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);}logger['error'](_0x56ea('0x22'),_0x34ab0e,_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);return _0x36d2b1(_0x5da2fa[_0x56ea('0x26')][_0x56ea('0x28')]);}else{logger[_0x56ea('0x21')](_0x56ea('0x22'),_0x34ab0e,'request\x20sent');_0x36d2b1(_0x5da2fa[_0x56ea('0x29')][_0x56ea('0x28')]);}})[_0x56ea('0x2a')](function(_0x1c789b){logger[_0x56ea('0x26')](_0x56ea('0x22'),_0x34ab0e,_0x1c789b);_0x1f9acc(_0x1c789b);});});}function respondWithStatusCode(_0x3d0f10,_0x3e6d04){_0x3e6d04=_0x3e6d04||0xcc;return function(_0x49c933){if(_0x49c933){return _0x3d0f10[_0x56ea('0x2b')](_0x3e6d04);}return _0x3d0f10[_0x56ea('0x2c')](_0x3e6d04)[_0x56ea('0x2d')]();};}function respondWithResult(_0x61f34d,_0x1d0ded){_0x1d0ded=_0x1d0ded||0xc8;return function(_0x24d6ef){if(_0x24d6ef){return _0x61f34d[_0x56ea('0x2c')](_0x1d0ded)['json'](_0x24d6ef);}};}function respondWithFilteredResult(_0x486c67,_0x53d06d){return function(_0x287d14){if(_0x287d14){var _0x54f74a=_0x287d14[_0x56ea('0x2e')],_0x176af1=_0x53d06d['offset'],_0x40decf=_0x53d06d[_0x56ea('0x2f')]+_0x53d06d[_0x56ea('0x30')],_0x5b1ad3;if(_0x40decf>=_0x54f74a){_0x40decf=_0x54f74a;_0x5b1ad3=0xc8;}else{_0x5b1ad3=0xce;}_0x486c67[_0x56ea('0x2c')](_0x5b1ad3);return _0x486c67[_0x56ea('0x31')](_0x56ea('0x32'),_0x176af1+'-'+_0x40decf+'/'+_0x54f74a)['json'](_0x287d14);}return null;};}function patchUpdates(_0x337d3){return function(_0x1afb2d){try{jsonpatch['apply'](_0x1afb2d,_0x337d3,!![]);}catch(_0x88d2cd){return BPromise[_0x56ea('0x33')](_0x88d2cd);}return _0x1afb2d['save']();};}function saveUpdates(_0x18cfe7,_0xfb4e6){return function(_0x2cc3f7){if(_0x2cc3f7){return _0x2cc3f7[_0x56ea('0x34')](_0x18cfe7)[_0x56ea('0x35')](function(_0x1370cc){return _0x1370cc;});}return null;};}function removeEntity(_0x3d54b8,_0x57483e){return function(_0x59dd23){if(_0x59dd23){return _0x59dd23[_0x56ea('0x36')]()[_0x56ea('0x35')](function(){_0x3d54b8[_0x56ea('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40aa56,_0x564d90){return function(_0x16428a){if(!_0x16428a){_0x40aa56[_0x56ea('0x2b')](0x194);}return _0x16428a;};}function handleError(_0x4f0820,_0x3eb2fc){_0x3eb2fc=_0x3eb2fc||0x1f4;return function(_0x49fb91){logger[_0x56ea('0x26')](_0x49fb91[_0x56ea('0x37')]);if(_0x49fb91[_0x56ea('0x38')]){delete _0x49fb91[_0x56ea('0x38')];}_0x4f0820[_0x56ea('0x2c')](_0x3eb2fc)[_0x56ea('0x39')](_0x49fb91);};}exports[_0x56ea('0x3a')]=function(_0x43625b,_0x5bc0e7){var _0x5163db={},_0x1b9e62={},_0x17f6dd={'count':0x0,'rows':[]};var _0x3a717b=db[_0x56ea('0x3b')][_0x56ea('0x3c')];_0x1b9e62[_0x56ea('0x3d')]=_['keys'](_0x3a717b);_0x1b9e62[_0x56ea('0x3e')]=_[_0x56ea('0x3f')](_0x43625b[_0x56ea('0x3e')]);_0x1b9e62[_0x56ea('0x40')]=_[_0x56ea('0x41')](_0x1b9e62[_0x56ea('0x3d')],_0x1b9e62['query']);_0x5163db[_0x56ea('0x42')]=_[_0x56ea('0x41')](_0x1b9e62[_0x56ea('0x3d')],qs['fields'](_0x43625b['query'][_0x56ea('0x43')]));_0x5163db[_0x56ea('0x42')]=_0x5163db[_0x56ea('0x42')][_0x56ea('0x44')]?_0x5163db['attributes']:_0x1b9e62[_0x56ea('0x3d')];if(!_0x43625b[_0x56ea('0x3e')]['hasOwnProperty'](_0x56ea('0x45'))){_0x5163db[_0x56ea('0x30')]=qs[_0x56ea('0x30')](_0x43625b[_0x56ea('0x3e')][_0x56ea('0x30')]);_0x5163db[_0x56ea('0x2f')]=qs[_0x56ea('0x2f')](_0x43625b['query'][_0x56ea('0x2f')]);}_0x5163db['order']=qs[_0x56ea('0x46')](_0x43625b[_0x56ea('0x3e')][_0x56ea('0x46')]);_0x5163db[_0x56ea('0x47')]=qs[_0x56ea('0x40')](_[_0x56ea('0x48')](_0x43625b[_0x56ea('0x3e')],_0x1b9e62[_0x56ea('0x40')]));if(_0x43625b['query'][_0x56ea('0x49')]){_0x5163db[_0x56ea('0x47')]=_[_0x56ea('0x4a')](_0x5163db[_0x56ea('0x47')],{'$or':_['map'](_0x3a717b,function(_0x255398){if(_0x255398[_0x56ea('0x4b')][_0x56ea('0x4c')]!==_0x56ea('0x4d')){var _0x1f99ff={};_0x1f99ff[_0x255398[_0x56ea('0x4e')]]={'$like':'%'+_0x43625b[_0x56ea('0x3e')][_0x56ea('0x49')]+'%'};return _0x1f99ff;}})});}_0x5163db=_[_0x56ea('0x4a')]({},_0x5163db,_0x43625b[_0x56ea('0x4f')]);var _0x269447={'where':_0x5163db[_0x56ea('0x47')]};return db[_0x56ea('0x3b')][_0x56ea('0x2e')](_0x269447)[_0x56ea('0x35')](function(_0x495565){_0x17f6dd[_0x56ea('0x2e')]=_0x495565;if(_0x43625b[_0x56ea('0x3e')]['includeAll']){_0x5163db[_0x56ea('0x50')]=[{'all':!![]}];}return db[_0x56ea('0x3b')]['findAll'](_0x5163db);})[_0x56ea('0x35')](function(_0x97b119){_0x17f6dd[_0x56ea('0x51')]=_0x97b119;return _0x17f6dd;})[_0x56ea('0x35')](respondWithFilteredResult(_0x5bc0e7,_0x5163db))[_0x56ea('0x2a')](handleError(_0x5bc0e7,null));};exports[_0x56ea('0x52')]=function(_0x365e64,_0x74f02f){var _0x1a38dd={'raw':!![],'where':{'id':_0x365e64[_0x56ea('0x53')]['id']}},_0x10a3d2={};_0x10a3d2['model']=_[_0x56ea('0x3f')](db[_0x56ea('0x3b')][_0x56ea('0x3c')]);_0x10a3d2['query']=_['keys'](_0x365e64[_0x56ea('0x3e')]);_0x10a3d2[_0x56ea('0x40')]=_[_0x56ea('0x41')](_0x10a3d2['model'],_0x10a3d2[_0x56ea('0x3e')]);_0x1a38dd['attributes']=_['intersection'](_0x10a3d2[_0x56ea('0x3d')],qs[_0x56ea('0x43')](_0x365e64['query'][_0x56ea('0x43')]));_0x1a38dd[_0x56ea('0x42')]=_0x1a38dd[_0x56ea('0x42')][_0x56ea('0x44')]?_0x1a38dd['attributes']:_0x10a3d2[_0x56ea('0x3d')];if(_0x365e64[_0x56ea('0x3e')]['includeAll']){_0x1a38dd[_0x56ea('0x50')]=[{'all':!![]}];}_0x1a38dd=_['merge']({},_0x1a38dd,_0x365e64['options']);return db[_0x56ea('0x3b')]['find'](_0x1a38dd)['then'](handleEntityNotFound(_0x74f02f,null))[_0x56ea('0x35')](respondWithResult(_0x74f02f,null))[_0x56ea('0x2a')](handleError(_0x74f02f,null));};exports['create']=function(_0x19878b,_0x2c67af){return db[_0x56ea('0x3b')][_0x56ea('0x54')](_0x19878b['body'],{})[_0x56ea('0x35')](respondWithResult(_0x2c67af,0xc9))[_0x56ea('0x2a')](handleError(_0x2c67af,null));};exports[_0x56ea('0x34')]=function(_0x201eaf,_0x9b70e5){if(_0x201eaf['body']['id']){delete _0x201eaf[_0x56ea('0x55')]['id'];}return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0x201eaf[_0x56ea('0x53')]['id']}})['then'](handleEntityNotFound(_0x9b70e5,null))[_0x56ea('0x35')](saveUpdates(_0x201eaf[_0x56ea('0x55')],null))['then'](respondWithResult(_0x9b70e5,null))['catch'](handleError(_0x9b70e5,null));};exports['destroy']=function(_0x5d9ccd,_0x4179ce){return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0x5d9ccd[_0x56ea('0x53')]['id']}})[_0x56ea('0x35')](handleEntityNotFound(_0x4179ce,null))['then'](removeEntity(_0x4179ce,null))[_0x56ea('0x2a')](handleError(_0x4179ce,null));};exports[_0x56ea('0x57')]=function(_0x2d7850,_0x1a669c){return db['ChatMessage'][_0x56ea('0x57')]()[_0x56ea('0x35')](respondWithResult(_0x1a669c,null))[_0x56ea('0x2a')](handleError(_0x1a669c,null));};var interaction_log=require('../../config/logger')(_0x56ea('0x58'));exports[_0x56ea('0x59')]=function(_0x11675b,_0x207cc4,_0x17ee8d){var _0x5a6e04={'channel':_0x56ea('0x5a')};if(_0x11675b[_0x56ea('0x55')]['id']){delete _0x11675b['body']['id'];}_0x11675b['body'][_0x56ea('0x5b')]=!![];_0x11675b[_0x56ea('0x55')][_0x56ea('0x5c')]=moment()[_0x56ea('0x5d')](_0x56ea('0x5e'));_0x11675b['body'][_0x56ea('0x5f')]=_0x11675b['body'][_0x56ea('0x5f')]||_0x11675b[_0x56ea('0x60')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x11675b[_0x56ea('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x56ea('0x61')}]})['then'](handleEntityNotFound(_0x207cc4,null))[_0x56ea('0x35')](saveUpdates(_0x11675b['body'],null))[_0x56ea('0x35')](function(_0x1b4fb8){if(_0x1b4fb8){_0x5a6e04[_0x56ea('0x28')]=_0x1b4fb8[_0x56ea('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x56ea('0x56')]({'where':{'id':_0x1b4fb8[_0x56ea('0x63')]}});}return null;})[_0x56ea('0x35')](handleEntityNotFound(_0x207cc4,null))[_0x56ea('0x35')](function(_0x5a2c78){if(_0x5a2c78){return _0x5a2c78[_0x56ea('0x34')]({'UserId':_0x11675b[_0x56ea('0x55')][_0x56ea('0x5f')],'read1stAt':_[_0x56ea('0x64')](_0x5a2c78[_0x56ea('0x65')])?moment()[_0x56ea('0x5d')](_0x56ea('0x5e')):undefined});}return null;})[_0x56ea('0x35')](function(_0x505391){if(_0x505391){_0x5a6e04[_0x56ea('0x66')]=_0x505391[_0x56ea('0x62')]({'plain':!![]});interaction_log['info'](_0x56ea('0x67'),_0x11675b[_0x56ea('0x60')]['id'],_0x11675b[_0x56ea('0x60')][_0x56ea('0x38')],_0x11675b['user'][_0x56ea('0x68')],_0x5a6e04[_0x56ea('0x66')]['id'],_0x11675b['body']?JSON[_0x56ea('0x25')](_0x11675b['body']):_0x56ea('0x69'));return respondWithRpcPromise(_0x56ea('0x6a'),_0x56ea('0x6b'),_0x5a6e04);}return null;})['then'](function(_0xba82ea){if(_0xba82ea){if(_0x11675b['body'][_0x56ea('0x6c')]){_0x5a6e04[_0x56ea('0x28')][_0x56ea('0x6d')]=util['format'](_0x56ea('0x6e'),_0x11675b[_0x56ea('0x60')][_0x56ea('0x38')]);_0x5a6e04['message'][_0x56ea('0x6f')]=_0x5a6e04[_0x56ea('0x6f')];_0x5a6e04['message']['event']='accept';return respondWithRpcPromise(_0x56ea('0x70'),_0x56ea('0x70'),{'event':_0x56ea('0x71'),'message':_['merge'](_0x5a6e04[_0x56ea('0x28')],JSON['parse'](_0x5a6e04['interaction']['formData']))},client9002)[_0x56ea('0x35')](function(){return _0x5a6e04;});}return _0x5a6e04;}return null;})[_0x56ea('0x35')](respondWithResult(_0x207cc4,null))['catch'](handleError(_0x207cc4,null));};var interaction_log=require(_0x56ea('0x72'))(_0x56ea('0x58'));exports[_0x56ea('0x33')]=function(_0xc8ff4e,_0x5c61ee,_0x3b930a){var _0xc5e482={'agent':{},'channel':_0x56ea('0x5a')};if(_0xc8ff4e[_0x56ea('0x55')]['id']){delete _0xc8ff4e[_0x56ea('0x55')]['id'];}_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')]=_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')]||_0xc8ff4e[_0x56ea('0x60')]['id'];_0xc5e482[_0x56ea('0x73')]['id']=_0xc8ff4e[_0x56ea('0x55')][_0x56ea('0x5f')];return db[_0x56ea('0x3b')][_0x56ea('0x56')]({'where':{'id':_0xc8ff4e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c61ee,null))[_0x56ea('0x35')](function(_0x483328){if(_0x483328){_0xc5e482['message']=_0x483328[_0x56ea('0x62')]({'plain':!![]});return db[_0x56ea('0x74')][_0x56ea('0x56')]({'where':{'id':_0x483328[_0x56ea('0x63')]}});}return null;})[_0x56ea('0x35')](handleEntityNotFound(_0x5c61ee,null))[_0x56ea('0x35')](function(_0x970d53){if(_0x970d53){_0xc5e482['interaction']=_0x970d53[_0x56ea('0x62')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc8ff4e['user']['id'],_0xc8ff4e[_0x56ea('0x60')][_0x56ea('0x38')],_0xc8ff4e[_0x56ea('0x60')][_0x56ea('0x68')],_0xc5e482['interaction']['id'],_0xc8ff4e[_0x56ea('0x55')]?JSON['stringify'](_0xc8ff4e[_0x56ea('0x55')]):'null');return respondWithRpcPromise(_0x56ea('0x75'),_0x56ea('0x76'),_0xc5e482);}return null;})['then'](function(_0x27a256){if(_0x27a256){_0x27a256[_0x56ea('0x28')][_0x56ea('0x6d')]=util['format'](_0x56ea('0x6e'),_0xc8ff4e['user']['name']);_0x27a256[_0x56ea('0x28')][_0x56ea('0x6f')]=_0xc5e482['channel'];_0x27a256['message'][_0x56ea('0x77')]='reject';respondWithRpcPromise(_0x56ea('0x70'),_0x56ea('0x70'),{'event':_0x56ea('0x78'),'message':_0x27a256[_0x56ea('0x28')]},client9002);return _0xc5e482;}return null;})[_0x56ea('0x35')](respondWithResult(_0x5c61ee,null))[_0x56ea('0x2a')](handleError(_0x5c61ee,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4a99160..158fc99 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 _0x5fc7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x53943a,_0x28c765){var _0x4a7937=function(_0x4fb681){while(--_0x4fb681){_0x53943a['push'](_0x53943a['shift']());}};_0x4a7937(++_0x28c765);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x5fc7[_0x435044];return _0x33d4c6;};'use strict';var EventEmitter=require(_0x75fc('0x0'));var ChatMessage=require(_0x75fc('0x1'))['db'][_0x75fc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x75fc('0x3')](0x0);var events={'afterCreate':_0x75fc('0x4'),'afterUpdate':_0x75fc('0x5'),'afterDestroy':_0x75fc('0x6')};function emitEvent(_0x34103c){return function(_0x756c32,_0x51e8b4,_0x94c5d3){ChatMessageEvents[_0x75fc('0x7')](_0x34103c+':'+_0x756c32['id'],_0x756c32);ChatMessageEvents['emit'](_0x34103c,_0x756c32);_0x94c5d3(null);};}for(var e in events){if(events[_0x75fc('0x8')](e)){var event=events[e];ChatMessage[_0x75fc('0x9')](e,emitEvent(event));}}module[_0x75fc('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x6250=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1356d5,_0x50edc2){var _0x24ad4c=function(_0x36929c){while(--_0x36929c){_0x1356d5['push'](_0x1356d5['shift']());}};_0x24ad4c(++_0x50edc2);}(_0x6250,0x85));var _0x0625=function(_0x74bd29,_0x42b0ee){_0x74bd29=_0x74bd29-0x0;var _0x3a593f=_0x6250[_0x74bd29];return _0x3a593f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0625('0x0'))['db'][_0x0625('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0625('0x2')};function emitEvent(_0x501f85){return function(_0x2c4434,_0x345b5a,_0x1a6be8){ChatMessageEvents[_0x0625('0x3')](_0x501f85+':'+_0x2c4434['id'],_0x2c4434);ChatMessageEvents[_0x0625('0x3')](_0x501f85,_0x2c4434);_0x1a6be8(null);};}for(var e in events){if(events[_0x0625('0x4')](e)){var event=events[e];ChatMessage[_0x0625('0x5')](e,emitEvent(event));}}module[_0x0625('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index daaac96..3691b06 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 _0x86a2=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./chatMessage.attributes','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then'];(function(_0x4e15c2,_0x3b28b1){var _0x26008d=function(_0x51feee){while(--_0x51feee){_0x4e15c2['push'](_0x4e15c2['shift']());}};_0x26008d(++_0x3b28b1);}(_0x86a2,0x165));var _0x286a=function(_0xf0b977,_0xe512bd){_0xf0b977=_0xf0b977-0x0;var _0x32199c=_0x86a2[_0xf0b977];return _0x32199c;};'use strict';var _=require(_0x286a('0x0'));var util=require('util');var logger=require(_0x286a('0x1'))('api');var moment=require(_0x286a('0x2'));var BPromise=require(_0x286a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x286a('0x4'));var rimraf=require('rimraf');var config=require(_0x286a('0x5'));var attributes=require(_0x286a('0x6'));module['exports']=function(_0x7ce78c,_0x357ed6){return _0x7ce78c[_0x286a('0x7')]('ChatMessage',attributes,{'tableName':_0x286a('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x286a('0x9')],'type':_0x286a('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x367bd9,_0x2c2441,_0x5cf3e8){var _0x5ca996=_0x7ce78c[_0x286a('0xb')];var _0x10ed83=_0x367bd9[_0x286a('0xc')]({'plain':!![]});if(_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()==='in'||_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()===_0x286a('0xf')&&!_0x10ed83[_0x286a('0x10')]&&!_[_0x286a('0x11')](_0x10ed83[_0x286a('0x12')])){_0x5ca996['ChatInteraction']['findOne']({'where':{'id':_0x10ed83[_0x286a('0x13')]}})[_0x286a('0x14')](function(_0x340da6){if(_0x340da6){_0x340da6[_0x286a('0x15')]({'lastMsgAt':_0x10ed83[_0x286a('0x16')],'lastMsgDirection':_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()});}})[_0x286a('0x17')](function(_0x4b5c0a){console[_0x286a('0x18')](_0x4b5c0a);});}_0x5cf3e8();}},'charset':_0x286a('0x19'),'collate':_0x286a('0x1a')});}; \ No newline at end of file +var _0xff6b=['createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','moment','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','then','update'];(function(_0x4c8b49,_0x22de7f){var _0x4877b7=function(_0x417fdc){while(--_0x417fdc){_0x4c8b49['push'](_0x4c8b49['shift']());}};_0x4877b7(++_0x22de7f);}(_0xff6b,0x1d8));var _0xbff6=function(_0x23bf21,_0x3fe881){_0x23bf21=_0x23bf21-0x0;var _0x359a1f=_0xff6b[_0x23bf21];return _0x359a1f;};'use strict';var _=require(_0xbff6('0x0'));var util=require(_0xbff6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbff6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbff6('0x3'));var rimraf=require(_0xbff6('0x4'));var config=require(_0xbff6('0x5'));var attributes=require('./chatMessage.attributes');module[_0xbff6('0x6')]=function(_0x100f47,_0x6f2ac6){return _0x100f47[_0xbff6('0x7')](_0xbff6('0x8'),attributes,{'tableName':_0xbff6('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xbff6('0xa')],'type':_0xbff6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ace1c,_0x3b6888,_0xa56a5d){var _0x30c43e=_0x100f47['models'];var _0x3e0f27=_0x5ace1c[_0xbff6('0xc')]({'plain':!![]});if(_0x3e0f27['direction'][_0xbff6('0xd')]()==='in'||_0x3e0f27[_0xbff6('0xe')][_0xbff6('0xd')]()===_0xbff6('0xf')&&!_0x3e0f27[_0xbff6('0x10')]&&!_[_0xbff6('0x11')](_0x3e0f27[_0xbff6('0x12')])){_0x30c43e[_0xbff6('0x13')]['findOne']({'where':{'id':_0x3e0f27['ChatInteractionId']}})[_0xbff6('0x14')](function(_0x5c9dec){if(_0x5c9dec){_0x5c9dec[_0xbff6('0x15')]({'lastMsgAt':_0x3e0f27[_0xbff6('0x16')],'lastMsgDirection':_0x3e0f27[_0xbff6('0xe')]['toLowerCase']()});}})[_0xbff6('0x17')](function(_0x22c227){console[_0xbff6('0x18')](_0x22c227);});}_0xa56a5d();}},'charset':'utf8mb4','collate':_0xbff6('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2fb1dec..4906ab3 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 _0xfebc=['ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x15681c,_0x1de42e){var _0x1cddf6=function(_0x38a706){while(--_0x38a706){_0x15681c['push'](_0x15681c['shift']());}};_0x1cddf6(++_0x1de42e);}(_0xfebc,0xb9));var _0xcfeb=function(_0x5de8bf,_0x24e115){_0x5de8bf=_0x5de8bf-0x0;var _0x2be3e3=_0xfebc[_0x5de8bf];return _0x2be3e3;};'use strict';var _=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfeb('0x2'));var fs=require('fs');var Redis=require(_0xcfeb('0x3'));var db=require(_0xcfeb('0x4'))['db'];var utils=require(_0xcfeb('0x5'));var logger=require(_0xcfeb('0x6'))(_0xcfeb('0x7'));var config=require(_0xcfeb('0x8'));var jayson=require(_0xcfeb('0x9'));var client=jayson[_0xcfeb('0xa')][_0xcfeb('0xb')]({'port':0x232a});config[_0xcfeb('0xc')]=_['defaults'](config[_0xcfeb('0xc')],{'host':_0xcfeb('0xd'),'port':0x18eb});var socket=require(_0xcfeb('0xe'))(new Redis(config['redis']));require(_0xcfeb('0xf'))[_0xcfeb('0x10')](socket);function respondWithRpcPromise(_0x49ba94,_0x2e4fdd,_0x5a5c42){return new BPromise(function(_0x104211,_0x4257bc){return client[_0xcfeb('0x11')](_0x49ba94,_0x5a5c42)[_0xcfeb('0x12')](function(_0x5a4196){logger[_0xcfeb('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2e4fdd,_0xcfeb('0x14'));logger[_0xcfeb('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2e4fdd,_0xcfeb('0x14'),JSON[_0xcfeb('0x16')](_0x5a4196));if(_0x5a4196[_0xcfeb('0x17')]){if(_0x5a4196[_0xcfeb('0x17')][_0xcfeb('0x18')]===0x1f4){logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0x5a4196['error'][_0xcfeb('0x1a')]);return _0x4257bc(_0x5a4196[_0xcfeb('0x17')]['message']);}logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0x5a4196[_0xcfeb('0x17')]['message']);return _0x104211(_0x5a4196[_0xcfeb('0x17')][_0xcfeb('0x1a')]);}else{logger['info'](_0xcfeb('0x19'),_0x2e4fdd,_0xcfeb('0x14'));_0x104211(_0x5a4196[_0xcfeb('0x1b')][_0xcfeb('0x1a')]);}})['catch'](function(_0xaf48c0){logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0xaf48c0);_0x4257bc(_0xaf48c0);});});}exports[_0xcfeb('0x1c')]=function(_0x3d2b63){var _0x2dc617=this;return new Promise(function(_0x3d6983,_0x358b52){return db[_0xcfeb('0x1d')][_0xcfeb('0x1e')](_0x3d2b63[_0xcfeb('0x1f')],{'raw':_0x3d2b63[_0xcfeb('0x20')]?_0x3d2b63['options'][_0xcfeb('0x21')]===undefined?!![]:![]:!![]})[_0xcfeb('0x12')](function(_0x5ad9ae){logger['info'](_0xcfeb('0x1c'),_0x3d2b63);logger[_0xcfeb('0x15')](_0xcfeb('0x1c'),_0x3d2b63,JSON['stringify'](_0x5ad9ae));_0x3d6983(_0x5ad9ae);})[_0xcfeb('0x22')](function(_0x2ec81d){logger['error'](_0xcfeb('0x1c'),_0x2ec81d[_0xcfeb('0x1a')],_0x3d2b63);_0x358b52(_0x2dc617[_0xcfeb('0x17')](0x1f4,_0x2ec81d['message']));});});}; \ No newline at end of file +var _0xf5e6=['result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x5e03ca,_0x1f53ef){var _0x381f3e=function(_0x308d9b){while(--_0x308d9b){_0x5e03ca['push'](_0x5e03ca['shift']());}};_0x381f3e(++_0x1f53ef);}(_0xf5e6,0xb2));var _0x6f5e=function(_0x6435b7,_0x3c5389){_0x6435b7=_0x6435b7-0x0;var _0x41d294=_0xf5e6[_0x6435b7];return _0x41d294;};'use strict';var _=require('lodash');var util=require(_0x6f5e('0x0'));var moment=require(_0x6f5e('0x1'));var BPromise=require(_0x6f5e('0x2'));var rs=require(_0x6f5e('0x3'));var fs=require('fs');var Redis=require(_0x6f5e('0x4'));var db=require(_0x6f5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f5e('0x6'))(_0x6f5e('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f5e('0x8'));var client=jayson[_0x6f5e('0x9')][_0x6f5e('0xa')]({'port':0x232a});config['redis']=_[_0x6f5e('0xb')](config[_0x6f5e('0xc')],{'host':_0x6f5e('0xd'),'port':0x18eb});var socket=require(_0x6f5e('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x6f5e('0xf')](socket);function respondWithRpcPromise(_0x51746b,_0x12292d,_0x508555){return new BPromise(function(_0x560602,_0x5e92e0){return client[_0x6f5e('0x10')](_0x51746b,_0x508555)[_0x6f5e('0x11')](function(_0x45b60f){logger['info'](_0x6f5e('0x12'),_0x12292d,_0x6f5e('0x13'));logger[_0x6f5e('0x14')](_0x6f5e('0x15'),_0x12292d,_0x6f5e('0x13'),JSON['stringify'](_0x45b60f));if(_0x45b60f[_0x6f5e('0x16')]){if(_0x45b60f[_0x6f5e('0x16')][_0x6f5e('0x17')]===0x1f4){logger[_0x6f5e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x45b60f['error'][_0x6f5e('0x18')]);return _0x5e92e0(_0x45b60f[_0x6f5e('0x16')]['message']);}logger[_0x6f5e('0x16')](_0x6f5e('0x12'),_0x12292d,_0x45b60f['error'][_0x6f5e('0x18')]);return _0x560602(_0x45b60f[_0x6f5e('0x16')][_0x6f5e('0x18')]);}else{logger[_0x6f5e('0x19')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x6f5e('0x13'));_0x560602(_0x45b60f[_0x6f5e('0x1a')][_0x6f5e('0x18')]);}})['catch'](function(_0x35a985){logger[_0x6f5e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x12292d,_0x35a985);_0x5e92e0(_0x35a985);});});}exports['CreateChatMessage']=function(_0x3bb71e){var _0xa573cf=this;return new Promise(function(_0x761980,_0x5206e1){return db[_0x6f5e('0x1b')][_0x6f5e('0x1c')](_0x3bb71e[_0x6f5e('0x1d')],{'raw':_0x3bb71e[_0x6f5e('0x1e')]?_0x3bb71e[_0x6f5e('0x1e')][_0x6f5e('0x1f')]===undefined?!![]:![]:!![]})[_0x6f5e('0x11')](function(_0x3d9300){logger['info'](_0x6f5e('0x20'),_0x3bb71e);logger[_0x6f5e('0x14')](_0x6f5e('0x20'),_0x3bb71e,JSON['stringify'](_0x3d9300));_0x761980(_0x3d9300);})[_0x6f5e('0x21')](function(_0x5bee42){logger[_0x6f5e('0x16')](_0x6f5e('0x20'),_0x5bee42[_0x6f5e('0x18')],_0x3bb71e);_0x5206e1(_0xa573cf[_0x6f5e('0x16')](0x1f4,_0x5bee42[_0x6f5e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 784b270..d2d0249 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 _0x008c=['./chatMessage.events','save','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x5b1ccf,_0xec68f2){var _0x4767aa=function(_0x183ece){while(--_0x183ece){_0x5b1ccf['push'](_0x5b1ccf['shift']());}};_0x4767aa(++_0xec68f2);}(_0x008c,0x188));var _0xc008=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0x008c[_0x5e6116];return _0x29bf86;};'use strict';var ChatMessageEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatMessageEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatMessageEvents['on'](_0x428fa9,_0x5aa09b);}}; \ No newline at end of file +var _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x55ca,0x126));var _0xa55c=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0x55ca[_0x6d0c3e];return _0x2895ce;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1a83be8..ab542c2 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 _0x7944=['/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x21eb13,_0x5a3060){var _0x439e40=function(_0x816b69){while(--_0x816b69){_0x21eb13['push'](_0x21eb13['shift']());}};_0x439e40(++_0x5a3060);}(_0x7944,0x71));var _0x4794=function(_0x307ce2,_0x41a7b3){_0x307ce2=_0x307ce2-0x0;var _0x24006e=_0x7944[_0x307ce2];return _0x24006e;};'use strict';var multer=require(_0x4794('0x0'));var util=require('util');var path=require(_0x4794('0x1'));var timeout=require(_0x4794('0x2'));var express=require(_0x4794('0x3'));var router=express['Router']();var auth=require(_0x4794('0x4'));var interaction=require(_0x4794('0x5'));var config=require(_0x4794('0x6'));var controller=require(_0x4794('0x7'));router[_0x4794('0x8')]('/',auth[_0x4794('0x9')](),controller[_0x4794('0xa')]);router[_0x4794('0x8')](_0x4794('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4794('0xc'),auth[_0x4794('0x9')](),controller[_0x4794('0xd')]);router[_0x4794('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4794('0xf'),_0x4794('0x10')),controller[_0x4794('0x11')]);router[_0x4794('0x12')](_0x4794('0xc'),controller[_0x4794('0x13')]);router['put'](_0x4794('0x14'),auth[_0x4794('0x9')](),controller[_0x4794('0x15')]);router[_0x4794('0x12')](_0x4794('0x16'),auth[_0x4794('0x9')](),controller[_0x4794('0x17')]);router[_0x4794('0x18')](_0x4794('0xc'),auth[_0x4794('0x9')](),controller[_0x4794('0x19')]);module[_0x4794('0x1a')]=router; \ No newline at end of file +var _0xb679=['put','/:id','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show','post','chat','chatmessage:create'];(function(_0x17b9af,_0x23f168){var _0x4c6041=function(_0xc8c897){while(--_0xc8c897){_0x17b9af['push'](_0x17b9af['shift']());}};_0x4c6041(++_0x23f168);}(_0xb679,0x127));var _0x9b67=function(_0x19411d,_0x1e7337){_0x19411d=_0x19411d-0x0;var _0x20f014=_0xb679[_0x19411d];return _0x20f014;};'use strict';var multer=require(_0x9b67('0x0'));var util=require(_0x9b67('0x1'));var path=require(_0x9b67('0x2'));var timeout=require(_0x9b67('0x3'));var express=require(_0x9b67('0x4'));var router=express[_0x9b67('0x5')]();var auth=require(_0x9b67('0x6'));var interaction=require(_0x9b67('0x7'));var config=require(_0x9b67('0x8'));var controller=require('./chatMessage.controller');router[_0x9b67('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b67('0xa')]);router[_0x9b67('0x9')]('/describe',auth[_0x9b67('0xb')](),controller[_0x9b67('0xc')]);router[_0x9b67('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9b67('0xd')]);router[_0x9b67('0xe')]('/',auth[_0x9b67('0xb')](),interaction['tracked'](_0x9b67('0xf'),_0x9b67('0x10')),controller['create']);router[_0x9b67('0x11')](_0x9b67('0x12'),controller['update']);router['put'](_0x9b67('0x13'),auth[_0x9b67('0xb')](),controller[_0x9b67('0x14')]);router[_0x9b67('0x11')](_0x9b67('0x15'),auth[_0x9b67('0xb')](),controller[_0x9b67('0x16')]);router['delete'](_0x9b67('0x12'),auth[_0x9b67('0xb')](),controller[_0x9b67('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 52dd7a9..8b91f34 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 _0x6782=['TEXT','medium','sequelize'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6782,0xdd));var _0x2678=function(_0x3cf0a4,_0x2f96f0){_0x3cf0a4=_0x3cf0a4-0x0;var _0x4190e7=_0x6782[_0x3cf0a4];return _0x4190e7;};'use strict';var Sequelize=require(_0x2678('0x0'));module['exports']={'body':{'type':Sequelize[_0x2678('0x1')](_0x2678('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x1cda=['TEXT','sequelize','exports'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0x1cda,0x91));var _0xa1cd=function(_0x1854d4,_0x12d839){_0x1854d4=_0x1854d4-0x0;var _0x34deb8=_0x1cda[_0x1854d4];return _0x34deb8;};'use strict';var Sequelize=require(_0xa1cd('0x0'));module[_0xa1cd('0x1')]={'body':{'type':Sequelize[_0xa1cd('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7280e97..cb28c0e 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 _0xbf13=['query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','filter','merge','map','key','field','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','error','name','send','ChatOfflineMessage','rawAttributes','keys'];(function(_0x51f311,_0x1e30ee){var _0xb32ac=function(_0xd9bd1d){while(--_0xd9bd1d){_0x51f311['push'](_0x51f311['shift']());}};_0xb32ac(++_0x1e30ee);}(_0xbf13,0xe2));var _0x3bf1=function(_0x2f43ee,_0x16f002){_0x2f43ee=_0x2f43ee-0x0;var _0x22fc22=_0xbf13[_0x2f43ee];return _0x22fc22;};'use strict';var pdf=require(_0x3bf1('0x0'));var emlformat=require(_0x3bf1('0x1'));var rimraf=require(_0x3bf1('0x2'));var zipdir=require(_0x3bf1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3bf1('0x4'));var BPromise=require(_0x3bf1('0x5'));var Mustache=require('mustache');var util=require(_0x3bf1('0x6'));var path=require(_0x3bf1('0x7'));var sox=require(_0x3bf1('0x8'));var csv=require(_0x3bf1('0x9'));var ejs=require(_0x3bf1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3bf1('0xb'));var jsforce=require(_0x3bf1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bf1('0x9'));var querystring=require(_0x3bf1('0xd'));var Papa=require(_0x3bf1('0xe'));var Redis=require(_0x3bf1('0xf'));var authService=require(_0x3bf1('0x10'));var qs=require(_0x3bf1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3bf1('0x12'));var utils=require(_0x3bf1('0x13'));var config=require('../../config/environment');var db=require(_0x3bf1('0x14'))['db'];function respondWithStatusCode(_0x5abcec,_0x2c8297){_0x2c8297=_0x2c8297||0xcc;return function(_0x237b02){if(_0x237b02){return _0x5abcec[_0x3bf1('0x15')](_0x2c8297);}return _0x5abcec[_0x3bf1('0x16')](_0x2c8297)[_0x3bf1('0x17')]();};}function respondWithResult(_0x2cebfb,_0x4c1a3c){_0x4c1a3c=_0x4c1a3c||0xc8;return function(_0x5ddb37){if(_0x5ddb37){return _0x2cebfb[_0x3bf1('0x16')](_0x4c1a3c)[_0x3bf1('0x18')](_0x5ddb37);}};}function respondWithFilteredResult(_0x3e8405,_0x124e01){return function(_0x2b7974){if(_0x2b7974){var _0x40335f=_0x2b7974[_0x3bf1('0x19')],_0xdc7282=_0x124e01[_0x3bf1('0x1a')],_0x863c2e=_0x124e01[_0x3bf1('0x1a')]+_0x124e01[_0x3bf1('0x1b')],_0x43e714;if(_0x863c2e>=_0x40335f){_0x863c2e=_0x40335f;_0x43e714=0xc8;}else{_0x43e714=0xce;}_0x3e8405[_0x3bf1('0x16')](_0x43e714);return _0x3e8405['set']('Content-Range',_0xdc7282+'-'+_0x863c2e+'/'+_0x40335f)[_0x3bf1('0x18')](_0x2b7974);}return null;};}function patchUpdates(_0x2b6fe1){return function(_0x140e51){try{jsonpatch['apply'](_0x140e51,_0x2b6fe1,!![]);}catch(_0x5a6b90){return BPromise[_0x3bf1('0x1c')](_0x5a6b90);}return _0x140e51[_0x3bf1('0x1d')]();};}function saveUpdates(_0x103b68,_0x13f371){return function(_0x45ed73){if(_0x45ed73){return _0x45ed73[_0x3bf1('0x1e')](_0x103b68)[_0x3bf1('0x1f')](function(_0x208b6b){return _0x208b6b;});}return null;};}function removeEntity(_0x306d67,_0x297128){return function(_0x1b8ae9){if(_0x1b8ae9){return _0x1b8ae9['destroy']()['then'](function(){_0x306d67[_0x3bf1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331cee,_0x4f8ec8){return function(_0x58a2a6){if(!_0x58a2a6){_0x331cee[_0x3bf1('0x15')](0x194);}return _0x58a2a6;};}function handleError(_0x1f97f7,_0x34e572){_0x34e572=_0x34e572||0x1f4;return function(_0x21aee4){logger[_0x3bf1('0x20')](_0x21aee4['stack']);if(_0x21aee4[_0x3bf1('0x21')]){delete _0x21aee4['name'];}_0x1f97f7[_0x3bf1('0x16')](_0x34e572)[_0x3bf1('0x22')](_0x21aee4);};}exports['index']=function(_0x4dc3ce,_0x3a691d){var _0x2e4905={},_0x20db42={},_0x45b204={'count':0x0,'rows':[]};var _0x589a49=db[_0x3bf1('0x23')][_0x3bf1('0x24')];_0x20db42['model']=_[_0x3bf1('0x25')](_0x589a49);_0x20db42[_0x3bf1('0x26')]=_[_0x3bf1('0x25')](_0x4dc3ce[_0x3bf1('0x26')]);_0x20db42[_0x3bf1('0x27')]=_[_0x3bf1('0x28')](_0x20db42['model'],_0x20db42[_0x3bf1('0x26')]);_0x2e4905['attributes']=_[_0x3bf1('0x28')](_0x20db42[_0x3bf1('0x29')],qs['fields'](_0x4dc3ce['query'][_0x3bf1('0x2a')]));_0x2e4905[_0x3bf1('0x2b')]=_0x2e4905[_0x3bf1('0x2b')]['length']?_0x2e4905[_0x3bf1('0x2b')]:_0x20db42[_0x3bf1('0x29')];if(!_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x2c')](_0x3bf1('0x2d'))){_0x2e4905['limit']=qs['limit'](_0x4dc3ce['query'][_0x3bf1('0x1b')]);_0x2e4905[_0x3bf1('0x1a')]=qs['offset'](_0x4dc3ce['query'][_0x3bf1('0x1a')]);}_0x2e4905[_0x3bf1('0x2e')]=qs['sort'](_0x4dc3ce['query']['sort']);_0x2e4905[_0x3bf1('0x2f')]=qs[_0x3bf1('0x27')](_['pick'](_0x4dc3ce[_0x3bf1('0x26')],_0x20db42[_0x3bf1('0x27')]));if(_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x30')]){_0x2e4905[_0x3bf1('0x2f')]=_[_0x3bf1('0x31')](_0x2e4905[_0x3bf1('0x2f')],{'$or':_[_0x3bf1('0x32')](_0x589a49,function(_0x3af076){if(_0x3af076['type'][_0x3bf1('0x33')]!=='VIRTUAL'){var _0x3340b={};_0x3340b[_0x3af076[_0x3bf1('0x34')]]={'$like':'%'+_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x30')]+'%'};return _0x3340b;}})});}_0x2e4905=_[_0x3bf1('0x31')]({},_0x2e4905,_0x4dc3ce[_0x3bf1('0x35')]);var _0x4ff066={'where':_0x2e4905[_0x3bf1('0x2f')]};return db['ChatOfflineMessage'][_0x3bf1('0x19')](_0x4ff066)[_0x3bf1('0x1f')](function(_0x3cad0d){_0x45b204[_0x3bf1('0x19')]=_0x3cad0d;if(_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x36')]){_0x2e4905[_0x3bf1('0x37')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x3bf1('0x38')](_0x2e4905);})[_0x3bf1('0x1f')](function(_0x3a4c45){_0x45b204[_0x3bf1('0x39')]=_0x3a4c45;return _0x45b204;})[_0x3bf1('0x1f')](respondWithFilteredResult(_0x3a691d,_0x2e4905))['catch'](handleError(_0x3a691d,null));};exports['show']=function(_0x56d0a9,_0x7e9b9){var _0x5010f9={'raw':!![],'where':{'id':_0x56d0a9[_0x3bf1('0x3a')]['id']}},_0x378d59={};_0x378d59[_0x3bf1('0x29')]=_[_0x3bf1('0x25')](db[_0x3bf1('0x23')][_0x3bf1('0x24')]);_0x378d59[_0x3bf1('0x26')]=_[_0x3bf1('0x25')](_0x56d0a9[_0x3bf1('0x26')]);_0x378d59['filters']=_[_0x3bf1('0x28')](_0x378d59[_0x3bf1('0x29')],_0x378d59['query']);_0x5010f9[_0x3bf1('0x2b')]=_['intersection'](_0x378d59[_0x3bf1('0x29')],qs[_0x3bf1('0x2a')](_0x56d0a9[_0x3bf1('0x26')]['fields']));_0x5010f9['attributes']=_0x5010f9[_0x3bf1('0x2b')][_0x3bf1('0x3b')]?_0x5010f9[_0x3bf1('0x2b')]:_0x378d59[_0x3bf1('0x29')];if(_0x56d0a9[_0x3bf1('0x26')][_0x3bf1('0x36')]){_0x5010f9['include']=[{'all':!![]}];}_0x5010f9=_[_0x3bf1('0x31')]({},_0x5010f9,_0x56d0a9[_0x3bf1('0x35')]);return db['ChatOfflineMessage'][_0x3bf1('0x3c')](_0x5010f9)[_0x3bf1('0x1f')](handleEntityNotFound(_0x7e9b9,null))[_0x3bf1('0x1f')](respondWithResult(_0x7e9b9,null))[_0x3bf1('0x3d')](handleError(_0x7e9b9,null));};exports[_0x3bf1('0x3e')]=function(_0x5b65e1,_0x2ba92e){return db['ChatOfflineMessage'][_0x3bf1('0x3e')](_0x5b65e1['body'],{})[_0x3bf1('0x1f')](respondWithResult(_0x2ba92e,0xc9))[_0x3bf1('0x3d')](handleError(_0x2ba92e,null));};exports[_0x3bf1('0x1e')]=function(_0xeac57c,_0x6e4b83){if(_0xeac57c[_0x3bf1('0x3f')]['id']){delete _0xeac57c[_0x3bf1('0x3f')]['id'];}return db[_0x3bf1('0x23')][_0x3bf1('0x3c')]({'where':{'id':_0xeac57c[_0x3bf1('0x3a')]['id']}})[_0x3bf1('0x1f')](handleEntityNotFound(_0x6e4b83,null))[_0x3bf1('0x1f')](saveUpdates(_0xeac57c['body'],null))[_0x3bf1('0x1f')](respondWithResult(_0x6e4b83,null))[_0x3bf1('0x3d')](handleError(_0x6e4b83,null));};exports[_0x3bf1('0x40')]=function(_0x154806,_0x50fe73){return db[_0x3bf1('0x23')][_0x3bf1('0x3c')]({'where':{'id':_0x154806[_0x3bf1('0x3a')]['id']}})[_0x3bf1('0x1f')](handleEntityNotFound(_0x50fe73,null))[_0x3bf1('0x1f')](removeEntity(_0x50fe73,null))[_0x3bf1('0x3d')](handleError(_0x50fe73,null));};exports[_0x3bf1('0x41')]=function(_0xef2c0e,_0x12135a){return db[_0x3bf1('0x23')]['describe']()[_0x3bf1('0x1f')](respondWithResult(_0x12135a,null))[_0x3bf1('0x3d')](handleError(_0x12135a,null));}; \ No newline at end of file +var _0xda20=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','update','destroy','then','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','VIRTUAL','field','options','includeAll','include','show','params','find','create','body','catch','describe','html-pdf','rimraf','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel'];(function(_0x272f43,_0x5840b5){var _0x32ea41=function(_0x5819f8){while(--_0x5819f8){_0x272f43['push'](_0x272f43['shift']());}};_0x32ea41(++_0x5840b5);}(_0xda20,0x1d9));var _0x0da2=function(_0x1107c0,_0x59e0ce){_0x1107c0=_0x1107c0-0x0;var _0x2da441=_0xda20[_0x1107c0];return _0x2da441;};'use strict';var pdf=require(_0x0da2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0da2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0da2('0x2'));var moment=require('moment');var BPromise=require(_0x0da2('0x3'));var Mustache=require(_0x0da2('0x4'));var util=require('util');var path=require(_0x0da2('0x5'));var sox=require(_0x0da2('0x6'));var csv=require('to-csv');var ejs=require(_0x0da2('0x7'));var fs=require('fs');var _=require(_0x0da2('0x8'));var squel=require(_0x0da2('0x9'));var crypto=require(_0x0da2('0xa'));var jsforce=require(_0x0da2('0xb'));var deskjs=require(_0x0da2('0xc'));var toCsv=require(_0x0da2('0xd'));var querystring=require(_0x0da2('0xe'));var Papa=require(_0x0da2('0xf'));var Redis=require('ioredis');var authService=require(_0x0da2('0x10'));var qs=require(_0x0da2('0x11'));var hardwareService=require(_0x0da2('0x12'));var logger=require(_0x0da2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0da2('0x14'));var db=require(_0x0da2('0x15'))['db'];function respondWithStatusCode(_0x8d21d1,_0x3e50d5){_0x3e50d5=_0x3e50d5||0xcc;return function(_0x19226a){if(_0x19226a){return _0x8d21d1[_0x0da2('0x16')](_0x3e50d5);}return _0x8d21d1[_0x0da2('0x17')](_0x3e50d5)['end']();};}function respondWithResult(_0x7dfc07,_0x570d68){_0x570d68=_0x570d68||0xc8;return function(_0x5496f5){if(_0x5496f5){return _0x7dfc07['status'](_0x570d68)[_0x0da2('0x18')](_0x5496f5);}};}function respondWithFilteredResult(_0x51bb68,_0x1e1e47){return function(_0x4cae2e){if(_0x4cae2e){var _0x5d0f4e=_0x4cae2e[_0x0da2('0x19')],_0xa0613c=_0x1e1e47[_0x0da2('0x1a')],_0x65f77=_0x1e1e47[_0x0da2('0x1a')]+_0x1e1e47['limit'],_0x52c310;if(_0x65f77>=_0x5d0f4e){_0x65f77=_0x5d0f4e;_0x52c310=0xc8;}else{_0x52c310=0xce;}_0x51bb68[_0x0da2('0x17')](_0x52c310);return _0x51bb68[_0x0da2('0x1b')]('Content-Range',_0xa0613c+'-'+_0x65f77+'/'+_0x5d0f4e)['json'](_0x4cae2e);}return null;};}function patchUpdates(_0x2e0f4e){return function(_0x500bf4){try{jsonpatch[_0x0da2('0x1c')](_0x500bf4,_0x2e0f4e,!![]);}catch(_0x569834){return BPromise['reject'](_0x569834);}return _0x500bf4['save']();};}function saveUpdates(_0x5cf40a,_0x109645){return function(_0x1d685c){if(_0x1d685c){return _0x1d685c[_0x0da2('0x1d')](_0x5cf40a)['then'](function(_0x5304af){return _0x5304af;});}return null;};}function removeEntity(_0x52367c,_0x1f22fe){return function(_0x2ce4c4){if(_0x2ce4c4){return _0x2ce4c4[_0x0da2('0x1e')]()[_0x0da2('0x1f')](function(){_0x52367c[_0x0da2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a3708,_0x113c40){return function(_0x1c3ab0){if(!_0x1c3ab0){_0x7a3708[_0x0da2('0x16')](0x194);}return _0x1c3ab0;};}function handleError(_0x336c76,_0x333835){_0x333835=_0x333835||0x1f4;return function(_0x3ae5a0){logger[_0x0da2('0x20')](_0x3ae5a0[_0x0da2('0x21')]);if(_0x3ae5a0['name']){delete _0x3ae5a0[_0x0da2('0x22')];}_0x336c76['status'](_0x333835)[_0x0da2('0x23')](_0x3ae5a0);};}exports[_0x0da2('0x24')]=function(_0x2aa651,_0x3c0fb0){var _0x4b9333={},_0x1e9ac4={},_0x2a931d={'count':0x0,'rows':[]};var _0x2ea8c2=db[_0x0da2('0x25')][_0x0da2('0x26')];_0x1e9ac4['model']=_[_0x0da2('0x27')](_0x2ea8c2);_0x1e9ac4['query']=_[_0x0da2('0x27')](_0x2aa651[_0x0da2('0x28')]);_0x1e9ac4[_0x0da2('0x29')]=_[_0x0da2('0x2a')](_0x1e9ac4[_0x0da2('0x2b')],_0x1e9ac4[_0x0da2('0x28')]);_0x4b9333[_0x0da2('0x2c')]=_[_0x0da2('0x2a')](_0x1e9ac4[_0x0da2('0x2b')],qs[_0x0da2('0x2d')](_0x2aa651[_0x0da2('0x28')]['fields']));_0x4b9333['attributes']=_0x4b9333['attributes'][_0x0da2('0x2e')]?_0x4b9333[_0x0da2('0x2c')]:_0x1e9ac4['model'];if(!_0x2aa651['query'][_0x0da2('0x2f')](_0x0da2('0x30'))){_0x4b9333[_0x0da2('0x31')]=qs[_0x0da2('0x31')](_0x2aa651['query'][_0x0da2('0x31')]);_0x4b9333['offset']=qs[_0x0da2('0x1a')](_0x2aa651[_0x0da2('0x28')][_0x0da2('0x1a')]);}_0x4b9333[_0x0da2('0x32')]=qs[_0x0da2('0x33')](_0x2aa651[_0x0da2('0x28')][_0x0da2('0x33')]);_0x4b9333['where']=qs[_0x0da2('0x29')](_[_0x0da2('0x34')](_0x2aa651[_0x0da2('0x28')],_0x1e9ac4[_0x0da2('0x29')]));if(_0x2aa651[_0x0da2('0x28')][_0x0da2('0x35')]){_0x4b9333['where']=_[_0x0da2('0x36')](_0x4b9333[_0x0da2('0x37')],{'$or':_[_0x0da2('0x38')](_0x2ea8c2,function(_0x21caef){if(_0x21caef['type']['key']!==_0x0da2('0x39')){var _0x317e09={};_0x317e09[_0x21caef[_0x0da2('0x3a')]]={'$like':'%'+_0x2aa651[_0x0da2('0x28')][_0x0da2('0x35')]+'%'};return _0x317e09;}})});}_0x4b9333=_[_0x0da2('0x36')]({},_0x4b9333,_0x2aa651[_0x0da2('0x3b')]);var _0x306704={'where':_0x4b9333[_0x0da2('0x37')]};return db['ChatOfflineMessage'][_0x0da2('0x19')](_0x306704)[_0x0da2('0x1f')](function(_0x3b7959){_0x2a931d[_0x0da2('0x19')]=_0x3b7959;if(_0x2aa651[_0x0da2('0x28')][_0x0da2('0x3c')]){_0x4b9333[_0x0da2('0x3d')]=[{'all':!![]}];}return db[_0x0da2('0x25')]['findAll'](_0x4b9333);})[_0x0da2('0x1f')](function(_0x528907){_0x2a931d['rows']=_0x528907;return _0x2a931d;})[_0x0da2('0x1f')](respondWithFilteredResult(_0x3c0fb0,_0x4b9333))['catch'](handleError(_0x3c0fb0,null));};exports[_0x0da2('0x3e')]=function(_0xe16564,_0x365075){var _0x1b8d43={'raw':!![],'where':{'id':_0xe16564[_0x0da2('0x3f')]['id']}},_0x5eb2e9={};_0x5eb2e9[_0x0da2('0x2b')]=_[_0x0da2('0x27')](db[_0x0da2('0x25')][_0x0da2('0x26')]);_0x5eb2e9[_0x0da2('0x28')]=_[_0x0da2('0x27')](_0xe16564[_0x0da2('0x28')]);_0x5eb2e9['filters']=_['intersection'](_0x5eb2e9[_0x0da2('0x2b')],_0x5eb2e9['query']);_0x1b8d43[_0x0da2('0x2c')]=_['intersection'](_0x5eb2e9[_0x0da2('0x2b')],qs['fields'](_0xe16564['query']['fields']));_0x1b8d43[_0x0da2('0x2c')]=_0x1b8d43[_0x0da2('0x2c')][_0x0da2('0x2e')]?_0x1b8d43[_0x0da2('0x2c')]:_0x5eb2e9['model'];if(_0xe16564[_0x0da2('0x28')]['includeAll']){_0x1b8d43[_0x0da2('0x3d')]=[{'all':!![]}];}_0x1b8d43=_[_0x0da2('0x36')]({},_0x1b8d43,_0xe16564['options']);return db[_0x0da2('0x25')][_0x0da2('0x40')](_0x1b8d43)[_0x0da2('0x1f')](handleEntityNotFound(_0x365075,null))[_0x0da2('0x1f')](respondWithResult(_0x365075,null))['catch'](handleError(_0x365075,null));};exports[_0x0da2('0x41')]=function(_0x3b0e28,_0x4c2111){return db[_0x0da2('0x25')][_0x0da2('0x41')](_0x3b0e28[_0x0da2('0x42')],{})[_0x0da2('0x1f')](respondWithResult(_0x4c2111,0xc9))['catch'](handleError(_0x4c2111,null));};exports[_0x0da2('0x1d')]=function(_0x5265f2,_0x17ec3f){if(_0x5265f2[_0x0da2('0x42')]['id']){delete _0x5265f2[_0x0da2('0x42')]['id'];}return db[_0x0da2('0x25')][_0x0da2('0x40')]({'where':{'id':_0x5265f2['params']['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x17ec3f,null))[_0x0da2('0x1f')](saveUpdates(_0x5265f2[_0x0da2('0x42')],null))[_0x0da2('0x1f')](respondWithResult(_0x17ec3f,null))['catch'](handleError(_0x17ec3f,null));};exports[_0x0da2('0x1e')]=function(_0x2b50b7,_0x2c9172){return db[_0x0da2('0x25')][_0x0da2('0x40')]({'where':{'id':_0x2b50b7['params']['id']}})[_0x0da2('0x1f')](handleEntityNotFound(_0x2c9172,null))[_0x0da2('0x1f')](removeEntity(_0x2c9172,null))[_0x0da2('0x43')](handleError(_0x2c9172,null));};exports[_0x0da2('0x44')]=function(_0x11d253,_0x2cf49d){return db[_0x0da2('0x25')]['describe']()[_0x0da2('0x1f')](respondWithResult(_0x2cf49d,null))['catch'](handleError(_0x2cf49d,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f4b0cc9..671f75f 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 _0x3911=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3404af,_0x1bb80e){var _0xb38180=function(_0x31b0d8){while(--_0x31b0d8){_0x3404af['push'](_0x3404af['shift']());}};_0xb38180(++_0x1bb80e);}(_0x3911,0x152));var _0x1391=function(_0x400f2a,_0x52a559){_0x400f2a=_0x400f2a-0x0;var _0x3dd8d1=_0x3911[_0x400f2a];return _0x3dd8d1;};'use strict';var _=require(_0x1391('0x0'));var util=require(_0x1391('0x1'));var logger=require('../../config/logger')(_0x1391('0x2'));var moment=require(_0x1391('0x3'));var BPromise=require(_0x1391('0x4'));var rp=require(_0x1391('0x5'));var fs=require('fs');var path=require(_0x1391('0x6'));var rimraf=require(_0x1391('0x7'));var config=require(_0x1391('0x8'));var attributes=require(_0x1391('0x9'));module[_0x1391('0xa')]=function(_0x2df393,_0x5d8183){return _0x2df393[_0x1391('0xb')](_0x1391('0xc'),attributes,{'tableName':_0x1391('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1391('0xe')});}; \ No newline at end of file +var _0x5baf=['util','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5baf,0xba));var _0xf5ba=function(_0x1291bd,_0x1f4c5c){_0x1291bd=_0x1291bd-0x0;var _0x1c1515=_0x5baf[_0x1291bd];return _0x1c1515;};'use strict';var _=require(_0xf5ba('0x0'));var util=require(_0xf5ba('0x1'));var logger=require('../../config/logger')(_0xf5ba('0x2'));var moment=require('moment');var BPromise=require(_0xf5ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5ba('0x4'));var rimraf=require('rimraf');var config=require(_0xf5ba('0x5'));var attributes=require(_0xf5ba('0x6'));module[_0xf5ba('0x7')]=function(_0x2f943c,_0xf2dda){return _0x2f943c[_0xf5ba('0x8')](_0xf5ba('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf5ba('0xa')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 29f94c2..6409cd9 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 _0x9b5d=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x9b5d,0x1a0));var _0xd9b5=function(_0x332f80,_0x3ec103){_0x332f80=_0x332f80-0x0;var _0x1f9127=_0x9b5d[_0x332f80];return _0x1f9127;};'use strict';var _=require(_0xd9b5('0x0'));var util=require(_0xd9b5('0x1'));var moment=require(_0xd9b5('0x2'));var BPromise=require(_0xd9b5('0x3'));var rs=require(_0xd9b5('0x4'));var fs=require('fs');var Redis=require(_0xd9b5('0x5'));var db=require(_0xd9b5('0x6'))['db'];var utils=require(_0xd9b5('0x7'));var logger=require(_0xd9b5('0x8'))(_0xd9b5('0x9'));var config=require(_0xd9b5('0xa'));var jayson=require(_0xd9b5('0xb'));var client=jayson[_0xd9b5('0xc')][_0xd9b5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a60de,_0x5687e7,_0x13335d){return new BPromise(function(_0x2001f3,_0x5c8f32){return client[_0xd9b5('0xe')](_0x5a60de,_0x13335d)[_0xd9b5('0xf')](function(_0x2462b2){logger['info'](_0xd9b5('0x10'),_0x5687e7,_0xd9b5('0x11'));logger[_0xd9b5('0x12')](_0xd9b5('0x13'),_0x5687e7,'request\x20sent',JSON[_0xd9b5('0x14')](_0x2462b2));if(_0x2462b2[_0xd9b5('0x15')]){if(_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x16')]===0x1f4){logger[_0xd9b5('0x15')](_0xd9b5('0x10'),_0x5687e7,_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x17')]);return _0x5c8f32(_0x2462b2['error'][_0xd9b5('0x17')]);}logger['error'](_0xd9b5('0x10'),_0x5687e7,_0x2462b2[_0xd9b5('0x15')]['message']);return _0x2001f3(_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x17')]);}else{logger[_0xd9b5('0x18')](_0xd9b5('0x10'),_0x5687e7,'request\x20sent');_0x2001f3(_0x2462b2[_0xd9b5('0x19')][_0xd9b5('0x17')]);}})[_0xd9b5('0x1a')](function(_0x5e2dbb){logger['error'](_0xd9b5('0x10'),_0x5687e7,_0x5e2dbb);_0x5c8f32(_0x5e2dbb);});});} \ No newline at end of file +var _0xf3d7=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\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','http'];(function(_0x5de818,_0x7c4485){var _0x345670=function(_0x5e268d){while(--_0x5e268d){_0x5de818['push'](_0x5de818['shift']());}};_0x345670(++_0x7c4485);}(_0xf3d7,0x145));var _0x7f3d=function(_0x50d086,_0x4e96e0){_0x50d086=_0x50d086-0x0;var _0x2e9e27=_0xf3d7[_0x50d086];return _0x2e9e27;};'use strict';var _=require(_0x7f3d('0x0'));var util=require(_0x7f3d('0x1'));var moment=require(_0x7f3d('0x2'));var BPromise=require(_0x7f3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f3d('0x4'));var db=require(_0x7f3d('0x5'))['db'];var utils=require(_0x7f3d('0x6'));var logger=require(_0x7f3d('0x7'))(_0x7f3d('0x8'));var config=require(_0x7f3d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7f3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x371b30,_0x588d55,_0x199658){return new BPromise(function(_0x373fa9,_0x5260b1){return client[_0x7f3d('0xb')](_0x371b30,_0x199658)[_0x7f3d('0xc')](function(_0x4e6813){logger[_0x7f3d('0xd')](_0x7f3d('0xe'),_0x588d55,_0x7f3d('0xf'));logger[_0x7f3d('0x10')](_0x7f3d('0x11'),_0x588d55,_0x7f3d('0xf'),JSON[_0x7f3d('0x12')](_0x4e6813));if(_0x4e6813['error']){if(_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x14')]===0x1f4){logger[_0x7f3d('0x13')](_0x7f3d('0xe'),_0x588d55,_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);return _0x5260b1(_0x4e6813['error'][_0x7f3d('0x15')]);}logger[_0x7f3d('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x588d55,_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);return _0x373fa9(_0x4e6813[_0x7f3d('0x13')][_0x7f3d('0x15')]);}else{logger[_0x7f3d('0xd')](_0x7f3d('0xe'),_0x588d55,'request\x20sent');_0x373fa9(_0x4e6813[_0x7f3d('0x16')]['message']);}})[_0x7f3d('0x17')](function(_0x3d1f29){logger[_0x7f3d('0x13')](_0x7f3d('0xe'),_0x588d55,_0x3d1f29);_0x5260b1(_0x3d1f29);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index dcbcabc..4cc0728 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 _0xd51f=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','post','create','delete'];(function(_0x367072,_0x334fa9){var _0x26b208=function(_0x573872){while(--_0x573872){_0x367072['push'](_0x367072['shift']());}};_0x26b208(++_0x334fa9);}(_0xd51f,0xf0));var _0xfd51=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd51f[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require('path');var timeout=require(_0xfd51('0x2'));var express=require(_0xfd51('0x3'));var router=express['Router']();var auth=require(_0xfd51('0x4'));var interaction=require(_0xfd51('0x5'));var config=require('../../config/environment');var controller=require(_0xfd51('0x6'));router[_0xfd51('0x7')]('/',auth['isAuthenticated'](),controller[_0xfd51('0x8')]);router[_0xfd51('0x7')]('/describe',auth[_0xfd51('0x9')](),controller[_0xfd51('0xa')]);router[_0xfd51('0x7')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller['show']);router[_0xfd51('0xc')]('/',auth[_0xfd51('0x9')](),controller[_0xfd51('0xd')]);router['put'](_0xfd51('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfd51('0xe')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2cc1=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0xf79003,_0x5a9960){var _0x4bb39c=function(_0x2017eb){while(--_0x2017eb){_0xf79003['push'](_0xf79003['shift']());}};_0x4bb39c(++_0x5a9960);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x243c5c,_0x3dd30c){_0x243c5c=_0x243c5c-0x0;var _0x486e0f=_0x2cc1[_0x243c5c];return _0x486e0f;};'use strict';var multer=require(_0x12cc('0x0'));var util=require(_0x12cc('0x1'));var path=require(_0x12cc('0x2'));var timeout=require(_0x12cc('0x3'));var express=require(_0x12cc('0x4'));var router=express[_0x12cc('0x5')]();var auth=require(_0x12cc('0x6'));var interaction=require(_0x12cc('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x12cc('0x8')]('/',auth[_0x12cc('0x9')](),controller['index']);router['get'](_0x12cc('0xa'),auth[_0x12cc('0x9')](),controller[_0x12cc('0xb')]);router[_0x12cc('0x8')](_0x12cc('0xc'),auth[_0x12cc('0x9')](),controller[_0x12cc('0xd')]);router[_0x12cc('0xe')]('/',auth[_0x12cc('0x9')](),controller[_0x12cc('0xf')]);router[_0x12cc('0x10')](_0x12cc('0xc'),auth[_0x12cc('0x9')](),controller['update']);router[_0x12cc('0x11')]('/:id',auth[_0x12cc('0x9')](),controller[_0x12cc('0x12')]);module[_0x12cc('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1abff66..efdf7a2 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 _0x7a03=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x223212,_0x5da8ea){var _0x5de9ad=function(_0x2115f4){while(--_0x2115f4){_0x223212['push'](_0x223212['shift']());}};_0x5de9ad(++_0x5da8ea);}(_0x7a03,0x1b7));var _0x37a0=function(_0x398253,_0x347f5d){_0x398253=_0x398253-0x0;var _0x1dcb99=_0x7a03[_0x398253];return _0x1dcb99;};'use strict';var Sequelize=require(_0x37a0('0x0'));module[_0x37a0('0x1')]={'name':{'type':Sequelize[_0x37a0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x37a0('0x3')](_0x37a0('0x4'),_0x37a0('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x37a0('0x2')]},'timeout':{'type':Sequelize[_0x37a0('0x6')]}}; \ No newline at end of file +var _0x4b67=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x1a8c32,_0x43baa6){var _0x37643c=function(_0x35c084){while(--_0x35c084){_0x1a8c32['push'](_0x1a8c32['shift']());}};_0x37643c(++_0x43baa6);}(_0x4b67,0x1f0));var _0x74b6=function(_0x5f8e70,_0x5f50f8){_0x5f8e70=_0x5f8e70-0x0;var _0x5ebd10=_0x4b67[_0x5f8e70];return _0x5ebd10;};'use strict';var Sequelize=require(_0x74b6('0x0'));module[_0x74b6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x74b6('0x2')](_0x74b6('0x3'),_0x74b6('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x74b6('0x5')]},'timeout':{'type':Sequelize[_0x74b6('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 9dd4c21..d9a7577 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 _0xe15b=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','show','params','model','ChatProactiveAction','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xe15b,0x98));var _0xbe15=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xe15b[_0x2a390b];return _0x5df10a;};'use strict';var pdf=require(_0xbe15('0x0'));var emlformat=require(_0xbe15('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbe15('0x2'));var jsonpatch=require(_0xbe15('0x3'));var rp=require(_0xbe15('0x4'));var moment=require(_0xbe15('0x5'));var BPromise=require(_0xbe15('0x6'));var Mustache=require(_0xbe15('0x7'));var util=require(_0xbe15('0x8'));var path=require(_0xbe15('0x9'));var sox=require(_0xbe15('0xa'));var csv=require(_0xbe15('0xb'));var ejs=require(_0xbe15('0xc'));var fs=require('fs');var _=require(_0xbe15('0xd'));var squel=require(_0xbe15('0xe'));var crypto=require(_0xbe15('0xf'));var jsforce=require(_0xbe15('0x10'));var deskjs=require(_0xbe15('0x11'));var toCsv=require(_0xbe15('0xb'));var querystring=require('querystring');var Papa=require(_0xbe15('0x12'));var Redis=require(_0xbe15('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbe15('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe15('0x15'))(_0xbe15('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbe15('0x17'))['db'];function respondWithStatusCode(_0x1e8a85,_0x1267e0){_0x1267e0=_0x1267e0||0xcc;return function(_0xf1daf7){if(_0xf1daf7){return _0x1e8a85['sendStatus'](_0x1267e0);}return _0x1e8a85[_0xbe15('0x18')](_0x1267e0)['end']();};}function respondWithResult(_0x4b43c1,_0x4c5381){_0x4c5381=_0x4c5381||0xc8;return function(_0x51cddc){if(_0x51cddc){return _0x4b43c1[_0xbe15('0x18')](_0x4c5381)[_0xbe15('0x19')](_0x51cddc);}};}function respondWithFilteredResult(_0x116b4e,_0x46bb03){return function(_0x5aa42e){if(_0x5aa42e){var _0x27e0ea=_0x5aa42e[_0xbe15('0x1a')],_0x46cac9=_0x46bb03[_0xbe15('0x1b')],_0x3cfa72=_0x46bb03[_0xbe15('0x1b')]+_0x46bb03[_0xbe15('0x1c')],_0xca72d6;if(_0x3cfa72>=_0x27e0ea){_0x3cfa72=_0x27e0ea;_0xca72d6=0xc8;}else{_0xca72d6=0xce;}_0x116b4e[_0xbe15('0x18')](_0xca72d6);return _0x116b4e[_0xbe15('0x1d')](_0xbe15('0x1e'),_0x46cac9+'-'+_0x3cfa72+'/'+_0x27e0ea)[_0xbe15('0x19')](_0x5aa42e);}return null;};}function patchUpdates(_0x1b64a5){return function(_0x52b314){try{jsonpatch[_0xbe15('0x1f')](_0x52b314,_0x1b64a5,!![]);}catch(_0x1f2393){return BPromise[_0xbe15('0x20')](_0x1f2393);}return _0x52b314[_0xbe15('0x21')]();};}function saveUpdates(_0x18ce71,_0x240894){return function(_0x3cfe0d){if(_0x3cfe0d){return _0x3cfe0d[_0xbe15('0x22')](_0x18ce71)['then'](function(_0x534a6f){return _0x534a6f;});}return null;};}function removeEntity(_0x2f51fd,_0x1c0299){return function(_0x2d8acb){if(_0x2d8acb){return _0x2d8acb[_0xbe15('0x23')]()[_0xbe15('0x24')](function(){_0x2f51fd['status'](0xcc)[_0xbe15('0x25')]();});}};}function handleEntityNotFound(_0x3a72c4,_0x24951f){return function(_0x20348e){if(!_0x20348e){_0x3a72c4[_0xbe15('0x26')](0x194);}return _0x20348e;};}function handleError(_0x328b36,_0x62f550){_0x62f550=_0x62f550||0x1f4;return function(_0x5b694d){logger[_0xbe15('0x27')](_0x5b694d['stack']);if(_0x5b694d[_0xbe15('0x28')]){delete _0x5b694d[_0xbe15('0x28')];}_0x328b36['status'](_0x62f550)[_0xbe15('0x29')](_0x5b694d);};}exports[_0xbe15('0x2a')]=function(_0x4da1e5,_0x584aa1){var _0x54ec0c={'raw':!![],'where':{'id':_0x4da1e5[_0xbe15('0x2b')]['id']}},_0x40c471={};_0x40c471[_0xbe15('0x2c')]=_['keys'](db[_0xbe15('0x2d')]['rawAttributes']);_0x40c471[_0xbe15('0x2e')]=_[_0xbe15('0x2f')](_0x4da1e5['query']);_0x40c471[_0xbe15('0x30')]=_[_0xbe15('0x31')](_0x40c471[_0xbe15('0x2c')],_0x40c471['query']);_0x54ec0c[_0xbe15('0x32')]=_['intersection'](_0x40c471[_0xbe15('0x2c')],qs['fields'](_0x4da1e5[_0xbe15('0x2e')][_0xbe15('0x33')]));_0x54ec0c[_0xbe15('0x32')]=_0x54ec0c['attributes'][_0xbe15('0x34')]?_0x54ec0c['attributes']:_0x40c471[_0xbe15('0x2c')];if(_0x4da1e5['query'][_0xbe15('0x35')]){_0x54ec0c['include']=[{'all':!![]}];}_0x54ec0c=_[_0xbe15('0x36')]({},_0x54ec0c,_0x4da1e5['options']);return db[_0xbe15('0x2d')][_0xbe15('0x37')](_0x54ec0c)[_0xbe15('0x24')](handleEntityNotFound(_0x584aa1,null))[_0xbe15('0x24')](respondWithResult(_0x584aa1,null))[_0xbe15('0x38')](handleError(_0x584aa1,null));};exports[_0xbe15('0x39')]=function(_0xc795f2,_0x6ea5f0){return db['ChatProactiveAction'][_0xbe15('0x39')](_0xc795f2[_0xbe15('0x3a')],{})['then'](respondWithResult(_0x6ea5f0,0xc9))[_0xbe15('0x38')](handleError(_0x6ea5f0,null));};exports[_0xbe15('0x22')]=function(_0x378bcb,_0x2870d7){if(_0x378bcb[_0xbe15('0x3a')]['id']){delete _0x378bcb[_0xbe15('0x3a')]['id'];}return db['ChatProactiveAction'][_0xbe15('0x37')]({'where':{'id':_0x378bcb['params']['id']}})['then'](handleEntityNotFound(_0x2870d7,null))[_0xbe15('0x24')](saveUpdates(_0x378bcb[_0xbe15('0x3a')],null))[_0xbe15('0x24')](respondWithResult(_0x2870d7,null))[_0xbe15('0x38')](handleError(_0x2870d7,null));};exports[_0xbe15('0x23')]=function(_0x2282e6,_0x5e0086){return db[_0xbe15('0x2d')]['find']({'where':{'id':_0x2282e6[_0xbe15('0x2b')]['id']}})[_0xbe15('0x24')](handleEntityNotFound(_0x5e0086,null))[_0xbe15('0x24')](removeEntity(_0x5e0086,null))['catch'](handleError(_0x5e0086,null));}; \ No newline at end of file +var _0xec66=['include','merge','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xec66,0x12a));var _0x6ec6=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xec66[_0x39caaa];return _0x9b9c7d;};'use strict';var pdf=require(_0x6ec6('0x0'));var emlformat=require(_0x6ec6('0x1'));var rimraf=require(_0x6ec6('0x2'));var zipdir=require(_0x6ec6('0x3'));var jsonpatch=require(_0x6ec6('0x4'));var rp=require(_0x6ec6('0x5'));var moment=require('moment');var BPromise=require(_0x6ec6('0x6'));var Mustache=require(_0x6ec6('0x7'));var util=require(_0x6ec6('0x8'));var path=require(_0x6ec6('0x9'));var sox=require(_0x6ec6('0xa'));var csv=require('to-csv');var ejs=require(_0x6ec6('0xb'));var fs=require('fs');var _=require(_0x6ec6('0xc'));var squel=require(_0x6ec6('0xd'));var crypto=require(_0x6ec6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ec6('0xf'));var querystring=require(_0x6ec6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6ec6('0x11'));var qs=require(_0x6ec6('0x12'));var hardwareService=require(_0x6ec6('0x13'));var logger=require(_0x6ec6('0x14'))(_0x6ec6('0x15'));var utils=require(_0x6ec6('0x16'));var config=require(_0x6ec6('0x17'));var db=require(_0x6ec6('0x18'))['db'];function respondWithStatusCode(_0xb2c12c,_0x476cfe){_0x476cfe=_0x476cfe||0xcc;return function(_0x5a3441){if(_0x5a3441){return _0xb2c12c['sendStatus'](_0x476cfe);}return _0xb2c12c[_0x6ec6('0x19')](_0x476cfe)[_0x6ec6('0x1a')]();};}function respondWithResult(_0x5a07d5,_0x28736e){_0x28736e=_0x28736e||0xc8;return function(_0x2a2e42){if(_0x2a2e42){return _0x5a07d5[_0x6ec6('0x19')](_0x28736e)[_0x6ec6('0x1b')](_0x2a2e42);}};}function respondWithFilteredResult(_0x3151ce,_0x305094){return function(_0x77d6c){if(_0x77d6c){var _0x531f10=_0x77d6c['count'],_0x2162fb=_0x305094[_0x6ec6('0x1c')],_0xcaecdf=_0x305094[_0x6ec6('0x1c')]+_0x305094[_0x6ec6('0x1d')],_0x5c21e9;if(_0xcaecdf>=_0x531f10){_0xcaecdf=_0x531f10;_0x5c21e9=0xc8;}else{_0x5c21e9=0xce;}_0x3151ce[_0x6ec6('0x19')](_0x5c21e9);return _0x3151ce['set'](_0x6ec6('0x1e'),_0x2162fb+'-'+_0xcaecdf+'/'+_0x531f10)[_0x6ec6('0x1b')](_0x77d6c);}return null;};}function patchUpdates(_0x3f57a1){return function(_0x3f6f3f){try{jsonpatch[_0x6ec6('0x1f')](_0x3f6f3f,_0x3f57a1,!![]);}catch(_0x4ef352){return BPromise[_0x6ec6('0x20')](_0x4ef352);}return _0x3f6f3f['save']();};}function saveUpdates(_0x7bbc5f,_0x553b0b){return function(_0x20e2ef){if(_0x20e2ef){return _0x20e2ef[_0x6ec6('0x21')](_0x7bbc5f)[_0x6ec6('0x22')](function(_0x563ced){return _0x563ced;});}return null;};}function removeEntity(_0x3663a0,_0x2d572b){return function(_0xf40137){if(_0xf40137){return _0xf40137[_0x6ec6('0x23')]()['then'](function(){_0x3663a0['status'](0xcc)[_0x6ec6('0x1a')]();});}};}function handleEntityNotFound(_0x55108b,_0x5e73d6){return function(_0x4fbc9e){if(!_0x4fbc9e){_0x55108b['sendStatus'](0x194);}return _0x4fbc9e;};}function handleError(_0x493987,_0x36c15b){_0x36c15b=_0x36c15b||0x1f4;return function(_0x1ddba7){logger[_0x6ec6('0x24')](_0x1ddba7[_0x6ec6('0x25')]);if(_0x1ddba7[_0x6ec6('0x26')]){delete _0x1ddba7[_0x6ec6('0x26')];}_0x493987[_0x6ec6('0x19')](_0x36c15b)['send'](_0x1ddba7);};}exports[_0x6ec6('0x27')]=function(_0xcaa8cd,_0x4376d8){var _0x1001c8={'raw':!![],'where':{'id':_0xcaa8cd['params']['id']}},_0x418ab1={};_0x418ab1['model']=_[_0x6ec6('0x28')](db[_0x6ec6('0x29')][_0x6ec6('0x2a')]);_0x418ab1[_0x6ec6('0x2b')]=_['keys'](_0xcaa8cd['query']);_0x418ab1[_0x6ec6('0x2c')]=_[_0x6ec6('0x2d')](_0x418ab1[_0x6ec6('0x2e')],_0x418ab1[_0x6ec6('0x2b')]);_0x1001c8[_0x6ec6('0x2f')]=_[_0x6ec6('0x2d')](_0x418ab1[_0x6ec6('0x2e')],qs['fields'](_0xcaa8cd[_0x6ec6('0x2b')][_0x6ec6('0x30')]));_0x1001c8['attributes']=_0x1001c8[_0x6ec6('0x2f')][_0x6ec6('0x31')]?_0x1001c8[_0x6ec6('0x2f')]:_0x418ab1[_0x6ec6('0x2e')];if(_0xcaa8cd[_0x6ec6('0x2b')]['includeAll']){_0x1001c8[_0x6ec6('0x32')]=[{'all':!![]}];}_0x1001c8=_[_0x6ec6('0x33')]({},_0x1001c8,_0xcaa8cd[_0x6ec6('0x34')]);return db[_0x6ec6('0x29')][_0x6ec6('0x35')](_0x1001c8)['then'](handleEntityNotFound(_0x4376d8,null))[_0x6ec6('0x22')](respondWithResult(_0x4376d8,null))[_0x6ec6('0x36')](handleError(_0x4376d8,null));};exports[_0x6ec6('0x37')]=function(_0x248174,_0x1fee12){return db[_0x6ec6('0x29')][_0x6ec6('0x37')](_0x248174['body'],{})['then'](respondWithResult(_0x1fee12,0xc9))[_0x6ec6('0x36')](handleError(_0x1fee12,null));};exports[_0x6ec6('0x21')]=function(_0x188b63,_0x8af5f4){if(_0x188b63[_0x6ec6('0x38')]['id']){delete _0x188b63[_0x6ec6('0x38')]['id'];}return db[_0x6ec6('0x29')][_0x6ec6('0x35')]({'where':{'id':_0x188b63[_0x6ec6('0x39')]['id']}})['then'](handleEntityNotFound(_0x8af5f4,null))[_0x6ec6('0x22')](saveUpdates(_0x188b63[_0x6ec6('0x38')],null))[_0x6ec6('0x22')](respondWithResult(_0x8af5f4,null))[_0x6ec6('0x36')](handleError(_0x8af5f4,null));};exports[_0x6ec6('0x23')]=function(_0x1c1e4b,_0x19b641){return db[_0x6ec6('0x29')][_0x6ec6('0x35')]({'where':{'id':_0x1c1e4b[_0x6ec6('0x39')]['id']}})['then'](handleEntityNotFound(_0x19b641,null))[_0x6ec6('0x22')](removeEntity(_0x19b641,null))[_0x6ec6('0x36')](handleError(_0x19b641,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index f33de3b..8a7c68e 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 _0xf61f=['api','moment','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0xf61f,0x1a0));var _0xff61=function(_0x17c64b,_0x38ae9c){_0x17c64b=_0x17c64b-0x0;var _0x5ca37f=_0xf61f[_0x17c64b];return _0x5ca37f;};'use strict';var _=require(_0xff61('0x0'));var util=require(_0xff61('0x1'));var logger=require('../../config/logger')(_0xff61('0x2'));var moment=require(_0xff61('0x3'));var BPromise=require('bluebird');var rp=require(_0xff61('0x4'));var fs=require('fs');var path=require(_0xff61('0x5'));var rimraf=require(_0xff61('0x6'));var config=require('../../config/environment');var attributes=require(_0xff61('0x7'));module[_0xff61('0x8')]=function(_0x31c6a3,_0x315409){return _0x31c6a3[_0xff61('0x9')](_0xff61('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae87=['bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x167bfe,_0x3aced5){var _0x12d0fb=function(_0x3e5cd5){while(--_0x3e5cd5){_0x167bfe['push'](_0x167bfe['shift']());}};_0x12d0fb(++_0x3aced5);}(_0xae87,0x141));var _0x7ae8=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0xae87[_0x326e79];return _0x37eb89;};'use strict';var _=require(_0x7ae8('0x0'));var util=require(_0x7ae8('0x1'));var logger=require(_0x7ae8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7ae8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ae8('0x4'));var attributes=require(_0x7ae8('0x5'));module[_0x7ae8('0x6')]=function(_0x800673,_0x32c06a){return _0x800673[_0x7ae8('0x7')](_0x7ae8('0x8'),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 1a5add1..92f1b44 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1bd5c9,_0x247071){var _0x36fbfe=function(_0x4c6ac1){while(--_0x4c6ac1){_0x1bd5c9['push'](_0x1bd5c9['shift']());}};_0x36fbfe(++_0x247071);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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']('ChatProactiveAction,\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','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x27e0d6,_0x15bc55){var _0x1a5282=function(_0x5c45fc){while(--_0x5c45fc){_0x27e0d6['push'](_0x27e0d6['shift']());}};_0x1a5282(++_0x15bc55);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('ChatProactiveAction,\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/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e4f6513..de23305 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 _0xdd6e=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','create','put','/:id','exports','multer','util','path'];(function(_0x126afc,_0x23081a){var _0x23f312=function(_0x1d5f97){while(--_0x1d5f97){_0x126afc['push'](_0x126afc['shift']());}};_0x23f312(++_0x23081a);}(_0xdd6e,0xa5));var _0xedd6=function(_0x362ec1,_0x469c93){_0x362ec1=_0x362ec1-0x0;var _0x294231=_0xdd6e[_0x362ec1];return _0x294231;};'use strict';var multer=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var path=require(_0xedd6('0x2'));var timeout=require(_0xedd6('0x3'));var express=require('express');var router=express[_0xedd6('0x4')]();var auth=require(_0xedd6('0x5'));var interaction=require(_0xedd6('0x6'));var config=require(_0xedd6('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xedd6('0x8')](),controller[_0xedd6('0x9')]);router['post']('/',auth[_0xedd6('0x8')](),controller[_0xedd6('0xa')]);router[_0xedd6('0xb')](_0xedd6('0xc'),auth[_0xedd6('0x8')](),controller['update']);router['delete'](_0xedd6('0xc'),auth[_0xedd6('0x8')](),controller['destroy']);module[_0xedd6('0xd')]=router; \ No newline at end of file +var _0x36ee=['/:id','isAuthenticated','show','post','put','update','delete','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x3e3217,_0x518c13){var _0x425fac=function(_0x22a925){while(--_0x22a925){_0x3e3217['push'](_0x3e3217['shift']());}};_0x425fac(++_0x518c13);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')](_0xe36e('0x8'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0xb')]('/',auth[_0xe36e('0x9')](),controller['create']);router[_0xe36e('0xc')]('/:id',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['destroy']);module[_0xe36e('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a667f71..1cedc02 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 _0x895c=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x895c,0x6a));var _0xc895=function(_0x4cf119,_0x139f57){_0x4cf119=_0x4cf119-0x0;var _0x5e7171=_0x895c[_0x4cf119];return _0x5e7171;};'use strict';var Sequelize=require(_0xc895('0x0'));module['exports']={'name':{'type':Sequelize[_0xc895('0x1')],'unique':_0xc895('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc895('0x1')]},'timeout':{'type':Sequelize[_0xc895('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc895('0x4')](_0xc895('0x5'),_0xc895('0x6'),_0xc895('0x7'))}}; \ No newline at end of file +var _0x6169=['STRING','rrmemory','roundrobin','sequelize','name'];(function(_0x3222f9,_0x4ce984){var _0x4a13b5=function(_0x49cdc4){while(--_0x49cdc4){_0x3222f9['push'](_0x3222f9['shift']());}};_0x4a13b5(++_0x4ce984);}(_0x6169,0x143));var _0x9616=function(_0x321281,_0x2a1dee){_0x321281=_0x321281-0x0;var _0x201640=_0x6169[_0x321281];return _0x201640;};'use strict';var Sequelize=require(_0x9616('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9616('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9616('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9616('0x3'),'beepall',_0x9616('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index a4385a6..3500d15 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 _0xd472=['emit','getAgents','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','map','User','findAndCountAll','UserId','agent','createdAt','rows','%s/%s','SIP','chatPause','updatedAt','Team','getTeams','teams','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray'];(function(_0x2ffdd3,_0x2c4286){var _0x1204ac=function(_0x515f10){while(--_0x515f10){_0x2ffdd3['push'](_0x2ffdd3['shift']());}};_0x1204ac(++_0x2c4286);}(_0xd472,0x1be));var _0x2d47=function(_0x29b326,_0x30c2b5){_0x29b326=_0x29b326-0x0;var _0xf6c8e9=_0xd472[_0x29b326];return _0xf6c8e9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d47('0x0'));var jsonpatch=require(_0x2d47('0x1'));var rp=require('request-promise');var moment=require(_0x2d47('0x2'));var BPromise=require(_0x2d47('0x3'));var Mustache=require('mustache');var util=require(_0x2d47('0x4'));var path=require(_0x2d47('0x5'));var sox=require(_0x2d47('0x6'));var csv=require(_0x2d47('0x7'));var ejs=require(_0x2d47('0x8'));var fs=require('fs');var _=require(_0x2d47('0x9'));var squel=require(_0x2d47('0xa'));var crypto=require(_0x2d47('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2d47('0xc'));var toCsv=require(_0x2d47('0x7'));var querystring=require(_0x2d47('0xd'));var Papa=require(_0x2d47('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d47('0xf'));var hardwareService=require(_0x2d47('0x10'));var logger=require(_0x2d47('0x11'))('api');var utils=require(_0x2d47('0x12'));var config=require(_0x2d47('0x13'));var db=require('../../mysqldb')['db'];config[_0x2d47('0x14')]=_[_0x2d47('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d47('0x16'))(new Redis(config['redis']));require(_0x2d47('0x17'))[_0x2d47('0x18')](socket);var jayson=require(_0x2d47('0x19'));var client=jayson[_0x2d47('0x1a')][_0x2d47('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5a7386,_0x50a4cc,_0xed2339){if(_0xed2339){var _0x4a27d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a27d7['test'](_0x50a4cc)){return _0x5a7386;}else{throw new Error(_0x2d47('0x1c'));}}else{return _0x5a7386;}}function respondWithRpcPromise(_0x7b46cf,_0x243902,_0x1b4654,_0x3a39b6){return new BPromise(function(_0x4b6a0c,_0x2d8949){var _0x55fca1=_0x3a39b6||client;return _0x55fca1[_0x2d47('0x1d')](_0x7b46cf,_0x1b4654)['then'](function(_0x237c32){logger['info'](_0x2d47('0x1e'),_0x243902,_0x2d47('0x1f'));logger['debug'](_0x2d47('0x20'),_0x243902,_0x2d47('0x1f'),JSON[_0x2d47('0x21')](_0x237c32));if(_0x237c32[_0x2d47('0x22')]){if(_0x237c32['error'][_0x2d47('0x23')]===0x1f4){logger[_0x2d47('0x22')](_0x2d47('0x1e'),_0x243902,_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);return _0x2d8949(_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);}logger[_0x2d47('0x22')](_0x2d47('0x1e'),_0x243902,_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);return _0x4b6a0c(_0x237c32['error']['message']);}else{logger[_0x2d47('0x25')](_0x2d47('0x1e'),_0x243902,_0x2d47('0x1f'));_0x4b6a0c(_0x237c32['result'][_0x2d47('0x24')]);}})[_0x2d47('0x26')](function(_0x27482f){logger[_0x2d47('0x22')]('ChatQueue,\x20%s,\x20%s',_0x243902,_0x27482f);_0x2d8949(_0x27482f);});});}function respondWithStatusCode(_0x2e4b4d,_0x2bb6e7){_0x2bb6e7=_0x2bb6e7||0xcc;return function(_0x46c7bb){if(_0x46c7bb){return _0x2e4b4d[_0x2d47('0x27')](_0x2bb6e7);}return _0x2e4b4d[_0x2d47('0x28')](_0x2bb6e7)[_0x2d47('0x29')]();};}function respondWithResult(_0x56fb3d,_0x2b86f7){_0x2b86f7=_0x2b86f7||0xc8;return function(_0x10fcc6){if(_0x10fcc6){return _0x56fb3d[_0x2d47('0x28')](_0x2b86f7)[_0x2d47('0x2a')](_0x10fcc6);}};}function respondWithFilteredResult(_0x55018a,_0x8c9422){return function(_0x434630){if(_0x434630){var _0x557d90=_0x434630[_0x2d47('0x2b')],_0xa16697=_0x8c9422[_0x2d47('0x2c')],_0xb6b4e8=_0x8c9422[_0x2d47('0x2c')]+_0x8c9422[_0x2d47('0x2d')],_0x3b84c2;if(_0xb6b4e8>=_0x557d90){_0xb6b4e8=_0x557d90;_0x3b84c2=0xc8;}else{_0x3b84c2=0xce;}_0x55018a[_0x2d47('0x28')](_0x3b84c2);return _0x55018a['set'](_0x2d47('0x2e'),_0xa16697+'-'+_0xb6b4e8+'/'+_0x557d90)['json'](_0x434630);}return null;};}function patchUpdates(_0x26c917){return function(_0x9c731d){try{jsonpatch[_0x2d47('0x2f')](_0x9c731d,_0x26c917,!![]);}catch(_0x11983b){return BPromise[_0x2d47('0x30')](_0x11983b);}return _0x9c731d['save']();};}function saveUpdates(_0x45a8cb,_0x19d585){return function(_0x57515a){if(_0x57515a){return _0x57515a[_0x2d47('0x31')](_0x45a8cb)[_0x2d47('0x32')](function(_0x428d3a){return _0x428d3a;});}return null;};}function removeEntity(_0x2b9382,_0x17be5){return function(_0x2217ca){if(_0x2217ca){return _0x2217ca[_0x2d47('0x33')]()[_0x2d47('0x32')](function(){var _0x273b9b=_0x2217ca[_0x2d47('0x34')]({'plain':!![]});var _0x4fe959=_0x2d47('0x35');return db[_0x2d47('0x36')][_0x2d47('0x33')]({'where':{'type':_0x4fe959,'resourceId':_0x273b9b['id']}})[_0x2d47('0x32')](function(){return _0x2217ca;});})[_0x2d47('0x32')](function(){_0x2b9382['status'](0xcc)[_0x2d47('0x29')]();});}};}function handleEntityNotFound(_0x4ab620,_0x290e76){return function(_0x391062){if(!_0x391062){_0x4ab620[_0x2d47('0x27')](0x194);}return _0x391062;};}function handleError(_0x5349b6,_0x4541c1){_0x4541c1=_0x4541c1||0x1f4;return function(_0x1f160c){logger[_0x2d47('0x22')](_0x1f160c[_0x2d47('0x37')]);if(_0x1f160c[_0x2d47('0x38')]){delete _0x1f160c['name'];}_0x5349b6[_0x2d47('0x28')](_0x4541c1)[_0x2d47('0x39')](_0x1f160c);};}exports[_0x2d47('0x3a')]=function(_0x320c91,_0x145ca6){var _0x6527e6={},_0x1426b7={},_0xde5158={'count':0x0,'rows':[]};var _0x16a519=db[_0x2d47('0x3b')][_0x2d47('0x3c')];_0x1426b7[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](_0x16a519);_0x1426b7['query']=_[_0x2d47('0x3e')](_0x320c91[_0x2d47('0x3f')]);_0x1426b7[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1426b7[_0x2d47('0x3d')],_0x1426b7['query']);_0x6527e6[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x1426b7['model'],qs[_0x2d47('0x43')](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x6527e6[_0x2d47('0x42')]=_0x6527e6[_0x2d47('0x42')][_0x2d47('0x44')]?_0x6527e6[_0x2d47('0x42')]:_0x1426b7[_0x2d47('0x3d')];if(!_0x320c91[_0x2d47('0x3f')][_0x2d47('0x45')](_0x2d47('0x46'))){_0x6527e6['limit']=qs['limit'](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x6527e6[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x2c')]);}_0x6527e6['order']=qs[_0x2d47('0x47')](_0x320c91['query']['sort']);_0x6527e6[_0x2d47('0x48')]=qs[_0x2d47('0x40')](_[_0x2d47('0x49')](_0x320c91[_0x2d47('0x3f')],_0x1426b7[_0x2d47('0x40')]));if(_0x320c91[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x6527e6[_0x2d47('0x48')]=_[_0x2d47('0x4b')](_0x6527e6[_0x2d47('0x48')],{'$or':_['map'](_0x16a519,function(_0x44bb22){if(_0x44bb22['type'][_0x2d47('0x4c')]!==_0x2d47('0x4d')){var _0x136042={};_0x136042[_0x44bb22['field']]={'$like':'%'+_0x320c91[_0x2d47('0x3f')][_0x2d47('0x4a')]+'%'};return _0x136042;}})});}_0x6527e6=_[_0x2d47('0x4b')]({},_0x6527e6,_0x320c91[_0x2d47('0x4e')]);var _0x314189={'where':_0x6527e6['where']};return db[_0x2d47('0x3b')]['count'](_0x314189)[_0x2d47('0x32')](function(_0x4d8ea1){_0xde5158[_0x2d47('0x2b')]=_0x4d8ea1;if(_0x320c91['query'][_0x2d47('0x4f')]){_0x6527e6[_0x2d47('0x50')]=[{'all':!![]}];}return db[_0x2d47('0x3b')]['findAll'](_0x6527e6);})[_0x2d47('0x32')](function(_0x1d09ea){_0xde5158['rows']=_0x1d09ea;return _0xde5158;})[_0x2d47('0x32')](respondWithFilteredResult(_0x145ca6,_0x6527e6))[_0x2d47('0x26')](handleError(_0x145ca6,null));};exports['show']=function(_0x3bd489,_0x1efaf7){var _0xe38ec1={'raw':!![],'where':{'id':_0x3bd489[_0x2d47('0x51')]['id']}},_0x170913={};_0x170913[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x3b')]['rawAttributes']);_0x170913[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x3bd489[_0x2d47('0x3f')]);_0x170913['filters']=_[_0x2d47('0x41')](_0x170913['model'],_0x170913['query']);_0xe38ec1[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x170913['model'],qs[_0x2d47('0x43')](_0x3bd489['query']['fields']));_0xe38ec1[_0x2d47('0x42')]=_0xe38ec1[_0x2d47('0x42')][_0x2d47('0x44')]?_0xe38ec1[_0x2d47('0x42')]:_0x170913['model'];if(_0x3bd489[_0x2d47('0x3f')][_0x2d47('0x4f')]){_0xe38ec1[_0x2d47('0x50')]=[{'all':!![]}];}_0xe38ec1=_[_0x2d47('0x4b')]({},_0xe38ec1,_0x3bd489[_0x2d47('0x4e')]);return db[_0x2d47('0x3b')][_0x2d47('0x52')](_0xe38ec1)['then'](handleEntityNotFound(_0x1efaf7,null))[_0x2d47('0x32')](respondWithResult(_0x1efaf7,null))[_0x2d47('0x26')](handleError(_0x1efaf7,null));};exports[_0x2d47('0x53')]=function(_0x1c4ae1,_0x46e992){return db[_0x2d47('0x3b')][_0x2d47('0x53')](_0x1c4ae1[_0x2d47('0x54')],{})[_0x2d47('0x32')](function(_0x55d6ae){var _0x2fc2cc=_0x1c4ae1['user'][_0x2d47('0x34')]({'plain':!![]});if(!_0x2fc2cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fc2cc[_0x2d47('0x55')]===_0x2d47('0x56')){var _0x2dfc4d=_0x55d6ae['get']({'plain':!![]});var _0x526d5a=_0x2d47('0x35');return db[_0x2d47('0x57')][_0x2d47('0x52')]({'where':{'name':_0x526d5a,'userProfileId':_0x2fc2cc[_0x2d47('0x58')]},'raw':!![]})[_0x2d47('0x32')](function(_0x2e8447){if(_0x2e8447&&_0x2e8447[_0x2d47('0x59')]===0x0){return db[_0x2d47('0x36')][_0x2d47('0x53')]({'name':_0x2dfc4d[_0x2d47('0x38')],'resourceId':_0x2dfc4d['id'],'type':_0x2e8447[_0x2d47('0x38')],'sectionId':_0x2e8447['id']},{})[_0x2d47('0x32')](function(){return _0x55d6ae;});}else{return _0x55d6ae;}})[_0x2d47('0x26')](function(_0x2d4c0c){logger['error'](_0x2d47('0x5a'),_0x2d4c0c);throw _0x2d4c0c;});}return _0x55d6ae;})[_0x2d47('0x32')](respondWithResult(_0x46e992,0xc9))[_0x2d47('0x26')](handleError(_0x46e992,null));};exports[_0x2d47('0x31')]=function(_0x523a9b,_0x28b511){if(_0x523a9b[_0x2d47('0x54')]['id']){delete _0x523a9b['body']['id'];}return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x523a9b['params']['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x28b511,null))[_0x2d47('0x32')](saveUpdates(_0x523a9b[_0x2d47('0x54')],null))[_0x2d47('0x32')](respondWithResult(_0x28b511,null))['catch'](handleError(_0x28b511,null));};exports[_0x2d47('0x33')]=function(_0x2a4e5a,_0x345249){return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x2a4e5a[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x345249,null))[_0x2d47('0x32')](removeEntity(_0x345249,null))['catch'](handleError(_0x345249,null));};exports[_0x2d47('0x5b')]=function(_0x4a270f,_0x4fc544){return db[_0x2d47('0x3b')][_0x2d47('0x5b')]()[_0x2d47('0x32')](respondWithResult(_0x4fc544,null))[_0x2d47('0x26')](handleError(_0x4fc544,null));};exports[_0x2d47('0x5c')]=function(_0x67c127,_0x20e54d,_0x3cc934){var _0x24c375={'raw':!![],'where':{}},_0x1faac0={},_0x573fbb;return db['ChatQueue'][_0x2d47('0x5d')]({'where':{'id':_0x67c127[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x20e54d,null))[_0x2d47('0x32')](function(_0xd7fdb7){if(_0xd7fdb7){_0x573fbb=_0xd7fdb7[_0x2d47('0x34')]({'plain':!![]});_0x1faac0[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x5e')]['rawAttributes']);_0x1faac0[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x67c127[_0x2d47('0x3f')]);_0x1faac0[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1faac0[_0x2d47('0x3d')],_0x1faac0[_0x2d47('0x3f')]);_0x24c375['attributes']=_[_0x2d47('0x41')](_0x1faac0[_0x2d47('0x3d')],qs['fields'](_0x67c127[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x24c375[_0x2d47('0x42')]=_0x24c375['attributes'][_0x2d47('0x44')]?_0x24c375[_0x2d47('0x42')]:_0x1faac0[_0x2d47('0x3d')];if(!_0x67c127['query'][_0x2d47('0x45')](_0x2d47('0x46'))){_0x24c375[_0x2d47('0x2d')]=qs['limit'](_0x67c127[_0x2d47('0x3f')]['limit']);_0x24c375[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x67c127['query'][_0x2d47('0x2c')]);}_0x24c375[_0x2d47('0x5f')]=qs[_0x2d47('0x47')](_0x67c127[_0x2d47('0x3f')][_0x2d47('0x47')]);_0x24c375['where']=qs[_0x2d47('0x40')](_[_0x2d47('0x49')](_0x67c127['query'],_0x1faac0['filters']));_0x24c375['where'][_0x2d47('0x60')]=_0xd7fdb7['id'];if(_0x67c127[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x24c375[_0x2d47('0x48')]=_['merge'](_0x24c375[_0x2d47('0x48')],{'$or':_[_0x2d47('0x61')](_0x24c375['attributes'],function(_0x2a5d3b){var _0x2fc961={};_0x2fc961[_0x2a5d3b]={'$like':'%'+_0x67c127['query'][_0x2d47('0x4a')]+'%'};return _0x2fc961;})});}_0x24c375=_[_0x2d47('0x4b')]({},_0x24c375,_0x67c127[_0x2d47('0x4e')]);return db[_0x2d47('0x5e')]['findAll'](_0x24c375);}})[_0x2d47('0x32')](function(_0x360cde){if(_0x360cde){return db[_0x2d47('0x62')][_0x2d47('0x63')]({'where':{'id':_['map'](_0x360cde,_0x2d47('0x64')),'role':_0x2d47('0x65')},'attributes':['id','name','chatPause','updatedAt',_0x2d47('0x66')]});}})[_0x2d47('0x32')](function(_0x42450){if(_0x42450){return{'count':_0x42450[_0x2d47('0x2b')],'rows':_[_0x2d47('0x61')](_0x42450[_0x2d47('0x67')],function(_0x3a8d1c){return{'membername':_0x3a8d1c['name'],'UserId':_0x3a8d1c['id'],'queue_name':_0x573fbb[_0x2d47('0x38')],'ChatQueueId':_0x573fbb['id'],'interface':util['format'](_0x2d47('0x68'),_0x2d47('0x69'),_0x3a8d1c['name']),'penalty':0x0,'paused':_0x3a8d1c[_0x2d47('0x6a')],'createdAt':_0x3a8d1c['createdAt'],'updatedAt':_0x3a8d1c[_0x2d47('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d47('0x32')](respondWithFilteredResult(_0x20e54d,_0x24c375))[_0x2d47('0x26')](handleError(_0x20e54d,null));};exports['getTeams']=function(_0x5b5398,_0x115b29,_0x374375){var _0x1996aa={};var _0x1141b2={};var _0x913dea;var _0x16378a;return db[_0x2d47('0x3b')][_0x2d47('0x5d')]({'where':{'id':_0x5b5398[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x115b29,null))['then'](function(_0x4f6618){if(_0x4f6618){_0x913dea=_0x4f6618;_0x1141b2[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x6c')][_0x2d47('0x3c')]);_0x1141b2[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x5b5398[_0x2d47('0x3f')]);_0x1141b2[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1141b2[_0x2d47('0x3d')],_0x1141b2[_0x2d47('0x3f')]);_0x1996aa[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x1141b2[_0x2d47('0x3d')],qs[_0x2d47('0x43')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x1996aa['attributes']=_0x1996aa[_0x2d47('0x42')][_0x2d47('0x44')]?_0x1996aa['attributes']:_0x1141b2[_0x2d47('0x3d')];_0x1996aa[_0x2d47('0x5f')]=qs[_0x2d47('0x47')](_0x5b5398[_0x2d47('0x3f')]['sort']);_0x1996aa[_0x2d47('0x48')]=qs[_0x2d47('0x40')](_['pick'](_0x5b5398['query'],_0x1141b2[_0x2d47('0x40')]));if(_0x5b5398['query']['filter']){_0x1996aa['where']=_[_0x2d47('0x4b')](_0x1996aa[_0x2d47('0x48')],{'$or':_['map'](_0x1996aa[_0x2d47('0x42')],function(_0x1ddf7f){var _0x4e8384={};_0x4e8384[_0x1ddf7f]={'$like':'%'+_0x5b5398[_0x2d47('0x3f')]['filter']+'%'};return _0x4e8384;})});}_0x1996aa=_[_0x2d47('0x4b')]({},_0x1996aa,_0x5b5398[_0x2d47('0x4e')]);return _0x913dea[_0x2d47('0x6d')](_0x1996aa);}})[_0x2d47('0x32')](function(_0x532f81){if(_0x532f81){_0x16378a=_0x532f81[_0x2d47('0x44')];if(!_0x5b5398[_0x2d47('0x3f')]['hasOwnProperty']('nolimit')){_0x1996aa[_0x2d47('0x2d')]=qs[_0x2d47('0x2d')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x1996aa[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x2c')]);}return _0x913dea[_0x2d47('0x6d')](_0x1996aa);}})['then'](function(_0x55c1cc){if(_0x55c1cc){return _0x55c1cc?{'count':_0x16378a,'rows':_0x55c1cc}:null;}})['then'](respondWithResult(_0x115b29,null))[_0x2d47('0x26')](handleError(_0x115b29,null));};exports['addTeams']=function(_0x147083,_0x1b757c,_0x8883d2){var _0x1aa618=_0x147083[_0x2d47('0x54')][_0x2d47('0x6e')];return db['Team'][_0x2d47('0x6f')]({'where':{'id':_['map'](_0x1aa618,'id')},'attributes':['id'],'include':[{'model':db[_0x2d47('0x62')],'as':_0x2d47('0x70'),'attributes':['id',_0x2d47('0x38'),_0x2d47('0x71'),_0x2d47('0x72'),_0x2d47('0x73')],'raw':!![]}]})[_0x2d47('0x32')](function(_0x4c9e3a){if(_0x4c9e3a){var _0x1d3aed=_[_0x2d47('0x74')](_0x4c9e3a,function(_0x136594){var _0x1afbd4=_0x136594[_0x2d47('0x34')]({'plain':!![]});return _0x1afbd4[_0x2d47('0x70')];});return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x147083[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](function(_0x4e9e3a){return db[_0x2d47('0x75')][_0x2d47('0x76')](function(_0x43ee32){return _0x4e9e3a[_0x2d47('0x77')](_[_0x2d47('0x61')](_0x1aa618,'id'),{'transaction':_0x43ee32})[_0x2d47('0x32')](function(){return BPromise[_0x2d47('0x78')](_0x1d3aed,function(_0x583dd5){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x583dd5['id'],'ChatQueueId':_0x147083[_0x2d47('0x51')]['id']},'transaction':_0x43ee32});});})['then'](function(){_0x1d3aed[_0x2d47('0x79')](function(_0x4a48c8){socket['emit'](_0x2d47('0x7a'),{'UserId':_0x4a48c8['id'],'ChatQueueId':_0x4e9e3a['id']});});});});});}})[_0x2d47('0x32')](respondWithStatusCode(_0x1b757c,null))[_0x2d47('0x26')](handleError(_0x1b757c,null));};exports[_0x2d47('0x7b')]=function(_0x1bfb06,_0x554ba2,_0x807d80){return db[_0x2d47('0x6c')][_0x2d47('0x6f')]({'where':{'id':_0x1bfb06[_0x2d47('0x3f')][_0x2d47('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x2d47('0x62')],'as':_0x2d47('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x554ba2,null))[_0x2d47('0x32')](function(_0x3bc96a){var _0x54ee3f=_[_0x2d47('0x61')](_0x3bc96a,'id');var _0x93fcae=[];var _0x4742a5=[];var _0x4180f2=squel[_0x2d47('0x7d')]();_0x4180f2[_0x2d47('0x7e')](_0x2d47('0x7f'))[_0x2d47('0x80')](_0x2d47('0x81'),'tq')['join']('user_has_teams','ut',_0x2d47('0x82'))[_0x2d47('0x48')](_0x2d47('0x83'),_0x1bfb06[_0x2d47('0x51')]['id']);for(var _0x279355=0x0;_0x279355<_0x3bc96a['length'];_0x279355+=0x1){let _0x43c0c6=_0x3bc96a[_0x279355];for(var _0x440a0d=0x0;_0x440a0d<_0x43c0c6[_0x2d47('0x70')]['length'];_0x440a0d+=0x1){let _0x2a66a2=_0x43c0c6[_0x2d47('0x70')][_0x440a0d];var _0x2c6975=_0x4180f2['clone']();_0x2c6975['where']('ut.UserId\x20=\x20?',_0x2a66a2['id']);_0x4742a5[_0x2d47('0x84')](db[_0x2d47('0x75')]['query'](_0x2c6975['toString'](),{'type':db[_0x2d47('0x75')]['QueryTypes'][_0x2d47('0x85')]})['then'](function(_0x1c7ac9){if(_0x1c7ac9['length']===0x1){return _0x2a66a2['id'];}else{var _0x1a40d9=_['every'](_[_0x2d47('0x61')](_0x1c7ac9,_0x2d47('0x86')),function(_0xaf531){return _[_0x2d47('0x87')](_0x54ee3f,_0xaf531);});if(_0x1a40d9){return _0x2a66a2['id'];}}}));}}return BPromise['all'](_0x4742a5)[_0x2d47('0x32')](function(_0x4e2f62){_0x93fcae=_(_0x93fcae)[_0x2d47('0x88')](_0x4e2f62)[_0x2d47('0x89')]()[_0x2d47('0x8a')]();return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x1bfb06[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](function(_0x309ab6){return db[_0x2d47('0x75')][_0x2d47('0x76')](function(_0x309986){return _0x309ab6[_0x2d47('0x7b')](_0x1bfb06[_0x2d47('0x3f')][_0x2d47('0x7c')],{'transaction':_0x309986})[_0x2d47('0x32')](function(){if(!_[_0x2d47('0x8b')](_0x93fcae)){return _0x309ab6[_0x2d47('0x8c')](_0x93fcae,{'transaction':_0x309986});}})[_0x2d47('0x32')](function(){_0x93fcae[_0x2d47('0x79')](function(_0x341765){socket['emit'](_0x2d47('0x8d'),{'UserId':_0x341765,'ChatQueueId':_0x309ab6['id']});});});});});});})['then'](respondWithStatusCode(_0x554ba2,null))[_0x2d47('0x26')](handleError(_0x554ba2,null));};exports[_0x2d47('0x8e')]=function(_0x377987,_0x2ae88a,_0x62c3b0){return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x377987[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x2ae88a,null))[_0x2d47('0x32')](function(_0x357cde){if(_0x357cde){return _0x357cde[_0x2d47('0x8e')](_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')],_[_0x2d47('0x8f')](_0x377987[_0x2d47('0x54')],[_0x2d47('0x7c'),'id'])||{})[_0x2d47('0x90')](function(_0x3f0faf){for(var _0x2ac213=0x0;_0x2ac213<_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')][_0x2d47('0x44')];_0x2ac213+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')][_0x2ac213],'ChatQueueId':_0x377987[_0x2d47('0x51')]['id']});}return _0x3f0faf;});}})['then'](respondWithResult(_0x2ae88a,null))['catch'](handleError(_0x2ae88a,null));};exports['removeAgents']=function(_0x4f1ed4,_0x468226,_0x23175b){return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x4f1ed4[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x468226,null))[_0x2d47('0x32')](function(_0x4f380d){if(_0x4f380d){return _0x4f380d['removeAgents'](_0x4f1ed4[_0x2d47('0x3f')]['ids'])[_0x2d47('0x32')](function(){if(_[_0x2d47('0x91')](_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')])){for(var _0x8f0338=0x0;_0x8f0338<_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')][_0x2d47('0x44')];_0x8f0338+=0x1){socket[_0x2d47('0x92')](_0x2d47('0x8d'),{'UserId':Number(_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')][_0x8f0338]),'ChatQueueId':Number(_0x4f1ed4[_0x2d47('0x51')]['id'])});}}else{socket[_0x2d47('0x92')](_0x2d47('0x8d'),{'UserId':Number(_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')]),'ChatQueueId':Number(_0x4f1ed4[_0x2d47('0x51')]['id'])});}});}})[_0x2d47('0x32')](respondWithStatusCode(_0x468226,null))['catch'](handleError(_0x468226,null));};exports['getAgents']=function(_0x844b46,_0x2ee509,_0x9f9e4c){var _0x25038f={};var _0x5b689a={};var _0xabb948;var _0x4542e2;return db[_0x2d47('0x3b')]['findOne']({'where':{'id':_0x844b46[_0x2d47('0x51')]['id']}})['then'](handleEntityNotFound(_0x2ee509,null))[_0x2d47('0x32')](function(_0x1528cc){if(_0x1528cc){_0xabb948=_0x1528cc;_0x5b689a[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x62')]['rawAttributes']);_0x5b689a[_0x2d47('0x3f')]=_['keys'](_0x844b46[_0x2d47('0x3f')]);_0x5b689a[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x5b689a[_0x2d47('0x3d')],_0x5b689a[_0x2d47('0x3f')]);_0x25038f['attributes']=_[_0x2d47('0x41')](_0x5b689a[_0x2d47('0x3d')],qs[_0x2d47('0x43')](_0x844b46['query'][_0x2d47('0x43')]));_0x25038f[_0x2d47('0x42')]=_0x25038f['attributes'][_0x2d47('0x44')]?_0x25038f[_0x2d47('0x42')]:_0x5b689a[_0x2d47('0x3d')];_0x25038f[_0x2d47('0x5f')]=qs['sort'](_0x844b46['query']['sort']);_0x25038f['where']=qs['filters'](_[_0x2d47('0x49')](_0x844b46['query'],_0x5b689a[_0x2d47('0x40')]));if(_0x844b46[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x25038f[_0x2d47('0x48')]=_[_0x2d47('0x4b')](_0x25038f['where'],{'$or':_[_0x2d47('0x61')](_0x25038f[_0x2d47('0x42')],function(_0x18ddbb){var _0x250c73={};_0x250c73[_0x18ddbb]={'$like':'%'+_0x844b46[_0x2d47('0x3f')][_0x2d47('0x4a')]+'%'};return _0x250c73;})});}_0x25038f=_[_0x2d47('0x4b')]({},_0x25038f,_0x844b46[_0x2d47('0x4e')]);return _0xabb948['getAgents'](_0x25038f);}})[_0x2d47('0x32')](function(_0x572f99){if(_0x572f99){_0x4542e2=_0x572f99[_0x2d47('0x44')];if(!_0x844b46['query'][_0x2d47('0x45')](_0x2d47('0x46'))){_0x25038f[_0x2d47('0x2d')]=qs[_0x2d47('0x2d')](_0x844b46[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x25038f[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x844b46[_0x2d47('0x3f')][_0x2d47('0x2c')]);}return _0xabb948[_0x2d47('0x93')](_0x25038f);}})[_0x2d47('0x32')](function(_0x2fca74){if(_0x2fca74){return _0x2fca74?{'count':_0x4542e2,'rows':_0x2fca74}:null;}})[_0x2d47('0x32')](respondWithResult(_0x2ee509,null))['catch'](handleError(_0x2ee509,null));}; \ No newline at end of file +var _0x4d94=['updatedAt','createdAt','format','%s/%s','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','transaction','each','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','ChatQueues','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','count','includeAll','findAll','rows','show','params','filters','length','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','nolimit','ChatQueueId','UserChatQueue','agent','chatPause'];(function(_0x2d212e,_0x4534ea){var _0x51b1e5=function(_0x530a54){while(--_0x530a54){_0x2d212e['push'](_0x2d212e['shift']());}};_0x51b1e5(++_0x4534ea);}(_0x4d94,0xc5));var _0x44d9=function(_0x17e09f,_0x1e12be){_0x17e09f=_0x17e09f-0x0;var _0x4ac806=_0x4d94[_0x17e09f];return _0x4ac806;};'use strict';var pdf=require(_0x44d9('0x0'));var emlformat=require(_0x44d9('0x1'));var rimraf=require(_0x44d9('0x2'));var zipdir=require(_0x44d9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x44d9('0x4'));var BPromise=require(_0x44d9('0x5'));var Mustache=require(_0x44d9('0x6'));var util=require(_0x44d9('0x7'));var path=require(_0x44d9('0x8'));var sox=require(_0x44d9('0x9'));var csv=require(_0x44d9('0xa'));var ejs=require(_0x44d9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44d9('0xc'));var crypto=require(_0x44d9('0xd'));var jsforce=require(_0x44d9('0xe'));var deskjs=require(_0x44d9('0xf'));var toCsv=require(_0x44d9('0xa'));var querystring=require(_0x44d9('0x10'));var Papa=require('papaparse');var Redis=require(_0x44d9('0x11'));var authService=require(_0x44d9('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x44d9('0x13'));var logger=require(_0x44d9('0x14'))(_0x44d9('0x15'));var utils=require(_0x44d9('0x16'));var config=require('../../config/environment');var db=require(_0x44d9('0x17'))['db'];config['redis']=_[_0x44d9('0x18')](config[_0x44d9('0x19')],{'host':_0x44d9('0x1a'),'port':0x18eb});var socket=require(_0x44d9('0x1b'))(new Redis(config[_0x44d9('0x19')]));require(_0x44d9('0x1c'))[_0x44d9('0x1d')](socket);var jayson=require(_0x44d9('0x1e'));var client=jayson[_0x44d9('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x415698,_0x423d3f,_0x52546c){if(_0x52546c){var _0x341ebe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x341ebe[_0x44d9('0x20')](_0x423d3f)){return _0x415698;}else{throw new Error(_0x44d9('0x21'));}}else{return _0x415698;}}function respondWithRpcPromise(_0x2ef5c7,_0x59eee4,_0x34702b,_0x12eb46){return new BPromise(function(_0x31c56d,_0x1f4064){var _0x420c41=_0x12eb46||client;return _0x420c41[_0x44d9('0x22')](_0x2ef5c7,_0x34702b)['then'](function(_0x191195){logger[_0x44d9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x59eee4,_0x44d9('0x24'));logger[_0x44d9('0x25')](_0x44d9('0x26'),_0x59eee4,_0x44d9('0x24'),JSON['stringify'](_0x191195));if(_0x191195[_0x44d9('0x27')]){if(_0x191195[_0x44d9('0x27')][_0x44d9('0x28')]===0x1f4){logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);return _0x1f4064(_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);}logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x191195['error'][_0x44d9('0x2a')]);return _0x31c56d(_0x191195[_0x44d9('0x27')][_0x44d9('0x2a')]);}else{logger['info'](_0x44d9('0x29'),_0x59eee4,'request\x20sent');_0x31c56d(_0x191195[_0x44d9('0x2b')][_0x44d9('0x2a')]);}})[_0x44d9('0x2c')](function(_0x397206){logger[_0x44d9('0x27')](_0x44d9('0x29'),_0x59eee4,_0x397206);_0x1f4064(_0x397206);});});}function respondWithStatusCode(_0x1e7097,_0xaadf3d){_0xaadf3d=_0xaadf3d||0xcc;return function(_0x21de48){if(_0x21de48){return _0x1e7097[_0x44d9('0x2d')](_0xaadf3d);}return _0x1e7097[_0x44d9('0x2e')](_0xaadf3d)['end']();};}function respondWithResult(_0x119380,_0x389214){_0x389214=_0x389214||0xc8;return function(_0x699a2c){if(_0x699a2c){return _0x119380[_0x44d9('0x2e')](_0x389214)['json'](_0x699a2c);}};}function respondWithFilteredResult(_0x4ee65f,_0x45dd0b){return function(_0x3f9001){if(_0x3f9001){var _0x21a746=_0x3f9001['count'],_0x1a7952=_0x45dd0b[_0x44d9('0x2f')],_0x28a967=_0x45dd0b['offset']+_0x45dd0b[_0x44d9('0x30')],_0x28e752;if(_0x28a967>=_0x21a746){_0x28a967=_0x21a746;_0x28e752=0xc8;}else{_0x28e752=0xce;}_0x4ee65f[_0x44d9('0x2e')](_0x28e752);return _0x4ee65f[_0x44d9('0x31')](_0x44d9('0x32'),_0x1a7952+'-'+_0x28a967+'/'+_0x21a746)['json'](_0x3f9001);}return null;};}function patchUpdates(_0x1563c1){return function(_0xd4221c){try{jsonpatch['apply'](_0xd4221c,_0x1563c1,!![]);}catch(_0x360271){return BPromise[_0x44d9('0x33')](_0x360271);}return _0xd4221c[_0x44d9('0x34')]();};}function saveUpdates(_0xce652a,_0x35dfb8){return function(_0x2319e6){if(_0x2319e6){return _0x2319e6[_0x44d9('0x35')](_0xce652a)['then'](function(_0x2e3da5){return _0x2e3da5;});}return null;};}function removeEntity(_0x1776aa,_0xed744a){return function(_0x10d148){if(_0x10d148){return _0x10d148[_0x44d9('0x36')]()[_0x44d9('0x37')](function(){var _0x3a3973=_0x10d148[_0x44d9('0x38')]({'plain':!![]});var _0x102cce=_0x44d9('0x39');return db['UserProfileResource'][_0x44d9('0x36')]({'where':{'type':_0x102cce,'resourceId':_0x3a3973['id']}})[_0x44d9('0x37')](function(){return _0x10d148;});})[_0x44d9('0x37')](function(){_0x1776aa[_0x44d9('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2867c6,_0x6955f8){return function(_0x187762){if(!_0x187762){_0x2867c6[_0x44d9('0x2d')](0x194);}return _0x187762;};}function handleError(_0x4cf222,_0x269b06){_0x269b06=_0x269b06||0x1f4;return function(_0x40d0c5){logger[_0x44d9('0x27')](_0x40d0c5[_0x44d9('0x3a')]);if(_0x40d0c5[_0x44d9('0x3b')]){delete _0x40d0c5[_0x44d9('0x3b')];}_0x4cf222[_0x44d9('0x2e')](_0x269b06)[_0x44d9('0x3c')](_0x40d0c5);};}exports[_0x44d9('0x3d')]=function(_0xcdd29c,_0x1cbeac){var _0xd9bfcb={},_0x5bf1b4={},_0x2d43f0={'count':0x0,'rows':[]};var _0x4b0aba=db[_0x44d9('0x3e')][_0x44d9('0x3f')];_0x5bf1b4[_0x44d9('0x40')]=_[_0x44d9('0x41')](_0x4b0aba);_0x5bf1b4[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0xcdd29c[_0x44d9('0x42')]);_0x5bf1b4['filters']=_[_0x44d9('0x43')](_0x5bf1b4[_0x44d9('0x40')],_0x5bf1b4[_0x44d9('0x42')]);_0xd9bfcb[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x5bf1b4[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0xcdd29c['query'][_0x44d9('0x45')]));_0xd9bfcb[_0x44d9('0x44')]=_0xd9bfcb[_0x44d9('0x44')]['length']?_0xd9bfcb[_0x44d9('0x44')]:_0x5bf1b4[_0x44d9('0x40')];if(!_0xcdd29c['query'][_0x44d9('0x46')]('nolimit')){_0xd9bfcb[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x30')]);_0xd9bfcb[_0x44d9('0x2f')]=qs[_0x44d9('0x2f')](_0xcdd29c['query'][_0x44d9('0x2f')]);}_0xd9bfcb[_0x44d9('0x47')]=qs[_0x44d9('0x48')](_0xcdd29c[_0x44d9('0x42')]['sort']);_0xd9bfcb[_0x44d9('0x49')]=qs['filters'](_[_0x44d9('0x4a')](_0xcdd29c[_0x44d9('0x42')],_0x5bf1b4['filters']));if(_0xcdd29c['query'][_0x44d9('0x4b')]){_0xd9bfcb[_0x44d9('0x49')]=_['merge'](_0xd9bfcb[_0x44d9('0x49')],{'$or':_[_0x44d9('0x4c')](_0x4b0aba,function(_0x5dd1ab){if(_0x5dd1ab[_0x44d9('0x4d')][_0x44d9('0x4e')]!==_0x44d9('0x4f')){var _0x43d4b5={};_0x43d4b5[_0x5dd1ab[_0x44d9('0x50')]]={'$like':'%'+_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x4b')]+'%'};return _0x43d4b5;}})});}_0xd9bfcb=_[_0x44d9('0x51')]({},_0xd9bfcb,_0xcdd29c[_0x44d9('0x52')]);var _0x3583f9={'where':_0xd9bfcb[_0x44d9('0x49')]};return db['ChatQueue']['count'](_0x3583f9)[_0x44d9('0x37')](function(_0x77d865){_0x2d43f0[_0x44d9('0x53')]=_0x77d865;if(_0xcdd29c[_0x44d9('0x42')][_0x44d9('0x54')]){_0xd9bfcb['include']=[{'all':!![]}];}return db[_0x44d9('0x3e')][_0x44d9('0x55')](_0xd9bfcb);})[_0x44d9('0x37')](function(_0x490e8a){_0x2d43f0[_0x44d9('0x56')]=_0x490e8a;return _0x2d43f0;})[_0x44d9('0x37')](respondWithFilteredResult(_0x1cbeac,_0xd9bfcb))[_0x44d9('0x2c')](handleError(_0x1cbeac,null));};exports[_0x44d9('0x57')]=function(_0x31aa02,_0x444c3d){var _0x587db7={'raw':!![],'where':{'id':_0x31aa02[_0x44d9('0x58')]['id']}},_0x1d1ff7={};_0x1d1ff7[_0x44d9('0x40')]=_['keys'](db[_0x44d9('0x3e')][_0x44d9('0x3f')]);_0x1d1ff7['query']=_[_0x44d9('0x41')](_0x31aa02[_0x44d9('0x42')]);_0x1d1ff7[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x1d1ff7[_0x44d9('0x40')],_0x1d1ff7[_0x44d9('0x42')]);_0x587db7[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x1d1ff7[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0x31aa02[_0x44d9('0x42')]['fields']));_0x587db7[_0x44d9('0x44')]=_0x587db7['attributes'][_0x44d9('0x5a')]?_0x587db7[_0x44d9('0x44')]:_0x1d1ff7[_0x44d9('0x40')];if(_0x31aa02[_0x44d9('0x42')][_0x44d9('0x54')]){_0x587db7[_0x44d9('0x5b')]=[{'all':!![]}];}_0x587db7=_[_0x44d9('0x51')]({},_0x587db7,_0x31aa02[_0x44d9('0x52')]);return db['ChatQueue']['find'](_0x587db7)[_0x44d9('0x37')](handleEntityNotFound(_0x444c3d,null))[_0x44d9('0x37')](respondWithResult(_0x444c3d,null))[_0x44d9('0x2c')](handleError(_0x444c3d,null));};exports['create']=function(_0x5646f1,_0x502e8c){return db[_0x44d9('0x3e')][_0x44d9('0x5c')](_0x5646f1[_0x44d9('0x5d')],{})['then'](function(_0x3758f6){var _0x169711=_0x5646f1[_0x44d9('0x5e')][_0x44d9('0x38')]({'plain':!![]});if(!_0x169711)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x169711[_0x44d9('0x5f')]===_0x44d9('0x5e')){var _0xd95e53=_0x3758f6[_0x44d9('0x38')]({'plain':!![]});var _0x4352dc=_0x44d9('0x39');return db[_0x44d9('0x60')]['find']({'where':{'name':_0x4352dc,'userProfileId':_0x169711[_0x44d9('0x61')]},'raw':!![]})[_0x44d9('0x37')](function(_0x3f5814){if(_0x3f5814&&_0x3f5814[_0x44d9('0x62')]===0x0){return db[_0x44d9('0x63')][_0x44d9('0x5c')]({'name':_0xd95e53[_0x44d9('0x3b')],'resourceId':_0xd95e53['id'],'type':_0x3f5814[_0x44d9('0x3b')],'sectionId':_0x3f5814['id']},{})['then'](function(){return _0x3758f6;});}else{return _0x3758f6;}})['catch'](function(_0xa1af4b){logger[_0x44d9('0x27')](_0x44d9('0x64'),_0xa1af4b);throw _0xa1af4b;});}return _0x3758f6;})[_0x44d9('0x37')](respondWithResult(_0x502e8c,0xc9))[_0x44d9('0x2c')](handleError(_0x502e8c,null));};exports[_0x44d9('0x35')]=function(_0x1c4498,_0x36d474){if(_0x1c4498[_0x44d9('0x5d')]['id']){delete _0x1c4498[_0x44d9('0x5d')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x1c4498[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x36d474,null))[_0x44d9('0x37')](saveUpdates(_0x1c4498[_0x44d9('0x5d')],null))[_0x44d9('0x37')](respondWithResult(_0x36d474,null))['catch'](handleError(_0x36d474,null));};exports['destroy']=function(_0x1b66f5,_0x5e30af){return db[_0x44d9('0x3e')][_0x44d9('0x65')]({'where':{'id':_0x1b66f5[_0x44d9('0x58')]['id']}})['then'](handleEntityNotFound(_0x5e30af,null))[_0x44d9('0x37')](removeEntity(_0x5e30af,null))[_0x44d9('0x2c')](handleError(_0x5e30af,null));};exports[_0x44d9('0x66')]=function(_0x5397cd,_0x1d5bc3){return db[_0x44d9('0x3e')][_0x44d9('0x66')]()[_0x44d9('0x37')](respondWithResult(_0x1d5bc3,null))[_0x44d9('0x2c')](handleError(_0x1d5bc3,null));};exports['getMembers']=function(_0xcb7087,_0x26e80f,_0x35880b){var _0x43e8c8={'raw':!![],'where':{}},_0xf2692b={},_0x1a81f9;return db['ChatQueue'][_0x44d9('0x67')]({'where':{'id':_0xcb7087[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x26e80f,null))[_0x44d9('0x37')](function(_0xdcbab3){if(_0xdcbab3){_0x1a81f9=_0xdcbab3[_0x44d9('0x38')]({'plain':!![]});_0xf2692b[_0x44d9('0x40')]=_['keys'](db['UserChatQueue']['rawAttributes']);_0xf2692b[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0xcb7087[_0x44d9('0x42')]);_0xf2692b[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0xf2692b[_0x44d9('0x40')],_0xf2692b[_0x44d9('0x42')]);_0x43e8c8['attributes']=_[_0x44d9('0x43')](_0xf2692b[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0xcb7087['query'][_0x44d9('0x45')]));_0x43e8c8['attributes']=_0x43e8c8['attributes'][_0x44d9('0x5a')]?_0x43e8c8[_0x44d9('0x44')]:_0xf2692b[_0x44d9('0x40')];if(!_0xcb7087['query'][_0x44d9('0x46')](_0x44d9('0x68'))){_0x43e8c8[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0xcb7087[_0x44d9('0x42')][_0x44d9('0x30')]);_0x43e8c8['offset']=qs[_0x44d9('0x2f')](_0xcb7087[_0x44d9('0x42')][_0x44d9('0x2f')]);}_0x43e8c8[_0x44d9('0x47')]=qs[_0x44d9('0x48')](_0xcb7087[_0x44d9('0x42')]['sort']);_0x43e8c8[_0x44d9('0x49')]=qs[_0x44d9('0x59')](_[_0x44d9('0x4a')](_0xcb7087[_0x44d9('0x42')],_0xf2692b[_0x44d9('0x59')]));_0x43e8c8[_0x44d9('0x49')][_0x44d9('0x69')]=_0xdcbab3['id'];if(_0xcb7087['query']['filter']){_0x43e8c8['where']=_[_0x44d9('0x51')](_0x43e8c8[_0x44d9('0x49')],{'$or':_['map'](_0x43e8c8[_0x44d9('0x44')],function(_0x427250){var _0x5e7e01={};_0x5e7e01[_0x427250]={'$like':'%'+_0xcb7087['query']['filter']+'%'};return _0x5e7e01;})});}_0x43e8c8=_[_0x44d9('0x51')]({},_0x43e8c8,_0xcb7087[_0x44d9('0x52')]);return db[_0x44d9('0x6a')][_0x44d9('0x55')](_0x43e8c8);}})[_0x44d9('0x37')](function(_0x1e1539){if(_0x1e1539){return db['User']['findAndCountAll']({'where':{'id':_[_0x44d9('0x4c')](_0x1e1539,'UserId'),'role':_0x44d9('0x6b')},'attributes':['id','name',_0x44d9('0x6c'),_0x44d9('0x6d'),_0x44d9('0x6e')]});}})['then'](function(_0x406bc7){if(_0x406bc7){return{'count':_0x406bc7[_0x44d9('0x53')],'rows':_[_0x44d9('0x4c')](_0x406bc7[_0x44d9('0x56')],function(_0x4f0dda){return{'membername':_0x4f0dda[_0x44d9('0x3b')],'UserId':_0x4f0dda['id'],'queue_name':_0x1a81f9[_0x44d9('0x3b')],'ChatQueueId':_0x1a81f9['id'],'interface':util[_0x44d9('0x6f')](_0x44d9('0x70'),'SIP',_0x4f0dda[_0x44d9('0x3b')]),'penalty':0x0,'paused':_0x4f0dda[_0x44d9('0x6c')],'createdAt':_0x4f0dda[_0x44d9('0x6e')],'updatedAt':_0x4f0dda['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x44d9('0x37')](respondWithFilteredResult(_0x26e80f,_0x43e8c8))[_0x44d9('0x2c')](handleError(_0x26e80f,null));};exports[_0x44d9('0x71')]=function(_0x23db00,_0x3c44fc,_0x12d48c){var _0x3d8ac5={};var _0x3a173b={};var _0x52a836;var _0xea34da;return db[_0x44d9('0x3e')][_0x44d9('0x67')]({'where':{'id':_0x23db00[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x3c44fc,null))['then'](function(_0x55a143){if(_0x55a143){_0x52a836=_0x55a143;_0x3a173b[_0x44d9('0x40')]=_[_0x44d9('0x41')](db['Team'][_0x44d9('0x3f')]);_0x3a173b[_0x44d9('0x42')]=_['keys'](_0x23db00['query']);_0x3a173b[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x3a173b[_0x44d9('0x40')],_0x3a173b[_0x44d9('0x42')]);_0x3d8ac5[_0x44d9('0x44')]=_[_0x44d9('0x43')](_0x3a173b['model'],qs['fields'](_0x23db00[_0x44d9('0x42')][_0x44d9('0x45')]));_0x3d8ac5[_0x44d9('0x44')]=_0x3d8ac5[_0x44d9('0x44')]['length']?_0x3d8ac5[_0x44d9('0x44')]:_0x3a173b[_0x44d9('0x40')];_0x3d8ac5[_0x44d9('0x47')]=qs['sort'](_0x23db00['query'][_0x44d9('0x48')]);_0x3d8ac5['where']=qs[_0x44d9('0x59')](_[_0x44d9('0x4a')](_0x23db00[_0x44d9('0x42')],_0x3a173b['filters']));if(_0x23db00[_0x44d9('0x42')][_0x44d9('0x4b')]){_0x3d8ac5['where']=_[_0x44d9('0x51')](_0x3d8ac5[_0x44d9('0x49')],{'$or':_[_0x44d9('0x4c')](_0x3d8ac5[_0x44d9('0x44')],function(_0x1e9622){var _0x39908c={};_0x39908c[_0x1e9622]={'$like':'%'+_0x23db00['query']['filter']+'%'};return _0x39908c;})});}_0x3d8ac5=_[_0x44d9('0x51')]({},_0x3d8ac5,_0x23db00[_0x44d9('0x52')]);return _0x52a836[_0x44d9('0x71')](_0x3d8ac5);}})[_0x44d9('0x37')](function(_0x323f83){if(_0x323f83){_0xea34da=_0x323f83[_0x44d9('0x5a')];if(!_0x23db00[_0x44d9('0x42')][_0x44d9('0x46')](_0x44d9('0x68'))){_0x3d8ac5[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0x23db00[_0x44d9('0x42')][_0x44d9('0x30')]);_0x3d8ac5['offset']=qs['offset'](_0x23db00[_0x44d9('0x42')][_0x44d9('0x2f')]);}return _0x52a836['getTeams'](_0x3d8ac5);}})['then'](function(_0x289c11){if(_0x289c11){return _0x289c11?{'count':_0xea34da,'rows':_0x289c11}:null;}})[_0x44d9('0x37')](respondWithResult(_0x3c44fc,null))[_0x44d9('0x2c')](handleError(_0x3c44fc,null));};exports[_0x44d9('0x72')]=function(_0x35aa4c,_0x13e746,_0x39c94a){var _0x226ace=_0x35aa4c['body'][_0x44d9('0x73')];return db[_0x44d9('0x74')][_0x44d9('0x55')]({'where':{'id':_['map'](_0x226ace,'id')},'attributes':['id'],'include':[{'model':db[_0x44d9('0x75')],'as':_0x44d9('0x76'),'attributes':['id',_0x44d9('0x3b'),'online',_0x44d9('0x77'),_0x44d9('0x78')],'raw':!![]}]})[_0x44d9('0x37')](function(_0x564fee){if(_0x564fee){var _0x1216c4=_[_0x44d9('0x79')](_0x564fee,function(_0x298972){var _0x37954a=_0x298972[_0x44d9('0x38')]({'plain':!![]});return _0x37954a[_0x44d9('0x76')];});return db['ChatQueue'][_0x44d9('0x65')]({'where':{'id':_0x35aa4c[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](function(_0x26f46e){return db['sequelize'][_0x44d9('0x7a')](function(_0x42e0fd){return _0x26f46e[_0x44d9('0x72')](_['map'](_0x226ace,'id'),{'transaction':_0x42e0fd})[_0x44d9('0x37')](function(){return BPromise[_0x44d9('0x7b')](_0x1216c4,function(_0x79fa72){return db[_0x44d9('0x6a')]['findOrCreate']({'where':{'UserId':_0x79fa72['id'],'ChatQueueId':_0x35aa4c[_0x44d9('0x58')]['id']},'transaction':_0x42e0fd});});})['then'](function(){_0x1216c4['forEach'](function(_0x112967){socket[_0x44d9('0x7c')](_0x44d9('0x7d'),{'UserId':_0x112967['id'],'ChatQueueId':_0x26f46e['id']});});});});});}})['then'](respondWithStatusCode(_0x13e746,null))[_0x44d9('0x2c')](handleError(_0x13e746,null));};exports[_0x44d9('0x7e')]=function(_0x596701,_0x496f80,_0x1e9095){return db['Team'][_0x44d9('0x55')]({'where':{'id':_0x596701['query'][_0x44d9('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x496f80,null))[_0x44d9('0x37')](function(_0x259349){var _0x3e975e=_[_0x44d9('0x4c')](_0x259349,'id');var _0xf78b36=[];var _0x56d545=[];var _0x55bbbc=squel[_0x44d9('0x80')]();_0x55bbbc[_0x44d9('0x50')](_0x44d9('0x81'))['from'](_0x44d9('0x82'),'tq')[_0x44d9('0x83')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x44d9('0x49')](_0x44d9('0x84'),_0x596701[_0x44d9('0x58')]['id']);for(var _0x4a96c3=0x0;_0x4a96c3<_0x259349['length'];_0x4a96c3+=0x1){let _0xc251f5=_0x259349[_0x4a96c3];for(var _0x1905a1=0x0;_0x1905a1<_0xc251f5[_0x44d9('0x76')][_0x44d9('0x5a')];_0x1905a1+=0x1){let _0x572de2=_0xc251f5[_0x44d9('0x76')][_0x1905a1];var _0x11e81d=_0x55bbbc[_0x44d9('0x85')]();_0x11e81d[_0x44d9('0x49')](_0x44d9('0x86'),_0x572de2['id']);_0x56d545[_0x44d9('0x87')](db['sequelize']['query'](_0x11e81d[_0x44d9('0x88')](),{'type':db[_0x44d9('0x89')][_0x44d9('0x8a')][_0x44d9('0x8b')]})[_0x44d9('0x37')](function(_0x2c704c){if(_0x2c704c[_0x44d9('0x5a')]===0x1){return _0x572de2['id'];}else{var _0xf1263d=_[_0x44d9('0x8c')](_[_0x44d9('0x4c')](_0x2c704c,'TeamId'),function(_0x1bc165){return _[_0x44d9('0x8d')](_0x3e975e,_0x1bc165);});if(_0xf1263d){return _0x572de2['id'];}}}));}}return BPromise[_0x44d9('0x8e')](_0x56d545)[_0x44d9('0x37')](function(_0x29bf06){_0xf78b36=_(_0xf78b36)[_0x44d9('0x8f')](_0x29bf06)['compact']()[_0x44d9('0x90')]();return db['ChatQueue'][_0x44d9('0x65')]({'where':{'id':_0x596701[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](function(_0x151ecf){return db[_0x44d9('0x89')][_0x44d9('0x7a')](function(_0x4c70b9){return _0x151ecf['removeTeams'](_0x596701['query'][_0x44d9('0x7f')],{'transaction':_0x4c70b9})['then'](function(){if(!_[_0x44d9('0x91')](_0xf78b36)){return _0x151ecf[_0x44d9('0x92')](_0xf78b36,{'transaction':_0x4c70b9});}})[_0x44d9('0x37')](function(){_0xf78b36[_0x44d9('0x93')](function(_0x4c958e){socket[_0x44d9('0x7c')](_0x44d9('0x94'),{'UserId':_0x4c958e,'ChatQueueId':_0x151ecf['id']});});});});});});})[_0x44d9('0x37')](respondWithStatusCode(_0x496f80,null))['catch'](handleError(_0x496f80,null));};exports[_0x44d9('0x95')]=function(_0x311fbe,_0x849095,_0x475519){return db[_0x44d9('0x3e')]['find']({'where':{'id':_0x311fbe[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x849095,null))[_0x44d9('0x37')](function(_0x27223f){if(_0x27223f){return _0x27223f[_0x44d9('0x95')](_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')],_['omit'](_0x311fbe[_0x44d9('0x5d')],['ids','id'])||{})[_0x44d9('0x96')](function(_0x39f12c){for(var _0x4b84cf=0x0;_0x4b84cf<_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')]['length'];_0x4b84cf+=0x1){socket[_0x44d9('0x7c')](_0x44d9('0x7d'),{'UserId':_0x311fbe[_0x44d9('0x5d')][_0x44d9('0x7f')][_0x4b84cf],'ChatQueueId':_0x311fbe[_0x44d9('0x58')]['id']});}return _0x39f12c;});}})[_0x44d9('0x37')](respondWithResult(_0x849095,null))['catch'](handleError(_0x849095,null));};exports['removeAgents']=function(_0x45f726,_0x2cd337,_0xdb0f28){return db[_0x44d9('0x3e')][_0x44d9('0x65')]({'where':{'id':_0x45f726['params']['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x2cd337,null))[_0x44d9('0x37')](function(_0x502118){if(_0x502118){return _0x502118[_0x44d9('0x92')](_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')])[_0x44d9('0x37')](function(){if(_[_0x44d9('0x97')](_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')])){for(var _0x3f051a=0x0;_0x3f051a<_0x45f726[_0x44d9('0x42')][_0x44d9('0x7f')][_0x44d9('0x5a')];_0x3f051a+=0x1){socket[_0x44d9('0x7c')](_0x44d9('0x94'),{'UserId':Number(_0x45f726['query'][_0x44d9('0x7f')][_0x3f051a]),'ChatQueueId':Number(_0x45f726[_0x44d9('0x58')]['id'])});}}else{socket['emit'](_0x44d9('0x94'),{'UserId':Number(_0x45f726['query']['ids']),'ChatQueueId':Number(_0x45f726[_0x44d9('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cd337,null))[_0x44d9('0x2c')](handleError(_0x2cd337,null));};exports[_0x44d9('0x98')]=function(_0x4cca51,_0x14106a,_0x16f646){var _0x4842e7={};var _0x276197={};var _0x2acbfb;var _0x3895dc;return db['ChatQueue']['findOne']({'where':{'id':_0x4cca51[_0x44d9('0x58')]['id']}})[_0x44d9('0x37')](handleEntityNotFound(_0x14106a,null))[_0x44d9('0x37')](function(_0x32e826){if(_0x32e826){_0x2acbfb=_0x32e826;_0x276197['model']=_[_0x44d9('0x41')](db[_0x44d9('0x75')][_0x44d9('0x3f')]);_0x276197[_0x44d9('0x42')]=_[_0x44d9('0x41')](_0x4cca51[_0x44d9('0x42')]);_0x276197[_0x44d9('0x59')]=_[_0x44d9('0x43')](_0x276197[_0x44d9('0x40')],_0x276197[_0x44d9('0x42')]);_0x4842e7['attributes']=_[_0x44d9('0x43')](_0x276197[_0x44d9('0x40')],qs[_0x44d9('0x45')](_0x4cca51['query']['fields']));_0x4842e7['attributes']=_0x4842e7[_0x44d9('0x44')][_0x44d9('0x5a')]?_0x4842e7[_0x44d9('0x44')]:_0x276197[_0x44d9('0x40')];_0x4842e7[_0x44d9('0x47')]=qs['sort'](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x48')]);_0x4842e7['where']=qs['filters'](_[_0x44d9('0x4a')](_0x4cca51[_0x44d9('0x42')],_0x276197['filters']));if(_0x4cca51[_0x44d9('0x42')][_0x44d9('0x4b')]){_0x4842e7['where']=_[_0x44d9('0x51')](_0x4842e7[_0x44d9('0x49')],{'$or':_['map'](_0x4842e7[_0x44d9('0x44')],function(_0x1fc56a){var _0x4008f5={};_0x4008f5[_0x1fc56a]={'$like':'%'+_0x4cca51[_0x44d9('0x42')][_0x44d9('0x4b')]+'%'};return _0x4008f5;})});}_0x4842e7=_[_0x44d9('0x51')]({},_0x4842e7,_0x4cca51[_0x44d9('0x52')]);return _0x2acbfb[_0x44d9('0x98')](_0x4842e7);}})[_0x44d9('0x37')](function(_0x5ac316){if(_0x5ac316){_0x3895dc=_0x5ac316[_0x44d9('0x5a')];if(!_0x4cca51[_0x44d9('0x42')][_0x44d9('0x46')](_0x44d9('0x68'))){_0x4842e7[_0x44d9('0x30')]=qs[_0x44d9('0x30')](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x30')]);_0x4842e7[_0x44d9('0x2f')]=qs[_0x44d9('0x2f')](_0x4cca51[_0x44d9('0x42')][_0x44d9('0x2f')]);}return _0x2acbfb[_0x44d9('0x98')](_0x4842e7);}})[_0x44d9('0x37')](function(_0x2d2832){if(_0x2d2832){return _0x2d2832?{'count':_0x3895dc,'rows':_0x2d2832}:null;}})['then'](respondWithResult(_0x14106a,null))[_0x44d9('0x2c')](handleError(_0x14106a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 5f50da3..280ac5e 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 _0x8535=['update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x540b64,_0xe51786){var _0xea9534=function(_0x6e302a){while(--_0x6e302a){_0x540b64['push'](_0x540b64['shift']());}};_0xea9534(++_0xe51786);}(_0x8535,0x66));var _0x5853=function(_0x2d3d42,_0x5e7caf){_0x2d3d42=_0x2d3d42-0x0;var _0x2c5669=_0x8535[_0x2d3d42];return _0x2c5669;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5853('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5853('0x1')](0x0);var events={'afterCreate':_0x5853('0x2'),'afterUpdate':_0x5853('0x3'),'afterDestroy':'remove'};function emitEvent(_0x437257){return function(_0x357de3,_0x4d0c17,_0xcdbce9){ChatQueueEvents['emit'](_0x437257+':'+_0x357de3['id'],_0x357de3);ChatQueueEvents[_0x5853('0x4')](_0x437257,_0x357de3);_0xcdbce9(null);};}for(var e in events){if(events[_0x5853('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x5853('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xf0e8=['remove','emit','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x38c8b5,_0x3dff7a){var _0x49045c=function(_0x3bf717){while(--_0x3bf717){_0x38c8b5['push'](_0x38c8b5['shift']());}};_0x49045c(++_0x3dff7a);}(_0xf0e8,0x81));var _0x8f0e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf0e8[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x8f0e('0x0'));var ChatQueue=require(_0x8f0e('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8f0e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f0e('0x3'),'afterDestroy':_0x8f0e('0x4')};function emitEvent(_0x4861aa){return function(_0x56c7c8,_0x2dc7de,_0x237856){ChatQueueEvents[_0x8f0e('0x5')](_0x4861aa+':'+_0x56c7c8['id'],_0x56c7c8);ChatQueueEvents[_0x8f0e('0x5')](_0x4861aa,_0x56c7c8);_0x237856(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8f0e('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index adc94ac..5fb7ce9 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 _0x5d86=['chat_queues','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x25078a,_0x3f68e5){var _0x4d8750=function(_0x18ceed){while(--_0x18ceed){_0x25078a['push'](_0x25078a['shift']());}};_0x4d8750(++_0x3f68e5);}(_0x5d86,0x76));var _0x65d8=function(_0x5c3ea5,_0xa9ed0c){_0x5c3ea5=_0x5c3ea5-0x0;var _0x102b61=_0x5d86[_0x5c3ea5];return _0x102b61;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./chatQueue.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('ChatQueue',attributes,{'tableName':_0x65d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdeb=['api','bluebird','request-promise','path','rimraf','exports','define','util'];(function(_0x414961,_0x168280){var _0x4f2a62=function(_0x298a64){while(--_0x298a64){_0x414961['push'](_0x414961['shift']());}};_0x4f2a62(++_0x168280);}(_0xbdeb,0x6f));var _0xbbde=function(_0x568b19,_0x56e516){_0x568b19=_0x568b19-0x0;var _0x332c05=_0xbdeb[_0x568b19];return _0x332c05;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var logger=require('../../config/logger')(_0xbbde('0x1'));var moment=require('moment');var BPromise=require(_0xbbde('0x2'));var rp=require(_0xbbde('0x3'));var fs=require('fs');var path=require(_0xbbde('0x4'));var rimraf=require(_0xbbde('0x5'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xbbde('0x6')]=function(_0x1d4042,_0x278651){return _0x1d4042[_0xbbde('0x7')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index f72a6c2..a83ef27 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 _0xac14=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x51fb3c,_0x28a763){var _0x941d96=function(_0x91294c){while(--_0x91294c){_0x51fb3c['push'](_0x51fb3c['shift']());}};_0x941d96(++_0x28a763);}(_0xac14,0x134));var _0x4ac1=function(_0x5c5a43,_0x42e1f7){_0x5c5a43=_0x5c5a43-0x0;var _0x8f5f1b=_0xac14[_0x5c5a43];return _0x8f5f1b;};'use strict';var _=require(_0x4ac1('0x0'));var util=require(_0x4ac1('0x1'));var moment=require(_0x4ac1('0x2'));var BPromise=require(_0x4ac1('0x3'));var rs=require(_0x4ac1('0x4'));var fs=require('fs');var Redis=require(_0x4ac1('0x5'));var db=require(_0x4ac1('0x6'))['db'];var utils=require(_0x4ac1('0x7'));var logger=require(_0x4ac1('0x8'))(_0x4ac1('0x9'));var config=require(_0x4ac1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4ac1('0xb')]['http']({'port':0x232a});config[_0x4ac1('0xc')]=_[_0x4ac1('0xd')](config[_0x4ac1('0xc')],{'host':_0x4ac1('0xe'),'port':0x18eb});var socket=require(_0x4ac1('0xf'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4ac1('0x10')](socket);function respondWithRpcPromise(_0x4f4918,_0x2e780c,_0x365f90){return new BPromise(function(_0x3bd008,_0x410870){return client[_0x4ac1('0x11')](_0x4f4918,_0x365f90)[_0x4ac1('0x12')](function(_0x5abe9d){logger[_0x4ac1('0x13')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x4ac1('0x14'));logger[_0x4ac1('0x15')](_0x4ac1('0x16'),_0x2e780c,_0x4ac1('0x14'),JSON[_0x4ac1('0x17')](_0x5abe9d));if(_0x5abe9d[_0x4ac1('0x18')]){if(_0x5abe9d['error']['code']===0x1f4){logger[_0x4ac1('0x18')](_0x4ac1('0x19'),_0x2e780c,_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);return _0x410870(_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);}logger[_0x4ac1('0x18')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);return _0x3bd008(_0x5abe9d[_0x4ac1('0x18')]['message']);}else{logger[_0x4ac1('0x13')](_0x4ac1('0x19'),_0x2e780c,_0x4ac1('0x14'));_0x3bd008(_0x5abe9d[_0x4ac1('0x1b')][_0x4ac1('0x1a')]);}})[_0x4ac1('0x1c')](function(_0x2d390a){logger[_0x4ac1('0x18')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x2d390a);_0x410870(_0x2d390a);});});}exports[_0x4ac1('0x1d')]=function(_0x460ca2){var _0x2acc86=this;return new Promise(function(_0x4d4991,_0x520dac){return db[_0x4ac1('0x1e')]['findAll']({'raw':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x20')]===undefined?!![]:![]:!![],'where':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x21')]||null:null,'attributes':_0x460ca2['options']?_0x460ca2['options'][_0x4ac1('0x22')]||null:null,'limit':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')]['limit']||null:null,'include':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x460ca2['options'][_0x4ac1('0x23')],function(_0x577ecb){return{'model':db[_0x577ecb[_0x4ac1('0x25')]],'as':_0x577ecb['as'],'attributes':_0x577ecb[_0x4ac1('0x22')],'include':_0x577ecb[_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x577ecb[_0x4ac1('0x23')],function(_0x363abb){return{'model':db[_0x363abb['model']],'as':_0x363abb['as'],'attributes':_0x363abb['attributes'],'include':_0x363abb[_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x363abb[_0x4ac1('0x23')],function(_0x44e15e){return{'model':db[_0x44e15e[_0x4ac1('0x25')]],'as':_0x44e15e['as'],'attributes':_0x44e15e[_0x4ac1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4ac1('0x12')](function(_0x4194c1){logger[_0x4ac1('0x13')](_0x4ac1('0x1d'),_0x460ca2);logger['debug'](_0x4ac1('0x1d'),_0x460ca2,JSON['stringify'](_0x4194c1));_0x4d4991(_0x4194c1);})[_0x4ac1('0x1c')](function(_0x1f926a){logger[_0x4ac1('0x18')]('GetChatQueue',_0x1f926a['message'],_0x460ca2);_0x520dac(_0x2acc86['error'](0x1f4,_0x1f926a['message']));});});};exports[_0x4ac1('0x26')]=function(_0x4acddb){var _0x4e5af2=this;return new Promise(function(_0x4438a8,_0x51122c){return db[_0x4ac1('0x1e')]['find']({'raw':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x20')]===undefined?!![]:![]:!![],'where':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x21')]||null:null,'attributes':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')]['attributes']||null:null,'include':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x23')],function(_0x32cad1){return{'model':db[_0x32cad1[_0x4ac1('0x25')]],'as':_0x32cad1['as'],'attributes':_0x32cad1['attributes'],'include':_0x32cad1['include']?_[_0x4ac1('0x24')](_0x32cad1[_0x4ac1('0x23')],function(_0x549275){return{'model':db[_0x549275[_0x4ac1('0x25')]],'as':_0x549275['as'],'attributes':_0x549275[_0x4ac1('0x22')],'include':_0x549275['include']?_[_0x4ac1('0x24')](_0x549275['include'],function(_0xe21016){return{'model':db[_0xe21016[_0x4ac1('0x25')]],'as':_0xe21016['as'],'attributes':_0xe21016[_0x4ac1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4ac1('0x12')](function(_0x4eefa1){logger['info'](_0x4ac1('0x26'),_0x4acddb);logger[_0x4ac1('0x15')](_0x4ac1('0x26'),_0x4acddb,JSON[_0x4ac1('0x17')](_0x4eefa1));_0x4438a8(_0x4eefa1);})['catch'](function(_0x1b8bb3){logger[_0x4ac1('0x18')](_0x4ac1('0x26'),_0x1b8bb3[_0x4ac1('0x1a')],_0x4acddb);_0x51122c(_0x4e5af2[_0x4ac1('0x18')](0x1f4,_0x1b8bb3['message']));});});}; \ No newline at end of file +var _0x4359=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','raw','options','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','catch'];(function(_0x458674,_0x3d0b84){var _0x542d8e=function(_0x2e0a14){while(--_0x2e0a14){_0x458674['push'](_0x458674['shift']());}};_0x542d8e(++_0x3d0b84);}(_0x4359,0xa4));var _0x9435=function(_0x51c8b2,_0x105c86){_0x51c8b2=_0x51c8b2-0x0;var _0x9ee93a=_0x4359[_0x51c8b2];return _0x9ee93a;};'use strict';var _=require('lodash');var util=require(_0x9435('0x0'));var moment=require('moment');var BPromise=require(_0x9435('0x1'));var rs=require(_0x9435('0x2'));var fs=require('fs');var Redis=require(_0x9435('0x3'));var db=require(_0x9435('0x4'))['db'];var utils=require(_0x9435('0x5'));var logger=require(_0x9435('0x6'))('rpc');var config=require(_0x9435('0x7'));var jayson=require(_0x9435('0x8'));var client=jayson[_0x9435('0x9')][_0x9435('0xa')]({'port':0x232a});config[_0x9435('0xb')]=_[_0x9435('0xc')](config[_0x9435('0xb')],{'host':_0x9435('0xd'),'port':0x18eb});var socket=require(_0x9435('0xe'))(new Redis(config[_0x9435('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x509a18,_0x5e9ff5,_0x53e012){return new BPromise(function(_0xd42339,_0x5b4ac6){return client[_0x9435('0xf')](_0x509a18,_0x53e012)[_0x9435('0x10')](function(_0x54fe83){logger[_0x9435('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5e9ff5,_0x9435('0x12'));logger['debug'](_0x9435('0x13'),_0x5e9ff5,_0x9435('0x12'),JSON[_0x9435('0x14')](_0x54fe83));if(_0x54fe83[_0x9435('0x15')]){if(_0x54fe83['error'][_0x9435('0x16')]===0x1f4){logger[_0x9435('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5e9ff5,_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);return _0x5b4ac6(_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);}logger['error'](_0x9435('0x18'),_0x5e9ff5,_0x54fe83[_0x9435('0x15')]['message']);return _0xd42339(_0x54fe83[_0x9435('0x15')][_0x9435('0x17')]);}else{logger[_0x9435('0x11')](_0x9435('0x18'),_0x5e9ff5,_0x9435('0x12'));_0xd42339(_0x54fe83[_0x9435('0x19')][_0x9435('0x17')]);}})['catch'](function(_0x4e289f){logger[_0x9435('0x15')](_0x9435('0x18'),_0x5e9ff5,_0x4e289f);_0x5b4ac6(_0x4e289f);});});}exports[_0x9435('0x1a')]=function(_0x3c0d33){var _0x1c995d=this;return new Promise(function(_0xbfd219,_0x514a5b){return db[_0x9435('0x1b')][_0x9435('0x1c')]({'raw':_0x3c0d33['options']?_0x3c0d33['options'][_0x9435('0x1d')]===undefined?!![]:![]:!![],'where':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x1f')]||null:null,'attributes':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')]['attributes']||null:null,'limit':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x20')]||null:null,'include':_0x3c0d33[_0x9435('0x1e')]?_0x3c0d33[_0x9435('0x1e')][_0x9435('0x21')]?_[_0x9435('0x22')](_0x3c0d33['options'][_0x9435('0x21')],function(_0xc6632){return{'model':db[_0xc6632[_0x9435('0x23')]],'as':_0xc6632['as'],'attributes':_0xc6632[_0x9435('0x24')],'include':_0xc6632[_0x9435('0x21')]?_[_0x9435('0x22')](_0xc6632[_0x9435('0x21')],function(_0xab0f42){return{'model':db[_0xab0f42[_0x9435('0x23')]],'as':_0xab0f42['as'],'attributes':_0xab0f42['attributes'],'include':_0xab0f42[_0x9435('0x21')]?_[_0x9435('0x22')](_0xab0f42['include'],function(_0x5c0f97){return{'model':db[_0x5c0f97['model']],'as':_0x5c0f97['as'],'attributes':_0x5c0f97[_0x9435('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9435('0x10')](function(_0x26b9b5){logger['info'](_0x9435('0x1a'),_0x3c0d33);logger[_0x9435('0x25')](_0x9435('0x1a'),_0x3c0d33,JSON[_0x9435('0x14')](_0x26b9b5));_0xbfd219(_0x26b9b5);})['catch'](function(_0x54c07){logger['error'](_0x9435('0x1a'),_0x54c07[_0x9435('0x17')],_0x3c0d33);_0x514a5b(_0x1c995d[_0x9435('0x15')](0x1f4,_0x54c07['message']));});});};exports[_0x9435('0x26')]=function(_0x2e213c){var _0x42f791=this;return new Promise(function(_0x305cb5,_0x145eb5){return db[_0x9435('0x1b')][_0x9435('0x27')]({'raw':_0x2e213c[_0x9435('0x1e')]?_0x2e213c[_0x9435('0x1e')][_0x9435('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e213c['options']?_0x2e213c[_0x9435('0x1e')][_0x9435('0x1f')]||null:null,'attributes':_0x2e213c[_0x9435('0x1e')]?_0x2e213c['options'][_0x9435('0x24')]||null:null,'include':_0x2e213c[_0x9435('0x1e')]?_0x2e213c[_0x9435('0x1e')][_0x9435('0x21')]?_[_0x9435('0x22')](_0x2e213c[_0x9435('0x1e')][_0x9435('0x21')],function(_0x2a663a){return{'model':db[_0x2a663a[_0x9435('0x23')]],'as':_0x2a663a['as'],'attributes':_0x2a663a[_0x9435('0x24')],'include':_0x2a663a[_0x9435('0x21')]?_[_0x9435('0x22')](_0x2a663a[_0x9435('0x21')],function(_0xc8a586){return{'model':db[_0xc8a586[_0x9435('0x23')]],'as':_0xc8a586['as'],'attributes':_0xc8a586[_0x9435('0x24')],'include':_0xc8a586[_0x9435('0x21')]?_['map'](_0xc8a586[_0x9435('0x21')],function(_0x205997){return{'model':db[_0x205997[_0x9435('0x23')]],'as':_0x205997['as'],'attributes':_0x205997[_0x9435('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9435('0x10')](function(_0x1b7d2f){logger['info']('ShowChatQueue',_0x2e213c);logger[_0x9435('0x25')]('ShowChatQueue',_0x2e213c,JSON[_0x9435('0x14')](_0x1b7d2f));_0x305cb5(_0x1b7d2f);})[_0x9435('0x28')](function(_0x3eba1b){logger[_0x9435('0x15')](_0x9435('0x26'),_0x3eba1b['message'],_0x2e213c);_0x145eb5(_0x42f791[_0x9435('0x15')](0x1f4,_0x3eba1b['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index bafa3b1..f928911 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.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(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index faab7f5..02b4158 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 _0x4bcb=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e3059,_0x5d008a){var _0x3e981a=function(_0x4f814a){while(--_0x4f814a){_0x1e3059['push'](_0x1e3059['shift']());}};_0x3e981a(++_0x5d008a);}(_0x4bcb,0x15a));var _0xb4bc=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0x4bcb[_0x52b24f];return _0x46ea6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb4bc('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4bc('0x1')]();var auth=require(_0xb4bc('0x2'));var interaction=require(_0xb4bc('0x3'));var config=require(_0xb4bc('0x4'));var controller=require('./chatQueue.controller');router[_0xb4bc('0x5')]('/',auth['isAuthenticated'](),controller[_0xb4bc('0x6')]);router[_0xb4bc('0x5')](_0xb4bc('0x7'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x9')]);router[_0xb4bc('0x5')](_0xb4bc('0xa'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xb')]);router['get'](_0xb4bc('0xc'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xd')]);router[_0xb4bc('0x5')]('/:id/teams',auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xe')]);router[_0xb4bc('0x5')](_0xb4bc('0xf'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x10')]);router[_0xb4bc('0x11')]('/',auth[_0xb4bc('0x8')](),controller['create']);router[_0xb4bc('0x11')](_0xb4bc('0x12'),auth['isAuthenticated'](),controller[_0xb4bc('0x13')]);router[_0xb4bc('0x11')](_0xb4bc('0xf'),auth['isAuthenticated'](),controller[_0xb4bc('0x14')]);router[_0xb4bc('0x15')]('/:id',auth[_0xb4bc('0x8')](),controller['update']);router[_0xb4bc('0x16')](_0xb4bc('0xa'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x17')]);router[_0xb4bc('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb4bc('0x18')]);router['delete'](_0xb4bc('0xf'),auth['isAuthenticated'](),controller[_0xb4bc('0x19')]);module[_0xb4bc('0x1a')]=router; \ No newline at end of file +var _0x8836=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','/:id','update','delete','destroy','exports','multer'];(function(_0x56a758,_0x381a41){var _0x4252ef=function(_0x2757b1){while(--_0x2757b1){_0x56a758['push'](_0x56a758['shift']());}};_0x4252ef(++_0x381a41);}(_0x8836,0xc3));var _0x6883=function(_0x3a6e86,_0x504412){_0x3a6e86=_0x3a6e86-0x0;var _0x41a89c=_0x8836[_0x3a6e86];return _0x41a89c;};'use strict';var multer=require(_0x6883('0x0'));var util=require(_0x6883('0x1'));var path=require(_0x6883('0x2'));var timeout=require(_0x6883('0x3'));var express=require(_0x6883('0x4'));var router=express[_0x6883('0x5')]();var auth=require(_0x6883('0x6'));var interaction=require(_0x6883('0x7'));var config=require(_0x6883('0x8'));var controller=require(_0x6883('0x9'));router[_0x6883('0xa')]('/',auth[_0x6883('0xb')](),controller['index']);router[_0x6883('0xa')](_0x6883('0xc'),auth['isAuthenticated'](),controller[_0x6883('0xd')]);router[_0x6883('0xa')]('/:id',auth[_0x6883('0xb')](),controller[_0x6883('0xe')]);router['get'](_0x6883('0xf'),auth[_0x6883('0xb')](),controller[_0x6883('0x10')]);router[_0x6883('0xa')](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['getTeams']);router[_0x6883('0xa')](_0x6883('0x12'),auth['isAuthenticated'](),controller[_0x6883('0x13')]);router[_0x6883('0x14')]('/',auth['isAuthenticated'](),controller[_0x6883('0x15')]);router[_0x6883('0x14')](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['addTeams']);router[_0x6883('0x14')](_0x6883('0x12'),auth[_0x6883('0xb')](),controller[_0x6883('0x16')]);router['put'](_0x6883('0x17'),auth['isAuthenticated'](),controller[_0x6883('0x18')]);router[_0x6883('0x19')](_0x6883('0x17'),auth['isAuthenticated'](),controller[_0x6883('0x1a')]);router['delete'](_0x6883('0x11'),auth[_0x6883('0xb')](),controller['removeTeams']);router[_0x6883('0x19')](_0x6883('0x12'),auth[_0x6883('0xb')](),controller['removeAgents']);module[_0x6883('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8f26d63..9aff951 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 _0x86b4=['exports','STRING','DATE','sequelize'];(function(_0xe0e2a8,_0x292f12){var _0x16f4b2=function(_0x3ebe9c){while(--_0x3ebe9c){_0xe0e2a8['push'](_0xe0e2a8['shift']());}};_0x16f4b2(++_0x292f12);}(_0x86b4,0x1a3));var _0x486b=function(_0x14feb6,_0x788fe3){_0x14feb6=_0x14feb6-0x0;var _0x3db984=_0x86b4[_0x14feb6];return _0x3db984;};'use strict';var moment=require('moment');var Sequelize=require(_0x486b('0x0'));module[_0x486b('0x1')]={'uniqueid':{'type':Sequelize[_0x486b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x486b('0x2')]},'joinAt':{'type':Sequelize[_0x486b('0x3')]},'leaveAt':{'type':Sequelize[_0x486b('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x486b('0x3')]},'reason':{'type':Sequelize[_0x486b('0x2')]}}; \ No newline at end of file +var _0xa0c7=['DATE','moment','sequelize','exports','STRING'];(function(_0x202517,_0x47ada9){var _0x72463a=function(_0x452ad4){while(--_0x452ad4){_0x202517['push'](_0x202517['shift']());}};_0x72463a(++_0x47ada9);}(_0xa0c7,0x19b));var _0x7a0c=function(_0x498fa6,_0x52ff74){_0x498fa6=_0x498fa6-0x0;var _0x1af4d5=_0xa0c7[_0x498fa6];return _0x1af4d5;};'use strict';var moment=require(_0x7a0c('0x0'));var Sequelize=require(_0x7a0c('0x1'));module[_0x7a0c('0x2')]={'uniqueid':{'type':Sequelize[_0x7a0c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7a0c('0x4')]},'leaveAt':{'type':Sequelize[_0x7a0c('0x4')]},'acceptAt':{'type':Sequelize[_0x7a0c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7a0c('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 18ad43d..14022d6 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 _0xb9f6=['update','destroy','then','error','stack','name','send','model','keys','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save'];(function(_0x4a63f3,_0x4b02aa){var _0xc4aa6a=function(_0x4bbcdc){while(--_0x4bbcdc){_0x4a63f3['push'](_0x4a63f3['shift']());}};_0xc4aa6a(++_0x4b02aa);}(_0xb9f6,0x1de));var _0x6b9f=function(_0xc1b84e,_0x12caee){_0xc1b84e=_0xc1b84e-0x0;var _0xeaa56b=_0xb9f6[_0xc1b84e];return _0xeaa56b;};'use strict';var pdf=require(_0x6b9f('0x0'));var emlformat=require(_0x6b9f('0x1'));var rimraf=require(_0x6b9f('0x2'));var zipdir=require(_0x6b9f('0x3'));var jsonpatch=require(_0x6b9f('0x4'));var rp=require('request-promise');var moment=require(_0x6b9f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b9f('0x6'));var util=require('util');var path=require(_0x6b9f('0x7'));var sox=require(_0x6b9f('0x8'));var csv=require(_0x6b9f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b9f('0xa'));var squel=require(_0x6b9f('0xb'));var crypto=require(_0x6b9f('0xc'));var jsforce=require(_0x6b9f('0xd'));var deskjs=require(_0x6b9f('0xe'));var toCsv=require(_0x6b9f('0x9'));var querystring=require(_0x6b9f('0xf'));var Papa=require(_0x6b9f('0x10'));var Redis=require(_0x6b9f('0x11'));var authService=require(_0x6b9f('0x12'));var qs=require(_0x6b9f('0x13'));var hardwareService=require(_0x6b9f('0x14'));var logger=require(_0x6b9f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6b9f('0x16'));var db=require(_0x6b9f('0x17'))['db'];function respondWithStatusCode(_0x51ed25,_0x4facc6){_0x4facc6=_0x4facc6||0xcc;return function(_0x46a2f6){if(_0x46a2f6){return _0x51ed25['sendStatus'](_0x4facc6);}return _0x51ed25[_0x6b9f('0x18')](_0x4facc6)[_0x6b9f('0x19')]();};}function respondWithResult(_0x1607ad,_0x3e8b8c){_0x3e8b8c=_0x3e8b8c||0xc8;return function(_0x33036a){if(_0x33036a){return _0x1607ad[_0x6b9f('0x18')](_0x3e8b8c)[_0x6b9f('0x1a')](_0x33036a);}};}function respondWithFilteredResult(_0x446895,_0x251f46){return function(_0x2672f0){if(_0x2672f0){var _0x52dfc8=_0x2672f0[_0x6b9f('0x1b')],_0x2b1bfe=_0x251f46['offset'],_0x1386b3=_0x251f46[_0x6b9f('0x1c')]+_0x251f46['limit'],_0x33b81c;if(_0x1386b3>=_0x52dfc8){_0x1386b3=_0x52dfc8;_0x33b81c=0xc8;}else{_0x33b81c=0xce;}_0x446895[_0x6b9f('0x18')](_0x33b81c);return _0x446895[_0x6b9f('0x1d')](_0x6b9f('0x1e'),_0x2b1bfe+'-'+_0x1386b3+'/'+_0x52dfc8)[_0x6b9f('0x1a')](_0x2672f0);}return null;};}function patchUpdates(_0x5b152d){return function(_0x17e7ec){try{jsonpatch[_0x6b9f('0x1f')](_0x17e7ec,_0x5b152d,!![]);}catch(_0x5cc109){return BPromise['reject'](_0x5cc109);}return _0x17e7ec[_0x6b9f('0x20')]();};}function saveUpdates(_0x4488e2,_0x190cc2){return function(_0x497802){if(_0x497802){return _0x497802[_0x6b9f('0x21')](_0x4488e2)['then'](function(_0x17fb82){return _0x17fb82;});}return null;};}function removeEntity(_0x599d11,_0x2455ee){return function(_0x4eaefa){if(_0x4eaefa){return _0x4eaefa[_0x6b9f('0x22')]()[_0x6b9f('0x23')](function(){_0x599d11[_0x6b9f('0x18')](0xcc)[_0x6b9f('0x19')]();});}};}function handleEntityNotFound(_0x3b7acc,_0x1dbfee){return function(_0xc12bcd){if(!_0xc12bcd){_0x3b7acc['sendStatus'](0x194);}return _0xc12bcd;};}function handleError(_0x237e72,_0x12ad7a){_0x12ad7a=_0x12ad7a||0x1f4;return function(_0x4c73c9){logger[_0x6b9f('0x24')](_0x4c73c9[_0x6b9f('0x25')]);if(_0x4c73c9['name']){delete _0x4c73c9[_0x6b9f('0x26')];}_0x237e72[_0x6b9f('0x18')](_0x12ad7a)[_0x6b9f('0x27')](_0x4c73c9);};}exports['index']=function(_0x1b28cf,_0x2cb6aa){var _0x3d57c4={},_0x6454cb={},_0x2c59d4={'count':0x0,'rows':[]};var _0xf45a86=db['ChatQueueReport']['rawAttributes'];_0x6454cb[_0x6b9f('0x28')]=_[_0x6b9f('0x29')](_0xf45a86);_0x6454cb[_0x6b9f('0x2a')]=_[_0x6b9f('0x29')](_0x1b28cf[_0x6b9f('0x2a')]);_0x6454cb[_0x6b9f('0x2b')]=_[_0x6b9f('0x2c')](_0x6454cb[_0x6b9f('0x28')],_0x6454cb[_0x6b9f('0x2a')]);_0x3d57c4['attributes']=_['intersection'](_0x6454cb[_0x6b9f('0x28')],qs['fields'](_0x1b28cf[_0x6b9f('0x2a')]['fields']));_0x3d57c4[_0x6b9f('0x2d')]=_0x3d57c4['attributes'][_0x6b9f('0x2e')]?_0x3d57c4['attributes']:_0x6454cb[_0x6b9f('0x28')];if(!_0x1b28cf[_0x6b9f('0x2a')]['hasOwnProperty'](_0x6b9f('0x2f'))){_0x3d57c4[_0x6b9f('0x30')]=qs[_0x6b9f('0x30')](_0x1b28cf[_0x6b9f('0x2a')]['limit']);_0x3d57c4[_0x6b9f('0x1c')]=qs[_0x6b9f('0x1c')](_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x1c')]);}_0x3d57c4[_0x6b9f('0x31')]=qs[_0x6b9f('0x32')](_0x1b28cf[_0x6b9f('0x2a')]['sort']);_0x3d57c4[_0x6b9f('0x33')]=qs[_0x6b9f('0x2b')](_[_0x6b9f('0x34')](_0x1b28cf[_0x6b9f('0x2a')],_0x6454cb[_0x6b9f('0x2b')]));if(_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x35')]){_0x3d57c4[_0x6b9f('0x33')]=_[_0x6b9f('0x36')](_0x3d57c4['where'],{'$or':_[_0x6b9f('0x37')](_0xf45a86,function(_0x569900){if(_0x569900[_0x6b9f('0x38')][_0x6b9f('0x39')]!=='VIRTUAL'){var _0xa9eb15={};_0xa9eb15[_0x569900[_0x6b9f('0x3a')]]={'$like':'%'+_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x35')]+'%'};return _0xa9eb15;}})});}_0x3d57c4=_[_0x6b9f('0x36')]({},_0x3d57c4,_0x1b28cf[_0x6b9f('0x3b')]);var _0x2305a8={'where':_0x3d57c4[_0x6b9f('0x33')]};return db[_0x6b9f('0x3c')][_0x6b9f('0x1b')](_0x2305a8)['then'](function(_0x1abd19){_0x2c59d4[_0x6b9f('0x1b')]=_0x1abd19;if(_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x3d')]){_0x3d57c4[_0x6b9f('0x3e')]=[{'all':!![]}];}return db[_0x6b9f('0x3c')][_0x6b9f('0x3f')](_0x3d57c4);})['then'](function(_0x4e1cce){_0x2c59d4[_0x6b9f('0x40')]=_0x4e1cce;return _0x2c59d4;})[_0x6b9f('0x23')](respondWithFilteredResult(_0x2cb6aa,_0x3d57c4))[_0x6b9f('0x41')](handleError(_0x2cb6aa,null));};exports['show']=function(_0x3dc1f9,_0x1c223f){var _0x9d53f4={'raw':!![],'where':{'id':_0x3dc1f9[_0x6b9f('0x42')]['id']}},_0x22d00d={};_0x22d00d[_0x6b9f('0x28')]=_[_0x6b9f('0x29')](db[_0x6b9f('0x3c')][_0x6b9f('0x43')]);_0x22d00d['query']=_['keys'](_0x3dc1f9[_0x6b9f('0x2a')]);_0x22d00d[_0x6b9f('0x2b')]=_['intersection'](_0x22d00d[_0x6b9f('0x28')],_0x22d00d[_0x6b9f('0x2a')]);_0x9d53f4['attributes']=_['intersection'](_0x22d00d['model'],qs[_0x6b9f('0x44')](_0x3dc1f9[_0x6b9f('0x2a')][_0x6b9f('0x44')]));_0x9d53f4['attributes']=_0x9d53f4[_0x6b9f('0x2d')][_0x6b9f('0x2e')]?_0x9d53f4['attributes']:_0x22d00d['model'];if(_0x3dc1f9[_0x6b9f('0x2a')][_0x6b9f('0x3d')]){_0x9d53f4['include']=[{'all':!![]}];}_0x9d53f4=_[_0x6b9f('0x36')]({},_0x9d53f4,_0x3dc1f9[_0x6b9f('0x3b')]);return db['ChatQueueReport'][_0x6b9f('0x45')](_0x9d53f4)[_0x6b9f('0x23')](handleEntityNotFound(_0x1c223f,null))[_0x6b9f('0x23')](respondWithResult(_0x1c223f,null))[_0x6b9f('0x41')](handleError(_0x1c223f,null));};exports[_0x6b9f('0x46')]=function(_0x42f987,_0x3040fa){return db['ChatQueueReport'][_0x6b9f('0x46')](_0x42f987[_0x6b9f('0x47')],{})[_0x6b9f('0x23')](respondWithResult(_0x3040fa,0xc9))['catch'](handleError(_0x3040fa,null));};exports[_0x6b9f('0x21')]=function(_0x443f49,_0x5c7311){if(_0x443f49['body']['id']){delete _0x443f49[_0x6b9f('0x47')]['id'];}return db['ChatQueueReport'][_0x6b9f('0x45')]({'where':{'id':_0x443f49['params']['id']}})['then'](handleEntityNotFound(_0x5c7311,null))[_0x6b9f('0x23')](saveUpdates(_0x443f49[_0x6b9f('0x47')],null))['then'](respondWithResult(_0x5c7311,null))['catch'](handleError(_0x5c7311,null));};exports[_0x6b9f('0x22')]=function(_0x1a2cfc,_0x403d9a){return db[_0x6b9f('0x3c')][_0x6b9f('0x45')]({'where':{'id':_0x1a2cfc[_0x6b9f('0x42')]['id']}})['then'](handleEntityNotFound(_0x403d9a,null))[_0x6b9f('0x23')](removeEntity(_0x403d9a,null))[_0x6b9f('0x41')](handleError(_0x403d9a,null));};exports[_0x6b9f('0x48')]=function(_0x43692f,_0x5c3670){return db['ChatQueueReport'][_0x6b9f('0x48')]()[_0x6b9f('0x23')](respondWithResult(_0x5c3670,null))[_0x6b9f('0x41')](handleError(_0x5c3670,null));}; \ No newline at end of file +var _0x9d5b=['params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','status','end','json','count','offset','set','reject','update','then','destroy','error','stack','name','send','ChatQueueReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3ca5df,_0x1da92f){var _0x18ba2d=function(_0x30c9dd){while(--_0x30c9dd){_0x3ca5df['push'](_0x3ca5df['shift']());}};_0x18ba2d(++_0x1da92f);}(_0x9d5b,0x198));var _0xb9d5=function(_0x10d9b3,_0x312fe9){_0x10d9b3=_0x10d9b3-0x0;var _0x779b20=_0x9d5b[_0x10d9b3];return _0x779b20;};'use strict';var pdf=require(_0xb9d5('0x0'));var emlformat=require(_0xb9d5('0x1'));var rimraf=require(_0xb9d5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb9d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb9d5('0x4'));var util=require(_0xb9d5('0x5'));var path=require(_0xb9d5('0x6'));var sox=require(_0xb9d5('0x7'));var csv=require(_0xb9d5('0x8'));var ejs=require(_0xb9d5('0x9'));var fs=require('fs');var _=require(_0xb9d5('0xa'));var squel=require(_0xb9d5('0xb'));var crypto=require(_0xb9d5('0xc'));var jsforce=require(_0xb9d5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9d5('0xe'));var Papa=require(_0xb9d5('0xf'));var Redis=require(_0xb9d5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb9d5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb9d5('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x418afa,_0x2553c1){_0x2553c1=_0x2553c1||0xcc;return function(_0x80f9bd){if(_0x80f9bd){return _0x418afa['sendStatus'](_0x2553c1);}return _0x418afa[_0xb9d5('0x13')](_0x2553c1)[_0xb9d5('0x14')]();};}function respondWithResult(_0x495e58,_0x32ff1a){_0x32ff1a=_0x32ff1a||0xc8;return function(_0x70fc98){if(_0x70fc98){return _0x495e58[_0xb9d5('0x13')](_0x32ff1a)[_0xb9d5('0x15')](_0x70fc98);}};}function respondWithFilteredResult(_0x262c62,_0x5e975d){return function(_0x48f57b){if(_0x48f57b){var _0x347d04=_0x48f57b[_0xb9d5('0x16')],_0xec6bd5=_0x5e975d[_0xb9d5('0x17')],_0x5d5a32=_0x5e975d[_0xb9d5('0x17')]+_0x5e975d['limit'],_0xeccdac;if(_0x5d5a32>=_0x347d04){_0x5d5a32=_0x347d04;_0xeccdac=0xc8;}else{_0xeccdac=0xce;}_0x262c62[_0xb9d5('0x13')](_0xeccdac);return _0x262c62[_0xb9d5('0x18')]('Content-Range',_0xec6bd5+'-'+_0x5d5a32+'/'+_0x347d04)[_0xb9d5('0x15')](_0x48f57b);}return null;};}function patchUpdates(_0x3adb4f){return function(_0x2e7b2d){try{jsonpatch['apply'](_0x2e7b2d,_0x3adb4f,!![]);}catch(_0x5d2c1c){return BPromise[_0xb9d5('0x19')](_0x5d2c1c);}return _0x2e7b2d['save']();};}function saveUpdates(_0x13c0fe,_0x14e95e){return function(_0x8145ba){if(_0x8145ba){return _0x8145ba[_0xb9d5('0x1a')](_0x13c0fe)[_0xb9d5('0x1b')](function(_0x5ac3be){return _0x5ac3be;});}return null;};}function removeEntity(_0x140a0f,_0x49ca58){return function(_0x347571){if(_0x347571){return _0x347571[_0xb9d5('0x1c')]()['then'](function(){_0x140a0f[_0xb9d5('0x13')](0xcc)[_0xb9d5('0x14')]();});}};}function handleEntityNotFound(_0x2e1a60,_0x254529){return function(_0x5bca57){if(!_0x5bca57){_0x2e1a60['sendStatus'](0x194);}return _0x5bca57;};}function handleError(_0x4aa2d9,_0x2c6cc6){_0x2c6cc6=_0x2c6cc6||0x1f4;return function(_0x355e07){logger[_0xb9d5('0x1d')](_0x355e07[_0xb9d5('0x1e')]);if(_0x355e07[_0xb9d5('0x1f')]){delete _0x355e07['name'];}_0x4aa2d9[_0xb9d5('0x13')](_0x2c6cc6)[_0xb9d5('0x20')](_0x355e07);};}exports['index']=function(_0x38c225,_0x141584){var _0x4b8245={},_0x1fcb03={},_0x29b1bb={'count':0x0,'rows':[]};var _0x3cd98b=db[_0xb9d5('0x21')][_0xb9d5('0x22')];_0x1fcb03[_0xb9d5('0x23')]=_['keys'](_0x3cd98b);_0x1fcb03[_0xb9d5('0x24')]=_['keys'](_0x38c225[_0xb9d5('0x24')]);_0x1fcb03['filters']=_[_0xb9d5('0x25')](_0x1fcb03[_0xb9d5('0x23')],_0x1fcb03[_0xb9d5('0x24')]);_0x4b8245[_0xb9d5('0x26')]=_[_0xb9d5('0x25')](_0x1fcb03['model'],qs[_0xb9d5('0x27')](_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x27')]));_0x4b8245['attributes']=_0x4b8245['attributes'][_0xb9d5('0x28')]?_0x4b8245[_0xb9d5('0x26')]:_0x1fcb03[_0xb9d5('0x23')];if(!_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x29')]('nolimit')){_0x4b8245['limit']=qs[_0xb9d5('0x2a')](_0x38c225[_0xb9d5('0x24')]['limit']);_0x4b8245[_0xb9d5('0x17')]=qs[_0xb9d5('0x17')](_0x38c225[_0xb9d5('0x24')]['offset']);}_0x4b8245[_0xb9d5('0x2b')]=qs[_0xb9d5('0x2c')](_0x38c225[_0xb9d5('0x24')]['sort']);_0x4b8245[_0xb9d5('0x2d')]=qs[_0xb9d5('0x2e')](_[_0xb9d5('0x2f')](_0x38c225['query'],_0x1fcb03['filters']));if(_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x30')]){_0x4b8245[_0xb9d5('0x2d')]=_[_0xb9d5('0x31')](_0x4b8245[_0xb9d5('0x2d')],{'$or':_[_0xb9d5('0x32')](_0x3cd98b,function(_0x367d08){if(_0x367d08[_0xb9d5('0x33')][_0xb9d5('0x34')]!=='VIRTUAL'){var _0x39384b={};_0x39384b[_0x367d08[_0xb9d5('0x35')]]={'$like':'%'+_0x38c225[_0xb9d5('0x24')]['filter']+'%'};return _0x39384b;}})});}_0x4b8245=_[_0xb9d5('0x31')]({},_0x4b8245,_0x38c225[_0xb9d5('0x36')]);var _0x264a94={'where':_0x4b8245['where']};return db['ChatQueueReport']['count'](_0x264a94)[_0xb9d5('0x1b')](function(_0x13eb4f){_0x29b1bb[_0xb9d5('0x16')]=_0x13eb4f;if(_0x38c225[_0xb9d5('0x24')][_0xb9d5('0x37')]){_0x4b8245[_0xb9d5('0x38')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xb9d5('0x39')](_0x4b8245);})[_0xb9d5('0x1b')](function(_0x35d2ec){_0x29b1bb[_0xb9d5('0x3a')]=_0x35d2ec;return _0x29b1bb;})[_0xb9d5('0x1b')](respondWithFilteredResult(_0x141584,_0x4b8245))[_0xb9d5('0x3b')](handleError(_0x141584,null));};exports[_0xb9d5('0x3c')]=function(_0x5d4c76,_0x497b0a){var _0x2f9c96={'raw':!![],'where':{'id':_0x5d4c76[_0xb9d5('0x3d')]['id']}},_0x41cdde={};_0x41cdde[_0xb9d5('0x23')]=_[_0xb9d5('0x3e')](db[_0xb9d5('0x21')][_0xb9d5('0x22')]);_0x41cdde['query']=_[_0xb9d5('0x3e')](_0x5d4c76[_0xb9d5('0x24')]);_0x41cdde[_0xb9d5('0x2e')]=_[_0xb9d5('0x25')](_0x41cdde[_0xb9d5('0x23')],_0x41cdde[_0xb9d5('0x24')]);_0x2f9c96['attributes']=_[_0xb9d5('0x25')](_0x41cdde['model'],qs[_0xb9d5('0x27')](_0x5d4c76['query'][_0xb9d5('0x27')]));_0x2f9c96[_0xb9d5('0x26')]=_0x2f9c96[_0xb9d5('0x26')]['length']?_0x2f9c96[_0xb9d5('0x26')]:_0x41cdde['model'];if(_0x5d4c76[_0xb9d5('0x24')][_0xb9d5('0x37')]){_0x2f9c96[_0xb9d5('0x38')]=[{'all':!![]}];}_0x2f9c96=_[_0xb9d5('0x31')]({},_0x2f9c96,_0x5d4c76[_0xb9d5('0x36')]);return db[_0xb9d5('0x21')][_0xb9d5('0x3f')](_0x2f9c96)[_0xb9d5('0x1b')](handleEntityNotFound(_0x497b0a,null))['then'](respondWithResult(_0x497b0a,null))[_0xb9d5('0x3b')](handleError(_0x497b0a,null));};exports[_0xb9d5('0x40')]=function(_0x4461a1,_0x802e6c){return db[_0xb9d5('0x21')][_0xb9d5('0x40')](_0x4461a1[_0xb9d5('0x41')],{})[_0xb9d5('0x1b')](respondWithResult(_0x802e6c,0xc9))[_0xb9d5('0x3b')](handleError(_0x802e6c,null));};exports[_0xb9d5('0x1a')]=function(_0x53db8d,_0x17e19b){if(_0x53db8d[_0xb9d5('0x41')]['id']){delete _0x53db8d[_0xb9d5('0x41')]['id'];}return db[_0xb9d5('0x21')][_0xb9d5('0x3f')]({'where':{'id':_0x53db8d[_0xb9d5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x17e19b,null))[_0xb9d5('0x1b')](saveUpdates(_0x53db8d[_0xb9d5('0x41')],null))[_0xb9d5('0x1b')](respondWithResult(_0x17e19b,null))[_0xb9d5('0x3b')](handleError(_0x17e19b,null));};exports[_0xb9d5('0x1c')]=function(_0x29099e,_0x3e3b07){return db['ChatQueueReport'][_0xb9d5('0x3f')]({'where':{'id':_0x29099e['params']['id']}})[_0xb9d5('0x1b')](handleEntityNotFound(_0x3e3b07,null))[_0xb9d5('0x1b')](removeEntity(_0x3e3b07,null))['catch'](handleError(_0x3e3b07,null));};exports['describe']=function(_0x47c8ea,_0x5eeacf){return db[_0xb9d5('0x21')][_0xb9d5('0x42')]()[_0xb9d5('0x1b')](respondWithResult(_0x5eeacf,null))['catch'](handleError(_0x5eeacf,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 1869594..b093b41 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 _0x2d29=['moment','request-promise','../../config/environment','./chatQueueReport.attributes','define','report_chat_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x2d29,0x1dd));var _0x92d2=function(_0x5ec607,_0x16c7b7){_0x5ec607=_0x5ec607-0x0;var _0x5275f4=_0x2d29[_0x5ec607];return _0x5275f4;};'use strict';var _=require(_0x92d2('0x0'));var util=require(_0x92d2('0x1'));var logger=require(_0x92d2('0x2'))('api');var moment=require(_0x92d2('0x3'));var BPromise=require('bluebird');var rp=require(_0x92d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92d2('0x5'));var attributes=require(_0x92d2('0x6'));module['exports']=function(_0x5a352e,_0x2490ea){return _0x5a352e[_0x92d2('0x7')]('ChatQueueReport',attributes,{'tableName':_0x92d2('0x8'),'paranoid':![],'indexes':[{'name':_0x92d2('0x9'),'fields':[_0x92d2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31ee=['../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x30d6f0,_0x227961){var _0x51ecad=function(_0x3392d3){while(--_0x3392d3){_0x30d6f0['push'](_0x30d6f0['shift']());}};_0x51ecad(++_0x227961);}(_0x31ee,0xac));var _0xe31e=function(_0x26cf6f,_0x86e045){_0x26cf6f=_0x26cf6f-0x0;var _0x4b9ebd=_0x31ee[_0x26cf6f];return _0x4b9ebd;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require(_0xe31e('0x5'));var rp=require(_0xe31e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe31e('0x7'));var config=require(_0xe31e('0x8'));var attributes=require(_0xe31e('0x9'));module[_0xe31e('0xa')]=function(_0x208010,_0x1b78b5){return _0x208010[_0xe31e('0xb')](_0xe31e('0xc'),attributes,{'tableName':_0xe31e('0xd'),'paranoid':![],'indexes':[{'name':_0xe31e('0xe'),'fields':[_0xe31e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9bd4701..d21e2c9 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 _0xf267=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','update','where','attributes','UpdateChatQueueReport','lodash','util','moment','randomstring'];(function(_0x3d717f,_0x23d861){var _0x2217d5=function(_0x59626a){while(--_0x59626a){_0x3d717f['push'](_0x3d717f['shift']());}};_0x2217d5(++_0x23d861);}(_0xf267,0xea));var _0x7f26=function(_0x5ae423,_0x39c5bf){_0x5ae423=_0x5ae423-0x0;var _0x4f88a2=_0xf267[_0x5ae423];return _0x4f88a2;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var moment=require(_0x7f26('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f26('0x3'));var fs=require('fs');var Redis=require(_0x7f26('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f26('0x5'))(_0x7f26('0x6'));var config=require(_0x7f26('0x7'));var jayson=require(_0x7f26('0x8'));var client=jayson[_0x7f26('0x9')][_0x7f26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d7774,_0x57a705,_0x2c9598){return new BPromise(function(_0x33dc92,_0x5ac1b0){return client[_0x7f26('0xb')](_0x1d7774,_0x2c9598)[_0x7f26('0xc')](function(_0xb6dc39){logger[_0x7f26('0xd')](_0x7f26('0xe'),_0x57a705,'request\x20sent');logger[_0x7f26('0xf')](_0x7f26('0x10'),_0x57a705,_0x7f26('0x11'),JSON['stringify'](_0xb6dc39));if(_0xb6dc39[_0x7f26('0x12')]){if(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x13')]===0x1f4){logger[_0x7f26('0x12')](_0x7f26('0xe'),_0x57a705,_0xb6dc39[_0x7f26('0x12')]['message']);return _0x5ac1b0(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x14')]);}logger['error'](_0x7f26('0xe'),_0x57a705,_0xb6dc39['error'][_0x7f26('0x14')]);return _0x33dc92(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x14')]);}else{logger[_0x7f26('0xd')](_0x7f26('0xe'),_0x57a705,_0x7f26('0x11'));_0x33dc92(_0xb6dc39[_0x7f26('0x15')][_0x7f26('0x14')]);}})[_0x7f26('0x16')](function(_0xf4563d){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x57a705,_0xf4563d);_0x5ac1b0(_0xf4563d);});});}exports[_0x7f26('0x17')]=function(_0x124692){var _0xa45ecb=this;return new Promise(function(_0x47f0a,_0x58c3b){return db[_0x7f26('0x18')][_0x7f26('0x19')](_0x124692[_0x7f26('0x1a')],{'raw':_0x124692[_0x7f26('0x1b')]?_0x124692[_0x7f26('0x1b')][_0x7f26('0x1c')]===undefined?!![]:![]:!![]})[_0x7f26('0xc')](function(_0x320e70){logger[_0x7f26('0xd')](_0x7f26('0x17'),_0x124692);logger[_0x7f26('0xf')]('CreateChatQueueReport',_0x124692,JSON[_0x7f26('0x1d')](_0x320e70));_0x47f0a(_0x320e70);})[_0x7f26('0x16')](function(_0x2927b0){logger[_0x7f26('0x12')](_0x7f26('0x17'),_0x2927b0[_0x7f26('0x14')],_0x124692);_0x58c3b(_0xa45ecb['error'](0x1f4,_0x2927b0[_0x7f26('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2fdb46){var _0x3aebbb=this;return new Promise(function(_0x337251,_0x14e199){return db[_0x7f26('0x18')][_0x7f26('0x1e')](_0x2fdb46[_0x7f26('0x1a')],{'raw':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')][_0x7f26('0x1f')]||null:null,'attributes':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')][_0x7f26('0x20')]||null:null,'limit':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')]['limit']||null:null})[_0x7f26('0xc')](function(_0x337275){logger[_0x7f26('0xd')]('UpdateChatQueueReport',_0x2fdb46);logger[_0x7f26('0xf')]('UpdateChatQueueReport',_0x2fdb46,JSON['stringify'](_0x337275));_0x337251(_0x337275);})[_0x7f26('0x16')](function(_0x2515ec){logger[_0x7f26('0x12')](_0x7f26('0x21'),_0x2515ec[_0x7f26('0x14')],_0x2fdb46);_0x14e199(_0x3aebbb['error'](0x1f4,_0x2515ec[_0x7f26('0x14')]));});});}; \ No newline at end of file +var _0x32df=['create','body','options','then','CreateChatQueueReport','ChatQueueReport','update','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','message','info','ChatQueueReport,\x20%s,\x20%s','result','catch'];(function(_0x3cd329,_0x35d2f5){var _0x1e0797=function(_0x2695a9){while(--_0x2695a9){_0x3cd329['push'](_0x3cd329['shift']());}};_0x1e0797(++_0x35d2f5);}(_0x32df,0x109));var _0xf32d=function(_0x54fd80,_0x430280){_0x54fd80=_0x54fd80-0x0;var _0x415018=_0x32df[_0x54fd80];return _0x415018;};'use strict';var _=require(_0xf32d('0x0'));var util=require('util');var moment=require(_0xf32d('0x1'));var BPromise=require(_0xf32d('0x2'));var rs=require(_0xf32d('0x3'));var fs=require('fs');var Redis=require(_0xf32d('0x4'));var db=require(_0xf32d('0x5'))['db'];var utils=require(_0xf32d('0x6'));var logger=require(_0xf32d('0x7'))(_0xf32d('0x8'));var config=require(_0xf32d('0x9'));var jayson=require(_0xf32d('0xa'));var client=jayson['client'][_0xf32d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4535b6,_0x36efae,_0x3920fb){return new BPromise(function(_0x3f7d44,_0xc7e5c8){return client[_0xf32d('0xc')](_0x4535b6,_0x3920fb)['then'](function(_0x31c47d){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0xf32d('0xd'));logger[_0xf32d('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x36efae,'request\x20sent',JSON[_0xf32d('0xf')](_0x31c47d));if(_0x31c47d['error']){if(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x11')]===0x1f4){logger[_0xf32d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);return _0xc7e5c8(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x36efae,_0x31c47d['error'][_0xf32d('0x12')]);return _0x3f7d44(_0x31c47d[_0xf32d('0x10')][_0xf32d('0x12')]);}else{logger[_0xf32d('0x13')](_0xf32d('0x14'),_0x36efae,_0xf32d('0xd'));_0x3f7d44(_0x31c47d[_0xf32d('0x15')][_0xf32d('0x12')]);}})[_0xf32d('0x16')](function(_0x17aa8c){logger[_0xf32d('0x10')](_0xf32d('0x14'),_0x36efae,_0x17aa8c);_0xc7e5c8(_0x17aa8c);});});}exports['CreateChatQueueReport']=function(_0x3ef6d0){var _0x1f3909=this;return new Promise(function(_0x40f0dc,_0x3dc092){return db['ChatQueueReport'][_0xf32d('0x17')](_0x3ef6d0[_0xf32d('0x18')],{'raw':_0x3ef6d0[_0xf32d('0x19')]?_0x3ef6d0['options']['raw']===undefined?!![]:![]:!![]})[_0xf32d('0x1a')](function(_0x4e0080){logger['info'](_0xf32d('0x1b'),_0x3ef6d0);logger[_0xf32d('0xe')](_0xf32d('0x1b'),_0x3ef6d0,JSON[_0xf32d('0xf')](_0x4e0080));_0x40f0dc(_0x4e0080);})[_0xf32d('0x16')](function(_0x454139){logger[_0xf32d('0x10')](_0xf32d('0x1b'),_0x454139[_0xf32d('0x12')],_0x3ef6d0);_0x3dc092(_0x1f3909['error'](0x1f4,_0x454139[_0xf32d('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x43121f){var _0x31a572=this;return new Promise(function(_0x4aa9a7,_0x3103af){return db[_0xf32d('0x1c')][_0xf32d('0x1d')](_0x43121f[_0xf32d('0x18')],{'raw':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['where']||null:null,'attributes':_0x43121f[_0xf32d('0x19')]?_0x43121f[_0xf32d('0x19')]['attributes']||null:null,'limit':_0x43121f['options']?_0x43121f[_0xf32d('0x19')][_0xf32d('0x1e')]||null:null})[_0xf32d('0x1a')](function(_0x5ed400){logger[_0xf32d('0x13')](_0xf32d('0x1f'),_0x43121f);logger[_0xf32d('0xe')]('UpdateChatQueueReport',_0x43121f,JSON[_0xf32d('0xf')](_0x5ed400));_0x4aa9a7(_0x5ed400);})[_0xf32d('0x16')](function(_0xa4b15b){logger[_0xf32d('0x10')](_0xf32d('0x1f'),_0xa4b15b[_0xf32d('0x12')],_0x43121f);_0x3103af(_0x31a572[_0xf32d('0x10')](0x1f4,_0xa4b15b[_0xf32d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 35f93c4..66e0054 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 _0x33d2=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x33d2,0x8b));var _0x233d=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0x33d2[_0x336c8b];return _0x4dd2f6;};'use strict';var multer=require(_0x233d('0x0'));var util=require(_0x233d('0x1'));var path=require(_0x233d('0x2'));var timeout=require(_0x233d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x233d('0x4'));var interaction=require(_0x233d('0x5'));var config=require('../../config/environment');var controller=require(_0x233d('0x6'));router[_0x233d('0x7')]('/',auth[_0x233d('0x8')](),controller[_0x233d('0x9')]);router[_0x233d('0x7')](_0x233d('0xa'),auth[_0x233d('0x8')](),controller[_0x233d('0xb')]);router['get'](_0x233d('0xc'),auth['isAuthenticated'](),controller[_0x233d('0xd')]);router[_0x233d('0xe')]('/',auth[_0x233d('0x8')](),controller[_0x233d('0xf')]);router[_0x233d('0x10')](_0x233d('0xc'),auth[_0x233d('0x8')](),controller[_0x233d('0x11')]);router[_0x233d('0x12')](_0x233d('0xc'),auth[_0x233d('0x8')](),controller[_0x233d('0x13')]);module[_0x233d('0x14')]=router; \ No newline at end of file +var _0x4d5e=['post','create','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4d5e,0x169));var _0xe4d5=function(_0x9dc979,_0x5d3ac8){_0x9dc979=_0x9dc979-0x0;var _0x532670=_0x4d5e[_0x9dc979];return _0x532670;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4d5('0x0'));var timeout=require(_0xe4d5('0x1'));var express=require(_0xe4d5('0x2'));var router=express[_0xe4d5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4d5('0x4'));var config=require(_0xe4d5('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe4d5('0x6')]);router['get'](_0xe4d5('0x7'),auth[_0xe4d5('0x8')](),controller[_0xe4d5('0x9')]);router[_0xe4d5('0xa')](_0xe4d5('0xb'),auth[_0xe4d5('0x8')](),controller[_0xe4d5('0xc')]);router[_0xe4d5('0xd')]('/',auth[_0xe4d5('0x8')](),controller[_0xe4d5('0xe')]);router['put'](_0xe4d5('0xb'),auth[_0xe4d5('0x8')](),controller['update']);router[_0xe4d5('0xf')]('/:id',auth[_0xe4d5('0x8')](),controller['destroy']);module[_0xe4d5('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2babacb..731e156 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 _0x0974=['queue','DATE','moment','sequelize','exports','STRING','ENUM'];(function(_0x1066a3,_0x4ae4b6){var _0x488ca3=function(_0x56377c){while(--_0x56377c){_0x1066a3['push'](_0x1066a3['shift']());}};_0x488ca3(++_0x4ae4b6);}(_0x0974,0x1b4));var _0x4097=function(_0x1b598d,_0x1d4db8){_0x1b598d=_0x1b598d-0x0;var _0x5a3ee6=_0x0974[_0x1b598d];return _0x5a3ee6;};'use strict';var moment=require(_0x4097('0x0'));var Sequelize=require(_0x4097('0x1'));module[_0x4097('0x2')]={'uniqueid':{'type':Sequelize[_0x4097('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4097('0x4')]('account','agent','queue'),'allowNull':![],'defaultValue':_0x4097('0x5')},'transferredAt':{'type':Sequelize[_0x4097('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x3245=['exports','STRING','ENUM','account','agent','queue','DATE','moment','sequelize'];(function(_0x11036e,_0x4e7f46){var _0x5cfc4c=function(_0x1050b7){while(--_0x1050b7){_0x11036e['push'](_0x11036e['shift']());}};_0x5cfc4c(++_0x4e7f46);}(_0x3245,0x11e));var _0x5324=function(_0x3408a7,_0x3ce209){_0x3408a7=_0x3408a7-0x0;var _0x54d552=_0x3245[_0x3408a7];return _0x54d552;};'use strict';var moment=require(_0x5324('0x0'));var Sequelize=require(_0x5324('0x1'));module[_0x5324('0x2')]={'uniqueid':{'type':Sequelize[_0x5324('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5324('0x4')](_0x5324('0x5'),_0x5324('0x6'),'queue'),'allowNull':![],'defaultValue':_0x5324('0x7')},'transferredAt':{'type':Sequelize[_0x5324('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1bd472a..112e331 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 _0x8a0b=['limit','set','Content-Range','reject','update','then','error','stack','name','send','ChatTransferReport','rawAttributes','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','catch','show','params','length','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset'];(function(_0x3776d9,_0x2dbf19){var _0x312918=function(_0x4e0389){while(--_0x4e0389){_0x3776d9['push'](_0x3776d9['shift']());}};_0x312918(++_0x2dbf19);}(_0x8a0b,0x71));var _0xb8a0=function(_0x25c3da,_0x14ea39){_0x25c3da=_0x25c3da-0x0;var _0x23f51a=_0x8a0b[_0x25c3da];return _0x23f51a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb8a0('0x0'));var rimraf=require(_0xb8a0('0x1'));var zipdir=require(_0xb8a0('0x2'));var jsonpatch=require(_0xb8a0('0x3'));var rp=require(_0xb8a0('0x4'));var moment=require('moment');var BPromise=require(_0xb8a0('0x5'));var Mustache=require(_0xb8a0('0x6'));var util=require(_0xb8a0('0x7'));var path=require(_0xb8a0('0x8'));var sox=require(_0xb8a0('0x9'));var csv=require(_0xb8a0('0xa'));var ejs=require(_0xb8a0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb8a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb8a0('0xe'));var Papa=require(_0xb8a0('0xf'));var Redis=require(_0xb8a0('0x10'));var authService=require(_0xb8a0('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a0('0x12'))(_0xb8a0('0x13'));var utils=require(_0xb8a0('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x345481,_0x36d169){_0x36d169=_0x36d169||0xcc;return function(_0x6a6aa6){if(_0x6a6aa6){return _0x345481[_0xb8a0('0x15')](_0x36d169);}return _0x345481[_0xb8a0('0x16')](_0x36d169)[_0xb8a0('0x17')]();};}function respondWithResult(_0x3ff403,_0xf5bb30){_0xf5bb30=_0xf5bb30||0xc8;return function(_0x4edaff){if(_0x4edaff){return _0x3ff403[_0xb8a0('0x16')](_0xf5bb30)[_0xb8a0('0x18')](_0x4edaff);}};}function respondWithFilteredResult(_0x173424,_0x4ad54f){return function(_0x195fb3){if(_0x195fb3){var _0x3ff118=_0x195fb3[_0xb8a0('0x19')],_0x2516d=_0x4ad54f[_0xb8a0('0x1a')],_0x3426f7=_0x4ad54f[_0xb8a0('0x1a')]+_0x4ad54f[_0xb8a0('0x1b')],_0x3b0ec4;if(_0x3426f7>=_0x3ff118){_0x3426f7=_0x3ff118;_0x3b0ec4=0xc8;}else{_0x3b0ec4=0xce;}_0x173424[_0xb8a0('0x16')](_0x3b0ec4);return _0x173424[_0xb8a0('0x1c')](_0xb8a0('0x1d'),_0x2516d+'-'+_0x3426f7+'/'+_0x3ff118)[_0xb8a0('0x18')](_0x195fb3);}return null;};}function patchUpdates(_0x5830ac){return function(_0x37fa3e){try{jsonpatch['apply'](_0x37fa3e,_0x5830ac,!![]);}catch(_0x47e538){return BPromise[_0xb8a0('0x1e')](_0x47e538);}return _0x37fa3e['save']();};}function saveUpdates(_0x1bb25e,_0x2b0937){return function(_0xda9a74){if(_0xda9a74){return _0xda9a74[_0xb8a0('0x1f')](_0x1bb25e)[_0xb8a0('0x20')](function(_0x2f1cfa){return _0x2f1cfa;});}return null;};}function removeEntity(_0x5d2def,_0x272237){return function(_0x5f057c){if(_0x5f057c){return _0x5f057c['destroy']()[_0xb8a0('0x20')](function(){_0x5d2def['status'](0xcc)[_0xb8a0('0x17')]();});}};}function handleEntityNotFound(_0x98a13a,_0x145afb){return function(_0x54f63d){if(!_0x54f63d){_0x98a13a[_0xb8a0('0x15')](0x194);}return _0x54f63d;};}function handleError(_0x1a21f3,_0x247334){_0x247334=_0x247334||0x1f4;return function(_0x1e1af9){logger[_0xb8a0('0x21')](_0x1e1af9[_0xb8a0('0x22')]);if(_0x1e1af9['name']){delete _0x1e1af9[_0xb8a0('0x23')];}_0x1a21f3[_0xb8a0('0x16')](_0x247334)[_0xb8a0('0x24')](_0x1e1af9);};}exports['index']=function(_0xd99143,_0x3616ac){var _0xc78a79={},_0x43ad2e={},_0x260fb2={'count':0x0,'rows':[]};var _0x14a266=db[_0xb8a0('0x25')][_0xb8a0('0x26')];_0x43ad2e['model']=_[_0xb8a0('0x27')](_0x14a266);_0x43ad2e[_0xb8a0('0x28')]=_[_0xb8a0('0x27')](_0xd99143[_0xb8a0('0x28')]);_0x43ad2e[_0xb8a0('0x29')]=_['intersection'](_0x43ad2e[_0xb8a0('0x2a')],_0x43ad2e[_0xb8a0('0x28')]);_0xc78a79['attributes']=_[_0xb8a0('0x2b')](_0x43ad2e[_0xb8a0('0x2a')],qs['fields'](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x2c')]));_0xc78a79[_0xb8a0('0x2d')]=_0xc78a79['attributes']['length']?_0xc78a79['attributes']:_0x43ad2e['model'];if(!_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x2e')](_0xb8a0('0x2f'))){_0xc78a79['limit']=qs[_0xb8a0('0x1b')](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x1b')]);_0xc78a79[_0xb8a0('0x1a')]=qs[_0xb8a0('0x1a')](_0xd99143['query'][_0xb8a0('0x1a')]);}_0xc78a79[_0xb8a0('0x30')]=qs[_0xb8a0('0x31')](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x31')]);_0xc78a79[_0xb8a0('0x32')]=qs[_0xb8a0('0x29')](_[_0xb8a0('0x33')](_0xd99143[_0xb8a0('0x28')],_0x43ad2e['filters']));if(_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x34')]){_0xc78a79[_0xb8a0('0x32')]=_['merge'](_0xc78a79[_0xb8a0('0x32')],{'$or':_[_0xb8a0('0x35')](_0x14a266,function(_0x1a0321){if(_0x1a0321[_0xb8a0('0x36')][_0xb8a0('0x37')]!==_0xb8a0('0x38')){var _0x457f23={};_0x457f23[_0x1a0321[_0xb8a0('0x39')]]={'$like':'%'+_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x34')]+'%'};return _0x457f23;}})});}_0xc78a79=_[_0xb8a0('0x3a')]({},_0xc78a79,_0xd99143[_0xb8a0('0x3b')]);var _0x56f135={'where':_0xc78a79[_0xb8a0('0x32')]};return db[_0xb8a0('0x25')]['count'](_0x56f135)[_0xb8a0('0x20')](function(_0x599944){_0x260fb2['count']=_0x599944;if(_0xd99143[_0xb8a0('0x28')]['includeAll']){_0xc78a79['include']=[{'all':!![]}];}return db[_0xb8a0('0x25')]['findAll'](_0xc78a79);})[_0xb8a0('0x20')](function(_0x17188a){_0x260fb2['rows']=_0x17188a;return _0x260fb2;})['then'](respondWithFilteredResult(_0x3616ac,_0xc78a79))[_0xb8a0('0x3c')](handleError(_0x3616ac,null));};exports[_0xb8a0('0x3d')]=function(_0x51b628,_0x27da3d){var _0x3a3ae7={'raw':!![],'where':{'id':_0x51b628[_0xb8a0('0x3e')]['id']}},_0x5b7e95={};_0x5b7e95[_0xb8a0('0x2a')]=_[_0xb8a0('0x27')](db[_0xb8a0('0x25')][_0xb8a0('0x26')]);_0x5b7e95[_0xb8a0('0x28')]=_[_0xb8a0('0x27')](_0x51b628['query']);_0x5b7e95['filters']=_[_0xb8a0('0x2b')](_0x5b7e95[_0xb8a0('0x2a')],_0x5b7e95[_0xb8a0('0x28')]);_0x3a3ae7[_0xb8a0('0x2d')]=_[_0xb8a0('0x2b')](_0x5b7e95[_0xb8a0('0x2a')],qs[_0xb8a0('0x2c')](_0x51b628[_0xb8a0('0x28')][_0xb8a0('0x2c')]));_0x3a3ae7[_0xb8a0('0x2d')]=_0x3a3ae7['attributes'][_0xb8a0('0x3f')]?_0x3a3ae7[_0xb8a0('0x2d')]:_0x5b7e95['model'];if(_0x51b628[_0xb8a0('0x28')][_0xb8a0('0x40')]){_0x3a3ae7[_0xb8a0('0x41')]=[{'all':!![]}];}_0x3a3ae7=_[_0xb8a0('0x3a')]({},_0x3a3ae7,_0x51b628['options']);return db['ChatTransferReport']['find'](_0x3a3ae7)[_0xb8a0('0x20')](handleEntityNotFound(_0x27da3d,null))[_0xb8a0('0x20')](respondWithResult(_0x27da3d,null))['catch'](handleError(_0x27da3d,null));};exports[_0xb8a0('0x42')]=function(_0x52330b,_0x1c4c99){return db[_0xb8a0('0x25')]['create'](_0x52330b[_0xb8a0('0x43')],{})[_0xb8a0('0x20')](respondWithResult(_0x1c4c99,0xc9))['catch'](handleError(_0x1c4c99,null));};exports[_0xb8a0('0x1f')]=function(_0x4b72fd,_0x3653c7){if(_0x4b72fd['body']['id']){delete _0x4b72fd[_0xb8a0('0x43')]['id'];}return db[_0xb8a0('0x25')][_0xb8a0('0x44')]({'where':{'id':_0x4b72fd['params']['id']}})[_0xb8a0('0x20')](handleEntityNotFound(_0x3653c7,null))['then'](saveUpdates(_0x4b72fd[_0xb8a0('0x43')],null))[_0xb8a0('0x20')](respondWithResult(_0x3653c7,null))[_0xb8a0('0x3c')](handleError(_0x3653c7,null));};exports['destroy']=function(_0x17bdaf,_0x20f67e){return db[_0xb8a0('0x25')]['find']({'where':{'id':_0x17bdaf[_0xb8a0('0x3e')]['id']}})[_0xb8a0('0x20')](handleEntityNotFound(_0x20f67e,null))[_0xb8a0('0x20')](removeEntity(_0x20f67e,null))[_0xb8a0('0x3c')](handleError(_0x20f67e,null));};exports['describe']=function(_0x4246e4,_0x340d6a){return db['ChatTransferReport'][_0xb8a0('0x45')]()['then'](respondWithResult(_0x340d6a,null))[_0xb8a0('0x3c')](handleError(_0x340d6a,null));}; \ No newline at end of file +var _0x042d=['merge','includeAll','rows','catch','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','type','key','VIRTUAL','field'];(function(_0x84ce83,_0x98461d){var _0x4490be=function(_0x3a9a69){while(--_0x3a9a69){_0x84ce83['push'](_0x84ce83['shift']());}};_0x4490be(++_0x98461d);}(_0x042d,0x12b));var _0xd042=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x042d[_0x2390bd];return _0x3a969d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd042('0x0'));var rimraf=require(_0xd042('0x1'));var zipdir=require(_0xd042('0x2'));var jsonpatch=require(_0xd042('0x3'));var rp=require('request-promise');var moment=require(_0xd042('0x4'));var BPromise=require(_0xd042('0x5'));var Mustache=require('mustache');var util=require(_0xd042('0x6'));var path=require(_0xd042('0x7'));var sox=require(_0xd042('0x8'));var csv=require(_0xd042('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd042('0xa'));var squel=require(_0xd042('0xb'));var crypto=require(_0xd042('0xc'));var jsforce=require(_0xd042('0xd'));var deskjs=require(_0xd042('0xe'));var toCsv=require(_0xd042('0x9'));var querystring=require(_0xd042('0xf'));var Papa=require(_0xd042('0x10'));var Redis=require('ioredis');var authService=require(_0xd042('0x11'));var qs=require(_0xd042('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd042('0x13'))('api');var utils=require(_0xd042('0x14'));var config=require(_0xd042('0x15'));var db=require(_0xd042('0x16'))['db'];function respondWithStatusCode(_0x37b23e,_0x408777){_0x408777=_0x408777||0xcc;return function(_0x4629e9){if(_0x4629e9){return _0x37b23e[_0xd042('0x17')](_0x408777);}return _0x37b23e[_0xd042('0x18')](_0x408777)[_0xd042('0x19')]();};}function respondWithResult(_0x2f8648,_0x27305a){_0x27305a=_0x27305a||0xc8;return function(_0x29dac6){if(_0x29dac6){return _0x2f8648[_0xd042('0x18')](_0x27305a)['json'](_0x29dac6);}};}function respondWithFilteredResult(_0x221123,_0x22a7d6){return function(_0x64a16){if(_0x64a16){var _0xd8a61e=_0x64a16[_0xd042('0x1a')],_0x4635d5=_0x22a7d6['offset'],_0x42654e=_0x22a7d6['offset']+_0x22a7d6[_0xd042('0x1b')],_0x390012;if(_0x42654e>=_0xd8a61e){_0x42654e=_0xd8a61e;_0x390012=0xc8;}else{_0x390012=0xce;}_0x221123[_0xd042('0x18')](_0x390012);return _0x221123[_0xd042('0x1c')](_0xd042('0x1d'),_0x4635d5+'-'+_0x42654e+'/'+_0xd8a61e)['json'](_0x64a16);}return null;};}function patchUpdates(_0x596b76){return function(_0x3436de){try{jsonpatch[_0xd042('0x1e')](_0x3436de,_0x596b76,!![]);}catch(_0x11a298){return BPromise[_0xd042('0x1f')](_0x11a298);}return _0x3436de[_0xd042('0x20')]();};}function saveUpdates(_0x296359,_0x2a6d96){return function(_0x511637){if(_0x511637){return _0x511637[_0xd042('0x21')](_0x296359)[_0xd042('0x22')](function(_0xfb35f1){return _0xfb35f1;});}return null;};}function removeEntity(_0x59f9ff,_0x280260){return function(_0x2a09de){if(_0x2a09de){return _0x2a09de[_0xd042('0x23')]()['then'](function(){_0x59f9ff[_0xd042('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b53c8,_0x17b55d){return function(_0x1d836){if(!_0x1d836){_0x3b53c8[_0xd042('0x17')](0x194);}return _0x1d836;};}function handleError(_0x483fd8,_0x2402c1){_0x2402c1=_0x2402c1||0x1f4;return function(_0x5719d3){logger[_0xd042('0x24')](_0x5719d3[_0xd042('0x25')]);if(_0x5719d3[_0xd042('0x26')]){delete _0x5719d3[_0xd042('0x26')];}_0x483fd8['status'](_0x2402c1)[_0xd042('0x27')](_0x5719d3);};}exports[_0xd042('0x28')]=function(_0x379304,_0x3767cb){var _0x2a0179={},_0x486523={},_0x27f561={'count':0x0,'rows':[]};var _0x41a37f=db[_0xd042('0x29')]['rawAttributes'];_0x486523[_0xd042('0x2a')]=_[_0xd042('0x2b')](_0x41a37f);_0x486523[_0xd042('0x2c')]=_[_0xd042('0x2b')](_0x379304[_0xd042('0x2c')]);_0x486523[_0xd042('0x2d')]=_['intersection'](_0x486523['model'],_0x486523[_0xd042('0x2c')]);_0x2a0179['attributes']=_[_0xd042('0x2e')](_0x486523[_0xd042('0x2a')],qs[_0xd042('0x2f')](_0x379304[_0xd042('0x2c')][_0xd042('0x2f')]));_0x2a0179[_0xd042('0x30')]=_0x2a0179['attributes'][_0xd042('0x31')]?_0x2a0179['attributes']:_0x486523[_0xd042('0x2a')];if(!_0x379304[_0xd042('0x2c')][_0xd042('0x32')](_0xd042('0x33'))){_0x2a0179[_0xd042('0x1b')]=qs[_0xd042('0x1b')](_0x379304[_0xd042('0x2c')][_0xd042('0x1b')]);_0x2a0179[_0xd042('0x34')]=qs['offset'](_0x379304['query'][_0xd042('0x34')]);}_0x2a0179[_0xd042('0x35')]=qs[_0xd042('0x36')](_0x379304['query'][_0xd042('0x36')]);_0x2a0179[_0xd042('0x37')]=qs[_0xd042('0x2d')](_['pick'](_0x379304[_0xd042('0x2c')],_0x486523['filters']));if(_0x379304[_0xd042('0x2c')][_0xd042('0x38')]){_0x2a0179[_0xd042('0x37')]=_['merge'](_0x2a0179[_0xd042('0x37')],{'$or':_['map'](_0x41a37f,function(_0x2ac757){if(_0x2ac757[_0xd042('0x39')][_0xd042('0x3a')]!==_0xd042('0x3b')){var _0x293c56={};_0x293c56[_0x2ac757[_0xd042('0x3c')]]={'$like':'%'+_0x379304[_0xd042('0x2c')][_0xd042('0x38')]+'%'};return _0x293c56;}})});}_0x2a0179=_[_0xd042('0x3d')]({},_0x2a0179,_0x379304['options']);var _0x4a96ce={'where':_0x2a0179['where']};return db['ChatTransferReport']['count'](_0x4a96ce)[_0xd042('0x22')](function(_0x3a5aa7){_0x27f561[_0xd042('0x1a')]=_0x3a5aa7;if(_0x379304[_0xd042('0x2c')][_0xd042('0x3e')]){_0x2a0179['include']=[{'all':!![]}];}return db[_0xd042('0x29')]['findAll'](_0x2a0179);})[_0xd042('0x22')](function(_0x339cb5){_0x27f561[_0xd042('0x3f')]=_0x339cb5;return _0x27f561;})[_0xd042('0x22')](respondWithFilteredResult(_0x3767cb,_0x2a0179))[_0xd042('0x40')](handleError(_0x3767cb,null));};exports['show']=function(_0x240cba,_0x39943e){var _0x3d673d={'raw':!![],'where':{'id':_0x240cba[_0xd042('0x41')]['id']}},_0x4888a9={};_0x4888a9[_0xd042('0x2a')]=_[_0xd042('0x2b')](db[_0xd042('0x29')]['rawAttributes']);_0x4888a9[_0xd042('0x2c')]=_[_0xd042('0x2b')](_0x240cba[_0xd042('0x2c')]);_0x4888a9[_0xd042('0x2d')]=_[_0xd042('0x2e')](_0x4888a9[_0xd042('0x2a')],_0x4888a9[_0xd042('0x2c')]);_0x3d673d['attributes']=_[_0xd042('0x2e')](_0x4888a9[_0xd042('0x2a')],qs[_0xd042('0x2f')](_0x240cba[_0xd042('0x2c')][_0xd042('0x2f')]));_0x3d673d[_0xd042('0x30')]=_0x3d673d[_0xd042('0x30')][_0xd042('0x31')]?_0x3d673d['attributes']:_0x4888a9[_0xd042('0x2a')];if(_0x240cba[_0xd042('0x2c')][_0xd042('0x3e')]){_0x3d673d[_0xd042('0x42')]=[{'all':!![]}];}_0x3d673d=_['merge']({},_0x3d673d,_0x240cba[_0xd042('0x43')]);return db[_0xd042('0x29')][_0xd042('0x44')](_0x3d673d)['then'](handleEntityNotFound(_0x39943e,null))[_0xd042('0x22')](respondWithResult(_0x39943e,null))[_0xd042('0x40')](handleError(_0x39943e,null));};exports[_0xd042('0x45')]=function(_0x6c2606,_0x4b2961){return db[_0xd042('0x29')][_0xd042('0x45')](_0x6c2606[_0xd042('0x46')],{})[_0xd042('0x22')](respondWithResult(_0x4b2961,0xc9))[_0xd042('0x40')](handleError(_0x4b2961,null));};exports[_0xd042('0x21')]=function(_0x4ec83d,_0x5941cd){if(_0x4ec83d[_0xd042('0x46')]['id']){delete _0x4ec83d[_0xd042('0x46')]['id'];}return db[_0xd042('0x29')]['find']({'where':{'id':_0x4ec83d['params']['id']}})[_0xd042('0x22')](handleEntityNotFound(_0x5941cd,null))[_0xd042('0x22')](saveUpdates(_0x4ec83d[_0xd042('0x46')],null))[_0xd042('0x22')](respondWithResult(_0x5941cd,null))[_0xd042('0x40')](handleError(_0x5941cd,null));};exports['destroy']=function(_0x5ea8a,_0x5aa6e8){return db[_0xd042('0x29')][_0xd042('0x44')]({'where':{'id':_0x5ea8a['params']['id']}})['then'](handleEntityNotFound(_0x5aa6e8,null))[_0xd042('0x22')](removeEntity(_0x5aa6e8,null))[_0xd042('0x40')](handleError(_0x5aa6e8,null));};exports[_0xd042('0x47')]=function(_0x1fbd84,_0x4baac7){return db[_0xd042('0x29')][_0xd042('0x47')]()[_0xd042('0x22')](respondWithResult(_0x4baac7,null))[_0xd042('0x40')](handleError(_0x4baac7,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 9207aa5..b46a33d 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 _0xc336=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','moment'];(function(_0x381a10,_0x1a3204){var _0xadf6cb=function(_0x1d53b7){while(--_0x1d53b7){_0x381a10['push'](_0x381a10['shift']());}};_0xadf6cb(++_0x1a3204);}(_0xc336,0x1d6));var _0x6c33=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xc336[_0x521929];return _0x632436;};'use strict';var _=require(_0x6c33('0x0'));var util=require(_0x6c33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6c33('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c33('0x3'));var rimraf=require(_0x6c33('0x4'));var config=require(_0x6c33('0x5'));var attributes=require(_0x6c33('0x6'));module[_0x6c33('0x7')]=function(_0x595f7b,_0x4a3653){return _0x595f7b[_0x6c33('0x8')](_0x6c33('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6c33('0xa'),'fields':[_0x6c33('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb76=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes'];(function(_0x72bccf,_0x584e4b){var _0x11b6b6=function(_0x3e7f98){while(--_0x3e7f98){_0x72bccf['push'](_0x72bccf['shift']());}};_0x11b6b6(++_0x584e4b);}(_0xdb76,0x8c));var _0x6db7=function(_0x327f76,_0x56d3c5){_0x327f76=_0x327f76-0x0;var _0x43c29c=_0xdb76[_0x327f76];return _0x43c29c;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var logger=require(_0x6db7('0x2'))(_0x6db7('0x3'));var moment=require(_0x6db7('0x4'));var BPromise=require(_0x6db7('0x5'));var rp=require(_0x6db7('0x6'));var fs=require('fs');var path=require(_0x6db7('0x7'));var rimraf=require('rimraf');var config=require(_0x6db7('0x8'));var attributes=require(_0x6db7('0x9'));module[_0x6db7('0xa')]=function(_0x536d56,_0x1801ba){return _0x536d56[_0x6db7('0xb')](_0x6db7('0xc'),attributes,{'tableName':_0x6db7('0xd'),'paranoid':![],'indexes':[{'name':_0x6db7('0xe'),'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 6e56666..180590b 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 _0x8093=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8093,0xa9));var _0x3809=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0x8093[_0x27eda0];return _0x2b63a5;};'use strict';var _=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var moment=require(_0x3809('0x2'));var BPromise=require(_0x3809('0x3'));var rs=require(_0x3809('0x4'));var fs=require('fs');var Redis=require(_0x3809('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3809('0x6'));var logger=require(_0x3809('0x7'))(_0x3809('0x8'));var config=require(_0x3809('0x9'));var jayson=require(_0x3809('0xa'));var client=jayson[_0x3809('0xb')][_0x3809('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x195cc8,_0x32d72d,_0x31db08){return new BPromise(function(_0x38aa21,_0x156d98){return client['request'](_0x195cc8,_0x31db08)[_0x3809('0xd')](function(_0xb90209){logger[_0x3809('0xe')](_0x3809('0xf'),_0x32d72d,'request\x20sent');logger['debug'](_0x3809('0x10'),_0x32d72d,'request\x20sent',JSON[_0x3809('0x11')](_0xb90209));if(_0xb90209['error']){if(_0xb90209['error'][_0x3809('0x12')]===0x1f4){logger[_0x3809('0x13')](_0x3809('0xf'),_0x32d72d,_0xb90209['error'][_0x3809('0x14')]);return _0x156d98(_0xb90209[_0x3809('0x13')][_0x3809('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x32d72d,_0xb90209['error'][_0x3809('0x14')]);return _0x38aa21(_0xb90209[_0x3809('0x13')][_0x3809('0x14')]);}else{logger['info'](_0x3809('0xf'),_0x32d72d,'request\x20sent');_0x38aa21(_0xb90209[_0x3809('0x15')][_0x3809('0x14')]);}})[_0x3809('0x16')](function(_0x190271){logger[_0x3809('0x13')](_0x3809('0xf'),_0x32d72d,_0x190271);_0x156d98(_0x190271);});});} \ No newline at end of file +var _0x75c5=['info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xf34924,_0x24da2b){var _0x27f8ec=function(_0x41ad08){while(--_0x41ad08){_0xf34924['push'](_0xf34924['shift']());}};_0x27f8ec(++_0x24da2b);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x575c('0x0'));var util=require(_0x575c('0x1'));var moment=require(_0x575c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x575c('0x3'));var db=require(_0x575c('0x4'))['db'];var utils=require(_0x575c('0x5'));var logger=require(_0x575c('0x6'))(_0x575c('0x7'));var config=require('../../config/environment');var jayson=require(_0x575c('0x8'));var client=jayson[_0x575c('0x9')][_0x575c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc786e7,_0x2d0629,_0x204764){return new BPromise(function(_0x163b31,_0x207199){return client[_0x575c('0xb')](_0xc786e7,_0x204764)[_0x575c('0xc')](function(_0x5b2fb1){logger[_0x575c('0xd')](_0x575c('0xe'),_0x2d0629,'request\x20sent');logger[_0x575c('0xf')](_0x575c('0x10'),_0x2d0629,'request\x20sent',JSON[_0x575c('0x11')](_0x5b2fb1));if(_0x5b2fb1['error']){if(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d0629,_0x5b2fb1['error'][_0x575c('0x14')]);return _0x207199(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x14')]);}logger[_0x575c('0x12')](_0x575c('0xe'),_0x2d0629,_0x5b2fb1[_0x575c('0x12')]['message']);return _0x163b31(_0x5b2fb1[_0x575c('0x12')][_0x575c('0x14')]);}else{logger[_0x575c('0xd')](_0x575c('0xe'),_0x2d0629,_0x575c('0x15'));_0x163b31(_0x5b2fb1[_0x575c('0x16')][_0x575c('0x14')]);}})[_0x575c('0x17')](function(_0x4b14fe){logger[_0x575c('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2d0629,_0x4b14fe);_0x207199(_0x4b14fe);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5fc968c..e233bf1 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 _0x2807=['update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x258e4e,_0x54ed6a){var _0x21df19=function(_0x3af695){while(--_0x3af695){_0x258e4e['push'](_0x258e4e['shift']());}};_0x21df19(++_0x54ed6a);}(_0x2807,0x1bc));var _0x7280=function(_0x253165,_0x32115c){_0x253165=_0x253165-0x0;var _0x564756=_0x2807[_0x253165];return _0x564756;};'use strict';var multer=require(_0x7280('0x0'));var util=require('util');var path=require(_0x7280('0x1'));var timeout=require(_0x7280('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7280('0x3'));var config=require(_0x7280('0x4'));var controller=require(_0x7280('0x5'));router[_0x7280('0x6')]('/',auth[_0x7280('0x7')](),controller[_0x7280('0x8')]);router[_0x7280('0x6')](_0x7280('0x9'),auth[_0x7280('0x7')](),controller[_0x7280('0xa')]);router['get'](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0xc')]);router[_0x7280('0xd')]('/',auth['isAuthenticated'](),controller[_0x7280('0xe')]);router[_0x7280('0xf')](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0x10')]);router[_0x7280('0x11')](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0x12')]);module[_0x7280('0x13')]=router; \ No newline at end of file +var _0x1c91=['/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x1c91,0xb8));var _0x11c9=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x1c91[_0x34bc30];return _0x5706de;};'use strict';var multer=require('multer');var util=require(_0x11c9('0x0'));var path=require(_0x11c9('0x1'));var timeout=require(_0x11c9('0x2'));var express=require(_0x11c9('0x3'));var router=express[_0x11c9('0x4')]();var auth=require(_0x11c9('0x5'));var interaction=require(_0x11c9('0x6'));var config=require(_0x11c9('0x7'));var controller=require(_0x11c9('0x8'));router[_0x11c9('0x9')]('/',auth[_0x11c9('0xa')](),controller[_0x11c9('0xb')]);router[_0x11c9('0x9')]('/describe',auth[_0x11c9('0xa')](),controller['describe']);router[_0x11c9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x11c9('0xc')]);router[_0x11c9('0xd')]('/',auth[_0x11c9('0xa')](),controller[_0x11c9('0xe')]);router[_0x11c9('0xf')](_0x11c9('0x10'),auth['isAuthenticated'](),controller[_0x11c9('0x11')]);router[_0x11c9('0x12')](_0x11c9('0x10'),auth[_0x11c9('0xa')](),controller[_0x11c9('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 5188a9d..c82ef27 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 _0x9bde=['name','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x9bde,0x19d));var _0xe9bd=function(_0x4674b4,_0x1b097b){_0x4674b4=_0x4674b4-0x0;var _0x5049c0=_0x9bde[_0x4674b4];return _0x5049c0;};'use strict';var Sequelize=require(_0xe9bd('0x0'));var rs=require(_0xe9bd('0x1'));module[_0xe9bd('0x2')]={'name':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'unique':_0xe9bd('0x4')},'description':{'type':Sequelize[_0xe9bd('0x3')]},'mapKey':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x5')},'mapKeyOffline':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x6')},'customerAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9bd('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe9bd('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe9bd('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe9bd('0xa')](_0xe9bd('0xb'),_0xe9bd('0xc')),'defaultValue':_0xe9bd('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0xd')},'start_chat_button':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'header_offline':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xf')},'download_transcript':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe9bd('0x11')]},'closingQuestion':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x14')},'placeholderMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x15')},'closingMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x16')},'closingMessageButton':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'skipMessageButton':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x17')},'conditionAgreement':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xe9bd('0x18'),_0xe9bd('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return JSON[_0xe9bd('0x1a')]({'items':[{'type':_0xe9bd('0x1b'),'variable':null,'config':{'placeholder':_0xe9bd('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xe9bd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe9bd('0x1d')]('onlineForm')?JSON['parse'](this['getDataValue'](_0xe9bd('0x1e'))):{};},'set':function(_0x35262a){return this[_0xe9bd('0x1f')]('onlineForm',JSON[_0xe9bd('0x1a')](_0x35262a));}},'offlineForm':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return JSON[_0xe9bd('0x1a')]({'items':[{'type':_0xe9bd('0x1b'),'props':{'title':_0xe9bd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x5'),'type':_0xe9bd('0x5')},'variable':null},{'type':_0xe9bd('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xe9bd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe9bd('0x22'))?JSON[_0xe9bd('0x23')](this[_0xe9bd('0x1d')](_0xe9bd('0x22'))):{};},'set':function(_0x454a8a){return this[_0xe9bd('0x1f')]('offlineForm',JSON['stringify'](_0x454a8a));}},'token':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':function(){return rs[_0xe9bd('0x24')]();}},'autoclose':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe9bd('0x3')]},'forwardOffline':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe9bd('0x3')]},'waitingTitle':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x25')},'offlineMessageBody':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x17')},'sendUnmanaged':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe9bd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return _0xe9bd('0x28');}},'notificationSound':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x2a')},'defaultTitle':{'type':Sequelize[_0xe9bd('0x3')]},'customerAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe9bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe9bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x2c')},'systemAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe9bd('0x9')],'comment':_0xe9bd('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![],'comment':_0xe9bd('0x2e'),'set':function(_0x2c0345){if(!_0x2c0345)this['setDataValue'](_0xe9bd('0x2f'),null);this[_0xe9bd('0x1f')](_0xe9bd('0x30'),_0x2c0345);}}}; \ No newline at end of file +var _0xc39e=['name','text','onlineForm','parse','getDataValue','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input'];(function(_0x42afab,_0x569319){var _0x4dca57=function(_0x334fce){while(--_0x334fce){_0x42afab['push'](_0x42afab['shift']());}};_0x4dca57(++_0x569319);}(_0xc39e,0xdb));var _0xec39=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0xc39e[_0x498334];return _0x13bb70;};'use strict';var Sequelize=require(_0xec39('0x0'));var rs=require(_0xec39('0x1'));module[_0xec39('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xec39('0x3')]},'mapKey':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x4')},'mapKeyOffline':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x4')},'key':{'type':Sequelize[_0xec39('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x5')},'customerAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':_0xec39('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xec39('0x3')]},'animation':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xec39('0x9'),_0xec39('0xa')),'defaultValue':_0xec39('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xb')},'start_chat_button':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xd')},'header_offline':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xe')},'download_transcript':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xec39('0xf')]},'closingQuestion':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x12')},'noteTitle':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x13')},'placeholderMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0xd')},'skipMessageButton':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x16')},'conditionAgreement':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xec39('0x17'),_0xec39('0x18')),'defaultValue':_0xec39('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xec39('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xec39('0x19'),'variable':null,'config':{'placeholder':_0xec39('0x1a'),'type':_0xec39('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xec39('0x19'),'props':{'title':_0xec39('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xec39('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xec39('0x1c'))?JSON[_0xec39('0x1d')](this[_0xec39('0x1e')](_0xec39('0x1c'))):{};},'set':function(_0x481317){return this[_0xec39('0x1f')](_0xec39('0x1c'),JSON[_0xec39('0x20')](_0x481317));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xec39('0x20')]({'items':[{'type':_0xec39('0x19'),'props':{'title':_0xec39('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xec39('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xec39('0x21')},'props':{'title':'Comments','helpText':_0xec39('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xec39('0x1e')]('offlineForm')?JSON[_0xec39('0x1d')](this[_0xec39('0x1e')](_0xec39('0x23'))):{};},'set':function(_0x933752){return this[_0xec39('0x1f')](_0xec39('0x23'),JSON['stringify'](_0x933752));}},'token':{'type':Sequelize[_0xec39('0x3')],'defaultValue':function(){return rs[_0xec39('0x24')]();}},'autoclose':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xec39('0x3')]},'forwardOffline':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x25')},'waitingMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xec39('0x27')},'offlineMessageBody':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x29')},'skipUnmanaged':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x16')},'sendUnmanaged':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xec39('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xec39('0x3')]},'notificationTemplate':{'type':Sequelize[_0xec39('0xf')],'defaultValue':function(){return _0xec39('0x2a');}},'notificationSound':{'type':Sequelize[_0xec39('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xec39('0x3')],'defaultValue':_0xec39('0x2c')},'defaultTitle':{'type':Sequelize[_0xec39('0x3')]},'customerAvatar':{'type':Sequelize[_0xec39('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xec39('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xec39('0x3')],'allowNull':![],'defaultValue':_0xec39('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xec39('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xec39('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xec39('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xec39('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xec39('0x7')],'comment':_0xec39('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xec39('0x2f'),'set':function(_0x4dd674){if(!_0x4dd674)this[_0xec39('0x1f')](_0xec39('0x30'),null);this['setDataValue']('mandatoryDisposition',_0x4dd674);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 723ca1c..00ae048 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 _0x6552=['filter','where','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','priority','asc','ListId','from','firstName','lastName','customerIp','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','addInteraction','omit','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','connection','remoteAddress','replace','alignment','verticalAlignment','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','Content-Range','apply','reject','update','destroy','then','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick'];(function(_0x379ad4,_0x24770f){var _0x3227f3=function(_0x51f486){while(--_0x51f486){_0x379ad4['push'](_0x379ad4['shift']());}};_0x3227f3(++_0x24770f);}(_0x6552,0x1ea));var _0x2655=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6552[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2655('0x0'));var zipdir=require(_0x2655('0x1'));var jsonpatch=require(_0x2655('0x2'));var rp=require(_0x2655('0x3'));var moment=require(_0x2655('0x4'));var BPromise=require(_0x2655('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2655('0x6'));var sox=require(_0x2655('0x7'));var csv=require(_0x2655('0x8'));var ejs=require(_0x2655('0x9'));var fs=require('fs');var _=require(_0x2655('0xa'));var squel=require(_0x2655('0xb'));var crypto=require(_0x2655('0xc'));var jsforce=require(_0x2655('0xd'));var deskjs=require(_0x2655('0xe'));var toCsv=require(_0x2655('0x8'));var querystring=require(_0x2655('0xf'));var Papa=require('papaparse');var Redis=require(_0x2655('0x10'));var authService=require(_0x2655('0x11'));var qs=require(_0x2655('0x12'));var hardwareService=require(_0x2655('0x13'));var logger=require(_0x2655('0x14'))(_0x2655('0x15'));var utils=require(_0x2655('0x16'));var config=require(_0x2655('0x17'));var db=require(_0x2655('0x18'))['db'];config['redis']=_[_0x2655('0x19')](config[_0x2655('0x1a')],{'host':_0x2655('0x1b'),'port':0x18eb});var socket=require(_0x2655('0x1c'))(new Redis(config[_0x2655('0x1a')]));require(_0x2655('0x1d'))[_0x2655('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2655('0x1f')][_0x2655('0x20')]({'port':0x232c});var client9002=jayson[_0x2655('0x1f')][_0x2655('0x20')]({'port':0x232a});var client9003=jayson[_0x2655('0x1f')]['http']({'port':0x232b});function checkPasswordPattern(_0x701fbc,_0x2d9cf2,_0x5484e6){if(_0x5484e6){var _0x218b47=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x218b47[_0x2655('0x21')](_0x2d9cf2)){return _0x701fbc;}else{throw new Error(_0x2655('0x22'));}}else{return _0x701fbc;}}function respondWithRpcPromise(_0x1297e5,_0xeafd4a,_0x2e0402,_0x2d36de){return new BPromise(function(_0x2b16b6,_0x5a20f5){var _0x57aafa=_0x2d36de||client;return _0x57aafa[_0x2655('0x23')](_0x1297e5,_0x2e0402)['then'](function(_0xe0f7f){logger[_0x2655('0x24')](_0x2655('0x25'),_0xeafd4a,_0x2655('0x26'));logger[_0x2655('0x27')](_0x2655('0x28'),_0xeafd4a,_0x2655('0x26'),JSON[_0x2655('0x29')](_0xe0f7f));if(_0xe0f7f[_0x2655('0x2a')]){if(_0xe0f7f[_0x2655('0x2a')]['code']===0x1f4){logger[_0x2655('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0xeafd4a,_0xe0f7f[_0x2655('0x2a')][_0x2655('0x2b')]);return _0x5a20f5(_0xe0f7f[_0x2655('0x2a')]['message']);}logger[_0x2655('0x2a')](_0x2655('0x25'),_0xeafd4a,_0xe0f7f['error'][_0x2655('0x2b')]);return _0x2b16b6(_0xe0f7f[_0x2655('0x2a')][_0x2655('0x2b')]);}else{logger[_0x2655('0x24')](_0x2655('0x25'),_0xeafd4a,_0x2655('0x26'));_0x2b16b6(_0xe0f7f['result'][_0x2655('0x2b')]);}})['catch'](function(_0x374da5){logger['error'](_0x2655('0x25'),_0xeafd4a,_0x374da5);_0x5a20f5(_0x374da5);});});}function respondWithStatusCode(_0x436f13,_0x219ffd){_0x219ffd=_0x219ffd||0xcc;return function(_0x34d327){if(_0x34d327){return _0x436f13[_0x2655('0x2c')](_0x219ffd);}return _0x436f13[_0x2655('0x2d')](_0x219ffd)['end']();};}function respondWithResult(_0x241e52,_0x31136f){_0x31136f=_0x31136f||0xc8;return function(_0x7a7180){if(_0x7a7180){return _0x241e52[_0x2655('0x2d')](_0x31136f)[_0x2655('0x2e')](_0x7a7180);}};}function respondWithFilteredResult(_0x253acf,_0x460fc5){return function(_0x5d4100){if(_0x5d4100){var _0x2192fd=_0x5d4100['count'],_0x21e615=_0x460fc5[_0x2655('0x2f')],_0x2ead1a=_0x460fc5[_0x2655('0x2f')]+_0x460fc5['limit'],_0x3e855f;if(_0x2ead1a>=_0x2192fd){_0x2ead1a=_0x2192fd;_0x3e855f=0xc8;}else{_0x3e855f=0xce;}_0x253acf[_0x2655('0x2d')](_0x3e855f);return _0x253acf['set'](_0x2655('0x30'),_0x21e615+'-'+_0x2ead1a+'/'+_0x2192fd)[_0x2655('0x2e')](_0x5d4100);}return null;};}function patchUpdates(_0x2aa5c0){return function(_0x12f0fb){try{jsonpatch[_0x2655('0x31')](_0x12f0fb,_0x2aa5c0,!![]);}catch(_0x17bc24){return BPromise[_0x2655('0x32')](_0x17bc24);}return _0x12f0fb['save']();};}function saveUpdates(_0xc53e14,_0x5231a4){return function(_0x5385cc){if(_0x5385cc){return _0x5385cc[_0x2655('0x33')](_0xc53e14)['then'](function(_0x4ed530){return _0x4ed530;});}return null;};}function removeEntity(_0x34a4d4,_0x2ab844){return function(_0x174fa9){if(_0x174fa9){return _0x174fa9[_0x2655('0x34')]()[_0x2655('0x35')](function(){var _0x18b611=_0x174fa9['get']({'plain':!![]});var _0x54e090=_0x2655('0x36');return db[_0x2655('0x37')][_0x2655('0x34')]({'where':{'type':_0x54e090,'resourceId':_0x18b611['id']}})['then'](function(){return _0x174fa9;});})['then'](function(){_0x34a4d4[_0x2655('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3923b7,_0x47d887){return function(_0x5123c2){if(!_0x5123c2){_0x3923b7[_0x2655('0x2c')](0x194);}return _0x5123c2;};}function handleError(_0x5ec15f,_0x44ec3e){_0x44ec3e=_0x44ec3e||0x1f4;return function(_0x45967){logger['error'](_0x45967[_0x2655('0x38')]);if(_0x45967['name']){delete _0x45967[_0x2655('0x39')];}_0x5ec15f[_0x2655('0x2d')](_0x44ec3e)[_0x2655('0x3a')](_0x45967);};}exports['index']=function(_0x398bde,_0x35a031){var _0x47e1c6={'include':[{'model':db[_0x2655('0x3b')],'as':_0x2655('0x3c')}]},_0x4c52af={},_0x1f0093={'count':0x0,'rows':[]};var _0x8e521d=db[_0x2655('0x3d')]['rawAttributes'];_0x4c52af[_0x2655('0x3e')]=_['keys'](_0x8e521d);_0x4c52af[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x398bde[_0x2655('0x3f')]);_0x4c52af[_0x2655('0x41')]=_[_0x2655('0x42')](_0x4c52af[_0x2655('0x3e')],_0x4c52af['query']);_0x47e1c6[_0x2655('0x43')]=_[_0x2655('0x42')](_0x4c52af[_0x2655('0x3e')],qs['fields'](_0x398bde[_0x2655('0x3f')]['fields']));_0x47e1c6[_0x2655('0x43')]=_0x47e1c6[_0x2655('0x43')][_0x2655('0x44')]?_0x47e1c6[_0x2655('0x43')]:_0x4c52af[_0x2655('0x3e')];if(!_0x398bde[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x47e1c6[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x398bde['query'][_0x2655('0x47')]);_0x47e1c6[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x398bde[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x47e1c6['order']=qs[_0x2655('0x48')](_0x398bde[_0x2655('0x3f')][_0x2655('0x48')]);_0x47e1c6['where']=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x398bde[_0x2655('0x3f')],_0x4c52af['filters']));if(_0x398bde['query'][_0x2655('0x4a')]){_0x47e1c6[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x47e1c6[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x8e521d,function(_0x4b22c3){if(_0x4b22c3[_0x2655('0x4e')][_0x2655('0x4f')]!=='VIRTUAL'){var _0x347e3e={};_0x347e3e[_0x4b22c3[_0x2655('0x50')]]={'$like':'%'+_0x398bde['query'][_0x2655('0x4a')]+'%'};return _0x347e3e;}})});}_0x47e1c6=_['merge']({},_0x47e1c6,_0x398bde[_0x2655('0x51')]);var _0x5c10b3={'where':_0x47e1c6[_0x2655('0x4b')]};return db[_0x2655('0x3d')]['count'](_0x5c10b3)[_0x2655('0x35')](function(_0x298e7f){_0x1f0093[_0x2655('0x52')]=_0x298e7f;if(_0x398bde[_0x2655('0x3f')][_0x2655('0x53')]){_0x47e1c6[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x3d')][_0x2655('0x55')](_0x47e1c6);})[_0x2655('0x35')](function(_0x55e54a){_0x1f0093[_0x2655('0x56')]=_0x55e54a;return _0x1f0093;})['then'](respondWithFilteredResult(_0x35a031,_0x47e1c6))[_0x2655('0x57')](handleError(_0x35a031,null));};exports[_0x2655('0x58')]=function(_0x162022,_0x28ade8){var _0x380ed8={'raw':![],'where':{'id':_0x162022['params']['id']},'include':[{'model':db['Pause'],'as':_0x2655('0x3c')}]},_0x3407b2={};_0x3407b2[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x3d')]['rawAttributes']);_0x3407b2[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x162022['query']);_0x3407b2[_0x2655('0x41')]=_[_0x2655('0x42')](_0x3407b2['model'],_0x3407b2['query']);_0x380ed8['attributes']=_['intersection'](_0x3407b2[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x162022[_0x2655('0x3f')][_0x2655('0x59')]));_0x380ed8[_0x2655('0x43')]=_0x380ed8['attributes']['length']?_0x380ed8[_0x2655('0x43')]:_0x3407b2[_0x2655('0x3e')];if(_0x162022['query'][_0x2655('0x53')]){_0x380ed8[_0x2655('0x54')]=[{'all':!![]}];}_0x380ed8=_[_0x2655('0x4c')]({},_0x380ed8,_0x162022[_0x2655('0x51')]);return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x380ed8)['then'](handleEntityNotFound(_0x28ade8,null))['then'](respondWithResult(_0x28ade8,null))[_0x2655('0x57')](handleError(_0x28ade8,null));};exports[_0x2655('0x5b')]=function(_0x26f158,_0x2c011d){return db['ChatWebsite'][_0x2655('0x5b')](_0x26f158[_0x2655('0x5c')],{})[_0x2655('0x35')](function(_0x310482){var _0x1b3251=_0x26f158[_0x2655('0x5d')][_0x2655('0x5e')]({'plain':!![]});if(!_0x1b3251)throw new Error(_0x2655('0x5f'));if(_0x1b3251[_0x2655('0x60')]===_0x2655('0x5d')){var _0x428ca4=_0x310482[_0x2655('0x5e')]({'plain':!![]});var _0x2b3bc2=_0x2655('0x36');return db[_0x2655('0x61')][_0x2655('0x5a')]({'where':{'name':_0x2b3bc2,'userProfileId':_0x1b3251[_0x2655('0x62')]},'raw':!![]})[_0x2655('0x35')](function(_0x29f3c6){if(_0x29f3c6&&_0x29f3c6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x428ca4[_0x2655('0x39')],'resourceId':_0x428ca4['id'],'type':_0x29f3c6['name'],'sectionId':_0x29f3c6['id']},{})[_0x2655('0x35')](function(){return _0x310482;});}else{return _0x310482;}})[_0x2655('0x57')](function(_0x5af56a){logger[_0x2655('0x2a')](_0x2655('0x63'),_0x5af56a);throw _0x5af56a;});}return _0x310482;})['then'](respondWithResult(_0x2c011d,0xc9))[_0x2655('0x57')](handleError(_0x2c011d,null));};exports['update']=function(_0x1b1815,_0x2fdd87){if(_0x1b1815['body']['id']){delete _0x1b1815[_0x2655('0x5c')]['id'];}return db[_0x2655('0x3d')]['find']({'where':{'id':_0x1b1815[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x2655('0x35')](handleEntityNotFound(_0x2fdd87,null))[_0x2655('0x35')](saveUpdates(_0x1b1815[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x2fdd87,null))[_0x2655('0x57')](handleError(_0x2fdd87,null));};exports[_0x2655('0x34')]=function(_0x21fe3e,_0x26ec5e){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x21fe3e[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x26ec5e,null))['then'](removeEntity(_0x26ec5e,null))[_0x2655('0x57')](handleError(_0x26ec5e,null));};exports[_0x2655('0x65')]=function(_0xc22e36,_0x89351f){return db[_0x2655('0x3d')][_0x2655('0x65')]()['then'](respondWithResult(_0x89351f,null))[_0x2655('0x57')](handleError(_0x89351f,null));};exports[_0x2655('0x66')]=function(_0x4c4c83,_0x1bf2d9,_0x494723){if(_0x4c4c83[_0x2655('0x5c')]['id']){delete _0x4c4c83['body']['id'];}return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x4c4c83[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x1bf2d9,null))['then'](function(_0x541b2b){if(_0x541b2b){_0x4c4c83[_0x2655('0x5c')][_0x2655('0x67')]=_0x541b2b['id'];return db[_0x2655('0x68')][_0x2655('0x5b')](_0x4c4c83[_0x2655('0x5c')]);}})[_0x2655('0x35')](respondWithResult(_0x1bf2d9,null))['catch'](handleError(_0x1bf2d9,null));};exports[_0x2655('0x69')]=function(_0x13c452,_0x410dd1,_0xcdb629){var _0x3abf60={'raw':![],'where':{}};var _0x4c7b42={};var _0x458d95={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2655('0x6a')]({'where':{'id':_0x13c452[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x410dd1,null))['then'](function(_0x1f5474){if(_0x1f5474){_0x4c7b42['model']=_['keys'](db[_0x2655('0x68')][_0x2655('0x6b')]);_0x4c7b42['query']=_[_0x2655('0x40')](_0x13c452[_0x2655('0x3f')]);_0x4c7b42['filters']=_[_0x2655('0x42')](_0x4c7b42[_0x2655('0x3e')],_0x4c7b42[_0x2655('0x3f')]);_0x3abf60[_0x2655('0x43')]=_[_0x2655('0x42')](_0x4c7b42['model'],qs[_0x2655('0x59')](_0x13c452[_0x2655('0x3f')][_0x2655('0x59')]));_0x3abf60[_0x2655('0x43')]=_0x3abf60[_0x2655('0x43')][_0x2655('0x44')]?_0x3abf60[_0x2655('0x43')]:_0x4c7b42['model'];if(!_0x13c452[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x3abf60[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x13c452[_0x2655('0x3f')][_0x2655('0x47')]);_0x3abf60[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x13c452[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x3abf60[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0x13c452[_0x2655('0x3f')]['sort']);_0x3abf60['where']=qs[_0x2655('0x41')](_['pick'](_0x13c452[_0x2655('0x3f')],_0x4c7b42['filters']));_0x3abf60[_0x2655('0x4b')]['ChatWebsiteId']=_0x1f5474['id'];if(_0x13c452[_0x2655('0x3f')][_0x2655('0x4a')]){_0x3abf60['where']=_[_0x2655('0x4c')](_0x3abf60[_0x2655('0x4b')],{'$or':_['map'](_0x3abf60['attributes'],function(_0x537d51){var _0x2ba3b4={};_0x2ba3b4[_0x537d51]={'$like':'%'+_0x13c452[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2ba3b4;})});}_0x3abf60=_[_0x2655('0x4c')]({},_0x3abf60,_0x13c452[_0x2655('0x51')]);return db[_0x2655('0x68')]['count']({'where':_0x3abf60[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x206c54){_0x458d95['count']=_0x206c54;if(_0x13c452[_0x2655('0x3f')][_0x2655('0x53')]){_0x3abf60[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x68')][_0x2655('0x55')](_0x3abf60);})[_0x2655('0x35')](function(_0x20effe){_0x458d95[_0x2655('0x56')]=_0x20effe;return _0x458d95;});}})['then'](respondWithFilteredResult(_0x410dd1,_0x3abf60))[_0x2655('0x57')](handleError(_0x410dd1,null));};exports[_0x2655('0x6d')]=function(_0x2a2eee,_0x3a7c4e,_0x171208){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x2a2eee['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3a7c4e,null))[_0x2655('0x35')](function(_0x3ebde0){if(_0x3ebde0){return _0x3ebde0[_0x2655('0x6d')](_0x2a2eee[_0x2655('0x3f')][_0x2655('0x6e')]);}})['then'](respondWithStatusCode(_0x3a7c4e,null))[_0x2655('0x57')](handleError(_0x3a7c4e,null));};exports[_0x2655('0x6f')]=function(_0x5ce470,_0x2c2399,_0x43fa27){if(_0x5ce470[_0x2655('0x5c')]['id']){delete _0x5ce470[_0x2655('0x5c')]['id'];}return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x5ce470[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x2c2399,null))[_0x2655('0x35')](function(_0x147545){if(_0x147545){_0x5ce470[_0x2655('0x5c')][_0x2655('0x67')]=_0x147545['id'];return db['CannedAnswer']['create'](_0x5ce470[_0x2655('0x5c')]);}})[_0x2655('0x35')](respondWithResult(_0x2c2399,null))[_0x2655('0x57')](handleError(_0x2c2399,null));};exports[_0x2655('0x70')]=function(_0x419572,_0x3aa9be,_0x18bc78){var _0x507919={'raw':![],'where':{}};var _0x3791fe={};var _0x3e5b52={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x419572[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3aa9be,null))['then'](function(_0x43fdc9){if(_0x43fdc9){_0x3791fe[_0x2655('0x3e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3791fe[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x419572[_0x2655('0x3f')]);_0x3791fe[_0x2655('0x41')]=_[_0x2655('0x42')](_0x3791fe[_0x2655('0x3e')],_0x3791fe[_0x2655('0x3f')]);_0x507919[_0x2655('0x43')]=_[_0x2655('0x42')](_0x3791fe[_0x2655('0x3e')],qs['fields'](_0x419572[_0x2655('0x3f')]['fields']));_0x507919['attributes']=_0x507919[_0x2655('0x43')][_0x2655('0x44')]?_0x507919['attributes']:_0x3791fe['model'];if(!_0x419572['query'][_0x2655('0x45')](_0x2655('0x46'))){_0x507919[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x419572['query'][_0x2655('0x47')]);_0x507919[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x419572[_0x2655('0x3f')]['offset']);}_0x507919['order']=qs[_0x2655('0x48')](_0x419572[_0x2655('0x3f')]['sort']);_0x507919['where']=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x419572[_0x2655('0x3f')],_0x3791fe[_0x2655('0x41')]));_0x507919['where']['ChatWebsiteId']=_0x43fdc9['id'];if(_0x419572[_0x2655('0x3f')][_0x2655('0x4a')]){_0x507919[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x507919[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x507919[_0x2655('0x43')],function(_0x3f45f7){var _0x5a064a={};_0x5a064a[_0x3f45f7]={'$like':'%'+_0x419572['query'][_0x2655('0x4a')]+'%'};return _0x5a064a;})});}_0x507919=_[_0x2655('0x4c')]({},_0x507919,_0x419572[_0x2655('0x51')]);return db[_0x2655('0x71')][_0x2655('0x52')]({'where':_0x507919[_0x2655('0x4b')]})['then'](function(_0x319f0a){_0x3e5b52[_0x2655('0x52')]=_0x319f0a;if(_0x419572[_0x2655('0x3f')][_0x2655('0x53')]){_0x507919[_0x2655('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2655('0x55')](_0x507919);})[_0x2655('0x35')](function(_0x52624c){_0x3e5b52[_0x2655('0x56')]=_0x52624c;return _0x3e5b52;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x3aa9be,_0x507919))[_0x2655('0x57')](handleError(_0x3aa9be,null));};exports[_0x2655('0x72')]=function(_0x1cd5ad,_0x26c3fc,_0x16dd3f){return db[_0x2655('0x3d')]['find']({'where':{'id':_0x1cd5ad[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x26c3fc,null))['then'](function(_0x28d552){if(_0x28d552){return _0x28d552[_0x2655('0x72')](_0x1cd5ad[_0x2655('0x3f')][_0x2655('0x6e')]);}})[_0x2655('0x35')](respondWithStatusCode(_0x26c3fc,null))[_0x2655('0x57')](handleError(_0x26c3fc,null));};exports[_0x2655('0x73')]=function(_0x30ae5e,_0x5e8d8d,_0x2cc97d){_0x30ae5e[_0x2655('0x5c')][_0x2655('0x74')]=_0x30ae5e[_0x2655('0x75')]['filename'];return db[_0x2655('0x3d')]['find']({'where':{'id':_0x30ae5e[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x5e8d8d,null))[_0x2655('0x35')](saveUpdates(_0x30ae5e[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x5e8d8d,null))[_0x2655('0x57')](handleError(_0x5e8d8d,null));};exports[_0x2655('0x76')]=function(_0x538765,_0x3ecc5d,_0x109738){_0x538765[_0x2655('0x5c')][_0x2655('0x77')]=_0x538765[_0x2655('0x75')][_0x2655('0x78')];return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x538765['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3ecc5d,null))[_0x2655('0x35')](saveUpdates(_0x538765['body'],null))[_0x2655('0x35')](respondWithResult(_0x3ecc5d,null))['catch'](handleError(_0x3ecc5d,null));};exports['addCustomerAvatar']=function(_0x26c411,_0x1e7ea1,_0x44b412){_0x26c411['body'][_0x2655('0x79')]=_0x26c411['file'][_0x2655('0x78')];return db['ChatWebsite'][_0x2655('0x5a')]({'where':{'id':_0x26c411['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x1e7ea1,null))[_0x2655('0x35')](saveUpdates(_0x26c411['body'],null))[_0x2655('0x35')](respondWithResult(_0x1e7ea1,null))[_0x2655('0x57')](handleError(_0x1e7ea1,null));};exports[_0x2655('0x7a')]=function(_0x59dffb,_0x2ea67f,_0x49a939){_0x59dffb[_0x2655('0x5c')]['systemAvatar']=_0x59dffb[_0x2655('0x75')]['filename'];return db[_0x2655('0x3d')]['find']({'where':{'id':_0x59dffb[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x2ea67f,null))[_0x2655('0x35')](saveUpdates(_0x59dffb[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x2ea67f,null))['catch'](handleError(_0x2ea67f,null));};exports['getLogo']=function(_0x149011,_0xa83cb5,_0x4e3958){var _0x2ce9c3=path['join'](config[_0x2655('0x7b')],_0x2655('0x7c'));var _0x200374={'where':{'id':_0x149011['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3332a3=![];return require(_0x2655('0x7d'))[_0x2655('0x7e')]()[_0x2655('0x35')](function(_0x27a864){if(_0x27a864){_0x3332a3=_0x27a864[_0x2655('0x7f')];}})[_0x2655('0x35')](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x200374);})[_0x2655('0x35')](handleEntityNotFound(_0xa83cb5,null))[_0x2655('0x35')](function(_0x3bb42d){if(_0x3bb42d){if(!_[_0x2655('0x80')](_0x3bb42d[_0x2655('0x74')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x83'),_0x3bb42d[_0x2655('0x74')]))&&_0x3332a3){_0x2ce9c3=path['join'](config[_0x2655('0x7b')],_0x2655('0x83'),_0x3bb42d['sitepic']);}}return _0xa83cb5[_0x2655('0x84')](_0x2ce9c3);}})[_0x2655('0x57')](handleError(_0xa83cb5,null));};exports[_0x2655('0x85')]=function(_0x5886f2,_0x3f99fe,_0xe57bda){var _0x11ec08=path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x86'));var _0x433040={'where':{'id':_0x5886f2[_0x2655('0x64')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x433040)['then'](handleEntityNotFound(_0x3f99fe,null))[_0x2655('0x35')](function(_0x4ec68e){if(_0x4ec68e){if(!_[_0x2655('0x80')](_0x4ec68e[_0x2655('0x77')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config['root'],_0x2655('0x87'),_0x4ec68e[_0x2655('0x77')]))){_0x11ec08=path['join'](config['root'],_0x2655('0x87'),_0x4ec68e[_0x2655('0x77')]);}}return _0x3f99fe['download'](_0x11ec08);}})[_0x2655('0x57')](handleError(_0x3f99fe,null));};exports[_0x2655('0x88')]=function(_0x5bc68e,_0x49bca3,_0x4bdd59){var _0x2ab8d4=path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x89'));var _0x16bcb4={'where':{'id':_0x5bc68e['params']['id']},'attributes':['id',_0x2655('0x79'),'showCustomerAvatar'],'raw':!![]};return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x16bcb4)[_0x2655('0x35')](handleEntityNotFound(_0x49bca3,null))[_0x2655('0x35')](function(_0x149a53){if(_0x149a53){if(!_[_0x2655('0x80')](_0x149a53[_0x2655('0x79')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x87'),_0x149a53[_0x2655('0x79')]))&&_0x149a53['showCustomerAvatar']){_0x2ab8d4=path['join'](config[_0x2655('0x7b')],_0x2655('0x87'),_0x149a53[_0x2655('0x79')]);}}return _0x49bca3['download'](_0x2ab8d4);}})[_0x2655('0x57')](handleError(_0x49bca3,null));};exports['getSystemAvatar']=function(_0x3620d3,_0x36ffe9,_0x14c514){var _0x320054=path[_0x2655('0x82')](config['root'],_0x2655('0x8a'));var _0x2aaaab={'where':{'id':_0x3620d3[_0x2655('0x64')]['id']},'attributes':['id',_0x2655('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x2655('0x5a')](_0x2aaaab)[_0x2655('0x35')](handleEntityNotFound(_0x36ffe9,null))[_0x2655('0x35')](function(_0x407a7c){if(_0x407a7c){if(!_[_0x2655('0x80')](_0x407a7c['systemAvatar'])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x87'),_0x407a7c[_0x2655('0x8b')]))){_0x320054=path[_0x2655('0x82')](config[_0x2655('0x7b')],'server/files/images/avatars/',_0x407a7c[_0x2655('0x8b')]);}}return _0x36ffe9[_0x2655('0x84')](_0x320054);}})[_0x2655('0x57')](handleError(_0x36ffe9,null));};exports[_0x2655('0x8c')]=function(_0x2e456b,_0x364a05,_0x26b453){var _0x4007eb=require(_0x2655('0x8d'));var _0x79ceb=new _0x4007eb();var _0x1a6654=_0x79ceb[_0x2655('0x8e')](_0x2e456b[_0x2655('0x8f')][_0x2655('0x90')])[_0x2655('0x91')]();var _0x2489db={'body':_0x2e456b[_0x2655('0x5c')],'channel':_0x2655('0x92')};var _0x593abe=[];var _0x15ed48=[];var _0x238175={};var _0x4e1878=![];return db[_0x2655('0x93')]['describe']()[_0x2655('0x35')](function(_0x2ace50){if(!_0x2ace50){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x96'));}_0x593abe=_[_0x2655('0x97')](_['keys'](_0x2ace50),[_0x2655('0x98'),'updatedAt']);_0x15ed48=_[_0x2655('0x97')](_[_0x2655('0x40')](_0x2ace50),['createdAt',_0x2655('0x99'),_0x2655('0x9a'),'ListId']);if(_0x2e456b[_0x2655('0x5c')]['id']){delete _0x2e456b['body']['id'];}if(_[_0x2655('0x80')](_0x2e456b['body']['from'])){throw new db[(_0x2655('0x94'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')])||_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')]===''){throw new db['Sequelize'][(_0x2655('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2e456b[_0x2655('0x5c')]['mapKey'])){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x9b')+_0x15ed48);}if(!_[_0x2655('0x9c')](_0x15ed48,_0x2e456b[_0x2655('0x5c')][_0x2655('0x9d')])){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x9e')+_0x15ed48);}_0x238175[_0x2e456b[_0x2655('0x5c')][_0x2655('0x9d')]]=_0x2e456b['body']['from'];})[_0x2655('0x35')](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x2e456b[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x2655('0xa0'),'where':_0x238175,'limit':0x1,'order':[[_0x2655('0x99'),_0x2655('0xa1')]]}]},{'model':db[_0x2655('0xa2')],'as':_0x2655('0xa3')}]});})['then'](handleEntityNotFound(_0x364a05,null))['then'](function(_0x164e5b){if(_0x164e5b&&_0x164e5b[_0x2655('0xa4')]){_0x2489db[_0x2655('0xa5')]=_0x164e5b;_0x2489db['applications']=_0x164e5b['Applications'];_0x2489db[_0x2655('0xa6')]=_0x164e5b[_0x2655('0xa4')];_0x2489db[_0x2655('0xa7')]=_[_0x2655('0xa8')](_0x2489db[_0x2655('0xa7')],[_0x2655('0xa9')],[_0x2655('0xaa')]);if(_0x2489db[_0x2655('0xa5')][_0x2655('0xa3')]){delete _0x2489db[_0x2655('0xa5')]['Applications'];}if(_0x2489db[_0x2655('0xa5')]['List']&&_0x2489db['account'][_0x2655('0xa4')][_0x2655('0xa0')][_0x2655('0x44')]){return _0x2489db['account'][_0x2655('0xa4')][_0x2655('0xa0')][0x0];}var _0x55c0be=_[_0x2655('0x19')](_0x2e456b['body'],{'firstName':_0x2e456b[_0x2655('0x5c')]['from'],'ListId':_0x164e5b[_0x2655('0xab')]});_0x55c0be[_0x2e456b['body'][_0x2655('0x9d')]]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xac')];return db['CmContact'][_0x2655('0x5b')](_0x55c0be,{'fields':_0x593abe,'raw':!![]});}})[_0x2655('0x35')](handleEntityNotFound(_0x364a05,null))['then'](function(_0x3e6fe9){_0x2489db['contact']=_0x3e6fe9;if(_0x3e6fe9){var _0x394c6c={'ContactId':_0x3e6fe9['id'],'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'from':(_0x3e6fe9[_0x2655('0xad')]||'')+'\x20'+(_0x3e6fe9[_0x2655('0xae')]||''),'customerIp':_0x2e456b[_0x2655('0x5c')][_0x2655('0xaf')],'referer':_0x2e456b['body'][_0x2655('0xb0')],'browserName':_0x1a6654[_0x2655('0xb1')][_0x2655('0x39')]&&_0x1a6654[_0x2655('0xb1')]['version']?util[_0x2655('0xb2')](_0x2655('0xb3'),_0x1a6654['browser'][_0x2655('0x39')],_0x1a6654[_0x2655('0xb1')][_0x2655('0xb4')]):_0x2655('0xb5'),'browserVersion':_0x1a6654['browser']['version']||_0x2655('0xb5'),'osName':util[_0x2655('0xb2')](_0x2655('0xb3'),_0x1a6654['os'][_0x2655('0x39')],_0x1a6654['os'][_0x2655('0xb4')]),'osVersion':_0x1a6654['os'][_0x2655('0xb4')],'deviceModel':_0x1a6654['device'][_0x2655('0x3e')]&&_0x1a6654[_0x2655('0xb6')][_0x2655('0xb7')]?util[_0x2655('0xb2')]('%s\x20%s\x20%s',_0x1a6654[_0x2655('0xb6')]['model'],_0x1a6654[_0x2655('0xb6')]['vendor'],_0x1a6654[_0x2655('0xb6')]['type']):null,'deviceVendor':_0x1a6654[_0x2655('0xb6')][_0x2655('0xb7')],'deviceType':_0x1a6654[_0x2655('0xb6')][_0x2655('0x4e')],'formData':JSON[_0x2655('0x29')](_0x2e456b[_0x2655('0x5c')])};var _0x270f72={'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'closed':![]};if(_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]){_0x270f72[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')];return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':_0x270f72})[_0x2655('0x35')](function(_0xf1a2d3){if(_0xf1a2d3){return[_0xf1a2d3,![]];}_0x394c6c[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')];_0x394c6c[_0x2655('0xba')]=_0x2e456b['body'][_0x2655('0xba')];return db[_0x2655('0xb9')][_0x2655('0x5b')](_0x394c6c)[_0x2655('0x35')](function(_0x1668f1){return[_0x1668f1,!![]];});});}_0x270f72['ContactId']=_0x3e6fe9['id'];if(_0x2e456b[_0x2655('0x5c')]['interaction']&&_0x2e456b[_0x2655('0x5c')][_0x2655('0xbb')]['id']){_0x270f72['id']=_0x2e456b[_0x2655('0x5c')][_0x2655('0xbb')]['id'];return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':_0x270f72})['then'](function(_0x36cb8f){if(_0x36cb8f){return[_0x36cb8f,![]];}return db['ChatInteraction']['create'](_0x394c6c)[_0x2655('0x35')](function(_0x5558ec){return[_0x5558ec,!![]];});});}return db[_0x2655('0xb9')][_0x2655('0x5b')](_0x394c6c)['then'](function(_0x5bb872){return[_0x5bb872,!![]];});}})[_0x2655('0xbc')](function(_0x2b569,_0x3132e2){if(_0x2b569){_0x4e1878=_0x3132e2;if(!_0x3132e2){var _0x2a83d0={'from':(_0x2489db['contact'][_0x2655('0xad')]||'')+'\x20'+(_0x2489db[_0x2655('0xbd')]['lastName']||'')};if(_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]&&_0x2e456b['body']['messageId']&&_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]!=_0x2e456b[_0x2655('0x5c')]['messageId']){_0x2a83d0[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xbe')];}return _0x2b569[_0x2655('0x33')](_0x2a83d0);}else{return _0x2b569;}}})[_0x2655('0x35')](function(_0x67918a){_0x2489db[_0x2655('0xbb')]=_0x67918a[_0x2655('0x5e')]({'plain':!![]});_0x2489db[_0x2655('0xbb')][_0x2655('0xbf')]=_0x4e1878;if(_0x2489db[_0x2655('0xbb')][_0x2655('0xbf')]){if(_0x2489db[_0x2655('0xa5')][_0x2655('0xc0')]){_0x2489db[_0x2655('0xa7')][_0x2655('0xc1')]({'id':0x0,'priority':_0x2489db[_0x2655('0xa7')][_0x2655('0x44')]+0x1,'app':_0x2655('0xc2'),'appdata':'unmanaged','interval':_0x2655('0xc3')});}}return db[_0x2655('0xc4')][_0x2655('0x5b')]({'body':_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')],'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'ChatInteractionId':_0x67918a['id'],'direction':'in','ContactId':_0x2489db[_0x2655('0xbd')]['id'],'AttachmentId':_0x2e456b[_0x2655('0x5c')][_0x2655('0xc5')]});})[_0x2655('0x35')](function(_0x3f17e8){_0x2489db[_0x2655('0x2b')]=_0x3f17e8;if(_0x2489db['interaction'][_0x2655('0xc6')]){return db[_0x2655('0xc7')][_0x2655('0x5a')]({'attributes':['id','name'],'where':{'id':_0x2489db['interaction'][_0x2655('0xc6')]}})[_0x2655('0x35')](function(_0x2dacb5){if(_0x2dacb5){_0x2489db[_0x2655('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2655('0xc8'),'appdata':_0x2dacb5[_0x2655('0x39')]+','+(_0x2489db[_0x2655('0xa5')][_0x2655('0xc9')]||0xa),'interval':_0x2655('0xc3')});_0x2489db['forcedOwnership']=!![];}return respondWithRpcPromise(_0x2655('0xca'),_0x2655('0xcb'),_0x2489db);});}return respondWithRpcPromise('Start',_0x2655('0xcb'),_0x2489db);})['then'](function(_0x21533f){respondWithRpcPromise('EventManager',_0x2655('0xcc'),{'event':'notify','message':_0x21533f},client9002);return _0x21533f;})[_0x2655('0x35')](respondWithResult(_0x364a05,null))['catch'](handleError(_0x364a05,null));};exports['offline']=function(_0xefe137,_0x54aafb,_0x105651){var _0x5ac616,_0x532281,_0x4acc07;var _0x1b3cd6=[];var _0x21b627=[];var _0x37d840={};return db[_0x2655('0x93')][_0x2655('0x65')]()[_0x2655('0x35')](function(_0x26e10f){if(!_0x26e10f){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))]('no\x20available\x20attributes');}_0x21b627=_[_0x2655('0x97')](_['keys'](_0x26e10f),[_0x2655('0x98'),_0x2655('0x99')]);_0x1b3cd6=_[_0x2655('0x97')](_['keys'](_0x26e10f),['createdAt',_0x2655('0x99'),_0x2655('0x9a'),_0x2655('0xab')]);if(_0xefe137[_0x2655('0x5c')]['id']){delete _0xefe137[_0x2655('0x5c')]['id'];}if(_[_0x2655('0x80')](_0xefe137[_0x2655('0x5c')][_0x2655('0xac')])){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0xefe137[_0x2655('0x5c')]['body'])||_0xefe137[_0x2655('0x5c')][_0x2655('0x5c')]===''){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0xcd')));}if(_[_0x2655('0x80')](_0xefe137[_0x2655('0x5c')][_0x2655('0xce')])){throw _0x54aafb['status'](0x1f4)['send'](new db[(_0x2655('0x94'))]['ValidationError'](_0x2655('0xcf')+_0x1b3cd6));}if(!_['includes'](_0x1b3cd6,_0xefe137[_0x2655('0x5c')][_0x2655('0xce')])){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))]['ValidationError'](_0x2655('0xd0')+_0x1b3cd6));}_0x37d840[_0xefe137[_0x2655('0x5c')][_0x2655('0xce')]]=_0xefe137['body'][_0x2655('0xac')];})['then'](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0xefe137[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x9f')],'as':_0x2655('0xa4')}]});})[_0x2655('0x35')](handleEntityNotFound(_0x54aafb,null))[_0x2655('0x35')](function(_0xbcffce){if(_0xbcffce&&_0xbcffce[_0x2655('0xa4')]){_0x532281=_0xbcffce;var _0x25a087=_['defaults'](_0xefe137[_0x2655('0x5c')],{'firstName':_0xefe137[_0x2655('0x5c')][_0x2655('0xac')],'phone':_0xefe137['body'][_0x2655('0xac')],'ListId':_0xbcffce['ListId']});_0x25a087[_0xefe137['body'][_0x2655('0xce')]]=_0xefe137[_0x2655('0x5c')]['from'];return db[_0x2655('0x93')][_0x2655('0xd1')]({'where':_0x37d840,'defaults':_0x25a087});}})[_0x2655('0xbc')](function(_0x53bce1){if(_0x53bce1){_0x4acc07=_0x53bce1;var _0xd07d21=fs['readFileSync'](path[_0x2655('0x82')](config['root'],_0x2655('0xd2')),_0x2655('0xd3'));var _0x3b7c67=ejs[_0x2655('0xd4')](_0xd07d21,{'body':_[_0x2655('0xd5')](_0xefe137[_0x2655('0x5c')]['body']),'bodyTitle':_0x532281[_0x2655('0xd6')]});return db['ChatOfflineMessage'][_0x2655('0x5b')]({'body':_0x3b7c67,'ContactId':_0x53bce1['id'],'ChatWebsiteId':_0x532281['id']});}})['then'](function(_0x1b8ad2){if(_0x1b8ad2){_0x5ac616=_0x1b8ad2;return db[_0x2655('0xd7')][_0x2655('0x6a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2655('0xd8'),'raw':!![]}]});}})[_0x2655('0x35')](function(_0x5bb43e){if(_0x5bb43e&&_0x5bb43e['Smtp']&&_0x532281[_0x2655('0xd9')]){var _0x434163={'tls':{'rejectUnauthorized':![]}};if(_0x5bb43e[_0x2655('0xd8')][_0x2655('0xda')]){_0x434163['service']=_0x5bb43e['Smtp']['service'];}else{_0x434163[_0x2655('0xdb')]=_0x5bb43e['Smtp']['host'];_0x434163[_0x2655('0xdc')]=_0x5bb43e['Smtp']['port'];_0x434163['secure']=_0x5bb43e[_0x2655('0xd8')][_0x2655('0xdd')];}if(_0x5bb43e[_0x2655('0xd8')]['authentication']){_0x434163[_0x2655('0xde')]={'user':_0x5bb43e[_0x2655('0xd8')][_0x2655('0x5d')],'pass':_0x5bb43e[_0x2655('0xd8')][_0x2655('0xdf')]};}return respondWithRpcPromise(_0x2655('0xe0'),_0x2655('0xe1'),{'account':_0x434163,'message':{'from':util[_0x2655('0xb2')]('\x22%s\x22\x20<%s>',_0x5bb43e['name'],_0x5bb43e[_0x2655('0xe2')]||_0x5bb43e[_0x2655('0xd8')]['user']),'to':_0x532281[_0x2655('0xd9')],'subject':_0x532281[_0x2655('0xe3')],'text':_0x5ac616['body']}},client9003)[_0x2655('0x35')](function(){return _0x5ac616;})[_0x2655('0x57')](function(_0x18c407){console[_0x2655('0x2a')](_0x18c407);});}})[_0x2655('0x35')](function(){if(_0x5ac616){return _0x5ac616;}})[_0x2655('0x35')](respondWithResult(_0x54aafb,null))['catch'](handleError(_0x54aafb,null));};exports[_0x2655('0xe4')]=function(_0x2e35d9,_0x3ec5c1,_0x4dd5b8){return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':{'id':_0x2e35d9[_0x2655('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ec5c1,null))['then'](function(_0x2c8342){if(_0x2c8342){return _0x2c8342[_0x2655('0xe4')](_0x2e35d9[_0x2655('0x5c')]['ids'],_[_0x2655('0xe5')](_0x2e35d9['body'],['ids','id'])||{});}})[_0x2655('0x35')](respondWithResult(_0x3ec5c1,null))[_0x2655('0x57')](handleError(_0x3ec5c1,null));};exports['getInteractions']=function(_0xbe1d43,_0x27f5a0,_0x263aa4){var _0x280dc6={'raw':![],'where':{}};var _0x5c7f30={};var _0x20269e={'count':0x0,'rows':[]};return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0xbe1d43[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x27f5a0,null))[_0x2655('0x35')](function(_0x491dce){if(_0x491dce){_0x5c7f30[_0x2655('0x3e')]=_['keys'](db[_0x2655('0xb9')][_0x2655('0x6b')]);_0x5c7f30['query']=_[_0x2655('0x40')](_0xbe1d43[_0x2655('0x3f')]);_0x5c7f30[_0x2655('0x41')]=_[_0x2655('0x42')](_0x5c7f30['model'],_0x5c7f30[_0x2655('0x3f')]);_0x280dc6[_0x2655('0x43')]=_[_0x2655('0x42')](_0x5c7f30[_0x2655('0x3e')],qs[_0x2655('0x59')](_0xbe1d43[_0x2655('0x3f')]['fields']));_0x280dc6[_0x2655('0x43')]=_0x280dc6['attributes'][_0x2655('0x44')]?_0x280dc6[_0x2655('0x43')]:_0x5c7f30['model'];if(!_0xbe1d43[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x280dc6[_0x2655('0x47')]=qs[_0x2655('0x47')](_0xbe1d43[_0x2655('0x3f')][_0x2655('0x47')]);_0x280dc6[_0x2655('0x2f')]=qs['offset'](_0xbe1d43[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x280dc6[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0xbe1d43['query'][_0x2655('0x48')]);_0x280dc6[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0xbe1d43['query'],_0x5c7f30[_0x2655('0x41')]));_0x280dc6[_0x2655('0x4b')][_0x2655('0x67')]=_0x491dce['id'];if(_0xbe1d43[_0x2655('0x3f')][_0x2655('0x4a')]){_0x280dc6['where']=_[_0x2655('0x4c')](_0x280dc6['where'],{'$or':_[_0x2655('0x4d')](_0x280dc6[_0x2655('0x43')],function(_0x3495ca){var _0x45bb99={};_0x45bb99[_0x3495ca]={'$like':'%'+_0xbe1d43['query'][_0x2655('0x4a')]+'%'};return _0x45bb99;})});}_0x280dc6=_[_0x2655('0x4c')]({},_0x280dc6,_0xbe1d43[_0x2655('0x51')]);return db[_0x2655('0xb9')][_0x2655('0x52')]({'where':_0x280dc6[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x483953){_0x20269e[_0x2655('0x52')]=_0x483953;if(_0xbe1d43[_0x2655('0x3f')][_0x2655('0x53')]){_0x280dc6[_0x2655('0x54')]=[{'model':db[_0x2655('0x93')],'as':'Contact','required':![]},{'model':db[_0x2655('0xc7')],'as':'Owner','attributes':[_0x2655('0x39'),_0x2655('0xe6'),'internal'],'required':![]},{'model':db[_0x2655('0xe7')],'as':_0x2655('0xe8'),'attributes':['id',_0x2655('0x39'),_0x2655('0xe9')],'where':_0xbe1d43[_0x2655('0x3f')]['tag']?{'id':_0xbe1d43[_0x2655('0x3f')][_0x2655('0xea')]}:undefined,'required':_0xbe1d43[_0x2655('0x3f')][_0x2655('0xea')]?!![]:![]}];}return db[_0x2655('0xb9')][_0x2655('0x55')](_0x280dc6);})[_0x2655('0x35')](function(_0xcf27dd){_0x20269e[_0x2655('0x56')]=_0xcf27dd;return _0x20269e;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x27f5a0,_0x280dc6))['catch'](handleError(_0x27f5a0,null));};function iftimePromise(_0x2de914,_0x17c49a){return respondWithRpcPromise(_0x2655('0xeb'),_0x2655('0xec'),{'command':_0x17c49a[_0x2655('0xed')]?util[_0x2655('0xb2')](_0x2655('0xee'),_0x2de914[_0x2655('0xef')],_0x17c49a[_0x2655('0xed')]):util['format'](_0x2655('0xf0'),_0x2de914[_0x2655('0xef')])},client9002)['then'](function(_0x59b88c){var _0x856e2b=_0x59b88c&&_0x59b88c['indexOf'](_0x2655('0xf1'))>=0x0?!![]:![];logger[_0x2655('0x24')](_0x2655('0xf2'),_0x17c49a['id'],_0x2de914['id'],_0x2de914['interval'],_0x856e2b?_0x2655('0xf3'):_0x2655('0xf4'),_0x17c49a['timezone']?_0x17c49a[_0x2655('0xed')]:_0x2655('0xf5'));return _0x856e2b;})[_0x2655('0x57')](function(_0x787721){logger['error'](_0x2655('0xf2'),_0x17c49a['id'],_0x2de914['id'],_0x2de914['interval'],util[_0x2655('0xf6')](_0x787721,{'showHidden':![],'depth':null}),_0x17c49a[_0x2655('0xed')]?_0x17c49a[_0x2655('0xed')]:_0x2655('0xf5'));return![];});}exports[_0x2655('0xec')]=function(_0x1ea8c4,_0x1056ba,_0x1317d7){var _0x387699=0x0;var _0x44f537=0x0;var _0x499b84=![];var _0x19bd50;var _0x28393b;return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x1ea8c4[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0xf7')],'as':'Interval','include':[{'model':db[_0x2655('0xf7')],'as':_0x2655('0xf8'),'attributes':['id',_0x2655('0xef')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1056ba,null))[_0x2655('0x35')](function(_0x3ef0f0){if(_0x3ef0f0){_0x19bd50=_0x3ef0f0;return _0x3ef0f0[_0x2655('0xf9')]({'raw':!![]});}})[_0x2655('0x35')](function(_0x24eb53){if(_0x19bd50){if(_0x24eb53){_0x28393b=_0x24eb53;}}return require(_0x2655('0x7d'))[_0x2655('0x7e')]();})['then'](function(_0x1be665){if(_0x1be665){_0x44f537=_0x1be665[_0x2655('0xfa')];_0x499b84=_0x1be665['custom'];}})[_0x2655('0x35')](function(){return db[_0x2655('0xb9')]['count']({'where':{'closed':![]}});})[_0x2655('0x35')](function(_0x26f62f){_0x387699=_0x26f62f;if(_0x44f537&&_0x26f62f>_0x44f537){return db[_0x2655('0xfb')]['findOne']({'where':{'id':0x1}})[_0x2655('0x35')](function(_0x2595a4){if(_0x2595a4){_0x2595a4[_0x2655('0xfc')](_0x2655('0xfd'));}});}})[_0x2655('0x35')](function(){if(_0x19bd50[_0x2655('0xf7')]&&_0x19bd50['Interval'][_0x2655('0xf8')]){var _0x4821b4=[];for(var _0x3c5087=0x0;_0x3c5087<_0x19bd50['Interval'][_0x2655('0xf8')][_0x2655('0x44')];_0x3c5087++){var _0x4c4406=_0x19bd50['Interval'][_0x2655('0xf8')][_0x3c5087][_0x2655('0x5e')]({'plain':!![]});_0x4821b4[_0x2655('0xc1')](iftimePromise(_0x4c4406,_0x19bd50));}return BPromise[_0x2655('0xfe')](_0x4821b4)[_0x2655('0x35')](function(_0x587ba0){return _[_0x2655('0xff')](_0x587ba0);});}else{return!![];}})[_0x2655('0x35')](function(_0x5ddc0b){var _0x51cca6=fs['readFileSync'](path[_0x2655('0x82')](config['root'],_0x2655('0x100')),_0x2655('0xd3'));var _0x4620c9={'remote':_0x19bd50[_0x2655('0x101')],'query':querystring[_0x2655('0x29')](_[_0x2655('0x4c')](_0x19bd50[_0x2655('0x5e')]({'plain':!![]}),{'customerIp':_0x1ea8c4[_0x2655('0x8f')]['x-forwarded-for']||_0x1ea8c4['headers']['x-real-ip']||_0x1ea8c4[_0x2655('0x102')][_0x2655('0x103')]||_0x1ea8c4['ip'],'referer':_0x1ea8c4[_0x2655('0x8f')]['referer'],'openedInteractions':_0x387699,'maxInteractions':_0x44f537,'virtual':_0x499b84[_0x2655('0xfa')],'online':_0x5ddc0b,'custom':_0x499b84}))[_0x2655('0x104')](/'/g,'\x5c\x27')};_0x1056ba[_0x2655('0x3a')](ejs['render'](Mustache[_0x2655('0xd4')](_0x51cca6,_0x4620c9),{'proactiveActions':_0x28393b,'alignment':_0x19bd50[_0x2655('0x105')],'verticalAlignment':_0x19bd50[_0x2655('0x106')]}));})[_0x2655('0x57')](handleError(_0x1056ba,null));};exports[_0x2655('0x107')]=function(_0x5b5e22,_0x88d4dd,_0x53cb82){return db['ChatWebsite'][_0x2655('0x6a')]({'where':{'id':_0x5b5e22[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x88d4dd,null))['then'](function(_0x20f940){if(_0x20f940){return db['sequelize']['transaction'](function(_0x50c358){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x5b5e22[_0x2655('0x64')]['id']},'transaction':_0x50c358})[_0x2655('0x35')](function(_0x23e8b2){var _0x4aaf6d=_[_0x2655('0x4d')](_0x5b5e22['body'],function(_0x15ec3e){_0x15ec3e[_0x2655('0x67')]=_0x5b5e22[_0x2655('0x64')]['id'];return _0x15ec3e;});return db[_0x2655('0xa2')][_0x2655('0x108')](_0x4aaf6d,{'transaction':_0x50c358});});})[_0x2655('0x35')](function(){return db[_0x2655('0xa2')][_0x2655('0x109')]({'where':{'ChatWebsiteId':_0x5b5e22['params']['id']},'order':_0x2655('0xa9')});});}})['then'](respondWithResult(_0x88d4dd,null))[_0x2655('0x57')](handleError(_0x88d4dd,null));};exports[_0x2655('0x10a')]=function(_0x401840,_0x272826,_0x4ec181){var _0x345ab2={};var _0x32f9cb={};var _0xc0c9e5;var _0x32b663;return db['ChatWebsite']['findOne']({'where':{'id':_0x401840['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x272826,null))[_0x2655('0x35')](function(_0x109d9a){if(_0x109d9a){_0xc0c9e5=_0x109d9a;_0x32f9cb['model']=_[_0x2655('0x40')](db[_0x2655('0xa2')][_0x2655('0x6b')]);_0x32f9cb[_0x2655('0x3f')]=_['keys'](_0x401840[_0x2655('0x3f')]);_0x32f9cb['filters']=_[_0x2655('0x42')](_0x32f9cb['model'],_0x32f9cb[_0x2655('0x3f')]);_0x345ab2[_0x2655('0x43')]=_[_0x2655('0x42')](_0x32f9cb[_0x2655('0x3e')],qs['fields'](_0x401840[_0x2655('0x3f')][_0x2655('0x59')]));_0x345ab2[_0x2655('0x43')]=_0x345ab2['attributes'][_0x2655('0x44')]?_0x345ab2['attributes']:_0x32f9cb['model'];_0x345ab2['order']=qs['sort'](_0x401840[_0x2655('0x3f')][_0x2655('0x48')]);_0x345ab2[_0x2655('0x4b')]=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x401840[_0x2655('0x3f')],_0x32f9cb[_0x2655('0x41')]));if(_0x401840[_0x2655('0x3f')][_0x2655('0x4a')]){_0x345ab2[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x345ab2[_0x2655('0x4b')],{'$or':_['map'](_0x345ab2[_0x2655('0x43')],function(_0x30313c){var _0x130118={};_0x130118[_0x30313c]={'$like':'%'+_0x401840[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x130118;})});}_0x345ab2=_[_0x2655('0x4c')]({},_0x345ab2,_0x401840[_0x2655('0x51')]);return _0xc0c9e5['getApplications'](_0x345ab2);}})['then'](function(_0x5ce549){if(_0x5ce549){_0x32b663=_0x5ce549[_0x2655('0x44')];if(!_0x401840[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x345ab2[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x401840[_0x2655('0x3f')][_0x2655('0x47')]);_0x345ab2['offset']=qs[_0x2655('0x2f')](_0x401840[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0xc0c9e5[_0x2655('0x10a')](_0x345ab2);}})[_0x2655('0x35')](function(_0x5bbbfa){if(_0x5bbbfa){return _0x5bbbfa?{'count':_0x32b663,'rows':_0x5bbbfa}:null;}})[_0x2655('0x35')](respondWithResult(_0x272826,null))[_0x2655('0x57')](handleError(_0x272826,null));};exports[_0x2655('0x10b')]=function(_0x2a87d5,_0x114805,_0x171aea){return db[_0x2655('0x10c')][_0x2655('0x5a')]({'where':{'id':_0x2a87d5[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x114805,null))['then'](function(_0x19ca0e){if(_0x19ca0e){return _0x19ca0e[_0x2655('0x10b')](_0x2a87d5[_0x2655('0x5c')]['ids'],_[_0x2655('0xe5')](_0x2a87d5[_0x2655('0x5c')],['ids','id'])||{});}})[_0x2655('0x35')](respondWithResult(_0x114805,null))[_0x2655('0x57')](handleError(_0x114805,null));};exports[_0x2655('0xf9')]=function(_0x58beec,_0x249d89,_0xa2853f){var _0x3c9ad4={};var _0x2c3b3b={};var _0x41032f;var _0x3975f9;return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x58beec[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x249d89,null))[_0x2655('0x35')](function(_0x59206d){if(_0x59206d){_0x41032f=_0x59206d;_0x2c3b3b[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x10d')][_0x2655('0x6b')]);_0x2c3b3b['query']=_[_0x2655('0x40')](_0x58beec[_0x2655('0x3f')]);_0x2c3b3b[_0x2655('0x41')]=_[_0x2655('0x42')](_0x2c3b3b[_0x2655('0x3e')],_0x2c3b3b[_0x2655('0x3f')]);_0x3c9ad4[_0x2655('0x43')]=_['intersection'](_0x2c3b3b[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x58beec['query'][_0x2655('0x59')]));_0x3c9ad4[_0x2655('0x43')]=_0x3c9ad4['attributes'][_0x2655('0x44')]?_0x3c9ad4[_0x2655('0x43')]:_0x2c3b3b[_0x2655('0x3e')];_0x3c9ad4['order']=qs[_0x2655('0x48')](_0x58beec[_0x2655('0x3f')][_0x2655('0x48')]);_0x3c9ad4[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0x58beec[_0x2655('0x3f')],_0x2c3b3b[_0x2655('0x41')]));if(_0x58beec['query']['filter']){_0x3c9ad4['where']=_[_0x2655('0x4c')](_0x3c9ad4[_0x2655('0x4b')],{'$or':_['map'](_0x3c9ad4['attributes'],function(_0x3d7f8a){var _0x1a6c34={};_0x1a6c34[_0x3d7f8a]={'$like':'%'+_0x58beec[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x1a6c34;})});}_0x3c9ad4=_[_0x2655('0x4c')]({},_0x3c9ad4,_0x58beec[_0x2655('0x51')]);return _0x41032f['getProactiveActions'](_0x3c9ad4);}})[_0x2655('0x35')](function(_0x17efbd){if(_0x17efbd){_0x3975f9=_0x17efbd[_0x2655('0x44')];if(!_0x58beec[_0x2655('0x3f')][_0x2655('0x45')]('nolimit')){_0x3c9ad4['limit']=qs[_0x2655('0x47')](_0x58beec[_0x2655('0x3f')]['limit']);_0x3c9ad4[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x58beec[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0x41032f['getProactiveActions'](_0x3c9ad4);}})[_0x2655('0x35')](function(_0x2ec517){if(_0x2ec517){return _0x2ec517?{'count':_0x3975f9,'rows':_0x2ec517}:null;}})[_0x2655('0x35')](respondWithResult(_0x249d89,null))[_0x2655('0x57')](handleError(_0x249d89,null));};exports[_0x2655('0x10e')]=function(_0x3314b9,_0x524d24,_0x49e7ae){var _0x594795=_0x3314b9[_0x2655('0x3f')][_0x2655('0x10f')]===_0x2655('0x110')?_0x2655('0x111'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x594795],'where':{'id':_0x3314b9[_0x2655('0x64')]['id']}})['then'](handleEntityNotFound(_0x524d24,null))['then'](function(_0x70e09){if(_0x70e09){var _0x21f747=_0x70e09[_0x594795];var _0x2d9525=_0x21f747&&_0x21f747[_0x2655('0x112')]?_0x21f747[_0x2655('0x112')]:[];_0x524d24[_0x2655('0x3a')]({'fromKey':_[_0x2655('0x80')](_0x21f747['fromKey'])?undefined:_0x21f747[_0x2655('0x113')],'count':_0x2d9525[_0x2655('0x44')],'rows':_0x2d9525});}})[_0x2655('0x57')](handleError(_0x524d24,null));};exports['getOfflineMessages']=function(_0x2b8e83,_0x17a2ba,_0xf42b04){var _0x23f6c7={'raw':!![],'where':{}};var _0x5be4c3={};var _0xd49fda={'count':0x0,'rows':[]};return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x2b8e83[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x17a2ba,null))[_0x2655('0x35')](function(_0x3d0847){if(_0x3d0847){_0x5be4c3[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x114')]['rawAttributes']);_0x5be4c3['query']=_['keys'](_0x2b8e83['query']);_0x5be4c3[_0x2655('0x41')]=_['intersection'](_0x5be4c3[_0x2655('0x3e')],_0x5be4c3[_0x2655('0x3f')]);_0x23f6c7[_0x2655('0x43')]=_[_0x2655('0x42')](_0x5be4c3[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x59')]));_0x23f6c7[_0x2655('0x43')]=_0x23f6c7[_0x2655('0x43')][_0x2655('0x44')]?_0x23f6c7['attributes']:_0x5be4c3[_0x2655('0x3e')];if(!_0x2b8e83[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x23f6c7[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x2b8e83['query'][_0x2655('0x47')]);_0x23f6c7[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x23f6c7['order']=qs[_0x2655('0x48')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x48')]);_0x23f6c7[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0x2b8e83[_0x2655('0x3f')],_0x5be4c3[_0x2655('0x41')]));_0x23f6c7[_0x2655('0x4b')][_0x2655('0x67')]=_0x3d0847['id'];if(_0x2b8e83[_0x2655('0x3f')]['filter']){_0x23f6c7[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x23f6c7[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x23f6c7[_0x2655('0x43')],function(_0x159f8d){var _0x2754e8={};_0x2754e8[_0x159f8d]={'$like':'%'+_0x2b8e83[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2754e8;})});}_0x23f6c7=_[_0x2655('0x4c')]({},_0x23f6c7,_0x2b8e83['options']);return db['ChatOfflineMessage'][_0x2655('0x52')]({'where':_0x23f6c7[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x5426ff){_0xd49fda[_0x2655('0x52')]=_0x5426ff;if(_0x2b8e83[_0x2655('0x3f')][_0x2655('0x53')]){_0x23f6c7[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x114')]['findAll'](_0x23f6c7);})['then'](function(_0x25c5e1){_0xd49fda[_0x2655('0x56')]=_0x25c5e1;return _0xd49fda;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x17a2ba,_0x23f6c7))[_0x2655('0x57')](handleError(_0x17a2ba,null));};exports[_0x2655('0x115')]=function(_0x38d541,_0x32f03c,_0x4a54a0){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x38d541['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x32f03c,null))[_0x2655('0x35')](function(_0x5a2173){if(_0x5a2173){return _0x5a2173[_0x2655('0x115')](_0x38d541[_0x2655('0x5c')][_0x2655('0x6e')],_['omit'](_0x38d541[_0x2655('0x5c')],[_0x2655('0x6e'),'id'])||{})['spread'](function(_0x27bd3b){for(var _0x2774a6=0x0;_0x2774a6<_0x38d541[_0x2655('0x5c')][_0x2655('0x6e')][_0x2655('0x44')];_0x2774a6+=0x1){socket[_0x2655('0x116')](_0x2655('0x117'),{'UserId':_0x38d541[_0x2655('0x5c')]['ids'][_0x2774a6],'ChatWebsiteId':_0x38d541[_0x2655('0x64')]['id']});}return _0x27bd3b;});}})[_0x2655('0x35')](respondWithResult(_0x32f03c,null))[_0x2655('0x57')](handleError(_0x32f03c,null));};exports['removeAgents']=function(_0x137524,_0x599503,_0x569009){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x137524[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x599503,null))[_0x2655('0x35')](function(_0x34acbe){if(_0x34acbe){return _0x34acbe['removeAgents'](_0x137524[_0x2655('0x3f')][_0x2655('0x6e')])[_0x2655('0x35')](function(){if(_['isArray'](_0x137524['query'][_0x2655('0x6e')])){for(var _0x5ec667=0x0;_0x5ec667<_0x137524[_0x2655('0x3f')][_0x2655('0x6e')]['length'];_0x5ec667+=0x1){socket[_0x2655('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x137524[_0x2655('0x3f')][_0x2655('0x6e')][_0x5ec667]),'ChatWebsiteId':Number(_0x137524[_0x2655('0x64')]['id'])});}}else{socket[_0x2655('0x116')](_0x2655('0x118'),{'UserId':Number(_0x137524[_0x2655('0x3f')]['ids']),'ChatWebsiteId':Number(_0x137524['params']['id'])});}});}})[_0x2655('0x35')](respondWithStatusCode(_0x599503,null))['catch'](handleError(_0x599503,null));};exports[_0x2655('0x119')]=function(_0x4001c3,_0x698ac5,_0x2cff86){var _0x53db1e={};var _0x21a8db={};var _0x19194f;var _0x4274ce;return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x4001c3[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x698ac5,null))['then'](function(_0x31b30e){if(_0x31b30e){_0x19194f=_0x31b30e;_0x21a8db[_0x2655('0x3e')]=_['keys'](db[_0x2655('0xc7')]['rawAttributes']);_0x21a8db['query']=_[_0x2655('0x40')](_0x4001c3['query']);_0x21a8db[_0x2655('0x41')]=_[_0x2655('0x42')](_0x21a8db[_0x2655('0x3e')],_0x21a8db[_0x2655('0x3f')]);_0x53db1e[_0x2655('0x43')]=_[_0x2655('0x42')](_0x21a8db[_0x2655('0x3e')],qs['fields'](_0x4001c3[_0x2655('0x3f')]['fields']));_0x53db1e[_0x2655('0x43')]=_0x53db1e['attributes'][_0x2655('0x44')]?_0x53db1e[_0x2655('0x43')]:_0x21a8db[_0x2655('0x3e')];_0x53db1e[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0x4001c3[_0x2655('0x3f')]['sort']);_0x53db1e[_0x2655('0x4b')]=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x4001c3[_0x2655('0x3f')],_0x21a8db[_0x2655('0x41')]));if(_0x4001c3[_0x2655('0x3f')][_0x2655('0x4a')]){_0x53db1e[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x53db1e[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x53db1e['attributes'],function(_0x34e8f8){var _0x2cff7c={};_0x2cff7c[_0x34e8f8]={'$like':'%'+_0x4001c3[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2cff7c;})});}_0x53db1e=_['merge']({},_0x53db1e,_0x4001c3['options']);return _0x19194f['getAgents'](_0x53db1e);}})[_0x2655('0x35')](function(_0x3d8276){if(_0x3d8276){_0x4274ce=_0x3d8276[_0x2655('0x44')];if(!_0x4001c3[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x53db1e[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x4001c3[_0x2655('0x3f')]['limit']);_0x53db1e['offset']=qs[_0x2655('0x2f')](_0x4001c3[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0x19194f[_0x2655('0x119')](_0x53db1e);}})['then'](function(_0x20d439){if(_0x20d439){return _0x20d439?{'count':_0x4274ce,'rows':_0x20d439}:null;}})['then'](respondWithResult(_0x698ac5,null))[_0x2655('0x57')](handleError(_0x698ac5,null));}; \ No newline at end of file +var _0x54ef=['ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','apply','reject','save','update','get','destroy','sendStatus','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','intersection','find','create','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','sitepic','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','contact','firstName','lastName','customerIp','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','user','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','readFileSync','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x54ef,0x112));var _0xf54e=function(_0xd3cb7c,_0xc6110b){_0xd3cb7c=_0xd3cb7c-0x0;var _0x3414e4=_0x54ef[_0xd3cb7c];return _0x3414e4;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf54e('0x1d')][_0xf54e('0x1e')]({'port':0x232c});var client9002=jayson[_0xf54e('0x1d')][_0xf54e('0x1e')]({'port':0x232a});var client9003=jayson['client'][_0xf54e('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x389abc,_0x3eb415,_0x5c5d00){if(_0x5c5d00){var _0x4af633=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4af633[_0xf54e('0x1f')](_0x3eb415)){return _0x389abc;}else{throw new Error(_0xf54e('0x20'));}}else{return _0x389abc;}}function respondWithRpcPromise(_0x1c02e7,_0x9647f,_0x15cc48,_0x3e7d96){return new BPromise(function(_0x2e27b6,_0x1ef06e){var _0x1dcc04=_0x3e7d96||client;return _0x1dcc04[_0xf54e('0x21')](_0x1c02e7,_0x15cc48)[_0xf54e('0x22')](function(_0x50fc66){logger['info'](_0xf54e('0x23'),_0x9647f,'request\x20sent');logger[_0xf54e('0x24')](_0xf54e('0x25'),_0x9647f,_0xf54e('0x26'),JSON[_0xf54e('0x27')](_0x50fc66));if(_0x50fc66[_0xf54e('0x28')]){if(_0x50fc66[_0xf54e('0x28')][_0xf54e('0x29')]===0x1f4){logger[_0xf54e('0x28')](_0xf54e('0x23'),_0x9647f,_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);return _0x1ef06e(_0x50fc66['error'][_0xf54e('0x2a')]);}logger['error'](_0xf54e('0x23'),_0x9647f,_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);return _0x2e27b6(_0x50fc66[_0xf54e('0x28')][_0xf54e('0x2a')]);}else{logger[_0xf54e('0x2b')](_0xf54e('0x23'),_0x9647f,_0xf54e('0x26'));_0x2e27b6(_0x50fc66[_0xf54e('0x2c')][_0xf54e('0x2a')]);}})[_0xf54e('0x2d')](function(_0x39c0ae){logger[_0xf54e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x9647f,_0x39c0ae);_0x1ef06e(_0x39c0ae);});});}function respondWithStatusCode(_0xb3706e,_0x4cbf7c){_0x4cbf7c=_0x4cbf7c||0xcc;return function(_0x282c63){if(_0x282c63){return _0xb3706e['sendStatus'](_0x4cbf7c);}return _0xb3706e[_0xf54e('0x2e')](_0x4cbf7c)[_0xf54e('0x2f')]();};}function respondWithResult(_0x21ba00,_0xa13cd0){_0xa13cd0=_0xa13cd0||0xc8;return function(_0x25b643){if(_0x25b643){return _0x21ba00[_0xf54e('0x2e')](_0xa13cd0)[_0xf54e('0x30')](_0x25b643);}};}function respondWithFilteredResult(_0x54bd8f,_0x4b3c73){return function(_0x2f96b1){if(_0x2f96b1){var _0x258d29=_0x2f96b1[_0xf54e('0x31')],_0x2ec92e=_0x4b3c73[_0xf54e('0x32')],_0x16d00f=_0x4b3c73[_0xf54e('0x32')]+_0x4b3c73[_0xf54e('0x33')],_0xb2d4c4;if(_0x16d00f>=_0x258d29){_0x16d00f=_0x258d29;_0xb2d4c4=0xc8;}else{_0xb2d4c4=0xce;}_0x54bd8f[_0xf54e('0x2e')](_0xb2d4c4);return _0x54bd8f['set']('Content-Range',_0x2ec92e+'-'+_0x16d00f+'/'+_0x258d29)[_0xf54e('0x30')](_0x2f96b1);}return null;};}function patchUpdates(_0x3169dd){return function(_0x4d8fdd){try{jsonpatch[_0xf54e('0x34')](_0x4d8fdd,_0x3169dd,!![]);}catch(_0x82e313){return BPromise[_0xf54e('0x35')](_0x82e313);}return _0x4d8fdd[_0xf54e('0x36')]();};}function saveUpdates(_0x576b46,_0x54bea4){return function(_0x4bb173){if(_0x4bb173){return _0x4bb173[_0xf54e('0x37')](_0x576b46)[_0xf54e('0x22')](function(_0x210d6d){return _0x210d6d;});}return null;};}function removeEntity(_0x399e68,_0x29dc39){return function(_0x3a2104){if(_0x3a2104){return _0x3a2104['destroy']()['then'](function(){var _0x530cee=_0x3a2104[_0xf54e('0x38')]({'plain':!![]});var _0x734187='ChatWebsites';return db['UserProfileResource'][_0xf54e('0x39')]({'where':{'type':_0x734187,'resourceId':_0x530cee['id']}})[_0xf54e('0x22')](function(){return _0x3a2104;});})[_0xf54e('0x22')](function(){_0x399e68['status'](0xcc)[_0xf54e('0x2f')]();});}};}function handleEntityNotFound(_0x44a437,_0x50aeca){return function(_0x38d7a0){if(!_0x38d7a0){_0x44a437[_0xf54e('0x3a')](0x194);}return _0x38d7a0;};}function handleError(_0x5af03,_0x1eeeb4){_0x1eeeb4=_0x1eeeb4||0x1f4;return function(_0x12ef97){logger[_0xf54e('0x28')](_0x12ef97['stack']);if(_0x12ef97['name']){delete _0x12ef97[_0xf54e('0x3b')];}_0x5af03[_0xf54e('0x2e')](_0x1eeeb4)[_0xf54e('0x3c')](_0x12ef97);};}exports['index']=function(_0x4533a2,_0x22fa6f){var _0x448054={'include':[{'model':db[_0xf54e('0x3d')],'as':_0xf54e('0x3e')}]},_0x1ee884={},_0x361e4c={'count':0x0,'rows':[]};var _0x1345b0=db[_0xf54e('0x3f')][_0xf54e('0x40')];_0x1ee884[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x1345b0);_0x1ee884[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x4533a2[_0xf54e('0x43')]);_0x1ee884['filters']=_['intersection'](_0x1ee884['model'],_0x1ee884[_0xf54e('0x43')]);_0x448054[_0xf54e('0x44')]=_['intersection'](_0x1ee884[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x4533a2[_0xf54e('0x43')]['fields']));_0x448054[_0xf54e('0x44')]=_0x448054[_0xf54e('0x44')][_0xf54e('0x46')]?_0x448054[_0xf54e('0x44')]:_0x1ee884[_0xf54e('0x41')];if(!_0x4533a2[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x448054[_0xf54e('0x33')]=qs['limit'](_0x4533a2[_0xf54e('0x43')][_0xf54e('0x33')]);_0x448054[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x4533a2[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x448054['order']=qs[_0xf54e('0x49')](_0x4533a2['query'][_0xf54e('0x49')]);_0x448054['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x4533a2[_0xf54e('0x43')],_0x1ee884['filters']));if(_0x4533a2[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x448054[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x448054[_0xf54e('0x4d')],{'$or':_['map'](_0x1345b0,function(_0x427799){if(_0x427799[_0xf54e('0x4f')][_0xf54e('0x50')]!==_0xf54e('0x51')){var _0x5f3438={};_0x5f3438[_0x427799[_0xf54e('0x52')]]={'$like':'%'+_0x4533a2[_0xf54e('0x43')]['filter']+'%'};return _0x5f3438;}})});}_0x448054=_[_0xf54e('0x4e')]({},_0x448054,_0x4533a2[_0xf54e('0x53')]);var _0x3d24c7={'where':_0x448054[_0xf54e('0x4d')]};return db['ChatWebsite'][_0xf54e('0x31')](_0x3d24c7)[_0xf54e('0x22')](function(_0x2527f6){_0x361e4c[_0xf54e('0x31')]=_0x2527f6;if(_0x4533a2[_0xf54e('0x43')][_0xf54e('0x54')]){_0x448054[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x56')](_0x448054);})[_0xf54e('0x22')](function(_0xaf9bf0){_0x361e4c[_0xf54e('0x57')]=_0xaf9bf0;return _0x361e4c;})[_0xf54e('0x22')](respondWithFilteredResult(_0x22fa6f,_0x448054))[_0xf54e('0x2d')](handleError(_0x22fa6f,null));};exports[_0xf54e('0x58')]=function(_0xa6c305,_0x40d8ab){var _0xe9338b={'raw':![],'where':{'id':_0xa6c305[_0xf54e('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x21fd80={};_0x21fd80[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x3f')][_0xf54e('0x40')]);_0x21fd80[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0xa6c305[_0xf54e('0x43')]);_0x21fd80[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x21fd80[_0xf54e('0x41')],_0x21fd80[_0xf54e('0x43')]);_0xe9338b['attributes']=_[_0xf54e('0x5a')](_0x21fd80[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0xa6c305[_0xf54e('0x43')][_0xf54e('0x45')]));_0xe9338b[_0xf54e('0x44')]=_0xe9338b[_0xf54e('0x44')]['length']?_0xe9338b[_0xf54e('0x44')]:_0x21fd80[_0xf54e('0x41')];if(_0xa6c305[_0xf54e('0x43')]['includeAll']){_0xe9338b[_0xf54e('0x55')]=[{'all':!![]}];}_0xe9338b=_['merge']({},_0xe9338b,_0xa6c305[_0xf54e('0x53')]);return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0xe9338b)['then'](handleEntityNotFound(_0x40d8ab,null))[_0xf54e('0x22')](respondWithResult(_0x40d8ab,null))[_0xf54e('0x2d')](handleError(_0x40d8ab,null));};exports[_0xf54e('0x5c')]=function(_0x4e5059,_0x3744a4){return db[_0xf54e('0x3f')][_0xf54e('0x5c')](_0x4e5059['body'],{})['then'](function(_0x4270e1){var _0x9ab4c4=_0x4e5059['user'][_0xf54e('0x38')]({'plain':!![]});if(!_0x9ab4c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9ab4c4[_0xf54e('0x5d')]==='user'){var _0x324167=_0x4270e1[_0xf54e('0x38')]({'plain':!![]});var _0x3f4243=_0xf54e('0x5e');return db[_0xf54e('0x5f')][_0xf54e('0x5b')]({'where':{'name':_0x3f4243,'userProfileId':_0x9ab4c4['userProfileId']},'raw':!![]})['then'](function(_0x79345){if(_0x79345&&_0x79345[_0xf54e('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x324167[_0xf54e('0x3b')],'resourceId':_0x324167['id'],'type':_0x79345['name'],'sectionId':_0x79345['id']},{})[_0xf54e('0x22')](function(){return _0x4270e1;});}else{return _0x4270e1;}})[_0xf54e('0x2d')](function(_0x47596c){logger[_0xf54e('0x28')](_0xf54e('0x61'),_0x47596c);throw _0x47596c;});}return _0x4270e1;})[_0xf54e('0x22')](respondWithResult(_0x3744a4,0xc9))[_0xf54e('0x2d')](handleError(_0x3744a4,null));};exports[_0xf54e('0x37')]=function(_0x11732b,_0x4d8040){if(_0x11732b[_0xf54e('0x62')]['id']){delete _0x11732b[_0xf54e('0x62')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x11732b['params']['id']},'include':[{'model':db[_0xf54e('0x3d')],'as':_0xf54e('0x3e')}]})[_0xf54e('0x22')](handleEntityNotFound(_0x4d8040,null))[_0xf54e('0x22')](saveUpdates(_0x11732b[_0xf54e('0x62')],null))['then'](respondWithResult(_0x4d8040,null))[_0xf54e('0x2d')](handleError(_0x4d8040,null));};exports[_0xf54e('0x39')]=function(_0x577075,_0x51ec35){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x577075[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x51ec35,null))[_0xf54e('0x22')](removeEntity(_0x51ec35,null))[_0xf54e('0x2d')](handleError(_0x51ec35,null));};exports['describe']=function(_0x2ecda1,_0x5cdb8c){return db[_0xf54e('0x3f')][_0xf54e('0x63')]()[_0xf54e('0x22')](respondWithResult(_0x5cdb8c,null))['catch'](handleError(_0x5cdb8c,null));};exports[_0xf54e('0x64')]=function(_0x504ec7,_0x3f7224,_0x3e2101){if(_0x504ec7['body']['id']){delete _0x504ec7[_0xf54e('0x62')]['id'];}return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x504ec7[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x3f7224,null))[_0xf54e('0x22')](function(_0x21159f){if(_0x21159f){_0x504ec7['body'][_0xf54e('0x65')]=_0x21159f['id'];return db[_0xf54e('0x66')]['create'](_0x504ec7[_0xf54e('0x62')]);}})[_0xf54e('0x22')](respondWithResult(_0x3f7224,null))['catch'](handleError(_0x3f7224,null));};exports[_0xf54e('0x67')]=function(_0x14aaf7,_0x309895,_0x4c72ef){var _0xf4e4d={'raw':![],'where':{}};var _0x4ae3d0={};var _0x8ed40a={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')]['findOne']({'where':{'id':_0x14aaf7[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x309895,null))[_0xf54e('0x22')](function(_0x3bdf23){if(_0x3bdf23){_0x4ae3d0[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x66')][_0xf54e('0x40')]);_0x4ae3d0[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x14aaf7[_0xf54e('0x43')]);_0x4ae3d0['filters']=_[_0xf54e('0x5a')](_0x4ae3d0[_0xf54e('0x41')],_0x4ae3d0[_0xf54e('0x43')]);_0xf4e4d['attributes']=_[_0xf54e('0x5a')](_0x4ae3d0[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x45')]));_0xf4e4d[_0xf54e('0x44')]=_0xf4e4d[_0xf54e('0x44')]['length']?_0xf4e4d[_0xf54e('0x44')]:_0x4ae3d0[_0xf54e('0x41')];if(!_0x14aaf7[_0xf54e('0x43')]['hasOwnProperty'](_0xf54e('0x48'))){_0xf4e4d[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x14aaf7[_0xf54e('0x43')]['limit']);_0xf4e4d['offset']=qs[_0xf54e('0x32')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x32')]);}_0xf4e4d[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x49')]);_0xf4e4d[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x14aaf7['query'],_0x4ae3d0[_0xf54e('0x4a')]));_0xf4e4d[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x3bdf23['id'];if(_0x14aaf7[_0xf54e('0x43')]['filter']){_0xf4e4d[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0xf4e4d[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0xf4e4d['attributes'],function(_0x394862){var _0x4876b5={};_0x4876b5[_0x394862]={'$like':'%'+_0x14aaf7[_0xf54e('0x43')]['filter']+'%'};return _0x4876b5;})});}_0xf4e4d=_['merge']({},_0xf4e4d,_0x14aaf7[_0xf54e('0x53')]);return db[_0xf54e('0x66')][_0xf54e('0x31')]({'where':_0xf4e4d[_0xf54e('0x4d')]})[_0xf54e('0x22')](function(_0x14b7fc){_0x8ed40a[_0xf54e('0x31')]=_0x14b7fc;if(_0x14aaf7[_0xf54e('0x43')][_0xf54e('0x54')]){_0xf4e4d['include']=[{'all':!![]}];}return db[_0xf54e('0x66')][_0xf54e('0x56')](_0xf4e4d);})[_0xf54e('0x22')](function(_0x37a61b){_0x8ed40a[_0xf54e('0x57')]=_0x37a61b;return _0x8ed40a;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x309895,_0xf4e4d))[_0xf54e('0x2d')](handleError(_0x309895,null));};exports[_0xf54e('0x6a')]=function(_0x2fa9bc,_0xe58bec,_0x11dec2){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x2fa9bc[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xe58bec,null))['then'](function(_0x4a0614){if(_0x4a0614){return _0x4a0614[_0xf54e('0x6a')](_0x2fa9bc[_0xf54e('0x43')][_0xf54e('0x6b')]);}})[_0xf54e('0x22')](respondWithStatusCode(_0xe58bec,null))[_0xf54e('0x2d')](handleError(_0xe58bec,null));};exports[_0xf54e('0x6c')]=function(_0x1d1d10,_0x403445,_0x244451){if(_0x1d1d10['body']['id']){delete _0x1d1d10[_0xf54e('0x62')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x1d1d10['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x403445,null))['then'](function(_0x3830e7){if(_0x3830e7){_0x1d1d10['body'][_0xf54e('0x65')]=_0x3830e7['id'];return db[_0xf54e('0x6d')]['create'](_0x1d1d10['body']);}})[_0xf54e('0x22')](respondWithResult(_0x403445,null))[_0xf54e('0x2d')](handleError(_0x403445,null));};exports[_0xf54e('0x6e')]=function(_0x406261,_0x389f16,_0x486626){var _0x5c008e={'raw':![],'where':{}};var _0x1a358f={};var _0x331e1f={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x406261[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x389f16,null))[_0xf54e('0x22')](function(_0x138119){if(_0x138119){_0x1a358f[_0xf54e('0x41')]=_[_0xf54e('0x42')](db['CannedAnswer'][_0xf54e('0x40')]);_0x1a358f[_0xf54e('0x43')]=_['keys'](_0x406261['query']);_0x1a358f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x1a358f[_0xf54e('0x41')],_0x1a358f[_0xf54e('0x43')]);_0x5c008e[_0xf54e('0x44')]=_['intersection'](_0x1a358f[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x406261[_0xf54e('0x43')][_0xf54e('0x45')]));_0x5c008e['attributes']=_0x5c008e[_0xf54e('0x44')][_0xf54e('0x46')]?_0x5c008e[_0xf54e('0x44')]:_0x1a358f[_0xf54e('0x41')];if(!_0x406261['query'][_0xf54e('0x47')](_0xf54e('0x48'))){_0x5c008e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x406261[_0xf54e('0x43')]['limit']);_0x5c008e[_0xf54e('0x32')]=qs['offset'](_0x406261['query'][_0xf54e('0x32')]);}_0x5c008e[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x406261[_0xf54e('0x43')][_0xf54e('0x49')]);_0x5c008e[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x406261[_0xf54e('0x43')],_0x1a358f['filters']));_0x5c008e[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x138119['id'];if(_0x406261[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x5c008e[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x5c008e['where'],{'$or':_[_0xf54e('0x69')](_0x5c008e[_0xf54e('0x44')],function(_0xd2c60d){var _0x2b46d4={};_0x2b46d4[_0xd2c60d]={'$like':'%'+_0x406261[_0xf54e('0x43')][_0xf54e('0x4c')]+'%'};return _0x2b46d4;})});}_0x5c008e=_['merge']({},_0x5c008e,_0x406261[_0xf54e('0x53')]);return db[_0xf54e('0x6d')][_0xf54e('0x31')]({'where':_0x5c008e[_0xf54e('0x4d')]})['then'](function(_0x4787ea){_0x331e1f[_0xf54e('0x31')]=_0x4787ea;if(_0x406261[_0xf54e('0x43')][_0xf54e('0x54')]){_0x5c008e[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0x6d')][_0xf54e('0x56')](_0x5c008e);})['then'](function(_0x45fb52){_0x331e1f[_0xf54e('0x57')]=_0x45fb52;return _0x331e1f;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x389f16,_0x5c008e))[_0xf54e('0x2d')](handleError(_0x389f16,null));};exports[_0xf54e('0x70')]=function(_0xa386cc,_0x5b5a0d,_0x33bed6){return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0xa386cc['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x5b5a0d,null))[_0xf54e('0x22')](function(_0x1ffad1){if(_0x1ffad1){return _0x1ffad1[_0xf54e('0x70')](_0xa386cc[_0xf54e('0x43')]['ids']);}})[_0xf54e('0x22')](respondWithStatusCode(_0x5b5a0d,null))[_0xf54e('0x2d')](handleError(_0x5b5a0d,null));};exports['addLogo']=function(_0x246309,_0x1b3ca4,_0x42dc85){_0x246309[_0xf54e('0x62')]['sitepic']=_0x246309[_0xf54e('0x71')][_0xf54e('0x72')];return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x246309['params']['id']}})['then'](handleEntityNotFound(_0x1b3ca4,null))[_0xf54e('0x22')](saveUpdates(_0x246309['body'],null))[_0xf54e('0x22')](respondWithResult(_0x1b3ca4,null))[_0xf54e('0x2d')](handleError(_0x1b3ca4,null));};exports[_0xf54e('0x73')]=function(_0x1f1ab0,_0x235124,_0x56f125){_0x1f1ab0[_0xf54e('0x62')][_0xf54e('0x74')]=_0x1f1ab0[_0xf54e('0x71')][_0xf54e('0x72')];return db['ChatWebsite'][_0xf54e('0x5b')]({'where':{'id':_0x1f1ab0['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x235124,null))[_0xf54e('0x22')](saveUpdates(_0x1f1ab0['body'],null))[_0xf54e('0x22')](respondWithResult(_0x235124,null))[_0xf54e('0x2d')](handleError(_0x235124,null));};exports[_0xf54e('0x75')]=function(_0x23a151,_0x5a7eac,_0x31f503){_0x23a151[_0xf54e('0x62')][_0xf54e('0x76')]=_0x23a151['file']['filename'];return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x23a151['params']['id']}})['then'](handleEntityNotFound(_0x5a7eac,null))[_0xf54e('0x22')](saveUpdates(_0x23a151[_0xf54e('0x62')],null))[_0xf54e('0x22')](respondWithResult(_0x5a7eac,null))[_0xf54e('0x2d')](handleError(_0x5a7eac,null));};exports[_0xf54e('0x77')]=function(_0xe97858,_0x427124,_0x2e32f6){_0xe97858[_0xf54e('0x62')]['systemAvatar']=_0xe97858[_0xf54e('0x71')]['filename'];return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0xe97858['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x427124,null))['then'](saveUpdates(_0xe97858[_0xf54e('0x62')],null))[_0xf54e('0x22')](respondWithResult(_0x427124,null))[_0xf54e('0x2d')](handleError(_0x427124,null));};exports[_0xf54e('0x78')]=function(_0x212887,_0x3c499e,_0x4ec250){var _0x4d0131=path['join'](config[_0xf54e('0x79')],'server/files/images/logos/default_logo.png');var _0x2abe2c={'where':{'id':_0x212887[_0xf54e('0x59')]['id']},'attributes':['id',_0xf54e('0x7a')],'raw':!![]};var _0xf24a7c=![];return require(_0xf54e('0x7b'))['getLicense']()[_0xf54e('0x22')](function(_0x9c0c5e){if(_0x9c0c5e){_0xf24a7c=_0x9c0c5e[_0xf54e('0x7c')];}})[_0xf54e('0x22')](function(){return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x2abe2c);})['then'](handleEntityNotFound(_0x3c499e,null))[_0xf54e('0x22')](function(_0x811fa7){if(_0x811fa7){if(!_[_0xf54e('0x7d')](_0x811fa7[_0xf54e('0x7a')])){if(fs[_0xf54e('0x7e')](path['join'](config[_0xf54e('0x79')],_0xf54e('0x7f'),_0x811fa7[_0xf54e('0x7a')]))&&_0xf24a7c){_0x4d0131=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x7f'),_0x811fa7[_0xf54e('0x7a')]);}}return _0x3c499e[_0xf54e('0x81')](_0x4d0131);}})[_0xf54e('0x2d')](handleError(_0x3c499e,null));};exports['getAvatar']=function(_0xb94478,_0x26a293,_0x47d309){var _0x47a1d2=path[_0xf54e('0x80')](config['root'],_0xf54e('0x82'));var _0xd4db77={'where':{'id':_0xb94478[_0xf54e('0x59')]['id']},'attributes':['id',_0xf54e('0x74')],'raw':!![]};return db['ChatWebsite'][_0xf54e('0x5b')](_0xd4db77)[_0xf54e('0x22')](handleEntityNotFound(_0x26a293,null))['then'](function(_0x90ad88){if(_0x90ad88){if(!_[_0xf54e('0x7d')](_0x90ad88[_0xf54e('0x74')])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x90ad88[_0xf54e('0x74')]))){_0x47a1d2=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x90ad88['agentAvatar']);}}return _0x26a293['download'](_0x47a1d2);}})[_0xf54e('0x2d')](handleError(_0x26a293,null));};exports[_0xf54e('0x84')]=function(_0x78860e,_0x961877,_0x27ce38){var _0x4e2143=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x85'));var _0x213dc5={'where':{'id':_0x78860e['params']['id']},'attributes':['id',_0xf54e('0x76'),_0xf54e('0x86')],'raw':!![]};return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x213dc5)[_0xf54e('0x22')](handleEntityNotFound(_0x961877,null))[_0xf54e('0x22')](function(_0x164f3e){if(_0x164f3e){if(!_[_0xf54e('0x7d')](_0x164f3e[_0xf54e('0x76')])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x164f3e[_0xf54e('0x76')]))&&_0x164f3e['showCustomerAvatar']){_0x4e2143=path[_0xf54e('0x80')](config['root'],'server/files/images/avatars/',_0x164f3e[_0xf54e('0x76')]);}}return _0x961877[_0xf54e('0x81')](_0x4e2143);}})[_0xf54e('0x2d')](handleError(_0x961877,null));};exports[_0xf54e('0x87')]=function(_0x22d3c1,_0x2609ef,_0x396f98){var _0x113020=path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x88'));var _0x3c77cd={'where':{'id':_0x22d3c1[_0xf54e('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xf54e('0x3f')][_0xf54e('0x5b')](_0x3c77cd)[_0xf54e('0x22')](handleEntityNotFound(_0x2609ef,null))[_0xf54e('0x22')](function(_0x40bd52){if(_0x40bd52){if(!_['isNil'](_0x40bd52['systemAvatar'])){if(fs[_0xf54e('0x7e')](path[_0xf54e('0x80')](config['root'],'server/files/images/avatars/',_0x40bd52[_0xf54e('0x89')]))){_0x113020=path['join'](config[_0xf54e('0x79')],_0xf54e('0x83'),_0x40bd52[_0xf54e('0x89')]);}}return _0x2609ef[_0xf54e('0x81')](_0x113020);}})[_0xf54e('0x2d')](handleError(_0x2609ef,null));};exports[_0xf54e('0x8a')]=function(_0x50bff9,_0x39fc7d,_0x2e0cf9){var _0x5cf1e4=require(_0xf54e('0x8b'));var _0x37d3ba=new _0x5cf1e4();var _0x529f31=_0x37d3ba[_0xf54e('0x8c')](_0x50bff9[_0xf54e('0x8d')][_0xf54e('0x8e')])['getResult']();var _0x4d463d={'body':_0x50bff9[_0xf54e('0x62')],'channel':_0xf54e('0x8f')};var _0x5316dd=[];var _0x4f6645=[];var _0x4ce631={};var _0x39027b=![];return db[_0xf54e('0x90')][_0xf54e('0x63')]()['then'](function(_0x187b1c){if(!_0x187b1c){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x93'));}_0x5316dd=_[_0xf54e('0x94')](_['keys'](_0x187b1c),['createdAt','updatedAt']);_0x4f6645=_['difference'](_['keys'](_0x187b1c),[_0xf54e('0x95'),'updatedAt',_0xf54e('0x96'),_0xf54e('0x97')]);if(_0x50bff9['body']['id']){delete _0x50bff9[_0xf54e('0x62')]['id'];}if(_['isNil'](_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')])){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x99'));}if(_[_0xf54e('0x7d')](_0x50bff9[_0xf54e('0x62')]['body'])||_0x50bff9[_0xf54e('0x62')][_0xf54e('0x62')]===''){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x9a'));}if(_['isNil'](_0x50bff9[_0xf54e('0x62')][_0xf54e('0x9b')])){throw new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0x9c')+_0x4f6645);}if(!_[_0xf54e('0x9d')](_0x4f6645,_0x50bff9['body']['mapKey'])){throw new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x9e')+_0x4f6645);}_0x4ce631[_0x50bff9[_0xf54e('0x62')][_0xf54e('0x9b')]]=_0x50bff9[_0xf54e('0x62')]['from'];})[_0xf54e('0x22')](function(){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x50bff9[_0xf54e('0x59')]['id']},'include':[{'model':db[_0xf54e('0x9f')],'as':_0xf54e('0xa0'),'include':[{'model':db['CmContact'],'as':_0xf54e('0xa1'),'where':_0x4ce631,'limit':0x1,'order':[[_0xf54e('0xa2'),_0xf54e('0xa3')]]}]},{'model':db[_0xf54e('0xa4')],'as':_0xf54e('0xa5')}]});})[_0xf54e('0x22')](handleEntityNotFound(_0x39fc7d,null))[_0xf54e('0x22')](function(_0x370e59){if(_0x370e59&&_0x370e59['List']){_0x4d463d[_0xf54e('0xa6')]=_0x370e59;_0x4d463d['applications']=_0x370e59[_0xf54e('0xa5')];_0x4d463d[_0xf54e('0xa7')]=_0x370e59[_0xf54e('0xa0')];_0x4d463d[_0xf54e('0xa8')]=_[_0xf54e('0xa9')](_0x4d463d[_0xf54e('0xa8')],[_0xf54e('0xaa')],['asc']);if(_0x4d463d['account']['Applications']){delete _0x4d463d[_0xf54e('0xa6')]['Applications'];}if(_0x4d463d[_0xf54e('0xa6')]['List']&&_0x4d463d[_0xf54e('0xa6')][_0xf54e('0xa0')]['Contacts'][_0xf54e('0x46')]){return _0x4d463d[_0xf54e('0xa6')][_0xf54e('0xa0')][_0xf54e('0xa1')][0x0];}var _0x4701b8=_[_0xf54e('0x18')](_0x50bff9[_0xf54e('0x62')],{'firstName':_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')],'ListId':_0x370e59[_0xf54e('0x97')]});_0x4701b8[_0x50bff9[_0xf54e('0x62')]['mapKey']]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0x98')];return db[_0xf54e('0x90')]['create'](_0x4701b8,{'fields':_0x5316dd,'raw':!![]});}})[_0xf54e('0x22')](handleEntityNotFound(_0x39fc7d,null))['then'](function(_0x2f6bcc){_0x4d463d[_0xf54e('0xab')]=_0x2f6bcc;if(_0x2f6bcc){var _0x9a5d11={'ContactId':_0x2f6bcc['id'],'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'from':(_0x2f6bcc[_0xf54e('0xac')]||'')+'\x20'+(_0x2f6bcc[_0xf54e('0xad')]||''),'customerIp':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xae')],'referer':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xaf')],'browserName':_0x529f31[_0xf54e('0xb0')]['name']&&_0x529f31['browser']['version']?util[_0xf54e('0xb1')](_0xf54e('0xb2'),_0x529f31[_0xf54e('0xb0')]['name'],_0x529f31[_0xf54e('0xb0')][_0xf54e('0xb3')]):'unknown','browserVersion':_0x529f31[_0xf54e('0xb0')][_0xf54e('0xb3')]||_0xf54e('0xb4'),'osName':util[_0xf54e('0xb1')](_0xf54e('0xb2'),_0x529f31['os'][_0xf54e('0x3b')],_0x529f31['os'][_0xf54e('0xb3')]),'osVersion':_0x529f31['os']['version'],'deviceModel':_0x529f31['device'][_0xf54e('0x41')]&&_0x529f31[_0xf54e('0xb5')][_0xf54e('0xb6')]?util[_0xf54e('0xb1')]('%s\x20%s\x20%s',_0x529f31[_0xf54e('0xb5')][_0xf54e('0x41')],_0x529f31['device'][_0xf54e('0xb6')],_0x529f31['device'][_0xf54e('0x4f')]):null,'deviceVendor':_0x529f31[_0xf54e('0xb5')][_0xf54e('0xb6')],'deviceType':_0x529f31[_0xf54e('0xb5')]['type'],'formData':JSON[_0xf54e('0x27')](_0x50bff9['body'])};var _0x2e2ca8={'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'closed':![]};if(_0x50bff9[_0xf54e('0x62')][_0xf54e('0xb7')]){_0x2e2ca8['threadId']=_0x50bff9['body'][_0xf54e('0xb7')];return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':_0x2e2ca8})['then'](function(_0x125ca5){if(_0x125ca5){return[_0x125ca5,![]];}_0x9a5d11[_0xf54e('0xb7')]=_0x50bff9['body'][_0xf54e('0xb7')];_0x9a5d11[_0xf54e('0xb9')]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xb9')];return db[_0xf54e('0xb8')][_0xf54e('0x5c')](_0x9a5d11)['then'](function(_0x1bf4d5){return[_0x1bf4d5,!![]];});});}_0x2e2ca8[_0xf54e('0xba')]=_0x2f6bcc['id'];if(_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]&&_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]['id']){_0x2e2ca8['id']=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbb')]['id'];return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':_0x2e2ca8})[_0xf54e('0x22')](function(_0x189f94){if(_0x189f94){return[_0x189f94,![]];}return db[_0xf54e('0xb8')][_0xf54e('0x5c')](_0x9a5d11)[_0xf54e('0x22')](function(_0x3dee01){return[_0x3dee01,!![]];});});}return db[_0xf54e('0xb8')]['create'](_0x9a5d11)[_0xf54e('0x22')](function(_0x11c957){return[_0x11c957,!![]];});}})[_0xf54e('0xbc')](function(_0x4807c9,_0x6b3a1a){if(_0x4807c9){_0x39027b=_0x6b3a1a;if(!_0x6b3a1a){var _0x3b3d45={'from':(_0x4d463d[_0xf54e('0xab')][_0xf54e('0xac')]||'')+'\x20'+(_0x4d463d[_0xf54e('0xab')]['lastName']||'')};if(_0x50bff9[_0xf54e('0x62')]['threadId']&&_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')]&&_0x50bff9['body'][_0xf54e('0xb7')]!=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')]){_0x3b3d45[_0xf54e('0xb7')]=_0x50bff9[_0xf54e('0x62')][_0xf54e('0xbd')];}return _0x4807c9[_0xf54e('0x37')](_0x3b3d45);}else{return _0x4807c9;}}})[_0xf54e('0x22')](function(_0x1ad56e){_0x4d463d['interaction']=_0x1ad56e[_0xf54e('0x38')]({'plain':!![]});_0x4d463d['interaction'][_0xf54e('0xbe')]=_0x39027b;if(_0x4d463d[_0xf54e('0xbb')]['created']){if(_0x4d463d[_0xf54e('0xa6')]['autoclose']){_0x4d463d[_0xf54e('0xa8')][_0xf54e('0xbf')]({'id':0x0,'priority':_0x4d463d['applications'][_0xf54e('0x46')]+0x1,'app':_0xf54e('0xc0'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xf54e('0x5c')]({'body':_0x50bff9[_0xf54e('0x62')][_0xf54e('0x62')],'ChatWebsiteId':_0x50bff9[_0xf54e('0x59')]['id'],'ChatInteractionId':_0x1ad56e['id'],'direction':'in','ContactId':_0x4d463d[_0xf54e('0xab')]['id'],'AttachmentId':_0x50bff9[_0xf54e('0x62')][_0xf54e('0xc1')]});})[_0xf54e('0x22')](function(_0x5a9400){_0x4d463d['message']=_0x5a9400;if(_0x4d463d[_0xf54e('0xbb')][_0xf54e('0xc2')]){return db[_0xf54e('0xc3')][_0xf54e('0x5b')]({'attributes':['id',_0xf54e('0x3b')],'where':{'id':_0x4d463d['interaction'][_0xf54e('0xc2')]}})['then'](function(_0x4cb711){if(_0x4cb711){_0x4d463d[_0xf54e('0xa8')][_0xf54e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xf54e('0xc5'),'appdata':_0x4cb711[_0xf54e('0x3b')]+','+(_0x4d463d[_0xf54e('0xa6')][_0xf54e('0xc6')]||0xa),'interval':_0xf54e('0xc7')});_0x4d463d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xf54e('0xc8'),_0xf54e('0xc9'),_0x4d463d);});}return respondWithRpcPromise(_0xf54e('0xc8'),_0xf54e('0xc9'),_0x4d463d);})[_0xf54e('0x22')](function(_0x547a00){respondWithRpcPromise(_0xf54e('0xca'),_0xf54e('0xca'),{'event':_0xf54e('0x8a'),'message':_0x547a00},client9002);return _0x547a00;})[_0xf54e('0x22')](respondWithResult(_0x39fc7d,null))[_0xf54e('0x2d')](handleError(_0x39fc7d,null));};exports['offline']=function(_0x5edb38,_0x395bbc,_0x2564f1){var _0x3a7e79,_0x582cde,_0x332f43;var _0x2c2833=[];var _0x2d5264=[];var _0x98eaa={};return db['CmContact'][_0xf54e('0x63')]()[_0xf54e('0x22')](function(_0x3219be){if(!_0x3219be){throw new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x93'));}_0x2d5264=_[_0xf54e('0x94')](_[_0xf54e('0x42')](_0x3219be),[_0xf54e('0x95'),_0xf54e('0xa2')]);_0x2c2833=_[_0xf54e('0x94')](_[_0xf54e('0x42')](_0x3219be),['createdAt',_0xf54e('0xa2'),_0xf54e('0x96'),_0xf54e('0x97')]);if(_0x5edb38[_0xf54e('0x62')]['id']){delete _0x5edb38['body']['id'];}if(_['isNil'](_0x5edb38['body']['from'])){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db[(_0xf54e('0x91'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xf54e('0x7d')](_0x5edb38['body'][_0xf54e('0x62')])||_0x5edb38['body'][_0xf54e('0x62')]===''){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db['Sequelize'][(_0xf54e('0x92'))](_0xf54e('0x9a')));}if(_[_0xf54e('0x7d')](_0x5edb38[_0xf54e('0x62')]['mapKeyOffline'])){throw _0x395bbc[_0xf54e('0x2e')](0x1f4)[_0xf54e('0x3c')](new db[(_0xf54e('0x91'))][(_0xf54e('0x92'))](_0xf54e('0xcb')+_0x2c2833));}if(!_[_0xf54e('0x9d')](_0x2c2833,_0x5edb38['body'][_0xf54e('0xcc')])){throw _0x395bbc['status'](0x1f4)['send'](new db[(_0xf54e('0x91'))]['ValidationError'](_0xf54e('0xcd')+_0x2c2833));}_0x98eaa[_0x5edb38[_0xf54e('0x62')]['mapKeyOffline']]=_0x5edb38['body'][_0xf54e('0x98')];})['then'](function(){return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x5edb38['params']['id']},'include':[{'model':db[_0xf54e('0x9f')],'as':'List'}]});})[_0xf54e('0x22')](handleEntityNotFound(_0x395bbc,null))[_0xf54e('0x22')](function(_0x4f4695){if(_0x4f4695&&_0x4f4695[_0xf54e('0xa0')]){_0x582cde=_0x4f4695;var _0x1cb490=_[_0xf54e('0x18')](_0x5edb38[_0xf54e('0x62')],{'firstName':_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')],'phone':_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')],'ListId':_0x4f4695[_0xf54e('0x97')]});_0x1cb490[_0x5edb38['body']['mapKeyOffline']]=_0x5edb38[_0xf54e('0x62')][_0xf54e('0x98')];return db[_0xf54e('0x90')][_0xf54e('0xce')]({'where':_0x98eaa,'defaults':_0x1cb490});}})['spread'](function(_0x143b50){if(_0x143b50){_0x332f43=_0x143b50;var _0x3986ec=fs['readFileSync'](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0xcf')),_0xf54e('0xd0'));var _0x24e9d6=ejs[_0xf54e('0xd1')](_0x3986ec,{'body':_[_0xf54e('0xd2')](_0x5edb38[_0xf54e('0x62')][_0xf54e('0x62')]),'bodyTitle':_0x582cde[_0xf54e('0xd3')]});return db[_0xf54e('0xd4')]['create']({'body':_0x24e9d6,'ContactId':_0x143b50['id'],'ChatWebsiteId':_0x582cde['id']});}})['then'](function(_0x293905){if(_0x293905){_0x3a7e79=_0x293905;return db[_0xf54e('0xd5')][_0xf54e('0x6f')]({'where':{'service':!![]},'include':[{'model':db[_0xf54e('0xd6')],'as':_0xf54e('0xd7'),'raw':!![]}]});}})[_0xf54e('0x22')](function(_0x53d6f9){if(_0x53d6f9&&_0x53d6f9[_0xf54e('0xd7')]&&_0x582cde[_0xf54e('0xd8')]){var _0x4bf14e={'tls':{'rejectUnauthorized':![]}};if(_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xd9')]){_0x4bf14e[_0xf54e('0xd9')]=_0x53d6f9[_0xf54e('0xd7')]['service'];}else{_0x4bf14e['host']=_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xda')];_0x4bf14e[_0xf54e('0xdb')]=_0x53d6f9[_0xf54e('0xd7')]['port'];_0x4bf14e['secure']=_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xdc')];}if(_0x53d6f9[_0xf54e('0xd7')]['authentication']){_0x4bf14e[_0xf54e('0xdd')]={'user':_0x53d6f9[_0xf54e('0xd7')][_0xf54e('0xde')],'pass':_0x53d6f9[_0xf54e('0xd7')]['pass']};}return respondWithRpcPromise(_0xf54e('0xdf'),'sendMail',{'account':_0x4bf14e,'message':{'from':util[_0xf54e('0xb1')](_0xf54e('0xe0'),_0x53d6f9[_0xf54e('0x3b')],_0x53d6f9[_0xf54e('0xe1')]||_0x53d6f9['Smtp'][_0xf54e('0xde')]),'to':_0x582cde[_0xf54e('0xd8')],'subject':_0x582cde[_0xf54e('0xe2')],'text':_0x3a7e79['body']}},client9003)[_0xf54e('0x22')](function(){return _0x3a7e79;})[_0xf54e('0x2d')](function(_0x40566e){console['error'](_0x40566e);});}})[_0xf54e('0x22')](function(){if(_0x3a7e79){return _0x3a7e79;}})[_0xf54e('0x22')](respondWithResult(_0x395bbc,null))[_0xf54e('0x2d')](handleError(_0x395bbc,null));};exports[_0xf54e('0xe3')]=function(_0x49f298,_0x602a27,_0x51f4b8){return db[_0xf54e('0xb8')][_0xf54e('0x5b')]({'where':{'id':_0x49f298[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x602a27,null))[_0xf54e('0x22')](function(_0x3bc515){if(_0x3bc515){return _0x3bc515[_0xf54e('0xe3')](_0x49f298[_0xf54e('0x62')][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x49f298[_0xf54e('0x62')],['ids','id'])||{});}})[_0xf54e('0x22')](respondWithResult(_0x602a27,null))[_0xf54e('0x2d')](handleError(_0x602a27,null));};exports[_0xf54e('0xe5')]=function(_0x116a50,_0xe71353,_0x374187){var _0x2569d7={'raw':![],'where':{}};var _0x3b391f={};var _0x429793={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x116a50[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xe71353,null))[_0xf54e('0x22')](function(_0x1c9536){if(_0x1c9536){_0x3b391f[_0xf54e('0x41')]=_['keys'](db[_0xf54e('0xb8')][_0xf54e('0x40')]);_0x3b391f[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x116a50['query']);_0x3b391f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x3b391f['model'],_0x3b391f[_0xf54e('0x43')]);_0x2569d7[_0xf54e('0x44')]=_[_0xf54e('0x5a')](_0x3b391f[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x45')]));_0x2569d7[_0xf54e('0x44')]=_0x2569d7[_0xf54e('0x44')][_0xf54e('0x46')]?_0x2569d7['attributes']:_0x3b391f[_0xf54e('0x41')];if(!_0x116a50[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x2569d7[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x116a50[_0xf54e('0x43')]['limit']);_0x2569d7[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x2569d7[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x116a50[_0xf54e('0x43')][_0xf54e('0x49')]);_0x2569d7[_0xf54e('0x4d')]=qs[_0xf54e('0x4a')](_['pick'](_0x116a50[_0xf54e('0x43')],_0x3b391f[_0xf54e('0x4a')]));_0x2569d7['where']['ChatWebsiteId']=_0x1c9536['id'];if(_0x116a50[_0xf54e('0x43')][_0xf54e('0x4c')]){_0x2569d7[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x2569d7[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x2569d7[_0xf54e('0x44')],function(_0x80aa32){var _0x2fc5ae={};_0x2fc5ae[_0x80aa32]={'$like':'%'+_0x116a50[_0xf54e('0x43')]['filter']+'%'};return _0x2fc5ae;})});}_0x2569d7=_[_0xf54e('0x4e')]({},_0x2569d7,_0x116a50[_0xf54e('0x53')]);return db['ChatInteraction']['count']({'where':_0x2569d7[_0xf54e('0x4d')]})[_0xf54e('0x22')](function(_0x5b640a){_0x429793[_0xf54e('0x31')]=_0x5b640a;if(_0x116a50[_0xf54e('0x43')][_0xf54e('0x54')]){_0x2569d7['include']=[{'model':db['CmContact'],'as':_0xf54e('0xe6'),'required':![]},{'model':db['User'],'as':_0xf54e('0xe7'),'attributes':[_0xf54e('0x3b'),_0xf54e('0xe8'),_0xf54e('0xe9')],'required':![]},{'model':db[_0xf54e('0xea')],'as':'Tags','attributes':['id','name',_0xf54e('0xeb')],'where':_0x116a50[_0xf54e('0x43')]['tag']?{'id':_0x116a50[_0xf54e('0x43')][_0xf54e('0xec')]}:undefined,'required':_0x116a50[_0xf54e('0x43')][_0xf54e('0xec')]?!![]:![]}];}return db[_0xf54e('0xb8')]['findAll'](_0x2569d7);})['then'](function(_0x31e342){_0x429793[_0xf54e('0x57')]=_0x31e342;return _0x429793;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0xe71353,_0x2569d7))[_0xf54e('0x2d')](handleError(_0xe71353,null));};function iftimePromise(_0x2d2593,_0x4bbfe4){return respondWithRpcPromise(_0xf54e('0xed'),_0xf54e('0xee'),{'command':_0x4bbfe4[_0xf54e('0xef')]?util['format']('iftime\x20%s,%s',_0x2d2593['interval'],_0x4bbfe4['timezone']):util['format']('iftime\x20%s',_0x2d2593[_0xf54e('0xf0')])},client9002)[_0xf54e('0x22')](function(_0x57aeaa){var _0x164252=_0x57aeaa&&_0x57aeaa[_0xf54e('0xf1')](_0xf54e('0xf2'))>=0x0?!![]:![];logger[_0xf54e('0x2b')](_0xf54e('0xf3'),_0x4bbfe4['id'],_0x2d2593['id'],_0x2d2593[_0xf54e('0xf0')],_0x164252?_0xf54e('0xf4'):'OFFLINE',_0x4bbfe4['timezone']?_0x4bbfe4['timezone']:_0xf54e('0xf5'));return _0x164252;})[_0xf54e('0x2d')](function(_0x49b62d){logger[_0xf54e('0x28')](_0xf54e('0xf3'),_0x4bbfe4['id'],_0x2d2593['id'],_0x2d2593[_0xf54e('0xf0')],util['inspect'](_0x49b62d,{'showHidden':![],'depth':null}),_0x4bbfe4[_0xf54e('0xef')]?_0x4bbfe4[_0xf54e('0xef')]:_0xf54e('0xf5'));return![];});}exports['getSnippet']=function(_0x2f602e,_0x542d28,_0x3b0de2){var _0x493b9d=0x0;var _0x1c7420=0x0;var _0x4fd3ec=![];var _0x1b27a7;var _0x55d080;return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x2f602e[_0xf54e('0x59')]['id']},'include':[{'model':db[_0xf54e('0xf6')],'as':_0xf54e('0xf6'),'include':[{'model':db[_0xf54e('0xf6')],'as':'Intervals','attributes':['id',_0xf54e('0xf0')],'raw':!![]}]}]})[_0xf54e('0x22')](handleEntityNotFound(_0x542d28,null))[_0xf54e('0x22')](function(_0x1a058a){if(_0x1a058a){_0x1b27a7=_0x1a058a;return _0x1a058a[_0xf54e('0xf7')]({'raw':!![]});}})[_0xf54e('0x22')](function(_0x4745c7){if(_0x1b27a7){if(_0x4745c7){_0x55d080=_0x4745c7;}}return require(_0xf54e('0x7b'))['getLicense']();})[_0xf54e('0x22')](function(_0xf56dd2){if(_0xf56dd2){_0x1c7420=_0xf56dd2[_0xf54e('0xf8')];_0x4fd3ec=_0xf56dd2[_0xf54e('0x7c')];}})[_0xf54e('0x22')](function(){return db[_0xf54e('0xb8')][_0xf54e('0x31')]({'where':{'closed':![]}});})[_0xf54e('0x22')](function(_0x2ea0bf){_0x493b9d=_0x2ea0bf;if(_0x1c7420&&_0x2ea0bf>_0x1c7420){return db[_0xf54e('0xf9')][_0xf54e('0x6f')]({'where':{'id':0x1}})[_0xf54e('0x22')](function(_0x126d06){if(_0x126d06){_0x126d06[_0xf54e('0xfa')](_0xf54e('0xfb'));}});}})[_0xf54e('0x22')](function(){if(_0x1b27a7[_0xf54e('0xf6')]&&_0x1b27a7['Interval'][_0xf54e('0xfc')]){var _0x28df44=[];for(var _0xc4b0a0=0x0;_0xc4b0a0<_0x1b27a7[_0xf54e('0xf6')][_0xf54e('0xfc')][_0xf54e('0x46')];_0xc4b0a0++){var _0x3c4862=_0x1b27a7[_0xf54e('0xf6')][_0xf54e('0xfc')][_0xc4b0a0][_0xf54e('0x38')]({'plain':!![]});_0x28df44['push'](iftimePromise(_0x3c4862,_0x1b27a7));}return BPromise[_0xf54e('0xfd')](_0x28df44)[_0xf54e('0x22')](function(_0x4b1c5e){return _[_0xf54e('0xfe')](_0x4b1c5e);});}else{return!![];}})[_0xf54e('0x22')](function(_0x154bd1){var _0x1129e2=fs[_0xf54e('0xff')](path[_0xf54e('0x80')](config[_0xf54e('0x79')],_0xf54e('0x100')),_0xf54e('0xd0'));var _0x5a982a={'remote':_0x1b27a7[_0xf54e('0x101')],'query':querystring[_0xf54e('0x27')](_['merge'](_0x1b27a7[_0xf54e('0x38')]({'plain':!![]}),{'customerIp':_0x2f602e[_0xf54e('0x8d')][_0xf54e('0x102')]||_0x2f602e[_0xf54e('0x8d')][_0xf54e('0x103')]||_0x2f602e['connection'][_0xf54e('0x104')]||_0x2f602e['ip'],'referer':_0x2f602e[_0xf54e('0x8d')][_0xf54e('0xaf')],'openedInteractions':_0x493b9d,'maxInteractions':_0x1c7420,'virtual':_0x4fd3ec['virtual'],'online':_0x154bd1,'custom':_0x4fd3ec}))[_0xf54e('0x105')](/'/g,'\x5c\x27')};_0x542d28['send'](ejs[_0xf54e('0xd1')](Mustache['render'](_0x1129e2,_0x5a982a),{'proactiveActions':_0x55d080,'alignment':_0x1b27a7[_0xf54e('0x106')],'verticalAlignment':_0x1b27a7[_0xf54e('0x107')]}));})[_0xf54e('0x2d')](handleError(_0x542d28,null));};exports['addApplications']=function(_0x52cc65,_0x57005b,_0x3676e8){return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x52cc65['params']['id']}})['then'](handleEntityNotFound(_0x57005b,null))[_0xf54e('0x22')](function(_0x5b313b){if(_0x5b313b){return db[_0xf54e('0x108')][_0xf54e('0x109')](function(_0x31700f){return db[_0xf54e('0xa4')][_0xf54e('0x39')]({'where':{'ChatWebsiteId':_0x52cc65[_0xf54e('0x59')]['id']},'transaction':_0x31700f})['then'](function(_0x1e4f68){var _0x50700b=_[_0xf54e('0x69')](_0x52cc65[_0xf54e('0x62')],function(_0x411160){_0x411160[_0xf54e('0x65')]=_0x52cc65[_0xf54e('0x59')]['id'];return _0x411160;});return db['ChatApplication'][_0xf54e('0x10a')](_0x50700b,{'transaction':_0x31700f});});})['then'](function(){return db[_0xf54e('0xa4')][_0xf54e('0x10b')]({'where':{'ChatWebsiteId':_0x52cc65[_0xf54e('0x59')]['id']},'order':_0xf54e('0xaa')});});}})['then'](respondWithResult(_0x57005b,null))[_0xf54e('0x2d')](handleError(_0x57005b,null));};exports[_0xf54e('0x10c')]=function(_0x931112,_0x2e7e95,_0xe98fad){var _0x319fc7={};var _0x1fb0e5={};var _0x49997c;var _0x309fe3;return db['ChatWebsite'][_0xf54e('0x6f')]({'where':{'id':_0x931112[_0xf54e('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e7e95,null))[_0xf54e('0x22')](function(_0xea94a){if(_0xea94a){_0x49997c=_0xea94a;_0x1fb0e5['model']=_[_0xf54e('0x42')](db[_0xf54e('0xa4')][_0xf54e('0x40')]);_0x1fb0e5[_0xf54e('0x43')]=_['keys'](_0x931112[_0xf54e('0x43')]);_0x1fb0e5[_0xf54e('0x4a')]=_['intersection'](_0x1fb0e5[_0xf54e('0x41')],_0x1fb0e5[_0xf54e('0x43')]);_0x319fc7[_0xf54e('0x44')]=_['intersection'](_0x1fb0e5[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x931112[_0xf54e('0x43')][_0xf54e('0x45')]));_0x319fc7[_0xf54e('0x44')]=_0x319fc7[_0xf54e('0x44')]['length']?_0x319fc7[_0xf54e('0x44')]:_0x1fb0e5['model'];_0x319fc7[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x931112['query'][_0xf54e('0x49')]);_0x319fc7['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x931112[_0xf54e('0x43')],_0x1fb0e5['filters']));if(_0x931112[_0xf54e('0x43')]['filter']){_0x319fc7[_0xf54e('0x4d')]=_['merge'](_0x319fc7[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x319fc7[_0xf54e('0x44')],function(_0x3e4e8f){var _0xd1b433={};_0xd1b433[_0x3e4e8f]={'$like':'%'+_0x931112[_0xf54e('0x43')][_0xf54e('0x4c')]+'%'};return _0xd1b433;})});}_0x319fc7=_['merge']({},_0x319fc7,_0x931112[_0xf54e('0x53')]);return _0x49997c[_0xf54e('0x10c')](_0x319fc7);}})[_0xf54e('0x22')](function(_0x10a315){if(_0x10a315){_0x309fe3=_0x10a315['length'];if(!_0x931112[_0xf54e('0x43')][_0xf54e('0x47')]('nolimit')){_0x319fc7[_0xf54e('0x33')]=qs['limit'](_0x931112[_0xf54e('0x43')][_0xf54e('0x33')]);_0x319fc7['offset']=qs[_0xf54e('0x32')](_0x931112['query'][_0xf54e('0x32')]);}return _0x49997c[_0xf54e('0x10c')](_0x319fc7);}})['then'](function(_0x197d79){if(_0x197d79){return _0x197d79?{'count':_0x309fe3,'rows':_0x197d79}:null;}})[_0xf54e('0x22')](respondWithResult(_0x2e7e95,null))[_0xf54e('0x2d')](handleError(_0x2e7e95,null));};exports[_0xf54e('0x10d')]=function(_0x4e91d9,_0x259d22,_0x4cb71f){return db['chatProactiveAction']['find']({'where':{'id':_0x4e91d9[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x259d22,null))[_0xf54e('0x22')](function(_0x208b9b){if(_0x208b9b){return _0x208b9b[_0xf54e('0x10d')](_0x4e91d9[_0xf54e('0x62')][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x4e91d9[_0xf54e('0x62')],['ids','id'])||{});}})[_0xf54e('0x22')](respondWithResult(_0x259d22,null))[_0xf54e('0x2d')](handleError(_0x259d22,null));};exports[_0xf54e('0xf7')]=function(_0x36f6ce,_0x35245b,_0x53016b){var _0x37c319={};var _0x50cfe6={};var _0x142f01;var _0x5d4db4;return db[_0xf54e('0x3f')]['findOne']({'where':{'id':_0x36f6ce[_0xf54e('0x59')]['id']}})['then'](handleEntityNotFound(_0x35245b,null))[_0xf54e('0x22')](function(_0x509c2c){if(_0x509c2c){_0x142f01=_0x509c2c;_0x50cfe6[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0x10e')]['rawAttributes']);_0x50cfe6[_0xf54e('0x43')]=_[_0xf54e('0x42')](_0x36f6ce['query']);_0x50cfe6[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x50cfe6[_0xf54e('0x41')],_0x50cfe6[_0xf54e('0x43')]);_0x37c319['attributes']=_[_0xf54e('0x5a')](_0x50cfe6[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x45')]));_0x37c319[_0xf54e('0x44')]=_0x37c319[_0xf54e('0x44')][_0xf54e('0x46')]?_0x37c319[_0xf54e('0x44')]:_0x50cfe6[_0xf54e('0x41')];_0x37c319[_0xf54e('0x68')]=qs['sort'](_0x36f6ce[_0xf54e('0x43')]['sort']);_0x37c319['where']=qs[_0xf54e('0x4a')](_['pick'](_0x36f6ce[_0xf54e('0x43')],_0x50cfe6['filters']));if(_0x36f6ce[_0xf54e('0x43')]['filter']){_0x37c319['where']=_[_0xf54e('0x4e')](_0x37c319[_0xf54e('0x4d')],{'$or':_[_0xf54e('0x69')](_0x37c319[_0xf54e('0x44')],function(_0x508162){var _0x2122ec={};_0x2122ec[_0x508162]={'$like':'%'+_0x36f6ce['query']['filter']+'%'};return _0x2122ec;})});}_0x37c319=_[_0xf54e('0x4e')]({},_0x37c319,_0x36f6ce[_0xf54e('0x53')]);return _0x142f01[_0xf54e('0xf7')](_0x37c319);}})['then'](function(_0x26dbfb){if(_0x26dbfb){_0x5d4db4=_0x26dbfb[_0xf54e('0x46')];if(!_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x37c319[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x36f6ce[_0xf54e('0x43')][_0xf54e('0x33')]);_0x37c319[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x36f6ce['query'][_0xf54e('0x32')]);}return _0x142f01[_0xf54e('0xf7')](_0x37c319);}})[_0xf54e('0x22')](function(_0x2ff74d){if(_0x2ff74d){return _0x2ff74d?{'count':_0x5d4db4,'rows':_0x2ff74d}:null;}})['then'](respondWithResult(_0x35245b,null))['catch'](handleError(_0x35245b,null));};exports[_0xf54e('0x10f')]=function(_0xb9c028,_0x2af905,_0x42cc39){var _0x3a3b50=_0xb9c028[_0xf54e('0x43')][_0xf54e('0x110')]===_0xf54e('0x111')?_0xf54e('0x112'):_0xf54e('0x113');return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'attributes':['id',_0x3a3b50],'where':{'id':_0xb9c028[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x2af905,null))[_0xf54e('0x22')](function(_0x15107a){if(_0x15107a){var _0x1a42c=_0x15107a[_0x3a3b50];var _0x2d7c34=_0x1a42c&&_0x1a42c[_0xf54e('0x114')]?_0x1a42c[_0xf54e('0x114')]:[];_0x2af905[_0xf54e('0x3c')]({'fromKey':_['isNil'](_0x1a42c[_0xf54e('0x115')])?undefined:_0x1a42c['fromKey'],'count':_0x2d7c34[_0xf54e('0x46')],'rows':_0x2d7c34});}})[_0xf54e('0x2d')](handleError(_0x2af905,null));};exports[_0xf54e('0x116')]=function(_0x4e466f,_0x145ef1,_0x5042a2){var _0x5df31c={'raw':!![],'where':{}};var _0x26c50f={};var _0x43bf0f={'count':0x0,'rows':[]};return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0x4e466f[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x145ef1,null))[_0xf54e('0x22')](function(_0x55bef6){if(_0x55bef6){_0x26c50f[_0xf54e('0x41')]=_[_0xf54e('0x42')](db[_0xf54e('0xd4')][_0xf54e('0x40')]);_0x26c50f[_0xf54e('0x43')]=_['keys'](_0x4e466f[_0xf54e('0x43')]);_0x26c50f[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x26c50f[_0xf54e('0x41')],_0x26c50f['query']);_0x5df31c['attributes']=_[_0xf54e('0x5a')](_0x26c50f[_0xf54e('0x41')],qs['fields'](_0x4e466f['query'][_0xf54e('0x45')]));_0x5df31c['attributes']=_0x5df31c[_0xf54e('0x44')][_0xf54e('0x46')]?_0x5df31c[_0xf54e('0x44')]:_0x26c50f[_0xf54e('0x41')];if(!_0x4e466f[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x5df31c[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x4e466f['query'][_0xf54e('0x33')]);_0x5df31c[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0x4e466f[_0xf54e('0x43')][_0xf54e('0x32')]);}_0x5df31c[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0x4e466f['query'][_0xf54e('0x49')]);_0x5df31c['where']=qs[_0xf54e('0x4a')](_[_0xf54e('0x4b')](_0x4e466f[_0xf54e('0x43')],_0x26c50f[_0xf54e('0x4a')]));_0x5df31c[_0xf54e('0x4d')][_0xf54e('0x65')]=_0x55bef6['id'];if(_0x4e466f['query'][_0xf54e('0x4c')]){_0x5df31c[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x5df31c[_0xf54e('0x4d')],{'$or':_['map'](_0x5df31c['attributes'],function(_0x34326c){var _0x148d39={};_0x148d39[_0x34326c]={'$like':'%'+_0x4e466f[_0xf54e('0x43')]['filter']+'%'};return _0x148d39;})});}_0x5df31c=_['merge']({},_0x5df31c,_0x4e466f[_0xf54e('0x53')]);return db[_0xf54e('0xd4')]['count']({'where':_0x5df31c['where']})[_0xf54e('0x22')](function(_0x48b3ef){_0x43bf0f['count']=_0x48b3ef;if(_0x4e466f[_0xf54e('0x43')][_0xf54e('0x54')]){_0x5df31c[_0xf54e('0x55')]=[{'all':!![]}];}return db[_0xf54e('0xd4')]['findAll'](_0x5df31c);})['then'](function(_0x50e7e0){_0x43bf0f['rows']=_0x50e7e0;return _0x43bf0f;});}})[_0xf54e('0x22')](respondWithFilteredResult(_0x145ef1,_0x5df31c))[_0xf54e('0x2d')](handleError(_0x145ef1,null));};exports[_0xf54e('0x117')]=function(_0x48f60d,_0x10c9dd,_0x159608){return db[_0xf54e('0x3f')][_0xf54e('0x5b')]({'where':{'id':_0x48f60d[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x10c9dd,null))['then'](function(_0x4a0820){if(_0x4a0820){return _0x4a0820['addAgents'](_0x48f60d['body'][_0xf54e('0x6b')],_[_0xf54e('0xe4')](_0x48f60d[_0xf54e('0x62')],['ids','id'])||{})['spread'](function(_0x3b0d33){for(var _0x509687=0x0;_0x509687<_0x48f60d[_0xf54e('0x62')][_0xf54e('0x6b')][_0xf54e('0x46')];_0x509687+=0x1){socket[_0xf54e('0x118')]('userChatWebsite:save',{'UserId':_0x48f60d['body'][_0xf54e('0x6b')][_0x509687],'ChatWebsiteId':_0x48f60d['params']['id']});}return _0x3b0d33;});}})['then'](respondWithResult(_0x10c9dd,null))['catch'](handleError(_0x10c9dd,null));};exports[_0xf54e('0x119')]=function(_0x38e4fd,_0xdf7bd5,_0x3e2c26){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x38e4fd[_0xf54e('0x59')]['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0xdf7bd5,null))[_0xf54e('0x22')](function(_0x3ee44d){if(_0x3ee44d){return _0x3ee44d[_0xf54e('0x119')](_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')])[_0xf54e('0x22')](function(){if(_['isArray'](_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')])){for(var _0x37d260=0x0;_0x37d260<_0x38e4fd['query']['ids'][_0xf54e('0x46')];_0x37d260+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x38e4fd['query'][_0xf54e('0x6b')][_0x37d260]),'ChatWebsiteId':Number(_0x38e4fd['params']['id'])});}}else{socket[_0xf54e('0x118')](_0xf54e('0x11a'),{'UserId':Number(_0x38e4fd[_0xf54e('0x43')][_0xf54e('0x6b')]),'ChatWebsiteId':Number(_0x38e4fd[_0xf54e('0x59')]['id'])});}});}})[_0xf54e('0x22')](respondWithStatusCode(_0xdf7bd5,null))[_0xf54e('0x2d')](handleError(_0xdf7bd5,null));};exports[_0xf54e('0x11b')]=function(_0xe68fc9,_0x2546d1,_0x9c42d8){var _0x13c7fd={};var _0x5bffd6={};var _0x4df612;var _0x4bbb17;return db[_0xf54e('0x3f')][_0xf54e('0x6f')]({'where':{'id':_0xe68fc9['params']['id']}})[_0xf54e('0x22')](handleEntityNotFound(_0x2546d1,null))[_0xf54e('0x22')](function(_0x39c630){if(_0x39c630){_0x4df612=_0x39c630;_0x5bffd6['model']=_[_0xf54e('0x42')](db[_0xf54e('0xc3')][_0xf54e('0x40')]);_0x5bffd6[_0xf54e('0x43')]=_['keys'](_0xe68fc9[_0xf54e('0x43')]);_0x5bffd6[_0xf54e('0x4a')]=_[_0xf54e('0x5a')](_0x5bffd6['model'],_0x5bffd6[_0xf54e('0x43')]);_0x13c7fd[_0xf54e('0x44')]=_['intersection'](_0x5bffd6[_0xf54e('0x41')],qs[_0xf54e('0x45')](_0xe68fc9['query'][_0xf54e('0x45')]));_0x13c7fd['attributes']=_0x13c7fd[_0xf54e('0x44')][_0xf54e('0x46')]?_0x13c7fd['attributes']:_0x5bffd6[_0xf54e('0x41')];_0x13c7fd[_0xf54e('0x68')]=qs[_0xf54e('0x49')](_0xe68fc9[_0xf54e('0x43')][_0xf54e('0x49')]);_0x13c7fd[_0xf54e('0x4d')]=qs['filters'](_[_0xf54e('0x4b')](_0xe68fc9['query'],_0x5bffd6[_0xf54e('0x4a')]));if(_0xe68fc9[_0xf54e('0x43')]['filter']){_0x13c7fd[_0xf54e('0x4d')]=_[_0xf54e('0x4e')](_0x13c7fd[_0xf54e('0x4d')],{'$or':_['map'](_0x13c7fd[_0xf54e('0x44')],function(_0x116698){var _0x3fbd4d={};_0x3fbd4d[_0x116698]={'$like':'%'+_0xe68fc9['query']['filter']+'%'};return _0x3fbd4d;})});}_0x13c7fd=_[_0xf54e('0x4e')]({},_0x13c7fd,_0xe68fc9[_0xf54e('0x53')]);return _0x4df612[_0xf54e('0x11b')](_0x13c7fd);}})['then'](function(_0x427ce7){if(_0x427ce7){_0x4bbb17=_0x427ce7[_0xf54e('0x46')];if(!_0xe68fc9[_0xf54e('0x43')][_0xf54e('0x47')](_0xf54e('0x48'))){_0x13c7fd[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0xe68fc9[_0xf54e('0x43')]['limit']);_0x13c7fd[_0xf54e('0x32')]=qs[_0xf54e('0x32')](_0xe68fc9[_0xf54e('0x43')]['offset']);}return _0x4df612['getAgents'](_0x13c7fd);}})['then'](function(_0x46460b){if(_0x46460b){return _0x46460b?{'count':_0x4bbb17,'rows':_0x46460b}:null;}})[_0xf54e('0x22')](respondWithResult(_0x2546d1,null))['catch'](handleError(_0x2546d1,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 01b2e1d..657e309 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 _0x7f3f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x526437,_0x22b116){var _0x7bc2f7=function(_0x4c56cc){while(--_0x4c56cc){_0x526437['push'](_0x526437['shift']());}};_0x7bc2f7(++_0x22b116);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0x7f3f[_0x388914];return _0x1f9111;};'use strict';var EventEmitter=require(_0xf7f3('0x0'));var ChatWebsite=require(_0xf7f3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf7f3('0x2')](0x0);var events={'afterCreate':_0xf7f3('0x3'),'afterUpdate':_0xf7f3('0x4'),'afterDestroy':_0xf7f3('0x5')};function emitEvent(_0x227ad2){return function(_0x4b4dbb,_0x19374c,_0xd8190d){ChatWebsiteEvents['emit'](_0x227ad2+':'+_0x4b4dbb['id'],_0x4b4dbb);ChatWebsiteEvents[_0xf7f3('0x6')](_0x227ad2,_0x4b4dbb);_0xd8190d(null);};}for(var e in events){if(events[_0xf7f3('0x7')](e)){var event=events[e];ChatWebsite[_0xf7f3('0x8')](e,emitEvent(event));}}module[_0xf7f3('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x47a1=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x5b97ed,_0x40dc6a){var _0x181d96=function(_0x2838db){while(--_0x2838db){_0x5b97ed['push'](_0x5b97ed['shift']());}};_0x181d96(++_0x40dc6a);}(_0x47a1,0xbd));var _0x147a=function(_0x296ab7,_0x29aef5){_0x296ab7=_0x296ab7-0x0;var _0x34e885=_0x47a1[_0x296ab7];return _0x34e885;};'use strict';var EventEmitter=require(_0x147a('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x147a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x147a('0x2'),'afterDestroy':_0x147a('0x3')};function emitEvent(_0x5e69bc){return function(_0xd80e93,_0x66a8e2,_0xc2071d){ChatWebsiteEvents[_0x147a('0x4')](_0x5e69bc+':'+_0xd80e93['id'],_0xd80e93);ChatWebsiteEvents[_0x147a('0x4')](_0x5e69bc,_0xd80e93);_0xc2071d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x147a('0x5')](e,emitEvent(event));}}module[_0x147a('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0d5212a..7cb2a47 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 _0xee68=['api','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xee68,0x1aa));var _0x8ee6=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xee68[_0x2dd390];return _0x3afe47;};'use strict';var _=require(_0x8ee6('0x0'));var util=require(_0x8ee6('0x1'));var logger=require(_0x8ee6('0x2'))(_0x8ee6('0x3'));var moment=require('moment');var BPromise=require(_0x8ee6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ee6('0x5'));var rimraf=require(_0x8ee6('0x6'));var config=require(_0x8ee6('0x7'));var attributes=require(_0x8ee6('0x8'));module[_0x8ee6('0x9')]=function(_0x56afef,_0x43b4c4){return _0x56afef[_0x8ee6('0xa')](_0x8ee6('0xb'),attributes,{'tableName':_0x8ee6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd98a=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x3ab0f1,_0x31acba){var _0x2c2fb8=function(_0x5da5c4){while(--_0x5da5c4){_0x3ab0f1['push'](_0x3ab0f1['shift']());}};_0x2c2fb8(++_0x31acba);}(_0xd98a,0xf6));var _0xad98=function(_0x2744f3,_0x299588){_0x2744f3=_0x2744f3-0x0;var _0x364784=_0xd98a[_0x2744f3];return _0x364784;};'use strict';var _=require(_0xad98('0x0'));var util=require(_0xad98('0x1'));var logger=require(_0xad98('0x2'))(_0xad98('0x3'));var moment=require(_0xad98('0x4'));var BPromise=require(_0xad98('0x5'));var rp=require(_0xad98('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad98('0x7'));var attributes=require(_0xad98('0x8'));module[_0xad98('0x9')]=function(_0x34a634,_0x51d5f2){return _0x34a634[_0xad98('0xa')](_0xad98('0xb'),attributes,{'tableName':_0xad98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 3b494e1..d8ba3bd 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 _0x8b71=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b71,0x1c0));var _0x18b7=function(_0x175d9a,_0x2a830a){_0x175d9a=_0x175d9a-0x0;var _0x48df16=_0x8b71[_0x175d9a];return _0x48df16;};'use strict';var _=require(_0x18b7('0x0'));var util=require(_0x18b7('0x1'));var moment=require(_0x18b7('0x2'));var BPromise=require(_0x18b7('0x3'));var rs=require(_0x18b7('0x4'));var fs=require('fs');var Redis=require(_0x18b7('0x5'));var db=require(_0x18b7('0x6'))['db'];var utils=require(_0x18b7('0x7'));var logger=require(_0x18b7('0x8'))(_0x18b7('0x9'));var config=require(_0x18b7('0xa'));var jayson=require(_0x18b7('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x18b7('0xc')],{'host':_0x18b7('0xd'),'port':0x18eb});var socket=require(_0x18b7('0xe'))(new Redis(config['redis']));require(_0x18b7('0xf'))[_0x18b7('0x10')](socket);function respondWithRpcPromise(_0xcabe15,_0x26084b,_0x309ad7){return new BPromise(function(_0x46cfbb,_0x1cdce4){return client[_0x18b7('0x11')](_0xcabe15,_0x309ad7)[_0x18b7('0x12')](function(_0x3fb8a0){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x18b7('0x13'));logger[_0x18b7('0x14')](_0x18b7('0x15'),_0x26084b,'request\x20sent',JSON[_0x18b7('0x16')](_0x3fb8a0));if(_0x3fb8a0[_0x18b7('0x17')]){if(_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x18')]===0x1f4){logger[_0x18b7('0x17')](_0x18b7('0x19'),_0x26084b,_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x1a')]);return _0x1cdce4(_0x3fb8a0['error']['message']);}logger[_0x18b7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x1a')]);return _0x46cfbb(_0x3fb8a0[_0x18b7('0x17')]['message']);}else{logger['info'](_0x18b7('0x19'),_0x26084b,_0x18b7('0x13'));_0x46cfbb(_0x3fb8a0[_0x18b7('0x1b')][_0x18b7('0x1a')]);}})['catch'](function(_0x5af87c){logger[_0x18b7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x5af87c);_0x1cdce4(_0x5af87c);});});} \ No newline at end of file +var _0x0cde=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x0cde,0x1d0));var _0xe0cd=function(_0xa3315e,_0x402cb7){_0xa3315e=_0xa3315e-0x0;var _0x39a3d0=_0x0cde[_0xa3315e];return _0x39a3d0;};'use strict';var _=require('lodash');var util=require(_0xe0cd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cd('0x1'));var fs=require('fs');var Redis=require(_0xe0cd('0x2'));var db=require(_0xe0cd('0x3'))['db'];var utils=require(_0xe0cd('0x4'));var logger=require(_0xe0cd('0x5'))(_0xe0cd('0x6'));var config=require(_0xe0cd('0x7'));var jayson=require(_0xe0cd('0x8'));var client=jayson[_0xe0cd('0x9')][_0xe0cd('0xa')]({'port':0x232a});config['redis']=_[_0xe0cd('0xb')](config[_0xe0cd('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0cd('0xc')]));require(_0xe0cd('0xd'))[_0xe0cd('0xe')](socket);function respondWithRpcPromise(_0x581ae2,_0xbcdca8,_0x1480a4){return new BPromise(function(_0x5e6410,_0xc471b){return client[_0xe0cd('0xf')](_0x581ae2,_0x1480a4)[_0xe0cd('0x10')](function(_0x3489fc){logger[_0xe0cd('0x11')](_0xe0cd('0x12'),_0xbcdca8,_0xe0cd('0x13'));logger['debug'](_0xe0cd('0x14'),_0xbcdca8,_0xe0cd('0x13'),JSON['stringify'](_0x3489fc));if(_0x3489fc[_0xe0cd('0x15')]){if(_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x16')]===0x1f4){logger[_0xe0cd('0x15')](_0xe0cd('0x12'),_0xbcdca8,_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x17')]);return _0xc471b(_0x3489fc[_0xe0cd('0x15')][_0xe0cd('0x17')]);}logger[_0xe0cd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xbcdca8,_0x3489fc[_0xe0cd('0x15')]['message']);return _0x5e6410(_0x3489fc['error'][_0xe0cd('0x17')]);}else{logger['info'](_0xe0cd('0x12'),_0xbcdca8,'request\x20sent');_0x5e6410(_0x3489fc[_0xe0cd('0x18')][_0xe0cd('0x17')]);}})[_0xe0cd('0x19')](function(_0x129966){logger[_0xe0cd('0x15')]('ChatWebsite,\x20%s,\x20%s',_0xbcdca8,_0x129966);_0xc471b(_0x129966);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2a1b73b..980d415 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 _0x9c8a=['removeListener','save','remove','update'];(function(_0x1d3d46,_0x138397){var _0x16cc99=function(_0x2d3baf){while(--_0x2d3baf){_0x1d3d46['push'](_0x1d3d46['shift']());}};_0x16cc99(++_0x138397);}(_0x9c8a,0x191));var _0xa9c8=function(_0x2da190,_0x52db4a){_0x2da190=_0x2da190-0x0;var _0x243a20=_0x9c8a[_0x2da190];return _0x243a20;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xa9c8('0x0'),_0xa9c8('0x1'),_0xa9c8('0x2')];function createListener(_0x15a6ad,_0x3f0207){return function(_0xe2a4ff){_0x3f0207['emit'](_0x15a6ad,_0xe2a4ff);};}function removeListener(_0x185723,_0x4fa96d){return function(){ChatWebsiteEvents[_0xa9c8('0x3')](_0x185723,_0x4fa96d);};}exports['register']=function(_0x506c05){for(var _0x3c3411=0x0,_0x301e63=events['length'];_0x3c3411<_0x301e63;_0x3c3411++){var _0x56c011=events[_0x3c3411];var _0x449124=createListener('chatWebsite:'+_0x56c011,_0x506c05);ChatWebsiteEvents['on'](_0x56c011,_0x449124);}}; \ No newline at end of file +var _0xd98a=['./chatWebsite.events','update','emit','register','length','chatWebsite:'];(function(_0x9fc657,_0x3acf5c){var _0x13d152=function(_0x3e55e5){while(--_0x3e55e5){_0x9fc657['push'](_0x9fc657['shift']());}};_0x13d152(++_0x3acf5c);}(_0xd98a,0xfc));var _0xad98=function(_0x5f4f35,_0x598632){_0x5f4f35=_0x5f4f35-0x0;var _0x4bf6f6=_0xd98a[_0x5f4f35];return _0x4bf6f6;};'use strict';var ChatWebsiteEvents=require(_0xad98('0x0'));var events=['save','remove',_0xad98('0x1')];function createListener(_0x10b24d,_0x189f8b){return function(_0x1cc198){_0x189f8b[_0xad98('0x2')](_0x10b24d,_0x1cc198);};}function removeListener(_0x1ab3f6,_0x5b14d4){return function(){ChatWebsiteEvents['removeListener'](_0x1ab3f6,_0x5b14d4);};}exports[_0xad98('0x3')]=function(_0x38f547){for(var _0x17e650=0x0,_0x2cd316=events[_0xad98('0x4')];_0x17e650<_0x2cd316;_0x17e650++){var _0x480c93=events[_0x17e650];var _0x20712b=createListener(_0xad98('0x5')+_0x480c93,_0x38f547);ChatWebsiteEvents['on'](_0x480c93,_0x20712b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ffb76e8..d97028d 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 _0x1ae3=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','diskStorage','join','root','%s-%s','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','addInteraction','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x1ae3,0x139));var _0x31ae=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0x1ae3[_0x3e6647];return _0x46bddd;};'use strict';var multer=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var path=require('path');var timeout=require(_0x31ae('0x2'));var express=require(_0x31ae('0x3'));var router=express[_0x31ae('0x4')]();var auth=require(_0x31ae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31ae('0x6'));var controller=require(_0x31ae('0x7'));router[_0x31ae('0x8')]('/',auth[_0x31ae('0x9')](),controller[_0x31ae('0xa')]);router[_0x31ae('0x8')](_0x31ae('0xb'),auth[_0x31ae('0x9')](),controller[_0x31ae('0xc')]);router[_0x31ae('0x8')](_0x31ae('0xd'),auth[_0x31ae('0x9')](),controller[_0x31ae('0xe')]);router[_0x31ae('0x8')](_0x31ae('0xf'),auth['isAuthenticated'](),controller[_0x31ae('0x10')]);router[_0x31ae('0x8')](_0x31ae('0x11'),auth['isAuthenticated'](),controller[_0x31ae('0x12')]);router[_0x31ae('0x8')]('/:id/logo',controller[_0x31ae('0x13')]);router['get'](_0x31ae('0x14'),controller[_0x31ae('0x15')]);router[_0x31ae('0x8')]('/:id/customer_avatar',controller[_0x31ae('0x16')]);router[_0x31ae('0x8')](_0x31ae('0x17'),controller[_0x31ae('0x18')]);router[_0x31ae('0x8')](_0x31ae('0x19'),auth['isAuthenticated'](),controller[_0x31ae('0x1a')]);router[_0x31ae('0x8')](_0x31ae('0x1b'),controller[_0x31ae('0x1c')]);router[_0x31ae('0x8')](_0x31ae('0x1d'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x1e')]);router['get'](_0x31ae('0x1f'),auth['isAuthenticated'](),controller[_0x31ae('0x20')]);router[_0x31ae('0x8')](_0x31ae('0x21'),controller[_0x31ae('0x22')]);router[_0x31ae('0x8')](_0x31ae('0x23'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x24')]);router[_0x31ae('0x8')](_0x31ae('0x25'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x26')]);router['post']('/',auth[_0x31ae('0x9')](),controller[_0x31ae('0x27')]);router[_0x31ae('0x28')](_0x31ae('0xf'),auth['isAuthenticated'](),controller[_0x31ae('0x29')]);router[_0x31ae('0x28')]('/:id/canned_answers',auth[_0x31ae('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x31ae('0x2a')]({'destination':function(_0x56f9c4,_0x59827a,_0x2219ce){_0x2219ce(null,path[_0x31ae('0x2b')](config[_0x31ae('0x2c')],'server/files/images/logos/'));},'filename':function(_0x4d18c0,_0x4c0246,_0x431890){_0x431890(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x4c0246[_0x31ae('0x2f')]));}})});router[_0x31ae('0x28')](_0x31ae('0x30'),upload[_0x31ae('0x31')](_0x31ae('0x32')),controller[_0x31ae('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x258e48,_0xdc9774,_0x1681ab){_0x1681ab(null,path[_0x31ae('0x2b')](config['root'],_0x31ae('0x34')));},'filename':function(_0x418d59,_0x28f439,_0x2c278b){_0x2c278b(null,util[_0x31ae('0x35')](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x28f439['originalname']));}})});router['post'](_0x31ae('0x14'),upload['single'](_0x31ae('0x32')),controller[_0x31ae('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2008a5,_0x207e57,_0x1b7ad7){_0x1b7ad7(null,path[_0x31ae('0x2b')](config['root'],_0x31ae('0x34')));},'filename':function(_0x130ee9,_0x4d22cf,_0x588e72){_0x588e72(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x4d22cf[_0x31ae('0x2f')]));}})});router[_0x31ae('0x28')](_0x31ae('0x37'),upload['single'](_0x31ae('0x32')),controller[_0x31ae('0x38')]);var upload=multer({'storage':multer[_0x31ae('0x2a')]({'destination':function(_0x3506e0,_0x3cf048,_0x3d6c3c){_0x3d6c3c(null,path[_0x31ae('0x2b')](config[_0x31ae('0x2c')],_0x31ae('0x34')));},'filename':function(_0x1aaa74,_0x27b311,_0x2e755c){_0x2e755c(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x27b311['originalname']));}})});router[_0x31ae('0x28')](_0x31ae('0x17'),upload[_0x31ae('0x31')](_0x31ae('0x32')),controller[_0x31ae('0x39')]);router['post'](_0x31ae('0x3a'),controller['notify']);router['post'](_0x31ae('0x3b'),controller['offline']);router[_0x31ae('0x28')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x31ae('0x3c')]);router[_0x31ae('0x28')](_0x31ae('0x1d'),auth[_0x31ae('0x9')](),controller['addApplications']);router[_0x31ae('0x28')](_0x31ae('0x1f'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x3d')]);router[_0x31ae('0x28')](_0x31ae('0x25'),auth['isAuthenticated'](),controller['addAgents']);router[_0x31ae('0x3e')](_0x31ae('0xd'),auth['isAuthenticated'](),controller[_0x31ae('0x3f')]);router[_0x31ae('0x40')](_0x31ae('0xd'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x41')]);router[_0x31ae('0x40')]('/:id/dispositions',auth[_0x31ae('0x9')](),controller[_0x31ae('0x42')]);router[_0x31ae('0x40')]('/:id/canned_answers',auth[_0x31ae('0x9')](),controller[_0x31ae('0x43')]);router['delete'](_0x31ae('0x25'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x44')]);module['exports']=router; \ No newline at end of file +var _0x24a6=['getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','getAgents','post','create','/:id/canned_answers','join','root','%s-%s','now','single','file','server/files/images/avatars/','originalname','diskStorage','format','addCustomerAvatar','addSystemAvatar','notify','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications'];(function(_0x3371e4,_0x18c88f){var _0x55fb77=function(_0x3ae241){while(--_0x3ae241){_0x3371e4['push'](_0x3371e4['shift']());}};_0x55fb77(++_0x18c88f);}(_0x24a6,0x14f));var _0x624a=function(_0x580f33,_0x523227){_0x580f33=_0x580f33-0x0;var _0x17c335=_0x24a6[_0x580f33];return _0x17c335;};'use strict';var multer=require(_0x624a('0x0'));var util=require('util');var path=require(_0x624a('0x1'));var timeout=require(_0x624a('0x2'));var express=require(_0x624a('0x3'));var router=express[_0x624a('0x4')]();var auth=require(_0x624a('0x5'));var interaction=require(_0x624a('0x6'));var config=require(_0x624a('0x7'));var controller=require(_0x624a('0x8'));router[_0x624a('0x9')]('/',auth[_0x624a('0xa')](),controller[_0x624a('0xb')]);router[_0x624a('0x9')](_0x624a('0xc'),auth[_0x624a('0xa')](),controller[_0x624a('0xd')]);router[_0x624a('0x9')](_0x624a('0xe'),auth[_0x624a('0xa')](),controller[_0x624a('0xf')]);router[_0x624a('0x9')](_0x624a('0x10'),auth[_0x624a('0xa')](),controller[_0x624a('0x11')]);router['get']('/:id/canned_answers',auth[_0x624a('0xa')](),controller[_0x624a('0x12')]);router[_0x624a('0x9')]('/:id/logo',controller[_0x624a('0x13')]);router[_0x624a('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x624a('0x14'),controller['getCustomerAvatar']);router[_0x624a('0x9')](_0x624a('0x15'),controller[_0x624a('0x16')]);router[_0x624a('0x9')]('/:id/interactions',auth[_0x624a('0xa')](),controller['getInteractions']);router[_0x624a('0x9')](_0x624a('0x17'),controller['getSnippet']);router[_0x624a('0x9')](_0x624a('0x18'),auth[_0x624a('0xa')](),controller[_0x624a('0x19')]);router[_0x624a('0x9')](_0x624a('0x1a'),auth[_0x624a('0xa')](),controller[_0x624a('0x1b')]);router[_0x624a('0x9')](_0x624a('0x1c'),controller['getFields']);router[_0x624a('0x9')]('/:id/offline_messages',auth[_0x624a('0xa')](),controller['getOfflineMessages']);router[_0x624a('0x9')](_0x624a('0x1d'),auth[_0x624a('0xa')](),controller[_0x624a('0x1e')]);router[_0x624a('0x1f')]('/',auth['isAuthenticated'](),controller[_0x624a('0x20')]);router[_0x624a('0x1f')](_0x624a('0x10'),auth[_0x624a('0xa')](),controller['addDisposition']);router[_0x624a('0x1f')](_0x624a('0x21'),auth[_0x624a('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56834b,_0x29257b,_0x4493bb){_0x4493bb(null,path[_0x624a('0x22')](config[_0x624a('0x23')],'server/files/images/logos/'));},'filename':function(_0x5ca99b,_0x2234dc,_0x15ba91){_0x15ba91(null,util['format'](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x2234dc['originalname']));}})});router['post']('/:id/logo',upload[_0x624a('0x26')](_0x624a('0x27')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59917f,_0x422c20,_0x35c8d0){_0x35c8d0(null,path[_0x624a('0x22')](config['root'],_0x624a('0x28')));},'filename':function(_0x1ba339,_0x56dfb2,_0x466af4){_0x466af4(null,util['format'](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x56dfb2[_0x624a('0x29')]));}})});router[_0x624a('0x1f')]('/:id/avatar',upload[_0x624a('0x26')](_0x624a('0x27')),controller['addAvatar']);var upload=multer({'storage':multer[_0x624a('0x2a')]({'destination':function(_0x11dcf4,_0x100545,_0x31a242){_0x31a242(null,path[_0x624a('0x22')](config[_0x624a('0x23')],'server/files/images/avatars/'));},'filename':function(_0x55d8f5,_0x45a3c2,_0x3315aa){_0x3315aa(null,util[_0x624a('0x2b')]('%s-%s',Date[_0x624a('0x25')](),_0x45a3c2['originalname']));}})});router['post']('/:id/customer_avatar',upload[_0x624a('0x26')]('file'),controller[_0x624a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21df69,_0x50f561,_0x4d9bee){_0x4d9bee(null,path[_0x624a('0x22')](config[_0x624a('0x23')],_0x624a('0x28')));},'filename':function(_0xa7b840,_0x23dd45,_0xe4ae90){_0xe4ae90(null,util[_0x624a('0x2b')](_0x624a('0x24'),Date[_0x624a('0x25')](),_0x23dd45[_0x624a('0x29')]));}})});router['post'](_0x624a('0x15'),upload[_0x624a('0x26')](_0x624a('0x27')),controller[_0x624a('0x2d')]);router[_0x624a('0x1f')]('/:id/notify',controller[_0x624a('0x2e')]);router[_0x624a('0x1f')](_0x624a('0x2f'),controller[_0x624a('0x30')]);router[_0x624a('0x1f')](_0x624a('0x31'),auth['isAuthenticated'](),controller[_0x624a('0x32')]);router[_0x624a('0x1f')](_0x624a('0x18'),auth['isAuthenticated'](),controller[_0x624a('0x33')]);router['post']('/:id/proactive_actions',auth[_0x624a('0xa')](),controller[_0x624a('0x34')]);router[_0x624a('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x624a('0x35')]);router[_0x624a('0x36')]('/:id',auth[_0x624a('0xa')](),controller[_0x624a('0x37')]);router['delete'](_0x624a('0xe'),auth[_0x624a('0xa')](),controller[_0x624a('0x38')]);router[_0x624a('0x39')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x624a('0x39')](_0x624a('0x21'),auth[_0x624a('0xa')](),controller[_0x624a('0x3a')]);router[_0x624a('0x39')](_0x624a('0x1d'),auth[_0x624a('0xa')](),controller['removeAgents']);module[_0x624a('0x3b')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index fc9e59c..2bab548 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 _0x02db=['sequelize','exports','STRING','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x02db,0x144));var _0xb02d=function(_0x411f14,_0x332d5a){_0x411f14=_0x411f14-0x0;var _0x3ba5fd=_0x02db[_0x411f14];return _0x3ba5fd;};'use strict';var Sequelize=require(_0xb02d('0x0'));module[_0xb02d('0x1')]={'name':{'type':Sequelize[_0xb02d('0x2')],'unique':_0xb02d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb02d('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xb02d('0x2')]},'phone':{'type':Sequelize[_0xb02d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xb02d('0x2')]},'postalCode':{'type':Sequelize[_0xb02d('0x2')]},'city':{'type':Sequelize[_0xb02d('0x2')]},'country':{'type':Sequelize[_0xb02d('0x2')]},'email':{'type':Sequelize[_0xb02d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb02d('0x2')]},'sStreet':{'type':Sequelize[_0xb02d('0x2')]},'sPostalCode':{'type':Sequelize[_0xb02d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xb02d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfffc=['exports','STRING','name'];(function(_0xc490b4,_0x4f67c1){var _0x4be707=function(_0x39f517){while(--_0x39f517){_0xc490b4['push'](_0xc490b4['shift']());}};_0x4be707(++_0x4f67c1);}(_0xfffc,0xfc));var _0xcfff=function(_0x6cbc20,_0x4ad188){_0x6cbc20=_0x6cbc20-0x0;var _0x1b09e5=_0xfffc[_0x6cbc20];return _0x1b09e5;};'use strict';var Sequelize=require('sequelize');module[_0xcfff('0x0')]={'name':{'type':Sequelize[_0xcfff('0x1')],'unique':_0xcfff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcfff('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xcfff('0x1')]},'fax':{'type':Sequelize[_0xcfff('0x1')]},'type':{'type':Sequelize[_0xcfff('0x1')]},'street':{'type':Sequelize[_0xcfff('0x1')]},'postalCode':{'type':Sequelize[_0xcfff('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcfff('0x1')]},'sCity':{'type':Sequelize[_0xcfff('0x1')]},'sCountry':{'type':Sequelize[_0xcfff('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 250b281..ac7ae56 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 _0x0b2a=['addContacts','CmContact','ids','findOne','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','save','then','UserProfileResource','destroy','error','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','CmCompany','findAll','rows','catch','params','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x803f24,_0x516eb9){var _0x3f9cd6=function(_0x2fef3e){while(--_0x2fef3e){_0x803f24['push'](_0x803f24['shift']());}};_0x3f9cd6(++_0x516eb9);}(_0x0b2a,0x1e5));var _0xa0b2=function(_0x22bba6,_0x512900){_0x22bba6=_0x22bba6-0x0;var _0x33b11b=_0x0b2a[_0x22bba6];return _0x33b11b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa0b2('0x0'));var zipdir=require(_0xa0b2('0x1'));var jsonpatch=require(_0xa0b2('0x2'));var rp=require(_0xa0b2('0x3'));var moment=require(_0xa0b2('0x4'));var BPromise=require(_0xa0b2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0b2('0x6'));var sox=require(_0xa0b2('0x7'));var csv=require(_0xa0b2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa0b2('0x9'));var crypto=require(_0xa0b2('0xa'));var jsforce=require(_0xa0b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa0b2('0x8'));var querystring=require(_0xa0b2('0xc'));var Papa=require(_0xa0b2('0xd'));var Redis=require(_0xa0b2('0xe'));var authService=require(_0xa0b2('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0b2('0x10'))(_0xa0b2('0x11'));var utils=require(_0xa0b2('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb7f530,_0x48d365){_0x48d365=_0x48d365||0xcc;return function(_0x5a8963){if(_0x5a8963){return _0xb7f530[_0xa0b2('0x13')](_0x48d365);}return _0xb7f530[_0xa0b2('0x14')](_0x48d365)[_0xa0b2('0x15')]();};}function respondWithResult(_0x570896,_0x34d9d7){_0x34d9d7=_0x34d9d7||0xc8;return function(_0x1ca0b1){if(_0x1ca0b1){return _0x570896[_0xa0b2('0x14')](_0x34d9d7)['json'](_0x1ca0b1);}};}function respondWithFilteredResult(_0x2aa3cc,_0x4f479b){return function(_0x39cbe4){if(_0x39cbe4){var _0x42ba63=_0x39cbe4[_0xa0b2('0x16')],_0x46a4d2=_0x4f479b[_0xa0b2('0x17')],_0x316fa5=_0x4f479b['offset']+_0x4f479b[_0xa0b2('0x18')],_0xb2ea02;if(_0x316fa5>=_0x42ba63){_0x316fa5=_0x42ba63;_0xb2ea02=0xc8;}else{_0xb2ea02=0xce;}_0x2aa3cc['status'](_0xb2ea02);return _0x2aa3cc[_0xa0b2('0x19')](_0xa0b2('0x1a'),_0x46a4d2+'-'+_0x316fa5+'/'+_0x42ba63)['json'](_0x39cbe4);}return null;};}function patchUpdates(_0x3ce428){return function(_0x3802fe){try{jsonpatch['apply'](_0x3802fe,_0x3ce428,!![]);}catch(_0x5db379){return BPromise['reject'](_0x5db379);}return _0x3802fe[_0xa0b2('0x1b')]();};}function saveUpdates(_0xef8cbb,_0x58d46e){return function(_0x241f39){if(_0x241f39){return _0x241f39['update'](_0xef8cbb)[_0xa0b2('0x1c')](function(_0x3fc8e3){return _0x3fc8e3;});}return null;};}function removeEntity(_0x398b2f,_0x6ff793){return function(_0x336083){if(_0x336083){return _0x336083['destroy']()[_0xa0b2('0x1c')](function(){var _0x167d49=_0x336083['get']({'plain':!![]});var _0x15e4b5='Companies';return db[_0xa0b2('0x1d')][_0xa0b2('0x1e')]({'where':{'type':_0x15e4b5,'resourceId':_0x167d49['id']}})['then'](function(){return _0x336083;});})[_0xa0b2('0x1c')](function(){_0x398b2f['status'](0xcc)[_0xa0b2('0x15')]();});}};}function handleEntityNotFound(_0x42a996,_0x5bda19){return function(_0x51fd9f){if(!_0x51fd9f){_0x42a996[_0xa0b2('0x13')](0x194);}return _0x51fd9f;};}function handleError(_0xde02b7,_0x271b62){_0x271b62=_0x271b62||0x1f4;return function(_0x4c8bc7){logger[_0xa0b2('0x1f')](_0x4c8bc7['stack']);if(_0x4c8bc7[_0xa0b2('0x20')]){delete _0x4c8bc7[_0xa0b2('0x20')];}_0xde02b7[_0xa0b2('0x14')](_0x271b62)[_0xa0b2('0x21')](_0x4c8bc7);};}exports[_0xa0b2('0x22')]=function(_0xd81dc6,_0x400ce2){var _0x1d13c3={},_0x5c0419={},_0x48b18b={'count':0x0,'rows':[]};var _0x3c711b=db['CmCompany'][_0xa0b2('0x23')];_0x5c0419[_0xa0b2('0x24')]=_[_0xa0b2('0x25')](_0x3c711b);_0x5c0419[_0xa0b2('0x26')]=_[_0xa0b2('0x25')](_0xd81dc6[_0xa0b2('0x26')]);_0x5c0419['filters']=_[_0xa0b2('0x27')](_0x5c0419[_0xa0b2('0x24')],_0x5c0419[_0xa0b2('0x26')]);_0x1d13c3['attributes']=_[_0xa0b2('0x27')](_0x5c0419[_0xa0b2('0x24')],qs[_0xa0b2('0x28')](_0xd81dc6['query']['fields']));_0x1d13c3['attributes']=_0x1d13c3[_0xa0b2('0x29')][_0xa0b2('0x2a')]?_0x1d13c3[_0xa0b2('0x29')]:_0x5c0419[_0xa0b2('0x24')];if(!_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x2b')](_0xa0b2('0x2c'))){_0x1d13c3[_0xa0b2('0x18')]=qs[_0xa0b2('0x18')](_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x18')]);_0x1d13c3['offset']=qs[_0xa0b2('0x17')](_0xd81dc6['query'][_0xa0b2('0x17')]);}_0x1d13c3[_0xa0b2('0x2d')]=qs[_0xa0b2('0x2e')](_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x2e')]);_0x1d13c3[_0xa0b2('0x2f')]=qs[_0xa0b2('0x30')](_[_0xa0b2('0x31')](_0xd81dc6[_0xa0b2('0x26')],_0x5c0419[_0xa0b2('0x30')]));if(_0xd81dc6[_0xa0b2('0x26')]['filter']){_0x1d13c3[_0xa0b2('0x2f')]=_[_0xa0b2('0x32')](_0x1d13c3[_0xa0b2('0x2f')],{'$or':_[_0xa0b2('0x33')](_0x3c711b,function(_0x5ba053){if(_0x5ba053[_0xa0b2('0x34')][_0xa0b2('0x35')]!==_0xa0b2('0x36')){var _0x47abb8={};_0x47abb8[_0x5ba053[_0xa0b2('0x37')]]={'$like':'%'+_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x38')]+'%'};return _0x47abb8;}})});}_0x1d13c3=_['merge']({},_0x1d13c3,_0xd81dc6[_0xa0b2('0x39')]);var _0x1f680e={'where':_0x1d13c3['where']};return db['CmCompany'][_0xa0b2('0x16')](_0x1f680e)[_0xa0b2('0x1c')](function(_0x2a5e4b){_0x48b18b['count']=_0x2a5e4b;if(_0xd81dc6[_0xa0b2('0x26')]['includeAll']){_0x1d13c3[_0xa0b2('0x3a')]=[{'all':!![]}];}return db[_0xa0b2('0x3b')][_0xa0b2('0x3c')](_0x1d13c3);})['then'](function(_0x3b3c8e){_0x48b18b[_0xa0b2('0x3d')]=_0x3b3c8e;return _0x48b18b;})[_0xa0b2('0x1c')](respondWithFilteredResult(_0x400ce2,_0x1d13c3))[_0xa0b2('0x3e')](handleError(_0x400ce2,null));};exports['show']=function(_0x94ae61,_0x297461){var _0x3c0bd4={'raw':![],'where':{'id':_0x94ae61[_0xa0b2('0x3f')]['id']}},_0x33d51b={};_0x33d51b[_0xa0b2('0x24')]=_['keys'](db[_0xa0b2('0x3b')][_0xa0b2('0x23')]);_0x33d51b['query']=_['keys'](_0x94ae61[_0xa0b2('0x26')]);_0x33d51b[_0xa0b2('0x30')]=_[_0xa0b2('0x27')](_0x33d51b[_0xa0b2('0x24')],_0x33d51b['query']);_0x3c0bd4['attributes']=_[_0xa0b2('0x27')](_0x33d51b[_0xa0b2('0x24')],qs[_0xa0b2('0x28')](_0x94ae61['query'][_0xa0b2('0x28')]));_0x3c0bd4[_0xa0b2('0x29')]=_0x3c0bd4[_0xa0b2('0x29')]['length']?_0x3c0bd4[_0xa0b2('0x29')]:_0x33d51b[_0xa0b2('0x24')];if(_0x94ae61[_0xa0b2('0x26')][_0xa0b2('0x40')]){_0x3c0bd4[_0xa0b2('0x3a')]=[{'all':!![]}];}_0x3c0bd4=_[_0xa0b2('0x32')]({},_0x3c0bd4,_0x94ae61[_0xa0b2('0x39')]);return db[_0xa0b2('0x3b')]['find'](_0x3c0bd4)[_0xa0b2('0x1c')](handleEntityNotFound(_0x297461,null))[_0xa0b2('0x1c')](respondWithResult(_0x297461,null))['catch'](handleError(_0x297461,null));};exports[_0xa0b2('0x41')]=function(_0x422b62,_0x4b3591){return db[_0xa0b2('0x3b')][_0xa0b2('0x41')](_0x422b62[_0xa0b2('0x42')],{})['then'](function(_0x28f873){var _0x3696f0=_0x422b62[_0xa0b2('0x43')][_0xa0b2('0x44')]({'plain':!![]});if(!_0x3696f0)throw new Error(_0xa0b2('0x45'));if(_0x3696f0[_0xa0b2('0x46')]===_0xa0b2('0x43')){var _0x5338a1=_0x28f873[_0xa0b2('0x44')]({'plain':!![]});var _0x2c2229=_0xa0b2('0x47');return db['UserProfileSection'][_0xa0b2('0x48')]({'where':{'name':_0x2c2229,'userProfileId':_0x3696f0[_0xa0b2('0x49')]},'raw':!![]})['then'](function(_0x8e04b){if(_0x8e04b&&_0x8e04b['autoAssociation']===0x0){return db[_0xa0b2('0x1d')][_0xa0b2('0x41')]({'name':_0x5338a1[_0xa0b2('0x20')],'resourceId':_0x5338a1['id'],'type':_0x8e04b[_0xa0b2('0x20')],'sectionId':_0x8e04b['id']},{})[_0xa0b2('0x1c')](function(){return _0x28f873;});}else{return _0x28f873;}})[_0xa0b2('0x3e')](function(_0x25e083){logger[_0xa0b2('0x1f')](_0xa0b2('0x4a'),_0x25e083);throw _0x25e083;});}return _0x28f873;})[_0xa0b2('0x1c')](respondWithResult(_0x4b3591,0xc9))[_0xa0b2('0x3e')](handleError(_0x4b3591,null));};exports['update']=function(_0xa3deb6,_0x280a07){if(_0xa3deb6['body']['id']){delete _0xa3deb6[_0xa0b2('0x42')]['id'];}return db['CmCompany']['find']({'where':{'id':_0xa3deb6[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x280a07,null))['then'](saveUpdates(_0xa3deb6[_0xa0b2('0x42')],null))[_0xa0b2('0x1c')](respondWithResult(_0x280a07,null))[_0xa0b2('0x3e')](handleError(_0x280a07,null));};exports[_0xa0b2('0x1e')]=function(_0x2e70a0,_0x599a8f){return db[_0xa0b2('0x3b')][_0xa0b2('0x48')]({'where':{'id':_0x2e70a0[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x599a8f,null))[_0xa0b2('0x1c')](removeEntity(_0x599a8f,null))['catch'](handleError(_0x599a8f,null));};exports[_0xa0b2('0x4b')]=function(_0xf0a954,_0x127b17,_0x4ad29d){return db[_0xa0b2('0x4c')]['find']({'where':{'id':_0xf0a954[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x127b17,null))[_0xa0b2('0x1c')](function(_0x11d510){if(_0x11d510){return _0x11d510[_0xa0b2('0x4b')](_0xf0a954['body'][_0xa0b2('0x4d')],_['omit'](_0xf0a954[_0xa0b2('0x42')],[_0xa0b2('0x4d'),'id'])||{});}})[_0xa0b2('0x1c')](respondWithResult(_0x127b17,null))[_0xa0b2('0x3e')](handleError(_0x127b17,null));};exports['getContacts']=function(_0x10155f,_0x5477ff,_0x1b690d){var _0x10dabe={};var _0x550748={};var _0x710af9;var _0x51b4ed;return db[_0xa0b2('0x3b')][_0xa0b2('0x4e')]({'where':{'id':_0x10155f[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x5477ff,null))['then'](function(_0x5e2eb2){if(_0x5e2eb2){_0x710af9=_0x5e2eb2;_0x550748[_0xa0b2('0x24')]=_[_0xa0b2('0x25')](db[_0xa0b2('0x4c')][_0xa0b2('0x23')]);_0x550748[_0xa0b2('0x26')]=_[_0xa0b2('0x25')](_0x10155f[_0xa0b2('0x26')]);_0x550748[_0xa0b2('0x30')]=_[_0xa0b2('0x27')](_0x550748[_0xa0b2('0x24')],_0x550748['query']);_0x10dabe[_0xa0b2('0x29')]=_[_0xa0b2('0x27')](_0x550748['model'],qs[_0xa0b2('0x28')](_0x10155f['query']['fields']));_0x10dabe[_0xa0b2('0x29')]=_0x10dabe[_0xa0b2('0x29')][_0xa0b2('0x2a')]?_0x10dabe[_0xa0b2('0x29')]:_0x550748['model'];_0x10dabe['order']=qs[_0xa0b2('0x2e')](_0x10155f['query']['sort']);_0x10dabe[_0xa0b2('0x2f')]=qs[_0xa0b2('0x30')](_[_0xa0b2('0x31')](_0x10155f[_0xa0b2('0x26')],_0x550748[_0xa0b2('0x30')]));if(_0x10155f['query'][_0xa0b2('0x38')]){_0x10dabe[_0xa0b2('0x2f')]=_[_0xa0b2('0x32')](_0x10dabe[_0xa0b2('0x2f')],{'$or':_[_0xa0b2('0x33')](_0x10dabe[_0xa0b2('0x29')],function(_0x4eeb07){var _0x456f17={};_0x456f17[_0x4eeb07]={'$like':'%'+_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x38')]+'%'};return _0x456f17;})});}_0x10dabe=_[_0xa0b2('0x32')]({},_0x10dabe,_0x10155f['options']);return _0x710af9[_0xa0b2('0x4f')](_0x10dabe);}})[_0xa0b2('0x1c')](function(_0x307769){if(_0x307769){_0x51b4ed=_0x307769['length'];if(!_0x10155f[_0xa0b2('0x26')]['hasOwnProperty']('nolimit')){_0x10dabe[_0xa0b2('0x18')]=qs[_0xa0b2('0x18')](_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x18')]);_0x10dabe[_0xa0b2('0x17')]=qs[_0xa0b2('0x17')](_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x17')]);}return _0x710af9[_0xa0b2('0x4f')](_0x10dabe);}})['then'](function(_0x5b1b2f){if(_0x5b1b2f){return _0x5b1b2f?{'count':_0x51b4ed,'rows':_0x5b1b2f}:null;}})['then'](respondWithResult(_0x5477ff,null))['catch'](handleError(_0x5477ff,null));}; \ No newline at end of file +var _0x3081=['error','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','filters','pick','merge','map','type','VIRTUAL','field','options','CmCompany','include','findAll','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','order','filter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','count','limit','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','end'];(function(_0x79dd58,_0x4ec3dc){var _0x32da7d=function(_0x92f90){while(--_0x92f90){_0x79dd58['push'](_0x79dd58['shift']());}};_0x32da7d(++_0x4ec3dc);}(_0x3081,0x1bf));var _0x1308=function(_0x22261c,_0x5ecf89){_0x22261c=_0x22261c-0x0;var _0x30e080=_0x3081[_0x22261c];return _0x30e080;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1308('0x0'));var rimraf=require(_0x1308('0x1'));var zipdir=require(_0x1308('0x2'));var jsonpatch=require(_0x1308('0x3'));var rp=require(_0x1308('0x4'));var moment=require(_0x1308('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1308('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1308('0x7'));var csv=require(_0x1308('0x8'));var ejs=require(_0x1308('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1308('0xa'));var crypto=require(_0x1308('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1308('0x8'));var querystring=require(_0x1308('0xc'));var Papa=require(_0x1308('0xd'));var Redis=require('ioredis');var authService=require(_0x1308('0xe'));var qs=require(_0x1308('0xf'));var hardwareService=require(_0x1308('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1308('0x11'));var config=require(_0x1308('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccdce1,_0x4d4842){_0x4d4842=_0x4d4842||0xcc;return function(_0x27d82c){if(_0x27d82c){return _0xccdce1[_0x1308('0x13')](_0x4d4842);}return _0xccdce1['status'](_0x4d4842)['end']();};}function respondWithResult(_0x4592bf,_0x2bb9c6){_0x2bb9c6=_0x2bb9c6||0xc8;return function(_0x4e5242){if(_0x4e5242){return _0x4592bf[_0x1308('0x14')](_0x2bb9c6)[_0x1308('0x15')](_0x4e5242);}};}function respondWithFilteredResult(_0x2fab1c,_0x4efe09){return function(_0x3e2fd2){if(_0x3e2fd2){var _0x3fedc7=_0x3e2fd2[_0x1308('0x16')],_0x54fb65=_0x4efe09['offset'],_0x1c664a=_0x4efe09['offset']+_0x4efe09[_0x1308('0x17')],_0x32a84b;if(_0x1c664a>=_0x3fedc7){_0x1c664a=_0x3fedc7;_0x32a84b=0xc8;}else{_0x32a84b=0xce;}_0x2fab1c['status'](_0x32a84b);return _0x2fab1c['set'](_0x1308('0x18'),_0x54fb65+'-'+_0x1c664a+'/'+_0x3fedc7)[_0x1308('0x15')](_0x3e2fd2);}return null;};}function patchUpdates(_0x303ceb){return function(_0x879cd6){try{jsonpatch[_0x1308('0x19')](_0x879cd6,_0x303ceb,!![]);}catch(_0x53b9e1){return BPromise[_0x1308('0x1a')](_0x53b9e1);}return _0x879cd6['save']();};}function saveUpdates(_0x9f1e72,_0x49ebf0){return function(_0x24baae){if(_0x24baae){return _0x24baae[_0x1308('0x1b')](_0x9f1e72)[_0x1308('0x1c')](function(_0x2acac4){return _0x2acac4;});}return null;};}function removeEntity(_0x4d545c,_0x1903c7){return function(_0x2c3082){if(_0x2c3082){return _0x2c3082['destroy']()['then'](function(){var _0x3cf228=_0x2c3082[_0x1308('0x1d')]({'plain':!![]});var _0xd88e4c='Companies';return db[_0x1308('0x1e')][_0x1308('0x1f')]({'where':{'type':_0xd88e4c,'resourceId':_0x3cf228['id']}})[_0x1308('0x1c')](function(){return _0x2c3082;});})['then'](function(){_0x4d545c[_0x1308('0x14')](0xcc)[_0x1308('0x20')]();});}};}function handleEntityNotFound(_0x3a00ec,_0x1b7e25){return function(_0xc58218){if(!_0xc58218){_0x3a00ec[_0x1308('0x13')](0x194);}return _0xc58218;};}function handleError(_0x58b8db,_0x54a978){_0x54a978=_0x54a978||0x1f4;return function(_0x4b30bb){logger[_0x1308('0x21')](_0x4b30bb[_0x1308('0x22')]);if(_0x4b30bb[_0x1308('0x23')]){delete _0x4b30bb[_0x1308('0x23')];}_0x58b8db[_0x1308('0x14')](_0x54a978)[_0x1308('0x24')](_0x4b30bb);};}exports['index']=function(_0x3f32f7,_0x51db74){var _0x4ab56b={},_0x12272f={},_0x37d5ca={'count':0x0,'rows':[]};var _0x1f757f=db['CmCompany'][_0x1308('0x25')];_0x12272f[_0x1308('0x26')]=_[_0x1308('0x27')](_0x1f757f);_0x12272f[_0x1308('0x28')]=_[_0x1308('0x27')](_0x3f32f7['query']);_0x12272f['filters']=_[_0x1308('0x29')](_0x12272f[_0x1308('0x26')],_0x12272f[_0x1308('0x28')]);_0x4ab56b['attributes']=_[_0x1308('0x29')](_0x12272f['model'],qs[_0x1308('0x2a')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x2a')]));_0x4ab56b[_0x1308('0x2b')]=_0x4ab56b['attributes'][_0x1308('0x2c')]?_0x4ab56b['attributes']:_0x12272f['model'];if(!_0x3f32f7[_0x1308('0x28')][_0x1308('0x2d')]('nolimit')){_0x4ab56b['limit']=qs[_0x1308('0x17')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x17')]);_0x4ab56b[_0x1308('0x2e')]=qs[_0x1308('0x2e')](_0x3f32f7['query'][_0x1308('0x2e')]);}_0x4ab56b['order']=qs[_0x1308('0x2f')](_0x3f32f7[_0x1308('0x28')][_0x1308('0x2f')]);_0x4ab56b[_0x1308('0x30')]=qs[_0x1308('0x31')](_[_0x1308('0x32')](_0x3f32f7[_0x1308('0x28')],_0x12272f[_0x1308('0x31')]));if(_0x3f32f7[_0x1308('0x28')]['filter']){_0x4ab56b[_0x1308('0x30')]=_[_0x1308('0x33')](_0x4ab56b[_0x1308('0x30')],{'$or':_[_0x1308('0x34')](_0x1f757f,function(_0x265726){if(_0x265726[_0x1308('0x35')]['key']!==_0x1308('0x36')){var _0x3c84a4={};_0x3c84a4[_0x265726[_0x1308('0x37')]]={'$like':'%'+_0x3f32f7[_0x1308('0x28')]['filter']+'%'};return _0x3c84a4;}})});}_0x4ab56b=_[_0x1308('0x33')]({},_0x4ab56b,_0x3f32f7[_0x1308('0x38')]);var _0x4e4a5f={'where':_0x4ab56b[_0x1308('0x30')]};return db[_0x1308('0x39')]['count'](_0x4e4a5f)[_0x1308('0x1c')](function(_0x8c2cdb){_0x37d5ca[_0x1308('0x16')]=_0x8c2cdb;if(_0x3f32f7[_0x1308('0x28')]['includeAll']){_0x4ab56b[_0x1308('0x3a')]=[{'all':!![]}];}return db[_0x1308('0x39')][_0x1308('0x3b')](_0x4ab56b);})['then'](function(_0x5353bc){_0x37d5ca['rows']=_0x5353bc;return _0x37d5ca;})[_0x1308('0x1c')](respondWithFilteredResult(_0x51db74,_0x4ab56b))[_0x1308('0x3c')](handleError(_0x51db74,null));};exports[_0x1308('0x3d')]=function(_0x144cbe,_0x2d58e0){var _0x5c1a35={'raw':![],'where':{'id':_0x144cbe[_0x1308('0x3e')]['id']}},_0x149618={};_0x149618[_0x1308('0x26')]=_['keys'](db[_0x1308('0x39')][_0x1308('0x25')]);_0x149618[_0x1308('0x28')]=_[_0x1308('0x27')](_0x144cbe[_0x1308('0x28')]);_0x149618[_0x1308('0x31')]=_['intersection'](_0x149618['model'],_0x149618[_0x1308('0x28')]);_0x5c1a35[_0x1308('0x2b')]=_[_0x1308('0x29')](_0x149618[_0x1308('0x26')],qs[_0x1308('0x2a')](_0x144cbe[_0x1308('0x28')][_0x1308('0x2a')]));_0x5c1a35[_0x1308('0x2b')]=_0x5c1a35['attributes'][_0x1308('0x2c')]?_0x5c1a35[_0x1308('0x2b')]:_0x149618[_0x1308('0x26')];if(_0x144cbe[_0x1308('0x28')][_0x1308('0x3f')]){_0x5c1a35[_0x1308('0x3a')]=[{'all':!![]}];}_0x5c1a35=_[_0x1308('0x33')]({},_0x5c1a35,_0x144cbe['options']);return db['CmCompany']['find'](_0x5c1a35)[_0x1308('0x1c')](handleEntityNotFound(_0x2d58e0,null))['then'](respondWithResult(_0x2d58e0,null))[_0x1308('0x3c')](handleError(_0x2d58e0,null));};exports['create']=function(_0x55cc99,_0x49bc82){return db[_0x1308('0x39')][_0x1308('0x40')](_0x55cc99[_0x1308('0x41')],{})['then'](function(_0x33c812){var _0x24c915=_0x55cc99[_0x1308('0x42')]['get']({'plain':!![]});if(!_0x24c915)throw new Error(_0x1308('0x43'));if(_0x24c915['role']===_0x1308('0x42')){var _0x2224b0=_0x33c812[_0x1308('0x1d')]({'plain':!![]});var _0x3eb63d='Companies';return db['UserProfileSection'][_0x1308('0x44')]({'where':{'name':_0x3eb63d,'userProfileId':_0x24c915[_0x1308('0x45')]},'raw':!![]})[_0x1308('0x1c')](function(_0x4dd6b4){if(_0x4dd6b4&&_0x4dd6b4[_0x1308('0x46')]===0x0){return db[_0x1308('0x1e')][_0x1308('0x40')]({'name':_0x2224b0[_0x1308('0x23')],'resourceId':_0x2224b0['id'],'type':_0x4dd6b4[_0x1308('0x23')],'sectionId':_0x4dd6b4['id']},{})[_0x1308('0x1c')](function(){return _0x33c812;});}else{return _0x33c812;}})[_0x1308('0x3c')](function(_0x547af5){logger[_0x1308('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x547af5);throw _0x547af5;});}return _0x33c812;})[_0x1308('0x1c')](respondWithResult(_0x49bc82,0xc9))[_0x1308('0x3c')](handleError(_0x49bc82,null));};exports[_0x1308('0x1b')]=function(_0x26c391,_0x46967f){if(_0x26c391[_0x1308('0x41')]['id']){delete _0x26c391[_0x1308('0x41')]['id'];}return db[_0x1308('0x39')][_0x1308('0x44')]({'where':{'id':_0x26c391[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x46967f,null))['then'](saveUpdates(_0x26c391['body'],null))[_0x1308('0x1c')](respondWithResult(_0x46967f,null))[_0x1308('0x3c')](handleError(_0x46967f,null));};exports[_0x1308('0x1f')]=function(_0x50b952,_0x184bea){return db['CmCompany'][_0x1308('0x44')]({'where':{'id':_0x50b952[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x184bea,null))[_0x1308('0x1c')](removeEntity(_0x184bea,null))[_0x1308('0x3c')](handleError(_0x184bea,null));};exports[_0x1308('0x47')]=function(_0x50b06c,_0x5f2a45,_0x324cf5){return db[_0x1308('0x48')][_0x1308('0x44')]({'where':{'id':_0x50b06c[_0x1308('0x3e')]['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x5f2a45,null))['then'](function(_0x426a58){if(_0x426a58){return _0x426a58[_0x1308('0x47')](_0x50b06c[_0x1308('0x41')][_0x1308('0x49')],_[_0x1308('0x4a')](_0x50b06c[_0x1308('0x41')],[_0x1308('0x49'),'id'])||{});}})[_0x1308('0x1c')](respondWithResult(_0x5f2a45,null))[_0x1308('0x3c')](handleError(_0x5f2a45,null));};exports[_0x1308('0x4b')]=function(_0x3fac72,_0x308de5,_0x151ed5){var _0x494512={};var _0x54f2d0={};var _0x5727cb;var _0x58fe32;return db[_0x1308('0x39')][_0x1308('0x4c')]({'where':{'id':_0x3fac72['params']['id']}})[_0x1308('0x1c')](handleEntityNotFound(_0x308de5,null))[_0x1308('0x1c')](function(_0x12dc1d){if(_0x12dc1d){_0x5727cb=_0x12dc1d;_0x54f2d0[_0x1308('0x26')]=_[_0x1308('0x27')](db[_0x1308('0x48')][_0x1308('0x25')]);_0x54f2d0[_0x1308('0x28')]=_[_0x1308('0x27')](_0x3fac72[_0x1308('0x28')]);_0x54f2d0[_0x1308('0x31')]=_[_0x1308('0x29')](_0x54f2d0[_0x1308('0x26')],_0x54f2d0[_0x1308('0x28')]);_0x494512[_0x1308('0x2b')]=_['intersection'](_0x54f2d0[_0x1308('0x26')],qs[_0x1308('0x2a')](_0x3fac72['query'][_0x1308('0x2a')]));_0x494512[_0x1308('0x2b')]=_0x494512[_0x1308('0x2b')][_0x1308('0x2c')]?_0x494512[_0x1308('0x2b')]:_0x54f2d0[_0x1308('0x26')];_0x494512[_0x1308('0x4d')]=qs[_0x1308('0x2f')](_0x3fac72[_0x1308('0x28')]['sort']);_0x494512[_0x1308('0x30')]=qs['filters'](_[_0x1308('0x32')](_0x3fac72[_0x1308('0x28')],_0x54f2d0['filters']));if(_0x3fac72[_0x1308('0x28')][_0x1308('0x4e')]){_0x494512[_0x1308('0x30')]=_[_0x1308('0x33')](_0x494512['where'],{'$or':_[_0x1308('0x34')](_0x494512[_0x1308('0x2b')],function(_0x2e1391){var _0x864ed1={};_0x864ed1[_0x2e1391]={'$like':'%'+_0x3fac72[_0x1308('0x28')][_0x1308('0x4e')]+'%'};return _0x864ed1;})});}_0x494512=_[_0x1308('0x33')]({},_0x494512,_0x3fac72[_0x1308('0x38')]);return _0x5727cb[_0x1308('0x4b')](_0x494512);}})[_0x1308('0x1c')](function(_0x545b63){if(_0x545b63){_0x58fe32=_0x545b63[_0x1308('0x2c')];if(!_0x3fac72['query'][_0x1308('0x2d')](_0x1308('0x4f'))){_0x494512[_0x1308('0x17')]=qs[_0x1308('0x17')](_0x3fac72[_0x1308('0x28')][_0x1308('0x17')]);_0x494512[_0x1308('0x2e')]=qs[_0x1308('0x2e')](_0x3fac72[_0x1308('0x28')][_0x1308('0x2e')]);}return _0x5727cb[_0x1308('0x4b')](_0x494512);}})[_0x1308('0x1c')](function(_0x50a04c){if(_0x50a04c){return _0x50a04c?{'count':_0x58fe32,'rows':_0x50a04c}:null;}})[_0x1308('0x1c')](respondWithResult(_0x308de5,null))['catch'](handleError(_0x308de5,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d971ca0..b209b5c 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 _0xa30a=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','CmCompany','cm_companies','util','../../config/logger'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x7d25,0x8a));var _0x57d2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7d25[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index c20b684..74625f5 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 _0xe08a=['CmCompany,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x32b362,_0x1f606f){var _0x35a7d8=function(_0x3f7fb7){while(--_0x3f7fb7){_0x32b362['push'](_0x32b362['shift']());}};_0x35a7d8(++_0x1f606f);}(_0xe08a,0x1d4));var _0xae08=function(_0x58b1fd,_0x180215){_0x58b1fd=_0x58b1fd-0x0;var _0x37a385=_0xe08a[_0x58b1fd];return _0x37a385;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae08('0x0'));var BPromise=require(_0xae08('0x1'));var rs=require(_0xae08('0x2'));var fs=require('fs');var Redis=require(_0xae08('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xae08('0x4'));var logger=require('../../config/logger')(_0xae08('0x5'));var config=require(_0xae08('0x6'));var jayson=require(_0xae08('0x7'));var client=jayson[_0xae08('0x8')][_0xae08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d168,_0x564b95,_0x4f9fff){return new BPromise(function(_0x2d303b,_0xeb31f3){return client[_0xae08('0xa')](_0x23d168,_0x4f9fff)[_0xae08('0xb')](function(_0x5e603b){logger['info'](_0xae08('0xc'),_0x564b95,_0xae08('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x564b95,_0xae08('0xd'),JSON['stringify'](_0x5e603b));if(_0x5e603b['error']){if(_0x5e603b[_0xae08('0xe')][_0xae08('0xf')]===0x1f4){logger[_0xae08('0xe')]('CmCompany,\x20%s,\x20%s',_0x564b95,_0x5e603b[_0xae08('0xe')][_0xae08('0x10')]);return _0xeb31f3(_0x5e603b[_0xae08('0xe')]['message']);}logger[_0xae08('0xe')](_0xae08('0xc'),_0x564b95,_0x5e603b[_0xae08('0xe')]['message']);return _0x2d303b(_0x5e603b[_0xae08('0xe')][_0xae08('0x10')]);}else{logger[_0xae08('0x11')](_0xae08('0xc'),_0x564b95,_0xae08('0xd'));_0x2d303b(_0x5e603b[_0xae08('0x12')]['message']);}})[_0xae08('0x13')](function(_0x224b43){logger[_0xae08('0xe')]('CmCompany,\x20%s,\x20%s',_0x564b95,_0x224b43);_0xeb31f3(_0x224b43);});});} \ No newline at end of file +var _0xf335=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xef0ad,_0xec64f){var _0x1c7c66=function(_0x3d361f){while(--_0x3d361f){_0xef0ad['push'](_0xef0ad['shift']());}};_0x1c7c66(++_0xec64f);}(_0xf335,0x1c3));var _0x5f33=function(_0x6640ba,_0x1ebe7d){_0x6640ba=_0x6640ba-0x0;var _0x427db6=_0xf335[_0x6640ba];return _0x427db6;};'use strict';var _=require(_0x5f33('0x0'));var util=require(_0x5f33('0x1'));var moment=require('moment');var BPromise=require(_0x5f33('0x2'));var rs=require(_0x5f33('0x3'));var fs=require('fs');var Redis=require(_0x5f33('0x4'));var db=require(_0x5f33('0x5'))['db'];var utils=require(_0x5f33('0x6'));var logger=require(_0x5f33('0x7'))(_0x5f33('0x8'));var config=require(_0x5f33('0x9'));var jayson=require(_0x5f33('0xa'));var client=jayson[_0x5f33('0xb')][_0x5f33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f0af1,_0xde17ad,_0xc1f9a){return new BPromise(function(_0x16a158,_0x59cd22){return client[_0x5f33('0xd')](_0x2f0af1,_0xc1f9a)[_0x5f33('0xe')](function(_0x17a093){logger[_0x5f33('0xf')](_0x5f33('0x10'),_0xde17ad,_0x5f33('0x11'));logger[_0x5f33('0x12')](_0x5f33('0x13'),_0xde17ad,'request\x20sent',JSON[_0x5f33('0x14')](_0x17a093));if(_0x17a093[_0x5f33('0x15')]){if(_0x17a093[_0x5f33('0x15')]['code']===0x1f4){logger[_0x5f33('0x15')]('CmCompany,\x20%s,\x20%s',_0xde17ad,_0x17a093[_0x5f33('0x15')]['message']);return _0x59cd22(_0x17a093[_0x5f33('0x15')]['message']);}logger['error'](_0x5f33('0x10'),_0xde17ad,_0x17a093['error'][_0x5f33('0x16')]);return _0x16a158(_0x17a093[_0x5f33('0x15')][_0x5f33('0x16')]);}else{logger[_0x5f33('0xf')](_0x5f33('0x10'),_0xde17ad,_0x5f33('0x11'));_0x16a158(_0x17a093[_0x5f33('0x17')][_0x5f33('0x16')]);}})[_0x5f33('0x18')](function(_0x1cd9d2){logger[_0x5f33('0x15')](_0x5f33('0x10'),_0xde17ad,_0x1cd9d2);_0x59cd22(_0x1cd9d2);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4708414..36ec3fc 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 _0xcea0=['get','isAuthenticated','index','/:id/contacts','post','create','/:id','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x28a83b,_0x590948){var _0x55b99d=function(_0x2cf03d){while(--_0x2cf03d){_0x28a83b['push'](_0x28a83b['shift']());}};_0x55b99d(++_0x590948);}(_0xcea0,0x1ae));var _0x0cea=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xcea0[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require(_0x0cea('0x0'));var path=require('path');var timeout=require(_0x0cea('0x1'));var express=require('express');var router=express[_0x0cea('0x2')]();var auth=require(_0x0cea('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0cea('0x4'));var controller=require('./cmCompany.controller');router[_0x0cea('0x5')]('/',auth[_0x0cea('0x6')](),controller[_0x0cea('0x7')]);router['get']('/:id',auth[_0x0cea('0x6')](),controller['show']);router['get'](_0x0cea('0x8'),auth['isAuthenticated'](),controller['getContacts']);router[_0x0cea('0x9')]('/',auth['isAuthenticated'](),controller[_0x0cea('0xa')]);router[_0x0cea('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['put'](_0x0cea('0xb'),auth['isAuthenticated'](),controller[_0x0cea('0xc')]);router[_0x0cea('0xd')](_0x0cea('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cea('0xe')]=router; \ No newline at end of file +var _0xb753=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/:id','isAuthenticated','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer'];(function(_0x83420c,_0x50fd91){var _0x1057d7=function(_0x80befc){while(--_0x80befc){_0x83420c['push'](_0x83420c['shift']());}};_0x1057d7(++_0x50fd91);}(_0xb753,0x158));var _0x3b75=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xb753[_0x10004e];return _0x5af990;};'use strict';var multer=require(_0x3b75('0x0'));var util=require(_0x3b75('0x1'));var path=require(_0x3b75('0x2'));var timeout=require(_0x3b75('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3b75('0x4'));var interaction=require(_0x3b75('0x5'));var config=require(_0x3b75('0x6'));var controller=require(_0x3b75('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b75('0x8')]);router[_0x3b75('0x9')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0xc')]);router[_0x3b75('0x9')](_0x3b75('0xd'),auth[_0x3b75('0xb')](),controller[_0x3b75('0xe')]);router['post']('/',auth[_0x3b75('0xb')](),controller[_0x3b75('0xf')]);router[_0x3b75('0x10')](_0x3b75('0xd'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x11')]);router[_0x3b75('0x12')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x13')]);router[_0x3b75('0x14')](_0x3b75('0xa'),auth[_0x3b75('0xb')](),controller[_0x3b75('0x15')]);module[_0x3b75('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 78f48d4..197f8aa 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 _0x1e64=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1e64,0x198));var _0x41e6=function(_0x3475d5,_0x54ddb0){_0x3475d5=_0x3475d5-0x0;var _0x2f57b6=_0x1e64[_0x3475d5];return _0x2f57b6;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x41e6('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x41e6('0x1')]},'street':{'type':Sequelize[_0x41e6('0x1')]},'postalCode':{'type':Sequelize[_0x41e6('0x1')]},'city':{'type':Sequelize[_0x41e6('0x1')]},'country':{'type':Sequelize[_0x41e6('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x41e6('0x2')]},'phone':{'type':Sequelize[_0x41e6('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x41e6('0x1')]},'email':{'type':Sequelize[_0x41e6('0x1')]},'url':{'type':Sequelize[_0x41e6('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x41e6('0x1')]},'twitter':{'type':Sequelize[_0x41e6('0x1')]},'skype':{'type':Sequelize[_0x41e6('0x1')]},'teams':{'type':Sequelize[_0x41e6('0x1')]},'viber':{'type':Sequelize[_0x41e6('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x41e6('0x1')]},'telegram':{'type':Sequelize[_0x41e6('0x1')]},'UserId':{'type':Sequelize[_0x41e6('0x3')]},'priority':{'type':Sequelize[_0x41e6('0x3')](0x2)[_0x41e6('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x41e6('0x5')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x1477=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x226802,_0x14c0f1){var _0x5900b9=function(_0x5e1169){while(--_0x5e1169){_0x226802['push'](_0x226802['shift']());}};_0x5900b9(++_0x14c0f1);}(_0x1477,0x1b7));var _0x7147=function(_0x571a92,_0x252001){_0x571a92=_0x571a92-0x0;var _0x98b426=_0x1477[_0x571a92];return _0x98b426;};'use strict';var _=require(_0x7147('0x0'));var Sequelize=require('sequelize');module[_0x7147('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7147('0x2')]},'postalCode':{'type':Sequelize[_0x7147('0x2')]},'city':{'type':Sequelize[_0x7147('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7147('0x2')]},'description':{'type':Sequelize[_0x7147('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7147('0x2')]},'fax':{'type':Sequelize[_0x7147('0x2')]},'email':{'type':Sequelize[_0x7147('0x2')]},'url':{'type':Sequelize[_0x7147('0x2')]},'facebook':{'type':Sequelize[_0x7147('0x2')]},'fb_data':{'type':Sequelize[_0x7147('0x2')]},'twitter':{'type':Sequelize[_0x7147('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7147('0x2')]},'viber':{'type':Sequelize[_0x7147('0x2')]},'line':{'type':Sequelize[_0x7147('0x2')]},'wechat':{'type':Sequelize[_0x7147('0x2')]},'telegram':{'type':Sequelize[_0x7147('0x2')]},'UserId':{'type':Sequelize[_0x7147('0x4')]},'priority':{'type':Sequelize[_0x7147('0x4')](0x2)[_0x7147('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7147('0x6')],'defaultValue':Sequelize[_0x7147('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 67c2a2c..89d64d4 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 _0xe0da=['c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','cm_contact_has_tags','left_join','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','sequelize','toString','keyBy','count','merge','c.*','TagIds','Tags','split','rows','catch','find','params','startsWith','columnName','displayName','CmCustomField','findAll','cf_','alias','custom','type','body','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','each','duplicates','$or','ListId','spread','show','Tag','$and','push','omit','format','cf_%d','setFields','toParam','text','values','phone','getTags','options','findOne','setTags','ids','rawAttributes','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','join','root','server/files/tmp','file','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','meta','import','User','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','sendStatus','end','status','json','offset','Content-Range','apply','reject','then','destroy','error','stack','name','CmContact','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','parse','advancedFilter','forEach','value','length','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','\x20LIKE\x20?','\x20<\x20?','map','isNil','isEmpty','c.ListId\x20IN\x20?','concat','filter','replace','\x27\x27\x27\x27','isNumeric'];(function(_0x5a8d86,_0x11d77c){var _0x4b2797=function(_0x4de12a){while(--_0x4de12a){_0x5a8d86['push'](_0x5a8d86['shift']());}};_0x4b2797(++_0x11d77c);}(_0xe0da,0x85));var _0xae0d=function(_0xa0f6ee,_0x2b9c8f){_0xa0f6ee=_0xa0f6ee-0x0;var _0xe32491=_0xe0da[_0xa0f6ee];return _0xe32491;};'use strict';var pdf=require(_0xae0d('0x0'));var emlformat=require(_0xae0d('0x1'));var rimraf=require(_0xae0d('0x2'));var zipdir=require(_0xae0d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae0d('0x4'));var moment=require('moment');var BPromise=require(_0xae0d('0x5'));var Mustache=require('mustache');var util=require(_0xae0d('0x6'));var path=require(_0xae0d('0x7'));var sox=require(_0xae0d('0x8'));var csv=require(_0xae0d('0x9'));var ejs=require(_0xae0d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xae0d('0xb'));var crypto=require(_0xae0d('0xc'));var jsforce=require(_0xae0d('0xd'));var deskjs=require(_0xae0d('0xe'));var toCsv=require(_0xae0d('0x9'));var querystring=require(_0xae0d('0xf'));var Papa=require(_0xae0d('0x10'));var Redis=require(_0xae0d('0x11'));var authService=require(_0xae0d('0x12'));var qs=require(_0xae0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae0d('0x14'))(_0xae0d('0x15'));var utils=require(_0xae0d('0x16'));var config=require('../../config/environment');var db=require(_0xae0d('0x17'))['db'];config[_0xae0d('0x18')]=_[_0xae0d('0x19')](config[_0xae0d('0x18')],{'host':_0xae0d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xae0d('0x1b'))[_0xae0d('0x1c')](socket);function respondWithStatusCode(_0x413359,_0x5393c3){_0x5393c3=_0x5393c3||0xcc;return function(_0x3c967f){if(_0x3c967f){return _0x413359[_0xae0d('0x1d')](_0x5393c3);}return _0x413359['status'](_0x5393c3)[_0xae0d('0x1e')]();};}function respondWithResult(_0x182ea1,_0x3c0776){_0x3c0776=_0x3c0776||0xc8;return function(_0x417f75){if(_0x417f75){return _0x182ea1[_0xae0d('0x1f')](_0x3c0776)[_0xae0d('0x20')](_0x417f75);}};}function respondWithFilteredResult(_0x20644b,_0x205189){return function(_0x2c2188){if(_0x2c2188){var _0x29772f=_0x2c2188['count'],_0x4f6d05=_0x205189[_0xae0d('0x21')],_0x18a746=_0x205189[_0xae0d('0x21')]+_0x205189['limit'],_0x4f4e48;if(_0x18a746>=_0x29772f){_0x18a746=_0x29772f;_0x4f4e48=0xc8;}else{_0x4f4e48=0xce;}_0x20644b['status'](_0x4f4e48);return _0x20644b['set'](_0xae0d('0x22'),_0x4f6d05+'-'+_0x18a746+'/'+_0x29772f)[_0xae0d('0x20')](_0x2c2188);}return null;};}function patchUpdates(_0x32317e){return function(_0x169c87){try{jsonpatch[_0xae0d('0x23')](_0x169c87,_0x32317e,!![]);}catch(_0x221cb7){return BPromise[_0xae0d('0x24')](_0x221cb7);}return _0x169c87['save']();};}function saveUpdates(_0x1af8a2,_0x1eb3a4){return function(_0x5cbb20){if(_0x5cbb20){return _0x5cbb20['update'](_0x1af8a2)[_0xae0d('0x25')](function(_0x3db7a7){return _0x3db7a7;});}return null;};}function removeEntity(_0x2f1248,_0x1cec78){return function(_0x39d0a8){if(_0x39d0a8){return _0x39d0a8[_0xae0d('0x26')]()[_0xae0d('0x25')](function(){_0x2f1248[_0xae0d('0x1f')](0xcc)[_0xae0d('0x1e')]();});}};}function handleEntityNotFound(_0x5967fd,_0x821998){return function(_0x16a8ef){if(!_0x16a8ef){_0x5967fd[_0xae0d('0x1d')](0x194);}return _0x16a8ef;};}function handleError(_0x45cc1b,_0x17ada2){_0x17ada2=_0x17ada2||0x1f4;return function(_0xfa3806){logger[_0xae0d('0x27')](_0xfa3806[_0xae0d('0x28')]);if(_0xfa3806['name']){delete _0xfa3806[_0xae0d('0x29')];}_0x45cc1b[_0xae0d('0x1f')](_0x17ada2)['send'](_0xfa3806);};}exports['index']=function(_0xf898e6,_0x4b3d09){var _0x5a969a={},_0x340ad8={},_0x3fa2bb={'count':0x0,'rows':[]};return db[_0xae0d('0x2a')][_0xae0d('0x2b')]()[_0xae0d('0x25')](function(_0x548cab){_0x340ad8[_0xae0d('0x2c')]=_[_0xae0d('0x2d')](_0x548cab);_0x340ad8[_0xae0d('0x2e')]=_[_0xae0d('0x2d')](_0xf898e6[_0xae0d('0x2e')]);_0x340ad8[_0xae0d('0x2f')]=_[_0xae0d('0x30')](_0x340ad8['model'],_0x340ad8[_0xae0d('0x2e')]);_0x5a969a[_0xae0d('0x31')]=_[_0xae0d('0x30')](_0x340ad8['model'],qs[_0xae0d('0x32')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x32')]));_0x5a969a[_0xae0d('0x31')]=_0x5a969a['attributes']['length']?_0x5a969a[_0xae0d('0x31')]:_0x340ad8['model'];if(!_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x33')](_0xae0d('0x34'))){_0x5a969a[_0xae0d('0x35')]=qs[_0xae0d('0x35')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x35')]);_0x5a969a[_0xae0d('0x21')]=qs[_0xae0d('0x21')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x21')]);}_0x5a969a[_0xae0d('0x36')]=qs[_0xae0d('0x37')](_0xf898e6[_0xae0d('0x2e')]['sort']);_0x5a969a[_0xae0d('0x38')]=qs[_0xae0d('0x2f')](_[_0xae0d('0x39')](_0xf898e6[_0xae0d('0x2e')],_0x340ad8[_0xae0d('0x2f')]));var _0x3cf6a8=[];var _0x591f3c=squel[_0xae0d('0x3a')]()[_0xae0d('0x3b')]('id')[_0xae0d('0x3b')](_0xae0d('0x29'))['field'](_0xae0d('0x3c'))[_0xae0d('0x3d')](_0xae0d('0x3e'));var _0x55f8cf=squel[_0xae0d('0x3a')]()['from'](_0xae0d('0x3f'),'c')[_0xae0d('0x38')](_0xae0d('0x40'));var _0x425e6f=squel[_0xae0d('0x41')]();if(_0xf898e6[_0xae0d('0x2e')]['advancedFilter']){var _0x2acd6d=JSON[_0xae0d('0x42')](_0xf898e6['query'][_0xae0d('0x43')]);_[_0xae0d('0x2d')](_0x2acd6d)[_0xae0d('0x44')](function(_0xcf6cfc){var _0x502b63=_0x2acd6d[_0xcf6cfc];switch(_0x502b63['condition']){case'IS':if(_['isArray'](_0x502b63[_0xae0d('0x45')])&&_0x502b63[_0xae0d('0x45')][_0xae0d('0x46')]>0x1){_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x49'),_0x502b63[_0xae0d('0x45')]);}else{_0x425e6f['and'](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4a'),_0x502b63[_0xae0d('0x45')][0x0]);}break;case'=':_0x425e6f['and'](_0x502b63['tableAlias']+'.'+_0xcf6cfc+'\x20=\x20?',_0x502b63[_0xae0d('0x45')]);break;case _0xae0d('0x4b'):_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4c'),'%'+_0x502b63[_0xae0d('0x45')]+'%');break;case'>':_0x425e6f['and'](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+'\x20>\x20?',_0x502b63[_0xae0d('0x45')]);break;case'<':_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4d'),_0x502b63[_0xae0d('0x45')]);break;}});}else{var _0x29d4e5=_(Object[_0xae0d('0x2d')](_0xf898e6[_0xae0d('0x2e')]))[_0xae0d('0x4e')](function(_0x3e3b5f){return _0x548cab['hasOwnProperty'](_0x3e3b5f)?_0x3e3b5f:undefined;})['filter'](function(_0x1dc3c6){return!_[_0xae0d('0x4f')](_0x1dc3c6);})[_0xae0d('0x45')]();if(!_[_0xae0d('0x50')](_0x29d4e5)){_0x29d4e5[_0xae0d('0x44')](function(_0x48a2aa){if(_0x48a2aa==='ListId'){_0x55f8cf['where'](_0xae0d('0x51'),[][_0xae0d('0x52')](_0xf898e6[_0xae0d('0x2e')][_0x48a2aa]));}else{_0x55f8cf[_0xae0d('0x38')]('c.'+_0x48a2aa+_0xae0d('0x4a'),_0xf898e6[_0xae0d('0x2e')][_0x48a2aa]);}});}if(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x53')]){var _0x181c53=_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x53')][_0xae0d('0x54')]('\x5c','\x5c\x5c')[_0xae0d('0x54')]('\x27\x27',_0xae0d('0x55'));if(qs[_0xae0d('0x56')](_0x181c53)){_0x425e6f['or']('c.id\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.phone\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.mobile\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or'](_0xae0d('0x57'),_0x181c53+'%');}else if(qs[_0xae0d('0x58')](_0x181c53)){_0x425e6f['or'](_0xae0d('0x59'),_0x181c53+'%');}else{_0x425e6f['or']('c.email\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.firstName\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or'](_0xae0d('0x5a'),_0x181c53+'%');}}}_0x55f8cf['where'](_0x425e6f);if(_0x5a969a['order']){_0x5a969a[_0xae0d('0x36')][_0xae0d('0x44')](function(_0x2e87d3){_0x55f8cf[_0xae0d('0x36')]('c.'+_0x2e87d3[0x0],_0x2e87d3[0x1]==='DESC'?![]:!![]);});}_0x55f8cf['group'](_0xae0d('0x5b'));var _0x3ca4cd={'type':db[_0xae0d('0x5c')][_0xae0d('0x5d')][_0xae0d('0x5e')],'raw':!![]};var _0x3ecb7b=_0x55f8cf[_0xae0d('0x5f')]()[_0xae0d('0x3b')](_0xae0d('0x60'));if(!_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x43')]){if(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')]){var _0x580539=_[_0xae0d('0x62')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')])?_0xf898e6[_0xae0d('0x2e')]['tag']:new Array(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')]);var _0x4c7666=squel[_0xae0d('0x41')]();_0x580539[_0xae0d('0x44')](function(_0x394774){_0x4c7666['or'](_0xae0d('0x63'),'%,'+_0x394774+',%');});_0x55f8cf[_0xae0d('0x64')](_0x4c7666);_0x3ecb7b['left_join'](_0xae0d('0x65'),'ct','ct.CmContactId\x20=\x20c.id');_0x3ecb7b[_0xae0d('0x66')](_0xae0d('0x3e'),'t',_0xae0d('0x67'));_0x3ecb7b[_0xae0d('0x38')](_0xae0d('0x68'),_0x580539);}}db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x591f3c[_0xae0d('0x6a')](),_0x3ca4cd)[_0xae0d('0x25')](function(_0x350c96){_0x3cf6a8=_[_0xae0d('0x6b')](_0x350c96,'id');return db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x3ecb7b['toString'](),_0x3ca4cd);})[_0xae0d('0x25')](function(_0x5c65f2){_0x3fa2bb[_0xae0d('0x6c')]=_0x5c65f2[_0xae0d('0x46')];_0x3ca4cd=_[_0xae0d('0x6d')](_0x3ca4cd,{'model':db[_0xae0d('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x55f8cf[_0xae0d('0x3b')](_0xae0d('0x6e'));_0x55f8cf[_0xae0d('0x3b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xae0d('0x6f'));_0x55f8cf[_0xae0d('0x66')](_0xae0d('0x65'),'ct','ct.CmContactId\x20=\x20c.id');_0x55f8cf['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');if(_0x5a969a[_0xae0d('0x35')]){_0x55f8cf[_0xae0d('0x35')](_0x5a969a[_0xae0d('0x35')]);}if(_0x5a969a[_0xae0d('0x21')]){_0x55f8cf[_0xae0d('0x21')](_0x5a969a['offset']);}db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x55f8cf[_0xae0d('0x6a')](),_0x3ca4cd)[_0xae0d('0x25')](function(_0x1b0f5d){_0x1b0f5d[_0xae0d('0x44')](function(_0x3faaa3){if(_0x3faaa3[_0xae0d('0x6f')]){_0x3faaa3[_0xae0d('0x70')]=[];_0x3faaa3[_0xae0d('0x6f')][_0xae0d('0x71')](',')[_0xae0d('0x44')](function(_0x38f6c4){_0x3faaa3['Tags']['push'](_0x3cf6a8[_0x38f6c4]);});}delete _0x3faaa3[_0xae0d('0x6f')];});_0x3fa2bb[_0xae0d('0x72')]=_0x1b0f5d;return _0x3fa2bb;})[_0xae0d('0x25')](respondWithFilteredResult(_0x4b3d09,_0x5a969a))[_0xae0d('0x73')](handleError(_0x4b3d09,null));});});};exports[_0xae0d('0x26')]=function(_0x5bec95,_0x5f341d){return db['CmContact'][_0xae0d('0x74')]({'where':{'id':_0x5bec95[_0xae0d('0x75')]['id']}})[_0xae0d('0x25')](handleEntityNotFound(_0x5f341d,null))[_0xae0d('0x25')](removeEntity(_0x5f341d,null))[_0xae0d('0x73')](handleError(_0x5f341d,null));};exports[_0xae0d('0x2b')]=function(_0x468291,_0x14a02f){return db[_0xae0d('0x2a')][_0xae0d('0x2b')]()[_0xae0d('0x25')](function(_0x527d09){for(var _0x4b1041=0x0;_0x4b1041\x20?','\x20<\x20?','map'];(function(_0x1b5b5d,_0x255772){var _0x38d0fd=function(_0x47a5bc){while(--_0x47a5bc){_0x1b5b5d['push'](_0x1b5b5d['shift']());}};_0x38d0fd(++_0x255772);}(_0x7c01,0x93));var _0x17c0=function(_0x36c04d,_0x52e6d2){_0x36c04d=_0x36c04d-0x0;var _0x45116f=_0x7c01[_0x36c04d];return _0x45116f;};'use strict';var pdf=require(_0x17c0('0x0'));var emlformat=require(_0x17c0('0x1'));var rimraf=require(_0x17c0('0x2'));var zipdir=require(_0x17c0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17c0('0x4'));var moment=require(_0x17c0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17c0('0x6'));var util=require(_0x17c0('0x7'));var path=require('path');var sox=require(_0x17c0('0x8'));var csv=require(_0x17c0('0x9'));var ejs=require(_0x17c0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x17c0('0xb'));var crypto=require(_0x17c0('0xc'));var jsforce=require(_0x17c0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x17c0('0x9'));var querystring=require(_0x17c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x17c0('0xf'));var authService=require(_0x17c0('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x17c0('0x11'));var logger=require(_0x17c0('0x12'))(_0x17c0('0x13'));var utils=require(_0x17c0('0x14'));var config=require(_0x17c0('0x15'));var db=require(_0x17c0('0x16'))['db'];config[_0x17c0('0x17')]=_['defaults'](config[_0x17c0('0x17')],{'host':_0x17c0('0x18'),'port':0x18eb});var socket=require(_0x17c0('0x19'))(new Redis(config[_0x17c0('0x17')]));require(_0x17c0('0x1a'))[_0x17c0('0x1b')](socket);function respondWithStatusCode(_0x32f9c4,_0x5e05be){_0x5e05be=_0x5e05be||0xcc;return function(_0x5af7aa){if(_0x5af7aa){return _0x32f9c4[_0x17c0('0x1c')](_0x5e05be);}return _0x32f9c4[_0x17c0('0x1d')](_0x5e05be)[_0x17c0('0x1e')]();};}function respondWithResult(_0x1bf87d,_0xd30255){_0xd30255=_0xd30255||0xc8;return function(_0x5d97bf){if(_0x5d97bf){return _0x1bf87d['status'](_0xd30255)[_0x17c0('0x1f')](_0x5d97bf);}};}function respondWithFilteredResult(_0x163175,_0x1b5455){return function(_0x490cd4){if(_0x490cd4){var _0x5a5c88=_0x490cd4['count'],_0x144817=_0x1b5455[_0x17c0('0x20')],_0x47737f=_0x1b5455[_0x17c0('0x20')]+_0x1b5455[_0x17c0('0x21')],_0x208877;if(_0x47737f>=_0x5a5c88){_0x47737f=_0x5a5c88;_0x208877=0xc8;}else{_0x208877=0xce;}_0x163175[_0x17c0('0x1d')](_0x208877);return _0x163175[_0x17c0('0x22')]('Content-Range',_0x144817+'-'+_0x47737f+'/'+_0x5a5c88)['json'](_0x490cd4);}return null;};}function patchUpdates(_0x2643a2){return function(_0x461a98){try{jsonpatch[_0x17c0('0x23')](_0x461a98,_0x2643a2,!![]);}catch(_0x1a0ae2){return BPromise[_0x17c0('0x24')](_0x1a0ae2);}return _0x461a98[_0x17c0('0x25')]();};}function saveUpdates(_0x4e5f5e,_0x33379d){return function(_0x1d44cf){if(_0x1d44cf){return _0x1d44cf[_0x17c0('0x26')](_0x4e5f5e)[_0x17c0('0x27')](function(_0x320fb9){return _0x320fb9;});}return null;};}function removeEntity(_0x151b99,_0x9a3ded){return function(_0x4d0a08){if(_0x4d0a08){return _0x4d0a08[_0x17c0('0x28')]()[_0x17c0('0x27')](function(){_0x151b99[_0x17c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a0dd3,_0x510efc){return function(_0x2c6ef3){if(!_0x2c6ef3){_0x3a0dd3[_0x17c0('0x1c')](0x194);}return _0x2c6ef3;};}function handleError(_0x2de054,_0x1f67b2){_0x1f67b2=_0x1f67b2||0x1f4;return function(_0x2f735d){logger[_0x17c0('0x29')](_0x2f735d[_0x17c0('0x2a')]);if(_0x2f735d['name']){delete _0x2f735d[_0x17c0('0x2b')];}_0x2de054['status'](_0x1f67b2)[_0x17c0('0x2c')](_0x2f735d);};}exports[_0x17c0('0x2d')]=function(_0x515ae5,_0x297b07){var _0x4bc4a6={},_0x2a035f={},_0x4f56ec={'count':0x0,'rows':[]};return db[_0x17c0('0x2e')]['describe']()['then'](function(_0x2c5508){_0x2a035f[_0x17c0('0x2f')]=_['keys'](_0x2c5508);_0x2a035f[_0x17c0('0x30')]=_[_0x17c0('0x31')](_0x515ae5[_0x17c0('0x30')]);_0x2a035f[_0x17c0('0x32')]=_[_0x17c0('0x33')](_0x2a035f[_0x17c0('0x2f')],_0x2a035f['query']);_0x4bc4a6[_0x17c0('0x34')]=_[_0x17c0('0x33')](_0x2a035f[_0x17c0('0x2f')],qs['fields'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x35')]));_0x4bc4a6[_0x17c0('0x34')]=_0x4bc4a6[_0x17c0('0x34')][_0x17c0('0x36')]?_0x4bc4a6[_0x17c0('0x34')]:_0x2a035f[_0x17c0('0x2f')];if(!_0x515ae5[_0x17c0('0x30')]['hasOwnProperty'](_0x17c0('0x37'))){_0x4bc4a6[_0x17c0('0x21')]=qs[_0x17c0('0x21')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x21')]);_0x4bc4a6[_0x17c0('0x20')]=qs[_0x17c0('0x20')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x20')]);}_0x4bc4a6['order']=qs['sort'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x38')]);_0x4bc4a6[_0x17c0('0x39')]=qs[_0x17c0('0x32')](_[_0x17c0('0x3a')](_0x515ae5[_0x17c0('0x30')],_0x2a035f[_0x17c0('0x32')]));var _0x62e551=[];var _0x3b73de=squel[_0x17c0('0x3b')]()[_0x17c0('0x3c')]('id')[_0x17c0('0x3c')](_0x17c0('0x2b'))['field'](_0x17c0('0x3d'))[_0x17c0('0x3e')](_0x17c0('0x3f'));var _0x26177a=squel['select']()[_0x17c0('0x3e')](_0x17c0('0x40'),'c')[_0x17c0('0x39')](_0x17c0('0x41'));var _0x5b7a42=squel[_0x17c0('0x42')]();if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]){var _0x2f095e=JSON['parse'](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]);_[_0x17c0('0x31')](_0x2f095e)[_0x17c0('0x44')](function(_0x4edfd5){var _0x5eb980=_0x2f095e[_0x4edfd5];switch(_0x5eb980[_0x17c0('0x45')]){case'IS':if(_[_0x17c0('0x46')](_0x5eb980[_0x17c0('0x47')])&&_0x5eb980[_0x17c0('0x47')][_0x17c0('0x36')]>0x1){_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4a'),_0x5eb980[_0x17c0('0x47')]);}else{_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4b'),_0x5eb980[_0x17c0('0x47')][0x0]);}break;case'=':_0x5b7a42[_0x17c0('0x48')](_0x5eb980['tableAlias']+'.'+_0x4edfd5+_0x17c0('0x4b'),_0x5eb980[_0x17c0('0x47')]);break;case _0x17c0('0x4c'):_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4d'),'%'+_0x5eb980[_0x17c0('0x47')]+'%');break;case'>':_0x5b7a42['and'](_0x5eb980['tableAlias']+'.'+_0x4edfd5+_0x17c0('0x4e'),_0x5eb980[_0x17c0('0x47')]);break;case'<':_0x5b7a42[_0x17c0('0x48')](_0x5eb980[_0x17c0('0x49')]+'.'+_0x4edfd5+_0x17c0('0x4f'),_0x5eb980['value']);break;}});}else{var _0x464624=_(Object[_0x17c0('0x31')](_0x515ae5[_0x17c0('0x30')]))[_0x17c0('0x50')](function(_0x14b2e3){return _0x2c5508[_0x17c0('0x51')](_0x14b2e3)?_0x14b2e3:undefined;})[_0x17c0('0x52')](function(_0x3195d1){return!_[_0x17c0('0x53')](_0x3195d1);})['value']();if(!_[_0x17c0('0x54')](_0x464624)){_0x464624[_0x17c0('0x44')](function(_0x62c212){if(_0x62c212==='ListId'){_0x26177a[_0x17c0('0x39')](_0x17c0('0x55'),[][_0x17c0('0x56')](_0x515ae5['query'][_0x62c212]));}else{_0x26177a[_0x17c0('0x39')]('c.'+_0x62c212+_0x17c0('0x4b'),_0x515ae5[_0x17c0('0x30')][_0x62c212]);}});}if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x52')]){var _0x3d57ee=_0x515ae5[_0x17c0('0x30')][_0x17c0('0x52')][_0x17c0('0x57')]('\x5c','\x5c\x5c')[_0x17c0('0x57')]('\x27\x27',_0x17c0('0x58'));if(qs[_0x17c0('0x59')](_0x3d57ee)){_0x5b7a42['or'](_0x17c0('0x5a'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5b'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5c'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x5d'),_0x3d57ee+'%');}else if(qs[_0x17c0('0x5e')](_0x3d57ee)){_0x5b7a42['or'](_0x17c0('0x5f'),_0x3d57ee+'%');}else{_0x5b7a42['or'](_0x17c0('0x5f'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x60'),_0x3d57ee+'%');_0x5b7a42['or'](_0x17c0('0x61'),_0x3d57ee+'%');}}}_0x26177a[_0x17c0('0x39')](_0x5b7a42);if(_0x4bc4a6[_0x17c0('0x62')]){_0x4bc4a6[_0x17c0('0x62')][_0x17c0('0x44')](function(_0x324f59){_0x26177a[_0x17c0('0x62')]('c.'+_0x324f59[0x0],_0x324f59[0x1]===_0x17c0('0x63')?![]:!![]);});}_0x26177a[_0x17c0('0x64')](_0x17c0('0x65'));var _0x1f0544={'type':db[_0x17c0('0x66')][_0x17c0('0x67')]['SELECT'],'raw':!![]};var _0x64933b=_0x26177a['clone']()[_0x17c0('0x3c')](_0x17c0('0x68'));if(!_0x515ae5[_0x17c0('0x30')][_0x17c0('0x43')]){if(_0x515ae5[_0x17c0('0x30')][_0x17c0('0x69')]){var _0x3df434=_[_0x17c0('0x46')](_0x515ae5[_0x17c0('0x30')][_0x17c0('0x69')])?_0x515ae5['query']['tag']:new Array(_0x515ae5['query'][_0x17c0('0x69')]);var _0xedc288=squel[_0x17c0('0x42')]();_0x3df434[_0x17c0('0x44')](function(_0x404551){_0xedc288['or'](_0x17c0('0x6a'),'%,'+_0x404551+',%');});_0x26177a[_0x17c0('0x6b')](_0xedc288);_0x64933b['left_join'](_0x17c0('0x6c'),'ct','ct.CmContactId\x20=\x20c.id');_0x64933b[_0x17c0('0x6d')](_0x17c0('0x3f'),'t','t.id\x20=\x20ct.TagId');_0x64933b[_0x17c0('0x39')](_0x17c0('0x6e'),_0x3df434);}}db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x3b73de[_0x17c0('0x70')](),_0x1f0544)[_0x17c0('0x27')](function(_0x25fa41){_0x62e551=_[_0x17c0('0x71')](_0x25fa41,'id');return db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x64933b[_0x17c0('0x70')](),_0x1f0544);})[_0x17c0('0x27')](function(_0x736e1){_0x4f56ec['count']=_0x736e1[_0x17c0('0x36')];_0x1f0544=_[_0x17c0('0x72')](_0x1f0544,{'model':db[_0x17c0('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x26177a[_0x17c0('0x3c')](_0x17c0('0x73'));_0x26177a[_0x17c0('0x3c')](_0x17c0('0x74'),'TagIds');_0x26177a[_0x17c0('0x6d')](_0x17c0('0x6c'),'ct',_0x17c0('0x75'));_0x26177a[_0x17c0('0x6d')]('tools_tags','t',_0x17c0('0x76'));if(_0x4bc4a6[_0x17c0('0x21')]){_0x26177a['limit'](_0x4bc4a6[_0x17c0('0x21')]);}if(_0x4bc4a6[_0x17c0('0x20')]){_0x26177a[_0x17c0('0x20')](_0x4bc4a6[_0x17c0('0x20')]);}db[_0x17c0('0x6f')][_0x17c0('0x30')](_0x26177a[_0x17c0('0x70')](),_0x1f0544)[_0x17c0('0x27')](function(_0xa5a714){_0xa5a714[_0x17c0('0x44')](function(_0x278a5d){if(_0x278a5d[_0x17c0('0x77')]){_0x278a5d['Tags']=[];_0x278a5d[_0x17c0('0x77')][_0x17c0('0x78')](',')[_0x17c0('0x44')](function(_0x5195c2){_0x278a5d[_0x17c0('0x79')]['push'](_0x62e551[_0x5195c2]);});}delete _0x278a5d[_0x17c0('0x77')];});_0x4f56ec[_0x17c0('0x7a')]=_0xa5a714;return _0x4f56ec;})[_0x17c0('0x27')](respondWithFilteredResult(_0x297b07,_0x4bc4a6))[_0x17c0('0x7b')](handleError(_0x297b07,null));});});};exports[_0x17c0('0x28')]=function(_0xfc0cf0,_0x4cad37){return db[_0x17c0('0x2e')][_0x17c0('0x7c')]({'where':{'id':_0xfc0cf0['params']['id']}})['then'](handleEntityNotFound(_0x4cad37,null))[_0x17c0('0x27')](removeEntity(_0x4cad37,null))['catch'](handleError(_0x4cad37,null));};exports[_0x17c0('0x7d')]=function(_0x3e9cb8,_0x17ddd0){return db[_0x17c0('0x2e')]['describe']()[_0x17c0('0x27')](function(_0x31642d){for(var _0x382f2c=0x0;_0x382f2c{}\s\\|]/g,'-');_0xe2f6f8(null,util[_0x6aba('0x20')]('%s-%s%s',path[_0x6aba('0x21')](_0x221d91[_0x6aba('0x1e')],path['extname'](_0x221d91[_0x6aba('0x1e')])),Date[_0x6aba('0x22')](),path[_0x6aba('0x23')](_0x221d91['originalname'])));}})});router['post'](_0x6aba('0x24'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x6aba('0x1b')]({'destination':function(_0x3c37cc,_0x3f7a53,_0x41d59a){_0x41d59a(null,path['join'](config[_0x6aba('0x25')],'server/files/tmp'));},'filename':function(_0x3e28d9,_0x27269f,_0xba8b3){_0x27269f[_0x6aba('0x1e')]=_0x27269f[_0x6aba('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xba8b3(null,util[_0x6aba('0x20')](_0x6aba('0x26'),path[_0x6aba('0x21')](_0x27269f[_0x6aba('0x1e')],path['extname'](_0x27269f[_0x6aba('0x1e')])),Date[_0x6aba('0x22')](),path[_0x6aba('0x23')](_0x27269f['originalname'])));}})});router[_0x6aba('0x15')]('/upload',upload['single'](_0x6aba('0x27')),controller[_0x6aba('0x28')]);router[_0x6aba('0x15')](_0x6aba('0x29'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x2a')]);router[_0x6aba('0x2b')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x2c')]);router[_0x6aba('0x2d')]('/:id',auth[_0x6aba('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x36af=['format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','replace','upload','/upload/:id','import','put','/:id','update','exports','path','connect-timeout','../../components/auth/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','merge','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname'];(function(_0x6a06e9,_0x4406d3){var _0xb769db=function(_0x23dc3e){while(--_0x23dc3e){_0x6a06e9['push'](_0x6a06e9['shift']());}};_0xb769db(++_0x4406d3);}(_0x36af,0x15a));var _0xf36a=function(_0x46e3c9,_0x3bcbc5){_0x46e3c9=_0x46e3c9-0x0;var _0x4d03f9=_0x36af[_0x46e3c9];return _0x4d03f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf36a('0x0'));var timeout=require(_0xf36a('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf36a('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf36a('0x3'));var controller=require(_0xf36a('0x4'));router['get']('/',auth[_0xf36a('0x5')](),controller[_0xf36a('0x6')]);router[_0xf36a('0x7')](_0xf36a('0x8'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x9')]);router['get']('/:id',auth[_0xf36a('0x5')](),controller['show']);router[_0xf36a('0x7')](_0xf36a('0xa'),auth[_0xf36a('0x5')](),controller[_0xf36a('0xb')]);router[_0xf36a('0x7')](_0xf36a('0xc'),auth[_0xf36a('0x5')](),controller[_0xf36a('0xd')]);router[_0xf36a('0x7')](_0xf36a('0xe'),auth['isAuthenticated'](),controller[_0xf36a('0xf')]);router[_0xf36a('0x7')](_0xf36a('0x10'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x11')]);router['get'](_0xf36a('0x12'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x13')]);router[_0xf36a('0x14')]('/merge',auth[_0xf36a('0x5')](),controller[_0xf36a('0x15')]);router['post']('/',auth[_0xf36a('0x5')](),controller[_0xf36a('0x16')]);router['post'](_0xf36a('0x17'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x18')]);router[_0xf36a('0x14')](_0xf36a('0xa'),auth[_0xf36a('0x5')](),controller['setTags']);var upload=multer({'storage':multer[_0xf36a('0x19')]({'destination':function(_0x2d7e83,_0x1e0f76,_0x37cf02){_0x37cf02(null,path[_0xf36a('0x1a')](config[_0xf36a('0x1b')],_0xf36a('0x1c')));},'filename':function(_0x1b03ee,_0x31fd07,_0xaec856){_0x31fd07['originalname']=_0x31fd07[_0xf36a('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xaec856(null,util[_0xf36a('0x1e')](_0xf36a('0x1f'),path[_0xf36a('0x20')](_0x31fd07[_0xf36a('0x1d')],path[_0xf36a('0x21')](_0x31fd07['originalname'])),Date[_0xf36a('0x22')](),path[_0xf36a('0x21')](_0x31fd07['originalname'])));}})});router[_0xf36a('0x14')](_0xf36a('0x23'),upload[_0xf36a('0x24')](_0xf36a('0x25')),controller[_0xf36a('0x26')]);var upload=multer({'storage':multer[_0xf36a('0x19')]({'destination':function(_0x1f5207,_0x997d60,_0x305214){_0x305214(null,path[_0xf36a('0x1a')](config[_0xf36a('0x1b')],_0xf36a('0x1c')));},'filename':function(_0x1813d9,_0x351a6c,_0xed5e89){_0x351a6c[_0xf36a('0x1d')]=_0x351a6c[_0xf36a('0x1d')][_0xf36a('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xed5e89(null,util['format'](_0xf36a('0x1f'),path[_0xf36a('0x20')](_0x351a6c[_0xf36a('0x1d')],path['extname'](_0x351a6c[_0xf36a('0x1d')])),Date[_0xf36a('0x22')](),path[_0xf36a('0x21')](_0x351a6c[_0xf36a('0x1d')])));}})});router[_0xf36a('0x14')]('/upload',upload['single'](_0xf36a('0x25')),controller[_0xf36a('0x28')]);router[_0xf36a('0x14')](_0xf36a('0x29'),auth['isAuthenticated'](),controller[_0xf36a('0x2a')]);router[_0xf36a('0x2b')](_0xf36a('0x2c'),auth[_0xf36a('0x5')](),controller[_0xf36a('0x2d')]);router['delete'](_0xf36a('0x2c'),auth[_0xf36a('0x5')](),controller['destroy']);module[_0xf36a('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 5954d34..4f084d0 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 _0x6c86=['type','select','parse','values','stringify','BOOLEAN','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0x3ab54a,_0xf327f1){var _0x2b8fcd=function(_0x124a71){while(--_0x124a71){_0x3ab54a['push'](_0x3ab54a['shift']());}};_0x2b8fcd(++_0xf327f1);}(_0x6c86,0x132));var _0x66c8=function(_0x5dea6a,_0x192e18){_0x5dea6a=_0x5dea6a-0x0;var _0x4d5435=_0x6c86[_0x5dea6a];return _0x4d5435;};'use strict';var Sequelize=require('sequelize');var _=require(_0x66c8('0x0'));module[_0x66c8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4650fe){return this[_0x66c8('0x2')](_0x66c8('0x3'));}},'alias':{'type':Sequelize[_0x66c8('0x4')],'allowNull':![],'set':function(_0x1e45f9){this[_0x66c8('0x5')](_0x66c8('0x3'),_0x1e45f9?_0x1e45f9:this['getDataValue'](_0x66c8('0x6')));}},'type':{'type':Sequelize[_0x66c8('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x66c8('0x7')](_0x66c8('0x8')),'get':function(){if(this['getDataValue'](_0x66c8('0x9'))===_0x66c8('0xa')){return JSON[_0x66c8('0xb')](this[_0x66c8('0x2')](_0x66c8('0xc')));}else{return this[_0x66c8('0x2')](_0x66c8('0xc'));}},'set':function(_0x181b9f){if(Array['isArray'](_0x181b9f)){this[_0x66c8('0x5')](_0x66c8('0xc'),JSON[_0x66c8('0xd')](_0x181b9f));}else{this['setDataValue'](_0x66c8('0xc'),_0x181b9f);}}},'required':{'type':Sequelize[_0x66c8('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xe4a5=['TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','VIRTUAL','alias','STRING','setDataValue','getDataValue','name'];(function(_0x1df5cc,_0x95c5e2){var _0x41caee=function(_0x24ec9f){while(--_0x24ec9f){_0x1df5cc['push'](_0x1df5cc['shift']());}};_0x41caee(++_0x95c5e2);}(_0xe4a5,0xa2));var _0x5e4a=function(_0x27567e,_0x2f60b0){_0x27567e=_0x27567e-0x0;var _0xb71bfe=_0xe4a5[_0x27567e];return _0xb71bfe;};'use strict';var Sequelize=require(_0x5e4a('0x0'));var _=require(_0x5e4a('0x1'));module['exports']={'name':{'type':Sequelize[_0x5e4a('0x2')],'get':function(_0x48717c){return this['getDataValue'](_0x5e4a('0x3'));}},'alias':{'type':Sequelize[_0x5e4a('0x4')],'allowNull':![],'set':function(_0x5349db){this[_0x5e4a('0x5')](_0x5e4a('0x3'),_0x5349db?_0x5349db:this[_0x5e4a('0x6')](_0x5e4a('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x5e4a('0x8')](_0x5e4a('0x9')),'get':function(){if(this[_0x5e4a('0x6')](_0x5e4a('0xa'))===_0x5e4a('0xb')){return JSON[_0x5e4a('0xc')](this[_0x5e4a('0x6')](_0x5e4a('0xd')));}else{return this['getDataValue'](_0x5e4a('0xd'));}},'set':function(_0x585ed0){if(Array[_0x5e4a('0xe')](_0x585ed0)){this[_0x5e4a('0x5')](_0x5e4a('0xd'),JSON[_0x5e4a('0xf')](_0x585ed0));}else{this[_0x5e4a('0x5')](_0x5e4a('0xd'),_0x585ed0);}}},'required':{'type':Sequelize[_0x5e4a('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 8b3e14a..e1a12aa 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 _0x3f4b=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','CmCustomField','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','sequelize','transaction','body','html-pdf','eml-format','rimraf','fast-json-patch','moment'];(function(_0xf5c57d,_0x183fb6){var _0x25a2f5=function(_0x5c6ef8){while(--_0x5c6ef8){_0xf5c57d['push'](_0xf5c57d['shift']());}};_0x25a2f5(++_0x183fb6);}(_0x3f4b,0x11f));var _0xb3f4=function(_0x5968d1,_0x3511d1){_0x5968d1=_0x5968d1-0x0;var _0x359acf=_0x3f4b[_0x5968d1];return _0x359acf;};'use strict';var pdf=require(_0xb3f4('0x0'));var emlformat=require(_0xb3f4('0x1'));var rimraf=require(_0xb3f4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3f4('0x3'));var rp=require('request-promise');var moment=require(_0xb3f4('0x4'));var BPromise=require(_0xb3f4('0x5'));var Mustache=require(_0xb3f4('0x6'));var util=require(_0xb3f4('0x7'));var path=require('path');var sox=require(_0xb3f4('0x8'));var csv=require(_0xb3f4('0x9'));var ejs=require(_0xb3f4('0xa'));var fs=require('fs');var _=require(_0xb3f4('0xb'));var squel=require(_0xb3f4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3f4('0xd'));var Papa=require(_0xb3f4('0xe'));var Redis=require('ioredis');var authService=require(_0xb3f4('0xf'));var qs=require(_0xb3f4('0x10'));var hardwareService=require(_0xb3f4('0x11'));var logger=require('../../config/logger')(_0xb3f4('0x12'));var utils=require(_0xb3f4('0x13'));var config=require(_0xb3f4('0x14'));var db=require(_0xb3f4('0x15'))['db'];function respondWithStatusCode(_0x48f2a2,_0x38c796){_0x38c796=_0x38c796||0xcc;return function(_0x2322c3){if(_0x2322c3){return _0x48f2a2[_0xb3f4('0x16')](_0x38c796);}return _0x48f2a2['status'](_0x38c796)['end']();};}function respondWithResult(_0x5b7493,_0x1a8d31){_0x1a8d31=_0x1a8d31||0xc8;return function(_0x4307c5){if(_0x4307c5){return _0x5b7493[_0xb3f4('0x17')](_0x1a8d31)[_0xb3f4('0x18')](_0x4307c5);}};}function respondWithFilteredResult(_0x2ec900,_0x39b2b0){return function(_0x425200){if(_0x425200){var _0x2392b0=_0x425200[_0xb3f4('0x19')],_0xaacf4e=_0x39b2b0[_0xb3f4('0x1a')],_0x2fcc5e=_0x39b2b0['offset']+_0x39b2b0[_0xb3f4('0x1b')],_0x35650f;if(_0x2fcc5e>=_0x2392b0){_0x2fcc5e=_0x2392b0;_0x35650f=0xc8;}else{_0x35650f=0xce;}_0x2ec900[_0xb3f4('0x17')](_0x35650f);return _0x2ec900[_0xb3f4('0x1c')](_0xb3f4('0x1d'),_0xaacf4e+'-'+_0x2fcc5e+'/'+_0x2392b0)[_0xb3f4('0x18')](_0x425200);}return null;};}function patchUpdates(_0x108ed0){return function(_0x57bb29){try{jsonpatch[_0xb3f4('0x1e')](_0x57bb29,_0x108ed0,!![]);}catch(_0x2924f0){return BPromise[_0xb3f4('0x1f')](_0x2924f0);}return _0x57bb29[_0xb3f4('0x20')]();};}function saveUpdates(_0x51adf5,_0x5ab8a8){return function(_0x9bb6a4){if(_0x9bb6a4){return _0x9bb6a4[_0xb3f4('0x21')](_0x51adf5)[_0xb3f4('0x22')](function(_0x42dea9){return _0x42dea9;});}return null;};}function removeEntity(_0x23a671,_0x257a5e){return function(_0x3afd36){if(_0x3afd36){return _0x3afd36[_0xb3f4('0x23')]()[_0xb3f4('0x22')](function(){_0x23a671[_0xb3f4('0x17')](0xcc)[_0xb3f4('0x24')]();});}};}function handleEntityNotFound(_0x3d58b6,_0x3c7f78){return function(_0x221a9a){if(!_0x221a9a){_0x3d58b6['sendStatus'](0x194);}return _0x221a9a;};}function handleError(_0x56fe31,_0x4a972b){_0x4a972b=_0x4a972b||0x1f4;return function(_0x15e77d){logger['error'](_0x15e77d[_0xb3f4('0x25')]);if(_0x15e77d[_0xb3f4('0x26')]){delete _0x15e77d['name'];}_0x56fe31['status'](_0x4a972b)['send'](_0x15e77d);};}exports[_0xb3f4('0x27')]=function(_0x27a13e,_0x2ad496){var _0x562a04={},_0x4d4ac7={},_0x57f43c={'count':0x0,'rows':[]};var _0x306a3d=db[_0xb3f4('0x28')]['rawAttributes'];_0x4d4ac7[_0xb3f4('0x29')]=_[_0xb3f4('0x2a')](_['keys'](_0x306a3d),[_0xb3f4('0x26')]);_0x4d4ac7['query']=_[_0xb3f4('0x2b')](_0x27a13e[_0xb3f4('0x2c')]);_0x4d4ac7[_0xb3f4('0x2d')]=_[_0xb3f4('0x2e')](_0x4d4ac7[_0xb3f4('0x29')],_0x4d4ac7[_0xb3f4('0x2c')]);_0x562a04['attributes']=_[_0xb3f4('0x2e')](_0x4d4ac7[_0xb3f4('0x29')],qs[_0xb3f4('0x2f')](_0x27a13e['query'][_0xb3f4('0x2f')]));_0x562a04[_0xb3f4('0x30')]=_0x562a04[_0xb3f4('0x30')][_0xb3f4('0x31')]?_0x562a04[_0xb3f4('0x30')]:_0x4d4ac7[_0xb3f4('0x29')];if(!_0x27a13e['query']['hasOwnProperty']('nolimit')){_0x562a04[_0xb3f4('0x1b')]=qs[_0xb3f4('0x1b')](_0x27a13e['query'][_0xb3f4('0x1b')]);_0x562a04[_0xb3f4('0x1a')]=qs['offset'](_0x27a13e['query']['offset']);}_0x562a04['order']=qs[_0xb3f4('0x32')](_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x32')]);_0x562a04[_0xb3f4('0x33')]=qs[_0xb3f4('0x2d')](_[_0xb3f4('0x34')](_0x27a13e[_0xb3f4('0x2c')],_0x4d4ac7['filters']));if(_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x35')]){_0x562a04[_0xb3f4('0x33')]=_[_0xb3f4('0x36')](_0x562a04[_0xb3f4('0x33')],{'$or':_[_0xb3f4('0x37')](_0x306a3d,function(_0x79d46e){if(_0x79d46e[_0xb3f4('0x38')][_0xb3f4('0x39')]!==_0xb3f4('0x3a')){var _0x5464a4={};_0x5464a4[_0x79d46e[_0xb3f4('0x3b')]]={'$like':'%'+_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x35')]+'%'};return _0x5464a4;}})});}_0x562a04=_[_0xb3f4('0x36')]({},_0x562a04,_0x27a13e[_0xb3f4('0x3c')]);var _0x1a0793={'where':_0x562a04[_0xb3f4('0x33')]};return db[_0xb3f4('0x28')][_0xb3f4('0x19')](_0x1a0793)[_0xb3f4('0x22')](function(_0x3da981){_0x57f43c[_0xb3f4('0x19')]=_0x3da981;if(_0x27a13e[_0xb3f4('0x2c')]['includeAll']){_0x562a04['include']=[{'all':!![]}];}return db[_0xb3f4('0x28')][_0xb3f4('0x3d')](_0x562a04);})[_0xb3f4('0x22')](function(_0x538d6f){_0x57f43c[_0xb3f4('0x3e')]=_0x538d6f;return _0x57f43c;})[_0xb3f4('0x22')](respondWithFilteredResult(_0x2ad496,_0x562a04))[_0xb3f4('0x3f')](handleError(_0x2ad496,null));};exports['show']=function(_0x3082ff,_0x2c44aa){var _0x304a68={'raw':!![],'where':{'id':_0x3082ff[_0xb3f4('0x40')]['id']}},_0x4acf1a={};_0x4acf1a['model']=_[_0xb3f4('0x2b')](db[_0xb3f4('0x28')][_0xb3f4('0x41')]);_0x4acf1a[_0xb3f4('0x2c')]=_['keys'](_0x3082ff[_0xb3f4('0x2c')]);_0x4acf1a[_0xb3f4('0x2d')]=_[_0xb3f4('0x2e')](_0x4acf1a[_0xb3f4('0x29')],_0x4acf1a[_0xb3f4('0x2c')]);_0x304a68[_0xb3f4('0x30')]=_[_0xb3f4('0x2e')](_0x4acf1a[_0xb3f4('0x29')],qs[_0xb3f4('0x2f')](_0x3082ff[_0xb3f4('0x2c')][_0xb3f4('0x2f')]));_0x304a68[_0xb3f4('0x30')]=_0x304a68['attributes'][_0xb3f4('0x31')]?_0x304a68[_0xb3f4('0x30')]:_0x4acf1a[_0xb3f4('0x29')];if(_0x3082ff[_0xb3f4('0x2c')][_0xb3f4('0x42')]){_0x304a68[_0xb3f4('0x43')]=[{'all':!![]}];}_0x304a68=_[_0xb3f4('0x36')]({},_0x304a68,_0x3082ff[_0xb3f4('0x3c')]);return db['CmCustomField'][_0xb3f4('0x44')](_0x304a68)[_0xb3f4('0x22')](handleEntityNotFound(_0x2c44aa,null))[_0xb3f4('0x22')](respondWithResult(_0x2c44aa,null))[_0xb3f4('0x3f')](handleError(_0x2c44aa,null));};exports[_0xb3f4('0x45')]=function(_0x59e8d4,_0x5bdd13){return db[_0xb3f4('0x46')][_0xb3f4('0x47')](function(_0x227fd5){return db['CmCustomField']['create'](_0x59e8d4[_0xb3f4('0x48')],{'transaction':_0x227fd5});})[_0xb3f4('0x22')](respondWithResult(_0x5bdd13,0xc9))[_0xb3f4('0x3f')](handleError(_0x5bdd13,null));};exports[_0xb3f4('0x21')]=function(_0x20543e,_0x424eb7){if(_0x20543e['body']['id']){delete _0x20543e[_0xb3f4('0x48')]['id'];}return db[_0xb3f4('0x28')]['find']({'where':{'id':_0x20543e[_0xb3f4('0x40')]['id']}})['then'](handleEntityNotFound(_0x424eb7,null))['then'](saveUpdates(_0x20543e[_0xb3f4('0x48')],null))[_0xb3f4('0x22')](respondWithResult(_0x424eb7,null))['catch'](handleError(_0x424eb7,null));};exports[_0xb3f4('0x23')]=function(_0x57c739,_0xc087f3){return db[_0xb3f4('0x28')][_0xb3f4('0x44')]({'where':{'id':_0x57c739[_0xb3f4('0x40')]['id']}})['then'](handleEntityNotFound(_0xc087f3,null))[_0xb3f4('0x22')](removeEntity(_0xc087f3,null))[_0xb3f4('0x3f')](handleError(_0xc087f3,null));}; \ No newline at end of file +var _0x01d4=['error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','field','options','includeAll','include','CmCustomField','findAll','rows','catch','find','create','sequelize','transaction','body','update','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then'];(function(_0x1e84e3,_0x281bc1){var _0x487b5a=function(_0x512ae5){while(--_0x512ae5){_0x1e84e3['push'](_0x1e84e3['shift']());}};_0x487b5a(++_0x281bc1);}(_0x01d4,0x6e));var _0x401d=function(_0x39b44b,_0x1a3bb2){_0x39b44b=_0x39b44b-0x0;var _0xf21df2=_0x01d4[_0x39b44b];return _0xf21df2;};'use strict';var pdf=require(_0x401d('0x0'));var emlformat=require(_0x401d('0x1'));var rimraf=require(_0x401d('0x2'));var zipdir=require(_0x401d('0x3'));var jsonpatch=require(_0x401d('0x4'));var rp=require(_0x401d('0x5'));var moment=require(_0x401d('0x6'));var BPromise=require(_0x401d('0x7'));var Mustache=require(_0x401d('0x8'));var util=require(_0x401d('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x401d('0xa'));var ejs=require(_0x401d('0xb'));var fs=require('fs');var _=require(_0x401d('0xc'));var squel=require(_0x401d('0xd'));var crypto=require('crypto');var jsforce=require(_0x401d('0xe'));var deskjs=require(_0x401d('0xf'));var toCsv=require(_0x401d('0xa'));var querystring=require(_0x401d('0x10'));var Papa=require(_0x401d('0x11'));var Redis=require(_0x401d('0x12'));var authService=require(_0x401d('0x13'));var qs=require(_0x401d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x401d('0x15'));var utils=require(_0x401d('0x16'));var config=require(_0x401d('0x17'));var db=require(_0x401d('0x18'))['db'];function respondWithStatusCode(_0x2714ae,_0x33d4f1){_0x33d4f1=_0x33d4f1||0xcc;return function(_0x5c1341){if(_0x5c1341){return _0x2714ae[_0x401d('0x19')](_0x33d4f1);}return _0x2714ae['status'](_0x33d4f1)[_0x401d('0x1a')]();};}function respondWithResult(_0x1d315e,_0x5c6fc3){_0x5c6fc3=_0x5c6fc3||0xc8;return function(_0x535939){if(_0x535939){return _0x1d315e['status'](_0x5c6fc3)[_0x401d('0x1b')](_0x535939);}};}function respondWithFilteredResult(_0x2c730d,_0x5a99c0){return function(_0x464d27){if(_0x464d27){var _0x1a318d=_0x464d27[_0x401d('0x1c')],_0x150600=_0x5a99c0[_0x401d('0x1d')],_0x438ca9=_0x5a99c0[_0x401d('0x1d')]+_0x5a99c0[_0x401d('0x1e')],_0x1cc647;if(_0x438ca9>=_0x1a318d){_0x438ca9=_0x1a318d;_0x1cc647=0xc8;}else{_0x1cc647=0xce;}_0x2c730d[_0x401d('0x1f')](_0x1cc647);return _0x2c730d[_0x401d('0x20')](_0x401d('0x21'),_0x150600+'-'+_0x438ca9+'/'+_0x1a318d)[_0x401d('0x1b')](_0x464d27);}return null;};}function patchUpdates(_0x48c0cd){return function(_0x1d42be){try{jsonpatch[_0x401d('0x22')](_0x1d42be,_0x48c0cd,!![]);}catch(_0x5b6879){return BPromise[_0x401d('0x23')](_0x5b6879);}return _0x1d42be[_0x401d('0x24')]();};}function saveUpdates(_0x262c55,_0x11d890){return function(_0xecb589){if(_0xecb589){return _0xecb589['update'](_0x262c55)[_0x401d('0x25')](function(_0x2ac33d){return _0x2ac33d;});}return null;};}function removeEntity(_0x4b002a,_0x3941d3){return function(_0x6250e4){if(_0x6250e4){return _0x6250e4['destroy']()[_0x401d('0x25')](function(){_0x4b002a[_0x401d('0x1f')](0xcc)[_0x401d('0x1a')]();});}};}function handleEntityNotFound(_0x52cc38,_0x20bc0b){return function(_0x476de8){if(!_0x476de8){_0x52cc38[_0x401d('0x19')](0x194);}return _0x476de8;};}function handleError(_0x3bb783,_0x24a08c){_0x24a08c=_0x24a08c||0x1f4;return function(_0x3dd2d1){logger[_0x401d('0x26')](_0x3dd2d1['stack']);if(_0x3dd2d1[_0x401d('0x27')]){delete _0x3dd2d1[_0x401d('0x27')];}_0x3bb783['status'](_0x24a08c)[_0x401d('0x28')](_0x3dd2d1);};}exports[_0x401d('0x29')]=function(_0x55757c,_0x54a5ad){var _0x4b8ea4={},_0x5dc152={},_0x98110f={'count':0x0,'rows':[]};var _0x164f35=db['CmCustomField'][_0x401d('0x2a')];_0x5dc152[_0x401d('0x2b')]=_['differenceBy'](_['keys'](_0x164f35),[_0x401d('0x27')]);_0x5dc152['query']=_[_0x401d('0x2c')](_0x55757c[_0x401d('0x2d')]);_0x5dc152[_0x401d('0x2e')]=_[_0x401d('0x2f')](_0x5dc152['model'],_0x5dc152[_0x401d('0x2d')]);_0x4b8ea4[_0x401d('0x30')]=_['intersection'](_0x5dc152[_0x401d('0x2b')],qs['fields'](_0x55757c[_0x401d('0x2d')][_0x401d('0x31')]));_0x4b8ea4[_0x401d('0x30')]=_0x4b8ea4[_0x401d('0x30')]['length']?_0x4b8ea4[_0x401d('0x30')]:_0x5dc152[_0x401d('0x2b')];if(!_0x55757c['query'][_0x401d('0x32')](_0x401d('0x33'))){_0x4b8ea4[_0x401d('0x1e')]=qs[_0x401d('0x1e')](_0x55757c['query'][_0x401d('0x1e')]);_0x4b8ea4[_0x401d('0x1d')]=qs['offset'](_0x55757c[_0x401d('0x2d')][_0x401d('0x1d')]);}_0x4b8ea4['order']=qs[_0x401d('0x34')](_0x55757c['query'][_0x401d('0x34')]);_0x4b8ea4[_0x401d('0x35')]=qs['filters'](_['pick'](_0x55757c['query'],_0x5dc152[_0x401d('0x2e')]));if(_0x55757c['query'][_0x401d('0x36')]){_0x4b8ea4[_0x401d('0x35')]=_[_0x401d('0x37')](_0x4b8ea4['where'],{'$or':_[_0x401d('0x38')](_0x164f35,function(_0x4b1cc1){if(_0x4b1cc1[_0x401d('0x39')]['key']!=='VIRTUAL'){var _0x2c38d9={};_0x2c38d9[_0x4b1cc1[_0x401d('0x3a')]]={'$like':'%'+_0x55757c[_0x401d('0x2d')][_0x401d('0x36')]+'%'};return _0x2c38d9;}})});}_0x4b8ea4=_[_0x401d('0x37')]({},_0x4b8ea4,_0x55757c[_0x401d('0x3b')]);var _0x4bd651={'where':_0x4b8ea4['where']};return db['CmCustomField'][_0x401d('0x1c')](_0x4bd651)['then'](function(_0x4385a9){_0x98110f[_0x401d('0x1c')]=_0x4385a9;if(_0x55757c[_0x401d('0x2d')][_0x401d('0x3c')]){_0x4b8ea4[_0x401d('0x3d')]=[{'all':!![]}];}return db[_0x401d('0x3e')][_0x401d('0x3f')](_0x4b8ea4);})[_0x401d('0x25')](function(_0x18f7d0){_0x98110f[_0x401d('0x40')]=_0x18f7d0;return _0x98110f;})[_0x401d('0x25')](respondWithFilteredResult(_0x54a5ad,_0x4b8ea4))[_0x401d('0x41')](handleError(_0x54a5ad,null));};exports['show']=function(_0x184eef,_0x429184){var _0x5d78c5={'raw':!![],'where':{'id':_0x184eef['params']['id']}},_0x55edfd={};_0x55edfd[_0x401d('0x2b')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x55edfd[_0x401d('0x2d')]=_[_0x401d('0x2c')](_0x184eef[_0x401d('0x2d')]);_0x55edfd[_0x401d('0x2e')]=_[_0x401d('0x2f')](_0x55edfd['model'],_0x55edfd[_0x401d('0x2d')]);_0x5d78c5[_0x401d('0x30')]=_[_0x401d('0x2f')](_0x55edfd[_0x401d('0x2b')],qs[_0x401d('0x31')](_0x184eef[_0x401d('0x2d')][_0x401d('0x31')]));_0x5d78c5['attributes']=_0x5d78c5[_0x401d('0x30')]['length']?_0x5d78c5[_0x401d('0x30')]:_0x55edfd[_0x401d('0x2b')];if(_0x184eef[_0x401d('0x2d')][_0x401d('0x3c')]){_0x5d78c5[_0x401d('0x3d')]=[{'all':!![]}];}_0x5d78c5=_[_0x401d('0x37')]({},_0x5d78c5,_0x184eef[_0x401d('0x3b')]);return db[_0x401d('0x3e')][_0x401d('0x42')](_0x5d78c5)[_0x401d('0x25')](handleEntityNotFound(_0x429184,null))['then'](respondWithResult(_0x429184,null))[_0x401d('0x41')](handleError(_0x429184,null));};exports[_0x401d('0x43')]=function(_0x444b74,_0x2ee5f1){return db[_0x401d('0x44')][_0x401d('0x45')](function(_0x312f9a){return db[_0x401d('0x3e')]['create'](_0x444b74[_0x401d('0x46')],{'transaction':_0x312f9a});})[_0x401d('0x25')](respondWithResult(_0x2ee5f1,0xc9))[_0x401d('0x41')](handleError(_0x2ee5f1,null));};exports[_0x401d('0x47')]=function(_0x2b55c1,_0x145092){if(_0x2b55c1[_0x401d('0x46')]['id']){delete _0x2b55c1[_0x401d('0x46')]['id'];}return db[_0x401d('0x3e')][_0x401d('0x42')]({'where':{'id':_0x2b55c1[_0x401d('0x48')]['id']}})['then'](handleEntityNotFound(_0x145092,null))['then'](saveUpdates(_0x2b55c1[_0x401d('0x46')],null))[_0x401d('0x25')](respondWithResult(_0x145092,null))[_0x401d('0x41')](handleError(_0x145092,null));};exports[_0x401d('0x49')]=function(_0x29858f,_0x26ae91){return db[_0x401d('0x3e')]['find']({'where':{'id':_0x29858f['params']['id']}})['then'](handleEntityNotFound(_0x26ae91,null))[_0x401d('0x25')](removeEntity(_0x26ae91,null))[_0x401d('0x41')](handleError(_0x26ae91,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 46c6eb8..ab2f3fe 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 _0xcb7b=['switch','BOOLEAN','defaultValue','addColumn','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','get','transaction','type','text','TEXT','number','INTEGER'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xcb7b,0x1a6));var _0xbcb7=function(_0x4933b6,_0xbf6409){_0x4933b6=_0x4933b6-0x0;var _0x1501f2=_0xcb7b[_0x4933b6];return _0x1501f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbcb7('0x0'));var BPromise=require('bluebird');var rp=require(_0xbcb7('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcb7('0x2'));var config=require(_0xbcb7('0x3'));var attributes=require(_0xbcb7('0x4'));module[_0xbcb7('0x5')]=function(_0x4d199c,_0x970591){return _0x4d199c[_0xbcb7('0x6')](_0xbcb7('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29b3f7,_0x4a6623,_0x28659f){var _0xea2864=_0x29b3f7[_0xbcb7('0x8')]({'plain':!![]});var _0xe4d5ba={'type':_0x970591['TEXT'],'transaction':_0x4a6623[_0xbcb7('0x9')]};switch(_0xea2864[_0xbcb7('0xa')]){case _0xbcb7('0xb'):_0xe4d5ba[_0xbcb7('0xa')]=_0x970591[_0xbcb7('0xc')];break;case _0xbcb7('0xd'):_0xe4d5ba['type']=_0x970591[_0xbcb7('0xe')];break;case _0xbcb7('0xf'):_0xe4d5ba['type']=_0x970591[_0xbcb7('0x10')];_0xe4d5ba[_0xbcb7('0x11')]=![];break;}_0x4d199c['queryInterface'][_0xbcb7('0x12')]('cm_contacts',util['format']('cf_%d',_0xea2864['id']),_0xe4d5ba);_0x28659f();}}});}; \ No newline at end of file +var _0x7845=['exports','define','get','transaction','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x52ac78,_0xf5a50c){var _0x4a9f09=function(_0x202619){while(--_0x202619){_0x52ac78['push'](_0x52ac78['shift']());}};_0x4a9f09(++_0xf5a50c);}(_0x7845,0xc5));var _0x5784=function(_0x55c338,_0x31fcdf){_0x55c338=_0x55c338-0x0;var _0x1c1016=_0x7845[_0x55c338];return _0x1c1016;};'use strict';var _=require(_0x5784('0x0'));var util=require(_0x5784('0x1'));var logger=require(_0x5784('0x2'))(_0x5784('0x3'));var moment=require(_0x5784('0x4'));var BPromise=require(_0x5784('0x5'));var rp=require(_0x5784('0x6'));var fs=require('fs');var path=require(_0x5784('0x7'));var rimraf=require(_0x5784('0x8'));var config=require(_0x5784('0x9'));var attributes=require(_0x5784('0xa'));module[_0x5784('0xb')]=function(_0x2064f1,_0x5e35e5){return _0x2064f1[_0x5784('0xc')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a10ac,_0x2509b8,_0x523ad3){var _0x34b619=_0x2a10ac[_0x5784('0xd')]({'plain':!![]});var _0x17d111={'type':_0x5e35e5['TEXT'],'transaction':_0x2509b8[_0x5784('0xe')]};switch(_0x34b619[_0x5784('0xf')]){case _0x5784('0x10'):_0x17d111[_0x5784('0xf')]=_0x5e35e5['TEXT'];break;case _0x5784('0x11'):_0x17d111[_0x5784('0xf')]=_0x5e35e5[_0x5784('0x12')];break;case _0x5784('0x13'):_0x17d111[_0x5784('0xf')]=_0x5e35e5[_0x5784('0x14')];_0x17d111[_0x5784('0x15')]=![];break;}_0x2064f1[_0x5784('0x16')]['addColumn'](_0x5784('0x17'),util[_0x5784('0x18')](_0x5784('0x19'),_0x34b619['id']),_0x17d111);_0x523ad3();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 7cbfb29..8d1208b 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 _0xc1fe=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmCustomField,\x20%s,\x20%s','info','result','message'];(function(_0x3a0783,_0x1506e6){var _0x629c72=function(_0x284953){while(--_0x284953){_0x3a0783['push'](_0x3a0783['shift']());}};_0x629c72(++_0x1506e6);}(_0xc1fe,0xb1));var _0xec1f=function(_0x86bf3a,_0x56fa58){_0x86bf3a=_0x86bf3a-0x0;var _0x4ce973=_0xc1fe[_0x86bf3a];return _0x4ce973;};'use strict';var _=require(_0xec1f('0x0'));var util=require(_0xec1f('0x1'));var moment=require(_0xec1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec1f('0x3'));var fs=require('fs');var Redis=require(_0xec1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec1f('0x5'));var logger=require(_0xec1f('0x6'))(_0xec1f('0x7'));var config=require(_0xec1f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4a62,_0x3444d8,_0x2bb418){return new BPromise(function(_0x3ecf29,_0x59e510){return client[_0xec1f('0xa')](_0x3e4a62,_0x2bb418)[_0xec1f('0xb')](function(_0x13e243){logger['info']('CmCustomField,\x20%s,\x20%s',_0x3444d8,'request\x20sent');logger[_0xec1f('0xc')](_0xec1f('0xd'),_0x3444d8,_0xec1f('0xe'),JSON['stringify'](_0x13e243));if(_0x13e243[_0xec1f('0xf')]){if(_0x13e243['error'][_0xec1f('0x10')]===0x1f4){logger['error'](_0xec1f('0x11'),_0x3444d8,_0x13e243[_0xec1f('0xf')]['message']);return _0x59e510(_0x13e243[_0xec1f('0xf')]['message']);}logger[_0xec1f('0xf')](_0xec1f('0x11'),_0x3444d8,_0x13e243[_0xec1f('0xf')]['message']);return _0x3ecf29(_0x13e243[_0xec1f('0xf')]['message']);}else{logger[_0xec1f('0x12')]('CmCustomField,\x20%s,\x20%s',_0x3444d8,_0xec1f('0xe'));_0x3ecf29(_0x13e243[_0xec1f('0x13')][_0xec1f('0x14')]);}})[_0xec1f('0x15')](function(_0x29dda8){logger[_0xec1f('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3444d8,_0x29dda8);_0x59e510(_0x29dda8);});});} \ No newline at end of file +var _0x5c68=['request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x5c68,0x14d));var _0x85c6=function(_0x33aa8d,_0x5d6fe2){_0x33aa8d=_0x33aa8d-0x0;var _0x314cf7=_0x5c68[_0x33aa8d];return _0x314cf7;};'use strict';var _=require(_0x85c6('0x0'));var util=require('util');var moment=require(_0x85c6('0x1'));var BPromise=require(_0x85c6('0x2'));var rs=require(_0x85c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85c6('0x4'))['db'];var utils=require(_0x85c6('0x5'));var logger=require(_0x85c6('0x6'))(_0x85c6('0x7'));var config=require(_0x85c6('0x8'));var jayson=require(_0x85c6('0x9'));var client=jayson[_0x85c6('0xa')][_0x85c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47cbe4,_0x498d11,_0x770217){return new BPromise(function(_0x69d956,_0xc2dde0){return client[_0x85c6('0xc')](_0x47cbe4,_0x770217)['then'](function(_0x4b607f){logger[_0x85c6('0xd')](_0x85c6('0xe'),_0x498d11,_0x85c6('0xf'));logger['debug'](_0x85c6('0x10'),_0x498d11,_0x85c6('0xf'),JSON[_0x85c6('0x11')](_0x4b607f));if(_0x4b607f[_0x85c6('0x12')]){if(_0x4b607f[_0x85c6('0x12')][_0x85c6('0x13')]===0x1f4){logger['error'](_0x85c6('0xe'),_0x498d11,_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);return _0xc2dde0(_0x4b607f['error'][_0x85c6('0x14')]);}logger[_0x85c6('0x12')](_0x85c6('0xe'),_0x498d11,_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);return _0x69d956(_0x4b607f[_0x85c6('0x12')][_0x85c6('0x14')]);}else{logger[_0x85c6('0xd')]('CmCustomField,\x20%s,\x20%s',_0x498d11,_0x85c6('0xf'));_0x69d956(_0x4b607f[_0x85c6('0x15')][_0x85c6('0x14')]);}})[_0x85c6('0x16')](function(_0x68a2c7){logger[_0x85c6('0x12')](_0x85c6('0xe'),_0x498d11,_0x68a2c7);_0xc2dde0(_0x68a2c7);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 020e13e..bc941e0 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 _0x8ebb=['show','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2639e8,_0x432210){var _0x599369=function(_0x5cc0be){while(--_0x5cc0be){_0x2639e8['push'](_0x2639e8['shift']());}};_0x599369(++_0x432210);}(_0x8ebb,0xc2));var _0xb8eb=function(_0x30310e,_0x6d9691){_0x30310e=_0x30310e-0x0;var _0x3bdc2f=_0x8ebb[_0x30310e];return _0x3bdc2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb8eb('0x0'));var timeout=require(_0xb8eb('0x1'));var express=require(_0xb8eb('0x2'));var router=express[_0xb8eb('0x3')]();var auth=require(_0xb8eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb8eb('0x5'));var controller=require('./cmCustomField.controller');router[_0xb8eb('0x6')]('/',auth['isAuthenticated'](),controller[_0xb8eb('0x7')]);router[_0xb8eb('0x6')](_0xb8eb('0x8'),auth[_0xb8eb('0x9')](),controller[_0xb8eb('0xa')]);router[_0xb8eb('0xb')]('/',auth[_0xb8eb('0x9')](),controller[_0xb8eb('0xc')]);router[_0xb8eb('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb8eb('0xe')](_0xb8eb('0x8'),auth['isAuthenticated'](),controller[_0xb8eb('0xf')]);module[_0xb8eb('0x10')]=router; \ No newline at end of file +var _0x2a93=['create','put','update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x40a6b5,_0x2ef12f){var _0x4bab77=function(_0x303e52){while(--_0x303e52){_0x40a6b5['push'](_0x40a6b5['shift']());}};_0x4bab77(++_0x2ef12f);}(_0x2a93,0xfd));var _0x32a9=function(_0x7a9abb,_0x57ea72){_0x7a9abb=_0x7a9abb-0x0;var _0xd04225=_0x2a93[_0x7a9abb];return _0xd04225;};'use strict';var multer=require('multer');var util=require(_0x32a9('0x0'));var path=require(_0x32a9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x32a9('0x2')]();var auth=require(_0x32a9('0x3'));var interaction=require(_0x32a9('0x4'));var config=require(_0x32a9('0x5'));var controller=require(_0x32a9('0x6'));router[_0x32a9('0x7')]('/',auth[_0x32a9('0x8')](),controller[_0x32a9('0x9')]);router[_0x32a9('0x7')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0xb')]);router[_0x32a9('0xc')]('/',auth['isAuthenticated'](),controller[_0x32a9('0xd')]);router[_0x32a9('0xe')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0xf')]);router[_0x32a9('0x10')](_0x32a9('0xa'),auth[_0x32a9('0x8')](),controller[_0x32a9('0x11')]);module[_0x32a9('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 06e5661..707a03f 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 _0xe395=['contactListQueue','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xe395,0x1f0));var _0x5e39=function(_0x1798f7,_0x6e19c0){_0x1798f7=_0x1798f7-0x0;var _0x71610b=_0xe395[_0x1798f7];return _0x71610b;};'use strict';var moment=require('moment');var Sequelize=require(_0x5e39('0x0'));module[_0x5e39('0x1')]={'phone':{'type':Sequelize[_0x5e39('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5e39('0x3')],'defaultValue':moment()['format'](_0x5e39('0x4'))},'countbusyretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5e39('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5e39('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5e39('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5e39('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5e39('0x8')},'ListId':{'type':Sequelize[_0x5e39('0x5')],'unique':_0x5e39('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5e39('0x5')],'unique':_0x5e39('0x8')},'CampaignId':{'type':Sequelize[_0x5e39('0x5')]}}; \ No newline at end of file +var _0xbdd9=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','STRING','contactListQueue','moment','sequelize','exports','DATE','format'];(function(_0xd4cc66,_0x10c57f){var _0x17fbef=function(_0x205d60){while(--_0x205d60){_0xd4cc66['push'](_0xd4cc66['shift']());}};_0x17fbef(++_0x10c57f);}(_0xbdd9,0xc3));var _0x9bdd=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xbdd9[_0x240261];return _0x45c332;};'use strict';var moment=require(_0x9bdd('0x0'));var Sequelize=require(_0x9bdd('0x1'));module[_0x9bdd('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9bdd('0x3')],'defaultValue':moment()[_0x9bdd('0x4')](_0x9bdd('0x5'))},'countbusyretry':{'type':Sequelize[_0x9bdd('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9bdd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9bdd('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9bdd('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9bdd('0x3')]},'priority':{'type':Sequelize[_0x9bdd('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9bdd('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9bdd('0x9')},'ListId':{'type':Sequelize[_0x9bdd('0x6')],'unique':_0x9bdd('0x9')},'UserId':{'type':Sequelize[_0x9bdd('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 69a4754..6b8b31c 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 _0xb974=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','error','stack','name','send','index','rawAttributes','model','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','CmHopper','then','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','updatedAt','state','statedesc','campaign','user','UserId','deleted','deletedat','format','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','UPDATE','Contact','CmList','List','VoiceQueue','Queue','dialActive','getVoiceQueues','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x20550f,_0x4e5fba){var _0x2d3cee=function(_0x4c4bbf){while(--_0x4c4bbf){_0x20550f['push'](_0x20550f['shift']());}};_0x2d3cee(++_0x4e5fba);}(_0xb974,0x111));var _0x4b97=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb974[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x4b97('0x0'));var emlformat=require(_0x4b97('0x1'));var rimraf=require(_0x4b97('0x2'));var zipdir=require(_0x4b97('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b97('0x4'));var moment=require(_0x4b97('0x5'));var BPromise=require(_0x4b97('0x6'));var Mustache=require(_0x4b97('0x7'));var util=require('util');var path=require(_0x4b97('0x8'));var sox=require(_0x4b97('0x9'));var csv=require('to-csv');var ejs=require(_0x4b97('0xa'));var fs=require('fs');var _=require(_0x4b97('0xb'));var squel=require('squel');var crypto=require(_0x4b97('0xc'));var jsforce=require(_0x4b97('0xd'));var deskjs=require(_0x4b97('0xe'));var toCsv=require(_0x4b97('0xf'));var querystring=require(_0x4b97('0x10'));var Papa=require(_0x4b97('0x11'));var Redis=require(_0x4b97('0x12'));var authService=require(_0x4b97('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4b97('0x14'));var logger=require(_0x4b97('0x15'))(_0x4b97('0x16'));var utils=require(_0x4b97('0x17'));var config=require(_0x4b97('0x18'));var db=require(_0x4b97('0x19'))['db'];function respondWithStatusCode(_0x40e1f5,_0x386c10){_0x386c10=_0x386c10||0xcc;return function(_0x3caedc){if(_0x3caedc){return _0x40e1f5[_0x4b97('0x1a')](_0x386c10);}return _0x40e1f5[_0x4b97('0x1b')](_0x386c10)[_0x4b97('0x1c')]();};}function respondWithResult(_0x26fee7,_0x1a5b06){_0x1a5b06=_0x1a5b06||0xc8;return function(_0x5719fe){if(_0x5719fe){return _0x26fee7[_0x4b97('0x1b')](_0x1a5b06)[_0x4b97('0x1d')](_0x5719fe);}};}function respondWithFilteredResult(_0x3f41de,_0x292f70){return function(_0x18afa3){if(_0x18afa3){var _0x157961=_0x18afa3[_0x4b97('0x1e')],_0x3e26b9=_0x292f70[_0x4b97('0x1f')],_0x935e66=_0x292f70[_0x4b97('0x1f')]+_0x292f70[_0x4b97('0x20')],_0x5ee022;if(_0x935e66>=_0x157961){_0x935e66=_0x157961;_0x5ee022=0xc8;}else{_0x5ee022=0xce;}_0x3f41de['status'](_0x5ee022);return _0x3f41de[_0x4b97('0x21')](_0x4b97('0x22'),_0x3e26b9+'-'+_0x935e66+'/'+_0x157961)[_0x4b97('0x1d')](_0x18afa3);}return null;};}function patchUpdates(_0x1ed78b){return function(_0x2fba2f){try{jsonpatch['apply'](_0x2fba2f,_0x1ed78b,!![]);}catch(_0x593864){return BPromise['reject'](_0x593864);}return _0x2fba2f[_0x4b97('0x23')]();};}function saveUpdates(_0x4b82f7,_0x51315e){return function(_0x121cb5){if(_0x121cb5){return _0x121cb5['update'](_0x4b82f7)['then'](function(_0x14dcb1){return _0x14dcb1;});}return null;};}function removeEntity(_0x59c2d4,_0x39ed9a){return function(_0x1dd332){if(_0x1dd332){return _0x1dd332[_0x4b97('0x24')]()['then'](function(){_0x59c2d4['status'](0xcc)[_0x4b97('0x1c')]();});}};}function handleEntityNotFound(_0x3be3c0,_0x57baa5){return function(_0x1b8875){if(!_0x1b8875){_0x3be3c0['sendStatus'](0x194);}return _0x1b8875;};}function handleError(_0x33e9c6,_0x53b4db){_0x53b4db=_0x53b4db||0x1f4;return function(_0x21e400){logger[_0x4b97('0x25')](_0x21e400[_0x4b97('0x26')]);if(_0x21e400[_0x4b97('0x27')]){delete _0x21e400['name'];}_0x33e9c6['status'](_0x53b4db)[_0x4b97('0x28')](_0x21e400);};}exports[_0x4b97('0x29')]=function(_0x2f463f,_0x1806f8){var _0x32624b={},_0x216c68={},_0x1d678f={'count':0x0,'rows':[]};var _0x428261=db['CmHopper'][_0x4b97('0x2a')];_0x216c68[_0x4b97('0x2b')]=_['keys'](_0x428261);_0x216c68[_0x4b97('0x2c')]=_['keys'](_0x2f463f['query']);_0x216c68[_0x4b97('0x2d')]=_[_0x4b97('0x2e')](_0x216c68['model'],_0x216c68[_0x4b97('0x2c')]);_0x216c68[_0x4b97('0x2d')]=_[_0x4b97('0x2f')](_0x216c68[_0x4b97('0x2d')],[_0x4b97('0x30'),_0x4b97('0x31'),_0x4b97('0x32'),_0x4b97('0x33'),'$lt',_0x4b97('0x34'),_0x4b97('0x35'),_0x4b97('0x36'),_0x4b97('0x37'),_0x4b97('0x38'),_0x4b97('0x39'),_0x4b97('0x3a'),_0x4b97('0x3b'),'$like',_0x4b97('0x3c'),_0x4b97('0x3d'),'$notILike','$like',_0x4b97('0x3e'),_0x4b97('0x3f'),_0x4b97('0x40'),_0x4b97('0x41')]);_0x32624b[_0x4b97('0x42')]=_['intersection'](_0x216c68[_0x4b97('0x2b')],qs[_0x4b97('0x43')](_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x43')]));_0x32624b[_0x4b97('0x42')]=_0x32624b[_0x4b97('0x42')][_0x4b97('0x44')]?_0x32624b[_0x4b97('0x42')]:_0x216c68['model'];if(!_0x2f463f['query'][_0x4b97('0x45')](_0x4b97('0x46'))){_0x32624b[_0x4b97('0x20')]=qs[_0x4b97('0x20')](_0x2f463f[_0x4b97('0x2c')]['limit']);_0x32624b[_0x4b97('0x1f')]=qs[_0x4b97('0x1f')](_0x2f463f[_0x4b97('0x2c')]['offset']);}_0x32624b['order']=qs['sort'](_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x47')]);_0x32624b[_0x4b97('0x48')]=qs[_0x4b97('0x2d')](_[_0x4b97('0x49')](_0x2f463f['query'],_0x216c68[_0x4b97('0x2d')]));if(_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x4a')]){_0x32624b['where']=_[_0x4b97('0x4b')](_0x32624b[_0x4b97('0x48')],{'$or':_[_0x4b97('0x4c')](_0x428261,function(_0x34217a){if(_0x34217a[_0x4b97('0x4d')][_0x4b97('0x4e')]!=='VIRTUAL'){var _0x965b1={};_0x965b1[_0x34217a['field']]={'$like':'%'+_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x4a')]+'%'};return _0x965b1;}})});}_0x32624b=_['merge']({},_0x32624b,_0x2f463f['options']);var _0x3d82e9={'where':_0x32624b[_0x4b97('0x48')]};return db[_0x4b97('0x4f')][_0x4b97('0x1e')](_0x3d82e9)[_0x4b97('0x50')](function(_0x402a86){_0x1d678f[_0x4b97('0x1e')]=_0x402a86;if(_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x51')]){_0x32624b[_0x4b97('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x4b97('0x53')](_0x32624b);})[_0x4b97('0x50')](function(_0x48c60e){_0x1d678f[_0x4b97('0x54')]=_0x48c60e;return _0x1d678f;})[_0x4b97('0x50')](respondWithFilteredResult(_0x1806f8,_0x32624b))[_0x4b97('0x55')](handleError(_0x1806f8,null));};exports[_0x4b97('0x56')]=function(_0x275732,_0x4054ba){var _0x50cbda={'raw':!![],'where':{'id':_0x275732[_0x4b97('0x57')]['id']}},_0xecb6ac={};_0xecb6ac['model']=_[_0x4b97('0x58')](db[_0x4b97('0x4f')][_0x4b97('0x2a')]);_0xecb6ac[_0x4b97('0x2c')]=_[_0x4b97('0x58')](_0x275732[_0x4b97('0x2c')]);_0xecb6ac[_0x4b97('0x2d')]=_[_0x4b97('0x2e')](_0xecb6ac[_0x4b97('0x2b')],_0xecb6ac[_0x4b97('0x2c')]);_0x50cbda[_0x4b97('0x42')]=_['intersection'](_0xecb6ac['model'],qs[_0x4b97('0x43')](_0x275732[_0x4b97('0x2c')][_0x4b97('0x43')]));_0x50cbda[_0x4b97('0x42')]=_0x50cbda[_0x4b97('0x42')][_0x4b97('0x44')]?_0x50cbda['attributes']:_0xecb6ac[_0x4b97('0x2b')];if(_0x275732['query'][_0x4b97('0x51')]){_0x50cbda[_0x4b97('0x52')]=[{'all':!![]}];}_0x50cbda=_[_0x4b97('0x4b')]({},_0x50cbda,_0x275732[_0x4b97('0x59')]);return db[_0x4b97('0x4f')][_0x4b97('0x5a')](_0x50cbda)[_0x4b97('0x50')](handleEntityNotFound(_0x4054ba,null))[_0x4b97('0x50')](respondWithResult(_0x4054ba,null))[_0x4b97('0x55')](handleError(_0x4054ba,null));};exports[_0x4b97('0x5b')]=function(_0x5ec0a8,_0x48cbc7){return db[_0x4b97('0x4f')]['create'](_0x5ec0a8[_0x4b97('0x5c')],{})['then'](respondWithResult(_0x48cbc7,0xc9))[_0x4b97('0x55')](handleError(_0x48cbc7,null));};exports[_0x4b97('0x5d')]=function(_0x1eb83b,_0x450b39){if(_0x1eb83b[_0x4b97('0x5c')]['id']){delete _0x1eb83b[_0x4b97('0x5c')]['id'];}return db[_0x4b97('0x4f')]['find']({'where':{'id':_0x1eb83b[_0x4b97('0x57')]['id']}})[_0x4b97('0x50')](handleEntityNotFound(_0x450b39,null))[_0x4b97('0x50')](saveUpdates(_0x1eb83b[_0x4b97('0x5c')],null))[_0x4b97('0x50')](respondWithResult(_0x450b39,null))[_0x4b97('0x55')](handleError(_0x450b39,null));};exports[_0x4b97('0x5e')]=function(_0x4eecdc,_0x30b3dd){return db[_0x4b97('0x4f')]['describe']()['then'](respondWithResult(_0x30b3dd,null))[_0x4b97('0x55')](handleError(_0x30b3dd,null));};exports[_0x4b97('0x24')]=function(_0x45af83,_0x1a654b){var _0x15eef5;return db['CmHopper'][_0x4b97('0x5a')]({'where':{'id':_0x45af83['params']['id']}})[_0x4b97('0x50')](handleEntityNotFound(_0x1a654b,null))[_0x4b97('0x50')](function(_0x4462c0){if(_0x4462c0){return _0x4462c0[_0x4b97('0x24')]()['then'](function(_0xb625fa){return _0xb625fa;});}})[_0x4b97('0x50')](function(_0x1faaf6){_0x15eef5=_0x1faaf6;if(_0x1faaf6){if(_0x1faaf6[_0x4b97('0x5f')]||_0x1faaf6[_0x4b97('0x60')]){return db[_0x1faaf6[_0x4b97('0x5f')]?'VoiceQueue':_0x4b97('0x61')][_0x4b97('0x5a')]({'where':{'id':_0x1faaf6['VoiceQueueId']?_0x1faaf6[_0x4b97('0x5f')]:_0x1faaf6['CampaignId']},'attributes':['id',_0x4b97('0x27')],'raw':!![]});}}})[_0x4b97('0x50')](function(_0x122cf4){var _0x47083d={};if(_0x122cf4){_[_0x4b97('0x4b')](_0x47083d,_[_0x4b97('0x62')](_0x15eef5[_0x4b97('0x63')],['createdAt',_0x4b97('0x64'),'id']));_0x47083d[_0x4b97('0x65')]=0x15;_0x47083d[_0x4b97('0x66')]='deleted';_0x47083d[_0x4b97('0x67')]=_0x122cf4[_0x4b97('0x27')];_0x47083d['membername']=_0x45af83[_0x4b97('0x68')][_0x4b97('0x27')];_0x47083d[_0x4b97('0x69')]=_0x45af83[_0x4b97('0x68')]['id'];_0x47083d[_0x4b97('0x6a')]=!![];_0x47083d[_0x4b97('0x6b')]=moment()[_0x4b97('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x47083d[_0x4b97('0x6d')]=_0x15eef5['phone'];_0x47083d[_0x4b97('0x6e')]=_0x15eef5[_0x4b97('0x5f')]?_0x4b97('0x6f'):_0x4b97('0x70');return db[_0x4b97('0x71')]['find']({'where':{'id':_0x47083d['ContactId']},'attributes':[_0x4b97('0x72'),_0x4b97('0x73')]})[_0x4b97('0x50')](function(_0x17bd43){if(!_['isNil'](_0x1a654b)&&!_[_0x4b97('0x74')](_0x17bd43[_0x4b97('0x72')])){_0x47083d[_0x4b97('0x75')]=_0x17bd43[_0x4b97('0x72')];if(!_[_0x4b97('0x74')](_0x17bd43[_0x4b97('0x73')])){_0x47083d[_0x4b97('0x75')]+='\x20'+_0x17bd43[_0x4b97('0x73')];}}})[_0x4b97('0x76')](function(){return db['CmHopperFinal'][_0x4b97('0x5b')](_0x47083d);});}})[_0x4b97('0x50')](function(){return _0x1a654b[_0x4b97('0x1b')](0xcc)['end']();})[_0x4b97('0x55')](handleError(_0x1a654b,null));};exports['getPreview']=function(_0x30eb04,_0x421d37,_0x1e98f7){var _0x331c42=[];return db[_0x4b97('0x71')]['describe']()['then'](function(_0x3620b7){_0x331c42=_['keys'](_0x3620b7);return _0x30eb04[_0x4b97('0x68')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x4b97('0x50')](function(_0x28f443){if(_0x28f443&&_0x28f443[_0x4b97('0x44')]){return db[_0x4b97('0x77')][_0x4b97('0x78')](function(_0x5011e4){var _0x2d871c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x4b97('0x79'))},'VoiceQueueId':{'$in':_[_0x4b97('0x4c')](_0x28f443,'id')},'$or':[{'UserId':null},{'UserId':_0x30eb04[_0x4b97('0x68')]['id']}]};var _0x1b4e34=[];if(_0x30eb04['body'][_0x4b97('0x7a')]&&_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7a')]==='prev'){if(!_[_0x4b97('0x7b')](_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')])){_0x2d871c['id']={'$in':_0x30eb04['body'][_0x4b97('0x7c')]};}_0x1b4e34=[[_0x4b97('0x7d'),_0x4b97('0x7e')],[_0x4b97('0x7f'),_0x28f443[0x0][_0x4b97('0x80')]===_0x4b97('0x7e')?_0x4b97('0x81'):'ASC'],db[_0x4b97('0x77')][_0x4b97('0x82')](_0x4b97('0x83')),['id',_0x4b97('0x81')]];}else{if(!_[_0x4b97('0x7b')](_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')])){_0x2d871c['id']={'$notIn':_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')]};}_0x1b4e34=[['priority',_0x4b97('0x81')],[_0x4b97('0x7f'),_0x28f443[0x0][_0x4b97('0x80')]],db[_0x4b97('0x77')][_0x4b97('0x82')](_0x4b97('0x84')),['id',_0x4b97('0x7e')]];}return db[_0x4b97('0x4f')]['findOne']({'attributes':['id','scheduledat'],'where':_0x2d871c,'order':_0x1b4e34,'transaction':_0x5011e4,'lock':_0x5011e4['LOCK'][_0x4b97('0x85')],'include':[{'model':db['CmContact'],'as':_0x4b97('0x86'),'attributes':_0x331c42,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x4b97('0x87')],'as':_0x4b97('0x88'),'attributes':['id',_0x4b97('0x27')]},{'model':db[_0x4b97('0x89')],'as':_0x4b97('0x8a'),'attributes':['id',_0x4b97('0x27'),_0x4b97('0x8b')]}]})[_0x4b97('0x50')](function(_0x4f6371){if(_0x4f6371){return _0x4f6371[_0x4b97('0x5d')]({'UserId':_0x30eb04[_0x4b97('0x68')]['id']},{'transaction':_0x5011e4});}});});}})[_0x4b97('0x50')](handleEntityNotFound(_0x421d37,null))['then'](respondWithResult(_0x421d37,null))[_0x4b97('0x55')](handleError(_0x421d37,null));};exports['getOpenContacts']=function(_0x2de146,_0x45ea38,_0x507fbb){return _0x2de146['user'][_0x4b97('0x8c')]({'where':{'type':_0x4b97('0x8d'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x4b97('0x50')](function(_0x2e455a){if(_0x2e455a&&_0x2e455a[_0x4b97('0x44')]){return db['CmHopper'][_0x4b97('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4b97('0x6c')](_0x4b97('0x79'))},'VoiceQueueId':{'$in':_[_0x4b97('0x4c')](_0x2e455a,'id')},'$or':[{'UserId':null},{'UserId':_0x2de146['user']['id']}]}});}return 0x0;})[_0x4b97('0x50')](function(_0x4c3d78){if(!_[_0x4b97('0x74')](_0x4c3d78)&&_[_0x4b97('0x8e')](_0x4c3d78)){return _0x45ea38[_0x4b97('0x1b')](0xc8)[_0x4b97('0x1d')]({'contacts':_0x4c3d78});}else{logger[_0x4b97('0x25')](_0x4b97('0x8f'),_0x4b97('0x90'),0x194,_0x4b97('0x91'));_0x45ea38[_0x4b97('0x1a')](0x194);}})['catch'](handleError(_0x45ea38,null));}; \ No newline at end of file +var _0x966b=['literal','findOne','scheduledat','LOCK','UPDATE','Contact','List','VoiceQueue','Queue','dialActive','outbound','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','end','json','count','offset','limit','status','apply','save','update','then','destroy','stack','send','index','CmHopper','rawAttributes','model','keys','query','filters','concat','$gt','$lt','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','name','omit','dataValues','createdAt','updatedAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x966b,0x120));var _0xb966=function(_0x99d9ea,_0x14baff){_0x99d9ea=_0x99d9ea-0x0;var _0x23ae97=_0x966b[_0x99d9ea];return _0x23ae97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb966('0x0'));var jsonpatch=require(_0xb966('0x1'));var rp=require(_0xb966('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb966('0x3'));var util=require('util');var path=require(_0xb966('0x4'));var sox=require('sox');var csv=require(_0xb966('0x5'));var ejs=require(_0xb966('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb966('0x7'));var crypto=require(_0xb966('0x8'));var jsforce=require(_0xb966('0x9'));var deskjs=require(_0xb966('0xa'));var toCsv=require(_0xb966('0x5'));var querystring=require(_0xb966('0xb'));var Papa=require(_0xb966('0xc'));var Redis=require('ioredis');var authService=require(_0xb966('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb966('0xe'));var logger=require('../../config/logger')(_0xb966('0xf'));var utils=require(_0xb966('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2befaf,_0x513965){_0x513965=_0x513965||0xcc;return function(_0x2dbdbd){if(_0x2dbdbd){return _0x2befaf[_0xb966('0x11')](_0x513965);}return _0x2befaf['status'](_0x513965)[_0xb966('0x12')]();};}function respondWithResult(_0x5dfbea,_0x5c778e){_0x5c778e=_0x5c778e||0xc8;return function(_0xc14ab){if(_0xc14ab){return _0x5dfbea['status'](_0x5c778e)[_0xb966('0x13')](_0xc14ab);}};}function respondWithFilteredResult(_0xf2953d,_0x404ec4){return function(_0x2499a9){if(_0x2499a9){var _0x56c8df=_0x2499a9[_0xb966('0x14')],_0x486ae1=_0x404ec4[_0xb966('0x15')],_0x42e861=_0x404ec4[_0xb966('0x15')]+_0x404ec4[_0xb966('0x16')],_0x189ef3;if(_0x42e861>=_0x56c8df){_0x42e861=_0x56c8df;_0x189ef3=0xc8;}else{_0x189ef3=0xce;}_0xf2953d[_0xb966('0x17')](_0x189ef3);return _0xf2953d['set']('Content-Range',_0x486ae1+'-'+_0x42e861+'/'+_0x56c8df)[_0xb966('0x13')](_0x2499a9);}return null;};}function patchUpdates(_0x173773){return function(_0x2cf541){try{jsonpatch[_0xb966('0x18')](_0x2cf541,_0x173773,!![]);}catch(_0x15848d){return BPromise['reject'](_0x15848d);}return _0x2cf541[_0xb966('0x19')]();};}function saveUpdates(_0x5d5956,_0x37e91e){return function(_0x2263d0){if(_0x2263d0){return _0x2263d0[_0xb966('0x1a')](_0x5d5956)[_0xb966('0x1b')](function(_0x37659b){return _0x37659b;});}return null;};}function removeEntity(_0x4c0a7e,_0x2370bb){return function(_0x4d054d){if(_0x4d054d){return _0x4d054d[_0xb966('0x1c')]()[_0xb966('0x1b')](function(){_0x4c0a7e['status'](0xcc)[_0xb966('0x12')]();});}};}function handleEntityNotFound(_0x4be77d,_0x55cb32){return function(_0x3fd9e8){if(!_0x3fd9e8){_0x4be77d[_0xb966('0x11')](0x194);}return _0x3fd9e8;};}function handleError(_0x2d9c9b,_0x51c3d7){_0x51c3d7=_0x51c3d7||0x1f4;return function(_0x364bb4){logger['error'](_0x364bb4[_0xb966('0x1d')]);if(_0x364bb4['name']){delete _0x364bb4['name'];}_0x2d9c9b['status'](_0x51c3d7)[_0xb966('0x1e')](_0x364bb4);};}exports[_0xb966('0x1f')]=function(_0x2dedf3,_0x42d074){var _0x9cf8c1={},_0x43a998={},_0x31d9d7={'count':0x0,'rows':[]};var _0x15a092=db[_0xb966('0x20')][_0xb966('0x21')];_0x43a998[_0xb966('0x22')]=_[_0xb966('0x23')](_0x15a092);_0x43a998[_0xb966('0x24')]=_[_0xb966('0x23')](_0x2dedf3[_0xb966('0x24')]);_0x43a998['filters']=_['intersection'](_0x43a998[_0xb966('0x22')],_0x43a998[_0xb966('0x24')]);_0x43a998[_0xb966('0x25')]=_[_0xb966('0x26')](_0x43a998[_0xb966('0x25')],['$and','$or',_0xb966('0x27'),'$gte',_0xb966('0x28'),_0xb966('0x29'),_0xb966('0x2a'),'$eq','$not',_0xb966('0x2b'),_0xb966('0x2c'),_0xb966('0x2d'),'$notIn',_0xb966('0x2e'),_0xb966('0x2f'),_0xb966('0x30'),_0xb966('0x31'),'$like','$overlap',_0xb966('0x32'),_0xb966('0x33'),_0xb966('0x34')]);_0x9cf8c1[_0xb966('0x35')]=_[_0xb966('0x36')](_0x43a998['model'],qs['fields'](_0x2dedf3[_0xb966('0x24')][_0xb966('0x37')]));_0x9cf8c1[_0xb966('0x35')]=_0x9cf8c1['attributes'][_0xb966('0x38')]?_0x9cf8c1[_0xb966('0x35')]:_0x43a998['model'];if(!_0x2dedf3[_0xb966('0x24')][_0xb966('0x39')](_0xb966('0x3a'))){_0x9cf8c1[_0xb966('0x16')]=qs['limit'](_0x2dedf3['query']['limit']);_0x9cf8c1['offset']=qs['offset'](_0x2dedf3[_0xb966('0x24')][_0xb966('0x15')]);}_0x9cf8c1['order']=qs[_0xb966('0x3b')](_0x2dedf3['query'][_0xb966('0x3b')]);_0x9cf8c1[_0xb966('0x3c')]=qs[_0xb966('0x25')](_[_0xb966('0x3d')](_0x2dedf3[_0xb966('0x24')],_0x43a998[_0xb966('0x25')]));if(_0x2dedf3['query'][_0xb966('0x3e')]){_0x9cf8c1[_0xb966('0x3c')]=_[_0xb966('0x3f')](_0x9cf8c1[_0xb966('0x3c')],{'$or':_[_0xb966('0x40')](_0x15a092,function(_0x2becbd){if(_0x2becbd[_0xb966('0x41')][_0xb966('0x42')]!==_0xb966('0x43')){var _0x6eb94a={};_0x6eb94a[_0x2becbd[_0xb966('0x44')]]={'$like':'%'+_0x2dedf3['query'][_0xb966('0x3e')]+'%'};return _0x6eb94a;}})});}_0x9cf8c1=_[_0xb966('0x3f')]({},_0x9cf8c1,_0x2dedf3[_0xb966('0x45')]);var _0x194599={'where':_0x9cf8c1[_0xb966('0x3c')]};return db[_0xb966('0x20')][_0xb966('0x14')](_0x194599)[_0xb966('0x1b')](function(_0x4177cc){_0x31d9d7['count']=_0x4177cc;if(_0x2dedf3[_0xb966('0x24')][_0xb966('0x46')]){_0x9cf8c1[_0xb966('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xb966('0x48')](_0x9cf8c1);})[_0xb966('0x1b')](function(_0x301468){_0x31d9d7[_0xb966('0x49')]=_0x301468;return _0x31d9d7;})['then'](respondWithFilteredResult(_0x42d074,_0x9cf8c1))[_0xb966('0x4a')](handleError(_0x42d074,null));};exports['show']=function(_0x50b2eb,_0x126eee){var _0x1670f3={'raw':!![],'where':{'id':_0x50b2eb[_0xb966('0x4b')]['id']}},_0x57e971={};_0x57e971[_0xb966('0x22')]=_[_0xb966('0x23')](db[_0xb966('0x20')]['rawAttributes']);_0x57e971[_0xb966('0x24')]=_['keys'](_0x50b2eb[_0xb966('0x24')]);_0x57e971['filters']=_[_0xb966('0x36')](_0x57e971[_0xb966('0x22')],_0x57e971['query']);_0x1670f3[_0xb966('0x35')]=_['intersection'](_0x57e971[_0xb966('0x22')],qs[_0xb966('0x37')](_0x50b2eb['query'][_0xb966('0x37')]));_0x1670f3[_0xb966('0x35')]=_0x1670f3[_0xb966('0x35')][_0xb966('0x38')]?_0x1670f3[_0xb966('0x35')]:_0x57e971[_0xb966('0x22')];if(_0x50b2eb[_0xb966('0x24')][_0xb966('0x46')]){_0x1670f3[_0xb966('0x47')]=[{'all':!![]}];}_0x1670f3=_[_0xb966('0x3f')]({},_0x1670f3,_0x50b2eb[_0xb966('0x45')]);return db[_0xb966('0x20')][_0xb966('0x4c')](_0x1670f3)[_0xb966('0x1b')](handleEntityNotFound(_0x126eee,null))['then'](respondWithResult(_0x126eee,null))[_0xb966('0x4a')](handleError(_0x126eee,null));};exports['create']=function(_0x51d089,_0x586267){return db[_0xb966('0x20')][_0xb966('0x4d')](_0x51d089[_0xb966('0x4e')],{})[_0xb966('0x1b')](respondWithResult(_0x586267,0xc9))['catch'](handleError(_0x586267,null));};exports[_0xb966('0x1a')]=function(_0x3d8853,_0x4d067c){if(_0x3d8853['body']['id']){delete _0x3d8853[_0xb966('0x4e')]['id'];}return db[_0xb966('0x20')][_0xb966('0x4c')]({'where':{'id':_0x3d8853[_0xb966('0x4b')]['id']}})[_0xb966('0x1b')](handleEntityNotFound(_0x4d067c,null))[_0xb966('0x1b')](saveUpdates(_0x3d8853[_0xb966('0x4e')],null))[_0xb966('0x1b')](respondWithResult(_0x4d067c,null))[_0xb966('0x4a')](handleError(_0x4d067c,null));};exports['describe']=function(_0x1f74b1,_0x391875){return db[_0xb966('0x20')][_0xb966('0x4f')]()['then'](respondWithResult(_0x391875,null))['catch'](handleError(_0x391875,null));};exports[_0xb966('0x1c')]=function(_0x13c54b,_0x1c8c3d){var _0x221530;return db['CmHopper']['find']({'where':{'id':_0x13c54b[_0xb966('0x4b')]['id']}})[_0xb966('0x1b')](handleEntityNotFound(_0x1c8c3d,null))[_0xb966('0x1b')](function(_0x38d4b6){if(_0x38d4b6){return _0x38d4b6['destroy']()[_0xb966('0x1b')](function(_0x404b1a){return _0x404b1a;});}})[_0xb966('0x1b')](function(_0x1b3b75){_0x221530=_0x1b3b75;if(_0x1b3b75){if(_0x1b3b75[_0xb966('0x50')]||_0x1b3b75[_0xb966('0x51')]){return db[_0x1b3b75['VoiceQueueId']?'VoiceQueue':_0xb966('0x52')][_0xb966('0x4c')]({'where':{'id':_0x1b3b75[_0xb966('0x50')]?_0x1b3b75['VoiceQueueId']:_0x1b3b75[_0xb966('0x51')]},'attributes':['id',_0xb966('0x53')],'raw':!![]});}}})['then'](function(_0x33da68){var _0x284e34={};if(_0x33da68){_[_0xb966('0x3f')](_0x284e34,_[_0xb966('0x54')](_0x221530[_0xb966('0x55')],[_0xb966('0x56'),_0xb966('0x57'),'id']));_0x284e34['state']=0x15;_0x284e34[_0xb966('0x58')]='deleted';_0x284e34[_0xb966('0x59')]=_0x33da68['name'];_0x284e34[_0xb966('0x5a')]=_0x13c54b[_0xb966('0x5b')][_0xb966('0x53')];_0x284e34[_0xb966('0x5c')]=_0x13c54b[_0xb966('0x5b')]['id'];_0x284e34[_0xb966('0x5d')]=!![];_0x284e34[_0xb966('0x5e')]=moment()[_0xb966('0x5f')](_0xb966('0x60'));_0x284e34[_0xb966('0x61')]=_0x221530[_0xb966('0x62')];_0x284e34[_0xb966('0x63')]=_0x221530[_0xb966('0x50')]?_0xb966('0x64'):'ivr';return db[_0xb966('0x65')][_0xb966('0x4c')]({'where':{'id':_0x284e34['ContactId']},'attributes':[_0xb966('0x66'),_0xb966('0x67')]})[_0xb966('0x1b')](function(_0x2091fd){if(!_[_0xb966('0x68')](_0x1c8c3d)&&!_['isNil'](_0x2091fd[_0xb966('0x66')])){_0x284e34[_0xb966('0x69')]=_0x2091fd[_0xb966('0x66')];if(!_[_0xb966('0x68')](_0x2091fd['lastName'])){_0x284e34[_0xb966('0x69')]+='\x20'+_0x2091fd['lastName'];}}})['finally'](function(){return db[_0xb966('0x6a')][_0xb966('0x4d')](_0x284e34);});}})[_0xb966('0x1b')](function(){return _0x1c8c3d['status'](0xcc)[_0xb966('0x12')]();})[_0xb966('0x4a')](handleError(_0x1c8c3d,null));};exports[_0xb966('0x6b')]=function(_0x2c18aa,_0x46c8a5,_0xe903f0){var _0x112bb9=[];return db[_0xb966('0x65')][_0xb966('0x4f')]()[_0xb966('0x1b')](function(_0x2f40ee){_0x112bb9=_[_0xb966('0x23')](_0x2f40ee);return _0x2c18aa['user'][_0xb966('0x6c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xb966('0x6d')},'attributes':['id',_0xb966('0x6e')],'raw':!![]});})[_0xb966('0x1b')](function(_0x2f78c2){if(_0x2f78c2&&_0x2f78c2[_0xb966('0x38')]){return db[_0xb966('0x6f')][_0xb966('0x70')](function(_0x49c982){var _0xf6688={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb966('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb966('0x40')](_0x2f78c2,'id')},'$or':[{'UserId':null},{'UserId':_0x2c18aa[_0xb966('0x5b')]['id']}]};var _0x52574b=[];if(_0x2c18aa[_0xb966('0x4e')][_0xb966('0x71')]&&_0x2c18aa[_0xb966('0x4e')][_0xb966('0x71')]==='prev'){if(!_[_0xb966('0x72')](_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')])){_0xf6688['id']={'$in':_0x2c18aa[_0xb966('0x4e')]['hopperIds']};}_0x52574b=[[_0xb966('0x74'),_0xb966('0x75')],[_0xb966('0x76'),_0x2f78c2[0x0]['dialOrderByScheduledAt']===_0xb966('0x75')?_0xb966('0x77'):_0xb966('0x75')],db[_0xb966('0x6f')][_0xb966('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xb966('0x77')]];}else{if(!_[_0xb966('0x72')](_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')])){_0xf6688['id']={'$notIn':_0x2c18aa[_0xb966('0x4e')][_0xb966('0x73')]};}_0x52574b=[['priority','DESC'],['scheduledAt',_0x2f78c2[0x0][_0xb966('0x6e')]],db['sequelize'][_0xb966('0x78')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xb966('0x75')]];}return db[_0xb966('0x20')][_0xb966('0x79')]({'attributes':['id',_0xb966('0x7a')],'where':_0xf6688,'order':_0x52574b,'transaction':_0x49c982,'lock':_0x49c982[_0xb966('0x7b')][_0xb966('0x7c')],'include':[{'model':db[_0xb966('0x65')],'as':_0xb966('0x7d'),'attributes':_0x112bb9,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0xb966('0x7e'),'attributes':['id','name']},{'model':db[_0xb966('0x7f')],'as':_0xb966('0x80'),'attributes':['id','name',_0xb966('0x81')]}]})[_0xb966('0x1b')](function(_0x973325){if(_0x973325){return _0x973325[_0xb966('0x1a')]({'UserId':_0x2c18aa[_0xb966('0x5b')]['id']},{'transaction':_0x49c982});}});});}})[_0xb966('0x1b')](handleEntityNotFound(_0x46c8a5,null))[_0xb966('0x1b')](respondWithResult(_0x46c8a5,null))[_0xb966('0x4a')](handleError(_0x46c8a5,null));};exports['getOpenContacts']=function(_0xb0021,_0xdb4b98,_0x48fba){return _0xb0021[_0xb966('0x5b')][_0xb966('0x6c')]({'where':{'type':_0xb966('0x82'),'dialActive':!![],'dialMethod':_0xb966('0x6d')},'attributes':['id'],'raw':!![]})[_0xb966('0x1b')](function(_0x4a0d71){if(_0x4a0d71&&_0x4a0d71[_0xb966('0x38')]){return db['CmHopper'][_0xb966('0x14')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb966('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb966('0x40')](_0x4a0d71,'id')},'$or':[{'UserId':null},{'UserId':_0xb0021['user']['id']}]}});}return 0x0;})[_0xb966('0x1b')](function(_0x250a21){if(!_[_0xb966('0x68')](_0x250a21)&&_[_0xb966('0x83')](_0x250a21)){return _0xdb4b98[_0xb966('0x17')](0xc8)[_0xb966('0x13')]({'contacts':_0x250a21});}else{logger[_0xb966('0x84')](_0xb966('0x85'),_0xb966('0x86'),0x194,_0xb966('0x87'));_0xdb4b98['sendStatus'](0x194);}})['catch'](handleError(_0xdb4b98,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ca1e19b..ffe482e 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 _0x70e0=['path','rimraf','./cmHopper.attributes','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x70e0,0x17b));var _0x070e=function(_0xc67faa,_0x2265a2){_0xc67faa=_0xc67faa-0x0;var _0x2a306e=_0x70e0[_0xc67faa];return _0x2a306e;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('CmHopper',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]},{'name':_0x070e('0xa'),'fields':[_0x070e('0xa')]},{'name':_0x070e('0xb'),'fields':[_0x070e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde2c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x185032,_0x5cacd6){var _0xbc1fb8=function(_0x1b0445){while(--_0x1b0445){_0x185032['push'](_0x185032['shift']());}};_0xbc1fb8(++_0x5cacd6);}(_0xde2c,0x7f));var _0xcde2=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xde2c[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));var moment=require(_0xcde2('0x4'));var BPromise=require(_0xcde2('0x5'));var rp=require(_0xcde2('0x6'));var fs=require('fs');var path=require(_0xcde2('0x7'));var rimraf=require('rimraf');var config=require(_0xcde2('0x8'));var attributes=require(_0xcde2('0x9'));module[_0xcde2('0xa')]=function(_0x1398de,_0x401b16){return _0x1398de['define'](_0xcde2('0xb'),attributes,{'tableName':_0xcde2('0xc'),'paranoid':![],'indexes':[{'name':_0xcde2('0xd'),'fields':['scheduledat']},{'name':'phone','fields':[_0xcde2('0xe')]},{'name':_0xcde2('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 8087096..a797448 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 _0xebcc=['CmContact','describe','sequelize','transaction','findAll','order','LOCK','Contact','keys','length','body','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','UserId','UPDATE','push','all','GetContactRecallMe','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCmHopper','CmHopper','options','raw','where','include','map','model','attributes','catch','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','limit','destroy','DestroyCmHopper','GetContactDialer'];(function(_0x2d5348,_0x2cc29c){var _0x6c32b7=function(_0x4e2f66){while(--_0x4e2f66){_0x2d5348['push'](_0x2d5348['shift']());}};_0x6c32b7(++_0x2cc29c);}(_0xebcc,0x117));var _0xcebc=function(_0x57f7ea,_0x54da6b){_0x57f7ea=_0x57f7ea-0x0;var _0x54a7e4=_0xebcc[_0x57f7ea];return _0x54a7e4;};'use strict';var _=require(_0xcebc('0x0'));var util=require('util');var moment=require(_0xcebc('0x1'));var BPromise=require(_0xcebc('0x2'));var rs=require(_0xcebc('0x3'));var fs=require('fs');var Redis=require(_0xcebc('0x4'));var db=require(_0xcebc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcebc('0x6'));var jayson=require(_0xcebc('0x7'));var client=jayson[_0xcebc('0x8')][_0xcebc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47e294,_0x377458,_0x1e2a0d){return new BPromise(function(_0x253380,_0x3c7fb0){return client[_0xcebc('0xa')](_0x47e294,_0x1e2a0d)[_0xcebc('0xb')](function(_0x327767){logger[_0xcebc('0xc')](_0xcebc('0xd'),_0x377458,_0xcebc('0xe'));logger[_0xcebc('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x377458,_0xcebc('0xe'),JSON[_0xcebc('0x10')](_0x327767));if(_0x327767['error']){if(_0x327767[_0xcebc('0x11')][_0xcebc('0x12')]===0x1f4){logger[_0xcebc('0x11')]('CmHopper,\x20%s,\x20%s',_0x377458,_0x327767[_0xcebc('0x11')][_0xcebc('0x13')]);return _0x3c7fb0(_0x327767[_0xcebc('0x11')][_0xcebc('0x13')]);}logger[_0xcebc('0x11')](_0xcebc('0xd'),_0x377458,_0x327767[_0xcebc('0x11')]['message']);return _0x253380(_0x327767['error'][_0xcebc('0x13')]);}else{logger[_0xcebc('0xc')](_0xcebc('0xd'),_0x377458,_0xcebc('0xe'));_0x253380(_0x327767[_0xcebc('0x14')][_0xcebc('0x13')]);}})['catch'](function(_0x5a3417){logger[_0xcebc('0x11')](_0xcebc('0xd'),_0x377458,_0x5a3417);_0x3c7fb0(_0x5a3417);});});}exports[_0xcebc('0x15')]=function(_0x1d9ab4){var _0x5ae94e=this;return new Promise(function(_0x251993,_0x3ac65f){return db[_0xcebc('0x16')]['findAll']({'raw':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')][_0xcebc('0x18')]===undefined?!![]:![]:!![],'where':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x1d9ab4['options']?_0x1d9ab4['options']['attributes']||null:null,'limit':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')]['limit']||null:null,'include':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4['options'][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x1d9ab4[_0xcebc('0x17')]['include'],function(_0x376a25){return{'model':db[_0x376a25[_0xcebc('0x1c')]],'as':_0x376a25['as'],'attributes':_0x376a25[_0xcebc('0x1d')],'include':_0x376a25[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x376a25[_0xcebc('0x1a')],function(_0x5ed61e){return{'model':db[_0x5ed61e[_0xcebc('0x1c')]],'as':_0x5ed61e['as'],'attributes':_0x5ed61e['attributes'],'include':_0x5ed61e[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x5ed61e[_0xcebc('0x1a')],function(_0xc381b6){return{'model':db[_0xc381b6[_0xcebc('0x1c')]],'as':_0xc381b6['as'],'attributes':_0xc381b6[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcebc('0xb')](function(_0x44b742){logger[_0xcebc('0xc')](_0xcebc('0x15'),_0x1d9ab4);logger[_0xcebc('0xf')]('GetCmHopper',_0x1d9ab4,JSON['stringify'](_0x44b742));_0x251993(_0x44b742);})[_0xcebc('0x1e')](function(_0x52a2bf){logger[_0xcebc('0x11')](_0xcebc('0x15'),_0x52a2bf[_0xcebc('0x13')],_0x1d9ab4);_0x3ac65f(_0x5ae94e[_0xcebc('0x11')](0x1f4,_0x52a2bf['message']));});});};exports[_0xcebc('0x1f')]=function(_0x29e3d2){var _0xa5efc6=this;return new Promise(function(_0x413985,_0x15ce54){return db[_0xcebc('0x16')][_0xcebc('0x20')]({'raw':_0x29e3d2['options']?_0x29e3d2['options']['raw']===undefined?!![]:![]:!![],'where':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'include':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1a')],function(_0xa29897){return{'model':db[_0xa29897[_0xcebc('0x1c')]],'as':_0xa29897['as'],'attributes':_0xa29897[_0xcebc('0x1d')],'include':_0xa29897[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0xa29897[_0xcebc('0x1a')],function(_0x39a648){return{'model':db[_0x39a648[_0xcebc('0x1c')]],'as':_0x39a648['as'],'attributes':_0x39a648[_0xcebc('0x1d')],'include':_0x39a648[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x39a648[_0xcebc('0x1a')],function(_0x239cbf){return{'model':db[_0x239cbf['model']],'as':_0x239cbf['as'],'attributes':_0x239cbf[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcebc('0xb')](function(_0x19a3ab){logger[_0xcebc('0xc')](_0xcebc('0x1f'),_0x29e3d2);logger[_0xcebc('0xf')](_0xcebc('0x1f'),_0x29e3d2,JSON[_0xcebc('0x10')](_0x19a3ab));_0x413985(_0x19a3ab);})[_0xcebc('0x1e')](function(_0x2f6397){logger['error']('ShowCmHopper',_0x2f6397[_0xcebc('0x13')],_0x29e3d2);_0x15ce54(_0xa5efc6['error'](0x1f4,_0x2f6397[_0xcebc('0x13')]));});});};exports[_0xcebc('0x21')]=function(_0x237926){var _0x237803=this;return new Promise(function(_0xdc1fde,_0x340877){return db['CmHopper'][_0xcebc('0x22')](_0x237926['body'],{'raw':_0x237926[_0xcebc('0x17')]?_0x237926[_0xcebc('0x17')][_0xcebc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x28cfd6){logger[_0xcebc('0xc')](_0xcebc('0x21'),_0x237926);logger[_0xcebc('0xf')]('CreateCmHopper',_0x237926,JSON[_0xcebc('0x10')](_0x28cfd6));_0xdc1fde(_0x28cfd6);})[_0xcebc('0x1e')](function(_0x53b1d6){logger[_0xcebc('0x11')](_0xcebc('0x21'),_0x53b1d6[_0xcebc('0x13')],_0x237926);_0x340877(_0x237803[_0xcebc('0x11')](0x1f4,_0x53b1d6[_0xcebc('0x13')]));});});};exports[_0xcebc('0x23')]=function(_0xbb518f){var _0x34ab3c=this;return new Promise(function(_0x49104b,_0x55dab1){return db[_0xcebc('0x16')][_0xcebc('0x24')](_0xbb518f['body'],{'raw':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x25')]||null:null})['then'](function(_0x2875a7){logger[_0xcebc('0xc')](_0xcebc('0x23'),_0xbb518f);logger[_0xcebc('0xf')](_0xcebc('0x23'),_0xbb518f,JSON[_0xcebc('0x10')](_0x2875a7));_0x49104b(_0x2875a7);})[_0xcebc('0x1e')](function(_0x44b713){logger[_0xcebc('0x11')]('UpdateCmHopper',_0x44b713[_0xcebc('0x13')],_0xbb518f);_0x55dab1(_0x34ab3c[_0xcebc('0x11')](0x1f4,_0x44b713['message']));});});};exports['DestroyCmHopper']=function(_0x2872ed){var _0x3e5fe7=this;return new Promise(function(_0x3fb21b,_0x532c37){return db[_0xcebc('0x16')][_0xcebc('0x26')]({'where':_0x2872ed[_0xcebc('0x17')]?_0x2872ed[_0xcebc('0x17')][_0xcebc('0x19')]||null:null})['then'](function(_0x432517){logger[_0xcebc('0xc')](_0xcebc('0x27'),_0x2872ed);logger['debug'](_0xcebc('0x27'),_0x2872ed,JSON[_0xcebc('0x10')](_0x432517));_0x3fb21b(_0x432517);})['catch'](function(_0xa2cc59){logger[_0xcebc('0x11')](_0xcebc('0x27'),_0xa2cc59[_0xcebc('0x13')],_0x2872ed);_0x532c37(_0x3e5fe7[_0xcebc('0x11')](0x1f4,_0xa2cc59['message']));});});};exports[_0xcebc('0x28')]=function(_0x25e9e0){var _0x2c1cdf=this;return new Promise(function(_0xb19da,_0x98f891){return db[_0xcebc('0x29')][_0xcebc('0x2a')]()[_0xcebc('0xb')](function(_0x57e03b){return db[_0xcebc('0x2b')][_0xcebc('0x2c')](function(_0x56da0c){return db['CmHopper'][_0xcebc('0x2d')]({'where':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0['options'][_0xcebc('0x25')]||null:null,'order':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x2e')]||null:null,'transaction':_0x56da0c,'lock':_0x56da0c[_0xcebc('0x2f')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xcebc('0x30'),'attributes':_[_0xcebc('0x31')](_0x57e03b)}]})[_0xcebc('0xb')](function(_0x396623){var _0x3869b1=[];for(var _0x16bc65=0x0;_0x16bc65<_0x396623[_0xcebc('0x32')];_0x16bc65+=0x1){_0x3869b1['push'](_0x396623[_0x16bc65][_0xcebc('0x24')](_0x25e9e0[_0xcebc('0x33')],{'transaction':_0x56da0c}));}return BPromise['all'](_0x3869b1);});})['then'](function(_0x42a6d4){logger['info'](_0xcebc('0x28'),_0x25e9e0);logger[_0xcebc('0xf')](_0xcebc('0x28'),_0x25e9e0,JSON[_0xcebc('0x10')](_0x42a6d4));_0xb19da(_0x42a6d4);})[_0xcebc('0x1e')](function(_0x1bc38c){logger[_0xcebc('0x11')]('GetContactDialer',_0x1bc38c[_0xcebc('0x13')],_0x25e9e0);_0x98f891(_0x2c1cdf[_0xcebc('0x11')](0x1f4,_0x1bc38c[_0xcebc('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x27b9e5){var _0x451d5b=this;return new Promise(function(_0x566c69,_0x4dbe84){return db[_0xcebc('0x2b')][_0xcebc('0x2c')](function(_0x5cbaa4){return db[_0xcebc('0x34')][_0xcebc('0x22')](_0x27b9e5[_0xcebc('0x33')],{'raw':_0x27b9e5[_0xcebc('0x17')]?_0x27b9e5['options'][_0xcebc('0x18')]===undefined?!![]:![]:!![],'transaction':_0x5cbaa4})[_0xcebc('0xb')](function(){return db[_0xcebc('0x16')][_0xcebc('0x26')]({'where':_0x27b9e5[_0xcebc('0x17')]?_0x27b9e5['options'][_0xcebc('0x19')]||null:null,'transaction':_0x5cbaa4});});})[_0xcebc('0xb')](function(_0x2329e4){logger['info'](_0xcebc('0x35'),_0x27b9e5);logger[_0xcebc('0xf')](_0xcebc('0x35'),_0x27b9e5,JSON['stringify'](_0x2329e4));_0x566c69(_0x2329e4);})['catch'](function(_0x445ee9){logger['error']('MoveContactManagedDialer',_0x445ee9[_0xcebc('0x13')],_0x27b9e5);_0x4dbe84(_0x451d5b[_0xcebc('0x11')](0x1f4,_0x445ee9['message']));});});};exports[_0xcebc('0x36')]=function(_0x3ae56f){var _0x1c96c8=this;return new Promise(function(_0x276d6,_0x22ceee){return db[_0xcebc('0x16')][_0xcebc('0x2d')]({'raw':_0x3ae56f[_0xcebc('0x17')]?_0x3ae56f['options'][_0xcebc('0x18')]===undefined?!![]:![]:!![],'where':_0x3ae56f['options']?_0x3ae56f[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':[[db[_0xcebc('0x2b')]['fn'](_0xcebc('0x37'),db['sequelize']['fn']('IF',db[_0xcebc('0x2b')][_0xcebc('0x38')](_0xcebc('0x39')+util[_0xcebc('0x3a')]('\x22%s\x22',moment()[_0xcebc('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xcebc('0xb')](function(_0x4a23c6){logger[_0xcebc('0xc')]('CountReScheduled',_0x3ae56f);logger['debug'](_0xcebc('0x36'),_0x3ae56f,JSON[_0xcebc('0x10')](_0x4a23c6));_0x276d6(_0x4a23c6);})[_0xcebc('0x1e')](function(_0x32348b){logger[_0xcebc('0x11')]('CountReScheduled',_0x32348b[_0xcebc('0x13')],_0x3ae56f);_0x22ceee(_0x1c96c8[_0xcebc('0x11')](0x1f4,_0x32348b['message']));});});};exports['GetContactRecallMe']=function(_0x24b0fc){var _0x158247=this;return new Promise(function(_0x2f966f,_0x4b80e9){return db['CmContact'][_0xcebc('0x2a')]()[_0xcebc('0xb')](function(_0x20b90c){return db['sequelize'][_0xcebc('0x2c')](function(_0x1ed4a6){return db[_0xcebc('0x16')][_0xcebc('0x2d')]({'where':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc['options']['where']||null:null,'attributes':_0x24b0fc['options']?_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':0x1,'order':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc['options'][_0xcebc('0x2e')]||null:null,'group':db[_0xcebc('0x16')][_0xcebc('0x3b')],'transaction':_0x1ed4a6,'lock':_0x1ed4a6[_0xcebc('0x2f')][_0xcebc('0x3c')],'include':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1a')],function(_0x32121f){return{'model':db[_0x32121f['model']],'as':_0x32121f['as'],'attributes':_0x32121f[_0xcebc('0x1d')],'include':_0x32121f[_0xcebc('0x1a')]?_['map'](_0x32121f[_0xcebc('0x1a')],function(_0x3c1e84){return{'model':db[_0x3c1e84[_0xcebc('0x1c')]],'as':_0x3c1e84['as'],'attributes':_0x3c1e84[_0xcebc('0x1d')],'include':_0x3c1e84['include']?_['map'](_0x3c1e84['include'],function(_0x5034fe){return{'model':db[_0x5034fe[_0xcebc('0x1c')]],'as':_0x5034fe['as'],'attributes':_0x5034fe[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32eaee){var _0x30bf3b=[];for(var _0x10a02c=0x0;_0x10a02c<_0x32eaee[_0xcebc('0x32')];_0x10a02c+=0x1){_0x30bf3b[_0xcebc('0x3d')](_0x32eaee[_0x10a02c][_0xcebc('0x24')](_0x24b0fc['body'],{'transaction':_0x1ed4a6}));}return BPromise[_0xcebc('0x3e')](_0x30bf3b);});})[_0xcebc('0xb')](function(_0x5500c0){logger[_0xcebc('0xc')]('GetContactRecallMe',_0x24b0fc);logger['debug'](_0xcebc('0x3f'),_0x24b0fc,JSON['stringify'](_0x5500c0));_0x2f966f(_0x5500c0);})[_0xcebc('0x1e')](function(_0x13ed8b){logger['error'](_0xcebc('0x3f'),_0x13ed8b['message'],_0x24b0fc);_0x4b80e9(_0x158247[_0xcebc('0x11')](0x1f4,_0x13ed8b[_0xcebc('0x13')]));});});});}; \ No newline at end of file +var _0x3b13=['LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','update','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','CmHopper','findAll','options','raw','where','limit','include','model','map','attributes','GetCmHopper','stringify','ShowCmHopper','debug','create','body','CreateCmHopper','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order'];(function(_0x456b45,_0x273834){var _0xe3627d=function(_0x3a6f59){while(--_0x3a6f59){_0x456b45['push'](_0x456b45['shift']());}};_0xe3627d(++_0x273834);}(_0x3b13,0x91));var _0x33b1=function(_0x447b8f,_0x396387){_0x447b8f=_0x447b8f-0x0;var _0x237474=_0x3b13[_0x447b8f];return _0x237474;};'use strict';var _=require('lodash');var util=require(_0x33b1('0x0'));var moment=require(_0x33b1('0x1'));var BPromise=require(_0x33b1('0x2'));var rs=require(_0x33b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x33b1('0x4'));var logger=require(_0x33b1('0x5'))(_0x33b1('0x6'));var config=require('../../config/environment');var jayson=require(_0x33b1('0x7'));var client=jayson[_0x33b1('0x8')][_0x33b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x322616,_0x5b5ded,_0x37efab){return new BPromise(function(_0x39ef67,_0x36a0ab){return client['request'](_0x322616,_0x37efab)[_0x33b1('0xa')](function(_0x5b4ef4){logger[_0x33b1('0xb')](_0x33b1('0xc'),_0x5b5ded,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x5b5ded,_0x33b1('0xd'),JSON['stringify'](_0x5b4ef4));if(_0x5b4ef4['error']){if(_0x5b4ef4['error'][_0x33b1('0xe')]===0x1f4){logger[_0x33b1('0xf')](_0x33b1('0xc'),_0x5b5ded,_0x5b4ef4[_0x33b1('0xf')][_0x33b1('0x10')]);return _0x36a0ab(_0x5b4ef4[_0x33b1('0xf')][_0x33b1('0x10')]);}logger['error'](_0x33b1('0xc'),_0x5b5ded,_0x5b4ef4['error'][_0x33b1('0x10')]);return _0x39ef67(_0x5b4ef4[_0x33b1('0xf')]['message']);}else{logger['info'](_0x33b1('0xc'),_0x5b5ded,_0x33b1('0xd'));_0x39ef67(_0x5b4ef4[_0x33b1('0x11')][_0x33b1('0x10')]);}})[_0x33b1('0x12')](function(_0x3d620f){logger[_0x33b1('0xf')](_0x33b1('0xc'),_0x5b5ded,_0x3d620f);_0x36a0ab(_0x3d620f);});});}exports['GetCmHopper']=function(_0x30883a){var _0x4f97f1=this;return new Promise(function(_0x9b78db,_0x47eb4c){return db[_0x33b1('0x13')][_0x33b1('0x14')]({'raw':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x30883a[_0x33b1('0x15')]?_0x30883a['options']['attributes']||null:null,'limit':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x18')]||null:null,'include':_0x30883a[_0x33b1('0x15')]?_0x30883a[_0x33b1('0x15')][_0x33b1('0x19')]?_['map'](_0x30883a[_0x33b1('0x15')][_0x33b1('0x19')],function(_0x2f42a0){return{'model':db[_0x2f42a0[_0x33b1('0x1a')]],'as':_0x2f42a0['as'],'attributes':_0x2f42a0['attributes'],'include':_0x2f42a0[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x2f42a0['include'],function(_0x2e9e7f){return{'model':db[_0x2e9e7f[_0x33b1('0x1a')]],'as':_0x2e9e7f['as'],'attributes':_0x2e9e7f[_0x33b1('0x1c')],'include':_0x2e9e7f[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x2e9e7f[_0x33b1('0x19')],function(_0x750020){return{'model':db[_0x750020['model']],'as':_0x750020['as'],'attributes':_0x750020[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6334){logger['info'](_0x33b1('0x1d'),_0x30883a);logger['debug'](_0x33b1('0x1d'),_0x30883a,JSON[_0x33b1('0x1e')](_0x4b6334));_0x9b78db(_0x4b6334);})['catch'](function(_0x23fa12){logger[_0x33b1('0xf')](_0x33b1('0x1d'),_0x23fa12[_0x33b1('0x10')],_0x30883a);_0x47eb4c(_0x4f97f1['error'](0x1f4,_0x23fa12['message']));});});};exports[_0x33b1('0x1f')]=function(_0x128071){var _0x48d90c=this;return new Promise(function(_0x22536e,_0x283514){return db[_0x33b1('0x13')]['find']({'raw':_0x128071[_0x33b1('0x15')]?_0x128071[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0x128071[_0x33b1('0x15')]?_0x128071[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x128071[_0x33b1('0x15')]?_0x128071['options'][_0x33b1('0x1c')]||null:null,'include':_0x128071['options']?_0x128071[_0x33b1('0x15')][_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x128071[_0x33b1('0x15')][_0x33b1('0x19')],function(_0x5c7c54){return{'model':db[_0x5c7c54[_0x33b1('0x1a')]],'as':_0x5c7c54['as'],'attributes':_0x5c7c54[_0x33b1('0x1c')],'include':_0x5c7c54['include']?_[_0x33b1('0x1b')](_0x5c7c54[_0x33b1('0x19')],function(_0x49021e){return{'model':db[_0x49021e[_0x33b1('0x1a')]],'as':_0x49021e['as'],'attributes':_0x49021e[_0x33b1('0x1c')],'include':_0x49021e['include']?_['map'](_0x49021e[_0x33b1('0x19')],function(_0x599364){return{'model':db[_0x599364[_0x33b1('0x1a')]],'as':_0x599364['as'],'attributes':_0x599364[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5db223){logger['info']('ShowCmHopper',_0x128071);logger[_0x33b1('0x20')](_0x33b1('0x1f'),_0x128071,JSON[_0x33b1('0x1e')](_0x5db223));_0x22536e(_0x5db223);})[_0x33b1('0x12')](function(_0x2dcbaa){logger[_0x33b1('0xf')](_0x33b1('0x1f'),_0x2dcbaa[_0x33b1('0x10')],_0x128071);_0x283514(_0x48d90c[_0x33b1('0xf')](0x1f4,_0x2dcbaa['message']));});});};exports['CreateCmHopper']=function(_0x4e2cc9){var _0x1df6ad=this;return new Promise(function(_0x52fdb7,_0x52d271){return db[_0x33b1('0x13')][_0x33b1('0x21')](_0x4e2cc9[_0x33b1('0x22')],{'raw':_0x4e2cc9['options']?_0x4e2cc9['options']['raw']===undefined?!![]:![]:!![]})[_0x33b1('0xa')](function(_0x141dea){logger[_0x33b1('0xb')](_0x33b1('0x23'),_0x4e2cc9);logger[_0x33b1('0x20')](_0x33b1('0x23'),_0x4e2cc9,JSON[_0x33b1('0x1e')](_0x141dea));_0x52fdb7(_0x141dea);})[_0x33b1('0x12')](function(_0x1d7532){logger['error'](_0x33b1('0x23'),_0x1d7532[_0x33b1('0x10')],_0x4e2cc9);_0x52d271(_0x1df6ad['error'](0x1f4,_0x1d7532[_0x33b1('0x10')]));});});};exports[_0x33b1('0x24')]=function(_0xf7291a){var _0x2f9760=this;return new Promise(function(_0x49871d,_0x17f932){return db[_0x33b1('0x13')]['update'](_0xf7291a[_0x33b1('0x22')],{'raw':_0xf7291a['options']?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x1c')]||null:null,'limit':_0xf7291a[_0x33b1('0x15')]?_0xf7291a[_0x33b1('0x15')][_0x33b1('0x18')]||null:null})[_0x33b1('0xa')](function(_0x183f3f){logger[_0x33b1('0xb')]('UpdateCmHopper',_0xf7291a);logger[_0x33b1('0x20')](_0x33b1('0x24'),_0xf7291a,JSON[_0x33b1('0x1e')](_0x183f3f));_0x49871d(_0x183f3f);})[_0x33b1('0x12')](function(_0x1f957a){logger[_0x33b1('0xf')](_0x33b1('0x24'),_0x1f957a['message'],_0xf7291a);_0x17f932(_0x2f9760[_0x33b1('0xf')](0x1f4,_0x1f957a[_0x33b1('0x10')]));});});};exports[_0x33b1('0x25')]=function(_0x166500){var _0x370410=this;return new Promise(function(_0x2109b1,_0x44bc53){return db[_0x33b1('0x13')]['destroy']({'where':_0x166500[_0x33b1('0x15')]?_0x166500['options'][_0x33b1('0x17')]||null:null})[_0x33b1('0xa')](function(_0xc7acb4){logger[_0x33b1('0xb')]('DestroyCmHopper',_0x166500);logger[_0x33b1('0x20')](_0x33b1('0x25'),_0x166500,JSON['stringify'](_0xc7acb4));_0x2109b1(_0xc7acb4);})['catch'](function(_0x35e257){logger[_0x33b1('0xf')]('DestroyCmHopper',_0x35e257[_0x33b1('0x10')],_0x166500);_0x44bc53(_0x370410[_0x33b1('0xf')](0x1f4,_0x35e257[_0x33b1('0x10')]));});});};exports[_0x33b1('0x26')]=function(_0x2783be){var _0x406bb1=this;return new Promise(function(_0x5967da,_0x5162c4){return db[_0x33b1('0x27')][_0x33b1('0x28')]()[_0x33b1('0xa')](function(_0x3f83c0){return db[_0x33b1('0x29')][_0x33b1('0x2a')](function(_0x371618){return db[_0x33b1('0x13')]['findAll']({'where':_0x2783be['options']?_0x2783be[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':_0x2783be[_0x33b1('0x15')]?_0x2783be['options']['attributes']||null:null,'limit':_0x2783be[_0x33b1('0x15')]?_0x2783be[_0x33b1('0x15')][_0x33b1('0x18')]||null:null,'order':_0x2783be[_0x33b1('0x15')]?_0x2783be[_0x33b1('0x15')][_0x33b1('0x2b')]||null:null,'transaction':_0x371618,'lock':_0x371618[_0x33b1('0x2c')][_0x33b1('0x2d')],'include':[{'model':db[_0x33b1('0x27')],'as':_0x33b1('0x2e'),'attributes':_[_0x33b1('0x2f')](_0x3f83c0)}]})[_0x33b1('0xa')](function(_0x56a509){var _0x1fbfe0=[];for(var _0x5e3dfc=0x0;_0x5e3dfc<_0x56a509[_0x33b1('0x30')];_0x5e3dfc+=0x1){_0x1fbfe0[_0x33b1('0x31')](_0x56a509[_0x5e3dfc]['update'](_0x2783be[_0x33b1('0x22')],{'transaction':_0x371618}));}return BPromise[_0x33b1('0x32')](_0x1fbfe0);});})['then'](function(_0x2b032a){logger[_0x33b1('0xb')]('GetContactDialer',_0x2783be);logger[_0x33b1('0x20')](_0x33b1('0x26'),_0x2783be,JSON['stringify'](_0x2b032a));_0x5967da(_0x2b032a);})['catch'](function(_0x2a6696){logger['error'](_0x33b1('0x26'),_0x2a6696[_0x33b1('0x10')],_0x2783be);_0x5162c4(_0x406bb1[_0x33b1('0xf')](0x1f4,_0x2a6696['message']));});});});};exports[_0x33b1('0x33')]=function(_0x2f0ef4){var _0x22b1cd=this;return new Promise(function(_0x318d00,_0x57a56d){return db['sequelize'][_0x33b1('0x2a')](function(_0x37cdab){return db['CmHopperFinal'][_0x33b1('0x21')](_0x2f0ef4[_0x33b1('0x22')],{'raw':_0x2f0ef4[_0x33b1('0x15')]?_0x2f0ef4[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'transaction':_0x37cdab})[_0x33b1('0xa')](function(){return db[_0x33b1('0x13')]['destroy']({'where':_0x2f0ef4[_0x33b1('0x15')]?_0x2f0ef4[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'transaction':_0x37cdab});});})['then'](function(_0x33072f){logger[_0x33b1('0xb')](_0x33b1('0x33'),_0x2f0ef4);logger[_0x33b1('0x20')](_0x33b1('0x33'),_0x2f0ef4,JSON[_0x33b1('0x1e')](_0x33072f));_0x318d00(_0x33072f);})[_0x33b1('0x12')](function(_0x315728){logger[_0x33b1('0xf')](_0x33b1('0x33'),_0x315728[_0x33b1('0x10')],_0x2f0ef4);_0x57a56d(_0x22b1cd[_0x33b1('0xf')](0x1f4,_0x315728['message']));});});};exports[_0x33b1('0x34')]=function(_0xb0f9af){var _0x5a1691=this;return new Promise(function(_0x20fce3,_0x579d1c){return db['CmHopper'][_0x33b1('0x14')]({'raw':_0xb0f9af[_0x33b1('0x15')]?_0xb0f9af[_0x33b1('0x15')][_0x33b1('0x16')]===undefined?!![]:![]:!![],'where':_0xb0f9af[_0x33b1('0x15')]?_0xb0f9af[_0x33b1('0x15')][_0x33b1('0x17')]||null:null,'attributes':[[db[_0x33b1('0x29')]['fn'](_0x33b1('0x35'),db[_0x33b1('0x29')]['fn']('IF',db[_0x33b1('0x29')][_0x33b1('0x36')](_0x33b1('0x37')+util[_0x33b1('0x38')](_0x33b1('0x39'),moment()[_0x33b1('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x33b1('0x3a')))),_0x33b1('0x3b')]]})[_0x33b1('0xa')](function(_0x581ddb){logger[_0x33b1('0xb')](_0x33b1('0x34'),_0xb0f9af);logger['debug'](_0x33b1('0x34'),_0xb0f9af,JSON[_0x33b1('0x1e')](_0x581ddb));_0x20fce3(_0x581ddb);})[_0x33b1('0x12')](function(_0x4edd54){logger[_0x33b1('0xf')](_0x33b1('0x34'),_0x4edd54['message'],_0xb0f9af);_0x579d1c(_0x5a1691['error'](0x1f4,_0x4edd54['message']));});});};exports[_0x33b1('0x3c')]=function(_0x596be9){var _0x2d7504=this;return new Promise(function(_0xc87f53,_0x362419){return db[_0x33b1('0x27')][_0x33b1('0x28')]()[_0x33b1('0xa')](function(_0x5ec812){return db[_0x33b1('0x29')][_0x33b1('0x2a')](function(_0xcd733){return db[_0x33b1('0x13')][_0x33b1('0x14')]({'where':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')]['where']||null:null,'attributes':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')]['attributes']||null:null,'limit':0x1,'order':_0x596be9[_0x33b1('0x15')]?_0x596be9[_0x33b1('0x15')][_0x33b1('0x2b')]||null:null,'group':db[_0x33b1('0x13')][_0x33b1('0x3d')],'transaction':_0xcd733,'lock':_0xcd733[_0x33b1('0x2c')][_0x33b1('0x2d')],'include':_0x596be9['options']?_0x596be9[_0x33b1('0x15')][_0x33b1('0x19')]?_['map'](_0x596be9[_0x33b1('0x15')]['include'],function(_0x212e7b){return{'model':db[_0x212e7b[_0x33b1('0x1a')]],'as':_0x212e7b['as'],'attributes':_0x212e7b[_0x33b1('0x1c')],'include':_0x212e7b[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x212e7b[_0x33b1('0x19')],function(_0x49da56){return{'model':db[_0x49da56[_0x33b1('0x1a')]],'as':_0x49da56['as'],'attributes':_0x49da56[_0x33b1('0x1c')],'include':_0x49da56[_0x33b1('0x19')]?_[_0x33b1('0x1b')](_0x49da56[_0x33b1('0x19')],function(_0x5aa7e3){return{'model':db[_0x5aa7e3[_0x33b1('0x1a')]],'as':_0x5aa7e3['as'],'attributes':_0x5aa7e3[_0x33b1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301d2b){var _0x1bea70=[];for(var _0x2dd431=0x0;_0x2dd431<_0x301d2b['length'];_0x2dd431+=0x1){_0x1bea70['push'](_0x301d2b[_0x2dd431][_0x33b1('0x3e')](_0x596be9['body'],{'transaction':_0xcd733}));}return BPromise['all'](_0x1bea70);});})[_0x33b1('0xa')](function(_0x3f0d0b){logger[_0x33b1('0xb')](_0x33b1('0x3c'),_0x596be9);logger[_0x33b1('0x20')](_0x33b1('0x3c'),_0x596be9,JSON[_0x33b1('0x1e')](_0x3f0d0b));_0xc87f53(_0x3f0d0b);})[_0x33b1('0x12')](function(_0x521fb4){logger[_0x33b1('0xf')](_0x33b1('0x3c'),_0x521fb4[_0x33b1('0x10')],_0x596be9);_0x362419(_0x2d7504[_0x33b1('0xf')](0x1f4,_0x521fb4[_0x33b1('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 72288b0..1486c71 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 _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x4a82bd,_0x2c2754){var _0x1babe9=function(_0x10772f){while(--_0x10772f){_0x4a82bd['push'](_0x4a82bd['shift']());}};_0x1babe9(++_0x2c2754);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7033,_0x4515cd){_0x4d7033=_0x4d7033-0x0;var _0x25ac99=_0x7a54[_0x4d7033];return _0x25ac99;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ebc7892..03391bf 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 _0x834b=['contactListQueue','moment','INTEGER'];(function(_0x59ccaa,_0x26823a){var _0x7780ea=function(_0x1682bc){while(--_0x1682bc){_0x59ccaa['push'](_0x59ccaa['shift']());}};_0x7780ea(++_0x26823a);}(_0x834b,0x16f));var _0xb834=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x834b[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xb834('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb834('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb834('0x1')],'unique':_0xb834('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb834('0x1')],'unique':_0xb834('0x2')}}; \ No newline at end of file +var _0xd7ac=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x62d0e3,_0x42bd6d){var _0x4579dc=function(_0x809f34){while(--_0x809f34){_0x62d0e3['push'](_0x62d0e3['shift']());}};_0x4579dc(++_0x42bd6d);}(_0xd7ac,0x13a));var _0xcd7a=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xd7ac[_0x12fc8d];return _0x3f9d04;};'use strict';var moment=require(_0xcd7a('0x0'));var Sequelize=require(_0xcd7a('0x1'));module['exports']={'phone':{'type':Sequelize[_0xcd7a('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xcd7a('0x3')],'unique':_0xcd7a('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcd7a('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xcd7a('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 38949a6..0270980 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 _0x2b10=['moment','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','params','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3e4b8a,_0x247151){var _0x5dd02e=function(_0x589c1b){while(--_0x589c1b){_0x3e4b8a['push'](_0x3e4b8a['shift']());}};_0x5dd02e(++_0x247151);}(_0x2b10,0x15a));var _0x02b1=function(_0x104d81,_0xcef70c){_0x104d81=_0x104d81-0x0;var _0x4a4d8c=_0x2b10[_0x104d81];return _0x4a4d8c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x02b1('0x0'));var rimraf=require(_0x02b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02b1('0x2'));var rp=require(_0x02b1('0x3'));var moment=require(_0x02b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02b1('0x5'));var path=require(_0x02b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x02b1('0x7'));var fs=require('fs');var _=require(_0x02b1('0x8'));var squel=require(_0x02b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x02b1('0xa'));var deskjs=require(_0x02b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x02b1('0xc'));var Papa=require(_0x02b1('0xd'));var Redis=require(_0x02b1('0xe'));var authService=require(_0x02b1('0xf'));var qs=require(_0x02b1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x02b1('0x11'))(_0x02b1('0x12'));var utils=require(_0x02b1('0x13'));var config=require(_0x02b1('0x14'));var db=require(_0x02b1('0x15'))['db'];function respondWithStatusCode(_0x4a19d4,_0x489d80){_0x489d80=_0x489d80||0xcc;return function(_0x46d0c3){if(_0x46d0c3){return _0x4a19d4[_0x02b1('0x16')](_0x489d80);}return _0x4a19d4[_0x02b1('0x17')](_0x489d80)['end']();};}function respondWithResult(_0x575f3c,_0x324dbe){_0x324dbe=_0x324dbe||0xc8;return function(_0x50b6a8){if(_0x50b6a8){return _0x575f3c[_0x02b1('0x17')](_0x324dbe)[_0x02b1('0x18')](_0x50b6a8);}};}function respondWithFilteredResult(_0x59e19d,_0xaaa919){return function(_0x581780){if(_0x581780){var _0x44605d=_0x581780[_0x02b1('0x19')],_0x5afc96=_0xaaa919['offset'],_0x179262=_0xaaa919[_0x02b1('0x1a')]+_0xaaa919[_0x02b1('0x1b')],_0x46b98a;if(_0x179262>=_0x44605d){_0x179262=_0x44605d;_0x46b98a=0xc8;}else{_0x46b98a=0xce;}_0x59e19d[_0x02b1('0x17')](_0x46b98a);return _0x59e19d[_0x02b1('0x1c')](_0x02b1('0x1d'),_0x5afc96+'-'+_0x179262+'/'+_0x44605d)[_0x02b1('0x18')](_0x581780);}return null;};}function patchUpdates(_0xb67993){return function(_0x59c3b5){try{jsonpatch[_0x02b1('0x1e')](_0x59c3b5,_0xb67993,!![]);}catch(_0x489802){return BPromise[_0x02b1('0x1f')](_0x489802);}return _0x59c3b5[_0x02b1('0x20')]();};}function saveUpdates(_0x2e8b38,_0x4aa4c0){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0x02b1('0x21')](_0x2e8b38)[_0x02b1('0x22')](function(_0x15edec){return _0x15edec;});}return null;};}function removeEntity(_0x111c7e,_0x1e5794){return function(_0x44314d){if(_0x44314d){return _0x44314d[_0x02b1('0x23')]()['then'](function(){_0x111c7e[_0x02b1('0x17')](0xcc)[_0x02b1('0x24')]();});}};}function handleEntityNotFound(_0x3e8e69,_0x128181){return function(_0x553f7b){if(!_0x553f7b){_0x3e8e69['sendStatus'](0x194);}return _0x553f7b;};}function handleError(_0x1bc605,_0x4a49af){_0x4a49af=_0x4a49af||0x1f4;return function(_0x27d554){logger['error'](_0x27d554[_0x02b1('0x25')]);if(_0x27d554[_0x02b1('0x26')]){delete _0x27d554[_0x02b1('0x26')];}_0x1bc605[_0x02b1('0x17')](_0x4a49af)[_0x02b1('0x27')](_0x27d554);};}exports[_0x02b1('0x28')]=function(_0x1d7529,_0xdef534){var _0x8a6e8a={},_0x45f4d8={},_0x1b5418={'count':0x0,'rows':[]};var _0x3c93ea=db[_0x02b1('0x29')][_0x02b1('0x2a')];_0x45f4d8[_0x02b1('0x2b')]=_[_0x02b1('0x2c')](_0x3c93ea);_0x45f4d8['query']=_[_0x02b1('0x2c')](_0x1d7529[_0x02b1('0x2d')]);_0x45f4d8['filters']=_['intersection'](_0x45f4d8[_0x02b1('0x2b')],_0x45f4d8[_0x02b1('0x2d')]);_0x8a6e8a[_0x02b1('0x2e')]=_['intersection'](_0x45f4d8['model'],qs['fields'](_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x2f')]));_0x8a6e8a[_0x02b1('0x2e')]=_0x8a6e8a[_0x02b1('0x2e')][_0x02b1('0x30')]?_0x8a6e8a[_0x02b1('0x2e')]:_0x45f4d8['model'];if(!_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x31')](_0x02b1('0x32'))){_0x8a6e8a[_0x02b1('0x1b')]=qs[_0x02b1('0x1b')](_0x1d7529['query'][_0x02b1('0x1b')]);_0x8a6e8a[_0x02b1('0x1a')]=qs[_0x02b1('0x1a')](_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x1a')]);}_0x8a6e8a[_0x02b1('0x33')]=qs['sort'](_0x1d7529['query'][_0x02b1('0x34')]);_0x8a6e8a[_0x02b1('0x35')]=qs[_0x02b1('0x36')](_[_0x02b1('0x37')](_0x1d7529[_0x02b1('0x2d')],_0x45f4d8['filters']));if(_0x1d7529['query'][_0x02b1('0x38')]){_0x8a6e8a[_0x02b1('0x35')]=_['merge'](_0x8a6e8a[_0x02b1('0x35')],{'$or':_[_0x02b1('0x39')](_0x3c93ea,function(_0x4cd228){if(_0x4cd228[_0x02b1('0x3a')]['key']!==_0x02b1('0x3b')){var _0x331caa={};_0x331caa[_0x4cd228[_0x02b1('0x3c')]]={'$like':'%'+_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x38')]+'%'};return _0x331caa;}})});}_0x8a6e8a=_[_0x02b1('0x3d')]({},_0x8a6e8a,_0x1d7529[_0x02b1('0x3e')]);var _0x59dc08={'where':_0x8a6e8a[_0x02b1('0x35')]};return db[_0x02b1('0x29')][_0x02b1('0x19')](_0x59dc08)[_0x02b1('0x22')](function(_0x1fcf01){_0x1b5418[_0x02b1('0x19')]=_0x1fcf01;if(_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x3f')]){_0x8a6e8a[_0x02b1('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x02b1('0x41')](_0x8a6e8a);})[_0x02b1('0x22')](function(_0xdd9ac7){_0x1b5418['rows']=_0xdd9ac7;return _0x1b5418;})[_0x02b1('0x22')](respondWithFilteredResult(_0xdef534,_0x8a6e8a))['catch'](handleError(_0xdef534,null));};exports['show']=function(_0x5d073c,_0x299533){var _0x3a6e01={'raw':!![],'where':{'id':_0x5d073c[_0x02b1('0x42')]['id']}},_0x1d04ca={};_0x1d04ca[_0x02b1('0x2b')]=_[_0x02b1('0x2c')](db[_0x02b1('0x29')]['rawAttributes']);_0x1d04ca[_0x02b1('0x2d')]=_[_0x02b1('0x2c')](_0x5d073c[_0x02b1('0x2d')]);_0x1d04ca[_0x02b1('0x36')]=_['intersection'](_0x1d04ca[_0x02b1('0x2b')],_0x1d04ca[_0x02b1('0x2d')]);_0x3a6e01[_0x02b1('0x2e')]=_['intersection'](_0x1d04ca[_0x02b1('0x2b')],qs['fields'](_0x5d073c[_0x02b1('0x2d')]['fields']));_0x3a6e01[_0x02b1('0x2e')]=_0x3a6e01[_0x02b1('0x2e')][_0x02b1('0x30')]?_0x3a6e01[_0x02b1('0x2e')]:_0x1d04ca[_0x02b1('0x2b')];if(_0x5d073c[_0x02b1('0x2d')][_0x02b1('0x3f')]){_0x3a6e01[_0x02b1('0x40')]=[{'all':!![]}];}_0x3a6e01=_['merge']({},_0x3a6e01,_0x5d073c[_0x02b1('0x3e')]);return db['CmHopperBlack']['find'](_0x3a6e01)[_0x02b1('0x22')](handleEntityNotFound(_0x299533,null))[_0x02b1('0x22')](respondWithResult(_0x299533,null))[_0x02b1('0x43')](handleError(_0x299533,null));};exports[_0x02b1('0x21')]=function(_0x364438,_0x42d2e3){if(_0x364438['body']['id']){delete _0x364438[_0x02b1('0x44')]['id'];}return db['CmHopperBlack'][_0x02b1('0x45')]({'where':{'id':_0x364438[_0x02b1('0x42')]['id']}})[_0x02b1('0x22')](handleEntityNotFound(_0x42d2e3,null))[_0x02b1('0x22')](saveUpdates(_0x364438['body'],null))[_0x02b1('0x22')](respondWithResult(_0x42d2e3,null))[_0x02b1('0x43')](handleError(_0x42d2e3,null));};exports[_0x02b1('0x23')]=function(_0x5b8c8f,_0xc8c902){return db[_0x02b1('0x29')]['find']({'where':{'id':_0x5b8c8f[_0x02b1('0x42')]['id']}})[_0x02b1('0x22')](handleEntityNotFound(_0xc8c902,null))[_0x02b1('0x22')](removeEntity(_0xc8c902,null))['catch'](handleError(_0xc8c902,null));};exports['describe']=function(_0x405ac3,_0x3fbac4){return db[_0x02b1('0x29')]['describe']()['then'](respondWithResult(_0x3fbac4,null))[_0x02b1('0x43')](handleError(_0x3fbac4,null));}; \ No newline at end of file +var _0x4d42=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperBlack','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','show','rawAttributes','body','find','params','catch','describe','html-pdf'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x4d42,0x1c1));var _0x24d4=function(_0x37bb50,_0x2444c5){_0x37bb50=_0x37bb50-0x0;var _0x521751=_0x4d42[_0x37bb50];return _0x521751;};'use strict';var pdf=require(_0x24d4('0x0'));var emlformat=require(_0x24d4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x24d4('0x2'));var jsonpatch=require(_0x24d4('0x3'));var rp=require('request-promise');var moment=require(_0x24d4('0x4'));var BPromise=require(_0x24d4('0x5'));var Mustache=require(_0x24d4('0x6'));var util=require(_0x24d4('0x7'));var path=require(_0x24d4('0x8'));var sox=require(_0x24d4('0x9'));var csv=require(_0x24d4('0xa'));var ejs=require(_0x24d4('0xb'));var fs=require('fs');var _=require(_0x24d4('0xc'));var squel=require(_0x24d4('0xd'));var crypto=require(_0x24d4('0xe'));var jsforce=require(_0x24d4('0xf'));var deskjs=require(_0x24d4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x24d4('0x11'));var Papa=require(_0x24d4('0x12'));var Redis=require('ioredis');var authService=require(_0x24d4('0x13'));var qs=require(_0x24d4('0x14'));var hardwareService=require(_0x24d4('0x15'));var logger=require(_0x24d4('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x24d4('0x17'))['db'];function respondWithStatusCode(_0x414401,_0x500efd){_0x500efd=_0x500efd||0xcc;return function(_0x207415){if(_0x207415){return _0x414401[_0x24d4('0x18')](_0x500efd);}return _0x414401[_0x24d4('0x19')](_0x500efd)[_0x24d4('0x1a')]();};}function respondWithResult(_0x443bfb,_0x58a3a3){_0x58a3a3=_0x58a3a3||0xc8;return function(_0xd01689){if(_0xd01689){return _0x443bfb[_0x24d4('0x19')](_0x58a3a3)[_0x24d4('0x1b')](_0xd01689);}};}function respondWithFilteredResult(_0x21dde7,_0x15f0c8){return function(_0x1cd03c){if(_0x1cd03c){var _0x32deb7=_0x1cd03c[_0x24d4('0x1c')],_0x3a12d9=_0x15f0c8['offset'],_0x3b9bfd=_0x15f0c8[_0x24d4('0x1d')]+_0x15f0c8[_0x24d4('0x1e')],_0x59ad84;if(_0x3b9bfd>=_0x32deb7){_0x3b9bfd=_0x32deb7;_0x59ad84=0xc8;}else{_0x59ad84=0xce;}_0x21dde7['status'](_0x59ad84);return _0x21dde7[_0x24d4('0x1f')](_0x24d4('0x20'),_0x3a12d9+'-'+_0x3b9bfd+'/'+_0x32deb7)['json'](_0x1cd03c);}return null;};}function patchUpdates(_0x522d20){return function(_0x1b71e2){try{jsonpatch[_0x24d4('0x21')](_0x1b71e2,_0x522d20,!![]);}catch(_0x4f86c1){return BPromise[_0x24d4('0x22')](_0x4f86c1);}return _0x1b71e2[_0x24d4('0x23')]();};}function saveUpdates(_0x1fe835,_0x502c03){return function(_0x1d6a44){if(_0x1d6a44){return _0x1d6a44[_0x24d4('0x24')](_0x1fe835)[_0x24d4('0x25')](function(_0x49d39c){return _0x49d39c;});}return null;};}function removeEntity(_0x51767d,_0x22b2cb){return function(_0x8b4567){if(_0x8b4567){return _0x8b4567[_0x24d4('0x26')]()[_0x24d4('0x25')](function(){_0x51767d['status'](0xcc)[_0x24d4('0x1a')]();});}};}function handleEntityNotFound(_0x235783,_0x31bfdd){return function(_0x46974f){if(!_0x46974f){_0x235783[_0x24d4('0x18')](0x194);}return _0x46974f;};}function handleError(_0x5041eb,_0x507d56){_0x507d56=_0x507d56||0x1f4;return function(_0x3164ae){logger['error'](_0x3164ae[_0x24d4('0x27')]);if(_0x3164ae[_0x24d4('0x28')]){delete _0x3164ae[_0x24d4('0x28')];}_0x5041eb[_0x24d4('0x19')](_0x507d56)[_0x24d4('0x29')](_0x3164ae);};}exports[_0x24d4('0x2a')]=function(_0x39cddb,_0x344cfb){var _0x10cf8e={},_0x367dde={},_0x406921={'count':0x0,'rows':[]};var _0x517d1a=db[_0x24d4('0x2b')]['rawAttributes'];_0x367dde[_0x24d4('0x2c')]=_['keys'](_0x517d1a);_0x367dde[_0x24d4('0x2d')]=_[_0x24d4('0x2e')](_0x39cddb['query']);_0x367dde[_0x24d4('0x2f')]=_[_0x24d4('0x30')](_0x367dde['model'],_0x367dde[_0x24d4('0x2d')]);_0x10cf8e[_0x24d4('0x31')]=_[_0x24d4('0x30')](_0x367dde['model'],qs[_0x24d4('0x32')](_0x39cddb['query'][_0x24d4('0x32')]));_0x10cf8e[_0x24d4('0x31')]=_0x10cf8e[_0x24d4('0x31')][_0x24d4('0x33')]?_0x10cf8e[_0x24d4('0x31')]:_0x367dde[_0x24d4('0x2c')];if(!_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x34')](_0x24d4('0x35'))){_0x10cf8e[_0x24d4('0x1e')]=qs['limit'](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x1e')]);_0x10cf8e['offset']=qs[_0x24d4('0x1d')](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x1d')]);}_0x10cf8e[_0x24d4('0x36')]=qs['sort'](_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x37')]);_0x10cf8e['where']=qs[_0x24d4('0x2f')](_[_0x24d4('0x38')](_0x39cddb[_0x24d4('0x2d')],_0x367dde[_0x24d4('0x2f')]));if(_0x39cddb['query'][_0x24d4('0x39')]){_0x10cf8e[_0x24d4('0x3a')]=_['merge'](_0x10cf8e[_0x24d4('0x3a')],{'$or':_[_0x24d4('0x3b')](_0x517d1a,function(_0x44ee85){if(_0x44ee85['type'][_0x24d4('0x3c')]!==_0x24d4('0x3d')){var _0x43040f={};_0x43040f[_0x44ee85[_0x24d4('0x3e')]]={'$like':'%'+_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x39')]+'%'};return _0x43040f;}})});}_0x10cf8e=_[_0x24d4('0x3f')]({},_0x10cf8e,_0x39cddb[_0x24d4('0x40')]);var _0x5c654d={'where':_0x10cf8e[_0x24d4('0x3a')]};return db[_0x24d4('0x2b')][_0x24d4('0x1c')](_0x5c654d)['then'](function(_0x388243){_0x406921['count']=_0x388243;if(_0x39cddb[_0x24d4('0x2d')][_0x24d4('0x41')]){_0x10cf8e[_0x24d4('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x24d4('0x43')](_0x10cf8e);})[_0x24d4('0x25')](function(_0x269c39){_0x406921['rows']=_0x269c39;return _0x406921;})[_0x24d4('0x25')](respondWithFilteredResult(_0x344cfb,_0x10cf8e))['catch'](handleError(_0x344cfb,null));};exports[_0x24d4('0x44')]=function(_0x5e778b,_0x2a3d92){var _0x7feae8={'raw':!![],'where':{'id':_0x5e778b['params']['id']}},_0x1cc1b9={};_0x1cc1b9[_0x24d4('0x2c')]=_[_0x24d4('0x2e')](db['CmHopperBlack'][_0x24d4('0x45')]);_0x1cc1b9[_0x24d4('0x2d')]=_[_0x24d4('0x2e')](_0x5e778b[_0x24d4('0x2d')]);_0x1cc1b9[_0x24d4('0x2f')]=_[_0x24d4('0x30')](_0x1cc1b9[_0x24d4('0x2c')],_0x1cc1b9['query']);_0x7feae8[_0x24d4('0x31')]=_[_0x24d4('0x30')](_0x1cc1b9[_0x24d4('0x2c')],qs[_0x24d4('0x32')](_0x5e778b['query'][_0x24d4('0x32')]));_0x7feae8[_0x24d4('0x31')]=_0x7feae8[_0x24d4('0x31')][_0x24d4('0x33')]?_0x7feae8[_0x24d4('0x31')]:_0x1cc1b9[_0x24d4('0x2c')];if(_0x5e778b['query'][_0x24d4('0x41')]){_0x7feae8['include']=[{'all':!![]}];}_0x7feae8=_[_0x24d4('0x3f')]({},_0x7feae8,_0x5e778b[_0x24d4('0x40')]);return db['CmHopperBlack']['find'](_0x7feae8)['then'](handleEntityNotFound(_0x2a3d92,null))[_0x24d4('0x25')](respondWithResult(_0x2a3d92,null))['catch'](handleError(_0x2a3d92,null));};exports[_0x24d4('0x24')]=function(_0x5cb312,_0x335472){if(_0x5cb312[_0x24d4('0x46')]['id']){delete _0x5cb312[_0x24d4('0x46')]['id'];}return db['CmHopperBlack'][_0x24d4('0x47')]({'where':{'id':_0x5cb312[_0x24d4('0x48')]['id']}})[_0x24d4('0x25')](handleEntityNotFound(_0x335472,null))[_0x24d4('0x25')](saveUpdates(_0x5cb312[_0x24d4('0x46')],null))['then'](respondWithResult(_0x335472,null))[_0x24d4('0x49')](handleError(_0x335472,null));};exports[_0x24d4('0x26')]=function(_0xecea73,_0x39bca1){return db[_0x24d4('0x2b')][_0x24d4('0x47')]({'where':{'id':_0xecea73[_0x24d4('0x48')]['id']}})['then'](handleEntityNotFound(_0x39bca1,null))['then'](removeEntity(_0x39bca1,null))['catch'](handleError(_0x39bca1,null));};exports[_0x24d4('0x4a')]=function(_0x212051,_0x3a9d64){return db[_0x24d4('0x2b')][_0x24d4('0x4a')]()[_0x24d4('0x25')](respondWithResult(_0x3a9d64,null))[_0x24d4('0x49')](handleError(_0x3a9d64,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 58079b0..89ff080 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 _0x34e8=['cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack'];(function(_0x14230c,_0x2b995d){var _0x3e4ec7=function(_0x5db0c6){while(--_0x5db0c6){_0x14230c['push'](_0x14230c['shift']());}};_0x3e4ec7(++_0x2b995d);}(_0x34e8,0x12c));var _0x834e=function(_0x480ca8,_0x197b37){_0x480ca8=_0x480ca8-0x0;var _0x439a07=_0x34e8[_0x480ca8];return _0x439a07;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','path'];(function(_0x377f7f,_0x2e41b){var _0x134b17=function(_0x250d39){while(--_0x250d39){_0x377f7f['push'](_0x377f7f['shift']());}};_0x134b17(++_0x2e41b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3ca499,_0x1724f0){_0x3ca499=_0x3ca499-0x0;var _0x4cbcd8=_0xb43b[_0x3ca499];return _0x4cbcd8;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'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 bd60bb0..b49479f 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 _0x508a=['where','DestroyCmHopperBlack','CmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopperBlack','findAll','options','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','body','raw'];(function(_0xd4f2c6,_0x1939ba){var _0x46ee69=function(_0x12e081){while(--_0x12e081){_0xd4f2c6['push'](_0xd4f2c6['shift']());}};_0x46ee69(++_0x1939ba);}(_0x508a,0xbd));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require('util');var moment=require(_0xa508('0x1'));var BPromise=require(_0xa508('0x2'));var rs=require(_0xa508('0x3'));var fs=require('fs');var Redis=require(_0xa508('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa508('0x5'))(_0xa508('0x6'));var config=require(_0xa508('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa508('0x8')][_0xa508('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bfe06,_0x3736f1,_0xcf666b){return new BPromise(function(_0x21c4cb,_0x3cf1e1){return client[_0xa508('0xa')](_0x1bfe06,_0xcf666b)[_0xa508('0xb')](function(_0x96c587){logger[_0xa508('0xc')](_0xa508('0xd'),_0x3736f1,_0xa508('0xe'));logger[_0xa508('0xf')](_0xa508('0x10'),_0x3736f1,'request\x20sent',JSON['stringify'](_0x96c587));if(_0x96c587[_0xa508('0x11')]){if(_0x96c587[_0xa508('0x11')][_0xa508('0x12')]===0x1f4){logger[_0xa508('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3736f1,_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);return _0x3cf1e1(_0x96c587['error'][_0xa508('0x13')]);}logger[_0xa508('0x11')](_0xa508('0xd'),_0x3736f1,_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);return _0x21c4cb(_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);}else{logger[_0xa508('0xc')](_0xa508('0xd'),_0x3736f1,_0xa508('0xe'));_0x21c4cb(_0x96c587['result'][_0xa508('0x13')]);}})[_0xa508('0x14')](function(_0xb61fe7){logger[_0xa508('0x11')](_0xa508('0xd'),_0x3736f1,_0xb61fe7);_0x3cf1e1(_0xb61fe7);});});}exports[_0xa508('0x15')]=function(_0x527453){var _0x385399=this;return new Promise(function(_0xf47212,_0x22f353){return db['CmHopperBlack'][_0xa508('0x16')]({'raw':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x527453['options']?_0x527453[_0xa508('0x17')]['where']||null:null,'attributes':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')][_0xa508('0x18')]||null:null,'limit':_0x527453['options']?_0x527453['options'][_0xa508('0x19')]||null:null,'include':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')][_0xa508('0x1a')]?_['map'](_0x527453[_0xa508('0x17')][_0xa508('0x1a')],function(_0x412f55){return{'model':db[_0x412f55['model']],'as':_0x412f55['as'],'attributes':_0x412f55[_0xa508('0x18')],'include':_0x412f55[_0xa508('0x1a')]?_[_0xa508('0x1b')](_0x412f55['include'],function(_0x2b3a75){return{'model':db[_0x2b3a75[_0xa508('0x1c')]],'as':_0x2b3a75['as'],'attributes':_0x2b3a75['attributes'],'include':_0x2b3a75[_0xa508('0x1a')]?_[_0xa508('0x1b')](_0x2b3a75['include'],function(_0x3d83ca){return{'model':db[_0x3d83ca['model']],'as':_0x3d83ca['as'],'attributes':_0x3d83ca[_0xa508('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59266f){logger[_0xa508('0xc')](_0xa508('0x15'),_0x527453);logger[_0xa508('0xf')](_0xa508('0x15'),_0x527453,JSON[_0xa508('0x1d')](_0x59266f));_0xf47212(_0x59266f);})[_0xa508('0x14')](function(_0xfc6173){logger[_0xa508('0x11')](_0xa508('0x15'),_0xfc6173[_0xa508('0x13')],_0x527453);_0x22f353(_0x385399[_0xa508('0x11')](0x1f4,_0xfc6173[_0xa508('0x13')]));});});};exports[_0xa508('0x1e')]=function(_0x1076e3){var _0x426a9d=this;return new Promise(function(_0x4bc3f6,_0x3f78a7){return db['CmHopperBlack']['update'](_0x1076e3[_0xa508('0x1f')],{'raw':_0x1076e3[_0xa508('0x17')]?_0x1076e3['options'][_0xa508('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1076e3[_0xa508('0x17')]?_0x1076e3[_0xa508('0x17')][_0xa508('0x21')]||null:null,'attributes':_0x1076e3[_0xa508('0x17')]?_0x1076e3[_0xa508('0x17')]['attributes']||null:null,'limit':_0x1076e3['options']?_0x1076e3[_0xa508('0x17')][_0xa508('0x19')]||null:null})[_0xa508('0xb')](function(_0x345331){logger['info'](_0xa508('0x1e'),_0x1076e3);logger[_0xa508('0xf')]('UpdateCmHopperBlack',_0x1076e3,JSON[_0xa508('0x1d')](_0x345331));_0x4bc3f6(_0x345331);})[_0xa508('0x14')](function(_0x300cdc){logger[_0xa508('0x11')](_0xa508('0x1e'),_0x300cdc[_0xa508('0x13')],_0x1076e3);_0x3f78a7(_0x426a9d[_0xa508('0x11')](0x1f4,_0x300cdc[_0xa508('0x13')]));});});};exports[_0xa508('0x22')]=function(_0x38b40c){var _0x7bf963=this;return new Promise(function(_0xff57e2,_0x418e46){return db[_0xa508('0x23')][_0xa508('0x24')]({'where':_0x38b40c[_0xa508('0x17')]?_0x38b40c[_0xa508('0x17')][_0xa508('0x21')]||null:null})[_0xa508('0xb')](function(_0x384c05){logger[_0xa508('0xc')](_0xa508('0x22'),_0x38b40c);logger[_0xa508('0xf')](_0xa508('0x22'),_0x38b40c,JSON[_0xa508('0x1d')](_0x384c05));_0xff57e2(_0x384c05);})[_0xa508('0x14')](function(_0x1168e0){logger[_0xa508('0x11')]('DestroyCmHopperBlack',_0x1168e0[_0xa508('0x13')],_0x38b40c);_0x418e46(_0x7bf963['error'](0x1f4,_0x1168e0[_0xa508('0x13')]));});});}; \ No newline at end of file +var _0xfe7f=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../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','CmHopperBlack','findAll','options','where','limit','map','include','model','attributes','GetCmHopperBlack','debug','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack'];(function(_0x4f6c38,_0x4850dd){var _0x4d5d79=function(_0x136ef4){while(--_0x136ef4){_0x4f6c38['push'](_0x4f6c38['shift']());}};_0x4d5d79(++_0x4850dd);}(_0xfe7f,0x111));var _0xffe7=function(_0x57a342,_0x292014){_0x57a342=_0x57a342-0x0;var _0xc3d159=_0xfe7f[_0x57a342];return _0xc3d159;};'use strict';var _=require(_0xffe7('0x0'));var util=require(_0xffe7('0x1'));var moment=require('moment');var BPromise=require(_0xffe7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffe7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe7('0x4'));var logger=require(_0xffe7('0x5'))(_0xffe7('0x6'));var config=require(_0xffe7('0x7'));var jayson=require(_0xffe7('0x8'));var client=jayson[_0xffe7('0x9')][_0xffe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x589105,_0x16e830,_0x354903){return new BPromise(function(_0x43eeb6,_0x2f9946){return client[_0xffe7('0xb')](_0x589105,_0x354903)[_0xffe7('0xc')](function(_0x3b23f9){logger[_0xffe7('0xd')](_0xffe7('0xe'),_0x16e830,_0xffe7('0xf'));logger['debug'](_0xffe7('0x10'),_0x16e830,_0xffe7('0xf'),JSON[_0xffe7('0x11')](_0x3b23f9));if(_0x3b23f9[_0xffe7('0x12')]){if(_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x13')]===0x1f4){logger[_0xffe7('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x16e830,_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x14')]);return _0x2f9946(_0x3b23f9[_0xffe7('0x12')]['message']);}logger['error'](_0xffe7('0xe'),_0x16e830,_0x3b23f9[_0xffe7('0x12')]['message']);return _0x43eeb6(_0x3b23f9[_0xffe7('0x12')][_0xffe7('0x14')]);}else{logger['info'](_0xffe7('0xe'),_0x16e830,_0xffe7('0xf'));_0x43eeb6(_0x3b23f9[_0xffe7('0x15')]['message']);}})[_0xffe7('0x16')](function(_0x303372){logger[_0xffe7('0x12')](_0xffe7('0xe'),_0x16e830,_0x303372);_0x2f9946(_0x303372);});});}exports['GetCmHopperBlack']=function(_0x543565){var _0x5c0be1=this;return new Promise(function(_0x13d404,_0x2a2900){return db[_0xffe7('0x17')][_0xffe7('0x18')]({'raw':_0x543565['options']?_0x543565['options']['raw']===undefined?!![]:![]:!![],'where':_0x543565[_0xffe7('0x19')]?_0x543565['options'][_0xffe7('0x1a')]||null:null,'attributes':_0x543565[_0xffe7('0x19')]?_0x543565[_0xffe7('0x19')]['attributes']||null:null,'limit':_0x543565[_0xffe7('0x19')]?_0x543565['options'][_0xffe7('0x1b')]||null:null,'include':_0x543565['options']?_0x543565['options']['include']?_[_0xffe7('0x1c')](_0x543565[_0xffe7('0x19')][_0xffe7('0x1d')],function(_0x575950){return{'model':db[_0x575950[_0xffe7('0x1e')]],'as':_0x575950['as'],'attributes':_0x575950[_0xffe7('0x1f')],'include':_0x575950[_0xffe7('0x1d')]?_[_0xffe7('0x1c')](_0x575950['include'],function(_0x327e7b){return{'model':db[_0x327e7b[_0xffe7('0x1e')]],'as':_0x327e7b['as'],'attributes':_0x327e7b[_0xffe7('0x1f')],'include':_0x327e7b[_0xffe7('0x1d')]?_[_0xffe7('0x1c')](_0x327e7b[_0xffe7('0x1d')],function(_0x2b9012){return{'model':db[_0x2b9012[_0xffe7('0x1e')]],'as':_0x2b9012['as'],'attributes':_0x2b9012[_0xffe7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8aedec){logger[_0xffe7('0xd')](_0xffe7('0x20'),_0x543565);logger[_0xffe7('0x21')](_0xffe7('0x20'),_0x543565,JSON[_0xffe7('0x11')](_0x8aedec));_0x13d404(_0x8aedec);})[_0xffe7('0x16')](function(_0x2a8d85){logger[_0xffe7('0x12')](_0xffe7('0x20'),_0x2a8d85['message'],_0x543565);_0x2a2900(_0x5c0be1[_0xffe7('0x12')](0x1f4,_0x2a8d85[_0xffe7('0x14')]));});});};exports[_0xffe7('0x22')]=function(_0x979d10){var _0x5e512f=this;return new Promise(function(_0x3e64f8,_0x4ddeb1){return db[_0xffe7('0x17')][_0xffe7('0x23')](_0x979d10[_0xffe7('0x24')],{'raw':_0x979d10[_0xffe7('0x19')]?_0x979d10[_0xffe7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x979d10[_0xffe7('0x19')]?_0x979d10['options']['where']||null:null,'attributes':_0x979d10['options']?_0x979d10[_0xffe7('0x19')][_0xffe7('0x1f')]||null:null,'limit':_0x979d10[_0xffe7('0x19')]?_0x979d10[_0xffe7('0x19')][_0xffe7('0x1b')]||null:null})['then'](function(_0x1d1df9){logger[_0xffe7('0xd')](_0xffe7('0x22'),_0x979d10);logger['debug'](_0xffe7('0x22'),_0x979d10,JSON[_0xffe7('0x11')](_0x1d1df9));_0x3e64f8(_0x1d1df9);})[_0xffe7('0x16')](function(_0x2d0d6e){logger[_0xffe7('0x12')](_0xffe7('0x22'),_0x2d0d6e[_0xffe7('0x14')],_0x979d10);_0x4ddeb1(_0x5e512f[_0xffe7('0x12')](0x1f4,_0x2d0d6e['message']));});});};exports['DestroyCmHopperBlack']=function(_0xd7315c){var _0x23732d=this;return new Promise(function(_0xed836,_0x25c76c){return db['CmHopperBlack'][_0xffe7('0x25')]({'where':_0xd7315c[_0xffe7('0x19')]?_0xd7315c['options'][_0xffe7('0x1a')]||null:null})[_0xffe7('0xc')](function(_0x561437){logger['info'](_0xffe7('0x26'),_0xd7315c);logger[_0xffe7('0x21')]('DestroyCmHopperBlack',_0xd7315c,JSON[_0xffe7('0x11')](_0x561437));_0xed836(_0x561437);})['catch'](function(_0x29e83d){logger[_0xffe7('0x12')](_0xffe7('0x26'),_0x29e83d[_0xffe7('0x14')],_0xd7315c);_0x25c76c(_0x23732d['error'](0x1f4,_0x29e83d[_0xffe7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 5774b0d..9551c54 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 _0xc23a=['/:id','exports','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','describe','show','put'];(function(_0x1d6a39,_0x5e3ba1){var _0x534782=function(_0x1d0b72){while(--_0x1d0b72){_0x1d6a39['push'](_0x1d6a39['shift']());}};_0x534782(++_0x5e3ba1);}(_0xc23a,0xd2));var _0xac23=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc23a[_0x1b6186];return _0x186121;};'use strict';var multer=require('multer');var util=require(_0xac23('0x0'));var path=require(_0xac23('0x1'));var timeout=require(_0xac23('0x2'));var express=require('express');var router=express[_0xac23('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac23('0x4'));var controller=require('./cmHopperBlack.controller');router[_0xac23('0x5')]('/',auth[_0xac23('0x6')](),controller[_0xac23('0x7')]);router['get']('/describe',auth[_0xac23('0x6')](),controller[_0xac23('0x8')]);router[_0xac23('0x5')]('/:id',auth[_0xac23('0x6')](),controller[_0xac23('0x9')]);router[_0xac23('0xa')](_0xac23('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xac23('0xb'),auth[_0xac23('0x6')](),controller['destroy']);module[_0xac23('0xc')]=router; \ No newline at end of file +var _0x2da1=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','update','delete','destroy','multer','util'];(function(_0x34b819,_0x2db518){var _0x463ab2=function(_0x2a8a29){while(--_0x2a8a29){_0x34b819['push'](_0x34b819['shift']());}};_0x463ab2(++_0x2db518);}(_0x2da1,0xca));var _0x12da=function(_0x44edb0,_0x7a1d21){_0x44edb0=_0x44edb0-0x0;var _0x38dbd0=_0x2da1[_0x44edb0];return _0x38dbd0;};'use strict';var multer=require(_0x12da('0x0'));var util=require(_0x12da('0x1'));var path=require('path');var timeout=require(_0x12da('0x2'));var express=require('express');var router=express[_0x12da('0x3')]();var auth=require(_0x12da('0x4'));var interaction=require(_0x12da('0x5'));var config=require(_0x12da('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x12da('0x7')]('/',auth[_0x12da('0x8')](),controller[_0x12da('0x9')]);router[_0x12da('0x7')](_0x12da('0xa'),auth[_0x12da('0x8')](),controller[_0x12da('0xb')]);router['get'](_0x12da('0xc'),auth[_0x12da('0x8')](),controller[_0x12da('0xd')]);router['put'](_0x12da('0xc'),auth[_0x12da('0x8')](),controller[_0x12da('0xe')]);router[_0x12da('0xf')](_0x12da('0xc'),auth['isAuthenticated'](),controller[_0x12da('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 69dc3ad..03a35c5 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 _0xe2cf=['moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','seconds','dispositionat','BOOLEAN'];(function(_0x392f8b,_0x121ff9){var _0x3bea2d=function(_0x25be3e){while(--_0x25be3e){_0x392f8b['push'](_0x392f8b['shift']());}};_0x3bea2d(++_0x121ff9);}(_0xe2cf,0xfa));var _0xfe2c=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0xe2cf[_0x5cdacf];return _0xa68a8b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe2c('0x0'));module['exports']={'state':{'type':Sequelize[_0xfe2c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfe2c('0x2')]},'scheduledat':{'type':Sequelize[_0xfe2c('0x3')]},'countbusyretry':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfe2c('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfe2c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfe2c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfe2c('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xfe2c('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfe2c('0x3')]},'endtime':{'type':Sequelize[_0xfe2c('0x3')]},'ringtime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfe2c('0x2')]},'campaign':{'type':Sequelize[_0xfe2c('0x2')]},'campaigntype':{'type':Sequelize[_0xfe2c('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfe2c('0x2')]},'disposition':{'type':Sequelize[_0xfe2c('0x2')]},'dispositionat':{'type':Sequelize[_0xfe2c('0x3')],'set':function(_0x5711d7){var _0x2a6d4c=this[_0xfe2c('0x4')](_0xfe2c('0x5'));if(_0x2a6d4c&&_0x5711d7){this[_0xfe2c('0x6')]('followuptime',moment(_0x5711d7)['diff'](moment(_0x2a6d4c),_0xfe2c('0x7')));}return this[_0xfe2c('0x6')](_0xfe2c('0x8'),_0x5711d7);}},'amd':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfe2c('0x3')]},'callback':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfe2c('0x3')]},'recallme':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb11a=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x85c4ac,_0x1930fd){var _0x53a7dd=function(_0x73a84d){while(--_0x73a84d){_0x85c4ac['push'](_0x85c4ac['shift']());}};_0x53a7dd(++_0x1930fd);}(_0xb11a,0x81));var _0xab11=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xb11a[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require(_0xab11('0x0'));var moment=require(_0xab11('0x1'));module[_0xab11('0x2')]={'state':{'type':Sequelize[_0xab11('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xab11('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xab11('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xab11('0x4')]},'originatecalleridname':{'type':Sequelize[_0xab11('0x4')]},'calleridnum':{'type':Sequelize[_0xab11('0x4')]},'calleridname':{'type':Sequelize[_0xab11('0x4')]},'starttime':{'type':Sequelize[_0xab11('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xab11('0x5')]},'droptime':{'type':Sequelize[_0xab11('0x5')]},'endtime':{'type':Sequelize[_0xab11('0x5')]},'ringtime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xab11('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xab11('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xab11('0x5')],'set':function(_0x206820){var _0x458704=this[_0xab11('0x6')](_0xab11('0x7'));if(_0x458704&&_0x206820){this[_0xab11('0x8')](_0xab11('0x9'),moment(_0x206820)[_0xab11('0xa')](moment(_0x458704),_0xab11('0xb')));}return this[_0xab11('0x8')](_0xab11('0xc'),_0x206820);}},'amd':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xab11('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xab11('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xab11('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xab11('0x5')]},'deleted':{'type':Sequelize[_0xab11('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xab11('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xab11('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ac07fbe..d525211 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 _0xa263=['options','includeAll','findAll','rows','catch','show','params','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','abandonedContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','Campaign','into','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0xa263,0x135));var _0x3a26=function(_0x4b49cb,_0x4eb15c){_0x4b49cb=_0x4b49cb-0x0;var _0x4d3a2f=_0xa263[_0x4b49cb];return _0x4d3a2f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a26('0x0'));var rp=require(_0x3a26('0x1'));var moment=require(_0x3a26('0x2'));var BPromise=require(_0x3a26('0x3'));var Mustache=require(_0x3a26('0x4'));var util=require(_0x3a26('0x5'));var path=require(_0x3a26('0x6'));var sox=require('sox');var csv=require(_0x3a26('0x7'));var ejs=require(_0x3a26('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3a26('0x9'));var crypto=require(_0x3a26('0xa'));var jsforce=require(_0x3a26('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3a26('0x7'));var querystring=require(_0x3a26('0xc'));var Papa=require(_0x3a26('0xd'));var Redis=require(_0x3a26('0xe'));var authService=require(_0x3a26('0xf'));var qs=require(_0x3a26('0x10'));var hardwareService=require(_0x3a26('0x11'));var logger=require('../../config/logger')(_0x3a26('0x12'));var utils=require('../../config/utils');var config=require(_0x3a26('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x264cff,_0x2c8664){_0x2c8664=_0x2c8664||0xcc;return function(_0x5ca51b){if(_0x5ca51b){return _0x264cff[_0x3a26('0x14')](_0x2c8664);}return _0x264cff['status'](_0x2c8664)['end']();};}function respondWithResult(_0x55239e,_0x4b4fec){_0x4b4fec=_0x4b4fec||0xc8;return function(_0x5e8ffe){if(_0x5e8ffe){return _0x55239e[_0x3a26('0x15')](_0x4b4fec)[_0x3a26('0x16')](_0x5e8ffe);}};}function respondWithFilteredResult(_0x10fdc1,_0x65e21d){return function(_0x348a79){if(_0x348a79){var _0x1fd06b=_0x348a79[_0x3a26('0x17')],_0x53fb30=_0x65e21d[_0x3a26('0x18')],_0x1a4423=_0x65e21d[_0x3a26('0x18')]+_0x65e21d[_0x3a26('0x19')],_0xf4dfb1;if(_0x1a4423>=_0x1fd06b){_0x1a4423=_0x1fd06b;_0xf4dfb1=0xc8;}else{_0xf4dfb1=0xce;}_0x10fdc1['status'](_0xf4dfb1);return _0x10fdc1[_0x3a26('0x1a')](_0x3a26('0x1b'),_0x53fb30+'-'+_0x1a4423+'/'+_0x1fd06b)[_0x3a26('0x16')](_0x348a79);}return null;};}function patchUpdates(_0x5e3a19){return function(_0x886c94){try{jsonpatch[_0x3a26('0x1c')](_0x886c94,_0x5e3a19,!![]);}catch(_0x1dc572){return BPromise[_0x3a26('0x1d')](_0x1dc572);}return _0x886c94[_0x3a26('0x1e')]();};}function saveUpdates(_0x5d0db9,_0x3aac08){return function(_0x22e0ae){if(_0x22e0ae){return _0x22e0ae['update'](_0x5d0db9)[_0x3a26('0x1f')](function(_0x23a32b){return _0x23a32b;});}return null;};}function removeEntity(_0x17968e,_0x4fe510){return function(_0x5913e2){if(_0x5913e2){return _0x5913e2[_0x3a26('0x20')]()['then'](function(){_0x17968e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0bc4,_0x431231){return function(_0x41c27e){if(!_0x41c27e){_0x2f0bc4[_0x3a26('0x14')](0x194);}return _0x41c27e;};}function handleError(_0x245cbf,_0x2d4a49){_0x2d4a49=_0x2d4a49||0x1f4;return function(_0x407a94){logger[_0x3a26('0x21')](_0x407a94[_0x3a26('0x22')]);if(_0x407a94[_0x3a26('0x23')]){delete _0x407a94['name'];}_0x245cbf[_0x3a26('0x15')](_0x2d4a49)[_0x3a26('0x24')](_0x407a94);};}exports[_0x3a26('0x25')]=function(_0x240acb,_0x3749d2){var _0x3d2d29={},_0x47dc1f={},_0x161045={'count':0x0,'rows':[]};var _0x526a5f=db[_0x3a26('0x26')][_0x3a26('0x27')];_0x47dc1f[_0x3a26('0x28')]=_[_0x3a26('0x29')](_0x526a5f);_0x47dc1f['query']=_[_0x3a26('0x29')](_0x240acb[_0x3a26('0x2a')]);_0x47dc1f[_0x3a26('0x2b')]=_[_0x3a26('0x2c')](_0x47dc1f['model'],_0x47dc1f['query']);_0x3d2d29[_0x3a26('0x2d')]=_[_0x3a26('0x2c')](_0x47dc1f['model'],qs[_0x3a26('0x2e')](_0x240acb['query']['fields']));_0x3d2d29[_0x3a26('0x2d')]=_0x3d2d29['attributes'][_0x3a26('0x2f')]?_0x3d2d29[_0x3a26('0x2d')]:_0x47dc1f[_0x3a26('0x28')];if(!_0x240acb[_0x3a26('0x2a')][_0x3a26('0x30')](_0x3a26('0x31'))){_0x3d2d29[_0x3a26('0x19')]=qs[_0x3a26('0x19')](_0x240acb[_0x3a26('0x2a')][_0x3a26('0x19')]);_0x3d2d29[_0x3a26('0x18')]=qs[_0x3a26('0x18')](_0x240acb['query'][_0x3a26('0x18')]);}_0x3d2d29[_0x3a26('0x32')]=qs[_0x3a26('0x33')](_0x240acb[_0x3a26('0x2a')][_0x3a26('0x33')]);_0x3d2d29[_0x3a26('0x34')]=qs[_0x3a26('0x2b')](_[_0x3a26('0x35')](_0x240acb[_0x3a26('0x2a')],_0x47dc1f[_0x3a26('0x2b')]));if(_0x240acb[_0x3a26('0x2a')]['filter']){_0x3d2d29[_0x3a26('0x34')]=_[_0x3a26('0x36')](_0x3d2d29[_0x3a26('0x34')],{'$or':_[_0x3a26('0x37')](_0x526a5f,function(_0x505427){if(_0x505427['type'][_0x3a26('0x38')]!==_0x3a26('0x39')){var _0x3e2b5e={};_0x3e2b5e[_0x505427[_0x3a26('0x3a')]]={'$like':'%'+_0x240acb['query'][_0x3a26('0x3b')]+'%'};return _0x3e2b5e;}})});}_0x3d2d29=_[_0x3a26('0x36')]({},_0x3d2d29,_0x240acb[_0x3a26('0x3c')]);var _0x439293={'where':_0x3d2d29[_0x3a26('0x34')]};return db[_0x3a26('0x26')][_0x3a26('0x17')](_0x439293)[_0x3a26('0x1f')](function(_0x480706){_0x161045[_0x3a26('0x17')]=_0x480706;if(_0x240acb[_0x3a26('0x2a')][_0x3a26('0x3d')]){_0x3d2d29['include']=[{'all':!![]}];}return db[_0x3a26('0x26')][_0x3a26('0x3e')](_0x3d2d29);})[_0x3a26('0x1f')](function(_0x1e7666){_0x161045[_0x3a26('0x3f')]=_0x1e7666;return _0x161045;})[_0x3a26('0x1f')](respondWithFilteredResult(_0x3749d2,_0x3d2d29))[_0x3a26('0x40')](handleError(_0x3749d2,null));};exports[_0x3a26('0x41')]=function(_0x41c8d6,_0xb960c4){var _0x40bc65={'raw':!![],'where':{'id':_0x41c8d6[_0x3a26('0x42')]['id']}},_0x559aaa={};_0x559aaa[_0x3a26('0x28')]=_[_0x3a26('0x29')](db[_0x3a26('0x26')][_0x3a26('0x27')]);_0x559aaa[_0x3a26('0x2a')]=_[_0x3a26('0x29')](_0x41c8d6['query']);_0x559aaa[_0x3a26('0x2b')]=_[_0x3a26('0x2c')](_0x559aaa['model'],_0x559aaa[_0x3a26('0x2a')]);_0x40bc65[_0x3a26('0x2d')]=_[_0x3a26('0x2c')](_0x559aaa[_0x3a26('0x28')],qs[_0x3a26('0x2e')](_0x41c8d6[_0x3a26('0x2a')][_0x3a26('0x2e')]));_0x40bc65['attributes']=_0x40bc65[_0x3a26('0x2d')][_0x3a26('0x2f')]?_0x40bc65['attributes']:_0x559aaa[_0x3a26('0x28')];if(_0x41c8d6[_0x3a26('0x2a')][_0x3a26('0x3d')]){_0x40bc65['include']=[{'all':!![]}];}_0x40bc65=_[_0x3a26('0x36')]({},_0x40bc65,_0x41c8d6[_0x3a26('0x3c')]);return db[_0x3a26('0x26')][_0x3a26('0x43')](_0x40bc65)[_0x3a26('0x1f')](handleEntityNotFound(_0xb960c4,null))[_0x3a26('0x1f')](respondWithResult(_0xb960c4,null))[_0x3a26('0x40')](handleError(_0xb960c4,null));};exports[_0x3a26('0x44')]=function(_0x5b971f,_0xce3544){return db[_0x3a26('0x26')]['describe']()[_0x3a26('0x1f')](respondWithResult(_0xce3544,null))[_0x3a26('0x40')](handleError(_0xce3544,null));};exports[_0x3a26('0x45')]=function(_0x53c637,_0x244316){if(_0x53c637[_0x3a26('0x46')]['uniqueid']){delete _0x53c637[_0x3a26('0x46')][_0x3a26('0x47')];}return db['CmHopperFinal'][_0x3a26('0x43')]({'where':{'uniqueid':_0x53c637[_0x3a26('0x42')]['id']}})['then'](handleEntityNotFound(_0x244316,null))[_0x3a26('0x1f')](saveUpdates(_0x53c637['body'],null))[_0x3a26('0x1f')](respondWithResult(_0x244316,null))[_0x3a26('0x40')](handleError(_0x244316,null));};exports[_0x3a26('0x48')]=function(_0x327000,_0x4f0bad,_0x41cd5){return db[_0x3a26('0x26')][_0x3a26('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x327000[_0x3a26('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0x3a26('0x49'),db['sequelize']['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4c')))),'noSuchContacts'],[db[_0x3a26('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3a26('0x4b')](_0x3a26('0x4d')))),_0x3a26('0x4e')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4f')))),_0x3a26('0x50')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x3a26('0x51')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x52')))),_0x3a26('0x53')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x54')))),'abandonedContacts'],[db['sequelize']['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x55')))),_0x3a26('0x56')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x3a26('0x1f')](handleEntityNotFound(_0x4f0bad,null))[_0x3a26('0x1f')](respondWithResult(_0x4f0bad,null))[_0x3a26('0x40')](handleError(_0x4f0bad,null));};exports[_0x3a26('0x57')]=function(_0x5547f7,_0x42003d,_0x51e413){return db[_0x3a26('0x26')][_0x3a26('0x3e')]({'raw':![],'where':{'CampaignId':_0x5547f7[_0x3a26('0x42')]['id']},'attributes':[[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db['sequelize'][_0x3a26('0x4b')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4d')))),_0x3a26('0x4e')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db['sequelize'][_0x3a26('0x4b')](_0x3a26('0x4f')))),_0x3a26('0x50')],[db[_0x3a26('0x4a')]['fn']('COUNT',db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x52')))),_0x3a26('0x53')],[db[_0x3a26('0x4a')]['fn']('COUNT',db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x54')))),_0x3a26('0x58')],[db['sequelize']['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x3a26('0x56')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db['sequelize']['fn']('IF',db[_0x3a26('0x4a')]['literal'](_0x3a26('0x59')))),_0x3a26('0x5a')]]})[_0x3a26('0x1f')](handleEntityNotFound(_0x42003d,null))[_0x3a26('0x1f')](respondWithResult(_0x42003d,null))[_0x3a26('0x40')](handleError(_0x42003d,null));};exports[_0x3a26('0x5b')]=function(_0x4717f0,_0xa7c212,_0x26948b){return db['VoiceQueue'][_0x3a26('0x43')]({'where':{'id':_0x4717f0[_0x3a26('0x42')]['id']}})[_0x3a26('0x1f')](handleEntityNotFound(_0xa7c212,null))[_0x3a26('0x1f')](function(_0x59de12){var _0x2f0e8e;if(_0x59de12){_0x2f0e8e=squel[_0x3a26('0x5c')]()['into'](_0x3a26('0x5d'))['fromQuery']([_0x3a26('0x5e'),_0x3a26('0x5f'),_0x3a26('0x60'),_0x3a26('0x61'),'VoiceQueueId','createdAt',_0x3a26('0x62')],squel[_0x3a26('0x63')]()['field'](_0x3a26('0x64'),_0x3a26('0x5e'))[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x5f'))[_0x3a26('0x3a')](_0x3a26('0x66'),'ContactId')[_0x3a26('0x3a')]('ANY_VALUE(ListId)',_0x3a26('0x61'))[_0x3a26('0x3a')](_0x3a26('0x67'),_0x3a26('0x68'))[_0x3a26('0x3a')](_0x3a26('0x65'),'createdAt')[_0x3a26('0x3a')](_0x3a26('0x65'),'updatedAt')[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')]('VoiceQueueId\x20=\x20?',_0x4717f0[_0x3a26('0x42')]['id'][_0x3a26('0x6b')]())[_0x3a26('0x34')](_0x3a26('0x6c'),_0x4717f0[_0x3a26('0x46')][_0x3a26('0x6d')]['toString']())[_0x3a26('0x34')](_0x3a26('0x6e'))[_0x3a26('0x34')](_0x3a26('0x6f'),squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x5e'))[_0x3a26('0x69')](_0x3a26('0x5d'))['where']('VoiceQueueId\x20=\x20?',_0x4717f0[_0x3a26('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x70'))['from'](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x71'),_0x4717f0['params']['id'][_0x3a26('0x6b')]())['where'](_0x3a26('0x72')))['group'](_0x3a26('0x60')))['toString']();return db[_0x3a26('0x4a')][_0x3a26('0x2a')](_0x2f0e8e);}return[];})[_0x3a26('0x1f')](respondWithResult(_0xa7c212,null))[_0x3a26('0x40')](handleError(_0xa7c212,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x4787ac,_0x49bcf8,_0x1280b8){return db[_0x3a26('0x73')][_0x3a26('0x43')]({'where':{'id':_0x4787ac[_0x3a26('0x42')]['id']}})[_0x3a26('0x1f')](handleEntityNotFound(_0x49bcf8,null))[_0x3a26('0x1f')](function(_0x1590c5){var _0x798fe0;if(_0x1590c5){_0x798fe0=squel[_0x3a26('0x5c')]()[_0x3a26('0x74')]('cm_hopper')['fromQuery']([_0x3a26('0x5e'),_0x3a26('0x5f'),_0x3a26('0x60'),_0x3a26('0x61'),_0x3a26('0x75'),_0x3a26('0x76'),_0x3a26('0x62')],squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x64'),'phone')[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x5f'))['field'](_0x3a26('0x66'),_0x3a26('0x60'))[_0x3a26('0x3a')]('ANY_VALUE(ListId)',_0x3a26('0x61'))[_0x3a26('0x3a')](_0x3a26('0x77'),'CampaignId')[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x76'))[_0x3a26('0x3a')]('NOW()',_0x3a26('0x62'))[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x78'),_0x4787ac[_0x3a26('0x42')]['id']['toString']())[_0x3a26('0x34')](_0x3a26('0x6c'),_0x4787ac[_0x3a26('0x46')]['state'][_0x3a26('0x6b')]())[_0x3a26('0x34')](_0x3a26('0x6e'))[_0x3a26('0x34')](_0x3a26('0x6f'),squel['select']()[_0x3a26('0x3a')](_0x3a26('0x5e'))[_0x3a26('0x69')](_0x3a26('0x5d'))[_0x3a26('0x34')]('CampaignId\x20=\x20?',_0x4787ac[_0x3a26('0x42')]['id']['toString']()))[_0x3a26('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x70'))[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x78'),_0x4787ac[_0x3a26('0x42')]['id'][_0x3a26('0x6b')]())['where'](_0x3a26('0x72')))['group'](_0x3a26('0x60')))[_0x3a26('0x6b')]();return db[_0x3a26('0x4a')]['query'](_0x798fe0);}return[];})[_0x3a26('0x1f')](respondWithResult(_0x49bcf8,null))[_0x3a26('0x40')](handleError(_0x49bcf8,null));};exports[_0x3a26('0x79')]=function(_0x111442,_0x117531,_0x46627c){return db['CmHopper'][_0x3a26('0x7a')]({'where':{'VoiceQueueId':_0x111442['body']['VoiceQueueId'],'CampaignId':_0x111442[_0x3a26('0x46')]['CampaignId'],'ContactId':_0x111442[_0x3a26('0x46')][_0x3a26('0x60')]}})['then'](handleEntityNotFound(_0x117531,null))[_0x3a26('0x1f')](function(_0x5736bd){if(_0x5736bd){return _0x5736bd;}return null;})[_0x3a26('0x1f')](respondWithResult(_0x117531,null))[_0x3a26('0x40')](handleError(_0x117531,null));}; \ No newline at end of file +var _0x25d4=['literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','ContactId','VoiceQueueId','select','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','field','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','createdAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','updatedAt','ANY_VALUE(CampaignId)','state\x20=\x20?','checkContactHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','options','CmHopperFinal','includeAll','include','findAll','catch','params','length','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT'];(function(_0x5464ab,_0x329d11){var _0x15432c=function(_0x451994){while(--_0x451994){_0x5464ab['push'](_0x5464ab['shift']());}};_0x15432c(++_0x329d11);}(_0x25d4,0xb1));var _0x425d=function(_0x395635,_0x18927d){_0x395635=_0x395635-0x0;var _0xf99470=_0x25d4[_0x395635];return _0xf99470;};'use strict';var pdf=require(_0x425d('0x0'));var emlformat=require(_0x425d('0x1'));var rimraf=require(_0x425d('0x2'));var zipdir=require(_0x425d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x425d('0x4'));var moment=require(_0x425d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x425d('0x6'));var util=require('util');var path=require(_0x425d('0x7'));var sox=require(_0x425d('0x8'));var csv=require(_0x425d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x425d('0xa'));var squel=require('squel');var crypto=require(_0x425d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x425d('0x9'));var querystring=require(_0x425d('0xc'));var Papa=require(_0x425d('0xd'));var Redis=require(_0x425d('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x425d('0xf'));var logger=require('../../config/logger')(_0x425d('0x10'));var utils=require('../../config/utils');var config=require(_0x425d('0x11'));var db=require(_0x425d('0x12'))['db'];function respondWithStatusCode(_0x194056,_0x299d14){_0x299d14=_0x299d14||0xcc;return function(_0x295a13){if(_0x295a13){return _0x194056[_0x425d('0x13')](_0x299d14);}return _0x194056[_0x425d('0x14')](_0x299d14)[_0x425d('0x15')]();};}function respondWithResult(_0x4b697c,_0x2729b8){_0x2729b8=_0x2729b8||0xc8;return function(_0x22a390){if(_0x22a390){return _0x4b697c[_0x425d('0x14')](_0x2729b8)[_0x425d('0x16')](_0x22a390);}};}function respondWithFilteredResult(_0x2573c3,_0x36b7eb){return function(_0x2fe443){if(_0x2fe443){var _0x10ea9c=_0x2fe443[_0x425d('0x17')],_0x359454=_0x36b7eb[_0x425d('0x18')],_0xb03bf=_0x36b7eb[_0x425d('0x18')]+_0x36b7eb[_0x425d('0x19')],_0x523a81;if(_0xb03bf>=_0x10ea9c){_0xb03bf=_0x10ea9c;_0x523a81=0xc8;}else{_0x523a81=0xce;}_0x2573c3[_0x425d('0x14')](_0x523a81);return _0x2573c3[_0x425d('0x1a')](_0x425d('0x1b'),_0x359454+'-'+_0xb03bf+'/'+_0x10ea9c)[_0x425d('0x16')](_0x2fe443);}return null;};}function patchUpdates(_0x1be86c){return function(_0x597c14){try{jsonpatch['apply'](_0x597c14,_0x1be86c,!![]);}catch(_0x98f68e){return BPromise[_0x425d('0x1c')](_0x98f68e);}return _0x597c14[_0x425d('0x1d')]();};}function saveUpdates(_0x4368ab,_0x402dec){return function(_0xd8765b){if(_0xd8765b){return _0xd8765b[_0x425d('0x1e')](_0x4368ab)[_0x425d('0x1f')](function(_0x2e0257){return _0x2e0257;});}return null;};}function removeEntity(_0x4fe28b,_0x2a2e22){return function(_0x3bd80c){if(_0x3bd80c){return _0x3bd80c[_0x425d('0x20')]()[_0x425d('0x1f')](function(){_0x4fe28b[_0x425d('0x14')](0xcc)[_0x425d('0x15')]();});}};}function handleEntityNotFound(_0xb63164,_0x205738){return function(_0x3a8169){if(!_0x3a8169){_0xb63164[_0x425d('0x13')](0x194);}return _0x3a8169;};}function handleError(_0x33639b,_0xae083f){_0xae083f=_0xae083f||0x1f4;return function(_0x1ff3f7){logger[_0x425d('0x21')](_0x1ff3f7['stack']);if(_0x1ff3f7[_0x425d('0x22')]){delete _0x1ff3f7[_0x425d('0x22')];}_0x33639b[_0x425d('0x14')](_0xae083f)[_0x425d('0x23')](_0x1ff3f7);};}exports[_0x425d('0x24')]=function(_0x434a62,_0x3332c8){var _0x10b6ea={},_0x4c891b={},_0xe62b86={'count':0x0,'rows':[]};var _0x46feb8=db['CmHopperFinal'][_0x425d('0x25')];_0x4c891b[_0x425d('0x26')]=_[_0x425d('0x27')](_0x46feb8);_0x4c891b[_0x425d('0x28')]=_[_0x425d('0x27')](_0x434a62[_0x425d('0x28')]);_0x4c891b[_0x425d('0x29')]=_['intersection'](_0x4c891b[_0x425d('0x26')],_0x4c891b[_0x425d('0x28')]);_0x10b6ea[_0x425d('0x2a')]=_[_0x425d('0x2b')](_0x4c891b['model'],qs[_0x425d('0x2c')](_0x434a62[_0x425d('0x28')]['fields']));_0x10b6ea[_0x425d('0x2a')]=_0x10b6ea['attributes']['length']?_0x10b6ea[_0x425d('0x2a')]:_0x4c891b[_0x425d('0x26')];if(!_0x434a62['query'][_0x425d('0x2d')](_0x425d('0x2e'))){_0x10b6ea['limit']=qs['limit'](_0x434a62[_0x425d('0x28')][_0x425d('0x19')]);_0x10b6ea[_0x425d('0x18')]=qs[_0x425d('0x18')](_0x434a62[_0x425d('0x28')][_0x425d('0x18')]);}_0x10b6ea['order']=qs['sort'](_0x434a62[_0x425d('0x28')][_0x425d('0x2f')]);_0x10b6ea[_0x425d('0x30')]=qs[_0x425d('0x29')](_[_0x425d('0x31')](_0x434a62[_0x425d('0x28')],_0x4c891b[_0x425d('0x29')]));if(_0x434a62[_0x425d('0x28')][_0x425d('0x32')]){_0x10b6ea[_0x425d('0x30')]=_[_0x425d('0x33')](_0x10b6ea[_0x425d('0x30')],{'$or':_[_0x425d('0x34')](_0x46feb8,function(_0x126a37){if(_0x126a37['type'][_0x425d('0x35')]!=='VIRTUAL'){var _0x3f2cdf={};_0x3f2cdf[_0x126a37['field']]={'$like':'%'+_0x434a62[_0x425d('0x28')][_0x425d('0x32')]+'%'};return _0x3f2cdf;}})});}_0x10b6ea=_['merge']({},_0x10b6ea,_0x434a62[_0x425d('0x36')]);var _0x3f803d={'where':_0x10b6ea['where']};return db[_0x425d('0x37')][_0x425d('0x17')](_0x3f803d)[_0x425d('0x1f')](function(_0x265e11){_0xe62b86['count']=_0x265e11;if(_0x434a62[_0x425d('0x28')][_0x425d('0x38')]){_0x10b6ea[_0x425d('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x425d('0x3a')](_0x10b6ea);})[_0x425d('0x1f')](function(_0x8a09cc){_0xe62b86['rows']=_0x8a09cc;return _0xe62b86;})['then'](respondWithFilteredResult(_0x3332c8,_0x10b6ea))[_0x425d('0x3b')](handleError(_0x3332c8,null));};exports['show']=function(_0x29eba2,_0x2c16a8){var _0x223462={'raw':!![],'where':{'id':_0x29eba2[_0x425d('0x3c')]['id']}},_0x2c7afc={};_0x2c7afc['model']=_[_0x425d('0x27')](db[_0x425d('0x37')][_0x425d('0x25')]);_0x2c7afc['query']=_[_0x425d('0x27')](_0x29eba2[_0x425d('0x28')]);_0x2c7afc[_0x425d('0x29')]=_['intersection'](_0x2c7afc[_0x425d('0x26')],_0x2c7afc[_0x425d('0x28')]);_0x223462[_0x425d('0x2a')]=_[_0x425d('0x2b')](_0x2c7afc[_0x425d('0x26')],qs['fields'](_0x29eba2['query']['fields']));_0x223462['attributes']=_0x223462[_0x425d('0x2a')][_0x425d('0x3d')]?_0x223462[_0x425d('0x2a')]:_0x2c7afc['model'];if(_0x29eba2['query'][_0x425d('0x38')]){_0x223462[_0x425d('0x39')]=[{'all':!![]}];}_0x223462=_[_0x425d('0x33')]({},_0x223462,_0x29eba2[_0x425d('0x36')]);return db[_0x425d('0x37')]['find'](_0x223462)[_0x425d('0x1f')](handleEntityNotFound(_0x2c16a8,null))[_0x425d('0x1f')](respondWithResult(_0x2c16a8,null))[_0x425d('0x3b')](handleError(_0x2c16a8,null));};exports[_0x425d('0x3e')]=function(_0xb70748,_0x1dfda5){return db[_0x425d('0x37')][_0x425d('0x3e')]()[_0x425d('0x1f')](respondWithResult(_0x1dfda5,null))['catch'](handleError(_0x1dfda5,null));};exports[_0x425d('0x1e')]=function(_0x1d64b5,_0x132cac){if(_0x1d64b5[_0x425d('0x3f')]['uniqueid']){delete _0x1d64b5[_0x425d('0x3f')][_0x425d('0x40')];}return db[_0x425d('0x37')][_0x425d('0x41')]({'where':{'uniqueid':_0x1d64b5[_0x425d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x132cac,null))[_0x425d('0x1f')](saveUpdates(_0x1d64b5[_0x425d('0x3f')],null))[_0x425d('0x1f')](respondWithResult(_0x132cac,null))['catch'](handleError(_0x132cac,null));};exports[_0x425d('0x42')]=function(_0x21a943,_0x101fef,_0x2dcfbd){return db[_0x425d('0x37')][_0x425d('0x3a')]({'raw':![],'where':{'VoiceQueueId':_0x21a943[_0x425d('0x3c')]['id']},'attributes':[[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x46')))),_0x425d('0x47')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x48')))),'noAnswerContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x49')))),_0x425d('0x4a')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x4b')))),_0x425d('0x4c')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x4d')))),_0x425d('0x4e')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x425d('0x4f')))),_0x425d('0x50')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x51')))),_0x425d('0x52')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x53')))),_0x425d('0x54')]]})[_0x425d('0x1f')](handleEntityNotFound(_0x101fef,null))[_0x425d('0x1f')](respondWithResult(_0x101fef,null))[_0x425d('0x3b')](handleError(_0x101fef,null));};exports[_0x425d('0x55')]=function(_0x1d30ab,_0x5b1115,_0x5d0a3f){return db['CmHopperFinal'][_0x425d('0x3a')]({'raw':![],'where':{'CampaignId':_0x1d30ab[_0x425d('0x3c')]['id']},'attributes':[[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')]['literal'](_0x425d('0x46')))),'noSuchContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')]('`state`\x20=\x203,\x201,\x20null'))),_0x425d('0x56')],[db['sequelize']['fn']('COUNT',db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x425d('0x4a')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')]('`state`\x20=\x208,\x201,\x20null'))),_0x425d('0x4c')],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db['sequelize'][_0x425d('0x45')](_0x425d('0x4d')))),'dropContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x4f')))),'abandonedContacts'],[db[_0x425d('0x43')]['fn'](_0x425d('0x44'),db[_0x425d('0x43')]['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x51')))),'reCallContacts'],[db['sequelize']['fn'](_0x425d('0x44'),db['sequelize']['fn']('IF',db[_0x425d('0x43')][_0x425d('0x45')](_0x425d('0x53')))),_0x425d('0x54')]]})[_0x425d('0x1f')](handleEntityNotFound(_0x5b1115,null))[_0x425d('0x1f')](respondWithResult(_0x5b1115,null))[_0x425d('0x3b')](handleError(_0x5b1115,null));};exports[_0x425d('0x57')]=function(_0x127854,_0x251c40,_0xa8c839){return db[_0x425d('0x58')]['find']({'where':{'id':_0x127854[_0x425d('0x3c')]['id']}})[_0x425d('0x1f')](handleEntityNotFound(_0x251c40,null))['then'](function(_0x1ca879){var _0x5260fa;if(_0x1ca879){_0x5260fa=squel[_0x425d('0x59')]()['into'](_0x425d('0x5a'))[_0x425d('0x5b')](['phone','scheduledAt',_0x425d('0x5c'),'ListId',_0x425d('0x5d'),'createdAt','updatedAt'],squel[_0x425d('0x5e')]()['field'](_0x425d('0x5f'),_0x425d('0x60'))['field'](_0x425d('0x61'),_0x425d('0x62'))[_0x425d('0x63')](_0x425d('0x64'),_0x425d('0x5c'))['field']('ANY_VALUE(ListId)',_0x425d('0x65'))['field'](_0x425d('0x66'),_0x425d('0x5d'))[_0x425d('0x63')]('NOW()',_0x425d('0x67'))[_0x425d('0x63')](_0x425d('0x61'),'updatedAt')[_0x425d('0x68')](_0x425d('0x69'))[_0x425d('0x30')]('VoiceQueueId\x20=\x20?',_0x127854[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')]('state\x20=\x20?',_0x127854['body'][_0x425d('0x6b')][_0x425d('0x6a')]())[_0x425d('0x30')](_0x425d('0x6c'))[_0x425d('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x60'))[_0x425d('0x68')]('cm_hopper')[_0x425d('0x30')](_0x425d('0x6d'),_0x127854['params']['id']['toString']()))[_0x425d('0x30')](_0x425d('0x6e'),squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x6f'))[_0x425d('0x68')](_0x425d('0x69'))['where'](_0x425d('0x6d'),_0x127854[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')](_0x425d('0x70')))[_0x425d('0x71')](_0x425d('0x5c')))[_0x425d('0x6a')]();return db['sequelize'][_0x425d('0x28')](_0x5260fa);}return[];})['then'](respondWithResult(_0x251c40,null))[_0x425d('0x3b')](handleError(_0x251c40,null));};exports[_0x425d('0x72')]=function(_0x537644,_0x3a550a,_0x445d92){return db[_0x425d('0x73')]['find']({'where':{'id':_0x537644[_0x425d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3a550a,null))[_0x425d('0x1f')](function(_0x10d9b7){var _0x44152e;if(_0x10d9b7){_0x44152e=squel[_0x425d('0x59')]()[_0x425d('0x74')](_0x425d('0x5a'))[_0x425d('0x5b')]([_0x425d('0x60'),_0x425d('0x62'),_0x425d('0x5c'),'ListId',_0x425d('0x75'),_0x425d('0x67'),_0x425d('0x76')],squel[_0x425d('0x5e')]()[_0x425d('0x63')](_0x425d('0x5f'),_0x425d('0x60'))[_0x425d('0x63')](_0x425d('0x61'),'scheduledAt')['field'](_0x425d('0x64'),'ContactId')[_0x425d('0x63')]('ANY_VALUE(ListId)',_0x425d('0x65'))[_0x425d('0x63')](_0x425d('0x77'),_0x425d('0x75'))[_0x425d('0x63')](_0x425d('0x61'),_0x425d('0x67'))[_0x425d('0x63')](_0x425d('0x61'),'updatedAt')[_0x425d('0x68')](_0x425d('0x69'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())['where'](_0x425d('0x78'),_0x537644[_0x425d('0x3f')][_0x425d('0x6b')]['toString']())['where'](_0x425d('0x6c'))[_0x425d('0x30')](_0x425d('0x6e'),squel[_0x425d('0x5e')]()['field'](_0x425d('0x60'))[_0x425d('0x68')](_0x425d('0x5a'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644['params']['id'][_0x425d('0x6a')]()))[_0x425d('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x425d('0x63')]('calleridnum')['from'](_0x425d('0x69'))[_0x425d('0x30')]('CampaignId\x20=\x20?',_0x537644[_0x425d('0x3c')]['id'][_0x425d('0x6a')]())[_0x425d('0x30')]('state\x20=\x204'))[_0x425d('0x71')](_0x425d('0x5c')))[_0x425d('0x6a')]();return db[_0x425d('0x43')][_0x425d('0x28')](_0x44152e);}return[];})[_0x425d('0x1f')](respondWithResult(_0x3a550a,null))['catch'](handleError(_0x3a550a,null));};exports[_0x425d('0x79')]=function(_0x133594,_0x42e26a,_0x4eaf66){return db['CmHopper'][_0x425d('0x7a')]({'where':{'VoiceQueueId':_0x133594[_0x425d('0x3f')][_0x425d('0x5d')],'CampaignId':_0x133594[_0x425d('0x3f')][_0x425d('0x75')],'ContactId':_0x133594[_0x425d('0x3f')][_0x425d('0x5c')]}})[_0x425d('0x1f')](handleEntityNotFound(_0x42e26a,null))[_0x425d('0x1f')](function(_0x1edeaf){if(_0x1edeaf){return _0x1edeaf;}return null;})['then'](respondWithResult(_0x42e26a,null))['catch'](handleError(_0x42e26a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index cde2339..abe31dc 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 _0xb789=['path','rimraf','../../config/environment','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x4bf406,_0x10810f){var _0x54f3e5=function(_0x312ed3){while(--_0x312ed3){_0x4bf406['push'](_0x4bf406['shift']());}};_0x54f3e5(++_0x10810f);}(_0xb789,0x188));var _0x9b78=function(_0x1036f1,_0x7d4cb7){_0x1036f1=_0x1036f1-0x0;var _0x5c47ad=_0xb789[_0x1036f1];return _0x5c47ad;};'use strict';var _=require(_0x9b78('0x0'));var util=require(_0x9b78('0x1'));var logger=require(_0x9b78('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b78('0x3'));var fs=require('fs');var path=require(_0x9b78('0x4'));var rimraf=require(_0x9b78('0x5'));var config=require(_0x9b78('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x9b78('0x7')]=function(_0x696c5e,_0x548753){return _0x696c5e[_0x9b78('0x8')](_0x9b78('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9b78('0xa'),'fields':[_0x9b78('0xa')]},{'name':'uniqueid','fields':[_0x9b78('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3dc=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x53dd63,_0x5e1852){var _0x460c0a=function(_0x599511){while(--_0x599511){_0x53dd63['push'](_0x53dd63['shift']());}};_0x460c0a(++_0x5e1852);}(_0xa3dc,0x128));var _0xca3d=function(_0x47f994,_0x253e96){_0x47f994=_0x47f994-0x0;var _0x2d5ba3=_0xa3dc[_0x47f994];return _0x2d5ba3;};'use strict';var _=require(_0xca3d('0x0'));var util=require(_0xca3d('0x1'));var logger=require(_0xca3d('0x2'))('api');var moment=require(_0xca3d('0x3'));var BPromise=require(_0xca3d('0x4'));var rp=require(_0xca3d('0x5'));var fs=require('fs');var path=require(_0xca3d('0x6'));var rimraf=require(_0xca3d('0x7'));var config=require(_0xca3d('0x8'));var attributes=require(_0xca3d('0x9'));module[_0xca3d('0xa')]=function(_0x4c0cec,_0x441a8d){return _0x4c0cec['define'](_0xca3d('0xb'),attributes,{'tableName':_0xca3d('0xc'),'paranoid':![],'indexes':[{'name':_0xca3d('0xd'),'fields':[_0xca3d('0xd')]},{'name':_0xca3d('0xe'),'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 1af9508..398d7e5 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 _0x7072=['request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperFinal','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s'];(function(_0x32f794,_0x2852da){var _0x15dade=function(_0x500ae0){while(--_0x500ae0){_0x32f794['push'](_0x32f794['shift']());}};_0x15dade(++_0x2852da);}(_0x7072,0x138));var _0x2707=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7072[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['CmHopperFinal']['create'](_0x4a8b7f['body'],{'raw':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![]})[_0x2707('0x18')](function(_0x1a0e1a){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')](_0x2707('0x15'),_0x4a8b7f,JSON[_0x2707('0x10')](_0x1a0e1a));_0x449a61(_0x1a0e1a);})[_0x2707('0x14')](function(_0x119df4){logger[_0x2707('0x11')](_0x2707('0x15'),_0x119df4['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x119df4[_0x2707('0x13')]));});});}; \ No newline at end of file +var _0xb9a7=['jayson/promise','client','http','request','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','debug','catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xed9f18,_0x1baf0f){var _0x40fc54=function(_0x5748a6){while(--_0x5748a6){_0xed9f18['push'](_0xed9f18['shift']());}};_0x40fc54(++_0x1baf0f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb9a7[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});}exports[_0x7b9a('0x13')]=function(_0x271263){var _0x169d16=this;return new Promise(function(_0x44a232,_0x180a67){return db[_0x7b9a('0x14')][_0x7b9a('0x15')](_0x271263[_0x7b9a('0x16')],{'raw':_0x271263[_0x7b9a('0x17')]?_0x271263[_0x7b9a('0x17')][_0x7b9a('0x18')]===undefined?!![]:![]:!![]})[_0x7b9a('0x19')](function(_0x58aed7){logger[_0x7b9a('0x11')]('CreateCmHopperFinal',_0x271263);logger[_0x7b9a('0x1a')]('CreateCmHopperFinal',_0x271263,JSON[_0x7b9a('0xd')](_0x58aed7));_0x44a232(_0x58aed7);})[_0x7b9a('0x1b')](function(_0x23d812){logger['error'](_0x7b9a('0x13'),_0x23d812[_0x7b9a('0x10')],_0x271263);_0x180a67(_0x169d16['error'](0x1f4,_0x23d812[_0x7b9a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 05efa79..6bf6f6c 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x46968a,_0x31623e){var _0xb1c0f2=function(_0x16d4f9){while(--_0x16d4f9){_0x46968a['push'](_0x46968a['shift']());}};_0xb1c0f2(++_0x31623e);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9957=['isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')]('/voice/queue/moveContacts/:id',auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x12')](_0x7995('0x14'),auth[_0x7995('0x9')](),controller[_0x7995('0x15')]);router[_0x7995('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x18')]);module[_0x7995('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 20e9228..0b66d85 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 _0x5292=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x36d66c,_0x14416b){var _0x3867a8=function(_0x3f147f){while(--_0x3f147f){_0x36d66c['push'](_0x36d66c['shift']());}};_0x3867a8(++_0x14416b);}(_0x5292,0xf7));var _0x2529=function(_0x495f6f,_0x20c392){_0x495f6f=_0x495f6f-0x0;var _0x39bbf3=_0x5292[_0x495f6f];return _0x39bbf3;};'use strict';var Sequelize=require(_0x2529('0x0'));module[_0x2529('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2529('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2529('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2529('0x4')]},'responsetime':{'type':Sequelize[_0x2529('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2529('0x4')]},'ringtime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2529('0x2')]},'campaign':{'type':Sequelize[_0x2529('0x2')]},'campaigntype':{'type':Sequelize[_0x2529('0x2')]},'membername':{'type':Sequelize[_0x2529('0x2')]},'reason':{'type':Sequelize[_0x2529('0x2')]},'amd':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2529('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2529('0x4')]},'edited':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5be29f,_0x588b70){var _0x5f3875=function(_0x39f052){while(--_0x39f052){_0x5be29f['push'](_0x5be29f['shift']());}};_0x5f3875(++_0x588b70);}(_0x5fc3,0xa8));var _0x35fc=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x5fc3[_0x168127];return _0x4c99ad;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x35fc('0x2')]},'scheduledat':{'type':Sequelize[_0x35fc('0x3')]},'countbusyretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x35fc('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x35fc('0x2')]},'originatecalleridname':{'type':Sequelize[_0x35fc('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x35fc('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x35fc('0x3')]},'droptime':{'type':Sequelize[_0x35fc('0x3')]},'endtime':{'type':Sequelize[_0x35fc('0x3')]},'ringtime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x35fc('0x2')]},'campaigntype':{'type':Sequelize[_0x35fc('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x35fc('0x2')]},'amd':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x35fc('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x35fc('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b255baf..dea9083 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 _0x12b5=['then','error','stack','name','send','index','CmHopperHistory','keys','query','filters','intersection','attributes','fields','length','model','where','pick','filter','merge','type','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','rawAttributes','find','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy'];(function(_0x372b9d,_0x547e8c){var _0x48cb9b=function(_0x5472c9){while(--_0x5472c9){_0x372b9d['push'](_0x372b9d['shift']());}};_0x48cb9b(++_0x547e8c);}(_0x12b5,0x13d));var _0x512b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12b5[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x512b('0x0'));var emlformat=require(_0x512b('0x1'));var rimraf=require(_0x512b('0x2'));var zipdir=require(_0x512b('0x3'));var jsonpatch=require(_0x512b('0x4'));var rp=require(_0x512b('0x5'));var moment=require('moment');var BPromise=require(_0x512b('0x6'));var Mustache=require(_0x512b('0x7'));var util=require(_0x512b('0x8'));var path=require(_0x512b('0x9'));var sox=require(_0x512b('0xa'));var csv=require(_0x512b('0xb'));var ejs=require(_0x512b('0xc'));var fs=require('fs');var _=require(_0x512b('0xd'));var squel=require(_0x512b('0xe'));var crypto=require(_0x512b('0xf'));var jsforce=require(_0x512b('0x10'));var deskjs=require(_0x512b('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x512b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x512b('0x13'));var hardwareService=require(_0x512b('0x14'));var logger=require('../../config/logger')(_0x512b('0x15'));var utils=require(_0x512b('0x16'));var config=require(_0x512b('0x17'));var db=require(_0x512b('0x18'))['db'];function respondWithStatusCode(_0x38c0b6,_0x69dcec){_0x69dcec=_0x69dcec||0xcc;return function(_0x488563){if(_0x488563){return _0x38c0b6[_0x512b('0x19')](_0x69dcec);}return _0x38c0b6['status'](_0x69dcec)[_0x512b('0x1a')]();};}function respondWithResult(_0x4e84fc,_0x5b73c5){_0x5b73c5=_0x5b73c5||0xc8;return function(_0x4d6d01){if(_0x4d6d01){return _0x4e84fc[_0x512b('0x1b')](_0x5b73c5)[_0x512b('0x1c')](_0x4d6d01);}};}function respondWithFilteredResult(_0x5a3730,_0x3419f4){return function(_0x243a83){if(_0x243a83){var _0x377c59=_0x243a83[_0x512b('0x1d')],_0x5237f2=_0x3419f4[_0x512b('0x1e')],_0x1f268f=_0x3419f4['offset']+_0x3419f4[_0x512b('0x1f')],_0x55eba6;if(_0x1f268f>=_0x377c59){_0x1f268f=_0x377c59;_0x55eba6=0xc8;}else{_0x55eba6=0xce;}_0x5a3730[_0x512b('0x1b')](_0x55eba6);return _0x5a3730[_0x512b('0x20')](_0x512b('0x21'),_0x5237f2+'-'+_0x1f268f+'/'+_0x377c59)[_0x512b('0x1c')](_0x243a83);}return null;};}function patchUpdates(_0x3467e3){return function(_0x2ad923){try{jsonpatch[_0x512b('0x22')](_0x2ad923,_0x3467e3,!![]);}catch(_0x173564){return BPromise[_0x512b('0x23')](_0x173564);}return _0x2ad923['save']();};}function saveUpdates(_0x55ae54,_0x1d9483){return function(_0x4f0ef5){if(_0x4f0ef5){return _0x4f0ef5[_0x512b('0x24')](_0x55ae54)['then'](function(_0x2ab3fd){return _0x2ab3fd;});}return null;};}function removeEntity(_0x4c9ba3,_0x142ba6){return function(_0x490140){if(_0x490140){return _0x490140[_0x512b('0x25')]()[_0x512b('0x26')](function(){_0x4c9ba3[_0x512b('0x1b')](0xcc)[_0x512b('0x1a')]();});}};}function handleEntityNotFound(_0x137cea,_0x1606da){return function(_0xd581df){if(!_0xd581df){_0x137cea['sendStatus'](0x194);}return _0xd581df;};}function handleError(_0xde69fe,_0x2d5ad0){_0x2d5ad0=_0x2d5ad0||0x1f4;return function(_0x43bf27){logger[_0x512b('0x27')](_0x43bf27[_0x512b('0x28')]);if(_0x43bf27['name']){delete _0x43bf27[_0x512b('0x29')];}_0xde69fe[_0x512b('0x1b')](_0x2d5ad0)[_0x512b('0x2a')](_0x43bf27);};}exports[_0x512b('0x2b')]=function(_0x4fc4b5,_0x1eca81){var _0xfdda6d={},_0x537615={},_0x589b2e={'count':0x0,'rows':[]};var _0x293c4c=db[_0x512b('0x2c')]['rawAttributes'];_0x537615['model']=_[_0x512b('0x2d')](_0x293c4c);_0x537615[_0x512b('0x2e')]=_['keys'](_0x4fc4b5[_0x512b('0x2e')]);_0x537615[_0x512b('0x2f')]=_[_0x512b('0x30')](_0x537615['model'],_0x537615[_0x512b('0x2e')]);_0xfdda6d[_0x512b('0x31')]=_[_0x512b('0x30')](_0x537615['model'],qs[_0x512b('0x32')](_0x4fc4b5[_0x512b('0x2e')]['fields']));_0xfdda6d[_0x512b('0x31')]=_0xfdda6d[_0x512b('0x31')][_0x512b('0x33')]?_0xfdda6d[_0x512b('0x31')]:_0x537615[_0x512b('0x34')];if(!_0x4fc4b5[_0x512b('0x2e')]['hasOwnProperty']('nolimit')){_0xfdda6d[_0x512b('0x1f')]=qs[_0x512b('0x1f')](_0x4fc4b5[_0x512b('0x2e')]['limit']);_0xfdda6d['offset']=qs[_0x512b('0x1e')](_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x1e')]);}_0xfdda6d['order']=qs['sort'](_0x4fc4b5[_0x512b('0x2e')]['sort']);_0xfdda6d[_0x512b('0x35')]=qs[_0x512b('0x2f')](_[_0x512b('0x36')](_0x4fc4b5[_0x512b('0x2e')],_0x537615['filters']));if(_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x37')]){_0xfdda6d[_0x512b('0x35')]=_[_0x512b('0x38')](_0xfdda6d['where'],{'$or':_['map'](_0x293c4c,function(_0x4fc50f){if(_0x4fc50f[_0x512b('0x39')]['key']!==_0x512b('0x3a')){var _0x437969={};_0x437969[_0x4fc50f[_0x512b('0x3b')]]={'$like':'%'+_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x37')]+'%'};return _0x437969;}})});}_0xfdda6d=_[_0x512b('0x38')]({},_0xfdda6d,_0x4fc4b5['options']);var _0x363fb7={'where':_0xfdda6d['where']};return db[_0x512b('0x2c')]['count'](_0x363fb7)['then'](function(_0x55d24b){_0x589b2e[_0x512b('0x1d')]=_0x55d24b;if(_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x3c')]){_0xfdda6d['include']=[{'all':!![]}];}return db[_0x512b('0x2c')][_0x512b('0x3d')](_0xfdda6d);})[_0x512b('0x26')](function(_0x1d28b2){_0x589b2e[_0x512b('0x3e')]=_0x1d28b2;return _0x589b2e;})[_0x512b('0x26')](respondWithFilteredResult(_0x1eca81,_0xfdda6d))[_0x512b('0x3f')](handleError(_0x1eca81,null));};exports[_0x512b('0x40')]=function(_0x4cb412,_0x416214){var _0x36da59={'raw':!![],'where':{'id':_0x4cb412[_0x512b('0x41')]['id']}},_0x1a0577={};_0x1a0577[_0x512b('0x34')]=_[_0x512b('0x2d')](db[_0x512b('0x2c')][_0x512b('0x42')]);_0x1a0577[_0x512b('0x2e')]=_[_0x512b('0x2d')](_0x4cb412[_0x512b('0x2e')]);_0x1a0577[_0x512b('0x2f')]=_[_0x512b('0x30')](_0x1a0577['model'],_0x1a0577['query']);_0x36da59[_0x512b('0x31')]=_[_0x512b('0x30')](_0x1a0577[_0x512b('0x34')],qs[_0x512b('0x32')](_0x4cb412['query']['fields']));_0x36da59[_0x512b('0x31')]=_0x36da59['attributes']['length']?_0x36da59[_0x512b('0x31')]:_0x1a0577['model'];if(_0x4cb412[_0x512b('0x2e')]['includeAll']){_0x36da59['include']=[{'all':!![]}];}_0x36da59=_[_0x512b('0x38')]({},_0x36da59,_0x4cb412['options']);return db['CmHopperHistory'][_0x512b('0x43')](_0x36da59)[_0x512b('0x26')](handleEntityNotFound(_0x416214,null))[_0x512b('0x26')](respondWithResult(_0x416214,null))[_0x512b('0x3f')](handleError(_0x416214,null));};exports['create']=function(_0x4e4dfe,_0x4a126a){return db[_0x512b('0x2c')]['create'](_0x4e4dfe[_0x512b('0x44')],{})[_0x512b('0x26')](respondWithResult(_0x4a126a,0xc9))[_0x512b('0x3f')](handleError(_0x4a126a,null));};exports[_0x512b('0x45')]=function(_0x3d19fd,_0x2b3955){return db['CmHopperHistory'][_0x512b('0x45')]()[_0x512b('0x26')](respondWithResult(_0x2b3955,null))[_0x512b('0x3f')](handleError(_0x2b3955,null));};exports[_0x512b('0x24')]=function(_0x578103,_0x3e4aac){if(_0x578103[_0x512b('0x44')][_0x512b('0x46')]){delete _0x578103[_0x512b('0x44')]['uniqueid'];}return db[_0x512b('0x2c')][_0x512b('0x43')]({'where':{'uniqueid':_0x578103[_0x512b('0x41')]['id']}})[_0x512b('0x26')](handleEntityNotFound(_0x3e4aac,null))['then'](saveUpdates(_0x578103[_0x512b('0x44')],null))[_0x512b('0x26')](respondWithResult(_0x3e4aac,null))[_0x512b('0x3f')](handleError(_0x3e4aac,null));}; \ No newline at end of file +var _0x168a=['body','describe','uniqueid','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','error','name','send','index','CmHopperHistory','rawAttributes','model','keys','filters','intersection','attributes','fields','query','length','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','rows','show','params','includeAll','include','find','catch','create'];(function(_0x14405c,_0x12b9b9){var _0x5d54ba=function(_0x5eaba7){while(--_0x5eaba7){_0x14405c['push'](_0x14405c['shift']());}};_0x5d54ba(++_0x12b9b9);}(_0x168a,0x15c));var _0xa168=function(_0x49f911,_0x128351){_0x49f911=_0x49f911-0x0;var _0x39e6c0=_0x168a[_0x49f911];return _0x39e6c0;};'use strict';var pdf=require(_0xa168('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa168('0x1'));var jsonpatch=require(_0xa168('0x2'));var rp=require(_0xa168('0x3'));var moment=require(_0xa168('0x4'));var BPromise=require(_0xa168('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa168('0x6'));var sox=require(_0xa168('0x7'));var csv=require(_0xa168('0x8'));var ejs=require(_0xa168('0x9'));var fs=require('fs');var _=require(_0xa168('0xa'));var squel=require(_0xa168('0xb'));var crypto=require(_0xa168('0xc'));var jsforce=require(_0xa168('0xd'));var deskjs=require(_0xa168('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa168('0xf'));var Redis=require(_0xa168('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa168('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa168('0x12'));var utils=require('../../config/utils');var config=require(_0xa168('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e46d7,_0x52b52c){_0x52b52c=_0x52b52c||0xcc;return function(_0x46683a){if(_0x46683a){return _0x3e46d7[_0xa168('0x14')](_0x52b52c);}return _0x3e46d7[_0xa168('0x15')](_0x52b52c)[_0xa168('0x16')]();};}function respondWithResult(_0x4d2221,_0x26c506){_0x26c506=_0x26c506||0xc8;return function(_0x3b90c6){if(_0x3b90c6){return _0x4d2221['status'](_0x26c506)[_0xa168('0x17')](_0x3b90c6);}};}function respondWithFilteredResult(_0xc1192a,_0x2f7097){return function(_0x1e043b){if(_0x1e043b){var _0x290c53=_0x1e043b[_0xa168('0x18')],_0x298a4c=_0x2f7097['offset'],_0x3dd3fe=_0x2f7097[_0xa168('0x19')]+_0x2f7097['limit'],_0x2cb145;if(_0x3dd3fe>=_0x290c53){_0x3dd3fe=_0x290c53;_0x2cb145=0xc8;}else{_0x2cb145=0xce;}_0xc1192a['status'](_0x2cb145);return _0xc1192a['set'](_0xa168('0x1a'),_0x298a4c+'-'+_0x3dd3fe+'/'+_0x290c53)[_0xa168('0x17')](_0x1e043b);}return null;};}function patchUpdates(_0x2803c4){return function(_0x486f80){try{jsonpatch['apply'](_0x486f80,_0x2803c4,!![]);}catch(_0x47474b){return BPromise[_0xa168('0x1b')](_0x47474b);}return _0x486f80[_0xa168('0x1c')]();};}function saveUpdates(_0x3cfb44,_0x5b7d1b){return function(_0x19935d){if(_0x19935d){return _0x19935d[_0xa168('0x1d')](_0x3cfb44)[_0xa168('0x1e')](function(_0x98677b){return _0x98677b;});}return null;};}function removeEntity(_0x16bf51,_0x405473){return function(_0x3b0555){if(_0x3b0555){return _0x3b0555['destroy']()[_0xa168('0x1e')](function(){_0x16bf51[_0xa168('0x15')](0xcc)[_0xa168('0x16')]();});}};}function handleEntityNotFound(_0x1a58b1,_0x16cd55){return function(_0x5a6425){if(!_0x5a6425){_0x1a58b1[_0xa168('0x14')](0x194);}return _0x5a6425;};}function handleError(_0x4fadc6,_0x445977){_0x445977=_0x445977||0x1f4;return function(_0x990f50){logger[_0xa168('0x1f')](_0x990f50['stack']);if(_0x990f50[_0xa168('0x20')]){delete _0x990f50[_0xa168('0x20')];}_0x4fadc6[_0xa168('0x15')](_0x445977)[_0xa168('0x21')](_0x990f50);};}exports[_0xa168('0x22')]=function(_0x2fe7f3,_0x228f90){var _0x1eb592={},_0x20cf58={},_0x5bab88={'count':0x0,'rows':[]};var _0x5d9c9d=db[_0xa168('0x23')][_0xa168('0x24')];_0x20cf58[_0xa168('0x25')]=_[_0xa168('0x26')](_0x5d9c9d);_0x20cf58['query']=_[_0xa168('0x26')](_0x2fe7f3['query']);_0x20cf58[_0xa168('0x27')]=_[_0xa168('0x28')](_0x20cf58['model'],_0x20cf58['query']);_0x1eb592[_0xa168('0x29')]=_['intersection'](_0x20cf58['model'],qs[_0xa168('0x2a')](_0x2fe7f3[_0xa168('0x2b')]['fields']));_0x1eb592[_0xa168('0x29')]=_0x1eb592[_0xa168('0x29')][_0xa168('0x2c')]?_0x1eb592[_0xa168('0x29')]:_0x20cf58[_0xa168('0x25')];if(!_0x2fe7f3['query']['hasOwnProperty']('nolimit')){_0x1eb592[_0xa168('0x2d')]=qs[_0xa168('0x2d')](_0x2fe7f3['query'][_0xa168('0x2d')]);_0x1eb592[_0xa168('0x19')]=qs[_0xa168('0x19')](_0x2fe7f3['query'][_0xa168('0x19')]);}_0x1eb592['order']=qs[_0xa168('0x2e')](_0x2fe7f3['query'][_0xa168('0x2e')]);_0x1eb592[_0xa168('0x2f')]=qs[_0xa168('0x27')](_[_0xa168('0x30')](_0x2fe7f3[_0xa168('0x2b')],_0x20cf58[_0xa168('0x27')]));if(_0x2fe7f3[_0xa168('0x2b')][_0xa168('0x31')]){_0x1eb592['where']=_[_0xa168('0x32')](_0x1eb592[_0xa168('0x2f')],{'$or':_[_0xa168('0x33')](_0x5d9c9d,function(_0xbabd92){if(_0xbabd92[_0xa168('0x34')][_0xa168('0x35')]!==_0xa168('0x36')){var _0x2a9724={};_0x2a9724[_0xbabd92[_0xa168('0x37')]]={'$like':'%'+_0x2fe7f3[_0xa168('0x2b')]['filter']+'%'};return _0x2a9724;}})});}_0x1eb592=_[_0xa168('0x32')]({},_0x1eb592,_0x2fe7f3[_0xa168('0x38')]);var _0x428298={'where':_0x1eb592['where']};return db[_0xa168('0x23')][_0xa168('0x18')](_0x428298)['then'](function(_0x209216){_0x5bab88[_0xa168('0x18')]=_0x209216;if(_0x2fe7f3[_0xa168('0x2b')]['includeAll']){_0x1eb592['include']=[{'all':!![]}];}return db[_0xa168('0x23')][_0xa168('0x39')](_0x1eb592);})[_0xa168('0x1e')](function(_0x3c7309){_0x5bab88[_0xa168('0x3a')]=_0x3c7309;return _0x5bab88;})[_0xa168('0x1e')](respondWithFilteredResult(_0x228f90,_0x1eb592))['catch'](handleError(_0x228f90,null));};exports[_0xa168('0x3b')]=function(_0x3eba91,_0x34426a){var _0x259559={'raw':!![],'where':{'id':_0x3eba91[_0xa168('0x3c')]['id']}},_0x3c3c5c={};_0x3c3c5c[_0xa168('0x25')]=_['keys'](db[_0xa168('0x23')][_0xa168('0x24')]);_0x3c3c5c['query']=_['keys'](_0x3eba91[_0xa168('0x2b')]);_0x3c3c5c['filters']=_['intersection'](_0x3c3c5c['model'],_0x3c3c5c[_0xa168('0x2b')]);_0x259559[_0xa168('0x29')]=_[_0xa168('0x28')](_0x3c3c5c[_0xa168('0x25')],qs[_0xa168('0x2a')](_0x3eba91[_0xa168('0x2b')]['fields']));_0x259559['attributes']=_0x259559[_0xa168('0x29')]['length']?_0x259559[_0xa168('0x29')]:_0x3c3c5c[_0xa168('0x25')];if(_0x3eba91['query'][_0xa168('0x3d')]){_0x259559[_0xa168('0x3e')]=[{'all':!![]}];}_0x259559=_['merge']({},_0x259559,_0x3eba91[_0xa168('0x38')]);return db['CmHopperHistory'][_0xa168('0x3f')](_0x259559)[_0xa168('0x1e')](handleEntityNotFound(_0x34426a,null))['then'](respondWithResult(_0x34426a,null))[_0xa168('0x40')](handleError(_0x34426a,null));};exports[_0xa168('0x41')]=function(_0x5abcbd,_0x50c172){return db[_0xa168('0x23')][_0xa168('0x41')](_0x5abcbd[_0xa168('0x42')],{})['then'](respondWithResult(_0x50c172,0xc9))[_0xa168('0x40')](handleError(_0x50c172,null));};exports[_0xa168('0x43')]=function(_0x786a85,_0x46196e){return db[_0xa168('0x23')][_0xa168('0x43')]()[_0xa168('0x1e')](respondWithResult(_0x46196e,null))[_0xa168('0x40')](handleError(_0x46196e,null));};exports['update']=function(_0xe85d98,_0x4a1fd0){if(_0xe85d98[_0xa168('0x42')][_0xa168('0x44')]){delete _0xe85d98[_0xa168('0x42')]['uniqueid'];}return db[_0xa168('0x23')][_0xa168('0x3f')]({'where':{'uniqueid':_0xe85d98[_0xa168('0x3c')]['id']}})[_0xa168('0x1e')](handleEntityNotFound(_0x4a1fd0,null))['then'](saveUpdates(_0xe85d98['body'],null))['then'](respondWithResult(_0x4a1fd0,null))[_0xa168('0x40')](handleError(_0x4a1fd0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9685a21..7254e8d 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 _0x9c44=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','define'];(function(_0x3fab58,_0x3b8fad){var _0x401852=function(_0xfacf25){while(--_0xfacf25){_0x3fab58['push'](_0x3fab58['shift']());}};_0x401852(++_0x3b8fad);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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':[{'name':'endtime','fields':[_0x49c4('0xa')]},{'name':_0x49c4('0xb'),'fields':[_0x49c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x4b8138,_0x6326be){var _0x3ef46d=function(_0x1aa903){while(--_0x1aa903){_0x4b8138['push'](_0x4b8138['shift']());}};_0x3ef46d(++_0x6326be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 67ef34c..3a5d4d1 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 _0xd0d5=['jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrAnswerCallsDay','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x414b7b,_0x517446){var _0x25ea89=function(_0x2ac2ea){while(--_0x2ac2ea){_0x414b7b['push'](_0x414b7b['shift']());}};_0x25ea89(++_0x517446);}(_0xd0d5,0x1ed));var _0x5d0d=function(_0x3b1084,_0x3e0063){_0x3b1084=_0x3b1084-0x0;var _0x2d1097=_0xd0d5[_0x3b1084];return _0x2d1097;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d0d('0x0'));var db=require(_0x5d0d('0x1'))['db'];var utils=require(_0x5d0d('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d0d('0x3'));var jayson=require(_0x5d0d('0x4'));var client=jayson[_0x5d0d('0x5')][_0x5d0d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5ace89,_0x36598d,_0xcfec38){return new BPromise(function(_0x11c549,_0x1404bf){return client[_0x5d0d('0x7')](_0x5ace89,_0xcfec38)['then'](function(_0x21a607){logger['info'](_0x5d0d('0x8'),_0x36598d,_0x5d0d('0x9'));logger[_0x5d0d('0xa')](_0x5d0d('0xb'),_0x36598d,_0x5d0d('0x9'),JSON[_0x5d0d('0xc')](_0x21a607));if(_0x21a607[_0x5d0d('0xd')]){if(_0x21a607['error'][_0x5d0d('0xe')]===0x1f4){logger[_0x5d0d('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36598d,_0x21a607['error'][_0x5d0d('0xf')]);return _0x1404bf(_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);}logger[_0x5d0d('0xd')](_0x5d0d('0x8'),_0x36598d,_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);return _0x11c549(_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);}else{logger[_0x5d0d('0x10')](_0x5d0d('0x8'),_0x36598d,_0x5d0d('0x9'));_0x11c549(_0x21a607[_0x5d0d('0x11')][_0x5d0d('0xf')]);}})['catch'](function(_0x68b55b){logger[_0x5d0d('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36598d,_0x68b55b);_0x1404bf(_0x68b55b);});});}exports[_0x5d0d('0x12')]=function(_0x4567c6){var _0x286dcb=this;return new Promise(function(_0x1c24cc,_0x161a8e){return db[_0x5d0d('0x13')][_0x5d0d('0x14')](_0x4567c6[_0x5d0d('0x15')],{'raw':_0x4567c6[_0x5d0d('0x16')]?_0x4567c6['options'][_0x5d0d('0x17')]===undefined?!![]:![]:!![]})[_0x5d0d('0x18')](function(_0x29c332){logger['info'](_0x5d0d('0x12'),_0x4567c6);logger[_0x5d0d('0xa')](_0x5d0d('0x12'),_0x4567c6,JSON[_0x5d0d('0xc')](_0x29c332));_0x1c24cc(_0x29c332);})['catch'](function(_0x5a8e73){logger[_0x5d0d('0xd')](_0x5d0d('0x12'),_0x5a8e73['message'],_0x4567c6);_0x161a8e(_0x286dcb[_0x5d0d('0xd')](0x1f4,_0x5a8e73[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x19')]=function(_0xea36ca){var _0x1d6c1d=this;return new Promise(function(_0x41b525,_0x1ca18f){return db[_0x5d0d('0x13')][_0x5d0d('0x1a')]({'raw':_0xea36ca['options']?_0xea36ca[_0x5d0d('0x16')][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0xea36ca[_0x5d0d('0x16')]?_0xea36ca[_0x5d0d('0x16')][_0x5d0d('0x1b')]||null:null,'attributes':[[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')][_0x5d0d('0x1e')]('id')),_0x5d0d('0x1f')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x5d0d('0x20')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x22')))),_0x5d0d('0x23')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x24')))),_0x5d0d('0x25')],[db[_0x5d0d('0x1c')]['fn']('AVG',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x26')))),_0x5d0d('0x27')],[db['sequelize']['fn'](_0x5d0d('0x28'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x29')))),_0x5d0d('0x2a')]]})[_0x5d0d('0x18')](function(_0x2564dd){logger[_0x5d0d('0x10')](_0x5d0d('0x19'),_0xea36ca);logger[_0x5d0d('0xa')](_0x5d0d('0x19'),_0xea36ca,JSON[_0x5d0d('0xc')](_0x2564dd));_0x41b525(_0x2564dd);})[_0x5d0d('0x2b')](function(_0x248202){logger[_0x5d0d('0xd')]('AvgHandleTime',_0x248202[_0x5d0d('0xf')],_0xea36ca);_0x1ca18f(_0x1d6c1d[_0x5d0d('0xd')](0x1f4,_0x248202[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x2c')]=function(_0x28c9d0){var _0x13fc1e=this;return new Promise(function(_0x185279,_0x83011e){return db[_0x5d0d('0x13')][_0x5d0d('0x1a')]({'raw':_0x28c9d0[_0x5d0d('0x16')]?_0x28c9d0[_0x5d0d('0x16')][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0x28c9d0['options']?_0x28c9d0[_0x5d0d('0x16')]['where']||null:null,'attributes':[[_0x5d0d('0x2d'),'name'],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')](_0x5d0d('0x2e')))),_0x5d0d('0x2f')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x5d0d('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x31')))),_0x5d0d('0x32')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')](_0x5d0d('0x33')))),_0x5d0d('0x34')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x35')))),_0x5d0d('0x36')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5d0d('0x37')))),_0x5d0d('0x38')],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x39')))),_0x5d0d('0x3a')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3b')))),'outboundUnknownCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3c')))),_0x5d0d('0x3d')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3f')))),'outboundRejectCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x5d0d('0x40')],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x5d0d('0x41')],[db['sequelize']['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x42')))),_0x5d0d('0x43')]],'group':[_0x5d0d('0x2d')]})['then'](function(_0x44bf4f){logger['info'](_0x5d0d('0x2c'),_0x28c9d0);logger[_0x5d0d('0xa')](_0x5d0d('0x2c'),_0x28c9d0,JSON[_0x5d0d('0xc')](_0x44bf4f));_0x185279(_0x44bf4f);})[_0x5d0d('0x2b')](function(_0x5bd551){logger[_0x5d0d('0xd')](_0x5d0d('0x2c'),_0x5bd551[_0x5d0d('0xf')],_0x28c9d0);_0x83011e(_0x13fc1e[_0x5d0d('0xd')](0x1f4,_0x5bd551[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x44')]=function(_0xb50a51){var _0x550f33=this;return new Promise(function(_0x279c51,_0x1d77a0){return db[_0x5d0d('0x13')]['findAll']({'raw':_0xb50a51[_0x5d0d('0x16')]?_0xb50a51['options'][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0xb50a51[_0x5d0d('0x16')]?_0xb50a51[_0x5d0d('0x16')][_0x5d0d('0x1b')]||null:null,'attributes':[[_0x5d0d('0x2d'),_0x5d0d('0x45')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db['sequelize'][_0x5d0d('0x1e')]('id')),'ivrTotalCallsDays'],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x31')))),_0x5d0d('0x46')]],'group':[_0x5d0d('0x2d')]})['then'](function(_0x5e13be){logger[_0x5d0d('0x10')]('GetCampaignHopperHistory',_0xb50a51);logger[_0x5d0d('0xa')](_0x5d0d('0x44'),_0xb50a51,JSON[_0x5d0d('0xc')](_0x5e13be));_0x279c51(_0x5e13be);})[_0x5d0d('0x2b')](function(_0x49da68){logger[_0x5d0d('0xd')]('GetCampaignHopperHistory',_0x49da68[_0x5d0d('0xf')],_0xb50a51);_0x1d77a0(_0x550f33[_0x5d0d('0xd')](0x1f4,_0x49da68[_0x5d0d('0xf')]));});});}; \ No newline at end of file +var _0xaaa2=['predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','CreateCmHopperHistory','create','body','options','catch','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null'];(function(_0x211576,_0xcc41af){var _0x3ce235=function(_0x28bd8a){while(--_0x28bd8a){_0x211576['push'](_0x211576['shift']());}};_0x3ce235(++_0xcc41af);}(_0xaaa2,0xac));var _0x2aaa=function(_0x4f2494,_0x57f683){_0x4f2494=_0x4f2494-0x0;var _0x40f3e0=_0xaaa2[_0x4f2494];return _0x40f3e0;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}exports[_0x2aaa('0x16')]=function(_0x3b94bf){var _0x1cae3e=this;return new Promise(function(_0xdaa445,_0x38a049){return db['CmHopperHistory'][_0x2aaa('0x17')](_0x3b94bf[_0x2aaa('0x18')],{'raw':_0x3b94bf['options']?_0x3b94bf[_0x2aaa('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ec32e){logger[_0x2aaa('0x14')](_0x2aaa('0x16'),_0x3b94bf);logger[_0x2aaa('0xe')](_0x2aaa('0x16'),_0x3b94bf,JSON[_0x2aaa('0xf')](_0x1ec32e));_0xdaa445(_0x1ec32e);})[_0x2aaa('0x1a')](function(_0x24da1e){logger['error'](_0x2aaa('0x16'),_0x24da1e[_0x2aaa('0x13')],_0x3b94bf);_0x38a049(_0x1cae3e['error'](0x1f4,_0x24da1e['message']));});});};exports[_0x2aaa('0x1b')]=function(_0x4d7151){var _0x37474f=this;return new Promise(function(_0x3606bf,_0x4e41ee){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x4d7151['options']?_0x4d7151[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d7151[_0x2aaa('0x19')]?_0x4d7151['options'][_0x2aaa('0x1f')]||null:null,'attributes':[[db[_0x2aaa('0x20')]['fn']('COUNT',db['sequelize'][_0x2aaa('0x21')]('id')),_0x2aaa('0x22')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x25')))),_0x2aaa('0x26')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db['sequelize'][_0x2aaa('0x24')]('`state`\x20=\x2010,\x201,\x20null'))),_0x2aaa('0x27')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x28')))),_0x2aaa('0x29')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x2a'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x2a'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x2b')))),_0x2aaa('0x2c')]]})[_0x2aaa('0x2d')](function(_0x5e9fdf){logger[_0x2aaa('0x14')](_0x2aaa('0x1b'),_0x4d7151);logger['debug'](_0x2aaa('0x1b'),_0x4d7151,JSON[_0x2aaa('0xf')](_0x5e9fdf));_0x3606bf(_0x5e9fdf);})['catch'](function(_0x39f8aa){logger[_0x2aaa('0x10')](_0x2aaa('0x1b'),_0x39f8aa[_0x2aaa('0x13')],_0x4d7151);_0x4e41ee(_0x37474f[_0x2aaa('0x10')](0x1f4,_0x39f8aa[_0x2aaa('0x13')]));});});};exports[_0x2aaa('0x2e')]=function(_0x4d9e9b){var _0x496b10=this;return new Promise(function(_0xa9054b,_0x4dc768){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x4d9e9b['options']?_0x4d9e9b[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d9e9b[_0x2aaa('0x19')]?_0x4d9e9b['options'][_0x2aaa('0x1f')]||null:null,'attributes':[[_0x2aaa('0x2f'),_0x2aaa('0x30')],[db[_0x2aaa('0x20')]['fn']('COUNT',db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x31')))),_0x2aaa('0x32')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x33')))),_0x2aaa('0x34')],[db[_0x2aaa('0x20')]['fn']('COUNT',db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x2aaa('0x35')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x36')))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')]['literal'](_0x2aaa('0x37')))),_0x2aaa('0x38')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x39')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2aaa('0x3a')],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db['sequelize'][_0x2aaa('0x24')](_0x2aaa('0x3b')))),_0x2aaa('0x3c')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x2aaa('0x3d')))),_0x2aaa('0x3e')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')](_0x2aaa('0x3f')))),_0x2aaa('0x40')],[db['sequelize']['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')]['fn']('IF',db[_0x2aaa('0x20')][_0x2aaa('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x2aaa('0x41')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x2aaa('0x24')](_0x2aaa('0x42')))),_0x2aaa('0x40')],[db[_0x2aaa('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x2aaa('0x43')))),_0x2aaa('0x44')]],'group':[_0x2aaa('0x2f')]})['then'](function(_0x1e690d){logger[_0x2aaa('0x14')](_0x2aaa('0x2e'),_0x4d9e9b);logger[_0x2aaa('0xe')](_0x2aaa('0x2e'),_0x4d9e9b,JSON[_0x2aaa('0xf')](_0x1e690d));_0xa9054b(_0x1e690d);})[_0x2aaa('0x1a')](function(_0x5f3ebb){logger[_0x2aaa('0x10')]('GetVoiceQueueHopperHistory',_0x5f3ebb['message'],_0x4d9e9b);_0x4dc768(_0x496b10[_0x2aaa('0x10')](0x1f4,_0x5f3ebb[_0x2aaa('0x13')]));});});};exports[_0x2aaa('0x45')]=function(_0x10b4bb){var _0x163ab9=this;return new Promise(function(_0x558d9d,_0x27a08c){return db[_0x2aaa('0x1c')][_0x2aaa('0x1d')]({'raw':_0x10b4bb[_0x2aaa('0x19')]?_0x10b4bb[_0x2aaa('0x19')][_0x2aaa('0x1e')]===undefined?!![]:![]:!![],'where':_0x10b4bb[_0x2aaa('0x19')]?_0x10b4bb[_0x2aaa('0x19')][_0x2aaa('0x1f')]||null:null,'attributes':[[_0x2aaa('0x2f'),_0x2aaa('0x30')],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db[_0x2aaa('0x20')][_0x2aaa('0x21')]('id')),'ivrTotalCallsDays'],[db[_0x2aaa('0x20')]['fn'](_0x2aaa('0x23'),db['sequelize']['fn']('IF',db[_0x2aaa('0x20')]['literal'](_0x2aaa('0x25')))),_0x2aaa('0x46')]],'group':['campaign']})[_0x2aaa('0x2d')](function(_0x3f446a){logger[_0x2aaa('0x14')](_0x2aaa('0x45'),_0x10b4bb);logger['debug'](_0x2aaa('0x45'),_0x10b4bb,JSON['stringify'](_0x3f446a));_0x558d9d(_0x3f446a);})[_0x2aaa('0x1a')](function(_0x359359){logger['error'](_0x2aaa('0x45'),_0x359359[_0x2aaa('0x13')],_0x10b4bb);_0x27a08c(_0x163ab9[_0x2aaa('0x10')](0x1f4,_0x359359[_0x2aaa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 7080bc0..1560fe1 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 _0x30bc=['/:id','show','create','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe'];(function(_0x435d77,_0x3d9a3a){var _0x5b0ffb=function(_0x10c3bc){while(--_0x10c3bc){_0x435d77['push'](_0x435d77['shift']());}};_0x5b0ffb(++_0x3d9a3a);}(_0x30bc,0x149));var _0xc30b=function(_0x1ee04d,_0x4b9f61){_0x1ee04d=_0x1ee04d-0x0;var _0x46a06e=_0x30bc[_0x1ee04d];return _0x46a06e;};'use strict';var multer=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var path=require(_0xc30b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc30b('0x3'));var router=express[_0xc30b('0x4')]();var auth=require(_0xc30b('0x5'));var interaction=require(_0xc30b('0x6'));var config=require(_0xc30b('0x7'));var controller=require(_0xc30b('0x8'));router[_0xc30b('0x9')]('/',auth[_0xc30b('0xa')](),controller[_0xc30b('0xb')]);router[_0xc30b('0x9')]('/describe',auth[_0xc30b('0xa')](),controller[_0xc30b('0xc')]);router[_0xc30b('0x9')](_0xc30b('0xd'),auth['isAuthenticated'](),controller[_0xc30b('0xe')]);router['post']('/',auth[_0xc30b('0xa')](),controller[_0xc30b('0xf')]);router['put']('/:id',auth[_0xc30b('0xa')](),controller[_0xc30b('0x10')]);module[_0xc30b('0x11')]=router; \ No newline at end of file +var _0xdefc=['exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','put','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdefc,0x1b3));var _0xcdef=function(_0x3d7de8,_0x2a2ec4){_0x3d7de8=_0x3d7de8-0x0;var _0x5e9a0c=_0xdefc[_0x3d7de8];return _0x5e9a0c;};'use strict';var multer=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var path=require(_0xcdef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdef('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcdef('0x4'));var config=require(_0xcdef('0x5'));var controller=require(_0xcdef('0x6'));router[_0xcdef('0x7')]('/',auth[_0xcdef('0x8')](),controller[_0xcdef('0x9')]);router[_0xcdef('0x7')]('/describe',auth[_0xcdef('0x8')](),controller['describe']);router[_0xcdef('0x7')](_0xcdef('0xa'),auth[_0xcdef('0x8')](),controller['show']);router['post']('/',auth[_0xcdef('0x8')](),controller['create']);router[_0xcdef('0xb')](_0xcdef('0xa'),auth[_0xcdef('0x8')](),controller[_0xcdef('0xc')]);module[_0xcdef('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 1361726..bb73d2f 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 _0x24ca=['sequelize','STRING','name'];(function(_0xd8f524,_0x1ca5de){var _0x3c0354=function(_0x17ff52){while(--_0x17ff52){_0xd8f524['push'](_0xd8f524['shift']());}};_0x3c0354(++_0x1ca5de);}(_0x24ca,0x1bc));var _0xa24c=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x24ca[_0x176317];return _0xef2759;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'unique':_0xa24c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa24c('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6aa7=['name','sequelize','STRING'];(function(_0x303797,_0x371c62){var _0x36635a=function(_0x878d21){while(--_0x878d21){_0x303797['push'](_0x303797['shift']());}};_0x36635a(++_0x371c62);}(_0x6aa7,0x178));var _0x76aa=function(_0x53482c,_0x522389){_0x53482c=_0x53482c-0x0;var _0x52c4d4=_0x6aa7[_0x53482c];return _0x52c4d4;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 257a920..517f653 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 _0x54ef=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./cmList.socket','register','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','CmList','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','findOne','Disposition','nolimit','map','rows','removeDispositions','ids','isArray','tags','join','push','each','CmContact','omit','dataValues','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContacts','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','emit','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x198365,_0x5bfb09){var _0x5054bd=function(_0x5667ec){while(--_0x5667ec){_0x198365['push'](_0x198365['shift']());}};_0x5054bd(++_0x5bfb09);}(_0x54ef,0x112));var _0xf54e=function(_0x3ba785,_0x5ded3e){_0x3ba785=_0x3ba785-0x0;var _0x7e585=_0x54ef[_0x3ba785];return _0x7e585;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);function respondWithStatusCode(_0x5644aa,_0x331732){_0x331732=_0x331732||0xcc;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1d')](_0x331732);}return _0x5644aa[_0xf54e('0x1e')](_0x331732)['end']();};}function respondWithResult(_0x2366ee,_0x389abc){_0x389abc=_0x389abc||0xc8;return function(_0x3eb415){if(_0x3eb415){return _0x2366ee['status'](_0x389abc)['json'](_0x3eb415);}};}function respondWithFilteredResult(_0xd87020,_0x41fb35){return function(_0x1c02e7){if(_0x1c02e7){var _0x9647f=_0x1c02e7[_0xf54e('0x1f')],_0x15cc48=_0x41fb35[_0xf54e('0x20')],_0x3e7d96=_0x41fb35[_0xf54e('0x20')]+_0x41fb35[_0xf54e('0x21')],_0x2e27b6;if(_0x3e7d96>=_0x9647f){_0x3e7d96=_0x9647f;_0x2e27b6=0xc8;}else{_0x2e27b6=0xce;}_0xd87020['status'](_0x2e27b6);return _0xd87020['set'](_0xf54e('0x22'),_0x15cc48+'-'+_0x3e7d96+'/'+_0x9647f)['json'](_0x1c02e7);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x23')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x24')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x25')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x26')](_0x388aa0)[_0xf54e('0x27')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x28')]()[_0xf54e('0x27')](function(){var _0x474b61=_0x264a8f[_0xf54e('0x29')]({'plain':!![]});var _0x160160=_0xf54e('0x2a');return db[_0xf54e('0x2b')][_0xf54e('0x28')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x27')](function(){return _0x264a8f;});})[_0xf54e('0x27')](function(){_0x6f6d29[_0xf54e('0x1e')](0xcc)[_0xf54e('0x2c')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x1d')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2d')](_0x269f47[_0xf54e('0x2e')]);if(_0x269f47[_0xf54e('0x2f')]){delete _0x269f47[_0xf54e('0x2f')];}_0x5e63f4[_0xf54e('0x1e')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=db[_0xf54e('0x30')][_0xf54e('0x31')];_0x16d00f[_0xf54e('0x32')]=_[_0xf54e('0x33')](_0x133cd7);_0x16d00f['query']=_['keys'](_0x2f96b1[_0xf54e('0x34')]);_0x16d00f[_0xf54e('0x35')]=_['intersection'](_0x16d00f[_0xf54e('0x32')],_0x16d00f[_0xf54e('0x34')]);_0x2ec92e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x16d00f['model'],qs['fields'](_0x2f96b1['query'][_0xf54e('0x38')]));_0x2ec92e[_0xf54e('0x36')]=_0x2ec92e[_0xf54e('0x36')][_0xf54e('0x39')]?_0x2ec92e[_0xf54e('0x36')]:_0x16d00f[_0xf54e('0x32')];if(!_0x2f96b1['query']['hasOwnProperty']('nolimit')){_0x2ec92e[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2f96b1['query']['limit']);_0x2ec92e[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x34')]['offset']);}_0x2ec92e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x2f96b1['query'][_0xf54e('0x3b')]);_0x2ec92e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2f96b1[_0xf54e('0x34')],_0x16d00f[_0xf54e('0x35')]));if(_0x2f96b1['query']['filter']){_0x2ec92e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x2ec92e[_0xf54e('0x3c')],{'$or':_['map'](_0x133cd7,function(_0x4533a2){if(_0x4533a2[_0xf54e('0x3f')][_0xf54e('0x40')]!==_0xf54e('0x41')){var _0x361e4c={};_0x361e4c[_0x4533a2[_0xf54e('0x42')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x361e4c;}})});}_0x2ec92e=_[_0xf54e('0x3e')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x1c1f0d={'where':_0x2ec92e[_0xf54e('0x3c')]};return db[_0xf54e('0x30')][_0xf54e('0x1f')](_0x1c1f0d)[_0xf54e('0x27')](function(_0x5085c1){_0xb2d4c4['count']=_0x5085c1;if(_0x2f96b1['query'][_0xf54e('0x45')]){_0x2ec92e[_0xf54e('0x46')]=[{'all':!![]}];}return db['CmList'][_0xf54e('0x47')](_0x2ec92e);})[_0xf54e('0x27')](function(_0x381c03){_0xb2d4c4['rows']=_0x381c03;return _0xb2d4c4;})[_0xf54e('0x27')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x794be7,_0x4b1931){var _0x143a39={'raw':![],'where':{'id':_0x794be7[_0xf54e('0x4a')]['id']}},_0x14ce90={};_0x14ce90[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x30')][_0xf54e('0x31')]);_0x14ce90[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x794be7[_0xf54e('0x34')]);_0x14ce90[_0xf54e('0x35')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],_0x14ce90['query']);_0x143a39[_0xf54e('0x36')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x794be7[_0xf54e('0x34')]['fields']));_0x143a39[_0xf54e('0x36')]=_0x143a39[_0xf54e('0x36')][_0xf54e('0x39')]?_0x143a39[_0xf54e('0x36')]:_0x14ce90[_0xf54e('0x32')];if(_0x794be7['query'][_0xf54e('0x45')]){_0x143a39[_0xf54e('0x46')]=[{'all':!![]}];}_0x143a39=_[_0xf54e('0x3e')]({},_0x143a39,_0x794be7[_0xf54e('0x44')]);return db['CmList'][_0xf54e('0x4b')](_0x143a39)[_0xf54e('0x27')](handleEntityNotFound(_0x4b1931,null))['then'](respondWithResult(_0x4b1931,null))[_0xf54e('0x48')](handleError(_0x4b1931,null));};exports[_0xf54e('0x4c')]=function(_0x3d24c7,_0xca0141){return db['CmList'][_0xf54e('0x4c')](_0x3d24c7[_0xf54e('0x4d')],{})[_0xf54e('0x27')](function(_0xb4654f){var _0x346fc9=_0x3d24c7[_0xf54e('0x4e')][_0xf54e('0x29')]({'plain':!![]});if(!_0x346fc9)throw new Error(_0xf54e('0x4f'));if(_0x346fc9[_0xf54e('0x50')]===_0xf54e('0x4e')){var _0xaf9bf0=_0xb4654f[_0xf54e('0x29')]({'plain':!![]});var _0x2deb0c=_0xf54e('0x2a');return db[_0xf54e('0x51')][_0xf54e('0x4b')]({'where':{'name':_0x2deb0c,'userProfileId':_0x346fc9[_0xf54e('0x52')]},'raw':!![]})[_0xf54e('0x27')](function(_0x21fd80){if(_0x21fd80&&_0x21fd80[_0xf54e('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0xaf9bf0[_0xf54e('0x2f')],'resourceId':_0xaf9bf0['id'],'type':_0x21fd80[_0xf54e('0x2f')],'sectionId':_0x21fd80['id']},{})[_0xf54e('0x27')](function(){return _0xb4654f;});}else{return _0xb4654f;}})[_0xf54e('0x48')](function(_0xba297c){logger[_0xf54e('0x2d')](_0xf54e('0x54'),_0xba297c);throw _0xba297c;});}return _0xb4654f;})[_0xf54e('0x27')](respondWithResult(_0xca0141,0xc9))[_0xf54e('0x48')](handleError(_0xca0141,null));};exports[_0xf54e('0x26')]=function(_0x1df308,_0x59c313){if(_0x1df308[_0xf54e('0x4d')]['id']){delete _0x1df308[_0xf54e('0x4d')]['id'];}return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x1df308[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x59c313,null))[_0xf54e('0x27')](saveUpdates(_0x1df308['body'],null))[_0xf54e('0x27')](respondWithResult(_0x59c313,null))[_0xf54e('0x48')](handleError(_0x59c313,null));};exports[_0xf54e('0x28')]=function(_0x48a5c8,_0x3ce832){return db['CmList'][_0xf54e('0x4b')]({'where':{'id':_0x48a5c8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x3ce832,null))['then'](removeEntity(_0x3ce832,null))[_0xf54e('0x48')](handleError(_0x3ce832,null));};exports[_0xf54e('0x55')]=function(_0x2096e5,_0x4e5059){return db[_0xf54e('0x30')][_0xf54e('0x55')]()[_0xf54e('0x27')](respondWithResult(_0x4e5059,null))['catch'](handleError(_0x4e5059,null));};exports['addDisposition']=function(_0x4270e1,_0x9ab4c4,_0x4f17dd){if(_0x4270e1[_0xf54e('0x4d')]['id']){delete _0x4270e1['body']['id'];}return db[_0xf54e('0x30')]['find']({'where':{'id':_0x4270e1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x9ab4c4,null))[_0xf54e('0x27')](function(_0x241198){if(_0x241198){_0x4270e1[_0xf54e('0x4d')][_0xf54e('0x56')]=_0x241198['id'];return db['Disposition']['create'](_0x4270e1[_0xf54e('0x4d')]);}})[_0xf54e('0x27')](respondWithResult(_0x9ab4c4,null))['catch'](handleError(_0x9ab4c4,null));};exports['getDispositions']=function(_0x2a5e54,_0x511a99,_0x2b616a){var _0x43f9bf={'raw':![],'where':{}};var _0x47596c={};var _0x2b11f8={'count':0x0,'rows':[]};return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x2a5e54[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x511a99,null))[_0xf54e('0x27')](function(_0x4d8040){if(_0x4d8040){_0x47596c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x58')][_0xf54e('0x31')]);_0x47596c['query']=_[_0xf54e('0x33')](_0x2a5e54[_0xf54e('0x34')]);_0x47596c[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x47596c[_0xf54e('0x32')],_0x47596c['query']);_0x43f9bf[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x47596c['model'],qs['fields'](_0x2a5e54[_0xf54e('0x34')]['fields']));_0x43f9bf[_0xf54e('0x36')]=_0x43f9bf[_0xf54e('0x36')][_0xf54e('0x39')]?_0x43f9bf[_0xf54e('0x36')]:_0x47596c['model'];if(!_0x2a5e54[_0xf54e('0x34')]['hasOwnProperty'](_0xf54e('0x59'))){_0x43f9bf[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2a5e54['query'][_0xf54e('0x21')]);_0x43f9bf['offset']=qs[_0xf54e('0x20')](_0x2a5e54[_0xf54e('0x34')]['offset']);}_0x43f9bf[_0xf54e('0x3a')]=qs['sort'](_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x43f9bf[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2a5e54['query'],_0x47596c[_0xf54e('0x35')]));_0x43f9bf[_0xf54e('0x3c')]['ListId']=_0x4d8040['id'];if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]){_0x43f9bf['where']=_[_0xf54e('0x3e')](_0x43f9bf[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x43f9bf['attributes'],function(_0xf4e4d){var _0x4ae3d0={};_0x4ae3d0[_0xf4e4d]={'$like':'%'+_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x4ae3d0;})});}_0x43f9bf=_['merge']({},_0x43f9bf,_0x2a5e54[_0xf54e('0x44')]);return db[_0xf54e('0x58')][_0xf54e('0x1f')]({'where':_0x43f9bf[_0xf54e('0x3c')]})[_0xf54e('0x27')](function(_0xfc1e){_0x2b11f8[_0xf54e('0x1f')]=_0xfc1e;if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x45')]){_0x43f9bf[_0xf54e('0x46')]=[{'all':!![]}];}return db[_0xf54e('0x58')]['findAll'](_0x43f9bf);})[_0xf54e('0x27')](function(_0x2c20b5){_0x2b11f8[_0xf54e('0x5b')]=_0x2c20b5;return _0x2b11f8;});}})['then'](respondWithFilteredResult(_0x511a99,_0x43f9bf))[_0xf54e('0x48')](handleError(_0x511a99,null));};exports[_0xf54e('0x5c')]=function(_0x2bf430,_0x13db3e,_0x47339e){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x2bf430['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x13db3e,null))[_0xf54e('0x27')](function(_0x261c39){if(_0x261c39){return _0x261c39['removeDispositions'](_0x2bf430[_0xf54e('0x34')][_0xf54e('0x5d')]);}})[_0xf54e('0x27')](respondWithStatusCode(_0x13db3e,null))[_0xf54e('0x48')](handleError(_0x13db3e,null));};exports['addContacts']=function(_0x4a6dee,_0x25d05e,_0x45c5ff){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4a6dee[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x25d05e,null))[_0xf54e('0x27')](function(_0x3b2a3e){if(_0x3b2a3e){var _0xf5108b=[];var _0x205b47={'success':[],'errors':[]};return db['CmContact'][_0xf54e('0x55')]()[_0xf54e('0x27')](function(_0x2b026a){if(_0x4a6dee[_0xf54e('0x4d')]['tags']&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')])){if(_0x4a6dee[_0xf54e('0x4d')]['tags'][_0xf54e('0x39')]){_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=_0x4a6dee['body']['tags'][_0xf54e('0x60')](';')+';';}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}if(_0x4a6dee[_0xf54e('0x4d')]&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')])){for(var _0x8093bc=0x0;_0x8093bc<_0x4a6dee['body'][_0xf54e('0x39')];_0x8093bc+=0x1){_0x4a6dee[_0xf54e('0x4d')][_0x8093bc][_0xf54e('0x56')]=_0x4a6dee[_0xf54e('0x4a')]['id'];_0xf5108b[_0xf54e('0x61')](_0x4a6dee[_0xf54e('0x4d')][_0x8093bc]);}return BPromise[_0xf54e('0x62')](_0xf5108b,function(_0x9a8f4f){return db[_0xf54e('0x63')][_0xf54e('0x4c')](_[_0xf54e('0x64')](_0x9a8f4f,[_0xf54e('0x5d'),'id'])||{},{'fields':_['keys'](_0x2b026a),'raw':!![]})[_0xf54e('0x27')](function(_0x1cfa09){_0x205b47['success']['push'](_0x1cfa09[_0xf54e('0x65')]);})[_0xf54e('0x48')](function(_0x44687a){_0x205b47[_0xf54e('0x66')][_0xf54e('0x61')]({'data':_0x9a8f4f,'error':_0x44687a[_0xf54e('0x67')]});});})[_0xf54e('0x27')](function(_0x403445){return _0x205b47;})[_0xf54e('0x48')](function(_0x570c3a){return _0x570c3a;});}else{_0x25d05e[_0xf54e('0x1e')](0x190)[_0xf54e('0x68')]({'message':_0xf54e('0x69')});}});}})['then'](respondWithResult(_0x25d05e,null))[_0xf54e('0x48')](handleError(_0x25d05e,null));};exports['getContacts']=function(_0x3830e7,_0x57bc6f,_0xfe35d8){var _0x35da10;return db['CmList']['find']({'where':{'id':_0x3830e7[_0xf54e('0x4a')]['id']},'include':[{'model':db[_0xf54e('0x6a')],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x57bc6f,null))[_0xf54e('0x27')](function(_0x486626){if(_0x486626){_0x35da10=_0x486626;return db['CmContact'][_0xf54e('0x31')];}})[_0xf54e('0x27')](function(_0x456159){if(_0x456159){var _0xc31d53={};var _0x9afe5={};_0x9afe5[_0xf54e('0x32')]=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x456159),_[_0xf54e('0x5a')](_0x35da10[_0xf54e('0x6b')],function(_0x54c13f){return util[_0xf54e('0x6d')](_0xf54e('0x6e'),_0x54c13f['id']);}));_0x9afe5['query']=_['keys'](_0x3830e7[_0xf54e('0x34')]);_0x9afe5[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],_0x9afe5[_0xf54e('0x34')]);_0xc31d53['attributes']=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3830e7[_0xf54e('0x34')]['fields']));_0xc31d53[_0xf54e('0x36')]=_0xc31d53[_0xf54e('0x36')][_0xf54e('0x39')]?_0xc31d53[_0xf54e('0x36')]:_0x9afe5['model'];if(!_0x3830e7[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0xc31d53[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x3830e7['query'][_0xf54e('0x21')]);_0xc31d53['offset']=qs['offset'](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x20')]);}_0xc31d53[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x3b')]);_0xc31d53[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3830e7['query'],_0x9afe5[_0xf54e('0x35')]));_0xc31d53[_0xf54e('0x70')]=!![];if(_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]){_0xc31d53[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0xc31d53['where'],{'$or':_[_0xf54e('0x5a')](_0xc31d53[_0xf54e('0x36')],function(_0xd2c60d){var _0x2b46d4={};_0x2b46d4[_0xd2c60d]={'$like':'%'+_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x2b46d4;})});}_0xc31d53=_['merge']({},_0xc31d53,_0x3830e7[_0xf54e('0x44')]);return _0x35da10[_0xf54e('0x71')](_0xc31d53);}})[_0xf54e('0x27')](respondWithResult(_0x57bc6f,null))[_0xf54e('0x48')](handleError(_0x57bc6f,null));};exports['getContactsCsv']=function(_0x4787ea,_0x2feaff,_0x1a5050){var _0x13dec5;return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4787ea[_0xf54e('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x2feaff,null))[_0xf54e('0x27')](function(_0x2136c2){if(_0x2136c2){_0x13dec5=_0x2136c2;return db[_0xf54e('0x63')][_0xf54e('0x31')];}})['then'](function(_0x33bed6){if(_0x33bed6){var _0x4dde1d={};var _0x385b43={};_0x385b43['model']=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x33bed6),_[_0xf54e('0x5a')](_0x13dec5[_0xf54e('0x6b')],function(_0x19796f){return util['format'](_0xf54e('0x6e'),_0x19796f['id']);}));_0x385b43[_0xf54e('0x34')]=_['keys'](_0x4787ea[_0xf54e('0x34')]);_0x385b43[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x385b43[_0xf54e('0x32')],_0x385b43['query']);_0x4dde1d[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x385b43['model'],qs[_0xf54e('0x38')](_0x4787ea['query']['fields']));_0x4dde1d[_0xf54e('0x36')]=_0x4dde1d['attributes'][_0xf54e('0x39')]?_0x4dde1d[_0xf54e('0x36')]:_0x385b43[_0xf54e('0x32')];if(!_0x4787ea[_0xf54e('0x34')][_0xf54e('0x6f')]('nolimit')){_0x4dde1d[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x21')]);_0x4dde1d['offset']=qs[_0xf54e('0x20')](_0x4787ea['query'][_0xf54e('0x20')]);}_0x4dde1d[_0xf54e('0x3a')]=qs['sort'](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4dde1d[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_['pick'](_0x4787ea[_0xf54e('0x34')],_0x385b43[_0xf54e('0x35')]));_0x4dde1d[_0xf54e('0x70')]=!![];if(_0x4787ea['query']['filter']){_0x4dde1d[_0xf54e('0x3c')]=_['merge'](_0x4dde1d['where'],{'$or':_['map'](_0x4dde1d[_0xf54e('0x36')],function(_0x146a6a){var _0x7c17a={};_0x7c17a[_0x146a6a]={'$like':'%'+_0x4787ea[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x7c17a;})});}_0x4dde1d=_[_0xf54e('0x3e')]({},_0x4dde1d,_0x4787ea[_0xf54e('0x44')]);return _0x13dec5[_0xf54e('0x71')](_0x4dde1d);}})[_0xf54e('0x27')](function(_0x558d5f){if(!_[_0xf54e('0x72')](_0x558d5f)){var _0x523171=toCsv(_0x558d5f);var _0x7cd726=Date[_0xf54e('0x73')]();fs['writeFileSync'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726),_0x523171);_0x2feaff[_0xf54e('0x74')](_0xf54e('0x75'),_0xf54e('0x76')+util[_0xf54e('0x6d')](_0xf54e('0x77'),_0x13dec5['id'],_0x7cd726));_0x2feaff[_0xf54e('0x74')]('Content-type','text/csv');return _0x2feaff['download'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726));}else{return _0x2feaff[_0xf54e('0x1d')](0xcc);}})[_0xf54e('0x48')](handleError(_0x2feaff,null));};exports[_0xf54e('0x78')]=function(_0xf24a7c,_0xf92db2,_0x5e5e50){var _0x40a68c;delete _0xf24a7c[_0xf54e('0x4d')]['id'];return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0xf24a7c[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0xf92db2,null))['then'](function(_0x996df5){if(_0x996df5){return db[_0xf54e('0x79')][_0xf54e('0x7a')](function(_0x3c3b44){return db[_0xf54e('0x6a')]['create'](_0xf24a7c[_0xf54e('0x4d')],{'transaction':_0x3c3b44})[_0xf54e('0x27')](function(_0x26631d){_0x40a68c=_0x26631d;return _0x996df5[_0xf54e('0x7b')](_0x26631d,{'transaction':_0x3c3b44});})[_0xf54e('0x27')](function(){var _0xea4112={'type':db[_0xf54e('0x7c')][_0xf54e('0x7d')],'transaction':_0x3c3b44};switch(_0xf24a7c[_0xf54e('0x4d')]['type']){case _0xf54e('0x7e'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize']['TEXT'];break;case _0xf54e('0x7f'):_0xea4112['type']=db[_0xf54e('0x7c')][_0xf54e('0x80')];break;case _0xf54e('0x81'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize'][_0xf54e('0x82')];_0xea4112[_0xf54e('0x83')]=![];break;default:}return db['sequelize'][_0xf54e('0x84')][_0xf54e('0x85')](_0xf54e('0x86'),util[_0xf54e('0x6d')](_0xf54e('0x87'),_0x40a68c['id']),_0xea4112);})[_0xf54e('0x27')](function(){return _0x40a68c;});});}})[_0xf54e('0x27')](respondWithResult(_0xf92db2,null))[_0xf54e('0x48')](handleError(_0xf92db2,null));};exports[_0xf54e('0x88')]=function(_0x3634bc,_0x4931b8,_0x5168a8){var _0x4bb13e={};var _0x246cdd={};var _0x2ef7e4;var _0x78860e;return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x3634bc['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x4931b8,null))[_0xf54e('0x27')](function(_0x3a9def){if(_0x3a9def){_0x2ef7e4=_0x3a9def;_0x246cdd[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x6a')][_0xf54e('0x31')]);_0x246cdd[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x3634bc[_0xf54e('0x34')]);_0x246cdd[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],_0x246cdd[_0xf54e('0x34')]);_0x4bb13e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3634bc[_0xf54e('0x34')]['fields']));_0x4bb13e[_0xf54e('0x36')]=_0x4bb13e['attributes']['length']?_0x4bb13e[_0xf54e('0x36')]:_0x246cdd[_0xf54e('0x32')];_0x4bb13e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3634bc[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4bb13e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3634bc[_0xf54e('0x34')],_0x246cdd[_0xf54e('0x35')]));_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e['where'],{'$or':[{'ListId':_0x3a9def['id']},{'ListId':null}]});if(_0x3634bc[_0xf54e('0x34')][_0xf54e('0x43')]){_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e[_0xf54e('0x3c')],{'$or':_['map'](_0x4bb13e['attributes'],function(_0x16956a){var _0xcc86ca={};_0xcc86ca[_0x16956a]={'$like':'%'+_0x3634bc['query']['filter']+'%'};return _0xcc86ca;})});}_0x4bb13e=_[_0xf54e('0x3e')]({},_0x4bb13e,_0x3634bc['options']);return db[_0xf54e('0x6a')][_0xf54e('0x89')](_0x4bb13e);}})[_0xf54e('0x27')](respondWithResult(_0x4931b8,null))[_0xf54e('0x48')](handleError(_0x4931b8,null));};exports[_0xf54e('0x8a')]=function(_0x1f9d18,_0x50bff9,_0x39fc7d){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x1f9d18[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x50bff9,null))['then'](function(_0x337fac){if(_0x337fac){return _0x337fac[_0xf54e('0x8a')](_0x1f9d18[_0xf54e('0x4d')]['ids'],_['omit'](_0x1f9d18[_0xf54e('0x4d')],[_0xf54e('0x5d'),'id'])||{})['spread'](function(_0x4f6645){for(var _0x4ce631=0x0;_0x4ce631<_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0xf54e('0x39')];_0x4ce631+=0x1){socket['emit'](_0xf54e('0x8b'),{'UserId':_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0x4ce631],'CmListId':_0x1f9d18[_0xf54e('0x4a')]['id']});}return _0x4f6645;});}})[_0xf54e('0x27')](respondWithResult(_0x50bff9,null))['catch'](handleError(_0x50bff9,null));};exports['removeAgents']=function(_0x54a86a,_0x484acd,_0x5458f0){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x54a86a[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x484acd,null))['then'](function(_0x2d5256){if(_0x2d5256){return _0x2d5256['removeAgents'](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])[_0xf54e('0x27')](function(){if(_[_0xf54e('0x5e')](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])){for(var _0x1b632d=0x0;_0x1b632d<_0x54a86a['query'][_0xf54e('0x5d')][_0xf54e('0x39')];_0x1b632d+=0x1){socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')]['ids'][_0x1b632d]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}}else{socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x484acd,null))['catch'](handleError(_0x484acd,null));};exports['getAgents']=function(_0x40da4d,_0x32f8f4,_0x261d91){var _0x21cb51={};var _0x2acc8c={};var _0x51be69;var _0x31b2d6;return db[_0xf54e('0x30')]['findOne']({'where':{'id':_0x40da4d[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x32f8f4,null))[_0xf54e('0x27')](function(_0x5b5d32){if(_0x5b5d32){_0x51be69=_0x5b5d32;_0x2acc8c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x8e')][_0xf54e('0x31')]);_0x2acc8c[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x40da4d[_0xf54e('0x34')]);_0x2acc8c[_0xf54e('0x35')]=_['intersection'](_0x2acc8c[_0xf54e('0x32')],_0x2acc8c['query']);_0x21cb51[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x2acc8c[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x38')]));_0x21cb51[_0xf54e('0x36')]=_0x21cb51['attributes']['length']?_0x21cb51['attributes']:_0x2acc8c[_0xf54e('0x32')];_0x21cb51['order']=qs[_0xf54e('0x3b')](_0x40da4d['query'][_0xf54e('0x3b')]);_0x21cb51[_0xf54e('0x3c')]=qs['filters'](_[_0xf54e('0x3d')](_0x40da4d[_0xf54e('0x34')],_0x2acc8c[_0xf54e('0x35')]));if(_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]){_0x21cb51[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x21cb51[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x21cb51[_0xf54e('0x36')],function(_0x3351a3){var _0x5bc7ed={};_0x5bc7ed[_0x3351a3]={'$like':'%'+_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x5bc7ed;})});}_0x21cb51=_[_0xf54e('0x3e')]({},_0x21cb51,_0x40da4d['options']);return _0x51be69[_0xf54e('0x8f')](_0x21cb51);}})['then'](function(_0x2f6bcc){if(_0x2f6bcc){_0x31b2d6=_0x2f6bcc[_0xf54e('0x39')];if(!_0x40da4d[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0x21cb51[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x21')]);_0x21cb51[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x40da4d['query']['offset']);}return _0x51be69['getAgents'](_0x21cb51);}})[_0xf54e('0x27')](function(_0x3cc581){if(_0x3cc581){return _0x3cc581?{'count':_0x31b2d6,'rows':_0x3cc581}:null;}})[_0xf54e('0x27')](respondWithResult(_0x32f8f4,null))['catch'](handleError(_0x32f8f4,null));}; \ No newline at end of file +var _0x34e8=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','Lists','stack','name','send','index','CmList','model','query','keys','filters','intersection','attributes','fields','limit','sort','where','filter','merge','map','key','field','include','rows','catch','show','length','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','nolimit','pick','ListId','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','omit','success','dataValues','errors','push','message','getContacts','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','CmCustomField','order','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','type','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User'];(function(_0x4282fc,_0x3e6b7e){var _0x264eab=function(_0xc73071){while(--_0xc73071){_0x4282fc['push'](_0x4282fc['shift']());}};_0x264eab(++_0x3e6b7e);}(_0x34e8,0x12c));var _0x834e=function(_0x4b54cd,_0x127553){_0x4b54cd=_0x4b54cd-0x0;var _0x38b2ed=_0x34e8[_0x4b54cd];return _0x38b2ed;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var db=require(_0x834e('0x1b'))['db'];config[_0x834e('0x1c')]=_['defaults'](config[_0x834e('0x1c')],{'host':_0x834e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x834e('0x1c')]));require(_0x834e('0x1e'))[_0x834e('0x1f')](socket);function respondWithStatusCode(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xcc;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x20')](_0x50e860);}return _0x21cc0a['status'](_0x50e860)[_0x834e('0x21')]();};}function respondWithResult(_0x4a9cdc,_0x38a8cd){_0x38a8cd=_0x38a8cd||0xc8;return function(_0x36d443){if(_0x36d443){return _0x4a9cdc['status'](_0x38a8cd)[_0x834e('0x22')](_0x36d443);}};}function respondWithFilteredResult(_0x22106e,_0x370fb5){return function(_0x50b3f6){if(_0x50b3f6){var _0x283e56=_0x50b3f6[_0x834e('0x23')],_0x211e9a=_0x370fb5[_0x834e('0x24')],_0x34e41a=_0x370fb5[_0x834e('0x24')]+_0x370fb5['limit'],_0xb993a1;if(_0x34e41a>=_0x283e56){_0x34e41a=_0x283e56;_0xb993a1=0xc8;}else{_0xb993a1=0xce;}_0x22106e[_0x834e('0x25')](_0xb993a1);return _0x22106e[_0x834e('0x26')](_0x834e('0x27'),_0x211e9a+'-'+_0x34e41a+'/'+_0x283e56)[_0x834e('0x22')](_0x50b3f6);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x28')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x29')](_0x5a05c0);}return _0x45a630[_0x834e('0x2a')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2b')](_0x8d406e)[_0x834e('0x2c')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2d')]()[_0x834e('0x2c')](function(){var _0x338636=_0x58f4fd['get']({'plain':!![]});var _0x24fcf7=_0x834e('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fcf7,'resourceId':_0x338636['id']}})[_0x834e('0x2c')](function(){return _0x58f4fd;});})['then'](function(){_0x25ee1d[_0x834e('0x25')](0xcc)[_0x834e('0x21')]();});}};}function handleEntityNotFound(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(!_0x3cd928){_0x3db026[_0x834e('0x20')](0x194);}return _0x3cd928;};}function handleError(_0x491919,_0x510780){_0x510780=_0x510780||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x834e('0x2f')]);if(_0x4dc64a[_0x834e('0x30')]){delete _0x4dc64a[_0x834e('0x30')];}_0x491919['status'](_0x510780)[_0x834e('0x31')](_0x4dc64a);};}exports[_0x834e('0x32')]=function(_0x1f3671,_0x1e026a){var _0x4551f5={},_0x390119={},_0x3d149d={'count':0x0,'rows':[]};var _0xfaf716=db[_0x834e('0x33')]['rawAttributes'];_0x390119[_0x834e('0x34')]=_['keys'](_0xfaf716);_0x390119[_0x834e('0x35')]=_[_0x834e('0x36')](_0x1f3671[_0x834e('0x35')]);_0x390119[_0x834e('0x37')]=_[_0x834e('0x38')](_0x390119[_0x834e('0x34')],_0x390119[_0x834e('0x35')]);_0x4551f5[_0x834e('0x39')]=_[_0x834e('0x38')](_0x390119[_0x834e('0x34')],qs['fields'](_0x1f3671[_0x834e('0x35')][_0x834e('0x3a')]));_0x4551f5[_0x834e('0x39')]=_0x4551f5[_0x834e('0x39')]['length']?_0x4551f5[_0x834e('0x39')]:_0x390119[_0x834e('0x34')];if(!_0x1f3671['query']['hasOwnProperty']('nolimit')){_0x4551f5[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x1f3671[_0x834e('0x35')][_0x834e('0x3b')]);_0x4551f5[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x1f3671['query'][_0x834e('0x24')]);}_0x4551f5['order']=qs[_0x834e('0x3c')](_0x1f3671[_0x834e('0x35')]['sort']);_0x4551f5[_0x834e('0x3d')]=qs[_0x834e('0x37')](_['pick'](_0x1f3671['query'],_0x390119[_0x834e('0x37')]));if(_0x1f3671[_0x834e('0x35')][_0x834e('0x3e')]){_0x4551f5[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x4551f5['where'],{'$or':_[_0x834e('0x40')](_0xfaf716,function(_0x548d1d){if(_0x548d1d['type'][_0x834e('0x41')]!=='VIRTUAL'){var _0x2e5239={};_0x2e5239[_0x548d1d[_0x834e('0x42')]]={'$like':'%'+_0x1f3671[_0x834e('0x35')][_0x834e('0x3e')]+'%'};return _0x2e5239;}})});}_0x4551f5=_[_0x834e('0x3f')]({},_0x4551f5,_0x1f3671['options']);var _0x207523={'where':_0x4551f5[_0x834e('0x3d')]};return db[_0x834e('0x33')]['count'](_0x207523)[_0x834e('0x2c')](function(_0x16ac45){_0x3d149d['count']=_0x16ac45;if(_0x1f3671[_0x834e('0x35')]['includeAll']){_0x4551f5[_0x834e('0x43')]=[{'all':!![]}];}return db[_0x834e('0x33')]['findAll'](_0x4551f5);})['then'](function(_0x22ea21){_0x3d149d[_0x834e('0x44')]=_0x22ea21;return _0x3d149d;})[_0x834e('0x2c')](respondWithFilteredResult(_0x1e026a,_0x4551f5))[_0x834e('0x45')](handleError(_0x1e026a,null));};exports[_0x834e('0x46')]=function(_0x23feea,_0x195204){var _0x4a3381={'raw':![],'where':{'id':_0x23feea['params']['id']}},_0x13d45a={};_0x13d45a[_0x834e('0x34')]=_['keys'](db[_0x834e('0x33')]['rawAttributes']);_0x13d45a[_0x834e('0x35')]=_[_0x834e('0x36')](_0x23feea['query']);_0x13d45a[_0x834e('0x37')]=_[_0x834e('0x38')](_0x13d45a[_0x834e('0x34')],_0x13d45a[_0x834e('0x35')]);_0x4a3381[_0x834e('0x39')]=_[_0x834e('0x38')](_0x13d45a[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x23feea[_0x834e('0x35')][_0x834e('0x3a')]));_0x4a3381['attributes']=_0x4a3381[_0x834e('0x39')][_0x834e('0x47')]?_0x4a3381['attributes']:_0x13d45a[_0x834e('0x34')];if(_0x23feea[_0x834e('0x35')][_0x834e('0x48')]){_0x4a3381[_0x834e('0x43')]=[{'all':!![]}];}_0x4a3381=_[_0x834e('0x3f')]({},_0x4a3381,_0x23feea[_0x834e('0x49')]);return db['CmList']['find'](_0x4a3381)[_0x834e('0x2c')](handleEntityNotFound(_0x195204,null))[_0x834e('0x2c')](respondWithResult(_0x195204,null))[_0x834e('0x45')](handleError(_0x195204,null));};exports[_0x834e('0x4a')]=function(_0x3da408,_0xd1d83b){return db[_0x834e('0x33')][_0x834e('0x4a')](_0x3da408[_0x834e('0x4b')],{})[_0x834e('0x2c')](function(_0xf02f0d){var _0x385435=_0x3da408[_0x834e('0x4c')][_0x834e('0x4d')]({'plain':!![]});if(!_0x385435)throw new Error(_0x834e('0x4e'));if(_0x385435[_0x834e('0x4f')]===_0x834e('0x4c')){var _0x32b8f7=_0xf02f0d[_0x834e('0x4d')]({'plain':!![]});var _0x1adf86='Lists';return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'name':_0x1adf86,'userProfileId':_0x385435['userProfileId']},'raw':!![]})[_0x834e('0x2c')](function(_0x3b0988){if(_0x3b0988&&_0x3b0988['autoAssociation']===0x0){return db[_0x834e('0x52')][_0x834e('0x4a')]({'name':_0x32b8f7[_0x834e('0x30')],'resourceId':_0x32b8f7['id'],'type':_0x3b0988[_0x834e('0x30')],'sectionId':_0x3b0988['id']},{})[_0x834e('0x2c')](function(){return _0xf02f0d;});}else{return _0xf02f0d;}})[_0x834e('0x45')](function(_0x4549ba){logger['error'](_0x834e('0x53'),_0x4549ba);throw _0x4549ba;});}return _0xf02f0d;})[_0x834e('0x2c')](respondWithResult(_0xd1d83b,0xc9))[_0x834e('0x45')](handleError(_0xd1d83b,null));};exports[_0x834e('0x2b')]=function(_0x86ad2b,_0x396bbe){if(_0x86ad2b[_0x834e('0x4b')]['id']){delete _0x86ad2b[_0x834e('0x4b')]['id'];}return db['CmList'][_0x834e('0x51')]({'where':{'id':_0x86ad2b['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x396bbe,null))['then'](saveUpdates(_0x86ad2b[_0x834e('0x4b')],null))['then'](respondWithResult(_0x396bbe,null))['catch'](handleError(_0x396bbe,null));};exports[_0x834e('0x2d')]=function(_0x3e1bee,_0x5291ae){return db['CmList'][_0x834e('0x51')]({'where':{'id':_0x3e1bee[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x5291ae,null))[_0x834e('0x2c')](removeEntity(_0x5291ae,null))[_0x834e('0x45')](handleError(_0x5291ae,null));};exports[_0x834e('0x55')]=function(_0x3d3f2b,_0x4273f1){return db['CmList'][_0x834e('0x55')]()[_0x834e('0x2c')](respondWithResult(_0x4273f1,null))['catch'](handleError(_0x4273f1,null));};exports[_0x834e('0x56')]=function(_0x4e2b22,_0x3e58ef,_0x45eceb){if(_0x4e2b22['body']['id']){delete _0x4e2b22[_0x834e('0x4b')]['id'];}return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0x4e2b22[_0x834e('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e58ef,null))[_0x834e('0x2c')](function(_0x438f75){if(_0x438f75){_0x4e2b22[_0x834e('0x4b')]['ListId']=_0x438f75['id'];return db[_0x834e('0x57')][_0x834e('0x4a')](_0x4e2b22[_0x834e('0x4b')]);}})[_0x834e('0x2c')](respondWithResult(_0x3e58ef,null))[_0x834e('0x45')](handleError(_0x3e58ef,null));};exports[_0x834e('0x58')]=function(_0x3a1426,_0x1def00,_0x208c21){var _0xfcccd8={'raw':![],'where':{}};var _0x1e4310={};var _0x1dfa95={'count':0x0,'rows':[]};return db[_0x834e('0x33')][_0x834e('0x59')]({'where':{'id':_0x3a1426[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x1def00,null))[_0x834e('0x2c')](function(_0x14ed83){if(_0x14ed83){_0x1e4310[_0x834e('0x34')]=_[_0x834e('0x36')](db[_0x834e('0x57')][_0x834e('0x5a')]);_0x1e4310['query']=_[_0x834e('0x36')](_0x3a1426[_0x834e('0x35')]);_0x1e4310[_0x834e('0x37')]=_[_0x834e('0x38')](_0x1e4310['model'],_0x1e4310[_0x834e('0x35')]);_0xfcccd8['attributes']=_['intersection'](_0x1e4310[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x3a1426[_0x834e('0x35')][_0x834e('0x3a')]));_0xfcccd8[_0x834e('0x39')]=_0xfcccd8[_0x834e('0x39')][_0x834e('0x47')]?_0xfcccd8[_0x834e('0x39')]:_0x1e4310['model'];if(!_0x3a1426[_0x834e('0x35')]['hasOwnProperty'](_0x834e('0x5b'))){_0xfcccd8[_0x834e('0x3b')]=qs['limit'](_0x3a1426['query'][_0x834e('0x3b')]);_0xfcccd8[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x3a1426[_0x834e('0x35')][_0x834e('0x24')]);}_0xfcccd8['order']=qs[_0x834e('0x3c')](_0x3a1426[_0x834e('0x35')][_0x834e('0x3c')]);_0xfcccd8[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x3a1426[_0x834e('0x35')],_0x1e4310[_0x834e('0x37')]));_0xfcccd8[_0x834e('0x3d')][_0x834e('0x5d')]=_0x14ed83['id'];if(_0x3a1426['query'][_0x834e('0x3e')]){_0xfcccd8[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0xfcccd8[_0x834e('0x3d')],{'$or':_['map'](_0xfcccd8[_0x834e('0x39')],function(_0x4ac5f2){var _0x5ce8b0={};_0x5ce8b0[_0x4ac5f2]={'$like':'%'+_0x3a1426['query'][_0x834e('0x3e')]+'%'};return _0x5ce8b0;})});}_0xfcccd8=_[_0x834e('0x3f')]({},_0xfcccd8,_0x3a1426['options']);return db[_0x834e('0x57')][_0x834e('0x23')]({'where':_0xfcccd8['where']})[_0x834e('0x2c')](function(_0x18ccb2){_0x1dfa95['count']=_0x18ccb2;if(_0x3a1426['query'][_0x834e('0x48')]){_0xfcccd8[_0x834e('0x43')]=[{'all':!![]}];}return db[_0x834e('0x57')][_0x834e('0x5e')](_0xfcccd8);})[_0x834e('0x2c')](function(_0x493239){_0x1dfa95[_0x834e('0x44')]=_0x493239;return _0x1dfa95;});}})['then'](respondWithFilteredResult(_0x1def00,_0xfcccd8))[_0x834e('0x45')](handleError(_0x1def00,null));};exports[_0x834e('0x5f')]=function(_0x2c758c,_0x5afb41,_0x33a3cd){return db[_0x834e('0x33')]['find']({'where':{'id':_0x2c758c[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x5afb41,null))[_0x834e('0x2c')](function(_0x50d0a3){if(_0x50d0a3){return _0x50d0a3[_0x834e('0x5f')](_0x2c758c[_0x834e('0x35')][_0x834e('0x60')]);}})[_0x834e('0x2c')](respondWithStatusCode(_0x5afb41,null))[_0x834e('0x45')](handleError(_0x5afb41,null));};exports[_0x834e('0x61')]=function(_0x1372dd,_0x23b5d9,_0xd49002){return db[_0x834e('0x33')]['find']({'where':{'id':_0x1372dd['params']['id']}})['then'](handleEntityNotFound(_0x23b5d9,null))[_0x834e('0x2c')](function(_0x1135a5){if(_0x1135a5){var _0x313c03=[];var _0x37fa2c={'success':[],'errors':[]};return db[_0x834e('0x62')]['describe']()['then'](function(_0x4520fc){if(_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')]&&_[_0x834e('0x64')](_0x1372dd[_0x834e('0x4b')]['tags'])){if(_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')][_0x834e('0x47')]){_0x1372dd['body'][_0x834e('0x63')]=_0x1372dd[_0x834e('0x4b')][_0x834e('0x63')][_0x834e('0x65')](';')+';';}else{_0x1372dd[_0x834e('0x4b')]['tags']=null;}}else{_0x1372dd['body'][_0x834e('0x63')]=null;}if(_0x1372dd[_0x834e('0x4b')]&&_['isArray'](_0x1372dd[_0x834e('0x4b')])){for(var _0x509427=0x0;_0x509427<_0x1372dd[_0x834e('0x4b')][_0x834e('0x47')];_0x509427+=0x1){_0x1372dd[_0x834e('0x4b')][_0x509427]['ListId']=_0x1372dd[_0x834e('0x54')]['id'];_0x313c03['push'](_0x1372dd['body'][_0x509427]);}return BPromise['each'](_0x313c03,function(_0x6735e6){return db[_0x834e('0x62')][_0x834e('0x4a')](_[_0x834e('0x66')](_0x6735e6,[_0x834e('0x60'),'id'])||{},{'fields':_[_0x834e('0x36')](_0x4520fc),'raw':!![]})[_0x834e('0x2c')](function(_0x179892){_0x37fa2c[_0x834e('0x67')]['push'](_0x179892[_0x834e('0x68')]);})['catch'](function(_0x11a9f7){_0x37fa2c[_0x834e('0x69')][_0x834e('0x6a')]({'data':_0x6735e6,'error':_0x11a9f7[_0x834e('0x6b')]});});})[_0x834e('0x2c')](function(_0x116830){return _0x37fa2c;})['catch'](function(_0x56d0f8){return _0x56d0f8;});}else{_0x23b5d9[_0x834e('0x25')](0x190)[_0x834e('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x834e('0x2c')](respondWithResult(_0x23b5d9,null))[_0x834e('0x45')](handleError(_0x23b5d9,null));};exports[_0x834e('0x6c')]=function(_0x1e225f,_0xc75f5e,_0x5a75e3){var _0x29839d;return db[_0x834e('0x33')]['find']({'where':{'id':_0x1e225f['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x834e('0x6d')}]})[_0x834e('0x2c')](handleEntityNotFound(_0xc75f5e,null))['then'](function(_0x23ce49){if(_0x23ce49){_0x29839d=_0x23ce49;return db[_0x834e('0x62')]['rawAttributes'];}})[_0x834e('0x2c')](function(_0x49eed7){if(_0x49eed7){var _0x4813a8={};var _0x41dfd9={};_0x41dfd9[_0x834e('0x34')]=_[_0x834e('0x6e')](_[_0x834e('0x36')](_0x49eed7),_['map'](_0x29839d[_0x834e('0x6d')],function(_0x34ecc8){return util[_0x834e('0x6f')](_0x834e('0x70'),_0x34ecc8['id']);}));_0x41dfd9[_0x834e('0x35')]=_[_0x834e('0x36')](_0x1e225f[_0x834e('0x35')]);_0x41dfd9[_0x834e('0x37')]=_[_0x834e('0x38')](_0x41dfd9[_0x834e('0x34')],_0x41dfd9[_0x834e('0x35')]);_0x4813a8[_0x834e('0x39')]=_[_0x834e('0x38')](_0x41dfd9[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x1e225f[_0x834e('0x35')][_0x834e('0x3a')]));_0x4813a8[_0x834e('0x39')]=_0x4813a8[_0x834e('0x39')][_0x834e('0x47')]?_0x4813a8[_0x834e('0x39')]:_0x41dfd9[_0x834e('0x34')];if(!_0x1e225f['query'][_0x834e('0x71')](_0x834e('0x5b'))){_0x4813a8[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x1e225f[_0x834e('0x35')][_0x834e('0x3b')]);_0x4813a8[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x1e225f[_0x834e('0x35')]['offset']);}_0x4813a8['order']=qs['sort'](_0x1e225f[_0x834e('0x35')]['sort']);_0x4813a8[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x1e225f['query'],_0x41dfd9[_0x834e('0x37')]));_0x4813a8[_0x834e('0x72')]=!![];if(_0x1e225f[_0x834e('0x35')][_0x834e('0x3e')]){_0x4813a8[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x4813a8['where'],{'$or':_[_0x834e('0x40')](_0x4813a8[_0x834e('0x39')],function(_0x24ff45){var _0x430973={};_0x430973[_0x24ff45]={'$like':'%'+_0x1e225f[_0x834e('0x35')]['filter']+'%'};return _0x430973;})});}_0x4813a8=_['merge']({},_0x4813a8,_0x1e225f['options']);return _0x29839d['getContacts'](_0x4813a8);}})[_0x834e('0x2c')](respondWithResult(_0xc75f5e,null))[_0x834e('0x45')](handleError(_0xc75f5e,null));};exports['getContactsCsv']=function(_0x3bd1e7,_0xf9fec9,_0x4fb709){var _0x296629;return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0x3bd1e7[_0x834e('0x54')]['id']},'include':[{'model':db[_0x834e('0x73')],'as':_0x834e('0x6d')}]})['then'](handleEntityNotFound(_0xf9fec9,null))['then'](function(_0x43b92f){if(_0x43b92f){_0x296629=_0x43b92f;return db[_0x834e('0x62')][_0x834e('0x5a')];}})['then'](function(_0x34fb30){if(_0x34fb30){var _0x3753cc={};var _0x582b24={};_0x582b24[_0x834e('0x34')]=_[_0x834e('0x6e')](_[_0x834e('0x36')](_0x34fb30),_[_0x834e('0x40')](_0x296629['CustomFields'],function(_0x366a9f){return util['format']('cf_%d',_0x366a9f['id']);}));_0x582b24[_0x834e('0x35')]=_[_0x834e('0x36')](_0x3bd1e7[_0x834e('0x35')]);_0x582b24[_0x834e('0x37')]=_[_0x834e('0x38')](_0x582b24[_0x834e('0x34')],_0x582b24['query']);_0x3753cc['attributes']=_[_0x834e('0x38')](_0x582b24[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3a')]));_0x3753cc[_0x834e('0x39')]=_0x3753cc[_0x834e('0x39')]['length']?_0x3753cc[_0x834e('0x39')]:_0x582b24[_0x834e('0x34')];if(!_0x3bd1e7['query'][_0x834e('0x71')](_0x834e('0x5b'))){_0x3753cc[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3b')]);_0x3753cc[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x24')]);}_0x3753cc[_0x834e('0x74')]=qs[_0x834e('0x3c')](_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3c')]);_0x3753cc['where']=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x3bd1e7['query'],_0x582b24[_0x834e('0x37')]));_0x3753cc['raw']=!![];if(_0x3bd1e7[_0x834e('0x35')]['filter']){_0x3753cc[_0x834e('0x3d')]=_['merge'](_0x3753cc[_0x834e('0x3d')],{'$or':_[_0x834e('0x40')](_0x3753cc[_0x834e('0x39')],function(_0x1aac37){var _0x57ee25={};_0x57ee25[_0x1aac37]={'$like':'%'+_0x3bd1e7[_0x834e('0x35')][_0x834e('0x3e')]+'%'};return _0x57ee25;})});}_0x3753cc=_[_0x834e('0x3f')]({},_0x3753cc,_0x3bd1e7[_0x834e('0x49')]);return _0x296629[_0x834e('0x6c')](_0x3753cc);}})[_0x834e('0x2c')](function(_0x2f6f97){if(!_[_0x834e('0x75')](_0x2f6f97)){var _0x2aa430=toCsv(_0x2f6f97);var _0x214c73=Date[_0x834e('0x76')]();fs[_0x834e('0x77')](util[_0x834e('0x6f')](_0x834e('0x78'),_0x296629['id'],_0x214c73),_0x2aa430);_0xf9fec9[_0x834e('0x79')](_0x834e('0x7a'),_0x834e('0x7b')+util['format']('list_%d_%s.csv',_0x296629['id'],_0x214c73));_0xf9fec9[_0x834e('0x79')](_0x834e('0x7c'),_0x834e('0x7d'));return _0xf9fec9[_0x834e('0x7e')](util[_0x834e('0x6f')](_0x834e('0x78'),_0x296629['id'],_0x214c73));}else{return _0xf9fec9[_0x834e('0x20')](0xcc);}})[_0x834e('0x45')](handleError(_0xf9fec9,null));};exports[_0x834e('0x7f')]=function(_0x58cd3b,_0x25f1f9,_0x32645e){var _0x513d9e;delete _0x58cd3b[_0x834e('0x4b')]['id'];return db['CmList'][_0x834e('0x59')]({'where':{'id':_0x58cd3b[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x25f1f9,null))['then'](function(_0x1a65b4){if(_0x1a65b4){return db[_0x834e('0x80')]['transaction'](function(_0x4f7c62){return db[_0x834e('0x73')][_0x834e('0x4a')](_0x58cd3b['body'],{'transaction':_0x4f7c62})[_0x834e('0x2c')](function(_0x132edd){_0x513d9e=_0x132edd;return _0x1a65b4[_0x834e('0x81')](_0x132edd,{'transaction':_0x4f7c62});})[_0x834e('0x2c')](function(){var _0x170ec2={'type':db['Sequelize']['TEXT'],'transaction':_0x4f7c62};switch(_0x58cd3b[_0x834e('0x4b')]['type']){case'text':_0x170ec2['type']=db[_0x834e('0x82')][_0x834e('0x83')];break;case'number':_0x170ec2[_0x834e('0x84')]=db[_0x834e('0x82')][_0x834e('0x85')];break;case _0x834e('0x86'):_0x170ec2['type']=db[_0x834e('0x82')][_0x834e('0x87')];_0x170ec2[_0x834e('0x88')]=![];break;default:}return db['sequelize'][_0x834e('0x89')]['addColumn'](_0x834e('0x8a'),util['format'](_0x834e('0x8b'),_0x513d9e['id']),_0x170ec2);})[_0x834e('0x2c')](function(){return _0x513d9e;});});}})['then'](respondWithResult(_0x25f1f9,null))[_0x834e('0x45')](handleError(_0x25f1f9,null));};exports[_0x834e('0x8c')]=function(_0x41e7a8,_0x1b81ca,_0x410895){var _0x24d77c={};var _0x5bb5ff={};var _0x2d4b29;var _0x464339;return db[_0x834e('0x33')][_0x834e('0x59')]({'where':{'id':_0x41e7a8[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x1b81ca,null))['then'](function(_0x448420){if(_0x448420){_0x2d4b29=_0x448420;_0x5bb5ff['model']=_['keys'](db[_0x834e('0x73')]['rawAttributes']);_0x5bb5ff['query']=_[_0x834e('0x36')](_0x41e7a8[_0x834e('0x35')]);_0x5bb5ff[_0x834e('0x37')]=_[_0x834e('0x38')](_0x5bb5ff[_0x834e('0x34')],_0x5bb5ff[_0x834e('0x35')]);_0x24d77c[_0x834e('0x39')]=_[_0x834e('0x38')](_0x5bb5ff[_0x834e('0x34')],qs[_0x834e('0x3a')](_0x41e7a8[_0x834e('0x35')][_0x834e('0x3a')]));_0x24d77c[_0x834e('0x39')]=_0x24d77c[_0x834e('0x39')]['length']?_0x24d77c[_0x834e('0x39')]:_0x5bb5ff['model'];_0x24d77c[_0x834e('0x74')]=qs[_0x834e('0x3c')](_0x41e7a8[_0x834e('0x35')][_0x834e('0x3c')]);_0x24d77c['where']=qs['filters'](_[_0x834e('0x5c')](_0x41e7a8[_0x834e('0x35')],_0x5bb5ff['filters']));_0x24d77c[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x24d77c['where'],{'$or':[{'ListId':_0x448420['id']},{'ListId':null}]});if(_0x41e7a8[_0x834e('0x35')][_0x834e('0x3e')]){_0x24d77c[_0x834e('0x3d')]=_[_0x834e('0x3f')](_0x24d77c['where'],{'$or':_['map'](_0x24d77c['attributes'],function(_0x48e14c){var _0x3baa81={};_0x3baa81[_0x48e14c]={'$like':'%'+_0x41e7a8[_0x834e('0x35')]['filter']+'%'};return _0x3baa81;})});}_0x24d77c=_[_0x834e('0x3f')]({},_0x24d77c,_0x41e7a8['options']);return db[_0x834e('0x73')][_0x834e('0x8d')](_0x24d77c);}})[_0x834e('0x2c')](respondWithResult(_0x1b81ca,null))[_0x834e('0x45')](handleError(_0x1b81ca,null));};exports[_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0xfa6cdb['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3c775f,null))[_0x834e('0x2c')](function(_0x536f66){if(_0x536f66){return _0x536f66['addAgents'](_0xfa6cdb['body'][_0x834e('0x60')],_[_0x834e('0x66')](_0xfa6cdb[_0x834e('0x4b')],['ids','id'])||{})[_0x834e('0x8f')](function(_0x45d444){for(var _0xbd0346=0x0;_0xbd0346<_0xfa6cdb[_0x834e('0x4b')][_0x834e('0x60')][_0x834e('0x47')];_0xbd0346+=0x1){socket[_0x834e('0x90')](_0x834e('0x91'),{'UserId':_0xfa6cdb[_0x834e('0x4b')][_0x834e('0x60')][_0xbd0346],'CmListId':_0xfa6cdb['params']['id']});}return _0x45d444;});}})['then'](respondWithResult(_0x3c775f,null))[_0x834e('0x45')](handleError(_0x3c775f,null));};exports[_0x834e('0x92')]=function(_0xbc7704,_0x3eda93,_0x4303a6){return db[_0x834e('0x33')][_0x834e('0x51')]({'where':{'id':_0xbc7704[_0x834e('0x54')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3eda93,null))[_0x834e('0x2c')](function(_0x264adc){if(_0x264adc){return _0x264adc[_0x834e('0x92')](_0xbc7704[_0x834e('0x35')]['ids'])[_0x834e('0x2c')](function(){if(_[_0x834e('0x64')](_0xbc7704[_0x834e('0x35')][_0x834e('0x60')])){for(var _0x495697=0x0;_0x495697<_0xbc7704['query']['ids'][_0x834e('0x47')];_0x495697+=0x1){socket[_0x834e('0x90')](_0x834e('0x93'),{'UserId':Number(_0xbc7704[_0x834e('0x35')][_0x834e('0x60')][_0x495697]),'CmListId':Number(_0xbc7704[_0x834e('0x54')]['id'])});}}else{socket[_0x834e('0x90')](_0x834e('0x93'),{'UserId':Number(_0xbc7704['query']['ids']),'CmListId':Number(_0xbc7704['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3eda93,null))[_0x834e('0x45')](handleError(_0x3eda93,null));};exports[_0x834e('0x94')]=function(_0x37defd,_0x30d669,_0x72f950){var _0x386e10={};var _0x3bee40={};var _0x29ef2f;var _0x33757d;return db['CmList']['findOne']({'where':{'id':_0x37defd['params']['id']}})['then'](handleEntityNotFound(_0x30d669,null))[_0x834e('0x2c')](function(_0x17025e){if(_0x17025e){_0x29ef2f=_0x17025e;_0x3bee40[_0x834e('0x34')]=_[_0x834e('0x36')](db[_0x834e('0x95')][_0x834e('0x5a')]);_0x3bee40[_0x834e('0x35')]=_[_0x834e('0x36')](_0x37defd[_0x834e('0x35')]);_0x3bee40[_0x834e('0x37')]=_[_0x834e('0x38')](_0x3bee40[_0x834e('0x34')],_0x3bee40[_0x834e('0x35')]);_0x386e10[_0x834e('0x39')]=_[_0x834e('0x38')](_0x3bee40[_0x834e('0x34')],qs['fields'](_0x37defd[_0x834e('0x35')]['fields']));_0x386e10[_0x834e('0x39')]=_0x386e10[_0x834e('0x39')][_0x834e('0x47')]?_0x386e10['attributes']:_0x3bee40[_0x834e('0x34')];_0x386e10[_0x834e('0x74')]=qs['sort'](_0x37defd['query'][_0x834e('0x3c')]);_0x386e10[_0x834e('0x3d')]=qs[_0x834e('0x37')](_[_0x834e('0x5c')](_0x37defd[_0x834e('0x35')],_0x3bee40[_0x834e('0x37')]));if(_0x37defd[_0x834e('0x35')][_0x834e('0x3e')]){_0x386e10['where']=_[_0x834e('0x3f')](_0x386e10[_0x834e('0x3d')],{'$or':_[_0x834e('0x40')](_0x386e10[_0x834e('0x39')],function(_0x1912e6){var _0x614e15={};_0x614e15[_0x1912e6]={'$like':'%'+_0x37defd[_0x834e('0x35')]['filter']+'%'};return _0x614e15;})});}_0x386e10=_[_0x834e('0x3f')]({},_0x386e10,_0x37defd['options']);return _0x29ef2f['getAgents'](_0x386e10);}})[_0x834e('0x2c')](function(_0x1e0bc9){if(_0x1e0bc9){_0x33757d=_0x1e0bc9['length'];if(!_0x37defd[_0x834e('0x35')][_0x834e('0x71')]('nolimit')){_0x386e10[_0x834e('0x3b')]=qs[_0x834e('0x3b')](_0x37defd['query']['limit']);_0x386e10[_0x834e('0x24')]=qs[_0x834e('0x24')](_0x37defd['query']['offset']);}return _0x29ef2f[_0x834e('0x94')](_0x386e10);}})[_0x834e('0x2c')](function(_0x5d6f5e){if(_0x5d6f5e){return _0x5d6f5e?{'count':_0x33757d,'rows':_0x5d6f5e}:null;}})['then'](respondWithResult(_0x30d669,null))['catch'](handleError(_0x30d669,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 71ac642..6867337 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 _0xe706=['events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x3657f2,_0x9a1d30){var _0x5ebfc1=function(_0x597584){while(--_0x597584){_0x3657f2['push'](_0x3657f2['shift']());}};_0x5ebfc1(++_0x9a1d30);}(_0xe706,0x12c));var _0x6e70=function(_0x5d869e,_0x1731bd){_0x5d869e=_0x5d869e-0x0;var _0x13a90b=_0xe706[_0x5d869e];return _0x13a90b;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var CmList=require(_0x6e70('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x2'),'afterUpdate':'update','afterDestroy':_0x6e70('0x3')};function emitEvent(_0x3aa8a6){return function(_0x27bf0b,_0x139c75,_0x58a7da){CmListEvents[_0x6e70('0x4')](_0x3aa8a6+':'+_0x27bf0b['id'],_0x27bf0b);CmListEvents['emit'](_0x3aa8a6,_0x27bf0b);_0x58a7da(null);};}for(var e in events){if(events[_0x6e70('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xa6df=['remove','hook','exports','events','setMaxListeners','save','update'];(function(_0x335202,_0x16d8a7){var _0x93ca72=function(_0x3074a1){while(--_0x3074a1){_0x335202['push'](_0x335202['shift']());}};_0x93ca72(++_0x16d8a7);}(_0xa6df,0x145));var _0xfa6d=function(_0x5002cb,_0x3325ae){_0x5002cb=_0x5002cb-0x0;var _0x591955=_0xa6df[_0x5002cb];return _0x591955;};'use strict';var EventEmitter=require(_0xfa6d('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xfa6d('0x1')](0x0);var events={'afterCreate':_0xfa6d('0x2'),'afterUpdate':_0xfa6d('0x3'),'afterDestroy':_0xfa6d('0x4')};function emitEvent(_0x3e52a3){return function(_0x449ec4,_0x4a3055,_0x57e1b9){CmListEvents['emit'](_0x3e52a3+':'+_0x449ec4['id'],_0x449ec4);CmListEvents['emit'](_0x3e52a3,_0x449ec4);_0x57e1b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xfa6d('0x5')](e,emitEvent(event));}}module[_0xfa6d('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 2daed98..8a61c12 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 _0xd2ce=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmList','util','api','moment'];(function(_0x347e56,_0x13aaea){var _0xd94cf1=function(_0x4c2e79){while(--_0x4c2e79){_0x347e56['push'](_0x347e56['shift']());}};_0xd94cf1(++_0x13aaea);}(_0xd2ce,0x13c));var _0xed2c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd2ce[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var logger=require('../../config/logger')(_0xed2c('0x1'));var moment=require(_0xed2c('0x2'));var BPromise=require(_0xed2c('0x3'));var rp=require(_0xed2c('0x4'));var fs=require('fs');var path=require(_0xed2c('0x5'));var rimraf=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var attributes=require('./cmList.attributes');module[_0xed2c('0x8')]=function(_0x5b6ccb,_0x38aa25){return _0x5b6ccb[_0xed2c('0x9')](_0xed2c('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09dd=['exports','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09dd,0x81));var _0xd09d=function(_0x338581,_0x85c756){_0x338581=_0x338581-0x0;var _0x306123=_0x09dd[_0x338581];return _0x306123;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a9edbf6..9c4938f 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 _0x13ea=['register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x392368,_0x1e14a5){var _0x33efe7=function(_0x385d1a){while(--_0x385d1a){_0x392368['push'](_0x392368['shift']());}};_0x33efe7(++_0x1e14a5);}(_0x13ea,0x139));var _0xa13e=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x13ea[_0x254b22];return _0x1279db;};'use strict';var _=require(_0xa13e('0x0'));var util=require(_0xa13e('0x1'));var moment=require(_0xa13e('0x2'));var BPromise=require(_0xa13e('0x3'));var rs=require(_0xa13e('0x4'));var fs=require('fs');var Redis=require(_0xa13e('0x5'));var db=require(_0xa13e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa13e('0x7'))(_0xa13e('0x8'));var config=require(_0xa13e('0x9'));var jayson=require(_0xa13e('0xa'));var client=jayson[_0xa13e('0xb')][_0xa13e('0xc')]({'port':0x232a});config[_0xa13e('0xd')]=_[_0xa13e('0xe')](config['redis'],{'host':_0xa13e('0xf'),'port':0x18eb});var socket=require(_0xa13e('0x10'))(new Redis(config['redis']));require('./cmList.socket')[_0xa13e('0x11')](socket);function respondWithRpcPromise(_0x492f18,_0x35df15,_0x5ca711){return new BPromise(function(_0x413f10,_0x2b2081){return client[_0xa13e('0x12')](_0x492f18,_0x5ca711)['then'](function(_0x2ce0db){logger[_0xa13e('0x13')](_0xa13e('0x14'),_0x35df15,_0xa13e('0x15'));logger[_0xa13e('0x16')](_0xa13e('0x17'),_0x35df15,_0xa13e('0x15'),JSON[_0xa13e('0x18')](_0x2ce0db));if(_0x2ce0db[_0xa13e('0x19')]){if(_0x2ce0db['error'][_0xa13e('0x1a')]===0x1f4){logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x2ce0db[_0xa13e('0x19')][_0xa13e('0x1b')]);return _0x2b2081(_0x2ce0db[_0xa13e('0x19')]['message']);}logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x2ce0db[_0xa13e('0x19')][_0xa13e('0x1b')]);return _0x413f10(_0x2ce0db['error'][_0xa13e('0x1b')]);}else{logger[_0xa13e('0x13')](_0xa13e('0x14'),_0x35df15,_0xa13e('0x15'));_0x413f10(_0x2ce0db[_0xa13e('0x1c')][_0xa13e('0x1b')]);}})[_0xa13e('0x1d')](function(_0x31daca){logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x31daca);_0x2b2081(_0x31daca);});});} \ No newline at end of file +var _0x304a=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x304a,0x168));var _0xa304=function(_0x572474,_0x54b9ae){_0x572474=_0x572474-0x0;var _0x252d0b=_0x304a[_0x572474];return _0x252d0b;};'use strict';var _=require(_0xa304('0x0'));var util=require(_0xa304('0x1'));var moment=require(_0xa304('0x2'));var BPromise=require('bluebird');var rs=require(_0xa304('0x3'));var fs=require('fs');var Redis=require(_0xa304('0x4'));var db=require(_0xa304('0x5'))['db'];var utils=require(_0xa304('0x6'));var logger=require(_0xa304('0x7'))('rpc');var config=require(_0xa304('0x8'));var jayson=require(_0xa304('0x9'));var client=jayson[_0xa304('0xa')][_0xa304('0xb')]({'port':0x232a});config[_0xa304('0xc')]=_[_0xa304('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa304('0xe'))(new Redis(config[_0xa304('0xc')]));require('./cmList.socket')[_0xa304('0xf')](socket);function respondWithRpcPromise(_0x3adc68,_0x530ee1,_0x5ec2c0){return new BPromise(function(_0x29e184,_0x28e465){return client[_0xa304('0x10')](_0x3adc68,_0x5ec2c0)[_0xa304('0x11')](function(_0x4fa458){logger[_0xa304('0x12')](_0xa304('0x13'),_0x530ee1,_0xa304('0x14'));logger[_0xa304('0x15')](_0xa304('0x16'),_0x530ee1,_0xa304('0x14'),JSON[_0xa304('0x17')](_0x4fa458));if(_0x4fa458['error']){if(_0x4fa458[_0xa304('0x18')][_0xa304('0x19')]===0x1f4){logger[_0xa304('0x18')](_0xa304('0x13'),_0x530ee1,_0x4fa458['error'][_0xa304('0x1a')]);return _0x28e465(_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);}logger[_0xa304('0x18')]('CmList,\x20%s,\x20%s',_0x530ee1,_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);return _0x29e184(_0x4fa458[_0xa304('0x18')][_0xa304('0x1a')]);}else{logger[_0xa304('0x12')](_0xa304('0x13'),_0x530ee1,_0xa304('0x14'));_0x29e184(_0x4fa458[_0xa304('0x1b')]['message']);}})[_0xa304('0x1c')](function(_0x2384ee){logger[_0xa304('0x18')](_0xa304('0x13'),_0x530ee1,_0x2384ee);_0x28e465(_0x2384ee);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7763af6..cad0225 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 _0x0a8c=['cmList:','./cmList.events','save','remove','update','removeListener','register','length'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0a8c,0xa1));var _0xc0a8=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x0a8c[_0xdaab62];return _0x13d767;};'use strict';var CmListEvents=require(_0xc0a8('0x0'));var events=[_0xc0a8('0x1'),_0xc0a8('0x2'),_0xc0a8('0x3')];function createListener(_0x38184d,_0x51df5f){return function(_0xa6375b){_0x51df5f['emit'](_0x38184d,_0xa6375b);};}function removeListener(_0x55f1c3,_0x436964){return function(){CmListEvents[_0xc0a8('0x4')](_0x55f1c3,_0x436964);};}exports[_0xc0a8('0x5')]=function(_0xa2acad){for(var _0x290a45=0x0,_0x18ec07=events[_0xc0a8('0x6')];_0x290a45<_0x18ec07;_0x290a45++){var _0x207a8b=events[_0x290a45];var _0x1c06e5=createListener(_0xc0a8('0x7')+_0x207a8b,_0xa2acad);CmListEvents['on'](_0x207a8b,_0x1c06e5);}}; \ No newline at end of file +var _0x936d=['cmList:','./cmList.events','remove','update','register','length'];(function(_0x5a4ac1,_0xb9eb0b){var _0x11dc18=function(_0x49d481){while(--_0x49d481){_0x5a4ac1['push'](_0x5a4ac1['shift']());}};_0x11dc18(++_0xb9eb0b);}(_0x936d,0x127));var _0xd936=function(_0x5d0279,_0xa9cd93){_0x5d0279=_0x5d0279-0x0;var _0x123e57=_0x936d[_0x5d0279];return _0x123e57;};'use strict';var CmListEvents=require(_0xd936('0x0'));var events=['save',_0xd936('0x1'),_0xd936('0x2')];function createListener(_0x5532fc,_0x465c1c){return function(_0x3a9cf6){_0x465c1c['emit'](_0x5532fc,_0x3a9cf6);};}function removeListener(_0x319f4c,_0x592aca){return function(){CmListEvents['removeListener'](_0x319f4c,_0x592aca);};}exports[_0xd936('0x3')]=function(_0x424ea7){for(var _0x1517b3=0x0,_0x52c701=events[_0xd936('0x4')];_0x1517b3<_0x52c701;_0x1517b3++){var _0x258699=events[_0x1517b3];var _0x167476=createListener(_0xd936('0x5')+_0x258699,_0x424ea7);CmListEvents['on'](_0x258699,_0x167476);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index d33f79b..4cd580c 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 _0xe766=['Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express'];(function(_0x47983c,_0x349fa3){var _0x1e6201=function(_0x36c5a3){while(--_0x36c5a3){_0x47983c['push'](_0x47983c['shift']());}};_0x1e6201(++_0x349fa3);}(_0xe766,0xe9));var _0x6e76=function(_0x18ee80,_0x2adf1c){_0x18ee80=_0x18ee80-0x0;var _0x2f60c2=_0xe766[_0x18ee80];return _0x2f60c2;};'use strict';var multer=require(_0x6e76('0x0'));var util=require(_0x6e76('0x1'));var path=require(_0x6e76('0x2'));var timeout=require(_0x6e76('0x3'));var express=require(_0x6e76('0x4'));var router=express[_0x6e76('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e76('0x6'));var config=require(_0x6e76('0x7'));var controller=require(_0x6e76('0x8'));router[_0x6e76('0x9')]('/',auth[_0x6e76('0xa')](),controller[_0x6e76('0xb')]);router['get'](_0x6e76('0xc'),auth[_0x6e76('0xa')](),controller[_0x6e76('0xd')]);router[_0x6e76('0x9')](_0x6e76('0xe'),auth[_0x6e76('0xa')](),controller[_0x6e76('0xf')]);router['get'](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x11')]);router['get'](_0x6e76('0x12'),auth['isAuthenticated'](),controller[_0x6e76('0x13')]);router[_0x6e76('0x9')](_0x6e76('0x14'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x15')]);router[_0x6e76('0x9')](_0x6e76('0x16'),auth[_0x6e76('0xa')](),controller['getCustomFields']);router[_0x6e76('0x9')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x18')]);router[_0x6e76('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e76('0x19')](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1a')]);router[_0x6e76('0x19')](_0x6e76('0x12'),auth['isAuthenticated'](),controller[_0x6e76('0x1b')]);router['post'](_0x6e76('0x16'),auth['isAuthenticated'](),controller['addCustomField']);router[_0x6e76('0x19')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1c')]);router[_0x6e76('0x1d')](_0x6e76('0xe'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1e')]);router[_0x6e76('0x1f')](_0x6e76('0xe'),auth['isAuthenticated'](),controller[_0x6e76('0x20')]);router[_0x6e76('0x1f')](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x21')]);router[_0x6e76('0x1f')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xdbc9=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/users','getAgents','post','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','delete','destroy','removeDispositions','removeAgents','exports','multer','path','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x7a491b,_0xb598f3){var _0x8a295e=function(_0x4637b7){while(--_0x4637b7){_0x7a491b['push'](_0x7a491b['shift']());}};_0x8a295e(++_0xb598f3);}(_0xdbc9,0x14a));var _0x9dbc=function(_0x5317d3,_0xc5d2b){_0x5317d3=_0x5317d3-0x0;var _0x437eda=_0xdbc9[_0x5317d3];return _0x437eda;};'use strict';var multer=require(_0x9dbc('0x0'));var util=require('util');var path=require(_0x9dbc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dbc('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x9dbc('0x3'));var config=require(_0x9dbc('0x4'));var controller=require('./cmList.controller');router[_0x9dbc('0x5')]('/',auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x7')]);router['get'](_0x9dbc('0x8'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x9')]);router[_0x9dbc('0x5')](_0x9dbc('0xa'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0xb')]);router[_0x9dbc('0x5')](_0x9dbc('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9dbc('0x5')](_0x9dbc('0xd'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0xe')]);router['get']('/:id/contacts/csv',auth[_0x9dbc('0x6')](),controller['getContactsCsv']);router['get']('/:id/fields',auth[_0x9dbc('0x6')](),controller['getCustomFields']);router['get'](_0x9dbc('0xf'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x10')]);router[_0x9dbc('0x11')]('/',auth[_0x9dbc('0x6')](),controller['create']);router[_0x9dbc('0x11')]('/:id/dispositions',auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x12')]);router[_0x9dbc('0x11')](_0x9dbc('0xd'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x13')]);router[_0x9dbc('0x11')](_0x9dbc('0x14'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x15')]);router[_0x9dbc('0x11')](_0x9dbc('0xf'),auth['isAuthenticated'](),controller[_0x9dbc('0x16')]);router['put'](_0x9dbc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9dbc('0x17')](_0x9dbc('0xa'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x18')]);router[_0x9dbc('0x17')](_0x9dbc('0xc'),auth[_0x9dbc('0x6')](),controller[_0x9dbc('0x19')]);router['delete'](_0x9dbc('0xf'),auth['isAuthenticated'](),controller[_0x9dbc('0x1a')]);module[_0x9dbc('0x1b')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4b78a9c..6243a22 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 _0x1848=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x402b7,_0x1bbb75){var _0x356bf6=function(_0x57845f){while(--_0x57845f){_0x402b7['push'](_0x402b7['shift']());}};_0x356bf6(++_0x1bbb75);}(_0x1848,0x166));var _0x8184=function(_0x43cded,_0x3e8fde){_0x43cded=_0x43cded-0x0;var _0xd6bb7c=_0x1848[_0x43cded];return _0xd6bb7c;};'use strict';var Sequelize=require(_0x8184('0x0'));module[_0x8184('0x1')]={'name':{'type':Sequelize[_0x8184('0x2')],'get':function(_0x1ee75a){return this[_0x8184('0x3')]('field');}},'field':{'type':Sequelize[_0x8184('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8184('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x955d=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x6ae0a2,_0x2a81f){var _0x1be156=function(_0x327ba6){while(--_0x327ba6){_0x6ae0a2['push'](_0x6ae0a2['shift']());}};_0x1be156(++_0x2a81f);}(_0x955d,0x1a9));var _0xd955=function(_0x5ff914,_0x3f6d9b){_0x5ff914=_0x5ff914-0x0;var _0x3f5e1d=_0x955d[_0x5ff914];return _0x3f5e1d;};'use strict';var Sequelize=require(_0xd955('0x0'));module[_0xd955('0x1')]={'name':{'type':Sequelize[_0xd955('0x2')],'get':function(_0x5879a9){return this[_0xd955('0x3')](_0xd955('0x4'));}},'field':{'type':Sequelize[_0xd955('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd955('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index e692bce..111b0c0 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 _0xbf95=['json','count','offset','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','body','Condition','find','params','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0xb1749e,_0x33f3af){var _0x1de3a5=function(_0x126b89){while(--_0x126b89){_0xb1749e['push'](_0xb1749e['shift']());}};_0x1de3a5(++_0x33f3af);}(_0xbf95,0xc8));var _0x5bf9=function(_0xf3e15c,_0xfb644e){_0xf3e15c=_0xf3e15c-0x0;var _0x21698f=_0xbf95[_0xf3e15c];return _0x21698f;};'use strict';var pdf=require(_0x5bf9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5bf9('0x1'));var zipdir=require(_0x5bf9('0x2'));var jsonpatch=require(_0x5bf9('0x3'));var rp=require(_0x5bf9('0x4'));var moment=require(_0x5bf9('0x5'));var BPromise=require(_0x5bf9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5bf9('0x7'));var sox=require(_0x5bf9('0x8'));var csv=require(_0x5bf9('0x9'));var ejs=require(_0x5bf9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5bf9('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bf9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5bf9('0xd'));var Papa=require('papaparse');var Redis=require(_0x5bf9('0xe'));var authService=require(_0x5bf9('0xf'));var qs=require(_0x5bf9('0x10'));var hardwareService=require(_0x5bf9('0x11'));var logger=require(_0x5bf9('0x12'))(_0x5bf9('0x13'));var utils=require(_0x5bf9('0x14'));var config=require(_0x5bf9('0x15'));var db=require(_0x5bf9('0x16'))['db'];function respondWithStatusCode(_0x165916,_0x2f7988){_0x2f7988=_0x2f7988||0xcc;return function(_0x520262){if(_0x520262){return _0x165916[_0x5bf9('0x17')](_0x2f7988);}return _0x165916['status'](_0x2f7988)[_0x5bf9('0x18')]();};}function respondWithResult(_0x4e6d45,_0x1922de){_0x1922de=_0x1922de||0xc8;return function(_0x53a99b){if(_0x53a99b){return _0x4e6d45['status'](_0x1922de)[_0x5bf9('0x19')](_0x53a99b);}};}function respondWithFilteredResult(_0x59fc03,_0x3d512e){return function(_0xccdf14){if(_0xccdf14){var _0x594308=_0xccdf14[_0x5bf9('0x1a')],_0x42f807=_0x3d512e[_0x5bf9('0x1b')],_0x5882a6=_0x3d512e[_0x5bf9('0x1b')]+_0x3d512e['limit'],_0x5cbeec;if(_0x5882a6>=_0x594308){_0x5882a6=_0x594308;_0x5cbeec=0xc8;}else{_0x5cbeec=0xce;}_0x59fc03['status'](_0x5cbeec);return _0x59fc03[_0x5bf9('0x1c')](_0x5bf9('0x1d'),_0x42f807+'-'+_0x5882a6+'/'+_0x594308)['json'](_0xccdf14);}return null;};}function patchUpdates(_0x1afe8d){return function(_0x3870c7){try{jsonpatch[_0x5bf9('0x1e')](_0x3870c7,_0x1afe8d,!![]);}catch(_0x1002c7){return BPromise[_0x5bf9('0x1f')](_0x1002c7);}return _0x3870c7['save']();};}function saveUpdates(_0x27530a,_0x28386f){return function(_0x107ec7){if(_0x107ec7){return _0x107ec7[_0x5bf9('0x20')](_0x27530a)[_0x5bf9('0x21')](function(_0x5cca40){return _0x5cca40;});}return null;};}function removeEntity(_0x574d0a,_0x38768e){return function(_0x2b849b){if(_0x2b849b){return _0x2b849b[_0x5bf9('0x22')]()[_0x5bf9('0x21')](function(){_0x574d0a[_0x5bf9('0x23')](0xcc)[_0x5bf9('0x18')]();});}};}function handleEntityNotFound(_0xf6d8df,_0x23a93f){return function(_0x3d6bb6){if(!_0x3d6bb6){_0xf6d8df[_0x5bf9('0x17')](0x194);}return _0x3d6bb6;};}function handleError(_0x541ef1,_0xbc0462){_0xbc0462=_0xbc0462||0x1f4;return function(_0xdbdd41){logger[_0x5bf9('0x24')](_0xdbdd41[_0x5bf9('0x25')]);if(_0xdbdd41[_0x5bf9('0x26')]){delete _0xdbdd41[_0x5bf9('0x26')];}_0x541ef1[_0x5bf9('0x23')](_0xbc0462)[_0x5bf9('0x27')](_0xdbdd41);};}exports['update']=function(_0x1f1f26,_0x5736c3){if(_0x1f1f26[_0x5bf9('0x28')]['id']){delete _0x1f1f26[_0x5bf9('0x28')]['id'];}return db[_0x5bf9('0x29')][_0x5bf9('0x2a')]({'where':{'id':_0x1f1f26[_0x5bf9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5736c3,null))[_0x5bf9('0x21')](saveUpdates(_0x1f1f26[_0x5bf9('0x28')],null))[_0x5bf9('0x21')](respondWithResult(_0x5736c3,null))[_0x5bf9('0x2c')](handleError(_0x5736c3,null));};exports[_0x5bf9('0x22')]=function(_0x276ac4,_0x4c304){return db[_0x5bf9('0x29')][_0x5bf9('0x2a')]({'where':{'id':_0x276ac4[_0x5bf9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4c304,null))[_0x5bf9('0x21')](removeEntity(_0x4c304,null))[_0x5bf9('0x2c')](handleError(_0x4c304,null));}; \ No newline at end of file +var _0xd88d=['destroy','stack','name','send','body','Condition','catch','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then'];(function(_0x99e09f,_0x24dbed){var _0x2ac8c1=function(_0x8f0dab){while(--_0x8f0dab){_0x99e09f['push'](_0x99e09f['shift']());}};_0x2ac8c1(++_0x24dbed);}(_0xd88d,0x81));var _0xdd88=function(_0x27a696,_0x1518fe){_0x27a696=_0x27a696-0x0;var _0x1faa3f=_0xd88d[_0x27a696];return _0x1faa3f;};'use strict';var pdf=require(_0xdd88('0x0'));var emlformat=require(_0xdd88('0x1'));var rimraf=require(_0xdd88('0x2'));var zipdir=require(_0xdd88('0x3'));var jsonpatch=require(_0xdd88('0x4'));var rp=require(_0xdd88('0x5'));var moment=require(_0xdd88('0x6'));var BPromise=require(_0xdd88('0x7'));var Mustache=require(_0xdd88('0x8'));var util=require(_0xdd88('0x9'));var path=require('path');var sox=require(_0xdd88('0xa'));var csv=require(_0xdd88('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd88('0xc'));var squel=require(_0xdd88('0xd'));var crypto=require(_0xdd88('0xe'));var jsforce=require(_0xdd88('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdd88('0xb'));var querystring=require('querystring');var Papa=require(_0xdd88('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdd88('0x11'));var config=require(_0xdd88('0x12'));var db=require(_0xdd88('0x13'))['db'];function respondWithStatusCode(_0x7482e7,_0x3d3d47){_0x3d3d47=_0x3d3d47||0xcc;return function(_0xa76d03){if(_0xa76d03){return _0x7482e7[_0xdd88('0x14')](_0x3d3d47);}return _0x7482e7[_0xdd88('0x15')](_0x3d3d47)['end']();};}function respondWithResult(_0x476a4d,_0x16a088){_0x16a088=_0x16a088||0xc8;return function(_0x172194){if(_0x172194){return _0x476a4d[_0xdd88('0x15')](_0x16a088)[_0xdd88('0x16')](_0x172194);}};}function respondWithFilteredResult(_0x2eacde,_0x313452){return function(_0x2a9a46){if(_0x2a9a46){var _0x43556e=_0x2a9a46[_0xdd88('0x17')],_0x481ecd=_0x313452['offset'],_0x1fbbb2=_0x313452[_0xdd88('0x18')]+_0x313452[_0xdd88('0x19')],_0x280afe;if(_0x1fbbb2>=_0x43556e){_0x1fbbb2=_0x43556e;_0x280afe=0xc8;}else{_0x280afe=0xce;}_0x2eacde[_0xdd88('0x15')](_0x280afe);return _0x2eacde[_0xdd88('0x1a')]('Content-Range',_0x481ecd+'-'+_0x1fbbb2+'/'+_0x43556e)['json'](_0x2a9a46);}return null;};}function patchUpdates(_0x4688cc){return function(_0xa8f7b3){try{jsonpatch[_0xdd88('0x1b')](_0xa8f7b3,_0x4688cc,!![]);}catch(_0x3af84d){return BPromise[_0xdd88('0x1c')](_0x3af84d);}return _0xa8f7b3['save']();};}function saveUpdates(_0x36a0f7,_0x4b17c5){return function(_0x5517f3){if(_0x5517f3){return _0x5517f3[_0xdd88('0x1d')](_0x36a0f7)[_0xdd88('0x1e')](function(_0x192b0a){return _0x192b0a;});}return null;};}function removeEntity(_0x33823f,_0x1acf1f){return function(_0x173742){if(_0x173742){return _0x173742[_0xdd88('0x1f')]()[_0xdd88('0x1e')](function(){_0x33823f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10238b,_0x6c44ab){return function(_0x3fb735){if(!_0x3fb735){_0x10238b[_0xdd88('0x14')](0x194);}return _0x3fb735;};}function handleError(_0xb3dda0,_0x497a49){_0x497a49=_0x497a49||0x1f4;return function(_0x43c86d){logger['error'](_0x43c86d[_0xdd88('0x20')]);if(_0x43c86d[_0xdd88('0x21')]){delete _0x43c86d['name'];}_0xb3dda0[_0xdd88('0x15')](_0x497a49)[_0xdd88('0x22')](_0x43c86d);};}exports['update']=function(_0x4c6f3,_0x54876c){if(_0x4c6f3[_0xdd88('0x23')]['id']){delete _0x4c6f3[_0xdd88('0x23')]['id'];}return db[_0xdd88('0x24')]['find']({'where':{'id':_0x4c6f3['params']['id']}})[_0xdd88('0x1e')](handleEntityNotFound(_0x54876c,null))[_0xdd88('0x1e')](saveUpdates(_0x4c6f3[_0xdd88('0x23')],null))[_0xdd88('0x1e')](respondWithResult(_0x54876c,null))[_0xdd88('0x25')](handleError(_0x54876c,null));};exports[_0xdd88('0x1f')]=function(_0xa42c54,_0x5e8601){return db[_0xdd88('0x24')][_0xdd88('0x26')]({'where':{'id':_0xa42c54[_0xdd88('0x27')]['id']}})[_0xdd88('0x1e')](handleEntityNotFound(_0x5e8601,null))[_0xdd88('0x1e')](removeEntity(_0x5e8601,null))[_0xdd88('0x25')](handleError(_0x5e8601,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index c8d08c4..4273253 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 _0x20de=['define','Condition','tools_conditions','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x33d77b,_0x3dc729){var _0x44d471=function(_0x3c4617){while(--_0x3c4617){_0x33d77b['push'](_0x33d77b['shift']());}};_0x44d471(++_0x3dc729);}(_0x20de,0x1ca));var _0xe20d=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x20de[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var logger=require('../../config/logger')(_0xe20d('0x2'));var moment=require('moment');var BPromise=require(_0xe20d('0x3'));var rp=require(_0xe20d('0x4'));var fs=require('fs');var path=require(_0xe20d('0x5'));var rimraf=require(_0xe20d('0x6'));var config=require(_0xe20d('0x7'));var attributes=require(_0xe20d('0x8'));module[_0xe20d('0x9')]=function(_0x280de1,_0x4ed186){return _0x280de1[_0xe20d('0xa')](_0xe20d('0xb'),attributes,{'tableName':_0xe20d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ffd=['../../config/environment','exports','define','util','api','bluebird','request-promise','path'];(function(_0x3f1eb8,_0x644a0c){var _0x10ad09=function(_0x2911c0){while(--_0x2911c0){_0x3f1eb8['push'](_0x3f1eb8['shift']());}};_0x10ad09(++_0x644a0c);}(_0x9ffd,0xfb));var _0xd9ff=function(_0x5a7579,_0x20a36d){_0x5a7579=_0x5a7579-0x0;var _0x3c527e=_0x9ffd[_0x5a7579];return _0x3c527e;};'use strict';var _=require('lodash');var util=require(_0xd9ff('0x0'));var logger=require('../../config/logger')(_0xd9ff('0x1'));var moment=require('moment');var BPromise=require(_0xd9ff('0x2'));var rp=require(_0xd9ff('0x3'));var fs=require('fs');var path=require(_0xd9ff('0x4'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x5'));var attributes=require('./condition.attributes');module[_0xd9ff('0x6')]=function(_0x20fb0a,_0x12f575){return _0x20fb0a[_0xd9ff('0x7')]('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 7a1bf71..83161a2 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 _0x93b8=['jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x51f764,_0x4c5c26){var _0x40eee9=function(_0x1c8827){while(--_0x1c8827){_0x51f764['push'](_0x51f764['shift']());}};_0x40eee9(++_0x4c5c26);}(_0x93b8,0xc1));var _0x893b=function(_0x41a095,_0x250e4a){_0x41a095=_0x41a095-0x0;var _0x337570=_0x93b8[_0x41a095];return _0x337570;};'use strict';var _=require(_0x893b('0x0'));var util=require(_0x893b('0x1'));var moment=require('moment');var BPromise=require(_0x893b('0x2'));var rs=require(_0x893b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x893b('0x4'));var logger=require(_0x893b('0x5'))(_0x893b('0x6'));var config=require('../../config/environment');var jayson=require(_0x893b('0x7'));var client=jayson[_0x893b('0x8')][_0x893b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf2c5,_0x5475f3,_0x4905a2){return new BPromise(function(_0x5abe2b,_0x28e322){return client[_0x893b('0xa')](_0x2bf2c5,_0x4905a2)[_0x893b('0xb')](function(_0x446f6f){logger['info'](_0x893b('0xc'),_0x5475f3,_0x893b('0xd'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x5475f3,'request\x20sent',JSON[_0x893b('0xe')](_0x446f6f));if(_0x446f6f[_0x893b('0xf')]){if(_0x446f6f[_0x893b('0xf')]['code']===0x1f4){logger[_0x893b('0xf')](_0x893b('0xc'),_0x5475f3,_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);return _0x28e322(_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);}logger[_0x893b('0xf')](_0x893b('0xc'),_0x5475f3,_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);return _0x5abe2b(_0x446f6f['error'][_0x893b('0x10')]);}else{logger[_0x893b('0x11')](_0x893b('0xc'),_0x5475f3,_0x893b('0xd'));_0x5abe2b(_0x446f6f[_0x893b('0x12')][_0x893b('0x10')]);}})[_0x893b('0x13')](function(_0x3c7a85){logger[_0x893b('0xf')]('Condition,\x20%s,\x20%s',_0x5475f3,_0x3c7a85);_0x28e322(_0x3c7a85);});});} \ No newline at end of file +var _0xa5c4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa5c4,0x89));var _0x4a5c=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xa5c4[_0x54b062];return _0x255e41;};'use strict';var _=require(_0x4a5c('0x0'));var util=require('util');var moment=require(_0x4a5c('0x1'));var BPromise=require(_0x4a5c('0x2'));var rs=require(_0x4a5c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a5c('0x4'))['db'];var utils=require(_0x4a5c('0x5'));var logger=require(_0x4a5c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4a5c('0x7'));var client=jayson[_0x4a5c('0x8')][_0x4a5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5be796,_0x57186b,_0x12b1f5){return new BPromise(function(_0xcd4690,_0x5c6f59){return client[_0x4a5c('0xa')](_0x5be796,_0x12b1f5)[_0x4a5c('0xb')](function(_0x5aca47){logger['info'](_0x4a5c('0xc'),_0x57186b,'request\x20sent');logger[_0x4a5c('0xd')](_0x4a5c('0xe'),_0x57186b,_0x4a5c('0xf'),JSON[_0x4a5c('0x10')](_0x5aca47));if(_0x5aca47[_0x4a5c('0x11')]){if(_0x5aca47[_0x4a5c('0x11')]['code']===0x1f4){logger['error'](_0x4a5c('0xc'),_0x57186b,_0x5aca47[_0x4a5c('0x11')][_0x4a5c('0x12')]);return _0x5c6f59(_0x5aca47[_0x4a5c('0x11')][_0x4a5c('0x12')]);}logger[_0x4a5c('0x11')](_0x4a5c('0xc'),_0x57186b,_0x5aca47[_0x4a5c('0x11')]['message']);return _0xcd4690(_0x5aca47['error'][_0x4a5c('0x12')]);}else{logger['info'](_0x4a5c('0xc'),_0x57186b,'request\x20sent');_0xcd4690(_0x5aca47[_0x4a5c('0x13')][_0x4a5c('0x12')]);}})['catch'](function(_0x10be92){logger['error'](_0x4a5c('0xc'),_0x57186b,_0x10be92);_0x5c6f59(_0x10be92);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d4b422a..7020429 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 _0x4c13=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','destroy','multer','util'];(function(_0x22d705,_0x27dd8e){var _0x8686fc=function(_0x29a9f1){while(--_0x29a9f1){_0x22d705['push'](_0x22d705['shift']());}};_0x8686fc(++_0x27dd8e);}(_0x4c13,0x66));var _0x34c1=function(_0x72ad5a,_0x3ad145){_0x72ad5a=_0x72ad5a-0x0;var _0x54b6bd=_0x4c13[_0x72ad5a];return _0x54b6bd;};'use strict';var multer=require(_0x34c1('0x0'));var util=require(_0x34c1('0x1'));var path=require(_0x34c1('0x2'));var timeout=require(_0x34c1('0x3'));var express=require(_0x34c1('0x4'));var router=express['Router']();var auth=require(_0x34c1('0x5'));var interaction=require(_0x34c1('0x6'));var config=require(_0x34c1('0x7'));var controller=require('./condition.controller');router[_0x34c1('0x8')](_0x34c1('0x9'),auth[_0x34c1('0xa')](),controller['update']);router[_0x34c1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x34c1('0xc')]);module['exports']=router; \ No newline at end of file +var _0x6c7f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','/:id','update','delete','destroy','exports','util'];(function(_0x190681,_0x590f58){var _0x4f2ada=function(_0x4556db){while(--_0x4556db){_0x190681['push'](_0x190681['shift']());}};_0x4f2ada(++_0x590f58);}(_0x6c7f,0x154));var _0xf6c7=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x6c7f[_0x42c6f1];return _0x3c7398;};'use strict';var multer=require('multer');var util=require(_0xf6c7('0x0'));var path=require(_0xf6c7('0x1'));var timeout=require(_0xf6c7('0x2'));var express=require('express');var router=express[_0xf6c7('0x3')]();var auth=require(_0xf6c7('0x4'));var interaction=require(_0xf6c7('0x5'));var config=require('../../config/environment');var controller=require('./condition.controller');router['put'](_0xf6c7('0x6'),auth['isAuthenticated'](),controller[_0xf6c7('0x7')]);router[_0xf6c7('0x8')](_0xf6c7('0x6'),auth['isAuthenticated'](),controller[_0xf6c7('0x9')]);module[_0xf6c7('0xa')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 76bc39e..9118fa0 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 _0xafd4=['STRING','exports'];(function(_0x6098b9,_0x3dc78c){var _0x116ed7=function(_0x4c4afe){while(--_0x4c4afe){_0x6098b9['push'](_0x6098b9['shift']());}};_0x116ed7(++_0x3dc78c);}(_0xafd4,0x16b));var _0x4afd=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xafd4[_0x5774be];return _0x4914b4;};'use strict';var Sequelize=require('sequelize');module[_0x4afd('0x0')]={'name':{'type':Sequelize[_0x4afd('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x4afd('0x1')]}}; \ No newline at end of file +var _0x0d14=['STRING','sequelize','exports'];(function(_0x244753,_0x45d986){var _0x1124fc=function(_0x156aff){while(--_0x156aff){_0x244753['push'](_0x244753['shift']());}};_0x1124fc(++_0x45d986);}(_0x0d14,0x187));var _0x40d1=function(_0xf3b53f,_0x55b917){_0xf3b53f=_0xf3b53f-0x0;var _0x8b238=_0x0d14[_0xf3b53f];return _0x8b238;};'use strict';var Sequelize=require(_0x40d1('0x0'));module[_0x40d1('0x1')]={'name':{'type':Sequelize[_0x40d1('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x40d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 0dbe6cd..93b7663 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 _0xdeb7=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','sort','map','html-pdf'];(function(_0x37c2b7,_0x29c081){var _0x1e5e30=function(_0x686709){while(--_0x686709){_0x37c2b7['push'](_0x37c2b7['shift']());}};_0x1e5e30(++_0x29c081);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x7deb('0x0'));var emlformat=require(_0x7deb('0x1'));var rimraf=require(_0x7deb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7deb('0x3'));var rp=require(_0x7deb('0x4'));var moment=require(_0x7deb('0x5'));var BPromise=require(_0x7deb('0x6'));var Mustache=require(_0x7deb('0x7'));var util=require('util');var path=require(_0x7deb('0x8'));var sox=require(_0x7deb('0x9'));var csv=require(_0x7deb('0xa'));var ejs=require(_0x7deb('0xb'));var fs=require('fs');var _=require(_0x7deb('0xc'));var squel=require(_0x7deb('0xd'));var crypto=require('crypto');var jsforce=require(_0x7deb('0xe'));var deskjs=require(_0x7deb('0xf'));var toCsv=require(_0x7deb('0xa'));var querystring=require(_0x7deb('0x10'));var Papa=require('papaparse');var Redis=require(_0x7deb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7deb('0x12'));var logger=require('../../config/logger')(_0x7deb('0x13'));var utils=require(_0x7deb('0x14'));var config=require(_0x7deb('0x15'));var db=require('../../mysqldb')['db'];config[_0x7deb('0x16')]=_[_0x7deb('0x17')](config[_0x7deb('0x16')],{'host':_0x7deb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7deb('0x16')]));require(_0x7deb('0x19'))[_0x7deb('0x1a')](socket);function respondWithStatusCode(_0x290f7a,_0xdf8efb){_0xdf8efb=_0xdf8efb||0xcc;return function(_0x2b784f){if(_0x2b784f){return _0x290f7a[_0x7deb('0x1b')](_0xdf8efb);}return _0x290f7a[_0x7deb('0x1c')](_0xdf8efb)[_0x7deb('0x1d')]();};}function respondWithResult(_0x405ae6,_0x470e07){_0x470e07=_0x470e07||0xc8;return function(_0x4764e3){if(_0x4764e3){return _0x405ae6[_0x7deb('0x1c')](_0x470e07)[_0x7deb('0x1e')](_0x4764e3);}};}function respondWithFilteredResult(_0xbe8e2a,_0x5b7f1e){return function(_0x13831c){if(_0x13831c){var _0x50e4ec=_0x13831c[_0x7deb('0x1f')],_0x2241a3=_0x5b7f1e[_0x7deb('0x20')],_0xbd6ea8=_0x5b7f1e[_0x7deb('0x20')]+_0x5b7f1e[_0x7deb('0x21')],_0x5439ac;if(_0xbd6ea8>=_0x50e4ec){_0xbd6ea8=_0x50e4ec;_0x5439ac=0xc8;}else{_0x5439ac=0xce;}_0xbe8e2a[_0x7deb('0x1c')](_0x5439ac);return _0xbe8e2a[_0x7deb('0x22')](_0x7deb('0x23'),_0x2241a3+'-'+_0xbd6ea8+'/'+_0x50e4ec)[_0x7deb('0x1e')](_0x13831c);}return null;};}function patchUpdates(_0x27a448){return function(_0x4e4f8f){try{jsonpatch[_0x7deb('0x24')](_0x4e4f8f,_0x27a448,!![]);}catch(_0x262a0d){return BPromise[_0x7deb('0x25')](_0x262a0d);}return _0x4e4f8f[_0x7deb('0x26')]();};}function saveUpdates(_0x21e061,_0x2f88ca){return function(_0x31dd30){if(_0x31dd30){return _0x31dd30[_0x7deb('0x27')](_0x21e061)['then'](function(_0x3151d6){return _0x3151d6;});}return null;};}function removeEntity(_0x2f1e42,_0x2cb976){return function(_0x529e23){if(_0x529e23){return _0x529e23[_0x7deb('0x28')]()[_0x7deb('0x29')](function(){var _0xde3478=_0x529e23[_0x7deb('0x2a')]({'plain':!![]});var _0x5e2258=_0x7deb('0x2b');return db[_0x7deb('0x2c')][_0x7deb('0x28')]({'where':{'type':_0x5e2258,'resourceId':_0xde3478['id']}})[_0x7deb('0x29')](function(){return _0x529e23;});})[_0x7deb('0x29')](function(){_0x2f1e42[_0x7deb('0x1c')](0xcc)[_0x7deb('0x1d')]();});}};}function handleEntityNotFound(_0x659b9,_0x3b2fe6){return function(_0x28f884){if(!_0x28f884){_0x659b9[_0x7deb('0x1b')](0x194);}return _0x28f884;};}function handleError(_0x2f9d98,_0x45d711){_0x45d711=_0x45d711||0x1f4;return function(_0x14ec6f){logger['error'](_0x14ec6f[_0x7deb('0x2d')]);if(_0x14ec6f['name']){delete _0x14ec6f[_0x7deb('0x2e')];}_0x2f9d98['status'](_0x45d711)[_0x7deb('0x2f')](_0x14ec6f);};}exports[_0x7deb('0x30')]=function(_0x57a062,_0x513bae){var _0x23d74a={},_0x298831={},_0x565349={'count':0x0,'rows':[]};var _0x504899=db[_0x7deb('0x31')][_0x7deb('0x32')];_0x298831[_0x7deb('0x33')]=_[_0x7deb('0x34')](_0x504899);_0x298831[_0x7deb('0x35')]=_[_0x7deb('0x34')](_0x57a062[_0x7deb('0x35')]);_0x298831[_0x7deb('0x36')]=_[_0x7deb('0x37')](_0x298831['model'],_0x298831[_0x7deb('0x35')]);_0x23d74a['attributes']=_[_0x7deb('0x37')](_0x298831[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x57a062[_0x7deb('0x35')][_0x7deb('0x38')]));_0x23d74a[_0x7deb('0x39')]=_0x23d74a[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x23d74a[_0x7deb('0x39')]:_0x298831[_0x7deb('0x33')];if(!_0x57a062['query'][_0x7deb('0x3b')](_0x7deb('0x3c'))){_0x23d74a['limit']=qs['limit'](_0x57a062['query'][_0x7deb('0x21')]);_0x23d74a['offset']=qs[_0x7deb('0x20')](_0x57a062[_0x7deb('0x35')][_0x7deb('0x20')]);}_0x23d74a[_0x7deb('0x3d')]=qs['sort'](_0x57a062['query']['sort']);_0x23d74a[_0x7deb('0x3e')]=qs[_0x7deb('0x36')](_[_0x7deb('0x3f')](_0x57a062[_0x7deb('0x35')],_0x298831[_0x7deb('0x36')]));if(_0x57a062[_0x7deb('0x35')]['filter']){_0x23d74a['where']=_[_0x7deb('0x40')](_0x23d74a[_0x7deb('0x3e')],{'$or':_['map'](_0x504899,function(_0x35d033){if(_0x35d033['type'][_0x7deb('0x41')]!==_0x7deb('0x42')){var _0x293066={};_0x293066[_0x35d033[_0x7deb('0x43')]]={'$like':'%'+_0x57a062[_0x7deb('0x35')][_0x7deb('0x44')]+'%'};return _0x293066;}})});}_0x23d74a=_['merge']({},_0x23d74a,_0x57a062[_0x7deb('0x45')]);var _0xccae33={'where':_0x23d74a[_0x7deb('0x3e')]};return db[_0x7deb('0x31')]['count'](_0xccae33)[_0x7deb('0x29')](function(_0x50b7d2){_0x565349['count']=_0x50b7d2;if(_0x57a062['query'][_0x7deb('0x46')]){_0x23d74a[_0x7deb('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x7deb('0x48')](_0x23d74a);})[_0x7deb('0x29')](function(_0x5c9e57){_0x565349[_0x7deb('0x49')]=_0x5c9e57;return _0x565349;})['then'](respondWithFilteredResult(_0x513bae,_0x23d74a))['catch'](handleError(_0x513bae,null));};exports[_0x7deb('0x4a')]=function(_0x2dbd49,_0x3ffa6a){var _0x350f6d={'raw':![],'where':{'id':_0x2dbd49[_0x7deb('0x4b')]['id']}},_0x27f82b={};_0x27f82b['model']=_[_0x7deb('0x34')](db[_0x7deb('0x31')][_0x7deb('0x32')]);_0x27f82b[_0x7deb('0x35')]=_[_0x7deb('0x34')](_0x2dbd49[_0x7deb('0x35')]);_0x27f82b[_0x7deb('0x36')]=_['intersection'](_0x27f82b[_0x7deb('0x33')],_0x27f82b[_0x7deb('0x35')]);_0x350f6d[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0x27f82b[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x2dbd49['query']['fields']));_0x350f6d[_0x7deb('0x39')]=_0x350f6d[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x350f6d[_0x7deb('0x39')]:_0x27f82b[_0x7deb('0x33')];if(_0x2dbd49[_0x7deb('0x35')][_0x7deb('0x46')]){_0x350f6d['include']=[{'all':!![]}];}_0x350f6d=_[_0x7deb('0x40')]({},_0x350f6d,_0x2dbd49[_0x7deb('0x45')]);return db[_0x7deb('0x31')][_0x7deb('0x4c')](_0x350f6d)[_0x7deb('0x29')](handleEntityNotFound(_0x3ffa6a,null))[_0x7deb('0x29')](respondWithResult(_0x3ffa6a,null))[_0x7deb('0x4d')](handleError(_0x3ffa6a,null));};exports[_0x7deb('0x4e')]=function(_0x54adc1,_0x3f4abc){return db['Dashboard'][_0x7deb('0x4e')](_0x54adc1['body'],{})['then'](function(_0x5c9790){var _0x2df040=_0x54adc1['user'][_0x7deb('0x2a')]({'plain':!![]});if(!_0x2df040)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2df040[_0x7deb('0x4f')]===_0x7deb('0x50')){var _0xd47ac=_0x5c9790[_0x7deb('0x2a')]({'plain':!![]});var _0x93f3a2=_0x7deb('0x2b');return db[_0x7deb('0x51')]['find']({'where':{'name':_0x93f3a2,'userProfileId':_0x2df040[_0x7deb('0x52')]},'raw':!![]})[_0x7deb('0x29')](function(_0x5f185c){if(_0x5f185c&&_0x5f185c['autoAssociation']===0x0){return db['UserProfileResource'][_0x7deb('0x4e')]({'name':_0xd47ac[_0x7deb('0x2e')],'resourceId':_0xd47ac['id'],'type':_0x5f185c['name'],'sectionId':_0x5f185c['id']},{})[_0x7deb('0x29')](function(){return _0x5c9790;});}else{return _0x5c9790;}})[_0x7deb('0x4d')](function(_0x1221c3){logger[_0x7deb('0x53')](_0x7deb('0x54'),_0x1221c3);throw _0x1221c3;});}return _0x5c9790;})[_0x7deb('0x29')](respondWithResult(_0x3f4abc,0xc9))['catch'](handleError(_0x3f4abc,null));};exports[_0x7deb('0x55')]=function(_0x4b75b7,_0x320fa4){var _0xbbbe04={'raw':![],'where':{'id':_0x4b75b7[_0x7deb('0x4b')]['id']}},_0xf6ee8a={};_0xf6ee8a[_0x7deb('0x33')]=_[_0x7deb('0x34')](db[_0x7deb('0x31')][_0x7deb('0x32')]);_0xbbbe04[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0xf6ee8a[_0x7deb('0x33')],qs['fields'](_0x4b75b7['query'][_0x7deb('0x38')]));_0xbbbe04[_0x7deb('0x39')]=_0xbbbe04[_0x7deb('0x39')][_0x7deb('0x3a')]?_0xbbbe04[_0x7deb('0x39')]:_0xf6ee8a['model'];if(_0x4b75b7[_0x7deb('0x35')][_0x7deb('0x46')]){_0xbbbe04[_0x7deb('0x47')]=[{'all':!![]}];}_0xbbbe04=_[_0x7deb('0x40')]({},_0xbbbe04,_0x4b75b7['options']);return db[_0x7deb('0x31')][_0x7deb('0x4c')](_0xbbbe04)[_0x7deb('0x29')](handleEntityNotFound(_0x320fa4,null))[_0x7deb('0x29')](function(_0x470bef){if(_0x470bef){var _0x19825a=_0x470bef[_0x7deb('0x2a')]({'plain':!![]});_0x19825a=qs['omit'](_0x19825a,['id',_0x7deb('0x56'),_0x7deb('0x57')]);_0x4b75b7[_0x7deb('0x58')]=_['omit'](_0x4b75b7[_0x7deb('0x58')],['id',_0x7deb('0x56'),'updatedAt']);return db[_0x7deb('0x31')]['create'](_[_0x7deb('0x40')](_0x19825a,_0x4b75b7['body']),{'include':_0x4b75b7['query'][_0x7deb('0x46')]?[{'all':!![]}]:undefined})[_0x7deb('0x29')](function(_0x335567){var _0x2ced48=_0x4b75b7[_0x7deb('0x50')]['get']({'plain':!![]});if(!_0x2ced48)throw new Error(_0x7deb('0x59'));if(_0x2ced48[_0x7deb('0x4f')]===_0x7deb('0x50')){var _0x14794f=_0x335567[_0x7deb('0x2a')]({'plain':!![]});var _0x2e4b62=_0x7deb('0x2b');return db[_0x7deb('0x51')][_0x7deb('0x4c')]({'where':{'name':_0x2e4b62,'userProfileId':_0x2ced48[_0x7deb('0x52')]},'raw':!![]})['then'](function(_0x2d593e){if(_0x2d593e&&_0x2d593e[_0x7deb('0x5a')]===0x0){return db[_0x7deb('0x2c')][_0x7deb('0x4e')]({'name':_0x14794f['name'],'resourceId':_0x14794f['id'],'type':_0x2d593e[_0x7deb('0x2e')],'sectionId':_0x2d593e['id']},{})[_0x7deb('0x29')](function(){return _0x335567;});}else{return _0x335567;}})[_0x7deb('0x4d')](function(_0x3aed0f){logger['error'](_0x7deb('0x54'),_0x3aed0f);throw _0x3aed0f;});}return _0x335567;});}})[_0x7deb('0x29')](respondWithResult(_0x320fa4,0xc9))[_0x7deb('0x4d')](handleError(_0x320fa4,null));};exports[_0x7deb('0x27')]=function(_0x71acf4,_0xc18a71){if(_0x71acf4['body']['id']){delete _0x71acf4['body']['id'];}return db[_0x7deb('0x31')]['find']({'where':{'id':_0x71acf4[_0x7deb('0x4b')]['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0xc18a71,null))[_0x7deb('0x29')](saveUpdates(_0x71acf4[_0x7deb('0x58')],null))[_0x7deb('0x29')](respondWithResult(_0xc18a71,null))['catch'](handleError(_0xc18a71,null));};exports[_0x7deb('0x28')]=function(_0x36cdee,_0x22b89a){return db['Dashboard'][_0x7deb('0x4c')]({'where':{'id':_0x36cdee[_0x7deb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22b89a,null))[_0x7deb('0x29')](removeEntity(_0x22b89a,null))[_0x7deb('0x4d')](handleError(_0x22b89a,null));};function widgetAttributes(_0x190d86){try{switch(_0x190d86[_0x7deb('0x5b')]){case'iframe':return[{'name':_0x7deb('0x5c'),'value':_0x190d86[_0x7deb('0x5c')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86[_0x7deb('0x5d')][0x0][_0x7deb('0x5e')]:undefined)||'https://'}];case _0x7deb('0x5f'):return[{'name':_0x7deb('0x60'),'value':_0x190d86['attrPath']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86['attrs'][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||''}];case _0x7deb('0x61'):return[{'name':'attrHourFormat','value':_0x190d86[_0x7deb('0x62')]||(_0x190d86['attrs']&&_0x190d86['attrs'][0x0]?_0x190d86[_0x7deb('0x5d')][0x0][_0x7deb('0x5e')]:undefined)||_0x7deb('0x63')},{'name':_0x7deb('0x64'),'value':_0x190d86[_0x7deb('0x64')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86['attrs'][0x1][_0x7deb('0x5e')]:undefined)||'0.00'},{'name':_0x7deb('0x65'),'value':_0x190d86[_0x7deb('0x65')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x2]?_0x190d86[_0x7deb('0x5d')][0x2]['value']:undefined)||0xc}];case _0x7deb('0x66'):return[{'name':_0x7deb('0x67'),'value':_0x190d86[_0x7deb('0x67')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||'total'},{'name':_0x7deb('0x68'),'value':_0x190d86['attrVoiceQueues']||(_0x190d86['attrs']&&_0x190d86['attrs'][0x1]?_0x190d86['attrs'][0x1][_0x7deb('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x190d86[_0x7deb('0x65')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x2]?_0x190d86[_0x7deb('0x5d')][0x2]['value']:undefined)||0x14}];case _0x7deb('0x69'):case _0x7deb('0x6a'):return[{'name':_0x7deb('0x6b'),'value':_0x190d86['attrSerie1']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86[_0x7deb('0x5d')][0x0]['value']:undefined)||_0x7deb('0x6c')},{'name':_0x7deb('0x6d'),'value':_0x190d86[_0x7deb('0x6d')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86['attrs'][0x1]['value']:undefined)||null},{'name':_0x7deb('0x6e'),'value':_0x190d86[_0x7deb('0x6e')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86['attrs'][0x2]?_0x190d86['attrs'][0x2][_0x7deb('0x5e')]:undefined)||null},{'name':_0x7deb('0x68'),'value':_0x190d86[_0x7deb('0x68')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x3]?_0x190d86[_0x7deb('0x5d')][0x3][_0x7deb('0x5e')]:undefined)||[]}];case'web-report':return[{'name':_0x7deb('0x6f'),'type':_0x190d86['reportType']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5b')]:undefined)||null,'value':_0x190d86['attrReport']||(_0x190d86['attrs']&&_0x190d86['attrs'][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||null},{'name':_0x7deb('0x70'),'value':_0x190d86[_0x7deb('0x70')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86[_0x7deb('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3eb200){logger[_0x7deb('0x53')]('widgetAttributes:\x20%s',JSON[_0x7deb('0x71')](_0x3eb200));return[];}}exports['addItem']=function(_0x45e327,_0x2ed32e,_0xa2c8d7){if(_0x45e327[_0x7deb('0x58')]['id']){delete _0x45e327[_0x7deb('0x58')]['id'];}return db[_0x7deb('0x31')][_0x7deb('0x4c')]({'where':{'id':_0x45e327[_0x7deb('0x4b')]['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0x2ed32e,null))['then'](function(_0x5e306d){if(_0x5e306d){_0x45e327[_0x7deb('0x58')][_0x7deb('0x72')]=_0x5e306d['id'];_0x45e327[_0x7deb('0x58')]['attrs']=widgetAttributes(_0x45e327[_0x7deb('0x58')]);return db[_0x7deb('0x73')][_0x7deb('0x4e')](_0x45e327[_0x7deb('0x58')]);}})[_0x7deb('0x29')](respondWithResult(_0x2ed32e,null))[_0x7deb('0x4d')](handleError(_0x2ed32e,null));};exports[_0x7deb('0x74')]=function(_0x1c6908,_0x183769,_0x16b87d){var _0x24b766={};var _0x5ec50e={};var _0x275dc2;var _0x110f5e;return db[_0x7deb('0x31')][_0x7deb('0x75')]({'where':{'id':_0x1c6908['params']['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0x183769,null))[_0x7deb('0x29')](function(_0x479228){if(_0x479228){_0x275dc2=_0x479228;_0x5ec50e[_0x7deb('0x33')]=_['keys'](db[_0x7deb('0x73')][_0x7deb('0x32')]);_0x5ec50e[_0x7deb('0x35')]=_['keys'](_0x1c6908[_0x7deb('0x35')]);_0x5ec50e[_0x7deb('0x36')]=_[_0x7deb('0x37')](_0x5ec50e[_0x7deb('0x33')],_0x5ec50e['query']);_0x24b766[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0x5ec50e[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x1c6908['query'][_0x7deb('0x38')]));_0x24b766[_0x7deb('0x39')]=_0x24b766[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x24b766['attributes']:_0x5ec50e[_0x7deb('0x33')];_0x24b766['order']=qs[_0x7deb('0x76')](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x76')]);_0x24b766['where']=qs['filters'](_[_0x7deb('0x3f')](_0x1c6908[_0x7deb('0x35')],_0x5ec50e[_0x7deb('0x36')]));if(_0x1c6908[_0x7deb('0x35')][_0x7deb('0x44')]){_0x24b766[_0x7deb('0x3e')]=_['merge'](_0x24b766['where'],{'$or':_[_0x7deb('0x77')](_0x24b766[_0x7deb('0x39')],function(_0x1d0b6e){var _0x5a84dc={};_0x5a84dc[_0x1d0b6e]={'$like':'%'+_0x1c6908[_0x7deb('0x35')][_0x7deb('0x44')]+'%'};return _0x5a84dc;})});}_0x24b766=_[_0x7deb('0x40')]({},_0x24b766,_0x1c6908[_0x7deb('0x45')]);return _0x275dc2[_0x7deb('0x74')](_0x24b766);}})[_0x7deb('0x29')](function(_0x23bd52){if(_0x23bd52){_0x110f5e=_0x23bd52[_0x7deb('0x3a')];if(!_0x1c6908[_0x7deb('0x35')][_0x7deb('0x3b')](_0x7deb('0x3c'))){_0x24b766[_0x7deb('0x21')]=qs['limit'](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x21')]);_0x24b766[_0x7deb('0x20')]=qs[_0x7deb('0x20')](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x20')]);}return _0x275dc2[_0x7deb('0x74')](_0x24b766);}})[_0x7deb('0x29')](function(_0x3efbf6){if(_0x3efbf6){return _0x3efbf6?{'count':_0x110f5e,'rows':_0x3efbf6}:null;}})['then'](respondWithResult(_0x183769,null))[_0x7deb('0x4d')](handleError(_0x183769,null));}; \ No newline at end of file +var _0x10ca=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','pick','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','save','then','get','destroy','error','stack','name','send','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','findAll','rows','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation'];(function(_0x1e89ed,_0x1cf7de){var _0x3e3e2c=function(_0x27e6b2){while(--_0x27e6b2){_0x1e89ed['push'](_0x1e89ed['shift']());}};_0x3e3e2c(++_0x1cf7de);}(_0x10ca,0x1a7));var _0xa10c=function(_0x68f9f,_0x4f8e85){_0x68f9f=_0x68f9f-0x0;var _0x10f944=_0x10ca[_0x68f9f];return _0x10f944;};'use strict';var pdf=require(_0xa10c('0x0'));var emlformat=require(_0xa10c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa10c('0x2'));var jsonpatch=require(_0xa10c('0x3'));var rp=require('request-promise');var moment=require(_0xa10c('0x4'));var BPromise=require(_0xa10c('0x5'));var Mustache=require(_0xa10c('0x6'));var util=require(_0xa10c('0x7'));var path=require(_0xa10c('0x8'));var sox=require(_0xa10c('0x9'));var csv=require('to-csv');var ejs=require(_0xa10c('0xa'));var fs=require('fs');var _=require(_0xa10c('0xb'));var squel=require(_0xa10c('0xc'));var crypto=require(_0xa10c('0xd'));var jsforce=require(_0xa10c('0xe'));var deskjs=require(_0xa10c('0xf'));var toCsv=require(_0xa10c('0x10'));var querystring=require(_0xa10c('0x11'));var Papa=require(_0xa10c('0x12'));var Redis=require(_0xa10c('0x13'));var authService=require(_0xa10c('0x14'));var qs=require(_0xa10c('0x15'));var hardwareService=require(_0xa10c('0x16'));var logger=require('../../config/logger')(_0xa10c('0x17'));var utils=require('../../config/utils');var config=require(_0xa10c('0x18'));var db=require(_0xa10c('0x19'))['db'];config[_0xa10c('0x1a')]=_[_0xa10c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa10c('0x1c'))(new Redis(config[_0xa10c('0x1a')]));require(_0xa10c('0x1d'))[_0xa10c('0x1e')](socket);function respondWithStatusCode(_0x5a06e2,_0x741664){_0x741664=_0x741664||0xcc;return function(_0x50fba5){if(_0x50fba5){return _0x5a06e2[_0xa10c('0x1f')](_0x741664);}return _0x5a06e2['status'](_0x741664)[_0xa10c('0x20')]();};}function respondWithResult(_0xf3ac9e,_0xa07a08){_0xa07a08=_0xa07a08||0xc8;return function(_0x969bd9){if(_0x969bd9){return _0xf3ac9e['status'](_0xa07a08)[_0xa10c('0x21')](_0x969bd9);}};}function respondWithFilteredResult(_0x31f8a2,_0x5a39bf){return function(_0x1814c2){if(_0x1814c2){var _0x23f2de=_0x1814c2[_0xa10c('0x22')],_0x1b552b=_0x5a39bf[_0xa10c('0x23')],_0x4c2269=_0x5a39bf[_0xa10c('0x23')]+_0x5a39bf[_0xa10c('0x24')],_0x2af1fa;if(_0x4c2269>=_0x23f2de){_0x4c2269=_0x23f2de;_0x2af1fa=0xc8;}else{_0x2af1fa=0xce;}_0x31f8a2[_0xa10c('0x25')](_0x2af1fa);return _0x31f8a2[_0xa10c('0x26')](_0xa10c('0x27'),_0x1b552b+'-'+_0x4c2269+'/'+_0x23f2de)[_0xa10c('0x21')](_0x1814c2);}return null;};}function patchUpdates(_0x48b5eb){return function(_0x3cedf7){try{jsonpatch['apply'](_0x3cedf7,_0x48b5eb,!![]);}catch(_0x37497f){return BPromise['reject'](_0x37497f);}return _0x3cedf7[_0xa10c('0x28')]();};}function saveUpdates(_0x34b439,_0x1dbe3d){return function(_0x57d39a){if(_0x57d39a){return _0x57d39a['update'](_0x34b439)[_0xa10c('0x29')](function(_0x24117c){return _0x24117c;});}return null;};}function removeEntity(_0x56ea7c,_0x3cb9fb){return function(_0x43b1c0){if(_0x43b1c0){return _0x43b1c0['destroy']()[_0xa10c('0x29')](function(){var _0x391e6e=_0x43b1c0[_0xa10c('0x2a')]({'plain':!![]});var _0x50765d='CustomDashboards';return db['UserProfileResource'][_0xa10c('0x2b')]({'where':{'type':_0x50765d,'resourceId':_0x391e6e['id']}})[_0xa10c('0x29')](function(){return _0x43b1c0;});})[_0xa10c('0x29')](function(){_0x56ea7c[_0xa10c('0x25')](0xcc)[_0xa10c('0x20')]();});}};}function handleEntityNotFound(_0x3447ab,_0x5f1ff6){return function(_0x4fba1e){if(!_0x4fba1e){_0x3447ab[_0xa10c('0x1f')](0x194);}return _0x4fba1e;};}function handleError(_0x2e3631,_0x349e41){_0x349e41=_0x349e41||0x1f4;return function(_0x5b4c7e){logger[_0xa10c('0x2c')](_0x5b4c7e[_0xa10c('0x2d')]);if(_0x5b4c7e['name']){delete _0x5b4c7e[_0xa10c('0x2e')];}_0x2e3631[_0xa10c('0x25')](_0x349e41)[_0xa10c('0x2f')](_0x5b4c7e);};}exports[_0xa10c('0x30')]=function(_0x2cc5e3,_0x4af802){var _0x440d85={},_0x564199={},_0x174933={'count':0x0,'rows':[]};var _0xe0f6a6=db[_0xa10c('0x31')][_0xa10c('0x32')];_0x564199[_0xa10c('0x33')]=_[_0xa10c('0x34')](_0xe0f6a6);_0x564199[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x2cc5e3[_0xa10c('0x35')]);_0x564199[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x564199[_0xa10c('0x33')],_0x564199[_0xa10c('0x35')]);_0x440d85[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x564199['model'],qs['fields'](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x39')]));_0x440d85[_0xa10c('0x38')]=_0x440d85[_0xa10c('0x38')][_0xa10c('0x3a')]?_0x440d85[_0xa10c('0x38')]:_0x564199[_0xa10c('0x33')];if(!_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x3b')]('nolimit')){_0x440d85[_0xa10c('0x24')]=qs[_0xa10c('0x24')](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x24')]);_0x440d85[_0xa10c('0x23')]=qs['offset'](_0x2cc5e3['query']['offset']);}_0x440d85[_0xa10c('0x3c')]=qs[_0xa10c('0x3d')](_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x3d')]);_0x440d85[_0xa10c('0x3e')]=qs[_0xa10c('0x36')](_['pick'](_0x2cc5e3[_0xa10c('0x35')],_0x564199[_0xa10c('0x36')]));if(_0x2cc5e3[_0xa10c('0x35')]['filter']){_0x440d85[_0xa10c('0x3e')]=_[_0xa10c('0x3f')](_0x440d85['where'],{'$or':_[_0xa10c('0x40')](_0xe0f6a6,function(_0x1e65ca){if(_0x1e65ca['type'][_0xa10c('0x41')]!==_0xa10c('0x42')){var _0xdf5a3={};_0xdf5a3[_0x1e65ca[_0xa10c('0x43')]]={'$like':'%'+_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x44')]+'%'};return _0xdf5a3;}})});}_0x440d85=_[_0xa10c('0x3f')]({},_0x440d85,_0x2cc5e3[_0xa10c('0x45')]);var _0x271f28={'where':_0x440d85[_0xa10c('0x3e')]};return db['Dashboard'][_0xa10c('0x22')](_0x271f28)[_0xa10c('0x29')](function(_0x4b14bc){_0x174933[_0xa10c('0x22')]=_0x4b14bc;if(_0x2cc5e3[_0xa10c('0x35')][_0xa10c('0x46')]){_0x440d85['include']=[{'all':!![]}];}return db[_0xa10c('0x31')][_0xa10c('0x47')](_0x440d85);})['then'](function(_0x1122a7){_0x174933[_0xa10c('0x48')]=_0x1122a7;return _0x174933;})[_0xa10c('0x29')](respondWithFilteredResult(_0x4af802,_0x440d85))['catch'](handleError(_0x4af802,null));};exports['show']=function(_0x39920c,_0x2d5673){var _0x41d5fb={'raw':![],'where':{'id':_0x39920c[_0xa10c('0x49')]['id']}},_0x2370c1={};_0x2370c1[_0xa10c('0x33')]=_[_0xa10c('0x34')](db[_0xa10c('0x31')]['rawAttributes']);_0x2370c1[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x39920c[_0xa10c('0x35')]);_0x2370c1[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x2370c1[_0xa10c('0x33')],_0x2370c1[_0xa10c('0x35')]);_0x41d5fb[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x2370c1['model'],qs['fields'](_0x39920c['query']['fields']));_0x41d5fb['attributes']=_0x41d5fb['attributes'][_0xa10c('0x3a')]?_0x41d5fb['attributes']:_0x2370c1[_0xa10c('0x33')];if(_0x39920c[_0xa10c('0x35')][_0xa10c('0x46')]){_0x41d5fb[_0xa10c('0x4a')]=[{'all':!![]}];}_0x41d5fb=_[_0xa10c('0x3f')]({},_0x41d5fb,_0x39920c[_0xa10c('0x45')]);return db['Dashboard'][_0xa10c('0x4b')](_0x41d5fb)[_0xa10c('0x29')](handleEntityNotFound(_0x2d5673,null))[_0xa10c('0x29')](respondWithResult(_0x2d5673,null))[_0xa10c('0x4c')](handleError(_0x2d5673,null));};exports[_0xa10c('0x4d')]=function(_0x41d903,_0x55fc21){return db[_0xa10c('0x31')][_0xa10c('0x4d')](_0x41d903['body'],{})[_0xa10c('0x29')](function(_0x184da8){var _0x28c2a2=_0x41d903[_0xa10c('0x4e')][_0xa10c('0x2a')]({'plain':!![]});if(!_0x28c2a2)throw new Error(_0xa10c('0x4f'));if(_0x28c2a2[_0xa10c('0x50')]===_0xa10c('0x4e')){var _0x52a99a=_0x184da8[_0xa10c('0x2a')]({'plain':!![]});var _0x14560b=_0xa10c('0x51');return db[_0xa10c('0x52')][_0xa10c('0x4b')]({'where':{'name':_0x14560b,'userProfileId':_0x28c2a2[_0xa10c('0x53')]},'raw':!![]})[_0xa10c('0x29')](function(_0xe22a7d){if(_0xe22a7d&&_0xe22a7d[_0xa10c('0x54')]===0x0){return db[_0xa10c('0x55')][_0xa10c('0x4d')]({'name':_0x52a99a[_0xa10c('0x2e')],'resourceId':_0x52a99a['id'],'type':_0xe22a7d['name'],'sectionId':_0xe22a7d['id']},{})[_0xa10c('0x29')](function(){return _0x184da8;});}else{return _0x184da8;}})[_0xa10c('0x4c')](function(_0x4fede0){logger['error'](_0xa10c('0x56'),_0x4fede0);throw _0x4fede0;});}return _0x184da8;})[_0xa10c('0x29')](respondWithResult(_0x55fc21,0xc9))[_0xa10c('0x4c')](handleError(_0x55fc21,null));};exports[_0xa10c('0x57')]=function(_0x238241,_0x84e122){var _0x1c37b8={'raw':![],'where':{'id':_0x238241[_0xa10c('0x49')]['id']}},_0x5ab7f1={};_0x5ab7f1[_0xa10c('0x33')]=_[_0xa10c('0x34')](db[_0xa10c('0x31')][_0xa10c('0x32')]);_0x1c37b8[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x5ab7f1[_0xa10c('0x33')],qs[_0xa10c('0x39')](_0x238241['query']['fields']));_0x1c37b8['attributes']=_0x1c37b8['attributes']['length']?_0x1c37b8['attributes']:_0x5ab7f1[_0xa10c('0x33')];if(_0x238241[_0xa10c('0x35')]['includeAll']){_0x1c37b8['include']=[{'all':!![]}];}_0x1c37b8=_['merge']({},_0x1c37b8,_0x238241[_0xa10c('0x45')]);return db[_0xa10c('0x31')][_0xa10c('0x4b')](_0x1c37b8)[_0xa10c('0x29')](handleEntityNotFound(_0x84e122,null))[_0xa10c('0x29')](function(_0x2f5f9d){if(_0x2f5f9d){var _0x13a4ae=_0x2f5f9d[_0xa10c('0x2a')]({'plain':!![]});_0x13a4ae=qs[_0xa10c('0x58')](_0x13a4ae,['id','createdAt',_0xa10c('0x59')]);_0x238241['body']=_[_0xa10c('0x58')](_0x238241[_0xa10c('0x5a')],['id',_0xa10c('0x5b'),'updatedAt']);return db[_0xa10c('0x31')][_0xa10c('0x4d')](_[_0xa10c('0x3f')](_0x13a4ae,_0x238241[_0xa10c('0x5a')]),{'include':_0x238241['query'][_0xa10c('0x46')]?[{'all':!![]}]:undefined})[_0xa10c('0x29')](function(_0xdcfb67){var _0x3766a9=_0x238241[_0xa10c('0x4e')][_0xa10c('0x2a')]({'plain':!![]});if(!_0x3766a9)throw new Error(_0xa10c('0x4f'));if(_0x3766a9[_0xa10c('0x50')]===_0xa10c('0x4e')){var _0x357e8c=_0xdcfb67[_0xa10c('0x2a')]({'plain':!![]});var _0x1b582f='CustomDashboards';return db[_0xa10c('0x52')][_0xa10c('0x4b')]({'where':{'name':_0x1b582f,'userProfileId':_0x3766a9[_0xa10c('0x53')]},'raw':!![]})[_0xa10c('0x29')](function(_0x2e701f){if(_0x2e701f&&_0x2e701f[_0xa10c('0x54')]===0x0){return db['UserProfileResource'][_0xa10c('0x4d')]({'name':_0x357e8c['name'],'resourceId':_0x357e8c['id'],'type':_0x2e701f[_0xa10c('0x2e')],'sectionId':_0x2e701f['id']},{})[_0xa10c('0x29')](function(){return _0xdcfb67;});}else{return _0xdcfb67;}})[_0xa10c('0x4c')](function(_0x38c2b8){logger[_0xa10c('0x2c')](_0xa10c('0x56'),_0x38c2b8);throw _0x38c2b8;});}return _0xdcfb67;});}})['then'](respondWithResult(_0x84e122,0xc9))[_0xa10c('0x4c')](handleError(_0x84e122,null));};exports[_0xa10c('0x5c')]=function(_0xb3b855,_0x151b7f){if(_0xb3b855[_0xa10c('0x5a')]['id']){delete _0xb3b855['body']['id'];}return db[_0xa10c('0x31')][_0xa10c('0x4b')]({'where':{'id':_0xb3b855[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x151b7f,null))[_0xa10c('0x29')](saveUpdates(_0xb3b855[_0xa10c('0x5a')],null))[_0xa10c('0x29')](respondWithResult(_0x151b7f,null))[_0xa10c('0x4c')](handleError(_0x151b7f,null));};exports[_0xa10c('0x2b')]=function(_0x44b98c,_0x200c3d){return db[_0xa10c('0x31')]['find']({'where':{'id':_0x44b98c[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x200c3d,null))['then'](removeEntity(_0x200c3d,null))[_0xa10c('0x4c')](handleError(_0x200c3d,null));};function widgetAttributes(_0x112d54){try{switch(_0x112d54['type']){case _0xa10c('0x5d'):return[{'name':'attrUrl','value':_0x112d54[_0xa10c('0x5e')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x61')}];case _0xa10c('0x62'):return[{'name':_0xa10c('0x63'),'value':_0x112d54['attrPath']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0]['value']:undefined)||''}];case _0xa10c('0x64'):return[{'name':_0xa10c('0x65'),'value':_0x112d54[_0xa10c('0x65')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x66')},{'name':_0xa10c('0x67'),'value':_0x112d54[_0xa10c('0x67')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54['attrs'][0x1][_0xa10c('0x60')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x112d54['attrFontSize']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x2]?_0x112d54[_0xa10c('0x5f')][0x2][_0xa10c('0x60')]:undefined)||0xc}];case'counter':return[{'name':_0xa10c('0x68'),'value':_0x112d54[_0xa10c('0x68')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||_0xa10c('0x69')},{'name':_0xa10c('0x6a'),'value':_0x112d54[_0xa10c('0x6a')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54['attrs'][0x1]?_0x112d54[_0xa10c('0x5f')][0x1][_0xa10c('0x60')]:undefined)||[]},{'name':_0xa10c('0x6b'),'value':_0x112d54['attrFontSize']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x2]?_0x112d54['attrs'][0x2]['value']:undefined)||0x14}];case _0xa10c('0x6c'):case _0xa10c('0x6d'):return[{'name':_0xa10c('0x6e'),'value':_0x112d54['attrSerie1']||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54['attrs'][0x0][_0xa10c('0x60')]:undefined)||'total'},{'name':'attrSerie2','value':_0x112d54[_0xa10c('0x6f')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54[_0xa10c('0x5f')][0x1]['value']:undefined)||null},{'name':_0xa10c('0x70'),'value':_0x112d54[_0xa10c('0x70')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x2]?_0x112d54[_0xa10c('0x5f')][0x2][_0xa10c('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x112d54[_0xa10c('0x6a')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x3]?_0x112d54[_0xa10c('0x5f')][0x3][_0xa10c('0x60')]:undefined)||[]}];case _0xa10c('0x71'):return[{'name':_0xa10c('0x72'),'type':_0x112d54[_0xa10c('0x73')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x74')]:undefined)||null,'value':_0x112d54[_0xa10c('0x72')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x0]?_0x112d54[_0xa10c('0x5f')][0x0][_0xa10c('0x60')]:undefined)||null},{'name':_0xa10c('0x75'),'value':_0x112d54[_0xa10c('0x75')]||(_0x112d54[_0xa10c('0x5f')]&&_0x112d54[_0xa10c('0x5f')][0x1]?_0x112d54[_0xa10c('0x5f')][0x1][_0xa10c('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x58767a){logger[_0xa10c('0x2c')](_0xa10c('0x76'),JSON[_0xa10c('0x77')](_0x58767a));return[];}}exports[_0xa10c('0x78')]=function(_0x4892c3,_0x5cabf6,_0x48d662){if(_0x4892c3['body']['id']){delete _0x4892c3['body']['id'];}return db[_0xa10c('0x31')][_0xa10c('0x4b')]({'where':{'id':_0x4892c3[_0xa10c('0x49')]['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x5cabf6,null))[_0xa10c('0x29')](function(_0x269fd4){if(_0x269fd4){_0x4892c3[_0xa10c('0x5a')][_0xa10c('0x79')]=_0x269fd4['id'];_0x4892c3[_0xa10c('0x5a')][_0xa10c('0x5f')]=widgetAttributes(_0x4892c3[_0xa10c('0x5a')]);return db['DashboardItem'][_0xa10c('0x4d')](_0x4892c3[_0xa10c('0x5a')]);}})[_0xa10c('0x29')](respondWithResult(_0x5cabf6,null))['catch'](handleError(_0x5cabf6,null));};exports[_0xa10c('0x7a')]=function(_0x8938f1,_0x3e0b18,_0x108d06){var _0x382285={};var _0x1d8d16={};var _0x21b76e;var _0x26be97;return db[_0xa10c('0x31')][_0xa10c('0x7b')]({'where':{'id':_0x8938f1['params']['id']}})[_0xa10c('0x29')](handleEntityNotFound(_0x3e0b18,null))[_0xa10c('0x29')](function(_0x19b3ff){if(_0x19b3ff){_0x21b76e=_0x19b3ff;_0x1d8d16[_0xa10c('0x33')]=_['keys'](db[_0xa10c('0x7c')][_0xa10c('0x32')]);_0x1d8d16[_0xa10c('0x35')]=_[_0xa10c('0x34')](_0x8938f1['query']);_0x1d8d16[_0xa10c('0x36')]=_[_0xa10c('0x37')](_0x1d8d16[_0xa10c('0x33')],_0x1d8d16[_0xa10c('0x35')]);_0x382285[_0xa10c('0x38')]=_[_0xa10c('0x37')](_0x1d8d16[_0xa10c('0x33')],qs[_0xa10c('0x39')](_0x8938f1[_0xa10c('0x35')][_0xa10c('0x39')]));_0x382285[_0xa10c('0x38')]=_0x382285[_0xa10c('0x38')][_0xa10c('0x3a')]?_0x382285['attributes']:_0x1d8d16[_0xa10c('0x33')];_0x382285['order']=qs[_0xa10c('0x3d')](_0x8938f1[_0xa10c('0x35')]['sort']);_0x382285['where']=qs['filters'](_[_0xa10c('0x7d')](_0x8938f1['query'],_0x1d8d16[_0xa10c('0x36')]));if(_0x8938f1[_0xa10c('0x35')][_0xa10c('0x44')]){_0x382285[_0xa10c('0x3e')]=_[_0xa10c('0x3f')](_0x382285[_0xa10c('0x3e')],{'$or':_[_0xa10c('0x40')](_0x382285['attributes'],function(_0x300526){var _0x2869e3={};_0x2869e3[_0x300526]={'$like':'%'+_0x8938f1[_0xa10c('0x35')][_0xa10c('0x44')]+'%'};return _0x2869e3;})});}_0x382285=_[_0xa10c('0x3f')]({},_0x382285,_0x8938f1['options']);return _0x21b76e[_0xa10c('0x7a')](_0x382285);}})[_0xa10c('0x29')](function(_0x19749e){if(_0x19749e){_0x26be97=_0x19749e[_0xa10c('0x3a')];if(!_0x8938f1[_0xa10c('0x35')][_0xa10c('0x3b')](_0xa10c('0x7e'))){_0x382285[_0xa10c('0x24')]=qs[_0xa10c('0x24')](_0x8938f1[_0xa10c('0x35')]['limit']);_0x382285[_0xa10c('0x23')]=qs[_0xa10c('0x23')](_0x8938f1['query']['offset']);}return _0x21b76e['getItems'](_0x382285);}})[_0xa10c('0x29')](function(_0x47376a){if(_0x47376a){return _0x47376a?{'count':_0x26be97,'rows':_0x47376a}:null;}})[_0xa10c('0x29')](respondWithResult(_0x3e0b18,null))[_0xa10c('0x4c')](handleError(_0x3e0b18,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 0c17f7d..9e9bb19 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 _0x6739=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x6739,0xe4));var _0x9673=function(_0x3f2930,_0x59313c){_0x3f2930=_0x3f2930-0x0;var _0x5cc939=_0x6739[_0x3f2930];return _0x5cc939;};'use strict';var EventEmitter=require(_0x9673('0x0'));var Dashboard=require(_0x9673('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9673('0x2')](0x0);var events={'afterCreate':_0x9673('0x3'),'afterUpdate':_0x9673('0x4'),'afterDestroy':'remove'};function emitEvent(_0x546ed2){return function(_0x3f4061,_0x5dc303,_0x527dcd){DashboardEvents['emit'](_0x546ed2+':'+_0x3f4061['id'],_0x3f4061);DashboardEvents[_0x9673('0x5')](_0x546ed2,_0x3f4061);_0x527dcd(null);};}for(var e in events){if(events[_0x9673('0x6')](e)){var event=events[e];Dashboard[_0x9673('0x7')](e,emitEvent(event));}}module[_0x9673('0x8')]=DashboardEvents; \ No newline at end of file +var _0xf98a=['emit','hasOwnProperty','hook','exports','Dashboard','setMaxListeners','save'];(function(_0x123d01,_0x413cfa){var _0x2ad989=function(_0x3450cb){while(--_0x3450cb){_0x123d01['push'](_0x123d01['shift']());}};_0x2ad989(++_0x413cfa);}(_0xf98a,0x162));var _0xaf98=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xf98a[_0xfcbcb8];return _0x1b1f97;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xaf98('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xaf98('0x1')](0x0);var events={'afterCreate':_0xaf98('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xcbc000){return function(_0x4b9abf,_0x115ee7,_0x3189b6){DashboardEvents[_0xaf98('0x3')](_0xcbc000+':'+_0x4b9abf['id'],_0x4b9abf);DashboardEvents[_0xaf98('0x3')](_0xcbc000,_0x4b9abf);_0x3189b6(null);};}for(var e in events){if(events[_0xaf98('0x4')](e)){var event=events[e];Dashboard[_0xaf98('0x5')](e,emitEvent(event));}}module[_0xaf98('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index af65ee1..ae64774 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 _0xe5bc=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger'];(function(_0x352a8e,_0x443baf){var _0x41d3dc=function(_0x2ea51e){while(--_0x2ea51e){_0x352a8e['push'](_0x352a8e['shift']());}};_0x41d3dc(++_0x443baf);}(_0xe5bc,0x8c));var _0xce5b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xe5bc[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xce5b('0x0'));var util=require(_0xce5b('0x1'));var logger=require(_0xce5b('0x2'))(_0xce5b('0x3'));var moment=require(_0xce5b('0x4'));var BPromise=require(_0xce5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce5b('0x6'));var rimraf=require(_0xce5b('0x7'));var config=require(_0xce5b('0x8'));var attributes=require(_0xce5b('0x9'));module[_0xce5b('0xa')]=function(_0x2d890c,_0x59ed4f){return _0x2d890c[_0xce5b('0xb')]('Dashboard',attributes,{'tableName':_0xce5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd90b=['lodash','api','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x9648db,_0x588d6e){var _0x2ce466=function(_0x4a47d9){while(--_0x4a47d9){_0x9648db['push'](_0x9648db['shift']());}};_0x2ce466(++_0x588d6e);}(_0xd90b,0xbd));var _0xbd90=function(_0x5a8899,_0x521ad0){_0x5a8899=_0x5a8899-0x0;var _0x548638=_0xd90b[_0x5a8899];return _0x548638;};'use strict';var _=require(_0xbd90('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd90('0x3'));var config=require(_0xbd90('0x4'));var attributes=require(_0xbd90('0x5'));module[_0xbd90('0x6')]=function(_0x448c24,_0x257fd3){return _0x448c24['define'](_0xbd90('0x7'),attributes,{'tableName':_0xbd90('0x8'),'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 e655da0..a1fd531 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 _0xb576=['socket.io-emitter','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x46f221,_0x211dab){var _0x5d510b=function(_0x2c4065){while(--_0x2c4065){_0x46f221['push'](_0x46f221['shift']());}};_0x5d510b(++_0x211dab);}(_0xb576,0x112));var _0x6b57=function(_0x321eeb,_0x1a3845){_0x321eeb=_0x321eeb-0x0;var _0x4f61f1=_0xb576[_0x321eeb];return _0x4f61f1;};'use strict';var _=require(_0x6b57('0x0'));var util=require('util');var moment=require(_0x6b57('0x1'));var BPromise=require(_0x6b57('0x2'));var rs=require(_0x6b57('0x3'));var fs=require('fs');var Redis=require(_0x6b57('0x4'));var db=require(_0x6b57('0x5'))['db'];var utils=require(_0x6b57('0x6'));var logger=require(_0x6b57('0x7'))(_0x6b57('0x8'));var config=require(_0x6b57('0x9'));var jayson=require(_0x6b57('0xa'));var client=jayson[_0x6b57('0xb')][_0x6b57('0xc')]({'port':0x232a});config[_0x6b57('0xd')]=_[_0x6b57('0xe')](config[_0x6b57('0xd')],{'host':_0x6b57('0xf'),'port':0x18eb});var socket=require(_0x6b57('0x10'))(new Redis(config[_0x6b57('0xd')]));require(_0x6b57('0x11'))[_0x6b57('0x12')](socket);function respondWithRpcPromise(_0x159757,_0x377c6f,_0x2e73a9){return new BPromise(function(_0x26c484,_0x284f38){return client['request'](_0x159757,_0x2e73a9)[_0x6b57('0x13')](function(_0x37b65d){logger['info'](_0x6b57('0x14'),_0x377c6f,_0x6b57('0x15'));logger['debug'](_0x6b57('0x16'),_0x377c6f,_0x6b57('0x15'),JSON[_0x6b57('0x17')](_0x37b65d));if(_0x37b65d[_0x6b57('0x18')]){if(_0x37b65d[_0x6b57('0x18')][_0x6b57('0x19')]===0x1f4){logger[_0x6b57('0x18')]('Dashboard,\x20%s,\x20%s',_0x377c6f,_0x37b65d[_0x6b57('0x18')]['message']);return _0x284f38(_0x37b65d[_0x6b57('0x18')][_0x6b57('0x1a')]);}logger[_0x6b57('0x18')](_0x6b57('0x14'),_0x377c6f,_0x37b65d[_0x6b57('0x18')]['message']);return _0x26c484(_0x37b65d[_0x6b57('0x18')]['message']);}else{logger['info'](_0x6b57('0x14'),_0x377c6f,_0x6b57('0x15'));_0x26c484(_0x37b65d[_0x6b57('0x1b')][_0x6b57('0x1a')]);}})[_0x6b57('0x1c')](function(_0x4f59bd){logger[_0x6b57('0x18')](_0x6b57('0x14'),_0x377c6f,_0x4f59bd);_0x284f38(_0x4f59bd);});});} \ No newline at end of file +var _0x55e6=['socket.io-emitter','./dashboard.socket','register','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','Dashboard,\x20%s,\x20%s','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','http','defaults','redis'];(function(_0x186e6c,_0x11567f){var _0x111ba7=function(_0x4297af){while(--_0x4297af){_0x186e6c['push'](_0x186e6c['shift']());}};_0x111ba7(++_0x11567f);}(_0x55e6,0x6f));var _0x655e=function(_0x1304c5,_0x359ed9){_0x1304c5=_0x1304c5-0x0;var _0x3a05ee=_0x55e6[_0x1304c5];return _0x3a05ee;};'use strict';var _=require('lodash');var util=require(_0x655e('0x0'));var moment=require(_0x655e('0x1'));var BPromise=require(_0x655e('0x2'));var rs=require(_0x655e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x655e('0x4'));var logger=require(_0x655e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x655e('0x6')]({'port':0x232a});config['redis']=_[_0x655e('0x7')](config[_0x655e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x655e('0x9'))(new Redis(config[_0x655e('0x8')]));require(_0x655e('0xa'))[_0x655e('0xb')](socket);function respondWithRpcPromise(_0x435e6d,_0x28c468,_0x389659){return new BPromise(function(_0x501d5f,_0x2d55a8){return client['request'](_0x435e6d,_0x389659)['then'](function(_0x1f6722){logger[_0x655e('0xc')]('Dashboard,\x20%s,\x20%s',_0x28c468,_0x655e('0xd'));logger[_0x655e('0xe')](_0x655e('0xf'),_0x28c468,_0x655e('0xd'),JSON['stringify'](_0x1f6722));if(_0x1f6722[_0x655e('0x10')]){if(_0x1f6722[_0x655e('0x10')][_0x655e('0x11')]===0x1f4){logger[_0x655e('0x10')]('Dashboard,\x20%s,\x20%s',_0x28c468,_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);return _0x2d55a8(_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);}logger[_0x655e('0x10')](_0x655e('0x13'),_0x28c468,_0x1f6722['error']['message']);return _0x501d5f(_0x1f6722[_0x655e('0x10')][_0x655e('0x12')]);}else{logger[_0x655e('0xc')]('Dashboard,\x20%s,\x20%s',_0x28c468,'request\x20sent');_0x501d5f(_0x1f6722['result']['message']);}})['catch'](function(_0x39e802){logger[_0x655e('0x10')](_0x655e('0x13'),_0x28c468,_0x39e802);_0x2d55a8(_0x39e802);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f70659e..4a47082 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 _0x074e=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x4af2c3,_0xf4d1f4){var _0x74088=function(_0x5a3cc8){while(--_0x5a3cc8){_0x4af2c3['push'](_0x4af2c3['shift']());}};_0x74088(++_0xf4d1f4);}(_0x074e,0x1d2));var _0xe074=function(_0x3300ee,_0xed60a9){_0x3300ee=_0x3300ee-0x0;var _0x714154=_0x074e[_0x3300ee];return _0x714154;};'use strict';var DashboardEvents=require(_0xe074('0x0'));var events=[_0xe074('0x1'),_0xe074('0x2'),_0xe074('0x3')];function createListener(_0x2e723b,_0x393b62){return function(_0x5141f6){_0x393b62[_0xe074('0x4')](_0x2e723b,_0x5141f6);};}function removeListener(_0x232f52,_0x2cfdde){return function(){DashboardEvents[_0xe074('0x5')](_0x232f52,_0x2cfdde);};}exports[_0xe074('0x6')]=function(_0x3a37ac){for(var _0x588725=0x0,_0x2dcb66=events[_0xe074('0x7')];_0x588725<_0x2dcb66;_0x588725++){var _0x1354f3=events[_0x588725];var _0x14cc8e=createListener(_0xe074('0x8')+_0x1354f3,_0x3a37ac);DashboardEvents['on'](_0x1354f3,_0x14cc8e);}}; \ No newline at end of file +var _0xb122=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x8878eb,_0x30f31b){var _0x5bc4f5=function(_0x370037){while(--_0x370037){_0x8878eb['push'](_0x8878eb['shift']());}};_0x5bc4f5(++_0x30f31b);}(_0xb122,0x69));var _0x2b12=function(_0x227b5c,_0x52a170){_0x227b5c=_0x227b5c-0x0;var _0x1eba10=_0xb122[_0x227b5c];return _0x1eba10;};'use strict';var DashboardEvents=require(_0x2b12('0x0'));var events=[_0x2b12('0x1'),_0x2b12('0x2'),_0x2b12('0x3')];function createListener(_0x4d7bca,_0x2c30fe){return function(_0x1c6b3a){_0x2c30fe[_0x2b12('0x4')](_0x4d7bca,_0x1c6b3a);};}function removeListener(_0x236505,_0x445d42){return function(){DashboardEvents[_0x2b12('0x5')](_0x236505,_0x445d42);};}exports[_0x2b12('0x6')]=function(_0x2cb51b){for(var _0x5cba3f=0x0,_0x14646a=events[_0x2b12('0x7')];_0x5cba3f<_0x14646a;_0x5cba3f++){var _0x5b1ad5=events[_0x5cba3f];var _0x3e52b4=createListener(_0x2b12('0x8')+_0x5b1ad5,_0x2cb51b);DashboardEvents['on'](_0x5b1ad5,_0x3e52b4);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index eb8782b..84dc0cd 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 _0x156d=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','put','update'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x156d,0x1a5));var _0xd156=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x156d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xd156('0x0'));var util=require(_0xd156('0x1'));var path=require('path');var timeout=require(_0xd156('0x2'));var express=require('express');var router=express[_0xd156('0x3')]();var auth=require(_0xd156('0x4'));var interaction=require(_0xd156('0x5'));var config=require(_0xd156('0x6'));var controller=require('./dashboard.controller');router[_0xd156('0x7')]('/',auth[_0xd156('0x8')](),controller[_0xd156('0x9')]);router[_0xd156('0x7')](_0xd156('0xa'),auth[_0xd156('0x8')](),controller[_0xd156('0xb')]);router[_0xd156('0x7')](_0xd156('0xc'),auth[_0xd156('0x8')](),controller[_0xd156('0xd')]);router[_0xd156('0xe')]('/',auth['isAuthenticated'](),controller[_0xd156('0xf')]);router['post'](_0xd156('0x10'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xd156('0xc'),auth['isAuthenticated'](),controller['addItem']);router[_0xd156('0x11')](_0xd156('0xa'),auth['isAuthenticated'](),controller[_0xd156('0x12')]);router[_0xd156('0x13')](_0xd156('0xa'),auth[_0xd156('0x8')](),controller[_0xd156('0x14')]);module[_0xd156('0x15')]=router; \ No newline at end of file +var _0xa33a=['show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x23981d,_0x1729ca){var _0xdb582f=function(_0xa1dd7c){while(--_0xa1dd7c){_0x23981d['push'](_0x23981d['shift']());}};_0xdb582f(++_0x1729ca);}(_0xa33a,0x68));var _0xaa33=function(_0x4d2216,_0x1f3826){_0x4d2216=_0x4d2216-0x0;var _0x44a375=_0xa33a[_0x4d2216];return _0x44a375;};'use strict';var multer=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var path=require(_0xaa33('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa33('0x3')]();var auth=require(_0xaa33('0x4'));var interaction=require(_0xaa33('0x5'));var config=require('../../config/environment');var controller=require(_0xaa33('0x6'));router[_0xaa33('0x7')]('/',auth[_0xaa33('0x8')](),controller[_0xaa33('0x9')]);router[_0xaa33('0x7')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0xb')]);router[_0xaa33('0x7')](_0xaa33('0xc'),auth[_0xaa33('0x8')](),controller[_0xaa33('0xd')]);router['post']('/',auth[_0xaa33('0x8')](),controller[_0xaa33('0xe')]);router[_0xaa33('0xf')](_0xaa33('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xaa33('0xf')](_0xaa33('0xc'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x11')]);router[_0xaa33('0x12')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x13')]);router[_0xaa33('0x14')](_0xaa33('0xa'),auth[_0xaa33('0x8')](),controller[_0xaa33('0x15')]);module[_0xaa33('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e1b5d0d..c49d9df 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 _0x6fff=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT'];(function(_0x35313f,_0x4993f6){var _0x1d458f=function(_0x7aa24a){while(--_0x7aa24a){_0x35313f['push'](_0x35313f['shift']());}};_0x1d458f(++_0x4993f6);}(_0x6fff,0xa4));var _0xf6ff=function(_0x187bb2,_0x2f59bf){_0x187bb2=_0x187bb2-0x0;var _0x4af854=_0x6fff[_0x187bb2];return _0x4af854;};'use strict';var Sequelize=require(_0xf6ff('0x0'));var squel=require('squel');var _=require(_0xf6ff('0x1'));module[_0xf6ff('0x2')]={'title':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf6ff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf6ff('0x4')](_0xf6ff('0x5')),'get':function(){try{return JSON[_0xf6ff('0x6')](this[_0xf6ff('0x7')](_0xf6ff('0x8')));}catch(_0x1d9d9){return[];}},'set':function(_0x5d844c){try{this[_0xf6ff('0x9')](_0xf6ff('0x8'),JSON[_0xf6ff('0xa')](_0x5d844c));}catch(_0x1dd7ff){this[_0xf6ff('0x9')](_0xf6ff('0x8'),JSON[_0xf6ff('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf6ff('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xf6ff('0xb')]},'background':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![],'defaultValue':_0xf6ff('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xf6ff('0x3')]}}; \ No newline at end of file +var _0x3cee=['sequelize','STRING','parse','getDataValue','setDataValue','attrs','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x4c273f,_0x37e69b){var _0x46533a=function(_0x9e1894){while(--_0x9e1894){_0x4c273f['push'](_0x4c273f['shift']());}};_0x46533a(++_0x37e69b);}(_0x3cee,0x136));var _0xe3ce=function(_0x3db3b1,_0x4c1516){_0x3db3b1=_0x3db3b1-0x0;var _0x1aefda=_0x3cee[_0x3db3b1];return _0x1aefda;};'use strict';var Sequelize=require(_0xe3ce('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0xe3ce('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe3ce('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0xe3ce('0x2')](this[_0xe3ce('0x3')]('attrs'));}catch(_0x242de4){return[];}},'set':function(_0x296eb9){try{this[_0xe3ce('0x4')](_0xe3ce('0x5'),JSON[_0xe3ce('0x6')](_0x296eb9));}catch(_0xccf378){this[_0xe3ce('0x4')](_0xe3ce('0x5'),JSON[_0xe3ce('0x6')]([]));}}},'sizeX':{'type':Sequelize[_0xe3ce('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xe3ce('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xe3ce('0x7')]},'col':{'type':Sequelize[_0xe3ce('0x7')]},'background':{'type':Sequelize[_0xe3ce('0x1')],'allowNull':![],'defaultValue':_0xe3ce('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe3ce('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xe3ce('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 2d56533..9213bb0 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 _0x7a54=['web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','query','keys','intersection','attributes','fields','length','includeAll','include','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues'];(function(_0xddb860,_0x344918){var _0x255df9=function(_0x102c1c){while(--_0x102c1c){_0xddb860['push'](_0xddb860['shift']());}};_0x255df9(++_0x344918);}(_0x7a54,0x106));var _0x47a5=function(_0x548c96,_0x48a5d1){_0x548c96=_0x548c96-0x0;var _0x160b80=_0x7a54[_0x548c96];return _0x160b80;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){_0xe2dea9[_0x47a5('0x1a')](0xcc)[_0x47a5('0x26')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x19')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);if(_0x5b6c4e[_0x47a5('0x29')]){delete _0x5b6c4e[_0x47a5('0x29')];}_0x5686db[_0x47a5('0x1a')](_0x1ea9c8)[_0x47a5('0x2a')](_0x5b6c4e);};}exports[_0x47a5('0x2b')]=function(_0x136b14,_0x16631f){var _0x361bfa={'raw':![],'where':{'id':_0x136b14[_0x47a5('0x2c')]['id']}},_0x1127f8={};_0x1127f8[_0x47a5('0x2d')]=_['keys'](db[_0x47a5('0x2e')]['rawAttributes']);_0x1127f8[_0x47a5('0x2f')]=_[_0x47a5('0x30')](_0x136b14[_0x47a5('0x2f')]);_0x1127f8['filters']=_[_0x47a5('0x31')](_0x1127f8[_0x47a5('0x2d')],_0x1127f8[_0x47a5('0x2f')]);_0x361bfa[_0x47a5('0x32')]=_['intersection'](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14[_0x47a5('0x2f')]['fields']));_0x361bfa['attributes']=_0x361bfa[_0x47a5('0x32')][_0x47a5('0x34')]?_0x361bfa['attributes']:_0x1127f8[_0x47a5('0x2d')];if(_0x136b14['query'][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x36')]=[{'all':!![]}];}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);return db[_0x47a5('0x2e')]['find'](_0x361bfa)[_0x47a5('0x24')](handleEntityNotFound(_0x16631f,null))[_0x47a5('0x24')](respondWithResult(_0x16631f,null))[_0x47a5('0x37')](handleError(_0x16631f,null));};exports['destroy']=function(_0x18f7e9,_0x50c086){return db['DashboardItem'][_0x47a5('0x38')]({'where':{'id':_0x18f7e9['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x50c086,null))['then'](removeEntity(_0x50c086,null))[_0x47a5('0x37')](handleError(_0x50c086,null));};function widgetAttributes(_0x3534cb){try{switch(_0x3534cb[_0x47a5('0x39')]){case _0x47a5('0x3a'):return[{'name':_0x47a5('0x3b'),'value':_0x3534cb[_0x47a5('0x3b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x3d')}];case _0x47a5('0x3e'):return[{'name':'attrPath','value':_0x3534cb[_0x47a5('0x3f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x40')]:undefined)||''}];case _0x47a5('0x41'):return[{'name':'attrHourFormat','value':_0x3534cb[_0x47a5('0x42')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x0]?_0x3534cb['attrs'][0x0]['value']:undefined)||_0x47a5('0x43')},{'name':'attrTimezone','value':_0x3534cb[_0x47a5('0x44')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||_0x47a5('0x45')},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0xc}];case _0x47a5('0x47'):return[{'name':'attrMetric','value':_0x3534cb[_0x47a5('0x48')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x49')},{'name':'attrVoiceQueues','value':_0x3534cb['attrVoiceQueues']||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1]['value']:undefined)||[]},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x47a5('0x4a'),'value':_0x3534cb['attrSerie1']||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||_0x47a5('0x49')},{'name':_0x47a5('0x4b'),'value':_0x3534cb[_0x47a5('0x4b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x4c'),'value':_0x3534cb[_0x47a5('0x4c')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2]['value']:undefined)||null},{'name':_0x47a5('0x4d'),'value':_0x3534cb[_0x47a5('0x4d')]||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x3]?_0x3534cb[_0x47a5('0x3c')][0x3]['value']:undefined)||[]}];case _0x47a5('0x4e'):return[{'name':_0x47a5('0x4f'),'type':_0x3534cb['reportType']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x39')]:undefined)||null,'value':_0x3534cb[_0x47a5('0x4f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x50'),'value':_0x3534cb['attrRefresh']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ea93e){logger[_0x47a5('0x27')](_0x47a5('0x51'),JSON[_0x47a5('0x52')](_0x9ea93e));return[];}}exports['create']=function(_0x45cca5,_0x1c9a62){if(_0x45cca5[_0x47a5('0x53')]){_0x45cca5['body'][_0x47a5('0x3c')]=widgetAttributes(_0x45cca5['body']);}return db[_0x47a5('0x2e')][_0x47a5('0x54')](_0x45cca5[_0x47a5('0x53')],{})[_0x47a5('0x24')](respondWithResult(_0x1c9a62,0xc9))['catch'](handleError(_0x1c9a62,null));};exports[_0x47a5('0x23')]=function(_0x1e6de3,_0x2f66e9){if(_0x1e6de3[_0x47a5('0x53')]['id']){delete _0x1e6de3[_0x47a5('0x53')]['id'];}_0x1e6de3[_0x47a5('0x53')][_0x47a5('0x3c')]=widgetAttributes(_0x1e6de3['body']);return db[_0x47a5('0x2e')][_0x47a5('0x38')]({'where':{'id':_0x1e6de3[_0x47a5('0x2c')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2f66e9,null))[_0x47a5('0x24')](saveUpdates(_0x1e6de3[_0x47a5('0x53')],null))['then'](respondWithResult(_0x2f66e9,null))[_0x47a5('0x37')](handleError(_0x2f66e9,null));}; \ No newline at end of file +var _0x5f2f=['find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrRefresh','stringify','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','send','show','params','DashboardItem','rawAttributes','query','keys','model','attributes','fields','length','includeAll','include','merge','options'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5def3c,_0x4cadf7){_0x5def3c=_0x5def3c-0x0;var _0x4e568f=_0x5f2f[_0x5def3c];return _0x4e568f;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];config[_0xf5f2('0x16')]=_[_0xf5f2('0x17')](config[_0xf5f2('0x16')],{'host':_0xf5f2('0x18'),'port':0x18eb});var socket=require(_0xf5f2('0x19'))(new Redis(config[_0xf5f2('0x16')]));require('./dashboardItem.socket')[_0xf5f2('0x1a')](socket);function respondWithStatusCode(_0xea612c,_0x269909){_0x269909=_0x269909||0xcc;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1b')](_0x269909);}return _0xea612c['status'](_0x269909)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x286197,_0x17d656){_0x17d656=_0x17d656||0xc8;return function(_0x1b6dd2){if(_0x1b6dd2){return _0x286197[_0xf5f2('0x1d')](_0x17d656)[_0xf5f2('0x1e')](_0x1b6dd2);}};}function respondWithFilteredResult(_0xdb61b3,_0x395a5a){return function(_0x11f702){if(_0x11f702){var _0x228ace=_0x11f702[_0xf5f2('0x1f')],_0x20fccd=_0x395a5a[_0xf5f2('0x20')],_0x28e097=_0x395a5a[_0xf5f2('0x20')]+_0x395a5a[_0xf5f2('0x21')],_0x4ff59b;if(_0x28e097>=_0x228ace){_0x28e097=_0x228ace;_0x4ff59b=0xc8;}else{_0x4ff59b=0xce;}_0xdb61b3['status'](_0x4ff59b);return _0xdb61b3[_0xf5f2('0x22')](_0xf5f2('0x23'),_0x20fccd+'-'+_0x28e097+'/'+_0x228ace)['json'](_0x11f702);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x24')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x25')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x26')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x27')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1d')](0xcc)[_0xf5f2('0x1c')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x1b')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x28')]);if(_0x294414[_0xf5f2('0x29')]){delete _0x294414[_0xf5f2('0x29')];}_0x13a3be[_0xf5f2('0x1d')](_0x281ec8)[_0xf5f2('0x2a')](_0x294414);};}exports[_0xf5f2('0x2b')]=function(_0x5b6672,_0x53cb96){var _0x22c826={'raw':![],'where':{'id':_0x5b6672[_0xf5f2('0x2c')]['id']}},_0x14c829={};_0x14c829['model']=_['keys'](db[_0xf5f2('0x2d')][_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x5b6672[_0xf5f2('0x2f')]);_0x14c829['filters']=_['intersection'](_0x14c829[_0xf5f2('0x31')],_0x14c829['query']);_0x22c826[_0xf5f2('0x32')]=_['intersection'](_0x14c829[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829['model'];if(_0x5b6672[_0xf5f2('0x2f')][_0xf5f2('0x35')]){_0x22c826[_0xf5f2('0x36')]=[{'all':!![]}];}_0x22c826=_[_0xf5f2('0x37')]({},_0x22c826,_0x5b6672[_0xf5f2('0x38')]);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')](_0x22c826)['then'](handleEntityNotFound(_0x53cb96,null))[_0xf5f2('0x27')](respondWithResult(_0x53cb96,null))[_0xf5f2('0x3a')](handleError(_0x53cb96,null));};exports['destroy']=function(_0x3fc168,_0x4b8c42){return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x3fc168[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x4b8c42,null))['then'](removeEntity(_0x4b8c42,null))['catch'](handleError(_0x4b8c42,null));};function widgetAttributes(_0x41088b){try{switch(_0x41088b[_0xf5f2('0x3b')]){case _0xf5f2('0x3c'):return[{'name':'attrUrl','value':_0x41088b[_0xf5f2('0x3d')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x40')}];case'custom':return[{'name':_0xf5f2('0x41'),'value':_0x41088b[_0xf5f2('0x41')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0]['value']:undefined)||''}];case _0xf5f2('0x42'):return[{'name':_0xf5f2('0x43'),'value':_0x41088b[_0xf5f2('0x43')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'HH:mm:ss'},{'name':_0xf5f2('0x44'),'value':_0x41088b[_0xf5f2('0x44')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x45')},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b['attrs'][0x2][_0xf5f2('0x3f')]:undefined)||0xc}];case _0xf5f2('0x47'):return[{'name':_0xf5f2('0x48'),'value':_0x41088b['attrMetric']||(_0x41088b['attrs']&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||'total'},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||[]},{'name':_0xf5f2('0x46'),'value':_0x41088b[_0xf5f2('0x46')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2][_0xf5f2('0x3f')]:undefined)||0x14}];case _0xf5f2('0x4a'):case _0xf5f2('0x4b'):return[{'name':'attrSerie1','value':_0x41088b[_0xf5f2('0x4c')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0][_0xf5f2('0x3f')]:undefined)||_0xf5f2('0x4d')},{'name':_0xf5f2('0x4e'),'value':_0x41088b[_0xf5f2('0x4e')]||(_0x41088b['attrs']&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b[_0xf5f2('0x3e')][0x1][_0xf5f2('0x3f')]:undefined)||null},{'name':_0xf5f2('0x4f'),'value':_0x41088b[_0xf5f2('0x4f')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x2]?_0x41088b[_0xf5f2('0x3e')][0x2]['value']:undefined)||null},{'name':_0xf5f2('0x49'),'value':_0x41088b[_0xf5f2('0x49')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x3]?_0x41088b[_0xf5f2('0x3e')][0x3][_0xf5f2('0x3f')]:undefined)||[]}];case _0xf5f2('0x50'):return[{'name':'attrReport','type':_0x41088b['reportType']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x0]?_0x41088b['attrs'][0x0][_0xf5f2('0x3b')]:undefined)||null,'value':_0x41088b['attrReport']||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b['attrs'][0x0]?_0x41088b[_0xf5f2('0x3e')][0x0]['value']:undefined)||null},{'name':_0xf5f2('0x51'),'value':_0x41088b[_0xf5f2('0x51')]||(_0x41088b[_0xf5f2('0x3e')]&&_0x41088b[_0xf5f2('0x3e')][0x1]?_0x41088b['attrs'][0x1][_0xf5f2('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x2b782f){logger['error']('widgetAttributes:\x20%s',JSON[_0xf5f2('0x52')](_0x2b782f));return[];}}exports[_0xf5f2('0x53')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x54')]){_0x57782c[_0xf5f2('0x54')][_0xf5f2('0x3e')]=widgetAttributes(_0x57782c['body']);}return db['DashboardItem'][_0xf5f2('0x53')](_0x57782c[_0xf5f2('0x54')],{})['then'](respondWithResult(_0x22b645,0xc9))[_0xf5f2('0x3a')](handleError(_0x22b645,null));};exports[_0xf5f2('0x55')]=function(_0x255125,_0x14029e){if(_0x255125[_0xf5f2('0x54')]['id']){delete _0x255125[_0xf5f2('0x54')]['id'];}_0x255125[_0xf5f2('0x54')]['attrs']=widgetAttributes(_0x255125['body']);return db[_0xf5f2('0x2d')][_0xf5f2('0x39')]({'where':{'id':_0x255125[_0xf5f2('0x2c')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x14029e,null))[_0xf5f2('0x27')](saveUpdates(_0x255125['body'],null))[_0xf5f2('0x27')](respondWithResult(_0x14029e,null))[_0xf5f2('0x3a')](handleError(_0x14029e,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4ee1bad..cf5e569 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 _0x2501=['save','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x55f039,_0x3be31b){var _0xdbed83=function(_0x4d3d13){while(--_0x4d3d13){_0x55f039['push'](_0x55f039['shift']());}};_0xdbed83(++_0x3be31b);}(_0x2501,0xac));var _0x1250=function(_0x228b96,_0x341271){_0x228b96=_0x228b96-0x0;var _0x264a3f=_0x2501[_0x228b96];return _0x264a3f;};'use strict';var EventEmitter=require(_0x1250('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1250('0x1')](0x0);var events={'afterCreate':_0x1250('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c607e){return function(_0x5cab91,_0x57348c,_0x16083e){DashboardItemEvents[_0x1250('0x3')](_0x1c607e+':'+_0x5cab91['id'],_0x5cab91);DashboardItemEvents[_0x1250('0x3')](_0x1c607e,_0x5cab91);_0x16083e(null);};}for(var e in events){if(events[_0x1250('0x4')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x1250('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x5047=['exports','events','../../mysqldb','save','remove','hook'];(function(_0x3287f4,_0x131a75){var _0x4f6d7e=function(_0x431e12){while(--_0x431e12){_0x3287f4['push'](_0x3287f4['shift']());}};_0x4f6d7e(++_0x131a75);}(_0x5047,0x1c3));var _0x7504=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x5047[_0x11ba46];return _0x1c8c6f;};'use strict';var EventEmitter=require(_0x7504('0x0'));var DashboardItem=require(_0x7504('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7504('0x2'),'afterUpdate':'update','afterDestroy':_0x7504('0x3')};function emitEvent(_0x59b5f9){return function(_0x2e4b11,_0x83425a,_0x4f8ec2){DashboardItemEvents['emit'](_0x59b5f9+':'+_0x2e4b11['id'],_0x2e4b11);DashboardItemEvents['emit'](_0x59b5f9,_0x2e4b11);_0x4f8ec2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x7504('0x4')](e,emitEvent(event));}}module[_0x7504('0x5')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9a26446..9a8c83f 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 _0x7994=['request-promise','path','rimraf','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird'];(function(_0x339d01,_0x282b12){var _0x4957e8=function(_0x24f3b7){while(--_0x24f3b7){_0x339d01['push'](_0x339d01['shift']());}};_0x4957e8(++_0x282b12);}(_0x7994,0x1b7));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4799('0x0'));var logger=require(_0x4799('0x1'))(_0x4799('0x2'));var moment=require(_0x4799('0x3'));var BPromise=require(_0x4799('0x4'));var rp=require(_0x4799('0x5'));var fs=require('fs');var path=require(_0x4799('0x6'));var rimraf=require(_0x4799('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x4799('0x8')]=function(_0x130941,_0x1c25e9){return _0x130941[_0x4799('0x9')](_0x4799('0xa'),attributes,{'tableName':_0x4799('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2086=['moment','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x3a6922,_0xc728be){var _0x9c1b44=function(_0x4ffb5e){while(--_0x4ffb5e){_0x3a6922['push'](_0x3a6922['shift']());}};_0x9c1b44(++_0xc728be);}(_0x2086,0x1c4));var _0x6208=function(_0x112a34,_0x5cf88f){_0x112a34=_0x112a34-0x0;var _0x1e64ba=_0x2086[_0x112a34];return _0x1e64ba;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require('bluebird');var rp=require(_0x6208('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6208('0x6'));var config=require(_0x6208('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x6208('0x8')]=function(_0x5ad8ae,_0x4165b8){return _0x5ad8ae[_0x6208('0x9')](_0x6208('0xa'),attributes,{'tableName':_0x6208('0xb'),'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 d8cefbc..414f40c 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 _0x850d=['register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x6d59c3,_0x54a10e){var _0x3d65f2=function(_0x55c25a){while(--_0x55c25a){_0x6d59c3['push'](_0x6d59c3['shift']());}};_0x3d65f2(++_0x54a10e);}(_0x850d,0x140));var _0xd850=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x850d[_0x31c5e9];return _0x517a8d;};'use strict';var _=require(_0xd850('0x0'));var util=require(_0xd850('0x1'));var moment=require('moment');var BPromise=require(_0xd850('0x2'));var rs=require(_0xd850('0x3'));var fs=require('fs');var Redis=require(_0xd850('0x4'));var db=require(_0xd850('0x5'))['db'];var utils=require(_0xd850('0x6'));var logger=require('../../config/logger')(_0xd850('0x7'));var config=require(_0xd850('0x8'));var jayson=require(_0xd850('0x9'));var client=jayson[_0xd850('0xa')][_0xd850('0xb')]({'port':0x232a});config[_0xd850('0xc')]=_['defaults'](config['redis'],{'host':_0xd850('0xd'),'port':0x18eb});var socket=require(_0xd850('0xe'))(new Redis(config[_0xd850('0xc')]));require(_0xd850('0xf'))[_0xd850('0x10')](socket);function respondWithRpcPromise(_0x381654,_0x342752,_0x200662){return new BPromise(function(_0x4df000,_0x46ea72){return client[_0xd850('0x11')](_0x381654,_0x200662)[_0xd850('0x12')](function(_0x2bde04){logger[_0xd850('0x13')](_0xd850('0x14'),_0x342752,_0xd850('0x15'));logger[_0xd850('0x16')](_0xd850('0x17'),_0x342752,_0xd850('0x15'),JSON[_0xd850('0x18')](_0x2bde04));if(_0x2bde04[_0xd850('0x19')]){if(_0x2bde04['error']['code']===0x1f4){logger[_0xd850('0x19')](_0xd850('0x14'),_0x342752,_0x2bde04[_0xd850('0x19')][_0xd850('0x1a')]);return _0x46ea72(_0x2bde04[_0xd850('0x19')][_0xd850('0x1a')]);}logger['error'](_0xd850('0x14'),_0x342752,_0x2bde04['error'][_0xd850('0x1a')]);return _0x4df000(_0x2bde04[_0xd850('0x19')]['message']);}else{logger[_0xd850('0x13')](_0xd850('0x14'),_0x342752,_0xd850('0x15'));_0x4df000(_0x2bde04['result']['message']);}})[_0xd850('0x1b')](function(_0x174226){logger[_0xd850('0x19')](_0xd850('0x14'),_0x342752,_0x174226);_0x46ea72(_0x174226);});});} \ No newline at end of file +var _0x057c=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x057c,0x1ac));var _0xc057=function(_0x51f854,_0x5208a3){_0x51f854=_0x51f854-0x0;var _0x2611f2=_0x057c[_0x51f854];return _0x2611f2;};'use strict';var _=require(_0xc057('0x0'));var util=require(_0xc057('0x1'));var moment=require(_0xc057('0x2'));var BPromise=require(_0xc057('0x3'));var rs=require(_0xc057('0x4'));var fs=require('fs');var Redis=require(_0xc057('0x5'));var db=require(_0xc057('0x6'))['db'];var utils=require(_0xc057('0x7'));var logger=require('../../config/logger')(_0xc057('0x8'));var config=require('../../config/environment');var jayson=require(_0xc057('0x9'));var client=jayson[_0xc057('0xa')][_0xc057('0xb')]({'port':0x232a});config[_0xc057('0xc')]=_[_0xc057('0xd')](config[_0xc057('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc057('0xe'))(new Redis(config[_0xc057('0xc')]));require(_0xc057('0xf'))['register'](socket);function respondWithRpcPromise(_0x324c36,_0x4b27a0,_0x43959f){return new BPromise(function(_0x49304d,_0x3d2ac3){return client[_0xc057('0x10')](_0x324c36,_0x43959f)[_0xc057('0x11')](function(_0xd40a7c){logger[_0xc057('0x12')](_0xc057('0x13'),_0x4b27a0,_0xc057('0x14'));logger[_0xc057('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4b27a0,'request\x20sent',JSON[_0xc057('0x16')](_0xd40a7c));if(_0xd40a7c[_0xc057('0x17')]){if(_0xd40a7c[_0xc057('0x17')][_0xc057('0x18')]===0x1f4){logger[_0xc057('0x17')](_0xc057('0x13'),_0x4b27a0,_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);return _0x3d2ac3(_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);}logger[_0xc057('0x17')]('DashboardItem,\x20%s,\x20%s',_0x4b27a0,_0xd40a7c[_0xc057('0x17')][_0xc057('0x19')]);return _0x49304d(_0xd40a7c[_0xc057('0x17')]['message']);}else{logger[_0xc057('0x12')](_0xc057('0x13'),_0x4b27a0,'request\x20sent');_0x49304d(_0xd40a7c[_0xc057('0x1a')]['message']);}})[_0xc057('0x1b')](function(_0x1b3f71){logger[_0xc057('0x17')](_0xc057('0x13'),_0x4b27a0,_0x1b3f71);_0x3d2ac3(_0x1b3f71);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 9a77564..a247c07 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 _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x4b7c10,_0x28ad51){var _0x12b39e=function(_0x3b47ff){while(--_0x3b47ff){_0x4b7c10['push'](_0x4b7c10['shift']());}};_0x12b39e(++_0x28ad51);}(_0xedd9,0xfc));var _0x9edd=function(_0x539d06,_0x26277d){_0x539d06=_0x539d06-0x0;var _0x2f178a=_0xedd9[_0x539d06];return _0x2f178a;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x26bede,_0x52421f){var _0x42a1b6=function(_0x482003){while(--_0x482003){_0x26bede['push'](_0x26bede['shift']());}};_0x42a1b6(++_0x52421f);}(_0xedd9,0xfc));var _0x9edd=function(_0x18d945,_0x11e617){_0x18d945=_0x18d945-0x0;var _0x44328b=_0xedd9[_0x18d945];return _0x44328b;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d987514..b8eba71 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 _0xbb4c=['/:id','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','create','put','update','delete'];(function(_0x5d9272,_0x15f0b2){var _0x433599=function(_0xfe17d4){while(--_0xfe17d4){_0x5d9272['push'](_0x5d9272['shift']());}};_0x433599(++_0x15f0b2);}(_0xbb4c,0x1a6));var _0xcbb4=function(_0x3f06be,_0x39f208){_0x3f06be=_0x3f06be-0x0;var _0x54680=_0xbb4c[_0x3f06be];return _0x54680;};'use strict';var multer=require('multer');var util=require(_0xcbb4('0x0'));var path=require(_0xcbb4('0x1'));var timeout=require(_0xcbb4('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xcbb4('0x3'));var interaction=require(_0xcbb4('0x4'));var config=require(_0xcbb4('0x5'));var controller=require('./dashboardItem.controller');router[_0xcbb4('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcbb4('0x7')](),controller[_0xcbb4('0x8')]);router[_0xcbb4('0x9')]('/:id',auth[_0xcbb4('0x7')](),controller[_0xcbb4('0xa')]);router[_0xcbb4('0xb')](_0xcbb4('0xc'),auth[_0xcbb4('0x7')](),controller[_0xcbb4('0xd')]);module['exports']=router; \ No newline at end of file +var _0x1956=['post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1956,0x194));var _0x6195=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x1956[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0x6195('0x0'));var util=require(_0x6195('0x1'));var path=require(_0x6195('0x2'));var timeout=require(_0x6195('0x3'));var express=require(_0x6195('0x4'));var router=express[_0x6195('0x5')]();var auth=require(_0x6195('0x6'));var interaction=require(_0x6195('0x7'));var config=require(_0x6195('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0x6195('0x9'),auth[_0x6195('0xa')](),controller[_0x6195('0xb')]);router[_0x6195('0xc')]('/',auth[_0x6195('0xa')](),controller[_0x6195('0xd')]);router[_0x6195('0xe')](_0x6195('0x9'),auth['isAuthenticated'](),controller[_0x6195('0xf')]);router['delete'](_0x6195('0x9'),auth[_0x6195('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8e2e02d..294e336 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 _0xc48b=['sequelize','exports'];(function(_0x408c20,_0x1501e4){var _0x21a450=function(_0x542f2a){while(--_0x542f2a){_0x408c20['push'](_0x408c20['shift']());}};_0x21a450(++_0x1501e4);}(_0xc48b,0x12a));var _0xbc48=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xc48b[_0x251d9c];return _0x16ae64;};'use strict';var Sequelize=require(_0xbc48('0x0'));module[_0xbc48('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3d9f=['sequelize','exports'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x3d9f,0x152));var _0xf3d9=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3d9f[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xf3d9('0x0'));module[_0xf3d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 68b9c44..6b56145 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 _0x491d=['mustache','util','path','sox','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','sendStatus','error','stack','name','send','index','Disposition','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x36756a,_0x3d1aec){var _0x151212=function(_0x2c8102){while(--_0x2c8102){_0x36756a['push'](_0x36756a['shift']());}};_0x151212(++_0x3d1aec);}(_0x491d,0xe6));var _0xd491=function(_0x44610b,_0x34693f){_0x44610b=_0x44610b-0x0;var _0x88c632=_0x491d[_0x44610b];return _0x88c632;};'use strict';var pdf=require(_0xd491('0x0'));var emlformat=require(_0xd491('0x1'));var rimraf=require(_0xd491('0x2'));var zipdir=require(_0xd491('0x3'));var jsonpatch=require(_0xd491('0x4'));var rp=require('request-promise');var moment=require(_0xd491('0x5'));var BPromise=require(_0xd491('0x6'));var Mustache=require(_0xd491('0x7'));var util=require(_0xd491('0x8'));var path=require(_0xd491('0x9'));var sox=require(_0xd491('0xa'));var csv=require('to-csv');var ejs=require(_0xd491('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd491('0xc'));var crypto=require('crypto');var jsforce=require(_0xd491('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd491('0xe'));var Papa=require(_0xd491('0xf'));var Redis=require('ioredis');var authService=require(_0xd491('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd491('0x11'))(_0xd491('0x12'));var utils=require(_0xd491('0x13'));var config=require(_0xd491('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x579c67,_0x3c86e1){_0x3c86e1=_0x3c86e1||0xcc;return function(_0x9fae9c){if(_0x9fae9c){return _0x579c67['sendStatus'](_0x3c86e1);}return _0x579c67['status'](_0x3c86e1)[_0xd491('0x15')]();};}function respondWithResult(_0x5bf73b,_0x2f0b9d){_0x2f0b9d=_0x2f0b9d||0xc8;return function(_0x1d5604){if(_0x1d5604){return _0x5bf73b[_0xd491('0x16')](_0x2f0b9d)[_0xd491('0x17')](_0x1d5604);}};}function respondWithFilteredResult(_0xe20fb,_0x57cb0d){return function(_0x39bbfb){if(_0x39bbfb){var _0x8101a6=_0x39bbfb[_0xd491('0x18')],_0x49b919=_0x57cb0d['offset'],_0x47cd3d=_0x57cb0d[_0xd491('0x19')]+_0x57cb0d[_0xd491('0x1a')],_0x4ac740;if(_0x47cd3d>=_0x8101a6){_0x47cd3d=_0x8101a6;_0x4ac740=0xc8;}else{_0x4ac740=0xce;}_0xe20fb[_0xd491('0x16')](_0x4ac740);return _0xe20fb[_0xd491('0x1b')](_0xd491('0x1c'),_0x49b919+'-'+_0x47cd3d+'/'+_0x8101a6)[_0xd491('0x17')](_0x39bbfb);}return null;};}function patchUpdates(_0x2df0b5){return function(_0x283230){try{jsonpatch[_0xd491('0x1d')](_0x283230,_0x2df0b5,!![]);}catch(_0x3a19cd){return BPromise[_0xd491('0x1e')](_0x3a19cd);}return _0x283230[_0xd491('0x1f')]();};}function saveUpdates(_0x229e35,_0x26cbfa){return function(_0x4cf467){if(_0x4cf467){return _0x4cf467[_0xd491('0x20')](_0x229e35)[_0xd491('0x21')](function(_0x31d975){return _0x31d975;});}return null;};}function removeEntity(_0x1fa90f,_0x31f08b){return function(_0x66414){if(_0x66414){return _0x66414[_0xd491('0x22')]()[_0xd491('0x21')](function(){var _0x8bf6f4=_0x66414[_0xd491('0x23')]({'plain':!![]});var _0x44288d=_0xd491('0x24');return db['UserProfileResource'][_0xd491('0x22')]({'where':{'type':_0x44288d,'resourceId':_0x8bf6f4['id']}})['then'](function(){return _0x66414;});})[_0xd491('0x21')](function(){_0x1fa90f[_0xd491('0x16')](0xcc)[_0xd491('0x15')]();});}};}function handleEntityNotFound(_0x5c645a,_0xf79c36){return function(_0x1c7d54){if(!_0x1c7d54){_0x5c645a[_0xd491('0x25')](0x194);}return _0x1c7d54;};}function handleError(_0x32356a,_0x4cb75a){_0x4cb75a=_0x4cb75a||0x1f4;return function(_0x3adb4a){logger[_0xd491('0x26')](_0x3adb4a[_0xd491('0x27')]);if(_0x3adb4a[_0xd491('0x28')]){delete _0x3adb4a['name'];}_0x32356a[_0xd491('0x16')](_0x4cb75a)[_0xd491('0x29')](_0x3adb4a);};}exports[_0xd491('0x2a')]=function(_0x3b3d38,_0x3aaa0b){var _0x49b0d7={},_0x45e378={},_0xabba59={'count':0x0,'rows':[]};var _0x4a31b1=db[_0xd491('0x2b')][_0xd491('0x2c')];_0x45e378[_0xd491('0x2d')]=_[_0xd491('0x2e')](_0x4a31b1);_0x45e378[_0xd491('0x2f')]=_[_0xd491('0x2e')](_0x3b3d38[_0xd491('0x2f')]);_0x45e378[_0xd491('0x30')]=_[_0xd491('0x31')](_0x45e378[_0xd491('0x2d')],_0x45e378[_0xd491('0x2f')]);_0x49b0d7[_0xd491('0x32')]=_['intersection'](_0x45e378[_0xd491('0x2d')],qs[_0xd491('0x33')](_0x3b3d38['query'][_0xd491('0x33')]));_0x49b0d7['attributes']=_0x49b0d7['attributes'][_0xd491('0x34')]?_0x49b0d7[_0xd491('0x32')]:_0x45e378[_0xd491('0x2d')];if(!_0x3b3d38[_0xd491('0x2f')][_0xd491('0x35')](_0xd491('0x36'))){_0x49b0d7[_0xd491('0x1a')]=qs[_0xd491('0x1a')](_0x3b3d38[_0xd491('0x2f')]['limit']);_0x49b0d7[_0xd491('0x19')]=qs[_0xd491('0x19')](_0x3b3d38[_0xd491('0x2f')][_0xd491('0x19')]);}_0x49b0d7[_0xd491('0x37')]=qs[_0xd491('0x38')](_0x3b3d38[_0xd491('0x2f')][_0xd491('0x38')]);_0x49b0d7[_0xd491('0x39')]=qs[_0xd491('0x30')](_[_0xd491('0x3a')](_0x3b3d38[_0xd491('0x2f')],_0x45e378[_0xd491('0x30')]));if(_0x3b3d38['query'][_0xd491('0x3b')]){_0x49b0d7['where']=_[_0xd491('0x3c')](_0x49b0d7[_0xd491('0x39')],{'$or':_[_0xd491('0x3d')](_0x4a31b1,function(_0x22e6a6){if(_0x22e6a6['type'][_0xd491('0x3e')]!=='VIRTUAL'){var _0x57ef8a={};_0x57ef8a[_0x22e6a6[_0xd491('0x3f')]]={'$like':'%'+_0x3b3d38[_0xd491('0x2f')][_0xd491('0x3b')]+'%'};return _0x57ef8a;}})});}_0x49b0d7=_[_0xd491('0x3c')]({},_0x49b0d7,_0x3b3d38[_0xd491('0x40')]);var _0x33715e={'where':_0x49b0d7[_0xd491('0x39')]};return db[_0xd491('0x2b')]['count'](_0x33715e)[_0xd491('0x21')](function(_0x1574af){_0xabba59['count']=_0x1574af;if(_0x3b3d38[_0xd491('0x2f')][_0xd491('0x41')]){_0x49b0d7['include']=[{'all':!![]}];}return db[_0xd491('0x2b')][_0xd491('0x42')](_0x49b0d7);})[_0xd491('0x21')](function(_0x23a589){_0xabba59['rows']=_0x23a589;return _0xabba59;})['then'](respondWithFilteredResult(_0x3aaa0b,_0x49b0d7))[_0xd491('0x43')](handleError(_0x3aaa0b,null));};exports[_0xd491('0x44')]=function(_0x8f341d,_0x455ee2){var _0x5197ae={'raw':!![],'where':{'id':_0x8f341d['params']['id']}},_0x32489f={};_0x32489f[_0xd491('0x2d')]=_[_0xd491('0x2e')](db[_0xd491('0x2b')][_0xd491('0x2c')]);_0x32489f[_0xd491('0x2f')]=_[_0xd491('0x2e')](_0x8f341d[_0xd491('0x2f')]);_0x32489f[_0xd491('0x30')]=_[_0xd491('0x31')](_0x32489f[_0xd491('0x2d')],_0x32489f[_0xd491('0x2f')]);_0x5197ae['attributes']=_[_0xd491('0x31')](_0x32489f['model'],qs[_0xd491('0x33')](_0x8f341d['query']['fields']));_0x5197ae[_0xd491('0x32')]=_0x5197ae[_0xd491('0x32')]['length']?_0x5197ae[_0xd491('0x32')]:_0x32489f[_0xd491('0x2d')];if(_0x8f341d[_0xd491('0x2f')]['includeAll']){_0x5197ae[_0xd491('0x45')]=[{'all':!![]}];}_0x5197ae=_['merge']({},_0x5197ae,_0x8f341d[_0xd491('0x40')]);return db['Disposition'][_0xd491('0x46')](_0x5197ae)['then'](handleEntityNotFound(_0x455ee2,null))[_0xd491('0x21')](respondWithResult(_0x455ee2,null))[_0xd491('0x43')](handleError(_0x455ee2,null));};exports[_0xd491('0x47')]=function(_0x223b62,_0x1456c8){return db[_0xd491('0x2b')][_0xd491('0x47')](_0x223b62[_0xd491('0x48')],{})[_0xd491('0x21')](function(_0x36fa2d){var _0x51ec94=_0x223b62[_0xd491('0x49')][_0xd491('0x23')]({'plain':!![]});if(!_0x51ec94)throw new Error(_0xd491('0x4a'));if(_0x51ec94[_0xd491('0x4b')]==='user'){var _0x23000a=_0x36fa2d[_0xd491('0x23')]({'plain':!![]});var _0x1e41d2=_0xd491('0x24');return db[_0xd491('0x4c')][_0xd491('0x46')]({'where':{'name':_0x1e41d2,'userProfileId':_0x51ec94['userProfileId']},'raw':!![]})[_0xd491('0x21')](function(_0x3a8caf){if(_0x3a8caf&&_0x3a8caf[_0xd491('0x4d')]===0x0){return db[_0xd491('0x4e')][_0xd491('0x47')]({'name':_0x23000a['name'],'resourceId':_0x23000a['id'],'type':_0x3a8caf[_0xd491('0x28')],'sectionId':_0x3a8caf['id']},{})[_0xd491('0x21')](function(){return _0x36fa2d;});}else{return _0x36fa2d;}})[_0xd491('0x43')](function(_0x3d5b44){logger[_0xd491('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5b44);throw _0x3d5b44;});}return _0x36fa2d;})[_0xd491('0x21')](respondWithResult(_0x1456c8,0xc9))[_0xd491('0x43')](handleError(_0x1456c8,null));};exports[_0xd491('0x20')]=function(_0x242c07,_0x2de774){if(_0x242c07[_0xd491('0x48')]['id']){delete _0x242c07[_0xd491('0x48')]['id'];}return db['Disposition'][_0xd491('0x46')]({'where':{'id':_0x242c07['params']['id']}})['then'](handleEntityNotFound(_0x2de774,null))[_0xd491('0x21')](saveUpdates(_0x242c07['body'],null))[_0xd491('0x21')](respondWithResult(_0x2de774,null))[_0xd491('0x43')](handleError(_0x2de774,null));};exports['destroy']=function(_0x5446ef,_0x7c8113){return db[_0xd491('0x2b')][_0xd491('0x46')]({'where':{'id':_0x5446ef['params']['id']}})['then'](handleEntityNotFound(_0x7c8113,null))['then'](removeEntity(_0x7c8113,null))[_0xd491('0x43')](handleError(_0x7c8113,null));}; \ No newline at end of file +var _0x6d67=['options','rows','show','params','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','Disposition','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0x25948f,_0x4ac7e4){var _0x2b1976=function(_0x1ee63a){while(--_0x1ee63a){_0x25948f['push'](_0x25948f['shift']());}};_0x2b1976(++_0x4ac7e4);}(_0x6d67,0xb5));var _0x76d6=function(_0x5b7468,_0x2f21c7){_0x5b7468=_0x5b7468-0x0;var _0x466de5=_0x6d67[_0x5b7468];return _0x466de5;};'use strict';var pdf=require(_0x76d6('0x0'));var emlformat=require(_0x76d6('0x1'));var rimraf=require(_0x76d6('0x2'));var zipdir=require(_0x76d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76d6('0x4'));var moment=require(_0x76d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x76d6('0x6'));var util=require('util');var path=require(_0x76d6('0x7'));var sox=require(_0x76d6('0x8'));var csv=require(_0x76d6('0x9'));var ejs=require(_0x76d6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x76d6('0xb'));var crypto=require(_0x76d6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x76d6('0xd'));var toCsv=require(_0x76d6('0x9'));var querystring=require(_0x76d6('0xe'));var Papa=require('papaparse');var Redis=require(_0x76d6('0xf'));var authService=require(_0x76d6('0x10'));var qs=require(_0x76d6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76d6('0x12'))(_0x76d6('0x13'));var utils=require('../../config/utils');var config=require(_0x76d6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26addd,_0x283a1b){_0x283a1b=_0x283a1b||0xcc;return function(_0x1efab5){if(_0x1efab5){return _0x26addd['sendStatus'](_0x283a1b);}return _0x26addd[_0x76d6('0x15')](_0x283a1b)[_0x76d6('0x16')]();};}function respondWithResult(_0x40ea91,_0x556472){_0x556472=_0x556472||0xc8;return function(_0x4ae7ff){if(_0x4ae7ff){return _0x40ea91[_0x76d6('0x15')](_0x556472)['json'](_0x4ae7ff);}};}function respondWithFilteredResult(_0x78b44b,_0x17ba38){return function(_0x19614f){if(_0x19614f){var _0x3fb191=_0x19614f[_0x76d6('0x17')],_0x31fab4=_0x17ba38[_0x76d6('0x18')],_0x1d07b0=_0x17ba38[_0x76d6('0x18')]+_0x17ba38[_0x76d6('0x19')],_0x565e3d;if(_0x1d07b0>=_0x3fb191){_0x1d07b0=_0x3fb191;_0x565e3d=0xc8;}else{_0x565e3d=0xce;}_0x78b44b[_0x76d6('0x15')](_0x565e3d);return _0x78b44b['set'](_0x76d6('0x1a'),_0x31fab4+'-'+_0x1d07b0+'/'+_0x3fb191)[_0x76d6('0x1b')](_0x19614f);}return null;};}function patchUpdates(_0x571216){return function(_0x39c385){try{jsonpatch[_0x76d6('0x1c')](_0x39c385,_0x571216,!![]);}catch(_0x5bc83a){return BPromise[_0x76d6('0x1d')](_0x5bc83a);}return _0x39c385[_0x76d6('0x1e')]();};}function saveUpdates(_0x188bc3,_0x4c6e40){return function(_0x357687){if(_0x357687){return _0x357687[_0x76d6('0x1f')](_0x188bc3)[_0x76d6('0x20')](function(_0x280f8e){return _0x280f8e;});}return null;};}function removeEntity(_0x5192cf,_0x5b193f){return function(_0x5ae029){if(_0x5ae029){return _0x5ae029[_0x76d6('0x21')]()[_0x76d6('0x20')](function(){var _0x4505dc=_0x5ae029[_0x76d6('0x22')]({'plain':!![]});var _0x4c66bf=_0x76d6('0x23');return db[_0x76d6('0x24')][_0x76d6('0x21')]({'where':{'type':_0x4c66bf,'resourceId':_0x4505dc['id']}})['then'](function(){return _0x5ae029;});})[_0x76d6('0x20')](function(){_0x5192cf[_0x76d6('0x15')](0xcc)[_0x76d6('0x16')]();});}};}function handleEntityNotFound(_0x3c4f4a,_0x122a4f){return function(_0x928f4){if(!_0x928f4){_0x3c4f4a[_0x76d6('0x25')](0x194);}return _0x928f4;};}function handleError(_0x6423e7,_0x1b5045){_0x1b5045=_0x1b5045||0x1f4;return function(_0x472ebd){logger[_0x76d6('0x26')](_0x472ebd['stack']);if(_0x472ebd[_0x76d6('0x27')]){delete _0x472ebd[_0x76d6('0x27')];}_0x6423e7['status'](_0x1b5045)[_0x76d6('0x28')](_0x472ebd);};}exports[_0x76d6('0x29')]=function(_0x399500,_0x9592ba){var _0x4eeaa7={},_0x42a6a8={},_0x519724={'count':0x0,'rows':[]};var _0x4313f9=db[_0x76d6('0x2a')][_0x76d6('0x2b')];_0x42a6a8['model']=_[_0x76d6('0x2c')](_0x4313f9);_0x42a6a8[_0x76d6('0x2d')]=_[_0x76d6('0x2c')](_0x399500['query']);_0x42a6a8['filters']=_[_0x76d6('0x2e')](_0x42a6a8['model'],_0x42a6a8[_0x76d6('0x2d')]);_0x4eeaa7[_0x76d6('0x2f')]=_['intersection'](_0x42a6a8[_0x76d6('0x30')],qs[_0x76d6('0x31')](_0x399500['query']['fields']));_0x4eeaa7[_0x76d6('0x2f')]=_0x4eeaa7[_0x76d6('0x2f')][_0x76d6('0x32')]?_0x4eeaa7[_0x76d6('0x2f')]:_0x42a6a8[_0x76d6('0x30')];if(!_0x399500[_0x76d6('0x2d')][_0x76d6('0x33')](_0x76d6('0x34'))){_0x4eeaa7[_0x76d6('0x19')]=qs[_0x76d6('0x19')](_0x399500[_0x76d6('0x2d')][_0x76d6('0x19')]);_0x4eeaa7['offset']=qs[_0x76d6('0x18')](_0x399500[_0x76d6('0x2d')]['offset']);}_0x4eeaa7[_0x76d6('0x35')]=qs['sort'](_0x399500['query'][_0x76d6('0x36')]);_0x4eeaa7[_0x76d6('0x37')]=qs[_0x76d6('0x38')](_[_0x76d6('0x39')](_0x399500['query'],_0x42a6a8[_0x76d6('0x38')]));if(_0x399500['query'][_0x76d6('0x3a')]){_0x4eeaa7[_0x76d6('0x37')]=_[_0x76d6('0x3b')](_0x4eeaa7[_0x76d6('0x37')],{'$or':_[_0x76d6('0x3c')](_0x4313f9,function(_0x389235){if(_0x389235[_0x76d6('0x3d')][_0x76d6('0x3e')]!==_0x76d6('0x3f')){var _0x5cafbd={};_0x5cafbd[_0x389235[_0x76d6('0x40')]]={'$like':'%'+_0x399500['query'][_0x76d6('0x3a')]+'%'};return _0x5cafbd;}})});}_0x4eeaa7=_['merge']({},_0x4eeaa7,_0x399500[_0x76d6('0x41')]);var _0x3ecba6={'where':_0x4eeaa7[_0x76d6('0x37')]};return db['Disposition'][_0x76d6('0x17')](_0x3ecba6)['then'](function(_0x4cde9e){_0x519724[_0x76d6('0x17')]=_0x4cde9e;if(_0x399500[_0x76d6('0x2d')]['includeAll']){_0x4eeaa7['include']=[{'all':!![]}];}return db[_0x76d6('0x2a')]['findAll'](_0x4eeaa7);})['then'](function(_0x5e70d7){_0x519724[_0x76d6('0x42')]=_0x5e70d7;return _0x519724;})['then'](respondWithFilteredResult(_0x9592ba,_0x4eeaa7))['catch'](handleError(_0x9592ba,null));};exports[_0x76d6('0x43')]=function(_0x45c7df,_0x492829){var _0x94f953={'raw':!![],'where':{'id':_0x45c7df[_0x76d6('0x44')]['id']}},_0x5878ea={};_0x5878ea[_0x76d6('0x30')]=_[_0x76d6('0x2c')](db[_0x76d6('0x2a')][_0x76d6('0x2b')]);_0x5878ea[_0x76d6('0x2d')]=_[_0x76d6('0x2c')](_0x45c7df['query']);_0x5878ea[_0x76d6('0x38')]=_['intersection'](_0x5878ea['model'],_0x5878ea[_0x76d6('0x2d')]);_0x94f953[_0x76d6('0x2f')]=_[_0x76d6('0x2e')](_0x5878ea['model'],qs['fields'](_0x45c7df[_0x76d6('0x2d')][_0x76d6('0x31')]));_0x94f953[_0x76d6('0x2f')]=_0x94f953['attributes']['length']?_0x94f953['attributes']:_0x5878ea[_0x76d6('0x30')];if(_0x45c7df[_0x76d6('0x2d')][_0x76d6('0x45')]){_0x94f953[_0x76d6('0x46')]=[{'all':!![]}];}_0x94f953=_[_0x76d6('0x3b')]({},_0x94f953,_0x45c7df[_0x76d6('0x41')]);return db[_0x76d6('0x2a')][_0x76d6('0x47')](_0x94f953)[_0x76d6('0x20')](handleEntityNotFound(_0x492829,null))['then'](respondWithResult(_0x492829,null))[_0x76d6('0x48')](handleError(_0x492829,null));};exports['create']=function(_0x29a0da,_0x571005){return db[_0x76d6('0x2a')][_0x76d6('0x49')](_0x29a0da['body'],{})[_0x76d6('0x20')](function(_0x810099){var _0xa55b64=_0x29a0da[_0x76d6('0x4a')][_0x76d6('0x22')]({'plain':!![]});if(!_0xa55b64)throw new Error(_0x76d6('0x4b'));if(_0xa55b64[_0x76d6('0x4c')]===_0x76d6('0x4a')){var _0x2e6125=_0x810099[_0x76d6('0x22')]({'plain':!![]});var _0x538868=_0x76d6('0x23');return db[_0x76d6('0x4d')][_0x76d6('0x47')]({'where':{'name':_0x538868,'userProfileId':_0xa55b64[_0x76d6('0x4e')]},'raw':!![]})[_0x76d6('0x20')](function(_0x260a26){if(_0x260a26&&_0x260a26[_0x76d6('0x4f')]===0x0){return db[_0x76d6('0x24')][_0x76d6('0x49')]({'name':_0x2e6125[_0x76d6('0x27')],'resourceId':_0x2e6125['id'],'type':_0x260a26[_0x76d6('0x27')],'sectionId':_0x260a26['id']},{})[_0x76d6('0x20')](function(){return _0x810099;});}else{return _0x810099;}})['catch'](function(_0x5273ce){logger[_0x76d6('0x26')](_0x76d6('0x50'),_0x5273ce);throw _0x5273ce;});}return _0x810099;})[_0x76d6('0x20')](respondWithResult(_0x571005,0xc9))[_0x76d6('0x48')](handleError(_0x571005,null));};exports['update']=function(_0x4c9a40,_0x5530e3){if(_0x4c9a40[_0x76d6('0x51')]['id']){delete _0x4c9a40['body']['id'];}return db['Disposition'][_0x76d6('0x47')]({'where':{'id':_0x4c9a40[_0x76d6('0x44')]['id']}})[_0x76d6('0x20')](handleEntityNotFound(_0x5530e3,null))[_0x76d6('0x20')](saveUpdates(_0x4c9a40[_0x76d6('0x51')],null))[_0x76d6('0x20')](respondWithResult(_0x5530e3,null))[_0x76d6('0x48')](handleError(_0x5530e3,null));};exports[_0x76d6('0x21')]=function(_0x131335,_0x2e4040){return db[_0x76d6('0x2a')][_0x76d6('0x47')]({'where':{'id':_0x131335[_0x76d6('0x44')]['id']}})[_0x76d6('0x20')](handleEntityNotFound(_0x2e4040,null))[_0x76d6('0x20')](removeEntity(_0x2e4040,null))['catch'](handleError(_0x2e4040,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 7a4ad74..25eafe8 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 _0xdaee=['tools_dispositions','name_voice','name','ListId','name_chat','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition'];(function(_0x7c9f34,_0x134666){var _0x2d93d1=function(_0x546121){while(--_0x546121){_0x7c9f34['push'](_0x7c9f34['shift']());}};_0x2d93d1(++_0x134666);}(_0xdaee,0x164));var _0xedae=function(_0xdc29c7,_0x32e24a){_0xdc29c7=_0xdc29c7-0x0;var _0x7388a2=_0xdaee[_0xdc29c7];return _0x7388a2;};'use strict';var _=require(_0xedae('0x0'));var util=require(_0xedae('0x1'));var logger=require(_0xedae('0x2'))(_0xedae('0x3'));var moment=require(_0xedae('0x4'));var BPromise=require(_0xedae('0x5'));var rp=require(_0xedae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedae('0x7'));var config=require('../../config/environment');var attributes=require(_0xedae('0x8'));module[_0xedae('0x9')]=function(_0x349d78,_0x1f11b9){return _0x349d78[_0xedae('0xa')](_0xedae('0xb'),attributes,{'tableName':_0xedae('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xedae('0xd'),'fields':[_0xedae('0xe'),_0xedae('0xf')]},{'unique':!![],'name':_0xedae('0x10'),'fields':[_0xedae('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xedae('0x11'),'fields':[_0xedae('0xe'),'MailAccountId']},{'unique':!![],'name':_0xedae('0x12'),'fields':['name',_0xedae('0x13')]},{'unique':!![],'name':_0xedae('0x14'),'fields':[_0xedae('0xe'),_0xedae('0x15')]},{'unique':!![],'name':_0xedae('0x16'),'fields':[_0xedae('0xe'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe097=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./disposition.attributes','define','Disposition','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x54f0d6,_0x542e24){var _0x16313e=function(_0x228122){while(--_0x228122){_0x54f0d6['push'](_0x54f0d6['shift']());}};_0x16313e(++_0x542e24);}(_0xe097,0x1b9));var _0x7e09=function(_0x479466,_0x3e9b31){_0x479466=_0x479466-0x0;var _0xb5cee9=_0xe097[_0x479466];return _0xb5cee9;};'use strict';var _=require(_0x7e09('0x0'));var util=require(_0x7e09('0x1'));var logger=require(_0x7e09('0x2'))(_0x7e09('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7e09('0x4'));var fs=require('fs');var path=require(_0x7e09('0x5'));var rimraf=require('rimraf');var config=require(_0x7e09('0x6'));var attributes=require(_0x7e09('0x7'));module['exports']=function(_0x279f56,_0x1f0449){return _0x279f56[_0x7e09('0x8')](_0x7e09('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x7e09('0xa'),'fields':[_0x7e09('0xb'),_0x7e09('0xc')]},{'unique':!![],'name':_0x7e09('0xd'),'fields':[_0x7e09('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x7e09('0xe'),'fields':[_0x7e09('0xb'),_0x7e09('0xf')]},{'unique':!![],'name':_0x7e09('0x10'),'fields':[_0x7e09('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x7e09('0x11'),'fields':[_0x7e09('0xb'),_0x7e09('0x12')]},{'unique':!![],'name':_0x7e09('0x13'),'fields':[_0x7e09('0xb'),_0x7e09('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d93e08e..ab4d223 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Disposition,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3fe476,_0x31755a){var _0x5b3b8c=function(_0x511b54){while(--_0x511b54){_0x3fe476['push'](_0x3fe476['shift']());}};_0x5b3b8c(++_0x31755a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x5fc3[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Disposition,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x99c9=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x199d99,_0x48eb55){var _0x3ff508=function(_0x33a888){while(--_0x33a888){_0x199d99['push'](_0x199d99['shift']());}};_0x3ff508(++_0x48eb55);}(_0x99c9,0x13c));var _0x999c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x99c9[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));var BPromise=require(_0x999c('0x3'));var rs=require(_0x999c('0x4'));var fs=require('fs');var Redis=require(_0x999c('0x5'));var db=require(_0x999c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x999c('0x7'))(_0x999c('0x8'));var config=require(_0x999c('0x9'));var jayson=require(_0x999c('0xa'));var client=jayson[_0x999c('0xb')][_0x999c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34f100,_0x651b7e,_0xc8a6b5){return new BPromise(function(_0xb88ec1,_0x329252){return client[_0x999c('0xd')](_0x34f100,_0xc8a6b5)[_0x999c('0xe')](function(_0x395321){logger['info'](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));logger['debug'](_0x999c('0x11'),_0x651b7e,_0x999c('0x10'),JSON[_0x999c('0x12')](_0x395321));if(_0x395321[_0x999c('0x13')]){if(_0x395321[_0x999c('0x13')][_0x999c('0x14')]===0x1f4){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')][_0x999c('0x15')]);return _0x329252(_0x395321[_0x999c('0x13')][_0x999c('0x15')]);}logger['error'](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')]['message']);return _0xb88ec1(_0x395321['error']['message']);}else{logger[_0x999c('0x16')](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));_0xb88ec1(_0x395321[_0x999c('0x17')][_0x999c('0x15')]);}})['catch'](function(_0x226437){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x226437);_0x329252(_0x226437);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index d8f97dc..1b17cc0 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 _0x42e1=['get','isAuthenticated','index','show','put','update','/:id','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1a8d7b,_0x23bf63){var _0x338c60=function(_0x1a69fb){while(--_0x1a69fb){_0x1a8d7b['push'](_0x1a8d7b['shift']());}};_0x338c60(++_0x23bf63);}(_0x42e1,0x1dd));var _0x142e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x42e1[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x142e('0x0'));var path=require('path');var timeout=require(_0x142e('0x1'));var express=require(_0x142e('0x2'));var router=express[_0x142e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x142e('0x4')]('/',auth[_0x142e('0x5')](),controller[_0x142e('0x6')]);router[_0x142e('0x4')]('/:id',auth[_0x142e('0x5')](),controller[_0x142e('0x7')]);router['post']('/',auth[_0x142e('0x5')](),controller['create']);router[_0x142e('0x8')]('/:id',auth[_0x142e('0x5')](),controller[_0x142e('0x9')]);router['delete'](_0x142e('0xa'),auth[_0x142e('0x5')](),controller[_0x142e('0xb')]);module[_0x142e('0xc')]=router; \ No newline at end of file +var _0xa928=['express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x167c46,_0x3e47b7){var _0x5b4f09=function(_0x32583f){while(--_0x32583f){_0x167c46['push'](_0x167c46['shift']());}};_0x5b4f09(++_0x3e47b7);}(_0xa928,0x1ac));var _0x8a92=function(_0x2c75bd,_0x4d24ec){_0x2c75bd=_0x2c75bd-0x0;var _0xc27f91=_0xa928[_0x2c75bd];return _0xc27f91;};'use strict';var multer=require(_0x8a92('0x0'));var util=require(_0x8a92('0x1'));var path=require(_0x8a92('0x2'));var timeout=require(_0x8a92('0x3'));var express=require(_0x8a92('0x4'));var router=express['Router']();var auth=require(_0x8a92('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a92('0x6'));var controller=require('./disposition.controller');router[_0x8a92('0x7')]('/',auth['isAuthenticated'](),controller[_0x8a92('0x8')]);router[_0x8a92('0x7')](_0x8a92('0x9'),auth[_0x8a92('0xa')](),controller[_0x8a92('0xb')]);router[_0x8a92('0xc')]('/',auth[_0x8a92('0xa')](),controller['create']);router[_0x8a92('0xd')](_0x8a92('0x9'),auth[_0x8a92('0xa')](),controller['update']);router[_0x8a92('0xe')](_0x8a92('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x8a92('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index efd9eda..7b958cb 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 _0x4655=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x57185a,_0x2fb687){var _0x29ab4f=function(_0x4c8783){while(--_0x4c8783){_0x57185a['push'](_0x57185a['shift']());}};_0x29ab4f(++_0x2fb687);}(_0x4655,0x186));var _0x5465=function(_0xb09d1b,_0x412994){_0xb09d1b=_0xb09d1b-0x0;var _0x43626b=_0x4655[_0xb09d1b];return _0x43626b;};'use strict';var Sequelize=require(_0x5465('0x0'));module[_0x5465('0x1')]={'name':{'type':Sequelize[_0x5465('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5465('0x2')]},'ecm':{'type':Sequelize[_0x5465('0x3')](_0x5465('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x5465('0x2')],'defaultValue':_0x5465('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5465('0x6')},'minrate':{'type':Sequelize[_0x5465('0x3')]('2400',_0x5465('0x7'),_0x5465('0x8'),_0x5465('0x9'),_0x5465('0xa'),_0x5465('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x5465('0x3')](_0x5465('0xc'),_0x5465('0x7'),_0x5465('0x8'),_0x5465('0x9'),_0x5465('0xa'),'14400'),'defaultValue':_0x5465('0xb')},'modem':{'type':Sequelize[_0x5465('0x2')],'defaultValue':_0x5465('0xd')},'gateway':{'type':Sequelize[_0x5465('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5465('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5465('0x3')](_0x5465('0xe'),'IAX',_0x5465('0xf'),_0x5465('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5465('0x11')],'defaultValue':function(){return _0x5465('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5465('0x14')],'allowNull':!![],'defaultValue':null,'comment':_0x5465('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5465('0x16'),'set':function(_0x113acc){if(!_0x113acc)this['setDataValue'](_0x5465('0x17'),null);this[_0x5465('0x18')](_0x5465('0x19'),_0x113acc);}}}; \ No newline at end of file +var _0xbc55=['7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x3a6fba,_0x5b3507){var _0x5c3019=function(_0x1d87d0){while(--_0x1d87d0){_0x3a6fba['push'](_0x3a6fba['shift']());}};_0x5c3019(++_0x5b3507);}(_0xbc55,0x177));var _0x5bc5=function(_0x16d5e9,_0x44e7e4){_0x16d5e9=_0x16d5e9-0x0;var _0x49e1b6=_0xbc55[_0x16d5e9];return _0x49e1b6;};'use strict';var Sequelize=require(_0x5bc5('0x0'));module[_0x5bc5('0x1')]={'name':{'type':Sequelize[_0x5bc5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5bc5('0x3')]('yes','no'),'defaultValue':_0x5bc5('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x5bc5('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5bc5('0x6')},'minrate':{'type':Sequelize[_0x5bc5('0x3')](_0x5bc5('0x7'),_0x5bc5('0x8'),_0x5bc5('0x9'),_0x5bc5('0xa'),_0x5bc5('0xb'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x5bc5('0x7'),_0x5bc5('0x8'),'7200',_0x5bc5('0xa'),_0x5bc5('0xb'),_0x5bc5('0xc')),'defaultValue':_0x5bc5('0xc')},'modem':{'type':Sequelize[_0x5bc5('0x2')],'defaultValue':_0x5bc5('0xd')},'gateway':{'type':Sequelize[_0x5bc5('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[_0x5bc5('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5bc5('0x3')](_0x5bc5('0xf'),_0x5bc5('0x10'),_0x5bc5('0x11'),_0x5bc5('0x12')),'defaultValue':_0x5bc5('0xf')},'key':{'type':Sequelize[_0x5bc5('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5bc5('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bc5('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bc5('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5bc5('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b6f61){if(!_0x1b6f61)this[_0x5bc5('0x15')](_0x5bc5('0x16'),null);this[_0x5bc5('0x15')](_0x5bc5('0x17'),_0x1b6f61);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index dff3a6c..b0abac2 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 _0xed69=['mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','then','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','FaxAccount','include','findAll','rows','show','keys','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','findOne','hasOwnProperty','Disposition','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','priority','Answer','Set','ecm','gateway','headerinfo','maxrate','t38timeout','push','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xed69,0x179));var _0x9ed6=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0xed69[_0x1559a5];return _0x17a783;};'use strict';var pdf=require(_0x9ed6('0x0'));var emlformat=require(_0x9ed6('0x1'));var rimraf=require(_0x9ed6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ed6('0x3'));var rp=require(_0x9ed6('0x4'));var moment=require(_0x9ed6('0x5'));var BPromise=require(_0x9ed6('0x6'));var Mustache=require(_0x9ed6('0x7'));var util=require(_0x9ed6('0x8'));var path=require(_0x9ed6('0x9'));var sox=require(_0x9ed6('0xa'));var csv=require('to-csv');var ejs=require(_0x9ed6('0xb'));var fs=require('fs');var _=require(_0x9ed6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9ed6('0xd'));var deskjs=require(_0x9ed6('0xe'));var toCsv=require(_0x9ed6('0xf'));var querystring=require(_0x9ed6('0x10'));var Papa=require(_0x9ed6('0x11'));var Redis=require('ioredis');var authService=require(_0x9ed6('0x12'));var qs=require(_0x9ed6('0x13'));var hardwareService=require(_0x9ed6('0x14'));var logger=require(_0x9ed6('0x15'))(_0x9ed6('0x16'));var utils=require(_0x9ed6('0x17'));var config=require(_0x9ed6('0x18'));var db=require(_0x9ed6('0x19'))['db'];config[_0x9ed6('0x1a')]=_[_0x9ed6('0x1b')](config['redis'],{'host':_0x9ed6('0x1c'),'port':0x18eb});var socket=require(_0x9ed6('0x1d'))(new Redis(config[_0x9ed6('0x1a')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x9ed6('0x1e'));var client=jayson['client'][_0x9ed6('0x1f')]({'port':0x232c});var client9002=jayson[_0x9ed6('0x20')][_0x9ed6('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2d37c7,_0x4bf333,_0x37ab2){if(_0x37ab2){var _0x2e77bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e77bc[_0x9ed6('0x21')](_0x4bf333)){return _0x2d37c7;}else{throw new Error(_0x9ed6('0x22'));}}else{return _0x2d37c7;}}function respondWithRpcPromise(_0x226327,_0x5a922c,_0x431a86,_0x58fe45){return new BPromise(function(_0x54e87d,_0x593bf9){var _0x5b3b23=_0x58fe45||client;return _0x5b3b23[_0x9ed6('0x23')](_0x226327,_0x431a86)['then'](function(_0x42279f){logger[_0x9ed6('0x24')](_0x9ed6('0x25'),_0x5a922c,_0x9ed6('0x26'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5a922c,_0x9ed6('0x26'),JSON[_0x9ed6('0x27')](_0x42279f));if(_0x42279f['error']){if(_0x42279f[_0x9ed6('0x28')]['code']===0x1f4){logger['error'](_0x9ed6('0x25'),_0x5a922c,_0x42279f['error'][_0x9ed6('0x29')]);return _0x593bf9(_0x42279f[_0x9ed6('0x28')][_0x9ed6('0x29')]);}logger[_0x9ed6('0x28')](_0x9ed6('0x25'),_0x5a922c,_0x42279f[_0x9ed6('0x28')]['message']);return _0x54e87d(_0x42279f['error']['message']);}else{logger[_0x9ed6('0x24')](_0x9ed6('0x25'),_0x5a922c,'request\x20sent');_0x54e87d(_0x42279f[_0x9ed6('0x2a')][_0x9ed6('0x29')]);}})[_0x9ed6('0x2b')](function(_0x578515){logger[_0x9ed6('0x28')](_0x9ed6('0x25'),_0x5a922c,_0x578515);_0x593bf9(_0x578515);});});}function respondWithStatusCode(_0x178e1d,_0x51fbcb){_0x51fbcb=_0x51fbcb||0xcc;return function(_0x2af353){if(_0x2af353){return _0x178e1d[_0x9ed6('0x2c')](_0x51fbcb);}return _0x178e1d[_0x9ed6('0x2d')](_0x51fbcb)[_0x9ed6('0x2e')]();};}function respondWithResult(_0x29ee48,_0x1dc291){_0x1dc291=_0x1dc291||0xc8;return function(_0x13f225){if(_0x13f225){return _0x29ee48['status'](_0x1dc291)[_0x9ed6('0x2f')](_0x13f225);}};}function respondWithFilteredResult(_0x343cbe,_0x55a4a1){return function(_0x196b25){if(_0x196b25){var _0x55e640=_0x196b25[_0x9ed6('0x30')],_0x8a9e69=_0x55a4a1[_0x9ed6('0x31')],_0x3cc8c6=_0x55a4a1[_0x9ed6('0x31')]+_0x55a4a1[_0x9ed6('0x32')],_0x2a0923;if(_0x3cc8c6>=_0x55e640){_0x3cc8c6=_0x55e640;_0x2a0923=0xc8;}else{_0x2a0923=0xce;}_0x343cbe[_0x9ed6('0x2d')](_0x2a0923);return _0x343cbe['set']('Content-Range',_0x8a9e69+'-'+_0x3cc8c6+'/'+_0x55e640)[_0x9ed6('0x2f')](_0x196b25);}return null;};}function patchUpdates(_0xe41200){return function(_0x5d53cb){try{jsonpatch['apply'](_0x5d53cb,_0xe41200,!![]);}catch(_0x1ab27c){return BPromise[_0x9ed6('0x33')](_0x1ab27c);}return _0x5d53cb[_0x9ed6('0x34')]();};}function saveUpdates(_0x53e612,_0xaffdf2){return function(_0x1b3b3e){if(_0x1b3b3e){return _0x1b3b3e[_0x9ed6('0x35')](_0x53e612)['then'](function(_0x2338e5){return _0x2338e5;});}return null;};}function removeEntity(_0x364199,_0x36f35b){return function(_0x6b216){if(_0x6b216){return _0x6b216[_0x9ed6('0x36')]()['then'](function(){var _0x272788=_0x6b216[_0x9ed6('0x37')]({'plain':!![]});var _0x11c8d0=_0x9ed6('0x38');return db[_0x9ed6('0x39')]['destroy']({'where':{'type':_0x11c8d0,'resourceId':_0x272788['id']}})[_0x9ed6('0x3a')](function(){return _0x6b216;});})[_0x9ed6('0x3a')](function(){_0x364199['status'](0xcc)[_0x9ed6('0x2e')]();});}};}function handleEntityNotFound(_0x204516,_0x5df5d4){return function(_0x4bd2e9){if(!_0x4bd2e9){_0x204516[_0x9ed6('0x2c')](0x194);}return _0x4bd2e9;};}function handleError(_0x17e2a5,_0x6cd0d3){_0x6cd0d3=_0x6cd0d3||0x1f4;return function(_0x5444ac){logger[_0x9ed6('0x28')](_0x5444ac[_0x9ed6('0x3b')]);if(_0x5444ac['name']){delete _0x5444ac[_0x9ed6('0x3c')];}_0x17e2a5[_0x9ed6('0x2d')](_0x6cd0d3)[_0x9ed6('0x3d')](_0x5444ac);};}exports[_0x9ed6('0x3e')]=function(_0x1e54d2,_0x9e010a){var _0x1f2e4c={'include':[{'model':db[_0x9ed6('0x3f')],'as':_0x9ed6('0x40')}]},_0x51c2d9={},_0x28acf3={'count':0x0,'rows':[]};var _0x511a07=db['FaxAccount'][_0x9ed6('0x41')];_0x51c2d9[_0x9ed6('0x42')]=_['keys'](_0x511a07);_0x51c2d9[_0x9ed6('0x43')]=_['keys'](_0x1e54d2[_0x9ed6('0x43')]);_0x51c2d9[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x51c2d9['model'],_0x51c2d9[_0x9ed6('0x43')]);_0x1f2e4c['attributes']=_[_0x9ed6('0x45')](_0x51c2d9[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x1f2e4c[_0x9ed6('0x47')]=_0x1f2e4c[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1f2e4c[_0x9ed6('0x47')]:_0x51c2d9[_0x9ed6('0x42')];if(!_0x1e54d2['query']['hasOwnProperty'](_0x9ed6('0x49'))){_0x1f2e4c[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x1f2e4c[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x1e54d2['query'][_0x9ed6('0x31')]);}_0x1f2e4c[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x1e54d2['query']['sort']);_0x1f2e4c[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x1e54d2[_0x9ed6('0x43')],_0x51c2d9['filters']));if(_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x1f2e4c[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x1f2e4c[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x511a07,function(_0x2872c2){if(_0x2872c2[_0x9ed6('0x51')][_0x9ed6('0x52')]!==_0x9ed6('0x53')){var _0xf7502a={};_0xf7502a[_0x2872c2['field']]={'$like':'%'+_0x1e54d2['query']['filter']+'%'};return _0xf7502a;}})});}_0x1f2e4c=_[_0x9ed6('0x4f')]({},_0x1f2e4c,_0x1e54d2['options']);var _0x36861b={'where':_0x1f2e4c['where']};return db[_0x9ed6('0x54')]['count'](_0x36861b)[_0x9ed6('0x3a')](function(_0x46b415){_0x28acf3[_0x9ed6('0x30')]=_0x46b415;if(_0x1e54d2[_0x9ed6('0x43')]['includeAll']){_0x1f2e4c[_0x9ed6('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0x9ed6('0x56')](_0x1f2e4c);})[_0x9ed6('0x3a')](function(_0x50f625){_0x28acf3[_0x9ed6('0x57')]=_0x50f625;return _0x28acf3;})['then'](respondWithFilteredResult(_0x9e010a,_0x1f2e4c))[_0x9ed6('0x2b')](handleError(_0x9e010a,null));};exports[_0x9ed6('0x58')]=function(_0x59ec81,_0x17bb96){var _0x177358={'raw':![],'where':{'id':_0x59ec81['params']['id']},'include':[{'model':db[_0x9ed6('0x3f')],'as':'mandatoryDispositionPause'}]},_0x3af57d={};_0x3af57d[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0x54')][_0x9ed6('0x41')]);_0x3af57d['query']=_[_0x9ed6('0x59')](_0x59ec81[_0x9ed6('0x43')]);_0x3af57d[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x3af57d[_0x9ed6('0x42')],_0x3af57d[_0x9ed6('0x43')]);_0x177358[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x3af57d['model'],qs[_0x9ed6('0x46')](_0x59ec81['query'][_0x9ed6('0x46')]));_0x177358[_0x9ed6('0x47')]=_0x177358[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x177358[_0x9ed6('0x47')]:_0x3af57d[_0x9ed6('0x42')];if(_0x59ec81['query'][_0x9ed6('0x5a')]){_0x177358[_0x9ed6('0x55')]=[{'all':!![]}];}_0x177358=_[_0x9ed6('0x4f')]({},_0x177358,_0x59ec81[_0x9ed6('0x5b')]);return db[_0x9ed6('0x54')]['find'](_0x177358)[_0x9ed6('0x3a')](handleEntityNotFound(_0x17bb96,null))[_0x9ed6('0x3a')](respondWithResult(_0x17bb96,null))[_0x9ed6('0x2b')](handleError(_0x17bb96,null));};exports[_0x9ed6('0x5c')]=function(_0x57f0f9,_0x4df873){return db[_0x9ed6('0x54')][_0x9ed6('0x5c')](_0x57f0f9[_0x9ed6('0x5d')],{})[_0x9ed6('0x3a')](function(_0xfe5dba){var _0x1d0a55=_0x57f0f9[_0x9ed6('0x5e')]['get']({'plain':!![]});if(!_0x1d0a55)throw new Error(_0x9ed6('0x5f'));if(_0x1d0a55[_0x9ed6('0x60')]==='user'){var _0x32b377=_0xfe5dba[_0x9ed6('0x37')]({'plain':!![]});var _0x19abc9=_0x9ed6('0x38');return db[_0x9ed6('0x61')][_0x9ed6('0x62')]({'where':{'name':_0x19abc9,'userProfileId':_0x1d0a55['userProfileId']},'raw':!![]})[_0x9ed6('0x3a')](function(_0x5141e7){if(_0x5141e7&&_0x5141e7[_0x9ed6('0x63')]===0x0){return db['UserProfileResource'][_0x9ed6('0x5c')]({'name':_0x32b377[_0x9ed6('0x3c')],'resourceId':_0x32b377['id'],'type':_0x5141e7[_0x9ed6('0x3c')],'sectionId':_0x5141e7['id']},{})['then'](function(){return _0xfe5dba;});}else{return _0xfe5dba;}})[_0x9ed6('0x2b')](function(_0x48ec90){logger['error'](_0x9ed6('0x64'),_0x48ec90);throw _0x48ec90;});}return _0xfe5dba;})['then'](respondWithResult(_0x4df873,0xc9))[_0x9ed6('0x2b')](handleError(_0x4df873,null));};exports['update']=function(_0x693762,_0x5a8c26){if(_0x693762[_0x9ed6('0x5d')]['id']){delete _0x693762[_0x9ed6('0x5d')]['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x693762[_0x9ed6('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x9ed6('0x40')}]})[_0x9ed6('0x3a')](handleEntityNotFound(_0x5a8c26,null))[_0x9ed6('0x3a')](saveUpdates(_0x693762[_0x9ed6('0x5d')],null))['then'](respondWithResult(_0x5a8c26,null))[_0x9ed6('0x2b')](handleError(_0x5a8c26,null));};exports['destroy']=function(_0x4a54c7,_0x5ab19f){return db[_0x9ed6('0x54')]['find']({'where':{'id':_0x4a54c7[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x5ab19f,null))['then'](removeEntity(_0x5ab19f,null))[_0x9ed6('0x2b')](handleError(_0x5ab19f,null));};exports['describe']=function(_0x402704,_0x3275fc){return db[_0x9ed6('0x54')][_0x9ed6('0x66')]()[_0x9ed6('0x3a')](respondWithResult(_0x3275fc,null))[_0x9ed6('0x2b')](handleError(_0x3275fc,null));};exports[_0x9ed6('0x67')]=function(_0x138e99,_0x5a96a7,_0x36323c){if(_0x138e99[_0x9ed6('0x5d')]['id']){delete _0x138e99['body']['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x138e99[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x5a96a7,null))[_0x9ed6('0x3a')](function(_0x476c60){if(_0x476c60){_0x138e99[_0x9ed6('0x5d')][_0x9ed6('0x68')]=_0x476c60['id'];return db['Disposition'][_0x9ed6('0x5c')](_0x138e99['body']);}})[_0x9ed6('0x3a')](respondWithResult(_0x5a96a7,null))[_0x9ed6('0x2b')](handleError(_0x5a96a7,null));};exports['getDispositions']=function(_0x32fa7b,_0x37b603,_0x5b9ca6){var _0x58c7e6={'raw':![],'where':{}};var _0x85dc33={};var _0x45bc1a={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x32fa7b[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x37b603,null))[_0x9ed6('0x3a')](function(_0x59a8ba){if(_0x59a8ba){_0x85dc33['model']=_['keys'](db['Disposition'][_0x9ed6('0x41')]);_0x85dc33[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x32fa7b['query']);_0x85dc33['filters']=_[_0x9ed6('0x45')](_0x85dc33[_0x9ed6('0x42')],_0x85dc33['query']);_0x58c7e6[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x85dc33[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x58c7e6[_0x9ed6('0x47')]=_0x58c7e6['attributes']['length']?_0x58c7e6[_0x9ed6('0x47')]:_0x85dc33[_0x9ed6('0x42')];if(!_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x58c7e6[_0x9ed6('0x32')]=qs['limit'](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x58c7e6[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x32fa7b[_0x9ed6('0x43')]['offset']);}_0x58c7e6['order']=qs['sort'](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x58c7e6[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x32fa7b[_0x9ed6('0x43')],_0x85dc33['filters']));_0x58c7e6[_0x9ed6('0x4c')][_0x9ed6('0x68')]=_0x59a8ba['id'];if(_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x58c7e6['where']=_['merge'](_0x58c7e6[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x58c7e6[_0x9ed6('0x47')],function(_0x5150bd){var _0x39751a={};_0x39751a[_0x5150bd]={'$like':'%'+_0x32fa7b[_0x9ed6('0x43')]['filter']+'%'};return _0x39751a;})});}_0x58c7e6=_[_0x9ed6('0x4f')]({},_0x58c7e6,_0x32fa7b['options']);return db['Disposition']['count']({'where':_0x58c7e6[_0x9ed6('0x4c')]})['then'](function(_0x28e727){_0x45bc1a[_0x9ed6('0x30')]=_0x28e727;if(_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x5a')]){_0x58c7e6[_0x9ed6('0x55')]=[{'all':!![]}];}return db[_0x9ed6('0x6b')][_0x9ed6('0x56')](_0x58c7e6);})['then'](function(_0xa88249){_0x45bc1a[_0x9ed6('0x57')]=_0xa88249;return _0x45bc1a;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x37b603,_0x58c7e6))['catch'](handleError(_0x37b603,null));};exports['removeDispositions']=function(_0x3a1fc4,_0x43a405,_0x3d6015){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x3a1fc4[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x43a405,null))[_0x9ed6('0x3a')](function(_0x1769df){if(_0x1769df){return _0x1769df['removeDispositions'](_0x3a1fc4[_0x9ed6('0x43')][_0x9ed6('0x6c')]);}})['then'](respondWithStatusCode(_0x43a405,null))[_0x9ed6('0x2b')](handleError(_0x43a405,null));};exports['addAnswer']=function(_0x91a93d,_0x2f549e,_0x22fae9){if(_0x91a93d[_0x9ed6('0x5d')]['id']){delete _0x91a93d[_0x9ed6('0x5d')]['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x91a93d[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x2f549e,null))[_0x9ed6('0x3a')](function(_0x524a8e){if(_0x524a8e){_0x91a93d[_0x9ed6('0x5d')][_0x9ed6('0x68')]=_0x524a8e['id'];return db[_0x9ed6('0x6d')]['create'](_0x91a93d[_0x9ed6('0x5d')]);}})[_0x9ed6('0x3a')](respondWithResult(_0x2f549e,null))[_0x9ed6('0x2b')](handleError(_0x2f549e,null));};exports[_0x9ed6('0x6e')]=function(_0x4ab90a,_0x2075e6,_0x4e2dd9){var _0xec726a={'raw':![],'where':{}};var _0x325736={};var _0x319684={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x4ab90a['params']['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2075e6,null))[_0x9ed6('0x3a')](function(_0x430a10){if(_0x430a10){_0x325736[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x6d')]['rawAttributes']);_0x325736[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x4ab90a['query']);_0x325736[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x325736[_0x9ed6('0x42')],_0x325736[_0x9ed6('0x43')]);_0xec726a['attributes']=_['intersection'](_0x325736['model'],qs['fields'](_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0xec726a['attributes']=_0xec726a['attributes'][_0x9ed6('0x48')]?_0xec726a['attributes']:_0x325736[_0x9ed6('0x42')];if(!_0x4ab90a[_0x9ed6('0x43')]['hasOwnProperty'](_0x9ed6('0x49'))){_0xec726a[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x4ab90a[_0x9ed6('0x43')]['limit']);_0xec726a[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0xec726a['order']=qs[_0x9ed6('0x4b')](_0x4ab90a['query'][_0x9ed6('0x4b')]);_0xec726a[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x4ab90a[_0x9ed6('0x43')],_0x325736['filters']));_0xec726a[_0x9ed6('0x4c')][_0x9ed6('0x68')]=_0x430a10['id'];if(_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0xec726a[_0x9ed6('0x4c')]=_['merge'](_0xec726a[_0x9ed6('0x4c')],{'$or':_['map'](_0xec726a[_0x9ed6('0x47')],function(_0x339bd7){var _0x47d042={};_0x47d042[_0x339bd7]={'$like':'%'+_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x47d042;})});}_0xec726a=_[_0x9ed6('0x4f')]({},_0xec726a,_0x4ab90a[_0x9ed6('0x5b')]);return db[_0x9ed6('0x6d')][_0x9ed6('0x30')]({'where':_0xec726a[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x38977e){_0x319684[_0x9ed6('0x30')]=_0x38977e;if(_0x4ab90a['query'][_0x9ed6('0x5a')]){_0xec726a[_0x9ed6('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9ed6('0x56')](_0xec726a);})[_0x9ed6('0x3a')](function(_0x394818){_0x319684[_0x9ed6('0x57')]=_0x394818;return _0x319684;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x2075e6,_0xec726a))[_0x9ed6('0x2b')](handleError(_0x2075e6,null));};exports[_0x9ed6('0x6f')]=function(_0xbc91a2,_0xb61222,_0x124b7f){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0xbc91a2['params']['id']}})['then'](handleEntityNotFound(_0xb61222,null))[_0x9ed6('0x3a')](function(_0x361bfd){if(_0x361bfd){return _0x361bfd[_0x9ed6('0x6f')](_0xbc91a2[_0x9ed6('0x43')][_0x9ed6('0x6c')]);}})['then'](respondWithStatusCode(_0xb61222,null))[_0x9ed6('0x2b')](handleError(_0xb61222,null));};exports[_0x9ed6('0x70')]=function(_0x1cb16b,_0x2f1771,_0x129d56){return db[_0x9ed6('0x71')][_0x9ed6('0x62')]({'where':{'id':_0x1cb16b[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2f1771,null))[_0x9ed6('0x3a')](function(_0x1de323){if(_0x1de323){return _0x1de323['addInteraction'](_0x1cb16b['body'][_0x9ed6('0x6c')],_[_0x9ed6('0x72')](_0x1cb16b[_0x9ed6('0x5d')],[_0x9ed6('0x6c'),'id'])||{});}})[_0x9ed6('0x3a')](respondWithResult(_0x2f1771,null))[_0x9ed6('0x2b')](handleError(_0x2f1771,null));};exports[_0x9ed6('0x73')]=function(_0x2335d3,_0x2366d1,_0x1fbbd1){var _0x30024f={'raw':![],'where':{}};var _0x3dd017={};var _0x3cd2ec={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2335d3[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2366d1,null))[_0x9ed6('0x3a')](function(_0x1b00b9){if(_0x1b00b9){_0x3dd017[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x71')][_0x9ed6('0x41')]);_0x3dd017[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x2335d3['query']);_0x3dd017[_0x9ed6('0x44')]=_['intersection'](_0x3dd017[_0x9ed6('0x42')],_0x3dd017['query']);_0x30024f[_0x9ed6('0x47')]=_['intersection'](_0x3dd017[_0x9ed6('0x42')],qs['fields'](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x30024f[_0x9ed6('0x47')]=_0x30024f[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x30024f[_0x9ed6('0x47')]:_0x3dd017['model'];if(!_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x30024f[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x2335d3[_0x9ed6('0x43')]['limit']);_0x30024f[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0x30024f['order']=qs[_0x9ed6('0x4b')](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x30024f['where']=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x2335d3[_0x9ed6('0x43')],_0x3dd017[_0x9ed6('0x44')]));_0x30024f['where'][_0x9ed6('0x68')]=_0x1b00b9['id'];if(_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x30024f[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x30024f[_0x9ed6('0x4c')],{'$or':_['map'](_0x30024f['attributes'],function(_0x2bea71){var _0xcd9023={};_0xcd9023[_0x2bea71]={'$like':'%'+_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0xcd9023;})});}_0x30024f=_[_0x9ed6('0x4f')]({},_0x30024f,_0x2335d3[_0x9ed6('0x5b')]);return db['FaxInteraction'][_0x9ed6('0x30')]({'where':_0x30024f[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x27f5a5){_0x3cd2ec['count']=_0x27f5a5;if(_0x2335d3[_0x9ed6('0x43')]['includeAll']){_0x30024f['include']=[{'model':db['CmContact'],'as':_0x9ed6('0x74'),'required':![]},{'model':db['User'],'as':_0x9ed6('0x75'),'attributes':[_0x9ed6('0x3c'),_0x9ed6('0x76'),_0x9ed6('0x77')],'required':![]},{'model':db[_0x9ed6('0x78')],'as':_0x9ed6('0x79'),'attributes':['id','name',_0x9ed6('0x7a')],'where':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]?{'id':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]}:undefined,'required':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]?!![]:![]}];}return db[_0x9ed6('0x71')][_0x9ed6('0x56')](_0x30024f);})[_0x9ed6('0x3a')](function(_0x39af43){_0x3cd2ec[_0x9ed6('0x57')]=_0x39af43;return _0x3cd2ec;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x2366d1,_0x30024f))[_0x9ed6('0x2b')](handleError(_0x2366d1,null));};exports['addApplications']=function(_0x2116f0,_0x290df8,_0x1a87e4){return db[_0x9ed6('0x54')]['findOne']({'where':{'id':_0x2116f0['params']['id']}})['then'](handleEntityNotFound(_0x290df8,null))[_0x9ed6('0x3a')](function(_0x36ad57){if(_0x36ad57){return db[_0x9ed6('0x7c')][_0x9ed6('0x7d')](function(_0x5bdcdf){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x2116f0[_0x9ed6('0x65')]['id']},'transaction':_0x5bdcdf})['then'](function(_0x358d4d){var _0x4700ce=_[_0x9ed6('0x50')](_0x2116f0[_0x9ed6('0x5d')],function(_0x36f14a){_0x36f14a[_0x9ed6('0x68')]=_0x2116f0['params']['id'];return _0x36f14a;});return db[_0x9ed6('0x7e')]['bulkCreate'](_0x4700ce,{'transaction':_0x5bdcdf});});})[_0x9ed6('0x3a')](function(){return db['FaxApplication'][_0x9ed6('0x7f')]({'where':{'FaxAccountId':_0x2116f0[_0x9ed6('0x65')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x290df8,null))[_0x9ed6('0x2b')](handleError(_0x290df8,null));};exports['getApplications']=function(_0x22c164,_0x481841,_0x598600){var _0x1718ea={};var _0x42f170={};var _0x16f0f1;var _0xf82b8b;return db['FaxAccount'][_0x9ed6('0x69')]({'where':{'id':_0x22c164['params']['id']}})['then'](handleEntityNotFound(_0x481841,null))[_0x9ed6('0x3a')](function(_0xc8f68c){if(_0xc8f68c){_0x16f0f1=_0xc8f68c;_0x42f170[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x7e')][_0x9ed6('0x41')]);_0x42f170[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x22c164[_0x9ed6('0x43')]);_0x42f170[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x42f170[_0x9ed6('0x42')],_0x42f170[_0x9ed6('0x43')]);_0x1718ea[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x42f170[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x22c164[_0x9ed6('0x43')]['fields']));_0x1718ea[_0x9ed6('0x47')]=_0x1718ea[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1718ea[_0x9ed6('0x47')]:_0x42f170[_0x9ed6('0x42')];_0x1718ea[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x22c164[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x1718ea[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_['pick'](_0x22c164[_0x9ed6('0x43')],_0x42f170[_0x9ed6('0x44')]));if(_0x22c164['query'][_0x9ed6('0x4e')]){_0x1718ea['where']=_[_0x9ed6('0x4f')](_0x1718ea[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x1718ea['attributes'],function(_0x1f469a){var _0x4c32b4={};_0x4c32b4[_0x1f469a]={'$like':'%'+_0x22c164[_0x9ed6('0x43')]['filter']+'%'};return _0x4c32b4;})});}_0x1718ea=_[_0x9ed6('0x4f')]({},_0x1718ea,_0x22c164[_0x9ed6('0x5b')]);return _0x16f0f1[_0x9ed6('0x80')](_0x1718ea);}})[_0x9ed6('0x3a')](function(_0x15becf){if(_0x15becf){_0xf82b8b=_0x15becf[_0x9ed6('0x48')];if(!_0x22c164[_0x9ed6('0x43')]['hasOwnProperty'](_0x9ed6('0x49'))){_0x1718ea['limit']=qs['limit'](_0x22c164['query'][_0x9ed6('0x32')]);_0x1718ea[_0x9ed6('0x31')]=qs['offset'](_0x22c164[_0x9ed6('0x43')][_0x9ed6('0x31')]);}return _0x16f0f1['getApplications'](_0x1718ea);}})[_0x9ed6('0x3a')](function(_0x4f1d86){if(_0x4f1d86){return _0x4f1d86?{'count':_0xf82b8b,'rows':_0x4f1d86}:null;}})[_0x9ed6('0x3a')](respondWithResult(_0x481841,null))[_0x9ed6('0x2b')](handleError(_0x481841,null));};function Extension(_0x25fb8b,_0x5df147,_0x53287b,_0x149a1b){this[_0x9ed6('0x81')]=_0x9ed6('0x82');this[_0x9ed6('0x83')]=_0x25fb8b[_0x9ed6('0x84')];this[_0x9ed6('0x85')]=_0x149a1b;this[_0x9ed6('0x51')]='system';this['description']=_0x9ed6('0x86');this[_0x9ed6('0x68')]=_0x25fb8b['id'];this[_0x9ed6('0x87')]=_0x5df147;this['appdata']=_0x53287b;}function createExtensionsReciveFax(_0x1e1036){var _0x386479=0x1;var _0x280b7a=[];_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'',_0x9ed6('0x88')));_0x386479+=0x1;_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'CDR(type)=inbound-fax',_0x9ed6('0x89')));_0x386479+=0x1;for(var _0x4fea8a in _0x1e1036){if(_0x1e1036[_0x9ed6('0x6a')](_0x4fea8a)&&(_0x4fea8a===_0x9ed6('0x8a')||_0x4fea8a===_0x9ed6('0x84')||_0x4fea8a===_0x9ed6('0x8b')||_0x4fea8a==='faxdetect'||_0x4fea8a===_0x9ed6('0x8c')||_0x4fea8a===_0x9ed6('0x8d')||_0x4fea8a==='minrate'||_0x4fea8a==='modem'||_0x4fea8a===_0x9ed6('0x8e'))){_0x280b7a[_0x9ed6('0x8f')](new Extension(_0x1e1036,_0x386479,'FAXOPT('+_0x4fea8a+')='+_0x1e1036[_0x4fea8a],'Set'));_0x386479+=0x1;}}_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'6',_0x9ed6('0x90')));_0x386479+=0x1;_0x280b7a[_0x9ed6('0x8f')](new Extension(_0x1e1036,_0x386479,_0x9ed6('0x91'),_0x9ed6('0x92')));_0x386479=0x0;return _0x280b7a;}exports[_0x9ed6('0x93')]=function(_0x5cfa41,_0x55bdce,_0x3437e1){var _0x441d72;return db['sequelize'][_0x9ed6('0x7d')](function(_0x409513){return db['FaxAccount'][_0x9ed6('0x5c')](_0x5cfa41[_0x9ed6('0x5d')],{'transaction':_0x409513})[_0x9ed6('0x3a')](function(_0x3ab4fe){_0x441d72=_0x3ab4fe[_0x9ed6('0x37')]({'plain':!![]});return db[_0x9ed6('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x441d72),{'transaction':_0x409513});});})[_0x9ed6('0x3a')](function(){return _0x441d72;})[_0x9ed6('0x3a')](respondWithResult(_0x55bdce,null))[_0x9ed6('0x2b')](handleError(_0x55bdce,null));};exports['updateAccountApplications']=function(_0x29fbfd,_0xba0231,_0x6e36a2){var _0x17fcb2;return db[_0x9ed6('0x7c')][_0x9ed6('0x7d')](function(_0x58b1a5){return db['FaxAccount']['update'](_0x29fbfd[_0x9ed6('0x5d')],{'where':{'id':_0x29fbfd[_0x9ed6('0x5d')]['id']},'transaction':_0x58b1a5})[_0x9ed6('0x3a')](function(_0x1d92bd){return db[_0x9ed6('0x94')]['destroy']({'where':{'FaxAccountId':_0x29fbfd['body']['id']},'transaction':_0x58b1a5})['then'](function(_0x2ba637){return db[_0x9ed6('0x94')][_0x9ed6('0x95')](createExtensionsReciveFax(_[_0x9ed6('0x72')](_0x29fbfd[_0x9ed6('0x5d')],[_0x9ed6('0x96'),_0x9ed6('0x52'),_0x9ed6('0x97'),_0x9ed6('0x98'),_0x9ed6('0x99'),'ListId'])),{'transaction':_0x58b1a5});});});})[_0x9ed6('0x3a')](function(){return db[_0x9ed6('0x54')][_0x9ed6('0x9a')](_0x29fbfd[_0x9ed6('0x5d')]['id']);})[_0x9ed6('0x3a')](respondWithResult(_0xba0231,null))[_0x9ed6('0x2b')](handleError(_0xba0231,null));};exports[_0x9ed6('0x9b')]=function(_0x383acd,_0x92bc37,_0x19c6cd){var _0x1c200f={'raw':!![],'where':{}};var _0x530c41={};var _0x1c3099={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x383acd[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x92bc37,null))[_0x9ed6('0x3a')](function(_0x5d80fd){if(_0x5d80fd){_0x530c41[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0x9c')][_0x9ed6('0x41')]);_0x530c41['query']=_[_0x9ed6('0x59')](_0x383acd[_0x9ed6('0x43')]);_0x530c41[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x530c41[_0x9ed6('0x42')],_0x530c41[_0x9ed6('0x43')]);_0x1c200f[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x530c41[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x383acd[_0x9ed6('0x43')]['fields']));_0x1c200f[_0x9ed6('0x47')]=_0x1c200f[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1c200f['attributes']:_0x530c41[_0x9ed6('0x42')];if(!_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x1c200f['limit']=qs[_0x9ed6('0x32')](_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x1c200f['offset']=qs[_0x9ed6('0x31')](_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0x1c200f[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x383acd['query'][_0x9ed6('0x4b')]);_0x1c200f['where']=qs[_0x9ed6('0x44')](_['pick'](_0x383acd[_0x9ed6('0x43')],_0x530c41[_0x9ed6('0x44')]));_0x1c200f[_0x9ed6('0x4c')]['FaxAccountId']=_0x5d80fd['id'];if(_0x383acd['query']['filter']){_0x1c200f[_0x9ed6('0x4c')]=_['merge'](_0x1c200f['where'],{'$or':_[_0x9ed6('0x50')](_0x1c200f['attributes'],function(_0x37e5b0){var _0x18b50f={};_0x18b50f[_0x37e5b0]={'$like':'%'+_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x18b50f;})});}if(_0x383acd[_0x9ed6('0x43')]['$gte']){var _0x6bd52d=_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x9d')]['split'](',');var _0x2e566b={};_0x2e566b[_0x6bd52d[0x0]]={'$gte':moment(_0x6bd52d[0x1])[_0x9ed6('0x9e')](_0x9ed6('0x9f'))};_0x1c200f[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x1c200f['where'],_0x2e566b);}_0x1c200f=_['merge']({},_0x1c200f,_0x383acd[_0x9ed6('0x5b')]);return db[_0x9ed6('0x9c')][_0x9ed6('0x30')]({'where':_0x1c200f[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x319a5b){_0x1c3099[_0x9ed6('0x30')]=_0x319a5b;if(_0x383acd['query'][_0x9ed6('0x5a')]){_0x1c200f[_0x9ed6('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0x9ed6('0x56')](_0x1c200f);})[_0x9ed6('0x3a')](function(_0x474b98){_0x1c3099[_0x9ed6('0x57')]=_0x474b98;return _0x1c3099;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x92bc37,_0x1c200f))[_0x9ed6('0x2b')](handleError(_0x92bc37,null));};exports[_0x9ed6('0x3d')]=function(_0x68bfd1,_0x5b625b,_0x604167){var _0x289327,_0x15b930={},_0x1c2cd2;if(_0x68bfd1['body']['to']){_0x1c2cd2=_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x68bfd1[_0x9ed6('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0x9ed6('0xa0'),'include':[{'model':db[_0x9ed6('0xa1')],'as':_0x9ed6('0xa2'),'where':{'fax':_0x1c2cd2},'limit':0x1,'order':[[_0x9ed6('0x98'),_0x9ed6('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x5b625b,null))[_0x9ed6('0x3a')](function(_0x3b1ae7){_0x289327=_0x3b1ae7;if(_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')]&&_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x9ed6('0x48')]){for(var _0x504d65=0x0;_0x504d65<_0x68bfd1[_0x9ed6('0x5d')]['attachments'][_0x9ed6('0x48')];_0x504d65+=0x1){_0x68bfd1[_0x9ed6('0x5d')]['attachments'][_0x504d65]={'filename':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65][_0x9ed6('0x3c')],'id':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65]['id'],'path':path[_0x9ed6('0xa5')](config[_0x9ed6('0xa6')],_0x9ed6('0xa7'),_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65][_0x9ed6('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x9ed6('0xa9'),{'FaxAccountId':_['isNil'](_0x68bfd1[_0x9ed6('0x65')]['id'])?undefined:_0x68bfd1[_0x9ed6('0x65')]['id'],'path':_['isNil'](_0x68bfd1['body'][_0x9ed6('0xa4')][0x0][_0x9ed6('0x9')])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0x9')],'fax':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0]},client9002);})[_0x9ed6('0x3a')](function(){if(_0x289327){if(_[_0x9ed6('0xaa')](_0x68bfd1['body'][_0x9ed6('0xab')])){_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xab')]=util[_0x9ed6('0x9e')](_0x9ed6('0xac'),_0x289327['name'],_0x289327[_0x9ed6('0xad')]);}if(_0x289327['List']){if(_0x289327['List'][_0x9ed6('0xa2')][_0x9ed6('0x48')]){return _0x289327[_0x9ed6('0xa0')][_0x9ed6('0xa2')][0x0];}else{return db[_0x9ed6('0xa1')][_0x9ed6('0x5c')](_['defaults'](_0x68bfd1[_0x9ed6('0x5d')],{'firstName':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'phone':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'fax':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'ListId':_0x289327['ListId']}));}}else{throw new Error(_0x9ed6('0xae'));}}else{throw new Error(_0x9ed6('0xaf'));}})['then'](function(_0x2cffaf){if(_0x2cffaf){return db[_0x9ed6('0x71')]['find']({'where':{'ContactId':_0x2cffaf['id'],'closed':![],'FaxAccountId':_0x289327['id']}})['then'](function(_0x266cdb){if(_0x266cdb){return[_0x266cdb,![]];}return db[_0x9ed6('0x71')][_0x9ed6('0x5c')]({'UserId':_0x68bfd1['user']['id'],'ContactId':_0x2cffaf['id'],'FaxAccountId':_0x289327['id'],'fax':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'firstMsgDirection':_0x9ed6('0xb0'),'Messages':[_[_0x9ed6('0x4f')](_0x68bfd1[_0x9ed6('0x5d')],{'read':![],'body':_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0xb1')],'FaxAccountId':_0x289327['id'],'UserId':_0x68bfd1['user']['id'],'ContactId':_0x2cffaf['id'],'AttachmentId':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x9ed6('0x9c')],'as':_0x9ed6('0xb2')}]})[_0x9ed6('0x3a')](function(_0x431aa4){return[_0x431aa4,!![]];});});}else{throw new Error(_0x9ed6('0xb3'));}})[_0x9ed6('0xb4')](function(_0x22b8ae,_0x4e9b3a){if(_0x4e9b3a){return _0x22b8ae;}return db[_0x9ed6('0x9c')][_0x9ed6('0x5c')]({'direction':'out','read':![],'body':_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0xb1')],'FaxAccountId':_0x289327['id'],'FaxInteractionId':_0x22b8ae['id'],'UserId':_0x68bfd1[_0x9ed6('0x5e')]['id'],'ContactId':_0x22b8ae[_0x9ed6('0xb5')],'AttachmentId':_0x68bfd1['body'][_0x9ed6('0xa4')][0x0]['id']})[_0x9ed6('0x3a')](function(_0x5eb583){_0x22b8ae[_0x9ed6('0xb6')][_0x9ed6('0xb2')]=[];_0x22b8ae[_0x9ed6('0xb6')][_0x9ed6('0xb2')][_0x9ed6('0x8f')](_0x5eb583[_0x9ed6('0xb6')]);return _0x22b8ae;});})[_0x9ed6('0x3a')](function(_0x36e4d1){respondWithRpcPromise(_0x9ed6('0xb7'),_0x9ed6('0xb7'),{'FaxAccountId':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x65')]['id'])?undefined:_0x68bfd1[_0x9ed6('0x65')]['id'],'path':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][0x0][_0x9ed6('0x9')])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0x9')],'fax':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'AttachmentId':_0x68bfd1['body'][_0x9ed6('0xa4')][0x0]['id']},client9002)['then'](function(_0x4038db){logger[_0x9ed6('0x24')](_0x9ed6('0xb8'),_0x4038db);})['catch'](function(_0x343a29){logger[_0x9ed6('0x24')]('SendFaxRpc,\x20%s',_0x343a29);});return _0x36e4d1;})[_0x9ed6('0x3a')](respondWithResult(_0x5b625b,null))['catch'](handleError(_0x5b625b,null));};exports['addAgents']=function(_0x4d70b4,_0x13a11f,_0xaf894f){return db['FaxAccount'][_0x9ed6('0x62')]({'where':{'id':_0x4d70b4['params']['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x13a11f,null))[_0x9ed6('0x3a')](function(_0xd631f9){if(_0xd631f9){return _0xd631f9['addAgents'](_0x4d70b4[_0x9ed6('0x5d')]['ids'],_[_0x9ed6('0x72')](_0x4d70b4[_0x9ed6('0x5d')],[_0x9ed6('0x6c'),'id'])||{})[_0x9ed6('0xb4')](function(_0x5c7d4b){for(var _0x25363e=0x0;_0x25363e<_0x4d70b4[_0x9ed6('0x5d')][_0x9ed6('0x6c')]['length'];_0x25363e+=0x1){socket[_0x9ed6('0xb9')](_0x9ed6('0xba'),{'UserId':_0x4d70b4[_0x9ed6('0x5d')][_0x9ed6('0x6c')][_0x25363e],'FaxAccountId':_0x4d70b4['params']['id']});}return _0x5c7d4b;});}})[_0x9ed6('0x3a')](respondWithResult(_0x13a11f,null))[_0x9ed6('0x2b')](handleError(_0x13a11f,null));};exports[_0x9ed6('0xbb')]=function(_0x3ab1f7,_0x3ee6db,_0x5214f6){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x3ab1f7[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x3ee6db,null))[_0x9ed6('0x3a')](function(_0x13582a){if(_0x13582a){return _0x13582a[_0x9ed6('0xbb')](_0x3ab1f7['query'][_0x9ed6('0x6c')])[_0x9ed6('0x3a')](function(){if(_[_0x9ed6('0xbc')](_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')])){for(var _0x4ef9c6=0x0;_0x4ef9c6<_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')]['length'];_0x4ef9c6+=0x1){socket[_0x9ed6('0xb9')](_0x9ed6('0xbd'),{'UserId':Number(_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')][_0x4ef9c6]),'FaxAccountId':Number(_0x3ab1f7['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3ab1f7[_0x9ed6('0x43')]['ids']),'FaxAccountId':Number(_0x3ab1f7['params']['id'])});}});}})[_0x9ed6('0x3a')](respondWithStatusCode(_0x3ee6db,null))[_0x9ed6('0x2b')](handleError(_0x3ee6db,null));};exports[_0x9ed6('0xbe')]=function(_0x58e15e,_0x35566f,_0x17dc19){var _0x47741b={};var _0x568fc9={};var _0x136264;var _0x288fe0;return db[_0x9ed6('0x54')]['findOne']({'where':{'id':_0x58e15e[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x35566f,null))[_0x9ed6('0x3a')](function(_0x3bad4c){if(_0x3bad4c){_0x136264=_0x3bad4c;_0x568fc9[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0xbf')]['rawAttributes']);_0x568fc9[_0x9ed6('0x43')]=_['keys'](_0x58e15e[_0x9ed6('0x43')]);_0x568fc9[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x568fc9[_0x9ed6('0x42')],_0x568fc9[_0x9ed6('0x43')]);_0x47741b[_0x9ed6('0x47')]=_['intersection'](_0x568fc9[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x58e15e['query'][_0x9ed6('0x46')]));_0x47741b[_0x9ed6('0x47')]=_0x47741b[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x47741b[_0x9ed6('0x47')]:_0x568fc9[_0x9ed6('0x42')];_0x47741b[_0x9ed6('0x4a')]=qs['sort'](_0x58e15e[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x47741b[_0x9ed6('0x4c')]=qs['filters'](_[_0x9ed6('0x4d')](_0x58e15e['query'],_0x568fc9['filters']));if(_0x58e15e[_0x9ed6('0x43')]['filter']){_0x47741b['where']=_[_0x9ed6('0x4f')](_0x47741b[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x47741b[_0x9ed6('0x47')],function(_0x3ae74b){var _0x151382={};_0x151382[_0x3ae74b]={'$like':'%'+_0x58e15e[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x151382;})});}_0x47741b=_[_0x9ed6('0x4f')]({},_0x47741b,_0x58e15e[_0x9ed6('0x5b')]);return _0x136264[_0x9ed6('0xbe')](_0x47741b);}})[_0x9ed6('0x3a')](function(_0x4b977e){if(_0x4b977e){_0x288fe0=_0x4b977e[_0x9ed6('0x48')];if(!_0x58e15e['query'][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x47741b[_0x9ed6('0x32')]=qs['limit'](_0x58e15e[_0x9ed6('0x43')]['limit']);_0x47741b[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x58e15e['query']['offset']);}return _0x136264[_0x9ed6('0xbe')](_0x47741b);}})[_0x9ed6('0x3a')](function(_0x19824d){if(_0x19824d){return _0x19824d?{'count':_0x288fe0,'rows':_0x19824d}:null;}})[_0x9ed6('0x3a')](respondWithResult(_0x35566f,null))[_0x9ed6('0x2b')](handleError(_0x35566f,null));}; \ No newline at end of file +var _0xb6a9=['appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','dataValues','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','end','status','json','count','offset','limit','set','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','filter','merge','where','type','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','Disposition','getDispositions','findOne','pick','FaxAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','map','removeAnswers','addInteraction','FaxInteraction','omit','hasOwnProperty','Contact','User','Owner','fullname','Tags','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb6a9,0x1b6));var _0x9b6a=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb6a9[_0x4b2863];return _0x567d67;};'use strict';var pdf=require(_0x9b6a('0x0'));var emlformat=require(_0x9b6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9b6a('0x2'));var jsonpatch=require(_0x9b6a('0x3'));var rp=require(_0x9b6a('0x4'));var moment=require(_0x9b6a('0x5'));var BPromise=require(_0x9b6a('0x6'));var Mustache=require(_0x9b6a('0x7'));var util=require(_0x9b6a('0x8'));var path=require(_0x9b6a('0x9'));var sox=require(_0x9b6a('0xa'));var csv=require('to-csv');var ejs=require(_0x9b6a('0xb'));var fs=require('fs');var _=require(_0x9b6a('0xc'));var squel=require(_0x9b6a('0xd'));var crypto=require(_0x9b6a('0xe'));var jsforce=require(_0x9b6a('0xf'));var deskjs=require(_0x9b6a('0x10'));var toCsv=require(_0x9b6a('0x11'));var querystring=require(_0x9b6a('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b6a('0x13'));var qs=require(_0x9b6a('0x14'));var hardwareService=require(_0x9b6a('0x15'));var logger=require(_0x9b6a('0x16'))(_0x9b6a('0x17'));var utils=require(_0x9b6a('0x18'));var config=require(_0x9b6a('0x19'));var db=require(_0x9b6a('0x1a'))['db'];config[_0x9b6a('0x1b')]=_['defaults'](config[_0x9b6a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b6a('0x1c'))(new Redis(config[_0x9b6a('0x1b')]));require(_0x9b6a('0x1d'))['register'](socket);var jayson=require(_0x9b6a('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x9b6a('0x1f')][_0x9b6a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3f0f9c,_0x594c1a,_0x4d422b){if(_0x4d422b){var _0x575c09=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x575c09['test'](_0x594c1a)){return _0x3f0f9c;}else{throw new Error(_0x9b6a('0x21'));}}else{return _0x3f0f9c;}}function respondWithRpcPromise(_0x297e8a,_0x5130ce,_0x18ded5,_0xff120){return new BPromise(function(_0x3723ac,_0x36b169){var _0x38ce7e=_0xff120||client;return _0x38ce7e['request'](_0x297e8a,_0x18ded5)[_0x9b6a('0x22')](function(_0x469cf0){logger['info'](_0x9b6a('0x23'),_0x5130ce,'request\x20sent');logger['debug'](_0x9b6a('0x24'),_0x5130ce,_0x9b6a('0x25'),JSON[_0x9b6a('0x26')](_0x469cf0));if(_0x469cf0[_0x9b6a('0x27')]){if(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x28')]===0x1f4){logger['error'](_0x9b6a('0x23'),_0x5130ce,_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);return _0x36b169(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);}logger['error'](_0x9b6a('0x23'),_0x5130ce,_0x469cf0['error'][_0x9b6a('0x29')]);return _0x3723ac(_0x469cf0[_0x9b6a('0x27')][_0x9b6a('0x29')]);}else{logger[_0x9b6a('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x5130ce,_0x9b6a('0x25'));_0x3723ac(_0x469cf0[_0x9b6a('0x2b')][_0x9b6a('0x29')]);}})['catch'](function(_0x494a4b){logger[_0x9b6a('0x27')](_0x9b6a('0x23'),_0x5130ce,_0x494a4b);_0x36b169(_0x494a4b);});});}function respondWithStatusCode(_0x52c787,_0x1d80d0){_0x1d80d0=_0x1d80d0||0xcc;return function(_0x31d0e3){if(_0x31d0e3){return _0x52c787['sendStatus'](_0x1d80d0);}return _0x52c787['status'](_0x1d80d0)[_0x9b6a('0x2c')]();};}function respondWithResult(_0xd6914d,_0x2291a0){_0x2291a0=_0x2291a0||0xc8;return function(_0xabdaf1){if(_0xabdaf1){return _0xd6914d[_0x9b6a('0x2d')](_0x2291a0)[_0x9b6a('0x2e')](_0xabdaf1);}};}function respondWithFilteredResult(_0x52cc71,_0x133719){return function(_0x458458){if(_0x458458){var _0x36dc81=_0x458458[_0x9b6a('0x2f')],_0x3f6539=_0x133719[_0x9b6a('0x30')],_0x3907bb=_0x133719[_0x9b6a('0x30')]+_0x133719[_0x9b6a('0x31')],_0x48a436;if(_0x3907bb>=_0x36dc81){_0x3907bb=_0x36dc81;_0x48a436=0xc8;}else{_0x48a436=0xce;}_0x52cc71['status'](_0x48a436);return _0x52cc71[_0x9b6a('0x32')]('Content-Range',_0x3f6539+'-'+_0x3907bb+'/'+_0x36dc81)[_0x9b6a('0x2e')](_0x458458);}return null;};}function patchUpdates(_0x22e446){return function(_0x2aef9a){try{jsonpatch['apply'](_0x2aef9a,_0x22e446,!![]);}catch(_0x3ddd53){return BPromise[_0x9b6a('0x33')](_0x3ddd53);}return _0x2aef9a[_0x9b6a('0x34')]();};}function saveUpdates(_0x1fcf47,_0x2f1351){return function(_0x2480a9){if(_0x2480a9){return _0x2480a9[_0x9b6a('0x35')](_0x1fcf47)[_0x9b6a('0x22')](function(_0x34d56c){return _0x34d56c;});}return null;};}function removeEntity(_0x57d5bb,_0x2f4d49){return function(_0x2c00f4){if(_0x2c00f4){return _0x2c00f4[_0x9b6a('0x36')]()[_0x9b6a('0x22')](function(){var _0x44eee6=_0x2c00f4[_0x9b6a('0x37')]({'plain':!![]});var _0x5684c8=_0x9b6a('0x38');return db[_0x9b6a('0x39')][_0x9b6a('0x36')]({'where':{'type':_0x5684c8,'resourceId':_0x44eee6['id']}})[_0x9b6a('0x22')](function(){return _0x2c00f4;});})['then'](function(){_0x57d5bb[_0x9b6a('0x2d')](0xcc)[_0x9b6a('0x2c')]();});}};}function handleEntityNotFound(_0x46b5fd,_0x39aa59){return function(_0x7cd99a){if(!_0x7cd99a){_0x46b5fd[_0x9b6a('0x3a')](0x194);}return _0x7cd99a;};}function handleError(_0x2506e8,_0x54a132){_0x54a132=_0x54a132||0x1f4;return function(_0x43a5fa){logger[_0x9b6a('0x27')](_0x43a5fa['stack']);if(_0x43a5fa[_0x9b6a('0x3b')]){delete _0x43a5fa['name'];}_0x2506e8[_0x9b6a('0x2d')](_0x54a132)[_0x9b6a('0x3c')](_0x43a5fa);};}exports[_0x9b6a('0x3d')]=function(_0x359a21,_0x2aa5b4){var _0xe9bad4={'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]},_0x53e6c0={},_0x490ee1={'count':0x0,'rows':[]};var _0x59b43e=db[_0x9b6a('0x40')][_0x9b6a('0x41')];_0x53e6c0['model']=_[_0x9b6a('0x42')](_0x59b43e);_0x53e6c0[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x359a21['query']);_0x53e6c0[_0x9b6a('0x44')]=_['intersection'](_0x53e6c0[_0x9b6a('0x45')],_0x53e6c0[_0x9b6a('0x43')]);_0xe9bad4['attributes']=_[_0x9b6a('0x46')](_0x53e6c0[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x359a21[_0x9b6a('0x43')]['fields']));_0xe9bad4[_0x9b6a('0x48')]=_0xe9bad4['attributes'][_0x9b6a('0x49')]?_0xe9bad4[_0x9b6a('0x48')]:_0x53e6c0[_0x9b6a('0x45')];if(!_0x359a21[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0xe9bad4[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x359a21['query'][_0x9b6a('0x31')]);_0xe9bad4['offset']=qs[_0x9b6a('0x30')](_0x359a21['query'][_0x9b6a('0x30')]);}_0xe9bad4[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0xe9bad4['where']=qs['filters'](_['pick'](_0x359a21[_0x9b6a('0x43')],_0x53e6c0[_0x9b6a('0x44')]));if(_0x359a21['query'][_0x9b6a('0x4d')]){_0xe9bad4['where']=_[_0x9b6a('0x4e')](_0xe9bad4[_0x9b6a('0x4f')],{'$or':_['map'](_0x59b43e,function(_0x18563b){if(_0x18563b[_0x9b6a('0x50')]['key']!=='VIRTUAL'){var _0x43c1bb={};_0x43c1bb[_0x18563b[_0x9b6a('0x51')]]={'$like':'%'+_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x43c1bb;}})});}_0xe9bad4=_[_0x9b6a('0x4e')]({},_0xe9bad4,_0x359a21[_0x9b6a('0x52')]);var _0x20ec22={'where':_0xe9bad4[_0x9b6a('0x4f')]};return db[_0x9b6a('0x40')][_0x9b6a('0x2f')](_0x20ec22)[_0x9b6a('0x22')](function(_0x502053){_0x490ee1[_0x9b6a('0x2f')]=_0x502053;if(_0x359a21[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0xe9bad4[_0x9b6a('0x54')]=[{'all':!![]}];}return db[_0x9b6a('0x40')][_0x9b6a('0x55')](_0xe9bad4);})['then'](function(_0x126e03){_0x490ee1[_0x9b6a('0x56')]=_0x126e03;return _0x490ee1;})['then'](respondWithFilteredResult(_0x2aa5b4,_0xe9bad4))[_0x9b6a('0x57')](handleError(_0x2aa5b4,null));};exports[_0x9b6a('0x58')]=function(_0x270693,_0xfd6733){var _0x224455={'raw':![],'where':{'id':_0x270693[_0x9b6a('0x59')]['id']},'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]},_0x14c351={};_0x14c351[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x40')][_0x9b6a('0x41')]);_0x14c351[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x270693['query']);_0x14c351['filters']=_['intersection'](_0x14c351[_0x9b6a('0x45')],_0x14c351['query']);_0x224455['attributes']=_[_0x9b6a('0x46')](_0x14c351[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x270693[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x224455[_0x9b6a('0x48')]=_0x224455['attributes'][_0x9b6a('0x49')]?_0x224455['attributes']:_0x14c351[_0x9b6a('0x45')];if(_0x270693['query'][_0x9b6a('0x53')]){_0x224455['include']=[{'all':!![]}];}_0x224455=_['merge']({},_0x224455,_0x270693[_0x9b6a('0x52')]);return db['FaxAccount']['find'](_0x224455)[_0x9b6a('0x22')](handleEntityNotFound(_0xfd6733,null))[_0x9b6a('0x22')](respondWithResult(_0xfd6733,null))['catch'](handleError(_0xfd6733,null));};exports[_0x9b6a('0x5a')]=function(_0x3eb883,_0x9bf585){return db['FaxAccount'][_0x9b6a('0x5a')](_0x3eb883[_0x9b6a('0x5b')],{})[_0x9b6a('0x22')](function(_0xf46887){var _0x29dac5=_0x3eb883[_0x9b6a('0x5c')][_0x9b6a('0x37')]({'plain':!![]});if(!_0x29dac5)throw new Error(_0x9b6a('0x5d'));if(_0x29dac5[_0x9b6a('0x5e')]===_0x9b6a('0x5c')){var _0x1297bb=_0xf46887[_0x9b6a('0x37')]({'plain':!![]});var _0x5c2526=_0x9b6a('0x38');return db[_0x9b6a('0x5f')]['find']({'where':{'name':_0x5c2526,'userProfileId':_0x29dac5[_0x9b6a('0x60')]},'raw':!![]})['then'](function(_0x59d3eb){if(_0x59d3eb&&_0x59d3eb[_0x9b6a('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x1297bb[_0x9b6a('0x3b')],'resourceId':_0x1297bb['id'],'type':_0x59d3eb[_0x9b6a('0x3b')],'sectionId':_0x59d3eb['id']},{})[_0x9b6a('0x22')](function(){return _0xf46887;});}else{return _0xf46887;}})[_0x9b6a('0x57')](function(_0x56cdf1){logger[_0x9b6a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56cdf1);throw _0x56cdf1;});}return _0xf46887;})[_0x9b6a('0x22')](respondWithResult(_0x9bf585,0xc9))[_0x9b6a('0x57')](handleError(_0x9bf585,null));};exports['update']=function(_0x26d397,_0x5f48a8){if(_0x26d397['body']['id']){delete _0x26d397[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x26d397[_0x9b6a('0x59')]['id']},'include':[{'model':db[_0x9b6a('0x3e')],'as':_0x9b6a('0x3f')}]})[_0x9b6a('0x22')](handleEntityNotFound(_0x5f48a8,null))[_0x9b6a('0x22')](saveUpdates(_0x26d397[_0x9b6a('0x5b')],null))[_0x9b6a('0x22')](respondWithResult(_0x5f48a8,null))[_0x9b6a('0x57')](handleError(_0x5f48a8,null));};exports[_0x9b6a('0x36')]=function(_0x3c5a64,_0x12082c){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x3c5a64[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x12082c,null))['then'](removeEntity(_0x12082c,null))['catch'](handleError(_0x12082c,null));};exports[_0x9b6a('0x63')]=function(_0x206ad4,_0x4e79e3){return db[_0x9b6a('0x40')][_0x9b6a('0x63')]()[_0x9b6a('0x22')](respondWithResult(_0x4e79e3,null))[_0x9b6a('0x57')](handleError(_0x4e79e3,null));};exports[_0x9b6a('0x64')]=function(_0x2cff13,_0x2c177b,_0x489570){if(_0x2cff13['body']['id']){delete _0x2cff13[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x2cff13[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x2c177b,null))[_0x9b6a('0x22')](function(_0x4c56cf){if(_0x4c56cf){_0x2cff13['body']['FaxAccountId']=_0x4c56cf['id'];return db[_0x9b6a('0x65')][_0x9b6a('0x5a')](_0x2cff13[_0x9b6a('0x5b')]);}})[_0x9b6a('0x22')](respondWithResult(_0x2c177b,null))[_0x9b6a('0x57')](handleError(_0x2c177b,null));};exports[_0x9b6a('0x66')]=function(_0x4b8b7d,_0x118735,_0x3d0d61){var _0x4d3714={'raw':![],'where':{}};var _0x4dc8b3={};var _0x118a0a={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x4b8b7d[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x118735,null))[_0x9b6a('0x22')](function(_0x1ff9c1){if(_0x1ff9c1){_0x4dc8b3[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db['Disposition'][_0x9b6a('0x41')]);_0x4dc8b3['query']=_[_0x9b6a('0x42')](_0x4b8b7d[_0x9b6a('0x43')]);_0x4dc8b3[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0x4dc8b3['model'],_0x4dc8b3[_0x9b6a('0x43')]);_0x4d3714[_0x9b6a('0x48')]=_['intersection'](_0x4dc8b3['model'],qs['fields'](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x4d3714['attributes']=_0x4d3714['attributes'][_0x9b6a('0x49')]?_0x4d3714[_0x9b6a('0x48')]:_0x4dc8b3['model'];if(!_0x4b8b7d[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x4d3714[_0x9b6a('0x31')]=qs['limit'](_0x4b8b7d[_0x9b6a('0x43')]['limit']);_0x4d3714[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x4d3714[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x4d3714['where']=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x4b8b7d[_0x9b6a('0x43')],_0x4dc8b3['filters']));_0x4d3714[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x1ff9c1['id'];if(_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x4d3714[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x4d3714[_0x9b6a('0x4f')],{'$or':_['map'](_0x4d3714['attributes'],function(_0x348035){var _0x592df2={};_0x592df2[_0x348035]={'$like':'%'+_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x592df2;})});}_0x4d3714=_[_0x9b6a('0x4e')]({},_0x4d3714,_0x4b8b7d[_0x9b6a('0x52')]);return db[_0x9b6a('0x65')][_0x9b6a('0x2f')]({'where':_0x4d3714[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x3d753b){_0x118a0a[_0x9b6a('0x2f')]=_0x3d753b;if(_0x4b8b7d[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0x4d3714['include']=[{'all':!![]}];}return db['Disposition'][_0x9b6a('0x55')](_0x4d3714);})[_0x9b6a('0x22')](function(_0x85b630){_0x118a0a['rows']=_0x85b630;return _0x118a0a;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x118735,_0x4d3714))[_0x9b6a('0x57')](handleError(_0x118735,null));};exports[_0x9b6a('0x6a')]=function(_0x53dfb6,_0xfc1be7,_0x57d9fd){return db['FaxAccount'][_0x9b6a('0x62')]({'where':{'id':_0x53dfb6[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0xfc1be7,null))[_0x9b6a('0x22')](function(_0x383f77){if(_0x383f77){return _0x383f77[_0x9b6a('0x6a')](_0x53dfb6['query'][_0x9b6a('0x6b')]);}})[_0x9b6a('0x22')](respondWithStatusCode(_0xfc1be7,null))[_0x9b6a('0x57')](handleError(_0xfc1be7,null));};exports[_0x9b6a('0x6c')]=function(_0x3b0855,_0x2f8a45,_0x3cb1b2){if(_0x3b0855[_0x9b6a('0x5b')]['id']){delete _0x3b0855[_0x9b6a('0x5b')]['id'];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x3b0855[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x2f8a45,null))['then'](function(_0x30a85){if(_0x30a85){_0x3b0855['body'][_0x9b6a('0x69')]=_0x30a85['id'];return db['CannedAnswer'][_0x9b6a('0x5a')](_0x3b0855[_0x9b6a('0x5b')]);}})['then'](respondWithResult(_0x2f8a45,null))[_0x9b6a('0x57')](handleError(_0x2f8a45,null));};exports[_0x9b6a('0x6d')]=function(_0x39b139,_0x5d08fe,_0x1a3a3c){var _0x58b486={'raw':![],'where':{}};var _0xc4b3d4={};var _0x4272d0={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9b6a('0x67')]({'where':{'id':_0x39b139[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d08fe,null))['then'](function(_0x1a333f){if(_0x1a333f){_0xc4b3d4[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x6e')][_0x9b6a('0x41')]);_0xc4b3d4[_0x9b6a('0x43')]=_[_0x9b6a('0x42')](_0x39b139['query']);_0xc4b3d4[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0xc4b3d4[_0x9b6a('0x45')],_0xc4b3d4[_0x9b6a('0x43')]);_0x58b486['attributes']=_[_0x9b6a('0x46')](_0xc4b3d4['model'],qs[_0x9b6a('0x47')](_0x39b139[_0x9b6a('0x43')]['fields']));_0x58b486['attributes']=_0x58b486[_0x9b6a('0x48')]['length']?_0x58b486[_0x9b6a('0x48')]:_0xc4b3d4[_0x9b6a('0x45')];if(!_0x39b139[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x58b486['limit']=qs[_0x9b6a('0x31')](_0x39b139['query'][_0x9b6a('0x31')]);_0x58b486[_0x9b6a('0x30')]=qs['offset'](_0x39b139[_0x9b6a('0x43')]['offset']);}_0x58b486['order']=qs[_0x9b6a('0x4c')](_0x39b139[_0x9b6a('0x43')]['sort']);_0x58b486[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x39b139[_0x9b6a('0x43')],_0xc4b3d4[_0x9b6a('0x44')]));_0x58b486[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x1a333f['id'];if(_0x39b139['query']['filter']){_0x58b486['where']=_[_0x9b6a('0x4e')](_0x58b486[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x58b486[_0x9b6a('0x48')],function(_0x56e4ac){var _0x2c71fe={};_0x2c71fe[_0x56e4ac]={'$like':'%'+_0x39b139['query'][_0x9b6a('0x4d')]+'%'};return _0x2c71fe;})});}_0x58b486=_['merge']({},_0x58b486,_0x39b139[_0x9b6a('0x52')]);return db[_0x9b6a('0x6e')]['count']({'where':_0x58b486[_0x9b6a('0x4f')]})['then'](function(_0x86907){_0x4272d0[_0x9b6a('0x2f')]=_0x86907;if(_0x39b139[_0x9b6a('0x43')][_0x9b6a('0x53')]){_0x58b486[_0x9b6a('0x54')]=[{'all':!![]}];}return db[_0x9b6a('0x6e')][_0x9b6a('0x55')](_0x58b486);})[_0x9b6a('0x22')](function(_0x1d3cea){_0x4272d0[_0x9b6a('0x56')]=_0x1d3cea;return _0x4272d0;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x5d08fe,_0x58b486))['catch'](handleError(_0x5d08fe,null));};exports[_0x9b6a('0x70')]=function(_0x8c3b2c,_0x47e702,_0x42de76){return db['FaxAccount'][_0x9b6a('0x62')]({'where':{'id':_0x8c3b2c[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x47e702,null))[_0x9b6a('0x22')](function(_0x17b076){if(_0x17b076){return _0x17b076[_0x9b6a('0x70')](_0x8c3b2c[_0x9b6a('0x43')][_0x9b6a('0x6b')]);}})['then'](respondWithStatusCode(_0x47e702,null))['catch'](handleError(_0x47e702,null));};exports[_0x9b6a('0x71')]=function(_0xcbdb5a,_0x16e2db,_0x24992b){return db[_0x9b6a('0x72')][_0x9b6a('0x62')]({'where':{'id':_0xcbdb5a[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x16e2db,null))[_0x9b6a('0x22')](function(_0x1e3a09){if(_0x1e3a09){return _0x1e3a09['addInteraction'](_0xcbdb5a[_0x9b6a('0x5b')][_0x9b6a('0x6b')],_[_0x9b6a('0x73')](_0xcbdb5a[_0x9b6a('0x5b')],[_0x9b6a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x16e2db,null))[_0x9b6a('0x57')](handleError(_0x16e2db,null));};exports['getInteractions']=function(_0x198e0a,_0x1f7a57,_0x2f98c4){var _0x1bbb5c={'raw':![],'where':{}};var _0x515385={};var _0x502dba={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x198e0a[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x1f7a57,null))[_0x9b6a('0x22')](function(_0x29c4f4){if(_0x29c4f4){_0x515385['model']=_['keys'](db['FaxInteraction']['rawAttributes']);_0x515385[_0x9b6a('0x43')]=_['keys'](_0x198e0a['query']);_0x515385[_0x9b6a('0x44')]=_[_0x9b6a('0x46')](_0x515385[_0x9b6a('0x45')],_0x515385['query']);_0x1bbb5c[_0x9b6a('0x48')]=_[_0x9b6a('0x46')](_0x515385[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x198e0a['query'][_0x9b6a('0x47')]));_0x1bbb5c['attributes']=_0x1bbb5c[_0x9b6a('0x48')]['length']?_0x1bbb5c['attributes']:_0x515385[_0x9b6a('0x45')];if(!_0x198e0a['query'][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x1bbb5c[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x1bbb5c[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x1bbb5c[_0x9b6a('0x4b')]=qs['sort'](_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x1bbb5c[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x198e0a['query'],_0x515385['filters']));_0x1bbb5c[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x29c4f4['id'];if(_0x198e0a[_0x9b6a('0x43')]['filter']){_0x1bbb5c[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x1bbb5c[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x1bbb5c[_0x9b6a('0x48')],function(_0x11ffb8){var _0x2b4a53={};_0x2b4a53[_0x11ffb8]={'$like':'%'+_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x2b4a53;})});}_0x1bbb5c=_['merge']({},_0x1bbb5c,_0x198e0a[_0x9b6a('0x52')]);return db['FaxInteraction'][_0x9b6a('0x2f')]({'where':_0x1bbb5c[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x75df4d){_0x502dba['count']=_0x75df4d;if(_0x198e0a[_0x9b6a('0x43')]['includeAll']){_0x1bbb5c[_0x9b6a('0x54')]=[{'model':db['CmContact'],'as':_0x9b6a('0x75'),'required':![]},{'model':db[_0x9b6a('0x76')],'as':_0x9b6a('0x77'),'attributes':['name',_0x9b6a('0x78'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x9b6a('0x79'),'attributes':['id','name','color'],'where':_0x198e0a[_0x9b6a('0x43')]['tag']?{'id':_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x7a')]}:undefined,'required':_0x198e0a[_0x9b6a('0x43')][_0x9b6a('0x7a')]?!![]:![]}];}return db[_0x9b6a('0x72')]['findAll'](_0x1bbb5c);})['then'](function(_0x215461){_0x502dba[_0x9b6a('0x56')]=_0x215461;return _0x502dba;});}})[_0x9b6a('0x22')](respondWithFilteredResult(_0x1f7a57,_0x1bbb5c))[_0x9b6a('0x57')](handleError(_0x1f7a57,null));};exports['addApplications']=function(_0x30d212,_0x56b026,_0xf130ef){return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x30d212[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x56b026,null))[_0x9b6a('0x22')](function(_0x2423a7){if(_0x2423a7){return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x59027f){return db[_0x9b6a('0x7d')]['destroy']({'where':{'FaxAccountId':_0x30d212[_0x9b6a('0x59')]['id']},'transaction':_0x59027f})[_0x9b6a('0x22')](function(_0x4c0589){var _0x2f3f98=_['map'](_0x30d212[_0x9b6a('0x5b')],function(_0x309d6f){_0x309d6f['FaxAccountId']=_0x30d212[_0x9b6a('0x59')]['id'];return _0x309d6f;});return db[_0x9b6a('0x7d')][_0x9b6a('0x7e')](_0x2f3f98,{'transaction':_0x59027f});});})[_0x9b6a('0x22')](function(){return db[_0x9b6a('0x7d')][_0x9b6a('0x7f')]({'where':{'FaxAccountId':_0x30d212[_0x9b6a('0x59')]['id']},'order':_0x9b6a('0x80')});});}})[_0x9b6a('0x22')](respondWithResult(_0x56b026,null))[_0x9b6a('0x57')](handleError(_0x56b026,null));};exports[_0x9b6a('0x81')]=function(_0x2dc6a6,_0x1d511d,_0x4f460b){var _0x10fa01={};var _0x358a06={};var _0x240388;var _0x380787;return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x2dc6a6[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x1d511d,null))[_0x9b6a('0x22')](function(_0x1baf50){if(_0x1baf50){_0x240388=_0x1baf50;_0x358a06[_0x9b6a('0x45')]=_[_0x9b6a('0x42')](db[_0x9b6a('0x7d')][_0x9b6a('0x41')]);_0x358a06[_0x9b6a('0x43')]=_['keys'](_0x2dc6a6[_0x9b6a('0x43')]);_0x358a06[_0x9b6a('0x44')]=_['intersection'](_0x358a06[_0x9b6a('0x45')],_0x358a06[_0x9b6a('0x43')]);_0x10fa01['attributes']=_[_0x9b6a('0x46')](_0x358a06[_0x9b6a('0x45')],qs[_0x9b6a('0x47')](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x10fa01[_0x9b6a('0x48')]=_0x10fa01[_0x9b6a('0x48')][_0x9b6a('0x49')]?_0x10fa01[_0x9b6a('0x48')]:_0x358a06[_0x9b6a('0x45')];_0x10fa01['order']=qs[_0x9b6a('0x4c')](_0x2dc6a6['query'][_0x9b6a('0x4c')]);_0x10fa01[_0x9b6a('0x4f')]=qs['filters'](_[_0x9b6a('0x68')](_0x2dc6a6[_0x9b6a('0x43')],_0x358a06[_0x9b6a('0x44')]));if(_0x2dc6a6['query'][_0x9b6a('0x4d')]){_0x10fa01[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x10fa01[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x10fa01['attributes'],function(_0x20b4dc){var _0x5a37a6={};_0x5a37a6[_0x20b4dc]={'$like':'%'+_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x5a37a6;})});}_0x10fa01=_[_0x9b6a('0x4e')]({},_0x10fa01,_0x2dc6a6[_0x9b6a('0x52')]);return _0x240388[_0x9b6a('0x81')](_0x10fa01);}})[_0x9b6a('0x22')](function(_0x38b486){if(_0x38b486){_0x380787=_0x38b486[_0x9b6a('0x49')];if(!_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x10fa01['limit']=qs[_0x9b6a('0x31')](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x10fa01[_0x9b6a('0x30')]=qs['offset'](_0x2dc6a6[_0x9b6a('0x43')][_0x9b6a('0x30')]);}return _0x240388[_0x9b6a('0x81')](_0x10fa01);}})[_0x9b6a('0x22')](function(_0x1e6be6){if(_0x1e6be6){return _0x1e6be6?{'count':_0x380787,'rows':_0x1e6be6}:null;}})[_0x9b6a('0x22')](respondWithResult(_0x1d511d,null))[_0x9b6a('0x57')](handleError(_0x1d511d,null));};function Extension(_0x5d4d06,_0x5b02bc,_0x23ddaf,_0xd2c0d8){this[_0x9b6a('0x82')]=_0x9b6a('0x83');this[_0x9b6a('0x84')]=_0x5d4d06[_0x9b6a('0x85')];this[_0x9b6a('0x86')]=_0xd2c0d8;this[_0x9b6a('0x50')]=_0x9b6a('0x87');this[_0x9b6a('0x88')]=_0x9b6a('0x89');this[_0x9b6a('0x69')]=_0x5d4d06['id'];this[_0x9b6a('0x80')]=_0x5b02bc;this[_0x9b6a('0x8a')]=_0x23ddaf;}function createExtensionsReciveFax(_0x5b3810){var _0x1d0ee7=0x1;var _0x150285=[];_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,'',_0x9b6a('0x8c')));_0x1d0ee7+=0x1;_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x8d'),_0x9b6a('0x8e')));_0x1d0ee7+=0x1;for(var _0x54edcd in _0x5b3810){if(_0x5b3810[_0x9b6a('0x74')](_0x54edcd)&&(_0x54edcd==='ecm'||_0x54edcd===_0x9b6a('0x85')||_0x54edcd===_0x9b6a('0x8f')||_0x54edcd==='faxdetect'||_0x54edcd===_0x9b6a('0x90')||_0x54edcd===_0x9b6a('0x91')||_0x54edcd===_0x9b6a('0x92')||_0x54edcd===_0x9b6a('0x93')||_0x54edcd==='t38timeout')){_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x94')+_0x54edcd+')='+_0x5b3810[_0x54edcd],_0x9b6a('0x8e')));_0x1d0ee7+=0x1;}}_0x150285['push'](new Extension(_0x5b3810,_0x1d0ee7,'6',_0x9b6a('0x95')));_0x1d0ee7+=0x1;_0x150285[_0x9b6a('0x8b')](new Extension(_0x5b3810,_0x1d0ee7,_0x9b6a('0x96'),'ReceiveFax'));_0x1d0ee7=0x0;return _0x150285;}exports[_0x9b6a('0x97')]=function(_0x77777d,_0x2ea2f0,_0xb2d4a8){var _0x217a93;return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x2638ed){return db[_0x9b6a('0x40')]['create'](_0x77777d[_0x9b6a('0x5b')],{'transaction':_0x2638ed})[_0x9b6a('0x22')](function(_0x263361){_0x217a93=_0x263361[_0x9b6a('0x37')]({'plain':!![]});return db[_0x9b6a('0x98')]['bulkCreate'](createExtensionsReciveFax(_0x217a93),{'transaction':_0x2638ed});});})[_0x9b6a('0x22')](function(){return _0x217a93;})[_0x9b6a('0x22')](respondWithResult(_0x2ea2f0,null))[_0x9b6a('0x57')](handleError(_0x2ea2f0,null));};exports[_0x9b6a('0x99')]=function(_0x5a8b25,_0x51d3b8,_0x4a37ee){var _0x31e504;return db[_0x9b6a('0x7b')][_0x9b6a('0x7c')](function(_0x37ca1b){return db[_0x9b6a('0x40')][_0x9b6a('0x35')](_0x5a8b25[_0x9b6a('0x5b')],{'where':{'id':_0x5a8b25[_0x9b6a('0x5b')]['id']},'transaction':_0x37ca1b})[_0x9b6a('0x22')](function(_0x9d8d31){return db[_0x9b6a('0x98')][_0x9b6a('0x36')]({'where':{'FaxAccountId':_0x5a8b25[_0x9b6a('0x5b')]['id']},'transaction':_0x37ca1b})['then'](function(_0x589ef0){return db[_0x9b6a('0x98')][_0x9b6a('0x7e')](createExtensionsReciveFax(_[_0x9b6a('0x73')](_0x5a8b25[_0x9b6a('0x5b')],['tech',_0x9b6a('0x9a'),_0x9b6a('0x9b'),_0x9b6a('0x9c'),_0x9b6a('0x9d'),_0x9b6a('0x9e')])),{'transaction':_0x37ca1b});});});})['then'](function(){return db['FaxAccount'][_0x9b6a('0x9f')](_0x5a8b25['body']['id']);})[_0x9b6a('0x22')](respondWithResult(_0x51d3b8,null))[_0x9b6a('0x57')](handleError(_0x51d3b8,null));};exports[_0x9b6a('0xa0')]=function(_0x27d6d5,_0x33e967,_0x36906a){var _0x1aab31={'raw':!![],'where':{}};var _0x415d17={};var _0x291dec={'count':0x0,'rows':[]};return db[_0x9b6a('0x40')][_0x9b6a('0x67')]({'where':{'id':_0x27d6d5[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x33e967,null))[_0x9b6a('0x22')](function(_0x2e911a){if(_0x2e911a){_0x415d17['model']=_[_0x9b6a('0x42')](db[_0x9b6a('0xa1')][_0x9b6a('0x41')]);_0x415d17['query']=_[_0x9b6a('0x42')](_0x27d6d5[_0x9b6a('0x43')]);_0x415d17[_0x9b6a('0x44')]=_['intersection'](_0x415d17[_0x9b6a('0x45')],_0x415d17[_0x9b6a('0x43')]);_0x1aab31['attributes']=_[_0x9b6a('0x46')](_0x415d17[_0x9b6a('0x45')],qs['fields'](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x47')]));_0x1aab31['attributes']=_0x1aab31['attributes'][_0x9b6a('0x49')]?_0x1aab31[_0x9b6a('0x48')]:_0x415d17['model'];if(!_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x74')](_0x9b6a('0x4a'))){_0x1aab31[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x27d6d5['query']['limit']);_0x1aab31[_0x9b6a('0x30')]=qs[_0x9b6a('0x30')](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x30')]);}_0x1aab31[_0x9b6a('0x4b')]=qs[_0x9b6a('0x4c')](_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x4c')]);_0x1aab31[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x27d6d5[_0x9b6a('0x43')],_0x415d17['filters']));_0x1aab31[_0x9b6a('0x4f')][_0x9b6a('0x69')]=_0x2e911a['id'];if(_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x1aab31[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x1aab31[_0x9b6a('0x4f')],{'$or':_[_0x9b6a('0x6f')](_0x1aab31[_0x9b6a('0x48')],function(_0x53195b){var _0x574813={};_0x574813[_0x53195b]={'$like':'%'+_0x27d6d5[_0x9b6a('0x43')]['filter']+'%'};return _0x574813;})});}if(_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0xa2')]){var _0xf098db=_0x27d6d5[_0x9b6a('0x43')][_0x9b6a('0xa2')][_0x9b6a('0xa3')](',');var _0x5e51ab={};_0x5e51ab[_0xf098db[0x0]]={'$gte':moment(_0xf098db[0x1])[_0x9b6a('0xa4')](_0x9b6a('0xa5'))};_0x1aab31['where']=_['merge'](_0x1aab31['where'],_0x5e51ab);}_0x1aab31=_['merge']({},_0x1aab31,_0x27d6d5[_0x9b6a('0x52')]);return db[_0x9b6a('0xa1')][_0x9b6a('0x2f')]({'where':_0x1aab31[_0x9b6a('0x4f')]})[_0x9b6a('0x22')](function(_0x2bf4da){_0x291dec[_0x9b6a('0x2f')]=_0x2bf4da;if(_0x27d6d5['query']['includeAll']){_0x1aab31['include']=[{'all':!![]}];}return db[_0x9b6a('0xa1')][_0x9b6a('0x55')](_0x1aab31);})[_0x9b6a('0x22')](function(_0x4f1d54){_0x291dec[_0x9b6a('0x56')]=_0x4f1d54;return _0x291dec;});}})['then'](respondWithFilteredResult(_0x33e967,_0x1aab31))[_0x9b6a('0x57')](handleError(_0x33e967,null));};exports[_0x9b6a('0x3c')]=function(_0x5c4181,_0x404078,_0x461520){var _0x35faa2,_0x438981={},_0x428b86;if(_0x5c4181['body']['to']){_0x428b86=_0x5c4181[_0x9b6a('0x5b')]['to'][0x0];}return db[_0x9b6a('0x40')]['find']({'where':{'id':_0x5c4181[_0x9b6a('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x9b6a('0xa6'),'include':[{'model':db['CmContact'],'as':_0x9b6a('0xa7'),'where':{'fax':_0x428b86},'limit':0x1,'order':[[_0x9b6a('0x9c'),'DESC']]}]}]})[_0x9b6a('0x22')](handleEntityNotFound(_0x404078,null))['then'](function(_0x399f10){_0x35faa2=_0x399f10;if(_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')]&&_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x9b6a('0x49')]){for(var _0x1bfed0=0x0;_0x1bfed0<_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x9b6a('0x49')];_0x1bfed0+=0x1){_0x5c4181['body']['attachments'][_0x1bfed0]={'filename':_0x5c4181[_0x9b6a('0x5b')]['attachments'][_0x1bfed0]['name'],'id':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x1bfed0]['id'],'path':path['join'](config[_0x9b6a('0xa9')],_0x9b6a('0xaa'),_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][_0x1bfed0][_0x9b6a('0xab')])};}}return respondWithRpcPromise(_0x9b6a('0xac'),'CheckAfterSend',{'FaxAccountId':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x59')]['id'])?undefined:_0x5c4181[_0x9b6a('0x59')]['id'],'path':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['path'])?undefined:_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')],'fax':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')]['to'][0x0])?undefined:_0x5c4181[_0x9b6a('0x5b')]['to'][0x0]},client9002);})[_0x9b6a('0x22')](function(){if(_0x35faa2){if(_['isNil'](_0x5c4181[_0x9b6a('0x5b')]['from'])){_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xae')]=util[_0x9b6a('0xa4')]('\x22%s\x22\x20<%s>',_0x35faa2[_0x9b6a('0x3b')],_0x35faa2[_0x9b6a('0xaf')]);}if(_0x35faa2[_0x9b6a('0xa6')]){if(_0x35faa2[_0x9b6a('0xa6')][_0x9b6a('0xa7')]['length']){return _0x35faa2[_0x9b6a('0xa6')]['Contacts'][0x0];}else{return db[_0x9b6a('0xb0')][_0x9b6a('0x5a')](_['defaults'](_0x5c4181['body'],{'firstName':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'phone':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'fax':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'ListId':_0x35faa2['ListId']}));}}else{throw new Error(_0x9b6a('0xb1'));}}else{throw new Error(_0x9b6a('0xb2'));}})[_0x9b6a('0x22')](function(_0x2c010c){if(_0x2c010c){return db[_0x9b6a('0x72')][_0x9b6a('0x62')]({'where':{'ContactId':_0x2c010c['id'],'closed':![],'FaxAccountId':_0x35faa2['id']}})[_0x9b6a('0x22')](function(_0x5d03a9){if(_0x5d03a9){return[_0x5d03a9,![]];}return db['FaxInteraction'][_0x9b6a('0x5a')]({'UserId':_0x5c4181[_0x9b6a('0x5c')]['id'],'ContactId':_0x2c010c['id'],'FaxAccountId':_0x35faa2['id'],'fax':_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x9b6a('0x4e')](_0x5c4181[_0x9b6a('0x5b')],{'read':![],'body':_0x5c4181['body'][_0x9b6a('0xa8')][0x0][_0x9b6a('0xb3')],'FaxAccountId':_0x35faa2['id'],'UserId':_0x5c4181[_0x9b6a('0x5c')]['id'],'ContactId':_0x2c010c['id'],'AttachmentId':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x9b6a('0xa1')],'as':_0x9b6a('0xb4')}]})[_0x9b6a('0x22')](function(_0x45616c){return[_0x45616c,!![]];});});}else{throw new Error(_0x9b6a('0xb5'));}})[_0x9b6a('0xb6')](function(_0x25ae99,_0x27fd37){if(_0x27fd37){return _0x25ae99;}return db['FaxMessage'][_0x9b6a('0x5a')]({'direction':_0x9b6a('0xb7'),'read':![],'body':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0xb3')],'FaxAccountId':_0x35faa2['id'],'FaxInteractionId':_0x25ae99['id'],'UserId':_0x5c4181['user']['id'],'ContactId':_0x25ae99['ContactId'],'AttachmentId':_0x5c4181['body'][_0x9b6a('0xa8')][0x0]['id']})['then'](function(_0x6628bd){_0x25ae99[_0x9b6a('0xb8')][_0x9b6a('0xb4')]=[];_0x25ae99['dataValues'][_0x9b6a('0xb4')][_0x9b6a('0x8b')](_0x6628bd[_0x9b6a('0xb8')]);return _0x25ae99;});})[_0x9b6a('0x22')](function(_0x1a97f8){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x9b6a('0xad')](_0x5c4181['params']['id'])?undefined:_0x5c4181['params']['id'],'path':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')])?undefined:_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0][_0x9b6a('0x9')],'fax':_[_0x9b6a('0xad')](_0x5c4181[_0x9b6a('0x5b')]['to'][0x0])?undefined:_0x5c4181[_0x9b6a('0x5b')]['to'][0x0],'AttachmentId':_0x5c4181[_0x9b6a('0x5b')][_0x9b6a('0xa8')][0x0]['id']},client9002)[_0x9b6a('0x22')](function(_0x218432){logger[_0x9b6a('0x2a')](_0x9b6a('0xb9'),_0x218432);})['catch'](function(_0x5eb35c){logger['info'](_0x9b6a('0xb9'),_0x5eb35c);});return _0x1a97f8;})[_0x9b6a('0x22')](respondWithResult(_0x404078,null))[_0x9b6a('0x57')](handleError(_0x404078,null));};exports[_0x9b6a('0xba')]=function(_0x21d20e,_0x27bf24,_0x386277){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x21d20e[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x27bf24,null))[_0x9b6a('0x22')](function(_0x328f74){if(_0x328f74){return _0x328f74['addAgents'](_0x21d20e[_0x9b6a('0x5b')][_0x9b6a('0x6b')],_[_0x9b6a('0x73')](_0x21d20e[_0x9b6a('0x5b')],['ids','id'])||{})[_0x9b6a('0xb6')](function(_0x388377){for(var _0x291b2c=0x0;_0x291b2c<_0x21d20e[_0x9b6a('0x5b')]['ids'][_0x9b6a('0x49')];_0x291b2c+=0x1){socket[_0x9b6a('0xbb')]('userFaxAccount:save',{'UserId':_0x21d20e[_0x9b6a('0x5b')][_0x9b6a('0x6b')][_0x291b2c],'FaxAccountId':_0x21d20e[_0x9b6a('0x59')]['id']});}return _0x388377;});}})[_0x9b6a('0x22')](respondWithResult(_0x27bf24,null))[_0x9b6a('0x57')](handleError(_0x27bf24,null));};exports[_0x9b6a('0xbc')]=function(_0x435d70,_0x5184f6,_0x51aea1){return db[_0x9b6a('0x40')][_0x9b6a('0x62')]({'where':{'id':_0x435d70[_0x9b6a('0x59')]['id']}})[_0x9b6a('0x22')](handleEntityNotFound(_0x5184f6,null))[_0x9b6a('0x22')](function(_0x4a348a){if(_0x4a348a){return _0x4a348a['removeAgents'](_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')])['then'](function(){if(_[_0x9b6a('0xbd')](_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')])){for(var _0x3c7d79=0x0;_0x3c7d79<_0x435d70[_0x9b6a('0x43')]['ids'][_0x9b6a('0x49')];_0x3c7d79+=0x1){socket[_0x9b6a('0xbb')](_0x9b6a('0xbe'),{'UserId':Number(_0x435d70[_0x9b6a('0x43')]['ids'][_0x3c7d79]),'FaxAccountId':Number(_0x435d70['params']['id'])});}}else{socket[_0x9b6a('0xbb')](_0x9b6a('0xbe'),{'UserId':Number(_0x435d70[_0x9b6a('0x43')][_0x9b6a('0x6b')]),'FaxAccountId':Number(_0x435d70[_0x9b6a('0x59')]['id'])});}});}})[_0x9b6a('0x22')](respondWithStatusCode(_0x5184f6,null))[_0x9b6a('0x57')](handleError(_0x5184f6,null));};exports[_0x9b6a('0xbf')]=function(_0x5f2469,_0x5a43f8,_0x31e516){var _0x5717a2={};var _0x28e485={};var _0x35f748;var _0x3799f9;return db['FaxAccount'][_0x9b6a('0x67')]({'where':{'id':_0x5f2469[_0x9b6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5a43f8,null))['then'](function(_0xa1a505){if(_0xa1a505){_0x35f748=_0xa1a505;_0x28e485['model']=_[_0x9b6a('0x42')](db['User'][_0x9b6a('0x41')]);_0x28e485[_0x9b6a('0x43')]=_['keys'](_0x5f2469[_0x9b6a('0x43')]);_0x28e485[_0x9b6a('0x44')]=_['intersection'](_0x28e485[_0x9b6a('0x45')],_0x28e485['query']);_0x5717a2[_0x9b6a('0x48')]=_['intersection'](_0x28e485['model'],qs[_0x9b6a('0x47')](_0x5f2469['query'][_0x9b6a('0x47')]));_0x5717a2['attributes']=_0x5717a2[_0x9b6a('0x48')]['length']?_0x5717a2['attributes']:_0x28e485[_0x9b6a('0x45')];_0x5717a2['order']=qs[_0x9b6a('0x4c')](_0x5f2469['query']['sort']);_0x5717a2[_0x9b6a('0x4f')]=qs[_0x9b6a('0x44')](_[_0x9b6a('0x68')](_0x5f2469[_0x9b6a('0x43')],_0x28e485[_0x9b6a('0x44')]));if(_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x4d')]){_0x5717a2[_0x9b6a('0x4f')]=_[_0x9b6a('0x4e')](_0x5717a2['where'],{'$or':_[_0x9b6a('0x6f')](_0x5717a2[_0x9b6a('0x48')],function(_0x11da13){var _0x1d9ab={};_0x1d9ab[_0x11da13]={'$like':'%'+_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x4d')]+'%'};return _0x1d9ab;})});}_0x5717a2=_[_0x9b6a('0x4e')]({},_0x5717a2,_0x5f2469['options']);return _0x35f748[_0x9b6a('0xbf')](_0x5717a2);}})['then'](function(_0x1c8a6e){if(_0x1c8a6e){_0x3799f9=_0x1c8a6e[_0x9b6a('0x49')];if(!_0x5f2469[_0x9b6a('0x43')]['hasOwnProperty'](_0x9b6a('0x4a'))){_0x5717a2[_0x9b6a('0x31')]=qs[_0x9b6a('0x31')](_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x31')]);_0x5717a2[_0x9b6a('0x30')]=qs['offset'](_0x5f2469[_0x9b6a('0x43')][_0x9b6a('0x30')]);}return _0x35f748[_0x9b6a('0xbf')](_0x5717a2);}})[_0x9b6a('0x22')](function(_0x29fd58){if(_0x29fd58){return _0x29fd58?{'count':_0x3799f9,'rows':_0x29fd58}:null;}})[_0x9b6a('0x22')](respondWithResult(_0x5a43f8,null))[_0x9b6a('0x57')](handleError(_0x5a43f8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7d878c3..a755f93 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 _0x66fe=['save','update','emit','hook','exports','events','FaxAccount','setMaxListeners'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x66fe,0x7d));var _0xe66f=function(_0x134710,_0x15c37){_0x134710=_0x134710-0x0;var _0x5790fc=_0x66fe[_0x134710];return _0x5790fc;};'use strict';var EventEmitter=require(_0xe66f('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe66f('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe66f('0x2')](0x0);var events={'afterCreate':_0xe66f('0x3'),'afterUpdate':_0xe66f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfd90f7){return function(_0x424166,_0x32777b,_0x43ac5b){FaxAccountEvents[_0xe66f('0x5')](_0xfd90f7+':'+_0x424166['id'],_0x424166);FaxAccountEvents['emit'](_0xfd90f7,_0x424166);_0x43ac5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe66f('0x6')](e,emitEvent(event));}}module[_0xe66f('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xacb6=['update','remove','emit','hasOwnProperty','hook','FaxAccount','setMaxListeners','save'];(function(_0x5bc345,_0x3ea6da){var _0x503c70=function(_0x5e0941){while(--_0x5e0941){_0x5bc345['push'](_0x5bc345['shift']());}};_0x503c70(++_0x3ea6da);}(_0xacb6,0x10d));var _0x6acb=function(_0x132487,_0x5d12f1){_0x132487=_0x132487-0x0;var _0x574190=_0xacb6[_0x132487];return _0x574190;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x6acb('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6acb('0x1')](0x0);var events={'afterCreate':_0x6acb('0x2'),'afterUpdate':_0x6acb('0x3'),'afterDestroy':_0x6acb('0x4')};function emitEvent(_0x540fb6){return function(_0x27008b,_0x45efa3,_0x5d162d){FaxAccountEvents[_0x6acb('0x5')](_0x540fb6+':'+_0x27008b['id'],_0x27008b);FaxAccountEvents[_0x6acb('0x5')](_0x540fb6,_0x27008b);_0x5d162d(null);};}for(var e in events){if(events[_0x6acb('0x6')](e)){var event=events[e];FaxAccount[_0x6acb('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 4104f74..b60a5f5 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 _0xa4b2=['../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','api','bluebird','request-promise','rimraf'];(function(_0x353b90,_0x528e73){var _0x4e96df=function(_0x2bc277){while(--_0x2bc277){_0x353b90['push'](_0x353b90['shift']());}};_0x4e96df(++_0x528e73);}(_0xa4b2,0x1e2));var _0x2a4b=function(_0x2c6cff,_0x5d12c2){_0x2c6cff=_0x2c6cff-0x0;var _0xa6bad9=_0xa4b2[_0x2c6cff];return _0xa6bad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a4b('0x0'));var moment=require('moment');var BPromise=require(_0x2a4b('0x1'));var rp=require(_0x2a4b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4b('0x3'));var config=require(_0x2a4b('0x4'));var attributes=require(_0x2a4b('0x5'));module['exports']=function(_0x13d691,_0x2bce18){return _0x13d691[_0x2a4b('0x6')](_0x2a4b('0x7'),attributes,{'tableName':_0x2a4b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dd9=['util','api','moment','bluebird','path','rimraf','./faxAccount.attributes','exports','FaxAccount'];(function(_0x5dbe76,_0x44c28b){var _0x50ed81=function(_0x23f254){while(--_0x23f254){_0x5dbe76['push'](_0x5dbe76['shift']());}};_0x50ed81(++_0x44c28b);}(_0x5dd9,0x1e6));var _0x95dd=function(_0x7aef09,_0x192202){_0x7aef09=_0x7aef09-0x0;var _0x224203=_0x5dd9[_0x7aef09];return _0x224203;};'use strict';var _=require('lodash');var util=require(_0x95dd('0x0'));var logger=require('../../config/logger')(_0x95dd('0x1'));var moment=require(_0x95dd('0x2'));var BPromise=require(_0x95dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x95dd('0x4'));var rimraf=require(_0x95dd('0x5'));var config=require('../../config/environment');var attributes=require(_0x95dd('0x6'));module[_0x95dd('0x7')]=function(_0x554402,_0x372e57){return _0x554402['define'](_0x95dd('0x8'),attributes,{'tableName':'fax_accounts','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 b2fb933..8ec9ca9 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 _0xc727=['catch','GetFaxAccount','FaxAccount','raw','options','attributes','limit','include','model','map','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','asc','length','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','create','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc727,0x1e5));var _0x7c72=function(_0x239818,_0x5a997f){_0x239818=_0x239818-0x0;var _0x157fcb=_0xc727[_0x239818];return _0x157fcb;};'use strict';var _=require(_0x7c72('0x0'));var util=require(_0x7c72('0x1'));var moment=require(_0x7c72('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c72('0x3'));var fs=require('fs');var Redis=require(_0x7c72('0x4'));var db=require(_0x7c72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c72('0x6'))(_0x7c72('0x7'));var config=require(_0x7c72('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c72('0x9')]['http']({'port':0x232c});config[_0x7c72('0xa')]=_[_0x7c72('0xb')](config[_0x7c72('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c72('0xc'))(new Redis(config['redis']));require(_0x7c72('0xd'))[_0x7c72('0xe')](socket);function respondWithRpcPromise(_0xf91f5d,_0x351af5,_0x34ab34){return new BPromise(function(_0x40e65d,_0x1b6de3){return client[_0x7c72('0xf')](_0xf91f5d,_0x34ab34)[_0x7c72('0x10')](function(_0x21ff80){logger[_0x7c72('0x11')]('FaxAccount,\x20%s,\x20%s',_0x351af5,_0x7c72('0x12'));logger[_0x7c72('0x13')](_0x7c72('0x14'),_0x351af5,_0x7c72('0x12'),JSON['stringify'](_0x21ff80));if(_0x21ff80[_0x7c72('0x15')]){if(_0x21ff80[_0x7c72('0x15')][_0x7c72('0x16')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x351af5,_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);return _0x1b6de3(_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);}logger[_0x7c72('0x15')](_0x7c72('0x18'),_0x351af5,_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);return _0x40e65d(_0x21ff80['error'][_0x7c72('0x17')]);}else{logger[_0x7c72('0x11')](_0x7c72('0x18'),_0x351af5,_0x7c72('0x12'));_0x40e65d(_0x21ff80['result'][_0x7c72('0x17')]);}})[_0x7c72('0x19')](function(_0x1027af){logger[_0x7c72('0x15')](_0x7c72('0x18'),_0x351af5,_0x1027af);_0x1b6de3(_0x1027af);});});}exports[_0x7c72('0x1a')]=function(_0x551139){var _0x524b52=this;return new Promise(function(_0x96596b,_0x2d1f63){return db[_0x7c72('0x1b')]['findAll']({'raw':_0x551139['options']?_0x551139['options'][_0x7c72('0x1c')]===undefined?!![]:![]:!![],'where':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')]['where']||null:null,'attributes':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x1e')]||null:null,'limit':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x1f')]||null:null,'include':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x20')]?_['map'](_0x551139[_0x7c72('0x1d')]['include'],function(_0x505699){return{'model':db[_0x505699[_0x7c72('0x21')]],'as':_0x505699['as'],'attributes':_0x505699[_0x7c72('0x1e')],'include':_0x505699[_0x7c72('0x20')]?_[_0x7c72('0x22')](_0x505699['include'],function(_0x4241b7){return{'model':db[_0x4241b7['model']],'as':_0x4241b7['as'],'attributes':_0x4241b7[_0x7c72('0x1e')],'include':_0x4241b7[_0x7c72('0x20')]?_[_0x7c72('0x22')](_0x4241b7['include'],function(_0x2576f9){return{'model':db[_0x2576f9[_0x7c72('0x21')]],'as':_0x2576f9['as'],'attributes':_0x2576f9[_0x7c72('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7c72('0x10')](function(_0x539854){logger['info'](_0x7c72('0x1a'),_0x551139);logger[_0x7c72('0x13')](_0x7c72('0x1a'),_0x551139,JSON[_0x7c72('0x23')](_0x539854));_0x96596b(_0x539854);})[_0x7c72('0x19')](function(_0x77c92e){logger[_0x7c72('0x15')](_0x7c72('0x1a'),_0x77c92e[_0x7c72('0x17')],_0x551139);_0x2d1f63(_0x524b52['error'](0x1f4,_0x77c92e[_0x7c72('0x17')]));});});};exports[_0x7c72('0x24')]=function(_0x47aa4f,_0x21440e,_0x6a8e65){var _0x51bd16=this;return new Promise(function(_0x1dd951,_0xa78162){var _0x52929e={'body':_0x47aa4f[_0x7c72('0x25')],'channel':_0x7c72('0x26')};var _0xe8f2e9=[];var _0x22651f=[];var _0x60128b={};return db[_0x7c72('0x27')][_0x7c72('0x28')]()[_0x7c72('0x10')](function(_0x45042e){if(!_0x45042e){throw new db[(_0x7c72('0x29'))]['ValidationError'](_0x7c72('0x2a'));}_0xe8f2e9=_[_0x7c72('0x2b')](_[_0x7c72('0x2c')](_0x45042e),['createdAt',_0x7c72('0x2d')]);_0x22651f=_['difference'](_[_0x7c72('0x2c')](_0x45042e),[_0x7c72('0x2e'),_0x7c72('0x2d'),_0x7c72('0x2f'),_0x7c72('0x30')]);if(_0x47aa4f['body']['id']){delete _0x47aa4f[_0x7c72('0x25')]['id'];}if(_[_0x7c72('0x31')](_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x32')])){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))](_0x7c72('0x34'));}if(_[_0x7c72('0x31')](_0x47aa4f['body']['body'])||_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x25')]===''){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))](_0x7c72('0x35'));}if(_[_0x7c72('0x31')](_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x36')])){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22651f);}if(!_[_0x7c72('0x37')](_0x22651f,_0x47aa4f[_0x7c72('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x7c72('0x33'))](_0x7c72('0x38')+_0x22651f);}_0x60128b[_0x47aa4f['body'][_0x7c72('0x36')]]=_0x47aa4f['body'][_0x7c72('0x32')];})[_0x7c72('0x10')](function(){return db[_0x7c72('0x1b')][_0x7c72('0x39')]({'where':{'id':_0x47aa4f[_0x7c72('0x3a')]['id']},'include':[{'model':db[_0x7c72('0x3b')],'as':_0x7c72('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x60128b,'limit':0x1,'order':[[_0x7c72('0x2d'),_0x7c72('0x3d')]]}]},{'model':db[_0x7c72('0x3e')],'as':_0x7c72('0x3f')}]});})[_0x7c72('0x10')](function(_0x42a133){if(_0x42a133&&_0x42a133[_0x7c72('0x3c')]){var _0x1b6d29=_0x42a133[_0x7c72('0x40')]({'plain':!![]});_0x52929e[_0x7c72('0x3a')]=_0x1b6d29;_0x52929e[_0x7c72('0x41')]=_0x1b6d29[_0x7c72('0x3f')];_0x52929e[_0x7c72('0x42')]=_0x1b6d29[_0x7c72('0x3c')];_0x52929e['applications']=_['orderBy'](_0x52929e['applications'],['priority'],[_0x7c72('0x43')]);if(_0x52929e[_0x7c72('0x3a')]['Applications']){delete _0x52929e[_0x7c72('0x3a')][_0x7c72('0x3f')];}if(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]&&_0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]['Contacts'][_0x7c72('0x44')]){return _0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]['Contacts'][0x0];}var _0x741117=_[_0x7c72('0xb')](_0x47aa4f[_0x7c72('0x25')],{'firstName':_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x32')],'ListId':_0x1b6d29['ListId']});_0x741117[_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x36')]]=_0x47aa4f['body'][_0x7c72('0x32')];return db[_0x7c72('0x27')]['create'](_0x741117,{'fields':_0xe8f2e9,'raw':!![]});}})['then'](function(_0x315e92){_0x52929e['contact']=_0x315e92;if(_0x315e92){var _0x239fd4={'ContactId':_0x315e92['id'],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id'],'fax':_0x315e92[_0x7c72('0x26')]};return db['FaxInteraction'][_0x7c72('0x39')]({'where':{'ContactId':_0x315e92['id'],'closed':![],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id']}})['then'](function(_0x376659){if(_0x376659){return[_0x376659,![]];}return db[_0x7c72('0x45')]['create'](_0x239fd4)[_0x7c72('0x10')](function(_0x2866d3){return[_0x2866d3,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7c72('0x46')](function(_0x4dd8e5,_0x280c9c){var _0x3facff=_0x4dd8e5[_0x7c72('0x40')]({'plain':!![]});if(_0x280c9c){if(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x47')]){_0x52929e['applications'][_0x7c72('0x48')]({'id':0x0,'priority':_0x52929e[_0x7c72('0x41')][_0x7c72('0x44')]+0x1,'app':_0x7c72('0x49'),'appdata':_0x7c72('0x4a'),'interval':_0x7c72('0x4b')});}_0x3facff['created']=!![];}else{_0x3facff['created']=![];}_0x52929e[_0x7c72('0x4c')]=_0x3facff;return db['FaxMessage'][_0x7c72('0x4d')]({'body':_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x25')],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id'],'FaxInteractionId':_0x4dd8e5['id'],'direction':'in','ContactId':_0x4dd8e5['ContactId'],'AttachmentId':_0x47aa4f[_0x7c72('0x25')]['AttachmentId']});})['then'](function(_0x491f61){_0x52929e['message']=_0x491f61;if(_0x52929e[_0x7c72('0x4c')]['UserId']){return db['User'][_0x7c72('0x39')]({'attributes':['id','name'],'where':{'id':_0x52929e[_0x7c72('0x4c')][_0x7c72('0x4e')]}})[_0x7c72('0x10')](function(_0x4198fc){if(_0x4198fc){_0x52929e[_0x7c72('0x41')][_0x7c72('0x4f')]({'id':0x0,'priority':0x0,'app':_0x7c72('0x50'),'appdata':_0x4198fc[_0x7c72('0x51')]+','+(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x52')]||0xa),'interval':_0x7c72('0x4b')});}return respondWithRpcPromise(_0x7c72('0x53'),_0x7c72('0x54'),_0x52929e);});}return respondWithRpcPromise(_0x7c72('0x53'),_0x7c72('0x54'),_0x52929e);})[_0x7c72('0x10')](function(_0xa3aa1f){_0x1dd951(_0xa3aa1f);})[_0x7c72('0x19')](function(_0xca2998){_0xa78162(_0x51bd16[_0x7c72('0x15')](0x1f4,_0xca2998[_0x7c72('0x17')]));});});}; \ No newline at end of file +var _0x0776=['no\x20available\x20attributes','keys','createdAt','updatedAt','ListId','body','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','CmList','List','Contacts','FaxApplication','Applications','get','account','list','applications','orderBy','asc','length','create','contact','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','attributes','include','model','map','then','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError'];(function(_0x5be0ea,_0x2b6121){var _0x26b02b=function(_0x1ef3a1){while(--_0x1ef3a1){_0x5be0ea['push'](_0x5be0ea['shift']());}};_0x26b02b(++_0x2b6121);}(_0x0776,0x128));var _0x6077=function(_0x1f7883,_0x5c9df7){_0x1f7883=_0x1f7883-0x0;var _0x5d8c6b=_0x0776[_0x1f7883];return _0x5d8c6b;};'use strict';var _=require(_0x6077('0x0'));var util=require(_0x6077('0x1'));var moment=require(_0x6077('0x2'));var BPromise=require(_0x6077('0x3'));var rs=require(_0x6077('0x4'));var fs=require('fs');var Redis=require(_0x6077('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6077('0x6'));var logger=require(_0x6077('0x7'))(_0x6077('0x8'));var config=require('../../config/environment');var jayson=require(_0x6077('0x9'));var client=jayson[_0x6077('0xa')]['http']({'port':0x232c});config[_0x6077('0xb')]=_['defaults'](config[_0x6077('0xb')],{'host':_0x6077('0xc'),'port':0x18eb});var socket=require(_0x6077('0xd'))(new Redis(config[_0x6077('0xb')]));require('./faxAccount.socket')[_0x6077('0xe')](socket);function respondWithRpcPromise(_0x1c4c12,_0x2d171d,_0x96c78f){return new BPromise(function(_0x116717,_0x5b7820){return client['request'](_0x1c4c12,_0x96c78f)['then'](function(_0x59f78c){logger['info']('FaxAccount,\x20%s,\x20%s',_0x2d171d,_0x6077('0xf'));logger['debug'](_0x6077('0x10'),_0x2d171d,'request\x20sent',JSON[_0x6077('0x11')](_0x59f78c));if(_0x59f78c[_0x6077('0x12')]){if(_0x59f78c[_0x6077('0x12')][_0x6077('0x13')]===0x1f4){logger[_0x6077('0x12')](_0x6077('0x14'),_0x2d171d,_0x59f78c['error'][_0x6077('0x15')]);return _0x5b7820(_0x59f78c[_0x6077('0x12')][_0x6077('0x15')]);}logger[_0x6077('0x12')]('FaxAccount,\x20%s,\x20%s',_0x2d171d,_0x59f78c[_0x6077('0x12')][_0x6077('0x15')]);return _0x116717(_0x59f78c['error'][_0x6077('0x15')]);}else{logger[_0x6077('0x16')](_0x6077('0x14'),_0x2d171d,'request\x20sent');_0x116717(_0x59f78c[_0x6077('0x17')][_0x6077('0x15')]);}})[_0x6077('0x18')](function(_0x1bcfee){logger[_0x6077('0x12')](_0x6077('0x14'),_0x2d171d,_0x1bcfee);_0x5b7820(_0x1bcfee);});});}exports['GetFaxAccount']=function(_0x32f6a4){var _0x4b5e42=this;return new Promise(function(_0x203174,_0x20382f){return db['FaxAccount'][_0x6077('0x19')]({'raw':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4['options'][_0x6077('0x1b')]===undefined?!![]:![]:!![],'where':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4['options']['where']||null:null,'attributes':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')][_0x6077('0x1c')]||null:null,'limit':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')]['limit']||null:null,'include':_0x32f6a4[_0x6077('0x1a')]?_0x32f6a4[_0x6077('0x1a')][_0x6077('0x1d')]?_['map'](_0x32f6a4['options'][_0x6077('0x1d')],function(_0x54720a){return{'model':db[_0x54720a[_0x6077('0x1e')]],'as':_0x54720a['as'],'attributes':_0x54720a['attributes'],'include':_0x54720a['include']?_[_0x6077('0x1f')](_0x54720a[_0x6077('0x1d')],function(_0x454162){return{'model':db[_0x454162[_0x6077('0x1e')]],'as':_0x454162['as'],'attributes':_0x454162[_0x6077('0x1c')],'include':_0x454162[_0x6077('0x1d')]?_[_0x6077('0x1f')](_0x454162[_0x6077('0x1d')],function(_0x4e408c){return{'model':db[_0x4e408c[_0x6077('0x1e')]],'as':_0x4e408c['as'],'attributes':_0x4e408c[_0x6077('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6077('0x20')](function(_0x51f101){logger[_0x6077('0x16')](_0x6077('0x21'),_0x32f6a4);logger['debug']('GetFaxAccount',_0x32f6a4,JSON[_0x6077('0x11')](_0x51f101));_0x203174(_0x51f101);})[_0x6077('0x18')](function(_0x20830b){logger['error']('GetFaxAccount',_0x20830b[_0x6077('0x15')],_0x32f6a4);_0x20382f(_0x4b5e42[_0x6077('0x12')](0x1f4,_0x20830b['message']));});});};exports[_0x6077('0x22')]=function(_0x54179d,_0x3a6929,_0x437cc0){var _0x8e3fa=this;return new Promise(function(_0x42e2e8,_0x4602e9){var _0x23b645={'body':_0x54179d['body'],'channel':_0x6077('0x23')};var _0x1472d4=[];var _0x3d6294=[];var _0x38726b={};return db[_0x6077('0x24')][_0x6077('0x25')]()[_0x6077('0x20')](function(_0x16a8e1){if(!_0x16a8e1){throw new db[(_0x6077('0x26'))][(_0x6077('0x27'))](_0x6077('0x28'));}_0x1472d4=_['difference'](_[_0x6077('0x29')](_0x16a8e1),[_0x6077('0x2a'),_0x6077('0x2b')]);_0x3d6294=_['difference'](_[_0x6077('0x29')](_0x16a8e1),['createdAt','updatedAt','CompanyId',_0x6077('0x2c')]);if(_0x54179d['body']['id']){delete _0x54179d[_0x6077('0x2d')]['id'];}if(_['isNil'](_0x54179d[_0x6077('0x2d')]['from'])){throw new db['Sequelize'][(_0x6077('0x27'))](_0x6077('0x2e'));}if(_['isNil'](_0x54179d[_0x6077('0x2d')][_0x6077('0x2d')])||_0x54179d[_0x6077('0x2d')][_0x6077('0x2d')]===''){throw new db[(_0x6077('0x26'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x54179d[_0x6077('0x2d')][_0x6077('0x2f')])){throw new db['Sequelize'][(_0x6077('0x27'))](_0x6077('0x30')+_0x3d6294);}if(!_['includes'](_0x3d6294,_0x54179d[_0x6077('0x2d')][_0x6077('0x2f')])){throw new db[(_0x6077('0x26'))][(_0x6077('0x27'))](_0x6077('0x31')+_0x3d6294);}_0x38726b[_0x54179d[_0x6077('0x2d')]['mapKey']]=_0x54179d[_0x6077('0x2d')][_0x6077('0x32')];})['then'](function(){return db[_0x6077('0x33')]['find']({'where':{'id':_0x54179d['account']['id']},'include':[{'model':db[_0x6077('0x34')],'as':_0x6077('0x35'),'include':[{'model':db['CmContact'],'as':_0x6077('0x36'),'where':_0x38726b,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x6077('0x37')],'as':_0x6077('0x38')}]});})[_0x6077('0x20')](function(_0x3256b9){if(_0x3256b9&&_0x3256b9['List']){var _0x23ae08=_0x3256b9[_0x6077('0x39')]({'plain':!![]});_0x23b645[_0x6077('0x3a')]=_0x23ae08;_0x23b645['applications']=_0x23ae08[_0x6077('0x38')];_0x23b645[_0x6077('0x3b')]=_0x23ae08['List'];_0x23b645[_0x6077('0x3c')]=_[_0x6077('0x3d')](_0x23b645[_0x6077('0x3c')],['priority'],[_0x6077('0x3e')]);if(_0x23b645['account']['Applications']){delete _0x23b645[_0x6077('0x3a')][_0x6077('0x38')];}if(_0x23b645['account'][_0x6077('0x35')]&&_0x23b645[_0x6077('0x3a')][_0x6077('0x35')][_0x6077('0x36')][_0x6077('0x3f')]){return _0x23b645[_0x6077('0x3a')][_0x6077('0x35')]['Contacts'][0x0];}var _0x444248=_['defaults'](_0x54179d[_0x6077('0x2d')],{'firstName':_0x54179d[_0x6077('0x2d')]['from'],'ListId':_0x23ae08[_0x6077('0x2c')]});_0x444248[_0x54179d[_0x6077('0x2d')]['mapKey']]=_0x54179d['body'][_0x6077('0x32')];return db[_0x6077('0x24')][_0x6077('0x40')](_0x444248,{'fields':_0x1472d4,'raw':!![]});}})[_0x6077('0x20')](function(_0x9be374){_0x23b645[_0x6077('0x41')]=_0x9be374;if(_0x9be374){var _0x3c0f91={'ContactId':_0x9be374['id'],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id'],'fax':_0x9be374[_0x6077('0x23')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x9be374['id'],'closed':![],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id']}})[_0x6077('0x20')](function(_0x14c643){if(_0x14c643){return[_0x14c643,![]];}return db['FaxInteraction'][_0x6077('0x40')](_0x3c0f91)[_0x6077('0x20')](function(_0x4ebc0e){return[_0x4ebc0e,!![]];});});}else{throw new Error(_0x6077('0x42'));}})[_0x6077('0x43')](function(_0x4e626b,_0x9c91de){var _0x2342d0=_0x4e626b[_0x6077('0x39')]({'plain':!![]});if(_0x9c91de){if(_0x23b645[_0x6077('0x3a')]['autoclose']){_0x23b645[_0x6077('0x3c')][_0x6077('0x44')]({'id':0x0,'priority':_0x23b645[_0x6077('0x3c')][_0x6077('0x3f')]+0x1,'app':_0x6077('0x45'),'appdata':_0x6077('0x46'),'interval':_0x6077('0x47')});}_0x2342d0[_0x6077('0x48')]=!![];}else{_0x2342d0[_0x6077('0x48')]=![];}_0x23b645[_0x6077('0x49')]=_0x2342d0;return db[_0x6077('0x4a')][_0x6077('0x40')]({'body':_0x54179d[_0x6077('0x2d')]['body'],'FaxAccountId':_0x54179d[_0x6077('0x3a')]['id'],'FaxInteractionId':_0x4e626b['id'],'direction':'in','ContactId':_0x4e626b[_0x6077('0x4b')],'AttachmentId':_0x54179d[_0x6077('0x2d')][_0x6077('0x4c')]});})['then'](function(_0x7d0892){_0x23b645[_0x6077('0x15')]=_0x7d0892;if(_0x23b645[_0x6077('0x49')]['UserId']){return db[_0x6077('0x4d')]['find']({'attributes':['id',_0x6077('0x4e')],'where':{'id':_0x23b645[_0x6077('0x49')]['UserId']}})[_0x6077('0x20')](function(_0xed61f7){if(_0xed61f7){_0x23b645['applications'][_0x6077('0x4f')]({'id':0x0,'priority':0x0,'app':_0x6077('0x50'),'appdata':_0xed61f7[_0x6077('0x4e')]+','+(_0x23b645[_0x6077('0x3a')][_0x6077('0x51')]||0xa),'interval':_0x6077('0x47')});}return respondWithRpcPromise(_0x6077('0x52'),_0x6077('0x53'),_0x23b645);});}return respondWithRpcPromise(_0x6077('0x52'),_0x6077('0x53'),_0x23b645);})['then'](function(_0x42c680){_0x42e2e8(_0x42c680);})[_0x6077('0x18')](function(_0x24326a){_0x4602e9(_0x8e3fa[_0x6077('0x12')](0x1f4,_0x24326a[_0x6077('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 331b8a9..d9a3064 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 _0x3896=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update','emit'];(function(_0x3bc61f,_0x137218){var _0x4e52b4=function(_0x16591c){while(--_0x16591c){_0x3bc61f['push'](_0x3bc61f['shift']());}};_0x4e52b4(++_0x137218);}(_0x3896,0x175));var _0x6389=function(_0x404d66,_0xcf3612){_0x404d66=_0x404d66-0x0;var _0x5e72a8=_0x3896[_0x404d66];return _0x5e72a8;};'use strict';var FaxAccountEvents=require(_0x6389('0x0'));var events=[_0x6389('0x1'),_0x6389('0x2'),_0x6389('0x3')];function createListener(_0x467bea,_0x349a08){return function(_0x669ad3){_0x349a08[_0x6389('0x4')](_0x467bea,_0x669ad3);};}function removeListener(_0xb65757,_0x50d202){return function(){FaxAccountEvents[_0x6389('0x5')](_0xb65757,_0x50d202);};}exports[_0x6389('0x6')]=function(_0x540130){for(var _0x157b77=0x0,_0x6bec6f=events[_0x6389('0x7')];_0x157b77<_0x6bec6f;_0x157b77++){var _0x52e1b1=events[_0x157b77];var _0x303ecd=createListener(_0x6389('0x8')+_0x52e1b1,_0x540130);FaxAccountEvents['on'](_0x52e1b1,_0x303ecd);}}; \ No newline at end of file +var _0x6dfe=['save','remove','emit','removeListener','register','faxAccount:','./faxAccount.events'];(function(_0x6cb5b8,_0x14cc50){var _0x445115=function(_0x200d97){while(--_0x200d97){_0x6cb5b8['push'](_0x6cb5b8['shift']());}};_0x445115(++_0x14cc50);}(_0x6dfe,0x1b1));var _0xe6df=function(_0x5b4623,_0x785913){_0x5b4623=_0x5b4623-0x0;var _0x25f1b1=_0x6dfe[_0x5b4623];return _0x25f1b1;};'use strict';var FaxAccountEvents=require(_0xe6df('0x0'));var events=[_0xe6df('0x1'),_0xe6df('0x2'),'update'];function createListener(_0x3568e1,_0x394a19){return function(_0x11d9d8){_0x394a19[_0xe6df('0x3')](_0x3568e1,_0x11d9d8);};}function removeListener(_0x5f5c9e,_0x23522a){return function(){FaxAccountEvents[_0xe6df('0x4')](_0x5f5c9e,_0x23522a);};}exports[_0xe6df('0x5')]=function(_0x4f0d38){for(var _0x2c8ce4=0x0,_0x286ed5=events['length'];_0x2c8ce4<_0x286ed5;_0x2c8ce4++){var _0x37e6af=events[_0x2c8ce4];var _0x37aee2=createListener(_0xe6df('0x6')+_0x37e6af,_0x4f0d38);FaxAccountEvents['on'](_0x37e6af,_0x37aee2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index dcee3e7..6a33a41 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 _0xd2d8=['isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/users','getAgents','post','create','/:id/dispositions','addInteraction','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','get'];(function(_0x345533,_0x5949f6){var _0x319552=function(_0x42f030){while(--_0x42f030){_0x345533['push'](_0x345533['shift']());}};_0x319552(++_0x5949f6);}(_0xd2d8,0x97));var _0x8d2d=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0xd2d8[_0x26ac27];return _0x44a599;};'use strict';var multer=require(_0x8d2d('0x0'));var util=require(_0x8d2d('0x1'));var path=require('path');var timeout=require(_0x8d2d('0x2'));var express=require(_0x8d2d('0x3'));var router=express[_0x8d2d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d2d('0x5'));var config=require(_0x8d2d('0x6'));var controller=require(_0x8d2d('0x7'));router[_0x8d2d('0x8')]('/',auth[_0x8d2d('0x9')](),controller['index']);router[_0x8d2d('0x8')](_0x8d2d('0xa'),auth['isAuthenticated'](),controller[_0x8d2d('0xb')]);router[_0x8d2d('0x8')](_0x8d2d('0xc'),auth['isAuthenticated'](),controller[_0x8d2d('0xd')]);router[_0x8d2d('0x8')]('/:id/dispositions',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0xe')]);router['get'](_0x8d2d('0xf'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x10')]);router[_0x8d2d('0x8')](_0x8d2d('0x11'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x12')]);router[_0x8d2d('0x8')](_0x8d2d('0x13'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x14')]);router[_0x8d2d('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x8d2d('0x15'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x16')]);router[_0x8d2d('0x17')]('/',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x18')]);router[_0x8d2d('0x17')](_0x8d2d('0x19'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x8d2d('0x17')](_0x8d2d('0xf'),auth[_0x8d2d('0x9')](),controller['addAnswer']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x8d2d('0x1a')]);router[_0x8d2d('0x17')](_0x8d2d('0x13'),auth['isAuthenticated'](),controller['addApplications']);router[_0x8d2d('0x17')](_0x8d2d('0x1b'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x1c')]);router[_0x8d2d('0x17')]('/updateaccountapplications',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x1d')]);router[_0x8d2d('0x17')](_0x8d2d('0x1e'),auth['isAuthenticated'](),controller[_0x8d2d('0x1f')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8d2d('0x20')]);router['put']('/:id',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x21')]);router[_0x8d2d('0x22')](_0x8d2d('0xc'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x23')]);router[_0x8d2d('0x22')]('/:id/dispositions',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x24')]);router[_0x8d2d('0x22')](_0x8d2d('0xf'),auth['isAuthenticated'](),controller[_0x8d2d('0x25')]);router[_0x8d2d('0x22')](_0x8d2d('0x15'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x26')]);module[_0x8d2d('0x27')]=router; \ No newline at end of file +var _0x8b17=['/:id/dispositions','removeDispositions','/:id/users','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','getInteractions','getApplications','/:id/messages','getAgents','post','create','addAnswer','addInteraction','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','update','delete'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0x8b17,0x151));var _0x78b1=function(_0x14b090,_0x3367cc){_0x14b090=_0x14b090-0x0;var _0x5d3efb=_0x8b17[_0x14b090];return _0x5d3efb;};'use strict';var multer=require('multer');var util=require(_0x78b1('0x0'));var path=require(_0x78b1('0x1'));var timeout=require(_0x78b1('0x2'));var express=require('express');var router=express[_0x78b1('0x3')]();var auth=require(_0x78b1('0x4'));var interaction=require(_0x78b1('0x5'));var config=require(_0x78b1('0x6'));var controller=require('./faxAccount.controller');router[_0x78b1('0x7')]('/',auth[_0x78b1('0x8')](),controller[_0x78b1('0x9')]);router['get'](_0x78b1('0xa'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xb')]);router[_0x78b1('0x7')](_0x78b1('0xc'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xd')]);router['get']('/:id/dispositions',auth[_0x78b1('0x8')](),controller['getDispositions']);router[_0x78b1('0x7')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller[_0x78b1('0xf')]);router[_0x78b1('0x7')]('/:id/interactions',auth[_0x78b1('0x8')](),controller[_0x78b1('0x10')]);router['get']('/:id/applications',auth[_0x78b1('0x8')](),controller[_0x78b1('0x11')]);router['get'](_0x78b1('0x12'),auth[_0x78b1('0x8')](),controller['getMessages']);router[_0x78b1('0x7')]('/:id/users',auth[_0x78b1('0x8')](),controller[_0x78b1('0x13')]);router[_0x78b1('0x14')]('/',auth[_0x78b1('0x8')](),controller[_0x78b1('0x15')]);router[_0x78b1('0x14')]('/:id/dispositions',auth[_0x78b1('0x8')](),controller['addDisposition']);router[_0x78b1('0x14')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x16')]);router[_0x78b1('0x14')]('/:id/interactions',auth[_0x78b1('0x8')](),controller[_0x78b1('0x17')]);router[_0x78b1('0x14')](_0x78b1('0x18'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x19')]);router[_0x78b1('0x14')](_0x78b1('0x1a'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x1b')]);router['post'](_0x78b1('0x1c'),auth[_0x78b1('0x8')](),controller['updateAccountApplications']);router['post'](_0x78b1('0x1d'),auth[_0x78b1('0x8')](),controller['send']);router[_0x78b1('0x14')]('/:id/users',auth[_0x78b1('0x8')](),controller[_0x78b1('0x1e')]);router['put'](_0x78b1('0xc'),auth['isAuthenticated'](),controller[_0x78b1('0x1f')]);router[_0x78b1('0x20')](_0x78b1('0xc'),auth[_0x78b1('0x8')](),controller['destroy']);router[_0x78b1('0x20')](_0x78b1('0x21'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x22')]);router[_0x78b1('0x20')](_0x78b1('0xe'),auth[_0x78b1('0x8')](),controller['removeAnswers']);router[_0x78b1('0x20')](_0x78b1('0x23'),auth[_0x78b1('0x8')](),controller[_0x78b1('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 618b6fb..5cc99fb 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 _0xd386=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd386,0x10c));var _0x6d38=function(_0x47327a,_0xa744ab){_0x47327a=_0x47327a-0x0;var _0x258c4c=_0xd386[_0x47327a];return _0x258c4c;};'use strict';var Sequelize=require(_0x6d38('0x0'));module[_0x6d38('0x1')]={'priority':{'type':Sequelize[_0x6d38('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d38('0x3')},'appdata':{'type':Sequelize[_0x6d38('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6d38('0x5')],'defaultValue':_0x6d38('0x6')}}; \ No newline at end of file +var _0xa817=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x558cb5,_0x58ce98){var _0x4a46f5=function(_0x62df49){while(--_0x62df49){_0x558cb5['push'](_0x558cb5['shift']());}};_0x4a46f5(++_0x58ce98);}(_0xa817,0x7b));var _0x7a81=function(_0x520470,_0x484dc0){_0x520470=_0x520470-0x0;var _0x31674e=_0xa817[_0x520470];return _0x31674e;};'use strict';var Sequelize=require(_0x7a81('0x0'));module[_0x7a81('0x1')]={'priority':{'type':Sequelize[_0x7a81('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7a81('0x3')],'allowNull':![],'defaultValue':_0x7a81('0x4')},'appdata':{'type':Sequelize[_0x7a81('0x5')]()},'description':{'type':Sequelize[_0x7a81('0x3')]},'interval':{'type':Sequelize[_0x7a81('0x3')],'defaultValue':_0x7a81('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 51065c1..119ba5b 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 _0xb016=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','find','catch','create','body','update','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x5e0e52,_0x5b449c){var _0x53bcae=function(_0x3f8a6d){while(--_0x3f8a6d){_0x5e0e52['push'](_0x5e0e52['shift']());}};_0x53bcae(++_0x5b449c);}(_0xb016,0x159));var _0x6b01=function(_0x506526,_0xcb7d3b){_0x506526=_0x506526-0x0;var _0x269995=_0xb016[_0x506526];return _0x269995;};'use strict';var pdf=require(_0x6b01('0x0'));var emlformat=require(_0x6b01('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6b01('0x2'));var rp=require('request-promise');var moment=require(_0x6b01('0x3'));var BPromise=require(_0x6b01('0x4'));var Mustache=require(_0x6b01('0x5'));var util=require(_0x6b01('0x6'));var path=require('path');var sox=require(_0x6b01('0x7'));var csv=require(_0x6b01('0x8'));var ejs=require(_0x6b01('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b01('0x11'));var utils=require(_0x6b01('0x12'));var config=require(_0x6b01('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200614,_0x5c54e4){_0x5c54e4=_0x5c54e4||0xcc;return function(_0x51f976){if(_0x51f976){return _0x200614[_0x6b01('0x14')](_0x5c54e4);}return _0x200614['status'](_0x5c54e4)[_0x6b01('0x15')]();};}function respondWithResult(_0x192406,_0x47c09f){_0x47c09f=_0x47c09f||0xc8;return function(_0x2c305e){if(_0x2c305e){return _0x192406['status'](_0x47c09f)['json'](_0x2c305e);}};}function respondWithFilteredResult(_0x51b3cf,_0x3d4666){return function(_0x4cbd38){if(_0x4cbd38){var _0x5b2f60=_0x4cbd38[_0x6b01('0x16')],_0x3a259f=_0x3d4666[_0x6b01('0x17')],_0x327e86=_0x3d4666[_0x6b01('0x17')]+_0x3d4666[_0x6b01('0x18')],_0x20dd83;if(_0x327e86>=_0x5b2f60){_0x327e86=_0x5b2f60;_0x20dd83=0xc8;}else{_0x20dd83=0xce;}_0x51b3cf[_0x6b01('0x19')](_0x20dd83);return _0x51b3cf[_0x6b01('0x1a')](_0x6b01('0x1b'),_0x3a259f+'-'+_0x327e86+'/'+_0x5b2f60)[_0x6b01('0x1c')](_0x4cbd38);}return null;};}function patchUpdates(_0x4f2d08){return function(_0x2c5f29){try{jsonpatch[_0x6b01('0x1d')](_0x2c5f29,_0x4f2d08,!![]);}catch(_0x3b0bab){return BPromise[_0x6b01('0x1e')](_0x3b0bab);}return _0x2c5f29[_0x6b01('0x1f')]();};}function saveUpdates(_0x11e4dc,_0x33753f){return function(_0x3c0573){if(_0x3c0573){return _0x3c0573['update'](_0x11e4dc)[_0x6b01('0x20')](function(_0xc1f453){return _0xc1f453;});}return null;};}function removeEntity(_0x424cd3,_0x2551b0){return function(_0x1fced4){if(_0x1fced4){return _0x1fced4[_0x6b01('0x21')]()[_0x6b01('0x20')](function(){_0x424cd3['status'](0xcc)[_0x6b01('0x15')]();});}};}function handleEntityNotFound(_0xcf9200,_0x42c990){return function(_0x51243c){if(!_0x51243c){_0xcf9200[_0x6b01('0x14')](0x194);}return _0x51243c;};}function handleError(_0x70a1c0,_0x304393){_0x304393=_0x304393||0x1f4;return function(_0x2ae85e){logger[_0x6b01('0x22')](_0x2ae85e[_0x6b01('0x23')]);if(_0x2ae85e[_0x6b01('0x24')]){delete _0x2ae85e[_0x6b01('0x24')];}_0x70a1c0[_0x6b01('0x19')](_0x304393)[_0x6b01('0x25')](_0x2ae85e);};}exports[_0x6b01('0x26')]=function(_0xa846d8,_0x154dfc){var _0x55ca4b={},_0x33d95d={},_0x220efb={'count':0x0,'rows':[]};var _0x32128f=db[_0x6b01('0x27')][_0x6b01('0x28')];_0x33d95d['model']=_['keys'](_0x32128f);_0x33d95d[_0x6b01('0x29')]=_[_0x6b01('0x2a')](_0xa846d8[_0x6b01('0x29')]);_0x33d95d[_0x6b01('0x2b')]=_[_0x6b01('0x2c')](_0x33d95d[_0x6b01('0x2d')],_0x33d95d['query']);_0x55ca4b[_0x6b01('0x2e')]=_['intersection'](_0x33d95d[_0x6b01('0x2d')],qs['fields'](_0xa846d8[_0x6b01('0x29')][_0x6b01('0x2f')]));_0x55ca4b[_0x6b01('0x2e')]=_0x55ca4b[_0x6b01('0x2e')][_0x6b01('0x30')]?_0x55ca4b['attributes']:_0x33d95d[_0x6b01('0x2d')];if(!_0xa846d8[_0x6b01('0x29')][_0x6b01('0x31')]('nolimit')){_0x55ca4b['limit']=qs[_0x6b01('0x18')](_0xa846d8['query'][_0x6b01('0x18')]);_0x55ca4b[_0x6b01('0x17')]=qs[_0x6b01('0x17')](_0xa846d8['query'][_0x6b01('0x17')]);}_0x55ca4b[_0x6b01('0x32')]=qs[_0x6b01('0x33')](_0xa846d8['query'][_0x6b01('0x33')]);_0x55ca4b[_0x6b01('0x34')]=qs[_0x6b01('0x2b')](_[_0x6b01('0x35')](_0xa846d8[_0x6b01('0x29')],_0x33d95d['filters']));if(_0xa846d8[_0x6b01('0x29')][_0x6b01('0x36')]){_0x55ca4b[_0x6b01('0x34')]=_[_0x6b01('0x37')](_0x55ca4b[_0x6b01('0x34')],{'$or':_[_0x6b01('0x38')](_0x32128f,function(_0x21492c){if(_0x21492c[_0x6b01('0x39')]['key']!==_0x6b01('0x3a')){var _0x530c91={};_0x530c91[_0x21492c[_0x6b01('0x3b')]]={'$like':'%'+_0xa846d8[_0x6b01('0x29')][_0x6b01('0x36')]+'%'};return _0x530c91;}})});}_0x55ca4b=_[_0x6b01('0x37')]({},_0x55ca4b,_0xa846d8[_0x6b01('0x3c')]);var _0x457c93={'where':_0x55ca4b[_0x6b01('0x34')]};return db['FaxApplication'][_0x6b01('0x16')](_0x457c93)[_0x6b01('0x20')](function(_0x2c3385){_0x220efb[_0x6b01('0x16')]=_0x2c3385;if(_0xa846d8[_0x6b01('0x29')][_0x6b01('0x3d')]){_0x55ca4b[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x27')]['findAll'](_0x55ca4b);})[_0x6b01('0x20')](function(_0x55907f){_0x220efb[_0x6b01('0x3f')]=_0x55907f;return _0x220efb;})[_0x6b01('0x20')](respondWithFilteredResult(_0x154dfc,_0x55ca4b))['catch'](handleError(_0x154dfc,null));};exports[_0x6b01('0x40')]=function(_0x2e661b,_0x1fa942){var _0x45952a={'raw':!![],'where':{'id':_0x2e661b[_0x6b01('0x41')]['id']}},_0x2d4125={};_0x2d4125[_0x6b01('0x2d')]=_[_0x6b01('0x2a')](db[_0x6b01('0x27')][_0x6b01('0x28')]);_0x2d4125['query']=_[_0x6b01('0x2a')](_0x2e661b[_0x6b01('0x29')]);_0x2d4125['filters']=_['intersection'](_0x2d4125[_0x6b01('0x2d')],_0x2d4125[_0x6b01('0x29')]);_0x45952a['attributes']=_[_0x6b01('0x2c')](_0x2d4125[_0x6b01('0x2d')],qs['fields'](_0x2e661b[_0x6b01('0x29')]['fields']));_0x45952a[_0x6b01('0x2e')]=_0x45952a[_0x6b01('0x2e')][_0x6b01('0x30')]?_0x45952a['attributes']:_0x2d4125[_0x6b01('0x2d')];if(_0x2e661b[_0x6b01('0x29')]['includeAll']){_0x45952a['include']=[{'all':!![]}];}_0x45952a=_['merge']({},_0x45952a,_0x2e661b[_0x6b01('0x3c')]);return db[_0x6b01('0x27')][_0x6b01('0x42')](_0x45952a)[_0x6b01('0x20')](handleEntityNotFound(_0x1fa942,null))[_0x6b01('0x20')](respondWithResult(_0x1fa942,null))[_0x6b01('0x43')](handleError(_0x1fa942,null));};exports['create']=function(_0x362085,_0x1dfe41){return db[_0x6b01('0x27')][_0x6b01('0x44')](_0x362085[_0x6b01('0x45')],{})[_0x6b01('0x20')](respondWithResult(_0x1dfe41,0xc9))['catch'](handleError(_0x1dfe41,null));};exports[_0x6b01('0x46')]=function(_0x58a91a,_0x52b8dd){if(_0x58a91a[_0x6b01('0x45')]['id']){delete _0x58a91a[_0x6b01('0x45')]['id'];}return db['FaxApplication'][_0x6b01('0x42')]({'where':{'id':_0x58a91a[_0x6b01('0x41')]['id']}})[_0x6b01('0x20')](handleEntityNotFound(_0x52b8dd,null))['then'](saveUpdates(_0x58a91a['body'],null))['then'](respondWithResult(_0x52b8dd,null))[_0x6b01('0x43')](handleError(_0x52b8dd,null));};exports[_0x6b01('0x21')]=function(_0x518d94,_0x34cef6){return db['FaxApplication']['find']({'where':{'id':_0x518d94['params']['id']}})[_0x6b01('0x20')](handleEntityNotFound(_0x34cef6,null))[_0x6b01('0x20')](removeEntity(_0x34cef6,null))['catch'](handleError(_0x34cef6,null));}; \ No newline at end of file +var _0xc6ac=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','FaxApplication','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','merge','type','key','VIRTUAL','field','filter','options','count','findAll','rows','catch','show','rawAttributes','includeAll','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x441033,_0x3d7e06){var _0x2f137f=function(_0x4a0708){while(--_0x4a0708){_0x441033['push'](_0x441033['shift']());}};_0x2f137f(++_0x3d7e06);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2417f2,_0x2c944e){_0x2417f2=_0x2417f2-0x0;var _0x1b7f57=_0xc6ac[_0x2417f2];return _0x1b7f57;};'use strict';var pdf=require(_0xcc6a('0x0'));var emlformat=require(_0xcc6a('0x1'));var rimraf=require(_0xcc6a('0x2'));var zipdir=require(_0xcc6a('0x3'));var jsonpatch=require(_0xcc6a('0x4'));var rp=require(_0xcc6a('0x5'));var moment=require(_0xcc6a('0x6'));var BPromise=require(_0xcc6a('0x7'));var Mustache=require(_0xcc6a('0x8'));var util=require(_0xcc6a('0x9'));var path=require(_0xcc6a('0xa'));var sox=require(_0xcc6a('0xb'));var csv=require(_0xcc6a('0xc'));var ejs=require(_0xcc6a('0xd'));var fs=require('fs');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('0xc'));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 hardwareService=require(_0xcc6a('0x15'));var logger=require(_0xcc6a('0x16'))(_0xcc6a('0x17'));var utils=require('../../config/utils');var config=require(_0xcc6a('0x18'));var db=require(_0xcc6a('0x19'))['db'];function respondWithStatusCode(_0x27b63a,_0x55af93){_0x55af93=_0x55af93||0xcc;return function(_0x59ce6d){if(_0x59ce6d){return _0x27b63a[_0xcc6a('0x1a')](_0x55af93);}return _0x27b63a[_0xcc6a('0x1b')](_0x55af93)[_0xcc6a('0x1c')]();};}function respondWithResult(_0x559a0a,_0x483ed4){_0x483ed4=_0x483ed4||0xc8;return function(_0x369dc1){if(_0x369dc1){return _0x559a0a[_0xcc6a('0x1b')](_0x483ed4)[_0xcc6a('0x1d')](_0x369dc1);}};}function respondWithFilteredResult(_0x348af7,_0x96f9de){return function(_0x337ec5){if(_0x337ec5){var _0x4133fa=_0x337ec5['count'],_0x403b18=_0x96f9de[_0xcc6a('0x1e')],_0x56ffb0=_0x96f9de[_0xcc6a('0x1e')]+_0x96f9de[_0xcc6a('0x1f')],_0x4e628f;if(_0x56ffb0>=_0x4133fa){_0x56ffb0=_0x4133fa;_0x4e628f=0xc8;}else{_0x4e628f=0xce;}_0x348af7[_0xcc6a('0x1b')](_0x4e628f);return _0x348af7[_0xcc6a('0x20')](_0xcc6a('0x21'),_0x403b18+'-'+_0x56ffb0+'/'+_0x4133fa)[_0xcc6a('0x1d')](_0x337ec5);}return null;};}function patchUpdates(_0x412bc7){return function(_0x374e51){try{jsonpatch[_0xcc6a('0x22')](_0x374e51,_0x412bc7,!![]);}catch(_0x1d20a3){return BPromise['reject'](_0x1d20a3);}return _0x374e51[_0xcc6a('0x23')]();};}function saveUpdates(_0x3e1fda,_0x355b6f){return function(_0x368a6e){if(_0x368a6e){return _0x368a6e[_0xcc6a('0x24')](_0x3e1fda)[_0xcc6a('0x25')](function(_0x36c80f){return _0x36c80f;});}return null;};}function removeEntity(_0x43f510,_0x2254a8){return function(_0x19d32c){if(_0x19d32c){return _0x19d32c[_0xcc6a('0x26')]()[_0xcc6a('0x25')](function(){_0x43f510['status'](0xcc)[_0xcc6a('0x1c')]();});}};}function handleEntityNotFound(_0x3a081e,_0x38f812){return function(_0x581aae){if(!_0x581aae){_0x3a081e[_0xcc6a('0x1a')](0x194);}return _0x581aae;};}function handleError(_0x294486,_0x3a00e5){_0x3a00e5=_0x3a00e5||0x1f4;return function(_0x3ed7ce){logger[_0xcc6a('0x27')](_0x3ed7ce[_0xcc6a('0x28')]);if(_0x3ed7ce['name']){delete _0x3ed7ce[_0xcc6a('0x29')];}_0x294486[_0xcc6a('0x1b')](_0x3a00e5)[_0xcc6a('0x2a')](_0x3ed7ce);};}exports['index']=function(_0x3afb3a,_0x3dad72){var _0x4da301={},_0xb377de={},_0x8b1b2b={'count':0x0,'rows':[]};var _0x3233d1=db[_0xcc6a('0x2b')]['rawAttributes'];_0xb377de[_0xcc6a('0x2c')]=_[_0xcc6a('0x2d')](_0x3233d1);_0xb377de[_0xcc6a('0x2e')]=_['keys'](_0x3afb3a[_0xcc6a('0x2e')]);_0xb377de['filters']=_['intersection'](_0xb377de[_0xcc6a('0x2c')],_0xb377de[_0xcc6a('0x2e')]);_0x4da301[_0xcc6a('0x2f')]=_[_0xcc6a('0x30')](_0xb377de[_0xcc6a('0x2c')],qs[_0xcc6a('0x31')](_0x3afb3a['query'][_0xcc6a('0x31')]));_0x4da301[_0xcc6a('0x2f')]=_0x4da301[_0xcc6a('0x2f')][_0xcc6a('0x32')]?_0x4da301[_0xcc6a('0x2f')]:_0xb377de[_0xcc6a('0x2c')];if(!_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x33')]('nolimit')){_0x4da301[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x1f')]);_0x4da301[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x3afb3a[_0xcc6a('0x2e')]['offset']);}_0x4da301[_0xcc6a('0x34')]=qs['sort'](_0x3afb3a['query']['sort']);_0x4da301[_0xcc6a('0x35')]=qs[_0xcc6a('0x36')](_[_0xcc6a('0x37')](_0x3afb3a[_0xcc6a('0x2e')],_0xb377de[_0xcc6a('0x36')]));if(_0x3afb3a['query']['filter']){_0x4da301[_0xcc6a('0x35')]=_[_0xcc6a('0x38')](_0x4da301[_0xcc6a('0x35')],{'$or':_['map'](_0x3233d1,function(_0x382283){if(_0x382283[_0xcc6a('0x39')][_0xcc6a('0x3a')]!==_0xcc6a('0x3b')){var _0x73bf0d={};_0x73bf0d[_0x382283[_0xcc6a('0x3c')]]={'$like':'%'+_0x3afb3a[_0xcc6a('0x2e')][_0xcc6a('0x3d')]+'%'};return _0x73bf0d;}})});}_0x4da301=_[_0xcc6a('0x38')]({},_0x4da301,_0x3afb3a[_0xcc6a('0x3e')]);var _0x5b11c8={'where':_0x4da301[_0xcc6a('0x35')]};return db[_0xcc6a('0x2b')][_0xcc6a('0x3f')](_0x5b11c8)[_0xcc6a('0x25')](function(_0x33e8c8){_0x8b1b2b[_0xcc6a('0x3f')]=_0x33e8c8;if(_0x3afb3a[_0xcc6a('0x2e')]['includeAll']){_0x4da301['include']=[{'all':!![]}];}return db[_0xcc6a('0x2b')][_0xcc6a('0x40')](_0x4da301);})[_0xcc6a('0x25')](function(_0x1fd8e1){_0x8b1b2b[_0xcc6a('0x41')]=_0x1fd8e1;return _0x8b1b2b;})[_0xcc6a('0x25')](respondWithFilteredResult(_0x3dad72,_0x4da301))[_0xcc6a('0x42')](handleError(_0x3dad72,null));};exports[_0xcc6a('0x43')]=function(_0x49b65c,_0x56bc7d){var _0x470e3b={'raw':!![],'where':{'id':_0x49b65c['params']['id']}},_0x4a4c4d={};_0x4a4c4d['model']=_[_0xcc6a('0x2d')](db[_0xcc6a('0x2b')][_0xcc6a('0x44')]);_0x4a4c4d[_0xcc6a('0x2e')]=_[_0xcc6a('0x2d')](_0x49b65c['query']);_0x4a4c4d[_0xcc6a('0x36')]=_[_0xcc6a('0x30')](_0x4a4c4d[_0xcc6a('0x2c')],_0x4a4c4d[_0xcc6a('0x2e')]);_0x470e3b[_0xcc6a('0x2f')]=_[_0xcc6a('0x30')](_0x4a4c4d['model'],qs[_0xcc6a('0x31')](_0x49b65c[_0xcc6a('0x2e')][_0xcc6a('0x31')]));_0x470e3b[_0xcc6a('0x2f')]=_0x470e3b['attributes'][_0xcc6a('0x32')]?_0x470e3b['attributes']:_0x4a4c4d[_0xcc6a('0x2c')];if(_0x49b65c[_0xcc6a('0x2e')][_0xcc6a('0x45')]){_0x470e3b['include']=[{'all':!![]}];}_0x470e3b=_[_0xcc6a('0x38')]({},_0x470e3b,_0x49b65c[_0xcc6a('0x3e')]);return db[_0xcc6a('0x2b')]['find'](_0x470e3b)['then'](handleEntityNotFound(_0x56bc7d,null))[_0xcc6a('0x25')](respondWithResult(_0x56bc7d,null))[_0xcc6a('0x42')](handleError(_0x56bc7d,null));};exports[_0xcc6a('0x46')]=function(_0x3d1e6b,_0x345e94){return db['FaxApplication'][_0xcc6a('0x46')](_0x3d1e6b[_0xcc6a('0x47')],{})['then'](respondWithResult(_0x345e94,0xc9))[_0xcc6a('0x42')](handleError(_0x345e94,null));};exports[_0xcc6a('0x24')]=function(_0x42ffcc,_0x12a594){if(_0x42ffcc[_0xcc6a('0x47')]['id']){delete _0x42ffcc[_0xcc6a('0x47')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x42ffcc['params']['id']}})[_0xcc6a('0x25')](handleEntityNotFound(_0x12a594,null))[_0xcc6a('0x25')](saveUpdates(_0x42ffcc[_0xcc6a('0x47')],null))[_0xcc6a('0x25')](respondWithResult(_0x12a594,null))['catch'](handleError(_0x12a594,null));};exports[_0xcc6a('0x26')]=function(_0x5e7bab,_0x3aa7dd){return db[_0xcc6a('0x2b')][_0xcc6a('0x48')]({'where':{'id':_0x5e7bab[_0xcc6a('0x49')]['id']}})[_0xcc6a('0x25')](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x25')](removeEntity(_0x3aa7dd,null))['catch'](handleError(_0x3aa7dd,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d3554e1..2ae98eb 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 _0x25fa=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x5b77a,_0x54c7f6){var _0x2b9ab4=function(_0x316d79){while(--_0x316d79){_0x5b77a['push'](_0x5b77a['shift']());}};_0x2b9ab4(++_0x54c7f6);}(_0x25fa,0x109));var _0xa25f=function(_0x5826e0,_0xa6395e){_0x5826e0=_0x5826e0-0x0;var _0x1a236e=_0x25fa[_0x5826e0];return _0x1a236e;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa25f('0xa'),'collate':_0xa25f('0xb')});}; \ No newline at end of file +var _0x9957=['rimraf','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7995('0xc'),'collate':_0x7995('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 430d867..0664fec 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 _0x74bb=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74bb,0x9b));var _0xb74b=function(_0x11b43e,_0x5bc5ed){_0x11b43e=_0x11b43e-0x0;var _0x3311f7=_0x74bb[_0x11b43e];return _0x3311f7;};'use strict';var _=require('lodash');var util=require(_0xb74b('0x0'));var moment=require('moment');var BPromise=require(_0xb74b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb74b('0x2'))['db'];var utils=require(_0xb74b('0x3'));var logger=require(_0xb74b('0x4'))('rpc');var config=require(_0xb74b('0x5'));var jayson=require(_0xb74b('0x6'));var client=jayson[_0xb74b('0x7')][_0xb74b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a9d09,_0x1124df,_0x1e0425){return new BPromise(function(_0x4ce517,_0x578670){return client[_0xb74b('0x9')](_0x2a9d09,_0x1e0425)[_0xb74b('0xa')](function(_0x486586){logger[_0xb74b('0xb')]('FaxApplication,\x20%s,\x20%s',_0x1124df,_0xb74b('0xc'));logger[_0xb74b('0xd')](_0xb74b('0xe'),_0x1124df,_0xb74b('0xc'),JSON[_0xb74b('0xf')](_0x486586));if(_0x486586['error']){if(_0x486586[_0xb74b('0x10')][_0xb74b('0x11')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x1124df,_0x486586[_0xb74b('0x10')][_0xb74b('0x12')]);return _0x578670(_0x486586[_0xb74b('0x10')]['message']);}logger[_0xb74b('0x10')](_0xb74b('0x13'),_0x1124df,_0x486586['error'][_0xb74b('0x12')]);return _0x4ce517(_0x486586[_0xb74b('0x10')][_0xb74b('0x12')]);}else{logger[_0xb74b('0xb')](_0xb74b('0x13'),_0x1124df,_0xb74b('0xc'));_0x4ce517(_0x486586[_0xb74b('0x14')][_0xb74b('0x12')]);}})[_0xb74b('0x15')](function(_0x3f15b5){logger[_0xb74b('0x10')](_0xb74b('0x13'),_0x1124df,_0x3f15b5);_0x578670(_0x3f15b5);});});}exports[_0xb74b('0x16')]=function(_0x10d40d){var _0x554466=this;return new Promise(function(_0x663841,_0x23201f){return db[_0xb74b('0x17')][_0xb74b('0x18')](_0x10d40d[_0xb74b('0x19')],{'raw':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1c')]||null:null,'attributes':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1d')]||null:null,'limit':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1e')]||null:null})['then'](function(_0x424367){logger['info']('UpdateFaxApplication',_0x10d40d);logger[_0xb74b('0xd')]('UpdateFaxApplication',_0x10d40d,JSON[_0xb74b('0xf')](_0x424367));_0x663841(_0x424367);})[_0xb74b('0x15')](function(_0x23db2e){logger['error']('UpdateFaxApplication',_0x23db2e[_0xb74b('0x12')],_0x10d40d);_0x23201f(_0x554466[_0xb74b('0x10')](0x1f4,_0x23db2e[_0xb74b('0x12')]));});});}; \ No newline at end of file +var _0x9393=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','where','attributes','limit','UpdateFaxApplication','catch','lodash','util','moment','bluebird'];(function(_0x35f83e,_0x30ec55){var _0x249b05=function(_0x2c2fcc){while(--_0x2c2fcc){_0x35f83e['push'](_0x35f83e['shift']());}};_0x249b05(++_0x30ec55);}(_0x9393,0x1cd));var _0x3939=function(_0x128b3c,_0x3190da){_0x128b3c=_0x128b3c-0x0;var _0x33f5b5=_0x9393[_0x128b3c];return _0x33f5b5;};'use strict';var _=require(_0x3939('0x0'));var util=require(_0x3939('0x1'));var moment=require(_0x3939('0x2'));var BPromise=require(_0x3939('0x3'));var rs=require(_0x3939('0x4'));var fs=require('fs');var Redis=require(_0x3939('0x5'));var db=require(_0x3939('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3939('0x7'))(_0x3939('0x8'));var config=require('../../config/environment');var jayson=require(_0x3939('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8957,_0x17cfe1,_0x476b76){return new BPromise(function(_0x478198,_0x3a88b5){return client[_0x3939('0xa')](_0x5a8957,_0x476b76)[_0x3939('0xb')](function(_0x46b3f6){logger[_0x3939('0xc')](_0x3939('0xd'),_0x17cfe1,_0x3939('0xe'));logger[_0x3939('0xf')](_0x3939('0x10'),_0x17cfe1,'request\x20sent',JSON[_0x3939('0x11')](_0x46b3f6));if(_0x46b3f6[_0x3939('0x12')]){if(_0x46b3f6[_0x3939('0x12')][_0x3939('0x13')]===0x1f4){logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x46b3f6[_0x3939('0x12')][_0x3939('0x14')]);return _0x3a88b5(_0x46b3f6['error'][_0x3939('0x14')]);}logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x46b3f6[_0x3939('0x12')]['message']);return _0x478198(_0x46b3f6[_0x3939('0x12')][_0x3939('0x14')]);}else{logger[_0x3939('0xc')](_0x3939('0xd'),_0x17cfe1,_0x3939('0xe'));_0x478198(_0x46b3f6[_0x3939('0x15')][_0x3939('0x14')]);}})['catch'](function(_0x3b4494){logger[_0x3939('0x12')](_0x3939('0xd'),_0x17cfe1,_0x3b4494);_0x3a88b5(_0x3b4494);});});}exports['UpdateFaxApplication']=function(_0x4e3ec0){var _0x4b2b1e=this;return new Promise(function(_0x64ba82,_0x2f2d8f){return db[_0x3939('0x16')][_0x3939('0x17')](_0x4e3ec0[_0x3939('0x18')],{'raw':_0x4e3ec0[_0x3939('0x19')]?_0x4e3ec0[_0x3939('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e3ec0[_0x3939('0x19')]?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1a')]||null:null,'attributes':_0x4e3ec0['options']?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1b')]||null:null,'limit':_0x4e3ec0['options']?_0x4e3ec0[_0x3939('0x19')][_0x3939('0x1c')]||null:null})['then'](function(_0xa79dc9){logger['info'](_0x3939('0x1d'),_0x4e3ec0);logger[_0x3939('0xf')](_0x3939('0x1d'),_0x4e3ec0,JSON[_0x3939('0x11')](_0xa79dc9));_0x64ba82(_0xa79dc9);})[_0x3939('0x1e')](function(_0x232021){logger[_0x3939('0x12')]('UpdateFaxApplication',_0x232021['message'],_0x4e3ec0);_0x2f2d8f(_0x4b2b1e[_0x3939('0x12')](0x1f4,_0x232021['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index df43c64..f38f097 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 _0x3f8c=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','isAuthenticated','index','get','/:id','show','create'];(function(_0x180b76,_0x561a3e){var _0x1111ae=function(_0x5c6263){while(--_0x5c6263){_0x180b76['push'](_0x180b76['shift']());}};_0x1111ae(++_0x561a3e);}(_0x3f8c,0x104));var _0xc3f8=function(_0x34a5af,_0x3f93d7){_0x34a5af=_0x34a5af-0x0;var _0x5e4357=_0x3f8c[_0x34a5af];return _0x5e4357;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router['get']('/',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x5')]);router[_0xc3f8('0x6')](_0xc3f8('0x7'),auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x8')]);router['post']('/',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x9')]);router[_0xc3f8('0xa')](_0xc3f8('0x7'),auth[_0xc3f8('0x4')](),controller[_0xc3f8('0xb')]);router[_0xc3f8('0xc')]('/:id',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0xd')]);module[_0xc3f8('0xe')]=router; \ No newline at end of file +var _0xd914=['get','index','/:id','isAuthenticated','show','post','create','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1771f8,_0x76adec){var _0x7845ec=function(_0x192a32){while(--_0x192a32){_0x1771f8['push'](_0x1771f8['shift']());}};_0x7845ec(++_0x76adec);}(_0xd914,0x17f));var _0x4d91=function(_0x5817e6,_0x44a2d0){_0x5817e6=_0x5817e6-0x0;var _0x51916a=_0xd914[_0x5817e6];return _0x51916a;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express[_0x4d91('0x4')]();var auth=require(_0x4d91('0x5'));var interaction=require(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));var controller=require('./faxApplication.controller');router[_0x4d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x4d91('0x9')]);router[_0x4d91('0x8')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0xc')]);router[_0x4d91('0xd')]('/',auth[_0x4d91('0xb')](),controller[_0x4d91('0xe')]);router['put'](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller[_0x4d91('0xf')]);router[_0x4d91('0x10')](_0x4d91('0xa'),auth[_0x4d91('0xb')](),controller['destroy']);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 ca749c0..7b25cb2 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 _0x7e0c=['exports','STRING','ENUM','out','DATE','sequelize'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x7e0c,0xa7));var _0xc7e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e0c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc7e0('0x0'));module[_0xc7e0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc7e0('0x2')]},'note':{'type':Sequelize[_0xc7e0('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xc7e0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xc7e0('0x3')]('in',_0xc7e0('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc7e0('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc7e0('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb819=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb819,0x137));var _0x9b81=function(_0x1cf5f3,_0x43bb33){_0x1cf5f3=_0x1cf5f3-0x0;var _0x180387=_0xb819[_0x1cf5f3];return _0x180387;};'use strict';var Sequelize=require(_0x9b81('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9b81('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9b81('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9b81('0x3')]},'read1stAt':{'type':Sequelize[_0x9b81('0x2')]},'fax':{'type':Sequelize[_0x9b81('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9b81('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9b81('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9b81('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 3bab854..0576827 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 _0x2bde=['body','destroy','describe','FaxMessage','addMessage','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','ids','spread','Tag','emit','faxInteractionTags:save','removeTags','download','join','files','attachments','server','tmp','interaction-%s.zip','createdAt','Attachment','basename','createReadStream','pipe','createWriteStream','log','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxInteraction','rawAttributes','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','select','field','color','from','COUNT(*)','fax_messages','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','user_has_fax_interactions','cm_contacts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','expr','advancedFilter','parse','forEach','value','dateStart','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','\x20>\x20?','Messages.count','c.lastName','\x20<\x20?','map','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$lte','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','toString','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','`Messages.count`\x20>\x200','sequelize','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','t.id\x20=\x20it.TagId','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','Users','Tags','split','push','rows','show','params','includeAll','include','find','catch','create'];(function(_0x3c37cb,_0xe44e){var _0xa1e8ec=function(_0x3a1644){while(--_0x3a1644){_0x3c37cb['push'](_0x3c37cb['shift']());}};_0xa1e8ec(++_0xe44e);}(_0x2bde,0x1b3));var _0xe2bd=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x2bde[_0x12e3e3];return _0x26602e;};'use strict';var pdf=require(_0xe2bd('0x0'));var emlformat=require(_0xe2bd('0x1'));var rimraf=require(_0xe2bd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2bd('0x4'));var Mustache=require(_0xe2bd('0x5'));var util=require(_0xe2bd('0x6'));var path=require(_0xe2bd('0x7'));var sox=require(_0xe2bd('0x8'));var csv=require(_0xe2bd('0x9'));var ejs=require(_0xe2bd('0xa'));var fs=require('fs');var _=require(_0xe2bd('0xb'));var squel=require(_0xe2bd('0xc'));var crypto=require(_0xe2bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2bd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe2bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2bd('0x11'))(_0xe2bd('0x12'));var utils=require(_0xe2bd('0x13'));var config=require('../../config/environment');var db=require(_0xe2bd('0x14'))['db'];config[_0xe2bd('0x15')]=_[_0xe2bd('0x16')](config[_0xe2bd('0x15')],{'host':_0xe2bd('0x17'),'port':0x18eb});var socket=require(_0xe2bd('0x18'))(new Redis(config['redis']));require(_0xe2bd('0x19'))[_0xe2bd('0x1a')](socket);function respondWithStatusCode(_0x328936,_0x30e48a){_0x30e48a=_0x30e48a||0xcc;return function(_0x191a89){if(_0x191a89){return _0x328936[_0xe2bd('0x1b')](_0x30e48a);}return _0x328936[_0xe2bd('0x1c')](_0x30e48a)[_0xe2bd('0x1d')]();};}function respondWithResult(_0xea33cf,_0x47c919){_0x47c919=_0x47c919||0xc8;return function(_0x254ac5){if(_0x254ac5){return _0xea33cf[_0xe2bd('0x1c')](_0x47c919)['json'](_0x254ac5);}};}function respondWithFilteredResult(_0x582351,_0x204a81){return function(_0x17d147){if(_0x17d147){var _0x1e0be2=_0x17d147[_0xe2bd('0x1e')],_0x288d87=_0x204a81[_0xe2bd('0x1f')],_0x5b71c7=_0x204a81[_0xe2bd('0x1f')]+_0x204a81['limit'],_0x27f8f0;if(_0x5b71c7>=_0x1e0be2){_0x5b71c7=_0x1e0be2;_0x27f8f0=0xc8;}else{_0x27f8f0=0xce;}_0x582351[_0xe2bd('0x1c')](_0x27f8f0);return _0x582351[_0xe2bd('0x20')](_0xe2bd('0x21'),_0x288d87+'-'+_0x5b71c7+'/'+_0x1e0be2)['json'](_0x17d147);}return null;};}function patchUpdates(_0xd412d9){return function(_0x16fb5b){try{jsonpatch[_0xe2bd('0x22')](_0x16fb5b,_0xd412d9,!![]);}catch(_0x2883ba){return BPromise[_0xe2bd('0x23')](_0x2883ba);}return _0x16fb5b[_0xe2bd('0x24')]();};}function saveUpdates(_0x5433fe,_0x27b1c2){return function(_0x14edbb){if(_0x14edbb){return _0x14edbb[_0xe2bd('0x25')](_0x5433fe)[_0xe2bd('0x26')](function(_0x16cba9){return _0x16cba9;});}return null;};}function removeEntity(_0x499e51,_0x2bf7ee){return function(_0xddfdc9){if(_0xddfdc9){return _0xddfdc9['destroy']()['then'](function(){_0x499e51[_0xe2bd('0x1c')](0xcc)[_0xe2bd('0x1d')]();});}};}function handleEntityNotFound(_0x47918b,_0x32fee7){return function(_0x2847ed){if(!_0x2847ed){_0x47918b[_0xe2bd('0x1b')](0x194);}return _0x2847ed;};}function handleError(_0x5158e9,_0x4b61a8){_0x4b61a8=_0x4b61a8||0x1f4;return function(_0x29caaf){logger[_0xe2bd('0x27')](_0x29caaf[_0xe2bd('0x28')]);if(_0x29caaf[_0xe2bd('0x29')]){delete _0x29caaf[_0xe2bd('0x29')];}_0x5158e9[_0xe2bd('0x1c')](_0x4b61a8)[_0xe2bd('0x2a')](_0x29caaf);};}exports[_0xe2bd('0x2b')]=function(_0xbe448a,_0x2416c4){var _0x1d10eb={},_0x4e0640={},_0x3e3ab7={'count':0x0,'rows':[]};var _0x2cb5d8=db[_0xe2bd('0x2c')][_0xe2bd('0x2d')];_0x4e0640[_0xe2bd('0x2e')]=_[_0xe2bd('0x2f')](_0x2cb5d8);_0x4e0640['query']=_[_0xe2bd('0x2f')](_0xbe448a['query']);_0x4e0640[_0xe2bd('0x30')]=_['intersection'](_0x4e0640['model'],_0x4e0640[_0xe2bd('0x31')]);_0x1d10eb[_0xe2bd('0x32')]=_[_0xe2bd('0x33')](_0x4e0640[_0xe2bd('0x2e')],qs[_0xe2bd('0x34')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x1d10eb['attributes']=_0x1d10eb[_0xe2bd('0x32')]['length']?_0x1d10eb[_0xe2bd('0x32')]:_0x4e0640['model'];if(!_0xbe448a['query'][_0xe2bd('0x35')](_0xe2bd('0x36'))){_0x1d10eb['limit']=qs[_0xe2bd('0x37')](_0xbe448a['query']['limit']);_0x1d10eb[_0xe2bd('0x1f')]=qs['offset'](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x1f')]);}_0x1d10eb['order']=qs[_0xe2bd('0x38')](_0xbe448a['query'][_0xe2bd('0x38')]);_0x1d10eb['where']=qs[_0xe2bd('0x30')](_[_0xe2bd('0x39')](_0xbe448a['query'],_0x4e0640[_0xe2bd('0x30')]));var _0x3a42ad=[];var _0x2c1922=squel[_0xe2bd('0x3a')]()['field']('id')[_0xe2bd('0x3b')](_0xe2bd('0x29'))['field'](_0xe2bd('0x3c'))[_0xe2bd('0x3d')]('tools_tags');var _0x4ab07c=squel[_0xe2bd('0x3a')]()['field'](_0xe2bd('0x3e'))[_0xe2bd('0x3d')](_0xe2bd('0x3f'),'me')[_0xe2bd('0x40')]('me.FaxInteractionId\x20=\x20i.id')['where'](_0xe2bd('0x41'))[_0xe2bd('0x40')](_0xe2bd('0x42'));var _0x223b4b=squel[_0xe2bd('0x3a')]()[_0xe2bd('0x3b')]('u.id')[_0xe2bd('0x3b')](_0xe2bd('0x43'))[_0xe2bd('0x3d')]('user_has_fax_interactions','ui')[_0xe2bd('0x44')]('users','u',_0xe2bd('0x45'));var _0x53152e=squel[_0xe2bd('0x3a')]()[_0xe2bd('0x3d')](_0xe2bd('0x46'),'i')[_0xe2bd('0x44')](_0xe2bd('0x47'),'ui','ui.UserId\x20=\x20i.UserId')[_0xe2bd('0x44')]('users','u','u.id\x20=\x20ui.UserId')[_0xe2bd('0x44')](_0xe2bd('0x48'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe2bd('0x44')]('users','o','o.id\x20=\x20i.UserId')[_0xe2bd('0x44')]('fax_accounts','a',_0xe2bd('0x49'))[_0xe2bd('0x44')](_0xe2bd('0x3f'),'me',_0xe2bd('0x4a'));var _0x122f53=squel[_0xe2bd('0x4b')]();if(_0xbe448a['query'][_0xe2bd('0x4c')]){var _0x1e1da8=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]);_[_0xe2bd('0x2f')](_0x1e1da8)[_0xe2bd('0x4e')](function(_0x2387cd){var _0x1bfdb3=_0x1e1da8[_0x2387cd];if(_0x2387cd==='createdAt'){var _0xd19498=moment(_0x1bfdb3[_0xe2bd('0x4f')][_0xe2bd('0x50')])['startOf'](_0xe2bd('0x51'))[_0xe2bd('0x52')]()[_0xe2bd('0x53')]();var _0x352107=moment(_0x352107)['utc']()[_0xe2bd('0x54')](_0xe2bd('0x51'))[_0xe2bd('0x53')]();_0x122f53[_0xe2bd('0x55')](_0xe2bd('0x56'),_0xd19498,_0x352107);}else{if(_['isArray'](_0x1bfdb3[_0xe2bd('0x57')])){_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4e')](function(_0x50cc5a){switch(_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4f')]){case'IS':if(_0x2387cd!==_0xe2bd('0x58')&&_0x2387cd!=='Messages.count'){if(_['isArray'](_0x1bfdb3['value'])&&_0x1bfdb3['value'][_0xe2bd('0x59')]>0x1){_0x122f53['and'](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5b'),_0x1bfdb3[_0xe2bd('0x4f')]);}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+'\x20=\x20?',_0x1bfdb3[_0xe2bd('0x4f')][0x0]);}}break;case'=':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3['value']);break;case _0xe2bd('0x5d'):if(_0x2387cd===_0xe2bd('0x5e')){_0x122f53[_0xe2bd('0x55')](_0xe2bd('0x5f')+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or']('c.lastName'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or']('c.email'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}break;case'>':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3['tableAlias']+'.'+_0x2387cd+_0xe2bd('0x61'),_0x1bfdb3[_0xe2bd('0x4f')]);break;case'<':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+'\x20<\x20?',_0x1bfdb3[_0xe2bd('0x4f')]);break;}});}else{switch(_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4f')]){case'IS':if(_0x2387cd!==_0xe2bd('0x58')&&_0x2387cd!==_0xe2bd('0x62')){if(_['isArray'](_0x1bfdb3['value'])&&_0x1bfdb3[_0xe2bd('0x4f')][_0xe2bd('0x59')]>0x1){_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5b'),_0x1bfdb3[_0xe2bd('0x4f')]);}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3[_0xe2bd('0x4f')][0x0]);}}break;case'=':_0x122f53['and'](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3['value']);break;case'LIKE':if(_0x2387cd===_0xe2bd('0x5e')){_0x122f53['and'](_0xe2bd('0x5f')+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or'](_0xe2bd('0x63')+'\x20LIKE\x20?','%'+_0x1bfdb3['value']+'%');_0x122f53['or']('c.email'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x60'),'%'+_0x1bfdb3['value']+'%');}break;case'>':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3['tableAlias']+'.'+_0x2387cd+_0xe2bd('0x61'),_0x1bfdb3[_0xe2bd('0x4f')]);break;case'<':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x64'),_0x1bfdb3[_0xe2bd('0x4f')]);break;}}}});}else{var _0x2a0635=_(Object[_0xe2bd('0x2f')](_0xbe448a[_0xe2bd('0x31')]))[_0xe2bd('0x65')](function(_0x3a8c2d){return _0x2cb5d8[_0xe2bd('0x35')](_0x3a8c2d)?_0x3a8c2d:undefined;})['filter'](function(_0x50e2bf){return!_[_0xe2bd('0x66')](_0x50e2bf);})[_0xe2bd('0x4f')]();if(!_[_0xe2bd('0x67')](_0x2a0635)){_0x2a0635['forEach'](function(_0x129a4d){if(_0x129a4d===_0xe2bd('0x68')){_0x53152e['where'](_0xe2bd('0x69'),[][_0xe2bd('0x6a')](_0xbe448a[_0xe2bd('0x31')][_0x129a4d]));}else if(_0x129a4d==='createdAt'){var _0x7df06b=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0x129a4d])['$gte'];var _0x52d0bc=JSON[_0xe2bd('0x4d')](_0xbe448a['query'][_0x129a4d])[_0xe2bd('0x6b')];_0x53152e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x7df06b,_0x52d0bc);}else{_0x53152e[_0xe2bd('0x40')]('i.'+_0x129a4d+'\x20=\x20?',_0xbe448a['query'][_0x129a4d]);}});}if(_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x6c')]){var _0x1ae25b=_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x6c')][_0xe2bd('0x6d')]('\x5c','\x5c\x5c')[_0xe2bd('0x6d')]('\x27\x27',_0xe2bd('0x6e'));if(qs[_0xe2bd('0x6f')](_0x1ae25b)){_0x122f53['or']('i.id\x20LIKE\x20?',_0x1ae25b+'%')['or'](_0xe2bd('0x70'),_0x1ae25b+'%');}_0x122f53['or'](_0xe2bd('0x71'),_0x1ae25b+'%');}}_0x53152e['where'](_0x122f53);if(_0x1d10eb[_0xe2bd('0x72')]){_0x1d10eb[_0xe2bd('0x72')][_0xe2bd('0x4e')](function(_0x48c3da){_0x53152e[_0xe2bd('0x72')]('i.'+_0x48c3da[0x0],_0x48c3da[0x1]===_0xe2bd('0x73')?![]:!![]);});}_0x53152e['group'](_0xe2bd('0x74'));var _0x28730d={'type':db[_0xe2bd('0x75')]['QueryTypes'][_0xe2bd('0x76')],'raw':!![]};var _0x342e6d=_0x53152e[_0xe2bd('0x77')]()[_0xe2bd('0x3b')](_0xe2bd('0x3e'));if(!_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]){if(_0xbe448a['query'][_0xe2bd('0x78')]){if(_0xbe448a['query'][_0xe2bd('0x78')]==0x1){_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')](_0xe2bd('0x79'),_0x4ab07c['toString']()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x7b'));}else{_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')]('%s\x20>\x200',_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e['having']('`Messages.count`\x20>\x200');}}if(_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x7d')]){var _0x3b182f=_[_0xe2bd('0x7e')](_0xbe448a[_0xe2bd('0x31')]['tag'])?_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x7d')]:new Array(_0xbe448a['query'][_0xe2bd('0x7d')]);var _0x2d4396=squel['expr']();_0x3b182f['forEach'](function(_0x68789f){_0x2d4396['or'](_0xe2bd('0x7f'),'%,'+_0x68789f+',%');});_0x53152e[_0xe2bd('0x7a')](_0x2d4396);_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x80'),'it',_0xe2bd('0x81'));_0x342e6d['left_join'](_0xe2bd('0x82'),'t','t.id\x20=\x20it.TagId');_0x342e6d[_0xe2bd('0x40')]('t.id\x20IN\x20?',_0x3b182f);}}else{var _0x1e1da8=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]);_[_0xe2bd('0x2f')](_0x1e1da8)['forEach'](function(_0x3366b1){var _0x1c7022=_0x1e1da8[_0x3366b1];if(_0x3366b1===_0xe2bd('0x58')){var _0x59d69d=_0x1c7022[_0xe2bd('0x4f')];var _0x352206=squel[_0xe2bd('0x4b')]();_0x59d69d['forEach'](function(_0x154ec4){_0x352206['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x154ec4+',%');});_0x53152e[_0xe2bd('0x7a')](_0x352206);_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x83'),'it',_0xe2bd('0x84'));_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x82'),'t','t.id\x20=\x20it.TagId');_0x342e6d['where'](_0xe2bd('0x85'),_0x59d69d);}else if(_0x3366b1==='Messages.count'){if(_0x1c7022['value'][_0xe2bd('0x59')]===0x1){if(_0x1c7022[_0xe2bd('0x4f')][0x0]===0x1){_0x342e6d['where'](util['format'](_0xe2bd('0x79'),_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x7b'));}else{_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')]('%s\x20>\x200',_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x86'));}}}});}db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x342e6d['toString'](),_0x28730d)['then'](function(_0x1cb883){_0x3e3ab7['count']=_0x1cb883[_0xe2bd('0x59')];if(_0x3e3ab7[_0xe2bd('0x1e')]===0x0)return[];return db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x2c1922[_0xe2bd('0x7c')](),_0x28730d)[_0xe2bd('0x26')](function(_0x559c56){_0x3a42ad=_['keyBy'](_0x559c56,'id');_0x28730d=_[_0xe2bd('0x88')](_0x28730d,{'model':db[_0xe2bd('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x53152e[_0xe2bd('0x3b')](_0x4ab07c,_0xe2bd('0x62'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x89'),_0xe2bd('0x8a'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x8b'));_0x53152e[_0xe2bd('0x3b')]('c.firstName',_0xe2bd('0x8c'));_0x53152e['field'](_0xe2bd('0x63'),_0xe2bd('0x8d'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x8e'),_0xe2bd('0x8f'));_0x53152e[_0xe2bd('0x3b')]('c.phone','Contact.phone');_0x53152e['field'](_0xe2bd('0x90'),'Contact.mobile');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x91'),'Contact.fax');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x92'),'User.name');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x93'),_0xe2bd('0x94'));_0x53152e['left_join'](_0xe2bd('0x80'),'it',_0xe2bd('0x81'));_0x53152e[_0xe2bd('0x44')](_0xe2bd('0x82'),'t',_0xe2bd('0x95'));_0x53152e[_0xe2bd('0x37')](_0x1d10eb[_0xe2bd('0x37')]);_0x53152e['offset'](_0x1d10eb['offset']);return db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x53152e[_0xe2bd('0x7c')](),_0x28730d);})[_0xe2bd('0x26')](function(_0x33b0a7){_0x223b4b['where'](_0xe2bd('0x96'),_[_0xe2bd('0x65')](_0x33b0a7,'id'));return db['sequelize'][_0xe2bd('0x31')](_0x223b4b[_0xe2bd('0x7c')](),_0x28730d)[_0xe2bd('0x26')](function(_0x32f7f9){var _0x649f62=_[_0xe2bd('0x97')](_0x32f7f9,_0xe2bd('0x98'));_0x33b0a7['forEach'](function(_0x291623){if(_0x649f62[_0x291623['id']]){_0x291623[_0xe2bd('0x99')]=_['map'](_0x649f62[_0x291623['id']],function(_0x19521a){return{'id':_0x19521a['id']};});}if(_0x291623[_0xe2bd('0x94')]){_0x291623[_0xe2bd('0x9a')]=[];_0x291623['TagIds'][_0xe2bd('0x9b')](',')['forEach'](function(_0x5253df){_0x291623['Tags'][_0xe2bd('0x9c')](_0x3a42ad[_0x5253df]);});}delete _0x291623[_0xe2bd('0x94')];});return _0x33b0a7;});});})[_0xe2bd('0x26')](function(_0x66217c){_0x3e3ab7[_0xe2bd('0x9d')]=_0x66217c;return _0x3e3ab7;})['then'](respondWithFilteredResult(_0x2416c4,_0x1d10eb))['catch'](handleError(_0x2416c4,null));};exports[_0xe2bd('0x9e')]=function(_0x23fbc5,_0x5416b5){var _0x5b6359={'raw':![],'where':{'id':_0x23fbc5[_0xe2bd('0x9f')]['id']}},_0xfb04a9={};_0xfb04a9[_0xe2bd('0x2e')]=_[_0xe2bd('0x2f')](db[_0xe2bd('0x2c')][_0xe2bd('0x2d')]);_0xfb04a9[_0xe2bd('0x31')]=_[_0xe2bd('0x2f')](_0x23fbc5[_0xe2bd('0x31')]);_0xfb04a9[_0xe2bd('0x30')]=_[_0xe2bd('0x33')](_0xfb04a9[_0xe2bd('0x2e')],_0xfb04a9['query']);_0x5b6359[_0xe2bd('0x32')]=_['intersection'](_0xfb04a9[_0xe2bd('0x2e')],qs['fields'](_0x23fbc5[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x5b6359['attributes']=_0x5b6359[_0xe2bd('0x32')]['length']?_0x5b6359[_0xe2bd('0x32')]:_0xfb04a9[_0xe2bd('0x2e')];if(_0x23fbc5['query'][_0xe2bd('0xa0')]){_0x5b6359[_0xe2bd('0xa1')]=[{'all':!![]}];}_0x5b6359=_[_0xe2bd('0x88')]({},_0x5b6359,_0x23fbc5['options']);return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')](_0x5b6359)[_0xe2bd('0x26')](handleEntityNotFound(_0x5416b5,null))[_0xe2bd('0x26')](respondWithResult(_0x5416b5,null))[_0xe2bd('0xa3')](handleError(_0x5416b5,null));};exports[_0xe2bd('0xa4')]=function(_0x3b4359,_0x18b97b){return db[_0xe2bd('0x2c')][_0xe2bd('0xa4')](_0x3b4359[_0xe2bd('0xa5')],{})['then'](respondWithResult(_0x18b97b,0xc9))[_0xe2bd('0xa3')](handleError(_0x18b97b,null));};exports[_0xe2bd('0x25')]=function(_0x5b2bb7,_0x595c4d){if(_0x5b2bb7[_0xe2bd('0xa5')]['id']){delete _0x5b2bb7['body']['id'];}return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x5b2bb7[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x595c4d,null))[_0xe2bd('0x26')](saveUpdates(_0x5b2bb7[_0xe2bd('0xa5')],null))[_0xe2bd('0x26')](respondWithResult(_0x595c4d,null))[_0xe2bd('0xa3')](handleError(_0x595c4d,null));};exports[_0xe2bd('0xa6')]=function(_0x4de59f,_0x593012){return db['FaxInteraction'][_0xe2bd('0xa2')]({'where':{'id':_0x4de59f[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x593012,null))[_0xe2bd('0x26')](removeEntity(_0x593012,null))['catch'](handleError(_0x593012,null));};exports[_0xe2bd('0xa7')]=function(_0x5034bf,_0x2e3f13){return db[_0xe2bd('0x2c')][_0xe2bd('0xa7')]()['then'](respondWithResult(_0x2e3f13,null))[_0xe2bd('0xa3')](handleError(_0x2e3f13,null));};exports['addMessage']=function(_0x387ded,_0x133546,_0x17fe62){return db[_0xe2bd('0xa8')][_0xe2bd('0xa2')]({'where':{'id':_0x387ded[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x133546,null))[_0xe2bd('0x26')](function(_0x3edfe8){if(_0x3edfe8){return _0x3edfe8[_0xe2bd('0xa9')](_0x387ded[_0xe2bd('0xa5')]['ids'],_[_0xe2bd('0xaa')](_0x387ded['body'],['ids','id'])||{});}})[_0xe2bd('0x26')](respondWithResult(_0x133546,null))[_0xe2bd('0xa3')](handleError(_0x133546,null));};exports[_0xe2bd('0xab')]=function(_0x296bf6,_0xf8475,_0x554ca9){var _0x3c770f={'raw':![],'where':{}};var _0x37c97a={};var _0x84cb89={'count':0x0,'rows':[]};return db[_0xe2bd('0x2c')][_0xe2bd('0xac')]({'where':{'id':_0x296bf6[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0xf8475,null))['then'](function(_0x1d151b){if(_0x1d151b){_0x37c97a['model']=_['keys'](db[_0xe2bd('0xa8')]['rawAttributes']);_0x37c97a['query']=_[_0xe2bd('0x2f')](_0x296bf6[_0xe2bd('0x31')]);_0x37c97a[_0xe2bd('0x30')]=_[_0xe2bd('0x33')](_0x37c97a['model'],_0x37c97a[_0xe2bd('0x31')]);_0x3c770f[_0xe2bd('0x32')]=_[_0xe2bd('0x33')](_0x37c97a['model'],qs[_0xe2bd('0x34')](_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x3c770f[_0xe2bd('0x32')]=_0x3c770f[_0xe2bd('0x32')][_0xe2bd('0x59')]?_0x3c770f['attributes']:_0x37c97a[_0xe2bd('0x2e')];if(!_0x296bf6[_0xe2bd('0x31')]['hasOwnProperty']('nolimit')){_0x3c770f[_0xe2bd('0x37')]=qs[_0xe2bd('0x37')](_0x296bf6['query'][_0xe2bd('0x37')]);_0x3c770f[_0xe2bd('0x1f')]=qs['offset'](_0x296bf6['query']['offset']);}_0x3c770f[_0xe2bd('0x72')]=qs[_0xe2bd('0x38')](_0x296bf6['query']['sort']);_0x3c770f[_0xe2bd('0x40')]=qs[_0xe2bd('0x30')](_[_0xe2bd('0x39')](_0x296bf6[_0xe2bd('0x31')],_0x37c97a[_0xe2bd('0x30')]));_0x3c770f[_0xe2bd('0x40')]['FaxInteractionId']=_0x1d151b['id'];if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x6c')]){_0x3c770f['where']=_[_0xe2bd('0x88')](_0x3c770f[_0xe2bd('0x40')],{'$or':_[_0xe2bd('0x65')](_0x3c770f['attributes'],function(_0x5b8ba6){var _0x1fa2a9={};_0x1fa2a9[_0x5b8ba6]={'$like':'%'+_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x6c')]+'%'};return _0x1fa2a9;})});}if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0xad')]){var _0x19a1a4=_0x296bf6[_0xe2bd('0x31')]['$gte'][_0xe2bd('0x9b')](',');var _0x446409={};_0x446409[_0x19a1a4[0x0]]={'$gte':moment(_0x19a1a4[0x1])['format'](_0xe2bd('0xae'))};_0x3c770f[_0xe2bd('0x40')]=_['merge'](_0x3c770f['where'],_0x446409);}_0x3c770f=_['merge']({},_0x3c770f,_0x296bf6[_0xe2bd('0xaf')]);return db[_0xe2bd('0xa8')][_0xe2bd('0x1e')]({'where':_0x3c770f[_0xe2bd('0x40')]})[_0xe2bd('0x26')](function(_0x319f30){_0x84cb89['count']=_0x319f30;if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0xa0')]){_0x3c770f[_0xe2bd('0xa1')]=[{'all':!![]}];}return db[_0xe2bd('0xa8')][_0xe2bd('0xb0')](_0x3c770f);})['then'](function(_0x16b6a9){_0x84cb89[_0xe2bd('0x9d')]=_0x16b6a9;return _0x84cb89;});}})[_0xe2bd('0x26')](respondWithFilteredResult(_0xf8475,_0x3c770f))[_0xe2bd('0xa3')](handleError(_0xf8475,null));};exports[_0xe2bd('0xb1')]=function(_0x1aace2,_0x69da87,_0x1a63ad){return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x1aace2[_0xe2bd('0x9f')]['id']}})['then'](handleEntityNotFound(_0x69da87,null))[_0xe2bd('0x26')](function(_0x1b0977){if(_0x1b0977){return _0x1b0977[_0xe2bd('0xb2')](_0x1aace2[_0xe2bd('0xa5')]['ids'],_[_0xe2bd('0xaa')](_0x1aace2[_0xe2bd('0xa5')],[_0xe2bd('0xb3'),'id'])||{})[_0xe2bd('0xb4')](function(){return db[_0xe2bd('0xb5')][_0xe2bd('0xb0')]({'attributes':['id',_0xe2bd('0x29'),_0xe2bd('0x3c')],'where':{'id':_0x1aace2[_0xe2bd('0xa5')][_0xe2bd('0xb3')]}});})[_0xe2bd('0x26')](function(_0x4e7819){socket[_0xe2bd('0xb6')](_0xe2bd('0xb7'),{'id':Number(_0x1aace2[_0xe2bd('0x9f')]['id']),'tags':_0x4e7819||[]});return{'id':Number(_0x1aace2[_0xe2bd('0x9f')]['id']),'tags':_0x4e7819||[]};});}})[_0xe2bd('0x26')](respondWithResult(_0x69da87,null))['catch'](handleError(_0x69da87,null));};exports[_0xe2bd('0xb8')]=function(_0x16875d,_0x272bea,_0x1ae797){return db[_0xe2bd('0x2c')]['find']({'where':{'id':_0x16875d[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x272bea,null))['then'](function(_0x4f8706){if(_0x4f8706){return _0x4f8706[_0xe2bd('0xb8')](_0x16875d[_0xe2bd('0x31')]['ids']);}})[_0xe2bd('0x26')](respondWithStatusCode(_0x272bea,null))['catch'](handleError(_0x272bea,null));};exports[_0xe2bd('0xb9')]=function(_0x3da21f,_0xa2fe8b){var _0x4ee1c3=moment()['unix']()[_0xe2bd('0x7c')]();var _0x9f7a98=path[_0xe2bd('0xba')](config['root'],'server',_0xe2bd('0xbb'),_0xe2bd('0xbc'));var _0x45acc7=path[_0xe2bd('0xba')](config['root'],_0xe2bd('0xbd'),_0xe2bd('0xbb'),_0xe2bd('0xbe'));var _0x40a680=path[_0xe2bd('0xba')](_0x45acc7,_0x4ee1c3);var _0x57e8a8=util[_0xe2bd('0x53')](_0xe2bd('0xbf'),_0x4ee1c3);var _0x46fe6a=path[_0xe2bd('0xba')](_0x45acc7,_0x57e8a8);var _0x1db1fe=![];return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x3da21f['params']['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0xa2fe8b,null))[_0xe2bd('0x26')](function(_0x257e62){if(_0x257e62){return _0x257e62['getMessages']({'attributes':['id','body',_0xe2bd('0xc0')],'include':[{'model':db['Attachment'],'as':_0xe2bd('0xc1')}]});}return[];})['then'](function(_0x76825d){_0x1db1fe=_0x76825d[_0xe2bd('0x59')];if(_0x76825d[_0xe2bd('0x59')]){fs['mkdirSync'](_0x40a680);for(var _0x39fe65=0x0;_0x39fe65<_0x76825d[_0xe2bd('0x59')];_0x39fe65++){var _0x4cecc4=_0x76825d[_0x39fe65];var _0x44fc6a=_0x4cecc4[_0xe2bd('0xc1')];if(_0x44fc6a){var _0x3a92bd=path[_0xe2bd('0xba')](_0x9f7a98,_0x44fc6a[_0xe2bd('0xc2')]);if(fs['existsSync'](_0x3a92bd)){fs[_0xe2bd('0xc3')](_0x3a92bd)[_0xe2bd('0xc4')](fs[_0xe2bd('0xc5')](path['join'](_0x40a680,_0x44fc6a[_0xe2bd('0xc2')])));}}}}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return new BPromise(function(_0x37ecbe,_0x18082e){zipdir(_0x40a680,{'saveTo':_0x46fe6a},function(_0x1b74ba,_0x12837f){if(_0x1b74ba)return _0x18082e(_0x1b74ba);return _0x37ecbe(_0x12837f);});});}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return new BPromise(function(_0x1982ba,_0xb23492){rimraf(_0x40a680,function(_0x55ecbd){if(_0x55ecbd)_0xb23492(_0x55ecbd);return _0x1982ba();});});}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return _0xa2fe8b[_0xe2bd('0xb9')](_0x46fe6a,_0x57e8a8,function(_0x28b5f1){if(_0x28b5f1){console[_0xe2bd('0xc6')]('err',_0x28b5f1);}else{fs[_0xe2bd('0xc7')](_0x46fe6a);}});}else{return _0xa2fe8b[_0xe2bd('0x1b')](0xc8);}})['catch'](handleError(_0xa2fe8b,null));}; \ No newline at end of file +var _0x0cb6=['isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','SELECT','read','%s\x20=\x200','toString','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','keyBy','merge','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.mobile','c.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','FaxInteractionId','Users','split','Tags','rows','params','includeAll','options','find','catch','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','Tag','emit','faxInteractionTags:save','removeTags','unix','join','server','files','attachments','interaction-%s.zip','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','FaxInteraction','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.FaxInteractionId','users','left_join','user_has_fax_interactions','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','advancedFilter','parse','forEach','createdAt','dateStart','day','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','\x20>\x20?','map','filter'];(function(_0x23ce49,_0x5bcdec){var _0x4f111c=function(_0x44e94e){while(--_0x44e94e){_0x23ce49['push'](_0x23ce49['shift']());}};_0x4f111c(++_0x5bcdec);}(_0x0cb6,0x120));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x60cb('0x0'));var emlformat=require(_0x60cb('0x1'));var rimraf=require(_0x60cb('0x2'));var zipdir=require(_0x60cb('0x3'));var jsonpatch=require(_0x60cb('0x4'));var rp=require(_0x60cb('0x5'));var moment=require(_0x60cb('0x6'));var BPromise=require(_0x60cb('0x7'));var Mustache=require(_0x60cb('0x8'));var util=require(_0x60cb('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x60cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x60cb('0xb'));var squel=require(_0x60cb('0xc'));var crypto=require(_0x60cb('0xd'));var jsforce=require(_0x60cb('0xe'));var deskjs=require(_0x60cb('0xf'));var toCsv=require(_0x60cb('0xa'));var querystring=require('querystring');var Papa=require(_0x60cb('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60cb('0x11'));var hardwareService=require(_0x60cb('0x12'));var logger=require(_0x60cb('0x13'))(_0x60cb('0x14'));var utils=require(_0x60cb('0x15'));var config=require(_0x60cb('0x16'));var db=require(_0x60cb('0x17'))['db'];config[_0x60cb('0x18')]=_['defaults'](config[_0x60cb('0x18')],{'host':_0x60cb('0x19'),'port':0x18eb});var socket=require(_0x60cb('0x1a'))(new Redis(config[_0x60cb('0x18')]));require(_0x60cb('0x1b'))['register'](socket);function respondWithStatusCode(_0x5f5393,_0x49010d){_0x49010d=_0x49010d||0xcc;return function(_0x2d1426){if(_0x2d1426){return _0x5f5393[_0x60cb('0x1c')](_0x49010d);}return _0x5f5393[_0x60cb('0x1d')](_0x49010d)[_0x60cb('0x1e')]();};}function respondWithResult(_0x49fe2b,_0x13bd04){_0x13bd04=_0x13bd04||0xc8;return function(_0x2012b2){if(_0x2012b2){return _0x49fe2b[_0x60cb('0x1d')](_0x13bd04)[_0x60cb('0x1f')](_0x2012b2);}};}function respondWithFilteredResult(_0x17dfe5,_0x25f422){return function(_0x1efd59){if(_0x1efd59){var _0x8bdf60=_0x1efd59[_0x60cb('0x20')],_0x5c5b20=_0x25f422[_0x60cb('0x21')],_0x2f9219=_0x25f422['offset']+_0x25f422['limit'],_0xad11f2;if(_0x2f9219>=_0x8bdf60){_0x2f9219=_0x8bdf60;_0xad11f2=0xc8;}else{_0xad11f2=0xce;}_0x17dfe5['status'](_0xad11f2);return _0x17dfe5['set'](_0x60cb('0x22'),_0x5c5b20+'-'+_0x2f9219+'/'+_0x8bdf60)[_0x60cb('0x1f')](_0x1efd59);}return null;};}function patchUpdates(_0x6d06e7){return function(_0x166b59){try{jsonpatch[_0x60cb('0x23')](_0x166b59,_0x6d06e7,!![]);}catch(_0x5ecc4b){return BPromise[_0x60cb('0x24')](_0x5ecc4b);}return _0x166b59[_0x60cb('0x25')]();};}function saveUpdates(_0x1ce72f,_0x20a81d){return function(_0x522961){if(_0x522961){return _0x522961[_0x60cb('0x26')](_0x1ce72f)[_0x60cb('0x27')](function(_0x3054c9){return _0x3054c9;});}return null;};}function removeEntity(_0x4407bb,_0x5a2a1a){return function(_0x2c9341){if(_0x2c9341){return _0x2c9341[_0x60cb('0x28')]()['then'](function(){_0x4407bb[_0x60cb('0x1d')](0xcc)[_0x60cb('0x1e')]();});}};}function handleEntityNotFound(_0x233665,_0x56ce46){return function(_0x5ac10d){if(!_0x5ac10d){_0x233665[_0x60cb('0x1c')](0x194);}return _0x5ac10d;};}function handleError(_0x46657b,_0x1a124d){_0x1a124d=_0x1a124d||0x1f4;return function(_0x1b1c4d){logger[_0x60cb('0x29')](_0x1b1c4d['stack']);if(_0x1b1c4d[_0x60cb('0x2a')]){delete _0x1b1c4d[_0x60cb('0x2a')];}_0x46657b['status'](_0x1a124d)['send'](_0x1b1c4d);};}exports['index']=function(_0x456654,_0x479ea9){var _0x33c73f={},_0xf63f={},_0x387f98={'count':0x0,'rows':[]};var _0x504604=db[_0x60cb('0x2b')][_0x60cb('0x2c')];_0xf63f[_0x60cb('0x2d')]=_['keys'](_0x504604);_0xf63f['query']=_[_0x60cb('0x2e')](_0x456654['query']);_0xf63f[_0x60cb('0x2f')]=_[_0x60cb('0x30')](_0xf63f['model'],_0xf63f[_0x60cb('0x31')]);_0x33c73f[_0x60cb('0x32')]=_[_0x60cb('0x30')](_0xf63f['model'],qs[_0x60cb('0x33')](_0x456654['query']['fields']));_0x33c73f[_0x60cb('0x32')]=_0x33c73f[_0x60cb('0x32')][_0x60cb('0x34')]?_0x33c73f[_0x60cb('0x32')]:_0xf63f[_0x60cb('0x2d')];if(!_0x456654['query'][_0x60cb('0x35')](_0x60cb('0x36'))){_0x33c73f['limit']=qs[_0x60cb('0x37')](_0x456654[_0x60cb('0x31')][_0x60cb('0x37')]);_0x33c73f[_0x60cb('0x21')]=qs[_0x60cb('0x21')](_0x456654[_0x60cb('0x31')][_0x60cb('0x21')]);}_0x33c73f[_0x60cb('0x38')]=qs['sort'](_0x456654[_0x60cb('0x31')][_0x60cb('0x39')]);_0x33c73f[_0x60cb('0x3a')]=qs[_0x60cb('0x2f')](_[_0x60cb('0x3b')](_0x456654[_0x60cb('0x31')],_0xf63f[_0x60cb('0x2f')]));var _0x56b6fb=[];var _0x5a5e77=squel[_0x60cb('0x3c')]()[_0x60cb('0x3d')]('id')[_0x60cb('0x3d')](_0x60cb('0x2a'))['field'](_0x60cb('0x3e'))[_0x60cb('0x3f')](_0x60cb('0x40'));var _0xfc4d0a=squel[_0x60cb('0x3c')]()['field'](_0x60cb('0x41'))[_0x60cb('0x3f')]('fax_messages','me')[_0x60cb('0x3a')](_0x60cb('0x42'))[_0x60cb('0x3a')](_0x60cb('0x43'))['where'](_0x60cb('0x44'));var _0x3dc030=squel['select']()[_0x60cb('0x3d')](_0x60cb('0x45'))['field'](_0x60cb('0x46'))[_0x60cb('0x3f')]('user_has_fax_interactions','ui')['left_join'](_0x60cb('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x1957c8=squel['select']()[_0x60cb('0x3f')]('fax_interactions','i')[_0x60cb('0x48')](_0x60cb('0x49'),'ui','ui.UserId\x20=\x20i.UserId')[_0x60cb('0x48')]('users','u',_0x60cb('0x4a'))[_0x60cb('0x48')]('cm_contacts','c',_0x60cb('0x4b'))['left_join'](_0x60cb('0x47'),'o',_0x60cb('0x4c'))[_0x60cb('0x48')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0x60cb('0x48')](_0x60cb('0x4d'),'me','me.FaxInteractionId\x20=\x20i.id');var _0x3a3d08=squel['expr']();if(_0x456654['query'][_0x60cb('0x4e')]){var _0x29ce23=JSON[_0x60cb('0x4f')](_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]);_['keys'](_0x29ce23)[_0x60cb('0x50')](function(_0x502c22){var _0x858f25=_0x29ce23[_0x502c22];if(_0x502c22===_0x60cb('0x51')){var _0x5da96b=moment(_0x858f25['value'][_0x60cb('0x52')])['startOf'](_0x60cb('0x53'))['utc']()[_0x60cb('0x54')]();var _0x56916e=moment(_0x56916e)['utc']()[_0x60cb('0x55')]('day')[_0x60cb('0x54')]();_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x57'),_0x5da96b,_0x56916e);}else{if(_[_0x60cb('0x58')](_0x858f25['condition'])){_0x858f25[_0x60cb('0x59')][_0x60cb('0x50')](function(_0x19e87a){switch(_0x858f25[_0x60cb('0x59')][_0x60cb('0x5a')]){case'IS':if(_0x502c22!==_0x60cb('0x5b')&&_0x502c22!==_0x60cb('0x5c')){if(_[_0x60cb('0x58')](_0x858f25[_0x60cb('0x5a')])&&_0x858f25['value']['length']>0x1){_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x5e'),_0x858f25['value']);}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25['tableAlias']+'.'+_0x502c22+_0x60cb('0x5f'),_0x858f25[_0x60cb('0x5a')][0x0]);}}break;case'=':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20=\x20?',_0x858f25[_0x60cb('0x5a')]);break;case _0x60cb('0x60'):if(_0x502c22===_0x60cb('0x61')){_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x62')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x64')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x65')+'\x20LIKE\x20?','%'+_0x858f25['value']+'%');}else{_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20LIKE\x20?','%'+_0x858f25[_0x60cb('0x5a')]+'%');}break;case'>':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20>\x20?',_0x858f25['value']);break;case'<':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x66'),_0x858f25['value']);break;}});}else{switch(_0x858f25['condition'][_0x60cb('0x5a')]){case'IS':if(_0x502c22!==_0x60cb('0x5b')&&_0x502c22!=='Messages.count'){if(_[_0x60cb('0x58')](_0x858f25[_0x60cb('0x5a')])&&_0x858f25['value']['length']>0x1){_0x3a3d08[_0x60cb('0x56')](_0x858f25['tableAlias']+'.'+_0x502c22+_0x60cb('0x5e'),_0x858f25[_0x60cb('0x5a')]);}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x5f'),_0x858f25[_0x60cb('0x5a')][0x0]);}}break;case'=':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+'\x20=\x20?',_0x858f25[_0x60cb('0x5a')]);break;case'LIKE':if(_0x502c22===_0x60cb('0x61')){_0x3a3d08[_0x60cb('0x56')](_0x60cb('0x62')+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x64')+'\x20LIKE\x20?','%'+_0x858f25[_0x60cb('0x5a')]+'%');_0x3a3d08['or'](_0x60cb('0x65')+_0x60cb('0x63'),'%'+_0x858f25['value']+'%');}else{_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x63'),'%'+_0x858f25[_0x60cb('0x5a')]+'%');}break;case'>':_0x3a3d08[_0x60cb('0x56')](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x67'),_0x858f25['value']);break;case'<':_0x3a3d08['and'](_0x858f25[_0x60cb('0x5d')]+'.'+_0x502c22+_0x60cb('0x66'),_0x858f25[_0x60cb('0x5a')]);break;}}}});}else{var _0x46356b=_(Object[_0x60cb('0x2e')](_0x456654['query']))[_0x60cb('0x68')](function(_0x1cfcd5){return _0x504604[_0x60cb('0x35')](_0x1cfcd5)?_0x1cfcd5:undefined;})[_0x60cb('0x69')](function(_0x1a41f7){return!_[_0x60cb('0x6a')](_0x1a41f7);})[_0x60cb('0x5a')]();if(!_[_0x60cb('0x6b')](_0x46356b)){_0x46356b['forEach'](function(_0xa27ca7){if(_0xa27ca7===_0x60cb('0x6c')){_0x1957c8[_0x60cb('0x3a')](_0x60cb('0x6d'),[][_0x60cb('0x6e')](_0x456654[_0x60cb('0x31')][_0xa27ca7]));}else if(_0xa27ca7===_0x60cb('0x51')){var _0x2a61cc=JSON[_0x60cb('0x4f')](_0x456654['query'][_0xa27ca7])['$gte'];var _0x47e72b=JSON['parse'](_0x456654['query'][_0xa27ca7])[_0x60cb('0x6f')];_0x1957c8[_0x60cb('0x3a')](_0x60cb('0x57'),_0x2a61cc,_0x47e72b);}else{_0x1957c8[_0x60cb('0x3a')]('i.'+_0xa27ca7+_0x60cb('0x5f'),_0x456654[_0x60cb('0x31')][_0xa27ca7]);}});}if(_0x456654[_0x60cb('0x31')]['filter']){var _0x2f5685=_0x456654['query'][_0x60cb('0x69')][_0x60cb('0x70')]('\x5c','\x5c\x5c')[_0x60cb('0x70')]('\x27\x27',_0x60cb('0x71'));if(qs[_0x60cb('0x72')](_0x2f5685)){_0x3a3d08['or'](_0x60cb('0x73'),_0x2f5685+'%')['or'](_0x60cb('0x74'),_0x2f5685+'%');}_0x3a3d08['or'](_0x60cb('0x75'),_0x2f5685+'%');}}_0x1957c8['where'](_0x3a3d08);if(_0x33c73f[_0x60cb('0x38')]){_0x33c73f[_0x60cb('0x38')][_0x60cb('0x50')](function(_0x582134){_0x1957c8['order']('i.'+_0x582134[0x0],_0x582134[0x1]===_0x60cb('0x76')?![]:!![]);});}_0x1957c8['group'](_0x60cb('0x77'));var _0x313f8b={'type':db[_0x60cb('0x78')]['QueryTypes'][_0x60cb('0x79')],'raw':!![]};var _0x38ea34=_0x1957c8['clone']()[_0x60cb('0x3d')](_0x60cb('0x41'));if(!_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]){if(_0x456654['query']['read']){if(_0x456654['query'][_0x60cb('0x7a')]==0x1){_0x38ea34[_0x60cb('0x3a')](util['format'](_0x60cb('0x7b'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8[_0x60cb('0x7d')](_0x60cb('0x7e'));}else{_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7f'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8['having'](_0x60cb('0x80'));}}if(_0x456654[_0x60cb('0x31')][_0x60cb('0x81')]){var _0x3b85bb=_[_0x60cb('0x58')](_0x456654[_0x60cb('0x31')][_0x60cb('0x81')])?_0x456654['query'][_0x60cb('0x81')]:new Array(_0x456654[_0x60cb('0x31')][_0x60cb('0x81')]);var _0xbc0a70=squel[_0x60cb('0x82')]();_0x3b85bb[_0x60cb('0x50')](function(_0xa5c9c5){_0xbc0a70['or'](_0x60cb('0x83'),'%,'+_0xa5c9c5+',%');});_0x1957c8[_0x60cb('0x7d')](_0xbc0a70);_0x38ea34['left_join'](_0x60cb('0x84'),'it',_0x60cb('0x85'));_0x38ea34[_0x60cb('0x48')]('tools_tags','t',_0x60cb('0x86'));_0x38ea34[_0x60cb('0x3a')]('t.id\x20IN\x20?',_0x3b85bb);}}else{var _0x29ce23=JSON[_0x60cb('0x4f')](_0x456654[_0x60cb('0x31')][_0x60cb('0x4e')]);_[_0x60cb('0x2e')](_0x29ce23)[_0x60cb('0x50')](function(_0x3454af){var _0xf33d48=_0x29ce23[_0x3454af];if(_0x3454af==='TagId'){var _0x104de3=_0xf33d48[_0x60cb('0x5a')];var _0x5f1656=squel[_0x60cb('0x82')]();_0x104de3[_0x60cb('0x50')](function(_0xf300b8){_0x5f1656['or'](_0x60cb('0x83'),'%,'+_0xf300b8+',%');});_0x1957c8['having'](_0x5f1656);_0x38ea34[_0x60cb('0x48')]('mail_interaction_has_tags','it',_0x60cb('0x87'));_0x38ea34[_0x60cb('0x48')](_0x60cb('0x40'),'t',_0x60cb('0x86'));_0x38ea34[_0x60cb('0x3a')](_0x60cb('0x88'),_0x104de3);}else if(_0x3454af===_0x60cb('0x5c')){if(_0xf33d48[_0x60cb('0x5a')][_0x60cb('0x34')]===0x1){if(_0xf33d48[_0x60cb('0x5a')][0x0]===0x1){_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7b'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8['having'](_0x60cb('0x7e'));}else{_0x38ea34[_0x60cb('0x3a')](util[_0x60cb('0x54')](_0x60cb('0x7f'),_0xfc4d0a[_0x60cb('0x7c')]()));_0x1957c8[_0x60cb('0x7d')](_0x60cb('0x80'));}}}});}db['sequelize'][_0x60cb('0x31')](_0x38ea34[_0x60cb('0x7c')](),_0x313f8b)[_0x60cb('0x27')](function(_0x3de4a2){_0x387f98[_0x60cb('0x20')]=_0x3de4a2[_0x60cb('0x34')];if(_0x387f98['count']===0x0)return[];return db[_0x60cb('0x89')][_0x60cb('0x31')](_0x5a5e77['toString'](),_0x313f8b)[_0x60cb('0x27')](function(_0x3da2e8){_0x56b6fb=_[_0x60cb('0x8a')](_0x3da2e8,'id');_0x313f8b=_[_0x60cb('0x8b')](_0x313f8b,{'model':db[_0x60cb('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1957c8['field'](_0xfc4d0a,_0x60cb('0x5c'));_0x1957c8['field'](_0x60cb('0x8c'),'Account.key');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x8d'));_0x1957c8['field'](_0x60cb('0x62'),_0x60cb('0x8e'));_0x1957c8['field'](_0x60cb('0x64'),_0x60cb('0x8f'));_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x65'),_0x60cb('0x90'));_0x1957c8[_0x60cb('0x3d')]('c.phone','Contact.phone');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x91'),'Contact.mobile');_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x92'),'Contact.fax');_0x1957c8['field'](_0x60cb('0x93'),_0x60cb('0x94'));_0x1957c8[_0x60cb('0x3d')](_0x60cb('0x95'),_0x60cb('0x96'));_0x1957c8[_0x60cb('0x48')]('fax_interaction_has_tags','it',_0x60cb('0x85'));_0x1957c8[_0x60cb('0x48')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x1957c8[_0x60cb('0x37')](_0x33c73f[_0x60cb('0x37')]);_0x1957c8[_0x60cb('0x21')](_0x33c73f[_0x60cb('0x21')]);return db[_0x60cb('0x89')][_0x60cb('0x31')](_0x1957c8[_0x60cb('0x7c')](),_0x313f8b);})[_0x60cb('0x27')](function(_0x233ae3){_0x3dc030[_0x60cb('0x3a')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x233ae3,'id'));return db['sequelize'][_0x60cb('0x31')](_0x3dc030[_0x60cb('0x7c')](),_0x313f8b)['then'](function(_0xb3be68){var _0x36337c=_[_0x60cb('0x97')](_0xb3be68,_0x60cb('0x98'));_0x233ae3[_0x60cb('0x50')](function(_0x4e4377){if(_0x36337c[_0x4e4377['id']]){_0x4e4377[_0x60cb('0x99')]=_[_0x60cb('0x68')](_0x36337c[_0x4e4377['id']],function(_0x31df7d){return{'id':_0x31df7d['id']};});}if(_0x4e4377[_0x60cb('0x96')]){_0x4e4377['Tags']=[];_0x4e4377[_0x60cb('0x96')][_0x60cb('0x9a')](',')[_0x60cb('0x50')](function(_0x55b818){_0x4e4377[_0x60cb('0x9b')]['push'](_0x56b6fb[_0x55b818]);});}delete _0x4e4377['TagIds'];});return _0x233ae3;});});})['then'](function(_0x3b711a){_0x387f98[_0x60cb('0x9c')]=_0x3b711a;return _0x387f98;})[_0x60cb('0x27')](respondWithFilteredResult(_0x479ea9,_0x33c73f))['catch'](handleError(_0x479ea9,null));};exports['show']=function(_0x221389,_0x59aade){var _0xc36723={'raw':![],'where':{'id':_0x221389[_0x60cb('0x9d')]['id']}},_0x3cfc82={};_0x3cfc82[_0x60cb('0x2d')]=_[_0x60cb('0x2e')](db[_0x60cb('0x2b')][_0x60cb('0x2c')]);_0x3cfc82[_0x60cb('0x31')]=_[_0x60cb('0x2e')](_0x221389[_0x60cb('0x31')]);_0x3cfc82[_0x60cb('0x2f')]=_[_0x60cb('0x30')](_0x3cfc82['model'],_0x3cfc82['query']);_0xc36723[_0x60cb('0x32')]=_[_0x60cb('0x30')](_0x3cfc82[_0x60cb('0x2d')],qs[_0x60cb('0x33')](_0x221389[_0x60cb('0x31')][_0x60cb('0x33')]));_0xc36723[_0x60cb('0x32')]=_0xc36723['attributes'][_0x60cb('0x34')]?_0xc36723[_0x60cb('0x32')]:_0x3cfc82['model'];if(_0x221389['query'][_0x60cb('0x9e')]){_0xc36723['include']=[{'all':!![]}];}_0xc36723=_[_0x60cb('0x8b')]({},_0xc36723,_0x221389[_0x60cb('0x9f')]);return db[_0x60cb('0x2b')][_0x60cb('0xa0')](_0xc36723)[_0x60cb('0x27')](handleEntityNotFound(_0x59aade,null))[_0x60cb('0x27')](respondWithResult(_0x59aade,null))[_0x60cb('0xa1')](handleError(_0x59aade,null));};exports['create']=function(_0x531ffd,_0x5514c6){return db[_0x60cb('0x2b')][_0x60cb('0xa2')](_0x531ffd[_0x60cb('0xa3')],{})[_0x60cb('0x27')](respondWithResult(_0x5514c6,0xc9))['catch'](handleError(_0x5514c6,null));};exports[_0x60cb('0x26')]=function(_0x5cc30c,_0x5507f8){if(_0x5cc30c[_0x60cb('0xa3')]['id']){delete _0x5cc30c[_0x60cb('0xa3')]['id'];}return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x5cc30c[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x5507f8,null))['then'](saveUpdates(_0x5cc30c[_0x60cb('0xa3')],null))[_0x60cb('0x27')](respondWithResult(_0x5507f8,null))[_0x60cb('0xa1')](handleError(_0x5507f8,null));};exports[_0x60cb('0x28')]=function(_0x4995d2,_0x858a58){return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x4995d2['params']['id']}})['then'](handleEntityNotFound(_0x858a58,null))['then'](removeEntity(_0x858a58,null))[_0x60cb('0xa1')](handleError(_0x858a58,null));};exports[_0x60cb('0xa4')]=function(_0x438fae,_0xd802cb){return db[_0x60cb('0x2b')][_0x60cb('0xa4')]()[_0x60cb('0x27')](respondWithResult(_0xd802cb,null))['catch'](handleError(_0xd802cb,null));};exports['addMessage']=function(_0x1cc4cb,_0x8f061f,_0x4d4076){return db[_0x60cb('0xa5')][_0x60cb('0xa0')]({'where':{'id':_0x1cc4cb[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x8f061f,null))[_0x60cb('0x27')](function(_0x435f5a){if(_0x435f5a){return _0x435f5a[_0x60cb('0xa6')](_0x1cc4cb[_0x60cb('0xa3')][_0x60cb('0xa7')],_[_0x60cb('0xa8')](_0x1cc4cb['body'],[_0x60cb('0xa7'),'id'])||{});}})[_0x60cb('0x27')](respondWithResult(_0x8f061f,null))[_0x60cb('0xa1')](handleError(_0x8f061f,null));};exports[_0x60cb('0xa9')]=function(_0xd1b922,_0x2de9bb,_0x4819e6){var _0x163020={'raw':![],'where':{}};var _0x1f4ba5={};var _0x41422f={'count':0x0,'rows':[]};return db[_0x60cb('0x2b')][_0x60cb('0xaa')]({'where':{'id':_0xd1b922[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x2de9bb,null))[_0x60cb('0x27')](function(_0x54069d){if(_0x54069d){_0x1f4ba5[_0x60cb('0x2d')]=_[_0x60cb('0x2e')](db[_0x60cb('0xa5')][_0x60cb('0x2c')]);_0x1f4ba5[_0x60cb('0x31')]=_[_0x60cb('0x2e')](_0xd1b922[_0x60cb('0x31')]);_0x1f4ba5['filters']=_[_0x60cb('0x30')](_0x1f4ba5['model'],_0x1f4ba5[_0x60cb('0x31')]);_0x163020['attributes']=_['intersection'](_0x1f4ba5[_0x60cb('0x2d')],qs['fields'](_0xd1b922[_0x60cb('0x31')][_0x60cb('0x33')]));_0x163020['attributes']=_0x163020['attributes'][_0x60cb('0x34')]?_0x163020[_0x60cb('0x32')]:_0x1f4ba5[_0x60cb('0x2d')];if(!_0xd1b922[_0x60cb('0x31')][_0x60cb('0x35')](_0x60cb('0x36'))){_0x163020[_0x60cb('0x37')]=qs[_0x60cb('0x37')](_0xd1b922[_0x60cb('0x31')][_0x60cb('0x37')]);_0x163020['offset']=qs[_0x60cb('0x21')](_0xd1b922[_0x60cb('0x31')]['offset']);}_0x163020[_0x60cb('0x38')]=qs[_0x60cb('0x39')](_0xd1b922[_0x60cb('0x31')]['sort']);_0x163020['where']=qs[_0x60cb('0x2f')](_[_0x60cb('0x3b')](_0xd1b922[_0x60cb('0x31')],_0x1f4ba5['filters']));_0x163020[_0x60cb('0x3a')]['FaxInteractionId']=_0x54069d['id'];if(_0xd1b922['query'][_0x60cb('0x69')]){_0x163020['where']=_['merge'](_0x163020[_0x60cb('0x3a')],{'$or':_[_0x60cb('0x68')](_0x163020['attributes'],function(_0x1d4a4d){var _0x18e237={};_0x18e237[_0x1d4a4d]={'$like':'%'+_0xd1b922[_0x60cb('0x31')][_0x60cb('0x69')]+'%'};return _0x18e237;})});}if(_0xd1b922[_0x60cb('0x31')][_0x60cb('0xab')]){var _0x355e5a=_0xd1b922[_0x60cb('0x31')][_0x60cb('0xab')]['split'](',');var _0x52fb23={};_0x52fb23[_0x355e5a[0x0]]={'$gte':moment(_0x355e5a[0x1])['format'](_0x60cb('0xac'))};_0x163020[_0x60cb('0x3a')]=_[_0x60cb('0x8b')](_0x163020[_0x60cb('0x3a')],_0x52fb23);}_0x163020=_['merge']({},_0x163020,_0xd1b922['options']);return db[_0x60cb('0xa5')][_0x60cb('0x20')]({'where':_0x163020['where']})[_0x60cb('0x27')](function(_0x4e18ed){_0x41422f[_0x60cb('0x20')]=_0x4e18ed;if(_0xd1b922[_0x60cb('0x31')][_0x60cb('0x9e')]){_0x163020[_0x60cb('0xad')]=[{'all':!![]}];}return db[_0x60cb('0xa5')][_0x60cb('0xae')](_0x163020);})[_0x60cb('0x27')](function(_0x7a6921){_0x41422f[_0x60cb('0x9c')]=_0x7a6921;return _0x41422f;});}})[_0x60cb('0x27')](respondWithFilteredResult(_0x2de9bb,_0x163020))[_0x60cb('0xa1')](handleError(_0x2de9bb,null));};exports['addTags']=function(_0x536f3e,_0x3d500d,_0x22d922){return db['FaxInteraction'][_0x60cb('0xa0')]({'where':{'id':_0x536f3e['params']['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x3d500d,null))[_0x60cb('0x27')](function(_0x458d98){if(_0x458d98){return _0x458d98[_0x60cb('0xaf')](_0x536f3e[_0x60cb('0xa3')][_0x60cb('0xa7')],_[_0x60cb('0xa8')](_0x536f3e[_0x60cb('0xa3')],[_0x60cb('0xa7'),'id'])||{})['spread'](function(){return db[_0x60cb('0xb0')][_0x60cb('0xae')]({'attributes':['id',_0x60cb('0x2a'),'color'],'where':{'id':_0x536f3e['body'][_0x60cb('0xa7')]}});})[_0x60cb('0x27')](function(_0x2d1cff){socket[_0x60cb('0xb1')](_0x60cb('0xb2'),{'id':Number(_0x536f3e[_0x60cb('0x9d')]['id']),'tags':_0x2d1cff||[]});return{'id':Number(_0x536f3e[_0x60cb('0x9d')]['id']),'tags':_0x2d1cff||[]};});}})['then'](respondWithResult(_0x3d500d,null))[_0x60cb('0xa1')](handleError(_0x3d500d,null));};exports[_0x60cb('0xb3')]=function(_0x15db92,_0x4c26f1,_0x44fecf){return db[_0x60cb('0x2b')][_0x60cb('0xa0')]({'where':{'id':_0x15db92[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x4c26f1,null))[_0x60cb('0x27')](function(_0x4a75e4){if(_0x4a75e4){return _0x4a75e4[_0x60cb('0xb3')](_0x15db92[_0x60cb('0x31')]['ids']);}})[_0x60cb('0x27')](respondWithStatusCode(_0x4c26f1,null))[_0x60cb('0xa1')](handleError(_0x4c26f1,null));};exports['download']=function(_0x252231,_0x517068){var _0x1ab651=moment()[_0x60cb('0xb4')]()[_0x60cb('0x7c')]();var _0x3be449=path[_0x60cb('0xb5')](config['root'],_0x60cb('0xb6'),_0x60cb('0xb7'),_0x60cb('0xb8'));var _0xcdc772=path[_0x60cb('0xb5')](config['root'],'server',_0x60cb('0xb7'),'tmp');var _0x30e755=path[_0x60cb('0xb5')](_0xcdc772,_0x1ab651);var _0x34efc8=util['format'](_0x60cb('0xb9'),_0x1ab651);var _0x44f3e1=path[_0x60cb('0xb5')](_0xcdc772,_0x34efc8);var _0x32c43d=![];return db[_0x60cb('0x2b')]['find']({'where':{'id':_0x252231[_0x60cb('0x9d')]['id']}})[_0x60cb('0x27')](handleEntityNotFound(_0x517068,null))[_0x60cb('0x27')](function(_0xbb8b60){if(_0xbb8b60){return _0xbb8b60[_0x60cb('0xa9')]({'attributes':['id',_0x60cb('0xa3'),'createdAt'],'include':[{'model':db['Attachment'],'as':_0x60cb('0xba')}]});}return[];})['then'](function(_0x31c476){_0x32c43d=_0x31c476[_0x60cb('0x34')];if(_0x31c476[_0x60cb('0x34')]){fs[_0x60cb('0xbb')](_0x30e755);for(var _0x3d44b2=0x0;_0x3d44b2<_0x31c476[_0x60cb('0x34')];_0x3d44b2++){var _0x4185e5=_0x31c476[_0x3d44b2];var _0x4a85d9=_0x4185e5[_0x60cb('0xba')];if(_0x4a85d9){var _0x16a4b2=path['join'](_0x3be449,_0x4a85d9[_0x60cb('0xbc')]);if(fs[_0x60cb('0xbd')](_0x16a4b2)){fs[_0x60cb('0xbe')](_0x16a4b2)[_0x60cb('0xbf')](fs[_0x60cb('0xc0')](path[_0x60cb('0xb5')](_0x30e755,_0x4a85d9['basename'])));}}}}})[_0x60cb('0x27')](function(){if(_0x32c43d){return new BPromise(function(_0x296a59,_0x1e6a9b){zipdir(_0x30e755,{'saveTo':_0x44f3e1},function(_0x2ff197,_0x329adb){if(_0x2ff197)return _0x1e6a9b(_0x2ff197);return _0x296a59(_0x329adb);});});}})[_0x60cb('0x27')](function(){if(_0x32c43d){return new BPromise(function(_0x3f8dc7,_0x6b0968){rimraf(_0x30e755,function(_0x22005e){if(_0x22005e)_0x6b0968(_0x22005e);return _0x3f8dc7();});});}})['then'](function(){if(_0x32c43d){return _0x517068[_0x60cb('0xc1')](_0x44f3e1,_0x34efc8,function(_0x5e1b38){if(_0x5e1b38){console[_0x60cb('0xc2')](_0x60cb('0xc3'),_0x5e1b38);}else{fs[_0x60cb('0xc4')](_0x44f3e1);}});}else{return _0x517068[_0x60cb('0x1c')](0xc8);}})['catch'](handleError(_0x517068,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 6f8e4dc..c05140c 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 _0x9ffd=['events','../../mysqldb','FaxInteraction','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7c324f,_0x326b1b){var _0x1b8d77=function(_0x339341){while(--_0x339341){_0x7c324f['push'](_0x7c324f['shift']());}};_0x1b8d77(++_0x326b1b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7d22fe,_0x2b5f9f){_0x7d22fe=_0x7d22fe-0x0;var _0x46ee01=_0x9ffd[_0x7d22fe];return _0x46ee01;};'use strict';var EventEmitter=require(_0xd9ff('0x0'));var FaxInteraction=require(_0xd9ff('0x1'))['db'][_0xd9ff('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ff('0x3'),'afterUpdate':_0xd9ff('0x4'),'afterDestroy':_0xd9ff('0x5')};function emitEvent(_0x5493ae){return function(_0x53e962,_0x1c9460,_0x111697){FaxInteractionEvents['emit'](_0x5493ae+':'+_0x53e962['id'],_0x53e962);FaxInteractionEvents[_0xd9ff('0x6')](_0x5493ae,_0x53e962);_0x111697(null);};}for(var e in events){if(events[_0xd9ff('0x7')](e)){var event=events[e];FaxInteraction[_0xd9ff('0x8')](e,emitEvent(event));}}module[_0xd9ff('0x9')]=FaxInteractionEvents; \ No newline at end of file +var _0x2547=['hasOwnProperty','exports','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','emit'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0x2547,0x1cd));var _0x7254=function(_0x924bbd,_0x590775){_0x924bbd=_0x924bbd-0x0;var _0x3e15e=_0x2547[_0x924bbd];return _0x3e15e;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){FaxInteractionEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);FaxInteractionEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index bf0acd8..6ee9273 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 _0x2082=['FaxInteraction','changed','closed','format','util','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x2082,0x1b1));var _0x2208=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x2082[_0xf16b1];return _0x26f94d;};'use strict';var _=require('lodash');var util=require(_0x2208('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2208('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2208('0x2'));var rimraf=require(_0x2208('0x3'));var config=require(_0x2208('0x4'));var attributes=require('./faxInteraction.attributes');module[_0x2208('0x5')]=function(_0x5b625a,_0xd2a30e){return _0x5b625a[_0x2208('0x6')](_0x2208('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x435016,_0x3e3a3b,_0x31f886){if(_0x435016[_0x2208('0x8')](_0x2208('0x9'))){_0x435016['closedAt']=moment()[_0x2208('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f886(null,_0x435016);}}});}; \ No newline at end of file +var _0x9d81=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','define'];(function(_0x56e828,_0x40b17b){var _0x24300b=function(_0xce649a){while(--_0xce649a){_0x56e828['push'](_0x56e828['shift']());}};_0x24300b(++_0x40b17b);}(_0x9d81,0x19c));var _0x19d8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9d81[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x19d8('0x0'));var util=require('util');var logger=require(_0x19d8('0x1'))(_0x19d8('0x2'));var moment=require(_0x19d8('0x3'));var BPromise=require(_0x19d8('0x4'));var rp=require(_0x19d8('0x5'));var fs=require('fs');var path=require(_0x19d8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x144afb,_0x14a8bd){return _0x144afb[_0x19d8('0x7')]('FaxInteraction',attributes,{'tableName':_0x19d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e3e18,_0x3388e0,_0x2a116b){if(_0x2e3e18[_0x19d8('0x9')](_0x19d8('0xa'))){_0x2e3e18[_0x19d8('0xb')]=moment()[_0x19d8('0xc')](_0x19d8('0xd'));}_0x2a116b(null,_0x2e3e18);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 476b787..0773298 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 _0xc3a4=['FaxInteraction','find','body','omit','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','update','options','where','limit','then','UpdateFaxInteraction','catch'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0xc3a4,0x7f));var _0x4c3a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc3a4[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4c3a('0x0'));var util=require('util');var moment=require(_0x4c3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c3a('0x2'));var fs=require('fs');var Redis=require(_0x4c3a('0x3'));var db=require(_0x4c3a('0x4'))['db'];var utils=require(_0x4c3a('0x5'));var logger=require(_0x4c3a('0x6'))('rpc');var config=require(_0x4c3a('0x7'));var jayson=require(_0x4c3a('0x8'));var client=jayson[_0x4c3a('0x9')][_0x4c3a('0xa')]({'port':0x232a});config[_0x4c3a('0xb')]=_[_0x4c3a('0xc')](config[_0x4c3a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c3a('0xd'))(new Redis(config[_0x4c3a('0xb')]));require(_0x4c3a('0xe'))[_0x4c3a('0xf')](socket);function respondWithRpcPromise(_0x29b0c8,_0x34c003,_0x49cacb){return new BPromise(function(_0x564de2,_0x237f09){return client[_0x4c3a('0x10')](_0x29b0c8,_0x49cacb)['then'](function(_0x439111){logger[_0x4c3a('0x11')](_0x4c3a('0x12'),_0x34c003,_0x4c3a('0x13'));logger[_0x4c3a('0x14')](_0x4c3a('0x15'),_0x34c003,_0x4c3a('0x13'),JSON[_0x4c3a('0x16')](_0x439111));if(_0x439111[_0x4c3a('0x17')]){if(_0x439111[_0x4c3a('0x17')]['code']===0x1f4){logger[_0x4c3a('0x17')](_0x4c3a('0x12'),_0x34c003,_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);return _0x237f09(_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);}logger[_0x4c3a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34c003,_0x439111['error'][_0x4c3a('0x18')]);return _0x564de2(_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);}else{logger[_0x4c3a('0x11')](_0x4c3a('0x12'),_0x34c003,_0x4c3a('0x13'));_0x564de2(_0x439111[_0x4c3a('0x19')]['message']);}})['catch'](function(_0x4de3b1){logger[_0x4c3a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34c003,_0x4de3b1);_0x237f09(_0x4de3b1);});});}exports['UpdateFaxInteraction']=function(_0x1c1100){var _0x1a8c18=this;return new Promise(function(_0x564355,_0xc298b9){return db['FaxInteraction'][_0x4c3a('0x1a')](_0x1c1100['body'],{'raw':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options'][_0x4c3a('0x1c')]||null:null,'attributes':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options']['attributes']||null:null,'limit':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options'][_0x4c3a('0x1d')]||null:null})[_0x4c3a('0x1e')](function(_0x25a94b){logger[_0x4c3a('0x11')](_0x4c3a('0x1f'),_0x1c1100);logger[_0x4c3a('0x14')](_0x4c3a('0x1f'),_0x1c1100,JSON[_0x4c3a('0x16')](_0x25a94b));_0x564355(_0x25a94b);})[_0x4c3a('0x20')](function(_0xbfbfc6){logger['error'](_0x4c3a('0x1f'),_0xbfbfc6[_0x4c3a('0x18')],_0x1c1100);_0xc298b9(_0x1a8c18[_0x4c3a('0x17')](0x1f4,_0xbfbfc6['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x6f8cb2){return new Promise(function(_0x34f702,_0xee8c31){return db[_0x4c3a('0x21')][_0x4c3a('0x22')]({'where':_0x6f8cb2[_0x4c3a('0x1b')]?_0x6f8cb2['options']['where']||null:null})[_0x4c3a('0x1e')](function(_0xd205ae){if(_0xd205ae){return _0xd205ae['addTags'](_0x6f8cb2[_0x4c3a('0x23')]['ids'],_[_0x4c3a('0x24')](_0x6f8cb2[_0x4c3a('0x23')],[_0x4c3a('0x25'),'id'])||{});}})[_0x4c3a('0x26')](function(_0x4e0e97){logger['info']('AddTags',_0x6f8cb2);logger[_0x4c3a('0x14')](_0x4c3a('0x27'),_0x6f8cb2,JSON[_0x4c3a('0x16')](_0x4e0e97));_0x34f702(_0x4e0e97);})[_0x4c3a('0x20')](function(_0x2cb917){logger[_0x4c3a('0x17')](_0x4c3a('0x27'),_0x2cb917['message'],_0x6f8cb2);_0xee8c31(_this[_0x4c3a('0x17')](0x1f4,_0x2cb917[_0x4c3a('0x18')]));});});}; \ No newline at end of file +var _0x3d6a=['attributes','limit','debug','AddTagsToFaxInteraction','find','where','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw'];(function(_0x53ea20,_0x56ac6d){var _0x4a93e8=function(_0x1c39b5){while(--_0x1c39b5){_0x53ea20['push'](_0x53ea20['shift']());}};_0x4a93e8(++_0x56ac6d);}(_0x3d6a,0xe0));var _0xa3d6=function(_0x53dcde,_0x4650ff){_0x53dcde=_0x53dcde-0x0;var _0x40be2c=_0x3d6a[_0x53dcde];return _0x40be2c;};'use strict';var _=require(_0xa3d6('0x0'));var util=require(_0xa3d6('0x1'));var moment=require(_0xa3d6('0x2'));var BPromise=require(_0xa3d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3d6('0x4'));var db=require(_0xa3d6('0x5'))['db'];var utils=require(_0xa3d6('0x6'));var logger=require(_0xa3d6('0x7'))(_0xa3d6('0x8'));var config=require(_0xa3d6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa3d6('0xa')][_0xa3d6('0xb')]({'port':0x232a});config['redis']=_[_0xa3d6('0xc')](config[_0xa3d6('0xd')],{'host':_0xa3d6('0xe'),'port':0x18eb});var socket=require(_0xa3d6('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xa3d6('0x10')](socket);function respondWithRpcPromise(_0x601d5e,_0x465efa,_0x298337){return new BPromise(function(_0x35eaab,_0x10a0cb){return client[_0xa3d6('0x11')](_0x601d5e,_0x298337)['then'](function(_0x116dab){logger[_0xa3d6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x465efa,_0xa3d6('0x13'));logger['debug'](_0xa3d6('0x14'),_0x465efa,_0xa3d6('0x13'),JSON[_0xa3d6('0x15')](_0x116dab));if(_0x116dab['error']){if(_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x17')]===0x1f4){logger[_0xa3d6('0x16')](_0xa3d6('0x18'),_0x465efa,_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x19')]);return _0x10a0cb(_0x116dab['error'][_0xa3d6('0x19')]);}logger[_0xa3d6('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x465efa,_0x116dab['error'][_0xa3d6('0x19')]);return _0x35eaab(_0x116dab[_0xa3d6('0x16')][_0xa3d6('0x19')]);}else{logger[_0xa3d6('0x12')](_0xa3d6('0x18'),_0x465efa,_0xa3d6('0x13'));_0x35eaab(_0x116dab[_0xa3d6('0x1a')][_0xa3d6('0x19')]);}})[_0xa3d6('0x1b')](function(_0x893322){logger[_0xa3d6('0x16')](_0xa3d6('0x18'),_0x465efa,_0x893322);_0x10a0cb(_0x893322);});});}exports[_0xa3d6('0x1c')]=function(_0x2df2d7){var _0xbcd1cf=this;return new Promise(function(_0x3a166b,_0x1b7160){return db[_0xa3d6('0x1d')][_0xa3d6('0x1e')](_0x2df2d7[_0xa3d6('0x1f')],{'raw':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7[_0xa3d6('0x20')][_0xa3d6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2df2d7['options']?_0x2df2d7[_0xa3d6('0x20')]['where']||null:null,'attributes':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7[_0xa3d6('0x20')][_0xa3d6('0x22')]||null:null,'limit':_0x2df2d7[_0xa3d6('0x20')]?_0x2df2d7['options'][_0xa3d6('0x23')]||null:null})['then'](function(_0x41b6f1){logger[_0xa3d6('0x12')](_0xa3d6('0x1c'),_0x2df2d7);logger[_0xa3d6('0x24')]('UpdateFaxInteraction',_0x2df2d7,JSON[_0xa3d6('0x15')](_0x41b6f1));_0x3a166b(_0x41b6f1);})[_0xa3d6('0x1b')](function(_0x126307){logger[_0xa3d6('0x16')]('UpdateFaxInteraction',_0x126307[_0xa3d6('0x19')],_0x2df2d7);_0x1b7160(_0xbcd1cf[_0xa3d6('0x16')](0x1f4,_0x126307[_0xa3d6('0x19')]));});});};exports[_0xa3d6('0x25')]=function(_0x84d33d){return new Promise(function(_0x33eb36,_0x42a757){return db[_0xa3d6('0x1d')][_0xa3d6('0x26')]({'where':_0x84d33d['options']?_0x84d33d[_0xa3d6('0x20')][_0xa3d6('0x27')]||null:null})['then'](function(_0x3a1df9){if(_0x3a1df9){return _0x3a1df9['addTags'](_0x84d33d[_0xa3d6('0x1f')]['ids'],_[_0xa3d6('0x28')](_0x84d33d[_0xa3d6('0x1f')],['ids','id'])||{});}})[_0xa3d6('0x29')](function(_0x26945f){logger[_0xa3d6('0x12')](_0xa3d6('0x2a'),_0x84d33d);logger[_0xa3d6('0x24')](_0xa3d6('0x2a'),_0x84d33d,JSON[_0xa3d6('0x15')](_0x26945f));_0x33eb36(_0x26945f);})['catch'](function(_0x3342b9){logger[_0xa3d6('0x16')](_0xa3d6('0x2a'),_0x3342b9['message'],_0x84d33d);_0x42a757(_this['error'](0x1f4,_0x3342b9[_0xa3d6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 029a7d1..7b18e88 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 _0x43ac=['faxInteraction:','remove','update','emit','register'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0x43ac,0xb0));var _0xc43a=function(_0x16768a,_0x361d22){_0x16768a=_0x16768a-0x0;var _0x57b061=_0x43ac[_0x16768a];return _0x57b061;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0xc43a('0x0'),_0xc43a('0x1')];function createListener(_0x5f31ed,_0x39c24e){return function(_0xa5eeb8){_0x39c24e[_0xc43a('0x2')](_0x5f31ed,_0xa5eeb8);};}function removeListener(_0xff1886,_0x4be0ed){return function(){FaxInteractionEvents['removeListener'](_0xff1886,_0x4be0ed);};}exports[_0xc43a('0x3')]=function(_0x2240a2){for(var _0x3594ac=0x0,_0x40b26a=events['length'];_0x3594ac<_0x40b26a;_0x3594ac++){var _0xd63d58=events[_0x3594ac];var _0xcf64ad=createListener(_0xc43a('0x4')+_0xd63d58,_0x2240a2);FaxInteractionEvents['on'](_0xd63d58,_0xcf64ad);}}; \ No newline at end of file +var _0x8568=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8568,0x1a4));var _0x8856=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x8568[_0x292f93];return _0x5a94b1;};'use strict';var FaxInteractionEvents=require(_0x8856('0x0'));var events=[_0x8856('0x1'),_0x8856('0x2'),_0x8856('0x3')];function createListener(_0x1ff806,_0x30ce4f){return function(_0x2a38dc){_0x30ce4f[_0x8856('0x4')](_0x1ff806,_0x2a38dc);};}function removeListener(_0x285418,_0x281b81){return function(){FaxInteractionEvents[_0x8856('0x5')](_0x285418,_0x281b81);};}exports[_0x8856('0x6')]=function(_0x280f4d){for(var _0x561d50=0x0,_0x373fb0=events[_0x8856('0x7')];_0x561d50<_0x373fb0;_0x561d50++){var _0x4ac6e1=events[_0x561d50];var _0x57210c=createListener(_0x8856('0x8')+_0x4ac6e1,_0x280f4d);FaxInteractionEvents['on'](_0x4ac6e1,_0x57210c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 16c5267..a1cc66b 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 _0x784a=['faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked'];(function(_0x2b58a5,_0x135cc9){var _0xa9e7fe=function(_0x5785f3){while(--_0x5785f3){_0x2b58a5['push'](_0x2b58a5['shift']());}};_0xa9e7fe(++_0x135cc9);}(_0x784a,0x16d));var _0xa784=function(_0x51d111,_0x53ddbc){_0x51d111=_0x51d111-0x0;var _0xdaeb2e=_0x784a[_0x51d111];return _0xdaeb2e;};'use strict';var multer=require(_0xa784('0x0'));var util=require('util');var path=require(_0xa784('0x1'));var timeout=require(_0xa784('0x2'));var express=require('express');var router=express[_0xa784('0x3')]();var auth=require(_0xa784('0x4'));var interaction=require(_0xa784('0x5'));var config=require('../../config/environment');var controller=require(_0xa784('0x6'));router[_0xa784('0x7')]('/',auth[_0xa784('0x8')](),controller[_0xa784('0x9')]);router['get'](_0xa784('0xa'),auth[_0xa784('0x8')](),controller[_0xa784('0xb')]);router['get'](_0xa784('0xc'),auth[_0xa784('0x8')](),controller[_0xa784('0xd')]);router[_0xa784('0x7')](_0xa784('0xe'),auth[_0xa784('0x8')](),controller[_0xa784('0xf')]);router['get'](_0xa784('0x10'),auth[_0xa784('0x8')](),controller['download']);router[_0xa784('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa784('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa784('0x12')]);router['post'](_0xa784('0x13'),auth[_0xa784('0x8')](),interaction['tracked'](_0xa784('0x14'),_0xa784('0x15')),controller[_0xa784('0x16')]);router[_0xa784('0x17')](_0xa784('0xc'),auth[_0xa784('0x8')](),interaction[_0xa784('0x18')](_0xa784('0x14'),_0xa784('0x19')),controller[_0xa784('0x1a')]);router[_0xa784('0x1b')]('/:id',auth[_0xa784('0x8')](),interaction[_0xa784('0x18')]('fax',_0xa784('0x1c')),controller['destroy']);router[_0xa784('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa784('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x0639=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','faxinteraction:destroy','delete','/:id/tags','removeTags','exports','util'];(function(_0x173afe,_0x12eb14){var _0xb3e606=function(_0xee5442){while(--_0xee5442){_0x173afe['push'](_0x173afe['shift']());}};_0xb3e606(++_0x12eb14);}(_0x0639,0x7f));var _0x9063=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x0639[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require('multer');var util=require(_0x9063('0x0'));var path=require(_0x9063('0x1'));var timeout=require(_0x9063('0x2'));var express=require(_0x9063('0x3'));var router=express['Router']();var auth=require(_0x9063('0x4'));var interaction=require(_0x9063('0x5'));var config=require(_0x9063('0x6'));var controller=require(_0x9063('0x7'));router['get']('/',auth[_0x9063('0x8')](),controller[_0x9063('0x9')]);router[_0x9063('0xa')](_0x9063('0xb'),auth[_0x9063('0x8')](),controller[_0x9063('0xc')]);router[_0x9063('0xa')](_0x9063('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9063('0xa')](_0x9063('0xe'),auth['isAuthenticated'](),controller[_0x9063('0xf')]);router[_0x9063('0xa')](_0x9063('0x10'),auth[_0x9063('0x8')](),controller[_0x9063('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9063('0x12')]);router['post'](_0x9063('0xe'),auth[_0x9063('0x8')](),controller[_0x9063('0x13')]);router['post']('/:id/tags',auth[_0x9063('0x8')](),interaction['tracked'](_0x9063('0x14'),_0x9063('0x15')),controller[_0x9063('0x16')]);router[_0x9063('0x17')](_0x9063('0xd'),auth[_0x9063('0x8')](),interaction[_0x9063('0x18')](_0x9063('0x14'),_0x9063('0x19')),controller[_0x9063('0x1a')]);router['delete']('/:id',auth[_0x9063('0x8')](),interaction[_0x9063('0x18')](_0x9063('0x14'),_0x9063('0x1b')),controller['destroy']);router[_0x9063('0x1c')](_0x9063('0x1d'),auth[_0x9063('0x8')](),controller[_0x9063('0x1e')]);module[_0x9063('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index f7cb10b..39dd1d4 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 _0x5e72=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5e72,0x1e6));var _0x25e7=function(_0x45fd68,_0x3f60a2){_0x45fd68=_0x45fd68-0x0;var _0x2ff2b8=_0x5e72[_0x45fd68];return _0x2ff2b8;};'use strict';var Sequelize=require(_0x25e7('0x0'));module[_0x25e7('0x1')]={'body':{'type':Sequelize[_0x25e7('0x2')](_0x25e7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x25e7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25e7('0x5')]('in',_0x25e7('0x6')),'defaultValue':_0x25e7('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x25e7('0x7')]}}; \ No newline at end of file +var _0x1cb1=['DATE','sequelize','exports','out'];(function(_0x3ffcfe,_0x569da1){var _0x3fbbfc=function(_0x3d418b){while(--_0x3d418b){_0x3ffcfe['push'](_0x3ffcfe['shift']());}};_0x3fbbfc(++_0x569da1);}(_0x1cb1,0x149));var _0x11cb=function(_0x551967,_0xf2dc7e){_0x551967=_0x551967-0x0;var _0x272036=_0x1cb1[_0x551967];return _0x272036;};'use strict';var Sequelize=require(_0x11cb('0x0'));module[_0x11cb('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x11cb('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x11cb('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a49f29e..4eed879 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 _0x858e=['isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','basename','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','save','update','destroy','stack','name','send','index','FaxMessage','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','key','VIRTUAL','field','then','includeAll','include','findAll','params','rawAttributes','body','find','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','reject','agent','FaxInteractionId','null','RejectMessage','rejectMessage','rejectmessage','create','findOne'];(function(_0x487702,_0x49f5d4){var _0x5e7150=function(_0x2b2b29){while(--_0x2b2b29){_0x487702['push'](_0x487702['shift']());}};_0x5e7150(++_0x49f5d4);}(_0x858e,0x10c));var _0xe858=function(_0x217ce7,_0x592574){_0x217ce7=_0x217ce7-0x0;var _0x4d3f53=_0x858e[_0x217ce7];return _0x4d3f53;};'use strict';var pdf=require(_0xe858('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe858('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe858('0x2'));var rp=require(_0xe858('0x3'));var moment=require(_0xe858('0x4'));var BPromise=require(_0xe858('0x5'));var Mustache=require(_0xe858('0x6'));var util=require(_0xe858('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe858('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe858('0x9'));var crypto=require(_0xe858('0xa'));var jsforce=require(_0xe858('0xb'));var deskjs=require(_0xe858('0xc'));var toCsv=require(_0xe858('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe858('0xd'));var authService=require(_0xe858('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe858('0xf'));var logger=require(_0xe858('0x10'))('api');var utils=require(_0xe858('0x11'));var config=require(_0xe858('0x12'));var db=require('../../mysqldb')['db'];config[_0xe858('0x13')]=_[_0xe858('0x14')](config[_0xe858('0x13')],{'host':_0xe858('0x15'),'port':0x18eb});var socket=require(_0xe858('0x16'))(new Redis(config['redis']));require(_0xe858('0x17'))[_0xe858('0x18')](socket);var jayson=require(_0xe858('0x19'));var client=jayson[_0xe858('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xe858('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4eabd3,_0x2a58fa,_0x592237){if(_0x592237){var _0x14e6b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14e6b7[_0xe858('0x1c')](_0x2a58fa)){return _0x4eabd3;}else{throw new Error(_0xe858('0x1d'));}}else{return _0x4eabd3;}}function respondWithRpcPromise(_0x287bdc,_0x1f9111,_0x48bd32,_0x277be6){return new BPromise(function(_0x4a6edc,_0x511af4){var _0x413f9d=_0x277be6||client;return _0x413f9d[_0xe858('0x1e')](_0x287bdc,_0x48bd32)['then'](function(_0x5db43d){logger[_0xe858('0x1f')](_0xe858('0x20'),_0x1f9111,_0xe858('0x21'));logger[_0xe858('0x22')](_0xe858('0x23'),_0x1f9111,_0xe858('0x21'),JSON[_0xe858('0x24')](_0x5db43d));if(_0x5db43d[_0xe858('0x25')]){if(_0x5db43d[_0xe858('0x25')][_0xe858('0x26')]===0x1f4){logger[_0xe858('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1f9111,_0x5db43d[_0xe858('0x25')][_0xe858('0x27')]);return _0x511af4(_0x5db43d[_0xe858('0x25')][_0xe858('0x27')]);}logger[_0xe858('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1f9111,_0x5db43d[_0xe858('0x25')]['message']);return _0x4a6edc(_0x5db43d['error'][_0xe858('0x27')]);}else{logger[_0xe858('0x1f')](_0xe858('0x20'),_0x1f9111,_0xe858('0x21'));_0x4a6edc(_0x5db43d[_0xe858('0x28')]['message']);}})[_0xe858('0x29')](function(_0x6aab29){logger[_0xe858('0x25')](_0xe858('0x20'),_0x1f9111,_0x6aab29);_0x511af4(_0x6aab29);});});}function respondWithStatusCode(_0x48cf95,_0x379cc8){_0x379cc8=_0x379cc8||0xcc;return function(_0x5229b2){if(_0x5229b2){return _0x48cf95['sendStatus'](_0x379cc8);}return _0x48cf95[_0xe858('0x2a')](_0x379cc8)[_0xe858('0x2b')]();};}function respondWithResult(_0xe98114,_0x1c4e7d){_0x1c4e7d=_0x1c4e7d||0xc8;return function(_0x4d35d8){if(_0x4d35d8){return _0xe98114['status'](_0x1c4e7d)[_0xe858('0x2c')](_0x4d35d8);}};}function respondWithFilteredResult(_0x42c5e0,_0x45db0b){return function(_0x3d0162){if(_0x3d0162){var _0x5c334e=_0x3d0162[_0xe858('0x2d')],_0x51b983=_0x45db0b[_0xe858('0x2e')],_0x46e9eb=_0x45db0b[_0xe858('0x2e')]+_0x45db0b[_0xe858('0x2f')],_0x3888b7;if(_0x46e9eb>=_0x5c334e){_0x46e9eb=_0x5c334e;_0x3888b7=0xc8;}else{_0x3888b7=0xce;}_0x42c5e0[_0xe858('0x2a')](_0x3888b7);return _0x42c5e0[_0xe858('0x30')]('Content-Range',_0x51b983+'-'+_0x46e9eb+'/'+_0x5c334e)[_0xe858('0x2c')](_0x3d0162);}return null;};}function patchUpdates(_0x50b7e8){return function(_0x1e05ab){try{jsonpatch['apply'](_0x1e05ab,_0x50b7e8,!![]);}catch(_0x408f12){return BPromise['reject'](_0x408f12);}return _0x1e05ab[_0xe858('0x31')]();};}function saveUpdates(_0x2719e7,_0x7cf7e6){return function(_0x212c2b){if(_0x212c2b){return _0x212c2b[_0xe858('0x32')](_0x2719e7)['then'](function(_0x4f10a2){return _0x4f10a2;});}return null;};}function removeEntity(_0x18a0e0,_0x1687b7){return function(_0x4da115){if(_0x4da115){return _0x4da115[_0xe858('0x33')]()['then'](function(){_0x18a0e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x526cbe,_0x1f8cd7){return function(_0xecc118){if(!_0xecc118){_0x526cbe['sendStatus'](0x194);}return _0xecc118;};}function handleError(_0x36ba67,_0x4ded4a){_0x4ded4a=_0x4ded4a||0x1f4;return function(_0xf094ec){logger[_0xe858('0x25')](_0xf094ec[_0xe858('0x34')]);if(_0xf094ec[_0xe858('0x35')]){delete _0xf094ec[_0xe858('0x35')];}_0x36ba67[_0xe858('0x2a')](_0x4ded4a)[_0xe858('0x36')](_0xf094ec);};}exports[_0xe858('0x37')]=function(_0x30a22d,_0x50fd12){var _0x21c08d={},_0xad3387={},_0x428b9d={'count':0x0,'rows':[]};var _0x3f6c4d=db[_0xe858('0x38')]['rawAttributes'];_0xad3387['model']=_[_0xe858('0x39')](_0x3f6c4d);_0xad3387['query']=_['keys'](_0x30a22d[_0xe858('0x3a')]);_0xad3387['filters']=_[_0xe858('0x3b')](_0xad3387[_0xe858('0x3c')],_0xad3387[_0xe858('0x3a')]);_0x21c08d['attributes']=_['intersection'](_0xad3387[_0xe858('0x3c')],qs[_0xe858('0x3d')](_0x30a22d[_0xe858('0x3a')][_0xe858('0x3d')]));_0x21c08d[_0xe858('0x3e')]=_0x21c08d[_0xe858('0x3e')][_0xe858('0x3f')]?_0x21c08d[_0xe858('0x3e')]:_0xad3387[_0xe858('0x3c')];if(!_0x30a22d[_0xe858('0x3a')][_0xe858('0x40')](_0xe858('0x41'))){_0x21c08d[_0xe858('0x2f')]=qs[_0xe858('0x2f')](_0x30a22d['query'][_0xe858('0x2f')]);_0x21c08d[_0xe858('0x2e')]=qs['offset'](_0x30a22d[_0xe858('0x3a')][_0xe858('0x2e')]);}_0x21c08d[_0xe858('0x42')]=qs[_0xe858('0x43')](_0x30a22d[_0xe858('0x3a')]['sort']);_0x21c08d['where']=qs[_0xe858('0x44')](_['pick'](_0x30a22d[_0xe858('0x3a')],_0xad3387[_0xe858('0x44')]));if(_0x30a22d[_0xe858('0x3a')][_0xe858('0x45')]){_0x21c08d[_0xe858('0x46')]=_[_0xe858('0x47')](_0x21c08d['where'],{'$or':_[_0xe858('0x48')](_0x3f6c4d,function(_0x163a56){if(_0x163a56['type'][_0xe858('0x49')]!==_0xe858('0x4a')){var _0x5120ef={};_0x5120ef[_0x163a56[_0xe858('0x4b')]]={'$like':'%'+_0x30a22d['query'][_0xe858('0x45')]+'%'};return _0x5120ef;}})});}_0x21c08d=_[_0xe858('0x47')]({},_0x21c08d,_0x30a22d['options']);var _0x51c3f7={'where':_0x21c08d['where']};return db[_0xe858('0x38')][_0xe858('0x2d')](_0x51c3f7)[_0xe858('0x4c')](function(_0x1812d8){_0x428b9d[_0xe858('0x2d')]=_0x1812d8;if(_0x30a22d[_0xe858('0x3a')][_0xe858('0x4d')]){_0x21c08d[_0xe858('0x4e')]=[{'all':!![]}];}return db[_0xe858('0x38')][_0xe858('0x4f')](_0x21c08d);})[_0xe858('0x4c')](function(_0x48b6ed){_0x428b9d['rows']=_0x48b6ed;return _0x428b9d;})[_0xe858('0x4c')](respondWithFilteredResult(_0x50fd12,_0x21c08d))[_0xe858('0x29')](handleError(_0x50fd12,null));};exports['show']=function(_0x4972bf,_0x265e6a){var _0x50183d={'raw':!![],'where':{'id':_0x4972bf[_0xe858('0x50')]['id']}},_0x13ea07={};_0x13ea07[_0xe858('0x3c')]=_['keys'](db['FaxMessage'][_0xe858('0x51')]);_0x13ea07[_0xe858('0x3a')]=_[_0xe858('0x39')](_0x4972bf[_0xe858('0x3a')]);_0x13ea07['filters']=_[_0xe858('0x3b')](_0x13ea07['model'],_0x13ea07[_0xe858('0x3a')]);_0x50183d['attributes']=_[_0xe858('0x3b')](_0x13ea07[_0xe858('0x3c')],qs[_0xe858('0x3d')](_0x4972bf[_0xe858('0x3a')]['fields']));_0x50183d[_0xe858('0x3e')]=_0x50183d[_0xe858('0x3e')][_0xe858('0x3f')]?_0x50183d['attributes']:_0x13ea07[_0xe858('0x3c')];if(_0x4972bf[_0xe858('0x3a')][_0xe858('0x4d')]){_0x50183d['include']=[{'all':!![]}];}_0x50183d=_[_0xe858('0x47')]({},_0x50183d,_0x4972bf['options']);return db[_0xe858('0x38')]['find'](_0x50183d)[_0xe858('0x4c')](handleEntityNotFound(_0x265e6a,null))['then'](respondWithResult(_0x265e6a,null))[_0xe858('0x29')](handleError(_0x265e6a,null));};exports[_0xe858('0x32')]=function(_0x2a5148,_0x4dff27){if(_0x2a5148['body']['id']){delete _0x2a5148['body']['id'];}return db[_0xe858('0x38')]['find']({'where':{'id':_0x2a5148[_0xe858('0x50')]['id']}})[_0xe858('0x4c')](handleEntityNotFound(_0x4dff27,null))[_0xe858('0x4c')](saveUpdates(_0x2a5148[_0xe858('0x52')],null))[_0xe858('0x4c')](respondWithResult(_0x4dff27,null))[_0xe858('0x29')](handleError(_0x4dff27,null));};exports[_0xe858('0x33')]=function(_0x2fd499,_0x51326c){return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x2fd499[_0xe858('0x50')]['id']}})[_0xe858('0x4c')](handleEntityNotFound(_0x51326c,null))[_0xe858('0x4c')](removeEntity(_0x51326c,null))[_0xe858('0x29')](handleError(_0x51326c,null));};exports[_0xe858('0x54')]=function(_0x1a5546,_0x7ba88c){return db[_0xe858('0x38')][_0xe858('0x54')]()[_0xe858('0x4c')](respondWithResult(_0x7ba88c,null))[_0xe858('0x29')](handleError(_0x7ba88c,null));};var interaction_log=require(_0xe858('0x10'))('fax-interactions');exports[_0xe858('0x55')]=function(_0x45a2e4,_0x51a3f3,_0x17d9d3){var _0x3356d1={'channel':_0xe858('0x56')};if(_0x45a2e4[_0xe858('0x52')]['id']){delete _0x45a2e4[_0xe858('0x52')]['id'];}_0x45a2e4[_0xe858('0x52')][_0xe858('0x57')]=!![];_0x45a2e4[_0xe858('0x52')]['readAt']=moment()[_0xe858('0x58')](_0xe858('0x59'));_0x45a2e4[_0xe858('0x52')][_0xe858('0x5a')]=_0x45a2e4[_0xe858('0x52')]['UserId']||_0x45a2e4[_0xe858('0x5b')]['id'];return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x45a2e4[_0xe858('0x50')]['id'],'UserId':null},'include':[{'model':db[_0xe858('0x5c')],'as':_0xe858('0x5d')}]})[_0xe858('0x4c')](handleEntityNotFound(_0x51a3f3,null))['then'](saveUpdates(_0x45a2e4[_0xe858('0x52')],null))['then'](function(_0x578f7b){if(_0x578f7b){_0x3356d1[_0xe858('0x27')]=_0x578f7b['get']({'plain':!![]});return db[_0xe858('0x5e')][_0xe858('0x53')]({'where':{'id':_0x578f7b['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x51a3f3,null))[_0xe858('0x4c')](function(_0x13d8ad){if(_0x13d8ad){return _0x13d8ad[_0xe858('0x32')]({'UserId':_0x45a2e4[_0xe858('0x52')][_0xe858('0x5a')],'read1stAt':_['isNil'](_0x13d8ad['read1stAt'])?moment()[_0xe858('0x58')](_0xe858('0x59')):undefined});}return null;})[_0xe858('0x4c')](function(_0x5752c9){if(_0x5752c9){_0x3356d1[_0xe858('0x5f')]=_0x5752c9[_0xe858('0x60')]({'plain':!![]});interaction_log[_0xe858('0x1f')](_0xe858('0x61'),_0x45a2e4[_0xe858('0x5b')]['id'],_0x45a2e4[_0xe858('0x5b')]['name'],_0x45a2e4[_0xe858('0x5b')][_0xe858('0x62')],_0x3356d1['interaction']['id'],_0x45a2e4[_0xe858('0x52')]?JSON[_0xe858('0x24')](_0x45a2e4[_0xe858('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0xe858('0x63'),_0x3356d1);}return null;})[_0xe858('0x4c')](function(_0x1cfe95){if(_0x1cfe95){if(_0x45a2e4[_0xe858('0x52')]['manual']){_0x3356d1[_0xe858('0x27')][_0xe858('0x64')]=util[_0xe858('0x58')](_0xe858('0x65'),_0x45a2e4[_0xe858('0x5b')][_0xe858('0x35')]);_0x3356d1[_0xe858('0x27')][_0xe858('0x66')]=_0x3356d1[_0xe858('0x66')];_0x3356d1[_0xe858('0x27')][_0xe858('0x67')]=_0xe858('0x55');return respondWithRpcPromise(_0xe858('0x68'),_0xe858('0x68'),{'event':_0xe858('0x69'),'message':_0x3356d1[_0xe858('0x27')]},client9002)['then'](function(){return _0x3356d1;});}return _0x3356d1;}return null;})['then'](respondWithResult(_0x51a3f3,null))[_0xe858('0x29')](handleError(_0x51a3f3,null));};var interaction_log=require(_0xe858('0x10'))(_0xe858('0x6a'));exports[_0xe858('0x6b')]=function(_0x3d7f93,_0x60cbea,_0x54bef7){var _0x10c514={'agent':{},'channel':_0xe858('0x56')};if(_0x3d7f93[_0xe858('0x52')]['id']){delete _0x3d7f93[_0xe858('0x52')]['id'];}_0x3d7f93[_0xe858('0x52')][_0xe858('0x5a')]=_0x3d7f93[_0xe858('0x52')][_0xe858('0x5a')]||_0x3d7f93[_0xe858('0x5b')]['id'];_0x10c514[_0xe858('0x6c')]['id']=_0x3d7f93['body']['UserId'];return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x3d7f93['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x60cbea,null))[_0xe858('0x4c')](function(_0x226b40){if(_0x226b40){_0x10c514[_0xe858('0x27')]=_0x226b40[_0xe858('0x60')]({'plain':!![]});return db['FaxInteraction'][_0xe858('0x53')]({'where':{'id':_0x226b40[_0xe858('0x6d')]}});}return null;})[_0xe858('0x4c')](handleEntityNotFound(_0x60cbea,null))['then'](function(_0x4e435b){if(_0x4e435b){_0x10c514['interaction']=_0x4e435b[_0xe858('0x60')]({'plain':!![]});interaction_log[_0xe858('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d7f93[_0xe858('0x5b')]['id'],_0x3d7f93['user']['name'],_0x3d7f93['user'][_0xe858('0x62')],_0x10c514[_0xe858('0x5f')]['id'],_0x3d7f93[_0xe858('0x52')]?JSON[_0xe858('0x24')](_0x3d7f93[_0xe858('0x52')]):_0xe858('0x6e'));return respondWithRpcPromise(_0xe858('0x6f'),_0xe858('0x70'),_0x10c514);}return null;})['then'](function(_0x16f8cc){if(_0x16f8cc){_0x16f8cc['message'][_0xe858('0x64')]=util[_0xe858('0x58')](_0xe858('0x65'),_0x3d7f93['user']['name']);_0x16f8cc[_0xe858('0x27')][_0xe858('0x66')]=_0x10c514[_0xe858('0x66')];_0x16f8cc['message'][_0xe858('0x67')]=_0xe858('0x6b');respondWithRpcPromise(_0xe858('0x68'),_0xe858('0x68'),{'event':_0xe858('0x71'),'message':_0x16f8cc['message']},client9002);return _0x10c514;}return null;})[_0xe858('0x4c')](respondWithResult(_0x60cbea,null))['catch'](handleError(_0x60cbea,null));};exports[_0xe858('0x72')]=function(_0x2ebf53,_0x1b2d6e){var _0x3b9285;return db[_0xe858('0x38')][_0xe858('0x72')](_0x2ebf53[_0xe858('0x52')],{})['then'](function(_0xd799f5){_0x3b9285=_0xd799f5;return db[_0xe858('0x5c')][_0xe858('0x73')]({'where':{'id':_0x3b9285['ContactId']}});})[_0xe858('0x4c')](function(_0x3d4b1d){if(_[_0xe858('0x74')](_0x3d4b1d)){return;}else{_0x3b9285['fax']=_0x3d4b1d[_0xe858('0x56')];return db[_0xe858('0x75')]['findOne']({'where':{'id':_0x3b9285[_0xe858('0x76')]}});}})[_0xe858('0x4c')](function(_0x3faeaa){return respondWithRpcPromise(_0xe858('0x77'),_0xe858('0x77'),{'FaxAccountId':_[_0xe858('0x74')](_0x2ebf53[_0xe858('0x52')])?undefined:_0x2ebf53[_0xe858('0x52')][_0xe858('0x78')],'path':_[_0xe858('0x74')](_0x3faeaa)?undefined:util[_0xe858('0x58')](_0xe858('0x79'),_0x3faeaa['basename']),'fax':_[_0xe858('0x74')](_0x3b9285[_0xe858('0x56')])?undefined:_0x3b9285[_0xe858('0x56')],'AttachmentId':_0x3b9285['AttachmentId']},client9002);})[_0xe858('0x4c')](respondWithResult(_0x1b2d6e,0xc9))[_0xe858('0x29')](handleError(_0x1b2d6e,null));};exports[_0xe858('0x7a')]=function(_0x5b8781,_0x39cc6c){var _0x2d3c60=path[_0xe858('0x7b')](config[_0xe858('0x7c')],_0xe858('0x7d'),_0xe858('0x7e'),'attachments');return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x5b8781['params']['id']},'include':[{'model':db['Attachment'],'as':_0xe858('0x75')}]})[_0xe858('0x4c')](handleEntityNotFound(_0x39cc6c,null))[_0xe858('0x4c')](function(_0x497ff2){if(_0x497ff2){return _0x39cc6c[_0xe858('0x7a')](path[_0xe858('0x7b')](_0x2d3c60,_0x497ff2[_0xe858('0x75')][_0xe858('0x7f')]));}})[_0xe858('0x29')](handleError(_0x39cc6c,null));}; \ No newline at end of file +var _0xc511=['accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','create','findOne','ContactId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','server','attachments','Attachment','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','test','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','rows','show','find','body','params','describe','fax-interactions'];(function(_0x40fb7b,_0x3af7b9){var _0x47e53e=function(_0x1d90ca){while(--_0x1d90ca){_0x40fb7b['push'](_0x40fb7b['shift']());}};_0x47e53e(++_0x3af7b9);}(_0xc511,0x137));var _0x1c51=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0xc511[_0x2a0183];return _0x158c3a;};'use strict';var pdf=require(_0x1c51('0x0'));var emlformat=require(_0x1c51('0x1'));var rimraf=require(_0x1c51('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c51('0x3'));var rp=require(_0x1c51('0x4'));var moment=require(_0x1c51('0x5'));var BPromise=require(_0x1c51('0x6'));var Mustache=require(_0x1c51('0x7'));var util=require(_0x1c51('0x8'));var path=require('path');var sox=require(_0x1c51('0x9'));var csv=require(_0x1c51('0xa'));var ejs=require(_0x1c51('0xb'));var fs=require('fs');var _=require(_0x1c51('0xc'));var squel=require(_0x1c51('0xd'));var crypto=require('crypto');var jsforce=require(_0x1c51('0xe'));var deskjs=require(_0x1c51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c51('0x10'));var Papa=require(_0x1c51('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1c51('0x12'));var hardwareService=require(_0x1c51('0x13'));var logger=require(_0x1c51('0x14'))('api');var utils=require(_0x1c51('0x15'));var config=require(_0x1c51('0x16'));var db=require(_0x1c51('0x17'))['db'];config[_0x1c51('0x18')]=_['defaults'](config[_0x1c51('0x18')],{'host':_0x1c51('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c51('0x18')]));require(_0x1c51('0x1a'))[_0x1c51('0x1b')](socket);var jayson=require(_0x1c51('0x1c'));var client=jayson[_0x1c51('0x1d')][_0x1c51('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x192e73,_0x4b6b36,_0x20ac4a){if(_0x20ac4a){var _0x5a9e92=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a9e92[_0x1c51('0x1f')](_0x4b6b36)){return _0x192e73;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x192e73;}}function respondWithRpcPromise(_0x122cf5,_0x4aaf26,_0x400799,_0x31ff0d){return new BPromise(function(_0x3431cc,_0x3897f0){var _0xa2d18e=_0x31ff0d||client;return _0xa2d18e[_0x1c51('0x20')](_0x122cf5,_0x400799)[_0x1c51('0x21')](function(_0x3b23ba){logger[_0x1c51('0x22')](_0x1c51('0x23'),_0x4aaf26,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4aaf26,_0x1c51('0x24'),JSON[_0x1c51('0x25')](_0x3b23ba));if(_0x3b23ba['error']){if(_0x3b23ba[_0x1c51('0x26')][_0x1c51('0x27')]===0x1f4){logger[_0x1c51('0x26')](_0x1c51('0x23'),_0x4aaf26,_0x3b23ba[_0x1c51('0x26')][_0x1c51('0x28')]);return _0x3897f0(_0x3b23ba['error'][_0x1c51('0x28')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4aaf26,_0x3b23ba['error']['message']);return _0x3431cc(_0x3b23ba[_0x1c51('0x26')]['message']);}else{logger['info'](_0x1c51('0x23'),_0x4aaf26,_0x1c51('0x24'));_0x3431cc(_0x3b23ba[_0x1c51('0x29')][_0x1c51('0x28')]);}})[_0x1c51('0x2a')](function(_0x30ef5c){logger[_0x1c51('0x26')]('FaxMessage,\x20%s,\x20%s',_0x4aaf26,_0x30ef5c);_0x3897f0(_0x30ef5c);});});}function respondWithStatusCode(_0x583bd2,_0x280a01){_0x280a01=_0x280a01||0xcc;return function(_0x436126){if(_0x436126){return _0x583bd2[_0x1c51('0x2b')](_0x280a01);}return _0x583bd2[_0x1c51('0x2c')](_0x280a01)[_0x1c51('0x2d')]();};}function respondWithResult(_0x51e464,_0x178845){_0x178845=_0x178845||0xc8;return function(_0x1121e6){if(_0x1121e6){return _0x51e464[_0x1c51('0x2c')](_0x178845)[_0x1c51('0x2e')](_0x1121e6);}};}function respondWithFilteredResult(_0x17ebb5,_0x524c1d){return function(_0x337073){if(_0x337073){var _0x56f8dd=_0x337073[_0x1c51('0x2f')],_0x3103ca=_0x524c1d['offset'],_0x322687=_0x524c1d[_0x1c51('0x30')]+_0x524c1d[_0x1c51('0x31')],_0x2996d4;if(_0x322687>=_0x56f8dd){_0x322687=_0x56f8dd;_0x2996d4=0xc8;}else{_0x2996d4=0xce;}_0x17ebb5[_0x1c51('0x2c')](_0x2996d4);return _0x17ebb5[_0x1c51('0x32')](_0x1c51('0x33'),_0x3103ca+'-'+_0x322687+'/'+_0x56f8dd)[_0x1c51('0x2e')](_0x337073);}return null;};}function patchUpdates(_0x11dc11){return function(_0x1a1e1b){try{jsonpatch[_0x1c51('0x34')](_0x1a1e1b,_0x11dc11,!![]);}catch(_0x3f3d7e){return BPromise[_0x1c51('0x35')](_0x3f3d7e);}return _0x1a1e1b[_0x1c51('0x36')]();};}function saveUpdates(_0x5b0bbb,_0x45b156){return function(_0x50d260){if(_0x50d260){return _0x50d260[_0x1c51('0x37')](_0x5b0bbb)['then'](function(_0x474f76){return _0x474f76;});}return null;};}function removeEntity(_0x558720,_0x2834e8){return function(_0x6c2ffa){if(_0x6c2ffa){return _0x6c2ffa[_0x1c51('0x38')]()[_0x1c51('0x21')](function(){_0x558720[_0x1c51('0x2c')](0xcc)[_0x1c51('0x2d')]();});}};}function handleEntityNotFound(_0x3804f9,_0x3a084f){return function(_0x1bf2d1){if(!_0x1bf2d1){_0x3804f9['sendStatus'](0x194);}return _0x1bf2d1;};}function handleError(_0x4e0928,_0x4c8fcd){_0x4c8fcd=_0x4c8fcd||0x1f4;return function(_0x142c0b){logger[_0x1c51('0x26')](_0x142c0b['stack']);if(_0x142c0b['name']){delete _0x142c0b[_0x1c51('0x39')];}_0x4e0928['status'](_0x4c8fcd)[_0x1c51('0x3a')](_0x142c0b);};}exports[_0x1c51('0x3b')]=function(_0x4821f8,_0x18bb41){var _0x39ceac={},_0x355206={},_0x4c7ffb={'count':0x0,'rows':[]};var _0x25286e=db[_0x1c51('0x3c')][_0x1c51('0x3d')];_0x355206[_0x1c51('0x3e')]=_[_0x1c51('0x3f')](_0x25286e);_0x355206[_0x1c51('0x40')]=_['keys'](_0x4821f8[_0x1c51('0x40')]);_0x355206[_0x1c51('0x41')]=_[_0x1c51('0x42')](_0x355206['model'],_0x355206[_0x1c51('0x40')]);_0x39ceac[_0x1c51('0x43')]=_[_0x1c51('0x42')](_0x355206[_0x1c51('0x3e')],qs[_0x1c51('0x44')](_0x4821f8[_0x1c51('0x40')]['fields']));_0x39ceac[_0x1c51('0x43')]=_0x39ceac[_0x1c51('0x43')][_0x1c51('0x45')]?_0x39ceac['attributes']:_0x355206[_0x1c51('0x3e')];if(!_0x4821f8['query'][_0x1c51('0x46')]('nolimit')){_0x39ceac[_0x1c51('0x31')]=qs[_0x1c51('0x31')](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x31')]);_0x39ceac[_0x1c51('0x30')]=qs[_0x1c51('0x30')](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x30')]);}_0x39ceac[_0x1c51('0x47')]=qs['sort'](_0x4821f8[_0x1c51('0x40')][_0x1c51('0x48')]);_0x39ceac[_0x1c51('0x49')]=qs[_0x1c51('0x41')](_[_0x1c51('0x4a')](_0x4821f8[_0x1c51('0x40')],_0x355206[_0x1c51('0x41')]));if(_0x4821f8['query'][_0x1c51('0x4b')]){_0x39ceac[_0x1c51('0x49')]=_['merge'](_0x39ceac[_0x1c51('0x49')],{'$or':_[_0x1c51('0x4c')](_0x25286e,function(_0x1566ea){if(_0x1566ea[_0x1c51('0x4d')][_0x1c51('0x4e')]!==_0x1c51('0x4f')){var _0x563ad3={};_0x563ad3[_0x1566ea[_0x1c51('0x50')]]={'$like':'%'+_0x4821f8['query'][_0x1c51('0x4b')]+'%'};return _0x563ad3;}})});}_0x39ceac=_[_0x1c51('0x51')]({},_0x39ceac,_0x4821f8[_0x1c51('0x52')]);var _0x4adab8={'where':_0x39ceac[_0x1c51('0x49')]};return db['FaxMessage'][_0x1c51('0x2f')](_0x4adab8)['then'](function(_0x44398a){_0x4c7ffb[_0x1c51('0x2f')]=_0x44398a;if(_0x4821f8[_0x1c51('0x40')][_0x1c51('0x53')]){_0x39ceac['include']=[{'all':!![]}];}return db[_0x1c51('0x3c')]['findAll'](_0x39ceac);})[_0x1c51('0x21')](function(_0x24e8b3){_0x4c7ffb[_0x1c51('0x54')]=_0x24e8b3;return _0x4c7ffb;})['then'](respondWithFilteredResult(_0x18bb41,_0x39ceac))['catch'](handleError(_0x18bb41,null));};exports[_0x1c51('0x55')]=function(_0x20e240,_0x529928){var _0x28fa81={'raw':!![],'where':{'id':_0x20e240['params']['id']}},_0x4f50a6={};_0x4f50a6[_0x1c51('0x3e')]=_[_0x1c51('0x3f')](db['FaxMessage'][_0x1c51('0x3d')]);_0x4f50a6[_0x1c51('0x40')]=_[_0x1c51('0x3f')](_0x20e240[_0x1c51('0x40')]);_0x4f50a6[_0x1c51('0x41')]=_['intersection'](_0x4f50a6['model'],_0x4f50a6[_0x1c51('0x40')]);_0x28fa81['attributes']=_[_0x1c51('0x42')](_0x4f50a6[_0x1c51('0x3e')],qs['fields'](_0x20e240[_0x1c51('0x40')]['fields']));_0x28fa81[_0x1c51('0x43')]=_0x28fa81['attributes'][_0x1c51('0x45')]?_0x28fa81[_0x1c51('0x43')]:_0x4f50a6[_0x1c51('0x3e')];if(_0x20e240[_0x1c51('0x40')][_0x1c51('0x53')]){_0x28fa81['include']=[{'all':!![]}];}_0x28fa81=_[_0x1c51('0x51')]({},_0x28fa81,_0x20e240[_0x1c51('0x52')]);return db[_0x1c51('0x3c')][_0x1c51('0x56')](_0x28fa81)[_0x1c51('0x21')](handleEntityNotFound(_0x529928,null))[_0x1c51('0x21')](respondWithResult(_0x529928,null))[_0x1c51('0x2a')](handleError(_0x529928,null));};exports[_0x1c51('0x37')]=function(_0x4ebbd4,_0x4b34f8){if(_0x4ebbd4[_0x1c51('0x57')]['id']){delete _0x4ebbd4[_0x1c51('0x57')]['id'];}return db[_0x1c51('0x3c')][_0x1c51('0x56')]({'where':{'id':_0x4ebbd4['params']['id']}})['then'](handleEntityNotFound(_0x4b34f8,null))[_0x1c51('0x21')](saveUpdates(_0x4ebbd4[_0x1c51('0x57')],null))[_0x1c51('0x21')](respondWithResult(_0x4b34f8,null))[_0x1c51('0x2a')](handleError(_0x4b34f8,null));};exports[_0x1c51('0x38')]=function(_0x5877a9,_0x5dc3d9){return db['FaxMessage']['find']({'where':{'id':_0x5877a9[_0x1c51('0x58')]['id']}})[_0x1c51('0x21')](handleEntityNotFound(_0x5dc3d9,null))['then'](removeEntity(_0x5dc3d9,null))['catch'](handleError(_0x5dc3d9,null));};exports[_0x1c51('0x59')]=function(_0x44b5e0,_0x1ffba5){return db['FaxMessage'][_0x1c51('0x59')]()[_0x1c51('0x21')](respondWithResult(_0x1ffba5,null))[_0x1c51('0x2a')](handleError(_0x1ffba5,null));};var interaction_log=require(_0x1c51('0x14'))(_0x1c51('0x5a'));exports[_0x1c51('0x5b')]=function(_0x529197,_0x156d0d,_0x37f8c9){var _0x528a41={'channel':_0x1c51('0x5c')};if(_0x529197['body']['id']){delete _0x529197[_0x1c51('0x57')]['id'];}_0x529197['body'][_0x1c51('0x5d')]=!![];_0x529197[_0x1c51('0x57')][_0x1c51('0x5e')]=moment()[_0x1c51('0x5f')](_0x1c51('0x60'));_0x529197['body'][_0x1c51('0x61')]=_0x529197[_0x1c51('0x57')]['UserId']||_0x529197[_0x1c51('0x62')]['id'];return db[_0x1c51('0x3c')]['find']({'where':{'id':_0x529197[_0x1c51('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x1c51('0x63')],'as':_0x1c51('0x64')}]})[_0x1c51('0x21')](handleEntityNotFound(_0x156d0d,null))[_0x1c51('0x21')](saveUpdates(_0x529197[_0x1c51('0x57')],null))[_0x1c51('0x21')](function(_0x6bfb17){if(_0x6bfb17){_0x528a41[_0x1c51('0x28')]=_0x6bfb17[_0x1c51('0x65')]({'plain':!![]});return db[_0x1c51('0x66')][_0x1c51('0x56')]({'where':{'id':_0x6bfb17[_0x1c51('0x67')]}});}return null;})[_0x1c51('0x21')](handleEntityNotFound(_0x156d0d,null))[_0x1c51('0x21')](function(_0x3fd78c){if(_0x3fd78c){return _0x3fd78c[_0x1c51('0x37')]({'UserId':_0x529197[_0x1c51('0x57')]['UserId'],'read1stAt':_[_0x1c51('0x68')](_0x3fd78c[_0x1c51('0x69')])?moment()[_0x1c51('0x5f')](_0x1c51('0x60')):undefined});}return null;})[_0x1c51('0x21')](function(_0x21d5b4){if(_0x21d5b4){_0x528a41[_0x1c51('0x6a')]=_0x21d5b4['get']({'plain':!![]});interaction_log[_0x1c51('0x22')](_0x1c51('0x6b'),_0x529197[_0x1c51('0x62')]['id'],_0x529197[_0x1c51('0x62')]['name'],_0x529197[_0x1c51('0x62')][_0x1c51('0x6c')],_0x528a41[_0x1c51('0x6a')]['id'],_0x529197[_0x1c51('0x57')]?JSON[_0x1c51('0x25')](_0x529197[_0x1c51('0x57')]):'null');return respondWithRpcPromise(_0x1c51('0x6d'),'acceptMessage',_0x528a41);}return null;})[_0x1c51('0x21')](function(_0x559db4){if(_0x559db4){if(_0x529197[_0x1c51('0x57')]['manual']){_0x528a41[_0x1c51('0x28')]['interface']=util[_0x1c51('0x5f')](_0x1c51('0x6e'),_0x529197[_0x1c51('0x62')][_0x1c51('0x39')]);_0x528a41['message'][_0x1c51('0x6f')]=_0x528a41[_0x1c51('0x6f')];_0x528a41['message'][_0x1c51('0x70')]=_0x1c51('0x5b');return respondWithRpcPromise('EventManager',_0x1c51('0x71'),{'event':_0x1c51('0x72'),'message':_0x528a41[_0x1c51('0x28')]},client9002)[_0x1c51('0x21')](function(){return _0x528a41;});}return _0x528a41;}return null;})[_0x1c51('0x21')](respondWithResult(_0x156d0d,null))[_0x1c51('0x2a')](handleError(_0x156d0d,null));};var interaction_log=require(_0x1c51('0x14'))(_0x1c51('0x5a'));exports[_0x1c51('0x35')]=function(_0x5b351c,_0x1b81f6,_0x3cab16){var _0x3f26ae={'agent':{},'channel':_0x1c51('0x5c')};if(_0x5b351c[_0x1c51('0x57')]['id']){delete _0x5b351c[_0x1c51('0x57')]['id'];}_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')]=_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')]||_0x5b351c[_0x1c51('0x62')]['id'];_0x3f26ae[_0x1c51('0x73')]['id']=_0x5b351c[_0x1c51('0x57')][_0x1c51('0x61')];return db[_0x1c51('0x3c')][_0x1c51('0x56')]({'where':{'id':_0x5b351c[_0x1c51('0x58')]['id'],'UserId':null}})[_0x1c51('0x21')](handleEntityNotFound(_0x1b81f6,null))[_0x1c51('0x21')](function(_0x322c39){if(_0x322c39){_0x3f26ae[_0x1c51('0x28')]=_0x322c39[_0x1c51('0x65')]({'plain':!![]});return db[_0x1c51('0x66')][_0x1c51('0x56')]({'where':{'id':_0x322c39[_0x1c51('0x67')]}});}return null;})[_0x1c51('0x21')](handleEntityNotFound(_0x1b81f6,null))['then'](function(_0x3921a3){if(_0x3921a3){_0x3f26ae[_0x1c51('0x6a')]=_0x3921a3['get']({'plain':!![]});interaction_log['info'](_0x1c51('0x74'),_0x5b351c[_0x1c51('0x62')]['id'],_0x5b351c[_0x1c51('0x62')][_0x1c51('0x39')],_0x5b351c[_0x1c51('0x62')][_0x1c51('0x6c')],_0x3f26ae[_0x1c51('0x6a')]['id'],_0x5b351c[_0x1c51('0x57')]?JSON[_0x1c51('0x25')](_0x5b351c[_0x1c51('0x57')]):_0x1c51('0x75'));return respondWithRpcPromise(_0x1c51('0x76'),_0x1c51('0x77'),_0x3f26ae);}return null;})[_0x1c51('0x21')](function(_0x12fbc7){if(_0x12fbc7){_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x78')]=util['format']('SIP/%s',_0x5b351c[_0x1c51('0x62')]['name']);_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x6f')]=_0x3f26ae['channel'];_0x12fbc7[_0x1c51('0x28')][_0x1c51('0x70')]=_0x1c51('0x35');respondWithRpcPromise(_0x1c51('0x71'),_0x1c51('0x71'),{'event':_0x1c51('0x79'),'message':_0x12fbc7['message']},client9002);return _0x3f26ae;}return null;})['then'](respondWithResult(_0x1b81f6,null))['catch'](handleError(_0x1b81f6,null));};exports['create']=function(_0x2dccfe,_0xa86c83){var _0x4180bb;return db['FaxMessage'][_0x1c51('0x7a')](_0x2dccfe[_0x1c51('0x57')],{})[_0x1c51('0x21')](function(_0x259265){_0x4180bb=_0x259265;return db['CmContact'][_0x1c51('0x7b')]({'where':{'id':_0x4180bb[_0x1c51('0x7c')]}});})['then'](function(_0x42b414){if(_['isNil'](_0x42b414)){return;}else{_0x4180bb['fax']=_0x42b414[_0x1c51('0x5c')];return db['Attachment'][_0x1c51('0x7b')]({'where':{'id':_0x4180bb['AttachmentId']}});}})['then'](function(_0x429882){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x1c51('0x68')](_0x2dccfe[_0x1c51('0x57')])?undefined:_0x2dccfe[_0x1c51('0x57')][_0x1c51('0x7d')],'path':_[_0x1c51('0x68')](_0x429882)?undefined:util[_0x1c51('0x5f')](_0x1c51('0x7e'),_0x429882[_0x1c51('0x7f')]),'fax':_[_0x1c51('0x68')](_0x4180bb[_0x1c51('0x5c')])?undefined:_0x4180bb[_0x1c51('0x5c')],'AttachmentId':_0x4180bb[_0x1c51('0x80')]},client9002);})[_0x1c51('0x21')](respondWithResult(_0xa86c83,0xc9))[_0x1c51('0x2a')](handleError(_0xa86c83,null));};exports[_0x1c51('0x81')]=function(_0x25880d,_0x4bbb19){var _0x5579db=path[_0x1c51('0x82')](config['root'],_0x1c51('0x83'),'files',_0x1c51('0x84'));return db[_0x1c51('0x3c')]['find']({'where':{'id':_0x25880d[_0x1c51('0x58')]['id']},'include':[{'model':db[_0x1c51('0x85')],'as':_0x1c51('0x85')}]})[_0x1c51('0x21')](handleEntityNotFound(_0x4bbb19,null))[_0x1c51('0x21')](function(_0x1aed2b){if(_0x1aed2b){return _0x4bbb19[_0x1c51('0x81')](path[_0x1c51('0x82')](_0x5579db,_0x1aed2b[_0x1c51('0x85')]['basename']));}})[_0x1c51('0x2a')](handleError(_0x4bbb19,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ec574ed..a581a6f 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 _0xd0c8=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','save'];(function(_0x1ba8a2,_0x16bf47){var _0x517541=function(_0x1e01d2){while(--_0x1e01d2){_0x1ba8a2['push'](_0x1ba8a2['shift']());}};_0x517541(++_0x16bf47);}(_0xd0c8,0xcd));var _0x8d0c=function(_0x4ec767,_0x4e55f3){_0x4ec767=_0x4ec767-0x0;var _0x94eb04=_0xd0c8[_0x4ec767];return _0x94eb04;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x8d0c('0x0'))['db'][_0x8d0c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d0c('0x2'),'afterUpdate':_0x8d0c('0x3'),'afterDestroy':_0x8d0c('0x4')};function emitEvent(_0x35ea93){return function(_0xc9143e,_0x10be27,_0xa88e40){FaxMessageEvents['emit'](_0x35ea93+':'+_0xc9143e['id'],_0xc9143e);FaxMessageEvents[_0x8d0c('0x5')](_0x35ea93,_0xc9143e);_0xa88e40(null);};}for(var e in events){if(events[_0x8d0c('0x6')](e)){var event=events[e];FaxMessage[_0x8d0c('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xd7c5=['../../mysqldb','FaxMessage','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xd7c5,0x8f));var _0x5d7c=function(_0xa81c45,_0x1a4550){_0xa81c45=_0xa81c45-0x0;var _0x3d3c9e=_0xd7c5[_0xa81c45];return _0x3d3c9e;};'use strict';var EventEmitter=require(_0x5d7c('0x0'));var FaxMessage=require(_0x5d7c('0x1'))['db'][_0x5d7c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d7c('0x3'),'afterUpdate':'update','afterDestroy':_0x5d7c('0x4')};function emitEvent(_0x1cf5dc){return function(_0x17afee,_0xe5d176,_0x1da620){FaxMessageEvents[_0x5d7c('0x5')](_0x1cf5dc+':'+_0x17afee['id'],_0x17afee);FaxMessageEvents['emit'](_0x1cf5dc,_0x17afee);_0x1da620(null);};}for(var e in events){if(events[_0x5d7c('0x6')](e)){var event=events[e];FaxMessage[_0x5d7c('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e894ac5..e6d3323 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 _0xa82c=['toLowerCase','direction','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get'];(function(_0x931446,_0x61f05a){var _0x5e6e68=function(_0x4fd213){while(--_0x4fd213){_0x931446['push'](_0x931446['shift']());}};_0x5e6e68(++_0x61f05a);}(_0xa82c,0x12a));var _0xca82=function(_0x206fb4,_0x3c8834){_0x206fb4=_0x206fb4-0x0;var _0x28cb32=_0xa82c[_0x206fb4];return _0x28cb32;};'use strict';var _=require('lodash');var util=require(_0xca82('0x0'));var logger=require('../../config/logger')(_0xca82('0x1'));var moment=require(_0xca82('0x2'));var BPromise=require(_0xca82('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca82('0x4'));var config=require(_0xca82('0x5'));var attributes=require(_0xca82('0x6'));module['exports']=function(_0x735ed9,_0x3160c5){return _0x735ed9[_0xca82('0x7')](_0xca82('0x8'),attributes,{'tableName':_0xca82('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xca82('0xa')],'type':_0xca82('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20c39f,_0x196a27,_0x42a055){var _0xe3c9ee=_0x735ed9[_0xca82('0xc')];var _0x287832=_0x20c39f[_0xca82('0xd')]({'plain':!![]});if(_0x287832['direction'][_0xca82('0xe')]()==='in'||_0x287832[_0xca82('0xf')][_0xca82('0xe')]()===_0xca82('0x10')&&!_0x287832[_0xca82('0x11')]&&!_['isNil'](_0x287832[_0xca82('0x12')])){_0xe3c9ee[_0xca82('0x13')][_0xca82('0x14')]({'where':{'id':_0x287832[_0xca82('0x15')]}})[_0xca82('0x16')](function(_0xdb2f21){if(_0xdb2f21){_0xdb2f21['update']({'lastMsgAt':_0x287832['createdAt'],'lastMsgDirection':_0x287832[_0xca82('0xf')]['toLowerCase']()});}})[_0xca82('0x17')](function(_0x422bcf){console[_0xca82('0x18')](_0x422bcf);});}_0x42a055();}},'charset':'utf8mb4','collate':_0xca82('0x19')});}; \ No newline at end of file +var _0x6509=['define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports'];(function(_0x44e923,_0x7ee877){var _0x10ddb4=function(_0x9f2a50){while(--_0x9f2a50){_0x44e923['push'](_0x44e923['shift']());}};_0x10ddb4(++_0x7ee877);}(_0x6509,0x16a));var _0x9650=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0x6509[_0x3b1106];return _0x1fbeef;};'use strict';var _=require(_0x9650('0x0'));var util=require(_0x9650('0x1'));var logger=require(_0x9650('0x2'))(_0x9650('0x3'));var moment=require(_0x9650('0x4'));var BPromise=require('bluebird');var rp=require(_0x9650('0x5'));var fs=require('fs');var path=require(_0x9650('0x6'));var rimraf=require('rimraf');var config=require(_0x9650('0x7'));var attributes=require(_0x9650('0x8'));module[_0x9650('0x9')]=function(_0x171c89,_0x3b053d){return _0x171c89[_0x9650('0xa')](_0x9650('0xb'),attributes,{'tableName':_0x9650('0xc'),'paranoid':![],'indexes':[{'name':_0x9650('0xd'),'fields':[_0x9650('0xe')],'type':_0x9650('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d0a38,_0x2337be,_0x3f5904){var _0x34f82a=_0x171c89[_0x9650('0x10')];var _0x1b5608=_0x5d0a38[_0x9650('0x11')]({'plain':!![]});if(_0x1b5608[_0x9650('0x12')][_0x9650('0x13')]()==='in'||_0x1b5608[_0x9650('0x12')]['toLowerCase']()===_0x9650('0x14')&&!_0x1b5608[_0x9650('0x15')]&&!_[_0x9650('0x16')](_0x1b5608[_0x9650('0x17')])){_0x34f82a['FaxInteraction'][_0x9650('0x18')]({'where':{'id':_0x1b5608[_0x9650('0x19')]}})['then'](function(_0x56031f){if(_0x56031f){_0x56031f[_0x9650('0x1a')]({'lastMsgAt':_0x1b5608['createdAt'],'lastMsgDirection':_0x1b5608['direction']['toLowerCase']()});}})[_0x9650('0x1b')](function(_0xc6e49c){console[_0x9650('0x1c')](_0xc6e49c);});}_0x3f5904();}},'charset':_0x9650('0x1d'),'collate':_0x9650('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 9875d7a..2423f81 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 _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x504fad,_0x556cd0){var _0x2b6826=function(_0xd27774){while(--_0xd27774){_0x504fad['push'](_0x504fad['shift']());}};_0x2b6826(++_0x556cd0);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5737b5,_0x3a8b65){_0x5737b5=_0x5737b5-0x0;var _0x447b01=_0xd6d6[_0x5737b5];return _0x447b01;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file +var _0x7923=['options','raw','debug','UpdateFaxMessage','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7923,0x8f));var _0x3792=function(_0x8c4071,_0x3891cf){_0x8c4071=_0x8c4071-0x0;var _0x184184=_0x7923[_0x8c4071];return _0x184184;};'use strict';var _=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var moment=require(_0x3792('0x2'));var BPromise=require(_0x3792('0x3'));var rs=require(_0x3792('0x4'));var fs=require('fs');var Redis=require(_0x3792('0x5'));var db=require(_0x3792('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3792('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3792('0x8'));var client=jayson['client'][_0x3792('0x9')]({'port':0x232a});config[_0x3792('0xa')]=_[_0x3792('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3792('0xc'))(new Redis(config[_0x3792('0xa')]));require('./faxMessage.socket')[_0x3792('0xd')](socket);function respondWithRpcPromise(_0x39eafb,_0x4c1a32,_0xebb0d0){return new BPromise(function(_0x23e626,_0x216ddd){return client['request'](_0x39eafb,_0xebb0d0)['then'](function(_0x8ed062){logger[_0x3792('0xe')](_0x3792('0xf'),_0x4c1a32,_0x3792('0x10'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4c1a32,_0x3792('0x10'),JSON[_0x3792('0x11')](_0x8ed062));if(_0x8ed062[_0x3792('0x12')]){if(_0x8ed062[_0x3792('0x12')][_0x3792('0x13')]===0x1f4){logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);return _0x216ddd(_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);}logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);return _0x23e626(_0x8ed062[_0x3792('0x12')][_0x3792('0x14')]);}else{logger['info'](_0x3792('0xf'),_0x4c1a32,_0x3792('0x10'));_0x23e626(_0x8ed062[_0x3792('0x15')][_0x3792('0x14')]);}})[_0x3792('0x16')](function(_0x5a9f56){logger[_0x3792('0x12')](_0x3792('0xf'),_0x4c1a32,_0x5a9f56);_0x216ddd(_0x5a9f56);});});}exports[_0x3792('0x17')]=function(_0x3c36b5){var _0x35eee8=this;return new Promise(function(_0x5647ac,_0x4cd50b){return db[_0x3792('0x18')][_0x3792('0x19')](_0x3c36b5[_0x3792('0x1a')],{'raw':_0x3c36b5[_0x3792('0x1b')]?_0x3c36b5[_0x3792('0x1b')][_0x3792('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4ca818){logger[_0x3792('0xe')](_0x3792('0x17'),_0x3c36b5);logger[_0x3792('0x1d')](_0x3792('0x17'),_0x3c36b5,JSON['stringify'](_0x4ca818));_0x5647ac(_0x4ca818);})[_0x3792('0x16')](function(_0x48f41c){logger[_0x3792('0x12')](_0x3792('0x17'),_0x48f41c['message'],_0x3c36b5);_0x4cd50b(_0x35eee8['error'](0x1f4,_0x48f41c[_0x3792('0x14')]));});});};exports[_0x3792('0x1e')]=function(_0x401080){var _0x516929=this;return new Promise(function(_0x54f42a,_0x44499b){return db[_0x3792('0x18')]['update'](_0x401080['body'],{'raw':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x401080[_0x3792('0x1b')]?_0x401080['options']['where']||null:null,'attributes':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x1f')]||null:null,'limit':_0x401080[_0x3792('0x1b')]?_0x401080[_0x3792('0x1b')][_0x3792('0x20')]||null:null})[_0x3792('0x21')](function(_0x44cc37){logger[_0x3792('0xe')]('UpdateFaxMessage',_0x401080);logger[_0x3792('0x1d')](_0x3792('0x1e'),_0x401080,JSON[_0x3792('0x11')](_0x44cc37));_0x54f42a(_0x44cc37);})[_0x3792('0x16')](function(_0x904b3b){logger['error']('UpdateFaxMessage',_0x904b3b['message'],_0x401080);_0x44499b(_0x516929[_0x3792('0x12')](0x1f4,_0x904b3b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b140f32..4be9ecb 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 _0xaeab=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','remove'];(function(_0x41907d,_0x52a638){var _0x1454f9=function(_0x1ea425){while(--_0x1ea425){_0x41907d['push'](_0x41907d['shift']());}};_0x1454f9(++_0x52a638);}(_0xaeab,0x91));var _0xbaea=function(_0xc0905b,_0x58bce2){_0xc0905b=_0xc0905b-0x0;var _0x252b68=_0xaeab[_0xc0905b];return _0x252b68;};'use strict';var FaxMessageEvents=require(_0xbaea('0x0'));var events=['save',_0xbaea('0x1'),'update'];function createListener(_0x2eb81e,_0x236fca){return function(_0x2e3da7){_0x236fca[_0xbaea('0x2')](_0x2eb81e,_0x2e3da7);};}function removeListener(_0x36e839,_0xbe1ff5){return function(){FaxMessageEvents[_0xbaea('0x3')](_0x36e839,_0xbe1ff5);};}exports[_0xbaea('0x4')]=function(_0x1ae44e){for(var _0x1e4331=0x0,_0x5bfed3=events[_0xbaea('0x5')];_0x1e4331<_0x5bfed3;_0x1e4331++){var _0x267afb=events[_0x1e4331];var _0x202d96=createListener(_0xbaea('0x6')+_0x267afb,_0x1ae44e);FaxMessageEvents['on'](_0x267afb,_0x202d96);}}; \ No newline at end of file +var _0xce50=['save','remove','update','register'];(function(_0x5d23a6,_0x10da71){var _0x137b85=function(_0x2fdde3){while(--_0x2fdde3){_0x5d23a6['push'](_0x5d23a6['shift']());}};_0x137b85(++_0x10da71);}(_0xce50,0x1d8));var _0x0ce5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xce50[_0x2dadb9];return _0x2f0097;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0ce5('0x0'),_0x0ce5('0x1'),_0x0ce5('0x2')];function createListener(_0x363236,_0x1eddd3){return function(_0x563b79){_0x1eddd3['emit'](_0x363236,_0x563b79);};}function removeListener(_0x11f9e0,_0x52a2f1){return function(){FaxMessageEvents['removeListener'](_0x11f9e0,_0x52a2f1);};}exports[_0x0ce5('0x3')]=function(_0x42fadd){for(var _0x69892c=0x0,_0x3eb5b2=events['length'];_0x69892c<_0x3eb5b2;_0x69892c++){var _0x32610d=events[_0x69892c];var _0x8d611f=createListener('faxMessage:'+_0x32610d,_0x42fadd);FaxMessageEvents['on'](_0x32610d,_0x8d611f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index c3e2c60..b1776ac 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 _0x1261=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','faxmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','util'];(function(_0x5935e6,_0x4a2b41){var _0x3aba85=function(_0x346199){while(--_0x346199){_0x5935e6['push'](_0x5935e6['shift']());}};_0x3aba85(++_0x4a2b41);}(_0x1261,0x144));var _0x1126=function(_0x4c9cc4,_0x1b6528){_0x4c9cc4=_0x4c9cc4-0x0;var _0x4384fb=_0x1261[_0x4c9cc4];return _0x4384fb;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['get'](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router['post']('/',auth[_0x1126('0xd')](),interaction['tracked']('fax',_0x1126('0x11')),controller['create']);router[_0x1126('0x12')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0x13')]);router[_0x1126('0x12')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x15')]);router[_0x1126('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x1126('0x16')]);router[_0x1126('0x17')](_0x1126('0xc'),auth['isAuthenticated'](),controller[_0x1126('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4fb4=['../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x4fb4,0x190));var _0x44fb=function(_0x596d42,_0x3156c8){_0x596d42=_0x596d42-0x0;var _0x55b49c=_0x4fb4[_0x596d42];return _0x55b49c;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var auth=require(_0x44fb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44fb('0x6'));var controller=require(_0x44fb('0x7'));router[_0x44fb('0x8')]('/',auth[_0x44fb('0x9')](),controller[_0x44fb('0xa')]);router[_0x44fb('0x8')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller['describe']);router[_0x44fb('0x8')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x8')](_0x44fb('0xe'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xf')]);router[_0x44fb('0x10')]('/',auth[_0x44fb('0x9')](),interaction[_0x44fb('0x11')](_0x44fb('0x12'),_0x44fb('0x13')),controller['create']);router[_0x44fb('0x14')](_0x44fb('0xc'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x15')]);router[_0x44fb('0x14')]('/:id/accept',auth[_0x44fb('0x9')](),controller[_0x44fb('0x16')]);router[_0x44fb('0x14')](_0x44fb('0x17'),auth[_0x44fb('0x9')](),controller['reject']);router[_0x44fb('0x18')](_0x44fb('0xc'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x19')]);module[_0x44fb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 4b750ab..a232b37 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 _0x48b0=['exports','STRING','rrmemory','roundrobin','INTEGER','sequelize'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x48b0,0x9b));var _0x048b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x48b0[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x048b('0x0'));module[_0x048b('0x1')]={'name':{'type':Sequelize[_0x048b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x048b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x048b('0x3'),'beepall',_0x048b('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x048b('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1297=['exports','STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize'];(function(_0x121985,_0x252db3){var _0x20bc79=function(_0x30889b){while(--_0x30889b){_0x121985['push'](_0x121985['shift']());}};_0x20bc79(++_0x252db3);}(_0x1297,0x157));var _0x7129=function(_0x3fd782,_0x4540ad){_0x3fd782=_0x3fd782-0x0;var _0x57008f=_0x1297[_0x3fd782];return _0x57008f;};'use strict';var Sequelize=require(_0x7129('0x0'));module[_0x7129('0x1')]={'name':{'type':Sequelize[_0x7129('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7129('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7129('0x3')](_0x7129('0x4'),_0x7129('0x5'),_0x7129('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7129('0x7')],'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 f3c12c4..963cff2 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 _0x3c70=['bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxQueue.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','options','count','includeAll','include','findAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','nolimit','pick','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','SIP','findOne','getTeams','teams','Team','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','emit','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x5dd74f,_0x588c9d){var _0x4d4643=function(_0x2a7c29){while(--_0x2a7c29){_0x5dd74f['push'](_0x5dd74f['shift']());}};_0x4d4643(++_0x588c9d);}(_0x3c70,0x10c));var _0x03c7=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3c70[_0x43d11d];return _0x38cd08;};'use strict';var pdf=require(_0x03c7('0x0'));var emlformat=require(_0x03c7('0x1'));var rimraf=require(_0x03c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03c7('0x3'));var rp=require(_0x03c7('0x4'));var moment=require(_0x03c7('0x5'));var BPromise=require(_0x03c7('0x6'));var Mustache=require(_0x03c7('0x7'));var util=require(_0x03c7('0x8'));var path=require('path');var sox=require(_0x03c7('0x9'));var csv=require('to-csv');var ejs=require(_0x03c7('0xa'));var fs=require('fs');var _=require(_0x03c7('0xb'));var squel=require(_0x03c7('0xc'));var crypto=require('crypto');var jsforce=require(_0x03c7('0xd'));var deskjs=require(_0x03c7('0xe'));var toCsv=require(_0x03c7('0xf'));var querystring=require('querystring');var Papa=require(_0x03c7('0x10'));var Redis=require('ioredis');var authService=require(_0x03c7('0x11'));var qs=require(_0x03c7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03c7('0x13'))(_0x03c7('0x14'));var utils=require(_0x03c7('0x15'));var config=require(_0x03c7('0x16'));var db=require(_0x03c7('0x17'))['db'];config['redis']=_['defaults'](config[_0x03c7('0x18')],{'host':_0x03c7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03c7('0x18')]));require(_0x03c7('0x1a'))[_0x03c7('0x1b')](socket);function respondWithStatusCode(_0x2c57af,_0x1d9668){_0x1d9668=_0x1d9668||0xcc;return function(_0x5adce3){if(_0x5adce3){return _0x2c57af[_0x03c7('0x1c')](_0x1d9668);}return _0x2c57af['status'](_0x1d9668)[_0x03c7('0x1d')]();};}function respondWithResult(_0x1ae657,_0x4e3ff5){_0x4e3ff5=_0x4e3ff5||0xc8;return function(_0x9a3264){if(_0x9a3264){return _0x1ae657[_0x03c7('0x1e')](_0x4e3ff5)[_0x03c7('0x1f')](_0x9a3264);}};}function respondWithFilteredResult(_0x5e8b01,_0x1d7562){return function(_0x6c852d){if(_0x6c852d){var _0xdb6482=_0x6c852d['count'],_0xdb40cc=_0x1d7562['offset'],_0x37118f=_0x1d7562[_0x03c7('0x20')]+_0x1d7562[_0x03c7('0x21')],_0x2946d7;if(_0x37118f>=_0xdb6482){_0x37118f=_0xdb6482;_0x2946d7=0xc8;}else{_0x2946d7=0xce;}_0x5e8b01[_0x03c7('0x1e')](_0x2946d7);return _0x5e8b01[_0x03c7('0x22')](_0x03c7('0x23'),_0xdb40cc+'-'+_0x37118f+'/'+_0xdb6482)['json'](_0x6c852d);}return null;};}function patchUpdates(_0x1e3de1){return function(_0x1e6fae){try{jsonpatch['apply'](_0x1e6fae,_0x1e3de1,!![]);}catch(_0x4e8062){return BPromise['reject'](_0x4e8062);}return _0x1e6fae[_0x03c7('0x24')]();};}function saveUpdates(_0x734b3b,_0x3a5da2){return function(_0x50b316){if(_0x50b316){return _0x50b316[_0x03c7('0x25')](_0x734b3b)[_0x03c7('0x26')](function(_0x3c960a){return _0x3c960a;});}return null;};}function removeEntity(_0x4d6a9c,_0xfa2d9e){return function(_0x4795e7){if(_0x4795e7){return _0x4795e7[_0x03c7('0x27')]()['then'](function(){var _0x2e7403=_0x4795e7['get']({'plain':!![]});var _0x270ee3=_0x03c7('0x28');return db[_0x03c7('0x29')]['destroy']({'where':{'type':_0x270ee3,'resourceId':_0x2e7403['id']}})[_0x03c7('0x26')](function(){return _0x4795e7;});})[_0x03c7('0x26')](function(){_0x4d6a9c[_0x03c7('0x1e')](0xcc)[_0x03c7('0x1d')]();});}};}function handleEntityNotFound(_0x5041fe,_0x5773e2){return function(_0x270b9a){if(!_0x270b9a){_0x5041fe['sendStatus'](0x194);}return _0x270b9a;};}function handleError(_0x182f72,_0x118491){_0x118491=_0x118491||0x1f4;return function(_0x51929b){logger[_0x03c7('0x2a')](_0x51929b[_0x03c7('0x2b')]);if(_0x51929b[_0x03c7('0x2c')]){delete _0x51929b[_0x03c7('0x2c')];}_0x182f72[_0x03c7('0x1e')](_0x118491)[_0x03c7('0x2d')](_0x51929b);};}exports[_0x03c7('0x2e')]=function(_0x2ab3bb,_0x306699){var _0x464f7e={},_0x199944={},_0x4de5f4={'count':0x0,'rows':[]};var _0x19c3ff=db[_0x03c7('0x2f')][_0x03c7('0x30')];_0x199944['model']=_['keys'](_0x19c3ff);_0x199944['query']=_[_0x03c7('0x31')](_0x2ab3bb['query']);_0x199944[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x199944[_0x03c7('0x34')],_0x199944['query']);_0x464f7e[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x199944[_0x03c7('0x34')],qs['fields'](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x37')]));_0x464f7e['attributes']=_0x464f7e[_0x03c7('0x35')][_0x03c7('0x38')]?_0x464f7e['attributes']:_0x199944[_0x03c7('0x34')];if(!_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x39')]('nolimit')){_0x464f7e[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x21')]);_0x464f7e['offset']=qs[_0x03c7('0x20')](_0x2ab3bb['query'][_0x03c7('0x20')]);}_0x464f7e[_0x03c7('0x3a')]=qs[_0x03c7('0x3b')](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x3b')]);_0x464f7e[_0x03c7('0x3c')]=qs['filters'](_['pick'](_0x2ab3bb[_0x03c7('0x36')],_0x199944[_0x03c7('0x32')]));if(_0x2ab3bb['query'][_0x03c7('0x3d')]){_0x464f7e[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x464f7e[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x19c3ff,function(_0x19da08){if(_0x19da08[_0x03c7('0x40')]['key']!=='VIRTUAL'){var _0x1c6256={};_0x1c6256[_0x19da08['field']]={'$like':'%'+_0x2ab3bb['query'][_0x03c7('0x3d')]+'%'};return _0x1c6256;}})});}_0x464f7e=_[_0x03c7('0x3e')]({},_0x464f7e,_0x2ab3bb[_0x03c7('0x41')]);var _0x525d0={'where':_0x464f7e['where']};return db[_0x03c7('0x2f')]['count'](_0x525d0)[_0x03c7('0x26')](function(_0x288fdd){_0x4de5f4[_0x03c7('0x42')]=_0x288fdd;if(_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x43')]){_0x464f7e[_0x03c7('0x44')]=[{'all':!![]}];}return db[_0x03c7('0x2f')][_0x03c7('0x45')](_0x464f7e);})[_0x03c7('0x26')](function(_0x4c2001){_0x4de5f4['rows']=_0x4c2001;return _0x4de5f4;})[_0x03c7('0x26')](respondWithFilteredResult(_0x306699,_0x464f7e))['catch'](handleError(_0x306699,null));};exports['show']=function(_0x129bbe,_0x31cca4){var _0x103174={'raw':!![],'where':{'id':_0x129bbe['params']['id']}},_0x13ca1d={};_0x13ca1d[_0x03c7('0x34')]=_[_0x03c7('0x31')](db[_0x03c7('0x2f')]['rawAttributes']);_0x13ca1d[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x129bbe[_0x03c7('0x36')]);_0x13ca1d[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x13ca1d['model'],_0x13ca1d['query']);_0x103174[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x13ca1d[_0x03c7('0x34')],qs['fields'](_0x129bbe[_0x03c7('0x36')]['fields']));_0x103174[_0x03c7('0x35')]=_0x103174[_0x03c7('0x35')][_0x03c7('0x38')]?_0x103174['attributes']:_0x13ca1d[_0x03c7('0x34')];if(_0x129bbe[_0x03c7('0x36')][_0x03c7('0x43')]){_0x103174[_0x03c7('0x44')]=[{'all':!![]}];}_0x103174=_[_0x03c7('0x3e')]({},_0x103174,_0x129bbe['options']);return db[_0x03c7('0x2f')][_0x03c7('0x46')](_0x103174)[_0x03c7('0x26')](handleEntityNotFound(_0x31cca4,null))[_0x03c7('0x26')](respondWithResult(_0x31cca4,null))[_0x03c7('0x47')](handleError(_0x31cca4,null));};exports['create']=function(_0x45a0f2,_0x31eb6c){return db[_0x03c7('0x2f')][_0x03c7('0x48')](_0x45a0f2[_0x03c7('0x49')],{})[_0x03c7('0x26')](function(_0xc17546){var _0x3d1f32=_0x45a0f2[_0x03c7('0x4a')][_0x03c7('0x4b')]({'plain':!![]});if(!_0x3d1f32)throw new Error(_0x03c7('0x4c'));if(_0x3d1f32[_0x03c7('0x4d')]===_0x03c7('0x4a')){var _0x133007=_0xc17546[_0x03c7('0x4b')]({'plain':!![]});var _0x578303='FaxQueues';return db[_0x03c7('0x4e')][_0x03c7('0x46')]({'where':{'name':_0x578303,'userProfileId':_0x3d1f32[_0x03c7('0x4f')]},'raw':!![]})['then'](function(_0x20825a){if(_0x20825a&&_0x20825a[_0x03c7('0x50')]===0x0){return db[_0x03c7('0x29')][_0x03c7('0x48')]({'name':_0x133007[_0x03c7('0x2c')],'resourceId':_0x133007['id'],'type':_0x20825a[_0x03c7('0x2c')],'sectionId':_0x20825a['id']},{})[_0x03c7('0x26')](function(){return _0xc17546;});}else{return _0xc17546;}})[_0x03c7('0x47')](function(_0x30ebcb){logger[_0x03c7('0x2a')](_0x03c7('0x51'),_0x30ebcb);throw _0x30ebcb;});}return _0xc17546;})['then'](respondWithResult(_0x31eb6c,0xc9))['catch'](handleError(_0x31eb6c,null));};exports[_0x03c7('0x25')]=function(_0x376991,_0x46c805){if(_0x376991[_0x03c7('0x49')]['id']){delete _0x376991[_0x03c7('0x49')]['id'];}return db['FaxQueue'][_0x03c7('0x46')]({'where':{'id':_0x376991[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x46c805,null))['then'](saveUpdates(_0x376991['body'],null))[_0x03c7('0x26')](respondWithResult(_0x46c805,null))[_0x03c7('0x47')](handleError(_0x46c805,null));};exports['destroy']=function(_0x19d5aa,_0x5049bb){return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x19d5aa[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x5049bb,null))[_0x03c7('0x26')](removeEntity(_0x5049bb,null))[_0x03c7('0x47')](handleError(_0x5049bb,null));};exports[_0x03c7('0x53')]=function(_0x400e91,_0x5f2fcb){return db[_0x03c7('0x2f')][_0x03c7('0x53')]()['then'](respondWithResult(_0x5f2fcb,null))['catch'](handleError(_0x5f2fcb,null));};exports[_0x03c7('0x54')]=function(_0x558663,_0x4d546b,_0x2f505f){var _0xdbd64c={'raw':!![],'where':{}},_0x5b3624={},_0x49558a;return db[_0x03c7('0x2f')]['findOne']({'where':{'id':_0x558663[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d546b,null))['then'](function(_0x2e48d1){if(_0x2e48d1){_0x49558a=_0x2e48d1['get']({'plain':!![]});_0x5b3624[_0x03c7('0x34')]=_[_0x03c7('0x31')](db[_0x03c7('0x55')][_0x03c7('0x30')]);_0x5b3624[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x558663[_0x03c7('0x36')]);_0x5b3624[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x5b3624[_0x03c7('0x34')],_0x5b3624[_0x03c7('0x36')]);_0xdbd64c[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x5b3624[_0x03c7('0x34')],qs[_0x03c7('0x37')](_0x558663[_0x03c7('0x36')][_0x03c7('0x37')]));_0xdbd64c['attributes']=_0xdbd64c[_0x03c7('0x35')][_0x03c7('0x38')]?_0xdbd64c[_0x03c7('0x35')]:_0x5b3624['model'];if(!_0x558663[_0x03c7('0x36')]['hasOwnProperty'](_0x03c7('0x56'))){_0xdbd64c['limit']=qs[_0x03c7('0x21')](_0x558663[_0x03c7('0x36')][_0x03c7('0x21')]);_0xdbd64c[_0x03c7('0x20')]=qs['offset'](_0x558663['query'][_0x03c7('0x20')]);}_0xdbd64c['order']=qs[_0x03c7('0x3b')](_0x558663['query'][_0x03c7('0x3b')]);_0xdbd64c['where']=qs[_0x03c7('0x32')](_[_0x03c7('0x57')](_0x558663[_0x03c7('0x36')],_0x5b3624[_0x03c7('0x32')]));_0xdbd64c[_0x03c7('0x3c')]['FaxQueueId']=_0x2e48d1['id'];if(_0x558663[_0x03c7('0x36')][_0x03c7('0x3d')]){_0xdbd64c[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0xdbd64c[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0xdbd64c[_0x03c7('0x35')],function(_0x3364a7){var _0x2ec2cb={};_0x2ec2cb[_0x3364a7]={'$like':'%'+_0x558663[_0x03c7('0x36')][_0x03c7('0x3d')]+'%'};return _0x2ec2cb;})});}_0xdbd64c=_[_0x03c7('0x3e')]({},_0xdbd64c,_0x558663[_0x03c7('0x41')]);return db['UserFaxQueue'][_0x03c7('0x45')](_0xdbd64c);}})[_0x03c7('0x26')](function(_0x3ca756){if(_0x3ca756){return db[_0x03c7('0x58')][_0x03c7('0x59')]({'where':{'id':_[_0x03c7('0x3f')](_0x3ca756,_0x03c7('0x5a')),'role':_0x03c7('0x5b')},'attributes':['id',_0x03c7('0x2c'),_0x03c7('0x5c'),_0x03c7('0x5d'),_0x03c7('0x5e')]});}})['then'](function(_0x41c2c4){if(_0x41c2c4){return{'count':_0x41c2c4[_0x03c7('0x42')],'rows':_[_0x03c7('0x3f')](_0x41c2c4[_0x03c7('0x5f')],function(_0x5e9238){return{'membername':_0x5e9238['name'],'UserId':_0x5e9238['id'],'queue_name':_0x49558a[_0x03c7('0x2c')],'FaxQueueId':_0x49558a['id'],'interface':util['format']('%s/%s',_0x03c7('0x60'),_0x5e9238['name']),'penalty':0x0,'paused':_0x5e9238[_0x03c7('0x5c')],'createdAt':_0x5e9238['createdAt'],'updatedAt':_0x5e9238[_0x03c7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x03c7('0x26')](respondWithFilteredResult(_0x4d546b,_0xdbd64c))['catch'](handleError(_0x4d546b,null));};exports['getTeams']=function(_0x5c5113,_0x42b62e,_0x3eb0c6){var _0x48d57c={};var _0x2ce44e={};var _0x1609a6;var _0x793d43;return db[_0x03c7('0x2f')][_0x03c7('0x61')]({'where':{'id':_0x5c5113['params']['id']}})['then'](handleEntityNotFound(_0x42b62e,null))[_0x03c7('0x26')](function(_0x5557f3){if(_0x5557f3){_0x1609a6=_0x5557f3;_0x2ce44e[_0x03c7('0x34')]=_[_0x03c7('0x31')](db['Team']['rawAttributes']);_0x2ce44e[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x5c5113[_0x03c7('0x36')]);_0x2ce44e[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x2ce44e[_0x03c7('0x34')],_0x2ce44e[_0x03c7('0x36')]);_0x48d57c['attributes']=_[_0x03c7('0x33')](_0x2ce44e[_0x03c7('0x34')],qs['fields'](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x37')]));_0x48d57c[_0x03c7('0x35')]=_0x48d57c[_0x03c7('0x35')][_0x03c7('0x38')]?_0x48d57c[_0x03c7('0x35')]:_0x2ce44e[_0x03c7('0x34')];_0x48d57c['order']=qs[_0x03c7('0x3b')](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x3b')]);_0x48d57c[_0x03c7('0x3c')]=qs['filters'](_['pick'](_0x5c5113[_0x03c7('0x36')],_0x2ce44e[_0x03c7('0x32')]));if(_0x5c5113['query'][_0x03c7('0x3d')]){_0x48d57c[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x48d57c[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x48d57c[_0x03c7('0x35')],function(_0x2ad246){var _0x10de41={};_0x10de41[_0x2ad246]={'$like':'%'+_0x5c5113[_0x03c7('0x36')][_0x03c7('0x3d')]+'%'};return _0x10de41;})});}_0x48d57c=_[_0x03c7('0x3e')]({},_0x48d57c,_0x5c5113[_0x03c7('0x41')]);return _0x1609a6[_0x03c7('0x62')](_0x48d57c);}})['then'](function(_0x30a745){if(_0x30a745){_0x793d43=_0x30a745['length'];if(!_0x5c5113[_0x03c7('0x36')][_0x03c7('0x39')]('nolimit')){_0x48d57c[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x21')]);_0x48d57c['offset']=qs[_0x03c7('0x20')](_0x5c5113['query'][_0x03c7('0x20')]);}return _0x1609a6['getTeams'](_0x48d57c);}})[_0x03c7('0x26')](function(_0x334f4a){if(_0x334f4a){return _0x334f4a?{'count':_0x793d43,'rows':_0x334f4a}:null;}})[_0x03c7('0x26')](respondWithResult(_0x42b62e,null))[_0x03c7('0x47')](handleError(_0x42b62e,null));};exports['addTeams']=function(_0x5bc146,_0x21d2b2,_0x51ff9f){var _0x337f5a=_0x5bc146[_0x03c7('0x49')][_0x03c7('0x63')];return db[_0x03c7('0x64')][_0x03c7('0x45')]({'where':{'id':_[_0x03c7('0x3f')](_0x337f5a,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x03c7('0x65'),'attributes':['id','name','online',_0x03c7('0x66'),'interface'],'raw':!![]}]})[_0x03c7('0x26')](function(_0x461920){if(_0x461920){var _0x32f5fa=_[_0x03c7('0x67')](_0x461920,function(_0x57b6e2){var _0x4fd1e3=_0x57b6e2[_0x03c7('0x4b')]({'plain':!![]});return _0x4fd1e3['Agents'];});return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x5bc146['params']['id']}})[_0x03c7('0x26')](function(_0x597c17){return db[_0x03c7('0x68')][_0x03c7('0x69')](function(_0x4f5dae){return _0x597c17[_0x03c7('0x6a')](_['map'](_0x337f5a,'id'),{'transaction':_0x4f5dae})[_0x03c7('0x26')](function(){return BPromise[_0x03c7('0x6b')](_0x32f5fa,function(_0x3ee34c){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3ee34c['id'],'FaxQueueId':_0x5bc146[_0x03c7('0x52')]['id']},'transaction':_0x4f5dae});});})[_0x03c7('0x26')](function(){_0x32f5fa['forEach'](function(_0x4c38ce){socket[_0x03c7('0x6c')]('userFaxQueue:save',{'UserId':_0x4c38ce['id'],'FaxQueueId':_0x597c17['id']});});});});});}})['then'](respondWithStatusCode(_0x21d2b2,null))[_0x03c7('0x47')](handleError(_0x21d2b2,null));};exports[_0x03c7('0x6d')]=function(_0x3c6f6c,_0x342fb8,_0x2c11ce){return db[_0x03c7('0x64')][_0x03c7('0x45')]({'where':{'id':_0x3c6f6c[_0x03c7('0x36')][_0x03c7('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x03c7('0x65'),'attributes':['id'],'raw':!![]}]})[_0x03c7('0x26')](handleEntityNotFound(_0x342fb8,null))[_0x03c7('0x26')](function(_0x3244e8){var _0x2d7e71=_[_0x03c7('0x3f')](_0x3244e8,'id');var _0x1a29e8=[];var _0x50c130=[];var _0x77614b=squel[_0x03c7('0x6f')]();_0x77614b['field'](_0x03c7('0x70'))['from'](_0x03c7('0x71'),'tq')['join'](_0x03c7('0x72'),'ut',_0x03c7('0x73'))['where'](_0x03c7('0x74'),_0x3c6f6c[_0x03c7('0x52')]['id']);for(var _0x30e959=0x0;_0x30e959<_0x3244e8[_0x03c7('0x38')];_0x30e959+=0x1){let _0xa575d=_0x3244e8[_0x30e959];for(var _0x14e9ee=0x0;_0x14e9ee<_0xa575d['Agents']['length'];_0x14e9ee+=0x1){let _0x72d871=_0xa575d['Agents'][_0x14e9ee];var _0x25ea6c=_0x77614b['clone']();_0x25ea6c[_0x03c7('0x3c')]('ut.UserId\x20=\x20?',_0x72d871['id']);_0x50c130[_0x03c7('0x75')](db[_0x03c7('0x68')][_0x03c7('0x36')](_0x25ea6c[_0x03c7('0x76')](),{'type':db[_0x03c7('0x68')][_0x03c7('0x77')][_0x03c7('0x78')]})[_0x03c7('0x26')](function(_0x35c506){if(_0x35c506['length']===0x1){return _0x72d871['id'];}else{var _0x572b4e=_[_0x03c7('0x79')](_[_0x03c7('0x3f')](_0x35c506,_0x03c7('0x7a')),function(_0x375536){return _[_0x03c7('0x7b')](_0x2d7e71,_0x375536);});if(_0x572b4e){return _0x72d871['id'];}}}));}}return BPromise[_0x03c7('0x7c')](_0x50c130)[_0x03c7('0x26')](function(_0x4540fc){_0x1a29e8=_(_0x1a29e8)[_0x03c7('0x7d')](_0x4540fc)[_0x03c7('0x7e')]()['value']();return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x3c6f6c[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](function(_0x467402){return db['sequelize'][_0x03c7('0x69')](function(_0x1a17cf){return _0x467402[_0x03c7('0x6d')](_0x3c6f6c['query'][_0x03c7('0x6e')],{'transaction':_0x1a17cf})[_0x03c7('0x26')](function(){if(!_[_0x03c7('0x7f')](_0x1a29e8)){return _0x467402['removeAgents'](_0x1a29e8,{'transaction':_0x1a17cf});}})['then'](function(){_0x1a29e8[_0x03c7('0x80')](function(_0x1a18ec){socket['emit'](_0x03c7('0x81'),{'UserId':_0x1a18ec,'FaxQueueId':_0x467402['id']});});});});});});})[_0x03c7('0x26')](respondWithStatusCode(_0x342fb8,null))[_0x03c7('0x47')](handleError(_0x342fb8,null));};exports[_0x03c7('0x82')]=function(_0x898fef,_0x18d4a6,_0x3d8413){return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x898fef[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x18d4a6,null))[_0x03c7('0x26')](function(_0x111047){if(_0x111047){return _0x111047[_0x03c7('0x82')](_0x898fef['body']['ids'],_[_0x03c7('0x83')](_0x898fef['body'],[_0x03c7('0x6e'),'id'])||{})[_0x03c7('0x84')](function(_0x52928f){for(var _0x2adc36=0x0;_0x2adc36<_0x898fef['body']['ids'][_0x03c7('0x38')];_0x2adc36+=0x1){socket[_0x03c7('0x6c')](_0x03c7('0x85'),{'UserId':_0x898fef[_0x03c7('0x49')]['ids'][_0x2adc36],'FaxQueueId':_0x898fef[_0x03c7('0x52')]['id']});}return _0x52928f;});}})[_0x03c7('0x26')](respondWithResult(_0x18d4a6,null))[_0x03c7('0x47')](handleError(_0x18d4a6,null));};exports[_0x03c7('0x86')]=function(_0x29d472,_0x31c4e0,_0x7f1782){return db['FaxQueue'][_0x03c7('0x46')]({'where':{'id':_0x29d472[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x31c4e0,null))[_0x03c7('0x26')](function(_0x51b6c1){if(_0x51b6c1){return _0x51b6c1['removeAgents'](_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')])[_0x03c7('0x26')](function(){if(_[_0x03c7('0x87')](_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')])){for(var _0x122762=0x0;_0x122762<_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')][_0x03c7('0x38')];_0x122762+=0x1){socket[_0x03c7('0x6c')](_0x03c7('0x81'),{'UserId':Number(_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')][_0x122762]),'FaxQueueId':Number(_0x29d472[_0x03c7('0x52')]['id'])});}}else{socket[_0x03c7('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0x29d472['query'][_0x03c7('0x6e')]),'FaxQueueId':Number(_0x29d472[_0x03c7('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x31c4e0,null))[_0x03c7('0x47')](handleError(_0x31c4e0,null));};exports[_0x03c7('0x88')]=function(_0xea9153,_0x18b389,_0x2b2d48){var _0x4dede6={};var _0x214fac={};var _0x3f0f28;var _0x9244e4;return db[_0x03c7('0x2f')][_0x03c7('0x61')]({'where':{'id':_0xea9153[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x18b389,null))[_0x03c7('0x26')](function(_0x210f80){if(_0x210f80){_0x3f0f28=_0x210f80;_0x214fac[_0x03c7('0x34')]=_[_0x03c7('0x31')](db['User'][_0x03c7('0x30')]);_0x214fac[_0x03c7('0x36')]=_['keys'](_0xea9153[_0x03c7('0x36')]);_0x214fac['filters']=_['intersection'](_0x214fac[_0x03c7('0x34')],_0x214fac[_0x03c7('0x36')]);_0x4dede6[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x214fac[_0x03c7('0x34')],qs['fields'](_0xea9153[_0x03c7('0x36')]['fields']));_0x4dede6['attributes']=_0x4dede6[_0x03c7('0x35')]['length']?_0x4dede6[_0x03c7('0x35')]:_0x214fac['model'];_0x4dede6[_0x03c7('0x3a')]=qs[_0x03c7('0x3b')](_0xea9153[_0x03c7('0x36')]['sort']);_0x4dede6['where']=qs[_0x03c7('0x32')](_['pick'](_0xea9153[_0x03c7('0x36')],_0x214fac[_0x03c7('0x32')]));if(_0xea9153[_0x03c7('0x36')][_0x03c7('0x3d')]){_0x4dede6[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x4dede6[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x4dede6[_0x03c7('0x35')],function(_0x445300){var _0x3ee5bb={};_0x3ee5bb[_0x445300]={'$like':'%'+_0xea9153['query']['filter']+'%'};return _0x3ee5bb;})});}_0x4dede6=_[_0x03c7('0x3e')]({},_0x4dede6,_0xea9153[_0x03c7('0x41')]);return _0x3f0f28[_0x03c7('0x88')](_0x4dede6);}})[_0x03c7('0x26')](function(_0x47f104){if(_0x47f104){_0x9244e4=_0x47f104['length'];if(!_0xea9153[_0x03c7('0x36')]['hasOwnProperty'](_0x03c7('0x56'))){_0x4dede6[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0xea9153['query']['limit']);_0x4dede6[_0x03c7('0x20')]=qs[_0x03c7('0x20')](_0xea9153['query'][_0x03c7('0x20')]);}return _0x3f0f28[_0x03c7('0x88')](_0x4dede6);}})[_0x03c7('0x26')](function(_0x2edc18){if(_0x2edc18){return _0x2edc18?{'count':_0x9244e4,'rows':_0x2edc18}:null;}})[_0x03c7('0x26')](respondWithResult(_0x18b389,null))[_0x03c7('0x47')](handleError(_0x18b389,null));}; \ No newline at end of file +var _0xc03e=['count','findAll','catch','show','params','fields','include','merge','options','create','body','user','get','role','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','order','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','rows','createdAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','isEmpty','omit','userFaxQueue:save','removeAgents','isArray','userFaxQueue:remove','getAgents','findOne','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','FaxQueues','UserProfileResource','destroy','stack','name','send','index','FaxQueue','rawAttributes','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field'];(function(_0x51d92a,_0x49d811){var _0x1236b0=function(_0x46c098){while(--_0x46c098){_0x51d92a['push'](_0x51d92a['shift']());}};_0x1236b0(++_0x49d811);}(_0xc03e,0x15a));var _0xec03=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xc03e[_0xcfeff4];return _0xb2fadc;};'use strict';var pdf=require(_0xec03('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xec03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var Mustache=require(_0xec03('0x4'));var util=require(_0xec03('0x5'));var path=require(_0xec03('0x6'));var sox=require(_0xec03('0x7'));var csv=require(_0xec03('0x8'));var ejs=require(_0xec03('0x9'));var fs=require('fs');var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x8'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var hardwareService=require(_0xec03('0x12'));var logger=require(_0xec03('0x13'))(_0xec03('0x14'));var utils=require(_0xec03('0x15'));var config=require(_0xec03('0x16'));var db=require('../../mysqldb')['db'];config[_0xec03('0x17')]=_[_0xec03('0x18')](config[_0xec03('0x17')],{'host':_0xec03('0x19'),'port':0x18eb});var socket=require(_0xec03('0x1a'))(new Redis(config[_0xec03('0x17')]));require(_0xec03('0x1b'))[_0xec03('0x1c')](socket);function respondWithStatusCode(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xcc;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1d')](_0x555447);}return _0x4ba43a[_0xec03('0x1e')](_0x555447)[_0xec03('0x1f')]();};}function respondWithResult(_0x515680,_0x28bb4f){_0x28bb4f=_0x28bb4f||0xc8;return function(_0xbe85e6){if(_0xbe85e6){return _0x515680[_0xec03('0x1e')](_0x28bb4f)[_0xec03('0x20')](_0xbe85e6);}};}function respondWithFilteredResult(_0x5c2f1a,_0x1fae17){return function(_0x52f6ae){if(_0x52f6ae){var _0x46a669=_0x52f6ae['count'],_0x5e8ae2=_0x1fae17[_0xec03('0x21')],_0x25292d=_0x1fae17[_0xec03('0x21')]+_0x1fae17[_0xec03('0x22')],_0x5b3e04;if(_0x25292d>=_0x46a669){_0x25292d=_0x46a669;_0x5b3e04=0xc8;}else{_0x5b3e04=0xce;}_0x5c2f1a[_0xec03('0x1e')](_0x5b3e04);return _0x5c2f1a['set'](_0xec03('0x23'),_0x5e8ae2+'-'+_0x25292d+'/'+_0x46a669)['json'](_0x52f6ae);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x24')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x25')](_0x33a167);}return _0x253910[_0xec03('0x26')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x27')](_0x3a44df)[_0xec03('0x28')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x28')](function(){var _0x3ab7a1=_0x15ef87['get']({'plain':!![]});var _0x2bfcf6=_0xec03('0x29');return db[_0xec03('0x2a')][_0xec03('0x2b')]({'where':{'type':_0x2bfcf6,'resourceId':_0x3ab7a1['id']}})[_0xec03('0x28')](function(){return _0x15ef87;});})['then'](function(){_0x76b813[_0xec03('0x1e')](0xcc)[_0xec03('0x1f')]();});}};}function handleEntityNotFound(_0x3eefe0,_0x11a6b6){return function(_0x29e904){if(!_0x29e904){_0x3eefe0['sendStatus'](0x194);}return _0x29e904;};}function handleError(_0x15cb11,_0x141db0){_0x141db0=_0x141db0||0x1f4;return function(_0x49f9ab){logger['error'](_0x49f9ab[_0xec03('0x2c')]);if(_0x49f9ab[_0xec03('0x2d')]){delete _0x49f9ab[_0xec03('0x2d')];}_0x15cb11[_0xec03('0x1e')](_0x141db0)[_0xec03('0x2e')](_0x49f9ab);};}exports[_0xec03('0x2f')]=function(_0xda963b,_0x28753c){var _0x51fad6={},_0x28f60c={},_0x31c08d={'count':0x0,'rows':[]};var _0x2bd889=db[_0xec03('0x30')][_0xec03('0x31')];_0x28f60c[_0xec03('0x32')]=_[_0xec03('0x33')](_0x2bd889);_0x28f60c[_0xec03('0x34')]=_[_0xec03('0x33')](_0xda963b['query']);_0x28f60c['filters']=_['intersection'](_0x28f60c[_0xec03('0x32')],_0x28f60c[_0xec03('0x34')]);_0x51fad6[_0xec03('0x35')]=_[_0xec03('0x36')](_0x28f60c['model'],qs['fields'](_0xda963b['query']['fields']));_0x51fad6[_0xec03('0x35')]=_0x51fad6[_0xec03('0x35')][_0xec03('0x37')]?_0x51fad6[_0xec03('0x35')]:_0x28f60c[_0xec03('0x32')];if(!_0xda963b[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x51fad6[_0xec03('0x22')]=qs[_0xec03('0x22')](_0xda963b[_0xec03('0x34')][_0xec03('0x22')]);_0x51fad6['offset']=qs[_0xec03('0x21')](_0xda963b[_0xec03('0x34')][_0xec03('0x21')]);}_0x51fad6['order']=qs[_0xec03('0x3a')](_0xda963b[_0xec03('0x34')][_0xec03('0x3a')]);_0x51fad6[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_[_0xec03('0x3d')](_0xda963b[_0xec03('0x34')],_0x28f60c[_0xec03('0x3c')]));if(_0xda963b[_0xec03('0x34')][_0xec03('0x3e')]){_0x51fad6[_0xec03('0x3b')]=_['merge'](_0x51fad6[_0xec03('0x3b')],{'$or':_[_0xec03('0x3f')](_0x2bd889,function(_0x37819a){if(_0x37819a[_0xec03('0x40')][_0xec03('0x41')]!==_0xec03('0x42')){var _0x2ba220={};_0x2ba220[_0x37819a[_0xec03('0x43')]]={'$like':'%'+_0xda963b['query'][_0xec03('0x3e')]+'%'};return _0x2ba220;}})});}_0x51fad6=_['merge']({},_0x51fad6,_0xda963b['options']);var _0x1c2d46={'where':_0x51fad6['where']};return db['FaxQueue'][_0xec03('0x44')](_0x1c2d46)[_0xec03('0x28')](function(_0x5aec1c){_0x31c08d[_0xec03('0x44')]=_0x5aec1c;if(_0xda963b['query']['includeAll']){_0x51fad6['include']=[{'all':!![]}];}return db[_0xec03('0x30')][_0xec03('0x45')](_0x51fad6);})[_0xec03('0x28')](function(_0xf3d24e){_0x31c08d['rows']=_0xf3d24e;return _0x31c08d;})[_0xec03('0x28')](respondWithFilteredResult(_0x28753c,_0x51fad6))[_0xec03('0x46')](handleError(_0x28753c,null));};exports[_0xec03('0x47')]=function(_0x14a429,_0x5f9bb6){var _0x419e15={'raw':!![],'where':{'id':_0x14a429[_0xec03('0x48')]['id']}},_0x1ee5b7={};_0x1ee5b7[_0xec03('0x32')]=_['keys'](db[_0xec03('0x30')][_0xec03('0x31')]);_0x1ee5b7[_0xec03('0x34')]=_[_0xec03('0x33')](_0x14a429['query']);_0x1ee5b7[_0xec03('0x3c')]=_[_0xec03('0x36')](_0x1ee5b7[_0xec03('0x32')],_0x1ee5b7[_0xec03('0x34')]);_0x419e15[_0xec03('0x35')]=_[_0xec03('0x36')](_0x1ee5b7['model'],qs['fields'](_0x14a429[_0xec03('0x34')][_0xec03('0x49')]));_0x419e15[_0xec03('0x35')]=_0x419e15[_0xec03('0x35')][_0xec03('0x37')]?_0x419e15['attributes']:_0x1ee5b7['model'];if(_0x14a429[_0xec03('0x34')]['includeAll']){_0x419e15[_0xec03('0x4a')]=[{'all':!![]}];}_0x419e15=_[_0xec03('0x4b')]({},_0x419e15,_0x14a429[_0xec03('0x4c')]);return db[_0xec03('0x30')]['find'](_0x419e15)[_0xec03('0x28')](handleEntityNotFound(_0x5f9bb6,null))[_0xec03('0x28')](respondWithResult(_0x5f9bb6,null))[_0xec03('0x46')](handleError(_0x5f9bb6,null));};exports[_0xec03('0x4d')]=function(_0x54a2d4,_0x128935){return db['FaxQueue'][_0xec03('0x4d')](_0x54a2d4[_0xec03('0x4e')],{})[_0xec03('0x28')](function(_0x1c6b87){var _0x2eba66=_0x54a2d4[_0xec03('0x4f')][_0xec03('0x50')]({'plain':!![]});if(!_0x2eba66)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eba66[_0xec03('0x51')]===_0xec03('0x4f')){var _0x3eacdf=_0x1c6b87[_0xec03('0x50')]({'plain':!![]});var _0x53a51e=_0xec03('0x29');return db['UserProfileSection'][_0xec03('0x52')]({'where':{'name':_0x53a51e,'userProfileId':_0x2eba66[_0xec03('0x53')]},'raw':!![]})[_0xec03('0x28')](function(_0x2e13c6){if(_0x2e13c6&&_0x2e13c6['autoAssociation']===0x0){return db[_0xec03('0x2a')][_0xec03('0x4d')]({'name':_0x3eacdf[_0xec03('0x2d')],'resourceId':_0x3eacdf['id'],'type':_0x2e13c6[_0xec03('0x2d')],'sectionId':_0x2e13c6['id']},{})[_0xec03('0x28')](function(){return _0x1c6b87;});}else{return _0x1c6b87;}})['catch'](function(_0x1170fa){logger[_0xec03('0x54')](_0xec03('0x55'),_0x1170fa);throw _0x1170fa;});}return _0x1c6b87;})['then'](respondWithResult(_0x128935,0xc9))['catch'](handleError(_0x128935,null));};exports[_0xec03('0x27')]=function(_0x3932ba,_0x29929d){if(_0x3932ba[_0xec03('0x4e')]['id']){delete _0x3932ba['body']['id'];}return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x3932ba[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x29929d,null))['then'](saveUpdates(_0x3932ba[_0xec03('0x4e')],null))[_0xec03('0x28')](respondWithResult(_0x29929d,null))[_0xec03('0x46')](handleError(_0x29929d,null));};exports[_0xec03('0x2b')]=function(_0x1fc401,_0x3d41b2){return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x1fc401['params']['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x3d41b2,null))[_0xec03('0x28')](removeEntity(_0x3d41b2,null))[_0xec03('0x46')](handleError(_0x3d41b2,null));};exports[_0xec03('0x56')]=function(_0x4ddc6f,_0x17ce61){return db[_0xec03('0x30')][_0xec03('0x56')]()[_0xec03('0x28')](respondWithResult(_0x17ce61,null))['catch'](handleError(_0x17ce61,null));};exports[_0xec03('0x57')]=function(_0x286156,_0x13fae4,_0x22e1da){var _0x7715b0={'raw':!![],'where':{}},_0x19272d={},_0x1f9272;return db[_0xec03('0x30')]['findOne']({'where':{'id':_0x286156[_0xec03('0x48')]['id']}})['then'](handleEntityNotFound(_0x13fae4,null))[_0xec03('0x28')](function(_0x5befb7){if(_0x5befb7){_0x1f9272=_0x5befb7[_0xec03('0x50')]({'plain':!![]});_0x19272d[_0xec03('0x32')]=_[_0xec03('0x33')](db[_0xec03('0x58')][_0xec03('0x31')]);_0x19272d[_0xec03('0x34')]=_[_0xec03('0x33')](_0x286156[_0xec03('0x34')]);_0x19272d['filters']=_[_0xec03('0x36')](_0x19272d[_0xec03('0x32')],_0x19272d['query']);_0x7715b0[_0xec03('0x35')]=_[_0xec03('0x36')](_0x19272d['model'],qs['fields'](_0x286156[_0xec03('0x34')][_0xec03('0x49')]));_0x7715b0[_0xec03('0x35')]=_0x7715b0[_0xec03('0x35')][_0xec03('0x37')]?_0x7715b0[_0xec03('0x35')]:_0x19272d[_0xec03('0x32')];if(!_0x286156[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x7715b0[_0xec03('0x22')]=qs[_0xec03('0x22')](_0x286156[_0xec03('0x34')][_0xec03('0x22')]);_0x7715b0[_0xec03('0x21')]=qs['offset'](_0x286156[_0xec03('0x34')]['offset']);}_0x7715b0[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x286156[_0xec03('0x34')][_0xec03('0x3a')]);_0x7715b0[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_['pick'](_0x286156[_0xec03('0x34')],_0x19272d[_0xec03('0x3c')]));_0x7715b0[_0xec03('0x3b')][_0xec03('0x5a')]=_0x5befb7['id'];if(_0x286156[_0xec03('0x34')][_0xec03('0x3e')]){_0x7715b0[_0xec03('0x3b')]=_[_0xec03('0x4b')](_0x7715b0['where'],{'$or':_[_0xec03('0x3f')](_0x7715b0[_0xec03('0x35')],function(_0x4a5e18){var _0x1537f1={};_0x1537f1[_0x4a5e18]={'$like':'%'+_0x286156[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1537f1;})});}_0x7715b0=_[_0xec03('0x4b')]({},_0x7715b0,_0x286156[_0xec03('0x4c')]);return db['UserFaxQueue'][_0xec03('0x45')](_0x7715b0);}})[_0xec03('0x28')](function(_0x39d2a6){if(_0x39d2a6){return db[_0xec03('0x5b')][_0xec03('0x5c')]({'where':{'id':_[_0xec03('0x3f')](_0x39d2a6,_0xec03('0x5d')),'role':'agent'},'attributes':['id',_0xec03('0x2d'),_0xec03('0x5e'),_0xec03('0x5f'),'createdAt']});}})[_0xec03('0x28')](function(_0x52c0f3){if(_0x52c0f3){return{'count':_0x52c0f3['count'],'rows':_[_0xec03('0x3f')](_0x52c0f3[_0xec03('0x60')],function(_0x338beb){return{'membername':_0x338beb[_0xec03('0x2d')],'UserId':_0x338beb['id'],'queue_name':_0x1f9272[_0xec03('0x2d')],'FaxQueueId':_0x1f9272['id'],'interface':util['format']('%s/%s','SIP',_0x338beb[_0xec03('0x2d')]),'penalty':0x0,'paused':_0x338beb[_0xec03('0x5e')],'createdAt':_0x338beb[_0xec03('0x61')],'updatedAt':_0x338beb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13fae4,_0x7715b0))[_0xec03('0x46')](handleError(_0x13fae4,null));};exports['getTeams']=function(_0x34c58c,_0x3bf499,_0x1a0bae){var _0x4de4eb={};var _0x3559cf={};var _0x5648a6;var _0x274425;return db['FaxQueue']['findOne']({'where':{'id':_0x34c58c['params']['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x3bf499,null))[_0xec03('0x28')](function(_0xba5495){if(_0xba5495){_0x5648a6=_0xba5495;_0x3559cf[_0xec03('0x32')]=_[_0xec03('0x33')](db[_0xec03('0x62')][_0xec03('0x31')]);_0x3559cf['query']=_[_0xec03('0x33')](_0x34c58c[_0xec03('0x34')]);_0x3559cf['filters']=_[_0xec03('0x36')](_0x3559cf['model'],_0x3559cf[_0xec03('0x34')]);_0x4de4eb[_0xec03('0x35')]=_[_0xec03('0x36')](_0x3559cf['model'],qs[_0xec03('0x49')](_0x34c58c[_0xec03('0x34')]['fields']));_0x4de4eb['attributes']=_0x4de4eb[_0xec03('0x35')][_0xec03('0x37')]?_0x4de4eb[_0xec03('0x35')]:_0x3559cf[_0xec03('0x32')];_0x4de4eb[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x34c58c[_0xec03('0x34')][_0xec03('0x3a')]);_0x4de4eb[_0xec03('0x3b')]=qs['filters'](_[_0xec03('0x3d')](_0x34c58c[_0xec03('0x34')],_0x3559cf[_0xec03('0x3c')]));if(_0x34c58c[_0xec03('0x34')][_0xec03('0x3e')]){_0x4de4eb['where']=_['merge'](_0x4de4eb['where'],{'$or':_[_0xec03('0x3f')](_0x4de4eb['attributes'],function(_0x1c75bc){var _0x1048c2={};_0x1048c2[_0x1c75bc]={'$like':'%'+_0x34c58c[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1048c2;})});}_0x4de4eb=_['merge']({},_0x4de4eb,_0x34c58c[_0xec03('0x4c')]);return _0x5648a6[_0xec03('0x63')](_0x4de4eb);}})['then'](function(_0x2d3172){if(_0x2d3172){_0x274425=_0x2d3172['length'];if(!_0x34c58c[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x4de4eb['limit']=qs['limit'](_0x34c58c[_0xec03('0x34')][_0xec03('0x22')]);_0x4de4eb[_0xec03('0x21')]=qs[_0xec03('0x21')](_0x34c58c[_0xec03('0x34')][_0xec03('0x21')]);}return _0x5648a6['getTeams'](_0x4de4eb);}})[_0xec03('0x28')](function(_0x152b93){if(_0x152b93){return _0x152b93?{'count':_0x274425,'rows':_0x152b93}:null;}})[_0xec03('0x28')](respondWithResult(_0x3bf499,null))[_0xec03('0x46')](handleError(_0x3bf499,null));};exports[_0xec03('0x64')]=function(_0x28be4d,_0x30a8da,_0x54dcf5){var _0x3384f0=_0x28be4d[_0xec03('0x4e')]['teams'];return db['Team'][_0xec03('0x45')]({'where':{'id':_['map'](_0x3384f0,'id')},'attributes':['id'],'include':[{'model':db[_0xec03('0x5b')],'as':_0xec03('0x65'),'attributes':['id',_0xec03('0x2d'),_0xec03('0x66'),_0xec03('0x67'),_0xec03('0x68')],'raw':!![]}]})['then'](function(_0x5f3a8b){if(_0x5f3a8b){var _0x1a6bc2=_[_0xec03('0x69')](_0x5f3a8b,function(_0x2cebb0){var _0x204e48=_0x2cebb0[_0xec03('0x50')]({'plain':!![]});return _0x204e48[_0xec03('0x65')];});return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x28be4d[_0xec03('0x48')]['id']}})[_0xec03('0x28')](function(_0x498fd2){return db[_0xec03('0x6a')][_0xec03('0x6b')](function(_0x39b38b){return _0x498fd2[_0xec03('0x64')](_[_0xec03('0x3f')](_0x3384f0,'id'),{'transaction':_0x39b38b})[_0xec03('0x28')](function(){return BPromise[_0xec03('0x6c')](_0x1a6bc2,function(_0x3d6e22){return db[_0xec03('0x58')][_0xec03('0x6d')]({'where':{'UserId':_0x3d6e22['id'],'FaxQueueId':_0x28be4d[_0xec03('0x48')]['id']},'transaction':_0x39b38b});});})['then'](function(){_0x1a6bc2[_0xec03('0x6e')](function(_0x599c1a){socket[_0xec03('0x6f')]('userFaxQueue:save',{'UserId':_0x599c1a['id'],'FaxQueueId':_0x498fd2['id']});});});});});}})[_0xec03('0x28')](respondWithStatusCode(_0x30a8da,null))[_0xec03('0x46')](handleError(_0x30a8da,null));};exports[_0xec03('0x70')]=function(_0x48f53e,_0x1fbed5,_0x255110){return db[_0xec03('0x62')]['findAll']({'where':{'id':_0x48f53e[_0xec03('0x34')][_0xec03('0x71')]},'attributes':['id'],'include':[{'model':db[_0xec03('0x5b')],'as':_0xec03('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fbed5,null))[_0xec03('0x28')](function(_0x1f0a79){var _0x7f975=_[_0xec03('0x3f')](_0x1f0a79,'id');var _0x27cc93=[];var _0x141902=[];var _0xd0b9c=squel[_0xec03('0x72')]();_0xd0b9c['field']('tq.TeamId')[_0xec03('0x73')](_0xec03('0x74'),'tq')[_0xec03('0x75')](_0xec03('0x76'),'ut',_0xec03('0x77'))[_0xec03('0x3b')]('FaxQueueId\x20=\x20?',_0x48f53e[_0xec03('0x48')]['id']);for(var _0x2e8e8b=0x0;_0x2e8e8b<_0x1f0a79[_0xec03('0x37')];_0x2e8e8b+=0x1){let _0x395d68=_0x1f0a79[_0x2e8e8b];for(var _0x7dd42d=0x0;_0x7dd42d<_0x395d68[_0xec03('0x65')][_0xec03('0x37')];_0x7dd42d+=0x1){let _0x26321e=_0x395d68['Agents'][_0x7dd42d];var _0x2ce92b=_0xd0b9c[_0xec03('0x78')]();_0x2ce92b[_0xec03('0x3b')](_0xec03('0x79'),_0x26321e['id']);_0x141902[_0xec03('0x7a')](db[_0xec03('0x6a')]['query'](_0x2ce92b[_0xec03('0x7b')](),{'type':db[_0xec03('0x6a')]['QueryTypes'][_0xec03('0x7c')]})[_0xec03('0x28')](function(_0x5d0897){if(_0x5d0897[_0xec03('0x37')]===0x1){return _0x26321e['id'];}else{var _0x1f231b=_['every'](_[_0xec03('0x3f')](_0x5d0897,_0xec03('0x7d')),function(_0x31a702){return _['includes'](_0x7f975,_0x31a702);});if(_0x1f231b){return _0x26321e['id'];}}}));}}return BPromise[_0xec03('0x7e')](_0x141902)[_0xec03('0x28')](function(_0x388280){_0x27cc93=_(_0x27cc93)[_0xec03('0x7f')](_0x388280)[_0xec03('0x80')]()[_0xec03('0x81')]();return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x48f53e['params']['id']}})[_0xec03('0x28')](function(_0x9f9172){return db['sequelize'][_0xec03('0x6b')](function(_0x369d56){return _0x9f9172[_0xec03('0x70')](_0x48f53e[_0xec03('0x34')][_0xec03('0x71')],{'transaction':_0x369d56})[_0xec03('0x28')](function(){if(!_[_0xec03('0x82')](_0x27cc93)){return _0x9f9172['removeAgents'](_0x27cc93,{'transaction':_0x369d56});}})[_0xec03('0x28')](function(){_0x27cc93[_0xec03('0x6e')](function(_0x45c246){socket[_0xec03('0x6f')]('userFaxQueue:remove',{'UserId':_0x45c246,'FaxQueueId':_0x9f9172['id']});});});});});});})['then'](respondWithStatusCode(_0x1fbed5,null))[_0xec03('0x46')](handleError(_0x1fbed5,null));};exports['addAgents']=function(_0x376777,_0x1a9445,_0xba2cd5){return db['FaxQueue'][_0xec03('0x52')]({'where':{'id':_0x376777[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x1a9445,null))[_0xec03('0x28')](function(_0x549faf){if(_0x549faf){return _0x549faf['addAgents'](_0x376777[_0xec03('0x4e')][_0xec03('0x71')],_[_0xec03('0x83')](_0x376777[_0xec03('0x4e')],[_0xec03('0x71'),'id'])||{})['spread'](function(_0x30cd0c){for(var _0x16fb71=0x0;_0x16fb71<_0x376777[_0xec03('0x4e')][_0xec03('0x71')][_0xec03('0x37')];_0x16fb71+=0x1){socket[_0xec03('0x6f')](_0xec03('0x84'),{'UserId':_0x376777[_0xec03('0x4e')][_0xec03('0x71')][_0x16fb71],'FaxQueueId':_0x376777[_0xec03('0x48')]['id']});}return _0x30cd0c;});}})[_0xec03('0x28')](respondWithResult(_0x1a9445,null))['catch'](handleError(_0x1a9445,null));};exports['removeAgents']=function(_0x5dd652,_0x1f1e14,_0xa77f71){return db[_0xec03('0x30')][_0xec03('0x52')]({'where':{'id':_0x5dd652[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x1f1e14,null))[_0xec03('0x28')](function(_0x5c4a27){if(_0x5c4a27){return _0x5c4a27[_0xec03('0x85')](_0x5dd652[_0xec03('0x34')][_0xec03('0x71')])['then'](function(){if(_[_0xec03('0x86')](_0x5dd652[_0xec03('0x34')]['ids'])){for(var _0x22686d=0x0;_0x22686d<_0x5dd652['query'][_0xec03('0x71')]['length'];_0x22686d+=0x1){socket['emit'](_0xec03('0x87'),{'UserId':Number(_0x5dd652['query'][_0xec03('0x71')][_0x22686d]),'FaxQueueId':Number(_0x5dd652[_0xec03('0x48')]['id'])});}}else{socket[_0xec03('0x6f')](_0xec03('0x87'),{'UserId':Number(_0x5dd652[_0xec03('0x34')][_0xec03('0x71')]),'FaxQueueId':Number(_0x5dd652[_0xec03('0x48')]['id'])});}});}})[_0xec03('0x28')](respondWithStatusCode(_0x1f1e14,null))[_0xec03('0x46')](handleError(_0x1f1e14,null));};exports[_0xec03('0x88')]=function(_0x291ae5,_0x18ede3,_0x58db82){var _0x5901c1={};var _0x5396e8={};var _0x5e7627;var _0x1faf17;return db['FaxQueue'][_0xec03('0x89')]({'where':{'id':_0x291ae5[_0xec03('0x48')]['id']}})[_0xec03('0x28')](handleEntityNotFound(_0x18ede3,null))['then'](function(_0x3de217){if(_0x3de217){_0x5e7627=_0x3de217;_0x5396e8[_0xec03('0x32')]=_[_0xec03('0x33')](db['User'][_0xec03('0x31')]);_0x5396e8[_0xec03('0x34')]=_[_0xec03('0x33')](_0x291ae5['query']);_0x5396e8[_0xec03('0x3c')]=_[_0xec03('0x36')](_0x5396e8[_0xec03('0x32')],_0x5396e8[_0xec03('0x34')]);_0x5901c1[_0xec03('0x35')]=_[_0xec03('0x36')](_0x5396e8[_0xec03('0x32')],qs['fields'](_0x291ae5[_0xec03('0x34')][_0xec03('0x49')]));_0x5901c1[_0xec03('0x35')]=_0x5901c1[_0xec03('0x35')][_0xec03('0x37')]?_0x5901c1[_0xec03('0x35')]:_0x5396e8['model'];_0x5901c1[_0xec03('0x59')]=qs[_0xec03('0x3a')](_0x291ae5[_0xec03('0x34')][_0xec03('0x3a')]);_0x5901c1[_0xec03('0x3b')]=qs['filters'](_[_0xec03('0x3d')](_0x291ae5[_0xec03('0x34')],_0x5396e8['filters']));if(_0x291ae5[_0xec03('0x34')][_0xec03('0x3e')]){_0x5901c1[_0xec03('0x3b')]=_[_0xec03('0x4b')](_0x5901c1[_0xec03('0x3b')],{'$or':_[_0xec03('0x3f')](_0x5901c1[_0xec03('0x35')],function(_0x4a106a){var _0x1dd07d={};_0x1dd07d[_0x4a106a]={'$like':'%'+_0x291ae5[_0xec03('0x34')][_0xec03('0x3e')]+'%'};return _0x1dd07d;})});}_0x5901c1=_[_0xec03('0x4b')]({},_0x5901c1,_0x291ae5['options']);return _0x5e7627[_0xec03('0x88')](_0x5901c1);}})[_0xec03('0x28')](function(_0x4589d3){if(_0x4589d3){_0x1faf17=_0x4589d3['length'];if(!_0x291ae5[_0xec03('0x34')][_0xec03('0x38')](_0xec03('0x39'))){_0x5901c1[_0xec03('0x22')]=qs[_0xec03('0x22')](_0x291ae5[_0xec03('0x34')][_0xec03('0x22')]);_0x5901c1[_0xec03('0x21')]=qs[_0xec03('0x21')](_0x291ae5[_0xec03('0x34')][_0xec03('0x21')]);}return _0x5e7627[_0xec03('0x88')](_0x5901c1);}})[_0xec03('0x28')](function(_0x2dc38f){if(_0x2dc38f){return _0x2dc38f?{'count':_0x1faf17,'rows':_0x2dc38f}:null;}})[_0xec03('0x28')](respondWithResult(_0x18ede3,null))[_0xec03('0x46')](handleError(_0x18ede3,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3931b2d..da4f2c5 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 _0xc3b5=['setMaxListeners','save','update','remove','emit','hook','exports','FaxQueue'];(function(_0x5404f2,_0x1109a5){var _0x3e3ef0=function(_0x547731){while(--_0x547731){_0x5404f2['push'](_0x5404f2['shift']());}};_0x3e3ef0(++_0x1109a5);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xd851b3,_0x140e24){_0xd851b3=_0xd851b3-0x0;var _0x3707c1=_0xc3b5[_0xd851b3];return _0x3707c1;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x5c3b('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5c3b('0x1')](0x0);var events={'afterCreate':_0x5c3b('0x2'),'afterUpdate':_0x5c3b('0x3'),'afterDestroy':_0x5c3b('0x4')};function emitEvent(_0x34be81){return function(_0x237a61,_0x48f8a1,_0x587055){FaxQueueEvents[_0x5c3b('0x5')](_0x34be81+':'+_0x237a61['id'],_0x237a61);FaxQueueEvents[_0x5c3b('0x5')](_0x34be81,_0x237a61);_0x587055(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x5c3b('0x6')](e,emitEvent(event));}}module[_0x5c3b('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xf873=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxQueue'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0xf873,0xb2));var _0x3f87=function(_0x982d77,_0x5e9b3d){_0x982d77=_0x982d77-0x0;var _0x1f7c16=_0xf873[_0x982d77];return _0x1f7c16;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3f87('0x0'))['db'][_0x3f87('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3f87('0x2')](0x0);var events={'afterCreate':_0x3f87('0x3'),'afterUpdate':_0x3f87('0x4'),'afterDestroy':_0x3f87('0x5')};function emitEvent(_0x2fbb4f){return function(_0x1d68dd,_0x3c80d6,_0x4a909e){FaxQueueEvents[_0x3f87('0x6')](_0x2fbb4f+':'+_0x1d68dd['id'],_0x1d68dd);FaxQueueEvents[_0x3f87('0x6')](_0x2fbb4f,_0x1d68dd);_0x4a909e(null);};}for(var e in events){if(events[_0x3f87('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3f87('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 465ce8a..b465bc8 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 _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4162e8,_0x421221){var _0x48768c=function(_0x25f33f){while(--_0x25f33f){_0x4162e8['push'](_0x4162e8['shift']());}};_0x48768c(++_0x421221);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1af655,_0x28b928){_0x1af655=_0x1af655-0x0;var _0x29da01=_0x0b0e[_0x1af655];return _0x29da01;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['bluebird','request-promise','path','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x5c5a69,_0x3eed00){var _0x13bb8a=function(_0x37a48d){while(--_0x37a48d){_0x5c5a69['push'](_0x5c5a69['shift']());}};_0x13bb8a(++_0x3eed00);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c3bb6,_0x33bac8){_0x1c3bb6=_0x1c3bb6-0x0;var _0x440675=_0x5f2f[_0x1c3bb6];return _0x440675;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'fax_queues','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 fdd2459..764acb5 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 _0x2661=['catch','GetFaxQueue','FaxQueue','options','where','attributes','limit','include','model','map','ShowFaxQueue','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result'];(function(_0xdd4555,_0x368dc9){var _0x5b035c=function(_0x2a00b9){while(--_0x2a00b9){_0xdd4555['push'](_0xdd4555['shift']());}};_0x5b035c(++_0x368dc9);}(_0x2661,0x116));var _0x1266=function(_0x59c9ac,_0x49bf7d){_0x59c9ac=_0x59c9ac-0x0;var _0x77d575=_0x2661[_0x59c9ac];return _0x77d575;};'use strict';var _=require(_0x1266('0x0'));var util=require('util');var moment=require(_0x1266('0x1'));var BPromise=require(_0x1266('0x2'));var rs=require(_0x1266('0x3'));var fs=require('fs');var Redis=require(_0x1266('0x4'));var db=require(_0x1266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1266('0x6'))('rpc');var config=require(_0x1266('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1266('0x8')][_0x1266('0x9')]({'port':0x232a});config[_0x1266('0xa')]=_[_0x1266('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1266('0xc'))(new Redis(config[_0x1266('0xa')]));require('./faxQueue.socket')[_0x1266('0xd')](socket);function respondWithRpcPromise(_0x25ef14,_0x9aedd3,_0x199df9){return new BPromise(function(_0x5345c1,_0x52cbf5){return client[_0x1266('0xe')](_0x25ef14,_0x199df9)[_0x1266('0xf')](function(_0x415b1c){logger[_0x1266('0x10')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x1266('0x11'));logger[_0x1266('0x12')](_0x1266('0x13'),_0x9aedd3,'request\x20sent',JSON[_0x1266('0x14')](_0x415b1c));if(_0x415b1c['error']){if(_0x415b1c[_0x1266('0x15')][_0x1266('0x16')]===0x1f4){logger[_0x1266('0x15')](_0x1266('0x17'),_0x9aedd3,_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);return _0x52cbf5(_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);}logger[_0x1266('0x15')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x415b1c['error'][_0x1266('0x18')]);return _0x5345c1(_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x1266('0x11'));_0x5345c1(_0x415b1c[_0x1266('0x19')][_0x1266('0x18')]);}})[_0x1266('0x1a')](function(_0x2a2343){logger[_0x1266('0x15')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x2a2343);_0x52cbf5(_0x2a2343);});});}exports[_0x1266('0x1b')]=function(_0x262a5e){var _0x5bc7d2=this;return new Promise(function(_0x10db01,_0x4a93c7){return db[_0x1266('0x1c')]['findAll']({'raw':_0x262a5e['options']?_0x262a5e['options']['raw']===undefined?!![]:![]:!![],'where':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x1e')]||null:null,'attributes':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x1f')]||null:null,'limit':_0x262a5e['options']?_0x262a5e['options'][_0x1266('0x20')]||null:null,'include':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x21')]?_['map'](_0x262a5e[_0x1266('0x1d')][_0x1266('0x21')],function(_0x50127a){return{'model':db[_0x50127a[_0x1266('0x22')]],'as':_0x50127a['as'],'attributes':_0x50127a[_0x1266('0x1f')],'include':_0x50127a[_0x1266('0x21')]?_[_0x1266('0x23')](_0x50127a['include'],function(_0x11561e){return{'model':db[_0x11561e['model']],'as':_0x11561e['as'],'attributes':_0x11561e[_0x1266('0x1f')],'include':_0x11561e[_0x1266('0x21')]?_[_0x1266('0x23')](_0x11561e[_0x1266('0x21')],function(_0x13d9cd){return{'model':db[_0x13d9cd[_0x1266('0x22')]],'as':_0x13d9cd['as'],'attributes':_0x13d9cd[_0x1266('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1266('0xf')](function(_0x357fca){logger['info'](_0x1266('0x1b'),_0x262a5e);logger[_0x1266('0x12')]('GetFaxQueue',_0x262a5e,JSON[_0x1266('0x14')](_0x357fca));_0x10db01(_0x357fca);})[_0x1266('0x1a')](function(_0x74cb21){logger[_0x1266('0x15')]('GetFaxQueue',_0x74cb21[_0x1266('0x18')],_0x262a5e);_0x4a93c7(_0x5bc7d2['error'](0x1f4,_0x74cb21[_0x1266('0x18')]));});});};exports[_0x1266('0x24')]=function(_0x2c9c0a){var _0x3a24b9=this;return new Promise(function(_0x64cdb6,_0x11e07c){return db[_0x1266('0x1c')]['find']({'raw':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x25')]===undefined?!![]:![]:!![],'where':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')]['where']||null:null,'attributes':_0x2c9c0a['options']?_0x2c9c0a['options'][_0x1266('0x1f')]||null:null,'include':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x21')]?_[_0x1266('0x23')](_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x21')],function(_0x1060df){return{'model':db[_0x1060df['model']],'as':_0x1060df['as'],'attributes':_0x1060df[_0x1266('0x1f')],'include':_0x1060df[_0x1266('0x21')]?_[_0x1266('0x23')](_0x1060df[_0x1266('0x21')],function(_0x207ed7){return{'model':db[_0x207ed7[_0x1266('0x22')]],'as':_0x207ed7['as'],'attributes':_0x207ed7['attributes'],'include':_0x207ed7[_0x1266('0x21')]?_[_0x1266('0x23')](_0x207ed7[_0x1266('0x21')],function(_0x52c340){return{'model':db[_0x52c340[_0x1266('0x22')]],'as':_0x52c340['as'],'attributes':_0x52c340[_0x1266('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1266('0xf')](function(_0x1ebf4c){logger['info'](_0x1266('0x24'),_0x2c9c0a);logger[_0x1266('0x12')](_0x1266('0x24'),_0x2c9c0a,JSON[_0x1266('0x14')](_0x1ebf4c));_0x64cdb6(_0x1ebf4c);})[_0x1266('0x1a')](function(_0x31da14){logger['error'](_0x1266('0x24'),_0x31da14[_0x1266('0x18')],_0x2c9c0a);_0x11e07c(_0x3a24b9[_0x1266('0x15')](0x1f4,_0x31da14[_0x1266('0x18')]));});});}; \ No newline at end of file +var _0xaf54=['request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','model','include','then','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info'];(function(_0x2fd83f,_0x3d0c4f){var _0x3f0cfd=function(_0xdcccb9){while(--_0xdcccb9){_0x2fd83f['push'](_0x2fd83f['shift']());}};_0x3f0cfd(++_0x3d0c4f);}(_0xaf54,0x1dc));var _0x4af5=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0xaf54[_0x5090d4];return _0x56c310;};'use strict';var _=require(_0x4af5('0x0'));var util=require(_0x4af5('0x1'));var moment=require(_0x4af5('0x2'));var BPromise=require('bluebird');var rs=require(_0x4af5('0x3'));var fs=require('fs');var Redis=require(_0x4af5('0x4'));var db=require(_0x4af5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4af5('0x6'));var config=require(_0x4af5('0x7'));var jayson=require(_0x4af5('0x8'));var client=jayson[_0x4af5('0x9')][_0x4af5('0xa')]({'port':0x232a});config[_0x4af5('0xb')]=_[_0x4af5('0xc')](config[_0x4af5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4af5('0xd'))(new Redis(config[_0x4af5('0xb')]));require(_0x4af5('0xe'))[_0x4af5('0xf')](socket);function respondWithRpcPromise(_0x1c72e8,_0x3be486,_0x5aab45){return new BPromise(function(_0x29a4d7,_0x18a70b){return client[_0x4af5('0x10')](_0x1c72e8,_0x5aab45)['then'](function(_0x25bdcc){logger[_0x4af5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x4af5('0x12'));logger[_0x4af5('0x13')](_0x4af5('0x14'),_0x3be486,'request\x20sent',JSON[_0x4af5('0x15')](_0x25bdcc));if(_0x25bdcc[_0x4af5('0x16')]){if(_0x25bdcc['error']['code']===0x1f4){logger[_0x4af5('0x16')](_0x4af5('0x17'),_0x3be486,_0x25bdcc[_0x4af5('0x16')][_0x4af5('0x18')]);return _0x18a70b(_0x25bdcc[_0x4af5('0x16')]['message']);}logger[_0x4af5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x25bdcc['error'][_0x4af5('0x18')]);return _0x29a4d7(_0x25bdcc[_0x4af5('0x16')][_0x4af5('0x18')]);}else{logger[_0x4af5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x4af5('0x12'));_0x29a4d7(_0x25bdcc['result'][_0x4af5('0x18')]);}})[_0x4af5('0x19')](function(_0x35abbb){logger[_0x4af5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3be486,_0x35abbb);_0x18a70b(_0x35abbb);});});}exports[_0x4af5('0x1a')]=function(_0x429944){var _0x598395=this;return new Promise(function(_0x56ea7f,_0x2eec34){return db['FaxQueue'][_0x4af5('0x1b')]({'raw':_0x429944[_0x4af5('0x1c')]?_0x429944['options'][_0x4af5('0x1d')]===undefined?!![]:![]:!![],'where':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x1e')]||null:null,'attributes':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x1f')]||null:null,'limit':_0x429944[_0x4af5('0x1c')]?_0x429944[_0x4af5('0x1c')][_0x4af5('0x20')]||null:null,'include':_0x429944['options']?_0x429944['options']['include']?_[_0x4af5('0x21')](_0x429944['options']['include'],function(_0x3f1fec){return{'model':db[_0x3f1fec[_0x4af5('0x22')]],'as':_0x3f1fec['as'],'attributes':_0x3f1fec[_0x4af5('0x1f')],'include':_0x3f1fec[_0x4af5('0x23')]?_['map'](_0x3f1fec['include'],function(_0x13bd1f){return{'model':db[_0x13bd1f[_0x4af5('0x22')]],'as':_0x13bd1f['as'],'attributes':_0x13bd1f[_0x4af5('0x1f')],'include':_0x13bd1f['include']?_[_0x4af5('0x21')](_0x13bd1f['include'],function(_0x25fc16){return{'model':db[_0x25fc16[_0x4af5('0x22')]],'as':_0x25fc16['as'],'attributes':_0x25fc16['attributes']};}):[]};}):[]};}):[]:[]})[_0x4af5('0x24')](function(_0xccab4b){logger['info']('GetFaxQueue',_0x429944);logger['debug'](_0x4af5('0x1a'),_0x429944,JSON['stringify'](_0xccab4b));_0x56ea7f(_0xccab4b);})['catch'](function(_0x307cfe){logger[_0x4af5('0x16')](_0x4af5('0x1a'),_0x307cfe[_0x4af5('0x18')],_0x429944);_0x2eec34(_0x598395[_0x4af5('0x16')](0x1f4,_0x307cfe['message']));});});};exports[_0x4af5('0x25')]=function(_0x1f3215){var _0x16c041=this;return new Promise(function(_0x4a0c0f,_0x338486){return db['FaxQueue']['find']({'raw':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1e')]||null:null,'attributes':_0x1f3215['options']?_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x1f')]||null:null,'include':_0x1f3215[_0x4af5('0x1c')]?_0x1f3215['options'][_0x4af5('0x23')]?_['map'](_0x1f3215[_0x4af5('0x1c')][_0x4af5('0x23')],function(_0xa59128){return{'model':db[_0xa59128[_0x4af5('0x22')]],'as':_0xa59128['as'],'attributes':_0xa59128[_0x4af5('0x1f')],'include':_0xa59128[_0x4af5('0x23')]?_[_0x4af5('0x21')](_0xa59128[_0x4af5('0x23')],function(_0xd778a6){return{'model':db[_0xd778a6[_0x4af5('0x22')]],'as':_0xd778a6['as'],'attributes':_0xd778a6[_0x4af5('0x1f')],'include':_0xd778a6[_0x4af5('0x23')]?_[_0x4af5('0x21')](_0xd778a6['include'],function(_0x953093){return{'model':db[_0x953093[_0x4af5('0x22')]],'as':_0x953093['as'],'attributes':_0x953093[_0x4af5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4af5('0x24')](function(_0x785567){logger[_0x4af5('0x11')](_0x4af5('0x25'),_0x1f3215);logger['debug'](_0x4af5('0x25'),_0x1f3215,JSON[_0x4af5('0x15')](_0x785567));_0x4a0c0f(_0x785567);})[_0x4af5('0x19')](function(_0x47e910){logger['error'](_0x4af5('0x25'),_0x47e910[_0x4af5('0x18')],_0x1f3215);_0x338486(_0x16c041['error'](0x1f4,_0x47e910[_0x4af5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 97dbdda..ac8965d 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 _0x33a8=['length','faxQueue:','./faxQueue.events','save','remove','register'];(function(_0x450bf8,_0x1e95e0){var _0x3508d8=function(_0x10052e){while(--_0x10052e){_0x450bf8['push'](_0x450bf8['shift']());}};_0x3508d8(++_0x1e95e0);}(_0x33a8,0x86));var _0x833a=function(_0x2fa898,_0x349e64){_0x2fa898=_0x2fa898-0x0;var _0x5687e5=_0x33a8[_0x2fa898];return _0x5687e5;};'use strict';var FaxQueueEvents=require(_0x833a('0x0'));var events=[_0x833a('0x1'),_0x833a('0x2'),'update'];function createListener(_0x492ca1,_0x169a9b){return function(_0x2a9084){_0x169a9b['emit'](_0x492ca1,_0x2a9084);};}function removeListener(_0x9be9fa,_0x10777c){return function(){FaxQueueEvents['removeListener'](_0x9be9fa,_0x10777c);};}exports[_0x833a('0x3')]=function(_0x1facb4){for(var _0x2eb178=0x0,_0x2685a5=events[_0x833a('0x4')];_0x2eb178<_0x2685a5;_0x2eb178++){var _0x2f1f62=events[_0x2eb178];var _0x175dbb=createListener(_0x833a('0x5')+_0x2f1f62,_0x1facb4);FaxQueueEvents['on'](_0x2f1f62,_0x175dbb);}}; \ No newline at end of file +var _0xf7cf=['register','length','remove','update','emit','removeListener'];(function(_0x200a2e,_0x57d4b3){var _0x8985b6=function(_0x26f0ed){while(--_0x26f0ed){_0x200a2e['push'](_0x200a2e['shift']());}};_0x8985b6(++_0x57d4b3);}(_0xf7cf,0x8c));var _0xff7c=function(_0x15bc2f,_0x25e563){_0x15bc2f=_0x15bc2f-0x0;var _0x574008=_0xf7cf[_0x15bc2f];return _0x574008;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0xff7c('0x0'),_0xff7c('0x1')];function createListener(_0xb0cc3a,_0xb49978){return function(_0x11e6b6){_0xb49978[_0xff7c('0x2')](_0xb0cc3a,_0x11e6b6);};}function removeListener(_0x1eae69,_0x5c7c1a){return function(){FaxQueueEvents[_0xff7c('0x3')](_0x1eae69,_0x5c7c1a);};}exports[_0xff7c('0x4')]=function(_0x15059f){for(var _0xc7e3a7=0x0,_0x4a7002=events[_0xff7c('0x5')];_0xc7e3a7<_0x4a7002;_0xc7e3a7++){var _0x37d9c5=events[_0xc7e3a7];var _0x3f4dea=createListener('faxQueue:'+_0x37d9c5,_0x15059f);FaxQueueEvents['on'](_0x37d9c5,_0x3f4dea);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f939b5d..2533dbf 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 _0xfdbe=['util','path','express','../../config/environment','./faxQueue.controller','isAuthenticated','index','describe','get','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x2bd9b5,_0xfd161b){var _0x61bc01=function(_0xb45d5b){while(--_0xb45d5b){_0x2bd9b5['push'](_0x2bd9b5['shift']());}};_0x61bc01(++_0xfd161b);}(_0xfdbe,0x8a));var _0xefdb=function(_0x3c4828,_0x546d02){_0x3c4828=_0x3c4828-0x0;var _0x5149c2=_0xfdbe[_0x3c4828];return _0x5149c2;};'use strict';var multer=require('multer');var util=require(_0xefdb('0x0'));var path=require(_0xefdb('0x1'));var timeout=require('connect-timeout');var express=require(_0xefdb('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xefdb('0x3'));var controller=require(_0xefdb('0x4'));router['get']('/',auth[_0xefdb('0x5')](),controller[_0xefdb('0x6')]);router['get']('/describe',auth[_0xefdb('0x5')](),controller[_0xefdb('0x7')]);router['get']('/:id',auth[_0xefdb('0x5')](),controller['show']);router[_0xefdb('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xefdb('0x8')](_0xefdb('0x9'),auth[_0xefdb('0x5')](),controller['getTeams']);router['get'](_0xefdb('0xa'),auth[_0xefdb('0x5')](),controller[_0xefdb('0xb')]);router[_0xefdb('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xefdb('0xc')]('/:id/teams',auth[_0xefdb('0x5')](),controller[_0xefdb('0xd')]);router['post'](_0xefdb('0xa'),auth['isAuthenticated'](),controller[_0xefdb('0xe')]);router[_0xefdb('0xf')](_0xefdb('0x10'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x11')]);router[_0xefdb('0x12')](_0xefdb('0x10'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x13')]);router[_0xefdb('0x12')](_0xefdb('0x9'),auth['isAuthenticated'](),controller[_0xefdb('0x14')]);router[_0xefdb('0x12')](_0xefdb('0xa'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x15')]);module[_0xefdb('0x16')]=router; \ No newline at end of file +var _0x54a4=['removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','put','destroy','removeTeams','delete'];(function(_0x34331d,_0x1aabf1){var _0x2e1300=function(_0x46dbaa){while(--_0x46dbaa){_0x34331d['push'](_0x34331d['shift']());}};_0x2e1300(++_0x1aabf1);}(_0x54a4,0x18a));var _0x454a=function(_0x203b52,_0x50d5a3){_0x203b52=_0x203b52-0x0;var _0x48e947=_0x54a4[_0x203b52];return _0x48e947;};'use strict';var multer=require(_0x454a('0x0'));var util=require(_0x454a('0x1'));var path=require(_0x454a('0x2'));var timeout=require(_0x454a('0x3'));var express=require(_0x454a('0x4'));var router=express['Router']();var auth=require(_0x454a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x454a('0x6'));var controller=require(_0x454a('0x7'));router['get']('/',auth[_0x454a('0x8')](),controller['index']);router[_0x454a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x454a('0xa')]);router['get'](_0x454a('0xb'),auth['isAuthenticated'](),controller[_0x454a('0xc')]);router[_0x454a('0x9')](_0x454a('0xd'),auth[_0x454a('0x8')](),controller['getMembers']);router[_0x454a('0x9')](_0x454a('0xe'),auth[_0x454a('0x8')](),controller[_0x454a('0xf')]);router[_0x454a('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x454a('0x10')]);router['post']('/',auth[_0x454a('0x8')](),controller[_0x454a('0x11')]);router[_0x454a('0x12')](_0x454a('0xe'),auth[_0x454a('0x8')](),controller[_0x454a('0x13')]);router['post'](_0x454a('0x14'),auth['isAuthenticated'](),controller[_0x454a('0x15')]);router[_0x454a('0x16')](_0x454a('0xb'),auth[_0x454a('0x8')](),controller['update']);router['delete'](_0x454a('0xb'),auth[_0x454a('0x8')](),controller[_0x454a('0x17')]);router['delete'](_0x454a('0xe'),auth['isAuthenticated'](),controller[_0x454a('0x18')]);router[_0x454a('0x19')](_0x454a('0x14'),auth[_0x454a('0x8')](),controller[_0x454a('0x1a')]);module[_0x454a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index af19f9a..a780f5a 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 _0x1395=['DATE','moment','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1395,0x7c));var _0x5139=function(_0x2f6eee,_0x55f32e){_0x2f6eee=_0x2f6eee-0x0;var _0x31c467=_0x1395[_0x2f6eee];return _0x31c467;};'use strict';var moment=require(_0x5139('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5139('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5139('0x1')]},'joinAt':{'type':Sequelize[_0x5139('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5139('0x2')]},'exitAt':{'type':Sequelize[_0x5139('0x2')]},'reason':{'type':Sequelize[_0x5139('0x1')]}}; \ No newline at end of file +var _0x43dd=['moment','sequelize','exports','STRING','DATE'];(function(_0x288de3,_0x2c5398){var _0x31b661=function(_0xbb99b4){while(--_0xbb99b4){_0x288de3['push'](_0x288de3['shift']());}};_0x31b661(++_0x2c5398);}(_0x43dd,0x11d));var _0xd43d=function(_0xeac928,_0x253cd6){_0xeac928=_0xeac928-0x0;var _0x345cff=_0x43dd[_0xeac928];return _0x345cff;};'use strict';var moment=require(_0xd43d('0x0'));var Sequelize=require(_0xd43d('0x1'));module[_0xd43d('0x2')]={'uniqueid':{'type':Sequelize[_0xd43d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd43d('0x3')]},'joinAt':{'type':Sequelize[_0xd43d('0x4')]},'leaveAt':{'type':Sequelize[_0xd43d('0x4')]},'acceptAt':{'type':Sequelize[_0xd43d('0x4')]},'exitAt':{'type':Sequelize[_0xd43d('0x4')]},'reason':{'type':Sequelize[_0xd43d('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index d65a61b..3ec9ebd 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 _0x1186=['describe','eml-format','zip-dir','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','FaxQueueReport','rawAttributes','keys','query','filters','model','intersection','hasOwnProperty','nolimit','where','pick','merge','key','field','filter','options','count','includeAll','include','rows','params','attributes','fields','length','find','catch','create','body','destroy'];(function(_0x5ea27b,_0x400668){var _0x5d1b9a=function(_0x57f4aa){while(--_0x57f4aa){_0x5ea27b['push'](_0x5ea27b['shift']());}};_0x5d1b9a(++_0x400668);}(_0x1186,0xbe));var _0x6118=function(_0x129250,_0x3d5a95){_0x129250=_0x129250-0x0;var _0x2916e9=_0x1186[_0x129250];return _0x2916e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6118('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6118('0x2'));var BPromise=require(_0x6118('0x3'));var Mustache=require('mustache');var util=require(_0x6118('0x4'));var path=require('path');var sox=require(_0x6118('0x5'));var csv=require('to-csv');var ejs=require(_0x6118('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6118('0x7'));var crypto=require(_0x6118('0x8'));var jsforce=require(_0x6118('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6118('0xa'));var querystring=require(_0x6118('0xb'));var Papa=require(_0x6118('0xc'));var Redis=require('ioredis');var authService=require(_0x6118('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6118('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6118('0xf'));var db=require(_0x6118('0x10'))['db'];function respondWithStatusCode(_0x3c5c09,_0x461fc1){_0x461fc1=_0x461fc1||0xcc;return function(_0x2e3045){if(_0x2e3045){return _0x3c5c09[_0x6118('0x11')](_0x461fc1);}return _0x3c5c09['status'](_0x461fc1)[_0x6118('0x12')]();};}function respondWithResult(_0x3003a7,_0x32f963){_0x32f963=_0x32f963||0xc8;return function(_0x384da9){if(_0x384da9){return _0x3003a7[_0x6118('0x13')](_0x32f963)[_0x6118('0x14')](_0x384da9);}};}function respondWithFilteredResult(_0x57aec2,_0x48474d){return function(_0x1ceb4a){if(_0x1ceb4a){var _0x1b6d28=_0x1ceb4a['count'],_0xc40c09=_0x48474d[_0x6118('0x15')],_0x2f2583=_0x48474d['offset']+_0x48474d[_0x6118('0x16')],_0x2b2dfe;if(_0x2f2583>=_0x1b6d28){_0x2f2583=_0x1b6d28;_0x2b2dfe=0xc8;}else{_0x2b2dfe=0xce;}_0x57aec2[_0x6118('0x13')](_0x2b2dfe);return _0x57aec2[_0x6118('0x17')](_0x6118('0x18'),_0xc40c09+'-'+_0x2f2583+'/'+_0x1b6d28)[_0x6118('0x14')](_0x1ceb4a);}return null;};}function patchUpdates(_0xf11106){return function(_0x4e7734){try{jsonpatch['apply'](_0x4e7734,_0xf11106,!![]);}catch(_0x3371bd){return BPromise[_0x6118('0x19')](_0x3371bd);}return _0x4e7734[_0x6118('0x1a')]();};}function saveUpdates(_0x5cf578,_0x5f01fe){return function(_0x8d23b3){if(_0x8d23b3){return _0x8d23b3[_0x6118('0x1b')](_0x5cf578)[_0x6118('0x1c')](function(_0xc4ae81){return _0xc4ae81;});}return null;};}function removeEntity(_0x341eeb,_0x4ef11f){return function(_0x51552e){if(_0x51552e){return _0x51552e['destroy']()[_0x6118('0x1c')](function(){_0x341eeb[_0x6118('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x521b3e,_0x570ec1){return function(_0x3c6a9e){if(!_0x3c6a9e){_0x521b3e['sendStatus'](0x194);}return _0x3c6a9e;};}function handleError(_0x269ca5,_0x2dc13b){_0x2dc13b=_0x2dc13b||0x1f4;return function(_0x204a1c){logger['error'](_0x204a1c[_0x6118('0x1d')]);if(_0x204a1c[_0x6118('0x1e')]){delete _0x204a1c[_0x6118('0x1e')];}_0x269ca5[_0x6118('0x13')](_0x2dc13b)[_0x6118('0x1f')](_0x204a1c);};}exports[_0x6118('0x20')]=function(_0x57dd63,_0x274fff){var _0x15fd58={},_0x4b50be={},_0x3e278a={'count':0x0,'rows':[]};var _0x23fb10=db[_0x6118('0x21')][_0x6118('0x22')];_0x4b50be['model']=_[_0x6118('0x23')](_0x23fb10);_0x4b50be[_0x6118('0x24')]=_['keys'](_0x57dd63[_0x6118('0x24')]);_0x4b50be[_0x6118('0x25')]=_['intersection'](_0x4b50be[_0x6118('0x26')],_0x4b50be[_0x6118('0x24')]);_0x15fd58['attributes']=_[_0x6118('0x27')](_0x4b50be[_0x6118('0x26')],qs['fields'](_0x57dd63['query']['fields']));_0x15fd58['attributes']=_0x15fd58['attributes']['length']?_0x15fd58['attributes']:_0x4b50be['model'];if(!_0x57dd63[_0x6118('0x24')][_0x6118('0x28')](_0x6118('0x29'))){_0x15fd58[_0x6118('0x16')]=qs[_0x6118('0x16')](_0x57dd63[_0x6118('0x24')][_0x6118('0x16')]);_0x15fd58['offset']=qs[_0x6118('0x15')](_0x57dd63[_0x6118('0x24')]['offset']);}_0x15fd58['order']=qs['sort'](_0x57dd63[_0x6118('0x24')]['sort']);_0x15fd58[_0x6118('0x2a')]=qs['filters'](_[_0x6118('0x2b')](_0x57dd63[_0x6118('0x24')],_0x4b50be[_0x6118('0x25')]));if(_0x57dd63[_0x6118('0x24')]['filter']){_0x15fd58[_0x6118('0x2a')]=_[_0x6118('0x2c')](_0x15fd58[_0x6118('0x2a')],{'$or':_['map'](_0x23fb10,function(_0x421f2b){if(_0x421f2b['type'][_0x6118('0x2d')]!=='VIRTUAL'){var _0x274662={};_0x274662[_0x421f2b[_0x6118('0x2e')]]={'$like':'%'+_0x57dd63[_0x6118('0x24')][_0x6118('0x2f')]+'%'};return _0x274662;}})});}_0x15fd58=_['merge']({},_0x15fd58,_0x57dd63[_0x6118('0x30')]);var _0xa146c5={'where':_0x15fd58['where']};return db[_0x6118('0x21')][_0x6118('0x31')](_0xa146c5)[_0x6118('0x1c')](function(_0x11711f){_0x3e278a['count']=_0x11711f;if(_0x57dd63[_0x6118('0x24')][_0x6118('0x32')]){_0x15fd58[_0x6118('0x33')]=[{'all':!![]}];}return db[_0x6118('0x21')]['findAll'](_0x15fd58);})['then'](function(_0x23f67e){_0x3e278a[_0x6118('0x34')]=_0x23f67e;return _0x3e278a;})[_0x6118('0x1c')](respondWithFilteredResult(_0x274fff,_0x15fd58))['catch'](handleError(_0x274fff,null));};exports['show']=function(_0x44b476,_0x3d86a5){var _0x3d0b54={'raw':!![],'where':{'id':_0x44b476[_0x6118('0x35')]['id']}},_0x436382={};_0x436382[_0x6118('0x26')]=_[_0x6118('0x23')](db[_0x6118('0x21')][_0x6118('0x22')]);_0x436382[_0x6118('0x24')]=_[_0x6118('0x23')](_0x44b476[_0x6118('0x24')]);_0x436382[_0x6118('0x25')]=_[_0x6118('0x27')](_0x436382['model'],_0x436382[_0x6118('0x24')]);_0x3d0b54[_0x6118('0x36')]=_[_0x6118('0x27')](_0x436382[_0x6118('0x26')],qs['fields'](_0x44b476[_0x6118('0x24')][_0x6118('0x37')]));_0x3d0b54[_0x6118('0x36')]=_0x3d0b54['attributes'][_0x6118('0x38')]?_0x3d0b54[_0x6118('0x36')]:_0x436382[_0x6118('0x26')];if(_0x44b476[_0x6118('0x24')][_0x6118('0x32')]){_0x3d0b54[_0x6118('0x33')]=[{'all':!![]}];}_0x3d0b54=_[_0x6118('0x2c')]({},_0x3d0b54,_0x44b476['options']);return db[_0x6118('0x21')][_0x6118('0x39')](_0x3d0b54)[_0x6118('0x1c')](handleEntityNotFound(_0x3d86a5,null))[_0x6118('0x1c')](respondWithResult(_0x3d86a5,null))[_0x6118('0x3a')](handleError(_0x3d86a5,null));};exports[_0x6118('0x3b')]=function(_0x28ea0b,_0x538331){return db[_0x6118('0x21')][_0x6118('0x3b')](_0x28ea0b[_0x6118('0x3c')],{})['then'](respondWithResult(_0x538331,0xc9))[_0x6118('0x3a')](handleError(_0x538331,null));};exports['update']=function(_0x2043be,_0x53f53d){if(_0x2043be[_0x6118('0x3c')]['id']){delete _0x2043be[_0x6118('0x3c')]['id'];}return db['FaxQueueReport'][_0x6118('0x39')]({'where':{'id':_0x2043be[_0x6118('0x35')]['id']}})[_0x6118('0x1c')](handleEntityNotFound(_0x53f53d,null))[_0x6118('0x1c')](saveUpdates(_0x2043be[_0x6118('0x3c')],null))['then'](respondWithResult(_0x53f53d,null))['catch'](handleError(_0x53f53d,null));};exports[_0x6118('0x3d')]=function(_0x1001b3,_0xa7e08c){return db['FaxQueueReport'][_0x6118('0x39')]({'where':{'id':_0x1001b3[_0x6118('0x35')]['id']}})[_0x6118('0x1c')](handleEntityNotFound(_0xa7e08c,null))[_0x6118('0x1c')](removeEntity(_0xa7e08c,null))['catch'](handleError(_0xa7e08c,null));};exports['describe']=function(_0xa357f8,_0x40588a){return db[_0x6118('0x21')][_0x6118('0x3e')]()['then'](respondWithResult(_0x40588a,null))[_0x6118('0x3a')](handleError(_0x40588a,null));}; \ No newline at end of file +var _0x7097=['findAll','rows','catch','show','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','merge','where','map','type','key','VIRTUAL','field','includeAll','include'];(function(_0x306aa3,_0x521e99){var _0x2d1a2a=function(_0x315428){while(--_0x315428){_0x306aa3['push'](_0x306aa3['shift']());}};_0x2d1a2a(++_0x521e99);}(_0x7097,0xe0));var _0x7709=function(_0x3e69be,_0x1176fb){_0x3e69be=_0x3e69be-0x0;var _0x182676=_0x7097[_0x3e69be];return _0x182676;};'use strict';var pdf=require(_0x7709('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7709('0x1'));var zipdir=require(_0x7709('0x2'));var jsonpatch=require(_0x7709('0x3'));var rp=require('request-promise');var moment=require(_0x7709('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7709('0x5'));var util=require(_0x7709('0x6'));var path=require(_0x7709('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7709('0x8'));var fs=require('fs');var _=require(_0x7709('0x9'));var squel=require(_0x7709('0xa'));var crypto=require(_0x7709('0xb'));var jsforce=require(_0x7709('0xc'));var deskjs=require(_0x7709('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7709('0xe'));var Redis=require(_0x7709('0xf'));var authService=require(_0x7709('0x10'));var qs=require(_0x7709('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7709('0x12'))('api');var utils=require(_0x7709('0x13'));var config=require(_0x7709('0x14'));var db=require(_0x7709('0x15'))['db'];function respondWithStatusCode(_0x448563,_0x50ce08){_0x50ce08=_0x50ce08||0xcc;return function(_0xb5deb5){if(_0xb5deb5){return _0x448563[_0x7709('0x16')](_0x50ce08);}return _0x448563[_0x7709('0x17')](_0x50ce08)[_0x7709('0x18')]();};}function respondWithResult(_0x51dd93,_0x4d9887){_0x4d9887=_0x4d9887||0xc8;return function(_0x545d67){if(_0x545d67){return _0x51dd93[_0x7709('0x17')](_0x4d9887)[_0x7709('0x19')](_0x545d67);}};}function respondWithFilteredResult(_0x2a83f3,_0x168256){return function(_0x29d38a){if(_0x29d38a){var _0xcdc0ae=_0x29d38a[_0x7709('0x1a')],_0x20c6d8=_0x168256[_0x7709('0x1b')],_0x34a40b=_0x168256[_0x7709('0x1b')]+_0x168256[_0x7709('0x1c')],_0x52edfb;if(_0x34a40b>=_0xcdc0ae){_0x34a40b=_0xcdc0ae;_0x52edfb=0xc8;}else{_0x52edfb=0xce;}_0x2a83f3[_0x7709('0x17')](_0x52edfb);return _0x2a83f3['set'](_0x7709('0x1d'),_0x20c6d8+'-'+_0x34a40b+'/'+_0xcdc0ae)[_0x7709('0x19')](_0x29d38a);}return null;};}function patchUpdates(_0x469562){return function(_0x13ea00){try{jsonpatch[_0x7709('0x1e')](_0x13ea00,_0x469562,!![]);}catch(_0xac282b){return BPromise[_0x7709('0x1f')](_0xac282b);}return _0x13ea00['save']();};}function saveUpdates(_0x353fb9,_0x13cd94){return function(_0x66cff3){if(_0x66cff3){return _0x66cff3[_0x7709('0x20')](_0x353fb9)[_0x7709('0x21')](function(_0x200e69){return _0x200e69;});}return null;};}function removeEntity(_0x14904d,_0x280b1b){return function(_0x1e66f2){if(_0x1e66f2){return _0x1e66f2[_0x7709('0x22')]()[_0x7709('0x21')](function(){_0x14904d[_0x7709('0x17')](0xcc)[_0x7709('0x18')]();});}};}function handleEntityNotFound(_0x126844,_0x549712){return function(_0x18a4ba){if(!_0x18a4ba){_0x126844[_0x7709('0x16')](0x194);}return _0x18a4ba;};}function handleError(_0x2305b7,_0xe39345){_0xe39345=_0xe39345||0x1f4;return function(_0x34f5d4){logger[_0x7709('0x23')](_0x34f5d4[_0x7709('0x24')]);if(_0x34f5d4[_0x7709('0x25')]){delete _0x34f5d4[_0x7709('0x25')];}_0x2305b7[_0x7709('0x17')](_0xe39345)[_0x7709('0x26')](_0x34f5d4);};}exports[_0x7709('0x27')]=function(_0x5643d0,_0x4a1056){var _0x417b57={},_0x47868e={},_0xe1f504={'count':0x0,'rows':[]};var _0x3acab5=db[_0x7709('0x28')][_0x7709('0x29')];_0x47868e[_0x7709('0x2a')]=_['keys'](_0x3acab5);_0x47868e[_0x7709('0x2b')]=_[_0x7709('0x2c')](_0x5643d0[_0x7709('0x2b')]);_0x47868e['filters']=_[_0x7709('0x2d')](_0x47868e[_0x7709('0x2a')],_0x47868e['query']);_0x417b57[_0x7709('0x2e')]=_[_0x7709('0x2d')](_0x47868e[_0x7709('0x2a')],qs[_0x7709('0x2f')](_0x5643d0['query'][_0x7709('0x2f')]));_0x417b57[_0x7709('0x2e')]=_0x417b57[_0x7709('0x2e')][_0x7709('0x30')]?_0x417b57[_0x7709('0x2e')]:_0x47868e['model'];if(!_0x5643d0[_0x7709('0x2b')][_0x7709('0x31')]('nolimit')){_0x417b57[_0x7709('0x1c')]=qs[_0x7709('0x1c')](_0x5643d0[_0x7709('0x2b')]['limit']);_0x417b57[_0x7709('0x1b')]=qs[_0x7709('0x1b')](_0x5643d0[_0x7709('0x2b')]['offset']);}_0x417b57[_0x7709('0x32')]=qs[_0x7709('0x33')](_0x5643d0[_0x7709('0x2b')][_0x7709('0x33')]);_0x417b57['where']=qs['filters'](_[_0x7709('0x34')](_0x5643d0[_0x7709('0x2b')],_0x47868e[_0x7709('0x35')]));if(_0x5643d0[_0x7709('0x2b')][_0x7709('0x36')]){_0x417b57['where']=_[_0x7709('0x37')](_0x417b57[_0x7709('0x38')],{'$or':_[_0x7709('0x39')](_0x3acab5,function(_0x484294){if(_0x484294[_0x7709('0x3a')][_0x7709('0x3b')]!==_0x7709('0x3c')){var _0x5a9c9a={};_0x5a9c9a[_0x484294[_0x7709('0x3d')]]={'$like':'%'+_0x5643d0[_0x7709('0x2b')][_0x7709('0x36')]+'%'};return _0x5a9c9a;}})});}_0x417b57=_[_0x7709('0x37')]({},_0x417b57,_0x5643d0['options']);var _0x4d3a70={'where':_0x417b57[_0x7709('0x38')]};return db[_0x7709('0x28')][_0x7709('0x1a')](_0x4d3a70)[_0x7709('0x21')](function(_0x27c655){_0xe1f504[_0x7709('0x1a')]=_0x27c655;if(_0x5643d0['query'][_0x7709('0x3e')]){_0x417b57[_0x7709('0x3f')]=[{'all':!![]}];}return db[_0x7709('0x28')][_0x7709('0x40')](_0x417b57);})[_0x7709('0x21')](function(_0x37cf7f){_0xe1f504[_0x7709('0x41')]=_0x37cf7f;return _0xe1f504;})[_0x7709('0x21')](respondWithFilteredResult(_0x4a1056,_0x417b57))[_0x7709('0x42')](handleError(_0x4a1056,null));};exports[_0x7709('0x43')]=function(_0x34257c,_0x3fc2e7){var _0x27c804={'raw':!![],'where':{'id':_0x34257c['params']['id']}},_0x249191={};_0x249191[_0x7709('0x2a')]=_[_0x7709('0x2c')](db[_0x7709('0x28')][_0x7709('0x29')]);_0x249191[_0x7709('0x2b')]=_[_0x7709('0x2c')](_0x34257c['query']);_0x249191[_0x7709('0x35')]=_[_0x7709('0x2d')](_0x249191[_0x7709('0x2a')],_0x249191[_0x7709('0x2b')]);_0x27c804[_0x7709('0x2e')]=_[_0x7709('0x2d')](_0x249191[_0x7709('0x2a')],qs[_0x7709('0x2f')](_0x34257c[_0x7709('0x2b')][_0x7709('0x2f')]));_0x27c804[_0x7709('0x2e')]=_0x27c804[_0x7709('0x2e')][_0x7709('0x30')]?_0x27c804['attributes']:_0x249191[_0x7709('0x2a')];if(_0x34257c[_0x7709('0x2b')]['includeAll']){_0x27c804[_0x7709('0x3f')]=[{'all':!![]}];}_0x27c804=_[_0x7709('0x37')]({},_0x27c804,_0x34257c['options']);return db[_0x7709('0x28')]['find'](_0x27c804)[_0x7709('0x21')](handleEntityNotFound(_0x3fc2e7,null))[_0x7709('0x21')](respondWithResult(_0x3fc2e7,null))[_0x7709('0x42')](handleError(_0x3fc2e7,null));};exports[_0x7709('0x44')]=function(_0x5593e8,_0x5b0138){return db[_0x7709('0x28')][_0x7709('0x44')](_0x5593e8['body'],{})['then'](respondWithResult(_0x5b0138,0xc9))['catch'](handleError(_0x5b0138,null));};exports[_0x7709('0x20')]=function(_0x1e584b,_0x3c0aca){if(_0x1e584b['body']['id']){delete _0x1e584b[_0x7709('0x45')]['id'];}return db[_0x7709('0x28')]['find']({'where':{'id':_0x1e584b[_0x7709('0x46')]['id']}})[_0x7709('0x21')](handleEntityNotFound(_0x3c0aca,null))[_0x7709('0x21')](saveUpdates(_0x1e584b['body'],null))[_0x7709('0x21')](respondWithResult(_0x3c0aca,null))[_0x7709('0x42')](handleError(_0x3c0aca,null));};exports[_0x7709('0x22')]=function(_0x4ed222,_0x16dc2c){return db[_0x7709('0x28')]['find']({'where':{'id':_0x4ed222[_0x7709('0x46')]['id']}})[_0x7709('0x21')](handleEntityNotFound(_0x16dc2c,null))[_0x7709('0x21')](removeEntity(_0x16dc2c,null))[_0x7709('0x42')](handleError(_0x16dc2c,null));};exports[_0x7709('0x47')]=function(_0x26d625,_0x21fe64){return db[_0x7709('0x28')]['describe']()[_0x7709('0x21')](respondWithResult(_0x21fe64,null))[_0x7709('0x42')](handleError(_0x21fe64,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 679ff04..d0074d7 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 _0x8e06=['uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue'];(function(_0x2a41a9,_0x569e2e){var _0x470725=function(_0x208a9b){while(--_0x208a9b){_0x2a41a9['push'](_0x2a41a9['shift']());}};_0x470725(++_0x569e2e);}(_0x8e06,0xc4));var _0x68e0=function(_0xc2d26f,_0x180ccf){_0xc2d26f=_0xc2d26f-0x0;var _0x50e707=_0x8e06[_0xc2d26f];return _0x50e707;};'use strict';var _=require(_0x68e0('0x0'));var util=require('util');var logger=require(_0x68e0('0x1'))(_0x68e0('0x2'));var moment=require(_0x68e0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x68e0('0x4'));var rimraf=require(_0x68e0('0x5'));var config=require(_0x68e0('0x6'));var attributes=require(_0x68e0('0x7'));module[_0x68e0('0x8')]=function(_0x589896,_0x139404){return _0x589896[_0x68e0('0x9')](_0x68e0('0xa'),attributes,{'tableName':_0x68e0('0xb'),'paranoid':![],'indexes':[{'name':_0x68e0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9754=['define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','./faxQueueReport.attributes','exports'];(function(_0xc0cbf,_0x22f493){var _0x24a0ac=function(_0x33e3c9){while(--_0x33e3c9){_0xc0cbf['push'](_0xc0cbf['shift']());}};_0x24a0ac(++_0x22f493);}(_0x9754,0x197));var _0x4975=function(_0x25f9f4,_0x4caec5){_0x25f9f4=_0x25f9f4-0x0;var _0x498257=_0x9754[_0x25f9f4];return _0x498257;};'use strict';var _=require(_0x4975('0x0'));var util=require(_0x4975('0x1'));var logger=require('../../config/logger')(_0x4975('0x2'));var moment=require(_0x4975('0x3'));var BPromise=require(_0x4975('0x4'));var rp=require(_0x4975('0x5'));var fs=require('fs');var path=require(_0x4975('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4975('0x7'));module[_0x4975('0x8')]=function(_0x6ba095,_0x51d764){return _0x6ba095[_0x4975('0x9')](_0x4975('0xa'),attributes,{'tableName':_0x4975('0xb'),'paranoid':![],'indexes':[{'name':_0x4975('0xc'),'fields':[_0x4975('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index f839d23..1095b4b 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 _0xf12a=['debug','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf12a,0x8e));var _0xaf12=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0xf12a[_0x18a577];return _0x1cb0c7;};'use strict';var _=require(_0xaf12('0x0'));var util=require(_0xaf12('0x1'));var moment=require(_0xaf12('0x2'));var BPromise=require(_0xaf12('0x3'));var rs=require(_0xaf12('0x4'));var fs=require('fs');var Redis=require(_0xaf12('0x5'));var db=require(_0xaf12('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf12('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf12('0x8'));var client=jayson['client'][_0xaf12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x581819,_0x38389d,_0x418c64){return new BPromise(function(_0x3b6626,_0xff1952){return client[_0xaf12('0xa')](_0x581819,_0x418c64)[_0xaf12('0xb')](function(_0x3d733d){logger[_0xaf12('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x38389d,_0xaf12('0xd'));logger['debug'](_0xaf12('0xe'),_0x38389d,'request\x20sent',JSON[_0xaf12('0xf')](_0x3d733d));if(_0x3d733d['error']){if(_0x3d733d['error'][_0xaf12('0x10')]===0x1f4){logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0xff1952(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0x3b6626(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}else{logger[_0xaf12('0xc')](_0xaf12('0x12'),_0x38389d,_0xaf12('0xd'));_0x3b6626(_0x3d733d[_0xaf12('0x14')]['message']);}})[_0xaf12('0x15')](function(_0x31a420){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x38389d,_0x31a420);_0xff1952(_0x31a420);});});}exports['CreateFaxQueueReport']=function(_0xd0c5f){var _0x4cc0a4=this;return new Promise(function(_0x3530a8,_0x516bad){return db[_0xaf12('0x16')][_0xaf12('0x17')](_0xd0c5f[_0xaf12('0x18')],{'raw':_0xd0c5f[_0xaf12('0x19')]?_0xd0c5f['options'][_0xaf12('0x1a')]===undefined?!![]:![]:!![]})[_0xaf12('0xb')](function(_0x3e81ce){logger[_0xaf12('0xc')](_0xaf12('0x1b'),_0xd0c5f);logger[_0xaf12('0x1c')](_0xaf12('0x1b'),_0xd0c5f,JSON[_0xaf12('0xf')](_0x3e81ce));_0x3530a8(_0x3e81ce);})[_0xaf12('0x15')](function(_0x41f9f7){logger[_0xaf12('0x11')](_0xaf12('0x1b'),_0x41f9f7[_0xaf12('0x13')],_0xd0c5f);_0x516bad(_0x4cc0a4['error'](0x1f4,_0x41f9f7[_0xaf12('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x576fd4){var _0x26e97a=this;return new Promise(function(_0x2fb1a8,_0x1b66bc){return db['FaxQueueReport'][_0xaf12('0x1d')](_0x576fd4[_0xaf12('0x18')],{'raw':_0x576fd4['options']?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576fd4[_0xaf12('0x19')]?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1e')]||null:null,'attributes':_0x576fd4[_0xaf12('0x19')]?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1f')]||null:null,'limit':_0x576fd4[_0xaf12('0x19')]?_0x576fd4['options'][_0xaf12('0x20')]||null:null})['then'](function(_0x39b12f){logger[_0xaf12('0xc')](_0xaf12('0x21'),_0x576fd4);logger['debug']('UpdateFaxQueueReport',_0x576fd4,JSON['stringify'](_0x39b12f));_0x2fb1a8(_0x39b12f);})['catch'](function(_0x5484c8){logger['error'](_0xaf12('0x21'),_0x5484c8[_0xaf12('0x13')],_0x576fd4);_0x1b66bc(_0x26e97a[_0xaf12('0x11')](0x1f4,_0x5484c8[_0xaf12('0x13')]));});});}; \ No newline at end of file +var _0x6f59=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','update','where','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x35bb03,_0x27f988){var _0x4d70a6=function(_0x2bc89f){while(--_0x2bc89f){_0x35bb03['push'](_0x35bb03['shift']());}};_0x4d70a6(++_0x27f988);}(_0x6f59,0x1be));var _0x96f5=function(_0x13c7c5,_0x1d0773){_0x13c7c5=_0x13c7c5-0x0;var _0x3c1df0=_0x6f59[_0x13c7c5];return _0x3c1df0;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var moment=require(_0x96f5('0x2'));var BPromise=require(_0x96f5('0x3'));var rs=require(_0x96f5('0x4'));var fs=require('fs');var Redis=require(_0x96f5('0x5'));var db=require(_0x96f5('0x6'))['db'];var utils=require(_0x96f5('0x7'));var logger=require(_0x96f5('0x8'))(_0x96f5('0x9'));var config=require(_0x96f5('0xa'));var jayson=require(_0x96f5('0xb'));var client=jayson['client'][_0x96f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57fc51,_0x2591a5,_0x4c919b){return new BPromise(function(_0x21dbf3,_0x4b6748){return client[_0x96f5('0xd')](_0x57fc51,_0x4c919b)[_0x96f5('0xe')](function(_0x3064bd){logger[_0x96f5('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2591a5,_0x96f5('0x10'));logger[_0x96f5('0x11')](_0x96f5('0x12'),_0x2591a5,_0x96f5('0x10'),JSON[_0x96f5('0x13')](_0x3064bd));if(_0x3064bd[_0x96f5('0x14')]){if(_0x3064bd[_0x96f5('0x14')][_0x96f5('0x15')]===0x1f4){logger[_0x96f5('0x14')](_0x96f5('0x16'),_0x2591a5,_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);return _0x4b6748(_0x3064bd[_0x96f5('0x14')]['message']);}logger[_0x96f5('0x14')](_0x96f5('0x16'),_0x2591a5,_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);return _0x21dbf3(_0x3064bd[_0x96f5('0x14')][_0x96f5('0x17')]);}else{logger['info'](_0x96f5('0x16'),_0x2591a5,'request\x20sent');_0x21dbf3(_0x3064bd[_0x96f5('0x18')][_0x96f5('0x17')]);}})[_0x96f5('0x19')](function(_0x40c088){logger[_0x96f5('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x2591a5,_0x40c088);_0x4b6748(_0x40c088);});});}exports[_0x96f5('0x1a')]=function(_0x4f19c3){var _0x35db9e=this;return new Promise(function(_0x5b6d40,_0x2523d0){return db[_0x96f5('0x1b')]['create'](_0x4f19c3[_0x96f5('0x1c')],{'raw':_0x4f19c3['options']?_0x4f19c3[_0x96f5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x96f5('0xe')](function(_0x212f41){logger['info'](_0x96f5('0x1a'),_0x4f19c3);logger[_0x96f5('0x11')](_0x96f5('0x1a'),_0x4f19c3,JSON[_0x96f5('0x13')](_0x212f41));_0x5b6d40(_0x212f41);})[_0x96f5('0x19')](function(_0xae4a2a){logger[_0x96f5('0x14')](_0x96f5('0x1a'),_0xae4a2a[_0x96f5('0x17')],_0x4f19c3);_0x2523d0(_0x35db9e[_0x96f5('0x14')](0x1f4,_0xae4a2a[_0x96f5('0x17')]));});});};exports['UpdateFaxQueueReport']=function(_0x119fd3){var _0x5619c9=this;return new Promise(function(_0x89f78d,_0x413769){return db[_0x96f5('0x1b')][_0x96f5('0x1e')](_0x119fd3[_0x96f5('0x1c')],{'raw':_0x119fd3['options']?_0x119fd3[_0x96f5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')][_0x96f5('0x1f')]||null:null,'attributes':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')]['attributes']||null:null,'limit':_0x119fd3[_0x96f5('0x1d')]?_0x119fd3[_0x96f5('0x1d')]['limit']||null:null})['then'](function(_0x53d715){logger['info'](_0x96f5('0x20'),_0x119fd3);logger[_0x96f5('0x11')](_0x96f5('0x20'),_0x119fd3,JSON['stringify'](_0x53d715));_0x89f78d(_0x53d715);})['catch'](function(_0xdae513){logger[_0x96f5('0x14')](_0x96f5('0x20'),_0xdae513[_0x96f5('0x17')],_0x119fd3);_0x413769(_0x5619c9['error'](0x1f4,_0xdae513[_0x96f5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 33c2207..cbcc3c9 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 _0xfa9f=['../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ab41e,_0x50bef3){var _0x46817c=function(_0x288cde){while(--_0x288cde){_0x3ab41e['push'](_0x3ab41e['shift']());}};_0x46817c(++_0x50bef3);}(_0xfa9f,0x100));var _0xffa9=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0xfa9f[_0x2f037f];return _0x2d1573;};'use strict';var multer=require(_0xffa9('0x0'));var util=require(_0xffa9('0x1'));var path=require(_0xffa9('0x2'));var timeout=require(_0xffa9('0x3'));var express=require(_0xffa9('0x4'));var router=express[_0xffa9('0x5')]();var auth=require(_0xffa9('0x6'));var interaction=require(_0xffa9('0x7'));var config=require(_0xffa9('0x8'));var controller=require(_0xffa9('0x9'));router[_0xffa9('0xa')]('/',auth[_0xffa9('0xb')](),controller[_0xffa9('0xc')]);router[_0xffa9('0xa')](_0xffa9('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xffa9('0xa')]('/:id',auth[_0xffa9('0xb')](),controller[_0xffa9('0xe')]);router['post']('/',auth[_0xffa9('0xb')](),controller[_0xffa9('0xf')]);router[_0xffa9('0x10')](_0xffa9('0x11'),auth['isAuthenticated'](),controller[_0xffa9('0x12')]);router[_0xffa9('0x13')](_0xffa9('0x11'),auth[_0xffa9('0xb')](),controller[_0xffa9('0x14')]);module[_0xffa9('0x15')]=router; \ No newline at end of file +var _0xff04=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x17ab45,_0x1a9bfa){var _0x2651c0=function(_0x146148){while(--_0x146148){_0x17ab45['push'](_0x17ab45['shift']());}};_0x2651c0(++_0x1a9bfa);}(_0xff04,0x1df));var _0x4ff0=function(_0x3761cc,_0x4ee126){_0x3761cc=_0x3761cc-0x0;var _0x3a9521=_0xff04[_0x3761cc];return _0x3a9521;};'use strict';var multer=require(_0x4ff0('0x0'));var util=require(_0x4ff0('0x1'));var path=require(_0x4ff0('0x2'));var timeout=require(_0x4ff0('0x3'));var express=require(_0x4ff0('0x4'));var router=express[_0x4ff0('0x5')]();var auth=require(_0x4ff0('0x6'));var interaction=require(_0x4ff0('0x7'));var config=require(_0x4ff0('0x8'));var controller=require(_0x4ff0('0x9'));router[_0x4ff0('0xa')]('/',auth[_0x4ff0('0xb')](),controller[_0x4ff0('0xc')]);router[_0x4ff0('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4ff0('0xd')]);router[_0x4ff0('0xa')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller[_0x4ff0('0xf')]);router[_0x4ff0('0x10')]('/',auth['isAuthenticated'](),controller[_0x4ff0('0x11')]);router[_0x4ff0('0x12')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller[_0x4ff0('0x13')]);router[_0x4ff0('0x14')](_0x4ff0('0xe'),auth[_0x4ff0('0xb')](),controller['destroy']);module[_0x4ff0('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 49a31e8..6406259 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 _0x5cf4=['agent','queue','NOW','sequelize','ENUM','account'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x5cf4,0x99));var _0x45cf=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x5cf4[_0x2b8077];return _0x308091;};'use strict';var moment=require('moment');var Sequelize=require(_0x45cf('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45cf('0x1')](_0x45cf('0x2'),_0x45cf('0x3'),'queue'),'allowNull':![],'defaultValue':_0x45cf('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x45cf('0x5')]}}; \ No newline at end of file +var _0x9d50=['agent','queue','DATE','NOW','moment','sequelize','STRING','ENUM','account'];(function(_0x2b46ae,_0xae0e7c){var _0x237cef=function(_0x3379b8){while(--_0x3379b8){_0x2b46ae['push'](_0x2b46ae['shift']());}};_0x237cef(++_0xae0e7c);}(_0x9d50,0x1ab));var _0x09d5=function(_0x148c40,_0x8381bb){_0x148c40=_0x148c40-0x0;var _0x53193a=_0x9d50[_0x148c40];return _0x53193a;};'use strict';var moment=require(_0x09d5('0x0'));var Sequelize=require(_0x09d5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x09d5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x09d5('0x3')](_0x09d5('0x4'),_0x09d5('0x5'),'queue'),'allowNull':![],'defaultValue':_0x09d5('0x6')},'transferredAt':{'type':Sequelize[_0x09d5('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x09d5('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 7bcd498..947449c 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 _0x3c61=['map','type','VIRTUAL','field','options','FaxTransferReport','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge'];(function(_0x236a8d,_0x2e9b1d){var _0x212efe=function(_0xe70882){while(--_0xe70882){_0x236a8d['push'](_0x236a8d['shift']());}};_0x212efe(++_0x2e9b1d);}(_0x3c61,0x1c7));var _0x13c6=function(_0x30e7b5,_0x5ce937){_0x30e7b5=_0x30e7b5-0x0;var _0x216457=_0x3c61[_0x30e7b5];return _0x216457;};'use strict';var pdf=require(_0x13c6('0x0'));var emlformat=require(_0x13c6('0x1'));var rimraf=require(_0x13c6('0x2'));var zipdir=require(_0x13c6('0x3'));var jsonpatch=require(_0x13c6('0x4'));var rp=require(_0x13c6('0x5'));var moment=require(_0x13c6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x13c6('0x7'));var util=require(_0x13c6('0x8'));var path=require('path');var sox=require(_0x13c6('0x9'));var csv=require(_0x13c6('0xa'));var ejs=require(_0x13c6('0xb'));var fs=require('fs');var _=require(_0x13c6('0xc'));var squel=require(_0x13c6('0xd'));var crypto=require(_0x13c6('0xe'));var jsforce=require(_0x13c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x13c6('0xa'));var querystring=require(_0x13c6('0x10'));var Papa=require(_0x13c6('0x11'));var Redis=require('ioredis');var authService=require(_0x13c6('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13c6('0x13'))('api');var utils=require(_0x13c6('0x14'));var config=require(_0x13c6('0x15'));var db=require(_0x13c6('0x16'))['db'];function respondWithStatusCode(_0x190128,_0xaa648e){_0xaa648e=_0xaa648e||0xcc;return function(_0x569a65){if(_0x569a65){return _0x190128[_0x13c6('0x17')](_0xaa648e);}return _0x190128[_0x13c6('0x18')](_0xaa648e)[_0x13c6('0x19')]();};}function respondWithResult(_0x1a56bf,_0x721d78){_0x721d78=_0x721d78||0xc8;return function(_0x2e9dd8){if(_0x2e9dd8){return _0x1a56bf[_0x13c6('0x18')](_0x721d78)[_0x13c6('0x1a')](_0x2e9dd8);}};}function respondWithFilteredResult(_0x5d1b6b,_0x25a7ea){return function(_0x5f0f01){if(_0x5f0f01){var _0x3b0cf5=_0x5f0f01[_0x13c6('0x1b')],_0x10d925=_0x25a7ea[_0x13c6('0x1c')],_0x44558e=_0x25a7ea[_0x13c6('0x1c')]+_0x25a7ea[_0x13c6('0x1d')],_0x3bb8ba;if(_0x44558e>=_0x3b0cf5){_0x44558e=_0x3b0cf5;_0x3bb8ba=0xc8;}else{_0x3bb8ba=0xce;}_0x5d1b6b[_0x13c6('0x18')](_0x3bb8ba);return _0x5d1b6b[_0x13c6('0x1e')](_0x13c6('0x1f'),_0x10d925+'-'+_0x44558e+'/'+_0x3b0cf5)['json'](_0x5f0f01);}return null;};}function patchUpdates(_0x2eca95){return function(_0x3ebc56){try{jsonpatch['apply'](_0x3ebc56,_0x2eca95,!![]);}catch(_0x144a9d){return BPromise['reject'](_0x144a9d);}return _0x3ebc56[_0x13c6('0x20')]();};}function saveUpdates(_0x59c442,_0x182a20){return function(_0x1c62e2){if(_0x1c62e2){return _0x1c62e2[_0x13c6('0x21')](_0x59c442)[_0x13c6('0x22')](function(_0x3226c9){return _0x3226c9;});}return null;};}function removeEntity(_0x81e7bd,_0x5ac38a){return function(_0x208bee){if(_0x208bee){return _0x208bee[_0x13c6('0x23')]()['then'](function(){_0x81e7bd[_0x13c6('0x18')](0xcc)[_0x13c6('0x19')]();});}};}function handleEntityNotFound(_0x3ace42,_0x5c2397){return function(_0x4dc2f3){if(!_0x4dc2f3){_0x3ace42['sendStatus'](0x194);}return _0x4dc2f3;};}function handleError(_0x1089d7,_0x3d29a8){_0x3d29a8=_0x3d29a8||0x1f4;return function(_0x2ede6e){logger[_0x13c6('0x24')](_0x2ede6e['stack']);if(_0x2ede6e[_0x13c6('0x25')]){delete _0x2ede6e[_0x13c6('0x25')];}_0x1089d7[_0x13c6('0x18')](_0x3d29a8)[_0x13c6('0x26')](_0x2ede6e);};}exports[_0x13c6('0x27')]=function(_0xedc225,_0x375f4a){var _0x2f55c3={},_0x92ff9={},_0x43d718={'count':0x0,'rows':[]};var _0x3e236a=db['FaxTransferReport'][_0x13c6('0x28')];_0x92ff9['model']=_['keys'](_0x3e236a);_0x92ff9[_0x13c6('0x29')]=_['keys'](_0xedc225[_0x13c6('0x29')]);_0x92ff9['filters']=_[_0x13c6('0x2a')](_0x92ff9[_0x13c6('0x2b')],_0x92ff9[_0x13c6('0x29')]);_0x2f55c3[_0x13c6('0x2c')]=_['intersection'](_0x92ff9[_0x13c6('0x2b')],qs[_0x13c6('0x2d')](_0xedc225['query'][_0x13c6('0x2d')]));_0x2f55c3[_0x13c6('0x2c')]=_0x2f55c3[_0x13c6('0x2c')][_0x13c6('0x2e')]?_0x2f55c3[_0x13c6('0x2c')]:_0x92ff9[_0x13c6('0x2b')];if(!_0xedc225[_0x13c6('0x29')][_0x13c6('0x2f')](_0x13c6('0x30'))){_0x2f55c3[_0x13c6('0x1d')]=qs[_0x13c6('0x1d')](_0xedc225[_0x13c6('0x29')][_0x13c6('0x1d')]);_0x2f55c3[_0x13c6('0x1c')]=qs[_0x13c6('0x1c')](_0xedc225[_0x13c6('0x29')][_0x13c6('0x1c')]);}_0x2f55c3[_0x13c6('0x31')]=qs[_0x13c6('0x32')](_0xedc225[_0x13c6('0x29')]['sort']);_0x2f55c3['where']=qs[_0x13c6('0x33')](_[_0x13c6('0x34')](_0xedc225[_0x13c6('0x29')],_0x92ff9[_0x13c6('0x33')]));if(_0xedc225[_0x13c6('0x29')][_0x13c6('0x35')]){_0x2f55c3[_0x13c6('0x36')]=_[_0x13c6('0x37')](_0x2f55c3[_0x13c6('0x36')],{'$or':_[_0x13c6('0x38')](_0x3e236a,function(_0x395a85){if(_0x395a85[_0x13c6('0x39')]['key']!==_0x13c6('0x3a')){var _0x31018c={};_0x31018c[_0x395a85[_0x13c6('0x3b')]]={'$like':'%'+_0xedc225[_0x13c6('0x29')][_0x13c6('0x35')]+'%'};return _0x31018c;}})});}_0x2f55c3=_['merge']({},_0x2f55c3,_0xedc225[_0x13c6('0x3c')]);var _0x1daeec={'where':_0x2f55c3['where']};return db[_0x13c6('0x3d')][_0x13c6('0x1b')](_0x1daeec)['then'](function(_0x1a916c){_0x43d718[_0x13c6('0x1b')]=_0x1a916c;if(_0xedc225['query']['includeAll']){_0x2f55c3[_0x13c6('0x3e')]=[{'all':!![]}];}return db[_0x13c6('0x3d')][_0x13c6('0x3f')](_0x2f55c3);})[_0x13c6('0x22')](function(_0xf22d3b){_0x43d718['rows']=_0xf22d3b;return _0x43d718;})[_0x13c6('0x22')](respondWithFilteredResult(_0x375f4a,_0x2f55c3))[_0x13c6('0x40')](handleError(_0x375f4a,null));};exports[_0x13c6('0x41')]=function(_0x49f90a,_0x331157){var _0x5a378b={'raw':!![],'where':{'id':_0x49f90a[_0x13c6('0x42')]['id']}},_0x4cd049={};_0x4cd049['model']=_[_0x13c6('0x43')](db['FaxTransferReport']['rawAttributes']);_0x4cd049['query']=_[_0x13c6('0x43')](_0x49f90a[_0x13c6('0x29')]);_0x4cd049[_0x13c6('0x33')]=_['intersection'](_0x4cd049[_0x13c6('0x2b')],_0x4cd049[_0x13c6('0x29')]);_0x5a378b[_0x13c6('0x2c')]=_[_0x13c6('0x2a')](_0x4cd049['model'],qs['fields'](_0x49f90a[_0x13c6('0x29')]['fields']));_0x5a378b['attributes']=_0x5a378b[_0x13c6('0x2c')]['length']?_0x5a378b[_0x13c6('0x2c')]:_0x4cd049[_0x13c6('0x2b')];if(_0x49f90a['query'][_0x13c6('0x44')]){_0x5a378b['include']=[{'all':!![]}];}_0x5a378b=_[_0x13c6('0x37')]({},_0x5a378b,_0x49f90a['options']);return db[_0x13c6('0x3d')][_0x13c6('0x45')](_0x5a378b)['then'](handleEntityNotFound(_0x331157,null))[_0x13c6('0x22')](respondWithResult(_0x331157,null))[_0x13c6('0x40')](handleError(_0x331157,null));};exports[_0x13c6('0x46')]=function(_0x148483,_0x4829da){return db[_0x13c6('0x3d')][_0x13c6('0x46')](_0x148483[_0x13c6('0x47')],{})[_0x13c6('0x22')](respondWithResult(_0x4829da,0xc9))[_0x13c6('0x40')](handleError(_0x4829da,null));};exports[_0x13c6('0x21')]=function(_0x58df71,_0x21997d){if(_0x58df71[_0x13c6('0x47')]['id']){delete _0x58df71['body']['id'];}return db[_0x13c6('0x3d')][_0x13c6('0x45')]({'where':{'id':_0x58df71[_0x13c6('0x42')]['id']}})['then'](handleEntityNotFound(_0x21997d,null))[_0x13c6('0x22')](saveUpdates(_0x58df71[_0x13c6('0x47')],null))[_0x13c6('0x22')](respondWithResult(_0x21997d,null))[_0x13c6('0x40')](handleError(_0x21997d,null));};exports['destroy']=function(_0x5d086e,_0x2395f6){return db[_0x13c6('0x3d')][_0x13c6('0x45')]({'where':{'id':_0x5d086e[_0x13c6('0x42')]['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x2395f6,null))[_0x13c6('0x22')](removeEntity(_0x2395f6,null))['catch'](handleError(_0x2395f6,null));};exports[_0x13c6('0x48')]=function(_0x448762,_0x22ab02){return db[_0x13c6('0x3d')][_0x13c6('0x48')]()['then'](respondWithResult(_0x22ab02,null))[_0x13c6('0x40')](handleError(_0x22ab02,null));}; \ No newline at end of file +var _0xa2b2=['includeAll','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','error','name','send','index','FaxTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','map','type','key','VIRTUAL','filter','options','include','findAll','rows','show','params'];(function(_0x42c3fb,_0x5174b3){var _0x36083c=function(_0x1b12d9){while(--_0x1b12d9){_0x42c3fb['push'](_0x42c3fb['shift']());}};_0x36083c(++_0x5174b3);}(_0xa2b2,0x1bd));var _0x2a2b=function(_0x285677,_0xcd32ab){_0x285677=_0x285677-0x0;var _0x3fae75=_0xa2b2[_0x285677];return _0x3fae75;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2a2b('0x0'));var zipdir=require(_0x2a2b('0x1'));var jsonpatch=require(_0x2a2b('0x2'));var rp=require(_0x2a2b('0x3'));var moment=require(_0x2a2b('0x4'));var BPromise=require(_0x2a2b('0x5'));var Mustache=require(_0x2a2b('0x6'));var util=require('util');var path=require(_0x2a2b('0x7'));var sox=require('sox');var csv=require(_0x2a2b('0x8'));var ejs=require(_0x2a2b('0x9'));var fs=require('fs');var _=require(_0x2a2b('0xa'));var squel=require(_0x2a2b('0xb'));var crypto=require(_0x2a2b('0xc'));var jsforce=require(_0x2a2b('0xd'));var deskjs=require(_0x2a2b('0xe'));var toCsv=require(_0x2a2b('0x8'));var querystring=require(_0x2a2b('0xf'));var Papa=require(_0x2a2b('0x10'));var Redis=require(_0x2a2b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a2b('0x12'));var logger=require(_0x2a2b('0x13'))(_0x2a2b('0x14'));var utils=require('../../config/utils');var config=require(_0x2a2b('0x15'));var db=require(_0x2a2b('0x16'))['db'];function respondWithStatusCode(_0x57d555,_0x4fdcc6){_0x4fdcc6=_0x4fdcc6||0xcc;return function(_0x7601e8){if(_0x7601e8){return _0x57d555[_0x2a2b('0x17')](_0x4fdcc6);}return _0x57d555[_0x2a2b('0x18')](_0x4fdcc6)[_0x2a2b('0x19')]();};}function respondWithResult(_0x5d7d59,_0x4596d7){_0x4596d7=_0x4596d7||0xc8;return function(_0x275f15){if(_0x275f15){return _0x5d7d59[_0x2a2b('0x18')](_0x4596d7)[_0x2a2b('0x1a')](_0x275f15);}};}function respondWithFilteredResult(_0xd742b5,_0x1ea33f){return function(_0x2a9761){if(_0x2a9761){var _0x9f69ed=_0x2a9761[_0x2a2b('0x1b')],_0x2ca985=_0x1ea33f[_0x2a2b('0x1c')],_0x5ba332=_0x1ea33f[_0x2a2b('0x1c')]+_0x1ea33f[_0x2a2b('0x1d')],_0x26a7b7;if(_0x5ba332>=_0x9f69ed){_0x5ba332=_0x9f69ed;_0x26a7b7=0xc8;}else{_0x26a7b7=0xce;}_0xd742b5[_0x2a2b('0x18')](_0x26a7b7);return _0xd742b5[_0x2a2b('0x1e')]('Content-Range',_0x2ca985+'-'+_0x5ba332+'/'+_0x9f69ed)[_0x2a2b('0x1a')](_0x2a9761);}return null;};}function patchUpdates(_0x566e09){return function(_0x42784a){try{jsonpatch['apply'](_0x42784a,_0x566e09,!![]);}catch(_0x54e45c){return BPromise[_0x2a2b('0x1f')](_0x54e45c);}return _0x42784a['save']();};}function saveUpdates(_0x23d41e,_0x13c6bf){return function(_0x41046d){if(_0x41046d){return _0x41046d[_0x2a2b('0x20')](_0x23d41e)['then'](function(_0xfc427b){return _0xfc427b;});}return null;};}function removeEntity(_0xed95e8,_0x549267){return function(_0x8b17f4){if(_0x8b17f4){return _0x8b17f4['destroy']()[_0x2a2b('0x21')](function(){_0xed95e8['status'](0xcc)[_0x2a2b('0x19')]();});}};}function handleEntityNotFound(_0x500f62,_0x48c0c4){return function(_0x131f18){if(!_0x131f18){_0x500f62['sendStatus'](0x194);}return _0x131f18;};}function handleError(_0x9be273,_0x1c396b){_0x1c396b=_0x1c396b||0x1f4;return function(_0x1e6221){logger[_0x2a2b('0x22')](_0x1e6221['stack']);if(_0x1e6221[_0x2a2b('0x23')]){delete _0x1e6221[_0x2a2b('0x23')];}_0x9be273[_0x2a2b('0x18')](_0x1c396b)[_0x2a2b('0x24')](_0x1e6221);};}exports[_0x2a2b('0x25')]=function(_0x43d3e0,_0x19205e){var _0x5ccafb={},_0xba3acb={},_0x57ced5={'count':0x0,'rows':[]};var _0x4d2880=db[_0x2a2b('0x26')][_0x2a2b('0x27')];_0xba3acb[_0x2a2b('0x28')]=_[_0x2a2b('0x29')](_0x4d2880);_0xba3acb['query']=_[_0x2a2b('0x29')](_0x43d3e0[_0x2a2b('0x2a')]);_0xba3acb[_0x2a2b('0x2b')]=_[_0x2a2b('0x2c')](_0xba3acb['model'],_0xba3acb[_0x2a2b('0x2a')]);_0x5ccafb['attributes']=_[_0x2a2b('0x2c')](_0xba3acb[_0x2a2b('0x28')],qs[_0x2a2b('0x2d')](_0x43d3e0[_0x2a2b('0x2a')][_0x2a2b('0x2d')]));_0x5ccafb[_0x2a2b('0x2e')]=_0x5ccafb[_0x2a2b('0x2e')][_0x2a2b('0x2f')]?_0x5ccafb[_0x2a2b('0x2e')]:_0xba3acb[_0x2a2b('0x28')];if(!_0x43d3e0[_0x2a2b('0x2a')][_0x2a2b('0x30')](_0x2a2b('0x31'))){_0x5ccafb[_0x2a2b('0x1d')]=qs[_0x2a2b('0x1d')](_0x43d3e0['query'][_0x2a2b('0x1d')]);_0x5ccafb[_0x2a2b('0x1c')]=qs[_0x2a2b('0x1c')](_0x43d3e0['query'][_0x2a2b('0x1c')]);}_0x5ccafb[_0x2a2b('0x32')]=qs['sort'](_0x43d3e0['query'][_0x2a2b('0x33')]);_0x5ccafb['where']=qs[_0x2a2b('0x2b')](_[_0x2a2b('0x34')](_0x43d3e0[_0x2a2b('0x2a')],_0xba3acb[_0x2a2b('0x2b')]));if(_0x43d3e0['query']['filter']){_0x5ccafb['where']=_[_0x2a2b('0x35')](_0x5ccafb[_0x2a2b('0x36')],{'$or':_[_0x2a2b('0x37')](_0x4d2880,function(_0x24293f){if(_0x24293f[_0x2a2b('0x38')][_0x2a2b('0x39')]!==_0x2a2b('0x3a')){var _0x2a72b6={};_0x2a72b6[_0x24293f['field']]={'$like':'%'+_0x43d3e0['query'][_0x2a2b('0x3b')]+'%'};return _0x2a72b6;}})});}_0x5ccafb=_[_0x2a2b('0x35')]({},_0x5ccafb,_0x43d3e0[_0x2a2b('0x3c')]);var _0x34d715={'where':_0x5ccafb[_0x2a2b('0x36')]};return db['FaxTransferReport']['count'](_0x34d715)['then'](function(_0x4bac9d){_0x57ced5[_0x2a2b('0x1b')]=_0x4bac9d;if(_0x43d3e0['query']['includeAll']){_0x5ccafb[_0x2a2b('0x3d')]=[{'all':!![]}];}return db[_0x2a2b('0x26')][_0x2a2b('0x3e')](_0x5ccafb);})['then'](function(_0x214412){_0x57ced5[_0x2a2b('0x3f')]=_0x214412;return _0x57ced5;})[_0x2a2b('0x21')](respondWithFilteredResult(_0x19205e,_0x5ccafb))['catch'](handleError(_0x19205e,null));};exports[_0x2a2b('0x40')]=function(_0x2bef9b,_0x2a5c53){var _0x45b4ee={'raw':!![],'where':{'id':_0x2bef9b[_0x2a2b('0x41')]['id']}},_0x218e18={};_0x218e18[_0x2a2b('0x28')]=_[_0x2a2b('0x29')](db[_0x2a2b('0x26')][_0x2a2b('0x27')]);_0x218e18[_0x2a2b('0x2a')]=_['keys'](_0x2bef9b[_0x2a2b('0x2a')]);_0x218e18[_0x2a2b('0x2b')]=_[_0x2a2b('0x2c')](_0x218e18[_0x2a2b('0x28')],_0x218e18['query']);_0x45b4ee[_0x2a2b('0x2e')]=_['intersection'](_0x218e18[_0x2a2b('0x28')],qs['fields'](_0x2bef9b[_0x2a2b('0x2a')][_0x2a2b('0x2d')]));_0x45b4ee[_0x2a2b('0x2e')]=_0x45b4ee['attributes']['length']?_0x45b4ee[_0x2a2b('0x2e')]:_0x218e18[_0x2a2b('0x28')];if(_0x2bef9b[_0x2a2b('0x2a')][_0x2a2b('0x42')]){_0x45b4ee[_0x2a2b('0x3d')]=[{'all':!![]}];}_0x45b4ee=_[_0x2a2b('0x35')]({},_0x45b4ee,_0x2bef9b[_0x2a2b('0x3c')]);return db[_0x2a2b('0x26')][_0x2a2b('0x43')](_0x45b4ee)[_0x2a2b('0x21')](handleEntityNotFound(_0x2a5c53,null))[_0x2a2b('0x21')](respondWithResult(_0x2a5c53,null))['catch'](handleError(_0x2a5c53,null));};exports[_0x2a2b('0x44')]=function(_0x1a89d4,_0x5ada1f){return db[_0x2a2b('0x26')][_0x2a2b('0x44')](_0x1a89d4['body'],{})[_0x2a2b('0x21')](respondWithResult(_0x5ada1f,0xc9))['catch'](handleError(_0x5ada1f,null));};exports[_0x2a2b('0x20')]=function(_0x1aeb19,_0x5a27d4){if(_0x1aeb19[_0x2a2b('0x45')]['id']){delete _0x1aeb19['body']['id'];}return db[_0x2a2b('0x26')][_0x2a2b('0x43')]({'where':{'id':_0x1aeb19['params']['id']}})[_0x2a2b('0x21')](handleEntityNotFound(_0x5a27d4,null))[_0x2a2b('0x21')](saveUpdates(_0x1aeb19[_0x2a2b('0x45')],null))['then'](respondWithResult(_0x5a27d4,null))[_0x2a2b('0x46')](handleError(_0x5a27d4,null));};exports[_0x2a2b('0x47')]=function(_0x2ab9b5,_0x536215){return db[_0x2a2b('0x26')][_0x2a2b('0x43')]({'where':{'id':_0x2ab9b5[_0x2a2b('0x41')]['id']}})[_0x2a2b('0x21')](handleEntityNotFound(_0x536215,null))[_0x2a2b('0x21')](removeEntity(_0x536215,null))[_0x2a2b('0x46')](handleError(_0x536215,null));};exports[_0x2a2b('0x48')]=function(_0x549aa0,_0x1b6db2){return db[_0x2a2b('0x26')][_0x2a2b('0x48')]()[_0x2a2b('0x21')](respondWithResult(_0x1b6db2,null))[_0x2a2b('0x46')](handleError(_0x1b6db2,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 24adeb1..c264a4f 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 _0x96f1=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x2cf8ef,_0x5ab4d4){var _0x11869f=function(_0xbd8a28){while(--_0xbd8a28){_0x2cf8ef['push'](_0x2cf8ef['shift']());}};_0x11869f(++_0x5ab4d4);}(_0x96f1,0x1b6));var _0x196f=function(_0x3f71c0,_0x2fa4d1){_0x3f71c0=_0x3f71c0-0x0;var _0x45d3ec=_0x96f1[_0x3f71c0];return _0x45d3ec;};'use strict';var _=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var logger=require(_0x196f('0x2'))(_0x196f('0x3'));var moment=require(_0x196f('0x4'));var BPromise=require(_0x196f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x196f('0x6'));var rimraf=require(_0x196f('0x7'));var config=require(_0x196f('0x8'));var attributes=require(_0x196f('0x9'));module['exports']=function(_0x299eae,_0x4a5d3b){return _0x299eae[_0x196f('0xa')](_0x196f('0xb'),attributes,{'tableName':_0x196f('0xc'),'paranoid':![],'indexes':[{'name':_0x196f('0xd'),'fields':[_0x196f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c82=['../../config/logger','moment','bluebird','request-promise','path','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x1a116d,_0x30acd0){var _0x10bd1b=function(_0x545a9a){while(--_0x545a9a){_0x1a116d['push'](_0x1a116d['shift']());}};_0x10bd1b(++_0x30acd0);}(_0x3c82,0xe2));var _0x23c8=function(_0x348a50,_0xe211f1){_0x348a50=_0x348a50-0x0;var _0x29beb2=_0x3c82[_0x348a50];return _0x29beb2;};'use strict';var _=require(_0x23c8('0x0'));var util=require(_0x23c8('0x1'));var logger=require(_0x23c8('0x2'))('api');var moment=require(_0x23c8('0x3'));var BPromise=require(_0x23c8('0x4'));var rp=require(_0x23c8('0x5'));var fs=require('fs');var path=require(_0x23c8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23c8('0x7'));module[_0x23c8('0x8')]=function(_0x3aa15e,_0xeaae97){return _0x3aa15e[_0x23c8('0x9')](_0x23c8('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x23c8('0xb'),'fields':[_0x23c8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8ae8d93..37809bd 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 _0xe9e4=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x52c6fb,_0xb84388){var _0x5f51df=function(_0xc3c9f0){while(--_0xc3c9f0){_0x52c6fb['push'](_0x52c6fb['shift']());}};_0x5f51df(++_0xb84388);}(_0xe9e4,0x104));var _0x4e9e=function(_0x110231,_0x20380c){_0x110231=_0x110231-0x0;var _0x4c7e51=_0xe9e4[_0x110231];return _0x4c7e51;};'use strict';var _=require(_0x4e9e('0x0'));var util=require(_0x4e9e('0x1'));var moment=require(_0x4e9e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e9e('0x3'));var fs=require('fs');var Redis=require(_0x4e9e('0x4'));var db=require(_0x4e9e('0x5'))['db'];var utils=require(_0x4e9e('0x6'));var logger=require(_0x4e9e('0x7'))(_0x4e9e('0x8'));var config=require(_0x4e9e('0x9'));var jayson=require(_0x4e9e('0xa'));var client=jayson[_0x4e9e('0xb')][_0x4e9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ac8dd,_0x310ffa,_0x1d8e65){return new BPromise(function(_0x15cc1e,_0x2dfd4f){return client[_0x4e9e('0xd')](_0x4ac8dd,_0x1d8e65)[_0x4e9e('0xe')](function(_0x33c6ad){logger[_0x4e9e('0xf')](_0x4e9e('0x10'),_0x310ffa,_0x4e9e('0x11'));logger[_0x4e9e('0x12')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x310ffa,_0x4e9e('0x11'),JSON[_0x4e9e('0x13')](_0x33c6ad));if(_0x33c6ad[_0x4e9e('0x14')]){if(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x15')]===0x1f4){logger['error'](_0x4e9e('0x10'),_0x310ffa,_0x33c6ad['error'][_0x4e9e('0x16')]);return _0x2dfd4f(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x16')]);}logger[_0x4e9e('0x14')](_0x4e9e('0x10'),_0x310ffa,_0x33c6ad['error']['message']);return _0x15cc1e(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x16')]);}else{logger[_0x4e9e('0xf')](_0x4e9e('0x10'),_0x310ffa,_0x4e9e('0x11'));_0x15cc1e(_0x33c6ad[_0x4e9e('0x17')][_0x4e9e('0x16')]);}})[_0x4e9e('0x18')](function(_0x446053){logger['error'](_0x4e9e('0x10'),_0x310ffa,_0x446053);_0x2dfd4f(_0x446053);});});} \ No newline at end of file +var _0x1e3d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../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','message','result','catch','lodash','util','moment','bluebird'];(function(_0x10f9e1,_0x4c7e0b){var _0x371f06=function(_0x475661){while(--_0x475661){_0x10f9e1['push'](_0x10f9e1['shift']());}};_0x371f06(++_0x4c7e0b);}(_0x1e3d,0x134));var _0xd1e3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x1e3d[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xd1e3('0x0'));var util=require(_0xd1e3('0x1'));var moment=require(_0xd1e3('0x2'));var BPromise=require(_0xd1e3('0x3'));var rs=require(_0xd1e3('0x4'));var fs=require('fs');var Redis=require(_0xd1e3('0x5'));var db=require(_0xd1e3('0x6'))['db'];var utils=require(_0xd1e3('0x7'));var logger=require(_0xd1e3('0x8'))('rpc');var config=require(_0xd1e3('0x9'));var jayson=require(_0xd1e3('0xa'));var client=jayson[_0xd1e3('0xb')][_0xd1e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a89bf,_0x440b71,_0x3d060b){return new BPromise(function(_0x53166e,_0x45c35e){return client[_0xd1e3('0xd')](_0x2a89bf,_0x3d060b)['then'](function(_0x13e2d5){logger[_0xd1e3('0xe')](_0xd1e3('0xf'),_0x440b71,_0xd1e3('0x10'));logger[_0xd1e3('0x11')](_0xd1e3('0x12'),_0x440b71,_0xd1e3('0x10'),JSON[_0xd1e3('0x13')](_0x13e2d5));if(_0x13e2d5[_0xd1e3('0x14')]){if(_0x13e2d5['error']['code']===0x1f4){logger[_0xd1e3('0x14')](_0xd1e3('0xf'),_0x440b71,_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);return _0x45c35e(_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);}logger['error'](_0xd1e3('0xf'),_0x440b71,_0x13e2d5[_0xd1e3('0x14')]['message']);return _0x53166e(_0x13e2d5[_0xd1e3('0x14')][_0xd1e3('0x15')]);}else{logger[_0xd1e3('0xe')](_0xd1e3('0xf'),_0x440b71,'request\x20sent');_0x53166e(_0x13e2d5[_0xd1e3('0x16')][_0xd1e3('0x15')]);}})[_0xd1e3('0x17')](function(_0x4cf328){logger['error'](_0xd1e3('0xf'),_0x440b71,_0x4cf328);_0x45c35e(_0x4cf328);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7207dc0..f15b105 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 _0x6aa7=['Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x14bf9e,_0xeac65e){var _0x8d2af2=function(_0x12c72a){while(--_0x12c72a){_0x14bf9e['push'](_0x14bf9e['shift']());}};_0x8d2af2(++_0xeac65e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ba50f,_0x32cee8){_0x2ba50f=_0x2ba50f-0x0;var _0x3db9e9=_0x6aa7[_0x2ba50f];return _0x3db9e9;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xd')]);router['post']('/',auth[_0x76aa('0xa')](),controller[_0x76aa('0xe')]);router[_0x76aa('0xf')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x10')]);router[_0x76aa('0x11')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x12')]);module['exports']=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x358df8,_0x4cb3e7){var _0x58320c=function(_0x4f36e4){while(--_0x4f36e4){_0x358df8['push'](_0x358df8['shift']());}};_0x58320c(++_0x4cb3e7);}(_0xac31,0xca));var _0x1ac3=function(_0xc9c87a,_0x507f97){_0xc9c87a=_0xc9c87a-0x0;var _0x38e1c9=_0xac31[_0xc9c87a];return _0x38e1c9;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 7cdfde1..d63fc22 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 _0x721e=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','/:id','delete','destroy'];(function(_0x3b9822,_0x4a9051){var _0x102220=function(_0x151dc2){while(--_0x151dc2){_0x3b9822['push'](_0x3b9822['shift']());}};_0x102220(++_0x4a9051);}(_0x721e,0xdd));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe721('0x0'));var util=require(_0xe721('0x1'));var path=require(_0xe721('0x2'));var timeout=require('connect-timeout');var express=require(_0xe721('0x3'));var router=express[_0xe721('0x4')]();var auth=require(_0xe721('0x5'));var interaction=require(_0xe721('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xe721('0x7')]('/',auth[_0xe721('0x8')](),controller[_0xe721('0x9')]);router[_0xe721('0x7')]('/:id',auth[_0xe721('0x8')](),controller[_0xe721('0xa')]);router[_0xe721('0x7')](_0xe721('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe721('0x7')](_0xe721('0xc'),auth['isAuthenticated'](),controller[_0xe721('0xd')]);router[_0xe721('0xe')]('/',auth[_0xe721('0x8')](),controller['create']);router[_0xe721('0xe')](_0xe721('0xb'),auth[_0xe721('0x8')](),controller[_0xe721('0xf')]);router['put'](_0xe721('0x10'),auth[_0xe721('0x8')](),controller['update']);router[_0xe721('0x11')](_0xe721('0x10'),auth[_0xe721('0x8')](),controller[_0xe721('0x12')]);module[_0xe721('0x13')]=router; \ No newline at end of file +var _0xcd36=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x15876c,_0x510dd4){var _0x39d91b=function(_0x2a692c){while(--_0x2a692c){_0x15876c['push'](_0x15876c['shift']());}};_0x39d91b(++_0x510dd4);}(_0xcd36,0x15f));var _0x6cd3=function(_0x55f84e,_0x193da0){_0x55f84e=_0x55f84e-0x0;var _0x4e6d3a=_0xcd36[_0x55f84e];return _0x4e6d3a;};'use strict';var multer=require(_0x6cd3('0x0'));var util=require(_0x6cd3('0x1'));var path=require(_0x6cd3('0x2'));var timeout=require(_0x6cd3('0x3'));var express=require(_0x6cd3('0x4'));var router=express[_0x6cd3('0x5')]();var auth=require(_0x6cd3('0x6'));var interaction=require(_0x6cd3('0x7'));var config=require(_0x6cd3('0x8'));var controller=require(_0x6cd3('0x9'));router[_0x6cd3('0xa')]('/',auth[_0x6cd3('0xb')](),controller[_0x6cd3('0xc')]);router[_0x6cd3('0xa')](_0x6cd3('0xd'),auth[_0x6cd3('0xb')](),controller[_0x6cd3('0xe')]);router[_0x6cd3('0xa')](_0x6cd3('0xf'),auth['isAuthenticated'](),controller[_0x6cd3('0x10')]);router[_0x6cd3('0xa')](_0x6cd3('0x11'),auth['isAuthenticated'](),controller[_0x6cd3('0x12')]);router[_0x6cd3('0x13')]('/',auth[_0x6cd3('0xb')](),controller[_0x6cd3('0x14')]);router[_0x6cd3('0x13')](_0x6cd3('0xf'),auth[_0x6cd3('0xb')](),controller[_0x6cd3('0x15')]);router[_0x6cd3('0x16')](_0x6cd3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6cd3('0x17')](_0x6cd3('0xd'),auth['isAuthenticated'](),controller[_0x6cd3('0x18')]);module[_0x6cd3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 32566d5..9db1efe 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 _0xe061=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x473dff,_0x556b62){var _0x1b8daa=function(_0x431000){while(--_0x431000){_0x473dff['push'](_0x473dff['shift']());}};_0x1b8daa(++_0x556b62);}(_0xe061,0xbb));var _0x1e06=function(_0x1db616,_0x5d464a){_0x1db616=_0x1db616-0x0;var _0x4102ee=_0xe061[_0x1db616];return _0x4102ee;};'use strict';var Sequelize=require(_0x1e06('0x0'));module[_0x1e06('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e06('0x2')]},'username':{'type':Sequelize[_0x1e06('0x2')]},'remoteUri':{'type':Sequelize[_0x1e06('0x2')]},'authType':{'type':Sequelize[_0x1e06('0x3')](_0x1e06('0x4')),'defaultValue':_0x1e06('0x4')},'password':{'type':Sequelize[_0x1e06('0x2')]},'consumerKey':{'type':Sequelize[_0x1e06('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1e06('0x2')]},'tokenSecret':{'type':Sequelize[_0x1e06('0x2')]},'serverUrl':{'type':Sequelize[_0x1e06('0x2')]},'type':{'type':Sequelize[_0x1e06('0x3')]('integrationTab','newTab'),'defaultValue':_0x1e06('0x5')}}; \ No newline at end of file +var _0x4ddc=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x5daaf2,_0x4c0150){var _0x202d70=function(_0x55c0fe){while(--_0x55c0fe){_0x5daaf2['push'](_0x5daaf2['shift']());}};_0x202d70(++_0x4c0150);}(_0x4ddc,0xe1));var _0xc4dd=function(_0x143f0d,_0x3f2e29){_0x143f0d=_0x143f0d-0x0;var _0x2c3801=_0x4ddc[_0x143f0d];return _0x2c3801;};'use strict';var Sequelize=require(_0xc4dd('0x0'));module[_0xc4dd('0x1')]={'name':{'type':Sequelize[_0xc4dd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc4dd('0x2')]},'remoteUri':{'type':Sequelize[_0xc4dd('0x2')]},'authType':{'type':Sequelize[_0xc4dd('0x3')]('basic'),'defaultValue':_0xc4dd('0x4')},'password':{'type':Sequelize[_0xc4dd('0x2')]},'consumerKey':{'type':Sequelize[_0xc4dd('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc4dd('0x2')]},'tokenSecret':{'type':Sequelize[_0xc4dd('0x2')]},'serverUrl':{'type':Sequelize[_0xc4dd('0x2')]},'type':{'type':Sequelize[_0xc4dd('0x3')](_0xc4dd('0x5'),'newTab'),'defaultValue':_0xc4dd('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8efa29b..27e1b12 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 _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index a1436d0..0fa0e6c 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x3be075,_0x50d5b0){var _0xbe567b=function(_0x26eb2c){while(--_0x26eb2c){_0x3be075['push'](_0x3be075['shift']());}};_0xbe567b(++_0x50d5b0);}(_0xe706,0xa3));var _0x6e70=function(_0x13d153,_0x3edda1){_0x13d153=_0x13d153-0x0;var _0x508a08=_0xe706[_0x13d153];return _0x508a08;};'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 _0x668b=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x668b,0x140));var _0xb668=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x668b[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xb668('0x8')]=function(_0x296fa9,_0x3be92e){return _0x296fa9[_0xb668('0x9')](_0xb668('0xa'),attributes,{'tableName':_0xb668('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index c51600f..7e5bd66 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 _0x1c3d=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowDeskAccount','find','where','util','moment','bluebird','randomstring'];(function(_0x907ab1,_0x3735cb){var _0x17ed79=function(_0x36d0c2){while(--_0x36d0c2){_0x907ab1['push'](_0x907ab1['shift']());}};_0x17ed79(++_0x3735cb);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x4d4c63,_0x33ac30){_0x4d4c63=_0x4d4c63-0x0;var _0x383b63=_0x1c3d[_0x4d4c63];return _0x383b63;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('DeskAccount,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('DeskAccount,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});}exports[_0xd1c3('0x18')]=function(_0x5d26c2){var _0x53a5e1=this;return new Promise(function(_0x14f6cb,_0x3a1a74){return db[_0xd1c3('0x19')][_0xd1c3('0x1a')]({'raw':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2['options'][_0xd1c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2[_0xd1c3('0x1b')]['where']||null:null,'attributes':_0x5d26c2['options']?_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1d')]||null:null,'limit':_0x5d26c2['options']?_0x5d26c2['options'][_0xd1c3('0x1e')]||null:null,'include':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1f')]?_[_0xd1c3('0x20')](_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1f')],function(_0xaa7580){return{'model':db[_0xaa7580[_0xd1c3('0x21')]],'as':_0xaa7580['as'],'attributes':_0xaa7580[_0xd1c3('0x1d')],'include':_0xaa7580['include']?_['map'](_0xaa7580[_0xd1c3('0x1f')],function(_0x261323){return{'model':db[_0x261323[_0xd1c3('0x21')]],'as':_0x261323['as'],'attributes':_0x261323[_0xd1c3('0x1d')],'include':_0x261323['include']?_[_0xd1c3('0x20')](_0x261323[_0xd1c3('0x1f')],function(_0x54fd33){return{'model':db[_0x54fd33[_0xd1c3('0x21')]],'as':_0x54fd33['as'],'attributes':_0x54fd33[_0xd1c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xc')](function(_0x173cb9){logger[_0xd1c3('0xd')](_0xd1c3('0x18'),_0x5d26c2);logger[_0xd1c3('0xe')]('GetDeskAccount',_0x5d26c2,JSON['stringify'](_0x173cb9));_0x14f6cb(_0x173cb9);})[_0xd1c3('0x17')](function(_0x3eabca){logger[_0xd1c3('0x12')](_0xd1c3('0x18'),_0x3eabca[_0xd1c3('0x15')],_0x5d26c2);_0x3a1a74(_0x53a5e1['error'](0x1f4,_0x3eabca[_0xd1c3('0x15')]));});});};exports[_0xd1c3('0x22')]=function(_0x5ce257){var _0x102e34=this;return new Promise(function(_0x5a7cdb,_0x1eefc2){return db[_0xd1c3('0x19')][_0xd1c3('0x23')]({'raw':_0x5ce257[_0xd1c3('0x1b')]?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ce257[_0xd1c3('0x1b')]?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x24')]||null:null,'attributes':_0x5ce257['options']?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1d')]||null:null,'include':_0x5ce257['options']?_0x5ce257[_0xd1c3('0x1b')]['include']?_[_0xd1c3('0x20')](_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1f')],function(_0x4ba6f0){return{'model':db[_0x4ba6f0[_0xd1c3('0x21')]],'as':_0x4ba6f0['as'],'attributes':_0x4ba6f0[_0xd1c3('0x1d')],'include':_0x4ba6f0[_0xd1c3('0x1f')]?_[_0xd1c3('0x20')](_0x4ba6f0[_0xd1c3('0x1f')],function(_0x1da9bf){return{'model':db[_0x1da9bf[_0xd1c3('0x21')]],'as':_0x1da9bf['as'],'attributes':_0x1da9bf[_0xd1c3('0x1d')],'include':_0x1da9bf[_0xd1c3('0x1f')]?_['map'](_0x1da9bf['include'],function(_0x3e5bcb){return{'model':db[_0x3e5bcb['model']],'as':_0x3e5bcb['as'],'attributes':_0x3e5bcb[_0xd1c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xc')](function(_0x1fd559){logger[_0xd1c3('0xd')](_0xd1c3('0x22'),_0x5ce257);logger[_0xd1c3('0xe')]('ShowDeskAccount',_0x5ce257,JSON[_0xd1c3('0x11')](_0x1fd559));_0x5a7cdb(_0x1fd559);})['catch'](function(_0x424918){logger['error'](_0xd1c3('0x22'),_0x424918['message'],_0x5ce257);_0x1eefc2(_0x102e34['error'](0x1f4,_0x424918[_0xd1c3('0x15')]));});});}; \ No newline at end of file +var _0xb5f3=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','DeskAccount','findAll','raw','options','where','attributes','limit','map','include','model','catch','ShowDeskAccount','find','lodash','util','moment','randomstring'];(function(_0x262957,_0x34c699){var _0x27e221=function(_0x49e5cf){while(--_0x49e5cf){_0x262957['push'](_0x262957['shift']());}};_0x27e221(++_0x34c699);}(_0xb5f3,0x137));var _0x3b5f=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0xb5f3[_0x2f4c1c];return _0x25e0f2;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var moment=require(_0x3b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b5f('0x3'));var fs=require('fs');var Redis=require(_0x3b5f('0x4'));var db=require(_0x3b5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b5f('0x6'));var config=require(_0x3b5f('0x7'));var jayson=require(_0x3b5f('0x8'));var client=jayson[_0x3b5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2db4ad,_0x1b6d67,_0x4edb1a){return new BPromise(function(_0x2e213c,_0x48597e){return client[_0x3b5f('0xa')](_0x2db4ad,_0x4edb1a)[_0x3b5f('0xb')](function(_0x2c37f6){logger[_0x3b5f('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1b6d67,_0x3b5f('0xd'));logger[_0x3b5f('0xe')](_0x3b5f('0xf'),_0x1b6d67,_0x3b5f('0xd'),JSON[_0x3b5f('0x10')](_0x2c37f6));if(_0x2c37f6['error']){if(_0x2c37f6['error']['code']===0x1f4){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);return _0x48597e(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x2c37f6['error'][_0x3b5f('0x13')]);return _0x2e213c(_0x2c37f6[_0x3b5f('0x11')][_0x3b5f('0x13')]);}else{logger['info'](_0x3b5f('0x12'),_0x1b6d67,'request\x20sent');_0x2e213c(_0x2c37f6[_0x3b5f('0x14')][_0x3b5f('0x13')]);}})['catch'](function(_0x28b6c1){logger[_0x3b5f('0x11')](_0x3b5f('0x12'),_0x1b6d67,_0x28b6c1);_0x48597e(_0x28b6c1);});});}exports[_0x3b5f('0x15')]=function(_0x5ed046){var _0x2db25f=this;return new Promise(function(_0x4933c8,_0x2d3848){return db[_0x3b5f('0x16')][_0x3b5f('0x17')]({'raw':_0x5ed046['options']?_0x5ed046['options'][_0x3b5f('0x18')]===undefined?!![]:![]:!![],'where':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1a')]||null:null,'attributes':_0x5ed046['options']?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1b')]||null:null,'limit':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1c')]||null:null,'include':_0x5ed046[_0x3b5f('0x19')]?_0x5ed046['options']['include']?_[_0x3b5f('0x1d')](_0x5ed046[_0x3b5f('0x19')][_0x3b5f('0x1e')],function(_0x25bcf6){return{'model':db[_0x25bcf6[_0x3b5f('0x1f')]],'as':_0x25bcf6['as'],'attributes':_0x25bcf6[_0x3b5f('0x1b')],'include':_0x25bcf6[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x25bcf6[_0x3b5f('0x1e')],function(_0x3267b8){return{'model':db[_0x3267b8['model']],'as':_0x3267b8['as'],'attributes':_0x3267b8['attributes'],'include':_0x3267b8[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x3267b8[_0x3b5f('0x1e')],function(_0x26c1e0){return{'model':db[_0x26c1e0[_0x3b5f('0x1f')]],'as':_0x26c1e0['as'],'attributes':_0x26c1e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b5f('0xb')](function(_0x2d5ba1){logger[_0x3b5f('0xc')](_0x3b5f('0x15'),_0x5ed046);logger['debug']('GetDeskAccount',_0x5ed046,JSON[_0x3b5f('0x10')](_0x2d5ba1));_0x4933c8(_0x2d5ba1);})[_0x3b5f('0x20')](function(_0x1533ea){logger['error']('GetDeskAccount',_0x1533ea[_0x3b5f('0x13')],_0x5ed046);_0x2d3848(_0x2db25f[_0x3b5f('0x11')](0x1f4,_0x1533ea['message']));});});};exports[_0x3b5f('0x21')]=function(_0x562f95){var _0xa10ddb=this;return new Promise(function(_0xc266d0,_0x4be2e2){return db['DeskAccount'][_0x3b5f('0x22')]({'raw':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x18')]===undefined?!![]:![]:!![],'where':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x1a')]||null:null,'attributes':_0x562f95[_0x3b5f('0x19')]?_0x562f95['options'][_0x3b5f('0x1b')]||null:null,'include':_0x562f95[_0x3b5f('0x19')]?_0x562f95[_0x3b5f('0x19')]['include']?_[_0x3b5f('0x1d')](_0x562f95[_0x3b5f('0x19')][_0x3b5f('0x1e')],function(_0x214dee){return{'model':db[_0x214dee[_0x3b5f('0x1f')]],'as':_0x214dee['as'],'attributes':_0x214dee['attributes'],'include':_0x214dee['include']?_['map'](_0x214dee[_0x3b5f('0x1e')],function(_0x1f660a){return{'model':db[_0x1f660a[_0x3b5f('0x1f')]],'as':_0x1f660a['as'],'attributes':_0x1f660a[_0x3b5f('0x1b')],'include':_0x1f660a[_0x3b5f('0x1e')]?_[_0x3b5f('0x1d')](_0x1f660a['include'],function(_0x185afb){return{'model':db[_0x185afb[_0x3b5f('0x1f')]],'as':_0x185afb['as'],'attributes':_0x185afb[_0x3b5f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x511671){logger[_0x3b5f('0xc')]('ShowDeskAccount',_0x562f95);logger['debug']('ShowDeskAccount',_0x562f95,JSON[_0x3b5f('0x10')](_0x511671));_0xc266d0(_0x511671);})['catch'](function(_0x2a4356){logger[_0x3b5f('0x11')](_0x3b5f('0x21'),_0x2a4356['message'],_0x562f95);_0x4be2e2(_0xa10ddb[_0x3b5f('0x11')](0x1f4,_0x2a4356['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index f896864..123ac68 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 _0xd018=['getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','/:id','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id/fields'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xd018,0x114));var _0x8d01=function(_0x4111a0,_0x171f56){_0x4111a0=_0x4111a0-0x0;var _0x5011a3=_0xd018[_0x4111a0];return _0x5011a3;};'use strict';var multer=require(_0x8d01('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d01('0x1')]();var auth=require(_0x8d01('0x2'));var interaction=require(_0x8d01('0x3'));var config=require(_0x8d01('0x4'));var controller=require(_0x8d01('0x5'));router['get']('/',auth[_0x8d01('0x6')](),controller[_0x8d01('0x7')]);router[_0x8d01('0x8')]('/:id',auth[_0x8d01('0x6')](),controller['show']);router[_0x8d01('0x8')](_0x8d01('0x9'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xa')]);router[_0x8d01('0x8')](_0x8d01('0xb'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xc')]);router[_0x8d01('0x8')]('/:id/descriptions',auth[_0x8d01('0x6')](),controller[_0x8d01('0xd')]);router[_0x8d01('0x8')](_0x8d01('0xe'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xf')]);router[_0x8d01('0x10')]('/',auth[_0x8d01('0x6')](),controller[_0x8d01('0x11')]);router[_0x8d01('0x10')](_0x8d01('0xe'),auth[_0x8d01('0x6')](),controller['setTags']);router[_0x8d01('0x12')](_0x8d01('0x13'),auth[_0x8d01('0x6')](),controller['update']);router[_0x8d01('0x14')](_0x8d01('0x13'),auth[_0x8d01('0x6')](),controller['destroy']);module[_0x8d01('0x15')]=router; \ No newline at end of file +var _0xab91=['show','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x59fb6d,_0x2ddf05){var _0x17191f=function(_0x1d72ed){while(--_0x1d72ed){_0x59fb6d['push'](_0x59fb6d['shift']());}};_0x17191f(++_0x2ddf05);}(_0xab91,0xc4));var _0x1ab9=function(_0x44e4a1,_0x3d053a){_0x44e4a1=_0x44e4a1-0x0;var _0x546ad3=_0xab91[_0x44e4a1];return _0x546ad3;};'use strict';var multer=require(_0x1ab9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ab9('0x1'));var express=require(_0x1ab9('0x2'));var router=express['Router']();var auth=require(_0x1ab9('0x3'));var interaction=require(_0x1ab9('0x4'));var config=require(_0x1ab9('0x5'));var controller=require(_0x1ab9('0x6'));router[_0x1ab9('0x7')]('/',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x9')]);router[_0x1ab9('0x7')](_0x1ab9('0xa'),auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xb')]);router['get']('/:id/fields',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xc')]);router[_0x1ab9('0x7')]('/:id/subjects',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xd')]);router[_0x1ab9('0x7')](_0x1ab9('0xe'),auth[_0x1ab9('0x8')](),controller[_0x1ab9('0xf')]);router[_0x1ab9('0x7')](_0x1ab9('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0x1ab9('0x11')]('/',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x12')]);router['post'](_0x1ab9('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0x1ab9('0x13')]('/:id',auth[_0x1ab9('0x8')](),controller[_0x1ab9('0x14')]);router[_0x1ab9('0x15')](_0x1ab9('0xa'),auth[_0x1ab9('0x8')](),controller['destroy']);module[_0x1ab9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 803b9bc..f6024be 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 _0xec63=['exports','STRING','sequelize'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xec63,0xbf));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec6('0x0'));module[_0x3ec6('0x1')]={'name':{'type':Sequelize[_0x3ec6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x78ae=['exports','STRING','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x78ae,0xd7));var _0xe78a=function(_0x2c2d11,_0x4308ac){_0x2c2d11=_0x2c2d11-0x0;var _0x255f24=_0x78ae[_0x2c2d11];return _0x255f24;};'use strict';var Sequelize=require(_0xe78a('0x0'));module[_0xe78a('0x1')]={'name':{'type':Sequelize[_0xe78a('0x2')]},'description':{'type':Sequelize[_0xe78a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 05d677f..c6f7670 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 _0x13f6=['getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','key','VIRTUAL','field','options','count','include','DeskConfiguration','findAll','rows','includeAll','create','body','params','find','getFields','findOne','DeskField','order','map','nolimit','getSubjects'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x13f6,0xc2));var _0x613f=function(_0x551c3d,_0x532744){_0x551c3d=_0x551c3d-0x0;var _0x2dbdc6=_0x13f6[_0x551c3d];return _0x2dbdc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require(_0x613f('0x2'));var jsonpatch=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var moment=require(_0x613f('0x5'));var BPromise=require(_0x613f('0x6'));var Mustache=require(_0x613f('0x7'));var util=require(_0x613f('0x8'));var path=require(_0x613f('0x9'));var sox=require(_0x613f('0xa'));var csv=require(_0x613f('0xb'));var ejs=require(_0x613f('0xc'));var fs=require('fs');var _=require(_0x613f('0xd'));var squel=require('squel');var crypto=require(_0x613f('0xe'));var jsforce=require(_0x613f('0xf'));var deskjs=require(_0x613f('0x10'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0x11'));var Papa=require(_0x613f('0x12'));var Redis=require(_0x613f('0x13'));var authService=require(_0x613f('0x14'));var qs=require(_0x613f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x16'))(_0x613f('0x17'));var utils=require('../../config/utils');var config=require(_0x613f('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x613f('0x19'));var client=jayson['client'][_0x613f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x27f45c,_0x1ea71c,_0xd4423d){if(_0xd4423d){var _0x296e4c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x296e4c['test'](_0x1ea71c)){return _0x27f45c;}else{throw new Error(_0x613f('0x1b'));}}else{return _0x27f45c;}}function respondWithRpcPromise(_0x4b41fb,_0x921e5b,_0x1543e5,_0x2b26e4){return new BPromise(function(_0x2f907e,_0xbac54f){var _0x2c09db=_0x2b26e4||client;return _0x2c09db[_0x613f('0x1c')](_0x4b41fb,_0x1543e5)['then'](function(_0x7fc722){logger['info'](_0x613f('0x1d'),_0x921e5b,_0x613f('0x1e'));logger[_0x613f('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x921e5b,'request\x20sent',JSON[_0x613f('0x20')](_0x7fc722));if(_0x7fc722[_0x613f('0x21')]){if(_0x7fc722[_0x613f('0x21')][_0x613f('0x22')]===0x1f4){logger['error'](_0x613f('0x1d'),_0x921e5b,_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);return _0xbac54f(_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);}logger[_0x613f('0x21')](_0x613f('0x1d'),_0x921e5b,_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);return _0x2f907e(_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);}else{logger[_0x613f('0x24')]('DeskConfiguration,\x20%s,\x20%s',_0x921e5b,_0x613f('0x1e'));_0x2f907e(_0x7fc722[_0x613f('0x25')]['message']);}})[_0x613f('0x26')](function(_0x2f986a){logger[_0x613f('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x921e5b,_0x2f986a);_0xbac54f(_0x2f986a);});});}function respondWithStatusCode(_0x1a9666,_0x4c6bc0){_0x4c6bc0=_0x4c6bc0||0xcc;return function(_0x1f4b2f){if(_0x1f4b2f){return _0x1a9666[_0x613f('0x27')](_0x4c6bc0);}return _0x1a9666['status'](_0x4c6bc0)[_0x613f('0x28')]();};}function respondWithResult(_0x522e85,_0x2f106f){_0x2f106f=_0x2f106f||0xc8;return function(_0xc002cc){if(_0xc002cc){return _0x522e85[_0x613f('0x29')](_0x2f106f)[_0x613f('0x2a')](_0xc002cc);}};}function respondWithFilteredResult(_0xdc66d7,_0x532f7d){return function(_0x53fbf8){if(_0x53fbf8){var _0x4ba591=_0x53fbf8['count'],_0x501250=_0x532f7d[_0x613f('0x2b')],_0x2f5c39=_0x532f7d['offset']+_0x532f7d[_0x613f('0x2c')],_0x44c711;if(_0x2f5c39>=_0x4ba591){_0x2f5c39=_0x4ba591;_0x44c711=0xc8;}else{_0x44c711=0xce;}_0xdc66d7['status'](_0x44c711);return _0xdc66d7[_0x613f('0x2d')]('Content-Range',_0x501250+'-'+_0x2f5c39+'/'+_0x4ba591)[_0x613f('0x2a')](_0x53fbf8);}return null;};}function patchUpdates(_0x4c7a3f){return function(_0x56a132){try{jsonpatch[_0x613f('0x2e')](_0x56a132,_0x4c7a3f,!![]);}catch(_0x43398c){return BPromise[_0x613f('0x2f')](_0x43398c);}return _0x56a132[_0x613f('0x30')]();};}function saveUpdates(_0x325f16,_0x369c31){return function(_0x454f1b){if(_0x454f1b){return _0x454f1b[_0x613f('0x31')](_0x325f16)[_0x613f('0x32')](function(_0x2a092e){return _0x2a092e;});}return null;};}function removeEntity(_0x1b798e,_0x3e64b1){return function(_0x1b7be4){if(_0x1b7be4){return _0x1b7be4[_0x613f('0x33')]()[_0x613f('0x32')](function(){_0x1b798e[_0x613f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337c69,_0x14eabd){return function(_0x2b9d85){if(!_0x2b9d85){_0x337c69['sendStatus'](0x194);}return _0x2b9d85;};}function handleError(_0xc65bbe,_0x38081f){_0x38081f=_0x38081f||0x1f4;return function(_0xe8ff91){logger[_0x613f('0x21')](_0xe8ff91[_0x613f('0x34')]);if(_0xe8ff91[_0x613f('0x35')]){delete _0xe8ff91['name'];}_0xc65bbe[_0x613f('0x29')](_0x38081f)[_0x613f('0x36')](_0xe8ff91);};}exports['index']=function(_0x1cb1b8,_0x70462b){var _0x505983={},_0x540be5={},_0x78b115={'count':0x0,'rows':[]};var _0x5eb1e3=db['DeskConfiguration'][_0x613f('0x37')];_0x540be5['model']=_[_0x613f('0x38')](_0x5eb1e3);_0x540be5[_0x613f('0x39')]=_[_0x613f('0x38')](_0x1cb1b8[_0x613f('0x39')]);_0x540be5[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x540be5[_0x613f('0x3c')],_0x540be5[_0x613f('0x39')]);_0x505983[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x540be5['model'],qs['fields'](_0x1cb1b8['query'][_0x613f('0x3e')]));_0x505983[_0x613f('0x3d')]=_0x505983['attributes'][_0x613f('0x3f')]?_0x505983[_0x613f('0x3d')]:_0x540be5[_0x613f('0x3c')];if(!_0x1cb1b8[_0x613f('0x39')][_0x613f('0x40')]('nolimit')){_0x505983['limit']=qs[_0x613f('0x2c')](_0x1cb1b8[_0x613f('0x39')]['limit']);_0x505983[_0x613f('0x2b')]=qs['offset'](_0x1cb1b8[_0x613f('0x39')]['offset']);}_0x505983['order']=qs[_0x613f('0x41')](_0x1cb1b8['query'][_0x613f('0x41')]);_0x505983['where']=qs[_0x613f('0x3a')](_[_0x613f('0x42')](_0x1cb1b8['query'],_0x540be5['filters']));if(_0x1cb1b8[_0x613f('0x39')][_0x613f('0x43')]){_0x505983['where']=_[_0x613f('0x44')](_0x505983[_0x613f('0x45')],{'$or':_['map'](_0x5eb1e3,function(_0x50b30f){if(_0x50b30f['type'][_0x613f('0x46')]!==_0x613f('0x47')){var _0x22cb0b={};_0x22cb0b[_0x50b30f[_0x613f('0x48')]]={'$like':'%'+_0x1cb1b8[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x22cb0b;}})});}_0x505983=_['merge']({},_0x505983,_0x1cb1b8[_0x613f('0x49')]);var _0x184bf0={'where':_0x505983[_0x613f('0x45')]};return db['DeskConfiguration']['count'](_0x184bf0)['then'](function(_0x55cd5e){_0x78b115[_0x613f('0x4a')]=_0x55cd5e;if(_0x1cb1b8['query']['includeAll']){_0x505983[_0x613f('0x4b')]=[{'all':!![]}];}return db[_0x613f('0x4c')][_0x613f('0x4d')](_0x505983);})[_0x613f('0x32')](function(_0x296e8b){_0x78b115[_0x613f('0x4e')]=_0x296e8b;return _0x78b115;})[_0x613f('0x32')](respondWithFilteredResult(_0x70462b,_0x505983))[_0x613f('0x26')](handleError(_0x70462b,null));};exports['show']=function(_0x4c7918,_0x5980c3){var _0x30c578={'raw':![],'where':{'id':_0x4c7918['params']['id']}},_0x4610f7={};_0x4610f7[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x4c')][_0x613f('0x37')]);_0x4610f7[_0x613f('0x39')]=_['keys'](_0x4c7918[_0x613f('0x39')]);_0x4610f7[_0x613f('0x3a')]=_['intersection'](_0x4610f7[_0x613f('0x3c')],_0x4610f7['query']);_0x30c578[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x4610f7[_0x613f('0x3c')],qs['fields'](_0x4c7918['query']['fields']));_0x30c578[_0x613f('0x3d')]=_0x30c578[_0x613f('0x3d')][_0x613f('0x3f')]?_0x30c578['attributes']:_0x4610f7['model'];if(_0x4c7918[_0x613f('0x39')][_0x613f('0x4f')]){_0x30c578[_0x613f('0x4b')]=[{'all':!![]}];}_0x30c578=_[_0x613f('0x44')]({},_0x30c578,_0x4c7918[_0x613f('0x49')]);return db[_0x613f('0x4c')]['find'](_0x30c578)[_0x613f('0x32')](handleEntityNotFound(_0x5980c3,null))[_0x613f('0x32')](respondWithResult(_0x5980c3,null))[_0x613f('0x26')](handleError(_0x5980c3,null));};exports[_0x613f('0x50')]=function(_0xa1999e,_0xe08541){return db[_0x613f('0x4c')][_0x613f('0x50')](_0xa1999e[_0x613f('0x51')],{})[_0x613f('0x32')](respondWithResult(_0xe08541,0xc9))[_0x613f('0x26')](handleError(_0xe08541,null));};exports[_0x613f('0x31')]=function(_0x3c3cb7,_0x20822d){if(_0x3c3cb7[_0x613f('0x51')]['id']){delete _0x3c3cb7[_0x613f('0x51')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3c3cb7[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x20822d,null))[_0x613f('0x32')](saveUpdates(_0x3c3cb7[_0x613f('0x51')],null))[_0x613f('0x32')](respondWithResult(_0x20822d,null))[_0x613f('0x26')](handleError(_0x20822d,null));};exports[_0x613f('0x33')]=function(_0xbf24e1,_0x604519){return db[_0x613f('0x4c')][_0x613f('0x53')]({'where':{'id':_0xbf24e1[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x604519,null))[_0x613f('0x32')](removeEntity(_0x604519,null))[_0x613f('0x26')](handleError(_0x604519,null));};exports[_0x613f('0x54')]=function(_0x2c76c0,_0x124b3f,_0x2f1d3f){var _0x475855={};var _0x4e8955={};var _0x2c0e3a;var _0x17dbe9;return db['DeskConfiguration'][_0x613f('0x55')]({'where':{'id':_0x2c76c0['params']['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x124b3f,null))['then'](function(_0x47fc17){if(_0x47fc17){_0x2c0e3a=_0x47fc17;_0x4e8955[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x56')][_0x613f('0x37')]);_0x4e8955['query']=_[_0x613f('0x38')](_0x2c76c0[_0x613f('0x39')]);_0x4e8955[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x4e8955[_0x613f('0x3c')],_0x4e8955['query']);_0x475855[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x4e8955[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x2c76c0['query']['fields']));_0x475855[_0x613f('0x3d')]=_0x475855['attributes'][_0x613f('0x3f')]?_0x475855[_0x613f('0x3d')]:_0x4e8955[_0x613f('0x3c')];_0x475855[_0x613f('0x57')]=qs[_0x613f('0x41')](_0x2c76c0['query'][_0x613f('0x41')]);_0x475855['where']=qs[_0x613f('0x3a')](_['pick'](_0x2c76c0['query'],_0x4e8955[_0x613f('0x3a')]));if(_0x2c76c0[_0x613f('0x39')][_0x613f('0x43')]){_0x475855['where']=_[_0x613f('0x44')](_0x475855[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x475855[_0x613f('0x3d')],function(_0x9eea2c){var _0x1558c3={};_0x1558c3[_0x9eea2c]={'$like':'%'+_0x2c76c0['query'][_0x613f('0x43')]+'%'};return _0x1558c3;})});}_0x475855=_['merge']({},_0x475855,_0x2c76c0[_0x613f('0x49')]);return _0x2c0e3a[_0x613f('0x54')](_0x475855);}})['then'](function(_0x4ac819){if(_0x4ac819){_0x17dbe9=_0x4ac819[_0x613f('0x3f')];if(!_0x2c76c0['query'][_0x613f('0x40')](_0x613f('0x59'))){_0x475855[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x2c76c0['query'][_0x613f('0x2c')]);_0x475855['offset']=qs[_0x613f('0x2b')](_0x2c76c0['query']['offset']);}return _0x2c0e3a[_0x613f('0x54')](_0x475855);}})[_0x613f('0x32')](function(_0x1419e0){if(_0x1419e0){return _0x1419e0?{'count':_0x17dbe9,'rows':_0x1419e0}:null;}})[_0x613f('0x32')](respondWithResult(_0x124b3f,null))[_0x613f('0x26')](handleError(_0x124b3f,null));};exports[_0x613f('0x5a')]=function(_0x159500,_0x2a82d4,_0x53269a){var _0x2d9e31={};var _0x2a321a={};var _0x5925d9;var _0x4e4ec1;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x159500['params']['id']}})['then'](handleEntityNotFound(_0x2a82d4,null))['then'](function(_0x39e0e6){if(_0x39e0e6){_0x5925d9=_0x39e0e6;_0x2a321a['model']=_[_0x613f('0x38')](db['DeskField'][_0x613f('0x37')]);_0x2a321a[_0x613f('0x39')]=_[_0x613f('0x38')](_0x159500[_0x613f('0x39')]);_0x2a321a[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x2a321a[_0x613f('0x3c')],_0x2a321a['query']);_0x2d9e31['attributes']=_[_0x613f('0x3b')](_0x2a321a['model'],qs[_0x613f('0x3e')](_0x159500[_0x613f('0x39')][_0x613f('0x3e')]));_0x2d9e31['attributes']=_0x2d9e31[_0x613f('0x3d')]['length']?_0x2d9e31[_0x613f('0x3d')]:_0x2a321a[_0x613f('0x3c')];_0x2d9e31['order']=qs['sort'](_0x159500[_0x613f('0x39')]['sort']);_0x2d9e31[_0x613f('0x45')]=qs[_0x613f('0x3a')](_[_0x613f('0x42')](_0x159500[_0x613f('0x39')],_0x2a321a['filters']));if(_0x159500['query'][_0x613f('0x43')]){_0x2d9e31['where']=_[_0x613f('0x44')](_0x2d9e31[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x2d9e31[_0x613f('0x3d')],function(_0x59ea01){var _0x1fd89f={};_0x1fd89f[_0x59ea01]={'$like':'%'+_0x159500[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x1fd89f;})});}_0x2d9e31=_['merge']({},_0x2d9e31,_0x159500[_0x613f('0x49')]);return _0x5925d9[_0x613f('0x5a')](_0x2d9e31);}})[_0x613f('0x32')](function(_0x34b917){if(_0x34b917){_0x4e4ec1=_0x34b917[_0x613f('0x3f')];if(!_0x159500[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x2d9e31[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x159500[_0x613f('0x39')][_0x613f('0x2c')]);_0x2d9e31[_0x613f('0x2b')]=qs[_0x613f('0x2b')](_0x159500['query']['offset']);}return _0x5925d9[_0x613f('0x5a')](_0x2d9e31);}})[_0x613f('0x32')](function(_0xfe1b51){if(_0xfe1b51){return _0xfe1b51?{'count':_0x4e4ec1,'rows':_0xfe1b51}:null;}})[_0x613f('0x32')](respondWithResult(_0x2a82d4,null))['catch'](handleError(_0x2a82d4,null));};exports['getDescriptions']=function(_0x217574,_0xf89eb2,_0x12b0a){var _0x17af58={};var _0x1995db={};var _0x505578;var _0x2e37f0;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x217574[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0xf89eb2,null))['then'](function(_0x553189){if(_0x553189){_0x505578=_0x553189;_0x1995db[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x56')]['rawAttributes']);_0x1995db['query']=_['keys'](_0x217574[_0x613f('0x39')]);_0x1995db[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x1995db[_0x613f('0x3c')],_0x1995db['query']);_0x17af58[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x1995db[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x217574['query'][_0x613f('0x3e')]));_0x17af58[_0x613f('0x3d')]=_0x17af58[_0x613f('0x3d')][_0x613f('0x3f')]?_0x17af58[_0x613f('0x3d')]:_0x1995db['model'];_0x17af58[_0x613f('0x57')]=qs[_0x613f('0x41')](_0x217574[_0x613f('0x39')][_0x613f('0x41')]);_0x17af58[_0x613f('0x45')]=qs['filters'](_[_0x613f('0x42')](_0x217574['query'],_0x1995db['filters']));if(_0x217574[_0x613f('0x39')]['filter']){_0x17af58[_0x613f('0x45')]=_['merge'](_0x17af58[_0x613f('0x45')],{'$or':_['map'](_0x17af58[_0x613f('0x3d')],function(_0x3ce4cf){var _0x3140b9={};_0x3140b9[_0x3ce4cf]={'$like':'%'+_0x217574['query'][_0x613f('0x43')]+'%'};return _0x3140b9;})});}_0x17af58=_[_0x613f('0x44')]({},_0x17af58,_0x217574[_0x613f('0x49')]);return _0x505578[_0x613f('0x5b')](_0x17af58);}})['then'](function(_0x40f2f7){if(_0x40f2f7){_0x2e37f0=_0x40f2f7[_0x613f('0x3f')];if(!_0x217574[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x17af58[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x217574[_0x613f('0x39')]['limit']);_0x17af58[_0x613f('0x2b')]=qs['offset'](_0x217574[_0x613f('0x39')][_0x613f('0x2b')]);}return _0x505578[_0x613f('0x5b')](_0x17af58);}})[_0x613f('0x32')](function(_0x596b4e){if(_0x596b4e){return _0x596b4e?{'count':_0x2e37f0,'rows':_0x596b4e}:null;}})['then'](respondWithResult(_0xf89eb2,null))[_0x613f('0x26')](handleError(_0xf89eb2,null));};exports[_0x613f('0x5c')]=function(_0x272378,_0x2ca890,_0x284c5a){var _0x14a05a={};var _0x5ec9e7={};var _0x51c8e9;var _0x205ddf;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x272378[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x2ca890,null))['then'](function(_0x4b0140){if(_0x4b0140){_0x51c8e9=_0x4b0140;_0x5ec9e7[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x5d')]['rawAttributes']);_0x5ec9e7[_0x613f('0x39')]=_[_0x613f('0x38')](_0x272378[_0x613f('0x39')]);_0x5ec9e7[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x5ec9e7[_0x613f('0x3c')],_0x5ec9e7[_0x613f('0x39')]);_0x14a05a[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x5ec9e7[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x272378[_0x613f('0x39')]['fields']));_0x14a05a[_0x613f('0x3d')]=_0x14a05a[_0x613f('0x3d')][_0x613f('0x3f')]?_0x14a05a['attributes']:_0x5ec9e7[_0x613f('0x3c')];_0x14a05a['order']=qs['sort'](_0x272378[_0x613f('0x39')][_0x613f('0x41')]);_0x14a05a[_0x613f('0x45')]=qs['filters'](_[_0x613f('0x42')](_0x272378[_0x613f('0x39')],_0x5ec9e7['filters']));if(_0x272378[_0x613f('0x39')][_0x613f('0x43')]){_0x14a05a[_0x613f('0x45')]=_[_0x613f('0x44')](_0x14a05a[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x14a05a[_0x613f('0x3d')],function(_0x3eb4fb){var _0x5c6367={};_0x5c6367[_0x3eb4fb]={'$like':'%'+_0x272378[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x5c6367;})});}_0x14a05a=_[_0x613f('0x44')]({},_0x14a05a,_0x272378[_0x613f('0x49')]);return _0x51c8e9[_0x613f('0x5c')](_0x14a05a);}})[_0x613f('0x32')](function(_0x5b3b73){if(_0x5b3b73){_0x205ddf=_0x5b3b73[_0x613f('0x3f')];if(!_0x272378[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x14a05a['limit']=qs[_0x613f('0x2c')](_0x272378[_0x613f('0x39')][_0x613f('0x2c')]);_0x14a05a[_0x613f('0x2b')]=qs[_0x613f('0x2b')](_0x272378['query'][_0x613f('0x2b')]);}return _0x51c8e9[_0x613f('0x5c')](_0x14a05a);}})[_0x613f('0x32')](function(_0x32035b){if(_0x32035b){return _0x32035b?{'count':_0x205ddf,'rows':_0x32035b}:null;}})['then'](respondWithResult(_0x2ca890,null))[_0x613f('0x26')](handleError(_0x2ca890,null));};exports[_0x613f('0x5e')]=function(_0x41b7b9,_0x4f7854,_0x2509b2){if(_0x41b7b9[_0x613f('0x51')]['id']){delete _0x41b7b9[_0x613f('0x51')]['id'];}return db['DeskConfiguration'][_0x613f('0x55')]({'where':{'id':_0x41b7b9[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x4f7854,null))[_0x613f('0x32')](function(_0x122f97){if(_0x122f97){return _0x122f97[_0x613f('0x5e')](_0x41b7b9[_0x613f('0x51')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4f7854,null))[_0x613f('0x26')](handleError(_0x4f7854,null));}; \ No newline at end of file +var _0x2335=['rawAttributes','keys','query','filters','attributes','intersection','fields','model','hasOwnProperty','where','pick','type','key','VIRTUAL','field','filter','merge','options','DeskConfiguration','count','include','findAll','show','params','includeAll','find','create','body','getFields','findOne','DeskField','order','sort','map','length','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','end','status','json','offset','limit','set','Content-Range','apply','reject','destroy','sendStatus','stack','name'];(function(_0x4aa863,_0x1b8858){var _0x1974cf=function(_0x34884a){while(--_0x34884a){_0x4aa863['push'](_0x4aa863['shift']());}};_0x1974cf(++_0x1b8858);}(_0x2335,0x199));var _0x5233=function(_0x5e9e57,_0x34e826){_0x5e9e57=_0x5e9e57-0x0;var _0x57a971=_0x2335[_0x5e9e57];return _0x57a971;};'use strict';var pdf=require(_0x5233('0x0'));var emlformat=require(_0x5233('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5233('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5233('0x3'));var moment=require(_0x5233('0x4'));var BPromise=require(_0x5233('0x5'));var Mustache=require(_0x5233('0x6'));var util=require(_0x5233('0x7'));var path=require('path');var sox=require(_0x5233('0x8'));var csv=require(_0x5233('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5233('0xa'));var squel=require('squel');var crypto=require(_0x5233('0xb'));var jsforce=require(_0x5233('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5233('0xd'));var Papa=require(_0x5233('0xe'));var Redis=require('ioredis');var authService=require(_0x5233('0xf'));var qs=require(_0x5233('0x10'));var hardwareService=require(_0x5233('0x11'));var logger=require(_0x5233('0x12'))(_0x5233('0x13'));var utils=require(_0x5233('0x14'));var config=require('../../config/environment');var db=require(_0x5233('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5233('0x16')][_0x5233('0x17')]({'port':0x232a});function checkPasswordPattern(_0x55c782,_0x514079,_0x307c8f){if(_0x307c8f){var _0x3006db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3006db[_0x5233('0x18')](_0x514079)){return _0x55c782;}else{throw new Error(_0x5233('0x19'));}}else{return _0x55c782;}}function respondWithRpcPromise(_0x2d05a8,_0x2903cc,_0x4af6f0,_0x172052){return new BPromise(function(_0x545507,_0x1f7e49){var _0x1bc852=_0x172052||client;return _0x1bc852[_0x5233('0x1a')](_0x2d05a8,_0x4af6f0)[_0x5233('0x1b')](function(_0x2f6404){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x2903cc,'request\x20sent');logger[_0x5233('0x1c')](_0x5233('0x1d'),_0x2903cc,'request\x20sent',JSON[_0x5233('0x1e')](_0x2f6404));if(_0x2f6404[_0x5233('0x1f')]){if(_0x2f6404[_0x5233('0x1f')][_0x5233('0x20')]===0x1f4){logger['error'](_0x5233('0x21'),_0x2903cc,_0x2f6404['error']['message']);return _0x1f7e49(_0x2f6404[_0x5233('0x1f')][_0x5233('0x22')]);}logger['error'](_0x5233('0x21'),_0x2903cc,_0x2f6404[_0x5233('0x1f')]['message']);return _0x545507(_0x2f6404['error'][_0x5233('0x22')]);}else{logger[_0x5233('0x23')](_0x5233('0x21'),_0x2903cc,'request\x20sent');_0x545507(_0x2f6404[_0x5233('0x24')][_0x5233('0x22')]);}})[_0x5233('0x25')](function(_0x33f283){logger[_0x5233('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x2903cc,_0x33f283);_0x1f7e49(_0x33f283);});});}function respondWithStatusCode(_0x681a00,_0x5afe15){_0x5afe15=_0x5afe15||0xcc;return function(_0x4112f3){if(_0x4112f3){return _0x681a00['sendStatus'](_0x5afe15);}return _0x681a00['status'](_0x5afe15)[_0x5233('0x26')]();};}function respondWithResult(_0x4d0f1b,_0x4b0e31){_0x4b0e31=_0x4b0e31||0xc8;return function(_0x24f3bc){if(_0x24f3bc){return _0x4d0f1b[_0x5233('0x27')](_0x4b0e31)[_0x5233('0x28')](_0x24f3bc);}};}function respondWithFilteredResult(_0x48005b,_0x4e4dae){return function(_0x55c1c7){if(_0x55c1c7){var _0x2a1ee4=_0x55c1c7['count'],_0x29fc5e=_0x4e4dae[_0x5233('0x29')],_0x35e8fe=_0x4e4dae['offset']+_0x4e4dae[_0x5233('0x2a')],_0x4d1bc9;if(_0x35e8fe>=_0x2a1ee4){_0x35e8fe=_0x2a1ee4;_0x4d1bc9=0xc8;}else{_0x4d1bc9=0xce;}_0x48005b['status'](_0x4d1bc9);return _0x48005b[_0x5233('0x2b')](_0x5233('0x2c'),_0x29fc5e+'-'+_0x35e8fe+'/'+_0x2a1ee4)[_0x5233('0x28')](_0x55c1c7);}return null;};}function patchUpdates(_0x3319b9){return function(_0xa24ede){try{jsonpatch[_0x5233('0x2d')](_0xa24ede,_0x3319b9,!![]);}catch(_0x307a47){return BPromise[_0x5233('0x2e')](_0x307a47);}return _0xa24ede['save']();};}function saveUpdates(_0x2613a1,_0x230ef0){return function(_0x3d3e58){if(_0x3d3e58){return _0x3d3e58['update'](_0x2613a1)[_0x5233('0x1b')](function(_0x24171e){return _0x24171e;});}return null;};}function removeEntity(_0x2ad7e9,_0x404f6e){return function(_0x593935){if(_0x593935){return _0x593935[_0x5233('0x2f')]()[_0x5233('0x1b')](function(){_0x2ad7e9[_0x5233('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1ccc,_0xc7732a){return function(_0x2f2cc2){if(!_0x2f2cc2){_0x1c1ccc[_0x5233('0x30')](0x194);}return _0x2f2cc2;};}function handleError(_0xa13bb7,_0x5ed48d){_0x5ed48d=_0x5ed48d||0x1f4;return function(_0x4289e1){logger[_0x5233('0x1f')](_0x4289e1[_0x5233('0x31')]);if(_0x4289e1[_0x5233('0x32')]){delete _0x4289e1[_0x5233('0x32')];}_0xa13bb7[_0x5233('0x27')](_0x5ed48d)['send'](_0x4289e1);};}exports['index']=function(_0x3fc27d,_0x31e11c){var _0x22683c={},_0x460f9f={},_0x1aa5d6={'count':0x0,'rows':[]};var _0x3e41a1=db['DeskConfiguration'][_0x5233('0x33')];_0x460f9f['model']=_[_0x5233('0x34')](_0x3e41a1);_0x460f9f[_0x5233('0x35')]=_['keys'](_0x3fc27d[_0x5233('0x35')]);_0x460f9f[_0x5233('0x36')]=_['intersection'](_0x460f9f['model'],_0x460f9f[_0x5233('0x35')]);_0x22683c[_0x5233('0x37')]=_[_0x5233('0x38')](_0x460f9f['model'],qs['fields'](_0x3fc27d[_0x5233('0x35')][_0x5233('0x39')]));_0x22683c['attributes']=_0x22683c['attributes']['length']?_0x22683c[_0x5233('0x37')]:_0x460f9f[_0x5233('0x3a')];if(!_0x3fc27d[_0x5233('0x35')][_0x5233('0x3b')]('nolimit')){_0x22683c['limit']=qs[_0x5233('0x2a')](_0x3fc27d[_0x5233('0x35')][_0x5233('0x2a')]);_0x22683c[_0x5233('0x29')]=qs[_0x5233('0x29')](_0x3fc27d[_0x5233('0x35')][_0x5233('0x29')]);}_0x22683c['order']=qs['sort'](_0x3fc27d[_0x5233('0x35')]['sort']);_0x22683c[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x3fc27d[_0x5233('0x35')],_0x460f9f[_0x5233('0x36')]));if(_0x3fc27d[_0x5233('0x35')]['filter']){_0x22683c[_0x5233('0x3c')]=_['merge'](_0x22683c[_0x5233('0x3c')],{'$or':_['map'](_0x3e41a1,function(_0x238e42){if(_0x238e42[_0x5233('0x3e')][_0x5233('0x3f')]!==_0x5233('0x40')){var _0x3319a0={};_0x3319a0[_0x238e42[_0x5233('0x41')]]={'$like':'%'+_0x3fc27d[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x3319a0;}})});}_0x22683c=_[_0x5233('0x43')]({},_0x22683c,_0x3fc27d[_0x5233('0x44')]);var _0x22d535={'where':_0x22683c['where']};return db[_0x5233('0x45')][_0x5233('0x46')](_0x22d535)[_0x5233('0x1b')](function(_0x14eb80){_0x1aa5d6[_0x5233('0x46')]=_0x14eb80;if(_0x3fc27d[_0x5233('0x35')]['includeAll']){_0x22683c[_0x5233('0x47')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x5233('0x48')](_0x22683c);})['then'](function(_0x50ef35){_0x1aa5d6['rows']=_0x50ef35;return _0x1aa5d6;})[_0x5233('0x1b')](respondWithFilteredResult(_0x31e11c,_0x22683c))[_0x5233('0x25')](handleError(_0x31e11c,null));};exports[_0x5233('0x49')]=function(_0x40598c,_0x14f673){var _0x53de8e={'raw':![],'where':{'id':_0x40598c[_0x5233('0x4a')]['id']}},_0x24bbe2={};_0x24bbe2['model']=_['keys'](db[_0x5233('0x45')][_0x5233('0x33')]);_0x24bbe2['query']=_[_0x5233('0x34')](_0x40598c[_0x5233('0x35')]);_0x24bbe2[_0x5233('0x36')]=_[_0x5233('0x38')](_0x24bbe2[_0x5233('0x3a')],_0x24bbe2[_0x5233('0x35')]);_0x53de8e[_0x5233('0x37')]=_[_0x5233('0x38')](_0x24bbe2[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x40598c[_0x5233('0x35')][_0x5233('0x39')]));_0x53de8e[_0x5233('0x37')]=_0x53de8e['attributes']['length']?_0x53de8e['attributes']:_0x24bbe2['model'];if(_0x40598c[_0x5233('0x35')][_0x5233('0x4b')]){_0x53de8e[_0x5233('0x47')]=[{'all':!![]}];}_0x53de8e=_[_0x5233('0x43')]({},_0x53de8e,_0x40598c['options']);return db['DeskConfiguration'][_0x5233('0x4c')](_0x53de8e)[_0x5233('0x1b')](handleEntityNotFound(_0x14f673,null))[_0x5233('0x1b')](respondWithResult(_0x14f673,null))[_0x5233('0x25')](handleError(_0x14f673,null));};exports[_0x5233('0x4d')]=function(_0x2dd607,_0x2dff88){return db['DeskConfiguration']['create'](_0x2dd607['body'],{})[_0x5233('0x1b')](respondWithResult(_0x2dff88,0xc9))[_0x5233('0x25')](handleError(_0x2dff88,null));};exports['update']=function(_0x3a12f7,_0x132767){if(_0x3a12f7[_0x5233('0x4e')]['id']){delete _0x3a12f7[_0x5233('0x4e')]['id'];}return db[_0x5233('0x45')][_0x5233('0x4c')]({'where':{'id':_0x3a12f7[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x132767,null))['then'](saveUpdates(_0x3a12f7[_0x5233('0x4e')],null))[_0x5233('0x1b')](respondWithResult(_0x132767,null))[_0x5233('0x25')](handleError(_0x132767,null));};exports[_0x5233('0x2f')]=function(_0x4d0143,_0x5a286b){return db[_0x5233('0x45')][_0x5233('0x4c')]({'where':{'id':_0x4d0143[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a286b,null))['then'](removeEntity(_0x5a286b,null))[_0x5233('0x25')](handleError(_0x5a286b,null));};exports[_0x5233('0x4f')]=function(_0x5194cf,_0x10d3b9,_0x4e78fc){var _0x362a3a={};var _0x5c205d={};var _0x31f767;var _0x34881a;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x5194cf[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x10d3b9,null))[_0x5233('0x1b')](function(_0x48d66f){if(_0x48d66f){_0x31f767=_0x48d66f;_0x5c205d['model']=_['keys'](db[_0x5233('0x51')][_0x5233('0x33')]);_0x5c205d['query']=_[_0x5233('0x34')](_0x5194cf['query']);_0x5c205d['filters']=_[_0x5233('0x38')](_0x5c205d[_0x5233('0x3a')],_0x5c205d[_0x5233('0x35')]);_0x362a3a[_0x5233('0x37')]=_[_0x5233('0x38')](_0x5c205d[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x5194cf[_0x5233('0x35')]['fields']));_0x362a3a[_0x5233('0x37')]=_0x362a3a[_0x5233('0x37')]['length']?_0x362a3a['attributes']:_0x5c205d[_0x5233('0x3a')];_0x362a3a[_0x5233('0x52')]=qs[_0x5233('0x53')](_0x5194cf[_0x5233('0x35')]['sort']);_0x362a3a[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x5194cf[_0x5233('0x35')],_0x5c205d[_0x5233('0x36')]));if(_0x5194cf['query'][_0x5233('0x42')]){_0x362a3a['where']=_[_0x5233('0x43')](_0x362a3a[_0x5233('0x3c')],{'$or':_[_0x5233('0x54')](_0x362a3a[_0x5233('0x37')],function(_0x25a36f){var _0x1174b2={};_0x1174b2[_0x25a36f]={'$like':'%'+_0x5194cf[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x1174b2;})});}_0x362a3a=_['merge']({},_0x362a3a,_0x5194cf[_0x5233('0x44')]);return _0x31f767[_0x5233('0x4f')](_0x362a3a);}})[_0x5233('0x1b')](function(_0x527d6e){if(_0x527d6e){_0x34881a=_0x527d6e[_0x5233('0x55')];if(!_0x5194cf[_0x5233('0x35')]['hasOwnProperty'](_0x5233('0x56'))){_0x362a3a[_0x5233('0x2a')]=qs[_0x5233('0x2a')](_0x5194cf[_0x5233('0x35')][_0x5233('0x2a')]);_0x362a3a[_0x5233('0x29')]=qs['offset'](_0x5194cf[_0x5233('0x35')]['offset']);}return _0x31f767[_0x5233('0x4f')](_0x362a3a);}})['then'](function(_0x26c092){if(_0x26c092){return _0x26c092?{'count':_0x34881a,'rows':_0x26c092}:null;}})[_0x5233('0x1b')](respondWithResult(_0x10d3b9,null))[_0x5233('0x25')](handleError(_0x10d3b9,null));};exports[_0x5233('0x57')]=function(_0x114936,_0x218b14,_0x406e25){var _0x4f108b={};var _0x6c535c={};var _0x59cd61;var _0x11afd7;return db['DeskConfiguration'][_0x5233('0x50')]({'where':{'id':_0x114936['params']['id']}})['then'](handleEntityNotFound(_0x218b14,null))[_0x5233('0x1b')](function(_0x377546){if(_0x377546){_0x59cd61=_0x377546;_0x6c535c[_0x5233('0x3a')]=_[_0x5233('0x34')](db[_0x5233('0x51')][_0x5233('0x33')]);_0x6c535c[_0x5233('0x35')]=_[_0x5233('0x34')](_0x114936[_0x5233('0x35')]);_0x6c535c[_0x5233('0x36')]=_['intersection'](_0x6c535c[_0x5233('0x3a')],_0x6c535c[_0x5233('0x35')]);_0x4f108b[_0x5233('0x37')]=_[_0x5233('0x38')](_0x6c535c[_0x5233('0x3a')],qs['fields'](_0x114936[_0x5233('0x35')]['fields']));_0x4f108b[_0x5233('0x37')]=_0x4f108b[_0x5233('0x37')][_0x5233('0x55')]?_0x4f108b[_0x5233('0x37')]:_0x6c535c[_0x5233('0x3a')];_0x4f108b[_0x5233('0x52')]=qs['sort'](_0x114936['query'][_0x5233('0x53')]);_0x4f108b[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x114936[_0x5233('0x35')],_0x6c535c['filters']));if(_0x114936['query'][_0x5233('0x42')]){_0x4f108b[_0x5233('0x3c')]=_['merge'](_0x4f108b[_0x5233('0x3c')],{'$or':_[_0x5233('0x54')](_0x4f108b[_0x5233('0x37')],function(_0x574d21){var _0x3d78d7={};_0x3d78d7[_0x574d21]={'$like':'%'+_0x114936[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x3d78d7;})});}_0x4f108b=_[_0x5233('0x43')]({},_0x4f108b,_0x114936['options']);return _0x59cd61[_0x5233('0x57')](_0x4f108b);}})[_0x5233('0x1b')](function(_0x326fc4){if(_0x326fc4){_0x11afd7=_0x326fc4[_0x5233('0x55')];if(!_0x114936[_0x5233('0x35')][_0x5233('0x3b')](_0x5233('0x56'))){_0x4f108b['limit']=qs[_0x5233('0x2a')](_0x114936[_0x5233('0x35')]['limit']);_0x4f108b[_0x5233('0x29')]=qs['offset'](_0x114936['query'][_0x5233('0x29')]);}return _0x59cd61[_0x5233('0x57')](_0x4f108b);}})[_0x5233('0x1b')](function(_0x14d620){if(_0x14d620){return _0x14d620?{'count':_0x11afd7,'rows':_0x14d620}:null;}})[_0x5233('0x1b')](respondWithResult(_0x218b14,null))[_0x5233('0x25')](handleError(_0x218b14,null));};exports[_0x5233('0x58')]=function(_0x507e68,_0x476e4e,_0x399872){var _0x4988ba={};var _0x54ecbf={};var _0xf6c964;var _0x3a6a5d;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x507e68[_0x5233('0x4a')]['id']}})[_0x5233('0x1b')](handleEntityNotFound(_0x476e4e,null))['then'](function(_0x2637f3){if(_0x2637f3){_0xf6c964=_0x2637f3;_0x54ecbf[_0x5233('0x3a')]=_['keys'](db['DeskField']['rawAttributes']);_0x54ecbf[_0x5233('0x35')]=_[_0x5233('0x34')](_0x507e68[_0x5233('0x35')]);_0x54ecbf['filters']=_[_0x5233('0x38')](_0x54ecbf[_0x5233('0x3a')],_0x54ecbf[_0x5233('0x35')]);_0x4988ba[_0x5233('0x37')]=_[_0x5233('0x38')](_0x54ecbf[_0x5233('0x3a')],qs[_0x5233('0x39')](_0x507e68['query'][_0x5233('0x39')]));_0x4988ba['attributes']=_0x4988ba['attributes'][_0x5233('0x55')]?_0x4988ba[_0x5233('0x37')]:_0x54ecbf['model'];_0x4988ba[_0x5233('0x52')]=qs['sort'](_0x507e68[_0x5233('0x35')][_0x5233('0x53')]);_0x4988ba[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x507e68[_0x5233('0x35')],_0x54ecbf[_0x5233('0x36')]));if(_0x507e68[_0x5233('0x35')][_0x5233('0x42')]){_0x4988ba[_0x5233('0x3c')]=_['merge'](_0x4988ba[_0x5233('0x3c')],{'$or':_['map'](_0x4988ba['attributes'],function(_0x26d6d5){var _0x35922c={};_0x35922c[_0x26d6d5]={'$like':'%'+_0x507e68[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x35922c;})});}_0x4988ba=_[_0x5233('0x43')]({},_0x4988ba,_0x507e68[_0x5233('0x44')]);return _0xf6c964[_0x5233('0x58')](_0x4988ba);}})['then'](function(_0x556489){if(_0x556489){_0x3a6a5d=_0x556489['length'];if(!_0x507e68[_0x5233('0x35')]['hasOwnProperty']('nolimit')){_0x4988ba[_0x5233('0x2a')]=qs[_0x5233('0x2a')](_0x507e68['query'][_0x5233('0x2a')]);_0x4988ba['offset']=qs[_0x5233('0x29')](_0x507e68[_0x5233('0x35')]['offset']);}return _0xf6c964[_0x5233('0x58')](_0x4988ba);}})['then'](function(_0x18121a){if(_0x18121a){return _0x18121a?{'count':_0x3a6a5d,'rows':_0x18121a}:null;}})[_0x5233('0x1b')](respondWithResult(_0x476e4e,null))[_0x5233('0x25')](handleError(_0x476e4e,null));};exports['getTags']=function(_0x29ec89,_0x40246f,_0x22eb94){var _0x518d23={};var _0x58279f={};var _0x233d76;var _0x4f6ad0;return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x29ec89[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40246f,null))[_0x5233('0x1b')](function(_0x529b33){if(_0x529b33){_0x233d76=_0x529b33;_0x58279f['model']=_['keys'](db[_0x5233('0x59')][_0x5233('0x33')]);_0x58279f[_0x5233('0x35')]=_[_0x5233('0x34')](_0x29ec89['query']);_0x58279f[_0x5233('0x36')]=_['intersection'](_0x58279f['model'],_0x58279f[_0x5233('0x35')]);_0x518d23[_0x5233('0x37')]=_[_0x5233('0x38')](_0x58279f['model'],qs[_0x5233('0x39')](_0x29ec89['query']['fields']));_0x518d23[_0x5233('0x37')]=_0x518d23['attributes'][_0x5233('0x55')]?_0x518d23[_0x5233('0x37')]:_0x58279f[_0x5233('0x3a')];_0x518d23['order']=qs['sort'](_0x29ec89[_0x5233('0x35')]['sort']);_0x518d23[_0x5233('0x3c')]=qs[_0x5233('0x36')](_[_0x5233('0x3d')](_0x29ec89[_0x5233('0x35')],_0x58279f[_0x5233('0x36')]));if(_0x29ec89[_0x5233('0x35')]['filter']){_0x518d23[_0x5233('0x3c')]=_[_0x5233('0x43')](_0x518d23[_0x5233('0x3c')],{'$or':_['map'](_0x518d23['attributes'],function(_0x4b2b3f){var _0x5cf61c={};_0x5cf61c[_0x4b2b3f]={'$like':'%'+_0x29ec89[_0x5233('0x35')][_0x5233('0x42')]+'%'};return _0x5cf61c;})});}_0x518d23=_[_0x5233('0x43')]({},_0x518d23,_0x29ec89[_0x5233('0x44')]);return _0x233d76[_0x5233('0x5a')](_0x518d23);}})['then'](function(_0x191b51){if(_0x191b51){_0x4f6ad0=_0x191b51['length'];if(!_0x29ec89[_0x5233('0x35')]['hasOwnProperty'](_0x5233('0x56'))){_0x518d23[_0x5233('0x2a')]=qs['limit'](_0x29ec89[_0x5233('0x35')][_0x5233('0x2a')]);_0x518d23['offset']=qs['offset'](_0x29ec89['query']['offset']);}return _0x233d76['getTags'](_0x518d23);}})[_0x5233('0x1b')](function(_0x409c19){if(_0x409c19){return _0x409c19?{'count':_0x4f6ad0,'rows':_0x409c19}:null;}})[_0x5233('0x1b')](respondWithResult(_0x40246f,null))[_0x5233('0x25')](handleError(_0x40246f,null));};exports[_0x5233('0x5b')]=function(_0x373ee9,_0x3b60a4,_0x66db74){if(_0x373ee9['body']['id']){delete _0x373ee9[_0x5233('0x4e')]['id'];}return db[_0x5233('0x45')][_0x5233('0x50')]({'where':{'id':_0x373ee9[_0x5233('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b60a4,null))[_0x5233('0x1b')](function(_0x26018f){if(_0x26018f){return _0x26018f['setTags'](_0x373ee9[_0x5233('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3b60a4,null))[_0x5233('0x25')](handleError(_0x3b60a4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 68fb543..2ae3718 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 _0x766e=['../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','../../config/logger','api','moment','path','rimraf'];(function(_0x4763db,_0x4b1d33){var _0x5a41ec=function(_0xb1deda){while(--_0xb1deda){_0x4763db['push'](_0x4763db['shift']());}};_0x5a41ec(++_0x4b1d33);}(_0x766e,0x13f));var _0xe766=function(_0x283f1a,_0x271f9a){_0x283f1a=_0x283f1a-0x0;var _0x3eeb4c=_0x766e[_0x283f1a];return _0x3eeb4c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe766('0x0'))(_0xe766('0x1'));var moment=require(_0xe766('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe766('0x3'));var rimraf=require(_0xe766('0x4'));var config=require(_0xe766('0x5'));var attributes=require(_0xe766('0x6'));module[_0xe766('0x7')]=function(_0x2d2932,_0x1eaa38){return _0x2d2932['define'](_0xe766('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c5b=['exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfa4bc6,_0xededcd){var _0xf6a411=function(_0x143a79){while(--_0x143a79){_0xfa4bc6['push'](_0xfa4bc6['shift']());}};_0xf6a411(++_0xededcd);}(_0x0c5b,0x1a8));var _0xb0c5=function(_0xb7e0eb,_0x4d078d){_0xb7e0eb=_0xb7e0eb-0x0;var _0x5f26bb=_0x0c5b[_0xb7e0eb];return _0x5f26bb;};'use strict';var _=require(_0xb0c5('0x0'));var util=require(_0xb0c5('0x1'));var logger=require('../../config/logger')(_0xb0c5('0x2'));var moment=require(_0xb0c5('0x3'));var BPromise=require(_0xb0c5('0x4'));var rp=require(_0xb0c5('0x5'));var fs=require('fs');var path=require(_0xb0c5('0x6'));var rimraf=require('rimraf');var config=require(_0xb0c5('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xb0c5('0x8')]=function(_0x175e43,_0x5cf3a4){return _0x175e43[_0xb0c5('0x9')](_0xb0c5('0xa'),attributes,{'tableName':_0xb0c5('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 7157400..4078c3f 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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x43057a,_0x4e00ff){var _0x478ac8=function(_0x124b1b){while(--_0x124b1b){_0x43057a['push'](_0x43057a['shift']());}};_0x478ac8(++_0x4e00ff);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1b43bf,_0x217a57){_0x1b43bf=_0x1b43bf-0x0;var _0x5ca176=_0xdbf5[_0x1b43bf];return _0x5ca176;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0xf1ed9f,_0x54694e){_0xf1ed9f=_0xf1ed9f-0x0;var _0x412f7d=_0x4975[_0xf1ed9f];return _0x412f7d;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2ba4668..f782137 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 _0x586d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x256771,_0xd650e0){var _0x37c1cd=function(_0xfff3af){while(--_0xfff3af){_0x256771['push'](_0x256771['shift']());}};_0x37c1cd(++_0xd650e0);}(_0x586d,0x8a));var _0xd586=function(_0x1c8989,_0x1ae867){_0x1c8989=_0x1c8989-0x0;var _0xefaadc=_0x586d[_0x1c8989];return _0xefaadc;};'use strict';var multer=require(_0xd586('0x0'));var util=require(_0xd586('0x1'));var path=require(_0xd586('0x2'));var timeout=require(_0xd586('0x3'));var express=require(_0xd586('0x4'));var router=express[_0xd586('0x5')]();var auth=require(_0xd586('0x6'));var interaction=require(_0xd586('0x7'));var config=require(_0xd586('0x8'));var controller=require(_0xd586('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd586('0xa')]('/:id',auth[_0xd586('0xb')](),controller['show']);router['post']('/',auth[_0xd586('0xb')](),controller[_0xd586('0xc')]);router['put']('/:id',auth[_0xd586('0xb')](),controller[_0xd586('0xd')]);router[_0xd586('0xe')](_0xd586('0xf'),auth['isAuthenticated'](),controller[_0xd586('0x10')]);module[_0xd586('0x11')]=router; \ No newline at end of file +var _0x2326=['../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53f347,_0x28efae){var _0x5ed3eb=function(_0x296c91){while(--_0x296c91){_0x53f347['push'](_0x53f347['shift']());}};_0x5ed3eb(++_0x28efae);}(_0x2326,0x1d9));var _0x6232=function(_0xc91d83,_0x319e8a){_0xc91d83=_0xc91d83-0x0;var _0x33970e=_0x2326[_0xc91d83];return _0x33970e;};'use strict';var multer=require(_0x6232('0x0'));var util=require(_0x6232('0x1'));var path=require(_0x6232('0x2'));var timeout=require('connect-timeout');var express=require(_0x6232('0x3'));var router=express[_0x6232('0x4')]();var auth=require(_0x6232('0x5'));var interaction=require(_0x6232('0x6'));var config=require(_0x6232('0x7'));var controller=require(_0x6232('0x8'));router[_0x6232('0x9')]('/',auth[_0x6232('0xa')](),controller[_0x6232('0xb')]);router[_0x6232('0x9')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0xd')]);router['post']('/',auth[_0x6232('0xa')](),controller[_0x6232('0xe')]);router[_0x6232('0xf')](_0x6232('0xc'),auth[_0x6232('0xa')](),controller[_0x6232('0x10')]);router[_0x6232('0x11')]('/:id',auth[_0x6232('0xa')](),controller[_0x6232('0x12')]);module[_0x6232('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 898723a..32f7ff7 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 _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x3735f9,_0x1ae262){var _0x1ad32=function(_0x3a73ae){while(--_0x3a73ae){_0x3735f9['push'](_0x3735f9['shift']());}};_0x1ad32(++_0x1ae262);}(_0xd64b,0xc1));var _0xbd64=function(_0x4951a3,_0xc7bb2c){_0x4951a3=_0x4951a3-0x0;var _0x1566a1=_0xd64b[_0x4951a3];return _0x1566a1;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file +var _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x29de0c,_0x22b09c){var _0x578e2c=function(_0x39cea4){while(--_0x39cea4){_0x29de0c['push'](_0x29de0c['shift']());}};_0x578e2c(++_0x22b09c);}(_0x22fb,0x192));var _0xb22f=function(_0x4e599d,_0x4eab2c){_0x4e599d=_0x4e599d-0x0;var _0x322c3d=_0x22fb[_0x4e599d];return _0x322c3d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb22f('0x0')]('string',_0xb22f('0x1'),_0xb22f('0x2'),_0xb22f('0x3')),'defaultValue':_0xb22f('0x4')},'content':{'type':Sequelize[_0xb22f('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb22f('0x0')](_0xb22f('0x4'),_0xb22f('0x1'),_0xb22f('0x2'))},'keyContent':{'type':Sequelize[_0xb22f('0x5')]},'idField':{'type':Sequelize[_0xb22f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb22f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb22f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 403e09b..4242e45 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 _0x5089=['length','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','includeAll','catch','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','DeskField','rawAttributes','model','keys','query','intersection','fields','attributes'];(function(_0x2d6207,_0x6c515d){var _0x5b3eee=function(_0x3d68a3){while(--_0x3d68a3){_0x2d6207['push'](_0x2d6207['shift']());}};_0x5b3eee(++_0x6c515d);}(_0x5089,0x1bb));var _0x9508=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x5089[_0x1ee62e];return _0x27c6c8;};'use strict';var pdf=require(_0x9508('0x0'));var emlformat=require(_0x9508('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9508('0x2'));var jsonpatch=require(_0x9508('0x3'));var rp=require(_0x9508('0x4'));var moment=require(_0x9508('0x5'));var BPromise=require(_0x9508('0x6'));var Mustache=require('mustache');var util=require(_0x9508('0x7'));var path=require('path');var sox=require(_0x9508('0x8'));var csv=require(_0x9508('0x9'));var ejs=require(_0x9508('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9508('0xb'));var crypto=require(_0x9508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9508('0xd'));var toCsv=require(_0x9508('0x9'));var querystring=require('querystring');var Papa=require(_0x9508('0xe'));var Redis=require('ioredis');var authService=require(_0x9508('0xf'));var qs=require(_0x9508('0x10'));var hardwareService=require(_0x9508('0x11'));var logger=require(_0x9508('0x12'))(_0x9508('0x13'));var utils=require(_0x9508('0x14'));var config=require('../../config/environment');var db=require(_0x9508('0x15'))['db'];function respondWithStatusCode(_0x507887,_0x2c4fd9){_0x2c4fd9=_0x2c4fd9||0xcc;return function(_0x396896){if(_0x396896){return _0x507887['sendStatus'](_0x2c4fd9);}return _0x507887[_0x9508('0x16')](_0x2c4fd9)[_0x9508('0x17')]();};}function respondWithResult(_0x10ceef,_0x4701de){_0x4701de=_0x4701de||0xc8;return function(_0x51ef92){if(_0x51ef92){return _0x10ceef[_0x9508('0x16')](_0x4701de)[_0x9508('0x18')](_0x51ef92);}};}function respondWithFilteredResult(_0x51c80b,_0x2a281d){return function(_0x539746){if(_0x539746){var _0x25d4d6=_0x539746[_0x9508('0x19')],_0x418889=_0x2a281d[_0x9508('0x1a')],_0x374c03=_0x2a281d[_0x9508('0x1a')]+_0x2a281d[_0x9508('0x1b')],_0x255a03;if(_0x374c03>=_0x25d4d6){_0x374c03=_0x25d4d6;_0x255a03=0xc8;}else{_0x255a03=0xce;}_0x51c80b['status'](_0x255a03);return _0x51c80b[_0x9508('0x1c')](_0x9508('0x1d'),_0x418889+'-'+_0x374c03+'/'+_0x25d4d6)[_0x9508('0x18')](_0x539746);}return null;};}function patchUpdates(_0x1ba7e6){return function(_0x23c30e){try{jsonpatch[_0x9508('0x1e')](_0x23c30e,_0x1ba7e6,!![]);}catch(_0x52e3c4){return BPromise['reject'](_0x52e3c4);}return _0x23c30e[_0x9508('0x1f')]();};}function saveUpdates(_0x47f7a2,_0x2272e2){return function(_0x4e9e9f){if(_0x4e9e9f){return _0x4e9e9f[_0x9508('0x20')](_0x47f7a2)[_0x9508('0x21')](function(_0x226f29){return _0x226f29;});}return null;};}function removeEntity(_0x1dfc6c,_0x1edf1b){return function(_0x2f8106){if(_0x2f8106){return _0x2f8106[_0x9508('0x22')]()['then'](function(){_0x1dfc6c['status'](0xcc)[_0x9508('0x17')]();});}};}function handleEntityNotFound(_0x1b70e6,_0x39e6b0){return function(_0xf70830){if(!_0xf70830){_0x1b70e6[_0x9508('0x23')](0x194);}return _0xf70830;};}function handleError(_0x20d2ce,_0x4b68e9){_0x4b68e9=_0x4b68e9||0x1f4;return function(_0x5e9a80){logger[_0x9508('0x24')](_0x5e9a80['stack']);if(_0x5e9a80['name']){delete _0x5e9a80[_0x9508('0x25')];}_0x20d2ce['status'](_0x4b68e9)['send'](_0x5e9a80);};}exports[_0x9508('0x26')]=function(_0x30da92,_0x57c7ae){var _0x49246b={},_0x32b0dd={},_0x22b2e2={'count':0x0,'rows':[]};var _0x4529a8=db[_0x9508('0x27')][_0x9508('0x28')];_0x32b0dd[_0x9508('0x29')]=_[_0x9508('0x2a')](_0x4529a8);_0x32b0dd[_0x9508('0x2b')]=_[_0x9508('0x2a')](_0x30da92[_0x9508('0x2b')]);_0x32b0dd['filters']=_[_0x9508('0x2c')](_0x32b0dd[_0x9508('0x29')],_0x32b0dd[_0x9508('0x2b')]);_0x49246b['attributes']=_[_0x9508('0x2c')](_0x32b0dd[_0x9508('0x29')],qs['fields'](_0x30da92[_0x9508('0x2b')][_0x9508('0x2d')]));_0x49246b['attributes']=_0x49246b[_0x9508('0x2e')][_0x9508('0x2f')]?_0x49246b[_0x9508('0x2e')]:_0x32b0dd[_0x9508('0x29')];if(!_0x30da92['query']['hasOwnProperty'](_0x9508('0x30'))){_0x49246b[_0x9508('0x1b')]=qs[_0x9508('0x1b')](_0x30da92['query']['limit']);_0x49246b[_0x9508('0x1a')]=qs[_0x9508('0x1a')](_0x30da92[_0x9508('0x2b')][_0x9508('0x1a')]);}_0x49246b[_0x9508('0x31')]=qs[_0x9508('0x32')](_0x30da92[_0x9508('0x2b')][_0x9508('0x32')]);_0x49246b[_0x9508('0x33')]=qs[_0x9508('0x34')](_['pick'](_0x30da92[_0x9508('0x2b')],_0x32b0dd[_0x9508('0x34')]));if(_0x30da92['query'][_0x9508('0x35')]){_0x49246b[_0x9508('0x33')]=_[_0x9508('0x36')](_0x49246b[_0x9508('0x33')],{'$or':_[_0x9508('0x37')](_0x4529a8,function(_0x31ab9c){if(_0x31ab9c[_0x9508('0x38')][_0x9508('0x39')]!==_0x9508('0x3a')){var _0x98ff75={};_0x98ff75[_0x31ab9c[_0x9508('0x3b')]]={'$like':'%'+_0x30da92['query'][_0x9508('0x35')]+'%'};return _0x98ff75;}})});}_0x49246b=_['merge']({},_0x49246b,_0x30da92[_0x9508('0x3c')]);var _0x1dd6c9={'where':_0x49246b[_0x9508('0x33')]};return db['DeskField']['count'](_0x1dd6c9)[_0x9508('0x21')](function(_0x1f28f6){_0x22b2e2[_0x9508('0x19')]=_0x1f28f6;if(_0x30da92[_0x9508('0x2b')]['includeAll']){_0x49246b[_0x9508('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x9508('0x3e')](_0x49246b);})[_0x9508('0x21')](function(_0x5205f8){_0x22b2e2[_0x9508('0x3f')]=_0x5205f8;return _0x22b2e2;})[_0x9508('0x21')](respondWithFilteredResult(_0x57c7ae,_0x49246b))['catch'](handleError(_0x57c7ae,null));};exports[_0x9508('0x40')]=function(_0x1e6851,_0x5b601d){var _0x12fdc6={'raw':!![],'where':{'id':_0x1e6851['params']['id']}},_0x4e2561={};_0x4e2561[_0x9508('0x29')]=_['keys'](db[_0x9508('0x27')][_0x9508('0x28')]);_0x4e2561[_0x9508('0x2b')]=_[_0x9508('0x2a')](_0x1e6851['query']);_0x4e2561['filters']=_['intersection'](_0x4e2561[_0x9508('0x29')],_0x4e2561['query']);_0x12fdc6[_0x9508('0x2e')]=_['intersection'](_0x4e2561[_0x9508('0x29')],qs[_0x9508('0x2d')](_0x1e6851[_0x9508('0x2b')][_0x9508('0x2d')]));_0x12fdc6['attributes']=_0x12fdc6[_0x9508('0x2e')][_0x9508('0x2f')]?_0x12fdc6[_0x9508('0x2e')]:_0x4e2561['model'];if(_0x1e6851[_0x9508('0x2b')][_0x9508('0x41')]){_0x12fdc6['include']=[{'all':!![]}];}_0x12fdc6=_[_0x9508('0x36')]({},_0x12fdc6,_0x1e6851['options']);return db[_0x9508('0x27')]['find'](_0x12fdc6)['then'](handleEntityNotFound(_0x5b601d,null))[_0x9508('0x21')](respondWithResult(_0x5b601d,null))[_0x9508('0x42')](handleError(_0x5b601d,null));};exports[_0x9508('0x43')]=function(_0x9c674f,_0xf17d3a){return db[_0x9508('0x27')]['create'](_0x9c674f[_0x9508('0x44')],{})[_0x9508('0x21')](respondWithResult(_0xf17d3a,0xc9))[_0x9508('0x42')](handleError(_0xf17d3a,null));};exports['update']=function(_0x2ee9e,_0xe81056){if(_0x2ee9e[_0x9508('0x44')]['id']){delete _0x2ee9e[_0x9508('0x44')]['id'];}return db['DeskField'][_0x9508('0x45')]({'where':{'id':_0x2ee9e['params']['id']}})[_0x9508('0x21')](handleEntityNotFound(_0xe81056,null))[_0x9508('0x21')](saveUpdates(_0x2ee9e['body'],null))[_0x9508('0x21')](respondWithResult(_0xe81056,null))[_0x9508('0x42')](handleError(_0xe81056,null));};exports['destroy']=function(_0x61eb2c,_0x22306e){return db['DeskField'][_0x9508('0x45')]({'where':{'id':_0x61eb2c['params']['id']}})[_0x9508('0x21')](handleEntityNotFound(_0x22306e,null))['then'](removeEntity(_0x22306e,null))[_0x9508('0x42')](handleError(_0x22306e,null));}; \ No newline at end of file +var _0x4c4e=['end','error','name','index','rawAttributes','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','DeskField','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0xe34092,_0x2f01b3){var _0x153313=function(_0x346221){while(--_0x346221){_0xe34092['push'](_0xe34092['shift']());}};_0x153313(++_0x2f01b3);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2db903,_0x1672a9){_0x2db903=_0x2db903-0x0;var _0x132516=_0x4c4e[_0x2db903];return _0x132516;};'use strict';var pdf=require(_0xe4c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe4c4('0x1'));var zipdir=require(_0xe4c4('0x2'));var jsonpatch=require(_0xe4c4('0x3'));var rp=require('request-promise');var moment=require(_0xe4c4('0x4'));var BPromise=require(_0xe4c4('0x5'));var Mustache=require(_0xe4c4('0x6'));var util=require('util');var path=require(_0xe4c4('0x7'));var sox=require('sox');var csv=require(_0xe4c4('0x8'));var ejs=require(_0xe4c4('0x9'));var fs=require('fs');var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0xf'));var authService=require(_0xe4c4('0x10'));var qs=require(_0xe4c4('0x11'));var hardwareService=require(_0xe4c4('0x12'));var logger=require(_0xe4c4('0x13'))(_0xe4c4('0x14'));var utils=require('../../config/utils');var config=require(_0xe4c4('0x15'));var db=require(_0xe4c4('0x16'))['db'];function respondWithStatusCode(_0x3805c5,_0x2483d0){_0x2483d0=_0x2483d0||0xcc;return function(_0x50bfab){if(_0x50bfab){return _0x3805c5[_0xe4c4('0x17')](_0x2483d0);}return _0x3805c5[_0xe4c4('0x18')](_0x2483d0)['end']();};}function respondWithResult(_0xe485ca,_0x1a44e5){_0x1a44e5=_0x1a44e5||0xc8;return function(_0x5aa89b){if(_0x5aa89b){return _0xe485ca[_0xe4c4('0x18')](_0x1a44e5)[_0xe4c4('0x19')](_0x5aa89b);}};}function respondWithFilteredResult(_0x5e263c,_0x307aa8){return function(_0x465c9b){if(_0x465c9b){var _0x26ea05=_0x465c9b[_0xe4c4('0x1a')],_0x40a36e=_0x307aa8[_0xe4c4('0x1b')],_0x19e59b=_0x307aa8[_0xe4c4('0x1b')]+_0x307aa8[_0xe4c4('0x1c')],_0x882be2;if(_0x19e59b>=_0x26ea05){_0x19e59b=_0x26ea05;_0x882be2=0xc8;}else{_0x882be2=0xce;}_0x5e263c[_0xe4c4('0x18')](_0x882be2);return _0x5e263c[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x40a36e+'-'+_0x19e59b+'/'+_0x26ea05)[_0xe4c4('0x19')](_0x465c9b);}return null;};}function patchUpdates(_0x376585){return function(_0x5a32b5){try{jsonpatch[_0xe4c4('0x1f')](_0x5a32b5,_0x376585,!![]);}catch(_0x24f946){return BPromise[_0xe4c4('0x20')](_0x24f946);}return _0x5a32b5[_0xe4c4('0x21')]();};}function saveUpdates(_0x5da165,_0x3d5856){return function(_0x1cad5d){if(_0x1cad5d){return _0x1cad5d[_0xe4c4('0x22')](_0x5da165)[_0xe4c4('0x23')](function(_0x2c5aea){return _0x2c5aea;});}return null;};}function removeEntity(_0x435940,_0x1d4597){return function(_0x393c96){if(_0x393c96){return _0x393c96[_0xe4c4('0x24')]()[_0xe4c4('0x23')](function(){_0x435940[_0xe4c4('0x18')](0xcc)[_0xe4c4('0x25')]();});}};}function handleEntityNotFound(_0x138ead,_0x1db719){return function(_0x15873e){if(!_0x15873e){_0x138ead['sendStatus'](0x194);}return _0x15873e;};}function handleError(_0x49cadc,_0x403a2c){_0x403a2c=_0x403a2c||0x1f4;return function(_0x4dc8cc){logger[_0xe4c4('0x26')](_0x4dc8cc['stack']);if(_0x4dc8cc[_0xe4c4('0x27')]){delete _0x4dc8cc['name'];}_0x49cadc[_0xe4c4('0x18')](_0x403a2c)['send'](_0x4dc8cc);};}exports[_0xe4c4('0x28')]=function(_0x4a0199,_0x5a2adb){var _0x4cea1f={},_0x5d66ab={},_0x3221cd={'count':0x0,'rows':[]};var _0x48cfe0=db['DeskField'][_0xe4c4('0x29')];_0x5d66ab[_0xe4c4('0x2a')]=_['keys'](_0x48cfe0);_0x5d66ab['query']=_[_0xe4c4('0x2b')](_0x4a0199[_0xe4c4('0x2c')]);_0x5d66ab['filters']=_[_0xe4c4('0x2d')](_0x5d66ab[_0xe4c4('0x2a')],_0x5d66ab[_0xe4c4('0x2c')]);_0x4cea1f['attributes']=_['intersection'](_0x5d66ab[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x4cea1f['attributes']=_0x4cea1f['attributes'][_0xe4c4('0x2f')]?_0x4cea1f[_0xe4c4('0x30')]:_0x5d66ab['model'];if(!_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x31')](_0xe4c4('0x32'))){_0x4cea1f['limit']=qs[_0xe4c4('0x1c')](_0x4a0199['query'][_0xe4c4('0x1c')]);_0x4cea1f[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x1b')]);}_0x4cea1f[_0xe4c4('0x33')]=qs[_0xe4c4('0x34')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x34')]);_0x4cea1f[_0xe4c4('0x35')]=qs[_0xe4c4('0x36')](_[_0xe4c4('0x37')](_0x4a0199['query'],_0x5d66ab[_0xe4c4('0x36')]));if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]){_0x4cea1f['where']=_[_0xe4c4('0x39')](_0x4cea1f[_0xe4c4('0x35')],{'$or':_[_0xe4c4('0x3a')](_0x48cfe0,function(_0x53eb5b){if(_0x53eb5b[_0xe4c4('0x3b')][_0xe4c4('0x3c')]!==_0xe4c4('0x3d')){var _0x1de955={};_0x1de955[_0x53eb5b[_0xe4c4('0x3e')]]={'$like':'%'+_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x38')]+'%'};return _0x1de955;}})});}_0x4cea1f=_[_0xe4c4('0x39')]({},_0x4cea1f,_0x4a0199[_0xe4c4('0x3f')]);var _0x8b5bf3={'where':_0x4cea1f['where']};return db[_0xe4c4('0x40')][_0xe4c4('0x1a')](_0x8b5bf3)[_0xe4c4('0x23')](function(_0x3c16a5){_0x3221cd['count']=_0x3c16a5;if(_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x41')]){_0x4cea1f['include']=[{'all':!![]}];}return db[_0xe4c4('0x40')][_0xe4c4('0x42')](_0x4cea1f);})['then'](function(_0x433f0c){_0x3221cd[_0xe4c4('0x43')]=_0x433f0c;return _0x3221cd;})[_0xe4c4('0x23')](respondWithFilteredResult(_0x5a2adb,_0x4cea1f))[_0xe4c4('0x44')](handleError(_0x5a2adb,null));};exports[_0xe4c4('0x45')]=function(_0xe7a882,_0x96dd48){var _0x43201e={'raw':!![],'where':{'id':_0xe7a882[_0xe4c4('0x46')]['id']}},_0x1e457c={};_0x1e457c[_0xe4c4('0x2a')]=_[_0xe4c4('0x2b')](db['DeskField'][_0xe4c4('0x29')]);_0x1e457c[_0xe4c4('0x2c')]=_[_0xe4c4('0x2b')](_0xe7a882[_0xe4c4('0x2c')]);_0x1e457c[_0xe4c4('0x36')]=_[_0xe4c4('0x2d')](_0x1e457c['model'],_0x1e457c[_0xe4c4('0x2c')]);_0x43201e['attributes']=_[_0xe4c4('0x2d')](_0x1e457c[_0xe4c4('0x2a')],qs[_0xe4c4('0x2e')](_0xe7a882[_0xe4c4('0x2c')][_0xe4c4('0x2e')]));_0x43201e['attributes']=_0x43201e['attributes'][_0xe4c4('0x2f')]?_0x43201e[_0xe4c4('0x30')]:_0x1e457c[_0xe4c4('0x2a')];if(_0xe7a882['query'][_0xe4c4('0x41')]){_0x43201e[_0xe4c4('0x47')]=[{'all':!![]}];}_0x43201e=_[_0xe4c4('0x39')]({},_0x43201e,_0xe7a882[_0xe4c4('0x3f')]);return db['DeskField'][_0xe4c4('0x48')](_0x43201e)[_0xe4c4('0x23')](handleEntityNotFound(_0x96dd48,null))[_0xe4c4('0x23')](respondWithResult(_0x96dd48,null))[_0xe4c4('0x44')](handleError(_0x96dd48,null));};exports[_0xe4c4('0x49')]=function(_0x1e459e,_0x1eda5e){return db[_0xe4c4('0x40')][_0xe4c4('0x49')](_0x1e459e['body'],{})[_0xe4c4('0x23')](respondWithResult(_0x1eda5e,0xc9))['catch'](handleError(_0x1eda5e,null));};exports[_0xe4c4('0x22')]=function(_0x7a40c2,_0x396f7a){if(_0x7a40c2[_0xe4c4('0x4a')]['id']){delete _0x7a40c2[_0xe4c4('0x4a')]['id'];}return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x7a40c2[_0xe4c4('0x46')]['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x396f7a,null))[_0xe4c4('0x23')](saveUpdates(_0x7a40c2[_0xe4c4('0x4a')],null))[_0xe4c4('0x23')](respondWithResult(_0x396f7a,null))[_0xe4c4('0x44')](handleError(_0x396f7a,null));};exports[_0xe4c4('0x24')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x40')][_0xe4c4('0x48')]({'where':{'id':_0x535bcc['params']['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x4922f5,null))[_0xe4c4('0x23')](removeEntity(_0x4922f5,null))[_0xe4c4('0x44')](handleError(_0x4922f5,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6cb0246..7170cfa 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 _0x1eb8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','desk_unique_index','FieldId'];(function(_0x362ade,_0x3e8b6a){var _0x1c985e=function(_0x1742f7){while(--_0x1742f7){_0x362ade['push'](_0x362ade['shift']());}};_0x1c985e(++_0x3e8b6a);}(_0x1eb8,0xfc));var _0x81eb=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0x1eb8[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require(_0x81eb('0x0'));var util=require(_0x81eb('0x1'));var logger=require(_0x81eb('0x2'))(_0x81eb('0x3'));var moment=require(_0x81eb('0x4'));var BPromise=require(_0x81eb('0x5'));var rp=require(_0x81eb('0x6'));var fs=require('fs');var path=require(_0x81eb('0x7'));var rimraf=require(_0x81eb('0x8'));var config=require('../../config/environment');var attributes=require(_0x81eb('0x9'));module[_0x81eb('0xa')]=function(_0x57fbed,_0x476117){return _0x57fbed[_0x81eb('0xb')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x81eb('0xc'),'fields':['idField',_0x81eb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b28=['util','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','desk_unique_index','idField','lodash'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x5b28,0x1e0));var _0x85b2=function(_0x55f216,_0x58f60b){_0x55f216=_0x55f216-0x0;var _0x1d288=_0x5b28[_0x55f216];return _0x1d288;};'use strict';var _=require(_0x85b2('0x0'));var util=require(_0x85b2('0x1'));var logger=require('../../config/logger')(_0x85b2('0x2'));var moment=require(_0x85b2('0x3'));var BPromise=require(_0x85b2('0x4'));var rp=require(_0x85b2('0x5'));var fs=require('fs');var path=require(_0x85b2('0x6'));var rimraf=require(_0x85b2('0x7'));var config=require('../../config/environment');var attributes=require(_0x85b2('0x8'));module[_0x85b2('0x9')]=function(_0x3f59c7,_0x2f8991){return _0x3f59c7[_0x85b2('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x85b2('0xb'),'fields':[_0x85b2('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 7d360c0..041c26c 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 _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x251d43,_0xd5a05a){var _0x3d7759=function(_0x13bd1c){while(--_0x13bd1c){_0x251d43['push'](_0x251d43['shift']());}};_0x3d7759(++_0xd5a05a);}(_0x702d,0x147));var _0xd702=function(_0x2a2271,_0x141af0){_0x2a2271=_0x2a2271-0x0;var _0x5c08c0=_0x702d[_0x2a2271];return _0x5c08c0;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file +var _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5b9c0e,_0x3e0c45){var _0x236b66=function(_0x57b7a8){while(--_0x57b7a8){_0x5b9c0e['push'](_0x5b9c0e['shift']());}};_0x236b66(++_0x3e0c45);}(_0x668b,0x140));var _0xb668=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x668b[_0x485f53];return _0x480f1e;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('DeskField,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 5dfa9a4..7f235f9 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 _0xd868=['addConfiguration','put','update','delete','/:id','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','create'];(function(_0x4b3358,_0x5cda77){var _0x1ea011=function(_0x1a17ea){while(--_0x1a17ea){_0x4b3358['push'](_0x4b3358['shift']());}};_0x1ea011(++_0x5cda77);}(_0xd868,0xd9));var _0x8d86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd868[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8d86('0x0'));var path=require(_0x8d86('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d86('0x2'));var router=express['Router']();var auth=require(_0x8d86('0x3'));var interaction=require(_0x8d86('0x4'));var config=require(_0x8d86('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x8d86('0x6')]('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0x8')]);router[_0x8d86('0x6')]('/:id',auth[_0x8d86('0x7')](),controller[_0x8d86('0x9')]);router['get'](_0x8d86('0xa'),auth[_0x8d86('0x7')](),controller[_0x8d86('0xb')]);router['get']('/:id/fields',auth[_0x8d86('0x7')](),controller['getFields']);router[_0x8d86('0xc')]('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0xd')]);router[_0x8d86('0xc')](_0x8d86('0xa'),auth['isAuthenticated'](),controller[_0x8d86('0xe')]);router[_0x8d86('0xf')]('/:id',auth[_0x8d86('0x7')](),controller[_0x8d86('0x10')]);router[_0x8d86('0x11')](_0x8d86('0x12'),auth['isAuthenticated'](),controller[_0x8d86('0x13')]);module[_0x8d86('0x14')]=router; \ No newline at end of file +var _0xf229=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x502a8e,_0x238224){var _0x5c7054=function(_0x2915f1){while(--_0x2915f1){_0x502a8e['push'](_0x502a8e['shift']());}};_0x5c7054(++_0x238224);}(_0xf229,0x14a));var _0x9f22=function(_0x43cc7d,_0x8e14a2){_0x43cc7d=_0x43cc7d-0x0;var _0x36bd75=_0xf229[_0x43cc7d];return _0x36bd75;};'use strict';var multer=require(_0x9f22('0x0'));var util=require(_0x9f22('0x1'));var path=require(_0x9f22('0x2'));var timeout=require(_0x9f22('0x3'));var express=require('express');var router=express[_0x9f22('0x4')]();var auth=require(_0x9f22('0x5'));var interaction=require(_0x9f22('0x6'));var config=require('../../config/environment');var controller=require(_0x9f22('0x7'));router[_0x9f22('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f22('0x9')]);router[_0x9f22('0x8')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0xc')]);router['get'](_0x9f22('0xd'),auth['isAuthenticated'](),controller[_0x9f22('0xe')]);router[_0x9f22('0x8')](_0x9f22('0xf'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x10')]);router[_0x9f22('0x11')]('/',auth['isAuthenticated'](),controller[_0x9f22('0x12')]);router['post'](_0x9f22('0xd'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x13')]);router[_0x9f22('0x14')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x15')]);router[_0x9f22('0x16')](_0x9f22('0xa'),auth[_0x9f22('0xb')](),controller[_0x9f22('0x17')]);module[_0x9f22('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 55151de..c8200eb 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 _0xcbd6=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbd6,0x114));var _0x6cbd=function(_0x19d378,_0x26d5c6){_0x19d378=_0x19d378-0x0;var _0x23a2d7=_0xcbd6[_0x19d378];return _0x23a2d7;};'use strict';var Sequelize=require(_0x6cbd('0x0'));module[_0x6cbd('0x1')]={'name':{'type':Sequelize[_0x6cbd('0x2')]},'username':{'type':Sequelize[_0x6cbd('0x2')]},'password':{'type':Sequelize[_0x6cbd('0x2')]},'remoteUri':{'type':Sequelize[_0x6cbd('0x2')]},'tenantId':{'type':Sequelize[_0x6cbd('0x2')]},'clientId':{'type':Sequelize[_0x6cbd('0x2')]},'clientSecret':{'type':Sequelize[_0x6cbd('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6cbd('0x2')]}}; \ No newline at end of file +var _0x5c9c=['sequelize','exports','STRING'];(function(_0x3ae8f4,_0x2920f4){var _0x367312=function(_0x4dffbf){while(--_0x4dffbf){_0x3ae8f4['push'](_0x3ae8f4['shift']());}};_0x367312(++_0x2920f4);}(_0x5c9c,0x111));var _0xc5c9=function(_0x249cc6,_0x6373f){_0x249cc6=_0x249cc6-0x0;var _0x153294=_0x5c9c[_0x249cc6];return _0x153294;};'use strict';var Sequelize=require(_0xc5c9('0x0'));module[_0xc5c9('0x1')]={'name':{'type':Sequelize[_0xc5c9('0x2')]},'username':{'type':Sequelize[_0xc5c9('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5c9('0x2')]},'tenantId':{'type':Sequelize[_0xc5c9('0x2')]},'clientId':{'type':Sequelize[_0xc5c9('0x2')]},'clientSecret':{'type':Sequelize[_0xc5c9('0x2')]},'serverUrl':{'type':Sequelize[_0xc5c9('0x2')]},'description':{'type':Sequelize[_0xc5c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f417ced..aed9a5b 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 _0xc8f8=['StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','send','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../mysqldb','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','end','stack','name','index','Dynamics365Account','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','destroy','getConfigurations','findOne','Dynamics365Configuration','pick','map','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','Incident','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','username','password','remoteUri','clientId','clientSecret','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','access_token','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','push','forEach','isNil','substring','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata'];(function(_0x5e9841,_0x51d53b){var _0x33e84f=function(_0x24623a){while(--_0x24623a){_0x5e9841['push'](_0x5e9841['shift']());}};_0x33e84f(++_0x51d53b);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xc8f8[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require(_0x8c8f('0x0'));var emlformat=require(_0x8c8f('0x1'));var rimraf=require(_0x8c8f('0x2'));var zipdir=require(_0x8c8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c8f('0x4'));var moment=require(_0x8c8f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c8f('0x6'));var util=require(_0x8c8f('0x7'));var path=require(_0x8c8f('0x8'));var sox=require(_0x8c8f('0x9'));var csv=require(_0x8c8f('0xa'));var ejs=require(_0x8c8f('0xb'));var fs=require('fs');var _=require(_0x8c8f('0xc'));var squel=require(_0x8c8f('0xd'));var crypto=require(_0x8c8f('0xe'));var jsforce=require(_0x8c8f('0xf'));var deskjs=require(_0x8c8f('0x10'));var toCsv=require(_0x8c8f('0xa'));var querystring=require(_0x8c8f('0x11'));var Papa=require('papaparse');var Redis=require(_0x8c8f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8c8f('0x13'));var logger=require('../../config/logger')(_0x8c8f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8c8f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x8c8f('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3cf77d,_0x3d2413,_0x3dedf5){if(_0x3dedf5){var _0x15f54d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15f54d['test'](_0x3d2413)){return _0x3cf77d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3cf77d;}}function respondWithRpcPromise(_0x321462,_0x3f3ff7,_0x42e084,_0x5b77f2){return new BPromise(function(_0x2edd9a,_0x2613dd){var _0x5ad27d=_0x5b77f2||client;return _0x5ad27d[_0x8c8f('0x17')](_0x321462,_0x42e084)[_0x8c8f('0x18')](function(_0x358c2a){logger[_0x8c8f('0x19')]('Dynamics365Account,\x20%s,\x20%s',_0x3f3ff7,_0x8c8f('0x1a'));logger[_0x8c8f('0x1b')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3f3ff7,_0x8c8f('0x1a'),JSON[_0x8c8f('0x1c')](_0x358c2a));if(_0x358c2a[_0x8c8f('0x1d')]){if(_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1e')]===0x1f4){logger[_0x8c8f('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x3f3ff7,_0x358c2a[_0x8c8f('0x1d')]['message']);return _0x2613dd(_0x358c2a['error'][_0x8c8f('0x1f')]);}logger[_0x8c8f('0x1d')](_0x8c8f('0x20'),_0x3f3ff7,_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1f')]);return _0x2edd9a(_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1f')]);}else{logger[_0x8c8f('0x19')](_0x8c8f('0x20'),_0x3f3ff7,_0x8c8f('0x1a'));_0x2edd9a(_0x358c2a[_0x8c8f('0x21')]['message']);}})[_0x8c8f('0x22')](function(_0x2c7939){logger[_0x8c8f('0x1d')](_0x8c8f('0x20'),_0x3f3ff7,_0x2c7939);_0x2613dd(_0x2c7939);});});}function respondWithStatusCode(_0x38631b,_0x488924){_0x488924=_0x488924||0xcc;return function(_0x7d258d){if(_0x7d258d){return _0x38631b[_0x8c8f('0x23')](_0x488924);}return _0x38631b[_0x8c8f('0x24')](_0x488924)['end']();};}function respondWithResult(_0x432933,_0x1a8c4a){_0x1a8c4a=_0x1a8c4a||0xc8;return function(_0x6e4ad2){if(_0x6e4ad2){return _0x432933[_0x8c8f('0x24')](_0x1a8c4a)[_0x8c8f('0x25')](_0x6e4ad2);}};}function respondWithFilteredResult(_0x3f14c9,_0x1fa65){return function(_0x5b1fe9){if(_0x5b1fe9){var _0x2a7838=_0x5b1fe9[_0x8c8f('0x26')],_0x274a2b=_0x1fa65['offset'],_0x30e8e7=_0x1fa65[_0x8c8f('0x27')]+_0x1fa65[_0x8c8f('0x28')],_0x5bbb6b;if(_0x30e8e7>=_0x2a7838){_0x30e8e7=_0x2a7838;_0x5bbb6b=0xc8;}else{_0x5bbb6b=0xce;}_0x3f14c9[_0x8c8f('0x24')](_0x5bbb6b);return _0x3f14c9[_0x8c8f('0x29')](_0x8c8f('0x2a'),_0x274a2b+'-'+_0x30e8e7+'/'+_0x2a7838)[_0x8c8f('0x25')](_0x5b1fe9);}return null;};}function patchUpdates(_0x2f7791){return function(_0x379d3d){try{jsonpatch[_0x8c8f('0x2b')](_0x379d3d,_0x2f7791,!![]);}catch(_0x5a6bdb){return BPromise['reject'](_0x5a6bdb);}return _0x379d3d[_0x8c8f('0x2c')]();};}function saveUpdates(_0x4c96d5,_0x5edc6d){return function(_0x2b5b91){if(_0x2b5b91){return _0x2b5b91[_0x8c8f('0x2d')](_0x4c96d5)[_0x8c8f('0x18')](function(_0x58632e){return _0x58632e;});}return null;};}function removeEntity(_0x4b9a7c,_0x2f2879){return function(_0x553ae1){if(_0x553ae1){return _0x553ae1['destroy']()[_0x8c8f('0x18')](function(){_0x4b9a7c[_0x8c8f('0x24')](0xcc)[_0x8c8f('0x2e')]();});}};}function handleEntityNotFound(_0xed4a4f,_0x365ddf){return function(_0x252238){if(!_0x252238){_0xed4a4f['sendStatus'](0x194);}return _0x252238;};}function handleError(_0x3bab08,_0x9499d0){_0x9499d0=_0x9499d0||0x1f4;return function(_0x18d6bd){logger[_0x8c8f('0x1d')](_0x18d6bd[_0x8c8f('0x2f')]);if(_0x18d6bd[_0x8c8f('0x30')]){delete _0x18d6bd['name'];}_0x3bab08[_0x8c8f('0x24')](_0x9499d0)['send'](_0x18d6bd);};}exports[_0x8c8f('0x31')]=function(_0x469839,_0xac6da0){var _0x10dca6={},_0x3369ad={},_0x4b9b0f={'count':0x0,'rows':[]};var _0x95df8b=db[_0x8c8f('0x32')][_0x8c8f('0x33')];_0x3369ad['model']=_[_0x8c8f('0x34')](_0x95df8b);_0x3369ad[_0x8c8f('0x35')]=_[_0x8c8f('0x34')](_0x469839[_0x8c8f('0x35')]);_0x3369ad['filters']=_['intersection'](_0x3369ad['model'],_0x3369ad[_0x8c8f('0x35')]);_0x10dca6[_0x8c8f('0x36')]=_[_0x8c8f('0x37')](_0x3369ad[_0x8c8f('0x38')],qs[_0x8c8f('0x39')](_0x469839[_0x8c8f('0x35')][_0x8c8f('0x39')]));_0x10dca6['attributes']=_0x10dca6[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x10dca6[_0x8c8f('0x36')]:_0x3369ad[_0x8c8f('0x38')];if(!_0x469839['query'][_0x8c8f('0x3b')](_0x8c8f('0x3c'))){_0x10dca6[_0x8c8f('0x28')]=qs[_0x8c8f('0x28')](_0x469839['query'][_0x8c8f('0x28')]);_0x10dca6[_0x8c8f('0x27')]=qs[_0x8c8f('0x27')](_0x469839['query'][_0x8c8f('0x27')]);}_0x10dca6[_0x8c8f('0x3d')]=qs[_0x8c8f('0x3e')](_0x469839[_0x8c8f('0x35')]['sort']);_0x10dca6[_0x8c8f('0x3f')]=qs[_0x8c8f('0x40')](_['pick'](_0x469839[_0x8c8f('0x35')],_0x3369ad[_0x8c8f('0x40')]));if(_0x469839['query'][_0x8c8f('0x41')]){_0x10dca6[_0x8c8f('0x3f')]=_['merge'](_0x10dca6[_0x8c8f('0x3f')],{'$or':_['map'](_0x95df8b,function(_0xd501d){if(_0xd501d[_0x8c8f('0x42')]['key']!==_0x8c8f('0x43')){var _0x28e57a={};_0x28e57a[_0xd501d[_0x8c8f('0x44')]]={'$like':'%'+_0x469839[_0x8c8f('0x35')]['filter']+'%'};return _0x28e57a;}})});}_0x10dca6=_[_0x8c8f('0x45')]({},_0x10dca6,_0x469839[_0x8c8f('0x46')]);var _0x3af9d7={'where':_0x10dca6[_0x8c8f('0x3f')]};return db[_0x8c8f('0x32')][_0x8c8f('0x26')](_0x3af9d7)['then'](function(_0x27be03){_0x4b9b0f[_0x8c8f('0x26')]=_0x27be03;if(_0x469839[_0x8c8f('0x35')][_0x8c8f('0x47')]){_0x10dca6[_0x8c8f('0x48')]=[{'all':!![]}];}return db[_0x8c8f('0x32')][_0x8c8f('0x49')](_0x10dca6);})[_0x8c8f('0x18')](function(_0x494102){_0x4b9b0f[_0x8c8f('0x4a')]=_0x494102;return _0x4b9b0f;})[_0x8c8f('0x18')](respondWithFilteredResult(_0xac6da0,_0x10dca6))[_0x8c8f('0x22')](handleError(_0xac6da0,null));};exports[_0x8c8f('0x4b')]=function(_0x42a18c,_0x556019){var _0x280453={'raw':![],'where':{'id':_0x42a18c[_0x8c8f('0x4c')]['id']}},_0x2308e1={};_0x2308e1['model']=_[_0x8c8f('0x34')](db[_0x8c8f('0x32')][_0x8c8f('0x33')]);_0x2308e1[_0x8c8f('0x35')]=_[_0x8c8f('0x34')](_0x42a18c['query']);_0x2308e1[_0x8c8f('0x40')]=_[_0x8c8f('0x37')](_0x2308e1['model'],_0x2308e1[_0x8c8f('0x35')]);_0x280453[_0x8c8f('0x36')]=_['intersection'](_0x2308e1[_0x8c8f('0x38')],qs['fields'](_0x42a18c[_0x8c8f('0x35')]['fields']));_0x280453['attributes']=_0x280453[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x280453[_0x8c8f('0x36')]:_0x2308e1[_0x8c8f('0x38')];if(_0x42a18c[_0x8c8f('0x35')][_0x8c8f('0x47')]){_0x280453[_0x8c8f('0x48')]=[{'all':!![]}];}_0x280453=_[_0x8c8f('0x45')]({},_0x280453,_0x42a18c[_0x8c8f('0x46')]);return db[_0x8c8f('0x32')]['find'](_0x280453)[_0x8c8f('0x18')](handleEntityNotFound(_0x556019,null))[_0x8c8f('0x18')](respondWithResult(_0x556019,null))[_0x8c8f('0x22')](handleError(_0x556019,null));};exports[_0x8c8f('0x4d')]=function(_0x9f17bc,_0x2276ce){return db['Dynamics365Account']['create'](_0x9f17bc[_0x8c8f('0x4e')],{})[_0x8c8f('0x18')](respondWithResult(_0x2276ce,0xc9))[_0x8c8f('0x22')](handleError(_0x2276ce,null));};exports[_0x8c8f('0x2d')]=function(_0x5f3651,_0x2f9630){if(_0x5f3651['body']['id']){delete _0x5f3651[_0x8c8f('0x4e')]['id'];}return db[_0x8c8f('0x32')][_0x8c8f('0x4f')]({'where':{'id':_0x5f3651[_0x8c8f('0x4c')]['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x2f9630,null))[_0x8c8f('0x18')](saveUpdates(_0x5f3651[_0x8c8f('0x4e')],null))[_0x8c8f('0x18')](respondWithResult(_0x2f9630,null))['catch'](handleError(_0x2f9630,null));};exports[_0x8c8f('0x50')]=function(_0x1e738c,_0x294f29){return db['Dynamics365Account'][_0x8c8f('0x4f')]({'where':{'id':_0x1e738c[_0x8c8f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x294f29,null))['then'](removeEntity(_0x294f29,null))[_0x8c8f('0x22')](handleError(_0x294f29,null));};exports[_0x8c8f('0x51')]=function(_0x1de7df,_0x308e71,_0x4c86ec){var _0x3aa0fd={};var _0x22dbac={};var _0x319735;var _0x431b4c;return db[_0x8c8f('0x32')][_0x8c8f('0x52')]({'where':{'id':_0x1de7df[_0x8c8f('0x4c')]['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x308e71,null))[_0x8c8f('0x18')](function(_0x480f4){if(_0x480f4){_0x319735=_0x480f4;_0x22dbac[_0x8c8f('0x38')]=_[_0x8c8f('0x34')](db[_0x8c8f('0x53')][_0x8c8f('0x33')]);_0x22dbac[_0x8c8f('0x35')]=_['keys'](_0x1de7df[_0x8c8f('0x35')]);_0x22dbac[_0x8c8f('0x40')]=_[_0x8c8f('0x37')](_0x22dbac['model'],_0x22dbac[_0x8c8f('0x35')]);_0x3aa0fd[_0x8c8f('0x36')]=_['intersection'](_0x22dbac['model'],qs[_0x8c8f('0x39')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x39')]));_0x3aa0fd[_0x8c8f('0x36')]=_0x3aa0fd[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x3aa0fd[_0x8c8f('0x36')]:_0x22dbac['model'];_0x3aa0fd[_0x8c8f('0x3d')]=qs[_0x8c8f('0x3e')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x3e')]);_0x3aa0fd[_0x8c8f('0x3f')]=qs[_0x8c8f('0x40')](_[_0x8c8f('0x54')](_0x1de7df[_0x8c8f('0x35')],_0x22dbac['filters']));if(_0x1de7df[_0x8c8f('0x35')]['filter']){_0x3aa0fd[_0x8c8f('0x3f')]=_[_0x8c8f('0x45')](_0x3aa0fd[_0x8c8f('0x3f')],{'$or':_[_0x8c8f('0x55')](_0x3aa0fd['attributes'],function(_0x191b61){var _0x686681={};_0x686681[_0x191b61]={'$like':'%'+_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x41')]+'%'};return _0x686681;})});}_0x3aa0fd=_[_0x8c8f('0x45')]({},_0x3aa0fd,_0x1de7df['options']);return _0x319735[_0x8c8f('0x51')](_0x3aa0fd);}})[_0x8c8f('0x18')](function(_0x32d1da){if(_0x32d1da){_0x431b4c=_0x32d1da[_0x8c8f('0x3a')];if(!_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x3b')]('nolimit')){_0x3aa0fd['limit']=qs[_0x8c8f('0x28')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x28')]);_0x3aa0fd[_0x8c8f('0x27')]=qs[_0x8c8f('0x27')](_0x1de7df['query'][_0x8c8f('0x27')]);}return _0x319735[_0x8c8f('0x51')](_0x3aa0fd);}})[_0x8c8f('0x18')](function(_0x444adb){if(_0x444adb){return _0x444adb?{'count':_0x431b4c,'rows':_0x444adb}:null;}})[_0x8c8f('0x18')](respondWithResult(_0x308e71,null))['catch'](handleError(_0x308e71,null));};exports[_0x8c8f('0x56')]=function(_0x2f654a,_0x28df47,_0x1adbd4){if(_0x2f654a[_0x8c8f('0x4e')]['id']){delete _0x2f654a[_0x8c8f('0x4e')]['id'];}return db[_0x8c8f('0x32')]['findOne']({'where':{'id':_0x2f654a['params']['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x28df47,null))[_0x8c8f('0x18')](function(_0x112a2f){if(_0x112a2f){_0x2f654a[_0x8c8f('0x4e')]['AccountId']=_0x112a2f['id'];_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x57')]=integrations[_0x8c8f('0x58')](_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x59')],_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x42')]);_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x5a')]=integrations[_0x8c8f('0x5b')](_0x2f654a['body'][_0x8c8f('0x59')],_0x2f654a[_0x8c8f('0x4e')]['type']);return db[_0x8c8f('0x53')]['create'](_0x2f654a['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x8c8f('0x57')},{'model':db[_0x8c8f('0x5c')],'as':'Descriptions'}]});}return null;})[_0x8c8f('0x18')](respondWithResult(_0x28df47,null))[_0x8c8f('0x22')](handleError(_0x28df47,null));};exports[_0x8c8f('0x5d')]=function(_0x51d4f6,_0x40d4b1,_0x4edbab){var _0xe3399d=_0x51d4f6[_0x8c8f('0x35')][_0x8c8f('0x5e')];var _0x4aa9b3=_0xe3399d==='incident'?_0x8c8f('0x5f'):'PhoneCall';var _0x38f4d4='';var _0x4a9238='';var _0x2927d9='';var _0x46d75e='';var _0x448251='';var _0x388dad='';var _0x5a0c89='';var _0x5e17fd='';var _0x60d1bc=[_0x8c8f('0x60'),_0x8c8f('0x61'),_0x8c8f('0x62'),'ownerid',_0x8c8f('0x63'),_0x8c8f('0x64'),_0x8c8f('0x65'),_0x8c8f('0x66'),_0x8c8f('0x67'),_0x8c8f('0x68')];var _0x5a80e0=[_0x8c8f('0x69'),'accountidyominame',_0x8c8f('0x6a'),_0x8c8f('0x6b'),_0x8c8f('0x6c'),_0x8c8f('0x6d'),_0x8c8f('0x6e'),_0x8c8f('0x6f'),_0x8c8f('0x70'),_0x8c8f('0x71'),_0x8c8f('0x72'),_0x8c8f('0x73'),'createdon',_0x8c8f('0x74'),'createdonbehalfbyyominame',_0x8c8f('0x75'),_0x8c8f('0x76'),_0x8c8f('0x77'),_0x8c8f('0x78'),_0x8c8f('0x79'),_0x8c8f('0x7a'),_0x8c8f('0x7b'),_0x8c8f('0x7c'),_0x8c8f('0x7d'),_0x8c8f('0x7e'),_0x8c8f('0x7f'),'importsequencenumber',_0x8c8f('0x80'),_0x8c8f('0x81'),_0x8c8f('0x82'),_0x8c8f('0x83'),_0x8c8f('0x84'),_0x8c8f('0x85'),_0x8c8f('0x86'),_0x8c8f('0x87'),_0x8c8f('0x88'),'modifiedonbehalfbyname',_0x8c8f('0x89'),_0x8c8f('0x8a'),_0x8c8f('0x8b'),_0x8c8f('0x8c'),'onholdtime',_0x8c8f('0x8d'),_0x8c8f('0x8e'),_0x8c8f('0x8f'),_0x8c8f('0x90'),'parentcaseidname',_0x8c8f('0x91'),'primarycontactidyominame',_0x8c8f('0x92'),_0x8c8f('0x93'),'productserialnumber',_0x8c8f('0x94'),_0x8c8f('0x95'),_0x8c8f('0x96'),_0x8c8f('0x97'),_0x8c8f('0x98'),_0x8c8f('0x99'),'slainvokedidname',_0x8c8f('0x9a'),_0x8c8f('0x9b'),'statecode',_0x8c8f('0x9c'),_0x8c8f('0x9d'),_0x8c8f('0x9e'),_0x8c8f('0x9f'),'transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber'];var _0x2f0b89=_0x60d1bc['concat'](_0x5a80e0);return db[_0x8c8f('0x32')][_0x8c8f('0x52')]({'where':{'id':_0x51d4f6[_0x8c8f('0x4c')]['id']},'attributes':['id',_0x8c8f('0xa0'),_0x8c8f('0xa1'),_0x8c8f('0xa2'),'tenantId',_0x8c8f('0xa3'),_0x8c8f('0xa4')]})[_0x8c8f('0x18')](handleEntityNotFound(_0x40d4b1,null))[_0x8c8f('0x18')](function(_0x140285){if(_0x140285){_0x5e17fd=_0x140285[_0x8c8f('0xa2')];var _0x254cd5=_0x5e17fd['slice'](-0x1);if(_0x254cd5==='/'){_0x5e17fd=_0x5e17fd['substring'](0x0,_0x5e17fd[_0x8c8f('0xa5')](_0x254cd5));}_0x5a0c89=util[_0x8c8f('0xa6')](_0x8c8f('0xa7'),_0x5e17fd);var _0x4bb5f0={'method':_0x8c8f('0xa8'),'uri':_0x8c8f('0xa9')+_0x140285[_0x8c8f('0xaa')]+'/oauth2/token','form':{'client_id':_0x140285[_0x8c8f('0xa3')],'resource':_0x5e17fd,'username':_0x140285[_0x8c8f('0xa0')],'password':_0x140285[_0x8c8f('0xa1')],'grant_type':_0x8c8f('0xa1'),'client_secret':_0x140285[_0x8c8f('0xa4')]},'json':!![]};return rp(_0x4bb5f0);}})[_0x8c8f('0x18')](function(_0x2493dd){_0x388dad=_0x2493dd[_0x8c8f('0xab')];var _0x1df6e1={'method':'GET','uri':encodeURI(_0x5a0c89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4aa9b3+'\x27'),'headers':{'Authorization':_0x8c8f('0xac')+_0x388dad,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x1df6e1);})['then'](function(_0x3f736c){var _0x2994b5=_0x3f736c[_0x8c8f('0xae')][0x0];var _0x8da36b=_0x2994b5[_0x8c8f('0xaf')];var _0x8238e1={'method':'GET','uri':_0x5a0c89+_0x8c8f('0xb0')+_0x8da36b+_0x8c8f('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x388dad,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x8238e1);})[_0x8c8f('0x18')](function(_0x1abf87){_0x38f4d4=_0x1abf87;_0x4a9238=_0x38f4d4[_0x8c8f('0xb2')];_0x4a9238=_[_0x8c8f('0xb3')](_0x4a9238,function(_0x17e68d){return!_0x2f0b89[_0x8c8f('0xb4')](_0x17e68d[_0x8c8f('0xb5')]);});var _0x420cef=[];var _0xc2f5d=[];_0x4a9238['forEach'](function(_0x328c8a){if(_0x328c8a[_0x8c8f('0xb6')]){var _0x5b82d7=_0x328c8a[_0x8c8f('0xb6')]['substring'](_0x328c8a['@odata.type'][_0x8c8f('0xa5')]('.')+0x1);if(_0x5b82d7==='PicklistAttributeMetadata'){_0x420cef[_0x8c8f('0xb7')](getSelectList(_0x5a0c89,_0xe3399d,_0xc2f5d,_0x38f4d4['MetadataId'],_0x328c8a[_0x8c8f('0xaf')],_0x388dad));}}});return Promise['all'](_0x420cef);})[_0x8c8f('0x18')](function(_0x3f0846){_0x2927d9=_0x3f0846[0x0];var _0x496b63=[];var _0x1892ec=[];_0x4a9238[_0x8c8f('0xb8')](function(_0x8d19d1){if(!_[_0x8c8f('0xb9')](_0x8d19d1[_0x8c8f('0xb6')])){var _0x153582=_0x8d19d1[_0x8c8f('0xb6')][_0x8c8f('0xba')](_0x8d19d1[_0x8c8f('0xb6')][_0x8c8f('0xa5')]('.')+0x1);if(_0x153582===_0x8c8f('0xbb')){_0x496b63[_0x8c8f('0xb7')](getBooleanList(_0x5a0c89,_0xe3399d,_0x1892ec,_0x38f4d4[_0x8c8f('0xaf')],_0x8d19d1[_0x8c8f('0xaf')],_0x388dad));}}});return Promise[_0x8c8f('0xbc')](_0x496b63);})[_0x8c8f('0x18')](function(_0x158278){_0x46d75e=_0x158278[0x0];var _0x102911=[];var _0x1c0f64=[];_0x4a9238[_0x8c8f('0xb8')](function(_0x3bc3c9){if(_0x3bc3c9['@odata.type']){var _0x76a314=_0x3bc3c9[_0x8c8f('0xb6')][_0x8c8f('0xba')](_0x3bc3c9[_0x8c8f('0xb6')][_0x8c8f('0xa5')]('.')+0x1);if(_0x76a314===_0x8c8f('0xbd')||_0x76a314===_0x8c8f('0xbe')||_0x76a314===_0x8c8f('0xbf')||_0x76a314===_0x8c8f('0xc0')||_0x76a314===_0x8c8f('0xc1')||_0x76a314===_0x8c8f('0xc2')||_0x76a314===_0x8c8f('0xc3')||_0x76a314===_0x8c8f('0xc4')||_0x76a314===_0x8c8f('0xc5')||_0x76a314===_0x8c8f('0xc6')){_0x102911[_0x8c8f('0xb7')](getInputList(_0x5a0c89,_0xe3399d,_0x76a314,_0x1c0f64,_0x38f4d4[_0x8c8f('0xaf')],_0x3bc3c9[_0x8c8f('0xaf')],_0x388dad));}}});return Promise[_0x8c8f('0xbc')](_0x102911);})[_0x8c8f('0x18')](function(_0x5051a3){_0x448251=_0x5051a3[0x0];var _0x146cc5=_0x2927d9[_0x8c8f('0xc7')](_0x46d75e)[_0x8c8f('0xc7')](_0x448251);var _0x125d78={'count':_0x146cc5['length'],'rows':_0x146cc5};return _0x125d78;})['then'](respondWithResult(_0x40d4b1,null))['catch'](function(_0x3d9a15){console['log']('Dynamics365\x20error:\x20'+_0x3d9a15);var _0x3ce978=_0x51d4f6[_0x8c8f('0x35')][_0x8c8f('0xc8')]?0x1f4:_0x3d9a15[_0x8c8f('0xc9')]||0x1f4;logger[_0x8c8f('0x1d')](_0x3d9a15['stack']);delete _0x3d9a15[_0x8c8f('0x30')];if(_0x3ce978===0x191){_0x3ce978=0x190;}_0x40d4b1[_0x8c8f('0x24')](_0x3ce978)[_0x8c8f('0xca')](_0x51d4f6['query'][_0x8c8f('0xc8')]?{'message':_0x8c8f('0xcb'),'statusCode':_0x3d9a15[_0x8c8f('0xc9')]}:_0x3d9a15);});};function getSelectList(_0x4bda56,_0x2d76dc,_0x594eb9,_0x3a60e5,_0x4dfd95,_0x3e5674){var _0x16f2d2={'method':'GET','uri':_0x4bda56+_0x8c8f('0xb0')+_0x3a60e5+_0x8c8f('0xcc')+_0x4dfd95+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x8c8f('0xcd'),'headers':{'Authorization':_0x8c8f('0xac')+_0x3e5674,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x16f2d2)[_0x8c8f('0x18')](function(_0x254955){var _0x207687=[];var _0x43f2b4=_0x254955['OptionSet'][_0x8c8f('0xce')];_0x43f2b4[_0x8c8f('0xb8')](function(_0x20ece0){_0x207687[_0x8c8f('0xb7')]({'name':_0x20ece0[_0x8c8f('0xcf')][_0x8c8f('0xd0')]['Label'],'value':String(_0x20ece0[_0x8c8f('0xd1')])});});var _0x49c1dd={'id':_0x2d76dc+'_'+_0x254955[_0x8c8f('0xb5')],'name':_0x254955['DisplayName'][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'custom':![],'options':_0x207687};_0x594eb9[_0x8c8f('0xb7')](_0x49c1dd);return _0x594eb9;});}function getBooleanList(_0xf341ec,_0x56ad2c,_0x4693ba,_0x23ffbe,_0x40151a,_0x432f60){var _0x57df7d={'method':_0x8c8f('0xd2'),'uri':_0xf341ec+'EntityDefinitions('+_0x23ffbe+_0x8c8f('0xcc')+_0x40151a+_0x8c8f('0xd3'),'headers':{'Authorization':_0x8c8f('0xac')+_0x432f60,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x57df7d)[_0x8c8f('0x18')](function(_0x32008c){var _0x3dbaca=[];_0x3dbaca[_0x8c8f('0xb7')]({'name':_0x32008c[_0x8c8f('0xd4')]['TrueOption'][_0x8c8f('0xcf')][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'value':_0x8c8f('0xd5')},{'name':_0x32008c[_0x8c8f('0xd4')][_0x8c8f('0xd6')]['Label'][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'value':_0x8c8f('0xd7')});var _0x533281={'id':_0x56ad2c+'_'+_0x32008c[_0x8c8f('0xb5')],'name':_0x32008c[_0x8c8f('0xd8')][_0x8c8f('0xd0')]['Label'],'custom':![],'options':_0x3dbaca};_0x4693ba['push'](_0x533281);return _0x4693ba;});}function getInputList(_0x4c1099,_0x45b031,_0x84cc06,_0xcec8ae,_0x596591,_0x1e3d80,_0x530d5b){var _0x28c0d0={'method':_0x8c8f('0xd2'),'uri':_0x4c1099+_0x8c8f('0xb0')+_0x596591+_0x8c8f('0xcc')+_0x1e3d80+_0x8c8f('0xd9')+_0x84cc06+_0x8c8f('0xda'),'headers':{'Authorization':_0x8c8f('0xac')+_0x530d5b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28c0d0)['then'](function(_0x1233ee){var _0x41cd9f={'id':_0x45b031+'_'+_0x1233ee[_0x8c8f('0xb5')],'name':_0x1233ee[_0x8c8f('0xd8')][_0x8c8f('0xd0')]?_0x1233ee[_0x8c8f('0xd8')][_0x8c8f('0xd0')]['Label']:_0x1233ee['LogicalName'],'custom':![],'options':[]};_0xcec8ae[_0x8c8f('0xb7')](_0x41cd9f);return _0xcec8ae;});} \ No newline at end of file +var _0x2e54=['prioritycodename','productidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','versionnumber','concat','remoteUri','tenantId','clientSecret','substring','lastIndexOf','format','POST','/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','LogicalName','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','end','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','Dynamics365Account','includeAll','include','findAll','show','params','rawAttributes','find','create','body','destroy','getConfigurations','Dynamics365Configuration','map','addConfiguration','AccountId','Subjects','channel','getDescriptions','getFields','ticketType','incident','PhoneCall','title','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame'];(function(_0x1f776a,_0x19602d){var _0x2a6b35=function(_0x81f169){while(--_0x81f169){_0x1f776a['push'](_0x1f776a['shift']());}};_0x2a6b35(++_0x19602d);}(_0x2e54,0x1dd));var _0x42e5=function(_0x439625,_0x49ff1c){_0x439625=_0x439625-0x0;var _0x37e743=_0x2e54[_0x439625];return _0x37e743;};'use strict';var pdf=require(_0x42e5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x42e5('0x1'));var jsonpatch=require(_0x42e5('0x2'));var rp=require(_0x42e5('0x3'));var moment=require(_0x42e5('0x4'));var BPromise=require(_0x42e5('0x5'));var Mustache=require(_0x42e5('0x6'));var util=require(_0x42e5('0x7'));var path=require('path');var sox=require(_0x42e5('0x8'));var csv=require(_0x42e5('0x9'));var ejs=require(_0x42e5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x9'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var hardwareService=require(_0x42e5('0x12'));var logger=require(_0x42e5('0x13'))(_0x42e5('0x14'));var utils=require('../../config/utils');var config=require(_0x42e5('0x15'));var db=require(_0x42e5('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x42e5('0x17'));var client=jayson[_0x42e5('0x18')][_0x42e5('0x19')]({'port':0x232a});function checkPasswordPattern(_0x41598d,_0x144fb4,_0x1faafc){if(_0x1faafc){var _0x2c18f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c18f7[_0x42e5('0x1a')](_0x144fb4)){return _0x41598d;}else{throw new Error(_0x42e5('0x1b'));}}else{return _0x41598d;}}function respondWithRpcPromise(_0x23957f,_0x51b2f4,_0x3b3dd9,_0x1d8e52){return new BPromise(function(_0x4034bd,_0x388300){var _0x2f4999=_0x1d8e52||client;return _0x2f4999[_0x42e5('0x1c')](_0x23957f,_0x3b3dd9)[_0x42e5('0x1d')](function(_0x3abe3d){logger[_0x42e5('0x1e')](_0x42e5('0x1f'),_0x51b2f4,_0x42e5('0x20'));logger[_0x42e5('0x21')](_0x42e5('0x22'),_0x51b2f4,_0x42e5('0x20'),JSON['stringify'](_0x3abe3d));if(_0x3abe3d[_0x42e5('0x23')]){if(_0x3abe3d['error']['code']===0x1f4){logger[_0x42e5('0x23')](_0x42e5('0x1f'),_0x51b2f4,_0x3abe3d['error'][_0x42e5('0x24')]);return _0x388300(_0x3abe3d[_0x42e5('0x23')][_0x42e5('0x24')]);}logger[_0x42e5('0x23')](_0x42e5('0x1f'),_0x51b2f4,_0x3abe3d[_0x42e5('0x23')][_0x42e5('0x24')]);return _0x4034bd(_0x3abe3d['error']['message']);}else{logger[_0x42e5('0x1e')]('Dynamics365Account,\x20%s,\x20%s',_0x51b2f4,_0x42e5('0x20'));_0x4034bd(_0x3abe3d[_0x42e5('0x25')][_0x42e5('0x24')]);}})[_0x42e5('0x26')](function(_0x32380f){logger['error'](_0x42e5('0x1f'),_0x51b2f4,_0x32380f);_0x388300(_0x32380f);});});}function respondWithStatusCode(_0xf29221,_0x14640d){_0x14640d=_0x14640d||0xcc;return function(_0x275c80){if(_0x275c80){return _0xf29221[_0x42e5('0x27')](_0x14640d);}return _0xf29221['status'](_0x14640d)['end']();};}function respondWithResult(_0x3115e4,_0x534a26){_0x534a26=_0x534a26||0xc8;return function(_0x56f812){if(_0x56f812){return _0x3115e4[_0x42e5('0x28')](_0x534a26)['json'](_0x56f812);}};}function respondWithFilteredResult(_0x392c6b,_0x2d9e65){return function(_0x4fd119){if(_0x4fd119){var _0x1c8ee4=_0x4fd119[_0x42e5('0x29')],_0x27ae27=_0x2d9e65[_0x42e5('0x2a')],_0x2f1edc=_0x2d9e65[_0x42e5('0x2a')]+_0x2d9e65[_0x42e5('0x2b')],_0x59a46b;if(_0x2f1edc>=_0x1c8ee4){_0x2f1edc=_0x1c8ee4;_0x59a46b=0xc8;}else{_0x59a46b=0xce;}_0x392c6b[_0x42e5('0x28')](_0x59a46b);return _0x392c6b[_0x42e5('0x2c')](_0x42e5('0x2d'),_0x27ae27+'-'+_0x2f1edc+'/'+_0x1c8ee4)[_0x42e5('0x2e')](_0x4fd119);}return null;};}function patchUpdates(_0x5a4930){return function(_0x2ba9ef){try{jsonpatch[_0x42e5('0x2f')](_0x2ba9ef,_0x5a4930,!![]);}catch(_0x3d9e8b){return BPromise[_0x42e5('0x30')](_0x3d9e8b);}return _0x2ba9ef['save']();};}function saveUpdates(_0x293403,_0xf5a3dc){return function(_0x14c8fd){if(_0x14c8fd){return _0x14c8fd[_0x42e5('0x31')](_0x293403)['then'](function(_0x539254){return _0x539254;});}return null;};}function removeEntity(_0x21d933,_0x59f8d6){return function(_0x45f402){if(_0x45f402){return _0x45f402['destroy']()[_0x42e5('0x1d')](function(){_0x21d933[_0x42e5('0x28')](0xcc)[_0x42e5('0x32')]();});}};}function handleEntityNotFound(_0x49a22e,_0x29b9fd){return function(_0x3a8d1c){if(!_0x3a8d1c){_0x49a22e['sendStatus'](0x194);}return _0x3a8d1c;};}function handleError(_0x1ae59c,_0x57558d){_0x57558d=_0x57558d||0x1f4;return function(_0x470ac5){logger[_0x42e5('0x23')](_0x470ac5[_0x42e5('0x33')]);if(_0x470ac5[_0x42e5('0x34')]){delete _0x470ac5[_0x42e5('0x34')];}_0x1ae59c[_0x42e5('0x28')](_0x57558d)[_0x42e5('0x35')](_0x470ac5);};}exports['index']=function(_0x5a18cc,_0xba86e2){var _0xd41feb={},_0x8cf7a8={},_0x4a1a8a={'count':0x0,'rows':[]};var _0x56804a=db['Dynamics365Account']['rawAttributes'];_0x8cf7a8[_0x42e5('0x36')]=_[_0x42e5('0x37')](_0x56804a);_0x8cf7a8[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x5a18cc[_0x42e5('0x38')]);_0x8cf7a8[_0x42e5('0x39')]=_[_0x42e5('0x3a')](_0x8cf7a8[_0x42e5('0x36')],_0x8cf7a8['query']);_0xd41feb[_0x42e5('0x3b')]=_['intersection'](_0x8cf7a8[_0x42e5('0x36')],qs[_0x42e5('0x3c')](_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x3c')]));_0xd41feb[_0x42e5('0x3b')]=_0xd41feb[_0x42e5('0x3b')][_0x42e5('0x3d')]?_0xd41feb['attributes']:_0x8cf7a8[_0x42e5('0x36')];if(!_0x5a18cc[_0x42e5('0x38')]['hasOwnProperty'](_0x42e5('0x3e'))){_0xd41feb['limit']=qs['limit'](_0x5a18cc['query'][_0x42e5('0x2b')]);_0xd41feb[_0x42e5('0x2a')]=qs[_0x42e5('0x2a')](_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x2a')]);}_0xd41feb[_0x42e5('0x3f')]=qs[_0x42e5('0x40')](_0x5a18cc['query'][_0x42e5('0x40')]);_0xd41feb[_0x42e5('0x41')]=qs['filters'](_[_0x42e5('0x42')](_0x5a18cc[_0x42e5('0x38')],_0x8cf7a8['filters']));if(_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x43')]){_0xd41feb[_0x42e5('0x41')]=_[_0x42e5('0x44')](_0xd41feb[_0x42e5('0x41')],{'$or':_['map'](_0x56804a,function(_0x41e1fd){if(_0x41e1fd[_0x42e5('0x45')][_0x42e5('0x46')]!==_0x42e5('0x47')){var _0x4ba2c3={};_0x4ba2c3[_0x41e1fd[_0x42e5('0x48')]]={'$like':'%'+_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x43')]+'%'};return _0x4ba2c3;}})});}_0xd41feb=_[_0x42e5('0x44')]({},_0xd41feb,_0x5a18cc[_0x42e5('0x49')]);var _0x68ad9b={'where':_0xd41feb[_0x42e5('0x41')]};return db[_0x42e5('0x4a')]['count'](_0x68ad9b)[_0x42e5('0x1d')](function(_0x5b27f6){_0x4a1a8a['count']=_0x5b27f6;if(_0x5a18cc[_0x42e5('0x38')][_0x42e5('0x4b')]){_0xd41feb[_0x42e5('0x4c')]=[{'all':!![]}];}return db[_0x42e5('0x4a')][_0x42e5('0x4d')](_0xd41feb);})[_0x42e5('0x1d')](function(_0x271bbb){_0x4a1a8a['rows']=_0x271bbb;return _0x4a1a8a;})[_0x42e5('0x1d')](respondWithFilteredResult(_0xba86e2,_0xd41feb))[_0x42e5('0x26')](handleError(_0xba86e2,null));};exports[_0x42e5('0x4e')]=function(_0x21a047,_0x1086b2){var _0xc8de4d={'raw':![],'where':{'id':_0x21a047[_0x42e5('0x4f')]['id']}},_0x3d910a={};_0x3d910a['model']=_[_0x42e5('0x37')](db[_0x42e5('0x4a')][_0x42e5('0x50')]);_0x3d910a[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x21a047[_0x42e5('0x38')]);_0x3d910a[_0x42e5('0x39')]=_[_0x42e5('0x3a')](_0x3d910a[_0x42e5('0x36')],_0x3d910a['query']);_0xc8de4d[_0x42e5('0x3b')]=_['intersection'](_0x3d910a[_0x42e5('0x36')],qs[_0x42e5('0x3c')](_0x21a047[_0x42e5('0x38')]['fields']));_0xc8de4d['attributes']=_0xc8de4d['attributes'][_0x42e5('0x3d')]?_0xc8de4d[_0x42e5('0x3b')]:_0x3d910a[_0x42e5('0x36')];if(_0x21a047[_0x42e5('0x38')]['includeAll']){_0xc8de4d[_0x42e5('0x4c')]=[{'all':!![]}];}_0xc8de4d=_[_0x42e5('0x44')]({},_0xc8de4d,_0x21a047[_0x42e5('0x49')]);return db['Dynamics365Account'][_0x42e5('0x51')](_0xc8de4d)['then'](handleEntityNotFound(_0x1086b2,null))[_0x42e5('0x1d')](respondWithResult(_0x1086b2,null))[_0x42e5('0x26')](handleError(_0x1086b2,null));};exports['create']=function(_0x2588e6,_0x18509a){return db[_0x42e5('0x4a')][_0x42e5('0x52')](_0x2588e6[_0x42e5('0x53')],{})[_0x42e5('0x1d')](respondWithResult(_0x18509a,0xc9))[_0x42e5('0x26')](handleError(_0x18509a,null));};exports[_0x42e5('0x31')]=function(_0x1ddd4c,_0x16efb2){if(_0x1ddd4c['body']['id']){delete _0x1ddd4c[_0x42e5('0x53')]['id'];}return db[_0x42e5('0x4a')][_0x42e5('0x51')]({'where':{'id':_0x1ddd4c[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0x16efb2,null))['then'](saveUpdates(_0x1ddd4c[_0x42e5('0x53')],null))[_0x42e5('0x1d')](respondWithResult(_0x16efb2,null))[_0x42e5('0x26')](handleError(_0x16efb2,null));};exports[_0x42e5('0x54')]=function(_0x5ac909,_0x5ec79a){return db['Dynamics365Account'][_0x42e5('0x51')]({'where':{'id':_0x5ac909[_0x42e5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ec79a,null))[_0x42e5('0x1d')](removeEntity(_0x5ec79a,null))[_0x42e5('0x26')](handleError(_0x5ec79a,null));};exports[_0x42e5('0x55')]=function(_0x2ced33,_0xb1cd9e,_0x4361cb){var _0x2ec142={};var _0x2c76e0={};var _0x3692fc;var _0x5688a4;return db[_0x42e5('0x4a')]['findOne']({'where':{'id':_0x2ced33[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0xb1cd9e,null))[_0x42e5('0x1d')](function(_0x3b4836){if(_0x3b4836){_0x3692fc=_0x3b4836;_0x2c76e0[_0x42e5('0x36')]=_[_0x42e5('0x37')](db[_0x42e5('0x56')][_0x42e5('0x50')]);_0x2c76e0[_0x42e5('0x38')]=_[_0x42e5('0x37')](_0x2ced33[_0x42e5('0x38')]);_0x2c76e0['filters']=_[_0x42e5('0x3a')](_0x2c76e0['model'],_0x2c76e0[_0x42e5('0x38')]);_0x2ec142['attributes']=_[_0x42e5('0x3a')](_0x2c76e0[_0x42e5('0x36')],qs['fields'](_0x2ced33[_0x42e5('0x38')][_0x42e5('0x3c')]));_0x2ec142['attributes']=_0x2ec142[_0x42e5('0x3b')][_0x42e5('0x3d')]?_0x2ec142['attributes']:_0x2c76e0[_0x42e5('0x36')];_0x2ec142[_0x42e5('0x3f')]=qs[_0x42e5('0x40')](_0x2ced33['query'][_0x42e5('0x40')]);_0x2ec142[_0x42e5('0x41')]=qs[_0x42e5('0x39')](_[_0x42e5('0x42')](_0x2ced33['query'],_0x2c76e0[_0x42e5('0x39')]));if(_0x2ced33['query'][_0x42e5('0x43')]){_0x2ec142[_0x42e5('0x41')]=_[_0x42e5('0x44')](_0x2ec142[_0x42e5('0x41')],{'$or':_[_0x42e5('0x57')](_0x2ec142[_0x42e5('0x3b')],function(_0x15ff42){var _0x590f7b={};_0x590f7b[_0x15ff42]={'$like':'%'+_0x2ced33[_0x42e5('0x38')][_0x42e5('0x43')]+'%'};return _0x590f7b;})});}_0x2ec142=_[_0x42e5('0x44')]({},_0x2ec142,_0x2ced33[_0x42e5('0x49')]);return _0x3692fc[_0x42e5('0x55')](_0x2ec142);}})[_0x42e5('0x1d')](function(_0xfef629){if(_0xfef629){_0x5688a4=_0xfef629[_0x42e5('0x3d')];if(!_0x2ced33[_0x42e5('0x38')]['hasOwnProperty'](_0x42e5('0x3e'))){_0x2ec142[_0x42e5('0x2b')]=qs[_0x42e5('0x2b')](_0x2ced33[_0x42e5('0x38')]['limit']);_0x2ec142[_0x42e5('0x2a')]=qs[_0x42e5('0x2a')](_0x2ced33[_0x42e5('0x38')][_0x42e5('0x2a')]);}return _0x3692fc['getConfigurations'](_0x2ec142);}})['then'](function(_0x4ef0b0){if(_0x4ef0b0){return _0x4ef0b0?{'count':_0x5688a4,'rows':_0x4ef0b0}:null;}})[_0x42e5('0x1d')](respondWithResult(_0xb1cd9e,null))[_0x42e5('0x26')](handleError(_0xb1cd9e,null));};exports[_0x42e5('0x58')]=function(_0x2ce1d4,_0xb198d,_0x14d111){if(_0x2ce1d4[_0x42e5('0x53')]['id']){delete _0x2ce1d4[_0x42e5('0x53')]['id'];}return db[_0x42e5('0x4a')]['findOne']({'where':{'id':_0x2ce1d4[_0x42e5('0x4f')]['id']}})[_0x42e5('0x1d')](handleEntityNotFound(_0xb198d,null))[_0x42e5('0x1d')](function(_0x398391){if(_0x398391){_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x59')]=_0x398391['id'];_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x5a')]=integrations['getSubjects'](_0x2ce1d4['body'][_0x42e5('0x5b')],_0x2ce1d4[_0x42e5('0x53')]['type']);_0x2ce1d4['body']['Descriptions']=integrations[_0x42e5('0x5c')](_0x2ce1d4[_0x42e5('0x53')]['channel'],_0x2ce1d4[_0x42e5('0x53')][_0x42e5('0x45')]);return db['Dynamics365Configuration'][_0x42e5('0x52')](_0x2ce1d4[_0x42e5('0x53')],{'include':[{'model':db['Dynamics365Field'],'as':_0x42e5('0x5a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xb198d,null))['catch'](handleError(_0xb198d,null));};exports[_0x42e5('0x5d')]=function(_0x234e29,_0x4c7cc5,_0x1be0ce){var _0x3e4d9c=_0x234e29[_0x42e5('0x38')][_0x42e5('0x5e')];var _0x1d7c2a=_0x3e4d9c===_0x42e5('0x5f')?'Incident':_0x42e5('0x60');var _0xe0f6ab='';var _0x51a05e='';var _0x598661='';var _0x2faf9b='';var _0xfa822e='';var _0x2dbba9='';var _0xef49d2='';var _0x1e2fa7='';var _0xacf060=[_0x42e5('0x61'),'description','customerid','ownerid','caseorigincode',_0x42e5('0x62'),_0x42e5('0x63'),'regardingobjectid',_0x42e5('0x64'),'phonecall_activity_parties'];var _0x19aeca=[_0x42e5('0x65'),_0x42e5('0x66'),_0x42e5('0x67'),_0x42e5('0x68'),_0x42e5('0x69'),_0x42e5('0x6a'),_0x42e5('0x6b'),_0x42e5('0x6c'),_0x42e5('0x6d'),_0x42e5('0x6e'),_0x42e5('0x6f'),_0x42e5('0x70'),_0x42e5('0x71'),_0x42e5('0x72'),_0x42e5('0x73'),_0x42e5('0x74'),_0x42e5('0x75'),'customeridyominame',_0x42e5('0x76'),_0x42e5('0x77'),_0x42e5('0x78'),_0x42e5('0x79'),_0x42e5('0x7a'),_0x42e5('0x7b'),_0x42e5('0x7c'),_0x42e5('0x7d'),'importsequencenumber',_0x42e5('0x7e'),_0x42e5('0x7f'),_0x42e5('0x80'),_0x42e5('0x81'),_0x42e5('0x82'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x42e5('0x83'),_0x42e5('0x84'),_0x42e5('0x85'),_0x42e5('0x86'),_0x42e5('0x87'),_0x42e5('0x88'),_0x42e5('0x89'),_0x42e5('0x8a'),_0x42e5('0x8b'),'owneridname',_0x42e5('0x8c'),_0x42e5('0x8d'),'parentcaseidname',_0x42e5('0x8e'),_0x42e5('0x8f'),_0x42e5('0x90'),_0x42e5('0x91'),'productserialnumber','resolveby','resolvebykpiidname',_0x42e5('0x92'),_0x42e5('0x93'),_0x42e5('0x94'),_0x42e5('0x95'),_0x42e5('0x96'),_0x42e5('0x97'),_0x42e5('0x98'),'statecode',_0x42e5('0x99'),_0x42e5('0x9a'),_0x42e5('0x9b'),'timezoneruleversionnumber',_0x42e5('0x9c'),'traversedpath','utcconversiontimezonecode',_0x42e5('0x9d')];var _0x1e1d32=_0xacf060[_0x42e5('0x9e')](_0x19aeca);return db['Dynamics365Account']['findOne']({'where':{'id':_0x234e29[_0x42e5('0x4f')]['id']},'attributes':['id','username','password',_0x42e5('0x9f'),_0x42e5('0xa0'),'clientId',_0x42e5('0xa1')]})[_0x42e5('0x1d')](handleEntityNotFound(_0x4c7cc5,null))[_0x42e5('0x1d')](function(_0x161f3d){if(_0x161f3d){_0x1e2fa7=_0x161f3d[_0x42e5('0x9f')];var _0x44aa72=_0x1e2fa7['slice'](-0x1);if(_0x44aa72==='/'){_0x1e2fa7=_0x1e2fa7[_0x42e5('0xa2')](0x0,_0x1e2fa7[_0x42e5('0xa3')](_0x44aa72));}_0xef49d2=util[_0x42e5('0xa4')]('%s/api/data/v9.0/',_0x1e2fa7);var _0x27ee6e={'method':_0x42e5('0xa5'),'uri':'https://login.microsoftonline.com/'+_0x161f3d[_0x42e5('0xa0')]+_0x42e5('0xa6'),'form':{'client_id':_0x161f3d[_0x42e5('0xa7')],'resource':_0x1e2fa7,'username':_0x161f3d['username'],'password':_0x161f3d[_0x42e5('0xa8')],'grant_type':_0x42e5('0xa8'),'client_secret':_0x161f3d['clientSecret']},'json':!![]};return rp(_0x27ee6e);}})['then'](function(_0x3a539d){_0x2dbba9=_0x3a539d['access_token'];var _0x290083={'method':_0x42e5('0xa9'),'uri':encodeURI(_0xef49d2+_0x42e5('0xaa')+_0x1d7c2a+'\x27'),'headers':{'Authorization':_0x42e5('0xab')+_0x2dbba9,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x290083);})['then'](function(_0xeee19d){var _0x34d888=_0xeee19d[_0x42e5('0xad')][0x0];var _0x4e1188=_0x34d888[_0x42e5('0xae')];var _0x1d02f7={'method':_0x42e5('0xa9'),'uri':_0xef49d2+_0x42e5('0xaf')+_0x4e1188+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x42e5('0xab')+_0x2dbba9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1d02f7);})['then'](function(_0x14494d){_0xe0f6ab=_0x14494d;_0x51a05e=_0xe0f6ab[_0x42e5('0xb0')];_0x51a05e=_[_0x42e5('0xb1')](_0x51a05e,function(_0x3c613b){return!_0x1e1d32[_0x42e5('0xb2')](_0x3c613b['LogicalName']);});var _0x35c329=[];var _0x1d6ee2=[];_0x51a05e[_0x42e5('0xb3')](function(_0x3114a9){if(_0x3114a9[_0x42e5('0xb4')]){var _0x79691=_0x3114a9[_0x42e5('0xb4')][_0x42e5('0xa2')](_0x3114a9[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x79691===_0x42e5('0xb5')){_0x35c329[_0x42e5('0xb6')](getSelectList(_0xef49d2,_0x3e4d9c,_0x1d6ee2,_0xe0f6ab[_0x42e5('0xae')],_0x3114a9[_0x42e5('0xae')],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x35c329);})[_0x42e5('0x1d')](function(_0x39c46){_0x598661=_0x39c46[0x0];var _0x432105=[];var _0x33deb3=[];_0x51a05e[_0x42e5('0xb3')](function(_0x4ea39f){if(!_['isNil'](_0x4ea39f['@odata.type'])){var _0x5cbf7=_0x4ea39f[_0x42e5('0xb4')]['substring'](_0x4ea39f[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x5cbf7===_0x42e5('0xb8')){_0x432105['push'](getBooleanList(_0xef49d2,_0x3e4d9c,_0x33deb3,_0xe0f6ab['MetadataId'],_0x4ea39f['MetadataId'],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x432105);})[_0x42e5('0x1d')](function(_0x26ee9c){_0x2faf9b=_0x26ee9c[0x0];var _0x36ca4c=[];var _0x3f7dd1=[];_0x51a05e['forEach'](function(_0x4b5500){if(_0x4b5500[_0x42e5('0xb4')]){var _0x3bcde9=_0x4b5500[_0x42e5('0xb4')][_0x42e5('0xa2')](_0x4b5500[_0x42e5('0xb4')]['lastIndexOf']('.')+0x1);if(_0x3bcde9===_0x42e5('0xb9')||_0x3bcde9===_0x42e5('0xba')||_0x3bcde9===_0x42e5('0xbb')||_0x3bcde9==='IntegerAttributeMetadata'||_0x3bcde9==='MemoAttributeMetadata'||_0x3bcde9==='DateTimeAttributeMetadata'||_0x3bcde9===_0x42e5('0xbc')||_0x3bcde9==='EntityNameAttributeMetadata'||_0x3bcde9===_0x42e5('0xbd')||_0x3bcde9===_0x42e5('0xbe')){_0x36ca4c['push'](getInputList(_0xef49d2,_0x3e4d9c,_0x3bcde9,_0x3f7dd1,_0xe0f6ab[_0x42e5('0xae')],_0x4b5500[_0x42e5('0xae')],_0x2dbba9));}}});return Promise[_0x42e5('0xb7')](_0x36ca4c);})['then'](function(_0x106257){_0xfa822e=_0x106257[0x0];var _0xa1efc=_0x598661[_0x42e5('0x9e')](_0x2faf9b)[_0x42e5('0x9e')](_0xfa822e);var _0x3439d7={'count':_0xa1efc['length'],'rows':_0xa1efc};return _0x3439d7;})[_0x42e5('0x1d')](respondWithResult(_0x4c7cc5,null))[_0x42e5('0x26')](function(_0xca0d13){console[_0x42e5('0xbf')](_0x42e5('0xc0')+_0xca0d13);var _0x59a32e=_0x234e29[_0x42e5('0x38')][_0x42e5('0x1a')]?0x1f4:_0xca0d13['statusCode']||0x1f4;logger[_0x42e5('0x23')](_0xca0d13[_0x42e5('0x33')]);delete _0xca0d13[_0x42e5('0x34')];if(_0x59a32e===0x191){_0x59a32e=0x190;}_0x4c7cc5[_0x42e5('0x28')](_0x59a32e)[_0x42e5('0x35')](_0x234e29[_0x42e5('0x38')][_0x42e5('0x1a')]?{'message':_0x42e5('0xc1'),'statusCode':_0xca0d13['statusCode']}:_0xca0d13);});};function getSelectList(_0x71237a,_0x56f112,_0x1ae1b5,_0x318d1d,_0x24dfeb,_0x5cca6d){var _0x47a704={'method':_0x42e5('0xa9'),'uri':_0x71237a+_0x42e5('0xaf')+_0x318d1d+_0x42e5('0xc2')+_0x24dfeb+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x42e5('0xc3'),'headers':{'Authorization':_0x42e5('0xab')+_0x5cca6d,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x47a704)[_0x42e5('0x1d')](function(_0x2fbf4f){var _0x9610a9=[];var _0x15de56=_0x2fbf4f[_0x42e5('0xc4')][_0x42e5('0xc5')];_0x15de56[_0x42e5('0xb3')](function(_0x5b0da1){_0x9610a9[_0x42e5('0xb6')]({'name':_0x5b0da1['Label'][_0x42e5('0xc6')]['Label'],'value':String(_0x5b0da1['Value'])});});var _0x1fd5b9={'id':_0x56f112+'_'+_0x2fbf4f[_0x42e5('0xc7')],'name':_0x2fbf4f[_0x42e5('0xc8')][_0x42e5('0xc6')][_0x42e5('0xc9')],'custom':![],'options':_0x9610a9};_0x1ae1b5[_0x42e5('0xb6')](_0x1fd5b9);return _0x1ae1b5;});}function getBooleanList(_0x375661,_0x99dbde,_0x1cf1a6,_0x25264b,_0x4331b4,_0xb6ff9a){var _0x1385dd={'method':_0x42e5('0xa9'),'uri':_0x375661+'EntityDefinitions('+_0x25264b+_0x42e5('0xc2')+_0x4331b4+_0x42e5('0xca'),'headers':{'Authorization':_0x42e5('0xab')+_0xb6ff9a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1385dd)[_0x42e5('0x1d')](function(_0x5d9764){var _0x506914=[];_0x506914[_0x42e5('0xb6')]({'name':_0x5d9764[_0x42e5('0xc4')]['TrueOption'][_0x42e5('0xc9')][_0x42e5('0xc6')][_0x42e5('0xc9')],'value':'true'},{'name':_0x5d9764[_0x42e5('0xc4')][_0x42e5('0xcb')][_0x42e5('0xc9')]['UserLocalizedLabel'][_0x42e5('0xc9')],'value':_0x42e5('0xcc')});var _0x530101={'id':_0x99dbde+'_'+_0x5d9764[_0x42e5('0xc7')],'name':_0x5d9764[_0x42e5('0xc8')][_0x42e5('0xc6')]['Label'],'custom':![],'options':_0x506914};_0x1cf1a6[_0x42e5('0xb6')](_0x530101);return _0x1cf1a6;});}function getInputList(_0x250356,_0x587e30,_0x270889,_0x4e3875,_0x3ceac8,_0x3ddb84,_0x5eb50f){var _0x3a178d={'method':_0x42e5('0xa9'),'uri':_0x250356+_0x42e5('0xaf')+_0x3ceac8+_0x42e5('0xc2')+_0x3ddb84+_0x42e5('0xcd')+_0x270889+_0x42e5('0xce'),'headers':{'Authorization':_0x42e5('0xab')+_0x5eb50f,'If-None-Match':null,'OData-Version':_0x42e5('0xac')},'json':!![]};return rp(_0x3a178d)[_0x42e5('0x1d')](function(_0x1d312c){var _0xe589e5={'id':_0x587e30+'_'+_0x1d312c[_0x42e5('0xc7')],'name':_0x1d312c[_0x42e5('0xc8')]['UserLocalizedLabel']?_0x1d312c['DisplayName'][_0x42e5('0xc6')][_0x42e5('0xc9')]:_0x1d312c[_0x42e5('0xc7')],'custom':![],'options':[]};_0x4e3875[_0x42e5('0xb6')](_0xe589e5);return _0x4e3875;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 63ed2a2..d81e142 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 _0xf81c=['./intDynamics365Account.attributes','define','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x168463,_0x1c6e2c){var _0x1f3d27=function(_0x4fad35){while(--_0x4fad35){_0x168463['push'](_0x168463['shift']());}};_0x1f3d27(++_0x1c6e2c);}(_0xf81c,0x7c));var _0xcf81=function(_0x22b2be,_0x4b164c){_0x22b2be=_0x22b2be-0x0;var _0x213c31=_0xf81c[_0x22b2be];return _0x213c31;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf81('0x0'))(_0xcf81('0x1'));var moment=require(_0xcf81('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf81('0x4'));var config=require(_0xcf81('0x5'));var attributes=require(_0xcf81('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x948048,_0x86c6cb){return _0x948048[_0xcf81('0x7')](_0xcf81('0x8'),attributes,{'tableName':_0xcf81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdacd=['moment','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','../../config/logger','api'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xdacd,0xe1));var _0xddac=function(_0x4ffdcc,_0x4e7fec){_0x4ffdcc=_0x4ffdcc-0x0;var _0x4e66c8=_0xdacd[_0x4ffdcc];return _0x4e66c8;};'use strict';var _=require(_0xddac('0x0'));var util=require('util');var logger=require(_0xddac('0x1'))(_0xddac('0x2'));var moment=require(_0xddac('0x3'));var BPromise=require('bluebird');var rp=require(_0xddac('0x4'));var fs=require('fs');var path=require(_0xddac('0x5'));var rimraf=require('rimraf');var config=require(_0xddac('0x6'));var attributes=require(_0xddac('0x7'));var integrations=require(_0xddac('0x8'));module[_0xddac('0x9')]=function(_0x40499f,_0x40c0cc){return _0x40499f[_0xddac('0xa')]('Dynamics365Account',attributes,{'tableName':_0xddac('0xb'),'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 915d936..aca409b 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 _0x9a93=['request\x20sent','debug','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','include','map','attributes','model','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x53aea3,_0x36d8c9){var _0x434479=function(_0x350fc1){while(--_0x350fc1){_0x53aea3['push'](_0x53aea3['shift']());}};_0x434479(++_0x36d8c9);}(_0x9a93,0xa5));var _0x39a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x39a9('0x0'));var util=require(_0x39a9('0x1'));var moment=require(_0x39a9('0x2'));var BPromise=require(_0x39a9('0x3'));var rs=require(_0x39a9('0x4'));var fs=require('fs');var Redis=require(_0x39a9('0x5'));var db=require(_0x39a9('0x6'))['db'];var utils=require(_0x39a9('0x7'));var logger=require('../../config/logger')(_0x39a9('0x8'));var config=require(_0x39a9('0x9'));var jayson=require(_0x39a9('0xa'));var client=jayson[_0x39a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x454f3b,_0x1c315f,_0x19b34b){return new BPromise(function(_0x3fc6e2,_0xa5384f){return client[_0x39a9('0xc')](_0x454f3b,_0x19b34b)[_0x39a9('0xd')](function(_0x380f60){logger[_0x39a9('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x1c315f,_0x39a9('0xf'));logger[_0x39a9('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1c315f,_0x39a9('0xf'),JSON['stringify'](_0x380f60));if(_0x380f60[_0x39a9('0x11')]){if(_0x380f60[_0x39a9('0x11')][_0x39a9('0x12')]===0x1f4){logger[_0x39a9('0x11')](_0x39a9('0x13'),_0x1c315f,_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);return _0xa5384f(_0x380f60[_0x39a9('0x11')]['message']);}logger['error'](_0x39a9('0x13'),_0x1c315f,_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);return _0x3fc6e2(_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);}else{logger[_0x39a9('0xe')](_0x39a9('0x13'),_0x1c315f,_0x39a9('0xf'));_0x3fc6e2(_0x380f60[_0x39a9('0x15')]['message']);}})[_0x39a9('0x16')](function(_0xfa0dd8){logger[_0x39a9('0x11')](_0x39a9('0x13'),_0x1c315f,_0xfa0dd8);_0xa5384f(_0xfa0dd8);});});}exports[_0x39a9('0x17')]=function(_0x59668d){var _0xfa2425=this;return new Promise(function(_0x28d76d,_0x3458b0){return db[_0x39a9('0x18')][_0x39a9('0x19')]({'raw':_0x59668d['options']?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x59668d[_0x39a9('0x1a')]?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1c')]||null:null,'attributes':_0x59668d[_0x39a9('0x1a')]?_0x59668d['options']['attributes']||null:null,'limit':_0x59668d[_0x39a9('0x1a')]?_0x59668d[_0x39a9('0x1a')]['limit']||null:null,'include':_0x59668d['options']?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1d')],function(_0x310499){return{'model':db[_0x310499['model']],'as':_0x310499['as'],'attributes':_0x310499[_0x39a9('0x1f')],'include':_0x310499['include']?_['map'](_0x310499[_0x39a9('0x1d')],function(_0x826c43){return{'model':db[_0x826c43[_0x39a9('0x20')]],'as':_0x826c43['as'],'attributes':_0x826c43[_0x39a9('0x1f')],'include':_0x826c43[_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x826c43['include'],function(_0x408545){return{'model':db[_0x408545[_0x39a9('0x20')]],'as':_0x408545['as'],'attributes':_0x408545['attributes']};}):[]};}):[]};}):[]:[]})[_0x39a9('0xd')](function(_0x14bfa6){logger['info'](_0x39a9('0x17'),_0x59668d);logger[_0x39a9('0x10')]('GetDynamics365Account',_0x59668d,JSON[_0x39a9('0x21')](_0x14bfa6));_0x28d76d(_0x14bfa6);})['catch'](function(_0x287f70){logger[_0x39a9('0x11')](_0x39a9('0x17'),_0x287f70[_0x39a9('0x14')],_0x59668d);_0x3458b0(_0xfa2425[_0x39a9('0x11')](0x1f4,_0x287f70[_0x39a9('0x14')]));});});};exports[_0x39a9('0x22')]=function(_0x2afe74){var _0x42c588=this;return new Promise(function(_0x5e5a23,_0x3ade97){return db[_0x39a9('0x18')][_0x39a9('0x23')]({'raw':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2afe74['options']?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1c')]||null:null,'attributes':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74['options'][_0x39a9('0x1f')]||null:null,'include':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x2afe74['options'][_0x39a9('0x1d')],function(_0x5d3a4c){return{'model':db[_0x5d3a4c[_0x39a9('0x20')]],'as':_0x5d3a4c['as'],'attributes':_0x5d3a4c[_0x39a9('0x1f')],'include':_0x5d3a4c[_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x5d3a4c['include'],function(_0x912e9b){return{'model':db[_0x912e9b[_0x39a9('0x20')]],'as':_0x912e9b['as'],'attributes':_0x912e9b[_0x39a9('0x1f')],'include':_0x912e9b['include']?_['map'](_0x912e9b[_0x39a9('0x1d')],function(_0x206f65){return{'model':db[_0x206f65[_0x39a9('0x20')]],'as':_0x206f65['as'],'attributes':_0x206f65['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3aca2e){logger[_0x39a9('0xe')](_0x39a9('0x22'),_0x2afe74);logger[_0x39a9('0x10')]('ShowDynamics365Account',_0x2afe74,JSON[_0x39a9('0x21')](_0x3aca2e));_0x5e5a23(_0x3aca2e);})[_0x39a9('0x16')](function(_0x3ece6b){logger[_0x39a9('0x11')]('ShowDynamics365Account',_0x3ece6b[_0x39a9('0x14')],_0x2afe74);_0x3ade97(_0x42c588[_0x39a9('0x11')](0x1f4,_0x3ece6b[_0x39a9('0x14')]));});});}; \ No newline at end of file +var _0x55aa=['Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','result','catch','Dynamics365Account','options','raw','where','attributes','include','model','map','GetDynamics365Account','ShowDynamics365Account','find','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x507310,_0x127555){var _0x5340ea=function(_0x4160e3){while(--_0x4160e3){_0x507310['push'](_0x507310['shift']());}};_0x5340ea(++_0x127555);}(_0x55aa,0xd2));var _0xa55a=function(_0x43c9fc,_0x41a681){_0x43c9fc=_0x43c9fc-0x0;var _0x253674=_0x55aa[_0x43c9fc];return _0x253674;};'use strict';var _=require('lodash');var util=require(_0xa55a('0x0'));var moment=require('moment');var BPromise=require(_0xa55a('0x1'));var rs=require(_0xa55a('0x2'));var fs=require('fs');var Redis=require(_0xa55a('0x3'));var db=require(_0xa55a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa55a('0x5'));var config=require(_0xa55a('0x6'));var jayson=require(_0xa55a('0x7'));var client=jayson['client'][_0xa55a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26bb1a,_0x1ce896,_0x52b9c9){return new BPromise(function(_0x1b6379,_0x4ff5f4){return client[_0xa55a('0x9')](_0x26bb1a,_0x52b9c9)[_0xa55a('0xa')](function(_0x3d2f0c){logger[_0xa55a('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x1ce896,_0xa55a('0xc'));logger[_0xa55a('0xd')](_0xa55a('0xe'),_0x1ce896,_0xa55a('0xc'),JSON[_0xa55a('0xf')](_0x3d2f0c));if(_0x3d2f0c[_0xa55a('0x10')]){if(_0x3d2f0c['error']['code']===0x1f4){logger['error'](_0xa55a('0x11'),_0x1ce896,_0x3d2f0c[_0xa55a('0x10')][_0xa55a('0x12')]);return _0x4ff5f4(_0x3d2f0c[_0xa55a('0x10')]['message']);}logger['error'](_0xa55a('0x11'),_0x1ce896,_0x3d2f0c['error'][_0xa55a('0x12')]);return _0x1b6379(_0x3d2f0c['error'][_0xa55a('0x12')]);}else{logger['info'](_0xa55a('0x11'),_0x1ce896,_0xa55a('0xc'));_0x1b6379(_0x3d2f0c[_0xa55a('0x13')][_0xa55a('0x12')]);}})[_0xa55a('0x14')](function(_0x176620){logger[_0xa55a('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x1ce896,_0x176620);_0x4ff5f4(_0x176620);});});}exports['GetDynamics365Account']=function(_0x2bf2ea){var _0x41f125=this;return new Promise(function(_0x4eb289,_0x2aa8ee){return db[_0xa55a('0x15')]['findAll']({'raw':_0x2bf2ea['options']?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x17')]===undefined?!![]:![]:!![],'where':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x18')]||null:null,'attributes':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x19')]||null:null,'limit':_0x2bf2ea['options']?_0x2bf2ea[_0xa55a('0x16')]['limit']||null:null,'include':_0x2bf2ea[_0xa55a('0x16')]?_0x2bf2ea['options'][_0xa55a('0x1a')]?_['map'](_0x2bf2ea[_0xa55a('0x16')][_0xa55a('0x1a')],function(_0x1fcfd3){return{'model':db[_0x1fcfd3[_0xa55a('0x1b')]],'as':_0x1fcfd3['as'],'attributes':_0x1fcfd3[_0xa55a('0x19')],'include':_0x1fcfd3[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x1fcfd3[_0xa55a('0x1a')],function(_0x3870c5){return{'model':db[_0x3870c5[_0xa55a('0x1b')]],'as':_0x3870c5['as'],'attributes':_0x3870c5['attributes'],'include':_0x3870c5[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x3870c5[_0xa55a('0x1a')],function(_0x10fed1){return{'model':db[_0x10fed1[_0xa55a('0x1b')]],'as':_0x10fed1['as'],'attributes':_0x10fed1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa55a('0xa')](function(_0xff5954){logger[_0xa55a('0xb')](_0xa55a('0x1d'),_0x2bf2ea);logger[_0xa55a('0xd')](_0xa55a('0x1d'),_0x2bf2ea,JSON[_0xa55a('0xf')](_0xff5954));_0x4eb289(_0xff5954);})[_0xa55a('0x14')](function(_0x15b417){logger[_0xa55a('0x10')](_0xa55a('0x1d'),_0x15b417[_0xa55a('0x12')],_0x2bf2ea);_0x2aa8ee(_0x41f125[_0xa55a('0x10')](0x1f4,_0x15b417[_0xa55a('0x12')]));});});};exports[_0xa55a('0x1e')]=function(_0x560705){var _0x38ee21=this;return new Promise(function(_0x4ebd6d,_0x30dda5){return db[_0xa55a('0x15')][_0xa55a('0x1f')]({'raw':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')][_0xa55a('0x17')]===undefined?!![]:![]:!![],'where':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')][_0xa55a('0x18')]||null:null,'attributes':_0x560705[_0xa55a('0x16')]?_0x560705[_0xa55a('0x16')]['attributes']||null:null,'include':_0x560705['options']?_0x560705[_0xa55a('0x16')]['include']?_[_0xa55a('0x1c')](_0x560705[_0xa55a('0x16')][_0xa55a('0x1a')],function(_0x520898){return{'model':db[_0x520898[_0xa55a('0x1b')]],'as':_0x520898['as'],'attributes':_0x520898[_0xa55a('0x19')],'include':_0x520898[_0xa55a('0x1a')]?_[_0xa55a('0x1c')](_0x520898['include'],function(_0x56c022){return{'model':db[_0x56c022['model']],'as':_0x56c022['as'],'attributes':_0x56c022[_0xa55a('0x19')],'include':_0x56c022[_0xa55a('0x1a')]?_['map'](_0x56c022[_0xa55a('0x1a')],function(_0x3acedf){return{'model':db[_0x3acedf[_0xa55a('0x1b')]],'as':_0x3acedf['as'],'attributes':_0x3acedf[_0xa55a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa55a('0xa')](function(_0x27d10f){logger['info'](_0xa55a('0x1e'),_0x560705);logger[_0xa55a('0xd')](_0xa55a('0x1e'),_0x560705,JSON[_0xa55a('0xf')](_0x27d10f));_0x4ebd6d(_0x27d10f);})[_0xa55a('0x14')](function(_0x59584e){logger['error']('ShowDynamics365Account',_0x59584e[_0xa55a('0x12')],_0x560705);_0x30dda5(_0x38ee21[_0xa55a('0x10')](0x1f4,_0x59584e[_0xa55a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ee4105f..e834dad 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 _0x1279=['getFields','/:id/subjects','/:id/descriptions','post','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','/:id','get'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1279,0xe7));var _0x9127=function(_0x347dde,_0x36eb9d){_0x347dde=_0x347dde-0x0;var _0x59fe14=_0x1279[_0x347dde];return _0x59fe14;};'use strict';var multer=require(_0x9127('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9127('0x1'));var router=express[_0x9127('0x2')]();var auth=require(_0x9127('0x3'));var interaction=require(_0x9127('0x4'));var config=require('../../config/environment');var controller=require(_0x9127('0x5'));router['get']('/',auth[_0x9127('0x6')](),controller['index']);router['get'](_0x9127('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9127('0x8')]('/:id/fields',auth[_0x9127('0x6')](),controller[_0x9127('0x9')]);router[_0x9127('0x8')](_0x9127('0xa'),auth[_0x9127('0x6')](),controller['getSubjects']);router[_0x9127('0x8')](_0x9127('0xb'),auth[_0x9127('0x6')](),controller['getDescriptions']);router[_0x9127('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9127('0xd')]);router['delete'](_0x9127('0x7'),auth[_0x9127('0x6')](),controller[_0x9127('0xe')]);module[_0x9127('0xf')]=router; \ No newline at end of file +var _0x9f81=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getDescriptions','post','create','put','update','destroy','exports'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9f81,0x12c));var _0x19f8=function(_0xdcee45,_0x6231f1){_0xdcee45=_0xdcee45-0x0;var _0x1bb790=_0x9f81[_0xdcee45];return _0x1bb790;};'use strict';var multer=require('multer');var util=require(_0x19f8('0x0'));var path=require('path');var timeout=require(_0x19f8('0x1'));var express=require('express');var router=express[_0x19f8('0x2')]();var auth=require(_0x19f8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f8('0x4'));var controller=require(_0x19f8('0x5'));router[_0x19f8('0x6')]('/',auth['isAuthenticated'](),controller[_0x19f8('0x7')]);router[_0x19f8('0x6')](_0x19f8('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x19f8('0x6')](_0x19f8('0x9'),auth[_0x19f8('0xa')](),controller[_0x19f8('0xb')]);router[_0x19f8('0x6')](_0x19f8('0xc'),auth[_0x19f8('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x19f8('0xa')](),controller[_0x19f8('0xd')]);router[_0x19f8('0xe')]('/',auth[_0x19f8('0xa')](),controller[_0x19f8('0xf')]);router[_0x19f8('0x10')](_0x19f8('0x8'),auth[_0x19f8('0xa')](),controller[_0x19f8('0x11')]);router['delete']('/:id',auth[_0x19f8('0xa')](),controller[_0x19f8('0x12')]);module[_0x19f8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 9efa3ef..83f2b58 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 _0x38fc=['ENUM','incident','phonecall','sequelize','exports','STRING'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x38fc,0x75));var _0xc38f=function(_0x82a5c5,_0x7431ac){_0x82a5c5=_0x82a5c5-0x0;var _0x82193d=_0x38fc[_0x82a5c5];return _0x82193d;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'name':{'type':Sequelize[_0xc38f('0x2')]},'description':{'type':Sequelize[_0xc38f('0x2')]},'ticketType':{'type':Sequelize[_0xc38f('0x3')](_0xc38f('0x4'),_0xc38f('0x5')),'defaultValue':_0xc38f('0x4')}}; \ No newline at end of file +var _0xef5c=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x1830a9,_0x1583bd){var _0x2b6166=function(_0x4cf0e6){while(--_0x4cf0e6){_0x1830a9['push'](_0x1830a9['shift']());}};_0x2b6166(++_0x1583bd);}(_0xef5c,0x1ea));var _0xcef5=function(_0x549a2b,_0x14a025){_0x549a2b=_0x549a2b-0x0;var _0x26e876=_0xef5c[_0x549a2b];return _0x26e876;};'use strict';var Sequelize=require(_0xcef5('0x0'));module[_0xcef5('0x1')]={'name':{'type':Sequelize[_0xcef5('0x2')]},'description':{'type':Sequelize[_0xcef5('0x2')]},'ticketType':{'type':Sequelize[_0xcef5('0x3')](_0xcef5('0x4'),_0xcef5('0x5')),'defaultValue':_0xcef5('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 995f7f1..8583a3d 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 _0x4766=['nolimit','order','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','params','include','merge','options','find','create','body','findOne','Dynamics365Field','map','hasOwnProperty','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','destroy','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0xc4c47f,_0x2379a2){var _0x11a039=function(_0x4eacf3){while(--_0x4eacf3){_0xc4c47f['push'](_0xc4c47f['shift']());}};_0x11a039(++_0x2379a2);}(_0x4766,0xce));var _0x6476=function(_0x1bdd8c,_0x4a7f61){_0x1bdd8c=_0x1bdd8c-0x0;var _0x23dacd=_0x4766[_0x1bdd8c];return _0x23dacd;};'use strict';var pdf=require(_0x6476('0x0'));var emlformat=require(_0x6476('0x1'));var rimraf=require(_0x6476('0x2'));var zipdir=require(_0x6476('0x3'));var jsonpatch=require(_0x6476('0x4'));var rp=require(_0x6476('0x5'));var moment=require(_0x6476('0x6'));var BPromise=require(_0x6476('0x7'));var Mustache=require(_0x6476('0x8'));var util=require(_0x6476('0x9'));var path=require('path');var sox=require(_0x6476('0xa'));var csv=require(_0x6476('0xb'));var ejs=require(_0x6476('0xc'));var fs=require('fs');var _=require(_0x6476('0xd'));var squel=require('squel');var crypto=require(_0x6476('0xe'));var jsforce=require(_0x6476('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6476('0xb'));var querystring=require(_0x6476('0x10'));var Papa=require('papaparse');var Redis=require(_0x6476('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6476('0x12'));var logger=require(_0x6476('0x13'))(_0x6476('0x14'));var utils=require(_0x6476('0x15'));var config=require(_0x6476('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6476('0x17'));var client=jayson[_0x6476('0x18')][_0x6476('0x19')]({'port':0x232a});function checkPasswordPattern(_0x56828e,_0x2723fa,_0x352194){if(_0x352194){var _0x3c5a3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c5a3b[_0x6476('0x1a')](_0x2723fa)){return _0x56828e;}else{throw new Error(_0x6476('0x1b'));}}else{return _0x56828e;}}function respondWithRpcPromise(_0x9fe982,_0x1059f9,_0x9c2e5c,_0x2b86d8){return new BPromise(function(_0x18c201,_0x5d96cb){var _0x2f9e9e=_0x2b86d8||client;return _0x2f9e9e[_0x6476('0x1c')](_0x9fe982,_0x9c2e5c)[_0x6476('0x1d')](function(_0x29e4df){logger[_0x6476('0x1e')](_0x6476('0x1f'),_0x1059f9,'request\x20sent');logger[_0x6476('0x20')](_0x6476('0x21'),_0x1059f9,_0x6476('0x22'),JSON[_0x6476('0x23')](_0x29e4df));if(_0x29e4df[_0x6476('0x24')]){if(_0x29e4df[_0x6476('0x24')][_0x6476('0x25')]===0x1f4){logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x29e4df['error'][_0x6476('0x26')]);return _0x5d96cb(_0x29e4df[_0x6476('0x24')]['message']);}logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x29e4df[_0x6476('0x24')][_0x6476('0x26')]);return _0x18c201(_0x29e4df['error'][_0x6476('0x26')]);}else{logger[_0x6476('0x1e')](_0x6476('0x1f'),_0x1059f9,_0x6476('0x22'));_0x18c201(_0x29e4df[_0x6476('0x27')]['message']);}})[_0x6476('0x28')](function(_0x215d0a){logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x215d0a);_0x5d96cb(_0x215d0a);});});}function respondWithStatusCode(_0x3aadbc,_0x5e7c17){_0x5e7c17=_0x5e7c17||0xcc;return function(_0x50223a){if(_0x50223a){return _0x3aadbc[_0x6476('0x29')](_0x5e7c17);}return _0x3aadbc[_0x6476('0x2a')](_0x5e7c17)[_0x6476('0x2b')]();};}function respondWithResult(_0x5c42e0,_0x698899){_0x698899=_0x698899||0xc8;return function(_0x2862be){if(_0x2862be){return _0x5c42e0[_0x6476('0x2a')](_0x698899)['json'](_0x2862be);}};}function respondWithFilteredResult(_0x58b354,_0x51ed20){return function(_0xfdf89){if(_0xfdf89){var _0x515ee9=_0xfdf89[_0x6476('0x2c')],_0x281e09=_0x51ed20[_0x6476('0x2d')],_0x515dca=_0x51ed20['offset']+_0x51ed20[_0x6476('0x2e')],_0xc09838;if(_0x515dca>=_0x515ee9){_0x515dca=_0x515ee9;_0xc09838=0xc8;}else{_0xc09838=0xce;}_0x58b354[_0x6476('0x2a')](_0xc09838);return _0x58b354['set'](_0x6476('0x2f'),_0x281e09+'-'+_0x515dca+'/'+_0x515ee9)['json'](_0xfdf89);}return null;};}function patchUpdates(_0x5e3d4f){return function(_0x1c6a51){try{jsonpatch['apply'](_0x1c6a51,_0x5e3d4f,!![]);}catch(_0x429974){return BPromise['reject'](_0x429974);}return _0x1c6a51['save']();};}function saveUpdates(_0x1d0eca,_0x103455){return function(_0x117deb){if(_0x117deb){return _0x117deb['update'](_0x1d0eca)[_0x6476('0x1d')](function(_0x5e639b){return _0x5e639b;});}return null;};}function removeEntity(_0x43e543,_0x17b2cf){return function(_0xdd277){if(_0xdd277){return _0xdd277[_0x6476('0x30')]()['then'](function(){_0x43e543[_0x6476('0x2a')](0xcc)[_0x6476('0x2b')]();});}};}function handleEntityNotFound(_0x180197,_0x5b5905){return function(_0xbe3629){if(!_0xbe3629){_0x180197[_0x6476('0x29')](0x194);}return _0xbe3629;};}function handleError(_0x3a9bf3,_0x51e0e7){_0x51e0e7=_0x51e0e7||0x1f4;return function(_0x4bcef2){logger['error'](_0x4bcef2['stack']);if(_0x4bcef2[_0x6476('0x31')]){delete _0x4bcef2['name'];}_0x3a9bf3['status'](_0x51e0e7)[_0x6476('0x32')](_0x4bcef2);};}exports[_0x6476('0x33')]=function(_0x49c901,_0x2e708c){var _0x3f6270={},_0x5150e7={},_0x58b93d={'count':0x0,'rows':[]};var _0x3262d7=db[_0x6476('0x34')][_0x6476('0x35')];_0x5150e7[_0x6476('0x36')]=_[_0x6476('0x37')](_0x3262d7);_0x5150e7['query']=_[_0x6476('0x37')](_0x49c901[_0x6476('0x38')]);_0x5150e7['filters']=_[_0x6476('0x39')](_0x5150e7[_0x6476('0x36')],_0x5150e7[_0x6476('0x38')]);_0x3f6270[_0x6476('0x3a')]=_['intersection'](_0x5150e7[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x49c901['query']['fields']));_0x3f6270[_0x6476('0x3a')]=_0x3f6270['attributes'][_0x6476('0x3c')]?_0x3f6270[_0x6476('0x3a')]:_0x5150e7['model'];if(!_0x49c901['query']['hasOwnProperty'](_0x6476('0x3d'))){_0x3f6270['limit']=qs[_0x6476('0x2e')](_0x49c901[_0x6476('0x38')][_0x6476('0x2e')]);_0x3f6270[_0x6476('0x2d')]=qs[_0x6476('0x2d')](_0x49c901['query'][_0x6476('0x2d')]);}_0x3f6270[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x49c901[_0x6476('0x38')][_0x6476('0x3f')]);_0x3f6270[_0x6476('0x40')]=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x49c901['query'],_0x5150e7['filters']));if(_0x49c901[_0x6476('0x38')][_0x6476('0x43')]){_0x3f6270['where']=_['merge'](_0x3f6270[_0x6476('0x40')],{'$or':_['map'](_0x3262d7,function(_0xf92858){if(_0xf92858[_0x6476('0x44')][_0x6476('0x45')]!==_0x6476('0x46')){var _0x110d47={};_0x110d47[_0xf92858[_0x6476('0x47')]]={'$like':'%'+_0x49c901[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x110d47;}})});}_0x3f6270=_['merge']({},_0x3f6270,_0x49c901['options']);var _0x594c28={'where':_0x3f6270[_0x6476('0x40')]};return db[_0x6476('0x34')][_0x6476('0x2c')](_0x594c28)[_0x6476('0x1d')](function(_0x39f229){_0x58b93d[_0x6476('0x2c')]=_0x39f229;if(_0x49c901[_0x6476('0x38')][_0x6476('0x48')]){_0x3f6270['include']=[{'all':!![]}];}return db[_0x6476('0x34')][_0x6476('0x49')](_0x3f6270);})[_0x6476('0x1d')](function(_0x44f3c1){_0x58b93d[_0x6476('0x4a')]=_0x44f3c1;return _0x58b93d;})['then'](respondWithFilteredResult(_0x2e708c,_0x3f6270))[_0x6476('0x28')](handleError(_0x2e708c,null));};exports['show']=function(_0x4972a4,_0x5dba4a){var _0x16b9c4={'raw':![],'where':{'id':_0x4972a4[_0x6476('0x4b')]['id']}},_0xe0620b={};_0xe0620b[_0x6476('0x36')]=_[_0x6476('0x37')](db[_0x6476('0x34')]['rawAttributes']);_0xe0620b[_0x6476('0x38')]=_[_0x6476('0x37')](_0x4972a4[_0x6476('0x38')]);_0xe0620b[_0x6476('0x41')]=_[_0x6476('0x39')](_0xe0620b['model'],_0xe0620b[_0x6476('0x38')]);_0x16b9c4['attributes']=_[_0x6476('0x39')](_0xe0620b[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x4972a4[_0x6476('0x38')][_0x6476('0x3b')]));_0x16b9c4[_0x6476('0x3a')]=_0x16b9c4[_0x6476('0x3a')][_0x6476('0x3c')]?_0x16b9c4[_0x6476('0x3a')]:_0xe0620b[_0x6476('0x36')];if(_0x4972a4[_0x6476('0x38')][_0x6476('0x48')]){_0x16b9c4[_0x6476('0x4c')]=[{'all':!![]}];}_0x16b9c4=_[_0x6476('0x4d')]({},_0x16b9c4,_0x4972a4[_0x6476('0x4e')]);return db[_0x6476('0x34')][_0x6476('0x4f')](_0x16b9c4)[_0x6476('0x1d')](handleEntityNotFound(_0x5dba4a,null))['then'](respondWithResult(_0x5dba4a,null))['catch'](handleError(_0x5dba4a,null));};exports[_0x6476('0x50')]=function(_0x1c89c9,_0x3d14f5){return db[_0x6476('0x34')][_0x6476('0x50')](_0x1c89c9[_0x6476('0x51')],{})[_0x6476('0x1d')](respondWithResult(_0x3d14f5,0xc9))[_0x6476('0x28')](handleError(_0x3d14f5,null));};exports['update']=function(_0x3b64b3,_0x1b339a){if(_0x3b64b3[_0x6476('0x51')]['id']){delete _0x3b64b3[_0x6476('0x51')]['id'];}return db[_0x6476('0x34')][_0x6476('0x4f')]({'where':{'id':_0x3b64b3[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x1b339a,null))[_0x6476('0x1d')](saveUpdates(_0x3b64b3[_0x6476('0x51')],null))['then'](respondWithResult(_0x1b339a,null))['catch'](handleError(_0x1b339a,null));};exports['destroy']=function(_0x50d6ae,_0x3fbb1a){return db[_0x6476('0x34')]['find']({'where':{'id':_0x50d6ae[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x3fbb1a,null))[_0x6476('0x1d')](removeEntity(_0x3fbb1a,null))[_0x6476('0x28')](handleError(_0x3fbb1a,null));};exports['getFields']=function(_0x320a48,_0x423209,_0x3fa68d){var _0x50f795={};var _0x185586={};var _0x2b53d2;var _0x3b07f5;return db['Dynamics365Configuration'][_0x6476('0x52')]({'where':{'id':_0x320a48['params']['id']}})['then'](handleEntityNotFound(_0x423209,null))[_0x6476('0x1d')](function(_0x507964){if(_0x507964){_0x2b53d2=_0x507964;_0x185586[_0x6476('0x36')]=_['keys'](db[_0x6476('0x53')]['rawAttributes']);_0x185586[_0x6476('0x38')]=_[_0x6476('0x37')](_0x320a48[_0x6476('0x38')]);_0x185586[_0x6476('0x41')]=_[_0x6476('0x39')](_0x185586[_0x6476('0x36')],_0x185586[_0x6476('0x38')]);_0x50f795[_0x6476('0x3a')]=_[_0x6476('0x39')](_0x185586[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x320a48[_0x6476('0x38')][_0x6476('0x3b')]));_0x50f795[_0x6476('0x3a')]=_0x50f795[_0x6476('0x3a')][_0x6476('0x3c')]?_0x50f795[_0x6476('0x3a')]:_0x185586[_0x6476('0x36')];_0x50f795[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x320a48[_0x6476('0x38')][_0x6476('0x3f')]);_0x50f795[_0x6476('0x40')]=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x320a48[_0x6476('0x38')],_0x185586['filters']));if(_0x320a48['query'][_0x6476('0x43')]){_0x50f795['where']=_['merge'](_0x50f795[_0x6476('0x40')],{'$or':_[_0x6476('0x54')](_0x50f795[_0x6476('0x3a')],function(_0x17d1d8){var _0x35af66={};_0x35af66[_0x17d1d8]={'$like':'%'+_0x320a48[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x35af66;})});}_0x50f795=_[_0x6476('0x4d')]({},_0x50f795,_0x320a48['options']);return _0x2b53d2['getFields'](_0x50f795);}})[_0x6476('0x1d')](function(_0x316c9a){if(_0x316c9a){_0x3b07f5=_0x316c9a['length'];if(!_0x320a48[_0x6476('0x38')][_0x6476('0x55')](_0x6476('0x3d'))){_0x50f795[_0x6476('0x2e')]=qs['limit'](_0x320a48[_0x6476('0x38')][_0x6476('0x2e')]);_0x50f795[_0x6476('0x2d')]=qs['offset'](_0x320a48[_0x6476('0x38')][_0x6476('0x2d')]);}return _0x2b53d2[_0x6476('0x56')](_0x50f795);}})['then'](function(_0x4cb4c0){if(_0x4cb4c0){return _0x4cb4c0?{'count':_0x3b07f5,'rows':_0x4cb4c0}:null;}})[_0x6476('0x1d')](respondWithResult(_0x423209,null))[_0x6476('0x28')](handleError(_0x423209,null));};exports[_0x6476('0x57')]=function(_0x4a67cc,_0x71dd73,_0x26d1db){var _0x21dc79={};var _0x19d313={};var _0xbd270e;var _0x22e4f3;return db[_0x6476('0x34')]['findOne']({'where':{'id':_0x4a67cc[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x71dd73,null))[_0x6476('0x1d')](function(_0x42d541){if(_0x42d541){_0xbd270e=_0x42d541;_0x19d313[_0x6476('0x36')]=_[_0x6476('0x37')](db[_0x6476('0x53')][_0x6476('0x35')]);_0x19d313[_0x6476('0x38')]=_[_0x6476('0x37')](_0x4a67cc[_0x6476('0x38')]);_0x19d313[_0x6476('0x41')]=_[_0x6476('0x39')](_0x19d313['model'],_0x19d313[_0x6476('0x38')]);_0x21dc79[_0x6476('0x3a')]=_['intersection'](_0x19d313[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x4a67cc[_0x6476('0x38')][_0x6476('0x3b')]));_0x21dc79[_0x6476('0x3a')]=_0x21dc79['attributes'][_0x6476('0x3c')]?_0x21dc79['attributes']:_0x19d313[_0x6476('0x36')];_0x21dc79['order']=qs[_0x6476('0x3f')](_0x4a67cc[_0x6476('0x38')]['sort']);_0x21dc79['where']=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x4a67cc['query'],_0x19d313['filters']));if(_0x4a67cc[_0x6476('0x38')]['filter']){_0x21dc79[_0x6476('0x40')]=_[_0x6476('0x4d')](_0x21dc79[_0x6476('0x40')],{'$or':_[_0x6476('0x54')](_0x21dc79[_0x6476('0x3a')],function(_0x4f6ee6){var _0x540fdf={};_0x540fdf[_0x4f6ee6]={'$like':'%'+_0x4a67cc[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x540fdf;})});}_0x21dc79=_[_0x6476('0x4d')]({},_0x21dc79,_0x4a67cc[_0x6476('0x4e')]);return _0xbd270e[_0x6476('0x57')](_0x21dc79);}})['then'](function(_0x9d0031){if(_0x9d0031){_0x22e4f3=_0x9d0031[_0x6476('0x3c')];if(!_0x4a67cc['query'][_0x6476('0x55')]('nolimit')){_0x21dc79[_0x6476('0x2e')]=qs['limit'](_0x4a67cc['query']['limit']);_0x21dc79[_0x6476('0x2d')]=qs[_0x6476('0x2d')](_0x4a67cc['query'][_0x6476('0x2d')]);}return _0xbd270e[_0x6476('0x57')](_0x21dc79);}})['then'](function(_0x119a09){if(_0x119a09){return _0x119a09?{'count':_0x22e4f3,'rows':_0x119a09}:null;}})['then'](respondWithResult(_0x71dd73,null))[_0x6476('0x28')](handleError(_0x71dd73,null));};exports[_0x6476('0x58')]=function(_0x5d8291,_0x17f0c4,_0x19a345){var _0x26dc17={};var _0x54a09c={};var _0x160469;var _0xb2f24b;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5d8291[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x17f0c4,null))[_0x6476('0x1d')](function(_0x5d0215){if(_0x5d0215){_0x160469=_0x5d0215;_0x54a09c['model']=_[_0x6476('0x37')](db[_0x6476('0x53')][_0x6476('0x35')]);_0x54a09c[_0x6476('0x38')]=_[_0x6476('0x37')](_0x5d8291['query']);_0x54a09c[_0x6476('0x41')]=_['intersection'](_0x54a09c[_0x6476('0x36')],_0x54a09c[_0x6476('0x38')]);_0x26dc17['attributes']=_[_0x6476('0x39')](_0x54a09c['model'],qs[_0x6476('0x3b')](_0x5d8291[_0x6476('0x38')][_0x6476('0x3b')]));_0x26dc17[_0x6476('0x3a')]=_0x26dc17[_0x6476('0x3a')][_0x6476('0x3c')]?_0x26dc17[_0x6476('0x3a')]:_0x54a09c[_0x6476('0x36')];_0x26dc17[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x5d8291[_0x6476('0x38')][_0x6476('0x3f')]);_0x26dc17[_0x6476('0x40')]=qs[_0x6476('0x41')](_['pick'](_0x5d8291['query'],_0x54a09c[_0x6476('0x41')]));if(_0x5d8291[_0x6476('0x38')]['filter']){_0x26dc17[_0x6476('0x40')]=_[_0x6476('0x4d')](_0x26dc17[_0x6476('0x40')],{'$or':_['map'](_0x26dc17[_0x6476('0x3a')],function(_0x9ca3b0){var _0x4347d1={};_0x4347d1[_0x9ca3b0]={'$like':'%'+_0x5d8291[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x4347d1;})});}_0x26dc17=_[_0x6476('0x4d')]({},_0x26dc17,_0x5d8291['options']);return _0x160469[_0x6476('0x58')](_0x26dc17);}})['then'](function(_0x59980e){if(_0x59980e){_0xb2f24b=_0x59980e[_0x6476('0x3c')];if(!_0x5d8291[_0x6476('0x38')][_0x6476('0x55')]('nolimit')){_0x26dc17['limit']=qs[_0x6476('0x2e')](_0x5d8291[_0x6476('0x38')][_0x6476('0x2e')]);_0x26dc17['offset']=qs[_0x6476('0x2d')](_0x5d8291['query']['offset']);}return _0x160469[_0x6476('0x58')](_0x26dc17);}})[_0x6476('0x1d')](function(_0xf2a49d){if(_0xf2a49d){return _0xf2a49d?{'count':_0xb2f24b,'rows':_0xf2a49d}:null;}})[_0x6476('0x1d')](respondWithResult(_0x17f0c4,null))[_0x6476('0x28')](handleError(_0x17f0c4,null));}; \ No newline at end of file +var _0x5f4b=['api','../../config/utils','../../config/environment','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','count','offset','set','json','apply','reject','save','update','destroy','name','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','Dynamics365Configuration','include','findAll','rows','show','find','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x35b99a,_0x12f6c3){var _0x72bf53=function(_0x30bfa3){while(--_0x30bfa3){_0x35b99a['push'](_0x35b99a['shift']());}};_0x72bf53(++_0x12f6c3);}(_0x5f4b,0x13e));var _0xb5f4=function(_0x217550,_0x80b968){_0x217550=_0x217550-0x0;var _0x5ba928=_0x5f4b[_0x217550];return _0x5ba928;};'use strict';var pdf=require(_0xb5f4('0x0'));var emlformat=require(_0xb5f4('0x1'));var rimraf=require(_0xb5f4('0x2'));var zipdir=require(_0xb5f4('0x3'));var jsonpatch=require(_0xb5f4('0x4'));var rp=require(_0xb5f4('0x5'));var moment=require(_0xb5f4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb5f4('0x7'));var util=require(_0xb5f4('0x8'));var path=require(_0xb5f4('0x9'));var sox=require(_0xb5f4('0xa'));var csv=require(_0xb5f4('0xb'));var ejs=require(_0xb5f4('0xc'));var fs=require('fs');var _=require(_0xb5f4('0xd'));var squel=require(_0xb5f4('0xe'));var crypto=require(_0xb5f4('0xf'));var jsforce=require(_0xb5f4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb5f4('0xb'));var querystring=require(_0xb5f4('0x11'));var Papa=require(_0xb5f4('0x12'));var Redis=require('ioredis');var authService=require(_0xb5f4('0x13'));var qs=require(_0xb5f4('0x14'));var hardwareService=require(_0xb5f4('0x15'));var logger=require('../../config/logger')(_0xb5f4('0x16'));var utils=require(_0xb5f4('0x17'));var config=require(_0xb5f4('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb5f4('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3c5ffc,_0x3cea5c,_0x3deed1){if(_0x3deed1){var _0xcac048=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcac048[_0xb5f4('0x1a')](_0x3cea5c)){return _0x3c5ffc;}else{throw new Error(_0xb5f4('0x1b'));}}else{return _0x3c5ffc;}}function respondWithRpcPromise(_0x5f0ea2,_0x1d00fc,_0x136261,_0x4be7e7){return new BPromise(function(_0x14cd71,_0x2f8d12){var _0x547aed=_0x4be7e7||client;return _0x547aed['request'](_0x5f0ea2,_0x136261)[_0xb5f4('0x1c')](function(_0x1c576d){logger['info'](_0xb5f4('0x1d'),_0x1d00fc,'request\x20sent');logger['debug'](_0xb5f4('0x1e'),_0x1d00fc,_0xb5f4('0x1f'),JSON[_0xb5f4('0x20')](_0x1c576d));if(_0x1c576d[_0xb5f4('0x21')]){if(_0x1c576d[_0xb5f4('0x21')]['code']===0x1f4){logger[_0xb5f4('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1d00fc,_0x1c576d[_0xb5f4('0x21')]['message']);return _0x2f8d12(_0x1c576d[_0xb5f4('0x21')][_0xb5f4('0x22')]);}logger[_0xb5f4('0x21')](_0xb5f4('0x1d'),_0x1d00fc,_0x1c576d[_0xb5f4('0x21')]['message']);return _0x14cd71(_0x1c576d['error'][_0xb5f4('0x22')]);}else{logger[_0xb5f4('0x23')](_0xb5f4('0x1d'),_0x1d00fc,_0xb5f4('0x1f'));_0x14cd71(_0x1c576d[_0xb5f4('0x24')][_0xb5f4('0x22')]);}})[_0xb5f4('0x25')](function(_0x4a1368){logger[_0xb5f4('0x21')](_0xb5f4('0x1d'),_0x1d00fc,_0x4a1368);_0x2f8d12(_0x4a1368);});});}function respondWithStatusCode(_0x1fc3bf,_0x574c77){_0x574c77=_0x574c77||0xcc;return function(_0x46f2bc){if(_0x46f2bc){return _0x1fc3bf[_0xb5f4('0x26')](_0x574c77);}return _0x1fc3bf['status'](_0x574c77)['end']();};}function respondWithResult(_0x436bb8,_0x383dd3){_0x383dd3=_0x383dd3||0xc8;return function(_0x34cad3){if(_0x34cad3){return _0x436bb8[_0xb5f4('0x27')](_0x383dd3)['json'](_0x34cad3);}};}function respondWithFilteredResult(_0x34e20c,_0x282278){return function(_0x46ef2a){if(_0x46ef2a){var _0x26484d=_0x46ef2a[_0xb5f4('0x28')],_0x53d225=_0x282278[_0xb5f4('0x29')],_0x1fe7b3=_0x282278['offset']+_0x282278['limit'],_0x24336c;if(_0x1fe7b3>=_0x26484d){_0x1fe7b3=_0x26484d;_0x24336c=0xc8;}else{_0x24336c=0xce;}_0x34e20c[_0xb5f4('0x27')](_0x24336c);return _0x34e20c[_0xb5f4('0x2a')]('Content-Range',_0x53d225+'-'+_0x1fe7b3+'/'+_0x26484d)[_0xb5f4('0x2b')](_0x46ef2a);}return null;};}function patchUpdates(_0x361f49){return function(_0x394499){try{jsonpatch[_0xb5f4('0x2c')](_0x394499,_0x361f49,!![]);}catch(_0x4c84e4){return BPromise[_0xb5f4('0x2d')](_0x4c84e4);}return _0x394499[_0xb5f4('0x2e')]();};}function saveUpdates(_0x20eb3e,_0x10ecf9){return function(_0xe2791e){if(_0xe2791e){return _0xe2791e[_0xb5f4('0x2f')](_0x20eb3e)['then'](function(_0x28daba){return _0x28daba;});}return null;};}function removeEntity(_0x3e1add,_0x50cec3){return function(_0x12bb88){if(_0x12bb88){return _0x12bb88[_0xb5f4('0x30')]()[_0xb5f4('0x1c')](function(){_0x3e1add[_0xb5f4('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483193,_0x553fb2){return function(_0x303595){if(!_0x303595){_0x483193[_0xb5f4('0x26')](0x194);}return _0x303595;};}function handleError(_0x826e46,_0x2c2145){_0x2c2145=_0x2c2145||0x1f4;return function(_0x2d2eec){logger[_0xb5f4('0x21')](_0x2d2eec['stack']);if(_0x2d2eec[_0xb5f4('0x31')]){delete _0x2d2eec['name'];}_0x826e46['status'](_0x2c2145)['send'](_0x2d2eec);};}exports['index']=function(_0x9887c7,_0x5b4371){var _0x466727={},_0x4f271c={},_0x35b411={'count':0x0,'rows':[]};var _0x5b1a13=db['Dynamics365Configuration'][_0xb5f4('0x32')];_0x4f271c[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](_0x5b1a13);_0x4f271c[_0xb5f4('0x35')]=_['keys'](_0x9887c7['query']);_0x4f271c[_0xb5f4('0x36')]=_['intersection'](_0x4f271c['model'],_0x4f271c['query']);_0x466727[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x4f271c[_0xb5f4('0x33')],qs['fields'](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x466727[_0xb5f4('0x37')]=_0x466727[_0xb5f4('0x37')][_0xb5f4('0x3a')]?_0x466727[_0xb5f4('0x37')]:_0x4f271c[_0xb5f4('0x33')];if(!_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x466727[_0xb5f4('0x3d')]=qs[_0xb5f4('0x3d')](_0x9887c7['query'][_0xb5f4('0x3d')]);_0x466727[_0xb5f4('0x29')]=qs['offset'](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x29')]);}_0x466727[_0xb5f4('0x3e')]=qs[_0xb5f4('0x3f')](_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x3f')]);_0x466727[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_[_0xb5f4('0x41')](_0x9887c7[_0xb5f4('0x35')],_0x4f271c[_0xb5f4('0x36')]));if(_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x42')]){_0x466727[_0xb5f4('0x40')]=_['merge'](_0x466727[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x5b1a13,function(_0x52a952){if(_0x52a952[_0xb5f4('0x44')]['key']!==_0xb5f4('0x45')){var _0x581a4a={};_0x581a4a[_0x52a952['field']]={'$like':'%'+_0x9887c7[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x581a4a;}})});}_0x466727=_[_0xb5f4('0x46')]({},_0x466727,_0x9887c7[_0xb5f4('0x47')]);var _0x1cf66a={'where':_0x466727[_0xb5f4('0x40')]};return db[_0xb5f4('0x48')][_0xb5f4('0x28')](_0x1cf66a)['then'](function(_0x1f7cb5){_0x35b411[_0xb5f4('0x28')]=_0x1f7cb5;if(_0x9887c7[_0xb5f4('0x35')]['includeAll']){_0x466727[_0xb5f4('0x49')]=[{'all':!![]}];}return db[_0xb5f4('0x48')][_0xb5f4('0x4a')](_0x466727);})[_0xb5f4('0x1c')](function(_0x4a907a){_0x35b411[_0xb5f4('0x4b')]=_0x4a907a;return _0x35b411;})[_0xb5f4('0x1c')](respondWithFilteredResult(_0x5b4371,_0x466727))[_0xb5f4('0x25')](handleError(_0x5b4371,null));};exports[_0xb5f4('0x4c')]=function(_0x35dd5a,_0x3a6b4b){var _0x5033f6={'raw':![],'where':{'id':_0x35dd5a['params']['id']}},_0x38574c={};_0x38574c['model']=_['keys'](db[_0xb5f4('0x48')][_0xb5f4('0x32')]);_0x38574c['query']=_[_0xb5f4('0x34')](_0x35dd5a[_0xb5f4('0x35')]);_0x38574c[_0xb5f4('0x36')]=_['intersection'](_0x38574c[_0xb5f4('0x33')],_0x38574c['query']);_0x5033f6[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x38574c[_0xb5f4('0x33')],qs[_0xb5f4('0x39')](_0x35dd5a[_0xb5f4('0x35')]['fields']));_0x5033f6['attributes']=_0x5033f6[_0xb5f4('0x37')][_0xb5f4('0x3a')]?_0x5033f6[_0xb5f4('0x37')]:_0x38574c[_0xb5f4('0x33')];if(_0x35dd5a['query']['includeAll']){_0x5033f6[_0xb5f4('0x49')]=[{'all':!![]}];}_0x5033f6=_[_0xb5f4('0x46')]({},_0x5033f6,_0x35dd5a['options']);return db['Dynamics365Configuration'][_0xb5f4('0x4d')](_0x5033f6)[_0xb5f4('0x1c')](handleEntityNotFound(_0x3a6b4b,null))[_0xb5f4('0x1c')](respondWithResult(_0x3a6b4b,null))[_0xb5f4('0x25')](handleError(_0x3a6b4b,null));};exports['create']=function(_0x26a2d3,_0x106829){return db[_0xb5f4('0x48')]['create'](_0x26a2d3[_0xb5f4('0x4e')],{})['then'](respondWithResult(_0x106829,0xc9))[_0xb5f4('0x25')](handleError(_0x106829,null));};exports[_0xb5f4('0x2f')]=function(_0x454696,_0xd458ba){if(_0x454696[_0xb5f4('0x4e')]['id']){delete _0x454696['body']['id'];}return db[_0xb5f4('0x48')]['find']({'where':{'id':_0x454696[_0xb5f4('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd458ba,null))['then'](saveUpdates(_0x454696[_0xb5f4('0x4e')],null))[_0xb5f4('0x1c')](respondWithResult(_0xd458ba,null))['catch'](handleError(_0xd458ba,null));};exports[_0xb5f4('0x30')]=function(_0x302ebe,_0x408383){return db[_0xb5f4('0x48')][_0xb5f4('0x4d')]({'where':{'id':_0x302ebe[_0xb5f4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x408383,null))[_0xb5f4('0x1c')](removeEntity(_0x408383,null))[_0xb5f4('0x25')](handleError(_0x408383,null));};exports[_0xb5f4('0x50')]=function(_0x4f9330,_0x273f23,_0x1bc6c0){var _0x590ef4={};var _0x5248f1={};var _0x4045af;var _0x498cef;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x4f9330['params']['id']}})['then'](handleEntityNotFound(_0x273f23,null))['then'](function(_0x46dcdf){if(_0x46dcdf){_0x4045af=_0x46dcdf;_0x5248f1[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')]['rawAttributes']);_0x5248f1[_0xb5f4('0x35')]=_['keys'](_0x4f9330[_0xb5f4('0x35')]);_0x5248f1['filters']=_['intersection'](_0x5248f1[_0xb5f4('0x33')],_0x5248f1[_0xb5f4('0x35')]);_0x590ef4[_0xb5f4('0x37')]=_[_0xb5f4('0x38')](_0x5248f1[_0xb5f4('0x33')],qs[_0xb5f4('0x39')](_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x590ef4[_0xb5f4('0x37')]=_0x590ef4['attributes']['length']?_0x590ef4['attributes']:_0x5248f1[_0xb5f4('0x33')];_0x590ef4[_0xb5f4('0x3e')]=qs[_0xb5f4('0x3f')](_0x4f9330['query'][_0xb5f4('0x3f')]);_0x590ef4[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_['pick'](_0x4f9330[_0xb5f4('0x35')],_0x5248f1[_0xb5f4('0x36')]));if(_0x4f9330['query']['filter']){_0x590ef4[_0xb5f4('0x40')]=_[_0xb5f4('0x46')](_0x590ef4[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x590ef4['attributes'],function(_0x12714d){var _0x501a89={};_0x501a89[_0x12714d]={'$like':'%'+_0x4f9330[_0xb5f4('0x35')]['filter']+'%'};return _0x501a89;})});}_0x590ef4=_['merge']({},_0x590ef4,_0x4f9330[_0xb5f4('0x47')]);return _0x4045af[_0xb5f4('0x50')](_0x590ef4);}})[_0xb5f4('0x1c')](function(_0x32985e){if(_0x32985e){_0x498cef=_0x32985e[_0xb5f4('0x3a')];if(!_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x590ef4[_0xb5f4('0x3d')]=qs['limit'](_0x4f9330['query'][_0xb5f4('0x3d')]);_0x590ef4[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x4f9330[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x4045af['getFields'](_0x590ef4);}})[_0xb5f4('0x1c')](function(_0x1a220d){if(_0x1a220d){return _0x1a220d?{'count':_0x498cef,'rows':_0x1a220d}:null;}})[_0xb5f4('0x1c')](respondWithResult(_0x273f23,null))[_0xb5f4('0x25')](handleError(_0x273f23,null));};exports['getSubjects']=function(_0x49d85e,_0x2aacd7,_0x2d7235){var _0x5ebbaa={};var _0x40f690={};var _0x2ccd45;var _0x3f0386;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x49d85e['params']['id']}})[_0xb5f4('0x1c')](handleEntityNotFound(_0x2aacd7,null))[_0xb5f4('0x1c')](function(_0x568a77){if(_0x568a77){_0x2ccd45=_0x568a77;_0x40f690[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')][_0xb5f4('0x32')]);_0x40f690[_0xb5f4('0x35')]=_['keys'](_0x49d85e[_0xb5f4('0x35')]);_0x40f690[_0xb5f4('0x36')]=_['intersection'](_0x40f690[_0xb5f4('0x33')],_0x40f690['query']);_0x5ebbaa[_0xb5f4('0x37')]=_['intersection'](_0x40f690[_0xb5f4('0x33')],qs['fields'](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x5ebbaa[_0xb5f4('0x37')]=_0x5ebbaa[_0xb5f4('0x37')]['length']?_0x5ebbaa[_0xb5f4('0x37')]:_0x40f690[_0xb5f4('0x33')];_0x5ebbaa[_0xb5f4('0x3e')]=qs['sort'](_0x49d85e['query'][_0xb5f4('0x3f')]);_0x5ebbaa[_0xb5f4('0x40')]=qs['filters'](_[_0xb5f4('0x41')](_0x49d85e[_0xb5f4('0x35')],_0x40f690['filters']));if(_0x49d85e['query']['filter']){_0x5ebbaa[_0xb5f4('0x40')]=_[_0xb5f4('0x46')](_0x5ebbaa[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x5ebbaa[_0xb5f4('0x37')],function(_0x687572){var _0x45be99={};_0x45be99[_0x687572]={'$like':'%'+_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x45be99;})});}_0x5ebbaa=_[_0xb5f4('0x46')]({},_0x5ebbaa,_0x49d85e[_0xb5f4('0x47')]);return _0x2ccd45[_0xb5f4('0x53')](_0x5ebbaa);}})['then'](function(_0x498049){if(_0x498049){_0x3f0386=_0x498049[_0xb5f4('0x3a')];if(!_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x3b')]('nolimit')){_0x5ebbaa[_0xb5f4('0x3d')]=qs[_0xb5f4('0x3d')](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x3d')]);_0x5ebbaa[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x49d85e[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x2ccd45[_0xb5f4('0x53')](_0x5ebbaa);}})['then'](function(_0x2bd287){if(_0x2bd287){return _0x2bd287?{'count':_0x3f0386,'rows':_0x2bd287}:null;}})['then'](respondWithResult(_0x2aacd7,null))[_0xb5f4('0x25')](handleError(_0x2aacd7,null));};exports[_0xb5f4('0x54')]=function(_0x3423bb,_0x4cb1fd,_0x470b6f){var _0x1f95ad={};var _0x5874f4={};var _0x54e90f;var _0x31a39a;return db[_0xb5f4('0x48')][_0xb5f4('0x51')]({'where':{'id':_0x3423bb[_0xb5f4('0x4f')]['id']}})[_0xb5f4('0x1c')](handleEntityNotFound(_0x4cb1fd,null))['then'](function(_0x319d1e){if(_0x319d1e){_0x54e90f=_0x319d1e;_0x5874f4[_0xb5f4('0x33')]=_[_0xb5f4('0x34')](db[_0xb5f4('0x52')][_0xb5f4('0x32')]);_0x5874f4[_0xb5f4('0x35')]=_[_0xb5f4('0x34')](_0x3423bb[_0xb5f4('0x35')]);_0x5874f4[_0xb5f4('0x36')]=_[_0xb5f4('0x38')](_0x5874f4[_0xb5f4('0x33')],_0x5874f4[_0xb5f4('0x35')]);_0x1f95ad['attributes']=_[_0xb5f4('0x38')](_0x5874f4['model'],qs['fields'](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x39')]));_0x1f95ad[_0xb5f4('0x37')]=_0x1f95ad[_0xb5f4('0x37')]['length']?_0x1f95ad[_0xb5f4('0x37')]:_0x5874f4[_0xb5f4('0x33')];_0x1f95ad['order']=qs[_0xb5f4('0x3f')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3f')]);_0x1f95ad[_0xb5f4('0x40')]=qs[_0xb5f4('0x36')](_['pick'](_0x3423bb[_0xb5f4('0x35')],_0x5874f4[_0xb5f4('0x36')]));if(_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x42')]){_0x1f95ad['where']=_[_0xb5f4('0x46')](_0x1f95ad[_0xb5f4('0x40')],{'$or':_[_0xb5f4('0x43')](_0x1f95ad[_0xb5f4('0x37')],function(_0x233372){var _0x56e0c1={};_0x56e0c1[_0x233372]={'$like':'%'+_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x42')]+'%'};return _0x56e0c1;})});}_0x1f95ad=_[_0xb5f4('0x46')]({},_0x1f95ad,_0x3423bb[_0xb5f4('0x47')]);return _0x54e90f['getDescriptions'](_0x1f95ad);}})[_0xb5f4('0x1c')](function(_0x1c64f9){if(_0x1c64f9){_0x31a39a=_0x1c64f9[_0xb5f4('0x3a')];if(!_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3b')](_0xb5f4('0x3c'))){_0x1f95ad['limit']=qs[_0xb5f4('0x3d')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x3d')]);_0x1f95ad[_0xb5f4('0x29')]=qs[_0xb5f4('0x29')](_0x3423bb[_0xb5f4('0x35')][_0xb5f4('0x29')]);}return _0x54e90f[_0xb5f4('0x54')](_0x1f95ad);}})[_0xb5f4('0x1c')](function(_0x4a1802){if(_0x4a1802){return _0x4a1802?{'count':_0x31a39a,'rows':_0x4a1802}:null;}})['then'](respondWithResult(_0x4cb1fd,null))['catch'](handleError(_0x4cb1fd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 6d70f2a..54a4ef6 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 _0xf263=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','moment','request-promise','path'];(function(_0x1fcc7d,_0x4eb620){var _0x3daa39=function(_0x2b90f9){while(--_0x2b90f9){_0x1fcc7d['push'](_0x1fcc7d['shift']());}};_0x3daa39(++_0x4eb620);}(_0xf263,0x8b));var _0x3f26=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf263[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3f26('0x0'));var util=require('util');var logger=require(_0x3f26('0x1'))('api');var moment=require(_0x3f26('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f26('0x3'));var fs=require('fs');var path=require(_0x3f26('0x4'));var rimraf=require('rimraf');var config=require(_0x3f26('0x5'));var attributes=require(_0x3f26('0x6'));module[_0x3f26('0x7')]=function(_0x2c1ef4,_0x4d16bf){return _0x2c1ef4[_0x3f26('0x8')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb3f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb3f,0x195));var _0xfcb3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcb3f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xfcb3('0x0'));var util=require(_0xfcb3('0x1'));var logger=require(_0xfcb3('0x2'))(_0xfcb3('0x3'));var moment=require(_0xfcb3('0x4'));var BPromise=require(_0xfcb3('0x5'));var rp=require(_0xfcb3('0x6'));var fs=require('fs');var path=require(_0xfcb3('0x7'));var rimraf=require(_0xfcb3('0x8'));var config=require('../../config/environment');var attributes=require(_0xfcb3('0x9'));module[_0xfcb3('0xa')]=function(_0x46e5f2,_0x257e58){return _0x46e5f2[_0xfcb3('0xb')](_0xfcb3('0xc'),attributes,{'tableName':_0xfcb3('0xd'),'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 67f8f01..752bd05 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 _0xde2c=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x4ce166,_0x418ecb){var _0x3cbf38=function(_0x104b99){while(--_0x104b99){_0x4ce166['push'](_0x4ce166['shift']());}};_0x3cbf38(++_0x418ecb);}(_0xde2c,0x16f));var _0xcde2=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xde2c[_0x5b7788];return _0x573871;};'use strict';var _=require(_0xcde2('0x0'));var util=require('util');var moment=require(_0xcde2('0x1'));var BPromise=require(_0xcde2('0x2'));var rs=require(_0xcde2('0x3'));var fs=require('fs');var Redis=require(_0xcde2('0x4'));var db=require(_0xcde2('0x5'))['db'];var utils=require(_0xcde2('0x6'));var logger=require(_0xcde2('0x7'))('rpc');var config=require(_0xcde2('0x8'));var jayson=require(_0xcde2('0x9'));var client=jayson[_0xcde2('0xa')][_0xcde2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46ef6c,_0x2dce23,_0x405031){return new BPromise(function(_0x306242,_0x465fcc){return client['request'](_0x46ef6c,_0x405031)[_0xcde2('0xc')](function(_0x5201d2){logger[_0xcde2('0xd')](_0xcde2('0xe'),_0x2dce23,'request\x20sent');logger[_0xcde2('0xf')](_0xcde2('0x10'),_0x2dce23,_0xcde2('0x11'),JSON[_0xcde2('0x12')](_0x5201d2));if(_0x5201d2[_0xcde2('0x13')]){if(_0x5201d2['error'][_0xcde2('0x14')]===0x1f4){logger[_0xcde2('0x13')](_0xcde2('0xe'),_0x2dce23,_0x5201d2[_0xcde2('0x13')]['message']);return _0x465fcc(_0x5201d2['error'][_0xcde2('0x15')]);}logger[_0xcde2('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2dce23,_0x5201d2[_0xcde2('0x13')][_0xcde2('0x15')]);return _0x306242(_0x5201d2[_0xcde2('0x13')][_0xcde2('0x15')]);}else{logger[_0xcde2('0xd')](_0xcde2('0xe'),_0x2dce23,'request\x20sent');_0x306242(_0x5201d2[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x5ea90c){logger[_0xcde2('0x13')](_0xcde2('0xe'),_0x2dce23,_0x5ea90c);_0x465fcc(_0x5ea90c);});});} \ No newline at end of file +var _0x08da=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x08da,0xf5));var _0xa08d=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x08da[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xa08d('0x0'));var util=require(_0xa08d('0x1'));var moment=require(_0xa08d('0x2'));var BPromise=require('bluebird');var rs=require(_0xa08d('0x3'));var fs=require('fs');var Redis=require(_0xa08d('0x4'));var db=require(_0xa08d('0x5'))['db'];var utils=require(_0xa08d('0x6'));var logger=require(_0xa08d('0x7'))(_0xa08d('0x8'));var config=require(_0xa08d('0x9'));var jayson=require(_0xa08d('0xa'));var client=jayson[_0xa08d('0xb')][_0xa08d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16a415,_0x2d6bcf,_0x2a6c06){return new BPromise(function(_0x735948,_0x192c33){return client[_0xa08d('0xd')](_0x16a415,_0x2a6c06)[_0xa08d('0xe')](function(_0x3eeff5){logger[_0xa08d('0xf')](_0xa08d('0x10'),_0x2d6bcf,_0xa08d('0x11'));logger[_0xa08d('0x12')](_0xa08d('0x13'),_0x2d6bcf,_0xa08d('0x11'),JSON[_0xa08d('0x14')](_0x3eeff5));if(_0x3eeff5[_0xa08d('0x15')]){if(_0x3eeff5[_0xa08d('0x15')][_0xa08d('0x16')]===0x1f4){logger[_0xa08d('0x15')](_0xa08d('0x10'),_0x2d6bcf,_0x3eeff5['error'][_0xa08d('0x17')]);return _0x192c33(_0x3eeff5[_0xa08d('0x15')][_0xa08d('0x17')]);}logger[_0xa08d('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2d6bcf,_0x3eeff5[_0xa08d('0x15')]['message']);return _0x735948(_0x3eeff5['error'][_0xa08d('0x17')]);}else{logger[_0xa08d('0xf')](_0xa08d('0x10'),_0x2d6bcf,_0xa08d('0x11'));_0x735948(_0x3eeff5['result']['message']);}})[_0xa08d('0x18')](function(_0x19eeb9){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2d6bcf,_0x19eeb9);_0x192c33(_0x19eeb9);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index efe759b..8fe0fa2 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 _0xe080=['express','Router','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0xe080,0x1d9));var _0x0e08=function(_0xae46ae,_0x6ceec6){_0xae46ae=_0xae46ae-0x0;var _0xf88ff4=_0xe080[_0xae46ae];return _0xf88ff4;};'use strict';var multer=require(_0x0e08('0x0'));var util=require('util');var path=require(_0x0e08('0x1'));var timeout=require(_0x0e08('0x2'));var express=require(_0x0e08('0x3'));var router=express[_0x0e08('0x4')]();var auth=require(_0x0e08('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0e08('0x6'));router[_0x0e08('0x7')]('/',auth[_0x0e08('0x8')](),controller[_0x0e08('0x9')]);router[_0x0e08('0x7')](_0x0e08('0xa'),auth[_0x0e08('0x8')](),controller[_0x0e08('0xb')]);router[_0x0e08('0xc')]('/',auth[_0x0e08('0x8')](),controller[_0x0e08('0xd')]);router[_0x0e08('0xe')](_0x0e08('0xa'),auth['isAuthenticated'](),controller[_0x0e08('0xf')]);router['delete']('/:id',auth[_0x0e08('0x8')](),controller[_0x0e08('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3bbd=['index','/:id','isAuthenticated','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x3bbd,0x88));var _0xd3bb=function(_0x439fe0,_0x3a50d8){_0x439fe0=_0x439fe0-0x0;var _0x3ebf90=_0x3bbd[_0x439fe0];return _0x3ebf90;};'use strict';var multer=require('multer');var util=require(_0xd3bb('0x0'));var path=require(_0xd3bb('0x1'));var timeout=require(_0xd3bb('0x2'));var express=require(_0xd3bb('0x3'));var router=express[_0xd3bb('0x4')]();var auth=require(_0xd3bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd3bb('0x6'));var controller=require(_0xd3bb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd3bb('0x8')]);router['get'](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller['show']);router['post']('/',auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xb')]);router['put'](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xc')]);router[_0xd3bb('0xd')](_0xd3bb('0x9'),auth[_0xd3bb('0xa')](),controller[_0xd3bb('0xe')]);module[_0xd3bb('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0c2894d..6907c7a 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 _0x153f=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x153f,0x15b));var _0xf153=function(_0x511653,_0x3b52b4){_0x511653=_0x511653-0x0;var _0x34e716=_0x153f[_0x511653];return _0x34e716;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'type':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'),_0xf153('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf153('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'))},'keyContent':{'type':Sequelize[_0xf153('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf153('0x7')]},'customField':{'type':Sequelize[_0xf153('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf153('0x7')]}}; \ No newline at end of file +var _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x450813,_0x1eb1ba){var _0x246705=function(_0x36fb9d){while(--_0x36fb9d){_0x450813['push'](_0x450813['shift']());}};_0x246705(++_0x1eb1ba);}(_0x5c00,0x17e));var _0x05c0=function(_0x5a12ff,_0x2e18db){_0x5a12ff=_0x5a12ff-0x0;var _0x285f8d=_0x5c00[_0x5a12ff];return _0x285f8d;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 377dd9c..300c5f6 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 _0x0cff=['status','end','json','offset','limit','set','apply','reject','update','then','destroy','error','name','send','index','Dynamics365Field','rawAttributes','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus'];(function(_0x120905,_0x3ed4ef){var _0x55446d=function(_0x1f3785){while(--_0x1f3785){_0x120905['push'](_0x120905['shift']());}};_0x55446d(++_0x3ed4ef);}(_0x0cff,0x18c));var _0xf0cf=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x0cff[_0x5d8018];return _0x151ac4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf0cf('0x0'));var rimraf=require(_0xf0cf('0x1'));var zipdir=require(_0xf0cf('0x2'));var jsonpatch=require(_0xf0cf('0x3'));var rp=require('request-promise');var moment=require(_0xf0cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf0cf('0x5'));var util=require(_0xf0cf('0x6'));var path=require(_0xf0cf('0x7'));var sox=require(_0xf0cf('0x8'));var csv=require(_0xf0cf('0x9'));var ejs=require(_0xf0cf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0cf('0xb'));var crypto=require(_0xf0cf('0xc'));var jsforce=require(_0xf0cf('0xd'));var deskjs=require(_0xf0cf('0xe'));var toCsv=require(_0xf0cf('0x9'));var querystring=require('querystring');var Papa=require(_0xf0cf('0xf'));var Redis=require(_0xf0cf('0x10'));var authService=require(_0xf0cf('0x11'));var qs=require(_0xf0cf('0x12'));var hardwareService=require(_0xf0cf('0x13'));var logger=require(_0xf0cf('0x14'))(_0xf0cf('0x15'));var utils=require('../../config/utils');var config=require(_0xf0cf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b5bad,_0x3cbf8d){_0x3cbf8d=_0x3cbf8d||0xcc;return function(_0x480c1d){if(_0x480c1d){return _0x1b5bad[_0xf0cf('0x17')](_0x3cbf8d);}return _0x1b5bad[_0xf0cf('0x18')](_0x3cbf8d)[_0xf0cf('0x19')]();};}function respondWithResult(_0x4f96f1,_0x55ef0c){_0x55ef0c=_0x55ef0c||0xc8;return function(_0x6aedc){if(_0x6aedc){return _0x4f96f1[_0xf0cf('0x18')](_0x55ef0c)[_0xf0cf('0x1a')](_0x6aedc);}};}function respondWithFilteredResult(_0x940a76,_0x265718){return function(_0x25f1f2){if(_0x25f1f2){var _0x12fc03=_0x25f1f2['count'],_0x1e5011=_0x265718[_0xf0cf('0x1b')],_0x17f2a4=_0x265718[_0xf0cf('0x1b')]+_0x265718[_0xf0cf('0x1c')],_0x486ee9;if(_0x17f2a4>=_0x12fc03){_0x17f2a4=_0x12fc03;_0x486ee9=0xc8;}else{_0x486ee9=0xce;}_0x940a76['status'](_0x486ee9);return _0x940a76[_0xf0cf('0x1d')]('Content-Range',_0x1e5011+'-'+_0x17f2a4+'/'+_0x12fc03)[_0xf0cf('0x1a')](_0x25f1f2);}return null;};}function patchUpdates(_0x254d04){return function(_0x1ea1ad){try{jsonpatch[_0xf0cf('0x1e')](_0x1ea1ad,_0x254d04,!![]);}catch(_0x41a089){return BPromise[_0xf0cf('0x1f')](_0x41a089);}return _0x1ea1ad['save']();};}function saveUpdates(_0x1519d7,_0x5b76eb){return function(_0x898373){if(_0x898373){return _0x898373[_0xf0cf('0x20')](_0x1519d7)[_0xf0cf('0x21')](function(_0x31adc1){return _0x31adc1;});}return null;};}function removeEntity(_0x2234c5,_0x98c667){return function(_0x13c9c9){if(_0x13c9c9){return _0x13c9c9[_0xf0cf('0x22')]()[_0xf0cf('0x21')](function(){_0x2234c5[_0xf0cf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebbce,_0x9e600){return function(_0x23e8c8){if(!_0x23e8c8){_0x1ebbce['sendStatus'](0x194);}return _0x23e8c8;};}function handleError(_0x1d3d3e,_0x1a647d){_0x1a647d=_0x1a647d||0x1f4;return function(_0x106861){logger[_0xf0cf('0x23')](_0x106861['stack']);if(_0x106861[_0xf0cf('0x24')]){delete _0x106861['name'];}_0x1d3d3e[_0xf0cf('0x18')](_0x1a647d)[_0xf0cf('0x25')](_0x106861);};}exports[_0xf0cf('0x26')]=function(_0x47c844,_0x4aaadb){var _0x2f4ff1={},_0x194421={},_0x374ae1={'count':0x0,'rows':[]};var _0x5a1f44=db[_0xf0cf('0x27')][_0xf0cf('0x28')];_0x194421['model']=_[_0xf0cf('0x29')](_0x5a1f44);_0x194421[_0xf0cf('0x2a')]=_[_0xf0cf('0x29')](_0x47c844[_0xf0cf('0x2a')]);_0x194421[_0xf0cf('0x2b')]=_['intersection'](_0x194421['model'],_0x194421[_0xf0cf('0x2a')]);_0x2f4ff1['attributes']=_[_0xf0cf('0x2c')](_0x194421[_0xf0cf('0x2d')],qs[_0xf0cf('0x2e')](_0x47c844[_0xf0cf('0x2a')]['fields']));_0x2f4ff1[_0xf0cf('0x2f')]=_0x2f4ff1[_0xf0cf('0x2f')]['length']?_0x2f4ff1[_0xf0cf('0x2f')]:_0x194421['model'];if(!_0x47c844[_0xf0cf('0x2a')]['hasOwnProperty'](_0xf0cf('0x30'))){_0x2f4ff1[_0xf0cf('0x1c')]=qs[_0xf0cf('0x1c')](_0x47c844[_0xf0cf('0x2a')][_0xf0cf('0x1c')]);_0x2f4ff1[_0xf0cf('0x1b')]=qs[_0xf0cf('0x1b')](_0x47c844[_0xf0cf('0x2a')]['offset']);}_0x2f4ff1[_0xf0cf('0x31')]=qs[_0xf0cf('0x32')](_0x47c844['query']['sort']);_0x2f4ff1[_0xf0cf('0x33')]=qs[_0xf0cf('0x2b')](_['pick'](_0x47c844[_0xf0cf('0x2a')],_0x194421['filters']));if(_0x47c844[_0xf0cf('0x2a')]['filter']){_0x2f4ff1[_0xf0cf('0x33')]=_[_0xf0cf('0x34')](_0x2f4ff1[_0xf0cf('0x33')],{'$or':_[_0xf0cf('0x35')](_0x5a1f44,function(_0x280a5d){if(_0x280a5d[_0xf0cf('0x36')][_0xf0cf('0x37')]!==_0xf0cf('0x38')){var _0x38c657={};_0x38c657[_0x280a5d['field']]={'$like':'%'+_0x47c844[_0xf0cf('0x2a')]['filter']+'%'};return _0x38c657;}})});}_0x2f4ff1=_[_0xf0cf('0x34')]({},_0x2f4ff1,_0x47c844[_0xf0cf('0x39')]);var _0x584111={'where':_0x2f4ff1[_0xf0cf('0x33')]};return db[_0xf0cf('0x27')][_0xf0cf('0x3a')](_0x584111)['then'](function(_0x463420){_0x374ae1[_0xf0cf('0x3a')]=_0x463420;if(_0x47c844[_0xf0cf('0x2a')][_0xf0cf('0x3b')]){_0x2f4ff1[_0xf0cf('0x3c')]=[{'all':!![]}];}return db[_0xf0cf('0x27')][_0xf0cf('0x3d')](_0x2f4ff1);})[_0xf0cf('0x21')](function(_0x2bd352){_0x374ae1[_0xf0cf('0x3e')]=_0x2bd352;return _0x374ae1;})[_0xf0cf('0x21')](respondWithFilteredResult(_0x4aaadb,_0x2f4ff1))[_0xf0cf('0x3f')](handleError(_0x4aaadb,null));};exports[_0xf0cf('0x40')]=function(_0x36ea87,_0x4b993f){var _0x389c59={'raw':!![],'where':{'id':_0x36ea87[_0xf0cf('0x41')]['id']}},_0x2e97a4={};_0x2e97a4['model']=_['keys'](db[_0xf0cf('0x27')][_0xf0cf('0x28')]);_0x2e97a4[_0xf0cf('0x2a')]=_[_0xf0cf('0x29')](_0x36ea87['query']);_0x2e97a4['filters']=_['intersection'](_0x2e97a4[_0xf0cf('0x2d')],_0x2e97a4[_0xf0cf('0x2a')]);_0x389c59[_0xf0cf('0x2f')]=_[_0xf0cf('0x2c')](_0x2e97a4['model'],qs[_0xf0cf('0x2e')](_0x36ea87[_0xf0cf('0x2a')][_0xf0cf('0x2e')]));_0x389c59[_0xf0cf('0x2f')]=_0x389c59[_0xf0cf('0x2f')][_0xf0cf('0x42')]?_0x389c59[_0xf0cf('0x2f')]:_0x2e97a4[_0xf0cf('0x2d')];if(_0x36ea87[_0xf0cf('0x2a')]['includeAll']){_0x389c59[_0xf0cf('0x3c')]=[{'all':!![]}];}_0x389c59=_[_0xf0cf('0x34')]({},_0x389c59,_0x36ea87[_0xf0cf('0x39')]);return db['Dynamics365Field'][_0xf0cf('0x43')](_0x389c59)[_0xf0cf('0x21')](handleEntityNotFound(_0x4b993f,null))['then'](respondWithResult(_0x4b993f,null))[_0xf0cf('0x3f')](handleError(_0x4b993f,null));};exports[_0xf0cf('0x44')]=function(_0x54bbd6,_0x35b257){return db[_0xf0cf('0x27')]['create'](_0x54bbd6['body'],{})[_0xf0cf('0x21')](respondWithResult(_0x35b257,0xc9))[_0xf0cf('0x3f')](handleError(_0x35b257,null));};exports['update']=function(_0x2bd963,_0x2e5976){if(_0x2bd963[_0xf0cf('0x45')]['id']){delete _0x2bd963[_0xf0cf('0x45')]['id'];}return db[_0xf0cf('0x27')][_0xf0cf('0x43')]({'where':{'id':_0x2bd963[_0xf0cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e5976,null))[_0xf0cf('0x21')](saveUpdates(_0x2bd963[_0xf0cf('0x45')],null))['then'](respondWithResult(_0x2e5976,null))[_0xf0cf('0x3f')](handleError(_0x2e5976,null));};exports['destroy']=function(_0x2a0a05,_0x986713){return db[_0xf0cf('0x27')][_0xf0cf('0x43')]({'where':{'id':_0x2a0a05[_0xf0cf('0x41')]['id']}})[_0xf0cf('0x21')](handleEntityNotFound(_0x986713,null))[_0xf0cf('0x21')](removeEntity(_0x986713,null))[_0xf0cf('0x3f')](handleError(_0x986713,null));}; \ No newline at end of file +var _0x3dc3=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','error','stack','name','send','Dynamics365Field','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','include','findAll','rows','params','includeAll','catch','create','body','find','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x3dc3,0x76));var _0x33dc=function(_0x2a6015,_0x4d4716){_0x2a6015=_0x2a6015-0x0;var _0x27bc1f=_0x3dc3[_0x2a6015];return _0x27bc1f;};'use strict';var pdf=require(_0x33dc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x33dc('0x1'));var zipdir=require(_0x33dc('0x2'));var jsonpatch=require(_0x33dc('0x3'));var rp=require(_0x33dc('0x4'));var moment=require(_0x33dc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x33dc('0x6'));var path=require(_0x33dc('0x7'));var sox=require(_0x33dc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x33dc('0x9'));var squel=require('squel');var crypto=require(_0x33dc('0xa'));var jsforce=require(_0x33dc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33dc('0xc'));var Papa=require(_0x33dc('0xd'));var Redis=require(_0x33dc('0xe'));var authService=require(_0x33dc('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x33dc('0x10'));var logger=require(_0x33dc('0x11'))('api');var utils=require(_0x33dc('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x148558,_0x51911b){_0x51911b=_0x51911b||0xcc;return function(_0xca615f){if(_0xca615f){return _0x148558[_0x33dc('0x13')](_0x51911b);}return _0x148558[_0x33dc('0x14')](_0x51911b)[_0x33dc('0x15')]();};}function respondWithResult(_0x524b72,_0x1f65e6){_0x1f65e6=_0x1f65e6||0xc8;return function(_0x158ed2){if(_0x158ed2){return _0x524b72['status'](_0x1f65e6)['json'](_0x158ed2);}};}function respondWithFilteredResult(_0x355cba,_0x2a1443){return function(_0x284d4d){if(_0x284d4d){var _0x19916c=_0x284d4d[_0x33dc('0x16')],_0x5e8820=_0x2a1443[_0x33dc('0x17')],_0x4c9f46=_0x2a1443[_0x33dc('0x17')]+_0x2a1443[_0x33dc('0x18')],_0x2f60bf;if(_0x4c9f46>=_0x19916c){_0x4c9f46=_0x19916c;_0x2f60bf=0xc8;}else{_0x2f60bf=0xce;}_0x355cba['status'](_0x2f60bf);return _0x355cba[_0x33dc('0x19')]('Content-Range',_0x5e8820+'-'+_0x4c9f46+'/'+_0x19916c)[_0x33dc('0x1a')](_0x284d4d);}return null;};}function patchUpdates(_0x2b1568){return function(_0x967565){try{jsonpatch[_0x33dc('0x1b')](_0x967565,_0x2b1568,!![]);}catch(_0x214339){return BPromise[_0x33dc('0x1c')](_0x214339);}return _0x967565[_0x33dc('0x1d')]();};}function saveUpdates(_0x2de3ee,_0x5b9019){return function(_0x3c252f){if(_0x3c252f){return _0x3c252f[_0x33dc('0x1e')](_0x2de3ee)[_0x33dc('0x1f')](function(_0x5d3eda){return _0x5d3eda;});}return null;};}function removeEntity(_0xdc929f,_0x2cbc1d){return function(_0x2daec4){if(_0x2daec4){return _0x2daec4['destroy']()['then'](function(){_0xdc929f[_0x33dc('0x14')](0xcc)[_0x33dc('0x15')]();});}};}function handleEntityNotFound(_0x32202f,_0x552f4e){return function(_0x5ea3af){if(!_0x5ea3af){_0x32202f[_0x33dc('0x13')](0x194);}return _0x5ea3af;};}function handleError(_0x5b238b,_0x19ff18){_0x19ff18=_0x19ff18||0x1f4;return function(_0x2ac8e1){logger[_0x33dc('0x20')](_0x2ac8e1[_0x33dc('0x21')]);if(_0x2ac8e1[_0x33dc('0x22')]){delete _0x2ac8e1[_0x33dc('0x22')];}_0x5b238b[_0x33dc('0x14')](_0x19ff18)[_0x33dc('0x23')](_0x2ac8e1);};}exports['index']=function(_0x184bbe,_0xce782d){var _0xf9a4e7={},_0xe1d92b={},_0x3d3d1c={'count':0x0,'rows':[]};var _0x3e1f31=db[_0x33dc('0x24')][_0x33dc('0x25')];_0xe1d92b[_0x33dc('0x26')]=_[_0x33dc('0x27')](_0x3e1f31);_0xe1d92b[_0x33dc('0x28')]=_[_0x33dc('0x27')](_0x184bbe[_0x33dc('0x28')]);_0xe1d92b[_0x33dc('0x29')]=_[_0x33dc('0x2a')](_0xe1d92b[_0x33dc('0x26')],_0xe1d92b[_0x33dc('0x28')]);_0xf9a4e7['attributes']=_[_0x33dc('0x2a')](_0xe1d92b[_0x33dc('0x26')],qs['fields'](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x2b')]));_0xf9a4e7[_0x33dc('0x2c')]=_0xf9a4e7['attributes'][_0x33dc('0x2d')]?_0xf9a4e7[_0x33dc('0x2c')]:_0xe1d92b[_0x33dc('0x26')];if(!_0x184bbe[_0x33dc('0x28')]['hasOwnProperty'](_0x33dc('0x2e'))){_0xf9a4e7[_0x33dc('0x18')]=qs['limit'](_0x184bbe['query']['limit']);_0xf9a4e7[_0x33dc('0x17')]=qs[_0x33dc('0x17')](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x17')]);}_0xf9a4e7[_0x33dc('0x2f')]=qs[_0x33dc('0x30')](_0x184bbe[_0x33dc('0x28')][_0x33dc('0x30')]);_0xf9a4e7[_0x33dc('0x31')]=qs[_0x33dc('0x29')](_['pick'](_0x184bbe[_0x33dc('0x28')],_0xe1d92b[_0x33dc('0x29')]));if(_0x184bbe[_0x33dc('0x28')][_0x33dc('0x32')]){_0xf9a4e7[_0x33dc('0x31')]=_[_0x33dc('0x33')](_0xf9a4e7[_0x33dc('0x31')],{'$or':_['map'](_0x3e1f31,function(_0x6823d1){if(_0x6823d1[_0x33dc('0x34')][_0x33dc('0x35')]!==_0x33dc('0x36')){var _0x1c4864={};_0x1c4864[_0x6823d1[_0x33dc('0x37')]]={'$like':'%'+_0x184bbe['query'][_0x33dc('0x32')]+'%'};return _0x1c4864;}})});}_0xf9a4e7=_[_0x33dc('0x33')]({},_0xf9a4e7,_0x184bbe['options']);var _0x10e5c2={'where':_0xf9a4e7['where']};return db[_0x33dc('0x24')][_0x33dc('0x16')](_0x10e5c2)[_0x33dc('0x1f')](function(_0x2ff4ae){_0x3d3d1c[_0x33dc('0x16')]=_0x2ff4ae;if(_0x184bbe[_0x33dc('0x28')]['includeAll']){_0xf9a4e7[_0x33dc('0x38')]=[{'all':!![]}];}return db[_0x33dc('0x24')][_0x33dc('0x39')](_0xf9a4e7);})[_0x33dc('0x1f')](function(_0x324983){_0x3d3d1c[_0x33dc('0x3a')]=_0x324983;return _0x3d3d1c;})[_0x33dc('0x1f')](respondWithFilteredResult(_0xce782d,_0xf9a4e7))['catch'](handleError(_0xce782d,null));};exports['show']=function(_0x14a052,_0x2b83d9){var _0x4d9f9a={'raw':!![],'where':{'id':_0x14a052[_0x33dc('0x3b')]['id']}},_0x541197={};_0x541197[_0x33dc('0x26')]=_[_0x33dc('0x27')](db['Dynamics365Field'][_0x33dc('0x25')]);_0x541197[_0x33dc('0x28')]=_[_0x33dc('0x27')](_0x14a052['query']);_0x541197[_0x33dc('0x29')]=_['intersection'](_0x541197[_0x33dc('0x26')],_0x541197[_0x33dc('0x28')]);_0x4d9f9a[_0x33dc('0x2c')]=_['intersection'](_0x541197['model'],qs['fields'](_0x14a052[_0x33dc('0x28')][_0x33dc('0x2b')]));_0x4d9f9a[_0x33dc('0x2c')]=_0x4d9f9a[_0x33dc('0x2c')][_0x33dc('0x2d')]?_0x4d9f9a[_0x33dc('0x2c')]:_0x541197['model'];if(_0x14a052[_0x33dc('0x28')][_0x33dc('0x3c')]){_0x4d9f9a[_0x33dc('0x38')]=[{'all':!![]}];}_0x4d9f9a=_[_0x33dc('0x33')]({},_0x4d9f9a,_0x14a052['options']);return db['Dynamics365Field']['find'](_0x4d9f9a)['then'](handleEntityNotFound(_0x2b83d9,null))[_0x33dc('0x1f')](respondWithResult(_0x2b83d9,null))[_0x33dc('0x3d')](handleError(_0x2b83d9,null));};exports[_0x33dc('0x3e')]=function(_0x2eb6b9,_0x58c980){return db['Dynamics365Field'][_0x33dc('0x3e')](_0x2eb6b9[_0x33dc('0x3f')],{})[_0x33dc('0x1f')](respondWithResult(_0x58c980,0xc9))[_0x33dc('0x3d')](handleError(_0x58c980,null));};exports['update']=function(_0x4312c3,_0x497989){if(_0x4312c3[_0x33dc('0x3f')]['id']){delete _0x4312c3[_0x33dc('0x3f')]['id'];}return db[_0x33dc('0x24')][_0x33dc('0x40')]({'where':{'id':_0x4312c3[_0x33dc('0x3b')]['id']}})[_0x33dc('0x1f')](handleEntityNotFound(_0x497989,null))[_0x33dc('0x1f')](saveUpdates(_0x4312c3['body'],null))[_0x33dc('0x1f')](respondWithResult(_0x497989,null))[_0x33dc('0x3d')](handleError(_0x497989,null));};exports[_0x33dc('0x41')]=function(_0x45b855,_0x171118){return db[_0x33dc('0x24')][_0x33dc('0x40')]({'where':{'id':_0x45b855[_0x33dc('0x3b')]['id']}})[_0x33dc('0x1f')](handleEntityNotFound(_0x171118,null))[_0x33dc('0x1f')](removeEntity(_0x171118,null))['catch'](handleError(_0x171118,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 963d160..7c0000c 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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x1e38d4,_0x22388f){var _0x322b36=function(_0x4c3ecb){while(--_0x4c3ecb){_0x1e38d4['push'](_0x1e38d4['shift']());}};_0x322b36(++_0x22388f);}(_0x7a54,0x106));var _0x47a5=function(_0x1c2269,_0x199bfc){_0x1c2269=_0x1c2269-0x0;var _0x5c4482=_0x7a54[_0x1c2269];return _0x5c4482;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x6dbd4c,_0x46aa71){var _0x5a7048=function(_0x5842dc){while(--_0x5842dc){_0x6dbd4c['push'](_0x6dbd4c['shift']());}};_0x5a7048(++_0x46aa71);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd721,_0x372b31){_0x1fd721=_0x1fd721-0x0;var _0x44d9e9=_0x7a54[_0x1fd721];return _0x44d9e9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 d82a799..a1e7fcd 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 _0xef7e=['http','request','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xef7e,0x194));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeef7('0x0'));var util=require('util');var moment=require(_0xeef7('0x1'));var BPromise=require(_0xeef7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeef7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeef7('0x4'));var logger=require(_0xeef7('0x5'))(_0xeef7('0x6'));var config=require(_0xeef7('0x7'));var jayson=require(_0xeef7('0x8'));var client=jayson[_0xeef7('0x9')][_0xeef7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbe8730,_0x104b84,_0x1e3695){return new BPromise(function(_0xc41c2d,_0x1021d5){return client[_0xeef7('0xb')](_0xbe8730,_0x1e3695)[_0xeef7('0xc')](function(_0x39a6cb){logger[_0xeef7('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0xeef7('0xe'));logger['debug'](_0xeef7('0xf'),_0x104b84,_0xeef7('0xe'),JSON[_0xeef7('0x10')](_0x39a6cb));if(_0x39a6cb[_0xeef7('0x11')]){if(_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x12')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x13')]);return _0x1021d5(_0x39a6cb[_0xeef7('0x11')]['message']);}logger[_0xeef7('0x11')](_0xeef7('0x14'),_0x104b84,_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x13')]);return _0xc41c2d(_0x39a6cb['error'][_0xeef7('0x13')]);}else{logger[_0xeef7('0xd')](_0xeef7('0x14'),_0x104b84,'request\x20sent');_0xc41c2d(_0x39a6cb[_0xeef7('0x15')][_0xeef7('0x13')]);}})[_0xeef7('0x16')](function(_0x75cb6f){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0x75cb6f);_0x1021d5(_0x75cb6f);});});} \ No newline at end of file +var _0xf3aa=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x4ef0cb,_0x525e34){var _0x576e26=function(_0x275fd2){while(--_0x275fd2){_0x4ef0cb['push'](_0x4ef0cb['shift']());}};_0x576e26(++_0x525e34);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x1c288b,_0x377b72){_0x1c288b=_0x1c288b-0x0;var _0x5d9225=_0xf3aa[_0x1c288b];return _0x5d9225;};'use strict';var _=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var moment=require(_0xaf3a('0x2'));var BPromise=require(_0xaf3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf3a('0x5'))(_0xaf3a('0x6'));var config=require(_0xaf3a('0x7'));var jayson=require(_0xaf3a('0x8'));var client=jayson[_0xaf3a('0x9')][_0xaf3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb009f0,_0x135eda,_0x560ca4){return new BPromise(function(_0x4e5041,_0x3c304e){return client[_0xaf3a('0xb')](_0xb009f0,_0x560ca4)[_0xaf3a('0xc')](function(_0x499643){logger['info'](_0xaf3a('0xd'),_0x135eda,_0xaf3a('0xe'));logger[_0xaf3a('0xf')](_0xaf3a('0x10'),_0x135eda,_0xaf3a('0xe'),JSON['stringify'](_0x499643));if(_0x499643[_0xaf3a('0x11')]){if(_0x499643[_0xaf3a('0x11')]['code']===0x1f4){logger[_0xaf3a('0x11')](_0xaf3a('0xd'),_0x135eda,_0x499643[_0xaf3a('0x11')]['message']);return _0x3c304e(_0x499643[_0xaf3a('0x11')][_0xaf3a('0x12')]);}logger['error'](_0xaf3a('0xd'),_0x135eda,_0x499643['error']['message']);return _0x4e5041(_0x499643[_0xaf3a('0x11')][_0xaf3a('0x12')]);}else{logger['info'](_0xaf3a('0xd'),_0x135eda,_0xaf3a('0xe'));_0x4e5041(_0x499643['result'][_0xaf3a('0x12')]);}})[_0xaf3a('0x13')](function(_0x2505ec){logger[_0xaf3a('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x135eda,_0x2505ec);_0x3c304e(_0x2505ec);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index bcbadc7..deab2e6 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 _0x8f60=['index','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x5e0fcd,_0x2a6202){var _0x8e934e=function(_0xab6615){while(--_0xab6615){_0x5e0fcd['push'](_0x5e0fcd['shift']());}};_0x8e934e(++_0x2a6202);}(_0x8f60,0x199));var _0x08f6=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x8f60[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require(_0x08f6('0x0'));var util=require('util');var path=require(_0x08f6('0x1'));var timeout=require(_0x08f6('0x2'));var express=require(_0x08f6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x08f6('0x4'));var config=require(_0x08f6('0x5'));var controller=require(_0x08f6('0x6'));router[_0x08f6('0x7')]('/',auth[_0x08f6('0x8')](),controller[_0x08f6('0x9')]);router['get']('/:id',auth[_0x08f6('0x8')](),controller[_0x08f6('0xa')]);router[_0x08f6('0x7')](_0x08f6('0xb'),auth[_0x08f6('0x8')](),controller[_0x08f6('0xc')]);router[_0x08f6('0x7')](_0x08f6('0xd'),auth[_0x08f6('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x08f6('0xe')]);router[_0x08f6('0xf')](_0x08f6('0xb'),auth['isAuthenticated'](),controller[_0x08f6('0x10')]);router['put'](_0x08f6('0x11'),auth[_0x08f6('0x8')](),controller[_0x08f6('0x12')]);router[_0x08f6('0x13')](_0x08f6('0x11'),auth['isAuthenticated'](),controller[_0x08f6('0x14')]);module[_0x08f6('0x15')]=router; \ No newline at end of file +var _0xfb8e=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x456ccb,_0x36a51a){var _0x1f9a0b=function(_0x51c972){while(--_0x51c972){_0x456ccb['push'](_0x456ccb['shift']());}};_0x1f9a0b(++_0x36a51a);}(_0xfb8e,0xfe));var _0xefb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb8e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xefb8('0x0'));var path=require(_0xefb8('0x1'));var timeout=require(_0xefb8('0x2'));var express=require(_0xefb8('0x3'));var router=express[_0xefb8('0x4')]();var auth=require(_0xefb8('0x5'));var interaction=require(_0xefb8('0x6'));var config=require(_0xefb8('0x7'));var controller=require(_0xefb8('0x8'));router['get']('/',auth[_0xefb8('0x9')](),controller['index']);router[_0xefb8('0xa')](_0xefb8('0xb'),auth[_0xefb8('0x9')](),controller[_0xefb8('0xc')]);router[_0xefb8('0xa')](_0xefb8('0xd'),auth[_0xefb8('0x9')](),controller[_0xefb8('0xe')]);router[_0xefb8('0xa')](_0xefb8('0xf'),auth['isAuthenticated'](),controller[_0xefb8('0x10')]);router[_0xefb8('0x11')]('/',auth[_0xefb8('0x9')](),controller[_0xefb8('0x12')]);router[_0xefb8('0x11')](_0xefb8('0xd'),auth[_0xefb8('0x9')](),controller[_0xefb8('0x13')]);router[_0xefb8('0x14')](_0xefb8('0xb'),auth[_0xefb8('0x9')](),controller[_0xefb8('0x15')]);router[_0xefb8('0x16')]('/:id',auth[_0xefb8('0x9')](),controller[_0xefb8('0x17')]);module[_0xefb8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 1675af6..7caa86b 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 _0x4165=['username','remoteUri','sequelize','exports','STRING'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x4165,0x1f1));var _0x5416=function(_0x59ffaf,_0x3b89db){_0x59ffaf=_0x59ffaf-0x0;var _0x5ab585=_0x4165[_0x59ffaf];return _0x5ab585;};'use strict';var Sequelize=require(_0x5416('0x0'));module[_0x5416('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5416('0x2')]},'username':{'type':Sequelize[_0x5416('0x2')],'unique':_0x5416('0x3')},'apiKey':{'type':Sequelize[_0x5416('0x2')]},'remoteUri':{'type':Sequelize[_0x5416('0x2')],'unique':_0x5416('0x4')},'serverUrl':{'type':Sequelize[_0x5416('0x2')]}}; \ No newline at end of file +var _0x6ff5=['exports','STRING','username','remoteUri'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ff5,0x1d0));var _0x56ff=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6ff5[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module[_0x56ff('0x0')]={'name':{'type':Sequelize[_0x56ff('0x1')]},'description':{'type':Sequelize[_0x56ff('0x1')]},'username':{'type':Sequelize[_0x56ff('0x1')],'unique':_0x56ff('0x2')},'apiKey':{'type':Sequelize[_0x56ff('0x1')]},'remoteUri':{'type':Sequelize[_0x56ff('0x1')],'unique':_0x56ff('0x3')},'serverUrl':{'type':Sequelize[_0x56ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0edc30f..0728eb0 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 _0xd481=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','save','update','stack','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','map','type','VIRTUAL','field','filter','count','includeAll','include','findAll','show','find','create','body','destroy','params','getConfigurations','findOne','FreshdeskConfiguration','length','order','pick','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','name','custom_text','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x24cdf2,_0x54ade2){var _0x323890=function(_0x274c73){while(--_0x274c73){_0x24cdf2['push'](_0x24cdf2['shift']());}};_0x323890(++_0x54ade2);}(_0xd481,0x1e4));var _0x1d48=function(_0x3ffca5,_0x99c86b){_0x3ffca5=_0x3ffca5-0x0;var _0x2bd0f3=_0xd481[_0x3ffca5];return _0x2bd0f3;};'use strict';var pdf=require(_0x1d48('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d48('0x1'));var zipdir=require(_0x1d48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d48('0x3'));var moment=require(_0x1d48('0x4'));var BPromise=require(_0x1d48('0x5'));var Mustache=require('mustache');var util=require(_0x1d48('0x6'));var path=require('path');var sox=require(_0x1d48('0x7'));var csv=require(_0x1d48('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d48('0x9'));var squel=require(_0x1d48('0xa'));var crypto=require(_0x1d48('0xb'));var jsforce=require(_0x1d48('0xc'));var deskjs=require(_0x1d48('0xd'));var toCsv=require(_0x1d48('0x8'));var querystring=require(_0x1d48('0xe'));var Papa=require(_0x1d48('0xf'));var Redis=require(_0x1d48('0x10'));var authService=require(_0x1d48('0x11'));var qs=require(_0x1d48('0x12'));var hardwareService=require(_0x1d48('0x13'));var logger=require('../../config/logger')(_0x1d48('0x14'));var utils=require(_0x1d48('0x15'));var config=require(_0x1d48('0x16'));var db=require(_0x1d48('0x17'))['db'];var integrations=require(_0x1d48('0x18'));var jayson=require(_0x1d48('0x19'));var client=jayson[_0x1d48('0x1a')][_0x1d48('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ac3e9,_0x2d84b1,_0x483b42){if(_0x483b42){var _0x3034d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3034d5['test'](_0x2d84b1)){return _0x2ac3e9;}else{throw new Error(_0x1d48('0x1c'));}}else{return _0x2ac3e9;}}function respondWithRpcPromise(_0x2ccc5e,_0x2b7f7c,_0x44db99,_0x4f9f04){return new BPromise(function(_0x1845bd,_0x2e2748){var _0x27fd35=_0x4f9f04||client;return _0x27fd35['request'](_0x2ccc5e,_0x44db99)[_0x1d48('0x1d')](function(_0x433c92){logger[_0x1d48('0x1e')](_0x1d48('0x1f'),_0x2b7f7c,_0x1d48('0x20'));logger[_0x1d48('0x21')](_0x1d48('0x22'),_0x2b7f7c,_0x1d48('0x20'),JSON[_0x1d48('0x23')](_0x433c92));if(_0x433c92['error']){if(_0x433c92['error'][_0x1d48('0x24')]===0x1f4){logger[_0x1d48('0x25')](_0x1d48('0x1f'),_0x2b7f7c,_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);return _0x2e2748(_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);}logger[_0x1d48('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x2b7f7c,_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);return _0x1845bd(_0x433c92['error']['message']);}else{logger[_0x1d48('0x1e')](_0x1d48('0x1f'),_0x2b7f7c,_0x1d48('0x20'));_0x1845bd(_0x433c92[_0x1d48('0x27')][_0x1d48('0x26')]);}})[_0x1d48('0x28')](function(_0xef15b5){logger[_0x1d48('0x25')](_0x1d48('0x1f'),_0x2b7f7c,_0xef15b5);_0x2e2748(_0xef15b5);});});}function respondWithStatusCode(_0x1382d8,_0x4be71e){_0x4be71e=_0x4be71e||0xcc;return function(_0x4e44eb){if(_0x4e44eb){return _0x1382d8[_0x1d48('0x29')](_0x4be71e);}return _0x1382d8[_0x1d48('0x2a')](_0x4be71e)[_0x1d48('0x2b')]();};}function respondWithResult(_0x2bf773,_0x228276){_0x228276=_0x228276||0xc8;return function(_0x7631b4){if(_0x7631b4){return _0x2bf773['status'](_0x228276)['json'](_0x7631b4);}};}function respondWithFilteredResult(_0x187b34,_0x280505){return function(_0x4d3f91){if(_0x4d3f91){var _0x33f9dd=_0x4d3f91['count'],_0x368c5f=_0x280505[_0x1d48('0x2c')],_0xb4d9c7=_0x280505[_0x1d48('0x2c')]+_0x280505[_0x1d48('0x2d')],_0xccc388;if(_0xb4d9c7>=_0x33f9dd){_0xb4d9c7=_0x33f9dd;_0xccc388=0xc8;}else{_0xccc388=0xce;}_0x187b34[_0x1d48('0x2a')](_0xccc388);return _0x187b34[_0x1d48('0x2e')]('Content-Range',_0x368c5f+'-'+_0xb4d9c7+'/'+_0x33f9dd)[_0x1d48('0x2f')](_0x4d3f91);}return null;};}function patchUpdates(_0x3dee70){return function(_0x41e050){try{jsonpatch[_0x1d48('0x30')](_0x41e050,_0x3dee70,!![]);}catch(_0x3cae45){return BPromise['reject'](_0x3cae45);}return _0x41e050[_0x1d48('0x31')]();};}function saveUpdates(_0xa3b0ed,_0x2fb984){return function(_0x4cfc41){if(_0x4cfc41){return _0x4cfc41[_0x1d48('0x32')](_0xa3b0ed)['then'](function(_0x5a2670){return _0x5a2670;});}return null;};}function removeEntity(_0x3abd42,_0x1ed3f5){return function(_0x2c4527){if(_0x2c4527){return _0x2c4527['destroy']()[_0x1d48('0x1d')](function(){_0x3abd42[_0x1d48('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2648d8,_0x2e77d5){return function(_0x189a89){if(!_0x189a89){_0x2648d8['sendStatus'](0x194);}return _0x189a89;};}function handleError(_0x3c6e09,_0x51093f){_0x51093f=_0x51093f||0x1f4;return function(_0x3e434c){logger[_0x1d48('0x25')](_0x3e434c[_0x1d48('0x33')]);if(_0x3e434c['name']){delete _0x3e434c['name'];}_0x3c6e09[_0x1d48('0x2a')](_0x51093f)[_0x1d48('0x34')](_0x3e434c);};}exports[_0x1d48('0x35')]=function(_0x438a0d,_0x292483){var _0x16493d={},_0x1df1e9={},_0x2476fe={'count':0x0,'rows':[]};var _0x216438=db[_0x1d48('0x36')][_0x1d48('0x37')];_0x1df1e9[_0x1d48('0x38')]=_[_0x1d48('0x39')](_0x216438);_0x1df1e9[_0x1d48('0x3a')]=_[_0x1d48('0x39')](_0x438a0d[_0x1d48('0x3a')]);_0x1df1e9[_0x1d48('0x3b')]=_[_0x1d48('0x3c')](_0x1df1e9[_0x1d48('0x38')],_0x1df1e9[_0x1d48('0x3a')]);_0x16493d[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x1df1e9[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x3e')]));_0x16493d[_0x1d48('0x3d')]=_0x16493d[_0x1d48('0x3d')]['length']?_0x16493d[_0x1d48('0x3d')]:_0x1df1e9['model'];if(!_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x3f')]('nolimit')){_0x16493d[_0x1d48('0x2d')]=qs[_0x1d48('0x2d')](_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x2d')]);_0x16493d[_0x1d48('0x2c')]=qs[_0x1d48('0x2c')](_0x438a0d['query']['offset']);}_0x16493d['order']=qs[_0x1d48('0x40')](_0x438a0d[_0x1d48('0x3a')]['sort']);_0x16493d[_0x1d48('0x41')]=qs[_0x1d48('0x3b')](_['pick'](_0x438a0d[_0x1d48('0x3a')],_0x1df1e9[_0x1d48('0x3b')]));if(_0x438a0d[_0x1d48('0x3a')]['filter']){_0x16493d['where']=_[_0x1d48('0x42')](_0x16493d[_0x1d48('0x41')],{'$or':_[_0x1d48('0x43')](_0x216438,function(_0x56971c){if(_0x56971c[_0x1d48('0x44')]['key']!==_0x1d48('0x45')){var _0xf849e4={};_0xf849e4[_0x56971c[_0x1d48('0x46')]]={'$like':'%'+_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x47')]+'%'};return _0xf849e4;}})});}_0x16493d=_[_0x1d48('0x42')]({},_0x16493d,_0x438a0d['options']);var _0x146111={'where':_0x16493d[_0x1d48('0x41')]};return db[_0x1d48('0x36')][_0x1d48('0x48')](_0x146111)[_0x1d48('0x1d')](function(_0x37bdbe){_0x2476fe[_0x1d48('0x48')]=_0x37bdbe;if(_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x49')]){_0x16493d[_0x1d48('0x4a')]=[{'all':!![]}];}return db[_0x1d48('0x36')][_0x1d48('0x4b')](_0x16493d);})['then'](function(_0x1e97c0){_0x2476fe['rows']=_0x1e97c0;return _0x2476fe;})[_0x1d48('0x1d')](respondWithFilteredResult(_0x292483,_0x16493d))[_0x1d48('0x28')](handleError(_0x292483,null));};exports[_0x1d48('0x4c')]=function(_0x484e4d,_0x53f2aa){var _0xf50046={'raw':![],'where':{'id':_0x484e4d['params']['id']}},_0x3e2420={};_0x3e2420[_0x1d48('0x38')]=_[_0x1d48('0x39')](db[_0x1d48('0x36')][_0x1d48('0x37')]);_0x3e2420[_0x1d48('0x3a')]=_[_0x1d48('0x39')](_0x484e4d['query']);_0x3e2420[_0x1d48('0x3b')]=_[_0x1d48('0x3c')](_0x3e2420[_0x1d48('0x38')],_0x3e2420['query']);_0xf50046[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x3e2420[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x484e4d[_0x1d48('0x3a')][_0x1d48('0x3e')]));_0xf50046[_0x1d48('0x3d')]=_0xf50046['attributes']['length']?_0xf50046[_0x1d48('0x3d')]:_0x3e2420[_0x1d48('0x38')];if(_0x484e4d[_0x1d48('0x3a')]['includeAll']){_0xf50046['include']=[{'all':!![]}];}_0xf50046=_['merge']({},_0xf50046,_0x484e4d['options']);return db[_0x1d48('0x36')][_0x1d48('0x4d')](_0xf50046)[_0x1d48('0x1d')](handleEntityNotFound(_0x53f2aa,null))[_0x1d48('0x1d')](respondWithResult(_0x53f2aa,null))[_0x1d48('0x28')](handleError(_0x53f2aa,null));};exports[_0x1d48('0x4e')]=function(_0x1a1405,_0x2dd61e){return db[_0x1d48('0x36')][_0x1d48('0x4e')](_0x1a1405[_0x1d48('0x4f')],{})[_0x1d48('0x1d')](respondWithResult(_0x2dd61e,0xc9))[_0x1d48('0x28')](handleError(_0x2dd61e,null));};exports['update']=function(_0x51af4a,_0xea6d8c){if(_0x51af4a['body']['id']){delete _0x51af4a['body']['id'];}return db['FreshdeskAccount'][_0x1d48('0x4d')]({'where':{'id':_0x51af4a['params']['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0xea6d8c,null))[_0x1d48('0x1d')](saveUpdates(_0x51af4a[_0x1d48('0x4f')],null))[_0x1d48('0x1d')](respondWithResult(_0xea6d8c,null))[_0x1d48('0x28')](handleError(_0xea6d8c,null));};exports[_0x1d48('0x50')]=function(_0xb5da33,_0x599b20){return db[_0x1d48('0x36')][_0x1d48('0x4d')]({'where':{'id':_0xb5da33[_0x1d48('0x51')]['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0x599b20,null))[_0x1d48('0x1d')](removeEntity(_0x599b20,null))[_0x1d48('0x28')](handleError(_0x599b20,null));};exports[_0x1d48('0x52')]=function(_0x55e0f5,_0x3937a3,_0x55a4ec){var _0x9bd2d6={};var _0x5dc8a2={};var _0x3feb0c;var _0x5504ed;return db[_0x1d48('0x36')][_0x1d48('0x53')]({'where':{'id':_0x55e0f5[_0x1d48('0x51')]['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0x3937a3,null))[_0x1d48('0x1d')](function(_0x3204eb){if(_0x3204eb){_0x3feb0c=_0x3204eb;_0x5dc8a2[_0x1d48('0x38')]=_[_0x1d48('0x39')](db[_0x1d48('0x54')][_0x1d48('0x37')]);_0x5dc8a2[_0x1d48('0x3a')]=_['keys'](_0x55e0f5[_0x1d48('0x3a')]);_0x5dc8a2[_0x1d48('0x3b')]=_['intersection'](_0x5dc8a2['model'],_0x5dc8a2['query']);_0x9bd2d6[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x5dc8a2[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x55e0f5['query']['fields']));_0x9bd2d6[_0x1d48('0x3d')]=_0x9bd2d6['attributes'][_0x1d48('0x55')]?_0x9bd2d6[_0x1d48('0x3d')]:_0x5dc8a2[_0x1d48('0x38')];_0x9bd2d6[_0x1d48('0x56')]=qs[_0x1d48('0x40')](_0x55e0f5[_0x1d48('0x3a')]['sort']);_0x9bd2d6[_0x1d48('0x41')]=qs[_0x1d48('0x3b')](_[_0x1d48('0x57')](_0x55e0f5[_0x1d48('0x3a')],_0x5dc8a2['filters']));if(_0x55e0f5['query']['filter']){_0x9bd2d6[_0x1d48('0x41')]=_['merge'](_0x9bd2d6[_0x1d48('0x41')],{'$or':_[_0x1d48('0x43')](_0x9bd2d6[_0x1d48('0x3d')],function(_0x308042){var _0x3447fa={};_0x3447fa[_0x308042]={'$like':'%'+_0x55e0f5['query'][_0x1d48('0x47')]+'%'};return _0x3447fa;})});}_0x9bd2d6=_[_0x1d48('0x42')]({},_0x9bd2d6,_0x55e0f5['options']);return _0x3feb0c[_0x1d48('0x52')](_0x9bd2d6);}})[_0x1d48('0x1d')](function(_0x567ed3){if(_0x567ed3){_0x5504ed=_0x567ed3[_0x1d48('0x55')];if(!_0x55e0f5[_0x1d48('0x3a')]['hasOwnProperty'](_0x1d48('0x58'))){_0x9bd2d6[_0x1d48('0x2d')]=qs[_0x1d48('0x2d')](_0x55e0f5['query']['limit']);_0x9bd2d6['offset']=qs['offset'](_0x55e0f5[_0x1d48('0x3a')][_0x1d48('0x2c')]);}return _0x3feb0c[_0x1d48('0x52')](_0x9bd2d6);}})[_0x1d48('0x1d')](function(_0x3fe0f4){if(_0x3fe0f4){return _0x3fe0f4?{'count':_0x5504ed,'rows':_0x3fe0f4}:null;}})['then'](respondWithResult(_0x3937a3,null))[_0x1d48('0x28')](handleError(_0x3937a3,null));};exports['addConfiguration']=function(_0x47e6ea,_0x3da820,_0x7c8284){if(_0x47e6ea[_0x1d48('0x4f')]['id']){delete _0x47e6ea[_0x1d48('0x4f')]['id'];}return db[_0x1d48('0x36')]['findOne']({'where':{'id':_0x47e6ea[_0x1d48('0x51')]['id']}})['then'](handleEntityNotFound(_0x3da820,null))[_0x1d48('0x1d')](function(_0x4cb827){if(_0x4cb827){_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x59')]=_0x4cb827['id'];_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x5a')]=integrations[_0x1d48('0x5b')](_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x5c')],_0x47e6ea[_0x1d48('0x4f')]['type']);_0x47e6ea[_0x1d48('0x4f')]['Descriptions']=integrations[_0x1d48('0x5d')](_0x47e6ea['body'][_0x1d48('0x5c')],_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x44')]);return db['FreshdeskConfiguration'][_0x1d48('0x4e')](_0x47e6ea[_0x1d48('0x4f')],{'include':[{'model':db[_0x1d48('0x5e')],'as':_0x1d48('0x5a')},{'model':db[_0x1d48('0x5e')],'as':_0x1d48('0x5f')}]});}return null;})[_0x1d48('0x1d')](respondWithResult(_0x3da820,null))[_0x1d48('0x28')](handleError(_0x3da820,null));};exports[_0x1d48('0x60')]=function(_0x19617e,_0x3c61f5,_0x4b9d35){var _0x2f33aa='';return db[_0x1d48('0x36')]['findOne']({'where':{'id':_0x19617e[_0x1d48('0x51')]['id']},'attributes':['id',_0x1d48('0x61'),_0x1d48('0x62')]})[_0x1d48('0x1d')](handleEntityNotFound(_0x3c61f5,null))[_0x1d48('0x1d')](function(_0x217485){if(_0x217485){_0x2f33aa=_0x217485[_0x1d48('0x61')];var _0x1d809d=_0x2f33aa[_0x1d48('0x63')](-0x1);if(_0x1d809d==='/'){_0x2f33aa=_0x2f33aa[_0x1d48('0x64')](0x0,_0x2f33aa[_0x1d48('0x65')](_0x1d809d));}return rp({'method':_0x1d48('0x66'),'uri':util[_0x1d48('0x67')](_0x1d48('0x68'),_0x2f33aa,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1d48('0x67')](_0x1d48('0x69'),new Buffer(util[_0x1d48('0x67')](_0x1d48('0x6a'),_0x217485[_0x1d48('0x62')]))[_0x1d48('0x6b')](_0x1d48('0x6c')))},'json':!![]});}})['then'](function(_0x12fd32){if(_0x12fd32){var _0x4e81ce=[_0x1d48('0x6d'),_0x1d48('0x6e'),_0x1d48('0x6f'),_0x1d48('0x70'),_0x1d48('0x2a'),_0x1d48('0x71'),'group',_0x1d48('0x72'),_0x1d48('0x73'),_0x1d48('0x74'),_0x1d48('0x75')];_['remove'](_0x12fd32,function(_0x1dd2cc){return _0x4e81ce[_0x1d48('0x76')](_0x1dd2cc[_0x1d48('0x77')])||!_0x1dd2cc['default']&&_0x1dd2cc[_0x1d48('0x44')]!==_0x1d48('0x78')&&_0x1dd2cc[_0x1d48('0x44')]!=='custom_dropdown';});return{'count':_0x12fd32[_0x1d48('0x55')],'rows':_[_0x1d48('0x43')](_0x12fd32,function(_0x1f1f65){return{'id':_0x1f1f65['name'],'name':_0x1f1f65[_0x1d48('0x79')],'custom':!_0x1f1f65[_0x1d48('0x7a')],'options':_0x1f1f65['choices']?_['map'](_0x1f1f65[_0x1d48('0x7b')],function(_0x115fb8){return{'name':_[_0x1d48('0x7c')](_0x115fb8),'value':_0x115fb8};}):[]};})};}})[_0x1d48('0x1d')](respondWithResult(_0x3c61f5,null))[_0x1d48('0x28')](function(_0x7300b4){var _0x3eacbd=_0x19617e['query'][_0x1d48('0x7d')]?0x1f4:_0x7300b4['statusCode']||0x1f4;logger[_0x1d48('0x25')](_0x1d48('0x7e'),_0x1d48('0x60'),_0x3eacbd,JSON['stringify'](_0x7300b4));delete _0x7300b4[_0x1d48('0x77')];if(_0x3eacbd===0x191){_0x3eacbd=0x190;}_0x3c61f5[_0x1d48('0x2a')](_0x3eacbd)[_0x1d48('0x34')](_0x19617e['query'][_0x1d48('0x7d')]?{'message':_0x1d48('0x7f'),'statusCode':_0x7300b4[_0x1d48('0x80')]}:_0x7300b4);});}; \ No newline at end of file +var _0xedf1=['includeAll','include','findAll','rows','show','params','length','find','create','body','update','map','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','findOne','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','format','Basic\x20%s','%s:X','toString','base64','subject','agent','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xedf1,0xb2));var _0x1edf=function(_0xae01de,_0x15e954){_0xae01de=_0xae01de-0x0;var _0x44a581=_0xedf1[_0xae01de];return _0x44a581;};'use strict';var pdf=require(_0x1edf('0x0'));var emlformat=require(_0x1edf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1edf('0x2'));var rp=require(_0x1edf('0x3'));var moment=require(_0x1edf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1edf('0x5'));var util=require(_0x1edf('0x6'));var path=require(_0x1edf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1edf('0x8'));var fs=require('fs');var _=require(_0x1edf('0x9'));var squel=require(_0x1edf('0xa'));var crypto=require(_0x1edf('0xb'));var jsforce=require(_0x1edf('0xc'));var deskjs=require(_0x1edf('0xd'));var toCsv=require(_0x1edf('0xe'));var querystring=require(_0x1edf('0xf'));var Papa=require(_0x1edf('0x10'));var Redis=require('ioredis');var authService=require(_0x1edf('0x11'));var qs=require(_0x1edf('0x12'));var hardwareService=require(_0x1edf('0x13'));var logger=require(_0x1edf('0x14'))('api');var utils=require(_0x1edf('0x15'));var config=require('../../config/environment');var db=require(_0x1edf('0x16'))['db'];var integrations=require(_0x1edf('0x17'));var jayson=require(_0x1edf('0x18'));var client=jayson[_0x1edf('0x19')][_0x1edf('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ec2bb,_0x277fc4,_0xfccc06){if(_0xfccc06){var _0x34811f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34811f['test'](_0x277fc4)){return _0x3ec2bb;}else{throw new Error(_0x1edf('0x1b'));}}else{return _0x3ec2bb;}}function respondWithRpcPromise(_0x212a02,_0x545dd9,_0x1ab562,_0x4551d4){return new BPromise(function(_0x2dc46a,_0x2a0a78){var _0x1dfa91=_0x4551d4||client;return _0x1dfa91[_0x1edf('0x1c')](_0x212a02,_0x1ab562)['then'](function(_0x4f2584){logger[_0x1edf('0x1d')](_0x1edf('0x1e'),_0x545dd9,_0x1edf('0x1f'));logger[_0x1edf('0x20')](_0x1edf('0x21'),_0x545dd9,'request\x20sent',JSON[_0x1edf('0x22')](_0x4f2584));if(_0x4f2584['error']){if(_0x4f2584[_0x1edf('0x23')][_0x1edf('0x24')]===0x1f4){logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);return _0x2a0a78(_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);}logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x4f2584[_0x1edf('0x23')][_0x1edf('0x25')]);return _0x2dc46a(_0x4f2584[_0x1edf('0x23')]['message']);}else{logger[_0x1edf('0x1d')](_0x1edf('0x1e'),_0x545dd9,_0x1edf('0x1f'));_0x2dc46a(_0x4f2584['result'][_0x1edf('0x25')]);}})[_0x1edf('0x26')](function(_0x343624){logger[_0x1edf('0x23')](_0x1edf('0x1e'),_0x545dd9,_0x343624);_0x2a0a78(_0x343624);});});}function respondWithStatusCode(_0xedefd7,_0x2f51c0){_0x2f51c0=_0x2f51c0||0xcc;return function(_0x2865ca){if(_0x2865ca){return _0xedefd7[_0x1edf('0x27')](_0x2f51c0);}return _0xedefd7[_0x1edf('0x28')](_0x2f51c0)[_0x1edf('0x29')]();};}function respondWithResult(_0x2ca8a7,_0x386cdd){_0x386cdd=_0x386cdd||0xc8;return function(_0x532e36){if(_0x532e36){return _0x2ca8a7['status'](_0x386cdd)[_0x1edf('0x2a')](_0x532e36);}};}function respondWithFilteredResult(_0x362e79,_0xd8bb8c){return function(_0x23fb7d){if(_0x23fb7d){var _0x105640=_0x23fb7d[_0x1edf('0x2b')],_0x16fb85=_0xd8bb8c[_0x1edf('0x2c')],_0x25b91f=_0xd8bb8c[_0x1edf('0x2c')]+_0xd8bb8c[_0x1edf('0x2d')],_0x1bcf3e;if(_0x25b91f>=_0x105640){_0x25b91f=_0x105640;_0x1bcf3e=0xc8;}else{_0x1bcf3e=0xce;}_0x362e79[_0x1edf('0x28')](_0x1bcf3e);return _0x362e79[_0x1edf('0x2e')]('Content-Range',_0x16fb85+'-'+_0x25b91f+'/'+_0x105640)[_0x1edf('0x2a')](_0x23fb7d);}return null;};}function patchUpdates(_0x4f7a50){return function(_0x942631){try{jsonpatch[_0x1edf('0x2f')](_0x942631,_0x4f7a50,!![]);}catch(_0x3e13c9){return BPromise['reject'](_0x3e13c9);}return _0x942631[_0x1edf('0x30')]();};}function saveUpdates(_0x49e2b1,_0x400464){return function(_0xad9370){if(_0xad9370){return _0xad9370['update'](_0x49e2b1)[_0x1edf('0x31')](function(_0x454930){return _0x454930;});}return null;};}function removeEntity(_0x15cbad,_0x1f40d7){return function(_0x15e5ef){if(_0x15e5ef){return _0x15e5ef[_0x1edf('0x32')]()[_0x1edf('0x31')](function(){_0x15cbad[_0x1edf('0x28')](0xcc)[_0x1edf('0x29')]();});}};}function handleEntityNotFound(_0x37b9d5,_0x412f92){return function(_0x49cabe){if(!_0x49cabe){_0x37b9d5[_0x1edf('0x27')](0x194);}return _0x49cabe;};}function handleError(_0x467530,_0x3b3423){_0x3b3423=_0x3b3423||0x1f4;return function(_0x16798c){logger[_0x1edf('0x23')](_0x16798c[_0x1edf('0x33')]);if(_0x16798c[_0x1edf('0x34')]){delete _0x16798c[_0x1edf('0x34')];}_0x467530[_0x1edf('0x28')](_0x3b3423)[_0x1edf('0x35')](_0x16798c);};}exports[_0x1edf('0x36')]=function(_0x2be392,_0x4a4156){var _0x3aeca6={},_0x2ce5da={},_0x4cd819={'count':0x0,'rows':[]};var _0x58b084=db[_0x1edf('0x37')][_0x1edf('0x38')];_0x2ce5da[_0x1edf('0x39')]=_[_0x1edf('0x3a')](_0x58b084);_0x2ce5da[_0x1edf('0x3b')]=_[_0x1edf('0x3a')](_0x2be392[_0x1edf('0x3b')]);_0x2ce5da['filters']=_[_0x1edf('0x3c')](_0x2ce5da[_0x1edf('0x39')],_0x2ce5da[_0x1edf('0x3b')]);_0x3aeca6[_0x1edf('0x3d')]=_[_0x1edf('0x3c')](_0x2ce5da[_0x1edf('0x39')],qs[_0x1edf('0x3e')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x3e')]));_0x3aeca6[_0x1edf('0x3d')]=_0x3aeca6[_0x1edf('0x3d')]['length']?_0x3aeca6[_0x1edf('0x3d')]:_0x2ce5da[_0x1edf('0x39')];if(!_0x2be392[_0x1edf('0x3b')]['hasOwnProperty'](_0x1edf('0x3f'))){_0x3aeca6[_0x1edf('0x2d')]=qs[_0x1edf('0x2d')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x2d')]);_0x3aeca6[_0x1edf('0x2c')]=qs[_0x1edf('0x2c')](_0x2be392[_0x1edf('0x3b')][_0x1edf('0x2c')]);}_0x3aeca6[_0x1edf('0x40')]=qs[_0x1edf('0x41')](_0x2be392['query']['sort']);_0x3aeca6[_0x1edf('0x42')]=qs[_0x1edf('0x43')](_[_0x1edf('0x44')](_0x2be392[_0x1edf('0x3b')],_0x2ce5da[_0x1edf('0x43')]));if(_0x2be392[_0x1edf('0x3b')][_0x1edf('0x45')]){_0x3aeca6[_0x1edf('0x42')]=_[_0x1edf('0x46')](_0x3aeca6[_0x1edf('0x42')],{'$or':_['map'](_0x58b084,function(_0xcef674){if(_0xcef674[_0x1edf('0x47')][_0x1edf('0x48')]!==_0x1edf('0x49')){var _0x11a04e={};_0x11a04e[_0xcef674[_0x1edf('0x4a')]]={'$like':'%'+_0x2be392[_0x1edf('0x3b')][_0x1edf('0x45')]+'%'};return _0x11a04e;}})});}_0x3aeca6=_[_0x1edf('0x46')]({},_0x3aeca6,_0x2be392[_0x1edf('0x4b')]);var _0x4b9163={'where':_0x3aeca6['where']};return db[_0x1edf('0x37')]['count'](_0x4b9163)[_0x1edf('0x31')](function(_0x438218){_0x4cd819[_0x1edf('0x2b')]=_0x438218;if(_0x2be392[_0x1edf('0x3b')][_0x1edf('0x4c')]){_0x3aeca6[_0x1edf('0x4d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x1edf('0x4e')](_0x3aeca6);})['then'](function(_0x454392){_0x4cd819[_0x1edf('0x4f')]=_0x454392;return _0x4cd819;})['then'](respondWithFilteredResult(_0x4a4156,_0x3aeca6))[_0x1edf('0x26')](handleError(_0x4a4156,null));};exports[_0x1edf('0x50')]=function(_0x3af225,_0x437c9e){var _0x4617a0={'raw':![],'where':{'id':_0x3af225[_0x1edf('0x51')]['id']}},_0x2af9a8={};_0x2af9a8[_0x1edf('0x39')]=_[_0x1edf('0x3a')](db[_0x1edf('0x37')]['rawAttributes']);_0x2af9a8[_0x1edf('0x3b')]=_['keys'](_0x3af225[_0x1edf('0x3b')]);_0x2af9a8[_0x1edf('0x43')]=_[_0x1edf('0x3c')](_0x2af9a8[_0x1edf('0x39')],_0x2af9a8[_0x1edf('0x3b')]);_0x4617a0['attributes']=_[_0x1edf('0x3c')](_0x2af9a8[_0x1edf('0x39')],qs['fields'](_0x3af225['query'][_0x1edf('0x3e')]));_0x4617a0[_0x1edf('0x3d')]=_0x4617a0[_0x1edf('0x3d')][_0x1edf('0x52')]?_0x4617a0[_0x1edf('0x3d')]:_0x2af9a8[_0x1edf('0x39')];if(_0x3af225[_0x1edf('0x3b')]['includeAll']){_0x4617a0[_0x1edf('0x4d')]=[{'all':!![]}];}_0x4617a0=_[_0x1edf('0x46')]({},_0x4617a0,_0x3af225['options']);return db['FreshdeskAccount'][_0x1edf('0x53')](_0x4617a0)[_0x1edf('0x31')](handleEntityNotFound(_0x437c9e,null))[_0x1edf('0x31')](respondWithResult(_0x437c9e,null))[_0x1edf('0x26')](handleError(_0x437c9e,null));};exports[_0x1edf('0x54')]=function(_0x45b073,_0xa9f933){return db['FreshdeskAccount']['create'](_0x45b073[_0x1edf('0x55')],{})['then'](respondWithResult(_0xa9f933,0xc9))[_0x1edf('0x26')](handleError(_0xa9f933,null));};exports[_0x1edf('0x56')]=function(_0x466068,_0x4122b1){if(_0x466068[_0x1edf('0x55')]['id']){delete _0x466068[_0x1edf('0x55')]['id'];}return db[_0x1edf('0x37')]['find']({'where':{'id':_0x466068['params']['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x4122b1,null))[_0x1edf('0x31')](saveUpdates(_0x466068['body'],null))['then'](respondWithResult(_0x4122b1,null))['catch'](handleError(_0x4122b1,null));};exports[_0x1edf('0x32')]=function(_0x14adc6,_0x6720aa){return db['FreshdeskAccount'][_0x1edf('0x53')]({'where':{'id':_0x14adc6[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x6720aa,null))[_0x1edf('0x31')](removeEntity(_0x6720aa,null))['catch'](handleError(_0x6720aa,null));};exports['getConfigurations']=function(_0x1a0eb9,_0x31c002,_0x5948ee){var _0x14b4c3={};var _0x55d894={};var _0x1c322d;var _0x244fe1;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1a0eb9[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x31c002,null))['then'](function(_0x4372c7){if(_0x4372c7){_0x1c322d=_0x4372c7;_0x55d894[_0x1edf('0x39')]=_[_0x1edf('0x3a')](db['FreshdeskConfiguration']['rawAttributes']);_0x55d894[_0x1edf('0x3b')]=_[_0x1edf('0x3a')](_0x1a0eb9[_0x1edf('0x3b')]);_0x55d894['filters']=_[_0x1edf('0x3c')](_0x55d894[_0x1edf('0x39')],_0x55d894[_0x1edf('0x3b')]);_0x14b4c3[_0x1edf('0x3d')]=_[_0x1edf('0x3c')](_0x55d894[_0x1edf('0x39')],qs[_0x1edf('0x3e')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x3e')]));_0x14b4c3[_0x1edf('0x3d')]=_0x14b4c3[_0x1edf('0x3d')]['length']?_0x14b4c3['attributes']:_0x55d894[_0x1edf('0x39')];_0x14b4c3[_0x1edf('0x40')]=qs[_0x1edf('0x41')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x41')]);_0x14b4c3[_0x1edf('0x42')]=qs[_0x1edf('0x43')](_[_0x1edf('0x44')](_0x1a0eb9[_0x1edf('0x3b')],_0x55d894[_0x1edf('0x43')]));if(_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x45')]){_0x14b4c3[_0x1edf('0x42')]=_[_0x1edf('0x46')](_0x14b4c3[_0x1edf('0x42')],{'$or':_[_0x1edf('0x57')](_0x14b4c3['attributes'],function(_0x477f1c){var _0xbadd41={};_0xbadd41[_0x477f1c]={'$like':'%'+_0x1a0eb9[_0x1edf('0x3b')]['filter']+'%'};return _0xbadd41;})});}_0x14b4c3=_[_0x1edf('0x46')]({},_0x14b4c3,_0x1a0eb9[_0x1edf('0x4b')]);return _0x1c322d[_0x1edf('0x58')](_0x14b4c3);}})[_0x1edf('0x31')](function(_0x3cb9e4){if(_0x3cb9e4){_0x244fe1=_0x3cb9e4[_0x1edf('0x52')];if(!_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x59')](_0x1edf('0x3f'))){_0x14b4c3[_0x1edf('0x2d')]=qs[_0x1edf('0x2d')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x2d')]);_0x14b4c3[_0x1edf('0x2c')]=qs[_0x1edf('0x2c')](_0x1a0eb9[_0x1edf('0x3b')][_0x1edf('0x2c')]);}return _0x1c322d['getConfigurations'](_0x14b4c3);}})['then'](function(_0x5086a7){if(_0x5086a7){return _0x5086a7?{'count':_0x244fe1,'rows':_0x5086a7}:null;}})[_0x1edf('0x31')](respondWithResult(_0x31c002,null))[_0x1edf('0x26')](handleError(_0x31c002,null));};exports[_0x1edf('0x5a')]=function(_0x2b43c0,_0x1d8b6f,_0x33d98b){if(_0x2b43c0[_0x1edf('0x55')]['id']){delete _0x2b43c0[_0x1edf('0x55')]['id'];}return db[_0x1edf('0x37')]['findOne']({'where':{'id':_0x2b43c0[_0x1edf('0x51')]['id']}})[_0x1edf('0x31')](handleEntityNotFound(_0x1d8b6f,null))[_0x1edf('0x31')](function(_0x358e0f){if(_0x358e0f){_0x2b43c0[_0x1edf('0x55')]['AccountId']=_0x358e0f['id'];_0x2b43c0['body'][_0x1edf('0x5b')]=integrations[_0x1edf('0x5c')](_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5d')],_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x47')]);_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5e')]=integrations['getDescriptions'](_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x5d')],_0x2b43c0[_0x1edf('0x55')][_0x1edf('0x47')]);return db[_0x1edf('0x5f')][_0x1edf('0x54')](_0x2b43c0[_0x1edf('0x55')],{'include':[{'model':db[_0x1edf('0x60')],'as':_0x1edf('0x5b')},{'model':db[_0x1edf('0x60')],'as':_0x1edf('0x5e')}]});}return null;})[_0x1edf('0x31')](respondWithResult(_0x1d8b6f,null))[_0x1edf('0x26')](handleError(_0x1d8b6f,null));};exports[_0x1edf('0x61')]=function(_0x219fa0,_0x260bd7,_0x463a99){var _0xdb37b5='';return db['FreshdeskAccount'][_0x1edf('0x62')]({'where':{'id':_0x219fa0[_0x1edf('0x51')]['id']},'attributes':['id',_0x1edf('0x63'),_0x1edf('0x64')]})['then'](handleEntityNotFound(_0x260bd7,null))['then'](function(_0x414e69){if(_0x414e69){_0xdb37b5=_0x414e69[_0x1edf('0x63')];var _0x1d4011=_0xdb37b5[_0x1edf('0x65')](-0x1);if(_0x1d4011==='/'){_0xdb37b5=_0xdb37b5[_0x1edf('0x66')](0x0,_0xdb37b5[_0x1edf('0x67')](_0x1d4011));}return rp({'method':_0x1edf('0x68'),'uri':util['format'](_0x1edf('0x69'),_0xdb37b5,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1edf('0x6a')](_0x1edf('0x6b'),new Buffer(util['format'](_0x1edf('0x6c'),_0x414e69[_0x1edf('0x64')]))[_0x1edf('0x6d')](_0x1edf('0x6e')))},'json':!![]});}})[_0x1edf('0x31')](function(_0x328d25){if(_0x328d25){var _0x172b6a=['requester',_0x1edf('0x6f'),_0x1edf('0x70'),'description','status',_0x1edf('0x71'),_0x1edf('0x72'),'source',_0x1edf('0x73'),_0x1edf('0x72'),_0x1edf('0x74')];_[_0x1edf('0x75')](_0x328d25,function(_0x4f53bc){return _0x172b6a[_0x1edf('0x76')](_0x4f53bc['name'])||!_0x4f53bc[_0x1edf('0x77')]&&_0x4f53bc['type']!==_0x1edf('0x78')&&_0x4f53bc['type']!==_0x1edf('0x79');});return{'count':_0x328d25['length'],'rows':_['map'](_0x328d25,function(_0x43d2d){return{'id':_0x43d2d[_0x1edf('0x34')],'name':_0x43d2d['label'],'custom':!_0x43d2d[_0x1edf('0x77')],'options':_0x43d2d[_0x1edf('0x7a')]?_['map'](_0x43d2d[_0x1edf('0x7a')],function(_0x27519b){return{'name':_[_0x1edf('0x7b')](_0x27519b),'value':_0x27519b};}):[]};})};}})[_0x1edf('0x31')](respondWithResult(_0x260bd7,null))[_0x1edf('0x26')](function(_0x568591){var _0x32400b=_0x219fa0['query'][_0x1edf('0x7c')]?0x1f4:_0x568591['statusCode']||0x1f4;logger[_0x1edf('0x23')](_0x1edf('0x7d'),_0x1edf('0x61'),_0x32400b,JSON[_0x1edf('0x22')](_0x568591));delete _0x568591[_0x1edf('0x34')];if(_0x32400b===0x191){_0x32400b=0x190;}_0x260bd7[_0x1edf('0x28')](_0x32400b)[_0x1edf('0x35')](_0x219fa0['query'][_0x1edf('0x7c')]?{'message':_0x1edf('0x7e'),'statusCode':_0x568591['statusCode']}:_0x568591);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0693451..1d9c1cf 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 _0xd34e=['../../components/integrations/configuration','define','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x598b53,_0x20fe66){var _0x1b2874=function(_0x4d2b54){while(--_0x4d2b54){_0x598b53['push'](_0x598b53['shift']());}};_0x1b2874(++_0x20fe66);}(_0xd34e,0x1a7));var _0xed34=function(_0x586839,_0x54aeab){_0x586839=_0x586839-0x0;var _0x33f90b=_0xd34e[_0x586839];return _0x33f90b;};'use strict';var _=require('lodash');var util=require(_0xed34('0x0'));var logger=require(_0xed34('0x1'))(_0xed34('0x2'));var moment=require(_0xed34('0x3'));var BPromise=require(_0xed34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed34('0x5'));var rimraf=require(_0xed34('0x6'));var config=require(_0xed34('0x7'));var attributes=require(_0xed34('0x8'));var integrations=require(_0xed34('0x9'));module['exports']=function(_0x50a3d7,_0x2d1a06){return _0x50a3d7[_0xed34('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xed34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3acc=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x203cf5,_0x8421e0){var _0x17a51d=function(_0x466b7a){while(--_0x466b7a){_0x203cf5['push'](_0x203cf5['shift']());}};_0x17a51d(++_0x8421e0);}(_0x3acc,0x119));var _0xc3ac=function(_0x11e9d7,_0x4a2024){_0x11e9d7=_0x11e9d7-0x0;var _0x35f9d7=_0x3acc[_0x11e9d7];return _0x35f9d7;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var logger=require(_0xc3ac('0x2'))(_0xc3ac('0x3'));var moment=require(_0xc3ac('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3ac('0x5'));var rimraf=require('rimraf');var config=require(_0xc3ac('0x6'));var attributes=require(_0xc3ac('0x7'));var integrations=require(_0xc3ac('0x8'));module[_0xc3ac('0x9')]=function(_0x23f229,_0x27058b){return _0x23f229[_0xc3ac('0xa')]('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 7a6c0e9..6890ba1 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 _0xdbc6=['findAll','options','where','attributes','limit','include','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','model','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount'];(function(_0x59efd2,_0x7b6b20){var _0x5abf6d=function(_0x518b33){while(--_0x518b33){_0x59efd2['push'](_0x59efd2['shift']());}};_0x5abf6d(++_0x7b6b20);}(_0xdbc6,0x1a3));var _0x6dbc=function(_0x2632f2,_0x1a38e5){_0x2632f2=_0x2632f2-0x0;var _0x1598ff=_0xdbc6[_0x2632f2];return _0x1598ff;};'use strict';var _=require('lodash');var util=require(_0x6dbc('0x0'));var moment=require('moment');var BPromise=require(_0x6dbc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dbc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dbc('0x3'))(_0x6dbc('0x4'));var config=require(_0x6dbc('0x5'));var jayson=require(_0x6dbc('0x6'));var client=jayson[_0x6dbc('0x7')][_0x6dbc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf9e279,_0x94b73d,_0x397f24){return new BPromise(function(_0x284d8d,_0x3b5bef){return client[_0x6dbc('0x9')](_0xf9e279,_0x397f24)[_0x6dbc('0xa')](function(_0x4e33ab){logger[_0x6dbc('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x94b73d,'request\x20sent');logger[_0x6dbc('0xc')](_0x6dbc('0xd'),_0x94b73d,_0x6dbc('0xe'),JSON[_0x6dbc('0xf')](_0x4e33ab));if(_0x4e33ab[_0x6dbc('0x10')]){if(_0x4e33ab['error'][_0x6dbc('0x11')]===0x1f4){logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x4e33ab['error'][_0x6dbc('0x13')]);return _0x3b5bef(_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);}logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);return _0x284d8d(_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);}else{logger[_0x6dbc('0xb')](_0x6dbc('0x12'),_0x94b73d,_0x6dbc('0xe'));_0x284d8d(_0x4e33ab[_0x6dbc('0x14')]['message']);}})[_0x6dbc('0x15')](function(_0x430a88){logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x430a88);_0x3b5bef(_0x430a88);});});}exports['GetFreshdeskAccount']=function(_0x49d0c2){var _0xc7e3eb=this;return new Promise(function(_0x5bedca,_0x19f7af){return db[_0x6dbc('0x16')][_0x6dbc('0x17')]({'raw':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x19')]||null:null,'attributes':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x1a')]||null:null,'limit':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x1b')]||null:null,'include':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2['options'][_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x49d0c2[_0x6dbc('0x18')]['include'],function(_0x498e18){return{'model':db[_0x498e18['model']],'as':_0x498e18['as'],'attributes':_0x498e18[_0x6dbc('0x1a')],'include':_0x498e18['include']?_[_0x6dbc('0x1d')](_0x498e18[_0x6dbc('0x1c')],function(_0x501b4a){return{'model':db[_0x501b4a['model']],'as':_0x501b4a['as'],'attributes':_0x501b4a[_0x6dbc('0x1a')],'include':_0x501b4a['include']?_[_0x6dbc('0x1d')](_0x501b4a['include'],function(_0x1f642a){return{'model':db[_0x1f642a['model']],'as':_0x1f642a['as'],'attributes':_0x1f642a[_0x6dbc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x438810){logger['info'](_0x6dbc('0x1e'),_0x49d0c2);logger[_0x6dbc('0xc')](_0x6dbc('0x1e'),_0x49d0c2,JSON[_0x6dbc('0xf')](_0x438810));_0x5bedca(_0x438810);})[_0x6dbc('0x15')](function(_0x47e9b5){logger[_0x6dbc('0x10')](_0x6dbc('0x1e'),_0x47e9b5[_0x6dbc('0x13')],_0x49d0c2);_0x19f7af(_0xc7e3eb[_0x6dbc('0x10')](0x1f4,_0x47e9b5[_0x6dbc('0x13')]));});});};exports[_0x6dbc('0x1f')]=function(_0x31c051){var _0x35273d=this;return new Promise(function(_0x539d8b,_0x508c1d){return db[_0x6dbc('0x16')][_0x6dbc('0x20')]({'raw':_0x31c051[_0x6dbc('0x18')]?_0x31c051[_0x6dbc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31c051[_0x6dbc('0x18')]?_0x31c051['options']['where']||null:null,'attributes':_0x31c051[_0x6dbc('0x18')]?_0x31c051[_0x6dbc('0x18')]['attributes']||null:null,'include':_0x31c051['options']?_0x31c051[_0x6dbc('0x18')][_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x31c051['options'][_0x6dbc('0x1c')],function(_0x5300c4){return{'model':db[_0x5300c4['model']],'as':_0x5300c4['as'],'attributes':_0x5300c4[_0x6dbc('0x1a')],'include':_0x5300c4[_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x5300c4['include'],function(_0x1c93d1){return{'model':db[_0x1c93d1[_0x6dbc('0x21')]],'as':_0x1c93d1['as'],'attributes':_0x1c93d1[_0x6dbc('0x1a')],'include':_0x1c93d1[_0x6dbc('0x1c')]?_['map'](_0x1c93d1[_0x6dbc('0x1c')],function(_0x2603fc){return{'model':db[_0x2603fc[_0x6dbc('0x21')]],'as':_0x2603fc['as'],'attributes':_0x2603fc[_0x6dbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6dbc('0xa')](function(_0x1fc4e0){logger[_0x6dbc('0xb')](_0x6dbc('0x1f'),_0x31c051);logger['debug']('ShowFreshdeskAccount',_0x31c051,JSON[_0x6dbc('0xf')](_0x1fc4e0));_0x539d8b(_0x1fc4e0);})['catch'](function(_0x37942e){logger[_0x6dbc('0x10')]('ShowFreshdeskAccount',_0x37942e[_0x6dbc('0x13')],_0x31c051);_0x508c1d(_0x35273d[_0x6dbc('0x10')](0x1f4,_0x37942e[_0x6dbc('0x13')]));});});}; \ No newline at end of file +var _0xda76=['jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e6508,_0x226aa6){var _0x45bad8=function(_0x4007dd){while(--_0x4007dd){_0x5e6508['push'](_0x5e6508['shift']());}};_0x45bad8(++_0x226aa6);}(_0xda76,0xc9));var _0x6da7=function(_0x55cb38,_0xd758bf){_0x55cb38=_0x55cb38-0x0;var _0xc89025=_0xda76[_0x55cb38];return _0xc89025;};'use strict';var _=require(_0x6da7('0x0'));var util=require(_0x6da7('0x1'));var moment=require(_0x6da7('0x2'));var BPromise=require(_0x6da7('0x3'));var rs=require(_0x6da7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6da7('0x5'))['db'];var utils=require(_0x6da7('0x6'));var logger=require(_0x6da7('0x7'))(_0x6da7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6da7('0x9'));var client=jayson['client'][_0x6da7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5058f1,_0x40ad1a,_0x35c93c){return new BPromise(function(_0x500a50,_0x43bbdb){return client[_0x6da7('0xb')](_0x5058f1,_0x35c93c)['then'](function(_0x562b37){logger[_0x6da7('0xc')](_0x6da7('0xd'),_0x40ad1a,_0x6da7('0xe'));logger[_0x6da7('0xf')](_0x6da7('0x10'),_0x40ad1a,'request\x20sent',JSON[_0x6da7('0x11')](_0x562b37));if(_0x562b37[_0x6da7('0x12')]){if(_0x562b37[_0x6da7('0x12')][_0x6da7('0x13')]===0x1f4){logger[_0x6da7('0x12')](_0x6da7('0xd'),_0x40ad1a,_0x562b37['error'][_0x6da7('0x14')]);return _0x43bbdb(_0x562b37[_0x6da7('0x12')][_0x6da7('0x14')]);}logger[_0x6da7('0x12')](_0x6da7('0xd'),_0x40ad1a,_0x562b37[_0x6da7('0x12')][_0x6da7('0x14')]);return _0x500a50(_0x562b37[_0x6da7('0x12')]['message']);}else{logger[_0x6da7('0xc')](_0x6da7('0xd'),_0x40ad1a,'request\x20sent');_0x500a50(_0x562b37['result'][_0x6da7('0x14')]);}})['catch'](function(_0x3ed245){logger['error'](_0x6da7('0xd'),_0x40ad1a,_0x3ed245);_0x43bbdb(_0x3ed245);});});}exports['GetFreshdeskAccount']=function(_0xb15933){var _0x3a0cc7=this;return new Promise(function(_0x291ddb,_0x106778){return db[_0x6da7('0x15')][_0x6da7('0x16')]({'raw':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x18')]===undefined?!![]:![]:!![],'where':_0xb15933['options']?_0xb15933['options']['where']||null:null,'attributes':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x19')]||null:null,'limit':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x1a')]||null:null,'include':_0xb15933[_0x6da7('0x17')]?_0xb15933[_0x6da7('0x17')][_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0xb15933[_0x6da7('0x17')][_0x6da7('0x1b')],function(_0x5064d7){return{'model':db[_0x5064d7[_0x6da7('0x1d')]],'as':_0x5064d7['as'],'attributes':_0x5064d7[_0x6da7('0x19')],'include':_0x5064d7[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x5064d7[_0x6da7('0x1b')],function(_0x13c89b){return{'model':db[_0x13c89b[_0x6da7('0x1d')]],'as':_0x13c89b['as'],'attributes':_0x13c89b['attributes'],'include':_0x13c89b[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x13c89b['include'],function(_0xc79383){return{'model':db[_0xc79383[_0x6da7('0x1d')]],'as':_0xc79383['as'],'attributes':_0xc79383[_0x6da7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6da7('0x1e')](function(_0x10a9d4){logger[_0x6da7('0xc')](_0x6da7('0x1f'),_0xb15933);logger[_0x6da7('0xf')]('GetFreshdeskAccount',_0xb15933,JSON[_0x6da7('0x11')](_0x10a9d4));_0x291ddb(_0x10a9d4);})['catch'](function(_0x37a466){logger[_0x6da7('0x12')](_0x6da7('0x1f'),_0x37a466['message'],_0xb15933);_0x106778(_0x3a0cc7['error'](0x1f4,_0x37a466[_0x6da7('0x14')]));});});};exports[_0x6da7('0x20')]=function(_0x5ae449){var _0x50f1dd=this;return new Promise(function(_0x43d0d3,_0x1b83e5){return db[_0x6da7('0x15')][_0x6da7('0x21')]({'raw':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x18')]===undefined?!![]:![]:!![],'where':_0x5ae449['options']?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x22')]||null:null,'attributes':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x19')]||null:null,'include':_0x5ae449[_0x6da7('0x17')]?_0x5ae449[_0x6da7('0x17')][_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x5ae449[_0x6da7('0x17')][_0x6da7('0x1b')],function(_0x1b5e00){return{'model':db[_0x1b5e00['model']],'as':_0x1b5e00['as'],'attributes':_0x1b5e00['attributes'],'include':_0x1b5e00[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x1b5e00[_0x6da7('0x1b')],function(_0x16030f){return{'model':db[_0x16030f[_0x6da7('0x1d')]],'as':_0x16030f['as'],'attributes':_0x16030f[_0x6da7('0x19')],'include':_0x16030f[_0x6da7('0x1b')]?_[_0x6da7('0x1c')](_0x16030f[_0x6da7('0x1b')],function(_0x437364){return{'model':db[_0x437364['model']],'as':_0x437364['as'],'attributes':_0x437364[_0x6da7('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bb8a3){logger[_0x6da7('0xc')](_0x6da7('0x20'),_0x5ae449);logger[_0x6da7('0xf')]('ShowFreshdeskAccount',_0x5ae449,JSON[_0x6da7('0x11')](_0x4bb8a3));_0x43d0d3(_0x4bb8a3);})['catch'](function(_0x4d214d){logger[_0x6da7('0x12')]('ShowFreshdeskAccount',_0x4d214d[_0x6da7('0x14')],_0x5ae449);_0x1b83e5(_0x50f1dd[_0x6da7('0x12')](0x1f4,_0x4d214d[_0x6da7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0713f15..6fe0d05 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 _0x98a8=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x98a8,0x12c));var _0x898a=function(_0x3ceb15,_0x140ee6){_0x3ceb15=_0x3ceb15-0x0;var _0x3be3cc=_0x98a8[_0x3ceb15];return _0x3be3cc;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x9')](_0x898a('0x12'),auth['isAuthenticated'](),controller[_0x898a('0x13')]);router['get'](_0x898a('0x14'),auth['isAuthenticated'](),controller[_0x898a('0x15')]);router[_0x898a('0x16')]('/',auth[_0x898a('0xa')](),controller['create']);router['post']('/:id/tags',auth[_0x898a('0xa')](),controller[_0x898a('0x17')]);router[_0x898a('0x18')](_0x898a('0xc'),auth[_0x898a('0xa')](),controller[_0x898a('0x19')]);router['delete'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd13e=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x586885,_0x393c14){var _0x4f9133=function(_0x2d3c80){while(--_0x2d3c80){_0x586885['push'](_0x586885['shift']());}};_0x4f9133(++_0x393c14);}(_0xd13e,0x193));var _0xed13=function(_0xbb7c1c,_0x1bfa20){_0xbb7c1c=_0xbb7c1c-0x0;var _0x4ce4d4=_0xd13e[_0xbb7c1c];return _0x4ce4d4;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xed13('0x5'));var config=require('../../config/environment');var controller=require(_0xed13('0x6'));router[_0xed13('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xed13('0x8'),auth[_0xed13('0x9')](),controller[_0xed13('0xa')]);router[_0xed13('0x7')](_0xed13('0xb'),auth[_0xed13('0x9')](),controller[_0xed13('0xc')]);router[_0xed13('0x7')](_0xed13('0xd'),auth['isAuthenticated'](),controller[_0xed13('0xe')]);router[_0xed13('0x7')](_0xed13('0xf'),auth[_0xed13('0x9')](),controller[_0xed13('0x10')]);router['get'](_0xed13('0x11'),auth[_0xed13('0x9')](),controller[_0xed13('0x12')]);router[_0xed13('0x13')]('/',auth[_0xed13('0x9')](),controller[_0xed13('0x14')]);router['post'](_0xed13('0x11'),auth['isAuthenticated'](),controller[_0xed13('0x15')]);router['put'](_0xed13('0x8'),auth['isAuthenticated'](),controller[_0xed13('0x16')]);router['delete'](_0xed13('0x8'),auth[_0xed13('0x9')](),controller[_0xed13('0x17')]);module[_0xed13('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0e04b72..fd80b3f 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 _0xf721=['exports','STRING'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xf721,0x150));var _0x1f72=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0xf721[_0x53d172];return _0x1bd0a2;};'use strict';var Sequelize=require('sequelize');module[_0x1f72('0x0')]={'name':{'type':Sequelize[_0x1f72('0x1')]},'description':{'type':Sequelize[_0x1f72('0x1')]}}; \ No newline at end of file +var _0xc79f=['exports','STRING','sequelize'];(function(_0x43dc3f,_0x322886){var _0x43a1ea=function(_0x1fd750){while(--_0x1fd750){_0x43dc3f['push'](_0x43dc3f['shift']());}};_0x43a1ea(++_0x322886);}(_0xc79f,0x8f));var _0xfc79=function(_0x370397,_0x4f2b07){_0x370397=_0x370397-0x0;var _0x2420ef=_0xc79f[_0x370397];return _0x2420ef;};'use strict';var Sequelize=require(_0xfc79('0x0'));module[_0xfc79('0x1')]={'name':{'type':Sequelize[_0xfc79('0x2')]},'description':{'type':Sequelize[_0xfc79('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index b6e5c4b..b54cd8f 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 _0x7d05=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','apply','save','update','then','destroy','stack','name','FreshdeskConfiguration','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','options','find','create','body','getFields','findOne','FreshdeskField','order','pick','getSubjects','map','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x44f3a8,_0x3f1f14){var _0x94d332=function(_0xa52ec3){while(--_0xa52ec3){_0x44f3a8['push'](_0x44f3a8['shift']());}};_0x94d332(++_0x3f1f14);}(_0x7d05,0x113));var _0x57d0=function(_0x4e4255,_0x41edd0){_0x4e4255=_0x4e4255-0x0;var _0x106fd4=_0x7d05[_0x4e4255];return _0x106fd4;};'use strict';var pdf=require(_0x57d0('0x0'));var emlformat=require(_0x57d0('0x1'));var rimraf=require(_0x57d0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57d0('0x3'));var rp=require(_0x57d0('0x4'));var moment=require(_0x57d0('0x5'));var BPromise=require(_0x57d0('0x6'));var Mustache=require(_0x57d0('0x7'));var util=require(_0x57d0('0x8'));var path=require(_0x57d0('0x9'));var sox=require('sox');var csv=require(_0x57d0('0xa'));var ejs=require(_0x57d0('0xb'));var fs=require('fs');var _=require(_0x57d0('0xc'));var squel=require(_0x57d0('0xd'));var crypto=require(_0x57d0('0xe'));var jsforce=require(_0x57d0('0xf'));var deskjs=require(_0x57d0('0x10'));var toCsv=require(_0x57d0('0xa'));var querystring=require(_0x57d0('0x11'));var Papa=require(_0x57d0('0x12'));var Redis=require(_0x57d0('0x13'));var authService=require(_0x57d0('0x14'));var qs=require(_0x57d0('0x15'));var hardwareService=require(_0x57d0('0x16'));var logger=require(_0x57d0('0x17'))('api');var utils=require(_0x57d0('0x18'));var config=require('../../config/environment');var db=require(_0x57d0('0x19'))['db'];var jayson=require(_0x57d0('0x1a'));var client=jayson[_0x57d0('0x1b')][_0x57d0('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x62c017,_0x3672da,_0x406b87){if(_0x406b87){var _0x266206=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x266206[_0x57d0('0x1d')](_0x3672da)){return _0x62c017;}else{throw new Error(_0x57d0('0x1e'));}}else{return _0x62c017;}}function respondWithRpcPromise(_0x3bd5a4,_0x3bc944,_0x58cbad,_0x409958){return new BPromise(function(_0x39d236,_0x192710){var _0x2bfba7=_0x409958||client;return _0x2bfba7[_0x57d0('0x1f')](_0x3bd5a4,_0x58cbad)['then'](function(_0xb61f74){logger[_0x57d0('0x20')](_0x57d0('0x21'),_0x3bc944,_0x57d0('0x22'));logger[_0x57d0('0x23')](_0x57d0('0x24'),_0x3bc944,_0x57d0('0x22'),JSON[_0x57d0('0x25')](_0xb61f74));if(_0xb61f74[_0x57d0('0x26')]){if(_0xb61f74[_0x57d0('0x26')][_0x57d0('0x27')]===0x1f4){logger[_0x57d0('0x26')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bc944,_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);return _0x192710(_0xb61f74[_0x57d0('0x26')]['message']);}logger[_0x57d0('0x26')](_0x57d0('0x21'),_0x3bc944,_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);return _0x39d236(_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);}else{logger[_0x57d0('0x20')](_0x57d0('0x21'),_0x3bc944,_0x57d0('0x22'));_0x39d236(_0xb61f74['result']['message']);}})[_0x57d0('0x29')](function(_0x547700){logger[_0x57d0('0x26')](_0x57d0('0x21'),_0x3bc944,_0x547700);_0x192710(_0x547700);});});}function respondWithStatusCode(_0x116062,_0x5bb244){_0x5bb244=_0x5bb244||0xcc;return function(_0x2dd103){if(_0x2dd103){return _0x116062[_0x57d0('0x2a')](_0x5bb244);}return _0x116062[_0x57d0('0x2b')](_0x5bb244)[_0x57d0('0x2c')]();};}function respondWithResult(_0xa042a1,_0x4a2dfa){_0x4a2dfa=_0x4a2dfa||0xc8;return function(_0x235b6b){if(_0x235b6b){return _0xa042a1['status'](_0x4a2dfa)['json'](_0x235b6b);}};}function respondWithFilteredResult(_0x16ba8e,_0x198511){return function(_0x511732){if(_0x511732){var _0x568af4=_0x511732[_0x57d0('0x2d')],_0x1248ee=_0x198511[_0x57d0('0x2e')],_0xaf791=_0x198511[_0x57d0('0x2e')]+_0x198511[_0x57d0('0x2f')],_0x48e79;if(_0xaf791>=_0x568af4){_0xaf791=_0x568af4;_0x48e79=0xc8;}else{_0x48e79=0xce;}_0x16ba8e[_0x57d0('0x2b')](_0x48e79);return _0x16ba8e[_0x57d0('0x30')]('Content-Range',_0x1248ee+'-'+_0xaf791+'/'+_0x568af4)['json'](_0x511732);}return null;};}function patchUpdates(_0x4bff29){return function(_0x4777ca){try{jsonpatch[_0x57d0('0x31')](_0x4777ca,_0x4bff29,!![]);}catch(_0x5d2bd8){return BPromise['reject'](_0x5d2bd8);}return _0x4777ca[_0x57d0('0x32')]();};}function saveUpdates(_0x49e00c,_0x2150e9){return function(_0x19f9fb){if(_0x19f9fb){return _0x19f9fb[_0x57d0('0x33')](_0x49e00c)[_0x57d0('0x34')](function(_0x473877){return _0x473877;});}return null;};}function removeEntity(_0x59f888,_0x55c7fc){return function(_0x270775){if(_0x270775){return _0x270775[_0x57d0('0x35')]()[_0x57d0('0x34')](function(){_0x59f888[_0x57d0('0x2b')](0xcc)[_0x57d0('0x2c')]();});}};}function handleEntityNotFound(_0x4460e7,_0x4441de){return function(_0x4d188c){if(!_0x4d188c){_0x4460e7['sendStatus'](0x194);}return _0x4d188c;};}function handleError(_0x2058bf,_0xb97e23){_0xb97e23=_0xb97e23||0x1f4;return function(_0x26ae90){logger[_0x57d0('0x26')](_0x26ae90[_0x57d0('0x36')]);if(_0x26ae90[_0x57d0('0x37')]){delete _0x26ae90['name'];}_0x2058bf[_0x57d0('0x2b')](_0xb97e23)['send'](_0x26ae90);};}exports['index']=function(_0x3dbfbc,_0x4d6d4b){var _0x2ded2a={},_0x2b8ba0={},_0x42bc85={'count':0x0,'rows':[]};var _0x3b84b2=db[_0x57d0('0x38')]['rawAttributes'];_0x2b8ba0[_0x57d0('0x39')]=_['keys'](_0x3b84b2);_0x2b8ba0[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x3dbfbc[_0x57d0('0x3a')]);_0x2b8ba0['filters']=_['intersection'](_0x2b8ba0[_0x57d0('0x39')],_0x2b8ba0[_0x57d0('0x3a')]);_0x2ded2a[_0x57d0('0x3c')]=_['intersection'](_0x2b8ba0[_0x57d0('0x39')],qs['fields'](_0x3dbfbc['query'][_0x57d0('0x3d')]));_0x2ded2a[_0x57d0('0x3c')]=_0x2ded2a['attributes'][_0x57d0('0x3e')]?_0x2ded2a[_0x57d0('0x3c')]:_0x2b8ba0[_0x57d0('0x39')];if(!_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x3f')](_0x57d0('0x40'))){_0x2ded2a[_0x57d0('0x2f')]=qs['limit'](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0x2ded2a[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x2e')]);}_0x2ded2a['order']=qs[_0x57d0('0x41')](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x2ded2a['where']=qs[_0x57d0('0x42')](_['pick'](_0x3dbfbc[_0x57d0('0x3a')],_0x2b8ba0[_0x57d0('0x42')]));if(_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x2ded2a[_0x57d0('0x44')]=_['merge'](_0x2ded2a[_0x57d0('0x44')],{'$or':_['map'](_0x3b84b2,function(_0x5cabe0){if(_0x5cabe0[_0x57d0('0x45')][_0x57d0('0x46')]!==_0x57d0('0x47')){var _0x34d387={};_0x34d387[_0x5cabe0[_0x57d0('0x48')]]={'$like':'%'+_0x3dbfbc[_0x57d0('0x3a')]['filter']+'%'};return _0x34d387;}})});}_0x2ded2a=_[_0x57d0('0x49')]({},_0x2ded2a,_0x3dbfbc['options']);var _0x298d26={'where':_0x2ded2a[_0x57d0('0x44')]};return db[_0x57d0('0x38')][_0x57d0('0x2d')](_0x298d26)['then'](function(_0x3cf11e){_0x42bc85['count']=_0x3cf11e;if(_0x3dbfbc['query'][_0x57d0('0x4a')]){_0x2ded2a[_0x57d0('0x4b')]=[{'all':!![]}];}return db[_0x57d0('0x38')][_0x57d0('0x4c')](_0x2ded2a);})[_0x57d0('0x34')](function(_0x126b3e){_0x42bc85[_0x57d0('0x4d')]=_0x126b3e;return _0x42bc85;})['then'](respondWithFilteredResult(_0x4d6d4b,_0x2ded2a))['catch'](handleError(_0x4d6d4b,null));};exports[_0x57d0('0x4e')]=function(_0x14b094,_0x176847){var _0x5f543f={'raw':![],'where':{'id':_0x14b094[_0x57d0('0x4f')]['id']}},_0xea6c7f={};_0xea6c7f['model']=_[_0x57d0('0x3b')](db['FreshdeskConfiguration'][_0x57d0('0x50')]);_0xea6c7f[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x14b094[_0x57d0('0x3a')]);_0xea6c7f['filters']=_[_0x57d0('0x51')](_0xea6c7f[_0x57d0('0x39')],_0xea6c7f[_0x57d0('0x3a')]);_0x5f543f[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0xea6c7f[_0x57d0('0x39')],qs['fields'](_0x14b094[_0x57d0('0x3a')][_0x57d0('0x3d')]));_0x5f543f['attributes']=_0x5f543f[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x5f543f[_0x57d0('0x3c')]:_0xea6c7f['model'];if(_0x14b094[_0x57d0('0x3a')][_0x57d0('0x4a')]){_0x5f543f[_0x57d0('0x4b')]=[{'all':!![]}];}_0x5f543f=_['merge']({},_0x5f543f,_0x14b094[_0x57d0('0x52')]);return db['FreshdeskConfiguration'][_0x57d0('0x53')](_0x5f543f)['then'](handleEntityNotFound(_0x176847,null))[_0x57d0('0x34')](respondWithResult(_0x176847,null))[_0x57d0('0x29')](handleError(_0x176847,null));};exports[_0x57d0('0x54')]=function(_0x4c7552,_0x7beb1e){return db[_0x57d0('0x38')][_0x57d0('0x54')](_0x4c7552['body'],{})[_0x57d0('0x34')](respondWithResult(_0x7beb1e,0xc9))[_0x57d0('0x29')](handleError(_0x7beb1e,null));};exports['update']=function(_0x2fa69a,_0x1a9146){if(_0x2fa69a['body']['id']){delete _0x2fa69a[_0x57d0('0x55')]['id'];}return db[_0x57d0('0x38')][_0x57d0('0x53')]({'where':{'id':_0x2fa69a[_0x57d0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a9146,null))[_0x57d0('0x34')](saveUpdates(_0x2fa69a[_0x57d0('0x55')],null))['then'](respondWithResult(_0x1a9146,null))[_0x57d0('0x29')](handleError(_0x1a9146,null));};exports['destroy']=function(_0x3a21d1,_0x51bd1b){return db[_0x57d0('0x38')][_0x57d0('0x53')]({'where':{'id':_0x3a21d1[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x51bd1b,null))[_0x57d0('0x34')](removeEntity(_0x51bd1b,null))['catch'](handleError(_0x51bd1b,null));};exports[_0x57d0('0x56')]=function(_0x48d61,_0x147087,_0x1e1722){var _0x2d56b7={};var _0x565802={};var _0x3f1f84;var _0x1b7765;return db['FreshdeskConfiguration'][_0x57d0('0x57')]({'where':{'id':_0x48d61[_0x57d0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x147087,null))[_0x57d0('0x34')](function(_0x134fa0){if(_0x134fa0){_0x3f1f84=_0x134fa0;_0x565802['model']=_[_0x57d0('0x3b')](db[_0x57d0('0x58')]['rawAttributes']);_0x565802['query']=_[_0x57d0('0x3b')](_0x48d61[_0x57d0('0x3a')]);_0x565802[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x565802[_0x57d0('0x39')],_0x565802[_0x57d0('0x3a')]);_0x2d56b7[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x565802['model'],qs[_0x57d0('0x3d')](_0x48d61[_0x57d0('0x3a')]['fields']));_0x2d56b7[_0x57d0('0x3c')]=_0x2d56b7[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x2d56b7[_0x57d0('0x3c')]:_0x565802[_0x57d0('0x39')];_0x2d56b7[_0x57d0('0x59')]=qs[_0x57d0('0x41')](_0x48d61[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x2d56b7['where']=qs[_0x57d0('0x42')](_[_0x57d0('0x5a')](_0x48d61['query'],_0x565802[_0x57d0('0x42')]));if(_0x48d61[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x2d56b7[_0x57d0('0x44')]=_[_0x57d0('0x49')](_0x2d56b7['where'],{'$or':_['map'](_0x2d56b7['attributes'],function(_0x4ee44c){var _0x26278b={};_0x26278b[_0x4ee44c]={'$like':'%'+_0x48d61[_0x57d0('0x3a')]['filter']+'%'};return _0x26278b;})});}_0x2d56b7=_[_0x57d0('0x49')]({},_0x2d56b7,_0x48d61[_0x57d0('0x52')]);return _0x3f1f84[_0x57d0('0x56')](_0x2d56b7);}})[_0x57d0('0x34')](function(_0x3332bf){if(_0x3332bf){_0x1b7765=_0x3332bf['length'];if(!_0x48d61[_0x57d0('0x3a')]['hasOwnProperty']('nolimit')){_0x2d56b7[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x48d61['query'][_0x57d0('0x2f')]);_0x2d56b7[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x48d61['query'][_0x57d0('0x2e')]);}return _0x3f1f84[_0x57d0('0x56')](_0x2d56b7);}})[_0x57d0('0x34')](function(_0x177fbf){if(_0x177fbf){return _0x177fbf?{'count':_0x1b7765,'rows':_0x177fbf}:null;}})[_0x57d0('0x34')](respondWithResult(_0x147087,null))['catch'](handleError(_0x147087,null));};exports[_0x57d0('0x5b')]=function(_0x3690e4,_0x88ba71,_0x2ad2fe){var _0x5009ef={};var _0x41f34e={};var _0x28de65;var _0x230097;return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x3690e4[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x88ba71,null))[_0x57d0('0x34')](function(_0x57873f){if(_0x57873f){_0x28de65=_0x57873f;_0x41f34e[_0x57d0('0x39')]=_[_0x57d0('0x3b')](db[_0x57d0('0x58')][_0x57d0('0x50')]);_0x41f34e[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x3690e4[_0x57d0('0x3a')]);_0x41f34e[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x41f34e[_0x57d0('0x39')],_0x41f34e['query']);_0x5009ef['attributes']=_[_0x57d0('0x51')](_0x41f34e[_0x57d0('0x39')],qs[_0x57d0('0x3d')](_0x3690e4['query']['fields']));_0x5009ef['attributes']=_0x5009ef['attributes'][_0x57d0('0x3e')]?_0x5009ef[_0x57d0('0x3c')]:_0x41f34e[_0x57d0('0x39')];_0x5009ef[_0x57d0('0x59')]=qs['sort'](_0x3690e4[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x5009ef[_0x57d0('0x44')]=qs[_0x57d0('0x42')](_['pick'](_0x3690e4[_0x57d0('0x3a')],_0x41f34e[_0x57d0('0x42')]));if(_0x3690e4['query']['filter']){_0x5009ef[_0x57d0('0x44')]=_['merge'](_0x5009ef[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0x5009ef['attributes'],function(_0x459942){var _0x51e722={};_0x51e722[_0x459942]={'$like':'%'+_0x3690e4[_0x57d0('0x3a')][_0x57d0('0x43')]+'%'};return _0x51e722;})});}_0x5009ef=_[_0x57d0('0x49')]({},_0x5009ef,_0x3690e4[_0x57d0('0x52')]);return _0x28de65[_0x57d0('0x5b')](_0x5009ef);}})[_0x57d0('0x34')](function(_0xd39a37){if(_0xd39a37){_0x230097=_0xd39a37['length'];if(!_0x3690e4['query'][_0x57d0('0x3f')]('nolimit')){_0x5009ef['limit']=qs[_0x57d0('0x2f')](_0x3690e4['query'][_0x57d0('0x2f')]);_0x5009ef[_0x57d0('0x2e')]=qs['offset'](_0x3690e4['query'][_0x57d0('0x2e')]);}return _0x28de65[_0x57d0('0x5b')](_0x5009ef);}})[_0x57d0('0x34')](function(_0x71b1c8){if(_0x71b1c8){return _0x71b1c8?{'count':_0x230097,'rows':_0x71b1c8}:null;}})[_0x57d0('0x34')](respondWithResult(_0x88ba71,null))['catch'](handleError(_0x88ba71,null));};exports['getDescriptions']=function(_0x4e258f,_0x44341c,_0x2388c5){var _0x4f1a8a={};var _0x6e8296={};var _0x20df4a;var _0x309549;return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x4e258f[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x44341c,null))[_0x57d0('0x34')](function(_0x4f3b4a){if(_0x4f3b4a){_0x20df4a=_0x4f3b4a;_0x6e8296[_0x57d0('0x39')]=_[_0x57d0('0x3b')](db[_0x57d0('0x58')][_0x57d0('0x50')]);_0x6e8296[_0x57d0('0x3a')]=_['keys'](_0x4e258f[_0x57d0('0x3a')]);_0x6e8296[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x6e8296[_0x57d0('0x39')],_0x6e8296[_0x57d0('0x3a')]);_0x4f1a8a[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x6e8296[_0x57d0('0x39')],qs['fields'](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x3d')]));_0x4f1a8a[_0x57d0('0x3c')]=_0x4f1a8a[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x4f1a8a[_0x57d0('0x3c')]:_0x6e8296[_0x57d0('0x39')];_0x4f1a8a[_0x57d0('0x59')]=qs['sort'](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x4f1a8a[_0x57d0('0x44')]=qs[_0x57d0('0x42')](_['pick'](_0x4e258f[_0x57d0('0x3a')],_0x6e8296['filters']));if(_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x4f1a8a[_0x57d0('0x44')]=_['merge'](_0x4f1a8a[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0x4f1a8a[_0x57d0('0x3c')],function(_0xd5ce0a){var _0xff98da={};_0xff98da[_0xd5ce0a]={'$like':'%'+_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x43')]+'%'};return _0xff98da;})});}_0x4f1a8a=_[_0x57d0('0x49')]({},_0x4f1a8a,_0x4e258f[_0x57d0('0x52')]);return _0x20df4a[_0x57d0('0x5d')](_0x4f1a8a);}})[_0x57d0('0x34')](function(_0x3a099b){if(_0x3a099b){_0x309549=_0x3a099b['length'];if(!_0x4e258f[_0x57d0('0x3a')]['hasOwnProperty'](_0x57d0('0x40'))){_0x4f1a8a[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0x4f1a8a['offset']=qs['offset'](_0x4e258f[_0x57d0('0x3a')]['offset']);}return _0x20df4a[_0x57d0('0x5d')](_0x4f1a8a);}})[_0x57d0('0x34')](function(_0x100dc9){if(_0x100dc9){return _0x100dc9?{'count':_0x309549,'rows':_0x100dc9}:null;}})[_0x57d0('0x34')](respondWithResult(_0x44341c,null))['catch'](handleError(_0x44341c,null));};exports['getTags']=function(_0x1eb9cf,_0xb448cc,_0x5b99e0){var _0xac2d56={};var _0x3dd1d8={};var _0x2eb7c2;var _0x5dd564;return db[_0x57d0('0x38')]['findOne']({'where':{'id':_0x1eb9cf[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0xb448cc,null))[_0x57d0('0x34')](function(_0x497ce5){if(_0x497ce5){_0x2eb7c2=_0x497ce5;_0x3dd1d8[_0x57d0('0x39')]=_['keys'](db[_0x57d0('0x5e')]['rawAttributes']);_0x3dd1d8[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x1eb9cf['query']);_0x3dd1d8[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x3dd1d8[_0x57d0('0x39')],_0x3dd1d8[_0x57d0('0x3a')]);_0xac2d56[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x3dd1d8[_0x57d0('0x39')],qs[_0x57d0('0x3d')](_0x1eb9cf['query'][_0x57d0('0x3d')]));_0xac2d56['attributes']=_0xac2d56[_0x57d0('0x3c')]['length']?_0xac2d56[_0x57d0('0x3c')]:_0x3dd1d8[_0x57d0('0x39')];_0xac2d56[_0x57d0('0x59')]=qs['sort'](_0x1eb9cf[_0x57d0('0x3a')]['sort']);_0xac2d56[_0x57d0('0x44')]=qs['filters'](_[_0x57d0('0x5a')](_0x1eb9cf[_0x57d0('0x3a')],_0x3dd1d8[_0x57d0('0x42')]));if(_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x43')]){_0xac2d56['where']=_[_0x57d0('0x49')](_0xac2d56[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0xac2d56[_0x57d0('0x3c')],function(_0x450d0e){var _0xa7d82f={};_0xa7d82f[_0x450d0e]={'$like':'%'+_0x1eb9cf[_0x57d0('0x3a')]['filter']+'%'};return _0xa7d82f;})});}_0xac2d56=_[_0x57d0('0x49')]({},_0xac2d56,_0x1eb9cf['options']);return _0x2eb7c2[_0x57d0('0x5f')](_0xac2d56);}})[_0x57d0('0x34')](function(_0x10c15b){if(_0x10c15b){_0x5dd564=_0x10c15b[_0x57d0('0x3e')];if(!_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x3f')](_0x57d0('0x40'))){_0xac2d56[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0xac2d56[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x1eb9cf[_0x57d0('0x3a')]['offset']);}return _0x2eb7c2[_0x57d0('0x5f')](_0xac2d56);}})[_0x57d0('0x34')](function(_0x3d60bb){if(_0x3d60bb){return _0x3d60bb?{'count':_0x5dd564,'rows':_0x3d60bb}:null;}})[_0x57d0('0x34')](respondWithResult(_0xb448cc,null))[_0x57d0('0x29')](handleError(_0xb448cc,null));};exports[_0x57d0('0x60')]=function(_0x3c05e0,_0x271260,_0xb72082){if(_0x3c05e0[_0x57d0('0x55')]['id']){delete _0x3c05e0['body']['id'];}return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x3c05e0['params']['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x271260,null))[_0x57d0('0x34')](function(_0x3301c2){if(_0x3301c2){return _0x3301c2['setTags'](_0x3c05e0['body'][_0x57d0('0x61')]||[]);}return null;})[_0x57d0('0x34')](respondWithResult(_0x271260,null))['catch'](handleError(_0x271260,null));}; \ No newline at end of file +var _0x4dfd=['model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','include','findAll','params','intersection','length','merge','find','create','body','update','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes'];(function(_0x18efb0,_0x402155){var _0x463641=function(_0x7f44b1){while(--_0x7f44b1){_0x18efb0['push'](_0x18efb0['shift']());}};_0x463641(++_0x402155);}(_0x4dfd,0xde));var _0xd4df=function(_0x35a389,_0x22f0b1){_0x35a389=_0x35a389-0x0;var _0x1af60b=_0x4dfd[_0x35a389];return _0x1af60b;};'use strict';var pdf=require(_0xd4df('0x0'));var emlformat=require(_0xd4df('0x1'));var rimraf=require(_0xd4df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4df('0x3'));var rp=require(_0xd4df('0x4'));var moment=require(_0xd4df('0x5'));var BPromise=require(_0xd4df('0x6'));var Mustache=require(_0xd4df('0x7'));var util=require('util');var path=require(_0xd4df('0x8'));var sox=require(_0xd4df('0x9'));var csv=require(_0xd4df('0xa'));var ejs=require(_0xd4df('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4df('0xc'));var jsforce=require(_0xd4df('0xd'));var deskjs=require(_0xd4df('0xe'));var toCsv=require(_0xd4df('0xa'));var querystring=require('querystring');var Papa=require(_0xd4df('0xf'));var Redis=require(_0xd4df('0x10'));var authService=require(_0xd4df('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4df('0x12'))(_0xd4df('0x13'));var utils=require('../../config/utils');var config=require(_0xd4df('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd4df('0x15'));var client=jayson[_0xd4df('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x347f8b,_0x33a802,_0x4ef82a){if(_0x4ef82a){var _0xb85522=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb85522[_0xd4df('0x17')](_0x33a802)){return _0x347f8b;}else{throw new Error(_0xd4df('0x18'));}}else{return _0x347f8b;}}function respondWithRpcPromise(_0x56b02f,_0x34791f,_0x365a00,_0xb5c09e){return new BPromise(function(_0x1c8e07,_0x4ed131){var _0xa6eb41=_0xb5c09e||client;return _0xa6eb41['request'](_0x56b02f,_0x365a00)[_0xd4df('0x19')](function(_0x173d03){logger[_0xd4df('0x1a')](_0xd4df('0x1b'),_0x34791f,_0xd4df('0x1c'));logger[_0xd4df('0x1d')](_0xd4df('0x1e'),_0x34791f,_0xd4df('0x1c'),JSON['stringify'](_0x173d03));if(_0x173d03[_0xd4df('0x1f')]){if(_0x173d03[_0xd4df('0x1f')][_0xd4df('0x20')]===0x1f4){logger[_0xd4df('0x1f')](_0xd4df('0x1b'),_0x34791f,_0x173d03['error'][_0xd4df('0x21')]);return _0x4ed131(_0x173d03['error'][_0xd4df('0x21')]);}logger['error'](_0xd4df('0x1b'),_0x34791f,_0x173d03[_0xd4df('0x1f')]['message']);return _0x1c8e07(_0x173d03[_0xd4df('0x1f')][_0xd4df('0x21')]);}else{logger['info'](_0xd4df('0x1b'),_0x34791f,'request\x20sent');_0x1c8e07(_0x173d03[_0xd4df('0x22')][_0xd4df('0x21')]);}})[_0xd4df('0x23')](function(_0x60336a){logger[_0xd4df('0x1f')](_0xd4df('0x1b'),_0x34791f,_0x60336a);_0x4ed131(_0x60336a);});});}function respondWithStatusCode(_0x1afb4e,_0x523367){_0x523367=_0x523367||0xcc;return function(_0x4e0b18){if(_0x4e0b18){return _0x1afb4e[_0xd4df('0x24')](_0x523367);}return _0x1afb4e[_0xd4df('0x25')](_0x523367)[_0xd4df('0x26')]();};}function respondWithResult(_0x145d70,_0x438277){_0x438277=_0x438277||0xc8;return function(_0x50eacd){if(_0x50eacd){return _0x145d70[_0xd4df('0x25')](_0x438277)[_0xd4df('0x27')](_0x50eacd);}};}function respondWithFilteredResult(_0x34a7c0,_0x514d9d){return function(_0xeea21b){if(_0xeea21b){var _0x546978=_0xeea21b[_0xd4df('0x28')],_0x398802=_0x514d9d[_0xd4df('0x29')],_0x384cd0=_0x514d9d[_0xd4df('0x29')]+_0x514d9d[_0xd4df('0x2a')],_0x5da9a3;if(_0x384cd0>=_0x546978){_0x384cd0=_0x546978;_0x5da9a3=0xc8;}else{_0x5da9a3=0xce;}_0x34a7c0[_0xd4df('0x25')](_0x5da9a3);return _0x34a7c0[_0xd4df('0x2b')](_0xd4df('0x2c'),_0x398802+'-'+_0x384cd0+'/'+_0x546978)['json'](_0xeea21b);}return null;};}function patchUpdates(_0x4a993b){return function(_0x2d24e6){try{jsonpatch[_0xd4df('0x2d')](_0x2d24e6,_0x4a993b,!![]);}catch(_0x371c27){return BPromise['reject'](_0x371c27);}return _0x2d24e6[_0xd4df('0x2e')]();};}function saveUpdates(_0xe171d7,_0x243fc4){return function(_0x37ac26){if(_0x37ac26){return _0x37ac26['update'](_0xe171d7)[_0xd4df('0x19')](function(_0x5760e3){return _0x5760e3;});}return null;};}function removeEntity(_0x32c706,_0x1c0759){return function(_0x2417c8){if(_0x2417c8){return _0x2417c8[_0xd4df('0x2f')]()['then'](function(){_0x32c706[_0xd4df('0x25')](0xcc)[_0xd4df('0x26')]();});}};}function handleEntityNotFound(_0x574288,_0x597b92){return function(_0x25ee73){if(!_0x25ee73){_0x574288[_0xd4df('0x24')](0x194);}return _0x25ee73;};}function handleError(_0x820f63,_0x38506c){_0x38506c=_0x38506c||0x1f4;return function(_0x597f88){logger['error'](_0x597f88[_0xd4df('0x30')]);if(_0x597f88[_0xd4df('0x31')]){delete _0x597f88[_0xd4df('0x31')];}_0x820f63['status'](_0x38506c)[_0xd4df('0x32')](_0x597f88);};}exports[_0xd4df('0x33')]=function(_0x29b04e,_0x51ec07){var _0x118994={},_0x7c9b60={},_0x463371={'count':0x0,'rows':[]};var _0x49d348=db[_0xd4df('0x34')][_0xd4df('0x35')];_0x7c9b60[_0xd4df('0x36')]=_[_0xd4df('0x37')](_0x49d348);_0x7c9b60[_0xd4df('0x38')]=_[_0xd4df('0x37')](_0x29b04e[_0xd4df('0x38')]);_0x7c9b60['filters']=_['intersection'](_0x7c9b60[_0xd4df('0x36')],_0x7c9b60[_0xd4df('0x38')]);_0x118994[_0xd4df('0x39')]=_['intersection'](_0x7c9b60[_0xd4df('0x36')],qs[_0xd4df('0x3a')](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x118994[_0xd4df('0x39')]=_0x118994[_0xd4df('0x39')]['length']?_0x118994[_0xd4df('0x39')]:_0x7c9b60['model'];if(!_0x29b04e[_0xd4df('0x38')][_0xd4df('0x3b')](_0xd4df('0x3c'))){_0x118994['limit']=qs['limit'](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x118994['offset']=qs[_0xd4df('0x29')](_0x29b04e[_0xd4df('0x38')][_0xd4df('0x29')]);}_0x118994[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x29b04e['query'][_0xd4df('0x3e')]);_0x118994[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x29b04e[_0xd4df('0x38')],_0x7c9b60[_0xd4df('0x40')]));if(_0x29b04e[_0xd4df('0x38')][_0xd4df('0x42')]){_0x118994[_0xd4df('0x3f')]=_['merge'](_0x118994[_0xd4df('0x3f')],{'$or':_[_0xd4df('0x43')](_0x49d348,function(_0x2f3096){if(_0x2f3096[_0xd4df('0x44')][_0xd4df('0x45')]!==_0xd4df('0x46')){var _0x2e02ff={};_0x2e02ff[_0x2f3096[_0xd4df('0x47')]]={'$like':'%'+_0x29b04e['query'][_0xd4df('0x42')]+'%'};return _0x2e02ff;}})});}_0x118994=_['merge']({},_0x118994,_0x29b04e['options']);var _0x3361f4={'where':_0x118994[_0xd4df('0x3f')]};return db[_0xd4df('0x34')][_0xd4df('0x28')](_0x3361f4)[_0xd4df('0x19')](function(_0x5eaae2){_0x463371[_0xd4df('0x28')]=_0x5eaae2;if(_0x29b04e[_0xd4df('0x38')]['includeAll']){_0x118994[_0xd4df('0x48')]=[{'all':!![]}];}return db[_0xd4df('0x34')][_0xd4df('0x49')](_0x118994);})[_0xd4df('0x19')](function(_0x4f6565){_0x463371['rows']=_0x4f6565;return _0x463371;})[_0xd4df('0x19')](respondWithFilteredResult(_0x51ec07,_0x118994))[_0xd4df('0x23')](handleError(_0x51ec07,null));};exports['show']=function(_0x284e1d,_0x94c230){var _0x5105e1={'raw':![],'where':{'id':_0x284e1d[_0xd4df('0x4a')]['id']}},_0x251d29={};_0x251d29[_0xd4df('0x36')]=_[_0xd4df('0x37')](db['FreshdeskConfiguration']['rawAttributes']);_0x251d29[_0xd4df('0x38')]=_[_0xd4df('0x37')](_0x284e1d[_0xd4df('0x38')]);_0x251d29['filters']=_[_0xd4df('0x4b')](_0x251d29[_0xd4df('0x36')],_0x251d29[_0xd4df('0x38')]);_0x5105e1[_0xd4df('0x39')]=_['intersection'](_0x251d29[_0xd4df('0x36')],qs['fields'](_0x284e1d[_0xd4df('0x38')]['fields']));_0x5105e1['attributes']=_0x5105e1[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x5105e1[_0xd4df('0x39')]:_0x251d29[_0xd4df('0x36')];if(_0x284e1d[_0xd4df('0x38')]['includeAll']){_0x5105e1[_0xd4df('0x48')]=[{'all':!![]}];}_0x5105e1=_[_0xd4df('0x4d')]({},_0x5105e1,_0x284e1d['options']);return db[_0xd4df('0x34')][_0xd4df('0x4e')](_0x5105e1)[_0xd4df('0x19')](handleEntityNotFound(_0x94c230,null))[_0xd4df('0x19')](respondWithResult(_0x94c230,null))[_0xd4df('0x23')](handleError(_0x94c230,null));};exports['create']=function(_0x55e541,_0x171311){return db['FreshdeskConfiguration'][_0xd4df('0x4f')](_0x55e541[_0xd4df('0x50')],{})['then'](respondWithResult(_0x171311,0xc9))[_0xd4df('0x23')](handleError(_0x171311,null));};exports[_0xd4df('0x51')]=function(_0x4afab1,_0x1ece70){if(_0x4afab1[_0xd4df('0x50')]['id']){delete _0x4afab1[_0xd4df('0x50')]['id'];}return db[_0xd4df('0x34')]['find']({'where':{'id':_0x4afab1[_0xd4df('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ece70,null))[_0xd4df('0x19')](saveUpdates(_0x4afab1['body'],null))['then'](respondWithResult(_0x1ece70,null))[_0xd4df('0x23')](handleError(_0x1ece70,null));};exports['destroy']=function(_0xd54c91,_0x3d9eeb){return db[_0xd4df('0x34')][_0xd4df('0x4e')]({'where':{'id':_0xd54c91[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x3d9eeb,null))[_0xd4df('0x19')](removeEntity(_0x3d9eeb,null))[_0xd4df('0x23')](handleError(_0x3d9eeb,null));};exports[_0xd4df('0x52')]=function(_0x9b883b,_0x26558d,_0x4f1e54){var _0x129898={};var _0x2534e1={};var _0x2ac705;var _0x3a7a46;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x9b883b['params']['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x26558d,null))['then'](function(_0x4289be){if(_0x4289be){_0x2ac705=_0x4289be;_0x2534e1[_0xd4df('0x36')]=_['keys'](db[_0xd4df('0x54')][_0xd4df('0x35')]);_0x2534e1['query']=_['keys'](_0x9b883b[_0xd4df('0x38')]);_0x2534e1[_0xd4df('0x40')]=_['intersection'](_0x2534e1[_0xd4df('0x36')],_0x2534e1[_0xd4df('0x38')]);_0x129898[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x2534e1[_0xd4df('0x36')],qs[_0xd4df('0x3a')](_0x9b883b[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x129898[_0xd4df('0x39')]=_0x129898[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x129898[_0xd4df('0x39')]:_0x2534e1[_0xd4df('0x36')];_0x129898[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x9b883b[_0xd4df('0x38')]['sort']);_0x129898[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_['pick'](_0x9b883b[_0xd4df('0x38')],_0x2534e1[_0xd4df('0x40')]));if(_0x9b883b[_0xd4df('0x38')][_0xd4df('0x42')]){_0x129898['where']=_[_0xd4df('0x4d')](_0x129898['where'],{'$or':_['map'](_0x129898['attributes'],function(_0x13ab71){var _0x1ac70d={};_0x1ac70d[_0x13ab71]={'$like':'%'+_0x9b883b[_0xd4df('0x38')]['filter']+'%'};return _0x1ac70d;})});}_0x129898=_[_0xd4df('0x4d')]({},_0x129898,_0x9b883b[_0xd4df('0x55')]);return _0x2ac705[_0xd4df('0x52')](_0x129898);}})[_0xd4df('0x19')](function(_0x3e08ba){if(_0x3e08ba){_0x3a7a46=_0x3e08ba[_0xd4df('0x4c')];if(!_0x9b883b[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x129898['limit']=qs['limit'](_0x9b883b[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x129898['offset']=qs['offset'](_0x9b883b['query'][_0xd4df('0x29')]);}return _0x2ac705[_0xd4df('0x52')](_0x129898);}})[_0xd4df('0x19')](function(_0x1d3bc5){if(_0x1d3bc5){return _0x1d3bc5?{'count':_0x3a7a46,'rows':_0x1d3bc5}:null;}})[_0xd4df('0x19')](respondWithResult(_0x26558d,null))[_0xd4df('0x23')](handleError(_0x26558d,null));};exports[_0xd4df('0x56')]=function(_0x1fb932,_0x4cf069,_0xeb60db){var _0x21cf08={};var _0x53bec1={};var _0x384623;var _0x3c01bd;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x1fb932[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x4cf069,null))[_0xd4df('0x19')](function(_0x299bfe){if(_0x299bfe){_0x384623=_0x299bfe;_0x53bec1[_0xd4df('0x36')]=_[_0xd4df('0x37')](db['FreshdeskField'][_0xd4df('0x35')]);_0x53bec1['query']=_[_0xd4df('0x37')](_0x1fb932['query']);_0x53bec1[_0xd4df('0x40')]=_[_0xd4df('0x4b')](_0x53bec1[_0xd4df('0x36')],_0x53bec1[_0xd4df('0x38')]);_0x21cf08[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x53bec1[_0xd4df('0x36')],qs['fields'](_0x1fb932['query'][_0xd4df('0x3a')]));_0x21cf08['attributes']=_0x21cf08[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x21cf08['attributes']:_0x53bec1['model'];_0x21cf08[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x1fb932[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x21cf08[_0xd4df('0x3f')]=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x1fb932[_0xd4df('0x38')],_0x53bec1[_0xd4df('0x40')]));if(_0x1fb932['query'][_0xd4df('0x42')]){_0x21cf08[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x21cf08[_0xd4df('0x3f')],{'$or':_['map'](_0x21cf08[_0xd4df('0x39')],function(_0x58fc86){var _0x4f459e={};_0x4f459e[_0x58fc86]={'$like':'%'+_0x1fb932['query'][_0xd4df('0x42')]+'%'};return _0x4f459e;})});}_0x21cf08=_[_0xd4df('0x4d')]({},_0x21cf08,_0x1fb932[_0xd4df('0x55')]);return _0x384623['getSubjects'](_0x21cf08);}})[_0xd4df('0x19')](function(_0x2b96bc){if(_0x2b96bc){_0x3c01bd=_0x2b96bc[_0xd4df('0x4c')];if(!_0x1fb932[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x21cf08[_0xd4df('0x2a')]=qs['limit'](_0x1fb932['query']['limit']);_0x21cf08[_0xd4df('0x29')]=qs[_0xd4df('0x29')](_0x1fb932[_0xd4df('0x38')][_0xd4df('0x29')]);}return _0x384623[_0xd4df('0x56')](_0x21cf08);}})[_0xd4df('0x19')](function(_0x13ddbc){if(_0x13ddbc){return _0x13ddbc?{'count':_0x3c01bd,'rows':_0x13ddbc}:null;}})[_0xd4df('0x19')](respondWithResult(_0x4cf069,null))[_0xd4df('0x23')](handleError(_0x4cf069,null));};exports[_0xd4df('0x57')]=function(_0x4f58ce,_0x590016,_0xf7c30b){var _0x24c294={};var _0x5934b1={};var _0x4fadef;var _0x4b469a;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4f58ce[_0xd4df('0x4a')]['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x590016,null))['then'](function(_0x4577ec){if(_0x4577ec){_0x4fadef=_0x4577ec;_0x5934b1[_0xd4df('0x36')]=_['keys'](db[_0xd4df('0x54')][_0xd4df('0x35')]);_0x5934b1['query']=_[_0xd4df('0x37')](_0x4f58ce[_0xd4df('0x38')]);_0x5934b1[_0xd4df('0x40')]=_[_0xd4df('0x4b')](_0x5934b1[_0xd4df('0x36')],_0x5934b1[_0xd4df('0x38')]);_0x24c294[_0xd4df('0x39')]=_['intersection'](_0x5934b1['model'],qs[_0xd4df('0x3a')](_0x4f58ce['query']['fields']));_0x24c294['attributes']=_0x24c294[_0xd4df('0x39')][_0xd4df('0x4c')]?_0x24c294[_0xd4df('0x39')]:_0x5934b1[_0xd4df('0x36')];_0x24c294[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x24c294[_0xd4df('0x3f')]=qs['filters'](_[_0xd4df('0x41')](_0x4f58ce[_0xd4df('0x38')],_0x5934b1[_0xd4df('0x40')]));if(_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x42')]){_0x24c294[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x24c294[_0xd4df('0x3f')],{'$or':_[_0xd4df('0x43')](_0x24c294['attributes'],function(_0x2374f7){var _0x4ee28e={};_0x4ee28e[_0x2374f7]={'$like':'%'+_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x42')]+'%'};return _0x4ee28e;})});}_0x24c294=_[_0xd4df('0x4d')]({},_0x24c294,_0x4f58ce[_0xd4df('0x55')]);return _0x4fadef[_0xd4df('0x57')](_0x24c294);}})[_0xd4df('0x19')](function(_0xa8935){if(_0xa8935){_0x4b469a=_0xa8935['length'];if(!_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x3b')]('nolimit')){_0x24c294[_0xd4df('0x2a')]=qs[_0xd4df('0x2a')](_0x4f58ce['query'][_0xd4df('0x2a')]);_0x24c294[_0xd4df('0x29')]=qs['offset'](_0x4f58ce[_0xd4df('0x38')][_0xd4df('0x29')]);}return _0x4fadef[_0xd4df('0x57')](_0x24c294);}})[_0xd4df('0x19')](function(_0x11af33){if(_0x11af33){return _0x11af33?{'count':_0x4b469a,'rows':_0x11af33}:null;}})['then'](respondWithResult(_0x590016,null))[_0xd4df('0x23')](handleError(_0x590016,null));};exports[_0xd4df('0x58')]=function(_0x343bca,_0x339723,_0x2101ae){var _0x3d39ed={};var _0x10b0e2={};var _0x39ab9e;var _0x968b3;return db[_0xd4df('0x34')][_0xd4df('0x53')]({'where':{'id':_0x343bca[_0xd4df('0x4a')]['id']}})['then'](handleEntityNotFound(_0x339723,null))['then'](function(_0xa299e3){if(_0xa299e3){_0x39ab9e=_0xa299e3;_0x10b0e2['model']=_[_0xd4df('0x37')](db[_0xd4df('0x59')]['rawAttributes']);_0x10b0e2[_0xd4df('0x38')]=_['keys'](_0x343bca[_0xd4df('0x38')]);_0x10b0e2[_0xd4df('0x40')]=_['intersection'](_0x10b0e2[_0xd4df('0x36')],_0x10b0e2[_0xd4df('0x38')]);_0x3d39ed[_0xd4df('0x39')]=_[_0xd4df('0x4b')](_0x10b0e2['model'],qs[_0xd4df('0x3a')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x3a')]));_0x3d39ed[_0xd4df('0x39')]=_0x3d39ed['attributes']['length']?_0x3d39ed[_0xd4df('0x39')]:_0x10b0e2['model'];_0x3d39ed[_0xd4df('0x3d')]=qs[_0xd4df('0x3e')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x3e')]);_0x3d39ed['where']=qs[_0xd4df('0x40')](_[_0xd4df('0x41')](_0x343bca[_0xd4df('0x38')],_0x10b0e2[_0xd4df('0x40')]));if(_0x343bca[_0xd4df('0x38')][_0xd4df('0x42')]){_0x3d39ed[_0xd4df('0x3f')]=_[_0xd4df('0x4d')](_0x3d39ed['where'],{'$or':_[_0xd4df('0x43')](_0x3d39ed[_0xd4df('0x39')],function(_0x3fbfca){var _0x5f543={};_0x5f543[_0x3fbfca]={'$like':'%'+_0x343bca[_0xd4df('0x38')][_0xd4df('0x42')]+'%'};return _0x5f543;})});}_0x3d39ed=_['merge']({},_0x3d39ed,_0x343bca[_0xd4df('0x55')]);return _0x39ab9e[_0xd4df('0x58')](_0x3d39ed);}})[_0xd4df('0x19')](function(_0x18ac97){if(_0x18ac97){_0x968b3=_0x18ac97[_0xd4df('0x4c')];if(!_0x343bca['query'][_0xd4df('0x3b')](_0xd4df('0x3c'))){_0x3d39ed[_0xd4df('0x2a')]=qs[_0xd4df('0x2a')](_0x343bca[_0xd4df('0x38')][_0xd4df('0x2a')]);_0x3d39ed[_0xd4df('0x29')]=qs[_0xd4df('0x29')](_0x343bca['query'][_0xd4df('0x29')]);}return _0x39ab9e['getTags'](_0x3d39ed);}})[_0xd4df('0x19')](function(_0x499af3){if(_0x499af3){return _0x499af3?{'count':_0x968b3,'rows':_0x499af3}:null;}})[_0xd4df('0x19')](respondWithResult(_0x339723,null))['catch'](handleError(_0x339723,null));};exports[_0xd4df('0x5a')]=function(_0x49b8fe,_0x43fb38,_0x567f45){if(_0x49b8fe[_0xd4df('0x50')]['id']){delete _0x49b8fe[_0xd4df('0x50')]['id'];}return db['FreshdeskConfiguration'][_0xd4df('0x53')]({'where':{'id':_0x49b8fe['params']['id']}})[_0xd4df('0x19')](handleEntityNotFound(_0x43fb38,null))[_0xd4df('0x19')](function(_0x2ccf15){if(_0x2ccf15){return _0x2ccf15['setTags'](_0x49b8fe[_0xd4df('0x50')][_0xd4df('0x5b')]||[]);}return null;})[_0xd4df('0x19')](respondWithResult(_0x43fb38,null))[_0xd4df('0x23')](handleError(_0x43fb38,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1339c17..0a09f68 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 _0x70e8=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x209497,_0x311317){var _0x4882d4=function(_0x574888){while(--_0x574888){_0x209497['push'](_0x209497['shift']());}};_0x4882d4(++_0x311317);}(_0x70e8,0x106));var _0x870e=function(_0x1b1772,_0x44cd65){_0x1b1772=_0x1b1772-0x0;var _0x176510=_0x70e8[_0x1b1772];return _0x176510;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var logger=require(_0x870e('0x2'))(_0x870e('0x3'));var moment=require('moment');var BPromise=require(_0x870e('0x4'));var rp=require(_0x870e('0x5'));var fs=require('fs');var path=require(_0x870e('0x6'));var rimraf=require(_0x870e('0x7'));var config=require(_0x870e('0x8'));var attributes=require(_0x870e('0x9'));module[_0x870e('0xa')]=function(_0x470560,_0x36fcc4){return _0x470560[_0x870e('0xb')](_0x870e('0xc'),attributes,{'tableName':_0x870e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39e6=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash'];(function(_0x2cb46b,_0x494af0){var _0x3ec2c7=function(_0x3728a3){while(--_0x3728a3){_0x2cb46b['push'](_0x2cb46b['shift']());}};_0x3ec2c7(++_0x494af0);}(_0x39e6,0x173));var _0x639e=function(_0x2f4022,_0x35dc81){_0x2f4022=_0x2f4022-0x0;var _0x266444=_0x39e6[_0x2f4022];return _0x266444;};'use strict';var _=require(_0x639e('0x0'));var util=require(_0x639e('0x1'));var logger=require(_0x639e('0x2'))(_0x639e('0x3'));var moment=require(_0x639e('0x4'));var BPromise=require('bluebird');var rp=require(_0x639e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x639e('0x6'));var config=require(_0x639e('0x7'));var attributes=require(_0x639e('0x8'));module[_0x639e('0x9')]=function(_0x1bb298,_0x3dfef1){return _0x1bb298[_0x639e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x639e('0xb'),'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 bd2714d..345c7ea 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 _0x6f5a=['util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x6f5a,0x10f));var _0xa6f5=function(_0x194494,_0x57c76e){_0x194494=_0x194494-0x0;var _0x45acaf=_0x6f5a[_0x194494];return _0x45acaf;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa6f5('0x2'));var fs=require('fs');var Redis=require(_0xa6f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6f5('0x4'));var logger=require('../../config/logger')(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x299fc0,_0x40cceb,_0x54c201){return new BPromise(function(_0x497224,_0x9b188d){return client[_0xa6f5('0x7')](_0x299fc0,_0x54c201)[_0xa6f5('0x8')](function(_0xda660a){logger['info'](_0xa6f5('0x9'),_0x40cceb,_0xa6f5('0xa'));logger['debug'](_0xa6f5('0xb'),_0x40cceb,_0xa6f5('0xa'),JSON['stringify'](_0xda660a));if(_0xda660a['error']){if(_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xd')]===0x1f4){logger[_0xa6f5('0xc')](_0xa6f5('0x9'),_0x40cceb,_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);return _0x9b188d(_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);}logger[_0xa6f5('0xc')](_0xa6f5('0x9'),_0x40cceb,_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);return _0x497224(_0xda660a[_0xa6f5('0xc')]['message']);}else{logger['info'](_0xa6f5('0x9'),_0x40cceb,'request\x20sent');_0x497224(_0xda660a[_0xa6f5('0xf')][_0xa6f5('0xe')]);}})[_0xa6f5('0x10')](function(_0x84ee59){logger[_0xa6f5('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x40cceb,_0x84ee59);_0x9b188d(_0x84ee59);});});} \ No newline at end of file +var _0xcf4c=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf4c,0x163));var _0xccf4=function(_0xc2c7e,_0x55a9fe){_0xc2c7e=_0xc2c7e-0x0;var _0x54d105=_0xcf4c[_0xc2c7e];return _0x54d105;};'use strict';var _=require(_0xccf4('0x0'));var util=require(_0xccf4('0x1'));var moment=require(_0xccf4('0x2'));var BPromise=require(_0xccf4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccf4('0x4'));var db=require(_0xccf4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xccf4('0x6'))(_0xccf4('0x7'));var config=require(_0xccf4('0x8'));var jayson=require(_0xccf4('0x9'));var client=jayson[_0xccf4('0xa')][_0xccf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318b45,_0xeb4169,_0x3e1725){return new BPromise(function(_0x44d1a6,_0x134fc7){return client['request'](_0x318b45,_0x3e1725)[_0xccf4('0xc')](function(_0x417e92){logger[_0xccf4('0xd')](_0xccf4('0xe'),_0xeb4169,_0xccf4('0xf'));logger[_0xccf4('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xeb4169,'request\x20sent',JSON[_0xccf4('0x11')](_0x417e92));if(_0x417e92[_0xccf4('0x12')]){if(_0x417e92['error']['code']===0x1f4){logger[_0xccf4('0x12')](_0xccf4('0xe'),_0xeb4169,_0x417e92[_0xccf4('0x12')][_0xccf4('0x13')]);return _0x134fc7(_0x417e92['error'][_0xccf4('0x13')]);}logger[_0xccf4('0x12')](_0xccf4('0xe'),_0xeb4169,_0x417e92['error'][_0xccf4('0x13')]);return _0x44d1a6(_0x417e92[_0xccf4('0x12')]['message']);}else{logger[_0xccf4('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xeb4169,_0xccf4('0xf'));_0x44d1a6(_0x417e92[_0xccf4('0x14')][_0xccf4('0x13')]);}})['catch'](function(_0x549966){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0xeb4169,_0x549966);_0x134fc7(_0x549966);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 2002288..12ee4c1 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 _0x1c2e=['express','Router','../../components/interaction/service','./intFreshdeskField.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c2e,0x186));var _0xe1c2=function(_0x2e2457,_0xb3805a){_0x2e2457=_0x2e2457-0x0;var _0x491473=_0x1c2e[_0x2e2457];return _0x491473;};'use strict';var multer=require('multer');var util=require(_0xe1c2('0x0'));var path=require(_0xe1c2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe1c2('0x2'));var router=express[_0xe1c2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe1c2('0x4'));var config=require('../../config/environment');var controller=require(_0xe1c2('0x5'));router[_0xe1c2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1c2('0x6')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe1c2('0x9')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller[_0xe1c2('0xa')]);router[_0xe1c2('0xb')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller[_0xe1c2('0xc')]);module[_0xe1c2('0xd')]=router; \ No newline at end of file +var _0x9039=['/:id','show','post','create','update','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index'];(function(_0x97eeef,_0xab42c5){var _0x5d8a3b=function(_0xeb3910){while(--_0xeb3910){_0x97eeef['push'](_0x97eeef['shift']());}};_0x5d8a3b(++_0xab42c5);}(_0x9039,0x1ab));var _0x9903=function(_0x22beab,_0x410db5){_0x22beab=_0x22beab-0x0;var _0x39f010=_0x9039[_0x22beab];return _0x39f010;};'use strict';var multer=require('multer');var util=require(_0x9903('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9903('0x1'));var router=express['Router']();var auth=require(_0x9903('0x2'));var interaction=require(_0x9903('0x3'));var config=require('../../config/environment');var controller=require(_0x9903('0x4'));router[_0x9903('0x5')]('/',auth[_0x9903('0x6')](),controller[_0x9903('0x7')]);router['get'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0x9')]);router[_0x9903('0xa')]('/',auth[_0x9903('0x6')](),controller[_0x9903('0xb')]);router['put'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0xc')]);router['delete'](_0x9903('0x8'),auth[_0x9903('0x6')](),controller[_0x9903('0xd')]);module[_0x9903('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 19d6a04..c8d2c4e 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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x26cfb2,_0x1a565f){var _0x4a6275=function(_0x5b4e17){while(--_0x5b4e17){_0x26cfb2['push'](_0x26cfb2['shift']());}};_0x4a6275(++_0x1a565f);}(_0xb688,0xcf));var _0x8b68=function(_0x1c6ae8,_0x4f4527){_0x1c6ae8=_0x1c6ae8-0x0;var _0x48fd3d=_0xb688[_0x1c6ae8];return _0x48fd3d;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file +var _0xe5b5=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xe5b5[_0xe719ec];return _0x4842a1;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'type':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'),_0x5e5b('0x6')),'defaultValue':_0x5e5b('0x3')},'content':{'type':Sequelize[_0x5e5b('0x7')]},'key':{'type':Sequelize[_0x5e5b('0x7')]},'keyType':{'type':Sequelize[_0x5e5b('0x2')](_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5'))},'keyContent':{'type':Sequelize[_0x5e5b('0x7')]},'idField':{'type':Sequelize[_0x5e5b('0x7')]},'nameField':{'type':Sequelize[_0x5e5b('0x7')]},'customField':{'type':Sequelize[_0x5e5b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e5b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 0152276..faa4717 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 _0x22f0=['offset','set','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count'];(function(_0x2dc5d5,_0x2ec894){var _0x3f390e=function(_0x51d41b){while(--_0x51d41b){_0x2dc5d5['push'](_0x2dc5d5['shift']());}};_0x3f390e(++_0x2ec894);}(_0x22f0,0x193));var _0x022f=function(_0x3f20a5,_0x5bbeda){_0x3f20a5=_0x3f20a5-0x0;var _0x168ec6=_0x22f0[_0x3f20a5];return _0x168ec6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x022f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x022f('0x1'));var rp=require(_0x022f('0x2'));var moment=require(_0x022f('0x3'));var BPromise=require(_0x022f('0x4'));var Mustache=require(_0x022f('0x5'));var util=require('util');var path=require(_0x022f('0x6'));var sox=require(_0x022f('0x7'));var csv=require(_0x022f('0x8'));var ejs=require(_0x022f('0x9'));var fs=require('fs');var _=require(_0x022f('0xa'));var squel=require(_0x022f('0xb'));var crypto=require(_0x022f('0xc'));var jsforce=require(_0x022f('0xd'));var deskjs=require(_0x022f('0xe'));var toCsv=require(_0x022f('0x8'));var querystring=require(_0x022f('0xf'));var Papa=require(_0x022f('0x10'));var Redis=require(_0x022f('0x11'));var authService=require(_0x022f('0x12'));var qs=require(_0x022f('0x13'));var hardwareService=require(_0x022f('0x14'));var logger=require(_0x022f('0x15'))(_0x022f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x022f('0x17'))['db'];function respondWithStatusCode(_0x2e69b6,_0x5dd312){_0x5dd312=_0x5dd312||0xcc;return function(_0x1ce858){if(_0x1ce858){return _0x2e69b6[_0x022f('0x18')](_0x5dd312);}return _0x2e69b6['status'](_0x5dd312)[_0x022f('0x19')]();};}function respondWithResult(_0xc54273,_0x1937e5){_0x1937e5=_0x1937e5||0xc8;return function(_0x2b52a3){if(_0x2b52a3){return _0xc54273[_0x022f('0x1a')](_0x1937e5)[_0x022f('0x1b')](_0x2b52a3);}};}function respondWithFilteredResult(_0x521324,_0x4e9a2f){return function(_0x218f24){if(_0x218f24){var _0x2f1429=_0x218f24[_0x022f('0x1c')],_0x35e0ce=_0x4e9a2f['offset'],_0x3b3eab=_0x4e9a2f[_0x022f('0x1d')]+_0x4e9a2f['limit'],_0x419e09;if(_0x3b3eab>=_0x2f1429){_0x3b3eab=_0x2f1429;_0x419e09=0xc8;}else{_0x419e09=0xce;}_0x521324[_0x022f('0x1a')](_0x419e09);return _0x521324[_0x022f('0x1e')]('Content-Range',_0x35e0ce+'-'+_0x3b3eab+'/'+_0x2f1429)[_0x022f('0x1b')](_0x218f24);}return null;};}function patchUpdates(_0x2d0001){return function(_0x3dcbeb){try{jsonpatch['apply'](_0x3dcbeb,_0x2d0001,!![]);}catch(_0x586762){return BPromise[_0x022f('0x1f')](_0x586762);}return _0x3dcbeb['save']();};}function saveUpdates(_0x583f2c,_0x2f950c){return function(_0x33906e){if(_0x33906e){return _0x33906e[_0x022f('0x20')](_0x583f2c)[_0x022f('0x21')](function(_0x13f71b){return _0x13f71b;});}return null;};}function removeEntity(_0x44e56e,_0x43bed7){return function(_0x3cc9c6){if(_0x3cc9c6){return _0x3cc9c6[_0x022f('0x22')]()[_0x022f('0x21')](function(){_0x44e56e[_0x022f('0x1a')](0xcc)[_0x022f('0x19')]();});}};}function handleEntityNotFound(_0x395bcc,_0xb9ecc1){return function(_0x4d5b37){if(!_0x4d5b37){_0x395bcc[_0x022f('0x18')](0x194);}return _0x4d5b37;};}function handleError(_0x174f44,_0x50fedc){_0x50fedc=_0x50fedc||0x1f4;return function(_0x1878be){logger[_0x022f('0x23')](_0x1878be[_0x022f('0x24')]);if(_0x1878be[_0x022f('0x25')]){delete _0x1878be[_0x022f('0x25')];}_0x174f44[_0x022f('0x1a')](_0x50fedc)[_0x022f('0x26')](_0x1878be);};}exports[_0x022f('0x27')]=function(_0x444503,_0x275d21){var _0x24787c={},_0xb54d80={},_0x3e0df8={'count':0x0,'rows':[]};var _0x4ae3cb=db[_0x022f('0x28')][_0x022f('0x29')];_0xb54d80[_0x022f('0x2a')]=_[_0x022f('0x2b')](_0x4ae3cb);_0xb54d80[_0x022f('0x2c')]=_['keys'](_0x444503[_0x022f('0x2c')]);_0xb54d80[_0x022f('0x2d')]=_[_0x022f('0x2e')](_0xb54d80[_0x022f('0x2a')],_0xb54d80[_0x022f('0x2c')]);_0x24787c[_0x022f('0x2f')]=_[_0x022f('0x2e')](_0xb54d80['model'],qs[_0x022f('0x30')](_0x444503[_0x022f('0x2c')][_0x022f('0x30')]));_0x24787c[_0x022f('0x2f')]=_0x24787c[_0x022f('0x2f')][_0x022f('0x31')]?_0x24787c['attributes']:_0xb54d80[_0x022f('0x2a')];if(!_0x444503[_0x022f('0x2c')][_0x022f('0x32')]('nolimit')){_0x24787c[_0x022f('0x33')]=qs[_0x022f('0x33')](_0x444503[_0x022f('0x2c')][_0x022f('0x33')]);_0x24787c[_0x022f('0x1d')]=qs[_0x022f('0x1d')](_0x444503[_0x022f('0x2c')][_0x022f('0x1d')]);}_0x24787c[_0x022f('0x34')]=qs[_0x022f('0x35')](_0x444503[_0x022f('0x2c')][_0x022f('0x35')]);_0x24787c['where']=qs[_0x022f('0x2d')](_[_0x022f('0x36')](_0x444503[_0x022f('0x2c')],_0xb54d80[_0x022f('0x2d')]));if(_0x444503[_0x022f('0x2c')][_0x022f('0x37')]){_0x24787c[_0x022f('0x38')]=_['merge'](_0x24787c[_0x022f('0x38')],{'$or':_[_0x022f('0x39')](_0x4ae3cb,function(_0x3a9ac6){if(_0x3a9ac6[_0x022f('0x3a')]['key']!==_0x022f('0x3b')){var _0x2f0ce6={};_0x2f0ce6[_0x3a9ac6[_0x022f('0x3c')]]={'$like':'%'+_0x444503[_0x022f('0x2c')][_0x022f('0x37')]+'%'};return _0x2f0ce6;}})});}_0x24787c=_[_0x022f('0x3d')]({},_0x24787c,_0x444503['options']);var _0x17f796={'where':_0x24787c[_0x022f('0x38')]};return db[_0x022f('0x28')][_0x022f('0x1c')](_0x17f796)[_0x022f('0x21')](function(_0x35b098){_0x3e0df8[_0x022f('0x1c')]=_0x35b098;if(_0x444503[_0x022f('0x2c')][_0x022f('0x3e')]){_0x24787c[_0x022f('0x3f')]=[{'all':!![]}];}return db[_0x022f('0x28')][_0x022f('0x40')](_0x24787c);})[_0x022f('0x21')](function(_0x379bfa){_0x3e0df8[_0x022f('0x41')]=_0x379bfa;return _0x3e0df8;})[_0x022f('0x21')](respondWithFilteredResult(_0x275d21,_0x24787c))[_0x022f('0x42')](handleError(_0x275d21,null));};exports['show']=function(_0x28bc27,_0x4eadd8){var _0x3e46d3={'raw':!![],'where':{'id':_0x28bc27[_0x022f('0x43')]['id']}},_0x234b0f={};_0x234b0f[_0x022f('0x2a')]=_[_0x022f('0x2b')](db[_0x022f('0x28')][_0x022f('0x29')]);_0x234b0f[_0x022f('0x2c')]=_[_0x022f('0x2b')](_0x28bc27[_0x022f('0x2c')]);_0x234b0f[_0x022f('0x2d')]=_['intersection'](_0x234b0f[_0x022f('0x2a')],_0x234b0f[_0x022f('0x2c')]);_0x3e46d3[_0x022f('0x2f')]=_[_0x022f('0x2e')](_0x234b0f[_0x022f('0x2a')],qs['fields'](_0x28bc27[_0x022f('0x2c')][_0x022f('0x30')]));_0x3e46d3['attributes']=_0x3e46d3['attributes']['length']?_0x3e46d3[_0x022f('0x2f')]:_0x234b0f[_0x022f('0x2a')];if(_0x28bc27[_0x022f('0x2c')][_0x022f('0x3e')]){_0x3e46d3[_0x022f('0x3f')]=[{'all':!![]}];}_0x3e46d3=_['merge']({},_0x3e46d3,_0x28bc27[_0x022f('0x44')]);return db[_0x022f('0x28')][_0x022f('0x45')](_0x3e46d3)[_0x022f('0x21')](handleEntityNotFound(_0x4eadd8,null))[_0x022f('0x21')](respondWithResult(_0x4eadd8,null))[_0x022f('0x42')](handleError(_0x4eadd8,null));};exports[_0x022f('0x46')]=function(_0x24579f,_0x1453cb){return db['FreshdeskField'][_0x022f('0x46')](_0x24579f[_0x022f('0x47')],{})[_0x022f('0x21')](respondWithResult(_0x1453cb,0xc9))['catch'](handleError(_0x1453cb,null));};exports[_0x022f('0x20')]=function(_0x5744c7,_0x126ddb){if(_0x5744c7[_0x022f('0x47')]['id']){delete _0x5744c7[_0x022f('0x47')]['id'];}return db[_0x022f('0x28')][_0x022f('0x45')]({'where':{'id':_0x5744c7[_0x022f('0x43')]['id']}})[_0x022f('0x21')](handleEntityNotFound(_0x126ddb,null))[_0x022f('0x21')](saveUpdates(_0x5744c7[_0x022f('0x47')],null))[_0x022f('0x21')](respondWithResult(_0x126ddb,null))['catch'](handleError(_0x126ddb,null));};exports[_0x022f('0x22')]=function(_0x215f09,_0x5ccfd8){return db['FreshdeskField']['find']({'where':{'id':_0x215f09[_0x022f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ccfd8,null))['then'](removeEntity(_0x5ccfd8,null))['catch'](handleError(_0x5ccfd8,null));}; \ No newline at end of file +var _0x6437=['squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','key','VIRTUAL','field','options','include','catch','show','includeAll','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0x6437,0x152));var _0x7643=function(_0xcf2509,_0x585310){_0xcf2509=_0xcf2509-0x0;var _0x280016=_0x6437[_0xcf2509];return _0x280016;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7643('0x0'));var rimraf=require(_0x7643('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7643('0x2'));var rp=require(_0x7643('0x3'));var moment=require(_0x7643('0x4'));var BPromise=require(_0x7643('0x5'));var Mustache=require(_0x7643('0x6'));var util=require('util');var path=require(_0x7643('0x7'));var sox=require(_0x7643('0x8'));var csv=require(_0x7643('0x9'));var ejs=require(_0x7643('0xa'));var fs=require('fs');var _=require(_0x7643('0xb'));var squel=require(_0x7643('0xc'));var crypto=require('crypto');var jsforce=require(_0x7643('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7643('0x9'));var querystring=require(_0x7643('0xe'));var Papa=require(_0x7643('0xf'));var Redis=require(_0x7643('0x10'));var authService=require(_0x7643('0x11'));var qs=require(_0x7643('0x12'));var hardwareService=require(_0x7643('0x13'));var logger=require(_0x7643('0x14'))(_0x7643('0x15'));var utils=require(_0x7643('0x16'));var config=require(_0x7643('0x17'));var db=require(_0x7643('0x18'))['db'];function respondWithStatusCode(_0x24b164,_0x16e76e){_0x16e76e=_0x16e76e||0xcc;return function(_0x2527b9){if(_0x2527b9){return _0x24b164[_0x7643('0x19')](_0x16e76e);}return _0x24b164[_0x7643('0x1a')](_0x16e76e)[_0x7643('0x1b')]();};}function respondWithResult(_0x420b95,_0x41f5d8){_0x41f5d8=_0x41f5d8||0xc8;return function(_0x5d3e98){if(_0x5d3e98){return _0x420b95['status'](_0x41f5d8)[_0x7643('0x1c')](_0x5d3e98);}};}function respondWithFilteredResult(_0x5a2a39,_0x311f12){return function(_0x3edabc){if(_0x3edabc){var _0x3469a7=_0x3edabc[_0x7643('0x1d')],_0x12a751=_0x311f12[_0x7643('0x1e')],_0x3f46d3=_0x311f12[_0x7643('0x1e')]+_0x311f12[_0x7643('0x1f')],_0x38e045;if(_0x3f46d3>=_0x3469a7){_0x3f46d3=_0x3469a7;_0x38e045=0xc8;}else{_0x38e045=0xce;}_0x5a2a39[_0x7643('0x1a')](_0x38e045);return _0x5a2a39[_0x7643('0x20')]('Content-Range',_0x12a751+'-'+_0x3f46d3+'/'+_0x3469a7)[_0x7643('0x1c')](_0x3edabc);}return null;};}function patchUpdates(_0x2cc517){return function(_0x1aefa6){try{jsonpatch[_0x7643('0x21')](_0x1aefa6,_0x2cc517,!![]);}catch(_0x3efadb){return BPromise[_0x7643('0x22')](_0x3efadb);}return _0x1aefa6[_0x7643('0x23')]();};}function saveUpdates(_0x17e6c2,_0x5867cf){return function(_0xad22ce){if(_0xad22ce){return _0xad22ce['update'](_0x17e6c2)[_0x7643('0x24')](function(_0x1e7a91){return _0x1e7a91;});}return null;};}function removeEntity(_0x44442,_0xc6da2e){return function(_0x2c1008){if(_0x2c1008){return _0x2c1008[_0x7643('0x25')]()[_0x7643('0x24')](function(){_0x44442['status'](0xcc)[_0x7643('0x1b')]();});}};}function handleEntityNotFound(_0x39d942,_0x36e2b3){return function(_0x31c1a9){if(!_0x31c1a9){_0x39d942[_0x7643('0x19')](0x194);}return _0x31c1a9;};}function handleError(_0x58189d,_0x4732b0){_0x4732b0=_0x4732b0||0x1f4;return function(_0x41d73c){logger[_0x7643('0x26')](_0x41d73c[_0x7643('0x27')]);if(_0x41d73c[_0x7643('0x28')]){delete _0x41d73c['name'];}_0x58189d['status'](_0x4732b0)['send'](_0x41d73c);};}exports['index']=function(_0x3a8abc,_0x4f4030){var _0x4a8162={},_0x5ca0fb={},_0x54ecd7={'count':0x0,'rows':[]};var _0x53bbc0=db[_0x7643('0x29')][_0x7643('0x2a')];_0x5ca0fb[_0x7643('0x2b')]=_[_0x7643('0x2c')](_0x53bbc0);_0x5ca0fb['query']=_[_0x7643('0x2c')](_0x3a8abc[_0x7643('0x2d')]);_0x5ca0fb[_0x7643('0x2e')]=_[_0x7643('0x2f')](_0x5ca0fb[_0x7643('0x2b')],_0x5ca0fb['query']);_0x4a8162[_0x7643('0x30')]=_['intersection'](_0x5ca0fb[_0x7643('0x2b')],qs[_0x7643('0x31')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x31')]));_0x4a8162[_0x7643('0x30')]=_0x4a8162[_0x7643('0x30')][_0x7643('0x32')]?_0x4a8162['attributes']:_0x5ca0fb[_0x7643('0x2b')];if(!_0x3a8abc['query']['hasOwnProperty'](_0x7643('0x33'))){_0x4a8162['limit']=qs[_0x7643('0x1f')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x1f')]);_0x4a8162['offset']=qs['offset'](_0x3a8abc[_0x7643('0x2d')]['offset']);}_0x4a8162[_0x7643('0x34')]=qs[_0x7643('0x35')](_0x3a8abc[_0x7643('0x2d')][_0x7643('0x35')]);_0x4a8162['where']=qs[_0x7643('0x2e')](_['pick'](_0x3a8abc[_0x7643('0x2d')],_0x5ca0fb[_0x7643('0x2e')]));if(_0x3a8abc['query'][_0x7643('0x36')]){_0x4a8162[_0x7643('0x37')]=_[_0x7643('0x38')](_0x4a8162[_0x7643('0x37')],{'$or':_['map'](_0x53bbc0,function(_0x54948f){if(_0x54948f['type'][_0x7643('0x39')]!==_0x7643('0x3a')){var _0x19f741={};_0x19f741[_0x54948f[_0x7643('0x3b')]]={'$like':'%'+_0x3a8abc[_0x7643('0x2d')][_0x7643('0x36')]+'%'};return _0x19f741;}})});}_0x4a8162=_[_0x7643('0x38')]({},_0x4a8162,_0x3a8abc[_0x7643('0x3c')]);var _0xdc64f4={'where':_0x4a8162[_0x7643('0x37')]};return db['FreshdeskField']['count'](_0xdc64f4)[_0x7643('0x24')](function(_0x40db2a){_0x54ecd7['count']=_0x40db2a;if(_0x3a8abc[_0x7643('0x2d')]['includeAll']){_0x4a8162[_0x7643('0x3d')]=[{'all':!![]}];}return db[_0x7643('0x29')]['findAll'](_0x4a8162);})[_0x7643('0x24')](function(_0x5636cb){_0x54ecd7['rows']=_0x5636cb;return _0x54ecd7;})[_0x7643('0x24')](respondWithFilteredResult(_0x4f4030,_0x4a8162))[_0x7643('0x3e')](handleError(_0x4f4030,null));};exports[_0x7643('0x3f')]=function(_0x4660ee,_0x3c5cb9){var _0x4784b4={'raw':!![],'where':{'id':_0x4660ee['params']['id']}},_0x840e24={};_0x840e24['model']=_['keys'](db[_0x7643('0x29')]['rawAttributes']);_0x840e24['query']=_[_0x7643('0x2c')](_0x4660ee[_0x7643('0x2d')]);_0x840e24[_0x7643('0x2e')]=_[_0x7643('0x2f')](_0x840e24[_0x7643('0x2b')],_0x840e24['query']);_0x4784b4[_0x7643('0x30')]=_[_0x7643('0x2f')](_0x840e24['model'],qs['fields'](_0x4660ee[_0x7643('0x2d')][_0x7643('0x31')]));_0x4784b4[_0x7643('0x30')]=_0x4784b4[_0x7643('0x30')][_0x7643('0x32')]?_0x4784b4['attributes']:_0x840e24[_0x7643('0x2b')];if(_0x4660ee[_0x7643('0x2d')][_0x7643('0x40')]){_0x4784b4[_0x7643('0x3d')]=[{'all':!![]}];}_0x4784b4=_[_0x7643('0x38')]({},_0x4784b4,_0x4660ee['options']);return db[_0x7643('0x29')][_0x7643('0x41')](_0x4784b4)['then'](handleEntityNotFound(_0x3c5cb9,null))[_0x7643('0x24')](respondWithResult(_0x3c5cb9,null))['catch'](handleError(_0x3c5cb9,null));};exports[_0x7643('0x42')]=function(_0x1feb30,_0x12f9c6){return db[_0x7643('0x29')][_0x7643('0x42')](_0x1feb30[_0x7643('0x43')],{})[_0x7643('0x24')](respondWithResult(_0x12f9c6,0xc9))[_0x7643('0x3e')](handleError(_0x12f9c6,null));};exports[_0x7643('0x44')]=function(_0x2df794,_0x249c2d){if(_0x2df794[_0x7643('0x43')]['id']){delete _0x2df794[_0x7643('0x43')]['id'];}return db[_0x7643('0x29')]['find']({'where':{'id':_0x2df794['params']['id']}})[_0x7643('0x24')](handleEntityNotFound(_0x249c2d,null))[_0x7643('0x24')](saveUpdates(_0x2df794[_0x7643('0x43')],null))['then'](respondWithResult(_0x249c2d,null))[_0x7643('0x3e')](handleError(_0x249c2d,null));};exports['destroy']=function(_0x29dd88,_0x2fb258){return db[_0x7643('0x29')]['find']({'where':{'id':_0x29dd88[_0x7643('0x45')]['id']}})[_0x7643('0x24')](handleEntityNotFound(_0x2fb258,null))[_0x7643('0x24')](removeEntity(_0x2fb258,null))['catch'](handleError(_0x2fb258,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ad3c630..a6e08eb 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 _0x1705=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x306527,_0x3873db){var _0x47ce18=function(_0x1419d3){while(--_0x1419d3){_0x306527['push'](_0x306527['shift']());}};_0x47ce18(++_0x3873db);}(_0x1705,0xe6));var _0x5170=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x1705[_0x10e840];return _0x405caa;};'use strict';var _=require(_0x5170('0x0'));var util=require(_0x5170('0x1'));var logger=require(_0x5170('0x2'))(_0x5170('0x3'));var moment=require('moment');var BPromise=require(_0x5170('0x4'));var rp=require(_0x5170('0x5'));var fs=require('fs');var path=require(_0x5170('0x6'));var rimraf=require(_0x5170('0x7'));var config=require(_0x5170('0x8'));var attributes=require(_0x5170('0x9'));module['exports']=function(_0x1453c8,_0x127b58){return _0x1453c8[_0x5170('0xa')](_0x5170('0xb'),attributes,{'tableName':_0x5170('0xc'),'paranoid':![],'indexes':[{'name':_0x5170('0xd'),'fields':[_0x5170('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x61a0=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','api','request-promise','rimraf','./intFreshdeskField.attributes','exports'];(function(_0x366ac7,_0x1b3148){var _0xed932a=function(_0x531fff){while(--_0x531fff){_0x366ac7['push'](_0x366ac7['shift']());}};_0xed932a(++_0x1b3148);}(_0x61a0,0x1a9));var _0x061a=function(_0x4b573a,_0x13828a){_0x4b573a=_0x4b573a-0x0;var _0x1ae343=_0x61a0[_0x4b573a];return _0x1ae343;};'use strict';var _=require(_0x061a('0x0'));var util=require(_0x061a('0x1'));var logger=require('../../config/logger')(_0x061a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x061a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x061a('0x4'));var config=require('../../config/environment');var attributes=require(_0x061a('0x5'));module[_0x061a('0x6')]=function(_0xd2d139,_0x71e24e){return _0xd2d139[_0x061a('0x7')](_0x061a('0x8'),attributes,{'tableName':_0x061a('0x9'),'paranoid':![],'indexes':[{'name':_0x061a('0xa'),'fields':['idField',_0x061a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index cbadfb5..3303f44 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 _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5c660a,_0x4b5262){var _0x3a77a4=function(_0x479c95){while(--_0x479c95){_0x5c660a['push'](_0x5c660a['shift']());}};_0x3a77a4(++_0x4b5262);}(_0x5089,0x1bb));var _0x9508=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x5089[_0x29bf80];return _0x932096;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});} \ No newline at end of file +var _0xec56=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xec56,0x1bd));var _0x6ec5=function(_0x537f56,_0x5055ef){_0x537f56=_0x537f56-0x0;var _0x317172=_0xec56[_0x537f56];return _0x317172;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec5('0x1'));var rs=require(_0x6ec5('0x2'));var fs=require('fs');var Redis=require(_0x6ec5('0x3'));var db=require(_0x6ec5('0x4'))['db'];var utils=require(_0x6ec5('0x5'));var logger=require(_0x6ec5('0x6'))(_0x6ec5('0x7'));var config=require(_0x6ec5('0x8'));var jayson=require(_0x6ec5('0x9'));var client=jayson[_0x6ec5('0xa')][_0x6ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb683,_0x35be4e,_0x1f59cd){return new BPromise(function(_0x3dd891,_0x225d2f){return client[_0x6ec5('0xc')](_0x3bb683,_0x1f59cd)[_0x6ec5('0xd')](function(_0x3ff17c){logger['info'](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));logger[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x35be4e,_0x6ec5('0xf'),JSON[_0x6ec5('0x12')](_0x3ff17c));if(_0x3ff17c[_0x6ec5('0x13')]){if(_0x3ff17c['error'][_0x6ec5('0x14')]===0x1f4){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);return _0x225d2f(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}logger[_0x6ec5('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x35be4e,_0x3ff17c[_0x6ec5('0x13')]['message']);return _0x3dd891(_0x3ff17c[_0x6ec5('0x13')][_0x6ec5('0x15')]);}else{logger[_0x6ec5('0x16')](_0x6ec5('0xe'),_0x35be4e,_0x6ec5('0xf'));_0x3dd891(_0x3ff17c['result'][_0x6ec5('0x15')]);}})[_0x6ec5('0x17')](function(_0x125ae6){logger[_0x6ec5('0x13')](_0x6ec5('0xe'),_0x35be4e,_0x125ae6);_0x225d2f(_0x125ae6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 27e577b..2ad0b26 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 _0x3dd3=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x49cd4c,_0x1c3aee){var _0x470ee5=function(_0x365446){while(--_0x365446){_0x49cd4c['push'](_0x49cd4c['shift']());}};_0x470ee5(++_0x1c3aee);}(_0x3dd3,0x185));var _0x33dd=function(_0x1bd413,_0x362007){_0x1bd413=_0x1bd413-0x0;var _0x4c853f=_0x3dd3[_0x1bd413];return _0x4c853f;};'use strict';var multer=require(_0x33dd('0x0'));var util=require(_0x33dd('0x1'));var path=require(_0x33dd('0x2'));var timeout=require(_0x33dd('0x3'));var express=require(_0x33dd('0x4'));var router=express[_0x33dd('0x5')]();var auth=require(_0x33dd('0x6'));var interaction=require(_0x33dd('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0x33dd('0x8')]('/',auth[_0x33dd('0x9')](),controller['index']);router[_0x33dd('0x8')](_0x33dd('0xa'),auth['isAuthenticated'](),controller[_0x33dd('0xb')]);router[_0x33dd('0x8')](_0x33dd('0xc'),auth[_0x33dd('0x9')](),controller[_0x33dd('0xd')]);router['get'](_0x33dd('0xe'),auth[_0x33dd('0x9')](),controller['getFields']);router[_0x33dd('0xf')]('/',auth[_0x33dd('0x9')](),controller[_0x33dd('0x10')]);router[_0x33dd('0xf')](_0x33dd('0xc'),auth[_0x33dd('0x9')](),controller['addConfiguration']);router[_0x33dd('0x11')]('/:id',auth[_0x33dd('0x9')](),controller['update']);router['delete']('/:id',auth[_0x33dd('0x9')](),controller['destroy']);module[_0x33dd('0x12')]=router; \ No newline at end of file +var _0x8107=['get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index'];(function(_0x1afaec,_0x1a69f1){var _0x14db6e=function(_0x1240a2){while(--_0x1240a2){_0x1afaec['push'](_0x1afaec['shift']());}};_0x14db6e(++_0x1a69f1);}(_0x8107,0x1bd));var _0x7810=function(_0x5aa1e2,_0x2b5adb){_0x5aa1e2=_0x5aa1e2-0x0;var _0x399098=_0x8107[_0x5aa1e2];return _0x399098;};'use strict';var multer=require(_0x7810('0x0'));var util=require(_0x7810('0x1'));var path=require('path');var timeout=require(_0x7810('0x2'));var express=require(_0x7810('0x3'));var router=express[_0x7810('0x4')]();var auth=require(_0x7810('0x5'));var interaction=require(_0x7810('0x6'));var config=require(_0x7810('0x7'));var controller=require(_0x7810('0x8'));router['get']('/',auth[_0x7810('0x9')](),controller[_0x7810('0xa')]);router[_0x7810('0xb')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller[_0x7810('0xd')]);router['get'](_0x7810('0xe'),auth[_0x7810('0x9')](),controller[_0x7810('0xf')]);router['get'](_0x7810('0x10'),auth['isAuthenticated'](),controller[_0x7810('0x11')]);router[_0x7810('0x12')]('/',auth[_0x7810('0x9')](),controller[_0x7810('0x13')]);router[_0x7810('0x12')](_0x7810('0xe'),auth[_0x7810('0x9')](),controller[_0x7810('0x14')]);router[_0x7810('0x15')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller['update']);router[_0x7810('0x16')](_0x7810('0xc'),auth[_0x7810('0x9')](),controller[_0x7810('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 66bed6e..66fb99e 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 _0xb9f4=['sequelize','STRING','ENUM','integrationTab','newTab'];(function(_0x50f08f,_0x477116){var _0x19ab53=function(_0x391787){while(--_0x391787){_0x50f08f['push'](_0x50f08f['shift']());}};_0x19ab53(++_0x477116);}(_0xb9f4,0xff));var _0x4b9f=function(_0x3d12f3,_0x4be54a){_0x3d12f3=_0x3d12f3-0x0;var _0x50d40d=_0xb9f4[_0x3d12f3];return _0x50d40d;};'use strict';var Sequelize=require(_0x4b9f('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b9f('0x1')]},'description':{'type':Sequelize[_0x4b9f('0x1')]},'username':{'type':Sequelize[_0x4b9f('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4b9f('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4b9f('0x1')]},'clientSecret':{'type':Sequelize[_0x4b9f('0x1')]},'securityToken':{'type':Sequelize[_0x4b9f('0x1')]},'serverUrl':{'type':Sequelize[_0x4b9f('0x1')]},'type':{'type':Sequelize[_0x4b9f('0x2')](_0x4b9f('0x3'),_0x4b9f('0x4')),'defaultValue':_0x4b9f('0x3')}}; \ No newline at end of file +var _0xd6c4=['newTab','sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x465f8f,_0x19eaa9){var _0x30198d=function(_0x57dd48){while(--_0x57dd48){_0x465f8f['push'](_0x465f8f['shift']());}};_0x30198d(++_0x19eaa9);}(_0xd6c4,0xfd));var _0x4d6c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4d6c('0x0'));module[_0x4d6c('0x1')]={'name':{'type':Sequelize[_0x4d6c('0x2')]},'description':{'type':Sequelize[_0x4d6c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4d6c('0x2')]},'password':{'type':Sequelize[_0x4d6c('0x2')]},'clientId':{'type':Sequelize[_0x4d6c('0x2')]},'clientSecret':{'type':Sequelize[_0x4d6c('0x2')]},'securityToken':{'type':Sequelize[_0x4d6c('0x2')]},'serverUrl':{'type':Sequelize[_0x4d6c('0x2')]},'type':{'type':Sequelize[_0x4d6c('0x3')](_0x4d6c('0x4'),_0x4d6c('0x5')),'defaultValue':_0x4d6c('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index d840d74..03ef1eb 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 _0xedd1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','map','type','field','options','includeAll','include','findAll','rows','catch','params','merge','find','create','body','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','username','securityToken','slice','Connection','clientSecret','password','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','remove','custom','includes','label','picklistValues','boolean','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x288dbc,_0x422195){var _0x547988=function(_0x3c66d2){while(--_0x3c66d2){_0x288dbc['push'](_0x288dbc['shift']());}};_0x547988(++_0x422195);}(_0xedd1,0xf2));var _0x1edd=function(_0x5775c4,_0x11631c){_0x5775c4=_0x5775c4-0x0;var _0xa2e3a1=_0xedd1[_0x5775c4];return _0xa2e3a1;};'use strict';var pdf=require(_0x1edd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1edd('0x1'));var zipdir=require(_0x1edd('0x2'));var jsonpatch=require(_0x1edd('0x3'));var rp=require(_0x1edd('0x4'));var moment=require(_0x1edd('0x5'));var BPromise=require(_0x1edd('0x6'));var Mustache=require(_0x1edd('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1edd('0x8'));var ejs=require(_0x1edd('0x9'));var fs=require('fs');var _=require(_0x1edd('0xa'));var squel=require(_0x1edd('0xb'));var crypto=require('crypto');var jsforce=require(_0x1edd('0xc'));var deskjs=require(_0x1edd('0xd'));var toCsv=require(_0x1edd('0x8'));var querystring=require('querystring');var Papa=require(_0x1edd('0xe'));var Redis=require(_0x1edd('0xf'));var authService=require(_0x1edd('0x10'));var qs=require(_0x1edd('0x11'));var hardwareService=require(_0x1edd('0x12'));var logger=require(_0x1edd('0x13'))(_0x1edd('0x14'));var utils=require(_0x1edd('0x15'));var config=require(_0x1edd('0x16'));var db=require(_0x1edd('0x17'))['db'];var integrations=require(_0x1edd('0x18'));var jayson=require(_0x1edd('0x19'));var client=jayson['client'][_0x1edd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x17f6e7,_0x5843cc,_0x5a76e2){if(_0x5a76e2){var _0x5286de=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5286de[_0x1edd('0x1b')](_0x5843cc)){return _0x17f6e7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17f6e7;}}function respondWithRpcPromise(_0x415975,_0x3d4e30,_0x1a3d3b,_0x536b43){return new BPromise(function(_0x190bc8,_0x19d479){var _0xa32634=_0x536b43||client;return _0xa32634[_0x1edd('0x1c')](_0x415975,_0x1a3d3b)[_0x1edd('0x1d')](function(_0x480a55){logger[_0x1edd('0x1e')](_0x1edd('0x1f'),_0x3d4e30,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3d4e30,_0x1edd('0x20'),JSON[_0x1edd('0x21')](_0x480a55));if(_0x480a55[_0x1edd('0x22')]){if(_0x480a55[_0x1edd('0x22')]['code']===0x1f4){logger['error'](_0x1edd('0x1f'),_0x3d4e30,_0x480a55['error'][_0x1edd('0x23')]);return _0x19d479(_0x480a55[_0x1edd('0x22')][_0x1edd('0x23')]);}logger[_0x1edd('0x22')](_0x1edd('0x1f'),_0x3d4e30,_0x480a55['error'][_0x1edd('0x23')]);return _0x190bc8(_0x480a55['error']['message']);}else{logger['info'](_0x1edd('0x1f'),_0x3d4e30,_0x1edd('0x20'));_0x190bc8(_0x480a55[_0x1edd('0x24')][_0x1edd('0x23')]);}})['catch'](function(_0x986755){logger[_0x1edd('0x22')]('SalesforceAccount,\x20%s,\x20%s',_0x3d4e30,_0x986755);_0x19d479(_0x986755);});});}function respondWithStatusCode(_0x133a33,_0x489121){_0x489121=_0x489121||0xcc;return function(_0x4c81e5){if(_0x4c81e5){return _0x133a33[_0x1edd('0x25')](_0x489121);}return _0x133a33[_0x1edd('0x26')](_0x489121)[_0x1edd('0x27')]();};}function respondWithResult(_0x3399fb,_0x1420ce){_0x1420ce=_0x1420ce||0xc8;return function(_0x2cdbf7){if(_0x2cdbf7){return _0x3399fb[_0x1edd('0x26')](_0x1420ce)['json'](_0x2cdbf7);}};}function respondWithFilteredResult(_0x5a5d80,_0x3523bd){return function(_0x194db7){if(_0x194db7){var _0x21701a=_0x194db7[_0x1edd('0x28')],_0x39faae=_0x3523bd[_0x1edd('0x29')],_0xc3e989=_0x3523bd[_0x1edd('0x29')]+_0x3523bd[_0x1edd('0x2a')],_0x59ef54;if(_0xc3e989>=_0x21701a){_0xc3e989=_0x21701a;_0x59ef54=0xc8;}else{_0x59ef54=0xce;}_0x5a5d80[_0x1edd('0x26')](_0x59ef54);return _0x5a5d80[_0x1edd('0x2b')](_0x1edd('0x2c'),_0x39faae+'-'+_0xc3e989+'/'+_0x21701a)['json'](_0x194db7);}return null;};}function patchUpdates(_0x49c00a){return function(_0x14f09b){try{jsonpatch['apply'](_0x14f09b,_0x49c00a,!![]);}catch(_0x31ca8d){return BPromise['reject'](_0x31ca8d);}return _0x14f09b[_0x1edd('0x2d')]();};}function saveUpdates(_0x2cd117,_0x2c17ef){return function(_0x2a84c8){if(_0x2a84c8){return _0x2a84c8[_0x1edd('0x2e')](_0x2cd117)[_0x1edd('0x1d')](function(_0x31635b){return _0x31635b;});}return null;};}function removeEntity(_0xbbce0a,_0x58c60d){return function(_0x6c3fac){if(_0x6c3fac){return _0x6c3fac[_0x1edd('0x2f')]()[_0x1edd('0x1d')](function(){_0xbbce0a[_0x1edd('0x26')](0xcc)[_0x1edd('0x27')]();});}};}function handleEntityNotFound(_0x4e24ad,_0x4df78e){return function(_0x519458){if(!_0x519458){_0x4e24ad['sendStatus'](0x194);}return _0x519458;};}function handleError(_0x5b3b7d,_0x24455f){_0x24455f=_0x24455f||0x1f4;return function(_0x372f4b){logger['error'](_0x372f4b[_0x1edd('0x30')]);if(_0x372f4b[_0x1edd('0x31')]){delete _0x372f4b[_0x1edd('0x31')];}_0x5b3b7d[_0x1edd('0x26')](_0x24455f)[_0x1edd('0x32')](_0x372f4b);};}exports[_0x1edd('0x33')]=function(_0x1b6f9d,_0x303a38){var _0x37f3b2={},_0x259cea={},_0x404bf4={'count':0x0,'rows':[]};var _0x54c024=db[_0x1edd('0x34')][_0x1edd('0x35')];_0x259cea[_0x1edd('0x36')]=_[_0x1edd('0x37')](_0x54c024);_0x259cea['query']=_[_0x1edd('0x37')](_0x1b6f9d[_0x1edd('0x38')]);_0x259cea['filters']=_[_0x1edd('0x39')](_0x259cea[_0x1edd('0x36')],_0x259cea[_0x1edd('0x38')]);_0x37f3b2[_0x1edd('0x3a')]=_[_0x1edd('0x39')](_0x259cea['model'],qs[_0x1edd('0x3b')](_0x1b6f9d[_0x1edd('0x38')]['fields']));_0x37f3b2[_0x1edd('0x3a')]=_0x37f3b2[_0x1edd('0x3a')][_0x1edd('0x3c')]?_0x37f3b2[_0x1edd('0x3a')]:_0x259cea[_0x1edd('0x36')];if(!_0x1b6f9d[_0x1edd('0x38')]['hasOwnProperty'](_0x1edd('0x3d'))){_0x37f3b2[_0x1edd('0x2a')]=qs[_0x1edd('0x2a')](_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x2a')]);_0x37f3b2['offset']=qs[_0x1edd('0x29')](_0x1b6f9d[_0x1edd('0x38')]['offset']);}_0x37f3b2['order']=qs['sort'](_0x1b6f9d['query'][_0x1edd('0x3e')]);_0x37f3b2[_0x1edd('0x3f')]=qs[_0x1edd('0x40')](_[_0x1edd('0x41')](_0x1b6f9d[_0x1edd('0x38')],_0x259cea[_0x1edd('0x40')]));if(_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x42')]){_0x37f3b2[_0x1edd('0x3f')]=_['merge'](_0x37f3b2['where'],{'$or':_[_0x1edd('0x43')](_0x54c024,function(_0x24cd43){if(_0x24cd43[_0x1edd('0x44')]['key']!=='VIRTUAL'){var _0x1bbdaf={};_0x1bbdaf[_0x24cd43[_0x1edd('0x45')]]={'$like':'%'+_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x42')]+'%'};return _0x1bbdaf;}})});}_0x37f3b2=_['merge']({},_0x37f3b2,_0x1b6f9d[_0x1edd('0x46')]);var _0x4966ea={'where':_0x37f3b2[_0x1edd('0x3f')]};return db[_0x1edd('0x34')][_0x1edd('0x28')](_0x4966ea)[_0x1edd('0x1d')](function(_0x488c07){_0x404bf4[_0x1edd('0x28')]=_0x488c07;if(_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x47')]){_0x37f3b2[_0x1edd('0x48')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x1edd('0x49')](_0x37f3b2);})['then'](function(_0xdad261){_0x404bf4[_0x1edd('0x4a')]=_0xdad261;return _0x404bf4;})[_0x1edd('0x1d')](respondWithFilteredResult(_0x303a38,_0x37f3b2))[_0x1edd('0x4b')](handleError(_0x303a38,null));};exports['show']=function(_0x4b81ec,_0x4efea6){var _0x1d038a={'raw':![],'where':{'id':_0x4b81ec[_0x1edd('0x4c')]['id']}},_0xfe287d={};_0xfe287d[_0x1edd('0x36')]=_['keys'](db[_0x1edd('0x34')][_0x1edd('0x35')]);_0xfe287d[_0x1edd('0x38')]=_[_0x1edd('0x37')](_0x4b81ec[_0x1edd('0x38')]);_0xfe287d[_0x1edd('0x40')]=_[_0x1edd('0x39')](_0xfe287d[_0x1edd('0x36')],_0xfe287d[_0x1edd('0x38')]);_0x1d038a['attributes']=_[_0x1edd('0x39')](_0xfe287d[_0x1edd('0x36')],qs[_0x1edd('0x3b')](_0x4b81ec['query'][_0x1edd('0x3b')]));_0x1d038a[_0x1edd('0x3a')]=_0x1d038a[_0x1edd('0x3a')]['length']?_0x1d038a['attributes']:_0xfe287d[_0x1edd('0x36')];if(_0x4b81ec['query']['includeAll']){_0x1d038a[_0x1edd('0x48')]=[{'all':!![]}];}_0x1d038a=_[_0x1edd('0x4d')]({},_0x1d038a,_0x4b81ec[_0x1edd('0x46')]);return db[_0x1edd('0x34')][_0x1edd('0x4e')](_0x1d038a)[_0x1edd('0x1d')](handleEntityNotFound(_0x4efea6,null))[_0x1edd('0x1d')](respondWithResult(_0x4efea6,null))[_0x1edd('0x4b')](handleError(_0x4efea6,null));};exports[_0x1edd('0x4f')]=function(_0xd73af3,_0x24960d){return db[_0x1edd('0x34')][_0x1edd('0x4f')](_0xd73af3[_0x1edd('0x50')],{})[_0x1edd('0x1d')](respondWithResult(_0x24960d,0xc9))['catch'](handleError(_0x24960d,null));};exports[_0x1edd('0x2e')]=function(_0x9f594e,_0x32f661){if(_0x9f594e['body']['id']){delete _0x9f594e[_0x1edd('0x50')]['id'];}return db[_0x1edd('0x34')][_0x1edd('0x4e')]({'where':{'id':_0x9f594e[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x32f661,null))['then'](saveUpdates(_0x9f594e['body'],null))['then'](respondWithResult(_0x32f661,null))['catch'](handleError(_0x32f661,null));};exports['destroy']=function(_0x1161a0,_0x2758b4){return db['SalesforceAccount']['find']({'where':{'id':_0x1161a0['params']['id']}})['then'](handleEntityNotFound(_0x2758b4,null))['then'](removeEntity(_0x2758b4,null))[_0x1edd('0x4b')](handleError(_0x2758b4,null));};exports[_0x1edd('0x51')]=function(_0x1721dd,_0x11e4a8,_0x165185){var _0x1d72ca={};var _0x1f94e4={};var _0x45a012;var _0x2abb6a;return db[_0x1edd('0x34')][_0x1edd('0x52')]({'where':{'id':_0x1721dd[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x11e4a8,null))[_0x1edd('0x1d')](function(_0x201550){if(_0x201550){_0x45a012=_0x201550;_0x1f94e4[_0x1edd('0x36')]=_[_0x1edd('0x37')](db[_0x1edd('0x53')][_0x1edd('0x35')]);_0x1f94e4['query']=_[_0x1edd('0x37')](_0x1721dd['query']);_0x1f94e4[_0x1edd('0x40')]=_[_0x1edd('0x39')](_0x1f94e4[_0x1edd('0x36')],_0x1f94e4[_0x1edd('0x38')]);_0x1d72ca[_0x1edd('0x3a')]=_[_0x1edd('0x39')](_0x1f94e4[_0x1edd('0x36')],qs['fields'](_0x1721dd[_0x1edd('0x38')]['fields']));_0x1d72ca[_0x1edd('0x3a')]=_0x1d72ca[_0x1edd('0x3a')][_0x1edd('0x3c')]?_0x1d72ca['attributes']:_0x1f94e4['model'];_0x1d72ca['order']=qs[_0x1edd('0x3e')](_0x1721dd['query'][_0x1edd('0x3e')]);_0x1d72ca[_0x1edd('0x3f')]=qs[_0x1edd('0x40')](_[_0x1edd('0x41')](_0x1721dd[_0x1edd('0x38')],_0x1f94e4[_0x1edd('0x40')]));if(_0x1721dd['query']['filter']){_0x1d72ca[_0x1edd('0x3f')]=_['merge'](_0x1d72ca[_0x1edd('0x3f')],{'$or':_[_0x1edd('0x43')](_0x1d72ca[_0x1edd('0x3a')],function(_0x3b2143){var _0x243264={};_0x243264[_0x3b2143]={'$like':'%'+_0x1721dd[_0x1edd('0x38')][_0x1edd('0x42')]+'%'};return _0x243264;})});}_0x1d72ca=_['merge']({},_0x1d72ca,_0x1721dd['options']);return _0x45a012['getConfigurations'](_0x1d72ca);}})[_0x1edd('0x1d')](function(_0x2d1431){if(_0x2d1431){_0x2abb6a=_0x2d1431[_0x1edd('0x3c')];if(!_0x1721dd[_0x1edd('0x38')][_0x1edd('0x54')](_0x1edd('0x3d'))){_0x1d72ca[_0x1edd('0x2a')]=qs['limit'](_0x1721dd[_0x1edd('0x38')]['limit']);_0x1d72ca[_0x1edd('0x29')]=qs['offset'](_0x1721dd[_0x1edd('0x38')][_0x1edd('0x29')]);}return _0x45a012['getConfigurations'](_0x1d72ca);}})[_0x1edd('0x1d')](function(_0x4d1710){if(_0x4d1710){return _0x4d1710?{'count':_0x2abb6a,'rows':_0x4d1710}:null;}})[_0x1edd('0x1d')](respondWithResult(_0x11e4a8,null))[_0x1edd('0x4b')](handleError(_0x11e4a8,null));};exports[_0x1edd('0x55')]=function(_0x4e0bbb,_0x20270e,_0xdd8575){if(_0x4e0bbb[_0x1edd('0x50')]['id']){delete _0x4e0bbb['body']['id'];}return db[_0x1edd('0x34')][_0x1edd('0x52')]({'where':{'id':_0x4e0bbb[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x20270e,null))[_0x1edd('0x1d')](function(_0xac5bd2){if(_0xac5bd2){_0x4e0bbb[_0x1edd('0x50')]['AccountId']=_0xac5bd2['id'];_0x4e0bbb[_0x1edd('0x50')][_0x1edd('0x56')]=integrations[_0x1edd('0x57')](_0x4e0bbb[_0x1edd('0x50')]['channel'],_0x4e0bbb[_0x1edd('0x50')][_0x1edd('0x44')]);_0x4e0bbb[_0x1edd('0x50')]['Descriptions']=integrations[_0x1edd('0x58')](_0x4e0bbb['body'][_0x1edd('0x59')],_0x4e0bbb[_0x1edd('0x50')]['type']);return db['SalesforceConfiguration'][_0x1edd('0x4f')](_0x4e0bbb[_0x1edd('0x50')],{'include':[{'model':db[_0x1edd('0x5a')],'as':_0x1edd('0x56')},{'model':db['SalesforceField'],'as':_0x1edd('0x5b')}]});}return null;})[_0x1edd('0x1d')](respondWithResult(_0x20270e,null))[_0x1edd('0x4b')](handleError(_0x20270e,null));};exports[_0x1edd('0x5c')]=function(_0x2ed5eb,_0x1c8933,_0x239ca9){var _0xaeb178;var _0xd5f678='';var _0x3a0408=_0x1edd('0x5d');return db[_0x1edd('0x34')]['findOne']({'where':{'id':_0x2ed5eb[_0x1edd('0x4c')]['id']},'attributes':['id',_0x1edd('0x5e'),_0x1edd('0x5f'),'clientSecret',_0x1edd('0x60'),'password',_0x1edd('0x61')]})['then'](handleEntityNotFound(_0x1c8933,null))['then'](function(_0x404879){if(_0x404879){_0xd5f678=_0x404879[_0x1edd('0x5e')];var _0x5c621c=_0xd5f678[_0x1edd('0x62')](-0x1);if(_0x5c621c==='/'){_0xd5f678=_0xd5f678['substring'](0x0,_0xd5f678['lastIndexOf'](_0x5c621c));}_0xaeb178=new jsforce[(_0x1edd('0x63'))]({'oauth2':{'loginUrl':_0xd5f678,'clientId':_0x404879['clientId'],'clientSecret':_0x404879[_0x1edd('0x64')]}});return _0xaeb178['login'](_0x404879[_0x1edd('0x60')],_0x404879[_0x1edd('0x65')][_0x1edd('0x66')](_0x404879[_0x1edd('0x61')]));}})[_0x1edd('0x1d')](function(_0x48fcef){if(_0x48fcef){if(!_[_0x1edd('0x67')](_0x2ed5eb['query'][_0x1edd('0x68')])){_0x3a0408=_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x68')];}return _0xaeb178[_0x1edd('0x69')](_0x3a0408)['describe']();}})[_0x1edd('0x1d')](function(_0x3ee486){var _0x69acec=[_0x1edd('0x6a'),_0x1edd('0x6b'),_0x1edd('0x6c'),'CallType',_0x1edd('0x6d'),_0x1edd('0x6e'),_0x1edd('0x6f'),_0x1edd('0x70')];if(!_[_0x1edd('0x67')](_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x68')])&&_0x2ed5eb[_0x1edd('0x38')]['ticketType']===_0x1edd('0x71')){_0x69acec=[_0x1edd('0x70'),_0x1edd('0x72'),_0x1edd('0x73'),'Status',_0x1edd('0x6e'),_0x1edd('0x74'),'SuppliedName',_0x1edd('0x75')];}if(_0x3ee486){_[_0x1edd('0x76')](_0x3ee486['fields'],function(_0x4ee5e5){return _0x4ee5e5[_0x1edd('0x77')]===![]&&!_0x69acec[_0x1edd('0x78')](_0x4ee5e5[_0x1edd('0x31')]);});return{'count':_0x3ee486['fields']['length'],'rows':_[_0x1edd('0x43')](_0x3ee486[_0x1edd('0x3b')],function(_0x2506a9){return{'id':_0x2506a9[_0x1edd('0x31')],'name':_0x2506a9[_0x1edd('0x79')],'custom':_0x2506a9[_0x1edd('0x77')],'options':_0x2506a9[_0x1edd('0x7a')][_0x1edd('0x3c')]>0x0?_[_0x1edd('0x43')](_0x2506a9['picklistValues'],function(_0x3c2a58){return{'name':_0x3c2a58[_0x1edd('0x79')],'value':_0x3c2a58['value']};}):_0x2506a9[_0x1edd('0x44')]==_0x1edd('0x7b')?[{'name':_0x1edd('0x7c'),'value':_0x1edd('0x7d')},{'name':'False','value':_0x1edd('0x7e')}]:[]};})};}})['then'](respondWithResult(_0x1c8933,null))[_0x1edd('0x4b')](function(_0x541069){var _0x5495c0=_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x1b')]?0x1f4:_0x541069[_0x1edd('0x7f')]||0x1f4;logger[_0x1edd('0x22')](_0x1edd('0x80'),_0x1edd('0x5c'),_0x5495c0,JSON['stringify'](_0x541069));delete _0x541069[_0x1edd('0x31')];if(_0x5495c0===0x191){_0x5495c0=0x190;}_0x1c8933['status'](_0x5495c0)['send'](_0x2ed5eb['query'][_0x1edd('0x1b')]?{'message':_0x1edd('0x81'),'statusCode':_0x541069[_0x1edd('0x7f')]}:_0x541069);});}; \ No newline at end of file +var _0xac84=['username','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','map','custom','picklistValues','label','value','boolean','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','name','send','index','SalesforceAccount','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','key','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','rawAttributes','order','pick','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret'];(function(_0x113cc2,_0x4b0509){var _0x59a3df=function(_0x15c2b0){while(--_0x15c2b0){_0x113cc2['push'](_0x113cc2['shift']());}};_0x59a3df(++_0x4b0509);}(_0xac84,0xb1));var _0x4ac8=function(_0x1a7fc9,_0x1ceb8d){_0x1a7fc9=_0x1a7fc9-0x0;var _0x30990f=_0xac84[_0x1a7fc9];return _0x30990f;};'use strict';var pdf=require(_0x4ac8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4ac8('0x1'));var zipdir=require(_0x4ac8('0x2'));var jsonpatch=require(_0x4ac8('0x3'));var rp=require(_0x4ac8('0x4'));var moment=require(_0x4ac8('0x5'));var BPromise=require(_0x4ac8('0x6'));var Mustache=require(_0x4ac8('0x7'));var util=require('util');var path=require(_0x4ac8('0x8'));var sox=require(_0x4ac8('0x9'));var csv=require(_0x4ac8('0xa'));var ejs=require(_0x4ac8('0xb'));var fs=require('fs');var _=require(_0x4ac8('0xc'));var squel=require(_0x4ac8('0xd'));var crypto=require('crypto');var jsforce=require(_0x4ac8('0xe'));var deskjs=require(_0x4ac8('0xf'));var toCsv=require(_0x4ac8('0xa'));var querystring=require(_0x4ac8('0x10'));var Papa=require(_0x4ac8('0x11'));var Redis=require(_0x4ac8('0x12'));var authService=require(_0x4ac8('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4ac8('0x14'));var logger=require(_0x4ac8('0x15'))('api');var utils=require(_0x4ac8('0x16'));var config=require(_0x4ac8('0x17'));var db=require(_0x4ac8('0x18'))['db'];var integrations=require(_0x4ac8('0x19'));var jayson=require(_0x4ac8('0x1a'));var client=jayson[_0x4ac8('0x1b')][_0x4ac8('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199212,_0x5696d2,_0x213d50){if(_0x213d50){var _0x48f226=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48f226[_0x4ac8('0x1d')](_0x5696d2)){return _0x199212;}else{throw new Error(_0x4ac8('0x1e'));}}else{return _0x199212;}}function respondWithRpcPromise(_0x33d3c1,_0x36b8d4,_0x1993aa,_0x179f5c){return new BPromise(function(_0x3f8374,_0x216853){var _0x40cea2=_0x179f5c||client;return _0x40cea2[_0x4ac8('0x1f')](_0x33d3c1,_0x1993aa)[_0x4ac8('0x20')](function(_0x1a439a){logger[_0x4ac8('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x36b8d4,_0x4ac8('0x22'));logger[_0x4ac8('0x23')](_0x4ac8('0x24'),_0x36b8d4,'request\x20sent',JSON[_0x4ac8('0x25')](_0x1a439a));if(_0x1a439a[_0x4ac8('0x26')]){if(_0x1a439a[_0x4ac8('0x26')]['code']===0x1f4){logger['error'](_0x4ac8('0x27'),_0x36b8d4,_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);return _0x216853(_0x1a439a['error'][_0x4ac8('0x28')]);}logger[_0x4ac8('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x36b8d4,_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);return _0x3f8374(_0x1a439a[_0x4ac8('0x26')][_0x4ac8('0x28')]);}else{logger[_0x4ac8('0x21')](_0x4ac8('0x27'),_0x36b8d4,_0x4ac8('0x22'));_0x3f8374(_0x1a439a[_0x4ac8('0x29')][_0x4ac8('0x28')]);}})['catch'](function(_0x37a819){logger[_0x4ac8('0x26')](_0x4ac8('0x27'),_0x36b8d4,_0x37a819);_0x216853(_0x37a819);});});}function respondWithStatusCode(_0x41fa06,_0x44e116){_0x44e116=_0x44e116||0xcc;return function(_0x1ad704){if(_0x1ad704){return _0x41fa06[_0x4ac8('0x2a')](_0x44e116);}return _0x41fa06[_0x4ac8('0x2b')](_0x44e116)[_0x4ac8('0x2c')]();};}function respondWithResult(_0x1936a2,_0x3c3d57){_0x3c3d57=_0x3c3d57||0xc8;return function(_0x6cc531){if(_0x6cc531){return _0x1936a2[_0x4ac8('0x2b')](_0x3c3d57)[_0x4ac8('0x2d')](_0x6cc531);}};}function respondWithFilteredResult(_0xf41d57,_0x2ffe19){return function(_0x1b88d2){if(_0x1b88d2){var _0x4066af=_0x1b88d2[_0x4ac8('0x2e')],_0x2862d6=_0x2ffe19[_0x4ac8('0x2f')],_0x31afa5=_0x2ffe19['offset']+_0x2ffe19[_0x4ac8('0x30')],_0x38a41e;if(_0x31afa5>=_0x4066af){_0x31afa5=_0x4066af;_0x38a41e=0xc8;}else{_0x38a41e=0xce;}_0xf41d57[_0x4ac8('0x2b')](_0x38a41e);return _0xf41d57[_0x4ac8('0x31')](_0x4ac8('0x32'),_0x2862d6+'-'+_0x31afa5+'/'+_0x4066af)[_0x4ac8('0x2d')](_0x1b88d2);}return null;};}function patchUpdates(_0x499fe2){return function(_0x4ec86c){try{jsonpatch['apply'](_0x4ec86c,_0x499fe2,!![]);}catch(_0x4c3862){return BPromise[_0x4ac8('0x33')](_0x4c3862);}return _0x4ec86c['save']();};}function saveUpdates(_0x306460,_0x4bf7b6){return function(_0x4230fc){if(_0x4230fc){return _0x4230fc[_0x4ac8('0x34')](_0x306460)[_0x4ac8('0x20')](function(_0x58be0c){return _0x58be0c;});}return null;};}function removeEntity(_0x7dd6f0,_0x32142a){return function(_0x3edbd1){if(_0x3edbd1){return _0x3edbd1['destroy']()[_0x4ac8('0x20')](function(){_0x7dd6f0['status'](0xcc)[_0x4ac8('0x2c')]();});}};}function handleEntityNotFound(_0x24991d,_0x16a4c3){return function(_0x3eea68){if(!_0x3eea68){_0x24991d[_0x4ac8('0x2a')](0x194);}return _0x3eea68;};}function handleError(_0x574c7a,_0x5db6a7){_0x5db6a7=_0x5db6a7||0x1f4;return function(_0x1f6bea){logger['error'](_0x1f6bea['stack']);if(_0x1f6bea['name']){delete _0x1f6bea[_0x4ac8('0x35')];}_0x574c7a[_0x4ac8('0x2b')](_0x5db6a7)[_0x4ac8('0x36')](_0x1f6bea);};}exports[_0x4ac8('0x37')]=function(_0x5204b4,_0x2acd30){var _0x3a1dfc={},_0x2021ae={},_0x407e09={'count':0x0,'rows':[]};var _0x12032d=db[_0x4ac8('0x38')]['rawAttributes'];_0x2021ae[_0x4ac8('0x39')]=_['keys'](_0x12032d);_0x2021ae[_0x4ac8('0x3a')]=_['keys'](_0x5204b4[_0x4ac8('0x3a')]);_0x2021ae[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x2021ae[_0x4ac8('0x39')],_0x2021ae['query']);_0x3a1dfc[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x2021ae['model'],qs[_0x4ac8('0x3e')](_0x5204b4[_0x4ac8('0x3a')]['fields']));_0x3a1dfc[_0x4ac8('0x3d')]=_0x3a1dfc[_0x4ac8('0x3d')][_0x4ac8('0x3f')]?_0x3a1dfc['attributes']:_0x2021ae['model'];if(!_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x40')](_0x4ac8('0x41'))){_0x3a1dfc[_0x4ac8('0x30')]=qs['limit'](_0x5204b4[_0x4ac8('0x3a')]['limit']);_0x3a1dfc[_0x4ac8('0x2f')]=qs[_0x4ac8('0x2f')](_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x2f')]);}_0x3a1dfc['order']=qs[_0x4ac8('0x42')](_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x42')]);_0x3a1dfc['where']=qs['filters'](_['pick'](_0x5204b4['query'],_0x2021ae['filters']));if(_0x5204b4[_0x4ac8('0x3a')][_0x4ac8('0x43')]){_0x3a1dfc[_0x4ac8('0x44')]=_[_0x4ac8('0x45')](_0x3a1dfc[_0x4ac8('0x44')],{'$or':_['map'](_0x12032d,function(_0x4d4e40){if(_0x4d4e40[_0x4ac8('0x46')][_0x4ac8('0x47')]!==_0x4ac8('0x48')){var _0x2ba582={};_0x2ba582[_0x4d4e40['field']]={'$like':'%'+_0x5204b4['query'][_0x4ac8('0x43')]+'%'};return _0x2ba582;}})});}_0x3a1dfc=_[_0x4ac8('0x45')]({},_0x3a1dfc,_0x5204b4[_0x4ac8('0x49')]);var _0xfed540={'where':_0x3a1dfc['where']};return db['SalesforceAccount'][_0x4ac8('0x2e')](_0xfed540)[_0x4ac8('0x20')](function(_0x3d571e){_0x407e09['count']=_0x3d571e;if(_0x5204b4['query'][_0x4ac8('0x4a')]){_0x3a1dfc['include']=[{'all':!![]}];}return db[_0x4ac8('0x38')]['findAll'](_0x3a1dfc);})[_0x4ac8('0x20')](function(_0x3642f0){_0x407e09[_0x4ac8('0x4b')]=_0x3642f0;return _0x407e09;})[_0x4ac8('0x20')](respondWithFilteredResult(_0x2acd30,_0x3a1dfc))[_0x4ac8('0x4c')](handleError(_0x2acd30,null));};exports[_0x4ac8('0x4d')]=function(_0x8494f9,_0x450a61){var _0x3b7427={'raw':![],'where':{'id':_0x8494f9[_0x4ac8('0x4e')]['id']}},_0x494471={};_0x494471['model']=_[_0x4ac8('0x4f')](db[_0x4ac8('0x38')]['rawAttributes']);_0x494471['query']=_[_0x4ac8('0x4f')](_0x8494f9[_0x4ac8('0x3a')]);_0x494471[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x494471[_0x4ac8('0x39')],_0x494471[_0x4ac8('0x3a')]);_0x3b7427[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x494471[_0x4ac8('0x39')],qs[_0x4ac8('0x3e')](_0x8494f9[_0x4ac8('0x3a')]['fields']));_0x3b7427[_0x4ac8('0x3d')]=_0x3b7427[_0x4ac8('0x3d')]['length']?_0x3b7427[_0x4ac8('0x3d')]:_0x494471[_0x4ac8('0x39')];if(_0x8494f9['query'][_0x4ac8('0x4a')]){_0x3b7427['include']=[{'all':!![]}];}_0x3b7427=_[_0x4ac8('0x45')]({},_0x3b7427,_0x8494f9[_0x4ac8('0x49')]);return db[_0x4ac8('0x38')][_0x4ac8('0x50')](_0x3b7427)['then'](handleEntityNotFound(_0x450a61,null))[_0x4ac8('0x20')](respondWithResult(_0x450a61,null))[_0x4ac8('0x4c')](handleError(_0x450a61,null));};exports[_0x4ac8('0x51')]=function(_0x530531,_0x39ddd6){return db['SalesforceAccount']['create'](_0x530531['body'],{})[_0x4ac8('0x20')](respondWithResult(_0x39ddd6,0xc9))[_0x4ac8('0x4c')](handleError(_0x39ddd6,null));};exports['update']=function(_0x1e6440,_0x335f74){if(_0x1e6440[_0x4ac8('0x52')]['id']){delete _0x1e6440['body']['id'];}return db['SalesforceAccount'][_0x4ac8('0x50')]({'where':{'id':_0x1e6440[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x335f74,null))[_0x4ac8('0x20')](saveUpdates(_0x1e6440['body'],null))[_0x4ac8('0x20')](respondWithResult(_0x335f74,null))['catch'](handleError(_0x335f74,null));};exports[_0x4ac8('0x53')]=function(_0x26d053,_0x31db3f){return db[_0x4ac8('0x38')][_0x4ac8('0x50')]({'where':{'id':_0x26d053[_0x4ac8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31db3f,null))[_0x4ac8('0x20')](removeEntity(_0x31db3f,null))['catch'](handleError(_0x31db3f,null));};exports[_0x4ac8('0x54')]=function(_0x3f59f8,_0x33c7f8,_0x273055){var _0x1be5ba={};var _0x5d775b={};var _0x13464d;var _0x424f2f;return db[_0x4ac8('0x38')][_0x4ac8('0x55')]({'where':{'id':_0x3f59f8[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x33c7f8,null))[_0x4ac8('0x20')](function(_0x59480c){if(_0x59480c){_0x13464d=_0x59480c;_0x5d775b[_0x4ac8('0x39')]=_[_0x4ac8('0x4f')](db['SalesforceConfiguration'][_0x4ac8('0x56')]);_0x5d775b[_0x4ac8('0x3a')]=_[_0x4ac8('0x4f')](_0x3f59f8[_0x4ac8('0x3a')]);_0x5d775b[_0x4ac8('0x3b')]=_[_0x4ac8('0x3c')](_0x5d775b['model'],_0x5d775b[_0x4ac8('0x3a')]);_0x1be5ba[_0x4ac8('0x3d')]=_[_0x4ac8('0x3c')](_0x5d775b[_0x4ac8('0x39')],qs[_0x4ac8('0x3e')](_0x3f59f8[_0x4ac8('0x3a')]['fields']));_0x1be5ba['attributes']=_0x1be5ba[_0x4ac8('0x3d')][_0x4ac8('0x3f')]?_0x1be5ba[_0x4ac8('0x3d')]:_0x5d775b[_0x4ac8('0x39')];_0x1be5ba[_0x4ac8('0x57')]=qs[_0x4ac8('0x42')](_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x42')]);_0x1be5ba[_0x4ac8('0x44')]=qs['filters'](_[_0x4ac8('0x58')](_0x3f59f8['query'],_0x5d775b[_0x4ac8('0x3b')]));if(_0x3f59f8['query'][_0x4ac8('0x43')]){_0x1be5ba['where']=_[_0x4ac8('0x45')](_0x1be5ba[_0x4ac8('0x44')],{'$or':_['map'](_0x1be5ba['attributes'],function(_0x1a0038){var _0x5b8e14={};_0x5b8e14[_0x1a0038]={'$like':'%'+_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x43')]+'%'};return _0x5b8e14;})});}_0x1be5ba=_[_0x4ac8('0x45')]({},_0x1be5ba,_0x3f59f8[_0x4ac8('0x49')]);return _0x13464d[_0x4ac8('0x54')](_0x1be5ba);}})[_0x4ac8('0x20')](function(_0x3a011f){if(_0x3a011f){_0x424f2f=_0x3a011f[_0x4ac8('0x3f')];if(!_0x3f59f8[_0x4ac8('0x3a')][_0x4ac8('0x40')]('nolimit')){_0x1be5ba[_0x4ac8('0x30')]=qs[_0x4ac8('0x30')](_0x3f59f8['query']['limit']);_0x1be5ba[_0x4ac8('0x2f')]=qs['offset'](_0x3f59f8[_0x4ac8('0x3a')]['offset']);}return _0x13464d[_0x4ac8('0x54')](_0x1be5ba);}})[_0x4ac8('0x20')](function(_0x474247){if(_0x474247){return _0x474247?{'count':_0x424f2f,'rows':_0x474247}:null;}})[_0x4ac8('0x20')](respondWithResult(_0x33c7f8,null))[_0x4ac8('0x4c')](handleError(_0x33c7f8,null));};exports['addConfiguration']=function(_0x13ee4d,_0x56429d,_0x200b61){if(_0x13ee4d[_0x4ac8('0x52')]['id']){delete _0x13ee4d[_0x4ac8('0x52')]['id'];}return db[_0x4ac8('0x38')][_0x4ac8('0x55')]({'where':{'id':_0x13ee4d[_0x4ac8('0x4e')]['id']}})[_0x4ac8('0x20')](handleEntityNotFound(_0x56429d,null))[_0x4ac8('0x20')](function(_0x24d67b){if(_0x24d67b){_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x59')]=_0x24d67b['id'];_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5a')]=integrations[_0x4ac8('0x5b')](_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5c')],_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x46')]);_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5d')]=integrations['getDescriptions'](_0x13ee4d[_0x4ac8('0x52')][_0x4ac8('0x5c')],_0x13ee4d[_0x4ac8('0x52')]['type']);return db[_0x4ac8('0x5e')]['create'](_0x13ee4d['body'],{'include':[{'model':db[_0x4ac8('0x5f')],'as':_0x4ac8('0x5a')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x4ac8('0x20')](respondWithResult(_0x56429d,null))[_0x4ac8('0x4c')](handleError(_0x56429d,null));};exports[_0x4ac8('0x60')]=function(_0x256ba2,_0x45a254,_0xb2fe52){var _0x2ccf65;var _0x5b6c84='';var _0x291ecf=_0x4ac8('0x61');return db['SalesforceAccount'][_0x4ac8('0x55')]({'where':{'id':_0x256ba2[_0x4ac8('0x4e')]['id']},'attributes':['id',_0x4ac8('0x62'),_0x4ac8('0x63'),_0x4ac8('0x64'),_0x4ac8('0x65'),'password',_0x4ac8('0x66')]})['then'](handleEntityNotFound(_0x45a254,null))['then'](function(_0x277148){if(_0x277148){_0x5b6c84=_0x277148[_0x4ac8('0x62')];var _0x1ff083=_0x5b6c84[_0x4ac8('0x67')](-0x1);if(_0x1ff083==='/'){_0x5b6c84=_0x5b6c84[_0x4ac8('0x68')](0x0,_0x5b6c84[_0x4ac8('0x69')](_0x1ff083));}_0x2ccf65=new jsforce[(_0x4ac8('0x6a'))]({'oauth2':{'loginUrl':_0x5b6c84,'clientId':_0x277148[_0x4ac8('0x63')],'clientSecret':_0x277148[_0x4ac8('0x64')]}});return _0x2ccf65[_0x4ac8('0x6b')](_0x277148[_0x4ac8('0x65')],_0x277148['password'][_0x4ac8('0x6c')](_0x277148[_0x4ac8('0x66')]));}})[_0x4ac8('0x20')](function(_0x1012a6){if(_0x1012a6){if(!_[_0x4ac8('0x6d')](_0x256ba2['query'][_0x4ac8('0x6e')])){_0x291ecf=_0x256ba2[_0x4ac8('0x3a')][_0x4ac8('0x6e')];}return _0x2ccf65[_0x4ac8('0x6f')](_0x291ecf)[_0x4ac8('0x70')]();}})[_0x4ac8('0x20')](function(_0x20c2db){var _0x9d86cd=[_0x4ac8('0x71'),_0x4ac8('0x72'),_0x4ac8('0x73'),_0x4ac8('0x74'),_0x4ac8('0x75'),_0x4ac8('0x76'),_0x4ac8('0x77'),_0x4ac8('0x78')];if(!_[_0x4ac8('0x6d')](_0x256ba2[_0x4ac8('0x3a')]['ticketType'])&&_0x256ba2[_0x4ac8('0x3a')]['ticketType']===_0x4ac8('0x79')){_0x9d86cd=[_0x4ac8('0x78'),_0x4ac8('0x7a'),_0x4ac8('0x7b'),'Status',_0x4ac8('0x76'),_0x4ac8('0x7c'),'SuppliedName',_0x4ac8('0x7d')];}if(_0x20c2db){_['remove'](_0x20c2db[_0x4ac8('0x3e')],function(_0x34093b){return _0x34093b['custom']===![]&&!_0x9d86cd['includes'](_0x34093b[_0x4ac8('0x35')]);});return{'count':_0x20c2db[_0x4ac8('0x3e')][_0x4ac8('0x3f')],'rows':_[_0x4ac8('0x7e')](_0x20c2db[_0x4ac8('0x3e')],function(_0x304324){return{'id':_0x304324[_0x4ac8('0x35')],'name':_0x304324['label'],'custom':_0x304324[_0x4ac8('0x7f')],'options':_0x304324[_0x4ac8('0x80')][_0x4ac8('0x3f')]>0x0?_[_0x4ac8('0x7e')](_0x304324[_0x4ac8('0x80')],function(_0x58f2cd){return{'name':_0x58f2cd[_0x4ac8('0x81')],'value':_0x58f2cd[_0x4ac8('0x82')]};}):_0x304324[_0x4ac8('0x46')]==_0x4ac8('0x83')?[{'name':_0x4ac8('0x84'),'value':_0x4ac8('0x85')},{'name':_0x4ac8('0x86'),'value':_0x4ac8('0x87')}]:[]};})};}})[_0x4ac8('0x20')](respondWithResult(_0x45a254,null))[_0x4ac8('0x4c')](function(_0xf70e3c){var _0x2fdc33=_0x256ba2['query'][_0x4ac8('0x1d')]?0x1f4:_0xf70e3c[_0x4ac8('0x88')]||0x1f4;logger['error'](_0x4ac8('0x89'),_0x4ac8('0x60'),_0x2fdc33,JSON[_0x4ac8('0x25')](_0xf70e3c));delete _0xf70e3c[_0x4ac8('0x35')];if(_0x2fdc33===0x191){_0x2fdc33=0x190;}_0x45a254[_0x4ac8('0x2b')](_0x2fdc33)[_0x4ac8('0x36')](_0x256ba2[_0x4ac8('0x3a')][_0x4ac8('0x1d')]?{'message':_0x4ac8('0x8a'),'statusCode':_0xf70e3c[_0x4ac8('0x88')]}:_0xf70e3c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1fd4edd..3737ebf 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 _0xea28=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x542505,_0x5e1687){var _0x5b9924=function(_0x58aaa7){while(--_0x58aaa7){_0x542505['push'](_0x542505['shift']());}};_0x5b9924(++_0x5e1687);}(_0xea28,0x13a));var _0x8ea2=function(_0xba34f8,_0x2d5922){_0xba34f8=_0xba34f8-0x0;var _0x39c5b5=_0xea28[_0xba34f8];return _0x39c5b5;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));var integrations=require(_0x8ea2('0xa'));module['exports']=function(_0x29b82b,_0x435d78){return _0x29b82b[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x049e=['api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x186edd,_0x16afae){var _0x447af8=function(_0x280a1b){while(--_0x280a1b){_0x186edd['push'](_0x186edd['shift']());}};_0x447af8(++_0x16afae);}(_0x049e,0x16a));var _0xe049=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x049e[_0x5311e8];return _0x582ad8;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var logger=require('../../config/logger')(_0xe049('0x2'));var moment=require('moment');var BPromise=require(_0xe049('0x3'));var rp=require(_0xe049('0x4'));var fs=require('fs');var path=require(_0xe049('0x5'));var rimraf=require(_0xe049('0x6'));var config=require(_0xe049('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xe049('0x8'));module[_0xe049('0x9')]=function(_0x22e8f5,_0x221a5f){return _0x22e8f5[_0xe049('0xa')](_0xe049('0xb'),attributes,{'tableName':_0xe049('0xc'),'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 95d4f57..64c8239 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 _0xdecc=['ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','include','map','model','then','stringify'];(function(_0x2ae588,_0x11621e){var _0x442b9c=function(_0x4af107){while(--_0x4af107){_0x2ae588['push'](_0x2ae588['shift']());}};_0x442b9c(++_0x11621e);}(_0xdecc,0x1d7));var _0xcdec=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xdecc[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0xcdec('0x0'));var util=require(_0xcdec('0x1'));var moment=require(_0xcdec('0x2'));var BPromise=require(_0xcdec('0x3'));var rs=require(_0xcdec('0x4'));var fs=require('fs');var Redis=require(_0xcdec('0x5'));var db=require(_0xcdec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdec('0x7'))('rpc');var config=require(_0xcdec('0x8'));var jayson=require(_0xcdec('0x9'));var client=jayson[_0xcdec('0xa')][_0xcdec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1578d5,_0x2bb273,_0x25c6f3){return new BPromise(function(_0x1ad4ff,_0x426e18){return client[_0xcdec('0xc')](_0x1578d5,_0x25c6f3)['then'](function(_0x47abb5){logger[_0xcdec('0xd')](_0xcdec('0xe'),_0x2bb273,_0xcdec('0xf'));logger[_0xcdec('0x10')](_0xcdec('0x11'),_0x2bb273,_0xcdec('0xf'),JSON['stringify'](_0x47abb5));if(_0x47abb5[_0xcdec('0x12')]){if(_0x47abb5[_0xcdec('0x12')]['code']===0x1f4){logger['error'](_0xcdec('0xe'),_0x2bb273,_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);return _0x426e18(_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);}logger[_0xcdec('0x12')](_0xcdec('0xe'),_0x2bb273,_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);return _0x1ad4ff(_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);}else{logger[_0xcdec('0xd')](_0xcdec('0xe'),_0x2bb273,_0xcdec('0xf'));_0x1ad4ff(_0x47abb5[_0xcdec('0x14')][_0xcdec('0x13')]);}})[_0xcdec('0x15')](function(_0x5f0dc3){logger[_0xcdec('0x12')](_0xcdec('0xe'),_0x2bb273,_0x5f0dc3);_0x426e18(_0x5f0dc3);});});}exports[_0xcdec('0x16')]=function(_0x11cd8c){var _0x1ef4fe=this;return new Promise(function(_0x13ad65,_0x387109){return db[_0xcdec('0x17')][_0xcdec('0x18')]({'raw':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x11cd8c['options']?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1a')]||null:null,'attributes':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1b')]||null:null,'limit':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')]['limit']||null:null,'include':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x11cd8c['options'][_0xcdec('0x1c')],function(_0x4f0647){return{'model':db[_0x4f0647[_0xcdec('0x1e')]],'as':_0x4f0647['as'],'attributes':_0x4f0647[_0xcdec('0x1b')],'include':_0x4f0647[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x4f0647['include'],function(_0x433c45){return{'model':db[_0x433c45[_0xcdec('0x1e')]],'as':_0x433c45['as'],'attributes':_0x433c45[_0xcdec('0x1b')],'include':_0x433c45[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x433c45[_0xcdec('0x1c')],function(_0x42f48c){return{'model':db[_0x42f48c['model']],'as':_0x42f48c['as'],'attributes':_0x42f48c[_0xcdec('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdec('0x1f')](function(_0x5273ff){logger['info'](_0xcdec('0x16'),_0x11cd8c);logger[_0xcdec('0x10')](_0xcdec('0x16'),_0x11cd8c,JSON[_0xcdec('0x20')](_0x5273ff));_0x13ad65(_0x5273ff);})['catch'](function(_0x26e7c3){logger[_0xcdec('0x12')](_0xcdec('0x16'),_0x26e7c3[_0xcdec('0x13')],_0x11cd8c);_0x387109(_0x1ef4fe['error'](0x1f4,_0x26e7c3[_0xcdec('0x13')]));});});};exports[_0xcdec('0x21')]=function(_0x4055d1){var _0x1bec2c=this;return new Promise(function(_0x214f28,_0x5d5aec){return db['SalesforceAccount'][_0xcdec('0x22')]({'raw':_0x4055d1['options']?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x23')]===undefined?!![]:![]:!![],'where':_0x4055d1[_0xcdec('0x19')]?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1a')]||null:null,'attributes':_0x4055d1[_0xcdec('0x19')]?_0x4055d1['options'][_0xcdec('0x1b')]||null:null,'include':_0x4055d1[_0xcdec('0x19')]?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1c')],function(_0xaf7b17){return{'model':db[_0xaf7b17['model']],'as':_0xaf7b17['as'],'attributes':_0xaf7b17[_0xcdec('0x1b')],'include':_0xaf7b17[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0xaf7b17[_0xcdec('0x1c')],function(_0x2c2d18){return{'model':db[_0x2c2d18['model']],'as':_0x2c2d18['as'],'attributes':_0x2c2d18[_0xcdec('0x1b')],'include':_0x2c2d18['include']?_[_0xcdec('0x1d')](_0x2c2d18[_0xcdec('0x1c')],function(_0x1f5b00){return{'model':db[_0x1f5b00[_0xcdec('0x1e')]],'as':_0x1f5b00['as'],'attributes':_0x1f5b00[_0xcdec('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe6d0d3){logger[_0xcdec('0xd')](_0xcdec('0x21'),_0x4055d1);logger[_0xcdec('0x10')](_0xcdec('0x21'),_0x4055d1,JSON[_0xcdec('0x20')](_0xe6d0d3));_0x214f28(_0xe6d0d3);})['catch'](function(_0x2e8c15){logger[_0xcdec('0x12')]('ShowSalesforceAccount',_0x2e8c15[_0xcdec('0x13')],_0x4055d1);_0x5d5aec(_0x1bec2c[_0xcdec('0x12')](0x1f4,_0x2e8c15['message']));});});}; \ No newline at end of file +var _0x5fb3=['GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x59f429,_0x2dfa26){var _0x396be4=function(_0x5033c5){while(--_0x5033c5){_0x59f429['push'](_0x59f429['shift']());}};_0x396be4(++_0x2dfa26);}(_0x5fb3,0x10f));var _0x35fb=function(_0x19b034,_0x220fde){_0x19b034=_0x19b034-0x0;var _0x2c9c76=_0x5fb3[_0x19b034];return _0x2c9c76;};'use strict';var _=require(_0x35fb('0x0'));var util=require(_0x35fb('0x1'));var moment=require(_0x35fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x35fb('0x3'));var fs=require('fs');var Redis=require(_0x35fb('0x4'));var db=require(_0x35fb('0x5'))['db'];var utils=require(_0x35fb('0x6'));var logger=require(_0x35fb('0x7'))(_0x35fb('0x8'));var config=require(_0x35fb('0x9'));var jayson=require(_0x35fb('0xa'));var client=jayson['client'][_0x35fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x404e5e,_0x38c29d,_0xb30a59){return new BPromise(function(_0x103a39,_0xf577ea){return client[_0x35fb('0xc')](_0x404e5e,_0xb30a59)[_0x35fb('0xd')](function(_0x58c301){logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x38c29d,'request\x20sent');logger[_0x35fb('0x10')](_0x35fb('0x11'),_0x38c29d,_0x35fb('0x12'),JSON[_0x35fb('0x13')](_0x58c301));if(_0x58c301[_0x35fb('0x14')]){if(_0x58c301['error'][_0x35fb('0x15')]===0x1f4){logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x58c301[_0x35fb('0x14')][_0x35fb('0x16')]);return _0xf577ea(_0x58c301['error'][_0x35fb('0x16')]);}logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x58c301[_0x35fb('0x14')][_0x35fb('0x16')]);return _0x103a39(_0x58c301[_0x35fb('0x14')]['message']);}else{logger[_0x35fb('0xe')](_0x35fb('0xf'),_0x38c29d,'request\x20sent');_0x103a39(_0x58c301[_0x35fb('0x17')][_0x35fb('0x16')]);}})[_0x35fb('0x18')](function(_0x48ec1d){logger[_0x35fb('0x14')](_0x35fb('0xf'),_0x38c29d,_0x48ec1d);_0xf577ea(_0x48ec1d);});});}exports[_0x35fb('0x19')]=function(_0x301fe9){var _0x14959c=this;return new Promise(function(_0x333d2f,_0x55db69){return db[_0x35fb('0x1a')]['findAll']({'raw':_0x301fe9['options']?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9['options'][_0x35fb('0x1d')]||null:null,'attributes':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1e')]||null:null,'limit':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x1f')]||null:null,'include':_0x301fe9[_0x35fb('0x1b')]?_0x301fe9[_0x35fb('0x1b')][_0x35fb('0x20')]?_[_0x35fb('0x21')](_0x301fe9['options'][_0x35fb('0x20')],function(_0x32a468){return{'model':db[_0x32a468[_0x35fb('0x22')]],'as':_0x32a468['as'],'attributes':_0x32a468[_0x35fb('0x1e')],'include':_0x32a468['include']?_[_0x35fb('0x21')](_0x32a468[_0x35fb('0x20')],function(_0x143c92){return{'model':db[_0x143c92[_0x35fb('0x22')]],'as':_0x143c92['as'],'attributes':_0x143c92['attributes'],'include':_0x143c92[_0x35fb('0x20')]?_[_0x35fb('0x21')](_0x143c92[_0x35fb('0x20')],function(_0x5071e7){return{'model':db[_0x5071e7[_0x35fb('0x22')]],'as':_0x5071e7['as'],'attributes':_0x5071e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x35fb('0xd')](function(_0xdf3c54){logger[_0x35fb('0xe')](_0x35fb('0x19'),_0x301fe9);logger['debug'](_0x35fb('0x19'),_0x301fe9,JSON[_0x35fb('0x13')](_0xdf3c54));_0x333d2f(_0xdf3c54);})[_0x35fb('0x18')](function(_0x53503b){logger[_0x35fb('0x14')](_0x35fb('0x19'),_0x53503b[_0x35fb('0x16')],_0x301fe9);_0x55db69(_0x14959c[_0x35fb('0x14')](0x1f4,_0x53503b[_0x35fb('0x16')]));});});};exports[_0x35fb('0x23')]=function(_0x19705e){var _0x19c115=this;return new Promise(function(_0x4bd2e4,_0x33e378){return db['SalesforceAccount'][_0x35fb('0x24')]({'raw':_0x19705e['options']?_0x19705e[_0x35fb('0x1b')][_0x35fb('0x1c')]===undefined?!![]:![]:!![],'where':_0x19705e[_0x35fb('0x1b')]?_0x19705e['options'][_0x35fb('0x1d')]||null:null,'attributes':_0x19705e[_0x35fb('0x1b')]?_0x19705e[_0x35fb('0x1b')]['attributes']||null:null,'include':_0x19705e[_0x35fb('0x1b')]?_0x19705e[_0x35fb('0x1b')][_0x35fb('0x20')]?_['map'](_0x19705e[_0x35fb('0x1b')][_0x35fb('0x20')],function(_0xdec94f){return{'model':db[_0xdec94f[_0x35fb('0x22')]],'as':_0xdec94f['as'],'attributes':_0xdec94f['attributes'],'include':_0xdec94f[_0x35fb('0x20')]?_[_0x35fb('0x21')](_0xdec94f[_0x35fb('0x20')],function(_0x2f6cf6){return{'model':db[_0x2f6cf6[_0x35fb('0x22')]],'as':_0x2f6cf6['as'],'attributes':_0x2f6cf6[_0x35fb('0x1e')],'include':_0x2f6cf6['include']?_[_0x35fb('0x21')](_0x2f6cf6[_0x35fb('0x20')],function(_0x20871f){return{'model':db[_0x20871f[_0x35fb('0x22')]],'as':_0x20871f['as'],'attributes':_0x20871f[_0x35fb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35fb('0xd')](function(_0x4ed9e6){logger['info']('ShowSalesforceAccount',_0x19705e);logger[_0x35fb('0x10')](_0x35fb('0x23'),_0x19705e,JSON['stringify'](_0x4ed9e6));_0x4bd2e4(_0x4ed9e6);})[_0x35fb('0x18')](function(_0x19c538){logger[_0x35fb('0x14')](_0x35fb('0x23'),_0x19c538['message'],_0x19705e);_0x33e378(_0x19c115[_0x35fb('0x14')](0x1f4,_0x19c538['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 15ef7f6..a300a2b 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 _0x6ff2=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x41116c,_0x33ac8b){var _0x16b707=function(_0x3d9758){while(--_0x3d9758){_0x41116c['push'](_0x41116c['shift']());}};_0x16b707(++_0x33ac8b);}(_0x6ff2,0xba));var _0x26ff=function(_0x44e7aa,_0x578c0d){_0x44e7aa=_0x44e7aa-0x0;var _0x41ee86=_0x6ff2[_0x44e7aa];return _0x41ee86;};'use strict';var multer=require(_0x26ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x26ff('0x1'));var express=require(_0x26ff('0x2'));var router=express[_0x26ff('0x3')]();var auth=require(_0x26ff('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26ff('0x5'));router[_0x26ff('0x6')]('/',auth[_0x26ff('0x7')](),controller[_0x26ff('0x8')]);router[_0x26ff('0x6')](_0x26ff('0x9'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xa')]);router[_0x26ff('0x6')](_0x26ff('0xb'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xc')]);router['get'](_0x26ff('0xd'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xe')]);router[_0x26ff('0x6')](_0x26ff('0xf'),auth[_0x26ff('0x7')](),controller[_0x26ff('0x10')]);router[_0x26ff('0x11')]('/',auth['isAuthenticated'](),controller[_0x26ff('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x26ff('0x13')]);router[_0x26ff('0x14')](_0x26ff('0x9'),auth[_0x26ff('0x7')](),controller['destroy']);module[_0x26ff('0x15')]=router; \ No newline at end of file +var _0x2f2f=['put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x4330ab,_0x141abd){var _0x1d764d=function(_0x187d84){while(--_0x187d84){_0x4330ab['push'](_0x4330ab['shift']());}};_0x1d764d(++_0x141abd);}(_0x2f2f,0x161));var _0xf2f2=function(_0x4e3ead,_0x24b267){_0x4e3ead=_0x4e3ead-0x0;var _0x3a80ea=_0x2f2f[_0x4e3ead];return _0x3a80ea;};'use strict';var multer=require(_0xf2f2('0x0'));var util=require(_0xf2f2('0x1'));var path=require(_0xf2f2('0x2'));var timeout=require(_0xf2f2('0x3'));var express=require(_0xf2f2('0x4'));var router=express[_0xf2f2('0x5')]();var auth=require(_0xf2f2('0x6'));var interaction=require(_0xf2f2('0x7'));var config=require(_0xf2f2('0x8'));var controller=require(_0xf2f2('0x9'));router[_0xf2f2('0xa')]('/',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0xc')]);router['get'](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0xe')]);router[_0xf2f2('0xa')](_0xf2f2('0xf'),auth['isAuthenticated'](),controller[_0xf2f2('0x10')]);router[_0xf2f2('0xa')]('/:id/subjects',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x11')]);router[_0xf2f2('0xa')](_0xf2f2('0x12'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x13')]);router[_0xf2f2('0x14')]('/',auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x15')]);router[_0xf2f2('0x16')](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller[_0xf2f2('0x17')]);router[_0xf2f2('0x18')](_0xf2f2('0xd'),auth[_0xf2f2('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f3d8b75..3a64578 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 _0xe4c2=['ENUM','Task','contact_lead','contact','lead','nothing','STRING'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0xe4c2,0x1a3));var _0x2e4c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe4c2[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e4c('0x0')]},'description':{'type':Sequelize[_0x2e4c('0x0')]},'ticketType':{'type':Sequelize[_0x2e4c('0x1')]('Task','Case'),'defaultValue':_0x2e4c('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2e4c('0x3'),_0x2e4c('0x4'),_0x2e4c('0x5')),'defaultValue':_0x2e4c('0x3')},'moduleCreate':{'type':Sequelize[_0x2e4c('0x1')](_0x2e4c('0x6'),_0x2e4c('0x4'),_0x2e4c('0x5')),'defaultValue':_0x2e4c('0x5')}}; \ No newline at end of file +var _0x98fe=['contact','lead','contact_lead','nothing','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x98fe,0x1ee));var _0xe98f=function(_0x37219e,_0x5e06b4){_0x37219e=_0x37219e-0x0;var _0x2a4ea6=_0x98fe[_0x37219e];return _0x2a4ea6;};'use strict';var Sequelize=require(_0xe98f('0x0'));module[_0xe98f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe98f('0x2')]},'ticketType':{'type':Sequelize[_0xe98f('0x3')](_0xe98f('0x4'),_0xe98f('0x5')),'defaultValue':_0xe98f('0x4')},'moduleSearch':{'type':Sequelize[_0xe98f('0x3')]('contact_lead',_0xe98f('0x6'),_0xe98f('0x7')),'defaultValue':_0xe98f('0x8')},'moduleCreate':{'type':Sequelize[_0xe98f('0x3')](_0xe98f('0x9'),_0xe98f('0x6'),_0xe98f('0x7')),'defaultValue':_0xe98f('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 0ecd502..129dc91 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 _0x698b=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','include','SalesforceConfiguration','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','findOne','SalesforceField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','destroy','end','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x377443,_0x963b2d){var _0x12026e=function(_0x11f67){while(--_0x11f67){_0x377443['push'](_0x377443['shift']());}};_0x12026e(++_0x963b2d);}(_0x698b,0x77));var _0xb698=function(_0x9490e5,_0x1b29ec){_0x9490e5=_0x9490e5-0x0;var _0x280fde=_0x698b[_0x9490e5];return _0x280fde;};'use strict';var pdf=require(_0xb698('0x0'));var emlformat=require(_0xb698('0x1'));var rimraf=require(_0xb698('0x2'));var zipdir=require(_0xb698('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb698('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb698('0x5'));var util=require(_0xb698('0x6'));var path=require(_0xb698('0x7'));var sox=require(_0xb698('0x8'));var csv=require(_0xb698('0x9'));var ejs=require(_0xb698('0xa'));var fs=require('fs');var _=require(_0xb698('0xb'));var squel=require(_0xb698('0xc'));var crypto=require(_0xb698('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb698('0xe'));var toCsv=require(_0xb698('0x9'));var querystring=require('querystring');var Papa=require(_0xb698('0xf'));var Redis=require(_0xb698('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb698('0x11'));var hardwareService=require(_0xb698('0x12'));var logger=require(_0xb698('0x13'))('api');var utils=require(_0xb698('0x14'));var config=require(_0xb698('0x15'));var db=require(_0xb698('0x16'))['db'];var jayson=require(_0xb698('0x17'));var client=jayson[_0xb698('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d03fa,_0x536703,_0x465fcc){if(_0x465fcc){var _0x5385d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5385d5[_0xb698('0x19')](_0x536703)){return _0x2d03fa;}else{throw new Error(_0xb698('0x1a'));}}else{return _0x2d03fa;}}function respondWithRpcPromise(_0x284f13,_0x380e81,_0x19ddc0,_0x284534){return new BPromise(function(_0x56af56,_0x2a3192){var _0x2dfffb=_0x284534||client;return _0x2dfffb[_0xb698('0x1b')](_0x284f13,_0x19ddc0)[_0xb698('0x1c')](function(_0x68d9e){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x380e81,_0xb698('0x1d'));logger[_0xb698('0x1e')](_0xb698('0x1f'),_0x380e81,_0xb698('0x1d'),JSON['stringify'](_0x68d9e));if(_0x68d9e[_0xb698('0x20')]){if(_0x68d9e[_0xb698('0x20')]['code']===0x1f4){logger['error'](_0xb698('0x21'),_0x380e81,_0x68d9e[_0xb698('0x20')][_0xb698('0x22')]);return _0x2a3192(_0x68d9e[_0xb698('0x20')]['message']);}logger[_0xb698('0x20')](_0xb698('0x21'),_0x380e81,_0x68d9e[_0xb698('0x20')]['message']);return _0x56af56(_0x68d9e['error']['message']);}else{logger[_0xb698('0x23')](_0xb698('0x21'),_0x380e81,_0xb698('0x1d'));_0x56af56(_0x68d9e[_0xb698('0x24')][_0xb698('0x22')]);}})['catch'](function(_0x5542a9){logger[_0xb698('0x20')](_0xb698('0x21'),_0x380e81,_0x5542a9);_0x2a3192(_0x5542a9);});});}function respondWithStatusCode(_0x158ff1,_0x21a894){_0x21a894=_0x21a894||0xcc;return function(_0x2df913){if(_0x2df913){return _0x158ff1[_0xb698('0x25')](_0x21a894);}return _0x158ff1['status'](_0x21a894)['end']();};}function respondWithResult(_0x3ef3bd,_0x431f24){_0x431f24=_0x431f24||0xc8;return function(_0x107c3b){if(_0x107c3b){return _0x3ef3bd[_0xb698('0x26')](_0x431f24)['json'](_0x107c3b);}};}function respondWithFilteredResult(_0x40b7fe,_0x4808ba){return function(_0x413d07){if(_0x413d07){var _0x3abc30=_0x413d07[_0xb698('0x27')],_0x27ae11=_0x4808ba[_0xb698('0x28')],_0x62ce91=_0x4808ba[_0xb698('0x28')]+_0x4808ba[_0xb698('0x29')],_0x398557;if(_0x62ce91>=_0x3abc30){_0x62ce91=_0x3abc30;_0x398557=0xc8;}else{_0x398557=0xce;}_0x40b7fe[_0xb698('0x26')](_0x398557);return _0x40b7fe['set'](_0xb698('0x2a'),_0x27ae11+'-'+_0x62ce91+'/'+_0x3abc30)[_0xb698('0x2b')](_0x413d07);}return null;};}function patchUpdates(_0x4259e6){return function(_0xdb18b4){try{jsonpatch['apply'](_0xdb18b4,_0x4259e6,!![]);}catch(_0x56a9c5){return BPromise[_0xb698('0x2c')](_0x56a9c5);}return _0xdb18b4[_0xb698('0x2d')]();};}function saveUpdates(_0x172738,_0x447768){return function(_0x32b931){if(_0x32b931){return _0x32b931['update'](_0x172738)['then'](function(_0x29e1a4){return _0x29e1a4;});}return null;};}function removeEntity(_0x27a15b,_0x208eb3){return function(_0x2b590c){if(_0x2b590c){return _0x2b590c[_0xb698('0x2e')]()['then'](function(){_0x27a15b[_0xb698('0x26')](0xcc)[_0xb698('0x2f')]();});}};}function handleEntityNotFound(_0x1f7d63,_0x47fcf1){return function(_0xec98e4){if(!_0xec98e4){_0x1f7d63[_0xb698('0x25')](0x194);}return _0xec98e4;};}function handleError(_0x321f20,_0x5e5f71){_0x5e5f71=_0x5e5f71||0x1f4;return function(_0x4de49c){logger[_0xb698('0x20')](_0x4de49c[_0xb698('0x30')]);if(_0x4de49c['name']){delete _0x4de49c[_0xb698('0x31')];}_0x321f20[_0xb698('0x26')](_0x5e5f71)[_0xb698('0x32')](_0x4de49c);};}exports[_0xb698('0x33')]=function(_0x35551d,_0x28a965){var _0x3d7160={},_0x11b5e9={},_0x3d702d={'count':0x0,'rows':[]};var _0x5d8bb0=db['SalesforceConfiguration'][_0xb698('0x34')];_0x11b5e9[_0xb698('0x35')]=_['keys'](_0x5d8bb0);_0x11b5e9[_0xb698('0x36')]=_[_0xb698('0x37')](_0x35551d[_0xb698('0x36')]);_0x11b5e9[_0xb698('0x38')]=_[_0xb698('0x39')](_0x11b5e9[_0xb698('0x35')],_0x11b5e9[_0xb698('0x36')]);_0x3d7160[_0xb698('0x3a')]=_['intersection'](_0x11b5e9[_0xb698('0x35')],qs[_0xb698('0x3b')](_0x35551d['query'][_0xb698('0x3b')]));_0x3d7160['attributes']=_0x3d7160[_0xb698('0x3a')][_0xb698('0x3c')]?_0x3d7160[_0xb698('0x3a')]:_0x11b5e9[_0xb698('0x35')];if(!_0x35551d['query'][_0xb698('0x3d')](_0xb698('0x3e'))){_0x3d7160[_0xb698('0x29')]=qs['limit'](_0x35551d[_0xb698('0x36')][_0xb698('0x29')]);_0x3d7160[_0xb698('0x28')]=qs[_0xb698('0x28')](_0x35551d[_0xb698('0x36')]['offset']);}_0x3d7160[_0xb698('0x3f')]=qs[_0xb698('0x40')](_0x35551d['query'][_0xb698('0x40')]);_0x3d7160[_0xb698('0x41')]=qs['filters'](_[_0xb698('0x42')](_0x35551d[_0xb698('0x36')],_0x11b5e9['filters']));if(_0x35551d[_0xb698('0x36')][_0xb698('0x43')]){_0x3d7160[_0xb698('0x41')]=_[_0xb698('0x44')](_0x3d7160[_0xb698('0x41')],{'$or':_[_0xb698('0x45')](_0x5d8bb0,function(_0x184682){if(_0x184682[_0xb698('0x46')][_0xb698('0x47')]!==_0xb698('0x48')){var _0x3c46e8={};_0x3c46e8[_0x184682['field']]={'$like':'%'+_0x35551d[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x3c46e8;}})});}_0x3d7160=_[_0xb698('0x44')]({},_0x3d7160,_0x35551d['options']);var _0x381e6c={'where':_0x3d7160[_0xb698('0x41')]};return db['SalesforceConfiguration'][_0xb698('0x27')](_0x381e6c)[_0xb698('0x1c')](function(_0x31ed40){_0x3d702d[_0xb698('0x27')]=_0x31ed40;if(_0x35551d[_0xb698('0x36')]['includeAll']){_0x3d7160[_0xb698('0x49')]=[{'all':!![]}];}return db[_0xb698('0x4a')][_0xb698('0x4b')](_0x3d7160);})[_0xb698('0x1c')](function(_0xf00222){_0x3d702d[_0xb698('0x4c')]=_0xf00222;return _0x3d702d;})[_0xb698('0x1c')](respondWithFilteredResult(_0x28a965,_0x3d7160))[_0xb698('0x4d')](handleError(_0x28a965,null));};exports[_0xb698('0x4e')]=function(_0x227bf9,_0xcd7727){var _0x51f9a6={'raw':![],'where':{'id':_0x227bf9['params']['id']}},_0x3c9f7c={};_0x3c9f7c[_0xb698('0x35')]=_[_0xb698('0x37')](db['SalesforceConfiguration'][_0xb698('0x34')]);_0x3c9f7c[_0xb698('0x36')]=_['keys'](_0x227bf9[_0xb698('0x36')]);_0x3c9f7c[_0xb698('0x38')]=_[_0xb698('0x39')](_0x3c9f7c[_0xb698('0x35')],_0x3c9f7c['query']);_0x51f9a6['attributes']=_[_0xb698('0x39')](_0x3c9f7c[_0xb698('0x35')],qs[_0xb698('0x3b')](_0x227bf9['query']['fields']));_0x51f9a6[_0xb698('0x3a')]=_0x51f9a6[_0xb698('0x3a')][_0xb698('0x3c')]?_0x51f9a6[_0xb698('0x3a')]:_0x3c9f7c[_0xb698('0x35')];if(_0x227bf9['query'][_0xb698('0x4f')]){_0x51f9a6[_0xb698('0x49')]=[{'all':!![]}];}_0x51f9a6=_[_0xb698('0x44')]({},_0x51f9a6,_0x227bf9[_0xb698('0x50')]);return db[_0xb698('0x4a')][_0xb698('0x51')](_0x51f9a6)[_0xb698('0x1c')](handleEntityNotFound(_0xcd7727,null))[_0xb698('0x1c')](respondWithResult(_0xcd7727,null))[_0xb698('0x4d')](handleError(_0xcd7727,null));};exports[_0xb698('0x52')]=function(_0x93024b,_0x471dd4){return db['SalesforceConfiguration'][_0xb698('0x52')](_0x93024b[_0xb698('0x53')],{})['then'](respondWithResult(_0x471dd4,0xc9))[_0xb698('0x4d')](handleError(_0x471dd4,null));};exports[_0xb698('0x54')]=function(_0x49e3da,_0x4919eb){if(_0x49e3da[_0xb698('0x53')]['id']){delete _0x49e3da[_0xb698('0x53')]['id'];}return db['SalesforceConfiguration'][_0xb698('0x51')]({'where':{'id':_0x49e3da[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x4919eb,null))[_0xb698('0x1c')](saveUpdates(_0x49e3da[_0xb698('0x53')],null))['then'](respondWithResult(_0x4919eb,null))[_0xb698('0x4d')](handleError(_0x4919eb,null));};exports[_0xb698('0x2e')]=function(_0x1cf440,_0x56cd0b){return db[_0xb698('0x4a')][_0xb698('0x51')]({'where':{'id':_0x1cf440[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x56cd0b,null))[_0xb698('0x1c')](removeEntity(_0x56cd0b,null))[_0xb698('0x4d')](handleError(_0x56cd0b,null));};exports['getFields']=function(_0x2ac5cc,_0x48b811,_0x54dacd){var _0x48a8de={};var _0x520057={};var _0x3f0238;var _0x1e821e;return db[_0xb698('0x4a')][_0xb698('0x56')]({'where':{'id':_0x2ac5cc['params']['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x48b811,null))[_0xb698('0x1c')](function(_0x5edd12){if(_0x5edd12){_0x3f0238=_0x5edd12;_0x520057[_0xb698('0x35')]=_[_0xb698('0x37')](db[_0xb698('0x57')][_0xb698('0x34')]);_0x520057[_0xb698('0x36')]=_[_0xb698('0x37')](_0x2ac5cc['query']);_0x520057[_0xb698('0x38')]=_[_0xb698('0x39')](_0x520057['model'],_0x520057[_0xb698('0x36')]);_0x48a8de['attributes']=_[_0xb698('0x39')](_0x520057['model'],qs['fields'](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x3b')]));_0x48a8de[_0xb698('0x3a')]=_0x48a8de['attributes']['length']?_0x48a8de['attributes']:_0x520057[_0xb698('0x35')];_0x48a8de[_0xb698('0x3f')]=qs[_0xb698('0x40')](_0x2ac5cc['query']['sort']);_0x48a8de[_0xb698('0x41')]=qs[_0xb698('0x38')](_[_0xb698('0x42')](_0x2ac5cc[_0xb698('0x36')],_0x520057[_0xb698('0x38')]));if(_0x2ac5cc[_0xb698('0x36')][_0xb698('0x43')]){_0x48a8de[_0xb698('0x41')]=_[_0xb698('0x44')](_0x48a8de['where'],{'$or':_['map'](_0x48a8de['attributes'],function(_0x57a038){var _0x266488={};_0x266488[_0x57a038]={'$like':'%'+_0x2ac5cc[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x266488;})});}_0x48a8de=_[_0xb698('0x44')]({},_0x48a8de,_0x2ac5cc[_0xb698('0x50')]);return _0x3f0238[_0xb698('0x58')](_0x48a8de);}})[_0xb698('0x1c')](function(_0x2a2c1){if(_0x2a2c1){_0x1e821e=_0x2a2c1[_0xb698('0x3c')];if(!_0x2ac5cc['query']['hasOwnProperty']('nolimit')){_0x48a8de[_0xb698('0x29')]=qs[_0xb698('0x29')](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x29')]);_0x48a8de[_0xb698('0x28')]=qs[_0xb698('0x28')](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x28')]);}return _0x3f0238[_0xb698('0x58')](_0x48a8de);}})[_0xb698('0x1c')](function(_0x45ce54){if(_0x45ce54){return _0x45ce54?{'count':_0x1e821e,'rows':_0x45ce54}:null;}})['then'](respondWithResult(_0x48b811,null))[_0xb698('0x4d')](handleError(_0x48b811,null));};exports[_0xb698('0x59')]=function(_0x526689,_0x51062a,_0x13cf08){var _0x4084df={};var _0x18b66b={};var _0x1565c8;var _0x5c1745;return db[_0xb698('0x4a')][_0xb698('0x56')]({'where':{'id':_0x526689[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x51062a,null))[_0xb698('0x1c')](function(_0x588a32){if(_0x588a32){_0x1565c8=_0x588a32;_0x18b66b['model']=_['keys'](db[_0xb698('0x57')][_0xb698('0x34')]);_0x18b66b[_0xb698('0x36')]=_['keys'](_0x526689[_0xb698('0x36')]);_0x18b66b['filters']=_[_0xb698('0x39')](_0x18b66b[_0xb698('0x35')],_0x18b66b['query']);_0x4084df['attributes']=_[_0xb698('0x39')](_0x18b66b[_0xb698('0x35')],qs['fields'](_0x526689['query'][_0xb698('0x3b')]));_0x4084df['attributes']=_0x4084df[_0xb698('0x3a')][_0xb698('0x3c')]?_0x4084df[_0xb698('0x3a')]:_0x18b66b[_0xb698('0x35')];_0x4084df[_0xb698('0x3f')]=qs['sort'](_0x526689[_0xb698('0x36')][_0xb698('0x40')]);_0x4084df[_0xb698('0x41')]=qs[_0xb698('0x38')](_[_0xb698('0x42')](_0x526689[_0xb698('0x36')],_0x18b66b[_0xb698('0x38')]));if(_0x526689['query'][_0xb698('0x43')]){_0x4084df['where']=_['merge'](_0x4084df['where'],{'$or':_[_0xb698('0x45')](_0x4084df[_0xb698('0x3a')],function(_0x1edb6a){var _0x1e4824={};_0x1e4824[_0x1edb6a]={'$like':'%'+_0x526689[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x1e4824;})});}_0x4084df=_[_0xb698('0x44')]({},_0x4084df,_0x526689[_0xb698('0x50')]);return _0x1565c8[_0xb698('0x59')](_0x4084df);}})[_0xb698('0x1c')](function(_0x34f0a3){if(_0x34f0a3){_0x5c1745=_0x34f0a3[_0xb698('0x3c')];if(!_0x526689[_0xb698('0x36')]['hasOwnProperty'](_0xb698('0x3e'))){_0x4084df['limit']=qs[_0xb698('0x29')](_0x526689[_0xb698('0x36')]['limit']);_0x4084df['offset']=qs[_0xb698('0x28')](_0x526689[_0xb698('0x36')][_0xb698('0x28')]);}return _0x1565c8[_0xb698('0x59')](_0x4084df);}})[_0xb698('0x1c')](function(_0x3de387){if(_0x3de387){return _0x3de387?{'count':_0x5c1745,'rows':_0x3de387}:null;}})['then'](respondWithResult(_0x51062a,null))['catch'](handleError(_0x51062a,null));};exports[_0xb698('0x5a')]=function(_0x212cfe,_0x3a2b35,_0x27406c){var _0x3be7ac={};var _0x1e2239={};var _0x4df227;var _0x1a6608;return db['SalesforceConfiguration'][_0xb698('0x56')]({'where':{'id':_0x212cfe[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x3a2b35,null))[_0xb698('0x1c')](function(_0x48927c){if(_0x48927c){_0x4df227=_0x48927c;_0x1e2239[_0xb698('0x35')]=_['keys'](db[_0xb698('0x57')][_0xb698('0x34')]);_0x1e2239[_0xb698('0x36')]=_['keys'](_0x212cfe['query']);_0x1e2239['filters']=_['intersection'](_0x1e2239[_0xb698('0x35')],_0x1e2239['query']);_0x3be7ac[_0xb698('0x3a')]=_[_0xb698('0x39')](_0x1e2239['model'],qs[_0xb698('0x3b')](_0x212cfe[_0xb698('0x36')]['fields']));_0x3be7ac[_0xb698('0x3a')]=_0x3be7ac[_0xb698('0x3a')][_0xb698('0x3c')]?_0x3be7ac[_0xb698('0x3a')]:_0x1e2239[_0xb698('0x35')];_0x3be7ac['order']=qs['sort'](_0x212cfe[_0xb698('0x36')][_0xb698('0x40')]);_0x3be7ac['where']=qs[_0xb698('0x38')](_['pick'](_0x212cfe[_0xb698('0x36')],_0x1e2239['filters']));if(_0x212cfe[_0xb698('0x36')][_0xb698('0x43')]){_0x3be7ac[_0xb698('0x41')]=_[_0xb698('0x44')](_0x3be7ac['where'],{'$or':_[_0xb698('0x45')](_0x3be7ac[_0xb698('0x3a')],function(_0x67c95c){var _0x565d59={};_0x565d59[_0x67c95c]={'$like':'%'+_0x212cfe['query'][_0xb698('0x43')]+'%'};return _0x565d59;})});}_0x3be7ac=_[_0xb698('0x44')]({},_0x3be7ac,_0x212cfe[_0xb698('0x50')]);return _0x4df227[_0xb698('0x5a')](_0x3be7ac);}})[_0xb698('0x1c')](function(_0x2027f8){if(_0x2027f8){_0x1a6608=_0x2027f8[_0xb698('0x3c')];if(!_0x212cfe[_0xb698('0x36')]['hasOwnProperty'](_0xb698('0x3e'))){_0x3be7ac[_0xb698('0x29')]=qs['limit'](_0x212cfe['query'][_0xb698('0x29')]);_0x3be7ac['offset']=qs[_0xb698('0x28')](_0x212cfe[_0xb698('0x36')][_0xb698('0x28')]);}return _0x4df227[_0xb698('0x5a')](_0x3be7ac);}})[_0xb698('0x1c')](function(_0x101447){if(_0x101447){return _0x101447?{'count':_0x1a6608,'rows':_0x101447}:null;}})['then'](respondWithResult(_0x3a2b35,null))['catch'](handleError(_0x3a2b35,null));}; \ No newline at end of file +var _0x5401=['mustache','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','http','test','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','field','merge','SalesforceConfiguration','includeAll','include','rows','show','params','options','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xb0099a,_0x29ad2f){var _0x66c25e=function(_0x78f20e){while(--_0x78f20e){_0xb0099a['push'](_0xb0099a['shift']());}};_0x66c25e(++_0x29ad2f);}(_0x5401,0xfd));var _0x1540=function(_0x50ad01,_0x31cfed){_0x50ad01=_0x50ad01-0x0;var _0x31a9bd=_0x5401[_0x50ad01];return _0x31a9bd;};'use strict';var pdf=require(_0x1540('0x0'));var emlformat=require(_0x1540('0x1'));var rimraf=require(_0x1540('0x2'));var zipdir=require(_0x1540('0x3'));var jsonpatch=require(_0x1540('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1540('0x5'));var util=require('util');var path=require(_0x1540('0x6'));var sox=require(_0x1540('0x7'));var csv=require('to-csv');var ejs=require(_0x1540('0x8'));var fs=require('fs');var _=require(_0x1540('0x9'));var squel=require(_0x1540('0xa'));var crypto=require(_0x1540('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1540('0xc'));var querystring=require(_0x1540('0xd'));var Papa=require(_0x1540('0xe'));var Redis=require('ioredis');var authService=require(_0x1540('0xf'));var qs=require(_0x1540('0x10'));var hardwareService=require(_0x1540('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x1540('0x12'));var config=require('../../config/environment');var db=require(_0x1540('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1540('0x14')]({'port':0x232a});function checkPasswordPattern(_0x324124,_0x5eea0e,_0x17a7ba){if(_0x17a7ba){var _0x332ea2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x332ea2[_0x1540('0x15')](_0x5eea0e)){return _0x324124;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x324124;}}function respondWithRpcPromise(_0x51f216,_0x54d7b3,_0xf99a64,_0x4ffdd8){return new BPromise(function(_0x5cf80d,_0x5db018){var _0x4bd586=_0x4ffdd8||client;return _0x4bd586[_0x1540('0x16')](_0x51f216,_0xf99a64)[_0x1540('0x17')](function(_0x5f4c01){logger['info'](_0x1540('0x18'),_0x54d7b3,_0x1540('0x19'));logger[_0x1540('0x1a')](_0x1540('0x1b'),_0x54d7b3,_0x1540('0x19'),JSON[_0x1540('0x1c')](_0x5f4c01));if(_0x5f4c01['error']){if(_0x5f4c01['error'][_0x1540('0x1d')]===0x1f4){logger[_0x1540('0x1e')](_0x1540('0x18'),_0x54d7b3,_0x5f4c01['error']['message']);return _0x5db018(_0x5f4c01[_0x1540('0x1e')][_0x1540('0x1f')]);}logger['error'](_0x1540('0x18'),_0x54d7b3,_0x5f4c01[_0x1540('0x1e')][_0x1540('0x1f')]);return _0x5cf80d(_0x5f4c01['error']['message']);}else{logger[_0x1540('0x20')](_0x1540('0x18'),_0x54d7b3,_0x1540('0x19'));_0x5cf80d(_0x5f4c01[_0x1540('0x21')][_0x1540('0x1f')]);}})[_0x1540('0x22')](function(_0x514a3c){logger[_0x1540('0x1e')](_0x1540('0x18'),_0x54d7b3,_0x514a3c);_0x5db018(_0x514a3c);});});}function respondWithStatusCode(_0x568e7e,_0x177f38){_0x177f38=_0x177f38||0xcc;return function(_0x30e76c){if(_0x30e76c){return _0x568e7e[_0x1540('0x23')](_0x177f38);}return _0x568e7e[_0x1540('0x24')](_0x177f38)[_0x1540('0x25')]();};}function respondWithResult(_0x11830a,_0x5916a){_0x5916a=_0x5916a||0xc8;return function(_0x4af9e3){if(_0x4af9e3){return _0x11830a['status'](_0x5916a)['json'](_0x4af9e3);}};}function respondWithFilteredResult(_0x59808e,_0x3255bf){return function(_0x491e5b){if(_0x491e5b){var _0x3801b9=_0x491e5b[_0x1540('0x26')],_0x5229e2=_0x3255bf[_0x1540('0x27')],_0x12a9a8=_0x3255bf[_0x1540('0x27')]+_0x3255bf[_0x1540('0x28')],_0xd0b6cd;if(_0x12a9a8>=_0x3801b9){_0x12a9a8=_0x3801b9;_0xd0b6cd=0xc8;}else{_0xd0b6cd=0xce;}_0x59808e[_0x1540('0x24')](_0xd0b6cd);return _0x59808e['set'](_0x1540('0x29'),_0x5229e2+'-'+_0x12a9a8+'/'+_0x3801b9)[_0x1540('0x2a')](_0x491e5b);}return null;};}function patchUpdates(_0x4664c0){return function(_0xe4cc0a){try{jsonpatch[_0x1540('0x2b')](_0xe4cc0a,_0x4664c0,!![]);}catch(_0x1497a7){return BPromise[_0x1540('0x2c')](_0x1497a7);}return _0xe4cc0a['save']();};}function saveUpdates(_0x593bb6,_0x2c15b8){return function(_0x400119){if(_0x400119){return _0x400119[_0x1540('0x2d')](_0x593bb6)[_0x1540('0x17')](function(_0x4e5f67){return _0x4e5f67;});}return null;};}function removeEntity(_0xf6b03e,_0x1ae5bb){return function(_0x5ece9f){if(_0x5ece9f){return _0x5ece9f[_0x1540('0x2e')]()[_0x1540('0x17')](function(){_0xf6b03e[_0x1540('0x24')](0xcc)[_0x1540('0x25')]();});}};}function handleEntityNotFound(_0x59ab77,_0x33bd35){return function(_0x1675a9){if(!_0x1675a9){_0x59ab77[_0x1540('0x23')](0x194);}return _0x1675a9;};}function handleError(_0x58ade3,_0x19b1c8){_0x19b1c8=_0x19b1c8||0x1f4;return function(_0x1b5736){logger[_0x1540('0x1e')](_0x1b5736[_0x1540('0x2f')]);if(_0x1b5736[_0x1540('0x30')]){delete _0x1b5736['name'];}_0x58ade3['status'](_0x19b1c8)[_0x1540('0x31')](_0x1b5736);};}exports[_0x1540('0x32')]=function(_0x1f07fe,_0xd2222f){var _0x1d2701={},_0x5db603={},_0x18e8c3={'count':0x0,'rows':[]};var _0x3d0e8a=db['SalesforceConfiguration'][_0x1540('0x33')];_0x5db603[_0x1540('0x34')]=_[_0x1540('0x35')](_0x3d0e8a);_0x5db603[_0x1540('0x36')]=_[_0x1540('0x35')](_0x1f07fe[_0x1540('0x36')]);_0x5db603[_0x1540('0x37')]=_[_0x1540('0x38')](_0x5db603[_0x1540('0x34')],_0x5db603[_0x1540('0x36')]);_0x1d2701[_0x1540('0x39')]=_[_0x1540('0x38')](_0x5db603[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x1f07fe['query'][_0x1540('0x3a')]));_0x1d2701['attributes']=_0x1d2701['attributes'][_0x1540('0x3b')]?_0x1d2701[_0x1540('0x39')]:_0x5db603[_0x1540('0x34')];if(!_0x1f07fe[_0x1540('0x36')][_0x1540('0x3c')](_0x1540('0x3d'))){_0x1d2701['limit']=qs['limit'](_0x1f07fe[_0x1540('0x36')][_0x1540('0x28')]);_0x1d2701[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x1f07fe[_0x1540('0x36')]['offset']);}_0x1d2701[_0x1540('0x3e')]=qs['sort'](_0x1f07fe[_0x1540('0x36')][_0x1540('0x3f')]);_0x1d2701[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x1f07fe['query'],_0x5db603[_0x1540('0x37')]));if(_0x1f07fe[_0x1540('0x36')][_0x1540('0x42')]){_0x1d2701[_0x1540('0x40')]=_['merge'](_0x1d2701[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x3d0e8a,function(_0x21b2c4){if(_0x21b2c4['type'][_0x1540('0x44')]!=='VIRTUAL'){var _0x10b73a={};_0x10b73a[_0x21b2c4[_0x1540('0x45')]]={'$like':'%'+_0x1f07fe[_0x1540('0x36')][_0x1540('0x42')]+'%'};return _0x10b73a;}})});}_0x1d2701=_[_0x1540('0x46')]({},_0x1d2701,_0x1f07fe['options']);var _0x47a819={'where':_0x1d2701[_0x1540('0x40')]};return db[_0x1540('0x47')][_0x1540('0x26')](_0x47a819)[_0x1540('0x17')](function(_0x168f62){_0x18e8c3[_0x1540('0x26')]=_0x168f62;if(_0x1f07fe['query'][_0x1540('0x48')]){_0x1d2701[_0x1540('0x49')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x1d2701);})['then'](function(_0x1d66dd){_0x18e8c3[_0x1540('0x4a')]=_0x1d66dd;return _0x18e8c3;})[_0x1540('0x17')](respondWithFilteredResult(_0xd2222f,_0x1d2701))['catch'](handleError(_0xd2222f,null));};exports[_0x1540('0x4b')]=function(_0x154525,_0x215a65){var _0x1a7e70={'raw':![],'where':{'id':_0x154525[_0x1540('0x4c')]['id']}},_0x17d397={};_0x17d397[_0x1540('0x34')]=_[_0x1540('0x35')](db[_0x1540('0x47')][_0x1540('0x33')]);_0x17d397[_0x1540('0x36')]=_['keys'](_0x154525[_0x1540('0x36')]);_0x17d397[_0x1540('0x37')]=_[_0x1540('0x38')](_0x17d397[_0x1540('0x34')],_0x17d397[_0x1540('0x36')]);_0x1a7e70[_0x1540('0x39')]=_['intersection'](_0x17d397[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x154525[_0x1540('0x36')][_0x1540('0x3a')]));_0x1a7e70[_0x1540('0x39')]=_0x1a7e70[_0x1540('0x39')][_0x1540('0x3b')]?_0x1a7e70[_0x1540('0x39')]:_0x17d397['model'];if(_0x154525[_0x1540('0x36')][_0x1540('0x48')]){_0x1a7e70['include']=[{'all':!![]}];}_0x1a7e70=_[_0x1540('0x46')]({},_0x1a7e70,_0x154525[_0x1540('0x4d')]);return db['SalesforceConfiguration'][_0x1540('0x4e')](_0x1a7e70)[_0x1540('0x17')](handleEntityNotFound(_0x215a65,null))['then'](respondWithResult(_0x215a65,null))[_0x1540('0x22')](handleError(_0x215a65,null));};exports[_0x1540('0x4f')]=function(_0x49ecf6,_0x312a0c){return db[_0x1540('0x47')][_0x1540('0x4f')](_0x49ecf6['body'],{})[_0x1540('0x17')](respondWithResult(_0x312a0c,0xc9))['catch'](handleError(_0x312a0c,null));};exports[_0x1540('0x2d')]=function(_0x37af93,_0x22cfa0){if(_0x37af93[_0x1540('0x50')]['id']){delete _0x37af93[_0x1540('0x50')]['id'];}return db[_0x1540('0x47')][_0x1540('0x4e')]({'where':{'id':_0x37af93[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x22cfa0,null))[_0x1540('0x17')](saveUpdates(_0x37af93['body'],null))[_0x1540('0x17')](respondWithResult(_0x22cfa0,null))[_0x1540('0x22')](handleError(_0x22cfa0,null));};exports['destroy']=function(_0x1dde65,_0x257a05){return db[_0x1540('0x47')][_0x1540('0x4e')]({'where':{'id':_0x1dde65[_0x1540('0x4c')]['id']}})['then'](handleEntityNotFound(_0x257a05,null))[_0x1540('0x17')](removeEntity(_0x257a05,null))[_0x1540('0x22')](handleError(_0x257a05,null));};exports[_0x1540('0x51')]=function(_0x9a1f25,_0x1ad085,_0x555d79){var _0x1ad498={};var _0x363bce={};var _0x528119;var _0x50c3a0;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x9a1f25['params']['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x1ad085,null))[_0x1540('0x17')](function(_0xdf2d8c){if(_0xdf2d8c){_0x528119=_0xdf2d8c;_0x363bce['model']=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x363bce[_0x1540('0x36')]=_[_0x1540('0x35')](_0x9a1f25[_0x1540('0x36')]);_0x363bce['filters']=_[_0x1540('0x38')](_0x363bce[_0x1540('0x34')],_0x363bce['query']);_0x1ad498['attributes']=_[_0x1540('0x38')](_0x363bce[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x9a1f25[_0x1540('0x36')][_0x1540('0x3a')]));_0x1ad498[_0x1540('0x39')]=_0x1ad498[_0x1540('0x39')][_0x1540('0x3b')]?_0x1ad498[_0x1540('0x39')]:_0x363bce[_0x1540('0x34')];_0x1ad498[_0x1540('0x3e')]=qs[_0x1540('0x3f')](_0x9a1f25['query'][_0x1540('0x3f')]);_0x1ad498[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x9a1f25[_0x1540('0x36')],_0x363bce[_0x1540('0x37')]));if(_0x9a1f25['query'][_0x1540('0x42')]){_0x1ad498[_0x1540('0x40')]=_[_0x1540('0x46')](_0x1ad498[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x1ad498['attributes'],function(_0x512edb){var _0x17cbac={};_0x17cbac[_0x512edb]={'$like':'%'+_0x9a1f25['query'][_0x1540('0x42')]+'%'};return _0x17cbac;})});}_0x1ad498=_[_0x1540('0x46')]({},_0x1ad498,_0x9a1f25['options']);return _0x528119[_0x1540('0x51')](_0x1ad498);}})[_0x1540('0x17')](function(_0x349f08){if(_0x349f08){_0x50c3a0=_0x349f08[_0x1540('0x3b')];if(!_0x9a1f25[_0x1540('0x36')][_0x1540('0x3c')](_0x1540('0x3d'))){_0x1ad498[_0x1540('0x28')]=qs[_0x1540('0x28')](_0x9a1f25[_0x1540('0x36')]['limit']);_0x1ad498[_0x1540('0x27')]=qs['offset'](_0x9a1f25[_0x1540('0x36')]['offset']);}return _0x528119['getFields'](_0x1ad498);}})[_0x1540('0x17')](function(_0x4d34b8){if(_0x4d34b8){return _0x4d34b8?{'count':_0x50c3a0,'rows':_0x4d34b8}:null;}})['then'](respondWithResult(_0x1ad085,null))[_0x1540('0x22')](handleError(_0x1ad085,null));};exports[_0x1540('0x54')]=function(_0x49484a,_0x309bb8,_0x5871b4){var _0xd5ac72={};var _0x385a7b={};var _0x18d052;var _0x320b66;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x49484a[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x309bb8,null))['then'](function(_0x3db5e1){if(_0x3db5e1){_0x18d052=_0x3db5e1;_0x385a7b[_0x1540('0x34')]=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x385a7b[_0x1540('0x36')]=_[_0x1540('0x35')](_0x49484a[_0x1540('0x36')]);_0x385a7b[_0x1540('0x37')]=_[_0x1540('0x38')](_0x385a7b['model'],_0x385a7b[_0x1540('0x36')]);_0xd5ac72[_0x1540('0x39')]=_['intersection'](_0x385a7b[_0x1540('0x34')],qs[_0x1540('0x3a')](_0x49484a['query']['fields']));_0xd5ac72[_0x1540('0x39')]=_0xd5ac72[_0x1540('0x39')][_0x1540('0x3b')]?_0xd5ac72[_0x1540('0x39')]:_0x385a7b[_0x1540('0x34')];_0xd5ac72[_0x1540('0x3e')]=qs[_0x1540('0x3f')](_0x49484a[_0x1540('0x36')]['sort']);_0xd5ac72[_0x1540('0x40')]=qs[_0x1540('0x37')](_[_0x1540('0x41')](_0x49484a[_0x1540('0x36')],_0x385a7b['filters']));if(_0x49484a[_0x1540('0x36')]['filter']){_0xd5ac72[_0x1540('0x40')]=_[_0x1540('0x46')](_0xd5ac72[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0xd5ac72[_0x1540('0x39')],function(_0x5cb0e0){var _0x21bb4c={};_0x21bb4c[_0x5cb0e0]={'$like':'%'+_0x49484a['query'][_0x1540('0x42')]+'%'};return _0x21bb4c;})});}_0xd5ac72=_[_0x1540('0x46')]({},_0xd5ac72,_0x49484a[_0x1540('0x4d')]);return _0x18d052['getSubjects'](_0xd5ac72);}})[_0x1540('0x17')](function(_0x16fa91){if(_0x16fa91){_0x320b66=_0x16fa91[_0x1540('0x3b')];if(!_0x49484a['query'][_0x1540('0x3c')](_0x1540('0x3d'))){_0xd5ac72[_0x1540('0x28')]=qs['limit'](_0x49484a['query']['limit']);_0xd5ac72[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x49484a['query'][_0x1540('0x27')]);}return _0x18d052[_0x1540('0x54')](_0xd5ac72);}})[_0x1540('0x17')](function(_0xea26d5){if(_0xea26d5){return _0xea26d5?{'count':_0x320b66,'rows':_0xea26d5}:null;}})[_0x1540('0x17')](respondWithResult(_0x309bb8,null))['catch'](handleError(_0x309bb8,null));};exports[_0x1540('0x55')]=function(_0x48c0b2,_0x2f2a46,_0x4f7e44){var _0x165e80={};var _0x25662a={};var _0x9f8a60;var _0x51bbff;return db[_0x1540('0x47')][_0x1540('0x52')]({'where':{'id':_0x48c0b2[_0x1540('0x4c')]['id']}})[_0x1540('0x17')](handleEntityNotFound(_0x2f2a46,null))[_0x1540('0x17')](function(_0x49de71){if(_0x49de71){_0x9f8a60=_0x49de71;_0x25662a[_0x1540('0x34')]=_['keys'](db[_0x1540('0x53')][_0x1540('0x33')]);_0x25662a['query']=_['keys'](_0x48c0b2[_0x1540('0x36')]);_0x25662a[_0x1540('0x37')]=_[_0x1540('0x38')](_0x25662a[_0x1540('0x34')],_0x25662a[_0x1540('0x36')]);_0x165e80['attributes']=_['intersection'](_0x25662a['model'],qs[_0x1540('0x3a')](_0x48c0b2[_0x1540('0x36')]['fields']));_0x165e80[_0x1540('0x39')]=_0x165e80[_0x1540('0x39')][_0x1540('0x3b')]?_0x165e80['attributes']:_0x25662a[_0x1540('0x34')];_0x165e80[_0x1540('0x3e')]=qs['sort'](_0x48c0b2[_0x1540('0x36')]['sort']);_0x165e80[_0x1540('0x40')]=qs[_0x1540('0x37')](_['pick'](_0x48c0b2[_0x1540('0x36')],_0x25662a[_0x1540('0x37')]));if(_0x48c0b2['query']['filter']){_0x165e80[_0x1540('0x40')]=_[_0x1540('0x46')](_0x165e80[_0x1540('0x40')],{'$or':_[_0x1540('0x43')](_0x165e80['attributes'],function(_0x56b04e){var _0xf78bab={};_0xf78bab[_0x56b04e]={'$like':'%'+_0x48c0b2[_0x1540('0x36')][_0x1540('0x42')]+'%'};return _0xf78bab;})});}_0x165e80=_[_0x1540('0x46')]({},_0x165e80,_0x48c0b2[_0x1540('0x4d')]);return _0x9f8a60[_0x1540('0x55')](_0x165e80);}})[_0x1540('0x17')](function(_0x3e8e57){if(_0x3e8e57){_0x51bbff=_0x3e8e57[_0x1540('0x3b')];if(!_0x48c0b2[_0x1540('0x36')]['hasOwnProperty'](_0x1540('0x3d'))){_0x165e80[_0x1540('0x28')]=qs['limit'](_0x48c0b2[_0x1540('0x36')][_0x1540('0x28')]);_0x165e80[_0x1540('0x27')]=qs[_0x1540('0x27')](_0x48c0b2[_0x1540('0x36')]['offset']);}return _0x9f8a60['getDescriptions'](_0x165e80);}})['then'](function(_0x473b07){if(_0x473b07){return _0x473b07?{'count':_0x51bbff,'rows':_0x473b07}:null;}})[_0x1540('0x17')](respondWithResult(_0x2f2a46,null))['catch'](handleError(_0x2f2a46,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e46fc68..cea6a8a 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 _0xe1f1=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x18c246,_0x53540e){var _0x27587e=function(_0x3b4798){while(--_0x3b4798){_0x18c246['push'](_0x18c246['shift']());}};_0x27587e(++_0x53540e);}(_0xe1f1,0xa0));var _0x1e1f=function(_0x9b84b4,_0x17077d){_0x9b84b4=_0x9b84b4-0x0;var _0x43c4e8=_0xe1f1[_0x9b84b4];return _0x43c4e8;};'use strict';var _=require('lodash');var util=require(_0x1e1f('0x0'));var logger=require(_0x1e1f('0x1'))(_0x1e1f('0x2'));var moment=require(_0x1e1f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e1f('0x4'));var fs=require('fs');var path=require(_0x1e1f('0x5'));var rimraf=require('rimraf');var config=require(_0x1e1f('0x6'));var attributes=require(_0x1e1f('0x7'));module['exports']=function(_0x4314de,_0x2bebe0){return _0x4314de['define'](_0x1e1f('0x8'),attributes,{'tableName':_0x1e1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4feb=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x188dd3,_0x1aa2ef){var _0x1edca0=function(_0x2ed731){while(--_0x2ed731){_0x188dd3['push'](_0x188dd3['shift']());}};_0x1edca0(++_0x1aa2ef);}(_0x4feb,0xf9));var _0xb4fe=function(_0x539e3e,_0x573ca1){_0x539e3e=_0x539e3e-0x0;var _0x4a7ff0=_0x4feb[_0x539e3e];return _0x4a7ff0;};'use strict';var _=require(_0xb4fe('0x0'));var util=require('util');var logger=require(_0xb4fe('0x1'))(_0xb4fe('0x2'));var moment=require(_0xb4fe('0x3'));var BPromise=require(_0xb4fe('0x4'));var rp=require(_0xb4fe('0x5'));var fs=require('fs');var path=require(_0xb4fe('0x6'));var rimraf=require('rimraf');var config=require(_0xb4fe('0x7'));var attributes=require(_0xb4fe('0x8'));module[_0xb4fe('0x9')]=function(_0x324672,_0x32ada7){return _0x324672['define'](_0xb4fe('0xa'),attributes,{'tableName':_0xb4fe('0xb'),'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 14faf84..3e7ef92 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x7217,0x19e));var _0x7721=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7217[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x7a54=['info','SalesforceConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x53ed7a,_0x7fad75){_0x53ed7a=_0x53ed7a-0x0;var _0x3b6bbf=_0x7a54[_0x53ed7a];return _0x3b6bbf;};'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')]('SalesforceConfiguration,\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 diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2f92a7a..ae851e1 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 _0x4e8b=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x4e8b,0xab));var _0xb4e8=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x4e8b[_0x4de586];return _0x46baf5;};'use strict';var multer=require(_0xb4e8('0x0'));var util=require(_0xb4e8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4e8('0x2')]();var auth=require(_0xb4e8('0x3'));var interaction=require(_0xb4e8('0x4'));var config=require('../../config/environment');var controller=require(_0xb4e8('0x5'));router[_0xb4e8('0x6')]('/',auth[_0xb4e8('0x7')](),controller[_0xb4e8('0x8')]);router[_0xb4e8('0x6')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller['show']);router[_0xb4e8('0xa')]('/',auth[_0xb4e8('0x7')](),controller[_0xb4e8('0xb')]);router[_0xb4e8('0xc')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller[_0xb4e8('0xd')]);router[_0xb4e8('0xe')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller['destroy']);module[_0xb4e8('0xf')]=router; \ No newline at end of file +var _0x30e5=['index','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4beb7a,_0x246983){var _0x50c7dd=function(_0x4c006c){while(--_0x4c006c){_0x4beb7a['push'](_0x4beb7a['shift']());}};_0x50c7dd(++_0x246983);}(_0x30e5,0x14c));var _0x530e=function(_0x5d706f,_0x107ecc){_0x5d706f=_0x5d706f-0x0;var _0xe30a47=_0x30e5[_0x5d706f];return _0xe30a47;};'use strict';var multer=require(_0x530e('0x0'));var util=require(_0x530e('0x1'));var path=require(_0x530e('0x2'));var timeout=require(_0x530e('0x3'));var express=require(_0x530e('0x4'));var router=express[_0x530e('0x5')]();var auth=require(_0x530e('0x6'));var interaction=require(_0x530e('0x7'));var config=require(_0x530e('0x8'));var controller=require('./intSalesforceField.controller');router[_0x530e('0x9')]('/',auth['isAuthenticated'](),controller[_0x530e('0xa')]);router[_0x530e('0x9')](_0x530e('0xb'),auth[_0x530e('0xc')](),controller[_0x530e('0xd')]);router[_0x530e('0xe')]('/',auth['isAuthenticated'](),controller[_0x530e('0xf')]);router[_0x530e('0x10')]('/:id',auth[_0x530e('0xc')](),controller[_0x530e('0x11')]);router['delete'](_0x530e('0xb'),auth[_0x530e('0xc')](),controller['destroy']);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 6a49a45..6e3400f 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 _0x63c7=['customVariable','ENUM','string','variable','STRING'];(function(_0x3ae4cc,_0x1cd059){var _0x102b82=function(_0x5cfcdf){while(--_0x5cfcdf){_0x3ae4cc['push'](_0x3ae4cc['shift']());}};_0x102b82(++_0x1cd059);}(_0x63c7,0x1a5));var _0x763c=function(_0x2fec16,_0x3c6e34){_0x2fec16=_0x2fec16-0x0;var _0x56b703=_0x63c7[_0x2fec16];return _0x56b703;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x763c('0x0')](_0x763c('0x1'),_0x763c('0x2'),'customVariable','keyValue'),'defaultValue':_0x763c('0x1')},'content':{'type':Sequelize[_0x763c('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x763c('0x0')](_0x763c('0x1'),_0x763c('0x2'),_0x763c('0x4'))},'keyContent':{'type':Sequelize[_0x763c('0x3')]},'idField':{'type':Sequelize[_0x763c('0x3')]},'variableName':{'type':Sequelize[_0x763c('0x3')]}}; \ No newline at end of file +var _0xa0da=['keyValue','STRING','sequelize','exports','string','variable','customVariable'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa0da,0x1bb));var _0xaa0d=function(_0xe470b2,_0x13d3be){_0xe470b2=_0xe470b2-0x0;var _0x373fd7=_0xa0da[_0xe470b2];return _0x373fd7;};'use strict';var Sequelize=require(_0xaa0d('0x0'));module[_0xaa0d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xaa0d('0x2'),_0xaa0d('0x3'),_0xaa0d('0x4'),_0xaa0d('0x5')),'defaultValue':_0xaa0d('0x2')},'content':{'type':Sequelize[_0xaa0d('0x6')]},'key':{'type':Sequelize[_0xaa0d('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xaa0d('0x3'),_0xaa0d('0x4'))},'keyContent':{'type':Sequelize[_0xaa0d('0x6')]},'idField':{'type':Sequelize[_0xaa0d('0x6')]},'variableName':{'type':Sequelize[_0xaa0d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 58c925e..2fdca05 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 _0x4d5c=['path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','SalesforceField','findAll','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x5ab5d9,_0x38a056){var _0x106fb8=function(_0x135e83){while(--_0x135e83){_0x5ab5d9['push'](_0x5ab5d9['shift']());}};_0x106fb8(++_0x38a056);}(_0x4d5c,0x119));var _0xc4d5=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x4d5c[_0x468b0f];return _0x3e74d9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc4d5('0x0'));var rimraf=require(_0xc4d5('0x1'));var zipdir=require(_0xc4d5('0x2'));var jsonpatch=require(_0xc4d5('0x3'));var rp=require(_0xc4d5('0x4'));var moment=require(_0xc4d5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc4d5('0x6'));var path=require(_0xc4d5('0x7'));var sox=require(_0xc4d5('0x8'));var csv=require('to-csv');var ejs=require(_0xc4d5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc4d5('0xa'));var crypto=require(_0xc4d5('0xb'));var jsforce=require(_0xc4d5('0xc'));var deskjs=require(_0xc4d5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4d5('0xe'));var Redis=require(_0xc4d5('0xf'));var authService=require(_0xc4d5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc4d5('0x11'));var logger=require(_0xc4d5('0x12'))(_0xc4d5('0x13'));var utils=require(_0xc4d5('0x14'));var config=require(_0xc4d5('0x15'));var db=require(_0xc4d5('0x16'))['db'];function respondWithStatusCode(_0x39d3a8,_0x22eda8){_0x22eda8=_0x22eda8||0xcc;return function(_0xc4873f){if(_0xc4873f){return _0x39d3a8[_0xc4d5('0x17')](_0x22eda8);}return _0x39d3a8[_0xc4d5('0x18')](_0x22eda8)[_0xc4d5('0x19')]();};}function respondWithResult(_0x260cf2,_0x1fdc0b){_0x1fdc0b=_0x1fdc0b||0xc8;return function(_0x3f3a3a){if(_0x3f3a3a){return _0x260cf2[_0xc4d5('0x18')](_0x1fdc0b)[_0xc4d5('0x1a')](_0x3f3a3a);}};}function respondWithFilteredResult(_0x59375c,_0x3c4098){return function(_0x529067){if(_0x529067){var _0x1970ae=_0x529067[_0xc4d5('0x1b')],_0x277a97=_0x3c4098['offset'],_0x50770e=_0x3c4098[_0xc4d5('0x1c')]+_0x3c4098[_0xc4d5('0x1d')],_0x2b3b17;if(_0x50770e>=_0x1970ae){_0x50770e=_0x1970ae;_0x2b3b17=0xc8;}else{_0x2b3b17=0xce;}_0x59375c['status'](_0x2b3b17);return _0x59375c[_0xc4d5('0x1e')](_0xc4d5('0x1f'),_0x277a97+'-'+_0x50770e+'/'+_0x1970ae)[_0xc4d5('0x1a')](_0x529067);}return null;};}function patchUpdates(_0x3e7686){return function(_0x458300){try{jsonpatch[_0xc4d5('0x20')](_0x458300,_0x3e7686,!![]);}catch(_0x2dfe31){return BPromise[_0xc4d5('0x21')](_0x2dfe31);}return _0x458300[_0xc4d5('0x22')]();};}function saveUpdates(_0x319fef,_0x3c7417){return function(_0x5e79d1){if(_0x5e79d1){return _0x5e79d1[_0xc4d5('0x23')](_0x319fef)[_0xc4d5('0x24')](function(_0x4a9c4a){return _0x4a9c4a;});}return null;};}function removeEntity(_0xa688b5,_0x30e4d5){return function(_0x282501){if(_0x282501){return _0x282501[_0xc4d5('0x25')]()[_0xc4d5('0x24')](function(){_0xa688b5[_0xc4d5('0x18')](0xcc)[_0xc4d5('0x19')]();});}};}function handleEntityNotFound(_0x4c93fa,_0x12257e){return function(_0x38a9c1){if(!_0x38a9c1){_0x4c93fa['sendStatus'](0x194);}return _0x38a9c1;};}function handleError(_0x491875,_0x2893ad){_0x2893ad=_0x2893ad||0x1f4;return function(_0x4a3922){logger[_0xc4d5('0x26')](_0x4a3922['stack']);if(_0x4a3922[_0xc4d5('0x27')]){delete _0x4a3922[_0xc4d5('0x27')];}_0x491875['status'](_0x2893ad)[_0xc4d5('0x28')](_0x4a3922);};}exports['index']=function(_0x42e23c,_0x465b68){var _0x1e1b19={},_0x4e3997={},_0x594837={'count':0x0,'rows':[]};var _0x13e00a=db['SalesforceField'][_0xc4d5('0x29')];_0x4e3997[_0xc4d5('0x2a')]=_[_0xc4d5('0x2b')](_0x13e00a);_0x4e3997[_0xc4d5('0x2c')]=_[_0xc4d5('0x2b')](_0x42e23c[_0xc4d5('0x2c')]);_0x4e3997[_0xc4d5('0x2d')]=_[_0xc4d5('0x2e')](_0x4e3997[_0xc4d5('0x2a')],_0x4e3997[_0xc4d5('0x2c')]);_0x1e1b19[_0xc4d5('0x2f')]=_[_0xc4d5('0x2e')](_0x4e3997[_0xc4d5('0x2a')],qs[_0xc4d5('0x30')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x30')]));_0x1e1b19['attributes']=_0x1e1b19[_0xc4d5('0x2f')][_0xc4d5('0x31')]?_0x1e1b19[_0xc4d5('0x2f')]:_0x4e3997['model'];if(!_0x42e23c[_0xc4d5('0x2c')]['hasOwnProperty'](_0xc4d5('0x32'))){_0x1e1b19[_0xc4d5('0x1d')]=qs[_0xc4d5('0x1d')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x1d')]);_0x1e1b19[_0xc4d5('0x1c')]=qs[_0xc4d5('0x1c')](_0x42e23c[_0xc4d5('0x2c')]['offset']);}_0x1e1b19[_0xc4d5('0x33')]=qs[_0xc4d5('0x34')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x34')]);_0x1e1b19['where']=qs[_0xc4d5('0x2d')](_[_0xc4d5('0x35')](_0x42e23c[_0xc4d5('0x2c')],_0x4e3997[_0xc4d5('0x2d')]));if(_0x42e23c[_0xc4d5('0x2c')]['filter']){_0x1e1b19[_0xc4d5('0x36')]=_[_0xc4d5('0x37')](_0x1e1b19[_0xc4d5('0x36')],{'$or':_[_0xc4d5('0x38')](_0x13e00a,function(_0x38961a){if(_0x38961a[_0xc4d5('0x39')][_0xc4d5('0x3a')]!==_0xc4d5('0x3b')){var _0x3b6a40={};_0x3b6a40[_0x38961a[_0xc4d5('0x3c')]]={'$like':'%'+_0x42e23c['query']['filter']+'%'};return _0x3b6a40;}})});}_0x1e1b19=_[_0xc4d5('0x37')]({},_0x1e1b19,_0x42e23c[_0xc4d5('0x3d')]);var _0x2f21d2={'where':_0x1e1b19['where']};return db['SalesforceField'][_0xc4d5('0x1b')](_0x2f21d2)[_0xc4d5('0x24')](function(_0x41d742){_0x594837['count']=_0x41d742;if(_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x3e')]){_0x1e1b19[_0xc4d5('0x3f')]=[{'all':!![]}];}return db[_0xc4d5('0x40')][_0xc4d5('0x41')](_0x1e1b19);})[_0xc4d5('0x24')](function(_0x3c381f){_0x594837['rows']=_0x3c381f;return _0x594837;})[_0xc4d5('0x24')](respondWithFilteredResult(_0x465b68,_0x1e1b19))[_0xc4d5('0x42')](handleError(_0x465b68,null));};exports[_0xc4d5('0x43')]=function(_0x17499f,_0xaf85d0){var _0x28f44a={'raw':!![],'where':{'id':_0x17499f['params']['id']}},_0x4ee474={};_0x4ee474[_0xc4d5('0x2a')]=_[_0xc4d5('0x2b')](db[_0xc4d5('0x40')][_0xc4d5('0x29')]);_0x4ee474['query']=_['keys'](_0x17499f[_0xc4d5('0x2c')]);_0x4ee474['filters']=_[_0xc4d5('0x2e')](_0x4ee474[_0xc4d5('0x2a')],_0x4ee474['query']);_0x28f44a[_0xc4d5('0x2f')]=_['intersection'](_0x4ee474[_0xc4d5('0x2a')],qs[_0xc4d5('0x30')](_0x17499f[_0xc4d5('0x2c')][_0xc4d5('0x30')]));_0x28f44a[_0xc4d5('0x2f')]=_0x28f44a[_0xc4d5('0x2f')][_0xc4d5('0x31')]?_0x28f44a[_0xc4d5('0x2f')]:_0x4ee474[_0xc4d5('0x2a')];if(_0x17499f[_0xc4d5('0x2c')]['includeAll']){_0x28f44a['include']=[{'all':!![]}];}_0x28f44a=_['merge']({},_0x28f44a,_0x17499f['options']);return db[_0xc4d5('0x40')]['find'](_0x28f44a)['then'](handleEntityNotFound(_0xaf85d0,null))[_0xc4d5('0x24')](respondWithResult(_0xaf85d0,null))[_0xc4d5('0x42')](handleError(_0xaf85d0,null));};exports[_0xc4d5('0x44')]=function(_0xc17747,_0x17a8e6){return db[_0xc4d5('0x40')][_0xc4d5('0x44')](_0xc17747[_0xc4d5('0x45')],{})['then'](respondWithResult(_0x17a8e6,0xc9))[_0xc4d5('0x42')](handleError(_0x17a8e6,null));};exports[_0xc4d5('0x23')]=function(_0x575954,_0x4cbb5b){if(_0x575954[_0xc4d5('0x45')]['id']){delete _0x575954[_0xc4d5('0x45')]['id'];}return db[_0xc4d5('0x40')][_0xc4d5('0x46')]({'where':{'id':_0x575954[_0xc4d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cbb5b,null))[_0xc4d5('0x24')](saveUpdates(_0x575954[_0xc4d5('0x45')],null))['then'](respondWithResult(_0x4cbb5b,null))[_0xc4d5('0x42')](handleError(_0x4cbb5b,null));};exports[_0xc4d5('0x25')]=function(_0x1e3fda,_0x150db5){return db['SalesforceField'][_0xc4d5('0x46')]({'where':{'id':_0x1e3fda['params']['id']}})[_0xc4d5('0x24')](handleEntityNotFound(_0x150db5,null))['then'](removeEntity(_0x150db5,null))[_0xc4d5('0x42')](handleError(_0x150db5,null));}; \ No newline at end of file +var _0x4b8f=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','SalesforceField','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xbc32a1,_0x1d698b){var _0x1787cb=function(_0x315c4c){while(--_0x315c4c){_0xbc32a1['push'](_0xbc32a1['shift']());}};_0x1787cb(++_0x1d698b);}(_0x4b8f,0x168));var _0xf4b8=function(_0x1258a1,_0x44ec6b){_0x1258a1=_0x1258a1-0x0;var _0x280307=_0x4b8f[_0x1258a1];return _0x280307;};'use strict';var pdf=require(_0xf4b8('0x0'));var emlformat=require(_0xf4b8('0x1'));var rimraf=require(_0xf4b8('0x2'));var zipdir=require(_0xf4b8('0x3'));var jsonpatch=require(_0xf4b8('0x4'));var rp=require(_0xf4b8('0x5'));var moment=require(_0xf4b8('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf4b8('0x7'));var util=require(_0xf4b8('0x8'));var path=require(_0xf4b8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b8('0xa'));var fs=require('fs');var _=require(_0xf4b8('0xb'));var squel=require('squel');var crypto=require(_0xf4b8('0xc'));var jsforce=require(_0xf4b8('0xd'));var deskjs=require(_0xf4b8('0xe'));var toCsv=require(_0xf4b8('0xf'));var querystring=require(_0xf4b8('0x10'));var Papa=require(_0xf4b8('0x11'));var Redis=require(_0xf4b8('0x12'));var authService=require(_0xf4b8('0x13'));var qs=require(_0xf4b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4b8('0x15'))(_0xf4b8('0x16'));var utils=require(_0xf4b8('0x17'));var config=require(_0xf4b8('0x18'));var db=require(_0xf4b8('0x19'))['db'];function respondWithStatusCode(_0x431513,_0x5d4429){_0x5d4429=_0x5d4429||0xcc;return function(_0x25572b){if(_0x25572b){return _0x431513[_0xf4b8('0x1a')](_0x5d4429);}return _0x431513[_0xf4b8('0x1b')](_0x5d4429)['end']();};}function respondWithResult(_0x54aa28,_0x505b2a){_0x505b2a=_0x505b2a||0xc8;return function(_0x1d28ac){if(_0x1d28ac){return _0x54aa28[_0xf4b8('0x1b')](_0x505b2a)[_0xf4b8('0x1c')](_0x1d28ac);}};}function respondWithFilteredResult(_0x2c9079,_0x58c258){return function(_0x2d1d77){if(_0x2d1d77){var _0x7c6b14=_0x2d1d77[_0xf4b8('0x1d')],_0x5878ff=_0x58c258[_0xf4b8('0x1e')],_0x2547a6=_0x58c258[_0xf4b8('0x1e')]+_0x58c258['limit'],_0xd67e2b;if(_0x2547a6>=_0x7c6b14){_0x2547a6=_0x7c6b14;_0xd67e2b=0xc8;}else{_0xd67e2b=0xce;}_0x2c9079['status'](_0xd67e2b);return _0x2c9079[_0xf4b8('0x1f')](_0xf4b8('0x20'),_0x5878ff+'-'+_0x2547a6+'/'+_0x7c6b14)[_0xf4b8('0x1c')](_0x2d1d77);}return null;};}function patchUpdates(_0x4a363f){return function(_0x8576b6){try{jsonpatch[_0xf4b8('0x21')](_0x8576b6,_0x4a363f,!![]);}catch(_0x27dc78){return BPromise[_0xf4b8('0x22')](_0x27dc78);}return _0x8576b6[_0xf4b8('0x23')]();};}function saveUpdates(_0x813caf,_0x467172){return function(_0x828730){if(_0x828730){return _0x828730[_0xf4b8('0x24')](_0x813caf)[_0xf4b8('0x25')](function(_0x558f55){return _0x558f55;});}return null;};}function removeEntity(_0x1259c6,_0x2cbde8){return function(_0x310e){if(_0x310e){return _0x310e[_0xf4b8('0x26')]()[_0xf4b8('0x25')](function(){_0x1259c6['status'](0xcc)[_0xf4b8('0x27')]();});}};}function handleEntityNotFound(_0x3e2986,_0x593169){return function(_0x349206){if(!_0x349206){_0x3e2986[_0xf4b8('0x1a')](0x194);}return _0x349206;};}function handleError(_0x20777c,_0x34b512){_0x34b512=_0x34b512||0x1f4;return function(_0x54ac96){logger['error'](_0x54ac96['stack']);if(_0x54ac96[_0xf4b8('0x28')]){delete _0x54ac96[_0xf4b8('0x28')];}_0x20777c[_0xf4b8('0x1b')](_0x34b512)[_0xf4b8('0x29')](_0x54ac96);};}exports['index']=function(_0x40ceef,_0x41e486){var _0x24cc21={},_0x268361={},_0x3fbfbb={'count':0x0,'rows':[]};var _0x2e2587=db[_0xf4b8('0x2a')][_0xf4b8('0x2b')];_0x268361[_0xf4b8('0x2c')]=_['keys'](_0x2e2587);_0x268361[_0xf4b8('0x2d')]=_['keys'](_0x40ceef['query']);_0x268361[_0xf4b8('0x2e')]=_[_0xf4b8('0x2f')](_0x268361[_0xf4b8('0x2c')],_0x268361[_0xf4b8('0x2d')]);_0x24cc21[_0xf4b8('0x30')]=_[_0xf4b8('0x2f')](_0x268361[_0xf4b8('0x2c')],qs[_0xf4b8('0x31')](_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x31')]));_0x24cc21[_0xf4b8('0x30')]=_0x24cc21[_0xf4b8('0x30')][_0xf4b8('0x32')]?_0x24cc21[_0xf4b8('0x30')]:_0x268361['model'];if(!_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x33')]('nolimit')){_0x24cc21['limit']=qs[_0xf4b8('0x34')](_0x40ceef['query'][_0xf4b8('0x34')]);_0x24cc21[_0xf4b8('0x1e')]=qs['offset'](_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x1e')]);}_0x24cc21[_0xf4b8('0x35')]=qs[_0xf4b8('0x36')](_0x40ceef['query'][_0xf4b8('0x36')]);_0x24cc21['where']=qs[_0xf4b8('0x2e')](_[_0xf4b8('0x37')](_0x40ceef[_0xf4b8('0x2d')],_0x268361[_0xf4b8('0x2e')]));if(_0x40ceef[_0xf4b8('0x2d')]['filter']){_0x24cc21[_0xf4b8('0x38')]=_[_0xf4b8('0x39')](_0x24cc21[_0xf4b8('0x38')],{'$or':_[_0xf4b8('0x3a')](_0x2e2587,function(_0x159e70){if(_0x159e70[_0xf4b8('0x3b')][_0xf4b8('0x3c')]!==_0xf4b8('0x3d')){var _0x6328a9={};_0x6328a9[_0x159e70[_0xf4b8('0x3e')]]={'$like':'%'+_0x40ceef[_0xf4b8('0x2d')][_0xf4b8('0x3f')]+'%'};return _0x6328a9;}})});}_0x24cc21=_['merge']({},_0x24cc21,_0x40ceef[_0xf4b8('0x40')]);var _0x47e0ac={'where':_0x24cc21[_0xf4b8('0x38')]};return db[_0xf4b8('0x2a')][_0xf4b8('0x1d')](_0x47e0ac)['then'](function(_0x2a49ac){_0x3fbfbb[_0xf4b8('0x1d')]=_0x2a49ac;if(_0x40ceef['query'][_0xf4b8('0x41')]){_0x24cc21[_0xf4b8('0x42')]=[{'all':!![]}];}return db[_0xf4b8('0x2a')][_0xf4b8('0x43')](_0x24cc21);})[_0xf4b8('0x25')](function(_0x3e660c){_0x3fbfbb[_0xf4b8('0x44')]=_0x3e660c;return _0x3fbfbb;})[_0xf4b8('0x25')](respondWithFilteredResult(_0x41e486,_0x24cc21))[_0xf4b8('0x45')](handleError(_0x41e486,null));};exports[_0xf4b8('0x46')]=function(_0x380b87,_0xa5b908){var _0x56e68e={'raw':!![],'where':{'id':_0x380b87[_0xf4b8('0x47')]['id']}},_0x4b2793={};_0x4b2793[_0xf4b8('0x2c')]=_['keys'](db['SalesforceField'][_0xf4b8('0x2b')]);_0x4b2793[_0xf4b8('0x2d')]=_[_0xf4b8('0x48')](_0x380b87[_0xf4b8('0x2d')]);_0x4b2793[_0xf4b8('0x2e')]=_[_0xf4b8('0x2f')](_0x4b2793[_0xf4b8('0x2c')],_0x4b2793[_0xf4b8('0x2d')]);_0x56e68e[_0xf4b8('0x30')]=_[_0xf4b8('0x2f')](_0x4b2793[_0xf4b8('0x2c')],qs['fields'](_0x380b87[_0xf4b8('0x2d')][_0xf4b8('0x31')]));_0x56e68e[_0xf4b8('0x30')]=_0x56e68e[_0xf4b8('0x30')][_0xf4b8('0x32')]?_0x56e68e['attributes']:_0x4b2793['model'];if(_0x380b87[_0xf4b8('0x2d')][_0xf4b8('0x41')]){_0x56e68e['include']=[{'all':!![]}];}_0x56e68e=_[_0xf4b8('0x39')]({},_0x56e68e,_0x380b87[_0xf4b8('0x40')]);return db[_0xf4b8('0x2a')][_0xf4b8('0x49')](_0x56e68e)[_0xf4b8('0x25')](handleEntityNotFound(_0xa5b908,null))[_0xf4b8('0x25')](respondWithResult(_0xa5b908,null))[_0xf4b8('0x45')](handleError(_0xa5b908,null));};exports[_0xf4b8('0x4a')]=function(_0x2ce919,_0x500c0e){return db[_0xf4b8('0x2a')][_0xf4b8('0x4a')](_0x2ce919[_0xf4b8('0x4b')],{})['then'](respondWithResult(_0x500c0e,0xc9))[_0xf4b8('0x45')](handleError(_0x500c0e,null));};exports[_0xf4b8('0x24')]=function(_0x223370,_0x3034dd){if(_0x223370[_0xf4b8('0x4b')]['id']){delete _0x223370[_0xf4b8('0x4b')]['id'];}return db[_0xf4b8('0x2a')][_0xf4b8('0x49')]({'where':{'id':_0x223370[_0xf4b8('0x47')]['id']}})[_0xf4b8('0x25')](handleEntityNotFound(_0x3034dd,null))['then'](saveUpdates(_0x223370[_0xf4b8('0x4b')],null))['then'](respondWithResult(_0x3034dd,null))[_0xf4b8('0x45')](handleError(_0x3034dd,null));};exports[_0xf4b8('0x26')]=function(_0x291155,_0x47caa5){return db[_0xf4b8('0x2a')]['find']({'where':{'id':_0x291155['params']['id']}})[_0xf4b8('0x25')](handleEntityNotFound(_0x47caa5,null))[_0xf4b8('0x25')](removeEntity(_0x47caa5,null))['catch'](handleError(_0x47caa5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 106b178..af2abba 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 _0x491b=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x491b,0x119));var _0xb491=function(_0x10e1b3,_0x52f3ed){_0x10e1b3=_0x10e1b3-0x0;var _0x3be5ca=_0x491b[_0x10e1b3];return _0x3be5ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb491('0x0'))(_0xb491('0x1'));var moment=require(_0xb491('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb491('0x3'));var rimraf=require('rimraf');var config=require(_0xb491('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0xb491('0x5')]=function(_0x1c856,_0x10ff69){return _0x1c856[_0xb491('0x6')](_0xb491('0x7'),attributes,{'tableName':_0xb491('0x8'),'paranoid':![],'indexes':[{'name':_0xb491('0x9'),'fields':[_0xb491('0xa'),_0xb491('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e14=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SalesforceField','int_salesforce_fields'];(function(_0x3ceac4,_0xf57186){var _0x9e4fe8=function(_0x439e4f){while(--_0x439e4f){_0x3ceac4['push'](_0x3ceac4['shift']());}};_0x9e4fe8(++_0xf57186);}(_0x0e14,0x113));var _0x40e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e14[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x40e1('0x0'));var util=require(_0x40e1('0x1'));var logger=require(_0x40e1('0x2'))(_0x40e1('0x3'));var moment=require(_0x40e1('0x4'));var BPromise=require(_0x40e1('0x5'));var rp=require(_0x40e1('0x6'));var fs=require('fs');var path=require(_0x40e1('0x7'));var rimraf=require(_0x40e1('0x8'));var config=require(_0x40e1('0x9'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x53ec52,_0x10316a){return _0x53ec52[_0x40e1('0xa')](_0x40e1('0xb'),attributes,{'tableName':_0x40e1('0xc'),'paranoid':![],'indexes':[{'name':_0x40e1('0xd'),'fields':[_0x40e1('0xe'),_0x40e1('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 975d9f0..f74018c 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 _0xdb80=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d5e76,_0x4a27bf){var _0x1f8064=function(_0x2c07bb){while(--_0x2c07bb){_0x2d5e76['push'](_0x2d5e76['shift']());}};_0x1f8064(++_0x4a27bf);}(_0xdb80,0xc3));var _0x0db8=function(_0x56e654,_0x5625c){_0x56e654=_0x56e654-0x0;var _0x237130=_0xdb80[_0x56e654];return _0x237130;};'use strict';var _=require(_0x0db8('0x0'));var util=require(_0x0db8('0x1'));var moment=require(_0x0db8('0x2'));var BPromise=require(_0x0db8('0x3'));var rs=require(_0x0db8('0x4'));var fs=require('fs');var Redis=require(_0x0db8('0x5'));var db=require(_0x0db8('0x6'))['db'];var utils=require(_0x0db8('0x7'));var logger=require(_0x0db8('0x8'))(_0x0db8('0x9'));var config=require(_0x0db8('0xa'));var jayson=require(_0x0db8('0xb'));var client=jayson[_0x0db8('0xc')][_0x0db8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xd95e6b,_0x30291d,_0x15d3b4){return new BPromise(function(_0x54b5da,_0x47eb89){return client[_0x0db8('0xe')](_0xd95e6b,_0x15d3b4)[_0x0db8('0xf')](function(_0x14489d){logger['info'](_0x0db8('0x10'),_0x30291d,_0x0db8('0x11'));logger[_0x0db8('0x12')](_0x0db8('0x13'),_0x30291d,'request\x20sent',JSON[_0x0db8('0x14')](_0x14489d));if(_0x14489d[_0x0db8('0x15')]){if(_0x14489d[_0x0db8('0x15')][_0x0db8('0x16')]===0x1f4){logger[_0x0db8('0x15')](_0x0db8('0x10'),_0x30291d,_0x14489d['error'][_0x0db8('0x17')]);return _0x47eb89(_0x14489d['error'][_0x0db8('0x17')]);}logger[_0x0db8('0x15')]('SalesforceField,\x20%s,\x20%s',_0x30291d,_0x14489d['error'][_0x0db8('0x17')]);return _0x54b5da(_0x14489d[_0x0db8('0x15')][_0x0db8('0x17')]);}else{logger[_0x0db8('0x18')](_0x0db8('0x10'),_0x30291d,_0x0db8('0x11'));_0x54b5da(_0x14489d[_0x0db8('0x19')][_0x0db8('0x17')]);}})[_0x0db8('0x1a')](function(_0x293b6e){logger[_0x0db8('0x15')]('SalesforceField,\x20%s,\x20%s',_0x30291d,_0x293b6e);_0x47eb89(_0x293b6e);});});} \ No newline at end of file +var _0x1b41=['info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x30ed3c,_0x516d8f){var _0x3fbb53=function(_0x461935){while(--_0x461935){_0x30ed3c['push'](_0x30ed3c['shift']());}};_0x3fbb53(++_0x516d8f);}(_0x1b41,0x1ba));var _0x11b4=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x1b41[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x11b4('0x0'));var util=require(_0x11b4('0x1'));var moment=require(_0x11b4('0x2'));var BPromise=require(_0x11b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11b4('0x4'));var db=require(_0x11b4('0x5'))['db'];var utils=require(_0x11b4('0x6'));var logger=require(_0x11b4('0x7'))(_0x11b4('0x8'));var config=require('../../config/environment');var jayson=require(_0x11b4('0x9'));var client=jayson[_0x11b4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf591da,_0x565258,_0x1abffc){return new BPromise(function(_0x5d3bd3,_0xaf91a4){return client[_0x11b4('0xb')](_0xf591da,_0x1abffc)['then'](function(_0x5714a3){logger['info'](_0x11b4('0xc'),_0x565258,'request\x20sent');logger[_0x11b4('0xd')](_0x11b4('0xe'),_0x565258,_0x11b4('0xf'),JSON[_0x11b4('0x10')](_0x5714a3));if(_0x5714a3[_0x11b4('0x11')]){if(_0x5714a3[_0x11b4('0x11')][_0x11b4('0x12')]===0x1f4){logger[_0x11b4('0x11')](_0x11b4('0xc'),_0x565258,_0x5714a3['error'][_0x11b4('0x13')]);return _0xaf91a4(_0x5714a3[_0x11b4('0x11')][_0x11b4('0x13')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x565258,_0x5714a3[_0x11b4('0x11')][_0x11b4('0x13')]);return _0x5d3bd3(_0x5714a3[_0x11b4('0x11')]['message']);}else{logger[_0x11b4('0x14')]('SalesforceField,\x20%s,\x20%s',_0x565258,_0x11b4('0xf'));_0x5d3bd3(_0x5714a3[_0x11b4('0x15')][_0x11b4('0x13')]);}})['catch'](function(_0x40f9c6){logger['error'](_0x11b4('0xc'),_0x565258,_0x40f9c6);_0xaf91a4(_0x40f9c6);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 829feac..ac550c2 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 _0xe3c0=['get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated'];(function(_0x240700,_0x13e7d9){var _0x51530c=function(_0x1e1420){while(--_0x1e1420){_0x240700['push'](_0x240700['shift']());}};_0x51530c(++_0x13e7d9);}(_0xe3c0,0x194));var _0x0e3c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe3c0[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x0e3c('0x0'));var util=require(_0x0e3c('0x1'));var path=require(_0x0e3c('0x2'));var timeout=require(_0x0e3c('0x3'));var express=require(_0x0e3c('0x4'));var router=express[_0x0e3c('0x5')]();var auth=require(_0x0e3c('0x6'));var interaction=require(_0x0e3c('0x7'));var config=require('../../config/environment');var controller=require(_0x0e3c('0x8'));router['get']('/',auth[_0x0e3c('0x9')](),controller['index']);router[_0x0e3c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0e3c('0xb')]);router[_0x0e3c('0xa')](_0x0e3c('0xc'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('0xd')]);router['get'](_0x0e3c('0xe'),auth['isAuthenticated'](),controller[_0x0e3c('0xf')]);router['post']('/',auth[_0x0e3c('0x9')](),controller[_0x0e3c('0x10')]);router[_0x0e3c('0x11')](_0x0e3c('0xc'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('0x12')]);router[_0x0e3c('0x13')](_0x0e3c('0x14'),auth[_0x0e3c('0x9')](),controller['update']);router[_0x0e3c('0x15')](_0x0e3c('0x14'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf003=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x37f906,_0x3ae89f){var _0x529bbe=function(_0x317c56){while(--_0x317c56){_0x37f906['push'](_0x37f906['shift']());}};_0x529bbe(++_0x3ae89f);}(_0xf003,0x1b4));var _0x3f00=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xf003[_0x218972];return _0x1bb1a8;};'use strict';var multer=require(_0x3f00('0x0'));var util=require(_0x3f00('0x1'));var path=require(_0x3f00('0x2'));var timeout=require(_0x3f00('0x3'));var express=require(_0x3f00('0x4'));var router=express[_0x3f00('0x5')]();var auth=require(_0x3f00('0x6'));var interaction=require(_0x3f00('0x7'));var config=require(_0x3f00('0x8'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x3f00('0x9')](),controller[_0x3f00('0xa')]);router[_0x3f00('0xb')](_0x3f00('0xc'),auth['isAuthenticated'](),controller[_0x3f00('0xd')]);router['get'](_0x3f00('0xe'),auth['isAuthenticated'](),controller[_0x3f00('0xf')]);router[_0x3f00('0xb')](_0x3f00('0x10'),auth['isAuthenticated'](),controller[_0x3f00('0x11')]);router[_0x3f00('0x12')]('/',auth[_0x3f00('0x9')](),controller['create']);router['post'](_0x3f00('0xe'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x13')]);router[_0x3f00('0x14')](_0x3f00('0xc'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x15')]);router['delete'](_0x3f00('0xc'),auth[_0x3f00('0x9')](),controller[_0x3f00('0x16')]);module[_0x3f00('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index d4dc244..7dea53f 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 _0x7072=['exports','STRING','username'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7072,0x138));var _0x2707=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7072[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'name':{'type':Sequelize[_0x2707('0x1')]},'description':{'type':Sequelize[_0x2707('0x1')]},'username':{'type':Sequelize[_0x2707('0x1')],'unique':_0x2707('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2707('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2707('0x1')]}}; \ No newline at end of file +var _0xbee3=['remoteUri','exports','STRING','username'];(function(_0x2f9bc9,_0x44bfea){var _0x2bf5a1=function(_0x546cb3){while(--_0x546cb3){_0x2f9bc9['push'](_0x2f9bc9['shift']());}};_0x2bf5a1(++_0x44bfea);}(_0xbee3,0xd5));var _0x3bee=function(_0x3e4a34,_0x452723){_0x3e4a34=_0x3e4a34-0x0;var _0x2d2d2e=_0xbee3[_0x3e4a34];return _0x2d2d2e;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3bee('0x1')],'unique':_0x3bee('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3bee('0x1')]},'remoteUri':{'type':Sequelize[_0x3bee('0x1')],'unique':_0x3bee('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f9e7574..1a04ed9 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 _0xa552=['impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','caller_id','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','sla_due','approval','due_date','reopen_count','sys_tags','upon_approval','correlation_id','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','status','end','count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','close_code','notify','incident_state','category','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan'];(function(_0x37980,_0x13c0f3){var _0x2eea4c=function(_0x5ce91a){while(--_0x5ce91a){_0x37980['push'](_0x37980['shift']());}};_0x2eea4c(++_0x13c0f3);}(_0xa552,0x105));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2a55('0x0'));var emlformat=require(_0x2a55('0x1'));var rimraf=require(_0x2a55('0x2'));var zipdir=require(_0x2a55('0x3'));var jsonpatch=require(_0x2a55('0x4'));var rp=require('request-promise');var moment=require(_0x2a55('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a55('0x6'));var util=require(_0x2a55('0x7'));var path=require(_0x2a55('0x8'));var sox=require('sox');var csv=require(_0x2a55('0x9'));var ejs=require(_0x2a55('0xa'));var fs=require('fs');var _=require(_0x2a55('0xb'));var squel=require('squel');var crypto=require(_0x2a55('0xc'));var jsforce=require(_0x2a55('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a55('0x9'));var querystring=require(_0x2a55('0xe'));var Papa=require('papaparse');var Redis=require(_0x2a55('0xf'));var authService=require(_0x2a55('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a55('0x11'));var logger=require(_0x2a55('0x12'))(_0x2a55('0x13'));var utils=require(_0x2a55('0x14'));var config=require(_0x2a55('0x15'));var db=require(_0x2a55('0x16'))['db'];var integrations=require(_0x2a55('0x17'));var jayson=require(_0x2a55('0x18'));var client=jayson[_0x2a55('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d657d,_0x5684fb,_0x457413){if(_0x457413){var _0x19943c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19943c['test'](_0x5684fb)){return _0x5d657d;}else{throw new Error(_0x2a55('0x1a'));}}else{return _0x5d657d;}}function respondWithRpcPromise(_0xf7ab18,_0x4f7204,_0x3de64f,_0x1164bc){return new BPromise(function(_0x53fbf1,_0x152ee9){var _0x33934d=_0x1164bc||client;return _0x33934d[_0x2a55('0x1b')](_0xf7ab18,_0x3de64f)['then'](function(_0x4a371b){logger[_0x2a55('0x1c')]('ServicenowAccount,\x20%s,\x20%s',_0x4f7204,'request\x20sent');logger[_0x2a55('0x1d')](_0x2a55('0x1e'),_0x4f7204,_0x2a55('0x1f'),JSON[_0x2a55('0x20')](_0x4a371b));if(_0x4a371b[_0x2a55('0x21')]){if(_0x4a371b['error'][_0x2a55('0x22')]===0x1f4){logger[_0x2a55('0x21')](_0x2a55('0x23'),_0x4f7204,_0x4a371b['error']['message']);return _0x152ee9(_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);}logger['error'](_0x2a55('0x23'),_0x4f7204,_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);return _0x53fbf1(_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);}else{logger[_0x2a55('0x1c')](_0x2a55('0x23'),_0x4f7204,_0x2a55('0x1f'));_0x53fbf1(_0x4a371b[_0x2a55('0x25')][_0x2a55('0x24')]);}})[_0x2a55('0x26')](function(_0xb4b713){logger[_0x2a55('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x4f7204,_0xb4b713);_0x152ee9(_0xb4b713);});});}function respondWithStatusCode(_0x388354,_0x9d6276){_0x9d6276=_0x9d6276||0xcc;return function(_0x20e672){if(_0x20e672){return _0x388354['sendStatus'](_0x9d6276);}return _0x388354[_0x2a55('0x27')](_0x9d6276)[_0x2a55('0x28')]();};}function respondWithResult(_0x33264c,_0x31fff6){_0x31fff6=_0x31fff6||0xc8;return function(_0x37d4df){if(_0x37d4df){return _0x33264c[_0x2a55('0x27')](_0x31fff6)['json'](_0x37d4df);}};}function respondWithFilteredResult(_0x3697f5,_0xb4731b){return function(_0x4faada){if(_0x4faada){var _0x4c9df9=_0x4faada[_0x2a55('0x29')],_0x1a8ed8=_0xb4731b[_0x2a55('0x2a')],_0x4bf851=_0xb4731b[_0x2a55('0x2a')]+_0xb4731b['limit'],_0x2d469a;if(_0x4bf851>=_0x4c9df9){_0x4bf851=_0x4c9df9;_0x2d469a=0xc8;}else{_0x2d469a=0xce;}_0x3697f5['status'](_0x2d469a);return _0x3697f5['set'](_0x2a55('0x2b'),_0x1a8ed8+'-'+_0x4bf851+'/'+_0x4c9df9)['json'](_0x4faada);}return null;};}function patchUpdates(_0x2be796){return function(_0x511329){try{jsonpatch[_0x2a55('0x2c')](_0x511329,_0x2be796,!![]);}catch(_0x466f56){return BPromise[_0x2a55('0x2d')](_0x466f56);}return _0x511329['save']();};}function saveUpdates(_0x3c7f8c,_0x45b9a7){return function(_0x1acc97){if(_0x1acc97){return _0x1acc97[_0x2a55('0x2e')](_0x3c7f8c)[_0x2a55('0x2f')](function(_0x5b9585){return _0x5b9585;});}return null;};}function removeEntity(_0x4b8b28,_0xcab11b){return function(_0x30f50a){if(_0x30f50a){return _0x30f50a[_0x2a55('0x30')]()[_0x2a55('0x2f')](function(){_0x4b8b28[_0x2a55('0x27')](0xcc)[_0x2a55('0x28')]();});}};}function handleEntityNotFound(_0x5c9d69,_0xf4c0d9){return function(_0x4756a3){if(!_0x4756a3){_0x5c9d69[_0x2a55('0x31')](0x194);}return _0x4756a3;};}function handleError(_0xfab77c,_0x455a41){_0x455a41=_0x455a41||0x1f4;return function(_0x158267){logger[_0x2a55('0x21')](_0x158267[_0x2a55('0x32')]);if(_0x158267[_0x2a55('0x33')]){delete _0x158267[_0x2a55('0x33')];}_0xfab77c[_0x2a55('0x27')](_0x455a41)[_0x2a55('0x34')](_0x158267);};}exports[_0x2a55('0x35')]=function(_0x5b43fe,_0x575382){var _0x14d844={},_0x567b64={},_0x21d4ba={'count':0x0,'rows':[]};var _0x598a04=db[_0x2a55('0x36')][_0x2a55('0x37')];_0x567b64[_0x2a55('0x38')]=_[_0x2a55('0x39')](_0x598a04);_0x567b64[_0x2a55('0x3a')]=_['keys'](_0x5b43fe[_0x2a55('0x3a')]);_0x567b64[_0x2a55('0x3b')]=_[_0x2a55('0x3c')](_0x567b64[_0x2a55('0x38')],_0x567b64[_0x2a55('0x3a')]);_0x14d844['attributes']=_[_0x2a55('0x3c')](_0x567b64[_0x2a55('0x38')],qs[_0x2a55('0x3d')](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x3d')]));_0x14d844[_0x2a55('0x3e')]=_0x14d844[_0x2a55('0x3e')][_0x2a55('0x3f')]?_0x14d844[_0x2a55('0x3e')]:_0x567b64[_0x2a55('0x38')];if(!_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x40')](_0x2a55('0x41'))){_0x14d844['limit']=qs['limit'](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x42')]);_0x14d844[_0x2a55('0x2a')]=qs[_0x2a55('0x2a')](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x2a')]);}_0x14d844[_0x2a55('0x43')]=qs['sort'](_0x5b43fe['query'][_0x2a55('0x44')]);_0x14d844[_0x2a55('0x45')]=qs[_0x2a55('0x3b')](_[_0x2a55('0x46')](_0x5b43fe[_0x2a55('0x3a')],_0x567b64[_0x2a55('0x3b')]));if(_0x5b43fe['query'][_0x2a55('0x47')]){_0x14d844[_0x2a55('0x45')]=_[_0x2a55('0x48')](_0x14d844[_0x2a55('0x45')],{'$or':_[_0x2a55('0x49')](_0x598a04,function(_0xb5011){if(_0xb5011[_0x2a55('0x4a')]['key']!=='VIRTUAL'){var _0x4eab03={};_0x4eab03[_0xb5011['field']]={'$like':'%'+_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x47')]+'%'};return _0x4eab03;}})});}_0x14d844=_[_0x2a55('0x48')]({},_0x14d844,_0x5b43fe[_0x2a55('0x4b')]);var _0x24e037={'where':_0x14d844[_0x2a55('0x45')]};return db['ServicenowAccount'][_0x2a55('0x29')](_0x24e037)[_0x2a55('0x2f')](function(_0x57f78c){_0x21d4ba['count']=_0x57f78c;if(_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x4c')]){_0x14d844[_0x2a55('0x4d')]=[{'all':!![]}];}return db[_0x2a55('0x36')][_0x2a55('0x4e')](_0x14d844);})[_0x2a55('0x2f')](function(_0x56b4e2){_0x21d4ba[_0x2a55('0x4f')]=_0x56b4e2;return _0x21d4ba;})[_0x2a55('0x2f')](respondWithFilteredResult(_0x575382,_0x14d844))['catch'](handleError(_0x575382,null));};exports[_0x2a55('0x50')]=function(_0x21b51a,_0x3c6284){var _0x549ba5={'raw':![],'where':{'id':_0x21b51a[_0x2a55('0x51')]['id']}},_0x34fa9c={};_0x34fa9c[_0x2a55('0x38')]=_[_0x2a55('0x39')](db[_0x2a55('0x36')][_0x2a55('0x37')]);_0x34fa9c[_0x2a55('0x3a')]=_['keys'](_0x21b51a[_0x2a55('0x3a')]);_0x34fa9c[_0x2a55('0x3b')]=_[_0x2a55('0x3c')](_0x34fa9c[_0x2a55('0x38')],_0x34fa9c['query']);_0x549ba5[_0x2a55('0x3e')]=_[_0x2a55('0x3c')](_0x34fa9c[_0x2a55('0x38')],qs['fields'](_0x21b51a[_0x2a55('0x3a')]['fields']));_0x549ba5[_0x2a55('0x3e')]=_0x549ba5['attributes'][_0x2a55('0x3f')]?_0x549ba5['attributes']:_0x34fa9c['model'];if(_0x21b51a[_0x2a55('0x3a')][_0x2a55('0x4c')]){_0x549ba5[_0x2a55('0x4d')]=[{'all':!![]}];}_0x549ba5=_[_0x2a55('0x48')]({},_0x549ba5,_0x21b51a[_0x2a55('0x4b')]);return db[_0x2a55('0x36')][_0x2a55('0x52')](_0x549ba5)[_0x2a55('0x2f')](handleEntityNotFound(_0x3c6284,null))[_0x2a55('0x2f')](respondWithResult(_0x3c6284,null))[_0x2a55('0x26')](handleError(_0x3c6284,null));};exports[_0x2a55('0x53')]=function(_0x38c731,_0x5b8597){return db['ServicenowAccount'][_0x2a55('0x53')](_0x38c731[_0x2a55('0x54')],{})[_0x2a55('0x2f')](respondWithResult(_0x5b8597,0xc9))[_0x2a55('0x26')](handleError(_0x5b8597,null));};exports[_0x2a55('0x2e')]=function(_0x38270f,_0x3b7e6a){if(_0x38270f[_0x2a55('0x54')]['id']){delete _0x38270f[_0x2a55('0x54')]['id'];}return db[_0x2a55('0x36')]['find']({'where':{'id':_0x38270f[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x3b7e6a,null))[_0x2a55('0x2f')](saveUpdates(_0x38270f[_0x2a55('0x54')],null))[_0x2a55('0x2f')](respondWithResult(_0x3b7e6a,null))['catch'](handleError(_0x3b7e6a,null));};exports['destroy']=function(_0x426c40,_0x5e8241){return db[_0x2a55('0x36')][_0x2a55('0x52')]({'where':{'id':_0x426c40[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x5e8241,null))[_0x2a55('0x2f')](removeEntity(_0x5e8241,null))[_0x2a55('0x26')](handleError(_0x5e8241,null));};exports['getConfigurations']=function(_0x3d278f,_0x547cdb,_0x2438a6){var _0x560839={};var _0x43f664={};var _0x4ffbda;var _0x225006;return db[_0x2a55('0x36')]['findOne']({'where':{'id':_0x3d278f[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x547cdb,null))[_0x2a55('0x2f')](function(_0xffaf73){if(_0xffaf73){_0x4ffbda=_0xffaf73;_0x43f664[_0x2a55('0x38')]=_[_0x2a55('0x39')](db['ServicenowConfiguration'][_0x2a55('0x37')]);_0x43f664[_0x2a55('0x3a')]=_[_0x2a55('0x39')](_0x3d278f['query']);_0x43f664['filters']=_[_0x2a55('0x3c')](_0x43f664[_0x2a55('0x38')],_0x43f664[_0x2a55('0x3a')]);_0x560839[_0x2a55('0x3e')]=_[_0x2a55('0x3c')](_0x43f664['model'],qs['fields'](_0x3d278f[_0x2a55('0x3a')]['fields']));_0x560839[_0x2a55('0x3e')]=_0x560839[_0x2a55('0x3e')][_0x2a55('0x3f')]?_0x560839[_0x2a55('0x3e')]:_0x43f664['model'];_0x560839['order']=qs['sort'](_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x44')]);_0x560839['where']=qs[_0x2a55('0x3b')](_[_0x2a55('0x46')](_0x3d278f[_0x2a55('0x3a')],_0x43f664[_0x2a55('0x3b')]));if(_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x47')]){_0x560839[_0x2a55('0x45')]=_[_0x2a55('0x48')](_0x560839[_0x2a55('0x45')],{'$or':_[_0x2a55('0x49')](_0x560839[_0x2a55('0x3e')],function(_0x4cfafe){var _0x39c97b={};_0x39c97b[_0x4cfafe]={'$like':'%'+_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x47')]+'%'};return _0x39c97b;})});}_0x560839=_[_0x2a55('0x48')]({},_0x560839,_0x3d278f[_0x2a55('0x4b')]);return _0x4ffbda[_0x2a55('0x55')](_0x560839);}})['then'](function(_0x3c2d30){if(_0x3c2d30){_0x225006=_0x3c2d30['length'];if(!_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x40')]('nolimit')){_0x560839[_0x2a55('0x42')]=qs[_0x2a55('0x42')](_0x3d278f[_0x2a55('0x3a')]['limit']);_0x560839['offset']=qs[_0x2a55('0x2a')](_0x3d278f['query']['offset']);}return _0x4ffbda[_0x2a55('0x55')](_0x560839);}})[_0x2a55('0x2f')](function(_0x387bbc){if(_0x387bbc){return _0x387bbc?{'count':_0x225006,'rows':_0x387bbc}:null;}})[_0x2a55('0x2f')](respondWithResult(_0x547cdb,null))['catch'](handleError(_0x547cdb,null));};exports[_0x2a55('0x56')]=function(_0x48a019,_0x25da51,_0x476077){if(_0x48a019[_0x2a55('0x54')]['id']){delete _0x48a019[_0x2a55('0x54')]['id'];}return db[_0x2a55('0x36')][_0x2a55('0x57')]({'where':{'id':_0x48a019[_0x2a55('0x51')]['id']}})['then'](handleEntityNotFound(_0x25da51,null))[_0x2a55('0x2f')](function(_0x40ccd5){if(_0x40ccd5){_0x48a019[_0x2a55('0x54')]['AccountId']=_0x40ccd5['id'];_0x48a019['body'][_0x2a55('0x58')]=integrations[_0x2a55('0x59')](_0x48a019[_0x2a55('0x54')][_0x2a55('0x5a')],_0x48a019[_0x2a55('0x54')]['type']);_0x48a019[_0x2a55('0x54')][_0x2a55('0x5b')]=integrations[_0x2a55('0x5c')](_0x48a019['body']['channel'],_0x48a019[_0x2a55('0x54')][_0x2a55('0x4a')]);return db[_0x2a55('0x5d')][_0x2a55('0x53')](_0x48a019[_0x2a55('0x54')],{'include':[{'model':db[_0x2a55('0x5e')],'as':'Subjects'},{'model':db[_0x2a55('0x5e')],'as':_0x2a55('0x5b')}]});}return null;})['then'](respondWithResult(_0x25da51,null))[_0x2a55('0x26')](handleError(_0x25da51,null));};exports['getFields']=function(_0x23dd53,_0x29baea,_0x56f70b){var _0x5da420=[_0x2a55('0x5f'),_0x2a55('0x60'),_0x2a55('0x61'),'subcategory',_0x2a55('0x62'),_0x2a55('0x63'),_0x2a55('0x64'),'severity',_0x2a55('0x65')];var _0x4da5f9=['parent',_0x2a55('0x5f'),_0x2a55('0x66'),_0x2a55('0x67'),_0x2a55('0x68'),'sys_updated_on',_0x2a55('0x69'),_0x2a55('0x60'),_0x2a55('0x6a'),_0x2a55('0x6b'),_0x2a55('0x6c'),'sys_updated_by',_0x2a55('0x6d'),_0x2a55('0x6e'),_0x2a55('0x6f'),_0x2a55('0x70'),_0x2a55('0x71'),_0x2a55('0x72'),_0x2a55('0x61'),_0x2a55('0x43'),_0x2a55('0x73'),_0x2a55('0x74'),_0x2a55('0x75'),_0x2a55('0x76'),_0x2a55('0x77'),'active',_0x2a55('0x78'),_0x2a55('0x79'),_0x2a55('0x7a'),_0x2a55('0x7b'),_0x2a55('0x7c'),_0x2a55('0x7d'),_0x2a55('0x7e'),_0x2a55('0x7f'),_0x2a55('0x80'),'group_list','work_end',_0x2a55('0x81'),'resolved_at',_0x2a55('0x82'),'approval_set',_0x2a55('0x83'),_0x2a55('0x84'),_0x2a55('0x85'),_0x2a55('0x62'),_0x2a55('0x86'),'delivery_task',_0x2a55('0x87'),_0x2a55('0x88'),_0x2a55('0x89'),_0x2a55('0x8a'),_0x2a55('0x8b'),_0x2a55('0x8c'),_0x2a55('0x63'),_0x2a55('0x8d'),_0x2a55('0x8e'),'closed_by',_0x2a55('0x8f'),_0x2a55('0x90'),_0x2a55('0x91'),_0x2a55('0x92'),_0x2a55('0x93'),_0x2a55('0x64'),_0x2a55('0x94'),_0x2a55('0x95'),_0x2a55('0x96'),_0x2a55('0x97'),_0x2a55('0x98'),'assigned_to',_0x2a55('0x99'),'comments',_0x2a55('0x9a'),_0x2a55('0x9b'),'comments_and_work_notes',_0x2a55('0x9c'),'sys_mod_count',_0x2a55('0x9d'),_0x2a55('0x9e'),'escalation',_0x2a55('0x9f'),_0x2a55('0xa0'),'location',_0x2a55('0x65')];var _0x536372='';var _0x4ecd57='';var _0x1e34d2=[];var _0x19530d='';var _0x1eeee8='';var _0x467621=[];var _0x5ef2d5='';var _0x5f0f5a='';var _0x5d8363={};var _0x16bbd8='';return db[_0x2a55('0x36')][_0x2a55('0x57')]({'where':{'id':_0x23dd53['params']['id']},'attributes':['id','username',_0x2a55('0xa1'),'email',_0x2a55('0xa2'),_0x2a55('0xa3')]})[_0x2a55('0x2f')](handleEntityNotFound(_0x29baea,null))[_0x2a55('0x2f')](function(_0x498e0c){if(_0x498e0c){_0x16bbd8=_0x498e0c[_0x2a55('0xa2')];var _0x3d19d4=_0x16bbd8[_0x2a55('0xa4')](-0x1);if(_0x3d19d4==='/'){_0x16bbd8=_0x16bbd8[_0x2a55('0xa5')](0x0,_0x16bbd8[_0x2a55('0xa6')](_0x3d19d4));}_0x5f0f5a=util[_0x2a55('0xa7')]('%s/api/now/doc/table/schema/',_0x16bbd8);_0x5ef2d5=util[_0x2a55('0xa7')](_0x2a55('0xa8'),_0x16bbd8);_0x5d8363={'user':_0x498e0c[_0x2a55('0xa9')],'pass':_0x498e0c[_0x2a55('0xa1')]};var _0x3f9c61={'method':_0x2a55('0xaa'),'uri':_0x5f0f5a+'incident?sysparm_display_value=all','auth':_0x5d8363,'json':!![]};return rp(_0x3f9c61);}})[_0x2a55('0x2f')](function(_0x54a525){if(_0x54a525[_0x2a55('0x25')][_0x2a55('0x3f')]>0x0){_0x536372=_0x54a525[_0x2a55('0x25')];}console[_0x2a55('0xab')](_0x2a55('0xac'),_0x536372);_0x467621=[];_0x4ecd57=Object[_0x2a55('0xad')]([],_0x536372);_[_0x2a55('0xae')](_0x4ecd57,function(_0x534676){return!_0x5da420[_0x2a55('0xaf')](_0x534676['name']);});_0x4ecd57[_0x2a55('0xb0')](function(_0x1104d5){var _0x1206ff=createFieldObject(_0x5ef2d5,_0x5d8363,_0x1104d5['internalType'],_0x1104d5[_0x2a55('0x33')],_0x1104d5[_0x2a55('0xb1')],![]);_0x467621[_0x2a55('0xb2')](_0x1206ff);});return Promise[_0x2a55('0xb3')](_0x467621);})['then'](function(_0x3ef916){_0x1e34d2=_0x3ef916;_0x19530d=Object[_0x2a55('0xad')]([],_0x536372);console[_0x2a55('0xab')]('TCL:\x20_object',_0x536372);_[_0x2a55('0xae')](_0x19530d,function(_0x268dc6){return _0x4da5f9[_0x2a55('0xaf')](_0x268dc6[_0x2a55('0x33')]);});console[_0x2a55('0xab')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x19530d);_0x467621=[];_0x19530d[_0x2a55('0xb0')](function(_0x538b6f){var _0x185c8a=createFieldObject(_0x5ef2d5,_0x5d8363,_0x538b6f['internalType'],_0x538b6f[_0x2a55('0x33')],_0x538b6f[_0x2a55('0xb1')],!![]);_0x467621[_0x2a55('0xb2')](_0x185c8a);});return Promise['all'](_0x467621);})[_0x2a55('0x2f')](function(_0x94600){_0x1eeee8=_0x94600;var _0x3af573=_0x1e34d2['concat'](_0x1eeee8);return{'count':_0x3af573[_0x2a55('0x3f')],'rows':_0x3af573};})[_0x2a55('0x2f')](respondWithResult(_0x29baea,null))[_0x2a55('0x26')](function(_0xe6baaf){console[_0x2a55('0xab')](_0x2a55('0xb4')+_0xe6baaf);var _0x377cb3=_0x23dd53[_0x2a55('0x3a')][_0x2a55('0xb5')]?0x1f4:_0xe6baaf[_0x2a55('0xb6')]||0x1f4;logger[_0x2a55('0x21')](_0xe6baaf['stack']);delete _0xe6baaf['name'];if(_0x377cb3===0x191){_0x377cb3=0x190;}_0x29baea[_0x2a55('0x27')](_0x377cb3)['send'](_0x23dd53[_0x2a55('0x3a')][_0x2a55('0xb5')]?{'message':_0x2a55('0xb7'),'statusCode':_0xe6baaf[_0x2a55('0xb6')]}:_0xe6baaf);});};function createFieldObject(_0x573f79,_0x1714b4,_0x402cd7,_0x4fcc56,_0x10fbc1,_0x109a95){return new Promise(function(_0x313c68,_0x4aae49){var _0x531c61={'id':_0x4fcc56,'name':_0x10fbc1,'custom':_0x109a95};if(_0x402cd7===_0x2a55('0xb8')){_0x531c61[_0x2a55('0x4b')]=[{'name':_0x2a55('0xb9'),'value':'true'},{'name':_0x2a55('0xba'),'value':_0x2a55('0xbb')}];_0x313c68(_0x531c61);}else{var _0x95cadc={'method':_0x2a55('0xaa'),'uri':_0x573f79+_0x2a55('0xbc')+_0x4fcc56,'auth':_0x1714b4,'json':!![]};return rp(_0x95cadc)[_0x2a55('0x2f')](function(_0x3c9881){var _0x1ab35a=[];if(_0x3c9881[_0x2a55('0x25')][_0x2a55('0x3f')]>0x0){_0x3c9881['result'][_0x2a55('0xb0')](function(_0x2479d7){if(_0x2479d7[_0x2a55('0xbd')]===_0x2a55('0xbb')){var _0x1e0a9f={'name':_0x2479d7['label'],'value':_0x2479d7['value']};_0x1ab35a[_0x2a55('0xb2')](_0x1e0a9f);}});}_0x531c61[_0x2a55('0x4b')]=_0x1ab35a;if(_0x531c61[_0x2a55('0x4b')][_0x2a55('0x3f')]>0x0){_0x313c68(_0x531c61);}else{if(_0x109a95==![]){_0x313c68();}else{_0x313c68(_0x531c61);}}});}});} \ No newline at end of file +var _0x362e=['channel','Descriptions','Subjects','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','order','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','problem_id','assigned_to','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','test','statusCode','Wrong\x20credentials','boolean','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','index','ServicenowAccount','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','getConfigurations','ServicenowConfiguration','nolimit','addConfiguration','findOne','AccountId','getSubjects'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x362e,0x1e6));var _0xe362=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x362e[_0x373dee];return _0x46798f;};'use strict';var pdf=require(_0xe362('0x0'));var emlformat=require(_0xe362('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe362('0x2'));var jsonpatch=require(_0xe362('0x3'));var rp=require('request-promise');var moment=require(_0xe362('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe362('0x5'));var path=require('path');var sox=require(_0xe362('0x6'));var csv=require(_0xe362('0x7'));var ejs=require(_0xe362('0x8'));var fs=require('fs');var _=require(_0xe362('0x9'));var squel=require(_0xe362('0xa'));var crypto=require(_0xe362('0xb'));var jsforce=require(_0xe362('0xc'));var deskjs=require(_0xe362('0xd'));var toCsv=require(_0xe362('0x7'));var querystring=require(_0xe362('0xe'));var Papa=require('papaparse');var Redis=require(_0xe362('0xf'));var authService=require(_0xe362('0x10'));var qs=require(_0xe362('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe362('0x12'))('api');var utils=require(_0xe362('0x13'));var config=require(_0xe362('0x14'));var db=require(_0xe362('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe362('0x16'));var client=jayson[_0xe362('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x2b7837,_0xce87c0,_0x513268){if(_0x513268){var _0x182d92=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x182d92['test'](_0xce87c0)){return _0x2b7837;}else{throw new Error(_0xe362('0x18'));}}else{return _0x2b7837;}}function respondWithRpcPromise(_0x271059,_0x10b7da,_0x6d3bdc,_0x1f8a88){return new BPromise(function(_0x456dbf,_0x5db958){var _0x235385=_0x1f8a88||client;return _0x235385['request'](_0x271059,_0x6d3bdc)[_0xe362('0x19')](function(_0x132155){logger[_0xe362('0x1a')](_0xe362('0x1b'),_0x10b7da,_0xe362('0x1c'));logger[_0xe362('0x1d')](_0xe362('0x1e'),_0x10b7da,_0xe362('0x1c'),JSON[_0xe362('0x1f')](_0x132155));if(_0x132155[_0xe362('0x20')]){if(_0x132155['error'][_0xe362('0x21')]===0x1f4){logger[_0xe362('0x20')](_0xe362('0x1b'),_0x10b7da,_0x132155['error']['message']);return _0x5db958(_0x132155[_0xe362('0x20')][_0xe362('0x22')]);}logger[_0xe362('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x10b7da,_0x132155['error'][_0xe362('0x22')]);return _0x456dbf(_0x132155['error']['message']);}else{logger[_0xe362('0x1a')](_0xe362('0x1b'),_0x10b7da,_0xe362('0x1c'));_0x456dbf(_0x132155[_0xe362('0x23')][_0xe362('0x22')]);}})['catch'](function(_0x2a7771){logger[_0xe362('0x20')](_0xe362('0x1b'),_0x10b7da,_0x2a7771);_0x5db958(_0x2a7771);});});}function respondWithStatusCode(_0x38ecc6,_0x186fdb){_0x186fdb=_0x186fdb||0xcc;return function(_0x4dfcb6){if(_0x4dfcb6){return _0x38ecc6['sendStatus'](_0x186fdb);}return _0x38ecc6[_0xe362('0x24')](_0x186fdb)['end']();};}function respondWithResult(_0x517eb0,_0x57dde5){_0x57dde5=_0x57dde5||0xc8;return function(_0xc50baa){if(_0xc50baa){return _0x517eb0[_0xe362('0x24')](_0x57dde5)['json'](_0xc50baa);}};}function respondWithFilteredResult(_0x518c9d,_0x556df5){return function(_0x2e0554){if(_0x2e0554){var _0x55b2eb=_0x2e0554[_0xe362('0x25')],_0x3e5f05=_0x556df5[_0xe362('0x26')],_0x89f160=_0x556df5['offset']+_0x556df5[_0xe362('0x27')],_0x3c218a;if(_0x89f160>=_0x55b2eb){_0x89f160=_0x55b2eb;_0x3c218a=0xc8;}else{_0x3c218a=0xce;}_0x518c9d[_0xe362('0x24')](_0x3c218a);return _0x518c9d['set'](_0xe362('0x28'),_0x3e5f05+'-'+_0x89f160+'/'+_0x55b2eb)['json'](_0x2e0554);}return null;};}function patchUpdates(_0x3d28a8){return function(_0x280516){try{jsonpatch[_0xe362('0x29')](_0x280516,_0x3d28a8,!![]);}catch(_0x132c48){return BPromise[_0xe362('0x2a')](_0x132c48);}return _0x280516[_0xe362('0x2b')]();};}function saveUpdates(_0x520bc3,_0x2ace7a){return function(_0x71f953){if(_0x71f953){return _0x71f953[_0xe362('0x2c')](_0x520bc3)['then'](function(_0x2198f7){return _0x2198f7;});}return null;};}function removeEntity(_0xfee47d,_0x425c94){return function(_0x36fd6f){if(_0x36fd6f){return _0x36fd6f['destroy']()[_0xe362('0x19')](function(){_0xfee47d[_0xe362('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7efc,_0x2a9b20){return function(_0x1879cf){if(!_0x1879cf){_0x2c7efc['sendStatus'](0x194);}return _0x1879cf;};}function handleError(_0x581bb7,_0x770d26){_0x770d26=_0x770d26||0x1f4;return function(_0x2aaabf){logger[_0xe362('0x20')](_0x2aaabf[_0xe362('0x2d')]);if(_0x2aaabf['name']){delete _0x2aaabf[_0xe362('0x2e')];}_0x581bb7[_0xe362('0x24')](_0x770d26)[_0xe362('0x2f')](_0x2aaabf);};}exports[_0xe362('0x30')]=function(_0x19b8d0,_0x58546a){var _0x16afb5={},_0x7a7aa2={},_0x553c06={'count':0x0,'rows':[]};var _0x28a205=db[_0xe362('0x31')][_0xe362('0x32')];_0x7a7aa2['model']=_[_0xe362('0x33')](_0x28a205);_0x7a7aa2['query']=_[_0xe362('0x33')](_0x19b8d0[_0xe362('0x34')]);_0x7a7aa2[_0xe362('0x35')]=_['intersection'](_0x7a7aa2[_0xe362('0x36')],_0x7a7aa2[_0xe362('0x34')]);_0x16afb5[_0xe362('0x37')]=_['intersection'](_0x7a7aa2[_0xe362('0x36')],qs['fields'](_0x19b8d0['query'][_0xe362('0x38')]));_0x16afb5['attributes']=_0x16afb5['attributes'][_0xe362('0x39')]?_0x16afb5['attributes']:_0x7a7aa2[_0xe362('0x36')];if(!_0x19b8d0[_0xe362('0x34')][_0xe362('0x3a')]('nolimit')){_0x16afb5['limit']=qs[_0xe362('0x27')](_0x19b8d0[_0xe362('0x34')]['limit']);_0x16afb5[_0xe362('0x26')]=qs['offset'](_0x19b8d0[_0xe362('0x34')][_0xe362('0x26')]);}_0x16afb5['order']=qs[_0xe362('0x3b')](_0x19b8d0['query'][_0xe362('0x3b')]);_0x16afb5['where']=qs['filters'](_[_0xe362('0x3c')](_0x19b8d0[_0xe362('0x34')],_0x7a7aa2[_0xe362('0x35')]));if(_0x19b8d0['query'][_0xe362('0x3d')]){_0x16afb5[_0xe362('0x3e')]=_['merge'](_0x16afb5[_0xe362('0x3e')],{'$or':_[_0xe362('0x3f')](_0x28a205,function(_0x3d886d){if(_0x3d886d[_0xe362('0x40')][_0xe362('0x41')]!==_0xe362('0x42')){var _0x40791f={};_0x40791f[_0x3d886d[_0xe362('0x43')]]={'$like':'%'+_0x19b8d0['query'][_0xe362('0x3d')]+'%'};return _0x40791f;}})});}_0x16afb5=_[_0xe362('0x44')]({},_0x16afb5,_0x19b8d0[_0xe362('0x45')]);var _0x3fdbc4={'where':_0x16afb5[_0xe362('0x3e')]};return db[_0xe362('0x31')][_0xe362('0x25')](_0x3fdbc4)[_0xe362('0x19')](function(_0x3bf151){_0x553c06[_0xe362('0x25')]=_0x3bf151;if(_0x19b8d0['query'][_0xe362('0x46')]){_0x16afb5[_0xe362('0x47')]=[{'all':!![]}];}return db[_0xe362('0x31')][_0xe362('0x48')](_0x16afb5);})[_0xe362('0x19')](function(_0x30458c){_0x553c06[_0xe362('0x49')]=_0x30458c;return _0x553c06;})[_0xe362('0x19')](respondWithFilteredResult(_0x58546a,_0x16afb5))[_0xe362('0x4a')](handleError(_0x58546a,null));};exports['show']=function(_0x27aa7c,_0x4a0ac0){var _0x15ecbf={'raw':![],'where':{'id':_0x27aa7c[_0xe362('0x4b')]['id']}},_0x31333c={};_0x31333c[_0xe362('0x36')]=_[_0xe362('0x33')](db[_0xe362('0x31')][_0xe362('0x32')]);_0x31333c[_0xe362('0x34')]=_[_0xe362('0x33')](_0x27aa7c[_0xe362('0x34')]);_0x31333c[_0xe362('0x35')]=_['intersection'](_0x31333c[_0xe362('0x36')],_0x31333c[_0xe362('0x34')]);_0x15ecbf['attributes']=_[_0xe362('0x4c')](_0x31333c['model'],qs[_0xe362('0x38')](_0x27aa7c['query'][_0xe362('0x38')]));_0x15ecbf[_0xe362('0x37')]=_0x15ecbf[_0xe362('0x37')]['length']?_0x15ecbf['attributes']:_0x31333c[_0xe362('0x36')];if(_0x27aa7c[_0xe362('0x34')][_0xe362('0x46')]){_0x15ecbf[_0xe362('0x47')]=[{'all':!![]}];}_0x15ecbf=_[_0xe362('0x44')]({},_0x15ecbf,_0x27aa7c['options']);return db[_0xe362('0x31')][_0xe362('0x4d')](_0x15ecbf)['then'](handleEntityNotFound(_0x4a0ac0,null))[_0xe362('0x19')](respondWithResult(_0x4a0ac0,null))['catch'](handleError(_0x4a0ac0,null));};exports[_0xe362('0x4e')]=function(_0x183ecb,_0x3960cb){return db[_0xe362('0x31')][_0xe362('0x4e')](_0x183ecb[_0xe362('0x4f')],{})[_0xe362('0x19')](respondWithResult(_0x3960cb,0xc9))[_0xe362('0x4a')](handleError(_0x3960cb,null));};exports[_0xe362('0x2c')]=function(_0x3eed26,_0x2a3c65){if(_0x3eed26[_0xe362('0x4f')]['id']){delete _0x3eed26[_0xe362('0x4f')]['id'];}return db[_0xe362('0x31')]['find']({'where':{'id':_0x3eed26[_0xe362('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a3c65,null))[_0xe362('0x19')](saveUpdates(_0x3eed26['body'],null))[_0xe362('0x19')](respondWithResult(_0x2a3c65,null))[_0xe362('0x4a')](handleError(_0x2a3c65,null));};exports['destroy']=function(_0x32d02f,_0x1dcbee){return db[_0xe362('0x31')][_0xe362('0x4d')]({'where':{'id':_0x32d02f[_0xe362('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dcbee,null))[_0xe362('0x19')](removeEntity(_0x1dcbee,null))['catch'](handleError(_0x1dcbee,null));};exports[_0xe362('0x50')]=function(_0x13aa5e,_0x4759bc,_0x32ae78){var _0x3d7f00={};var _0x39c0d0={};var _0x2984c2;var _0xab0958;return db['ServicenowAccount']['findOne']({'where':{'id':_0x13aa5e[_0xe362('0x4b')]['id']}})[_0xe362('0x19')](handleEntityNotFound(_0x4759bc,null))[_0xe362('0x19')](function(_0x32a417){if(_0x32a417){_0x2984c2=_0x32a417;_0x39c0d0[_0xe362('0x36')]=_['keys'](db[_0xe362('0x51')][_0xe362('0x32')]);_0x39c0d0['query']=_[_0xe362('0x33')](_0x13aa5e[_0xe362('0x34')]);_0x39c0d0[_0xe362('0x35')]=_[_0xe362('0x4c')](_0x39c0d0[_0xe362('0x36')],_0x39c0d0[_0xe362('0x34')]);_0x3d7f00[_0xe362('0x37')]=_['intersection'](_0x39c0d0[_0xe362('0x36')],qs[_0xe362('0x38')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x38')]));_0x3d7f00[_0xe362('0x37')]=_0x3d7f00[_0xe362('0x37')]['length']?_0x3d7f00[_0xe362('0x37')]:_0x39c0d0['model'];_0x3d7f00['order']=qs[_0xe362('0x3b')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x3b')]);_0x3d7f00[_0xe362('0x3e')]=qs['filters'](_[_0xe362('0x3c')](_0x13aa5e['query'],_0x39c0d0[_0xe362('0x35')]));if(_0x13aa5e[_0xe362('0x34')][_0xe362('0x3d')]){_0x3d7f00['where']=_[_0xe362('0x44')](_0x3d7f00[_0xe362('0x3e')],{'$or':_['map'](_0x3d7f00['attributes'],function(_0x127af3){var _0x320d78={};_0x320d78[_0x127af3]={'$like':'%'+_0x13aa5e[_0xe362('0x34')][_0xe362('0x3d')]+'%'};return _0x320d78;})});}_0x3d7f00=_[_0xe362('0x44')]({},_0x3d7f00,_0x13aa5e[_0xe362('0x45')]);return _0x2984c2[_0xe362('0x50')](_0x3d7f00);}})[_0xe362('0x19')](function(_0x10126d){if(_0x10126d){_0xab0958=_0x10126d[_0xe362('0x39')];if(!_0x13aa5e['query'][_0xe362('0x3a')](_0xe362('0x52'))){_0x3d7f00[_0xe362('0x27')]=qs['limit'](_0x13aa5e[_0xe362('0x34')][_0xe362('0x27')]);_0x3d7f00['offset']=qs[_0xe362('0x26')](_0x13aa5e[_0xe362('0x34')][_0xe362('0x26')]);}return _0x2984c2['getConfigurations'](_0x3d7f00);}})[_0xe362('0x19')](function(_0x5df270){if(_0x5df270){return _0x5df270?{'count':_0xab0958,'rows':_0x5df270}:null;}})['then'](respondWithResult(_0x4759bc,null))[_0xe362('0x4a')](handleError(_0x4759bc,null));};exports[_0xe362('0x53')]=function(_0x28df6b,_0x39a3cc,_0x4f9c65){if(_0x28df6b[_0xe362('0x4f')]['id']){delete _0x28df6b['body']['id'];}return db['ServicenowAccount'][_0xe362('0x54')]({'where':{'id':_0x28df6b['params']['id']}})[_0xe362('0x19')](handleEntityNotFound(_0x39a3cc,null))[_0xe362('0x19')](function(_0x490f18){if(_0x490f18){_0x28df6b['body'][_0xe362('0x55')]=_0x490f18['id'];_0x28df6b[_0xe362('0x4f')]['Subjects']=integrations[_0xe362('0x56')](_0x28df6b[_0xe362('0x4f')][_0xe362('0x57')],_0x28df6b[_0xe362('0x4f')][_0xe362('0x40')]);_0x28df6b[_0xe362('0x4f')][_0xe362('0x58')]=integrations['getDescriptions'](_0x28df6b[_0xe362('0x4f')]['channel'],_0x28df6b[_0xe362('0x4f')][_0xe362('0x40')]);return db[_0xe362('0x51')][_0xe362('0x4e')](_0x28df6b[_0xe362('0x4f')],{'include':[{'model':db['ServicenowField'],'as':_0xe362('0x59')},{'model':db[_0xe362('0x5a')],'as':_0xe362('0x58')}]});}return null;})[_0xe362('0x19')](respondWithResult(_0x39a3cc,null))[_0xe362('0x4a')](handleError(_0x39a3cc,null));};exports['getFields']=function(_0x199cf0,_0xce993e,_0x410ebb){var _0x2eebae=[_0xe362('0x5b'),_0xe362('0x5c'),_0xe362('0x5d'),_0xe362('0x5e'),_0xe362('0x5f'),_0xe362('0x60'),_0xe362('0x61'),_0xe362('0x62'),_0xe362('0x63')];var _0x59bf13=[_0xe362('0x64'),'made_sla',_0xe362('0x65'),_0xe362('0x66'),_0xe362('0x67'),_0xe362('0x68'),_0xe362('0x69'),_0xe362('0x5c'),'approval_history',_0xe362('0x6a'),_0xe362('0x6b'),_0xe362('0x6c'),_0xe362('0x6d'),_0xe362('0x6e'),_0xe362('0x6f'),_0xe362('0x70'),_0xe362('0x71'),_0xe362('0x72'),_0xe362('0x5d'),_0xe362('0x73'),_0xe362('0x74'),_0xe362('0x75'),_0xe362('0x76'),_0xe362('0x77'),_0xe362('0x78'),_0xe362('0x79'),_0xe362('0x7a'),_0xe362('0x7b'),'priority',_0xe362('0x7c'),_0xe362('0x7d'),_0xe362('0x7e'),'expected_start',_0xe362('0x7f'),_0xe362('0x80'),_0xe362('0x81'),_0xe362('0x82'),_0xe362('0x83'),_0xe362('0x84'),_0xe362('0x85'),_0xe362('0x86'),_0xe362('0x5e'),_0xe362('0x87'),'short_description',_0xe362('0x5f'),_0xe362('0x88'),_0xe362('0x89'),_0xe362('0x8a'),_0xe362('0x8b'),'business_stc','additional_assignee_list',_0xe362('0x8c'),_0xe362('0x8d'),'notify',_0xe362('0x8e'),_0xe362('0x8f'),_0xe362('0x90'),_0xe362('0x91'),_0xe362('0x92'),'sys_id',_0xe362('0x93'),_0xe362('0x94'),_0xe362('0x61'),'urgency',_0xe362('0x95'),'company','reassignment_count','activity_due',_0xe362('0x96'),_0xe362('0x62'),_0xe362('0x97'),'sla_due','approval',_0xe362('0x98'),_0xe362('0x99'),_0xe362('0x9a'),_0xe362('0x9b'),_0xe362('0x9c'),'escalation',_0xe362('0x9d'),_0xe362('0x9e'),_0xe362('0x9f'),_0xe362('0x63')];var _0x4dde57='';var _0x1580d5='';var _0xfed8e5=[];var _0x2cf2e8='';var _0x5d5239='';var _0x426d01=[];var _0x56d2e1='';var _0x5c27a9='';var _0x262c17={};var _0x3335f9='';return db['ServicenowAccount'][_0xe362('0x54')]({'where':{'id':_0x199cf0[_0xe362('0x4b')]['id']},'attributes':['id',_0xe362('0xa0'),_0xe362('0xa1'),_0xe362('0xa2'),_0xe362('0xa3'),_0xe362('0xa4')]})[_0xe362('0x19')](handleEntityNotFound(_0xce993e,null))[_0xe362('0x19')](function(_0x4d2ea3){if(_0x4d2ea3){_0x3335f9=_0x4d2ea3[_0xe362('0xa3')];var _0x585b8f=_0x3335f9[_0xe362('0xa5')](-0x1);if(_0x585b8f==='/'){_0x3335f9=_0x3335f9[_0xe362('0xa6')](0x0,_0x3335f9['lastIndexOf'](_0x585b8f));}_0x5c27a9=util[_0xe362('0xa7')](_0xe362('0xa8'),_0x3335f9);_0x56d2e1=util['format']('%s/api/now/table/',_0x3335f9);_0x262c17={'user':_0x4d2ea3[_0xe362('0xa0')],'pass':_0x4d2ea3[_0xe362('0xa1')]};var _0x5950a8={'method':_0xe362('0xa9'),'uri':_0x5c27a9+_0xe362('0xaa'),'auth':_0x262c17,'json':!![]};return rp(_0x5950a8);}})[_0xe362('0x19')](function(_0x19c47c){if(_0x19c47c[_0xe362('0x23')][_0xe362('0x39')]>0x0){_0x4dde57=_0x19c47c[_0xe362('0x23')];}console[_0xe362('0xab')](_0xe362('0xac'),_0x4dde57);_0x426d01=[];_0x1580d5=Object[_0xe362('0xad')]([],_0x4dde57);_['remove'](_0x1580d5,function(_0x53e670){return!_0x2eebae[_0xe362('0xae')](_0x53e670['name']);});_0x1580d5[_0xe362('0xaf')](function(_0x36e22a){var _0x1d1065=createFieldObject(_0x56d2e1,_0x262c17,_0x36e22a[_0xe362('0xb0')],_0x36e22a[_0xe362('0x2e')],_0x36e22a[_0xe362('0xb1')],![]);_0x426d01[_0xe362('0xb2')](_0x1d1065);});return Promise['all'](_0x426d01);})[_0xe362('0x19')](function(_0x39c659){_0xfed8e5=_0x39c659;_0x2cf2e8=Object[_0xe362('0xad')]([],_0x4dde57);console[_0xe362('0xab')](_0xe362('0xb3'),_0x4dde57);_['remove'](_0x2cf2e8,function(_0x24746d){return _0x59bf13['includes'](_0x24746d[_0xe362('0x2e')]);});console[_0xe362('0xab')](_0xe362('0xb4'),_0x2cf2e8);_0x426d01=[];_0x2cf2e8[_0xe362('0xaf')](function(_0x1704da){var _0x3f617e=createFieldObject(_0x56d2e1,_0x262c17,_0x1704da['internalType'],_0x1704da[_0xe362('0x2e')],_0x1704da[_0xe362('0xb1')],!![]);_0x426d01[_0xe362('0xb2')](_0x3f617e);});return Promise[_0xe362('0xb5')](_0x426d01);})['then'](function(_0xe786b8){_0x5d5239=_0xe786b8;var _0x43f042=_0xfed8e5[_0xe362('0xb6')](_0x5d5239);return{'count':_0x43f042[_0xe362('0x39')],'rows':_0x43f042};})[_0xe362('0x19')](respondWithResult(_0xce993e,null))[_0xe362('0x4a')](function(_0x19ad8e){console[_0xe362('0xab')]('ServiceNow\x20error:\x20'+_0x19ad8e);var _0x1bfa90=_0x199cf0[_0xe362('0x34')][_0xe362('0xb7')]?0x1f4:_0x19ad8e[_0xe362('0xb8')]||0x1f4;logger[_0xe362('0x20')](_0x19ad8e['stack']);delete _0x19ad8e['name'];if(_0x1bfa90===0x191){_0x1bfa90=0x190;}_0xce993e['status'](_0x1bfa90)['send'](_0x199cf0[_0xe362('0x34')][_0xe362('0xb7')]?{'message':_0xe362('0xb9'),'statusCode':_0x19ad8e['statusCode']}:_0x19ad8e);});};function createFieldObject(_0x5b6932,_0x454602,_0x3d1832,_0x25a40b,_0x473d84,_0x39a6e2){return new Promise(function(_0xb82339,_0x4fc426){var _0x268057={'id':_0x25a40b,'name':_0x473d84,'custom':_0x39a6e2};if(_0x3d1832===_0xe362('0xba')){_0x268057['options']=[{'name':'True','value':'true'},{'name':'False','value':_0xe362('0xbb')}];_0xb82339(_0x268057);}else{var _0x4735f0={'method':_0xe362('0xa9'),'uri':_0x5b6932+_0xe362('0xbc')+_0x25a40b,'auth':_0x454602,'json':!![]};return rp(_0x4735f0)[_0xe362('0x19')](function(_0x16cf9a){var _0x5c0670=[];if(_0x16cf9a['result'][_0xe362('0x39')]>0x0){_0x16cf9a['result']['forEach'](function(_0x38a48a){if(_0x38a48a[_0xe362('0xbd')]===_0xe362('0xbb')){var _0x48d3fc={'name':_0x38a48a['label'],'value':_0x38a48a[_0xe362('0xbe')]};_0x5c0670[_0xe362('0xb2')](_0x48d3fc);}});}_0x268057[_0xe362('0x45')]=_0x5c0670;if(_0x268057[_0xe362('0x45')][_0xe362('0x39')]>0x0){_0xb82339(_0x268057);}else{if(_0x39a6e2==![]){_0xb82339();}else{_0xb82339(_0x268057);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 36dcbeb..ef2a366 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x7a54,0x106));var _0x47a5=function(_0x17bc92,_0x174962){_0x17bc92=_0x17bc92-0x0;var _0x299a29=_0x7a54[_0x17bc92];return _0x299a29;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x1167dd,_0x1a8011){var _0xd37e5b=function(_0x2439be){while(--_0x2439be){_0x1167dd['push'](_0x1167dd['shift']());}};_0xd37e5b(++_0x1a8011);}(_0x814b,0x1a2));var _0xb814=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x814b[_0x2a56ad];return _0x425175;};'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'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'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 87783a2..e6e87d2 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 _0x40ab=['where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','map','model','debug','ShowServicenowAccount','find'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x40ab,0x64));var _0xb40a=function(_0x19fdab,_0x226364){_0x19fdab=_0x19fdab-0x0;var _0x5f18f5=_0x40ab[_0x19fdab];return _0x5f18f5;};'use strict';var _=require('lodash');var util=require(_0xb40a('0x0'));var moment=require(_0xb40a('0x1'));var BPromise=require(_0xb40a('0x2'));var rs=require(_0xb40a('0x3'));var fs=require('fs');var Redis=require(_0xb40a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb40a('0x5'));var logger=require(_0xb40a('0x6'))(_0xb40a('0x7'));var config=require(_0xb40a('0x8'));var jayson=require(_0xb40a('0x9'));var client=jayson['client'][_0xb40a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21248b,_0x5192f3,_0x599787){return new BPromise(function(_0x5b7781,_0x3e660f){return client['request'](_0x21248b,_0x599787)[_0xb40a('0xb')](function(_0x59f757){logger['info'](_0xb40a('0xc'),_0x5192f3,_0xb40a('0xd'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5192f3,'request\x20sent',JSON[_0xb40a('0xe')](_0x59f757));if(_0x59f757['error']){if(_0x59f757[_0xb40a('0xf')]['code']===0x1f4){logger['error'](_0xb40a('0xc'),_0x5192f3,_0x59f757['error']['message']);return _0x3e660f(_0x59f757['error']['message']);}logger[_0xb40a('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0x59f757[_0xb40a('0xf')][_0xb40a('0x10')]);return _0x5b7781(_0x59f757[_0xb40a('0xf')][_0xb40a('0x10')]);}else{logger[_0xb40a('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0xb40a('0xd'));_0x5b7781(_0x59f757[_0xb40a('0x12')]['message']);}})[_0xb40a('0x13')](function(_0x355fb4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0x355fb4);_0x3e660f(_0x355fb4);});});}exports[_0xb40a('0x14')]=function(_0x52e39c){var _0x8bfe0a=this;return new Promise(function(_0x3bc5d7,_0x1be736){return db[_0xb40a('0x15')]['findAll']({'raw':_0x52e39c['options']?_0x52e39c[_0xb40a('0x16')][_0xb40a('0x17')]===undefined?!![]:![]:!![],'where':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options']['where']||null:null,'attributes':_0x52e39c[_0xb40a('0x16')]?_0x52e39c[_0xb40a('0x16')][_0xb40a('0x18')]||null:null,'limit':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options'][_0xb40a('0x19')]||null:null,'include':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options'][_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x52e39c['options'][_0xb40a('0x1a')],function(_0x4e2aef){return{'model':db[_0x4e2aef[_0xb40a('0x1c')]],'as':_0x4e2aef['as'],'attributes':_0x4e2aef[_0xb40a('0x18')],'include':_0x4e2aef[_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x4e2aef[_0xb40a('0x1a')],function(_0xfe28f7){return{'model':db[_0xfe28f7[_0xb40a('0x1c')]],'as':_0xfe28f7['as'],'attributes':_0xfe28f7[_0xb40a('0x18')],'include':_0xfe28f7['include']?_[_0xb40a('0x1b')](_0xfe28f7[_0xb40a('0x1a')],function(_0x5b8c6d){return{'model':db[_0x5b8c6d[_0xb40a('0x1c')]],'as':_0x5b8c6d['as'],'attributes':_0x5b8c6d[_0xb40a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7234){logger[_0xb40a('0x11')](_0xb40a('0x14'),_0x52e39c);logger[_0xb40a('0x1d')](_0xb40a('0x14'),_0x52e39c,JSON['stringify'](_0x4f7234));_0x3bc5d7(_0x4f7234);})[_0xb40a('0x13')](function(_0x5c9366){logger[_0xb40a('0xf')](_0xb40a('0x14'),_0x5c9366[_0xb40a('0x10')],_0x52e39c);_0x1be736(_0x8bfe0a['error'](0x1f4,_0x5c9366[_0xb40a('0x10')]));});});};exports[_0xb40a('0x1e')]=function(_0x282fae){var _0x2c5d02=this;return new Promise(function(_0x2f2d6a,_0x14a1ed){return db[_0xb40a('0x15')][_0xb40a('0x1f')]({'raw':_0x282fae[_0xb40a('0x16')]?_0x282fae['options'][_0xb40a('0x17')]===undefined?!![]:![]:!![],'where':_0x282fae[_0xb40a('0x16')]?_0x282fae['options'][_0xb40a('0x20')]||null:null,'attributes':_0x282fae['options']?_0x282fae[_0xb40a('0x16')]['attributes']||null:null,'include':_0x282fae[_0xb40a('0x16')]?_0x282fae[_0xb40a('0x16')][_0xb40a('0x1a')]?_['map'](_0x282fae[_0xb40a('0x16')]['include'],function(_0x191a20){return{'model':db[_0x191a20[_0xb40a('0x1c')]],'as':_0x191a20['as'],'attributes':_0x191a20[_0xb40a('0x18')],'include':_0x191a20[_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x191a20['include'],function(_0x32f5c5){return{'model':db[_0x32f5c5['model']],'as':_0x32f5c5['as'],'attributes':_0x32f5c5[_0xb40a('0x18')],'include':_0x32f5c5[_0xb40a('0x1a')]?_['map'](_0x32f5c5[_0xb40a('0x1a')],function(_0x40889d){return{'model':db[_0x40889d[_0xb40a('0x1c')]],'as':_0x40889d['as'],'attributes':_0x40889d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb40a('0xb')](function(_0x30dc00){logger[_0xb40a('0x11')](_0xb40a('0x1e'),_0x282fae);logger[_0xb40a('0x1d')](_0xb40a('0x1e'),_0x282fae,JSON[_0xb40a('0xe')](_0x30dc00));_0x2f2d6a(_0x30dc00);})['catch'](function(_0x5b4d4c){logger[_0xb40a('0xf')](_0xb40a('0x1e'),_0x5b4d4c['message'],_0x282fae);_0x14a1ed(_0x2c5d02[_0xb40a('0xf')](0x1f4,_0x5b4d4c[_0xb40a('0x10')]));});});}; \ No newline at end of file +var _0x1551=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x1ff6d1,_0x52f903){var _0x1554cd=function(_0x233f9d){while(--_0x233f9d){_0x1ff6d1['push'](_0x1ff6d1['shift']());}};_0x1554cd(++_0x52f903);}(_0x1551,0x12c));var _0x1155=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x1551[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x1155('0x0'));var util=require(_0x1155('0x1'));var moment=require(_0x1155('0x2'));var BPromise=require(_0x1155('0x3'));var rs=require(_0x1155('0x4'));var fs=require('fs');var Redis=require(_0x1155('0x5'));var db=require(_0x1155('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1155('0x7'))(_0x1155('0x8'));var config=require(_0x1155('0x9'));var jayson=require(_0x1155('0xa'));var client=jayson['client'][_0x1155('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29b0d2,_0x404ccb,_0x329307){return new BPromise(function(_0x4b572c,_0x1084f8){return client[_0x1155('0xc')](_0x29b0d2,_0x329307)[_0x1155('0xd')](function(_0x5ac777){logger[_0x1155('0xe')](_0x1155('0xf'),_0x404ccb,_0x1155('0x10'));logger[_0x1155('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x404ccb,_0x1155('0x10'),JSON[_0x1155('0x12')](_0x5ac777));if(_0x5ac777[_0x1155('0x13')]){if(_0x5ac777[_0x1155('0x13')]['code']===0x1f4){logger[_0x1155('0x13')](_0x1155('0xf'),_0x404ccb,_0x5ac777['error']['message']);return _0x1084f8(_0x5ac777['error'][_0x1155('0x14')]);}logger['error'](_0x1155('0xf'),_0x404ccb,_0x5ac777[_0x1155('0x13')][_0x1155('0x14')]);return _0x4b572c(_0x5ac777[_0x1155('0x13')][_0x1155('0x14')]);}else{logger[_0x1155('0xe')](_0x1155('0xf'),_0x404ccb,_0x1155('0x10'));_0x4b572c(_0x5ac777[_0x1155('0x15')][_0x1155('0x14')]);}})[_0x1155('0x16')](function(_0x4a3e59){logger[_0x1155('0x13')](_0x1155('0xf'),_0x404ccb,_0x4a3e59);_0x1084f8(_0x4a3e59);});});}exports['GetServicenowAccount']=function(_0x30c6ac){var _0x1db795=this;return new Promise(function(_0x1938cc,_0x249831){return db[_0x1155('0x17')][_0x1155('0x18')]({'raw':_0x30c6ac['options']?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1a')]===undefined?!![]:![]:!![],'where':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1b')]||null:null,'attributes':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1c')]||null:null,'limit':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')]['limit']||null:null,'include':_0x30c6ac[_0x1155('0x19')]?_0x30c6ac[_0x1155('0x19')][_0x1155('0x1d')]?_['map'](_0x30c6ac[_0x1155('0x19')]['include'],function(_0x2420e3){return{'model':db[_0x2420e3['model']],'as':_0x2420e3['as'],'attributes':_0x2420e3['attributes'],'include':_0x2420e3[_0x1155('0x1d')]?_[_0x1155('0x1e')](_0x2420e3[_0x1155('0x1d')],function(_0x55374e){return{'model':db[_0x55374e[_0x1155('0x1f')]],'as':_0x55374e['as'],'attributes':_0x55374e[_0x1155('0x1c')],'include':_0x55374e['include']?_[_0x1155('0x1e')](_0x55374e[_0x1155('0x1d')],function(_0x3248cb){return{'model':db[_0x3248cb[_0x1155('0x1f')]],'as':_0x3248cb['as'],'attributes':_0x3248cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x1155('0xd')](function(_0x298ade){logger['info'](_0x1155('0x20'),_0x30c6ac);logger[_0x1155('0x11')](_0x1155('0x20'),_0x30c6ac,JSON[_0x1155('0x12')](_0x298ade));_0x1938cc(_0x298ade);})[_0x1155('0x16')](function(_0x2cbe63){logger[_0x1155('0x13')](_0x1155('0x20'),_0x2cbe63[_0x1155('0x14')],_0x30c6ac);_0x249831(_0x1db795[_0x1155('0x13')](0x1f4,_0x2cbe63[_0x1155('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x2c7567){var _0x2496b2=this;return new Promise(function(_0x16e1ea,_0x3c9d7d){return db[_0x1155('0x17')][_0x1155('0x21')]({'raw':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1b')]||null:null,'attributes':_0x2c7567[_0x1155('0x19')]?_0x2c7567['options']['attributes']||null:null,'include':_0x2c7567[_0x1155('0x19')]?_0x2c7567[_0x1155('0x19')][_0x1155('0x1d')]?_[_0x1155('0x1e')](_0x2c7567['options'][_0x1155('0x1d')],function(_0x1c8df8){return{'model':db[_0x1c8df8[_0x1155('0x1f')]],'as':_0x1c8df8['as'],'attributes':_0x1c8df8['attributes'],'include':_0x1c8df8['include']?_['map'](_0x1c8df8['include'],function(_0x2a249f){return{'model':db[_0x2a249f[_0x1155('0x1f')]],'as':_0x2a249f['as'],'attributes':_0x2a249f['attributes'],'include':_0x2a249f[_0x1155('0x1d')]?_['map'](_0x2a249f['include'],function(_0x5310df){return{'model':db[_0x5310df[_0x1155('0x1f')]],'as':_0x5310df['as'],'attributes':_0x5310df['attributes']};}):[]};}):[]};}):[]:[]})[_0x1155('0xd')](function(_0x5f1ed4){logger[_0x1155('0xe')](_0x1155('0x22'),_0x2c7567);logger[_0x1155('0x11')](_0x1155('0x22'),_0x2c7567,JSON[_0x1155('0x12')](_0x5f1ed4));_0x16e1ea(_0x5f1ed4);})[_0x1155('0x16')](function(_0x4e84f8){logger['error'](_0x1155('0x22'),_0x4e84f8[_0x1155('0x14')],_0x2c7567);_0x3c9d7d(_0x2496b2[_0x1155('0x13')](0x1f4,_0x4e84f8[_0x1155('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 659fe55..b363847 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 _0x2b10=['index','/:id','show','/:id/fields','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x92342b,_0x4b1810){var _0x44a822=function(_0x2c0e0c){while(--_0x2c0e0c){_0x92342b['push'](_0x92342b['shift']());}};_0x44a822(++_0x4b1810);}(_0x2b10,0xfc));var _0x02b1=function(_0xc164,_0x30abed){_0xc164=_0xc164-0x0;var _0x469d46=_0x2b10[_0xc164];return _0x469d46;};'use strict';var multer=require(_0x02b1('0x0'));var util=require(_0x02b1('0x1'));var path=require(_0x02b1('0x2'));var timeout=require(_0x02b1('0x3'));var express=require(_0x02b1('0x4'));var router=express[_0x02b1('0x5')]();var auth=require(_0x02b1('0x6'));var interaction=require(_0x02b1('0x7'));var config=require(_0x02b1('0x8'));var controller=require(_0x02b1('0x9'));router[_0x02b1('0xa')]('/',auth[_0x02b1('0xb')](),controller[_0x02b1('0xc')]);router['get'](_0x02b1('0xd'),auth['isAuthenticated'](),controller[_0x02b1('0xe')]);router[_0x02b1('0xa')](_0x02b1('0xf'),auth[_0x02b1('0xb')](),controller['getFields']);router[_0x02b1('0xa')]('/:id/subjects',auth[_0x02b1('0xb')](),controller[_0x02b1('0x10')]);router[_0x02b1('0xa')]('/:id/descriptions',auth[_0x02b1('0xb')](),controller[_0x02b1('0x11')]);router[_0x02b1('0x12')]('/',auth[_0x02b1('0xb')](),controller[_0x02b1('0x13')]);router[_0x02b1('0x14')](_0x02b1('0xd'),auth[_0x02b1('0xb')](),controller[_0x02b1('0x15')]);router[_0x02b1('0x16')](_0x02b1('0xd'),auth[_0x02b1('0xb')](),controller['destroy']);module[_0x02b1('0x17')]=router; \ No newline at end of file +var _0x90b7=['index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x4712ef,_0x3e5e22){var _0x30ec75=function(_0x237589){while(--_0x237589){_0x4712ef['push'](_0x4712ef['shift']());}};_0x30ec75(++_0x3e5e22);}(_0x90b7,0x99));var _0x790b=function(_0x3b5984,_0x44dd34){_0x3b5984=_0x3b5984-0x0;var _0x3fcbf3=_0x90b7[_0x3b5984];return _0x3fcbf3;};'use strict';var multer=require('multer');var util=require(_0x790b('0x0'));var path=require(_0x790b('0x1'));var timeout=require(_0x790b('0x2'));var express=require('express');var router=express[_0x790b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x790b('0x4'));var config=require(_0x790b('0x5'));var controller=require(_0x790b('0x6'));router[_0x790b('0x7')]('/',auth['isAuthenticated'](),controller[_0x790b('0x8')]);router['get']('/:id',auth[_0x790b('0x9')](),controller[_0x790b('0xa')]);router['get']('/:id/fields',auth[_0x790b('0x9')](),controller[_0x790b('0xb')]);router[_0x790b('0x7')](_0x790b('0xc'),auth['isAuthenticated'](),controller[_0x790b('0xd')]);router[_0x790b('0x7')](_0x790b('0xe'),auth[_0x790b('0x9')](),controller[_0x790b('0xf')]);router[_0x790b('0x10')]('/',auth[_0x790b('0x9')](),controller[_0x790b('0x11')]);router['put']('/:id',auth[_0x790b('0x9')](),controller[_0x790b('0x12')]);router[_0x790b('0x13')](_0x790b('0x14'),auth['isAuthenticated'](),controller[_0x790b('0x15')]);module[_0x790b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 180ebca..7b3d82a 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 _0xb0c0=['sequelize','exports','STRING'];(function(_0x21a14a,_0x2ef0f6){var _0x3d3931=function(_0x43f340){while(--_0x43f340){_0x21a14a['push'](_0x21a14a['shift']());}};_0x3d3931(++_0x2ef0f6);}(_0xb0c0,0x144));var _0x0b0c=function(_0x5abe26,_0x39c703){_0x5abe26=_0x5abe26-0x0;var _0x28eed8=_0xb0c0[_0x5abe26];return _0x28eed8;};'use strict';var Sequelize=require(_0x0b0c('0x0'));module[_0x0b0c('0x1')]={'name':{'type':Sequelize[_0x0b0c('0x2')]},'description':{'type':Sequelize[_0x0b0c('0x2')]}}; \ No newline at end of file +var _0x8b88=['exports','STRING','sequelize'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x8b88,0x17f));var _0x88b8=function(_0xc52705,_0x842a2c){_0xc52705=_0xc52705-0x0;var _0x59dfa5=_0x8b88[_0xc52705];return _0x59dfa5;};'use strict';var Sequelize=require(_0x88b8('0x0'));module[_0x88b8('0x1')]={'name':{'type':Sequelize[_0x88b8('0x2')]},'description':{'type':Sequelize[_0x88b8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index bac6f96..095cb92 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 _0xadb5=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','ServicenowConfiguration','count','includeAll','include','show','params','options','find','create','body','destroy','getFields','findOne','ServicenowField','sort','merge','order','getSubjects','hasOwnProperty','getDescriptions','nolimit','eml-format','zip-dir','fast-json-patch'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xadb5,0xad));var _0x5adb=function(_0x26a1fd,_0x35215e){_0x26a1fd=_0x26a1fd-0x0;var _0x5cba48=_0xadb5[_0x26a1fd];return _0x5cba48;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['ServicenowConfiguration'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['ServicenowConfiguration']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4c')],{})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))['catch'](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x91775c,_0x28b291){if(_0x91775c[_0x5adb('0x4c')]['id']){delete _0x91775c[_0x5adb('0x4c')]['id'];}return db['ServicenowConfiguration'][_0x5adb('0x4a')]({'where':{'id':_0x91775c['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x28b291,null))['then'](saveUpdates(_0x91775c[_0x5adb('0x4c')],null))[_0x5adb('0x1b')](respondWithResult(_0x28b291,null))[_0x5adb('0x24')](handleError(_0x28b291,null));};exports[_0x5adb('0x4d')]=function(_0x59b512,_0x18f95c){return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x59b512['params']['id']}})['then'](handleEntityNotFound(_0x18f95c,null))['then'](removeEntity(_0x18f95c,null))[_0x5adb('0x24')](handleError(_0x18f95c,null));};exports[_0x5adb('0x4e')]=function(_0xa5ecc0,_0x12a146,_0xa833f4){var _0xb06bee={};var _0x204b9b={};var _0x8d7810;var _0xc880af;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0xa5ecc0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x12a146,null))['then'](function(_0x49f4c8){if(_0x49f4c8){_0x8d7810=_0x49f4c8;_0x204b9b[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x204b9b['query']=_[_0x5adb('0x33')](_0xa5ecc0[_0x5adb('0x36')]);_0x204b9b['filters']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],_0x204b9b[_0x5adb('0x36')]);_0xb06bee['attributes']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x38')]));_0xb06bee[_0x5adb('0x39')]=_0xb06bee['attributes'][_0x5adb('0x3a')]?_0xb06bee[_0x5adb('0x39')]:_0x204b9b[_0x5adb('0x37')];_0xb06bee['order']=qs[_0x5adb('0x51')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x51')]);_0xb06bee['where']=qs[_0x5adb('0x34')](_['pick'](_0xa5ecc0[_0x5adb('0x36')],_0x204b9b[_0x5adb('0x34')]));if(_0xa5ecc0[_0x5adb('0x36')]['filter']){_0xb06bee[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0xb06bee['where'],{'$or':_[_0x5adb('0x3e')](_0xb06bee[_0x5adb('0x39')],function(_0x248739){var _0x3fcad5={};_0x3fcad5[_0x248739]={'$like':'%'+_0xa5ecc0['query'][_0x5adb('0x3d')]+'%'};return _0x3fcad5;})});}_0xb06bee=_[_0x5adb('0x52')]({},_0xb06bee,_0xa5ecc0[_0x5adb('0x49')]);return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})['then'](function(_0x53a4bc){if(_0x53a4bc){_0xc880af=_0x53a4bc[_0x5adb('0x3a')];if(!_0xa5ecc0['query']['hasOwnProperty']('nolimit')){_0xb06bee[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0xa5ecc0['query'][_0x5adb('0x28')]);_0xb06bee[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})[_0x5adb('0x1b')](function(_0x1ffcd3){if(_0x1ffcd3){return _0x1ffcd3?{'count':_0xc880af,'rows':_0x1ffcd3}:null;}})['then'](respondWithResult(_0x12a146,null))['catch'](handleError(_0x12a146,null));};exports['getSubjects']=function(_0x347b7b,_0x4357a6,_0x3a0d1b){var _0x2a55a3={};var _0x1f59bb={};var _0x2f6ef7;var _0x386c76;return db[_0x5adb('0x43')]['findOne']({'where':{'id':_0x347b7b['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x4357a6,null))[_0x5adb('0x1b')](function(_0x114ee4){if(_0x114ee4){_0x2f6ef7=_0x114ee4;_0x1f59bb[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x1f59bb[_0x5adb('0x36')]=_[_0x5adb('0x33')](_0x347b7b[_0x5adb('0x36')]);_0x1f59bb['filters']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],_0x1f59bb[_0x5adb('0x36')]);_0x2a55a3['attributes']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],qs['fields'](_0x347b7b[_0x5adb('0x36')]['fields']));_0x2a55a3[_0x5adb('0x39')]=_0x2a55a3[_0x5adb('0x39')]['length']?_0x2a55a3[_0x5adb('0x39')]:_0x1f59bb[_0x5adb('0x37')];_0x2a55a3[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x51')]);_0x2a55a3[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x347b7b[_0x5adb('0x36')],_0x1f59bb[_0x5adb('0x34')]));if(_0x347b7b[_0x5adb('0x36')]['filter']){_0x2a55a3['where']=_[_0x5adb('0x52')](_0x2a55a3['where'],{'$or':_[_0x5adb('0x3e')](_0x2a55a3[_0x5adb('0x39')],function(_0xd6cc89){var _0x50600f={};_0x50600f[_0xd6cc89]={'$like':'%'+_0x347b7b[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x50600f;})});}_0x2a55a3=_[_0x5adb('0x52')]({},_0x2a55a3,_0x347b7b[_0x5adb('0x49')]);return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})['then'](function(_0x2a3084){if(_0x2a3084){_0x386c76=_0x2a3084[_0x5adb('0x3a')];if(!_0x347b7b[_0x5adb('0x36')][_0x5adb('0x55')]('nolimit')){_0x2a55a3[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x28')]);_0x2a55a3[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x347b7b[_0x5adb('0x36')]['offset']);}return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})[_0x5adb('0x1b')](function(_0x5f36ec){if(_0x5f36ec){return _0x5f36ec?{'count':_0x386c76,'rows':_0x5f36ec}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x4357a6,null))[_0x5adb('0x24')](handleError(_0x4357a6,null));};exports['getDescriptions']=function(_0x462fa0,_0x50f8ed,_0x372354){var _0x268df2={};var _0x4a2ebc={};var _0x167432;var _0x54c2c8;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0x462fa0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x50f8ed,null))[_0x5adb('0x1b')](function(_0x4dbcd9){if(_0x4dbcd9){_0x167432=_0x4dbcd9;_0x4a2ebc[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x4a2ebc['query']=_['keys'](_0x462fa0[_0x5adb('0x36')]);_0x4a2ebc[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4a2ebc[_0x5adb('0x37')],_0x4a2ebc[_0x5adb('0x36')]);_0x268df2[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x4a2ebc['model'],qs[_0x5adb('0x38')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x38')]));_0x268df2[_0x5adb('0x39')]=_0x268df2['attributes'][_0x5adb('0x3a')]?_0x268df2[_0x5adb('0x39')]:_0x4a2ebc[_0x5adb('0x37')];_0x268df2[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x51')]);_0x268df2[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x462fa0[_0x5adb('0x36')],_0x4a2ebc[_0x5adb('0x34')]));if(_0x462fa0['query'][_0x5adb('0x3d')]){_0x268df2[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0x268df2[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x268df2[_0x5adb('0x39')],function(_0x450516){var _0x350bb1={};_0x350bb1[_0x450516]={'$like':'%'+_0x462fa0['query'][_0x5adb('0x3d')]+'%'};return _0x350bb1;})});}_0x268df2=_[_0x5adb('0x52')]({},_0x268df2,_0x462fa0['options']);return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x14d4a7){if(_0x14d4a7){_0x54c2c8=_0x14d4a7['length'];if(!_0x462fa0['query'][_0x5adb('0x55')](_0x5adb('0x57'))){_0x268df2[_0x5adb('0x28')]=qs['limit'](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x28')]);_0x268df2[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x28bd33){if(_0x28bd33){return _0x28bd33?{'count':_0x54c2c8,'rows':_0x28bd33}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x50f8ed,null))[_0x5adb('0x24')](handleError(_0x50f8ed,null));}; \ No newline at end of file +var _0x2ef3=['params','options','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','ServicenowConfiguration','includeAll','include','findAll','show'];(function(_0x40c4a5,_0xa7bba7){var _0x4717e3=function(_0x1bdb37){while(--_0x1bdb37){_0x40c4a5['push'](_0x40c4a5['shift']());}};_0x4717e3(++_0xa7bba7);}(_0x2ef3,0xba));var _0x32ef=function(_0x1debf6,_0x47f160){_0x1debf6=_0x1debf6-0x0;var _0x44be6f=_0x2ef3[_0x1debf6];return _0x44be6f;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x32ef('0x18'));var client=jayson['client'][_0x32ef('0x19')]({'port':0x232a});function checkPasswordPattern(_0x49d590,_0x3e98df,_0x1ef1ae){if(_0x1ef1ae){var _0x5c3eb9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c3eb9['test'](_0x3e98df)){return _0x49d590;}else{throw new Error(_0x32ef('0x1a'));}}else{return _0x49d590;}}function respondWithRpcPromise(_0x4d8009,_0x326fce,_0x40a6e6,_0x93d492){return new BPromise(function(_0x54c7f5,_0x57aff1){var _0x55bf0b=_0x93d492||client;return _0x55bf0b['request'](_0x4d8009,_0x40a6e6)[_0x32ef('0x1b')](function(_0x3950e6){logger[_0x32ef('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x326fce,'request\x20sent');logger[_0x32ef('0x1d')](_0x32ef('0x1e'),_0x326fce,_0x32ef('0x1f'),JSON['stringify'](_0x3950e6));if(_0x3950e6[_0x32ef('0x20')]){if(_0x3950e6[_0x32ef('0x20')]['code']===0x1f4){logger[_0x32ef('0x20')](_0x32ef('0x21'),_0x326fce,_0x3950e6[_0x32ef('0x20')][_0x32ef('0x22')]);return _0x57aff1(_0x3950e6[_0x32ef('0x20')][_0x32ef('0x22')]);}logger['error'](_0x32ef('0x21'),_0x326fce,_0x3950e6['error'][_0x32ef('0x22')]);return _0x54c7f5(_0x3950e6[_0x32ef('0x20')]['message']);}else{logger[_0x32ef('0x1c')](_0x32ef('0x21'),_0x326fce,_0x32ef('0x1f'));_0x54c7f5(_0x3950e6['result']['message']);}})[_0x32ef('0x23')](function(_0xb30fab){logger[_0x32ef('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x326fce,_0xb30fab);_0x57aff1(_0xb30fab);});});}function respondWithStatusCode(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0xcc;return function(_0x4d584b){if(_0x4d584b){return _0x59585f['sendStatus'](_0x19ea6);}return _0x59585f[_0x32ef('0x24')](_0x19ea6)[_0x32ef('0x25')]();};}function respondWithResult(_0x371540,_0x1dbe98){_0x1dbe98=_0x1dbe98||0xc8;return function(_0x15ce54){if(_0x15ce54){return _0x371540[_0x32ef('0x24')](_0x1dbe98)[_0x32ef('0x26')](_0x15ce54);}};}function respondWithFilteredResult(_0x38aed5,_0x338f19){return function(_0x2f52d7){if(_0x2f52d7){var _0x1335e2=_0x2f52d7[_0x32ef('0x27')],_0xba4b3f=_0x338f19['offset'],_0x5a88a5=_0x338f19[_0x32ef('0x28')]+_0x338f19[_0x32ef('0x29')],_0xd65fde;if(_0x5a88a5>=_0x1335e2){_0x5a88a5=_0x1335e2;_0xd65fde=0xc8;}else{_0xd65fde=0xce;}_0x38aed5[_0x32ef('0x24')](_0xd65fde);return _0x38aed5[_0x32ef('0x2a')]('Content-Range',_0xba4b3f+'-'+_0x5a88a5+'/'+_0x1335e2)[_0x32ef('0x26')](_0x2f52d7);}return null;};}function patchUpdates(_0x22bf86){return function(_0x31dbc3){try{jsonpatch[_0x32ef('0x2b')](_0x31dbc3,_0x22bf86,!![]);}catch(_0x1b668a){return BPromise[_0x32ef('0x2c')](_0x1b668a);}return _0x31dbc3[_0x32ef('0x2d')]();};}function saveUpdates(_0x575f3e,_0x36ac37){return function(_0x537214){if(_0x537214){return _0x537214[_0x32ef('0x2e')](_0x575f3e)[_0x32ef('0x1b')](function(_0x5a9565){return _0x5a9565;});}return null;};}function removeEntity(_0xcc2efb,_0x17e4d1){return function(_0x3b00ad){if(_0x3b00ad){return _0x3b00ad[_0x32ef('0x2f')]()[_0x32ef('0x1b')](function(){_0xcc2efb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(!_0x643dc4){_0x2a5eb5[_0x32ef('0x30')](0x194);}return _0x643dc4;};}function handleError(_0x2f1349,_0x390670){_0x390670=_0x390670||0x1f4;return function(_0x389583){logger[_0x32ef('0x20')](_0x389583['stack']);if(_0x389583['name']){delete _0x389583['name'];}_0x2f1349[_0x32ef('0x24')](_0x390670)[_0x32ef('0x31')](_0x389583);};}exports[_0x32ef('0x32')]=function(_0x5f2443,_0x4fb402){var _0x1c3633={},_0x2bd8a9={},_0x410334={'count':0x0,'rows':[]};var _0x480348=db['ServicenowConfiguration'][_0x32ef('0x33')];_0x2bd8a9[_0x32ef('0x34')]=_[_0x32ef('0x35')](_0x480348);_0x2bd8a9[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x5f2443[_0x32ef('0x36')]);_0x2bd8a9[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x2bd8a9[_0x32ef('0x34')],_0x2bd8a9['query']);_0x1c3633[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x2bd8a9[_0x32ef('0x34')],qs['fields'](_0x5f2443[_0x32ef('0x36')][_0x32ef('0x3a')]));_0x1c3633[_0x32ef('0x39')]=_0x1c3633[_0x32ef('0x39')][_0x32ef('0x3b')]?_0x1c3633[_0x32ef('0x39')]:_0x2bd8a9[_0x32ef('0x34')];if(!_0x5f2443[_0x32ef('0x36')][_0x32ef('0x3c')](_0x32ef('0x3d'))){_0x1c3633[_0x32ef('0x29')]=qs[_0x32ef('0x29')](_0x5f2443['query'][_0x32ef('0x29')]);_0x1c3633[_0x32ef('0x28')]=qs[_0x32ef('0x28')](_0x5f2443[_0x32ef('0x36')][_0x32ef('0x28')]);}_0x1c3633[_0x32ef('0x3e')]=qs[_0x32ef('0x3f')](_0x5f2443['query']['sort']);_0x1c3633[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_[_0x32ef('0x41')](_0x5f2443[_0x32ef('0x36')],_0x2bd8a9['filters']));if(_0x5f2443[_0x32ef('0x36')][_0x32ef('0x42')]){_0x1c3633['where']=_[_0x32ef('0x43')](_0x1c3633['where'],{'$or':_[_0x32ef('0x44')](_0x480348,function(_0x100ec7){if(_0x100ec7[_0x32ef('0x45')][_0x32ef('0x46')]!==_0x32ef('0x47')){var _0x2310ae={};_0x2310ae[_0x100ec7[_0x32ef('0x48')]]={'$like':'%'+_0x5f2443[_0x32ef('0x36')][_0x32ef('0x42')]+'%'};return _0x2310ae;}})});}_0x1c3633=_[_0x32ef('0x43')]({},_0x1c3633,_0x5f2443['options']);var _0x18b943={'where':_0x1c3633['where']};return db[_0x32ef('0x49')][_0x32ef('0x27')](_0x18b943)[_0x32ef('0x1b')](function(_0x4d8393){_0x410334[_0x32ef('0x27')]=_0x4d8393;if(_0x5f2443[_0x32ef('0x36')][_0x32ef('0x4a')]){_0x1c3633[_0x32ef('0x4b')]=[{'all':!![]}];}return db[_0x32ef('0x49')][_0x32ef('0x4c')](_0x1c3633);})[_0x32ef('0x1b')](function(_0x47dbe1){_0x410334['rows']=_0x47dbe1;return _0x410334;})[_0x32ef('0x1b')](respondWithFilteredResult(_0x4fb402,_0x1c3633))[_0x32ef('0x23')](handleError(_0x4fb402,null));};exports[_0x32ef('0x4d')]=function(_0x13b270,_0x209361){var _0xd67dc9={'raw':![],'where':{'id':_0x13b270[_0x32ef('0x4e')]['id']}},_0x44ad11={};_0x44ad11[_0x32ef('0x34')]=_[_0x32ef('0x35')](db[_0x32ef('0x49')][_0x32ef('0x33')]);_0x44ad11[_0x32ef('0x36')]=_['keys'](_0x13b270[_0x32ef('0x36')]);_0x44ad11[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x44ad11[_0x32ef('0x34')],_0x44ad11[_0x32ef('0x36')]);_0xd67dc9[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x44ad11[_0x32ef('0x34')],qs[_0x32ef('0x3a')](_0x13b270[_0x32ef('0x36')][_0x32ef('0x3a')]));_0xd67dc9[_0x32ef('0x39')]=_0xd67dc9[_0x32ef('0x39')][_0x32ef('0x3b')]?_0xd67dc9[_0x32ef('0x39')]:_0x44ad11[_0x32ef('0x34')];if(_0x13b270[_0x32ef('0x36')][_0x32ef('0x4a')]){_0xd67dc9['include']=[{'all':!![]}];}_0xd67dc9=_['merge']({},_0xd67dc9,_0x13b270[_0x32ef('0x4f')]);return db[_0x32ef('0x49')][_0x32ef('0x50')](_0xd67dc9)[_0x32ef('0x1b')](handleEntityNotFound(_0x209361,null))[_0x32ef('0x1b')](respondWithResult(_0x209361,null))[_0x32ef('0x23')](handleError(_0x209361,null));};exports[_0x32ef('0x51')]=function(_0x1f105a,_0x15b640){return db[_0x32ef('0x49')][_0x32ef('0x51')](_0x1f105a['body'],{})[_0x32ef('0x1b')](respondWithResult(_0x15b640,0xc9))[_0x32ef('0x23')](handleError(_0x15b640,null));};exports[_0x32ef('0x2e')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x52')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x49')][_0x32ef('0x50')]({'where':{'id':_0x3fe01f[_0x32ef('0x4e')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x1b')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x1b')](respondWithResult(_0x38314a,null))[_0x32ef('0x23')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x49')][_0x32ef('0x50')]({'where':{'id':_0x206ad5[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x1b')](removeEntity(_0x59e5f9,null))[_0x32ef('0x23')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x53')]=function(_0x56260f,_0x56cc75,_0xdfa103){var _0x52232a={};var _0x4fbab6={};var _0xb519e9;var _0x89d0b3;return db[_0x32ef('0x49')][_0x32ef('0x54')]({'where':{'id':_0x56260f[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x56cc75,null))[_0x32ef('0x1b')](function(_0x4249c3){if(_0x4249c3){_0xb519e9=_0x4249c3;_0x4fbab6[_0x32ef('0x34')]=_[_0x32ef('0x35')](db['ServicenowField']['rawAttributes']);_0x4fbab6[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x56260f['query']);_0x4fbab6[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x4fbab6[_0x32ef('0x34')],_0x4fbab6['query']);_0x52232a[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x4fbab6[_0x32ef('0x34')],qs['fields'](_0x56260f['query'][_0x32ef('0x3a')]));_0x52232a['attributes']=_0x52232a[_0x32ef('0x39')]['length']?_0x52232a['attributes']:_0x4fbab6[_0x32ef('0x34')];_0x52232a[_0x32ef('0x3e')]=qs[_0x32ef('0x3f')](_0x56260f['query'][_0x32ef('0x3f')]);_0x52232a[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_['pick'](_0x56260f[_0x32ef('0x36')],_0x4fbab6[_0x32ef('0x37')]));if(_0x56260f['query']['filter']){_0x52232a[_0x32ef('0x40')]=_[_0x32ef('0x43')](_0x52232a[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x52232a[_0x32ef('0x39')],function(_0x40700e){var _0x4c89e8={};_0x4c89e8[_0x40700e]={'$like':'%'+_0x56260f[_0x32ef('0x36')][_0x32ef('0x42')]+'%'};return _0x4c89e8;})});}_0x52232a=_[_0x32ef('0x43')]({},_0x52232a,_0x56260f[_0x32ef('0x4f')]);return _0xb519e9[_0x32ef('0x53')](_0x52232a);}})[_0x32ef('0x1b')](function(_0x1dc755){if(_0x1dc755){_0x89d0b3=_0x1dc755[_0x32ef('0x3b')];if(!_0x56260f[_0x32ef('0x36')]['hasOwnProperty'](_0x32ef('0x3d'))){_0x52232a[_0x32ef('0x29')]=qs[_0x32ef('0x29')](_0x56260f[_0x32ef('0x36')][_0x32ef('0x29')]);_0x52232a['offset']=qs['offset'](_0x56260f[_0x32ef('0x36')][_0x32ef('0x28')]);}return _0xb519e9[_0x32ef('0x53')](_0x52232a);}})[_0x32ef('0x1b')](function(_0x1a8bad){if(_0x1a8bad){return _0x1a8bad?{'count':_0x89d0b3,'rows':_0x1a8bad}:null;}})['then'](respondWithResult(_0x56cc75,null))[_0x32ef('0x23')](handleError(_0x56cc75,null));};exports['getSubjects']=function(_0x216e2f,_0x1ee66b,_0x48b6f4){var _0x5402b4={};var _0x2c9f7a={};var _0x1538d0;var _0x2e0873;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x216e2f[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x1ee66b,null))[_0x32ef('0x1b')](function(_0x416e62){if(_0x416e62){_0x1538d0=_0x416e62;_0x2c9f7a['model']=_[_0x32ef('0x35')](db[_0x32ef('0x55')][_0x32ef('0x33')]);_0x2c9f7a[_0x32ef('0x36')]=_[_0x32ef('0x35')](_0x216e2f[_0x32ef('0x36')]);_0x2c9f7a[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x2c9f7a[_0x32ef('0x34')],_0x2c9f7a[_0x32ef('0x36')]);_0x5402b4[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x2c9f7a['model'],qs['fields'](_0x216e2f[_0x32ef('0x36')][_0x32ef('0x3a')]));_0x5402b4['attributes']=_0x5402b4[_0x32ef('0x39')]['length']?_0x5402b4[_0x32ef('0x39')]:_0x2c9f7a[_0x32ef('0x34')];_0x5402b4[_0x32ef('0x3e')]=qs['sort'](_0x216e2f[_0x32ef('0x36')]['sort']);_0x5402b4[_0x32ef('0x40')]=qs[_0x32ef('0x37')](_['pick'](_0x216e2f['query'],_0x2c9f7a[_0x32ef('0x37')]));if(_0x216e2f['query'][_0x32ef('0x42')]){_0x5402b4['where']=_[_0x32ef('0x43')](_0x5402b4[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x5402b4['attributes'],function(_0x48b35e){var _0x4f1b94={};_0x4f1b94[_0x48b35e]={'$like':'%'+_0x216e2f[_0x32ef('0x36')]['filter']+'%'};return _0x4f1b94;})});}_0x5402b4=_[_0x32ef('0x43')]({},_0x5402b4,_0x216e2f[_0x32ef('0x4f')]);return _0x1538d0[_0x32ef('0x56')](_0x5402b4);}})[_0x32ef('0x1b')](function(_0x339184){if(_0x339184){_0x2e0873=_0x339184[_0x32ef('0x3b')];if(!_0x216e2f['query'][_0x32ef('0x3c')]('nolimit')){_0x5402b4['limit']=qs[_0x32ef('0x29')](_0x216e2f['query'][_0x32ef('0x29')]);_0x5402b4[_0x32ef('0x28')]=qs['offset'](_0x216e2f[_0x32ef('0x36')][_0x32ef('0x28')]);}return _0x1538d0[_0x32ef('0x56')](_0x5402b4);}})[_0x32ef('0x1b')](function(_0x1fa36d){if(_0x1fa36d){return _0x1fa36d?{'count':_0x2e0873,'rows':_0x1fa36d}:null;}})[_0x32ef('0x1b')](respondWithResult(_0x1ee66b,null))['catch'](handleError(_0x1ee66b,null));};exports['getDescriptions']=function(_0x35b10d,_0x5e0b55,_0x41bbe1){var _0x266688={};var _0x114d8e={};var _0x1782a5;var _0x238e4d;return db[_0x32ef('0x49')]['findOne']({'where':{'id':_0x35b10d[_0x32ef('0x4e')]['id']}})[_0x32ef('0x1b')](handleEntityNotFound(_0x5e0b55,null))[_0x32ef('0x1b')](function(_0x2aeb11){if(_0x2aeb11){_0x1782a5=_0x2aeb11;_0x114d8e[_0x32ef('0x34')]=_['keys'](db['ServicenowField'][_0x32ef('0x33')]);_0x114d8e[_0x32ef('0x36')]=_['keys'](_0x35b10d[_0x32ef('0x36')]);_0x114d8e[_0x32ef('0x37')]=_[_0x32ef('0x38')](_0x114d8e[_0x32ef('0x34')],_0x114d8e[_0x32ef('0x36')]);_0x266688[_0x32ef('0x39')]=_[_0x32ef('0x38')](_0x114d8e[_0x32ef('0x34')],qs[_0x32ef('0x3a')](_0x35b10d['query'][_0x32ef('0x3a')]));_0x266688[_0x32ef('0x39')]=_0x266688['attributes'][_0x32ef('0x3b')]?_0x266688['attributes']:_0x114d8e[_0x32ef('0x34')];_0x266688['order']=qs[_0x32ef('0x3f')](_0x35b10d[_0x32ef('0x36')][_0x32ef('0x3f')]);_0x266688[_0x32ef('0x40')]=qs['filters'](_[_0x32ef('0x41')](_0x35b10d[_0x32ef('0x36')],_0x114d8e[_0x32ef('0x37')]));if(_0x35b10d['query']['filter']){_0x266688['where']=_[_0x32ef('0x43')](_0x266688[_0x32ef('0x40')],{'$or':_[_0x32ef('0x44')](_0x266688[_0x32ef('0x39')],function(_0x3cc90c){var _0x5a1696={};_0x5a1696[_0x3cc90c]={'$like':'%'+_0x35b10d[_0x32ef('0x36')]['filter']+'%'};return _0x5a1696;})});}_0x266688=_[_0x32ef('0x43')]({},_0x266688,_0x35b10d[_0x32ef('0x4f')]);return _0x1782a5[_0x32ef('0x57')](_0x266688);}})['then'](function(_0x14399d){if(_0x14399d){_0x238e4d=_0x14399d[_0x32ef('0x3b')];if(!_0x35b10d[_0x32ef('0x36')][_0x32ef('0x3c')](_0x32ef('0x3d'))){_0x266688['limit']=qs[_0x32ef('0x29')](_0x35b10d['query'][_0x32ef('0x29')]);_0x266688[_0x32ef('0x28')]=qs['offset'](_0x35b10d['query'][_0x32ef('0x28')]);}return _0x1782a5[_0x32ef('0x57')](_0x266688);}})[_0x32ef('0x1b')](function(_0x3b9896){if(_0x3b9896){return _0x3b9896?{'count':_0x238e4d,'rows':_0x3b9896}:null;}})['then'](respondWithResult(_0x5e0b55,null))[_0x32ef('0x23')](handleError(_0x5e0b55,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3f44b9c..5db1bee 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 _0xfea1=['path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0x23a311,_0x12a101){var _0x528616=function(_0x34828a){while(--_0x34828a){_0x23a311['push'](_0x23a311['shift']());}};_0x528616(++_0x12a101);}(_0xfea1,0x163));var _0x1fea=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xfea1[_0x2dc96f];return _0xd012da;};'use strict';var _=require(_0x1fea('0x0'));var util=require(_0x1fea('0x1'));var logger=require(_0x1fea('0x2'))('api');var moment=require(_0x1fea('0x3'));var BPromise=require('bluebird');var rp=require(_0x1fea('0x4'));var fs=require('fs');var path=require(_0x1fea('0x5'));var rimraf=require(_0x1fea('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fea('0x7'));module[_0x1fea('0x8')]=function(_0x2094e8,_0x2de394){return _0x2094e8[_0x1fea('0x9')](_0x1fea('0xa'),attributes,{'tableName':_0x1fea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b38=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ca35f,_0x2b9ce9){var _0x179d47=function(_0x24c655){while(--_0x24c655){_0x3ca35f['push'](_0x3ca35f['shift']());}};_0x179d47(++_0x2b9ce9);}(_0x0b38,0x19b));var _0x80b3=function(_0x1c2028,_0x249c33){_0x1c2028=_0x1c2028-0x0;var _0x59922e=_0x0b38[_0x1c2028];return _0x59922e;};'use strict';var _=require('lodash');var util=require(_0x80b3('0x0'));var logger=require(_0x80b3('0x1'))(_0x80b3('0x2'));var moment=require(_0x80b3('0x3'));var BPromise=require(_0x80b3('0x4'));var rp=require(_0x80b3('0x5'));var fs=require('fs');var path=require(_0x80b3('0x6'));var rimraf=require(_0x80b3('0x7'));var config=require(_0x80b3('0x8'));var attributes=require(_0x80b3('0x9'));module[_0x80b3('0xa')]=function(_0x3437f3,_0x2ddf23){return _0x3437f3[_0x80b3('0xb')](_0x80b3('0xc'),attributes,{'tableName':_0x80b3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c81f864..ebfc2d3 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 _0x9a45=['code','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41a785,_0x2a6ffa){var _0x56f35d=function(_0x5199d4){while(--_0x5199d4){_0x41a785['push'](_0x41a785['shift']());}};_0x56f35d(++_0x2a6ffa);}(_0x9a45,0xca));var _0x59a4=function(_0x19e3c2,_0x177a95){_0x19e3c2=_0x19e3c2-0x0;var _0x2bb88f=_0x9a45[_0x19e3c2];return _0x2bb88f;};'use strict';var _=require(_0x59a4('0x0'));var util=require(_0x59a4('0x1'));var moment=require('moment');var BPromise=require(_0x59a4('0x2'));var rs=require(_0x59a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x59a4('0x4'));var logger=require(_0x59a4('0x5'))(_0x59a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x59a4('0x7'));var client=jayson[_0x59a4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261dcf,_0x283f3e,_0x593d2f){return new BPromise(function(_0xc86690,_0x1742fd){return client[_0x59a4('0x9')](_0x261dcf,_0x593d2f)[_0x59a4('0xa')](function(_0xed8876){logger[_0x59a4('0xb')](_0x59a4('0xc'),_0x283f3e,_0x59a4('0xd'));logger[_0x59a4('0xe')](_0x59a4('0xf'),_0x283f3e,_0x59a4('0xd'),JSON[_0x59a4('0x10')](_0xed8876));if(_0xed8876[_0x59a4('0x11')]){if(_0xed8876[_0x59a4('0x11')][_0x59a4('0x12')]===0x1f4){logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);return _0x1742fd(_0xed8876['error'][_0x59a4('0x13')]);}logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);return _0xc86690(_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x283f3e,'request\x20sent');_0xc86690(_0xed8876['result'][_0x59a4('0x13')]);}})['catch'](function(_0x2a3ee2){logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0x2a3ee2);_0x1742fd(_0x2a3ee2);});});} \ No newline at end of file +var _0xfb73=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x553a24,_0x6b5c46){var _0x4f9856=function(_0x42a8cc){while(--_0x42a8cc){_0x553a24['push'](_0x553a24['shift']());}};_0x4f9856(++_0x6b5c46);}(_0xfb73,0x1c4));var _0x3fb7=function(_0x366390,_0x16f4b0){_0x366390=_0x366390-0x0;var _0x526701=_0xfb73[_0x366390];return _0x526701;};'use strict';var _=require(_0x3fb7('0x0'));var util=require('util');var moment=require(_0x3fb7('0x1'));var BPromise=require(_0x3fb7('0x2'));var rs=require(_0x3fb7('0x3'));var fs=require('fs');var Redis=require(_0x3fb7('0x4'));var db=require(_0x3fb7('0x5'))['db'];var utils=require(_0x3fb7('0x6'));var logger=require('../../config/logger')(_0x3fb7('0x7'));var config=require(_0x3fb7('0x8'));var jayson=require(_0x3fb7('0x9'));var client=jayson[_0x3fb7('0xa')][_0x3fb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103119,_0x5753c2,_0x38c9d8){return new BPromise(function(_0x5884dd,_0x5f54a5){return client['request'](_0x103119,_0x38c9d8)[_0x3fb7('0xc')](function(_0x1ffc76){logger[_0x3fb7('0xd')](_0x3fb7('0xe'),_0x5753c2,_0x3fb7('0xf'));logger[_0x3fb7('0x10')](_0x3fb7('0x11'),_0x5753c2,'request\x20sent',JSON[_0x3fb7('0x12')](_0x1ffc76));if(_0x1ffc76['error']){if(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x14')]===0x1f4){logger['error'](_0x3fb7('0xe'),_0x5753c2,_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);return _0x5f54a5(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);}logger[_0x3fb7('0x13')](_0x3fb7('0xe'),_0x5753c2,_0x1ffc76['error'][_0x3fb7('0x15')]);return _0x5884dd(_0x1ffc76[_0x3fb7('0x13')][_0x3fb7('0x15')]);}else{logger[_0x3fb7('0xd')](_0x3fb7('0xe'),_0x5753c2,_0x3fb7('0xf'));_0x5884dd(_0x1ffc76[_0x3fb7('0x16')]['message']);}})[_0x3fb7('0x17')](function(_0x46a6f1){logger[_0x3fb7('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5753c2,_0x46a6f1);_0x5f54a5(_0x46a6f1);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 2577906..9016d0d 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 _0x8f71=['util','express','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x8f71,0xed));var _0x18f7=function(_0x46a8c4,_0x312adc){_0x46a8c4=_0x46a8c4-0x0;var _0x16515c=_0x8f71[_0x46a8c4];return _0x16515c;};'use strict';var multer=require(_0x18f7('0x0'));var util=require(_0x18f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x18f7('0x2'));var router=express['Router']();var auth=require(_0x18f7('0x3'));var interaction=require(_0x18f7('0x4'));var config=require('../../config/environment');var controller=require(_0x18f7('0x5'));router[_0x18f7('0x6')]('/',auth[_0x18f7('0x7')](),controller[_0x18f7('0x8')]);router['get']('/:id',auth[_0x18f7('0x7')](),controller[_0x18f7('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x18f7('0xa')]);router[_0x18f7('0xb')](_0x18f7('0xc'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xd')]);router[_0x18f7('0xe')](_0x18f7('0xc'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xf')]);module[_0x18f7('0x10')]=router; \ No newline at end of file +var _0x81a6=['create','put','delete','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post'];(function(_0x15e6f4,_0x52f862){var _0x59f9f2=function(_0x53e1d3){while(--_0x53e1d3){_0x15e6f4['push'](_0x15e6f4['shift']());}};_0x59f9f2(++_0x52f862);}(_0x81a6,0x9a));var _0x681a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x81a6[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x681a('0x0'));var util=require('util');var path=require(_0x681a('0x1'));var timeout=require('connect-timeout');var express=require(_0x681a('0x2'));var router=express[_0x681a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x681a('0x4'));var config=require(_0x681a('0x5'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x681a('0x6')](),controller[_0x681a('0x7')]);router['get'](_0x681a('0x8'),auth[_0x681a('0x6')](),controller[_0x681a('0x9')]);router[_0x681a('0xa')]('/',auth[_0x681a('0x6')](),controller[_0x681a('0xb')]);router[_0x681a('0xc')]('/:id',auth[_0x681a('0x6')](),controller['update']);router[_0x681a('0xd')](_0x681a('0x8'),auth[_0x681a('0x6')](),controller['destroy']);module[_0x681a('0xe')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dc0ec94..181a363 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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x4d8e49,_0x102e48){var _0xb4257b=function(_0x358b03){while(--_0x358b03){_0x4d8e49['push'](_0x4d8e49['shift']());}};_0xb4257b(++_0x102e48);}(_0xb688,0xcf));var _0x8b68=function(_0x5e2cde,_0x20dae0){_0x5e2cde=_0x5e2cde-0x0;var _0x33b759=_0xb688[_0x5e2cde];return _0x33b759;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file +var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x385ed5,_0x449f76){var _0x27f199=function(_0x47d08f){while(--_0x47d08f){_0x385ed5['push'](_0x385ed5['shift']());}};_0x27f199(++_0x449f76);}(_0xb58b,0x1f1));var _0xbb58=function(_0x578a6b,_0xe0d001){_0x578a6b=_0x578a6b-0x0;var _0x10ea80=_0xb58b[_0x578a6b];return _0x10ea80;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 9ca4492..bf90eca 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 _0x2ef3=['count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','ServicenowField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','json'];(function(_0x45408d,_0x38f8b2){var _0x186ae7=function(_0x2c10e8){while(--_0x2c10e8){_0x45408d['push'](_0x45408d['shift']());}};_0x186ae7(++_0x38f8b2);}(_0x2ef3,0xba));var _0x32ef=function(_0x18fe1c,_0xacb736){_0x18fe1c=_0x18fe1c-0x0;var _0x30caf6=_0x2ef3[_0x18fe1c];return _0x30caf6;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x193714,_0x5afcc2){_0x5afcc2=_0x5afcc2||0xcc;return function(_0x1a5106){if(_0x1a5106){return _0x193714['sendStatus'](_0x5afcc2);}return _0x193714[_0x32ef('0x18')](_0x5afcc2)[_0x32ef('0x19')]();};}function respondWithResult(_0x5c3eb9,_0x539d18){_0x539d18=_0x539d18||0xc8;return function(_0x19ce1){if(_0x19ce1){return _0x5c3eb9['status'](_0x539d18)[_0x32ef('0x1a')](_0x19ce1);}};}function respondWithFilteredResult(_0x40a6e6,_0x93d492){return function(_0x54c7f5){if(_0x54c7f5){var _0x57aff1=_0x54c7f5[_0x32ef('0x1b')],_0x55bf0b=_0x93d492[_0x32ef('0x1c')],_0x531e30=_0x93d492['offset']+_0x93d492['limit'],_0x13db1a;if(_0x531e30>=_0x57aff1){_0x531e30=_0x57aff1;_0x13db1a=0xc8;}else{_0x13db1a=0xce;}_0x40a6e6[_0x32ef('0x18')](_0x13db1a);return _0x40a6e6[_0x32ef('0x1d')](_0x32ef('0x1e'),_0x55bf0b+'-'+_0x531e30+'/'+_0x57aff1)['json'](_0x54c7f5);}return null;};}function patchUpdates(_0xbe37f6){return function(_0x33e230){try{jsonpatch['apply'](_0x33e230,_0xbe37f6,!![]);}catch(_0x304505){return BPromise[_0x32ef('0x1f')](_0x304505);}return _0x33e230[_0x32ef('0x20')]();};}function saveUpdates(_0x251084,_0x445cda){return function(_0x3aec05){if(_0x3aec05){return _0x3aec05['update'](_0x251084)[_0x32ef('0x21')](function(_0x5cc3ef){return _0x5cc3ef;});}return null;};}function removeEntity(_0x309866,_0x3a20ca){return function(_0x49f2d8){if(_0x49f2d8){return _0x49f2d8[_0x32ef('0x22')]()[_0x32ef('0x21')](function(){_0x309866[_0x32ef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f5e5,_0x22f2d7){return function(_0xb30fab){if(!_0xb30fab){_0x57f5e5[_0x32ef('0x23')](0x194);}return _0xb30fab;};}function handleError(_0x478bef,_0x59585f){_0x59585f=_0x59585f||0x1f4;return function(_0x19ea6){logger['error'](_0x19ea6['stack']);if(_0x19ea6[_0x32ef('0x24')]){delete _0x19ea6[_0x32ef('0x24')];}_0x478bef[_0x32ef('0x18')](_0x59585f)[_0x32ef('0x25')](_0x19ea6);};}exports[_0x32ef('0x26')]=function(_0x234175,_0x1874ea){var _0x38aed5={},_0x338f19={},_0x2f52d7={'count':0x0,'rows':[]};var _0x1335e2=db[_0x32ef('0x27')]['rawAttributes'];_0x338f19[_0x32ef('0x28')]=_[_0x32ef('0x29')](_0x1335e2);_0x338f19['query']=_[_0x32ef('0x29')](_0x234175[_0x32ef('0x2a')]);_0x338f19[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0x338f19['model'],_0x338f19[_0x32ef('0x2a')]);_0x38aed5[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x338f19[_0x32ef('0x28')],qs[_0x32ef('0x2e')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x2e')]));_0x38aed5['attributes']=_0x38aed5[_0x32ef('0x2d')]['length']?_0x38aed5[_0x32ef('0x2d')]:_0x338f19[_0x32ef('0x28')];if(!_0x234175['query'][_0x32ef('0x2f')](_0x32ef('0x30'))){_0x38aed5[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x234175[_0x32ef('0x2a')]['limit']);_0x38aed5['offset']=qs[_0x32ef('0x1c')](_0x234175['query'][_0x32ef('0x1c')]);}_0x38aed5[_0x32ef('0x32')]=qs[_0x32ef('0x33')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x33')]);_0x38aed5[_0x32ef('0x34')]=qs['filters'](_['pick'](_0x234175['query'],_0x338f19[_0x32ef('0x2b')]));if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]){_0x38aed5['where']=_['merge'](_0x38aed5[_0x32ef('0x34')],{'$or':_[_0x32ef('0x36')](_0x1335e2,function(_0x410334){if(_0x410334['type']['key']!==_0x32ef('0x37')){var _0x21706f={};_0x21706f[_0x410334[_0x32ef('0x38')]]={'$like':'%'+_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]+'%'};return _0x21706f;}})});}_0x38aed5=_[_0x32ef('0x39')]({},_0x38aed5,_0x234175[_0x32ef('0x3a')]);var _0x21da90={'where':_0x38aed5[_0x32ef('0x34')]};return db['ServicenowField'][_0x32ef('0x1b')](_0x21da90)[_0x32ef('0x21')](function(_0x14b54f){_0x2f52d7['count']=_0x14b54f;if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x38aed5[_0x32ef('0x3c')]=[{'all':!![]}];}return db[_0x32ef('0x27')][_0x32ef('0x3d')](_0x38aed5);})[_0x32ef('0x21')](function(_0x256c40){_0x2f52d7[_0x32ef('0x3e')]=_0x256c40;return _0x2f52d7;})[_0x32ef('0x21')](respondWithFilteredResult(_0x1874ea,_0x38aed5))[_0x32ef('0x3f')](handleError(_0x1874ea,null));};exports[_0x32ef('0x40')]=function(_0x4615b4,_0x48e071){var _0x3cac2e={'raw':!![],'where':{'id':_0x4615b4[_0x32ef('0x41')]['id']}},_0xc3a6d3={};_0xc3a6d3[_0x32ef('0x28')]=_[_0x32ef('0x29')](db[_0x32ef('0x27')][_0x32ef('0x42')]);_0xc3a6d3['query']=_['keys'](_0x4615b4[_0x32ef('0x2a')]);_0xc3a6d3[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0xc3a6d3[_0x32ef('0x28')],_0xc3a6d3['query']);_0x3cac2e[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0xc3a6d3['model'],qs[_0x32ef('0x2e')](_0x4615b4['query'][_0x32ef('0x2e')]));_0x3cac2e[_0x32ef('0x2d')]=_0x3cac2e[_0x32ef('0x2d')][_0x32ef('0x43')]?_0x3cac2e[_0x32ef('0x2d')]:_0xc3a6d3[_0x32ef('0x28')];if(_0x4615b4[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x3cac2e[_0x32ef('0x3c')]=[{'all':!![]}];}_0x3cac2e=_[_0x32ef('0x39')]({},_0x3cac2e,_0x4615b4['options']);return db[_0x32ef('0x27')]['find'](_0x3cac2e)[_0x32ef('0x21')](handleEntityNotFound(_0x48e071,null))[_0x32ef('0x21')](respondWithResult(_0x48e071,null))[_0x32ef('0x3f')](handleError(_0x48e071,null));};exports['create']=function(_0x502113,_0x230ac9){return db[_0x32ef('0x27')][_0x32ef('0x44')](_0x502113[_0x32ef('0x45')],{})[_0x32ef('0x21')](respondWithResult(_0x230ac9,0xc9))[_0x32ef('0x3f')](handleError(_0x230ac9,null));};exports['update']=function(_0x5cb6fc,_0x36252c){if(_0x5cb6fc[_0x32ef('0x45')]['id']){delete _0x5cb6fc[_0x32ef('0x45')]['id'];}return db[_0x32ef('0x27')][_0x32ef('0x46')]({'where':{'id':_0x5cb6fc[_0x32ef('0x41')]['id']}})[_0x32ef('0x21')](handleEntityNotFound(_0x36252c,null))[_0x32ef('0x21')](saveUpdates(_0x5cb6fc[_0x32ef('0x45')],null))[_0x32ef('0x21')](respondWithResult(_0x36252c,null))[_0x32ef('0x3f')](handleError(_0x36252c,null));};exports[_0x32ef('0x22')]=function(_0x36a65c,_0x4c2534){return db[_0x32ef('0x27')][_0x32ef('0x46')]({'where':{'id':_0x36a65c[_0x32ef('0x41')]['id']}})[_0x32ef('0x21')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x21')](removeEntity(_0x4c2534,null))[_0x32ef('0x3f')](handleError(_0x4c2534,null));}; \ No newline at end of file +var _0x4975=['jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','field','merge','options','ServicenowField','includeAll','include','rows','catch','show','params','rawAttributes','fields','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x3f2e3d,_0x3acada){_0x3f2e3d=_0x3f2e3d-0x0;var _0x75beb7=_0x4975[_0x3f2e3d];return _0x75beb7;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require(_0x5497('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b1162,_0xc250bb){_0xc250bb=_0xc250bb||0xcc;return function(_0x1b23df){if(_0x1b23df){return _0x5b1162[_0x5497('0x18')](_0xc250bb);}return _0x5b1162[_0x5497('0x19')](_0xc250bb)[_0x5497('0x1a')]();};}function respondWithResult(_0x365144,_0x1f7169){_0x1f7169=_0x1f7169||0xc8;return function(_0xaca97d){if(_0xaca97d){return _0x365144[_0x5497('0x19')](_0x1f7169)[_0x5497('0x1b')](_0xaca97d);}};}function respondWithFilteredResult(_0x55f590,_0x11b0a9){return function(_0x4fb8e9){if(_0x4fb8e9){var _0x4237a9=_0x4fb8e9[_0x5497('0x1c')],_0x2bfd8a=_0x11b0a9[_0x5497('0x1d')],_0x19e5f3=_0x11b0a9[_0x5497('0x1d')]+_0x11b0a9['limit'],_0x3ce50b;if(_0x19e5f3>=_0x4237a9){_0x19e5f3=_0x4237a9;_0x3ce50b=0xc8;}else{_0x3ce50b=0xce;}_0x55f590['status'](_0x3ce50b);return _0x55f590[_0x5497('0x1e')](_0x5497('0x1f'),_0x2bfd8a+'-'+_0x19e5f3+'/'+_0x4237a9)[_0x5497('0x1b')](_0x4fb8e9);}return null;};}function patchUpdates(_0x5d9e24){return function(_0xbf1ba7){try{jsonpatch[_0x5497('0x20')](_0xbf1ba7,_0x5d9e24,!![]);}catch(_0x18e8a8){return BPromise[_0x5497('0x21')](_0x18e8a8);}return _0xbf1ba7[_0x5497('0x22')]();};}function saveUpdates(_0x1f6f18,_0x16d378){return function(_0x10226f){if(_0x10226f){return _0x10226f[_0x5497('0x23')](_0x1f6f18)[_0x5497('0x24')](function(_0x186065){return _0x186065;});}return null;};}function removeEntity(_0x52c049,_0x720767){return function(_0x4d1b27){if(_0x4d1b27){return _0x4d1b27[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x52c049[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x35ecd9,_0x3b2fbc){return function(_0x5018fa){if(!_0x5018fa){_0x35ecd9['sendStatus'](0x194);}return _0x5018fa;};}function handleError(_0x1eefce,_0x34b97f){_0x34b97f=_0x34b97f||0x1f4;return function(_0x24482a){logger[_0x5497('0x26')](_0x24482a['stack']);if(_0x24482a[_0x5497('0x27')]){delete _0x24482a['name'];}_0x1eefce[_0x5497('0x19')](_0x34b97f)[_0x5497('0x28')](_0x24482a);};}exports[_0x5497('0x29')]=function(_0x34a1a5,_0x163a30){var _0x31cd01={},_0x48b835={},_0x4af5f4={'count':0x0,'rows':[]};var _0x5406e2=db['ServicenowField']['rawAttributes'];_0x48b835[_0x5497('0x2a')]=_['keys'](_0x5406e2);_0x48b835['query']=_[_0x5497('0x2b')](_0x34a1a5[_0x5497('0x2c')]);_0x48b835[_0x5497('0x2d')]=_['intersection'](_0x48b835['model'],_0x48b835['query']);_0x31cd01[_0x5497('0x2e')]=_[_0x5497('0x2f')](_0x48b835[_0x5497('0x2a')],qs['fields'](_0x34a1a5['query']['fields']));_0x31cd01[_0x5497('0x2e')]=_0x31cd01['attributes'][_0x5497('0x30')]?_0x31cd01[_0x5497('0x2e')]:_0x48b835[_0x5497('0x2a')];if(!_0x34a1a5['query'][_0x5497('0x31')](_0x5497('0x32'))){_0x31cd01['limit']=qs[_0x5497('0x33')](_0x34a1a5[_0x5497('0x2c')][_0x5497('0x33')]);_0x31cd01['offset']=qs[_0x5497('0x1d')](_0x34a1a5[_0x5497('0x2c')][_0x5497('0x1d')]);}_0x31cd01[_0x5497('0x34')]=qs[_0x5497('0x35')](_0x34a1a5['query'][_0x5497('0x35')]);_0x31cd01[_0x5497('0x36')]=qs['filters'](_[_0x5497('0x37')](_0x34a1a5[_0x5497('0x2c')],_0x48b835[_0x5497('0x2d')]));if(_0x34a1a5[_0x5497('0x2c')][_0x5497('0x38')]){_0x31cd01[_0x5497('0x36')]=_['merge'](_0x31cd01[_0x5497('0x36')],{'$or':_['map'](_0x5406e2,function(_0x7880e4){if(_0x7880e4[_0x5497('0x39')][_0x5497('0x3a')]!=='VIRTUAL'){var _0x4ec5f7={};_0x4ec5f7[_0x7880e4[_0x5497('0x3b')]]={'$like':'%'+_0x34a1a5[_0x5497('0x2c')][_0x5497('0x38')]+'%'};return _0x4ec5f7;}})});}_0x31cd01=_[_0x5497('0x3c')]({},_0x31cd01,_0x34a1a5[_0x5497('0x3d')]);var _0xc8a689={'where':_0x31cd01['where']};return db[_0x5497('0x3e')][_0x5497('0x1c')](_0xc8a689)[_0x5497('0x24')](function(_0x2bd07a){_0x4af5f4[_0x5497('0x1c')]=_0x2bd07a;if(_0x34a1a5[_0x5497('0x2c')][_0x5497('0x3f')]){_0x31cd01[_0x5497('0x40')]=[{'all':!![]}];}return db[_0x5497('0x3e')]['findAll'](_0x31cd01);})[_0x5497('0x24')](function(_0x32fa2b){_0x4af5f4[_0x5497('0x41')]=_0x32fa2b;return _0x4af5f4;})[_0x5497('0x24')](respondWithFilteredResult(_0x163a30,_0x31cd01))[_0x5497('0x42')](handleError(_0x163a30,null));};exports[_0x5497('0x43')]=function(_0x4299be,_0x59ed13){var _0x3e5f7d={'raw':!![],'where':{'id':_0x4299be[_0x5497('0x44')]['id']}},_0x95d7d6={};_0x95d7d6[_0x5497('0x2a')]=_[_0x5497('0x2b')](db[_0x5497('0x3e')][_0x5497('0x45')]);_0x95d7d6['query']=_[_0x5497('0x2b')](_0x4299be[_0x5497('0x2c')]);_0x95d7d6[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0x95d7d6[_0x5497('0x2a')],_0x95d7d6[_0x5497('0x2c')]);_0x3e5f7d[_0x5497('0x2e')]=_[_0x5497('0x2f')](_0x95d7d6[_0x5497('0x2a')],qs[_0x5497('0x46')](_0x4299be['query'][_0x5497('0x46')]));_0x3e5f7d['attributes']=_0x3e5f7d[_0x5497('0x2e')][_0x5497('0x30')]?_0x3e5f7d[_0x5497('0x2e')]:_0x95d7d6[_0x5497('0x2a')];if(_0x4299be[_0x5497('0x2c')]['includeAll']){_0x3e5f7d[_0x5497('0x40')]=[{'all':!![]}];}_0x3e5f7d=_[_0x5497('0x3c')]({},_0x3e5f7d,_0x4299be['options']);return db[_0x5497('0x3e')]['find'](_0x3e5f7d)[_0x5497('0x24')](handleEntityNotFound(_0x59ed13,null))['then'](respondWithResult(_0x59ed13,null))[_0x5497('0x42')](handleError(_0x59ed13,null));};exports[_0x5497('0x47')]=function(_0x2e8c6a,_0x3a852a){return db[_0x5497('0x3e')]['create'](_0x2e8c6a['body'],{})['then'](respondWithResult(_0x3a852a,0xc9))['catch'](handleError(_0x3a852a,null));};exports[_0x5497('0x23')]=function(_0x43c430,_0x417f31){if(_0x43c430[_0x5497('0x48')]['id']){delete _0x43c430[_0x5497('0x48')]['id'];}return db[_0x5497('0x3e')][_0x5497('0x49')]({'where':{'id':_0x43c430[_0x5497('0x44')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x417f31,null))['then'](saveUpdates(_0x43c430[_0x5497('0x48')],null))[_0x5497('0x24')](respondWithResult(_0x417f31,null))[_0x5497('0x42')](handleError(_0x417f31,null));};exports['destroy']=function(_0x3e4da2,_0x530475){return db[_0x5497('0x3e')][_0x5497('0x49')]({'where':{'id':_0x3e4da2[_0x5497('0x44')]['id']}})['then'](handleEntityNotFound(_0x530475,null))[_0x5497('0x24')](removeEntity(_0x530475,null))[_0x5497('0x42')](handleError(_0x530475,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 8fa0d59..9e03d97 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 _0x1504=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x35cee0,_0x46d552){var _0x77812d=function(_0x581a85){while(--_0x581a85){_0x35cee0['push'](_0x35cee0['shift']());}};_0x77812d(++_0x46d552);}(_0x1504,0x1d6));var _0x4150=function(_0x450875,_0x1ba5aa){_0x450875=_0x450875-0x0;var _0x284b8f=_0x1504[_0x450875];return _0x284b8f;};'use strict';var _=require(_0x4150('0x0'));var util=require(_0x4150('0x1'));var logger=require(_0x4150('0x2'))(_0x4150('0x3'));var moment=require(_0x4150('0x4'));var BPromise=require('bluebird');var rp=require(_0x4150('0x5'));var fs=require('fs');var path=require(_0x4150('0x6'));var rimraf=require(_0x4150('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x4150('0x8')]=function(_0x5782f5,_0x5c8d81){return _0x5782f5[_0x4150('0x9')](_0x4150('0xa'),attributes,{'tableName':_0x4150('0xb'),'paranoid':![],'indexes':[{'name':_0x4150('0xc'),'fields':[_0x4150('0xd'),_0x4150('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11b2=['moment','bluebird','request-promise','path','../../config/environment','./intServicenowField.attributes','define','idField','lodash','util','../../config/logger','api'];(function(_0x5b3ede,_0x749e34){var _0x51814d=function(_0x3821b9){while(--_0x3821b9){_0x5b3ede['push'](_0x5b3ede['shift']());}};_0x51814d(++_0x749e34);}(_0x11b2,0x170));var _0x211b=function(_0x5f26a8,_0x5b9294){_0x5f26a8=_0x5f26a8-0x0;var _0x5c37eb=_0x11b2[_0x5f26a8];return _0x5c37eb;};'use strict';var _=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var logger=require(_0x211b('0x2'))(_0x211b('0x3'));var moment=require(_0x211b('0x4'));var BPromise=require(_0x211b('0x5'));var rp=require(_0x211b('0x6'));var fs=require('fs');var path=require(_0x211b('0x7'));var rimraf=require('rimraf');var config=require(_0x211b('0x8'));var attributes=require(_0x211b('0x9'));module['exports']=function(_0x3e2270,_0x368043){return _0x3e2270[_0x211b('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x211b('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 837d23e..958e421 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 _0x8ace=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x486d60,_0x1f1cb7){var _0x4b81fb=function(_0x4d5680){while(--_0x4d5680){_0x486d60['push'](_0x486d60['shift']());}};_0x4b81fb(++_0x1f1cb7);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x332edd,_0x30528b){_0x332edd=_0x332edd-0x0;var _0x310417=_0x8ace[_0x332edd];return _0x310417;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('ServicenowField,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});} \ No newline at end of file +var _0x6343=['message','result','catch','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x5b7237,_0x165af2){var _0x868337=function(_0x310c23){while(--_0x310c23){_0x5b7237['push'](_0x5b7237['shift']());}};_0x868337(++_0x165af2);}(_0x6343,0x168));var _0x3634=function(_0x1483e7,_0x10ab97){_0x1483e7=_0x1483e7-0x0;var _0x3267ea=_0x6343[_0x1483e7];return _0x3267ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));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(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('ServicenowField,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 7789ffc..3f2dcd9 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 _0x0c1c=['/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x0c1c,0x183));var _0xc0c1=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x0c1c[_0x28b7ab];return _0x56791b;};'use strict';var multer=require(_0xc0c1('0x0'));var util=require(_0xc0c1('0x1'));var path=require(_0xc0c1('0x2'));var timeout=require(_0xc0c1('0x3'));var express=require(_0xc0c1('0x4'));var router=express['Router']();var auth=require(_0xc0c1('0x5'));var interaction=require(_0xc0c1('0x6'));var config=require('../../config/environment');var controller=require(_0xc0c1('0x7'));router[_0xc0c1('0x8')]('/',auth[_0xc0c1('0x9')](),controller['index']);router[_0xc0c1('0x8')](_0xc0c1('0xa'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xb')]);router['get'](_0xc0c1('0xc'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xd')]);router[_0xc0c1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc0c1('0xe')]('/',auth[_0xc0c1('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xf')]);router['put']('/:id',auth[_0xc0c1('0x9')](),controller[_0xc0c1('0x10')]);router[_0xc0c1('0x11')](_0xc0c1('0xa'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x04e6=['/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x3dc070,_0x8bc4eb){var _0x1040dd=function(_0x20d422){while(--_0x20d422){_0x3dc070['push'](_0x3dc070['shift']());}};_0x1040dd(++_0x8bc4eb);}(_0x04e6,0xea));var _0x604e=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x04e6[_0x4d82ea];return _0x257f4a;};'use strict';var multer=require(_0x604e('0x0'));var util=require(_0x604e('0x1'));var path=require(_0x604e('0x2'));var timeout=require(_0x604e('0x3'));var express=require(_0x604e('0x4'));var router=express[_0x604e('0x5')]();var auth=require(_0x604e('0x6'));var interaction=require(_0x604e('0x7'));var config=require(_0x604e('0x8'));var controller=require(_0x604e('0x9'));router[_0x604e('0xa')]('/',auth[_0x604e('0xb')](),controller['index']);router[_0x604e('0xa')](_0x604e('0xc'),auth[_0x604e('0xb')](),controller[_0x604e('0xd')]);router[_0x604e('0xa')](_0x604e('0xe'),auth[_0x604e('0xb')](),controller[_0x604e('0xf')]);router[_0x604e('0xa')](_0x604e('0x10'),auth[_0x604e('0xb')](),controller[_0x604e('0x11')]);router[_0x604e('0x12')]('/',auth[_0x604e('0xb')](),controller[_0x604e('0x13')]);router[_0x604e('0x12')](_0x604e('0xe'),auth[_0x604e('0xb')](),controller[_0x604e('0x14')]);router[_0x604e('0x15')]('/:id',auth[_0x604e('0xb')](),controller['update']);router[_0x604e('0x16')](_0x604e('0xc'),auth[_0x604e('0xb')](),controller[_0x604e('0x17')]);module[_0x604e('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 790237e..a245598 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 _0x9883=['remoteUri','exports','STRING'];(function(_0x3f2fa5,_0x434388){var _0xe7fb00=function(_0x25c03){while(--_0x25c03){_0x3f2fa5['push'](_0x3f2fa5['shift']());}};_0xe7fb00(++_0x434388);}(_0x9883,0x151));var _0x3988=function(_0x5562fc,_0x70905b){_0x5562fc=_0x5562fc-0x0;var _0x5efd05=_0x9883[_0x5562fc];return _0x5efd05;};'use strict';var Sequelize=require('sequelize');module[_0x3988('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3988('0x1')]},'username':{'type':Sequelize[_0x3988('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x3988('0x1')]},'remoteUri':{'type':Sequelize[_0x3988('0x1')],'unique':_0x3988('0x2')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2285=['STRING','remoteUri','exports'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x2285,0x80));var _0x5228=function(_0x5a34e5,_0x2aa9e9){_0x5a34e5=_0x5a34e5-0x0;var _0x3f98a5=_0x2285[_0x5a34e5];return _0x3f98a5;};'use strict';var Sequelize=require('sequelize');module[_0x5228('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5228('0x1')]},'username':{'type':Sequelize[_0x5228('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x5228('0x1')]},'remoteUri':{'type':Sequelize[_0x5228('0x1')],'unique':_0x5228('0x2')},'serverUrl':{'type':Sequelize[_0x5228('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 3e5612b..4f0f747 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 _0x3c7b=['map','type','key','VIRTUAL','options','include','SugarcrmAccount','rows','params','rawAttributes','find','create','body','getConfigurations','SugarcrmConfiguration','order','nolimit','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','direction','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','value','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','update','destroy','stack','name','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','filter','where','merge'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x361be3,_0x53e660){_0x361be3=_0x361be3-0x0;var _0x256904=_0x3c7b[_0x361be3];return _0x256904;};'use strict';var pdf=require(_0xb3c7('0x0'));var emlformat=require(_0xb3c7('0x1'));var rimraf=require(_0xb3c7('0x2'));var zipdir=require(_0xb3c7('0x3'));var jsonpatch=require(_0xb3c7('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb3c7('0x5'));var path=require(_0xb3c7('0x6'));var sox=require('sox');var csv=require(_0xb3c7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb3c7('0x8'));var squel=require(_0xb3c7('0x9'));var crypto=require(_0xb3c7('0xa'));var jsforce=require(_0xb3c7('0xb'));var deskjs=require(_0xb3c7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb3c7('0xd'));var Papa=require('papaparse');var Redis=require(_0xb3c7('0xe'));var authService=require(_0xb3c7('0xf'));var qs=require(_0xb3c7('0x10'));var hardwareService=require(_0xb3c7('0x11'));var logger=require('../../config/logger')(_0xb3c7('0x12'));var utils=require(_0xb3c7('0x13'));var config=require('../../config/environment');var db=require(_0xb3c7('0x14'))['db'];var integrations=require(_0xb3c7('0x15'));var jayson=require(_0xb3c7('0x16'));var client=jayson[_0xb3c7('0x17')][_0xb3c7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x10def5,_0xc30bf9,_0x48317f){if(_0x48317f){var _0x382743=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x382743[_0xb3c7('0x19')](_0xc30bf9)){return _0x10def5;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x10def5;}}function respondWithRpcPromise(_0x1d9860,_0x1beab1,_0x746d75,_0x2a24c7){return new BPromise(function(_0x370eae,_0x26e5c9){var _0x9a2b03=_0x2a24c7||client;return _0x9a2b03[_0xb3c7('0x1a')](_0x1d9860,_0x746d75)[_0xb3c7('0x1b')](function(_0x10f8d4){logger[_0xb3c7('0x1c')](_0xb3c7('0x1d'),_0x1beab1,'request\x20sent');logger['debug'](_0xb3c7('0x1e'),_0x1beab1,_0xb3c7('0x1f'),JSON[_0xb3c7('0x20')](_0x10f8d4));if(_0x10f8d4[_0xb3c7('0x21')]){if(_0x10f8d4[_0xb3c7('0x21')]['code']===0x1f4){logger[_0xb3c7('0x21')](_0xb3c7('0x1d'),_0x1beab1,_0x10f8d4[_0xb3c7('0x21')][_0xb3c7('0x22')]);return _0x26e5c9(_0x10f8d4['error']['message']);}logger[_0xb3c7('0x21')](_0xb3c7('0x1d'),_0x1beab1,_0x10f8d4['error'][_0xb3c7('0x22')]);return _0x370eae(_0x10f8d4[_0xb3c7('0x21')][_0xb3c7('0x22')]);}else{logger[_0xb3c7('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x1beab1,'request\x20sent');_0x370eae(_0x10f8d4[_0xb3c7('0x23')][_0xb3c7('0x22')]);}})[_0xb3c7('0x24')](function(_0x1348a6){logger[_0xb3c7('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x1beab1,_0x1348a6);_0x26e5c9(_0x1348a6);});});}function respondWithStatusCode(_0x3a46bd,_0x13d5ad){_0x13d5ad=_0x13d5ad||0xcc;return function(_0x21a2de){if(_0x21a2de){return _0x3a46bd[_0xb3c7('0x25')](_0x13d5ad);}return _0x3a46bd['status'](_0x13d5ad)[_0xb3c7('0x26')]();};}function respondWithResult(_0x1bde63,_0x191cc6){_0x191cc6=_0x191cc6||0xc8;return function(_0x593cf6){if(_0x593cf6){return _0x1bde63[_0xb3c7('0x27')](_0x191cc6)[_0xb3c7('0x28')](_0x593cf6);}};}function respondWithFilteredResult(_0xedb5e,_0x6fa822){return function(_0x29c707){if(_0x29c707){var _0x51e0a5=_0x29c707[_0xb3c7('0x29')],_0x42a817=_0x6fa822[_0xb3c7('0x2a')],_0x394568=_0x6fa822[_0xb3c7('0x2a')]+_0x6fa822[_0xb3c7('0x2b')],_0x1f51c4;if(_0x394568>=_0x51e0a5){_0x394568=_0x51e0a5;_0x1f51c4=0xc8;}else{_0x1f51c4=0xce;}_0xedb5e[_0xb3c7('0x27')](_0x1f51c4);return _0xedb5e[_0xb3c7('0x2c')]('Content-Range',_0x42a817+'-'+_0x394568+'/'+_0x51e0a5)[_0xb3c7('0x28')](_0x29c707);}return null;};}function patchUpdates(_0x685eb5){return function(_0x44ef69){try{jsonpatch['apply'](_0x44ef69,_0x685eb5,!![]);}catch(_0x2c67a9){return BPromise['reject'](_0x2c67a9);}return _0x44ef69['save']();};}function saveUpdates(_0x4a80c4,_0x18c2cd){return function(_0x35e80e){if(_0x35e80e){return _0x35e80e[_0xb3c7('0x2d')](_0x4a80c4)[_0xb3c7('0x1b')](function(_0x52e418){return _0x52e418;});}return null;};}function removeEntity(_0x511ff9,_0x3f82c6){return function(_0x1aba77){if(_0x1aba77){return _0x1aba77[_0xb3c7('0x2e')]()['then'](function(){_0x511ff9['status'](0xcc)[_0xb3c7('0x26')]();});}};}function handleEntityNotFound(_0x4ce7f9,_0x46d221){return function(_0x15680a){if(!_0x15680a){_0x4ce7f9[_0xb3c7('0x25')](0x194);}return _0x15680a;};}function handleError(_0x1267e0,_0x40efdc){_0x40efdc=_0x40efdc||0x1f4;return function(_0x4d7b3e){logger[_0xb3c7('0x21')](_0x4d7b3e[_0xb3c7('0x2f')]);if(_0x4d7b3e[_0xb3c7('0x30')]){delete _0x4d7b3e[_0xb3c7('0x30')];}_0x1267e0[_0xb3c7('0x27')](_0x40efdc)['send'](_0x4d7b3e);};}exports[_0xb3c7('0x31')]=function(_0x1044b2,_0x346dcc){var _0x4668bd={},_0x2935aa={},_0x3ed478={'count':0x0,'rows':[]};var _0x371feb=db['SugarcrmAccount']['rawAttributes'];_0x2935aa[_0xb3c7('0x32')]=_[_0xb3c7('0x33')](_0x371feb);_0x2935aa[_0xb3c7('0x34')]=_[_0xb3c7('0x33')](_0x1044b2[_0xb3c7('0x34')]);_0x2935aa[_0xb3c7('0x35')]=_['intersection'](_0x2935aa[_0xb3c7('0x32')],_0x2935aa[_0xb3c7('0x34')]);_0x4668bd[_0xb3c7('0x36')]=_[_0xb3c7('0x37')](_0x2935aa[_0xb3c7('0x32')],qs[_0xb3c7('0x38')](_0x1044b2[_0xb3c7('0x34')]['fields']));_0x4668bd[_0xb3c7('0x36')]=_0x4668bd['attributes'][_0xb3c7('0x39')]?_0x4668bd[_0xb3c7('0x36')]:_0x2935aa[_0xb3c7('0x32')];if(!_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3a')]('nolimit')){_0x4668bd[_0xb3c7('0x2b')]=qs[_0xb3c7('0x2b')](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x2b')]);_0x4668bd[_0xb3c7('0x2a')]=qs[_0xb3c7('0x2a')](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x2a')]);}_0x4668bd['order']=qs['sort'](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3b')]);_0x4668bd['where']=qs[_0xb3c7('0x35')](_['pick'](_0x1044b2[_0xb3c7('0x34')],_0x2935aa[_0xb3c7('0x35')]));if(_0x1044b2['query'][_0xb3c7('0x3c')]){_0x4668bd[_0xb3c7('0x3d')]=_[_0xb3c7('0x3e')](_0x4668bd['where'],{'$or':_[_0xb3c7('0x3f')](_0x371feb,function(_0x2406ba){if(_0x2406ba[_0xb3c7('0x40')][_0xb3c7('0x41')]!==_0xb3c7('0x42')){var _0x3d97a4={};_0x3d97a4[_0x2406ba['field']]={'$like':'%'+_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3c')]+'%'};return _0x3d97a4;}})});}_0x4668bd=_['merge']({},_0x4668bd,_0x1044b2[_0xb3c7('0x43')]);var _0x1a6025={'where':_0x4668bd[_0xb3c7('0x3d')]};return db['SugarcrmAccount'][_0xb3c7('0x29')](_0x1a6025)[_0xb3c7('0x1b')](function(_0x464bd1){_0x3ed478[_0xb3c7('0x29')]=_0x464bd1;if(_0x1044b2[_0xb3c7('0x34')]['includeAll']){_0x4668bd[_0xb3c7('0x44')]=[{'all':!![]}];}return db[_0xb3c7('0x45')]['findAll'](_0x4668bd);})['then'](function(_0x4c0f6c){_0x3ed478[_0xb3c7('0x46')]=_0x4c0f6c;return _0x3ed478;})['then'](respondWithFilteredResult(_0x346dcc,_0x4668bd))[_0xb3c7('0x24')](handleError(_0x346dcc,null));};exports['show']=function(_0x5d4da0,_0x1c7c54){var _0x2c6f2b={'raw':![],'where':{'id':_0x5d4da0[_0xb3c7('0x47')]['id']}},_0x1b4d20={};_0x1b4d20[_0xb3c7('0x32')]=_['keys'](db['SugarcrmAccount'][_0xb3c7('0x48')]);_0x1b4d20[_0xb3c7('0x34')]=_[_0xb3c7('0x33')](_0x5d4da0[_0xb3c7('0x34')]);_0x1b4d20[_0xb3c7('0x35')]=_[_0xb3c7('0x37')](_0x1b4d20[_0xb3c7('0x32')],_0x1b4d20['query']);_0x2c6f2b['attributes']=_[_0xb3c7('0x37')](_0x1b4d20['model'],qs[_0xb3c7('0x38')](_0x5d4da0['query']['fields']));_0x2c6f2b[_0xb3c7('0x36')]=_0x2c6f2b[_0xb3c7('0x36')][_0xb3c7('0x39')]?_0x2c6f2b['attributes']:_0x1b4d20['model'];if(_0x5d4da0[_0xb3c7('0x34')]['includeAll']){_0x2c6f2b['include']=[{'all':!![]}];}_0x2c6f2b=_[_0xb3c7('0x3e')]({},_0x2c6f2b,_0x5d4da0[_0xb3c7('0x43')]);return db[_0xb3c7('0x45')][_0xb3c7('0x49')](_0x2c6f2b)[_0xb3c7('0x1b')](handleEntityNotFound(_0x1c7c54,null))[_0xb3c7('0x1b')](respondWithResult(_0x1c7c54,null))[_0xb3c7('0x24')](handleError(_0x1c7c54,null));};exports[_0xb3c7('0x4a')]=function(_0x3ef029,_0x4e9722){return db[_0xb3c7('0x45')][_0xb3c7('0x4a')](_0x3ef029[_0xb3c7('0x4b')],{})[_0xb3c7('0x1b')](respondWithResult(_0x4e9722,0xc9))[_0xb3c7('0x24')](handleError(_0x4e9722,null));};exports[_0xb3c7('0x2d')]=function(_0x5e00de,_0x9f27cf){if(_0x5e00de[_0xb3c7('0x4b')]['id']){delete _0x5e00de['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x5e00de[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x9f27cf,null))[_0xb3c7('0x1b')](saveUpdates(_0x5e00de[_0xb3c7('0x4b')],null))[_0xb3c7('0x1b')](respondWithResult(_0x9f27cf,null))[_0xb3c7('0x24')](handleError(_0x9f27cf,null));};exports[_0xb3c7('0x2e')]=function(_0x390bb9,_0x251af2){return db[_0xb3c7('0x45')][_0xb3c7('0x49')]({'where':{'id':_0x390bb9[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x251af2,null))[_0xb3c7('0x1b')](removeEntity(_0x251af2,null))['catch'](handleError(_0x251af2,null));};exports[_0xb3c7('0x4c')]=function(_0x8244df,_0x3402ef,_0x4f4efd){var _0x9c4423={};var _0x1c3001={};var _0x122b84;var _0x2fc8ed;return db[_0xb3c7('0x45')]['findOne']({'where':{'id':_0x8244df[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x3402ef,null))[_0xb3c7('0x1b')](function(_0x3a49c6){if(_0x3a49c6){_0x122b84=_0x3a49c6;_0x1c3001[_0xb3c7('0x32')]=_['keys'](db[_0xb3c7('0x4d')][_0xb3c7('0x48')]);_0x1c3001[_0xb3c7('0x34')]=_['keys'](_0x8244df[_0xb3c7('0x34')]);_0x1c3001[_0xb3c7('0x35')]=_[_0xb3c7('0x37')](_0x1c3001[_0xb3c7('0x32')],_0x1c3001[_0xb3c7('0x34')]);_0x9c4423['attributes']=_[_0xb3c7('0x37')](_0x1c3001[_0xb3c7('0x32')],qs[_0xb3c7('0x38')](_0x8244df['query'][_0xb3c7('0x38')]));_0x9c4423[_0xb3c7('0x36')]=_0x9c4423['attributes']['length']?_0x9c4423[_0xb3c7('0x36')]:_0x1c3001[_0xb3c7('0x32')];_0x9c4423[_0xb3c7('0x4e')]=qs[_0xb3c7('0x3b')](_0x8244df[_0xb3c7('0x34')]['sort']);_0x9c4423[_0xb3c7('0x3d')]=qs['filters'](_['pick'](_0x8244df[_0xb3c7('0x34')],_0x1c3001[_0xb3c7('0x35')]));if(_0x8244df['query'][_0xb3c7('0x3c')]){_0x9c4423[_0xb3c7('0x3d')]=_['merge'](_0x9c4423[_0xb3c7('0x3d')],{'$or':_[_0xb3c7('0x3f')](_0x9c4423[_0xb3c7('0x36')],function(_0x166b99){var _0x180564={};_0x180564[_0x166b99]={'$like':'%'+_0x8244df['query'][_0xb3c7('0x3c')]+'%'};return _0x180564;})});}_0x9c4423=_[_0xb3c7('0x3e')]({},_0x9c4423,_0x8244df['options']);return _0x122b84[_0xb3c7('0x4c')](_0x9c4423);}})[_0xb3c7('0x1b')](function(_0x42c10e){if(_0x42c10e){_0x2fc8ed=_0x42c10e[_0xb3c7('0x39')];if(!_0x8244df[_0xb3c7('0x34')]['hasOwnProperty'](_0xb3c7('0x4f'))){_0x9c4423[_0xb3c7('0x2b')]=qs['limit'](_0x8244df[_0xb3c7('0x34')][_0xb3c7('0x2b')]);_0x9c4423[_0xb3c7('0x2a')]=qs[_0xb3c7('0x2a')](_0x8244df[_0xb3c7('0x34')][_0xb3c7('0x2a')]);}return _0x122b84['getConfigurations'](_0x9c4423);}})[_0xb3c7('0x1b')](function(_0x172b8f){if(_0x172b8f){return _0x172b8f?{'count':_0x2fc8ed,'rows':_0x172b8f}:null;}})[_0xb3c7('0x1b')](respondWithResult(_0x3402ef,null))[_0xb3c7('0x24')](handleError(_0x3402ef,null));};exports['addConfiguration']=function(_0x47c59c,_0x416c67,_0x1f9568){if(_0x47c59c['body']['id']){delete _0x47c59c[_0xb3c7('0x4b')]['id'];}return db['SugarcrmAccount'][_0xb3c7('0x50')]({'where':{'id':_0x47c59c[_0xb3c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x416c67,null))[_0xb3c7('0x1b')](function(_0x414a03){if(_0x414a03){_0x47c59c[_0xb3c7('0x4b')][_0xb3c7('0x51')]=_0x414a03['id'];_0x47c59c[_0xb3c7('0x4b')]['Subjects']=integrations[_0xb3c7('0x52')](_0x47c59c['body']['channel'],_0x47c59c['body'][_0xb3c7('0x40')]);_0x47c59c['body'][_0xb3c7('0x53')]=integrations[_0xb3c7('0x54')](_0x47c59c['body'][_0xb3c7('0x55')],_0x47c59c[_0xb3c7('0x4b')][_0xb3c7('0x40')]);return db[_0xb3c7('0x4d')][_0xb3c7('0x4a')](_0x47c59c[_0xb3c7('0x4b')],{'include':[{'model':db[_0xb3c7('0x56')],'as':'Subjects'},{'model':db[_0xb3c7('0x56')],'as':_0xb3c7('0x53')}]});}return null;})['then'](respondWithResult(_0x416c67,null))[_0xb3c7('0x24')](handleError(_0x416c67,null));};exports[_0xb3c7('0x57')]=function(_0xbf2d7a,_0x632b20,_0x4df5a1){var _0x19655e='';var _0x2116c5=['id',_0xb3c7('0x30'),_0xb3c7('0x58'),_0xb3c7('0x59'),'description',_0xb3c7('0x5a'),_0xb3c7('0x5b'),_0xb3c7('0x5c'),_0xb3c7('0x5d'),'parent_type','parent_name',_0xb3c7('0x5e')];return db[_0xb3c7('0x45')][_0xb3c7('0x50')]({'where':{'id':_0xbf2d7a['params']['id']},'attributes':['id','username','password',_0xb3c7('0x5f')]})[_0xb3c7('0x1b')](handleEntityNotFound(_0x632b20,null))[_0xb3c7('0x1b')](function(_0x1524be){if(_0x1524be){_0x19655e=_0x1524be[_0xb3c7('0x5f')];var _0x2cf7d7=_0x19655e['slice'](-0x1);if(_0x2cf7d7==='/'){_0x19655e=_0x19655e[_0xb3c7('0x60')](0x0,_0x19655e[_0xb3c7('0x61')](_0x2cf7d7));}return rp({'method':_0xb3c7('0x62'),'uri':util[_0xb3c7('0x63')](_0xb3c7('0x64'),_0x19655e,_0xb3c7('0x65')),'json':!![],'form':{'method':_0xb3c7('0x66'),'input_type':_0xb3c7('0x67'),'response_type':_0xb3c7('0x67'),'rest_data':JSON[_0xb3c7('0x20')]({'user_auth':{'user_name':_0x1524be[_0xb3c7('0x68')],'password':_0x1524be['password'],'encryption':_0xb3c7('0x69')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xb3c7('0x1b')](function(_0x34f020){if(_0x34f020&&_0x34f020[_0xb3c7('0x30')]!=='Invalid\x20Login'&&_0x34f020['name']!==_0xb3c7('0x6a')){return rp({'method':'POST','uri':util['format'](_0xb3c7('0x64'),_0x19655e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb3c7('0x6b'),'input_type':'JSON','response_type':_0xb3c7('0x67'),'rest_data':JSON[_0xb3c7('0x20')]({'session':_0x34f020['id'],'module_name':_0xb3c7('0x6c')})}})[_0xb3c7('0x1b')](function(_0x1d6774){if(_0x1d6774){var _0x2ce8b7=_[_0xb3c7('0x6d')](_0x1d6774[_0xb3c7('0x6e')]);_[_0xb3c7('0x6f')](_0x2ce8b7,function(_0x80d831){return _0x2116c5[_0xb3c7('0x70')](_0x80d831[_0xb3c7('0x30')]);});return{'count':_0x2ce8b7[_0xb3c7('0x39')],'rows':_[_0xb3c7('0x3f')](_0x2ce8b7,function(_0x5b663d){return{'id':_0x5b663d[_0xb3c7('0x30')],'name':_0x5b663d['label'],'custom':_['endsWith'](_0x5b663d[_0xb3c7('0x30')],'_c')?!![]:![],'options':_0x5b663d['options']?_[_0xb3c7('0x3f')](_[_0xb3c7('0x6d')](_0x5b663d[_0xb3c7('0x43')]),function(_0x5d2a02){return{'name':_0x5d2a02[_0xb3c7('0x71')],'value':_0x5d2a02[_0xb3c7('0x30')]};}):[]};})};}})[_0xb3c7('0x1b')](respondWithResult(_0x632b20,null))[_0xb3c7('0x24')](function(_0x33ed02){var _0x3bf716=_0xbf2d7a[_0xb3c7('0x34')][_0xb3c7('0x19')]?0x1f4:_0x33ed02[_0xb3c7('0x72')]||0x1f4;logger[_0xb3c7('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0xb3c7('0x57'),_0x3bf716,JSON[_0xb3c7('0x20')](_0x33ed02));delete _0x33ed02[_0xb3c7('0x30')];if(_0x3bf716===0x191){_0x3bf716=0x190;}_0x632b20[_0xb3c7('0x27')](_0x3bf716)['send'](_0xbf2d7a[_0xb3c7('0x34')][_0xb3c7('0x19')]?{'message':_0xb3c7('0x73'),'statusCode':_0x33ed02[_0xb3c7('0x72')]}:_0x33ed02);});}else{var _0x220bda=0x1f4;_0x632b20[_0xb3c7('0x27')](_0x220bda)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x559d=['http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','index','SugarcrmAccount','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','count','includeAll','include','findAll','show','params','rawAttributes','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','format','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client'];(function(_0x28b880,_0x2049c4){var _0x4f6d65=function(_0x20748f){while(--_0x20748f){_0x28b880['push'](_0x28b880['shift']());}};_0x4f6d65(++_0x2049c4);}(_0x559d,0x1e9));var _0xd559=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x559d[_0x37cc52];return _0x2b4a90;};'use strict';var pdf=require(_0xd559('0x0'));var emlformat=require(_0xd559('0x1'));var rimraf=require(_0xd559('0x2'));var zipdir=require(_0xd559('0x3'));var jsonpatch=require(_0xd559('0x4'));var rp=require(_0xd559('0x5'));var moment=require(_0xd559('0x6'));var BPromise=require(_0xd559('0x7'));var Mustache=require(_0xd559('0x8'));var util=require(_0xd559('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd559('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd559('0xb'));var crypto=require('crypto');var jsforce=require(_0xd559('0xc'));var deskjs=require(_0xd559('0xd'));var toCsv=require(_0xd559('0xe'));var querystring=require(_0xd559('0xf'));var Papa=require(_0xd559('0x10'));var Redis=require('ioredis');var authService=require(_0xd559('0x11'));var qs=require(_0xd559('0x12'));var hardwareService=require(_0xd559('0x13'));var logger=require(_0xd559('0x14'))(_0xd559('0x15'));var utils=require(_0xd559('0x16'));var config=require(_0xd559('0x17'));var db=require(_0xd559('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xd559('0x19'));var client=jayson[_0xd559('0x1a')][_0xd559('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x439745,_0x3d7fa6,_0x5d5e09){if(_0x5d5e09){var _0x6158f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6158f8[_0xd559('0x1c')](_0x3d7fa6)){return _0x439745;}else{throw new Error(_0xd559('0x1d'));}}else{return _0x439745;}}function respondWithRpcPromise(_0x28f23e,_0x439cf9,_0x5e78dd,_0xa135a9){return new BPromise(function(_0x41a62a,_0x452374){var _0x2a61ef=_0xa135a9||client;return _0x2a61ef[_0xd559('0x1e')](_0x28f23e,_0x5e78dd)['then'](function(_0x1b555b){logger[_0xd559('0x1f')](_0xd559('0x20'),_0x439cf9,_0xd559('0x21'));logger[_0xd559('0x22')](_0xd559('0x23'),_0x439cf9,_0xd559('0x21'),JSON[_0xd559('0x24')](_0x1b555b));if(_0x1b555b[_0xd559('0x25')]){if(_0x1b555b[_0xd559('0x25')]['code']===0x1f4){logger[_0xd559('0x25')]('SugarcrmAccount,\x20%s,\x20%s',_0x439cf9,_0x1b555b[_0xd559('0x25')][_0xd559('0x26')]);return _0x452374(_0x1b555b[_0xd559('0x25')]['message']);}logger[_0xd559('0x25')](_0xd559('0x20'),_0x439cf9,_0x1b555b[_0xd559('0x25')]['message']);return _0x41a62a(_0x1b555b[_0xd559('0x25')]['message']);}else{logger[_0xd559('0x1f')](_0xd559('0x20'),_0x439cf9,_0xd559('0x21'));_0x41a62a(_0x1b555b['result']['message']);}})[_0xd559('0x27')](function(_0xac3d39){logger[_0xd559('0x25')](_0xd559('0x20'),_0x439cf9,_0xac3d39);_0x452374(_0xac3d39);});});}function respondWithStatusCode(_0x964430,_0x4d5993){_0x4d5993=_0x4d5993||0xcc;return function(_0x3a501b){if(_0x3a501b){return _0x964430[_0xd559('0x28')](_0x4d5993);}return _0x964430[_0xd559('0x29')](_0x4d5993)[_0xd559('0x2a')]();};}function respondWithResult(_0x1d526d,_0x174ed0){_0x174ed0=_0x174ed0||0xc8;return function(_0xa9faf6){if(_0xa9faf6){return _0x1d526d['status'](_0x174ed0)[_0xd559('0x2b')](_0xa9faf6);}};}function respondWithFilteredResult(_0xc44eb9,_0x23965f){return function(_0x25736){if(_0x25736){var _0x12daf9=_0x25736['count'],_0x4a4a92=_0x23965f[_0xd559('0x2c')],_0x21b099=_0x23965f['offset']+_0x23965f[_0xd559('0x2d')],_0x46b51d;if(_0x21b099>=_0x12daf9){_0x21b099=_0x12daf9;_0x46b51d=0xc8;}else{_0x46b51d=0xce;}_0xc44eb9['status'](_0x46b51d);return _0xc44eb9[_0xd559('0x2e')](_0xd559('0x2f'),_0x4a4a92+'-'+_0x21b099+'/'+_0x12daf9)[_0xd559('0x2b')](_0x25736);}return null;};}function patchUpdates(_0x1e4942){return function(_0x53df3d){try{jsonpatch[_0xd559('0x30')](_0x53df3d,_0x1e4942,!![]);}catch(_0x3e7c8f){return BPromise['reject'](_0x3e7c8f);}return _0x53df3d['save']();};}function saveUpdates(_0x30d3e2,_0xa69fba){return function(_0x4431dc){if(_0x4431dc){return _0x4431dc[_0xd559('0x31')](_0x30d3e2)[_0xd559('0x32')](function(_0x39c3f4){return _0x39c3f4;});}return null;};}function removeEntity(_0x1b83f4,_0x54db2b){return function(_0x5135b8){if(_0x5135b8){return _0x5135b8[_0xd559('0x33')]()[_0xd559('0x32')](function(){_0x1b83f4[_0xd559('0x29')](0xcc)[_0xd559('0x2a')]();});}};}function handleEntityNotFound(_0x354501,_0x1eab12){return function(_0x5db070){if(!_0x5db070){_0x354501[_0xd559('0x28')](0x194);}return _0x5db070;};}function handleError(_0x2d9e90,_0x1d917d){_0x1d917d=_0x1d917d||0x1f4;return function(_0x2983a7){logger[_0xd559('0x25')](_0x2983a7[_0xd559('0x34')]);if(_0x2983a7[_0xd559('0x35')]){delete _0x2983a7[_0xd559('0x35')];}_0x2d9e90[_0xd559('0x29')](_0x1d917d)[_0xd559('0x36')](_0x2983a7);};}exports[_0xd559('0x37')]=function(_0x142546,_0x5cecc4){var _0x4e9ca0={},_0x3f1d50={},_0x3af0e7={'count':0x0,'rows':[]};var _0x47e85=db[_0xd559('0x38')]['rawAttributes'];_0x3f1d50['model']=_[_0xd559('0x39')](_0x47e85);_0x3f1d50[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x142546[_0xd559('0x3a')]);_0x3f1d50[_0xd559('0x3b')]=_[_0xd559('0x3c')](_0x3f1d50['model'],_0x3f1d50[_0xd559('0x3a')]);_0x4e9ca0['attributes']=_[_0xd559('0x3c')](_0x3f1d50['model'],qs[_0xd559('0x3d')](_0x142546['query'][_0xd559('0x3d')]));_0x4e9ca0[_0xd559('0x3e')]=_0x4e9ca0[_0xd559('0x3e')][_0xd559('0x3f')]?_0x4e9ca0['attributes']:_0x3f1d50[_0xd559('0x40')];if(!_0x142546[_0xd559('0x3a')][_0xd559('0x41')](_0xd559('0x42'))){_0x4e9ca0['limit']=qs['limit'](_0x142546[_0xd559('0x3a')][_0xd559('0x2d')]);_0x4e9ca0[_0xd559('0x2c')]=qs[_0xd559('0x2c')](_0x142546[_0xd559('0x3a')]['offset']);}_0x4e9ca0[_0xd559('0x43')]=qs[_0xd559('0x44')](_0x142546['query'][_0xd559('0x44')]);_0x4e9ca0[_0xd559('0x45')]=qs[_0xd559('0x3b')](_[_0xd559('0x46')](_0x142546[_0xd559('0x3a')],_0x3f1d50[_0xd559('0x3b')]));if(_0x142546[_0xd559('0x3a')][_0xd559('0x47')]){_0x4e9ca0['where']=_[_0xd559('0x48')](_0x4e9ca0['where'],{'$or':_[_0xd559('0x49')](_0x47e85,function(_0x30e853){if(_0x30e853[_0xd559('0x4a')]['key']!=='VIRTUAL'){var _0x5d07ca={};_0x5d07ca[_0x30e853[_0xd559('0x4b')]]={'$like':'%'+_0x142546[_0xd559('0x3a')][_0xd559('0x47')]+'%'};return _0x5d07ca;}})});}_0x4e9ca0=_[_0xd559('0x48')]({},_0x4e9ca0,_0x142546[_0xd559('0x4c')]);var _0x56b5d4={'where':_0x4e9ca0[_0xd559('0x45')]};return db['SugarcrmAccount'][_0xd559('0x4d')](_0x56b5d4)[_0xd559('0x32')](function(_0xd2502f){_0x3af0e7[_0xd559('0x4d')]=_0xd2502f;if(_0x142546[_0xd559('0x3a')][_0xd559('0x4e')]){_0x4e9ca0[_0xd559('0x4f')]=[{'all':!![]}];}return db[_0xd559('0x38')][_0xd559('0x50')](_0x4e9ca0);})['then'](function(_0x559bc3){_0x3af0e7['rows']=_0x559bc3;return _0x3af0e7;})['then'](respondWithFilteredResult(_0x5cecc4,_0x4e9ca0))['catch'](handleError(_0x5cecc4,null));};exports[_0xd559('0x51')]=function(_0x2be99c,_0x377855){var _0x2c6ff5={'raw':![],'where':{'id':_0x2be99c[_0xd559('0x52')]['id']}},_0x45bc72={};_0x45bc72[_0xd559('0x40')]=_[_0xd559('0x39')](db[_0xd559('0x38')][_0xd559('0x53')]);_0x45bc72[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x2be99c[_0xd559('0x3a')]);_0x45bc72['filters']=_[_0xd559('0x3c')](_0x45bc72['model'],_0x45bc72[_0xd559('0x3a')]);_0x2c6ff5[_0xd559('0x3e')]=_[_0xd559('0x3c')](_0x45bc72[_0xd559('0x40')],qs[_0xd559('0x3d')](_0x2be99c[_0xd559('0x3a')][_0xd559('0x3d')]));_0x2c6ff5['attributes']=_0x2c6ff5[_0xd559('0x3e')][_0xd559('0x3f')]?_0x2c6ff5[_0xd559('0x3e')]:_0x45bc72[_0xd559('0x40')];if(_0x2be99c[_0xd559('0x3a')][_0xd559('0x4e')]){_0x2c6ff5[_0xd559('0x4f')]=[{'all':!![]}];}_0x2c6ff5=_[_0xd559('0x48')]({},_0x2c6ff5,_0x2be99c[_0xd559('0x4c')]);return db['SugarcrmAccount'][_0xd559('0x54')](_0x2c6ff5)[_0xd559('0x32')](handleEntityNotFound(_0x377855,null))[_0xd559('0x32')](respondWithResult(_0x377855,null))[_0xd559('0x27')](handleError(_0x377855,null));};exports[_0xd559('0x55')]=function(_0x20a33c,_0x5a1f86){return db[_0xd559('0x38')][_0xd559('0x55')](_0x20a33c[_0xd559('0x56')],{})[_0xd559('0x32')](respondWithResult(_0x5a1f86,0xc9))[_0xd559('0x27')](handleError(_0x5a1f86,null));};exports[_0xd559('0x31')]=function(_0x170291,_0x1ca676){if(_0x170291[_0xd559('0x56')]['id']){delete _0x170291['body']['id'];}return db[_0xd559('0x38')][_0xd559('0x54')]({'where':{'id':_0x170291[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x1ca676,null))[_0xd559('0x32')](saveUpdates(_0x170291[_0xd559('0x56')],null))[_0xd559('0x32')](respondWithResult(_0x1ca676,null))[_0xd559('0x27')](handleError(_0x1ca676,null));};exports[_0xd559('0x33')]=function(_0x2e9425,_0x400a8a){return db[_0xd559('0x38')][_0xd559('0x54')]({'where':{'id':_0x2e9425[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x400a8a,null))[_0xd559('0x32')](removeEntity(_0x400a8a,null))[_0xd559('0x27')](handleError(_0x400a8a,null));};exports['getConfigurations']=function(_0x4b1251,_0x5cf9d7,_0x82e7c9){var _0x71c985={};var _0x2decd7={};var _0x892e6c;var _0x423c1b;return db['SugarcrmAccount'][_0xd559('0x57')]({'where':{'id':_0x4b1251[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x5cf9d7,null))[_0xd559('0x32')](function(_0xb66933){if(_0xb66933){_0x892e6c=_0xb66933;_0x2decd7['model']=_[_0xd559('0x39')](db[_0xd559('0x58')]['rawAttributes']);_0x2decd7[_0xd559('0x3a')]=_[_0xd559('0x39')](_0x4b1251[_0xd559('0x3a')]);_0x2decd7[_0xd559('0x3b')]=_[_0xd559('0x3c')](_0x2decd7[_0xd559('0x40')],_0x2decd7[_0xd559('0x3a')]);_0x71c985[_0xd559('0x3e')]=_[_0xd559('0x3c')](_0x2decd7['model'],qs[_0xd559('0x3d')](_0x4b1251[_0xd559('0x3a')][_0xd559('0x3d')]));_0x71c985['attributes']=_0x71c985[_0xd559('0x3e')][_0xd559('0x3f')]?_0x71c985[_0xd559('0x3e')]:_0x2decd7[_0xd559('0x40')];_0x71c985[_0xd559('0x43')]=qs[_0xd559('0x44')](_0x4b1251[_0xd559('0x3a')][_0xd559('0x44')]);_0x71c985[_0xd559('0x45')]=qs[_0xd559('0x3b')](_['pick'](_0x4b1251[_0xd559('0x3a')],_0x2decd7['filters']));if(_0x4b1251[_0xd559('0x3a')][_0xd559('0x47')]){_0x71c985[_0xd559('0x45')]=_[_0xd559('0x48')](_0x71c985['where'],{'$or':_[_0xd559('0x49')](_0x71c985['attributes'],function(_0x36fac1){var _0x45406c={};_0x45406c[_0x36fac1]={'$like':'%'+_0x4b1251['query'][_0xd559('0x47')]+'%'};return _0x45406c;})});}_0x71c985=_['merge']({},_0x71c985,_0x4b1251[_0xd559('0x4c')]);return _0x892e6c[_0xd559('0x59')](_0x71c985);}})[_0xd559('0x32')](function(_0x1326a1){if(_0x1326a1){_0x423c1b=_0x1326a1[_0xd559('0x3f')];if(!_0x4b1251['query'][_0xd559('0x41')](_0xd559('0x42'))){_0x71c985[_0xd559('0x2d')]=qs[_0xd559('0x2d')](_0x4b1251[_0xd559('0x3a')]['limit']);_0x71c985[_0xd559('0x2c')]=qs[_0xd559('0x2c')](_0x4b1251['query'][_0xd559('0x2c')]);}return _0x892e6c[_0xd559('0x59')](_0x71c985);}})[_0xd559('0x32')](function(_0x1f662d){if(_0x1f662d){return _0x1f662d?{'count':_0x423c1b,'rows':_0x1f662d}:null;}})[_0xd559('0x32')](respondWithResult(_0x5cf9d7,null))[_0xd559('0x27')](handleError(_0x5cf9d7,null));};exports['addConfiguration']=function(_0x117926,_0x2c6cb0,_0x17d660){if(_0x117926['body']['id']){delete _0x117926[_0xd559('0x56')]['id'];}return db[_0xd559('0x38')]['findOne']({'where':{'id':_0x117926[_0xd559('0x52')]['id']}})[_0xd559('0x32')](handleEntityNotFound(_0x2c6cb0,null))['then'](function(_0x48f59f){if(_0x48f59f){_0x117926[_0xd559('0x56')][_0xd559('0x5a')]=_0x48f59f['id'];_0x117926[_0xd559('0x56')]['Subjects']=integrations[_0xd559('0x5b')](_0x117926[_0xd559('0x56')][_0xd559('0x5c')],_0x117926[_0xd559('0x56')]['type']);_0x117926[_0xd559('0x56')]['Descriptions']=integrations[_0xd559('0x5d')](_0x117926[_0xd559('0x56')][_0xd559('0x5c')],_0x117926[_0xd559('0x56')][_0xd559('0x4a')]);return db[_0xd559('0x58')][_0xd559('0x55')](_0x117926[_0xd559('0x56')],{'include':[{'model':db[_0xd559('0x5e')],'as':_0xd559('0x5f')},{'model':db[_0xd559('0x5e')],'as':_0xd559('0x60')}]});}return null;})[_0xd559('0x32')](respondWithResult(_0x2c6cb0,null))[_0xd559('0x27')](handleError(_0x2c6cb0,null));};exports[_0xd559('0x61')]=function(_0x477510,_0x48cd6d,_0x179190){var _0x189ae1='';var _0x5c704e=['id',_0xd559('0x35'),'assigned_user_id',_0xd559('0x62'),'description',_0xd559('0x63'),_0xd559('0x64'),'duration_minutes',_0xd559('0x65'),_0xd559('0x66'),_0xd559('0x67'),_0xd559('0x68')];return db[_0xd559('0x38')][_0xd559('0x57')]({'where':{'id':_0x477510[_0xd559('0x52')]['id']},'attributes':['id',_0xd559('0x69'),_0xd559('0x6a'),_0xd559('0x6b')]})[_0xd559('0x32')](handleEntityNotFound(_0x48cd6d,null))['then'](function(_0x1bd14f){if(_0x1bd14f){_0x189ae1=_0x1bd14f[_0xd559('0x6b')];var _0x181699=_0x189ae1[_0xd559('0x6c')](-0x1);if(_0x181699==='/'){_0x189ae1=_0x189ae1['substring'](0x0,_0x189ae1['lastIndexOf'](_0x181699));}return rp({'method':'POST','uri':util[_0xd559('0x6d')]('%s%s',_0x189ae1,_0xd559('0x6e')),'json':!![],'form':{'method':_0xd559('0x6f'),'input_type':'JSON','response_type':_0xd559('0x70'),'rest_data':JSON[_0xd559('0x24')]({'user_auth':{'user_name':_0x1bd14f[_0xd559('0x69')],'password':_0x1bd14f['password'],'encryption':_0xd559('0x71')},'application':_0xd559('0x72')})}});}})[_0xd559('0x32')](function(_0x109df7){if(_0x109df7&&_0x109df7[_0xd559('0x35')]!==_0xd559('0x73')&&_0x109df7['name']!==_0xd559('0x74')){return rp({'method':_0xd559('0x75'),'uri':util[_0xd559('0x6d')](_0xd559('0x76'),_0x189ae1,_0xd559('0x6e')),'json':!![],'form':{'method':_0xd559('0x77'),'input_type':'JSON','response_type':_0xd559('0x70'),'rest_data':JSON[_0xd559('0x24')]({'session':_0x109df7['id'],'module_name':_0xd559('0x78')})}})[_0xd559('0x32')](function(_0x512b88){if(_0x512b88){var _0x2e9b66=_[_0xd559('0x79')](_0x512b88[_0xd559('0x7a')]);_[_0xd559('0x7b')](_0x2e9b66,function(_0x5aa379){return _0x5c704e['includes'](_0x5aa379[_0xd559('0x35')]);});return{'count':_0x2e9b66[_0xd559('0x3f')],'rows':_[_0xd559('0x49')](_0x2e9b66,function(_0x267ba2){return{'id':_0x267ba2[_0xd559('0x35')],'name':_0x267ba2[_0xd559('0x7c')],'custom':_[_0xd559('0x7d')](_0x267ba2['name'],'_c')?!![]:![],'options':_0x267ba2['options']?_['map'](_[_0xd559('0x79')](_0x267ba2['options']),function(_0x19d06a){return{'name':_0x19d06a[_0xd559('0x7e')],'value':_0x19d06a[_0xd559('0x35')]};}):[]};})};}})[_0xd559('0x32')](respondWithResult(_0x48cd6d,null))[_0xd559('0x27')](function(_0x23b408){var _0x1a6953=_0x477510[_0xd559('0x3a')][_0xd559('0x1c')]?0x1f4:_0x23b408[_0xd559('0x7f')]||0x1f4;logger[_0xd559('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0xd559('0x61'),_0x1a6953,JSON[_0xd559('0x24')](_0x23b408));delete _0x23b408['name'];if(_0x1a6953===0x191){_0x1a6953=0x190;}_0x48cd6d[_0xd559('0x29')](_0x1a6953)[_0xd559('0x36')](_0x477510[_0xd559('0x3a')][_0xd559('0x1c')]?{'message':_0xd559('0x80'),'statusCode':_0x23b408[_0xd559('0x7f')]}:_0x23b408);});}else{var _0x5a8a78=0x1f4;_0x48cd6d[_0xd559('0x29')](_0x5a8a78)[_0xd559('0x36')]({'message':_0xd559('0x80'),'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 6b73f12..22a2705 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 _0x5a89=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x5a89,0x1e4));var _0x95a8=function(_0x1eddb9,_0x4e8c4f){_0x1eddb9=_0x1eddb9-0x0;var _0x17ebdd=_0x5a89[_0x1eddb9];return _0x17ebdd;};'use strict';var _=require(_0x95a8('0x0'));var util=require(_0x95a8('0x1'));var logger=require(_0x95a8('0x2'))(_0x95a8('0x3'));var moment=require(_0x95a8('0x4'));var BPromise=require(_0x95a8('0x5'));var rp=require(_0x95a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95a8('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x95a8('0x8'));module['exports']=function(_0x29d4bb,_0x5b9dfd){return _0x29d4bb[_0x95a8('0x9')](_0x95a8('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19a7=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4961f3,_0x56e337){var _0x523b41=function(_0x510b94){while(--_0x510b94){_0x4961f3['push'](_0x4961f3['shift']());}};_0x523b41(++_0x56e337);}(_0x19a7,0x1c7));var _0x719a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x19a7[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x719a('0x0'));var util=require(_0x719a('0x1'));var logger=require(_0x719a('0x2'))(_0x719a('0x3'));var moment=require(_0x719a('0x4'));var BPromise=require(_0x719a('0x5'));var rp=require(_0x719a('0x6'));var fs=require('fs');var path=require(_0x719a('0x7'));var rimraf=require(_0x719a('0x8'));var config=require(_0x719a('0x9'));var attributes=require(_0x719a('0xa'));var integrations=require(_0x719a('0xb'));module['exports']=function(_0x16d898,_0x2c10b5){return _0x16d898[_0x719a('0xc')](_0x719a('0xd'),attributes,{'tableName':_0x719a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index ed9799e..050a876 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 _0xce9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring'];(function(_0x5e7c3e,_0x4dd14e){var _0x3ca540=function(_0x718103){while(--_0x718103){_0x5e7c3e['push'](_0x5e7c3e['shift']());}};_0x3ca540(++_0x4dd14e);}(_0xce9e,0x188));var _0xece9=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0xce9e[_0xb72cc8];return _0x75cfb3;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var moment=require('moment');var BPromise=require(_0xece9('0x2'));var rs=require(_0xece9('0x3'));var fs=require('fs');var Redis=require(_0xece9('0x4'));var db=require(_0xece9('0x5'))['db'];var utils=require(_0xece9('0x6'));var logger=require(_0xece9('0x7'))(_0xece9('0x8'));var config=require(_0xece9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xece9('0xa')][_0xece9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b6404,_0x38a4d3,_0x14c415){return new BPromise(function(_0xaebd22,_0x589e48){return client[_0xece9('0xc')](_0x3b6404,_0x14c415)[_0xece9('0xd')](function(_0xd29905){logger['info'](_0xece9('0xe'),_0x38a4d3,_0xece9('0xf'));logger[_0xece9('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x38a4d3,_0xece9('0xf'),JSON[_0xece9('0x11')](_0xd29905));if(_0xd29905[_0xece9('0x12')]){if(_0xd29905['error'][_0xece9('0x13')]===0x1f4){logger[_0xece9('0x12')](_0xece9('0xe'),_0x38a4d3,_0xd29905[_0xece9('0x12')]['message']);return _0x589e48(_0xd29905[_0xece9('0x12')][_0xece9('0x14')]);}logger[_0xece9('0x12')](_0xece9('0xe'),_0x38a4d3,_0xd29905[_0xece9('0x12')][_0xece9('0x14')]);return _0xaebd22(_0xd29905[_0xece9('0x12')]['message']);}else{logger[_0xece9('0x15')](_0xece9('0xe'),_0x38a4d3,_0xece9('0xf'));_0xaebd22(_0xd29905[_0xece9('0x16')][_0xece9('0x14')]);}})[_0xece9('0x17')](function(_0x3e509a){logger[_0xece9('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x38a4d3,_0x3e509a);_0x589e48(_0x3e509a);});});}exports['GetSugarcrmAccount']=function(_0x211a92){var _0x467c09=this;return new Promise(function(_0x378cc9,_0x3f2f4a){return db[_0xece9('0x18')][_0xece9('0x19')]({'raw':_0x211a92[_0xece9('0x1a')]?_0x211a92['options'][_0xece9('0x1b')]===undefined?!![]:![]:!![],'where':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')][_0xece9('0x1c')]||null:null,'attributes':_0x211a92['options']?_0x211a92[_0xece9('0x1a')][_0xece9('0x1d')]||null:null,'limit':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')]['limit']||null:null,'include':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')][_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x211a92[_0xece9('0x1a')][_0xece9('0x1e')],function(_0x36694a){return{'model':db[_0x36694a[_0xece9('0x20')]],'as':_0x36694a['as'],'attributes':_0x36694a[_0xece9('0x1d')],'include':_0x36694a[_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x36694a['include'],function(_0x5ef097){return{'model':db[_0x5ef097[_0xece9('0x20')]],'as':_0x5ef097['as'],'attributes':_0x5ef097['attributes'],'include':_0x5ef097[_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x5ef097[_0xece9('0x1e')],function(_0x4db657){return{'model':db[_0x4db657[_0xece9('0x20')]],'as':_0x4db657['as'],'attributes':_0x4db657[_0xece9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xece9('0xd')](function(_0xee134a){logger[_0xece9('0x15')](_0xece9('0x21'),_0x211a92);logger[_0xece9('0x10')](_0xece9('0x21'),_0x211a92,JSON[_0xece9('0x11')](_0xee134a));_0x378cc9(_0xee134a);})[_0xece9('0x17')](function(_0x2b8b18){logger[_0xece9('0x12')](_0xece9('0x21'),_0x2b8b18['message'],_0x211a92);_0x3f2f4a(_0x467c09[_0xece9('0x12')](0x1f4,_0x2b8b18['message']));});});};exports[_0xece9('0x22')]=function(_0x38e915){var _0x4b8687=this;return new Promise(function(_0x3bcd2c,_0x2279a2){return db['SugarcrmAccount'][_0xece9('0x23')]({'raw':_0x38e915[_0xece9('0x1a')]?_0x38e915['options'][_0xece9('0x1b')]===undefined?!![]:![]:!![],'where':_0x38e915[_0xece9('0x1a')]?_0x38e915[_0xece9('0x1a')][_0xece9('0x1c')]||null:null,'attributes':_0x38e915['options']?_0x38e915[_0xece9('0x1a')][_0xece9('0x1d')]||null:null,'include':_0x38e915['options']?_0x38e915[_0xece9('0x1a')][_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x38e915[_0xece9('0x1a')][_0xece9('0x1e')],function(_0x24fc9c){return{'model':db[_0x24fc9c[_0xece9('0x20')]],'as':_0x24fc9c['as'],'attributes':_0x24fc9c[_0xece9('0x1d')],'include':_0x24fc9c[_0xece9('0x1e')]?_['map'](_0x24fc9c['include'],function(_0xf821f){return{'model':db[_0xf821f[_0xece9('0x20')]],'as':_0xf821f['as'],'attributes':_0xf821f[_0xece9('0x1d')],'include':_0xf821f['include']?_[_0xece9('0x1f')](_0xf821f['include'],function(_0x41b719){return{'model':db[_0x41b719[_0xece9('0x20')]],'as':_0x41b719['as'],'attributes':_0x41b719['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x133467){logger[_0xece9('0x15')]('ShowSugarcrmAccount',_0x38e915);logger[_0xece9('0x10')](_0xece9('0x22'),_0x38e915,JSON['stringify'](_0x133467));_0x3bcd2c(_0x133467);})['catch'](function(_0x1dac84){logger[_0xece9('0x12')](_0xece9('0x22'),_0x1dac84[_0xece9('0x14')],_0x38e915);_0x2279a2(_0x4b8687['error'](0x1f4,_0x1dac84[_0xece9('0x14')]));});});}; \ No newline at end of file +var _0x3f75=['ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','limit','include','map','model','attributes','debug','stringify','find','where','ShowSugarcrmAccount','lodash','moment','bluebird','randomstring'];(function(_0x2cd1d9,_0x151a1e){var _0x5abf9a=function(_0x2c294f){while(--_0x2c294f){_0x2cd1d9['push'](_0x2cd1d9['shift']());}};_0x5abf9a(++_0x151a1e);}(_0x3f75,0xc8));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x53f7('0x0'));var util=require('util');var moment=require(_0x53f7('0x1'));var BPromise=require(_0x53f7('0x2'));var rs=require(_0x53f7('0x3'));var fs=require('fs');var Redis=require(_0x53f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x53f7('0x5'))(_0x53f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x53f7('0x7'));var client=jayson[_0x53f7('0x8')][_0x53f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197120,_0x5af833,_0x108b7e){return new BPromise(function(_0x4f6384,_0x21a2a7){return client[_0x53f7('0xa')](_0x197120,_0x108b7e)[_0x53f7('0xb')](function(_0x1f1d64){logger[_0x53f7('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x5af833,_0x53f7('0xd'));logger['debug'](_0x53f7('0xe'),_0x5af833,'request\x20sent',JSON['stringify'](_0x1f1d64));if(_0x1f1d64[_0x53f7('0xf')]){if(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x10')]===0x1f4){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);return _0x21a2a7(_0x1f1d64['error'][_0x53f7('0x12')]);}logger['error'](_0x53f7('0x11'),_0x5af833,_0x1f1d64['error'][_0x53f7('0x12')]);return _0x4f6384(_0x1f1d64[_0x53f7('0xf')][_0x53f7('0x12')]);}else{logger[_0x53f7('0xc')](_0x53f7('0x11'),_0x5af833,_0x53f7('0xd'));_0x4f6384(_0x1f1d64[_0x53f7('0x13')][_0x53f7('0x12')]);}})['catch'](function(_0x120af2){logger[_0x53f7('0xf')](_0x53f7('0x11'),_0x5af833,_0x120af2);_0x21a2a7(_0x120af2);});});}exports[_0x53f7('0x14')]=function(_0x30b108){var _0x4c4466=this;return new Promise(function(_0x164169,_0xe4c9fb){return db[_0x53f7('0x15')][_0x53f7('0x16')]({'raw':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['where']||null:null,'attributes':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')]['attributes']||null:null,'limit':_0x30b108['options']?_0x30b108[_0x53f7('0x17')][_0x53f7('0x18')]||null:null,'include':_0x30b108[_0x53f7('0x17')]?_0x30b108[_0x53f7('0x17')][_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x30b108[_0x53f7('0x17')]['include'],function(_0x40f6e0){return{'model':db[_0x40f6e0[_0x53f7('0x1b')]],'as':_0x40f6e0['as'],'attributes':_0x40f6e0[_0x53f7('0x1c')],'include':_0x40f6e0[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x40f6e0['include'],function(_0x22a69a){return{'model':db[_0x22a69a[_0x53f7('0x1b')]],'as':_0x22a69a['as'],'attributes':_0x22a69a[_0x53f7('0x1c')],'include':_0x22a69a[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x22a69a[_0x53f7('0x19')],function(_0x45342f){return{'model':db[_0x45342f[_0x53f7('0x1b')]],'as':_0x45342f['as'],'attributes':_0x45342f[_0x53f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0xb')](function(_0x1c72bc){logger[_0x53f7('0xc')](_0x53f7('0x14'),_0x30b108);logger[_0x53f7('0x1d')]('GetSugarcrmAccount',_0x30b108,JSON[_0x53f7('0x1e')](_0x1c72bc));_0x164169(_0x1c72bc);})['catch'](function(_0x831942){logger[_0x53f7('0xf')](_0x53f7('0x14'),_0x831942[_0x53f7('0x12')],_0x30b108);_0xe4c9fb(_0x4c4466[_0x53f7('0xf')](0x1f4,_0x831942[_0x53f7('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2b5928){var _0x12ef1c=this;return new Promise(function(_0x2b9be2,_0x4b7713){return db[_0x53f7('0x15')][_0x53f7('0x1f')]({'raw':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x20')]||null:null,'attributes':_0x2b5928['options']?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x1c')]||null:null,'include':_0x2b5928[_0x53f7('0x17')]?_0x2b5928[_0x53f7('0x17')][_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x2b5928['options'][_0x53f7('0x19')],function(_0x20524f){return{'model':db[_0x20524f[_0x53f7('0x1b')]],'as':_0x20524f['as'],'attributes':_0x20524f['attributes'],'include':_0x20524f['include']?_[_0x53f7('0x1a')](_0x20524f[_0x53f7('0x19')],function(_0x5bfc82){return{'model':db[_0x5bfc82[_0x53f7('0x1b')]],'as':_0x5bfc82['as'],'attributes':_0x5bfc82[_0x53f7('0x1c')],'include':_0x5bfc82[_0x53f7('0x19')]?_[_0x53f7('0x1a')](_0x5bfc82[_0x53f7('0x19')],function(_0x36fe83){return{'model':db[_0x36fe83[_0x53f7('0x1b')]],'as':_0x36fe83['as'],'attributes':_0x36fe83[_0x53f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53f7('0xb')](function(_0x237d97){logger[_0x53f7('0xc')](_0x53f7('0x21'),_0x2b5928);logger[_0x53f7('0x1d')](_0x53f7('0x21'),_0x2b5928,JSON[_0x53f7('0x1e')](_0x237d97));_0x2b9be2(_0x237d97);})['catch'](function(_0x407fdb){logger[_0x53f7('0xf')](_0x53f7('0x21'),_0x407fdb[_0x53f7('0x12')],_0x2b5928);_0x4b7713(_0x12ef1c[_0x53f7('0xf')](0x1f4,_0x407fdb[_0x53f7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ff157a8..d036e1c 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 _0xdddf=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getSubjects','/:id/descriptions','create','put','delete','exports','multer','util'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xdddf,0x17a));var _0xfddd=function(_0x3cf62f,_0x39152c){_0x3cf62f=_0x3cf62f-0x0;var _0x36f12f=_0xdddf[_0x3cf62f];return _0x36f12f;};'use strict';var multer=require(_0xfddd('0x0'));var util=require(_0xfddd('0x1'));var path=require(_0xfddd('0x2'));var timeout=require(_0xfddd('0x3'));var express=require(_0xfddd('0x4'));var router=express[_0xfddd('0x5')]();var auth=require(_0xfddd('0x6'));var interaction=require(_0xfddd('0x7'));var config=require('../../config/environment');var controller=require(_0xfddd('0x8'));router['get']('/',auth[_0xfddd('0x9')](),controller[_0xfddd('0xa')]);router[_0xfddd('0xb')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['show']);router[_0xfddd('0xb')](_0xfddd('0xd'),auth[_0xfddd('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xfddd('0x9')](),controller[_0xfddd('0xe')]);router['get'](_0xfddd('0xf'),auth[_0xfddd('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xfddd('0x9')](),controller[_0xfddd('0x10')]);router[_0xfddd('0x11')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['update']);router[_0xfddd('0x12')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['destroy']);module[_0xfddd('0x13')]=router; \ No newline at end of file +var _0x2516=['/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x2516,0x9d));var _0x6251=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2516[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var path=require(_0x6251('0x2'));var timeout=require(_0x6251('0x3'));var express=require(_0x6251('0x4'));var router=express['Router']();var auth=require(_0x6251('0x5'));var interaction=require(_0x6251('0x6'));var config=require(_0x6251('0x7'));var controller=require(_0x6251('0x8'));router[_0x6251('0x9')]('/',auth[_0x6251('0xa')](),controller[_0x6251('0xb')]);router[_0x6251('0x9')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0xd')]);router[_0x6251('0x9')](_0x6251('0xe'),auth[_0x6251('0xa')](),controller[_0x6251('0xf')]);router[_0x6251('0x9')](_0x6251('0x10'),auth['isAuthenticated'](),controller[_0x6251('0x11')]);router[_0x6251('0x9')](_0x6251('0x12'),auth[_0x6251('0xa')](),controller[_0x6251('0x13')]);router[_0x6251('0x14')]('/',auth[_0x6251('0xa')](),controller['create']);router[_0x6251('0x15')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0x16')]);router[_0x6251('0x17')](_0x6251('0xc'),auth[_0x6251('0xa')](),controller[_0x6251('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a688135..8f8bbfb 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2f27=['exports','STRING'];(function(_0x373f3c,_0x44e12b){var _0x555326=function(_0x5dd8d9){while(--_0x5dd8d9){_0x373f3c['push'](_0x373f3c['shift']());}};_0x555326(++_0x44e12b);}(_0x2f27,0x6a));var _0x72f2=function(_0xfba891,_0x34e86c){_0xfba891=_0xfba891-0x0;var _0x44e262=_0x2f27[_0xfba891];return _0x44e262;};'use strict';var Sequelize=require('sequelize');module[_0x72f2('0x0')]={'name':{'type':Sequelize[_0x72f2('0x1')]},'description':{'type':Sequelize[_0x72f2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c075a4a..ebffe42 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 _0x4fc2=['getSubjects','getDescriptions','SugarcrmField','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','body','getFields','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x4fc2[_0x1fdb40];return _0x281f93;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var hardwareService=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x24fc('0x18'));var client=jayson[_0x24fc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x306873,_0x76cb25,_0x3f6d8b){if(_0x3f6d8b){var _0x3bc30b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bc30b[_0x24fc('0x1a')](_0x76cb25)){return _0x306873;}else{throw new Error(_0x24fc('0x1b'));}}else{return _0x306873;}}function respondWithRpcPromise(_0x537b5c,_0x2a0971,_0x18c0a7,_0x2ffed3){return new BPromise(function(_0x42cbe8,_0x4acd36){var _0x2ac989=_0x2ffed3||client;return _0x2ac989['request'](_0x537b5c,_0x18c0a7)[_0x24fc('0x1c')](function(_0x3385c7){logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));logger['debug'](_0x24fc('0x20'),_0x2a0971,_0x24fc('0x1f'),JSON[_0x24fc('0x21')](_0x3385c7));if(_0x3385c7[_0x24fc('0x22')]){if(_0x3385c7['error'][_0x24fc('0x23')]===0x1f4){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x3385c7['error'][_0x24fc('0x24')]);return _0x4acd36(_0x3385c7[_0x24fc('0x22')][_0x24fc('0x24')]);}logger[_0x24fc('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a0971,_0x3385c7[_0x24fc('0x22')]['message']);return _0x42cbe8(_0x3385c7[_0x24fc('0x22')]['message']);}else{logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));_0x42cbe8(_0x3385c7['result'][_0x24fc('0x24')]);}})['catch'](function(_0x35a9c7){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x35a9c7);_0x4acd36(_0x35a9c7);});});}function respondWithStatusCode(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0xcc;return function(_0x262e11){if(_0x262e11){return _0x34b5b2[_0x24fc('0x25')](_0x3296fc);}return _0x34b5b2[_0x24fc('0x26')](_0x3296fc)[_0x24fc('0x27')]();};}function respondWithResult(_0x2a5c4b,_0x568441){_0x568441=_0x568441||0xc8;return function(_0x11c913){if(_0x11c913){return _0x2a5c4b[_0x24fc('0x26')](_0x568441)[_0x24fc('0x28')](_0x11c913);}};}function respondWithFilteredResult(_0x5bb4c8,_0xf2f77d){return function(_0x3d1ec8){if(_0x3d1ec8){var _0x35f9f9=_0x3d1ec8['count'],_0x290f84=_0xf2f77d[_0x24fc('0x29')],_0x8f2528=_0xf2f77d[_0x24fc('0x29')]+_0xf2f77d[_0x24fc('0x2a')],_0x443796;if(_0x8f2528>=_0x35f9f9){_0x8f2528=_0x35f9f9;_0x443796=0xc8;}else{_0x443796=0xce;}_0x5bb4c8[_0x24fc('0x26')](_0x443796);return _0x5bb4c8[_0x24fc('0x2b')]('Content-Range',_0x290f84+'-'+_0x8f2528+'/'+_0x35f9f9)['json'](_0x3d1ec8);}return null;};}function patchUpdates(_0x4e6f73){return function(_0x3df6f4){try{jsonpatch['apply'](_0x3df6f4,_0x4e6f73,!![]);}catch(_0x3f2464){return BPromise[_0x24fc('0x2c')](_0x3f2464);}return _0x3df6f4[_0x24fc('0x2d')]();};}function saveUpdates(_0x2086c0,_0x4dbd52){return function(_0x66eec0){if(_0x66eec0){return _0x66eec0[_0x24fc('0x2e')](_0x2086c0)['then'](function(_0xf46cd5){return _0xf46cd5;});}return null;};}function removeEntity(_0x1b174d,_0x4d756f){return function(_0x48c62a){if(_0x48c62a){return _0x48c62a[_0x24fc('0x2f')]()['then'](function(){_0x1b174d[_0x24fc('0x26')](0xcc)[_0x24fc('0x27')]();});}};}function handleEntityNotFound(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(!_0x33bbf2){_0x5491b0[_0x24fc('0x25')](0x194);}return _0x33bbf2;};}function handleError(_0x1f7f8d,_0x1c5874){_0x1c5874=_0x1c5874||0x1f4;return function(_0x1e205d){logger[_0x24fc('0x22')](_0x1e205d[_0x24fc('0x30')]);if(_0x1e205d[_0x24fc('0x31')]){delete _0x1e205d['name'];}_0x1f7f8d[_0x24fc('0x26')](_0x1c5874)[_0x24fc('0x32')](_0x1e205d);};}exports[_0x24fc('0x33')]=function(_0x316aa2,_0x242bd5){var _0x5781d2={},_0x56a9bd={},_0xd52d10={'count':0x0,'rows':[]};var _0x5d48fe=db[_0x24fc('0x34')][_0x24fc('0x35')];_0x56a9bd[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x5d48fe);_0x56a9bd['query']=_[_0x24fc('0x37')](_0x316aa2['query']);_0x56a9bd[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x56a9bd[_0x24fc('0x36')],_0x56a9bd[_0x24fc('0x3a')]);_0x5781d2[_0x24fc('0x3b')]=_['intersection'](_0x56a9bd[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x5781d2['attributes']=_0x5781d2[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x5781d2['attributes']:_0x56a9bd[_0x24fc('0x36')];if(!_0x316aa2['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x5781d2[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x5781d2[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x316aa2['query'][_0x24fc('0x29')]);}_0x5781d2[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x316aa2['query'][_0x24fc('0x41')]);_0x5781d2[_0x24fc('0x42')]=qs['filters'](_[_0x24fc('0x43')](_0x316aa2[_0x24fc('0x3a')],_0x56a9bd[_0x24fc('0x38')]));if(_0x316aa2['query'][_0x24fc('0x44')]){_0x5781d2[_0x24fc('0x42')]=_['merge'](_0x5781d2[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x5d48fe,function(_0x158f7b){if(_0x158f7b[_0x24fc('0x46')]['key']!==_0x24fc('0x47')){var _0x9bc56a={};_0x9bc56a[_0x158f7b[_0x24fc('0x48')]]={'$like':'%'+_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x9bc56a;}})});}_0x5781d2=_['merge']({},_0x5781d2,_0x316aa2[_0x24fc('0x49')]);var _0x1b9c90={'where':_0x5781d2[_0x24fc('0x42')]};return db[_0x24fc('0x34')]['count'](_0x1b9c90)[_0x24fc('0x1c')](function(_0x253358){_0xd52d10['count']=_0x253358;if(_0x316aa2['query'][_0x24fc('0x4a')]){_0x5781d2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x24fc('0x4b')](_0x5781d2);})['then'](function(_0x281194){_0xd52d10[_0x24fc('0x4c')]=_0x281194;return _0xd52d10;})[_0x24fc('0x1c')](respondWithFilteredResult(_0x242bd5,_0x5781d2))['catch'](handleError(_0x242bd5,null));};exports[_0x24fc('0x4d')]=function(_0x23c1d4,_0x1b1f1c){var _0x1ad8d6={'raw':![],'where':{'id':_0x23c1d4[_0x24fc('0x4e')]['id']}},_0x39873d={};_0x39873d[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmConfiguration']['rawAttributes']);_0x39873d[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x23c1d4[_0x24fc('0x3a')]);_0x39873d['filters']=_['intersection'](_0x39873d[_0x24fc('0x36')],_0x39873d[_0x24fc('0x3a')]);_0x1ad8d6[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x39873d[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x1ad8d6[_0x24fc('0x3b')]=_0x1ad8d6[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x1ad8d6[_0x24fc('0x3b')]:_0x39873d['model'];if(_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x4a')]){_0x1ad8d6[_0x24fc('0x4f')]=[{'all':!![]}];}_0x1ad8d6=_[_0x24fc('0x50')]({},_0x1ad8d6,_0x23c1d4[_0x24fc('0x49')]);return db['SugarcrmConfiguration'][_0x24fc('0x51')](_0x1ad8d6)['then'](handleEntityNotFound(_0x1b1f1c,null))[_0x24fc('0x1c')](respondWithResult(_0x1b1f1c,null))[_0x24fc('0x52')](handleError(_0x1b1f1c,null));};exports[_0x24fc('0x53')]=function(_0x41ddfb,_0x40f42b){return db[_0x24fc('0x34')]['create'](_0x41ddfb[_0x24fc('0x54')],{})[_0x24fc('0x1c')](respondWithResult(_0x40f42b,0xc9))[_0x24fc('0x52')](handleError(_0x40f42b,null));};exports[_0x24fc('0x2e')]=function(_0x28f799,_0x870767){if(_0x28f799['body']['id']){delete _0x28f799[_0x24fc('0x54')]['id'];}return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x28f799[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x870767,null))[_0x24fc('0x1c')](saveUpdates(_0x28f799[_0x24fc('0x54')],null))['then'](respondWithResult(_0x870767,null))[_0x24fc('0x52')](handleError(_0x870767,null));};exports[_0x24fc('0x2f')]=function(_0x4ae720,_0x1368f6){return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x4ae720[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x1368f6,null))[_0x24fc('0x1c')](removeEntity(_0x1368f6,null))['catch'](handleError(_0x1368f6,null));};exports[_0x24fc('0x55')]=function(_0x4a0524,_0x3e9644,_0x8c9649){var _0x50e5b0={};var _0x435442={};var _0x5c1a92;var _0x1c1f74;return db['SugarcrmConfiguration'][_0x24fc('0x56')]({'where':{'id':_0x4a0524[_0x24fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e9644,null))[_0x24fc('0x1c')](function(_0x5d6539){if(_0x5d6539){_0x5c1a92=_0x5d6539;_0x435442[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmField'][_0x24fc('0x35')]);_0x435442[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x4a0524[_0x24fc('0x3a')]);_0x435442[_0x24fc('0x38')]=_['intersection'](_0x435442[_0x24fc('0x36')],_0x435442[_0x24fc('0x3a')]);_0x50e5b0[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x435442[_0x24fc('0x36')],qs['fields'](_0x4a0524['query'][_0x24fc('0x3c')]));_0x50e5b0[_0x24fc('0x3b')]=_0x50e5b0['attributes']['length']?_0x50e5b0[_0x24fc('0x3b')]:_0x435442[_0x24fc('0x36')];_0x50e5b0[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4a0524['query'][_0x24fc('0x41')]);_0x50e5b0[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x4a0524[_0x24fc('0x3a')],_0x435442[_0x24fc('0x38')]));if(_0x4a0524[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x50e5b0[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x50e5b0[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x50e5b0[_0x24fc('0x3b')],function(_0x24ca4b){var _0x354fc6={};_0x354fc6[_0x24ca4b]={'$like':'%'+_0x4a0524['query'][_0x24fc('0x44')]+'%'};return _0x354fc6;})});}_0x50e5b0=_[_0x24fc('0x50')]({},_0x50e5b0,_0x4a0524[_0x24fc('0x49')]);return _0x5c1a92[_0x24fc('0x55')](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x2eb6dc){if(_0x2eb6dc){_0x1c1f74=_0x2eb6dc[_0x24fc('0x3d')];if(!_0x4a0524[_0x24fc('0x3a')]['hasOwnProperty'](_0x24fc('0x3f'))){_0x50e5b0[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x4a0524[_0x24fc('0x3a')]['limit']);_0x50e5b0[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x4a0524['query']['offset']);}return _0x5c1a92['getFields'](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x698283){if(_0x698283){return _0x698283?{'count':_0x1c1f74,'rows':_0x698283}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x3e9644,null))[_0x24fc('0x52')](handleError(_0x3e9644,null));};exports[_0x24fc('0x57')]=function(_0x1d0f06,_0x52e1aa,_0x11bafd){var _0x15e8a3={};var _0x5a2c09={};var _0x51b1c0;var _0xfc6b7f;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1d0f06['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x52e1aa,null))[_0x24fc('0x1c')](function(_0x33f04e){if(_0x33f04e){_0x51b1c0=_0x33f04e;_0x5a2c09['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x5a2c09['query']=_[_0x24fc('0x37')](_0x1d0f06[_0x24fc('0x3a')]);_0x5a2c09[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5a2c09['model'],_0x5a2c09[_0x24fc('0x3a')]);_0x15e8a3['attributes']=_[_0x24fc('0x39')](_0x5a2c09['model'],qs[_0x24fc('0x3c')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x15e8a3[_0x24fc('0x3b')]=_0x15e8a3[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x15e8a3[_0x24fc('0x3b')]:_0x5a2c09['model'];_0x15e8a3[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1d0f06[_0x24fc('0x3a')]['sort']);_0x15e8a3['where']=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x1d0f06['query'],_0x5a2c09[_0x24fc('0x38')]));if(_0x1d0f06[_0x24fc('0x3a')]['filter']){_0x15e8a3[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x15e8a3['where'],{'$or':_[_0x24fc('0x45')](_0x15e8a3[_0x24fc('0x3b')],function(_0x24e717){var _0x1efe4e={};_0x1efe4e[_0x24e717]={'$like':'%'+_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x1efe4e;})});}_0x15e8a3=_['merge']({},_0x15e8a3,_0x1d0f06['options']);return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x29bd9f){if(_0x29bd9f){_0xfc6b7f=_0x29bd9f['length'];if(!_0x1d0f06['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x15e8a3[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x15e8a3[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1d0f06['query'][_0x24fc('0x29')]);}return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x47e22f){if(_0x47e22f){return _0x47e22f?{'count':_0xfc6b7f,'rows':_0x47e22f}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x52e1aa,null))[_0x24fc('0x52')](handleError(_0x52e1aa,null));};exports[_0x24fc('0x58')]=function(_0x1b2a97,_0xd1e6,_0x5de0ea){var _0x216781={};var _0xcb7986={};var _0x5ca35b;var _0x13ab57;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1b2a97['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0xd1e6,null))[_0x24fc('0x1c')](function(_0x3399fe){if(_0x3399fe){_0x5ca35b=_0x3399fe;_0xcb7986[_0x24fc('0x36')]=_[_0x24fc('0x37')](db[_0x24fc('0x59')][_0x24fc('0x35')]);_0xcb7986[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x1b2a97['query']);_0xcb7986[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0xcb7986[_0x24fc('0x36')],_0xcb7986['query']);_0x216781['attributes']=_['intersection'](_0xcb7986[_0x24fc('0x36')],qs['fields'](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x216781['attributes']=_0x216781[_0x24fc('0x3b')]['length']?_0x216781[_0x24fc('0x3b')]:_0xcb7986['model'];_0x216781[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x41')]);_0x216781[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_['pick'](_0x1b2a97[_0x24fc('0x3a')],_0xcb7986[_0x24fc('0x38')]));if(_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x216781[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x216781[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x216781[_0x24fc('0x3b')],function(_0x5f4ec2){var _0x2c9119={};_0x2c9119[_0x5f4ec2]={'$like':'%'+_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x2c9119;})});}_0x216781=_[_0x24fc('0x50')]({},_0x216781,_0x1b2a97['options']);return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0xc2be0f){if(_0xc2be0f){_0x13ab57=_0xc2be0f['length'];if(!_0x1b2a97[_0x24fc('0x3a')]['hasOwnProperty']('nolimit')){_0x216781['limit']=qs[_0x24fc('0x2a')](_0x1b2a97['query'][_0x24fc('0x2a')]);_0x216781[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1b2a97[_0x24fc('0x3a')]['offset']);}return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0x3d8394){if(_0x3d8394){return _0x3d8394?{'count':_0x13ab57,'rows':_0x3d8394}:null;}})[_0x24fc('0x1c')](respondWithResult(_0xd1e6,null))[_0x24fc('0x52')](handleError(_0xd1e6,null));}; \ No newline at end of file +var _0xd8b0=['moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','Content-Range','apply','destroy','end','stack','name','send','SugarcrmConfiguration','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','key','VIRTUAL','field','options','findAll','rows','show','params','keys','includeAll','find','create','body','update','getFields','findOne','SugarcrmField','filter','map','pick','getSubjects','getDescriptions','html-pdf','eml-format','request-promise'];(function(_0x261cc4,_0x3f9aa1){var _0x5c1cba=function(_0x38764a){while(--_0x38764a){_0x261cc4['push'](_0x261cc4['shift']());}};_0x5c1cba(++_0x3f9aa1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var hardwareService=require(_0x0d8b('0x11'));var logger=require(_0x0d8b('0x12'))('api');var utils=require(_0x0d8b('0x13'));var config=require('../../config/environment');var db=require(_0x0d8b('0x14'))['db'];var jayson=require(_0x0d8b('0x15'));var client=jayson[_0x0d8b('0x16')][_0x0d8b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x35a07b,_0x32bb1a,_0x15dd0f){if(_0x15dd0f){var _0x31a8cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31a8cc[_0x0d8b('0x18')](_0x32bb1a)){return _0x35a07b;}else{throw new Error(_0x0d8b('0x19'));}}else{return _0x35a07b;}}function respondWithRpcPromise(_0x5ad086,_0xe65334,_0x1567ce,_0x2d4e1c){return new BPromise(function(_0x4f6f21,_0x23eb7b){var _0xa86349=_0x2d4e1c||client;return _0xa86349[_0x0d8b('0x1a')](_0x5ad086,_0x1567ce)[_0x0d8b('0x1b')](function(_0x2cb03c){logger['info'](_0x0d8b('0x1c'),_0xe65334,_0x0d8b('0x1d'));logger[_0x0d8b('0x1e')](_0x0d8b('0x1f'),_0xe65334,_0x0d8b('0x1d'),JSON[_0x0d8b('0x20')](_0x2cb03c));if(_0x2cb03c[_0x0d8b('0x21')]){if(_0x2cb03c[_0x0d8b('0x21')]['code']===0x1f4){logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x2cb03c[_0x0d8b('0x21')][_0x0d8b('0x22')]);return _0x23eb7b(_0x2cb03c[_0x0d8b('0x21')][_0x0d8b('0x22')]);}logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x2cb03c['error']['message']);return _0x4f6f21(_0x2cb03c[_0x0d8b('0x21')]['message']);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0xe65334,_0x0d8b('0x1d'));_0x4f6f21(_0x2cb03c[_0x0d8b('0x23')][_0x0d8b('0x22')]);}})[_0x0d8b('0x24')](function(_0x221071){logger[_0x0d8b('0x21')](_0x0d8b('0x1c'),_0xe65334,_0x221071);_0x23eb7b(_0x221071);});});}function respondWithStatusCode(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0xcc;return function(_0x5e5bc3){if(_0x5e5bc3){return _0x4562cb[_0x0d8b('0x25')](_0x27b695);}return _0x4562cb[_0x0d8b('0x26')](_0x27b695)['end']();};}function respondWithResult(_0xe1ef20,_0x4a0ae4){_0x4a0ae4=_0x4a0ae4||0xc8;return function(_0x3dd149){if(_0x3dd149){return _0xe1ef20[_0x0d8b('0x26')](_0x4a0ae4)[_0x0d8b('0x27')](_0x3dd149);}};}function respondWithFilteredResult(_0x4fe6f9,_0x59a905){return function(_0x28f639){if(_0x28f639){var _0x3ef745=_0x28f639[_0x0d8b('0x28')],_0x4c05ee=_0x59a905['offset'],_0xcbc4ac=_0x59a905[_0x0d8b('0x29')]+_0x59a905['limit'],_0x59aa83;if(_0xcbc4ac>=_0x3ef745){_0xcbc4ac=_0x3ef745;_0x59aa83=0xc8;}else{_0x59aa83=0xce;}_0x4fe6f9[_0x0d8b('0x26')](_0x59aa83);return _0x4fe6f9['set'](_0x0d8b('0x2a'),_0x4c05ee+'-'+_0xcbc4ac+'/'+_0x3ef745)['json'](_0x28f639);}return null;};}function patchUpdates(_0x3c8887){return function(_0x106e4c){try{jsonpatch[_0x0d8b('0x2b')](_0x106e4c,_0x3c8887,!![]);}catch(_0x56120a){return BPromise['reject'](_0x56120a);}return _0x106e4c['save']();};}function saveUpdates(_0x4e8992,_0x5515d2){return function(_0x3cdf3c){if(_0x3cdf3c){return _0x3cdf3c['update'](_0x4e8992)['then'](function(_0x36017a){return _0x36017a;});}return null;};}function removeEntity(_0x1b6920,_0x109c14){return function(_0xdeee5d){if(_0xdeee5d){return _0xdeee5d[_0x0d8b('0x2c')]()[_0x0d8b('0x1b')](function(){_0x1b6920[_0x0d8b('0x26')](0xcc)[_0x0d8b('0x2d')]();});}};}function handleEntityNotFound(_0x553e03,_0x37ca42){return function(_0x3ef48d){if(!_0x3ef48d){_0x553e03['sendStatus'](0x194);}return _0x3ef48d;};}function handleError(_0xb18586,_0x23f7f6){_0x23f7f6=_0x23f7f6||0x1f4;return function(_0x18a905){logger['error'](_0x18a905[_0x0d8b('0x2e')]);if(_0x18a905[_0x0d8b('0x2f')]){delete _0x18a905[_0x0d8b('0x2f')];}_0xb18586[_0x0d8b('0x26')](_0x23f7f6)[_0x0d8b('0x30')](_0x18a905);};}exports['index']=function(_0x3f1cb3,_0x1649fc){var _0x5ad0fe={},_0x1180ac={},_0x3cc3ee={'count':0x0,'rows':[]};var _0x188af2=db[_0x0d8b('0x31')][_0x0d8b('0x32')];_0x1180ac['model']=_['keys'](_0x188af2);_0x1180ac[_0x0d8b('0x33')]=_['keys'](_0x3f1cb3['query']);_0x1180ac[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x1180ac[_0x0d8b('0x36')],_0x1180ac[_0x0d8b('0x33')]);_0x5ad0fe[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0x1180ac['model'],qs[_0x0d8b('0x38')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x5ad0fe[_0x0d8b('0x37')]=_0x5ad0fe[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x5ad0fe[_0x0d8b('0x37')]:_0x1180ac['model'];if(!_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x5ad0fe[_0x0d8b('0x3c')]=qs['limit'](_0x3f1cb3[_0x0d8b('0x33')]['limit']);_0x5ad0fe[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x29')]);}_0x5ad0fe[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x3f1cb3[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x5ad0fe[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_['pick'](_0x3f1cb3['query'],_0x1180ac['filters']));if(_0x3f1cb3['query']['filter']){_0x5ad0fe[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x5ad0fe[_0x0d8b('0x3f')],{'$or':_['map'](_0x188af2,function(_0x4a76a3){if(_0x4a76a3[_0x0d8b('0x41')][_0x0d8b('0x42')]!==_0x0d8b('0x43')){var _0x513b93={};_0x513b93[_0x4a76a3[_0x0d8b('0x44')]]={'$like':'%'+_0x3f1cb3[_0x0d8b('0x33')]['filter']+'%'};return _0x513b93;}})});}_0x5ad0fe=_['merge']({},_0x5ad0fe,_0x3f1cb3[_0x0d8b('0x45')]);var _0x495870={'where':_0x5ad0fe[_0x0d8b('0x3f')]};return db['SugarcrmConfiguration']['count'](_0x495870)[_0x0d8b('0x1b')](function(_0x194f17){_0x3cc3ee['count']=_0x194f17;if(_0x3f1cb3['query']['includeAll']){_0x5ad0fe['include']=[{'all':!![]}];}return db[_0x0d8b('0x31')][_0x0d8b('0x46')](_0x5ad0fe);})[_0x0d8b('0x1b')](function(_0x490eda){_0x3cc3ee[_0x0d8b('0x47')]=_0x490eda;return _0x3cc3ee;})[_0x0d8b('0x1b')](respondWithFilteredResult(_0x1649fc,_0x5ad0fe))[_0x0d8b('0x24')](handleError(_0x1649fc,null));};exports[_0x0d8b('0x48')]=function(_0x423ecd,_0x2d5246){var _0x11d22b={'raw':![],'where':{'id':_0x423ecd[_0x0d8b('0x49')]['id']}},_0x1d5067={};_0x1d5067[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x31')][_0x0d8b('0x32')]);_0x1d5067[_0x0d8b('0x33')]=_[_0x0d8b('0x4a')](_0x423ecd[_0x0d8b('0x33')]);_0x1d5067[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x1d5067[_0x0d8b('0x36')],_0x1d5067['query']);_0x11d22b[_0x0d8b('0x37')]=_['intersection'](_0x1d5067['model'],qs[_0x0d8b('0x38')](_0x423ecd[_0x0d8b('0x33')][_0x0d8b('0x38')]));_0x11d22b[_0x0d8b('0x37')]=_0x11d22b['attributes'][_0x0d8b('0x39')]?_0x11d22b[_0x0d8b('0x37')]:_0x1d5067[_0x0d8b('0x36')];if(_0x423ecd[_0x0d8b('0x33')][_0x0d8b('0x4b')]){_0x11d22b['include']=[{'all':!![]}];}_0x11d22b=_['merge']({},_0x11d22b,_0x423ecd['options']);return db['SugarcrmConfiguration'][_0x0d8b('0x4c')](_0x11d22b)[_0x0d8b('0x1b')](handleEntityNotFound(_0x2d5246,null))['then'](respondWithResult(_0x2d5246,null))['catch'](handleError(_0x2d5246,null));};exports[_0x0d8b('0x4d')]=function(_0x3d3cb6,_0x5c5bd7){return db['SugarcrmConfiguration'][_0x0d8b('0x4d')](_0x3d3cb6[_0x0d8b('0x4e')],{})[_0x0d8b('0x1b')](respondWithResult(_0x5c5bd7,0xc9))[_0x0d8b('0x24')](handleError(_0x5c5bd7,null));};exports[_0x0d8b('0x4f')]=function(_0x506a79,_0x2de903){if(_0x506a79[_0x0d8b('0x4e')]['id']){delete _0x506a79['body']['id'];}return db['SugarcrmConfiguration'][_0x0d8b('0x4c')]({'where':{'id':_0x506a79[_0x0d8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x2de903,null))['then'](saveUpdates(_0x506a79[_0x0d8b('0x4e')],null))[_0x0d8b('0x1b')](respondWithResult(_0x2de903,null))[_0x0d8b('0x24')](handleError(_0x2de903,null));};exports[_0x0d8b('0x2c')]=function(_0x4a2989,_0x356b3d){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x4a2989[_0x0d8b('0x49')]['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x356b3d,null))['then'](removeEntity(_0x356b3d,null))['catch'](handleError(_0x356b3d,null));};exports[_0x0d8b('0x50')]=function(_0x3d7161,_0xccc2a9,_0x2c1eb0){var _0x3afc3a={};var _0xb66e76={};var _0x3978e5;var _0x3bead7;return db['SugarcrmConfiguration'][_0x0d8b('0x51')]({'where':{'id':_0x3d7161[_0x0d8b('0x49')]['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0xccc2a9,null))[_0x0d8b('0x1b')](function(_0x3fb9ea){if(_0x3fb9ea){_0x3978e5=_0x3fb9ea;_0xb66e76[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x52')][_0x0d8b('0x32')]);_0xb66e76['query']=_[_0x0d8b('0x4a')](_0x3d7161[_0x0d8b('0x33')]);_0xb66e76[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0xb66e76[_0x0d8b('0x36')],_0xb66e76['query']);_0x3afc3a[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0xb66e76[_0x0d8b('0x36')],qs[_0x0d8b('0x38')](_0x3d7161[_0x0d8b('0x33')]['fields']));_0x3afc3a['attributes']=_0x3afc3a[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x3afc3a[_0x0d8b('0x37')]:_0xb66e76[_0x0d8b('0x36')];_0x3afc3a['order']=qs[_0x0d8b('0x3e')](_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x3afc3a['where']=qs[_0x0d8b('0x34')](_['pick'](_0x3d7161[_0x0d8b('0x33')],_0xb66e76[_0x0d8b('0x34')]));if(_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x53')]){_0x3afc3a[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x3afc3a['where'],{'$or':_[_0x0d8b('0x54')](_0x3afc3a['attributes'],function(_0x71e8d8){var _0x4577c8={};_0x4577c8[_0x71e8d8]={'$like':'%'+_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x53')]+'%'};return _0x4577c8;})});}_0x3afc3a=_['merge']({},_0x3afc3a,_0x3d7161[_0x0d8b('0x45')]);return _0x3978e5[_0x0d8b('0x50')](_0x3afc3a);}})[_0x0d8b('0x1b')](function(_0x2332fc){if(_0x2332fc){_0x3bead7=_0x2332fc[_0x0d8b('0x39')];if(!_0x3d7161[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x3afc3a[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3c')](_0x3d7161['query']['limit']);_0x3afc3a[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x3d7161['query'][_0x0d8b('0x29')]);}return _0x3978e5['getFields'](_0x3afc3a);}})['then'](function(_0x22ee20){if(_0x22ee20){return _0x22ee20?{'count':_0x3bead7,'rows':_0x22ee20}:null;}})[_0x0d8b('0x1b')](respondWithResult(_0xccc2a9,null))['catch'](handleError(_0xccc2a9,null));};exports['getSubjects']=function(_0x1900e3,_0x1c007b,_0x70e4b2){var _0x435090={};var _0x2ab72b={};var _0x156859;var _0x40d265;return db['SugarcrmConfiguration'][_0x0d8b('0x51')]({'where':{'id':_0x1900e3['params']['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x1c007b,null))[_0x0d8b('0x1b')](function(_0x2bb690){if(_0x2bb690){_0x156859=_0x2bb690;_0x2ab72b[_0x0d8b('0x36')]=_['keys'](db[_0x0d8b('0x52')]['rawAttributes']);_0x2ab72b[_0x0d8b('0x33')]=_[_0x0d8b('0x4a')](_0x1900e3[_0x0d8b('0x33')]);_0x2ab72b[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x2ab72b[_0x0d8b('0x36')],_0x2ab72b[_0x0d8b('0x33')]);_0x435090[_0x0d8b('0x37')]=_[_0x0d8b('0x35')](_0x2ab72b[_0x0d8b('0x36')],qs['fields'](_0x1900e3[_0x0d8b('0x33')]['fields']));_0x435090[_0x0d8b('0x37')]=_0x435090[_0x0d8b('0x37')]['length']?_0x435090[_0x0d8b('0x37')]:_0x2ab72b['model'];_0x435090[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x435090[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_[_0x0d8b('0x55')](_0x1900e3[_0x0d8b('0x33')],_0x2ab72b['filters']));if(_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x53')]){_0x435090['where']=_[_0x0d8b('0x40')](_0x435090[_0x0d8b('0x3f')],{'$or':_[_0x0d8b('0x54')](_0x435090[_0x0d8b('0x37')],function(_0x16141a){var _0x9e44b4={};_0x9e44b4[_0x16141a]={'$like':'%'+_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x53')]+'%'};return _0x9e44b4;})});}_0x435090=_[_0x0d8b('0x40')]({},_0x435090,_0x1900e3[_0x0d8b('0x45')]);return _0x156859[_0x0d8b('0x56')](_0x435090);}})[_0x0d8b('0x1b')](function(_0x50c0ff){if(_0x50c0ff){_0x40d265=_0x50c0ff[_0x0d8b('0x39')];if(!_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3a')]('nolimit')){_0x435090['limit']=qs[_0x0d8b('0x3c')](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x3c')]);_0x435090['offset']=qs['offset'](_0x1900e3[_0x0d8b('0x33')][_0x0d8b('0x29')]);}return _0x156859[_0x0d8b('0x56')](_0x435090);}})[_0x0d8b('0x1b')](function(_0x2a2b58){if(_0x2a2b58){return _0x2a2b58?{'count':_0x40d265,'rows':_0x2a2b58}:null;}})[_0x0d8b('0x1b')](respondWithResult(_0x1c007b,null))[_0x0d8b('0x24')](handleError(_0x1c007b,null));};exports[_0x0d8b('0x57')]=function(_0x20a3dd,_0x3a5aea,_0x195901){var _0x291336={};var _0x3b060e={};var _0x5dbc6b;var _0x3d3b0b;return db[_0x0d8b('0x31')]['findOne']({'where':{'id':_0x20a3dd['params']['id']}})[_0x0d8b('0x1b')](handleEntityNotFound(_0x3a5aea,null))[_0x0d8b('0x1b')](function(_0x3573b4){if(_0x3573b4){_0x5dbc6b=_0x3573b4;_0x3b060e[_0x0d8b('0x36')]=_[_0x0d8b('0x4a')](db[_0x0d8b('0x52')]['rawAttributes']);_0x3b060e['query']=_['keys'](_0x20a3dd[_0x0d8b('0x33')]);_0x3b060e[_0x0d8b('0x34')]=_[_0x0d8b('0x35')](_0x3b060e[_0x0d8b('0x36')],_0x3b060e[_0x0d8b('0x33')]);_0x291336[_0x0d8b('0x37')]=_['intersection'](_0x3b060e[_0x0d8b('0x36')],qs[_0x0d8b('0x38')](_0x20a3dd['query'][_0x0d8b('0x38')]));_0x291336['attributes']=_0x291336[_0x0d8b('0x37')][_0x0d8b('0x39')]?_0x291336[_0x0d8b('0x37')]:_0x3b060e[_0x0d8b('0x36')];_0x291336[_0x0d8b('0x3d')]=qs[_0x0d8b('0x3e')](_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3e')]);_0x291336[_0x0d8b('0x3f')]=qs[_0x0d8b('0x34')](_[_0x0d8b('0x55')](_0x20a3dd[_0x0d8b('0x33')],_0x3b060e['filters']));if(_0x20a3dd['query'][_0x0d8b('0x53')]){_0x291336[_0x0d8b('0x3f')]=_[_0x0d8b('0x40')](_0x291336[_0x0d8b('0x3f')],{'$or':_[_0x0d8b('0x54')](_0x291336[_0x0d8b('0x37')],function(_0xeadc0c){var _0x54674f={};_0x54674f[_0xeadc0c]={'$like':'%'+_0x20a3dd[_0x0d8b('0x33')]['filter']+'%'};return _0x54674f;})});}_0x291336=_[_0x0d8b('0x40')]({},_0x291336,_0x20a3dd['options']);return _0x5dbc6b['getDescriptions'](_0x291336);}})[_0x0d8b('0x1b')](function(_0x460a36){if(_0x460a36){_0x3d3b0b=_0x460a36[_0x0d8b('0x39')];if(!_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3a')](_0x0d8b('0x3b'))){_0x291336[_0x0d8b('0x3c')]=qs[_0x0d8b('0x3c')](_0x20a3dd[_0x0d8b('0x33')][_0x0d8b('0x3c')]);_0x291336[_0x0d8b('0x29')]=qs[_0x0d8b('0x29')](_0x20a3dd['query'][_0x0d8b('0x29')]);}return _0x5dbc6b[_0x0d8b('0x57')](_0x291336);}})[_0x0d8b('0x1b')](function(_0x5eba19){if(_0x5eba19){return _0x5eba19?{'count':_0x3d3b0b,'rows':_0x5eba19}:null;}})['then'](respondWithResult(_0x3a5aea,null))[_0x0d8b('0x24')](handleError(_0x3a5aea,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9b91c53..00f1b61 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 _0x7c2d=['api','moment','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0x7c2d,0x1a1));var _0xd7c2=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7c2d[_0x38537f];return _0x141e23;};'use strict';var _=require(_0xd7c2('0x0'));var util=require(_0xd7c2('0x1'));var logger=require(_0xd7c2('0x2'))(_0xd7c2('0x3'));var moment=require(_0xd7c2('0x4'));var BPromise=require(_0xd7c2('0x5'));var rp=require(_0xd7c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7c2('0x7'));module[_0xd7c2('0x8')]=function(_0x174364,_0x468b8f){return _0x174364[_0xd7c2('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9417=['./intSugarcrmConfiguration.attributes','exports','define','lodash','util','api','bluebird','request-promise','path'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x9417,0xc0));var _0x7941=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x9417[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x7941('0x0'));var util=require(_0x7941('0x1'));var logger=require('../../config/logger')(_0x7941('0x2'));var moment=require('moment');var BPromise=require(_0x7941('0x3'));var rp=require(_0x7941('0x4'));var fs=require('fs');var path=require(_0x7941('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7941('0x6'));module[_0x7941('0x7')]=function(_0x17f3d1,_0x561929){return _0x17f3d1[_0x7941('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 59abb02..ba1ef84 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 _0xd609=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird'];(function(_0x2a261d,_0x4857a8){var _0x56dab0=function(_0x4ffa14){while(--_0x4ffa14){_0x2a261d['push'](_0x2a261d['shift']());}};_0x56dab0(++_0x4857a8);}(_0xd609,0x184));var _0x9d60=function(_0x41a36f,_0xe248f0){_0x41a36f=_0x41a36f-0x0;var _0x27a295=_0xd609[_0x41a36f];return _0x27a295;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var moment=require('moment');var BPromise=require(_0x9d60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d60('0x3'))['db'];var utils=require(_0x9d60('0x4'));var logger=require(_0x9d60('0x5'))(_0x9d60('0x6'));var config=require(_0x9d60('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d60('0x8')][_0x9d60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x403091,_0x44490e,_0x2cfdb2){return new BPromise(function(_0x2ca90f,_0x2cf2f8){return client['request'](_0x403091,_0x2cfdb2)['then'](function(_0x1a2d16){logger[_0x9d60('0xa')](_0x9d60('0xb'),_0x44490e,'request\x20sent');logger['debug'](_0x9d60('0xc'),_0x44490e,_0x9d60('0xd'),JSON['stringify'](_0x1a2d16));if(_0x1a2d16['error']){if(_0x1a2d16['error']['code']===0x1f4){logger[_0x9d60('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x44490e,_0x1a2d16['error']['message']);return _0x2cf2f8(_0x1a2d16[_0x9d60('0xe')][_0x9d60('0xf')]);}logger[_0x9d60('0xe')](_0x9d60('0xb'),_0x44490e,_0x1a2d16['error'][_0x9d60('0xf')]);return _0x2ca90f(_0x1a2d16['error'][_0x9d60('0xf')]);}else{logger[_0x9d60('0xa')](_0x9d60('0xb'),_0x44490e,'request\x20sent');_0x2ca90f(_0x1a2d16['result'][_0x9d60('0xf')]);}})[_0x9d60('0x10')](function(_0x5e5eca){logger[_0x9d60('0xe')](_0x9d60('0xb'),_0x44490e,_0x5e5eca);_0x2cf2f8(_0x5e5eca);});});} \ No newline at end of file +var _0xe56c=['../../config/logger','rpc','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe56c,0xa1));var _0xce56=function(_0x1c7fc9,_0x561e62){_0x1c7fc9=_0x1c7fc9-0x0;var _0x5b0bf1=_0xe56c[_0x1c7fc9];return _0x5b0bf1;};'use strict';var _=require('lodash');var util=require(_0xce56('0x0'));var moment=require(_0xce56('0x1'));var BPromise=require(_0xce56('0x2'));var rs=require(_0xce56('0x3'));var fs=require('fs');var Redis=require(_0xce56('0x4'));var db=require(_0xce56('0x5'))['db'];var utils=require(_0xce56('0x6'));var logger=require(_0xce56('0x7'))(_0xce56('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce56('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce4fa,_0x139689,_0x1095f8){return new BPromise(function(_0x374565,_0x4e6e31){return client[_0xce56('0xa')](_0x1ce4fa,_0x1095f8)['then'](function(_0x497a26){logger[_0xce56('0xb')](_0xce56('0xc'),_0x139689,_0xce56('0xd'));logger[_0xce56('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x139689,_0xce56('0xd'),JSON[_0xce56('0xf')](_0x497a26));if(_0x497a26[_0xce56('0x10')]){if(_0x497a26[_0xce56('0x10')][_0xce56('0x11')]===0x1f4){logger[_0xce56('0x10')](_0xce56('0xc'),_0x139689,_0x497a26['error']['message']);return _0x4e6e31(_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);}logger['error'](_0xce56('0xc'),_0x139689,_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);return _0x374565(_0x497a26[_0xce56('0x10')][_0xce56('0x12')]);}else{logger[_0xce56('0xb')](_0xce56('0xc'),_0x139689,_0xce56('0xd'));_0x374565(_0x497a26[_0xce56('0x13')][_0xce56('0x12')]);}})[_0xce56('0x14')](function(_0x2c764e){logger[_0xce56('0x10')](_0xce56('0xc'),_0x139689,_0x2c764e);_0x4e6e31(_0x2c764e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6543156..e504275 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 _0x627f=['exports','path','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x2cf7f3,_0x5b3ffc){var _0x17cb68=function(_0x3a41bd){while(--_0x3a41bd){_0x2cf7f3['push'](_0x2cf7f3['shift']());}};_0x17cb68(++_0x5b3ffc);}(_0x627f,0xb7));var _0xf627=function(_0x41d9a8,_0x386c27){_0x41d9a8=_0x41d9a8-0x0;var _0x146498=_0x627f[_0x41d9a8];return _0x146498;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf627('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf627('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf627('0x2'));var config=require(_0xf627('0x3'));var controller=require(_0xf627('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xf627('0x5')]);router[_0xf627('0x6')](_0xf627('0x7'),auth[_0xf627('0x8')](),controller[_0xf627('0x9')]);router[_0xf627('0xa')]('/',auth[_0xf627('0x8')](),controller[_0xf627('0xb')]);router['put']('/:id',auth[_0xf627('0x8')](),controller[_0xf627('0xc')]);router['delete'](_0xf627('0x7'),auth[_0xf627('0x8')](),controller['destroy']);module[_0xf627('0xd')]=router; \ No newline at end of file +var _0x12fe=['get','index','/:id','isAuthenticated','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller'];(function(_0x53d743,_0x4ac86f){var _0xab2a7=function(_0x302bdf){while(--_0x302bdf){_0x53d743['push'](_0x53d743['shift']());}};_0xab2a7(++_0x4ac86f);}(_0x12fe,0x1e8));var _0xe12f=function(_0x122366,_0x3cd609){_0x122366=_0x122366-0x0;var _0xfdf8ee=_0x12fe[_0x122366];return _0xfdf8ee;};'use strict';var multer=require('multer');var util=require(_0xe12f('0x0'));var path=require('path');var timeout=require(_0xe12f('0x1'));var express=require(_0xe12f('0x2'));var router=express[_0xe12f('0x3')]();var auth=require(_0xe12f('0x4'));var interaction=require(_0xe12f('0x5'));var config=require('../../config/environment');var controller=require(_0xe12f('0x6'));router[_0xe12f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe12f('0x8')]);router[_0xe12f('0x7')](_0xe12f('0x9'),auth[_0xe12f('0xa')](),controller['show']);router['post']('/',auth[_0xe12f('0xa')](),controller['create']);router[_0xe12f('0xb')](_0xe12f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe12f('0xc')](_0xe12f('0x9'),auth[_0xe12f('0xa')](),controller[_0xe12f('0xd')]);module[_0xe12f('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index ad0ec9c..aeb3ce8 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 _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x26d335,_0x1cd183){var _0x5b25b7=function(_0x3d0d8c){while(--_0x3d0d8c){_0x26d335['push'](_0x26d335['shift']());}};_0x5b25b7(++_0x1cd183);}(_0x750a,0x140));var _0xa750=function(_0x2d94b1,_0x29bbad){_0x2d94b1=_0x2d94b1-0x0;var _0x3a1d08=_0x750a[_0x2d94b1];return _0x3a1d08;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x91a7=['STRING','exports','ENUM','string','customVariable'];(function(_0x2712c3,_0x37d83c){var _0x177596=function(_0x2f414b){while(--_0x2f414b){_0x2712c3['push'](_0x2712c3['shift']());}};_0x177596(++_0x37d83c);}(_0x91a7,0xe7));var _0x791a=function(_0x17b460,_0x4bb923){_0x17b460=_0x17b460-0x0;var _0x5e15a7=_0x91a7[_0x17b460];return _0x5e15a7;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'type':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'),'keyValue'),'defaultValue':_0x791a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x791a('0x1')](_0x791a('0x2'),'variable',_0x791a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x791a('0x4')]},'nameField':{'type':Sequelize[_0x791a('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x791a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 2aa2f50..b459b0d 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 _0xbcdb=['map','type','key','field','options','include','then','rows','catch','show','rawAttributes','length','includeAll','create','body','find','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','error','stack','name','send','index','SugarcrmField','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0xab41a6,_0x46b9f0){var _0x5cda36=function(_0x4228e7){while(--_0x4228e7){_0xab41a6['push'](_0xab41a6['shift']());}};_0x5cda36(++_0x46b9f0);}(_0xbcdb,0xa8));var _0xbbcd=function(_0x2808c3,_0xfbf446){_0x2808c3=_0x2808c3-0x0;var _0x490a96=_0xbcdb[_0x2808c3];return _0x490a96;};'use strict';var pdf=require(_0xbbcd('0x0'));var emlformat=require(_0xbbcd('0x1'));var rimraf=require(_0xbbcd('0x2'));var zipdir=require(_0xbbcd('0x3'));var jsonpatch=require(_0xbbcd('0x4'));var rp=require(_0xbbcd('0x5'));var moment=require('moment');var BPromise=require(_0xbbcd('0x6'));var Mustache=require('mustache');var util=require(_0xbbcd('0x7'));var path=require(_0xbbcd('0x8'));var sox=require('sox');var csv=require(_0xbbcd('0x9'));var ejs=require(_0xbbcd('0xa'));var fs=require('fs');var _=require(_0xbbcd('0xb'));var squel=require('squel');var crypto=require(_0xbbcd('0xc'));var jsforce=require(_0xbbcd('0xd'));var deskjs=require(_0xbbcd('0xe'));var toCsv=require(_0xbbcd('0x9'));var querystring=require(_0xbbcd('0xf'));var Papa=require(_0xbbcd('0x10'));var Redis=require('ioredis');var authService=require(_0xbbcd('0x11'));var qs=require(_0xbbcd('0x12'));var hardwareService=require(_0xbbcd('0x13'));var logger=require(_0xbbcd('0x14'))(_0xbbcd('0x15'));var utils=require(_0xbbcd('0x16'));var config=require(_0xbbcd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52e8a9,_0x3a462e){_0x3a462e=_0x3a462e||0xcc;return function(_0x201af4){if(_0x201af4){return _0x52e8a9[_0xbbcd('0x18')](_0x3a462e);}return _0x52e8a9[_0xbbcd('0x19')](_0x3a462e)[_0xbbcd('0x1a')]();};}function respondWithResult(_0x4cfe60,_0x100cbe){_0x100cbe=_0x100cbe||0xc8;return function(_0x42ee94){if(_0x42ee94){return _0x4cfe60[_0xbbcd('0x19')](_0x100cbe)[_0xbbcd('0x1b')](_0x42ee94);}};}function respondWithFilteredResult(_0x51a01e,_0x282937){return function(_0x134b64){if(_0x134b64){var _0x1df67a=_0x134b64[_0xbbcd('0x1c')],_0x3d573c=_0x282937['offset'],_0x4eccfa=_0x282937[_0xbbcd('0x1d')]+_0x282937[_0xbbcd('0x1e')],_0x191901;if(_0x4eccfa>=_0x1df67a){_0x4eccfa=_0x1df67a;_0x191901=0xc8;}else{_0x191901=0xce;}_0x51a01e[_0xbbcd('0x19')](_0x191901);return _0x51a01e[_0xbbcd('0x1f')](_0xbbcd('0x20'),_0x3d573c+'-'+_0x4eccfa+'/'+_0x1df67a)['json'](_0x134b64);}return null;};}function patchUpdates(_0x4a87c9){return function(_0x41a0e9){try{jsonpatch[_0xbbcd('0x21')](_0x41a0e9,_0x4a87c9,!![]);}catch(_0x423169){return BPromise['reject'](_0x423169);}return _0x41a0e9[_0xbbcd('0x22')]();};}function saveUpdates(_0x4b3a66,_0x1c1b78){return function(_0x56de41){if(_0x56de41){return _0x56de41[_0xbbcd('0x23')](_0x4b3a66)['then'](function(_0x4a2b6b){return _0x4a2b6b;});}return null;};}function removeEntity(_0x23767a,_0x1f1351){return function(_0x3a94d1){if(_0x3a94d1){return _0x3a94d1['destroy']()['then'](function(){_0x23767a['status'](0xcc)[_0xbbcd('0x1a')]();});}};}function handleEntityNotFound(_0x4edbfe,_0x2bafbe){return function(_0x216878){if(!_0x216878){_0x4edbfe[_0xbbcd('0x18')](0x194);}return _0x216878;};}function handleError(_0x5a1a70,_0x3f578d){_0x3f578d=_0x3f578d||0x1f4;return function(_0x1d0f1d){logger[_0xbbcd('0x24')](_0x1d0f1d[_0xbbcd('0x25')]);if(_0x1d0f1d[_0xbbcd('0x26')]){delete _0x1d0f1d[_0xbbcd('0x26')];}_0x5a1a70[_0xbbcd('0x19')](_0x3f578d)[_0xbbcd('0x27')](_0x1d0f1d);};}exports[_0xbbcd('0x28')]=function(_0x5c35f1,_0x4863be){var _0xa65ba6={},_0x25e17b={},_0x53fc6d={'count':0x0,'rows':[]};var _0x256ce2=db[_0xbbcd('0x29')]['rawAttributes'];_0x25e17b[_0xbbcd('0x2a')]=_[_0xbbcd('0x2b')](_0x256ce2);_0x25e17b[_0xbbcd('0x2c')]=_[_0xbbcd('0x2b')](_0x5c35f1[_0xbbcd('0x2c')]);_0x25e17b['filters']=_[_0xbbcd('0x2d')](_0x25e17b[_0xbbcd('0x2a')],_0x25e17b[_0xbbcd('0x2c')]);_0xa65ba6[_0xbbcd('0x2e')]=_['intersection'](_0x25e17b[_0xbbcd('0x2a')],qs[_0xbbcd('0x2f')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x2f')]));_0xa65ba6[_0xbbcd('0x2e')]=_0xa65ba6[_0xbbcd('0x2e')]['length']?_0xa65ba6[_0xbbcd('0x2e')]:_0x25e17b[_0xbbcd('0x2a')];if(!_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x30')](_0xbbcd('0x31'))){_0xa65ba6[_0xbbcd('0x1e')]=qs[_0xbbcd('0x1e')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x1e')]);_0xa65ba6['offset']=qs['offset'](_0x5c35f1[_0xbbcd('0x2c')]['offset']);}_0xa65ba6[_0xbbcd('0x32')]=qs[_0xbbcd('0x33')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x33')]);_0xa65ba6[_0xbbcd('0x34')]=qs[_0xbbcd('0x35')](_[_0xbbcd('0x36')](_0x5c35f1[_0xbbcd('0x2c')],_0x25e17b['filters']));if(_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x37')]){_0xa65ba6[_0xbbcd('0x34')]=_[_0xbbcd('0x38')](_0xa65ba6[_0xbbcd('0x34')],{'$or':_[_0xbbcd('0x39')](_0x256ce2,function(_0x5897a8){if(_0x5897a8[_0xbbcd('0x3a')][_0xbbcd('0x3b')]!=='VIRTUAL'){var _0x127a76={};_0x127a76[_0x5897a8[_0xbbcd('0x3c')]]={'$like':'%'+_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x37')]+'%'};return _0x127a76;}})});}_0xa65ba6=_[_0xbbcd('0x38')]({},_0xa65ba6,_0x5c35f1[_0xbbcd('0x3d')]);var _0x5a5857={'where':_0xa65ba6[_0xbbcd('0x34')]};return db['SugarcrmField'][_0xbbcd('0x1c')](_0x5a5857)['then'](function(_0x57de42){_0x53fc6d['count']=_0x57de42;if(_0x5c35f1[_0xbbcd('0x2c')]['includeAll']){_0xa65ba6[_0xbbcd('0x3e')]=[{'all':!![]}];}return db[_0xbbcd('0x29')]['findAll'](_0xa65ba6);})[_0xbbcd('0x3f')](function(_0x27d3b2){_0x53fc6d[_0xbbcd('0x40')]=_0x27d3b2;return _0x53fc6d;})[_0xbbcd('0x3f')](respondWithFilteredResult(_0x4863be,_0xa65ba6))[_0xbbcd('0x41')](handleError(_0x4863be,null));};exports[_0xbbcd('0x42')]=function(_0x4d41ea,_0x35ea0f){var _0x1fa1cc={'raw':!![],'where':{'id':_0x4d41ea['params']['id']}},_0x137db2={};_0x137db2['model']=_[_0xbbcd('0x2b')](db[_0xbbcd('0x29')][_0xbbcd('0x43')]);_0x137db2[_0xbbcd('0x2c')]=_[_0xbbcd('0x2b')](_0x4d41ea['query']);_0x137db2[_0xbbcd('0x35')]=_[_0xbbcd('0x2d')](_0x137db2[_0xbbcd('0x2a')],_0x137db2[_0xbbcd('0x2c')]);_0x1fa1cc[_0xbbcd('0x2e')]=_[_0xbbcd('0x2d')](_0x137db2[_0xbbcd('0x2a')],qs[_0xbbcd('0x2f')](_0x4d41ea[_0xbbcd('0x2c')]['fields']));_0x1fa1cc[_0xbbcd('0x2e')]=_0x1fa1cc['attributes'][_0xbbcd('0x44')]?_0x1fa1cc[_0xbbcd('0x2e')]:_0x137db2[_0xbbcd('0x2a')];if(_0x4d41ea[_0xbbcd('0x2c')][_0xbbcd('0x45')]){_0x1fa1cc['include']=[{'all':!![]}];}_0x1fa1cc=_['merge']({},_0x1fa1cc,_0x4d41ea['options']);return db[_0xbbcd('0x29')]['find'](_0x1fa1cc)[_0xbbcd('0x3f')](handleEntityNotFound(_0x35ea0f,null))[_0xbbcd('0x3f')](respondWithResult(_0x35ea0f,null))[_0xbbcd('0x41')](handleError(_0x35ea0f,null));};exports[_0xbbcd('0x46')]=function(_0x3fd691,_0x3fea6b){return db[_0xbbcd('0x29')][_0xbbcd('0x46')](_0x3fd691[_0xbbcd('0x47')],{})[_0xbbcd('0x3f')](respondWithResult(_0x3fea6b,0xc9))[_0xbbcd('0x41')](handleError(_0x3fea6b,null));};exports[_0xbbcd('0x23')]=function(_0x3d93d3,_0x237603){if(_0x3d93d3['body']['id']){delete _0x3d93d3['body']['id'];}return db[_0xbbcd('0x29')][_0xbbcd('0x48')]({'where':{'id':_0x3d93d3[_0xbbcd('0x49')]['id']}})[_0xbbcd('0x3f')](handleEntityNotFound(_0x237603,null))[_0xbbcd('0x3f')](saveUpdates(_0x3d93d3[_0xbbcd('0x47')],null))[_0xbbcd('0x3f')](respondWithResult(_0x237603,null))[_0xbbcd('0x41')](handleError(_0x237603,null));};exports[_0xbbcd('0x4a')]=function(_0x524122,_0xf1ec2){return db[_0xbbcd('0x29')]['find']({'where':{'id':_0x524122['params']['id']}})[_0xbbcd('0x3f')](handleEntityNotFound(_0xf1ec2,null))['then'](removeEntity(_0xf1ec2,null))[_0xbbcd('0x41')](handleError(_0xf1ec2,null));}; \ No newline at end of file +var _0xbc94=['params','keys','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','index','SugarcrmField','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show'];(function(_0x361858,_0x5435fa){var _0x49961e=function(_0x5214e1){while(--_0x5214e1){_0x361858['push'](_0x361858['shift']());}};_0x49961e(++_0x5435fa);}(_0xbc94,0x151));var _0x4bc9=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0xbc94[_0x382d8e];return _0x23993d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4bc9('0x0'));var rimraf=require(_0x4bc9('0x1'));var zipdir=require(_0x4bc9('0x2'));var jsonpatch=require(_0x4bc9('0x3'));var rp=require('request-promise');var moment=require(_0x4bc9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bc9('0x5'));var util=require(_0x4bc9('0x6'));var path=require(_0x4bc9('0x7'));var sox=require('sox');var csv=require(_0x4bc9('0x8'));var ejs=require(_0x4bc9('0x9'));var fs=require('fs');var _=require(_0x4bc9('0xa'));var squel=require(_0x4bc9('0xb'));var crypto=require(_0x4bc9('0xc'));var jsforce=require(_0x4bc9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4bc9('0xe'));var authService=require(_0x4bc9('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4bc9('0x10'));var db=require(_0x4bc9('0x11'))['db'];function respondWithStatusCode(_0x11f8b5,_0x4526dc){_0x4526dc=_0x4526dc||0xcc;return function(_0xc7257a){if(_0xc7257a){return _0x11f8b5['sendStatus'](_0x4526dc);}return _0x11f8b5['status'](_0x4526dc)[_0x4bc9('0x12')]();};}function respondWithResult(_0x39b9b5,_0x4cab3e){_0x4cab3e=_0x4cab3e||0xc8;return function(_0x2dc921){if(_0x2dc921){return _0x39b9b5['status'](_0x4cab3e)[_0x4bc9('0x13')](_0x2dc921);}};}function respondWithFilteredResult(_0x567cd4,_0x3c84b1){return function(_0x4d9686){if(_0x4d9686){var _0x1b16e8=_0x4d9686[_0x4bc9('0x14')],_0xb7ff1d=_0x3c84b1[_0x4bc9('0x15')],_0x5ad67e=_0x3c84b1['offset']+_0x3c84b1[_0x4bc9('0x16')],_0x5be0b6;if(_0x5ad67e>=_0x1b16e8){_0x5ad67e=_0x1b16e8;_0x5be0b6=0xc8;}else{_0x5be0b6=0xce;}_0x567cd4[_0x4bc9('0x17')](_0x5be0b6);return _0x567cd4[_0x4bc9('0x18')](_0x4bc9('0x19'),_0xb7ff1d+'-'+_0x5ad67e+'/'+_0x1b16e8)['json'](_0x4d9686);}return null;};}function patchUpdates(_0x4dbffc){return function(_0x1728c0){try{jsonpatch[_0x4bc9('0x1a')](_0x1728c0,_0x4dbffc,!![]);}catch(_0x22bcd6){return BPromise['reject'](_0x22bcd6);}return _0x1728c0[_0x4bc9('0x1b')]();};}function saveUpdates(_0x362612,_0x2ff675){return function(_0x3d21d3){if(_0x3d21d3){return _0x3d21d3['update'](_0x362612)['then'](function(_0x515bf9){return _0x515bf9;});}return null;};}function removeEntity(_0x32b103,_0x12b744){return function(_0xa7c91d){if(_0xa7c91d){return _0xa7c91d[_0x4bc9('0x1c')]()[_0x4bc9('0x1d')](function(){_0x32b103[_0x4bc9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1654e0,_0x394132){return function(_0x5a5de2){if(!_0x5a5de2){_0x1654e0[_0x4bc9('0x1e')](0x194);}return _0x5a5de2;};}function handleError(_0x29c07e,_0x191594){_0x191594=_0x191594||0x1f4;return function(_0x2c5e98){logger[_0x4bc9('0x1f')](_0x2c5e98[_0x4bc9('0x20')]);if(_0x2c5e98[_0x4bc9('0x21')]){delete _0x2c5e98['name'];}_0x29c07e['status'](_0x191594)['send'](_0x2c5e98);};}exports[_0x4bc9('0x22')]=function(_0x6718c2,_0x17fcb7){var _0x144509={},_0xc3b62d={},_0x4ac3e4={'count':0x0,'rows':[]};var _0x44e9e6=db[_0x4bc9('0x23')][_0x4bc9('0x24')];_0xc3b62d[_0x4bc9('0x25')]=_['keys'](_0x44e9e6);_0xc3b62d['query']=_['keys'](_0x6718c2[_0x4bc9('0x26')]);_0xc3b62d[_0x4bc9('0x27')]=_[_0x4bc9('0x28')](_0xc3b62d[_0x4bc9('0x25')],_0xc3b62d['query']);_0x144509['attributes']=_[_0x4bc9('0x28')](_0xc3b62d[_0x4bc9('0x25')],qs[_0x4bc9('0x29')](_0x6718c2[_0x4bc9('0x26')]['fields']));_0x144509[_0x4bc9('0x2a')]=_0x144509['attributes'][_0x4bc9('0x2b')]?_0x144509[_0x4bc9('0x2a')]:_0xc3b62d[_0x4bc9('0x25')];if(!_0x6718c2[_0x4bc9('0x26')]['hasOwnProperty'](_0x4bc9('0x2c'))){_0x144509[_0x4bc9('0x16')]=qs[_0x4bc9('0x16')](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x16')]);_0x144509[_0x4bc9('0x15')]=qs['offset'](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x15')]);}_0x144509[_0x4bc9('0x2d')]=qs['sort'](_0x6718c2[_0x4bc9('0x26')][_0x4bc9('0x2e')]);_0x144509[_0x4bc9('0x2f')]=qs[_0x4bc9('0x27')](_['pick'](_0x6718c2[_0x4bc9('0x26')],_0xc3b62d[_0x4bc9('0x27')]));if(_0x6718c2[_0x4bc9('0x26')]['filter']){_0x144509[_0x4bc9('0x2f')]=_[_0x4bc9('0x30')](_0x144509[_0x4bc9('0x2f')],{'$or':_[_0x4bc9('0x31')](_0x44e9e6,function(_0x3391d0){if(_0x3391d0[_0x4bc9('0x32')][_0x4bc9('0x33')]!==_0x4bc9('0x34')){var _0x5ac5d0={};_0x5ac5d0[_0x3391d0[_0x4bc9('0x35')]]={'$like':'%'+_0x6718c2[_0x4bc9('0x26')]['filter']+'%'};return _0x5ac5d0;}})});}_0x144509=_[_0x4bc9('0x30')]({},_0x144509,_0x6718c2['options']);var _0x5df915={'where':_0x144509['where']};return db['SugarcrmField'][_0x4bc9('0x14')](_0x5df915)[_0x4bc9('0x1d')](function(_0x2dddba){_0x4ac3e4['count']=_0x2dddba;if(_0x6718c2['query'][_0x4bc9('0x36')]){_0x144509[_0x4bc9('0x37')]=[{'all':!![]}];}return db[_0x4bc9('0x23')]['findAll'](_0x144509);})[_0x4bc9('0x1d')](function(_0x4b0f07){_0x4ac3e4[_0x4bc9('0x38')]=_0x4b0f07;return _0x4ac3e4;})[_0x4bc9('0x1d')](respondWithFilteredResult(_0x17fcb7,_0x144509))[_0x4bc9('0x39')](handleError(_0x17fcb7,null));};exports[_0x4bc9('0x3a')]=function(_0x2bf529,_0xb5c55){var _0xd32cd1={'raw':!![],'where':{'id':_0x2bf529[_0x4bc9('0x3b')]['id']}},_0x56b615={};_0x56b615[_0x4bc9('0x25')]=_['keys'](db[_0x4bc9('0x23')]['rawAttributes']);_0x56b615[_0x4bc9('0x26')]=_[_0x4bc9('0x3c')](_0x2bf529['query']);_0x56b615[_0x4bc9('0x27')]=_[_0x4bc9('0x28')](_0x56b615['model'],_0x56b615[_0x4bc9('0x26')]);_0xd32cd1[_0x4bc9('0x2a')]=_['intersection'](_0x56b615[_0x4bc9('0x25')],qs[_0x4bc9('0x29')](_0x2bf529[_0x4bc9('0x26')][_0x4bc9('0x29')]));_0xd32cd1[_0x4bc9('0x2a')]=_0xd32cd1[_0x4bc9('0x2a')][_0x4bc9('0x2b')]?_0xd32cd1[_0x4bc9('0x2a')]:_0x56b615[_0x4bc9('0x25')];if(_0x2bf529['query'][_0x4bc9('0x36')]){_0xd32cd1[_0x4bc9('0x37')]=[{'all':!![]}];}_0xd32cd1=_[_0x4bc9('0x30')]({},_0xd32cd1,_0x2bf529[_0x4bc9('0x3d')]);return db['SugarcrmField']['find'](_0xd32cd1)[_0x4bc9('0x1d')](handleEntityNotFound(_0xb5c55,null))[_0x4bc9('0x1d')](respondWithResult(_0xb5c55,null))[_0x4bc9('0x39')](handleError(_0xb5c55,null));};exports[_0x4bc9('0x3e')]=function(_0x38f792,_0x5a7899){return db[_0x4bc9('0x23')]['create'](_0x38f792[_0x4bc9('0x3f')],{})[_0x4bc9('0x1d')](respondWithResult(_0x5a7899,0xc9))[_0x4bc9('0x39')](handleError(_0x5a7899,null));};exports[_0x4bc9('0x40')]=function(_0xe37839,_0xb6361){if(_0xe37839[_0x4bc9('0x3f')]['id']){delete _0xe37839[_0x4bc9('0x3f')]['id'];}return db[_0x4bc9('0x23')][_0x4bc9('0x41')]({'where':{'id':_0xe37839['params']['id']}})[_0x4bc9('0x1d')](handleEntityNotFound(_0xb6361,null))[_0x4bc9('0x1d')](saveUpdates(_0xe37839['body'],null))[_0x4bc9('0x1d')](respondWithResult(_0xb6361,null))['catch'](handleError(_0xb6361,null));};exports['destroy']=function(_0x53fb72,_0x1d0713){return db[_0x4bc9('0x23')]['find']({'where':{'id':_0x53fb72['params']['id']}})['then'](handleEntityNotFound(_0x1d0713,null))[_0x4bc9('0x1d')](removeEntity(_0x1d0713,null))[_0x4bc9('0x39')](handleError(_0x1d0713,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 691c22d..32c0c06 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 _0xf744=['api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x47397f,_0x45ba05){var _0xba5ff1=function(_0x4e139a){while(--_0x4e139a){_0x47397f['push'](_0x47397f['shift']());}};_0xba5ff1(++_0x45ba05);}(_0xf744,0x1be));var _0x4f74=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xf744[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x4f74('0x0'));var logger=require(_0x4f74('0x1'))(_0x4f74('0x2'));var moment=require('moment');var BPromise=require(_0x4f74('0x3'));var rp=require(_0x4f74('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f74('0x5'));var config=require(_0x4f74('0x6'));var attributes=require(_0x4f74('0x7'));module[_0x4f74('0x8')]=function(_0x13bb65,_0x40569d){return _0x13bb65[_0x4f74('0x9')](_0x4f74('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x4f74('0xb'),'fields':[_0x4f74('0xc'),_0x4f74('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x22b1=['path','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','moment','bluebird'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x22b1,0x170));var _0x122b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x22b1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x122b('0x0'));var util=require('util');var logger=require(_0x122b('0x1'))('api');var moment=require(_0x122b('0x2'));var BPromise=require(_0x122b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x122b('0x4'));var rimraf=require('rimraf');var config=require(_0x122b('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x122b('0x6')]=function(_0x50153c,_0x5d0295){return _0x50153c[_0x122b('0x7')](_0x122b('0x8'),attributes,{'tableName':_0x122b('0x9'),'paranoid':![],'indexes':[{'name':_0x122b('0xa'),'fields':[_0x122b('0xb'),'FieldId'],'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 f640dea..0e3e892 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 _0x501c=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x113664,_0x43c8ca){var _0x4210f4=function(_0x3d2f51){while(--_0x3d2f51){_0x113664['push'](_0x113664['shift']());}};_0x4210f4(++_0x43c8ca);}(_0x501c,0x7a));var _0xc501=function(_0x4d446d,_0x289bbd){_0x4d446d=_0x4d446d-0x0;var _0x3314e8=_0x501c[_0x4d446d];return _0x3314e8;};'use strict';var _=require(_0xc501('0x0'));var util=require(_0xc501('0x1'));var moment=require(_0xc501('0x2'));var BPromise=require(_0xc501('0x3'));var rs=require(_0xc501('0x4'));var fs=require('fs');var Redis=require(_0xc501('0x5'));var db=require(_0xc501('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc501('0x7'))(_0xc501('0x8'));var config=require(_0xc501('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc501('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27e026,_0x42227b,_0xcd0c08){return new BPromise(function(_0xbbb1e7,_0x16101d){return client[_0xc501('0xb')](_0x27e026,_0xcd0c08)[_0xc501('0xc')](function(_0x39fb82){logger[_0xc501('0xd')](_0xc501('0xe'),_0x42227b,'request\x20sent');logger[_0xc501('0xf')](_0xc501('0x10'),_0x42227b,_0xc501('0x11'),JSON['stringify'](_0x39fb82));if(_0x39fb82[_0xc501('0x12')]){if(_0x39fb82[_0xc501('0x12')][_0xc501('0x13')]===0x1f4){logger[_0xc501('0x12')](_0xc501('0xe'),_0x42227b,_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);return _0x16101d(_0x39fb82['error'][_0xc501('0x14')]);}logger[_0xc501('0x12')](_0xc501('0xe'),_0x42227b,_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);return _0xbbb1e7(_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);}else{logger[_0xc501('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x42227b,_0xc501('0x11'));_0xbbb1e7(_0x39fb82[_0xc501('0x15')][_0xc501('0x14')]);}})[_0xc501('0x16')](function(_0x42f213){logger['error'](_0xc501('0xe'),_0x42227b,_0x42f213);_0x16101d(_0x42f213);});});} \ No newline at end of file +var _0xfb89=['ioredis','rpc','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x4d7dc1,_0x5c630f){var _0x9ea7f0=function(_0x2d1c1){while(--_0x2d1c1){_0x4d7dc1['push'](_0x4d7dc1['shift']());}};_0x9ea7f0(++_0x5c630f);}(_0xfb89,0x1f3));var _0x9fb8=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xfb89[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0x9fb8('0x0'));var util=require(_0x9fb8('0x1'));var moment=require(_0x9fb8('0x2'));var BPromise=require(_0x9fb8('0x3'));var rs=require(_0x9fb8('0x4'));var fs=require('fs');var Redis=require(_0x9fb8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fb8('0x6'));var config=require('../../config/environment');var jayson=require(_0x9fb8('0x7'));var client=jayson[_0x9fb8('0x8')][_0x9fb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3287aa,_0x5e078a,_0x54b4b1){return new BPromise(function(_0x132a40,_0x5a1067){return client[_0x9fb8('0xa')](_0x3287aa,_0x54b4b1)[_0x9fb8('0xb')](function(_0x485e3b){logger[_0x9fb8('0xc')](_0x9fb8('0xd'),_0x5e078a,_0x9fb8('0xe'));logger[_0x9fb8('0xf')](_0x9fb8('0x10'),_0x5e078a,_0x9fb8('0xe'),JSON[_0x9fb8('0x11')](_0x485e3b));if(_0x485e3b[_0x9fb8('0x12')]){if(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x13')]===0x1f4){logger[_0x9fb8('0x12')](_0x9fb8('0xd'),_0x5e078a,_0x485e3b['error'][_0x9fb8('0x14')]);return _0x5a1067(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x14')]);}logger[_0x9fb8('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x5e078a,_0x485e3b['error'][_0x9fb8('0x14')]);return _0x132a40(_0x485e3b[_0x9fb8('0x12')][_0x9fb8('0x14')]);}else{logger[_0x9fb8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x5e078a,'request\x20sent');_0x132a40(_0x485e3b['result'][_0x9fb8('0x14')]);}})['catch'](function(_0x58e349){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5e078a,_0x58e349);_0x5a1067(_0x58e349);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index f9030eb..7158aac 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 _0x5ab4=['index','get','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x5ab4,0x12b));var _0x45ab=function(_0x2b8a28,_0x1dd421){_0x2b8a28=_0x2b8a28-0x0;var _0x1299bd=_0x5ab4[_0x2b8a28];return _0x1299bd;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var auth=require(_0x45ab('0x5'));var interaction=require(_0x45ab('0x6'));var config=require(_0x45ab('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x45ab('0x8')](),controller[_0x45ab('0x9')]);router[_0x45ab('0xa')]('/:id',auth[_0x45ab('0x8')](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0x8')](),controller['getConfigurations']);router[_0x45ab('0xa')](_0x45ab('0xd'),auth['isAuthenticated'](),controller[_0x45ab('0xe')]);router[_0x45ab('0xf')]('/',auth[_0x45ab('0x8')](),controller['create']);router['post'](_0x45ab('0xc'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x10')]);router['put'](_0x45ab('0x11'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x12')]);router[_0x45ab('0x13')](_0x45ab('0x11'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x14')]);module[_0x45ab('0x15')]=router; \ No newline at end of file +var _0x44f4=['delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0x44f4,0x178));var _0x444f=function(_0x1de14f,_0x55464a){_0x1de14f=_0x1de14f-0x0;var _0x283d61=_0x44f4[_0x1de14f];return _0x283d61;};'use strict';var multer=require(_0x444f('0x0'));var util=require(_0x444f('0x1'));var path=require('path');var timeout=require(_0x444f('0x2'));var express=require(_0x444f('0x3'));var router=express[_0x444f('0x4')]();var auth=require(_0x444f('0x5'));var interaction=require(_0x444f('0x6'));var config=require(_0x444f('0x7'));var controller=require(_0x444f('0x8'));router['get']('/',auth[_0x444f('0x9')](),controller['index']);router[_0x444f('0xa')](_0x444f('0xb'),auth[_0x444f('0x9')](),controller[_0x444f('0xc')]);router[_0x444f('0xa')]('/:id/configurations',auth[_0x444f('0x9')](),controller[_0x444f('0xd')]);router[_0x444f('0xa')](_0x444f('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x444f('0xf')]('/',auth['isAuthenticated'](),controller[_0x444f('0x10')]);router[_0x444f('0xf')]('/:id/configurations',auth[_0x444f('0x9')](),controller[_0x444f('0x11')]);router[_0x444f('0x12')](_0x444f('0xb'),auth['isAuthenticated'](),controller[_0x444f('0x13')]);router[_0x444f('0x14')](_0x444f('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x444f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 728cd56..8572ddf 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 _0x82a8=['STRING','sequelize','exports'];(function(_0x5d9a46,_0x2d4360){var _0x1a8790=function(_0x3a5281){while(--_0x3a5281){_0x5d9a46['push'](_0x5d9a46['shift']());}};_0x1a8790(++_0x2d4360);}(_0x82a8,0xcd));var _0x882a=function(_0x4fd805,_0x46dee4){_0x4fd805=_0x4fd805-0x0;var _0x4e9bbd=_0x82a8[_0x4fd805];return _0x4e9bbd;};'use strict';var Sequelize=require(_0x882a('0x0'));module[_0x882a('0x1')]={'name':{'type':Sequelize[_0x882a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x882a('0x2')]},'username':{'type':Sequelize[_0x882a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x882a('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x882a('0x2')]},'accessKey':{'type':Sequelize[_0x882a('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3e15=['exports','STRING','sequelize'];(function(_0x4f0fc1,_0x521e45){var _0x182520=function(_0x2a0a3a){while(--_0x2a0a3a){_0x4f0fc1['push'](_0x4f0fc1['shift']());}};_0x182520(++_0x521e45);}(_0x3e15,0x137));var _0x53e1=function(_0x594aad,_0x3e9fa2){_0x594aad=_0x594aad-0x0;var _0x4eff94=_0x3e15[_0x594aad];return _0x4eff94;};'use strict';var Sequelize=require(_0x53e1('0x0'));module[_0x53e1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x53e1('0x2')]},'accessKey':{'type':Sequelize[_0x53e1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index fb9242d..bfac2dc 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 _0x0a39=['querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','count','offset','limit','set','Content-Range','json','reject','update','destroy','status','sendStatus','stack','name','VtigerAccount','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','findOne','length','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','VtigerConfiguration','VtigerField','Subjects','Descriptions','md5','getFields','serverUrl','accessKey','username','moduleName','remoteUri','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','remove','includes','editable','false','label','startsWith','picklist','picklistValues','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a39,0x176));var _0x90a3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a39[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x90a3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x90a3('0x1'));var zipdir=require(_0x90a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90a3('0x3'));var moment=require(_0x90a3('0x4'));var BPromise=require(_0x90a3('0x5'));var Mustache=require(_0x90a3('0x6'));var util=require(_0x90a3('0x7'));var path=require(_0x90a3('0x8'));var sox=require(_0x90a3('0x9'));var csv=require(_0x90a3('0xa'));var ejs=require(_0x90a3('0xb'));var fs=require('fs');var _=require(_0x90a3('0xc'));var squel=require(_0x90a3('0xd'));var crypto=require(_0x90a3('0xe'));var jsforce=require(_0x90a3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x90a3('0xa'));var querystring=require(_0x90a3('0x10'));var Papa=require(_0x90a3('0x11'));var Redis=require(_0x90a3('0x12'));var authService=require(_0x90a3('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90a3('0x14'))(_0x90a3('0x15'));var utils=require(_0x90a3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x90a3('0x17'));var jayson=require(_0x90a3('0x18'));var client=jayson[_0x90a3('0x19')][_0x90a3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xf9b9d2,_0x3457c1,_0x1d85db){if(_0x1d85db){var _0x18504c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18504c[_0x90a3('0x1b')](_0x3457c1)){return _0xf9b9d2;}else{throw new Error(_0x90a3('0x1c'));}}else{return _0xf9b9d2;}}function respondWithRpcPromise(_0x300519,_0x28e6ec,_0x5b6951,_0x1ffabd){return new BPromise(function(_0x19d7b3,_0x29f56a){var _0x1eb0a4=_0x1ffabd||client;return _0x1eb0a4[_0x90a3('0x1d')](_0x300519,_0x5b6951)[_0x90a3('0x1e')](function(_0x50f540){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x28e6ec,'request\x20sent');logger[_0x90a3('0x1f')](_0x90a3('0x20'),_0x28e6ec,_0x90a3('0x21'),JSON[_0x90a3('0x22')](_0x50f540));if(_0x50f540[_0x90a3('0x23')]){if(_0x50f540[_0x90a3('0x23')][_0x90a3('0x24')]===0x1f4){logger[_0x90a3('0x23')](_0x90a3('0x25'),_0x28e6ec,_0x50f540[_0x90a3('0x23')]['message']);return _0x29f56a(_0x50f540[_0x90a3('0x23')][_0x90a3('0x26')]);}logger['error'](_0x90a3('0x25'),_0x28e6ec,_0x50f540[_0x90a3('0x23')]['message']);return _0x19d7b3(_0x50f540['error'][_0x90a3('0x26')]);}else{logger[_0x90a3('0x27')](_0x90a3('0x25'),_0x28e6ec,'request\x20sent');_0x19d7b3(_0x50f540[_0x90a3('0x28')][_0x90a3('0x26')]);}})[_0x90a3('0x29')](function(_0x39fe52){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x28e6ec,_0x39fe52);_0x29f56a(_0x39fe52);});});}function respondWithStatusCode(_0x48a224,_0x54d255){_0x54d255=_0x54d255||0xcc;return function(_0xe1f6e5){if(_0xe1f6e5){return _0x48a224['sendStatus'](_0x54d255);}return _0x48a224['status'](_0x54d255)['end']();};}function respondWithResult(_0x35c358,_0x4cd6bf){_0x4cd6bf=_0x4cd6bf||0xc8;return function(_0x19b01b){if(_0x19b01b){return _0x35c358['status'](_0x4cd6bf)['json'](_0x19b01b);}};}function respondWithFilteredResult(_0x587f5f,_0x3238ce){return function(_0x1e0237){if(_0x1e0237){var _0x521391=_0x1e0237[_0x90a3('0x2a')],_0x4b9ca0=_0x3238ce['offset'],_0x7f63c1=_0x3238ce[_0x90a3('0x2b')]+_0x3238ce[_0x90a3('0x2c')],_0x4f38e1;if(_0x7f63c1>=_0x521391){_0x7f63c1=_0x521391;_0x4f38e1=0xc8;}else{_0x4f38e1=0xce;}_0x587f5f['status'](_0x4f38e1);return _0x587f5f[_0x90a3('0x2d')](_0x90a3('0x2e'),_0x4b9ca0+'-'+_0x7f63c1+'/'+_0x521391)[_0x90a3('0x2f')](_0x1e0237);}return null;};}function patchUpdates(_0x431f1e){return function(_0x4042c1){try{jsonpatch['apply'](_0x4042c1,_0x431f1e,!![]);}catch(_0x352668){return BPromise[_0x90a3('0x30')](_0x352668);}return _0x4042c1['save']();};}function saveUpdates(_0x1bcc4d,_0x3b30aa){return function(_0x53cd05){if(_0x53cd05){return _0x53cd05[_0x90a3('0x31')](_0x1bcc4d)[_0x90a3('0x1e')](function(_0x2ead5d){return _0x2ead5d;});}return null;};}function removeEntity(_0x204b8b,_0x2547cb){return function(_0x58fd40){if(_0x58fd40){return _0x58fd40[_0x90a3('0x32')]()[_0x90a3('0x1e')](function(){_0x204b8b[_0x90a3('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f594c,_0x593601){return function(_0x414b6b){if(!_0x414b6b){_0x2f594c[_0x90a3('0x34')](0x194);}return _0x414b6b;};}function handleError(_0x5d0cf4,_0x6e7ba){_0x6e7ba=_0x6e7ba||0x1f4;return function(_0x20518e){logger['error'](_0x20518e[_0x90a3('0x35')]);if(_0x20518e[_0x90a3('0x36')]){delete _0x20518e[_0x90a3('0x36')];}_0x5d0cf4['status'](_0x6e7ba)['send'](_0x20518e);};}exports['index']=function(_0x1d1b62,_0x338263){var _0x23ccf7={},_0x5aadab={},_0x531148={'count':0x0,'rows':[]};var _0x3f7890=db[_0x90a3('0x37')]['rawAttributes'];_0x5aadab[_0x90a3('0x38')]=_[_0x90a3('0x39')](_0x3f7890);_0x5aadab['query']=_['keys'](_0x1d1b62[_0x90a3('0x3a')]);_0x5aadab[_0x90a3('0x3b')]=_[_0x90a3('0x3c')](_0x5aadab[_0x90a3('0x38')],_0x5aadab['query']);_0x23ccf7[_0x90a3('0x3d')]=_[_0x90a3('0x3c')](_0x5aadab[_0x90a3('0x38')],qs['fields'](_0x1d1b62['query'][_0x90a3('0x3e')]));_0x23ccf7[_0x90a3('0x3d')]=_0x23ccf7[_0x90a3('0x3d')]['length']?_0x23ccf7[_0x90a3('0x3d')]:_0x5aadab[_0x90a3('0x38')];if(!_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x3f')]('nolimit')){_0x23ccf7['limit']=qs[_0x90a3('0x2c')](_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x2c')]);_0x23ccf7['offset']=qs[_0x90a3('0x2b')](_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x2b')]);}_0x23ccf7[_0x90a3('0x40')]=qs[_0x90a3('0x41')](_0x1d1b62[_0x90a3('0x3a')]['sort']);_0x23ccf7[_0x90a3('0x42')]=qs[_0x90a3('0x3b')](_[_0x90a3('0x43')](_0x1d1b62[_0x90a3('0x3a')],_0x5aadab[_0x90a3('0x3b')]));if(_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x44')]){_0x23ccf7[_0x90a3('0x42')]=_[_0x90a3('0x45')](_0x23ccf7[_0x90a3('0x42')],{'$or':_[_0x90a3('0x46')](_0x3f7890,function(_0x255568){if(_0x255568[_0x90a3('0x47')]['key']!==_0x90a3('0x48')){var _0x200054={};_0x200054[_0x255568[_0x90a3('0x49')]]={'$like':'%'+_0x1d1b62['query']['filter']+'%'};return _0x200054;}})});}_0x23ccf7=_[_0x90a3('0x45')]({},_0x23ccf7,_0x1d1b62[_0x90a3('0x4a')]);var _0x48208e={'where':_0x23ccf7[_0x90a3('0x42')]};return db[_0x90a3('0x37')][_0x90a3('0x2a')](_0x48208e)[_0x90a3('0x1e')](function(_0x49402f){_0x531148[_0x90a3('0x2a')]=_0x49402f;if(_0x1d1b62[_0x90a3('0x3a')]['includeAll']){_0x23ccf7[_0x90a3('0x4b')]=[{'all':!![]}];}return db[_0x90a3('0x37')][_0x90a3('0x4c')](_0x23ccf7);})['then'](function(_0x5790de){_0x531148[_0x90a3('0x4d')]=_0x5790de;return _0x531148;})[_0x90a3('0x1e')](respondWithFilteredResult(_0x338263,_0x23ccf7))[_0x90a3('0x29')](handleError(_0x338263,null));};exports[_0x90a3('0x4e')]=function(_0x41e65a,_0x19d351){var _0x23ac6a={'raw':![],'where':{'id':_0x41e65a[_0x90a3('0x4f')]['id']}},_0x3354c2={};_0x3354c2[_0x90a3('0x38')]=_[_0x90a3('0x39')](db[_0x90a3('0x37')][_0x90a3('0x50')]);_0x3354c2['query']=_[_0x90a3('0x39')](_0x41e65a[_0x90a3('0x3a')]);_0x3354c2['filters']=_[_0x90a3('0x3c')](_0x3354c2[_0x90a3('0x38')],_0x3354c2[_0x90a3('0x3a')]);_0x23ac6a[_0x90a3('0x3d')]=_[_0x90a3('0x3c')](_0x3354c2[_0x90a3('0x38')],qs[_0x90a3('0x3e')](_0x41e65a[_0x90a3('0x3a')][_0x90a3('0x3e')]));_0x23ac6a[_0x90a3('0x3d')]=_0x23ac6a[_0x90a3('0x3d')]['length']?_0x23ac6a[_0x90a3('0x3d')]:_0x3354c2[_0x90a3('0x38')];if(_0x41e65a['query'][_0x90a3('0x51')]){_0x23ac6a['include']=[{'all':!![]}];}_0x23ac6a=_[_0x90a3('0x45')]({},_0x23ac6a,_0x41e65a[_0x90a3('0x4a')]);return db[_0x90a3('0x37')][_0x90a3('0x52')](_0x23ac6a)[_0x90a3('0x1e')](handleEntityNotFound(_0x19d351,null))[_0x90a3('0x1e')](respondWithResult(_0x19d351,null))[_0x90a3('0x29')](handleError(_0x19d351,null));};exports[_0x90a3('0x53')]=function(_0x19be4a,_0xf480b0){return db['VtigerAccount'][_0x90a3('0x53')](_0x19be4a[_0x90a3('0x54')],{})[_0x90a3('0x1e')](respondWithResult(_0xf480b0,0xc9))[_0x90a3('0x29')](handleError(_0xf480b0,null));};exports[_0x90a3('0x31')]=function(_0x50d432,_0x243167){if(_0x50d432[_0x90a3('0x54')]['id']){delete _0x50d432[_0x90a3('0x54')]['id'];}return db[_0x90a3('0x37')][_0x90a3('0x52')]({'where':{'id':_0x50d432['params']['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x243167,null))['then'](saveUpdates(_0x50d432[_0x90a3('0x54')],null))[_0x90a3('0x1e')](respondWithResult(_0x243167,null))['catch'](handleError(_0x243167,null));};exports[_0x90a3('0x32')]=function(_0x144681,_0x2a3f67){return db['VtigerAccount'][_0x90a3('0x52')]({'where':{'id':_0x144681['params']['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x2a3f67,null))[_0x90a3('0x1e')](removeEntity(_0x2a3f67,null))['catch'](handleError(_0x2a3f67,null));};exports['getConfigurations']=function(_0x3723d2,_0x2ae026,_0x4d321a){var _0x5a6a2d={};var _0x5f5370={};var _0x575f4f;var _0x18b86f;return db['VtigerAccount'][_0x90a3('0x55')]({'where':{'id':_0x3723d2[_0x90a3('0x4f')]['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x2ae026,null))[_0x90a3('0x1e')](function(_0x18e69f){if(_0x18e69f){_0x575f4f=_0x18e69f;_0x5f5370[_0x90a3('0x38')]=_[_0x90a3('0x39')](db['VtigerConfiguration'][_0x90a3('0x50')]);_0x5f5370[_0x90a3('0x3a')]=_[_0x90a3('0x39')](_0x3723d2[_0x90a3('0x3a')]);_0x5f5370[_0x90a3('0x3b')]=_[_0x90a3('0x3c')](_0x5f5370[_0x90a3('0x38')],_0x5f5370['query']);_0x5a6a2d['attributes']=_[_0x90a3('0x3c')](_0x5f5370[_0x90a3('0x38')],qs[_0x90a3('0x3e')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x3e')]));_0x5a6a2d[_0x90a3('0x3d')]=_0x5a6a2d[_0x90a3('0x3d')][_0x90a3('0x56')]?_0x5a6a2d[_0x90a3('0x3d')]:_0x5f5370[_0x90a3('0x38')];_0x5a6a2d[_0x90a3('0x40')]=qs[_0x90a3('0x41')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x41')]);_0x5a6a2d[_0x90a3('0x42')]=qs[_0x90a3('0x3b')](_[_0x90a3('0x43')](_0x3723d2[_0x90a3('0x3a')],_0x5f5370[_0x90a3('0x3b')]));if(_0x3723d2[_0x90a3('0x3a')]['filter']){_0x5a6a2d[_0x90a3('0x42')]=_['merge'](_0x5a6a2d['where'],{'$or':_['map'](_0x5a6a2d['attributes'],function(_0x329aa2){var _0x4354bb={};_0x4354bb[_0x329aa2]={'$like':'%'+_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x44')]+'%'};return _0x4354bb;})});}_0x5a6a2d=_[_0x90a3('0x45')]({},_0x5a6a2d,_0x3723d2[_0x90a3('0x4a')]);return _0x575f4f[_0x90a3('0x57')](_0x5a6a2d);}})[_0x90a3('0x1e')](function(_0x22bdf2){if(_0x22bdf2){_0x18b86f=_0x22bdf2[_0x90a3('0x56')];if(!_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x3f')]('nolimit')){_0x5a6a2d['limit']=qs[_0x90a3('0x2c')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x2c')]);_0x5a6a2d['offset']=qs[_0x90a3('0x2b')](_0x3723d2['query'][_0x90a3('0x2b')]);}return _0x575f4f['getConfigurations'](_0x5a6a2d);}})[_0x90a3('0x1e')](function(_0xf2b844){if(_0xf2b844){return _0xf2b844?{'count':_0x18b86f,'rows':_0xf2b844}:null;}})['then'](respondWithResult(_0x2ae026,null))['catch'](handleError(_0x2ae026,null));};exports[_0x90a3('0x58')]=function(_0x2fa7af,_0xd2655e,_0x4b0ab1){if(_0x2fa7af[_0x90a3('0x54')]['id']){delete _0x2fa7af[_0x90a3('0x54')]['id'];}return db[_0x90a3('0x37')][_0x90a3('0x55')]({'where':{'id':_0x2fa7af[_0x90a3('0x4f')]['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0xd2655e,null))[_0x90a3('0x1e')](function(_0x8411cd){if(_0x8411cd){_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x59')]=_0x8411cd['id'];_0x2fa7af[_0x90a3('0x54')]['Subjects']=integrations[_0x90a3('0x5a')](_0x2fa7af[_0x90a3('0x54')]['channel'],_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x47')]);_0x2fa7af['body']['Descriptions']=integrations[_0x90a3('0x5b')](_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x5c')],_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x47')]);return db[_0x90a3('0x5d')][_0x90a3('0x53')](_0x2fa7af[_0x90a3('0x54')],{'include':[{'model':db[_0x90a3('0x5e')],'as':_0x90a3('0x5f')},{'model':db[_0x90a3('0x5e')],'as':_0x90a3('0x60')}]});}return null;})[_0x90a3('0x1e')](respondWithResult(_0xd2655e,null))[_0x90a3('0x29')](handleError(_0xd2655e,null));};var md5=require(_0x90a3('0x61'));exports[_0x90a3('0x62')]=function(_0x364ee8,_0xbbaee,_0x20befa){var _0x212df5=null;var _0x19a0e0=null;var _0x4a6a4d=null;var _0x434354=null;var _0x4339d6='';return db[_0x90a3('0x37')]['findOne']({'where':{'id':_0x364ee8['params']['id']},'attributes':['id','name','username','description','moduleName','remoteUri',_0x90a3('0x63'),_0x90a3('0x64')]})['then'](handleEntityNotFound(_0xbbaee,null))['then'](function(_0x3b50f4){if(_0x3b50f4){_0x212df5=_0x3b50f4[_0x90a3('0x65')];_0x19a0e0=_0x3b50f4[_0x90a3('0x64')];_0x4a6a4d=_0x3b50f4[_0x90a3('0x66')];_0x4339d6=_0x3b50f4[_0x90a3('0x67')];var _0x31d1f7=_0x4339d6[_0x90a3('0x68')](-0x1);if(_0x31d1f7==='/'){_0x4339d6=_0x4339d6[_0x90a3('0x69')](0x0,_0x4339d6['lastIndexOf'](_0x31d1f7));}_0x434354=util[_0x90a3('0x6a')](_0x90a3('0x6b'),_0x4339d6);var _0x4d4cef={'method':_0x90a3('0x6c'),'uri':_0x434354,'qs':{'operation':_0x90a3('0x6d'),'username':_0x3b50f4[_0x90a3('0x65')]},'json':!![]};return rp(_0x4d4cef);}})[_0x90a3('0x1e')](function(_0x54fffb){if(_0x54fffb[_0x90a3('0x6e')]){var _0x4212aa={'method':_0x90a3('0x6f'),'uri':_0x434354,'form':{'operation':_0x90a3('0x70'),'username':_0x212df5,'accessKey':md5(_0x54fffb[_0x90a3('0x28')][_0x90a3('0x71')]+_0x19a0e0)},'json':!![]};return rp(_0x4212aa);}})['then'](function(_0x4cb49d){if(_0x4cb49d[_0x90a3('0x6e')]){var _0xb490ee={'method':_0x90a3('0x6c'),'uri':_0x434354,'qs':{'operation':_0x90a3('0x72'),'username':_0x212df5,'sessionName':_0x4cb49d[_0x90a3('0x28')][_0x90a3('0x73')],'elementType':_0x4a6a4d},'json':!![]};return rp(_0xb490ee);}})[_0x90a3('0x1e')](function(_0x16cf62){if(_0x16cf62[_0x90a3('0x6e')]){var _0x1e1aee=[_0x90a3('0x74'),'reference','owner'];_[_0x90a3('0x75')](_0x16cf62['result']['fields'],function(_0x35f539){return _0x1e1aee[_0x90a3('0x76')](_0x35f539[_0x90a3('0x47')]['name']);});_['remove'](_0x16cf62[_0x90a3('0x28')][_0x90a3('0x3e')],function(_0x257a90){return _0x257a90[_0x90a3('0x77')]===_0x90a3('0x78');});return{'count':_0x16cf62['result'][_0x90a3('0x3e')][_0x90a3('0x56')],'rows':_['map'](_0x16cf62[_0x90a3('0x28')][_0x90a3('0x3e')],function(_0x37656b){return{'id':_0x37656b[_0x90a3('0x36')],'name':_0x37656b[_0x90a3('0x79')],'custom':_[_0x90a3('0x7a')](_0x37656b[_0x90a3('0x36')],'cf_')?!![]:![],'options':_0x37656b[_0x90a3('0x47')][_0x90a3('0x36')]===_0x90a3('0x7b')&&_0x37656b['type'][_0x90a3('0x7c')][_0x90a3('0x56')]>0x0?_[_0x90a3('0x46')](_0x37656b[_0x90a3('0x47')][_0x90a3('0x7c')],function(_0x210ef1){return{'name':_0x210ef1[_0x90a3('0x79')],'value':_0x210ef1['value']};}):[]};})};}})[_0x90a3('0x1e')](respondWithResult(_0xbbaee,null))['catch'](function(_0x1f824f){console[_0x90a3('0x7d')]('vTiger\x20error:\x20'+_0x1f824f);var _0x166787=_0x364ee8[_0x90a3('0x3a')][_0x90a3('0x1b')]?0x1f4:_0x1f824f[_0x90a3('0x7e')]||0x1f4;logger[_0x90a3('0x23')](_0x90a3('0x7f'),_0x90a3('0x62'),_0x166787,JSON['stringify'](_0x1f824f));delete _0x1f824f[_0x90a3('0x36')];if(_0x166787===0x191){_0x166787=0x190;}_0xbbaee['status'](_0x166787)[_0x90a3('0x80')](_0x364ee8['query']['test']?{'message':_0x90a3('0x81'),'statusCode':_0x1f824f['statusCode']}:_0x1f824f);});}; \ No newline at end of file +var _0x80ae=['includeAll','include','rows','show','params','find','create','body','getConfigurations','VtigerConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','description','remoteUri','serverUrl','accessKey','username','moduleName','lastIndexOf','format','GET','getchallenge','success','POST','login','describe','sessionName','reference','owner','remove','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','VtigerAccount','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','type','key','field','merge','options'];(function(_0x3878b3,_0x3d44ec){var _0x2eed44=function(_0x333d20){while(--_0x333d20){_0x3878b3['push'](_0x3878b3['shift']());}};_0x2eed44(++_0x3d44ec);}(_0x80ae,0x1b6));var _0xe80a=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x80ae[_0x3a04ab];return _0x4bff6d;};'use strict';var pdf=require(_0xe80a('0x0'));var emlformat=require(_0xe80a('0x1'));var rimraf=require(_0xe80a('0x2'));var zipdir=require(_0xe80a('0x3'));var jsonpatch=require(_0xe80a('0x4'));var rp=require(_0xe80a('0x5'));var moment=require(_0xe80a('0x6'));var BPromise=require(_0xe80a('0x7'));var Mustache=require('mustache');var util=require(_0xe80a('0x8'));var path=require(_0xe80a('0x9'));var sox=require(_0xe80a('0xa'));var csv=require(_0xe80a('0xb'));var ejs=require(_0xe80a('0xc'));var fs=require('fs');var _=require(_0xe80a('0xd'));var squel=require(_0xe80a('0xe'));var crypto=require('crypto');var jsforce=require(_0xe80a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe80a('0xb'));var querystring=require(_0xe80a('0x10'));var Papa=require(_0xe80a('0x11'));var Redis=require(_0xe80a('0x12'));var authService=require(_0xe80a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe80a('0x14'));var logger=require(_0xe80a('0x15'))(_0xe80a('0x16'));var utils=require(_0xe80a('0x17'));var config=require(_0xe80a('0x18'));var db=require(_0xe80a('0x19'))['db'];var integrations=require(_0xe80a('0x1a'));var jayson=require(_0xe80a('0x1b'));var client=jayson[_0xe80a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x157d67,_0x14e5cb,_0x516a21){if(_0x516a21){var _0x280773=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x280773[_0xe80a('0x1d')](_0x14e5cb)){return _0x157d67;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x157d67;}}function respondWithRpcPromise(_0x5418ef,_0x35c106,_0x4d5f02,_0x2fee9a){return new BPromise(function(_0x474767,_0x219fd0){var _0x1777e6=_0x2fee9a||client;return _0x1777e6['request'](_0x5418ef,_0x4d5f02)['then'](function(_0x1d8232){logger[_0xe80a('0x1e')](_0xe80a('0x1f'),_0x35c106,_0xe80a('0x20'));logger[_0xe80a('0x21')](_0xe80a('0x22'),_0x35c106,_0xe80a('0x20'),JSON['stringify'](_0x1d8232));if(_0x1d8232[_0xe80a('0x23')]){if(_0x1d8232['error'][_0xe80a('0x24')]===0x1f4){logger[_0xe80a('0x23')](_0xe80a('0x1f'),_0x35c106,_0x1d8232[_0xe80a('0x23')][_0xe80a('0x25')]);return _0x219fd0(_0x1d8232['error']['message']);}logger[_0xe80a('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x35c106,_0x1d8232[_0xe80a('0x23')][_0xe80a('0x25')]);return _0x474767(_0x1d8232[_0xe80a('0x23')]['message']);}else{logger[_0xe80a('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x35c106,_0xe80a('0x20'));_0x474767(_0x1d8232[_0xe80a('0x26')]['message']);}})[_0xe80a('0x27')](function(_0x4d5622){logger[_0xe80a('0x23')](_0xe80a('0x1f'),_0x35c106,_0x4d5622);_0x219fd0(_0x4d5622);});});}function respondWithStatusCode(_0x1ed446,_0x30f878){_0x30f878=_0x30f878||0xcc;return function(_0x2a7af4){if(_0x2a7af4){return _0x1ed446['sendStatus'](_0x30f878);}return _0x1ed446[_0xe80a('0x28')](_0x30f878)['end']();};}function respondWithResult(_0x4a534d,_0xbbdfaa){_0xbbdfaa=_0xbbdfaa||0xc8;return function(_0x16fe24){if(_0x16fe24){return _0x4a534d[_0xe80a('0x28')](_0xbbdfaa)[_0xe80a('0x29')](_0x16fe24);}};}function respondWithFilteredResult(_0x365922,_0x235f7c){return function(_0x2c1aec){if(_0x2c1aec){var _0xb68eb0=_0x2c1aec[_0xe80a('0x2a')],_0x381c25=_0x235f7c[_0xe80a('0x2b')],_0x6e6b91=_0x235f7c[_0xe80a('0x2b')]+_0x235f7c[_0xe80a('0x2c')],_0x10dcc5;if(_0x6e6b91>=_0xb68eb0){_0x6e6b91=_0xb68eb0;_0x10dcc5=0xc8;}else{_0x10dcc5=0xce;}_0x365922['status'](_0x10dcc5);return _0x365922[_0xe80a('0x2d')]('Content-Range',_0x381c25+'-'+_0x6e6b91+'/'+_0xb68eb0)[_0xe80a('0x29')](_0x2c1aec);}return null;};}function patchUpdates(_0x3a99c5){return function(_0x398eca){try{jsonpatch[_0xe80a('0x2e')](_0x398eca,_0x3a99c5,!![]);}catch(_0x542d72){return BPromise[_0xe80a('0x2f')](_0x542d72);}return _0x398eca[_0xe80a('0x30')]();};}function saveUpdates(_0x16207c,_0x152a01){return function(_0x2710f4){if(_0x2710f4){return _0x2710f4[_0xe80a('0x31')](_0x16207c)[_0xe80a('0x32')](function(_0xf4c766){return _0xf4c766;});}return null;};}function removeEntity(_0x336f38,_0x5b80c3){return function(_0x2e5931){if(_0x2e5931){return _0x2e5931[_0xe80a('0x33')]()['then'](function(){_0x336f38[_0xe80a('0x28')](0xcc)[_0xe80a('0x34')]();});}};}function handleEntityNotFound(_0x37dd30,_0x2a7c97){return function(_0x2afd3a){if(!_0x2afd3a){_0x37dd30[_0xe80a('0x35')](0x194);}return _0x2afd3a;};}function handleError(_0x5be04e,_0x3975d2){_0x3975d2=_0x3975d2||0x1f4;return function(_0x4eb5b1){logger[_0xe80a('0x23')](_0x4eb5b1['stack']);if(_0x4eb5b1[_0xe80a('0x36')]){delete _0x4eb5b1[_0xe80a('0x36')];}_0x5be04e[_0xe80a('0x28')](_0x3975d2)[_0xe80a('0x37')](_0x4eb5b1);};}exports[_0xe80a('0x38')]=function(_0xdc51bc,_0x58f94a){var _0x15d559={},_0x3a4559={},_0x3087b9={'count':0x0,'rows':[]};var _0x2fe4ae=db[_0xe80a('0x39')][_0xe80a('0x3a')];_0x3a4559['model']=_[_0xe80a('0x3b')](_0x2fe4ae);_0x3a4559[_0xe80a('0x3c')]=_[_0xe80a('0x3b')](_0xdc51bc['query']);_0x3a4559[_0xe80a('0x3d')]=_['intersection'](_0x3a4559[_0xe80a('0x3e')],_0x3a4559[_0xe80a('0x3c')]);_0x15d559[_0xe80a('0x3f')]=_[_0xe80a('0x40')](_0x3a4559[_0xe80a('0x3e')],qs[_0xe80a('0x41')](_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x41')]));_0x15d559['attributes']=_0x15d559['attributes'][_0xe80a('0x42')]?_0x15d559[_0xe80a('0x3f')]:_0x3a4559['model'];if(!_0xdc51bc[_0xe80a('0x3c')]['hasOwnProperty'](_0xe80a('0x43'))){_0x15d559['limit']=qs[_0xe80a('0x2c')](_0xdc51bc['query'][_0xe80a('0x2c')]);_0x15d559[_0xe80a('0x2b')]=qs[_0xe80a('0x2b')](_0xdc51bc[_0xe80a('0x3c')]['offset']);}_0x15d559[_0xe80a('0x44')]=qs[_0xe80a('0x45')](_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x45')]);_0x15d559[_0xe80a('0x46')]=qs[_0xe80a('0x3d')](_['pick'](_0xdc51bc[_0xe80a('0x3c')],_0x3a4559[_0xe80a('0x3d')]));if(_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x47')]){_0x15d559[_0xe80a('0x46')]=_['merge'](_0x15d559[_0xe80a('0x46')],{'$or':_[_0xe80a('0x48')](_0x2fe4ae,function(_0x342bb2){if(_0x342bb2[_0xe80a('0x49')][_0xe80a('0x4a')]!=='VIRTUAL'){var _0x5c09c4={};_0x5c09c4[_0x342bb2[_0xe80a('0x4b')]]={'$like':'%'+_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x47')]+'%'};return _0x5c09c4;}})});}_0x15d559=_[_0xe80a('0x4c')]({},_0x15d559,_0xdc51bc[_0xe80a('0x4d')]);var _0x582bbd={'where':_0x15d559['where']};return db['VtigerAccount'][_0xe80a('0x2a')](_0x582bbd)['then'](function(_0x5f289e){_0x3087b9['count']=_0x5f289e;if(_0xdc51bc[_0xe80a('0x3c')][_0xe80a('0x4e')]){_0x15d559[_0xe80a('0x4f')]=[{'all':!![]}];}return db[_0xe80a('0x39')]['findAll'](_0x15d559);})[_0xe80a('0x32')](function(_0x3a747d){_0x3087b9[_0xe80a('0x50')]=_0x3a747d;return _0x3087b9;})[_0xe80a('0x32')](respondWithFilteredResult(_0x58f94a,_0x15d559))['catch'](handleError(_0x58f94a,null));};exports[_0xe80a('0x51')]=function(_0x530ed3,_0x23f771){var _0x57275c={'raw':![],'where':{'id':_0x530ed3[_0xe80a('0x52')]['id']}},_0x4abfe0={};_0x4abfe0['model']=_[_0xe80a('0x3b')](db[_0xe80a('0x39')][_0xe80a('0x3a')]);_0x4abfe0[_0xe80a('0x3c')]=_[_0xe80a('0x3b')](_0x530ed3['query']);_0x4abfe0['filters']=_[_0xe80a('0x40')](_0x4abfe0[_0xe80a('0x3e')],_0x4abfe0['query']);_0x57275c['attributes']=_[_0xe80a('0x40')](_0x4abfe0['model'],qs[_0xe80a('0x41')](_0x530ed3['query'][_0xe80a('0x41')]));_0x57275c[_0xe80a('0x3f')]=_0x57275c[_0xe80a('0x3f')][_0xe80a('0x42')]?_0x57275c[_0xe80a('0x3f')]:_0x4abfe0['model'];if(_0x530ed3[_0xe80a('0x3c')][_0xe80a('0x4e')]){_0x57275c[_0xe80a('0x4f')]=[{'all':!![]}];}_0x57275c=_[_0xe80a('0x4c')]({},_0x57275c,_0x530ed3[_0xe80a('0x4d')]);return db['VtigerAccount'][_0xe80a('0x53')](_0x57275c)[_0xe80a('0x32')](handleEntityNotFound(_0x23f771,null))[_0xe80a('0x32')](respondWithResult(_0x23f771,null))[_0xe80a('0x27')](handleError(_0x23f771,null));};exports['create']=function(_0x1671df,_0x383163){return db[_0xe80a('0x39')][_0xe80a('0x54')](_0x1671df[_0xe80a('0x55')],{})['then'](respondWithResult(_0x383163,0xc9))[_0xe80a('0x27')](handleError(_0x383163,null));};exports[_0xe80a('0x31')]=function(_0x1cc2d9,_0x31c71f){if(_0x1cc2d9[_0xe80a('0x55')]['id']){delete _0x1cc2d9[_0xe80a('0x55')]['id'];}return db[_0xe80a('0x39')]['find']({'where':{'id':_0x1cc2d9['params']['id']}})[_0xe80a('0x32')](handleEntityNotFound(_0x31c71f,null))['then'](saveUpdates(_0x1cc2d9['body'],null))['then'](respondWithResult(_0x31c71f,null))[_0xe80a('0x27')](handleError(_0x31c71f,null));};exports[_0xe80a('0x33')]=function(_0x19c18b,_0x462bf3){return db['VtigerAccount'][_0xe80a('0x53')]({'where':{'id':_0x19c18b[_0xe80a('0x52')]['id']}})['then'](handleEntityNotFound(_0x462bf3,null))['then'](removeEntity(_0x462bf3,null))['catch'](handleError(_0x462bf3,null));};exports[_0xe80a('0x56')]=function(_0x3306ef,_0xd90601,_0x5ba939){var _0x385e0a={};var _0x49f712={};var _0x4458fd;var _0x5162a0;return db[_0xe80a('0x39')]['findOne']({'where':{'id':_0x3306ef['params']['id']}})[_0xe80a('0x32')](handleEntityNotFound(_0xd90601,null))[_0xe80a('0x32')](function(_0x2b1f02){if(_0x2b1f02){_0x4458fd=_0x2b1f02;_0x49f712[_0xe80a('0x3e')]=_[_0xe80a('0x3b')](db[_0xe80a('0x57')][_0xe80a('0x3a')]);_0x49f712[_0xe80a('0x3c')]=_['keys'](_0x3306ef[_0xe80a('0x3c')]);_0x49f712[_0xe80a('0x3d')]=_[_0xe80a('0x40')](_0x49f712['model'],_0x49f712[_0xe80a('0x3c')]);_0x385e0a[_0xe80a('0x3f')]=_['intersection'](_0x49f712[_0xe80a('0x3e')],qs[_0xe80a('0x41')](_0x3306ef[_0xe80a('0x3c')]['fields']));_0x385e0a[_0xe80a('0x3f')]=_0x385e0a['attributes'][_0xe80a('0x42')]?_0x385e0a[_0xe80a('0x3f')]:_0x49f712[_0xe80a('0x3e')];_0x385e0a['order']=qs[_0xe80a('0x45')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x45')]);_0x385e0a[_0xe80a('0x46')]=qs[_0xe80a('0x3d')](_[_0xe80a('0x58')](_0x3306ef[_0xe80a('0x3c')],_0x49f712[_0xe80a('0x3d')]));if(_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x47')]){_0x385e0a[_0xe80a('0x46')]=_['merge'](_0x385e0a['where'],{'$or':_[_0xe80a('0x48')](_0x385e0a[_0xe80a('0x3f')],function(_0x55fcd7){var _0x23f835={};_0x23f835[_0x55fcd7]={'$like':'%'+_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x47')]+'%'};return _0x23f835;})});}_0x385e0a=_['merge']({},_0x385e0a,_0x3306ef[_0xe80a('0x4d')]);return _0x4458fd[_0xe80a('0x56')](_0x385e0a);}})[_0xe80a('0x32')](function(_0x424929){if(_0x424929){_0x5162a0=_0x424929[_0xe80a('0x42')];if(!_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x59')](_0xe80a('0x43'))){_0x385e0a[_0xe80a('0x2c')]=qs[_0xe80a('0x2c')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x2c')]);_0x385e0a[_0xe80a('0x2b')]=qs[_0xe80a('0x2b')](_0x3306ef[_0xe80a('0x3c')][_0xe80a('0x2b')]);}return _0x4458fd['getConfigurations'](_0x385e0a);}})[_0xe80a('0x32')](function(_0x340f52){if(_0x340f52){return _0x340f52?{'count':_0x5162a0,'rows':_0x340f52}:null;}})[_0xe80a('0x32')](respondWithResult(_0xd90601,null))[_0xe80a('0x27')](handleError(_0xd90601,null));};exports[_0xe80a('0x5a')]=function(_0x37278e,_0x49f459,_0x154837){if(_0x37278e['body']['id']){delete _0x37278e[_0xe80a('0x55')]['id'];}return db[_0xe80a('0x39')]['findOne']({'where':{'id':_0x37278e[_0xe80a('0x52')]['id']}})['then'](handleEntityNotFound(_0x49f459,null))[_0xe80a('0x32')](function(_0x175b91){if(_0x175b91){_0x37278e['body']['AccountId']=_0x175b91['id'];_0x37278e[_0xe80a('0x55')][_0xe80a('0x5b')]=integrations[_0xe80a('0x5c')](_0x37278e[_0xe80a('0x55')][_0xe80a('0x5d')],_0x37278e[_0xe80a('0x55')][_0xe80a('0x49')]);_0x37278e[_0xe80a('0x55')][_0xe80a('0x5e')]=integrations[_0xe80a('0x5f')](_0x37278e[_0xe80a('0x55')][_0xe80a('0x5d')],_0x37278e[_0xe80a('0x55')][_0xe80a('0x49')]);return db[_0xe80a('0x57')]['create'](_0x37278e[_0xe80a('0x55')],{'include':[{'model':db[_0xe80a('0x60')],'as':'Subjects'},{'model':db[_0xe80a('0x60')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x49f459,null))[_0xe80a('0x27')](handleError(_0x49f459,null));};var md5=require(_0xe80a('0x61'));exports[_0xe80a('0x62')]=function(_0x23b9c7,_0x45817f,_0x1bd769){var _0x3d4a81=null;var _0x15c6e7=null;var _0x604214=null;var _0x321c3d=null;var _0x10101b='';return db['VtigerAccount'][_0xe80a('0x63')]({'where':{'id':_0x23b9c7['params']['id']},'attributes':['id',_0xe80a('0x36'),'username',_0xe80a('0x64'),'moduleName',_0xe80a('0x65'),_0xe80a('0x66'),_0xe80a('0x67')]})['then'](handleEntityNotFound(_0x45817f,null))['then'](function(_0x12948e){if(_0x12948e){_0x3d4a81=_0x12948e[_0xe80a('0x68')];_0x15c6e7=_0x12948e[_0xe80a('0x67')];_0x604214=_0x12948e[_0xe80a('0x69')];_0x10101b=_0x12948e['remoteUri'];var _0x3a9915=_0x10101b['slice'](-0x1);if(_0x3a9915==='/'){_0x10101b=_0x10101b['substring'](0x0,_0x10101b[_0xe80a('0x6a')](_0x3a9915));}_0x321c3d=util[_0xe80a('0x6b')]('%s/webservice.php',_0x10101b);var _0x573164={'method':_0xe80a('0x6c'),'uri':_0x321c3d,'qs':{'operation':_0xe80a('0x6d'),'username':_0x12948e[_0xe80a('0x68')]},'json':!![]};return rp(_0x573164);}})[_0xe80a('0x32')](function(_0x24acfb){if(_0x24acfb[_0xe80a('0x6e')]){var _0xe1f48f={'method':_0xe80a('0x6f'),'uri':_0x321c3d,'form':{'operation':_0xe80a('0x70'),'username':_0x3d4a81,'accessKey':md5(_0x24acfb[_0xe80a('0x26')]['token']+_0x15c6e7)},'json':!![]};return rp(_0xe1f48f);}})[_0xe80a('0x32')](function(_0x2c0eb8){if(_0x2c0eb8['success']){var _0x2770da={'method':'GET','uri':_0x321c3d,'qs':{'operation':_0xe80a('0x71'),'username':_0x3d4a81,'sessionName':_0x2c0eb8[_0xe80a('0x26')][_0xe80a('0x72')],'elementType':_0x604214},'json':!![]};return rp(_0x2770da);}})[_0xe80a('0x32')](function(_0x58ef32){if(_0x58ef32['success']){var _0x592898=['autogenerated',_0xe80a('0x73'),_0xe80a('0x74')];_[_0xe80a('0x75')](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0x254366){return _0x592898['includes'](_0x254366['type'][_0xe80a('0x36')]);});_['remove'](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0x8354d5){return _0x8354d5['editable']==='false';});return{'count':_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')]['length'],'rows':_[_0xe80a('0x48')](_0x58ef32[_0xe80a('0x26')][_0xe80a('0x41')],function(_0xdbc823){return{'id':_0xdbc823['name'],'name':_0xdbc823[_0xe80a('0x76')],'custom':_[_0xe80a('0x77')](_0xdbc823[_0xe80a('0x36')],_0xe80a('0x78'))?!![]:![],'options':_0xdbc823[_0xe80a('0x49')][_0xe80a('0x36')]===_0xe80a('0x79')&&_0xdbc823[_0xe80a('0x49')][_0xe80a('0x7a')][_0xe80a('0x42')]>0x0?_[_0xe80a('0x48')](_0xdbc823[_0xe80a('0x49')]['picklistValues'],function(_0x50da52){return{'name':_0x50da52[_0xe80a('0x76')],'value':_0x50da52[_0xe80a('0x7b')]};}):[]};})};}})['then'](respondWithResult(_0x45817f,null))[_0xe80a('0x27')](function(_0x3e91d4){console[_0xe80a('0x7c')](_0xe80a('0x7d')+_0x3e91d4);var _0x5d5843=_0x23b9c7[_0xe80a('0x3c')]['test']?0x1f4:_0x3e91d4['statusCode']||0x1f4;logger[_0xe80a('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5d5843,JSON[_0xe80a('0x7e')](_0x3e91d4));delete _0x3e91d4[_0xe80a('0x36')];if(_0x5d5843===0x191){_0x5d5843=0x190;}_0x45817f[_0xe80a('0x28')](_0x5d5843)[_0xe80a('0x37')](_0x23b9c7[_0xe80a('0x3c')]['test']?{'message':_0xe80a('0x7f'),'statusCode':_0x3e91d4[_0xe80a('0x80')]}:_0x3e91d4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 28ce668..70f7d35 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 _0xc0f9=['VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x254983,_0x26c7ba){var _0x2ba66b=function(_0x30a256){while(--_0x30a256){_0x254983['push'](_0x254983['shift']());}};_0x2ba66b(++_0x26c7ba);}(_0xc0f9,0xc5));var _0x9c0f=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0xc0f9[_0x55754e];return _0x2e9948;};'use strict';var _=require(_0x9c0f('0x0'));var util=require(_0x9c0f('0x1'));var logger=require(_0x9c0f('0x2'))(_0x9c0f('0x3'));var moment=require(_0x9c0f('0x4'));var BPromise=require(_0x9c0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c0f('0x6'));var rimraf=require(_0x9c0f('0x7'));var config=require(_0x9c0f('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9c0f('0x9'));module[_0x9c0f('0xa')]=function(_0x2eab65,_0x181915){return _0x2eab65['define'](_0x9c0f('0xb'),attributes,{'tableName':_0x9c0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfcb=['../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x29560f,_0x1621cc){var _0x49606e=function(_0x44649b){while(--_0x44649b){_0x29560f['push'](_0x29560f['shift']());}};_0x49606e(++_0x1621cc);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x284174,_0x1dd400){_0x284174=_0x284174-0x0;var _0x58b7fb=_0xcfcb[_0x284174];return _0x58b7fb;};'use strict';var _=require(_0xbcfc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbcfc('0x1'));var BPromise=require(_0xbcfc('0x2'));var rp=require(_0xbcfc('0x3'));var fs=require('fs');var path=require(_0xbcfc('0x4'));var rimraf=require(_0xbcfc('0x5'));var config=require(_0xbcfc('0x6'));var attributes=require(_0xbcfc('0x7'));var integrations=require(_0xbcfc('0x8'));module[_0xbcfc('0x9')]=function(_0x255243,_0x4056a8){return _0x255243[_0xbcfc('0xa')](_0xbcfc('0xb'),attributes,{'tableName':_0xbcfc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index a8f503b..924d5c0 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 _0xe9d3=['attributes','include','map','model','then','GetVtigerAccount','ShowVtigerAccount','find','debug','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VtigerAccount','findAll','options','raw','where'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe9d3,0x169));var _0x3e9d=function(_0x14e8c6,_0xd130a){_0x14e8c6=_0x14e8c6-0x0;var _0x203210=_0xe9d3[_0x14e8c6];return _0x203210;};'use strict';var _=require(_0x3e9d('0x0'));var util=require(_0x3e9d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e9d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e9d('0x3'))(_0x3e9d('0x4'));var config=require(_0x3e9d('0x5'));var jayson=require(_0x3e9d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf1fc26,_0x4e6e9c,_0x36e6f3){return new BPromise(function(_0x3af59c,_0x2bd1f9){return client[_0x3e9d('0x7')](_0xf1fc26,_0x36e6f3)['then'](function(_0x29085b){logger[_0x3e9d('0x8')](_0x3e9d('0x9'),_0x4e6e9c,_0x3e9d('0xa'));logger['debug'](_0x3e9d('0xb'),_0x4e6e9c,_0x3e9d('0xa'),JSON[_0x3e9d('0xc')](_0x29085b));if(_0x29085b['error']){if(_0x29085b['error'][_0x3e9d('0xd')]===0x1f4){logger[_0x3e9d('0xe')](_0x3e9d('0x9'),_0x4e6e9c,_0x29085b['error'][_0x3e9d('0xf')]);return _0x2bd1f9(_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);}logger[_0x3e9d('0xe')](_0x3e9d('0x9'),_0x4e6e9c,_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);return _0x3af59c(_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);}else{logger['info'](_0x3e9d('0x9'),_0x4e6e9c,'request\x20sent');_0x3af59c(_0x29085b[_0x3e9d('0x10')][_0x3e9d('0xf')]);}})[_0x3e9d('0x11')](function(_0x201765){logger['error'](_0x3e9d('0x9'),_0x4e6e9c,_0x201765);_0x2bd1f9(_0x201765);});});}exports['GetVtigerAccount']=function(_0x38cb0e){var _0xc77889=this;return new Promise(function(_0x22d2f3,_0x37e81b){return db[_0x3e9d('0x12')][_0x3e9d('0x13')]({'raw':_0x38cb0e['options']?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x15')]===undefined?!![]:![]:!![],'where':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x16')]||null:null,'attributes':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x17')]||null:null,'limit':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')]['limit']||null:null,'include':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e['options'][_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x18')],function(_0x233895){return{'model':db[_0x233895[_0x3e9d('0x1a')]],'as':_0x233895['as'],'attributes':_0x233895[_0x3e9d('0x17')],'include':_0x233895[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x233895[_0x3e9d('0x18')],function(_0x4cf83b){return{'model':db[_0x4cf83b[_0x3e9d('0x1a')]],'as':_0x4cf83b['as'],'attributes':_0x4cf83b[_0x3e9d('0x17')],'include':_0x4cf83b[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x4cf83b[_0x3e9d('0x18')],function(_0x4b3801){return{'model':db[_0x4b3801['model']],'as':_0x4b3801['as'],'attributes':_0x4b3801[_0x3e9d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3e9d('0x1b')](function(_0x17f006){logger[_0x3e9d('0x8')](_0x3e9d('0x1c'),_0x38cb0e);logger['debug'](_0x3e9d('0x1c'),_0x38cb0e,JSON[_0x3e9d('0xc')](_0x17f006));_0x22d2f3(_0x17f006);})[_0x3e9d('0x11')](function(_0x5c98e4){logger[_0x3e9d('0xe')]('GetVtigerAccount',_0x5c98e4[_0x3e9d('0xf')],_0x38cb0e);_0x37e81b(_0xc77889['error'](0x1f4,_0x5c98e4['message']));});});};exports[_0x3e9d('0x1d')]=function(_0x518e66){var _0x2a3889=this;return new Promise(function(_0x429da7,_0xc4e892){return db[_0x3e9d('0x12')][_0x3e9d('0x1e')]({'raw':_0x518e66['options']?_0x518e66[_0x3e9d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x518e66['options']?_0x518e66['options'][_0x3e9d('0x16')]||null:null,'attributes':_0x518e66[_0x3e9d('0x14')]?_0x518e66['options'][_0x3e9d('0x17')]||null:null,'include':_0x518e66['options']?_0x518e66[_0x3e9d('0x14')]['include']?_[_0x3e9d('0x19')](_0x518e66[_0x3e9d('0x14')][_0x3e9d('0x18')],function(_0x273004){return{'model':db[_0x273004[_0x3e9d('0x1a')]],'as':_0x273004['as'],'attributes':_0x273004[_0x3e9d('0x17')],'include':_0x273004[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x273004[_0x3e9d('0x18')],function(_0x513b41){return{'model':db[_0x513b41[_0x3e9d('0x1a')]],'as':_0x513b41['as'],'attributes':_0x513b41[_0x3e9d('0x17')],'include':_0x513b41[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x513b41[_0x3e9d('0x18')],function(_0x862b85){return{'model':db[_0x862b85[_0x3e9d('0x1a')]],'as':_0x862b85['as'],'attributes':_0x862b85['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e9d('0x1b')](function(_0x2b0a85){logger[_0x3e9d('0x8')](_0x3e9d('0x1d'),_0x518e66);logger[_0x3e9d('0x1f')](_0x3e9d('0x1d'),_0x518e66,JSON[_0x3e9d('0xc')](_0x2b0a85));_0x429da7(_0x2b0a85);})[_0x3e9d('0x11')](function(_0x44855d){logger[_0x3e9d('0xe')](_0x3e9d('0x1d'),_0x44855d['message'],_0x518e66);_0xc4e892(_0x2a3889[_0x3e9d('0xe')](0x1f4,_0x44855d[_0x3e9d('0xf')]));});});}; \ No newline at end of file +var _0x1771=['request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x5a9126,_0xc1c87e){var _0x1134ed=function(_0x359696){while(--_0x359696){_0x5a9126['push'](_0x5a9126['shift']());}};_0x1134ed(++_0xc1c87e);}(_0x1771,0xbb));var _0x1177=function(_0x2fac31,_0x556be2){_0x2fac31=_0x2fac31-0x0;var _0x2073a0=_0x1771[_0x2fac31];return _0x2073a0;};'use strict';var _=require(_0x1177('0x0'));var util=require(_0x1177('0x1'));var moment=require(_0x1177('0x2'));var BPromise=require(_0x1177('0x3'));var rs=require(_0x1177('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1177('0x5'))['db'];var utils=require(_0x1177('0x6'));var logger=require(_0x1177('0x7'))(_0x1177('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1177('0x9')][_0x1177('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bc79f,_0x256055,_0x14f802){return new BPromise(function(_0x45a86c,_0x2db099){return client[_0x1177('0xb')](_0x3bc79f,_0x14f802)[_0x1177('0xc')](function(_0x3a5e44){logger[_0x1177('0xd')](_0x1177('0xe'),_0x256055,'request\x20sent');logger['debug'](_0x1177('0xf'),_0x256055,'request\x20sent',JSON['stringify'](_0x3a5e44));if(_0x3a5e44[_0x1177('0x10')]){if(_0x3a5e44['error']['code']===0x1f4){logger[_0x1177('0x10')](_0x1177('0xe'),_0x256055,_0x3a5e44['error'][_0x1177('0x11')]);return _0x2db099(_0x3a5e44[_0x1177('0x10')][_0x1177('0x11')]);}logger[_0x1177('0x10')](_0x1177('0xe'),_0x256055,_0x3a5e44['error']['message']);return _0x45a86c(_0x3a5e44[_0x1177('0x10')][_0x1177('0x11')]);}else{logger['info'](_0x1177('0xe'),_0x256055,_0x1177('0x12'));_0x45a86c(_0x3a5e44['result'][_0x1177('0x11')]);}})[_0x1177('0x13')](function(_0x3726cd){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x256055,_0x3726cd);_0x2db099(_0x3726cd);});});}exports[_0x1177('0x14')]=function(_0x2a89ef){var _0x30409e=this;return new Promise(function(_0x33d5ce,_0x3a4973){return db[_0x1177('0x15')][_0x1177('0x16')]({'raw':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef[_0x1177('0x17')][_0x1177('0x18')]===undefined?!![]:![]:!![],'where':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef['options'][_0x1177('0x19')]||null:null,'attributes':_0x2a89ef['options']?_0x2a89ef[_0x1177('0x17')]['attributes']||null:null,'limit':_0x2a89ef[_0x1177('0x17')]?_0x2a89ef[_0x1177('0x17')][_0x1177('0x1a')]||null:null,'include':_0x2a89ef['options']?_0x2a89ef['options'][_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x2a89ef[_0x1177('0x17')][_0x1177('0x1b')],function(_0x43b990){return{'model':db[_0x43b990[_0x1177('0x1d')]],'as':_0x43b990['as'],'attributes':_0x43b990['attributes'],'include':_0x43b990[_0x1177('0x1b')]?_['map'](_0x43b990[_0x1177('0x1b')],function(_0x345425){return{'model':db[_0x345425[_0x1177('0x1d')]],'as':_0x345425['as'],'attributes':_0x345425[_0x1177('0x1e')],'include':_0x345425[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x345425[_0x1177('0x1b')],function(_0x25bd53){return{'model':db[_0x25bd53[_0x1177('0x1d')]],'as':_0x25bd53['as'],'attributes':_0x25bd53['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x108436){logger['info'](_0x1177('0x14'),_0x2a89ef);logger[_0x1177('0x1f')](_0x1177('0x14'),_0x2a89ef,JSON['stringify'](_0x108436));_0x33d5ce(_0x108436);})[_0x1177('0x13')](function(_0xbfaff){logger['error']('GetVtigerAccount',_0xbfaff[_0x1177('0x11')],_0x2a89ef);_0x3a4973(_0x30409e[_0x1177('0x10')](0x1f4,_0xbfaff[_0x1177('0x11')]));});});};exports[_0x1177('0x20')]=function(_0x20f02d){var _0x585e13=this;return new Promise(function(_0xcc104f,_0x5537bf){return db[_0x1177('0x15')]['find']({'raw':_0x20f02d[_0x1177('0x17')]?_0x20f02d['options'][_0x1177('0x18')]===undefined?!![]:![]:!![],'where':_0x20f02d['options']?_0x20f02d['options'][_0x1177('0x19')]||null:null,'attributes':_0x20f02d[_0x1177('0x17')]?_0x20f02d[_0x1177('0x17')]['attributes']||null:null,'include':_0x20f02d[_0x1177('0x17')]?_0x20f02d[_0x1177('0x17')][_0x1177('0x1b')]?_['map'](_0x20f02d[_0x1177('0x17')][_0x1177('0x1b')],function(_0x432134){return{'model':db[_0x432134[_0x1177('0x1d')]],'as':_0x432134['as'],'attributes':_0x432134[_0x1177('0x1e')],'include':_0x432134[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x432134[_0x1177('0x1b')],function(_0x3eadda){return{'model':db[_0x3eadda[_0x1177('0x1d')]],'as':_0x3eadda['as'],'attributes':_0x3eadda['attributes'],'include':_0x3eadda[_0x1177('0x1b')]?_[_0x1177('0x1c')](_0x3eadda[_0x1177('0x1b')],function(_0x44ee17){return{'model':db[_0x44ee17[_0x1177('0x1d')]],'as':_0x44ee17['as'],'attributes':_0x44ee17[_0x1177('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1177('0xc')](function(_0x2c6542){logger['info'](_0x1177('0x20'),_0x20f02d);logger[_0x1177('0x1f')](_0x1177('0x20'),_0x20f02d,JSON['stringify'](_0x2c6542));_0xcc104f(_0x2c6542);})[_0x1177('0x13')](function(_0x11425b){logger[_0x1177('0x10')](_0x1177('0x20'),_0x11425b[_0x1177('0x11')],_0x20f02d);_0x5537bf(_0x585e13[_0x1177('0x10')](0x1f4,_0x11425b[_0x1177('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9b7c15d..e52a68c 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 _0xb7e7=['create','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['getSubjects']);router[_0x7b7e('0x6')](_0x7b7e('0xc'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 2a90240..a68f9ab 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 _0x8f9b=['sequelize','STRING'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x8f9b,0x156));var _0xb8f9=function(_0x9a451f,_0x2858ea){_0x9a451f=_0x9a451f-0x0;var _0x30f055=_0x8f9b[_0x9a451f];return _0x30f055;};'use strict';var Sequelize=require(_0xb8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8f9('0x1')]},'description':{'type':Sequelize[_0xb8f9('0x1')]}}; \ No newline at end of file +var _0x7220=['sequelize','STRING'];(function(_0x4e0dac,_0x43cb93){var _0x2de6a4=function(_0x1c27fe){while(--_0x1c27fe){_0x4e0dac['push'](_0x4e0dac['shift']());}};_0x2de6a4(++_0x43cb93);}(_0x7220,0x180));var _0x0722=function(_0x2ae17e,_0x4b406e){_0x2ae17e=_0x2ae17e-0x0;var _0x4dc529=_0x7220[_0x2ae17e];return _0x4dc529;};'use strict';var Sequelize=require(_0x0722('0x0'));module['exports']={'name':{'type':Sequelize[_0x0722('0x1')]},'description':{'type':Sequelize[_0x0722('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 408658b..7a09fed 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 _0xadec=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','VtigerConfiguration','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','keys','create','body','findOne','VtigerField','rawAttributes','getFields','getSubjects','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x21bad5,_0x23a39d){var _0x235106=function(_0x281b1f){while(--_0x281b1f){_0x21bad5['push'](_0x21bad5['shift']());}};_0x235106(++_0x23a39d);}(_0xadec,0x156));var _0xcade=function(_0x2687b9,_0x1d7069){_0x2687b9=_0x2687b9-0x0;var _0x3d19b7=_0xadec[_0x2687b9];return _0x3d19b7;};'use strict';var pdf=require(_0xcade('0x0'));var emlformat=require(_0xcade('0x1'));var rimraf=require(_0xcade('0x2'));var zipdir=require(_0xcade('0x3'));var jsonpatch=require(_0xcade('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcade('0x5'));var util=require(_0xcade('0x6'));var path=require(_0xcade('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcade('0x8'));var crypto=require('crypto');var jsforce=require(_0xcade('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcade('0xa'));var Papa=require(_0xcade('0xb'));var Redis=require(_0xcade('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xcade('0xd'));var hardwareService=require(_0xcade('0xe'));var logger=require(_0xcade('0xf'))(_0xcade('0x10'));var utils=require(_0xcade('0x11'));var config=require(_0xcade('0x12'));var db=require(_0xcade('0x13'))['db'];var jayson=require(_0xcade('0x14'));var client=jayson[_0xcade('0x15')][_0xcade('0x16')]({'port':0x232a});function checkPasswordPattern(_0x136d02,_0x2fd9a4,_0x2e2019){if(_0x2e2019){var _0x40c5c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c5c7['test'](_0x2fd9a4)){return _0x136d02;}else{throw new Error(_0xcade('0x17'));}}else{return _0x136d02;}}function respondWithRpcPromise(_0x33d794,_0x2c5976,_0x53dfb8,_0x81ddea){return new BPromise(function(_0x245621,_0x4be206){var _0x135fb7=_0x81ddea||client;return _0x135fb7[_0xcade('0x18')](_0x33d794,_0x53dfb8)[_0xcade('0x19')](function(_0x4da027){logger[_0xcade('0x1a')](_0xcade('0x1b'),_0x2c5976,_0xcade('0x1c'));logger['debug'](_0xcade('0x1d'),_0x2c5976,_0xcade('0x1c'),JSON[_0xcade('0x1e')](_0x4da027));if(_0x4da027[_0xcade('0x1f')]){if(_0x4da027[_0xcade('0x1f')][_0xcade('0x20')]===0x1f4){logger[_0xcade('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c5976,_0x4da027[_0xcade('0x1f')][_0xcade('0x21')]);return _0x4be206(_0x4da027[_0xcade('0x1f')][_0xcade('0x21')]);}logger[_0xcade('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c5976,_0x4da027['error'][_0xcade('0x21')]);return _0x245621(_0x4da027['error'][_0xcade('0x21')]);}else{logger[_0xcade('0x1a')](_0xcade('0x1b'),_0x2c5976,_0xcade('0x1c'));_0x245621(_0x4da027[_0xcade('0x22')][_0xcade('0x21')]);}})[_0xcade('0x23')](function(_0x264df7){logger[_0xcade('0x1f')](_0xcade('0x1b'),_0x2c5976,_0x264df7);_0x4be206(_0x264df7);});});}function respondWithStatusCode(_0x28b55c,_0x2c9f13){_0x2c9f13=_0x2c9f13||0xcc;return function(_0x598a20){if(_0x598a20){return _0x28b55c[_0xcade('0x24')](_0x2c9f13);}return _0x28b55c[_0xcade('0x25')](_0x2c9f13)['end']();};}function respondWithResult(_0x3b6f37,_0x25cf6a){_0x25cf6a=_0x25cf6a||0xc8;return function(_0x468302){if(_0x468302){return _0x3b6f37[_0xcade('0x25')](_0x25cf6a)[_0xcade('0x26')](_0x468302);}};}function respondWithFilteredResult(_0x1c77f1,_0xf8e810){return function(_0x4bbe2a){if(_0x4bbe2a){var _0x39dcf0=_0x4bbe2a[_0xcade('0x27')],_0x17c156=_0xf8e810[_0xcade('0x28')],_0x18fe12=_0xf8e810[_0xcade('0x28')]+_0xf8e810[_0xcade('0x29')],_0x1874c6;if(_0x18fe12>=_0x39dcf0){_0x18fe12=_0x39dcf0;_0x1874c6=0xc8;}else{_0x1874c6=0xce;}_0x1c77f1['status'](_0x1874c6);return _0x1c77f1[_0xcade('0x2a')](_0xcade('0x2b'),_0x17c156+'-'+_0x18fe12+'/'+_0x39dcf0)[_0xcade('0x26')](_0x4bbe2a);}return null;};}function patchUpdates(_0x28d9da){return function(_0x5c96e3){try{jsonpatch[_0xcade('0x2c')](_0x5c96e3,_0x28d9da,!![]);}catch(_0xe83cc3){return BPromise[_0xcade('0x2d')](_0xe83cc3);}return _0x5c96e3[_0xcade('0x2e')]();};}function saveUpdates(_0x104c45,_0x13ac98){return function(_0x4eac69){if(_0x4eac69){return _0x4eac69[_0xcade('0x2f')](_0x104c45)[_0xcade('0x19')](function(_0x8c92b1){return _0x8c92b1;});}return null;};}function removeEntity(_0x31429b,_0x4c4442){return function(_0x3fbb39){if(_0x3fbb39){return _0x3fbb39[_0xcade('0x30')]()[_0xcade('0x19')](function(){_0x31429b[_0xcade('0x25')](0xcc)[_0xcade('0x31')]();});}};}function handleEntityNotFound(_0x1abd15,_0x4821d2){return function(_0x5363cc){if(!_0x5363cc){_0x1abd15[_0xcade('0x24')](0x194);}return _0x5363cc;};}function handleError(_0x5f59de,_0x80b610){_0x80b610=_0x80b610||0x1f4;return function(_0x40fe71){logger[_0xcade('0x1f')](_0x40fe71[_0xcade('0x32')]);if(_0x40fe71[_0xcade('0x33')]){delete _0x40fe71[_0xcade('0x33')];}_0x5f59de[_0xcade('0x25')](_0x80b610)[_0xcade('0x34')](_0x40fe71);};}exports[_0xcade('0x35')]=function(_0x3dc0ad,_0xeb678d){var _0x265011={},_0x51d576={},_0x4fd75e={'count':0x0,'rows':[]};var _0x53d5a8=db[_0xcade('0x36')]['rawAttributes'];_0x51d576[_0xcade('0x37')]=_['keys'](_0x53d5a8);_0x51d576['query']=_['keys'](_0x3dc0ad['query']);_0x51d576['filters']=_[_0xcade('0x38')](_0x51d576['model'],_0x51d576[_0xcade('0x39')]);_0x265011['attributes']=_[_0xcade('0x38')](_0x51d576[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x3dc0ad[_0xcade('0x39')][_0xcade('0x3a')]));_0x265011[_0xcade('0x3b')]=_0x265011['attributes'][_0xcade('0x3c')]?_0x265011[_0xcade('0x3b')]:_0x51d576[_0xcade('0x37')];if(!_0x3dc0ad['query'][_0xcade('0x3d')](_0xcade('0x3e'))){_0x265011['limit']=qs[_0xcade('0x29')](_0x3dc0ad[_0xcade('0x39')]['limit']);_0x265011[_0xcade('0x28')]=qs[_0xcade('0x28')](_0x3dc0ad['query'][_0xcade('0x28')]);}_0x265011[_0xcade('0x3f')]=qs['sort'](_0x3dc0ad[_0xcade('0x39')][_0xcade('0x40')]);_0x265011[_0xcade('0x41')]=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x3dc0ad[_0xcade('0x39')],_0x51d576[_0xcade('0x42')]));if(_0x3dc0ad[_0xcade('0x39')][_0xcade('0x44')]){_0x265011[_0xcade('0x41')]=_[_0xcade('0x45')](_0x265011['where'],{'$or':_[_0xcade('0x46')](_0x53d5a8,function(_0x4ad05f){if(_0x4ad05f[_0xcade('0x47')][_0xcade('0x48')]!==_0xcade('0x49')){var _0x5b1c21={};_0x5b1c21[_0x4ad05f[_0xcade('0x4a')]]={'$like':'%'+_0x3dc0ad[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x5b1c21;}})});}_0x265011=_[_0xcade('0x45')]({},_0x265011,_0x3dc0ad[_0xcade('0x4b')]);var _0x34c46b={'where':_0x265011['where']};return db['VtigerConfiguration']['count'](_0x34c46b)[_0xcade('0x19')](function(_0xdbd296){_0x4fd75e[_0xcade('0x27')]=_0xdbd296;if(_0x3dc0ad[_0xcade('0x39')]['includeAll']){_0x265011[_0xcade('0x4c')]=[{'all':!![]}];}return db[_0xcade('0x36')][_0xcade('0x4d')](_0x265011);})['then'](function(_0x500303){_0x4fd75e[_0xcade('0x4e')]=_0x500303;return _0x4fd75e;})[_0xcade('0x19')](respondWithFilteredResult(_0xeb678d,_0x265011))[_0xcade('0x23')](handleError(_0xeb678d,null));};exports[_0xcade('0x4f')]=function(_0x5a0d3e,_0xab6d57){var _0x18bb5a={'raw':![],'where':{'id':_0x5a0d3e[_0xcade('0x50')]['id']}},_0x350b01={};_0x350b01[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x36')]['rawAttributes']);_0x350b01[_0xcade('0x39')]=_[_0xcade('0x51')](_0x5a0d3e[_0xcade('0x39')]);_0x350b01[_0xcade('0x42')]=_['intersection'](_0x350b01[_0xcade('0x37')],_0x350b01[_0xcade('0x39')]);_0x18bb5a[_0xcade('0x3b')]=_[_0xcade('0x38')](_0x350b01[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x5a0d3e[_0xcade('0x39')][_0xcade('0x3a')]));_0x18bb5a[_0xcade('0x3b')]=_0x18bb5a[_0xcade('0x3b')][_0xcade('0x3c')]?_0x18bb5a['attributes']:_0x350b01[_0xcade('0x37')];if(_0x5a0d3e[_0xcade('0x39')]['includeAll']){_0x18bb5a[_0xcade('0x4c')]=[{'all':!![]}];}_0x18bb5a=_['merge']({},_0x18bb5a,_0x5a0d3e[_0xcade('0x4b')]);return db[_0xcade('0x36')]['find'](_0x18bb5a)[_0xcade('0x19')](handleEntityNotFound(_0xab6d57,null))[_0xcade('0x19')](respondWithResult(_0xab6d57,null))['catch'](handleError(_0xab6d57,null));};exports[_0xcade('0x52')]=function(_0x18fb02,_0x380832){return db['VtigerConfiguration'][_0xcade('0x52')](_0x18fb02[_0xcade('0x53')],{})[_0xcade('0x19')](respondWithResult(_0x380832,0xc9))[_0xcade('0x23')](handleError(_0x380832,null));};exports[_0xcade('0x2f')]=function(_0xc3d5ff,_0x11b6c5){if(_0xc3d5ff['body']['id']){delete _0xc3d5ff[_0xcade('0x53')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xc3d5ff[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x11b6c5,null))[_0xcade('0x19')](saveUpdates(_0xc3d5ff['body'],null))[_0xcade('0x19')](respondWithResult(_0x11b6c5,null))[_0xcade('0x23')](handleError(_0x11b6c5,null));};exports['destroy']=function(_0x27e474,_0x196e5c){return db[_0xcade('0x36')]['find']({'where':{'id':_0x27e474[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x196e5c,null))[_0xcade('0x19')](removeEntity(_0x196e5c,null))[_0xcade('0x23')](handleError(_0x196e5c,null));};exports['getFields']=function(_0x446a32,_0x4f6b85,_0x40ef90){var _0xc8bed0={};var _0x2577b7={};var _0x2198ed;var _0x77aea3;return db[_0xcade('0x36')][_0xcade('0x54')]({'where':{'id':_0x446a32[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x4f6b85,null))[_0xcade('0x19')](function(_0x51cd3f){if(_0x51cd3f){_0x2198ed=_0x51cd3f;_0x2577b7[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x55')][_0xcade('0x56')]);_0x2577b7[_0xcade('0x39')]=_['keys'](_0x446a32['query']);_0x2577b7[_0xcade('0x42')]=_[_0xcade('0x38')](_0x2577b7['model'],_0x2577b7[_0xcade('0x39')]);_0xc8bed0['attributes']=_[_0xcade('0x38')](_0x2577b7[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x446a32[_0xcade('0x39')][_0xcade('0x3a')]));_0xc8bed0[_0xcade('0x3b')]=_0xc8bed0[_0xcade('0x3b')][_0xcade('0x3c')]?_0xc8bed0[_0xcade('0x3b')]:_0x2577b7[_0xcade('0x37')];_0xc8bed0[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x446a32[_0xcade('0x39')][_0xcade('0x40')]);_0xc8bed0[_0xcade('0x41')]=qs['filters'](_['pick'](_0x446a32['query'],_0x2577b7[_0xcade('0x42')]));if(_0x446a32['query']['filter']){_0xc8bed0[_0xcade('0x41')]=_[_0xcade('0x45')](_0xc8bed0[_0xcade('0x41')],{'$or':_[_0xcade('0x46')](_0xc8bed0[_0xcade('0x3b')],function(_0x3a5f35){var _0x7a3ada={};_0x7a3ada[_0x3a5f35]={'$like':'%'+_0x446a32[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x7a3ada;})});}_0xc8bed0=_[_0xcade('0x45')]({},_0xc8bed0,_0x446a32['options']);return _0x2198ed[_0xcade('0x57')](_0xc8bed0);}})[_0xcade('0x19')](function(_0x518f93){if(_0x518f93){_0x77aea3=_0x518f93['length'];if(!_0x446a32[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0xc8bed0['limit']=qs[_0xcade('0x29')](_0x446a32[_0xcade('0x39')][_0xcade('0x29')]);_0xc8bed0[_0xcade('0x28')]=qs['offset'](_0x446a32[_0xcade('0x39')][_0xcade('0x28')]);}return _0x2198ed[_0xcade('0x57')](_0xc8bed0);}})['then'](function(_0x243706){if(_0x243706){return _0x243706?{'count':_0x77aea3,'rows':_0x243706}:null;}})[_0xcade('0x19')](respondWithResult(_0x4f6b85,null))['catch'](handleError(_0x4f6b85,null));};exports[_0xcade('0x58')]=function(_0x5d67c0,_0x29456f,_0x28e91b){var _0x433eec={};var _0x50cf70={};var _0xda52af;var _0x2802a1;return db[_0xcade('0x36')][_0xcade('0x54')]({'where':{'id':_0x5d67c0[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x29456f,null))[_0xcade('0x19')](function(_0x154b85){if(_0x154b85){_0xda52af=_0x154b85;_0x50cf70[_0xcade('0x37')]=_[_0xcade('0x51')](db['VtigerField'][_0xcade('0x56')]);_0x50cf70['query']=_[_0xcade('0x51')](_0x5d67c0[_0xcade('0x39')]);_0x50cf70[_0xcade('0x42')]=_[_0xcade('0x38')](_0x50cf70[_0xcade('0x37')],_0x50cf70[_0xcade('0x39')]);_0x433eec[_0xcade('0x3b')]=_['intersection'](_0x50cf70[_0xcade('0x37')],qs['fields'](_0x5d67c0[_0xcade('0x39')]['fields']));_0x433eec['attributes']=_0x433eec[_0xcade('0x3b')][_0xcade('0x3c')]?_0x433eec[_0xcade('0x3b')]:_0x50cf70[_0xcade('0x37')];_0x433eec[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x5d67c0[_0xcade('0x39')][_0xcade('0x40')]);_0x433eec['where']=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x5d67c0[_0xcade('0x39')],_0x50cf70[_0xcade('0x42')]));if(_0x5d67c0[_0xcade('0x39')][_0xcade('0x44')]){_0x433eec['where']=_[_0xcade('0x45')](_0x433eec['where'],{'$or':_[_0xcade('0x46')](_0x433eec[_0xcade('0x3b')],function(_0x369206){var _0x25ca25={};_0x25ca25[_0x369206]={'$like':'%'+_0x5d67c0[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x25ca25;})});}_0x433eec=_[_0xcade('0x45')]({},_0x433eec,_0x5d67c0[_0xcade('0x4b')]);return _0xda52af[_0xcade('0x58')](_0x433eec);}})[_0xcade('0x19')](function(_0x44ff6b){if(_0x44ff6b){_0x2802a1=_0x44ff6b[_0xcade('0x3c')];if(!_0x5d67c0[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0x433eec['limit']=qs[_0xcade('0x29')](_0x5d67c0[_0xcade('0x39')][_0xcade('0x29')]);_0x433eec[_0xcade('0x28')]=qs['offset'](_0x5d67c0[_0xcade('0x39')]['offset']);}return _0xda52af[_0xcade('0x58')](_0x433eec);}})[_0xcade('0x19')](function(_0xf5ec56){if(_0xf5ec56){return _0xf5ec56?{'count':_0x2802a1,'rows':_0xf5ec56}:null;}})[_0xcade('0x19')](respondWithResult(_0x29456f,null))['catch'](handleError(_0x29456f,null));};exports['getDescriptions']=function(_0x17d974,_0x847f42,_0xaeb5c){var _0x5ca84c={};var _0x2b5575={};var _0x472bcb;var _0x3a7e1a;return db[_0xcade('0x36')]['findOne']({'where':{'id':_0x17d974[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x847f42,null))[_0xcade('0x19')](function(_0x19e201){if(_0x19e201){_0x472bcb=_0x19e201;_0x2b5575[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x55')][_0xcade('0x56')]);_0x2b5575[_0xcade('0x39')]=_[_0xcade('0x51')](_0x17d974[_0xcade('0x39')]);_0x2b5575[_0xcade('0x42')]=_[_0xcade('0x38')](_0x2b5575[_0xcade('0x37')],_0x2b5575[_0xcade('0x39')]);_0x5ca84c[_0xcade('0x3b')]=_[_0xcade('0x38')](_0x2b5575['model'],qs[_0xcade('0x3a')](_0x17d974['query']['fields']));_0x5ca84c['attributes']=_0x5ca84c[_0xcade('0x3b')][_0xcade('0x3c')]?_0x5ca84c[_0xcade('0x3b')]:_0x2b5575[_0xcade('0x37')];_0x5ca84c[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x17d974['query'][_0xcade('0x40')]);_0x5ca84c['where']=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x17d974['query'],_0x2b5575[_0xcade('0x42')]));if(_0x17d974[_0xcade('0x39')][_0xcade('0x44')]){_0x5ca84c[_0xcade('0x41')]=_[_0xcade('0x45')](_0x5ca84c[_0xcade('0x41')],{'$or':_[_0xcade('0x46')](_0x5ca84c[_0xcade('0x3b')],function(_0x4732e9){var _0x3b290c={};_0x3b290c[_0x4732e9]={'$like':'%'+_0x17d974[_0xcade('0x39')]['filter']+'%'};return _0x3b290c;})});}_0x5ca84c=_[_0xcade('0x45')]({},_0x5ca84c,_0x17d974[_0xcade('0x4b')]);return _0x472bcb['getDescriptions'](_0x5ca84c);}})[_0xcade('0x19')](function(_0x2a11e6){if(_0x2a11e6){_0x3a7e1a=_0x2a11e6[_0xcade('0x3c')];if(!_0x17d974[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0x5ca84c[_0xcade('0x29')]=qs[_0xcade('0x29')](_0x17d974[_0xcade('0x39')][_0xcade('0x29')]);_0x5ca84c[_0xcade('0x28')]=qs[_0xcade('0x28')](_0x17d974[_0xcade('0x39')]['offset']);}return _0x472bcb['getDescriptions'](_0x5ca84c);}})[_0xcade('0x19')](function(_0x3fb7d9){if(_0x3fb7d9){return _0x3fb7d9?{'count':_0x3a7e1a,'rows':_0x3fb7d9}:null;}})['then'](respondWithResult(_0x847f42,null))[_0xcade('0x23')](handleError(_0x847f42,null));}; \ No newline at end of file +var _0x92f0=['show','params','includeAll','find','create','body','destroy','getFields','findOne','VtigerField','rawAttributes','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','update','name','index','VtigerConfiguration','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','include','findAll'];(function(_0x12de61,_0x4b56a4){var _0xb3684f=function(_0x27fa50){while(--_0x27fa50){_0x12de61['push'](_0x12de61['shift']());}};_0xb3684f(++_0x4b56a4);}(_0x92f0,0x10d));var _0x092f=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x92f0[_0x879e31];return _0x3467e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x092f('0x0'));var rimraf=require(_0x092f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x092f('0x2'));var rp=require(_0x092f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x092f('0x4'));var util=require(_0x092f('0x5'));var path=require(_0x092f('0x6'));var sox=require(_0x092f('0x7'));var csv=require(_0x092f('0x8'));var ejs=require(_0x092f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x092f('0xa'));var crypto=require('crypto');var jsforce=require(_0x092f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x092f('0x8'));var querystring=require('querystring');var Papa=require(_0x092f('0xc'));var Redis=require('ioredis');var authService=require(_0x092f('0xd'));var qs=require(_0x092f('0xe'));var hardwareService=require(_0x092f('0xf'));var logger=require('../../config/logger')(_0x092f('0x10'));var utils=require(_0x092f('0x11'));var config=require(_0x092f('0x12'));var db=require(_0x092f('0x13'))['db'];var jayson=require(_0x092f('0x14'));var client=jayson['client'][_0x092f('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3e9305,_0x5c6d22,_0x1f395e){if(_0x1f395e){var _0x1b19fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b19fb[_0x092f('0x16')](_0x5c6d22)){return _0x3e9305;}else{throw new Error(_0x092f('0x17'));}}else{return _0x3e9305;}}function respondWithRpcPromise(_0x954956,_0x3b1f34,_0x1984df,_0x272ea5){return new BPromise(function(_0x4e4d0f,_0x352456){var _0x346c68=_0x272ea5||client;return _0x346c68[_0x092f('0x18')](_0x954956,_0x1984df)[_0x092f('0x19')](function(_0x57e911){logger['info'](_0x092f('0x1a'),_0x3b1f34,_0x092f('0x1b'));logger[_0x092f('0x1c')](_0x092f('0x1d'),_0x3b1f34,_0x092f('0x1b'),JSON['stringify'](_0x57e911));if(_0x57e911['error']){if(_0x57e911[_0x092f('0x1e')][_0x092f('0x1f')]===0x1f4){logger[_0x092f('0x1e')](_0x092f('0x1a'),_0x3b1f34,_0x57e911[_0x092f('0x1e')]['message']);return _0x352456(_0x57e911[_0x092f('0x1e')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3b1f34,_0x57e911[_0x092f('0x1e')]['message']);return _0x4e4d0f(_0x57e911['error'][_0x092f('0x20')]);}else{logger[_0x092f('0x21')](_0x092f('0x1a'),_0x3b1f34,'request\x20sent');_0x4e4d0f(_0x57e911[_0x092f('0x22')]['message']);}})[_0x092f('0x23')](function(_0x1528c0){logger[_0x092f('0x1e')](_0x092f('0x1a'),_0x3b1f34,_0x1528c0);_0x352456(_0x1528c0);});});}function respondWithStatusCode(_0x2a8543,_0xc1eb8d){_0xc1eb8d=_0xc1eb8d||0xcc;return function(_0x42ac28){if(_0x42ac28){return _0x2a8543[_0x092f('0x24')](_0xc1eb8d);}return _0x2a8543[_0x092f('0x25')](_0xc1eb8d)[_0x092f('0x26')]();};}function respondWithResult(_0x27004c,_0x43f5c0){_0x43f5c0=_0x43f5c0||0xc8;return function(_0x29ac64){if(_0x29ac64){return _0x27004c[_0x092f('0x25')](_0x43f5c0)['json'](_0x29ac64);}};}function respondWithFilteredResult(_0x2c0524,_0x459140){return function(_0x58a5a7){if(_0x58a5a7){var _0x32f0a8=_0x58a5a7[_0x092f('0x27')],_0x598e69=_0x459140[_0x092f('0x28')],_0x4dd349=_0x459140[_0x092f('0x28')]+_0x459140['limit'],_0xea4c6;if(_0x4dd349>=_0x32f0a8){_0x4dd349=_0x32f0a8;_0xea4c6=0xc8;}else{_0xea4c6=0xce;}_0x2c0524[_0x092f('0x25')](_0xea4c6);return _0x2c0524['set'](_0x092f('0x29'),_0x598e69+'-'+_0x4dd349+'/'+_0x32f0a8)[_0x092f('0x2a')](_0x58a5a7);}return null;};}function patchUpdates(_0x372327){return function(_0x2eeb50){try{jsonpatch[_0x092f('0x2b')](_0x2eeb50,_0x372327,!![]);}catch(_0x3f8351){return BPromise['reject'](_0x3f8351);}return _0x2eeb50['save']();};}function saveUpdates(_0x4f74c8,_0x23aea7){return function(_0x57ec44){if(_0x57ec44){return _0x57ec44[_0x092f('0x2c')](_0x4f74c8)['then'](function(_0x3466ef){return _0x3466ef;});}return null;};}function removeEntity(_0xa97ece,_0x5a0b57){return function(_0x2c4c69){if(_0x2c4c69){return _0x2c4c69['destroy']()[_0x092f('0x19')](function(){_0xa97ece[_0x092f('0x25')](0xcc)[_0x092f('0x26')]();});}};}function handleEntityNotFound(_0x2f697f,_0x46beb2){return function(_0xa06c5e){if(!_0xa06c5e){_0x2f697f['sendStatus'](0x194);}return _0xa06c5e;};}function handleError(_0x1b6f41,_0x1c6903){_0x1c6903=_0x1c6903||0x1f4;return function(_0x3beaad){logger[_0x092f('0x1e')](_0x3beaad['stack']);if(_0x3beaad[_0x092f('0x2d')]){delete _0x3beaad[_0x092f('0x2d')];}_0x1b6f41[_0x092f('0x25')](_0x1c6903)['send'](_0x3beaad);};}exports[_0x092f('0x2e')]=function(_0x3a842e,_0x1e1807){var _0x45447e={},_0x141e31={},_0x4029a7={'count':0x0,'rows':[]};var _0x3f447b=db[_0x092f('0x2f')]['rawAttributes'];_0x141e31['model']=_[_0x092f('0x30')](_0x3f447b);_0x141e31['query']=_[_0x092f('0x30')](_0x3a842e[_0x092f('0x31')]);_0x141e31[_0x092f('0x32')]=_[_0x092f('0x33')](_0x141e31[_0x092f('0x34')],_0x141e31[_0x092f('0x31')]);_0x45447e['attributes']=_[_0x092f('0x33')](_0x141e31[_0x092f('0x34')],qs[_0x092f('0x35')](_0x3a842e[_0x092f('0x31')][_0x092f('0x35')]));_0x45447e[_0x092f('0x36')]=_0x45447e[_0x092f('0x36')][_0x092f('0x37')]?_0x45447e[_0x092f('0x36')]:_0x141e31[_0x092f('0x34')];if(!_0x3a842e['query'][_0x092f('0x38')]('nolimit')){_0x45447e['limit']=qs['limit'](_0x3a842e[_0x092f('0x31')][_0x092f('0x39')]);_0x45447e[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x3a842e[_0x092f('0x31')][_0x092f('0x28')]);}_0x45447e[_0x092f('0x3a')]=qs['sort'](_0x3a842e['query'][_0x092f('0x3b')]);_0x45447e['where']=qs[_0x092f('0x32')](_[_0x092f('0x3c')](_0x3a842e['query'],_0x141e31[_0x092f('0x32')]));if(_0x3a842e[_0x092f('0x31')][_0x092f('0x3d')]){_0x45447e[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x45447e[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x3f447b,function(_0x22d596){if(_0x22d596['type'][_0x092f('0x41')]!==_0x092f('0x42')){var _0x3ddda2={};_0x3ddda2[_0x22d596[_0x092f('0x43')]]={'$like':'%'+_0x3a842e[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x3ddda2;}})});}_0x45447e=_['merge']({},_0x45447e,_0x3a842e[_0x092f('0x44')]);var _0x55ba85={'where':_0x45447e[_0x092f('0x3e')]};return db[_0x092f('0x2f')][_0x092f('0x27')](_0x55ba85)[_0x092f('0x19')](function(_0x24d228){_0x4029a7['count']=_0x24d228;if(_0x3a842e[_0x092f('0x31')]['includeAll']){_0x45447e[_0x092f('0x45')]=[{'all':!![]}];}return db[_0x092f('0x2f')][_0x092f('0x46')](_0x45447e);})[_0x092f('0x19')](function(_0x497473){_0x4029a7['rows']=_0x497473;return _0x4029a7;})[_0x092f('0x19')](respondWithFilteredResult(_0x1e1807,_0x45447e))['catch'](handleError(_0x1e1807,null));};exports[_0x092f('0x47')]=function(_0x1c1f37,_0x51c5ee){var _0x285eb3={'raw':![],'where':{'id':_0x1c1f37[_0x092f('0x48')]['id']}},_0x6b9cb6={};_0x6b9cb6[_0x092f('0x34')]=_[_0x092f('0x30')](db[_0x092f('0x2f')]['rawAttributes']);_0x6b9cb6[_0x092f('0x31')]=_[_0x092f('0x30')](_0x1c1f37[_0x092f('0x31')]);_0x6b9cb6[_0x092f('0x32')]=_[_0x092f('0x33')](_0x6b9cb6['model'],_0x6b9cb6['query']);_0x285eb3[_0x092f('0x36')]=_[_0x092f('0x33')](_0x6b9cb6[_0x092f('0x34')],qs['fields'](_0x1c1f37[_0x092f('0x31')][_0x092f('0x35')]));_0x285eb3[_0x092f('0x36')]=_0x285eb3[_0x092f('0x36')][_0x092f('0x37')]?_0x285eb3[_0x092f('0x36')]:_0x6b9cb6[_0x092f('0x34')];if(_0x1c1f37['query'][_0x092f('0x49')]){_0x285eb3[_0x092f('0x45')]=[{'all':!![]}];}_0x285eb3=_[_0x092f('0x3f')]({},_0x285eb3,_0x1c1f37[_0x092f('0x44')]);return db[_0x092f('0x2f')][_0x092f('0x4a')](_0x285eb3)[_0x092f('0x19')](handleEntityNotFound(_0x51c5ee,null))['then'](respondWithResult(_0x51c5ee,null))[_0x092f('0x23')](handleError(_0x51c5ee,null));};exports[_0x092f('0x4b')]=function(_0x18f1d,_0x3e60c1){return db['VtigerConfiguration'][_0x092f('0x4b')](_0x18f1d[_0x092f('0x4c')],{})['then'](respondWithResult(_0x3e60c1,0xc9))[_0x092f('0x23')](handleError(_0x3e60c1,null));};exports['update']=function(_0x4d1569,_0x2be736){if(_0x4d1569[_0x092f('0x4c')]['id']){delete _0x4d1569['body']['id'];}return db['VtigerConfiguration'][_0x092f('0x4a')]({'where':{'id':_0x4d1569[_0x092f('0x48')]['id']}})[_0x092f('0x19')](handleEntityNotFound(_0x2be736,null))[_0x092f('0x19')](saveUpdates(_0x4d1569[_0x092f('0x4c')],null))[_0x092f('0x19')](respondWithResult(_0x2be736,null))['catch'](handleError(_0x2be736,null));};exports[_0x092f('0x4d')]=function(_0x1784a9,_0xbedced){return db['VtigerConfiguration']['find']({'where':{'id':_0x1784a9[_0x092f('0x48')]['id']}})['then'](handleEntityNotFound(_0xbedced,null))[_0x092f('0x19')](removeEntity(_0xbedced,null))[_0x092f('0x23')](handleError(_0xbedced,null));};exports[_0x092f('0x4e')]=function(_0x36fae3,_0x1552f9,_0x1b5393){var _0x5dd786={};var _0x2bf463={};var _0x423bf2;var _0x44386e;return db['VtigerConfiguration'][_0x092f('0x4f')]({'where':{'id':_0x36fae3['params']['id']}})['then'](handleEntityNotFound(_0x1552f9,null))['then'](function(_0x3b09aa){if(_0x3b09aa){_0x423bf2=_0x3b09aa;_0x2bf463[_0x092f('0x34')]=_[_0x092f('0x30')](db[_0x092f('0x50')][_0x092f('0x51')]);_0x2bf463[_0x092f('0x31')]=_[_0x092f('0x30')](_0x36fae3[_0x092f('0x31')]);_0x2bf463['filters']=_[_0x092f('0x33')](_0x2bf463[_0x092f('0x34')],_0x2bf463[_0x092f('0x31')]);_0x5dd786[_0x092f('0x36')]=_['intersection'](_0x2bf463[_0x092f('0x34')],qs[_0x092f('0x35')](_0x36fae3[_0x092f('0x31')][_0x092f('0x35')]));_0x5dd786[_0x092f('0x36')]=_0x5dd786['attributes'][_0x092f('0x37')]?_0x5dd786[_0x092f('0x36')]:_0x2bf463[_0x092f('0x34')];_0x5dd786[_0x092f('0x3a')]=qs[_0x092f('0x3b')](_0x36fae3[_0x092f('0x31')]['sort']);_0x5dd786[_0x092f('0x3e')]=qs[_0x092f('0x32')](_[_0x092f('0x3c')](_0x36fae3[_0x092f('0x31')],_0x2bf463['filters']));if(_0x36fae3[_0x092f('0x31')][_0x092f('0x3d')]){_0x5dd786[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x5dd786[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x5dd786['attributes'],function(_0x44ed91){var _0x521f83={};_0x521f83[_0x44ed91]={'$like':'%'+_0x36fae3[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x521f83;})});}_0x5dd786=_['merge']({},_0x5dd786,_0x36fae3[_0x092f('0x44')]);return _0x423bf2['getFields'](_0x5dd786);}})[_0x092f('0x19')](function(_0x16c622){if(_0x16c622){_0x44386e=_0x16c622[_0x092f('0x37')];if(!_0x36fae3[_0x092f('0x31')][_0x092f('0x38')](_0x092f('0x52'))){_0x5dd786[_0x092f('0x39')]=qs[_0x092f('0x39')](_0x36fae3['query'][_0x092f('0x39')]);_0x5dd786[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x36fae3[_0x092f('0x31')]['offset']);}return _0x423bf2['getFields'](_0x5dd786);}})[_0x092f('0x19')](function(_0x321d5a){if(_0x321d5a){return _0x321d5a?{'count':_0x44386e,'rows':_0x321d5a}:null;}})[_0x092f('0x19')](respondWithResult(_0x1552f9,null))[_0x092f('0x23')](handleError(_0x1552f9,null));};exports[_0x092f('0x53')]=function(_0xf0dff3,_0x2f4983,_0x59ca53){var _0x2cf40e={};var _0x431ded={};var _0x1911a8;var _0x24e766;return db[_0x092f('0x2f')][_0x092f('0x4f')]({'where':{'id':_0xf0dff3['params']['id']}})[_0x092f('0x19')](handleEntityNotFound(_0x2f4983,null))['then'](function(_0x39f551){if(_0x39f551){_0x1911a8=_0x39f551;_0x431ded[_0x092f('0x34')]=_['keys'](db[_0x092f('0x50')][_0x092f('0x51')]);_0x431ded[_0x092f('0x31')]=_[_0x092f('0x30')](_0xf0dff3['query']);_0x431ded['filters']=_[_0x092f('0x33')](_0x431ded[_0x092f('0x34')],_0x431ded[_0x092f('0x31')]);_0x2cf40e['attributes']=_[_0x092f('0x33')](_0x431ded[_0x092f('0x34')],qs[_0x092f('0x35')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x35')]));_0x2cf40e[_0x092f('0x36')]=_0x2cf40e[_0x092f('0x36')][_0x092f('0x37')]?_0x2cf40e['attributes']:_0x431ded[_0x092f('0x34')];_0x2cf40e[_0x092f('0x3a')]=qs[_0x092f('0x3b')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x3b')]);_0x2cf40e[_0x092f('0x3e')]=qs['filters'](_[_0x092f('0x3c')](_0xf0dff3[_0x092f('0x31')],_0x431ded[_0x092f('0x32')]));if(_0xf0dff3['query'][_0x092f('0x3d')]){_0x2cf40e['where']=_[_0x092f('0x3f')](_0x2cf40e[_0x092f('0x3e')],{'$or':_[_0x092f('0x40')](_0x2cf40e['attributes'],function(_0x2644d3){var _0x1ea876={};_0x1ea876[_0x2644d3]={'$like':'%'+_0xf0dff3['query'][_0x092f('0x3d')]+'%'};return _0x1ea876;})});}_0x2cf40e=_['merge']({},_0x2cf40e,_0xf0dff3[_0x092f('0x44')]);return _0x1911a8['getSubjects'](_0x2cf40e);}})[_0x092f('0x19')](function(_0x55807e){if(_0x55807e){_0x24e766=_0x55807e['length'];if(!_0xf0dff3[_0x092f('0x31')][_0x092f('0x38')]('nolimit')){_0x2cf40e[_0x092f('0x39')]=qs[_0x092f('0x39')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x39')]);_0x2cf40e['offset']=qs[_0x092f('0x28')](_0xf0dff3[_0x092f('0x31')][_0x092f('0x28')]);}return _0x1911a8['getSubjects'](_0x2cf40e);}})['then'](function(_0x3f86fd){if(_0x3f86fd){return _0x3f86fd?{'count':_0x24e766,'rows':_0x3f86fd}:null;}})[_0x092f('0x19')](respondWithResult(_0x2f4983,null))['catch'](handleError(_0x2f4983,null));};exports[_0x092f('0x54')]=function(_0x2f1db2,_0x197e5d,_0x2e4d47){var _0x9f597c={};var _0x3aea42={};var _0x2ba759;var _0x4049f4;return db[_0x092f('0x2f')][_0x092f('0x4f')]({'where':{'id':_0x2f1db2['params']['id']}})['then'](handleEntityNotFound(_0x197e5d,null))[_0x092f('0x19')](function(_0x23e69a){if(_0x23e69a){_0x2ba759=_0x23e69a;_0x3aea42['model']=_[_0x092f('0x30')](db[_0x092f('0x50')][_0x092f('0x51')]);_0x3aea42[_0x092f('0x31')]=_[_0x092f('0x30')](_0x2f1db2[_0x092f('0x31')]);_0x3aea42[_0x092f('0x32')]=_[_0x092f('0x33')](_0x3aea42[_0x092f('0x34')],_0x3aea42[_0x092f('0x31')]);_0x9f597c[_0x092f('0x36')]=_[_0x092f('0x33')](_0x3aea42[_0x092f('0x34')],qs[_0x092f('0x35')](_0x2f1db2[_0x092f('0x31')][_0x092f('0x35')]));_0x9f597c[_0x092f('0x36')]=_0x9f597c[_0x092f('0x36')]['length']?_0x9f597c[_0x092f('0x36')]:_0x3aea42[_0x092f('0x34')];_0x9f597c['order']=qs[_0x092f('0x3b')](_0x2f1db2['query'][_0x092f('0x3b')]);_0x9f597c[_0x092f('0x3e')]=qs[_0x092f('0x32')](_['pick'](_0x2f1db2[_0x092f('0x31')],_0x3aea42[_0x092f('0x32')]));if(_0x2f1db2[_0x092f('0x31')][_0x092f('0x3d')]){_0x9f597c[_0x092f('0x3e')]=_[_0x092f('0x3f')](_0x9f597c[_0x092f('0x3e')],{'$or':_['map'](_0x9f597c['attributes'],function(_0x2b1f5f){var _0x1c1f26={};_0x1c1f26[_0x2b1f5f]={'$like':'%'+_0x2f1db2[_0x092f('0x31')][_0x092f('0x3d')]+'%'};return _0x1c1f26;})});}_0x9f597c=_[_0x092f('0x3f')]({},_0x9f597c,_0x2f1db2['options']);return _0x2ba759[_0x092f('0x54')](_0x9f597c);}})['then'](function(_0x4616b0){if(_0x4616b0){_0x4049f4=_0x4616b0[_0x092f('0x37')];if(!_0x2f1db2[_0x092f('0x31')]['hasOwnProperty'](_0x092f('0x52'))){_0x9f597c['limit']=qs[_0x092f('0x39')](_0x2f1db2[_0x092f('0x31')][_0x092f('0x39')]);_0x9f597c[_0x092f('0x28')]=qs[_0x092f('0x28')](_0x2f1db2[_0x092f('0x31')]['offset']);}return _0x2ba759[_0x092f('0x54')](_0x9f597c);}})[_0x092f('0x19')](function(_0x4424c5){if(_0x4424c5){return _0x4424c5?{'count':_0x4049f4,'rows':_0x4424c5}:null;}})[_0x092f('0x19')](respondWithResult(_0x197e5d,null))[_0x092f('0x23')](handleError(_0x197e5d,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 95f485a..5243ae4 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x46279b,_0x2d7e20){var _0x38e9f6=function(_0x2294df){while(--_0x2294df){_0x46279b['push'](_0x46279b['shift']());}};_0x38e9f6(++_0x2d7e20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4217c2,_0x7b64a3){var _0x580b64=function(_0x309e9a){while(--_0x309e9a){_0x4217c2['push'](_0x4217c2['shift']());}};_0x580b64(++_0x7b64a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 9be62c5..7775be1 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 _0xd939=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','error','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd939,0x1ac));var _0x9d93=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0xd939[_0x57dc85];return _0x563a2e;};'use strict';var _=require(_0x9d93('0x0'));var util=require(_0x9d93('0x1'));var moment=require(_0x9d93('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d93('0x3'));var fs=require('fs');var Redis=require(_0x9d93('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d93('0x5'));var logger=require(_0x9d93('0x6'))(_0x9d93('0x7'));var config=require(_0x9d93('0x8'));var jayson=require(_0x9d93('0x9'));var client=jayson['client'][_0x9d93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bc7db,_0x43d9fe,_0x2ae0ca){return new BPromise(function(_0xc84d49,_0x4a6ea7){return client[_0x9d93('0xb')](_0x2bc7db,_0x2ae0ca)['then'](function(_0x37cc71){logger[_0x9d93('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x43d9fe,_0x9d93('0xd'));logger[_0x9d93('0xe')](_0x9d93('0xf'),_0x43d9fe,_0x9d93('0xd'),JSON['stringify'](_0x37cc71));if(_0x37cc71['error']){if(_0x37cc71['error'][_0x9d93('0x10')]===0x1f4){logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x37cc71[_0x9d93('0x11')]['message']);return _0x4a6ea7(_0x37cc71[_0x9d93('0x11')]['message']);}logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x37cc71[_0x9d93('0x11')]['message']);return _0xc84d49(_0x37cc71['error'][_0x9d93('0x13')]);}else{logger[_0x9d93('0xc')](_0x9d93('0x12'),_0x43d9fe,_0x9d93('0xd'));_0xc84d49(_0x37cc71[_0x9d93('0x14')][_0x9d93('0x13')]);}})['catch'](function(_0x8d38a7){logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x8d38a7);_0x4a6ea7(_0x8d38a7);});});} \ No newline at end of file +var _0x9642=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9642,0x13e));var _0x2964=function(_0x5a470d,_0x57b379){_0x5a470d=_0x5a470d-0x0;var _0x4bfc10=_0x9642[_0x5a470d];return _0x4bfc10;};'use strict';var _=require(_0x2964('0x0'));var util=require('util');var moment=require(_0x2964('0x1'));var BPromise=require(_0x2964('0x2'));var rs=require(_0x2964('0x3'));var fs=require('fs');var Redis=require(_0x2964('0x4'));var db=require(_0x2964('0x5'))['db'];var utils=require(_0x2964('0x6'));var logger=require('../../config/logger')(_0x2964('0x7'));var config=require(_0x2964('0x8'));var jayson=require(_0x2964('0x9'));var client=jayson[_0x2964('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x600e2a,_0x52d2ee,_0x5b0f39){return new BPromise(function(_0x414af9,_0x482970){return client[_0x2964('0xb')](_0x600e2a,_0x5b0f39)['then'](function(_0xf17ade){logger[_0x2964('0xc')](_0x2964('0xd'),_0x52d2ee,_0x2964('0xe'));logger['debug'](_0x2964('0xf'),_0x52d2ee,'request\x20sent',JSON[_0x2964('0x10')](_0xf17ade));if(_0xf17ade['error']){if(_0xf17ade[_0x2964('0x11')][_0x2964('0x12')]===0x1f4){logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0xf17ade[_0x2964('0x11')][_0x2964('0x13')]);return _0x482970(_0xf17ade['error']['message']);}logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0xf17ade[_0x2964('0x11')][_0x2964('0x13')]);return _0x414af9(_0xf17ade['error']['message']);}else{logger[_0x2964('0xc')](_0x2964('0xd'),_0x52d2ee,_0x2964('0xe'));_0x414af9(_0xf17ade['result']['message']);}})['catch'](function(_0x1f0937){logger[_0x2964('0x11')](_0x2964('0xd'),_0x52d2ee,_0x1f0937);_0x482970(_0x1f0937);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 9d3dc7c..9a4223a 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 _0x1c55=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0xab5f15,_0x5c1860){var _0x56290a=function(_0x226869){while(--_0x226869){_0xab5f15['push'](_0xab5f15['shift']());}};_0x56290a(++_0x5c1860);}(_0x1c55,0xbb));var _0x51c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c55[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x51c5('0x0'));var util=require(_0x51c5('0x1'));var path=require(_0x51c5('0x2'));var timeout=require(_0x51c5('0x3'));var express=require(_0x51c5('0x4'));var router=express[_0x51c5('0x5')]();var auth=require(_0x51c5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51c5('0x7'));var controller=require(_0x51c5('0x8'));router[_0x51c5('0x9')]('/',auth[_0x51c5('0xa')](),controller[_0x51c5('0xb')]);router[_0x51c5('0x9')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller['show']);router[_0x51c5('0xd')]('/',auth['isAuthenticated'](),controller[_0x51c5('0xe')]);router[_0x51c5('0xf')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller[_0x51c5('0x10')]);router[_0x51c5('0x11')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller[_0x51c5('0x12')]);module[_0x51c5('0x13')]=router; \ No newline at end of file +var _0xb587=['put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','show','create'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xb587,0x74));var _0x7b58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb587[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7b58('0x0'));var util=require(_0x7b58('0x1'));var path=require(_0x7b58('0x2'));var timeout=require(_0x7b58('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7b58('0x4'));var interaction=require(_0x7b58('0x5'));var config=require(_0x7b58('0x6'));var controller=require(_0x7b58('0x7'));router['get']('/',auth[_0x7b58('0x8')](),controller['index']);router['get'](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xa')]);router['post']('/',auth[_0x7b58('0x8')](),controller[_0x7b58('0xb')]);router[_0x7b58('0xc')](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xd')]);router['delete'](_0x7b58('0x9'),auth[_0x7b58('0x8')](),controller[_0x7b58('0xe')]);module[_0x7b58('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 6bb7f9f..7800a27 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 _0x702d=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x2c0723,_0x1c99cb){var _0x5b468f=function(_0x14d4fc){while(--_0x14d4fc){_0x2c0723['push'](_0x2c0723['shift']());}};_0x5b468f(++_0x1c99cb);}(_0x702d,0x147));var _0xd702=function(_0x478ff1,_0x3158fc){_0x478ff1=_0x478ff1-0x0;var _0x22fa4c=_0x702d[_0x478ff1];return _0x22fa4c;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'type':{'type':Sequelize[_0xd702('0x2')](_0xd702('0x3'),_0xd702('0x4'),'customVariable',_0xd702('0x5')),'defaultValue':_0xd702('0x3')},'content':{'type':Sequelize[_0xd702('0x6')]},'key':{'type':Sequelize[_0xd702('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd702('0x3'),'variable',_0xd702('0x7'))},'keyContent':{'type':Sequelize[_0xd702('0x6')]},'idField':{'type':Sequelize[_0xd702('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3071('0x5')]},'key':{'type':Sequelize[_0x3071('0x5')]},'keyType':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'))},'keyContent':{'type':Sequelize[_0x3071('0x5')]},'idField':{'type':Sequelize[_0x3071('0x5')]},'nameField':{'type':Sequelize[_0x3071('0x5')]},'customField':{'type':Sequelize[_0x3071('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3071('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b051b36..00b2c5d 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 _0xe5d5=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','index','VtigerField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','options','count','then','include','findAll','rows','catch','show','params','includeAll','create','body','find','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x340c09,_0xc08941){var _0x1cc1b6=function(_0x193f75){while(--_0x193f75){_0x340c09['push'](_0x340c09['shift']());}};_0x1cc1b6(++_0xc08941);}(_0xe5d5,0x156));var _0x5e5d=function(_0x4cb0c5,_0xa5dbe3){_0x4cb0c5=_0x4cb0c5-0x0;var _0x2e4ec9=_0xe5d5[_0x4cb0c5];return _0x2e4ec9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5e5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e5d('0x1'));var rp=require('request-promise');var moment=require(_0x5e5d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5e5d('0x3'));var util=require(_0x5e5d('0x4'));var path=require(_0x5e5d('0x5'));var sox=require(_0x5e5d('0x6'));var csv=require(_0x5e5d('0x7'));var ejs=require(_0x5e5d('0x8'));var fs=require('fs');var _=require(_0x5e5d('0x9'));var squel=require(_0x5e5d('0xa'));var crypto=require(_0x5e5d('0xb'));var jsforce=require(_0x5e5d('0xc'));var deskjs=require(_0x5e5d('0xd'));var toCsv=require(_0x5e5d('0x7'));var querystring=require(_0x5e5d('0xe'));var Papa=require(_0x5e5d('0xf'));var Redis=require('ioredis');var authService=require(_0x5e5d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5e5d('0x11'));var logger=require(_0x5e5d('0x12'))('api');var utils=require(_0x5e5d('0x13'));var config=require(_0x5e5d('0x14'));var db=require(_0x5e5d('0x15'))['db'];function respondWithStatusCode(_0x35e513,_0x4a10c8){_0x4a10c8=_0x4a10c8||0xcc;return function(_0x4ff045){if(_0x4ff045){return _0x35e513[_0x5e5d('0x16')](_0x4a10c8);}return _0x35e513[_0x5e5d('0x17')](_0x4a10c8)['end']();};}function respondWithResult(_0x2a743d,_0x2cf150){_0x2cf150=_0x2cf150||0xc8;return function(_0x5a4474){if(_0x5a4474){return _0x2a743d[_0x5e5d('0x17')](_0x2cf150)[_0x5e5d('0x18')](_0x5a4474);}};}function respondWithFilteredResult(_0x5a5258,_0x5a8457){return function(_0x5bf617){if(_0x5bf617){var _0x1a3e5c=_0x5bf617['count'],_0x3dfb7e=_0x5a8457[_0x5e5d('0x19')],_0x79e8c1=_0x5a8457[_0x5e5d('0x19')]+_0x5a8457[_0x5e5d('0x1a')],_0x1e2d44;if(_0x79e8c1>=_0x1a3e5c){_0x79e8c1=_0x1a3e5c;_0x1e2d44=0xc8;}else{_0x1e2d44=0xce;}_0x5a5258[_0x5e5d('0x17')](_0x1e2d44);return _0x5a5258[_0x5e5d('0x1b')](_0x5e5d('0x1c'),_0x3dfb7e+'-'+_0x79e8c1+'/'+_0x1a3e5c)[_0x5e5d('0x18')](_0x5bf617);}return null;};}function patchUpdates(_0x27e197){return function(_0x4ae3f3){try{jsonpatch[_0x5e5d('0x1d')](_0x4ae3f3,_0x27e197,!![]);}catch(_0x1ceea7){return BPromise[_0x5e5d('0x1e')](_0x1ceea7);}return _0x4ae3f3[_0x5e5d('0x1f')]();};}function saveUpdates(_0xd3b6d6,_0xf8fe10){return function(_0x517b89){if(_0x517b89){return _0x517b89[_0x5e5d('0x20')](_0xd3b6d6)['then'](function(_0x968d4b){return _0x968d4b;});}return null;};}function removeEntity(_0x2f1eab,_0x3c5dd0){return function(_0x4c9973){if(_0x4c9973){return _0x4c9973[_0x5e5d('0x21')]()['then'](function(){_0x2f1eab[_0x5e5d('0x17')](0xcc)[_0x5e5d('0x22')]();});}};}function handleEntityNotFound(_0x3e8a1d,_0x49a558){return function(_0x49d2e5){if(!_0x49d2e5){_0x3e8a1d[_0x5e5d('0x16')](0x194);}return _0x49d2e5;};}function handleError(_0x1d5078,_0x5bef18){_0x5bef18=_0x5bef18||0x1f4;return function(_0x537564){logger[_0x5e5d('0x23')](_0x537564[_0x5e5d('0x24')]);if(_0x537564[_0x5e5d('0x25')]){delete _0x537564['name'];}_0x1d5078[_0x5e5d('0x17')](_0x5bef18)['send'](_0x537564);};}exports[_0x5e5d('0x26')]=function(_0x4ed6e5,_0x15abf2){var _0x20ba59={},_0x180816={},_0x442324={'count':0x0,'rows':[]};var _0x425b5c=db[_0x5e5d('0x27')][_0x5e5d('0x28')];_0x180816['model']=_[_0x5e5d('0x29')](_0x425b5c);_0x180816[_0x5e5d('0x2a')]=_[_0x5e5d('0x29')](_0x4ed6e5[_0x5e5d('0x2a')]);_0x180816[_0x5e5d('0x2b')]=_[_0x5e5d('0x2c')](_0x180816[_0x5e5d('0x2d')],_0x180816[_0x5e5d('0x2a')]);_0x20ba59[_0x5e5d('0x2e')]=_['intersection'](_0x180816[_0x5e5d('0x2d')],qs['fields'](_0x4ed6e5['query'][_0x5e5d('0x2f')]));_0x20ba59[_0x5e5d('0x2e')]=_0x20ba59[_0x5e5d('0x2e')][_0x5e5d('0x30')]?_0x20ba59[_0x5e5d('0x2e')]:_0x180816['model'];if(!_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x31')](_0x5e5d('0x32'))){_0x20ba59[_0x5e5d('0x1a')]=qs[_0x5e5d('0x1a')](_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x1a')]);_0x20ba59['offset']=qs[_0x5e5d('0x19')](_0x4ed6e5[_0x5e5d('0x2a')]['offset']);}_0x20ba59['order']=qs[_0x5e5d('0x33')](_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x33')]);_0x20ba59[_0x5e5d('0x34')]=qs[_0x5e5d('0x2b')](_[_0x5e5d('0x35')](_0x4ed6e5['query'],_0x180816[_0x5e5d('0x2b')]));if(_0x4ed6e5['query'][_0x5e5d('0x36')]){_0x20ba59[_0x5e5d('0x34')]=_[_0x5e5d('0x37')](_0x20ba59[_0x5e5d('0x34')],{'$or':_[_0x5e5d('0x38')](_0x425b5c,function(_0x5ba035){if(_0x5ba035[_0x5e5d('0x39')][_0x5e5d('0x3a')]!=='VIRTUAL'){var _0x13ec9c={};_0x13ec9c[_0x5ba035['field']]={'$like':'%'+_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x36')]+'%'};return _0x13ec9c;}})});}_0x20ba59=_[_0x5e5d('0x37')]({},_0x20ba59,_0x4ed6e5[_0x5e5d('0x3b')]);var _0x25c347={'where':_0x20ba59[_0x5e5d('0x34')]};return db[_0x5e5d('0x27')][_0x5e5d('0x3c')](_0x25c347)[_0x5e5d('0x3d')](function(_0x27636d){_0x442324[_0x5e5d('0x3c')]=_0x27636d;if(_0x4ed6e5[_0x5e5d('0x2a')]['includeAll']){_0x20ba59[_0x5e5d('0x3e')]=[{'all':!![]}];}return db[_0x5e5d('0x27')][_0x5e5d('0x3f')](_0x20ba59);})[_0x5e5d('0x3d')](function(_0x225ad5){_0x442324[_0x5e5d('0x40')]=_0x225ad5;return _0x442324;})['then'](respondWithFilteredResult(_0x15abf2,_0x20ba59))[_0x5e5d('0x41')](handleError(_0x15abf2,null));};exports[_0x5e5d('0x42')]=function(_0x4c2667,_0x162e74){var _0x38698e={'raw':!![],'where':{'id':_0x4c2667[_0x5e5d('0x43')]['id']}},_0x1f1186={};_0x1f1186[_0x5e5d('0x2d')]=_[_0x5e5d('0x29')](db['VtigerField']['rawAttributes']);_0x1f1186[_0x5e5d('0x2a')]=_['keys'](_0x4c2667[_0x5e5d('0x2a')]);_0x1f1186['filters']=_['intersection'](_0x1f1186[_0x5e5d('0x2d')],_0x1f1186['query']);_0x38698e['attributes']=_[_0x5e5d('0x2c')](_0x1f1186[_0x5e5d('0x2d')],qs[_0x5e5d('0x2f')](_0x4c2667[_0x5e5d('0x2a')][_0x5e5d('0x2f')]));_0x38698e[_0x5e5d('0x2e')]=_0x38698e['attributes']['length']?_0x38698e['attributes']:_0x1f1186[_0x5e5d('0x2d')];if(_0x4c2667['query'][_0x5e5d('0x44')]){_0x38698e[_0x5e5d('0x3e')]=[{'all':!![]}];}_0x38698e=_['merge']({},_0x38698e,_0x4c2667[_0x5e5d('0x3b')]);return db[_0x5e5d('0x27')]['find'](_0x38698e)[_0x5e5d('0x3d')](handleEntityNotFound(_0x162e74,null))[_0x5e5d('0x3d')](respondWithResult(_0x162e74,null))[_0x5e5d('0x41')](handleError(_0x162e74,null));};exports[_0x5e5d('0x45')]=function(_0x3ba75f,_0x4b6fc9){return db[_0x5e5d('0x27')][_0x5e5d('0x45')](_0x3ba75f[_0x5e5d('0x46')],{})[_0x5e5d('0x3d')](respondWithResult(_0x4b6fc9,0xc9))[_0x5e5d('0x41')](handleError(_0x4b6fc9,null));};exports[_0x5e5d('0x20')]=function(_0x117e05,_0x24eb0f){if(_0x117e05['body']['id']){delete _0x117e05[_0x5e5d('0x46')]['id'];}return db[_0x5e5d('0x27')][_0x5e5d('0x47')]({'where':{'id':_0x117e05['params']['id']}})[_0x5e5d('0x3d')](handleEntityNotFound(_0x24eb0f,null))[_0x5e5d('0x3d')](saveUpdates(_0x117e05['body'],null))[_0x5e5d('0x3d')](respondWithResult(_0x24eb0f,null))[_0x5e5d('0x41')](handleError(_0x24eb0f,null));};exports[_0x5e5d('0x21')]=function(_0x56e0ac,_0x3df625){return db[_0x5e5d('0x27')][_0x5e5d('0x47')]({'where':{'id':_0x56e0ac[_0x5e5d('0x43')]['id']}})[_0x5e5d('0x3d')](handleEntityNotFound(_0x3df625,null))['then'](removeEntity(_0x3df625,null))[_0x5e5d('0x41')](handleError(_0x3df625,null));}; \ No newline at end of file +var _0x24ca=['show','find','create','body','update','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','reject','save','then','destroy','end','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','options','VtigerField','count','includeAll','include','findAll','rows','catch'];(function(_0x53ca0a,_0x2264cc){var _0x457ff2=function(_0xde79b0){while(--_0xde79b0){_0x53ca0a['push'](_0x53ca0a['shift']());}};_0x457ff2(++_0x2264cc);}(_0x24ca,0x1bc));var _0xa24c=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x24ca[_0x11a220];return _0x20d8fe;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa24c('0x1'));var zipdir=require(_0xa24c('0x2'));var jsonpatch=require(_0xa24c('0x3'));var rp=require('request-promise');var moment=require(_0xa24c('0x4'));var BPromise=require(_0xa24c('0x5'));var Mustache=require(_0xa24c('0x6'));var util=require(_0xa24c('0x7'));var path=require(_0xa24c('0x8'));var sox=require(_0xa24c('0x9'));var csv=require(_0xa24c('0xa'));var ejs=require(_0xa24c('0xb'));var fs=require('fs');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('0xa'));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 hardwareService=require(_0xa24c('0x14'));var logger=require(_0xa24c('0x15'))(_0xa24c('0x16'));var utils=require(_0xa24c('0x17'));var config=require(_0xa24c('0x18'));var db=require(_0xa24c('0x19'))['db'];function respondWithStatusCode(_0x5aa811,_0x43bcd3){_0x43bcd3=_0x43bcd3||0xcc;return function(_0x11090c){if(_0x11090c){return _0x5aa811[_0xa24c('0x1a')](_0x43bcd3);}return _0x5aa811[_0xa24c('0x1b')](_0x43bcd3)['end']();};}function respondWithResult(_0x3ad0bf,_0x3c23fc){_0x3c23fc=_0x3c23fc||0xc8;return function(_0x26ff28){if(_0x26ff28){return _0x3ad0bf[_0xa24c('0x1b')](_0x3c23fc)[_0xa24c('0x1c')](_0x26ff28);}};}function respondWithFilteredResult(_0x2d185c,_0x448275){return function(_0x5d4727){if(_0x5d4727){var _0x47a063=_0x5d4727['count'],_0xb80781=_0x448275[_0xa24c('0x1d')],_0x87aa90=_0x448275[_0xa24c('0x1d')]+_0x448275['limit'],_0x49ce53;if(_0x87aa90>=_0x47a063){_0x87aa90=_0x47a063;_0x49ce53=0xc8;}else{_0x49ce53=0xce;}_0x2d185c[_0xa24c('0x1b')](_0x49ce53);return _0x2d185c['set'](_0xa24c('0x1e'),_0xb80781+'-'+_0x87aa90+'/'+_0x47a063)[_0xa24c('0x1c')](_0x5d4727);}return null;};}function patchUpdates(_0x1fcd4b){return function(_0xefdbd9){try{jsonpatch['apply'](_0xefdbd9,_0x1fcd4b,!![]);}catch(_0x16d363){return BPromise[_0xa24c('0x1f')](_0x16d363);}return _0xefdbd9[_0xa24c('0x20')]();};}function saveUpdates(_0x4d4bab,_0x48a768){return function(_0x506424){if(_0x506424){return _0x506424['update'](_0x4d4bab)[_0xa24c('0x21')](function(_0x174b69){return _0x174b69;});}return null;};}function removeEntity(_0x26e9c3,_0x180297){return function(_0x51a275){if(_0x51a275){return _0x51a275[_0xa24c('0x22')]()['then'](function(){_0x26e9c3[_0xa24c('0x1b')](0xcc)[_0xa24c('0x23')]();});}};}function handleEntityNotFound(_0x4a1cda,_0x346ee8){return function(_0x363d52){if(!_0x363d52){_0x4a1cda[_0xa24c('0x1a')](0x194);}return _0x363d52;};}function handleError(_0x188ee2,_0x14cc65){_0x14cc65=_0x14cc65||0x1f4;return function(_0x47e0eb){logger[_0xa24c('0x24')](_0x47e0eb['stack']);if(_0x47e0eb[_0xa24c('0x25')]){delete _0x47e0eb[_0xa24c('0x25')];}_0x188ee2[_0xa24c('0x1b')](_0x14cc65)['send'](_0x47e0eb);};}exports[_0xa24c('0x26')]=function(_0x31c4d9,_0x14fd5a){var _0x314121={},_0x11e4e0={},_0x3ad0e6={'count':0x0,'rows':[]};var _0x39609a=db['VtigerField'][_0xa24c('0x27')];_0x11e4e0[_0xa24c('0x28')]=_[_0xa24c('0x29')](_0x39609a);_0x11e4e0[_0xa24c('0x2a')]=_['keys'](_0x31c4d9[_0xa24c('0x2a')]);_0x11e4e0[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],_0x11e4e0[_0xa24c('0x2a')]);_0x314121[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x11e4e0['model'],qs[_0xa24c('0x2e')](_0x31c4d9['query'][_0xa24c('0x2e')]));_0x314121[_0xa24c('0x2d')]=_0x314121[_0xa24c('0x2d')]['length']?_0x314121[_0xa24c('0x2d')]:_0x11e4e0[_0xa24c('0x28')];if(!_0x31c4d9[_0xa24c('0x2a')]['hasOwnProperty'](_0xa24c('0x2f'))){_0x314121['limit']=qs[_0xa24c('0x30')](_0x31c4d9[_0xa24c('0x2a')]['limit']);_0x314121['offset']=qs[_0xa24c('0x1d')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x1d')]);}_0x314121[_0xa24c('0x31')]=qs[_0xa24c('0x32')](_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x32')]);_0x314121['where']=qs[_0xa24c('0x2b')](_[_0xa24c('0x33')](_0x31c4d9[_0xa24c('0x2a')],_0x11e4e0[_0xa24c('0x2b')]));if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x34')]){_0x314121[_0xa24c('0x35')]=_[_0xa24c('0x36')](_0x314121[_0xa24c('0x35')],{'$or':_[_0xa24c('0x37')](_0x39609a,function(_0x4c7a30){if(_0x4c7a30[_0xa24c('0x38')][_0xa24c('0x39')]!==_0xa24c('0x3a')){var _0x1b0757={};_0x1b0757[_0x4c7a30['field']]={'$like':'%'+_0x31c4d9['query'][_0xa24c('0x34')]+'%'};return _0x1b0757;}})});}_0x314121=_['merge']({},_0x314121,_0x31c4d9[_0xa24c('0x3b')]);var _0x13f272={'where':_0x314121[_0xa24c('0x35')]};return db[_0xa24c('0x3c')][_0xa24c('0x3d')](_0x13f272)['then'](function(_0x532875){_0x3ad0e6[_0xa24c('0x3d')]=_0x532875;if(_0x31c4d9[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x314121[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x3c')][_0xa24c('0x40')](_0x314121);})['then'](function(_0x56f392){_0x3ad0e6[_0xa24c('0x41')]=_0x56f392;return _0x3ad0e6;})[_0xa24c('0x21')](respondWithFilteredResult(_0x14fd5a,_0x314121))[_0xa24c('0x42')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x43')]=function(_0x43beff,_0x4c5b7e){var _0x171c51={'raw':!![],'where':{'id':_0x43beff['params']['id']}},_0x7895e={};_0x7895e['model']=_[_0xa24c('0x29')](db[_0xa24c('0x3c')][_0xa24c('0x27')]);_0x7895e['query']=_['keys'](_0x43beff[_0xa24c('0x2a')]);_0x7895e[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],_0x7895e[_0xa24c('0x2a')]);_0x171c51[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x7895e[_0xa24c('0x28')],qs['fields'](_0x43beff['query'][_0xa24c('0x2e')]));_0x171c51[_0xa24c('0x2d')]=_0x171c51[_0xa24c('0x2d')]['length']?_0x171c51[_0xa24c('0x2d')]:_0x7895e[_0xa24c('0x28')];if(_0x43beff[_0xa24c('0x2a')][_0xa24c('0x3e')]){_0x171c51[_0xa24c('0x3f')]=[{'all':!![]}];}_0x171c51=_[_0xa24c('0x36')]({},_0x171c51,_0x43beff[_0xa24c('0x3b')]);return db[_0xa24c('0x3c')][_0xa24c('0x44')](_0x171c51)[_0xa24c('0x21')](handleEntityNotFound(_0x4c5b7e,null))['then'](respondWithResult(_0x4c5b7e,null))[_0xa24c('0x42')](handleError(_0x4c5b7e,null));};exports[_0xa24c('0x45')]=function(_0x39a6cd,_0x5aa2b2){return db[_0xa24c('0x3c')][_0xa24c('0x45')](_0x39a6cd[_0xa24c('0x46')],{})[_0xa24c('0x21')](respondWithResult(_0x5aa2b2,0xc9))[_0xa24c('0x42')](handleError(_0x5aa2b2,null));};exports[_0xa24c('0x47')]=function(_0x1a20bd,_0x46f725){if(_0x1a20bd[_0xa24c('0x46')]['id']){delete _0x1a20bd[_0xa24c('0x46')]['id'];}return db[_0xa24c('0x3c')]['find']({'where':{'id':_0x1a20bd[_0xa24c('0x48')]['id']}})[_0xa24c('0x21')](handleEntityNotFound(_0x46f725,null))[_0xa24c('0x21')](saveUpdates(_0x1a20bd[_0xa24c('0x46')],null))[_0xa24c('0x21')](respondWithResult(_0x46f725,null))[_0xa24c('0x42')](handleError(_0x46f725,null));};exports[_0xa24c('0x22')]=function(_0x2250b9,_0x184179){return db['VtigerField']['find']({'where':{'id':_0x2250b9[_0xa24c('0x48')]['id']}})['then'](handleEntityNotFound(_0x184179,null))[_0xa24c('0x21')](removeEntity(_0x184179,null))[_0xa24c('0x42')](handleError(_0x184179,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 0f57b29..e17e3a5 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 _0x08e0=['request-promise','path','../../config/environment','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','bluebird'];(function(_0x5bfb95,_0x5c7940){var _0x2d17b9=function(_0xd4ff1c){while(--_0xd4ff1c){_0x5bfb95['push'](_0x5bfb95['shift']());}};_0x2d17b9(++_0x5c7940);}(_0x08e0,0x1e1));var _0x008e=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x08e0[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x008e('0x2'));var rp=require(_0x008e('0x3'));var fs=require('fs');var path=require(_0x008e('0x4'));var rimraf=require('rimraf');var config=require(_0x008e('0x5'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x43ebba,_0x1c9220){return _0x43ebba[_0x008e('0x6')](_0x008e('0x7'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x008e('0x8'),'fields':[_0x008e('0x9'),_0x008e('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c1f=['VtigerField','vtiger_unique_index','idField','FieldId','util','../../config/logger','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define'];(function(_0x11a5f0,_0x1f323b){var _0x14be6a=function(_0x3135b6){while(--_0x3135b6){_0x11a5f0['push'](_0x11a5f0['shift']());}};_0x14be6a(++_0x1f323b);}(_0x3c1f,0x170));var _0xf3c1=function(_0x28cf9c,_0x5bfe56){_0x28cf9c=_0x28cf9c-0x0;var _0x29abdd=_0x3c1f[_0x28cf9c];return _0x29abdd;};'use strict';var _=require('lodash');var util=require(_0xf3c1('0x0'));var logger=require(_0xf3c1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf3c1('0x2'));var rp=require(_0xf3c1('0x3'));var fs=require('fs');var path=require(_0xf3c1('0x4'));var rimraf=require(_0xf3c1('0x5'));var config=require('../../config/environment');var attributes=require(_0xf3c1('0x6'));module[_0xf3c1('0x7')]=function(_0x197330,_0x4b4bec){return _0x197330[_0xf3c1('0x8')](_0xf3c1('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xf3c1('0xa'),'fields':[_0xf3c1('0xb'),_0xf3c1('0xc')],'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 9ddcc3b..bec753a 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 _0x30fb=['code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x30fb,0x13e));var _0xb30f=function(_0x222fb3,_0x8ffafd){_0x222fb3=_0x222fb3-0x0;var _0x7ee839=_0x30fb[_0x222fb3];return _0x7ee839;};'use strict';var _=require(_0xb30f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb30f('0x1'));var rs=require(_0xb30f('0x2'));var fs=require('fs');var Redis=require(_0xb30f('0x3'));var db=require(_0xb30f('0x4'))['db'];var utils=require(_0xb30f('0x5'));var logger=require(_0xb30f('0x6'))(_0xb30f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb30f('0x8')][_0xb30f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de1c1,_0x4341ea,_0x744084){return new BPromise(function(_0x5e1b9d,_0x58ac3c){return client[_0xb30f('0xa')](_0x5de1c1,_0x744084)['then'](function(_0x331c23){logger[_0xb30f('0xb')](_0xb30f('0xc'),_0x4341ea,_0xb30f('0xd'));logger[_0xb30f('0xe')](_0xb30f('0xf'),_0x4341ea,_0xb30f('0xd'),JSON[_0xb30f('0x10')](_0x331c23));if(_0x331c23['error']){if(_0x331c23[_0xb30f('0x11')][_0xb30f('0x12')]===0x1f4){logger[_0xb30f('0x11')]('VtigerField,\x20%s,\x20%s',_0x4341ea,_0x331c23[_0xb30f('0x11')]['message']);return _0x58ac3c(_0x331c23['error'][_0xb30f('0x13')]);}logger[_0xb30f('0x11')](_0xb30f('0xc'),_0x4341ea,_0x331c23[_0xb30f('0x11')]['message']);return _0x5e1b9d(_0x331c23[_0xb30f('0x11')][_0xb30f('0x13')]);}else{logger[_0xb30f('0xb')]('VtigerField,\x20%s,\x20%s',_0x4341ea,_0xb30f('0xd'));_0x5e1b9d(_0x331c23['result'][_0xb30f('0x13')]);}})[_0xb30f('0x14')](function(_0x3d6b36){logger[_0xb30f('0x11')](_0xb30f('0xc'),_0x4341ea,_0x3d6b36);_0x58ac3c(_0x3d6b36);});});} \ No newline at end of file +var _0x79e8=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x112cd5,_0x192331){var _0x4523ef=function(_0x543888){while(--_0x543888){_0x112cd5['push'](_0x112cd5['shift']());}};_0x4523ef(++_0x192331);}(_0x79e8,0x1c8));var _0x879e=function(_0x5da648,_0x488b53){_0x5da648=_0x5da648-0x0;var _0x8f765d=_0x79e8[_0x5da648];return _0x8f765d;};'use strict';var _=require(_0x879e('0x0'));var util=require(_0x879e('0x1'));var moment=require(_0x879e('0x2'));var BPromise=require(_0x879e('0x3'));var rs=require(_0x879e('0x4'));var fs=require('fs');var Redis=require(_0x879e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x879e('0x6'))('rpc');var config=require(_0x879e('0x7'));var jayson=require(_0x879e('0x8'));var client=jayson['client'][_0x879e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x967957,_0x1aae1e,_0x148095){return new BPromise(function(_0x1bbd70,_0xd35aa){return client[_0x879e('0xa')](_0x967957,_0x148095)[_0x879e('0xb')](function(_0x20f4cf){logger[_0x879e('0xc')](_0x879e('0xd'),_0x1aae1e,_0x879e('0xe'));logger[_0x879e('0xf')](_0x879e('0x10'),_0x1aae1e,_0x879e('0xe'),JSON['stringify'](_0x20f4cf));if(_0x20f4cf[_0x879e('0x11')]){if(_0x20f4cf[_0x879e('0x11')][_0x879e('0x12')]===0x1f4){logger['error'](_0x879e('0xd'),_0x1aae1e,_0x20f4cf[_0x879e('0x11')][_0x879e('0x13')]);return _0xd35aa(_0x20f4cf[_0x879e('0x11')]['message']);}logger['error']('VtigerField,\x20%s,\x20%s',_0x1aae1e,_0x20f4cf[_0x879e('0x11')][_0x879e('0x13')]);return _0x1bbd70(_0x20f4cf[_0x879e('0x11')]['message']);}else{logger['info'](_0x879e('0xd'),_0x1aae1e,_0x879e('0xe'));_0x1bbd70(_0x20f4cf[_0x879e('0x14')][_0x879e('0x13')]);}})[_0x879e('0x15')](function(_0x1d76c2){logger[_0x879e('0x11')](_0x879e('0xd'),_0x1aae1e,_0x1d76c2);_0xd35aa(_0x1d76c2);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index c820c36..ac8dc73 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 _0xd6e8=['./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9fb75,_0x2b0232){var _0x4ddb83=function(_0x11d062){while(--_0x11d062){_0x9fb75['push'](_0x9fb75['shift']());}};_0x4ddb83(++_0x2b0232);}(_0xd6e8,0xb0));var _0x8d6e=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xd6e8[_0x30a31e];return _0x170879;};'use strict';var multer=require(_0x8d6e('0x0'));var util=require(_0x8d6e('0x1'));var path=require(_0x8d6e('0x2'));var timeout=require(_0x8d6e('0x3'));var express=require(_0x8d6e('0x4'));var router=express['Router']();var auth=require(_0x8d6e('0x5'));var interaction=require(_0x8d6e('0x6'));var config=require(_0x8d6e('0x7'));var controller=require(_0x8d6e('0x8'));router[_0x8d6e('0x9')]('/',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xb')]);router['get'](_0x8d6e('0xc'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xd')]);router[_0x8d6e('0x9')]('/:id/configurations',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xe')]);router['get'](_0x8d6e('0xf'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x10')]);router[_0x8d6e('0x11')]('/',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x12')]);router[_0x8d6e('0x11')]('/:id/configurations',auth[_0x8d6e('0xa')](),controller['addConfiguration']);router[_0x8d6e('0x13')](_0x8d6e('0xc'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x14')]);router[_0x8d6e('0x15')](_0x8d6e('0xc'),auth['isAuthenticated'](),controller[_0x8d6e('0x16')]);module['exports']=router; \ No newline at end of file +var _0xddd6=['Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id/configurations','post','addConfiguration','put','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xddd6,0x12e));var _0x6ddd=function(_0x4cde1b,_0x28c2bc){_0x4cde1b=_0x4cde1b-0x0;var _0x394e8e=_0xddd6[_0x4cde1b];return _0x394e8e;};'use strict';var multer=require(_0x6ddd('0x0'));var util=require('util');var path=require(_0x6ddd('0x1'));var timeout=require(_0x6ddd('0x2'));var express=require(_0x6ddd('0x3'));var router=express[_0x6ddd('0x4')]();var auth=require(_0x6ddd('0x5'));var interaction=require(_0x6ddd('0x6'));var config=require('../../config/environment');var controller=require(_0x6ddd('0x7'));router[_0x6ddd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x6ddd('0x9')](),controller['show']);router[_0x6ddd('0x8')](_0x6ddd('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x6ddd('0x8')]('/:id/fields',auth[_0x6ddd('0x9')](),controller['getFields']);router[_0x6ddd('0xb')]('/',auth[_0x6ddd('0x9')](),controller['create']);router[_0x6ddd('0xb')](_0x6ddd('0xa'),auth[_0x6ddd('0x9')](),controller[_0x6ddd('0xc')]);router[_0x6ddd('0xd')](_0x6ddd('0xe'),auth[_0x6ddd('0x9')](),controller['update']);router['delete'](_0x6ddd('0xe'),auth[_0x6ddd('0x9')](),controller[_0x6ddd('0xf')]);module[_0x6ddd('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c5afd56..459f130 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 _0x1340=['ENUM','password','token','integrationTab','exports','STRING','remoteUri'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1340,0x74));var _0x0134=function(_0x519cee,_0x3e4053){_0x519cee=_0x519cee-0x0;var _0x41e344=_0x1340[_0x519cee];return _0x41e344;};'use strict';var Sequelize=require('sequelize');module[_0x0134('0x0')]={'name':{'type':Sequelize[_0x0134('0x1')]},'description':{'type':Sequelize[_0x0134('0x1')]},'username':{'type':Sequelize[_0x0134('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0134('0x1')]},'token':{'type':Sequelize[_0x0134('0x1')]},'remoteUri':{'type':Sequelize[_0x0134('0x1')],'unique':_0x0134('0x2')},'authType':{'type':Sequelize[_0x0134('0x3')](_0x0134('0x4'),_0x0134('0x5')),'defaultValue':_0x0134('0x4')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0134('0x3')](_0x0134('0x6'),'newTab'),'defaultValue':_0x0134('0x6')}}; \ No newline at end of file +var _0x4bff=['STRING','username','remoteUri','ENUM','password','integrationTab'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0x4bff,0x84));var _0xf4bf=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x4bff[_0x16771d];return _0x386f11;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf4bf('0x0')]},'description':{'type':Sequelize[_0xf4bf('0x0')]},'username':{'type':Sequelize[_0xf4bf('0x0')],'unique':_0xf4bf('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf4bf('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf4bf('0x2')},'authType':{'type':Sequelize[_0xf4bf('0x3')](_0xf4bf('0x4'),'token'),'defaultValue':_0xf4bf('0x4')},'serverUrl':{'type':Sequelize[_0xf4bf('0x0')]},'type':{'type':Sequelize[_0xf4bf('0x3')](_0xf4bf('0x5'),'newTab'),'defaultValue':_0xf4bf('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 4340b28..5328c99 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 _0x2de4=['show','include','find','create','body','params','getConfigurations','map','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','ZendeskField','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','description','group','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../components/integrations/configuration','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','code','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','rows'];(function(_0x5ddf0e,_0x3eed0b){var _0x1b5a0c=function(_0x56af0b){while(--_0x56af0b){_0x5ddf0e['push'](_0x5ddf0e['shift']());}};_0x1b5a0c(++_0x3eed0b);}(_0x2de4,0x1a9));var _0x42de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2de4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x42de('0x0'));var emlformat=require(_0x42de('0x1'));var rimraf=require(_0x42de('0x2'));var zipdir=require(_0x42de('0x3'));var jsonpatch=require(_0x42de('0x4'));var rp=require(_0x42de('0x5'));var moment=require(_0x42de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x42de('0x7'));var util=require('util');var path=require(_0x42de('0x8'));var sox=require('sox');var csv=require(_0x42de('0x9'));var ejs=require(_0x42de('0xa'));var fs=require('fs');var _=require(_0x42de('0xb'));var squel=require(_0x42de('0xc'));var crypto=require(_0x42de('0xd'));var jsforce=require(_0x42de('0xe'));var deskjs=require(_0x42de('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x42de('0x10'));var Redis=require(_0x42de('0x11'));var authService=require(_0x42de('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42de('0x13'))(_0x42de('0x14'));var utils=require('../../config/utils');var config=require(_0x42de('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x42de('0x16'));var jayson=require('jayson/promise');var client=jayson['client'][_0x42de('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3dc31e,_0x1121dd,_0x1fa011){if(_0x1fa011){var _0x4dc49a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4dc49a[_0x42de('0x18')](_0x1121dd)){return _0x3dc31e;}else{throw new Error(_0x42de('0x19'));}}else{return _0x3dc31e;}}function respondWithRpcPromise(_0x337f66,_0x3101a0,_0xbc82f,_0x222803){return new BPromise(function(_0x2ed9d4,_0x11b3c4){var _0x49bc51=_0x222803||client;return _0x49bc51[_0x42de('0x1a')](_0x337f66,_0xbc82f)[_0x42de('0x1b')](function(_0x800f7f){logger[_0x42de('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x3101a0,_0x42de('0x1d'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3101a0,_0x42de('0x1d'),JSON[_0x42de('0x1e')](_0x800f7f));if(_0x800f7f['error']){if(_0x800f7f['error'][_0x42de('0x1f')]===0x1f4){logger[_0x42de('0x20')](_0x42de('0x21'),_0x3101a0,_0x800f7f[_0x42de('0x20')][_0x42de('0x22')]);return _0x11b3c4(_0x800f7f[_0x42de('0x20')]['message']);}logger[_0x42de('0x20')](_0x42de('0x21'),_0x3101a0,_0x800f7f[_0x42de('0x20')]['message']);return _0x2ed9d4(_0x800f7f[_0x42de('0x20')][_0x42de('0x22')]);}else{logger[_0x42de('0x1c')](_0x42de('0x21'),_0x3101a0,_0x42de('0x1d'));_0x2ed9d4(_0x800f7f[_0x42de('0x23')][_0x42de('0x22')]);}})[_0x42de('0x24')](function(_0x4033b8){logger['error'](_0x42de('0x21'),_0x3101a0,_0x4033b8);_0x11b3c4(_0x4033b8);});});}function respondWithStatusCode(_0x437c45,_0x403e4a){_0x403e4a=_0x403e4a||0xcc;return function(_0x1a9f18){if(_0x1a9f18){return _0x437c45[_0x42de('0x25')](_0x403e4a);}return _0x437c45[_0x42de('0x26')](_0x403e4a)[_0x42de('0x27')]();};}function respondWithResult(_0x1bb401,_0x4ec06d){_0x4ec06d=_0x4ec06d||0xc8;return function(_0x753802){if(_0x753802){return _0x1bb401[_0x42de('0x26')](_0x4ec06d)[_0x42de('0x28')](_0x753802);}};}function respondWithFilteredResult(_0x4fdd4d,_0x3a65f2){return function(_0x2da998){if(_0x2da998){var _0x325f7c=_0x2da998[_0x42de('0x29')],_0x484693=_0x3a65f2[_0x42de('0x2a')],_0x332662=_0x3a65f2[_0x42de('0x2a')]+_0x3a65f2[_0x42de('0x2b')],_0x2e4f49;if(_0x332662>=_0x325f7c){_0x332662=_0x325f7c;_0x2e4f49=0xc8;}else{_0x2e4f49=0xce;}_0x4fdd4d['status'](_0x2e4f49);return _0x4fdd4d[_0x42de('0x2c')](_0x42de('0x2d'),_0x484693+'-'+_0x332662+'/'+_0x325f7c)[_0x42de('0x28')](_0x2da998);}return null;};}function patchUpdates(_0xb8c8a9){return function(_0x202721){try{jsonpatch[_0x42de('0x2e')](_0x202721,_0xb8c8a9,!![]);}catch(_0x40caad){return BPromise[_0x42de('0x2f')](_0x40caad);}return _0x202721[_0x42de('0x30')]();};}function saveUpdates(_0x456beb,_0xf3e944){return function(_0x521832){if(_0x521832){return _0x521832[_0x42de('0x31')](_0x456beb)[_0x42de('0x1b')](function(_0x3e512b){return _0x3e512b;});}return null;};}function removeEntity(_0x530976,_0x1f23bd){return function(_0x152d42){if(_0x152d42){return _0x152d42[_0x42de('0x32')]()[_0x42de('0x1b')](function(){_0x530976['status'](0xcc)[_0x42de('0x27')]();});}};}function handleEntityNotFound(_0x555638,_0x2dad0f){return function(_0x10d455){if(!_0x10d455){_0x555638[_0x42de('0x25')](0x194);}return _0x10d455;};}function handleError(_0x3568a2,_0x383940){_0x383940=_0x383940||0x1f4;return function(_0x39fd47){logger[_0x42de('0x20')](_0x39fd47['stack']);if(_0x39fd47[_0x42de('0x33')]){delete _0x39fd47['name'];}_0x3568a2[_0x42de('0x26')](_0x383940)[_0x42de('0x34')](_0x39fd47);};}exports[_0x42de('0x35')]=function(_0x4509ce,_0x369269){var _0x380614={},_0x5596d5={},_0x222827={'count':0x0,'rows':[]};var _0x2381f3=db[_0x42de('0x36')][_0x42de('0x37')];_0x5596d5[_0x42de('0x38')]=_[_0x42de('0x39')](_0x2381f3);_0x5596d5[_0x42de('0x3a')]=_[_0x42de('0x39')](_0x4509ce[_0x42de('0x3a')]);_0x5596d5[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0x5596d5[_0x42de('0x38')],_0x5596d5[_0x42de('0x3a')]);_0x380614[_0x42de('0x3d')]=_[_0x42de('0x3c')](_0x5596d5[_0x42de('0x38')],qs[_0x42de('0x3e')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x3e')]));_0x380614['attributes']=_0x380614[_0x42de('0x3d')][_0x42de('0x3f')]?_0x380614[_0x42de('0x3d')]:_0x5596d5[_0x42de('0x38')];if(!_0x4509ce[_0x42de('0x3a')][_0x42de('0x40')](_0x42de('0x41'))){_0x380614[_0x42de('0x2b')]=qs[_0x42de('0x2b')](_0x4509ce['query'][_0x42de('0x2b')]);_0x380614[_0x42de('0x2a')]=qs[_0x42de('0x2a')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x2a')]);}_0x380614[_0x42de('0x42')]=qs[_0x42de('0x43')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x43')]);_0x380614[_0x42de('0x44')]=qs[_0x42de('0x3b')](_[_0x42de('0x45')](_0x4509ce[_0x42de('0x3a')],_0x5596d5[_0x42de('0x3b')]));if(_0x4509ce[_0x42de('0x3a')][_0x42de('0x46')]){_0x380614['where']=_[_0x42de('0x47')](_0x380614['where'],{'$or':_['map'](_0x2381f3,function(_0x486c7c){if(_0x486c7c['type'][_0x42de('0x48')]!==_0x42de('0x49')){var _0x43f7a6={};_0x43f7a6[_0x486c7c[_0x42de('0x4a')]]={'$like':'%'+_0x4509ce[_0x42de('0x3a')][_0x42de('0x46')]+'%'};return _0x43f7a6;}})});}_0x380614=_[_0x42de('0x47')]({},_0x380614,_0x4509ce[_0x42de('0x4b')]);var _0x1b0be1={'where':_0x380614[_0x42de('0x44')]};return db[_0x42de('0x36')][_0x42de('0x29')](_0x1b0be1)[_0x42de('0x1b')](function(_0x554516){_0x222827[_0x42de('0x29')]=_0x554516;if(_0x4509ce[_0x42de('0x3a')][_0x42de('0x4c')]){_0x380614['include']=[{'all':!![]}];}return db[_0x42de('0x36')][_0x42de('0x4d')](_0x380614);})[_0x42de('0x1b')](function(_0x476c8a){_0x222827[_0x42de('0x4e')]=_0x476c8a;return _0x222827;})[_0x42de('0x1b')](respondWithFilteredResult(_0x369269,_0x380614))[_0x42de('0x24')](handleError(_0x369269,null));};exports[_0x42de('0x4f')]=function(_0x40ddb9,_0x32a831){var _0x5720c1={'raw':![],'where':{'id':_0x40ddb9['params']['id']}},_0x1ba8ac={};_0x1ba8ac[_0x42de('0x38')]=_[_0x42de('0x39')](db['ZendeskAccount'][_0x42de('0x37')]);_0x1ba8ac[_0x42de('0x3a')]=_['keys'](_0x40ddb9[_0x42de('0x3a')]);_0x1ba8ac[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0x1ba8ac[_0x42de('0x38')],_0x1ba8ac['query']);_0x5720c1['attributes']=_[_0x42de('0x3c')](_0x1ba8ac[_0x42de('0x38')],qs['fields'](_0x40ddb9['query']['fields']));_0x5720c1[_0x42de('0x3d')]=_0x5720c1['attributes'][_0x42de('0x3f')]?_0x5720c1[_0x42de('0x3d')]:_0x1ba8ac[_0x42de('0x38')];if(_0x40ddb9[_0x42de('0x3a')][_0x42de('0x4c')]){_0x5720c1[_0x42de('0x50')]=[{'all':!![]}];}_0x5720c1=_['merge']({},_0x5720c1,_0x40ddb9['options']);return db[_0x42de('0x36')][_0x42de('0x51')](_0x5720c1)[_0x42de('0x1b')](handleEntityNotFound(_0x32a831,null))['then'](respondWithResult(_0x32a831,null))[_0x42de('0x24')](handleError(_0x32a831,null));};exports[_0x42de('0x52')]=function(_0x396e49,_0x2e4eca){return db['ZendeskAccount'][_0x42de('0x52')](_0x396e49['body'],{})[_0x42de('0x1b')](respondWithResult(_0x2e4eca,0xc9))[_0x42de('0x24')](handleError(_0x2e4eca,null));};exports[_0x42de('0x31')]=function(_0x4991f6,_0x33efcf){if(_0x4991f6[_0x42de('0x53')]['id']){delete _0x4991f6[_0x42de('0x53')]['id'];}return db[_0x42de('0x36')][_0x42de('0x51')]({'where':{'id':_0x4991f6[_0x42de('0x54')]['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x33efcf,null))[_0x42de('0x1b')](saveUpdates(_0x4991f6[_0x42de('0x53')],null))[_0x42de('0x1b')](respondWithResult(_0x33efcf,null))[_0x42de('0x24')](handleError(_0x33efcf,null));};exports[_0x42de('0x32')]=function(_0x206029,_0x450340){return db[_0x42de('0x36')][_0x42de('0x51')]({'where':{'id':_0x206029['params']['id']}})['then'](handleEntityNotFound(_0x450340,null))['then'](removeEntity(_0x450340,null))[_0x42de('0x24')](handleError(_0x450340,null));};exports[_0x42de('0x55')]=function(_0x50953b,_0x7e951c,_0x1b56d5){var _0x1f88ad={};var _0xb5bb39={};var _0x33efbe;var _0x1fa62a;return db[_0x42de('0x36')]['findOne']({'where':{'id':_0x50953b['params']['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x7e951c,null))[_0x42de('0x1b')](function(_0x3a50b5){if(_0x3a50b5){_0x33efbe=_0x3a50b5;_0xb5bb39['model']=_[_0x42de('0x39')](db['ZendeskConfiguration']['rawAttributes']);_0xb5bb39['query']=_['keys'](_0x50953b['query']);_0xb5bb39[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0xb5bb39[_0x42de('0x38')],_0xb5bb39[_0x42de('0x3a')]);_0x1f88ad[_0x42de('0x3d')]=_[_0x42de('0x3c')](_0xb5bb39[_0x42de('0x38')],qs['fields'](_0x50953b['query']['fields']));_0x1f88ad['attributes']=_0x1f88ad[_0x42de('0x3d')][_0x42de('0x3f')]?_0x1f88ad[_0x42de('0x3d')]:_0xb5bb39['model'];_0x1f88ad[_0x42de('0x42')]=qs['sort'](_0x50953b['query'][_0x42de('0x43')]);_0x1f88ad['where']=qs[_0x42de('0x3b')](_[_0x42de('0x45')](_0x50953b[_0x42de('0x3a')],_0xb5bb39['filters']));if(_0x50953b[_0x42de('0x3a')][_0x42de('0x46')]){_0x1f88ad['where']=_[_0x42de('0x47')](_0x1f88ad[_0x42de('0x44')],{'$or':_[_0x42de('0x56')](_0x1f88ad['attributes'],function(_0xc785ec){var _0x4d6873={};_0x4d6873[_0xc785ec]={'$like':'%'+_0x50953b[_0x42de('0x3a')][_0x42de('0x46')]+'%'};return _0x4d6873;})});}_0x1f88ad=_[_0x42de('0x47')]({},_0x1f88ad,_0x50953b[_0x42de('0x4b')]);return _0x33efbe[_0x42de('0x55')](_0x1f88ad);}})[_0x42de('0x1b')](function(_0x4ce52e){if(_0x4ce52e){_0x1fa62a=_0x4ce52e[_0x42de('0x3f')];if(!_0x50953b[_0x42de('0x3a')][_0x42de('0x40')](_0x42de('0x41'))){_0x1f88ad[_0x42de('0x2b')]=qs[_0x42de('0x2b')](_0x50953b[_0x42de('0x3a')][_0x42de('0x2b')]);_0x1f88ad[_0x42de('0x2a')]=qs[_0x42de('0x2a')](_0x50953b[_0x42de('0x3a')][_0x42de('0x2a')]);}return _0x33efbe[_0x42de('0x55')](_0x1f88ad);}})[_0x42de('0x1b')](function(_0x392ffb){if(_0x392ffb){return _0x392ffb?{'count':_0x1fa62a,'rows':_0x392ffb}:null;}})['then'](respondWithResult(_0x7e951c,null))['catch'](handleError(_0x7e951c,null));};exports['addConfiguration']=function(_0x5d119d,_0x25eac3,_0x1cd19f){if(_0x5d119d[_0x42de('0x53')]['id']){delete _0x5d119d[_0x42de('0x53')]['id'];}return db['ZendeskAccount'][_0x42de('0x57')]({'where':{'id':_0x5d119d[_0x42de('0x54')]['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x25eac3,null))[_0x42de('0x1b')](function(_0x20fa9b){if(_0x20fa9b){_0x5d119d['body'][_0x42de('0x58')]=_0x20fa9b['id'];_0x5d119d[_0x42de('0x53')][_0x42de('0x59')]=integrations[_0x42de('0x5a')](_0x5d119d['body'][_0x42de('0x5b')],_0x5d119d[_0x42de('0x53')]['type']);_0x5d119d['body'][_0x42de('0x5c')]=integrations[_0x42de('0x5d')](_0x5d119d['body'][_0x42de('0x5b')],_0x5d119d['body'][_0x42de('0x5e')]);return db['ZendeskConfiguration'][_0x42de('0x52')](_0x5d119d[_0x42de('0x53')],{'include':[{'model':db[_0x42de('0x5f')],'as':_0x42de('0x59')},{'model':db[_0x42de('0x5f')],'as':_0x42de('0x5c')}]});}return null;})['then'](respondWithResult(_0x25eac3,null))[_0x42de('0x24')](handleError(_0x25eac3,null));};exports['getFields']=function(_0x5bcf16,_0x800bc7,_0x5357c2){var _0x30d79b='';return db[_0x42de('0x36')]['findOne']({'where':{'id':_0x5bcf16[_0x42de('0x54')]['id']},'attributes':['id',_0x42de('0x60'),_0x42de('0x61'),_0x42de('0x62'),_0x42de('0x63'),_0x42de('0x64')]})[_0x42de('0x1b')](handleEntityNotFound(_0x800bc7,null))[_0x42de('0x1b')](function(_0xfd7b13){if(_0xfd7b13){_0x30d79b=_0xfd7b13[_0x42de('0x64')];var _0x3b50ea=_0x30d79b[_0x42de('0x65')](-0x1);if(_0x3b50ea==='/'){_0x30d79b=_0x30d79b['substring'](0x0,_0x30d79b[_0x42de('0x66')](_0x3b50ea));}var _0x178737={'method':_0x42de('0x67'),'uri':util[_0x42de('0x68')]('%s/%s',_0x30d79b,'ticket_fields'),'json':!![]};switch(_0xfd7b13[_0x42de('0x63')]){case _0x42de('0x61'):_0x178737[_0x42de('0x69')]={'Authorization':util[_0x42de('0x68')]('Basic\x20%s',new Buffer(util[_0x42de('0x68')](_0x42de('0x6a'),_0xfd7b13[_0x42de('0x60')],_0xfd7b13[_0x42de('0x61')]))[_0x42de('0x6b')](_0x42de('0x6c')))};break;case _0x42de('0x62'):_0x178737[_0x42de('0x69')]={'Authorization':util['format'](_0x42de('0x6d'),new Buffer(util[_0x42de('0x68')](_0x42de('0x6e'),_0xfd7b13[_0x42de('0x60')],_0xfd7b13[_0x42de('0x62')]))[_0x42de('0x6b')](_0x42de('0x6c')))};break;default:throw new db['Sequelize'][(_0x42de('0x6f'))](_0x42de('0x70'));}return rp(_0x178737);}})[_0x42de('0x1b')](function(_0x55b5ba){if(_0x55b5ba){var _0x522f78=['subject',_0x42de('0x71'),_0x42de('0x72'),'assignee'];_[_0x42de('0x73')](_0x55b5ba[_0x42de('0x74')],function(_0x1378e9){return _0x522f78[_0x42de('0x75')](_0x1378e9['type']);});return{'count':_0x55b5ba[_0x42de('0x74')]['length'],'rows':_[_0x42de('0x56')](_0x55b5ba[_0x42de('0x74')],function(_0x190fb9){return{'id':_0x190fb9['id'],'name':_0x190fb9[_0x42de('0x76')]>0x7?_0x190fb9[_0x42de('0x77')]:_0x190fb9[_0x42de('0x5e')],'custom':_0x190fb9[_0x42de('0x76')]>0x7?!![]:![],'options':_0x190fb9[_0x42de('0x78')]?_0x190fb9[_0x42de('0x78')]:_0x190fb9[_0x42de('0x79')]?_0x190fb9[_0x42de('0x79')]:[]};})};}})['then'](respondWithResult(_0x800bc7,null))['catch'](function(_0x399a9d){var _0x11d0b8=_0x5bcf16[_0x42de('0x3a')][_0x42de('0x18')]?0x1f4:_0x399a9d[_0x42de('0x7a')]||0x1f4;logger[_0x42de('0x20')](_0x42de('0x7b'),_0x42de('0x7c'),_0x11d0b8,JSON['stringify'](_0x399a9d));delete _0x399a9d['name'];if(_0x11d0b8===0x191){_0x11d0b8=0x190;}_0x800bc7['status'](_0x11d0b8)[_0x42de('0x34')](_0x5bcf16[_0x42de('0x3a')]['test']?{'message':_0x42de('0x7d'),'statusCode':_0x399a9d[_0x42de('0x7a')]}:_0x399a9d);});}; \ No newline at end of file +var _0x7836=['Descriptions','username','token','authType','remoteUri','slice','substring','lastIndexOf','%s/%s','ticket_fields','password','headers','format','toString','Basic\x20%s','%s/token:%s','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','status','count','offset','set','Content-Range','json','reject','save','update','destroy','end','stack','name','send','index','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','show','rawAttributes','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','filters','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x7836,0x123));var _0x6783=function(_0x57d232,_0x1eb10c){_0x57d232=_0x57d232-0x0;var _0x4c7e6d=_0x7836[_0x57d232];return _0x4c7e6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6783('0x0'));var rimraf=require(_0x6783('0x1'));var zipdir=require(_0x6783('0x2'));var jsonpatch=require(_0x6783('0x3'));var rp=require(_0x6783('0x4'));var moment=require(_0x6783('0x5'));var BPromise=require(_0x6783('0x6'));var Mustache=require(_0x6783('0x7'));var util=require(_0x6783('0x8'));var path=require('path');var sox=require(_0x6783('0x9'));var csv=require('to-csv');var ejs=require(_0x6783('0xa'));var fs=require('fs');var _=require(_0x6783('0xb'));var squel=require('squel');var crypto=require(_0x6783('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6783('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6783('0xe'));var Papa=require(_0x6783('0xf'));var Redis=require(_0x6783('0x10'));var authService=require(_0x6783('0x11'));var qs=require(_0x6783('0x12'));var hardwareService=require(_0x6783('0x13'));var logger=require('../../config/logger')(_0x6783('0x14'));var utils=require(_0x6783('0x15'));var config=require(_0x6783('0x16'));var db=require(_0x6783('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6783('0x18'));var client=jayson['client'][_0x6783('0x19')]({'port':0x232a});function checkPasswordPattern(_0xb3fc21,_0x62e6e0,_0x18a5f8){if(_0x18a5f8){var _0x3a2482=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a2482[_0x6783('0x1a')](_0x62e6e0)){return _0xb3fc21;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xb3fc21;}}function respondWithRpcPromise(_0x391ad6,_0x478ccf,_0x15231d,_0x2d7ce9){return new BPromise(function(_0x2cce8b,_0x3d877e){var _0x21384d=_0x2d7ce9||client;return _0x21384d[_0x6783('0x1b')](_0x391ad6,_0x15231d)[_0x6783('0x1c')](function(_0x1b019c){logger[_0x6783('0x1d')]('ZendeskAccount,\x20%s,\x20%s',_0x478ccf,_0x6783('0x1e'));logger[_0x6783('0x1f')](_0x6783('0x20'),_0x478ccf,_0x6783('0x1e'),JSON[_0x6783('0x21')](_0x1b019c));if(_0x1b019c[_0x6783('0x22')]){if(_0x1b019c['error'][_0x6783('0x23')]===0x1f4){logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);return _0x3d877e(_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);}logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0x1b019c[_0x6783('0x22')]['message']);return _0x2cce8b(_0x1b019c[_0x6783('0x22')][_0x6783('0x25')]);}else{logger[_0x6783('0x1d')](_0x6783('0x24'),_0x478ccf,'request\x20sent');_0x2cce8b(_0x1b019c[_0x6783('0x26')]['message']);}})[_0x6783('0x27')](function(_0xd2c02){logger[_0x6783('0x22')](_0x6783('0x24'),_0x478ccf,_0xd2c02);_0x3d877e(_0xd2c02);});});}function respondWithStatusCode(_0x3743ef,_0x503086){_0x503086=_0x503086||0xcc;return function(_0x247c17){if(_0x247c17){return _0x3743ef['sendStatus'](_0x503086);}return _0x3743ef[_0x6783('0x28')](_0x503086)['end']();};}function respondWithResult(_0x4f8f1d,_0x239d6e){_0x239d6e=_0x239d6e||0xc8;return function(_0x61f2b9){if(_0x61f2b9){return _0x4f8f1d['status'](_0x239d6e)['json'](_0x61f2b9);}};}function respondWithFilteredResult(_0x3157bc,_0x1729a4){return function(_0x3011a7){if(_0x3011a7){var _0x1d5066=_0x3011a7[_0x6783('0x29')],_0x23d4fa=_0x1729a4['offset'],_0x4bc865=_0x1729a4[_0x6783('0x2a')]+_0x1729a4['limit'],_0x4c10a9;if(_0x4bc865>=_0x1d5066){_0x4bc865=_0x1d5066;_0x4c10a9=0xc8;}else{_0x4c10a9=0xce;}_0x3157bc[_0x6783('0x28')](_0x4c10a9);return _0x3157bc[_0x6783('0x2b')](_0x6783('0x2c'),_0x23d4fa+'-'+_0x4bc865+'/'+_0x1d5066)[_0x6783('0x2d')](_0x3011a7);}return null;};}function patchUpdates(_0x4c6a37){return function(_0x2f4bff){try{jsonpatch['apply'](_0x2f4bff,_0x4c6a37,!![]);}catch(_0x366d40){return BPromise[_0x6783('0x2e')](_0x366d40);}return _0x2f4bff[_0x6783('0x2f')]();};}function saveUpdates(_0xea4c15,_0x5d853a){return function(_0x408b65){if(_0x408b65){return _0x408b65[_0x6783('0x30')](_0xea4c15)[_0x6783('0x1c')](function(_0x33ee06){return _0x33ee06;});}return null;};}function removeEntity(_0x17e45d,_0xd9b963){return function(_0x5085f4){if(_0x5085f4){return _0x5085f4[_0x6783('0x31')]()['then'](function(){_0x17e45d[_0x6783('0x28')](0xcc)[_0x6783('0x32')]();});}};}function handleEntityNotFound(_0x1efebe,_0x2e23e8){return function(_0x52a078){if(!_0x52a078){_0x1efebe['sendStatus'](0x194);}return _0x52a078;};}function handleError(_0x521427,_0x2af97b){_0x2af97b=_0x2af97b||0x1f4;return function(_0x24da57){logger[_0x6783('0x22')](_0x24da57[_0x6783('0x33')]);if(_0x24da57['name']){delete _0x24da57[_0x6783('0x34')];}_0x521427['status'](_0x2af97b)[_0x6783('0x35')](_0x24da57);};}exports[_0x6783('0x36')]=function(_0x472f74,_0x2d121a){var _0x55b6cd={},_0x346109={},_0x2bf029={'count':0x0,'rows':[]};var _0x54335e=db['ZendeskAccount']['rawAttributes'];_0x346109[_0x6783('0x37')]=_['keys'](_0x54335e);_0x346109[_0x6783('0x38')]=_[_0x6783('0x39')](_0x472f74[_0x6783('0x38')]);_0x346109['filters']=_['intersection'](_0x346109[_0x6783('0x37')],_0x346109[_0x6783('0x38')]);_0x55b6cd[_0x6783('0x3a')]=_[_0x6783('0x3b')](_0x346109[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x472f74[_0x6783('0x38')]['fields']));_0x55b6cd[_0x6783('0x3a')]=_0x55b6cd[_0x6783('0x3a')][_0x6783('0x3d')]?_0x55b6cd[_0x6783('0x3a')]:_0x346109['model'];if(!_0x472f74[_0x6783('0x38')][_0x6783('0x3e')](_0x6783('0x3f'))){_0x55b6cd['limit']=qs[_0x6783('0x40')](_0x472f74['query'][_0x6783('0x40')]);_0x55b6cd[_0x6783('0x2a')]=qs[_0x6783('0x2a')](_0x472f74['query'][_0x6783('0x2a')]);}_0x55b6cd[_0x6783('0x41')]=qs[_0x6783('0x42')](_0x472f74['query']['sort']);_0x55b6cd[_0x6783('0x43')]=qs['filters'](_[_0x6783('0x44')](_0x472f74[_0x6783('0x38')],_0x346109['filters']));if(_0x472f74[_0x6783('0x38')][_0x6783('0x45')]){_0x55b6cd[_0x6783('0x43')]=_[_0x6783('0x46')](_0x55b6cd[_0x6783('0x43')],{'$or':_['map'](_0x54335e,function(_0x1bbcd8){if(_0x1bbcd8[_0x6783('0x47')][_0x6783('0x48')]!==_0x6783('0x49')){var _0x222426={};_0x222426[_0x1bbcd8['field']]={'$like':'%'+_0x472f74[_0x6783('0x38')][_0x6783('0x45')]+'%'};return _0x222426;}})});}_0x55b6cd=_[_0x6783('0x46')]({},_0x55b6cd,_0x472f74[_0x6783('0x4a')]);var _0x4641d4={'where':_0x55b6cd['where']};return db[_0x6783('0x4b')][_0x6783('0x29')](_0x4641d4)['then'](function(_0x4d850c){_0x2bf029[_0x6783('0x29')]=_0x4d850c;if(_0x472f74[_0x6783('0x38')][_0x6783('0x4c')]){_0x55b6cd[_0x6783('0x4d')]=[{'all':!![]}];}return db[_0x6783('0x4b')]['findAll'](_0x55b6cd);})[_0x6783('0x1c')](function(_0x1ec033){_0x2bf029[_0x6783('0x4e')]=_0x1ec033;return _0x2bf029;})['then'](respondWithFilteredResult(_0x2d121a,_0x55b6cd))[_0x6783('0x27')](handleError(_0x2d121a,null));};exports[_0x6783('0x4f')]=function(_0x2295d0,_0x36bea4){var _0x4a51e9={'raw':![],'where':{'id':_0x2295d0['params']['id']}},_0x4aa0ea={};_0x4aa0ea[_0x6783('0x37')]=_[_0x6783('0x39')](db[_0x6783('0x4b')][_0x6783('0x50')]);_0x4aa0ea[_0x6783('0x38')]=_[_0x6783('0x39')](_0x2295d0['query']);_0x4aa0ea['filters']=_[_0x6783('0x3b')](_0x4aa0ea[_0x6783('0x37')],_0x4aa0ea[_0x6783('0x38')]);_0x4a51e9['attributes']=_['intersection'](_0x4aa0ea[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x2295d0[_0x6783('0x38')][_0x6783('0x3c')]));_0x4a51e9[_0x6783('0x3a')]=_0x4a51e9['attributes'][_0x6783('0x3d')]?_0x4a51e9[_0x6783('0x3a')]:_0x4aa0ea['model'];if(_0x2295d0[_0x6783('0x38')][_0x6783('0x4c')]){_0x4a51e9[_0x6783('0x4d')]=[{'all':!![]}];}_0x4a51e9=_[_0x6783('0x46')]({},_0x4a51e9,_0x2295d0[_0x6783('0x4a')]);return db[_0x6783('0x4b')][_0x6783('0x51')](_0x4a51e9)['then'](handleEntityNotFound(_0x36bea4,null))[_0x6783('0x1c')](respondWithResult(_0x36bea4,null))[_0x6783('0x27')](handleError(_0x36bea4,null));};exports['create']=function(_0x1792a8,_0xc17a15){return db['ZendeskAccount'][_0x6783('0x52')](_0x1792a8[_0x6783('0x53')],{})[_0x6783('0x1c')](respondWithResult(_0xc17a15,0xc9))[_0x6783('0x27')](handleError(_0xc17a15,null));};exports[_0x6783('0x30')]=function(_0x550301,_0x4b08c2){if(_0x550301[_0x6783('0x53')]['id']){delete _0x550301[_0x6783('0x53')]['id'];}return db[_0x6783('0x4b')][_0x6783('0x51')]({'where':{'id':_0x550301['params']['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x4b08c2,null))['then'](saveUpdates(_0x550301[_0x6783('0x53')],null))[_0x6783('0x1c')](respondWithResult(_0x4b08c2,null))[_0x6783('0x27')](handleError(_0x4b08c2,null));};exports[_0x6783('0x31')]=function(_0x479f17,_0x30a60b){return db[_0x6783('0x4b')]['find']({'where':{'id':_0x479f17[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x30a60b,null))[_0x6783('0x1c')](removeEntity(_0x30a60b,null))['catch'](handleError(_0x30a60b,null));};exports[_0x6783('0x55')]=function(_0x22ed9b,_0x4cbecf,_0x108969){var _0x1c000c={};var _0x1521be={};var _0x10f4d2;var _0xee1ac;return db[_0x6783('0x4b')][_0x6783('0x56')]({'where':{'id':_0x22ed9b[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x4cbecf,null))[_0x6783('0x1c')](function(_0x457f3b){if(_0x457f3b){_0x10f4d2=_0x457f3b;_0x1521be['model']=_[_0x6783('0x39')](db[_0x6783('0x57')]['rawAttributes']);_0x1521be['query']=_[_0x6783('0x39')](_0x22ed9b[_0x6783('0x38')]);_0x1521be[_0x6783('0x58')]=_['intersection'](_0x1521be['model'],_0x1521be[_0x6783('0x38')]);_0x1c000c[_0x6783('0x3a')]=_[_0x6783('0x3b')](_0x1521be[_0x6783('0x37')],qs[_0x6783('0x3c')](_0x22ed9b[_0x6783('0x38')]['fields']));_0x1c000c[_0x6783('0x3a')]=_0x1c000c[_0x6783('0x3a')][_0x6783('0x3d')]?_0x1c000c[_0x6783('0x3a')]:_0x1521be[_0x6783('0x37')];_0x1c000c['order']=qs[_0x6783('0x42')](_0x22ed9b[_0x6783('0x38')]['sort']);_0x1c000c[_0x6783('0x43')]=qs[_0x6783('0x58')](_[_0x6783('0x44')](_0x22ed9b[_0x6783('0x38')],_0x1521be[_0x6783('0x58')]));if(_0x22ed9b['query'][_0x6783('0x45')]){_0x1c000c[_0x6783('0x43')]=_[_0x6783('0x46')](_0x1c000c[_0x6783('0x43')],{'$or':_[_0x6783('0x59')](_0x1c000c[_0x6783('0x3a')],function(_0xcd2879){var _0x49849e={};_0x49849e[_0xcd2879]={'$like':'%'+_0x22ed9b[_0x6783('0x38')][_0x6783('0x45')]+'%'};return _0x49849e;})});}_0x1c000c=_[_0x6783('0x46')]({},_0x1c000c,_0x22ed9b[_0x6783('0x4a')]);return _0x10f4d2['getConfigurations'](_0x1c000c);}})[_0x6783('0x1c')](function(_0x3dac62){if(_0x3dac62){_0xee1ac=_0x3dac62[_0x6783('0x3d')];if(!_0x22ed9b[_0x6783('0x38')][_0x6783('0x3e')]('nolimit')){_0x1c000c[_0x6783('0x40')]=qs[_0x6783('0x40')](_0x22ed9b['query']['limit']);_0x1c000c[_0x6783('0x2a')]=qs['offset'](_0x22ed9b[_0x6783('0x38')][_0x6783('0x2a')]);}return _0x10f4d2['getConfigurations'](_0x1c000c);}})[_0x6783('0x1c')](function(_0x2c8deb){if(_0x2c8deb){return _0x2c8deb?{'count':_0xee1ac,'rows':_0x2c8deb}:null;}})[_0x6783('0x1c')](respondWithResult(_0x4cbecf,null))['catch'](handleError(_0x4cbecf,null));};exports[_0x6783('0x5a')]=function(_0x174089,_0x428350,_0x3206ba){if(_0x174089[_0x6783('0x53')]['id']){delete _0x174089[_0x6783('0x53')]['id'];}return db[_0x6783('0x4b')]['findOne']({'where':{'id':_0x174089[_0x6783('0x54')]['id']}})[_0x6783('0x1c')](handleEntityNotFound(_0x428350,null))[_0x6783('0x1c')](function(_0x33257d){if(_0x33257d){_0x174089['body'][_0x6783('0x5b')]=_0x33257d['id'];_0x174089[_0x6783('0x53')][_0x6783('0x5c')]=integrations[_0x6783('0x5d')](_0x174089[_0x6783('0x53')][_0x6783('0x5e')],_0x174089[_0x6783('0x53')]['type']);_0x174089[_0x6783('0x53')]['Descriptions']=integrations[_0x6783('0x5f')](_0x174089[_0x6783('0x53')][_0x6783('0x5e')],_0x174089[_0x6783('0x53')][_0x6783('0x47')]);return db[_0x6783('0x57')][_0x6783('0x52')](_0x174089[_0x6783('0x53')],{'include':[{'model':db['ZendeskField'],'as':_0x6783('0x5c')},{'model':db['ZendeskField'],'as':_0x6783('0x60')}]});}return null;})[_0x6783('0x1c')](respondWithResult(_0x428350,null))[_0x6783('0x27')](handleError(_0x428350,null));};exports['getFields']=function(_0x5a5fb8,_0x142b30,_0x307eff){var _0x447b88='';return db[_0x6783('0x4b')][_0x6783('0x56')]({'where':{'id':_0x5a5fb8[_0x6783('0x54')]['id']},'attributes':['id',_0x6783('0x61'),'password',_0x6783('0x62'),_0x6783('0x63'),_0x6783('0x64')]})[_0x6783('0x1c')](handleEntityNotFound(_0x142b30,null))[_0x6783('0x1c')](function(_0x1cef78){if(_0x1cef78){_0x447b88=_0x1cef78[_0x6783('0x64')];var _0x17ffcb=_0x447b88[_0x6783('0x65')](-0x1);if(_0x17ffcb==='/'){_0x447b88=_0x447b88[_0x6783('0x66')](0x0,_0x447b88[_0x6783('0x67')](_0x17ffcb));}var _0x34a34f={'method':'GET','uri':util['format'](_0x6783('0x68'),_0x447b88,_0x6783('0x69')),'json':!![]};switch(_0x1cef78[_0x6783('0x63')]){case _0x6783('0x6a'):_0x34a34f[_0x6783('0x6b')]={'Authorization':util[_0x6783('0x6c')]('Basic\x20%s',new Buffer(util[_0x6783('0x6c')]('%s:%s',_0x1cef78['username'],_0x1cef78[_0x6783('0x6a')]))[_0x6783('0x6d')]('base64'))};break;case'token':_0x34a34f[_0x6783('0x6b')]={'Authorization':util['format'](_0x6783('0x6e'),new Buffer(util['format'](_0x6783('0x6f'),_0x1cef78['username'],_0x1cef78[_0x6783('0x62')]))['toString'](_0x6783('0x70')))};break;default:throw new db['Sequelize'][(_0x6783('0x71'))](_0x6783('0x72'));}return rp(_0x34a34f);}})['then'](function(_0x24db8f){if(_0x24db8f){var _0x3687cf=[_0x6783('0x73'),_0x6783('0x74'),_0x6783('0x75'),_0x6783('0x76')];_[_0x6783('0x77')](_0x24db8f[_0x6783('0x69')],function(_0x3d7ea0){return _0x3687cf[_0x6783('0x78')](_0x3d7ea0[_0x6783('0x47')]);});return{'count':_0x24db8f[_0x6783('0x69')]['length'],'rows':_['map'](_0x24db8f[_0x6783('0x69')],function(_0x2dc0cb){return{'id':_0x2dc0cb['id'],'name':_0x2dc0cb[_0x6783('0x79')]>0x7?_0x2dc0cb[_0x6783('0x7a')]:_0x2dc0cb[_0x6783('0x47')],'custom':_0x2dc0cb[_0x6783('0x79')]>0x7?!![]:![],'options':_0x2dc0cb[_0x6783('0x7b')]?_0x2dc0cb[_0x6783('0x7b')]:_0x2dc0cb[_0x6783('0x7c')]?_0x2dc0cb[_0x6783('0x7c')]:[]};})};}})[_0x6783('0x1c')](respondWithResult(_0x142b30,null))[_0x6783('0x27')](function(_0x4ef776){var _0x56b15f=_0x5a5fb8[_0x6783('0x38')][_0x6783('0x1a')]?0x1f4:_0x4ef776[_0x6783('0x7d')]||0x1f4;logger[_0x6783('0x22')](_0x6783('0x7e'),_0x6783('0x7f'),_0x56b15f,JSON[_0x6783('0x21')](_0x4ef776));delete _0x4ef776[_0x6783('0x34')];if(_0x56b15f===0x191){_0x56b15f=0x190;}_0x142b30['status'](_0x56b15f)['send'](_0x5a5fb8[_0x6783('0x38')]['test']?{'message':_0x6783('0x80'),'statusCode':_0x4ef776[_0x6783('0x7d')]}:_0x4ef776);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 242eec1..25a8a89 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 _0xc4a6=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x409586,_0x32c0ff){var _0x3daae3=function(_0x5100e1){while(--_0x5100e1){_0x409586['push'](_0x409586['shift']());}};_0x3daae3(++_0x32c0ff);}(_0xc4a6,0x106));var _0x6c4a=function(_0x2f3a46,_0x25335f){_0x2f3a46=_0x2f3a46-0x0;var _0x98fa2f=_0xc4a6[_0x2f3a46];return _0x98fa2f;};'use strict';var _=require(_0x6c4a('0x0'));var util=require(_0x6c4a('0x1'));var logger=require(_0x6c4a('0x2'))(_0x6c4a('0x3'));var moment=require(_0x6c4a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6c4a('0x5'));var fs=require('fs');var path=require(_0x6c4a('0x6'));var rimraf=require(_0x6c4a('0x7'));var config=require(_0x6c4a('0x8'));var attributes=require(_0x6c4a('0x9'));var integrations=require(_0x6c4a('0xa'));module[_0x6c4a('0xb')]=function(_0x5f5363,_0x1bc91f){return _0x5f5363[_0x6c4a('0xc')](_0x6c4a('0xd'),attributes,{'tableName':_0x6c4a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x15022b,_0x100ec0){var _0xd23271=function(_0x28d732){while(--_0x28d732){_0x15022b['push'](_0x15022b['shift']());}};_0xd23271(++_0x100ec0);}(_0x687b,0x14a));var _0xb687=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x687b[_0x1d5400];return _0x21d9fe;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ZendeskAccount',attributes,{'tableName':_0xb687('0xc'),'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 b9b1038..d594fc0 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 _0x556b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetZendeskAccount','debug','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0xb849e7,_0x24aa49){var _0x344014=function(_0x54a99e){while(--_0x54a99e){_0xb849e7['push'](_0xb849e7['shift']());}};_0x344014(++_0x24aa49);}(_0x556b,0x1d7));var _0xb556=function(_0x28d10a,_0x3637f9){_0x28d10a=_0x28d10a-0x0;var _0x58eb45=_0x556b[_0x28d10a];return _0x58eb45;};'use strict';var _=require(_0xb556('0x0'));var util=require(_0xb556('0x1'));var moment=require(_0xb556('0x2'));var BPromise=require(_0xb556('0x3'));var rs=require(_0xb556('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb556('0x5'))['db'];var utils=require(_0xb556('0x6'));var logger=require(_0xb556('0x7'))(_0xb556('0x8'));var config=require(_0xb556('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18728e,_0xb44f26,_0x1cc8a1){return new BPromise(function(_0x33508d,_0xe45310){return client[_0xb556('0xa')](_0x18728e,_0x1cc8a1)[_0xb556('0xb')](function(_0x9c1e10){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xb44f26,_0xb556('0xc'));logger['debug'](_0xb556('0xd'),_0xb44f26,_0xb556('0xc'),JSON['stringify'](_0x9c1e10));if(_0x9c1e10['error']){if(_0x9c1e10[_0xb556('0xe')][_0xb556('0xf')]===0x1f4){logger[_0xb556('0xe')](_0xb556('0x10'),_0xb44f26,_0x9c1e10[_0xb556('0xe')][_0xb556('0x11')]);return _0xe45310(_0x9c1e10['error']['message']);}logger[_0xb556('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0xb44f26,_0x9c1e10[_0xb556('0xe')][_0xb556('0x11')]);return _0x33508d(_0x9c1e10['error']['message']);}else{logger[_0xb556('0x12')](_0xb556('0x10'),_0xb44f26,_0xb556('0xc'));_0x33508d(_0x9c1e10[_0xb556('0x13')][_0xb556('0x11')]);}})[_0xb556('0x14')](function(_0x13677c){logger[_0xb556('0xe')](_0xb556('0x10'),_0xb44f26,_0x13677c);_0xe45310(_0x13677c);});});}exports['GetZendeskAccount']=function(_0x475808){var _0xaa8168=this;return new Promise(function(_0xb378b2,_0x23ada8){return db['ZendeskAccount'][_0xb556('0x15')]({'raw':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x17')]===undefined?!![]:![]:!![],'where':_0x475808['options']?_0x475808[_0xb556('0x16')][_0xb556('0x18')]||null:null,'attributes':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')]['attributes']||null:null,'limit':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x19')]||null:null,'include':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x475808[_0xb556('0x16')][_0xb556('0x1a')],function(_0x3d5ae7){return{'model':db[_0x3d5ae7[_0xb556('0x1c')]],'as':_0x3d5ae7['as'],'attributes':_0x3d5ae7[_0xb556('0x1d')],'include':_0x3d5ae7[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x3d5ae7[_0xb556('0x1a')],function(_0x442264){return{'model':db[_0x442264[_0xb556('0x1c')]],'as':_0x442264['as'],'attributes':_0x442264[_0xb556('0x1d')],'include':_0x442264[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x442264[_0xb556('0x1a')],function(_0x1962b1){return{'model':db[_0x1962b1['model']],'as':_0x1962b1['as'],'attributes':_0x1962b1[_0xb556('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a43a0){logger['info'](_0xb556('0x1e'),_0x475808);logger[_0xb556('0x1f')](_0xb556('0x1e'),_0x475808,JSON['stringify'](_0x4a43a0));_0xb378b2(_0x4a43a0);})[_0xb556('0x14')](function(_0x3c9a87){logger['error']('GetZendeskAccount',_0x3c9a87['message'],_0x475808);_0x23ada8(_0xaa8168[_0xb556('0xe')](0x1f4,_0x3c9a87[_0xb556('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x4d5311){var _0x3a6548=this;return new Promise(function(_0x5d989c,_0x2694de){return db['ZendeskAccount'][_0xb556('0x20')]({'raw':_0x4d5311['options']?_0x4d5311[_0xb556('0x16')][_0xb556('0x17')]===undefined?!![]:![]:!![],'where':_0x4d5311['options']?_0x4d5311['options'][_0xb556('0x18')]||null:null,'attributes':_0x4d5311[_0xb556('0x16')]?_0x4d5311[_0xb556('0x16')]['attributes']||null:null,'include':_0x4d5311[_0xb556('0x16')]?_0x4d5311[_0xb556('0x16')][_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x4d5311['options'][_0xb556('0x1a')],function(_0x3ce450){return{'model':db[_0x3ce450['model']],'as':_0x3ce450['as'],'attributes':_0x3ce450['attributes'],'include':_0x3ce450[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x3ce450[_0xb556('0x1a')],function(_0x5bdf7b){return{'model':db[_0x5bdf7b[_0xb556('0x1c')]],'as':_0x5bdf7b['as'],'attributes':_0x5bdf7b[_0xb556('0x1d')],'include':_0x5bdf7b['include']?_[_0xb556('0x1b')](_0x5bdf7b[_0xb556('0x1a')],function(_0x2e5d65){return{'model':db[_0x2e5d65['model']],'as':_0x2e5d65['as'],'attributes':_0x2e5d65['attributes']};}):[]};}):[]};}):[]:[]})[_0xb556('0xb')](function(_0x2db02e){logger[_0xb556('0x12')]('ShowZendeskAccount',_0x4d5311);logger[_0xb556('0x1f')](_0xb556('0x21'),_0x4d5311,JSON['stringify'](_0x2db02e));_0x5d989c(_0x2db02e);})['catch'](function(_0xaf4af4){logger[_0xb556('0xe')]('ShowZendeskAccount',_0xaf4af4['message'],_0x4d5311);_0x2694de(_0x3a6548[_0xb556('0xe')](0x1f4,_0xaf4af4[_0xb556('0x11')]));});});}; \ No newline at end of file +var _0xc8ca=['http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x92ca24,_0x505f51){var _0x88ecdb=function(_0x21f5fd){while(--_0x21f5fd){_0x92ca24['push'](_0x92ca24['shift']());}};_0x88ecdb(++_0x505f51);}(_0xc8ca,0x1b3));var _0xac8c=function(_0x4d5a08,_0x31d500){_0x4d5a08=_0x4d5a08-0x0;var _0x20922e=_0xc8ca[_0x4d5a08];return _0x20922e;};'use strict';var _=require(_0xac8c('0x0'));var util=require(_0xac8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac8c('0x2'))['db'];var utils=require(_0xac8c('0x3'));var logger=require('../../config/logger')(_0xac8c('0x4'));var config=require(_0xac8c('0x5'));var jayson=require(_0xac8c('0x6'));var client=jayson['client'][_0xac8c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6b2f26,_0x544755,_0x35756f){return new BPromise(function(_0x51ecd9,_0x378215){return client[_0xac8c('0x8')](_0x6b2f26,_0x35756f)[_0xac8c('0x9')](function(_0x4eea78){logger[_0xac8c('0xa')](_0xac8c('0xb'),_0x544755,_0xac8c('0xc'));logger[_0xac8c('0xd')](_0xac8c('0xe'),_0x544755,_0xac8c('0xc'),JSON[_0xac8c('0xf')](_0x4eea78));if(_0x4eea78[_0xac8c('0x10')]){if(_0x4eea78['error'][_0xac8c('0x11')]===0x1f4){logger[_0xac8c('0x10')](_0xac8c('0xb'),_0x544755,_0x4eea78[_0xac8c('0x10')][_0xac8c('0x12')]);return _0x378215(_0x4eea78['error']['message']);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x544755,_0x4eea78['error'][_0xac8c('0x12')]);return _0x51ecd9(_0x4eea78[_0xac8c('0x10')][_0xac8c('0x12')]);}else{logger[_0xac8c('0xa')](_0xac8c('0xb'),_0x544755,_0xac8c('0xc'));_0x51ecd9(_0x4eea78[_0xac8c('0x13')]['message']);}})['catch'](function(_0x34725b){logger[_0xac8c('0x10')](_0xac8c('0xb'),_0x544755,_0x34725b);_0x378215(_0x34725b);});});}exports[_0xac8c('0x14')]=function(_0x310e19){var _0x520f3f=this;return new Promise(function(_0x158322,_0x2150dc){return db['ZendeskAccount'][_0xac8c('0x15')]({'raw':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x17')]===undefined?!![]:![]:!![],'where':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x18')]||null:null,'attributes':_0x310e19['options']?_0x310e19[_0xac8c('0x16')]['attributes']||null:null,'limit':_0x310e19[_0xac8c('0x16')]?_0x310e19['options'][_0xac8c('0x19')]||null:null,'include':_0x310e19[_0xac8c('0x16')]?_0x310e19[_0xac8c('0x16')][_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x310e19['options'][_0xac8c('0x1a')],function(_0x114038){return{'model':db[_0x114038['model']],'as':_0x114038['as'],'attributes':_0x114038[_0xac8c('0x1c')],'include':_0x114038[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x114038[_0xac8c('0x1a')],function(_0x14a89e){return{'model':db[_0x14a89e['model']],'as':_0x14a89e['as'],'attributes':_0x14a89e[_0xac8c('0x1c')],'include':_0x14a89e[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x14a89e[_0xac8c('0x1a')],function(_0x505e33){return{'model':db[_0x505e33[_0xac8c('0x1d')]],'as':_0x505e33['as'],'attributes':_0x505e33[_0xac8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8c('0x9')](function(_0x5a42e8){logger[_0xac8c('0xa')](_0xac8c('0x14'),_0x310e19);logger[_0xac8c('0xd')](_0xac8c('0x14'),_0x310e19,JSON[_0xac8c('0xf')](_0x5a42e8));_0x158322(_0x5a42e8);})[_0xac8c('0x1e')](function(_0xb638ee){logger[_0xac8c('0x10')](_0xac8c('0x14'),_0xb638ee[_0xac8c('0x12')],_0x310e19);_0x2150dc(_0x520f3f[_0xac8c('0x10')](0x1f4,_0xb638ee['message']));});});};exports[_0xac8c('0x1f')]=function(_0x49b89d){var _0x2b5f4e=this;return new Promise(function(_0x113e9c,_0x1cf426){return db[_0xac8c('0x20')][_0xac8c('0x21')]({'raw':_0x49b89d[_0xac8c('0x16')]?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x17')]===undefined?!![]:![]:!![],'where':_0x49b89d['options']?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x18')]||null:null,'attributes':_0x49b89d['options']?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1c')]||null:null,'include':_0x49b89d[_0xac8c('0x16')]?_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1a')]?_['map'](_0x49b89d[_0xac8c('0x16')][_0xac8c('0x1a')],function(_0x31f89d){return{'model':db[_0x31f89d[_0xac8c('0x1d')]],'as':_0x31f89d['as'],'attributes':_0x31f89d[_0xac8c('0x1c')],'include':_0x31f89d[_0xac8c('0x1a')]?_['map'](_0x31f89d[_0xac8c('0x1a')],function(_0x2cd9f8){return{'model':db[_0x2cd9f8[_0xac8c('0x1d')]],'as':_0x2cd9f8['as'],'attributes':_0x2cd9f8['attributes'],'include':_0x2cd9f8[_0xac8c('0x1a')]?_[_0xac8c('0x1b')](_0x2cd9f8[_0xac8c('0x1a')],function(_0x5ddb10){return{'model':db[_0x5ddb10[_0xac8c('0x1d')]],'as':_0x5ddb10['as'],'attributes':_0x5ddb10[_0xac8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac8c('0x9')](function(_0x48703b){logger[_0xac8c('0xa')](_0xac8c('0x1f'),_0x49b89d);logger[_0xac8c('0xd')]('ShowZendeskAccount',_0x49b89d,JSON[_0xac8c('0xf')](_0x48703b));_0x113e9c(_0x48703b);})['catch'](function(_0x6155c5){logger[_0xac8c('0x10')]('ShowZendeskAccount',_0x6155c5[_0xac8c('0x12')],_0x49b89d);_0x1cf426(_0x2b5f4e[_0xac8c('0x10')](0x1f4,_0x6155c5[_0xac8c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 479fa9d..553eaae 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 _0xd982=['/:id','exports','multer','util','path','express','./intZendeskConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','put','delete'];(function(_0x1f3ec0,_0x4809c2){var _0x3e2007=function(_0x1e2d16){while(--_0x1e2d16){_0x1f3ec0['push'](_0x1f3ec0['shift']());}};_0x3e2007(++_0x4809c2);}(_0xd982,0x128));var _0x2d98=function(_0x43bc0e,_0x18864e){_0x43bc0e=_0x43bc0e-0x0;var _0x5b4081=_0xd982[_0x43bc0e];return _0x5b4081;};'use strict';var multer=require(_0x2d98('0x0'));var util=require(_0x2d98('0x1'));var path=require(_0x2d98('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d98('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2d98('0x4'));router['get']('/',auth[_0x2d98('0x5')](),controller[_0x2d98('0x6')]);router[_0x2d98('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2d98('0x8')]);router[_0x2d98('0x7')](_0x2d98('0x9'),auth[_0x2d98('0x5')](),controller[_0x2d98('0xa')]);router[_0x2d98('0x7')](_0x2d98('0xb'),auth[_0x2d98('0x5')](),controller[_0x2d98('0xc')]);router[_0x2d98('0x7')](_0x2d98('0xd'),auth[_0x2d98('0x5')](),controller['getDescriptions']);router['get'](_0x2d98('0xe'),auth['isAuthenticated'](),controller[_0x2d98('0xf')]);router[_0x2d98('0x10')]('/',auth[_0x2d98('0x5')](),controller['create']);router[_0x2d98('0x10')](_0x2d98('0xe'),auth['isAuthenticated'](),controller['setTags']);router[_0x2d98('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2d98('0x12')](_0x2d98('0x13'),auth[_0x2d98('0x5')](),controller['destroy']);module[_0x2d98('0x14')]=router; \ No newline at end of file +var _0x12fe=['isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x5ab846,_0x4bfcb9){var _0x5a745a=function(_0x4c8595){while(--_0x4c8595){_0x5ab846['push'](_0x5ab846['shift']());}};_0x5a745a(++_0x4bfcb9);}(_0x12fe,0x122));var _0xe12f=function(_0x6d0ecf,_0x30e024){_0x6d0ecf=_0x6d0ecf-0x0;var _0x599b89=_0x12fe[_0x6d0ecf];return _0x599b89;};'use strict';var multer=require(_0xe12f('0x0'));var util=require(_0xe12f('0x1'));var path=require(_0xe12f('0x2'));var timeout=require(_0xe12f('0x3'));var express=require(_0xe12f('0x4'));var router=express[_0xe12f('0x5')]();var auth=require(_0xe12f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe12f('0x7'));var controller=require(_0xe12f('0x8'));router[_0xe12f('0x9')]('/',auth[_0xe12f('0xa')](),controller['index']);router['get'](_0xe12f('0xb'),auth[_0xe12f('0xa')](),controller['show']);router[_0xe12f('0x9')](_0xe12f('0xc'),auth['isAuthenticated'](),controller[_0xe12f('0xd')]);router[_0xe12f('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe12f('0xe')]);router[_0xe12f('0x9')](_0xe12f('0xf'),auth[_0xe12f('0xa')](),controller[_0xe12f('0x10')]);router[_0xe12f('0x9')](_0xe12f('0x11'),auth[_0xe12f('0xa')](),controller['getTags']);router[_0xe12f('0x12')]('/',auth[_0xe12f('0xa')](),controller['create']);router[_0xe12f('0x12')](_0xe12f('0x11'),auth['isAuthenticated'](),controller[_0xe12f('0x13')]);router[_0xe12f('0x14')](_0xe12f('0xb'),auth['isAuthenticated'](),controller[_0xe12f('0x15')]);router[_0xe12f('0x16')](_0xe12f('0xb'),auth[_0xe12f('0xa')](),controller[_0xe12f('0x17')]);module[_0xe12f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 36c1615..bda7f55 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 _0xd780=['sequelize','exports','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd780,0x18c));var _0x0d78=function(_0x33b22c,_0x42ad88){_0x33b22c=_0x33b22c-0x0;var _0xcdd372=_0xd780[_0x33b22c];return _0xcdd372;};'use strict';var Sequelize=require(_0x0d78('0x0'));module[_0x0d78('0x1')]={'name':{'type':Sequelize[_0x0d78('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0389=['sequelize','exports','STRING'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x0389,0xd2));var _0x9038=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x0389[_0xe84805];return _0x398efd;};'use strict';var Sequelize=require(_0x9038('0x0'));module[_0x9038('0x1')]={'name':{'type':Sequelize[_0x9038('0x2')]},'description':{'type':Sequelize[_0x9038('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 84726ec..bda67ad 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 _0x63e8=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','ZendeskConfiguration','findAll','rows','show','includeAll','include','create','body','params','getFields','findOne','ZendeskField','rawAttributes','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird'];(function(_0xec434,_0x80a23c){var _0x109d2d=function(_0x59006c){while(--_0x59006c){_0xec434['push'](_0xec434['shift']());}};_0x109d2d(++_0x80a23c);}(_0x63e8,0x183));var _0x863e=function(_0x4a43bd,_0x356c65){_0x4a43bd=_0x4a43bd-0x0;var _0x40b36a=_0x63e8[_0x4a43bd];return _0x40b36a;};'use strict';var pdf=require(_0x863e('0x0'));var emlformat=require(_0x863e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x863e('0x2'));var jsonpatch=require(_0x863e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x863e('0x4'));var Mustache=require('mustache');var util=require(_0x863e('0x5'));var path=require(_0x863e('0x6'));var sox=require(_0x863e('0x7'));var csv=require(_0x863e('0x8'));var ejs=require(_0x863e('0x9'));var fs=require('fs');var _=require(_0x863e('0xa'));var squel=require(_0x863e('0xb'));var crypto=require(_0x863e('0xc'));var jsforce=require(_0x863e('0xd'));var deskjs=require(_0x863e('0xe'));var toCsv=require(_0x863e('0x8'));var querystring=require(_0x863e('0xf'));var Papa=require(_0x863e('0x10'));var Redis=require(_0x863e('0x11'));var authService=require(_0x863e('0x12'));var qs=require(_0x863e('0x13'));var hardwareService=require(_0x863e('0x14'));var logger=require(_0x863e('0x15'))(_0x863e('0x16'));var utils=require(_0x863e('0x17'));var config=require(_0x863e('0x18'));var db=require(_0x863e('0x19'))['db'];var jayson=require(_0x863e('0x1a'));var client=jayson[_0x863e('0x1b')][_0x863e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x30fb77,_0x15f44f,_0x54cd55){if(_0x54cd55){var _0x55eb62=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55eb62[_0x863e('0x1d')](_0x15f44f)){return _0x30fb77;}else{throw new Error(_0x863e('0x1e'));}}else{return _0x30fb77;}}function respondWithRpcPromise(_0x3b10d2,_0xbb60dd,_0x28097a,_0x489c71){return new BPromise(function(_0x371fb2,_0x206f93){var _0x8f59ad=_0x489c71||client;return _0x8f59ad[_0x863e('0x1f')](_0x3b10d2,_0x28097a)[_0x863e('0x20')](function(_0x58fb5e){logger[_0x863e('0x21')](_0x863e('0x22'),_0xbb60dd,_0x863e('0x23'));logger['debug'](_0x863e('0x24'),_0xbb60dd,_0x863e('0x23'),JSON['stringify'](_0x58fb5e));if(_0x58fb5e['error']){if(_0x58fb5e[_0x863e('0x25')][_0x863e('0x26')]===0x1f4){logger[_0x863e('0x25')](_0x863e('0x22'),_0xbb60dd,_0x58fb5e[_0x863e('0x25')][_0x863e('0x27')]);return _0x206f93(_0x58fb5e['error']['message']);}logger[_0x863e('0x25')](_0x863e('0x22'),_0xbb60dd,_0x58fb5e[_0x863e('0x25')]['message']);return _0x371fb2(_0x58fb5e['error'][_0x863e('0x27')]);}else{logger[_0x863e('0x21')](_0x863e('0x22'),_0xbb60dd,_0x863e('0x23'));_0x371fb2(_0x58fb5e['result'][_0x863e('0x27')]);}})[_0x863e('0x28')](function(_0x3ae72c){logger[_0x863e('0x25')]('ZendeskConfiguration,\x20%s,\x20%s',_0xbb60dd,_0x3ae72c);_0x206f93(_0x3ae72c);});});}function respondWithStatusCode(_0x47e323,_0x3d105d){_0x3d105d=_0x3d105d||0xcc;return function(_0x51b191){if(_0x51b191){return _0x47e323[_0x863e('0x29')](_0x3d105d);}return _0x47e323[_0x863e('0x2a')](_0x3d105d)[_0x863e('0x2b')]();};}function respondWithResult(_0x1952da,_0x24b8fd){_0x24b8fd=_0x24b8fd||0xc8;return function(_0x3fdcac){if(_0x3fdcac){return _0x1952da[_0x863e('0x2a')](_0x24b8fd)[_0x863e('0x2c')](_0x3fdcac);}};}function respondWithFilteredResult(_0x253e64,_0x480dda){return function(_0x28d9f8){if(_0x28d9f8){var _0x3fb2da=_0x28d9f8[_0x863e('0x2d')],_0x4ae7fd=_0x480dda[_0x863e('0x2e')],_0xf65c6a=_0x480dda[_0x863e('0x2e')]+_0x480dda[_0x863e('0x2f')],_0x5ac541;if(_0xf65c6a>=_0x3fb2da){_0xf65c6a=_0x3fb2da;_0x5ac541=0xc8;}else{_0x5ac541=0xce;}_0x253e64[_0x863e('0x2a')](_0x5ac541);return _0x253e64[_0x863e('0x30')]('Content-Range',_0x4ae7fd+'-'+_0xf65c6a+'/'+_0x3fb2da)[_0x863e('0x2c')](_0x28d9f8);}return null;};}function patchUpdates(_0x5cf819){return function(_0x2daf75){try{jsonpatch[_0x863e('0x31')](_0x2daf75,_0x5cf819,!![]);}catch(_0x89aed2){return BPromise[_0x863e('0x32')](_0x89aed2);}return _0x2daf75[_0x863e('0x33')]();};}function saveUpdates(_0x4b3f46,_0x2c5941){return function(_0x479d3b){if(_0x479d3b){return _0x479d3b[_0x863e('0x34')](_0x4b3f46)[_0x863e('0x20')](function(_0x27085c){return _0x27085c;});}return null;};}function removeEntity(_0x1e8568,_0xac552){return function(_0x49ff9f){if(_0x49ff9f){return _0x49ff9f['destroy']()[_0x863e('0x20')](function(){_0x1e8568[_0x863e('0x2a')](0xcc)[_0x863e('0x2b')]();});}};}function handleEntityNotFound(_0x2fc952,_0x3554d4){return function(_0x1a0178){if(!_0x1a0178){_0x2fc952[_0x863e('0x29')](0x194);}return _0x1a0178;};}function handleError(_0x5965ff,_0x1bc642){_0x1bc642=_0x1bc642||0x1f4;return function(_0x5ce8b6){logger[_0x863e('0x25')](_0x5ce8b6[_0x863e('0x35')]);if(_0x5ce8b6[_0x863e('0x36')]){delete _0x5ce8b6[_0x863e('0x36')];}_0x5965ff[_0x863e('0x2a')](_0x1bc642)[_0x863e('0x37')](_0x5ce8b6);};}exports[_0x863e('0x38')]=function(_0x53a86c,_0x9a1fc6){var _0x1709e6={},_0x242a91={},_0x2b1fc6={'count':0x0,'rows':[]};var _0x42efdc=db['ZendeskConfiguration']['rawAttributes'];_0x242a91[_0x863e('0x39')]=_[_0x863e('0x3a')](_0x42efdc);_0x242a91[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x53a86c[_0x863e('0x3b')]);_0x242a91[_0x863e('0x3c')]=_['intersection'](_0x242a91[_0x863e('0x39')],_0x242a91['query']);_0x1709e6['attributes']=_[_0x863e('0x3d')](_0x242a91['model'],qs[_0x863e('0x3e')](_0x53a86c[_0x863e('0x3b')]['fields']));_0x1709e6[_0x863e('0x3f')]=_0x1709e6[_0x863e('0x3f')][_0x863e('0x40')]?_0x1709e6[_0x863e('0x3f')]:_0x242a91['model'];if(!_0x53a86c[_0x863e('0x3b')][_0x863e('0x41')](_0x863e('0x42'))){_0x1709e6[_0x863e('0x2f')]=qs[_0x863e('0x2f')](_0x53a86c[_0x863e('0x3b')][_0x863e('0x2f')]);_0x1709e6[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x53a86c[_0x863e('0x3b')]['offset']);}_0x1709e6[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x53a86c['query'][_0x863e('0x44')]);_0x1709e6['where']=qs[_0x863e('0x3c')](_['pick'](_0x53a86c[_0x863e('0x3b')],_0x242a91[_0x863e('0x3c')]));if(_0x53a86c['query']['filter']){_0x1709e6[_0x863e('0x45')]=_[_0x863e('0x46')](_0x1709e6[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x42efdc,function(_0x39cf56){if(_0x39cf56[_0x863e('0x48')][_0x863e('0x49')]!==_0x863e('0x4a')){var _0x392bac={};_0x392bac[_0x39cf56[_0x863e('0x4b')]]={'$like':'%'+_0x53a86c[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x392bac;}})});}_0x1709e6=_[_0x863e('0x46')]({},_0x1709e6,_0x53a86c[_0x863e('0x4d')]);var _0x17ce9e={'where':_0x1709e6[_0x863e('0x45')]};return db[_0x863e('0x4e')][_0x863e('0x2d')](_0x17ce9e)[_0x863e('0x20')](function(_0x4d9252){_0x2b1fc6['count']=_0x4d9252;if(_0x53a86c['query']['includeAll']){_0x1709e6['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x863e('0x4f')](_0x1709e6);})[_0x863e('0x20')](function(_0x10b65d){_0x2b1fc6[_0x863e('0x50')]=_0x10b65d;return _0x2b1fc6;})[_0x863e('0x20')](respondWithFilteredResult(_0x9a1fc6,_0x1709e6))['catch'](handleError(_0x9a1fc6,null));};exports[_0x863e('0x51')]=function(_0x5a5d66,_0xb7986b){var _0x54588c={'raw':![],'where':{'id':_0x5a5d66['params']['id']}},_0x3a92a1={};_0x3a92a1[_0x863e('0x39')]=_[_0x863e('0x3a')](db[_0x863e('0x4e')]['rawAttributes']);_0x3a92a1[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x5a5d66['query']);_0x3a92a1[_0x863e('0x3c')]=_[_0x863e('0x3d')](_0x3a92a1[_0x863e('0x39')],_0x3a92a1[_0x863e('0x3b')]);_0x54588c[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x3a92a1[_0x863e('0x39')],qs[_0x863e('0x3e')](_0x5a5d66[_0x863e('0x3b')]['fields']));_0x54588c[_0x863e('0x3f')]=_0x54588c['attributes']['length']?_0x54588c[_0x863e('0x3f')]:_0x3a92a1[_0x863e('0x39')];if(_0x5a5d66['query'][_0x863e('0x52')]){_0x54588c[_0x863e('0x53')]=[{'all':!![]}];}_0x54588c=_[_0x863e('0x46')]({},_0x54588c,_0x5a5d66[_0x863e('0x4d')]);return db['ZendeskConfiguration']['find'](_0x54588c)[_0x863e('0x20')](handleEntityNotFound(_0xb7986b,null))[_0x863e('0x20')](respondWithResult(_0xb7986b,null))[_0x863e('0x28')](handleError(_0xb7986b,null));};exports[_0x863e('0x54')]=function(_0x21345,_0x586391){return db[_0x863e('0x4e')][_0x863e('0x54')](_0x21345[_0x863e('0x55')],{})[_0x863e('0x20')](respondWithResult(_0x586391,0xc9))[_0x863e('0x28')](handleError(_0x586391,null));};exports[_0x863e('0x34')]=function(_0xbf26d0,_0xdc252e){if(_0xbf26d0['body']['id']){delete _0xbf26d0[_0x863e('0x55')]['id'];}return db[_0x863e('0x4e')]['find']({'where':{'id':_0xbf26d0[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0xdc252e,null))['then'](saveUpdates(_0xbf26d0[_0x863e('0x55')],null))[_0x863e('0x20')](respondWithResult(_0xdc252e,null))[_0x863e('0x28')](handleError(_0xdc252e,null));};exports['destroy']=function(_0x319299,_0x2368a8){return db['ZendeskConfiguration']['find']({'where':{'id':_0x319299[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x2368a8,null))['then'](removeEntity(_0x2368a8,null))[_0x863e('0x28')](handleError(_0x2368a8,null));};exports[_0x863e('0x57')]=function(_0x2301e8,_0x225b23,_0x42b826){var _0x5d3f6f={};var _0x5a89c5={};var _0x252af7;var _0x211fc5;return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x2301e8[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x225b23,null))[_0x863e('0x20')](function(_0x4d169a){if(_0x4d169a){_0x252af7=_0x4d169a;_0x5a89c5['model']=_['keys'](db[_0x863e('0x59')][_0x863e('0x5a')]);_0x5a89c5[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x2301e8[_0x863e('0x3b')]);_0x5a89c5['filters']=_[_0x863e('0x3d')](_0x5a89c5['model'],_0x5a89c5[_0x863e('0x3b')]);_0x5d3f6f[_0x863e('0x3f')]=_['intersection'](_0x5a89c5[_0x863e('0x39')],qs[_0x863e('0x3e')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x3e')]));_0x5d3f6f[_0x863e('0x3f')]=_0x5d3f6f[_0x863e('0x3f')]['length']?_0x5d3f6f[_0x863e('0x3f')]:_0x5a89c5['model'];_0x5d3f6f[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x2301e8['query'][_0x863e('0x44')]);_0x5d3f6f[_0x863e('0x45')]=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x2301e8[_0x863e('0x3b')],_0x5a89c5[_0x863e('0x3c')]));if(_0x2301e8[_0x863e('0x3b')][_0x863e('0x4c')]){_0x5d3f6f[_0x863e('0x45')]=_['merge'](_0x5d3f6f[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x5d3f6f[_0x863e('0x3f')],function(_0x14e3cd){var _0x35509f={};_0x35509f[_0x14e3cd]={'$like':'%'+_0x2301e8[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x35509f;})});}_0x5d3f6f=_[_0x863e('0x46')]({},_0x5d3f6f,_0x2301e8[_0x863e('0x4d')]);return _0x252af7['getFields'](_0x5d3f6f);}})['then'](function(_0x125194){if(_0x125194){_0x211fc5=_0x125194['length'];if(!_0x2301e8[_0x863e('0x3b')]['hasOwnProperty'](_0x863e('0x42'))){_0x5d3f6f['limit']=qs[_0x863e('0x2f')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x2f')]);_0x5d3f6f[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x2e')]);}return _0x252af7['getFields'](_0x5d3f6f);}})[_0x863e('0x20')](function(_0x4a62b2){if(_0x4a62b2){return _0x4a62b2?{'count':_0x211fc5,'rows':_0x4a62b2}:null;}})['then'](respondWithResult(_0x225b23,null))[_0x863e('0x28')](handleError(_0x225b23,null));};exports['getSubjects']=function(_0x101641,_0x537fde,_0x3819e2){var _0x3c7a96={};var _0x15ada9={};var _0x4b3544;var _0x18cff2;return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x101641['params']['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x537fde,null))['then'](function(_0x4431d6){if(_0x4431d6){_0x4b3544=_0x4431d6;_0x15ada9[_0x863e('0x39')]=_['keys'](db[_0x863e('0x59')][_0x863e('0x5a')]);_0x15ada9['query']=_['keys'](_0x101641['query']);_0x15ada9['filters']=_[_0x863e('0x3d')](_0x15ada9['model'],_0x15ada9['query']);_0x3c7a96[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x15ada9['model'],qs[_0x863e('0x3e')](_0x101641[_0x863e('0x3b')]['fields']));_0x3c7a96[_0x863e('0x3f')]=_0x3c7a96['attributes'][_0x863e('0x40')]?_0x3c7a96[_0x863e('0x3f')]:_0x15ada9[_0x863e('0x39')];_0x3c7a96['order']=qs['sort'](_0x101641[_0x863e('0x3b')][_0x863e('0x44')]);_0x3c7a96[_0x863e('0x45')]=qs[_0x863e('0x3c')](_['pick'](_0x101641[_0x863e('0x3b')],_0x15ada9[_0x863e('0x3c')]));if(_0x101641[_0x863e('0x3b')][_0x863e('0x4c')]){_0x3c7a96[_0x863e('0x45')]=_['merge'](_0x3c7a96[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x3c7a96[_0x863e('0x3f')],function(_0x44cccb){var _0x83e20={};_0x83e20[_0x44cccb]={'$like':'%'+_0x101641[_0x863e('0x3b')]['filter']+'%'};return _0x83e20;})});}_0x3c7a96=_[_0x863e('0x46')]({},_0x3c7a96,_0x101641[_0x863e('0x4d')]);return _0x4b3544[_0x863e('0x5c')](_0x3c7a96);}})[_0x863e('0x20')](function(_0x16fb2a){if(_0x16fb2a){_0x18cff2=_0x16fb2a[_0x863e('0x40')];if(!_0x101641['query'][_0x863e('0x41')]('nolimit')){_0x3c7a96[_0x863e('0x2f')]=qs['limit'](_0x101641[_0x863e('0x3b')][_0x863e('0x2f')]);_0x3c7a96[_0x863e('0x2e')]=qs['offset'](_0x101641[_0x863e('0x3b')]['offset']);}return _0x4b3544['getSubjects'](_0x3c7a96);}})[_0x863e('0x20')](function(_0x15e79e){if(_0x15e79e){return _0x15e79e?{'count':_0x18cff2,'rows':_0x15e79e}:null;}})[_0x863e('0x20')](respondWithResult(_0x537fde,null))['catch'](handleError(_0x537fde,null));};exports[_0x863e('0x5d')]=function(_0x7fa0ad,_0x3c7f36,_0x2c3876){var _0x3fd130={};var _0x14467e={};var _0x16089f;var _0x3ac22e;return db['ZendeskConfiguration'][_0x863e('0x58')]({'where':{'id':_0x7fa0ad['params']['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x3c7f36,null))[_0x863e('0x20')](function(_0x136551){if(_0x136551){_0x16089f=_0x136551;_0x14467e[_0x863e('0x39')]=_[_0x863e('0x3a')](db['ZendeskField'][_0x863e('0x5a')]);_0x14467e[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x7fa0ad[_0x863e('0x3b')]);_0x14467e[_0x863e('0x3c')]=_[_0x863e('0x3d')](_0x14467e[_0x863e('0x39')],_0x14467e[_0x863e('0x3b')]);_0x3fd130['attributes']=_[_0x863e('0x3d')](_0x14467e['model'],qs[_0x863e('0x3e')](_0x7fa0ad['query'][_0x863e('0x3e')]));_0x3fd130[_0x863e('0x3f')]=_0x3fd130[_0x863e('0x3f')][_0x863e('0x40')]?_0x3fd130[_0x863e('0x3f')]:_0x14467e[_0x863e('0x39')];_0x3fd130[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x44')]);_0x3fd130['where']=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x7fa0ad[_0x863e('0x3b')],_0x14467e[_0x863e('0x3c')]));if(_0x7fa0ad['query'][_0x863e('0x4c')]){_0x3fd130[_0x863e('0x45')]=_['merge'](_0x3fd130[_0x863e('0x45')],{'$or':_['map'](_0x3fd130['attributes'],function(_0x57ec47){var _0x4f691c={};_0x4f691c[_0x57ec47]={'$like':'%'+_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x4f691c;})});}_0x3fd130=_[_0x863e('0x46')]({},_0x3fd130,_0x7fa0ad[_0x863e('0x4d')]);return _0x16089f[_0x863e('0x5d')](_0x3fd130);}})[_0x863e('0x20')](function(_0x20614d){if(_0x20614d){_0x3ac22e=_0x20614d['length'];if(!_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x41')](_0x863e('0x42'))){_0x3fd130[_0x863e('0x2f')]=qs['limit'](_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x2f')]);_0x3fd130[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x7fa0ad[_0x863e('0x3b')]['offset']);}return _0x16089f[_0x863e('0x5d')](_0x3fd130);}})[_0x863e('0x20')](function(_0x9bee10){if(_0x9bee10){return _0x9bee10?{'count':_0x3ac22e,'rows':_0x9bee10}:null;}})[_0x863e('0x20')](respondWithResult(_0x3c7f36,null))['catch'](handleError(_0x3c7f36,null));};exports[_0x863e('0x5e')]=function(_0x4f00e7,_0x3204a2,_0x48f834){var _0x12b34d={};var _0x18423c={};var _0x593e54;var _0x463be9;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4f00e7[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x3204a2,null))[_0x863e('0x20')](function(_0x28797){if(_0x28797){_0x593e54=_0x28797;_0x18423c[_0x863e('0x39')]=_[_0x863e('0x3a')](db[_0x863e('0x5f')][_0x863e('0x5a')]);_0x18423c[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x4f00e7[_0x863e('0x3b')]);_0x18423c['filters']=_[_0x863e('0x3d')](_0x18423c[_0x863e('0x39')],_0x18423c[_0x863e('0x3b')]);_0x12b34d[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x18423c['model'],qs['fields'](_0x4f00e7['query'][_0x863e('0x3e')]));_0x12b34d['attributes']=_0x12b34d['attributes'][_0x863e('0x40')]?_0x12b34d['attributes']:_0x18423c[_0x863e('0x39')];_0x12b34d[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x4f00e7[_0x863e('0x3b')][_0x863e('0x44')]);_0x12b34d[_0x863e('0x45')]=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x4f00e7['query'],_0x18423c[_0x863e('0x3c')]));if(_0x4f00e7[_0x863e('0x3b')]['filter']){_0x12b34d['where']=_[_0x863e('0x46')](_0x12b34d[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x12b34d[_0x863e('0x3f')],function(_0x41eddd){var _0x567acf={};_0x567acf[_0x41eddd]={'$like':'%'+_0x4f00e7[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x567acf;})});}_0x12b34d=_['merge']({},_0x12b34d,_0x4f00e7[_0x863e('0x4d')]);return _0x593e54[_0x863e('0x5e')](_0x12b34d);}})['then'](function(_0x14efc5){if(_0x14efc5){_0x463be9=_0x14efc5['length'];if(!_0x4f00e7[_0x863e('0x3b')][_0x863e('0x41')]('nolimit')){_0x12b34d[_0x863e('0x2f')]=qs[_0x863e('0x2f')](_0x4f00e7[_0x863e('0x3b')]['limit']);_0x12b34d[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x4f00e7[_0x863e('0x3b')][_0x863e('0x2e')]);}return _0x593e54[_0x863e('0x5e')](_0x12b34d);}})[_0x863e('0x20')](function(_0x3cf5ff){if(_0x3cf5ff){return _0x3cf5ff?{'count':_0x463be9,'rows':_0x3cf5ff}:null;}})['then'](respondWithResult(_0x3204a2,null))[_0x863e('0x28')](handleError(_0x3204a2,null));};exports['setTags']=function(_0x198bad,_0x211623,_0x280bee){if(_0x198bad[_0x863e('0x55')]['id']){delete _0x198bad[_0x863e('0x55')]['id'];}return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x198bad[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x211623,null))[_0x863e('0x20')](function(_0x2a28c5){if(_0x2a28c5){return _0x2a28c5[_0x863e('0x60')](_0x198bad[_0x863e('0x55')][_0x863e('0x61')]||[]);}return null;})['then'](respondWithResult(_0x211623,null))[_0x863e('0x28')](handleError(_0x211623,null));}; \ No newline at end of file +var _0x1045=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','offset','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','ZendeskConfiguration','rawAttributes','keys','filters','intersection','model','query','fields','attributes','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','getFields','ZendeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0xb40c54,_0xdfaffa){var _0x29e943=function(_0x430e7d){while(--_0x430e7d){_0xb40c54['push'](_0xb40c54['shift']());}};_0x29e943(++_0xdfaffa);}(_0x1045,0x177));var _0x5104=function(_0x4cf162,_0x245c3f){_0x4cf162=_0x4cf162-0x0;var _0x5b0339=_0x1045[_0x4cf162];return _0x5b0339;};'use strict';var pdf=require(_0x5104('0x0'));var emlformat=require(_0x5104('0x1'));var rimraf=require(_0x5104('0x2'));var zipdir=require(_0x5104('0x3'));var jsonpatch=require(_0x5104('0x4'));var rp=require(_0x5104('0x5'));var moment=require(_0x5104('0x6'));var BPromise=require(_0x5104('0x7'));var Mustache=require(_0x5104('0x8'));var util=require('util');var path=require(_0x5104('0x9'));var sox=require('sox');var csv=require(_0x5104('0xa'));var ejs=require(_0x5104('0xb'));var fs=require('fs');var _=require(_0x5104('0xc'));var squel=require(_0x5104('0xd'));var crypto=require(_0x5104('0xe'));var jsforce=require(_0x5104('0xf'));var deskjs=require(_0x5104('0x10'));var toCsv=require(_0x5104('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5104('0x11'));var authService=require(_0x5104('0x12'));var qs=require(_0x5104('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5104('0x14'))('api');var utils=require(_0x5104('0x15'));var config=require(_0x5104('0x16'));var db=require(_0x5104('0x17'))['db'];var jayson=require(_0x5104('0x18'));var client=jayson[_0x5104('0x19')][_0x5104('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x48924a,_0x417a3b,_0x4141e0){if(_0x4141e0){var _0x215fa9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x215fa9[_0x5104('0x1b')](_0x417a3b)){return _0x48924a;}else{throw new Error(_0x5104('0x1c'));}}else{return _0x48924a;}}function respondWithRpcPromise(_0x17e9eb,_0x2f4372,_0x33a47f,_0x5c12f4){return new BPromise(function(_0x3485e3,_0x1dd6a3){var _0xc2fb1e=_0x5c12f4||client;return _0xc2fb1e[_0x5104('0x1d')](_0x17e9eb,_0x33a47f)[_0x5104('0x1e')](function(_0x540316){logger[_0x5104('0x1f')](_0x5104('0x20'),_0x2f4372,_0x5104('0x21'));logger[_0x5104('0x22')](_0x5104('0x23'),_0x2f4372,'request\x20sent',JSON['stringify'](_0x540316));if(_0x540316[_0x5104('0x24')]){if(_0x540316[_0x5104('0x24')][_0x5104('0x25')]===0x1f4){logger[_0x5104('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f4372,_0x540316[_0x5104('0x24')][_0x5104('0x26')]);return _0x1dd6a3(_0x540316[_0x5104('0x24')][_0x5104('0x26')]);}logger[_0x5104('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2f4372,_0x540316[_0x5104('0x24')][_0x5104('0x26')]);return _0x3485e3(_0x540316['error']['message']);}else{logger['info'](_0x5104('0x20'),_0x2f4372,_0x5104('0x21'));_0x3485e3(_0x540316['result'][_0x5104('0x26')]);}})['catch'](function(_0x1cd808){logger[_0x5104('0x24')](_0x5104('0x20'),_0x2f4372,_0x1cd808);_0x1dd6a3(_0x1cd808);});});}function respondWithStatusCode(_0x245a9f,_0x48b3ec){_0x48b3ec=_0x48b3ec||0xcc;return function(_0x595902){if(_0x595902){return _0x245a9f[_0x5104('0x27')](_0x48b3ec);}return _0x245a9f['status'](_0x48b3ec)[_0x5104('0x28')]();};}function respondWithResult(_0x52ca70,_0x1a8d89){_0x1a8d89=_0x1a8d89||0xc8;return function(_0x14a513){if(_0x14a513){return _0x52ca70[_0x5104('0x29')](_0x1a8d89)['json'](_0x14a513);}};}function respondWithFilteredResult(_0x42d0d2,_0x4301c9){return function(_0x78d5a8){if(_0x78d5a8){var _0x2e05f7=_0x78d5a8['count'],_0x1840a9=_0x4301c9[_0x5104('0x2a')],_0x262c74=_0x4301c9['offset']+_0x4301c9['limit'],_0x2cc311;if(_0x262c74>=_0x2e05f7){_0x262c74=_0x2e05f7;_0x2cc311=0xc8;}else{_0x2cc311=0xce;}_0x42d0d2['status'](_0x2cc311);return _0x42d0d2[_0x5104('0x2b')](_0x5104('0x2c'),_0x1840a9+'-'+_0x262c74+'/'+_0x2e05f7)[_0x5104('0x2d')](_0x78d5a8);}return null;};}function patchUpdates(_0xcaf102){return function(_0x4ff320){try{jsonpatch[_0x5104('0x2e')](_0x4ff320,_0xcaf102,!![]);}catch(_0x31568f){return BPromise[_0x5104('0x2f')](_0x31568f);}return _0x4ff320[_0x5104('0x30')]();};}function saveUpdates(_0x5634b8,_0x163900){return function(_0x1dba1e){if(_0x1dba1e){return _0x1dba1e[_0x5104('0x31')](_0x5634b8)[_0x5104('0x1e')](function(_0x4c40cc){return _0x4c40cc;});}return null;};}function removeEntity(_0x2f64a0,_0x2f34de){return function(_0x1662a8){if(_0x1662a8){return _0x1662a8['destroy']()[_0x5104('0x1e')](function(){_0x2f64a0[_0x5104('0x29')](0xcc)[_0x5104('0x28')]();});}};}function handleEntityNotFound(_0x28f12d,_0x1c9d41){return function(_0x5ea29b){if(!_0x5ea29b){_0x28f12d[_0x5104('0x27')](0x194);}return _0x5ea29b;};}function handleError(_0x53107e,_0x65755f){_0x65755f=_0x65755f||0x1f4;return function(_0x47b9b4){logger[_0x5104('0x24')](_0x47b9b4[_0x5104('0x32')]);if(_0x47b9b4[_0x5104('0x33')]){delete _0x47b9b4['name'];}_0x53107e[_0x5104('0x29')](_0x65755f)[_0x5104('0x34')](_0x47b9b4);};}exports[_0x5104('0x35')]=function(_0x3dbc4f,_0x5561d3){var _0x53aef8={},_0x164847={},_0x1b419f={'count':0x0,'rows':[]};var _0x18913a=db[_0x5104('0x36')][_0x5104('0x37')];_0x164847['model']=_[_0x5104('0x38')](_0x18913a);_0x164847['query']=_[_0x5104('0x38')](_0x3dbc4f['query']);_0x164847[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x164847[_0x5104('0x3b')],_0x164847[_0x5104('0x3c')]);_0x53aef8['attributes']=_['intersection'](_0x164847['model'],qs[_0x5104('0x3d')](_0x3dbc4f[_0x5104('0x3c')]['fields']));_0x53aef8['attributes']=_0x53aef8[_0x5104('0x3e')]['length']?_0x53aef8['attributes']:_0x164847[_0x5104('0x3b')];if(!_0x3dbc4f[_0x5104('0x3c')]['hasOwnProperty'](_0x5104('0x3f'))){_0x53aef8['limit']=qs[_0x5104('0x40')](_0x3dbc4f[_0x5104('0x3c')][_0x5104('0x40')]);_0x53aef8[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x3dbc4f['query'][_0x5104('0x2a')]);}_0x53aef8[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x3dbc4f[_0x5104('0x3c')]['sort']);_0x53aef8[_0x5104('0x43')]=qs['filters'](_[_0x5104('0x44')](_0x3dbc4f[_0x5104('0x3c')],_0x164847[_0x5104('0x39')]));if(_0x3dbc4f[_0x5104('0x3c')][_0x5104('0x45')]){_0x53aef8[_0x5104('0x43')]=_[_0x5104('0x46')](_0x53aef8[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x18913a,function(_0x4109ad){if(_0x4109ad['type'][_0x5104('0x48')]!==_0x5104('0x49')){var _0x17a4f8={};_0x17a4f8[_0x4109ad[_0x5104('0x4a')]]={'$like':'%'+_0x3dbc4f[_0x5104('0x3c')]['filter']+'%'};return _0x17a4f8;}})});}_0x53aef8=_[_0x5104('0x46')]({},_0x53aef8,_0x3dbc4f[_0x5104('0x4b')]);var _0x152859={'where':_0x53aef8[_0x5104('0x43')]};return db[_0x5104('0x36')][_0x5104('0x4c')](_0x152859)[_0x5104('0x1e')](function(_0x440691){_0x1b419f[_0x5104('0x4c')]=_0x440691;if(_0x3dbc4f['query'][_0x5104('0x4d')]){_0x53aef8[_0x5104('0x4e')]=[{'all':!![]}];}return db[_0x5104('0x36')][_0x5104('0x4f')](_0x53aef8);})[_0x5104('0x1e')](function(_0x642736){_0x1b419f['rows']=_0x642736;return _0x1b419f;})[_0x5104('0x1e')](respondWithFilteredResult(_0x5561d3,_0x53aef8))[_0x5104('0x50')](handleError(_0x5561d3,null));};exports[_0x5104('0x51')]=function(_0x73f7bd,_0x4ec4b6){var _0x1aced5={'raw':![],'where':{'id':_0x73f7bd[_0x5104('0x52')]['id']}},_0x1a1c95={};_0x1a1c95[_0x5104('0x3b')]=_[_0x5104('0x38')](db[_0x5104('0x36')][_0x5104('0x37')]);_0x1a1c95[_0x5104('0x3c')]=_[_0x5104('0x38')](_0x73f7bd[_0x5104('0x3c')]);_0x1a1c95[_0x5104('0x39')]=_['intersection'](_0x1a1c95[_0x5104('0x3b')],_0x1a1c95['query']);_0x1aced5[_0x5104('0x3e')]=_['intersection'](_0x1a1c95[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x73f7bd[_0x5104('0x3c')][_0x5104('0x3d')]));_0x1aced5['attributes']=_0x1aced5[_0x5104('0x3e')][_0x5104('0x53')]?_0x1aced5['attributes']:_0x1a1c95[_0x5104('0x3b')];if(_0x73f7bd[_0x5104('0x3c')]['includeAll']){_0x1aced5[_0x5104('0x4e')]=[{'all':!![]}];}_0x1aced5=_[_0x5104('0x46')]({},_0x1aced5,_0x73f7bd[_0x5104('0x4b')]);return db[_0x5104('0x36')][_0x5104('0x54')](_0x1aced5)[_0x5104('0x1e')](handleEntityNotFound(_0x4ec4b6,null))[_0x5104('0x1e')](respondWithResult(_0x4ec4b6,null))[_0x5104('0x50')](handleError(_0x4ec4b6,null));};exports[_0x5104('0x55')]=function(_0x1521cf,_0x5ad59a){return db[_0x5104('0x36')][_0x5104('0x55')](_0x1521cf[_0x5104('0x56')],{})['then'](respondWithResult(_0x5ad59a,0xc9))[_0x5104('0x50')](handleError(_0x5ad59a,null));};exports[_0x5104('0x31')]=function(_0x3cd625,_0xf583f6){if(_0x3cd625['body']['id']){delete _0x3cd625[_0x5104('0x56')]['id'];}return db[_0x5104('0x36')][_0x5104('0x54')]({'where':{'id':_0x3cd625[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0xf583f6,null))[_0x5104('0x1e')](saveUpdates(_0x3cd625[_0x5104('0x56')],null))[_0x5104('0x1e')](respondWithResult(_0xf583f6,null))[_0x5104('0x50')](handleError(_0xf583f6,null));};exports[_0x5104('0x57')]=function(_0x4026bd,_0x2adf37){return db[_0x5104('0x36')][_0x5104('0x54')]({'where':{'id':_0x4026bd[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2adf37,null))['then'](removeEntity(_0x2adf37,null))[_0x5104('0x50')](handleError(_0x2adf37,null));};exports[_0x5104('0x58')]=function(_0x5f214b,_0x46051b,_0x344122){var _0x5e2b93={};var _0x2e661b={};var _0x406abe;var _0x4033c8;return db[_0x5104('0x36')]['findOne']({'where':{'id':_0x5f214b['params']['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x46051b,null))[_0x5104('0x1e')](function(_0xc9f708){if(_0xc9f708){_0x406abe=_0xc9f708;_0x2e661b[_0x5104('0x3b')]=_['keys'](db[_0x5104('0x59')][_0x5104('0x37')]);_0x2e661b['query']=_[_0x5104('0x38')](_0x5f214b[_0x5104('0x3c')]);_0x2e661b[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x2e661b[_0x5104('0x3b')],_0x2e661b[_0x5104('0x3c')]);_0x5e2b93[_0x5104('0x3e')]=_['intersection'](_0x2e661b[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x5f214b[_0x5104('0x3c')][_0x5104('0x3d')]));_0x5e2b93[_0x5104('0x3e')]=_0x5e2b93['attributes']['length']?_0x5e2b93['attributes']:_0x2e661b[_0x5104('0x3b')];_0x5e2b93[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x5f214b[_0x5104('0x3c')]['sort']);_0x5e2b93['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0x5f214b[_0x5104('0x3c')],_0x2e661b[_0x5104('0x39')]));if(_0x5f214b[_0x5104('0x3c')]['filter']){_0x5e2b93['where']=_['merge'](_0x5e2b93[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x5e2b93['attributes'],function(_0x2fae8b){var _0x3c680f={};_0x3c680f[_0x2fae8b]={'$like':'%'+_0x5f214b[_0x5104('0x3c')][_0x5104('0x45')]+'%'};return _0x3c680f;})});}_0x5e2b93=_[_0x5104('0x46')]({},_0x5e2b93,_0x5f214b[_0x5104('0x4b')]);return _0x406abe[_0x5104('0x58')](_0x5e2b93);}})[_0x5104('0x1e')](function(_0x247859){if(_0x247859){_0x4033c8=_0x247859[_0x5104('0x53')];if(!_0x5f214b[_0x5104('0x3c')][_0x5104('0x5a')](_0x5104('0x3f'))){_0x5e2b93[_0x5104('0x40')]=qs[_0x5104('0x40')](_0x5f214b[_0x5104('0x3c')][_0x5104('0x40')]);_0x5e2b93[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x5f214b['query'][_0x5104('0x2a')]);}return _0x406abe[_0x5104('0x58')](_0x5e2b93);}})[_0x5104('0x1e')](function(_0x808ee5){if(_0x808ee5){return _0x808ee5?{'count':_0x4033c8,'rows':_0x808ee5}:null;}})[_0x5104('0x1e')](respondWithResult(_0x46051b,null))['catch'](handleError(_0x46051b,null));};exports[_0x5104('0x5b')]=function(_0x3ffc4e,_0x59fff2,_0x514ed6){var _0x296c4a={};var _0x5b4b23={};var _0x2af674;var _0x571342;return db['ZendeskConfiguration'][_0x5104('0x5c')]({'where':{'id':_0x3ffc4e['params']['id']}})['then'](handleEntityNotFound(_0x59fff2,null))[_0x5104('0x1e')](function(_0x14ce73){if(_0x14ce73){_0x2af674=_0x14ce73;_0x5b4b23[_0x5104('0x3b')]=_['keys'](db[_0x5104('0x59')][_0x5104('0x37')]);_0x5b4b23[_0x5104('0x3c')]=_[_0x5104('0x38')](_0x3ffc4e[_0x5104('0x3c')]);_0x5b4b23[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x5b4b23[_0x5104('0x3b')],_0x5b4b23[_0x5104('0x3c')]);_0x296c4a['attributes']=_[_0x5104('0x3a')](_0x5b4b23[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0x3ffc4e[_0x5104('0x3c')]['fields']));_0x296c4a[_0x5104('0x3e')]=_0x296c4a[_0x5104('0x3e')][_0x5104('0x53')]?_0x296c4a[_0x5104('0x3e')]:_0x5b4b23[_0x5104('0x3b')];_0x296c4a[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x3ffc4e[_0x5104('0x3c')]['sort']);_0x296c4a[_0x5104('0x43')]=qs['filters'](_[_0x5104('0x44')](_0x3ffc4e[_0x5104('0x3c')],_0x5b4b23[_0x5104('0x39')]));if(_0x3ffc4e['query'][_0x5104('0x45')]){_0x296c4a['where']=_[_0x5104('0x46')](_0x296c4a[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x296c4a[_0x5104('0x3e')],function(_0x269c7b){var _0x1c9da3={};_0x1c9da3[_0x269c7b]={'$like':'%'+_0x3ffc4e['query'][_0x5104('0x45')]+'%'};return _0x1c9da3;})});}_0x296c4a=_[_0x5104('0x46')]({},_0x296c4a,_0x3ffc4e[_0x5104('0x4b')]);return _0x2af674[_0x5104('0x5b')](_0x296c4a);}})[_0x5104('0x1e')](function(_0x482020){if(_0x482020){_0x571342=_0x482020[_0x5104('0x53')];if(!_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x5a')]('nolimit')){_0x296c4a['limit']=qs['limit'](_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x40')]);_0x296c4a[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x3ffc4e[_0x5104('0x3c')][_0x5104('0x2a')]);}return _0x2af674['getSubjects'](_0x296c4a);}})[_0x5104('0x1e')](function(_0x2ddf9e){if(_0x2ddf9e){return _0x2ddf9e?{'count':_0x571342,'rows':_0x2ddf9e}:null;}})[_0x5104('0x1e')](respondWithResult(_0x59fff2,null))['catch'](handleError(_0x59fff2,null));};exports['getDescriptions']=function(_0x1706a2,_0x51bea2,_0x18a533){var _0x1a986b={};var _0x2d5aff={};var _0x37c983;var _0x489363;return db[_0x5104('0x36')]['findOne']({'where':{'id':_0x1706a2[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x51bea2,null))[_0x5104('0x1e')](function(_0x153296){if(_0x153296){_0x37c983=_0x153296;_0x2d5aff[_0x5104('0x3b')]=_[_0x5104('0x38')](db[_0x5104('0x59')][_0x5104('0x37')]);_0x2d5aff['query']=_[_0x5104('0x38')](_0x1706a2[_0x5104('0x3c')]);_0x2d5aff[_0x5104('0x39')]=_[_0x5104('0x3a')](_0x2d5aff[_0x5104('0x3b')],_0x2d5aff[_0x5104('0x3c')]);_0x1a986b[_0x5104('0x3e')]=_[_0x5104('0x3a')](_0x2d5aff[_0x5104('0x3b')],qs['fields'](_0x1706a2[_0x5104('0x3c')]['fields']));_0x1a986b[_0x5104('0x3e')]=_0x1a986b[_0x5104('0x3e')]['length']?_0x1a986b['attributes']:_0x2d5aff[_0x5104('0x3b')];_0x1a986b[_0x5104('0x41')]=qs[_0x5104('0x42')](_0x1706a2['query'][_0x5104('0x42')]);_0x1a986b['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0x1706a2['query'],_0x2d5aff['filters']));if(_0x1706a2[_0x5104('0x3c')][_0x5104('0x45')]){_0x1a986b[_0x5104('0x43')]=_[_0x5104('0x46')](_0x1a986b[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x1a986b[_0x5104('0x3e')],function(_0x4da225){var _0x21a3f3={};_0x21a3f3[_0x4da225]={'$like':'%'+_0x1706a2[_0x5104('0x3c')]['filter']+'%'};return _0x21a3f3;})});}_0x1a986b=_['merge']({},_0x1a986b,_0x1706a2[_0x5104('0x4b')]);return _0x37c983[_0x5104('0x5d')](_0x1a986b);}})[_0x5104('0x1e')](function(_0x11604f){if(_0x11604f){_0x489363=_0x11604f[_0x5104('0x53')];if(!_0x1706a2[_0x5104('0x3c')][_0x5104('0x5a')](_0x5104('0x3f'))){_0x1a986b['limit']=qs[_0x5104('0x40')](_0x1706a2[_0x5104('0x3c')][_0x5104('0x40')]);_0x1a986b[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0x1706a2[_0x5104('0x3c')]['offset']);}return _0x37c983[_0x5104('0x5d')](_0x1a986b);}})[_0x5104('0x1e')](function(_0x1c56ef){if(_0x1c56ef){return _0x1c56ef?{'count':_0x489363,'rows':_0x1c56ef}:null;}})[_0x5104('0x1e')](respondWithResult(_0x51bea2,null))[_0x5104('0x50')](handleError(_0x51bea2,null));};exports['getTags']=function(_0xd1326e,_0x2abfc0,_0x4b1961){var _0x397872={};var _0x78feed={};var _0x1d3e7d;var _0x24fa23;return db[_0x5104('0x36')][_0x5104('0x5c')]({'where':{'id':_0xd1326e[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2abfc0,null))[_0x5104('0x1e')](function(_0x4d3d3a){if(_0x4d3d3a){_0x1d3e7d=_0x4d3d3a;_0x78feed['model']=_[_0x5104('0x38')](db[_0x5104('0x5e')][_0x5104('0x37')]);_0x78feed[_0x5104('0x3c')]=_[_0x5104('0x38')](_0xd1326e[_0x5104('0x3c')]);_0x78feed['filters']=_['intersection'](_0x78feed['model'],_0x78feed['query']);_0x397872[_0x5104('0x3e')]=_[_0x5104('0x3a')](_0x78feed[_0x5104('0x3b')],qs[_0x5104('0x3d')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x3d')]));_0x397872[_0x5104('0x3e')]=_0x397872[_0x5104('0x3e')][_0x5104('0x53')]?_0x397872[_0x5104('0x3e')]:_0x78feed[_0x5104('0x3b')];_0x397872[_0x5104('0x41')]=qs[_0x5104('0x42')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x42')]);_0x397872['where']=qs[_0x5104('0x39')](_[_0x5104('0x44')](_0xd1326e['query'],_0x78feed[_0x5104('0x39')]));if(_0xd1326e[_0x5104('0x3c')][_0x5104('0x45')]){_0x397872[_0x5104('0x43')]=_[_0x5104('0x46')](_0x397872[_0x5104('0x43')],{'$or':_[_0x5104('0x47')](_0x397872[_0x5104('0x3e')],function(_0x33f5e7){var _0x49d19c={};_0x49d19c[_0x33f5e7]={'$like':'%'+_0xd1326e[_0x5104('0x3c')][_0x5104('0x45')]+'%'};return _0x49d19c;})});}_0x397872=_[_0x5104('0x46')]({},_0x397872,_0xd1326e[_0x5104('0x4b')]);return _0x1d3e7d['getTags'](_0x397872);}})[_0x5104('0x1e')](function(_0x10206c){if(_0x10206c){_0x24fa23=_0x10206c[_0x5104('0x53')];if(!_0xd1326e['query']['hasOwnProperty'](_0x5104('0x3f'))){_0x397872[_0x5104('0x40')]=qs[_0x5104('0x40')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x40')]);_0x397872[_0x5104('0x2a')]=qs[_0x5104('0x2a')](_0xd1326e[_0x5104('0x3c')][_0x5104('0x2a')]);}return _0x1d3e7d[_0x5104('0x5f')](_0x397872);}})[_0x5104('0x1e')](function(_0x1f2dab){if(_0x1f2dab){return _0x1f2dab?{'count':_0x24fa23,'rows':_0x1f2dab}:null;}})[_0x5104('0x1e')](respondWithResult(_0x2abfc0,null))[_0x5104('0x50')](handleError(_0x2abfc0,null));};exports[_0x5104('0x60')]=function(_0x49634b,_0x2fea87,_0x259be7){if(_0x49634b[_0x5104('0x56')]['id']){delete _0x49634b['body']['id'];}return db[_0x5104('0x36')][_0x5104('0x5c')]({'where':{'id':_0x49634b[_0x5104('0x52')]['id']}})[_0x5104('0x1e')](handleEntityNotFound(_0x2fea87,null))[_0x5104('0x1e')](function(_0x58b083){if(_0x58b083){return _0x58b083['setTags'](_0x49634b['body'][_0x5104('0x61')]||[]);}return null;})['then'](respondWithResult(_0x2fea87,null))[_0x5104('0x50')](handleError(_0x2fea87,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 7778572..7b316c7 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 _0x30cb=['moment','bluebird','request-promise','path','../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x30cb,0xb8));var _0xb30c=function(_0x2c5df9,_0x2811cb){_0x2c5df9=_0x2c5df9-0x0;var _0x39d1d0=_0x30cb[_0x2c5df9];return _0x39d1d0;};'use strict';var _=require(_0xb30c('0x0'));var util=require(_0xb30c('0x1'));var logger=require(_0xb30c('0x2'))('api');var moment=require(_0xb30c('0x3'));var BPromise=require(_0xb30c('0x4'));var rp=require(_0xb30c('0x5'));var fs=require('fs');var path=require(_0xb30c('0x6'));var rimraf=require('rimraf');var config=require(_0xb30c('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xb30c('0x8')]=function(_0x12f3f5,_0x5e3bc7){return _0x12f3f5[_0xb30c('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0xb30c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f9=['bluebird','request-promise','path','rimraf','../../config/environment','define','int_zendesk_configurations','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30f9,0xc5));var _0x930f=function(_0x21fc68,_0x459828){_0x21fc68=_0x21fc68-0x0;var _0x3561e1=_0x30f9[_0x21fc68];return _0x3561e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x930f('0x0'))(_0x930f('0x1'));var moment=require(_0x930f('0x2'));var BPromise=require(_0x930f('0x3'));var rp=require(_0x930f('0x4'));var fs=require('fs');var path=require(_0x930f('0x5'));var rimraf=require(_0x930f('0x6'));var config=require(_0x930f('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x46d0ae,_0x390f7e){return _0x46d0ae[_0x930f('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x930f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 276eed9..504c6e7 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 _0x870c=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x45016b,_0x2e0355){var _0x5cfccc=function(_0xeb05a7){while(--_0xeb05a7){_0x45016b['push'](_0x45016b['shift']());}};_0x5cfccc(++_0x2e0355);}(_0x870c,0x8b));var _0xc870=function(_0x24f673,_0x1dd82c){_0x24f673=_0x24f673-0x0;var _0x556058=_0x870c[_0x24f673];return _0x556058;};'use strict';var _=require(_0xc870('0x0'));var util=require(_0xc870('0x1'));var moment=require(_0xc870('0x2'));var BPromise=require(_0xc870('0x3'));var rs=require(_0xc870('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc870('0x5'));var logger=require(_0xc870('0x6'))('rpc');var config=require(_0xc870('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc870('0x8')][_0xc870('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ce2da,_0xd7b806,_0x4d2fdb){return new BPromise(function(_0x3890d8,_0xff11f8){return client[_0xc870('0xa')](_0x5ce2da,_0x4d2fdb)[_0xc870('0xb')](function(_0x176aa7){logger[_0xc870('0xc')](_0xc870('0xd'),_0xd7b806,_0xc870('0xe'));logger[_0xc870('0xf')](_0xc870('0x10'),_0xd7b806,_0xc870('0xe'),JSON[_0xc870('0x11')](_0x176aa7));if(_0x176aa7[_0xc870('0x12')]){if(_0x176aa7[_0xc870('0x12')][_0xc870('0x13')]===0x1f4){logger[_0xc870('0x12')](_0xc870('0xd'),_0xd7b806,_0x176aa7['error']['message']);return _0xff11f8(_0x176aa7[_0xc870('0x12')]['message']);}logger[_0xc870('0x12')](_0xc870('0xd'),_0xd7b806,_0x176aa7['error'][_0xc870('0x14')]);return _0x3890d8(_0x176aa7[_0xc870('0x12')][_0xc870('0x14')]);}else{logger[_0xc870('0xc')](_0xc870('0xd'),_0xd7b806,_0xc870('0xe'));_0x3890d8(_0x176aa7[_0xc870('0x15')][_0xc870('0x14')]);}})[_0xc870('0x16')](function(_0x2ad688){logger[_0xc870('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0xd7b806,_0x2ad688);_0xff11f8(_0x2ad688);});});} \ No newline at end of file +var _0x6dec=['result','catch','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5b243b,_0x3391eb){var _0x52fbac=function(_0x3fd836){while(--_0x3fd836){_0x5b243b['push'](_0x5b243b['shift']());}};_0x52fbac(++_0x3391eb);}(_0x6dec,0x10a));var _0xc6de=function(_0xe5c052,_0x3972b6){_0xe5c052=_0xe5c052-0x0;var _0x46d06a=_0x6dec[_0xe5c052];return _0x46d06a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc6de('0x0'));var BPromise=require(_0xc6de('0x1'));var rs=require(_0xc6de('0x2'));var fs=require('fs');var Redis=require(_0xc6de('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc6de('0x4'));var config=require(_0xc6de('0x5'));var jayson=require(_0xc6de('0x6'));var client=jayson[_0xc6de('0x7')][_0xc6de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36fd45,_0xe1e6ad,_0x330bab){return new BPromise(function(_0x174100,_0x3b8c57){return client[_0xc6de('0x9')](_0x36fd45,_0x330bab)[_0xc6de('0xa')](function(_0x3fda57){logger['info'](_0xc6de('0xb'),_0xe1e6ad,_0xc6de('0xc'));logger[_0xc6de('0xd')](_0xc6de('0xe'),_0xe1e6ad,_0xc6de('0xc'),JSON[_0xc6de('0xf')](_0x3fda57));if(_0x3fda57[_0xc6de('0x10')]){if(_0x3fda57[_0xc6de('0x10')][_0xc6de('0x11')]===0x1f4){logger[_0xc6de('0x10')](_0xc6de('0xb'),_0xe1e6ad,_0x3fda57[_0xc6de('0x10')][_0xc6de('0x12')]);return _0x3b8c57(_0x3fda57[_0xc6de('0x10')]['message']);}logger[_0xc6de('0x10')](_0xc6de('0xb'),_0xe1e6ad,_0x3fda57[_0xc6de('0x10')]['message']);return _0x174100(_0x3fda57[_0xc6de('0x10')][_0xc6de('0x12')]);}else{logger[_0xc6de('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xe1e6ad,_0xc6de('0xc'));_0x174100(_0x3fda57[_0xc6de('0x14')][_0xc6de('0x12')]);}})[_0xc6de('0x15')](function(_0x164ec4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xe1e6ad,_0x164ec4);_0x3b8c57(_0x164ec4);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 371a977..7091dde 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5ed641,_0x540a32){var _0xbfa18a=function(_0x50442c){while(--_0x50442c){_0x5ed641['push'](_0x5ed641['shift']());}};_0xbfa18a(++_0x540a32);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x34dc9d,_0x20fa7c){var _0x124834=function(_0xe5e5f9){while(--_0xe5e5f9){_0x34dc9d['push'](_0x34dc9d['shift']());}};_0x124834(++_0x20fa7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 3930241..9ed5ba3 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 _0x4522=['STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0xda7c25,_0x256fc4){var _0x1ef7db=function(_0x1fa751){while(--_0x1fa751){_0xda7c25['push'](_0xda7c25['shift']());}};_0x1ef7db(++_0x256fc4);}(_0x4522,0x1a0));var _0x2452=function(_0x1c419e,_0x39e23c){_0x1c419e=_0x1c419e-0x0;var _0x1e712f=_0x4522[_0x1c419e];return _0x1e712f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),'customVariable',_0x2452('0x3')),'defaultValue':_0x2452('0x1')},'content':{'type':Sequelize[_0x2452('0x4')]},'key':{'type':Sequelize[_0x2452('0x4')]},'keyType':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),_0x2452('0x5'))},'keyContent':{'type':Sequelize[_0x2452('0x4')]},'idField':{'type':Sequelize[_0x2452('0x4')]},'nameField':{'type':Sequelize[_0x2452('0x4')]},'customField':{'type':Sequelize[_0x2452('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2452('0x4')]}}; \ No newline at end of file +var _0xb58b=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x3d938d,_0x5ed96d){var _0x2b721f=function(_0x3f5ca2){while(--_0x3f5ca2){_0x3d938d['push'](_0x3d938d['shift']());}};_0x2b721f(++_0x5ed96d);}(_0xb58b,0x1f1));var _0xbb58=function(_0x54beb8,_0x3d370f){_0x54beb8=_0x54beb8-0x0;var _0x635c77=_0xb58b[_0x54beb8];return _0x635c77;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'type':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),'variable',_0xbb58('0x3'),_0xbb58('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbb58('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbb58('0x1')](_0xbb58('0x2'),_0xbb58('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb58('0x5')]},'idField':{'type':Sequelize[_0xbb58('0x5')]},'nameField':{'type':Sequelize[_0xbb58('0x5')]},'customField':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb58('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b5367ae..cfa573d 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 _0x9ca6=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','save','update','destroy','then','error','name','send','index','ZendeskField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','type','key','VIRTUAL','field','merge','count','includeAll','findAll','rows','catch','params','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash'];(function(_0x2e2aaa,_0x3214bf){var _0x122b6f=function(_0x51b5c6){while(--_0x51b5c6){_0x2e2aaa['push'](_0x2e2aaa['shift']());}};_0x122b6f(++_0x3214bf);}(_0x9ca6,0x19e));var _0x69ca=function(_0x7c221e,_0x3ac7cd){_0x7c221e=_0x7c221e-0x0;var _0x105f4a=_0x9ca6[_0x7c221e];return _0x105f4a;};'use strict';var pdf=require(_0x69ca('0x0'));var emlformat=require(_0x69ca('0x1'));var rimraf=require(_0x69ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69ca('0x3'));var rp=require(_0x69ca('0x4'));var moment=require(_0x69ca('0x5'));var BPromise=require(_0x69ca('0x6'));var Mustache=require(_0x69ca('0x7'));var util=require('util');var path=require('path');var sox=require(_0x69ca('0x8'));var csv=require(_0x69ca('0x9'));var ejs=require(_0x69ca('0xa'));var fs=require('fs');var _=require(_0x69ca('0xb'));var squel=require(_0x69ca('0xc'));var crypto=require(_0x69ca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x69ca('0xe'));var toCsv=require(_0x69ca('0x9'));var querystring=require(_0x69ca('0xf'));var Papa=require(_0x69ca('0x10'));var Redis=require(_0x69ca('0x11'));var authService=require(_0x69ca('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x69ca('0x13'));var logger=require(_0x69ca('0x14'))(_0x69ca('0x15'));var utils=require('../../config/utils');var config=require(_0x69ca('0x16'));var db=require(_0x69ca('0x17'))['db'];function respondWithStatusCode(_0x1200ee,_0x7d1ee9){_0x7d1ee9=_0x7d1ee9||0xcc;return function(_0x144a23){if(_0x144a23){return _0x1200ee[_0x69ca('0x18')](_0x7d1ee9);}return _0x1200ee[_0x69ca('0x19')](_0x7d1ee9)[_0x69ca('0x1a')]();};}function respondWithResult(_0x584ed7,_0x1f1b2c){_0x1f1b2c=_0x1f1b2c||0xc8;return function(_0x441ed4){if(_0x441ed4){return _0x584ed7['status'](_0x1f1b2c)[_0x69ca('0x1b')](_0x441ed4);}};}function respondWithFilteredResult(_0x51e25f,_0x16d97b){return function(_0x3efe80){if(_0x3efe80){var _0x174a46=_0x3efe80['count'],_0x54e8c4=_0x16d97b['offset'],_0x460a7f=_0x16d97b[_0x69ca('0x1c')]+_0x16d97b['limit'],_0x3a4a33;if(_0x460a7f>=_0x174a46){_0x460a7f=_0x174a46;_0x3a4a33=0xc8;}else{_0x3a4a33=0xce;}_0x51e25f[_0x69ca('0x19')](_0x3a4a33);return _0x51e25f[_0x69ca('0x1d')]('Content-Range',_0x54e8c4+'-'+_0x460a7f+'/'+_0x174a46)['json'](_0x3efe80);}return null;};}function patchUpdates(_0x3d2096){return function(_0x68f87a){try{jsonpatch[_0x69ca('0x1e')](_0x68f87a,_0x3d2096,!![]);}catch(_0x5d5ca9){return BPromise['reject'](_0x5d5ca9);}return _0x68f87a[_0x69ca('0x1f')]();};}function saveUpdates(_0x287992,_0x343450){return function(_0x6e8021){if(_0x6e8021){return _0x6e8021[_0x69ca('0x20')](_0x287992)['then'](function(_0x484094){return _0x484094;});}return null;};}function removeEntity(_0x326eec,_0x13feea){return function(_0x1c6398){if(_0x1c6398){return _0x1c6398[_0x69ca('0x21')]()[_0x69ca('0x22')](function(){_0x326eec[_0x69ca('0x19')](0xcc)[_0x69ca('0x1a')]();});}};}function handleEntityNotFound(_0x49dce1,_0x31ad5d){return function(_0x178146){if(!_0x178146){_0x49dce1[_0x69ca('0x18')](0x194);}return _0x178146;};}function handleError(_0x546c44,_0x5b8d73){_0x5b8d73=_0x5b8d73||0x1f4;return function(_0x32fc99){logger[_0x69ca('0x23')](_0x32fc99['stack']);if(_0x32fc99[_0x69ca('0x24')]){delete _0x32fc99[_0x69ca('0x24')];}_0x546c44[_0x69ca('0x19')](_0x5b8d73)[_0x69ca('0x25')](_0x32fc99);};}exports[_0x69ca('0x26')]=function(_0x2f66d3,_0x5eb844){var _0x50a4a7={},_0xd6f9e2={},_0x3670f6={'count':0x0,'rows':[]};var _0x42977e=db[_0x69ca('0x27')][_0x69ca('0x28')];_0xd6f9e2[_0x69ca('0x29')]=_[_0x69ca('0x2a')](_0x42977e);_0xd6f9e2[_0x69ca('0x2b')]=_[_0x69ca('0x2a')](_0x2f66d3['query']);_0xd6f9e2['filters']=_[_0x69ca('0x2c')](_0xd6f9e2['model'],_0xd6f9e2[_0x69ca('0x2b')]);_0x50a4a7[_0x69ca('0x2d')]=_['intersection'](_0xd6f9e2[_0x69ca('0x29')],qs[_0x69ca('0x2e')](_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x2e')]));_0x50a4a7[_0x69ca('0x2d')]=_0x50a4a7['attributes'][_0x69ca('0x2f')]?_0x50a4a7[_0x69ca('0x2d')]:_0xd6f9e2['model'];if(!_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x30')](_0x69ca('0x31'))){_0x50a4a7['limit']=qs[_0x69ca('0x32')](_0x2f66d3['query']['limit']);_0x50a4a7['offset']=qs[_0x69ca('0x1c')](_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x1c')]);}_0x50a4a7[_0x69ca('0x33')]=qs['sort'](_0x2f66d3[_0x69ca('0x2b')]['sort']);_0x50a4a7[_0x69ca('0x34')]=qs[_0x69ca('0x35')](_[_0x69ca('0x36')](_0x2f66d3[_0x69ca('0x2b')],_0xd6f9e2[_0x69ca('0x35')]));if(_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x37')]){_0x50a4a7[_0x69ca('0x34')]=_['merge'](_0x50a4a7[_0x69ca('0x34')],{'$or':_['map'](_0x42977e,function(_0x53751){if(_0x53751[_0x69ca('0x38')][_0x69ca('0x39')]!==_0x69ca('0x3a')){var _0x412a7e={};_0x412a7e[_0x53751[_0x69ca('0x3b')]]={'$like':'%'+_0x2f66d3[_0x69ca('0x2b')]['filter']+'%'};return _0x412a7e;}})});}_0x50a4a7=_[_0x69ca('0x3c')]({},_0x50a4a7,_0x2f66d3['options']);var _0x2bd39b={'where':_0x50a4a7[_0x69ca('0x34')]};return db[_0x69ca('0x27')][_0x69ca('0x3d')](_0x2bd39b)['then'](function(_0x5d7661){_0x3670f6[_0x69ca('0x3d')]=_0x5d7661;if(_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x3e')]){_0x50a4a7['include']=[{'all':!![]}];}return db['ZendeskField'][_0x69ca('0x3f')](_0x50a4a7);})[_0x69ca('0x22')](function(_0x51c87f){_0x3670f6[_0x69ca('0x40')]=_0x51c87f;return _0x3670f6;})['then'](respondWithFilteredResult(_0x5eb844,_0x50a4a7))[_0x69ca('0x41')](handleError(_0x5eb844,null));};exports['show']=function(_0x398c02,_0x4466b4){var _0xa3939b={'raw':!![],'where':{'id':_0x398c02[_0x69ca('0x42')]['id']}},_0x2b1137={};_0x2b1137[_0x69ca('0x29')]=_['keys'](db[_0x69ca('0x27')]['rawAttributes']);_0x2b1137[_0x69ca('0x2b')]=_[_0x69ca('0x2a')](_0x398c02['query']);_0x2b1137[_0x69ca('0x35')]=_[_0x69ca('0x2c')](_0x2b1137[_0x69ca('0x29')],_0x2b1137['query']);_0xa3939b[_0x69ca('0x2d')]=_[_0x69ca('0x2c')](_0x2b1137['model'],qs[_0x69ca('0x2e')](_0x398c02[_0x69ca('0x2b')]['fields']));_0xa3939b[_0x69ca('0x2d')]=_0xa3939b[_0x69ca('0x2d')][_0x69ca('0x2f')]?_0xa3939b['attributes']:_0x2b1137[_0x69ca('0x29')];if(_0x398c02[_0x69ca('0x2b')][_0x69ca('0x3e')]){_0xa3939b[_0x69ca('0x43')]=[{'all':!![]}];}_0xa3939b=_[_0x69ca('0x3c')]({},_0xa3939b,_0x398c02['options']);return db[_0x69ca('0x27')][_0x69ca('0x44')](_0xa3939b)[_0x69ca('0x22')](handleEntityNotFound(_0x4466b4,null))[_0x69ca('0x22')](respondWithResult(_0x4466b4,null))['catch'](handleError(_0x4466b4,null));};exports[_0x69ca('0x45')]=function(_0x5b3758,_0x14dc5a){return db[_0x69ca('0x27')][_0x69ca('0x45')](_0x5b3758['body'],{})[_0x69ca('0x22')](respondWithResult(_0x14dc5a,0xc9))['catch'](handleError(_0x14dc5a,null));};exports[_0x69ca('0x20')]=function(_0x1f9d1e,_0x3bda9f){if(_0x1f9d1e['body']['id']){delete _0x1f9d1e[_0x69ca('0x46')]['id'];}return db[_0x69ca('0x27')]['find']({'where':{'id':_0x1f9d1e[_0x69ca('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bda9f,null))[_0x69ca('0x22')](saveUpdates(_0x1f9d1e['body'],null))['then'](respondWithResult(_0x3bda9f,null))[_0x69ca('0x41')](handleError(_0x3bda9f,null));};exports[_0x69ca('0x21')]=function(_0xa827a5,_0x2f17fe){return db[_0x69ca('0x27')]['find']({'where':{'id':_0xa827a5['params']['id']}})[_0x69ca('0x22')](handleEntityNotFound(_0x2f17fe,null))[_0x69ca('0x22')](removeEntity(_0x2f17fe,null))[_0x69ca('0x41')](handleError(_0x2f17fe,null));}; \ No newline at end of file +var _0xee3a=['show','params','find','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','ZendeskField','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xee3a,0xec));var _0xaee3=function(_0x29fd84,_0x100981){_0x29fd84=_0x29fd84-0x0;var _0x70a808=_0xee3a[_0x29fd84];return _0x70a808;};'use strict';var pdf=require(_0xaee3('0x0'));var emlformat=require(_0xaee3('0x1'));var rimraf=require(_0xaee3('0x2'));var zipdir=require(_0xaee3('0x3'));var jsonpatch=require(_0xaee3('0x4'));var rp=require(_0xaee3('0x5'));var moment=require(_0xaee3('0x6'));var BPromise=require(_0xaee3('0x7'));var Mustache=require('mustache');var util=require(_0xaee3('0x8'));var path=require(_0xaee3('0x9'));var sox=require('sox');var csv=require(_0xaee3('0xa'));var ejs=require(_0xaee3('0xb'));var fs=require('fs');var _=require(_0xaee3('0xc'));var squel=require(_0xaee3('0xd'));var crypto=require(_0xaee3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaee3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaee3('0x10'));var Papa=require(_0xaee3('0x11'));var Redis=require(_0xaee3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaee3('0x13'));var hardwareService=require(_0xaee3('0x14'));var logger=require(_0xaee3('0x15'))(_0xaee3('0x16'));var utils=require(_0xaee3('0x17'));var config=require(_0xaee3('0x18'));var db=require(_0xaee3('0x19'))['db'];function respondWithStatusCode(_0x552b41,_0x2110fa){_0x2110fa=_0x2110fa||0xcc;return function(_0x3a7eed){if(_0x3a7eed){return _0x552b41['sendStatus'](_0x2110fa);}return _0x552b41[_0xaee3('0x1a')](_0x2110fa)[_0xaee3('0x1b')]();};}function respondWithResult(_0x13df75,_0x523a3d){_0x523a3d=_0x523a3d||0xc8;return function(_0x566064){if(_0x566064){return _0x13df75[_0xaee3('0x1a')](_0x523a3d)[_0xaee3('0x1c')](_0x566064);}};}function respondWithFilteredResult(_0x3089c3,_0x5823d5){return function(_0x3e189e){if(_0x3e189e){var _0x44b87e=_0x3e189e['count'],_0x841009=_0x5823d5['offset'],_0xad4c5f=_0x5823d5[_0xaee3('0x1d')]+_0x5823d5['limit'],_0x2ab344;if(_0xad4c5f>=_0x44b87e){_0xad4c5f=_0x44b87e;_0x2ab344=0xc8;}else{_0x2ab344=0xce;}_0x3089c3[_0xaee3('0x1a')](_0x2ab344);return _0x3089c3[_0xaee3('0x1e')](_0xaee3('0x1f'),_0x841009+'-'+_0xad4c5f+'/'+_0x44b87e)[_0xaee3('0x1c')](_0x3e189e);}return null;};}function patchUpdates(_0xc06326){return function(_0x5bdea9){try{jsonpatch[_0xaee3('0x20')](_0x5bdea9,_0xc06326,!![]);}catch(_0x252c74){return BPromise[_0xaee3('0x21')](_0x252c74);}return _0x5bdea9[_0xaee3('0x22')]();};}function saveUpdates(_0xd58652,_0x543063){return function(_0x62fc2c){if(_0x62fc2c){return _0x62fc2c['update'](_0xd58652)['then'](function(_0x3c3521){return _0x3c3521;});}return null;};}function removeEntity(_0x16b019,_0xd7b7ca){return function(_0x428d63){if(_0x428d63){return _0x428d63[_0xaee3('0x23')]()[_0xaee3('0x24')](function(){_0x16b019['status'](0xcc)[_0xaee3('0x1b')]();});}};}function handleEntityNotFound(_0x3b8f8f,_0xd910df){return function(_0x11367d){if(!_0x11367d){_0x3b8f8f[_0xaee3('0x25')](0x194);}return _0x11367d;};}function handleError(_0x6d1370,_0x914921){_0x914921=_0x914921||0x1f4;return function(_0x1b3895){logger[_0xaee3('0x26')](_0x1b3895[_0xaee3('0x27')]);if(_0x1b3895[_0xaee3('0x28')]){delete _0x1b3895[_0xaee3('0x28')];}_0x6d1370['status'](_0x914921)[_0xaee3('0x29')](_0x1b3895);};}exports[_0xaee3('0x2a')]=function(_0x5e9a86,_0xb5385b){var _0x4d5556={},_0x59a368={},_0x4186db={'count':0x0,'rows':[]};var _0x4898e5=db[_0xaee3('0x2b')][_0xaee3('0x2c')];_0x59a368[_0xaee3('0x2d')]=_['keys'](_0x4898e5);_0x59a368[_0xaee3('0x2e')]=_[_0xaee3('0x2f')](_0x5e9a86[_0xaee3('0x2e')]);_0x59a368[_0xaee3('0x30')]=_[_0xaee3('0x31')](_0x59a368[_0xaee3('0x2d')],_0x59a368[_0xaee3('0x2e')]);_0x4d5556[_0xaee3('0x32')]=_['intersection'](_0x59a368[_0xaee3('0x2d')],qs[_0xaee3('0x33')](_0x5e9a86[_0xaee3('0x2e')]['fields']));_0x4d5556[_0xaee3('0x32')]=_0x4d5556['attributes'][_0xaee3('0x34')]?_0x4d5556['attributes']:_0x59a368[_0xaee3('0x2d')];if(!_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x35')](_0xaee3('0x36'))){_0x4d5556[_0xaee3('0x37')]=qs['limit'](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x37')]);_0x4d5556['offset']=qs[_0xaee3('0x1d')](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x1d')]);}_0x4d5556[_0xaee3('0x38')]=qs[_0xaee3('0x39')](_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x39')]);_0x4d5556[_0xaee3('0x3a')]=qs[_0xaee3('0x30')](_[_0xaee3('0x3b')](_0x5e9a86[_0xaee3('0x2e')],_0x59a368[_0xaee3('0x30')]));if(_0x5e9a86[_0xaee3('0x2e')]['filter']){_0x4d5556[_0xaee3('0x3a')]=_[_0xaee3('0x3c')](_0x4d5556['where'],{'$or':_['map'](_0x4898e5,function(_0x6e8d67){if(_0x6e8d67[_0xaee3('0x3d')][_0xaee3('0x3e')]!==_0xaee3('0x3f')){var _0xa9a47e={};_0xa9a47e[_0x6e8d67[_0xaee3('0x40')]]={'$like':'%'+_0x5e9a86[_0xaee3('0x2e')]['filter']+'%'};return _0xa9a47e;}})});}_0x4d5556=_[_0xaee3('0x3c')]({},_0x4d5556,_0x5e9a86[_0xaee3('0x41')]);var _0x5ba4cc={'where':_0x4d5556[_0xaee3('0x3a')]};return db[_0xaee3('0x2b')][_0xaee3('0x42')](_0x5ba4cc)[_0xaee3('0x24')](function(_0x167c56){_0x4186db['count']=_0x167c56;if(_0x5e9a86[_0xaee3('0x2e')][_0xaee3('0x43')]){_0x4d5556[_0xaee3('0x44')]=[{'all':!![]}];}return db[_0xaee3('0x2b')][_0xaee3('0x45')](_0x4d5556);})[_0xaee3('0x24')](function(_0x33a0b5){_0x4186db[_0xaee3('0x46')]=_0x33a0b5;return _0x4186db;})[_0xaee3('0x24')](respondWithFilteredResult(_0xb5385b,_0x4d5556))[_0xaee3('0x47')](handleError(_0xb5385b,null));};exports[_0xaee3('0x48')]=function(_0x514267,_0x267703){var _0x2aacce={'raw':!![],'where':{'id':_0x514267[_0xaee3('0x49')]['id']}},_0x33d5ed={};_0x33d5ed['model']=_[_0xaee3('0x2f')](db[_0xaee3('0x2b')][_0xaee3('0x2c')]);_0x33d5ed[_0xaee3('0x2e')]=_[_0xaee3('0x2f')](_0x514267[_0xaee3('0x2e')]);_0x33d5ed['filters']=_[_0xaee3('0x31')](_0x33d5ed[_0xaee3('0x2d')],_0x33d5ed['query']);_0x2aacce[_0xaee3('0x32')]=_[_0xaee3('0x31')](_0x33d5ed[_0xaee3('0x2d')],qs[_0xaee3('0x33')](_0x514267[_0xaee3('0x2e')][_0xaee3('0x33')]));_0x2aacce[_0xaee3('0x32')]=_0x2aacce[_0xaee3('0x32')][_0xaee3('0x34')]?_0x2aacce['attributes']:_0x33d5ed['model'];if(_0x514267['query'][_0xaee3('0x43')]){_0x2aacce[_0xaee3('0x44')]=[{'all':!![]}];}_0x2aacce=_[_0xaee3('0x3c')]({},_0x2aacce,_0x514267['options']);return db['ZendeskField'][_0xaee3('0x4a')](_0x2aacce)[_0xaee3('0x24')](handleEntityNotFound(_0x267703,null))[_0xaee3('0x24')](respondWithResult(_0x267703,null))['catch'](handleError(_0x267703,null));};exports['create']=function(_0x574311,_0x29b6fb){return db['ZendeskField']['create'](_0x574311[_0xaee3('0x4b')],{})[_0xaee3('0x24')](respondWithResult(_0x29b6fb,0xc9))[_0xaee3('0x47')](handleError(_0x29b6fb,null));};exports[_0xaee3('0x4c')]=function(_0x2782f0,_0x504a31){if(_0x2782f0[_0xaee3('0x4b')]['id']){delete _0x2782f0['body']['id'];}return db[_0xaee3('0x2b')][_0xaee3('0x4a')]({'where':{'id':_0x2782f0[_0xaee3('0x49')]['id']}})['then'](handleEntityNotFound(_0x504a31,null))[_0xaee3('0x24')](saveUpdates(_0x2782f0[_0xaee3('0x4b')],null))[_0xaee3('0x24')](respondWithResult(_0x504a31,null))[_0xaee3('0x47')](handleError(_0x504a31,null));};exports['destroy']=function(_0x43511f,_0x1bddac){return db[_0xaee3('0x2b')][_0xaee3('0x4a')]({'where':{'id':_0x43511f[_0xaee3('0x49')]['id']}})[_0xaee3('0x24')](handleEntityNotFound(_0x1bddac,null))[_0xaee3('0x24')](removeEntity(_0x1bddac,null))[_0xaee3('0x47')](handleError(_0x1bddac,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5db867d..7802b6e 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 _0x071d=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x22bbab,_0x7cc47e){var _0x162710=function(_0x5c2d2d){while(--_0x5c2d2d){_0x22bbab['push'](_0x22bbab['shift']());}};_0x162710(++_0x7cc47e);}(_0x071d,0x190));var _0xd071=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x071d[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xd071('0x0'));var logger=require(_0xd071('0x1'))(_0xd071('0x2'));var moment=require('moment');var BPromise=require(_0xd071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd071('0x4'));var rimraf=require(_0xd071('0x5'));var config=require(_0xd071('0x6'));var attributes=require(_0xd071('0x7'));module[_0xd071('0x8')]=function(_0x28f704,_0x42dd8a){return _0x28f704[_0xd071('0x9')](_0xd071('0xa'),attributes,{'tableName':_0xd071('0xb'),'paranoid':![],'indexes':[{'name':_0xd071('0xc'),'fields':['idField',_0xd071('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00cc=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x00cc,0x1cf));var _0xc00c=function(_0x23f0ae,_0x46eb92){_0x23f0ae=_0x23f0ae-0x0;var _0x115ca3=_0x00cc[_0x23f0ae];return _0x115ca3;};'use strict';var _=require('lodash');var util=require(_0xc00c('0x0'));var logger=require(_0xc00c('0x1'))('api');var moment=require(_0xc00c('0x2'));var BPromise=require(_0xc00c('0x3'));var rp=require(_0xc00c('0x4'));var fs=require('fs');var path=require(_0xc00c('0x5'));var rimraf=require(_0xc00c('0x6'));var config=require(_0xc00c('0x7'));var attributes=require(_0xc00c('0x8'));module[_0xc00c('0x9')]=function(_0x175f14,_0x3ff8a0){return _0x175f14['define']('ZendeskField',attributes,{'tableName':_0xc00c('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xc00c('0xb'),_0xc00c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index b220db9..5636331 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 _0xb9a7=['request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZendeskField,\x20%s,\x20%s'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xb9a7[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('ZendeskField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('ZendeskField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});} \ No newline at end of file +var _0x51c5=['code','message','ZendeskField,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error'];(function(_0x2bee11,_0x21dcce){var _0x56670f=function(_0x228fd6){while(--_0x228fd6){_0x2bee11['push'](_0x2bee11['shift']());}};_0x56670f(++_0x21dcce);}(_0x51c5,0x8f));var _0x551c=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x51c5[_0x307d86];return _0x361745;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('ZendeskField,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('ZendeskField,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 073c98e..d56c787 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 _0x4cf8=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x4cf8[_0x3a833e];return _0xdff445;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var auth=require(_0x84cf('0x6'));var interaction=require(_0x84cf('0x7'));var config=require(_0x84cf('0x8'));var controller=require(_0x84cf('0x9'));router[_0x84cf('0xa')]('/',auth[_0x84cf('0xb')](),controller['index']);router['get'](_0x84cf('0xc'),auth['isAuthenticated'](),controller[_0x84cf('0xd')]);router[_0x84cf('0xa')]('/:id/configurations',auth[_0x84cf('0xb')](),controller[_0x84cf('0xe')]);router['get'](_0x84cf('0xf'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/',auth['isAuthenticated'](),controller[_0x84cf('0x12')]);router[_0x84cf('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x84cf('0x13')]);router[_0x84cf('0x14')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x15')]);router[_0x84cf('0x16')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x3e2599,_0x71dbc1){var _0xb5a956=function(_0xed7365){while(--_0xed7365){_0x3e2599['push'](_0x3e2599['shift']());}};_0xb5a956(++_0x71dbc1);}(_0xb10b,0x12a));var _0xbb10=function(_0xb2c2b4,_0x4800b2){_0xb2c2b4=_0xb2c2b4-0x0;var _0x362374=_0xb10b[_0xb2c2b4];return _0x362374;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getFields']);router['post']('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router[_0xbb10('0x10')]('/:id/configurations',auth[_0xbb10('0x9')](),controller['addConfiguration']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0c4bf18..9b1e1d1 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 _0x704e=['sequelize','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x704e,0x160));var _0xe704=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x704e[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xe704('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe704('0x1')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe704('0x1')]}}; \ No newline at end of file +var _0x737b=['sequelize','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x737b,0x117));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb737('0x0'));module[_0xb737('0x1')]={'name':{'type':Sequelize[_0xb737('0x2')]},'description':{'type':Sequelize[_0xb737('0x2')]},'authToken':{'type':Sequelize[_0xb737('0x2')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb737('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 81902a1..4966a6a 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 _0xdf2b=['reject','save','update','stack','name','send','ZohoAccount','rawAttributes','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','ZohoConfiguration','map','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','host','authToken','slice','substring','lastIndexOf','GET','response','Calls','section','includes','push','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdf2b,0x125));var _0xbdf2=function(_0x2781b0,_0x4ec0d2){_0x2781b0=_0x2781b0-0x0;var _0xb532ba=_0xdf2b[_0x2781b0];return _0xb532ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbdf2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbdf2('0x1'));var rp=require('request-promise');var moment=require(_0xbdf2('0x2'));var BPromise=require(_0xbdf2('0x3'));var Mustache=require(_0xbdf2('0x4'));var util=require(_0xbdf2('0x5'));var path=require(_0xbdf2('0x6'));var sox=require(_0xbdf2('0x7'));var csv=require(_0xbdf2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbdf2('0x9'));var squel=require(_0xbdf2('0xa'));var crypto=require('crypto');var jsforce=require(_0xbdf2('0xb'));var deskjs=require(_0xbdf2('0xc'));var toCsv=require(_0xbdf2('0x8'));var querystring=require(_0xbdf2('0xd'));var Papa=require(_0xbdf2('0xe'));var Redis=require(_0xbdf2('0xf'));var authService=require(_0xbdf2('0x10'));var qs=require(_0xbdf2('0x11'));var hardwareService=require(_0xbdf2('0x12'));var logger=require(_0xbdf2('0x13'))(_0xbdf2('0x14'));var utils=require(_0xbdf2('0x15'));var config=require(_0xbdf2('0x16'));var db=require(_0xbdf2('0x17'))['db'];var integrations=require(_0xbdf2('0x18'));var jayson=require(_0xbdf2('0x19'));var client=jayson['client'][_0xbdf2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x293e77,_0x2e2c74,_0x5ec208){if(_0x5ec208){var _0x2ac939=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ac939[_0xbdf2('0x1b')](_0x2e2c74)){return _0x293e77;}else{throw new Error(_0xbdf2('0x1c'));}}else{return _0x293e77;}}function respondWithRpcPromise(_0x679f35,_0xdc30dc,_0x3c955e,_0x563105){return new BPromise(function(_0x200b66,_0xa405be){var _0x25ad56=_0x563105||client;return _0x25ad56[_0xbdf2('0x1d')](_0x679f35,_0x3c955e)[_0xbdf2('0x1e')](function(_0x15f857){logger[_0xbdf2('0x1f')](_0xbdf2('0x20'),_0xdc30dc,_0xbdf2('0x21'));logger['debug'](_0xbdf2('0x22'),_0xdc30dc,_0xbdf2('0x21'),JSON[_0xbdf2('0x23')](_0x15f857));if(_0x15f857['error']){if(_0x15f857['error']['code']===0x1f4){logger['error'](_0xbdf2('0x20'),_0xdc30dc,_0x15f857[_0xbdf2('0x24')]['message']);return _0xa405be(_0x15f857['error'][_0xbdf2('0x25')]);}logger[_0xbdf2('0x24')](_0xbdf2('0x20'),_0xdc30dc,_0x15f857[_0xbdf2('0x24')][_0xbdf2('0x25')]);return _0x200b66(_0x15f857['error']['message']);}else{logger[_0xbdf2('0x1f')](_0xbdf2('0x20'),_0xdc30dc,_0xbdf2('0x21'));_0x200b66(_0x15f857[_0xbdf2('0x26')]['message']);}})[_0xbdf2('0x27')](function(_0x5a87f9){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xdc30dc,_0x5a87f9);_0xa405be(_0x5a87f9);});});}function respondWithStatusCode(_0x393d9f,_0x332e59){_0x332e59=_0x332e59||0xcc;return function(_0x2f21ba){if(_0x2f21ba){return _0x393d9f[_0xbdf2('0x28')](_0x332e59);}return _0x393d9f['status'](_0x332e59)[_0xbdf2('0x29')]();};}function respondWithResult(_0xad03af,_0x1bbc2a){_0x1bbc2a=_0x1bbc2a||0xc8;return function(_0x1555ea){if(_0x1555ea){return _0xad03af[_0xbdf2('0x2a')](_0x1bbc2a)[_0xbdf2('0x2b')](_0x1555ea);}};}function respondWithFilteredResult(_0x2f4b7f,_0x222a65){return function(_0x37fb10){if(_0x37fb10){var _0x1c51b1=_0x37fb10[_0xbdf2('0x2c')],_0x521ab4=_0x222a65[_0xbdf2('0x2d')],_0x3bc623=_0x222a65[_0xbdf2('0x2d')]+_0x222a65[_0xbdf2('0x2e')],_0x5775c9;if(_0x3bc623>=_0x1c51b1){_0x3bc623=_0x1c51b1;_0x5775c9=0xc8;}else{_0x5775c9=0xce;}_0x2f4b7f[_0xbdf2('0x2a')](_0x5775c9);return _0x2f4b7f[_0xbdf2('0x2f')](_0xbdf2('0x30'),_0x521ab4+'-'+_0x3bc623+'/'+_0x1c51b1)[_0xbdf2('0x2b')](_0x37fb10);}return null;};}function patchUpdates(_0x48cda9){return function(_0x4f726f){try{jsonpatch['apply'](_0x4f726f,_0x48cda9,!![]);}catch(_0x3ad6c0){return BPromise[_0xbdf2('0x31')](_0x3ad6c0);}return _0x4f726f[_0xbdf2('0x32')]();};}function saveUpdates(_0x27f1c4,_0x23792f){return function(_0x592457){if(_0x592457){return _0x592457[_0xbdf2('0x33')](_0x27f1c4)[_0xbdf2('0x1e')](function(_0x26f74f){return _0x26f74f;});}return null;};}function removeEntity(_0x33866c,_0x7c1fa1){return function(_0x4ffcab){if(_0x4ffcab){return _0x4ffcab['destroy']()['then'](function(){_0x33866c[_0xbdf2('0x2a')](0xcc)[_0xbdf2('0x29')]();});}};}function handleEntityNotFound(_0x5391c9,_0xdb46ce){return function(_0x2a37d7){if(!_0x2a37d7){_0x5391c9[_0xbdf2('0x28')](0x194);}return _0x2a37d7;};}function handleError(_0x3c9d53,_0x328be1){_0x328be1=_0x328be1||0x1f4;return function(_0x575ba7){logger[_0xbdf2('0x24')](_0x575ba7[_0xbdf2('0x34')]);if(_0x575ba7[_0xbdf2('0x35')]){delete _0x575ba7[_0xbdf2('0x35')];}_0x3c9d53[_0xbdf2('0x2a')](_0x328be1)[_0xbdf2('0x36')](_0x575ba7);};}exports['index']=function(_0xde58e5,_0x2a8d70){var _0x4996ee={},_0x22ac41={},_0x54e5cd={'count':0x0,'rows':[]};var _0x30d797=db[_0xbdf2('0x37')][_0xbdf2('0x38')];_0x22ac41['model']=_['keys'](_0x30d797);_0x22ac41[_0xbdf2('0x39')]=_[_0xbdf2('0x3a')](_0xde58e5[_0xbdf2('0x39')]);_0x22ac41[_0xbdf2('0x3b')]=_['intersection'](_0x22ac41['model'],_0x22ac41[_0xbdf2('0x39')]);_0x4996ee[_0xbdf2('0x3c')]=_[_0xbdf2('0x3d')](_0x22ac41['model'],qs['fields'](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x3e')]));_0x4996ee[_0xbdf2('0x3c')]=_0x4996ee[_0xbdf2('0x3c')][_0xbdf2('0x3f')]?_0x4996ee['attributes']:_0x22ac41[_0xbdf2('0x40')];if(!_0xde58e5['query'][_0xbdf2('0x41')](_0xbdf2('0x42'))){_0x4996ee[_0xbdf2('0x2e')]=qs[_0xbdf2('0x2e')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x2e')]);_0x4996ee[_0xbdf2('0x2d')]=qs[_0xbdf2('0x2d')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x2d')]);}_0x4996ee[_0xbdf2('0x43')]=qs[_0xbdf2('0x44')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x44')]);_0x4996ee[_0xbdf2('0x45')]=qs[_0xbdf2('0x3b')](_['pick'](_0xde58e5['query'],_0x22ac41[_0xbdf2('0x3b')]));if(_0xde58e5['query'][_0xbdf2('0x46')]){_0x4996ee[_0xbdf2('0x45')]=_[_0xbdf2('0x47')](_0x4996ee[_0xbdf2('0x45')],{'$or':_['map'](_0x30d797,function(_0x2c1db4){if(_0x2c1db4[_0xbdf2('0x48')][_0xbdf2('0x49')]!==_0xbdf2('0x4a')){var _0x155aa8={};_0x155aa8[_0x2c1db4['field']]={'$like':'%'+_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x46')]+'%'};return _0x155aa8;}})});}_0x4996ee=_[_0xbdf2('0x47')]({},_0x4996ee,_0xde58e5[_0xbdf2('0x4b')]);var _0x1c9811={'where':_0x4996ee[_0xbdf2('0x45')]};return db[_0xbdf2('0x37')][_0xbdf2('0x2c')](_0x1c9811)[_0xbdf2('0x1e')](function(_0x10542e){_0x54e5cd[_0xbdf2('0x2c')]=_0x10542e;if(_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x4c')]){_0x4996ee['include']=[{'all':!![]}];}return db[_0xbdf2('0x37')][_0xbdf2('0x4d')](_0x4996ee);})['then'](function(_0x2d811d){_0x54e5cd[_0xbdf2('0x4e')]=_0x2d811d;return _0x54e5cd;})[_0xbdf2('0x1e')](respondWithFilteredResult(_0x2a8d70,_0x4996ee))[_0xbdf2('0x27')](handleError(_0x2a8d70,null));};exports[_0xbdf2('0x4f')]=function(_0x54223c,_0x43364d){var _0x42fb69={'raw':![],'where':{'id':_0x54223c[_0xbdf2('0x50')]['id']}},_0x573bb1={};_0x573bb1[_0xbdf2('0x40')]=_[_0xbdf2('0x3a')](db['ZohoAccount']['rawAttributes']);_0x573bb1[_0xbdf2('0x39')]=_['keys'](_0x54223c[_0xbdf2('0x39')]);_0x573bb1[_0xbdf2('0x3b')]=_[_0xbdf2('0x3d')](_0x573bb1[_0xbdf2('0x40')],_0x573bb1['query']);_0x42fb69[_0xbdf2('0x3c')]=_[_0xbdf2('0x3d')](_0x573bb1[_0xbdf2('0x40')],qs[_0xbdf2('0x3e')](_0x54223c[_0xbdf2('0x39')][_0xbdf2('0x3e')]));_0x42fb69['attributes']=_0x42fb69[_0xbdf2('0x3c')]['length']?_0x42fb69['attributes']:_0x573bb1[_0xbdf2('0x40')];if(_0x54223c[_0xbdf2('0x39')]['includeAll']){_0x42fb69[_0xbdf2('0x51')]=[{'all':!![]}];}_0x42fb69=_[_0xbdf2('0x47')]({},_0x42fb69,_0x54223c['options']);return db[_0xbdf2('0x37')][_0xbdf2('0x52')](_0x42fb69)[_0xbdf2('0x1e')](handleEntityNotFound(_0x43364d,null))[_0xbdf2('0x1e')](respondWithResult(_0x43364d,null))[_0xbdf2('0x27')](handleError(_0x43364d,null));};exports[_0xbdf2('0x53')]=function(_0x5a496e,_0x335dee){return db[_0xbdf2('0x37')][_0xbdf2('0x53')](_0x5a496e[_0xbdf2('0x54')],{})['then'](respondWithResult(_0x335dee,0xc9))[_0xbdf2('0x27')](handleError(_0x335dee,null));};exports['update']=function(_0x28e56b,_0x2cdf5d){if(_0x28e56b[_0xbdf2('0x54')]['id']){delete _0x28e56b['body']['id'];}return db[_0xbdf2('0x37')][_0xbdf2('0x52')]({'where':{'id':_0x28e56b[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x2cdf5d,null))['then'](saveUpdates(_0x28e56b[_0xbdf2('0x54')],null))[_0xbdf2('0x1e')](respondWithResult(_0x2cdf5d,null))[_0xbdf2('0x27')](handleError(_0x2cdf5d,null));};exports['destroy']=function(_0x5e070e,_0x868343){return db['ZohoAccount'][_0xbdf2('0x52')]({'where':{'id':_0x5e070e[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x868343,null))[_0xbdf2('0x1e')](removeEntity(_0x868343,null))[_0xbdf2('0x27')](handleError(_0x868343,null));};exports[_0xbdf2('0x55')]=function(_0x1088e2,_0x4a00bd,_0x5b9f77){var _0x1841b3={};var _0x51d8d={};var _0x5d06a4;var _0x566160;return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x1088e2[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x4a00bd,null))[_0xbdf2('0x1e')](function(_0x42f1d5){if(_0x42f1d5){_0x5d06a4=_0x42f1d5;_0x51d8d[_0xbdf2('0x40')]=_[_0xbdf2('0x3a')](db[_0xbdf2('0x56')]['rawAttributes']);_0x51d8d[_0xbdf2('0x39')]=_[_0xbdf2('0x3a')](_0x1088e2['query']);_0x51d8d[_0xbdf2('0x3b')]=_[_0xbdf2('0x3d')](_0x51d8d['model'],_0x51d8d['query']);_0x1841b3['attributes']=_[_0xbdf2('0x3d')](_0x51d8d[_0xbdf2('0x40')],qs[_0xbdf2('0x3e')](_0x1088e2[_0xbdf2('0x39')]['fields']));_0x1841b3[_0xbdf2('0x3c')]=_0x1841b3['attributes']['length']?_0x1841b3[_0xbdf2('0x3c')]:_0x51d8d[_0xbdf2('0x40')];_0x1841b3[_0xbdf2('0x43')]=qs[_0xbdf2('0x44')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x44')]);_0x1841b3[_0xbdf2('0x45')]=qs[_0xbdf2('0x3b')](_['pick'](_0x1088e2[_0xbdf2('0x39')],_0x51d8d[_0xbdf2('0x3b')]));if(_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x46')]){_0x1841b3[_0xbdf2('0x45')]=_[_0xbdf2('0x47')](_0x1841b3[_0xbdf2('0x45')],{'$or':_[_0xbdf2('0x57')](_0x1841b3[_0xbdf2('0x3c')],function(_0x278a94){var _0xbe6881={};_0xbe6881[_0x278a94]={'$like':'%'+_0x1088e2[_0xbdf2('0x39')]['filter']+'%'};return _0xbe6881;})});}_0x1841b3=_[_0xbdf2('0x47')]({},_0x1841b3,_0x1088e2[_0xbdf2('0x4b')]);return _0x5d06a4['getConfigurations'](_0x1841b3);}})[_0xbdf2('0x1e')](function(_0x245984){if(_0x245984){_0x566160=_0x245984[_0xbdf2('0x3f')];if(!_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x41')](_0xbdf2('0x42'))){_0x1841b3[_0xbdf2('0x2e')]=qs[_0xbdf2('0x2e')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x2e')]);_0x1841b3[_0xbdf2('0x2d')]=qs[_0xbdf2('0x2d')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x2d')]);}return _0x5d06a4[_0xbdf2('0x55')](_0x1841b3);}})[_0xbdf2('0x1e')](function(_0x18140f){if(_0x18140f){return _0x18140f?{'count':_0x566160,'rows':_0x18140f}:null;}})[_0xbdf2('0x1e')](respondWithResult(_0x4a00bd,null))[_0xbdf2('0x27')](handleError(_0x4a00bd,null));};exports[_0xbdf2('0x58')]=function(_0x877088,_0x57b87f,_0x22a673){if(_0x877088[_0xbdf2('0x54')]['id']){delete _0x877088[_0xbdf2('0x54')]['id'];}return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x877088[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x57b87f,null))[_0xbdf2('0x1e')](function(_0x1e8cb2){if(_0x1e8cb2){_0x877088[_0xbdf2('0x54')][_0xbdf2('0x59')]=_0x1e8cb2['id'];_0x877088[_0xbdf2('0x54')]['Subjects']=integrations['getSubjects'](_0x877088[_0xbdf2('0x54')][_0xbdf2('0x5a')],_0x877088[_0xbdf2('0x54')][_0xbdf2('0x48')]);_0x877088[_0xbdf2('0x54')][_0xbdf2('0x5b')]=integrations[_0xbdf2('0x5c')](_0x877088[_0xbdf2('0x54')]['channel'],_0x877088[_0xbdf2('0x54')][_0xbdf2('0x48')]);return db[_0xbdf2('0x56')][_0xbdf2('0x53')](_0x877088[_0xbdf2('0x54')],{'include':[{'model':db[_0xbdf2('0x5d')],'as':_0xbdf2('0x5e')},{'model':db['ZohoField'],'as':_0xbdf2('0x5b')}]});}return null;})[_0xbdf2('0x1e')](respondWithResult(_0x57b87f,null))[_0xbdf2('0x27')](handleError(_0x57b87f,null));};exports['getFields']=function(_0x2888d5,_0x23ff66,_0x510e9e){var _0x3c318b='';return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x2888d5[_0xbdf2('0x50')]['id']},'attributes':['id',_0xbdf2('0x5f'),_0xbdf2('0x60')]})[_0xbdf2('0x1e')](handleEntityNotFound(_0x23ff66,null))[_0xbdf2('0x1e')](function(_0x2a9199){if(_0x2a9199){_0x3c318b=_0x2a9199[_0xbdf2('0x5f')];var _0x50f6a6=_0x3c318b[_0xbdf2('0x61')](-0x1);if(_0x50f6a6==='/'){_0x3c318b=_0x3c318b[_0xbdf2('0x62')](0x0,_0x3c318b[_0xbdf2('0x63')](_0x50f6a6));}return rp({'method':_0xbdf2('0x64'),'uri':util['format']('https://crm.%s/crm/private/json/Calls/getFields',_0x3c318b),'qs':{'authtoken':_0x2a9199[_0xbdf2('0x60')],'scope':'crmapi'},'json':!![]});}})[_0xbdf2('0x1e')](function(_0x359357){if(_0x359357){if(_0x359357['response']&&_0x359357[_0xbdf2('0x65')][_0xbdf2('0x24')]){throw new Error(_0x359357[_0xbdf2('0x65')][_0xbdf2('0x24')][_0xbdf2('0x25')]);}var _0x2bd5b4=[];if(_0x359357[_0xbdf2('0x66')]&&_0x359357[_0xbdf2('0x66')]['section']){if(_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL']){var _0xfdbca8=['Call\x20Purpose'];for(var _0x17c8e1=0x0,_0x432858=_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0xbdf2('0x3f')];_0x17c8e1<_0x432858;_0x17c8e1++){if(_[_0xbdf2('0x68')](_0xfdbca8,_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['dv'])){_0x2bd5b4[_0xbdf2('0x69')]({'id':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['dv'],'name':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['label'],'custom':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x6a')]===_0xbdf2('0x6b')?!![]:![],'options':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x48')]===_0xbdf2('0x6c')&&_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x6d')]?_['map'](_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['val'],function(_0x2aef53){return{'name':_0x2aef53,'value':_0x2aef53};}):[]});}}}}return{'count':_0x2bd5b4['length'],'rows':_0x2bd5b4};}})[_0xbdf2('0x1e')](respondWithResult(_0x23ff66,null))['catch'](function(_0x37e784){var _0x690576=_0x2888d5[_0xbdf2('0x39')][_0xbdf2('0x1b')]?0x1f4:_0x37e784[_0xbdf2('0x6e')]||0x1f4;logger[_0xbdf2('0x24')](_0xbdf2('0x6f'),_0xbdf2('0x70'),_0x690576,JSON[_0xbdf2('0x23')](_0x37e784));delete _0x37e784[_0xbdf2('0x35')];if(_0x690576===0x191){_0x690576=0x190;}_0x23ff66['status'](_0x690576)['send'](_0x2888d5[_0xbdf2('0x39')][_0xbdf2('0x1b')]?{'message':_0xbdf2('0x71'),'statusCode':_0x37e784['statusCode']}:_0x37e784);});}; \ No newline at end of file +var _0x569f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','stack','name','index','ZohoAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','rows','params','length','find','catch','create','body','update','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','ZohoField','getFields','host','slice','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','authToken','crmapi','response','Calls','section','Call\x20Purpose','includes','push','label','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format'];(function(_0xfcfe92,_0x14ea66){var _0x166ba1=function(_0x45f01a){while(--_0x45f01a){_0xfcfe92['push'](_0xfcfe92['shift']());}};_0x166ba1(++_0x14ea66);}(_0x569f,0xef));var _0xf569=function(_0x3f06ff,_0x449b9c){_0x3f06ff=_0x3f06ff-0x0;var _0x375fcd=_0x569f[_0x3f06ff];return _0x375fcd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf569('0x0'));var rimraf=require(_0xf569('0x1'));var zipdir=require(_0xf569('0x2'));var jsonpatch=require(_0xf569('0x3'));var rp=require(_0xf569('0x4'));var moment=require(_0xf569('0x5'));var BPromise=require(_0xf569('0x6'));var Mustache=require(_0xf569('0x7'));var util=require('util');var path=require(_0xf569('0x8'));var sox=require(_0xf569('0x9'));var csv=require(_0xf569('0xa'));var ejs=require(_0xf569('0xb'));var fs=require('fs');var _=require(_0xf569('0xc'));var squel=require(_0xf569('0xd'));var crypto=require('crypto');var jsforce=require(_0xf569('0xe'));var deskjs=require(_0xf569('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf569('0x10'));var Redis=require(_0xf569('0x11'));var authService=require(_0xf569('0x12'));var qs=require(_0xf569('0x13'));var hardwareService=require(_0xf569('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf569('0x15'));var config=require(_0xf569('0x16'));var db=require(_0xf569('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xf569('0x18')][_0xf569('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2f3516,_0x186b87,_0x234396){if(_0x234396){var _0x549b58=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x549b58[_0xf569('0x1a')](_0x186b87)){return _0x2f3516;}else{throw new Error(_0xf569('0x1b'));}}else{return _0x2f3516;}}function respondWithRpcPromise(_0x190f3f,_0xe0867e,_0x372599,_0x507c83){return new BPromise(function(_0x41e8a9,_0x191e7a){var _0xf6acd5=_0x507c83||client;return _0xf6acd5[_0xf569('0x1c')](_0x190f3f,_0x372599)['then'](function(_0x423640){logger[_0xf569('0x1d')](_0xf569('0x1e'),_0xe0867e,_0xf569('0x1f'));logger[_0xf569('0x20')](_0xf569('0x21'),_0xe0867e,_0xf569('0x1f'),JSON[_0xf569('0x22')](_0x423640));if(_0x423640[_0xf569('0x23')]){if(_0x423640[_0xf569('0x23')]['code']===0x1f4){logger[_0xf569('0x23')](_0xf569('0x1e'),_0xe0867e,_0x423640['error'][_0xf569('0x24')]);return _0x191e7a(_0x423640['error'][_0xf569('0x24')]);}logger['error'](_0xf569('0x1e'),_0xe0867e,_0x423640[_0xf569('0x23')]['message']);return _0x41e8a9(_0x423640[_0xf569('0x23')][_0xf569('0x24')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0xe0867e,'request\x20sent');_0x41e8a9(_0x423640[_0xf569('0x25')][_0xf569('0x24')]);}})['catch'](function(_0x108997){logger[_0xf569('0x23')](_0xf569('0x1e'),_0xe0867e,_0x108997);_0x191e7a(_0x108997);});});}function respondWithStatusCode(_0x2c49af,_0x3219b2){_0x3219b2=_0x3219b2||0xcc;return function(_0x230e52){if(_0x230e52){return _0x2c49af['sendStatus'](_0x3219b2);}return _0x2c49af[_0xf569('0x26')](_0x3219b2)[_0xf569('0x27')]();};}function respondWithResult(_0x360f16,_0xc846b7){_0xc846b7=_0xc846b7||0xc8;return function(_0x1004eb){if(_0x1004eb){return _0x360f16[_0xf569('0x26')](_0xc846b7)[_0xf569('0x28')](_0x1004eb);}};}function respondWithFilteredResult(_0x42bb5b,_0x299696){return function(_0x4c112a){if(_0x4c112a){var _0x1450b9=_0x4c112a[_0xf569('0x29')],_0x1c7c3e=_0x299696[_0xf569('0x2a')],_0x536d56=_0x299696[_0xf569('0x2a')]+_0x299696[_0xf569('0x2b')],_0xa5c682;if(_0x536d56>=_0x1450b9){_0x536d56=_0x1450b9;_0xa5c682=0xc8;}else{_0xa5c682=0xce;}_0x42bb5b[_0xf569('0x26')](_0xa5c682);return _0x42bb5b[_0xf569('0x2c')]('Content-Range',_0x1c7c3e+'-'+_0x536d56+'/'+_0x1450b9)[_0xf569('0x28')](_0x4c112a);}return null;};}function patchUpdates(_0x3100e7){return function(_0x3fc1e0){try{jsonpatch[_0xf569('0x2d')](_0x3fc1e0,_0x3100e7,!![]);}catch(_0x45e6d1){return BPromise[_0xf569('0x2e')](_0x45e6d1);}return _0x3fc1e0[_0xf569('0x2f')]();};}function saveUpdates(_0x58b29f,_0x42a2dc){return function(_0x4a0e45){if(_0x4a0e45){return _0x4a0e45['update'](_0x58b29f)[_0xf569('0x30')](function(_0x611c30){return _0x611c30;});}return null;};}function removeEntity(_0x256e0f,_0x19a203){return function(_0x52b9b8){if(_0x52b9b8){return _0x52b9b8[_0xf569('0x31')]()[_0xf569('0x30')](function(){_0x256e0f[_0xf569('0x26')](0xcc)[_0xf569('0x27')]();});}};}function handleEntityNotFound(_0x5ecfe1,_0x2f9bd6){return function(_0x9dbf37){if(!_0x9dbf37){_0x5ecfe1[_0xf569('0x32')](0x194);}return _0x9dbf37;};}function handleError(_0x61faad,_0xd96364){_0xd96364=_0xd96364||0x1f4;return function(_0x2f4339){logger[_0xf569('0x23')](_0x2f4339[_0xf569('0x33')]);if(_0x2f4339[_0xf569('0x34')]){delete _0x2f4339['name'];}_0x61faad[_0xf569('0x26')](_0xd96364)['send'](_0x2f4339);};}exports[_0xf569('0x35')]=function(_0x441a80,_0x3351a0){var _0x41b4ae={},_0x48cfc4={},_0x270491={'count':0x0,'rows':[]};var _0x1b7cc1=db[_0xf569('0x36')][_0xf569('0x37')];_0x48cfc4[_0xf569('0x38')]=_[_0xf569('0x39')](_0x1b7cc1);_0x48cfc4[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x441a80[_0xf569('0x3a')]);_0x48cfc4[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x48cfc4[_0xf569('0x38')],_0x48cfc4[_0xf569('0x3a')]);_0x41b4ae[_0xf569('0x3d')]=_['intersection'](_0x48cfc4[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x441a80['query'][_0xf569('0x3e')]));_0x41b4ae['attributes']=_0x41b4ae[_0xf569('0x3d')]['length']?_0x41b4ae[_0xf569('0x3d')]:_0x48cfc4[_0xf569('0x38')];if(!_0x441a80[_0xf569('0x3a')][_0xf569('0x3f')](_0xf569('0x40'))){_0x41b4ae[_0xf569('0x2b')]=qs[_0xf569('0x2b')](_0x441a80['query']['limit']);_0x41b4ae[_0xf569('0x2a')]=qs['offset'](_0x441a80[_0xf569('0x3a')][_0xf569('0x2a')]);}_0x41b4ae[_0xf569('0x41')]=qs[_0xf569('0x42')](_0x441a80[_0xf569('0x3a')]['sort']);_0x41b4ae[_0xf569('0x43')]=qs[_0xf569('0x3b')](_[_0xf569('0x44')](_0x441a80[_0xf569('0x3a')],_0x48cfc4['filters']));if(_0x441a80['query'][_0xf569('0x45')]){_0x41b4ae[_0xf569('0x43')]=_[_0xf569('0x46')](_0x41b4ae[_0xf569('0x43')],{'$or':_[_0xf569('0x47')](_0x1b7cc1,function(_0x570de4){if(_0x570de4['type'][_0xf569('0x48')]!==_0xf569('0x49')){var _0x264385={};_0x264385[_0x570de4[_0xf569('0x4a')]]={'$like':'%'+_0x441a80[_0xf569('0x3a')]['filter']+'%'};return _0x264385;}})});}_0x41b4ae=_[_0xf569('0x46')]({},_0x41b4ae,_0x441a80[_0xf569('0x4b')]);var _0x52f054={'where':_0x41b4ae[_0xf569('0x43')]};return db[_0xf569('0x36')][_0xf569('0x29')](_0x52f054)[_0xf569('0x30')](function(_0x48ab50){_0x270491[_0xf569('0x29')]=_0x48ab50;if(_0x441a80['query'][_0xf569('0x4c')]){_0x41b4ae[_0xf569('0x4d')]=[{'all':!![]}];}return db[_0xf569('0x36')]['findAll'](_0x41b4ae);})['then'](function(_0x5158be){_0x270491[_0xf569('0x4e')]=_0x5158be;return _0x270491;})[_0xf569('0x30')](respondWithFilteredResult(_0x3351a0,_0x41b4ae))['catch'](handleError(_0x3351a0,null));};exports['show']=function(_0x27eea7,_0x2b302f){var _0x21d3e4={'raw':![],'where':{'id':_0x27eea7[_0xf569('0x4f')]['id']}},_0x3df0dc={};_0x3df0dc[_0xf569('0x38')]=_['keys'](db[_0xf569('0x36')]['rawAttributes']);_0x3df0dc[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x27eea7[_0xf569('0x3a')]);_0x3df0dc[_0xf569('0x3b')]=_['intersection'](_0x3df0dc[_0xf569('0x38')],_0x3df0dc[_0xf569('0x3a')]);_0x21d3e4['attributes']=_['intersection'](_0x3df0dc['model'],qs['fields'](_0x27eea7[_0xf569('0x3a')][_0xf569('0x3e')]));_0x21d3e4[_0xf569('0x3d')]=_0x21d3e4[_0xf569('0x3d')][_0xf569('0x50')]?_0x21d3e4[_0xf569('0x3d')]:_0x3df0dc['model'];if(_0x27eea7[_0xf569('0x3a')][_0xf569('0x4c')]){_0x21d3e4[_0xf569('0x4d')]=[{'all':!![]}];}_0x21d3e4=_['merge']({},_0x21d3e4,_0x27eea7['options']);return db['ZohoAccount'][_0xf569('0x51')](_0x21d3e4)[_0xf569('0x30')](handleEntityNotFound(_0x2b302f,null))[_0xf569('0x30')](respondWithResult(_0x2b302f,null))[_0xf569('0x52')](handleError(_0x2b302f,null));};exports[_0xf569('0x53')]=function(_0x59ad88,_0x2c8be6){return db[_0xf569('0x36')]['create'](_0x59ad88[_0xf569('0x54')],{})['then'](respondWithResult(_0x2c8be6,0xc9))[_0xf569('0x52')](handleError(_0x2c8be6,null));};exports[_0xf569('0x55')]=function(_0x26b5b3,_0x25aac7){if(_0x26b5b3[_0xf569('0x54')]['id']){delete _0x26b5b3[_0xf569('0x54')]['id'];}return db[_0xf569('0x36')]['find']({'where':{'id':_0x26b5b3[_0xf569('0x4f')]['id']}})[_0xf569('0x30')](handleEntityNotFound(_0x25aac7,null))[_0xf569('0x30')](saveUpdates(_0x26b5b3[_0xf569('0x54')],null))['then'](respondWithResult(_0x25aac7,null))[_0xf569('0x52')](handleError(_0x25aac7,null));};exports[_0xf569('0x31')]=function(_0x168830,_0x1d4eb6){return db[_0xf569('0x36')][_0xf569('0x51')]({'where':{'id':_0x168830[_0xf569('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d4eb6,null))[_0xf569('0x30')](removeEntity(_0x1d4eb6,null))[_0xf569('0x52')](handleError(_0x1d4eb6,null));};exports['getConfigurations']=function(_0x46c758,_0x32d6a8,_0x272904){var _0x251af8={};var _0x4460f3={};var _0x10f4e1;var _0x4f34de;return db[_0xf569('0x36')][_0xf569('0x56')]({'where':{'id':_0x46c758['params']['id']}})[_0xf569('0x30')](handleEntityNotFound(_0x32d6a8,null))[_0xf569('0x30')](function(_0x496980){if(_0x496980){_0x10f4e1=_0x496980;_0x4460f3['model']=_[_0xf569('0x39')](db[_0xf569('0x57')][_0xf569('0x37')]);_0x4460f3[_0xf569('0x3a')]=_[_0xf569('0x39')](_0x46c758[_0xf569('0x3a')]);_0x4460f3[_0xf569('0x3b')]=_[_0xf569('0x3c')](_0x4460f3[_0xf569('0x38')],_0x4460f3[_0xf569('0x3a')]);_0x251af8[_0xf569('0x3d')]=_['intersection'](_0x4460f3[_0xf569('0x38')],qs[_0xf569('0x3e')](_0x46c758[_0xf569('0x3a')][_0xf569('0x3e')]));_0x251af8[_0xf569('0x3d')]=_0x251af8[_0xf569('0x3d')]['length']?_0x251af8['attributes']:_0x4460f3[_0xf569('0x38')];_0x251af8[_0xf569('0x41')]=qs[_0xf569('0x42')](_0x46c758['query'][_0xf569('0x42')]);_0x251af8[_0xf569('0x43')]=qs['filters'](_[_0xf569('0x44')](_0x46c758[_0xf569('0x3a')],_0x4460f3[_0xf569('0x3b')]));if(_0x46c758[_0xf569('0x3a')][_0xf569('0x45')]){_0x251af8['where']=_[_0xf569('0x46')](_0x251af8[_0xf569('0x43')],{'$or':_[_0xf569('0x47')](_0x251af8[_0xf569('0x3d')],function(_0x4cdca6){var _0x1a3567={};_0x1a3567[_0x4cdca6]={'$like':'%'+_0x46c758[_0xf569('0x3a')]['filter']+'%'};return _0x1a3567;})});}_0x251af8=_[_0xf569('0x46')]({},_0x251af8,_0x46c758[_0xf569('0x4b')]);return _0x10f4e1[_0xf569('0x58')](_0x251af8);}})['then'](function(_0x18d3a0){if(_0x18d3a0){_0x4f34de=_0x18d3a0[_0xf569('0x50')];if(!_0x46c758[_0xf569('0x3a')][_0xf569('0x3f')]('nolimit')){_0x251af8['limit']=qs[_0xf569('0x2b')](_0x46c758[_0xf569('0x3a')][_0xf569('0x2b')]);_0x251af8[_0xf569('0x2a')]=qs[_0xf569('0x2a')](_0x46c758[_0xf569('0x3a')][_0xf569('0x2a')]);}return _0x10f4e1[_0xf569('0x58')](_0x251af8);}})[_0xf569('0x30')](function(_0x51e4b7){if(_0x51e4b7){return _0x51e4b7?{'count':_0x4f34de,'rows':_0x51e4b7}:null;}})[_0xf569('0x30')](respondWithResult(_0x32d6a8,null))['catch'](handleError(_0x32d6a8,null));};exports[_0xf569('0x59')]=function(_0x191542,_0x277616,_0x576003){if(_0x191542[_0xf569('0x54')]['id']){delete _0x191542[_0xf569('0x54')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x191542[_0xf569('0x4f')]['id']}})['then'](handleEntityNotFound(_0x277616,null))[_0xf569('0x30')](function(_0x24d612){if(_0x24d612){_0x191542['body']['AccountId']=_0x24d612['id'];_0x191542[_0xf569('0x54')][_0xf569('0x5a')]=integrations[_0xf569('0x5b')](_0x191542['body']['channel'],_0x191542[_0xf569('0x54')][_0xf569('0x5c')]);_0x191542[_0xf569('0x54')][_0xf569('0x5d')]=integrations[_0xf569('0x5e')](_0x191542['body'][_0xf569('0x5f')],_0x191542[_0xf569('0x54')]['type']);return db[_0xf569('0x57')][_0xf569('0x53')](_0x191542[_0xf569('0x54')],{'include':[{'model':db[_0xf569('0x60')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xf569('0x5d')}]});}return null;})[_0xf569('0x30')](respondWithResult(_0x277616,null))['catch'](handleError(_0x277616,null));};exports[_0xf569('0x61')]=function(_0xc8480f,_0xf73222,_0x2765ea){var _0x422d4a='';return db[_0xf569('0x36')][_0xf569('0x56')]({'where':{'id':_0xc8480f[_0xf569('0x4f')]['id']},'attributes':['id','host','authToken']})[_0xf569('0x30')](handleEntityNotFound(_0xf73222,null))[_0xf569('0x30')](function(_0x55a0aa){if(_0x55a0aa){_0x422d4a=_0x55a0aa[_0xf569('0x62')];var _0x4fbf78=_0x422d4a[_0xf569('0x63')](-0x1);if(_0x4fbf78==='/'){_0x422d4a=_0x422d4a['substring'](0x0,_0x422d4a[_0xf569('0x64')](_0x4fbf78));}return rp({'method':_0xf569('0x65'),'uri':util[_0xf569('0x66')](_0xf569('0x67'),_0x422d4a),'qs':{'authtoken':_0x55a0aa[_0xf569('0x68')],'scope':_0xf569('0x69')},'json':!![]});}})[_0xf569('0x30')](function(_0x130e47){if(_0x130e47){if(_0x130e47['response']&&_0x130e47[_0xf569('0x6a')][_0xf569('0x23')]){throw new Error(_0x130e47[_0xf569('0x6a')]['error'][_0xf569('0x24')]);}var _0x3fbe49=[];if(_0x130e47[_0xf569('0x6b')]&&_0x130e47[_0xf569('0x6b')]['section']){if(_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL']){var _0x3e248d=[_0xf569('0x6d')];for(var _0x382cb9=0x0,_0x4a1aa2=_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL']['length'];_0x382cb9<_0x4a1aa2;_0x382cb9++){if(_[_0xf569('0x6e')](_0x3e248d,_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9]['dv'])){_0x3fbe49[_0xf569('0x6f')]({'id':_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9]['dv'],'name':_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x70')],'custom':_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x71')]===_0xf569('0x72')?!![]:![],'options':_0x130e47[_0xf569('0x6b')]['section']['FL'][_0x382cb9][_0xf569('0x5c')]===_0xf569('0x73')&&_0x130e47['Calls'][_0xf569('0x6c')]['FL'][_0x382cb9][_0xf569('0x74')]?_[_0xf569('0x47')](_0x130e47[_0xf569('0x6b')][_0xf569('0x6c')]['FL'][_0x382cb9]['val'],function(_0x3e1ed6){return{'name':_0x3e1ed6,'value':_0x3e1ed6};}):[]});}}}}return{'count':_0x3fbe49[_0xf569('0x50')],'rows':_0x3fbe49};}})[_0xf569('0x30')](respondWithResult(_0xf73222,null))[_0xf569('0x52')](function(_0x48bd3d){var _0x5b9077=_0xc8480f[_0xf569('0x3a')][_0xf569('0x1a')]?0x1f4:_0x48bd3d[_0xf569('0x75')]||0x1f4;logger[_0xf569('0x23')](_0xf569('0x76'),_0xf569('0x61'),_0x5b9077,JSON[_0xf569('0x22')](_0x48bd3d));delete _0x48bd3d[_0xf569('0x34')];if(_0x5b9077===0x191){_0x5b9077=0x190;}_0xf73222[_0xf569('0x26')](_0x5b9077)[_0xf569('0x77')](_0xc8480f[_0xf569('0x3a')][_0xf569('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x48bd3d[_0xf569('0x75')]}:_0x48bd3d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index a44ca1f..5bb57ba 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 _0xb338=['moment','bluebird','../../config/environment','./intZohoAccount.attributes','exports','define','lodash','api'];(function(_0x2a4226,_0x202691){var _0x483c78=function(_0x546536){while(--_0x546536){_0x2a4226['push'](_0x2a4226['shift']());}};_0x483c78(++_0x202691);}(_0xb338,0x16e));var _0x8b33=function(_0x530ec8,_0x3b402d){_0x530ec8=_0x530ec8-0x0;var _0xdd83a5=_0xb338[_0x530ec8];return _0xdd83a5;};'use strict';var _=require(_0x8b33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b33('0x1'));var moment=require(_0x8b33('0x2'));var BPromise=require(_0x8b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b33('0x4'));var attributes=require(_0x8b33('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x8b33('0x6')]=function(_0x49545d,_0x2eb2d8){return _0x49545d[_0x8b33('0x7')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc65=['int_zoho_accounts','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xcc65,0x1b1));var _0x5cc6=function(_0x4bf5ec,_0x333deb){_0x4bf5ec=_0x4bf5ec-0x0;var _0x128359=_0xcc65[_0x4bf5ec];return _0x128359;};'use strict';var _=require(_0x5cc6('0x0'));var util=require('util');var logger=require(_0x5cc6('0x1'))('api');var moment=require(_0x5cc6('0x2'));var BPromise=require(_0x5cc6('0x3'));var rp=require(_0x5cc6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5cc6('0x5'));var attributes=require(_0x5cc6('0x6'));var integrations=require(_0x5cc6('0x7'));module[_0x5cc6('0x8')]=function(_0x5e1cee,_0xfc7d6d){return _0x5e1cee[_0x5cc6('0x9')](_0x5cc6('0xa'),attributes,{'tableName':_0x5cc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 908897c..1217d9b 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 _0xc6e8=['rpc','../../config/environment','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ZohoAccount','findAll','options','raw','attributes','limit','include','model','map','GetZohoAccount','find','where','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x46531f,_0x4f56da){var _0x31b3e0=function(_0x5af008){while(--_0x5af008){_0x46531f['push'](_0x46531f['shift']());}};_0x31b3e0(++_0x4f56da);}(_0xc6e8,0x9e));var _0x8c6e=function(_0xe656e5,_0x31c52c){_0xe656e5=_0xe656e5-0x0;var _0x2d48b6=_0xc6e8[_0xe656e5];return _0x2d48b6;};'use strict';var _=require(_0x8c6e('0x0'));var util=require(_0x8c6e('0x1'));var moment=require(_0x8c6e('0x2'));var BPromise=require(_0x8c6e('0x3'));var rs=require(_0x8c6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c6e('0x6'))(_0x8c6e('0x7'));var config=require(_0x8c6e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8c6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4624a5,_0x5b0cbc,_0x14c178){return new BPromise(function(_0x2b1156,_0x22ec9d){return client['request'](_0x4624a5,_0x14c178)[_0x8c6e('0xa')](function(_0x1f0352){logger[_0x8c6e('0xb')](_0x8c6e('0xc'),_0x5b0cbc,_0x8c6e('0xd'));logger[_0x8c6e('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5b0cbc,_0x8c6e('0xd'),JSON['stringify'](_0x1f0352));if(_0x1f0352[_0x8c6e('0xf')]){if(_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x10')]===0x1f4){logger[_0x8c6e('0xf')](_0x8c6e('0xc'),_0x5b0cbc,_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x11')]);return _0x22ec9d(_0x1f0352['error'][_0x8c6e('0x11')]);}logger[_0x8c6e('0xf')](_0x8c6e('0xc'),_0x5b0cbc,_0x1f0352['error'][_0x8c6e('0x11')]);return _0x2b1156(_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x11')]);}else{logger[_0x8c6e('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x5b0cbc,'request\x20sent');_0x2b1156(_0x1f0352[_0x8c6e('0x12')][_0x8c6e('0x11')]);}})[_0x8c6e('0x13')](function(_0x15e63d){logger['error'](_0x8c6e('0xc'),_0x5b0cbc,_0x15e63d);_0x22ec9d(_0x15e63d);});});}exports['GetZohoAccount']=function(_0x7e5a7){var _0x4be8d9=this;return new Promise(function(_0x436279,_0x58197d){return db[_0x8c6e('0x14')][_0x8c6e('0x15')]({'raw':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x17')]===undefined?!![]:![]:!![],'where':_0x7e5a7['options']?_0x7e5a7[_0x8c6e('0x16')]['where']||null:null,'attributes':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x18')]||null:null,'limit':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7['options'][_0x8c6e('0x19')]||null:null,'include':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x1a')]?_['map'](_0x7e5a7['options']['include'],function(_0x497795){return{'model':db[_0x497795[_0x8c6e('0x1b')]],'as':_0x497795['as'],'attributes':_0x497795[_0x8c6e('0x18')],'include':_0x497795['include']?_['map'](_0x497795[_0x8c6e('0x1a')],function(_0x33a0a3){return{'model':db[_0x33a0a3[_0x8c6e('0x1b')]],'as':_0x33a0a3['as'],'attributes':_0x33a0a3[_0x8c6e('0x18')],'include':_0x33a0a3[_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x33a0a3[_0x8c6e('0x1a')],function(_0x3429d1){return{'model':db[_0x3429d1[_0x8c6e('0x1b')]],'as':_0x3429d1['as'],'attributes':_0x3429d1[_0x8c6e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x177654){logger[_0x8c6e('0xb')](_0x8c6e('0x1d'),_0x7e5a7);logger[_0x8c6e('0xe')]('GetZohoAccount',_0x7e5a7,JSON['stringify'](_0x177654));_0x436279(_0x177654);})[_0x8c6e('0x13')](function(_0x30391b){logger[_0x8c6e('0xf')]('GetZohoAccount',_0x30391b[_0x8c6e('0x11')],_0x7e5a7);_0x58197d(_0x4be8d9[_0x8c6e('0xf')](0x1f4,_0x30391b[_0x8c6e('0x11')]));});});};exports['ShowZohoAccount']=function(_0x221027){var _0x5f16ed=this;return new Promise(function(_0x37e62a,_0xd568bc){return db[_0x8c6e('0x14')][_0x8c6e('0x1e')]({'raw':_0x221027['options']?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x17')]===undefined?!![]:![]:!![],'where':_0x221027[_0x8c6e('0x16')]?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x1f')]||null:null,'attributes':_0x221027['options']?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x18')]||null:null,'include':_0x221027[_0x8c6e('0x16')]?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x221027[_0x8c6e('0x16')]['include'],function(_0x50ea97){return{'model':db[_0x50ea97[_0x8c6e('0x1b')]],'as':_0x50ea97['as'],'attributes':_0x50ea97['attributes'],'include':_0x50ea97[_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x50ea97[_0x8c6e('0x1a')],function(_0x1501ef){return{'model':db[_0x1501ef['model']],'as':_0x1501ef['as'],'attributes':_0x1501ef[_0x8c6e('0x18')],'include':_0x1501ef[_0x8c6e('0x1a')]?_['map'](_0x1501ef['include'],function(_0x12f155){return{'model':db[_0x12f155['model']],'as':_0x12f155['as'],'attributes':_0x12f155[_0x8c6e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6d60f){logger[_0x8c6e('0xb')]('ShowZohoAccount',_0x221027);logger[_0x8c6e('0xe')]('ShowZohoAccount',_0x221027,JSON[_0x8c6e('0x20')](_0xd6d60f));_0x37e62a(_0xd6d60f);})[_0x8c6e('0x13')](function(_0x4064bc){logger[_0x8c6e('0xf')]('ShowZohoAccount',_0x4064bc['message'],_0x221027);_0xd568bc(_0x5f16ed[_0x8c6e('0xf')](0x1f4,_0x4064bc[_0x8c6e('0x11')]));});});}; \ No newline at end of file +var _0x956c=['attributes','then','info','GetZohoAccount','catch','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount','findAll','options','raw','where','limit','include','map','model'];(function(_0x5178a5,_0x53a158){var _0x2467e6=function(_0x2e7ff9){while(--_0x2e7ff9){_0x5178a5['push'](_0x5178a5['shift']());}};_0x2467e6(++_0x53a158);}(_0x956c,0x1d5));var _0xc956=function(_0x3a6201,_0x514193){_0x3a6201=_0x3a6201-0x0;var _0x3a37af=_0x956c[_0x3a6201];return _0x3a37af;};'use strict';var _=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var moment=require(_0xc956('0x2'));var BPromise=require('bluebird');var rs=require(_0xc956('0x3'));var fs=require('fs');var Redis=require(_0xc956('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc956('0x5'));var logger=require('../../config/logger')(_0xc956('0x6'));var config=require('../../config/environment');var jayson=require(_0xc956('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35a20e,_0x4722a2,_0x2609cf){return new BPromise(function(_0x4b5dd6,_0xf25ec){return client[_0xc956('0x8')](_0x35a20e,_0x2609cf)['then'](function(_0x557676){logger['info'](_0xc956('0x9'),_0x4722a2,_0xc956('0xa'));logger[_0xc956('0xb')](_0xc956('0xc'),_0x4722a2,_0xc956('0xa'),JSON[_0xc956('0xd')](_0x557676));if(_0x557676[_0xc956('0xe')]){if(_0x557676[_0xc956('0xe')][_0xc956('0xf')]===0x1f4){logger['error'](_0xc956('0x9'),_0x4722a2,_0x557676[_0xc956('0xe')][_0xc956('0x10')]);return _0xf25ec(_0x557676[_0xc956('0xe')][_0xc956('0x10')]);}logger[_0xc956('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4722a2,_0x557676[_0xc956('0xe')][_0xc956('0x10')]);return _0x4b5dd6(_0x557676[_0xc956('0xe')][_0xc956('0x10')]);}else{logger['info'](_0xc956('0x9'),_0x4722a2,_0xc956('0xa'));_0x4b5dd6(_0x557676['result']['message']);}})['catch'](function(_0x3ea285){logger['error'](_0xc956('0x9'),_0x4722a2,_0x3ea285);_0xf25ec(_0x3ea285);});});}exports['GetZohoAccount']=function(_0x154ec6){var _0x2899eb=this;return new Promise(function(_0x51a8c2,_0x35ec6a){return db[_0xc956('0x11')][_0xc956('0x12')]({'raw':_0x154ec6['options']?_0x154ec6[_0xc956('0x13')][_0xc956('0x14')]===undefined?!![]:![]:!![],'where':_0x154ec6[_0xc956('0x13')]?_0x154ec6[_0xc956('0x13')][_0xc956('0x15')]||null:null,'attributes':_0x154ec6[_0xc956('0x13')]?_0x154ec6[_0xc956('0x13')]['attributes']||null:null,'limit':_0x154ec6['options']?_0x154ec6['options'][_0xc956('0x16')]||null:null,'include':_0x154ec6[_0xc956('0x13')]?_0x154ec6['options'][_0xc956('0x17')]?_[_0xc956('0x18')](_0x154ec6[_0xc956('0x13')][_0xc956('0x17')],function(_0x709100){return{'model':db[_0x709100['model']],'as':_0x709100['as'],'attributes':_0x709100['attributes'],'include':_0x709100[_0xc956('0x17')]?_['map'](_0x709100[_0xc956('0x17')],function(_0x11bb49){return{'model':db[_0x11bb49[_0xc956('0x19')]],'as':_0x11bb49['as'],'attributes':_0x11bb49[_0xc956('0x1a')],'include':_0x11bb49['include']?_[_0xc956('0x18')](_0x11bb49[_0xc956('0x17')],function(_0x47815e){return{'model':db[_0x47815e['model']],'as':_0x47815e['as'],'attributes':_0x47815e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc956('0x1b')](function(_0x942733){logger[_0xc956('0x1c')](_0xc956('0x1d'),_0x154ec6);logger[_0xc956('0xb')]('GetZohoAccount',_0x154ec6,JSON[_0xc956('0xd')](_0x942733));_0x51a8c2(_0x942733);})[_0xc956('0x1e')](function(_0x35cdaa){logger['error'](_0xc956('0x1d'),_0x35cdaa[_0xc956('0x10')],_0x154ec6);_0x35ec6a(_0x2899eb['error'](0x1f4,_0x35cdaa[_0xc956('0x10')]));});});};exports[_0xc956('0x1f')]=function(_0x4445a0){var _0x14898b=this;return new Promise(function(_0x3b2f9f,_0x5a6bc7){return db[_0xc956('0x11')][_0xc956('0x20')]({'raw':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x14')]===undefined?!![]:![]:!![],'where':_0x4445a0['options']?_0x4445a0['options'][_0xc956('0x15')]||null:null,'attributes':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x1a')]||null:null,'include':_0x4445a0[_0xc956('0x13')]?_0x4445a0[_0xc956('0x13')][_0xc956('0x17')]?_[_0xc956('0x18')](_0x4445a0[_0xc956('0x13')][_0xc956('0x17')],function(_0x3808b1){return{'model':db[_0x3808b1['model']],'as':_0x3808b1['as'],'attributes':_0x3808b1[_0xc956('0x1a')],'include':_0x3808b1[_0xc956('0x17')]?_[_0xc956('0x18')](_0x3808b1[_0xc956('0x17')],function(_0x59756c){return{'model':db[_0x59756c[_0xc956('0x19')]],'as':_0x59756c['as'],'attributes':_0x59756c[_0xc956('0x1a')],'include':_0x59756c[_0xc956('0x17')]?_['map'](_0x59756c[_0xc956('0x17')],function(_0x57cd4a){return{'model':db[_0x57cd4a[_0xc956('0x19')]],'as':_0x57cd4a['as'],'attributes':_0x57cd4a[_0xc956('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc956('0x1b')](function(_0x1ee3ae){logger[_0xc956('0x1c')](_0xc956('0x1f'),_0x4445a0);logger[_0xc956('0xb')](_0xc956('0x1f'),_0x4445a0,JSON['stringify'](_0x1ee3ae));_0x3b2f9f(_0x1ee3ae);})[_0xc956('0x1e')](function(_0x477daa){logger['error'](_0xc956('0x1f'),_0x477daa[_0xc956('0x10')],_0x4445a0);_0x5a6bc7(_0x14898b[_0xc956('0xe')](0x1f4,_0x477daa[_0xc956('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ca2850f..c9aa4a2 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 _0x8ce1=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x528622,_0xcb18f0){var _0x1b12a0=function(_0x4d4065){while(--_0x4d4065){_0x528622['push'](_0x528622['shift']());}};_0x1b12a0(++_0xcb18f0);}(_0x8ce1,0x183));var _0x18ce=function(_0x1d7413,_0x39bed1){_0x1d7413=_0x1d7413-0x0;var _0x515d6c=_0x8ce1[_0x1d7413];return _0x515d6c;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var auth=require(_0x18ce('0x6'));var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0xc')]);router[_0x18ce('0xa')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['show']);router[_0x18ce('0xa')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0xf')]);router['get'](_0x18ce('0x10'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x11')]);router[_0x18ce('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')]('/:id',auth[_0x18ce('0xb')](),controller[_0x18ce('0x16')]);router[_0x18ce('0x17')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['destroy']);module[_0x18ce('0x18')]=router; \ No newline at end of file +var _0xf021=['getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','index','/:id','isAuthenticated','show','get','/:id/fields','getFields'];(function(_0x11714b,_0x2aef4b){var _0x3386d3=function(_0x48bc10){while(--_0x48bc10){_0x11714b['push'](_0x11714b['shift']());}};_0x3386d3(++_0x2aef4b);}(_0xf021,0x18f));var _0x1f02=function(_0x36bf4a,_0x13cf2f){_0x36bf4a=_0x36bf4a-0x0;var _0x3588c6=_0xf021[_0x36bf4a];return _0x3588c6;};'use strict';var multer=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var path=require(_0x1f02('0x2'));var timeout=require(_0x1f02('0x3'));var express=require(_0x1f02('0x4'));var router=express['Router']();var auth=require(_0x1f02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f02('0x6'));var controller=require(_0x1f02('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1f02('0x8')]);router['get'](_0x1f02('0x9'),auth[_0x1f02('0xa')](),controller[_0x1f02('0xb')]);router[_0x1f02('0xc')](_0x1f02('0xd'),auth['isAuthenticated'](),controller[_0x1f02('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x1f02('0xf')]);router[_0x1f02('0xc')](_0x1f02('0x10'),auth[_0x1f02('0xa')](),controller[_0x1f02('0x11')]);router['post']('/',auth[_0x1f02('0xa')](),controller[_0x1f02('0x12')]);router[_0x1f02('0x13')]('/:id',auth[_0x1f02('0xa')](),controller[_0x1f02('0x14')]);router[_0x1f02('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1f02('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 6c6555a..fbd2bc8 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 _0x6038=['STRING','sequelize','exports'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x6038,0x115));var _0x8603=function(_0x233c8d,_0x173255){_0x233c8d=_0x233c8d-0x0;var _0x3dbcd7=_0x6038[_0x233c8d];return _0x3dbcd7;};'use strict';var Sequelize=require(_0x8603('0x0'));module[_0x8603('0x1')]={'name':{'type':Sequelize[_0x8603('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc279=['exports','STRING'];(function(_0x45a4a0,_0x2ed137){var _0xcf3cca=function(_0x56c28a){while(--_0x56c28a){_0x45a4a0['push'](_0x45a4a0['shift']());}};_0xcf3cca(++_0x2ed137);}(_0xc279,0xd2));var _0x9c27=function(_0x4d0c07,_0x1c647b){_0x4d0c07=_0x4d0c07-0x0;var _0x450ca0=_0xc279[_0x4d0c07];return _0x450ca0;};'use strict';var Sequelize=require('sequelize');module[_0x9c27('0x0')]={'name':{'type':Sequelize[_0x9c27('0x1')]},'description':{'type':Sequelize[_0x9c27('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5c7c043..984bc07 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 _0x456e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','merge','map','type','key','field','filter','includeAll','include','ZohoConfiguration','findAll','params','length','options','create','body','destroy','find','findOne','ZohoField','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x456e,0xf6));var _0xe456=function(_0x1b5418,_0xa0747){_0x1b5418=_0x1b5418-0x0;var _0x1c189f=_0x456e[_0x1b5418];return _0x1c189f;};'use strict';var pdf=require(_0xe456('0x0'));var emlformat=require(_0xe456('0x1'));var rimraf=require(_0xe456('0x2'));var zipdir=require(_0xe456('0x3'));var jsonpatch=require(_0xe456('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe456('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe456('0x6'));var sox=require('sox');var csv=require(_0xe456('0x7'));var ejs=require(_0xe456('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe456('0x9'));var crypto=require(_0xe456('0xa'));var jsforce=require(_0xe456('0xb'));var deskjs=require(_0xe456('0xc'));var toCsv=require(_0xe456('0x7'));var querystring=require(_0xe456('0xd'));var Papa=require(_0xe456('0xe'));var Redis=require(_0xe456('0xf'));var authService=require(_0xe456('0x10'));var qs=require(_0xe456('0x11'));var hardwareService=require(_0xe456('0x12'));var logger=require(_0xe456('0x13'))(_0xe456('0x14'));var utils=require(_0xe456('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe456('0x16')]({'port':0x232a});function checkPasswordPattern(_0x413ef9,_0x2de09c,_0x2c4580){if(_0x2c4580){var _0x399509=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x399509[_0xe456('0x17')](_0x2de09c)){return _0x413ef9;}else{throw new Error(_0xe456('0x18'));}}else{return _0x413ef9;}}function respondWithRpcPromise(_0x1d0f16,_0x5abc12,_0x3d7127,_0x5ec69c){return new BPromise(function(_0x5fafed,_0x5c908f){var _0x5d5b42=_0x5ec69c||client;return _0x5d5b42[_0xe456('0x19')](_0x1d0f16,_0x3d7127)[_0xe456('0x1a')](function(_0x2f327f){logger[_0xe456('0x1b')](_0xe456('0x1c'),_0x5abc12,'request\x20sent');logger[_0xe456('0x1d')](_0xe456('0x1e'),_0x5abc12,_0xe456('0x1f'),JSON[_0xe456('0x20')](_0x2f327f));if(_0x2f327f['error']){if(_0x2f327f[_0xe456('0x21')]['code']===0x1f4){logger['error'](_0xe456('0x1c'),_0x5abc12,_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);return _0x5c908f(_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);}logger['error'](_0xe456('0x1c'),_0x5abc12,_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);return _0x5fafed(_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);}else{logger[_0xe456('0x1b')](_0xe456('0x1c'),_0x5abc12,_0xe456('0x1f'));_0x5fafed(_0x2f327f[_0xe456('0x23')]['message']);}})[_0xe456('0x24')](function(_0x20247d){logger[_0xe456('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x5abc12,_0x20247d);_0x5c908f(_0x20247d);});});}function respondWithStatusCode(_0x270816,_0x33d926){_0x33d926=_0x33d926||0xcc;return function(_0xb53b07){if(_0xb53b07){return _0x270816[_0xe456('0x25')](_0x33d926);}return _0x270816[_0xe456('0x26')](_0x33d926)[_0xe456('0x27')]();};}function respondWithResult(_0x12cd5f,_0x19c923){_0x19c923=_0x19c923||0xc8;return function(_0x5657ea){if(_0x5657ea){return _0x12cd5f[_0xe456('0x26')](_0x19c923)[_0xe456('0x28')](_0x5657ea);}};}function respondWithFilteredResult(_0x36a8f0,_0x26bb1a){return function(_0x4277d0){if(_0x4277d0){var _0x55b581=_0x4277d0[_0xe456('0x29')],_0x5912a8=_0x26bb1a[_0xe456('0x2a')],_0x598ca2=_0x26bb1a['offset']+_0x26bb1a['limit'],_0x150a27;if(_0x598ca2>=_0x55b581){_0x598ca2=_0x55b581;_0x150a27=0xc8;}else{_0x150a27=0xce;}_0x36a8f0[_0xe456('0x26')](_0x150a27);return _0x36a8f0[_0xe456('0x2b')](_0xe456('0x2c'),_0x5912a8+'-'+_0x598ca2+'/'+_0x55b581)[_0xe456('0x28')](_0x4277d0);}return null;};}function patchUpdates(_0x563986){return function(_0x228580){try{jsonpatch['apply'](_0x228580,_0x563986,!![]);}catch(_0x409322){return BPromise[_0xe456('0x2d')](_0x409322);}return _0x228580['save']();};}function saveUpdates(_0x1380c6,_0x45c3ef){return function(_0x32d1bd){if(_0x32d1bd){return _0x32d1bd[_0xe456('0x2e')](_0x1380c6)['then'](function(_0x1594fb){return _0x1594fb;});}return null;};}function removeEntity(_0xfd5165,_0x96e03b){return function(_0x11b8dd){if(_0x11b8dd){return _0x11b8dd['destroy']()['then'](function(){_0xfd5165['status'](0xcc)[_0xe456('0x27')]();});}};}function handleEntityNotFound(_0x5f0a0b,_0x9b0c9e){return function(_0x492d55){if(!_0x492d55){_0x5f0a0b['sendStatus'](0x194);}return _0x492d55;};}function handleError(_0x549cc1,_0x18d9e0){_0x18d9e0=_0x18d9e0||0x1f4;return function(_0x2ed7a7){logger['error'](_0x2ed7a7[_0xe456('0x2f')]);if(_0x2ed7a7['name']){delete _0x2ed7a7[_0xe456('0x30')];}_0x549cc1[_0xe456('0x26')](_0x18d9e0)[_0xe456('0x31')](_0x2ed7a7);};}exports['index']=function(_0x54f764,_0xdf906d){var _0x335861={},_0x4d0baf={},_0x308f0d={'count':0x0,'rows':[]};var _0x181d1a=db['ZohoConfiguration'][_0xe456('0x32')];_0x4d0baf[_0xe456('0x33')]=_[_0xe456('0x34')](_0x181d1a);_0x4d0baf[_0xe456('0x35')]=_[_0xe456('0x34')](_0x54f764['query']);_0x4d0baf[_0xe456('0x36')]=_[_0xe456('0x37')](_0x4d0baf[_0xe456('0x33')],_0x4d0baf[_0xe456('0x35')]);_0x335861[_0xe456('0x38')]=_[_0xe456('0x37')](_0x4d0baf[_0xe456('0x33')],qs['fields'](_0x54f764[_0xe456('0x35')][_0xe456('0x39')]));_0x335861[_0xe456('0x38')]=_0x335861[_0xe456('0x38')]['length']?_0x335861[_0xe456('0x38')]:_0x4d0baf['model'];if(!_0x54f764[_0xe456('0x35')]['hasOwnProperty'](_0xe456('0x3a'))){_0x335861['limit']=qs['limit'](_0x54f764['query'][_0xe456('0x3b')]);_0x335861[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x54f764['query']['offset']);}_0x335861[_0xe456('0x3c')]=qs['sort'](_0x54f764['query'][_0xe456('0x3d')]);_0x335861[_0xe456('0x3e')]=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x54f764[_0xe456('0x35')],_0x4d0baf[_0xe456('0x36')]));if(_0x54f764[_0xe456('0x35')]['filter']){_0x335861[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x335861[_0xe456('0x3e')],{'$or':_[_0xe456('0x41')](_0x181d1a,function(_0x52eef3){if(_0x52eef3[_0xe456('0x42')][_0xe456('0x43')]!=='VIRTUAL'){var _0x104241={};_0x104241[_0x52eef3[_0xe456('0x44')]]={'$like':'%'+_0x54f764[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0x104241;}})});}_0x335861=_[_0xe456('0x40')]({},_0x335861,_0x54f764['options']);var _0x13f06d={'where':_0x335861['where']};return db['ZohoConfiguration'][_0xe456('0x29')](_0x13f06d)[_0xe456('0x1a')](function(_0x1f28f6){_0x308f0d[_0xe456('0x29')]=_0x1f28f6;if(_0x54f764[_0xe456('0x35')][_0xe456('0x46')]){_0x335861[_0xe456('0x47')]=[{'all':!![]}];}return db[_0xe456('0x48')][_0xe456('0x49')](_0x335861);})[_0xe456('0x1a')](function(_0x59e51c){_0x308f0d['rows']=_0x59e51c;return _0x308f0d;})[_0xe456('0x1a')](respondWithFilteredResult(_0xdf906d,_0x335861))[_0xe456('0x24')](handleError(_0xdf906d,null));};exports['show']=function(_0x2a3000,_0x4db2c6){var _0x3654e5={'raw':![],'where':{'id':_0x2a3000[_0xe456('0x4a')]['id']}},_0xb54e71={};_0xb54e71['model']=_['keys'](db[_0xe456('0x48')][_0xe456('0x32')]);_0xb54e71[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2a3000[_0xe456('0x35')]);_0xb54e71[_0xe456('0x36')]=_[_0xe456('0x37')](_0xb54e71['model'],_0xb54e71[_0xe456('0x35')]);_0x3654e5[_0xe456('0x38')]=_[_0xe456('0x37')](_0xb54e71[_0xe456('0x33')],qs[_0xe456('0x39')](_0x2a3000[_0xe456('0x35')][_0xe456('0x39')]));_0x3654e5[_0xe456('0x38')]=_0x3654e5[_0xe456('0x38')][_0xe456('0x4b')]?_0x3654e5['attributes']:_0xb54e71[_0xe456('0x33')];if(_0x2a3000[_0xe456('0x35')][_0xe456('0x46')]){_0x3654e5[_0xe456('0x47')]=[{'all':!![]}];}_0x3654e5=_[_0xe456('0x40')]({},_0x3654e5,_0x2a3000[_0xe456('0x4c')]);return db['ZohoConfiguration']['find'](_0x3654e5)[_0xe456('0x1a')](handleEntityNotFound(_0x4db2c6,null))['then'](respondWithResult(_0x4db2c6,null))[_0xe456('0x24')](handleError(_0x4db2c6,null));};exports[_0xe456('0x4d')]=function(_0x566ef8,_0x188241){return db[_0xe456('0x48')]['create'](_0x566ef8[_0xe456('0x4e')],{})['then'](respondWithResult(_0x188241,0xc9))[_0xe456('0x24')](handleError(_0x188241,null));};exports['update']=function(_0x47f018,_0x3d44b5){if(_0x47f018[_0xe456('0x4e')]['id']){delete _0x47f018[_0xe456('0x4e')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x47f018[_0xe456('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d44b5,null))[_0xe456('0x1a')](saveUpdates(_0x47f018[_0xe456('0x4e')],null))[_0xe456('0x1a')](respondWithResult(_0x3d44b5,null))['catch'](handleError(_0x3d44b5,null));};exports[_0xe456('0x4f')]=function(_0x2d13a1,_0x444405){return db[_0xe456('0x48')][_0xe456('0x50')]({'where':{'id':_0x2d13a1[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x444405,null))['then'](removeEntity(_0x444405,null))[_0xe456('0x24')](handleError(_0x444405,null));};exports['getFields']=function(_0x4d38e6,_0x75f849,_0x3e613a){var _0xa9d9b9={};var _0x14769c={};var _0x53c4ba;var _0x56b81b;return db['ZohoConfiguration'][_0xe456('0x51')]({'where':{'id':_0x4d38e6[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x75f849,null))['then'](function(_0xf11e48){if(_0xf11e48){_0x53c4ba=_0xf11e48;_0x14769c['model']=_[_0xe456('0x34')](db[_0xe456('0x52')]['rawAttributes']);_0x14769c[_0xe456('0x35')]=_[_0xe456('0x34')](_0x4d38e6['query']);_0x14769c[_0xe456('0x36')]=_[_0xe456('0x37')](_0x14769c['model'],_0x14769c['query']);_0xa9d9b9[_0xe456('0x38')]=_['intersection'](_0x14769c[_0xe456('0x33')],qs[_0xe456('0x39')](_0x4d38e6[_0xe456('0x35')]['fields']));_0xa9d9b9[_0xe456('0x38')]=_0xa9d9b9[_0xe456('0x38')][_0xe456('0x4b')]?_0xa9d9b9[_0xe456('0x38')]:_0x14769c[_0xe456('0x33')];_0xa9d9b9[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x4d38e6[_0xe456('0x35')][_0xe456('0x3d')]);_0xa9d9b9[_0xe456('0x3e')]=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x4d38e6[_0xe456('0x35')],_0x14769c[_0xe456('0x36')]));if(_0x4d38e6[_0xe456('0x35')][_0xe456('0x45')]){_0xa9d9b9['where']=_[_0xe456('0x40')](_0xa9d9b9[_0xe456('0x3e')],{'$or':_['map'](_0xa9d9b9[_0xe456('0x38')],function(_0x5b3f28){var _0xd1b87d={};_0xd1b87d[_0x5b3f28]={'$like':'%'+_0x4d38e6[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0xd1b87d;})});}_0xa9d9b9=_[_0xe456('0x40')]({},_0xa9d9b9,_0x4d38e6[_0xe456('0x4c')]);return _0x53c4ba[_0xe456('0x53')](_0xa9d9b9);}})[_0xe456('0x1a')](function(_0x25ac1f){if(_0x25ac1f){_0x56b81b=_0x25ac1f[_0xe456('0x4b')];if(!_0x4d38e6[_0xe456('0x35')][_0xe456('0x54')]('nolimit')){_0xa9d9b9['limit']=qs[_0xe456('0x3b')](_0x4d38e6[_0xe456('0x35')]['limit']);_0xa9d9b9[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x4d38e6[_0xe456('0x35')]['offset']);}return _0x53c4ba[_0xe456('0x53')](_0xa9d9b9);}})[_0xe456('0x1a')](function(_0x5b20de){if(_0x5b20de){return _0x5b20de?{'count':_0x56b81b,'rows':_0x5b20de}:null;}})[_0xe456('0x1a')](respondWithResult(_0x75f849,null))[_0xe456('0x24')](handleError(_0x75f849,null));};exports[_0xe456('0x55')]=function(_0x2d7271,_0x26a331,_0x2d8f4f){var _0x5ae2e8={};var _0x3eb084={};var _0x4d103b;var _0x422722;return db[_0xe456('0x48')][_0xe456('0x51')]({'where':{'id':_0x2d7271[_0xe456('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26a331,null))[_0xe456('0x1a')](function(_0x543d15){if(_0x543d15){_0x4d103b=_0x543d15;_0x3eb084['model']=_['keys'](db['ZohoField'][_0xe456('0x32')]);_0x3eb084[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2d7271[_0xe456('0x35')]);_0x3eb084[_0xe456('0x36')]=_[_0xe456('0x37')](_0x3eb084['model'],_0x3eb084[_0xe456('0x35')]);_0x5ae2e8['attributes']=_['intersection'](_0x3eb084[_0xe456('0x33')],qs[_0xe456('0x39')](_0x2d7271[_0xe456('0x35')][_0xe456('0x39')]));_0x5ae2e8['attributes']=_0x5ae2e8[_0xe456('0x38')][_0xe456('0x4b')]?_0x5ae2e8[_0xe456('0x38')]:_0x3eb084[_0xe456('0x33')];_0x5ae2e8[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x2d7271['query'][_0xe456('0x3d')]);_0x5ae2e8[_0xe456('0x3e')]=qs[_0xe456('0x36')](_['pick'](_0x2d7271[_0xe456('0x35')],_0x3eb084[_0xe456('0x36')]));if(_0x2d7271['query']['filter']){_0x5ae2e8[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x5ae2e8['where'],{'$or':_['map'](_0x5ae2e8[_0xe456('0x38')],function(_0x538067){var _0x18e595={};_0x18e595[_0x538067]={'$like':'%'+_0x2d7271[_0xe456('0x35')]['filter']+'%'};return _0x18e595;})});}_0x5ae2e8=_['merge']({},_0x5ae2e8,_0x2d7271[_0xe456('0x4c')]);return _0x4d103b[_0xe456('0x55')](_0x5ae2e8);}})[_0xe456('0x1a')](function(_0x2dce82){if(_0x2dce82){_0x422722=_0x2dce82['length'];if(!_0x2d7271[_0xe456('0x35')]['hasOwnProperty']('nolimit')){_0x5ae2e8['limit']=qs['limit'](_0x2d7271[_0xe456('0x35')][_0xe456('0x3b')]);_0x5ae2e8['offset']=qs[_0xe456('0x2a')](_0x2d7271[_0xe456('0x35')][_0xe456('0x2a')]);}return _0x4d103b[_0xe456('0x55')](_0x5ae2e8);}})['then'](function(_0x3c4ad2){if(_0x3c4ad2){return _0x3c4ad2?{'count':_0x422722,'rows':_0x3c4ad2}:null;}})['then'](respondWithResult(_0x26a331,null))[_0xe456('0x24')](handleError(_0x26a331,null));};exports['getDescriptions']=function(_0x2b92b9,_0x1f5418,_0x34524e){var _0x26018b={};var _0x3af7da={};var _0xb1716f;var _0x13f758;return db[_0xe456('0x48')][_0xe456('0x51')]({'where':{'id':_0x2b92b9[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x1f5418,null))[_0xe456('0x1a')](function(_0x3f87f0){if(_0x3f87f0){_0xb1716f=_0x3f87f0;_0x3af7da[_0xe456('0x33')]=_[_0xe456('0x34')](db[_0xe456('0x52')]['rawAttributes']);_0x3af7da[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2b92b9[_0xe456('0x35')]);_0x3af7da[_0xe456('0x36')]=_[_0xe456('0x37')](_0x3af7da['model'],_0x3af7da[_0xe456('0x35')]);_0x26018b[_0xe456('0x38')]=_[_0xe456('0x37')](_0x3af7da['model'],qs[_0xe456('0x39')](_0x2b92b9['query'][_0xe456('0x39')]));_0x26018b[_0xe456('0x38')]=_0x26018b['attributes']['length']?_0x26018b[_0xe456('0x38')]:_0x3af7da[_0xe456('0x33')];_0x26018b[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x2b92b9[_0xe456('0x35')][_0xe456('0x3d')]);_0x26018b['where']=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x2b92b9['query'],_0x3af7da[_0xe456('0x36')]));if(_0x2b92b9[_0xe456('0x35')][_0xe456('0x45')]){_0x26018b[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x26018b[_0xe456('0x3e')],{'$or':_['map'](_0x26018b[_0xe456('0x38')],function(_0x5b1040){var _0x96232c={};_0x96232c[_0x5b1040]={'$like':'%'+_0x2b92b9[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0x96232c;})});}_0x26018b=_['merge']({},_0x26018b,_0x2b92b9[_0xe456('0x4c')]);return _0xb1716f[_0xe456('0x56')](_0x26018b);}})[_0xe456('0x1a')](function(_0x5048ef){if(_0x5048ef){_0x13f758=_0x5048ef[_0xe456('0x4b')];if(!_0x2b92b9[_0xe456('0x35')][_0xe456('0x54')](_0xe456('0x3a'))){_0x26018b[_0xe456('0x3b')]=qs['limit'](_0x2b92b9['query'][_0xe456('0x3b')]);_0x26018b[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x2b92b9[_0xe456('0x35')][_0xe456('0x2a')]);}return _0xb1716f[_0xe456('0x56')](_0x26018b);}})[_0xe456('0x1a')](function(_0x4794c7){if(_0x4794c7){return _0x4794c7?{'count':_0x13f758,'rows':_0x4794c7}:null;}})[_0xe456('0x1a')](respondWithResult(_0x1f5418,null))['catch'](handleError(_0x1f5418,null));}; \ No newline at end of file +var _0xfb3d=['limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','ZohoConfiguration','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','type','key','field','options','count','includeAll','include','rows','show','keys','length','find','create','body','params','findOne','ZohoField','getFields','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','sendStatus','status','json','offset'];(function(_0x3744c4,_0x5cc421){var _0x540e13=function(_0x40e000){while(--_0x40e000){_0x3744c4['push'](_0x3744c4['shift']());}};_0x540e13(++_0x5cc421);}(_0xfb3d,0x1e8));var _0xdfb3=function(_0x5962de,_0x5d63a3){_0x5962de=_0x5962de-0x0;var _0x1b7dd9=_0xfb3d[_0x5962de];return _0x1b7dd9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdfb3('0x0'));var rimraf=require(_0xdfb3('0x1'));var zipdir=require(_0xdfb3('0x2'));var jsonpatch=require(_0xdfb3('0x3'));var rp=require(_0xdfb3('0x4'));var moment=require('moment');var BPromise=require(_0xdfb3('0x5'));var Mustache=require(_0xdfb3('0x6'));var util=require(_0xdfb3('0x7'));var path=require('path');var sox=require(_0xdfb3('0x8'));var csv=require(_0xdfb3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfb3('0xa'));var squel=require('squel');var crypto=require(_0xdfb3('0xb'));var jsforce=require(_0xdfb3('0xc'));var deskjs=require(_0xdfb3('0xd'));var toCsv=require(_0xdfb3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdfb3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdfb3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfb3('0x10'))(_0xdfb3('0x11'));var utils=require(_0xdfb3('0x12'));var config=require(_0xdfb3('0x13'));var db=require(_0xdfb3('0x14'))['db'];var jayson=require(_0xdfb3('0x15'));var client=jayson['client'][_0xdfb3('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4b82cc,_0x13b043,_0x5f0b36){if(_0x5f0b36){var _0x25b2eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b2eb[_0xdfb3('0x17')](_0x13b043)){return _0x4b82cc;}else{throw new Error(_0xdfb3('0x18'));}}else{return _0x4b82cc;}}function respondWithRpcPromise(_0x474351,_0x30c5bc,_0x335a55,_0x538da5){return new BPromise(function(_0x8e0e61,_0x22121a){var _0x1e4779=_0x538da5||client;return _0x1e4779[_0xdfb3('0x19')](_0x474351,_0x335a55)[_0xdfb3('0x1a')](function(_0x3ca336){logger['info'](_0xdfb3('0x1b'),_0x30c5bc,_0xdfb3('0x1c'));logger['debug'](_0xdfb3('0x1d'),_0x30c5bc,_0xdfb3('0x1c'),JSON['stringify'](_0x3ca336));if(_0x3ca336['error']){if(_0x3ca336['error'][_0xdfb3('0x1e')]===0x1f4){logger['error'](_0xdfb3('0x1b'),_0x30c5bc,_0x3ca336['error']['message']);return _0x22121a(_0x3ca336[_0xdfb3('0x1f')]['message']);}logger[_0xdfb3('0x1f')](_0xdfb3('0x1b'),_0x30c5bc,_0x3ca336[_0xdfb3('0x1f')][_0xdfb3('0x20')]);return _0x8e0e61(_0x3ca336[_0xdfb3('0x1f')][_0xdfb3('0x20')]);}else{logger[_0xdfb3('0x21')](_0xdfb3('0x1b'),_0x30c5bc,_0xdfb3('0x1c'));_0x8e0e61(_0x3ca336[_0xdfb3('0x22')][_0xdfb3('0x20')]);}})[_0xdfb3('0x23')](function(_0x14cb30){logger[_0xdfb3('0x1f')](_0xdfb3('0x1b'),_0x30c5bc,_0x14cb30);_0x22121a(_0x14cb30);});});}function respondWithStatusCode(_0x185027,_0x3de83d){_0x3de83d=_0x3de83d||0xcc;return function(_0x335942){if(_0x335942){return _0x185027[_0xdfb3('0x24')](_0x3de83d);}return _0x185027[_0xdfb3('0x25')](_0x3de83d)['end']();};}function respondWithResult(_0x21b259,_0x20381c){_0x20381c=_0x20381c||0xc8;return function(_0x50c3a0){if(_0x50c3a0){return _0x21b259['status'](_0x20381c)[_0xdfb3('0x26')](_0x50c3a0);}};}function respondWithFilteredResult(_0x197d05,_0x2fb565){return function(_0xb7f44e){if(_0xb7f44e){var _0x1a5e4a=_0xb7f44e['count'],_0x5f37ce=_0x2fb565[_0xdfb3('0x27')],_0x3baad6=_0x2fb565['offset']+_0x2fb565[_0xdfb3('0x28')],_0x518da7;if(_0x3baad6>=_0x1a5e4a){_0x3baad6=_0x1a5e4a;_0x518da7=0xc8;}else{_0x518da7=0xce;}_0x197d05['status'](_0x518da7);return _0x197d05[_0xdfb3('0x29')](_0xdfb3('0x2a'),_0x5f37ce+'-'+_0x3baad6+'/'+_0x1a5e4a)[_0xdfb3('0x26')](_0xb7f44e);}return null;};}function patchUpdates(_0x3ab08b){return function(_0x42a710){try{jsonpatch[_0xdfb3('0x2b')](_0x42a710,_0x3ab08b,!![]);}catch(_0x536f6b){return BPromise[_0xdfb3('0x2c')](_0x536f6b);}return _0x42a710['save']();};}function saveUpdates(_0x2b76b9,_0x58d3e0){return function(_0x5c2e53){if(_0x5c2e53){return _0x5c2e53[_0xdfb3('0x2d')](_0x2b76b9)[_0xdfb3('0x1a')](function(_0x2d1194){return _0x2d1194;});}return null;};}function removeEntity(_0x37819b,_0xa5100d){return function(_0x9f4c29){if(_0x9f4c29){return _0x9f4c29[_0xdfb3('0x2e')]()['then'](function(){_0x37819b[_0xdfb3('0x25')](0xcc)[_0xdfb3('0x2f')]();});}};}function handleEntityNotFound(_0x520e41,_0x4aa0e7){return function(_0x4a0089){if(!_0x4a0089){_0x520e41[_0xdfb3('0x24')](0x194);}return _0x4a0089;};}function handleError(_0x238e33,_0x140555){_0x140555=_0x140555||0x1f4;return function(_0x5bfae3){logger[_0xdfb3('0x1f')](_0x5bfae3[_0xdfb3('0x30')]);if(_0x5bfae3['name']){delete _0x5bfae3[_0xdfb3('0x31')];}_0x238e33['status'](_0x140555)[_0xdfb3('0x32')](_0x5bfae3);};}exports['index']=function(_0x2282ba,_0x10e904){var _0xe9af36={},_0x39048a={},_0x246beb={'count':0x0,'rows':[]};var _0x5e8fb5=db[_0xdfb3('0x33')][_0xdfb3('0x34')];_0x39048a[_0xdfb3('0x35')]=_['keys'](_0x5e8fb5);_0x39048a[_0xdfb3('0x36')]=_['keys'](_0x2282ba[_0xdfb3('0x36')]);_0x39048a['filters']=_[_0xdfb3('0x37')](_0x39048a[_0xdfb3('0x35')],_0x39048a['query']);_0xe9af36[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x39048a['model'],qs[_0xdfb3('0x39')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x39')]));_0xe9af36[_0xdfb3('0x38')]=_0xe9af36['attributes']['length']?_0xe9af36['attributes']:_0x39048a[_0xdfb3('0x35')];if(!_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3a')](_0xdfb3('0x3b'))){_0xe9af36['limit']=qs[_0xdfb3('0x28')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0xe9af36[_0xdfb3('0x27')]=qs['offset'](_0x2282ba['query'][_0xdfb3('0x27')]);}_0xe9af36['order']=qs[_0xdfb3('0x3c')](_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3c')]);_0xe9af36['where']=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x2282ba[_0xdfb3('0x36')],_0x39048a[_0xdfb3('0x3d')]));if(_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0xe9af36[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0xe9af36[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x5e8fb5,function(_0x3bd4f4){if(_0x3bd4f4[_0xdfb3('0x43')][_0xdfb3('0x44')]!=='VIRTUAL'){var _0x51a55d={};_0x51a55d[_0x3bd4f4[_0xdfb3('0x45')]]={'$like':'%'+_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x51a55d;}})});}_0xe9af36=_[_0xdfb3('0x41')]({},_0xe9af36,_0x2282ba[_0xdfb3('0x46')]);var _0x312228={'where':_0xe9af36['where']};return db['ZohoConfiguration'][_0xdfb3('0x47')](_0x312228)['then'](function(_0x425713){_0x246beb['count']=_0x425713;if(_0x2282ba[_0xdfb3('0x36')][_0xdfb3('0x48')]){_0xe9af36[_0xdfb3('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xe9af36);})[_0xdfb3('0x1a')](function(_0x32070d){_0x246beb[_0xdfb3('0x4a')]=_0x32070d;return _0x246beb;})[_0xdfb3('0x1a')](respondWithFilteredResult(_0x10e904,_0xe9af36))[_0xdfb3('0x23')](handleError(_0x10e904,null));};exports[_0xdfb3('0x4b')]=function(_0x235c63,_0x14412f){var _0x42be56={'raw':![],'where':{'id':_0x235c63['params']['id']}},_0x497c0f={};_0x497c0f[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db[_0xdfb3('0x33')][_0xdfb3('0x34')]);_0x497c0f[_0xdfb3('0x36')]=_['keys'](_0x235c63['query']);_0x497c0f['filters']=_[_0xdfb3('0x37')](_0x497c0f[_0xdfb3('0x35')],_0x497c0f[_0xdfb3('0x36')]);_0x42be56[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x497c0f[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x235c63['query'][_0xdfb3('0x39')]));_0x42be56[_0xdfb3('0x38')]=_0x42be56[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x42be56[_0xdfb3('0x38')]:_0x497c0f[_0xdfb3('0x35')];if(_0x235c63['query'][_0xdfb3('0x48')]){_0x42be56[_0xdfb3('0x49')]=[{'all':!![]}];}_0x42be56=_['merge']({},_0x42be56,_0x235c63['options']);return db[_0xdfb3('0x33')][_0xdfb3('0x4e')](_0x42be56)['then'](handleEntityNotFound(_0x14412f,null))['then'](respondWithResult(_0x14412f,null))['catch'](handleError(_0x14412f,null));};exports[_0xdfb3('0x4f')]=function(_0x226636,_0x1098ef){return db[_0xdfb3('0x33')][_0xdfb3('0x4f')](_0x226636[_0xdfb3('0x50')],{})[_0xdfb3('0x1a')](respondWithResult(_0x1098ef,0xc9))['catch'](handleError(_0x1098ef,null));};exports[_0xdfb3('0x2d')]=function(_0x4211d0,_0x26df39){if(_0x4211d0[_0xdfb3('0x50')]['id']){delete _0x4211d0[_0xdfb3('0x50')]['id'];}return db[_0xdfb3('0x33')][_0xdfb3('0x4e')]({'where':{'id':_0x4211d0[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x26df39,null))[_0xdfb3('0x1a')](saveUpdates(_0x4211d0[_0xdfb3('0x50')],null))[_0xdfb3('0x1a')](respondWithResult(_0x26df39,null))['catch'](handleError(_0x26df39,null));};exports[_0xdfb3('0x2e')]=function(_0x3e331b,_0x307773){return db[_0xdfb3('0x33')][_0xdfb3('0x4e')]({'where':{'id':_0x3e331b[_0xdfb3('0x51')]['id']}})['then'](handleEntityNotFound(_0x307773,null))[_0xdfb3('0x1a')](removeEntity(_0x307773,null))[_0xdfb3('0x23')](handleError(_0x307773,null));};exports['getFields']=function(_0x11f829,_0x448451,_0x31b569){var _0x528b63={};var _0x975b52={};var _0xffcd0e;var _0x22a3a0;return db[_0xdfb3('0x33')][_0xdfb3('0x52')]({'where':{'id':_0x11f829[_0xdfb3('0x51')]['id']}})['then'](handleEntityNotFound(_0x448451,null))[_0xdfb3('0x1a')](function(_0x3a9ab8){if(_0x3a9ab8){_0xffcd0e=_0x3a9ab8;_0x975b52[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db[_0xdfb3('0x53')][_0xdfb3('0x34')]);_0x975b52[_0xdfb3('0x36')]=_[_0xdfb3('0x4c')](_0x11f829[_0xdfb3('0x36')]);_0x975b52['filters']=_[_0xdfb3('0x37')](_0x975b52[_0xdfb3('0x35')],_0x975b52['query']);_0x528b63[_0xdfb3('0x38')]=_[_0xdfb3('0x37')](_0x975b52['model'],qs[_0xdfb3('0x39')](_0x11f829['query'][_0xdfb3('0x39')]));_0x528b63[_0xdfb3('0x38')]=_0x528b63[_0xdfb3('0x38')]['length']?_0x528b63['attributes']:_0x975b52[_0xdfb3('0x35')];_0x528b63['order']=qs[_0xdfb3('0x3c')](_0x11f829['query'][_0xdfb3('0x3c')]);_0x528b63[_0xdfb3('0x40')]=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x11f829[_0xdfb3('0x36')],_0x975b52[_0xdfb3('0x3d')]));if(_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0x528b63[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x528b63[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x528b63[_0xdfb3('0x38')],function(_0x446249){var _0x15f48c={};_0x15f48c[_0x446249]={'$like':'%'+_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x15f48c;})});}_0x528b63=_['merge']({},_0x528b63,_0x11f829[_0xdfb3('0x46')]);return _0xffcd0e['getFields'](_0x528b63);}})[_0xdfb3('0x1a')](function(_0x5c4086){if(_0x5c4086){_0x22a3a0=_0x5c4086['length'];if(!_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x3a')](_0xdfb3('0x3b'))){_0x528b63[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x11f829['query'][_0xdfb3('0x28')]);_0x528b63[_0xdfb3('0x27')]=qs[_0xdfb3('0x27')](_0x11f829[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0xffcd0e[_0xdfb3('0x54')](_0x528b63);}})['then'](function(_0x57f8f3){if(_0x57f8f3){return _0x57f8f3?{'count':_0x22a3a0,'rows':_0x57f8f3}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x448451,null))[_0xdfb3('0x23')](handleError(_0x448451,null));};exports[_0xdfb3('0x55')]=function(_0x40cadb,_0x1649ce,_0x1aee3d){var _0x383cfd={};var _0x12eef2={};var _0x337899;var _0x49c40d;return db['ZohoConfiguration'][_0xdfb3('0x52')]({'where':{'id':_0x40cadb[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x1649ce,null))[_0xdfb3('0x1a')](function(_0x35d714){if(_0x35d714){_0x337899=_0x35d714;_0x12eef2[_0xdfb3('0x35')]=_['keys'](db['ZohoField'][_0xdfb3('0x34')]);_0x12eef2[_0xdfb3('0x36')]=_['keys'](_0x40cadb[_0xdfb3('0x36')]);_0x12eef2[_0xdfb3('0x3d')]=_[_0xdfb3('0x37')](_0x12eef2[_0xdfb3('0x35')],_0x12eef2[_0xdfb3('0x36')]);_0x383cfd['attributes']=_['intersection'](_0x12eef2[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x40cadb['query'][_0xdfb3('0x39')]));_0x383cfd[_0xdfb3('0x38')]=_0x383cfd[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x383cfd[_0xdfb3('0x38')]:_0x12eef2[_0xdfb3('0x35')];_0x383cfd[_0xdfb3('0x56')]=qs[_0xdfb3('0x3c')](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3c')]);_0x383cfd[_0xdfb3('0x40')]=qs[_0xdfb3('0x3d')](_[_0xdfb3('0x3e')](_0x40cadb[_0xdfb3('0x36')],_0x12eef2[_0xdfb3('0x3d')]));if(_0x40cadb[_0xdfb3('0x36')]['filter']){_0x383cfd[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x383cfd[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x383cfd[_0xdfb3('0x38')],function(_0x41dfcf){var _0x3437c8={};_0x3437c8[_0x41dfcf]={'$like':'%'+_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3f')]+'%'};return _0x3437c8;})});}_0x383cfd=_['merge']({},_0x383cfd,_0x40cadb[_0xdfb3('0x46')]);return _0x337899[_0xdfb3('0x55')](_0x383cfd);}})[_0xdfb3('0x1a')](function(_0x4679e6){if(_0x4679e6){_0x49c40d=_0x4679e6[_0xdfb3('0x4d')];if(!_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x3a')]('nolimit')){_0x383cfd[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0x383cfd[_0xdfb3('0x27')]=qs['offset'](_0x40cadb[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0x337899[_0xdfb3('0x55')](_0x383cfd);}})[_0xdfb3('0x1a')](function(_0x1181fc){if(_0x1181fc){return _0x1181fc?{'count':_0x49c40d,'rows':_0x1181fc}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x1649ce,null))[_0xdfb3('0x23')](handleError(_0x1649ce,null));};exports[_0xdfb3('0x57')]=function(_0x40e618,_0x2be8bb,_0x5f5369){var _0x449ab4={};var _0x20da57={};var _0x3f4f57;var _0x2556a9;return db[_0xdfb3('0x33')][_0xdfb3('0x52')]({'where':{'id':_0x40e618[_0xdfb3('0x51')]['id']}})[_0xdfb3('0x1a')](handleEntityNotFound(_0x2be8bb,null))[_0xdfb3('0x1a')](function(_0xd33b65){if(_0xd33b65){_0x3f4f57=_0xd33b65;_0x20da57[_0xdfb3('0x35')]=_[_0xdfb3('0x4c')](db['ZohoField'][_0xdfb3('0x34')]);_0x20da57[_0xdfb3('0x36')]=_['keys'](_0x40e618['query']);_0x20da57[_0xdfb3('0x3d')]=_['intersection'](_0x20da57[_0xdfb3('0x35')],_0x20da57[_0xdfb3('0x36')]);_0x449ab4['attributes']=_[_0xdfb3('0x37')](_0x20da57[_0xdfb3('0x35')],qs[_0xdfb3('0x39')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x39')]));_0x449ab4[_0xdfb3('0x38')]=_0x449ab4[_0xdfb3('0x38')][_0xdfb3('0x4d')]?_0x449ab4[_0xdfb3('0x38')]:_0x20da57[_0xdfb3('0x35')];_0x449ab4[_0xdfb3('0x56')]=qs['sort'](_0x40e618['query']['sort']);_0x449ab4[_0xdfb3('0x40')]=qs['filters'](_[_0xdfb3('0x3e')](_0x40e618[_0xdfb3('0x36')],_0x20da57[_0xdfb3('0x3d')]));if(_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x3f')]){_0x449ab4[_0xdfb3('0x40')]=_[_0xdfb3('0x41')](_0x449ab4[_0xdfb3('0x40')],{'$or':_[_0xdfb3('0x42')](_0x449ab4['attributes'],function(_0x4d9c7c){var _0x9dbd32={};_0x9dbd32[_0x4d9c7c]={'$like':'%'+_0x40e618['query'][_0xdfb3('0x3f')]+'%'};return _0x9dbd32;})});}_0x449ab4=_[_0xdfb3('0x41')]({},_0x449ab4,_0x40e618[_0xdfb3('0x46')]);return _0x3f4f57['getDescriptions'](_0x449ab4);}})['then'](function(_0x4bc44f){if(_0x4bc44f){_0x2556a9=_0x4bc44f['length'];if(!_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x3a')]('nolimit')){_0x449ab4[_0xdfb3('0x28')]=qs[_0xdfb3('0x28')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x28')]);_0x449ab4[_0xdfb3('0x27')]=qs[_0xdfb3('0x27')](_0x40e618[_0xdfb3('0x36')][_0xdfb3('0x27')]);}return _0x3f4f57['getDescriptions'](_0x449ab4);}})[_0xdfb3('0x1a')](function(_0x5731ee){if(_0x5731ee){return _0x5731ee?{'count':_0x2556a9,'rows':_0x5731ee}:null;}})[_0xdfb3('0x1a')](respondWithResult(_0x2be8bb,null))[_0xdfb3('0x23')](handleError(_0x2be8bb,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index f680895..6de70df 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x37f34c,_0x40d1c7){var _0x1ace64=function(_0x927ae7){while(--_0x927ae7){_0x37f34c['push'](_0x37f34c['shift']());}};_0x1ace64(++_0x40d1c7);}(_0xe706,0xa3));var _0x6e70=function(_0x2aba17,_0x128a30){_0x2aba17=_0x2aba17-0x0;var _0x5a9599=_0xe706[_0x2aba17];return _0x5a9599;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eb8=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird'];(function(_0x164bb2,_0x194924){var _0xd16526=function(_0x42eb4a){while(--_0x42eb4a){_0x164bb2['push'](_0x164bb2['shift']());}};_0xd16526(++_0x194924);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x5eb8[_0x5bff0];return _0x3ead2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index d2526c3..6ca2939 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 _0x03df=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0xc300b8,_0x29d449){var _0x28861f=function(_0x5d39b0){while(--_0x5d39b0){_0xc300b8['push'](_0xc300b8['shift']());}};_0x28861f(++_0x29d449);}(_0x03df,0x11c));var _0xf03d=function(_0x58c911,_0x5d1227){_0x58c911=_0x58c911-0x0;var _0x394dfd=_0x03df[_0x58c911];return _0x394dfd;};'use strict';var _=require(_0xf03d('0x0'));var util=require(_0xf03d('0x1'));var moment=require(_0xf03d('0x2'));var BPromise=require(_0xf03d('0x3'));var rs=require(_0xf03d('0x4'));var fs=require('fs');var Redis=require(_0xf03d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03d('0x6'));var logger=require(_0xf03d('0x7'))(_0xf03d('0x8'));var config=require(_0xf03d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf03d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53d9e8,_0x46cfdf,_0x2e929a){return new BPromise(function(_0x275c2b,_0x3c3f70){return client[_0xf03d('0xb')](_0x53d9e8,_0x2e929a)[_0xf03d('0xc')](function(_0x26c4f1){logger[_0xf03d('0xd')](_0xf03d('0xe'),_0x46cfdf,_0xf03d('0xf'));logger[_0xf03d('0x10')](_0xf03d('0x11'),_0x46cfdf,'request\x20sent',JSON[_0xf03d('0x12')](_0x26c4f1));if(_0x26c4f1[_0xf03d('0x13')]){if(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x46cfdf,_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);return _0x3c3f70(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);}logger['error'](_0xf03d('0xe'),_0x46cfdf,_0x26c4f1[_0xf03d('0x13')]['message']);return _0x275c2b(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);}else{logger['info'](_0xf03d('0xe'),_0x46cfdf,'request\x20sent');_0x275c2b(_0x26c4f1[_0xf03d('0x16')][_0xf03d('0x15')]);}})[_0xf03d('0x17')](function(_0xaabcd9){logger['error'](_0xf03d('0xe'),_0x46cfdf,_0xaabcd9);_0x3c3f70(_0xaabcd9);});});} \ No newline at end of file +var _0x4ba1=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46ee3c,_0x1c08f0){var _0x530a97=function(_0x194bba){while(--_0x194bba){_0x46ee3c['push'](_0x46ee3c['shift']());}};_0x530a97(++_0x1c08f0);}(_0x4ba1,0x14b));var _0x14ba=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x4ba1[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var moment=require(_0x14ba('0x2'));var BPromise=require(_0x14ba('0x3'));var rs=require(_0x14ba('0x4'));var fs=require('fs');var Redis=require(_0x14ba('0x5'));var db=require(_0x14ba('0x6'))['db'];var utils=require(_0x14ba('0x7'));var logger=require(_0x14ba('0x8'))(_0x14ba('0x9'));var config=require(_0x14ba('0xa'));var jayson=require(_0x14ba('0xb'));var client=jayson[_0x14ba('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbe80d0,_0x245dde,_0x4a3005){return new BPromise(function(_0x205081,_0x1e40d0){return client[_0x14ba('0xd')](_0xbe80d0,_0x4a3005)[_0x14ba('0xe')](function(_0x569b42){logger[_0x14ba('0xf')](_0x14ba('0x10'),_0x245dde,_0x14ba('0x11'));logger[_0x14ba('0x12')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x245dde,_0x14ba('0x11'),JSON[_0x14ba('0x13')](_0x569b42));if(_0x569b42['error']){if(_0x569b42[_0x14ba('0x14')][_0x14ba('0x15')]===0x1f4){logger[_0x14ba('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x245dde,_0x569b42[_0x14ba('0x14')][_0x14ba('0x16')]);return _0x1e40d0(_0x569b42['error'][_0x14ba('0x16')]);}logger[_0x14ba('0x14')](_0x14ba('0x10'),_0x245dde,_0x569b42[_0x14ba('0x14')]['message']);return _0x205081(_0x569b42['error']['message']);}else{logger['info'](_0x14ba('0x10'),_0x245dde,'request\x20sent');_0x205081(_0x569b42[_0x14ba('0x17')][_0x14ba('0x16')]);}})[_0x14ba('0x18')](function(_0x7a7584){logger[_0x14ba('0x14')](_0x14ba('0x10'),_0x245dde,_0x7a7584);_0x1e40d0(_0x7a7584);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index bf9fe26..c739b3e 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 _0x12ff=['index','/:id','post','isAuthenticated','create','update','delete','destroy','exports','util','path','express','Router','../../config/environment','./intZohoField.controller','get'];(function(_0x313139,_0x50cbee){var _0x4fb243=function(_0x250ac2){while(--_0x250ac2){_0x313139['push'](_0x313139['shift']());}};_0x4fb243(++_0x50cbee);}(_0x12ff,0x149));var _0xf12f=function(_0x2d5df5,_0x282cba){_0x2d5df5=_0x2d5df5-0x0;var _0x48d803=_0x12ff[_0x2d5df5];return _0x48d803;};'use strict';var multer=require('multer');var util=require(_0xf12f('0x0'));var path=require(_0xf12f('0x1'));var timeout=require('connect-timeout');var express=require(_0xf12f('0x2'));var router=express[_0xf12f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf12f('0x4'));var controller=require(_0xf12f('0x5'));router[_0xf12f('0x6')]('/',auth['isAuthenticated'](),controller[_0xf12f('0x7')]);router[_0xf12f('0x6')](_0xf12f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xf12f('0x9')]('/',auth[_0xf12f('0xa')](),controller[_0xf12f('0xb')]);router['put'](_0xf12f('0x8'),auth['isAuthenticated'](),controller[_0xf12f('0xc')]);router[_0xf12f('0xd')](_0xf12f('0x8'),auth[_0xf12f('0xa')](),controller[_0xf12f('0xe')]);module[_0xf12f('0xf')]=router; \ No newline at end of file +var _0x480b=['post','create','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x592f0c,_0x22cee8){var _0x454845=function(_0x56cbc2){while(--_0x56cbc2){_0x592f0c['push'](_0x592f0c['shift']());}};_0x454845(++_0x22cee8);}(_0x480b,0x16a));var _0xb480=function(_0x286297,_0x1aac9c){_0x286297=_0x286297-0x0;var _0x4146bf=_0x480b[_0x286297];return _0x4146bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb480('0x0'));var timeout=require('connect-timeout');var express=require(_0xb480('0x1'));var router=express[_0xb480('0x2')]();var auth=require(_0xb480('0x3'));var interaction=require(_0xb480('0x4'));var config=require(_0xb480('0x5'));var controller=require(_0xb480('0x6'));router[_0xb480('0x7')]('/',auth['isAuthenticated'](),controller[_0xb480('0x8')]);router[_0xb480('0x7')](_0xb480('0x9'),auth[_0xb480('0xa')](),controller[_0xb480('0xb')]);router[_0xb480('0xc')]('/',auth['isAuthenticated'](),controller[_0xb480('0xd')]);router[_0xb480('0xe')](_0xb480('0x9'),auth[_0xb480('0xa')](),controller[_0xb480('0xf')]);router['delete'](_0xb480('0x9'),auth[_0xb480('0xa')](),controller['destroy']);module[_0xb480('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index dcba2ea..cff9291 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 _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3c81,0x102));var _0x13c8=function(_0x33a99c,_0x41f4b2){_0x33a99c=_0x33a99c-0x0;var _0x5956ae=_0x3c81[_0x33a99c];return _0x5956ae;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa571=['exports','ENUM','string','customVariable','keyValue','STRING','variable','sequelize'];(function(_0x243358,_0x26775b){var _0x3d3b27=function(_0xf57311){while(--_0xf57311){_0x243358['push'](_0x243358['shift']());}};_0x3d3b27(++_0x26775b);}(_0xa571,0x107));var _0x1a57=function(_0x2d015c,_0x31bb7e){_0x2d015c=_0x2d015c-0x0;var _0x403093=_0xa571[_0x2d015c];return _0x403093;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'type':{'type':Sequelize[_0x1a57('0x2')](_0x1a57('0x3'),'variable',_0x1a57('0x4'),_0x1a57('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a57('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1a57('0x3'),_0x1a57('0x7'),_0x1a57('0x4'))},'keyContent':{'type':Sequelize[_0x1a57('0x6')]},'idField':{'type':Sequelize[_0x1a57('0x6')]},'nameField':{'type':Sequelize[_0x1a57('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a57('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4eccebe..722b33d 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 _0xf2f3=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','stack','name','send','ZohoField','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','field','includeAll','catch','show','params','length','include','options','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger'];(function(_0x1d1884,_0x437c94){var _0x16d120=function(_0x815287){while(--_0x815287){_0x1d1884['push'](_0x1d1884['shift']());}};_0x16d120(++_0x437c94);}(_0xf2f3,0x1d0));var _0x3f2f=function(_0x390702,_0x1298c3){_0x390702=_0x390702-0x0;var _0x2072ce=_0xf2f3[_0x390702];return _0x2072ce;};'use strict';var pdf=require(_0x3f2f('0x0'));var emlformat=require(_0x3f2f('0x1'));var rimraf=require(_0x3f2f('0x2'));var zipdir=require(_0x3f2f('0x3'));var jsonpatch=require(_0x3f2f('0x4'));var rp=require(_0x3f2f('0x5'));var moment=require(_0x3f2f('0x6'));var BPromise=require(_0x3f2f('0x7'));var Mustache=require(_0x3f2f('0x8'));var util=require('util');var path=require('path');var sox=require(_0x3f2f('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2f('0xa'));var fs=require('fs');var _=require(_0x3f2f('0xb'));var squel=require(_0x3f2f('0xc'));var crypto=require(_0x3f2f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3f2f('0xe'));var querystring=require(_0x3f2f('0xf'));var Papa=require(_0x3f2f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f2f('0x12'))(_0x3f2f('0x13'));var utils=require(_0x3f2f('0x14'));var config=require(_0x3f2f('0x15'));var db=require(_0x3f2f('0x16'))['db'];function respondWithStatusCode(_0x5296ee,_0x42b7eb){_0x42b7eb=_0x42b7eb||0xcc;return function(_0x1c0047){if(_0x1c0047){return _0x5296ee[_0x3f2f('0x17')](_0x42b7eb);}return _0x5296ee[_0x3f2f('0x18')](_0x42b7eb)[_0x3f2f('0x19')]();};}function respondWithResult(_0x41c4ae,_0xa799c4){_0xa799c4=_0xa799c4||0xc8;return function(_0x227533){if(_0x227533){return _0x41c4ae['status'](_0xa799c4)[_0x3f2f('0x1a')](_0x227533);}};}function respondWithFilteredResult(_0x2e9db2,_0x418640){return function(_0x3cf4bb){if(_0x3cf4bb){var _0x976cdf=_0x3cf4bb[_0x3f2f('0x1b')],_0x5b0981=_0x418640[_0x3f2f('0x1c')],_0x48ded1=_0x418640[_0x3f2f('0x1c')]+_0x418640['limit'],_0x576120;if(_0x48ded1>=_0x976cdf){_0x48ded1=_0x976cdf;_0x576120=0xc8;}else{_0x576120=0xce;}_0x2e9db2[_0x3f2f('0x18')](_0x576120);return _0x2e9db2[_0x3f2f('0x1d')]('Content-Range',_0x5b0981+'-'+_0x48ded1+'/'+_0x976cdf)[_0x3f2f('0x1a')](_0x3cf4bb);}return null;};}function patchUpdates(_0x545b23){return function(_0x5dfdf5){try{jsonpatch[_0x3f2f('0x1e')](_0x5dfdf5,_0x545b23,!![]);}catch(_0x428bad){return BPromise[_0x3f2f('0x1f')](_0x428bad);}return _0x5dfdf5[_0x3f2f('0x20')]();};}function saveUpdates(_0x28403b,_0x57a466){return function(_0x46dc54){if(_0x46dc54){return _0x46dc54['update'](_0x28403b)[_0x3f2f('0x21')](function(_0x6855d6){return _0x6855d6;});}return null;};}function removeEntity(_0x5aac97,_0x926598){return function(_0x179619){if(_0x179619){return _0x179619[_0x3f2f('0x22')]()[_0x3f2f('0x21')](function(){_0x5aac97[_0x3f2f('0x18')](0xcc)[_0x3f2f('0x19')]();});}};}function handleEntityNotFound(_0x4f0e3a,_0x44c61c){return function(_0x32e397){if(!_0x32e397){_0x4f0e3a[_0x3f2f('0x17')](0x194);}return _0x32e397;};}function handleError(_0x10efb1,_0x195999){_0x195999=_0x195999||0x1f4;return function(_0x1dfd52){logger['error'](_0x1dfd52[_0x3f2f('0x23')]);if(_0x1dfd52[_0x3f2f('0x24')]){delete _0x1dfd52['name'];}_0x10efb1[_0x3f2f('0x18')](_0x195999)[_0x3f2f('0x25')](_0x1dfd52);};}exports['index']=function(_0x5f482e,_0x2ec4d4){var _0xa7ead5={},_0xa647b0={},_0x426d90={'count':0x0,'rows':[]};var _0x82ab27=db[_0x3f2f('0x26')][_0x3f2f('0x27')];_0xa647b0[_0x3f2f('0x28')]=_[_0x3f2f('0x29')](_0x82ab27);_0xa647b0[_0x3f2f('0x2a')]=_[_0x3f2f('0x29')](_0x5f482e[_0x3f2f('0x2a')]);_0xa647b0['filters']=_[_0x3f2f('0x2b')](_0xa647b0[_0x3f2f('0x28')],_0xa647b0[_0x3f2f('0x2a')]);_0xa7ead5[_0x3f2f('0x2c')]=_['intersection'](_0xa647b0[_0x3f2f('0x28')],qs[_0x3f2f('0x2d')](_0x5f482e[_0x3f2f('0x2a')]['fields']));_0xa7ead5['attributes']=_0xa7ead5[_0x3f2f('0x2c')]['length']?_0xa7ead5[_0x3f2f('0x2c')]:_0xa647b0[_0x3f2f('0x28')];if(!_0x5f482e[_0x3f2f('0x2a')]['hasOwnProperty'](_0x3f2f('0x2e'))){_0xa7ead5['limit']=qs[_0x3f2f('0x2f')](_0x5f482e[_0x3f2f('0x2a')]['limit']);_0xa7ead5[_0x3f2f('0x1c')]=qs[_0x3f2f('0x1c')](_0x5f482e[_0x3f2f('0x2a')]['offset']);}_0xa7ead5[_0x3f2f('0x30')]=qs[_0x3f2f('0x31')](_0x5f482e['query'][_0x3f2f('0x31')]);_0xa7ead5[_0x3f2f('0x32')]=qs[_0x3f2f('0x33')](_[_0x3f2f('0x34')](_0x5f482e[_0x3f2f('0x2a')],_0xa647b0[_0x3f2f('0x33')]));if(_0x5f482e[_0x3f2f('0x2a')][_0x3f2f('0x35')]){_0xa7ead5[_0x3f2f('0x32')]=_[_0x3f2f('0x36')](_0xa7ead5['where'],{'$or':_[_0x3f2f('0x37')](_0x82ab27,function(_0x32304b){if(_0x32304b['type'][_0x3f2f('0x38')]!=='VIRTUAL'){var _0x39a791={};_0x39a791[_0x32304b[_0x3f2f('0x39')]]={'$like':'%'+_0x5f482e['query']['filter']+'%'};return _0x39a791;}})});}_0xa7ead5=_['merge']({},_0xa7ead5,_0x5f482e['options']);var _0xf5983c={'where':_0xa7ead5[_0x3f2f('0x32')]};return db[_0x3f2f('0x26')]['count'](_0xf5983c)[_0x3f2f('0x21')](function(_0x183915){_0x426d90[_0x3f2f('0x1b')]=_0x183915;if(_0x5f482e[_0x3f2f('0x2a')][_0x3f2f('0x3a')]){_0xa7ead5['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0xa7ead5);})[_0x3f2f('0x21')](function(_0x40c846){_0x426d90['rows']=_0x40c846;return _0x426d90;})[_0x3f2f('0x21')](respondWithFilteredResult(_0x2ec4d4,_0xa7ead5))[_0x3f2f('0x3b')](handleError(_0x2ec4d4,null));};exports[_0x3f2f('0x3c')]=function(_0x5de055,_0x556e98){var _0x3f0ea4={'raw':!![],'where':{'id':_0x5de055[_0x3f2f('0x3d')]['id']}},_0x4f3332={};_0x4f3332[_0x3f2f('0x28')]=_[_0x3f2f('0x29')](db['ZohoField'][_0x3f2f('0x27')]);_0x4f3332['query']=_[_0x3f2f('0x29')](_0x5de055['query']);_0x4f3332[_0x3f2f('0x33')]=_[_0x3f2f('0x2b')](_0x4f3332[_0x3f2f('0x28')],_0x4f3332[_0x3f2f('0x2a')]);_0x3f0ea4['attributes']=_[_0x3f2f('0x2b')](_0x4f3332[_0x3f2f('0x28')],qs[_0x3f2f('0x2d')](_0x5de055[_0x3f2f('0x2a')]['fields']));_0x3f0ea4[_0x3f2f('0x2c')]=_0x3f0ea4[_0x3f2f('0x2c')][_0x3f2f('0x3e')]?_0x3f0ea4[_0x3f2f('0x2c')]:_0x4f3332['model'];if(_0x5de055['query'][_0x3f2f('0x3a')]){_0x3f0ea4[_0x3f2f('0x3f')]=[{'all':!![]}];}_0x3f0ea4=_[_0x3f2f('0x36')]({},_0x3f0ea4,_0x5de055[_0x3f2f('0x40')]);return db[_0x3f2f('0x26')][_0x3f2f('0x41')](_0x3f0ea4)[_0x3f2f('0x21')](handleEntityNotFound(_0x556e98,null))[_0x3f2f('0x21')](respondWithResult(_0x556e98,null))[_0x3f2f('0x3b')](handleError(_0x556e98,null));};exports[_0x3f2f('0x42')]=function(_0x1e3fcf,_0x176a8a){return db[_0x3f2f('0x26')][_0x3f2f('0x42')](_0x1e3fcf[_0x3f2f('0x43')],{})[_0x3f2f('0x21')](respondWithResult(_0x176a8a,0xc9))['catch'](handleError(_0x176a8a,null));};exports[_0x3f2f('0x44')]=function(_0x3968b0,_0x3f8f57){if(_0x3968b0[_0x3f2f('0x43')]['id']){delete _0x3968b0['body']['id'];}return db[_0x3f2f('0x26')][_0x3f2f('0x41')]({'where':{'id':_0x3968b0[_0x3f2f('0x3d')]['id']}})[_0x3f2f('0x21')](handleEntityNotFound(_0x3f8f57,null))[_0x3f2f('0x21')](saveUpdates(_0x3968b0[_0x3f2f('0x43')],null))['then'](respondWithResult(_0x3f8f57,null))[_0x3f2f('0x3b')](handleError(_0x3f8f57,null));};exports['destroy']=function(_0x55a4bb,_0x348b25){return db['ZohoField']['find']({'where':{'id':_0x55a4bb['params']['id']}})['then'](handleEntityNotFound(_0x348b25,null))[_0x3f2f('0x21')](removeEntity(_0x348b25,null))[_0x3f2f('0x3b')](handleError(_0x348b25,null));}; \ No newline at end of file +var _0xc573=['fields','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','json','apply','reject','save','then','destroy','end','stack','name','index','rawAttributes','model','keys','filters','intersection','query','attributes'];(function(_0x123493,_0x2a95c8){var _0x5257bd=function(_0x377c6d){while(--_0x377c6d){_0x123493['push'](_0x123493['shift']());}};_0x5257bd(++_0x2a95c8);}(_0xc573,0x12d));var _0x3c57=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc573[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x3c57('0x0'));var emlformat=require(_0x3c57('0x1'));var rimraf=require(_0x3c57('0x2'));var zipdir=require(_0x3c57('0x3'));var jsonpatch=require(_0x3c57('0x4'));var rp=require(_0x3c57('0x5'));var moment=require(_0x3c57('0x6'));var BPromise=require(_0x3c57('0x7'));var Mustache=require(_0x3c57('0x8'));var util=require(_0x3c57('0x9'));var path=require(_0x3c57('0xa'));var sox=require('sox');var csv=require(_0x3c57('0xb'));var ejs=require(_0x3c57('0xc'));var fs=require('fs');var _=require(_0x3c57('0xd'));var squel=require(_0x3c57('0xe'));var crypto=require(_0x3c57('0xf'));var jsforce=require(_0x3c57('0x10'));var deskjs=require(_0x3c57('0x11'));var toCsv=require(_0x3c57('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3c57('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c57('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3c57('0x14'));var db=require(_0x3c57('0x15'))['db'];function respondWithStatusCode(_0x57fe4b,_0x103b20){_0x103b20=_0x103b20||0xcc;return function(_0x11a7c9){if(_0x11a7c9){return _0x57fe4b[_0x3c57('0x16')](_0x103b20);}return _0x57fe4b[_0x3c57('0x17')](_0x103b20)['end']();};}function respondWithResult(_0x4743f2,_0x13050b){_0x13050b=_0x13050b||0xc8;return function(_0xf7c873){if(_0xf7c873){return _0x4743f2[_0x3c57('0x17')](_0x13050b)['json'](_0xf7c873);}};}function respondWithFilteredResult(_0x2cda8e,_0x29682c){return function(_0x58911b){if(_0x58911b){var _0x21ccce=_0x58911b[_0x3c57('0x18')],_0x3cada7=_0x29682c[_0x3c57('0x19')],_0x4f7eef=_0x29682c[_0x3c57('0x19')]+_0x29682c[_0x3c57('0x1a')],_0x20506b;if(_0x4f7eef>=_0x21ccce){_0x4f7eef=_0x21ccce;_0x20506b=0xc8;}else{_0x20506b=0xce;}_0x2cda8e[_0x3c57('0x17')](_0x20506b);return _0x2cda8e['set']('Content-Range',_0x3cada7+'-'+_0x4f7eef+'/'+_0x21ccce)[_0x3c57('0x1b')](_0x58911b);}return null;};}function patchUpdates(_0x583db0){return function(_0x5e0341){try{jsonpatch[_0x3c57('0x1c')](_0x5e0341,_0x583db0,!![]);}catch(_0x3323c8){return BPromise[_0x3c57('0x1d')](_0x3323c8);}return _0x5e0341[_0x3c57('0x1e')]();};}function saveUpdates(_0x3954f6,_0x22773d){return function(_0x42f626){if(_0x42f626){return _0x42f626['update'](_0x3954f6)[_0x3c57('0x1f')](function(_0x10b517){return _0x10b517;});}return null;};}function removeEntity(_0xc3dc2b,_0x4f5e4c){return function(_0x5584b9){if(_0x5584b9){return _0x5584b9[_0x3c57('0x20')]()[_0x3c57('0x1f')](function(){_0xc3dc2b[_0x3c57('0x17')](0xcc)[_0x3c57('0x21')]();});}};}function handleEntityNotFound(_0xa8ed0b,_0x6f8bb1){return function(_0x34d1b7){if(!_0x34d1b7){_0xa8ed0b[_0x3c57('0x16')](0x194);}return _0x34d1b7;};}function handleError(_0x23e5db,_0x305b82){_0x305b82=_0x305b82||0x1f4;return function(_0x3d55b1){logger['error'](_0x3d55b1[_0x3c57('0x22')]);if(_0x3d55b1[_0x3c57('0x23')]){delete _0x3d55b1[_0x3c57('0x23')];}_0x23e5db[_0x3c57('0x17')](_0x305b82)['send'](_0x3d55b1);};}exports[_0x3c57('0x24')]=function(_0x3dbbe3,_0xd7ddb){var _0x5efa86={},_0x4826d9={},_0x62060a={'count':0x0,'rows':[]};var _0x20a6e2=db['ZohoField'][_0x3c57('0x25')];_0x4826d9[_0x3c57('0x26')]=_[_0x3c57('0x27')](_0x20a6e2);_0x4826d9['query']=_[_0x3c57('0x27')](_0x3dbbe3['query']);_0x4826d9[_0x3c57('0x28')]=_[_0x3c57('0x29')](_0x4826d9[_0x3c57('0x26')],_0x4826d9[_0x3c57('0x2a')]);_0x5efa86[_0x3c57('0x2b')]=_[_0x3c57('0x29')](_0x4826d9[_0x3c57('0x26')],qs['fields'](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x2c')]));_0x5efa86['attributes']=_0x5efa86[_0x3c57('0x2b')]['length']?_0x5efa86[_0x3c57('0x2b')]:_0x4826d9[_0x3c57('0x26')];if(!_0x3dbbe3[_0x3c57('0x2a')]['hasOwnProperty'](_0x3c57('0x2d'))){_0x5efa86[_0x3c57('0x1a')]=qs[_0x3c57('0x1a')](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x1a')]);_0x5efa86[_0x3c57('0x19')]=qs[_0x3c57('0x19')](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x19')]);}_0x5efa86[_0x3c57('0x2e')]=qs['sort'](_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x2f')]);_0x5efa86[_0x3c57('0x30')]=qs[_0x3c57('0x28')](_[_0x3c57('0x31')](_0x3dbbe3['query'],_0x4826d9['filters']));if(_0x3dbbe3[_0x3c57('0x2a')][_0x3c57('0x32')]){_0x5efa86[_0x3c57('0x30')]=_['merge'](_0x5efa86[_0x3c57('0x30')],{'$or':_[_0x3c57('0x33')](_0x20a6e2,function(_0x49580a){if(_0x49580a['type'][_0x3c57('0x34')]!==_0x3c57('0x35')){var _0x44e9d5={};_0x44e9d5[_0x49580a[_0x3c57('0x36')]]={'$like':'%'+_0x3dbbe3['query'][_0x3c57('0x32')]+'%'};return _0x44e9d5;}})});}_0x5efa86=_[_0x3c57('0x37')]({},_0x5efa86,_0x3dbbe3[_0x3c57('0x38')]);var _0x444a68={'where':_0x5efa86['where']};return db[_0x3c57('0x39')][_0x3c57('0x18')](_0x444a68)[_0x3c57('0x1f')](function(_0x22506e){_0x62060a['count']=_0x22506e;if(_0x3dbbe3['query'][_0x3c57('0x3a')]){_0x5efa86[_0x3c57('0x3b')]=[{'all':!![]}];}return db[_0x3c57('0x39')][_0x3c57('0x3c')](_0x5efa86);})[_0x3c57('0x1f')](function(_0x2348ba){_0x62060a[_0x3c57('0x3d')]=_0x2348ba;return _0x62060a;})[_0x3c57('0x1f')](respondWithFilteredResult(_0xd7ddb,_0x5efa86))[_0x3c57('0x3e')](handleError(_0xd7ddb,null));};exports[_0x3c57('0x3f')]=function(_0x17d5eb,_0x52278e){var _0x5dc3e3={'raw':!![],'where':{'id':_0x17d5eb[_0x3c57('0x40')]['id']}},_0x234e6b={};_0x234e6b['model']=_[_0x3c57('0x27')](db[_0x3c57('0x39')][_0x3c57('0x25')]);_0x234e6b[_0x3c57('0x2a')]=_[_0x3c57('0x27')](_0x17d5eb[_0x3c57('0x2a')]);_0x234e6b[_0x3c57('0x28')]=_[_0x3c57('0x29')](_0x234e6b[_0x3c57('0x26')],_0x234e6b[_0x3c57('0x2a')]);_0x5dc3e3[_0x3c57('0x2b')]=_[_0x3c57('0x29')](_0x234e6b[_0x3c57('0x26')],qs[_0x3c57('0x2c')](_0x17d5eb['query'][_0x3c57('0x2c')]));_0x5dc3e3['attributes']=_0x5dc3e3[_0x3c57('0x2b')]['length']?_0x5dc3e3[_0x3c57('0x2b')]:_0x234e6b[_0x3c57('0x26')];if(_0x17d5eb[_0x3c57('0x2a')][_0x3c57('0x3a')]){_0x5dc3e3[_0x3c57('0x3b')]=[{'all':!![]}];}_0x5dc3e3=_['merge']({},_0x5dc3e3,_0x17d5eb[_0x3c57('0x38')]);return db[_0x3c57('0x39')][_0x3c57('0x41')](_0x5dc3e3)[_0x3c57('0x1f')](handleEntityNotFound(_0x52278e,null))[_0x3c57('0x1f')](respondWithResult(_0x52278e,null))[_0x3c57('0x3e')](handleError(_0x52278e,null));};exports['create']=function(_0x24a613,_0x3cf7ac){return db[_0x3c57('0x39')][_0x3c57('0x42')](_0x24a613[_0x3c57('0x43')],{})[_0x3c57('0x1f')](respondWithResult(_0x3cf7ac,0xc9))[_0x3c57('0x3e')](handleError(_0x3cf7ac,null));};exports[_0x3c57('0x44')]=function(_0x17c6b5,_0x2df977){if(_0x17c6b5[_0x3c57('0x43')]['id']){delete _0x17c6b5['body']['id'];}return db[_0x3c57('0x39')][_0x3c57('0x41')]({'where':{'id':_0x17c6b5['params']['id']}})[_0x3c57('0x1f')](handleEntityNotFound(_0x2df977,null))[_0x3c57('0x1f')](saveUpdates(_0x17c6b5[_0x3c57('0x43')],null))[_0x3c57('0x1f')](respondWithResult(_0x2df977,null))[_0x3c57('0x3e')](handleError(_0x2df977,null));};exports[_0x3c57('0x20')]=function(_0x1e5cf9,_0x41af81){return db[_0x3c57('0x39')][_0x3c57('0x41')]({'where':{'id':_0x1e5cf9[_0x3c57('0x40')]['id']}})[_0x3c57('0x1f')](handleEntityNotFound(_0x41af81,null))['then'](removeEntity(_0x41af81,null))['catch'](handleError(_0x41af81,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5324fc1..2926e14 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 _0xb3a5=['FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField'];(function(_0x3c460f,_0x1dcbed){var _0xb5842c=function(_0x4d15bf){while(--_0x4d15bf){_0x3c460f['push'](_0x3c460f['shift']());}};_0xb5842c(++_0x1dcbed);}(_0xb3a5,0x10b));var _0x5b3a=function(_0x36eef2,_0x299892){_0x36eef2=_0x36eef2-0x0;var _0x5aae86=_0xb3a5[_0x36eef2];return _0x5aae86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5b3a('0x0'))(_0x5b3a('0x1'));var moment=require(_0x5b3a('0x2'));var BPromise=require(_0x5b3a('0x3'));var rp=require(_0x5b3a('0x4'));var fs=require('fs');var path=require(_0x5b3a('0x5'));var rimraf=require(_0x5b3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b3a('0x7'));module[_0x5b3a('0x8')]=function(_0xa1d418,_0xe09216){return _0xa1d418[_0x5b3a('0x9')](_0x5b3a('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5b3a('0xb'),'fields':[_0x5b3a('0xc'),_0x5b3a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xede9=['moment','bluebird','request-promise','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','../../config/logger','api'];(function(_0x159ca4,_0x388cc9){var _0x2e9cb2=function(_0x510c57){while(--_0x510c57){_0x159ca4['push'](_0x159ca4['shift']());}};_0x2e9cb2(++_0x388cc9);}(_0xede9,0x1d2));var _0x9ede=function(_0x1b9550,_0x4a40a3){_0x1b9550=_0x1b9550-0x0;var _0x357a3a=_0xede9[_0x1b9550];return _0x357a3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ede('0x0'))(_0x9ede('0x1'));var moment=require(_0x9ede('0x2'));var BPromise=require(_0x9ede('0x3'));var rp=require(_0x9ede('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ede('0x5'));var attributes=require('./intZohoField.attributes');module[_0x9ede('0x6')]=function(_0x16afd3,_0x16dd63){return _0x16afd3[_0x9ede('0x7')](_0x9ede('0x8'),attributes,{'tableName':_0x9ede('0x9'),'paranoid':![],'indexes':[{'name':_0x9ede('0xa'),'fields':['idField',_0x9ede('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 93a8448..67422b5 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 _0xd014=['util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0xc85d23,_0x209ca3){var _0x4bbeef=function(_0x318b97){while(--_0x318b97){_0xc85d23['push'](_0xc85d23['shift']());}};_0x4bbeef(++_0x209ca3);}(_0xd014,0x1c1));var _0x4d01=function(_0x33f643,_0x223ef9){_0x33f643=_0x33f643-0x0;var _0xaf90d5=_0xd014[_0x33f643];return _0xaf90d5;};'use strict';var _=require(_0x4d01('0x0'));var util=require(_0x4d01('0x1'));var moment=require(_0x4d01('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d01('0x4'));var logger=require(_0x4d01('0x5'))('rpc');var config=require(_0x4d01('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d01('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x744bc6,_0x3e7c0f,_0xcb4209){return new BPromise(function(_0x5f39c6,_0xf5416a){return client['request'](_0x744bc6,_0xcb4209)['then'](function(_0x1cf4f6){logger[_0x4d01('0x8')](_0x4d01('0x9'),_0x3e7c0f,_0x4d01('0xa'));logger[_0x4d01('0xb')](_0x4d01('0xc'),_0x3e7c0f,_0x4d01('0xa'),JSON['stringify'](_0x1cf4f6));if(_0x1cf4f6[_0x4d01('0xd')]){if(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xe')]===0x1f4){logger[_0x4d01('0xd')](_0x4d01('0x9'),_0x3e7c0f,_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);return _0xf5416a(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);}logger[_0x4d01('0xd')](_0x4d01('0x9'),_0x3e7c0f,_0x1cf4f6[_0x4d01('0xd')]['message']);return _0x5f39c6(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);}else{logger['info'](_0x4d01('0x9'),_0x3e7c0f,_0x4d01('0xa'));_0x5f39c6(_0x1cf4f6[_0x4d01('0x10')]['message']);}})[_0x4d01('0x11')](function(_0x43b8c0){logger[_0x4d01('0xd')]('ZohoField,\x20%s,\x20%s',_0x3e7c0f,_0x43b8c0);_0xf5416a(_0x43b8c0);});});} \ No newline at end of file +var _0x5dbf=['error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5dbf,0x180));var _0xf5db=function(_0xe11ac7,_0x539367){_0xe11ac7=_0xe11ac7-0x0;var _0x8516e=_0x5dbf[_0xe11ac7];return _0x8516e;};'use strict';var _=require('lodash');var util=require(_0xf5db('0x0'));var moment=require(_0xf5db('0x1'));var BPromise=require(_0xf5db('0x2'));var rs=require(_0xf5db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5db('0x5'))(_0xf5db('0x6'));var config=require(_0xf5db('0x7'));var jayson=require(_0xf5db('0x8'));var client=jayson[_0xf5db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac0e3,_0x4ba8cb,_0x368e0a){return new BPromise(function(_0x2d7f5e,_0xafd30c){return client[_0xf5db('0xa')](_0x1ac0e3,_0x368e0a)['then'](function(_0x322746){logger[_0xf5db('0xb')](_0xf5db('0xc'),_0x4ba8cb,'request\x20sent');logger[_0xf5db('0xd')](_0xf5db('0xe'),_0x4ba8cb,'request\x20sent',JSON['stringify'](_0x322746));if(_0x322746[_0xf5db('0xf')]){if(_0x322746[_0xf5db('0xf')][_0xf5db('0x10')]===0x1f4){logger[_0xf5db('0xf')]('ZohoField,\x20%s,\x20%s',_0x4ba8cb,_0x322746[_0xf5db('0xf')]['message']);return _0xafd30c(_0x322746[_0xf5db('0xf')][_0xf5db('0x11')]);}logger[_0xf5db('0xf')](_0xf5db('0xc'),_0x4ba8cb,_0x322746['error'][_0xf5db('0x11')]);return _0x2d7f5e(_0x322746[_0xf5db('0xf')]['message']);}else{logger[_0xf5db('0xb')](_0xf5db('0xc'),_0x4ba8cb,'request\x20sent');_0x2d7f5e(_0x322746[_0xf5db('0x12')][_0xf5db('0x11')]);}})['catch'](function(_0xd24de2){logger[_0xf5db('0xf')](_0xf5db('0xc'),_0x4ba8cb,_0xd24de2);_0xafd30c(_0xd24de2);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 63c27e9..109c029 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 _0x2f2e=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','express'];(function(_0x1a0c3d,_0x48f6c3){var _0x2a137f=function(_0x2e1710){while(--_0x2e1710){_0x1a0c3d['push'](_0x1a0c3d['shift']());}};_0x2a137f(++_0x48f6c3);}(_0x2f2e,0x146));var _0xe2f2=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x2f2e[_0x2cc0b3];return _0x1667ef;};'use strict';var multer=require('multer');var util=require(_0xe2f2('0x0'));var path=require(_0xe2f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2f2('0x2'));var router=express['Router']();var auth=require(_0xe2f2('0x3'));var interaction=require(_0xe2f2('0x4'));var config=require(_0xe2f2('0x5'));module[_0xe2f2('0x6')]=router; \ No newline at end of file +var _0x3bd7=['../../config/environment','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x34cda7,_0xfd20d4){var _0x2ae028=function(_0x33c78e){while(--_0x33c78e){_0x34cda7['push'](_0x34cda7['shift']());}};_0x2ae028(++_0xfd20d4);}(_0x3bd7,0x199));var _0x73bd=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x3bd7[_0x5c6244];return _0x5800ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73bd('0x0'));var timeout=require(_0x73bd('0x1'));var express=require(_0x73bd('0x2'));var router=express['Router']();var auth=require(_0x73bd('0x3'));var interaction=require(_0x73bd('0x4'));var config=require(_0x73bd('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e390993..86ccbf5 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 _0xc52b=['unique_name_and_version','INTEGER','state','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc52b,0xd5));var _0xbc52=function(_0x17c05a,_0xde01fc){_0x17c05a=_0x17c05a-0x0;var _0x53f984=_0xc52b[_0x17c05a];return _0x53f984;};'use strict';var Sequelize=require('sequelize');module[_0xbc52('0x0')]={'name':{'type':Sequelize[_0xbc52('0x1')],'allowNull':![],'unique':_0xbc52('0x2')},'version':{'type':Sequelize[_0xbc52('0x1')],'allowNull':![],'unique':_0xbc52('0x2')},'main':{'type':Sequelize[_0xbc52('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xbc52('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xbc52('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xbc52('0x1')]},'logo':{'type':Sequelize[_0xbc52('0x1')]},'state':{'type':Sequelize[_0xbc52('0x1')],'unique':_0xbc52('0x4')},'description':{'type':Sequelize[_0xbc52('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc52('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x79c3=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x2494bd,_0x4e04fc){var _0x57e5bd=function(_0x231c2f){while(--_0x231c2f){_0x2494bd['push'](_0x2494bd['shift']());}};_0x57e5bd(++_0x4e04fc);}(_0x79c3,0x1a4));var _0x379c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x79c3[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x379c('0x0'));module[_0x379c('0x1')]={'name':{'type':Sequelize[_0x379c('0x2')],'allowNull':![],'unique':_0x379c('0x3')},'version':{'type':Sequelize[_0x379c('0x2')],'allowNull':![],'unique':_0x379c('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x379c('0x4')},'filename':{'type':Sequelize[_0x379c('0x2')]},'path':{'type':Sequelize[_0x379c('0x2')]},'type':{'type':Sequelize[_0x379c('0x2')]},'size':{'type':Sequelize[_0x379c('0x5')]},'active':{'type':Sequelize[_0x379c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x379c('0x2')]},'logo':{'type':Sequelize[_0x379c('0x2')]},'state':{'type':Sequelize[_0x379c('0x2')],'unique':_0x379c('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x379c('0x2')]},'remoteUri':{'type':Sequelize[_0x379c('0x2')]},'link':{'type':Sequelize[_0x379c('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 226aa39..c9cf2b3 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 _0x6360=['findAll','rows','show','params','intersection','length','includeAll','find','catch','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','Integration','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','type','field','options','count','include'];(function(_0xaff616,_0x5c9424){var _0x3aa4c0=function(_0x2b6448){while(--_0x2b6448){_0xaff616['push'](_0xaff616['shift']());}};_0x3aa4c0(++_0x5c9424);}(_0x6360,0x1e7));var _0x0636=function(_0x3aedac,_0x2f4b1c){_0x3aedac=_0x3aedac-0x0;var _0x55e636=_0x6360[_0x3aedac];return _0x55e636;};'use strict';var pdf=require(_0x0636('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0636('0x1'));var jsonpatch=require(_0x0636('0x2'));var rp=require(_0x0636('0x3'));var moment=require(_0x0636('0x4'));var BPromise=require(_0x0636('0x5'));var Mustache=require(_0x0636('0x6'));var util=require('util');var path=require(_0x0636('0x7'));var sox=require(_0x0636('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0636('0x9'));var jsforce=require(_0x0636('0xa'));var deskjs=require(_0x0636('0xb'));var toCsv=require(_0x0636('0xc'));var querystring=require('querystring');var Papa=require(_0x0636('0xd'));var Redis=require(_0x0636('0xe'));var authService=require(_0x0636('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0636('0x10'));var logger=require(_0x0636('0x11'))('api');var utils=require(_0x0636('0x12'));var config=require(_0x0636('0x13'));var db=require(_0x0636('0x14'))['db'];function respondWithStatusCode(_0x1628fc,_0xca3042){_0xca3042=_0xca3042||0xcc;return function(_0xd39956){if(_0xd39956){return _0x1628fc['sendStatus'](_0xca3042);}return _0x1628fc[_0x0636('0x15')](_0xca3042)['end']();};}function respondWithResult(_0x52593a,_0x15137c){_0x15137c=_0x15137c||0xc8;return function(_0x378ec8){if(_0x378ec8){return _0x52593a['status'](_0x15137c)[_0x0636('0x16')](_0x378ec8);}};}function respondWithFilteredResult(_0xc40a80,_0x2ef41f){return function(_0xb795ca){if(_0xb795ca){var _0x52fe36=_0xb795ca['count'],_0x258fb0=_0x2ef41f[_0x0636('0x17')],_0x5dd798=_0x2ef41f['offset']+_0x2ef41f[_0x0636('0x18')],_0x25b06c;if(_0x5dd798>=_0x52fe36){_0x5dd798=_0x52fe36;_0x25b06c=0xc8;}else{_0x25b06c=0xce;}_0xc40a80[_0x0636('0x15')](_0x25b06c);return _0xc40a80[_0x0636('0x19')](_0x0636('0x1a'),_0x258fb0+'-'+_0x5dd798+'/'+_0x52fe36)[_0x0636('0x16')](_0xb795ca);}return null;};}function patchUpdates(_0x56707a){return function(_0x587c73){try{jsonpatch['apply'](_0x587c73,_0x56707a,!![]);}catch(_0x5222ef){return BPromise[_0x0636('0x1b')](_0x5222ef);}return _0x587c73[_0x0636('0x1c')]();};}function saveUpdates(_0x3c524d,_0x1ccc10){return function(_0xde55d2){if(_0xde55d2){return _0xde55d2[_0x0636('0x1d')](_0x3c524d)[_0x0636('0x1e')](function(_0x25dae3){return _0x25dae3;});}return null;};}function removeEntity(_0x472c41,_0xcaa884){return function(_0x5c7b79){if(_0x5c7b79){return _0x5c7b79[_0x0636('0x1f')]()[_0x0636('0x1e')](function(){_0x472c41[_0x0636('0x15')](0xcc)[_0x0636('0x20')]();});}};}function handleEntityNotFound(_0x5e194b,_0x304888){return function(_0x9897df){if(!_0x9897df){_0x5e194b[_0x0636('0x21')](0x194);}return _0x9897df;};}function handleError(_0x23b700,_0x2d3b96){_0x2d3b96=_0x2d3b96||0x1f4;return function(_0x4e18b8){logger['error'](_0x4e18b8[_0x0636('0x22')]);if(_0x4e18b8[_0x0636('0x23')]){delete _0x4e18b8['name'];}_0x23b700[_0x0636('0x15')](_0x2d3b96)[_0x0636('0x24')](_0x4e18b8);};}exports[_0x0636('0x25')]=function(_0x618a59,_0x5383fe){var _0x5703f7={},_0xf8c860={},_0x91a001={'count':0x0,'rows':[]};var _0x15bf2a=db[_0x0636('0x26')][_0x0636('0x27')];_0xf8c860[_0x0636('0x28')]=_['keys'](_0x15bf2a);_0xf8c860['query']=_[_0x0636('0x29')](_0x618a59[_0x0636('0x2a')]);_0xf8c860[_0x0636('0x2b')]=_['intersection'](_0xf8c860[_0x0636('0x28')],_0xf8c860[_0x0636('0x2a')]);_0x5703f7['attributes']=_['intersection'](_0xf8c860[_0x0636('0x28')],qs[_0x0636('0x2c')](_0x618a59[_0x0636('0x2a')][_0x0636('0x2c')]));_0x5703f7[_0x0636('0x2d')]=_0x5703f7[_0x0636('0x2d')]['length']?_0x5703f7[_0x0636('0x2d')]:_0xf8c860[_0x0636('0x28')];if(!_0x618a59[_0x0636('0x2a')][_0x0636('0x2e')](_0x0636('0x2f'))){_0x5703f7[_0x0636('0x18')]=qs[_0x0636('0x18')](_0x618a59[_0x0636('0x2a')][_0x0636('0x18')]);_0x5703f7[_0x0636('0x17')]=qs[_0x0636('0x17')](_0x618a59[_0x0636('0x2a')][_0x0636('0x17')]);}_0x5703f7['order']=qs['sort'](_0x618a59['query']['sort']);_0x5703f7[_0x0636('0x30')]=qs[_0x0636('0x2b')](_[_0x0636('0x31')](_0x618a59[_0x0636('0x2a')],_0xf8c860[_0x0636('0x2b')]));if(_0x618a59[_0x0636('0x2a')][_0x0636('0x32')]){_0x5703f7[_0x0636('0x30')]=_[_0x0636('0x33')](_0x5703f7['where'],{'$or':_['map'](_0x15bf2a,function(_0x13dd22){if(_0x13dd22[_0x0636('0x34')]['key']!=='VIRTUAL'){var _0x330268={};_0x330268[_0x13dd22[_0x0636('0x35')]]={'$like':'%'+_0x618a59[_0x0636('0x2a')]['filter']+'%'};return _0x330268;}})});}_0x5703f7=_[_0x0636('0x33')]({},_0x5703f7,_0x618a59[_0x0636('0x36')]);var _0x323807={'where':_0x5703f7[_0x0636('0x30')]};return db[_0x0636('0x26')][_0x0636('0x37')](_0x323807)['then'](function(_0x3061aa){_0x91a001['count']=_0x3061aa;if(_0x618a59[_0x0636('0x2a')]['includeAll']){_0x5703f7[_0x0636('0x38')]=[{'all':!![]}];}return db['Integration'][_0x0636('0x39')](_0x5703f7);})[_0x0636('0x1e')](function(_0x223161){_0x91a001[_0x0636('0x3a')]=_0x223161;return _0x91a001;})[_0x0636('0x1e')](respondWithFilteredResult(_0x5383fe,_0x5703f7))['catch'](handleError(_0x5383fe,null));};exports[_0x0636('0x3b')]=function(_0x3607ea,_0x562af6){var _0x4e90c0={'raw':![],'where':{'id':_0x3607ea[_0x0636('0x3c')]['id']}},_0xc30c0e={};_0xc30c0e[_0x0636('0x28')]=_[_0x0636('0x29')](db[_0x0636('0x26')][_0x0636('0x27')]);_0xc30c0e[_0x0636('0x2a')]=_[_0x0636('0x29')](_0x3607ea[_0x0636('0x2a')]);_0xc30c0e[_0x0636('0x2b')]=_[_0x0636('0x3d')](_0xc30c0e[_0x0636('0x28')],_0xc30c0e[_0x0636('0x2a')]);_0x4e90c0[_0x0636('0x2d')]=_[_0x0636('0x3d')](_0xc30c0e[_0x0636('0x28')],qs[_0x0636('0x2c')](_0x3607ea[_0x0636('0x2a')]['fields']));_0x4e90c0[_0x0636('0x2d')]=_0x4e90c0['attributes'][_0x0636('0x3e')]?_0x4e90c0[_0x0636('0x2d')]:_0xc30c0e[_0x0636('0x28')];if(_0x3607ea[_0x0636('0x2a')][_0x0636('0x3f')]){_0x4e90c0[_0x0636('0x38')]=[{'all':!![]}];}_0x4e90c0=_['merge']({},_0x4e90c0,_0x3607ea[_0x0636('0x36')]);return db[_0x0636('0x26')][_0x0636('0x40')](_0x4e90c0)[_0x0636('0x1e')](handleEntityNotFound(_0x562af6,null))[_0x0636('0x1e')](respondWithResult(_0x562af6,null))[_0x0636('0x41')](handleError(_0x562af6,null));};exports[_0x0636('0x42')]=function(_0x56c21c,_0x531fae){return db[_0x0636('0x26')][_0x0636('0x42')](_0x56c21c[_0x0636('0x43')],{})['then'](respondWithResult(_0x531fae,0xc9))[_0x0636('0x41')](handleError(_0x531fae,null));};exports[_0x0636('0x1d')]=function(_0x501e75,_0x40fa10){if(_0x501e75['body']['id']){delete _0x501e75['body']['id'];}return db[_0x0636('0x26')][_0x0636('0x40')]({'where':{'id':_0x501e75[_0x0636('0x3c')]['id']}})[_0x0636('0x1e')](handleEntityNotFound(_0x40fa10,null))[_0x0636('0x1e')](saveUpdates(_0x501e75['body'],null))[_0x0636('0x1e')](respondWithResult(_0x40fa10,null))[_0x0636('0x41')](handleError(_0x40fa10,null));};exports[_0x0636('0x1f')]=function(_0x594e77,_0xc1780a){return db['Integration'][_0x0636('0x40')]({'where':{'id':_0x594e77[_0x0636('0x3c')]['id']}})['then'](handleEntityNotFound(_0xc1780a,null))['then'](removeEntity(_0xc1780a,null))[_0x0636('0x41')](handleError(_0xc1780a,null));}; \ No newline at end of file +var _0x5a91=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','Integration','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','include','findAll','params','includeAll','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x810d09,_0x4adab4){var _0x417828=function(_0x2537a9){while(--_0x2537a9){_0x810d09['push'](_0x810d09['shift']());}};_0x417828(++_0x4adab4);}(_0x5a91,0xc0));var _0x15a9=function(_0x1b5f00,_0x2bba5a){_0x1b5f00=_0x1b5f00-0x0;var _0x235948=_0x5a91[_0x1b5f00];return _0x235948;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x15a9('0x0'));var rimraf=require(_0x15a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15a9('0x2'));var rp=require(_0x15a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15a9('0x4'));var path=require(_0x15a9('0x5'));var sox=require(_0x15a9('0x6'));var csv=require(_0x15a9('0x7'));var ejs=require(_0x15a9('0x8'));var fs=require('fs');var _=require(_0x15a9('0x9'));var squel=require(_0x15a9('0xa'));var crypto=require(_0x15a9('0xb'));var jsforce=require(_0x15a9('0xc'));var deskjs=require(_0x15a9('0xd'));var toCsv=require(_0x15a9('0x7'));var querystring=require(_0x15a9('0xe'));var Papa=require(_0x15a9('0xf'));var Redis=require(_0x15a9('0x10'));var authService=require(_0x15a9('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x15a9('0x12'));var logger=require(_0x15a9('0x13'))(_0x15a9('0x14'));var utils=require(_0x15a9('0x15'));var config=require('../../config/environment');var db=require(_0x15a9('0x16'))['db'];function respondWithStatusCode(_0x4f022e,_0x103ec7){_0x103ec7=_0x103ec7||0xcc;return function(_0x3d67f7){if(_0x3d67f7){return _0x4f022e[_0x15a9('0x17')](_0x103ec7);}return _0x4f022e[_0x15a9('0x18')](_0x103ec7)[_0x15a9('0x19')]();};}function respondWithResult(_0x16ab6c,_0x2a33b3){_0x2a33b3=_0x2a33b3||0xc8;return function(_0x2303d3){if(_0x2303d3){return _0x16ab6c[_0x15a9('0x18')](_0x2a33b3)[_0x15a9('0x1a')](_0x2303d3);}};}function respondWithFilteredResult(_0xb27ca0,_0x1fa23e){return function(_0x4f1b32){if(_0x4f1b32){var _0x8f0878=_0x4f1b32[_0x15a9('0x1b')],_0x3a3365=_0x1fa23e[_0x15a9('0x1c')],_0x404683=_0x1fa23e[_0x15a9('0x1c')]+_0x1fa23e[_0x15a9('0x1d')],_0x3fec7f;if(_0x404683>=_0x8f0878){_0x404683=_0x8f0878;_0x3fec7f=0xc8;}else{_0x3fec7f=0xce;}_0xb27ca0[_0x15a9('0x18')](_0x3fec7f);return _0xb27ca0[_0x15a9('0x1e')]('Content-Range',_0x3a3365+'-'+_0x404683+'/'+_0x8f0878)[_0x15a9('0x1a')](_0x4f1b32);}return null;};}function patchUpdates(_0x55fcf4){return function(_0x58bba2){try{jsonpatch[_0x15a9('0x1f')](_0x58bba2,_0x55fcf4,!![]);}catch(_0x50b8a0){return BPromise[_0x15a9('0x20')](_0x50b8a0);}return _0x58bba2[_0x15a9('0x21')]();};}function saveUpdates(_0x1fc183,_0x35a4dd){return function(_0x8f02af){if(_0x8f02af){return _0x8f02af[_0x15a9('0x22')](_0x1fc183)[_0x15a9('0x23')](function(_0x5f43c9){return _0x5f43c9;});}return null;};}function removeEntity(_0x1b3cae,_0x87f63a){return function(_0x6aaa41){if(_0x6aaa41){return _0x6aaa41[_0x15a9('0x24')]()['then'](function(){_0x1b3cae['status'](0xcc)[_0x15a9('0x19')]();});}};}function handleEntityNotFound(_0x43b354,_0xac44a){return function(_0x19b251){if(!_0x19b251){_0x43b354[_0x15a9('0x17')](0x194);}return _0x19b251;};}function handleError(_0x4e4864,_0x3d195c){_0x3d195c=_0x3d195c||0x1f4;return function(_0x96c5b){logger[_0x15a9('0x25')](_0x96c5b['stack']);if(_0x96c5b[_0x15a9('0x26')]){delete _0x96c5b['name'];}_0x4e4864[_0x15a9('0x18')](_0x3d195c)['send'](_0x96c5b);};}exports[_0x15a9('0x27')]=function(_0x29c8e5,_0x35a1bc){var _0x1fca85={},_0x20c3c0={},_0x1b1f81={'count':0x0,'rows':[]};var _0x436265=db[_0x15a9('0x28')][_0x15a9('0x29')];_0x20c3c0['model']=_[_0x15a9('0x2a')](_0x436265);_0x20c3c0[_0x15a9('0x2b')]=_[_0x15a9('0x2a')](_0x29c8e5[_0x15a9('0x2b')]);_0x20c3c0[_0x15a9('0x2c')]=_[_0x15a9('0x2d')](_0x20c3c0['model'],_0x20c3c0['query']);_0x1fca85[_0x15a9('0x2e')]=_[_0x15a9('0x2d')](_0x20c3c0[_0x15a9('0x2f')],qs[_0x15a9('0x30')](_0x29c8e5[_0x15a9('0x2b')]['fields']));_0x1fca85[_0x15a9('0x2e')]=_0x1fca85['attributes'][_0x15a9('0x31')]?_0x1fca85[_0x15a9('0x2e')]:_0x20c3c0['model'];if(!_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x32')](_0x15a9('0x33'))){_0x1fca85[_0x15a9('0x1d')]=qs['limit'](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x1d')]);_0x1fca85['offset']=qs[_0x15a9('0x1c')](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x1c')]);}_0x1fca85['order']=qs[_0x15a9('0x34')](_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x34')]);_0x1fca85[_0x15a9('0x35')]=qs[_0x15a9('0x2c')](_[_0x15a9('0x36')](_0x29c8e5['query'],_0x20c3c0[_0x15a9('0x2c')]));if(_0x29c8e5[_0x15a9('0x2b')][_0x15a9('0x37')]){_0x1fca85[_0x15a9('0x35')]=_[_0x15a9('0x38')](_0x1fca85[_0x15a9('0x35')],{'$or':_[_0x15a9('0x39')](_0x436265,function(_0x183cb7){if(_0x183cb7[_0x15a9('0x3a')]['key']!=='VIRTUAL'){var _0x586d09={};_0x586d09[_0x183cb7['field']]={'$like':'%'+_0x29c8e5['query'][_0x15a9('0x37')]+'%'};return _0x586d09;}})});}_0x1fca85=_[_0x15a9('0x38')]({},_0x1fca85,_0x29c8e5['options']);var _0x1d4177={'where':_0x1fca85[_0x15a9('0x35')]};return db[_0x15a9('0x28')][_0x15a9('0x1b')](_0x1d4177)[_0x15a9('0x23')](function(_0x5887fc){_0x1b1f81[_0x15a9('0x1b')]=_0x5887fc;if(_0x29c8e5[_0x15a9('0x2b')]['includeAll']){_0x1fca85[_0x15a9('0x3b')]=[{'all':!![]}];}return db[_0x15a9('0x28')][_0x15a9('0x3c')](_0x1fca85);})['then'](function(_0x2d3b60){_0x1b1f81['rows']=_0x2d3b60;return _0x1b1f81;})['then'](respondWithFilteredResult(_0x35a1bc,_0x1fca85))['catch'](handleError(_0x35a1bc,null));};exports['show']=function(_0x4220ed,_0x221a3d){var _0x334dc4={'raw':![],'where':{'id':_0x4220ed[_0x15a9('0x3d')]['id']}},_0x3e04e3={};_0x3e04e3['model']=_[_0x15a9('0x2a')](db[_0x15a9('0x28')][_0x15a9('0x29')]);_0x3e04e3['query']=_['keys'](_0x4220ed[_0x15a9('0x2b')]);_0x3e04e3['filters']=_['intersection'](_0x3e04e3[_0x15a9('0x2f')],_0x3e04e3[_0x15a9('0x2b')]);_0x334dc4[_0x15a9('0x2e')]=_['intersection'](_0x3e04e3[_0x15a9('0x2f')],qs[_0x15a9('0x30')](_0x4220ed[_0x15a9('0x2b')][_0x15a9('0x30')]));_0x334dc4['attributes']=_0x334dc4[_0x15a9('0x2e')][_0x15a9('0x31')]?_0x334dc4[_0x15a9('0x2e')]:_0x3e04e3[_0x15a9('0x2f')];if(_0x4220ed[_0x15a9('0x2b')][_0x15a9('0x3e')]){_0x334dc4[_0x15a9('0x3b')]=[{'all':!![]}];}_0x334dc4=_['merge']({},_0x334dc4,_0x4220ed[_0x15a9('0x3f')]);return db[_0x15a9('0x28')]['find'](_0x334dc4)[_0x15a9('0x23')](handleEntityNotFound(_0x221a3d,null))[_0x15a9('0x23')](respondWithResult(_0x221a3d,null))[_0x15a9('0x40')](handleError(_0x221a3d,null));};exports['create']=function(_0xabaab3,_0x53a5d0){return db[_0x15a9('0x28')][_0x15a9('0x41')](_0xabaab3[_0x15a9('0x42')],{})[_0x15a9('0x23')](respondWithResult(_0x53a5d0,0xc9))[_0x15a9('0x40')](handleError(_0x53a5d0,null));};exports['update']=function(_0x34d379,_0x2c4e5e){if(_0x34d379[_0x15a9('0x42')]['id']){delete _0x34d379[_0x15a9('0x42')]['id'];}return db['Integration'][_0x15a9('0x43')]({'where':{'id':_0x34d379[_0x15a9('0x3d')]['id']}})[_0x15a9('0x23')](handleEntityNotFound(_0x2c4e5e,null))['then'](saveUpdates(_0x34d379[_0x15a9('0x42')],null))[_0x15a9('0x23')](respondWithResult(_0x2c4e5e,null))[_0x15a9('0x40')](handleError(_0x2c4e5e,null));};exports['destroy']=function(_0x154a30,_0x2a6781){return db['Integration'][_0x15a9('0x43')]({'where':{'id':_0x154a30[_0x15a9('0x3d')]['id']}})[_0x15a9('0x23')](handleEntityNotFound(_0x2a6781,null))[_0x15a9('0x23')](removeEntity(_0x2a6781,null))[_0x15a9('0x40')](handleError(_0x2a6781,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index a9caf81..029f50c 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 _0xbb70=['../../config/environment','./integration.attributes','exports','define','Integration','util','api','request-promise','path','rimraf'];(function(_0x3fc048,_0x583e90){var _0x863355=function(_0x5b4c3e){while(--_0x5b4c3e){_0x3fc048['push'](_0x3fc048['shift']());}};_0x863355(++_0x583e90);}(_0xbb70,0x7d));var _0x0bb7=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xbb70[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x0bb7('0x0'));var logger=require('../../config/logger')(_0x0bb7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bb7('0x2'));var fs=require('fs');var path=require(_0x0bb7('0x3'));var rimraf=require(_0x0bb7('0x4'));var config=require(_0x0bb7('0x5'));var attributes=require(_0x0bb7('0x6'));module[_0x0bb7('0x7')]=function(_0x13113c,_0x2530fc){return _0x13113c[_0x0bb7('0x8')](_0x0bb7('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08fa=['Integration','integrations','lodash','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x08fa,0x124));var _0xa08f=function(_0x35158d,_0x3fe39b){_0x35158d=_0x35158d-0x0;var _0x31f810=_0x08fa[_0x35158d];return _0x31f810;};'use strict';var _=require(_0xa08f('0x0'));var util=require('util');var logger=require(_0xa08f('0x1'))(_0xa08f('0x2'));var moment=require(_0xa08f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa08f('0x4'));var rimraf=require('rimraf');var config=require(_0xa08f('0x5'));var attributes=require('./integration.attributes');module[_0xa08f('0x6')]=function(_0x35ca35,_0x15c7dd){return _0x35ca35[_0xa08f('0x7')](_0xa08f('0x8'),attributes,{'tableName':_0xa08f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 36a8e2b..ccfb65b 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 _0x6919=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x6919,0x1a9));var _0x9691=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x6919[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require('lodash');var util=require(_0x9691('0x0'));var moment=require(_0x9691('0x1'));var BPromise=require(_0x9691('0x2'));var rs=require(_0x9691('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9691('0x4'))['db'];var utils=require(_0x9691('0x5'));var logger=require(_0x9691('0x6'))(_0x9691('0x7'));var config=require(_0x9691('0x8'));var jayson=require(_0x9691('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x146fda,_0x236c85,_0x362db0){return new BPromise(function(_0x5d4283,_0x2b54a8){return client[_0x9691('0xa')](_0x146fda,_0x362db0)[_0x9691('0xb')](function(_0x46b665){logger[_0x9691('0xc')](_0x9691('0xd'),_0x236c85,'request\x20sent');logger[_0x9691('0xe')](_0x9691('0xf'),_0x236c85,_0x9691('0x10'),JSON[_0x9691('0x11')](_0x46b665));if(_0x46b665[_0x9691('0x12')]){if(_0x46b665[_0x9691('0x12')][_0x9691('0x13')]===0x1f4){logger['error'](_0x9691('0xd'),_0x236c85,_0x46b665[_0x9691('0x12')][_0x9691('0x14')]);return _0x2b54a8(_0x46b665[_0x9691('0x12')]['message']);}logger[_0x9691('0x12')](_0x9691('0xd'),_0x236c85,_0x46b665[_0x9691('0x12')]['message']);return _0x5d4283(_0x46b665[_0x9691('0x12')][_0x9691('0x14')]);}else{logger[_0x9691('0xc')]('Integration,\x20%s,\x20%s',_0x236c85,_0x9691('0x10'));_0x5d4283(_0x46b665[_0x9691('0x15')][_0x9691('0x14')]);}})[_0x9691('0x16')](function(_0x36a9e4){logger[_0x9691('0x12')](_0x9691('0xd'),_0x236c85,_0x36a9e4);_0x2b54a8(_0x36a9e4);});});} \ No newline at end of file +var _0xd5c7=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x453257,_0x2fe82e){var _0x9779a8=function(_0x2c9ad0){while(--_0x2c9ad0){_0x453257['push'](_0x453257['shift']());}};_0x9779a8(++_0x2fe82e);}(_0xd5c7,0x99));var _0x7d5c=function(_0x5a76ee,_0x26e0a2){_0x5a76ee=_0x5a76ee-0x0;var _0x871197=_0xd5c7[_0x5a76ee];return _0x871197;};'use strict';var _=require('lodash');var util=require(_0x7d5c('0x0'));var moment=require(_0x7d5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d5c('0x2'));var fs=require('fs');var Redis=require(_0x7d5c('0x3'));var db=require(_0x7d5c('0x4'))['db'];var utils=require(_0x7d5c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d5c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7d5c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x421302,_0x210df4,_0x58cc37){return new BPromise(function(_0x334480,_0x1d0c5c){return client[_0x7d5c('0x8')](_0x421302,_0x58cc37)[_0x7d5c('0x9')](function(_0x516aa6){logger[_0x7d5c('0xa')](_0x7d5c('0xb'),_0x210df4,_0x7d5c('0xc'));logger[_0x7d5c('0xd')](_0x7d5c('0xe'),_0x210df4,_0x7d5c('0xc'),JSON[_0x7d5c('0xf')](_0x516aa6));if(_0x516aa6['error']){if(_0x516aa6[_0x7d5c('0x10')]['code']===0x1f4){logger['error'](_0x7d5c('0xb'),_0x210df4,_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);return _0x1d0c5c(_0x516aa6['error'][_0x7d5c('0x11')]);}logger[_0x7d5c('0x10')]('Integration,\x20%s,\x20%s',_0x210df4,_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);return _0x334480(_0x516aa6[_0x7d5c('0x10')][_0x7d5c('0x11')]);}else{logger['info'](_0x7d5c('0xb'),_0x210df4,_0x7d5c('0xc'));_0x334480(_0x516aa6['result'][_0x7d5c('0x11')]);}})[_0x7d5c('0x12')](function(_0x5c37d4){logger[_0x7d5c('0x10')](_0x7d5c('0xb'),_0x210df4,_0x5c37d4);_0x1d0c5c(_0x5c37d4);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f98857f..9df599d 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 _0x474d=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer','connect-timeout','express','../../config/environment','./integrationReport.controller','get'];(function(_0x37c836,_0x2a0079){var _0x1b89b1=function(_0x346c19){while(--_0x346c19){_0x37c836['push'](_0x37c836['shift']());}};_0x1b89b1(++_0x2a0079);}(_0x474d,0x13a));var _0xd474=function(_0x2b1d49,_0x57f1c1){_0x2b1d49=_0x2b1d49-0x0;var _0x728b99=_0x474d[_0x2b1d49];return _0x728b99;};'use strict';var multer=require(_0xd474('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd474('0x1'));var express=require(_0xd474('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd474('0x3'));var controller=require(_0xd474('0x4'));router[_0xd474('0x5')]('/',auth[_0xd474('0x6')](),controller['index']);router[_0xd474('0x5')](_0xd474('0x7'),auth['isAuthenticated'](),controller[_0xd474('0x8')]);router[_0xd474('0x5')](_0xd474('0x9'),auth[_0xd474('0x6')](),controller[_0xd474('0xa')]);router[_0xd474('0xb')]('/',auth[_0xd474('0x6')](),controller[_0xd474('0xc')]);router[_0xd474('0xd')](_0xd474('0x9'),auth[_0xd474('0x6')](),controller[_0xd474('0xe')]);router['delete']('/:id',auth[_0xd474('0x6')](),controller[_0xd474('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbb1e=['/describe','describe','/:id','show','post','create','update','exports','util','path','connect-timeout','express','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0xbb1e,0x90));var _0xebb1=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbb1e[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0xebb1('0x0'));var path=require(_0xebb1('0x1'));var timeout=require(_0xebb1('0x2'));var express=require(_0xebb1('0x3'));var router=express['Router']();var auth=require(_0xebb1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xebb1('0x5'));router[_0xebb1('0x6')]('/',auth[_0xebb1('0x7')](),controller[_0xebb1('0x8')]);router[_0xebb1('0x6')](_0xebb1('0x9'),auth[_0xebb1('0x7')](),controller[_0xebb1('0xa')]);router[_0xebb1('0x6')](_0xebb1('0xb'),auth['isAuthenticated'](),controller[_0xebb1('0xc')]);router[_0xebb1('0xd')]('/',auth[_0xebb1('0x7')](),controller[_0xebb1('0xe')]);router['put'](_0xebb1('0xb'),auth['isAuthenticated'](),controller[_0xebb1('0xf')]);router['delete'](_0xebb1('0xb'),auth[_0xebb1('0x7')](),controller['destroy']);module[_0xebb1('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 281aa8a..0b59422 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 _0xff77=['INTEGER','BOOLEAN','TEXT','SENT','FAILED','sequelize','exports','STRING','DATE'];(function(_0x581617,_0x164cdc){var _0x635776=function(_0x3b8cc6){while(--_0x3b8cc6){_0x581617['push'](_0x581617['shift']());}};_0x635776(++_0x164cdc);}(_0xff77,0x191));var _0x7ff7=function(_0x1a1774,_0x4d5efa){_0x1a1774=_0x1a1774-0x0;var _0x9bf800=_0xff77[_0x1a1774];return _0x9bf800;};'use strict';var Sequelize=require(_0x7ff7('0x0'));module[_0x7ff7('0x1')]={'integration':{'type':Sequelize[_0x7ff7('0x2')]},'eventChannel':{'type':Sequelize[_0x7ff7('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x7ff7('0x2')]},'uniqueid':{'type':Sequelize[_0x7ff7('0x2')]},'calleridnum':{'type':Sequelize[_0x7ff7('0x2')]},'calleridname':{'type':Sequelize[_0x7ff7('0x2')]},'queue':{'type':Sequelize[_0x7ff7('0x2')]},'interface':{'type':Sequelize[_0x7ff7('0x2')]},'membername':{'type':Sequelize[_0x7ff7('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7ff7('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7ff7('0x3')]},'holdtime':{'type':Sequelize[_0x7ff7('0x4')]},'agentcomplete':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7ff7('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7ff7('0x4')]},'reason':{'type':Sequelize[_0x7ff7('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7ff7('0x3')]},'agentdump':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7ff7('0x3')]},'lastevent':{'type':Sequelize[_0x7ff7('0x2')]},'channel':{'type':Sequelize[_0x7ff7('0x2')]},'channelstate':{'type':Sequelize[_0x7ff7('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7ff7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7ff7('0x2')]},'context':{'type':Sequelize[_0x7ff7('0x2')]},'exten':{'type':Sequelize[_0x7ff7('0x2')]},'priority':{'type':Sequelize[_0x7ff7('0x2')]},'destchannel':{'type':Sequelize[_0x7ff7('0x2')]},'destchannelstate':{'type':Sequelize[_0x7ff7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7ff7('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7ff7('0x2')]},'destcalleridname':{'type':Sequelize[_0x7ff7('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7ff7('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7ff7('0x2')]},'destcontext':{'type':Sequelize[_0x7ff7('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7ff7('0x2')]},'inReplyTo':{'type':Sequelize[_0x7ff7('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x7ff7('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7ff7('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x7ff7('0x6')]},'text':{'type':Sequelize[_0x7ff7('0x6')]},'status':{'type':Sequelize['ENUM'](_0x7ff7('0x7'),'SENDING','RECEIVED',_0x7ff7('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7ff7('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x7ff7('0x4')]}}; \ No newline at end of file +var _0xe1ff=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0x2cb491,_0x3e08e8){var _0x2a9bde=function(_0x3a44c9){while(--_0x3a44c9){_0x2cb491['push'](_0x2cb491['shift']());}};_0x2a9bde(++_0x3e08e8);}(_0xe1ff,0x138));var _0xfe1f=function(_0x41fd17,_0x5ddf0f){_0x41fd17=_0x41fd17-0x0;var _0x3e8502=_0xe1ff[_0x41fd17];return _0x3e8502;};'use strict';var Sequelize=require(_0xfe1f('0x0'));module[_0xfe1f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xfe1f('0x2')]},'exitStatus':{'type':Sequelize[_0xfe1f('0x2')]},'ticketId':{'type':Sequelize[_0xfe1f('0x2')]},'integrationId':{'type':Sequelize[_0xfe1f('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfe1f('0x2')]},'calleridnum':{'type':Sequelize[_0xfe1f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfe1f('0x2')]},'interface':{'type':Sequelize[_0xfe1f('0x2')]},'membername':{'type':Sequelize[_0xfe1f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfe1f('0x4')]},'agentconnectAt':{'type':Sequelize[_0xfe1f('0x4')]},'holdtime':{'type':Sequelize[_0xfe1f('0x3')]},'agentcomplete':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfe1f('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfe1f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xfe1f('0x4')]},'agentdump':{'type':Sequelize[_0xfe1f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xfe1f('0x4')]},'lastevent':{'type':Sequelize[_0xfe1f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xfe1f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfe1f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfe1f('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfe1f('0x2')]},'accountcode':{'type':Sequelize[_0xfe1f('0x2')]},'context':{'type':Sequelize[_0xfe1f('0x2')]},'exten':{'type':Sequelize[_0xfe1f('0x2')]},'priority':{'type':Sequelize[_0xfe1f('0x2')]},'destchannel':{'type':Sequelize[_0xfe1f('0x2')]},'destchannelstate':{'type':Sequelize[_0xfe1f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xfe1f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfe1f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xfe1f('0x2')]},'destlanguage':{'type':Sequelize[_0xfe1f('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfe1f('0x2')]},'destexten':{'type':Sequelize[_0xfe1f('0x2')]},'destpriority':{'type':Sequelize[_0xfe1f('0x2')]},'destuniqueid':{'type':Sequelize[_0xfe1f('0x2')]},'messageId':{'type':Sequelize[_0xfe1f('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xfe1f('0x2')]},'from':{'type':Sequelize[_0xfe1f('0x2')]},'to':{'type':Sequelize[_0xfe1f('0x2')]},'cc':{'type':Sequelize[_0xfe1f('0x2')]},'attachment':{'type':Sequelize[_0xfe1f('0x6')]},'html':{'type':Sequelize[_0xfe1f('0x6')]},'text':{'type':Sequelize[_0xfe1f('0x6')]},'status':{'type':Sequelize[_0xfe1f('0x7')](_0xfe1f('0x8'),_0xfe1f('0x9'),_0xfe1f('0xa'),_0xfe1f('0xb'))},'url':{'type':Sequelize[_0xfe1f('0x2')]},'app':{'type':Sequelize[_0xfe1f('0x2')]},'appdata':{'type':Sequelize[_0xfe1f('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d571429..da2bf51 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 _0x4c71=['params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','IntegrationReport','rawAttributes','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','catch','keys','includeAll','find','create','body'];(function(_0x29cf6f,_0x2062ac){var _0x5c69d0=function(_0x595ad2){while(--_0x595ad2){_0x29cf6f['push'](_0x29cf6f['shift']());}};_0x5c69d0(++_0x2062ac);}(_0x4c71,0x12b));var _0x14c7=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4c71[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0x14c7('0x0'));var emlformat=require(_0x14c7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x14c7('0x2'));var jsonpatch=require(_0x14c7('0x3'));var rp=require(_0x14c7('0x4'));var moment=require(_0x14c7('0x5'));var BPromise=require(_0x14c7('0x6'));var Mustache=require('mustache');var util=require(_0x14c7('0x7'));var path=require(_0x14c7('0x8'));var sox=require(_0x14c7('0x9'));var csv=require(_0x14c7('0xa'));var ejs=require(_0x14c7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x14c7('0xc'));var crypto=require(_0x14c7('0xd'));var jsforce=require(_0x14c7('0xe'));var deskjs=require(_0x14c7('0xf'));var toCsv=require(_0x14c7('0xa'));var querystring=require('querystring');var Papa=require(_0x14c7('0x10'));var Redis=require('ioredis');var authService=require(_0x14c7('0x11'));var qs=require(_0x14c7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14c7('0x13'))(_0x14c7('0x14'));var utils=require(_0x14c7('0x15'));var config=require(_0x14c7('0x16'));var db=require(_0x14c7('0x17'))['db'];function respondWithStatusCode(_0x175835,_0x53f5fa){_0x53f5fa=_0x53f5fa||0xcc;return function(_0x5b3ff2){if(_0x5b3ff2){return _0x175835[_0x14c7('0x18')](_0x53f5fa);}return _0x175835[_0x14c7('0x19')](_0x53f5fa)[_0x14c7('0x1a')]();};}function respondWithResult(_0x268bde,_0x1199a1){_0x1199a1=_0x1199a1||0xc8;return function(_0x3e779f){if(_0x3e779f){return _0x268bde['status'](_0x1199a1)['json'](_0x3e779f);}};}function respondWithFilteredResult(_0x2428bc,_0x34b078){return function(_0x5db054){if(_0x5db054){var _0x5bb4de=_0x5db054[_0x14c7('0x1b')],_0x39c742=_0x34b078[_0x14c7('0x1c')],_0x2929bc=_0x34b078[_0x14c7('0x1c')]+_0x34b078['limit'],_0x1eff6b;if(_0x2929bc>=_0x5bb4de){_0x2929bc=_0x5bb4de;_0x1eff6b=0xc8;}else{_0x1eff6b=0xce;}_0x2428bc[_0x14c7('0x19')](_0x1eff6b);return _0x2428bc[_0x14c7('0x1d')](_0x14c7('0x1e'),_0x39c742+'-'+_0x2929bc+'/'+_0x5bb4de)[_0x14c7('0x1f')](_0x5db054);}return null;};}function patchUpdates(_0x57d383){return function(_0x4c504b){try{jsonpatch[_0x14c7('0x20')](_0x4c504b,_0x57d383,!![]);}catch(_0x3c6ab5){return BPromise[_0x14c7('0x21')](_0x3c6ab5);}return _0x4c504b['save']();};}function saveUpdates(_0x266940,_0xa4ab97){return function(_0x2622b5){if(_0x2622b5){return _0x2622b5[_0x14c7('0x22')](_0x266940)['then'](function(_0x5e1df1){return _0x5e1df1;});}return null;};}function removeEntity(_0x504790,_0x32ef89){return function(_0x4944ad){if(_0x4944ad){return _0x4944ad['destroy']()[_0x14c7('0x23')](function(){_0x504790[_0x14c7('0x19')](0xcc)[_0x14c7('0x1a')]();});}};}function handleEntityNotFound(_0x1c914b,_0x24a93b){return function(_0x4db89a){if(!_0x4db89a){_0x1c914b['sendStatus'](0x194);}return _0x4db89a;};}function handleError(_0x5a5349,_0x274c3c){_0x274c3c=_0x274c3c||0x1f4;return function(_0x1f24b4){logger[_0x14c7('0x24')](_0x1f24b4[_0x14c7('0x25')]);if(_0x1f24b4[_0x14c7('0x26')]){delete _0x1f24b4[_0x14c7('0x26')];}_0x5a5349[_0x14c7('0x19')](_0x274c3c)['send'](_0x1f24b4);};}exports[_0x14c7('0x27')]=function(_0x21be43,_0x17b2e5){var _0x30a959={},_0x3b4344={},_0x5a48e9={'count':0x0,'rows':[]};var _0x3dc18d=db[_0x14c7('0x28')][_0x14c7('0x29')];_0x3b4344['model']=_['keys'](_0x3dc18d);_0x3b4344['query']=_['keys'](_0x21be43['query']);_0x3b4344[_0x14c7('0x2a')]=_[_0x14c7('0x2b')](_0x3b4344[_0x14c7('0x2c')],_0x3b4344[_0x14c7('0x2d')]);_0x30a959['attributes']=_['intersection'](_0x3b4344['model'],qs[_0x14c7('0x2e')](_0x21be43[_0x14c7('0x2d')][_0x14c7('0x2e')]));_0x30a959[_0x14c7('0x2f')]=_0x30a959[_0x14c7('0x2f')][_0x14c7('0x30')]?_0x30a959['attributes']:_0x3b4344[_0x14c7('0x2c')];if(!_0x21be43[_0x14c7('0x2d')][_0x14c7('0x31')]('nolimit')){_0x30a959['limit']=qs[_0x14c7('0x32')](_0x21be43[_0x14c7('0x2d')]['limit']);_0x30a959[_0x14c7('0x1c')]=qs['offset'](_0x21be43[_0x14c7('0x2d')][_0x14c7('0x1c')]);}_0x30a959[_0x14c7('0x33')]=qs[_0x14c7('0x34')](_0x21be43[_0x14c7('0x2d')]['sort']);_0x30a959[_0x14c7('0x35')]=qs[_0x14c7('0x2a')](_[_0x14c7('0x36')](_0x21be43['query'],_0x3b4344['filters']));if(_0x21be43['query'][_0x14c7('0x37')]){_0x30a959['where']=_[_0x14c7('0x38')](_0x30a959[_0x14c7('0x35')],{'$or':_[_0x14c7('0x39')](_0x3dc18d,function(_0x8aaf8d){if(_0x8aaf8d['type'][_0x14c7('0x3a')]!==_0x14c7('0x3b')){var _0x441d27={};_0x441d27[_0x8aaf8d[_0x14c7('0x3c')]]={'$like':'%'+_0x21be43['query']['filter']+'%'};return _0x441d27;}})});}_0x30a959=_[_0x14c7('0x38')]({},_0x30a959,_0x21be43[_0x14c7('0x3d')]);var _0x43c9fc={'where':_0x30a959[_0x14c7('0x35')]};return db[_0x14c7('0x28')][_0x14c7('0x1b')](_0x43c9fc)[_0x14c7('0x23')](function(_0x4a71b3){_0x5a48e9[_0x14c7('0x1b')]=_0x4a71b3;if(_0x21be43['query']['includeAll']){_0x30a959[_0x14c7('0x3e')]=[{'all':!![]}];}return db['IntegrationReport'][_0x14c7('0x3f')](_0x30a959);})[_0x14c7('0x23')](function(_0x12e007){_0x5a48e9[_0x14c7('0x40')]=_0x12e007;return _0x5a48e9;})[_0x14c7('0x23')](respondWithFilteredResult(_0x17b2e5,_0x30a959))[_0x14c7('0x41')](handleError(_0x17b2e5,null));};exports['show']=function(_0x1b3da8,_0x2690a6){var _0x296417={'raw':![],'where':{'id':_0x1b3da8['params']['id']}},_0xce0c81={};_0xce0c81[_0x14c7('0x2c')]=_[_0x14c7('0x42')](db[_0x14c7('0x28')]['rawAttributes']);_0xce0c81[_0x14c7('0x2d')]=_[_0x14c7('0x42')](_0x1b3da8[_0x14c7('0x2d')]);_0xce0c81[_0x14c7('0x2a')]=_['intersection'](_0xce0c81[_0x14c7('0x2c')],_0xce0c81['query']);_0x296417['attributes']=_[_0x14c7('0x2b')](_0xce0c81['model'],qs[_0x14c7('0x2e')](_0x1b3da8[_0x14c7('0x2d')][_0x14c7('0x2e')]));_0x296417[_0x14c7('0x2f')]=_0x296417[_0x14c7('0x2f')]['length']?_0x296417['attributes']:_0xce0c81[_0x14c7('0x2c')];if(_0x1b3da8[_0x14c7('0x2d')][_0x14c7('0x43')]){_0x296417[_0x14c7('0x3e')]=[{'all':!![]}];}_0x296417=_[_0x14c7('0x38')]({},_0x296417,_0x1b3da8[_0x14c7('0x3d')]);return db[_0x14c7('0x28')][_0x14c7('0x44')](_0x296417)[_0x14c7('0x23')](handleEntityNotFound(_0x2690a6,null))['then'](respondWithResult(_0x2690a6,null))[_0x14c7('0x41')](handleError(_0x2690a6,null));};exports['create']=function(_0x2d0e17,_0x361ad4){return db[_0x14c7('0x28')][_0x14c7('0x45')](_0x2d0e17[_0x14c7('0x46')],{})['then'](respondWithResult(_0x361ad4,0xc9))['catch'](handleError(_0x361ad4,null));};exports['update']=function(_0x4239ff,_0x48bb32){if(_0x4239ff[_0x14c7('0x46')]['id']){delete _0x4239ff[_0x14c7('0x46')]['id'];}return db['IntegrationReport'][_0x14c7('0x44')]({'where':{'id':_0x4239ff[_0x14c7('0x47')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x48bb32,null))[_0x14c7('0x23')](saveUpdates(_0x4239ff['body'],null))[_0x14c7('0x23')](respondWithResult(_0x48bb32,null))[_0x14c7('0x41')](handleError(_0x48bb32,null));};exports[_0x14c7('0x48')]=function(_0x10509f,_0x3ca42c){return db[_0x14c7('0x28')]['find']({'where':{'id':_0x10509f[_0x14c7('0x47')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x3ca42c,null))['then'](removeEntity(_0x3ca42c,null))[_0x14c7('0x41')](handleError(_0x3ca42c,null));};exports[_0x14c7('0x49')]=function(_0xe9da42,_0xa0accb){return db[_0x14c7('0x28')][_0x14c7('0x49')]()[_0x14c7('0x23')](respondWithResult(_0xa0accb,null))[_0x14c7('0x41')](handleError(_0xa0accb,null));}; \ No newline at end of file +var _0xe027=['offset','limit','Content-Range','apply','reject','save','update','destroy','end','error','name','index','IntegrationReport','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','options','count','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0xd3fc8c,_0x204ecb){var _0x44558b=function(_0x2a958c){while(--_0x2a958c){_0xd3fc8c['push'](_0xd3fc8c['shift']());}};_0x44558b(++_0x204ecb);}(_0xe027,0x106));var _0x7e02=function(_0x1d22ce,_0x21a755){_0x1d22ce=_0x1d22ce-0x0;var _0x998150=_0xe027[_0x1d22ce];return _0x998150;};'use strict';var pdf=require(_0x7e02('0x0'));var emlformat=require(_0x7e02('0x1'));var rimraf=require(_0x7e02('0x2'));var zipdir=require(_0x7e02('0x3'));var jsonpatch=require(_0x7e02('0x4'));var rp=require(_0x7e02('0x5'));var moment=require(_0x7e02('0x6'));var BPromise=require(_0x7e02('0x7'));var Mustache=require(_0x7e02('0x8'));var util=require(_0x7e02('0x9'));var path=require(_0x7e02('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e02('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e02('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7e02('0xe'));var Papa=require(_0x7e02('0xf'));var Redis=require(_0x7e02('0x10'));var authService=require(_0x7e02('0x11'));var qs=require(_0x7e02('0x12'));var hardwareService=require(_0x7e02('0x13'));var logger=require('../../config/logger')(_0x7e02('0x14'));var utils=require('../../config/utils');var config=require(_0x7e02('0x15'));var db=require(_0x7e02('0x16'))['db'];function respondWithStatusCode(_0x9de2f,_0x8406e6){_0x8406e6=_0x8406e6||0xcc;return function(_0x44daf4){if(_0x44daf4){return _0x9de2f[_0x7e02('0x17')](_0x8406e6);}return _0x9de2f[_0x7e02('0x18')](_0x8406e6)['end']();};}function respondWithResult(_0x7dc571,_0x5d91ab){_0x5d91ab=_0x5d91ab||0xc8;return function(_0x542ecb){if(_0x542ecb){return _0x7dc571[_0x7e02('0x18')](_0x5d91ab)[_0x7e02('0x19')](_0x542ecb);}};}function respondWithFilteredResult(_0x269c3b,_0x249281){return function(_0x33b013){if(_0x33b013){var _0x550352=_0x33b013['count'],_0x5b69a3=_0x249281[_0x7e02('0x1a')],_0x589ecb=_0x249281[_0x7e02('0x1a')]+_0x249281[_0x7e02('0x1b')],_0x24a572;if(_0x589ecb>=_0x550352){_0x589ecb=_0x550352;_0x24a572=0xc8;}else{_0x24a572=0xce;}_0x269c3b[_0x7e02('0x18')](_0x24a572);return _0x269c3b['set'](_0x7e02('0x1c'),_0x5b69a3+'-'+_0x589ecb+'/'+_0x550352)[_0x7e02('0x19')](_0x33b013);}return null;};}function patchUpdates(_0x53d174){return function(_0x1199ed){try{jsonpatch[_0x7e02('0x1d')](_0x1199ed,_0x53d174,!![]);}catch(_0x1d2bd2){return BPromise[_0x7e02('0x1e')](_0x1d2bd2);}return _0x1199ed[_0x7e02('0x1f')]();};}function saveUpdates(_0xd7c720,_0x5670c1){return function(_0x452499){if(_0x452499){return _0x452499[_0x7e02('0x20')](_0xd7c720)['then'](function(_0x2f44f4){return _0x2f44f4;});}return null;};}function removeEntity(_0x1eef9c,_0x4aca7e){return function(_0xb1b8f9){if(_0xb1b8f9){return _0xb1b8f9[_0x7e02('0x21')]()['then'](function(){_0x1eef9c[_0x7e02('0x18')](0xcc)[_0x7e02('0x22')]();});}};}function handleEntityNotFound(_0x5b0481,_0x5625e5){return function(_0x3e1b35){if(!_0x3e1b35){_0x5b0481[_0x7e02('0x17')](0x194);}return _0x3e1b35;};}function handleError(_0x177553,_0x145adb){_0x145adb=_0x145adb||0x1f4;return function(_0x3b8794){logger[_0x7e02('0x23')](_0x3b8794['stack']);if(_0x3b8794['name']){delete _0x3b8794[_0x7e02('0x24')];}_0x177553[_0x7e02('0x18')](_0x145adb)['send'](_0x3b8794);};}exports[_0x7e02('0x25')]=function(_0x56b928,_0x216e7c){var _0xd4270e={},_0x3541b6={},_0x552ed7={'count':0x0,'rows':[]};var _0x42283d=db[_0x7e02('0x26')][_0x7e02('0x27')];_0x3541b6['model']=_['keys'](_0x42283d);_0x3541b6[_0x7e02('0x28')]=_[_0x7e02('0x29')](_0x56b928['query']);_0x3541b6[_0x7e02('0x2a')]=_[_0x7e02('0x2b')](_0x3541b6[_0x7e02('0x2c')],_0x3541b6[_0x7e02('0x28')]);_0xd4270e['attributes']=_[_0x7e02('0x2b')](_0x3541b6[_0x7e02('0x2c')],qs[_0x7e02('0x2d')](_0x56b928[_0x7e02('0x28')][_0x7e02('0x2d')]));_0xd4270e[_0x7e02('0x2e')]=_0xd4270e[_0x7e02('0x2e')][_0x7e02('0x2f')]?_0xd4270e[_0x7e02('0x2e')]:_0x3541b6[_0x7e02('0x2c')];if(!_0x56b928[_0x7e02('0x28')][_0x7e02('0x30')](_0x7e02('0x31'))){_0xd4270e[_0x7e02('0x1b')]=qs[_0x7e02('0x1b')](_0x56b928['query'][_0x7e02('0x1b')]);_0xd4270e[_0x7e02('0x1a')]=qs[_0x7e02('0x1a')](_0x56b928[_0x7e02('0x28')][_0x7e02('0x1a')]);}_0xd4270e[_0x7e02('0x32')]=qs[_0x7e02('0x33')](_0x56b928['query']['sort']);_0xd4270e['where']=qs['filters'](_[_0x7e02('0x34')](_0x56b928[_0x7e02('0x28')],_0x3541b6['filters']));if(_0x56b928[_0x7e02('0x28')][_0x7e02('0x35')]){_0xd4270e['where']=_[_0x7e02('0x36')](_0xd4270e[_0x7e02('0x37')],{'$or':_[_0x7e02('0x38')](_0x42283d,function(_0x358d93){if(_0x358d93[_0x7e02('0x39')]['key']!=='VIRTUAL'){var _0x43c9c5={};_0x43c9c5[_0x358d93['field']]={'$like':'%'+_0x56b928[_0x7e02('0x28')][_0x7e02('0x35')]+'%'};return _0x43c9c5;}})});}_0xd4270e=_[_0x7e02('0x36')]({},_0xd4270e,_0x56b928[_0x7e02('0x3a')]);var _0x4cd23f={'where':_0xd4270e[_0x7e02('0x37')]};return db[_0x7e02('0x26')][_0x7e02('0x3b')](_0x4cd23f)[_0x7e02('0x3c')](function(_0x1f8d8f){_0x552ed7[_0x7e02('0x3b')]=_0x1f8d8f;if(_0x56b928['query'][_0x7e02('0x3d')]){_0xd4270e[_0x7e02('0x3e')]=[{'all':!![]}];}return db[_0x7e02('0x26')][_0x7e02('0x3f')](_0xd4270e);})[_0x7e02('0x3c')](function(_0x1125ac){_0x552ed7[_0x7e02('0x40')]=_0x1125ac;return _0x552ed7;})[_0x7e02('0x3c')](respondWithFilteredResult(_0x216e7c,_0xd4270e))[_0x7e02('0x41')](handleError(_0x216e7c,null));};exports[_0x7e02('0x42')]=function(_0x4cd2ba,_0x15bbcb){var _0x46b32a={'raw':![],'where':{'id':_0x4cd2ba[_0x7e02('0x43')]['id']}},_0x2bbd20={};_0x2bbd20[_0x7e02('0x2c')]=_[_0x7e02('0x29')](db[_0x7e02('0x26')][_0x7e02('0x27')]);_0x2bbd20[_0x7e02('0x28')]=_[_0x7e02('0x29')](_0x4cd2ba['query']);_0x2bbd20[_0x7e02('0x2a')]=_[_0x7e02('0x2b')](_0x2bbd20[_0x7e02('0x2c')],_0x2bbd20[_0x7e02('0x28')]);_0x46b32a[_0x7e02('0x2e')]=_[_0x7e02('0x2b')](_0x2bbd20['model'],qs[_0x7e02('0x2d')](_0x4cd2ba['query'][_0x7e02('0x2d')]));_0x46b32a[_0x7e02('0x2e')]=_0x46b32a[_0x7e02('0x2e')][_0x7e02('0x2f')]?_0x46b32a[_0x7e02('0x2e')]:_0x2bbd20[_0x7e02('0x2c')];if(_0x4cd2ba['query'][_0x7e02('0x3d')]){_0x46b32a[_0x7e02('0x3e')]=[{'all':!![]}];}_0x46b32a=_[_0x7e02('0x36')]({},_0x46b32a,_0x4cd2ba[_0x7e02('0x3a')]);return db[_0x7e02('0x26')][_0x7e02('0x44')](_0x46b32a)['then'](handleEntityNotFound(_0x15bbcb,null))[_0x7e02('0x3c')](respondWithResult(_0x15bbcb,null))[_0x7e02('0x41')](handleError(_0x15bbcb,null));};exports[_0x7e02('0x45')]=function(_0x138a81,_0x267acb){return db['IntegrationReport'][_0x7e02('0x45')](_0x138a81[_0x7e02('0x46')],{})[_0x7e02('0x3c')](respondWithResult(_0x267acb,0xc9))['catch'](handleError(_0x267acb,null));};exports[_0x7e02('0x20')]=function(_0x7b2829,_0x3700c9){if(_0x7b2829['body']['id']){delete _0x7b2829['body']['id'];}return db[_0x7e02('0x26')][_0x7e02('0x44')]({'where':{'id':_0x7b2829[_0x7e02('0x43')]['id']}})[_0x7e02('0x3c')](handleEntityNotFound(_0x3700c9,null))[_0x7e02('0x3c')](saveUpdates(_0x7b2829['body'],null))['then'](respondWithResult(_0x3700c9,null))['catch'](handleError(_0x3700c9,null));};exports[_0x7e02('0x21')]=function(_0x107445,_0x452303){return db[_0x7e02('0x26')][_0x7e02('0x44')]({'where':{'id':_0x107445['params']['id']}})[_0x7e02('0x3c')](handleEntityNotFound(_0x452303,null))[_0x7e02('0x3c')](removeEntity(_0x452303,null))[_0x7e02('0x41')](handleError(_0x452303,null));};exports[_0x7e02('0x47')]=function(_0x26eadb,_0xa76dd7){return db['IntegrationReport'][_0x7e02('0x47')]()[_0x7e02('0x3c')](respondWithResult(_0xa76dd7,null))[_0x7e02('0x41')](handleError(_0xa76dd7,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 9bff925..306a862 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 _0xb647=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util'];(function(_0x11207a,_0x149cef){var _0x2c17d1=function(_0x523099){while(--_0x523099){_0x11207a['push'](_0x11207a['shift']());}};_0x2c17d1(++_0x149cef);}(_0xb647,0xdb));var _0x7b64=function(_0x39e0fb,_0x448e21){_0x39e0fb=_0x39e0fb-0x0;var _0x52bf4c=_0xb647[_0x39e0fb];return _0x52bf4c;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var logger=require(_0x7b64('0x2'))(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var rp=require(_0x7b64('0x6'));var fs=require('fs');var path=require(_0x7b64('0x7'));var rimraf=require('rimraf');var config=require(_0x7b64('0x8'));var attributes=require('./integrationReport.attributes');module[_0x7b64('0x9')]=function(_0x38ebf7,_0x31915b){return _0x38ebf7[_0x7b64('0xa')](_0x7b64('0xb'),attributes,{'tableName':_0x7b64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x950a=['../../config/logger','api','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','lodash','util'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x950a,0x111));var _0xa950=function(_0x4b4888,_0x497b2a){_0x4b4888=_0x4b4888-0x0;var _0x468eb2=_0x950a[_0x4b4888];return _0x468eb2;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var logger=require(_0xa950('0x2'))(_0xa950('0x3'));var moment=require('moment');var BPromise=require(_0xa950('0x4'));var rp=require(_0xa950('0x5'));var fs=require('fs');var path=require(_0xa950('0x6'));var rimraf=require(_0xa950('0x7'));var config=require('../../config/environment');var attributes=require(_0xa950('0x8'));module[_0xa950('0x9')]=function(_0x512c0e,_0x14b4ac){return _0x512c0e[_0xa950('0xa')]('IntegrationReport',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 55fedc9..450e3e8 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 _0x228c=['error','code','message','catch','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x228c,0x1be));var _0xc228=function(_0x2d08e1,_0x4f0f49){_0x2d08e1=_0x2d08e1-0x0;var _0x4e3398=_0x228c[_0x2d08e1];return _0x4e3398;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc228('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc228('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xc228('0x2'));var logger=require(_0xc228('0x3'))('rpc');var config=require(_0xc228('0x4'));var jayson=require(_0xc228('0x5'));var client=jayson[_0xc228('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb50eb4,_0x1db557,_0x174c48){return new BPromise(function(_0x3b8769,_0x245501){return client[_0xc228('0x7')](_0xb50eb4,_0x174c48)[_0xc228('0x8')](function(_0x3bcd8e){logger[_0xc228('0x9')](_0xc228('0xa'),_0x1db557,_0xc228('0xb'));logger['debug'](_0xc228('0xc'),_0x1db557,_0xc228('0xb'),JSON['stringify'](_0x3bcd8e));if(_0x3bcd8e[_0xc228('0xd')]){if(_0x3bcd8e['error'][_0xc228('0xe')]===0x1f4){logger[_0xc228('0xd')](_0xc228('0xa'),_0x1db557,_0x3bcd8e[_0xc228('0xd')]['message']);return _0x245501(_0x3bcd8e['error'][_0xc228('0xf')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x1db557,_0x3bcd8e[_0xc228('0xd')][_0xc228('0xf')]);return _0x3b8769(_0x3bcd8e[_0xc228('0xd')]['message']);}else{logger[_0xc228('0x9')]('IntegrationReport,\x20%s,\x20%s',_0x1db557,'request\x20sent');_0x3b8769(_0x3bcd8e['result'][_0xc228('0xf')]);}})[_0xc228('0x10')](function(_0x23b920){logger[_0xc228('0xd')](_0xc228('0xa'),_0x1db557,_0x23b920);_0x245501(_0x23b920);});});} \ No newline at end of file +var _0xad94=['catch','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x50993c,_0x186d2a){var _0x143663=function(_0x1a150a){while(--_0x1a150a){_0x50993c['push'](_0x50993c['shift']());}};_0x143663(++_0x186d2a);}(_0xad94,0x99));var _0x4ad9=function(_0x31fe11,_0x38ff4a){_0x31fe11=_0x31fe11-0x0;var _0xd96502=_0xad94[_0x31fe11];return _0xd96502;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ad9('0x0'));var BPromise=require('bluebird');var rs=require(_0x4ad9('0x1'));var fs=require('fs');var Redis=require(_0x4ad9('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ad9('0x3'))('rpc');var config=require(_0x4ad9('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4ad9('0x5')][_0x4ad9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xb6e8cb,_0x3cd626,_0x1f1d52){return new BPromise(function(_0xac2d13,_0x516496){return client[_0x4ad9('0x7')](_0xb6e8cb,_0x1f1d52)[_0x4ad9('0x8')](function(_0xb308b0){logger[_0x4ad9('0x9')](_0x4ad9('0xa'),_0x3cd626,'request\x20sent');logger[_0x4ad9('0xb')](_0x4ad9('0xc'),_0x3cd626,_0x4ad9('0xd'),JSON['stringify'](_0xb308b0));if(_0xb308b0[_0x4ad9('0xe')]){if(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0xf')]===0x1f4){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);return _0x516496(_0xb308b0[_0x4ad9('0xe')][_0x4ad9('0x10')]);}logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0xb308b0[_0x4ad9('0xe')]['message']);return _0xac2d13(_0xb308b0[_0x4ad9('0xe')]['message']);}else{logger[_0x4ad9('0x9')]('IntegrationReport,\x20%s,\x20%s',_0x3cd626,_0x4ad9('0xd'));_0xac2d13(_0xb308b0[_0x4ad9('0x11')][_0x4ad9('0x10')]);}})[_0x4ad9('0x12')](function(_0x2b5bbc){logger[_0x4ad9('0xe')](_0x4ad9('0xa'),_0x3cd626,_0x2b5bbc);_0x516496(_0x2b5bbc);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0f63bfc..6e5377a 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 _0xdcec=['show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','/:id'];(function(_0x15850e,_0x58311a){var _0xc90e63=function(_0x51c5dd){while(--_0x51c5dd){_0x15850e['push'](_0x15850e['shift']());}};_0xc90e63(++_0x58311a);}(_0xdcec,0xf2));var _0xcdce=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xdcec[_0x1ae31c];return _0x19519d;};'use strict';var multer=require('multer');var util=require(_0xcdce('0x0'));var path=require(_0xcdce('0x1'));var timeout=require(_0xcdce('0x2'));var express=require(_0xcdce('0x3'));var router=express[_0xcdce('0x4')]();var auth=require(_0xcdce('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcdce('0x6'));router[_0xcdce('0x7')]('/',auth[_0xcdce('0x8')](),controller['index']);router['get'](_0xcdce('0x9'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xa')]);router[_0xcdce('0x7')](_0xcdce('0xb'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xc')]);router[_0xcdce('0xd')]('/',auth['isAuthenticated'](),controller[_0xcdce('0xe')]);router[_0xcdce('0xd')](_0xcdce('0xb'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xf')]);router[_0xcdce('0xd')](_0xcdce('0x10'),auth['isAuthenticated'](),controller[_0xcdce('0x11')]);router['put']('/:id',auth[_0xcdce('0x8')](),controller['update']);router[_0xcdce('0x12')](_0xcdce('0x9'),auth[_0xcdce('0x8')](),controller[_0xcdce('0x13')]);module[_0xcdce('0x14')]=router; \ No newline at end of file +var _0xf087=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','index','isAuthenticated','get','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf087,0x101));var _0x7f08=function(_0x294aa0,_0x43ba1a){_0x294aa0=_0x294aa0-0x0;var _0x395eb6=_0xf087[_0x294aa0];return _0x395eb6;};'use strict';var multer=require(_0x7f08('0x0'));var util=require(_0x7f08('0x1'));var path=require(_0x7f08('0x2'));var timeout=require(_0x7f08('0x3'));var express=require(_0x7f08('0x4'));var router=express['Router']();var auth=require(_0x7f08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f08('0x6'));var controller=require(_0x7f08('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7f08('0x8')]);router['get']('/:id',auth[_0x7f08('0x9')](),controller['show']);router[_0x7f08('0xa')](_0x7f08('0xb'),auth[_0x7f08('0x9')](),controller[_0x7f08('0xc')]);router['post']('/',auth[_0x7f08('0x9')](),controller[_0x7f08('0xd')]);router[_0x7f08('0xe')](_0x7f08('0xb'),auth[_0x7f08('0x9')](),controller[_0x7f08('0xf')]);router[_0x7f08('0xe')](_0x7f08('0x10'),auth['isAuthenticated'](),controller[_0x7f08('0x11')]);router[_0x7f08('0x12')](_0x7f08('0x13'),auth[_0x7f08('0x9')](),controller['update']);router[_0x7f08('0x14')](_0x7f08('0x13'),auth['isAuthenticated'](),controller[_0x7f08('0x15')]);module[_0x7f08('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 2086a62..4532544 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 _0xaf9d=['STRING','sequelize','exports'];(function(_0xddce0e,_0x12c9b4){var _0x3de9ff=function(_0x4f0073){while(--_0x4f0073){_0xddce0e['push'](_0xddce0e['shift']());}};_0x3de9ff(++_0x12c9b4);}(_0xaf9d,0x12d));var _0xdaf9=function(_0x164bf8,_0x1881b0){_0x164bf8=_0x164bf8-0x0;var _0x553015=_0xaf9d[_0x164bf8];return _0x553015;};'use strict';var Sequelize=require(_0xdaf9('0x0'));module[_0xdaf9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaf9('0x2')]},'interval':{'type':Sequelize[_0xdaf9('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc331=['exports','STRING','sequelize'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xc331,0x18b));var _0x1c33=function(_0x1cbde6,_0x54d935){_0x1cbde6=_0x1cbde6-0x0;var _0xc10400=_0xc331[_0x1cbde6];return _0xc10400;};'use strict';var Sequelize=require(_0x1c33('0x0'));module[_0x1c33('0x1')]={'name':{'type':Sequelize[_0x1c33('0x2')]},'description':{'type':Sequelize[_0x1c33('0x2')]},'interval':{'type':Sequelize[_0x1c33('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index eb1ac3a..2d1cc04 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 _0xadbf=['nolimit','order','sort','where','merge','map','type','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','pick','addIntervals','sequelize','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','Interval','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x283d2,_0x326465){var _0x468ee3=function(_0x431edd){while(--_0x431edd){_0x283d2['push'](_0x283d2['shift']());}};_0x468ee3(++_0x326465);}(_0xadbf,0x7d));var _0xfadb=function(_0x1eea3a,_0x4f34bf){_0x1eea3a=_0x1eea3a-0x0;var _0x53d9b7=_0xadbf[_0x1eea3a];return _0x53d9b7;};'use strict';var pdf=require(_0xfadb('0x0'));var emlformat=require(_0xfadb('0x1'));var rimraf=require(_0xfadb('0x2'));var zipdir=require(_0xfadb('0x3'));var jsonpatch=require(_0xfadb('0x4'));var rp=require('request-promise');var moment=require(_0xfadb('0x5'));var BPromise=require(_0xfadb('0x6'));var Mustache=require(_0xfadb('0x7'));var util=require('util');var path=require(_0xfadb('0x8'));var sox=require(_0xfadb('0x9'));var csv=require(_0xfadb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfadb('0xb'));var squel=require(_0xfadb('0xc'));var crypto=require(_0xfadb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfadb('0xe'));var toCsv=require(_0xfadb('0xa'));var querystring=require(_0xfadb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfadb('0x10'));var qs=require(_0xfadb('0x11'));var hardwareService=require(_0xfadb('0x12'));var logger=require('../../config/logger')(_0xfadb('0x13'));var utils=require(_0xfadb('0x14'));var config=require(_0xfadb('0x15'));var db=require(_0xfadb('0x16'))['db'];var extensions=require(_0xfadb('0x17'));function respondWithStatusCode(_0x417d43,_0x421a34){_0x421a34=_0x421a34||0xcc;return function(_0x3afe72){if(_0x3afe72){return _0x417d43[_0xfadb('0x18')](_0x421a34);}return _0x417d43[_0xfadb('0x19')](_0x421a34)['end']();};}function respondWithResult(_0x4dd132,_0x436918){_0x436918=_0x436918||0xc8;return function(_0x332728){if(_0x332728){return _0x4dd132[_0xfadb('0x19')](_0x436918)[_0xfadb('0x1a')](_0x332728);}};}function respondWithFilteredResult(_0xec2b4a,_0x17f7cc){return function(_0x2636d8){if(_0x2636d8){var _0x2b3a0b=_0x2636d8['count'],_0x456723=_0x17f7cc['offset'],_0x12b423=_0x17f7cc[_0xfadb('0x1b')]+_0x17f7cc[_0xfadb('0x1c')],_0x56261d;if(_0x12b423>=_0x2b3a0b){_0x12b423=_0x2b3a0b;_0x56261d=0xc8;}else{_0x56261d=0xce;}_0xec2b4a[_0xfadb('0x19')](_0x56261d);return _0xec2b4a[_0xfadb('0x1d')](_0xfadb('0x1e'),_0x456723+'-'+_0x12b423+'/'+_0x2b3a0b)[_0xfadb('0x1a')](_0x2636d8);}return null;};}function patchUpdates(_0x432ec4){return function(_0x171dfb){try{jsonpatch['apply'](_0x171dfb,_0x432ec4,!![]);}catch(_0x1af0e2){return BPromise[_0xfadb('0x1f')](_0x1af0e2);}return _0x171dfb[_0xfadb('0x20')]();};}function saveUpdates(_0xa8a5be,_0x35798a){return function(_0x5832e0){if(_0x5832e0){return _0x5832e0[_0xfadb('0x21')](_0xa8a5be)[_0xfadb('0x22')](function(_0x186d27){return _0x186d27;});}return null;};}function removeEntity(_0xdfd177,_0x4fc32a){return function(_0x4435ed){if(_0x4435ed){return _0x4435ed[_0xfadb('0x23')]()[_0xfadb('0x22')](function(){var _0x4f50b6=_0x4435ed[_0xfadb('0x24')]({'plain':!![]});var _0x4e60fa=_0xfadb('0x25');return db[_0xfadb('0x26')][_0xfadb('0x23')]({'where':{'type':_0x4e60fa,'resourceId':_0x4f50b6['id']}})[_0xfadb('0x22')](function(){return _0x4435ed;});})[_0xfadb('0x22')](function(){_0xdfd177[_0xfadb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fc3c,_0x213a6a){return function(_0xf2a18){if(!_0xf2a18){_0x59fc3c[_0xfadb('0x18')](0x194);}return _0xf2a18;};}function handleError(_0x198c0a,_0x834f9e){_0x834f9e=_0x834f9e||0x1f4;return function(_0x2b4d89){logger[_0xfadb('0x27')](_0x2b4d89[_0xfadb('0x28')]);if(_0x2b4d89[_0xfadb('0x29')]){delete _0x2b4d89[_0xfadb('0x29')];}_0x198c0a[_0xfadb('0x19')](_0x834f9e)['send'](_0x2b4d89);};}exports['index']=function(_0x4eaf37,_0x2ad1bc){var _0x4ef0cd={},_0x4fbebb={},_0x47b3d1={'count':0x0,'rows':[]};var _0x38e363=db[_0xfadb('0x2a')][_0xfadb('0x2b')];_0x4fbebb[_0xfadb('0x2c')]=_['keys'](_0x38e363);_0x4fbebb[_0xfadb('0x2d')]=_[_0xfadb('0x2e')](_0x4eaf37[_0xfadb('0x2d')]);_0x4fbebb[_0xfadb('0x2f')]=_['intersection'](_0x4fbebb['model'],_0x4fbebb[_0xfadb('0x2d')]);_0x4ef0cd[_0xfadb('0x30')]=_[_0xfadb('0x31')](_0x4fbebb[_0xfadb('0x2c')],qs['fields'](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x4ef0cd[_0xfadb('0x30')]=_0x4ef0cd[_0xfadb('0x30')][_0xfadb('0x33')]?_0x4ef0cd[_0xfadb('0x30')]:_0x4fbebb[_0xfadb('0x2c')];if(!_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x34')](_0xfadb('0x35'))){_0x4ef0cd[_0xfadb('0x1c')]=qs[_0xfadb('0x1c')](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x1c')]);_0x4ef0cd[_0xfadb('0x1b')]=qs[_0xfadb('0x1b')](_0x4eaf37[_0xfadb('0x2d')]['offset']);}_0x4ef0cd[_0xfadb('0x36')]=qs[_0xfadb('0x37')](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x37')]);_0x4ef0cd['where']=qs['filters'](_['pick'](_0x4eaf37[_0xfadb('0x2d')],_0x4fbebb[_0xfadb('0x2f')]));if(_0x4eaf37[_0xfadb('0x2d')]['filter']){_0x4ef0cd[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x4ef0cd[_0xfadb('0x38')],{'$or':_[_0xfadb('0x3a')](_0x38e363,function(_0x4bf816){if(_0x4bf816[_0xfadb('0x3b')]['key']!=='VIRTUAL'){var _0x2faaf9={};_0x2faaf9[_0x4bf816[_0xfadb('0x3c')]]={'$like':'%'+_0x4eaf37['query'][_0xfadb('0x3d')]+'%'};return _0x2faaf9;}})});}_0x4ef0cd=_[_0xfadb('0x39')]({},_0x4ef0cd,_0x4eaf37[_0xfadb('0x3e')]);var _0x189810={'where':_0x4ef0cd[_0xfadb('0x38')]};return db['Interval'][_0xfadb('0x3f')](_0x189810)[_0xfadb('0x22')](function(_0x4b2997){_0x47b3d1[_0xfadb('0x3f')]=_0x4b2997;if(_0x4eaf37['query'][_0xfadb('0x40')]){_0x4ef0cd[_0xfadb('0x41')]=[{'all':!![]}];}return db[_0xfadb('0x2a')][_0xfadb('0x42')](_0x4ef0cd);})[_0xfadb('0x22')](function(_0x367fbb){_0x47b3d1[_0xfadb('0x43')]=_0x367fbb;return _0x47b3d1;})[_0xfadb('0x22')](respondWithFilteredResult(_0x2ad1bc,_0x4ef0cd))[_0xfadb('0x44')](handleError(_0x2ad1bc,null));};exports[_0xfadb('0x45')]=function(_0x3d164d,_0x287a51){var _0x53dbe9={'raw':!![],'where':{'id':_0x3d164d[_0xfadb('0x46')]['id']}},_0x17a89e={};_0x17a89e[_0xfadb('0x2c')]=_['keys'](db[_0xfadb('0x2a')]['rawAttributes']);_0x17a89e[_0xfadb('0x2d')]=_['keys'](_0x3d164d[_0xfadb('0x2d')]);_0x17a89e[_0xfadb('0x2f')]=_[_0xfadb('0x31')](_0x17a89e[_0xfadb('0x2c')],_0x17a89e[_0xfadb('0x2d')]);_0x53dbe9['attributes']=_[_0xfadb('0x31')](_0x17a89e[_0xfadb('0x2c')],qs['fields'](_0x3d164d[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x53dbe9['attributes']=_0x53dbe9['attributes']['length']?_0x53dbe9[_0xfadb('0x30')]:_0x17a89e[_0xfadb('0x2c')];if(_0x3d164d[_0xfadb('0x2d')]['includeAll']){_0x53dbe9[_0xfadb('0x41')]=[{'all':!![]}];}_0x53dbe9=_['merge']({},_0x53dbe9,_0x3d164d[_0xfadb('0x3e')]);return db[_0xfadb('0x2a')]['find'](_0x53dbe9)[_0xfadb('0x22')](handleEntityNotFound(_0x287a51,null))[_0xfadb('0x22')](respondWithResult(_0x287a51,null))['catch'](handleError(_0x287a51,null));};exports[_0xfadb('0x47')]=function(_0x405d7c,_0x5c996c){return db[_0xfadb('0x2a')][_0xfadb('0x47')](_0x405d7c['body'],{})['then'](function(_0x5e551f){var _0x42e17d=_0x405d7c['user'][_0xfadb('0x24')]({'plain':!![]});if(!_0x42e17d)throw new Error(_0xfadb('0x48'));if(_0x42e17d[_0xfadb('0x49')]===_0xfadb('0x4a')){var _0x4ff9ee=_0x5e551f[_0xfadb('0x24')]({'plain':!![]});var _0x4bbdfa=_0xfadb('0x25');return db[_0xfadb('0x4b')][_0xfadb('0x4c')]({'where':{'name':_0x4bbdfa,'userProfileId':_0x42e17d[_0xfadb('0x4d')]},'raw':!![]})[_0xfadb('0x22')](function(_0x28e39a){if(_0x28e39a&&_0x28e39a[_0xfadb('0x4e')]===0x0){return db[_0xfadb('0x26')][_0xfadb('0x47')]({'name':_0x4ff9ee['name'],'resourceId':_0x4ff9ee['id'],'type':_0x28e39a[_0xfadb('0x29')],'sectionId':_0x28e39a['id']},{})[_0xfadb('0x22')](function(){return _0x5e551f;});}else{return _0x5e551f;}})['catch'](function(_0x568783){logger['error'](_0xfadb('0x4f'),_0x568783);throw _0x568783;});}return _0x5e551f;})[_0xfadb('0x22')](respondWithResult(_0x5c996c,0xc9))['catch'](handleError(_0x5c996c,null));};exports[_0xfadb('0x21')]=function(_0x48c8d4,_0x55663c){if(_0x48c8d4['body']['id']){delete _0x48c8d4[_0xfadb('0x50')]['id'];}return db[_0xfadb('0x2a')][_0xfadb('0x4c')]({'where':{'id':_0x48c8d4[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x55663c,null))[_0xfadb('0x22')](saveUpdates(_0x48c8d4[_0xfadb('0x50')],null))[_0xfadb('0x22')](respondWithResult(_0x55663c,null))[_0xfadb('0x44')](handleError(_0x55663c,null));};exports[_0xfadb('0x23')]=function(_0x4fb0bb,_0x41f0e1){return db[_0xfadb('0x2a')]['find']({'where':{'id':_0x4fb0bb['params']['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x41f0e1,null))[_0xfadb('0x22')](removeEntity(_0x41f0e1,null))[_0xfadb('0x44')](handleError(_0x41f0e1,null));};exports[_0xfadb('0x51')]=function(_0xc37817,_0x46b6be,_0x471a32){if(_0xc37817[_0xfadb('0x50')]['id']){delete _0xc37817[_0xfadb('0x50')]['id'];}return db[_0xfadb('0x2a')][_0xfadb('0x4c')]({'where':{'id':_0xc37817[_0xfadb('0x46')]['id']}})['then'](handleEntityNotFound(_0x46b6be,null))[_0xfadb('0x22')](function(_0x4b8ecb){if(_0x4b8ecb){_0xc37817['body'][_0xfadb('0x52')]=_0x4b8ecb['id'];return db[_0xfadb('0x2a')][_0xfadb('0x47')](_0xc37817[_0xfadb('0x50')]);}})[_0xfadb('0x22')](respondWithResult(_0x46b6be,null))['catch'](handleError(_0x46b6be,null));};exports[_0xfadb('0x53')]=function(_0x6e4313,_0x14ba04,_0x272941){var _0x421608={};var _0x29960f={};var _0x2cdd6d;var _0x46ab4d;return db[_0xfadb('0x2a')][_0xfadb('0x54')]({'where':{'id':_0x6e4313[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x14ba04,null))['then'](function(_0xa2be6a){if(_0xa2be6a){_0x2cdd6d=_0xa2be6a;_0x29960f[_0xfadb('0x2c')]=_[_0xfadb('0x2e')](db['Interval'][_0xfadb('0x2b')]);_0x29960f['query']=_[_0xfadb('0x2e')](_0x6e4313[_0xfadb('0x2d')]);_0x29960f[_0xfadb('0x2f')]=_[_0xfadb('0x31')](_0x29960f[_0xfadb('0x2c')],_0x29960f['query']);_0x421608[_0xfadb('0x30')]=_['intersection'](_0x29960f[_0xfadb('0x2c')],qs[_0xfadb('0x32')](_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x421608['attributes']=_0x421608[_0xfadb('0x30')][_0xfadb('0x33')]?_0x421608[_0xfadb('0x30')]:_0x29960f[_0xfadb('0x2c')];_0x421608[_0xfadb('0x36')]=qs[_0xfadb('0x37')](_0x6e4313['query'][_0xfadb('0x37')]);_0x421608[_0xfadb('0x38')]=qs[_0xfadb('0x2f')](_[_0xfadb('0x55')](_0x6e4313[_0xfadb('0x2d')],_0x29960f[_0xfadb('0x2f')]));if(_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x3d')]){_0x421608[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x421608['where'],{'$or':_['map'](_0x421608['attributes'],function(_0x1bac5f){var _0x5ea6d3={};_0x5ea6d3[_0x1bac5f]={'$like':'%'+_0x6e4313['query'][_0xfadb('0x3d')]+'%'};return _0x5ea6d3;})});}_0x421608=_[_0xfadb('0x39')]({},_0x421608,_0x6e4313['options']);return _0x2cdd6d[_0xfadb('0x53')](_0x421608);}})[_0xfadb('0x22')](function(_0x49af48){if(_0x49af48){_0x46ab4d=_0x49af48[_0xfadb('0x33')];if(!_0x6e4313[_0xfadb('0x2d')]['hasOwnProperty']('nolimit')){_0x421608['limit']=qs[_0xfadb('0x1c')](_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x1c')]);_0x421608[_0xfadb('0x1b')]=qs['offset'](_0x6e4313['query'][_0xfadb('0x1b')]);}return _0x2cdd6d['getIntervals'](_0x421608);}})[_0xfadb('0x22')](function(_0x4251b3){if(_0x4251b3){return _0x4251b3?{'count':_0x46ab4d,'rows':_0x4251b3}:null;}})[_0xfadb('0x22')](respondWithResult(_0x14ba04,null))['catch'](handleError(_0x14ba04,null));};exports[_0xfadb('0x56')]=function(_0x267bfc,_0x3db6ac,_0x4cd473){return db['Interval'][_0xfadb('0x54')]({'where':{'id':_0x267bfc[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x3db6ac,null))['then'](function(_0xf7af8f){if(_0xf7af8f){return db[_0xfadb('0x57')]['transaction'](function(_0x2c14ae){return db[_0xfadb('0x2a')][_0xfadb('0x23')]({'where':{'IntervalId':_0x267bfc[_0xfadb('0x46')]['id']},'transaction':_0x2c14ae})['then'](function(_0x58ee7a){var _0x91fec5=_[_0xfadb('0x3a')](_0x267bfc[_0xfadb('0x50')],function(_0x34145e){delete _0x34145e['id'];_0x34145e[_0xfadb('0x52')]=_0x267bfc[_0xfadb('0x46')]['id'];return _0x34145e;});return db[_0xfadb('0x2a')][_0xfadb('0x58')](_0x91fec5,{'transaction':_0x2c14ae});});})[_0xfadb('0x22')](function(){return db[_0xfadb('0x2a')][_0xfadb('0x42')]({'where':{'IntervalId':_0x267bfc[_0xfadb('0x46')]['id']}});});}})[_0xfadb('0x22')](respondWithResult(_0x3db6ac,null))[_0xfadb('0x44')](handleError(_0x3db6ac,null));}; \ No newline at end of file +var _0xa9df=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Interval','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','filter','options','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','user','role','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','lodash','crypto'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xa9df,0x1ee));var _0xfa9d=function(_0x3c2c97,_0x3f97f5){_0x3c2c97=_0x3c2c97-0x0;var _0x2ec77c=_0xa9df[_0x3c2c97];return _0x2ec77c;};'use strict';var pdf=require(_0xfa9d('0x0'));var emlformat=require(_0xfa9d('0x1'));var rimraf=require(_0xfa9d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa9d('0x3'));var rp=require('request-promise');var moment=require(_0xfa9d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfa9d('0x5'));var sox=require(_0xfa9d('0x6'));var csv=require(_0xfa9d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa9d('0x8'));var squel=require('squel');var crypto=require(_0xfa9d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfa9d('0xa'));var toCsv=require(_0xfa9d('0x7'));var querystring=require(_0xfa9d('0xb'));var Papa=require(_0xfa9d('0xc'));var Redis=require(_0xfa9d('0xd'));var authService=require(_0xfa9d('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa9d('0xf'))(_0xfa9d('0x10'));var utils=require(_0xfa9d('0x11'));var config=require(_0xfa9d('0x12'));var db=require(_0xfa9d('0x13'))['db'];var extensions=require(_0xfa9d('0x14'));function respondWithStatusCode(_0x34790b,_0x83bdee){_0x83bdee=_0x83bdee||0xcc;return function(_0xb262ea){if(_0xb262ea){return _0x34790b[_0xfa9d('0x15')](_0x83bdee);}return _0x34790b[_0xfa9d('0x16')](_0x83bdee)['end']();};}function respondWithResult(_0x591ce3,_0x5a437c){_0x5a437c=_0x5a437c||0xc8;return function(_0x131e68){if(_0x131e68){return _0x591ce3[_0xfa9d('0x16')](_0x5a437c)['json'](_0x131e68);}};}function respondWithFilteredResult(_0x11f75e,_0x4ce959){return function(_0x484a8c){if(_0x484a8c){var _0x4d9e47=_0x484a8c[_0xfa9d('0x17')],_0x9b76e9=_0x4ce959['offset'],_0x5daf3e=_0x4ce959[_0xfa9d('0x18')]+_0x4ce959[_0xfa9d('0x19')],_0x4dcac5;if(_0x5daf3e>=_0x4d9e47){_0x5daf3e=_0x4d9e47;_0x4dcac5=0xc8;}else{_0x4dcac5=0xce;}_0x11f75e[_0xfa9d('0x16')](_0x4dcac5);return _0x11f75e[_0xfa9d('0x1a')](_0xfa9d('0x1b'),_0x9b76e9+'-'+_0x5daf3e+'/'+_0x4d9e47)[_0xfa9d('0x1c')](_0x484a8c);}return null;};}function patchUpdates(_0xbb6e1d){return function(_0x3f0e17){try{jsonpatch[_0xfa9d('0x1d')](_0x3f0e17,_0xbb6e1d,!![]);}catch(_0x13e9a6){return BPromise[_0xfa9d('0x1e')](_0x13e9a6);}return _0x3f0e17['save']();};}function saveUpdates(_0x10730b,_0x4ad98f){return function(_0x59498c){if(_0x59498c){return _0x59498c[_0xfa9d('0x1f')](_0x10730b)[_0xfa9d('0x20')](function(_0x2d9b3a){return _0x2d9b3a;});}return null;};}function removeEntity(_0x596e20,_0x326525){return function(_0x49d18d){if(_0x49d18d){return _0x49d18d[_0xfa9d('0x21')]()['then'](function(){var _0x5a42e1=_0x49d18d[_0xfa9d('0x22')]({'plain':!![]});var _0x4316d4='Intervals';return db[_0xfa9d('0x23')][_0xfa9d('0x21')]({'where':{'type':_0x4316d4,'resourceId':_0x5a42e1['id']}})[_0xfa9d('0x20')](function(){return _0x49d18d;});})[_0xfa9d('0x20')](function(){_0x596e20[_0xfa9d('0x16')](0xcc)[_0xfa9d('0x24')]();});}};}function handleEntityNotFound(_0x6e8d9b,_0xbf2a98){return function(_0x4d8086){if(!_0x4d8086){_0x6e8d9b['sendStatus'](0x194);}return _0x4d8086;};}function handleError(_0x47c98b,_0x177be6){_0x177be6=_0x177be6||0x1f4;return function(_0x5c8476){logger[_0xfa9d('0x25')](_0x5c8476[_0xfa9d('0x26')]);if(_0x5c8476['name']){delete _0x5c8476[_0xfa9d('0x27')];}_0x47c98b['status'](_0x177be6)[_0xfa9d('0x28')](_0x5c8476);};}exports[_0xfa9d('0x29')]=function(_0x58bb3c,_0x342f2e){var _0x12bf38={},_0x2483a1={},_0x475549={'count':0x0,'rows':[]};var _0x299745=db[_0xfa9d('0x2a')]['rawAttributes'];_0x2483a1[_0xfa9d('0x2b')]=_[_0xfa9d('0x2c')](_0x299745);_0x2483a1[_0xfa9d('0x2d')]=_[_0xfa9d('0x2c')](_0x58bb3c['query']);_0x2483a1[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x2483a1[_0xfa9d('0x2b')],_0x2483a1[_0xfa9d('0x2d')]);_0x12bf38[_0xfa9d('0x30')]=_['intersection'](_0x2483a1['model'],qs[_0xfa9d('0x31')](_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x31')]));_0x12bf38['attributes']=_0x12bf38[_0xfa9d('0x30')]['length']?_0x12bf38[_0xfa9d('0x30')]:_0x2483a1[_0xfa9d('0x2b')];if(!_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x32')](_0xfa9d('0x33'))){_0x12bf38[_0xfa9d('0x19')]=qs[_0xfa9d('0x19')](_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x19')]);_0x12bf38[_0xfa9d('0x18')]=qs[_0xfa9d('0x18')](_0x58bb3c['query'][_0xfa9d('0x18')]);}_0x12bf38[_0xfa9d('0x34')]=qs[_0xfa9d('0x35')](_0x58bb3c[_0xfa9d('0x2d')]['sort']);_0x12bf38[_0xfa9d('0x36')]=qs[_0xfa9d('0x2e')](_[_0xfa9d('0x37')](_0x58bb3c[_0xfa9d('0x2d')],_0x2483a1['filters']));if(_0x58bb3c['query']['filter']){_0x12bf38[_0xfa9d('0x36')]=_[_0xfa9d('0x38')](_0x12bf38[_0xfa9d('0x36')],{'$or':_[_0xfa9d('0x39')](_0x299745,function(_0x48bc18){if(_0x48bc18['type'][_0xfa9d('0x3a')]!=='VIRTUAL'){var _0x339b9a={};_0x339b9a[_0x48bc18['field']]={'$like':'%'+_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x3b')]+'%'};return _0x339b9a;}})});}_0x12bf38=_[_0xfa9d('0x38')]({},_0x12bf38,_0x58bb3c[_0xfa9d('0x3c')]);var _0x2ca29c={'where':_0x12bf38['where']};return db[_0xfa9d('0x2a')]['count'](_0x2ca29c)[_0xfa9d('0x20')](function(_0x47e551){_0x475549[_0xfa9d('0x17')]=_0x47e551;if(_0x58bb3c[_0xfa9d('0x2d')][_0xfa9d('0x3d')]){_0x12bf38[_0xfa9d('0x3e')]=[{'all':!![]}];}return db[_0xfa9d('0x2a')][_0xfa9d('0x3f')](_0x12bf38);})['then'](function(_0x5596d0){_0x475549['rows']=_0x5596d0;return _0x475549;})[_0xfa9d('0x20')](respondWithFilteredResult(_0x342f2e,_0x12bf38))[_0xfa9d('0x40')](handleError(_0x342f2e,null));};exports['show']=function(_0x3dcd85,_0x212fb6){var _0x469ae2={'raw':!![],'where':{'id':_0x3dcd85[_0xfa9d('0x41')]['id']}},_0x2c93e9={};_0x2c93e9['model']=_[_0xfa9d('0x2c')](db[_0xfa9d('0x2a')][_0xfa9d('0x42')]);_0x2c93e9['query']=_[_0xfa9d('0x2c')](_0x3dcd85[_0xfa9d('0x2d')]);_0x2c93e9[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x2c93e9[_0xfa9d('0x2b')],_0x2c93e9['query']);_0x469ae2[_0xfa9d('0x30')]=_[_0xfa9d('0x2f')](_0x2c93e9[_0xfa9d('0x2b')],qs[_0xfa9d('0x31')](_0x3dcd85['query'][_0xfa9d('0x31')]));_0x469ae2[_0xfa9d('0x30')]=_0x469ae2[_0xfa9d('0x30')][_0xfa9d('0x43')]?_0x469ae2['attributes']:_0x2c93e9['model'];if(_0x3dcd85[_0xfa9d('0x2d')][_0xfa9d('0x3d')]){_0x469ae2[_0xfa9d('0x3e')]=[{'all':!![]}];}_0x469ae2=_[_0xfa9d('0x38')]({},_0x469ae2,_0x3dcd85['options']);return db[_0xfa9d('0x2a')][_0xfa9d('0x44')](_0x469ae2)[_0xfa9d('0x20')](handleEntityNotFound(_0x212fb6,null))[_0xfa9d('0x20')](respondWithResult(_0x212fb6,null))[_0xfa9d('0x40')](handleError(_0x212fb6,null));};exports[_0xfa9d('0x45')]=function(_0x24009b,_0x2e8877){return db[_0xfa9d('0x2a')][_0xfa9d('0x45')](_0x24009b[_0xfa9d('0x46')],{})[_0xfa9d('0x20')](function(_0x1c4c20){var _0x5c2364=_0x24009b[_0xfa9d('0x47')][_0xfa9d('0x22')]({'plain':!![]});if(!_0x5c2364)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c2364[_0xfa9d('0x48')]==='user'){var _0x586c76=_0x1c4c20[_0xfa9d('0x22')]({'plain':!![]});var _0x587810=_0xfa9d('0x49');return db[_0xfa9d('0x4a')][_0xfa9d('0x44')]({'where':{'name':_0x587810,'userProfileId':_0x5c2364['userProfileId']},'raw':!![]})[_0xfa9d('0x20')](function(_0x1fb118){if(_0x1fb118&&_0x1fb118[_0xfa9d('0x4b')]===0x0){return db[_0xfa9d('0x23')]['create']({'name':_0x586c76[_0xfa9d('0x27')],'resourceId':_0x586c76['id'],'type':_0x1fb118[_0xfa9d('0x27')],'sectionId':_0x1fb118['id']},{})[_0xfa9d('0x20')](function(){return _0x1c4c20;});}else{return _0x1c4c20;}})[_0xfa9d('0x40')](function(_0x48afe8){logger[_0xfa9d('0x25')](_0xfa9d('0x4c'),_0x48afe8);throw _0x48afe8;});}return _0x1c4c20;})[_0xfa9d('0x20')](respondWithResult(_0x2e8877,0xc9))[_0xfa9d('0x40')](handleError(_0x2e8877,null));};exports[_0xfa9d('0x1f')]=function(_0x30af68,_0x5d11ca){if(_0x30af68[_0xfa9d('0x46')]['id']){delete _0x30af68[_0xfa9d('0x46')]['id'];}return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x30af68['params']['id']}})['then'](handleEntityNotFound(_0x5d11ca,null))[_0xfa9d('0x20')](saveUpdates(_0x30af68['body'],null))[_0xfa9d('0x20')](respondWithResult(_0x5d11ca,null))[_0xfa9d('0x40')](handleError(_0x5d11ca,null));};exports['destroy']=function(_0x5eaaaf,_0x178aa2){return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x5eaaaf[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x178aa2,null))[_0xfa9d('0x20')](removeEntity(_0x178aa2,null))['catch'](handleError(_0x178aa2,null));};exports['addInterval']=function(_0x16b5bc,_0xfc90e5,_0x134b46){if(_0x16b5bc['body']['id']){delete _0x16b5bc[_0xfa9d('0x46')]['id'];}return db[_0xfa9d('0x2a')][_0xfa9d('0x44')]({'where':{'id':_0x16b5bc[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0xfc90e5,null))[_0xfa9d('0x20')](function(_0x130b2b){if(_0x130b2b){_0x16b5bc[_0xfa9d('0x46')]['IntervalId']=_0x130b2b['id'];return db[_0xfa9d('0x2a')][_0xfa9d('0x45')](_0x16b5bc[_0xfa9d('0x46')]);}})[_0xfa9d('0x20')](respondWithResult(_0xfc90e5,null))[_0xfa9d('0x40')](handleError(_0xfc90e5,null));};exports[_0xfa9d('0x4d')]=function(_0x11a3a5,_0x3e7c84,_0x2ad8db){var _0x3349e3={};var _0x3a9705={};var _0x379b54;var _0x2a1bb9;return db['Interval'][_0xfa9d('0x4e')]({'where':{'id':_0x11a3a5[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x3e7c84,null))[_0xfa9d('0x20')](function(_0x5bdc58){if(_0x5bdc58){_0x379b54=_0x5bdc58;_0x3a9705['model']=_['keys'](db[_0xfa9d('0x2a')][_0xfa9d('0x42')]);_0x3a9705['query']=_[_0xfa9d('0x2c')](_0x11a3a5[_0xfa9d('0x2d')]);_0x3a9705[_0xfa9d('0x2e')]=_[_0xfa9d('0x2f')](_0x3a9705[_0xfa9d('0x2b')],_0x3a9705[_0xfa9d('0x2d')]);_0x3349e3[_0xfa9d('0x30')]=_['intersection'](_0x3a9705[_0xfa9d('0x2b')],qs[_0xfa9d('0x31')](_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x31')]));_0x3349e3[_0xfa9d('0x30')]=_0x3349e3[_0xfa9d('0x30')][_0xfa9d('0x43')]?_0x3349e3[_0xfa9d('0x30')]:_0x3a9705[_0xfa9d('0x2b')];_0x3349e3['order']=qs[_0xfa9d('0x35')](_0x11a3a5[_0xfa9d('0x2d')]['sort']);_0x3349e3['where']=qs[_0xfa9d('0x2e')](_[_0xfa9d('0x37')](_0x11a3a5[_0xfa9d('0x2d')],_0x3a9705['filters']));if(_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x3b')]){_0x3349e3[_0xfa9d('0x36')]=_[_0xfa9d('0x38')](_0x3349e3[_0xfa9d('0x36')],{'$or':_['map'](_0x3349e3['attributes'],function(_0x26bc78){var _0x3873b7={};_0x3873b7[_0x26bc78]={'$like':'%'+_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x3b')]+'%'};return _0x3873b7;})});}_0x3349e3=_[_0xfa9d('0x38')]({},_0x3349e3,_0x11a3a5[_0xfa9d('0x3c')]);return _0x379b54[_0xfa9d('0x4d')](_0x3349e3);}})[_0xfa9d('0x20')](function(_0x457936){if(_0x457936){_0x2a1bb9=_0x457936['length'];if(!_0x11a3a5[_0xfa9d('0x2d')]['hasOwnProperty'](_0xfa9d('0x33'))){_0x3349e3['limit']=qs[_0xfa9d('0x19')](_0x11a3a5[_0xfa9d('0x2d')][_0xfa9d('0x19')]);_0x3349e3[_0xfa9d('0x18')]=qs[_0xfa9d('0x18')](_0x11a3a5['query']['offset']);}return _0x379b54[_0xfa9d('0x4d')](_0x3349e3);}})['then'](function(_0x1112f0){if(_0x1112f0){return _0x1112f0?{'count':_0x2a1bb9,'rows':_0x1112f0}:null;}})[_0xfa9d('0x20')](respondWithResult(_0x3e7c84,null))[_0xfa9d('0x40')](handleError(_0x3e7c84,null));};exports[_0xfa9d('0x4f')]=function(_0x3f240d,_0x769b2b,_0x25d421){return db['Interval'][_0xfa9d('0x4e')]({'where':{'id':_0x3f240d[_0xfa9d('0x41')]['id']}})[_0xfa9d('0x20')](handleEntityNotFound(_0x769b2b,null))[_0xfa9d('0x20')](function(_0x5cec68){if(_0x5cec68){return db[_0xfa9d('0x50')][_0xfa9d('0x51')](function(_0x2b791e){return db[_0xfa9d('0x2a')][_0xfa9d('0x21')]({'where':{'IntervalId':_0x3f240d[_0xfa9d('0x41')]['id']},'transaction':_0x2b791e})[_0xfa9d('0x20')](function(_0x3eee0f){var _0x4137b2=_[_0xfa9d('0x39')](_0x3f240d[_0xfa9d('0x46')],function(_0x22dd7e){delete _0x22dd7e['id'];_0x22dd7e[_0xfa9d('0x52')]=_0x3f240d[_0xfa9d('0x41')]['id'];return _0x22dd7e;});return db[_0xfa9d('0x2a')][_0xfa9d('0x53')](_0x4137b2,{'transaction':_0x2b791e});});})['then'](function(){return db['Interval'][_0xfa9d('0x3f')]({'where':{'IntervalId':_0x3f240d[_0xfa9d('0x41')]['id']}});});}})[_0xfa9d('0x20')](respondWithResult(_0x769b2b,null))[_0xfa9d('0x40')](handleError(_0x769b2b,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c690659..7add367 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 _0x1bf5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite'];(function(_0x1a4a6e,_0x152965){var _0x590be7=function(_0x59e8ba){while(--_0x59e8ba){_0x1a4a6e['push'](_0x1a4a6e['shift']());}};_0x590be7(++_0x152965);}(_0x1bf5,0xa0));var _0x51bf=function(_0x4c8540,_0x1243ae){_0x4c8540=_0x4c8540-0x0;var _0x32f264=_0x1bf5[_0x4c8540];return _0x32f264;};'use strict';var _=require(_0x51bf('0x0'));var util=require(_0x51bf('0x1'));var logger=require(_0x51bf('0x2'))(_0x51bf('0x3'));var moment=require(_0x51bf('0x4'));var BPromise=require(_0x51bf('0x5'));var rp=require(_0x51bf('0x6'));var fs=require('fs');var path=require(_0x51bf('0x7'));var rimraf=require(_0x51bf('0x8'));var config=require(_0x51bf('0x9'));var attributes=require(_0x51bf('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0x51bf('0xb')]=function(_0x381488,_0x2e6566){return _0x381488[_0x51bf('0xc')](_0x51bf('0xd'),attributes,{'tableName':_0x51bf('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e408d,_0x111fd2){extensions[_0x51bf('0xf')](_0x381488,_0x2e408d);},'afterBulkCreate':function(_0x28ad3b,_0x31dee7,_0x27a4ba){_0x27a4ba();extensions[_0x51bf('0xf')](_0x381488,_0x28ad3b[0x0]);},'afterUpdate':function(_0x574329,_0x462744){extensions[_0x51bf('0xf')](_0x381488,_0x574329);},'afterDestroy':function(_0x2c1335,_0x13c21d){extensions['rewrite'](_0x381488,_0x2c1335);}}});}; \ No newline at end of file +var _0x7ad9=['util','../../config/logger','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash'];(function(_0x1b8678,_0x472aa1){var _0x2e3eaf=function(_0x3fcac2){while(--_0x3fcac2){_0x1b8678['push'](_0x1b8678['shift']());}};_0x2e3eaf(++_0x472aa1);}(_0x7ad9,0x17f));var _0x97ad=function(_0x5f8d3c,_0x5eb54a){_0x5f8d3c=_0x5f8d3c-0x0;var _0x4d2bcb=_0x7ad9[_0x5f8d3c];return _0x4d2bcb;};'use strict';var _=require(_0x97ad('0x0'));var util=require(_0x97ad('0x1'));var logger=require(_0x97ad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x97ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97ad('0x4'));var config=require(_0x97ad('0x5'));var attributes=require(_0x97ad('0x6'));var extensions=require(_0x97ad('0x7'));module[_0x97ad('0x8')]=function(_0x1fd0d1,_0x2381d8){return _0x1fd0d1['define'](_0x97ad('0x9'),attributes,{'tableName':_0x97ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41dc05,_0x285e2c){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x41dc05);},'afterBulkCreate':function(_0x4c4e28,_0x34cf69,_0x594cb6){_0x594cb6();extensions[_0x97ad('0xb')](_0x1fd0d1,_0x4c4e28[0x0]);},'afterUpdate':function(_0x1c63ad,_0x2a8cbe){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x1c63ad);},'afterDestroy':function(_0x4a0d25,_0x29ccc8){extensions[_0x97ad('0xb')](_0x1fd0d1,_0x4a0d25);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8b143ef..34e059c 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 _0xf494=['attributes','limit','include','map','model','debug','stringify','ShowInterval','Interval','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error','message','catch','GetInterval','findAll','options','raw','where'];(function(_0x279860,_0x549387){var _0x1ed55e=function(_0x84716){while(--_0x84716){_0x279860['push'](_0x279860['shift']());}};_0x1ed55e(++_0x549387);}(_0xf494,0x1c6));var _0x4f49=function(_0x532f9e,_0x28cbce){_0x532f9e=_0x532f9e-0x0;var _0x589278=_0xf494[_0x532f9e];return _0x589278;};'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);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Interval'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'limit':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]||null:null,'include':_0x4e85df[_0x4f49('0x18')]?_0x4e85df['options'][_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1d')],function(_0x9d30aa){return{'model':db[_0x9d30aa[_0x4f49('0x1f')]],'as':_0x9d30aa['as'],'attributes':_0x9d30aa['attributes'],'include':_0x9d30aa['include']?_[_0x4f49('0x1e')](_0x9d30aa[_0x4f49('0x1d')],function(_0x4fedbb){return{'model':db[_0x4fedbb[_0x4f49('0x1f')]],'as':_0x4fedbb['as'],'attributes':_0x4fedbb[_0x4f49('0x1b')],'include':_0x4fedbb[_0x4f49('0x1d')]?_['map'](_0x4fedbb[_0x4f49('0x1d')],function(_0x2eed1c){return{'model':db[_0x2eed1c[_0x4f49('0x1f')]],'as':_0x2eed1c['as'],'attributes':_0x2eed1c[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x122404){logger['info']('GetInterval',_0x4e85df);logger[_0x4f49('0x20')](_0x4f49('0x16'),_0x4e85df,JSON[_0x4f49('0x21')](_0x122404));_0x5bb23b(_0x122404);})['catch'](function(_0x3cbfbd){logger[_0x4f49('0x13')](_0x4f49('0x16'),_0x3cbfbd['message'],_0x4e85df);_0x560592(_0x49cdaf['error'](0x1f4,_0x3cbfbd[_0x4f49('0x14')]));});});};exports[_0x4f49('0x22')]=function(_0x7a6ea0){var _0x5e7076=this;return new Promise(function(_0x1eaac6,_0x35aa33){return db[_0x4f49('0x23')][_0x4f49('0x24')]({'raw':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1d')],function(_0x492b16){return{'model':db[_0x492b16[_0x4f49('0x1f')]],'as':_0x492b16['as'],'attributes':_0x492b16[_0x4f49('0x1b')],'include':_0x492b16[_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x492b16[_0x4f49('0x1d')],function(_0x15e82b){return{'model':db[_0x15e82b[_0x4f49('0x1f')]],'as':_0x15e82b['as'],'attributes':_0x15e82b[_0x4f49('0x1b')],'include':_0x15e82b[_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x15e82b[_0x4f49('0x1d')],function(_0x343365){return{'model':db[_0x343365[_0x4f49('0x1f')]],'as':_0x343365['as'],'attributes':_0x343365['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x27b7a9){logger[_0x4f49('0xf')](_0x4f49('0x22'),_0x7a6ea0);logger[_0x4f49('0x20')](_0x4f49('0x22'),_0x7a6ea0,JSON[_0x4f49('0x21')](_0x27b7a9));_0x1eaac6(_0x27b7a9);})[_0x4f49('0x15')](function(_0x10bfc4){logger[_0x4f49('0x13')](_0x4f49('0x22'),_0x10bfc4[_0x4f49('0x14')],_0x7a6ea0);_0x35aa33(_0x5e7076[_0x4f49('0x13')](0x1f4,_0x10bfc4[_0x4f49('0x14')]));});});}; \ No newline at end of file +var _0x1b20=['rpc','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','catch','ShowInterval','find','raw','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28f1d0,_0x190e2c){var _0x495a23=function(_0x1da2dd){while(--_0x1da2dd){_0x28f1d0['push'](_0x28f1d0['shift']());}};_0x495a23(++_0x190e2c);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01b2('0x2'));var db=require(_0x01b2('0x3'))['db'];var utils=require(_0x01b2('0x4'));var logger=require(_0x01b2('0x5'))(_0x01b2('0x6'));var config=require(_0x01b2('0x7'));var jayson=require(_0x01b2('0x8'));var client=jayson[_0x01b2('0x9')][_0x01b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa64ad1,_0x43d561,_0x323470){return new BPromise(function(_0x508add,_0x132a08){return client['request'](_0xa64ad1,_0x323470)[_0x01b2('0xb')](function(_0x157fb6){logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));logger[_0x01b2('0xf')](_0x01b2('0x10'),_0x43d561,_0x01b2('0xe'),JSON['stringify'](_0x157fb6));if(_0x157fb6[_0x01b2('0x11')]){if(_0x157fb6['error'][_0x01b2('0x12')]===0x1f4){logger['error'](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x132a08(_0x157fb6[_0x01b2('0x11')]['message']);}logger[_0x01b2('0x11')](_0x01b2('0xd'),_0x43d561,_0x157fb6[_0x01b2('0x11')][_0x01b2('0x13')]);return _0x508add(_0x157fb6[_0x01b2('0x11')]['message']);}else{logger[_0x01b2('0xc')](_0x01b2('0xd'),_0x43d561,_0x01b2('0xe'));_0x508add(_0x157fb6[_0x01b2('0x14')]['message']);}})['catch'](function(_0x2a8458){logger[_0x01b2('0x11')]('Interval,\x20%s,\x20%s',_0x43d561,_0x2a8458);_0x132a08(_0x2a8458);});});}exports[_0x01b2('0x15')]=function(_0x444236){var _0x27a0bc=this;return new Promise(function(_0x5986f5,_0x25c55f){return db[_0x01b2('0x16')][_0x01b2('0x17')]({'raw':_0x444236[_0x01b2('0x18')]?_0x444236[_0x01b2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x444236[_0x01b2('0x18')]?_0x444236['options'][_0x01b2('0x19')]||null:null,'attributes':_0x444236['options']?_0x444236[_0x01b2('0x18')][_0x01b2('0x1a')]||null:null,'limit':_0x444236[_0x01b2('0x18')]?_0x444236['options'][_0x01b2('0x1b')]||null:null,'include':_0x444236[_0x01b2('0x18')]?_0x444236[_0x01b2('0x18')][_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x444236['options'][_0x01b2('0x1c')],function(_0x539db1){return{'model':db[_0x539db1['model']],'as':_0x539db1['as'],'attributes':_0x539db1[_0x01b2('0x1a')],'include':_0x539db1[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x539db1[_0x01b2('0x1c')],function(_0x2e32c1){return{'model':db[_0x2e32c1[_0x01b2('0x1e')]],'as':_0x2e32c1['as'],'attributes':_0x2e32c1['attributes'],'include':_0x2e32c1[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x2e32c1[_0x01b2('0x1c')],function(_0x17274f){return{'model':db[_0x17274f['model']],'as':_0x17274f['as'],'attributes':_0x17274f[_0x01b2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x122925){logger[_0x01b2('0xc')]('GetInterval',_0x444236);logger[_0x01b2('0xf')]('GetInterval',_0x444236,JSON['stringify'](_0x122925));_0x5986f5(_0x122925);})[_0x01b2('0x1f')](function(_0x4363ec){logger['error'](_0x01b2('0x15'),_0x4363ec[_0x01b2('0x13')],_0x444236);_0x25c55f(_0x27a0bc[_0x01b2('0x11')](0x1f4,_0x4363ec[_0x01b2('0x13')]));});});};exports[_0x01b2('0x20')]=function(_0xd7ad6b){var _0xd60b46=this;return new Promise(function(_0x3169f5,_0x27eeb3){return db[_0x01b2('0x16')][_0x01b2('0x21')]({'raw':_0xd7ad6b['options']?_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x22')]===undefined?!![]:![]:!![],'where':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x19')]||null:null,'attributes':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b['options']['attributes']||null:null,'include':_0xd7ad6b[_0x01b2('0x18')]?_0xd7ad6b['options']['include']?_[_0x01b2('0x1d')](_0xd7ad6b[_0x01b2('0x18')][_0x01b2('0x1c')],function(_0x3b1307){return{'model':db[_0x3b1307['model']],'as':_0x3b1307['as'],'attributes':_0x3b1307[_0x01b2('0x1a')],'include':_0x3b1307['include']?_[_0x01b2('0x1d')](_0x3b1307['include'],function(_0x5af6ff){return{'model':db[_0x5af6ff['model']],'as':_0x5af6ff['as'],'attributes':_0x5af6ff[_0x01b2('0x1a')],'include':_0x5af6ff[_0x01b2('0x1c')]?_[_0x01b2('0x1d')](_0x5af6ff[_0x01b2('0x1c')],function(_0x4d80d0){return{'model':db[_0x4d80d0[_0x01b2('0x1e')]],'as':_0x4d80d0['as'],'attributes':_0x4d80d0[_0x01b2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xecbce4){logger[_0x01b2('0xc')](_0x01b2('0x20'),_0xd7ad6b);logger[_0x01b2('0xf')](_0x01b2('0x20'),_0xd7ad6b,JSON[_0x01b2('0x23')](_0xecbce4));_0x3169f5(_0xecbce4);})['catch'](function(_0x2fb530){logger[_0x01b2('0x11')]('ShowInterval',_0x2fb530['message'],_0xd7ad6b);_0x27eeb3(_0xd60b46[_0x01b2('0x11')](0x1f4,_0x2fb530[_0x01b2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 118a128..df25f85 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x57c0cc,_0xc7c917){var _0xc5d912=function(_0x69246b){while(--_0x69246b){_0x57c0cc['push'](_0x57c0cc['shift']());}};_0xc5d912(++_0xc7c917);}(_0x2032,0xd9));var _0x2203=function(_0x2064fe,_0x227f68){_0x2064fe=_0x2064fe-0x0;var _0x559631=_0x2032[_0x2064fe];return _0x559631;};'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 +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x43bf97,_0x3083d7){var _0x55ee6a=function(_0x4b37ef){while(--_0x4b37ef){_0x43bf97['push'](_0x43bf97['shift']());}};_0x55ee6a(++_0x3083d7);}(_0xdb28,0x106));var _0x8db2=function(_0x472432,_0x412b95){_0x472432=_0x472432-0x0;var _0x4038f8=_0xdb28[_0x472432];return _0x4038f8;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6ee5ac4..f2fb064 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 _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x3f3913,_0x4b43e1){var _0x16dea4=function(_0xaa6b41){while(--_0xaa6b41){_0x3f3913['push'](_0x3f3913['shift']());}};_0x16dea4(++_0x4b43e1);}(_0xe706,0xa3));var _0x6e70=function(_0x1c12bd,_0x348360){_0x1c12bd=_0x1c12bd-0x0;var _0x1de620=_0xe706[_0x1c12bd];return _0x1de620;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);}; \ No newline at end of file +var _0xbaf0=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x46ecbf,_0x23485d){var _0x476483=function(_0x467b06){while(--_0x467b06){_0x46ecbf['push'](_0x46ecbf['shift']());}};_0x476483(++_0x23485d);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var https=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var USERNAME=_0x0baf('0x3');var PASSWORD=_0x0baf('0x4');function openIssue(_0x4d2e72,_0x5a3e42){var _0x232cc7={'fields':{'project':{'key':_0x4d2e72[_0x0baf('0x5')]||_0x0baf('0x6')},'summary':(_0x4d2e72[_0x0baf('0x7')]||_0x0baf('0x8'))+_0x0baf('0x9')+_0x4d2e72['ip'],'description':_0x4d2e72[_0x0baf('0xa')]||JSON[_0x0baf('0xb')](_0x4d2e72),'issuetype':{'name':_0x4d2e72[_0x0baf('0xc')]||'Bug'}}};_0x232cc7[_0x0baf('0xd')]['customfield_11500']=_0x4d2e72[_0x0baf('0xe')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0xf')]=_0x4d2e72[_0x0baf('0x10')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x11')]=_0x4d2e72[_0x0baf('0x12')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x13')]=_0x4d2e72[_0x0baf('0x14')];_0x232cc7[_0x0baf('0xd')]['customfield_11504']=_0x4d2e72['reason'];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x15')]=_0x4d2e72['ip'];var _0x5db689={'host':_0x0baf('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0baf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0baf('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0baf('0x19')](_0x0baf('0x1a'))}};var _0x2bc381=JSON[_0x0baf('0xb')](_0x232cc7);var _0x469599=https['request'](_0x5db689,function(_0x4cd79d){_0x4cd79d[_0x0baf('0x1b')](_0x0baf('0x1c'));var _0x283408='';_0x4cd79d['on'](_0x0baf('0x1d'),function(_0x2cf7da){_0x283408+=_0x2cf7da;});_0x4cd79d['on'](_0x0baf('0x1e'),function(){if(_0x5a3e42){return _0x5a3e42['status'](_0x4cd79d[_0x0baf('0x1f')])[_0x0baf('0x20')](JSON[_0x0baf('0x21')](_0x283408));}});});_0x469599['on'](_0x0baf('0x22'),function(_0x47070d){if(_0x5a3e42){return _0x5a3e42[_0x0baf('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0baf('0x24')}]});}});_0x469599[_0x0baf('0x25')](_0x2bc381);_0x469599[_0x0baf('0x1e')]();}exports[_0x0baf('0x26')]=openIssue;exports[_0x0baf('0x27')]=function(_0x3e3e20,_0x210cd8){_0x3e3e20[_0x0baf('0x28')]['ip']=_0x3e3e20[_0x0baf('0x29')][_0x0baf('0x2a')]||_0x3e3e20['connection'][_0x0baf('0x2b')]||_0x3e3e20['socket'][_0x0baf('0x2b')]||_0x3e3e20['connection']['socket'][_0x0baf('0x2b')];return openIssue(_0x3e3e20['body'],_0x210cd8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8fef3d2..20232fe 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 _0xbcde=['/describe','describe','/:id','show','create','put','update','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x486083,_0xeb3b54){var _0x1db44e=function(_0x2586fc){while(--_0x2586fc){_0x486083['push'](_0x486083['shift']());}};_0x1db44e(++_0xeb3b54);}(_0xbcde,0x13a));var _0xebcd=function(_0x254a6f,_0x18e991){_0x254a6f=_0x254a6f-0x0;var _0x2abc55=_0xbcde[_0x254a6f];return _0x2abc55;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebcd('0x0'));var timeout=require(_0xebcd('0x1'));var express=require('express');var router=express[_0xebcd('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xebcd('0x3'));var config=require(_0xebcd('0x4'));var controller=require(_0xebcd('0x5'));router[_0xebcd('0x6')]('/',auth[_0xebcd('0x7')](),controller[_0xebcd('0x8')]);router[_0xebcd('0x6')](_0xebcd('0x9'),auth[_0xebcd('0x7')](),controller[_0xebcd('0xa')]);router[_0xebcd('0x6')](_0xebcd('0xb'),auth[_0xebcd('0x7')](),controller[_0xebcd('0xc')]);router['post']('/',auth[_0xebcd('0x7')](),controller[_0xebcd('0xd')]);router[_0xebcd('0xe')](_0xebcd('0xb'),auth['isAuthenticated'](),controller[_0xebcd('0xf')]);router['delete'](_0xebcd('0xb'),auth[_0xebcd('0x7')](),controller['destroy']);module[_0xebcd('0x10')]=router; \ No newline at end of file +var _0x950c=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x17ec0f,_0x5126a3){var _0x3a4191=function(_0x3ed243){while(--_0x3ed243){_0x17ec0f['push'](_0x17ec0f['shift']());}};_0x3a4191(++_0x5126a3);}(_0x950c,0x18e));var _0xc950=function(_0x5e4f92,_0x5ef2d0){_0x5e4f92=_0x5e4f92-0x0;var _0x3bf6ba=_0x950c[_0x5e4f92];return _0x3bf6ba;};'use strict';var multer=require(_0xc950('0x0'));var util=require(_0xc950('0x1'));var path=require(_0xc950('0x2'));var timeout=require(_0xc950('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc950('0x4'));var interaction=require(_0xc950('0x5'));var config=require(_0xc950('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xc950('0x7')]('/',auth[_0xc950('0x8')](),controller[_0xc950('0x9')]);router[_0xc950('0x7')](_0xc950('0xa'),auth['isAuthenticated'](),controller[_0xc950('0xb')]);router[_0xc950('0x7')](_0xc950('0xc'),auth[_0xc950('0x8')](),controller[_0xc950('0xd')]);router[_0xc950('0xe')]('/',auth[_0xc950('0x8')](),controller['create']);router[_0xc950('0xf')](_0xc950('0xc'),auth['isAuthenticated'](),controller[_0xc950('0x10')]);router[_0xc950('0x11')](_0xc950('0xc'),auth['isAuthenticated'](),controller[_0xc950('0x12')]);module[_0xc950('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 8109bf1..1486f71 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 _0x1be1=['STRING','TEXT'];(function(_0x7f9e59,_0x203192){var _0x1b505c=function(_0x234bb0){while(--_0x234bb0){_0x7f9e59['push'](_0x7f9e59['shift']());}};_0x1b505c(++_0x203192);}(_0x1be1,0x192));var _0x11be=function(_0x56c23a,_0x23e40a){_0x56c23a=_0x56c23a-0x0;var _0x4f965f=_0x1be1[_0x56c23a];return _0x4f965f;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x11be('0x0')]},'answer':{'type':Sequelize[_0x11be('0x1')]('long')},'membername':{'type':Sequelize[_0x11be('0x0')]},'projectname':{'type':Sequelize[_0x11be('0x0')]},'queue':{'type':Sequelize[_0x11be('0x0')]},'uniqueid':{'type':Sequelize[_0x11be('0x0')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x11be('0x0')]},'questionId':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file +var _0xd73a=['exports','STRING','TEXT','long','sequelize'];(function(_0x71ce36,_0x563612){var _0x6177c0=function(_0x1e46d8){while(--_0x1e46d8){_0x71ce36['push'](_0x71ce36['shift']());}};_0x6177c0(++_0x563612);}(_0xd73a,0x171));var _0xad73=function(_0x492445,_0x1454f9){_0x492445=_0x492445-0x0;var _0x34ca20=_0xd73a[_0x492445];return _0x34ca20;};'use strict';var Sequelize=require(_0xad73('0x0'));module[_0xad73('0x1')]={'question':{'type':Sequelize[_0xad73('0x2')]},'answer':{'type':Sequelize[_0xad73('0x3')](_0xad73('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xad73('0x2')]},'uniqueid':{'type':Sequelize[_0xad73('0x2')]},'calleridname':{'type':Sequelize[_0xad73('0x2')]},'calleridnum':{'type':Sequelize[_0xad73('0x2')]},'questionId':{'type':Sequelize[_0xad73('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index c9a496d..2bc4c42 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 _0x7579=['then','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','JscriptyAnswerReport','findAll','rows','catch','params','include','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0x7579,0x1e2));var _0x9757=function(_0x5bce69,_0x2669c4){_0x5bce69=_0x5bce69-0x0;var _0x20c418=_0x7579[_0x5bce69];return _0x20c418;};'use strict';var pdf=require(_0x9757('0x0'));var emlformat=require(_0x9757('0x1'));var rimraf=require(_0x9757('0x2'));var zipdir=require(_0x9757('0x3'));var jsonpatch=require(_0x9757('0x4'));var rp=require(_0x9757('0x5'));var moment=require('moment');var BPromise=require(_0x9757('0x6'));var Mustache=require(_0x9757('0x7'));var util=require(_0x9757('0x8'));var path=require(_0x9757('0x9'));var sox=require('sox');var csv=require(_0x9757('0xa'));var ejs=require(_0x9757('0xb'));var fs=require('fs');var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xa'));var querystring=require(_0x9757('0xf'));var Papa=require('papaparse');var Redis=require(_0x9757('0x10'));var authService=require(_0x9757('0x11'));var qs=require(_0x9757('0x12'));var hardwareService=require(_0x9757('0x13'));var logger=require(_0x9757('0x14'))(_0x9757('0x15'));var utils=require(_0x9757('0x16'));var config=require(_0x9757('0x17'));var db=require(_0x9757('0x18'))['db'];function respondWithStatusCode(_0x141e64,_0x7491ea){_0x7491ea=_0x7491ea||0xcc;return function(_0x5c19c9){if(_0x5c19c9){return _0x141e64[_0x9757('0x19')](_0x7491ea);}return _0x141e64[_0x9757('0x1a')](_0x7491ea)[_0x9757('0x1b')]();};}function respondWithResult(_0x595a9e,_0x32d1c5){_0x32d1c5=_0x32d1c5||0xc8;return function(_0x39fa5c){if(_0x39fa5c){return _0x595a9e[_0x9757('0x1a')](_0x32d1c5)[_0x9757('0x1c')](_0x39fa5c);}};}function respondWithFilteredResult(_0x224229,_0x3abf05){return function(_0x105e56){if(_0x105e56){var _0x4b994d=_0x105e56[_0x9757('0x1d')],_0x1fd6f6=_0x3abf05[_0x9757('0x1e')],_0x55ded7=_0x3abf05[_0x9757('0x1e')]+_0x3abf05[_0x9757('0x1f')],_0x17ab45;if(_0x55ded7>=_0x4b994d){_0x55ded7=_0x4b994d;_0x17ab45=0xc8;}else{_0x17ab45=0xce;}_0x224229[_0x9757('0x1a')](_0x17ab45);return _0x224229['set'](_0x9757('0x20'),_0x1fd6f6+'-'+_0x55ded7+'/'+_0x4b994d)[_0x9757('0x1c')](_0x105e56);}return null;};}function patchUpdates(_0x1c9449){return function(_0x284952){try{jsonpatch[_0x9757('0x21')](_0x284952,_0x1c9449,!![]);}catch(_0xd2306b){return BPromise[_0x9757('0x22')](_0xd2306b);}return _0x284952['save']();};}function saveUpdates(_0x185506,_0x4c1b66){return function(_0x517504){if(_0x517504){return _0x517504[_0x9757('0x23')](_0x185506)[_0x9757('0x24')](function(_0x1443a9){return _0x1443a9;});}return null;};}function removeEntity(_0x36cf6d,_0x559135){return function(_0x4ef000){if(_0x4ef000){return _0x4ef000['destroy']()[_0x9757('0x24')](function(){_0x36cf6d[_0x9757('0x1a')](0xcc)[_0x9757('0x1b')]();});}};}function handleEntityNotFound(_0x21435e,_0x5dc2fa){return function(_0x11f5ac){if(!_0x11f5ac){_0x21435e[_0x9757('0x19')](0x194);}return _0x11f5ac;};}function handleError(_0x5d6554,_0x293951){_0x293951=_0x293951||0x1f4;return function(_0x956048){logger['error'](_0x956048[_0x9757('0x25')]);if(_0x956048[_0x9757('0x26')]){delete _0x956048[_0x9757('0x26')];}_0x5d6554[_0x9757('0x1a')](_0x293951)[_0x9757('0x27')](_0x956048);};}exports[_0x9757('0x28')]=function(_0x4e6b86,_0x2a9438){var _0x57c770={},_0x2f2fe7={},_0x398c48={'count':0x0,'rows':[]};var _0x58ae5e=db['JscriptyAnswerReport'][_0x9757('0x29')];_0x2f2fe7[_0x9757('0x2a')]=_[_0x9757('0x2b')](_0x58ae5e);_0x2f2fe7[_0x9757('0x2c')]=_['keys'](_0x4e6b86[_0x9757('0x2c')]);_0x2f2fe7[_0x9757('0x2d')]=_[_0x9757('0x2e')](_0x2f2fe7[_0x9757('0x2a')],_0x2f2fe7[_0x9757('0x2c')]);_0x57c770[_0x9757('0x2f')]=_['intersection'](_0x2f2fe7[_0x9757('0x2a')],qs[_0x9757('0x30')](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x30')]));_0x57c770[_0x9757('0x2f')]=_0x57c770[_0x9757('0x2f')][_0x9757('0x31')]?_0x57c770['attributes']:_0x2f2fe7[_0x9757('0x2a')];if(!_0x4e6b86[_0x9757('0x2c')][_0x9757('0x32')](_0x9757('0x33'))){_0x57c770[_0x9757('0x1f')]=qs[_0x9757('0x1f')](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x1f')]);_0x57c770['offset']=qs[_0x9757('0x1e')](_0x4e6b86['query'][_0x9757('0x1e')]);}_0x57c770[_0x9757('0x34')]=qs['sort'](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x35')]);_0x57c770[_0x9757('0x36')]=qs[_0x9757('0x2d')](_[_0x9757('0x37')](_0x4e6b86[_0x9757('0x2c')],_0x2f2fe7[_0x9757('0x2d')]));if(_0x4e6b86[_0x9757('0x2c')][_0x9757('0x38')]){_0x57c770[_0x9757('0x36')]=_['merge'](_0x57c770[_0x9757('0x36')],{'$or':_[_0x9757('0x39')](_0x58ae5e,function(_0x457d6c){if(_0x457d6c['type'][_0x9757('0x3a')]!==_0x9757('0x3b')){var _0x1317d6={};_0x1317d6[_0x457d6c[_0x9757('0x3c')]]={'$like':'%'+_0x4e6b86[_0x9757('0x2c')][_0x9757('0x38')]+'%'};return _0x1317d6;}})});}_0x57c770=_[_0x9757('0x3d')]({},_0x57c770,_0x4e6b86[_0x9757('0x3e')]);var _0x12de51={'where':_0x57c770['where']};return db['JscriptyAnswerReport'][_0x9757('0x1d')](_0x12de51)[_0x9757('0x24')](function(_0x11c710){_0x398c48[_0x9757('0x1d')]=_0x11c710;if(_0x4e6b86['query'][_0x9757('0x3f')]){_0x57c770['include']=[{'all':!![]}];}return db[_0x9757('0x40')][_0x9757('0x41')](_0x57c770);})[_0x9757('0x24')](function(_0x59f7ca){_0x398c48[_0x9757('0x42')]=_0x59f7ca;return _0x398c48;})[_0x9757('0x24')](respondWithFilteredResult(_0x2a9438,_0x57c770))[_0x9757('0x43')](handleError(_0x2a9438,null));};exports['show']=function(_0x37b223,_0x5eea8b){var _0x50f0e4={'raw':!![],'where':{'id':_0x37b223[_0x9757('0x44')]['id']}},_0x3aea44={};_0x3aea44[_0x9757('0x2a')]=_[_0x9757('0x2b')](db[_0x9757('0x40')]['rawAttributes']);_0x3aea44['query']=_['keys'](_0x37b223[_0x9757('0x2c')]);_0x3aea44[_0x9757('0x2d')]=_[_0x9757('0x2e')](_0x3aea44['model'],_0x3aea44[_0x9757('0x2c')]);_0x50f0e4[_0x9757('0x2f')]=_['intersection'](_0x3aea44[_0x9757('0x2a')],qs[_0x9757('0x30')](_0x37b223[_0x9757('0x2c')][_0x9757('0x30')]));_0x50f0e4['attributes']=_0x50f0e4[_0x9757('0x2f')][_0x9757('0x31')]?_0x50f0e4[_0x9757('0x2f')]:_0x3aea44[_0x9757('0x2a')];if(_0x37b223[_0x9757('0x2c')][_0x9757('0x3f')]){_0x50f0e4[_0x9757('0x45')]=[{'all':!![]}];}_0x50f0e4=_[_0x9757('0x3d')]({},_0x50f0e4,_0x37b223[_0x9757('0x3e')]);return db['JscriptyAnswerReport']['find'](_0x50f0e4)[_0x9757('0x24')](handleEntityNotFound(_0x5eea8b,null))[_0x9757('0x24')](respondWithResult(_0x5eea8b,null))[_0x9757('0x43')](handleError(_0x5eea8b,null));};exports['create']=function(_0x229f8a,_0x20413a){return db[_0x9757('0x40')]['create'](_0x229f8a[_0x9757('0x46')],{})[_0x9757('0x24')](respondWithResult(_0x20413a,0xc9))['catch'](handleError(_0x20413a,null));};exports['update']=function(_0x4e613d,_0x45771a){if(_0x4e613d[_0x9757('0x46')]['id']){delete _0x4e613d[_0x9757('0x46')]['id'];}return db['JscriptyAnswerReport'][_0x9757('0x47')]({'where':{'id':_0x4e613d['params']['id']}})[_0x9757('0x24')](handleEntityNotFound(_0x45771a,null))[_0x9757('0x24')](saveUpdates(_0x4e613d['body'],null))[_0x9757('0x24')](respondWithResult(_0x45771a,null))[_0x9757('0x43')](handleError(_0x45771a,null));};exports[_0x9757('0x48')]=function(_0x4487a4,_0x118d02){return db['JscriptyAnswerReport'][_0x9757('0x47')]({'where':{'id':_0x4487a4[_0x9757('0x44')]['id']}})[_0x9757('0x24')](handleEntityNotFound(_0x118d02,null))[_0x9757('0x24')](removeEntity(_0x118d02,null))[_0x9757('0x43')](handleError(_0x118d02,null));};exports[_0x9757('0x49')]=function(_0x7a5cb9,_0x4e3ebc){return db['JscriptyAnswerReport'][_0x9757('0x49')]()['then'](respondWithResult(_0x4e3ebc,null))['catch'](handleError(_0x4e3ebc,null));}; \ No newline at end of file +var _0x5c12=['rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','show','keys','includeAll','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','reject','save','update','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport'];(function(_0x1dd22e,_0x5e9f64){var _0x4ba820=function(_0xb7e887){while(--_0xb7e887){_0x1dd22e['push'](_0x1dd22e['shift']());}};_0x4ba820(++_0x5e9f64);}(_0x5c12,0x188));var _0x25c1=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x5c12[_0x149a9b];return _0x2c2bf6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x25c1('0x0'));var rimraf=require(_0x25c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c1('0x2'));var rp=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var BPromise=require(_0x25c1('0x5'));var Mustache=require(_0x25c1('0x6'));var util=require(_0x25c1('0x7'));var path=require(_0x25c1('0x8'));var sox=require('sox');var csv=require(_0x25c1('0x9'));var ejs=require(_0x25c1('0xa'));var fs=require('fs');var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0x9'));var querystring=require(_0x25c1('0xe'));var Papa=require(_0x25c1('0xf'));var Redis=require('ioredis');var authService=require(_0x25c1('0x10'));var qs=require(_0x25c1('0x11'));var hardwareService=require(_0x25c1('0x12'));var logger=require(_0x25c1('0x13'))(_0x25c1('0x14'));var utils=require('../../config/utils');var config=require(_0x25c1('0x15'));var db=require(_0x25c1('0x16'))['db'];function respondWithStatusCode(_0x49fb8e,_0x256ecd){_0x256ecd=_0x256ecd||0xcc;return function(_0x209af5){if(_0x209af5){return _0x49fb8e[_0x25c1('0x17')](_0x256ecd);}return _0x49fb8e[_0x25c1('0x18')](_0x256ecd)['end']();};}function respondWithResult(_0x569ef9,_0x4ef5d7){_0x4ef5d7=_0x4ef5d7||0xc8;return function(_0x54f6f4){if(_0x54f6f4){return _0x569ef9[_0x25c1('0x18')](_0x4ef5d7)[_0x25c1('0x19')](_0x54f6f4);}};}function respondWithFilteredResult(_0x342cd4,_0x6eba15){return function(_0x17a032){if(_0x17a032){var _0x4ea926=_0x17a032['count'],_0x4638f0=_0x6eba15[_0x25c1('0x1a')],_0x55b62d=_0x6eba15[_0x25c1('0x1a')]+_0x6eba15['limit'],_0x5d631e;if(_0x55b62d>=_0x4ea926){_0x55b62d=_0x4ea926;_0x5d631e=0xc8;}else{_0x5d631e=0xce;}_0x342cd4['status'](_0x5d631e);return _0x342cd4[_0x25c1('0x1b')]('Content-Range',_0x4638f0+'-'+_0x55b62d+'/'+_0x4ea926)[_0x25c1('0x19')](_0x17a032);}return null;};}function patchUpdates(_0x23a418){return function(_0x5c3c5d){try{jsonpatch['apply'](_0x5c3c5d,_0x23a418,!![]);}catch(_0x542768){return BPromise[_0x25c1('0x1c')](_0x542768);}return _0x5c3c5d[_0x25c1('0x1d')]();};}function saveUpdates(_0x22a36e,_0x1bf95d){return function(_0x481c12){if(_0x481c12){return _0x481c12[_0x25c1('0x1e')](_0x22a36e)[_0x25c1('0x1f')](function(_0x34454a){return _0x34454a;});}return null;};}function removeEntity(_0x29e637,_0x517a46){return function(_0x4c3259){if(_0x4c3259){return _0x4c3259[_0x25c1('0x20')]()[_0x25c1('0x1f')](function(){_0x29e637[_0x25c1('0x18')](0xcc)[_0x25c1('0x21')]();});}};}function handleEntityNotFound(_0x15cf2f,_0x1a4b89){return function(_0x2ba595){if(!_0x2ba595){_0x15cf2f[_0x25c1('0x17')](0x194);}return _0x2ba595;};}function handleError(_0x14ffd9,_0x261604){_0x261604=_0x261604||0x1f4;return function(_0x2f78dd){logger[_0x25c1('0x22')](_0x2f78dd[_0x25c1('0x23')]);if(_0x2f78dd['name']){delete _0x2f78dd[_0x25c1('0x24')];}_0x14ffd9[_0x25c1('0x18')](_0x261604)[_0x25c1('0x25')](_0x2f78dd);};}exports[_0x25c1('0x26')]=function(_0x21fdb8,_0x326a5f){var _0x5ad776={},_0x17c924={},_0x428ce8={'count':0x0,'rows':[]};var _0x6cb14f=db[_0x25c1('0x27')][_0x25c1('0x28')];_0x17c924[_0x25c1('0x29')]=_['keys'](_0x6cb14f);_0x17c924[_0x25c1('0x2a')]=_['keys'](_0x21fdb8[_0x25c1('0x2a')]);_0x17c924[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_0x17c924[_0x25c1('0x29')],_0x17c924[_0x25c1('0x2a')]);_0x5ad776[_0x25c1('0x2d')]=_[_0x25c1('0x2c')](_0x17c924[_0x25c1('0x29')],qs[_0x25c1('0x2e')](_0x21fdb8['query'][_0x25c1('0x2e')]));_0x5ad776['attributes']=_0x5ad776['attributes'][_0x25c1('0x2f')]?_0x5ad776[_0x25c1('0x2d')]:_0x17c924['model'];if(!_0x21fdb8[_0x25c1('0x2a')]['hasOwnProperty'](_0x25c1('0x30'))){_0x5ad776['limit']=qs[_0x25c1('0x31')](_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x31')]);_0x5ad776[_0x25c1('0x1a')]=qs[_0x25c1('0x1a')](_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x1a')]);}_0x5ad776[_0x25c1('0x32')]=qs['sort'](_0x21fdb8[_0x25c1('0x2a')]['sort']);_0x5ad776[_0x25c1('0x33')]=qs['filters'](_[_0x25c1('0x34')](_0x21fdb8[_0x25c1('0x2a')],_0x17c924[_0x25c1('0x2b')]));if(_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x35')]){_0x5ad776[_0x25c1('0x33')]=_[_0x25c1('0x36')](_0x5ad776[_0x25c1('0x33')],{'$or':_[_0x25c1('0x37')](_0x6cb14f,function(_0x2d060c){if(_0x2d060c[_0x25c1('0x38')][_0x25c1('0x39')]!==_0x25c1('0x3a')){var _0x1b6e92={};_0x1b6e92[_0x2d060c[_0x25c1('0x3b')]]={'$like':'%'+_0x21fdb8[_0x25c1('0x2a')][_0x25c1('0x35')]+'%'};return _0x1b6e92;}})});}_0x5ad776=_[_0x25c1('0x36')]({},_0x5ad776,_0x21fdb8[_0x25c1('0x3c')]);var _0x357385={'where':_0x5ad776['where']};return db[_0x25c1('0x27')][_0x25c1('0x3d')](_0x357385)['then'](function(_0x32ab98){_0x428ce8['count']=_0x32ab98;if(_0x21fdb8[_0x25c1('0x2a')]['includeAll']){_0x5ad776[_0x25c1('0x3e')]=[{'all':!![]}];}return db[_0x25c1('0x27')][_0x25c1('0x3f')](_0x5ad776);})[_0x25c1('0x1f')](function(_0xbc20a3){_0x428ce8['rows']=_0xbc20a3;return _0x428ce8;})[_0x25c1('0x1f')](respondWithFilteredResult(_0x326a5f,_0x5ad776))['catch'](handleError(_0x326a5f,null));};exports[_0x25c1('0x40')]=function(_0xe83d32,_0x6d588a){var _0x17fc23={'raw':!![],'where':{'id':_0xe83d32['params']['id']}},_0x57c65a={};_0x57c65a['model']=_[_0x25c1('0x41')](db[_0x25c1('0x27')]['rawAttributes']);_0x57c65a[_0x25c1('0x2a')]=_['keys'](_0xe83d32[_0x25c1('0x2a')]);_0x57c65a[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_0x57c65a['model'],_0x57c65a['query']);_0x17fc23['attributes']=_[_0x25c1('0x2c')](_0x57c65a[_0x25c1('0x29')],qs['fields'](_0xe83d32[_0x25c1('0x2a')][_0x25c1('0x2e')]));_0x17fc23[_0x25c1('0x2d')]=_0x17fc23['attributes']['length']?_0x17fc23['attributes']:_0x57c65a['model'];if(_0xe83d32[_0x25c1('0x2a')][_0x25c1('0x42')]){_0x17fc23['include']=[{'all':!![]}];}_0x17fc23=_[_0x25c1('0x36')]({},_0x17fc23,_0xe83d32[_0x25c1('0x3c')]);return db[_0x25c1('0x27')][_0x25c1('0x43')](_0x17fc23)[_0x25c1('0x1f')](handleEntityNotFound(_0x6d588a,null))[_0x25c1('0x1f')](respondWithResult(_0x6d588a,null))[_0x25c1('0x44')](handleError(_0x6d588a,null));};exports['create']=function(_0x545934,_0x28fc89){return db[_0x25c1('0x27')][_0x25c1('0x45')](_0x545934['body'],{})[_0x25c1('0x1f')](respondWithResult(_0x28fc89,0xc9))[_0x25c1('0x44')](handleError(_0x28fc89,null));};exports[_0x25c1('0x1e')]=function(_0xa009d1,_0x557ca3){if(_0xa009d1[_0x25c1('0x46')]['id']){delete _0xa009d1[_0x25c1('0x46')]['id'];}return db[_0x25c1('0x27')][_0x25c1('0x43')]({'where':{'id':_0xa009d1['params']['id']}})['then'](handleEntityNotFound(_0x557ca3,null))[_0x25c1('0x1f')](saveUpdates(_0xa009d1[_0x25c1('0x46')],null))[_0x25c1('0x1f')](respondWithResult(_0x557ca3,null))[_0x25c1('0x44')](handleError(_0x557ca3,null));};exports['destroy']=function(_0x6eff9e,_0x32943c){return db['JscriptyAnswerReport'][_0x25c1('0x43')]({'where':{'id':_0x6eff9e[_0x25c1('0x47')]['id']}})[_0x25c1('0x1f')](handleEntityNotFound(_0x32943c,null))[_0x25c1('0x1f')](removeEntity(_0x32943c,null))['catch'](handleError(_0x32943c,null));};exports['describe']=function(_0x5034ba,_0x3e8e2c){return db[_0x25c1('0x27')]['describe']()[_0x25c1('0x1f')](respondWithResult(_0x3e8e2c,null))[_0x25c1('0x44')](handleError(_0x3e8e2c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 37c6558..6cd7287 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 _0x9bdc=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','report_jscripty_answers'];(function(_0x1744e1,_0x1d5cd9){var _0x5166a0=function(_0x5f28dd){while(--_0x5f28dd){_0x1744e1['push'](_0x1744e1['shift']());}};_0x5166a0(++_0x1d5cd9);}(_0x9bdc,0x197));var _0xc9bd=function(_0x4f702a,_0x1e0faf){_0x4f702a=_0x4f702a-0x0;var _0x5f24d0=_0x9bdc[_0x4f702a];return _0x5f24d0;};'use strict';var _=require(_0xc9bd('0x0'));var util=require('util');var logger=require(_0xc9bd('0x1'))(_0xc9bd('0x2'));var moment=require(_0xc9bd('0x3'));var BPromise=require(_0xc9bd('0x4'));var rp=require(_0xc9bd('0x5'));var fs=require('fs');var path=require(_0xc9bd('0x6'));var rimraf=require(_0xc9bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9bd('0x8'));module[_0xc9bd('0x9')]=function(_0x17c71d,_0x2ac14b){return _0x17c71d['define']('JscriptyAnswerReport',attributes,{'tableName':_0xc9bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d99=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x9a74aa,_0x3ae50e){var _0x19cf78=function(_0x3beeea){while(--_0x3beeea){_0x9a74aa['push'](_0x9a74aa['shift']());}};_0x19cf78(++_0x3ae50e);}(_0x6d99,0xd0));var _0x96d9=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6d99[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x96d9('0x0'));var logger=require(_0x96d9('0x1'))(_0x96d9('0x2'));var moment=require('moment');var BPromise=require(_0x96d9('0x3'));var rp=require(_0x96d9('0x4'));var fs=require('fs');var path=require(_0x96d9('0x5'));var rimraf=require('rimraf');var config=require(_0x96d9('0x6'));var attributes=require(_0x96d9('0x7'));module[_0x96d9('0x8')]=function(_0x5555ba,_0x1a58c3){return _0x5555ba[_0x96d9('0x9')](_0x96d9('0xa'),attributes,{'tableName':_0x96d9('0xb'),'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 eab55fd..4655631 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 _0xf495=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2640fa,_0xaeaf32){var _0x5aa2cd=function(_0x3a0bf2){while(--_0x3a0bf2){_0x2640fa['push'](_0x2640fa['shift']());}};_0x5aa2cd(++_0xaeaf32);}(_0xf495,0x7d));var _0x5f49=function(_0x4c1176,_0xf999e9){_0x4c1176=_0x4c1176-0x0;var _0x2aca97=_0xf495[_0x4c1176];return _0x2aca97;};'use strict';var _=require('lodash');var util=require(_0x5f49('0x0'));var moment=require(_0x5f49('0x1'));var BPromise=require(_0x5f49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f49('0x3'));var db=require(_0x5f49('0x4'))['db'];var utils=require(_0x5f49('0x5'));var logger=require(_0x5f49('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f49('0x7'));var client=jayson['client'][_0x5f49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22dcfb,_0x24fd8d,_0x3674a7){return new BPromise(function(_0x30944d,_0x1c94d4){return client['request'](_0x22dcfb,_0x3674a7)[_0x5f49('0x9')](function(_0x462be5){logger[_0x5f49('0xa')](_0x5f49('0xb'),_0x24fd8d,'request\x20sent');logger[_0x5f49('0xc')](_0x5f49('0xd'),_0x24fd8d,_0x5f49('0xe'),JSON[_0x5f49('0xf')](_0x462be5));if(_0x462be5[_0x5f49('0x10')]){if(_0x462be5['error']['code']===0x1f4){logger[_0x5f49('0x10')](_0x5f49('0xb'),_0x24fd8d,_0x462be5[_0x5f49('0x10')][_0x5f49('0x11')]);return _0x1c94d4(_0x462be5['error'][_0x5f49('0x11')]);}logger['error'](_0x5f49('0xb'),_0x24fd8d,_0x462be5[_0x5f49('0x10')][_0x5f49('0x11')]);return _0x30944d(_0x462be5['error']['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x24fd8d,_0x5f49('0xe'));_0x30944d(_0x462be5[_0x5f49('0x12')]['message']);}})[_0x5f49('0x13')](function(_0x5918a7){logger[_0x5f49('0x10')](_0x5f49('0xb'),_0x24fd8d,_0x5918a7);_0x1c94d4(_0x5918a7);});});} \ No newline at end of file +var _0xe0b7=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e741f,_0x4a60ce){var _0x23f353=function(_0x5f0c24){while(--_0x5f0c24){_0x5e741f['push'](_0x5e741f['shift']());}};_0x23f353(++_0x4a60ce);}(_0xe0b7,0xc4));var _0x7e0b=function(_0x35b6a6,_0x2af2ad){_0x35b6a6=_0x35b6a6-0x0;var _0x19cbc8=_0xe0b7[_0x35b6a6];return _0x19cbc8;};'use strict';var _=require(_0x7e0b('0x0'));var util=require(_0x7e0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e0b('0x2'));var db=require(_0x7e0b('0x3'))['db'];var utils=require(_0x7e0b('0x4'));var logger=require(_0x7e0b('0x5'))(_0x7e0b('0x6'));var config=require(_0x7e0b('0x7'));var jayson=require(_0x7e0b('0x8'));var client=jayson[_0x7e0b('0x9')][_0x7e0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e0999,_0x932d74,_0x5aa527){return new BPromise(function(_0x4eb43b,_0x5f40ad){return client['request'](_0x5e0999,_0x5aa527)[_0x7e0b('0xb')](function(_0x2d0d12){logger[_0x7e0b('0xc')](_0x7e0b('0xd'),_0x932d74,'request\x20sent');logger[_0x7e0b('0xe')](_0x7e0b('0xf'),_0x932d74,_0x7e0b('0x10'),JSON[_0x7e0b('0x11')](_0x2d0d12));if(_0x2d0d12[_0x7e0b('0x12')]){if(_0x2d0d12['error'][_0x7e0b('0x13')]===0x1f4){logger[_0x7e0b('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x2d0d12['error'][_0x7e0b('0x14')]);return _0x5f40ad(_0x2d0d12[_0x7e0b('0x12')]['message']);}logger[_0x7e0b('0x12')](_0x7e0b('0xd'),_0x932d74,_0x2d0d12[_0x7e0b('0x12')][_0x7e0b('0x14')]);return _0x4eb43b(_0x2d0d12[_0x7e0b('0x12')]['message']);}else{logger[_0x7e0b('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x7e0b('0x10'));_0x4eb43b(_0x2d0d12[_0x7e0b('0x15')][_0x7e0b('0x14')]);}})[_0x7e0b('0x16')](function(_0x4a91e0){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x932d74,_0x4a91e0);_0x5f40ad(_0x4a91e0);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 60fc01a..6f14ccc 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 _0x79b5=['post','create','/:id/clone','/:id','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary'];(function(_0x4db243,_0x46aa0a){var _0x169997=function(_0x574228){while(--_0x574228){_0x4db243['push'](_0x4db243['shift']());}};_0x169997(++_0x46aa0a);}(_0x79b5,0x1bd));var _0x579b=function(_0x3d8c50,_0x4bb14c){_0x3d8c50=_0x3d8c50-0x0;var _0x2725db=_0x79b5[_0x3d8c50];return _0x2725db;};'use strict';var multer=require(_0x579b('0x0'));var util=require(_0x579b('0x1'));var path=require(_0x579b('0x2'));var timeout=require(_0x579b('0x3'));var express=require('express');var router=express[_0x579b('0x4')]();var auth=require(_0x579b('0x5'));var interaction=require(_0x579b('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x579b('0x7')]('/',auth[_0x579b('0x8')](),controller[_0x579b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x579b('0xa')]);router['get'](_0x579b('0xb'),auth['isAuthenticated'](),controller[_0x579b('0xc')]);router[_0x579b('0x7')](_0x579b('0xd'),auth[_0x579b('0x8')](),controller[_0x579b('0xe')]);router[_0x579b('0x7')](_0x579b('0xf'),auth[_0x579b('0x8')](),timeout('30s'),controller[_0x579b('0x10')]);router[_0x579b('0x11')]('/',auth[_0x579b('0x8')](),controller[_0x579b('0x12')]);router[_0x579b('0x11')](_0x579b('0x13'),auth[_0x579b('0x8')](),controller['clone']);router['put'](_0x579b('0x14'),auth[_0x579b('0x8')](),controller['update']);router[_0x579b('0x15')]('/:id',auth[_0x579b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x79d7=['/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id','show'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x79d7,0x9c));var _0x779d=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x79d7[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0x779d('0x0'));var util=require('util');var path=require(_0x779d('0x1'));var timeout=require(_0x779d('0x2'));var express=require(_0x779d('0x3'));var router=express[_0x779d('0x4')]();var auth=require(_0x779d('0x5'));var interaction=require(_0x779d('0x6'));var config=require('../../config/environment');var controller=require(_0x779d('0x7'));router[_0x779d('0x8')]('/',auth[_0x779d('0x9')](),controller['index']);router['get'](_0x779d('0xa'),auth['isAuthenticated'](),controller[_0x779d('0xb')]);router[_0x779d('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller['getSessions']);router['get'](_0x779d('0xc'),auth[_0x779d('0x9')](),controller[_0x779d('0xd')]);router['get'](_0x779d('0xe'),auth['isAuthenticated'](),timeout(_0x779d('0xf')),controller['getSummary']);router[_0x779d('0x10')]('/',auth[_0x779d('0x9')](),controller[_0x779d('0x11')]);router['post'](_0x779d('0x12'),auth[_0x779d('0x9')](),controller[_0x779d('0x13')]);router[_0x779d('0x14')](_0x779d('0xa'),auth[_0x779d('0x9')](),controller['update']);router[_0x779d('0x15')](_0x779d('0xa'),auth[_0x779d('0x9')](),controller[_0x779d('0x16')]);module[_0x779d('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 8601ee4..2f807d6 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 _0xc2ba=['long','isObjectLike','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','lodash','util','exports','STRING','name','TEXT'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0xc2ba,0x1bc));var _0xac2b=function(_0x56fd4c,_0x5a753c){_0x56fd4c=_0x56fd4c-0x0;var _0x5a3d36=_0xc2ba[_0x56fd4c];return _0x5a3d36;};'use strict';var Sequelize=require('sequelize');var _=require(_0xac2b('0x0'));var util=require(_0xac2b('0x1'));module[_0xac2b('0x2')]={'name':{'type':Sequelize[_0xac2b('0x3')],'unique':_0xac2b('0x4')},'description':{'type':Sequelize[_0xac2b('0x3')]},'formData':{'type':Sequelize[_0xac2b('0x5')](_0xac2b('0x6')),'set':function(_0x27da5c){if(_[_0xac2b('0x7')](_0x27da5c)){this['setDataValue'](_0xac2b('0x8'),JSON['stringify'](_0x27da5c));}else if(_[_0xac2b('0x9')](_0x27da5c)){this[_0xac2b('0xa')](_0xac2b('0x8'),_0x27da5c);}else{this[_0xac2b('0xa')](_0xac2b('0x8'),util[_0xac2b('0xb')](_0xac2b('0xc'),this[_0xac2b('0xd')](_0xac2b('0x4'))||'',this[_0xac2b('0xd')](_0xac2b('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd8ac=['BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0xd8ac,0x171));var _0xcd8a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd8ac[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xcd8a('0x0'));var _=require(_0xcd8a('0x1'));var util=require(_0xcd8a('0x2'));module[_0xcd8a('0x3')]={'name':{'type':Sequelize[_0xcd8a('0x4')],'unique':_0xcd8a('0x5')},'description':{'type':Sequelize[_0xcd8a('0x4')]},'formData':{'type':Sequelize[_0xcd8a('0x6')](_0xcd8a('0x7')),'set':function(_0x328c70){if(_[_0xcd8a('0x8')](_0x328c70)){this[_0xcd8a('0x9')]('formData',JSON[_0xcd8a('0xa')](_0x328c70));}else if(_[_0xcd8a('0xb')](_0x328c70)){this[_0xcd8a('0x9')](_0xcd8a('0xc'),_0x328c70);}else{this[_0xcd8a('0x9')]('formData',util['format'](_0xcd8a('0xd'),this[_0xcd8a('0xe')](_0xcd8a('0x5'))||'',this[_0xcd8a('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xcd8a('0xf')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index fcbbdd8..94e2867 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 _0xc40b=['set','Content-Range','json','apply','reject','update','get','UserProfileResource','destroy','then','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','fields','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','user','UserProfileSection','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit'];(function(_0x7cf4e0,_0x57a36c){var _0x389461=function(_0x5e8b21){while(--_0x5e8b21){_0x7cf4e0['push'](_0x7cf4e0['shift']());}};_0x389461(++_0x57a36c);}(_0xc40b,0x151));var _0xbc40=function(_0x4f4379,_0x3b9c17){_0x4f4379=_0x4f4379-0x0;var _0x4d1468=_0xc40b[_0x4f4379];return _0x4d1468;};'use strict';var pdf=require(_0xbc40('0x0'));var emlformat=require(_0xbc40('0x1'));var rimraf=require(_0xbc40('0x2'));var zipdir=require(_0xbc40('0x3'));var jsonpatch=require(_0xbc40('0x4'));var rp=require(_0xbc40('0x5'));var moment=require(_0xbc40('0x6'));var BPromise=require(_0xbc40('0x7'));var Mustache=require(_0xbc40('0x8'));var util=require(_0xbc40('0x9'));var path=require(_0xbc40('0xa'));var sox=require(_0xbc40('0xb'));var csv=require(_0xbc40('0xc'));var ejs=require(_0xbc40('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbc40('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc40('0xf'));var Papa=require('papaparse');var Redis=require(_0xbc40('0x10'));var authService=require(_0xbc40('0x11'));var qs=require(_0xbc40('0x12'));var hardwareService=require(_0xbc40('0x13'));var logger=require(_0xbc40('0x14'))(_0xbc40('0x15'));var utils=require(_0xbc40('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6a70,_0x28b13f){_0x28b13f=_0x28b13f||0xcc;return function(_0xd4e758){if(_0xd4e758){return _0x3d6a70[_0xbc40('0x17')](_0x28b13f);}return _0x3d6a70[_0xbc40('0x18')](_0x28b13f)[_0xbc40('0x19')]();};}function respondWithResult(_0xf2b810,_0x211f5c){_0x211f5c=_0x211f5c||0xc8;return function(_0x44b1d4){if(_0x44b1d4){return _0xf2b810['status'](_0x211f5c)['json'](_0x44b1d4);}};}function respondWithFilteredResult(_0x302bab,_0x18429e){return function(_0x23e3d8){if(_0x23e3d8){var _0x48a622=_0x23e3d8[_0xbc40('0x1a')],_0x17bb19=_0x18429e[_0xbc40('0x1b')],_0x2d9944=_0x18429e[_0xbc40('0x1b')]+_0x18429e[_0xbc40('0x1c')],_0x189356;if(_0x2d9944>=_0x48a622){_0x2d9944=_0x48a622;_0x189356=0xc8;}else{_0x189356=0xce;}_0x302bab[_0xbc40('0x18')](_0x189356);return _0x302bab[_0xbc40('0x1d')](_0xbc40('0x1e'),_0x17bb19+'-'+_0x2d9944+'/'+_0x48a622)[_0xbc40('0x1f')](_0x23e3d8);}return null;};}function patchUpdates(_0x15e2b1){return function(_0x155f65){try{jsonpatch[_0xbc40('0x20')](_0x155f65,_0x15e2b1,!![]);}catch(_0x34c3e3){return BPromise[_0xbc40('0x21')](_0x34c3e3);}return _0x155f65['save']();};}function saveUpdates(_0x23cc3d,_0x542a8f){return function(_0x27289b){if(_0x27289b){return _0x27289b[_0xbc40('0x22')](_0x23cc3d)['then'](function(_0x10f5a3){return _0x10f5a3;});}return null;};}function removeEntity(_0x2c3c08,_0x1a6023){return function(_0x3be3bb){if(_0x3be3bb){return _0x3be3bb['destroy']()['then'](function(){var _0x508779=_0x3be3bb[_0xbc40('0x23')]({'plain':!![]});var _0x43b396='Projects';return db[_0xbc40('0x24')][_0xbc40('0x25')]({'where':{'type':_0x43b396,'resourceId':_0x508779['id']}})[_0xbc40('0x26')](function(){return _0x3be3bb;});})[_0xbc40('0x26')](function(){_0x2c3c08[_0xbc40('0x18')](0xcc)[_0xbc40('0x19')]();});}};}function handleEntityNotFound(_0x44c2e5,_0x54a40b){return function(_0x13cbee){if(!_0x13cbee){_0x44c2e5[_0xbc40('0x17')](0x194);}return _0x13cbee;};}function handleError(_0x756972,_0x3fb668){_0x3fb668=_0x3fb668||0x1f4;return function(_0x1d54d4){logger['error'](_0x1d54d4[_0xbc40('0x27')]);if(_0x1d54d4[_0xbc40('0x28')]){delete _0x1d54d4['name'];}_0x756972['status'](_0x3fb668)[_0xbc40('0x29')](_0x1d54d4);};}exports[_0xbc40('0x2a')]=function(_0x3a6ec4,_0x5d3247){var _0x3d198c={},_0x411ce6={},_0x29e062={'count':0x0,'rows':[]};var _0x1aa45c=db[_0xbc40('0x2b')][_0xbc40('0x2c')];_0x411ce6[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](_0x1aa45c);_0x411ce6['query']=_['keys'](_0x3a6ec4[_0xbc40('0x2f')]);_0x411ce6['filters']=_[_0xbc40('0x30')](_0x411ce6['model'],_0x411ce6[_0xbc40('0x2f')]);_0x3d198c[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x411ce6['model'],qs['fields'](_0x3a6ec4['query']['fields']));_0x3d198c[_0xbc40('0x31')]=_0x3d198c[_0xbc40('0x31')]['length']?_0x3d198c['attributes']:_0x411ce6['model'];if(!_0x3a6ec4['query'][_0xbc40('0x32')](_0xbc40('0x33'))){_0x3d198c['limit']=qs[_0xbc40('0x1c')](_0x3a6ec4['query'][_0xbc40('0x1c')]);_0x3d198c[_0xbc40('0x1b')]=qs[_0xbc40('0x1b')](_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x1b')]);}_0x3d198c[_0xbc40('0x34')]=qs[_0xbc40('0x35')](_0x3a6ec4['query']['sort']);_0x3d198c['where']=qs[_0xbc40('0x36')](_[_0xbc40('0x37')](_0x3a6ec4[_0xbc40('0x2f')],_0x411ce6[_0xbc40('0x36')]));if(_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x38')]){_0x3d198c['where']=_['merge'](_0x3d198c[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x1aa45c,function(_0x13149c){if(_0x13149c[_0xbc40('0x3b')][_0xbc40('0x3c')]!=='VIRTUAL'){var _0x48efe6={};_0x48efe6[_0x13149c[_0xbc40('0x3d')]]={'$like':'%'+_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x38')]+'%'};return _0x48efe6;}})});}_0x3d198c=_['merge']({},_0x3d198c,_0x3a6ec4[_0xbc40('0x3e')]);var _0x382f4b={'where':_0x3d198c[_0xbc40('0x39')]};return db['JscriptyProject']['count'](_0x382f4b)['then'](function(_0x3d16a5){_0x29e062[_0xbc40('0x1a')]=_0x3d16a5;if(_0x3a6ec4['query'][_0xbc40('0x3f')]){_0x3d198c[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x2b')][_0xbc40('0x41')](_0x3d198c);})[_0xbc40('0x26')](function(_0xe81ca9){_0x29e062[_0xbc40('0x42')]=_0xe81ca9;return _0x29e062;})['then'](respondWithFilteredResult(_0x5d3247,_0x3d198c))[_0xbc40('0x43')](handleError(_0x5d3247,null));};exports[_0xbc40('0x44')]=function(_0x281e7f,_0x137e5d){var _0x5a6cff={'raw':![],'where':{'id':_0x281e7f[_0xbc40('0x45')]['id']}},_0x10af58={};_0x10af58[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](db[_0xbc40('0x2b')][_0xbc40('0x2c')]);_0x10af58[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x281e7f[_0xbc40('0x2f')]);_0x10af58[_0xbc40('0x36')]=_['intersection'](_0x10af58[_0xbc40('0x2d')],_0x10af58[_0xbc40('0x2f')]);_0x5a6cff[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x10af58[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x281e7f['query'][_0xbc40('0x46')]));_0x5a6cff['attributes']=_0x5a6cff['attributes'][_0xbc40('0x47')]?_0x5a6cff[_0xbc40('0x31')]:_0x10af58['model'];if(_0x281e7f[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x5a6cff[_0xbc40('0x40')]=[{'all':!![]}];}_0x5a6cff=_[_0xbc40('0x48')]({},_0x5a6cff,_0x281e7f['options']);return db['JscriptyProject'][_0xbc40('0x49')](_0x5a6cff)[_0xbc40('0x26')](handleEntityNotFound(_0x137e5d,null))['then'](respondWithResult(_0x137e5d,null))[_0xbc40('0x43')](handleError(_0x137e5d,null));};exports[_0xbc40('0x4a')]=function(_0x31b14c,_0x5177ba){return db[_0xbc40('0x2b')]['create'](_0x31b14c[_0xbc40('0x4b')],{})['then'](function(_0xa435d3){var _0x438a34=_0x31b14c['user'][_0xbc40('0x23')]({'plain':!![]});if(!_0x438a34)throw new Error(_0xbc40('0x4c'));if(_0x438a34[_0xbc40('0x4d')]==='user'){var _0x295e7b=_0xa435d3[_0xbc40('0x23')]({'plain':!![]});var _0x31f525=_0xbc40('0x4e');return db['UserProfileSection'][_0xbc40('0x49')]({'where':{'name':_0x31f525,'userProfileId':_0x438a34[_0xbc40('0x4f')]},'raw':!![]})['then'](function(_0x102378){if(_0x102378&&_0x102378['autoAssociation']===0x0){return db[_0xbc40('0x24')][_0xbc40('0x4a')]({'name':_0x295e7b[_0xbc40('0x28')],'resourceId':_0x295e7b['id'],'type':_0x102378[_0xbc40('0x28')],'sectionId':_0x102378['id']},{})[_0xbc40('0x26')](function(){return _0xa435d3;});}else{return _0xa435d3;}})['catch'](function(_0x547aed){logger[_0xbc40('0x50')](_0xbc40('0x51'),_0x547aed);throw _0x547aed;});}return _0xa435d3;})[_0xbc40('0x26')](respondWithResult(_0x5177ba,0xc9))['catch'](handleError(_0x5177ba,null));};exports[_0xbc40('0x52')]=function(_0x2dd03f,_0x19477b){var _0x377e7c={'raw':![],'where':{'id':_0x2dd03f[_0xbc40('0x45')]['id']}},_0x3f65c4={};_0x3f65c4['model']=_[_0xbc40('0x2e')](db[_0xbc40('0x2b')]['rawAttributes']);_0x377e7c['attributes']=_[_0xbc40('0x30')](_0x3f65c4[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x2dd03f[_0xbc40('0x2f')]['fields']));_0x377e7c[_0xbc40('0x31')]=_0x377e7c['attributes'][_0xbc40('0x47')]?_0x377e7c[_0xbc40('0x31')]:_0x3f65c4[_0xbc40('0x2d')];if(_0x2dd03f[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x377e7c[_0xbc40('0x40')]=[{'all':!![]}];}_0x377e7c=_[_0xbc40('0x48')]({},_0x377e7c,_0x2dd03f[_0xbc40('0x3e')]);return db[_0xbc40('0x2b')]['find'](_0x377e7c)[_0xbc40('0x26')](handleEntityNotFound(_0x19477b,null))[_0xbc40('0x26')](function(_0x175fc5){if(_0x175fc5){var _0x42b99c=_0x175fc5['get']({'plain':!![]});_0x42b99c=qs[_0xbc40('0x53')](_0x42b99c,['id','createdAt',_0xbc40('0x54')]);_0x2dd03f[_0xbc40('0x4b')]=_['omit'](_0x2dd03f['body'],['id','createdAt',_0xbc40('0x54')]);return db[_0xbc40('0x2b')][_0xbc40('0x4a')](_['merge'](_0x42b99c,_0x2dd03f['body']),{'include':_0x2dd03f[_0xbc40('0x2f')][_0xbc40('0x3f')]?[{'all':!![]}]:undefined})[_0xbc40('0x26')](function(_0x55df0f){var _0x5acbac=_0x2dd03f[_0xbc40('0x55')][_0xbc40('0x23')]({'plain':!![]});if(!_0x5acbac)throw new Error(_0xbc40('0x4c'));if(_0x5acbac['role']===_0xbc40('0x55')){var _0x4362ae=_0x55df0f[_0xbc40('0x23')]({'plain':!![]});var _0x43f4ff=_0xbc40('0x4e');return db[_0xbc40('0x56')][_0xbc40('0x49')]({'where':{'name':_0x43f4ff,'userProfileId':_0x5acbac[_0xbc40('0x4f')]},'raw':!![]})[_0xbc40('0x26')](function(_0x22405f){if(_0x22405f&&_0x22405f['autoAssociation']===0x0){return db[_0xbc40('0x24')][_0xbc40('0x4a')]({'name':_0x4362ae['name'],'resourceId':_0x4362ae['id'],'type':_0x22405f['name'],'sectionId':_0x22405f['id']},{})[_0xbc40('0x26')](function(){return _0x55df0f;});}else{return _0x55df0f;}})[_0xbc40('0x43')](function(_0xc3b3de){logger['error'](_0xbc40('0x51'),_0xc3b3de);throw _0xc3b3de;});}return _0x55df0f;});}})[_0xbc40('0x26')](respondWithResult(_0x19477b,0xc9))[_0xbc40('0x43')](handleError(_0x19477b,null));};exports['update']=function(_0x25cdd2,_0x287034){if(_0x25cdd2[_0xbc40('0x4b')]['id']){delete _0x25cdd2[_0xbc40('0x4b')]['id'];}return db[_0xbc40('0x2b')][_0xbc40('0x49')]({'where':{'id':_0x25cdd2[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x287034,null))[_0xbc40('0x26')](saveUpdates(_0x25cdd2[_0xbc40('0x4b')],null))[_0xbc40('0x26')](respondWithResult(_0x287034,null))[_0xbc40('0x43')](handleError(_0x287034,null));};exports[_0xbc40('0x25')]=function(_0x55d2d9,_0x5766d6){return db[_0xbc40('0x2b')][_0xbc40('0x49')]({'where':{'id':_0x55d2d9[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x5766d6,null))[_0xbc40('0x26')](removeEntity(_0x5766d6,null))['catch'](handleError(_0x5766d6,null));};exports[_0xbc40('0x57')]=function(_0x45145a,_0x2272b4,_0x408293){var _0x5ead52={'raw':!![],'where':{}};var _0x107913={};var _0xb34ed7={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbc40('0x58')]({'where':{'id':_0x45145a['params']['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x2272b4,null))[_0xbc40('0x26')](function(_0x8a3c88){if(_0x8a3c88){_0x107913[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](db[_0xbc40('0x59')]['rawAttributes']);_0x107913[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x45145a[_0xbc40('0x2f')]);_0x107913['filters']=_['intersection'](_0x107913[_0xbc40('0x2d')],_0x107913['query']);_0x5ead52[_0xbc40('0x31')]=_['intersection'](_0x107913[_0xbc40('0x2d')],qs['fields'](_0x45145a[_0xbc40('0x2f')][_0xbc40('0x46')]));_0x5ead52[_0xbc40('0x31')]=_0x5ead52[_0xbc40('0x31')][_0xbc40('0x47')]?_0x5ead52[_0xbc40('0x31')]:_0x107913[_0xbc40('0x2d')];if(!_0x45145a[_0xbc40('0x2f')]['hasOwnProperty'](_0xbc40('0x33'))){_0x5ead52[_0xbc40('0x1c')]=qs[_0xbc40('0x1c')](_0x45145a[_0xbc40('0x2f')]['limit']);_0x5ead52['offset']=qs[_0xbc40('0x1b')](_0x45145a['query'][_0xbc40('0x1b')]);}_0x5ead52[_0xbc40('0x34')]=qs[_0xbc40('0x35')](_0x45145a['query'][_0xbc40('0x35')]);_0x5ead52['where']=qs['filters'](_[_0xbc40('0x37')](_0x45145a[_0xbc40('0x2f')],_0x107913[_0xbc40('0x36')]));_0x5ead52['where'][_0xbc40('0x5a')]=_0x8a3c88['id'];if(_0x45145a[_0xbc40('0x2f')][_0xbc40('0x38')]){_0x5ead52[_0xbc40('0x39')]=_[_0xbc40('0x48')](_0x5ead52[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x5ead52[_0xbc40('0x31')],function(_0x4bae09){var _0x23e694={};_0x23e694[_0x4bae09]={'$like':'%'+_0x45145a[_0xbc40('0x2f')]['filter']+'%'};return _0x23e694;})});}_0x5ead52=_[_0xbc40('0x48')]({},_0x5ead52,_0x45145a[_0xbc40('0x3e')]);return db[_0xbc40('0x59')][_0xbc40('0x1a')]({'where':_0x5ead52[_0xbc40('0x39')]})[_0xbc40('0x26')](function(_0x1cc867){_0xb34ed7[_0xbc40('0x1a')]=_0x1cc867;if(_0x45145a[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x5ead52[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x59')]['findAll'](_0x5ead52);})['then'](function(_0xb4d98){_0xb34ed7[_0xbc40('0x42')]=_0xb4d98;return _0xb34ed7;});}})[_0xbc40('0x26')](respondWithFilteredResult(_0x2272b4,_0x5ead52))[_0xbc40('0x43')](handleError(_0x2272b4,null));};exports[_0xbc40('0x5b')]=function(_0x10e602,_0x19ce0b,_0x453a2d){var _0x2a58ed={'raw':!![],'where':{}};var _0x3d5113={};var _0x501f7c={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbc40('0x58')]({'where':{'id':_0x10e602[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x19ce0b,null))['then'](function(_0x25676a){if(_0x25676a){_0x3d5113[_0xbc40('0x2d')]=_['keys'](db[_0xbc40('0x5c')]['rawAttributes']);_0x3d5113[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x10e602['query']);_0x3d5113[_0xbc40('0x36')]=_['intersection'](_0x3d5113[_0xbc40('0x2d')],_0x3d5113[_0xbc40('0x2f')]);_0x2a58ed[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x3d5113[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x10e602[_0xbc40('0x2f')][_0xbc40('0x46')]));_0x2a58ed[_0xbc40('0x31')]=_0x2a58ed['attributes'][_0xbc40('0x47')]?_0x2a58ed['attributes']:_0x3d5113[_0xbc40('0x2d')];if(!_0x10e602[_0xbc40('0x2f')][_0xbc40('0x32')](_0xbc40('0x33'))){_0x2a58ed[_0xbc40('0x1c')]=qs[_0xbc40('0x1c')](_0x10e602['query'][_0xbc40('0x1c')]);_0x2a58ed[_0xbc40('0x1b')]=qs[_0xbc40('0x1b')](_0x10e602['query'][_0xbc40('0x1b')]);}_0x2a58ed[_0xbc40('0x34')]=qs['sort'](_0x10e602[_0xbc40('0x2f')][_0xbc40('0x35')]);_0x2a58ed['where']=qs['filters'](_[_0xbc40('0x37')](_0x10e602[_0xbc40('0x2f')],_0x3d5113[_0xbc40('0x36')]));_0x2a58ed[_0xbc40('0x39')][_0xbc40('0x5a')]=_0x25676a['id'];if(_0x10e602['query']['filter']){_0x2a58ed[_0xbc40('0x39')]=_[_0xbc40('0x48')](_0x2a58ed[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x2a58ed[_0xbc40('0x31')],function(_0x148e96){var _0x4c1426={};_0x4c1426[_0x148e96]={'$like':'%'+_0x10e602[_0xbc40('0x2f')][_0xbc40('0x38')]+'%'};return _0x4c1426;})});}_0x2a58ed=_[_0xbc40('0x48')]({},_0x2a58ed,_0x10e602[_0xbc40('0x3e')]);return db[_0xbc40('0x5c')][_0xbc40('0x1a')]({'where':_0x2a58ed[_0xbc40('0x39')]})[_0xbc40('0x26')](function(_0x4a3a16){_0x501f7c[_0xbc40('0x1a')]=_0x4a3a16;if(_0x10e602['query']['includeAll']){_0x2a58ed[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x5c')][_0xbc40('0x41')](_0x2a58ed);})['then'](function(_0x168ce7){_0x501f7c[_0xbc40('0x42')]=_0x168ce7;return _0x501f7c;});}})[_0xbc40('0x26')](respondWithFilteredResult(_0x19ce0b,_0x2a58ed))[_0xbc40('0x43')](handleError(_0x19ce0b,null));};function char(_0x53d661){return _0xbc40('0x5d')===typeof _0x53d661?String[_0xbc40('0x5e')][_0xbc40('0x20')](null,arguments):_0x53d661;}function needsEncapsulation(_0x4b5d5d){return!!_0x4b5d5d&&(_0x4b5d5d[_0xbc40('0x5f')]()[_0xbc40('0x60')](char(0xd))>=0x0||_0x4b5d5d[_0xbc40('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x4b5d5d[_0xbc40('0x5f')]()[_0xbc40('0x60')](char(0x2c))>=0x0||_0x4b5d5d['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xa7742){var _0x57e12d=char(0x22),_0x2bfdae='\x5c'+char(0x22),_0x27bee4=_0xa7742[_0xbc40('0x5f')]()[_0xbc40('0x61')](new RegExp(_0x57e12d,'g'),_0x2bfdae);return _0x57e12d+_0x27bee4+_0x57e12d;}exports[_0xbc40('0x62')]=function(_0x139628,_0x5abbb7,_0x2501e5){var _0x3cf595,_0x3ccace;var _0x49f82b={'where':{'ProjectId':_0x139628[_0xbc40('0x45')]['id']}};if(_0x139628[_0xbc40('0x2f')][_0xbc40('0x63')]){_0x49f82b[_0xbc40('0x39')][_0xbc40('0x64')]=JSON[_0xbc40('0x65')](_0x139628[_0xbc40('0x2f')][_0xbc40('0x63')]);}return db['JscriptySessionReport'][_0xbc40('0x41')](_0x49f82b)[_0xbc40('0x26')](handleEntityNotFound(_0x5abbb7,null))['then'](function(_0x584a0f){if(_0x584a0f){_0x3cf595=_0x584a0f;return db[_0xbc40('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0xbc40('0x3a')](_0x3cf595,'id')},'ProjectId':_0x139628['params']['id']},'order':_0xbc40('0x67')});}})['then'](handleEntityNotFound(_0x5abbb7,null))['then'](function(_0xa4b236){if(_0xa4b236){_0x3ccace=_0xa4b236;var _0x51b6d6={};for(var _0x475a0d=0x0,_0xa4f40=_0x3ccace[_0xbc40('0x47')];_0x475a0d<_0xa4f40;_0x475a0d++){if(!_0x51b6d6[_0xbc40('0x32')](_0x3ccace[_0x475a0d][_0xbc40('0x68')])){_0x51b6d6[_0x3ccace[_0x475a0d][_0xbc40('0x68')]]=needsEncapsulation(_0x3ccace[_0x475a0d][_0xbc40('0x69')])?encapsulate(_0x3ccace[_0x475a0d][_0xbc40('0x69')]):_0x3ccace[_0x475a0d][_0xbc40('0x69')];}}var _0x5bd1a5=[],_0x43a0e8={};for(var _0xfda5a2=0x0,_0xd74d7a=_0x3cf595[_0xbc40('0x47')];_0xfda5a2<_0xd74d7a;_0xfda5a2++){_0x43a0e8={'ProjectId':_0x139628[_0xbc40('0x45')]['id'],'SessionId':_0x3cf595[_0xfda5a2]['id'],'StartTime':moment(_0x3cf595[_0xfda5a2][_0xbc40('0x64')])['format'](_0xbc40('0x6a'))};for(var _0x3a5655=0x0,_0x545318=_0x3ccace[_0xbc40('0x47')];_0x3a5655<_0x545318;_0x3a5655++){if(_0x3ccace[_0x3a5655][_0xbc40('0x6b')]==_0x3cf595[_0xfda5a2]['id']&&_0x51b6d6[_0xbc40('0x32')](_0x3ccace[_0x3a5655]['questionId'])){_0x43a0e8[_0x51b6d6[_0x3ccace[_0x3a5655][_0xbc40('0x68')]]]=_0x3ccace[_0x3a5655][_0xbc40('0x6c')];}}for(var _0x5bb17c in _0x51b6d6){if(!_0x43a0e8[_0xbc40('0x32')](_0x51b6d6[_0x5bb17c])){_0x43a0e8[_0x51b6d6[_0x5bb17c]]=null;}}_0x5bd1a5[_0xbc40('0x6d')](_0x43a0e8);}return _0x5bd1a5;}})[_0xbc40('0x26')](function(_0x48aef7){if(!_[_0xbc40('0x6e')](_0x48aef7)){var _0x248c2c=toCsv(_0x48aef7);var _0x152bc8=Date[_0xbc40('0x6f')]();fs[_0xbc40('0x70')](util['format'](_0xbc40('0x71'),_0x139628[_0xbc40('0x45')]['id'],_0x152bc8),_0x248c2c);_0x5abbb7[_0xbc40('0x72')](_0xbc40('0x73'),_0xbc40('0x74')+util[_0xbc40('0x75')](_0xbc40('0x76'),_0x139628['params']['id'],_0x152bc8));_0x5abbb7[_0xbc40('0x72')](_0xbc40('0x77'),_0xbc40('0x78'));return _0x5abbb7[_0xbc40('0x79')](util['format'](_0xbc40('0x71'),_0x139628[_0xbc40('0x45')]['id'],_0x152bc8));}else{return _0x5abbb7[_0xbc40('0x17')](0xcc);}})[_0xbc40('0x43')](handleError(_0x5abbb7,null));}; \ No newline at end of file +var _0x6ba9=['where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','UserProfileSection','update','getSessions','findOne','JscriptySessionReport','pick','ProjectId','findAll','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x24a4b1,_0x4f23cb){var _0x476dfb=function(_0x5bf09a){while(--_0x5bf09a){_0x24a4b1['push'](_0x24a4b1['shift']());}};_0x476dfb(++_0x4f23cb);}(_0x6ba9,0x126));var _0x96ba=function(_0x56625d,_0x12e6e9){_0x56625d=_0x56625d-0x0;var _0x3bf11b=_0x6ba9[_0x56625d];return _0x3bf11b;};'use strict';var pdf=require(_0x96ba('0x0'));var emlformat=require(_0x96ba('0x1'));var rimraf=require(_0x96ba('0x2'));var zipdir=require(_0x96ba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96ba('0x4'));var moment=require(_0x96ba('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96ba('0x6'));var path=require(_0x96ba('0x7'));var sox=require(_0x96ba('0x8'));var csv=require('to-csv');var ejs=require(_0x96ba('0x9'));var fs=require('fs');var _=require(_0x96ba('0xa'));var squel=require(_0x96ba('0xb'));var crypto=require(_0x96ba('0xc'));var jsforce=require(_0x96ba('0xd'));var deskjs=require(_0x96ba('0xe'));var toCsv=require(_0x96ba('0xf'));var querystring=require(_0x96ba('0x10'));var Papa=require(_0x96ba('0x11'));var Redis=require('ioredis');var authService=require(_0x96ba('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x96ba('0x13'));var logger=require(_0x96ba('0x14'))('api');var utils=require(_0x96ba('0x15'));var config=require(_0x96ba('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ce16c,_0x3186ef){_0x3186ef=_0x3186ef||0xcc;return function(_0xb3216d){if(_0xb3216d){return _0x2ce16c[_0x96ba('0x17')](_0x3186ef);}return _0x2ce16c[_0x96ba('0x18')](_0x3186ef)[_0x96ba('0x19')]();};}function respondWithResult(_0x340c8a,_0x211c42){_0x211c42=_0x211c42||0xc8;return function(_0x24cac8){if(_0x24cac8){return _0x340c8a[_0x96ba('0x18')](_0x211c42)[_0x96ba('0x1a')](_0x24cac8);}};}function respondWithFilteredResult(_0x447ac4,_0x5072a7){return function(_0x283cb2){if(_0x283cb2){var _0x5b2b8d=_0x283cb2[_0x96ba('0x1b')],_0x2e8400=_0x5072a7[_0x96ba('0x1c')],_0x4fe918=_0x5072a7[_0x96ba('0x1c')]+_0x5072a7['limit'],_0x5ada5e;if(_0x4fe918>=_0x5b2b8d){_0x4fe918=_0x5b2b8d;_0x5ada5e=0xc8;}else{_0x5ada5e=0xce;}_0x447ac4['status'](_0x5ada5e);return _0x447ac4[_0x96ba('0x1d')](_0x96ba('0x1e'),_0x2e8400+'-'+_0x4fe918+'/'+_0x5b2b8d)[_0x96ba('0x1a')](_0x283cb2);}return null;};}function patchUpdates(_0x17cc8b){return function(_0x3dd9f0){try{jsonpatch[_0x96ba('0x1f')](_0x3dd9f0,_0x17cc8b,!![]);}catch(_0x152521){return BPromise['reject'](_0x152521);}return _0x3dd9f0['save']();};}function saveUpdates(_0x5a8ef2,_0xc4f355){return function(_0x209182){if(_0x209182){return _0x209182['update'](_0x5a8ef2)[_0x96ba('0x20')](function(_0xf0009){return _0xf0009;});}return null;};}function removeEntity(_0x63b309,_0x312220){return function(_0x1499fb){if(_0x1499fb){return _0x1499fb[_0x96ba('0x21')]()[_0x96ba('0x20')](function(){var _0x35ba4d=_0x1499fb[_0x96ba('0x22')]({'plain':!![]});var _0x5c2b64=_0x96ba('0x23');return db[_0x96ba('0x24')][_0x96ba('0x21')]({'where':{'type':_0x5c2b64,'resourceId':_0x35ba4d['id']}})[_0x96ba('0x20')](function(){return _0x1499fb;});})['then'](function(){_0x63b309[_0x96ba('0x18')](0xcc)[_0x96ba('0x19')]();});}};}function handleEntityNotFound(_0x140cae,_0x2dc2a2){return function(_0x1e7efe){if(!_0x1e7efe){_0x140cae[_0x96ba('0x17')](0x194);}return _0x1e7efe;};}function handleError(_0x118c77,_0x5f7c51){_0x5f7c51=_0x5f7c51||0x1f4;return function(_0x4c900a){logger[_0x96ba('0x25')](_0x4c900a[_0x96ba('0x26')]);if(_0x4c900a['name']){delete _0x4c900a[_0x96ba('0x27')];}_0x118c77[_0x96ba('0x18')](_0x5f7c51)[_0x96ba('0x28')](_0x4c900a);};}exports[_0x96ba('0x29')]=function(_0x586820,_0x51aedd){var _0x305afb={},_0x1b2325={},_0x14d3f9={'count':0x0,'rows':[]};var _0xdc69a4=db[_0x96ba('0x2a')][_0x96ba('0x2b')];_0x1b2325[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](_0xdc69a4);_0x1b2325[_0x96ba('0x2e')]=_[_0x96ba('0x2d')](_0x586820[_0x96ba('0x2e')]);_0x1b2325[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x1b2325[_0x96ba('0x2c')],_0x1b2325[_0x96ba('0x2e')]);_0x305afb[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x1b2325['model'],qs['fields'](_0x586820[_0x96ba('0x2e')][_0x96ba('0x32')]));_0x305afb['attributes']=_0x305afb[_0x96ba('0x31')][_0x96ba('0x33')]?_0x305afb[_0x96ba('0x31')]:_0x1b2325[_0x96ba('0x2c')];if(!_0x586820[_0x96ba('0x2e')][_0x96ba('0x34')](_0x96ba('0x35'))){_0x305afb[_0x96ba('0x36')]=qs['limit'](_0x586820[_0x96ba('0x2e')]['limit']);_0x305afb[_0x96ba('0x1c')]=qs[_0x96ba('0x1c')](_0x586820[_0x96ba('0x2e')][_0x96ba('0x1c')]);}_0x305afb[_0x96ba('0x37')]=qs['sort'](_0x586820[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x305afb[_0x96ba('0x39')]=qs['filters'](_['pick'](_0x586820[_0x96ba('0x2e')],_0x1b2325['filters']));if(_0x586820['query'][_0x96ba('0x3a')]){_0x305afb[_0x96ba('0x39')]=_[_0x96ba('0x3b')](_0x305afb[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0xdc69a4,function(_0x5bf307){if(_0x5bf307[_0x96ba('0x3d')][_0x96ba('0x3e')]!==_0x96ba('0x3f')){var _0x19d392={};_0x19d392[_0x5bf307[_0x96ba('0x40')]]={'$like':'%'+_0x586820[_0x96ba('0x2e')][_0x96ba('0x3a')]+'%'};return _0x19d392;}})});}_0x305afb=_['merge']({},_0x305afb,_0x586820['options']);var _0x183b7d={'where':_0x305afb[_0x96ba('0x39')]};return db['JscriptyProject']['count'](_0x183b7d)[_0x96ba('0x20')](function(_0x53102a){_0x14d3f9[_0x96ba('0x1b')]=_0x53102a;if(_0x586820['query'][_0x96ba('0x41')]){_0x305afb[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x2a')]['findAll'](_0x305afb);})[_0x96ba('0x20')](function(_0x9201d4){_0x14d3f9[_0x96ba('0x43')]=_0x9201d4;return _0x14d3f9;})['then'](respondWithFilteredResult(_0x51aedd,_0x305afb))['catch'](handleError(_0x51aedd,null));};exports[_0x96ba('0x44')]=function(_0xce0f82,_0x17fc6a){var _0x1c825d={'raw':![],'where':{'id':_0xce0f82[_0x96ba('0x45')]['id']}},_0x45302a={};_0x45302a[_0x96ba('0x2c')]=_['keys'](db[_0x96ba('0x2a')][_0x96ba('0x2b')]);_0x45302a['query']=_['keys'](_0xce0f82['query']);_0x45302a[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x45302a[_0x96ba('0x2c')],_0x45302a[_0x96ba('0x2e')]);_0x1c825d[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x45302a[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0xce0f82['query'][_0x96ba('0x32')]));_0x1c825d[_0x96ba('0x31')]=_0x1c825d['attributes'][_0x96ba('0x33')]?_0x1c825d[_0x96ba('0x31')]:_0x45302a[_0x96ba('0x2c')];if(_0xce0f82[_0x96ba('0x2e')][_0x96ba('0x41')]){_0x1c825d[_0x96ba('0x42')]=[{'all':!![]}];}_0x1c825d=_[_0x96ba('0x3b')]({},_0x1c825d,_0xce0f82[_0x96ba('0x46')]);return db[_0x96ba('0x2a')][_0x96ba('0x47')](_0x1c825d)[_0x96ba('0x20')](handleEntityNotFound(_0x17fc6a,null))[_0x96ba('0x20')](respondWithResult(_0x17fc6a,null))[_0x96ba('0x48')](handleError(_0x17fc6a,null));};exports['create']=function(_0x15bb02,_0x11744f){return db[_0x96ba('0x2a')][_0x96ba('0x49')](_0x15bb02['body'],{})['then'](function(_0x236270){var _0x55c47a=_0x15bb02['user'][_0x96ba('0x22')]({'plain':!![]});if(!_0x55c47a)throw new Error(_0x96ba('0x4a'));if(_0x55c47a['role']===_0x96ba('0x4b')){var _0x9df07d=_0x236270[_0x96ba('0x22')]({'plain':!![]});var _0x1b2a6d=_0x96ba('0x23');return db['UserProfileSection'][_0x96ba('0x47')]({'where':{'name':_0x1b2a6d,'userProfileId':_0x55c47a['userProfileId']},'raw':!![]})['then'](function(_0x40c9cc){if(_0x40c9cc&&_0x40c9cc[_0x96ba('0x4c')]===0x0){return db[_0x96ba('0x24')][_0x96ba('0x49')]({'name':_0x9df07d[_0x96ba('0x27')],'resourceId':_0x9df07d['id'],'type':_0x40c9cc[_0x96ba('0x27')],'sectionId':_0x40c9cc['id']},{})[_0x96ba('0x20')](function(){return _0x236270;});}else{return _0x236270;}})[_0x96ba('0x48')](function(_0x1e845e){logger[_0x96ba('0x25')](_0x96ba('0x4d'),_0x1e845e);throw _0x1e845e;});}return _0x236270;})['then'](respondWithResult(_0x11744f,0xc9))[_0x96ba('0x48')](handleError(_0x11744f,null));};exports['clone']=function(_0x4064a9,_0x470191){var _0xcc0256={'raw':![],'where':{'id':_0x4064a9[_0x96ba('0x45')]['id']}},_0xbc852f={};_0xbc852f[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db['JscriptyProject'][_0x96ba('0x2b')]);_0xcc0256['attributes']=_[_0x96ba('0x30')](_0xbc852f[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0x4064a9[_0x96ba('0x2e')]['fields']));_0xcc0256['attributes']=_0xcc0256[_0x96ba('0x31')][_0x96ba('0x33')]?_0xcc0256[_0x96ba('0x31')]:_0xbc852f[_0x96ba('0x2c')];if(_0x4064a9['query'][_0x96ba('0x41')]){_0xcc0256[_0x96ba('0x42')]=[{'all':!![]}];}_0xcc0256=_[_0x96ba('0x3b')]({},_0xcc0256,_0x4064a9['options']);return db[_0x96ba('0x2a')][_0x96ba('0x47')](_0xcc0256)['then'](handleEntityNotFound(_0x470191,null))[_0x96ba('0x20')](function(_0x34faf2){if(_0x34faf2){var _0x9d37b=_0x34faf2[_0x96ba('0x22')]({'plain':!![]});_0x9d37b=qs[_0x96ba('0x4e')](_0x9d37b,['id',_0x96ba('0x4f'),_0x96ba('0x50')]);_0x4064a9['body']=_['omit'](_0x4064a9['body'],['id',_0x96ba('0x4f'),_0x96ba('0x50')]);return db[_0x96ba('0x2a')][_0x96ba('0x49')](_['merge'](_0x9d37b,_0x4064a9[_0x96ba('0x51')]),{'include':_0x4064a9[_0x96ba('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x96ba('0x20')](function(_0x1bf7e9){var _0x2b11a3=_0x4064a9[_0x96ba('0x4b')][_0x96ba('0x22')]({'plain':!![]});if(!_0x2b11a3)throw new Error(_0x96ba('0x4a'));if(_0x2b11a3[_0x96ba('0x52')]===_0x96ba('0x4b')){var _0x1fc54f=_0x1bf7e9[_0x96ba('0x22')]({'plain':!![]});var _0xb8dc8e=_0x96ba('0x23');return db[_0x96ba('0x53')][_0x96ba('0x47')]({'where':{'name':_0xb8dc8e,'userProfileId':_0x2b11a3['userProfileId']},'raw':!![]})[_0x96ba('0x20')](function(_0x4570e3){if(_0x4570e3&&_0x4570e3[_0x96ba('0x4c')]===0x0){return db['UserProfileResource'][_0x96ba('0x49')]({'name':_0x1fc54f[_0x96ba('0x27')],'resourceId':_0x1fc54f['id'],'type':_0x4570e3[_0x96ba('0x27')],'sectionId':_0x4570e3['id']},{})[_0x96ba('0x20')](function(){return _0x1bf7e9;});}else{return _0x1bf7e9;}})[_0x96ba('0x48')](function(_0x137786){logger[_0x96ba('0x25')](_0x96ba('0x4d'),_0x137786);throw _0x137786;});}return _0x1bf7e9;});}})[_0x96ba('0x20')](respondWithResult(_0x470191,0xc9))['catch'](handleError(_0x470191,null));};exports[_0x96ba('0x54')]=function(_0xd7903f,_0xc5ea80){if(_0xd7903f[_0x96ba('0x51')]['id']){delete _0xd7903f[_0x96ba('0x51')]['id'];}return db[_0x96ba('0x2a')][_0x96ba('0x47')]({'where':{'id':_0xd7903f[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0xc5ea80,null))['then'](saveUpdates(_0xd7903f[_0x96ba('0x51')],null))[_0x96ba('0x20')](respondWithResult(_0xc5ea80,null))['catch'](handleError(_0xc5ea80,null));};exports[_0x96ba('0x21')]=function(_0x1d4d2e,_0x513d2f){return db[_0x96ba('0x2a')][_0x96ba('0x47')]({'where':{'id':_0x1d4d2e[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x513d2f,null))[_0x96ba('0x20')](removeEntity(_0x513d2f,null))[_0x96ba('0x48')](handleError(_0x513d2f,null));};exports[_0x96ba('0x55')]=function(_0x189dc4,_0x529b94,_0x9a6190){var _0x2f9788={'raw':!![],'where':{}};var _0x5b4bc3={};var _0x178284={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x96ba('0x56')]({'where':{'id':_0x189dc4['params']['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x529b94,null))[_0x96ba('0x20')](function(_0x10e28e){if(_0x10e28e){_0x5b4bc3[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db[_0x96ba('0x57')][_0x96ba('0x2b')]);_0x5b4bc3[_0x96ba('0x2e')]=_['keys'](_0x189dc4['query']);_0x5b4bc3[_0x96ba('0x2f')]=_[_0x96ba('0x30')](_0x5b4bc3['model'],_0x5b4bc3[_0x96ba('0x2e')]);_0x2f9788[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x5b4bc3[_0x96ba('0x2c')],qs[_0x96ba('0x32')](_0x189dc4['query'][_0x96ba('0x32')]));_0x2f9788[_0x96ba('0x31')]=_0x2f9788[_0x96ba('0x31')][_0x96ba('0x33')]?_0x2f9788[_0x96ba('0x31')]:_0x5b4bc3[_0x96ba('0x2c')];if(!_0x189dc4['query'][_0x96ba('0x34')](_0x96ba('0x35'))){_0x2f9788['limit']=qs[_0x96ba('0x36')](_0x189dc4[_0x96ba('0x2e')]['limit']);_0x2f9788[_0x96ba('0x1c')]=qs['offset'](_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x1c')]);}_0x2f9788[_0x96ba('0x37')]=qs[_0x96ba('0x38')](_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x2f9788[_0x96ba('0x39')]=qs[_0x96ba('0x2f')](_[_0x96ba('0x58')](_0x189dc4[_0x96ba('0x2e')],_0x5b4bc3['filters']));_0x2f9788[_0x96ba('0x39')][_0x96ba('0x59')]=_0x10e28e['id'];if(_0x189dc4[_0x96ba('0x2e')][_0x96ba('0x3a')]){_0x2f9788[_0x96ba('0x39')]=_[_0x96ba('0x3b')](_0x2f9788[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0x2f9788['attributes'],function(_0x196f92){var _0x52a278={};_0x52a278[_0x196f92]={'$like':'%'+_0x189dc4['query']['filter']+'%'};return _0x52a278;})});}_0x2f9788=_[_0x96ba('0x3b')]({},_0x2f9788,_0x189dc4['options']);return db[_0x96ba('0x57')][_0x96ba('0x1b')]({'where':_0x2f9788[_0x96ba('0x39')]})[_0x96ba('0x20')](function(_0x3b9d86){_0x178284[_0x96ba('0x1b')]=_0x3b9d86;if(_0x189dc4[_0x96ba('0x2e')]['includeAll']){_0x2f9788[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x57')][_0x96ba('0x5a')](_0x2f9788);})[_0x96ba('0x20')](function(_0x7d0aa1){_0x178284[_0x96ba('0x43')]=_0x7d0aa1;return _0x178284;});}})[_0x96ba('0x20')](respondWithFilteredResult(_0x529b94,_0x2f9788))[_0x96ba('0x48')](handleError(_0x529b94,null));};exports['getAnswers']=function(_0x35e13a,_0x42f143,_0x36a984){var _0x225c30={'raw':!![],'where':{}};var _0x22019f={};var _0xea4dca={'count':0x0,'rows':[]};return db[_0x96ba('0x2a')][_0x96ba('0x56')]({'where':{'id':_0x35e13a[_0x96ba('0x45')]['id']}})[_0x96ba('0x20')](handleEntityNotFound(_0x42f143,null))[_0x96ba('0x20')](function(_0x48fe63){if(_0x48fe63){_0x22019f[_0x96ba('0x2c')]=_[_0x96ba('0x2d')](db[_0x96ba('0x5b')][_0x96ba('0x2b')]);_0x22019f[_0x96ba('0x2e')]=_[_0x96ba('0x2d')](_0x35e13a['query']);_0x22019f[_0x96ba('0x2f')]=_['intersection'](_0x22019f[_0x96ba('0x2c')],_0x22019f['query']);_0x225c30[_0x96ba('0x31')]=_[_0x96ba('0x30')](_0x22019f[_0x96ba('0x2c')],qs['fields'](_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x32')]));_0x225c30[_0x96ba('0x31')]=_0x225c30[_0x96ba('0x31')][_0x96ba('0x33')]?_0x225c30['attributes']:_0x22019f[_0x96ba('0x2c')];if(!_0x35e13a[_0x96ba('0x2e')]['hasOwnProperty'](_0x96ba('0x35'))){_0x225c30['limit']=qs[_0x96ba('0x36')](_0x35e13a['query'][_0x96ba('0x36')]);_0x225c30[_0x96ba('0x1c')]=qs[_0x96ba('0x1c')](_0x35e13a[_0x96ba('0x2e')]['offset']);}_0x225c30[_0x96ba('0x37')]=qs[_0x96ba('0x38')](_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x38')]);_0x225c30['where']=qs[_0x96ba('0x2f')](_[_0x96ba('0x58')](_0x35e13a[_0x96ba('0x2e')],_0x22019f[_0x96ba('0x2f')]));_0x225c30[_0x96ba('0x39')][_0x96ba('0x59')]=_0x48fe63['id'];if(_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x3a')]){_0x225c30['where']=_[_0x96ba('0x3b')](_0x225c30[_0x96ba('0x39')],{'$or':_[_0x96ba('0x3c')](_0x225c30[_0x96ba('0x31')],function(_0xe1eac){var _0x260cb1={};_0x260cb1[_0xe1eac]={'$like':'%'+_0x35e13a[_0x96ba('0x2e')]['filter']+'%'};return _0x260cb1;})});}_0x225c30=_[_0x96ba('0x3b')]({},_0x225c30,_0x35e13a[_0x96ba('0x46')]);return db[_0x96ba('0x5b')][_0x96ba('0x1b')]({'where':_0x225c30[_0x96ba('0x39')]})[_0x96ba('0x20')](function(_0x20e6da){_0xea4dca[_0x96ba('0x1b')]=_0x20e6da;if(_0x35e13a[_0x96ba('0x2e')][_0x96ba('0x41')]){_0x225c30[_0x96ba('0x42')]=[{'all':!![]}];}return db[_0x96ba('0x5b')]['findAll'](_0x225c30);})['then'](function(_0xfb6993){_0xea4dca[_0x96ba('0x43')]=_0xfb6993;return _0xea4dca;});}})[_0x96ba('0x20')](respondWithFilteredResult(_0x42f143,_0x225c30))[_0x96ba('0x48')](handleError(_0x42f143,null));};function char(_0x38bef1){return'number'===typeof _0x38bef1?String[_0x96ba('0x5c')][_0x96ba('0x1f')](null,arguments):_0x38bef1;}function needsEncapsulation(_0x42b0b0){return!!_0x42b0b0&&(_0x42b0b0[_0x96ba('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x42b0b0['toString']()[_0x96ba('0x5e')](char(0xa))>=0x0||_0x42b0b0[_0x96ba('0x5d')]()[_0x96ba('0x5e')](char(0x2c))>=0x0||_0x42b0b0[_0x96ba('0x5d')]()[_0x96ba('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x57056f){var _0x5ca783=char(0x22),_0x2dca0f='\x5c'+char(0x22),_0x1a58df=_0x57056f[_0x96ba('0x5d')]()[_0x96ba('0x5f')](new RegExp(_0x5ca783,'g'),_0x2dca0f);return _0x5ca783+_0x1a58df+_0x5ca783;}exports['getSummary']=function(_0x418ea4,_0x5c4083,_0x4f9f57){var _0xddc7c8,_0x40f330;var _0x3cbfa7={'where':{'ProjectId':_0x418ea4[_0x96ba('0x45')]['id']}};if(_0x418ea4[_0x96ba('0x2e')][_0x96ba('0x60')]){_0x3cbfa7[_0x96ba('0x39')]['starttime']=JSON[_0x96ba('0x61')](_0x418ea4[_0x96ba('0x2e')][_0x96ba('0x60')]);}return db[_0x96ba('0x57')][_0x96ba('0x5a')](_0x3cbfa7)[_0x96ba('0x20')](handleEntityNotFound(_0x5c4083,null))['then'](function(_0x5ceb25){if(_0x5ceb25){_0xddc7c8=_0x5ceb25;return db[_0x96ba('0x62')][_0x96ba('0x5a')]({'where':{'SessionId':{'$in':_[_0x96ba('0x3c')](_0xddc7c8,'id')},'ProjectId':_0x418ea4[_0x96ba('0x45')]['id']},'order':_0x96ba('0x63')});}})[_0x96ba('0x20')](handleEntityNotFound(_0x5c4083,null))[_0x96ba('0x20')](function(_0x16e8f2){if(_0x16e8f2){_0x40f330=_0x16e8f2;var _0x11b54c={};for(var _0x525532=0x0,_0x51fe69=_0x40f330[_0x96ba('0x33')];_0x525532<_0x51fe69;_0x525532++){if(!_0x11b54c[_0x96ba('0x34')](_0x40f330[_0x525532][_0x96ba('0x64')])){_0x11b54c[_0x40f330[_0x525532][_0x96ba('0x64')]]=needsEncapsulation(_0x40f330[_0x525532][_0x96ba('0x65')])?encapsulate(_0x40f330[_0x525532]['question']):_0x40f330[_0x525532]['question'];}}var _0xe3340a=[],_0x4e1765={};for(var _0x44063a=0x0,_0x1aafbc=_0xddc7c8[_0x96ba('0x33')];_0x44063a<_0x1aafbc;_0x44063a++){_0x4e1765={'ProjectId':_0x418ea4[_0x96ba('0x45')]['id'],'SessionId':_0xddc7c8[_0x44063a]['id'],'StartTime':moment(_0xddc7c8[_0x44063a][_0x96ba('0x66')])[_0x96ba('0x67')](_0x96ba('0x68'))};for(var _0x3c48d3=0x0,_0x3d10da=_0x40f330[_0x96ba('0x33')];_0x3c48d3<_0x3d10da;_0x3c48d3++){if(_0x40f330[_0x3c48d3][_0x96ba('0x69')]==_0xddc7c8[_0x44063a]['id']&&_0x11b54c[_0x96ba('0x34')](_0x40f330[_0x3c48d3][_0x96ba('0x64')])){_0x4e1765[_0x11b54c[_0x40f330[_0x3c48d3]['questionId']]]=_0x40f330[_0x3c48d3][_0x96ba('0x6a')];}}for(var _0x20ae2d in _0x11b54c){if(!_0x4e1765[_0x96ba('0x34')](_0x11b54c[_0x20ae2d])){_0x4e1765[_0x11b54c[_0x20ae2d]]=null;}}_0xe3340a[_0x96ba('0x6b')](_0x4e1765);}return _0xe3340a;}})[_0x96ba('0x20')](function(_0x4156a5){if(!_[_0x96ba('0x6c')](_0x4156a5)){var _0x28896c=toCsv(_0x4156a5);var _0x455f5f=Date[_0x96ba('0x6d')]();fs[_0x96ba('0x6e')](util[_0x96ba('0x67')](_0x96ba('0x6f'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f),_0x28896c);_0x5c4083['setHeader'](_0x96ba('0x70'),'attachment;\x20filename='+util[_0x96ba('0x67')](_0x96ba('0x71'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f));_0x5c4083[_0x96ba('0x72')]('Content-type',_0x96ba('0x73'));return _0x5c4083[_0x96ba('0x74')](util[_0x96ba('0x67')](_0x96ba('0x6f'),_0x418ea4[_0x96ba('0x45')]['id'],_0x455f5f));}else{return _0x5c4083[_0x96ba('0x17')](0xcc);}})[_0x96ba('0x48')](handleError(_0x5c4083,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 99a62e6..0f22a2b 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 _0xd45e=['path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','util','../../config/logger','moment','request-promise'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xd45e,0x182));var _0xed45=function(_0x314e74,_0x2ca40f){_0x314e74=_0x314e74-0x0;var _0x3ebe54=_0xd45e[_0x314e74];return _0x3ebe54;};'use strict';var _=require('lodash');var util=require(_0xed45('0x0'));var logger=require(_0xed45('0x1'))('api');var moment=require(_0xed45('0x2'));var BPromise=require('bluebird');var rp=require(_0xed45('0x3'));var fs=require('fs');var path=require(_0xed45('0x4'));var rimraf=require(_0xed45('0x5'));var config=require('../../config/environment');var attributes=require(_0xed45('0x6'));module[_0xed45('0x7')]=function(_0x5332aa,_0x528ca3){return _0x5332aa[_0xed45('0x8')](_0xed45('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8a1=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','moment','request-promise','rimraf','exports'];(function(_0x5b7ccb,_0x4cf444){var _0x5375f7=function(_0x1e1482){while(--_0x1e1482){_0x5b7ccb['push'](_0x5b7ccb['shift']());}};_0x5375f7(++_0x4cf444);}(_0xe8a1,0xad));var _0x1e8a=function(_0x32c48a,_0x874ea7){_0x32c48a=_0x32c48a-0x0;var _0xfecc8e=_0xe8a1[_0x32c48a];return _0xfecc8e;};'use strict';var _=require(_0x1e8a('0x0'));var util=require(_0x1e8a('0x1'));var logger=require(_0x1e8a('0x2'))('api');var moment=require(_0x1e8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e8a('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x1e8a('0x6')]=function(_0x32e924,_0x3fe04c){return _0x32e924[_0x1e8a('0x7')](_0x1e8a('0x8'),attributes,{'tableName':_0x1e8a('0x9'),'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 544591c..932c963 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 _0xef8e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x3aef70,_0x56d200){var _0x26a1a1=function(_0x55e0a5){while(--_0x55e0a5){_0x3aef70['push'](_0x3aef70['shift']());}};_0x26a1a1(++_0x56d200);}(_0xef8e,0x17b));var _0xeef8=function(_0x395f0f,_0x5a2c92){_0x395f0f=_0x395f0f-0x0;var _0x368d59=_0xef8e[_0x395f0f];return _0x368d59;};'use strict';var _=require(_0xeef8('0x0'));var util=require('util');var moment=require(_0xeef8('0x1'));var BPromise=require(_0xeef8('0x2'));var rs=require(_0xeef8('0x3'));var fs=require('fs');var Redis=require(_0xeef8('0x4'));var db=require(_0xeef8('0x5'))['db'];var utils=require(_0xeef8('0x6'));var logger=require(_0xeef8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeef8('0x8'));var client=jayson[_0xeef8('0x9')][_0xeef8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19bfc2,_0x11f698,_0x5e095a){return new BPromise(function(_0x490067,_0x2f3dd2){return client['request'](_0x19bfc2,_0x5e095a)[_0xeef8('0xb')](function(_0x1ccf20){logger[_0xeef8('0xc')](_0xeef8('0xd'),_0x11f698,'request\x20sent');logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x11f698,_0xeef8('0xe'),JSON[_0xeef8('0xf')](_0x1ccf20));if(_0x1ccf20[_0xeef8('0x10')]){if(_0x1ccf20[_0xeef8('0x10')][_0xeef8('0x11')]===0x1f4){logger[_0xeef8('0x10')](_0xeef8('0xd'),_0x11f698,_0x1ccf20['error'][_0xeef8('0x12')]);return _0x2f3dd2(_0x1ccf20['error'][_0xeef8('0x12')]);}logger[_0xeef8('0x10')](_0xeef8('0xd'),_0x11f698,_0x1ccf20['error'][_0xeef8('0x12')]);return _0x490067(_0x1ccf20[_0xeef8('0x10')][_0xeef8('0x12')]);}else{logger[_0xeef8('0xc')](_0xeef8('0xd'),_0x11f698,'request\x20sent');_0x490067(_0x1ccf20['result'][_0xeef8('0x12')]);}})[_0xeef8('0x13')](function(_0x124a50){logger[_0xeef8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x11f698,_0x124a50);_0x2f3dd2(_0x124a50);});});} \ No newline at end of file +var _0xe154=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xe154,0x11b));var _0x4e15=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe154[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require(_0x4e15('0x0'));var moment=require(_0x4e15('0x1'));var BPromise=require(_0x4e15('0x2'));var rs=require(_0x4e15('0x3'));var fs=require('fs');var Redis=require(_0x4e15('0x4'));var db=require(_0x4e15('0x5'))['db'];var utils=require(_0x4e15('0x6'));var logger=require(_0x4e15('0x7'))(_0x4e15('0x8'));var config=require(_0x4e15('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4e15('0xa')][_0x4e15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a2cf,_0x180947,_0x9f9982){return new BPromise(function(_0x103646,_0x52328a){return client['request'](_0x36a2cf,_0x9f9982)['then'](function(_0x14e35b){logger['info'](_0x4e15('0xc'),_0x180947,'request\x20sent');logger[_0x4e15('0xd')](_0x4e15('0xe'),_0x180947,'request\x20sent',JSON[_0x4e15('0xf')](_0x14e35b));if(_0x14e35b[_0x4e15('0x10')]){if(_0x14e35b[_0x4e15('0x10')]['code']===0x1f4){logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x14e35b[_0x4e15('0x10')][_0x4e15('0x11')]);return _0x52328a(_0x14e35b[_0x4e15('0x10')][_0x4e15('0x11')]);}logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x14e35b[_0x4e15('0x10')]['message']);return _0x103646(_0x14e35b[_0x4e15('0x10')]['message']);}else{logger[_0x4e15('0x12')](_0x4e15('0xc'),_0x180947,_0x4e15('0x13'));_0x103646(_0x14e35b[_0x4e15('0x14')][_0x4e15('0x11')]);}})[_0x4e15('0x15')](function(_0x597fc9){logger[_0x4e15('0x10')](_0x4e15('0xc'),_0x180947,_0x597fc9);_0x52328a(_0x597fc9);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6376ea5..461b625 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 _0x47b9=['post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x47b9,0x110));var _0x947b=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x47b9[_0x44afa4];return _0xcad289;};'use strict';var multer=require(_0x947b('0x0'));var util=require(_0x947b('0x1'));var path=require(_0x947b('0x2'));var timeout=require('connect-timeout');var express=require(_0x947b('0x3'));var router=express[_0x947b('0x4')]();var auth=require(_0x947b('0x5'));var interaction=require(_0x947b('0x6'));var config=require(_0x947b('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x947b('0x8')](),controller[_0x947b('0x9')]);router[_0x947b('0xa')]('/describe',auth[_0x947b('0x8')](),controller['describe']);router['get'](_0x947b('0xb'),auth[_0x947b('0x8')](),controller[_0x947b('0xc')]);router[_0x947b('0xd')]('/',auth[_0x947b('0x8')](),controller[_0x947b('0xe')]);router[_0x947b('0xf')](_0x947b('0xb'),auth[_0x947b('0x8')](),controller['update']);router[_0x947b('0x10')](_0x947b('0xb'),auth[_0x947b('0x8')](),controller[_0x947b('0x11')]);module[_0x947b('0x12')]=router; \ No newline at end of file +var _0x96d4=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x36b7d2,_0xe1d340){var _0x176bb6=function(_0x5a6c8d){while(--_0x5a6c8d){_0x36b7d2['push'](_0x36b7d2['shift']());}};_0x176bb6(++_0xe1d340);}(_0x96d4,0x108));var _0x496d=function(_0x340d27,_0x18af34){_0x340d27=_0x340d27-0x0;var _0x364d74=_0x96d4[_0x340d27];return _0x364d74;};'use strict';var multer=require(_0x496d('0x0'));var util=require(_0x496d('0x1'));var path=require('path');var timeout=require(_0x496d('0x2'));var express=require(_0x496d('0x3'));var router=express['Router']();var auth=require(_0x496d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x496d('0x5'));var controller=require(_0x496d('0x6'));router[_0x496d('0x7')]('/',auth[_0x496d('0x8')](),controller[_0x496d('0x9')]);router[_0x496d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x496d('0xa')]);router[_0x496d('0x7')](_0x496d('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x496d('0x8')](),controller[_0x496d('0xc')]);router[_0x496d('0xd')](_0x496d('0xb'),auth[_0x496d('0x8')](),controller[_0x496d('0xe')]);router[_0x496d('0xf')]('/:id',auth[_0x496d('0x8')](),controller[_0x496d('0x10')]);module[_0x496d('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 59f99e8..0a9e60d 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 _0xef38=['STRING','TEXT','exports'];(function(_0x16dced,_0x2f8d60){var _0x40e9d7=function(_0x1fc94a){while(--_0x1fc94a){_0x16dced['push'](_0x16dced['shift']());}};_0x40e9d7(++_0x2f8d60);}(_0xef38,0x122));var _0x8ef3=function(_0x475922,_0x1e1886){_0x475922=_0x475922-0x0;var _0x531932=_0xef38[_0x475922];return _0x531932;};'use strict';var Sequelize=require('sequelize');module[_0x8ef3('0x0')]={'question':{'type':Sequelize[_0x8ef3('0x1')]},'answer':{'type':Sequelize[_0x8ef3('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8ef3('0x1')]},'queue':{'type':Sequelize[_0x8ef3('0x1')]},'uniqueid':{'type':Sequelize[_0x8ef3('0x1')]},'calleridname':{'type':Sequelize[_0x8ef3('0x1')]},'calleridnum':{'type':Sequelize[_0x8ef3('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x76a3=['STRING','TEXT','long','sequelize','exports'];(function(_0x56039b,_0x3de8d8){var _0xc90792=function(_0x300c35){while(--_0x300c35){_0x56039b['push'](_0x56039b['shift']());}};_0xc90792(++_0x3de8d8);}(_0x76a3,0xf8));var _0x376a=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x76a3[_0x754ab4];return _0x34079a;};'use strict';var Sequelize=require(_0x376a('0x0'));module[_0x376a('0x1')]={'question':{'type':Sequelize[_0x376a('0x2')]},'answer':{'type':Sequelize[_0x376a('0x3')](_0x376a('0x4'))},'membername':{'type':Sequelize[_0x376a('0x2')]},'projectname':{'type':Sequelize[_0x376a('0x2')]},'queue':{'type':Sequelize[_0x376a('0x2')]},'uniqueid':{'type':Sequelize[_0x376a('0x2')]},'calleridname':{'type':Sequelize[_0x376a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 1a2ee4b..8c36100 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 _0xf802=['name','index','JscriptyQuestionReport','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','catch','params','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack'];(function(_0xa55099,_0x2356ef){var _0x3e425c=function(_0xb9ed6e){while(--_0xb9ed6e){_0xa55099['push'](_0xa55099['shift']());}};_0x3e425c(++_0x2356ef);}(_0xf802,0x100));var _0x2f80=function(_0x4f85e6,_0xa3cbca){_0x4f85e6=_0x4f85e6-0x0;var _0x970e75=_0xf802[_0x4f85e6];return _0x970e75;};'use strict';var pdf=require(_0x2f80('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2f80('0x1'));var zipdir=require(_0x2f80('0x2'));var jsonpatch=require(_0x2f80('0x3'));var rp=require(_0x2f80('0x4'));var moment=require('moment');var BPromise=require(_0x2f80('0x5'));var Mustache=require(_0x2f80('0x6'));var util=require(_0x2f80('0x7'));var path=require(_0x2f80('0x8'));var sox=require('sox');var csv=require(_0x2f80('0x9'));var ejs=require(_0x2f80('0xa'));var fs=require('fs');var _=require(_0x2f80('0xb'));var squel=require(_0x2f80('0xc'));var crypto=require(_0x2f80('0xd'));var jsforce=require(_0x2f80('0xe'));var deskjs=require(_0x2f80('0xf'));var toCsv=require(_0x2f80('0x9'));var querystring=require(_0x2f80('0x10'));var Papa=require(_0x2f80('0x11'));var Redis=require('ioredis');var authService=require(_0x2f80('0x12'));var qs=require(_0x2f80('0x13'));var hardwareService=require(_0x2f80('0x14'));var logger=require(_0x2f80('0x15'))(_0x2f80('0x16'));var utils=require('../../config/utils');var config=require(_0x2f80('0x17'));var db=require(_0x2f80('0x18'))['db'];function respondWithStatusCode(_0x39eb6,_0x1c9077){_0x1c9077=_0x1c9077||0xcc;return function(_0x2d2fe9){if(_0x2d2fe9){return _0x39eb6[_0x2f80('0x19')](_0x1c9077);}return _0x39eb6[_0x2f80('0x1a')](_0x1c9077)[_0x2f80('0x1b')]();};}function respondWithResult(_0x35ecc1,_0x2df602){_0x2df602=_0x2df602||0xc8;return function(_0x7ab6e3){if(_0x7ab6e3){return _0x35ecc1[_0x2f80('0x1a')](_0x2df602)[_0x2f80('0x1c')](_0x7ab6e3);}};}function respondWithFilteredResult(_0x53883a,_0x3d4461){return function(_0x2d7e4f){if(_0x2d7e4f){var _0x393b16=_0x2d7e4f[_0x2f80('0x1d')],_0x53f030=_0x3d4461[_0x2f80('0x1e')],_0x4d4c56=_0x3d4461[_0x2f80('0x1e')]+_0x3d4461['limit'],_0x55d5f0;if(_0x4d4c56>=_0x393b16){_0x4d4c56=_0x393b16;_0x55d5f0=0xc8;}else{_0x55d5f0=0xce;}_0x53883a[_0x2f80('0x1a')](_0x55d5f0);return _0x53883a[_0x2f80('0x1f')]('Content-Range',_0x53f030+'-'+_0x4d4c56+'/'+_0x393b16)[_0x2f80('0x1c')](_0x2d7e4f);}return null;};}function patchUpdates(_0x3c1403){return function(_0x31689d){try{jsonpatch[_0x2f80('0x20')](_0x31689d,_0x3c1403,!![]);}catch(_0xc1264e){return BPromise[_0x2f80('0x21')](_0xc1264e);}return _0x31689d[_0x2f80('0x22')]();};}function saveUpdates(_0x12dbaa,_0x4a52c7){return function(_0x151472){if(_0x151472){return _0x151472[_0x2f80('0x23')](_0x12dbaa)[_0x2f80('0x24')](function(_0xe3b732){return _0xe3b732;});}return null;};}function removeEntity(_0x1e5f6c,_0x57c0fd){return function(_0x183f42){if(_0x183f42){return _0x183f42[_0x2f80('0x25')]()[_0x2f80('0x24')](function(){_0x1e5f6c['status'](0xcc)[_0x2f80('0x1b')]();});}};}function handleEntityNotFound(_0x63c1c7,_0xb05d4f){return function(_0x596962){if(!_0x596962){_0x63c1c7['sendStatus'](0x194);}return _0x596962;};}function handleError(_0x23ceb1,_0x57e6bd){_0x57e6bd=_0x57e6bd||0x1f4;return function(_0x37a4f2){logger[_0x2f80('0x26')](_0x37a4f2[_0x2f80('0x27')]);if(_0x37a4f2['name']){delete _0x37a4f2[_0x2f80('0x28')];}_0x23ceb1[_0x2f80('0x1a')](_0x57e6bd)['send'](_0x37a4f2);};}exports[_0x2f80('0x29')]=function(_0xc8c92,_0x239582){var _0x45f145={},_0x47e0b0={},_0x1f0167={'count':0x0,'rows':[]};var _0x556d93=db[_0x2f80('0x2a')][_0x2f80('0x2b')];_0x47e0b0['model']=_['keys'](_0x556d93);_0x47e0b0[_0x2f80('0x2c')]=_[_0x2f80('0x2d')](_0xc8c92[_0x2f80('0x2c')]);_0x47e0b0[_0x2f80('0x2e')]=_['intersection'](_0x47e0b0[_0x2f80('0x2f')],_0x47e0b0[_0x2f80('0x2c')]);_0x45f145[_0x2f80('0x30')]=_[_0x2f80('0x31')](_0x47e0b0[_0x2f80('0x2f')],qs[_0x2f80('0x32')](_0xc8c92[_0x2f80('0x2c')]['fields']));_0x45f145[_0x2f80('0x30')]=_0x45f145[_0x2f80('0x30')][_0x2f80('0x33')]?_0x45f145['attributes']:_0x47e0b0[_0x2f80('0x2f')];if(!_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x34')](_0x2f80('0x35'))){_0x45f145[_0x2f80('0x36')]=qs[_0x2f80('0x36')](_0xc8c92['query'][_0x2f80('0x36')]);_0x45f145[_0x2f80('0x1e')]=qs[_0x2f80('0x1e')](_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x1e')]);}_0x45f145[_0x2f80('0x37')]=qs['sort'](_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x38')]);_0x45f145[_0x2f80('0x39')]=qs[_0x2f80('0x2e')](_[_0x2f80('0x3a')](_0xc8c92['query'],_0x47e0b0['filters']));if(_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x3b')]){_0x45f145['where']=_[_0x2f80('0x3c')](_0x45f145[_0x2f80('0x39')],{'$or':_[_0x2f80('0x3d')](_0x556d93,function(_0x4c73c0){if(_0x4c73c0[_0x2f80('0x3e')]['key']!==_0x2f80('0x3f')){var _0x553209={};_0x553209[_0x4c73c0[_0x2f80('0x40')]]={'$like':'%'+_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x3b')]+'%'};return _0x553209;}})});}_0x45f145=_[_0x2f80('0x3c')]({},_0x45f145,_0xc8c92[_0x2f80('0x41')]);var _0x1ba68c={'where':_0x45f145['where']};return db[_0x2f80('0x2a')][_0x2f80('0x1d')](_0x1ba68c)['then'](function(_0x44690b){_0x1f0167[_0x2f80('0x1d')]=_0x44690b;if(_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x42')]){_0x45f145[_0x2f80('0x43')]=[{'all':!![]}];}return db[_0x2f80('0x2a')][_0x2f80('0x44')](_0x45f145);})[_0x2f80('0x24')](function(_0x4d45b1){_0x1f0167['rows']=_0x4d45b1;return _0x1f0167;})[_0x2f80('0x24')](respondWithFilteredResult(_0x239582,_0x45f145))[_0x2f80('0x45')](handleError(_0x239582,null));};exports['show']=function(_0x4f5f4a,_0x398699){var _0x45bc4b={'raw':!![],'where':{'id':_0x4f5f4a[_0x2f80('0x46')]['id']}},_0x4257ed={};_0x4257ed[_0x2f80('0x2f')]=_[_0x2f80('0x2d')](db[_0x2f80('0x2a')]['rawAttributes']);_0x4257ed[_0x2f80('0x2c')]=_[_0x2f80('0x2d')](_0x4f5f4a[_0x2f80('0x2c')]);_0x4257ed['filters']=_[_0x2f80('0x31')](_0x4257ed['model'],_0x4257ed[_0x2f80('0x2c')]);_0x45bc4b[_0x2f80('0x30')]=_[_0x2f80('0x31')](_0x4257ed[_0x2f80('0x2f')],qs['fields'](_0x4f5f4a[_0x2f80('0x2c')]['fields']));_0x45bc4b['attributes']=_0x45bc4b['attributes'][_0x2f80('0x33')]?_0x45bc4b[_0x2f80('0x30')]:_0x4257ed[_0x2f80('0x2f')];if(_0x4f5f4a['query'][_0x2f80('0x42')]){_0x45bc4b[_0x2f80('0x43')]=[{'all':!![]}];}_0x45bc4b=_[_0x2f80('0x3c')]({},_0x45bc4b,_0x4f5f4a[_0x2f80('0x41')]);return db[_0x2f80('0x2a')]['find'](_0x45bc4b)['then'](handleEntityNotFound(_0x398699,null))[_0x2f80('0x24')](respondWithResult(_0x398699,null))['catch'](handleError(_0x398699,null));};exports[_0x2f80('0x47')]=function(_0x4c44b5,_0x52e90e){return db['JscriptyQuestionReport'][_0x2f80('0x47')](_0x4c44b5['body'],{})[_0x2f80('0x24')](respondWithResult(_0x52e90e,0xc9))[_0x2f80('0x45')](handleError(_0x52e90e,null));};exports[_0x2f80('0x23')]=function(_0x8c4f21,_0x10fb47){if(_0x8c4f21['body']['id']){delete _0x8c4f21[_0x2f80('0x48')]['id'];}return db[_0x2f80('0x2a')][_0x2f80('0x49')]({'where':{'id':_0x8c4f21[_0x2f80('0x46')]['id']}})[_0x2f80('0x24')](handleEntityNotFound(_0x10fb47,null))[_0x2f80('0x24')](saveUpdates(_0x8c4f21[_0x2f80('0x48')],null))[_0x2f80('0x24')](respondWithResult(_0x10fb47,null))[_0x2f80('0x45')](handleError(_0x10fb47,null));};exports[_0x2f80('0x25')]=function(_0x39da59,_0x44c5df){return db[_0x2f80('0x2a')][_0x2f80('0x49')]({'where':{'id':_0x39da59['params']['id']}})[_0x2f80('0x24')](handleEntityNotFound(_0x44c5df,null))[_0x2f80('0x24')](removeEntity(_0x44c5df,null))['catch'](handleError(_0x44c5df,null));};exports['describe']=function(_0xf62f75,_0x3ed54e){return db['JscriptyQuestionReport']['describe']()[_0x2f80('0x24')](respondWithResult(_0x3ed54e,null))['catch'](handleError(_0x3ed54e,null));}; \ No newline at end of file +var _0x223d=['../../mysqldb','sendStatus','status','json','offset','set','apply','reject','update','then','destroy','end','error','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','field','merge','options','count','include','rows','show','params','includeAll','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x2bdff7,_0x4199dd){var _0x15a40a=function(_0x21d57c){while(--_0x21d57c){_0x2bdff7['push'](_0x2bdff7['shift']());}};_0x15a40a(++_0x4199dd);}(_0x223d,0x13c));var _0xd223=function(_0x5d7624,_0x13c005){_0x5d7624=_0x5d7624-0x0;var _0x2ce86e=_0x223d[_0x5d7624];return _0x2ce86e;};'use strict';var pdf=require(_0xd223('0x0'));var emlformat=require(_0xd223('0x1'));var rimraf=require(_0xd223('0x2'));var zipdir=require(_0xd223('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd223('0x4'));var moment=require(_0xd223('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd223('0x6'));var sox=require('sox');var csv=require(_0xd223('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd223('0x8'));var squel=require(_0xd223('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd223('0xa'));var toCsv=require(_0xd223('0x7'));var querystring=require(_0xd223('0xb'));var Papa=require(_0xd223('0xc'));var Redis=require(_0xd223('0xd'));var authService=require(_0xd223('0xe'));var qs=require(_0xd223('0xf'));var hardwareService=require(_0xd223('0x10'));var logger=require('../../config/logger')(_0xd223('0x11'));var utils=require('../../config/utils');var config=require(_0xd223('0x12'));var db=require(_0xd223('0x13'))['db'];function respondWithStatusCode(_0x24a578,_0x34440c){_0x34440c=_0x34440c||0xcc;return function(_0x51fa9b){if(_0x51fa9b){return _0x24a578[_0xd223('0x14')](_0x34440c);}return _0x24a578['status'](_0x34440c)['end']();};}function respondWithResult(_0xe802e3,_0x367407){_0x367407=_0x367407||0xc8;return function(_0x4db289){if(_0x4db289){return _0xe802e3[_0xd223('0x15')](_0x367407)[_0xd223('0x16')](_0x4db289);}};}function respondWithFilteredResult(_0x2d7598,_0x1f29a3){return function(_0x4082c2){if(_0x4082c2){var _0x463e4c=_0x4082c2['count'],_0x1ccd94=_0x1f29a3[_0xd223('0x17')],_0x4d1c34=_0x1f29a3[_0xd223('0x17')]+_0x1f29a3['limit'],_0x2358ed;if(_0x4d1c34>=_0x463e4c){_0x4d1c34=_0x463e4c;_0x2358ed=0xc8;}else{_0x2358ed=0xce;}_0x2d7598[_0xd223('0x15')](_0x2358ed);return _0x2d7598[_0xd223('0x18')]('Content-Range',_0x1ccd94+'-'+_0x4d1c34+'/'+_0x463e4c)['json'](_0x4082c2);}return null;};}function patchUpdates(_0x118d47){return function(_0x5e9b92){try{jsonpatch[_0xd223('0x19')](_0x5e9b92,_0x118d47,!![]);}catch(_0x4cc002){return BPromise[_0xd223('0x1a')](_0x4cc002);}return _0x5e9b92['save']();};}function saveUpdates(_0x4dad15,_0x5eb898){return function(_0x5dc180){if(_0x5dc180){return _0x5dc180[_0xd223('0x1b')](_0x4dad15)[_0xd223('0x1c')](function(_0x115382){return _0x115382;});}return null;};}function removeEntity(_0x1ab7cf,_0x3b8eca){return function(_0xc1c9){if(_0xc1c9){return _0xc1c9[_0xd223('0x1d')]()[_0xd223('0x1c')](function(){_0x1ab7cf[_0xd223('0x15')](0xcc)[_0xd223('0x1e')]();});}};}function handleEntityNotFound(_0x43cc36,_0x149477){return function(_0x47f012){if(!_0x47f012){_0x43cc36[_0xd223('0x14')](0x194);}return _0x47f012;};}function handleError(_0x35ffe4,_0x4250ed){_0x4250ed=_0x4250ed||0x1f4;return function(_0x267acf){logger[_0xd223('0x1f')](_0x267acf['stack']);if(_0x267acf['name']){delete _0x267acf['name'];}_0x35ffe4['status'](_0x4250ed)[_0xd223('0x20')](_0x267acf);};}exports[_0xd223('0x21')]=function(_0x574210,_0x3aeadc){var _0xa35bca={},_0xe404fc={},_0x5a8332={'count':0x0,'rows':[]};var _0x571a0b=db[_0xd223('0x22')][_0xd223('0x23')];_0xe404fc[_0xd223('0x24')]=_[_0xd223('0x25')](_0x571a0b);_0xe404fc['query']=_[_0xd223('0x25')](_0x574210[_0xd223('0x26')]);_0xe404fc['filters']=_[_0xd223('0x27')](_0xe404fc['model'],_0xe404fc[_0xd223('0x26')]);_0xa35bca[_0xd223('0x28')]=_[_0xd223('0x27')](_0xe404fc[_0xd223('0x24')],qs[_0xd223('0x29')](_0x574210[_0xd223('0x26')]['fields']));_0xa35bca[_0xd223('0x28')]=_0xa35bca[_0xd223('0x28')]['length']?_0xa35bca['attributes']:_0xe404fc['model'];if(!_0x574210['query'][_0xd223('0x2a')](_0xd223('0x2b'))){_0xa35bca[_0xd223('0x2c')]=qs[_0xd223('0x2c')](_0x574210[_0xd223('0x26')][_0xd223('0x2c')]);_0xa35bca[_0xd223('0x17')]=qs['offset'](_0x574210[_0xd223('0x26')][_0xd223('0x17')]);}_0xa35bca[_0xd223('0x2d')]=qs[_0xd223('0x2e')](_0x574210[_0xd223('0x26')][_0xd223('0x2e')]);_0xa35bca[_0xd223('0x2f')]=qs[_0xd223('0x30')](_[_0xd223('0x31')](_0x574210[_0xd223('0x26')],_0xe404fc[_0xd223('0x30')]));if(_0x574210[_0xd223('0x26')][_0xd223('0x32')]){_0xa35bca['where']=_['merge'](_0xa35bca['where'],{'$or':_['map'](_0x571a0b,function(_0x18dcb2){if(_0x18dcb2[_0xd223('0x33')]['key']!==_0xd223('0x34')){var _0x36bb5c={};_0x36bb5c[_0x18dcb2[_0xd223('0x35')]]={'$like':'%'+_0x574210[_0xd223('0x26')][_0xd223('0x32')]+'%'};return _0x36bb5c;}})});}_0xa35bca=_[_0xd223('0x36')]({},_0xa35bca,_0x574210[_0xd223('0x37')]);var _0x152534={'where':_0xa35bca[_0xd223('0x2f')]};return db[_0xd223('0x22')][_0xd223('0x38')](_0x152534)['then'](function(_0x37e851){_0x5a8332[_0xd223('0x38')]=_0x37e851;if(_0x574210['query']['includeAll']){_0xa35bca[_0xd223('0x39')]=[{'all':!![]}];}return db[_0xd223('0x22')]['findAll'](_0xa35bca);})[_0xd223('0x1c')](function(_0x5c1971){_0x5a8332[_0xd223('0x3a')]=_0x5c1971;return _0x5a8332;})['then'](respondWithFilteredResult(_0x3aeadc,_0xa35bca))['catch'](handleError(_0x3aeadc,null));};exports[_0xd223('0x3b')]=function(_0x167579,_0x5074fb){var _0x30ed89={'raw':!![],'where':{'id':_0x167579[_0xd223('0x3c')]['id']}},_0x5f2da9={};_0x5f2da9[_0xd223('0x24')]=_[_0xd223('0x25')](db[_0xd223('0x22')]['rawAttributes']);_0x5f2da9[_0xd223('0x26')]=_[_0xd223('0x25')](_0x167579[_0xd223('0x26')]);_0x5f2da9[_0xd223('0x30')]=_[_0xd223('0x27')](_0x5f2da9[_0xd223('0x24')],_0x5f2da9[_0xd223('0x26')]);_0x30ed89['attributes']=_['intersection'](_0x5f2da9[_0xd223('0x24')],qs[_0xd223('0x29')](_0x167579[_0xd223('0x26')][_0xd223('0x29')]));_0x30ed89[_0xd223('0x28')]=_0x30ed89[_0xd223('0x28')]['length']?_0x30ed89[_0xd223('0x28')]:_0x5f2da9[_0xd223('0x24')];if(_0x167579['query'][_0xd223('0x3d')]){_0x30ed89['include']=[{'all':!![]}];}_0x30ed89=_[_0xd223('0x36')]({},_0x30ed89,_0x167579[_0xd223('0x37')]);return db[_0xd223('0x22')][_0xd223('0x3e')](_0x30ed89)[_0xd223('0x1c')](handleEntityNotFound(_0x5074fb,null))[_0xd223('0x1c')](respondWithResult(_0x5074fb,null))[_0xd223('0x3f')](handleError(_0x5074fb,null));};exports[_0xd223('0x40')]=function(_0xc6217f,_0x58b166){return db[_0xd223('0x22')][_0xd223('0x40')](_0xc6217f['body'],{})[_0xd223('0x1c')](respondWithResult(_0x58b166,0xc9))[_0xd223('0x3f')](handleError(_0x58b166,null));};exports[_0xd223('0x1b')]=function(_0x4cd1a5,_0x4ded35){if(_0x4cd1a5[_0xd223('0x41')]['id']){delete _0x4cd1a5[_0xd223('0x41')]['id'];}return db[_0xd223('0x22')][_0xd223('0x3e')]({'where':{'id':_0x4cd1a5[_0xd223('0x3c')]['id']}})[_0xd223('0x1c')](handleEntityNotFound(_0x4ded35,null))[_0xd223('0x1c')](saveUpdates(_0x4cd1a5[_0xd223('0x41')],null))['then'](respondWithResult(_0x4ded35,null))[_0xd223('0x3f')](handleError(_0x4ded35,null));};exports['destroy']=function(_0x2b9c92,_0x391a87){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x2b9c92['params']['id']}})[_0xd223('0x1c')](handleEntityNotFound(_0x391a87,null))['then'](removeEntity(_0x391a87,null))['catch'](handleError(_0x391a87,null));};exports[_0xd223('0x42')]=function(_0x3c0c13,_0x576651){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0x576651,null))[_0xd223('0x3f')](handleError(_0x576651,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 430b6f5..69a57ed 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 _0x1cb3=['../../config/logger','api','moment','request-promise','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0xa991d4,_0x170745){var _0x2cec75=function(_0xe72355){while(--_0xe72355){_0xa991d4['push'](_0xa991d4['shift']());}};_0x2cec75(++_0x170745);}(_0x1cb3,0x7d));var _0x31cb=function(_0x3577df,_0x161af3){_0x3577df=_0x3577df-0x0;var _0x3f2558=_0x1cb3[_0x3577df];return _0x3f2558;};'use strict';var _=require('lodash');var util=require(_0x31cb('0x0'));var logger=require(_0x31cb('0x1'))(_0x31cb('0x2'));var moment=require(_0x31cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x31cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31cb('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x55f7ad,_0x3ba5d0){return _0x55f7ad[_0x31cb('0x6')](_0x31cb('0x7'),attributes,{'tableName':_0x31cb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c9=['../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util'];(function(_0x32d06f,_0x430045){var _0x4bda1c=function(_0x49cf4b){while(--_0x49cf4b){_0x32d06f['push'](_0x32d06f['shift']());}};_0x4bda1c(++_0x430045);}(_0xc1c9,0x1de));var _0x9c1c=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0xc1c9[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0x9c1c('0x0'));var util=require(_0x9c1c('0x1'));var logger=require(_0x9c1c('0x2'))(_0x9c1c('0x3'));var moment=require(_0x9c1c('0x4'));var BPromise=require(_0x9c1c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c1c('0x6'));var rimraf=require('rimraf');var config=require(_0x9c1c('0x7'));var attributes=require(_0x9c1c('0x8'));module[_0x9c1c('0x9')]=function(_0x1a85df,_0x48411d){return _0x1a85df[_0x9c1c('0xa')](_0x9c1c('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 3032ad5..1664895 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 _0xe549=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x13dd89,_0x34cb0e){var _0x2d61ee=function(_0x2b268f){while(--_0x2b268f){_0x13dd89['push'](_0x13dd89['shift']());}};_0x2d61ee(++_0x34cb0e);}(_0xe549,0x140));var _0x9e54=function(_0x5857f3,_0x1bd9bb){_0x5857f3=_0x5857f3-0x0;var _0x295c0a=_0xe549[_0x5857f3];return _0x295c0a;};'use strict';var _=require(_0x9e54('0x0'));var util=require(_0x9e54('0x1'));var moment=require(_0x9e54('0x2'));var BPromise=require(_0x9e54('0x3'));var rs=require(_0x9e54('0x4'));var fs=require('fs');var Redis=require(_0x9e54('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e54('0x6'));var logger=require(_0x9e54('0x7'))('rpc');var config=require(_0x9e54('0x8'));var jayson=require(_0x9e54('0x9'));var client=jayson[_0x9e54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d13e6,_0x22ac85,_0xf2aeb){return new BPromise(function(_0x46f8ed,_0x48df92){return client[_0x9e54('0xb')](_0x2d13e6,_0xf2aeb)[_0x9e54('0xc')](function(_0x2cd8aa){logger[_0x9e54('0xd')](_0x9e54('0xe'),_0x22ac85,_0x9e54('0xf'));logger[_0x9e54('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x22ac85,_0x9e54('0xf'),JSON[_0x9e54('0x11')](_0x2cd8aa));if(_0x2cd8aa[_0x9e54('0x12')]){if(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x13')]===0x1f4){logger[_0x9e54('0x12')](_0x9e54('0xe'),_0x22ac85,_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);return _0x48df92(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);}logger[_0x9e54('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x22ac85,_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);return _0x46f8ed(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);}else{logger[_0x9e54('0xd')](_0x9e54('0xe'),_0x22ac85,_0x9e54('0xf'));_0x46f8ed(_0x2cd8aa[_0x9e54('0x15')]['message']);}})[_0x9e54('0x16')](function(_0x34c365){logger['error'](_0x9e54('0xe'),_0x22ac85,_0x34c365);_0x48df92(_0x34c365);});});} \ No newline at end of file +var _0xd4a4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd4a4,0x195));var _0x4d4a=function(_0x27f7bf,_0x2d897e){_0x27f7bf=_0x27f7bf-0x0;var _0x30c6c4=_0xd4a4[_0x27f7bf];return _0x30c6c4;};'use strict';var _=require(_0x4d4a('0x0'));var util=require(_0x4d4a('0x1'));var moment=require(_0x4d4a('0x2'));var BPromise=require(_0x4d4a('0x3'));var rs=require(_0x4d4a('0x4'));var fs=require('fs');var Redis=require(_0x4d4a('0x5'));var db=require(_0x4d4a('0x6'))['db'];var utils=require(_0x4d4a('0x7'));var logger=require(_0x4d4a('0x8'))(_0x4d4a('0x9'));var config=require(_0x4d4a('0xa'));var jayson=require(_0x4d4a('0xb'));var client=jayson[_0x4d4a('0xc')][_0x4d4a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xa046bc,_0x1ece4d,_0x3906e7){return new BPromise(function(_0xdd510,_0x2fb223){return client[_0x4d4a('0xe')](_0xa046bc,_0x3906e7)['then'](function(_0x52a57e){logger[_0x4d4a('0xf')](_0x4d4a('0x10'),_0x1ece4d,_0x4d4a('0x11'));logger[_0x4d4a('0x12')](_0x4d4a('0x13'),_0x1ece4d,'request\x20sent',JSON[_0x4d4a('0x14')](_0x52a57e));if(_0x52a57e['error']){if(_0x52a57e[_0x4d4a('0x15')]['code']===0x1f4){logger[_0x4d4a('0x15')](_0x4d4a('0x10'),_0x1ece4d,_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);return _0x2fb223(_0x52a57e['error'][_0x4d4a('0x16')]);}logger[_0x4d4a('0x15')](_0x4d4a('0x10'),_0x1ece4d,_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);return _0xdd510(_0x52a57e[_0x4d4a('0x15')][_0x4d4a('0x16')]);}else{logger['info'](_0x4d4a('0x10'),_0x1ece4d,_0x4d4a('0x11'));_0xdd510(_0x52a57e['result'][_0x4d4a('0x16')]);}})[_0x4d4a('0x17')](function(_0x53d616){logger['error'](_0x4d4a('0x10'),_0x1ece4d,_0x53d616);_0x2fb223(_0x53d616);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 33759ca..ce13873 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 _0x9274=['connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','exports','util'];(function(_0x5ad219,_0x5f3e1d){var _0x5e1f82=function(_0x5074f1){while(--_0x5074f1){_0x5ad219['push'](_0x5ad219['shift']());}};_0x5e1f82(++_0x5f3e1d);}(_0x9274,0x1a3));var _0x4927=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9274[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x4927('0x0'));var path=require('path');var timeout=require(_0x4927('0x1'));var express=require(_0x4927('0x2'));var router=express['Router']();var auth=require(_0x4927('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4927('0x4'));var controller=require(_0x4927('0x5'));router['get']('/',auth[_0x4927('0x6')](),controller[_0x4927('0x7')]);router[_0x4927('0x8')](_0x4927('0x9'),auth['isAuthenticated'](),controller[_0x4927('0xa')]);router[_0x4927('0x8')](_0x4927('0xb'),auth[_0x4927('0x6')](),controller[_0x4927('0xc')]);router[_0x4927('0x8')](_0x4927('0xd'),auth[_0x4927('0x6')](),controller[_0x4927('0xe')]);router[_0x4927('0xf')]('/',auth[_0x4927('0x6')](),controller[_0x4927('0x10')]);router[_0x4927('0x11')](_0x4927('0xb'),auth[_0x4927('0x6')](),controller[_0x4927('0x12')]);router['delete'](_0x4927('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4927('0x13')]=router; \ No newline at end of file +var _0x9d0f=['getQuestions','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','show','/:id/questions'];(function(_0x2dcc94,_0x290ad1){var _0x3c9567=function(_0x5f15ea){while(--_0x5f15ea){_0x2dcc94['push'](_0x2dcc94['shift']());}};_0x3c9567(++_0x290ad1);}(_0x9d0f,0x134));var _0xf9d0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9d0f[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xf9d0('0x0'));var path=require(_0xf9d0('0x1'));var timeout=require(_0xf9d0('0x2'));var express=require(_0xf9d0('0x3'));var router=express[_0xf9d0('0x4')]();var auth=require(_0xf9d0('0x5'));var interaction=require(_0xf9d0('0x6'));var config=require(_0xf9d0('0x7'));var controller=require(_0xf9d0('0x8'));router[_0xf9d0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf9d0('0x9')]('/describe',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xb')]);router[_0xf9d0('0x9')]('/:id',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xc')]);router[_0xf9d0('0x9')](_0xf9d0('0xd'),auth[_0xf9d0('0xa')](),controller[_0xf9d0('0xe')]);router[_0xf9d0('0xf')]('/',auth[_0xf9d0('0xa')](),controller[_0xf9d0('0x10')]);router[_0xf9d0('0x11')](_0xf9d0('0x12'),auth['isAuthenticated'](),controller[_0xf9d0('0x13')]);router[_0xf9d0('0x14')](_0xf9d0('0x12'),auth['isAuthenticated'](),controller[_0xf9d0('0x15')]);module[_0xf9d0('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index bb49867..5efbd0c 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 _0xb54c=['DATE','setDataValue','starttime','endtime','format','STRING','BOOLEAN','moment','exports'];(function(_0x33d606,_0x33d61a){var _0x3d1c1a=function(_0x2b2f9b){while(--_0x2b2f9b){_0x33d606['push'](_0x33d606['shift']());}};_0x3d1c1a(++_0x33d61a);}(_0xb54c,0x127));var _0xcb54=function(_0x35f6c6,_0x5baf42){_0x35f6c6=_0x35f6c6-0x0;var _0x1bc368=_0xb54c[_0x35f6c6];return _0x1bc368;};'use strict';var moment=require(_0xcb54('0x0'));var Sequelize=require('sequelize');module[_0xcb54('0x1')]={'starttime':{'type':Sequelize[_0xcb54('0x2')],'set':function(_0x4f5a5a){this[_0xcb54('0x3')](_0xcb54('0x4'),_0x4f5a5a);this[_0xcb54('0x3')](_0xcb54('0x5'),moment()[_0xcb54('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xcb54('0x7')]},'projectname':{'type':Sequelize[_0xcb54('0x7')]},'queue':{'type':Sequelize[_0xcb54('0x7')]},'uniqueid':{'type':Sequelize[_0xcb54('0x7')]},'calleridname':{'type':Sequelize[_0xcb54('0x7')]},'calleridnum':{'type':Sequelize[_0xcb54('0x7')]},'completed':{'type':Sequelize[_0xcb54('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ae9=['BOOLEAN','moment','sequelize','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING'];(function(_0x5629ca,_0x18796a){var _0x2f5b84=function(_0x3473a4){while(--_0x3473a4){_0x5629ca['push'](_0x5629ca['shift']());}};_0x2f5b84(++_0x18796a);}(_0x8ae9,0x179));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x98ae('0x0'));var Sequelize=require(_0x98ae('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4a1157){this[_0x98ae('0x2')](_0x98ae('0x3'),_0x4a1157);this[_0x98ae('0x2')]('endtime',moment()['format'](_0x98ae('0x4')));}},'endtime':{'type':Sequelize[_0x98ae('0x5')]},'membername':{'type':Sequelize[_0x98ae('0x6')]},'projectname':{'type':Sequelize[_0x98ae('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x98ae('0x6')]},'calleridname':{'type':Sequelize[_0x98ae('0x6')]},'calleridnum':{'type':Sequelize[_0x98ae('0x6')]},'completed':{'type':Sequelize[_0x98ae('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 0036af0..0cb7f5f 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 _0x5e3c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','field','options','JscriptySessionReport','includeAll','include','findAll','show','params','find','create','catch','body','describe','findOne','JscriptyQuestionReport','pick','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x361ddd,_0x503739){var _0x3a92da=function(_0x439b0e){while(--_0x439b0e){_0x361ddd['push'](_0x361ddd['shift']());}};_0x3a92da(++_0x503739);}(_0x5e3c,0x92));var _0xc5e3=function(_0x36af3c,_0x2d2b8b){_0x36af3c=_0x36af3c-0x0;var _0x5c219a=_0x5e3c[_0x36af3c];return _0x5c219a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc5e3('0x0'));var rimraf=require(_0xc5e3('0x1'));var zipdir=require(_0xc5e3('0x2'));var jsonpatch=require(_0xc5e3('0x3'));var rp=require(_0xc5e3('0x4'));var moment=require(_0xc5e3('0x5'));var BPromise=require(_0xc5e3('0x6'));var Mustache=require(_0xc5e3('0x7'));var util=require(_0xc5e3('0x8'));var path=require(_0xc5e3('0x9'));var sox=require(_0xc5e3('0xa'));var csv=require(_0xc5e3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc5e3('0xc'));var squel=require(_0xc5e3('0xd'));var crypto=require(_0xc5e3('0xe'));var jsforce=require(_0xc5e3('0xf'));var deskjs=require(_0xc5e3('0x10'));var toCsv=require(_0xc5e3('0xb'));var querystring=require('querystring');var Papa=require(_0xc5e3('0x11'));var Redis=require(_0xc5e3('0x12'));var authService=require(_0xc5e3('0x13'));var qs=require(_0xc5e3('0x14'));var hardwareService=require(_0xc5e3('0x15'));var logger=require(_0xc5e3('0x16'))(_0xc5e3('0x17'));var utils=require('../../config/utils');var config=require(_0xc5e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aec91,_0x2b07ec){_0x2b07ec=_0x2b07ec||0xcc;return function(_0x29f2dc){if(_0x29f2dc){return _0x1aec91[_0xc5e3('0x19')](_0x2b07ec);}return _0x1aec91[_0xc5e3('0x1a')](_0x2b07ec)[_0xc5e3('0x1b')]();};}function respondWithResult(_0xf286dc,_0x144784){_0x144784=_0x144784||0xc8;return function(_0x5a611b){if(_0x5a611b){return _0xf286dc['status'](_0x144784)[_0xc5e3('0x1c')](_0x5a611b);}};}function respondWithFilteredResult(_0xf2d80e,_0x1becb2){return function(_0x323891){if(_0x323891){var _0x4adc93=_0x323891[_0xc5e3('0x1d')],_0x143471=_0x1becb2[_0xc5e3('0x1e')],_0x356f00=_0x1becb2['offset']+_0x1becb2['limit'],_0x54ffdb;if(_0x356f00>=_0x4adc93){_0x356f00=_0x4adc93;_0x54ffdb=0xc8;}else{_0x54ffdb=0xce;}_0xf2d80e[_0xc5e3('0x1a')](_0x54ffdb);return _0xf2d80e['set'](_0xc5e3('0x1f'),_0x143471+'-'+_0x356f00+'/'+_0x4adc93)[_0xc5e3('0x1c')](_0x323891);}return null;};}function patchUpdates(_0x3eb230){return function(_0x494c5a){try{jsonpatch[_0xc5e3('0x20')](_0x494c5a,_0x3eb230,!![]);}catch(_0x173722){return BPromise[_0xc5e3('0x21')](_0x173722);}return _0x494c5a[_0xc5e3('0x22')]();};}function saveUpdates(_0x25a830,_0x21496c){return function(_0x1f9065){if(_0x1f9065){return _0x1f9065[_0xc5e3('0x23')](_0x25a830)[_0xc5e3('0x24')](function(_0x333f6a){return _0x333f6a;});}return null;};}function removeEntity(_0x1a17e7,_0x368e42){return function(_0x2aeae9){if(_0x2aeae9){return _0x2aeae9[_0xc5e3('0x25')]()['then'](function(){_0x1a17e7[_0xc5e3('0x1a')](0xcc)[_0xc5e3('0x1b')]();});}};}function handleEntityNotFound(_0x50e041,_0x43a1ca){return function(_0x288bd3){if(!_0x288bd3){_0x50e041[_0xc5e3('0x19')](0x194);}return _0x288bd3;};}function handleError(_0x29a0e6,_0x28e836){_0x28e836=_0x28e836||0x1f4;return function(_0x48af16){logger[_0xc5e3('0x26')](_0x48af16[_0xc5e3('0x27')]);if(_0x48af16[_0xc5e3('0x28')]){delete _0x48af16['name'];}_0x29a0e6['status'](_0x28e836)[_0xc5e3('0x29')](_0x48af16);};}exports[_0xc5e3('0x2a')]=function(_0x2a5686,_0x4b2acf){var _0x1b2d69={},_0x236a08={},_0x832249={'count':0x0,'rows':[]};var _0x58e73d=db['JscriptySessionReport'][_0xc5e3('0x2b')];_0x236a08[_0xc5e3('0x2c')]=_[_0xc5e3('0x2d')](_0x58e73d);_0x236a08[_0xc5e3('0x2e')]=_['keys'](_0x2a5686['query']);_0x236a08[_0xc5e3('0x2f')]=_[_0xc5e3('0x30')](_0x236a08[_0xc5e3('0x2c')],_0x236a08[_0xc5e3('0x2e')]);_0x1b2d69[_0xc5e3('0x31')]=_['intersection'](_0x236a08[_0xc5e3('0x2c')],qs['fields'](_0x2a5686['query'][_0xc5e3('0x32')]));_0x1b2d69[_0xc5e3('0x31')]=_0x1b2d69[_0xc5e3('0x31')][_0xc5e3('0x33')]?_0x1b2d69[_0xc5e3('0x31')]:_0x236a08['model'];if(!_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x34')](_0xc5e3('0x35'))){_0x1b2d69[_0xc5e3('0x36')]=qs[_0xc5e3('0x36')](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x36')]);_0x1b2d69[_0xc5e3('0x1e')]=qs[_0xc5e3('0x1e')](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x1e')]);}_0x1b2d69[_0xc5e3('0x37')]=qs['sort'](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x38')]);_0x1b2d69[_0xc5e3('0x39')]=qs[_0xc5e3('0x2f')](_['pick'](_0x2a5686['query'],_0x236a08[_0xc5e3('0x2f')]));if(_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x3a')]){_0x1b2d69[_0xc5e3('0x39')]=_[_0xc5e3('0x3b')](_0x1b2d69[_0xc5e3('0x39')],{'$or':_[_0xc5e3('0x3c')](_0x58e73d,function(_0x52bd8b){if(_0x52bd8b[_0xc5e3('0x3d')]['key']!=='VIRTUAL'){var _0x50bfba={};_0x50bfba[_0x52bd8b[_0xc5e3('0x3e')]]={'$like':'%'+_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x3a')]+'%'};return _0x50bfba;}})});}_0x1b2d69=_[_0xc5e3('0x3b')]({},_0x1b2d69,_0x2a5686[_0xc5e3('0x3f')]);var _0x53bade={'where':_0x1b2d69[_0xc5e3('0x39')]};return db[_0xc5e3('0x40')][_0xc5e3('0x1d')](_0x53bade)[_0xc5e3('0x24')](function(_0x1b6bf0){_0x832249['count']=_0x1b6bf0;if(_0x2a5686['query'][_0xc5e3('0x41')]){_0x1b2d69[_0xc5e3('0x42')]=[{'all':!![]}];}return db[_0xc5e3('0x40')][_0xc5e3('0x43')](_0x1b2d69);})[_0xc5e3('0x24')](function(_0x59fba3){_0x832249['rows']=_0x59fba3;return _0x832249;})['then'](respondWithFilteredResult(_0x4b2acf,_0x1b2d69))['catch'](handleError(_0x4b2acf,null));};exports[_0xc5e3('0x44')]=function(_0x3019d9,_0x188f0a){var _0x12ac95={'raw':!![],'where':{'id':_0x3019d9[_0xc5e3('0x45')]['id']}},_0x5eb672={};_0x5eb672['model']=_[_0xc5e3('0x2d')](db[_0xc5e3('0x40')][_0xc5e3('0x2b')]);_0x5eb672['query']=_[_0xc5e3('0x2d')](_0x3019d9[_0xc5e3('0x2e')]);_0x5eb672['filters']=_['intersection'](_0x5eb672[_0xc5e3('0x2c')],_0x5eb672[_0xc5e3('0x2e')]);_0x12ac95[_0xc5e3('0x31')]=_[_0xc5e3('0x30')](_0x5eb672['model'],qs['fields'](_0x3019d9[_0xc5e3('0x2e')][_0xc5e3('0x32')]));_0x12ac95[_0xc5e3('0x31')]=_0x12ac95[_0xc5e3('0x31')]['length']?_0x12ac95[_0xc5e3('0x31')]:_0x5eb672['model'];if(_0x3019d9[_0xc5e3('0x2e')][_0xc5e3('0x41')]){_0x12ac95[_0xc5e3('0x42')]=[{'all':!![]}];}_0x12ac95=_[_0xc5e3('0x3b')]({},_0x12ac95,_0x3019d9[_0xc5e3('0x3f')]);return db[_0xc5e3('0x40')][_0xc5e3('0x46')](_0x12ac95)[_0xc5e3('0x24')](handleEntityNotFound(_0x188f0a,null))[_0xc5e3('0x24')](respondWithResult(_0x188f0a,null))['catch'](handleError(_0x188f0a,null));};exports['create']=function(_0x2fe69d,_0x4551b0){return db[_0xc5e3('0x40')][_0xc5e3('0x47')](_0x2fe69d['body'],{})[_0xc5e3('0x24')](respondWithResult(_0x4551b0,0xc9))[_0xc5e3('0x48')](handleError(_0x4551b0,null));};exports[_0xc5e3('0x23')]=function(_0x5f1610,_0x2a40ea){if(_0x5f1610[_0xc5e3('0x49')]['id']){delete _0x5f1610[_0xc5e3('0x49')]['id'];}return db[_0xc5e3('0x40')][_0xc5e3('0x46')]({'where':{'id':_0x5f1610[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x2a40ea,null))[_0xc5e3('0x24')](saveUpdates(_0x5f1610[_0xc5e3('0x49')],null))[_0xc5e3('0x24')](respondWithResult(_0x2a40ea,null))[_0xc5e3('0x48')](handleError(_0x2a40ea,null));};exports[_0xc5e3('0x25')]=function(_0x3ed67c,_0x3d57a4){return db[_0xc5e3('0x40')]['find']({'where':{'id':_0x3ed67c[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x3d57a4,null))[_0xc5e3('0x24')](removeEntity(_0x3d57a4,null))[_0xc5e3('0x48')](handleError(_0x3d57a4,null));};exports[_0xc5e3('0x4a')]=function(_0x190038,_0x217a67){return db[_0xc5e3('0x40')][_0xc5e3('0x4a')]()[_0xc5e3('0x24')](respondWithResult(_0x217a67,null))[_0xc5e3('0x48')](handleError(_0x217a67,null));};exports['getQuestions']=function(_0x4e5cbd,_0x417811,_0x1708a1){var _0x56ab04={'raw':!![],'where':{}};var _0x567ea2={};var _0x110129={'count':0x0,'rows':[]};return db[_0xc5e3('0x40')][_0xc5e3('0x4b')]({'where':{'id':_0x4e5cbd[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x417811,null))[_0xc5e3('0x24')](function(_0x3e86ac){if(_0x3e86ac){_0x567ea2[_0xc5e3('0x2c')]=_[_0xc5e3('0x2d')](db[_0xc5e3('0x4c')][_0xc5e3('0x2b')]);_0x567ea2[_0xc5e3('0x2e')]=_[_0xc5e3('0x2d')](_0x4e5cbd[_0xc5e3('0x2e')]);_0x567ea2[_0xc5e3('0x2f')]=_['intersection'](_0x567ea2['model'],_0x567ea2[_0xc5e3('0x2e')]);_0x56ab04[_0xc5e3('0x31')]=_[_0xc5e3('0x30')](_0x567ea2[_0xc5e3('0x2c')],qs[_0xc5e3('0x32')](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x32')]));_0x56ab04[_0xc5e3('0x31')]=_0x56ab04[_0xc5e3('0x31')][_0xc5e3('0x33')]?_0x56ab04['attributes']:_0x567ea2[_0xc5e3('0x2c')];if(!_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x34')]('nolimit')){_0x56ab04[_0xc5e3('0x36')]=qs[_0xc5e3('0x36')](_0x4e5cbd['query'][_0xc5e3('0x36')]);_0x56ab04['offset']=qs['offset'](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x1e')]);}_0x56ab04[_0xc5e3('0x37')]=qs[_0xc5e3('0x38')](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x38')]);_0x56ab04[_0xc5e3('0x39')]=qs['filters'](_[_0xc5e3('0x4d')](_0x4e5cbd['query'],_0x567ea2[_0xc5e3('0x2f')]));_0x56ab04['where']['SessionId']=_0x3e86ac['id'];if(_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x3a')]){_0x56ab04[_0xc5e3('0x39')]=_[_0xc5e3('0x3b')](_0x56ab04[_0xc5e3('0x39')],{'$or':_['map'](_0x56ab04[_0xc5e3('0x31')],function(_0x3bdca9){var _0x417981={};_0x417981[_0x3bdca9]={'$like':'%'+_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x3a')]+'%'};return _0x417981;})});}_0x56ab04=_[_0xc5e3('0x3b')]({},_0x56ab04,_0x4e5cbd[_0xc5e3('0x3f')]);return db[_0xc5e3('0x4c')]['count']({'where':_0x56ab04[_0xc5e3('0x39')]})[_0xc5e3('0x24')](function(_0x88eb2e){_0x110129[_0xc5e3('0x1d')]=_0x88eb2e;if(_0x4e5cbd['query']['includeAll']){_0x56ab04[_0xc5e3('0x42')]=[{'all':!![]}];}return db[_0xc5e3('0x4c')][_0xc5e3('0x43')](_0x56ab04);})['then'](function(_0x231ba5){_0x110129[_0xc5e3('0x4e')]=_0x231ba5;return _0x110129;});}})[_0xc5e3('0x24')](respondWithFilteredResult(_0x417811,_0x56ab04))['catch'](handleError(_0x417811,null));}; \ No newline at end of file +var _0x11f7=['query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','key','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','SessionId','map','html-pdf','bluebird','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','model','keys'];(function(_0x73f596,_0x33ac7c){var _0x4117b3=function(_0x287a34){while(--_0x287a34){_0x73f596['push'](_0x73f596['shift']());}};_0x4117b3(++_0x33ac7c);}(_0x11f7,0xaf));var _0x711f=function(_0x2416cf,_0x58403f){_0x2416cf=_0x2416cf-0x0;var _0x42bc02=_0x11f7[_0x2416cf];return _0x42bc02;};'use strict';var pdf=require(_0x711f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x711f('0x1'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x711f('0x2'));var ejs=require(_0x711f('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x711f('0x4'));var crypto=require(_0x711f('0x5'));var jsforce=require(_0x711f('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x711f('0x2'));var querystring=require(_0x711f('0x7'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x711f('0x8'));var qs=require(_0x711f('0x9'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x711f('0xa'))(_0x711f('0xb'));var utils=require(_0x711f('0xc'));var config=require(_0x711f('0xd'));var db=require(_0x711f('0xe'))['db'];function respondWithStatusCode(_0x40a6d9,_0x57d93a){_0x57d93a=_0x57d93a||0xcc;return function(_0x2ee66f){if(_0x2ee66f){return _0x40a6d9[_0x711f('0xf')](_0x57d93a);}return _0x40a6d9[_0x711f('0x10')](_0x57d93a)[_0x711f('0x11')]();};}function respondWithResult(_0x2213e5,_0x3d0832){_0x3d0832=_0x3d0832||0xc8;return function(_0x731709){if(_0x731709){return _0x2213e5['status'](_0x3d0832)[_0x711f('0x12')](_0x731709);}};}function respondWithFilteredResult(_0x371c2f,_0x3df69f){return function(_0x34d7db){if(_0x34d7db){var _0x557e7c=_0x34d7db[_0x711f('0x13')],_0x7f3233=_0x3df69f[_0x711f('0x14')],_0x287264=_0x3df69f['offset']+_0x3df69f['limit'],_0x5dd22c;if(_0x287264>=_0x557e7c){_0x287264=_0x557e7c;_0x5dd22c=0xc8;}else{_0x5dd22c=0xce;}_0x371c2f[_0x711f('0x10')](_0x5dd22c);return _0x371c2f[_0x711f('0x15')](_0x711f('0x16'),_0x7f3233+'-'+_0x287264+'/'+_0x557e7c)['json'](_0x34d7db);}return null;};}function patchUpdates(_0x38095b){return function(_0x14f021){try{jsonpatch[_0x711f('0x17')](_0x14f021,_0x38095b,!![]);}catch(_0x575b2b){return BPromise[_0x711f('0x18')](_0x575b2b);}return _0x14f021[_0x711f('0x19')]();};}function saveUpdates(_0x5b73a6,_0x1cc8e5){return function(_0x3c2c79){if(_0x3c2c79){return _0x3c2c79[_0x711f('0x1a')](_0x5b73a6)['then'](function(_0x38391a){return _0x38391a;});}return null;};}function removeEntity(_0x478f67,_0xa88232){return function(_0xa4a501){if(_0xa4a501){return _0xa4a501[_0x711f('0x1b')]()[_0x711f('0x1c')](function(){_0x478f67[_0x711f('0x10')](0xcc)[_0x711f('0x11')]();});}};}function handleEntityNotFound(_0x53c861,_0x5e794d){return function(_0x45658f){if(!_0x45658f){_0x53c861[_0x711f('0xf')](0x194);}return _0x45658f;};}function handleError(_0x57b7c4,_0x45f69a){_0x45f69a=_0x45f69a||0x1f4;return function(_0x232e40){logger[_0x711f('0x1d')](_0x232e40[_0x711f('0x1e')]);if(_0x232e40[_0x711f('0x1f')]){delete _0x232e40[_0x711f('0x1f')];}_0x57b7c4[_0x711f('0x10')](_0x45f69a)[_0x711f('0x20')](_0x232e40);};}exports[_0x711f('0x21')]=function(_0x27ebd1,_0x5b8c20){var _0x1b77b6={},_0x2fc9e3={},_0x3d33df={'count':0x0,'rows':[]};var _0x154ccb=db[_0x711f('0x22')][_0x711f('0x23')];_0x2fc9e3[_0x711f('0x24')]=_[_0x711f('0x25')](_0x154ccb);_0x2fc9e3[_0x711f('0x26')]=_[_0x711f('0x25')](_0x27ebd1[_0x711f('0x26')]);_0x2fc9e3['filters']=_[_0x711f('0x27')](_0x2fc9e3[_0x711f('0x24')],_0x2fc9e3[_0x711f('0x26')]);_0x1b77b6[_0x711f('0x28')]=_[_0x711f('0x27')](_0x2fc9e3['model'],qs[_0x711f('0x29')](_0x27ebd1[_0x711f('0x26')]['fields']));_0x1b77b6['attributes']=_0x1b77b6['attributes'][_0x711f('0x2a')]?_0x1b77b6[_0x711f('0x28')]:_0x2fc9e3[_0x711f('0x24')];if(!_0x27ebd1[_0x711f('0x26')][_0x711f('0x2b')]('nolimit')){_0x1b77b6[_0x711f('0x2c')]=qs[_0x711f('0x2c')](_0x27ebd1[_0x711f('0x26')]['limit']);_0x1b77b6[_0x711f('0x14')]=qs['offset'](_0x27ebd1['query'][_0x711f('0x14')]);}_0x1b77b6[_0x711f('0x2d')]=qs[_0x711f('0x2e')](_0x27ebd1[_0x711f('0x26')][_0x711f('0x2e')]);_0x1b77b6[_0x711f('0x2f')]=qs[_0x711f('0x30')](_['pick'](_0x27ebd1[_0x711f('0x26')],_0x2fc9e3[_0x711f('0x30')]));if(_0x27ebd1['query'][_0x711f('0x31')]){_0x1b77b6['where']=_[_0x711f('0x32')](_0x1b77b6[_0x711f('0x2f')],{'$or':_['map'](_0x154ccb,function(_0x467089){if(_0x467089['type'][_0x711f('0x33')]!=='VIRTUAL'){var _0x2bee77={};_0x2bee77[_0x467089['field']]={'$like':'%'+_0x27ebd1[_0x711f('0x26')]['filter']+'%'};return _0x2bee77;}})});}_0x1b77b6=_[_0x711f('0x32')]({},_0x1b77b6,_0x27ebd1[_0x711f('0x34')]);var _0x327bd8={'where':_0x1b77b6[_0x711f('0x2f')]};return db[_0x711f('0x22')][_0x711f('0x13')](_0x327bd8)[_0x711f('0x1c')](function(_0x3bc56a){_0x3d33df['count']=_0x3bc56a;if(_0x27ebd1['query'][_0x711f('0x35')]){_0x1b77b6[_0x711f('0x36')]=[{'all':!![]}];}return db[_0x711f('0x22')][_0x711f('0x37')](_0x1b77b6);})[_0x711f('0x1c')](function(_0x3a7e1e){_0x3d33df[_0x711f('0x38')]=_0x3a7e1e;return _0x3d33df;})[_0x711f('0x1c')](respondWithFilteredResult(_0x5b8c20,_0x1b77b6))['catch'](handleError(_0x5b8c20,null));};exports[_0x711f('0x39')]=function(_0x5763ee,_0x3c9d8a){var _0x39331a={'raw':!![],'where':{'id':_0x5763ee['params']['id']}},_0x4ab528={};_0x4ab528['model']=_['keys'](db[_0x711f('0x22')][_0x711f('0x23')]);_0x4ab528['query']=_[_0x711f('0x25')](_0x5763ee[_0x711f('0x26')]);_0x4ab528[_0x711f('0x30')]=_['intersection'](_0x4ab528[_0x711f('0x24')],_0x4ab528[_0x711f('0x26')]);_0x39331a[_0x711f('0x28')]=_[_0x711f('0x27')](_0x4ab528[_0x711f('0x24')],qs[_0x711f('0x29')](_0x5763ee['query']['fields']));_0x39331a[_0x711f('0x28')]=_0x39331a[_0x711f('0x28')][_0x711f('0x2a')]?_0x39331a[_0x711f('0x28')]:_0x4ab528[_0x711f('0x24')];if(_0x5763ee['query'][_0x711f('0x35')]){_0x39331a[_0x711f('0x36')]=[{'all':!![]}];}_0x39331a=_[_0x711f('0x32')]({},_0x39331a,_0x5763ee[_0x711f('0x34')]);return db[_0x711f('0x22')][_0x711f('0x3a')](_0x39331a)['then'](handleEntityNotFound(_0x3c9d8a,null))['then'](respondWithResult(_0x3c9d8a,null))[_0x711f('0x3b')](handleError(_0x3c9d8a,null));};exports[_0x711f('0x3c')]=function(_0x492179,_0x34f9b4){return db[_0x711f('0x22')][_0x711f('0x3c')](_0x492179[_0x711f('0x3d')],{})['then'](respondWithResult(_0x34f9b4,0xc9))[_0x711f('0x3b')](handleError(_0x34f9b4,null));};exports[_0x711f('0x1a')]=function(_0x46e17a,_0x3af6d2){if(_0x46e17a[_0x711f('0x3d')]['id']){delete _0x46e17a[_0x711f('0x3d')]['id'];}return db[_0x711f('0x22')]['find']({'where':{'id':_0x46e17a[_0x711f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3af6d2,null))[_0x711f('0x1c')](saveUpdates(_0x46e17a['body'],null))[_0x711f('0x1c')](respondWithResult(_0x3af6d2,null))[_0x711f('0x3b')](handleError(_0x3af6d2,null));};exports[_0x711f('0x1b')]=function(_0x46e53d,_0x4b157b){return db['JscriptySessionReport'][_0x711f('0x3a')]({'where':{'id':_0x46e53d[_0x711f('0x3e')]['id']}})[_0x711f('0x1c')](handleEntityNotFound(_0x4b157b,null))[_0x711f('0x1c')](removeEntity(_0x4b157b,null))[_0x711f('0x3b')](handleError(_0x4b157b,null));};exports[_0x711f('0x3f')]=function(_0x1e9b53,_0x18cc32){return db[_0x711f('0x22')][_0x711f('0x3f')]()[_0x711f('0x1c')](respondWithResult(_0x18cc32,null))[_0x711f('0x3b')](handleError(_0x18cc32,null));};exports[_0x711f('0x40')]=function(_0x2f2098,_0x413025,_0x48c304){var _0x74b761={'raw':!![],'where':{}};var _0x16a65c={};var _0x3ff667={'count':0x0,'rows':[]};return db[_0x711f('0x22')][_0x711f('0x41')]({'where':{'id':_0x2f2098[_0x711f('0x3e')]['id']}})[_0x711f('0x1c')](handleEntityNotFound(_0x413025,null))[_0x711f('0x1c')](function(_0x23f8cb){if(_0x23f8cb){_0x16a65c['model']=_[_0x711f('0x25')](db[_0x711f('0x42')][_0x711f('0x23')]);_0x16a65c['query']=_[_0x711f('0x25')](_0x2f2098['query']);_0x16a65c[_0x711f('0x30')]=_['intersection'](_0x16a65c[_0x711f('0x24')],_0x16a65c[_0x711f('0x26')]);_0x74b761[_0x711f('0x28')]=_['intersection'](_0x16a65c[_0x711f('0x24')],qs['fields'](_0x2f2098['query']['fields']));_0x74b761['attributes']=_0x74b761[_0x711f('0x28')][_0x711f('0x2a')]?_0x74b761[_0x711f('0x28')]:_0x16a65c[_0x711f('0x24')];if(!_0x2f2098[_0x711f('0x26')][_0x711f('0x2b')](_0x711f('0x43'))){_0x74b761[_0x711f('0x2c')]=qs[_0x711f('0x2c')](_0x2f2098[_0x711f('0x26')][_0x711f('0x2c')]);_0x74b761[_0x711f('0x14')]=qs[_0x711f('0x14')](_0x2f2098[_0x711f('0x26')][_0x711f('0x14')]);}_0x74b761[_0x711f('0x2d')]=qs[_0x711f('0x2e')](_0x2f2098['query'][_0x711f('0x2e')]);_0x74b761['where']=qs[_0x711f('0x30')](_[_0x711f('0x44')](_0x2f2098[_0x711f('0x26')],_0x16a65c[_0x711f('0x30')]));_0x74b761['where'][_0x711f('0x45')]=_0x23f8cb['id'];if(_0x2f2098['query']['filter']){_0x74b761['where']=_[_0x711f('0x32')](_0x74b761[_0x711f('0x2f')],{'$or':_[_0x711f('0x46')](_0x74b761[_0x711f('0x28')],function(_0x2b4101){var _0x48241e={};_0x48241e[_0x2b4101]={'$like':'%'+_0x2f2098['query']['filter']+'%'};return _0x48241e;})});}_0x74b761=_[_0x711f('0x32')]({},_0x74b761,_0x2f2098['options']);return db[_0x711f('0x42')][_0x711f('0x13')]({'where':_0x74b761[_0x711f('0x2f')]})[_0x711f('0x1c')](function(_0x39ffc3){_0x3ff667[_0x711f('0x13')]=_0x39ffc3;if(_0x2f2098['query'][_0x711f('0x35')]){_0x74b761[_0x711f('0x36')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x711f('0x37')](_0x74b761);})[_0x711f('0x1c')](function(_0x33b10e){_0x3ff667[_0x711f('0x38')]=_0x33b10e;return _0x3ff667;});}})[_0x711f('0x1c')](respondWithFilteredResult(_0x413025,_0x74b761))[_0x711f('0x3b')](handleError(_0x413025,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 209b613..6c92b71 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 _0x7483=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x2f3f19,_0x3f47cc){var _0x4574be=function(_0x1b0aab){while(--_0x1b0aab){_0x2f3f19['push'](_0x2f3f19['shift']());}};_0x4574be(++_0x3f47cc);}(_0x7483,0x1c8));var _0x3748=function(_0x1ec8ec,_0x400f85){_0x1ec8ec=_0x1ec8ec-0x0;var _0x4ea607=_0x7483[_0x1ec8ec];return _0x4ea607;};'use strict';var _=require(_0x3748('0x0'));var util=require('util');var logger=require(_0x3748('0x1'))(_0x3748('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3748('0x3'));var fs=require('fs');var path=require(_0x3748('0x4'));var rimraf=require(_0x3748('0x5'));var config=require(_0x3748('0x6'));var attributes=require(_0x3748('0x7'));module[_0x3748('0x8')]=function(_0x28c391,_0xde1237){return _0x28c391[_0x3748('0x9')](_0x3748('0xa'),attributes,{'tableName':_0x3748('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf691=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3550b4,_0x59b309){var _0x237bca=function(_0x9624f9){while(--_0x9624f9){_0x3550b4['push'](_0x3550b4['shift']());}};_0x237bca(++_0x59b309);}(_0xf691,0xa0));var _0x1f69=function(_0x38c401,_0x3b088e){_0x38c401=_0x38c401-0x0;var _0x12ed59=_0xf691[_0x38c401];return _0x12ed59;};'use strict';var _=require(_0x1f69('0x0'));var util=require('util');var logger=require(_0x1f69('0x1'))(_0x1f69('0x2'));var moment=require(_0x1f69('0x3'));var BPromise=require(_0x1f69('0x4'));var rp=require(_0x1f69('0x5'));var fs=require('fs');var path=require(_0x1f69('0x6'));var rimraf=require(_0x1f69('0x7'));var config=require(_0x1f69('0x8'));var attributes=require(_0x1f69('0x9'));module[_0x1f69('0xa')]=function(_0x48ee76,_0x5a9e89){return _0x48ee76[_0x1f69('0xb')](_0x1f69('0xc'),attributes,{'tableName':_0x1f69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index cd4d7f5..23a81cc 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 _0x0755=['request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x9682c5,_0x5ed0ec){var _0x177062=function(_0x32724d){while(--_0x32724d){_0x9682c5['push'](_0x9682c5['shift']());}};_0x177062(++_0x5ed0ec);}(_0x0755,0x7c));var _0x5075=function(_0x4080d8,_0x298f9b){_0x4080d8=_0x4080d8-0x0;var _0x3d3bab=_0x0755[_0x4080d8];return _0x3d3bab;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var moment=require(_0x5075('0x2'));var BPromise=require(_0x5075('0x3'));var rs=require(_0x5075('0x4'));var fs=require('fs');var Redis=require(_0x5075('0x5'));var db=require(_0x5075('0x6'))['db'];var utils=require(_0x5075('0x7'));var logger=require(_0x5075('0x8'))(_0x5075('0x9'));var config=require('../../config/environment');var jayson=require(_0x5075('0xa'));var client=jayson[_0x5075('0xb')][_0x5075('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e39f4,_0x57f9e8,_0x52bb37){return new BPromise(function(_0x4f882e,_0x41d88f){return client[_0x5075('0xd')](_0x2e39f4,_0x52bb37)['then'](function(_0x1782e9){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'),JSON[_0x5075('0xf')](_0x1782e9));if(_0x1782e9[_0x5075('0x10')]){if(_0x1782e9['error'][_0x5075('0x11')]===0x1f4){logger['error'](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x41d88f(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}logger[_0x5075('0x10')](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x4f882e(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}else{logger[_0x5075('0x14')](_0x5075('0x12'),_0x57f9e8,'request\x20sent');_0x4f882e(_0x1782e9[_0x5075('0x15')][_0x5075('0x13')]);}})[_0x5075('0x16')](function(_0x381b3b){logger[_0x5075('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x57f9e8,_0x381b3b);_0x41d88f(_0x381b3b);});});} \ No newline at end of file +var _0x1574=['rpc','../../config/environment','jayson/promise','client','http','request','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0x1574,0x148));var _0x4157=function(_0x253779,_0x4a85b7){_0x253779=_0x253779-0x0;var _0x16c340=_0x1574[_0x253779];return _0x16c340;};'use strict';var _=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var moment=require(_0x4157('0x2'));var BPromise=require(_0x4157('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4157('0x4'));var db=require(_0x4157('0x5'))['db'];var utils=require(_0x4157('0x6'));var logger=require(_0x4157('0x7'))(_0x4157('0x8'));var config=require(_0x4157('0x9'));var jayson=require(_0x4157('0xa'));var client=jayson[_0x4157('0xb')][_0x4157('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ece73,_0x1b33e1,_0x213c67){return new BPromise(function(_0x17a9ec,_0xadb310){return client[_0x4157('0xd')](_0x1ece73,_0x213c67)['then'](function(_0x449b71){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x1b33e1,'request\x20sent');logger[_0x4157('0xe')](_0x4157('0xf'),_0x1b33e1,_0x4157('0x10'),JSON['stringify'](_0x449b71));if(_0x449b71[_0x4157('0x11')]){if(_0x449b71[_0x4157('0x11')][_0x4157('0x12')]===0x1f4){logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x449b71[_0x4157('0x11')][_0x4157('0x14')]);return _0xadb310(_0x449b71[_0x4157('0x11')][_0x4157('0x14')]);}logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x449b71[_0x4157('0x11')]['message']);return _0x17a9ec(_0x449b71[_0x4157('0x11')]['message']);}else{logger[_0x4157('0x15')](_0x4157('0x13'),_0x1b33e1,_0x4157('0x10'));_0x17a9ec(_0x449b71[_0x4157('0x16')][_0x4157('0x14')]);}})[_0x4157('0x17')](function(_0x30dc0a){logger[_0x4157('0x11')](_0x4157('0x13'),_0x1b33e1,_0x30dc0a);_0xadb310(_0x30dc0a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index dc3e8a4..9fa3c7a 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 _0xf72d=['./license.controller','get','index','/:id','isAuthenticated','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x11525c,_0x169add){var _0x89cb90=function(_0x5affc9){while(--_0x5affc9){_0x11525c['push'](_0x11525c['shift']());}};_0x89cb90(++_0x169add);}(_0xf72d,0x101));var _0xdf72=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xf72d[_0x11a220];return _0x20d8fe;};'use strict';var multer=require('multer');var util=require(_0xdf72('0x0'));var path=require(_0xdf72('0x1'));var timeout=require(_0xdf72('0x2'));var express=require(_0xdf72('0x3'));var router=express[_0xdf72('0x4')]();var auth=require(_0xdf72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf72('0x6'));var controller=require(_0xdf72('0x7'));router[_0xdf72('0x8')]('/',controller[_0xdf72('0x9')]);router['put'](_0xdf72('0xa'),auth[_0xdf72('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0xa692=['update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated'];(function(_0x554018,_0x455829){var _0x29645b=function(_0x159b93){while(--_0x159b93){_0x554018['push'](_0x554018['shift']());}};_0x29645b(++_0x455829);}(_0xa692,0x16e));var _0x2a69=function(_0x277d61,_0xab8c96){_0x277d61=_0x277d61-0x0;var _0x34f6e1=_0xa692[_0x277d61];return _0x34f6e1;};'use strict';var multer=require(_0x2a69('0x0'));var util=require('util');var path=require(_0x2a69('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a69('0x2'));var router=express[_0x2a69('0x3')]();var auth=require(_0x2a69('0x4'));var interaction=require(_0x2a69('0x5'));var config=require('../../config/environment');var controller=require(_0x2a69('0x6'));router[_0x2a69('0x7')]('/',controller[_0x2a69('0x8')]);router[_0x2a69('0x9')](_0x2a69('0xa'),auth[_0x2a69('0xb')](),controller[_0x2a69('0xc')]);module[_0x2a69('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 123c5fd..45e2e45 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 _0xf093=['INTEGER','exports','TEXT','STRING'];(function(_0x5da73f,_0x592980){var _0x1b3d73=function(_0x4e62ba){while(--_0x4e62ba){_0x5da73f['push'](_0x5da73f['shift']());}};_0x1b3d73(++_0x592980);}(_0xf093,0xd5));var _0x3f09=function(_0x334f5f,_0x5f5496){_0x334f5f=_0x334f5f-0x0;var _0x123ca0=_0xf093[_0x334f5f];return _0x123ca0;};'use strict';var Sequelize=require('sequelize');module[_0x3f09('0x0')]={'license':{'type':Sequelize[_0x3f09('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x3f09('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3f09('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc542=['TEXT','STRING','sequelize','exports'];(function(_0x1bd873,_0x5216b1){var _0x477c67=function(_0x3a50c2){while(--_0x3a50c2){_0x1bd873['push'](_0x1bd873['shift']());}};_0x477c67(++_0x5216b1);}(_0xc542,0xc6));var _0x2c54=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xc542[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x2c54('0x0'));module[_0x2c54('0x1')]={'license':{'type':Sequelize[_0x2c54('0x2')]},'data1':{'type':Sequelize[_0x2c54('0x3')]},'data2':{'type':Sequelize[_0x2c54('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 06bcf9a..acd871b 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 _0xc9d5=['get','checkLicense','key','demo','catch','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','path','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','index','model','rawAttributes','query','filters','attributes','intersection','fields','length','merge','update','body','License'];(function(_0x5dd357,_0x3e06ad){var _0xef3936=function(_0x141316){while(--_0x141316){_0x5dd357['push'](_0x5dd357['shift']());}};_0xef3936(++_0x3e06ad);}(_0xc9d5,0x163));var _0x5c9d=function(_0x14fdbd,_0x58e34a){_0x14fdbd=_0x14fdbd-0x0;var _0x3c5953=_0xc9d5[_0x14fdbd];return _0x3c5953;};'use strict';var pdf=require(_0x5c9d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5c9d('0x1'));var zipdir=require(_0x5c9d('0x2'));var jsonpatch=require(_0x5c9d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c9d('0x4'));var util=require('util');var path=require(_0x5c9d('0x5'));var sox=require(_0x5c9d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5c9d('0x7'));var crypto=require(_0x5c9d('0x8'));var jsforce=require(_0x5c9d('0x9'));var deskjs=require(_0x5c9d('0xa'));var toCsv=require(_0x5c9d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c9d('0xc'));var authService=require(_0x5c9d('0xd'));var qs=require(_0x5c9d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c9d('0xf'))(_0x5c9d('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5c9d('0x11'))['db'];function respondWithStatusCode(_0x3993c6,_0xb9fea){_0xb9fea=_0xb9fea||0xcc;return function(_0x34b448){if(_0x34b448){return _0x3993c6[_0x5c9d('0x12')](_0xb9fea);}return _0x3993c6['status'](_0xb9fea)[_0x5c9d('0x13')]();};}function respondWithResult(_0x40f6d4,_0xc52734){_0xc52734=_0xc52734||0xc8;return function(_0x25941b){if(_0x25941b){return _0x40f6d4[_0x5c9d('0x14')](_0xc52734)[_0x5c9d('0x15')](_0x25941b);}};}function respondWithFilteredResult(_0x498a06,_0x53621b){return function(_0x167c50){if(_0x167c50){var _0x50a6b8=_0x167c50['count'],_0x5631c2=_0x53621b[_0x5c9d('0x16')],_0x462503=_0x53621b[_0x5c9d('0x16')]+_0x53621b['limit'],_0x50f045;if(_0x462503>=_0x50a6b8){_0x462503=_0x50a6b8;_0x50f045=0xc8;}else{_0x50f045=0xce;}_0x498a06[_0x5c9d('0x14')](_0x50f045);return _0x498a06[_0x5c9d('0x17')](_0x5c9d('0x18'),_0x5631c2+'-'+_0x462503+'/'+_0x50a6b8)[_0x5c9d('0x15')](_0x167c50);}return null;};}function patchUpdates(_0x50f2d6){return function(_0x4c0df9){try{jsonpatch[_0x5c9d('0x19')](_0x4c0df9,_0x50f2d6,!![]);}catch(_0x37bbba){return BPromise['reject'](_0x37bbba);}return _0x4c0df9[_0x5c9d('0x1a')]();};}function saveUpdates(_0x5dc79d,_0x1c6718){return function(_0x98bce6){if(_0x98bce6){return _0x98bce6['update'](_0x5dc79d)['then'](function(_0x525b6c){return _0x525b6c;});}return null;};}function removeEntity(_0x2ae71c,_0x1600c2){return function(_0x182cf6){if(_0x182cf6){return _0x182cf6[_0x5c9d('0x1b')]()[_0x5c9d('0x1c')](function(){_0x2ae71c[_0x5c9d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36df61,_0x18a999){return function(_0x5e53b9){if(!_0x5e53b9){_0x36df61['sendStatus'](0x194);}return _0x5e53b9;};}function handleError(_0x2af260,_0x2dd04d){_0x2dd04d=_0x2dd04d||0x1f4;return function(_0x3bbe46){logger[_0x5c9d('0x1d')](_0x3bbe46[_0x5c9d('0x1e')]);if(_0x3bbe46[_0x5c9d('0x1f')]){delete _0x3bbe46[_0x5c9d('0x1f')];}_0x2af260[_0x5c9d('0x14')](_0x2dd04d)['send'](_0x3bbe46);};}var utilLicense=require('../../config/license/util');exports[_0x5c9d('0x20')]=function(_0x58e59f,_0x2f7b88){var _0x34d5f4={'raw':!![],'where':{'id':0x1}},_0x310121={};_0x310121[_0x5c9d('0x21')]=_['keys'](db['License'][_0x5c9d('0x22')]);_0x310121[_0x5c9d('0x23')]=_['keys'](_0x58e59f[_0x5c9d('0x23')]);_0x310121[_0x5c9d('0x24')]=_['intersection'](_0x310121['model'],_0x310121['query']);_0x34d5f4[_0x5c9d('0x25')]=_[_0x5c9d('0x26')](_0x310121[_0x5c9d('0x21')],qs[_0x5c9d('0x27')](_0x58e59f['query'][_0x5c9d('0x27')]));_0x34d5f4[_0x5c9d('0x25')]=_0x34d5f4[_0x5c9d('0x25')][_0x5c9d('0x28')]?_0x34d5f4[_0x5c9d('0x25')]:_0x310121[_0x5c9d('0x21')];_0x34d5f4=_[_0x5c9d('0x29')]({},_0x34d5f4,_0x58e59f['options']);return utilLicense['getLicense'](_0x34d5f4)[_0x5c9d('0x1c')](respondWithResult(_0x2f7b88,null))['catch'](handleError(_0x2f7b88,null));};exports[_0x5c9d('0x2a')]=function(_0x5d7a86,_0x1d8596){if(_0x5d7a86['body']['id']){delete _0x5d7a86[_0x5c9d('0x2b')]['id'];}return db[_0x5c9d('0x2c')]['find']({'where':{'id':_0x5d7a86['params']['id']}})[_0x5c9d('0x1c')](handleEntityNotFound(_0x1d8596,null))['then'](function(_0x1bc2b2){var _0x38ea9d=_0x1bc2b2[_0x5c9d('0x2d')]({'plain':!![]});return utilLicense[_0x5c9d('0x2e')](_0x38ea9d,_0x5d7a86[_0x5c9d('0x2b')][_0x5c9d('0x2f')]);})[_0x5c9d('0x1c')](function(_0x2a85bd){if(!_0x2a85bd[_0x5c9d('0x30')]){return saveUpdates(_0x5d7a86[_0x5c9d('0x2b')],null);}return _0x2a85bd;})['then'](respondWithResult(_0x1d8596,null))[_0x5c9d('0x31')](handleError(_0x1d8596,null));}; \ No newline at end of file +var _0x2bbc=['offset','Content-Range','apply','then','destroy','error','stack','name','send','model','License','rawAttributes','query','attributes','intersection','fields','length','catch','body','find','params','get','key','demo','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x2bbc,0xec));var _0xc2bb=function(_0x56457b,_0x322699){_0x56457b=_0x56457b-0x0;var _0x3b6146=_0x2bbc[_0x56457b];return _0x3b6146;};'use strict';var pdf=require(_0xc2bb('0x0'));var emlformat=require(_0xc2bb('0x1'));var rimraf=require(_0xc2bb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc2bb('0x3'));var moment=require(_0xc2bb('0x4'));var BPromise=require(_0xc2bb('0x5'));var Mustache=require(_0xc2bb('0x6'));var util=require(_0xc2bb('0x7'));var path=require(_0xc2bb('0x8'));var sox=require(_0xc2bb('0x9'));var csv=require('to-csv');var ejs=require(_0xc2bb('0xa'));var fs=require('fs');var _=require(_0xc2bb('0xb'));var squel=require(_0xc2bb('0xc'));var crypto=require(_0xc2bb('0xd'));var jsforce=require(_0xc2bb('0xe'));var deskjs=require(_0xc2bb('0xf'));var toCsv=require(_0xc2bb('0x10'));var querystring=require('querystring');var Papa=require(_0xc2bb('0x11'));var Redis=require(_0xc2bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc2bb('0x13'));var hardwareService=require(_0xc2bb('0x14'));var logger=require(_0xc2bb('0x15'))(_0xc2bb('0x16'));var utils=require(_0xc2bb('0x17'));var config=require(_0xc2bb('0x18'));var db=require(_0xc2bb('0x19'))['db'];function respondWithStatusCode(_0x2c847b,_0x224460){_0x224460=_0x224460||0xcc;return function(_0x45c8eb){if(_0x45c8eb){return _0x2c847b[_0xc2bb('0x1a')](_0x224460);}return _0x2c847b['status'](_0x224460)['end']();};}function respondWithResult(_0x1c0869,_0x22e095){_0x22e095=_0x22e095||0xc8;return function(_0x543d1a){if(_0x543d1a){return _0x1c0869[_0xc2bb('0x1b')](_0x22e095)[_0xc2bb('0x1c')](_0x543d1a);}};}function respondWithFilteredResult(_0x3385bc,_0x4bb7b7){return function(_0x3ac4fe){if(_0x3ac4fe){var _0x1ee311=_0x3ac4fe['count'],_0x4bdc96=_0x4bb7b7[_0xc2bb('0x1d')],_0x57988d=_0x4bb7b7[_0xc2bb('0x1d')]+_0x4bb7b7['limit'],_0x4320bd;if(_0x57988d>=_0x1ee311){_0x57988d=_0x1ee311;_0x4320bd=0xc8;}else{_0x4320bd=0xce;}_0x3385bc[_0xc2bb('0x1b')](_0x4320bd);return _0x3385bc['set'](_0xc2bb('0x1e'),_0x4bdc96+'-'+_0x57988d+'/'+_0x1ee311)[_0xc2bb('0x1c')](_0x3ac4fe);}return null;};}function patchUpdates(_0x25750b){return function(_0x4cb746){try{jsonpatch[_0xc2bb('0x1f')](_0x4cb746,_0x25750b,!![]);}catch(_0x54522d){return BPromise['reject'](_0x54522d);}return _0x4cb746['save']();};}function saveUpdates(_0x1049d3,_0x45b494){return function(_0x205ac5){if(_0x205ac5){return _0x205ac5['update'](_0x1049d3)[_0xc2bb('0x20')](function(_0x43080d){return _0x43080d;});}return null;};}function removeEntity(_0x1bc216,_0x2026ed){return function(_0x5a933d){if(_0x5a933d){return _0x5a933d[_0xc2bb('0x21')]()['then'](function(){_0x1bc216[_0xc2bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217e79,_0x5de930){return function(_0x5cc622){if(!_0x5cc622){_0x217e79[_0xc2bb('0x1a')](0x194);}return _0x5cc622;};}function handleError(_0x8d4d45,_0x362a7e){_0x362a7e=_0x362a7e||0x1f4;return function(_0x54d732){logger[_0xc2bb('0x22')](_0x54d732[_0xc2bb('0x23')]);if(_0x54d732[_0xc2bb('0x24')]){delete _0x54d732[_0xc2bb('0x24')];}_0x8d4d45[_0xc2bb('0x1b')](_0x362a7e)[_0xc2bb('0x25')](_0x54d732);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x3df934,_0x1c26c3){var _0x1093ea={'raw':!![],'where':{'id':0x1}},_0x4d44c2={};_0x4d44c2[_0xc2bb('0x26')]=_['keys'](db[_0xc2bb('0x27')][_0xc2bb('0x28')]);_0x4d44c2[_0xc2bb('0x29')]=_['keys'](_0x3df934[_0xc2bb('0x29')]);_0x4d44c2['filters']=_['intersection'](_0x4d44c2[_0xc2bb('0x26')],_0x4d44c2[_0xc2bb('0x29')]);_0x1093ea[_0xc2bb('0x2a')]=_[_0xc2bb('0x2b')](_0x4d44c2[_0xc2bb('0x26')],qs[_0xc2bb('0x2c')](_0x3df934['query']['fields']));_0x1093ea['attributes']=_0x1093ea[_0xc2bb('0x2a')][_0xc2bb('0x2d')]?_0x1093ea[_0xc2bb('0x2a')]:_0x4d44c2['model'];_0x1093ea=_['merge']({},_0x1093ea,_0x3df934['options']);return utilLicense['getLicense'](_0x1093ea)[_0xc2bb('0x20')](respondWithResult(_0x1c26c3,null))[_0xc2bb('0x2e')](handleError(_0x1c26c3,null));};exports['update']=function(_0x21875a,_0x2dfd3a){if(_0x21875a[_0xc2bb('0x2f')]['id']){delete _0x21875a['body']['id'];}return db[_0xc2bb('0x27')][_0xc2bb('0x30')]({'where':{'id':_0x21875a[_0xc2bb('0x31')]['id']}})[_0xc2bb('0x20')](handleEntityNotFound(_0x2dfd3a,null))[_0xc2bb('0x20')](function(_0x4d1615){var _0x46bf3b=_0x4d1615[_0xc2bb('0x32')]({'plain':!![]});return utilLicense['checkLicense'](_0x46bf3b,_0x21875a[_0xc2bb('0x2f')][_0xc2bb('0x33')]);})[_0xc2bb('0x20')](function(_0x217f98){if(!_0x217f98[_0xc2bb('0x34')]){return saveUpdates(_0x21875a['body'],null);}return _0x217f98;})[_0xc2bb('0x20')](respondWithResult(_0x2dfd3a,null))[_0xc2bb('0x2e')](handleError(_0x2dfd3a,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 75a8b61..f5952df 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 _0xcecc=['exports','define','License','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0xcecc,0x186));var _0xccec=function(_0x22a100,_0x3e6383){_0x22a100=_0x22a100-0x0;var _0x575540=_0xcecc[_0x22a100];return _0x575540;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var logger=require(_0xccec('0x1'))('api');var moment=require('moment');var BPromise=require(_0xccec('0x2'));var rp=require(_0xccec('0x3'));var fs=require('fs');var path=require(_0xccec('0x4'));var rimraf=require(_0xccec('0x5'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xccec('0x6')]=function(_0x5822af,_0x455556){return _0x5822af[_0xccec('0x7')](_0xccec('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x867f=['exports','define','License','license','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./license.attributes'];(function(_0x4e4529,_0x33f07b){var _0x100460=function(_0xdabf17){while(--_0xdabf17){_0x4e4529['push'](_0x4e4529['shift']());}};_0x100460(++_0x33f07b);}(_0x867f,0xdc));var _0xf867=function(_0x241b92,_0x1526dd){_0x241b92=_0x241b92-0x0;var _0x575bb4=_0x867f[_0x241b92];return _0x575bb4;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))('api');var moment=require(_0xf867('0x3'));var BPromise=require(_0xf867('0x4'));var rp=require(_0xf867('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf867('0x6'));var config=require('../../config/environment');var attributes=require(_0xf867('0x7'));module[_0xf867('0x8')]=function(_0x2708d5,_0x287b67){return _0x2708d5[_0xf867('0x9')](_0xf867('0xa'),attributes,{'tableName':_0xf867('0xb'),'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 25c067a..b2a7ed3 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 _0xd3bf=['error','code','License,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xd3bf,0x16d));var _0xfd3b=function(_0x377f32,_0x2b032c){_0x377f32=_0x377f32-0x0;var _0x43a1b0=_0xd3bf[_0x377f32];return _0x43a1b0;};'use strict';var _=require(_0xfd3b('0x0'));var util=require('util');var moment=require(_0xfd3b('0x1'));var BPromise=require(_0xfd3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd3b('0x3'));var db=require(_0xfd3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd3b('0x5'))(_0xfd3b('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3da9cb,_0x182ed1,_0x335bb3){return new BPromise(function(_0x508be3,_0x3cdd25){return client[_0xfd3b('0x8')](_0x3da9cb,_0x335bb3)[_0xfd3b('0x9')](function(_0x39036d){logger[_0xfd3b('0xa')]('License,\x20%s,\x20%s',_0x182ed1,_0xfd3b('0xb'));logger[_0xfd3b('0xc')](_0xfd3b('0xd'),_0x182ed1,_0xfd3b('0xb'),JSON[_0xfd3b('0xe')](_0x39036d));if(_0x39036d[_0xfd3b('0xf')]){if(_0x39036d['error'][_0xfd3b('0x10')]===0x1f4){logger[_0xfd3b('0xf')](_0xfd3b('0x11'),_0x182ed1,_0x39036d['error'][_0xfd3b('0x12')]);return _0x3cdd25(_0x39036d[_0xfd3b('0xf')][_0xfd3b('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0x182ed1,_0x39036d[_0xfd3b('0xf')]['message']);return _0x508be3(_0x39036d['error']['message']);}else{logger[_0xfd3b('0xa')](_0xfd3b('0x11'),_0x182ed1,_0xfd3b('0xb'));_0x508be3(_0x39036d['result'][_0xfd3b('0x12')]);}})[_0xfd3b('0x13')](function(_0x20dabe){logger['error'](_0xfd3b('0x11'),_0x182ed1,_0x20dabe);_0x3cdd25(_0x20dabe);});});} \ No newline at end of file +var _0x595a=['request','then','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x595a,0x19a));var _0xa595=function(_0x155839,_0x3f679d){_0x155839=_0x155839-0x0;var _0x51d322=_0x595a[_0x155839];return _0x51d322;};'use strict';var _=require('lodash');var util=require(_0xa595('0x0'));var moment=require(_0xa595('0x1'));var BPromise=require(_0xa595('0x2'));var rs=require(_0xa595('0x3'));var fs=require('fs');var Redis=require(_0xa595('0x4'));var db=require(_0xa595('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa595('0x6'))('rpc');var config=require(_0xa595('0x7'));var jayson=require(_0xa595('0x8'));var client=jayson[_0xa595('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb14b,_0x18e2ed,_0x4617f9){return new BPromise(function(_0x484a3c,_0x251976){return client[_0xa595('0xa')](_0x3eb14b,_0x4617f9)[_0xa595('0xb')](function(_0x54096c){logger['info'](_0xa595('0xc'),_0x18e2ed,_0xa595('0xd'));logger[_0xa595('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x18e2ed,_0xa595('0xd'),JSON[_0xa595('0xf')](_0x54096c));if(_0x54096c[_0xa595('0x10')]){if(_0x54096c['error'][_0xa595('0x11')]===0x1f4){logger[_0xa595('0x10')](_0xa595('0xc'),_0x18e2ed,_0x54096c[_0xa595('0x10')][_0xa595('0x12')]);return _0x251976(_0x54096c['error']['message']);}logger[_0xa595('0x10')](_0xa595('0xc'),_0x18e2ed,_0x54096c[_0xa595('0x10')][_0xa595('0x12')]);return _0x484a3c(_0x54096c['error']['message']);}else{logger[_0xa595('0x13')](_0xa595('0xc'),_0x18e2ed,'request\x20sent');_0x484a3c(_0x54096c[_0xa595('0x14')][_0xa595('0x12')]);}})['catch'](function(_0x5750f0){logger[_0xa595('0x10')]('License,\x20%s,\x20%s',_0x18e2ed,_0x5750f0);_0x251976(_0x5750f0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f6c83e3..8235a7c 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 _0xe77d=['post','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x34507d,_0x4600ba){var _0x33d263=function(_0xf7c7b){while(--_0xf7c7b){_0x34507d['push'](_0x34507d['shift']());}};_0x33d263(++_0x4600ba);}(_0xe77d,0xc6));var _0xde77=function(_0x546ab6,_0x357f23){_0x546ab6=_0x546ab6-0x0;var _0x3952ca=_0xe77d[_0x546ab6];return _0x3952ca;};'use strict';var multer=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var path=require(_0xde77('0x2'));var timeout=require(_0xde77('0x3'));var express=require(_0xde77('0x4'));var router=express[_0xde77('0x5')]();var auth=require(_0xde77('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde77('0x7'));var controller=require(_0xde77('0x8'));router[_0xde77('0x9')]('/',auth[_0xde77('0xa')](),controller[_0xde77('0xb')]);router[_0xde77('0x9')](_0xde77('0xc'),auth[_0xde77('0xa')](),controller[_0xde77('0xd')]);router['get'](_0xde77('0xe'),auth[_0xde77('0xa')](),controller['show']);router[_0xde77('0x9')](_0xde77('0xf'),auth[_0xde77('0xa')](),controller[_0xde77('0x10')]);router['get'](_0xde77('0x11'),auth[_0xde77('0xa')](),controller['getAnswers']);router[_0xde77('0x9')](_0xde77('0x12'),auth[_0xde77('0xa')](),controller['getImap']);router[_0xde77('0x9')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x14')]);router[_0xde77('0x9')](_0xde77('0x15'),auth[_0xde77('0xa')](),controller['getInteractions']);router[_0xde77('0x9')](_0xde77('0x16'),auth[_0xde77('0xa')](),controller['getApplications']);router[_0xde77('0x9')]('/:id/messages',auth[_0xde77('0xa')](),controller['getMessages']);router[_0xde77('0x9')](_0xde77('0x17'),auth['isAuthenticated'](),controller[_0xde77('0x18')]);router[_0xde77('0x9')](_0xde77('0x19'),auth['isAuthenticated'](),controller[_0xde77('0x1a')]);router[_0xde77('0x1b')](_0xde77('0xf'),auth[_0xde77('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xde77('0xa')](),controller[_0xde77('0x1c')]);router['post']('/',auth[_0xde77('0xa')](),controller['create']);router[_0xde77('0x1b')](_0xde77('0x12'),auth['isAuthenticated'](),controller[_0xde77('0x1d')]);router[_0xde77('0x1b')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x1e')]);router['post'](_0xde77('0x15'),auth[_0xde77('0xa')](),controller[_0xde77('0x1f')]);router[_0xde77('0x1b')](_0xde77('0x16'),auth[_0xde77('0xa')](),controller[_0xde77('0x20')]);router['post'](_0xde77('0x21'),auth[_0xde77('0xa')](),controller[_0xde77('0x22')]);router[_0xde77('0x1b')](_0xde77('0x19'),auth[_0xde77('0xa')](),controller[_0xde77('0x23')]);router[_0xde77('0x24')]('/:id',auth['isAuthenticated'](),controller[_0xde77('0x25')]);router['delete'](_0xde77('0xf'),auth[_0xde77('0xa')](),controller[_0xde77('0x26')]);router[_0xde77('0x27')](_0xde77('0x11'),auth['isAuthenticated'](),controller[_0xde77('0x28')]);router[_0xde77('0x27')](_0xde77('0x12'),auth[_0xde77('0xa')](),controller['removeImap']);router[_0xde77('0x27')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x29')]);router[_0xde77('0x27')](_0xde77('0xe'),auth[_0xde77('0xa')](),controller[_0xde77('0x2a')]);router[_0xde77('0x27')](_0xde77('0x19'),auth[_0xde77('0xa')](),controller[_0xde77('0x2b')]);module[_0xde77('0x2c')]=router; \ No newline at end of file +var _0x1262=['addImap','addSmtp','addInteraction','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','express','Router','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','verifySmtp','/:id/users','addDisposition','post','addAnswer'];(function(_0xda77fb,_0x341892){var _0x18264b=function(_0x1b01dd){while(--_0x1b01dd){_0xda77fb['push'](_0xda77fb['shift']());}};_0x18264b(++_0x341892);}(_0x1262,0x16c));var _0x2126=function(_0x13cc49,_0x5758fc){_0x13cc49=_0x13cc49-0x0;var _0x14b1f9=_0x1262[_0x13cc49];return _0x14b1f9;};'use strict';var multer=require('multer');var util=require(_0x2126('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2126('0x1'));var router=express[_0x2126('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2126('0x3'));router[_0x2126('0x4')]('/',auth[_0x2126('0x5')](),controller[_0x2126('0x6')]);router[_0x2126('0x4')](_0x2126('0x7'),auth[_0x2126('0x5')](),controller['describe']);router['get'](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x9')]);router['get'](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0xb')]);router[_0x2126('0x4')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller['getAnswers']);router[_0x2126('0x4')](_0x2126('0xd'),auth[_0x2126('0x5')](),controller['getImap']);router[_0x2126('0x4')](_0x2126('0xe'),auth[_0x2126('0x5')](),controller[_0x2126('0xf')]);router[_0x2126('0x4')](_0x2126('0x10'),auth[_0x2126('0x5')](),controller[_0x2126('0x11')]);router['get'](_0x2126('0x12'),auth[_0x2126('0x5')](),controller['getApplications']);router['get'](_0x2126('0x13'),auth[_0x2126('0x5')](),controller['getMessages']);router[_0x2126('0x4')](_0x2126('0x14'),auth[_0x2126('0x5')](),controller[_0x2126('0x15')]);router[_0x2126('0x4')](_0x2126('0x16'),auth[_0x2126('0x5')](),controller['getAgents']);router['post'](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0x17')]);router[_0x2126('0x18')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller[_0x2126('0x19')]);router[_0x2126('0x18')]('/',auth[_0x2126('0x5')](),controller['create']);router[_0x2126('0x18')](_0x2126('0xd'),auth[_0x2126('0x5')](),controller[_0x2126('0x1a')]);router['post'](_0x2126('0xe'),auth['isAuthenticated'](),controller[_0x2126('0x1b')]);router[_0x2126('0x18')](_0x2126('0x10'),auth[_0x2126('0x5')](),controller[_0x2126('0x1c')]);router[_0x2126('0x18')](_0x2126('0x12'),auth[_0x2126('0x5')](),controller['addApplications']);router[_0x2126('0x18')]('/:id/send',auth[_0x2126('0x5')](),controller['send']);router['post'](_0x2126('0x16'),auth[_0x2126('0x5')](),controller['addAgents']);router[_0x2126('0x1d')](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x1e')]);router[_0x2126('0x1f')](_0x2126('0xa'),auth['isAuthenticated'](),controller[_0x2126('0x20')]);router[_0x2126('0x1f')](_0x2126('0xc'),auth[_0x2126('0x5')](),controller[_0x2126('0x21')]);router[_0x2126('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2126('0x22')]);router[_0x2126('0x1f')](_0x2126('0xe'),auth[_0x2126('0x5')](),controller[_0x2126('0x23')]);router[_0x2126('0x1f')](_0x2126('0x8'),auth[_0x2126('0x5')](),controller[_0x2126('0x24')]);router[_0x2126('0x1f')](_0x2126('0x16'),auth['isAuthenticated'](),controller[_0x2126('0x25')]);module[_0x2126('0x26')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7996360..f05a78d 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 _0x5af0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5af0,0x89));var _0x05af=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x5af0[_0x2675da];return _0x5e6153;};'use strict';var Sequelize=require(_0x05af('0x0'));module['exports']={'description':{'type':Sequelize[_0x05af('0x1')]},'name':{'type':Sequelize[_0x05af('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x05af('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x05af('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x05af('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x05af('0x3')]},'markAsUnread':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x05af('0x4')](0x2)[_0x05af('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x05af('0x3')],'defaultValue':function(){return _0x05af('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x05af('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x05af('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x05af('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![],'comment':_0x05af('0x8'),'set':function(_0x2e5d86){if(!_0x2e5d86)this[_0x05af('0x9')](_0x05af('0xa'),null);this['setDataValue'](_0x05af('0xb'),_0x2e5d86);}}}; \ No newline at end of file +var _0xaaa8=['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(_0x7b975a,_0x1bd7a0){var _0x3aa5e6=function(_0x16dcaa){while(--_0x16dcaa){_0x7b975a['push'](_0x7b975a['shift']());}};_0x3aa5e6(++_0x1bd7a0);}(_0xaaa8,0x17f));var _0x8aaa=function(_0x2b9c1a,_0x575609){_0x2b9c1a=_0x2b9c1a-0x0;var _0x2ac8e2=_0xaaa8[_0x2b9c1a];return _0x2ac8e2;};'use strict';var Sequelize=require(_0x8aaa('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8aaa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8aaa('0x3')]},'markAsUnread':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8aaa('0x1')],'allowNull':![],'defaultValue':_0x8aaa('0x4')},'fontSize':{'type':Sequelize[_0x8aaa('0x5')](0x2)[_0x8aaa('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8aaa('0x3')],'defaultValue':function(){return _0x8aaa('0x7');}},'notificationSound':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8aaa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8aaa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aaa('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x8aaa('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aaa('0x9'),'set':function(_0x4a25fd){if(!_0x4a25fd)this[_0x8aaa('0xa')](_0x8aaa('0xb'),null);this[_0x8aaa('0xa')]('mandatoryDisposition',_0x4a25fd);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 1251fa0..f507a5d 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 _0xa30a=['updatedAt','DESC','from','attachments','join','server/files/attachments','basename','authentication','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','destroy','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','get','MailAccounts','UserProfileResource','sendStatus','stack','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','where','include','rows','show','Smtp','includeAll','find','body','params','describe','MailAccountId','create','getDispositions','Disposition','rawAttributes','hasOwnProperty','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','length','name','email','ListId','active','isNil','cservice','cauthentication','user','cuser','password','pass','host','port','service','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','ids','User','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts'];(function(_0x12d23a,_0x1cad42){var _0x239536=function(_0x2fe720){while(--_0x2fe720){_0x12d23a['push'](_0x12d23a['shift']());}};_0x239536(++_0x1cad42);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xaa30('0x0'));var emlformat=require(_0xaa30('0x1'));var rimraf=require(_0xaa30('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa30('0x3'));var rp=require(_0xaa30('0x4'));var moment=require(_0xaa30('0x5'));var BPromise=require(_0xaa30('0x6'));var Mustache=require(_0xaa30('0x7'));var util=require(_0xaa30('0x8'));var path=require(_0xaa30('0x9'));var sox=require('sox');var csv=require(_0xaa30('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xa'));var querystring=require(_0xaa30('0xf'));var Papa=require(_0xaa30('0x10'));var Redis=require(_0xaa30('0x11'));var authService=require(_0xaa30('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa30('0x13'))('api');var utils=require(_0xaa30('0x14'));var config=require(_0xaa30('0x15'));var db=require(_0xaa30('0x16'))['db'];config[_0xaa30('0x17')]=_['defaults'](config[_0xaa30('0x17')],{'host':_0xaa30('0x18'),'port':0x18eb});var socket=require(_0xaa30('0x19'))(new Redis(config['redis']));require(_0xaa30('0x1a'))[_0xaa30('0x1b')](socket);var jayson=require(_0xaa30('0x1c'));var client=jayson[_0xaa30('0x1d')][_0xaa30('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x31aa0b,_0x3240e9,_0x3b8095){if(_0x3b8095){var _0x2e37af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e37af[_0xaa30('0x1f')](_0x3240e9)){return _0x31aa0b;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x31aa0b;}}function respondWithRpcPromise(_0x91839d,_0x591478,_0x5eb356,_0x3247ea){return new BPromise(function(_0x153939,_0x130606){var _0x540e36=_0x3247ea||client;return _0x540e36['request'](_0x91839d,_0x5eb356)['then'](function(_0x23ad3b){logger['info'](_0xaa30('0x20'),_0x591478,_0xaa30('0x21'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x591478,'request\x20sent',JSON[_0xaa30('0x22')](_0x23ad3b));if(_0x23ad3b[_0xaa30('0x23')]){if(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x24')]===0x1f4){logger[_0xaa30('0x23')]('MailAccount,\x20%s,\x20%s',_0x591478,_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);return _0x130606(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);}logger[_0xaa30('0x23')]('MailAccount,\x20%s,\x20%s',_0x591478,_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);return _0x153939(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);}else{logger['info'](_0xaa30('0x20'),_0x591478,_0xaa30('0x21'));_0x153939(_0x23ad3b[_0xaa30('0x26')][_0xaa30('0x25')]);}})[_0xaa30('0x27')](function(_0x2a59ce){logger['error'](_0xaa30('0x20'),_0x591478,_0x2a59ce);_0x130606(_0x2a59ce);});});}function respondWithStatusCode(_0x465701,_0x5d4da8){_0x5d4da8=_0x5d4da8||0xcc;return function(_0xb043e4){if(_0xb043e4){return _0x465701['sendStatus'](_0x5d4da8);}return _0x465701[_0xaa30('0x28')](_0x5d4da8)[_0xaa30('0x29')]();};}function respondWithResult(_0x2aabf8,_0xd1eb3a){_0xd1eb3a=_0xd1eb3a||0xc8;return function(_0x37b4a6){if(_0x37b4a6){return _0x2aabf8[_0xaa30('0x28')](_0xd1eb3a)[_0xaa30('0x2a')](_0x37b4a6);}};}function respondWithFilteredResult(_0x39f708,_0x1f288c){return function(_0x43fb30){if(_0x43fb30){var _0x44aa9b=_0x43fb30[_0xaa30('0x2b')],_0x43003f=_0x1f288c[_0xaa30('0x2c')],_0x2038a6=_0x1f288c[_0xaa30('0x2c')]+_0x1f288c[_0xaa30('0x2d')],_0x46abb9;if(_0x2038a6>=_0x44aa9b){_0x2038a6=_0x44aa9b;_0x46abb9=0xc8;}else{_0x46abb9=0xce;}_0x39f708['status'](_0x46abb9);return _0x39f708[_0xaa30('0x2e')](_0xaa30('0x2f'),_0x43003f+'-'+_0x2038a6+'/'+_0x44aa9b)[_0xaa30('0x2a')](_0x43fb30);}return null;};}function patchUpdates(_0x20916f){return function(_0x2276e0){try{jsonpatch[_0xaa30('0x30')](_0x2276e0,_0x20916f,!![]);}catch(_0x4dae71){return BPromise['reject'](_0x4dae71);}return _0x2276e0['save']();};}function saveUpdates(_0x30909a,_0x407090){return function(_0xb48ef3){if(_0xb48ef3){return _0xb48ef3[_0xaa30('0x31')](_0x30909a)[_0xaa30('0x32')](function(_0x559013){return _0x559013;});}return null;};}function removeEntity(_0x499af0,_0x7a920e){return function(_0x2d26fb){if(_0x2d26fb){return _0x2d26fb['destroy']()[_0xaa30('0x32')](function(){var _0x4c83dd=_0x2d26fb[_0xaa30('0x33')]({'plain':!![]});var _0x5241d2=_0xaa30('0x34');return db[_0xaa30('0x35')]['destroy']({'where':{'type':_0x5241d2,'resourceId':_0x4c83dd['id']}})[_0xaa30('0x32')](function(){return _0x2d26fb;});})[_0xaa30('0x32')](function(){_0x499af0[_0xaa30('0x28')](0xcc)[_0xaa30('0x29')]();});}};}function handleEntityNotFound(_0x285b68,_0x61c959){return function(_0x5cfc85){if(!_0x5cfc85){_0x285b68[_0xaa30('0x36')](0x194);}return _0x5cfc85;};}function handleError(_0x1a2af6,_0x53dd7c){_0x53dd7c=_0x53dd7c||0x1f4;return function(_0x3769ea){logger[_0xaa30('0x23')](_0x3769ea[_0xaa30('0x37')]);if(_0x3769ea['name']){delete _0x3769ea['name'];}_0x1a2af6[_0xaa30('0x28')](_0x53dd7c)[_0xaa30('0x38')](_0x3769ea);};}exports[_0xaa30('0x39')]=function(_0x1b22ed,_0x1ec3cf){var _0x291854={'include':[{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')},{'model':db[_0xaa30('0x3c')],'as':'Smtp'},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]},_0x4dd5df={},_0x5ca1b0={'count':0x0,'rows':[]};var _0x8fb95e=db[_0xaa30('0x3f')]['rawAttributes'];_0x4dd5df[_0xaa30('0x40')]=_[_0xaa30('0x41')](_0x8fb95e);_0x4dd5df[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x1b22ed[_0xaa30('0x42')]);_0x4dd5df['filters']=_[_0xaa30('0x43')](_0x4dd5df[_0xaa30('0x40')],_0x4dd5df[_0xaa30('0x42')]);_0x291854[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x4dd5df[_0xaa30('0x40')],qs[_0xaa30('0x45')](_0x1b22ed[_0xaa30('0x42')]['fields']));_0x291854['attributes']=_0x291854[_0xaa30('0x44')]['length']?_0x291854['attributes']:_0x4dd5df['model'];if(!_0x1b22ed[_0xaa30('0x42')]['hasOwnProperty'](_0xaa30('0x46'))){_0x291854['limit']=qs[_0xaa30('0x2d')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x291854[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x291854[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x48')]);_0x291854['where']=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x1b22ed[_0xaa30('0x42')],_0x4dd5df[_0xaa30('0x49')]));if(_0x1b22ed[_0xaa30('0x42')]['filter']){_0x291854['where']=_[_0xaa30('0x4b')](_0x291854['where'],{'$or':_[_0xaa30('0x4c')](_0x8fb95e,function(_0xbf9edd){if(_0xbf9edd[_0xaa30('0x4d')][_0xaa30('0x4e')]!==_0xaa30('0x4f')){var _0x3ec15b={};_0x3ec15b[_0xbf9edd[_0xaa30('0x50')]]={'$like':'%'+_0x1b22ed['query'][_0xaa30('0x51')]+'%'};return _0x3ec15b;}})});}_0x291854=_[_0xaa30('0x4b')]({},_0x291854,_0x1b22ed[_0xaa30('0x52')]);var _0x5cacee={'where':_0x291854[_0xaa30('0x53')]};return db[_0xaa30('0x3f')]['count'](_0x5cacee)[_0xaa30('0x32')](function(_0x4a8fcc){_0x5ca1b0[_0xaa30('0x2b')]=_0x4a8fcc;if(_0x1b22ed['query']['includeAll']){_0x291854[_0xaa30('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x291854);})[_0xaa30('0x32')](function(_0x1083e2){_0x5ca1b0[_0xaa30('0x55')]=_0x1083e2;return _0x5ca1b0;})[_0xaa30('0x32')](respondWithFilteredResult(_0x1ec3cf,_0x291854))[_0xaa30('0x27')](handleError(_0x1ec3cf,null));};exports[_0xaa30('0x56')]=function(_0x5616cd,_0x17d75d){var _0x17868d={'raw':![],'where':{'id':_0x5616cd['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]},_0x4531b7={};_0x4531b7[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x3f')]['rawAttributes']);_0x4531b7[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x5616cd[_0xaa30('0x42')]);_0x4531b7[_0xaa30('0x49')]=_['intersection'](_0x4531b7[_0xaa30('0x40')],_0x4531b7[_0xaa30('0x42')]);_0x17868d[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x4531b7[_0xaa30('0x40')],qs['fields'](_0x5616cd['query'][_0xaa30('0x45')]));_0x17868d[_0xaa30('0x44')]=_0x17868d[_0xaa30('0x44')]['length']?_0x17868d[_0xaa30('0x44')]:_0x4531b7['model'];if(_0x5616cd[_0xaa30('0x42')][_0xaa30('0x58')]){_0x17868d['include']=[{'all':!![]}];}_0x17868d=_[_0xaa30('0x4b')]({},_0x17868d,_0x5616cd[_0xaa30('0x52')]);return db['MailAccount'][_0xaa30('0x59')](_0x17868d)['then'](handleEntityNotFound(_0x17d75d,null))['then'](respondWithResult(_0x17d75d,null))[_0xaa30('0x27')](handleError(_0x17d75d,null));};exports[_0xaa30('0x31')]=function(_0x268359,_0x5a85aa){if(_0x268359[_0xaa30('0x5a')]['id']){delete _0x268359[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x268359[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')},{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]})[_0xaa30('0x32')](handleEntityNotFound(_0x5a85aa,null))[_0xaa30('0x32')](saveUpdates(_0x268359['body'],null))[_0xaa30('0x32')](function(_0x3bc9d9){if(_0x3bc9d9&&_0x268359[_0xaa30('0x5a')]['Imap']){return db[_0xaa30('0x3a')][_0xaa30('0x31')](_0x268359[_0xaa30('0x5a')][_0xaa30('0x3b')],{'where':{'MailAccountId':_0x3bc9d9['id']}})[_0xaa30('0x32')](function(){return _0x3bc9d9;});}return _0x3bc9d9;})[_0xaa30('0x32')](function(_0x4f1d54){if(_0x4f1d54&&_0x268359[_0xaa30('0x5a')]['Smtp']){return db[_0xaa30('0x3c')][_0xaa30('0x31')](_0x268359[_0xaa30('0x5a')][_0xaa30('0x57')],{'where':{'MailAccountId':_0x4f1d54['id']}})['then'](function(){return _0x4f1d54;});}return _0x4f1d54;})[_0xaa30('0x32')](respondWithResult(_0x5a85aa,null))[_0xaa30('0x27')](handleError(_0x5a85aa,null));};exports['describe']=function(_0x26f6f9,_0x62b307){return db[_0xaa30('0x3f')][_0xaa30('0x5c')]()[_0xaa30('0x32')](respondWithResult(_0x62b307,null))[_0xaa30('0x27')](handleError(_0x62b307,null));};exports['addDisposition']=function(_0x401f5f,_0x33b2ef,_0x3a8bdc){if(_0x401f5f[_0xaa30('0x5a')]['id']){delete _0x401f5f[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x401f5f[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x33b2ef,null))[_0xaa30('0x32')](function(_0x46bdc4){if(_0x46bdc4){_0x401f5f[_0xaa30('0x5a')][_0xaa30('0x5d')]=_0x46bdc4['id'];return db['Disposition'][_0xaa30('0x5e')](_0x401f5f['body']);}})[_0xaa30('0x32')](respondWithResult(_0x33b2ef,null))['catch'](handleError(_0x33b2ef,null));};exports[_0xaa30('0x5f')]=function(_0x2d7725,_0x211a83,_0x5880b2){var _0x12347c={'raw':![],'where':{}};var _0x30f19a={};var _0x4c9643={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x2d7725[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x211a83,null))['then'](function(_0x17801d){if(_0x17801d){_0x30f19a[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x60')][_0xaa30('0x61')]);_0x30f19a[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x2d7725['query']);_0x30f19a[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x30f19a[_0xaa30('0x40')],_0x30f19a['query']);_0x12347c[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x30f19a[_0xaa30('0x40')],qs['fields'](_0x2d7725[_0xaa30('0x42')]['fields']));_0x12347c[_0xaa30('0x44')]=_0x12347c['attributes']['length']?_0x12347c[_0xaa30('0x44')]:_0x30f19a[_0xaa30('0x40')];if(!_0x2d7725['query'][_0xaa30('0x62')](_0xaa30('0x46'))){_0x12347c[_0xaa30('0x2d')]=qs['limit'](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x12347c[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x12347c[_0xaa30('0x47')]=qs['sort'](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x48')]);_0x12347c[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_['pick'](_0x2d7725[_0xaa30('0x42')],_0x30f19a[_0xaa30('0x49')]));_0x12347c['where'][_0xaa30('0x5d')]=_0x17801d['id'];if(_0x2d7725[_0xaa30('0x42')][_0xaa30('0x51')]){_0x12347c[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x12347c[_0xaa30('0x53')],{'$or':_['map'](_0x12347c[_0xaa30('0x44')],function(_0x1ddae9){var _0x5948b4={};_0x5948b4[_0x1ddae9]={'$like':'%'+_0x2d7725[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x5948b4;})});}_0x12347c=_[_0xaa30('0x4b')]({},_0x12347c,_0x2d7725[_0xaa30('0x52')]);return db[_0xaa30('0x60')]['count']({'where':_0x12347c[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x2216c0){_0x4c9643[_0xaa30('0x2b')]=_0x2216c0;if(_0x2d7725[_0xaa30('0x42')][_0xaa30('0x58')]){_0x12347c['include']=[{'all':!![]}];}return db[_0xaa30('0x60')][_0xaa30('0x63')](_0x12347c);})['then'](function(_0x4ecb6e){_0x4c9643[_0xaa30('0x55')]=_0x4ecb6e;return _0x4c9643;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x211a83,_0x12347c))[_0xaa30('0x27')](handleError(_0x211a83,null));};exports[_0xaa30('0x64')]=function(_0x1e6e00,_0x25449c,_0x2548be){return db['MailAccount']['find']({'where':{'id':_0x1e6e00['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x25449c,null))[_0xaa30('0x32')](function(_0xba496a){if(_0xba496a){return _0xba496a[_0xaa30('0x64')](_0x1e6e00[_0xaa30('0x42')]['ids']);}})[_0xaa30('0x32')](respondWithStatusCode(_0x25449c,null))[_0xaa30('0x27')](handleError(_0x25449c,null));};exports[_0xaa30('0x65')]=function(_0x377454,_0x37af47,_0xf9624a){if(_0x377454[_0xaa30('0x5a')]['id']){delete _0x377454[_0xaa30('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x377454['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x37af47,null))[_0xaa30('0x32')](function(_0x541d3b){if(_0x541d3b){_0x377454[_0xaa30('0x5a')][_0xaa30('0x5d')]=_0x541d3b['id'];return db[_0xaa30('0x66')][_0xaa30('0x5e')](_0x377454[_0xaa30('0x5a')]);}})['then'](respondWithResult(_0x37af47,null))[_0xaa30('0x27')](handleError(_0x37af47,null));};exports[_0xaa30('0x67')]=function(_0x4233de,_0x583eee,_0x21b87b){var _0x3792be={'raw':![],'where':{}};var _0x245787={};var _0x41873c={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x4233de[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x583eee,null))[_0xaa30('0x32')](function(_0x25d030){if(_0x25d030){_0x245787[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x66')][_0xaa30('0x61')]);_0x245787[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x4233de[_0xaa30('0x42')]);_0x245787[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x245787[_0xaa30('0x40')],_0x245787[_0xaa30('0x42')]);_0x3792be['attributes']=_[_0xaa30('0x43')](_0x245787['model'],qs[_0xaa30('0x45')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x45')]));_0x3792be[_0xaa30('0x44')]=_0x3792be[_0xaa30('0x44')][_0xaa30('0x69')]?_0x3792be[_0xaa30('0x44')]:_0x245787[_0xaa30('0x40')];if(!_0x4233de[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x3792be[_0xaa30('0x2d')]=qs[_0xaa30('0x2d')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x3792be[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x3792be['order']=qs[_0xaa30('0x48')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x48')]);_0x3792be[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x4233de[_0xaa30('0x42')],_0x245787['filters']));_0x3792be[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x25d030['id'];if(_0x4233de['query'][_0xaa30('0x51')]){_0x3792be[_0xaa30('0x53')]=_['merge'](_0x3792be[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x3792be[_0xaa30('0x44')],function(_0x3b60f3){var _0x5eb209={};_0x5eb209[_0x3b60f3]={'$like':'%'+_0x4233de[_0xaa30('0x42')]['filter']+'%'};return _0x5eb209;})});}_0x3792be=_[_0xaa30('0x4b')]({},_0x3792be,_0x4233de[_0xaa30('0x52')]);return db[_0xaa30('0x66')][_0xaa30('0x2b')]({'where':_0x3792be[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x45ffba){_0x41873c[_0xaa30('0x2b')]=_0x45ffba;if(_0x4233de[_0xaa30('0x42')]['includeAll']){_0x3792be[_0xaa30('0x54')]=[{'all':!![]}];}return db[_0xaa30('0x66')]['findAll'](_0x3792be);})[_0xaa30('0x32')](function(_0x1550ce){_0x41873c['rows']=_0x1550ce;return _0x41873c;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x583eee,_0x3792be))[_0xaa30('0x27')](handleError(_0x583eee,null));};exports['removeAnswers']=function(_0x44b202,_0x58920d,_0x5db1d5){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x44b202['params']['id']}})['then'](handleEntityNotFound(_0x58920d,null))[_0xaa30('0x32')](function(_0x30ba59){if(_0x30ba59){return _0x30ba59['removeAnswers'](_0x44b202[_0xaa30('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x58920d,null))[_0xaa30('0x27')](handleError(_0x58920d,null));};exports['create']=function(_0x2e6f5d,_0x4ce637){var _0x181692={'name':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6a')],'key':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x4e')],'email':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6b')],'ListId':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6c')],'active':!_['isNil'](_0x2e6f5d['body'][_0xaa30('0x6d')])?_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6d')]:!![],'description':_0x2e6f5d['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xaa30('0x6e')](_0x2e6f5d['body'][_0xaa30('0x6f')])){if(_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x70')]){_0x181692[_0xaa30('0x3b')]['user']=_0x181692[_0xaa30('0x57')][_0xaa30('0x71')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x72')];_0x181692[_0xaa30('0x3b')][_0xaa30('0x73')]=_0x181692['Smtp'][_0xaa30('0x74')]=_0x2e6f5d[_0xaa30('0x5a')]['cpassword'];}else{_0x181692[_0xaa30('0x3b')]['authentication']=_0x181692[_0xaa30('0x57')]['authentication']=![];}_0x181692[_0xaa30('0x3b')][_0xaa30('0x75')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x3b')][_0xaa30('0x75')];_0x181692[_0xaa30('0x3b')][_0xaa30('0x76')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x3b')]['port'];_0x181692[_0xaa30('0x57')][_0xaa30('0x75')]=_0x2e6f5d[_0xaa30('0x5a')]['Smtp'][_0xaa30('0x75')];_0x181692[_0xaa30('0x57')][_0xaa30('0x76')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x57')][_0xaa30('0x76')];}else{_0x181692[_0xaa30('0x3b')][_0xaa30('0x77')]=_0x181692[_0xaa30('0x57')]['service']=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6f')];_0x181692[_0xaa30('0x3b')]['user']=_0x181692[_0xaa30('0x57')][_0xaa30('0x71')]=_0x2e6f5d['body'][_0xaa30('0x72')];_0x181692['Imap']['password']=_0x181692[_0xaa30('0x57')][_0xaa30('0x74')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x78')];}return db['MailAccount']['create'](_0x181692,{'include':[{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')}]})[_0xaa30('0x32')](function(_0x4add63){var _0x7db5d7=_0x2e6f5d['user'][_0xaa30('0x33')]({'plain':!![]});if(!_0x7db5d7)throw new Error(_0xaa30('0x79'));if(_0x7db5d7[_0xaa30('0x7a')]==='user'){var _0x1c25b1=_0x4add63[_0xaa30('0x33')]({'plain':!![]});return db[_0xaa30('0x7b')][_0xaa30('0x59')]({'where':{'name':_0xaa30('0x34'),'userProfileId':_0x7db5d7[_0xaa30('0x7c')]},'raw':!![]})['then'](function(_0x133a0f){if(_0x133a0f&&_0x133a0f[_0xaa30('0x7d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c25b1[_0xaa30('0x6a')],'resourceId':_0x1c25b1['id'],'type':_0x133a0f[_0xaa30('0x6a')],'sectionId':_0x133a0f['id']},{})[_0xaa30('0x32')](function(){return _0x4add63;});}else{return _0x4add63;}})[_0xaa30('0x27')](function(_0x405e93){logger[_0xaa30('0x23')](_0xaa30('0x7e'),_0x405e93);throw _0x405e93;});}return _0x4add63;})[_0xaa30('0x32')](respondWithResult(_0x4ce637,0xc9))[_0xaa30('0x27')](handleError(_0x4ce637,null));};exports[_0xaa30('0x7f')]=function(_0x4bba25,_0x73c665,_0x51c71a){return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x4bba25[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x73c665,null))['then'](function(_0x439016){if(_0x439016){return _0x439016[_0xaa30('0x7f')]();}return null;})['then'](respondWithResult(_0x73c665,null))[_0xaa30('0x27')](handleError(_0x73c665,null));};exports[_0xaa30('0x80')]=function(_0x2ebaa0,_0x3b0b3e,_0x420276){if(_0x2ebaa0[_0xaa30('0x5a')]['id']){delete _0x2ebaa0['body']['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x2ebaa0[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x3b0b3e,null))[_0xaa30('0x32')](function(_0x3afa1c){if(_0x3afa1c){_0x2ebaa0[_0xaa30('0x5a')]['MailAccountId']=_0x3afa1c['id'];return db['MailServerIn'][_0xaa30('0x5e')](_0x2ebaa0[_0xaa30('0x5a')]);}})[_0xaa30('0x32')](respondWithResult(_0x3b0b3e,null))[_0xaa30('0x27')](handleError(_0x3b0b3e,null));};exports[_0xaa30('0x81')]=function(_0xf61a64,_0x162810,_0x1a26ce){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0xf61a64[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x162810,null))[_0xaa30('0x32')](function(_0x3a40b2){if(_0x3a40b2){return _0x3a40b2[_0xaa30('0x82')](null);}return null;})[_0xaa30('0x32')](respondWithStatusCode(_0x162810,null))[_0xaa30('0x27')](handleError(_0x162810,null));};exports[_0xaa30('0x83')]=function(_0x3c4df3,_0x25c239,_0x3174f6){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x3c4df3[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25c239,null))[_0xaa30('0x32')](function(_0x17ca14){if(_0x17ca14){return _0x17ca14[_0xaa30('0x83')]();}return null;})['then'](respondWithResult(_0x25c239,null))['catch'](handleError(_0x25c239,null));};exports[_0xaa30('0x84')]=function(_0x5a756f,_0x23c31e,_0x483991){if(_0x5a756f[_0xaa30('0x5a')]['id']){delete _0x5a756f[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x5a756f['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x23c31e,null))[_0xaa30('0x32')](function(_0x4521a4){if(_0x4521a4){_0x5a756f[_0xaa30('0x5a')]['MailAccountId']=_0x4521a4['id'];return db[_0xaa30('0x3c')]['create'](_0x5a756f[_0xaa30('0x5a')]);}})['then'](respondWithResult(_0x23c31e,null))[_0xaa30('0x27')](handleError(_0x23c31e,null));};exports[_0xaa30('0x85')]=function(_0x5feb07,_0x536eae,_0x2d8b6d){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x5feb07['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x536eae,null))['then'](function(_0x2632a7){if(_0x2632a7){return _0x2632a7[_0xaa30('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x536eae,null))[_0xaa30('0x27')](handleError(_0x536eae,null));};exports['addInteraction']=function(_0x397d88,_0x3a4f24,_0x58b8fe){return db[_0xaa30('0x87')][_0xaa30('0x59')]({'where':{'id':_0x397d88[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x3a4f24,null))[_0xaa30('0x32')](function(_0x1af8ef){if(_0x1af8ef){return _0x1af8ef[_0xaa30('0x88')](_0x397d88[_0xaa30('0x5a')]['ids'],_[_0xaa30('0x89')](_0x397d88['body'],[_0xaa30('0x8a'),'id'])||{});}})['then'](respondWithResult(_0x3a4f24,null))[_0xaa30('0x27')](handleError(_0x3a4f24,null));};exports['getInteractions']=function(_0x5253ab,_0xe20fd0,_0x22093c){var _0x329c69={'raw':![],'where':{}};var _0x2dab91={};var _0x53db5a={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x5253ab[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0xe20fd0,null))[_0xaa30('0x32')](function(_0x449bad){if(_0x449bad){_0x2dab91[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x87')]['rawAttributes']);_0x2dab91[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x5253ab[_0xaa30('0x42')]);_0x2dab91[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x2dab91[_0xaa30('0x40')],_0x2dab91[_0xaa30('0x42')]);_0x329c69[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x2dab91[_0xaa30('0x40')],qs['fields'](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x45')]));_0x329c69[_0xaa30('0x44')]=_0x329c69['attributes'][_0xaa30('0x69')]?_0x329c69['attributes']:_0x2dab91[_0xaa30('0x40')];if(!_0x5253ab['query']['hasOwnProperty']('nolimit')){_0x329c69[_0xaa30('0x2d')]=qs['limit'](_0x5253ab[_0xaa30('0x42')]['limit']);_0x329c69[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x329c69[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x48')]);_0x329c69[_0xaa30('0x53')]=qs['filters'](_[_0xaa30('0x4a')](_0x5253ab[_0xaa30('0x42')],_0x2dab91[_0xaa30('0x49')]));_0x329c69[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x449bad['id'];if(_0x5253ab[_0xaa30('0x42')]['filter']){_0x329c69[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x329c69[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x329c69[_0xaa30('0x44')],function(_0x1f941c){var _0x123328={};_0x123328[_0x1f941c]={'$like':'%'+_0x5253ab[_0xaa30('0x42')]['filter']+'%'};return _0x123328;})});}_0x329c69=_[_0xaa30('0x4b')]({},_0x329c69,_0x5253ab[_0xaa30('0x52')]);return db[_0xaa30('0x87')][_0xaa30('0x2b')]({'where':_0x329c69[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x22daa4){_0x53db5a[_0xaa30('0x2b')]=_0x22daa4;if(_0x5253ab['query'][_0xaa30('0x58')]){_0x329c69[_0xaa30('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xaa30('0x8b')],'as':'Owner','attributes':[_0xaa30('0x6a'),'fullname','internal'],'required':![]},{'model':db[_0xaa30('0x8c')],'as':'Tags','attributes':['id',_0xaa30('0x6a'),_0xaa30('0x8d')],'where':_0x5253ab['query']['tag']?{'id':_0x5253ab[_0xaa30('0x42')]['tag']}:undefined,'required':_0x5253ab[_0xaa30('0x42')][_0xaa30('0x8e')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x329c69);})[_0xaa30('0x32')](function(_0xcea48e){_0x53db5a[_0xaa30('0x55')]=_0xcea48e;return _0x53db5a;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0xe20fd0,_0x329c69))[_0xaa30('0x27')](handleError(_0xe20fd0,null));};exports[_0xaa30('0x8f')]=function(_0x2a258c,_0x9d7892,_0x301e6f){return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x2a258c['params']['id']}})['then'](handleEntityNotFound(_0x9d7892,null))[_0xaa30('0x32')](function(_0xd69c50){if(_0xd69c50){return db[_0xaa30('0x90')][_0xaa30('0x91')](function(_0xcf5d37){return db[_0xaa30('0x92')]['destroy']({'where':{'MailAccountId':_0x2a258c['params']['id']},'transaction':_0xcf5d37})[_0xaa30('0x32')](function(_0x38bdc4){var _0xd2d083=_['map'](_0x2a258c[_0xaa30('0x5a')],function(_0x4672a4){_0x4672a4[_0xaa30('0x5d')]=_0x2a258c['params']['id'];return _0x4672a4;});return db[_0xaa30('0x92')][_0xaa30('0x93')](_0xd2d083,{'transaction':_0xcf5d37});});})[_0xaa30('0x32')](function(){return db[_0xaa30('0x92')]['findAndCountAll']({'where':{'MailAccountId':_0x2a258c[_0xaa30('0x5b')]['id']},'order':_0xaa30('0x94')});});}})['then'](respondWithResult(_0x9d7892,null))[_0xaa30('0x27')](handleError(_0x9d7892,null));};exports[_0xaa30('0x95')]=function(_0x592619,_0xa76565,_0x2ee683){var _0x1ea804={};var _0x5738a0={};var _0x488dcf;var _0x1bc85b;return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x592619[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0xa76565,null))[_0xaa30('0x32')](function(_0x45d1d6){if(_0x45d1d6){_0x488dcf=_0x45d1d6;_0x5738a0[_0xaa30('0x40')]=_[_0xaa30('0x41')](db['MailApplication']['rawAttributes']);_0x5738a0[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x592619[_0xaa30('0x42')]);_0x5738a0[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x5738a0['model'],_0x5738a0[_0xaa30('0x42')]);_0x1ea804[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x5738a0['model'],qs[_0xaa30('0x45')](_0x592619[_0xaa30('0x42')][_0xaa30('0x45')]));_0x1ea804[_0xaa30('0x44')]=_0x1ea804[_0xaa30('0x44')][_0xaa30('0x69')]?_0x1ea804[_0xaa30('0x44')]:_0x5738a0[_0xaa30('0x40')];_0x1ea804[_0xaa30('0x47')]=qs['sort'](_0x592619[_0xaa30('0x42')]['sort']);_0x1ea804[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x592619[_0xaa30('0x42')],_0x5738a0[_0xaa30('0x49')]));if(_0x592619[_0xaa30('0x42')][_0xaa30('0x51')]){_0x1ea804['where']=_[_0xaa30('0x4b')](_0x1ea804[_0xaa30('0x53')],{'$or':_['map'](_0x1ea804[_0xaa30('0x44')],function(_0x15dfac){var _0x2b9f8b={};_0x2b9f8b[_0x15dfac]={'$like':'%'+_0x592619[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x2b9f8b;})});}_0x1ea804=_[_0xaa30('0x4b')]({},_0x1ea804,_0x592619[_0xaa30('0x52')]);return _0x488dcf['getApplications'](_0x1ea804);}})[_0xaa30('0x32')](function(_0x131227){if(_0x131227){_0x1bc85b=_0x131227['length'];if(!_0x592619[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x1ea804[_0xaa30('0x2d')]=qs['limit'](_0x592619[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x1ea804[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x592619[_0xaa30('0x42')]['offset']);}return _0x488dcf[_0xaa30('0x95')](_0x1ea804);}})['then'](function(_0x4ba244){if(_0x4ba244){return _0x4ba244?{'count':_0x1bc85b,'rows':_0x4ba244}:null;}})[_0xaa30('0x32')](respondWithResult(_0xa76565,null))['catch'](handleError(_0xa76565,null));};exports['getMessages']=function(_0x1216f9,_0x44fe23,_0x79fcc9){var _0x4228fc={'raw':!![],'where':{}};var _0x8aec1f={};var _0x569b70={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x1216f9['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x44fe23,null))[_0xaa30('0x32')](function(_0x1ba4b6){if(_0x1ba4b6){_0x8aec1f[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x96')][_0xaa30('0x61')]);_0x8aec1f['query']=_[_0xaa30('0x41')](_0x1216f9[_0xaa30('0x42')]);_0x8aec1f[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x8aec1f[_0xaa30('0x40')],_0x8aec1f['query']);_0x4228fc['attributes']=_['intersection'](_0x8aec1f['model'],qs[_0xaa30('0x45')](_0x1216f9[_0xaa30('0x42')][_0xaa30('0x45')]));_0x4228fc[_0xaa30('0x44')]=_0x4228fc[_0xaa30('0x44')]['length']?_0x4228fc[_0xaa30('0x44')]:_0x8aec1f[_0xaa30('0x40')];if(!_0x1216f9[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x4228fc[_0xaa30('0x2d')]=qs['limit'](_0x1216f9['query'][_0xaa30('0x2d')]);_0x4228fc['offset']=qs[_0xaa30('0x2c')](_0x1216f9['query'][_0xaa30('0x2c')]);}_0x4228fc[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x1216f9[_0xaa30('0x42')][_0xaa30('0x48')]);_0x4228fc['where']=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x1216f9[_0xaa30('0x42')],_0x8aec1f[_0xaa30('0x49')]));_0x4228fc[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x1ba4b6['id'];if(_0x1216f9['query'][_0xaa30('0x51')]){_0x4228fc[_0xaa30('0x53')]=_['merge'](_0x4228fc[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x4228fc[_0xaa30('0x44')],function(_0x29abb5){var _0x161b45={};_0x161b45[_0x29abb5]={'$like':'%'+_0x1216f9[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x161b45;})});}if(_0x1216f9[_0xaa30('0x42')][_0xaa30('0x97')]){var _0x12c0b7=_0x1216f9[_0xaa30('0x42')][_0xaa30('0x97')][_0xaa30('0x98')](',');var _0x58147b={};_0x58147b[_0x12c0b7[0x0]]={'$gte':moment(_0x12c0b7[0x1])[_0xaa30('0x99')](_0xaa30('0x9a'))};_0x4228fc[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x4228fc[_0xaa30('0x53')],_0x58147b);}_0x4228fc=_['merge']({},_0x4228fc,_0x1216f9['options']);return db['MailMessage'][_0xaa30('0x2b')]({'where':_0x4228fc[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x2d4c66){_0x569b70[_0xaa30('0x2b')]=_0x2d4c66;if(_0x1216f9[_0xaa30('0x42')][_0xaa30('0x58')]){_0x4228fc[_0xaa30('0x54')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4228fc);})[_0xaa30('0x32')](function(_0x16583e){_0x569b70[_0xaa30('0x55')]=_0x16583e;return _0x569b70;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x44fe23,_0x4228fc))[_0xaa30('0x27')](handleError(_0x44fe23,null));};exports[_0xaa30('0x38')]=function(_0x3c0a6a,_0x478a2f,_0x40d756){var _0x43e1c1,_0x249cdc={},_0x16e6e1;if(_0x3c0a6a[_0xaa30('0x5a')]['to']){_0x16e6e1=_0x3c0a6a[_0xaa30('0x5a')]['to'][_0xaa30('0x98')](',')[0x0];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x3c0a6a[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x9b')],'as':_0xaa30('0x9c'),'include':[{'model':db[_0xaa30('0x9d')],'as':_0xaa30('0x9e'),'where':{'email':_0x16e6e1},'limit':0x1,'order':[[_0xaa30('0x9f'),_0xaa30('0xa0')]]}]},{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57'),'raw':!![]}]})[_0xaa30('0x32')](handleEntityNotFound(_0x478a2f,null))[_0xaa30('0x32')](function(_0x51ccc8){if(_0x51ccc8){_0x43e1c1=_0x51ccc8;if(_0x51ccc8[_0xaa30('0x57')]){if(_[_0xaa30('0x6e')](_0x3c0a6a['body'][_0xaa30('0xa1')])){_0x3c0a6a[_0xaa30('0x5a')]['from']=util[_0xaa30('0x99')]('%s\x20<%s>',_0x51ccc8[_0xaa30('0x6a')],_0x51ccc8[_0xaa30('0x6b')]||_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x71')]);}if(_0x3c0a6a['body'][_0xaa30('0xa2')]&&_0x3c0a6a['body'][_0xaa30('0xa2')]['length']){for(var _0x242176=0x0;_0x242176<_0x3c0a6a['body']['attachments'][_0xaa30('0x69')];_0x242176+=0x1){_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176]={'filename':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176]['name'],'path':path[_0xaa30('0xa3')](config['root'],_0xaa30('0xa4'),_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176][_0xaa30('0xa5')])};}}var _0x460d3c={'tls':{'rejectUnauthorized':![]}};if(_[_0xaa30('0x6e')](_0x51ccc8['Smtp'][_0xaa30('0x77')])){if(_0x51ccc8[_0xaa30('0x57')][_0xaa30('0xa6')]){_0x460d3c[_0xaa30('0xa7')]={'user':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x71')],'pass':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x74')]};}_0x460d3c[_0xaa30('0x75')]=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x75')];_0x460d3c[_0xaa30('0x76')]=_0x51ccc8[_0xaa30('0x57')]['port'];_0x460d3c['secure']=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0xa8')];}else{_0x460d3c[_0xaa30('0x77')]=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x77')];_0x460d3c[_0xaa30('0xa7')]={'user':_0x51ccc8['Smtp'][_0xaa30('0x71')],'pass':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x74')]};}return respondWithRpcPromise(_0xaa30('0xa9'),_0xaa30('0xaa'),{'account':_0x460d3c,'message':_0x3c0a6a['body']});}else{throw new Error(_0xaa30('0xab'));}}})[_0xaa30('0x32')](function(_0x5065f1){if(_0x5065f1){_0x249cdc=_0x5065f1;if(_0x43e1c1[_0xaa30('0x9c')]){if(_0x43e1c1[_0xaa30('0x9c')][_0xaa30('0x9e')]['length']){return _0x43e1c1[_0xaa30('0x9c')]['Contacts'][0x0];}else{return db[_0xaa30('0x9d')][_0xaa30('0x5e')](_['defaults'](_0x3c0a6a[_0xaa30('0x5a')],{'firstName':_0x3c0a6a[_0xaa30('0x5a')]['to'],'email':_0x3c0a6a[_0xaa30('0x5a')]['to'],'phone':_0x3c0a6a['body']['to'],'ListId':_0x43e1c1[_0xaa30('0x6c')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xaa30('0x32')](function(_0x389772){if(_0x389772){var _0x361f53={'UserId':_0x3c0a6a[_0xaa30('0x71')]['id'],'ContactId':_0x389772['id'],'MailAccountId':_0x43e1c1['id'],'inReplyTo':_0x249cdc[_0xaa30('0xac')],'to':_0x3c0a6a['body'][_0xaa30('0xa1')],'cc':_0x3c0a6a[_0xaa30('0x5a')]['cc'],'subject':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xad')],'attach':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xae')],'firstMsgDirection':_0xaa30('0xaf'),'lastMsgAt':moment()[_0xaa30('0x99')](_0xaa30('0x9a')),'lastMsgDirection':_0xaa30('0xaf'),'lastMsgBody':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0x5a')],'Messages':[_['merge'](_0x3c0a6a[_0xaa30('0x5a')],{'messageId':_0x249cdc[_0xaa30('0xac')],'sentAt':moment()['format'](_0xaa30('0x9a')),'read':!![],'MailAccountId':_0x43e1c1['id'],'UserId':_0x3c0a6a[_0xaa30('0x71')]['id'],'ContactId':_0x389772['id']})]};if(_0x3c0a6a['body']['Interaction']){_0x361f53=_['merge'](_0x361f53,_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xb0')]);}return db[_0xaa30('0x87')][_0xaa30('0x5e')](_0x361f53,{'include':[{'model':db['MailMessage'],'as':_0xaa30('0xb1')}]});}})[_0xaa30('0x32')](respondWithResult(_0x478a2f,null))[_0xaa30('0x27')](handleError(_0x478a2f,null));};exports[_0xaa30('0xb2')]=function(_0x2c8b64,_0xdaad2d,_0x9ed777){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x2c8b64[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57'),'raw':!![]}]})[_0xaa30('0x32')](handleEntityNotFound(_0xdaad2d,null))[_0xaa30('0x32')](function(_0x965a92){if(_0x965a92&&_0x965a92[_0xaa30('0x57')]){var _0x8d4e59={'id':_0x965a92['id'],'tls':{'rejectUnauthorized':![]}};if(_0x965a92['Smtp'][_0xaa30('0x77')]){_0x8d4e59[_0xaa30('0x77')]=_0x965a92['Smtp'][_0xaa30('0x77')];}else{_0x8d4e59['host']=_0x965a92[_0xaa30('0x57')][_0xaa30('0x75')];_0x8d4e59[_0xaa30('0x76')]=_0x965a92['Smtp'][_0xaa30('0x76')];_0x8d4e59[_0xaa30('0xa8')]=_0x965a92[_0xaa30('0x57')][_0xaa30('0xa8')];}if(_0x965a92[_0xaa30('0x57')][_0xaa30('0xa6')]){_0x8d4e59[_0xaa30('0xa7')]={'user':_0x965a92['Smtp'][_0xaa30('0x71')],'pass':_0x965a92[_0xaa30('0x57')]['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x8d4e59});}})[_0xaa30('0x32')](respondWithResult(_0xdaad2d,null))[_0xaa30('0x27')](handleError(_0xdaad2d,null));};exports[_0xaa30('0xb3')]=function(_0x1235fb,_0x21540d){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x1235fb['params']['id']}})['then'](handleEntityNotFound(_0x21540d,null))[_0xaa30('0x32')](function(_0x355e22){if(_0x355e22&&_0x355e22['service']){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x355e22;})[_0xaa30('0x32')](removeEntity(_0x21540d,null))[_0xaa30('0x27')](handleError(_0x21540d,null));};exports['addAgents']=function(_0x236319,_0x4a0607,_0x3b77eb){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x236319[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x4a0607,null))[_0xaa30('0x32')](function(_0x312c94){if(_0x312c94){return _0x312c94[_0xaa30('0xb4')](_0x236319['body']['ids'],_[_0xaa30('0x89')](_0x236319['body'],[_0xaa30('0x8a'),'id'])||{})['spread'](function(_0x41f17f){for(var _0xabacee=0x0;_0xabacee<_0x236319[_0xaa30('0x5a')]['ids']['length'];_0xabacee+=0x1){socket[_0xaa30('0xb5')](_0xaa30('0xb6'),{'UserId':_0x236319[_0xaa30('0x5a')]['ids'][_0xabacee],'MailAccountId':_0x236319[_0xaa30('0x5b')]['id']});}return _0x41f17f;});}})['then'](respondWithResult(_0x4a0607,null))[_0xaa30('0x27')](handleError(_0x4a0607,null));};exports['removeAgents']=function(_0x1703f2,_0x416f4d,_0xcd26df){return db['MailAccount'][_0xaa30('0x59')]({'where':{'id':_0x1703f2[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x416f4d,null))[_0xaa30('0x32')](function(_0x425865){if(_0x425865){return _0x425865[_0xaa30('0xb7')](_0x1703f2['query'][_0xaa30('0x8a')])[_0xaa30('0x32')](function(){if(_[_0xaa30('0xb8')](_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')])){for(var _0x21048c=0x0;_0x21048c<_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')][_0xaa30('0x69')];_0x21048c+=0x1){socket[_0xaa30('0xb5')]('userMailAccount:remove',{'UserId':Number(_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')][_0x21048c]),'MailAccountId':Number(_0x1703f2[_0xaa30('0x5b')]['id'])});}}else{socket[_0xaa30('0xb5')](_0xaa30('0xb9'),{'UserId':Number(_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')]),'MailAccountId':Number(_0x1703f2[_0xaa30('0x5b')]['id'])});}});}})[_0xaa30('0x32')](respondWithStatusCode(_0x416f4d,null))[_0xaa30('0x27')](handleError(_0x416f4d,null));};exports['getAgents']=function(_0x49d8fa,_0x430607,_0x11f771){var _0x4b20cd={};var _0x3a2449={};var _0x164c78;var _0xd182cc;return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x49d8fa[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x430607,null))[_0xaa30('0x32')](function(_0xf9158b){if(_0xf9158b){_0x164c78=_0xf9158b;_0x3a2449['model']=_['keys'](db[_0xaa30('0x8b')]['rawAttributes']);_0x3a2449['query']=_['keys'](_0x49d8fa[_0xaa30('0x42')]);_0x3a2449[_0xaa30('0x49')]=_['intersection'](_0x3a2449[_0xaa30('0x40')],_0x3a2449['query']);_0x4b20cd[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x3a2449[_0xaa30('0x40')],qs['fields'](_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x45')]));_0x4b20cd[_0xaa30('0x44')]=_0x4b20cd[_0xaa30('0x44')][_0xaa30('0x69')]?_0x4b20cd[_0xaa30('0x44')]:_0x3a2449[_0xaa30('0x40')];_0x4b20cd[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x49d8fa[_0xaa30('0x42')]['sort']);_0x4b20cd[_0xaa30('0x53')]=qs['filters'](_[_0xaa30('0x4a')](_0x49d8fa[_0xaa30('0x42')],_0x3a2449[_0xaa30('0x49')]));if(_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x51')]){_0x4b20cd[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x4b20cd['where'],{'$or':_[_0xaa30('0x4c')](_0x4b20cd[_0xaa30('0x44')],function(_0x2d6171){var _0x3555cf={};_0x3555cf[_0x2d6171]={'$like':'%'+_0x49d8fa['query'][_0xaa30('0x51')]+'%'};return _0x3555cf;})});}_0x4b20cd=_[_0xaa30('0x4b')]({},_0x4b20cd,_0x49d8fa[_0xaa30('0x52')]);return _0x164c78[_0xaa30('0xba')](_0x4b20cd);}})[_0xaa30('0x32')](function(_0x3d50d0){if(_0x3d50d0){_0xd182cc=_0x3d50d0[_0xaa30('0x69')];if(!_0x49d8fa['query'][_0xaa30('0x62')](_0xaa30('0x46'))){_0x4b20cd[_0xaa30('0x2d')]=qs[_0xaa30('0x2d')](_0x49d8fa['query'][_0xaa30('0x2d')]);_0x4b20cd[_0xaa30('0x2c')]=qs['offset'](_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x2c')]);}return _0x164c78['getAgents'](_0x4b20cd);}})[_0xaa30('0x32')](function(_0x5bc808){if(_0x5bc808){return _0x5bc808?{'count':_0xd182cc,'rows':_0x5bc808}:null;}})[_0xaa30('0x32')](respondWithResult(_0x430607,null))[_0xaa30('0x27')](handleError(_0x430607,null));}; \ No newline at end of file +var _0x6d5e=['port','host','service','cuser','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Owner','internal','Tag','tag','addApplications','sequelize','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','CmContact','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','request','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set','apply','reject','update','then','MailAccounts','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','body','describe','addDisposition','getDispositions','findOne','Disposition','sort','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','order','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','password','pass','cpassword','authentication'];(function(_0x501401,_0x2d8737){var _0xfd0a47=function(_0x57decb){while(--_0x57decb){_0x501401['push'](_0x501401['shift']());}};_0xfd0a47(++_0x2d8737);}(_0x6d5e,0x103));var _0xe6d5=function(_0x3866ac,_0x1d470f){_0x3866ac=_0x3866ac-0x0;var _0x5ce7b2=_0x6d5e[_0x3866ac];return _0x5ce7b2;};'use strict';var pdf=require(_0xe6d5('0x0'));var emlformat=require(_0xe6d5('0x1'));var rimraf=require(_0xe6d5('0x2'));var zipdir=require(_0xe6d5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6d5('0x4'));var moment=require(_0xe6d5('0x5'));var BPromise=require(_0xe6d5('0x6'));var Mustache=require(_0xe6d5('0x7'));var util=require(_0xe6d5('0x8'));var path=require(_0xe6d5('0x9'));var sox=require(_0xe6d5('0xa'));var csv=require('to-csv');var ejs=require(_0xe6d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6d5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6d5('0xd'));var Papa=require(_0xe6d5('0xe'));var Redis=require(_0xe6d5('0xf'));var authService=require(_0xe6d5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe6d5('0x11'));var logger=require(_0xe6d5('0x12'))(_0xe6d5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe6d5('0x14'))['db'];config[_0xe6d5('0x15')]=_[_0xe6d5('0x16')](config[_0xe6d5('0x15')],{'host':_0xe6d5('0x17'),'port':0x18eb});var socket=require(_0xe6d5('0x18'))(new Redis(config[_0xe6d5('0x15')]));require('./mailAccount.socket')[_0xe6d5('0x19')](socket);var jayson=require(_0xe6d5('0x1a'));var client=jayson[_0xe6d5('0x1b')][_0xe6d5('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x88b75e,_0x42f2ba,_0x35599f){if(_0x35599f){var _0x37ff40=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37ff40[_0xe6d5('0x1d')](_0x42f2ba)){return _0x88b75e;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x88b75e;}}function respondWithRpcPromise(_0x2a8aa7,_0x2adb34,_0x268ced,_0x4ecc63){return new BPromise(function(_0x3847d1,_0xf0a8bf){var _0x5f5d7a=_0x4ecc63||client;return _0x5f5d7a[_0xe6d5('0x1e')](_0x2a8aa7,_0x268ced)['then'](function(_0x3d4fb7){logger['info']('MailAccount,\x20%s,\x20%s',_0x2adb34,_0xe6d5('0x1f'));logger['debug'](_0xe6d5('0x20'),_0x2adb34,_0xe6d5('0x1f'),JSON[_0xe6d5('0x21')](_0x3d4fb7));if(_0x3d4fb7['error']){if(_0x3d4fb7['error'][_0xe6d5('0x22')]===0x1f4){logger[_0xe6d5('0x23')](_0xe6d5('0x24'),_0x2adb34,_0x3d4fb7[_0xe6d5('0x23')][_0xe6d5('0x25')]);return _0xf0a8bf(_0x3d4fb7['error'][_0xe6d5('0x25')]);}logger[_0xe6d5('0x23')]('MailAccount,\x20%s,\x20%s',_0x2adb34,_0x3d4fb7[_0xe6d5('0x23')][_0xe6d5('0x25')]);return _0x3847d1(_0x3d4fb7[_0xe6d5('0x23')]['message']);}else{logger[_0xe6d5('0x26')](_0xe6d5('0x24'),_0x2adb34,_0xe6d5('0x1f'));_0x3847d1(_0x3d4fb7[_0xe6d5('0x27')][_0xe6d5('0x25')]);}})[_0xe6d5('0x28')](function(_0x1e6a36){logger[_0xe6d5('0x23')]('MailAccount,\x20%s,\x20%s',_0x2adb34,_0x1e6a36);_0xf0a8bf(_0x1e6a36);});});}function respondWithStatusCode(_0x347343,_0x210b00){_0x210b00=_0x210b00||0xcc;return function(_0x24fe6a){if(_0x24fe6a){return _0x347343[_0xe6d5('0x29')](_0x210b00);}return _0x347343['status'](_0x210b00)[_0xe6d5('0x2a')]();};}function respondWithResult(_0x4a4b27,_0x21ba91){_0x21ba91=_0x21ba91||0xc8;return function(_0x20e1b4){if(_0x20e1b4){return _0x4a4b27['status'](_0x21ba91)[_0xe6d5('0x2b')](_0x20e1b4);}};}function respondWithFilteredResult(_0x526786,_0x4377bc){return function(_0x1345d1){if(_0x1345d1){var _0x4247f5=_0x1345d1[_0xe6d5('0x2c')],_0x1feccd=_0x4377bc['offset'],_0x331449=_0x4377bc[_0xe6d5('0x2d')]+_0x4377bc[_0xe6d5('0x2e')],_0x4754a8;if(_0x331449>=_0x4247f5){_0x331449=_0x4247f5;_0x4754a8=0xc8;}else{_0x4754a8=0xce;}_0x526786[_0xe6d5('0x2f')](_0x4754a8);return _0x526786[_0xe6d5('0x30')]('Content-Range',_0x1feccd+'-'+_0x331449+'/'+_0x4247f5)[_0xe6d5('0x2b')](_0x1345d1);}return null;};}function patchUpdates(_0x2dbf1b){return function(_0x4f5c6a){try{jsonpatch[_0xe6d5('0x31')](_0x4f5c6a,_0x2dbf1b,!![]);}catch(_0x594a25){return BPromise[_0xe6d5('0x32')](_0x594a25);}return _0x4f5c6a['save']();};}function saveUpdates(_0x1f2fbf,_0x5354b0){return function(_0x12f3b0){if(_0x12f3b0){return _0x12f3b0[_0xe6d5('0x33')](_0x1f2fbf)[_0xe6d5('0x34')](function(_0x14960b){return _0x14960b;});}return null;};}function removeEntity(_0x556198,_0x276e32){return function(_0x350441){if(_0x350441){return _0x350441['destroy']()[_0xe6d5('0x34')](function(){var _0x38c757=_0x350441['get']({'plain':!![]});var _0x2663ab=_0xe6d5('0x35');return db['UserProfileResource'][_0xe6d5('0x36')]({'where':{'type':_0x2663ab,'resourceId':_0x38c757['id']}})[_0xe6d5('0x34')](function(){return _0x350441;});})[_0xe6d5('0x34')](function(){_0x556198[_0xe6d5('0x2f')](0xcc)[_0xe6d5('0x2a')]();});}};}function handleEntityNotFound(_0x15e4ce,_0x22a229){return function(_0x2fb0c6){if(!_0x2fb0c6){_0x15e4ce['sendStatus'](0x194);}return _0x2fb0c6;};}function handleError(_0x4b4136,_0x7ce9c6){_0x7ce9c6=_0x7ce9c6||0x1f4;return function(_0x3d625f){logger[_0xe6d5('0x23')](_0x3d625f[_0xe6d5('0x37')]);if(_0x3d625f[_0xe6d5('0x38')]){delete _0x3d625f[_0xe6d5('0x38')];}_0x4b4136[_0xe6d5('0x2f')](_0x7ce9c6)[_0xe6d5('0x39')](_0x3d625f);};}exports[_0xe6d5('0x3a')]=function(_0x348b47,_0x2c1eb9){var _0xc4d65c={'include':[{'model':db[_0xe6d5('0x3b')],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]},_0x32bce5={},_0x2e8175={'count':0x0,'rows':[]};var _0x3576da=db[_0xe6d5('0x41')][_0xe6d5('0x42')];_0x32bce5[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](_0x3576da);_0x32bce5['query']=_[_0xe6d5('0x44')](_0x348b47[_0xe6d5('0x45')]);_0x32bce5[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x32bce5[_0xe6d5('0x43')],_0x32bce5[_0xe6d5('0x45')]);_0xc4d65c[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x32bce5[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x348b47['query']['fields']));_0xc4d65c[_0xe6d5('0x48')]=_0xc4d65c['attributes']['length']?_0xc4d65c[_0xe6d5('0x48')]:_0x32bce5[_0xe6d5('0x43')];if(!_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0xc4d65c[_0xe6d5('0x2e')]=qs['limit'](_0x348b47[_0xe6d5('0x45')]['limit']);_0xc4d65c[_0xe6d5('0x2d')]=qs[_0xe6d5('0x2d')](_0x348b47['query'][_0xe6d5('0x2d')]);}_0xc4d65c['order']=qs['sort'](_0x348b47[_0xe6d5('0x45')]['sort']);_0xc4d65c[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x348b47['query'],_0x32bce5[_0xe6d5('0x46')]));if(_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0xc4d65c[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0xc4d65c['where'],{'$or':_[_0xe6d5('0x50')](_0x3576da,function(_0x2a04fa){if(_0x2a04fa[_0xe6d5('0x51')]['key']!==_0xe6d5('0x52')){var _0xc696ca={};_0xc696ca[_0x2a04fa['field']]={'$like':'%'+_0x348b47[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0xc696ca;}})});}_0xc4d65c=_[_0xe6d5('0x4f')]({},_0xc4d65c,_0x348b47[_0xe6d5('0x53')]);var _0x5a9fd7={'where':_0xc4d65c['where']};return db['MailAccount'][_0xe6d5('0x2c')](_0x5a9fd7)[_0xe6d5('0x34')](function(_0x1a26da){_0x2e8175[_0xe6d5('0x2c')]=_0x1a26da;if(_0x348b47[_0xe6d5('0x45')]['includeAll']){_0xc4d65c[_0xe6d5('0x54')]=[{'all':!![]}];}return db[_0xe6d5('0x41')][_0xe6d5('0x55')](_0xc4d65c);})['then'](function(_0x1d5281){_0x2e8175[_0xe6d5('0x56')]=_0x1d5281;return _0x2e8175;})[_0xe6d5('0x34')](respondWithFilteredResult(_0x2c1eb9,_0xc4d65c))[_0xe6d5('0x28')](handleError(_0x2c1eb9,null));};exports[_0xe6d5('0x57')]=function(_0x56182e,_0x440d9d){var _0x137b77={'raw':![],'where':{'id':_0x56182e[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x3b')],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]},_0x49f3d9={};_0x49f3d9['model']=_[_0xe6d5('0x44')](db['MailAccount'][_0xe6d5('0x42')]);_0x49f3d9[_0xe6d5('0x45')]=_['keys'](_0x56182e[_0xe6d5('0x45')]);_0x49f3d9['filters']=_[_0xe6d5('0x47')](_0x49f3d9[_0xe6d5('0x43')],_0x49f3d9[_0xe6d5('0x45')]);_0x137b77['attributes']=_[_0xe6d5('0x47')](_0x49f3d9['model'],qs[_0xe6d5('0x49')](_0x56182e[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x137b77['attributes']=_0x137b77[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x137b77[_0xe6d5('0x48')]:_0x49f3d9[_0xe6d5('0x43')];if(_0x56182e[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x137b77[_0xe6d5('0x54')]=[{'all':!![]}];}_0x137b77=_[_0xe6d5('0x4f')]({},_0x137b77,_0x56182e[_0xe6d5('0x53')]);return db['MailAccount'][_0xe6d5('0x5b')](_0x137b77)['then'](handleEntityNotFound(_0x440d9d,null))[_0xe6d5('0x34')](respondWithResult(_0x440d9d,null))[_0xe6d5('0x28')](handleError(_0x440d9d,null));};exports[_0xe6d5('0x33')]=function(_0x4ceed9,_0x77ca12){if(_0x4ceed9['body']['id']){delete _0x4ceed9[_0xe6d5('0x5c')]['id'];}return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x4ceed9['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xe6d5('0x3c')},{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db[_0xe6d5('0x3f')],'as':_0xe6d5('0x40')}]})[_0xe6d5('0x34')](handleEntityNotFound(_0x77ca12,null))[_0xe6d5('0x34')](saveUpdates(_0x4ceed9['body'],null))[_0xe6d5('0x34')](function(_0x4b1ab4){if(_0x4b1ab4&&_0x4ceed9['body']['Imap']){return db['MailServerIn'][_0xe6d5('0x33')](_0x4ceed9[_0xe6d5('0x5c')]['Imap'],{'where':{'MailAccountId':_0x4b1ab4['id']}})[_0xe6d5('0x34')](function(){return _0x4b1ab4;});}return _0x4b1ab4;})[_0xe6d5('0x34')](function(_0x441b32){if(_0x441b32&&_0x4ceed9['body'][_0xe6d5('0x3e')]){return db[_0xe6d5('0x3d')]['update'](_0x4ceed9[_0xe6d5('0x5c')][_0xe6d5('0x3e')],{'where':{'MailAccountId':_0x441b32['id']}})[_0xe6d5('0x34')](function(){return _0x441b32;});}return _0x441b32;})['then'](respondWithResult(_0x77ca12,null))[_0xe6d5('0x28')](handleError(_0x77ca12,null));};exports['describe']=function(_0x2a326f,_0x2d34b9){return db[_0xe6d5('0x41')][_0xe6d5('0x5d')]()[_0xe6d5('0x34')](respondWithResult(_0x2d34b9,null))[_0xe6d5('0x28')](handleError(_0x2d34b9,null));};exports[_0xe6d5('0x5e')]=function(_0x2a1bb2,_0x298116,_0x381797){if(_0x2a1bb2[_0xe6d5('0x5c')]['id']){delete _0x2a1bb2[_0xe6d5('0x5c')]['id'];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x2a1bb2['params']['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x298116,null))[_0xe6d5('0x34')](function(_0x4521b7){if(_0x4521b7){_0x2a1bb2['body']['MailAccountId']=_0x4521b7['id'];return db['Disposition']['create'](_0x2a1bb2['body']);}})[_0xe6d5('0x34')](respondWithResult(_0x298116,null))[_0xe6d5('0x28')](handleError(_0x298116,null));};exports[_0xe6d5('0x5f')]=function(_0x1adfe1,_0x1e21c9,_0x2f7827){var _0x40e8ba={'raw':![],'where':{}};var _0x20431d={};var _0x4a9b21={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x1adfe1[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x1e21c9,null))['then'](function(_0x167a0c){if(_0x167a0c){_0x20431d['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x61')]['rawAttributes']);_0x20431d[_0xe6d5('0x45')]=_['keys'](_0x1adfe1[_0xe6d5('0x45')]);_0x20431d[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x20431d[_0xe6d5('0x43')],_0x20431d['query']);_0x40e8ba[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x20431d['model'],qs[_0xe6d5('0x49')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x40e8ba[_0xe6d5('0x48')]=_0x40e8ba[_0xe6d5('0x48')]['length']?_0x40e8ba[_0xe6d5('0x48')]:_0x20431d[_0xe6d5('0x43')];if(!_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x40e8ba[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x40e8ba[_0xe6d5('0x2d')]=qs['offset'](_0x1adfe1['query'][_0xe6d5('0x2d')]);}_0x40e8ba['order']=qs[_0xe6d5('0x62')](_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x62')]);_0x40e8ba[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x1adfe1[_0xe6d5('0x45')],_0x20431d[_0xe6d5('0x46')]));_0x40e8ba['where'][_0xe6d5('0x63')]=_0x167a0c['id'];if(_0x1adfe1['query'][_0xe6d5('0x4e')]){_0x40e8ba[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x40e8ba['where'],{'$or':_['map'](_0x40e8ba[_0xe6d5('0x48')],function(_0x3cc66e){var _0x2f29c8={};_0x2f29c8[_0x3cc66e]={'$like':'%'+_0x1adfe1['query'][_0xe6d5('0x4e')]+'%'};return _0x2f29c8;})});}_0x40e8ba=_[_0xe6d5('0x4f')]({},_0x40e8ba,_0x1adfe1['options']);return db[_0xe6d5('0x61')][_0xe6d5('0x2c')]({'where':_0x40e8ba[_0xe6d5('0x4c')]})[_0xe6d5('0x34')](function(_0x5034c1){_0x4a9b21[_0xe6d5('0x2c')]=_0x5034c1;if(_0x1adfe1[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x40e8ba[_0xe6d5('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xe6d5('0x55')](_0x40e8ba);})[_0xe6d5('0x34')](function(_0x1126a8){_0x4a9b21[_0xe6d5('0x56')]=_0x1126a8;return _0x4a9b21;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0x1e21c9,_0x40e8ba))['catch'](handleError(_0x1e21c9,null));};exports[_0xe6d5('0x64')]=function(_0x5aad97,_0x32b3c3,_0x1ab6ca){return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x5aad97[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x32b3c3,null))['then'](function(_0x4bc6c6){if(_0x4bc6c6){return _0x4bc6c6[_0xe6d5('0x64')](_0x5aad97[_0xe6d5('0x45')][_0xe6d5('0x65')]);}})['then'](respondWithStatusCode(_0x32b3c3,null))['catch'](handleError(_0x32b3c3,null));};exports[_0xe6d5('0x66')]=function(_0x41bf18,_0x12ea3a,_0x1d7af0){if(_0x41bf18['body']['id']){delete _0x41bf18['body']['id'];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x41bf18[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x12ea3a,null))['then'](function(_0x1646f9){if(_0x1646f9){_0x41bf18[_0xe6d5('0x5c')][_0xe6d5('0x63')]=_0x1646f9['id'];return db[_0xe6d5('0x67')][_0xe6d5('0x68')](_0x41bf18[_0xe6d5('0x5c')]);}})['then'](respondWithResult(_0x12ea3a,null))[_0xe6d5('0x28')](handleError(_0x12ea3a,null));};exports[_0xe6d5('0x69')]=function(_0x291332,_0xe1ed34,_0x52cc47){var _0xb8ee1f={'raw':![],'where':{}};var _0x203cc9={};var _0x5a8b08={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x291332[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xe1ed34,null))['then'](function(_0x559ed5){if(_0x559ed5){_0x203cc9[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0x67')]['rawAttributes']);_0x203cc9[_0xe6d5('0x45')]=_['keys'](_0x291332['query']);_0x203cc9[_0xe6d5('0x46')]=_['intersection'](_0x203cc9[_0xe6d5('0x43')],_0x203cc9[_0xe6d5('0x45')]);_0xb8ee1f[_0xe6d5('0x48')]=_['intersection'](_0x203cc9[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x291332[_0xe6d5('0x45')]['fields']));_0xb8ee1f[_0xe6d5('0x48')]=_0xb8ee1f[_0xe6d5('0x48')]['length']?_0xb8ee1f[_0xe6d5('0x48')]:_0x203cc9[_0xe6d5('0x43')];if(!_0x291332[_0xe6d5('0x45')][_0xe6d5('0x4a')]('nolimit')){_0xb8ee1f[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x291332[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0xb8ee1f['offset']=qs['offset'](_0x291332['query'][_0xe6d5('0x2d')]);}_0xb8ee1f[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x291332[_0xe6d5('0x45')]['sort']);_0xb8ee1f[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x291332['query'],_0x203cc9[_0xe6d5('0x46')]));_0xb8ee1f[_0xe6d5('0x4c')]['MailAccountId']=_0x559ed5['id'];if(_0x291332['query'][_0xe6d5('0x4e')]){_0xb8ee1f['where']=_[_0xe6d5('0x4f')](_0xb8ee1f[_0xe6d5('0x4c')],{'$or':_[_0xe6d5('0x50')](_0xb8ee1f[_0xe6d5('0x48')],function(_0x43eafb){var _0x1e6c5c={};_0x1e6c5c[_0x43eafb]={'$like':'%'+_0x291332[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0x1e6c5c;})});}_0xb8ee1f=_[_0xe6d5('0x4f')]({},_0xb8ee1f,_0x291332['options']);return db[_0xe6d5('0x67')][_0xe6d5('0x2c')]({'where':_0xb8ee1f[_0xe6d5('0x4c')]})[_0xe6d5('0x34')](function(_0x5662fd){_0x5a8b08[_0xe6d5('0x2c')]=_0x5662fd;if(_0x291332['query'][_0xe6d5('0x5a')]){_0xb8ee1f[_0xe6d5('0x54')]=[{'all':!![]}];}return db[_0xe6d5('0x67')]['findAll'](_0xb8ee1f);})[_0xe6d5('0x34')](function(_0x1ac560){_0x5a8b08[_0xe6d5('0x56')]=_0x1ac560;return _0x5a8b08;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0xe1ed34,_0xb8ee1f))[_0xe6d5('0x28')](handleError(_0xe1ed34,null));};exports[_0xe6d5('0x6b')]=function(_0x4ccc92,_0x372d15,_0x1b163d){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x4ccc92[_0xe6d5('0x58')]['id']}})['then'](handleEntityNotFound(_0x372d15,null))[_0xe6d5('0x34')](function(_0x56845e){if(_0x56845e){return _0x56845e[_0xe6d5('0x6b')](_0x4ccc92['query'][_0xe6d5('0x65')]);}})[_0xe6d5('0x34')](respondWithStatusCode(_0x372d15,null))[_0xe6d5('0x28')](handleError(_0x372d15,null));};exports[_0xe6d5('0x68')]=function(_0x36b863,_0x1fc646){var _0x1cd1a5={'name':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x38')],'key':_0x36b863['body'][_0xe6d5('0x6c')],'email':_0x36b863['body'][_0xe6d5('0x6d')],'ListId':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x6e')],'active':!_[_0xe6d5('0x6f')](_0x36b863[_0xe6d5('0x5c')]['active'])?_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x70')]:!![],'description':_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xe6d5('0x6f')](_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x72')])){if(_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x73')]){_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x74')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x74')]=_0x36b863[_0xe6d5('0x5c')]['cuser'];_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x75')]=_0x1cd1a5['Smtp'][_0xe6d5('0x76')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x77')];}else{_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x78')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x78')]=![];}_0x1cd1a5[_0xe6d5('0x3c')]['host']=_0x36b863['body'][_0xe6d5('0x3c')]['host'];_0x1cd1a5['Imap']['port']=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x3c')][_0xe6d5('0x79')];_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x7a')]=_0x36b863[_0xe6d5('0x5c')]['Smtp'][_0xe6d5('0x7a')];_0x1cd1a5['Smtp'][_0xe6d5('0x79')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x3e')][_0xe6d5('0x79')];}else{_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x7b')]=_0x1cd1a5[_0xe6d5('0x3e')]['service']=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x72')];_0x1cd1a5[_0xe6d5('0x3c')]['user']=_0x1cd1a5['Smtp'][_0xe6d5('0x74')]=_0x36b863['body'][_0xe6d5('0x7c')];_0x1cd1a5[_0xe6d5('0x3c')][_0xe6d5('0x75')]=_0x1cd1a5[_0xe6d5('0x3e')][_0xe6d5('0x76')]=_0x36b863[_0xe6d5('0x5c')][_0xe6d5('0x77')];}return db[_0xe6d5('0x41')][_0xe6d5('0x68')](_0x1cd1a5,{'include':[{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e')},{'model':db['MailServerIn'],'as':_0xe6d5('0x3c')}]})[_0xe6d5('0x34')](function(_0x2b55ee){var _0x4d1db0=_0x36b863[_0xe6d5('0x74')][_0xe6d5('0x7d')]({'plain':!![]});if(!_0x4d1db0)throw new Error(_0xe6d5('0x7e'));if(_0x4d1db0[_0xe6d5('0x7f')]===_0xe6d5('0x74')){var _0x1de88e=_0x2b55ee[_0xe6d5('0x7d')]({'plain':!![]});return db[_0xe6d5('0x80')][_0xe6d5('0x5b')]({'where':{'name':_0xe6d5('0x35'),'userProfileId':_0x4d1db0['userProfileId']},'raw':!![]})['then'](function(_0x50857f){if(_0x50857f&&_0x50857f[_0xe6d5('0x81')]===0x0){return db[_0xe6d5('0x82')]['create']({'name':_0x1de88e[_0xe6d5('0x38')],'resourceId':_0x1de88e['id'],'type':_0x50857f['name'],'sectionId':_0x50857f['id']},{})[_0xe6d5('0x34')](function(){return _0x2b55ee;});}else{return _0x2b55ee;}})[_0xe6d5('0x28')](function(_0x5a4caa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a4caa);throw _0x5a4caa;});}return _0x2b55ee;})[_0xe6d5('0x34')](respondWithResult(_0x1fc646,0xc9))[_0xe6d5('0x28')](handleError(_0x1fc646,null));};exports[_0xe6d5('0x83')]=function(_0x42f00f,_0x3c5c4f,_0x2896fc){return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x42f00f[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x3c5c4f,null))[_0xe6d5('0x34')](function(_0x11a774){if(_0x11a774){return _0x11a774[_0xe6d5('0x83')]();}return null;})['then'](respondWithResult(_0x3c5c4f,null))[_0xe6d5('0x28')](handleError(_0x3c5c4f,null));};exports[_0xe6d5('0x84')]=function(_0x569043,_0x4c328a,_0x2262d6){if(_0x569043[_0xe6d5('0x5c')]['id']){delete _0x569043['body']['id'];}return db[_0xe6d5('0x41')]['find']({'where':{'id':_0x569043['params']['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x4c328a,null))['then'](function(_0x2de93a){if(_0x2de93a){_0x569043['body'][_0xe6d5('0x63')]=_0x2de93a['id'];return db['MailServerIn'][_0xe6d5('0x68')](_0x569043[_0xe6d5('0x5c')]);}})[_0xe6d5('0x34')](respondWithResult(_0x4c328a,null))['catch'](handleError(_0x4c328a,null));};exports[_0xe6d5('0x85')]=function(_0x55a61e,_0xa3b631,_0x3ace1b){return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x55a61e[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xa3b631,null))[_0xe6d5('0x34')](function(_0x13c9a7){if(_0x13c9a7){return _0x13c9a7[_0xe6d5('0x86')](null);}return null;})[_0xe6d5('0x34')](respondWithStatusCode(_0xa3b631,null))[_0xe6d5('0x28')](handleError(_0xa3b631,null));};exports[_0xe6d5('0x87')]=function(_0x309d55,_0x3fea0b,_0x21eda6){return db[_0xe6d5('0x41')]['findOne']({'where':{'id':_0x309d55[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x3fea0b,null))['then'](function(_0x321567){if(_0x321567){return _0x321567[_0xe6d5('0x87')]();}return null;})['then'](respondWithResult(_0x3fea0b,null))[_0xe6d5('0x28')](handleError(_0x3fea0b,null));};exports[_0xe6d5('0x88')]=function(_0x1b7b11,_0x5b097e,_0x599efd){if(_0x1b7b11['body']['id']){delete _0x1b7b11[_0xe6d5('0x5c')]['id'];}return db[_0xe6d5('0x41')]['find']({'where':{'id':_0x1b7b11[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x5b097e,null))[_0xe6d5('0x34')](function(_0x46e342){if(_0x46e342){_0x1b7b11[_0xe6d5('0x5c')][_0xe6d5('0x63')]=_0x46e342['id'];return db[_0xe6d5('0x3d')][_0xe6d5('0x68')](_0x1b7b11[_0xe6d5('0x5c')]);}})['then'](respondWithResult(_0x5b097e,null))['catch'](handleError(_0x5b097e,null));};exports[_0xe6d5('0x89')]=function(_0x48d48d,_0x8876,_0x4c3108){return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x48d48d[_0xe6d5('0x58')]['id']}})['then'](handleEntityNotFound(_0x8876,null))[_0xe6d5('0x34')](function(_0x47cde0){if(_0x47cde0){return _0x47cde0[_0xe6d5('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0x8876,null))[_0xe6d5('0x28')](handleError(_0x8876,null));};exports[_0xe6d5('0x8b')]=function(_0x5c6421,_0xf4f108,_0x209a1e){return db[_0xe6d5('0x8c')][_0xe6d5('0x5b')]({'where':{'id':_0x5c6421[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xf4f108,null))[_0xe6d5('0x34')](function(_0x361a64){if(_0x361a64){return _0x361a64[_0xe6d5('0x8b')](_0x5c6421[_0xe6d5('0x5c')]['ids'],_[_0xe6d5('0x8d')](_0x5c6421['body'],[_0xe6d5('0x65'),'id'])||{});}})['then'](respondWithResult(_0xf4f108,null))[_0xe6d5('0x28')](handleError(_0xf4f108,null));};exports[_0xe6d5('0x8e')]=function(_0x5ee4dd,_0x1c1b1b,_0x4650f0){var _0x66c6d2={'raw':![],'where':{}};var _0x2e0201={};var _0x23ea96={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x5ee4dd[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x1c1b1b,null))[_0xe6d5('0x34')](function(_0x2f3992){if(_0x2f3992){_0x2e0201[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0x8c')][_0xe6d5('0x42')]);_0x2e0201[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x5ee4dd[_0xe6d5('0x45')]);_0x2e0201[_0xe6d5('0x46')]=_['intersection'](_0x2e0201['model'],_0x2e0201['query']);_0x66c6d2['attributes']=_[_0xe6d5('0x47')](_0x2e0201['model'],qs['fields'](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x66c6d2['attributes']=_0x66c6d2[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x66c6d2[_0xe6d5('0x48')]:_0x2e0201[_0xe6d5('0x43')];if(!_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4a')]('nolimit')){_0x66c6d2[_0xe6d5('0x2e')]=qs['limit'](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x66c6d2[_0xe6d5('0x2d')]=qs[_0xe6d5('0x2d')](_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x2d')]);}_0x66c6d2[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x5ee4dd['query'][_0xe6d5('0x62')]);_0x66c6d2['where']=qs[_0xe6d5('0x46')](_['pick'](_0x5ee4dd[_0xe6d5('0x45')],_0x2e0201[_0xe6d5('0x46')]));_0x66c6d2[_0xe6d5('0x4c')][_0xe6d5('0x63')]=_0x2f3992['id'];if(_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0x66c6d2['where']=_[_0xe6d5('0x4f')](_0x66c6d2['where'],{'$or':_[_0xe6d5('0x50')](_0x66c6d2[_0xe6d5('0x48')],function(_0x4c1c23){var _0xfbca64={};_0xfbca64[_0x4c1c23]={'$like':'%'+_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0xfbca64;})});}_0x66c6d2=_['merge']({},_0x66c6d2,_0x5ee4dd[_0xe6d5('0x53')]);return db[_0xe6d5('0x8c')]['count']({'where':_0x66c6d2['where']})[_0xe6d5('0x34')](function(_0x39e03b){_0x23ea96[_0xe6d5('0x2c')]=_0x39e03b;if(_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x66c6d2[_0xe6d5('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xe6d5('0x8f'),'attributes':[_0xe6d5('0x38'),'fullname',_0xe6d5('0x90')],'required':![]},{'model':db[_0xe6d5('0x91')],'as':'Tags','attributes':['id',_0xe6d5('0x38'),'color'],'where':_0x5ee4dd[_0xe6d5('0x45')]['tag']?{'id':_0x5ee4dd[_0xe6d5('0x45')][_0xe6d5('0x92')]}:undefined,'required':_0x5ee4dd['query'][_0xe6d5('0x92')]?!![]:![]}];}return db['MailInteraction'][_0xe6d5('0x55')](_0x66c6d2);})[_0xe6d5('0x34')](function(_0x4ae7c1){_0x23ea96[_0xe6d5('0x56')]=_0x4ae7c1;return _0x23ea96;});}})['then'](respondWithFilteredResult(_0x1c1b1b,_0x66c6d2))[_0xe6d5('0x28')](handleError(_0x1c1b1b,null));};exports[_0xe6d5('0x93')]=function(_0x2e9a0a,_0x10025,_0x145c2f){return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x2e9a0a[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x10025,null))['then'](function(_0xbaf208){if(_0xbaf208){return db[_0xe6d5('0x94')]['transaction'](function(_0x45c17c){return db[_0xe6d5('0x95')][_0xe6d5('0x36')]({'where':{'MailAccountId':_0x2e9a0a['params']['id']},'transaction':_0x45c17c})[_0xe6d5('0x34')](function(_0x2d6995){var _0x576190=_['map'](_0x2e9a0a['body'],function(_0x50f3fd){_0x50f3fd[_0xe6d5('0x63')]=_0x2e9a0a['params']['id'];return _0x50f3fd;});return db[_0xe6d5('0x95')]['bulkCreate'](_0x576190,{'transaction':_0x45c17c});});})[_0xe6d5('0x34')](function(){return db[_0xe6d5('0x95')][_0xe6d5('0x96')]({'where':{'MailAccountId':_0x2e9a0a[_0xe6d5('0x58')]['id']},'order':'priority'});});}})[_0xe6d5('0x34')](respondWithResult(_0x10025,null))['catch'](handleError(_0x10025,null));};exports['getApplications']=function(_0x4087f6,_0x20072d,_0x4f7a03){var _0x2ad8bf={};var _0x1fc37f={};var _0xeee60;var _0x4b2b70;return db['MailAccount'][_0xe6d5('0x60')]({'where':{'id':_0x4087f6[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x20072d,null))[_0xe6d5('0x34')](function(_0x4bf30b){if(_0x4bf30b){_0xeee60=_0x4bf30b;_0x1fc37f['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x95')][_0xe6d5('0x42')]);_0x1fc37f['query']=_['keys'](_0x4087f6[_0xe6d5('0x45')]);_0x1fc37f['filters']=_['intersection'](_0x1fc37f[_0xe6d5('0x43')],_0x1fc37f[_0xe6d5('0x45')]);_0x2ad8bf[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x1fc37f['model'],qs[_0xe6d5('0x49')](_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x2ad8bf[_0xe6d5('0x48')]=_0x2ad8bf[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x2ad8bf[_0xe6d5('0x48')]:_0x1fc37f[_0xe6d5('0x43')];_0x2ad8bf[_0xe6d5('0x6a')]=qs['sort'](_0x4087f6[_0xe6d5('0x45')]['sort']);_0x2ad8bf[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x4087f6[_0xe6d5('0x45')],_0x1fc37f['filters']));if(_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4e')]){_0x2ad8bf['where']=_[_0xe6d5('0x4f')](_0x2ad8bf[_0xe6d5('0x4c')],{'$or':_['map'](_0x2ad8bf[_0xe6d5('0x48')],function(_0x36ab30){var _0x5e16c8={};_0x5e16c8[_0x36ab30]={'$like':'%'+_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4e')]+'%'};return _0x5e16c8;})});}_0x2ad8bf=_['merge']({},_0x2ad8bf,_0x4087f6[_0xe6d5('0x53')]);return _0xeee60['getApplications'](_0x2ad8bf);}})[_0xe6d5('0x34')](function(_0x18c4b5){if(_0x18c4b5){_0x4b2b70=_0x18c4b5[_0xe6d5('0x59')];if(!_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x2ad8bf[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x4087f6[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x2ad8bf['offset']=qs[_0xe6d5('0x2d')](_0x4087f6['query'][_0xe6d5('0x2d')]);}return _0xeee60[_0xe6d5('0x97')](_0x2ad8bf);}})[_0xe6d5('0x34')](function(_0xf010e4){if(_0xf010e4){return _0xf010e4?{'count':_0x4b2b70,'rows':_0xf010e4}:null;}})['then'](respondWithResult(_0x20072d,null))[_0xe6d5('0x28')](handleError(_0x20072d,null));};exports[_0xe6d5('0x98')]=function(_0x300780,_0x12eaf5,_0x18d7a6){var _0x42f7e9={'raw':!![],'where':{}};var _0x33be88={};var _0x5ce771={'count':0x0,'rows':[]};return db[_0xe6d5('0x41')][_0xe6d5('0x60')]({'where':{'id':_0x300780['params']['id']}})['then'](handleEntityNotFound(_0x12eaf5,null))[_0xe6d5('0x34')](function(_0x3ea4b6){if(_0x3ea4b6){_0x33be88['model']=_[_0xe6d5('0x44')](db[_0xe6d5('0x99')]['rawAttributes']);_0x33be88[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x300780['query']);_0x33be88[_0xe6d5('0x46')]=_['intersection'](_0x33be88[_0xe6d5('0x43')],_0x33be88[_0xe6d5('0x45')]);_0x42f7e9[_0xe6d5('0x48')]=_[_0xe6d5('0x47')](_0x33be88[_0xe6d5('0x43')],qs[_0xe6d5('0x49')](_0x300780[_0xe6d5('0x45')][_0xe6d5('0x49')]));_0x42f7e9[_0xe6d5('0x48')]=_0x42f7e9[_0xe6d5('0x48')][_0xe6d5('0x59')]?_0x42f7e9[_0xe6d5('0x48')]:_0x33be88[_0xe6d5('0x43')];if(!_0x300780[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x42f7e9[_0xe6d5('0x2e')]=qs[_0xe6d5('0x2e')](_0x300780[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x42f7e9[_0xe6d5('0x2d')]=qs['offset'](_0x300780['query'][_0xe6d5('0x2d')]);}_0x42f7e9[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x300780['query'][_0xe6d5('0x62')]);_0x42f7e9[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x300780[_0xe6d5('0x45')],_0x33be88[_0xe6d5('0x46')]));_0x42f7e9[_0xe6d5('0x4c')]['MailAccountId']=_0x3ea4b6['id'];if(_0x300780['query'][_0xe6d5('0x4e')]){_0x42f7e9[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x42f7e9[_0xe6d5('0x4c')],{'$or':_[_0xe6d5('0x50')](_0x42f7e9[_0xe6d5('0x48')],function(_0x481079){var _0x5cbd37={};_0x5cbd37[_0x481079]={'$like':'%'+_0x300780['query'][_0xe6d5('0x4e')]+'%'};return _0x5cbd37;})});}if(_0x300780[_0xe6d5('0x45')][_0xe6d5('0x9a')]){var _0x43df2f=_0x300780[_0xe6d5('0x45')][_0xe6d5('0x9a')][_0xe6d5('0x9b')](',');var _0x5531af={};_0x5531af[_0x43df2f[0x0]]={'$gte':moment(_0x43df2f[0x1])[_0xe6d5('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x42f7e9['where']=_[_0xe6d5('0x4f')](_0x42f7e9[_0xe6d5('0x4c')],_0x5531af);}_0x42f7e9=_[_0xe6d5('0x4f')]({},_0x42f7e9,_0x300780[_0xe6d5('0x53')]);return db[_0xe6d5('0x99')][_0xe6d5('0x2c')]({'where':_0x42f7e9[_0xe6d5('0x4c')]})['then'](function(_0x582908){_0x5ce771[_0xe6d5('0x2c')]=_0x582908;if(_0x300780[_0xe6d5('0x45')][_0xe6d5('0x5a')]){_0x42f7e9[_0xe6d5('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0xe6d5('0x55')](_0x42f7e9);})[_0xe6d5('0x34')](function(_0x336191){_0x5ce771[_0xe6d5('0x56')]=_0x336191;return _0x5ce771;});}})[_0xe6d5('0x34')](respondWithFilteredResult(_0x12eaf5,_0x42f7e9))[_0xe6d5('0x28')](handleError(_0x12eaf5,null));};exports['send']=function(_0x169a03,_0x2e07cd,_0x56a12b){var _0x21a7e5,_0x5ca46b={},_0x50e672;if(_0x169a03[_0xe6d5('0x5c')]['to']){_0x50e672=_0x169a03[_0xe6d5('0x5c')]['to'][_0xe6d5('0x9b')](',')[0x0];}return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x169a03[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x9d')],'as':_0xe6d5('0x9e'),'include':[{'model':db[_0xe6d5('0x9f')],'as':_0xe6d5('0xa0'),'where':{'email':_0x50e672},'limit':0x1,'order':[[_0xe6d5('0xa1'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xe6d5('0x3e'),'raw':!![]}]})[_0xe6d5('0x34')](handleEntityNotFound(_0x2e07cd,null))[_0xe6d5('0x34')](function(_0x4a9f76){if(_0x4a9f76){_0x21a7e5=_0x4a9f76;if(_0x4a9f76[_0xe6d5('0x3e')]){if(_[_0xe6d5('0x6f')](_0x169a03['body']['from'])){_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa2')]=util['format'](_0xe6d5('0xa3'),_0x4a9f76['name'],_0x4a9f76[_0xe6d5('0x6d')]||_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x74')]);}if(_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')]&&_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')]['length']){for(var _0xf58202=0x0;_0xf58202<_0x169a03['body'][_0xe6d5('0xa4')][_0xe6d5('0x59')];_0xf58202+=0x1){_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa4')][_0xf58202]={'filename':_0x169a03[_0xe6d5('0x5c')]['attachments'][_0xf58202][_0xe6d5('0x38')],'path':path[_0xe6d5('0xa5')](config['root'],'server/files/attachments',_0x169a03['body'][_0xe6d5('0xa4')][_0xf58202][_0xe6d5('0xa6')])};}}var _0x2ef5d3={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4a9f76['Smtp']['service'])){if(_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x78')]){_0x2ef5d3[_0xe6d5('0xa7')]={'user':_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x74')],'pass':_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x76')]};}_0x2ef5d3[_0xe6d5('0x7a')]=_0x4a9f76['Smtp']['host'];_0x2ef5d3[_0xe6d5('0x79')]=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x79')];_0x2ef5d3[_0xe6d5('0xa8')]=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0xa8')];}else{_0x2ef5d3['service']=_0x4a9f76[_0xe6d5('0x3e')][_0xe6d5('0x7b')];_0x2ef5d3['auth']={'user':_0x4a9f76['Smtp'][_0xe6d5('0x74')],'pass':_0x4a9f76[_0xe6d5('0x3e')]['pass']};}return respondWithRpcPromise(_0xe6d5('0xa9'),'sendMail',{'account':_0x2ef5d3,'message':_0x169a03[_0xe6d5('0x5c')]});}else{throw new Error(_0xe6d5('0xaa'));}}})[_0xe6d5('0x34')](function(_0x479d6a){if(_0x479d6a){_0x5ca46b=_0x479d6a;if(_0x21a7e5[_0xe6d5('0x9e')]){if(_0x21a7e5['List'][_0xe6d5('0xa0')]['length']){return _0x21a7e5[_0xe6d5('0x9e')][_0xe6d5('0xa0')][0x0];}else{return db[_0xe6d5('0x9f')][_0xe6d5('0x68')](_[_0xe6d5('0x16')](_0x169a03[_0xe6d5('0x5c')],{'firstName':_0x169a03[_0xe6d5('0x5c')]['to'],'email':_0x169a03['body']['to'],'phone':_0x169a03[_0xe6d5('0x5c')]['to'],'ListId':_0x21a7e5[_0xe6d5('0x6e')]}));}}else{throw new Error(_0xe6d5('0xaa'));}}})[_0xe6d5('0x34')](function(_0x1ec885){if(_0x1ec885){var _0x22521e={'UserId':_0x169a03[_0xe6d5('0x74')]['id'],'ContactId':_0x1ec885['id'],'MailAccountId':_0x21a7e5['id'],'inReplyTo':_0x5ca46b[_0xe6d5('0xab')],'to':_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xa2')],'cc':_0x169a03['body']['cc'],'subject':_0x169a03['body'][_0xe6d5('0xac')],'attach':_0x169a03['body']['attach'],'firstMsgDirection':_0xe6d5('0xad'),'lastMsgAt':moment()[_0xe6d5('0x9c')](_0xe6d5('0xae')),'lastMsgDirection':_0xe6d5('0xad'),'lastMsgBody':_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0x5c')],'Messages':[_['merge'](_0x169a03[_0xe6d5('0x5c')],{'messageId':_0x5ca46b[_0xe6d5('0xab')],'sentAt':moment()[_0xe6d5('0x9c')](_0xe6d5('0xae')),'read':!![],'MailAccountId':_0x21a7e5['id'],'UserId':_0x169a03[_0xe6d5('0x74')]['id'],'ContactId':_0x1ec885['id']})]};if(_0x169a03[_0xe6d5('0x5c')][_0xe6d5('0xaf')]){_0x22521e=_[_0xe6d5('0x4f')](_0x22521e,_0x169a03['body']['Interaction']);}return db[_0xe6d5('0x8c')][_0xe6d5('0x68')](_0x22521e,{'include':[{'model':db[_0xe6d5('0x99')],'as':'Messages'}]});}})[_0xe6d5('0x34')](respondWithResult(_0x2e07cd,null))['catch'](handleError(_0x2e07cd,null));};exports[_0xe6d5('0xb0')]=function(_0x86ffe,_0x3a07ed,_0x393122){return db['MailAccount']['find']({'where':{'id':_0x86ffe[_0xe6d5('0x58')]['id']},'include':[{'model':db[_0xe6d5('0x3d')],'as':_0xe6d5('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x3a07ed,null))[_0xe6d5('0x34')](function(_0x5dcb2c){if(_0x5dcb2c&&_0x5dcb2c[_0xe6d5('0x3e')]){var _0x1469e4={'id':_0x5dcb2c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x7b')]){_0x1469e4[_0xe6d5('0x7b')]=_0x5dcb2c[_0xe6d5('0x3e')]['service'];}else{_0x1469e4['host']=_0x5dcb2c[_0xe6d5('0x3e')]['host'];_0x1469e4[_0xe6d5('0x79')]=_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x79')];_0x1469e4[_0xe6d5('0xa8')]=_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0xa8')];}if(_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x78')]){_0x1469e4[_0xe6d5('0xa7')]={'user':_0x5dcb2c[_0xe6d5('0x3e')][_0xe6d5('0x74')],'pass':_0x5dcb2c[_0xe6d5('0x3e')]['pass']};}return respondWithRpcPromise(_0xe6d5('0xb1'),'verifySmtp',{'account':_0x1469e4});}})[_0xe6d5('0x34')](respondWithResult(_0x3a07ed,null))[_0xe6d5('0x28')](handleError(_0x3a07ed,null));};exports[_0xe6d5('0x36')]=function(_0x5d5312,_0x340da0){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x5d5312[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x340da0,null))[_0xe6d5('0x34')](function(_0x523e2f){if(_0x523e2f&&_0x523e2f['service']){throw new db[(_0xe6d5('0xb2'))][(_0xe6d5('0xb3'))](_0xe6d5('0xb4'));}return _0x523e2f;})['then'](removeEntity(_0x340da0,null))['catch'](handleError(_0x340da0,null));};exports[_0xe6d5('0xb5')]=function(_0x39581e,_0x49dd5e,_0x1ddf60){return db['MailAccount'][_0xe6d5('0x5b')]({'where':{'id':_0x39581e[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x49dd5e,null))[_0xe6d5('0x34')](function(_0x35f402){if(_0x35f402){return _0x35f402[_0xe6d5('0xb5')](_0x39581e[_0xe6d5('0x5c')][_0xe6d5('0x65')],_['omit'](_0x39581e[_0xe6d5('0x5c')],['ids','id'])||{})[_0xe6d5('0xb6')](function(_0xd98fa3){for(var _0x15f150=0x0;_0x15f150<_0x39581e['body'][_0xe6d5('0x65')][_0xe6d5('0x59')];_0x15f150+=0x1){socket[_0xe6d5('0xb7')](_0xe6d5('0xb8'),{'UserId':_0x39581e['body']['ids'][_0x15f150],'MailAccountId':_0x39581e[_0xe6d5('0x58')]['id']});}return _0xd98fa3;});}})['then'](respondWithResult(_0x49dd5e,null))[_0xe6d5('0x28')](handleError(_0x49dd5e,null));};exports[_0xe6d5('0xb9')]=function(_0x3016cb,_0xcfb44c,_0x51c274){return db[_0xe6d5('0x41')][_0xe6d5('0x5b')]({'where':{'id':_0x3016cb[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0xcfb44c,null))[_0xe6d5('0x34')](function(_0x4ae27c){if(_0x4ae27c){return _0x4ae27c[_0xe6d5('0xb9')](_0x3016cb[_0xe6d5('0x45')][_0xe6d5('0x65')])[_0xe6d5('0x34')](function(){if(_[_0xe6d5('0xba')](_0x3016cb['query'][_0xe6d5('0x65')])){for(var _0x5d927d=0x0;_0x5d927d<_0x3016cb['query']['ids'][_0xe6d5('0x59')];_0x5d927d+=0x1){socket[_0xe6d5('0xb7')](_0xe6d5('0xbb'),{'UserId':Number(_0x3016cb[_0xe6d5('0x45')]['ids'][_0x5d927d]),'MailAccountId':Number(_0x3016cb[_0xe6d5('0x58')]['id'])});}}else{socket['emit'](_0xe6d5('0xbb'),{'UserId':Number(_0x3016cb[_0xe6d5('0x45')][_0xe6d5('0x65')]),'MailAccountId':Number(_0x3016cb[_0xe6d5('0x58')]['id'])});}});}})[_0xe6d5('0x34')](respondWithStatusCode(_0xcfb44c,null))[_0xe6d5('0x28')](handleError(_0xcfb44c,null));};exports['getAgents']=function(_0x48afa7,_0x20e010,_0x4bac10){var _0x2fcead={};var _0x8ebb6a={};var _0x4fe787;var _0x6d7e19;return db['MailAccount']['findOne']({'where':{'id':_0x48afa7[_0xe6d5('0x58')]['id']}})[_0xe6d5('0x34')](handleEntityNotFound(_0x20e010,null))['then'](function(_0x1e4ebd){if(_0x1e4ebd){_0x4fe787=_0x1e4ebd;_0x8ebb6a[_0xe6d5('0x43')]=_[_0xe6d5('0x44')](db[_0xe6d5('0xbc')][_0xe6d5('0x42')]);_0x8ebb6a[_0xe6d5('0x45')]=_[_0xe6d5('0x44')](_0x48afa7[_0xe6d5('0x45')]);_0x8ebb6a[_0xe6d5('0x46')]=_[_0xe6d5('0x47')](_0x8ebb6a[_0xe6d5('0x43')],_0x8ebb6a['query']);_0x2fcead[_0xe6d5('0x48')]=_['intersection'](_0x8ebb6a['model'],qs[_0xe6d5('0x49')](_0x48afa7['query'][_0xe6d5('0x49')]));_0x2fcead['attributes']=_0x2fcead['attributes'][_0xe6d5('0x59')]?_0x2fcead[_0xe6d5('0x48')]:_0x8ebb6a[_0xe6d5('0x43')];_0x2fcead[_0xe6d5('0x6a')]=qs[_0xe6d5('0x62')](_0x48afa7['query'][_0xe6d5('0x62')]);_0x2fcead[_0xe6d5('0x4c')]=qs[_0xe6d5('0x46')](_[_0xe6d5('0x4d')](_0x48afa7[_0xe6d5('0x45')],_0x8ebb6a['filters']));if(_0x48afa7['query'][_0xe6d5('0x4e')]){_0x2fcead[_0xe6d5('0x4c')]=_[_0xe6d5('0x4f')](_0x2fcead[_0xe6d5('0x4c')],{'$or':_['map'](_0x2fcead['attributes'],function(_0xe73271){var _0x4187d1={};_0x4187d1[_0xe73271]={'$like':'%'+_0x48afa7[_0xe6d5('0x45')]['filter']+'%'};return _0x4187d1;})});}_0x2fcead=_[_0xe6d5('0x4f')]({},_0x2fcead,_0x48afa7[_0xe6d5('0x53')]);return _0x4fe787[_0xe6d5('0xbd')](_0x2fcead);}})[_0xe6d5('0x34')](function(_0x277247){if(_0x277247){_0x6d7e19=_0x277247[_0xe6d5('0x59')];if(!_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x4a')](_0xe6d5('0x4b'))){_0x2fcead['limit']=qs['limit'](_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x2e')]);_0x2fcead['offset']=qs[_0xe6d5('0x2d')](_0x48afa7[_0xe6d5('0x45')][_0xe6d5('0x2d')]);}return _0x4fe787['getAgents'](_0x2fcead);}})[_0xe6d5('0x34')](function(_0x451e4f){if(_0x451e4f){return _0x451e4f?{'count':_0x6d7e19,'rows':_0x451e4f}:null;}})[_0xe6d5('0x34')](respondWithResult(_0x20e010,null))['catch'](handleError(_0x20e010,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 14ecd21..e2f7d45 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 _0x1a83=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3b9fdf,_0x143f0b){var _0xd3bbd0=function(_0x4c4f61){while(--_0x4c4f61){_0x3b9fdf['push'](_0x3b9fdf['shift']());}};_0xd3bbd0(++_0x143f0b);}(_0x1a83,0x195));var _0x31a8=function(_0xa0383e,_0x3fb760){_0xa0383e=_0xa0383e-0x0;var _0xcfbbf=_0x1a83[_0xa0383e];return _0xcfbbf;};'use strict';var EventEmitter=require(_0x31a8('0x0'));var MailAccount=require(_0x31a8('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x31a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x31a8('0x3'),'afterDestroy':_0x31a8('0x4')};function emitEvent(_0x34056d){return function(_0x46c0b9,_0x3aeab8,_0xc38f19){MailAccountEvents[_0x31a8('0x5')](_0x34056d+':'+_0x46c0b9['id'],_0x46c0b9);MailAccountEvents['emit'](_0x34056d,_0x46c0b9);_0xc38f19(null);};}for(var e in events){if(events[_0x31a8('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x31a8('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xa8b2=['remove','emit','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x4ac12d,_0x16a759){var _0x30c831=function(_0x52ed0a){while(--_0x52ed0a){_0x4ac12d['push'](_0x4ac12d['shift']());}};_0x30c831(++_0x16a759);}(_0xa8b2,0x193));var _0x2a8b=function(_0x38bbb7,_0x302c80){_0x38bbb7=_0x38bbb7-0x0;var _0xee51a5=_0xa8b2[_0x38bbb7];return _0xee51a5;};'use strict';var EventEmitter=require(_0x2a8b('0x0'));var MailAccount=require(_0x2a8b('0x1'))['db'][_0x2a8b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2a8b('0x3')](0x0);var events={'afterCreate':_0x2a8b('0x4'),'afterUpdate':'update','afterDestroy':_0x2a8b('0x5')};function emitEvent(_0x33cd08){return function(_0x5a422a,_0x4e2a2d,_0x109183){MailAccountEvents[_0x2a8b('0x6')](_0x33cd08+':'+_0x5a422a['id'],_0x5a422a);MailAccountEvents[_0x2a8b('0x6')](_0x33cd08,_0x5a422a);_0x109183(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x2a8b('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c097974..3192fb0 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 _0x04d5=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash','util','api'];(function(_0x549cb9,_0x4eac7f){var _0x42049c=function(_0x48b040){while(--_0x48b040){_0x549cb9['push'](_0x549cb9['shift']());}};_0x42049c(++_0x4eac7f);}(_0x04d5,0xe1));var _0x504d=function(_0x588582,_0x437d17){_0x588582=_0x588582-0x0;var _0x6a6800=_0x04d5[_0x588582];return _0x6a6800;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var logger=require('../../config/logger')(_0x504d('0x2'));var moment=require(_0x504d('0x3'));var BPromise=require(_0x504d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x504d('0x5'));var rimraf=require(_0x504d('0x6'));var config=require(_0x504d('0x7'));var attributes=require(_0x504d('0x8'));module[_0x504d('0x9')]=function(_0x535671,_0x289d44){return _0x535671[_0x504d('0xa')](_0x504d('0xb'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa486=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','moment'];(function(_0x125857,_0x14e067){var _0x4fa9ff=function(_0xbb5991){while(--_0xbb5991){_0x125857['push'](_0x125857['shift']());}};_0x4fa9ff(++_0x14e067);}(_0xa486,0x17d));var _0x6a48=function(_0x584fa2,_0x45820f){_0x584fa2=_0x584fa2-0x0;var _0x4adc75=_0xa486[_0x584fa2];return _0x4adc75;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var logger=require(_0x6a48('0x1'))('api');var moment=require(_0x6a48('0x2'));var BPromise=require('bluebird');var rp=require(_0x6a48('0x3'));var fs=require('fs');var path=require(_0x6a48('0x4'));var rimraf=require(_0x6a48('0x5'));var config=require(_0x6a48('0x6'));var attributes=require(_0x6a48('0x7'));module[_0x6a48('0x8')]=function(_0x29c0eb,_0x3d81f7){return _0x29c0eb[_0x6a48('0x9')](_0x6a48('0xa'),attributes,{'tableName':_0x6a48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 21e5a71..0efc6e4 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 _0xd81c=['contact','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','find','ShowMailAccount','body','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','List','applications','list','priority','asc','autoclose','close','*,*,*,*','length','Contacts','ListId','List\x20not\x20found'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd81c,0xed));var _0xcd81=function(_0x2057c4,_0x1e9fa5){_0x2057c4=_0x2057c4-0x0;var _0x57ce25=_0xd81c[_0x2057c4];return _0x57ce25;};'use strict';var _=require(_0xcd81('0x0'));var util=require(_0xcd81('0x1'));var moment=require(_0xcd81('0x2'));var BPromise=require(_0xcd81('0x3'));var rs=require(_0xcd81('0x4'));var fs=require('fs');var Redis=require(_0xcd81('0x5'));var db=require(_0xcd81('0x6'))['db'];var utils=require(_0xcd81('0x7'));var logger=require(_0xcd81('0x8'))(_0xcd81('0x9'));var config=require(_0xcd81('0xa'));var jayson=require(_0xcd81('0xb'));var client=jayson['client'][_0xcd81('0xc')]({'port':0x232c});config['redis']=_[_0xcd81('0xd')](config[_0xcd81('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd81('0xf'))(new Redis(config[_0xcd81('0xe')]));require(_0xcd81('0x10'))['register'](socket);function respondWithRpcPromise(_0x6a04b1,_0x5801e9,_0x3ecfa0){return new BPromise(function(_0x1b8f11,_0x3a755f){return client[_0xcd81('0x11')](_0x6a04b1,_0x3ecfa0)['then'](function(_0x406c5e){logger[_0xcd81('0x12')](_0xcd81('0x13'),_0x5801e9,_0xcd81('0x14'));logger['debug'](_0xcd81('0x15'),_0x5801e9,_0xcd81('0x14'),JSON[_0xcd81('0x16')](_0x406c5e));if(_0x406c5e[_0xcd81('0x17')]){if(_0x406c5e['error'][_0xcd81('0x18')]===0x1f4){logger[_0xcd81('0x17')]('MailAccount,\x20%s,\x20%s',_0x5801e9,_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);return _0x3a755f(_0x406c5e['error'][_0xcd81('0x19')]);}logger[_0xcd81('0x17')]('MailAccount,\x20%s,\x20%s',_0x5801e9,_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);return _0x1b8f11(_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);}else{logger['info'](_0xcd81('0x13'),_0x5801e9,'request\x20sent');_0x1b8f11(_0x406c5e[_0xcd81('0x1a')]['message']);}})[_0xcd81('0x1b')](function(_0x6d3345){logger[_0xcd81('0x17')](_0xcd81('0x13'),_0x5801e9,_0x6d3345);_0x3a755f(_0x6d3345);});});}exports[_0xcd81('0x1c')]=function(_0x45e5f2){var _0x2c24c2=this;return new Promise(function(_0x44bbc5,_0xbeadb6){return db[_0xcd81('0x1d')][_0xcd81('0x1e')]({'raw':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x20')]===undefined?!![]:![]:!![],'where':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x21')]||null:null,'attributes':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x22')]||null:null,'limit':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x23')]||null:null,'include':_0x45e5f2['options']?_0x45e5f2['options'][_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x45e5f2['options'][_0xcd81('0x24')],function(_0x438d32){return{'model':db[_0x438d32[_0xcd81('0x26')]],'as':_0x438d32['as'],'attributes':_0x438d32[_0xcd81('0x22')],'include':_0x438d32[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x438d32[_0xcd81('0x24')],function(_0x1a3315){return{'model':db[_0x1a3315[_0xcd81('0x26')]],'as':_0x1a3315['as'],'attributes':_0x1a3315[_0xcd81('0x22')],'include':_0x1a3315[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x1a3315[_0xcd81('0x24')],function(_0x51ae1e){return{'model':db[_0x51ae1e['model']],'as':_0x51ae1e['as'],'attributes':_0x51ae1e[_0xcd81('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcd81('0x27')](function(_0x25432f){logger['info'](_0xcd81('0x1c'),_0x45e5f2);logger[_0xcd81('0x28')](_0xcd81('0x1c'),_0x45e5f2,JSON[_0xcd81('0x16')](_0x25432f));_0x44bbc5(_0x25432f);})[_0xcd81('0x1b')](function(_0x595a69){logger[_0xcd81('0x17')](_0xcd81('0x1c'),_0x595a69[_0xcd81('0x19')],_0x45e5f2);_0xbeadb6(_0x2c24c2[_0xcd81('0x17')](0x1f4,_0x595a69[_0xcd81('0x19')]));});});};exports['ShowMailAccount']=function(_0x54791f){var _0x50137a=this;return new Promise(function(_0x2bec29,_0x50b980){return db[_0xcd81('0x1d')][_0xcd81('0x29')]({'raw':_0x54791f['options']?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x20')]===undefined?!![]:![]:!![],'where':_0x54791f[_0xcd81('0x1f')]?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x21')]||null:null,'attributes':_0x54791f[_0xcd81('0x1f')]?_0x54791f['options'][_0xcd81('0x22')]||null:null,'include':_0x54791f[_0xcd81('0x1f')]?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x54791f[_0xcd81('0x1f')][_0xcd81('0x24')],function(_0x1b7904){return{'model':db[_0x1b7904['model']],'as':_0x1b7904['as'],'attributes':_0x1b7904['attributes'],'include':_0x1b7904[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x1b7904['include'],function(_0x2b0013){return{'model':db[_0x2b0013[_0xcd81('0x26')]],'as':_0x2b0013['as'],'attributes':_0x2b0013[_0xcd81('0x22')],'include':_0x2b0013[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x2b0013[_0xcd81('0x24')],function(_0x357f0f){return{'model':db[_0x357f0f[_0xcd81('0x26')]],'as':_0x357f0f['as'],'attributes':_0x357f0f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd81('0x27')](function(_0x48f45b){logger['info'](_0xcd81('0x2a'),_0x54791f);logger[_0xcd81('0x28')](_0xcd81('0x2a'),_0x54791f,JSON[_0xcd81('0x16')](_0x48f45b));_0x2bec29(_0x48f45b);})['catch'](function(_0x1f4914){logger['error'](_0xcd81('0x2a'),_0x1f4914['message'],_0x54791f);_0x50b980(_0x50137a[_0xcd81('0x17')](0x1f4,_0x1f4914[_0xcd81('0x19')]));});});};exports['NotifyMailAccount']=function(_0x500834){var _0x163c13=this;return new Promise(function(_0x12508b,_0x2b861a){var _0x18bf1c={'body':_0x500834[_0xcd81('0x2b')],'channel':'mail'};var _0x514b79=_[_0xcd81('0x2c')](_[_0xcd81('0x2d')](db[_0xcd81('0x2e')][_0xcd81('0x2f')]),['createdAt',_0xcd81('0x30'),_0xcd81('0x31'),'ListId']);var _0x2e4c10=![];if(_0x500834[_0xcd81('0x2b')]['id']){delete _0x500834[_0xcd81('0x2b')]['id'];}if(_[_0xcd81('0x32')](_0x500834['body'][_0xcd81('0x33')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x34')));}if(_[_0xcd81('0x32')](_0x500834[_0xcd81('0x2b')][_0xcd81('0x2b')])||_0x500834['body'][_0xcd81('0x2b')]===''){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x35')));}if(_[_0xcd81('0x32')](_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x37')+_0x514b79));}if(!_[_0xcd81('0x38')](_0x514b79,_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x39')+_0x514b79));}var _0x948a60={};_0x948a60[_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')]]=_0x500834[_0xcd81('0x2b')][_0xcd81('0x33')];return db[_0xcd81('0x1d')][_0xcd81('0x29')]({'where':{'id':_0x500834[_0xcd81('0x3a')]['id']},'include':[{'model':db[_0xcd81('0x3b')],'as':'List','include':[{'model':db[_0xcd81('0x2e')],'as':'Contacts','where':_0x948a60,'limit':0x1,'order':[[_0xcd81('0x30'),_0xcd81('0x3c')]]}]},{'model':db[_0xcd81('0x3d')],'as':_0xcd81('0x3e')},{'model':db[_0xcd81('0x3f')],'as':_0xcd81('0x40')}]})[_0xcd81('0x27')](function(_0x385600){if(_0x385600&&_0x385600['List']){var _0x427e93=_0x385600['get']({'plain':!![]});_0x18bf1c['account']=_[_0xcd81('0x41')](_0x427e93,['Applications',_0xcd81('0x42')]);_0x18bf1c[_0xcd81('0x43')]=_0x427e93['Applications'];_0x18bf1c[_0xcd81('0x44')]=_0x427e93[_0xcd81('0x42')];_0x18bf1c['applications']=_['orderBy'](_0x18bf1c[_0xcd81('0x43')],[_0xcd81('0x45')],[_0xcd81('0x46')]);if(_0x18bf1c['account']&&_0x18bf1c['account'][_0xcd81('0x47')]){_0x18bf1c[_0xcd81('0x43')]['push']({'id':0x0,'priority':_0x18bf1c[_0xcd81('0x43')]['length']+0x1,'app':_0xcd81('0x48'),'appdata':_0xcd81('0x47'),'interval':_0xcd81('0x49')});}if(_0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x3e')]){delete _0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x3e')];}if(_0x18bf1c[_0xcd81('0x3a')]['List']){delete _0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x42')];}if(_0x427e93[_0xcd81('0x42')]['Contacts'][_0xcd81('0x4a')]){return _0x427e93[_0xcd81('0x42')][_0xcd81('0x4b')][0x0];}var _0x42dc52=_[_0xcd81('0xd')](_0x500834[_0xcd81('0x2b')],{'firstName':_0x500834[_0xcd81('0x2b')][_0xcd81('0x33')],'ListId':_0x427e93[_0xcd81('0x4c')]});_0x42dc52[_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')]]=_0x500834[_0xcd81('0x2b')]['from'];return db[_0xcd81('0x2e')]['create'](_0x42dc52);}else{throw new Error(_0xcd81('0x4d'));}})[_0xcd81('0x27')](function(_0x2d8932){_0x18bf1c[_0xcd81('0x4e')]=_0x2d8932;if(_0x2d8932){if(!_0x500834['body'][_0xcd81('0x19')]['messageId']){_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x4f')]=rs['generate']()+'\x20'+_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x33')];}var _0x472f8e={'ContactId':_0x2d8932['id'],'MailAccountId':_0x500834['account']['id'],'inReplyTo':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x4f')],'to':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['from'],'cc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['cc'],'subject':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x50')],'attach':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x51')],'lastMsgAt':moment()[_0xcd81('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x500834[_0xcd81('0x2b')]['body']};return db[_0xcd81('0x53')][_0xcd81('0x29')]({'where':{'closed':![],'MailAccountId':_0x500834['account']['id']},'include':[{'model':db[_0xcd81('0x54')],'as':_0xcd81('0x55'),'attributes':[_0xcd81('0x4f')],'where':{'messageId':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x56')]}}]})[_0xcd81('0x27')](function(_0x23e543){if(_0x23e543){return[_0x23e543,![]];}return db[_0xcd81('0x53')][_0xcd81('0x57')](_0x472f8e)['then'](function(_0xe32c9e){return[_0xe32c9e,!![]];});});}else{throw new Error(_0xcd81('0x58'));}})[_0xcd81('0x59')](function(_0x118233,_0x5b9b05){if(_0x118233){_0x2e4c10=_0x5b9b05;if(!_0x5b9b05){return _0x118233[_0xcd81('0x5a')]({'inReplyTo':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x4f')],'to':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x33')],'cc':_0x500834[_0xcd81('0x2b')]['message']['cc'],'subject':_0x500834['body']['message'][_0xcd81('0x50')],'attach':_0x118233['attach']?_0x118233[_0xcd81('0x51')]:_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x51')],'substatus':null,'substatusAt':moment()[_0xcd81('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xcd81('0x52')](_0xcd81('0x5b')),'lastMsgDirection':'in','lastMsgBody':_0x500834[_0xcd81('0x2b')]['body']});}else{return _0x118233;}}})[_0xcd81('0x27')](function(_0x4208c4){_0x18bf1c[_0xcd81('0x5c')]=_0x4208c4['get']({'plain':!![]});_0x18bf1c[_0xcd81('0x5c')]['created']=_0x2e4c10;return db['MailMessage']['create']({'body':_0x500834[_0xcd81('0x2b')]['body'],'MailAccountId':_0x500834[_0xcd81('0x3a')]['id'],'MailInteractionId':_0x4208c4['id'],'direction':'in','ContactId':_0x18bf1c['contact']['id'],'messageId':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x4f')],'from':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x33')],'to':_0x500834['body'][_0xcd81('0x19')]['to'],'cc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['cc'],'subject':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x50')],'attach':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x51')],'Attachments':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x5d')],'originTo':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x5e')],'originCc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x5f')],'bcc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['bcc']},{'include':[{'model':db[_0xcd81('0x60')],'as':'Attachments'}]});})[_0xcd81('0x27')](function(_0x7b5b3d){_0x18bf1c[_0xcd81('0x19')]=_0x7b5b3d;if(_0x18bf1c[_0xcd81('0x5c')][_0xcd81('0x61')]){return db[_0xcd81('0x62')][_0xcd81('0x29')]({'attributes':['id',_0xcd81('0x63')],'where':{'id':_0x18bf1c[_0xcd81('0x5c')][_0xcd81('0x61')]}})[_0xcd81('0x27')](function(_0x1d9180){if(_0x1d9180){_0x18bf1c[_0xcd81('0x43')][_0xcd81('0x64')]({'id':0x0,'priority':0x0,'app':_0xcd81('0x65'),'appdata':_0x1d9180[_0xcd81('0x63')]+','+(_0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x66')]||0xa),'interval':_0xcd81('0x49')});}return respondWithRpcPromise(_0xcd81('0x67'),_0xcd81('0x68'),_0x18bf1c);});}return respondWithRpcPromise(_0xcd81('0x67'),_0xcd81('0x68'),_0x18bf1c);})[_0xcd81('0x27')](function(_0x1d57b7){_0x12508b(_0x1d57b7);})['catch'](function(_0x476425){_0x2b861a(_0x163c13['error'](0x1f4,_0x476425[_0xcd81('0x19')]));});});}; \ No newline at end of file +var _0xe840=['limit','include','map','model','GetMailAccount','find','raw','ShowMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','get','list','applications','orderBy','asc','push','length','close','autoclose','*,*,*,*','Contacts','create','contact','messageId','generate','subject','attach','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','catch','MailAccount','findAll','options','where','attributes'];(function(_0x480009,_0x209238){var _0x31dfc2=function(_0x3161f5){while(--_0x3161f5){_0x480009['push'](_0x480009['shift']());}};_0x31dfc2(++_0x209238);}(_0xe840,0x1dd));var _0x0e84=function(_0x494603,_0x300ba4){_0x494603=_0x494603-0x0;var _0x3504f5=_0xe840[_0x494603];return _0x3504f5;};'use strict';var _=require(_0x0e84('0x0'));var util=require('util');var moment=require(_0x0e84('0x1'));var BPromise=require(_0x0e84('0x2'));var rs=require(_0x0e84('0x3'));var fs=require('fs');var Redis=require(_0x0e84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e84('0x5'));var logger=require('../../config/logger')(_0x0e84('0x6'));var config=require(_0x0e84('0x7'));var jayson=require(_0x0e84('0x8'));var client=jayson[_0x0e84('0x9')]['http']({'port':0x232c});config['redis']=_[_0x0e84('0xa')](config[_0x0e84('0xb')],{'host':_0x0e84('0xc'),'port':0x18eb});var socket=require(_0x0e84('0xd'))(new Redis(config[_0x0e84('0xb')]));require(_0x0e84('0xe'))[_0x0e84('0xf')](socket);function respondWithRpcPromise(_0x41d587,_0x2a2c72,_0xae798c){return new BPromise(function(_0x3dd022,_0x91e828){return client[_0x0e84('0x10')](_0x41d587,_0xae798c)[_0x0e84('0x11')](function(_0x58da53){logger['info']('MailAccount,\x20%s,\x20%s',_0x2a2c72,_0x0e84('0x12'));logger[_0x0e84('0x13')](_0x0e84('0x14'),_0x2a2c72,_0x0e84('0x12'),JSON[_0x0e84('0x15')](_0x58da53));if(_0x58da53[_0x0e84('0x16')]){if(_0x58da53[_0x0e84('0x16')][_0x0e84('0x17')]===0x1f4){logger[_0x0e84('0x16')](_0x0e84('0x18'),_0x2a2c72,_0x58da53[_0x0e84('0x16')][_0x0e84('0x19')]);return _0x91e828(_0x58da53[_0x0e84('0x16')]['message']);}logger[_0x0e84('0x16')](_0x0e84('0x18'),_0x2a2c72,_0x58da53['error'][_0x0e84('0x19')]);return _0x3dd022(_0x58da53[_0x0e84('0x16')][_0x0e84('0x19')]);}else{logger[_0x0e84('0x1a')](_0x0e84('0x18'),_0x2a2c72,_0x0e84('0x12'));_0x3dd022(_0x58da53['result'][_0x0e84('0x19')]);}})[_0x0e84('0x1b')](function(_0x1c92b8){logger['error'](_0x0e84('0x18'),_0x2a2c72,_0x1c92b8);_0x91e828(_0x1c92b8);});});}exports['GetMailAccount']=function(_0x36d829){var _0x3544b1=this;return new Promise(function(_0x27428d,_0x5809c2){return db[_0x0e84('0x1c')][_0x0e84('0x1d')]({'raw':_0x36d829[_0x0e84('0x1e')]?_0x36d829['options']['raw']===undefined?!![]:![]:!![],'where':_0x36d829[_0x0e84('0x1e')]?_0x36d829[_0x0e84('0x1e')][_0x0e84('0x1f')]||null:null,'attributes':_0x36d829['options']?_0x36d829['options'][_0x0e84('0x20')]||null:null,'limit':_0x36d829[_0x0e84('0x1e')]?_0x36d829['options'][_0x0e84('0x21')]||null:null,'include':_0x36d829[_0x0e84('0x1e')]?_0x36d829[_0x0e84('0x1e')][_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x36d829['options'][_0x0e84('0x22')],function(_0x347c12){return{'model':db[_0x347c12[_0x0e84('0x24')]],'as':_0x347c12['as'],'attributes':_0x347c12['attributes'],'include':_0x347c12[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x347c12[_0x0e84('0x22')],function(_0x3bf26b){return{'model':db[_0x3bf26b['model']],'as':_0x3bf26b['as'],'attributes':_0x3bf26b['attributes'],'include':_0x3bf26b[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x3bf26b[_0x0e84('0x22')],function(_0x5034c2){return{'model':db[_0x5034c2['model']],'as':_0x5034c2['as'],'attributes':_0x5034c2[_0x0e84('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12ab63){logger['info'](_0x0e84('0x25'),_0x36d829);logger[_0x0e84('0x13')]('GetMailAccount',_0x36d829,JSON[_0x0e84('0x15')](_0x12ab63));_0x27428d(_0x12ab63);})['catch'](function(_0x198c0d){logger[_0x0e84('0x16')]('GetMailAccount',_0x198c0d[_0x0e84('0x19')],_0x36d829);_0x5809c2(_0x3544b1['error'](0x1f4,_0x198c0d[_0x0e84('0x19')]));});});};exports['ShowMailAccount']=function(_0x55c6e6){var _0x4eb09e=this;return new Promise(function(_0x128c3d,_0x3528f0){return db[_0x0e84('0x1c')][_0x0e84('0x26')]({'raw':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6[_0x0e84('0x1e')][_0x0e84('0x27')]===undefined?!![]:![]:!![],'where':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6[_0x0e84('0x1e')][_0x0e84('0x1f')]||null:null,'attributes':_0x55c6e6['options']?_0x55c6e6['options'][_0x0e84('0x20')]||null:null,'include':_0x55c6e6[_0x0e84('0x1e')]?_0x55c6e6['options']['include']?_[_0x0e84('0x23')](_0x55c6e6['options'][_0x0e84('0x22')],function(_0xff97c5){return{'model':db[_0xff97c5['model']],'as':_0xff97c5['as'],'attributes':_0xff97c5[_0x0e84('0x20')],'include':_0xff97c5[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0xff97c5[_0x0e84('0x22')],function(_0x14213e){return{'model':db[_0x14213e[_0x0e84('0x24')]],'as':_0x14213e['as'],'attributes':_0x14213e[_0x0e84('0x20')],'include':_0x14213e[_0x0e84('0x22')]?_[_0x0e84('0x23')](_0x14213e[_0x0e84('0x22')],function(_0x5a9140){return{'model':db[_0x5a9140[_0x0e84('0x24')]],'as':_0x5a9140['as'],'attributes':_0x5a9140[_0x0e84('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0e84('0x11')](function(_0x3ad5ab){logger[_0x0e84('0x1a')](_0x0e84('0x28'),_0x55c6e6);logger[_0x0e84('0x13')](_0x0e84('0x28'),_0x55c6e6,JSON[_0x0e84('0x15')](_0x3ad5ab));_0x128c3d(_0x3ad5ab);})[_0x0e84('0x1b')](function(_0x65df2c){logger[_0x0e84('0x16')](_0x0e84('0x28'),_0x65df2c[_0x0e84('0x19')],_0x55c6e6);_0x3528f0(_0x4eb09e['error'](0x1f4,_0x65df2c[_0x0e84('0x19')]));});});};exports['NotifyMailAccount']=function(_0x488e58){var _0x17b499=this;return new Promise(function(_0x552230,_0x231980){var _0x1aeada={'body':_0x488e58[_0x0e84('0x29')],'channel':_0x0e84('0x2a')};var _0x54cbb1=_[_0x0e84('0x2b')](_['keys'](db[_0x0e84('0x2c')][_0x0e84('0x2d')]),[_0x0e84('0x2e'),_0x0e84('0x2f'),_0x0e84('0x30'),_0x0e84('0x31')]);var _0x35d253=![];if(_0x488e58[_0x0e84('0x29')]['id']){delete _0x488e58['body']['id'];}if(_[_0x0e84('0x32')](_0x488e58['body'][_0x0e84('0x33')])){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x34')));}if(_['isNil'](_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')])||_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]===''){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x35')));}if(_['isNil'](_0x488e58['body'][_0x0e84('0x36')])){return _0x231980(_0x17b499['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54cbb1));}if(!_[_0x0e84('0x37')](_0x54cbb1,_0x488e58['body']['mapKey'])){return _0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x0e84('0x38')+_0x54cbb1));}var _0x138a5c={};_0x138a5c[_0x488e58[_0x0e84('0x29')]['mapKey']]=_0x488e58[_0x0e84('0x29')]['from'];return db['MailAccount'][_0x0e84('0x26')]({'where':{'id':_0x488e58[_0x0e84('0x39')]['id']},'include':[{'model':db[_0x0e84('0x3a')],'as':_0x0e84('0x3b'),'include':[{'model':db[_0x0e84('0x2c')],'as':'Contacts','where':_0x138a5c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x0e84('0x3c')],'as':_0x0e84('0x3d')},{'model':db[_0x0e84('0x3e')],'as':_0x0e84('0x3f')}]})[_0x0e84('0x11')](function(_0x5b9bb5){if(_0x5b9bb5&&_0x5b9bb5[_0x0e84('0x3b')]){var _0x309ee9=_0x5b9bb5[_0x0e84('0x40')]({'plain':!![]});_0x1aeada[_0x0e84('0x39')]=_['omit'](_0x309ee9,[_0x0e84('0x3d'),_0x0e84('0x3b')]);_0x1aeada['applications']=_0x309ee9[_0x0e84('0x3d')];_0x1aeada[_0x0e84('0x41')]=_0x309ee9[_0x0e84('0x3b')];_0x1aeada[_0x0e84('0x42')]=_[_0x0e84('0x43')](_0x1aeada[_0x0e84('0x42')],['priority'],[_0x0e84('0x44')]);if(_0x1aeada[_0x0e84('0x39')]&&_0x1aeada[_0x0e84('0x39')]['autoclose']){_0x1aeada[_0x0e84('0x42')][_0x0e84('0x45')]({'id':0x0,'priority':_0x1aeada[_0x0e84('0x42')][_0x0e84('0x46')]+0x1,'app':_0x0e84('0x47'),'appdata':_0x0e84('0x48'),'interval':_0x0e84('0x49')});}if(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x3d')]){delete _0x1aeada[_0x0e84('0x39')][_0x0e84('0x3d')];}if(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x3b')]){delete _0x1aeada['account'][_0x0e84('0x3b')];}if(_0x309ee9[_0x0e84('0x3b')][_0x0e84('0x4a')][_0x0e84('0x46')]){return _0x309ee9[_0x0e84('0x3b')]['Contacts'][0x0];}var _0x55447b=_[_0x0e84('0xa')](_0x488e58['body'],{'firstName':_0x488e58[_0x0e84('0x29')][_0x0e84('0x33')],'ListId':_0x309ee9[_0x0e84('0x31')]});_0x55447b[_0x488e58[_0x0e84('0x29')][_0x0e84('0x36')]]=_0x488e58[_0x0e84('0x29')]['from'];return db[_0x0e84('0x2c')][_0x0e84('0x4b')](_0x55447b);}else{throw new Error('List\x20not\x20found');}})[_0x0e84('0x11')](function(_0x3fada7){_0x1aeada[_0x0e84('0x4c')]=_0x3fada7;if(_0x3fada7){if(!_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x4d')]){_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['messageId']=rs[_0x0e84('0x4e')]()+'\x20'+_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x33')];}var _0x330247={'ContactId':_0x3fada7['id'],'MailAccountId':_0x488e58[_0x0e84('0x39')]['id'],'inReplyTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'to':_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x33')],'cc':_0x488e58['body'][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4f')],'attach':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x50')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]};return db[_0x0e84('0x51')][_0x0e84('0x26')]({'where':{'closed':![],'MailAccountId':_0x488e58['account']['id']},'include':[{'model':db[_0x0e84('0x52')],'as':'Messages','attributes':[_0x0e84('0x4d')],'where':{'messageId':_0x488e58['body']['message'][_0x0e84('0x53')]}}]})['then'](function(_0x459930){if(_0x459930){return[_0x459930,![]];}return db[_0x0e84('0x51')]['create'](_0x330247)[_0x0e84('0x11')](function(_0x5cdd45){return[_0x5cdd45,!![]];});});}else{throw new Error(_0x0e84('0x54'));}})['spread'](function(_0x369d42,_0x202295){if(_0x369d42){_0x35d253=_0x202295;if(!_0x202295){return _0x369d42[_0x0e84('0x55')]({'inReplyTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'to':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x33')],'cc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4f')],'attach':_0x369d42[_0x0e84('0x50')]?_0x369d42[_0x0e84('0x50')]:_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x50')],'substatus':null,'substatusAt':moment()[_0x0e84('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0e84('0x56')](_0x0e84('0x57')),'lastMsgDirection':'in','lastMsgBody':_0x488e58[_0x0e84('0x29')][_0x0e84('0x29')]});}else{return _0x369d42;}}})[_0x0e84('0x11')](function(_0x421b97){_0x1aeada[_0x0e84('0x58')]=_0x421b97[_0x0e84('0x40')]({'plain':!![]});_0x1aeada[_0x0e84('0x58')][_0x0e84('0x59')]=_0x35d253;return db['MailMessage'][_0x0e84('0x4b')]({'body':_0x488e58['body'][_0x0e84('0x29')],'MailAccountId':_0x488e58[_0x0e84('0x39')]['id'],'MailInteractionId':_0x421b97['id'],'direction':'in','ContactId':_0x1aeada['contact']['id'],'messageId':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x4d')],'from':_0x488e58['body']['message'][_0x0e84('0x33')],'to':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['to'],'cc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['cc'],'subject':_0x488e58[_0x0e84('0x29')]['message'][_0x0e84('0x4f')],'attach':_0x488e58['body']['message'][_0x0e84('0x50')],'Attachments':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x5a')],'originTo':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')][_0x0e84('0x5b')],'originCc':_0x488e58[_0x0e84('0x29')][_0x0e84('0x19')]['originCc'],'bcc':_0x488e58['body'][_0x0e84('0x19')][_0x0e84('0x5c')]},{'include':[{'model':db[_0x0e84('0x5d')],'as':'Attachments'}]});})[_0x0e84('0x11')](function(_0x381b89){_0x1aeada['message']=_0x381b89;if(_0x1aeada[_0x0e84('0x58')][_0x0e84('0x5e')]){return db[_0x0e84('0x5f')][_0x0e84('0x26')]({'attributes':['id',_0x0e84('0x60')],'where':{'id':_0x1aeada['interaction'][_0x0e84('0x5e')]}})[_0x0e84('0x11')](function(_0x542425){if(_0x542425){_0x1aeada[_0x0e84('0x42')][_0x0e84('0x61')]({'id':0x0,'priority':0x0,'app':_0x0e84('0x62'),'appdata':_0x542425[_0x0e84('0x60')]+','+(_0x1aeada[_0x0e84('0x39')][_0x0e84('0x63')]||0xa),'interval':_0x0e84('0x49')});}return respondWithRpcPromise('Start',_0x0e84('0x64'),_0x1aeada);});}return respondWithRpcPromise(_0x0e84('0x65'),_0x0e84('0x64'),_0x1aeada);})[_0x0e84('0x11')](function(_0x2da69d){_0x552230(_0x2da69d);})[_0x0e84('0x1b')](function(_0x4d3113){_0x231980(_0x17b499[_0x0e84('0x16')](0x1f4,_0x4d3113[_0x0e84('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a9e9f01..b70bc39 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 _0xc7d3=['./mailAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3efa3a,_0x5b6097){var _0x4b718d=function(_0x4224d1){while(--_0x4224d1){_0x3efa3a['push'](_0x3efa3a['shift']());}};_0x4b718d(++_0x5b6097);}(_0xc7d3,0x1d0));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x3c7d('0x0'));var events=[_0x3c7d('0x1'),_0x3c7d('0x2'),_0x3c7d('0x3')];function createListener(_0x3aa791,_0x45e686){return function(_0x59cc93){_0x45e686[_0x3c7d('0x4')](_0x3aa791,_0x59cc93);};}function removeListener(_0x17ef76,_0x1e46f4){return function(){MailAccountEvents[_0x3c7d('0x5')](_0x17ef76,_0x1e46f4);};}exports[_0x3c7d('0x6')]=function(_0x19d2eb){for(var _0x320372=0x0,_0x5c8d38=events[_0x3c7d('0x7')];_0x320372<_0x5c8d38;_0x320372++){var _0x6a2c75=events[_0x320372];var _0x469346=createListener('mailAccount:'+_0x6a2c75,_0x19d2eb);MailAccountEvents['on'](_0x6a2c75,_0x469346);}}; \ No newline at end of file +var _0xc1c6=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0xe58f7a,_0x1e59d3){var _0x591208=function(_0x213621){while(--_0x213621){_0xe58f7a['push'](_0xe58f7a['shift']());}};_0x591208(++_0x1e59d3);}(_0xc1c6,0x145));var _0x6c1c=function(_0x56de14,_0x376a46){_0x56de14=_0x56de14-0x0;var _0x1b0446=_0xc1c6[_0x56de14];return _0x1b0446;};'use strict';var MailAccountEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),'update'];function createListener(_0x5a876a,_0x118780){return function(_0x556e32){_0x118780[_0x6c1c('0x3')](_0x5a876a,_0x556e32);};}function removeListener(_0x3df146,_0x22f726){return function(){MailAccountEvents[_0x6c1c('0x4')](_0x3df146,_0x22f726);};}exports[_0x6c1c('0x5')]=function(_0x135890){for(var _0x3f30f4=0x0,_0x228c2b=events[_0x6c1c('0x6')];_0x3f30f4<_0x228c2b;_0x3f30f4++){var _0x153397=events[_0x3f30f4];var _0x45e0ee=createListener(_0x6c1c('0x7')+_0x153397,_0x135890);MailAccountEvents['on'](_0x153397,_0x45e0ee);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 6890ec7..e90713e 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 _0xd52a=['./mailApplication.controller','get','put','isAuthenticated','delete','/:id','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1e2414,_0x3687dc){var _0x5a2744=function(_0xa8c06a){while(--_0xa8c06a){_0x1e2414['push'](_0x1e2414['shift']());}};_0x5a2744(++_0x3687dc);}(_0xd52a,0xca));var _0xad52=function(_0x3363b9,_0xc41ba1){_0x3363b9=_0x3363b9-0x0;var _0x12ffbf=_0xd52a[_0x3363b9];return _0x12ffbf;};'use strict';var multer=require('multer');var util=require(_0xad52('0x0'));var path=require('path');var timeout=require(_0xad52('0x1'));var express=require(_0xad52('0x2'));var router=express[_0xad52('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xad52('0x4'));var config=require(_0xad52('0x5'));var controller=require(_0xad52('0x6'));router[_0xad52('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad52('0x8')]('/:id',auth[_0xad52('0x9')](),controller['update']);router[_0xad52('0xa')](_0xad52('0xb'),auth['isAuthenticated'](),controller[_0xad52('0xc')]);module['exports']=router; \ No newline at end of file +var _0x180f=['/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','update','delete'];(function(_0x2636ee,_0xa2019b){var _0x5be81e=function(_0x2093a4){while(--_0x2093a4){_0x2636ee['push'](_0x2636ee['shift']());}};_0x5be81e(++_0xa2019b);}(_0x180f,0xf3));var _0xf180=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x180f[_0x4e1a49];return _0x136aae;};'use strict';var multer=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var path=require('path');var timeout=require(_0xf180('0x2'));var express=require(_0xf180('0x3'));var router=express['Router']();var auth=require(_0xf180('0x4'));var interaction=require(_0xf180('0x5'));var config=require(_0xf180('0x6'));var controller=require(_0xf180('0x7'));router[_0xf180('0x8')]('/:id',auth[_0xf180('0x9')](),controller[_0xf180('0xa')]);router['put']('/:id',auth[_0xf180('0x9')](),controller[_0xf180('0xb')]);router[_0xf180('0xc')](_0xf180('0xd'),auth[_0xf180('0x9')](),controller[_0xf180('0xe')]);module[_0xf180('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8849a18..75fd6b0 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 _0x5cc3=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x138142,_0x30308f){var _0x3d203d=function(_0x272735){while(--_0x272735){_0x138142['push'](_0x138142['shift']());}};_0x3d203d(++_0x30308f);}(_0x5cc3,0x144));var _0x35cc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5cc3[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x35cc('0x0'));module[_0x35cc('0x1')]={'priority':{'type':Sequelize[_0x35cc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x35cc('0x3')],'allowNull':![],'defaultValue':_0x35cc('0x4')},'appdata':{'type':Sequelize[_0x35cc('0x5')]()},'description':{'type':Sequelize[_0x35cc('0x3')]},'interval':{'type':Sequelize[_0x35cc('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x762e=['sequelize','STRING','*,*,*,*'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x762e,0xea));var _0xe762=function(_0x130319,_0x5722d8){_0x130319=_0x130319-0x0;var _0x235ae3=_0x762e[_0x130319];return _0x235ae3;};'use strict';var Sequelize=require(_0xe762('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe762('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe762('0x1')]},'interval':{'type':Sequelize[_0xe762('0x1')],'defaultValue':_0xe762('0x2')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6905e1f..8b2c25b 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 _0xe13a=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','save','update','then','stack','name','send','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xe13a,0x178));var _0xae13=function(_0x48b174,_0x5767b8){_0x48b174=_0x48b174-0x0;var _0x37fb93=_0xe13a[_0x48b174];return _0x37fb93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae13('0x0'));var rimraf=require(_0xae13('0x1'));var zipdir=require(_0xae13('0x2'));var jsonpatch=require(_0xae13('0x3'));var rp=require('request-promise');var moment=require(_0xae13('0x4'));var BPromise=require(_0xae13('0x5'));var Mustache=require(_0xae13('0x6'));var util=require(_0xae13('0x7'));var path=require(_0xae13('0x8'));var sox=require(_0xae13('0x9'));var csv=require(_0xae13('0xa'));var ejs=require(_0xae13('0xb'));var fs=require('fs');var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0xa'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae13('0x15'))(_0xae13('0x16'));var utils=require(_0xae13('0x17'));var config=require(_0xae13('0x18'));var db=require(_0xae13('0x19'))['db'];function respondWithStatusCode(_0x3006f0,_0x1505c5){_0x1505c5=_0x1505c5||0xcc;return function(_0x4dd599){if(_0x4dd599){return _0x3006f0[_0xae13('0x1a')](_0x1505c5);}return _0x3006f0[_0xae13('0x1b')](_0x1505c5)['end']();};}function respondWithResult(_0x589803,_0x506411){_0x506411=_0x506411||0xc8;return function(_0x50f7c4){if(_0x50f7c4){return _0x589803['status'](_0x506411)[_0xae13('0x1c')](_0x50f7c4);}};}function respondWithFilteredResult(_0x148186,_0x44e141){return function(_0x90cdc1){if(_0x90cdc1){var _0x537889=_0x90cdc1['count'],_0x2912a2=_0x44e141[_0xae13('0x1d')],_0x5c25a4=_0x44e141[_0xae13('0x1d')]+_0x44e141[_0xae13('0x1e')],_0x3c488f;if(_0x5c25a4>=_0x537889){_0x5c25a4=_0x537889;_0x3c488f=0xc8;}else{_0x3c488f=0xce;}_0x148186[_0xae13('0x1b')](_0x3c488f);return _0x148186[_0xae13('0x1f')](_0xae13('0x20'),_0x2912a2+'-'+_0x5c25a4+'/'+_0x537889)[_0xae13('0x1c')](_0x90cdc1);}return null;};}function patchUpdates(_0x326471){return function(_0x42b307){try{jsonpatch['apply'](_0x42b307,_0x326471,!![]);}catch(_0x4462a5){return BPromise['reject'](_0x4462a5);}return _0x42b307[_0xae13('0x21')]();};}function saveUpdates(_0x1c66b7,_0x49c7d5){return function(_0x25a195){if(_0x25a195){return _0x25a195[_0xae13('0x22')](_0x1c66b7)[_0xae13('0x23')](function(_0x240802){return _0x240802;});}return null;};}function removeEntity(_0x184375,_0x2fd0e9){return function(_0x54b3b4){if(_0x54b3b4){return _0x54b3b4['destroy']()[_0xae13('0x23')](function(){_0x184375[_0xae13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168b92,_0x519a37){return function(_0x13c2de){if(!_0x13c2de){_0x168b92[_0xae13('0x1a')](0x194);}return _0x13c2de;};}function handleError(_0x3f12b0,_0x4b47d1){_0x4b47d1=_0x4b47d1||0x1f4;return function(_0x57124a){logger['error'](_0x57124a[_0xae13('0x24')]);if(_0x57124a[_0xae13('0x25')]){delete _0x57124a[_0xae13('0x25')];}_0x3f12b0['status'](_0x4b47d1)[_0xae13('0x26')](_0x57124a);};}exports['show']=function(_0x3d0d60,_0x5de054){var _0xbeda8d={'raw':!![],'where':{'id':_0x3d0d60['params']['id']}},_0x3117c2={};_0x3117c2[_0xae13('0x27')]=_[_0xae13('0x28')](db[_0xae13('0x29')][_0xae13('0x2a')]);_0x3117c2['query']=_[_0xae13('0x28')](_0x3d0d60[_0xae13('0x2b')]);_0x3117c2[_0xae13('0x2c')]=_[_0xae13('0x2d')](_0x3117c2[_0xae13('0x27')],_0x3117c2[_0xae13('0x2b')]);_0xbeda8d[_0xae13('0x2e')]=_['intersection'](_0x3117c2[_0xae13('0x27')],qs['fields'](_0x3d0d60[_0xae13('0x2b')][_0xae13('0x2f')]));_0xbeda8d[_0xae13('0x2e')]=_0xbeda8d[_0xae13('0x2e')][_0xae13('0x30')]?_0xbeda8d[_0xae13('0x2e')]:_0x3117c2[_0xae13('0x27')];if(_0x3d0d60['query']['includeAll']){_0xbeda8d[_0xae13('0x31')]=[{'all':!![]}];}_0xbeda8d=_[_0xae13('0x32')]({},_0xbeda8d,_0x3d0d60[_0xae13('0x33')]);return db[_0xae13('0x29')][_0xae13('0x34')](_0xbeda8d)[_0xae13('0x23')](handleEntityNotFound(_0x5de054,null))[_0xae13('0x23')](respondWithResult(_0x5de054,null))[_0xae13('0x35')](handleError(_0x5de054,null));};exports[_0xae13('0x22')]=function(_0x23f9d7,_0x5f1aeb){if(_0x23f9d7[_0xae13('0x36')]['id']){delete _0x23f9d7[_0xae13('0x36')]['id'];}return db[_0xae13('0x29')]['find']({'where':{'id':_0x23f9d7['params']['id']}})['then'](handleEntityNotFound(_0x5f1aeb,null))['then'](saveUpdates(_0x23f9d7['body'],null))['then'](respondWithResult(_0x5f1aeb,null))[_0xae13('0x35')](handleError(_0x5f1aeb,null));};exports[_0xae13('0x37')]=function(_0x34a801,_0x5bb32a){return db[_0xae13('0x29')][_0xae13('0x34')]({'where':{'id':_0x34a801[_0xae13('0x38')]['id']}})[_0xae13('0x23')](handleEntityNotFound(_0x5bb32a,null))[_0xae13('0x23')](removeEntity(_0x5bb32a,null))['catch'](handleError(_0x5bb32a,null));}; \ No newline at end of file +var _0x8f37=['then','destroy','error','stack','name','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','find','catch','body','params','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0x8f37,0x190));var _0x78f3=function(_0x181101,_0x2745f9){_0x181101=_0x181101-0x0;var _0x414148=_0x8f37[_0x181101];return _0x414148;};'use strict';var pdf=require(_0x78f3('0x0'));var emlformat=require(_0x78f3('0x1'));var rimraf=require(_0x78f3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x78f3('0x3'));var moment=require(_0x78f3('0x4'));var BPromise=require(_0x78f3('0x5'));var Mustache=require('mustache');var util=require(_0x78f3('0x6'));var path=require('path');var sox=require(_0x78f3('0x7'));var csv=require('to-csv');var ejs=require(_0x78f3('0x8'));var fs=require('fs');var _=require(_0x78f3('0x9'));var squel=require('squel');var crypto=require(_0x78f3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78f3('0xb'));var toCsv=require(_0x78f3('0xc'));var querystring=require('querystring');var Papa=require(_0x78f3('0xd'));var Redis=require(_0x78f3('0xe'));var authService=require(_0x78f3('0xf'));var qs=require(_0x78f3('0x10'));var hardwareService=require(_0x78f3('0x11'));var logger=require('../../config/logger')(_0x78f3('0x12'));var utils=require(_0x78f3('0x13'));var config=require('../../config/environment');var db=require(_0x78f3('0x14'))['db'];function respondWithStatusCode(_0x26466c,_0x2cc16b){_0x2cc16b=_0x2cc16b||0xcc;return function(_0x532f29){if(_0x532f29){return _0x26466c[_0x78f3('0x15')](_0x2cc16b);}return _0x26466c[_0x78f3('0x16')](_0x2cc16b)[_0x78f3('0x17')]();};}function respondWithResult(_0x244915,_0x58fe69){_0x58fe69=_0x58fe69||0xc8;return function(_0x1858f1){if(_0x1858f1){return _0x244915[_0x78f3('0x16')](_0x58fe69)[_0x78f3('0x18')](_0x1858f1);}};}function respondWithFilteredResult(_0x1b0f4c,_0x1059e0){return function(_0x225c7f){if(_0x225c7f){var _0x1e7a83=_0x225c7f[_0x78f3('0x19')],_0x3e2a15=_0x1059e0[_0x78f3('0x1a')],_0x453270=_0x1059e0[_0x78f3('0x1a')]+_0x1059e0[_0x78f3('0x1b')],_0x17172c;if(_0x453270>=_0x1e7a83){_0x453270=_0x1e7a83;_0x17172c=0xc8;}else{_0x17172c=0xce;}_0x1b0f4c[_0x78f3('0x16')](_0x17172c);return _0x1b0f4c[_0x78f3('0x1c')](_0x78f3('0x1d'),_0x3e2a15+'-'+_0x453270+'/'+_0x1e7a83)[_0x78f3('0x18')](_0x225c7f);}return null;};}function patchUpdates(_0x4a5db4){return function(_0x2f7ec9){try{jsonpatch[_0x78f3('0x1e')](_0x2f7ec9,_0x4a5db4,!![]);}catch(_0x53ee6a){return BPromise['reject'](_0x53ee6a);}return _0x2f7ec9['save']();};}function saveUpdates(_0x46d65d,_0x364a72){return function(_0x31621a){if(_0x31621a){return _0x31621a[_0x78f3('0x1f')](_0x46d65d)[_0x78f3('0x20')](function(_0x560510){return _0x560510;});}return null;};}function removeEntity(_0x369704,_0x2dfe51){return function(_0x116918){if(_0x116918){return _0x116918[_0x78f3('0x21')]()[_0x78f3('0x20')](function(){_0x369704[_0x78f3('0x16')](0xcc)[_0x78f3('0x17')]();});}};}function handleEntityNotFound(_0x213604,_0x18189e){return function(_0x3c6bf8){if(!_0x3c6bf8){_0x213604['sendStatus'](0x194);}return _0x3c6bf8;};}function handleError(_0x46f3a0,_0x172fda){_0x172fda=_0x172fda||0x1f4;return function(_0x48d727){logger[_0x78f3('0x22')](_0x48d727[_0x78f3('0x23')]);if(_0x48d727[_0x78f3('0x24')]){delete _0x48d727[_0x78f3('0x24')];}_0x46f3a0[_0x78f3('0x16')](_0x172fda)['send'](_0x48d727);};}exports[_0x78f3('0x25')]=function(_0x197837,_0xf0607f){var _0x28b923={'raw':!![],'where':{'id':_0x197837['params']['id']}},_0x1595b7={};_0x1595b7[_0x78f3('0x26')]=_[_0x78f3('0x27')](db[_0x78f3('0x28')][_0x78f3('0x29')]);_0x1595b7[_0x78f3('0x2a')]=_[_0x78f3('0x27')](_0x197837[_0x78f3('0x2a')]);_0x1595b7[_0x78f3('0x2b')]=_[_0x78f3('0x2c')](_0x1595b7[_0x78f3('0x26')],_0x1595b7[_0x78f3('0x2a')]);_0x28b923[_0x78f3('0x2d')]=_[_0x78f3('0x2c')](_0x1595b7[_0x78f3('0x26')],qs[_0x78f3('0x2e')](_0x197837[_0x78f3('0x2a')][_0x78f3('0x2e')]));_0x28b923[_0x78f3('0x2d')]=_0x28b923[_0x78f3('0x2d')][_0x78f3('0x2f')]?_0x28b923[_0x78f3('0x2d')]:_0x1595b7[_0x78f3('0x26')];if(_0x197837[_0x78f3('0x2a')]['includeAll']){_0x28b923[_0x78f3('0x30')]=[{'all':!![]}];}_0x28b923=_['merge']({},_0x28b923,_0x197837[_0x78f3('0x31')]);return db[_0x78f3('0x28')][_0x78f3('0x32')](_0x28b923)['then'](handleEntityNotFound(_0xf0607f,null))[_0x78f3('0x20')](respondWithResult(_0xf0607f,null))[_0x78f3('0x33')](handleError(_0xf0607f,null));};exports[_0x78f3('0x1f')]=function(_0x3228f6,_0x4854c0){if(_0x3228f6['body']['id']){delete _0x3228f6[_0x78f3('0x34')]['id'];}return db[_0x78f3('0x28')][_0x78f3('0x32')]({'where':{'id':_0x3228f6[_0x78f3('0x35')]['id']}})[_0x78f3('0x20')](handleEntityNotFound(_0x4854c0,null))['then'](saveUpdates(_0x3228f6[_0x78f3('0x34')],null))[_0x78f3('0x20')](respondWithResult(_0x4854c0,null))[_0x78f3('0x33')](handleError(_0x4854c0,null));};exports['destroy']=function(_0x4c00f1,_0x371976){return db[_0x78f3('0x28')]['find']({'where':{'id':_0x4c00f1[_0x78f3('0x35')]['id']}})[_0x78f3('0x20')](handleEntityNotFound(_0x371976,null))[_0x78f3('0x20')](removeEntity(_0x371976,null))[_0x78f3('0x33')](handleError(_0x371976,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 8b3f66a..c3021d4 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 _0xf70e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x102b64,_0x43bd50){var _0x4217a1=function(_0x26f45e){while(--_0x26f45e){_0x102b64['push'](_0x102b64['shift']());}};_0x4217a1(++_0x43bd50);}(_0xf70e,0x1ae));var _0xef70=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0xf70e[_0x4b8968];return _0x3a0ab7;};'use strict';var _=require(_0xef70('0x0'));var util=require(_0xef70('0x1'));var logger=require(_0xef70('0x2'))(_0xef70('0x3'));var moment=require(_0xef70('0x4'));var BPromise=require(_0xef70('0x5'));var rp=require(_0xef70('0x6'));var fs=require('fs');var path=require(_0xef70('0x7'));var rimraf=require(_0xef70('0x8'));var config=require(_0xef70('0x9'));var attributes=require(_0xef70('0xa'));module[_0xef70('0xb')]=function(_0x48fc5f,_0xfb890){return _0x48fc5f[_0xef70('0xc')]('MailApplication',attributes,{'tableName':_0xef70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef70('0xe'),'collate':_0xef70('0xf')});}; \ No newline at end of file +var _0xfb66=['rimraf','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xfb66,0xf7));var _0x6fb6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfb66[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6fb6('0x0'));var util=require(_0x6fb6('0x1'));var logger=require(_0x6fb6('0x2'))(_0x6fb6('0x3'));var moment=require(_0x6fb6('0x4'));var BPromise=require(_0x6fb6('0x5'));var rp=require(_0x6fb6('0x6'));var fs=require('fs');var path=require(_0x6fb6('0x7'));var rimraf=require(_0x6fb6('0x8'));var config=require('../../config/environment');var attributes=require(_0x6fb6('0x9'));module[_0x6fb6('0xa')]=function(_0x1041f5,_0x374f2e){return _0x1041f5[_0x6fb6('0xb')](_0x6fb6('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6fb6('0xd'),'collate':_0x6fb6('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index a86570b..21e090b 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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x58652a,_0x1b8060){var _0x2caac0=function(_0x4b4e38){while(--_0x4b4e38){_0x58652a['push'](_0x58652a['shift']());}};_0x2caac0(++_0x1b8060);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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']('MailApplication,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x30b1f4,_0x32a0fe){var _0x57c004=function(_0x11e26f){while(--_0x11e26f){_0x30b1f4['push'](_0x30b1f4['shift']());}};_0x57c004(++_0x32a0fe);}(_0x7a54,0x106));var _0x47a5=function(_0x421da9,_0x2759ea){_0x421da9=_0x421da9-0x0;var _0x574ecc=_0x7a54[_0x421da9];return _0x574ecc;};'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')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a30a3a2..ea2f086 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 _0xedd9=['isAuthenticated','index','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2f2bcf,_0x2348dc){var _0x1f7259=function(_0x2a12c5){while(--_0x2a12c5){_0x2f2bcf['push'](_0x2f2bcf['shift']());}};_0x1f7259(++_0x2348dc);}(_0xedd9,0xfc));var _0x9edd=function(_0x36ade4,_0x1faea0){_0x36ade4=_0x36ade4-0x0;var _0x8f7ac0=_0xedd9[_0x36ade4];return _0x8f7ac0;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./mailInteraction.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0x8')]('/:id/download',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router['post']('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')](_0x9edd('0xd'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x11')](_0x9edd('0x13'),auth['isAuthenticated'](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),_0x9edd('0x16')),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')]('mail',_0x9edd('0x19')),controller[_0x9edd('0x1a')]);router[_0x9edd('0x1b')]('/:id',auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),'mailinteraction:destroy'),controller[_0x9edd('0x1c')]);router['delete'](_0x9edd('0x13'),auth[_0x9edd('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x00bb=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','addTags','put','update','delete','destroy','removeTags','exports','multer','util','path','express'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['get'](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0x7')](_0xb00b('0xe'),auth['isAuthenticated'](),controller[_0xb00b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb00b('0x10')](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0x11')]);router[_0xb00b('0x10')](_0xb00b('0x12'),auth['isAuthenticated'](),interaction[_0xb00b('0x13')](_0xb00b('0x14'),'mailinteraction:addtags'),controller[_0xb00b('0x15')]);router[_0xb00b('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0xb00b('0x13')]('mail','mailinteraction:update'),controller[_0xb00b('0x17')]);router[_0xb00b('0x18')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),interaction['tracked'](_0xb00b('0x14'),'mailinteraction:destroy'),controller[_0xb00b('0x19')]);router['delete'](_0xb00b('0x12'),auth['isAuthenticated'](),controller[_0xb00b('0x1a')]);module[_0xb00b('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 390d4dd..8ed431c 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 _0x52db=['iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','sequelize'];(function(_0x5a30d7,_0x3e5e7b){var _0x29efa8=function(_0x905010){while(--_0x905010){_0x5a30d7['push'](_0x5a30d7['shift']());}};_0x29efa8(++_0x3e5e7b);}(_0x52db,0x1a3));var _0xb52d=function(_0x51d157,_0x2acf38){_0x51d157=_0x51d157-0x0;var _0x15d542=_0x52db[_0x51d157];return _0x15d542;};'use strict';var Sequelize=require(_0xb52d('0x0'));var iconv=require(_0xb52d('0x1'));module[_0xb52d('0x2')]={'closed':{'type':Sequelize[_0xb52d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb52d('0x4')]},'inReplyTo':{'type':Sequelize[_0xb52d('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb52d('0x4')]},'cc':{'type':Sequelize[_0xb52d('0x5')](_0xb52d('0x6'))},'subject':{'type':Sequelize[_0xb52d('0x5')]()},'attach':{'type':Sequelize[_0xb52d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb52d('0x7')]},'substatus':{'type':Sequelize[_0xb52d('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb52d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb52d('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xb52d('0x8')]('in',_0xb52d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xb52d('0x5')]('long')},'lastMsgText':{'type':Sequelize[_0xb52d('0x5')](_0xb52d('0x6'))}}; \ No newline at end of file +var _0x2ff0=['DATE','STRING','TEXT','ENUM','out','long','sequelize','iconv','BOOLEAN'];(function(_0x3201bf,_0x3fbc6b){var _0x154e68=function(_0x5a7c2a){while(--_0x5a7c2a){_0x3201bf['push'](_0x3201bf['shift']());}};_0x154e68(++_0x3fbc6b);}(_0x2ff0,0x72));var _0x02ff=function(_0x14c8fb,_0x29a4ab){_0x14c8fb=_0x14c8fb-0x0;var _0x220dfe=_0x2ff0[_0x14c8fb];return _0x220dfe;};'use strict';var Sequelize=require(_0x02ff('0x0'));var iconv=require(_0x02ff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x02ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x02ff('0x3')]},'disposition':{'type':Sequelize[_0x02ff('0x4')]},'note':{'type':Sequelize[_0x02ff('0x4')]},'inReplyTo':{'type':Sequelize[_0x02ff('0x4')](0x1fe)},'to':{'type':Sequelize[_0x02ff('0x4')]},'cc':{'type':Sequelize[_0x02ff('0x5')]('long')},'subject':{'type':Sequelize[_0x02ff('0x5')]()},'attach':{'type':Sequelize[_0x02ff('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x02ff('0x3')]},'substatus':{'type':Sequelize[_0x02ff('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x02ff('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x02ff('0x6')]('in',_0x02ff('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x02ff('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x02ff('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x02ff('0x5')](_0x02ff('0x8'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x02ff('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9719a4e..95df1e9 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 _0xa5d0=['lastMsgBody','rows','catch','show','params','includeAll','include','options','find','create','body','describe','MailMessage','ids','omit','sort','spread','findAll','emit','removeTags','download','unix','root','server','tmp','interaction-%s.zip','bcc','subject','attachments','Attachment','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','status','json','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','MailInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','pick','select','field','color','COUNT(*)','from','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','parse','forEach','createdAt','value','dateStart','utc','endOf','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','Messages.count','LIKE','c.firstName','c.email','map','filter','isEmpty','MailAccountId','concat','$gte','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','advancedFilter','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','%s\x20>\x200','sequelize','count','keyBy','merge','Account.key','i.*','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Users','Tags','push','lastMsgText','trimStart','fromString'];(function(_0x2ac0b0,_0x115490){var _0x352688=function(_0xbd450e){while(--_0xbd450e){_0x2ac0b0['push'](_0x2ac0b0['shift']());}};_0x352688(++_0x115490);}(_0xa5d0,0x100));var _0x0a5d=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa5d0[_0x484e36];return _0xafc85d;};'use strict';var pdf=require(_0x0a5d('0x0'));var emlformat=require(_0x0a5d('0x1'));var rimraf=require(_0x0a5d('0x2'));var zipdir=require(_0x0a5d('0x3'));var jsonpatch=require(_0x0a5d('0x4'));var rp=require(_0x0a5d('0x5'));var moment=require('moment');var BPromise=require(_0x0a5d('0x6'));var Mustache=require(_0x0a5d('0x7'));var util=require(_0x0a5d('0x8'));var path=require(_0x0a5d('0x9'));var sox=require(_0x0a5d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a5d('0xb'));var squel=require(_0x0a5d('0xc'));var crypto=require(_0x0a5d('0xd'));var jsforce=require(_0x0a5d('0xe'));var deskjs=require(_0x0a5d('0xf'));var toCsv=require(_0x0a5d('0x10'));var querystring=require(_0x0a5d('0x11'));var Papa=require(_0x0a5d('0x12'));var htmlToText=require(_0x0a5d('0x13'));var Redis=require(_0x0a5d('0x14'));var authService=require(_0x0a5d('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0a5d('0x16'));var logger=require(_0x0a5d('0x17'))(_0x0a5d('0x18'));var utils=require(_0x0a5d('0x19'));var config=require(_0x0a5d('0x1a'));var db=require(_0x0a5d('0x1b'))['db'];config[_0x0a5d('0x1c')]=_[_0x0a5d('0x1d')](config[_0x0a5d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a5d('0x1e'))(new Redis(config[_0x0a5d('0x1c')]));require(_0x0a5d('0x1f'))['register'](socket);function respondWithStatusCode(_0x513422,_0x516931){_0x516931=_0x516931||0xcc;return function(_0x27c18b){if(_0x27c18b){return _0x513422['sendStatus'](_0x516931);}return _0x513422['status'](_0x516931)['end']();};}function respondWithResult(_0x19941b,_0x3be666){_0x3be666=_0x3be666||0xc8;return function(_0x58a021){if(_0x58a021){return _0x19941b[_0x0a5d('0x20')](_0x3be666)[_0x0a5d('0x21')](_0x58a021);}};}function respondWithFilteredResult(_0x4e3057,_0x40d35e){return function(_0x17bcd6){if(_0x17bcd6){var _0x1854b2=_0x17bcd6['count'],_0x4b548a=_0x40d35e['offset'],_0x52c14f=_0x40d35e['offset']+_0x40d35e[_0x0a5d('0x22')],_0x54f25f;if(_0x52c14f>=_0x1854b2){_0x52c14f=_0x1854b2;_0x54f25f=0xc8;}else{_0x54f25f=0xce;}_0x4e3057['status'](_0x54f25f);return _0x4e3057[_0x0a5d('0x23')](_0x0a5d('0x24'),_0x4b548a+'-'+_0x52c14f+'/'+_0x1854b2)['json'](_0x17bcd6);}return null;};}function patchUpdates(_0x2ae42b){return function(_0x3b407e){try{jsonpatch[_0x0a5d('0x25')](_0x3b407e,_0x2ae42b,!![]);}catch(_0x2490dd){return BPromise[_0x0a5d('0x26')](_0x2490dd);}return _0x3b407e['save']();};}function saveUpdates(_0x518f30,_0x32612c){return function(_0x43f07){if(_0x43f07){return _0x43f07[_0x0a5d('0x27')](_0x518f30)['then'](function(_0x4de918){return _0x4de918;});}return null;};}function removeEntity(_0x3e0437,_0xe21ce6){return function(_0x409e91){if(_0x409e91){return _0x409e91['destroy']()[_0x0a5d('0x28')](function(){_0x3e0437[_0x0a5d('0x20')](0xcc)[_0x0a5d('0x29')]();});}};}function handleEntityNotFound(_0x887fbf,_0x145b67){return function(_0x28b99a){if(!_0x28b99a){_0x887fbf[_0x0a5d('0x2a')](0x194);}return _0x28b99a;};}function handleError(_0x34fb16,_0x403d20){_0x403d20=_0x403d20||0x1f4;return function(_0x222b5c){logger[_0x0a5d('0x2b')](_0x222b5c['stack']);if(_0x222b5c[_0x0a5d('0x2c')]){delete _0x222b5c[_0x0a5d('0x2c')];}_0x34fb16[_0x0a5d('0x20')](_0x403d20)[_0x0a5d('0x2d')](_0x222b5c);};}exports['index']=function(_0x40dbed,_0x2b3aed){var _0xcbe1f={},_0x36cf23={},_0x1d97f7={'count':0x0,'rows':[]};var _0x5ac4e7=db[_0x0a5d('0x2e')][_0x0a5d('0x2f')];_0x36cf23[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x5ac4e7);_0x36cf23[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x40dbed['query']);_0x36cf23[_0x0a5d('0x33')]=_[_0x0a5d('0x34')](_0x36cf23[_0x0a5d('0x30')],_0x36cf23['query']);_0xcbe1f['attributes']=_[_0x0a5d('0x34')](_0x36cf23['model'],qs[_0x0a5d('0x35')](_0x40dbed[_0x0a5d('0x32')]['fields']));_0xcbe1f[_0x0a5d('0x36')]=_0xcbe1f[_0x0a5d('0x36')][_0x0a5d('0x37')]?_0xcbe1f['attributes']:_0x36cf23[_0x0a5d('0x30')];if(!_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x38')](_0x0a5d('0x39'))){_0xcbe1f[_0x0a5d('0x22')]=qs[_0x0a5d('0x22')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x22')]);_0xcbe1f[_0x0a5d('0x3a')]=qs[_0x0a5d('0x3a')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x3a')]);}_0xcbe1f[_0x0a5d('0x3b')]=qs['sort'](_0x40dbed[_0x0a5d('0x32')]['sort']);_0xcbe1f[_0x0a5d('0x3c')]=qs[_0x0a5d('0x33')](_[_0x0a5d('0x3d')](_0x40dbed[_0x0a5d('0x32')],_0x36cf23[_0x0a5d('0x33')]));var _0x20aa11=[];var _0x41ae64=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')]('id')[_0x0a5d('0x3f')](_0x0a5d('0x2c'))['field'](_0x0a5d('0x40'))['from']('tools_tags');var _0xba4ec7=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')](_0x0a5d('0x41'))[_0x0a5d('0x42')]('mail_messages','me')[_0x0a5d('0x3c')](_0x0a5d('0x43'))['where'](_0x0a5d('0x44'))[_0x0a5d('0x3c')](_0x0a5d('0x45'));var _0x2f1370=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')](_0x0a5d('0x46'))[_0x0a5d('0x3f')](_0x0a5d('0x47'))['from'](_0x0a5d('0x48'),'ui')[_0x0a5d('0x49')](_0x0a5d('0x4a'),'u',_0x0a5d('0x4b'));var _0x1f3b22=squel['select']()[_0x0a5d('0x42')](_0x0a5d('0x4c'),'i')[_0x0a5d('0x49')](_0x0a5d('0x48'),'ui',_0x0a5d('0x4d'))[_0x0a5d('0x49')](_0x0a5d('0x4a'),'u',_0x0a5d('0x4b'))[_0x0a5d('0x49')]('cm_contacts','c',_0x0a5d('0x4e'))[_0x0a5d('0x49')]('users','o','o.id\x20=\x20i.UserId')[_0x0a5d('0x49')]('mail_accounts','a',_0x0a5d('0x4f'))[_0x0a5d('0x49')](_0x0a5d('0x50'),'me','me.MailInteractionId\x20=\x20i.id');var _0x5c0538=squel['expr']();if(_0x40dbed[_0x0a5d('0x32')]['advancedFilter']){var _0x2d8ee7=JSON[_0x0a5d('0x51')](_0x40dbed['query']['advancedFilter']);_[_0x0a5d('0x31')](_0x2d8ee7)[_0x0a5d('0x52')](function(_0x36ab82){var _0x1ff7ea=_0x2d8ee7[_0x36ab82];if(_0x36ab82===_0x0a5d('0x53')){var _0x299b6f=moment(_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x55')])['startOf']('day')[_0x0a5d('0x56')]()['format']();var _0x5e5b9d=moment(_0x5e5b9d)[_0x0a5d('0x56')]()[_0x0a5d('0x57')]('day')[_0x0a5d('0x58')]();_0x5c0538[_0x0a5d('0x59')](_0x0a5d('0x5a'),_0x299b6f,_0x5e5b9d);}else{if(_[_0x0a5d('0x5b')](_0x1ff7ea['condition'])){_0x1ff7ea[_0x0a5d('0x5c')][_0x0a5d('0x52')](function(_0x50c196){switch(_0x1ff7ea[_0x0a5d('0x5c')]['value']){case'IS':if(_0x36ab82!==_0x0a5d('0x5d')&&_0x36ab82!=='Messages.count'){if(_[_0x0a5d('0x5b')](_0x1ff7ea[_0x0a5d('0x54')])&&_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x37')]>0x1){_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x5f'),_0x1ff7ea[_0x0a5d('0x54')]);}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea[_0x0a5d('0x54')][0x0]);}}break;case'=':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'LIKE':if(_0x36ab82===_0x0a5d('0x61')){_0x5c0538[_0x0a5d('0x59')]('c.firstName'+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x63')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or']('c.email'+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}break;case'>':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x64'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'<':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x65'),_0x1ff7ea['value']);break;}});}else{switch(_0x1ff7ea[_0x0a5d('0x5c')][_0x0a5d('0x54')]){case'IS':if(_0x36ab82!==_0x0a5d('0x5d')&&_0x36ab82!==_0x0a5d('0x66')){if(_[_0x0a5d('0x5b')](_0x1ff7ea[_0x0a5d('0x54')])&&_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x37')]>0x1){_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x5f'),_0x1ff7ea[_0x0a5d('0x54')]);}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea['value'][0x0]);}}break;case'=':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea['value']);break;case _0x0a5d('0x67'):if(_0x36ab82==='ContactId'){_0x5c0538[_0x0a5d('0x59')](_0x0a5d('0x68')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x63')+'\x20LIKE\x20?','%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x69')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}break;case'>':_0x5c0538['and'](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x64'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'<':_0x5c0538['and'](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x65'),_0x1ff7ea[_0x0a5d('0x54')]);break;}}}});}else{var _0x762871=_(Object[_0x0a5d('0x31')](_0x40dbed['query']))[_0x0a5d('0x6a')](function(_0x42e8f3){return _0x5ac4e7[_0x0a5d('0x38')](_0x42e8f3)?_0x42e8f3:undefined;})[_0x0a5d('0x6b')](function(_0x1bf258){return!_['isNil'](_0x1bf258);})[_0x0a5d('0x54')]();if(!_[_0x0a5d('0x6c')](_0x762871)){_0x762871[_0x0a5d('0x52')](function(_0x408823){if(_0x408823===_0x0a5d('0x6d')){_0x1f3b22['where']('i.MailAccountId\x20IN\x20?',[][_0x0a5d('0x6e')](_0x40dbed[_0x0a5d('0x32')][_0x408823]));}else if(_0x408823==='createdAt'){var _0x2715ac=JSON[_0x0a5d('0x51')](_0x40dbed[_0x0a5d('0x32')][_0x408823])[_0x0a5d('0x6f')];var _0x44319c=JSON[_0x0a5d('0x51')](_0x40dbed[_0x0a5d('0x32')][_0x408823])[_0x0a5d('0x70')];_0x1f3b22[_0x0a5d('0x3c')](_0x0a5d('0x5a'),_0x2715ac,_0x44319c);}else{_0x1f3b22[_0x0a5d('0x3c')]('i.'+_0x408823+_0x0a5d('0x60'),_0x40dbed[_0x0a5d('0x32')][_0x408823]);}});}if(_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x6b')]){var _0x3cf3ff=_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x6b')][_0x0a5d('0x71')]('\x5c','\x5c\x5c')[_0x0a5d('0x71')]('\x27\x27',_0x0a5d('0x72'));if(qs[_0x0a5d('0x73')](_0x3cf3ff)){_0x5c0538['or'](_0x0a5d('0x74'),_0x3cf3ff+'%');}else if(qs[_0x0a5d('0x75')](_0x3cf3ff)){_0x5c0538['or'](_0x0a5d('0x76'),_0x3cf3ff+'%');}else{var _0x2287db=[];_0x3cf3ff['split']('\x20')[_0x0a5d('0x52')](function(_0x42521c){_0x2287db['push']('+'+_0x42521c[_0x0a5d('0x77')]());});var _0x5b8230=_0x2287db[_0x0a5d('0x78')]('\x20');_0x5c0538['or'](_0x0a5d('0x79'),_0x5b8230)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x5b8230);}}}_0x1f3b22[_0x0a5d('0x3c')](_0x5c0538);if(_0xcbe1f[_0x0a5d('0x3b')]){_0xcbe1f[_0x0a5d('0x3b')][_0x0a5d('0x52')](function(_0x59a49a){_0x1f3b22['order']('i.'+_0x59a49a[0x0],_0x59a49a[0x1]==='DESC'?![]:!![]);});}_0x1f3b22[_0x0a5d('0x7a')](_0x0a5d('0x7b'));var _0x31796c={'type':db[_0x0a5d('0x7c')][_0x0a5d('0x7d')][_0x0a5d('0x7e')],'raw':!![]};var _0x4d7bc5=_0x1f3b22[_0x0a5d('0x7f')]()[_0x0a5d('0x3f')](_0x0a5d('0x41'));if(!_0x40dbed['query'][_0x0a5d('0x80')]){if(_0x40dbed['query'][_0x0a5d('0x81')]){if(_0x40dbed[_0x0a5d('0x32')]['read']==0x1){_0x4d7bc5[_0x0a5d('0x3c')](util[_0x0a5d('0x58')](_0x0a5d('0x82'),_0xba4ec7[_0x0a5d('0x77')]()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x84'));}else{_0x4d7bc5['where'](util[_0x0a5d('0x58')]('%s\x20>\x200',_0xba4ec7[_0x0a5d('0x77')]()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x85'));}}if(_0x40dbed[_0x0a5d('0x32')]['tag']){var _0x22f580=_[_0x0a5d('0x5b')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x86')])?_0x40dbed[_0x0a5d('0x32')]['tag']:new Array(_0x40dbed['query'][_0x0a5d('0x86')]);var _0x10487d=squel[_0x0a5d('0x87')]();_0x22f580['forEach'](function(_0x392741){_0x10487d['or'](_0x0a5d('0x88'),'%,'+_0x392741+',%');});_0x1f3b22[_0x0a5d('0x83')](_0x10487d);_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x89'),'it','it.MailInteractionId\x20=\x20i.id');_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x8a'),'t',_0x0a5d('0x8b'));_0x4d7bc5[_0x0a5d('0x3c')]('t.id\x20IN\x20?',_0x22f580);}}else{var _0x2d8ee7=JSON[_0x0a5d('0x51')](_0x40dbed['query']['advancedFilter']);_[_0x0a5d('0x31')](_0x2d8ee7)['forEach'](function(_0xc48998){var _0x3ad924=_0x2d8ee7[_0xc48998];if(_0xc48998==='TagId'){var _0x2c389e=_0x3ad924[_0x0a5d('0x54')];var _0x29b7ad=squel[_0x0a5d('0x87')]();_0x2c389e[_0x0a5d('0x52')](function(_0x557c93){_0x29b7ad['or'](_0x0a5d('0x88'),'%,'+_0x557c93+',%');});_0x1f3b22[_0x0a5d('0x83')](_0x29b7ad);_0x4d7bc5[_0x0a5d('0x49')]('mail_interaction_has_tags','it',_0x0a5d('0x8c'));_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x8a'),'t',_0x0a5d('0x8b'));_0x4d7bc5[_0x0a5d('0x3c')](_0x0a5d('0x8d'),_0x2c389e);}else if(_0xc48998===_0x0a5d('0x66')){if(_0x3ad924[_0x0a5d('0x54')][_0x0a5d('0x37')]===0x1){if(_0x3ad924[_0x0a5d('0x54')][0x0]===0x1){_0x4d7bc5[_0x0a5d('0x3c')](util['format'](_0x0a5d('0x82'),_0xba4ec7['toString']()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x84'));}else{_0x4d7bc5['where'](util[_0x0a5d('0x58')](_0x0a5d('0x8e'),_0xba4ec7['toString']()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x85'));}}}});}db[_0x0a5d('0x8f')][_0x0a5d('0x32')](_0x4d7bc5[_0x0a5d('0x77')](),_0x31796c)['then'](function(_0x23879b){_0x1d97f7[_0x0a5d('0x90')]=_0x23879b['length'];if(_0x1d97f7[_0x0a5d('0x90')]===0x0)return[];return db[_0x0a5d('0x8f')]['query'](_0x41ae64[_0x0a5d('0x77')](),_0x31796c)[_0x0a5d('0x28')](function(_0x184348){_0x20aa11=_[_0x0a5d('0x91')](_0x184348,'id');_0x31796c=_[_0x0a5d('0x92')](_0x31796c,{'model':db[_0x0a5d('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1f3b22[_0x0a5d('0x3f')](_0xba4ec7,_0x0a5d('0x66'));_0x1f3b22[_0x0a5d('0x3f')]('a.key',_0x0a5d('0x93'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x94'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x68'),'Contact.firstName');_0x1f3b22['field'](_0x0a5d('0x63'),'Contact.lastName');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x69'),_0x0a5d('0x95'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x96'),'Contact.phone');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x97'),'Contact.mobile');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x98'),_0x0a5d('0x99'));_0x1f3b22[_0x0a5d('0x3f')]('u.fullname',_0x0a5d('0x9a'));_0x1f3b22['field'](_0x0a5d('0x9b'),_0x0a5d('0x9c'));_0x1f3b22[_0x0a5d('0x49')](_0x0a5d('0x89'),'it',_0x0a5d('0x8c'));_0x1f3b22[_0x0a5d('0x49')]('tools_tags','t',_0x0a5d('0x8b'));_0x1f3b22[_0x0a5d('0x22')](_0xcbe1f[_0x0a5d('0x22')]);_0x1f3b22[_0x0a5d('0x3a')](_0xcbe1f['offset']);return db[_0x0a5d('0x8f')]['query'](_0x1f3b22[_0x0a5d('0x77')](),_0x31796c);})[_0x0a5d('0x28')](function(_0x2af292){_0x2f1370[_0x0a5d('0x3c')](_0x0a5d('0x9d'),_[_0x0a5d('0x6a')](_0x2af292,'id'));return db['sequelize'][_0x0a5d('0x32')](_0x2f1370[_0x0a5d('0x77')](),_0x31796c)['then'](function(_0x3c9ceb){var _0x1bb41f=_[_0x0a5d('0x9e')](_0x3c9ceb,_0x0a5d('0x9f'));_0x2af292[_0x0a5d('0x52')](function(_0x8cdbb0){if(_0x1bb41f[_0x8cdbb0['id']]){_0x8cdbb0[_0x0a5d('0xa0')]=_[_0x0a5d('0x6a')](_0x1bb41f[_0x8cdbb0['id']],function(_0x3d2f37){return{'id':_0x3d2f37['id']};});}if(_0x8cdbb0[_0x0a5d('0x9c')]){_0x8cdbb0['Tags']=[];_0x8cdbb0['TagIds']['split'](',')['forEach'](function(_0x3eb2a2){_0x8cdbb0[_0x0a5d('0xa1')][_0x0a5d('0xa2')](_0x20aa11[_0x3eb2a2]);});}delete _0x8cdbb0['TagIds'];if(!_0x8cdbb0[_0x0a5d('0xa3')]){_0x8cdbb0[_0x0a5d('0xa3')]=_[_0x0a5d('0xa4')](htmlToText[_0x0a5d('0xa5')](_0x8cdbb0[_0x0a5d('0xa6')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x2af292;});});})[_0x0a5d('0x28')](function(_0x54d931){_0x1d97f7[_0x0a5d('0xa7')]=_0x54d931;return _0x1d97f7;})['then'](respondWithFilteredResult(_0x2b3aed,_0xcbe1f))[_0x0a5d('0xa8')](handleError(_0x2b3aed,null));};exports[_0x0a5d('0xa9')]=function(_0x2ca917,_0x4daec3){var _0xde5d1b={'raw':![],'where':{'id':_0x2ca917[_0x0a5d('0xaa')]['id']}},_0x39f04c={};_0x39f04c['model']=_['keys'](db[_0x0a5d('0x2e')][_0x0a5d('0x2f')]);_0x39f04c['query']=_[_0x0a5d('0x31')](_0x2ca917['query']);_0x39f04c['filters']=_[_0x0a5d('0x34')](_0x39f04c[_0x0a5d('0x30')],_0x39f04c[_0x0a5d('0x32')]);_0xde5d1b[_0x0a5d('0x36')]=_[_0x0a5d('0x34')](_0x39f04c[_0x0a5d('0x30')],qs[_0x0a5d('0x35')](_0x2ca917[_0x0a5d('0x32')]['fields']));_0xde5d1b[_0x0a5d('0x36')]=_0xde5d1b['attributes'][_0x0a5d('0x37')]?_0xde5d1b[_0x0a5d('0x36')]:_0x39f04c[_0x0a5d('0x30')];if(_0x2ca917[_0x0a5d('0x32')][_0x0a5d('0xab')]){_0xde5d1b[_0x0a5d('0xac')]=[{'all':!![]}];}_0xde5d1b=_[_0x0a5d('0x92')]({},_0xde5d1b,_0x2ca917[_0x0a5d('0xad')]);return db['MailInteraction'][_0x0a5d('0xae')](_0xde5d1b)['then'](handleEntityNotFound(_0x4daec3,null))[_0x0a5d('0x28')](respondWithResult(_0x4daec3,null))[_0x0a5d('0xa8')](handleError(_0x4daec3,null));};exports[_0x0a5d('0xaf')]=function(_0x489644,_0x571400){return db['MailInteraction'][_0x0a5d('0xaf')](_0x489644[_0x0a5d('0xb0')],{})[_0x0a5d('0x28')](respondWithResult(_0x571400,0xc9))['catch'](handleError(_0x571400,null));};exports[_0x0a5d('0x27')]=function(_0x4620b6,_0x2f3843){if(_0x4620b6[_0x0a5d('0xb0')]['id']){delete _0x4620b6[_0x0a5d('0xb0')]['id'];}return db[_0x0a5d('0x2e')][_0x0a5d('0xae')]({'where':{'id':_0x4620b6[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x2f3843,null))['then'](saveUpdates(_0x4620b6[_0x0a5d('0xb0')],null))['then'](respondWithResult(_0x2f3843,null))['catch'](handleError(_0x2f3843,null));};exports['destroy']=function(_0x39c547,_0x3c7d53){return db['MailInteraction'][_0x0a5d('0xae')]({'where':{'id':_0x39c547[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x3c7d53,null))[_0x0a5d('0x28')](removeEntity(_0x3c7d53,null))[_0x0a5d('0xa8')](handleError(_0x3c7d53,null));};exports[_0x0a5d('0xb1')]=function(_0x11aba2,_0x42593e){return db['MailInteraction'][_0x0a5d('0xb1')]()[_0x0a5d('0x28')](respondWithResult(_0x42593e,null))[_0x0a5d('0xa8')](handleError(_0x42593e,null));};exports['addMessage']=function(_0x3e0a31,_0x12c9a2,_0x46e1f9){return db[_0x0a5d('0xb2')]['find']({'where':{'id':_0x3e0a31[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x12c9a2,null))[_0x0a5d('0x28')](function(_0x33f43e){if(_0x33f43e){return _0x33f43e['addMessage'](_0x3e0a31['body'][_0x0a5d('0xb3')],_[_0x0a5d('0xb4')](_0x3e0a31[_0x0a5d('0xb0')],[_0x0a5d('0xb3'),'id'])||{});}})[_0x0a5d('0x28')](respondWithResult(_0x12c9a2,null))[_0x0a5d('0xa8')](handleError(_0x12c9a2,null));};exports['getMessages']=function(_0x450494,_0x555f90,_0x211447){var _0x2d7dcc={'raw':![],'where':{}};var _0x356d47={};var _0x1a183b={'count':0x0,'rows':[]};return db[_0x0a5d('0x2e')]['findOne']({'where':{'id':_0x450494[_0x0a5d('0xaa')]['id']}})['then'](handleEntityNotFound(_0x555f90,null))['then'](function(_0x1671ac){if(_0x1671ac){_0x356d47[_0x0a5d('0x30')]=_['keys'](db[_0x0a5d('0xb2')]['rawAttributes']);_0x356d47[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x450494[_0x0a5d('0x32')]);_0x356d47[_0x0a5d('0x33')]=_['intersection'](_0x356d47['model'],_0x356d47[_0x0a5d('0x32')]);_0x2d7dcc[_0x0a5d('0x36')]=_[_0x0a5d('0x34')](_0x356d47[_0x0a5d('0x30')],qs[_0x0a5d('0x35')](_0x450494[_0x0a5d('0x32')]['fields']));_0x2d7dcc[_0x0a5d('0x36')]=_0x2d7dcc['attributes'][_0x0a5d('0x37')]?_0x2d7dcc['attributes']:_0x356d47[_0x0a5d('0x30')];if(!_0x450494[_0x0a5d('0x32')][_0x0a5d('0x38')](_0x0a5d('0x39'))){_0x2d7dcc[_0x0a5d('0x22')]=qs[_0x0a5d('0x22')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0x22')]);_0x2d7dcc[_0x0a5d('0x3a')]=qs[_0x0a5d('0x3a')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0x3a')]);}_0x2d7dcc[_0x0a5d('0x3b')]=qs[_0x0a5d('0xb5')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0xb5')]);_0x2d7dcc['where']=qs['filters'](_[_0x0a5d('0x3d')](_0x450494[_0x0a5d('0x32')],_0x356d47[_0x0a5d('0x33')]));_0x2d7dcc['where']['MailInteractionId']=_0x1671ac['id'];if(_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6b')]){_0x2d7dcc[_0x0a5d('0x3c')]=_['merge'](_0x2d7dcc[_0x0a5d('0x3c')],{'$or':_[_0x0a5d('0x6a')](_0x2d7dcc[_0x0a5d('0x36')],function(_0x3af778){var _0x30f65d={};_0x30f65d[_0x3af778]={'$like':'%'+_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6b')]+'%'};return _0x30f65d;})});}if(_0x450494['query'][_0x0a5d('0x6f')]){var _0x3c963f=_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6f')]['split'](',');var _0x19a87f={};_0x19a87f[_0x3c963f[0x0]]={'$gte':moment(_0x3c963f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2d7dcc[_0x0a5d('0x3c')]=_[_0x0a5d('0x92')](_0x2d7dcc[_0x0a5d('0x3c')],_0x19a87f);}_0x2d7dcc=_['merge']({},_0x2d7dcc,_0x450494[_0x0a5d('0xad')]);return db[_0x0a5d('0xb2')][_0x0a5d('0x90')]({'where':_0x2d7dcc[_0x0a5d('0x3c')]})[_0x0a5d('0x28')](function(_0x1c4e66){_0x1a183b[_0x0a5d('0x90')]=_0x1c4e66;if(_0x450494[_0x0a5d('0x32')][_0x0a5d('0xab')]){_0x2d7dcc[_0x0a5d('0xac')]=[{'all':!![]}];}return db[_0x0a5d('0xb2')]['findAll'](_0x2d7dcc);})['then'](function(_0xdedfa1){_0x1a183b[_0x0a5d('0xa7')]=_0xdedfa1;return _0x1a183b;});}})[_0x0a5d('0x28')](respondWithFilteredResult(_0x555f90,_0x2d7dcc))[_0x0a5d('0xa8')](handleError(_0x555f90,null));};exports['addTags']=function(_0x40082c,_0x418463,_0x1b8ef9){return db['MailInteraction'][_0x0a5d('0xae')]({'where':{'id':_0x40082c[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x418463,null))[_0x0a5d('0x28')](function(_0xbd3fda){if(_0xbd3fda){return _0xbd3fda['setTags'](_0x40082c[_0x0a5d('0xb0')]['ids'],_['omit'](_0x40082c[_0x0a5d('0xb0')],['ids','id'])||{})[_0x0a5d('0xb6')](function(){return db['Tag'][_0x0a5d('0xb7')]({'attributes':['id',_0x0a5d('0x2c'),_0x0a5d('0x40')],'where':{'id':_0x40082c[_0x0a5d('0xb0')][_0x0a5d('0xb3')]}});})['then'](function(_0x2772c0){socket[_0x0a5d('0xb8')]('mailInteractionTags:save',{'id':Number(_0x40082c[_0x0a5d('0xaa')]['id']),'tags':_0x2772c0||[]});return{'id':Number(_0x40082c[_0x0a5d('0xaa')]['id']),'tags':_0x2772c0||[]};});}})[_0x0a5d('0x28')](respondWithResult(_0x418463,null))[_0x0a5d('0xa8')](handleError(_0x418463,null));};exports[_0x0a5d('0xb9')]=function(_0x137a55,_0x4d8a09,_0x132aa7){return db[_0x0a5d('0x2e')][_0x0a5d('0xae')]({'where':{'id':_0x137a55['params']['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x4d8a09,null))['then'](function(_0xd4a59d){if(_0xd4a59d){return _0xd4a59d['removeTags'](_0x137a55[_0x0a5d('0x32')]['ids']);}})[_0x0a5d('0x28')](respondWithStatusCode(_0x4d8a09,null))[_0x0a5d('0xa8')](handleError(_0x4d8a09,null));};exports[_0x0a5d('0xba')]=function(_0x4710de,_0x3583ff){var _0x2f8ba3=moment()[_0x0a5d('0xbb')]()[_0x0a5d('0x77')]();var _0x48317e=path[_0x0a5d('0x78')](config[_0x0a5d('0xbc')],_0x0a5d('0xbd'),'files','attachments');var _0x15dc09=path['join'](config[_0x0a5d('0xbc')],'server','files',_0x0a5d('0xbe'));var _0xf39ef9=path['join'](_0x15dc09,_0x2f8ba3);var _0x214ea0=util[_0x0a5d('0x58')](_0x0a5d('0xbf'),_0x2f8ba3);var _0x13cd92=path[_0x0a5d('0x78')](_0x15dc09,_0x214ea0);var _0x35fed5=![];return db[_0x0a5d('0x2e')]['find']({'where':{'id':_0x4710de['params']['id']}})['then'](handleEntityNotFound(_0x3583ff,null))[_0x0a5d('0x28')](function(_0x2cadf6){if(_0x2cadf6){return _0x2cadf6['getMessages']({'attributes':['id','body',_0x0a5d('0x42'),'to','cc',_0x0a5d('0xc0'),_0x0a5d('0xc1'),'createdAt'],'where':{'secret':![]},'include':_0x4710de[_0x0a5d('0x32')][_0x0a5d('0xc2')]?[{'model':db[_0x0a5d('0xc3')],'as':'Attachments'}]:undefined,'order':qs[_0x0a5d('0xb5')]('id')});}return[];})[_0x0a5d('0x28')](function(_0x286225){_0x35fed5=_0x286225[_0x0a5d('0x37')];if(_0x286225[_0x0a5d('0x37')]){fs[_0x0a5d('0xc4')](_0xf39ef9);return BPromise[_0x0a5d('0xc5')](_0x286225,function(_0x4718ad,_0x28a2bb){var _0x1fc150=_0x4718ad;var _0x2469b4={'from':_0x1fc150[_0x0a5d('0x42')],'to':_0x1fc150['to'],'subject':_0x1fc150[_0x0a5d('0xc1')],'html':_0x1fc150['body'],'headers':{'Date':moment(_0x1fc150[_0x0a5d('0x53')])[_0x0a5d('0x58')](_0x0a5d('0xc6'))},'attachments':[]};if(_0x4718ad['cc']){_0x2469b4[_0x0a5d('0xc7')]['Cc']=_0x4718ad['cc'];}if(_0x4718ad[_0x0a5d('0xc0')]){_0x2469b4[_0x0a5d('0xc7')][_0x0a5d('0xc8')]=_0x4718ad[_0x0a5d('0xc0')];}return new BPromise(function(_0x599cc3,_0xae1d3e){if(_0x4718ad[_0x0a5d('0xc9')]){for(var _0x557f8e=0x0;_0x557f8e<_0x4718ad[_0x0a5d('0xc9')]['length'];_0x557f8e++){var _0x575401=_0x4718ad[_0x0a5d('0xc9')][_0x557f8e];var _0x86c814=path[_0x0a5d('0x78')](_0x48317e,_0x575401[_0x0a5d('0xca')]);if(fs[_0x0a5d('0xcb')](_0x86c814)){_0x2469b4[_0x0a5d('0xc2')]['push']({'name':_0x575401[_0x0a5d('0x2c')],'contentType':_0x575401[_0x0a5d('0xcc')],'data':fs[_0x0a5d('0xcd')](_0x86c814)});}}}emlformat[_0x0a5d('0xce')](_0x2469b4,function(_0x2e9312,_0x5878bd){if(_0x2e9312)return _0xae1d3e(_0x2e9312);fs[_0x0a5d('0xcf')](path['join'](_0xf39ef9,util[_0x0a5d('0x58')]('message%d.eml',_0x28a2bb)),_0x5878bd);return _0x599cc3(_0x5878bd);});});});}})[_0x0a5d('0x28')](function(){if(_0x35fed5){return new BPromise(function(_0x50b2f6,_0x2889c6){zipdir(_0xf39ef9,{'saveTo':_0x13cd92},function(_0x3b0c9f,_0x23b13b){if(_0x3b0c9f)return _0x2889c6(_0x3b0c9f);return _0x50b2f6(_0x23b13b);});});}})[_0x0a5d('0x28')](function(){if(_0x35fed5){return new BPromise(function(_0xaa7151,_0x4398e5){rimraf(_0xf39ef9,function(_0x1784b){if(_0x1784b)_0x4398e5(_0x1784b);return _0xaa7151();});});}})['then'](function(){if(_0x35fed5){return _0x3583ff['download'](_0x13cd92,_0x214ea0,function(_0x593ab7){if(_0x593ab7){console[_0x0a5d('0xd0')](_0x0a5d('0xd1'),_0x593ab7);}else{fs[_0x0a5d('0xd2')](_0x13cd92);}});}else{return _0x3583ff['sendStatus'](0xc8);}})['catch'](handleError(_0x3583ff,null));}; \ No newline at end of file +var _0x2cf0=['pick','select','field','name','color','from','tools_tags','COUNT(*)','mail_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','Messages.count','\x20<\x20?','map','filter','isNil','isEmpty','forEach','MailAccountId','i.MailAccountId\x20IN\x20?','concat','$lte','replace','\x27\x27\x27\x27','isNumeric','split','push','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id','Sequelize','QueryTypes','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize','count','keyBy','merge','MailInteraction','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Users','Tags','TagIds','lastMsgText','trimStart','fromString','lastMsgBody','rows','catch','show','params','intersection','includeAll','include','options','create','body','find','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','sort','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','server','files','attachments','root','tmp','interaction-%s.zip','bcc','subject','Attachment','Attachments','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','type','build','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','stack','send','index','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','where'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2cf0,0x17d));var _0x02cf=function(_0x302a35,_0x3b9e8f){_0x302a35=_0x302a35-0x0;var _0x4c3891=_0x2cf0[_0x302a35];return _0x4c3891;};'use strict';var pdf=require(_0x02cf('0x0'));var emlformat=require(_0x02cf('0x1'));var rimraf=require(_0x02cf('0x2'));var zipdir=require(_0x02cf('0x3'));var jsonpatch=require(_0x02cf('0x4'));var rp=require(_0x02cf('0x5'));var moment=require(_0x02cf('0x6'));var BPromise=require(_0x02cf('0x7'));var Mustache=require('mustache');var util=require(_0x02cf('0x8'));var path=require(_0x02cf('0x9'));var sox=require(_0x02cf('0xa'));var csv=require(_0x02cf('0xb'));var ejs=require(_0x02cf('0xc'));var fs=require('fs');var _=require(_0x02cf('0xd'));var squel=require(_0x02cf('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x02cf('0xf'));var toCsv=require(_0x02cf('0xb'));var querystring=require('querystring');var Papa=require(_0x02cf('0x10'));var htmlToText=require(_0x02cf('0x11'));var Redis=require(_0x02cf('0x12'));var authService=require(_0x02cf('0x13'));var qs=require(_0x02cf('0x14'));var hardwareService=require(_0x02cf('0x15'));var logger=require(_0x02cf('0x16'))(_0x02cf('0x17'));var utils=require('../../config/utils');var config=require(_0x02cf('0x18'));var db=require(_0x02cf('0x19'))['db'];config['redis']=_['defaults'](config[_0x02cf('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cf('0x1a')]));require(_0x02cf('0x1b'))[_0x02cf('0x1c')](socket);function respondWithStatusCode(_0x14cd66,_0x5590bc){_0x5590bc=_0x5590bc||0xcc;return function(_0x4956c8){if(_0x4956c8){return _0x14cd66[_0x02cf('0x1d')](_0x5590bc);}return _0x14cd66[_0x02cf('0x1e')](_0x5590bc)[_0x02cf('0x1f')]();};}function respondWithResult(_0x361757,_0x572bc8){_0x572bc8=_0x572bc8||0xc8;return function(_0x201c12){if(_0x201c12){return _0x361757[_0x02cf('0x1e')](_0x572bc8)[_0x02cf('0x20')](_0x201c12);}};}function respondWithFilteredResult(_0x4f20b6,_0x175ef9){return function(_0x2a457c){if(_0x2a457c){var _0x922406=_0x2a457c['count'],_0x44d17f=_0x175ef9[_0x02cf('0x21')],_0x481bef=_0x175ef9['offset']+_0x175ef9[_0x02cf('0x22')],_0x51130e;if(_0x481bef>=_0x922406){_0x481bef=_0x922406;_0x51130e=0xc8;}else{_0x51130e=0xce;}_0x4f20b6[_0x02cf('0x1e')](_0x51130e);return _0x4f20b6[_0x02cf('0x23')]('Content-Range',_0x44d17f+'-'+_0x481bef+'/'+_0x922406)[_0x02cf('0x20')](_0x2a457c);}return null;};}function patchUpdates(_0x115846){return function(_0x27145a){try{jsonpatch[_0x02cf('0x24')](_0x27145a,_0x115846,!![]);}catch(_0x36d0e1){return BPromise['reject'](_0x36d0e1);}return _0x27145a[_0x02cf('0x25')]();};}function saveUpdates(_0x316d53,_0x26f2ec){return function(_0x5c692d){if(_0x5c692d){return _0x5c692d[_0x02cf('0x26')](_0x316d53)[_0x02cf('0x27')](function(_0x2bba1c){return _0x2bba1c;});}return null;};}function removeEntity(_0x150b81,_0x20ab04){return function(_0x5d3c98){if(_0x5d3c98){return _0x5d3c98[_0x02cf('0x28')]()[_0x02cf('0x27')](function(){_0x150b81[_0x02cf('0x1e')](0xcc)[_0x02cf('0x1f')]();});}};}function handleEntityNotFound(_0x205fb9,_0xf7d722){return function(_0x51ed76){if(!_0x51ed76){_0x205fb9[_0x02cf('0x1d')](0x194);}return _0x51ed76;};}function handleError(_0x7fc968,_0x2d207d){_0x2d207d=_0x2d207d||0x1f4;return function(_0x2e9ca6){logger['error'](_0x2e9ca6[_0x02cf('0x29')]);if(_0x2e9ca6['name']){delete _0x2e9ca6['name'];}_0x7fc968[_0x02cf('0x1e')](_0x2d207d)[_0x02cf('0x2a')](_0x2e9ca6);};}exports[_0x02cf('0x2b')]=function(_0x2f2b1a,_0x480c1c){var _0x105dab={},_0xb18380={},_0x2b18ef={'count':0x0,'rows':[]};var _0x2b8cd7=db['MailInteraction'][_0x02cf('0x2c')];_0xb18380[_0x02cf('0x2d')]=_[_0x02cf('0x2e')](_0x2b8cd7);_0xb18380[_0x02cf('0x2f')]=_['keys'](_0x2f2b1a[_0x02cf('0x2f')]);_0xb18380[_0x02cf('0x30')]=_['intersection'](_0xb18380['model'],_0xb18380[_0x02cf('0x2f')]);_0x105dab[_0x02cf('0x31')]=_['intersection'](_0xb18380[_0x02cf('0x2d')],qs[_0x02cf('0x32')](_0x2f2b1a[_0x02cf('0x2f')]['fields']));_0x105dab[_0x02cf('0x31')]=_0x105dab[_0x02cf('0x31')][_0x02cf('0x33')]?_0x105dab[_0x02cf('0x31')]:_0xb18380[_0x02cf('0x2d')];if(!_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x34')](_0x02cf('0x35'))){_0x105dab[_0x02cf('0x22')]=qs[_0x02cf('0x22')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x22')]);_0x105dab[_0x02cf('0x21')]=qs[_0x02cf('0x21')](_0x2f2b1a[_0x02cf('0x2f')]['offset']);}_0x105dab['order']=qs['sort'](_0x2f2b1a[_0x02cf('0x2f')]['sort']);_0x105dab[_0x02cf('0x36')]=qs[_0x02cf('0x30')](_[_0x02cf('0x37')](_0x2f2b1a[_0x02cf('0x2f')],_0xb18380[_0x02cf('0x30')]));var _0x5bfff1=[];var _0x56e57c=squel[_0x02cf('0x38')]()[_0x02cf('0x39')]('id')[_0x02cf('0x39')](_0x02cf('0x3a'))[_0x02cf('0x39')](_0x02cf('0x3b'))[_0x02cf('0x3c')](_0x02cf('0x3d'));var _0x4f3f5e=squel['select']()[_0x02cf('0x39')](_0x02cf('0x3e'))[_0x02cf('0x3c')](_0x02cf('0x3f'),'me')[_0x02cf('0x36')]('me.MailInteractionId\x20=\x20i.id')[_0x02cf('0x36')](_0x02cf('0x40'))[_0x02cf('0x36')](_0x02cf('0x41'));var _0x599c29=squel['select']()[_0x02cf('0x39')](_0x02cf('0x42'))[_0x02cf('0x39')](_0x02cf('0x43'))[_0x02cf('0x3c')](_0x02cf('0x44'),'ui')[_0x02cf('0x45')]('users','u',_0x02cf('0x46'));var _0xe27207=squel[_0x02cf('0x38')]()[_0x02cf('0x3c')](_0x02cf('0x47'),'i')['left_join']('user_has_mail_interactions','ui',_0x02cf('0x48'))[_0x02cf('0x45')](_0x02cf('0x49'),'u',_0x02cf('0x46'))[_0x02cf('0x45')]('cm_contacts','c',_0x02cf('0x4a'))[_0x02cf('0x45')](_0x02cf('0x49'),'o',_0x02cf('0x4b'))['left_join'](_0x02cf('0x4c'),'a',_0x02cf('0x4d'))[_0x02cf('0x45')](_0x02cf('0x3f'),'me',_0x02cf('0x4e'));var _0x285214=squel[_0x02cf('0x4f')]();if(_0x2f2b1a[_0x02cf('0x2f')]['advancedFilter']){var _0x3ef202=JSON[_0x02cf('0x50')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x51')]);_['keys'](_0x3ef202)['forEach'](function(_0x28c98c){var _0x22f92b=_0x3ef202[_0x28c98c];if(_0x28c98c===_0x02cf('0x52')){var _0x39c8ff=moment(_0x22f92b[_0x02cf('0x53')][_0x02cf('0x54')])[_0x02cf('0x55')](_0x02cf('0x56'))[_0x02cf('0x57')]()[_0x02cf('0x58')]();var _0x45c48c=moment(_0x45c48c)[_0x02cf('0x57')]()[_0x02cf('0x59')]('day')[_0x02cf('0x58')]();_0x285214[_0x02cf('0x5a')](_0x02cf('0x5b'),_0x39c8ff,_0x45c48c);}else{if(_[_0x02cf('0x5c')](_0x22f92b[_0x02cf('0x5d')])){_0x22f92b['condition']['forEach'](function(_0x53a705){switch(_0x22f92b['condition'][_0x02cf('0x53')]){case'IS':if(_0x28c98c!==_0x02cf('0x5e')&&_0x28c98c!=='Messages.count'){if(_['isArray'](_0x22f92b[_0x02cf('0x53')])&&_0x22f92b['value'][_0x02cf('0x33')]>0x1){_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x60'),_0x22f92b[_0x02cf('0x53')]);}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b['value'][0x0]);}}break;case'=':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20=\x20?',_0x22f92b['value']);break;case _0x02cf('0x62'):if(_0x28c98c===_0x02cf('0x63')){_0x285214[_0x02cf('0x5a')](_0x02cf('0x64')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x66')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x67')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}break;case'>':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x68'),_0x22f92b['value']);break;case'<':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20<\x20?',_0x22f92b[_0x02cf('0x53')]);break;}});}else{switch(_0x22f92b['condition'][_0x02cf('0x53')]){case'IS':if(_0x28c98c!==_0x02cf('0x5e')&&_0x28c98c!==_0x02cf('0x69')){if(_['isArray'](_0x22f92b[_0x02cf('0x53')])&&_0x22f92b['value'][_0x02cf('0x33')]>0x1){_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20IN\x20?',_0x22f92b[_0x02cf('0x53')]);}else{_0x285214['and'](_0x22f92b['tableAlias']+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b[_0x02cf('0x53')][0x0]);}}break;case'=':_0x285214['and'](_0x22f92b['tableAlias']+'.'+_0x28c98c+_0x02cf('0x61'),_0x22f92b['value']);break;case _0x02cf('0x62'):if(_0x28c98c===_0x02cf('0x63')){_0x285214['and'](_0x02cf('0x64')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x66')+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');_0x285214['or'](_0x02cf('0x67')+_0x02cf('0x65'),'%'+_0x22f92b[_0x02cf('0x53')]+'%');}else{_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+'\x20LIKE\x20?','%'+_0x22f92b[_0x02cf('0x53')]+'%');}break;case'>':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x68'),_0x22f92b[_0x02cf('0x53')]);break;case'<':_0x285214[_0x02cf('0x5a')](_0x22f92b[_0x02cf('0x5f')]+'.'+_0x28c98c+_0x02cf('0x6a'),_0x22f92b['value']);break;}}}});}else{var _0x331e14=_(Object[_0x02cf('0x2e')](_0x2f2b1a[_0x02cf('0x2f')]))[_0x02cf('0x6b')](function(_0x7d30c8){return _0x2b8cd7[_0x02cf('0x34')](_0x7d30c8)?_0x7d30c8:undefined;})[_0x02cf('0x6c')](function(_0x567cf7){return!_[_0x02cf('0x6d')](_0x567cf7);})[_0x02cf('0x53')]();if(!_[_0x02cf('0x6e')](_0x331e14)){_0x331e14[_0x02cf('0x6f')](function(_0x485a45){if(_0x485a45===_0x02cf('0x70')){_0xe27207[_0x02cf('0x36')](_0x02cf('0x71'),[][_0x02cf('0x72')](_0x2f2b1a[_0x02cf('0x2f')][_0x485a45]));}else if(_0x485a45==='createdAt'){var _0x41e982=JSON[_0x02cf('0x50')](_0x2f2b1a['query'][_0x485a45])['$gte'];var _0x245364=JSON['parse'](_0x2f2b1a[_0x02cf('0x2f')][_0x485a45])[_0x02cf('0x73')];_0xe27207['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x41e982,_0x245364);}else{_0xe27207[_0x02cf('0x36')]('i.'+_0x485a45+_0x02cf('0x61'),_0x2f2b1a[_0x02cf('0x2f')][_0x485a45]);}});}if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x6c')]){var _0x34ea1b=_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x6c')][_0x02cf('0x74')]('\x5c','\x5c\x5c')[_0x02cf('0x74')]('\x27\x27',_0x02cf('0x75'));if(qs[_0x02cf('0x76')](_0x34ea1b)){_0x285214['or']('i.id\x20LIKE\x20?',_0x34ea1b+'%');}else if(qs['isEmail'](_0x34ea1b)){_0x285214['or']('c.email\x20LIKE\x20?',_0x34ea1b+'%');}else{var _0x439d7a=[];_0x34ea1b[_0x02cf('0x77')]('\x20')[_0x02cf('0x6f')](function(_0x32068c){_0x439d7a[_0x02cf('0x78')]('+'+_0x32068c[_0x02cf('0x79')]());});var _0x1c6a15=_0x439d7a['join']('\x20');_0x285214['or'](_0x02cf('0x7a'),_0x1c6a15)['or'](_0x02cf('0x7b'),_0x1c6a15);}}}_0xe27207[_0x02cf('0x36')](_0x285214);if(_0x105dab[_0x02cf('0x7c')]){_0x105dab[_0x02cf('0x7c')]['forEach'](function(_0x44aae1){_0xe27207[_0x02cf('0x7c')]('i.'+_0x44aae1[0x0],_0x44aae1[0x1]===_0x02cf('0x7d')?![]:!![]);});}_0xe27207[_0x02cf('0x7e')](_0x02cf('0x7f'));var _0x13508f={'type':db[_0x02cf('0x80')][_0x02cf('0x81')]['SELECT'],'raw':!![]};var _0x173068=_0xe27207['clone']()['field'](_0x02cf('0x3e'));if(!_0x2f2b1a[_0x02cf('0x2f')]['advancedFilter']){if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x82')]){if(_0x2f2b1a['query'][_0x02cf('0x82')]==0x1){_0x173068[_0x02cf('0x36')](util['format'](_0x02cf('0x83'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207[_0x02cf('0x84')](_0x02cf('0x85'));}else{_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x86'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207['having'](_0x02cf('0x87'));}}if(_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')]){var _0x146565=_[_0x02cf('0x5c')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')])?_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x88')]:new Array(_0x2f2b1a['query']['tag']);var _0x14dc30=squel[_0x02cf('0x4f')]();_0x146565[_0x02cf('0x6f')](function(_0x4c5cd3){_0x14dc30['or'](_0x02cf('0x89'),'%,'+_0x4c5cd3+',%');});_0xe27207['having'](_0x14dc30);_0x173068[_0x02cf('0x45')](_0x02cf('0x8a'),'it',_0x02cf('0x8b'));_0x173068[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0x173068[_0x02cf('0x36')](_0x02cf('0x8d'),_0x146565);}}else{var _0x3ef202=JSON[_0x02cf('0x50')](_0x2f2b1a[_0x02cf('0x2f')][_0x02cf('0x51')]);_[_0x02cf('0x2e')](_0x3ef202)[_0x02cf('0x6f')](function(_0x47b85d){var _0x57fac0=_0x3ef202[_0x47b85d];if(_0x47b85d===_0x02cf('0x5e')){var _0x2d82eb=_0x57fac0[_0x02cf('0x53')];var _0x189cb9=squel[_0x02cf('0x4f')]();_0x2d82eb[_0x02cf('0x6f')](function(_0x1afe45){_0x189cb9['or'](_0x02cf('0x89'),'%,'+_0x1afe45+',%');});_0xe27207[_0x02cf('0x84')](_0x189cb9);_0x173068[_0x02cf('0x45')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x173068[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0x173068[_0x02cf('0x36')](_0x02cf('0x8d'),_0x2d82eb);}else if(_0x47b85d===_0x02cf('0x69')){if(_0x57fac0['value'][_0x02cf('0x33')]===0x1){if(_0x57fac0['value'][0x0]===0x1){_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x83'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207[_0x02cf('0x84')](_0x02cf('0x85'));}else{_0x173068[_0x02cf('0x36')](util[_0x02cf('0x58')](_0x02cf('0x86'),_0x4f3f5e[_0x02cf('0x79')]()));_0xe27207['having'](_0x02cf('0x87'));}}}});}db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x173068[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x3826f9){_0x2b18ef[_0x02cf('0x8f')]=_0x3826f9[_0x02cf('0x33')];if(_0x2b18ef[_0x02cf('0x8f')]===0x0)return[];return db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x56e57c[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x35d09e){_0x5bfff1=_[_0x02cf('0x90')](_0x35d09e,'id');_0x13508f=_[_0x02cf('0x91')](_0x13508f,{'model':db[_0x02cf('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe27207[_0x02cf('0x39')](_0x4f3f5e,_0x02cf('0x69'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x93'),_0x02cf('0x94'));_0xe27207[_0x02cf('0x39')]('i.*');_0xe27207['field']('c.firstName',_0x02cf('0x95'));_0xe27207[_0x02cf('0x39')]('c.lastName',_0x02cf('0x96'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x67'),_0x02cf('0x97'));_0xe27207['field'](_0x02cf('0x98'),_0x02cf('0x99'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x9a'),'Contact.mobile');_0xe27207['field'](_0x02cf('0x9b'),_0x02cf('0x9c'));_0xe27207[_0x02cf('0x39')](_0x02cf('0x9d'),'User.name');_0xe27207['field'](_0x02cf('0x9e'),'TagIds');_0xe27207[_0x02cf('0x45')](_0x02cf('0x8a'),'it',_0x02cf('0x8b'));_0xe27207[_0x02cf('0x45')](_0x02cf('0x3d'),'t',_0x02cf('0x8c'));_0xe27207[_0x02cf('0x22')](_0x105dab[_0x02cf('0x22')]);_0xe27207['offset'](_0x105dab[_0x02cf('0x21')]);return db[_0x02cf('0x8e')]['query'](_0xe27207[_0x02cf('0x79')](),_0x13508f);})[_0x02cf('0x27')](function(_0x5e51db){_0x599c29[_0x02cf('0x36')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x5e51db,'id'));return db[_0x02cf('0x8e')][_0x02cf('0x2f')](_0x599c29[_0x02cf('0x79')](),_0x13508f)[_0x02cf('0x27')](function(_0x5d6207){var _0x463845=_[_0x02cf('0x9f')](_0x5d6207,_0x02cf('0xa0'));_0x5e51db['forEach'](function(_0x316d6e){if(_0x463845[_0x316d6e['id']]){_0x316d6e[_0x02cf('0xa1')]=_['map'](_0x463845[_0x316d6e['id']],function(_0x1050c2){return{'id':_0x1050c2['id']};});}if(_0x316d6e['TagIds']){_0x316d6e[_0x02cf('0xa2')]=[];_0x316d6e['TagIds'][_0x02cf('0x77')](',')['forEach'](function(_0xac9820){_0x316d6e[_0x02cf('0xa2')][_0x02cf('0x78')](_0x5bfff1[_0xac9820]);});}delete _0x316d6e[_0x02cf('0xa3')];if(!_0x316d6e[_0x02cf('0xa4')]){_0x316d6e[_0x02cf('0xa4')]=_[_0x02cf('0xa5')](htmlToText[_0x02cf('0xa6')](_0x316d6e[_0x02cf('0xa7')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x5e51db;});});})[_0x02cf('0x27')](function(_0x3e78db){_0x2b18ef[_0x02cf('0xa8')]=_0x3e78db;return _0x2b18ef;})['then'](respondWithFilteredResult(_0x480c1c,_0x105dab))[_0x02cf('0xa9')](handleError(_0x480c1c,null));};exports[_0x02cf('0xaa')]=function(_0x40e078,_0x1fa42d){var _0x5e8d26={'raw':![],'where':{'id':_0x40e078[_0x02cf('0xab')]['id']}},_0x25e163={};_0x25e163[_0x02cf('0x2d')]=_['keys'](db[_0x02cf('0x92')]['rawAttributes']);_0x25e163[_0x02cf('0x2f')]=_[_0x02cf('0x2e')](_0x40e078['query']);_0x25e163[_0x02cf('0x30')]=_['intersection'](_0x25e163[_0x02cf('0x2d')],_0x25e163[_0x02cf('0x2f')]);_0x5e8d26[_0x02cf('0x31')]=_[_0x02cf('0xac')](_0x25e163['model'],qs[_0x02cf('0x32')](_0x40e078[_0x02cf('0x2f')][_0x02cf('0x32')]));_0x5e8d26[_0x02cf('0x31')]=_0x5e8d26['attributes'][_0x02cf('0x33')]?_0x5e8d26['attributes']:_0x25e163[_0x02cf('0x2d')];if(_0x40e078[_0x02cf('0x2f')][_0x02cf('0xad')]){_0x5e8d26[_0x02cf('0xae')]=[{'all':!![]}];}_0x5e8d26=_['merge']({},_0x5e8d26,_0x40e078[_0x02cf('0xaf')]);return db[_0x02cf('0x92')]['find'](_0x5e8d26)['then'](handleEntityNotFound(_0x1fa42d,null))['then'](respondWithResult(_0x1fa42d,null))[_0x02cf('0xa9')](handleError(_0x1fa42d,null));};exports[_0x02cf('0xb0')]=function(_0xcea802,_0x604799){return db['MailInteraction'][_0x02cf('0xb0')](_0xcea802[_0x02cf('0xb1')],{})[_0x02cf('0x27')](respondWithResult(_0x604799,0xc9))['catch'](handleError(_0x604799,null));};exports[_0x02cf('0x26')]=function(_0x4fd526,_0x574a75){if(_0x4fd526[_0x02cf('0xb1')]['id']){delete _0x4fd526[_0x02cf('0xb1')]['id'];}return db[_0x02cf('0x92')]['find']({'where':{'id':_0x4fd526[_0x02cf('0xab')]['id']}})['then'](handleEntityNotFound(_0x574a75,null))[_0x02cf('0x27')](saveUpdates(_0x4fd526['body'],null))['then'](respondWithResult(_0x574a75,null))[_0x02cf('0xa9')](handleError(_0x574a75,null));};exports[_0x02cf('0x28')]=function(_0x587618,_0x4d5c7){return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x587618[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x4d5c7,null))['then'](removeEntity(_0x4d5c7,null))['catch'](handleError(_0x4d5c7,null));};exports[_0x02cf('0xb3')]=function(_0x159803,_0x122293){return db[_0x02cf('0x92')][_0x02cf('0xb3')]()['then'](respondWithResult(_0x122293,null))[_0x02cf('0xa9')](handleError(_0x122293,null));};exports[_0x02cf('0xb4')]=function(_0x1490bf,_0x1946bc,_0x17df80){return db[_0x02cf('0xb5')][_0x02cf('0xb2')]({'where':{'id':_0x1490bf[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x1946bc,null))['then'](function(_0x55b1ce){if(_0x55b1ce){return _0x55b1ce[_0x02cf('0xb4')](_0x1490bf[_0x02cf('0xb1')][_0x02cf('0xb6')],_[_0x02cf('0xb7')](_0x1490bf['body'],[_0x02cf('0xb6'),'id'])||{});}})[_0x02cf('0x27')](respondWithResult(_0x1946bc,null))['catch'](handleError(_0x1946bc,null));};exports[_0x02cf('0xb8')]=function(_0x55c4ca,_0x1ce057,_0x13c257){var _0x37b050={'raw':![],'where':{}};var _0xd85790={};var _0xd7aaa6={'count':0x0,'rows':[]};return db['MailInteraction'][_0x02cf('0xb9')]({'where':{'id':_0x55c4ca['params']['id']}})['then'](handleEntityNotFound(_0x1ce057,null))[_0x02cf('0x27')](function(_0x496bb3){if(_0x496bb3){_0xd85790[_0x02cf('0x2d')]=_['keys'](db[_0x02cf('0xb5')]['rawAttributes']);_0xd85790[_0x02cf('0x2f')]=_[_0x02cf('0x2e')](_0x55c4ca[_0x02cf('0x2f')]);_0xd85790[_0x02cf('0x30')]=_[_0x02cf('0xac')](_0xd85790[_0x02cf('0x2d')],_0xd85790['query']);_0x37b050[_0x02cf('0x31')]=_[_0x02cf('0xac')](_0xd85790[_0x02cf('0x2d')],qs['fields'](_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x32')]));_0x37b050[_0x02cf('0x31')]=_0x37b050[_0x02cf('0x31')]['length']?_0x37b050[_0x02cf('0x31')]:_0xd85790[_0x02cf('0x2d')];if(!_0x55c4ca[_0x02cf('0x2f')]['hasOwnProperty'](_0x02cf('0x35'))){_0x37b050[_0x02cf('0x22')]=qs['limit'](_0x55c4ca[_0x02cf('0x2f')]['limit']);_0x37b050[_0x02cf('0x21')]=qs[_0x02cf('0x21')](_0x55c4ca['query'][_0x02cf('0x21')]);}_0x37b050[_0x02cf('0x7c')]=qs[_0x02cf('0xba')](_0x55c4ca[_0x02cf('0x2f')]['sort']);_0x37b050[_0x02cf('0x36')]=qs[_0x02cf('0x30')](_[_0x02cf('0x37')](_0x55c4ca[_0x02cf('0x2f')],_0xd85790['filters']));_0x37b050['where'][_0x02cf('0xa0')]=_0x496bb3['id'];if(_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x6c')]){_0x37b050[_0x02cf('0x36')]=_['merge'](_0x37b050[_0x02cf('0x36')],{'$or':_[_0x02cf('0x6b')](_0x37b050[_0x02cf('0x31')],function(_0x79691d){var _0x424739={};_0x424739[_0x79691d]={'$like':'%'+_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0x6c')]+'%'};return _0x424739;})});}if(_0x55c4ca[_0x02cf('0x2f')][_0x02cf('0xbb')]){var _0xa9a781=_0x55c4ca['query'][_0x02cf('0xbb')]['split'](',');var _0x4f745b={};_0x4f745b[_0xa9a781[0x0]]={'$gte':moment(_0xa9a781[0x1])[_0x02cf('0x58')](_0x02cf('0xbc'))};_0x37b050[_0x02cf('0x36')]=_['merge'](_0x37b050[_0x02cf('0x36')],_0x4f745b);}_0x37b050=_[_0x02cf('0x91')]({},_0x37b050,_0x55c4ca[_0x02cf('0xaf')]);return db[_0x02cf('0xb5')]['count']({'where':_0x37b050[_0x02cf('0x36')]})[_0x02cf('0x27')](function(_0x226364){_0xd7aaa6[_0x02cf('0x8f')]=_0x226364;if(_0x55c4ca[_0x02cf('0x2f')]['includeAll']){_0x37b050[_0x02cf('0xae')]=[{'all':!![]}];}return db[_0x02cf('0xb5')][_0x02cf('0xbd')](_0x37b050);})[_0x02cf('0x27')](function(_0x1fbba4){_0xd7aaa6['rows']=_0x1fbba4;return _0xd7aaa6;});}})[_0x02cf('0x27')](respondWithFilteredResult(_0x1ce057,_0x37b050))[_0x02cf('0xa9')](handleError(_0x1ce057,null));};exports[_0x02cf('0xbe')]=function(_0x265a32,_0x1bf60b,_0x1329dd){return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x265a32['params']['id']}})['then'](handleEntityNotFound(_0x1bf60b,null))[_0x02cf('0x27')](function(_0x3b53a1){if(_0x3b53a1){return _0x3b53a1['setTags'](_0x265a32['body']['ids'],_[_0x02cf('0xb7')](_0x265a32[_0x02cf('0xb1')],[_0x02cf('0xb6'),'id'])||{})['spread'](function(){return db[_0x02cf('0xbf')][_0x02cf('0xbd')]({'attributes':['id',_0x02cf('0x3a'),'color'],'where':{'id':_0x265a32[_0x02cf('0xb1')][_0x02cf('0xb6')]}});})[_0x02cf('0x27')](function(_0x531226){socket[_0x02cf('0xc0')](_0x02cf('0xc1'),{'id':Number(_0x265a32[_0x02cf('0xab')]['id']),'tags':_0x531226||[]});return{'id':Number(_0x265a32[_0x02cf('0xab')]['id']),'tags':_0x531226||[]};});}})['then'](respondWithResult(_0x1bf60b,null))[_0x02cf('0xa9')](handleError(_0x1bf60b,null));};exports['removeTags']=function(_0x3973b4,_0xa32649,_0x58961a){return db[_0x02cf('0x92')]['find']({'where':{'id':_0x3973b4[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0xa32649,null))[_0x02cf('0x27')](function(_0x1e2428){if(_0x1e2428){return _0x1e2428[_0x02cf('0xc2')](_0x3973b4[_0x02cf('0x2f')][_0x02cf('0xb6')]);}})[_0x02cf('0x27')](respondWithStatusCode(_0xa32649,null))[_0x02cf('0xa9')](handleError(_0xa32649,null));};exports[_0x02cf('0xc3')]=function(_0x55aa36,_0x19f58a){var _0x25278f=moment()[_0x02cf('0xc4')]()[_0x02cf('0x79')]();var _0x59dc7e=path[_0x02cf('0xc5')](config['root'],_0x02cf('0xc6'),_0x02cf('0xc7'),_0x02cf('0xc8'));var _0x4985fc=path['join'](config[_0x02cf('0xc9')],_0x02cf('0xc6'),'files',_0x02cf('0xca'));var _0x5ecb35=path[_0x02cf('0xc5')](_0x4985fc,_0x25278f);var _0x502084=util[_0x02cf('0x58')](_0x02cf('0xcb'),_0x25278f);var _0x391115=path[_0x02cf('0xc5')](_0x4985fc,_0x502084);var _0x318323=![];return db[_0x02cf('0x92')][_0x02cf('0xb2')]({'where':{'id':_0x55aa36[_0x02cf('0xab')]['id']}})[_0x02cf('0x27')](handleEntityNotFound(_0x19f58a,null))['then'](function(_0x320391){if(_0x320391){return _0x320391[_0x02cf('0xb8')]({'attributes':['id',_0x02cf('0xb1'),_0x02cf('0x3c'),'to','cc',_0x02cf('0xcc'),_0x02cf('0xcd'),_0x02cf('0x52')],'where':{'secret':![]},'include':_0x55aa36[_0x02cf('0x2f')][_0x02cf('0xc8')]?[{'model':db[_0x02cf('0xce')],'as':_0x02cf('0xcf')}]:undefined,'order':qs['sort']('id')});}return[];})[_0x02cf('0x27')](function(_0x17bd35){_0x318323=_0x17bd35['length'];if(_0x17bd35['length']){fs['mkdirSync'](_0x5ecb35);return BPromise[_0x02cf('0xd0')](_0x17bd35,function(_0x99859a,_0x3fa690){var _0x225567=_0x99859a;var _0x46dbd5={'from':_0x225567[_0x02cf('0x3c')],'to':_0x225567['to'],'subject':_0x225567[_0x02cf('0xcd')],'html':_0x225567[_0x02cf('0xb1')],'headers':{'Date':moment(_0x225567[_0x02cf('0x52')])['format'](_0x02cf('0xd1'))},'attachments':[]};if(_0x99859a['cc']){_0x46dbd5[_0x02cf('0xd2')]['Cc']=_0x99859a['cc'];}if(_0x99859a['bcc']){_0x46dbd5[_0x02cf('0xd2')]['Bcc']=_0x99859a[_0x02cf('0xcc')];}return new BPromise(function(_0x4b1ab9,_0x9124a0){if(_0x99859a[_0x02cf('0xcf')]){for(var _0xbb1a2f=0x0;_0xbb1a2f<_0x99859a[_0x02cf('0xcf')][_0x02cf('0x33')];_0xbb1a2f++){var _0x2abcaa=_0x99859a[_0x02cf('0xcf')][_0xbb1a2f];var _0x1aab3f=path[_0x02cf('0xc5')](_0x59dc7e,_0x2abcaa[_0x02cf('0xd3')]);if(fs[_0x02cf('0xd4')](_0x1aab3f)){_0x46dbd5[_0x02cf('0xc8')][_0x02cf('0x78')]({'name':_0x2abcaa[_0x02cf('0x3a')],'contentType':_0x2abcaa[_0x02cf('0xd5')],'data':fs['readFileSync'](_0x1aab3f)});}}}emlformat[_0x02cf('0xd6')](_0x46dbd5,function(_0x2de1e9,_0x36c203){if(_0x2de1e9)return _0x9124a0(_0x2de1e9);fs[_0x02cf('0xd7')](path[_0x02cf('0xc5')](_0x5ecb35,util[_0x02cf('0x58')]('message%d.eml',_0x3fa690)),_0x36c203);return _0x4b1ab9(_0x36c203);});});});}})[_0x02cf('0x27')](function(){if(_0x318323){return new BPromise(function(_0x293c43,_0x9f9cc1){zipdir(_0x5ecb35,{'saveTo':_0x391115},function(_0x5a159b,_0x5022a4){if(_0x5a159b)return _0x9f9cc1(_0x5a159b);return _0x293c43(_0x5022a4);});});}})[_0x02cf('0x27')](function(){if(_0x318323){return new BPromise(function(_0x3a3117,_0x2417a8){rimraf(_0x5ecb35,function(_0x724c6c){if(_0x724c6c)_0x2417a8(_0x724c6c);return _0x3a3117();});});}})['then'](function(){if(_0x318323){return _0x19f58a[_0x02cf('0xc3')](_0x391115,_0x502084,function(_0x13ce63){if(_0x13ce63){console[_0x02cf('0xd8')]('err',_0x13ce63);}else{fs[_0x02cf('0xd9')](_0x391115);}});}else{return _0x19f58a[_0x02cf('0x1d')](0xc8);}})['catch'](handleError(_0x19f58a,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c9dcc01..3ac7e9e 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 _0x66b6=['../../mysqldb','MailInteraction','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x66b6,0x1c7));var _0x666b=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x66b6[_0x49aa7d];return _0xdd0d26;};'use strict';var EventEmitter=require(_0x666b('0x0'));var MailInteraction=require(_0x666b('0x1'))['db'][_0x666b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x666b('0x3')};function emitEvent(_0x3946b5){return function(_0x19b152,_0x5c25e8,_0x4dc813){MailInteractionEvents[_0x666b('0x4')](_0x3946b5+':'+_0x19b152['id'],_0x19b152);MailInteractionEvents[_0x666b('0x4')](_0x3946b5,_0x19b152);_0x4dc813(null);};}for(var e in events){if(events[_0x666b('0x5')](e)){var event=events[e];MailInteraction[_0x666b('0x6')](e,emitEvent(event));}}module[_0x666b('0x7')]=MailInteractionEvents; \ No newline at end of file +var _0x7fd9=['emit','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x2a7589,_0x90c5d3){var _0x18619b=function(_0x3b60f8){while(--_0x3b60f8){_0x2a7589['push'](_0x2a7589['shift']());}};_0x18619b(++_0x90c5d3);}(_0x7fd9,0x16f));var _0x97fd=function(_0x3231e8,_0x41df58){_0x3231e8=_0x3231e8-0x0;var _0x13a897=_0x7fd9[_0x3231e8];return _0x13a897;};'use strict';var EventEmitter=require(_0x97fd('0x0'));var MailInteraction=require(_0x97fd('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x97fd('0x2')](0x0);var events={'afterCreate':_0x97fd('0x3'),'afterUpdate':'update','afterDestroy':_0x97fd('0x4')};function emitEvent(_0x44c526){return function(_0x209cb6,_0x1ae083,_0x1300de){MailInteractionEvents[_0x97fd('0x5')](_0x44c526+':'+_0x209cb6['id'],_0x209cb6);MailInteractionEvents[_0x97fd('0x5')](_0x44c526,_0x209cb6);_0x1300de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 0683be0..6a7aca9 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 _0x0eec=['changed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x349243,_0x244d3f){var _0x26b0ae=function(_0x151e68){while(--_0x151e68){_0x349243['push'](_0x349243['shift']());}};_0x26b0ae(++_0x244d3f);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0ee('0x1'));var moment=require(_0xc0ee('0x2'));var BPromise=require(_0xc0ee('0x3'));var rp=require(_0xc0ee('0x4'));var fs=require('fs');var path=require(_0xc0ee('0x5'));var rimraf=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xc0ee('0x8')]=function(_0x4db3d6,_0x218797){return _0x4db3d6[_0xc0ee('0x9')](_0xc0ee('0xa'),attributes,{'tableName':_0xc0ee('0xb'),'paranoid':![],'indexes':[{'name':_0xc0ee('0xc'),'fields':[_0xc0ee('0xd'),'to'],'type':_0xc0ee('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4992d6,_0x141f4a,_0x3bb29a){if(_0x4992d6[_0xc0ee('0xf')]){_0x4992d6[_0xc0ee('0x10')]=moment()[_0xc0ee('0x11')](_0xc0ee('0x12'));}if(_0x4992d6[_0xc0ee('0x13')]){_0x4992d6['closedAt']=moment()[_0xc0ee('0x11')](_0xc0ee('0x12'));}_0x3bb29a(null,_0x141f4a);},'beforeUpdate':function(_0x153f7b,_0x157951,_0x22d46b){if(_0x153f7b[_0xc0ee('0x14')](_0xc0ee('0xf'))){_0x153f7b[_0xc0ee('0x10')]=moment()[_0xc0ee('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x153f7b['changed'](_0xc0ee('0x13'))){_0x153f7b[_0xc0ee('0x15')]=moment()[_0xc0ee('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22d46b(null,_0x153f7b);}},'charset':_0xc0ee('0x16'),'collate':_0xc0ee('0x17')});}; \ No newline at end of file +var _0x6427=['./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x6427,0xbe));var _0x7642=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x6427[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x7642('0x0'));var logger=require(_0x7642('0x1'))(_0x7642('0x2'));var moment=require(_0x7642('0x3'));var BPromise=require(_0x7642('0x4'));var rp=require(_0x7642('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7642('0x6'));var config=require(_0x7642('0x7'));var attributes=require(_0x7642('0x8'));module[_0x7642('0x9')]=function(_0x2e2fa7,_0x3788b1){return _0x2e2fa7[_0x7642('0xa')](_0x7642('0xb'),attributes,{'tableName':_0x7642('0xc'),'paranoid':![],'indexes':[{'name':_0x7642('0xd'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x37cb5a,_0x17527f,_0x1ef8d3){if(_0x37cb5a[_0x7642('0xe')]){_0x37cb5a[_0x7642('0xf')]=moment()[_0x7642('0x10')](_0x7642('0x11'));}if(_0x37cb5a[_0x7642('0x12')]){_0x37cb5a[_0x7642('0x13')]=moment()[_0x7642('0x10')](_0x7642('0x11'));}_0x1ef8d3(null,_0x17527f);},'beforeUpdate':function(_0xd214ee,_0x167ff6,_0x3e5f50){if(_0xd214ee[_0x7642('0x14')](_0x7642('0xe'))){_0xd214ee[_0x7642('0xf')]=moment()['format'](_0x7642('0x11'));}if(_0xd214ee[_0x7642('0x14')]('closed')){_0xd214ee[_0x7642('0x13')]=moment()['format'](_0x7642('0x11'));}_0x3e5f50(null,_0xd214ee);}},'charset':'utf8mb4','collate':_0x7642('0x15')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 2fc1344..0bd58df 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 _0x50e5=['MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','body','raw','options','where','attributes','then','debug','AddTagsToMailInteraction'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x50e5,0xb7));var _0x550e=function(_0x559356,_0x2d0e8e){_0x559356=_0x559356-0x0;var _0x2c9c25=_0x50e5[_0x559356];return _0x2c9c25;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var moment=require('moment');var BPromise=require(_0x550e('0x2'));var rs=require(_0x550e('0x3'));var fs=require('fs');var Redis=require(_0x550e('0x4'));var db=require(_0x550e('0x5'))['db'];var utils=require(_0x550e('0x6'));var logger=require(_0x550e('0x7'))(_0x550e('0x8'));var config=require(_0x550e('0x9'));var jayson=require(_0x550e('0xa'));var client=jayson[_0x550e('0xb')][_0x550e('0xc')]({'port':0x232a});config[_0x550e('0xd')]=_['defaults'](config[_0x550e('0xd')],{'host':_0x550e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x550e('0xd')]));require(_0x550e('0xf'))[_0x550e('0x10')](socket);function respondWithRpcPromise(_0x4d236d,_0x1a1e3e,_0x49cc53){return new BPromise(function(_0x59c6c9,_0x116691){return client[_0x550e('0x11')](_0x4d236d,_0x49cc53)['then'](function(_0x13f7e9){logger[_0x550e('0x12')](_0x550e('0x13'),_0x1a1e3e,_0x550e('0x14'));logger['debug'](_0x550e('0x15'),_0x1a1e3e,'request\x20sent',JSON[_0x550e('0x16')](_0x13f7e9));if(_0x13f7e9['error']){if(_0x13f7e9[_0x550e('0x17')][_0x550e('0x18')]===0x1f4){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x13f7e9[_0x550e('0x17')]['message']);return _0x116691(_0x13f7e9[_0x550e('0x17')]['message']);}logger[_0x550e('0x17')]('MailInteraction,\x20%s,\x20%s',_0x1a1e3e,_0x13f7e9['error'][_0x550e('0x19')]);return _0x59c6c9(_0x13f7e9[_0x550e('0x17')]['message']);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x1a1e3e,_0x550e('0x14'));_0x59c6c9(_0x13f7e9['result']['message']);}})[_0x550e('0x1a')](function(_0x3607ad){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x3607ad);_0x116691(_0x3607ad);});});}exports[_0x550e('0x1b')]=function(_0x29f2db){var _0x3b4dca=this;return new Promise(function(_0x38f12b,_0x1b9799){return db['MailInteraction'][_0x550e('0x1c')](_0x29f2db[_0x550e('0x1d')],{'raw':_0x29f2db['options']?_0x29f2db['options'][_0x550e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29f2db[_0x550e('0x1f')]?_0x29f2db['options'][_0x550e('0x20')]||null:null,'attributes':_0x29f2db[_0x550e('0x1f')]?_0x29f2db[_0x550e('0x1f')][_0x550e('0x21')]||null:null,'limit':_0x29f2db[_0x550e('0x1f')]?_0x29f2db[_0x550e('0x1f')]['limit']||null:null})[_0x550e('0x22')](function(_0x205e3a){logger[_0x550e('0x12')](_0x550e('0x1b'),_0x29f2db);logger[_0x550e('0x23')](_0x550e('0x1b'),_0x29f2db,JSON[_0x550e('0x16')](_0x205e3a));_0x38f12b(_0x205e3a);})[_0x550e('0x1a')](function(_0x13ca4e){logger[_0x550e('0x17')](_0x550e('0x1b'),_0x13ca4e[_0x550e('0x19')],_0x29f2db);_0x1b9799(_0x3b4dca['error'](0x1f4,_0x13ca4e[_0x550e('0x19')]));});});};exports[_0x550e('0x24')]=function(_0x48d367){return new Promise(function(_0x3a1d62,_0x78f04c){return db[_0x550e('0x25')][_0x550e('0x26')]({'where':_0x48d367[_0x550e('0x1f')]?_0x48d367[_0x550e('0x1f')][_0x550e('0x20')]||null:null})[_0x550e('0x22')](function(_0x209f30){if(_0x209f30){return _0x209f30[_0x550e('0x27')](_0x48d367[_0x550e('0x1d')][_0x550e('0x28')],_[_0x550e('0x29')](_0x48d367[_0x550e('0x1d')],['ids','id'])||{});}})[_0x550e('0x2a')](function(_0x1a544d){logger['info'](_0x550e('0x2b'),_0x48d367);logger[_0x550e('0x23')]('AddTags',_0x48d367,JSON[_0x550e('0x16')](_0x1a544d));_0x3a1d62(_0x1a544d);})[_0x550e('0x1a')](function(_0x1beb59){logger[_0x550e('0x17')](_0x550e('0x2b'),_0x1beb59[_0x550e('0x19')],_0x48d367);_0x78f04c(_this[_0x550e('0x17')](0x1f4,_0x1beb59[_0x550e('0x19')]));});});}; \ No newline at end of file +var _0x6075=['AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToMailInteraction','omit','ids'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6075,0x191));var _0x5607=function(_0x480834,_0x2fbcee){_0x480834=_0x480834-0x0;var _0x33aab2=_0x6075[_0x480834];return _0x33aab2;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var moment=require(_0x5607('0x1'));var BPromise=require(_0x5607('0x2'));var rs=require(_0x5607('0x3'));var fs=require('fs');var Redis=require(_0x5607('0x4'));var db=require(_0x5607('0x5'))['db'];var utils=require(_0x5607('0x6'));var logger=require(_0x5607('0x7'))(_0x5607('0x8'));var config=require('../../config/environment');var jayson=require(_0x5607('0x9'));var client=jayson[_0x5607('0xa')][_0x5607('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5607('0xc')],{'host':_0x5607('0xd'),'port':0x18eb});var socket=require(_0x5607('0xe'))(new Redis(config[_0x5607('0xc')]));require(_0x5607('0xf'))['register'](socket);function respondWithRpcPromise(_0x96549b,_0x45de00,_0xe18e86){return new BPromise(function(_0x4ea43b,_0x6e62a0){return client['request'](_0x96549b,_0xe18e86)['then'](function(_0x3eb82e){logger[_0x5607('0x10')](_0x5607('0x11'),_0x45de00,'request\x20sent');logger[_0x5607('0x12')](_0x5607('0x13'),_0x45de00,_0x5607('0x14'),JSON[_0x5607('0x15')](_0x3eb82e));if(_0x3eb82e[_0x5607('0x16')]){if(_0x3eb82e[_0x5607('0x16')][_0x5607('0x17')]===0x1f4){logger[_0x5607('0x16')](_0x5607('0x11'),_0x45de00,_0x3eb82e['error'][_0x5607('0x18')]);return _0x6e62a0(_0x3eb82e[_0x5607('0x16')][_0x5607('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x45de00,_0x3eb82e[_0x5607('0x16')]['message']);return _0x4ea43b(_0x3eb82e[_0x5607('0x16')][_0x5607('0x18')]);}else{logger[_0x5607('0x10')](_0x5607('0x11'),_0x45de00,_0x5607('0x14'));_0x4ea43b(_0x3eb82e[_0x5607('0x19')]['message']);}})[_0x5607('0x1a')](function(_0x50bd2c){logger[_0x5607('0x16')](_0x5607('0x11'),_0x45de00,_0x50bd2c);_0x6e62a0(_0x50bd2c);});});}exports[_0x5607('0x1b')]=function(_0x5f080d){var _0xffa25d=this;return new Promise(function(_0x6e4868,_0x303089){return db['MailInteraction'][_0x5607('0x1c')](_0x5f080d[_0x5607('0x1d')],{'raw':_0x5f080d[_0x5607('0x1e')]?_0x5f080d['options'][_0x5607('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f080d['options']?_0x5f080d['options'][_0x5607('0x20')]||null:null,'attributes':_0x5f080d[_0x5607('0x1e')]?_0x5f080d[_0x5607('0x1e')][_0x5607('0x21')]||null:null,'limit':_0x5f080d[_0x5607('0x1e')]?_0x5f080d[_0x5607('0x1e')][_0x5607('0x22')]||null:null})[_0x5607('0x23')](function(_0x8a7592){logger[_0x5607('0x10')]('UpdateMailInteraction',_0x5f080d);logger[_0x5607('0x12')](_0x5607('0x1b'),_0x5f080d,JSON['stringify'](_0x8a7592));_0x6e4868(_0x8a7592);})[_0x5607('0x1a')](function(_0x14dd08){logger[_0x5607('0x16')](_0x5607('0x1b'),_0x14dd08[_0x5607('0x18')],_0x5f080d);_0x303089(_0xffa25d[_0x5607('0x16')](0x1f4,_0x14dd08[_0x5607('0x18')]));});});};exports[_0x5607('0x24')]=function(_0x570e62){return new Promise(function(_0xcd4e9f,_0x309ede){return db['MailInteraction']['find']({'where':_0x570e62[_0x5607('0x1e')]?_0x570e62[_0x5607('0x1e')][_0x5607('0x20')]||null:null})[_0x5607('0x23')](function(_0x2c3078){if(_0x2c3078){return _0x2c3078['addTags'](_0x570e62[_0x5607('0x1d')]['ids'],_[_0x5607('0x25')](_0x570e62[_0x5607('0x1d')],[_0x5607('0x26'),'id'])||{});}})['spread'](function(_0x326c51){logger['info'](_0x5607('0x27'),_0x570e62);logger[_0x5607('0x12')](_0x5607('0x27'),_0x570e62,JSON[_0x5607('0x15')](_0x326c51));_0xcd4e9f(_0x326c51);})[_0x5607('0x1a')](function(_0x525fb5){logger[_0x5607('0x16')]('AddTags',_0x525fb5[_0x5607('0x18')],_0x570e62);_0x309ede(_this[_0x5607('0x16')](0x1f4,_0x525fb5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 10fb260..b1c7dcc 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 _0x09a7=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x09a7,0x13b));var _0x709a=function(_0x47c055,_0x18b00a){_0x47c055=_0x47c055-0x0;var _0x5a240b=_0x09a7[_0x47c055];return _0x5a240b;};'use strict';var MailInteractionEvents=require(_0x709a('0x0'));var events=[_0x709a('0x1'),_0x709a('0x2'),_0x709a('0x3')];function createListener(_0x423e88,_0x1e0b7e){return function(_0x5109fa){_0x1e0b7e[_0x709a('0x4')](_0x423e88,_0x5109fa);};}function removeListener(_0x370b33,_0x5c8e14){return function(){MailInteractionEvents[_0x709a('0x5')](_0x370b33,_0x5c8e14);};}exports[_0x709a('0x6')]=function(_0x850263){for(var _0x4bdacf=0x0,_0x9b3e1e=events[_0x709a('0x7')];_0x4bdacf<_0x9b3e1e;_0x4bdacf++){var _0x132286=events[_0x4bdacf];var _0x24164b=createListener(_0x709a('0x8')+_0x132286,_0x850263);MailInteractionEvents['on'](_0x132286,_0x24164b);}}; \ No newline at end of file +var _0x6d21=['save','update','emit','removeListener','./mailInteraction.events'];(function(_0x116d33,_0xd0ac04){var _0x32c10d=function(_0xd65b43){while(--_0xd65b43){_0x116d33['push'](_0x116d33['shift']());}};_0x32c10d(++_0xd0ac04);}(_0x6d21,0x144));var _0x16d2=function(_0x2aaa29,_0x56aeb8){_0x2aaa29=_0x2aaa29-0x0;var _0x521519=_0x6d21[_0x2aaa29];return _0x521519;};'use strict';var MailInteractionEvents=require(_0x16d2('0x0'));var events=[_0x16d2('0x1'),'remove',_0x16d2('0x2')];function createListener(_0x1a6a12,_0x3410d8){return function(_0xe8a044){_0x3410d8[_0x16d2('0x3')](_0x1a6a12,_0xe8a044);};}function removeListener(_0x3e4596,_0x180b92){return function(){MailInteractionEvents[_0x16d2('0x4')](_0x3e4596,_0x180b92);};}exports['register']=function(_0x3db806){for(var _0x4afdd5=0x0,_0x28a21f=events['length'];_0x4afdd5<_0x28a21f;_0x4afdd5++){var _0x5bdbaf=events[_0x4afdd5];var _0x40ebac=createListener('mailInteraction:'+_0x5bdbaf,_0x3db806);MailInteractionEvents['on'](_0x5bdbaf,_0x40ebac);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 5ef1ca1..2349332 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 _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x814b=['post','tracked','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download'];(function(_0x19990f,_0x1ebd9e){var _0x188288=function(_0x37a6c2){while(--_0x37a6c2){_0x19990f['push'](_0x19990f['shift']());}};_0x188288(++_0x1ebd9e);}(_0x814b,0x1a2));var _0xb814=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x814b[_0x5b26cb];return _0x563d12;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0x9')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')]('/',auth[_0xb814('0xa')](),interaction[_0xb814('0x12')]('mail',_0xb814('0x13')),controller['create']);router[_0xb814('0x14')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x15')]);router[_0xb814('0x14')](_0xb814('0x16'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);router[_0xb814('0x14')](_0xb814('0x18'),auth[_0xb814('0xa')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x1b')]);module[_0xb814('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index bb2a9e7..6e4e352 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 _0x4034=['TEXT','BOOLEAN','ENUM','out','long','INTEGER','DATE','lodash','exports'];(function(_0x2b522b,_0x15f23e){var _0xcc61ad=function(_0x603c08){while(--_0x603c08){_0x2b522b['push'](_0x2b522b['shift']());}};_0xcc61ad(++_0x15f23e);}(_0x4034,0x166));var _0x4403=function(_0x1486ce,_0x233c7f){_0x1486ce=_0x1486ce-0x0;var _0x10a7b2=_0x4034[_0x1486ce];return _0x10a7b2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4403('0x0'));module[_0x4403('0x1')]={'body':{'type':Sequelize[_0x4403('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4403('0x2')]('medium')},'read':{'type':Sequelize[_0x4403('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4403('0x4')]('in','out'),'defaultValue':_0x4403('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x4403('0x6'))},'cc':{'type':Sequelize['TEXT'](_0x4403('0x6'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x4403('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4403('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4403('0x8')]},'originTo':{'type':Sequelize[_0x4403('0x2')](_0x4403('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x4403('0x6'))}}; \ No newline at end of file +var _0x6988=['TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','sequelize','lodash','exports'];(function(_0x4e6993,_0x5a8f22){var _0x2ab2a3=function(_0x2bc5cc){while(--_0x2bc5cc){_0x4e6993['push'](_0x4e6993['shift']());}};_0x2ab2a3(++_0x5a8f22);}(_0x6988,0x81));var _0x8698=function(_0xbc59d6,_0xbbf474){_0xbc59d6=_0xbc59d6-0x0;var _0x490ebe=_0x6988[_0xbc59d6];return _0x490ebe;};'use strict';var Sequelize=require(_0x8698('0x0'));var _=require(_0x8698('0x1'));module[_0x8698('0x2')]={'body':{'type':Sequelize[_0x8698('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8698('0x4'))},'read':{'type':Sequelize[_0x8698('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8698('0x6')]('in',_0x8698('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8698('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'cc':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'bcc':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x8698('0xa')]},'attach':{'type':Sequelize[_0x8698('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8698('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8698('0xa')]},'originTo':{'type':Sequelize[_0x8698('0x3')](_0x8698('0x9'))},'originCc':{'type':Sequelize['TEXT'](_0x8698('0x9'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2068371..d91d1e1 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 _0x9590=['Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','download','toString','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','from','subject','headers','Bcc','Attachments','existsSync','push','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./mailMessage.socket','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','destroy','then','end','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','key','field','options','includeAll','include','findAll','show','find','body','params','describe','create','direction','out','secret','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','auth','pass','service','user','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','update','format','stringify','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x9590,0xd3));var _0x0959=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x9590[_0x30cc1a];return _0xb3f18f;};'use strict';var pdf=require(_0x0959('0x0'));var emlformat=require(_0x0959('0x1'));var rimraf=require(_0x0959('0x2'));var zipdir=require(_0x0959('0x3'));var jsonpatch=require(_0x0959('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0959('0x5'));var Mustache=require(_0x0959('0x6'));var util=require(_0x0959('0x7'));var path=require(_0x0959('0x8'));var sox=require(_0x0959('0x9'));var csv=require(_0x0959('0xa'));var ejs=require(_0x0959('0xb'));var fs=require('fs');var _=require(_0x0959('0xc'));var squel=require(_0x0959('0xd'));var crypto=require(_0x0959('0xe'));var jsforce=require(_0x0959('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0959('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0959('0x11'));var qs=require(_0x0959('0x12'));var hardwareService=require(_0x0959('0x13'));var logger=require(_0x0959('0x14'))('api');var utils=require(_0x0959('0x15'));var config=require('../../config/environment');var db=require(_0x0959('0x16'))['db'];config['redis']=_['defaults'](config[_0x0959('0x17')],{'host':_0x0959('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0959('0x19'))['register'](socket);var jayson=require(_0x0959('0x1a'));var client=jayson['client'][_0x0959('0x1b')]({'port':0x232c});var client9003=jayson[_0x0959('0x1c')][_0x0959('0x1b')]({'port':0x232b});var client9002=jayson[_0x0959('0x1c')][_0x0959('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x57c6ab,_0x2407ee,_0x15c79e){if(_0x15c79e){var _0x1e7ffd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e7ffd[_0x0959('0x1d')](_0x2407ee)){return _0x57c6ab;}else{throw new Error(_0x0959('0x1e'));}}else{return _0x57c6ab;}}function respondWithRpcPromise(_0x58f98d,_0x30e7db,_0xaacd76,_0x5e54b0){return new BPromise(function(_0x2d9d2e,_0x475476){var _0xf042c8=_0x5e54b0||client;return _0xf042c8[_0x0959('0x1f')](_0x58f98d,_0xaacd76)['then'](function(_0x516574){logger[_0x0959('0x20')](_0x0959('0x21'),_0x30e7db,_0x0959('0x22'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x30e7db,_0x0959('0x22'),JSON['stringify'](_0x516574));if(_0x516574[_0x0959('0x23')]){if(_0x516574[_0x0959('0x23')][_0x0959('0x24')]===0x1f4){logger[_0x0959('0x23')](_0x0959('0x21'),_0x30e7db,_0x516574[_0x0959('0x23')][_0x0959('0x25')]);return _0x475476(_0x516574[_0x0959('0x23')][_0x0959('0x25')]);}logger[_0x0959('0x23')]('MailMessage,\x20%s,\x20%s',_0x30e7db,_0x516574['error'][_0x0959('0x25')]);return _0x2d9d2e(_0x516574['error']['message']);}else{logger[_0x0959('0x20')](_0x0959('0x21'),_0x30e7db,_0x0959('0x22'));_0x2d9d2e(_0x516574[_0x0959('0x26')][_0x0959('0x25')]);}})[_0x0959('0x27')](function(_0x59d00f){logger['error'](_0x0959('0x21'),_0x30e7db,_0x59d00f);_0x475476(_0x59d00f);});});}function respondWithStatusCode(_0x314134,_0x113c8a){_0x113c8a=_0x113c8a||0xcc;return function(_0x3d33fc){if(_0x3d33fc){return _0x314134[_0x0959('0x28')](_0x113c8a);}return _0x314134[_0x0959('0x29')](_0x113c8a)['end']();};}function respondWithResult(_0x375c5b,_0x94d8f4){_0x94d8f4=_0x94d8f4||0xc8;return function(_0xcfc0e1){if(_0xcfc0e1){return _0x375c5b[_0x0959('0x29')](_0x94d8f4)[_0x0959('0x2a')](_0xcfc0e1);}};}function respondWithFilteredResult(_0x3ee493,_0x5e48e0){return function(_0x2c941f){if(_0x2c941f){var _0x13fbb6=_0x2c941f[_0x0959('0x2b')],_0x12221d=_0x5e48e0[_0x0959('0x2c')],_0x2efa15=_0x5e48e0[_0x0959('0x2c')]+_0x5e48e0[_0x0959('0x2d')],_0x3e89cf;if(_0x2efa15>=_0x13fbb6){_0x2efa15=_0x13fbb6;_0x3e89cf=0xc8;}else{_0x3e89cf=0xce;}_0x3ee493[_0x0959('0x29')](_0x3e89cf);return _0x3ee493['set']('Content-Range',_0x12221d+'-'+_0x2efa15+'/'+_0x13fbb6)[_0x0959('0x2a')](_0x2c941f);}return null;};}function patchUpdates(_0x2d1395){return function(_0x4cc7d7){try{jsonpatch[_0x0959('0x2e')](_0x4cc7d7,_0x2d1395,!![]);}catch(_0x591b92){return BPromise[_0x0959('0x2f')](_0x591b92);}return _0x4cc7d7[_0x0959('0x30')]();};}function saveUpdates(_0x249675,_0x2d7d4c){return function(_0x5bd3ba){if(_0x5bd3ba){return _0x5bd3ba['update'](_0x249675)['then'](function(_0x30dbda){return _0x30dbda;});}return null;};}function removeEntity(_0x4c1060,_0x561b2a){return function(_0x464b86){if(_0x464b86){return _0x464b86[_0x0959('0x31')]()[_0x0959('0x32')](function(){_0x4c1060['status'](0xcc)[_0x0959('0x33')]();});}};}function handleEntityNotFound(_0x44773c,_0x1ac00c){return function(_0x37492a){if(!_0x37492a){_0x44773c[_0x0959('0x28')](0x194);}return _0x37492a;};}function handleError(_0x4011f7,_0x1ac9a6){_0x1ac9a6=_0x1ac9a6||0x1f4;return function(_0x5c089e){logger[_0x0959('0x23')](_0x5c089e[_0x0959('0x34')]);if(_0x5c089e[_0x0959('0x35')]){delete _0x5c089e[_0x0959('0x35')];}_0x4011f7[_0x0959('0x29')](_0x1ac9a6)[_0x0959('0x36')](_0x5c089e);};}exports[_0x0959('0x37')]=function(_0x1b291e,_0x1e3e6e){var _0x52af80={},_0x22ebde={},_0x6d0a22={'count':0x0,'rows':[]};var _0x1265ac=db[_0x0959('0x38')][_0x0959('0x39')];_0x22ebde[_0x0959('0x3a')]=_[_0x0959('0x3b')](_0x1265ac);_0x22ebde[_0x0959('0x3c')]=_[_0x0959('0x3b')](_0x1b291e[_0x0959('0x3c')]);_0x22ebde['filters']=_[_0x0959('0x3d')](_0x22ebde[_0x0959('0x3a')],_0x22ebde[_0x0959('0x3c')]);_0x52af80[_0x0959('0x3e')]=_[_0x0959('0x3d')](_0x22ebde['model'],qs[_0x0959('0x3f')](_0x1b291e[_0x0959('0x3c')]['fields']));_0x52af80[_0x0959('0x3e')]=_0x52af80[_0x0959('0x3e')][_0x0959('0x40')]?_0x52af80[_0x0959('0x3e')]:_0x22ebde[_0x0959('0x3a')];if(!_0x1b291e[_0x0959('0x3c')][_0x0959('0x41')](_0x0959('0x42'))){_0x52af80['limit']=qs[_0x0959('0x2d')](_0x1b291e['query']['limit']);_0x52af80[_0x0959('0x2c')]=qs['offset'](_0x1b291e[_0x0959('0x3c')][_0x0959('0x2c')]);}_0x52af80['order']=qs[_0x0959('0x43')](_0x1b291e[_0x0959('0x3c')][_0x0959('0x43')]);_0x52af80[_0x0959('0x44')]=qs[_0x0959('0x45')](_[_0x0959('0x46')](_0x1b291e[_0x0959('0x3c')],_0x22ebde['filters']));if(_0x1b291e[_0x0959('0x3c')][_0x0959('0x47')]){_0x52af80[_0x0959('0x44')]=_[_0x0959('0x48')](_0x52af80[_0x0959('0x44')],{'$or':_[_0x0959('0x49')](_0x1265ac,function(_0x1a90ba){if(_0x1a90ba['type'][_0x0959('0x4a')]!=='VIRTUAL'){var _0x2ca010={};_0x2ca010[_0x1a90ba[_0x0959('0x4b')]]={'$like':'%'+_0x1b291e[_0x0959('0x3c')][_0x0959('0x47')]+'%'};return _0x2ca010;}})});}_0x52af80=_[_0x0959('0x48')]({},_0x52af80,_0x1b291e[_0x0959('0x4c')]);var _0x267d5c={'where':_0x52af80[_0x0959('0x44')]};return db[_0x0959('0x38')][_0x0959('0x2b')](_0x267d5c)['then'](function(_0x5acb9b){_0x6d0a22[_0x0959('0x2b')]=_0x5acb9b;if(_0x1b291e[_0x0959('0x3c')][_0x0959('0x4d')]){_0x52af80[_0x0959('0x4e')]=[{'all':!![]}];}return db[_0x0959('0x38')][_0x0959('0x4f')](_0x52af80);})[_0x0959('0x32')](function(_0x3afeab){_0x6d0a22['rows']=_0x3afeab;return _0x6d0a22;})[_0x0959('0x32')](respondWithFilteredResult(_0x1e3e6e,_0x52af80))['catch'](handleError(_0x1e3e6e,null));};exports[_0x0959('0x50')]=function(_0x35f750,_0x46b0f4){var _0x419f4c={'raw':!![],'where':{'id':_0x35f750['params']['id']}},_0x41ff08={};_0x41ff08[_0x0959('0x3a')]=_[_0x0959('0x3b')](db['MailMessage']['rawAttributes']);_0x41ff08[_0x0959('0x3c')]=_[_0x0959('0x3b')](_0x35f750[_0x0959('0x3c')]);_0x41ff08[_0x0959('0x45')]=_[_0x0959('0x3d')](_0x41ff08[_0x0959('0x3a')],_0x41ff08['query']);_0x419f4c[_0x0959('0x3e')]=_[_0x0959('0x3d')](_0x41ff08[_0x0959('0x3a')],qs[_0x0959('0x3f')](_0x35f750[_0x0959('0x3c')][_0x0959('0x3f')]));_0x419f4c[_0x0959('0x3e')]=_0x419f4c[_0x0959('0x3e')][_0x0959('0x40')]?_0x419f4c[_0x0959('0x3e')]:_0x41ff08[_0x0959('0x3a')];if(_0x35f750['query']['includeAll']){_0x419f4c['include']=[{'all':!![]}];}_0x419f4c=_[_0x0959('0x48')]({},_0x419f4c,_0x35f750[_0x0959('0x4c')]);return db['MailMessage'][_0x0959('0x51')](_0x419f4c)['then'](handleEntityNotFound(_0x46b0f4,null))[_0x0959('0x32')](respondWithResult(_0x46b0f4,null))[_0x0959('0x27')](handleError(_0x46b0f4,null));};exports['update']=function(_0x555298,_0x3d89fe){if(_0x555298['body']['id']){delete _0x555298[_0x0959('0x52')]['id'];}return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x555298[_0x0959('0x53')]['id']}})[_0x0959('0x32')](handleEntityNotFound(_0x3d89fe,null))[_0x0959('0x32')](saveUpdates(_0x555298[_0x0959('0x52')],null))[_0x0959('0x32')](respondWithResult(_0x3d89fe,null))[_0x0959('0x27')](handleError(_0x3d89fe,null));};exports['destroy']=function(_0x5848f7,_0x580244){return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x5848f7[_0x0959('0x53')]['id']}})[_0x0959('0x32')](handleEntityNotFound(_0x580244,null))[_0x0959('0x32')](removeEntity(_0x580244,null))[_0x0959('0x27')](handleError(_0x580244,null));};exports[_0x0959('0x54')]=function(_0xf96ffe,_0x5ac3c5){return db[_0x0959('0x38')]['describe']()[_0x0959('0x32')](respondWithResult(_0x5ac3c5,null))[_0x0959('0x27')](handleError(_0x5ac3c5,null));};exports[_0x0959('0x55')]=function(_0x4d55b2,_0x860bf0){return db['MailMessage'][_0x0959('0x55')](_0x4d55b2[_0x0959('0x52')])[_0x0959('0x32')](function(_0x137314){if(_0x137314){if(_0x137314[_0x0959('0x56')]===_0x0959('0x57')&&!_0x137314[_0x0959('0x58')]){return db[_0x0959('0x59')]['findOne']({'where':{'id':_0x137314[_0x0959('0x5a')]},'include':[{'model':db[_0x0959('0x5b')],'as':'Smtp','raw':!![]}]})['then'](function(_0x1d851e){if(_0x1d851e&&_0x1d851e[_0x0959('0x5c')]){var _0x171570={'tls':{'rejectUnauthorized':![]}};if(_[_0x0959('0x5d')](_0x1d851e[_0x0959('0x5c')]['service'])){_0x171570[_0x0959('0x5e')]=_0x1d851e[_0x0959('0x5c')][_0x0959('0x5e')];_0x171570[_0x0959('0x5f')]=_0x1d851e[_0x0959('0x5c')][_0x0959('0x5f')];_0x171570[_0x0959('0x60')]=_0x1d851e[_0x0959('0x5c')]['secure'];if(_0x1d851e[_0x0959('0x5c')]['authentication']){_0x171570[_0x0959('0x61')]={'user':_0x1d851e[_0x0959('0x5c')]['user'],'pass':_0x1d851e[_0x0959('0x5c')][_0x0959('0x62')]};}}else{_0x171570['service']=_0x1d851e[_0x0959('0x5c')][_0x0959('0x63')];_0x171570[_0x0959('0x61')]={'user':_0x1d851e[_0x0959('0x5c')][_0x0959('0x64')],'pass':_0x1d851e[_0x0959('0x5c')][_0x0959('0x62')]};_0x171570[_0x0959('0x60')]=_0x1d851e[_0x0959('0x5c')]['secure'];}if(_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')]&&_0x4d55b2['body'][_0x0959('0x65')][_0x0959('0x40')]){for(var _0x35692d=0x0;_0x35692d<_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x0959('0x40')];_0x35692d+=0x1){_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d]={'filename':_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d][_0x0959('0x35')],'path':path[_0x0959('0x66')](config[_0x0959('0x67')],_0x0959('0x68'),_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d][_0x0959('0x69')])};}}return{'account':_0x171570,'message':_0x4d55b2[_0x0959('0x52')]};}})[_0x0959('0x32')](function(_0x1dd908){if(_0x1dd908){return respondWithRpcPromise(_0x0959('0x6a'),_0x0959('0x6b'),_0x1dd908,client9003)['then'](function(_0x431da7){return _0x137314[_0x0959('0x6c')]({'read':!![],'messageId':_0x431da7['messageId'],'sentAt':moment()[_0x0959('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0959('0x27')](function(_0x4f135e){logger[_0x0959('0x23')]('%s',JSON[_0x0959('0x6e')](_0x4f135e));return _0x137314;});}return _0x137314;});}return _0x137314;}})[_0x0959('0x32')](respondWithResult(_0x860bf0,0xc9))[_0x0959('0x27')](handleError(_0x860bf0,null));};var interaction_log=require(_0x0959('0x14'))(_0x0959('0x6f'));exports[_0x0959('0x70')]=function(_0xed3c47,_0x286c20,_0x570bf8){var _0x489ca7={'channel':_0x0959('0x71')};if(_0xed3c47[_0x0959('0x52')]['id']){delete _0xed3c47['body']['id'];}_0xed3c47[_0x0959('0x52')][_0x0959('0x72')]=!![];_0xed3c47['body'][_0x0959('0x73')]=moment()[_0x0959('0x6d')](_0x0959('0x74'));_0xed3c47[_0x0959('0x52')][_0x0959('0x75')]=_0xed3c47[_0x0959('0x52')]['UserId']||_0xed3c47[_0x0959('0x64')]['id'];return db[_0x0959('0x38')]['find']({'where':{'id':_0xed3c47['params']['id'],'UserId':null},'include':[{'model':db[_0x0959('0x76')],'as':_0x0959('0x77')}]})[_0x0959('0x32')](handleEntityNotFound(_0x286c20,null))['then'](saveUpdates(_0xed3c47['body'],null))[_0x0959('0x32')](function(_0x32025a){if(_0x32025a){_0x489ca7[_0x0959('0x25')]=_0x32025a[_0x0959('0x78')]({'plain':!![]});return db[_0x0959('0x79')][_0x0959('0x51')]({'where':{'id':_0x32025a[_0x0959('0x7a')]}});}return null;})[_0x0959('0x32')](handleEntityNotFound(_0x286c20,null))[_0x0959('0x32')](function(_0x37a9cf){if(_0x37a9cf){return _0x37a9cf[_0x0959('0x6c')]({'UserId':_0xed3c47[_0x0959('0x52')][_0x0959('0x75')],'read1stAt':_[_0x0959('0x5d')](_0x37a9cf[_0x0959('0x7b')])?moment()[_0x0959('0x6d')](_0x0959('0x74')):undefined});}return null;})[_0x0959('0x32')](function(_0x27c1f2){if(_0x27c1f2){_0x489ca7[_0x0959('0x7c')]=_0x27c1f2[_0x0959('0x78')]({'plain':!![]});interaction_log[_0x0959('0x20')](_0x0959('0x7d'),_0xed3c47[_0x0959('0x64')]['id'],_0xed3c47[_0x0959('0x64')][_0x0959('0x35')],_0xed3c47[_0x0959('0x64')][_0x0959('0x7e')],_0x489ca7[_0x0959('0x7c')]['id'],_0xed3c47[_0x0959('0x52')]?JSON[_0x0959('0x6e')](_0xed3c47[_0x0959('0x52')]):_0x0959('0x7f'));return respondWithRpcPromise(_0x0959('0x80'),_0x0959('0x81'),_0x489ca7);}return null;})['then'](function(_0x2f9797){if(_0x2f9797){if(_0xed3c47[_0x0959('0x52')][_0x0959('0x82')]){_0x489ca7[_0x0959('0x25')][_0x0959('0x83')]=util['format'](_0x0959('0x84'),_0xed3c47[_0x0959('0x64')]['name']);_0x489ca7[_0x0959('0x25')][_0x0959('0x85')]=_0x489ca7[_0x0959('0x85')];_0x489ca7['message']['event']=_0x0959('0x70');return respondWithRpcPromise(_0x0959('0x86'),_0x0959('0x86'),{'event':_0x0959('0x87'),'message':_0x489ca7['message']},client9002)[_0x0959('0x32')](function(){return _0x489ca7;});}return _0x489ca7;}return null;})['then'](respondWithResult(_0x286c20,null))['catch'](handleError(_0x286c20,null));};var interaction_log=require(_0x0959('0x14'))('mail-interactions');exports[_0x0959('0x2f')]=function(_0x56c875,_0x2885f3,_0x532713){var _0x2f62c6={'agent':{},'channel':_0x0959('0x71')};if(_0x56c875[_0x0959('0x52')]['id']){delete _0x56c875['body']['id'];}_0x56c875['body'][_0x0959('0x75')]=_0x56c875['body'][_0x0959('0x75')]||_0x56c875['user']['id'];_0x2f62c6[_0x0959('0x88')]['id']=_0x56c875[_0x0959('0x52')][_0x0959('0x75')];return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x56c875['params']['id'],'UserId':null}})[_0x0959('0x32')](handleEntityNotFound(_0x2885f3,null))['then'](function(_0x3d126f){if(_0x3d126f){_0x2f62c6['message']=_0x3d126f[_0x0959('0x78')]({'plain':!![]});return db[_0x0959('0x79')][_0x0959('0x51')]({'where':{'id':_0x3d126f['MailInteractionId']}});}return null;})[_0x0959('0x32')](handleEntityNotFound(_0x2885f3,null))[_0x0959('0x32')](function(_0x4c49f4){if(_0x4c49f4){_0x2f62c6['interaction']=_0x4c49f4['get']({'plain':!![]});interaction_log['info'](_0x0959('0x89'),_0x56c875[_0x0959('0x64')]['id'],_0x56c875[_0x0959('0x64')][_0x0959('0x35')],_0x56c875[_0x0959('0x64')][_0x0959('0x7e')],_0x2f62c6[_0x0959('0x7c')]['id'],_0x56c875[_0x0959('0x52')]?JSON[_0x0959('0x6e')](_0x56c875['body']):_0x0959('0x7f'));return respondWithRpcPromise(_0x0959('0x8a'),_0x0959('0x8b'),_0x2f62c6);}return null;})['then'](function(_0x21868b){if(_0x21868b){_0x21868b['message'][_0x0959('0x83')]=util['format'](_0x0959('0x84'),_0x56c875[_0x0959('0x64')][_0x0959('0x35')]);_0x21868b[_0x0959('0x25')][_0x0959('0x85')]=_0x2f62c6[_0x0959('0x85')];_0x21868b[_0x0959('0x25')][_0x0959('0x8c')]='reject';respondWithRpcPromise(_0x0959('0x86'),_0x0959('0x86'),{'event':_0x0959('0x8d'),'message':_0x21868b[_0x0959('0x25')]},client9002);return _0x2f62c6;}return null;})[_0x0959('0x32')](respondWithResult(_0x2885f3,null))[_0x0959('0x27')](handleError(_0x2885f3,null));};exports[_0x0959('0x8e')]=function(_0x2ed7e7,_0x2b987a){var _0x4ce49b=moment()['unix']()[_0x0959('0x8f')]();var _0x5307c0=path[_0x0959('0x66')](config[_0x0959('0x67')],_0x0959('0x90'),_0x0959('0x91'),_0x0959('0x92'));var _0x3627b1=path[_0x0959('0x66')](config['root'],_0x0959('0x90'),_0x0959('0x91'),_0x0959('0x65'));var _0x4ab456=util[_0x0959('0x6d')](_0x0959('0x93'),_0x4ce49b);return db[_0x0959('0x38')]['find']({'where':{'id':_0x2ed7e7[_0x0959('0x53')]['id']},'attributes':['id',_0x0959('0x52'),'from','to','cc',_0x0959('0x94'),'subject',_0x0959('0x95')],'include':_0x2ed7e7[_0x0959('0x3c')]['attachments']?[{'model':db[_0x0959('0x96')],'as':'Attachments'}]:undefined})[_0x0959('0x32')](handleEntityNotFound(_0x2b987a,null))[_0x0959('0x32')](function(_0xb48ed4){if(_0xb48ed4){var _0x1fda86=_0xb48ed4;var _0x14e712={'from':_0x1fda86[_0x0959('0x97')],'to':_0x1fda86['to'],'subject':_0x1fda86[_0x0959('0x98')],'html':_0x1fda86['body'],'headers':{'Date':moment(_0x1fda86['createdAt'])[_0x0959('0x6d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xb48ed4['cc']){_0x14e712[_0x0959('0x99')]['Cc']=_0xb48ed4['cc'];}if(_0xb48ed4['bcc']){_0x14e712['headers'][_0x0959('0x9a')]=_0xb48ed4[_0x0959('0x94')];}return new BPromise(function(_0x57c173,_0x14bd51){if(_0xb48ed4[_0x0959('0x9b')]){for(var _0x172beb=0x0;_0x172beb<_0xb48ed4[_0x0959('0x9b')]['length'];_0x172beb++){var _0x2ec1fd=_0xb48ed4[_0x0959('0x9b')][_0x172beb];var _0x32fc3d=path[_0x0959('0x66')](_0x3627b1,_0x2ec1fd[_0x0959('0x69')]);if(fs[_0x0959('0x9c')](_0x32fc3d)){_0x14e712[_0x0959('0x65')][_0x0959('0x9d')]({'name':_0x2ec1fd[_0x0959('0x35')],'contentType':_0x2ec1fd[_0x0959('0x9e')],'data':fs[_0x0959('0x9f')](_0x32fc3d)});}}}emlformat[_0x0959('0xa0')](_0x14e712,function(_0x281b95,_0x514bd3){if(_0x281b95)return _0x14bd51(_0x281b95);fs[_0x0959('0xa1')](path[_0x0959('0x66')](_0x5307c0,_0x4ab456),_0x514bd3);return _0x57c173(_0x514bd3);});});}})[_0x0959('0x32')](function(_0x491f74){if(_0x491f74){return _0x2b987a['download'](path['join'](_0x5307c0,_0x4ab456),_0x4ab456,function(_0x28ba66){if(_0x28ba66){console[_0x0959('0xa2')](_0x0959('0xa3'),_0x28ba66);}else{fs[_0x0959('0xa4')](path[_0x0959('0x66')](_0x5307c0,_0x4ab456));}});}})[_0x0959('0x27')](handleError(_0x2b987a,null));}; \ No newline at end of file +var _0x1708=['body','params','create','direction','out','MailAccount','Smtp','isNil','service','host','port','authentication','auth','user','pass','secure','attachments','server/files/attachments','basename','SendMail','format','accept','mail','read','UserId','CmContact','Contact','get','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','channel','event','EventManager','acceptmessage','mail-interactions','MailInteraction','RejectMessage','rejectMessage','SIP/%s','rejectmessage','download','unix','toString','join','root','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','key','options','includeAll','include','MailMessage','findAll','rows','catch','show','keys','rawAttributes','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1708,0xe9));var _0x8170=function(_0x1a3eb1,_0x5188d5){_0x1a3eb1=_0x1a3eb1-0x0;var _0x29efec=_0x1708[_0x1a3eb1];return _0x29efec;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8170('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8170('0x1'));var jsonpatch=require(_0x8170('0x2'));var rp=require(_0x8170('0x3'));var moment=require('moment');var BPromise=require(_0x8170('0x4'));var Mustache=require('mustache');var util=require(_0x8170('0x5'));var path=require(_0x8170('0x6'));var sox=require(_0x8170('0x7'));var csv=require(_0x8170('0x8'));var ejs=require(_0x8170('0x9'));var fs=require('fs');var _=require(_0x8170('0xa'));var squel=require(_0x8170('0xb'));var crypto=require(_0x8170('0xc'));var jsforce=require(_0x8170('0xd'));var deskjs=require(_0x8170('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8170('0xf'));var Papa=require(_0x8170('0x10'));var Redis=require(_0x8170('0x11'));var authService=require(_0x8170('0x12'));var qs=require(_0x8170('0x13'));var hardwareService=require(_0x8170('0x14'));var logger=require(_0x8170('0x15'))('api');var utils=require(_0x8170('0x16'));var config=require(_0x8170('0x17'));var db=require(_0x8170('0x18'))['db'];config['redis']=_[_0x8170('0x19')](config[_0x8170('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8170('0x1b'))(new Redis(config[_0x8170('0x1a')]));require(_0x8170('0x1c'))['register'](socket);var jayson=require(_0x8170('0x1d'));var client=jayson[_0x8170('0x1e')][_0x8170('0x1f')]({'port':0x232c});var client9003=jayson[_0x8170('0x1e')][_0x8170('0x1f')]({'port':0x232b});var client9002=jayson['client'][_0x8170('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x272816,_0x23341a,_0x326049){if(_0x326049){var _0x1c64d9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c64d9['test'](_0x23341a)){return _0x272816;}else{throw new Error(_0x8170('0x20'));}}else{return _0x272816;}}function respondWithRpcPromise(_0x2a7bb5,_0x3085fd,_0x2a57ec,_0x21328a){return new BPromise(function(_0x25d87e,_0x5f05ce){var _0x1bbc64=_0x21328a||client;return _0x1bbc64[_0x8170('0x21')](_0x2a7bb5,_0x2a57ec)[_0x8170('0x22')](function(_0x4d1e87){logger[_0x8170('0x23')]('MailMessage,\x20%s,\x20%s',_0x3085fd,_0x8170('0x24'));logger[_0x8170('0x25')](_0x8170('0x26'),_0x3085fd,'request\x20sent',JSON[_0x8170('0x27')](_0x4d1e87));if(_0x4d1e87['error']){if(_0x4d1e87[_0x8170('0x28')][_0x8170('0x29')]===0x1f4){logger[_0x8170('0x28')]('MailMessage,\x20%s,\x20%s',_0x3085fd,_0x4d1e87['error']['message']);return _0x5f05ce(_0x4d1e87[_0x8170('0x28')][_0x8170('0x2a')]);}logger[_0x8170('0x28')](_0x8170('0x2b'),_0x3085fd,_0x4d1e87[_0x8170('0x28')][_0x8170('0x2a')]);return _0x25d87e(_0x4d1e87['error'][_0x8170('0x2a')]);}else{logger[_0x8170('0x23')](_0x8170('0x2b'),_0x3085fd,_0x8170('0x24'));_0x25d87e(_0x4d1e87['result'][_0x8170('0x2a')]);}})['catch'](function(_0x4697b6){logger[_0x8170('0x28')](_0x8170('0x2b'),_0x3085fd,_0x4697b6);_0x5f05ce(_0x4697b6);});});}function respondWithStatusCode(_0x70e25,_0x982ff0){_0x982ff0=_0x982ff0||0xcc;return function(_0x3576e9){if(_0x3576e9){return _0x70e25['sendStatus'](_0x982ff0);}return _0x70e25['status'](_0x982ff0)[_0x8170('0x2c')]();};}function respondWithResult(_0x51008f,_0x5ccd2e){_0x5ccd2e=_0x5ccd2e||0xc8;return function(_0x3e5b33){if(_0x3e5b33){return _0x51008f[_0x8170('0x2d')](_0x5ccd2e)[_0x8170('0x2e')](_0x3e5b33);}};}function respondWithFilteredResult(_0xb2b9da,_0x2fbe59){return function(_0x2139d9){if(_0x2139d9){var _0x139898=_0x2139d9[_0x8170('0x2f')],_0xe86e74=_0x2fbe59[_0x8170('0x30')],_0x37162d=_0x2fbe59[_0x8170('0x30')]+_0x2fbe59['limit'],_0x3e3ec4;if(_0x37162d>=_0x139898){_0x37162d=_0x139898;_0x3e3ec4=0xc8;}else{_0x3e3ec4=0xce;}_0xb2b9da[_0x8170('0x2d')](_0x3e3ec4);return _0xb2b9da[_0x8170('0x31')](_0x8170('0x32'),_0xe86e74+'-'+_0x37162d+'/'+_0x139898)[_0x8170('0x2e')](_0x2139d9);}return null;};}function patchUpdates(_0x5b7c4e){return function(_0x28f375){try{jsonpatch[_0x8170('0x33')](_0x28f375,_0x5b7c4e,!![]);}catch(_0x25f4b){return BPromise[_0x8170('0x34')](_0x25f4b);}return _0x28f375[_0x8170('0x35')]();};}function saveUpdates(_0x50b93d,_0x513376){return function(_0xd5ed9){if(_0xd5ed9){return _0xd5ed9[_0x8170('0x36')](_0x50b93d)['then'](function(_0x11ca35){return _0x11ca35;});}return null;};}function removeEntity(_0x2fbd25,_0x166fe5){return function(_0x50c9ea){if(_0x50c9ea){return _0x50c9ea[_0x8170('0x37')]()[_0x8170('0x22')](function(){_0x2fbd25['status'](0xcc)[_0x8170('0x2c')]();});}};}function handleEntityNotFound(_0x4b02ba,_0x5733e7){return function(_0x46c1d3){if(!_0x46c1d3){_0x4b02ba['sendStatus'](0x194);}return _0x46c1d3;};}function handleError(_0x35c63d,_0x68ea3e){_0x68ea3e=_0x68ea3e||0x1f4;return function(_0xf476a0){logger[_0x8170('0x28')](_0xf476a0['stack']);if(_0xf476a0[_0x8170('0x38')]){delete _0xf476a0[_0x8170('0x38')];}_0x35c63d['status'](_0x68ea3e)[_0x8170('0x39')](_0xf476a0);};}exports[_0x8170('0x3a')]=function(_0x364f2c,_0x36c638){var _0x4635a2={},_0xb1fbdf={},_0x31c315={'count':0x0,'rows':[]};var _0x2ebdc5=db['MailMessage']['rawAttributes'];_0xb1fbdf[_0x8170('0x3b')]=_['keys'](_0x2ebdc5);_0xb1fbdf[_0x8170('0x3c')]=_['keys'](_0x364f2c['query']);_0xb1fbdf['filters']=_[_0x8170('0x3d')](_0xb1fbdf[_0x8170('0x3b')],_0xb1fbdf[_0x8170('0x3c')]);_0x4635a2[_0x8170('0x3e')]=_[_0x8170('0x3d')](_0xb1fbdf[_0x8170('0x3b')],qs[_0x8170('0x3f')](_0x364f2c[_0x8170('0x3c')]['fields']));_0x4635a2[_0x8170('0x3e')]=_0x4635a2['attributes'][_0x8170('0x40')]?_0x4635a2[_0x8170('0x3e')]:_0xb1fbdf['model'];if(!_0x364f2c[_0x8170('0x3c')][_0x8170('0x41')]('nolimit')){_0x4635a2[_0x8170('0x42')]=qs['limit'](_0x364f2c['query'][_0x8170('0x42')]);_0x4635a2['offset']=qs[_0x8170('0x30')](_0x364f2c['query'][_0x8170('0x30')]);}_0x4635a2[_0x8170('0x43')]=qs[_0x8170('0x44')](_0x364f2c[_0x8170('0x3c')]['sort']);_0x4635a2[_0x8170('0x45')]=qs[_0x8170('0x46')](_[_0x8170('0x47')](_0x364f2c['query'],_0xb1fbdf[_0x8170('0x46')]));if(_0x364f2c[_0x8170('0x3c')][_0x8170('0x48')]){_0x4635a2['where']=_[_0x8170('0x49')](_0x4635a2[_0x8170('0x45')],{'$or':_[_0x8170('0x4a')](_0x2ebdc5,function(_0x4a7291){if(_0x4a7291['type'][_0x8170('0x4b')]!=='VIRTUAL'){var _0x5a1a31={};_0x5a1a31[_0x4a7291['field']]={'$like':'%'+_0x364f2c[_0x8170('0x3c')]['filter']+'%'};return _0x5a1a31;}})});}_0x4635a2=_[_0x8170('0x49')]({},_0x4635a2,_0x364f2c[_0x8170('0x4c')]);var _0x273e04={'where':_0x4635a2[_0x8170('0x45')]};return db['MailMessage']['count'](_0x273e04)[_0x8170('0x22')](function(_0x543759){_0x31c315[_0x8170('0x2f')]=_0x543759;if(_0x364f2c[_0x8170('0x3c')][_0x8170('0x4d')]){_0x4635a2[_0x8170('0x4e')]=[{'all':!![]}];}return db[_0x8170('0x4f')][_0x8170('0x50')](_0x4635a2);})[_0x8170('0x22')](function(_0x4d2ea3){_0x31c315[_0x8170('0x51')]=_0x4d2ea3;return _0x31c315;})[_0x8170('0x22')](respondWithFilteredResult(_0x36c638,_0x4635a2))[_0x8170('0x52')](handleError(_0x36c638,null));};exports[_0x8170('0x53')]=function(_0x5369c7,_0x12bd49){var _0x37b7bc={'raw':!![],'where':{'id':_0x5369c7['params']['id']}},_0x3edf82={};_0x3edf82[_0x8170('0x3b')]=_[_0x8170('0x54')](db[_0x8170('0x4f')][_0x8170('0x55')]);_0x3edf82[_0x8170('0x3c')]=_['keys'](_0x5369c7[_0x8170('0x3c')]);_0x3edf82['filters']=_[_0x8170('0x3d')](_0x3edf82[_0x8170('0x3b')],_0x3edf82['query']);_0x37b7bc[_0x8170('0x3e')]=_[_0x8170('0x3d')](_0x3edf82['model'],qs[_0x8170('0x3f')](_0x5369c7['query'][_0x8170('0x3f')]));_0x37b7bc[_0x8170('0x3e')]=_0x37b7bc[_0x8170('0x3e')][_0x8170('0x40')]?_0x37b7bc[_0x8170('0x3e')]:_0x3edf82[_0x8170('0x3b')];if(_0x5369c7[_0x8170('0x3c')][_0x8170('0x4d')]){_0x37b7bc[_0x8170('0x4e')]=[{'all':!![]}];}_0x37b7bc=_[_0x8170('0x49')]({},_0x37b7bc,_0x5369c7['options']);return db['MailMessage'][_0x8170('0x56')](_0x37b7bc)[_0x8170('0x22')](handleEntityNotFound(_0x12bd49,null))[_0x8170('0x22')](respondWithResult(_0x12bd49,null))['catch'](handleError(_0x12bd49,null));};exports[_0x8170('0x36')]=function(_0x2d0e17,_0x1df1bf){if(_0x2d0e17[_0x8170('0x57')]['id']){delete _0x2d0e17[_0x8170('0x57')]['id'];}return db['MailMessage'][_0x8170('0x56')]({'where':{'id':_0x2d0e17[_0x8170('0x58')]['id']}})[_0x8170('0x22')](handleEntityNotFound(_0x1df1bf,null))[_0x8170('0x22')](saveUpdates(_0x2d0e17[_0x8170('0x57')],null))['then'](respondWithResult(_0x1df1bf,null))['catch'](handleError(_0x1df1bf,null));};exports[_0x8170('0x37')]=function(_0x4ab83b,_0x52affb){return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x4ab83b['params']['id']}})[_0x8170('0x22')](handleEntityNotFound(_0x52affb,null))[_0x8170('0x22')](removeEntity(_0x52affb,null))[_0x8170('0x52')](handleError(_0x52affb,null));};exports['describe']=function(_0x5f07b0,_0x2b7f28){return db[_0x8170('0x4f')]['describe']()['then'](respondWithResult(_0x2b7f28,null))[_0x8170('0x52')](handleError(_0x2b7f28,null));};exports[_0x8170('0x59')]=function(_0x2e1962,_0x3f28fe){return db[_0x8170('0x4f')]['create'](_0x2e1962[_0x8170('0x57')])[_0x8170('0x22')](function(_0x59af1f){if(_0x59af1f){if(_0x59af1f[_0x8170('0x5a')]===_0x8170('0x5b')&&!_0x59af1f['secret']){return db[_0x8170('0x5c')]['findOne']({'where':{'id':_0x59af1f['MailAccountId']},'include':[{'model':db['MailServerOut'],'as':_0x8170('0x5d'),'raw':!![]}]})['then'](function(_0x53e086){if(_0x53e086&&_0x53e086[_0x8170('0x5d')]){var _0x4a1c34={'tls':{'rejectUnauthorized':![]}};if(_[_0x8170('0x5e')](_0x53e086[_0x8170('0x5d')][_0x8170('0x5f')])){_0x4a1c34[_0x8170('0x60')]=_0x53e086[_0x8170('0x5d')]['host'];_0x4a1c34[_0x8170('0x61')]=_0x53e086[_0x8170('0x5d')]['port'];_0x4a1c34['secure']=_0x53e086[_0x8170('0x5d')]['secure'];if(_0x53e086['Smtp'][_0x8170('0x62')]){_0x4a1c34[_0x8170('0x63')]={'user':_0x53e086[_0x8170('0x5d')][_0x8170('0x64')],'pass':_0x53e086[_0x8170('0x5d')][_0x8170('0x65')]};}}else{_0x4a1c34['service']=_0x53e086[_0x8170('0x5d')][_0x8170('0x5f')];_0x4a1c34['auth']={'user':_0x53e086['Smtp'][_0x8170('0x64')],'pass':_0x53e086['Smtp']['pass']};_0x4a1c34[_0x8170('0x66')]=_0x53e086[_0x8170('0x5d')][_0x8170('0x66')];}if(_0x2e1962[_0x8170('0x57')][_0x8170('0x67')]&&_0x2e1962[_0x8170('0x57')][_0x8170('0x67')]['length']){for(var _0x11d29a=0x0;_0x11d29a<_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x8170('0x40')];_0x11d29a+=0x1){_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a]={'filename':_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a][_0x8170('0x38')],'path':path['join'](config['root'],_0x8170('0x68'),_0x2e1962[_0x8170('0x57')][_0x8170('0x67')][_0x11d29a][_0x8170('0x69')])};}}return{'account':_0x4a1c34,'message':_0x2e1962[_0x8170('0x57')]};}})[_0x8170('0x22')](function(_0x31fdb5){if(_0x31fdb5){return respondWithRpcPromise(_0x8170('0x6a'),'sendMail',_0x31fdb5,client9003)[_0x8170('0x22')](function(_0x158801){return _0x59af1f['update']({'read':!![],'messageId':_0x158801['messageId'],'sentAt':moment()[_0x8170('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x8170('0x52')](function(_0x59b361){logger['error']('%s',JSON[_0x8170('0x27')](_0x59b361));return _0x59af1f;});}return _0x59af1f;});}return _0x59af1f;}})[_0x8170('0x22')](respondWithResult(_0x3f28fe,0xc9))[_0x8170('0x52')](handleError(_0x3f28fe,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x8170('0x6c')]=function(_0x59fe32,_0x5c6897,_0x3986af){var _0x54020e={'channel':_0x8170('0x6d')};if(_0x59fe32[_0x8170('0x57')]['id']){delete _0x59fe32['body']['id'];}_0x59fe32[_0x8170('0x57')][_0x8170('0x6e')]=!![];_0x59fe32['body']['readAt']=moment()[_0x8170('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');_0x59fe32[_0x8170('0x57')][_0x8170('0x6f')]=_0x59fe32[_0x8170('0x57')]['UserId']||_0x59fe32['user']['id'];return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x59fe32[_0x8170('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x8170('0x70')],'as':_0x8170('0x71')}]})[_0x8170('0x22')](handleEntityNotFound(_0x5c6897,null))[_0x8170('0x22')](saveUpdates(_0x59fe32[_0x8170('0x57')],null))[_0x8170('0x22')](function(_0x5a1f48){if(_0x5a1f48){_0x54020e[_0x8170('0x2a')]=_0x5a1f48[_0x8170('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5a1f48[_0x8170('0x73')]}});}return null;})[_0x8170('0x22')](handleEntityNotFound(_0x5c6897,null))['then'](function(_0x5e64ed){if(_0x5e64ed){return _0x5e64ed[_0x8170('0x36')]({'UserId':_0x59fe32[_0x8170('0x57')][_0x8170('0x6f')],'read1stAt':_[_0x8170('0x5e')](_0x5e64ed['read1stAt'])?moment()[_0x8170('0x6b')](_0x8170('0x74')):undefined});}return null;})[_0x8170('0x22')](function(_0x4ae644){if(_0x4ae644){_0x54020e[_0x8170('0x75')]=_0x4ae644[_0x8170('0x72')]({'plain':!![]});interaction_log['info'](_0x8170('0x76'),_0x59fe32[_0x8170('0x64')]['id'],_0x59fe32[_0x8170('0x64')]['name'],_0x59fe32[_0x8170('0x64')][_0x8170('0x77')],_0x54020e[_0x8170('0x75')]['id'],_0x59fe32[_0x8170('0x57')]?JSON[_0x8170('0x27')](_0x59fe32[_0x8170('0x57')]):_0x8170('0x78'));return respondWithRpcPromise(_0x8170('0x79'),_0x8170('0x7a'),_0x54020e);}return null;})['then'](function(_0x19e374){if(_0x19e374){if(_0x59fe32[_0x8170('0x57')]['manual']){_0x54020e[_0x8170('0x2a')][_0x8170('0x7b')]=util['format']('SIP/%s',_0x59fe32[_0x8170('0x64')][_0x8170('0x38')]);_0x54020e[_0x8170('0x2a')][_0x8170('0x7c')]=_0x54020e['channel'];_0x54020e[_0x8170('0x2a')][_0x8170('0x7d')]=_0x8170('0x6c');return respondWithRpcPromise(_0x8170('0x7e'),_0x8170('0x7e'),{'event':_0x8170('0x7f'),'message':_0x54020e[_0x8170('0x2a')]},client9002)[_0x8170('0x22')](function(){return _0x54020e;});}return _0x54020e;}return null;})['then'](respondWithResult(_0x5c6897,null))[_0x8170('0x52')](handleError(_0x5c6897,null));};var interaction_log=require(_0x8170('0x15'))(_0x8170('0x80'));exports[_0x8170('0x34')]=function(_0x1df5ea,_0x50d2db,_0x45a52b){var _0xe1bd1c={'agent':{},'channel':'mail'};if(_0x1df5ea['body']['id']){delete _0x1df5ea[_0x8170('0x57')]['id'];}_0x1df5ea['body'][_0x8170('0x6f')]=_0x1df5ea[_0x8170('0x57')][_0x8170('0x6f')]||_0x1df5ea['user']['id'];_0xe1bd1c['agent']['id']=_0x1df5ea[_0x8170('0x57')][_0x8170('0x6f')];return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0x1df5ea[_0x8170('0x58')]['id'],'UserId':null}})[_0x8170('0x22')](handleEntityNotFound(_0x50d2db,null))['then'](function(_0x5d2d20){if(_0x5d2d20){_0xe1bd1c[_0x8170('0x2a')]=_0x5d2d20[_0x8170('0x72')]({'plain':!![]});return db[_0x8170('0x81')][_0x8170('0x56')]({'where':{'id':_0x5d2d20['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x50d2db,null))[_0x8170('0x22')](function(_0xc4d171){if(_0xc4d171){_0xe1bd1c[_0x8170('0x75')]=_0xc4d171[_0x8170('0x72')]({'plain':!![]});interaction_log[_0x8170('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1df5ea['user']['id'],_0x1df5ea[_0x8170('0x64')]['name'],_0x1df5ea[_0x8170('0x64')][_0x8170('0x77')],_0xe1bd1c['interaction']['id'],_0x1df5ea[_0x8170('0x57')]?JSON[_0x8170('0x27')](_0x1df5ea[_0x8170('0x57')]):_0x8170('0x78'));return respondWithRpcPromise(_0x8170('0x82'),_0x8170('0x83'),_0xe1bd1c);}return null;})['then'](function(_0x3a2a3f){if(_0x3a2a3f){_0x3a2a3f[_0x8170('0x2a')]['interface']=util[_0x8170('0x6b')](_0x8170('0x84'),_0x1df5ea[_0x8170('0x64')][_0x8170('0x38')]);_0x3a2a3f[_0x8170('0x2a')][_0x8170('0x7c')]=_0xe1bd1c['channel'];_0x3a2a3f[_0x8170('0x2a')][_0x8170('0x7d')]=_0x8170('0x34');respondWithRpcPromise(_0x8170('0x7e'),'EventManager',{'event':_0x8170('0x85'),'message':_0x3a2a3f['message']},client9002);return _0xe1bd1c;}return null;})[_0x8170('0x22')](respondWithResult(_0x50d2db,null))['catch'](handleError(_0x50d2db,null));};exports[_0x8170('0x86')]=function(_0xbb855b,_0x45d829){var _0x5a76c4=moment()[_0x8170('0x87')]()[_0x8170('0x88')]();var _0x1fbefa=path[_0x8170('0x89')](config[_0x8170('0x8a')],_0x8170('0x8b'),_0x8170('0x8c'),_0x8170('0x8d'));var _0x51dcc1=path['join'](config[_0x8170('0x8a')],'server','files',_0x8170('0x67'));var _0x160dc3=util[_0x8170('0x6b')](_0x8170('0x8e'),_0x5a76c4);return db[_0x8170('0x4f')][_0x8170('0x56')]({'where':{'id':_0xbb855b[_0x8170('0x58')]['id']},'attributes':['id',_0x8170('0x57'),_0x8170('0x8f'),'to','cc',_0x8170('0x90'),_0x8170('0x91'),'createdAt'],'include':_0xbb855b[_0x8170('0x3c')][_0x8170('0x67')]?[{'model':db[_0x8170('0x92')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x45d829,null))[_0x8170('0x22')](function(_0x275b21){if(_0x275b21){var _0x290429=_0x275b21;var _0x14923b={'from':_0x290429[_0x8170('0x8f')],'to':_0x290429['to'],'subject':_0x290429[_0x8170('0x91')],'html':_0x290429[_0x8170('0x57')],'headers':{'Date':moment(_0x290429[_0x8170('0x93')])[_0x8170('0x6b')](_0x8170('0x94'))},'attachments':[]};if(_0x275b21['cc']){_0x14923b[_0x8170('0x95')]['Cc']=_0x275b21['cc'];}if(_0x275b21['bcc']){_0x14923b[_0x8170('0x95')][_0x8170('0x96')]=_0x275b21['bcc'];}return new BPromise(function(_0x4997d1,_0x2bdeb1){if(_0x275b21[_0x8170('0x97')]){for(var _0x129bdc=0x0;_0x129bdc<_0x275b21['Attachments'][_0x8170('0x40')];_0x129bdc++){var _0x5d3739=_0x275b21[_0x8170('0x97')][_0x129bdc];var _0x35895b=path['join'](_0x51dcc1,_0x5d3739[_0x8170('0x69')]);if(fs[_0x8170('0x98')](_0x35895b)){_0x14923b['attachments'][_0x8170('0x99')]({'name':_0x5d3739[_0x8170('0x38')],'contentType':_0x5d3739['type'],'data':fs[_0x8170('0x9a')](_0x35895b)});}}}emlformat[_0x8170('0x9b')](_0x14923b,function(_0xd2b5da,_0x5416ad){if(_0xd2b5da)return _0x2bdeb1(_0xd2b5da);fs[_0x8170('0x9c')](path['join'](_0x1fbefa,_0x160dc3),_0x5416ad);return _0x4997d1(_0x5416ad);});});}})['then'](function(_0x4f64b8){if(_0x4f64b8){return _0x45d829[_0x8170('0x86')](path['join'](_0x1fbefa,_0x160dc3),_0x160dc3,function(_0x42ac18){if(_0x42ac18){console[_0x8170('0x9d')](_0x8170('0x9e'),_0x42ac18);}else{fs[_0x8170('0x9f')](path[_0x8170('0x89')](_0x1fbefa,_0x160dc3));}});}})['catch'](handleError(_0x45d829,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0a79f6c..40729b6 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 _0xc949=['exports','events','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xe4dc99,_0x3f0e75){var _0x2d1561=function(_0x52b551){while(--_0x52b551){_0xe4dc99['push'](_0xe4dc99['shift']());}};_0x2d1561(++_0x3f0e75);}(_0xc949,0x181));var _0x9c94=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc949[_0x491a7f];return _0x3d8f44;};'use strict';var EventEmitter=require(_0x9c94('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x9c94('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9c94('0x2')](0x0);var events={'afterCreate':_0x9c94('0x3'),'afterUpdate':_0x9c94('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11a56c){return function(_0x231762,_0x528a17,_0x405fe2){MailMessageEvents[_0x9c94('0x5')](_0x11a56c+':'+_0x231762['id'],_0x231762);MailMessageEvents[_0x9c94('0x5')](_0x11a56c,_0x231762);_0x405fe2(null);};}for(var e in events){if(events[_0x9c94('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x9c94('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xb194=['hasOwnProperty','exports','events','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x34945a,_0x423a7d){var _0x5d7a1d=function(_0xe346c0){while(--_0xe346c0){_0x34945a['push'](_0x34945a['shift']());}};_0x5d7a1d(++_0x423a7d);}(_0xb194,0x1b2));var _0x4b19=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0xb194[_0xd3348b];return _0x583cdc;};'use strict';var EventEmitter=require(_0x4b19('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x4b19('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4b19('0x2')](0x0);var events={'afterCreate':_0x4b19('0x3'),'afterUpdate':_0x4b19('0x4'),'afterDestroy':_0x4b19('0x5')};function emitEvent(_0x5c07ad){return function(_0x46faa3,_0x3a4700,_0x555969){MailMessageEvents[_0x4b19('0x6')](_0x5c07ad+':'+_0x46faa3['id'],_0x46faa3);MailMessageEvents['emit'](_0x5c07ad,_0x46faa3);_0x555969(null);};}for(var e in events){if(events[_0x4b19('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x4b19('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 a69225d..b53cfbd 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 _0x97fb=['findOne','then','update','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','html-to-text','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x97fb,0x1b8));var _0xb97f=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x97fb[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0xb97f('0x0'));var util=require('util');var logger=require(_0xb97f('0x1'))(_0xb97f('0x2'));var moment=require(_0xb97f('0x3'));var BPromise=require(_0xb97f('0x4'));var rp=require('request-promise');var htmlToText=require(_0xb97f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb97f('0x6'));var config=require(_0xb97f('0x7'));var attributes=require('./mailMessage.attributes');module[_0xb97f('0x8')]=function(_0x39a460,_0x24d53c){return _0x39a460[_0xb97f('0x9')]('MailMessage',attributes,{'tableName':_0xb97f('0xa'),'paranoid':![],'indexes':[{'name':_0xb97f('0xb'),'fields':['messageId']},{'name':_0xb97f('0xc'),'fields':[_0xb97f('0xd'),_0xb97f('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45cbec,_0x3af14f,_0x2e4fda){if(_0x45cbec[_0xb97f('0xf')]){_0x45cbec[_0xb97f('0xd')]=htmlToText[_0xb97f('0x10')](_0x45cbec[_0xb97f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e4fda(null,_0x3af14f);},'afterCreate':function(_0x17e545,_0x52ab5b,_0xac01f6){var _0x525e90=_0x39a460[_0xb97f('0x11')];var _0x5b870b=_0x17e545['get']({'plain':!![]});if(_0x5b870b['direction'][_0xb97f('0x12')]()==='in'||_0x5b870b[_0xb97f('0x13')][_0xb97f('0x12')]()===_0xb97f('0x14')&&!_0x5b870b[_0xb97f('0x15')]&&!_[_0xb97f('0x16')](_0x5b870b[_0xb97f('0x17')])){_0x525e90['MailInteraction'][_0xb97f('0x18')]({'where':{'id':_0x5b870b['MailInteractionId']}})[_0xb97f('0x19')](function(_0x26ba48){if(_0x26ba48){_0x26ba48[_0xb97f('0x1a')]({'lastMsgAt':_0x5b870b['createdAt'],'lastMsgDirection':_0x5b870b[_0xb97f('0x13')][_0xb97f('0x12')](),'lastMsgBody':_0x5b870b[_0xb97f('0xf')]});}})[_0xb97f('0x1b')](function(_0x4f3d70){console['error'](_0x4f3d70);});}_0xac01f6();}},'charset':_0xb97f('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8ab5=['direction','out','secret','isNil','UserId','findOne','update','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','toLowerCase'];(function(_0x2534ce,_0x46b96d){var _0x2dc511=function(_0x54796d){while(--_0x54796d){_0x2534ce['push'](_0x2534ce['shift']());}};_0x2dc511(++_0x46b96d);}(_0x8ab5,0x9f));var _0x58ab=function(_0x483eea,_0x35cfc5){_0x483eea=_0x483eea-0x0;var _0x27c3e0=_0x8ab5[_0x483eea];return _0x27c3e0;};'use strict';var _=require(_0x58ab('0x0'));var util=require(_0x58ab('0x1'));var logger=require(_0x58ab('0x2'))(_0x58ab('0x3'));var moment=require(_0x58ab('0x4'));var BPromise=require(_0x58ab('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x58ab('0x6'));var rimraf=require('rimraf');var config=require(_0x58ab('0x7'));var attributes=require(_0x58ab('0x8'));module[_0x58ab('0x9')]=function(_0x37d6a3,_0x41585e){return _0x37d6a3[_0x58ab('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x58ab('0xb'),'fields':[_0x58ab('0xb')]},{'name':_0x58ab('0xc'),'fields':['plainBody',_0x58ab('0xd')],'type':_0x58ab('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x215820,_0x1688fe,_0x1fc230){if(_0x215820[_0x58ab('0xf')]){_0x215820[_0x58ab('0x10')]=htmlToText[_0x58ab('0x11')](_0x215820[_0x58ab('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1fc230(null,_0x1688fe);},'afterCreate':function(_0x14d7d9,_0x4fb129,_0x44da93){var _0x2538b6=_0x37d6a3[_0x58ab('0x12')];var _0x3ae3bf=_0x14d7d9[_0x58ab('0x13')]({'plain':!![]});if(_0x3ae3bf['direction'][_0x58ab('0x14')]()==='in'||_0x3ae3bf[_0x58ab('0x15')][_0x58ab('0x14')]()===_0x58ab('0x16')&&!_0x3ae3bf[_0x58ab('0x17')]&&!_[_0x58ab('0x18')](_0x3ae3bf[_0x58ab('0x19')])){_0x2538b6['MailInteraction'][_0x58ab('0x1a')]({'where':{'id':_0x3ae3bf['MailInteractionId']}})['then'](function(_0xff62bf){if(_0xff62bf){_0xff62bf[_0x58ab('0x1b')]({'lastMsgAt':_0x3ae3bf['createdAt'],'lastMsgDirection':_0x3ae3bf[_0x58ab('0x15')]['toLowerCase'](),'lastMsgBody':_0x3ae3bf['body']});}})['catch'](function(_0x1c7a8c){console[_0x58ab('0x1c')](_0x1c7a8c);});}_0x44da93();}},'charset':'utf8mb4','collate':_0x58ab('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 521c37d..1f231d2 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 _0x1af3=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateMailMessage','create','body'];(function(_0x300e9e,_0xcbfa6b){var _0x53c501=function(_0x4bdeb0){while(--_0x4bdeb0){_0x300e9e['push'](_0x300e9e['shift']());}};_0x53c501(++_0xcbfa6b);}(_0x1af3,0x1ca));var _0x31af=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x1af3[_0x389832];return _0x59429e;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var moment=require(_0x31af('0x2'));var BPromise=require(_0x31af('0x3'));var rs=require(_0x31af('0x4'));var fs=require('fs');var Redis=require(_0x31af('0x5'));var db=require(_0x31af('0x6'))['db'];var utils=require(_0x31af('0x7'));var logger=require(_0x31af('0x8'))(_0x31af('0x9'));var config=require('../../config/environment');var jayson=require(_0x31af('0xa'));var client=jayson[_0x31af('0xb')][_0x31af('0xc')]({'port':0x232a});config[_0x31af('0xd')]=_['defaults'](config[_0x31af('0xd')],{'host':_0x31af('0xe'),'port':0x18eb});var socket=require(_0x31af('0xf'))(new Redis(config['redis']));require(_0x31af('0x10'))[_0x31af('0x11')](socket);function respondWithRpcPromise(_0x1cfcf6,_0x1d2cd0,_0x2888dd){return new BPromise(function(_0x26c99f,_0x1fa064){return client[_0x31af('0x12')](_0x1cfcf6,_0x2888dd)['then'](function(_0x123fc8){logger[_0x31af('0x13')](_0x31af('0x14'),_0x1d2cd0,_0x31af('0x15'));logger[_0x31af('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1d2cd0,_0x31af('0x15'),JSON[_0x31af('0x17')](_0x123fc8));if(_0x123fc8['error']){if(_0x123fc8['error'][_0x31af('0x18')]===0x1f4){logger[_0x31af('0x19')](_0x31af('0x14'),_0x1d2cd0,_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);return _0x1fa064(_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);}logger[_0x31af('0x19')](_0x31af('0x14'),_0x1d2cd0,_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);return _0x26c99f(_0x123fc8['error'][_0x31af('0x1a')]);}else{logger[_0x31af('0x13')](_0x31af('0x14'),_0x1d2cd0,_0x31af('0x15'));_0x26c99f(_0x123fc8[_0x31af('0x1b')][_0x31af('0x1a')]);}})[_0x31af('0x1c')](function(_0x1684d5){logger[_0x31af('0x19')]('MailMessage,\x20%s,\x20%s',_0x1d2cd0,_0x1684d5);_0x1fa064(_0x1684d5);});});}exports[_0x31af('0x1d')]=function(_0x230002){var _0x16be44=this;return new Promise(function(_0x2ce4c2,_0x414ad8){return db['MailMessage'][_0x31af('0x1e')](_0x230002[_0x31af('0x1f')],{'raw':_0x230002[_0x31af('0x20')]?_0x230002[_0x31af('0x20')][_0x31af('0x21')]===undefined?!![]:![]:!![]})[_0x31af('0x22')](function(_0x1ddfba){logger[_0x31af('0x13')](_0x31af('0x1d'),_0x230002);logger[_0x31af('0x16')](_0x31af('0x1d'),_0x230002,JSON[_0x31af('0x17')](_0x1ddfba));_0x2ce4c2(_0x1ddfba);})[_0x31af('0x1c')](function(_0x34a5a7){logger[_0x31af('0x19')]('CreateMailMessage',_0x34a5a7['message'],_0x230002);_0x414ad8(_0x16be44['error'](0x1f4,_0x34a5a7[_0x31af('0x1a')]));});});}; \ No newline at end of file +var _0xf8af=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','info','stringify','lodash'];(function(_0x2a80ee,_0x4f21f2){var _0x145a20=function(_0x42e967){while(--_0x42e967){_0x2a80ee['push'](_0x2a80ee['shift']());}};_0x145a20(++_0x4f21f2);}(_0xf8af,0x8b));var _0xff8a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf8af[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var moment=require(_0xff8a('0x1'));var BPromise=require(_0xff8a('0x2'));var rs=require(_0xff8a('0x3'));var fs=require('fs');var Redis=require(_0xff8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff8a('0x5'));var logger=require(_0xff8a('0x6'))(_0xff8a('0x7'));var config=require(_0xff8a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff8a('0x9')]({'port':0x232a});config['redis']=_[_0xff8a('0xa')](config[_0xff8a('0xb')],{'host':_0xff8a('0xc'),'port':0x18eb});var socket=require(_0xff8a('0xd'))(new Redis(config[_0xff8a('0xb')]));require(_0xff8a('0xe'))[_0xff8a('0xf')](socket);function respondWithRpcPromise(_0x7442d6,_0x3bb1ba,_0xb8cb56){return new BPromise(function(_0x2c2e5d,_0x5a31cb){return client[_0xff8a('0x10')](_0x7442d6,_0xb8cb56)[_0xff8a('0x11')](function(_0x3f12b5){logger['info'](_0xff8a('0x12'),_0x3bb1ba,_0xff8a('0x13'));logger[_0xff8a('0x14')](_0xff8a('0x15'),_0x3bb1ba,_0xff8a('0x13'),JSON['stringify'](_0x3f12b5));if(_0x3f12b5[_0xff8a('0x16')]){if(_0x3f12b5[_0xff8a('0x16')][_0xff8a('0x17')]===0x1f4){logger[_0xff8a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3bb1ba,_0x3f12b5['error']['message']);return _0x5a31cb(_0x3f12b5['error'][_0xff8a('0x18')]);}logger['error'](_0xff8a('0x12'),_0x3bb1ba,_0x3f12b5[_0xff8a('0x16')]['message']);return _0x2c2e5d(_0x3f12b5[_0xff8a('0x16')]['message']);}else{logger['info'](_0xff8a('0x12'),_0x3bb1ba,_0xff8a('0x13'));_0x2c2e5d(_0x3f12b5[_0xff8a('0x19')]['message']);}})[_0xff8a('0x1a')](function(_0x5c4349){logger[_0xff8a('0x16')]('MailMessage,\x20%s,\x20%s',_0x3bb1ba,_0x5c4349);_0x5a31cb(_0x5c4349);});});}exports[_0xff8a('0x1b')]=function(_0x1b4272){var _0x794015=this;return new Promise(function(_0xdb1027,_0x145d95){return db[_0xff8a('0x1c')][_0xff8a('0x1d')](_0x1b4272[_0xff8a('0x1e')],{'raw':_0x1b4272[_0xff8a('0x1f')]?_0x1b4272[_0xff8a('0x1f')][_0xff8a('0x20')]===undefined?!![]:![]:!![]})[_0xff8a('0x11')](function(_0x3bb4ac){logger[_0xff8a('0x21')](_0xff8a('0x1b'),_0x1b4272);logger['debug'](_0xff8a('0x1b'),_0x1b4272,JSON[_0xff8a('0x22')](_0x3bb4ac));_0xdb1027(_0x3bb4ac);})[_0xff8a('0x1a')](function(_0x303050){logger['error'](_0xff8a('0x1b'),_0x303050['message'],_0x1b4272);_0x145d95(_0x794015[_0xff8a('0x16')](0x1f4,_0x303050[_0xff8a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7d10feb..4074f96 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 _0x46cf=['mailMessage:','remove','update','emit','removeListener','register','length'];(function(_0x525209,_0x256e19){var _0x4f438f=function(_0x1d027d){while(--_0x1d027d){_0x525209['push'](_0x525209['shift']());}};_0x4f438f(++_0x256e19);}(_0x46cf,0xda));var _0xf46c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x46cf[_0x82129b];return _0x2ae5dc;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xf46c('0x0'),_0xf46c('0x1')];function createListener(_0x4b8031,_0xd5e4ec){return function(_0x3f2570){_0xd5e4ec[_0xf46c('0x2')](_0x4b8031,_0x3f2570);};}function removeListener(_0x280e58,_0x51ba4f){return function(){MailMessageEvents[_0xf46c('0x3')](_0x280e58,_0x51ba4f);};}exports[_0xf46c('0x4')]=function(_0x2e1bc2){for(var _0x38fa7c=0x0,_0xb3c0d7=events[_0xf46c('0x5')];_0x38fa7c<_0xb3c0d7;_0x38fa7c++){var _0x5aaa4a=events[_0x38fa7c];var _0x2189f7=createListener(_0xf46c('0x6')+_0x5aaa4a,_0x2e1bc2);MailMessageEvents['on'](_0x5aaa4a,_0x2189f7);}}; \ No newline at end of file +var _0xa059=['./mailMessage.events','save','remove','update','emit','mailMessage:'];(function(_0x53fec6,_0x45fa6b){var _0x5ddf3b=function(_0x39f122){while(--_0x39f122){_0x53fec6['push'](_0x53fec6['shift']());}};_0x5ddf3b(++_0x45fa6b);}(_0xa059,0x90));var _0x9a05=function(_0x5ceb12,_0x3035fd){_0x5ceb12=_0x5ceb12-0x0;var _0x2d046a=_0xa059[_0x5ceb12];return _0x2d046a;};'use strict';var MailMessageEvents=require(_0x9a05('0x0'));var events=[_0x9a05('0x1'),_0x9a05('0x2'),_0x9a05('0x3')];function createListener(_0x3ce22b,_0x16c58f){return function(_0x3dd4b8){_0x16c58f[_0x9a05('0x4')](_0x3ce22b,_0x3dd4b8);};}function removeListener(_0x1331cf,_0x561d95){return function(){MailMessageEvents['removeListener'](_0x1331cf,_0x561d95);};}exports['register']=function(_0x5a6372){for(var _0x4368ce=0x0,_0x592321=events['length'];_0x4368ce<_0x592321;_0x4368ce++){var _0x3d7937=events[_0x4368ce];var _0x403ed3=createListener(_0x9a05('0x5')+_0x3d7937,_0x5a6372);MailMessageEvents['on'](_0x3d7937,_0x403ed3);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 3af03d7..02b9216 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 _0x424e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','path','connect-timeout','./mailQueue.controller'];(function(_0x39d9e5,_0x18e770){var _0x4481f5=function(_0x2bcc92){while(--_0x2bcc92){_0x39d9e5['push'](_0x39d9e5['shift']());}};_0x4481f5(++_0x18e770);}(_0x424e,0x156));var _0xe424=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x424e[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe424('0x0'));var timeout=require(_0xe424('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe424('0x2'));router[_0xe424('0x3')]('/',auth[_0xe424('0x4')](),controller[_0xe424('0x5')]);router['get'](_0xe424('0x6'),auth[_0xe424('0x4')](),controller['describe']);router[_0xe424('0x3')](_0xe424('0x7'),auth[_0xe424('0x4')](),controller[_0xe424('0x8')]);router[_0xe424('0x3')](_0xe424('0x9'),auth['isAuthenticated'](),controller[_0xe424('0xa')]);router[_0xe424('0x3')](_0xe424('0xb'),auth[_0xe424('0x4')](),controller['getTeams']);router[_0xe424('0x3')](_0xe424('0xc'),auth[_0xe424('0x4')](),controller[_0xe424('0xd')]);router[_0xe424('0xe')]('/',auth[_0xe424('0x4')](),controller[_0xe424('0xf')]);router[_0xe424('0xe')](_0xe424('0xb'),auth[_0xe424('0x4')](),controller[_0xe424('0x10')]);router[_0xe424('0xe')](_0xe424('0xc'),auth[_0xe424('0x4')](),controller[_0xe424('0x11')]);router[_0xe424('0x12')](_0xe424('0x7'),auth[_0xe424('0x4')](),controller['update']);router[_0xe424('0x13')]('/:id',auth[_0xe424('0x4')](),controller[_0xe424('0x14')]);router[_0xe424('0x13')](_0xe424('0xb'),auth['isAuthenticated'](),controller[_0xe424('0x15')]);router['delete'](_0xe424('0xc'),auth[_0xe424('0x4')](),controller['removeAgents']);module[_0xe424('0x16')]=router; \ No newline at end of file +var _0x77aa=['post','create','addTeams','/:id/users','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x77aa,0x6a));var _0xa77a=function(_0x25d812,_0x379281){_0x25d812=_0x25d812-0x0;var _0x2a9a0b=_0x77aa[_0x25d812];return _0x2a9a0b;};'use strict';var multer=require(_0xa77a('0x0'));var util=require(_0xa77a('0x1'));var path=require(_0xa77a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa77a('0x3')]();var auth=require(_0xa77a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa77a('0x5'));router[_0xa77a('0x6')]('/',auth[_0xa77a('0x7')](),controller[_0xa77a('0x8')]);router[_0xa77a('0x6')](_0xa77a('0x9'),auth[_0xa77a('0x7')](),controller[_0xa77a('0xa')]);router['get'](_0xa77a('0xb'),auth[_0xa77a('0x7')](),controller[_0xa77a('0xc')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xa77a('0x6')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller['getTeams']);router[_0xa77a('0x6')]('/:id/users',auth[_0xa77a('0x7')](),controller['getAgents']);router[_0xa77a('0xe')]('/',auth[_0xa77a('0x7')](),controller[_0xa77a('0xf')]);router[_0xa77a('0xe')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x10')]);router['post'](_0xa77a('0x11'),auth[_0xa77a('0x7')](),controller['addAgents']);router[_0xa77a('0x12')]('/:id',auth[_0xa77a('0x7')](),controller['update']);router['delete'](_0xa77a('0xb'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x13')]);router[_0xa77a('0x14')](_0xa77a('0xd'),auth[_0xa77a('0x7')](),controller[_0xa77a('0x15')]);router[_0xa77a('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xa77a('0x16')]);module[_0xa77a('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 4813875..dc98acd 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 _0x0d49=['sequelize','exports','name','ENUM','beepall','roundrobin'];(function(_0x2e78bf,_0x16d495){var _0x43511b=function(_0x396e74){while(--_0x396e74){_0x2e78bf['push'](_0x2e78bf['shift']());}};_0x43511b(++_0x16d495);}(_0x0d49,0x1da));var _0x90d4=function(_0x190d80,_0x18d26c){_0x190d80=_0x190d80-0x0;var _0x3cef0d=_0x0d49[_0x190d80];return _0x3cef0d;};'use strict';var Sequelize=require(_0x90d4('0x0'));module[_0x90d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x90d4('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[_0x90d4('0x3')]('rrmemory',_0x90d4('0x4'),_0x90d4('0x5'))}}; \ No newline at end of file +var _0x8643=['beepall','roundrobin','sequelize','name','STRING','INTEGER','rrmemory'];(function(_0xa273e9,_0x49d1dd){var _0x13b88d=function(_0x1b6e82){while(--_0x1b6e82){_0xa273e9['push'](_0xa273e9['shift']());}};_0x13b88d(++_0x49d1dd);}(_0x8643,0xb1));var _0x3864=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8643[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x3864('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3864('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3864('0x2')]},'timeout':{'type':Sequelize[_0x3864('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3864('0x4'),_0x3864('0x5'),_0x3864('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index cdd8fb1..b165568 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 _0x1248=['status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','MailQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','options','count','include','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','order','pick','MailQueueId','UserMailQueue','findAll','User','UserId','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','Agents','online','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register'];(function(_0x584c28,_0x2e9d14){var _0x3b0810=function(_0xce6920){while(--_0xce6920){_0x584c28['push'](_0x584c28['shift']());}};_0x3b0810(++_0x2e9d14);}(_0x1248,0x180));var _0x8124=function(_0x200d3e,_0x592a2b){_0x200d3e=_0x200d3e-0x0;var _0x196fab=_0x1248[_0x200d3e];return _0x196fab;};'use strict';var pdf=require(_0x8124('0x0'));var emlformat=require(_0x8124('0x1'));var rimraf=require(_0x8124('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8124('0x3'));var rp=require(_0x8124('0x4'));var moment=require(_0x8124('0x5'));var BPromise=require(_0x8124('0x6'));var Mustache=require('mustache');var util=require(_0x8124('0x7'));var path=require('path');var sox=require(_0x8124('0x8'));var csv=require(_0x8124('0x9'));var ejs=require(_0x8124('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8124('0xb'));var jsforce=require(_0x8124('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8124('0x9'));var querystring=require(_0x8124('0xd'));var Papa=require(_0x8124('0xe'));var Redis=require(_0x8124('0xf'));var authService=require(_0x8124('0x10'));var qs=require(_0x8124('0x11'));var hardwareService=require(_0x8124('0x12'));var logger=require('../../config/logger')(_0x8124('0x13'));var utils=require('../../config/utils');var config=require(_0x8124('0x14'));var db=require(_0x8124('0x15'))['db'];config[_0x8124('0x16')]=_[_0x8124('0x17')](config[_0x8124('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x8124('0x18'))(new Redis(config['redis']));require(_0x8124('0x19'))[_0x8124('0x1a')](socket);function respondWithStatusCode(_0x34541f,_0x45f42e){_0x45f42e=_0x45f42e||0xcc;return function(_0x5da3c7){if(_0x5da3c7){return _0x34541f['sendStatus'](_0x45f42e);}return _0x34541f[_0x8124('0x1b')](_0x45f42e)[_0x8124('0x1c')]();};}function respondWithResult(_0x1f4f27,_0x3d1d7d){_0x3d1d7d=_0x3d1d7d||0xc8;return function(_0x252272){if(_0x252272){return _0x1f4f27['status'](_0x3d1d7d)[_0x8124('0x1d')](_0x252272);}};}function respondWithFilteredResult(_0xaf1a20,_0x39059c){return function(_0x18412c){if(_0x18412c){var _0xab3c19=_0x18412c['count'],_0x1bf2b4=_0x39059c['offset'],_0x2417f9=_0x39059c[_0x8124('0x1e')]+_0x39059c[_0x8124('0x1f')],_0x45e205;if(_0x2417f9>=_0xab3c19){_0x2417f9=_0xab3c19;_0x45e205=0xc8;}else{_0x45e205=0xce;}_0xaf1a20[_0x8124('0x1b')](_0x45e205);return _0xaf1a20['set'](_0x8124('0x20'),_0x1bf2b4+'-'+_0x2417f9+'/'+_0xab3c19)[_0x8124('0x1d')](_0x18412c);}return null;};}function patchUpdates(_0x1b8cb8){return function(_0x170ae6){try{jsonpatch[_0x8124('0x21')](_0x170ae6,_0x1b8cb8,!![]);}catch(_0x12b973){return BPromise[_0x8124('0x22')](_0x12b973);}return _0x170ae6[_0x8124('0x23')]();};}function saveUpdates(_0x219780,_0x3d424d){return function(_0x1f792a){if(_0x1f792a){return _0x1f792a[_0x8124('0x24')](_0x219780)['then'](function(_0x1e942a){return _0x1e942a;});}return null;};}function removeEntity(_0xa119e7,_0x192b89){return function(_0x493d69){if(_0x493d69){return _0x493d69[_0x8124('0x25')]()[_0x8124('0x26')](function(){var _0x3f1a40=_0x493d69[_0x8124('0x27')]({'plain':!![]});var _0x3e857b='MailQueues';return db[_0x8124('0x28')]['destroy']({'where':{'type':_0x3e857b,'resourceId':_0x3f1a40['id']}})[_0x8124('0x26')](function(){return _0x493d69;});})['then'](function(){_0xa119e7[_0x8124('0x1b')](0xcc)[_0x8124('0x1c')]();});}};}function handleEntityNotFound(_0x475352,_0x3962d2){return function(_0x285b30){if(!_0x285b30){_0x475352[_0x8124('0x29')](0x194);}return _0x285b30;};}function handleError(_0x903548,_0x2ebdf2){_0x2ebdf2=_0x2ebdf2||0x1f4;return function(_0x2115ef){logger[_0x8124('0x2a')](_0x2115ef[_0x8124('0x2b')]);if(_0x2115ef[_0x8124('0x2c')]){delete _0x2115ef['name'];}_0x903548[_0x8124('0x1b')](_0x2ebdf2)['send'](_0x2115ef);};}exports['index']=function(_0xb59085,_0x4f87fc){var _0x52238b={},_0x4824f2={},_0x1be16b={'count':0x0,'rows':[]};var _0xdfbd45=db[_0x8124('0x2d')][_0x8124('0x2e')];_0x4824f2[_0x8124('0x2f')]=_[_0x8124('0x30')](_0xdfbd45);_0x4824f2['query']=_[_0x8124('0x30')](_0xb59085[_0x8124('0x31')]);_0x4824f2[_0x8124('0x32')]=_[_0x8124('0x33')](_0x4824f2[_0x8124('0x2f')],_0x4824f2[_0x8124('0x31')]);_0x52238b[_0x8124('0x34')]=_[_0x8124('0x33')](_0x4824f2[_0x8124('0x2f')],qs['fields'](_0xb59085['query'][_0x8124('0x35')]));_0x52238b['attributes']=_0x52238b[_0x8124('0x34')][_0x8124('0x36')]?_0x52238b[_0x8124('0x34')]:_0x4824f2[_0x8124('0x2f')];if(!_0xb59085[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x52238b['limit']=qs['limit'](_0xb59085[_0x8124('0x31')][_0x8124('0x1f')]);_0x52238b[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0xb59085['query'][_0x8124('0x1e')]);}_0x52238b['order']=qs[_0x8124('0x39')](_0xb59085['query'][_0x8124('0x39')]);_0x52238b[_0x8124('0x3a')]=qs['filters'](_['pick'](_0xb59085[_0x8124('0x31')],_0x4824f2[_0x8124('0x32')]));if(_0xb59085['query'][_0x8124('0x3b')]){_0x52238b['where']=_[_0x8124('0x3c')](_0x52238b[_0x8124('0x3a')],{'$or':_[_0x8124('0x3d')](_0xdfbd45,function(_0x177b62){if(_0x177b62[_0x8124('0x3e')][_0x8124('0x3f')]!=='VIRTUAL'){var _0x26129f={};_0x26129f[_0x177b62['field']]={'$like':'%'+_0xb59085['query'][_0x8124('0x3b')]+'%'};return _0x26129f;}})});}_0x52238b=_[_0x8124('0x3c')]({},_0x52238b,_0xb59085[_0x8124('0x40')]);var _0x4748b7={'where':_0x52238b['where']};return db[_0x8124('0x2d')]['count'](_0x4748b7)[_0x8124('0x26')](function(_0x529072){_0x1be16b[_0x8124('0x41')]=_0x529072;if(_0xb59085[_0x8124('0x31')]['includeAll']){_0x52238b[_0x8124('0x42')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x52238b);})[_0x8124('0x26')](function(_0x52c5fa){_0x1be16b['rows']=_0x52c5fa;return _0x1be16b;})[_0x8124('0x26')](respondWithFilteredResult(_0x4f87fc,_0x52238b))[_0x8124('0x43')](handleError(_0x4f87fc,null));};exports[_0x8124('0x44')]=function(_0x5ce646,_0x355caf){var _0x2749c3={'raw':!![],'where':{'id':_0x5ce646[_0x8124('0x45')]['id']}},_0x557c1c={};_0x557c1c[_0x8124('0x2f')]=_[_0x8124('0x30')](db[_0x8124('0x2d')][_0x8124('0x2e')]);_0x557c1c[_0x8124('0x31')]=_[_0x8124('0x30')](_0x5ce646[_0x8124('0x31')]);_0x557c1c['filters']=_[_0x8124('0x33')](_0x557c1c['model'],_0x557c1c[_0x8124('0x31')]);_0x2749c3[_0x8124('0x34')]=_['intersection'](_0x557c1c[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x5ce646[_0x8124('0x31')]['fields']));_0x2749c3[_0x8124('0x34')]=_0x2749c3[_0x8124('0x34')][_0x8124('0x36')]?_0x2749c3[_0x8124('0x34')]:_0x557c1c['model'];if(_0x5ce646[_0x8124('0x31')][_0x8124('0x46')]){_0x2749c3[_0x8124('0x42')]=[{'all':!![]}];}_0x2749c3=_[_0x8124('0x3c')]({},_0x2749c3,_0x5ce646[_0x8124('0x40')]);return db[_0x8124('0x2d')][_0x8124('0x47')](_0x2749c3)[_0x8124('0x26')](handleEntityNotFound(_0x355caf,null))[_0x8124('0x26')](respondWithResult(_0x355caf,null))[_0x8124('0x43')](handleError(_0x355caf,null));};exports[_0x8124('0x48')]=function(_0xfda0e5,_0x2173f6){return db['MailQueue'][_0x8124('0x48')](_0xfda0e5['body'],{})[_0x8124('0x26')](function(_0x23f1ec){var _0x3dde61=_0xfda0e5[_0x8124('0x49')]['get']({'plain':!![]});if(!_0x3dde61)throw new Error(_0x8124('0x4a'));if(_0x3dde61[_0x8124('0x4b')]===_0x8124('0x49')){var _0x187d81=_0x23f1ec['get']({'plain':!![]});var _0x2fc764=_0x8124('0x4c');return db[_0x8124('0x4d')][_0x8124('0x47')]({'where':{'name':_0x2fc764,'userProfileId':_0x3dde61[_0x8124('0x4e')]},'raw':!![]})[_0x8124('0x26')](function(_0x53a746){if(_0x53a746&&_0x53a746[_0x8124('0x4f')]===0x0){return db[_0x8124('0x28')]['create']({'name':_0x187d81[_0x8124('0x2c')],'resourceId':_0x187d81['id'],'type':_0x53a746[_0x8124('0x2c')],'sectionId':_0x53a746['id']},{})[_0x8124('0x26')](function(){return _0x23f1ec;});}else{return _0x23f1ec;}})[_0x8124('0x43')](function(_0x4256de){logger[_0x8124('0x2a')](_0x8124('0x50'),_0x4256de);throw _0x4256de;});}return _0x23f1ec;})[_0x8124('0x26')](respondWithResult(_0x2173f6,0xc9))[_0x8124('0x43')](handleError(_0x2173f6,null));};exports[_0x8124('0x24')]=function(_0x399381,_0x401c84){if(_0x399381[_0x8124('0x51')]['id']){delete _0x399381[_0x8124('0x51')]['id'];}return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x399381['params']['id']}})['then'](handleEntityNotFound(_0x401c84,null))[_0x8124('0x26')](saveUpdates(_0x399381['body'],null))[_0x8124('0x26')](respondWithResult(_0x401c84,null))[_0x8124('0x43')](handleError(_0x401c84,null));};exports[_0x8124('0x25')]=function(_0x1ac2f3,_0x1cacf5){return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x1ac2f3[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x1cacf5,null))['then'](removeEntity(_0x1cacf5,null))['catch'](handleError(_0x1cacf5,null));};exports[_0x8124('0x52')]=function(_0x530fc5,_0x2c9b42){return db[_0x8124('0x2d')]['describe']()[_0x8124('0x26')](respondWithResult(_0x2c9b42,null))[_0x8124('0x43')](handleError(_0x2c9b42,null));};exports[_0x8124('0x53')]=function(_0x4c25b5,_0xfb4a12,_0x51f058){var _0x52a361={'raw':!![],'where':{}},_0x355796={},_0x15672c;return db[_0x8124('0x2d')]['findOne']({'where':{'id':_0x4c25b5[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0xfb4a12,null))[_0x8124('0x26')](function(_0x200c6c){if(_0x200c6c){_0x15672c=_0x200c6c[_0x8124('0x27')]({'plain':!![]});_0x355796[_0x8124('0x2f')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0x355796[_0x8124('0x31')]=_[_0x8124('0x30')](_0x4c25b5[_0x8124('0x31')]);_0x355796[_0x8124('0x32')]=_[_0x8124('0x33')](_0x355796[_0x8124('0x2f')],_0x355796[_0x8124('0x31')]);_0x52a361[_0x8124('0x34')]=_[_0x8124('0x33')](_0x355796[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x4c25b5[_0x8124('0x31')][_0x8124('0x35')]));_0x52a361[_0x8124('0x34')]=_0x52a361[_0x8124('0x34')][_0x8124('0x36')]?_0x52a361['attributes']:_0x355796[_0x8124('0x2f')];if(!_0x4c25b5[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x52a361[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x4c25b5[_0x8124('0x31')][_0x8124('0x1f')]);_0x52a361[_0x8124('0x1e')]=qs['offset'](_0x4c25b5['query']['offset']);}_0x52a361[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x4c25b5['query'][_0x8124('0x39')]);_0x52a361[_0x8124('0x3a')]=qs['filters'](_[_0x8124('0x55')](_0x4c25b5[_0x8124('0x31')],_0x355796[_0x8124('0x32')]));_0x52a361[_0x8124('0x3a')][_0x8124('0x56')]=_0x200c6c['id'];if(_0x4c25b5['query']['filter']){_0x52a361[_0x8124('0x3a')]=_[_0x8124('0x3c')](_0x52a361['where'],{'$or':_[_0x8124('0x3d')](_0x52a361['attributes'],function(_0x4fd232){var _0x3d2df9={};_0x3d2df9[_0x4fd232]={'$like':'%'+_0x4c25b5[_0x8124('0x31')][_0x8124('0x3b')]+'%'};return _0x3d2df9;})});}_0x52a361=_['merge']({},_0x52a361,_0x4c25b5['options']);return db[_0x8124('0x57')][_0x8124('0x58')](_0x52a361);}})['then'](function(_0x401537){if(_0x401537){return db[_0x8124('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x401537,_0x8124('0x5a')),'role':'agent'},'attributes':['id',_0x8124('0x2c'),_0x8124('0x5b'),_0x8124('0x5c'),_0x8124('0x5d')]});}})[_0x8124('0x26')](function(_0x1e55a9){if(_0x1e55a9){return{'count':_0x1e55a9[_0x8124('0x41')],'rows':_[_0x8124('0x3d')](_0x1e55a9[_0x8124('0x5e')],function(_0x652afb){return{'membername':_0x652afb[_0x8124('0x2c')],'UserId':_0x652afb['id'],'queue_name':_0x15672c[_0x8124('0x2c')],'MailQueueId':_0x15672c['id'],'interface':util[_0x8124('0x5f')](_0x8124('0x60'),_0x8124('0x61'),_0x652afb[_0x8124('0x2c')]),'penalty':0x0,'paused':_0x652afb[_0x8124('0x5b')],'createdAt':_0x652afb[_0x8124('0x5d')],'updatedAt':_0x652afb[_0x8124('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8124('0x26')](respondWithFilteredResult(_0xfb4a12,_0x52a361))[_0x8124('0x43')](handleError(_0xfb4a12,null));};exports[_0x8124('0x62')]=function(_0x2b6068,_0x574f12,_0x335aff){var _0x4146ff={};var _0x3c330c={};var _0x5bf56b;var _0x3a114b;return db[_0x8124('0x2d')][_0x8124('0x63')]({'where':{'id':_0x2b6068['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x574f12,null))['then'](function(_0x3229eb){if(_0x3229eb){_0x5bf56b=_0x3229eb;_0x3c330c[_0x8124('0x2f')]=_[_0x8124('0x30')](db[_0x8124('0x64')][_0x8124('0x2e')]);_0x3c330c[_0x8124('0x31')]=_[_0x8124('0x30')](_0x2b6068['query']);_0x3c330c[_0x8124('0x32')]=_[_0x8124('0x33')](_0x3c330c[_0x8124('0x2f')],_0x3c330c[_0x8124('0x31')]);_0x4146ff['attributes']=_[_0x8124('0x33')](_0x3c330c[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x2b6068[_0x8124('0x31')][_0x8124('0x35')]));_0x4146ff['attributes']=_0x4146ff[_0x8124('0x34')][_0x8124('0x36')]?_0x4146ff[_0x8124('0x34')]:_0x3c330c[_0x8124('0x2f')];_0x4146ff[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x2b6068['query'][_0x8124('0x39')]);_0x4146ff['where']=qs['filters'](_[_0x8124('0x55')](_0x2b6068[_0x8124('0x31')],_0x3c330c['filters']));if(_0x2b6068[_0x8124('0x31')][_0x8124('0x3b')]){_0x4146ff[_0x8124('0x3a')]=_['merge'](_0x4146ff['where'],{'$or':_[_0x8124('0x3d')](_0x4146ff[_0x8124('0x34')],function(_0x1fe4db){var _0x306dc1={};_0x306dc1[_0x1fe4db]={'$like':'%'+_0x2b6068[_0x8124('0x31')][_0x8124('0x3b')]+'%'};return _0x306dc1;})});}_0x4146ff=_[_0x8124('0x3c')]({},_0x4146ff,_0x2b6068[_0x8124('0x40')]);return _0x5bf56b['getTeams'](_0x4146ff);}})[_0x8124('0x26')](function(_0x4ca50a){if(_0x4ca50a){_0x3a114b=_0x4ca50a[_0x8124('0x36')];if(!_0x2b6068['query'][_0x8124('0x37')](_0x8124('0x38'))){_0x4146ff[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x2b6068[_0x8124('0x31')][_0x8124('0x1f')]);_0x4146ff[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0x2b6068[_0x8124('0x31')]['offset']);}return _0x5bf56b[_0x8124('0x62')](_0x4146ff);}})[_0x8124('0x26')](function(_0x4a7370){if(_0x4a7370){return _0x4a7370?{'count':_0x3a114b,'rows':_0x4a7370}:null;}})[_0x8124('0x26')](respondWithResult(_0x574f12,null))[_0x8124('0x43')](handleError(_0x574f12,null));};exports['addTeams']=function(_0x568273,_0xcf93e3,_0x382d03){var _0x1e9af5=_0x568273[_0x8124('0x51')]['teams'];return db[_0x8124('0x64')][_0x8124('0x58')]({'where':{'id':_[_0x8124('0x3d')](_0x1e9af5,'id')},'attributes':['id'],'include':[{'model':db[_0x8124('0x59')],'as':_0x8124('0x65'),'attributes':['id',_0x8124('0x2c'),_0x8124('0x66'),'voicePause',_0x8124('0x67')],'raw':!![]}]})['then'](function(_0x4b3962){if(_0x4b3962){var _0xeef4f0=_[_0x8124('0x68')](_0x4b3962,function(_0x453da2){var _0x251588=_0x453da2[_0x8124('0x27')]({'plain':!![]});return _0x251588[_0x8124('0x65')];});return db['MailQueue'][_0x8124('0x47')]({'where':{'id':_0x568273[_0x8124('0x45')]['id']}})[_0x8124('0x26')](function(_0x5e3c20){return db['sequelize'][_0x8124('0x69')](function(_0x562e67){return _0x5e3c20[_0x8124('0x6a')](_[_0x8124('0x3d')](_0x1e9af5,'id'),{'transaction':_0x562e67})[_0x8124('0x26')](function(){return BPromise[_0x8124('0x6b')](_0xeef4f0,function(_0x4ad129){return db[_0x8124('0x57')][_0x8124('0x6c')]({'where':{'UserId':_0x4ad129['id'],'MailQueueId':_0x568273[_0x8124('0x45')]['id']},'transaction':_0x562e67});});})[_0x8124('0x26')](function(){_0xeef4f0[_0x8124('0x6d')](function(_0x5246e1){socket[_0x8124('0x6e')](_0x8124('0x6f'),{'UserId':_0x5246e1['id'],'MailQueueId':_0x5e3c20['id']});});});});});}})[_0x8124('0x26')](respondWithStatusCode(_0xcf93e3,null))[_0x8124('0x43')](handleError(_0xcf93e3,null));};exports[_0x8124('0x70')]=function(_0x1ca19f,_0x505194,_0xf995c9){return db[_0x8124('0x64')][_0x8124('0x58')]({'where':{'id':_0x1ca19f[_0x8124('0x31')][_0x8124('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8124('0x59')],'as':_0x8124('0x65'),'attributes':['id'],'raw':!![]}]})[_0x8124('0x26')](handleEntityNotFound(_0x505194,null))[_0x8124('0x26')](function(_0x50fcbf){var _0x2009e7=_[_0x8124('0x3d')](_0x50fcbf,'id');var _0x1ca7bc=[];var _0x35d385=[];var _0x7d8160=squel[_0x8124('0x72')]();_0x7d8160['field'](_0x8124('0x73'))[_0x8124('0x74')]('team_has_mail_queues','tq')[_0x8124('0x75')]('user_has_teams','ut',_0x8124('0x76'))[_0x8124('0x3a')](_0x8124('0x77'),_0x1ca19f['params']['id']);for(var _0x30fa79=0x0;_0x30fa79<_0x50fcbf[_0x8124('0x36')];_0x30fa79+=0x1){let _0x539d51=_0x50fcbf[_0x30fa79];for(var _0x582fe3=0x0;_0x582fe3<_0x539d51['Agents'][_0x8124('0x36')];_0x582fe3+=0x1){let _0x416f34=_0x539d51[_0x8124('0x65')][_0x582fe3];var _0x27525b=_0x7d8160['clone']();_0x27525b[_0x8124('0x3a')](_0x8124('0x78'),_0x416f34['id']);_0x35d385[_0x8124('0x79')](db['sequelize'][_0x8124('0x31')](_0x27525b['toString'](),{'type':db['sequelize'][_0x8124('0x7a')][_0x8124('0x7b')]})[_0x8124('0x26')](function(_0x282995){if(_0x282995[_0x8124('0x36')]===0x1){return _0x416f34['id'];}else{var _0x23c4f6=_[_0x8124('0x7c')](_[_0x8124('0x3d')](_0x282995,'TeamId'),function(_0x51b52b){return _[_0x8124('0x7d')](_0x2009e7,_0x51b52b);});if(_0x23c4f6){return _0x416f34['id'];}}}));}}return BPromise[_0x8124('0x7e')](_0x35d385)[_0x8124('0x26')](function(_0x4d7e43){_0x1ca7bc=_(_0x1ca7bc)[_0x8124('0x7f')](_0x4d7e43)[_0x8124('0x80')]()[_0x8124('0x81')]();return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x1ca19f[_0x8124('0x45')]['id']}})[_0x8124('0x26')](function(_0x2a1e6a){return db['sequelize']['transaction'](function(_0x45ffe7){return _0x2a1e6a[_0x8124('0x70')](_0x1ca19f['query'][_0x8124('0x71')],{'transaction':_0x45ffe7})[_0x8124('0x26')](function(){if(!_[_0x8124('0x82')](_0x1ca7bc)){return _0x2a1e6a[_0x8124('0x83')](_0x1ca7bc,{'transaction':_0x45ffe7});}})['then'](function(){_0x1ca7bc[_0x8124('0x6d')](function(_0x2c4e92){socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':_0x2c4e92,'MailQueueId':_0x2a1e6a['id']});});});});});});})[_0x8124('0x26')](respondWithStatusCode(_0x505194,null))[_0x8124('0x43')](handleError(_0x505194,null));};exports[_0x8124('0x85')]=function(_0x143ca0,_0x3f0fa9,_0x1c498d){return db[_0x8124('0x2d')]['find']({'where':{'id':_0x143ca0['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x3f0fa9,null))[_0x8124('0x26')](function(_0x62a90c){if(_0x62a90c){return _0x62a90c['addAgents'](_0x143ca0['body'][_0x8124('0x71')],_[_0x8124('0x86')](_0x143ca0[_0x8124('0x51')],[_0x8124('0x71'),'id'])||{})['spread'](function(_0x4434b6){for(var _0x571f12=0x0;_0x571f12<_0x143ca0[_0x8124('0x51')][_0x8124('0x71')][_0x8124('0x36')];_0x571f12+=0x1){socket[_0x8124('0x6e')]('userMailQueue:save',{'UserId':_0x143ca0[_0x8124('0x51')][_0x8124('0x71')][_0x571f12],'MailQueueId':_0x143ca0[_0x8124('0x45')]['id']});}return _0x4434b6;});}})['then'](respondWithResult(_0x3f0fa9,null))[_0x8124('0x43')](handleError(_0x3f0fa9,null));};exports[_0x8124('0x83')]=function(_0x419edd,_0x226790,_0x137e64){return db['MailQueue'][_0x8124('0x47')]({'where':{'id':_0x419edd[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x226790,null))['then'](function(_0x51c369){if(_0x51c369){return _0x51c369[_0x8124('0x83')](_0x419edd['query'][_0x8124('0x71')])[_0x8124('0x26')](function(){if(_[_0x8124('0x87')](_0x419edd[_0x8124('0x31')]['ids'])){for(var _0x245f9d=0x0;_0x245f9d<_0x419edd[_0x8124('0x31')][_0x8124('0x71')][_0x8124('0x36')];_0x245f9d+=0x1){socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':Number(_0x419edd['query']['ids'][_0x245f9d]),'MailQueueId':Number(_0x419edd[_0x8124('0x45')]['id'])});}}else{socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':Number(_0x419edd['query']['ids']),'MailQueueId':Number(_0x419edd[_0x8124('0x45')]['id'])});}});}})[_0x8124('0x26')](respondWithStatusCode(_0x226790,null))[_0x8124('0x43')](handleError(_0x226790,null));};exports[_0x8124('0x88')]=function(_0x296977,_0x33f4ca,_0x273cd7){var _0x5dd50f={};var _0x18ffe6={};var _0x150a75;var _0x413a2d;return db[_0x8124('0x2d')][_0x8124('0x63')]({'where':{'id':_0x296977[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x33f4ca,null))[_0x8124('0x26')](function(_0x478565){if(_0x478565){_0x150a75=_0x478565;_0x18ffe6['model']=_[_0x8124('0x30')](db[_0x8124('0x59')][_0x8124('0x2e')]);_0x18ffe6[_0x8124('0x31')]=_[_0x8124('0x30')](_0x296977['query']);_0x18ffe6[_0x8124('0x32')]=_[_0x8124('0x33')](_0x18ffe6['model'],_0x18ffe6[_0x8124('0x31')]);_0x5dd50f[_0x8124('0x34')]=_[_0x8124('0x33')](_0x18ffe6[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x296977[_0x8124('0x31')][_0x8124('0x35')]));_0x5dd50f['attributes']=_0x5dd50f[_0x8124('0x34')][_0x8124('0x36')]?_0x5dd50f[_0x8124('0x34')]:_0x18ffe6[_0x8124('0x2f')];_0x5dd50f[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x296977[_0x8124('0x31')][_0x8124('0x39')]);_0x5dd50f['where']=qs['filters'](_[_0x8124('0x55')](_0x296977['query'],_0x18ffe6[_0x8124('0x32')]));if(_0x296977[_0x8124('0x31')][_0x8124('0x3b')]){_0x5dd50f[_0x8124('0x3a')]=_[_0x8124('0x3c')](_0x5dd50f[_0x8124('0x3a')],{'$or':_[_0x8124('0x3d')](_0x5dd50f[_0x8124('0x34')],function(_0x436763){var _0x1521bc={};_0x1521bc[_0x436763]={'$like':'%'+_0x296977['query'][_0x8124('0x3b')]+'%'};return _0x1521bc;})});}_0x5dd50f=_[_0x8124('0x3c')]({},_0x5dd50f,_0x296977['options']);return _0x150a75[_0x8124('0x88')](_0x5dd50f);}})[_0x8124('0x26')](function(_0x2e29f2){if(_0x2e29f2){_0x413a2d=_0x2e29f2['length'];if(!_0x296977[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x5dd50f[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x296977[_0x8124('0x31')]['limit']);_0x5dd50f[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0x296977[_0x8124('0x31')][_0x8124('0x1e')]);}return _0x150a75[_0x8124('0x88')](_0x5dd50f);}})[_0x8124('0x26')](function(_0x332a64){if(_0x332a64){return _0x332a64?{'count':_0x413a2d,'rows':_0x332a64}:null;}})[_0x8124('0x26')](respondWithResult(_0x33f4ca,null))['catch'](handleError(_0x33f4ca,null));}; \ No newline at end of file +var _0x3f18=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserMailQueue','order','MailQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','SIP','mailPause','getTeams','Team','nolimit','teams','User','Agents','online','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','removeAgents','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','./mailQueue.socket','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','type','field','options','includeAll','findAll','rows','catch','params'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x3f18,0x1ce));var _0x83f1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3f18[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x83f1('0x0'));var rimraf=require(_0x83f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83f1('0x2'));var rp=require('request-promise');var moment=require(_0x83f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x83f1('0x4'));var util=require(_0x83f1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x83f1('0x6'));var ejs=require(_0x83f1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x83f1('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x83f1('0x9'));var Papa=require(_0x83f1('0xa'));var Redis=require(_0x83f1('0xb'));var authService=require(_0x83f1('0xc'));var qs=require(_0x83f1('0xd'));var hardwareService=require(_0x83f1('0xe'));var logger=require('../../config/logger')(_0x83f1('0xf'));var utils=require('../../config/utils');var config=require(_0x83f1('0x10'));var db=require(_0x83f1('0x11'))['db'];config[_0x83f1('0x12')]=_['defaults'](config[_0x83f1('0x12')],{'host':_0x83f1('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83f1('0x12')]));require(_0x83f1('0x14'))['register'](socket);function respondWithStatusCode(_0x38f2f6,_0x1cdad8){_0x1cdad8=_0x1cdad8||0xcc;return function(_0x2549a2){if(_0x2549a2){return _0x38f2f6[_0x83f1('0x15')](_0x1cdad8);}return _0x38f2f6[_0x83f1('0x16')](_0x1cdad8)[_0x83f1('0x17')]();};}function respondWithResult(_0x130912,_0x326e89){_0x326e89=_0x326e89||0xc8;return function(_0x434ab3){if(_0x434ab3){return _0x130912[_0x83f1('0x16')](_0x326e89)[_0x83f1('0x18')](_0x434ab3);}};}function respondWithFilteredResult(_0x424508,_0x51b685){return function(_0x25c694){if(_0x25c694){var _0x49e78d=_0x25c694[_0x83f1('0x19')],_0x99ef16=_0x51b685[_0x83f1('0x1a')],_0x30e876=_0x51b685[_0x83f1('0x1a')]+_0x51b685[_0x83f1('0x1b')],_0xafa1f9;if(_0x30e876>=_0x49e78d){_0x30e876=_0x49e78d;_0xafa1f9=0xc8;}else{_0xafa1f9=0xce;}_0x424508[_0x83f1('0x16')](_0xafa1f9);return _0x424508[_0x83f1('0x1c')]('Content-Range',_0x99ef16+'-'+_0x30e876+'/'+_0x49e78d)[_0x83f1('0x18')](_0x25c694);}return null;};}function patchUpdates(_0x4ce7f4){return function(_0x322344){try{jsonpatch[_0x83f1('0x1d')](_0x322344,_0x4ce7f4,!![]);}catch(_0x4adb6e){return BPromise[_0x83f1('0x1e')](_0x4adb6e);}return _0x322344[_0x83f1('0x1f')]();};}function saveUpdates(_0x1d1b69,_0x2059c5){return function(_0x4d804b){if(_0x4d804b){return _0x4d804b['update'](_0x1d1b69)[_0x83f1('0x20')](function(_0x2934b2){return _0x2934b2;});}return null;};}function removeEntity(_0x1887e8,_0x78c6e2){return function(_0x4eacd5){if(_0x4eacd5){return _0x4eacd5[_0x83f1('0x21')]()[_0x83f1('0x20')](function(){var _0x288525=_0x4eacd5[_0x83f1('0x22')]({'plain':!![]});var _0x205624=_0x83f1('0x23');return db[_0x83f1('0x24')][_0x83f1('0x21')]({'where':{'type':_0x205624,'resourceId':_0x288525['id']}})[_0x83f1('0x20')](function(){return _0x4eacd5;});})['then'](function(){_0x1887e8[_0x83f1('0x16')](0xcc)[_0x83f1('0x17')]();});}};}function handleEntityNotFound(_0x3282be,_0x345d65){return function(_0x2b8367){if(!_0x2b8367){_0x3282be[_0x83f1('0x15')](0x194);}return _0x2b8367;};}function handleError(_0x9f6af7,_0x268dc8){_0x268dc8=_0x268dc8||0x1f4;return function(_0x30622d){logger[_0x83f1('0x25')](_0x30622d[_0x83f1('0x26')]);if(_0x30622d[_0x83f1('0x27')]){delete _0x30622d['name'];}_0x9f6af7[_0x83f1('0x16')](_0x268dc8)[_0x83f1('0x28')](_0x30622d);};}exports[_0x83f1('0x29')]=function(_0x307c96,_0x5c32a9){var _0x164e1e={},_0x1584d4={},_0x34933a={'count':0x0,'rows':[]};var _0x2435e9=db[_0x83f1('0x2a')][_0x83f1('0x2b')];_0x1584d4[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](_0x2435e9);_0x1584d4['query']=_['keys'](_0x307c96[_0x83f1('0x2e')]);_0x1584d4[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x1584d4[_0x83f1('0x2c')],_0x1584d4[_0x83f1('0x2e')]);_0x164e1e[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x1584d4[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x32')]));_0x164e1e[_0x83f1('0x31')]=_0x164e1e[_0x83f1('0x31')][_0x83f1('0x33')]?_0x164e1e[_0x83f1('0x31')]:_0x1584d4[_0x83f1('0x2c')];if(!_0x307c96['query'][_0x83f1('0x34')]('nolimit')){_0x164e1e['limit']=qs[_0x83f1('0x1b')](_0x307c96['query'][_0x83f1('0x1b')]);_0x164e1e[_0x83f1('0x1a')]=qs['offset'](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x1a')]);}_0x164e1e['order']=qs['sort'](_0x307c96[_0x83f1('0x2e')][_0x83f1('0x35')]);_0x164e1e[_0x83f1('0x36')]=qs['filters'](_[_0x83f1('0x37')](_0x307c96[_0x83f1('0x2e')],_0x1584d4['filters']));if(_0x307c96[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x164e1e[_0x83f1('0x36')]=_['merge'](_0x164e1e[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x2435e9,function(_0x2e789f){if(_0x2e789f[_0x83f1('0x3a')]['key']!=='VIRTUAL'){var _0xb38aec={};_0xb38aec[_0x2e789f[_0x83f1('0x3b')]]={'$like':'%'+_0x307c96[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0xb38aec;}})});}_0x164e1e=_['merge']({},_0x164e1e,_0x307c96[_0x83f1('0x3c')]);var _0x5ccdce={'where':_0x164e1e['where']};return db[_0x83f1('0x2a')][_0x83f1('0x19')](_0x5ccdce)['then'](function(_0x388afd){_0x34933a[_0x83f1('0x19')]=_0x388afd;if(_0x307c96[_0x83f1('0x2e')][_0x83f1('0x3d')]){_0x164e1e['include']=[{'all':!![]}];}return db[_0x83f1('0x2a')][_0x83f1('0x3e')](_0x164e1e);})['then'](function(_0x2af01a){_0x34933a[_0x83f1('0x3f')]=_0x2af01a;return _0x34933a;})['then'](respondWithFilteredResult(_0x5c32a9,_0x164e1e))[_0x83f1('0x40')](handleError(_0x5c32a9,null));};exports['show']=function(_0x1980e5,_0x21b1ea){var _0xa4c099={'raw':!![],'where':{'id':_0x1980e5[_0x83f1('0x41')]['id']}},_0x2acaa3={};_0x2acaa3[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db['MailQueue']['rawAttributes']);_0x2acaa3[_0x83f1('0x2e')]=_[_0x83f1('0x2d')](_0x1980e5[_0x83f1('0x2e')]);_0x2acaa3[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x2acaa3[_0x83f1('0x2c')],_0x2acaa3[_0x83f1('0x2e')]);_0xa4c099[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x2acaa3[_0x83f1('0x2c')],qs[_0x83f1('0x32')](_0x1980e5[_0x83f1('0x2e')][_0x83f1('0x32')]));_0xa4c099[_0x83f1('0x31')]=_0xa4c099['attributes'][_0x83f1('0x33')]?_0xa4c099['attributes']:_0x2acaa3['model'];if(_0x1980e5[_0x83f1('0x2e')][_0x83f1('0x3d')]){_0xa4c099['include']=[{'all':!![]}];}_0xa4c099=_[_0x83f1('0x42')]({},_0xa4c099,_0x1980e5['options']);return db[_0x83f1('0x2a')][_0x83f1('0x43')](_0xa4c099)[_0x83f1('0x20')](handleEntityNotFound(_0x21b1ea,null))[_0x83f1('0x20')](respondWithResult(_0x21b1ea,null))[_0x83f1('0x40')](handleError(_0x21b1ea,null));};exports[_0x83f1('0x44')]=function(_0x434724,_0x29513a){return db[_0x83f1('0x2a')][_0x83f1('0x44')](_0x434724['body'],{})[_0x83f1('0x20')](function(_0x1b3b37){var _0x4c37cb=_0x434724['user'][_0x83f1('0x22')]({'plain':!![]});if(!_0x4c37cb)throw new Error(_0x83f1('0x45'));if(_0x4c37cb[_0x83f1('0x46')]===_0x83f1('0x47')){var _0xcc4790=_0x1b3b37[_0x83f1('0x22')]({'plain':!![]});var _0x221b37=_0x83f1('0x23');return db['UserProfileSection'][_0x83f1('0x43')]({'where':{'name':_0x221b37,'userProfileId':_0x4c37cb[_0x83f1('0x48')]},'raw':!![]})[_0x83f1('0x20')](function(_0x45ad2c){if(_0x45ad2c&&_0x45ad2c[_0x83f1('0x49')]===0x0){return db[_0x83f1('0x24')][_0x83f1('0x44')]({'name':_0xcc4790['name'],'resourceId':_0xcc4790['id'],'type':_0x45ad2c[_0x83f1('0x27')],'sectionId':_0x45ad2c['id']},{})[_0x83f1('0x20')](function(){return _0x1b3b37;});}else{return _0x1b3b37;}})[_0x83f1('0x40')](function(_0x3d9387){logger[_0x83f1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d9387);throw _0x3d9387;});}return _0x1b3b37;})[_0x83f1('0x20')](respondWithResult(_0x29513a,0xc9))[_0x83f1('0x40')](handleError(_0x29513a,null));};exports[_0x83f1('0x4a')]=function(_0x5e27f0,_0x576262){if(_0x5e27f0[_0x83f1('0x4b')]['id']){delete _0x5e27f0['body']['id'];}return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x5e27f0[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x576262,null))['then'](saveUpdates(_0x5e27f0[_0x83f1('0x4b')],null))['then'](respondWithResult(_0x576262,null))[_0x83f1('0x40')](handleError(_0x576262,null));};exports[_0x83f1('0x21')]=function(_0x15bdaa,_0x101a24){return db[_0x83f1('0x2a')]['find']({'where':{'id':_0x15bdaa['params']['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x101a24,null))[_0x83f1('0x20')](removeEntity(_0x101a24,null))['catch'](handleError(_0x101a24,null));};exports[_0x83f1('0x4c')]=function(_0x18ab06,_0x3ef104){return db[_0x83f1('0x2a')][_0x83f1('0x4c')]()[_0x83f1('0x20')](respondWithResult(_0x3ef104,null))[_0x83f1('0x40')](handleError(_0x3ef104,null));};exports[_0x83f1('0x4d')]=function(_0x4b7e7e,_0x2bd284,_0x23275d){var _0x2c0aab={'raw':!![],'where':{}},_0x18adb5={},_0x3dea86;return db[_0x83f1('0x2a')][_0x83f1('0x4e')]({'where':{'id':_0x4b7e7e['params']['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x2bd284,null))[_0x83f1('0x20')](function(_0x1058fa){if(_0x1058fa){_0x3dea86=_0x1058fa[_0x83f1('0x22')]({'plain':!![]});_0x18adb5[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db[_0x83f1('0x4f')][_0x83f1('0x2b')]);_0x18adb5[_0x83f1('0x2e')]=_['keys'](_0x4b7e7e[_0x83f1('0x2e')]);_0x18adb5[_0x83f1('0x2f')]=_[_0x83f1('0x30')](_0x18adb5['model'],_0x18adb5['query']);_0x2c0aab[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x18adb5['model'],qs['fields'](_0x4b7e7e['query']['fields']));_0x2c0aab[_0x83f1('0x31')]=_0x2c0aab[_0x83f1('0x31')][_0x83f1('0x33')]?_0x2c0aab[_0x83f1('0x31')]:_0x18adb5[_0x83f1('0x2c')];if(!_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x34')]('nolimit')){_0x2c0aab['limit']=qs[_0x83f1('0x1b')](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x1b')]);_0x2c0aab[_0x83f1('0x1a')]=qs['offset'](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x1a')]);}_0x2c0aab[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x35')]);_0x2c0aab[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_[_0x83f1('0x37')](_0x4b7e7e[_0x83f1('0x2e')],_0x18adb5[_0x83f1('0x2f')]));_0x2c0aab[_0x83f1('0x36')][_0x83f1('0x51')]=_0x1058fa['id'];if(_0x4b7e7e[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x2c0aab['where']=_[_0x83f1('0x42')](_0x2c0aab[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x2c0aab[_0x83f1('0x31')],function(_0x54115a){var _0x122864={};_0x122864[_0x54115a]={'$like':'%'+_0x4b7e7e['query'][_0x83f1('0x38')]+'%'};return _0x122864;})});}_0x2c0aab=_[_0x83f1('0x42')]({},_0x2c0aab,_0x4b7e7e['options']);return db[_0x83f1('0x4f')][_0x83f1('0x3e')](_0x2c0aab);}})['then'](function(_0x52fb41){if(_0x52fb41){return db['User'][_0x83f1('0x52')]({'where':{'id':_['map'](_0x52fb41,_0x83f1('0x53')),'role':'agent'},'attributes':['id',_0x83f1('0x27'),'mailPause',_0x83f1('0x54'),_0x83f1('0x55')]});}})[_0x83f1('0x20')](function(_0x50e4c3){if(_0x50e4c3){return{'count':_0x50e4c3[_0x83f1('0x19')],'rows':_[_0x83f1('0x39')](_0x50e4c3[_0x83f1('0x3f')],function(_0x51e1e4){return{'membername':_0x51e1e4[_0x83f1('0x27')],'UserId':_0x51e1e4['id'],'queue_name':_0x3dea86['name'],'MailQueueId':_0x3dea86['id'],'interface':util[_0x83f1('0x56')]('%s/%s',_0x83f1('0x57'),_0x51e1e4[_0x83f1('0x27')]),'penalty':0x0,'paused':_0x51e1e4[_0x83f1('0x58')],'createdAt':_0x51e1e4['createdAt'],'updatedAt':_0x51e1e4[_0x83f1('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x83f1('0x20')](respondWithFilteredResult(_0x2bd284,_0x2c0aab))[_0x83f1('0x40')](handleError(_0x2bd284,null));};exports[_0x83f1('0x59')]=function(_0x259937,_0x46365b,_0x392e96){var _0x338d91={};var _0x1306fd={};var _0x3d5c2c;var _0x51ac39;return db[_0x83f1('0x2a')]['findOne']({'where':{'id':_0x259937[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x46365b,null))[_0x83f1('0x20')](function(_0x29ed31){if(_0x29ed31){_0x3d5c2c=_0x29ed31;_0x1306fd['model']=_[_0x83f1('0x2d')](db[_0x83f1('0x5a')]['rawAttributes']);_0x1306fd[_0x83f1('0x2e')]=_['keys'](_0x259937[_0x83f1('0x2e')]);_0x1306fd['filters']=_[_0x83f1('0x30')](_0x1306fd[_0x83f1('0x2c')],_0x1306fd[_0x83f1('0x2e')]);_0x338d91[_0x83f1('0x31')]=_[_0x83f1('0x30')](_0x1306fd[_0x83f1('0x2c')],qs['fields'](_0x259937[_0x83f1('0x2e')]['fields']));_0x338d91[_0x83f1('0x31')]=_0x338d91[_0x83f1('0x31')][_0x83f1('0x33')]?_0x338d91[_0x83f1('0x31')]:_0x1306fd[_0x83f1('0x2c')];_0x338d91[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x259937[_0x83f1('0x2e')]['sort']);_0x338d91[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_['pick'](_0x259937['query'],_0x1306fd[_0x83f1('0x2f')]));if(_0x259937[_0x83f1('0x2e')][_0x83f1('0x38')]){_0x338d91[_0x83f1('0x36')]=_[_0x83f1('0x42')](_0x338d91[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x338d91[_0x83f1('0x31')],function(_0xf27326){var _0x1e44d9={};_0x1e44d9[_0xf27326]={'$like':'%'+_0x259937[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0x1e44d9;})});}_0x338d91=_[_0x83f1('0x42')]({},_0x338d91,_0x259937[_0x83f1('0x3c')]);return _0x3d5c2c[_0x83f1('0x59')](_0x338d91);}})['then'](function(_0x40245f){if(_0x40245f){_0x51ac39=_0x40245f[_0x83f1('0x33')];if(!_0x259937[_0x83f1('0x2e')]['hasOwnProperty'](_0x83f1('0x5b'))){_0x338d91[_0x83f1('0x1b')]=qs[_0x83f1('0x1b')](_0x259937[_0x83f1('0x2e')][_0x83f1('0x1b')]);_0x338d91[_0x83f1('0x1a')]=qs[_0x83f1('0x1a')](_0x259937[_0x83f1('0x2e')]['offset']);}return _0x3d5c2c['getTeams'](_0x338d91);}})[_0x83f1('0x20')](function(_0x3bc7fe){if(_0x3bc7fe){return _0x3bc7fe?{'count':_0x51ac39,'rows':_0x3bc7fe}:null;}})[_0x83f1('0x20')](respondWithResult(_0x46365b,null))[_0x83f1('0x40')](handleError(_0x46365b,null));};exports['addTeams']=function(_0xbcb5de,_0x42deca,_0x13a35d){var _0x43f5f9=_0xbcb5de[_0x83f1('0x4b')][_0x83f1('0x5c')];return db['Team']['findAll']({'where':{'id':_[_0x83f1('0x39')](_0x43f5f9,'id')},'attributes':['id'],'include':[{'model':db[_0x83f1('0x5d')],'as':_0x83f1('0x5e'),'attributes':['id','name',_0x83f1('0x5f'),_0x83f1('0x60'),_0x83f1('0x61')],'raw':!![]}]})[_0x83f1('0x20')](function(_0x698194){if(_0x698194){var _0x44e2ca=_[_0x83f1('0x62')](_0x698194,function(_0x12b9e3){var _0x54fd0a=_0x12b9e3[_0x83f1('0x22')]({'plain':!![]});return _0x54fd0a['Agents'];});return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0xbcb5de[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](function(_0x39a23d){return db['sequelize'][_0x83f1('0x63')](function(_0x49a1b6){return _0x39a23d[_0x83f1('0x64')](_[_0x83f1('0x39')](_0x43f5f9,'id'),{'transaction':_0x49a1b6})[_0x83f1('0x20')](function(){return BPromise['each'](_0x44e2ca,function(_0x3bd45c){return db['UserMailQueue'][_0x83f1('0x65')]({'where':{'UserId':_0x3bd45c['id'],'MailQueueId':_0xbcb5de['params']['id']},'transaction':_0x49a1b6});});})[_0x83f1('0x20')](function(){_0x44e2ca[_0x83f1('0x66')](function(_0x3df369){socket[_0x83f1('0x67')]('userMailQueue:save',{'UserId':_0x3df369['id'],'MailQueueId':_0x39a23d['id']});});});});});}})[_0x83f1('0x20')](respondWithStatusCode(_0x42deca,null))[_0x83f1('0x40')](handleError(_0x42deca,null));};exports[_0x83f1('0x68')]=function(_0x16be03,_0x30f517,_0xf81e54){return db[_0x83f1('0x5a')][_0x83f1('0x3e')]({'where':{'id':_0x16be03[_0x83f1('0x2e')][_0x83f1('0x69')]},'attributes':['id'],'include':[{'model':db[_0x83f1('0x5d')],'as':_0x83f1('0x5e'),'attributes':['id'],'raw':!![]}]})[_0x83f1('0x20')](handleEntityNotFound(_0x30f517,null))['then'](function(_0x2e25bf){var _0x1a8d5f=_[_0x83f1('0x39')](_0x2e25bf,'id');var _0x262dc2=[];var _0x4be267=[];var _0x71005=squel[_0x83f1('0x6a')]();_0x71005[_0x83f1('0x3b')](_0x83f1('0x6b'))[_0x83f1('0x6c')](_0x83f1('0x6d'),'tq')[_0x83f1('0x6e')](_0x83f1('0x6f'),'ut',_0x83f1('0x70'))[_0x83f1('0x36')](_0x83f1('0x71'),_0x16be03[_0x83f1('0x41')]['id']);for(var _0x151c6b=0x0;_0x151c6b<_0x2e25bf[_0x83f1('0x33')];_0x151c6b+=0x1){let _0x27915c=_0x2e25bf[_0x151c6b];for(var _0x3ea279=0x0;_0x3ea279<_0x27915c[_0x83f1('0x5e')][_0x83f1('0x33')];_0x3ea279+=0x1){let _0x352394=_0x27915c[_0x83f1('0x5e')][_0x3ea279];var _0x4e4b24=_0x71005[_0x83f1('0x72')]();_0x4e4b24['where'](_0x83f1('0x73'),_0x352394['id']);_0x4be267[_0x83f1('0x74')](db[_0x83f1('0x75')][_0x83f1('0x2e')](_0x4e4b24[_0x83f1('0x76')](),{'type':db[_0x83f1('0x75')][_0x83f1('0x77')][_0x83f1('0x78')]})['then'](function(_0x13ee43){if(_0x13ee43['length']===0x1){return _0x352394['id'];}else{var _0x509339=_[_0x83f1('0x79')](_[_0x83f1('0x39')](_0x13ee43,_0x83f1('0x7a')),function(_0x3a00be){return _['includes'](_0x1a8d5f,_0x3a00be);});if(_0x509339){return _0x352394['id'];}}}));}}return BPromise[_0x83f1('0x7b')](_0x4be267)[_0x83f1('0x20')](function(_0x5c9f1d){_0x262dc2=_(_0x262dc2)[_0x83f1('0x7c')](_0x5c9f1d)['compact']()['value']();return db['MailQueue'][_0x83f1('0x43')]({'where':{'id':_0x16be03['params']['id']}})[_0x83f1('0x20')](function(_0x2e572d){return db[_0x83f1('0x75')]['transaction'](function(_0x41687b){return _0x2e572d[_0x83f1('0x68')](_0x16be03[_0x83f1('0x2e')][_0x83f1('0x69')],{'transaction':_0x41687b})['then'](function(){if(!_['isEmpty'](_0x262dc2)){return _0x2e572d[_0x83f1('0x7d')](_0x262dc2,{'transaction':_0x41687b});}})[_0x83f1('0x20')](function(){_0x262dc2['forEach'](function(_0x4c547c){socket[_0x83f1('0x67')](_0x83f1('0x7e'),{'UserId':_0x4c547c,'MailQueueId':_0x2e572d['id']});});});});});});})[_0x83f1('0x20')](respondWithStatusCode(_0x30f517,null))[_0x83f1('0x40')](handleError(_0x30f517,null));};exports[_0x83f1('0x7f')]=function(_0x3c63bc,_0x49b9da,_0x585dfc){return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x3c63bc[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x49b9da,null))['then'](function(_0x57a409){if(_0x57a409){return _0x57a409[_0x83f1('0x7f')](_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')],_[_0x83f1('0x80')](_0x3c63bc[_0x83f1('0x4b')],[_0x83f1('0x69'),'id'])||{})['spread'](function(_0x3ab763){for(var _0x52f554=0x0;_0x52f554<_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')]['length'];_0x52f554+=0x1){socket[_0x83f1('0x67')](_0x83f1('0x81'),{'UserId':_0x3c63bc[_0x83f1('0x4b')][_0x83f1('0x69')][_0x52f554],'MailQueueId':_0x3c63bc['params']['id']});}return _0x3ab763;});}})[_0x83f1('0x20')](respondWithResult(_0x49b9da,null))[_0x83f1('0x40')](handleError(_0x49b9da,null));};exports[_0x83f1('0x7d')]=function(_0x193037,_0x1572cb,_0x5d7363){return db[_0x83f1('0x2a')][_0x83f1('0x43')]({'where':{'id':_0x193037[_0x83f1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1572cb,null))[_0x83f1('0x20')](function(_0x56f7ef){if(_0x56f7ef){return _0x56f7ef[_0x83f1('0x7d')](_0x193037['query'][_0x83f1('0x69')])['then'](function(){if(_[_0x83f1('0x82')](_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')])){for(var _0x3758a7=0x0;_0x3758a7<_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')]['length'];_0x3758a7+=0x1){socket[_0x83f1('0x67')](_0x83f1('0x7e'),{'UserId':Number(_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')][_0x3758a7]),'MailQueueId':Number(_0x193037[_0x83f1('0x41')]['id'])});}}else{socket[_0x83f1('0x67')]('userMailQueue:remove',{'UserId':Number(_0x193037[_0x83f1('0x2e')][_0x83f1('0x69')]),'MailQueueId':Number(_0x193037['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1572cb,null))['catch'](handleError(_0x1572cb,null));};exports[_0x83f1('0x83')]=function(_0x5b324e,_0x286b92,_0x3dfce2){var _0x4960a0={};var _0x46226b={};var _0x2575a7;var _0x4c43bd;return db[_0x83f1('0x2a')][_0x83f1('0x4e')]({'where':{'id':_0x5b324e[_0x83f1('0x41')]['id']}})[_0x83f1('0x20')](handleEntityNotFound(_0x286b92,null))[_0x83f1('0x20')](function(_0x2b7751){if(_0x2b7751){_0x2575a7=_0x2b7751;_0x46226b[_0x83f1('0x2c')]=_[_0x83f1('0x2d')](db[_0x83f1('0x5d')][_0x83f1('0x2b')]);_0x46226b[_0x83f1('0x2e')]=_['keys'](_0x5b324e[_0x83f1('0x2e')]);_0x46226b[_0x83f1('0x2f')]=_['intersection'](_0x46226b[_0x83f1('0x2c')],_0x46226b[_0x83f1('0x2e')]);_0x4960a0[_0x83f1('0x31')]=_['intersection'](_0x46226b['model'],qs['fields'](_0x5b324e[_0x83f1('0x2e')]['fields']));_0x4960a0['attributes']=_0x4960a0[_0x83f1('0x31')][_0x83f1('0x33')]?_0x4960a0['attributes']:_0x46226b[_0x83f1('0x2c')];_0x4960a0[_0x83f1('0x50')]=qs[_0x83f1('0x35')](_0x5b324e['query'][_0x83f1('0x35')]);_0x4960a0[_0x83f1('0x36')]=qs[_0x83f1('0x2f')](_[_0x83f1('0x37')](_0x5b324e[_0x83f1('0x2e')],_0x46226b[_0x83f1('0x2f')]));if(_0x5b324e[_0x83f1('0x2e')]['filter']){_0x4960a0[_0x83f1('0x36')]=_[_0x83f1('0x42')](_0x4960a0[_0x83f1('0x36')],{'$or':_[_0x83f1('0x39')](_0x4960a0['attributes'],function(_0x1d7f84){var _0x9bf089={};_0x9bf089[_0x1d7f84]={'$like':'%'+_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x38')]+'%'};return _0x9bf089;})});}_0x4960a0=_['merge']({},_0x4960a0,_0x5b324e[_0x83f1('0x3c')]);return _0x2575a7[_0x83f1('0x83')](_0x4960a0);}})[_0x83f1('0x20')](function(_0x483396){if(_0x483396){_0x4c43bd=_0x483396['length'];if(!_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x34')](_0x83f1('0x5b'))){_0x4960a0[_0x83f1('0x1b')]=qs['limit'](_0x5b324e[_0x83f1('0x2e')]['limit']);_0x4960a0['offset']=qs['offset'](_0x5b324e[_0x83f1('0x2e')][_0x83f1('0x1a')]);}return _0x2575a7[_0x83f1('0x83')](_0x4960a0);}})[_0x83f1('0x20')](function(_0x3c1464){if(_0x3c1464){return _0x3c1464?{'count':_0x4c43bd,'rows':_0x3c1464}:null;}})[_0x83f1('0x20')](respondWithResult(_0x286b92,null))[_0x83f1('0x40')](handleError(_0x286b92,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d9bcab4..c1c6aeb 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 _0xe2a1=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57f458,_0x288edf){var _0x5e2e77=function(_0x521fef){while(--_0x521fef){_0x57f458['push'](_0x57f458['shift']());}};_0x5e2e77(++_0x288edf);}(_0xe2a1,0x18c));var _0x1e2a=function(_0x1e1bd8,_0x25b2f6){_0x1e1bd8=_0x1e1bd8-0x0;var _0x4c944f=_0xe2a1[_0x1e1bd8];return _0x4c944f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1e2a('0x0'))['db'][_0x1e2a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1e2a('0x2')](0x0);var events={'afterCreate':_0x1e2a('0x3'),'afterUpdate':_0x1e2a('0x4'),'afterDestroy':_0x1e2a('0x5')};function emitEvent(_0x4abef9){return function(_0x5754e4,_0x3917ea,_0x26a1d0){MailQueueEvents[_0x1e2a('0x6')](_0x4abef9+':'+_0x5754e4['id'],_0x5754e4);MailQueueEvents[_0x1e2a('0x6')](_0x4abef9,_0x5754e4);_0x26a1d0(null);};}for(var e in events){if(events[_0x1e2a('0x7')](e)){var event=events[e];MailQueue[_0x1e2a('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xcc7d=['MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x18be08,_0x1329bc){var _0x5cdf81=function(_0x5ced79){while(--_0x5ced79){_0x18be08['push'](_0x18be08['shift']());}};_0x5cdf81(++_0x1329bc);}(_0xcc7d,0x19c));var _0xdcc7=function(_0x4cc566,_0x4ac7cf){_0x4cc566=_0x4cc566-0x0;var _0x1a470a=_0xcc7d[_0x4cc566];return _0x1a470a;};'use strict';var EventEmitter=require(_0xdcc7('0x0'));var MailQueue=require(_0xdcc7('0x1'))['db'][_0xdcc7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xdcc7('0x3')](0x0);var events={'afterCreate':_0xdcc7('0x4'),'afterUpdate':'update','afterDestroy':_0xdcc7('0x5')};function emitEvent(_0xb41c91){return function(_0x331038,_0x35fa61,_0xbccf0d){MailQueueEvents[_0xdcc7('0x6')](_0xb41c91+':'+_0x331038['id'],_0x331038);MailQueueEvents['emit'](_0xb41c91,_0x331038);_0xbccf0d(null);};}for(var e in events){if(events[_0xdcc7('0x7')](e)){var event=events[e];MailQueue[_0xdcc7('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index e2c33a8..a4e0a71 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 _0xf4eb=['./mailQueue.attributes','exports','define','mail_queues','lodash','bluebird','rimraf','../../config/environment'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x56c535,_0x5e7def){_0x56c535=_0x56c535-0x0;var _0x572797=_0xf4eb[_0x56c535];return _0x572797;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('MailQueue',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./mailQueue.attributes','exports','define','mail_queues','../../config/logger','api','moment','bluebird','path'];(function(_0x123c05,_0x43820d){var _0x4d2410=function(_0x156d1f){while(--_0x156d1f){_0x123c05['push'](_0x123c05['shift']());}};_0x4d2410(++_0x43820d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xcb91[_0x189305];return _0xea3406;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('MailQueue',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 68afb22..27952c9 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 _0x8559=['localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetMailQueue','MailQueue','findAll','options','raw','include','map','model','attributes','ShowMailQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x8559,0x181));var _0x9855=function(_0x803a26,_0x2210d0){_0x803a26=_0x803a26-0x0;var _0x5d1324=_0x8559[_0x803a26];return _0x5d1324;};'use strict';var _=require(_0x9855('0x0'));var util=require(_0x9855('0x1'));var moment=require(_0x9855('0x2'));var BPromise=require('bluebird');var rs=require(_0x9855('0x3'));var fs=require('fs');var Redis=require(_0x9855('0x4'));var db=require(_0x9855('0x5'))['db'];var utils=require(_0x9855('0x6'));var logger=require(_0x9855('0x7'))(_0x9855('0x8'));var config=require(_0x9855('0x9'));var jayson=require(_0x9855('0xa'));var client=jayson[_0x9855('0xb')][_0x9855('0xc')]({'port':0x232a});config[_0x9855('0xd')]=_[_0x9855('0xe')](config[_0x9855('0xd')],{'host':_0x9855('0xf'),'port':0x18eb});var socket=require(_0x9855('0x10'))(new Redis(config['redis']));require(_0x9855('0x11'))[_0x9855('0x12')](socket);function respondWithRpcPromise(_0x149a73,_0x1816b5,_0x21ca54){return new BPromise(function(_0x12a566,_0x5eacfc){return client[_0x9855('0x13')](_0x149a73,_0x21ca54)[_0x9855('0x14')](function(_0x1c4158){logger[_0x9855('0x15')](_0x9855('0x16'),_0x1816b5,_0x9855('0x17'));logger[_0x9855('0x18')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1816b5,'request\x20sent',JSON[_0x9855('0x19')](_0x1c4158));if(_0x1c4158[_0x9855('0x1a')]){if(_0x1c4158[_0x9855('0x1a')]['code']===0x1f4){logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x1c4158['error'][_0x9855('0x1b')]);return _0x5eacfc(_0x1c4158[_0x9855('0x1a')]['message']);}logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x1c4158[_0x9855('0x1a')]['message']);return _0x12a566(_0x1c4158['error']['message']);}else{logger[_0x9855('0x15')](_0x9855('0x16'),_0x1816b5,'request\x20sent');_0x12a566(_0x1c4158['result'][_0x9855('0x1b')]);}})[_0x9855('0x1c')](function(_0x280593){logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x280593);_0x5eacfc(_0x280593);});});}exports[_0x9855('0x1d')]=function(_0x3caa1b){var _0x4a47cb=this;return new Promise(function(_0x2d78ee,_0x521dd5){return db[_0x9855('0x1e')][_0x9855('0x1f')]({'raw':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')][_0x9855('0x21')]===undefined?!![]:![]:!![],'where':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')]['where']||null:null,'attributes':_0x3caa1b['options']?_0x3caa1b[_0x9855('0x20')]['attributes']||null:null,'limit':_0x3caa1b['options']?_0x3caa1b[_0x9855('0x20')]['limit']||null:null,'include':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')][_0x9855('0x22')]?_[_0x9855('0x23')](_0x3caa1b[_0x9855('0x20')][_0x9855('0x22')],function(_0x568e5e){return{'model':db[_0x568e5e[_0x9855('0x24')]],'as':_0x568e5e['as'],'attributes':_0x568e5e[_0x9855('0x25')],'include':_0x568e5e[_0x9855('0x22')]?_[_0x9855('0x23')](_0x568e5e[_0x9855('0x22')],function(_0x24ae1b){return{'model':db[_0x24ae1b[_0x9855('0x24')]],'as':_0x24ae1b['as'],'attributes':_0x24ae1b['attributes'],'include':_0x24ae1b[_0x9855('0x22')]?_[_0x9855('0x23')](_0x24ae1b[_0x9855('0x22')],function(_0x7cc8c8){return{'model':db[_0x7cc8c8[_0x9855('0x24')]],'as':_0x7cc8c8['as'],'attributes':_0x7cc8c8[_0x9855('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9855('0x14')](function(_0x1e1a00){logger[_0x9855('0x15')](_0x9855('0x1d'),_0x3caa1b);logger['debug'](_0x9855('0x1d'),_0x3caa1b,JSON[_0x9855('0x19')](_0x1e1a00));_0x2d78ee(_0x1e1a00);})[_0x9855('0x1c')](function(_0x1df931){logger[_0x9855('0x1a')](_0x9855('0x1d'),_0x1df931[_0x9855('0x1b')],_0x3caa1b);_0x521dd5(_0x4a47cb['error'](0x1f4,_0x1df931[_0x9855('0x1b')]));});});};exports[_0x9855('0x26')]=function(_0x2dcfb8){var _0x5d10d1=this;return new Promise(function(_0x36071d,_0x1fef9a){return db[_0x9855('0x1e')][_0x9855('0x27')]({'raw':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8['options'][_0x9855('0x21')]===undefined?!![]:![]:!![],'where':_0x2dcfb8['options']?_0x2dcfb8['options']['where']||null:null,'attributes':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8['options']['attributes']||null:null,'include':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8[_0x9855('0x20')][_0x9855('0x22')]?_[_0x9855('0x23')](_0x2dcfb8[_0x9855('0x20')][_0x9855('0x22')],function(_0x14e144){return{'model':db[_0x14e144[_0x9855('0x24')]],'as':_0x14e144['as'],'attributes':_0x14e144[_0x9855('0x25')],'include':_0x14e144[_0x9855('0x22')]?_[_0x9855('0x23')](_0x14e144[_0x9855('0x22')],function(_0x3c38f6){return{'model':db[_0x3c38f6['model']],'as':_0x3c38f6['as'],'attributes':_0x3c38f6[_0x9855('0x25')],'include':_0x3c38f6[_0x9855('0x22')]?_[_0x9855('0x23')](_0x3c38f6[_0x9855('0x22')],function(_0x523627){return{'model':db[_0x523627[_0x9855('0x24')]],'as':_0x523627['as'],'attributes':_0x523627[_0x9855('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9855('0x14')](function(_0xf4d2ea){logger['info'](_0x9855('0x26'),_0x2dcfb8);logger['debug']('ShowMailQueue',_0x2dcfb8,JSON[_0x9855('0x19')](_0xf4d2ea));_0x36071d(_0xf4d2ea);})[_0x9855('0x1c')](function(_0x47a9e0){logger[_0x9855('0x1a')](_0x9855('0x26'),_0x47a9e0[_0x9855('0x1b')],_0x2dcfb8);_0x1fef9a(_0x5d10d1[_0x9855('0x1a')](0x1f4,_0x47a9e0[_0x9855('0x1b')]));});});}; \ No newline at end of file +var _0x062f=['ShowMailQueue','MailQueue','find','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','findAll','options','raw','where','limit','map','include','model','attributes'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x062f,0xc7));var _0xf062=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0x062f[_0x4bbe00];return _0x3999d2;};'use strict';var _=require(_0xf062('0x0'));var util=require(_0xf062('0x1'));var moment=require(_0xf062('0x2'));var BPromise=require('bluebird');var rs=require(_0xf062('0x3'));var fs=require('fs');var Redis=require(_0xf062('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf062('0x5'));var logger=require(_0xf062('0x6'))(_0xf062('0x7'));var config=require(_0xf062('0x8'));var jayson=require(_0xf062('0x9'));var client=jayson[_0xf062('0xa')][_0xf062('0xb')]({'port':0x232a});config[_0xf062('0xc')]=_['defaults'](config[_0xf062('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf062('0xd'))(new Redis(config[_0xf062('0xc')]));require(_0xf062('0xe'))[_0xf062('0xf')](socket);function respondWithRpcPromise(_0x432d2c,_0x3ae668,_0x25a875){return new BPromise(function(_0x3ca47c,_0x1d6363){return client['request'](_0x432d2c,_0x25a875)[_0xf062('0x10')](function(_0x29eef2){logger[_0xf062('0x11')](_0xf062('0x12'),_0x3ae668,_0xf062('0x13'));logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x3ae668,'request\x20sent',JSON[_0xf062('0x14')](_0x29eef2));if(_0x29eef2[_0xf062('0x15')]){if(_0x29eef2[_0xf062('0x15')]['code']===0x1f4){logger[_0xf062('0x15')](_0xf062('0x12'),_0x3ae668,_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);return _0x1d6363(_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);}logger[_0xf062('0x15')](_0xf062('0x12'),_0x3ae668,_0x29eef2[_0xf062('0x15')]['message']);return _0x3ca47c(_0x29eef2[_0xf062('0x15')][_0xf062('0x16')]);}else{logger['info'](_0xf062('0x12'),_0x3ae668,_0xf062('0x13'));_0x3ca47c(_0x29eef2[_0xf062('0x17')][_0xf062('0x16')]);}})[_0xf062('0x18')](function(_0x410598){logger[_0xf062('0x15')]('MailQueue,\x20%s,\x20%s',_0x3ae668,_0x410598);_0x1d6363(_0x410598);});});}exports[_0xf062('0x19')]=function(_0x35b884){var _0x29cb2b=this;return new Promise(function(_0x545b1b,_0x1914b8){return db['MailQueue'][_0xf062('0x1a')]({'raw':_0x35b884[_0xf062('0x1b')]?_0x35b884[_0xf062('0x1b')][_0xf062('0x1c')]===undefined?!![]:![]:!![],'where':_0x35b884['options']?_0x35b884[_0xf062('0x1b')][_0xf062('0x1d')]||null:null,'attributes':_0x35b884[_0xf062('0x1b')]?_0x35b884[_0xf062('0x1b')]['attributes']||null:null,'limit':_0x35b884['options']?_0x35b884['options'][_0xf062('0x1e')]||null:null,'include':_0x35b884['options']?_0x35b884[_0xf062('0x1b')]['include']?_[_0xf062('0x1f')](_0x35b884[_0xf062('0x1b')][_0xf062('0x20')],function(_0x41896b){return{'model':db[_0x41896b[_0xf062('0x21')]],'as':_0x41896b['as'],'attributes':_0x41896b[_0xf062('0x22')],'include':_0x41896b[_0xf062('0x20')]?_['map'](_0x41896b['include'],function(_0x22988f){return{'model':db[_0x22988f[_0xf062('0x21')]],'as':_0x22988f['as'],'attributes':_0x22988f[_0xf062('0x22')],'include':_0x22988f[_0xf062('0x20')]?_['map'](_0x22988f[_0xf062('0x20')],function(_0x5e796c){return{'model':db[_0x5e796c[_0xf062('0x21')]],'as':_0x5e796c['as'],'attributes':_0x5e796c[_0xf062('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf062('0x10')](function(_0x16bf0){logger[_0xf062('0x11')](_0xf062('0x19'),_0x35b884);logger['debug'](_0xf062('0x19'),_0x35b884,JSON[_0xf062('0x14')](_0x16bf0));_0x545b1b(_0x16bf0);})[_0xf062('0x18')](function(_0x6e7a18){logger['error']('GetMailQueue',_0x6e7a18[_0xf062('0x16')],_0x35b884);_0x1914b8(_0x29cb2b[_0xf062('0x15')](0x1f4,_0x6e7a18[_0xf062('0x16')]));});});};exports[_0xf062('0x23')]=function(_0x562c8e){var _0x3770d7=this;return new Promise(function(_0x492be2,_0x53eb97){return db[_0xf062('0x24')][_0xf062('0x25')]({'raw':_0x562c8e[_0xf062('0x1b')]?_0x562c8e['options'][_0xf062('0x1c')]===undefined?!![]:![]:!![],'where':_0x562c8e[_0xf062('0x1b')]?_0x562c8e[_0xf062('0x1b')][_0xf062('0x1d')]||null:null,'attributes':_0x562c8e[_0xf062('0x1b')]?_0x562c8e['options']['attributes']||null:null,'include':_0x562c8e[_0xf062('0x1b')]?_0x562c8e[_0xf062('0x1b')][_0xf062('0x20')]?_['map'](_0x562c8e[_0xf062('0x1b')]['include'],function(_0x25faa4){return{'model':db[_0x25faa4['model']],'as':_0x25faa4['as'],'attributes':_0x25faa4[_0xf062('0x22')],'include':_0x25faa4[_0xf062('0x20')]?_['map'](_0x25faa4[_0xf062('0x20')],function(_0x2bcb60){return{'model':db[_0x2bcb60[_0xf062('0x21')]],'as':_0x2bcb60['as'],'attributes':_0x2bcb60[_0xf062('0x22')],'include':_0x2bcb60[_0xf062('0x20')]?_[_0xf062('0x1f')](_0x2bcb60[_0xf062('0x20')],function(_0x4a7742){return{'model':db[_0x4a7742[_0xf062('0x21')]],'as':_0x4a7742['as'],'attributes':_0x4a7742[_0xf062('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x494997){logger[_0xf062('0x11')](_0xf062('0x23'),_0x562c8e);logger[_0xf062('0x26')](_0xf062('0x23'),_0x562c8e,JSON['stringify'](_0x494997));_0x492be2(_0x494997);})[_0xf062('0x18')](function(_0x408961){logger[_0xf062('0x15')]('ShowMailQueue',_0x408961[_0xf062('0x16')],_0x562c8e);_0x53eb97(_0x3770d7[_0xf062('0x15')](0x1f4,_0x408961[_0xf062('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index db121a5..3844b0a 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 _0x003b=['update','emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x003b,0xd5));var _0xb003=function(_0x3df247,_0x4ff38e){_0x3df247=_0x3df247-0x0;var _0x1dce03=_0x003b[_0x3df247];return _0x1dce03;};'use strict';var MailQueueEvents=require(_0xb003('0x0'));var events=[_0xb003('0x1'),_0xb003('0x2'),_0xb003('0x3')];function createListener(_0x2ce1f1,_0x498150){return function(_0x52e79d){_0x498150[_0xb003('0x4')](_0x2ce1f1,_0x52e79d);};}function removeListener(_0x44afc0,_0xedff6d){return function(){MailQueueEvents[_0xb003('0x5')](_0x44afc0,_0xedff6d);};}exports[_0xb003('0x6')]=function(_0x5ab87f){for(var _0x3f2556=0x0,_0x191643=events[_0xb003('0x7')];_0x3f2556<_0x191643;_0x3f2556++){var _0x4f6873=events[_0x3f2556];var _0x580ab=createListener('mailQueue:'+_0x4f6873,_0x5ab87f);MailQueueEvents['on'](_0x4f6873,_0x580ab);}}; \ No newline at end of file +var _0xcfba=['./mailQueue.events','save','remove','update','emit','removeListener','length','mailQueue:'];(function(_0x9fe71f,_0x52a7ec){var _0x1c5cc8=function(_0x9815d2){while(--_0x9815d2){_0x9fe71f['push'](_0x9fe71f['shift']());}};_0x1c5cc8(++_0x52a7ec);}(_0xcfba,0x1d0));var _0xacfb=function(_0x38537d,_0x1cbe69){_0x38537d=_0x38537d-0x0;var _0x4674e3=_0xcfba[_0x38537d];return _0x4674e3;};'use strict';var MailQueueEvents=require(_0xacfb('0x0'));var events=[_0xacfb('0x1'),_0xacfb('0x2'),_0xacfb('0x3')];function createListener(_0x214eb3,_0x19d879){return function(_0x32aa02){_0x19d879[_0xacfb('0x4')](_0x214eb3,_0x32aa02);};}function removeListener(_0x1719da,_0x105c1c){return function(){MailQueueEvents[_0xacfb('0x5')](_0x1719da,_0x105c1c);};}exports['register']=function(_0x1c34e3){for(var _0x351836=0x0,_0x1d4e7b=events[_0xacfb('0x6')];_0x351836<_0x1d4e7b;_0x351836++){var _0x4b1991=events[_0x351836];var _0x4bece8=createListener(_0xacfb('0x7')+_0x4b1991,_0x1c34e3);MailQueueEvents['on'](_0x4b1991,_0x4bece8);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 8d8ef18..df7c868 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 _0xfd6d=['create','put','/:id','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','show'];(function(_0xdb447c,_0x1c0cc5){var _0x497b8c=function(_0x48d526){while(--_0x48d526){_0xdb447c['push'](_0xdb447c['shift']());}};_0x497b8c(++_0x1c0cc5);}(_0xfd6d,0xb0));var _0xdfd6=function(_0x51b06f,_0x424e3e){_0x51b06f=_0x51b06f-0x0;var _0x4e95f1=_0xfd6d[_0x51b06f];return _0x4e95f1;};'use strict';var multer=require(_0xdfd6('0x0'));var util=require('util');var path=require(_0xdfd6('0x1'));var timeout=require('connect-timeout');var express=require(_0xdfd6('0x2'));var router=express[_0xdfd6('0x3')]();var auth=require(_0xdfd6('0x4'));var interaction=require(_0xdfd6('0x5'));var config=require(_0xdfd6('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xdfd6('0x7')](),controller['index']);router['get']('/describe',auth[_0xdfd6('0x7')](),controller[_0xdfd6('0x8')]);router[_0xdfd6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdfd6('0xa')]);router['post']('/',auth[_0xdfd6('0x7')](),controller[_0xdfd6('0xb')]);router[_0xdfd6('0xc')](_0xdfd6('0xd'),auth[_0xdfd6('0x7')](),controller[_0xdfd6('0xe')]);router[_0xdfd6('0xf')](_0xdfd6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xdfd6('0x10')]=router; \ No newline at end of file +var _0xd17d=['../../config/environment','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','put','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10afad,_0x30da9d){var _0x588d7e=function(_0x25e897){while(--_0x25e897){_0x10afad['push'](_0x10afad['shift']());}};_0x588d7e(++_0x30da9d);}(_0xd17d,0x93));var _0xdd17=function(_0x26d784,_0xf08b74){_0x26d784=_0x26d784-0x0;var _0x5d131d=_0xd17d[_0x26d784];return _0x5d131d;};'use strict';var multer=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var path=require(_0xdd17('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd17('0x3')]();var auth=require(_0xdd17('0x4'));var interaction=require(_0xdd17('0x5'));var config=require(_0xdd17('0x6'));var controller=require(_0xdd17('0x7'));router[_0xdd17('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd17('0x9')]);router[_0xdd17('0x8')](_0xdd17('0xa'),auth['isAuthenticated'](),controller[_0xdd17('0xb')]);router[_0xdd17('0x8')](_0xdd17('0xc'),auth[_0xdd17('0xd')](),controller[_0xdd17('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdd17('0xf')](_0xdd17('0xc'),auth[_0xdd17('0xd')](),controller[_0xdd17('0x10')]);router['delete'](_0xdd17('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5b2c004..936c6d7 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 _0x9437=['DATE','sequelize','exports','STRING'];(function(_0x11bc0f,_0x373666){var _0x3ab0d1=function(_0x4604a7){while(--_0x4604a7){_0x11bc0f['push'](_0x11bc0f['shift']());}};_0x3ab0d1(++_0x373666);}(_0x9437,0x99));var _0x7943=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x9437[_0x320cf5];return _0xa77006;};'use strict';var moment=require('moment');var Sequelize=require(_0x7943('0x0'));module[_0x7943('0x1')]={'uniqueid':{'type':Sequelize[_0x7943('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7943('0x2')]},'joinAt':{'type':Sequelize[_0x7943('0x3')]},'leaveAt':{'type':Sequelize[_0x7943('0x3')]},'acceptAt':{'type':Sequelize[_0x7943('0x3')]},'exitAt':{'type':Sequelize[_0x7943('0x3')]},'reason':{'type':Sequelize[_0x7943('0x2')]}}; \ No newline at end of file +var _0xc30f=['moment','sequelize','exports','STRING','DATE'];(function(_0x495d55,_0x29ced0){var _0x477849=function(_0xeb718c){while(--_0xeb718c){_0x495d55['push'](_0x495d55['shift']());}};_0x477849(++_0x29ced0);}(_0xc30f,0x159));var _0xfc30=function(_0x10a827,_0x381036){_0x10a827=_0x10a827-0x0;var _0x28803a=_0xc30f[_0x10a827];return _0x28803a;};'use strict';var moment=require(_0xfc30('0x0'));var Sequelize=require(_0xfc30('0x1'));module[_0xfc30('0x2')]={'uniqueid':{'type':Sequelize[_0xfc30('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfc30('0x3')]},'joinAt':{'type':Sequelize[_0xfc30('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc30('0x4')]},'exitAt':{'type':Sequelize[_0xfc30('0x4')]},'reason':{'type':Sequelize[_0xfc30('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index cc74dc1..5e4f9b0 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 _0xb9f9=['where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','params','rawAttributes','catch','create','update','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','index','MailQueueReport','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort'];(function(_0x5f1955,_0x15f0a5){var _0x1274c1=function(_0x39d84e){while(--_0x39d84e){_0x5f1955['push'](_0x5f1955['shift']());}};_0x1274c1(++_0x15f0a5);}(_0xb9f9,0x186));var _0x9b9f=function(_0x4c5100,_0x239163){_0x4c5100=_0x4c5100-0x0;var _0x1c2d75=_0xb9f9[_0x4c5100];return _0x1c2d75;};'use strict';var pdf=require(_0x9b9f('0x0'));var emlformat=require(_0x9b9f('0x1'));var rimraf=require(_0x9b9f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b9f('0x3'));var rp=require('request-promise');var moment=require(_0x9b9f('0x4'));var BPromise=require(_0x9b9f('0x5'));var Mustache=require(_0x9b9f('0x6'));var util=require(_0x9b9f('0x7'));var path=require(_0x9b9f('0x8'));var sox=require(_0x9b9f('0x9'));var csv=require(_0x9b9f('0xa'));var ejs=require(_0x9b9f('0xb'));var fs=require('fs');var _=require(_0x9b9f('0xc'));var squel=require(_0x9b9f('0xd'));var crypto=require('crypto');var jsforce=require(_0x9b9f('0xe'));var deskjs=require(_0x9b9f('0xf'));var toCsv=require(_0x9b9f('0xa'));var querystring=require(_0x9b9f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9b9f('0x11'));var authService=require(_0x9b9f('0x12'));var qs=require(_0x9b9f('0x13'));var hardwareService=require(_0x9b9f('0x14'));var logger=require('../../config/logger')(_0x9b9f('0x15'));var utils=require(_0x9b9f('0x16'));var config=require(_0x9b9f('0x17'));var db=require(_0x9b9f('0x18'))['db'];function respondWithStatusCode(_0x45d753,_0x58c705){_0x58c705=_0x58c705||0xcc;return function(_0x268e3e){if(_0x268e3e){return _0x45d753['sendStatus'](_0x58c705);}return _0x45d753[_0x9b9f('0x19')](_0x58c705)[_0x9b9f('0x1a')]();};}function respondWithResult(_0x426e51,_0x4d55ae){_0x4d55ae=_0x4d55ae||0xc8;return function(_0x4451f3){if(_0x4451f3){return _0x426e51[_0x9b9f('0x19')](_0x4d55ae)[_0x9b9f('0x1b')](_0x4451f3);}};}function respondWithFilteredResult(_0x19f4fb,_0x19f998){return function(_0x63b2f2){if(_0x63b2f2){var _0x1130bd=_0x63b2f2[_0x9b9f('0x1c')],_0xae44ab=_0x19f998['offset'],_0x18d6ce=_0x19f998[_0x9b9f('0x1d')]+_0x19f998['limit'],_0x515cf3;if(_0x18d6ce>=_0x1130bd){_0x18d6ce=_0x1130bd;_0x515cf3=0xc8;}else{_0x515cf3=0xce;}_0x19f4fb[_0x9b9f('0x19')](_0x515cf3);return _0x19f4fb[_0x9b9f('0x1e')](_0x9b9f('0x1f'),_0xae44ab+'-'+_0x18d6ce+'/'+_0x1130bd)[_0x9b9f('0x1b')](_0x63b2f2);}return null;};}function patchUpdates(_0x192fd6){return function(_0x8a69af){try{jsonpatch['apply'](_0x8a69af,_0x192fd6,!![]);}catch(_0x435fc4){return BPromise[_0x9b9f('0x20')](_0x435fc4);}return _0x8a69af[_0x9b9f('0x21')]();};}function saveUpdates(_0x1baafd,_0x1a004a){return function(_0x2fb029){if(_0x2fb029){return _0x2fb029['update'](_0x1baafd)[_0x9b9f('0x22')](function(_0x45939d){return _0x45939d;});}return null;};}function removeEntity(_0x441641,_0x47b579){return function(_0x2a2393){if(_0x2a2393){return _0x2a2393[_0x9b9f('0x23')]()['then'](function(){_0x441641['status'](0xcc)[_0x9b9f('0x1a')]();});}};}function handleEntityNotFound(_0x38b5ac,_0x204d28){return function(_0x21083b){if(!_0x21083b){_0x38b5ac[_0x9b9f('0x24')](0x194);}return _0x21083b;};}function handleError(_0x7e398b,_0x3feed3){_0x3feed3=_0x3feed3||0x1f4;return function(_0x2c5cd0){logger[_0x9b9f('0x25')](_0x2c5cd0[_0x9b9f('0x26')]);if(_0x2c5cd0[_0x9b9f('0x27')]){delete _0x2c5cd0[_0x9b9f('0x27')];}_0x7e398b[_0x9b9f('0x19')](_0x3feed3)['send'](_0x2c5cd0);};}exports[_0x9b9f('0x28')]=function(_0xe48bc8,_0x358cf9){var _0x27427d={},_0x346f08={},_0x13b118={'count':0x0,'rows':[]};var _0x6320f0=db[_0x9b9f('0x29')]['rawAttributes'];_0x346f08[_0x9b9f('0x2a')]=_['keys'](_0x6320f0);_0x346f08[_0x9b9f('0x2b')]=_[_0x9b9f('0x2c')](_0xe48bc8[_0x9b9f('0x2b')]);_0x346f08[_0x9b9f('0x2d')]=_['intersection'](_0x346f08[_0x9b9f('0x2a')],_0x346f08[_0x9b9f('0x2b')]);_0x27427d[_0x9b9f('0x2e')]=_[_0x9b9f('0x2f')](_0x346f08['model'],qs[_0x9b9f('0x30')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x30')]));_0x27427d[_0x9b9f('0x2e')]=_0x27427d[_0x9b9f('0x2e')][_0x9b9f('0x31')]?_0x27427d[_0x9b9f('0x2e')]:_0x346f08['model'];if(!_0xe48bc8[_0x9b9f('0x2b')]['hasOwnProperty'](_0x9b9f('0x32'))){_0x27427d['limit']=qs[_0x9b9f('0x33')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x33')]);_0x27427d[_0x9b9f('0x1d')]=qs[_0x9b9f('0x1d')](_0xe48bc8[_0x9b9f('0x2b')]['offset']);}_0x27427d[_0x9b9f('0x34')]=qs[_0x9b9f('0x35')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x35')]);_0x27427d[_0x9b9f('0x36')]=qs['filters'](_[_0x9b9f('0x37')](_0xe48bc8['query'],_0x346f08[_0x9b9f('0x2d')]));if(_0xe48bc8['query'][_0x9b9f('0x38')]){_0x27427d[_0x9b9f('0x36')]=_[_0x9b9f('0x39')](_0x27427d[_0x9b9f('0x36')],{'$or':_[_0x9b9f('0x3a')](_0x6320f0,function(_0x5e59a3){if(_0x5e59a3[_0x9b9f('0x3b')]['key']!==_0x9b9f('0x3c')){var _0x3f700b={};_0x3f700b[_0x5e59a3[_0x9b9f('0x3d')]]={'$like':'%'+_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x38')]+'%'};return _0x3f700b;}})});}_0x27427d=_[_0x9b9f('0x39')]({},_0x27427d,_0xe48bc8[_0x9b9f('0x3e')]);var _0x521556={'where':_0x27427d[_0x9b9f('0x36')]};return db['MailQueueReport'][_0x9b9f('0x1c')](_0x521556)[_0x9b9f('0x22')](function(_0x44d9c6){_0x13b118['count']=_0x44d9c6;if(_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x3f')]){_0x27427d[_0x9b9f('0x40')]=[{'all':!![]}];}return db[_0x9b9f('0x29')]['findAll'](_0x27427d);})['then'](function(_0x316cc9){_0x13b118[_0x9b9f('0x41')]=_0x316cc9;return _0x13b118;})['then'](respondWithFilteredResult(_0x358cf9,_0x27427d))['catch'](handleError(_0x358cf9,null));};exports['show']=function(_0x1bbf8f,_0x41de3e){var _0x13fe6f={'raw':!![],'where':{'id':_0x1bbf8f[_0x9b9f('0x42')]['id']}},_0x5ce871={};_0x5ce871['model']=_[_0x9b9f('0x2c')](db['MailQueueReport'][_0x9b9f('0x43')]);_0x5ce871[_0x9b9f('0x2b')]=_[_0x9b9f('0x2c')](_0x1bbf8f[_0x9b9f('0x2b')]);_0x5ce871[_0x9b9f('0x2d')]=_['intersection'](_0x5ce871[_0x9b9f('0x2a')],_0x5ce871['query']);_0x13fe6f[_0x9b9f('0x2e')]=_[_0x9b9f('0x2f')](_0x5ce871['model'],qs[_0x9b9f('0x30')](_0x1bbf8f['query'][_0x9b9f('0x30')]));_0x13fe6f[_0x9b9f('0x2e')]=_0x13fe6f[_0x9b9f('0x2e')][_0x9b9f('0x31')]?_0x13fe6f['attributes']:_0x5ce871['model'];if(_0x1bbf8f[_0x9b9f('0x2b')][_0x9b9f('0x3f')]){_0x13fe6f[_0x9b9f('0x40')]=[{'all':!![]}];}_0x13fe6f=_[_0x9b9f('0x39')]({},_0x13fe6f,_0x1bbf8f[_0x9b9f('0x3e')]);return db['MailQueueReport']['find'](_0x13fe6f)[_0x9b9f('0x22')](handleEntityNotFound(_0x41de3e,null))[_0x9b9f('0x22')](respondWithResult(_0x41de3e,null))[_0x9b9f('0x44')](handleError(_0x41de3e,null));};exports[_0x9b9f('0x45')]=function(_0x48fbc2,_0x5cee0f){return db['MailQueueReport'][_0x9b9f('0x45')](_0x48fbc2['body'],{})[_0x9b9f('0x22')](respondWithResult(_0x5cee0f,0xc9))[_0x9b9f('0x44')](handleError(_0x5cee0f,null));};exports[_0x9b9f('0x46')]=function(_0x4b95c2,_0x5de0c2){if(_0x4b95c2['body']['id']){delete _0x4b95c2[_0x9b9f('0x47')]['id'];}return db[_0x9b9f('0x29')][_0x9b9f('0x48')]({'where':{'id':_0x4b95c2[_0x9b9f('0x42')]['id']}})[_0x9b9f('0x22')](handleEntityNotFound(_0x5de0c2,null))['then'](saveUpdates(_0x4b95c2[_0x9b9f('0x47')],null))[_0x9b9f('0x22')](respondWithResult(_0x5de0c2,null))[_0x9b9f('0x44')](handleError(_0x5de0c2,null));};exports['destroy']=function(_0x5062d2,_0x163211){return db[_0x9b9f('0x29')]['find']({'where':{'id':_0x5062d2[_0x9b9f('0x42')]['id']}})[_0x9b9f('0x22')](handleEntityNotFound(_0x163211,null))[_0x9b9f('0x22')](removeEntity(_0x163211,null))['catch'](handleError(_0x163211,null));};exports['describe']=function(_0x423de8,_0x2082fb){return db[_0x9b9f('0x29')][_0x9b9f('0x49')]()[_0x9b9f('0x22')](respondWithResult(_0x2082fb,null))['catch'](handleError(_0x2082fb,null));}; \ No newline at end of file +var _0x8ae7=['reject','save','update','then','destroy','error','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x282a8e,_0x26fa64){var _0x3e7d2d=function(_0x20436c){while(--_0x20436c){_0x282a8e['push'](_0x282a8e['shift']());}};_0x3e7d2d(++_0x26fa64);}(_0x8ae7,0x1e4));var _0x78ae=function(_0x13047e,_0xbf0fbe){_0x13047e=_0x13047e-0x0;var _0x1e2602=_0x8ae7[_0x13047e];return _0x1e2602;};'use strict';var pdf=require(_0x78ae('0x0'));var emlformat=require(_0x78ae('0x1'));var rimraf=require(_0x78ae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78ae('0x3'));var rp=require(_0x78ae('0x4'));var moment=require(_0x78ae('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x78ae('0x6'));var path=require(_0x78ae('0x7'));var sox=require(_0x78ae('0x8'));var csv=require(_0x78ae('0x9'));var ejs=require(_0x78ae('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78ae('0xb'));var crypto=require(_0x78ae('0xc'));var jsforce=require(_0x78ae('0xd'));var deskjs=require(_0x78ae('0xe'));var toCsv=require(_0x78ae('0x9'));var querystring=require(_0x78ae('0xf'));var Papa=require(_0x78ae('0x10'));var Redis=require(_0x78ae('0x11'));var authService=require(_0x78ae('0x12'));var qs=require(_0x78ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78ae('0x14'));var utils=require(_0x78ae('0x15'));var config=require(_0x78ae('0x16'));var db=require(_0x78ae('0x17'))['db'];function respondWithStatusCode(_0x264fb8,_0x2f665d){_0x2f665d=_0x2f665d||0xcc;return function(_0x110a00){if(_0x110a00){return _0x264fb8[_0x78ae('0x18')](_0x2f665d);}return _0x264fb8[_0x78ae('0x19')](_0x2f665d)[_0x78ae('0x1a')]();};}function respondWithResult(_0x2ec98f,_0x5e3dc6){_0x5e3dc6=_0x5e3dc6||0xc8;return function(_0x442dd3){if(_0x442dd3){return _0x2ec98f[_0x78ae('0x19')](_0x5e3dc6)[_0x78ae('0x1b')](_0x442dd3);}};}function respondWithFilteredResult(_0x19c095,_0x261e8c){return function(_0x53f6ac){if(_0x53f6ac){var _0x396d1b=_0x53f6ac[_0x78ae('0x1c')],_0x4c396a=_0x261e8c[_0x78ae('0x1d')],_0x1b42a9=_0x261e8c[_0x78ae('0x1d')]+_0x261e8c[_0x78ae('0x1e')],_0x43e93a;if(_0x1b42a9>=_0x396d1b){_0x1b42a9=_0x396d1b;_0x43e93a=0xc8;}else{_0x43e93a=0xce;}_0x19c095[_0x78ae('0x19')](_0x43e93a);return _0x19c095[_0x78ae('0x1f')](_0x78ae('0x20'),_0x4c396a+'-'+_0x1b42a9+'/'+_0x396d1b)[_0x78ae('0x1b')](_0x53f6ac);}return null;};}function patchUpdates(_0x339a5c){return function(_0x39a22f){try{jsonpatch[_0x78ae('0x21')](_0x39a22f,_0x339a5c,!![]);}catch(_0x217ca4){return BPromise[_0x78ae('0x22')](_0x217ca4);}return _0x39a22f[_0x78ae('0x23')]();};}function saveUpdates(_0xc6699f,_0xf1c506){return function(_0x2f9b97){if(_0x2f9b97){return _0x2f9b97[_0x78ae('0x24')](_0xc6699f)[_0x78ae('0x25')](function(_0x30ca02){return _0x30ca02;});}return null;};}function removeEntity(_0x4b136a,_0x2bab1f){return function(_0x3cadfe){if(_0x3cadfe){return _0x3cadfe[_0x78ae('0x26')]()[_0x78ae('0x25')](function(){_0x4b136a[_0x78ae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa076,_0x283a06){return function(_0x214eb7){if(!_0x214eb7){_0x3fa076[_0x78ae('0x18')](0x194);}return _0x214eb7;};}function handleError(_0x1d261f,_0x19cfd3){_0x19cfd3=_0x19cfd3||0x1f4;return function(_0x16c9b1){logger[_0x78ae('0x27')](_0x16c9b1['stack']);if(_0x16c9b1['name']){delete _0x16c9b1[_0x78ae('0x28')];}_0x1d261f['status'](_0x19cfd3)['send'](_0x16c9b1);};}exports[_0x78ae('0x29')]=function(_0x4c6247,_0xea3b70){var _0x13ffeb={},_0x541cd3={},_0xb21125={'count':0x0,'rows':[]};var _0x499300=db['MailQueueReport'][_0x78ae('0x2a')];_0x541cd3[_0x78ae('0x2b')]=_[_0x78ae('0x2c')](_0x499300);_0x541cd3[_0x78ae('0x2d')]=_[_0x78ae('0x2c')](_0x4c6247[_0x78ae('0x2d')]);_0x541cd3['filters']=_[_0x78ae('0x2e')](_0x541cd3[_0x78ae('0x2b')],_0x541cd3[_0x78ae('0x2d')]);_0x13ffeb[_0x78ae('0x2f')]=_['intersection'](_0x541cd3[_0x78ae('0x2b')],qs[_0x78ae('0x30')](_0x4c6247['query']['fields']));_0x13ffeb[_0x78ae('0x2f')]=_0x13ffeb[_0x78ae('0x2f')][_0x78ae('0x31')]?_0x13ffeb[_0x78ae('0x2f')]:_0x541cd3[_0x78ae('0x2b')];if(!_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x32')](_0x78ae('0x33'))){_0x13ffeb[_0x78ae('0x1e')]=qs[_0x78ae('0x1e')](_0x4c6247[_0x78ae('0x2d')]['limit']);_0x13ffeb[_0x78ae('0x1d')]=qs[_0x78ae('0x1d')](_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x1d')]);}_0x13ffeb['order']=qs[_0x78ae('0x34')](_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x34')]);_0x13ffeb[_0x78ae('0x35')]=qs[_0x78ae('0x36')](_[_0x78ae('0x37')](_0x4c6247[_0x78ae('0x2d')],_0x541cd3[_0x78ae('0x36')]));if(_0x4c6247['query'][_0x78ae('0x38')]){_0x13ffeb[_0x78ae('0x35')]=_[_0x78ae('0x39')](_0x13ffeb[_0x78ae('0x35')],{'$or':_[_0x78ae('0x3a')](_0x499300,function(_0xf3f6c9){if(_0xf3f6c9[_0x78ae('0x3b')][_0x78ae('0x3c')]!==_0x78ae('0x3d')){var _0x35ebbd={};_0x35ebbd[_0xf3f6c9['field']]={'$like':'%'+_0x4c6247[_0x78ae('0x2d')]['filter']+'%'};return _0x35ebbd;}})});}_0x13ffeb=_['merge']({},_0x13ffeb,_0x4c6247[_0x78ae('0x3e')]);var _0x1b5b9f={'where':_0x13ffeb[_0x78ae('0x35')]};return db[_0x78ae('0x3f')][_0x78ae('0x1c')](_0x1b5b9f)[_0x78ae('0x25')](function(_0x434f24){_0xb21125[_0x78ae('0x1c')]=_0x434f24;if(_0x4c6247[_0x78ae('0x2d')][_0x78ae('0x40')]){_0x13ffeb[_0x78ae('0x41')]=[{'all':!![]}];}return db[_0x78ae('0x3f')][_0x78ae('0x42')](_0x13ffeb);})[_0x78ae('0x25')](function(_0x3b906a){_0xb21125[_0x78ae('0x43')]=_0x3b906a;return _0xb21125;})[_0x78ae('0x25')](respondWithFilteredResult(_0xea3b70,_0x13ffeb))[_0x78ae('0x44')](handleError(_0xea3b70,null));};exports['show']=function(_0x44a2ae,_0x4f98b1){var _0x3f9998={'raw':!![],'where':{'id':_0x44a2ae[_0x78ae('0x45')]['id']}},_0x3f67c5={};_0x3f67c5[_0x78ae('0x2b')]=_[_0x78ae('0x2c')](db[_0x78ae('0x3f')]['rawAttributes']);_0x3f67c5[_0x78ae('0x2d')]=_['keys'](_0x44a2ae[_0x78ae('0x2d')]);_0x3f67c5['filters']=_[_0x78ae('0x2e')](_0x3f67c5[_0x78ae('0x2b')],_0x3f67c5[_0x78ae('0x2d')]);_0x3f9998[_0x78ae('0x2f')]=_[_0x78ae('0x2e')](_0x3f67c5[_0x78ae('0x2b')],qs[_0x78ae('0x30')](_0x44a2ae[_0x78ae('0x2d')][_0x78ae('0x30')]));_0x3f9998[_0x78ae('0x2f')]=_0x3f9998[_0x78ae('0x2f')][_0x78ae('0x31')]?_0x3f9998['attributes']:_0x3f67c5['model'];if(_0x44a2ae[_0x78ae('0x2d')][_0x78ae('0x40')]){_0x3f9998[_0x78ae('0x41')]=[{'all':!![]}];}_0x3f9998=_[_0x78ae('0x39')]({},_0x3f9998,_0x44a2ae[_0x78ae('0x3e')]);return db[_0x78ae('0x3f')][_0x78ae('0x46')](_0x3f9998)[_0x78ae('0x25')](handleEntityNotFound(_0x4f98b1,null))[_0x78ae('0x25')](respondWithResult(_0x4f98b1,null))[_0x78ae('0x44')](handleError(_0x4f98b1,null));};exports[_0x78ae('0x47')]=function(_0x1b42ee,_0x528a65){return db['MailQueueReport'][_0x78ae('0x47')](_0x1b42ee[_0x78ae('0x48')],{})[_0x78ae('0x25')](respondWithResult(_0x528a65,0xc9))[_0x78ae('0x44')](handleError(_0x528a65,null));};exports[_0x78ae('0x24')]=function(_0x4ceb84,_0x5156cc){if(_0x4ceb84['body']['id']){delete _0x4ceb84[_0x78ae('0x48')]['id'];}return db[_0x78ae('0x3f')]['find']({'where':{'id':_0x4ceb84[_0x78ae('0x45')]['id']}})[_0x78ae('0x25')](handleEntityNotFound(_0x5156cc,null))[_0x78ae('0x25')](saveUpdates(_0x4ceb84[_0x78ae('0x48')],null))[_0x78ae('0x25')](respondWithResult(_0x5156cc,null))[_0x78ae('0x44')](handleError(_0x5156cc,null));};exports[_0x78ae('0x26')]=function(_0x585224,_0xa0b276){return db['MailQueueReport'][_0x78ae('0x46')]({'where':{'id':_0x585224[_0x78ae('0x45')]['id']}})[_0x78ae('0x25')](handleEntityNotFound(_0xa0b276,null))['then'](removeEntity(_0xa0b276,null))[_0x78ae('0x44')](handleError(_0xa0b276,null));};exports[_0x78ae('0x49')]=function(_0x4a2664,_0x3e7cdd){return db[_0x78ae('0x3f')][_0x78ae('0x49')]()['then'](respondWithResult(_0x3e7cdd,null))[_0x78ae('0x44')](handleError(_0x3e7cdd,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 2df4829..5233c1c 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 _0xe493=['path','../../config/environment','exports','define','MailQueueReport','report_mail_queue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x55b745,_0x36e0fa){var _0x1772a7=function(_0x2bf1e3){while(--_0x2bf1e3){_0x55b745['push'](_0x55b745['shift']());}};_0x1772a7(++_0x36e0fa);}(_0xe493,0x7e));var _0x3e49=function(_0x108c67,_0xdc716f){_0x108c67=_0x108c67-0x0;var _0xd4b72=_0xe493[_0x108c67];return _0xd4b72;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var logger=require(_0x3e49('0x2'))(_0x3e49('0x3'));var moment=require(_0x3e49('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e49('0x5'));var fs=require('fs');var path=require(_0x3e49('0x6'));var rimraf=require('rimraf');var config=require(_0x3e49('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x3e49('0x8')]=function(_0x2e79b6,_0x24f15c){return _0x2e79b6[_0x3e49('0x9')](_0x3e49('0xa'),attributes,{'tableName':_0x3e49('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xea5b=['report_mail_queue','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','define','MailQueueReport'];(function(_0x2edda2,_0x512dd4){var _0xa51ae1=function(_0x1aff8b){while(--_0x1aff8b){_0x2edda2['push'](_0x2edda2['shift']());}};_0xa51ae1(++_0x512dd4);}(_0xea5b,0x152));var _0xbea5=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xea5b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var logger=require(_0xbea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbea5('0x3'));var rp=require(_0xbea5('0x4'));var fs=require('fs');var path=require(_0xbea5('0x5'));var rimraf=require(_0xbea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbea5('0x7'));module['exports']=function(_0x2db67a,_0x3d9263){return _0x2db67a[_0xbea5('0x8')](_0xbea5('0x9'),attributes,{'tableName':_0xbea5('0xa'),'paranoid':![],'indexes':[{'name':_0xbea5('0xb'),'fields':[_0xbea5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 36ee2fc..1795f87 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 _0xbad1=['request\x20sent','stringify','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbad1,0x147));var _0x1bad=function(_0x51a9c8,_0x1e0917){_0x51a9c8=_0x51a9c8-0x0;var _0x5d8b7f=_0xbad1[_0x51a9c8];return _0x5d8b7f;};'use strict';var _=require(_0x1bad('0x0'));var util=require('util');var moment=require(_0x1bad('0x1'));var BPromise=require(_0x1bad('0x2'));var rs=require(_0x1bad('0x3'));var fs=require('fs');var Redis=require(_0x1bad('0x4'));var db=require(_0x1bad('0x5'))['db'];var utils=require(_0x1bad('0x6'));var logger=require(_0x1bad('0x7'))('rpc');var config=require(_0x1bad('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1bad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b9dc1,_0x2ab7f9,_0x4d166b){return new BPromise(function(_0xdfbdce,_0x15732c){return client['request'](_0x4b9dc1,_0x4d166b)[_0x1bad('0xa')](function(_0x3a620f){logger['info'](_0x1bad('0xb'),_0x2ab7f9,'request\x20sent');logger[_0x1bad('0xc')](_0x1bad('0xd'),_0x2ab7f9,_0x1bad('0xe'),JSON[_0x1bad('0xf')](_0x3a620f));if(_0x3a620f[_0x1bad('0x10')]){if(_0x3a620f['error'][_0x1bad('0x11')]===0x1f4){logger[_0x1bad('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x2ab7f9,_0x3a620f['error'][_0x1bad('0x12')]);return _0x15732c(_0x3a620f['error'][_0x1bad('0x12')]);}logger['error'](_0x1bad('0xb'),_0x2ab7f9,_0x3a620f[_0x1bad('0x10')][_0x1bad('0x12')]);return _0xdfbdce(_0x3a620f[_0x1bad('0x10')][_0x1bad('0x12')]);}else{logger[_0x1bad('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x2ab7f9,_0x1bad('0xe'));_0xdfbdce(_0x3a620f['result'][_0x1bad('0x12')]);}})[_0x1bad('0x14')](function(_0x29cefb){logger[_0x1bad('0x10')](_0x1bad('0xb'),_0x2ab7f9,_0x29cefb);_0x15732c(_0x29cefb);});});}exports[_0x1bad('0x15')]=function(_0x32d81c){var _0x2d8669=this;return new Promise(function(_0x386d94,_0x2ec5b6){return db[_0x1bad('0x16')][_0x1bad('0x17')](_0x32d81c[_0x1bad('0x18')],{'raw':_0x32d81c[_0x1bad('0x19')]?_0x32d81c[_0x1bad('0x19')][_0x1bad('0x1a')]===undefined?!![]:![]:!![]})[_0x1bad('0xa')](function(_0xa42164){logger['info']('CreateMailQueueReport',_0x32d81c);logger[_0x1bad('0xc')]('CreateMailQueueReport',_0x32d81c,JSON['stringify'](_0xa42164));_0x386d94(_0xa42164);})[_0x1bad('0x14')](function(_0x230f72){logger[_0x1bad('0x10')]('CreateMailQueueReport',_0x230f72[_0x1bad('0x12')],_0x32d81c);_0x2ec5b6(_0x2d8669[_0x1bad('0x10')](0x1f4,_0x230f72['message']));});});};exports[_0x1bad('0x1b')]=function(_0x5165e6){var _0x49effa=this;return new Promise(function(_0x233207,_0x274a2a){return db['MailQueueReport']['update'](_0x5165e6[_0x1bad('0x18')],{'raw':_0x5165e6[_0x1bad('0x19')]?_0x5165e6[_0x1bad('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5165e6['options']?_0x5165e6[_0x1bad('0x19')][_0x1bad('0x1c')]||null:null,'attributes':_0x5165e6[_0x1bad('0x19')]?_0x5165e6['options'][_0x1bad('0x1d')]||null:null,'limit':_0x5165e6[_0x1bad('0x19')]?_0x5165e6['options'][_0x1bad('0x1e')]||null:null})['then'](function(_0x285543){logger['info'](_0x1bad('0x1b'),_0x5165e6);logger[_0x1bad('0xc')](_0x1bad('0x1b'),_0x5165e6,JSON[_0x1bad('0xf')](_0x285543));_0x233207(_0x285543);})[_0x1bad('0x14')](function(_0x24ed7e){logger[_0x1bad('0x10')](_0x1bad('0x1b'),_0x24ed7e['message'],_0x5165e6);_0x274a2a(_0x49effa[_0x1bad('0x10')](0x1f4,_0x24ed7e[_0x1bad('0x12')]));});});}; \ No newline at end of file +var _0x8a01=['stringify','code','error','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','raw','UpdateMailQueueReport','update','body','where','attributes','limit','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x8a01,0x1df));var _0x18a0=function(_0x5be32a,_0x61feed){_0x5be32a=_0x5be32a-0x0;var _0x5d1cee=_0x8a01[_0x5be32a];return _0x5d1cee;};'use strict';var _=require('lodash');var util=require(_0x18a0('0x0'));var moment=require(_0x18a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x18a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18a0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x18a0('0x4'));var config=require(_0x18a0('0x5'));var jayson=require(_0x18a0('0x6'));var client=jayson[_0x18a0('0x7')][_0x18a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4218d9,_0x326a71,_0x233c64){return new BPromise(function(_0x58c50b,_0x2c672a){return client[_0x18a0('0x9')](_0x4218d9,_0x233c64)[_0x18a0('0xa')](function(_0x539be0){logger[_0x18a0('0xb')](_0x18a0('0xc'),_0x326a71,_0x18a0('0xd'));logger[_0x18a0('0xe')](_0x18a0('0xf'),_0x326a71,_0x18a0('0xd'),JSON[_0x18a0('0x10')](_0x539be0));if(_0x539be0['error']){if(_0x539be0['error'][_0x18a0('0x11')]===0x1f4){logger['error'](_0x18a0('0xc'),_0x326a71,_0x539be0[_0x18a0('0x12')]['message']);return _0x2c672a(_0x539be0[_0x18a0('0x12')][_0x18a0('0x13')]);}logger[_0x18a0('0x12')](_0x18a0('0xc'),_0x326a71,_0x539be0['error'][_0x18a0('0x13')]);return _0x58c50b(_0x539be0[_0x18a0('0x12')]['message']);}else{logger[_0x18a0('0xb')](_0x18a0('0xc'),_0x326a71,'request\x20sent');_0x58c50b(_0x539be0[_0x18a0('0x14')]['message']);}})[_0x18a0('0x15')](function(_0x5c7637){logger['error'](_0x18a0('0xc'),_0x326a71,_0x5c7637);_0x2c672a(_0x5c7637);});});}exports[_0x18a0('0x16')]=function(_0x42dffa){var _0x31936b=this;return new Promise(function(_0x53680c,_0x3dbf0d){return db[_0x18a0('0x17')][_0x18a0('0x18')](_0x42dffa['body'],{'raw':_0x42dffa[_0x18a0('0x19')]?_0x42dffa['options'][_0x18a0('0x1a')]===undefined?!![]:![]:!![]})[_0x18a0('0xa')](function(_0x36fec1){logger['info'](_0x18a0('0x16'),_0x42dffa);logger[_0x18a0('0xe')](_0x18a0('0x16'),_0x42dffa,JSON['stringify'](_0x36fec1));_0x53680c(_0x36fec1);})[_0x18a0('0x15')](function(_0x334394){logger['error'](_0x18a0('0x16'),_0x334394[_0x18a0('0x13')],_0x42dffa);_0x3dbf0d(_0x31936b[_0x18a0('0x12')](0x1f4,_0x334394[_0x18a0('0x13')]));});});};exports[_0x18a0('0x1b')]=function(_0x2c733b){var _0x1bd8c8=this;return new Promise(function(_0x348930,_0x2bcf9d){return db[_0x18a0('0x17')][_0x18a0('0x1c')](_0x2c733b[_0x18a0('0x1d')],{'raw':_0x2c733b[_0x18a0('0x19')]?_0x2c733b['options'][_0x18a0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c733b['options']?_0x2c733b[_0x18a0('0x19')][_0x18a0('0x1e')]||null:null,'attributes':_0x2c733b[_0x18a0('0x19')]?_0x2c733b[_0x18a0('0x19')][_0x18a0('0x1f')]||null:null,'limit':_0x2c733b['options']?_0x2c733b['options'][_0x18a0('0x20')]||null:null})[_0x18a0('0xa')](function(_0x44e8b1){logger[_0x18a0('0xb')](_0x18a0('0x1b'),_0x2c733b);logger[_0x18a0('0xe')](_0x18a0('0x1b'),_0x2c733b,JSON['stringify'](_0x44e8b1));_0x348930(_0x44e8b1);})[_0x18a0('0x15')](function(_0x254493){logger['error'](_0x18a0('0x1b'),_0x254493['message'],_0x2c733b);_0x2bcf9d(_0x1bd8c8[_0x18a0('0x12')](0x1f4,_0x254493['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index c214ed4..510f8fb 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 _0xc4aa=['path','connect-timeout','express','Router','exports','multer','util'];(function(_0x2b9f8b,_0x404ea5){var _0x58d615=function(_0x1f117a){while(--_0x1f117a){_0x2b9f8b['push'](_0x2b9f8b['shift']());}};_0x58d615(++_0x404ea5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xac4a('0x6')]=router; \ No newline at end of file +var _0xfcf0=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcf0,0x138));var _0x0fcf=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xfcf0[_0x117f4c];return _0x2b24e9;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var auth=require(_0x0fcf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0fcf('0x6'));module[_0x0fcf('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 32c9457..d999393 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 _0xb7e7=['STRING','BOOLEAN','username','INTEGER','sequelize'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x7b7e('0x3')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7b7e('0x4')]},'tls':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7b7e('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xad8a=['INBOX','sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xad8a,0xb0));var _0xaad8=function(_0x2b2a24,_0x1ef51a){_0x2b2a24=_0x2b2a24-0x0;var _0x3e5cb5=_0xad8a[_0x2b2a24];return _0x3e5cb5;};'use strict';var Sequelize=require(_0xaad8('0x0'));module[_0xaad8('0x1')]={'description':{'type':Sequelize[_0xaad8('0x2')]},'host':{'type':Sequelize[_0xaad8('0x2')]},'authentication':{'type':Sequelize[_0xaad8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xaad8('0x4')},'password':{'type':Sequelize[_0xaad8('0x2')]},'port':{'type':Sequelize[_0xaad8('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaad8('0x2')],'defaultValue':_0xaad8('0x6')},'connTimeout':{'type':Sequelize[_0xaad8('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaad8('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xaad8('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c08bae5..9df1c6a 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 _0x7833=['MailServerIn','mail_servers_in','lodash','util','api','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x5af978,_0x3a2a2f){var _0x3ec596=function(_0x1530d4){while(--_0x1530d4){_0x5af978['push'](_0x5af978['shift']());}};_0x3ec596(++_0x3a2a2f);}(_0x7833,0x1d6));var _0x3783=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7833[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x3783('0x0'));var util=require(_0x3783('0x1'));var logger=require('../../config/logger')(_0x3783('0x2'));var moment=require('moment');var BPromise=require(_0x3783('0x3'));var rp=require(_0x3783('0x4'));var fs=require('fs');var path=require(_0x3783('0x5'));var rimraf=require('rimraf');var config=require(_0x3783('0x6'));var attributes=require(_0x3783('0x7'));module[_0x3783('0x8')]=function(_0x214860,_0x1f1887){return _0x214860[_0x3783('0x9')](_0x3783('0xa'),attributes,{'tableName':_0x3783('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68a1=['path','rimraf','../../config/environment','./mailServerIn.attributes','MailServerIn','lodash','../../config/logger','api','moment'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x68a1,0x17f));var _0x168a=function(_0x5ef56c,_0x497df1){_0x5ef56c=_0x5ef56c-0x0;var _0x1f10ae=_0x68a1[_0x5ef56c];return _0x1f10ae;};'use strict';var _=require(_0x168a('0x0'));var util=require('util');var logger=require(_0x168a('0x1'))(_0x168a('0x2'));var moment=require(_0x168a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x168a('0x4'));var rimraf=require(_0x168a('0x5'));var config=require(_0x168a('0x6'));var attributes=require(_0x168a('0x7'));module['exports']=function(_0x59f73b,_0x1905aa){return _0x59f73b['define'](_0x168a('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 f3676df..14fa773 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 _0xebc3=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','model','map','stringify','util'];(function(_0x24e1ec,_0x43bf35){var _0x50f4d3=function(_0x1eeadf){while(--_0x1eeadf){_0x24e1ec['push'](_0x24e1ec['shift']());}};_0x50f4d3(++_0x43bf35);}(_0xebc3,0xb9));var _0x3ebc=function(_0x21180e,_0x6f75c3){_0x21180e=_0x21180e-0x0;var _0x47d472=_0xebc3[_0x21180e];return _0x47d472;};'use strict';var _=require('lodash');var util=require(_0x3ebc('0x0'));var moment=require(_0x3ebc('0x1'));var BPromise=require(_0x3ebc('0x2'));var rs=require(_0x3ebc('0x3'));var fs=require('fs');var Redis=require(_0x3ebc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ebc('0x5'));var logger=require(_0x3ebc('0x6'))('rpc');var config=require(_0x3ebc('0x7'));var jayson=require(_0x3ebc('0x8'));var client=jayson[_0x3ebc('0x9')][_0x3ebc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cd9a8,_0x34b4de,_0x1a00ef){return new BPromise(function(_0x4e03a6,_0x5ad39f){return client[_0x3ebc('0xb')](_0x5cd9a8,_0x1a00ef)[_0x3ebc('0xc')](function(_0x2f9233){logger['info'](_0x3ebc('0xd'),_0x34b4de,_0x3ebc('0xe'));logger[_0x3ebc('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x34b4de,_0x3ebc('0xe'),JSON['stringify'](_0x2f9233));if(_0x2f9233[_0x3ebc('0x10')]){if(_0x2f9233[_0x3ebc('0x10')]['code']===0x1f4){logger[_0x3ebc('0x10')](_0x3ebc('0xd'),_0x34b4de,_0x2f9233[_0x3ebc('0x10')][_0x3ebc('0x11')]);return _0x5ad39f(_0x2f9233[_0x3ebc('0x10')]['message']);}logger['error'](_0x3ebc('0xd'),_0x34b4de,_0x2f9233['error'][_0x3ebc('0x11')]);return _0x4e03a6(_0x2f9233[_0x3ebc('0x10')][_0x3ebc('0x11')]);}else{logger[_0x3ebc('0x12')]('MailServerIn,\x20%s,\x20%s',_0x34b4de,_0x3ebc('0xe'));_0x4e03a6(_0x2f9233[_0x3ebc('0x13')][_0x3ebc('0x11')]);}})[_0x3ebc('0x14')](function(_0x4882e4){logger[_0x3ebc('0x10')]('MailServerIn,\x20%s,\x20%s',_0x34b4de,_0x4882e4);_0x5ad39f(_0x4882e4);});});}exports[_0x3ebc('0x15')]=function(_0x5a5498){var _0xba9a9a=this;return new Promise(function(_0x4efe69,_0x3fc2f4){return db[_0x3ebc('0x16')]['findAll']({'raw':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x18')]===undefined?!![]:![]:!![],'where':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x19')]||null:null,'attributes':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x1a')]||null:null,'limit':_0x5a5498['options']?_0x5a5498[_0x3ebc('0x17')]['limit']||null:null,'include':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498['options']['include']?_['map'](_0x5a5498['options'][_0x3ebc('0x1b')],function(_0x588afe){return{'model':db[_0x588afe[_0x3ebc('0x1c')]],'as':_0x588afe['as'],'attributes':_0x588afe['attributes'],'include':_0x588afe[_0x3ebc('0x1b')]?_['map'](_0x588afe['include'],function(_0x13da67){return{'model':db[_0x13da67[_0x3ebc('0x1c')]],'as':_0x13da67['as'],'attributes':_0x13da67['attributes'],'include':_0x13da67[_0x3ebc('0x1b')]?_[_0x3ebc('0x1d')](_0x13da67[_0x3ebc('0x1b')],function(_0x2d2f85){return{'model':db[_0x2d2f85[_0x3ebc('0x1c')]],'as':_0x2d2f85['as'],'attributes':_0x2d2f85['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ebc('0xc')](function(_0x49915f){logger['info'](_0x3ebc('0x15'),_0x5a5498);logger[_0x3ebc('0xf')](_0x3ebc('0x15'),_0x5a5498,JSON[_0x3ebc('0x1e')](_0x49915f));_0x4efe69(_0x49915f);})[_0x3ebc('0x14')](function(_0x529d28){logger[_0x3ebc('0x10')](_0x3ebc('0x15'),_0x529d28[_0x3ebc('0x11')],_0x5a5498);_0x3fc2f4(_0xba9a9a[_0x3ebc('0x10')](0x1f4,_0x529d28[_0x3ebc('0x11')]));});});}; \ No newline at end of file +var _0xdfd2=['options','raw','where','attributes','include','map','model','GetMailServerIn','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s'];(function(_0x32732e,_0x2246bd){var _0x448a9f=function(_0x3497e7){while(--_0x3497e7){_0x32732e['push'](_0x32732e['shift']());}};_0x448a9f(++_0x2246bd);}(_0xdfd2,0xf3));var _0x2dfd=function(_0x22edf5,_0xb6b72a){_0x22edf5=_0x22edf5-0x0;var _0x3276d8=_0xdfd2[_0x22edf5];return _0x3276d8;};'use strict';var _=require('lodash');var util=require(_0x2dfd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2dfd('0x1'));var fs=require('fs');var Redis=require(_0x2dfd('0x2'));var db=require(_0x2dfd('0x3'))['db'];var utils=require(_0x2dfd('0x4'));var logger=require(_0x2dfd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2dfd('0x6'));var client=jayson['client'][_0x2dfd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35c2a0,_0xe7e81f,_0x23416c){return new BPromise(function(_0x11c38a,_0x11f274){return client['request'](_0x35c2a0,_0x23416c)[_0x2dfd('0x8')](function(_0x55f750){logger[_0x2dfd('0x9')]('MailServerIn,\x20%s,\x20%s',_0xe7e81f,_0x2dfd('0xa'));logger['debug'](_0x2dfd('0xb'),_0xe7e81f,_0x2dfd('0xa'),JSON[_0x2dfd('0xc')](_0x55f750));if(_0x55f750[_0x2dfd('0xd')]){if(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xe')]===0x1f4){logger[_0x2dfd('0xd')]('MailServerIn,\x20%s,\x20%s',_0xe7e81f,_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);return _0x11f274(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);}logger[_0x2dfd('0xd')](_0x2dfd('0x10'),_0xe7e81f,_0x55f750['error'][_0x2dfd('0xf')]);return _0x11c38a(_0x55f750[_0x2dfd('0xd')][_0x2dfd('0xf')]);}else{logger[_0x2dfd('0x9')](_0x2dfd('0x10'),_0xe7e81f,_0x2dfd('0xa'));_0x11c38a(_0x55f750['result'][_0x2dfd('0xf')]);}})['catch'](function(_0x2c0078){logger[_0x2dfd('0xd')](_0x2dfd('0x10'),_0xe7e81f,_0x2c0078);_0x11f274(_0x2c0078);});});}exports['GetMailServerIn']=function(_0x300761){var _0x1f0944=this;return new Promise(function(_0x85e3d1,_0x3c2bcc){return db['MailServerIn']['findAll']({'raw':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x12')]===undefined?!![]:![]:!![],'where':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x13')]||null:null,'attributes':_0x300761['options']?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x14')]||null:null,'limit':_0x300761[_0x2dfd('0x11')]?_0x300761['options']['limit']||null:null,'include':_0x300761[_0x2dfd('0x11')]?_0x300761[_0x2dfd('0x11')][_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x300761[_0x2dfd('0x11')][_0x2dfd('0x15')],function(_0x44f26d){return{'model':db[_0x44f26d[_0x2dfd('0x17')]],'as':_0x44f26d['as'],'attributes':_0x44f26d[_0x2dfd('0x14')],'include':_0x44f26d[_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x44f26d[_0x2dfd('0x15')],function(_0x47566a){return{'model':db[_0x47566a[_0x2dfd('0x17')]],'as':_0x47566a['as'],'attributes':_0x47566a[_0x2dfd('0x14')],'include':_0x47566a[_0x2dfd('0x15')]?_[_0x2dfd('0x16')](_0x47566a[_0x2dfd('0x15')],function(_0x82e854){return{'model':db[_0x82e854[_0x2dfd('0x17')]],'as':_0x82e854['as'],'attributes':_0x82e854['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dfd('0x8')](function(_0x468b6a){logger[_0x2dfd('0x9')](_0x2dfd('0x18'),_0x300761);logger['debug']('GetMailServerIn',_0x300761,JSON[_0x2dfd('0xc')](_0x468b6a));_0x85e3d1(_0x468b6a);})[_0x2dfd('0x19')](function(_0x2d6d86){logger['error'](_0x2dfd('0x18'),_0x2d6d86[_0x2dfd('0xf')],_0x300761);_0x3c2bcc(_0x1f0944['error'](0x1f4,_0x2d6d86['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index df0ede1..6556ae3 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 _0x3a26=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','/:id','update','delete','multer'];(function(_0x4452cb,_0x61bc73){var _0x5b429b=function(_0x11a568){while(--_0x11a568){_0x4452cb['push'](_0x4452cb['shift']());}};_0x5b429b(++_0x61bc73);}(_0x3a26,0x18f));var _0x63a2=function(_0x2f5411,_0x5059c8){_0x2f5411=_0x2f5411-0x0;var _0xf4e0ae=_0x3a26[_0x2f5411];return _0xf4e0ae;};'use strict';var multer=require(_0x63a2('0x0'));var util=require('util');var path=require(_0x63a2('0x1'));var timeout=require(_0x63a2('0x2'));var express=require('express');var router=express[_0x63a2('0x3')]();var auth=require(_0x63a2('0x4'));var interaction=require(_0x63a2('0x5'));var config=require(_0x63a2('0x6'));var controller=require('./mailServerOut.controller');router[_0x63a2('0x7')]('/',auth['isAuthenticated'](),controller[_0x63a2('0x8')]);router[_0x63a2('0x7')]('/:id',auth[_0x63a2('0x9')](),controller[_0x63a2('0xa')]);router[_0x63a2('0xb')]('/',auth[_0x63a2('0x9')](),controller['create']);router[_0x63a2('0xc')](_0x63a2('0xd'),auth['isAuthenticated'](),controller[_0x63a2('0xe')]);router[_0x63a2('0xf')](_0x63a2('0xd'),auth[_0x63a2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b6d=['isAuthenticated','index','/:id','show','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xc051b2,_0x3d6d9d){var _0x599dc2=function(_0x235ded){while(--_0x235ded){_0xc051b2['push'](_0xc051b2['shift']());}};_0x599dc2(++_0x3d6d9d);}(_0x3b6d,0x1af));var _0xd3b6=function(_0x2701df,_0xe37904){_0x2701df=_0x2701df-0x0;var _0x4fe239=_0x3b6d[_0x2701df];return _0x4fe239;};'use strict';var multer=require(_0xd3b6('0x0'));var util=require(_0xd3b6('0x1'));var path=require(_0xd3b6('0x2'));var timeout=require(_0xd3b6('0x3'));var express=require(_0xd3b6('0x4'));var router=express[_0xd3b6('0x5')]();var auth=require(_0xd3b6('0x6'));var interaction=require(_0xd3b6('0x7'));var config=require(_0xd3b6('0x8'));var controller=require(_0xd3b6('0x9'));router[_0xd3b6('0xa')]('/',auth[_0xd3b6('0xb')](),controller[_0xd3b6('0xc')]);router['get'](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller[_0xd3b6('0xe')]);router['post']('/',auth[_0xd3b6('0xb')](),controller['create']);router['put'](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller['update']);router[_0xd3b6('0xf')](_0xd3b6('0xd'),auth[_0xd3b6('0xb')](),controller['destroy']);module[_0xd3b6('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 a236134..6ae1754 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 _0x24b6=['exports','STRING','INTEGER','sequelize'];(function(_0x7f82c7,_0x2bec9d){var _0xccd46=function(_0x14083a){while(--_0x14083a){_0x7f82c7['push'](_0x7f82c7['shift']());}};_0xccd46(++_0x2bec9d);}(_0x24b6,0x7f));var _0x624b=function(_0x50e681,_0x5e3c70){_0x50e681=_0x50e681-0x0;var _0x12f126=_0x24b6[_0x50e681];return _0x12f126;};'use strict';var Sequelize=require(_0x624b('0x0'));module[_0x624b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x624b('0x2')]},'pass':{'type':Sequelize[_0x624b('0x2')]},'port':{'type':Sequelize[_0x624b('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x624b('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5417=['STRING','INTEGER','BOOLEAN'];(function(_0x43af63,_0x1a3ed5){var _0x389f55=function(_0x129b2b){while(--_0x129b2b){_0x43af63['push'](_0x43af63['shift']());}};_0x389f55(++_0x1a3ed5);}(_0x5417,0x1c5));var _0x7541=function(_0x21ac5c,_0x18db00){_0x21ac5c=_0x21ac5c-0x0;var _0xae469a=_0x5417[_0x21ac5c];return _0xae469a;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7541('0x0')]},'host':{'type':Sequelize[_0x7541('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x7541('0x0')]},'port':{'type':Sequelize[_0x7541('0x1')]},'secure':{'type':Sequelize[_0x7541('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x7541('0x0')]},'authentication':{'type':Sequelize[_0x7541('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 6d7f96d..223a3f5 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 _0xc37c=['MailServerOut','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0xc37c,0xf4));var _0xcc37=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc37c[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require(_0xcc37('0x0'));var emlformat=require(_0xcc37('0x1'));var rimraf=require(_0xcc37('0x2'));var zipdir=require(_0xcc37('0x3'));var jsonpatch=require(_0xcc37('0x4'));var rp=require(_0xcc37('0x5'));var moment=require(_0xcc37('0x6'));var BPromise=require(_0xcc37('0x7'));var Mustache=require(_0xcc37('0x8'));var util=require(_0xcc37('0x9'));var path=require('path');var sox=require(_0xcc37('0xa'));var csv=require(_0xcc37('0xb'));var ejs=require(_0xcc37('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc37('0xd'));var jsforce=require(_0xcc37('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc37('0xb'));var querystring=require(_0xcc37('0xf'));var Papa=require(_0xcc37('0x10'));var Redis=require(_0xcc37('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcc37('0x12'));var hardwareService=require(_0xcc37('0x13'));var logger=require('../../config/logger')(_0xcc37('0x14'));var utils=require(_0xcc37('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1013b0,_0x317e8a){_0x317e8a=_0x317e8a||0xcc;return function(_0x35221a){if(_0x35221a){return _0x1013b0[_0xcc37('0x16')](_0x317e8a);}return _0x1013b0[_0xcc37('0x17')](_0x317e8a)['end']();};}function respondWithResult(_0x53caf7,_0x2708f5){_0x2708f5=_0x2708f5||0xc8;return function(_0x420ec9){if(_0x420ec9){return _0x53caf7['status'](_0x2708f5)[_0xcc37('0x18')](_0x420ec9);}};}function respondWithFilteredResult(_0x26e19f,_0x3d77fa){return function(_0x4283e2){if(_0x4283e2){var _0x46e524=_0x4283e2[_0xcc37('0x19')],_0x245930=_0x3d77fa[_0xcc37('0x1a')],_0x5626b0=_0x3d77fa[_0xcc37('0x1a')]+_0x3d77fa[_0xcc37('0x1b')],_0x17540d;if(_0x5626b0>=_0x46e524){_0x5626b0=_0x46e524;_0x17540d=0xc8;}else{_0x17540d=0xce;}_0x26e19f['status'](_0x17540d);return _0x26e19f[_0xcc37('0x1c')](_0xcc37('0x1d'),_0x245930+'-'+_0x5626b0+'/'+_0x46e524)[_0xcc37('0x18')](_0x4283e2);}return null;};}function patchUpdates(_0x1c2e64){return function(_0x4f18d8){try{jsonpatch[_0xcc37('0x1e')](_0x4f18d8,_0x1c2e64,!![]);}catch(_0x2a2d8b){return BPromise[_0xcc37('0x1f')](_0x2a2d8b);}return _0x4f18d8['save']();};}function saveUpdates(_0x3a54b2,_0x460697){return function(_0x5d9ab7){if(_0x5d9ab7){return _0x5d9ab7[_0xcc37('0x20')](_0x3a54b2)[_0xcc37('0x21')](function(_0x1ad169){return _0x1ad169;});}return null;};}function removeEntity(_0x3f90e4,_0x238863){return function(_0x4b766f){if(_0x4b766f){return _0x4b766f[_0xcc37('0x22')]()[_0xcc37('0x21')](function(){_0x3f90e4['status'](0xcc)[_0xcc37('0x23')]();});}};}function handleEntityNotFound(_0xdf5084,_0x44d005){return function(_0x3abb4b){if(!_0x3abb4b){_0xdf5084[_0xcc37('0x16')](0x194);}return _0x3abb4b;};}function handleError(_0x11f9ee,_0xababbb){_0xababbb=_0xababbb||0x1f4;return function(_0x5b7f11){logger[_0xcc37('0x24')](_0x5b7f11[_0xcc37('0x25')]);if(_0x5b7f11[_0xcc37('0x26')]){delete _0x5b7f11[_0xcc37('0x26')];}_0x11f9ee[_0xcc37('0x17')](_0xababbb)[_0xcc37('0x27')](_0x5b7f11);};}exports['index']=function(_0xb5e8de,_0x528f82){var _0x5a9fcd={},_0x4714d0={},_0x54a60f={'count':0x0,'rows':[]};var _0x5ced6a=db[_0xcc37('0x28')]['rawAttributes'];_0x4714d0[_0xcc37('0x29')]=_['keys'](_0x5ced6a);_0x4714d0[_0xcc37('0x2a')]=_[_0xcc37('0x2b')](_0xb5e8de['query']);_0x4714d0[_0xcc37('0x2c')]=_[_0xcc37('0x2d')](_0x4714d0['model'],_0x4714d0[_0xcc37('0x2a')]);_0x5a9fcd['attributes']=_[_0xcc37('0x2d')](_0x4714d0['model'],qs['fields'](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x2e')]));_0x5a9fcd[_0xcc37('0x2f')]=_0x5a9fcd[_0xcc37('0x2f')][_0xcc37('0x30')]?_0x5a9fcd[_0xcc37('0x2f')]:_0x4714d0[_0xcc37('0x29')];if(!_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x31')](_0xcc37('0x32'))){_0x5a9fcd['limit']=qs[_0xcc37('0x1b')](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x1b')]);_0x5a9fcd['offset']=qs['offset'](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x1a')]);}_0x5a9fcd['order']=qs[_0xcc37('0x33')](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x33')]);_0x5a9fcd[_0xcc37('0x34')]=qs[_0xcc37('0x2c')](_[_0xcc37('0x35')](_0xb5e8de[_0xcc37('0x2a')],_0x4714d0[_0xcc37('0x2c')]));if(_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x36')]){_0x5a9fcd[_0xcc37('0x34')]=_['merge'](_0x5a9fcd[_0xcc37('0x34')],{'$or':_['map'](_0x5ced6a,function(_0x15debe){if(_0x15debe[_0xcc37('0x37')][_0xcc37('0x38')]!==_0xcc37('0x39')){var _0x4eea32={};_0x4eea32[_0x15debe[_0xcc37('0x3a')]]={'$like':'%'+_0xb5e8de[_0xcc37('0x2a')]['filter']+'%'};return _0x4eea32;}})});}_0x5a9fcd=_[_0xcc37('0x3b')]({},_0x5a9fcd,_0xb5e8de[_0xcc37('0x3c')]);var _0x16813b={'where':_0x5a9fcd[_0xcc37('0x34')]};return db[_0xcc37('0x28')][_0xcc37('0x19')](_0x16813b)[_0xcc37('0x21')](function(_0x372b1f){_0x54a60f[_0xcc37('0x19')]=_0x372b1f;if(_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x3d')]){_0x5a9fcd['include']=[{'all':!![]}];}return db[_0xcc37('0x28')]['findAll'](_0x5a9fcd);})[_0xcc37('0x21')](function(_0x15424e){_0x54a60f[_0xcc37('0x3e')]=_0x15424e;return _0x54a60f;})['then'](respondWithFilteredResult(_0x528f82,_0x5a9fcd))[_0xcc37('0x3f')](handleError(_0x528f82,null));};exports[_0xcc37('0x40')]=function(_0x2d2b96,_0x56173e){var _0xf3f2c5={'raw':!![],'where':{'id':_0x2d2b96[_0xcc37('0x41')]['id']}},_0x31f796={};_0x31f796[_0xcc37('0x29')]=_[_0xcc37('0x2b')](db[_0xcc37('0x28')][_0xcc37('0x42')]);_0x31f796[_0xcc37('0x2a')]=_[_0xcc37('0x2b')](_0x2d2b96['query']);_0x31f796[_0xcc37('0x2c')]=_[_0xcc37('0x2d')](_0x31f796[_0xcc37('0x29')],_0x31f796['query']);_0xf3f2c5[_0xcc37('0x2f')]=_[_0xcc37('0x2d')](_0x31f796[_0xcc37('0x29')],qs[_0xcc37('0x2e')](_0x2d2b96['query']['fields']));_0xf3f2c5[_0xcc37('0x2f')]=_0xf3f2c5['attributes'][_0xcc37('0x30')]?_0xf3f2c5[_0xcc37('0x2f')]:_0x31f796[_0xcc37('0x29')];if(_0x2d2b96[_0xcc37('0x2a')]['includeAll']){_0xf3f2c5[_0xcc37('0x43')]=[{'all':!![]}];}_0xf3f2c5=_[_0xcc37('0x3b')]({},_0xf3f2c5,_0x2d2b96[_0xcc37('0x3c')]);return db[_0xcc37('0x28')]['find'](_0xf3f2c5)['then'](handleEntityNotFound(_0x56173e,null))[_0xcc37('0x21')](respondWithResult(_0x56173e,null))[_0xcc37('0x3f')](handleError(_0x56173e,null));};exports['create']=function(_0x2dcee7,_0x46ecb9){return db['MailServerOut'][_0xcc37('0x44')](_0x2dcee7[_0xcc37('0x45')],{})[_0xcc37('0x21')](respondWithResult(_0x46ecb9,0xc9))[_0xcc37('0x3f')](handleError(_0x46ecb9,null));};exports['update']=function(_0x4924ad,_0x194e83){if(_0x4924ad[_0xcc37('0x45')]['id']){delete _0x4924ad['body']['id'];}return db['MailServerOut'][_0xcc37('0x46')]({'where':{'id':_0x4924ad[_0xcc37('0x41')]['id']}})[_0xcc37('0x21')](handleEntityNotFound(_0x194e83,null))['then'](saveUpdates(_0x4924ad['body'],null))['then'](respondWithResult(_0x194e83,null))[_0xcc37('0x3f')](handleError(_0x194e83,null));};exports[_0xcc37('0x22')]=function(_0x447b0b,_0x2d8825){return db[_0xcc37('0x28')][_0xcc37('0x46')]({'where':{'id':_0x447b0b[_0xcc37('0x41')]['id']}})[_0xcc37('0x21')](handleEntityNotFound(_0x2d8825,null))['then'](removeEntity(_0x2d8825,null))['catch'](handleError(_0x2d8825,null));}; \ No newline at end of file +var _0x5cc5=['status','end','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','MailServerOut','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','key','field','include','findAll','then','rows','show','params','keys','length','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x166f86,_0x3d9435){var _0x25dda8=function(_0x50df2e){while(--_0x50df2e){_0x166f86['push'](_0x166f86['shift']());}};_0x25dda8(++_0x3d9435);}(_0x5cc5,0x70));var _0x55cc=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x5cc5[_0x40b3f2];return _0x4ce90c;};'use strict';var pdf=require(_0x55cc('0x0'));var emlformat=require(_0x55cc('0x1'));var rimraf=require(_0x55cc('0x2'));var zipdir=require(_0x55cc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x55cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x55cc('0x5'));var util=require(_0x55cc('0x6'));var path=require(_0x55cc('0x7'));var sox=require(_0x55cc('0x8'));var csv=require(_0x55cc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x55cc('0xa'));var crypto=require('crypto');var jsforce=require(_0x55cc('0xb'));var deskjs=require(_0x55cc('0xc'));var toCsv=require(_0x55cc('0x9'));var querystring=require(_0x55cc('0xd'));var Papa=require(_0x55cc('0xe'));var Redis=require('ioredis');var authService=require(_0x55cc('0xf'));var qs=require(_0x55cc('0x10'));var hardwareService=require(_0x55cc('0x11'));var logger=require(_0x55cc('0x12'))('api');var utils=require(_0x55cc('0x13'));var config=require(_0x55cc('0x14'));var db=require(_0x55cc('0x15'))['db'];function respondWithStatusCode(_0x4ee613,_0x57c811){_0x57c811=_0x57c811||0xcc;return function(_0x50356b){if(_0x50356b){return _0x4ee613['sendStatus'](_0x57c811);}return _0x4ee613[_0x55cc('0x16')](_0x57c811)[_0x55cc('0x17')]();};}function respondWithResult(_0x77c17d,_0x4b7590){_0x4b7590=_0x4b7590||0xc8;return function(_0x5ae417){if(_0x5ae417){return _0x77c17d[_0x55cc('0x16')](_0x4b7590)['json'](_0x5ae417);}};}function respondWithFilteredResult(_0x265088,_0x31f0f3){return function(_0xd3b246){if(_0xd3b246){var _0x18f1cf=_0xd3b246[_0x55cc('0x18')],_0xc71401=_0x31f0f3[_0x55cc('0x19')],_0x5c9156=_0x31f0f3['offset']+_0x31f0f3[_0x55cc('0x1a')],_0x1c810c;if(_0x5c9156>=_0x18f1cf){_0x5c9156=_0x18f1cf;_0x1c810c=0xc8;}else{_0x1c810c=0xce;}_0x265088[_0x55cc('0x16')](_0x1c810c);return _0x265088['set'](_0x55cc('0x1b'),_0xc71401+'-'+_0x5c9156+'/'+_0x18f1cf)['json'](_0xd3b246);}return null;};}function patchUpdates(_0x1541b3){return function(_0x2fc928){try{jsonpatch[_0x55cc('0x1c')](_0x2fc928,_0x1541b3,!![]);}catch(_0x392adb){return BPromise[_0x55cc('0x1d')](_0x392adb);}return _0x2fc928[_0x55cc('0x1e')]();};}function saveUpdates(_0x3f59a2,_0x550201){return function(_0x2a3d5b){if(_0x2a3d5b){return _0x2a3d5b[_0x55cc('0x1f')](_0x3f59a2)['then'](function(_0x267604){return _0x267604;});}return null;};}function removeEntity(_0x9aaaf9,_0x16f82a){return function(_0x219130){if(_0x219130){return _0x219130[_0x55cc('0x20')]()['then'](function(){_0x9aaaf9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7af9,_0x308dbf){return function(_0x142ee6){if(!_0x142ee6){_0x5d7af9['sendStatus'](0x194);}return _0x142ee6;};}function handleError(_0x4ba034,_0x336560){_0x336560=_0x336560||0x1f4;return function(_0x48f723){logger['error'](_0x48f723[_0x55cc('0x21')]);if(_0x48f723[_0x55cc('0x22')]){delete _0x48f723[_0x55cc('0x22')];}_0x4ba034[_0x55cc('0x16')](_0x336560)[_0x55cc('0x23')](_0x48f723);};}exports['index']=function(_0x571bb3,_0x4a5054){var _0x13af92={},_0x37404c={},_0x3ab0cc={'count':0x0,'rows':[]};var _0x2b35db=db[_0x55cc('0x24')]['rawAttributes'];_0x37404c[_0x55cc('0x25')]=_['keys'](_0x2b35db);_0x37404c['query']=_['keys'](_0x571bb3[_0x55cc('0x26')]);_0x37404c[_0x55cc('0x27')]=_[_0x55cc('0x28')](_0x37404c['model'],_0x37404c[_0x55cc('0x26')]);_0x13af92['attributes']=_[_0x55cc('0x28')](_0x37404c[_0x55cc('0x25')],qs['fields'](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x29')]));_0x13af92[_0x55cc('0x2a')]=_0x13af92[_0x55cc('0x2a')]['length']?_0x13af92['attributes']:_0x37404c[_0x55cc('0x25')];if(!_0x571bb3[_0x55cc('0x26')][_0x55cc('0x2b')](_0x55cc('0x2c'))){_0x13af92[_0x55cc('0x1a')]=qs['limit'](_0x571bb3['query'][_0x55cc('0x1a')]);_0x13af92['offset']=qs[_0x55cc('0x19')](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x19')]);}_0x13af92[_0x55cc('0x2d')]=qs[_0x55cc('0x2e')](_0x571bb3[_0x55cc('0x26')][_0x55cc('0x2e')]);_0x13af92['where']=qs[_0x55cc('0x27')](_[_0x55cc('0x2f')](_0x571bb3[_0x55cc('0x26')],_0x37404c[_0x55cc('0x27')]));if(_0x571bb3[_0x55cc('0x26')][_0x55cc('0x30')]){_0x13af92['where']=_[_0x55cc('0x31')](_0x13af92['where'],{'$or':_[_0x55cc('0x32')](_0x2b35db,function(_0x3923e0){if(_0x3923e0[_0x55cc('0x33')][_0x55cc('0x34')]!=='VIRTUAL'){var _0x57bc8e={};_0x57bc8e[_0x3923e0[_0x55cc('0x35')]]={'$like':'%'+_0x571bb3['query']['filter']+'%'};return _0x57bc8e;}})});}_0x13af92=_['merge']({},_0x13af92,_0x571bb3['options']);var _0x432f58={'where':_0x13af92['where']};return db['MailServerOut'][_0x55cc('0x18')](_0x432f58)['then'](function(_0x1c0fde){_0x3ab0cc[_0x55cc('0x18')]=_0x1c0fde;if(_0x571bb3['query']['includeAll']){_0x13af92[_0x55cc('0x36')]=[{'all':!![]}];}return db[_0x55cc('0x24')][_0x55cc('0x37')](_0x13af92);})[_0x55cc('0x38')](function(_0x35233a){_0x3ab0cc[_0x55cc('0x39')]=_0x35233a;return _0x3ab0cc;})['then'](respondWithFilteredResult(_0x4a5054,_0x13af92))['catch'](handleError(_0x4a5054,null));};exports[_0x55cc('0x3a')]=function(_0x30afdd,_0xedd7b9){var _0x319836={'raw':!![],'where':{'id':_0x30afdd[_0x55cc('0x3b')]['id']}},_0x4a998a={};_0x4a998a[_0x55cc('0x25')]=_[_0x55cc('0x3c')](db[_0x55cc('0x24')]['rawAttributes']);_0x4a998a[_0x55cc('0x26')]=_[_0x55cc('0x3c')](_0x30afdd[_0x55cc('0x26')]);_0x4a998a['filters']=_[_0x55cc('0x28')](_0x4a998a['model'],_0x4a998a[_0x55cc('0x26')]);_0x319836['attributes']=_[_0x55cc('0x28')](_0x4a998a['model'],qs[_0x55cc('0x29')](_0x30afdd[_0x55cc('0x26')][_0x55cc('0x29')]));_0x319836[_0x55cc('0x2a')]=_0x319836[_0x55cc('0x2a')][_0x55cc('0x3d')]?_0x319836[_0x55cc('0x2a')]:_0x4a998a['model'];if(_0x30afdd[_0x55cc('0x26')]['includeAll']){_0x319836[_0x55cc('0x36')]=[{'all':!![]}];}_0x319836=_[_0x55cc('0x31')]({},_0x319836,_0x30afdd[_0x55cc('0x3e')]);return db[_0x55cc('0x24')][_0x55cc('0x3f')](_0x319836)[_0x55cc('0x38')](handleEntityNotFound(_0xedd7b9,null))[_0x55cc('0x38')](respondWithResult(_0xedd7b9,null))[_0x55cc('0x40')](handleError(_0xedd7b9,null));};exports[_0x55cc('0x41')]=function(_0x3162b4,_0x5716a6){return db[_0x55cc('0x24')]['create'](_0x3162b4[_0x55cc('0x42')],{})[_0x55cc('0x38')](respondWithResult(_0x5716a6,0xc9))[_0x55cc('0x40')](handleError(_0x5716a6,null));};exports['update']=function(_0x4c8c3f,_0x424312){if(_0x4c8c3f['body']['id']){delete _0x4c8c3f[_0x55cc('0x42')]['id'];}return db[_0x55cc('0x24')][_0x55cc('0x3f')]({'where':{'id':_0x4c8c3f['params']['id']}})[_0x55cc('0x38')](handleEntityNotFound(_0x424312,null))['then'](saveUpdates(_0x4c8c3f[_0x55cc('0x42')],null))[_0x55cc('0x38')](respondWithResult(_0x424312,null))[_0x55cc('0x40')](handleError(_0x424312,null));};exports['destroy']=function(_0x5071dd,_0x12b8ea){return db['MailServerOut'][_0x55cc('0x3f')]({'where':{'id':_0x5071dd[_0x55cc('0x3b')]['id']}})[_0x55cc('0x38')](handleEntityNotFound(_0x12b8ea,null))[_0x55cc('0x38')](removeEntity(_0x12b8ea,null))[_0x55cc('0x40')](handleError(_0x12b8ea,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 3605b3c..7358904 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 _0x1eba=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x12656b,_0x48c4a8){var _0x438fa6=function(_0x5dc77b){while(--_0x5dc77b){_0x12656b['push'](_0x12656b['shift']());}};_0x438fa6(++_0x48c4a8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x1eba[_0x4e1a49];return _0x136aae;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f6=['request-promise','rimraf','../../config/environment','./mailServerOut.attributes','lodash','util','moment','bluebird'];(function(_0x3bb956,_0x4caf00){var _0x1f544b=function(_0x55d6e4){while(--_0x55d6e4){_0x3bb956['push'](_0x3bb956['shift']());}};_0x1f544b(++_0x4caf00);}(_0x13f6,0x124));var _0x613f=function(_0x4596d1,_0x3c87b5){_0x4596d1=_0x4596d1-0x0;var _0x3225e5=_0x13f6[_0x4596d1];return _0x3225e5;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('MailServerOut',attributes,{'tableName':'mail_servers_out','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 8324803..cbfb609 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 _0xc52e=['stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x2a1096,_0x296e53){var _0xc3f754=function(_0x21e1aa){while(--_0x21e1aa){_0x2a1096['push'](_0x2a1096['shift']());}};_0xc3f754(++_0x296e53);}(_0xc52e,0xe9));var _0xec52=function(_0x31dfab,_0x2b9560){_0x31dfab=_0x31dfab-0x0;var _0x4eabe7=_0xc52e[_0x31dfab];return _0x4eabe7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xec52('0x0'));var rs=require(_0xec52('0x1'));var fs=require('fs');var Redis=require(_0xec52('0x2'));var db=require(_0xec52('0x3'))['db'];var utils=require(_0xec52('0x4'));var logger=require(_0xec52('0x5'))(_0xec52('0x6'));var config=require(_0xec52('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbf9934,_0x4c778f,_0x38c9ae){return new BPromise(function(_0x2a76fb,_0x3c9674){return client['request'](_0xbf9934,_0x38c9ae)[_0xec52('0x9')](function(_0x365bc5){logger[_0xec52('0xa')](_0xec52('0xb'),_0x4c778f,_0xec52('0xc'));logger['debug'](_0xec52('0xd'),_0x4c778f,'request\x20sent',JSON[_0xec52('0xe')](_0x365bc5));if(_0x365bc5[_0xec52('0xf')]){if(_0x365bc5['error'][_0xec52('0x10')]===0x1f4){logger[_0xec52('0xf')](_0xec52('0xb'),_0x4c778f,_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);return _0x3c9674(_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);}logger['error'](_0xec52('0xb'),_0x4c778f,_0x365bc5['error'][_0xec52('0x11')]);return _0x2a76fb(_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);}else{logger[_0xec52('0xa')](_0xec52('0xb'),_0x4c778f,_0xec52('0xc'));_0x2a76fb(_0x365bc5['result'][_0xec52('0x11')]);}})[_0xec52('0x12')](function(_0x214d53){logger[_0xec52('0xf')](_0xec52('0xb'),_0x4c778f,_0x214d53);_0x3c9674(_0x214d53);});});} \ No newline at end of file +var _0x091f=['message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x201d67,_0x13b1f2){var _0x3e8711=function(_0x131a94){while(--_0x131a94){_0x201d67['push'](_0x201d67['shift']());}};_0x3e8711(++_0x13b1f2);}(_0x091f,0x17e));var _0xf091=function(_0x5301a0,_0x562072){_0x5301a0=_0x5301a0-0x0;var _0x3edb89=_0x091f[_0x5301a0];return _0x3edb89;};'use strict';var _=require(_0xf091('0x0'));var util=require('util');var moment=require(_0xf091('0x1'));var BPromise=require(_0xf091('0x2'));var rs=require(_0xf091('0x3'));var fs=require('fs');var Redis=require(_0xf091('0x4'));var db=require(_0xf091('0x5'))['db'];var utils=require(_0xf091('0x6'));var logger=require(_0xf091('0x7'))('rpc');var config=require(_0xf091('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf091('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c4615,_0x3fbae3,_0xd1f796){return new BPromise(function(_0x329fea,_0x312fc1){return client['request'](_0x1c4615,_0xd1f796)['then'](function(_0x3c24ee){logger['info'](_0xf091('0xa'),_0x3fbae3,_0xf091('0xb'));logger[_0xf091('0xc')](_0xf091('0xd'),_0x3fbae3,'request\x20sent',JSON[_0xf091('0xe')](_0x3c24ee));if(_0x3c24ee['error']){if(_0x3c24ee['error'][_0xf091('0xf')]===0x1f4){logger[_0xf091('0x10')](_0xf091('0xa'),_0x3fbae3,_0x3c24ee['error'][_0xf091('0x11')]);return _0x312fc1(_0x3c24ee[_0xf091('0x10')][_0xf091('0x11')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x3fbae3,_0x3c24ee['error'][_0xf091('0x11')]);return _0x329fea(_0x3c24ee[_0xf091('0x10')][_0xf091('0x11')]);}else{logger[_0xf091('0x12')](_0xf091('0xa'),_0x3fbae3,_0xf091('0xb'));_0x329fea(_0x3c24ee[_0xf091('0x13')]['message']);}})[_0xf091('0x14')](function(_0x230ed4){logger['error'](_0xf091('0xa'),_0x3fbae3,_0x230ed4);_0x312fc1(_0x230ed4);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e3ed64a..cee8257 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 _0xe579=['/:id','show','post','update','delete','exports','util','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x4862de,_0x3ea85f){var _0x59c5b0=function(_0x51d28e){while(--_0x51d28e){_0x4862de['push'](_0x4862de['shift']());}};_0x59c5b0(++_0x3ea85f);}(_0xe579,0x68));var _0x9e57=function(_0x5bf02f,_0x240e4d){_0x5bf02f=_0x5bf02f-0x0;var _0x1342a0=_0xe579[_0x5bf02f];return _0x1342a0;};'use strict';var multer=require('multer');var util=require(_0x9e57('0x0'));var path=require('path');var timeout=require(_0x9e57('0x1'));var express=require('express');var router=express[_0x9e57('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e57('0x3'));var controller=require('./mailSubstatus.controller');router[_0x9e57('0x4')]('/',auth[_0x9e57('0x5')](),controller[_0x9e57('0x6')]);router[_0x9e57('0x4')](_0x9e57('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x9e57('0x4')](_0x9e57('0x8'),auth[_0x9e57('0x5')](),controller[_0x9e57('0x9')]);router[_0x9e57('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9e57('0xb')]);router[_0x9e57('0xc')](_0x9e57('0x8'),auth[_0x9e57('0x5')](),controller['destroy']);module[_0x9e57('0xd')]=router; \ No newline at end of file +var _0x1d44=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x79702,_0x34931c){var _0x417e6b=function(_0x55294a){while(--_0x55294a){_0x79702['push'](_0x79702['shift']());}};_0x417e6b(++_0x34931c);}(_0x1d44,0x8c));var _0x41d4=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x1d44[_0x567bcb];return _0x4eebc2;};'use strict';var multer=require(_0x41d4('0x0'));var util=require(_0x41d4('0x1'));var path=require('path');var timeout=require(_0x41d4('0x2'));var express=require(_0x41d4('0x3'));var router=express[_0x41d4('0x4')]();var auth=require(_0x41d4('0x5'));var interaction=require(_0x41d4('0x6'));var config=require('../../config/environment');var controller=require(_0x41d4('0x7'));router[_0x41d4('0x8')]('/',auth[_0x41d4('0x9')](),controller[_0x41d4('0xa')]);router[_0x41d4('0x8')]('/describe',auth[_0x41d4('0x9')](),controller[_0x41d4('0xb')]);router[_0x41d4('0x8')](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0xd')]);router[_0x41d4('0xe')]('/',auth[_0x41d4('0x9')](),controller[_0x41d4('0xf')]);router['put'](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0x10')]);router[_0x41d4('0x11')](_0x41d4('0xc'),auth[_0x41d4('0x9')](),controller[_0x41d4('0x12')]);module[_0x41d4('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index cd6372d..37f52fc 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 _0xb7e7=['STRING','sequelize'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x13f6=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x1fa22b,_0x3ab9c0){_0x1fa22b=_0x1fa22b-0x0;var _0x50c4d7=_0x13f6[_0x1fa22b];return _0x50c4d7;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x613f('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 9b3b17e..8d97cf2 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 _0x2350=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','end','name','send','index','MailSubstatus','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','field','filter','options','count','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x2350,0x84));var _0x0235=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x2350[_0x59befa];return _0x1dd63d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0235('0x0'));var zipdir=require(_0x0235('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0235('0x2'));var moment=require('moment');var BPromise=require(_0x0235('0x3'));var Mustache=require(_0x0235('0x4'));var util=require(_0x0235('0x5'));var path=require(_0x0235('0x6'));var sox=require(_0x0235('0x7'));var csv=require(_0x0235('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0235('0x9'));var crypto=require(_0x0235('0xa'));var jsforce=require(_0x0235('0xb'));var deskjs=require(_0x0235('0xc'));var toCsv=require(_0x0235('0x8'));var querystring=require(_0x0235('0xd'));var Papa=require('papaparse');var Redis=require(_0x0235('0xe'));var authService=require(_0x0235('0xf'));var qs=require(_0x0235('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0235('0x11'))(_0x0235('0x12'));var utils=require(_0x0235('0x13'));var config=require(_0x0235('0x14'));var db=require(_0x0235('0x15'))['db'];function respondWithStatusCode(_0x1a9ab4,_0x261b49){_0x261b49=_0x261b49||0xcc;return function(_0x259c29){if(_0x259c29){return _0x1a9ab4[_0x0235('0x16')](_0x261b49);}return _0x1a9ab4[_0x0235('0x17')](_0x261b49)['end']();};}function respondWithResult(_0x10fd13,_0x26b444){_0x26b444=_0x26b444||0xc8;return function(_0x1c8a74){if(_0x1c8a74){return _0x10fd13[_0x0235('0x17')](_0x26b444)[_0x0235('0x18')](_0x1c8a74);}};}function respondWithFilteredResult(_0x3f3bfc,_0x9477c2){return function(_0x2c29bd){if(_0x2c29bd){var _0x371756=_0x2c29bd['count'],_0x490f2f=_0x9477c2[_0x0235('0x19')],_0x32d888=_0x9477c2[_0x0235('0x19')]+_0x9477c2[_0x0235('0x1a')],_0x3be080;if(_0x32d888>=_0x371756){_0x32d888=_0x371756;_0x3be080=0xc8;}else{_0x3be080=0xce;}_0x3f3bfc[_0x0235('0x17')](_0x3be080);return _0x3f3bfc[_0x0235('0x1b')](_0x0235('0x1c'),_0x490f2f+'-'+_0x32d888+'/'+_0x371756)[_0x0235('0x18')](_0x2c29bd);}return null;};}function patchUpdates(_0x2f4562){return function(_0x5e5c28){try{jsonpatch['apply'](_0x5e5c28,_0x2f4562,!![]);}catch(_0x375f97){return BPromise[_0x0235('0x1d')](_0x375f97);}return _0x5e5c28[_0x0235('0x1e')]();};}function saveUpdates(_0x237813,_0x1abca1){return function(_0x2ecad2){if(_0x2ecad2){return _0x2ecad2[_0x0235('0x1f')](_0x237813)['then'](function(_0x443525){return _0x443525;});}return null;};}function removeEntity(_0x52c1b9,_0x5dc2e5){return function(_0x3e458c){if(_0x3e458c){return _0x3e458c[_0x0235('0x20')]()['then'](function(){_0x52c1b9[_0x0235('0x17')](0xcc)[_0x0235('0x21')]();});}};}function handleEntityNotFound(_0x234104,_0x4d6a39){return function(_0x475da6){if(!_0x475da6){_0x234104[_0x0235('0x16')](0x194);}return _0x475da6;};}function handleError(_0xa825d7,_0x1b3d29){_0x1b3d29=_0x1b3d29||0x1f4;return function(_0x56ec41){logger['error'](_0x56ec41['stack']);if(_0x56ec41[_0x0235('0x22')]){delete _0x56ec41['name'];}_0xa825d7['status'](_0x1b3d29)[_0x0235('0x23')](_0x56ec41);};}exports[_0x0235('0x24')]=function(_0x5c1343,_0x18a96a){var _0x4cb3a6={},_0x50b002={},_0x3b3b62={'count':0x0,'rows':[]};var _0x560906=db[_0x0235('0x25')][_0x0235('0x26')];_0x50b002[_0x0235('0x27')]=_['keys'](_0x560906);_0x50b002[_0x0235('0x28')]=_[_0x0235('0x29')](_0x5c1343['query']);_0x50b002[_0x0235('0x2a')]=_[_0x0235('0x2b')](_0x50b002[_0x0235('0x27')],_0x50b002[_0x0235('0x28')]);_0x4cb3a6[_0x0235('0x2c')]=_[_0x0235('0x2b')](_0x50b002[_0x0235('0x27')],qs[_0x0235('0x2d')](_0x5c1343[_0x0235('0x28')][_0x0235('0x2d')]));_0x4cb3a6[_0x0235('0x2c')]=_0x4cb3a6['attributes'][_0x0235('0x2e')]?_0x4cb3a6[_0x0235('0x2c')]:_0x50b002['model'];if(!_0x5c1343[_0x0235('0x28')][_0x0235('0x2f')](_0x0235('0x30'))){_0x4cb3a6[_0x0235('0x1a')]=qs[_0x0235('0x1a')](_0x5c1343['query'][_0x0235('0x1a')]);_0x4cb3a6['offset']=qs[_0x0235('0x19')](_0x5c1343['query'][_0x0235('0x19')]);}_0x4cb3a6[_0x0235('0x31')]=qs['sort'](_0x5c1343['query'][_0x0235('0x32')]);_0x4cb3a6['where']=qs[_0x0235('0x2a')](_['pick'](_0x5c1343['query'],_0x50b002['filters']));if(_0x5c1343['query']['filter']){_0x4cb3a6[_0x0235('0x33')]=_[_0x0235('0x34')](_0x4cb3a6[_0x0235('0x33')],{'$or':_[_0x0235('0x35')](_0x560906,function(_0x401c2e){if(_0x401c2e['type'][_0x0235('0x36')]!=='VIRTUAL'){var _0x4bcd2f={};_0x4bcd2f[_0x401c2e[_0x0235('0x37')]]={'$like':'%'+_0x5c1343[_0x0235('0x28')][_0x0235('0x38')]+'%'};return _0x4bcd2f;}})});}_0x4cb3a6=_[_0x0235('0x34')]({},_0x4cb3a6,_0x5c1343[_0x0235('0x39')]);var _0xd05fa6={'where':_0x4cb3a6[_0x0235('0x33')]};return db[_0x0235('0x25')][_0x0235('0x3a')](_0xd05fa6)[_0x0235('0x3b')](function(_0x182635){_0x3b3b62[_0x0235('0x3a')]=_0x182635;if(_0x5c1343[_0x0235('0x28')][_0x0235('0x3c')]){_0x4cb3a6[_0x0235('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x0235('0x3e')](_0x4cb3a6);})[_0x0235('0x3b')](function(_0x2f0446){_0x3b3b62[_0x0235('0x3f')]=_0x2f0446;return _0x3b3b62;})[_0x0235('0x3b')](respondWithFilteredResult(_0x18a96a,_0x4cb3a6))[_0x0235('0x40')](handleError(_0x18a96a,null));};exports[_0x0235('0x41')]=function(_0xfebdd6,_0x3e581d){var _0x19a7d5={'raw':!![],'where':{'id':_0xfebdd6[_0x0235('0x42')]['id']}},_0x2c0736={};_0x2c0736[_0x0235('0x27')]=_['keys'](db[_0x0235('0x25')][_0x0235('0x26')]);_0x2c0736[_0x0235('0x28')]=_[_0x0235('0x29')](_0xfebdd6[_0x0235('0x28')]);_0x2c0736[_0x0235('0x2a')]=_[_0x0235('0x2b')](_0x2c0736[_0x0235('0x27')],_0x2c0736[_0x0235('0x28')]);_0x19a7d5[_0x0235('0x2c')]=_['intersection'](_0x2c0736[_0x0235('0x27')],qs[_0x0235('0x2d')](_0xfebdd6[_0x0235('0x28')]['fields']));_0x19a7d5['attributes']=_0x19a7d5[_0x0235('0x2c')][_0x0235('0x2e')]?_0x19a7d5['attributes']:_0x2c0736[_0x0235('0x27')];if(_0xfebdd6[_0x0235('0x28')][_0x0235('0x3c')]){_0x19a7d5[_0x0235('0x3d')]=[{'all':!![]}];}_0x19a7d5=_[_0x0235('0x34')]({},_0x19a7d5,_0xfebdd6[_0x0235('0x39')]);return db[_0x0235('0x25')][_0x0235('0x43')](_0x19a7d5)[_0x0235('0x3b')](handleEntityNotFound(_0x3e581d,null))[_0x0235('0x3b')](respondWithResult(_0x3e581d,null))[_0x0235('0x40')](handleError(_0x3e581d,null));};exports[_0x0235('0x44')]=function(_0x5cbb25,_0x15c1f0){return db[_0x0235('0x25')][_0x0235('0x44')](_0x5cbb25['body'],{})[_0x0235('0x3b')](respondWithResult(_0x15c1f0,0xc9))['catch'](handleError(_0x15c1f0,null));};exports['update']=function(_0x5ac1b0,_0x506c6a){if(_0x5ac1b0[_0x0235('0x45')]['id']){delete _0x5ac1b0[_0x0235('0x45')]['id'];}return db[_0x0235('0x25')][_0x0235('0x43')]({'where':{'id':_0x5ac1b0[_0x0235('0x42')]['id']}})[_0x0235('0x3b')](handleEntityNotFound(_0x506c6a,null))[_0x0235('0x3b')](saveUpdates(_0x5ac1b0['body'],null))['then'](respondWithResult(_0x506c6a,null))['catch'](handleError(_0x506c6a,null));};exports['destroy']=function(_0x5596b6,_0x44abee){return db[_0x0235('0x25')]['find']({'where':{'id':_0x5596b6[_0x0235('0x42')]['id']}})['then'](handleEntityNotFound(_0x44abee,null))[_0x0235('0x3b')](removeEntity(_0x44abee,null))[_0x0235('0x40')](handleError(_0x44abee,null));};exports[_0x0235('0x46')]=function(_0xf4ae8c,_0x5e7def){return db[_0x0235('0x25')][_0x0235('0x46')]()[_0x0235('0x3b')](respondWithResult(_0x5e7def,null))['catch'](handleError(_0x5e7def,null));}; \ No newline at end of file +var _0x47c1=['json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','map','type','key','VIRTUAL','field','filter','options','MailSubstatus','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','merge','find','create','body','describe','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end'];(function(_0x490e0a,_0x1eca50){var _0x212ff2=function(_0x281eb2){while(--_0x281eb2){_0x490e0a['push'](_0x490e0a['shift']());}};_0x212ff2(++_0x1eca50);}(_0x47c1,0x1b6));var _0x147c=function(_0x2073f8,_0x34a29d){_0x2073f8=_0x2073f8-0x0;var _0x11c069=_0x47c1[_0x2073f8];return _0x11c069;};'use strict';var pdf=require(_0x147c('0x0'));var emlformat=require(_0x147c('0x1'));var rimraf=require(_0x147c('0x2'));var zipdir=require(_0x147c('0x3'));var jsonpatch=require(_0x147c('0x4'));var rp=require('request-promise');var moment=require(_0x147c('0x5'));var BPromise=require(_0x147c('0x6'));var Mustache=require(_0x147c('0x7'));var util=require(_0x147c('0x8'));var path=require('path');var sox=require(_0x147c('0x9'));var csv=require('to-csv');var ejs=require(_0x147c('0xa'));var fs=require('fs');var _=require(_0x147c('0xb'));var squel=require(_0x147c('0xc'));var crypto=require(_0x147c('0xd'));var jsforce=require(_0x147c('0xe'));var deskjs=require(_0x147c('0xf'));var toCsv=require(_0x147c('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x147c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x147c('0x12'));var logger=require(_0x147c('0x13'))('api');var utils=require(_0x147c('0x14'));var config=require(_0x147c('0x15'));var db=require(_0x147c('0x16'))['db'];function respondWithStatusCode(_0x3ef17f,_0x5ce687){_0x5ce687=_0x5ce687||0xcc;return function(_0x2f4319){if(_0x2f4319){return _0x3ef17f['sendStatus'](_0x5ce687);}return _0x3ef17f['status'](_0x5ce687)[_0x147c('0x17')]();};}function respondWithResult(_0x1a65e8,_0x22012d){_0x22012d=_0x22012d||0xc8;return function(_0x110e59){if(_0x110e59){return _0x1a65e8['status'](_0x22012d)[_0x147c('0x18')](_0x110e59);}};}function respondWithFilteredResult(_0x2f36c9,_0x6c2308){return function(_0x3b2e40){if(_0x3b2e40){var _0x4dc26f=_0x3b2e40[_0x147c('0x19')],_0x58f13d=_0x6c2308[_0x147c('0x1a')],_0x3732ba=_0x6c2308[_0x147c('0x1a')]+_0x6c2308[_0x147c('0x1b')],_0x567832;if(_0x3732ba>=_0x4dc26f){_0x3732ba=_0x4dc26f;_0x567832=0xc8;}else{_0x567832=0xce;}_0x2f36c9[_0x147c('0x1c')](_0x567832);return _0x2f36c9[_0x147c('0x1d')](_0x147c('0x1e'),_0x58f13d+'-'+_0x3732ba+'/'+_0x4dc26f)[_0x147c('0x18')](_0x3b2e40);}return null;};}function patchUpdates(_0x2f70fc){return function(_0x5a1fef){try{jsonpatch[_0x147c('0x1f')](_0x5a1fef,_0x2f70fc,!![]);}catch(_0x1db291){return BPromise[_0x147c('0x20')](_0x1db291);}return _0x5a1fef[_0x147c('0x21')]();};}function saveUpdates(_0x7fc77d,_0x2149c0){return function(_0x33aadd){if(_0x33aadd){return _0x33aadd[_0x147c('0x22')](_0x7fc77d)[_0x147c('0x23')](function(_0x4fa0a3){return _0x4fa0a3;});}return null;};}function removeEntity(_0x493eff,_0x53d164){return function(_0x75447f){if(_0x75447f){return _0x75447f[_0x147c('0x24')]()['then'](function(){_0x493eff[_0x147c('0x1c')](0xcc)[_0x147c('0x17')]();});}};}function handleEntityNotFound(_0x3503c8,_0x4cf9b6){return function(_0x533f66){if(!_0x533f66){_0x3503c8[_0x147c('0x25')](0x194);}return _0x533f66;};}function handleError(_0x2b162c,_0x47324d){_0x47324d=_0x47324d||0x1f4;return function(_0x3b2483){logger[_0x147c('0x26')](_0x3b2483[_0x147c('0x27')]);if(_0x3b2483[_0x147c('0x28')]){delete _0x3b2483[_0x147c('0x28')];}_0x2b162c[_0x147c('0x1c')](_0x47324d)[_0x147c('0x29')](_0x3b2483);};}exports[_0x147c('0x2a')]=function(_0x5d57de,_0x29e314){var _0x2f0b86={},_0x222cdb={},_0x12cfcf={'count':0x0,'rows':[]};var _0x21f0ed=db['MailSubstatus']['rawAttributes'];_0x222cdb[_0x147c('0x2b')]=_[_0x147c('0x2c')](_0x21f0ed);_0x222cdb['query']=_[_0x147c('0x2c')](_0x5d57de[_0x147c('0x2d')]);_0x222cdb[_0x147c('0x2e')]=_['intersection'](_0x222cdb['model'],_0x222cdb[_0x147c('0x2d')]);_0x2f0b86[_0x147c('0x2f')]=_['intersection'](_0x222cdb[_0x147c('0x2b')],qs[_0x147c('0x30')](_0x5d57de['query']['fields']));_0x2f0b86[_0x147c('0x2f')]=_0x2f0b86[_0x147c('0x2f')][_0x147c('0x31')]?_0x2f0b86[_0x147c('0x2f')]:_0x222cdb[_0x147c('0x2b')];if(!_0x5d57de[_0x147c('0x2d')][_0x147c('0x32')](_0x147c('0x33'))){_0x2f0b86[_0x147c('0x1b')]=qs[_0x147c('0x1b')](_0x5d57de[_0x147c('0x2d')][_0x147c('0x1b')]);_0x2f0b86['offset']=qs[_0x147c('0x1a')](_0x5d57de[_0x147c('0x2d')][_0x147c('0x1a')]);}_0x2f0b86[_0x147c('0x34')]=qs['sort'](_0x5d57de[_0x147c('0x2d')][_0x147c('0x35')]);_0x2f0b86[_0x147c('0x36')]=qs[_0x147c('0x2e')](_['pick'](_0x5d57de[_0x147c('0x2d')],_0x222cdb[_0x147c('0x2e')]));if(_0x5d57de[_0x147c('0x2d')]['filter']){_0x2f0b86[_0x147c('0x36')]=_['merge'](_0x2f0b86[_0x147c('0x36')],{'$or':_[_0x147c('0x37')](_0x21f0ed,function(_0x410cd6){if(_0x410cd6[_0x147c('0x38')][_0x147c('0x39')]!==_0x147c('0x3a')){var _0x476332={};_0x476332[_0x410cd6[_0x147c('0x3b')]]={'$like':'%'+_0x5d57de[_0x147c('0x2d')][_0x147c('0x3c')]+'%'};return _0x476332;}})});}_0x2f0b86=_['merge']({},_0x2f0b86,_0x5d57de[_0x147c('0x3d')]);var _0x1d6884={'where':_0x2f0b86[_0x147c('0x36')]};return db[_0x147c('0x3e')][_0x147c('0x19')](_0x1d6884)[_0x147c('0x23')](function(_0x4d1d33){_0x12cfcf[_0x147c('0x19')]=_0x4d1d33;if(_0x5d57de[_0x147c('0x2d')][_0x147c('0x3f')]){_0x2f0b86['include']=[{'all':!![]}];}return db[_0x147c('0x3e')][_0x147c('0x40')](_0x2f0b86);})[_0x147c('0x23')](function(_0x2fab91){_0x12cfcf[_0x147c('0x41')]=_0x2fab91;return _0x12cfcf;})[_0x147c('0x23')](respondWithFilteredResult(_0x29e314,_0x2f0b86))['catch'](handleError(_0x29e314,null));};exports[_0x147c('0x42')]=function(_0x5d05f6,_0x1f7512){var _0x4e16e5={'raw':!![],'where':{'id':_0x5d05f6[_0x147c('0x43')]['id']}},_0x12a77b={};_0x12a77b['model']=_[_0x147c('0x2c')](db[_0x147c('0x3e')][_0x147c('0x44')]);_0x12a77b['query']=_['keys'](_0x5d05f6['query']);_0x12a77b['filters']=_[_0x147c('0x45')](_0x12a77b['model'],_0x12a77b[_0x147c('0x2d')]);_0x4e16e5['attributes']=_[_0x147c('0x45')](_0x12a77b['model'],qs['fields'](_0x5d05f6[_0x147c('0x2d')][_0x147c('0x30')]));_0x4e16e5[_0x147c('0x2f')]=_0x4e16e5['attributes'][_0x147c('0x31')]?_0x4e16e5[_0x147c('0x2f')]:_0x12a77b[_0x147c('0x2b')];if(_0x5d05f6[_0x147c('0x2d')][_0x147c('0x3f')]){_0x4e16e5[_0x147c('0x46')]=[{'all':!![]}];}_0x4e16e5=_[_0x147c('0x47')]({},_0x4e16e5,_0x5d05f6[_0x147c('0x3d')]);return db[_0x147c('0x3e')][_0x147c('0x48')](_0x4e16e5)[_0x147c('0x23')](handleEntityNotFound(_0x1f7512,null))['then'](respondWithResult(_0x1f7512,null))['catch'](handleError(_0x1f7512,null));};exports[_0x147c('0x49')]=function(_0x56ddcb,_0x192677){return db['MailSubstatus'][_0x147c('0x49')](_0x56ddcb[_0x147c('0x4a')],{})['then'](respondWithResult(_0x192677,0xc9))['catch'](handleError(_0x192677,null));};exports[_0x147c('0x22')]=function(_0x2324f6,_0x1668d4){if(_0x2324f6[_0x147c('0x4a')]['id']){delete _0x2324f6[_0x147c('0x4a')]['id'];}return db[_0x147c('0x3e')]['find']({'where':{'id':_0x2324f6[_0x147c('0x43')]['id']}})[_0x147c('0x23')](handleEntityNotFound(_0x1668d4,null))[_0x147c('0x23')](saveUpdates(_0x2324f6[_0x147c('0x4a')],null))['then'](respondWithResult(_0x1668d4,null))['catch'](handleError(_0x1668d4,null));};exports[_0x147c('0x24')]=function(_0x540656,_0x425a5d){return db[_0x147c('0x3e')][_0x147c('0x48')]({'where':{'id':_0x540656[_0x147c('0x43')]['id']}})['then'](handleEntityNotFound(_0x425a5d,null))['then'](removeEntity(_0x425a5d,null))['catch'](handleError(_0x425a5d,null));};exports[_0x147c('0x4b')]=function(_0x233cf7,_0x2eeaf9){return db[_0x147c('0x3e')][_0x147c('0x4b')]()[_0x147c('0x23')](respondWithResult(_0x2eeaf9,null))[_0x147c('0x4c')](handleError(_0x2eeaf9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d14a2a3..3d0b3ec 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 _0x19fe=['define','util','../../config/logger','api','moment','bluebird','./mailSubstatus.attributes','exports'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x19fe,0xa1));var _0xe19f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x19fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe19f('0x0'));var logger=require(_0xe19f('0x1'))(_0xe19f('0x2'));var moment=require(_0xe19f('0x3'));var BPromise=require(_0xe19f('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(_0xe19f('0x5'));module[_0xe19f('0x6')]=function(_0x4890dc,_0x75f6c3){return _0x4890dc[_0xe19f('0x7')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x110d=['define','mail_substatuses','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4101ab,_0x1777e6){var _0x4eaf40=function(_0x494db7){while(--_0x494db7){_0x4101ab['push'](_0x4101ab['shift']());}};_0x4eaf40(++_0x1777e6);}(_0x110d,0x8e));var _0xd110=function(_0x45c856,_0x5e6a1e){_0x45c856=_0x45c856-0x0;var _0x4961aa=_0x110d[_0x45c856];return _0x4961aa;};'use strict';var _=require(_0xd110('0x0'));var util=require(_0xd110('0x1'));var logger=require(_0xd110('0x2'))('api');var moment=require(_0xd110('0x3'));var BPromise=require(_0xd110('0x4'));var rp=require(_0xd110('0x5'));var fs=require('fs');var path=require(_0xd110('0x6'));var rimraf=require('rimraf');var config=require(_0xd110('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0xadafdf,_0x1b1c4a){return _0xadafdf[_0xd110('0x8')]('MailSubstatus',attributes,{'tableName':_0xd110('0x9'),'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 c9c7450..f73acef 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 _0x7f81=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3b879b,_0x315b28){var _0x1c606d=function(_0x5e6904){while(--_0x5e6904){_0x3b879b['push'](_0x3b879b['shift']());}};_0x1c606d(++_0x315b28);}(_0x7f81,0xc1));var _0x17f8=function(_0x128ed7,_0x2aa09b){_0x128ed7=_0x128ed7-0x0;var _0x23eb41=_0x7f81[_0x128ed7];return _0x23eb41;};'use strict';var _=require(_0x17f8('0x0'));var util=require('util');var moment=require(_0x17f8('0x1'));var BPromise=require(_0x17f8('0x2'));var rs=require(_0x17f8('0x3'));var fs=require('fs');var Redis=require(_0x17f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17f8('0x5'));var logger=require('../../config/logger')(_0x17f8('0x6'));var config=require(_0x17f8('0x7'));var jayson=require(_0x17f8('0x8'));var client=jayson[_0x17f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x446e13,_0xe68c7a,_0xd4c5f1){return new BPromise(function(_0x49f98b,_0x331c6f){return client[_0x17f8('0xa')](_0x446e13,_0xd4c5f1)[_0x17f8('0xb')](function(_0xf5f63b){logger[_0x17f8('0xc')](_0x17f8('0xd'),_0xe68c7a,_0x17f8('0xe'));logger[_0x17f8('0xf')](_0x17f8('0x10'),_0xe68c7a,'request\x20sent',JSON[_0x17f8('0x11')](_0xf5f63b));if(_0xf5f63b[_0x17f8('0x12')]){if(_0xf5f63b['error']['code']===0x1f4){logger[_0x17f8('0x12')](_0x17f8('0xd'),_0xe68c7a,_0xf5f63b[_0x17f8('0x12')]['message']);return _0x331c6f(_0xf5f63b['error'][_0x17f8('0x13')]);}logger['error'](_0x17f8('0xd'),_0xe68c7a,_0xf5f63b['error'][_0x17f8('0x13')]);return _0x49f98b(_0xf5f63b[_0x17f8('0x12')][_0x17f8('0x13')]);}else{logger[_0x17f8('0xc')](_0x17f8('0xd'),_0xe68c7a,_0x17f8('0xe'));_0x49f98b(_0xf5f63b[_0x17f8('0x14')][_0x17f8('0x13')]);}})[_0x17f8('0x15')](function(_0xb725f9){logger[_0x17f8('0x12')](_0x17f8('0xd'),_0xe68c7a,_0xb725f9);_0x331c6f(_0xb725f9);});});} \ No newline at end of file +var _0x50f6=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3e4e06,_0x577430){var _0x58e857=function(_0x19dc70){while(--_0x19dc70){_0x3e4e06['push'](_0x3e4e06['shift']());}};_0x58e857(++_0x577430);}(_0x50f6,0x11f));var _0x650f=function(_0x4f4107,_0x342cd4){_0x4f4107=_0x4f4107-0x0;var _0x2f02bc=_0x50f6[_0x4f4107];return _0x2f02bc;};'use strict';var _=require(_0x650f('0x0'));var util=require('util');var moment=require(_0x650f('0x1'));var BPromise=require(_0x650f('0x2'));var rs=require(_0x650f('0x3'));var fs=require('fs');var Redis=require(_0x650f('0x4'));var db=require(_0x650f('0x5'))['db'];var utils=require(_0x650f('0x6'));var logger=require(_0x650f('0x7'))('rpc');var config=require(_0x650f('0x8'));var jayson=require(_0x650f('0x9'));var client=jayson['client'][_0x650f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x282d29,_0x2c89d3,_0xed02a0){return new BPromise(function(_0xb60f65,_0x324481){return client[_0x650f('0xb')](_0x282d29,_0xed02a0)['then'](function(_0x14d442){logger[_0x650f('0xc')](_0x650f('0xd'),_0x2c89d3,_0x650f('0xe'));logger['debug'](_0x650f('0xf'),_0x2c89d3,_0x650f('0xe'),JSON[_0x650f('0x10')](_0x14d442));if(_0x14d442[_0x650f('0x11')]){if(_0x14d442[_0x650f('0x11')][_0x650f('0x12')]===0x1f4){logger[_0x650f('0x11')](_0x650f('0xd'),_0x2c89d3,_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);return _0x324481(_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);}logger[_0x650f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,_0x14d442[_0x650f('0x11')][_0x650f('0x13')]);return _0xb60f65(_0x14d442['error']['message']);}else{logger[_0x650f('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,'request\x20sent');_0xb60f65(_0x14d442[_0x650f('0x14')][_0x650f('0x13')]);}})[_0x650f('0x15')](function(_0x30ef81){logger[_0x650f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2c89d3,_0x30ef81);_0x324481(_0x30ef81);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 33092dd..079426f 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 _0x1883=['put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x56d764,_0x3f0652){var _0xec0df6=function(_0xe149fa){while(--_0xe149fa){_0x56d764['push'](_0x56d764['shift']());}};_0xec0df6(++_0x3f0652);}(_0x1883,0xab));var _0x3188=function(_0x5f41c9,_0x160beb){_0x5f41c9=_0x5f41c9-0x0;var _0xdb7812=_0x1883[_0x5f41c9];return _0xdb7812;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['get'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['show']);router[_0x3188('0x10')]('/',auth['isAuthenticated'](),controller[_0x3188('0x11')]);router[_0x3188('0x12')](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['update']);router[_0x3188('0x13')](_0x3188('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x3188('0x14')]=router; \ No newline at end of file +var _0x6b8f=['isAuthenticated','/describe','describe','post','create','put','/:id','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get'];(function(_0x276098,_0x3bb8b3){var _0x3e7506=function(_0x5b474d){while(--_0x5b474d){_0x276098['push'](_0x276098['shift']());}};_0x3e7506(++_0x3bb8b3);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x479d18,_0x3e10e7){_0x479d18=_0x479d18-0x0;var _0x4348cf=_0x6b8f[_0x479d18];return _0x4348cf;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf6b8('0x2'));var interaction=require(_0xf6b8('0x3'));var config=require('../../config/environment');var controller=require(_0xf6b8('0x4'));router[_0xf6b8('0x5')]('/',auth[_0xf6b8('0x6')](),controller['index']);router[_0xf6b8('0x5')](_0xf6b8('0x7'),auth[_0xf6b8('0x6')](),controller[_0xf6b8('0x8')]);router['get']('/:id',auth[_0xf6b8('0x6')](),controller['show']);router[_0xf6b8('0x9')]('/',auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xa')]);router[_0xf6b8('0xb')](_0xf6b8('0xc'),auth[_0xf6b8('0x6')](),controller['update']);router['delete']('/:id',auth[_0xf6b8('0x6')](),controller[_0xf6b8('0xd')]);module[_0xf6b8('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 128353d..6c75c3b 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 _0xab9e=['queue','DATE','NOW','moment','exports','STRING','ENUM','account','agent'];(function(_0x2266b8,_0x5129b0){var _0x10f797=function(_0x3fed04){while(--_0x3fed04){_0x2266b8['push'](_0x2266b8['shift']());}};_0x10f797(++_0x5129b0);}(_0xab9e,0xed));var _0xeab9=function(_0x572382,_0x1cffda){_0x572382=_0x572382-0x0;var _0x2a1ddf=_0xab9e[_0x572382];return _0x2a1ddf;};'use strict';var moment=require(_0xeab9('0x0'));var Sequelize=require('sequelize');module[_0xeab9('0x1')]={'uniqueid':{'type':Sequelize[_0xeab9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeab9('0x3')](_0xeab9('0x4'),_0xeab9('0x5'),'queue'),'allowNull':![],'defaultValue':_0xeab9('0x6')},'transferredAt':{'type':Sequelize[_0xeab9('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xeab9('0x8')]}}; \ No newline at end of file +var _0x0226=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x4d39c3,_0x2c300d){var _0x4a1122=function(_0x5e7285){while(--_0x5e7285){_0x4d39c3['push'](_0x4d39c3['shift']());}};_0x4a1122(++_0x2c300d);}(_0x0226,0x159));var _0x6022=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x0226[_0x2ed8f3];return _0x525a55;};'use strict';var moment=require(_0x6022('0x0'));var Sequelize=require(_0x6022('0x1'));module[_0x6022('0x2')]={'uniqueid':{'type':Sequelize[_0x6022('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x6022('0x4')](_0x6022('0x5'),_0x6022('0x6'),_0x6022('0x7')),'allowNull':![],'defaultValue':_0x6022('0x7')},'transferredAt':{'type':Sequelize[_0x6022('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x6022('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e87bcc6..a9a184a 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 _0x2c91=['merge','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','end','error','name','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x3910de,_0x3c395b){var _0x1ef471=function(_0x1106dc){while(--_0x1106dc){_0x3910de['push'](_0x3910de['shift']());}};_0x1ef471(++_0x3c395b);}(_0x2c91,0xe0));var _0x12c9=function(_0x5d4eec,_0x58b311){_0x5d4eec=_0x5d4eec-0x0;var _0x444ebb=_0x2c91[_0x5d4eec];return _0x444ebb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x12c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12c9('0x1'));var jsonpatch=require(_0x12c9('0x2'));var rp=require(_0x12c9('0x3'));var moment=require('moment');var BPromise=require(_0x12c9('0x4'));var Mustache=require('mustache');var util=require(_0x12c9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x12c9('0x6'));var fs=require('fs');var _=require(_0x12c9('0x7'));var squel=require(_0x12c9('0x8'));var crypto=require('crypto');var jsforce=require(_0x12c9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x12c9('0xa'));var querystring=require(_0x12c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x12c9('0xc'));var authService=require(_0x12c9('0xd'));var qs=require(_0x12c9('0xe'));var hardwareService=require(_0x12c9('0xf'));var logger=require(_0x12c9('0x10'))(_0x12c9('0x11'));var utils=require(_0x12c9('0x12'));var config=require(_0x12c9('0x13'));var db=require(_0x12c9('0x14'))['db'];function respondWithStatusCode(_0x1949f5,_0x223787){_0x223787=_0x223787||0xcc;return function(_0x180d37){if(_0x180d37){return _0x1949f5[_0x12c9('0x15')](_0x223787);}return _0x1949f5[_0x12c9('0x16')](_0x223787)['end']();};}function respondWithResult(_0x2527cd,_0x4244ad){_0x4244ad=_0x4244ad||0xc8;return function(_0x2e73c9){if(_0x2e73c9){return _0x2527cd['status'](_0x4244ad)[_0x12c9('0x17')](_0x2e73c9);}};}function respondWithFilteredResult(_0xd20d4e,_0xcaa73c){return function(_0x4ef497){if(_0x4ef497){var _0x34a18b=_0x4ef497[_0x12c9('0x18')],_0x140dbd=_0xcaa73c[_0x12c9('0x19')],_0x1d4222=_0xcaa73c[_0x12c9('0x19')]+_0xcaa73c[_0x12c9('0x1a')],_0x4877c2;if(_0x1d4222>=_0x34a18b){_0x1d4222=_0x34a18b;_0x4877c2=0xc8;}else{_0x4877c2=0xce;}_0xd20d4e[_0x12c9('0x16')](_0x4877c2);return _0xd20d4e[_0x12c9('0x1b')]('Content-Range',_0x140dbd+'-'+_0x1d4222+'/'+_0x34a18b)[_0x12c9('0x17')](_0x4ef497);}return null;};}function patchUpdates(_0x1a702e){return function(_0x3ae12f){try{jsonpatch[_0x12c9('0x1c')](_0x3ae12f,_0x1a702e,!![]);}catch(_0xe948b2){return BPromise[_0x12c9('0x1d')](_0xe948b2);}return _0x3ae12f['save']();};}function saveUpdates(_0x5a747c,_0x548564){return function(_0x260b85){if(_0x260b85){return _0x260b85[_0x12c9('0x1e')](_0x5a747c)[_0x12c9('0x1f')](function(_0x57566e){return _0x57566e;});}return null;};}function removeEntity(_0xad52a0,_0x11c778){return function(_0x16a2f5){if(_0x16a2f5){return _0x16a2f5['destroy']()[_0x12c9('0x1f')](function(){_0xad52a0[_0x12c9('0x16')](0xcc)[_0x12c9('0x20')]();});}};}function handleEntityNotFound(_0x18ed27,_0x4ac038){return function(_0x238b4f){if(!_0x238b4f){_0x18ed27['sendStatus'](0x194);}return _0x238b4f;};}function handleError(_0x2e1fa6,_0x2859dc){_0x2859dc=_0x2859dc||0x1f4;return function(_0x30998f){logger[_0x12c9('0x21')](_0x30998f['stack']);if(_0x30998f[_0x12c9('0x22')]){delete _0x30998f[_0x12c9('0x22')];}_0x2e1fa6[_0x12c9('0x16')](_0x2859dc)['send'](_0x30998f);};}exports[_0x12c9('0x23')]=function(_0x2e9a2c,_0x2c6620){var _0x9c142e={},_0x15ce86={},_0x2176f9={'count':0x0,'rows':[]};var _0x32af10=db[_0x12c9('0x24')][_0x12c9('0x25')];_0x15ce86[_0x12c9('0x26')]=_[_0x12c9('0x27')](_0x32af10);_0x15ce86['query']=_[_0x12c9('0x27')](_0x2e9a2c[_0x12c9('0x28')]);_0x15ce86[_0x12c9('0x29')]=_[_0x12c9('0x2a')](_0x15ce86[_0x12c9('0x26')],_0x15ce86['query']);_0x9c142e[_0x12c9('0x2b')]=_['intersection'](_0x15ce86[_0x12c9('0x26')],qs[_0x12c9('0x2c')](_0x2e9a2c['query'][_0x12c9('0x2c')]));_0x9c142e[_0x12c9('0x2b')]=_0x9c142e[_0x12c9('0x2b')]['length']?_0x9c142e[_0x12c9('0x2b')]:_0x15ce86[_0x12c9('0x26')];if(!_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x2d')](_0x12c9('0x2e'))){_0x9c142e['limit']=qs[_0x12c9('0x1a')](_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x1a')]);_0x9c142e['offset']=qs[_0x12c9('0x19')](_0x2e9a2c['query'][_0x12c9('0x19')]);}_0x9c142e[_0x12c9('0x2f')]=qs[_0x12c9('0x30')](_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x30')]);_0x9c142e['where']=qs['filters'](_[_0x12c9('0x31')](_0x2e9a2c['query'],_0x15ce86['filters']));if(_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x32')]){_0x9c142e[_0x12c9('0x33')]=_[_0x12c9('0x34')](_0x9c142e['where'],{'$or':_[_0x12c9('0x35')](_0x32af10,function(_0x4c4840){if(_0x4c4840['type'][_0x12c9('0x36')]!==_0x12c9('0x37')){var _0x550c49={};_0x550c49[_0x4c4840[_0x12c9('0x38')]]={'$like':'%'+_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x32')]+'%'};return _0x550c49;}})});}_0x9c142e=_['merge']({},_0x9c142e,_0x2e9a2c[_0x12c9('0x39')]);var _0x4bab23={'where':_0x9c142e[_0x12c9('0x33')]};return db[_0x12c9('0x24')][_0x12c9('0x18')](_0x4bab23)[_0x12c9('0x1f')](function(_0x4cd540){_0x2176f9['count']=_0x4cd540;if(_0x2e9a2c['query'][_0x12c9('0x3a')]){_0x9c142e[_0x12c9('0x3b')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x9c142e);})['then'](function(_0x1f051c){_0x2176f9[_0x12c9('0x3c')]=_0x1f051c;return _0x2176f9;})[_0x12c9('0x1f')](respondWithFilteredResult(_0x2c6620,_0x9c142e))[_0x12c9('0x3d')](handleError(_0x2c6620,null));};exports['show']=function(_0x3775a7,_0x30c826){var _0x5e3ded={'raw':!![],'where':{'id':_0x3775a7[_0x12c9('0x3e')]['id']}},_0x5af74f={};_0x5af74f[_0x12c9('0x26')]=_[_0x12c9('0x27')](db[_0x12c9('0x24')][_0x12c9('0x25')]);_0x5af74f[_0x12c9('0x28')]=_[_0x12c9('0x27')](_0x3775a7[_0x12c9('0x28')]);_0x5af74f[_0x12c9('0x29')]=_[_0x12c9('0x2a')](_0x5af74f[_0x12c9('0x26')],_0x5af74f['query']);_0x5e3ded['attributes']=_[_0x12c9('0x2a')](_0x5af74f[_0x12c9('0x26')],qs[_0x12c9('0x2c')](_0x3775a7[_0x12c9('0x28')]['fields']));_0x5e3ded[_0x12c9('0x2b')]=_0x5e3ded['attributes'][_0x12c9('0x3f')]?_0x5e3ded['attributes']:_0x5af74f[_0x12c9('0x26')];if(_0x3775a7[_0x12c9('0x28')][_0x12c9('0x3a')]){_0x5e3ded[_0x12c9('0x3b')]=[{'all':!![]}];}_0x5e3ded=_[_0x12c9('0x34')]({},_0x5e3ded,_0x3775a7['options']);return db[_0x12c9('0x24')][_0x12c9('0x40')](_0x5e3ded)[_0x12c9('0x1f')](handleEntityNotFound(_0x30c826,null))['then'](respondWithResult(_0x30c826,null))['catch'](handleError(_0x30c826,null));};exports['create']=function(_0x4caca2,_0x2f6d66){return db[_0x12c9('0x24')][_0x12c9('0x41')](_0x4caca2[_0x12c9('0x42')],{})[_0x12c9('0x1f')](respondWithResult(_0x2f6d66,0xc9))['catch'](handleError(_0x2f6d66,null));};exports[_0x12c9('0x1e')]=function(_0x324e4f,_0x3ee9ad){if(_0x324e4f[_0x12c9('0x42')]['id']){delete _0x324e4f[_0x12c9('0x42')]['id'];}return db[_0x12c9('0x24')][_0x12c9('0x40')]({'where':{'id':_0x324e4f[_0x12c9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ee9ad,null))[_0x12c9('0x1f')](saveUpdates(_0x324e4f['body'],null))[_0x12c9('0x1f')](respondWithResult(_0x3ee9ad,null))[_0x12c9('0x3d')](handleError(_0x3ee9ad,null));};exports[_0x12c9('0x43')]=function(_0x3a00a3,_0x5b5d13){return db[_0x12c9('0x24')]['find']({'where':{'id':_0x3a00a3['params']['id']}})[_0x12c9('0x1f')](handleEntityNotFound(_0x5b5d13,null))[_0x12c9('0x1f')](removeEntity(_0x5b5d13,null))[_0x12c9('0x3d')](handleError(_0x5b5d13,null));};exports[_0x12c9('0x44')]=function(_0xb7fc30,_0x44b95a){return db[_0x12c9('0x24')][_0x12c9('0x44')]()[_0x12c9('0x1f')](respondWithResult(_0x44b95a,null))['catch'](handleError(_0x44b95a,null));}; \ No newline at end of file +var _0xaf90=['keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','model'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaf90,0x1e3));var _0x0af9=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xaf90[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0x0af9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0af9('0x1'));var jsonpatch=require(_0x0af9('0x2'));var rp=require(_0x0af9('0x3'));var moment=require(_0x0af9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0af9('0x5'));var util=require(_0x0af9('0x6'));var path=require(_0x0af9('0x7'));var sox=require(_0x0af9('0x8'));var csv=require('to-csv');var ejs=require(_0x0af9('0x9'));var fs=require('fs');var _=require(_0x0af9('0xa'));var squel=require('squel');var crypto=require(_0x0af9('0xb'));var jsforce=require(_0x0af9('0xc'));var deskjs=require(_0x0af9('0xd'));var toCsv=require(_0x0af9('0xe'));var querystring=require(_0x0af9('0xf'));var Papa=require('papaparse');var Redis=require(_0x0af9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0af9('0x11'));var hardwareService=require(_0x0af9('0x12'));var logger=require(_0x0af9('0x13'))(_0x0af9('0x14'));var utils=require('../../config/utils');var config=require(_0x0af9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf195e5,_0x1152d1){_0x1152d1=_0x1152d1||0xcc;return function(_0x46ba18){if(_0x46ba18){return _0xf195e5[_0x0af9('0x16')](_0x1152d1);}return _0xf195e5['status'](_0x1152d1)[_0x0af9('0x17')]();};}function respondWithResult(_0x2a6c0b,_0x25f074){_0x25f074=_0x25f074||0xc8;return function(_0x1d2a65){if(_0x1d2a65){return _0x2a6c0b[_0x0af9('0x18')](_0x25f074)[_0x0af9('0x19')](_0x1d2a65);}};}function respondWithFilteredResult(_0x2d482f,_0x37488f){return function(_0x100bad){if(_0x100bad){var _0x4ede8c=_0x100bad['count'],_0x324a3a=_0x37488f[_0x0af9('0x1a')],_0x58358a=_0x37488f[_0x0af9('0x1a')]+_0x37488f['limit'],_0x1c88da;if(_0x58358a>=_0x4ede8c){_0x58358a=_0x4ede8c;_0x1c88da=0xc8;}else{_0x1c88da=0xce;}_0x2d482f[_0x0af9('0x18')](_0x1c88da);return _0x2d482f[_0x0af9('0x1b')](_0x0af9('0x1c'),_0x324a3a+'-'+_0x58358a+'/'+_0x4ede8c)[_0x0af9('0x19')](_0x100bad);}return null;};}function patchUpdates(_0x23f7f3){return function(_0x17e698){try{jsonpatch[_0x0af9('0x1d')](_0x17e698,_0x23f7f3,!![]);}catch(_0x3577f4){return BPromise[_0x0af9('0x1e')](_0x3577f4);}return _0x17e698[_0x0af9('0x1f')]();};}function saveUpdates(_0xf79ad,_0x2f0078){return function(_0x2dd0ce){if(_0x2dd0ce){return _0x2dd0ce['update'](_0xf79ad)[_0x0af9('0x20')](function(_0x4e38bd){return _0x4e38bd;});}return null;};}function removeEntity(_0x93faf6,_0xb837cc){return function(_0x25af39){if(_0x25af39){return _0x25af39[_0x0af9('0x21')]()['then'](function(){_0x93faf6[_0x0af9('0x18')](0xcc)[_0x0af9('0x17')]();});}};}function handleEntityNotFound(_0x4274d1,_0x11c051){return function(_0x2d2cca){if(!_0x2d2cca){_0x4274d1[_0x0af9('0x16')](0x194);}return _0x2d2cca;};}function handleError(_0x17bb26,_0x526b7){_0x526b7=_0x526b7||0x1f4;return function(_0x235ddc){logger[_0x0af9('0x22')](_0x235ddc[_0x0af9('0x23')]);if(_0x235ddc['name']){delete _0x235ddc[_0x0af9('0x24')];}_0x17bb26[_0x0af9('0x18')](_0x526b7)[_0x0af9('0x25')](_0x235ddc);};}exports[_0x0af9('0x26')]=function(_0x9ec64e,_0x4d61ae){var _0xa86ae8={},_0x2e5633={},_0x163832={'count':0x0,'rows':[]};var _0x3ef489=db[_0x0af9('0x27')][_0x0af9('0x28')];_0x2e5633[_0x0af9('0x29')]=_[_0x0af9('0x2a')](_0x3ef489);_0x2e5633[_0x0af9('0x2b')]=_['keys'](_0x9ec64e[_0x0af9('0x2b')]);_0x2e5633[_0x0af9('0x2c')]=_[_0x0af9('0x2d')](_0x2e5633[_0x0af9('0x29')],_0x2e5633[_0x0af9('0x2b')]);_0xa86ae8[_0x0af9('0x2e')]=_[_0x0af9('0x2d')](_0x2e5633['model'],qs[_0x0af9('0x2f')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x2f')]));_0xa86ae8[_0x0af9('0x2e')]=_0xa86ae8[_0x0af9('0x2e')][_0x0af9('0x30')]?_0xa86ae8['attributes']:_0x2e5633['model'];if(!_0x9ec64e['query']['hasOwnProperty'](_0x0af9('0x31'))){_0xa86ae8[_0x0af9('0x32')]=qs[_0x0af9('0x32')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x32')]);_0xa86ae8[_0x0af9('0x1a')]=qs[_0x0af9('0x1a')](_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x1a')]);}_0xa86ae8[_0x0af9('0x33')]=qs[_0x0af9('0x34')](_0x9ec64e['query'][_0x0af9('0x34')]);_0xa86ae8['where']=qs[_0x0af9('0x2c')](_[_0x0af9('0x35')](_0x9ec64e['query'],_0x2e5633['filters']));if(_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x36')]){_0xa86ae8[_0x0af9('0x37')]=_[_0x0af9('0x38')](_0xa86ae8[_0x0af9('0x37')],{'$or':_[_0x0af9('0x39')](_0x3ef489,function(_0x3609ee){if(_0x3609ee[_0x0af9('0x3a')][_0x0af9('0x3b')]!=='VIRTUAL'){var _0x4079af={};_0x4079af[_0x3609ee[_0x0af9('0x3c')]]={'$like':'%'+_0x9ec64e[_0x0af9('0x2b')][_0x0af9('0x36')]+'%'};return _0x4079af;}})});}_0xa86ae8=_['merge']({},_0xa86ae8,_0x9ec64e['options']);var _0x5d4534={'where':_0xa86ae8['where']};return db[_0x0af9('0x27')][_0x0af9('0x3d')](_0x5d4534)['then'](function(_0x43fc7d){_0x163832[_0x0af9('0x3d')]=_0x43fc7d;if(_0x9ec64e['query'][_0x0af9('0x3e')]){_0xa86ae8[_0x0af9('0x3f')]=[{'all':!![]}];}return db[_0x0af9('0x27')][_0x0af9('0x40')](_0xa86ae8);})[_0x0af9('0x20')](function(_0x3fbb30){_0x163832[_0x0af9('0x41')]=_0x3fbb30;return _0x163832;})[_0x0af9('0x20')](respondWithFilteredResult(_0x4d61ae,_0xa86ae8))['catch'](handleError(_0x4d61ae,null));};exports[_0x0af9('0x42')]=function(_0x18576b,_0x3015a7){var _0x3d4a0d={'raw':!![],'where':{'id':_0x18576b[_0x0af9('0x43')]['id']}},_0x3cdb8d={};_0x3cdb8d['model']=_[_0x0af9('0x2a')](db['MailTransferReport'][_0x0af9('0x28')]);_0x3cdb8d[_0x0af9('0x2b')]=_[_0x0af9('0x2a')](_0x18576b['query']);_0x3cdb8d['filters']=_[_0x0af9('0x2d')](_0x3cdb8d[_0x0af9('0x29')],_0x3cdb8d['query']);_0x3d4a0d[_0x0af9('0x2e')]=_[_0x0af9('0x2d')](_0x3cdb8d['model'],qs[_0x0af9('0x2f')](_0x18576b[_0x0af9('0x2b')][_0x0af9('0x2f')]));_0x3d4a0d[_0x0af9('0x2e')]=_0x3d4a0d[_0x0af9('0x2e')][_0x0af9('0x30')]?_0x3d4a0d['attributes']:_0x3cdb8d[_0x0af9('0x29')];if(_0x18576b[_0x0af9('0x2b')]['includeAll']){_0x3d4a0d[_0x0af9('0x3f')]=[{'all':!![]}];}_0x3d4a0d=_[_0x0af9('0x38')]({},_0x3d4a0d,_0x18576b[_0x0af9('0x44')]);return db[_0x0af9('0x27')][_0x0af9('0x45')](_0x3d4a0d)[_0x0af9('0x20')](handleEntityNotFound(_0x3015a7,null))[_0x0af9('0x20')](respondWithResult(_0x3015a7,null))[_0x0af9('0x46')](handleError(_0x3015a7,null));};exports[_0x0af9('0x47')]=function(_0x516a65,_0xee6ea2){return db[_0x0af9('0x27')][_0x0af9('0x47')](_0x516a65[_0x0af9('0x48')],{})['then'](respondWithResult(_0xee6ea2,0xc9))[_0x0af9('0x46')](handleError(_0xee6ea2,null));};exports[_0x0af9('0x49')]=function(_0x55375e,_0x519864){if(_0x55375e[_0x0af9('0x48')]['id']){delete _0x55375e[_0x0af9('0x48')]['id'];}return db[_0x0af9('0x27')]['find']({'where':{'id':_0x55375e[_0x0af9('0x43')]['id']}})[_0x0af9('0x20')](handleEntityNotFound(_0x519864,null))[_0x0af9('0x20')](saveUpdates(_0x55375e[_0x0af9('0x48')],null))[_0x0af9('0x20')](respondWithResult(_0x519864,null))[_0x0af9('0x46')](handleError(_0x519864,null));};exports[_0x0af9('0x21')]=function(_0x29ca7e,_0x208d94){return db[_0x0af9('0x27')][_0x0af9('0x45')]({'where':{'id':_0x29ca7e[_0x0af9('0x43')]['id']}})[_0x0af9('0x20')](handleEntityNotFound(_0x208d94,null))[_0x0af9('0x20')](removeEntity(_0x208d94,null))[_0x0af9('0x46')](handleError(_0x208d94,null));};exports['describe']=function(_0x1de647,_0x1e96c3){return db[_0x0af9('0x27')][_0x0af9('0x4a')]()[_0x0af9('0x20')](respondWithResult(_0x1e96c3,null))[_0x0af9('0x46')](handleError(_0x1e96c3,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 22d886e..c86319a 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 _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','report_mail_transfer','uniqueid','bluebird'];(function(_0xaef393,_0x3bb479){var _0x180e7e=function(_0x50ab2b){while(--_0x50ab2b){_0xaef393['push'](_0xaef393['shift']());}};_0x180e7e(++_0x3bb479);}(_0x5d58,0x187));var _0x85d5=function(_0x3bb65a,_0x5bbec4){_0x3bb65a=_0x3bb65a-0x0;var _0x3c83ec=_0x5d58[_0x3bb65a];return _0x3c83ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./mailTransferReport.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('MailTransferReport',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[{'name':_0x85d5('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_mail_transfer','uniqueid','lodash','util'];(function(_0x24322c,_0x291896){var _0x53ad8f=function(_0x24a5c8){while(--_0x24a5c8){_0x24322c['push'](_0x24322c['shift']());}};_0x53ad8f(++_0x291896);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf4add4,_0x5b9cc1){_0xf4add4=_0xf4add4-0x0;var _0x1c42fb=_0xf2ca[_0xf4add4];return _0x1c42fb;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0xaf2c('0x9')]=function(_0x100d17,_0x297740){return _0x100d17[_0xaf2c('0xa')]('MailTransferReport',attributes,{'tableName':_0xaf2c('0xb'),'paranoid':![],'indexes':[{'name':_0xaf2c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index caf2391..fa8073d 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 _0xfbef=['request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s'];(function(_0x30aca4,_0x54b849){var _0x5a8dfb=function(_0x445070){while(--_0x445070){_0x30aca4['push'](_0x30aca4['shift']());}};_0x5a8dfb(++_0x54b849);}(_0xfbef,0x8d));var _0xffbe=function(_0x5e9e04,_0x28a45f){_0x5e9e04=_0x5e9e04-0x0;var _0x2909d7=_0xfbef[_0x5e9e04];return _0x2909d7;};'use strict';var _=require(_0xffbe('0x0'));var util=require('util');var moment=require(_0xffbe('0x1'));var BPromise=require('bluebird');var rs=require(_0xffbe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffbe('0x3'));var logger=require(_0xffbe('0x4'))(_0xffbe('0x5'));var config=require(_0xffbe('0x6'));var jayson=require(_0xffbe('0x7'));var client=jayson[_0xffbe('0x8')][_0xffbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb5ff,_0x23a6c2,_0x4068ef){return new BPromise(function(_0x5a9dab,_0x174710){return client[_0xffbe('0xa')](_0x5eb5ff,_0x4068ef)[_0xffbe('0xb')](function(_0x3614e6){logger['info'](_0xffbe('0xc'),_0x23a6c2,_0xffbe('0xd'));logger['debug'](_0xffbe('0xe'),_0x23a6c2,_0xffbe('0xd'),JSON[_0xffbe('0xf')](_0x3614e6));if(_0x3614e6[_0xffbe('0x10')]){if(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x11')]===0x1f4){logger[_0xffbe('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x23a6c2,_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);return _0x174710(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);}logger[_0xffbe('0x10')](_0xffbe('0xc'),_0x23a6c2,_0x3614e6['error'][_0xffbe('0x12')]);return _0x5a9dab(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);}else{logger[_0xffbe('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x23a6c2,'request\x20sent');_0x5a9dab(_0x3614e6[_0xffbe('0x14')][_0xffbe('0x12')]);}})[_0xffbe('0x15')](function(_0x1bf310){logger[_0xffbe('0x10')](_0xffbe('0xc'),_0x23a6c2,_0x1bf310);_0x174710(_0x1bf310);});});} \ No newline at end of file +var _0x5f7b=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ee358,_0x42fdfb){var _0x4d01b9=function(_0x2ad69d){while(--_0x2ad69d){_0x1ee358['push'](_0x1ee358['shift']());}};_0x4d01b9(++_0x42fdfb);}(_0x5f7b,0xb4));var _0xb5f7=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x5f7b[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xb5f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5f7('0x1'));var fs=require('fs');var Redis=require(_0xb5f7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb5f7('0x3'));var logger=require(_0xb5f7('0x4'))(_0xb5f7('0x5'));var config=require(_0xb5f7('0x6'));var jayson=require(_0xb5f7('0x7'));var client=jayson[_0xb5f7('0x8')][_0xb5f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x561f85,_0x30e47e,_0x5a523d){return new BPromise(function(_0x206181,_0x460fdc){return client[_0xb5f7('0xa')](_0x561f85,_0x5a523d)[_0xb5f7('0xb')](function(_0x317dd4){logger[_0xb5f7('0xc')](_0xb5f7('0xd'),_0x30e47e,_0xb5f7('0xe'));logger['debug'](_0xb5f7('0xf'),_0x30e47e,_0xb5f7('0xe'),JSON[_0xb5f7('0x10')](_0x317dd4));if(_0x317dd4['error']){if(_0x317dd4['error']['code']===0x1f4){logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x317dd4['error'][_0xb5f7('0x12')]);return _0x460fdc(_0x317dd4[_0xb5f7('0x11')]['message']);}logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x317dd4['error'][_0xb5f7('0x12')]);return _0x206181(_0x317dd4[_0xb5f7('0x11')][_0xb5f7('0x12')]);}else{logger[_0xb5f7('0xc')](_0xb5f7('0xd'),_0x30e47e,'request\x20sent');_0x206181(_0x317dd4[_0xb5f7('0x13')][_0xb5f7('0x12')]);}})[_0xb5f7('0x14')](function(_0x3652de){logger[_0xb5f7('0x11')](_0xb5f7('0xd'),_0x30e47e,_0x3652de);_0x460fdc(_0x3652de);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a529b74..b162ce3 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 _0xacb9=['update','exports','multer','util','path','express','../../components/auth/service','./memberReport.controller','get','isAuthenticated','describe','show','put','/:id'];(function(_0x41174b,_0x44e5ac){var _0x1930a5=function(_0x5f3fef){while(--_0x5f3fef){_0x41174b['push'](_0x41174b['shift']());}};_0x1930a5(++_0x44e5ac);}(_0xacb9,0x128));var _0x9acb=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xacb9[_0x45c262];return _0x4f2ba6;};'use strict';var multer=require(_0x9acb('0x0'));var util=require(_0x9acb('0x1'));var path=require(_0x9acb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9acb('0x3'));var router=express['Router']();var auth=require(_0x9acb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9acb('0x5'));router[_0x9acb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9acb('0x6')]('/describe',auth[_0x9acb('0x7')](),controller[_0x9acb('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9acb('0x9')]);router['post']('/',auth[_0x9acb('0x7')](),controller['create']);router[_0x9acb('0xa')](_0x9acb('0xb'),auth[_0x9acb('0x7')](),controller[_0x9acb('0xc')]);router['delete'](_0x9acb('0xb'),auth[_0x9acb('0x7')](),controller['destroy']);module[_0x9acb('0xd')]=router; \ No newline at end of file +var _0x979e=['describe','/:id','show','post','update','delete','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x261950,_0x38e58a){var _0x40fa53=function(_0x9a754){while(--_0x9a754){_0x261950['push'](_0x261950['shift']());}};_0x40fa53(++_0x38e58a);}(_0x979e,0xe4));var _0xe979=function(_0x48b4ab,_0x939aff){_0x48b4ab=_0x48b4ab-0x0;var _0x3c06ac=_0x979e[_0x48b4ab];return _0x3c06ac;};'use strict';var multer=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var path=require('path');var timeout=require(_0xe979('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe979('0x3'));var config=require(_0xe979('0x4'));var controller=require(_0xe979('0x5'));router[_0xe979('0x6')]('/',auth[_0xe979('0x7')](),controller[_0xe979('0x8')]);router[_0xe979('0x6')](_0xe979('0x9'),auth[_0xe979('0x7')](),controller[_0xe979('0xa')]);router['get'](_0xe979('0xb'),auth[_0xe979('0x7')](),controller[_0xe979('0xc')]);router[_0xe979('0xd')]('/',auth[_0xe979('0x7')](),controller['create']);router['put'](_0xe979('0xb'),auth['isAuthenticated'](),controller[_0xe979('0xe')]);router[_0xe979('0xf')](_0xe979('0xb'),auth[_0xe979('0x7')](),controller['destroy']);module[_0xe979('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 0d937d6..f9b001c 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 _0x77c5=['talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x77c5,0x1b3));var _0x577c=function(_0x44d42a,_0xe76ad8){_0x44d42a=_0x44d42a-0x0;var _0x172b8f=_0x77c5[_0x44d42a];return _0x172b8f;};'use strict';var Sequelize=require(_0x577c('0x0'));var moment=require('moment');module[_0x577c('0x1')]={'channel':{'type':Sequelize[_0x577c('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x577c('0x2')]},'type':{'type':Sequelize[_0x577c('0x2')],'defaultValue':_0x577c('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x577c('0x4')]},'enterAt':{'type':Sequelize[_0x577c('0x5')]},'exitAt':{'type':Sequelize[_0x577c('0x5')],'set':function(_0xd12109){var _0x5ce5e5=moment(_0xd12109);var _0xb2c84=moment(this[_0x577c('0x6')]('enterAt'));var _0x48d88a=_0x5ce5e5[_0x577c('0x7')](_0xb2c84,_0x577c('0x8'));this[_0x577c('0x9')](_0x577c('0xa'),_0xd12109);this[_0x577c('0x9')](_0x577c('0xb'),_0x48d88a||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x577c('0xc')},'data2':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xd')},'data3':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xe')},'data4':{'type':Sequelize[_0x577c('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x577c('0x2')]}}; \ No newline at end of file +var _0xbe55=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration'];(function(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xbe55,0x91));var _0x5be5=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xbe55[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x5be5('0x0'));var moment=require(_0x5be5('0x1'));module[_0x5be5('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5be5('0x3')]},'interface':{'type':Sequelize[_0x5be5('0x3')]},'type':{'type':Sequelize[_0x5be5('0x3')],'defaultValue':_0x5be5('0x4'),'comment':_0x5be5('0x5')},'duration':{'type':Sequelize[_0x5be5('0x6')]},'enterAt':{'type':Sequelize[_0x5be5('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3e579c){var _0x598f70=moment(_0x3e579c);var _0x14c41a=moment(this[_0x5be5('0x8')](_0x5be5('0x9')));var _0x194ba1=_0x598f70[_0x5be5('0xa')](_0x14c41a,_0x5be5('0xb'));this[_0x5be5('0xc')](_0x5be5('0xd'),_0x3e579c);this[_0x5be5('0xc')](_0x5be5('0xe'),_0x194ba1||null);}},'data1':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0xf')},'data2':{'type':Sequelize['STRING'],'comment':_0x5be5('0x10')},'data3':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x11')},'data4':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x12')},'data5':{'type':Sequelize[_0x5be5('0x3')],'comment':_0x5be5('0x13')},'role':{'type':Sequelize[_0x5be5('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1a37100..085d7ef 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 _0xd03f=['VIRTUAL','field','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','html-pdf','eml-format','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','send','index','MemberReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key'];(function(_0x5573f9,_0x4c006f){var _0x1619d8=function(_0x2df9d7){while(--_0x2df9d7){_0x5573f9['push'](_0x5573f9['shift']());}};_0x1619d8(++_0x4c006f);}(_0xd03f,0xf0));var _0xfd03=function(_0x486c24,_0x3b3097){_0x486c24=_0x486c24-0x0;var _0x5a5943=_0xd03f[_0x486c24];return _0x5a5943;};'use strict';var pdf=require(_0xfd03('0x0'));var emlformat=require(_0xfd03('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd03('0x2'));var moment=require(_0xfd03('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd03('0x4'));var path=require(_0xfd03('0x5'));var sox=require(_0xfd03('0x6'));var csv=require(_0xfd03('0x7'));var ejs=require(_0xfd03('0x8'));var fs=require('fs');var _=require(_0xfd03('0x9'));var squel=require(_0xfd03('0xa'));var crypto=require(_0xfd03('0xb'));var jsforce=require(_0xfd03('0xc'));var deskjs=require(_0xfd03('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfd03('0xe'));var Papa=require(_0xfd03('0xf'));var Redis=require(_0xfd03('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd03('0x11'));var hardwareService=require(_0xfd03('0x12'));var logger=require(_0xfd03('0x13'))(_0xfd03('0x14'));var utils=require(_0xfd03('0x15'));var config=require('../../config/environment');var db=require(_0xfd03('0x16'))['db'];function respondWithStatusCode(_0x105857,_0x4ba3c6){_0x4ba3c6=_0x4ba3c6||0xcc;return function(_0x4cfecd){if(_0x4cfecd){return _0x105857['sendStatus'](_0x4ba3c6);}return _0x105857[_0xfd03('0x17')](_0x4ba3c6)['end']();};}function respondWithResult(_0x4942ac,_0x204165){_0x204165=_0x204165||0xc8;return function(_0x209e18){if(_0x209e18){return _0x4942ac[_0xfd03('0x17')](_0x204165)['json'](_0x209e18);}};}function respondWithFilteredResult(_0x1eb9ea,_0x3e2611){return function(_0x125ec5){if(_0x125ec5){var _0x25469=_0x125ec5[_0xfd03('0x18')],_0x43a87f=_0x3e2611[_0xfd03('0x19')],_0x77d403=_0x3e2611[_0xfd03('0x19')]+_0x3e2611[_0xfd03('0x1a')],_0x1b9eec;if(_0x77d403>=_0x25469){_0x77d403=_0x25469;_0x1b9eec=0xc8;}else{_0x1b9eec=0xce;}_0x1eb9ea[_0xfd03('0x17')](_0x1b9eec);return _0x1eb9ea[_0xfd03('0x1b')](_0xfd03('0x1c'),_0x43a87f+'-'+_0x77d403+'/'+_0x25469)[_0xfd03('0x1d')](_0x125ec5);}return null;};}function patchUpdates(_0x14af04){return function(_0x3ed22e){try{jsonpatch[_0xfd03('0x1e')](_0x3ed22e,_0x14af04,!![]);}catch(_0x42bd01){return BPromise[_0xfd03('0x1f')](_0x42bd01);}return _0x3ed22e[_0xfd03('0x20')]();};}function saveUpdates(_0x2eed6c,_0x9045ec){return function(_0x3d879e){if(_0x3d879e){return _0x3d879e[_0xfd03('0x21')](_0x2eed6c)[_0xfd03('0x22')](function(_0x6eee9e){return _0x6eee9e;});}return null;};}function removeEntity(_0xeefaea,_0x3cb518){return function(_0x3ddd0c){if(_0x3ddd0c){return _0x3ddd0c[_0xfd03('0x23')]()[_0xfd03('0x22')](function(){_0xeefaea['status'](0xcc)[_0xfd03('0x24')]();});}};}function handleEntityNotFound(_0xfd9bd1,_0x3239c9){return function(_0x11ee06){if(!_0x11ee06){_0xfd9bd1[_0xfd03('0x25')](0x194);}return _0x11ee06;};}function handleError(_0x5cb2ad,_0x1c638a){_0x1c638a=_0x1c638a||0x1f4;return function(_0x1a641c){logger['error'](_0x1a641c[_0xfd03('0x26')]);if(_0x1a641c['name']){delete _0x1a641c['name'];}_0x5cb2ad[_0xfd03('0x17')](_0x1c638a)[_0xfd03('0x27')](_0x1a641c);};}exports[_0xfd03('0x28')]=function(_0x3fed09,_0x301b3a){var _0x530b3a={},_0x18388a={},_0x2658e8={'count':0x0,'rows':[]};var _0xa77b2b=db[_0xfd03('0x29')]['rawAttributes'];_0x18388a[_0xfd03('0x2a')]=_[_0xfd03('0x2b')](_0xa77b2b);_0x18388a[_0xfd03('0x2c')]=_[_0xfd03('0x2b')](_0x3fed09[_0xfd03('0x2c')]);_0x18388a[_0xfd03('0x2d')]=_[_0xfd03('0x2e')](_0x18388a[_0xfd03('0x2a')],_0x18388a['query']);_0x530b3a[_0xfd03('0x2f')]=_[_0xfd03('0x2e')](_0x18388a[_0xfd03('0x2a')],qs[_0xfd03('0x30')](_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x30')]));_0x530b3a[_0xfd03('0x2f')]=_0x530b3a[_0xfd03('0x2f')][_0xfd03('0x31')]?_0x530b3a[_0xfd03('0x2f')]:_0x18388a[_0xfd03('0x2a')];if(!_0x3fed09[_0xfd03('0x2c')]['hasOwnProperty'](_0xfd03('0x32'))){_0x530b3a[_0xfd03('0x1a')]=qs[_0xfd03('0x1a')](_0x3fed09[_0xfd03('0x2c')]['limit']);_0x530b3a[_0xfd03('0x19')]=qs[_0xfd03('0x19')](_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x19')]);}_0x530b3a[_0xfd03('0x33')]=qs[_0xfd03('0x34')](_0x3fed09[_0xfd03('0x2c')]['sort']);_0x530b3a[_0xfd03('0x35')]=qs['filters'](_[_0xfd03('0x36')](_0x3fed09[_0xfd03('0x2c')],_0x18388a[_0xfd03('0x2d')]));if(_0x3fed09['query'][_0xfd03('0x37')]){_0x530b3a[_0xfd03('0x35')]=_[_0xfd03('0x38')](_0x530b3a[_0xfd03('0x35')],{'$or':_[_0xfd03('0x39')](_0xa77b2b,function(_0x2fc226){if(_0x2fc226[_0xfd03('0x3a')][_0xfd03('0x3b')]!==_0xfd03('0x3c')){var _0x5c61cf={};_0x5c61cf[_0x2fc226[_0xfd03('0x3d')]]={'$like':'%'+_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x37')]+'%'};return _0x5c61cf;}})});}_0x530b3a=_[_0xfd03('0x38')]({},_0x530b3a,_0x3fed09[_0xfd03('0x3e')]);var _0xa63697={'where':_0x530b3a['where']};return db['MemberReport'][_0xfd03('0x18')](_0xa63697)['then'](function(_0x397454){_0x2658e8[_0xfd03('0x18')]=_0x397454;if(_0x3fed09[_0xfd03('0x2c')]['includeAll']){_0x530b3a['include']=[{'all':!![]}];}return db[_0xfd03('0x29')][_0xfd03('0x3f')](_0x530b3a);})[_0xfd03('0x22')](function(_0x5a9e99){_0x2658e8[_0xfd03('0x40')]=_0x5a9e99;return _0x2658e8;})[_0xfd03('0x22')](respondWithFilteredResult(_0x301b3a,_0x530b3a))[_0xfd03('0x41')](handleError(_0x301b3a,null));};exports[_0xfd03('0x42')]=function(_0x5ddd28,_0x577059){var _0x55bbd7={'raw':!![],'where':{'id':_0x5ddd28[_0xfd03('0x43')]['id']}},_0x2bb848={};_0x2bb848[_0xfd03('0x2a')]=_[_0xfd03('0x2b')](db[_0xfd03('0x29')][_0xfd03('0x44')]);_0x2bb848[_0xfd03('0x2c')]=_[_0xfd03('0x2b')](_0x5ddd28[_0xfd03('0x2c')]);_0x2bb848[_0xfd03('0x2d')]=_[_0xfd03('0x2e')](_0x2bb848[_0xfd03('0x2a')],_0x2bb848[_0xfd03('0x2c')]);_0x55bbd7[_0xfd03('0x2f')]=_[_0xfd03('0x2e')](_0x2bb848[_0xfd03('0x2a')],qs[_0xfd03('0x30')](_0x5ddd28[_0xfd03('0x2c')][_0xfd03('0x30')]));_0x55bbd7['attributes']=_0x55bbd7[_0xfd03('0x2f')][_0xfd03('0x31')]?_0x55bbd7['attributes']:_0x2bb848[_0xfd03('0x2a')];if(_0x5ddd28[_0xfd03('0x2c')][_0xfd03('0x45')]){_0x55bbd7[_0xfd03('0x46')]=[{'all':!![]}];}_0x55bbd7=_[_0xfd03('0x38')]({},_0x55bbd7,_0x5ddd28[_0xfd03('0x3e')]);return db[_0xfd03('0x29')][_0xfd03('0x47')](_0x55bbd7)[_0xfd03('0x22')](handleEntityNotFound(_0x577059,null))[_0xfd03('0x22')](respondWithResult(_0x577059,null))[_0xfd03('0x41')](handleError(_0x577059,null));};exports[_0xfd03('0x48')]=function(_0x3ed7e6,_0x16e4e8){return db[_0xfd03('0x29')][_0xfd03('0x48')](_0x3ed7e6['body'],{})['then'](respondWithResult(_0x16e4e8,0xc9))[_0xfd03('0x41')](handleError(_0x16e4e8,null));};exports[_0xfd03('0x21')]=function(_0x531a41,_0xb30925){if(_0x531a41['body']['id']){delete _0x531a41[_0xfd03('0x49')]['id'];}return db[_0xfd03('0x29')][_0xfd03('0x47')]({'where':{'id':_0x531a41[_0xfd03('0x43')]['id']}})[_0xfd03('0x22')](handleEntityNotFound(_0xb30925,null))[_0xfd03('0x22')](saveUpdates(_0x531a41[_0xfd03('0x49')],null))['then'](respondWithResult(_0xb30925,null))[_0xfd03('0x41')](handleError(_0xb30925,null));};exports[_0xfd03('0x23')]=function(_0x4906fb,_0x3c411a){return db[_0xfd03('0x29')]['find']({'where':{'id':_0x4906fb[_0xfd03('0x43')]['id']}})[_0xfd03('0x22')](handleEntityNotFound(_0x3c411a,null))[_0xfd03('0x22')](removeEntity(_0x3c411a,null))[_0xfd03('0x41')](handleError(_0x3c411a,null));};exports[_0xfd03('0x4a')]=function(_0x1e2cbe,_0x3b485e){return db[_0xfd03('0x29')][_0xfd03('0x4a')]()[_0xfd03('0x22')](respondWithResult(_0x3b485e,null))[_0xfd03('0x41')](handleError(_0x3b485e,null));}; \ No newline at end of file +var _0x7082=['apply','reject','save','then','destroy','error','stack','name','send','index','MemberReport','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','intersection','length','include','create','body','update','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x7082,0x145));var _0x2708=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x7082[_0x55e839];return _0x39c61a;};'use strict';var pdf=require(_0x2708('0x0'));var emlformat=require(_0x2708('0x1'));var rimraf=require(_0x2708('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2708('0x3'));var rp=require(_0x2708('0x4'));var moment=require(_0x2708('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2708('0x6'));var csv=require('to-csv');var ejs=require(_0x2708('0x7'));var fs=require('fs');var _=require(_0x2708('0x8'));var squel=require(_0x2708('0x9'));var crypto=require(_0x2708('0xa'));var jsforce=require(_0x2708('0xb'));var deskjs=require(_0x2708('0xc'));var toCsv=require(_0x2708('0xd'));var querystring=require(_0x2708('0xe'));var Papa=require(_0x2708('0xf'));var Redis=require('ioredis');var authService=require(_0x2708('0x10'));var qs=require(_0x2708('0x11'));var hardwareService=require(_0x2708('0x12'));var logger=require('../../config/logger')(_0x2708('0x13'));var utils=require('../../config/utils');var config=require(_0x2708('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4860,_0x30fc08){_0x30fc08=_0x30fc08||0xcc;return function(_0x549fd9){if(_0x549fd9){return _0x4e4860[_0x2708('0x15')](_0x30fc08);}return _0x4e4860['status'](_0x30fc08)[_0x2708('0x16')]();};}function respondWithResult(_0x17a3b9,_0x2a51f4){_0x2a51f4=_0x2a51f4||0xc8;return function(_0x4b60c3){if(_0x4b60c3){return _0x17a3b9[_0x2708('0x17')](_0x2a51f4)[_0x2708('0x18')](_0x4b60c3);}};}function respondWithFilteredResult(_0x4c9413,_0x2db6d6){return function(_0x1465d3){if(_0x1465d3){var _0x4d26b9=_0x1465d3[_0x2708('0x19')],_0x206440=_0x2db6d6[_0x2708('0x1a')],_0xa8c084=_0x2db6d6[_0x2708('0x1a')]+_0x2db6d6[_0x2708('0x1b')],_0x47e92d;if(_0xa8c084>=_0x4d26b9){_0xa8c084=_0x4d26b9;_0x47e92d=0xc8;}else{_0x47e92d=0xce;}_0x4c9413['status'](_0x47e92d);return _0x4c9413[_0x2708('0x1c')](_0x2708('0x1d'),_0x206440+'-'+_0xa8c084+'/'+_0x4d26b9)['json'](_0x1465d3);}return null;};}function patchUpdates(_0x9e737f){return function(_0x2e2225){try{jsonpatch[_0x2708('0x1e')](_0x2e2225,_0x9e737f,!![]);}catch(_0x242239){return BPromise[_0x2708('0x1f')](_0x242239);}return _0x2e2225[_0x2708('0x20')]();};}function saveUpdates(_0x21c664,_0x311e5d){return function(_0x312cd8){if(_0x312cd8){return _0x312cd8['update'](_0x21c664)[_0x2708('0x21')](function(_0x196313){return _0x196313;});}return null;};}function removeEntity(_0x3a5d45,_0x5529ec){return function(_0x23a8d9){if(_0x23a8d9){return _0x23a8d9[_0x2708('0x22')]()['then'](function(){_0x3a5d45['status'](0xcc)[_0x2708('0x16')]();});}};}function handleEntityNotFound(_0x1e84fe,_0x39e394){return function(_0x242f92){if(!_0x242f92){_0x1e84fe[_0x2708('0x15')](0x194);}return _0x242f92;};}function handleError(_0xc50dd,_0x172cdd){_0x172cdd=_0x172cdd||0x1f4;return function(_0x39c16b){logger[_0x2708('0x23')](_0x39c16b[_0x2708('0x24')]);if(_0x39c16b['name']){delete _0x39c16b[_0x2708('0x25')];}_0xc50dd[_0x2708('0x17')](_0x172cdd)[_0x2708('0x26')](_0x39c16b);};}exports[_0x2708('0x27')]=function(_0x228d8d,_0x1d43f2){var _0x442e98={},_0x322e9e={},_0x16cc16={'count':0x0,'rows':[]};var _0x2c4202=db[_0x2708('0x28')][_0x2708('0x29')];_0x322e9e[_0x2708('0x2a')]=_[_0x2708('0x2b')](_0x2c4202);_0x322e9e[_0x2708('0x2c')]=_[_0x2708('0x2b')](_0x228d8d[_0x2708('0x2c')]);_0x322e9e[_0x2708('0x2d')]=_['intersection'](_0x322e9e[_0x2708('0x2a')],_0x322e9e['query']);_0x442e98[_0x2708('0x2e')]=_['intersection'](_0x322e9e[_0x2708('0x2a')],qs[_0x2708('0x2f')](_0x228d8d[_0x2708('0x2c')][_0x2708('0x2f')]));_0x442e98[_0x2708('0x2e')]=_0x442e98[_0x2708('0x2e')]['length']?_0x442e98[_0x2708('0x2e')]:_0x322e9e['model'];if(!_0x228d8d['query'][_0x2708('0x30')](_0x2708('0x31'))){_0x442e98[_0x2708('0x1b')]=qs[_0x2708('0x1b')](_0x228d8d[_0x2708('0x2c')]['limit']);_0x442e98[_0x2708('0x1a')]=qs[_0x2708('0x1a')](_0x228d8d[_0x2708('0x2c')]['offset']);}_0x442e98[_0x2708('0x32')]=qs['sort'](_0x228d8d['query'][_0x2708('0x33')]);_0x442e98[_0x2708('0x34')]=qs[_0x2708('0x2d')](_[_0x2708('0x35')](_0x228d8d['query'],_0x322e9e[_0x2708('0x2d')]));if(_0x228d8d[_0x2708('0x2c')][_0x2708('0x36')]){_0x442e98['where']=_[_0x2708('0x37')](_0x442e98[_0x2708('0x34')],{'$or':_['map'](_0x2c4202,function(_0x204df5){if(_0x204df5[_0x2708('0x38')]['key']!==_0x2708('0x39')){var _0x426f61={};_0x426f61[_0x204df5['field']]={'$like':'%'+_0x228d8d[_0x2708('0x2c')]['filter']+'%'};return _0x426f61;}})});}_0x442e98=_['merge']({},_0x442e98,_0x228d8d['options']);var _0x43ff0f={'where':_0x442e98[_0x2708('0x34')]};return db[_0x2708('0x28')]['count'](_0x43ff0f)['then'](function(_0x38c66a){_0x16cc16[_0x2708('0x19')]=_0x38c66a;if(_0x228d8d['query'][_0x2708('0x3a')]){_0x442e98['include']=[{'all':!![]}];}return db[_0x2708('0x28')]['findAll'](_0x442e98);})[_0x2708('0x21')](function(_0x3fd519){_0x16cc16[_0x2708('0x3b')]=_0x3fd519;return _0x16cc16;})[_0x2708('0x21')](respondWithFilteredResult(_0x1d43f2,_0x442e98))[_0x2708('0x3c')](handleError(_0x1d43f2,null));};exports[_0x2708('0x3d')]=function(_0x2b9c26,_0x4b44f9){var _0x48e7d2={'raw':!![],'where':{'id':_0x2b9c26[_0x2708('0x3e')]['id']}},_0x59f993={};_0x59f993[_0x2708('0x2a')]=_[_0x2708('0x2b')](db[_0x2708('0x28')][_0x2708('0x29')]);_0x59f993['query']=_[_0x2708('0x2b')](_0x2b9c26[_0x2708('0x2c')]);_0x59f993['filters']=_['intersection'](_0x59f993['model'],_0x59f993[_0x2708('0x2c')]);_0x48e7d2[_0x2708('0x2e')]=_[_0x2708('0x3f')](_0x59f993[_0x2708('0x2a')],qs[_0x2708('0x2f')](_0x2b9c26['query'][_0x2708('0x2f')]));_0x48e7d2[_0x2708('0x2e')]=_0x48e7d2['attributes'][_0x2708('0x40')]?_0x48e7d2[_0x2708('0x2e')]:_0x59f993[_0x2708('0x2a')];if(_0x2b9c26['query'][_0x2708('0x3a')]){_0x48e7d2[_0x2708('0x41')]=[{'all':!![]}];}_0x48e7d2=_['merge']({},_0x48e7d2,_0x2b9c26['options']);return db[_0x2708('0x28')]['find'](_0x48e7d2)[_0x2708('0x21')](handleEntityNotFound(_0x4b44f9,null))['then'](respondWithResult(_0x4b44f9,null))[_0x2708('0x3c')](handleError(_0x4b44f9,null));};exports['create']=function(_0x5c6d77,_0x4dda45){return db[_0x2708('0x28')][_0x2708('0x42')](_0x5c6d77[_0x2708('0x43')],{})[_0x2708('0x21')](respondWithResult(_0x4dda45,0xc9))[_0x2708('0x3c')](handleError(_0x4dda45,null));};exports[_0x2708('0x44')]=function(_0x811780,_0x1cb96b){if(_0x811780[_0x2708('0x43')]['id']){delete _0x811780[_0x2708('0x43')]['id'];}return db[_0x2708('0x28')]['find']({'where':{'id':_0x811780['params']['id']}})[_0x2708('0x21')](handleEntityNotFound(_0x1cb96b,null))[_0x2708('0x21')](saveUpdates(_0x811780['body'],null))['then'](respondWithResult(_0x1cb96b,null))['catch'](handleError(_0x1cb96b,null));};exports[_0x2708('0x22')]=function(_0x737a7,_0x1baa81){return db[_0x2708('0x28')][_0x2708('0x45')]({'where':{'id':_0x737a7[_0x2708('0x3e')]['id']}})[_0x2708('0x21')](handleEntityNotFound(_0x1baa81,null))['then'](removeEntity(_0x1baa81,null))['catch'](handleError(_0x1baa81,null));};exports[_0x2708('0x46')]=function(_0x390c6b,_0x53ef5e){return db[_0x2708('0x28')]['describe']()[_0x2708('0x21')](respondWithResult(_0x53ef5e,null))[_0x2708('0x3c')](handleError(_0x53ef5e,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 9d3b39f..5635f38 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 _0xa6f0=['../../config/environment','exports','define','report_member','interface','util','../../config/logger','bluebird','rimraf'];(function(_0x44a784,_0x479da0){var _0x70d93a=function(_0x2774b8){while(--_0x2774b8){_0x44a784['push'](_0x44a784['shift']());}};_0x70d93a(++_0x479da0);}(_0xa6f0,0x1be));var _0x0a6f=function(_0x9463b5,_0x2707ba){_0x9463b5=_0x9463b5-0x0;var _0x4ca799=_0xa6f0[_0x9463b5];return _0x4ca799;};'use strict';var _=require('lodash');var util=require(_0x0a6f('0x0'));var logger=require(_0x0a6f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0a6f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6f('0x3'));var config=require(_0x0a6f('0x4'));var attributes=require('./memberReport.attributes');module[_0x0a6f('0x5')]=function(_0x5c0b20,_0xb5161a){return _0x5c0b20[_0x0a6f('0x6')]('MemberReport',attributes,{'tableName':_0x0a6f('0x7'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x0a6f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc462=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','membername_interface','interface','lodash','util','api'];(function(_0x4fc3a2,_0x5d9d9d){var _0x3ebfb9=function(_0xa51f97){while(--_0xa51f97){_0x4fc3a2['push'](_0x4fc3a2['shift']());}};_0x3ebfb9(++_0x5d9d9d);}(_0xc462,0xc0));var _0x2c46=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc462[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x2c46('0x0'));var util=require(_0x2c46('0x1'));var logger=require('../../config/logger')(_0x2c46('0x2'));var moment=require(_0x2c46('0x3'));var BPromise=require(_0x2c46('0x4'));var rp=require(_0x2c46('0x5'));var fs=require('fs');var path=require(_0x2c46('0x6'));var rimraf=require(_0x2c46('0x7'));var config=require(_0x2c46('0x8'));var attributes=require('./memberReport.attributes');module[_0x2c46('0x9')]=function(_0x1b57a8,_0x31d470){return _0x1b57a8[_0x2c46('0xa')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x2c46('0xb'),'fields':['membername',_0x2c46('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 43692c4..700399f 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 _0x088d=['UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','map','include','model','create','raw','CreateMemberReport'];(function(_0x699049,_0x51d7d6){var _0x5e25e4=function(_0x331b29){while(--_0x331b29){_0x699049['push'](_0x699049['shift']());}};_0x5e25e4(++_0x51d7d6);}(_0x088d,0xb6));var _0xd088=function(_0x64d133,_0x566118){_0x64d133=_0x64d133-0x0;var _0x2e558d=_0x088d[_0x64d133];return _0x2e558d;};'use strict';var _=require(_0xd088('0x0'));var util=require(_0xd088('0x1'));var moment=require(_0xd088('0x2'));var BPromise=require(_0xd088('0x3'));var rs=require(_0xd088('0x4'));var fs=require('fs');var Redis=require(_0xd088('0x5'));var db=require(_0xd088('0x6'))['db'];var utils=require(_0xd088('0x7'));var logger=require('../../config/logger')(_0xd088('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd088('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b7303,_0x121e0b,_0x2ab21b){return new BPromise(function(_0x1cbba2,_0x36df4){return client[_0xd088('0xa')](_0x2b7303,_0x2ab21b)[_0xd088('0xb')](function(_0x347a3a){logger[_0xd088('0xc')](_0xd088('0xd'),_0x121e0b,_0xd088('0xe'));logger[_0xd088('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x121e0b,_0xd088('0xe'),JSON[_0xd088('0x10')](_0x347a3a));if(_0x347a3a[_0xd088('0x11')]){if(_0x347a3a['error']['code']===0x1f4){logger[_0xd088('0x11')]('MemberReport,\x20%s,\x20%s',_0x121e0b,_0x347a3a['error'][_0xd088('0x12')]);return _0x36df4(_0x347a3a[_0xd088('0x11')][_0xd088('0x12')]);}logger[_0xd088('0x11')](_0xd088('0xd'),_0x121e0b,_0x347a3a[_0xd088('0x11')]['message']);return _0x1cbba2(_0x347a3a[_0xd088('0x11')][_0xd088('0x12')]);}else{logger[_0xd088('0xc')](_0xd088('0xd'),_0x121e0b,'request\x20sent');_0x1cbba2(_0x347a3a[_0xd088('0x13')][_0xd088('0x12')]);}})[_0xd088('0x14')](function(_0x3af792){logger[_0xd088('0x11')](_0xd088('0xd'),_0x121e0b,_0x3af792);_0x36df4(_0x3af792);});});}exports[_0xd088('0x15')]=function(_0x4f89a4){var _0x393534=this;return new Promise(function(_0x145ea0,_0x46e8f5){return db[_0xd088('0x16')][_0xd088('0x17')]({'raw':_0x4f89a4['options']?_0x4f89a4[_0xd088('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x19')]||null:null,'attributes':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x1a')]||null:null,'limit':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x1b')]||null:null,'include':_0x4f89a4['options']?_0x4f89a4[_0xd088('0x18')]['include']?_[_0xd088('0x1c')](_0x4f89a4[_0xd088('0x18')][_0xd088('0x1d')],function(_0x105d27){return{'model':db[_0x105d27[_0xd088('0x1e')]],'as':_0x105d27['as'],'attributes':_0x105d27[_0xd088('0x1a')],'include':_0x105d27['include']?_['map'](_0x105d27['include'],function(_0x1522c7){return{'model':db[_0x1522c7['model']],'as':_0x1522c7['as'],'attributes':_0x1522c7['attributes'],'include':_0x1522c7['include']?_['map'](_0x1522c7['include'],function(_0x2b237b){return{'model':db[_0x2b237b['model']],'as':_0x2b237b['as'],'attributes':_0x2b237b['attributes']};}):[]};}):[]};}):[]:[]})[_0xd088('0xb')](function(_0x21c339){logger['info']('GetMemberReport',_0x4f89a4);logger[_0xd088('0xf')]('GetMemberReport',_0x4f89a4,JSON['stringify'](_0x21c339));_0x145ea0(_0x21c339);})[_0xd088('0x14')](function(_0x452a21){logger[_0xd088('0x11')](_0xd088('0x15'),_0x452a21[_0xd088('0x12')],_0x4f89a4);_0x46e8f5(_0x393534['error'](0x1f4,_0x452a21[_0xd088('0x12')]));});});};exports['CreateMemberReport']=function(_0x1d4f79){var _0x46264c=this;return new Promise(function(_0x5daa50,_0xc6af85){return db['MemberReport'][_0xd088('0x1f')](_0x1d4f79['body'],{'raw':_0x1d4f79[_0xd088('0x18')]?_0x1d4f79['options'][_0xd088('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xeaada2){logger[_0xd088('0xc')](_0xd088('0x21'),_0x1d4f79);logger[_0xd088('0xf')]('CreateMemberReport',_0x1d4f79,JSON[_0xd088('0x10')](_0xeaada2));_0x5daa50(_0xeaada2);})[_0xd088('0x14')](function(_0x2f017c){logger[_0xd088('0x11')]('CreateMemberReport',_0x2f017c[_0xd088('0x12')],_0x1d4f79);_0xc6af85(_0x46264c[_0xd088('0x11')](0x1f4,_0x2f017c[_0xd088('0x12')]));});});};exports[_0xd088('0x22')]=function(_0x39f263){var _0x50ba41=this;return new Promise(function(_0x40d4d5,_0x223106){return db[_0xd088('0x16')][_0xd088('0x23')](_0x39f263['body'],{'raw':_0x39f263[_0xd088('0x18')]?_0x39f263['options'][_0xd088('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f263['options']?_0x39f263['options'][_0xd088('0x19')]||null:null,'attributes':_0x39f263[_0xd088('0x18')]?_0x39f263[_0xd088('0x18')]['attributes']||null:null,'limit':_0x39f263[_0xd088('0x18')]?_0x39f263[_0xd088('0x18')][_0xd088('0x1b')]||null:null})[_0xd088('0xb')](function(_0x994c9f){logger[_0xd088('0xc')](_0xd088('0x22'),_0x39f263);logger[_0xd088('0xf')](_0xd088('0x22'),_0x39f263,JSON['stringify'](_0x994c9f));_0x40d4d5(_0x994c9f);})[_0xd088('0x14')](function(_0x1e6e2a){logger[_0xd088('0x11')](_0xd088('0x22'),_0x1e6e2a[_0xd088('0x12')],_0x39f263);_0x223106(_0x50ba41['error'](0x1f4,_0x1e6e2a[_0xd088('0x12')]));});});}; \ No newline at end of file +var _0x9419=['stringify','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9419,0x1cd));var _0x9941=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x9419[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0x9941('0x0'));var util=require(_0x9941('0x1'));var moment=require(_0x9941('0x2'));var BPromise=require(_0x9941('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9941('0x4'));var db=require(_0x9941('0x5'))['db'];var utils=require(_0x9941('0x6'));var logger=require(_0x9941('0x7'))(_0x9941('0x8'));var config=require('../../config/environment');var jayson=require(_0x9941('0x9'));var client=jayson[_0x9941('0xa')][_0x9941('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8f5adb,_0x5de59f,_0x30ef32){return new BPromise(function(_0x1350ef,_0x3efbf3){return client[_0x9941('0xc')](_0x8f5adb,_0x30ef32)[_0x9941('0xd')](function(_0x3d3365){logger[_0x9941('0xe')](_0x9941('0xf'),_0x5de59f,_0x9941('0x10'));logger[_0x9941('0x11')](_0x9941('0x12'),_0x5de59f,_0x9941('0x10'),JSON[_0x9941('0x13')](_0x3d3365));if(_0x3d3365[_0x9941('0x14')]){if(_0x3d3365[_0x9941('0x14')][_0x9941('0x15')]===0x1f4){logger['error'](_0x9941('0xf'),_0x5de59f,_0x3d3365['error'][_0x9941('0x16')]);return _0x3efbf3(_0x3d3365[_0x9941('0x14')][_0x9941('0x16')]);}logger[_0x9941('0x14')](_0x9941('0xf'),_0x5de59f,_0x3d3365[_0x9941('0x14')][_0x9941('0x16')]);return _0x1350ef(_0x3d3365[_0x9941('0x14')]['message']);}else{logger['info'](_0x9941('0xf'),_0x5de59f,_0x9941('0x10'));_0x1350ef(_0x3d3365['result'][_0x9941('0x16')]);}})[_0x9941('0x17')](function(_0x376f29){logger[_0x9941('0x14')]('MemberReport,\x20%s,\x20%s',_0x5de59f,_0x376f29);_0x3efbf3(_0x376f29);});});}exports[_0x9941('0x18')]=function(_0x44a7b8){var _0x39c50e=this;return new Promise(function(_0x1b6481,_0x16e043){return db[_0x9941('0x19')][_0x9941('0x1a')]({'raw':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1c')]===undefined?!![]:![]:!![],'where':_0x44a7b8['options']?_0x44a7b8['options'][_0x9941('0x1d')]||null:null,'attributes':_0x44a7b8['options']?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1e')]||null:null,'limit':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x1f')]||null:null,'include':_0x44a7b8[_0x9941('0x1b')]?_0x44a7b8[_0x9941('0x1b')][_0x9941('0x20')]?_[_0x9941('0x21')](_0x44a7b8['options'][_0x9941('0x20')],function(_0x344c91){return{'model':db[_0x344c91[_0x9941('0x22')]],'as':_0x344c91['as'],'attributes':_0x344c91[_0x9941('0x1e')],'include':_0x344c91[_0x9941('0x20')]?_[_0x9941('0x21')](_0x344c91[_0x9941('0x20')],function(_0x420d94){return{'model':db[_0x420d94[_0x9941('0x22')]],'as':_0x420d94['as'],'attributes':_0x420d94[_0x9941('0x1e')],'include':_0x420d94[_0x9941('0x20')]?_[_0x9941('0x21')](_0x420d94[_0x9941('0x20')],function(_0xd9d32d){return{'model':db[_0xd9d32d['model']],'as':_0xd9d32d['as'],'attributes':_0xd9d32d['attributes']};}):[]};}):[]};}):[]:[]})[_0x9941('0xd')](function(_0x8a06a6){logger[_0x9941('0xe')]('GetMemberReport',_0x44a7b8);logger['debug'](_0x9941('0x18'),_0x44a7b8,JSON['stringify'](_0x8a06a6));_0x1b6481(_0x8a06a6);})[_0x9941('0x17')](function(_0x512174){logger['error'](_0x9941('0x18'),_0x512174[_0x9941('0x16')],_0x44a7b8);_0x16e043(_0x39c50e[_0x9941('0x14')](0x1f4,_0x512174[_0x9941('0x16')]));});});};exports[_0x9941('0x23')]=function(_0x52c152){var _0x169e45=this;return new Promise(function(_0x43eae9,_0x3d684a){return db['MemberReport'][_0x9941('0x24')](_0x52c152[_0x9941('0x25')],{'raw':_0x52c152[_0x9941('0x1b')]?_0x52c152[_0x9941('0x1b')][_0x9941('0x1c')]===undefined?!![]:![]:!![]})[_0x9941('0xd')](function(_0x52118c){logger[_0x9941('0xe')](_0x9941('0x23'),_0x52c152);logger[_0x9941('0x11')](_0x9941('0x23'),_0x52c152,JSON['stringify'](_0x52118c));_0x43eae9(_0x52118c);})[_0x9941('0x17')](function(_0x459202){logger[_0x9941('0x14')](_0x9941('0x23'),_0x459202[_0x9941('0x16')],_0x52c152);_0x3d684a(_0x169e45[_0x9941('0x14')](0x1f4,_0x459202[_0x9941('0x16')]));});});};exports[_0x9941('0x26')]=function(_0x5cfc84){var _0x2ce7ad=this;return new Promise(function(_0x287372,_0x26a084){return db['MemberReport'][_0x9941('0x27')](_0x5cfc84[_0x9941('0x25')],{'raw':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84['options'][_0x9941('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84['options'][_0x9941('0x1d')]||null:null,'attributes':_0x5cfc84['options']?_0x5cfc84[_0x9941('0x1b')][_0x9941('0x1e')]||null:null,'limit':_0x5cfc84[_0x9941('0x1b')]?_0x5cfc84[_0x9941('0x1b')][_0x9941('0x1f')]||null:null})[_0x9941('0xd')](function(_0xaa0454){logger[_0x9941('0xe')](_0x9941('0x26'),_0x5cfc84);logger[_0x9941('0x11')](_0x9941('0x26'),_0x5cfc84,JSON[_0x9941('0x13')](_0xaa0454));_0x287372(_0xaa0454);})['catch'](function(_0x4c58e0){logger[_0x9941('0x14')](_0x9941('0x26'),_0x4c58e0['message'],_0x5cfc84);_0x26a084(_0x2ce7ad[_0x9941('0x14')](0x1f4,_0x4c58e0[_0x9941('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 9d7f10e..121eb45 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 _0x8cfd=['Router','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','express'];(function(_0x5169f5,_0x5065e7){var _0x330776=function(_0x136666){while(--_0x136666){_0x5169f5['push'](_0x5169f5['shift']());}};_0x330776(++_0x5065e7);}(_0x8cfd,0xa6));var _0xd8cf=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x8cfd[_0x367361];return _0x195d2d;};'use strict';var multer=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var path=require(_0xd8cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8cf('0x3'));var router=express[_0xd8cf('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8cf('0x5'));var config=require(_0xd8cf('0x6'));var controller=require(_0xd8cf('0x7'));router[_0xd8cf('0x8')]('/',controller['index']);module[_0xd8cf('0x9')]=router; \ No newline at end of file +var _0x7c38=['index','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x7c38,0x98));var _0x87c3=function(_0x282899,_0x12c338){_0x282899=_0x282899-0x0;var _0x13bbb6=_0x7c38[_0x282899];return _0x13bbb6;};'use strict';var multer=require('multer');var util=require(_0x87c3('0x0'));var path=require('path');var timeout=require(_0x87c3('0x1'));var express=require('express');var router=express[_0x87c3('0x2')]();var auth=require(_0x87c3('0x3'));var interaction=require(_0x87c3('0x4'));var config=require(_0x87c3('0x5'));var controller=require(_0x87c3('0x6'));router[_0x87c3('0x7')]('/',controller[_0x87c3('0x8')]);module[_0x87c3('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 d02b82d..2f63ac3 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 _0xf4cf=['exports','STRING','version','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4cf,0x107));var _0xff4c=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xf4cf[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0xff4c('0x0'));module[_0xff4c('0x1')]={'version':{'type':Sequelize[_0xff4c('0x2')],'unique':_0xff4c('0x3')}}; \ No newline at end of file +var _0xef09=['version','sequelize','STRING'];(function(_0xe3bbf3,_0x1e5d36){var _0x1ee802=function(_0x513d09){while(--_0x513d09){_0xe3bbf3['push'](_0xe3bbf3['shift']());}};_0x1ee802(++_0x1e5d36);}(_0xef09,0x1e4));var _0x9ef0=function(_0x99c154,_0x27e9fb){_0x99c154=_0x99c154-0x0;var _0x38974b=_0xef09[_0x99c154];return _0x38974b;};'use strict';var Sequelize=require(_0x9ef0('0x0'));module['exports']={'version':{'type':Sequelize[_0x9ef0('0x1')],'unique':_0x9ef0('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index af8e7bb..dcacfb6 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 _0x25c3=['where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','Migration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x25c3,0xc2));var _0x325c=function(_0x3a3623,_0x53bf4e){_0x3a3623=_0x3a3623-0x0;var _0x338fb0=_0x25c3[_0x3a3623];return _0x338fb0;};'use strict';var pdf=require(_0x325c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x325c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x325c('0x2'));var rp=require(_0x325c('0x3'));var moment=require(_0x325c('0x4'));var BPromise=require(_0x325c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x325c('0x6'));var sox=require(_0x325c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x325c('0x8'));var jsforce=require(_0x325c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x325c('0xa'));var querystring=require('querystring');var Papa=require(_0x325c('0xb'));var Redis=require('ioredis');var authService=require(_0x325c('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x325c('0xd'))(_0x325c('0xe'));var utils=require(_0x325c('0xf'));var config=require(_0x325c('0x10'));var db=require(_0x325c('0x11'))['db'];function respondWithStatusCode(_0x54c883,_0x510852){_0x510852=_0x510852||0xcc;return function(_0x2cf790){if(_0x2cf790){return _0x54c883[_0x325c('0x12')](_0x510852);}return _0x54c883['status'](_0x510852)[_0x325c('0x13')]();};}function respondWithResult(_0x5c20c1,_0x357bd0){_0x357bd0=_0x357bd0||0xc8;return function(_0x440a54){if(_0x440a54){return _0x5c20c1[_0x325c('0x14')](_0x357bd0)[_0x325c('0x15')](_0x440a54);}};}function respondWithFilteredResult(_0xacbd5d,_0x483da5){return function(_0x1a8af1){if(_0x1a8af1){var _0x4c6adb=_0x1a8af1[_0x325c('0x16')],_0x57a378=_0x483da5[_0x325c('0x17')],_0xed253a=_0x483da5[_0x325c('0x17')]+_0x483da5[_0x325c('0x18')],_0x318e95;if(_0xed253a>=_0x4c6adb){_0xed253a=_0x4c6adb;_0x318e95=0xc8;}else{_0x318e95=0xce;}_0xacbd5d[_0x325c('0x14')](_0x318e95);return _0xacbd5d[_0x325c('0x19')](_0x325c('0x1a'),_0x57a378+'-'+_0xed253a+'/'+_0x4c6adb)['json'](_0x1a8af1);}return null;};}function patchUpdates(_0x1addc6){return function(_0x5bc69a){try{jsonpatch[_0x325c('0x1b')](_0x5bc69a,_0x1addc6,!![]);}catch(_0x2b6b1b){return BPromise[_0x325c('0x1c')](_0x2b6b1b);}return _0x5bc69a[_0x325c('0x1d')]();};}function saveUpdates(_0x1e4a51,_0xd418c4){return function(_0x4c8f13){if(_0x4c8f13){return _0x4c8f13[_0x325c('0x1e')](_0x1e4a51)[_0x325c('0x1f')](function(_0x3897ef){return _0x3897ef;});}return null;};}function removeEntity(_0x46a843,_0x47d708){return function(_0x2170d7){if(_0x2170d7){return _0x2170d7[_0x325c('0x20')]()[_0x325c('0x1f')](function(){_0x46a843[_0x325c('0x14')](0xcc)[_0x325c('0x13')]();});}};}function handleEntityNotFound(_0x54aae8,_0xb0afff){return function(_0x55e997){if(!_0x55e997){_0x54aae8[_0x325c('0x12')](0x194);}return _0x55e997;};}function handleError(_0x537e8b,_0x380335){_0x380335=_0x380335||0x1f4;return function(_0x4d4ef8){logger[_0x325c('0x21')](_0x4d4ef8['stack']);if(_0x4d4ef8[_0x325c('0x22')]){delete _0x4d4ef8[_0x325c('0x22')];}_0x537e8b[_0x325c('0x14')](_0x380335)['send'](_0x4d4ef8);};}exports[_0x325c('0x23')]=function(_0x43c668,_0x145cfd){var _0x340fee={},_0xd7231={},_0x3f08f5={'count':0x0,'rows':[]};var _0x31b95b=db[_0x325c('0x24')][_0x325c('0x25')];_0xd7231[_0x325c('0x26')]=_[_0x325c('0x27')](_0x31b95b);_0xd7231['query']=_['keys'](_0x43c668['query']);_0xd7231[_0x325c('0x28')]=_[_0x325c('0x29')](_0xd7231[_0x325c('0x26')],_0xd7231[_0x325c('0x2a')]);_0x340fee[_0x325c('0x2b')]=_[_0x325c('0x29')](_0xd7231[_0x325c('0x26')],qs[_0x325c('0x2c')](_0x43c668['query'][_0x325c('0x2c')]));_0x340fee[_0x325c('0x2b')]=_0x340fee[_0x325c('0x2b')][_0x325c('0x2d')]?_0x340fee['attributes']:_0xd7231[_0x325c('0x26')];if(!_0x43c668[_0x325c('0x2a')][_0x325c('0x2e')]('nolimit')){_0x340fee[_0x325c('0x18')]=qs[_0x325c('0x18')](_0x43c668[_0x325c('0x2a')][_0x325c('0x18')]);_0x340fee[_0x325c('0x17')]=qs[_0x325c('0x17')](_0x43c668[_0x325c('0x2a')][_0x325c('0x17')]);}_0x340fee[_0x325c('0x2f')]=qs['sort'](_0x43c668[_0x325c('0x2a')][_0x325c('0x30')]);_0x340fee['where']=qs[_0x325c('0x28')](_[_0x325c('0x31')](_0x43c668['query'],_0xd7231[_0x325c('0x28')]));if(_0x43c668[_0x325c('0x2a')]['filter']){_0x340fee[_0x325c('0x32')]=_[_0x325c('0x33')](_0x340fee['where'],{'$or':_[_0x325c('0x34')](_0x31b95b,function(_0x5eacbe){if(_0x5eacbe[_0x325c('0x35')]['key']!==_0x325c('0x36')){var _0x3b18f8={};_0x3b18f8[_0x5eacbe[_0x325c('0x37')]]={'$like':'%'+_0x43c668[_0x325c('0x2a')]['filter']+'%'};return _0x3b18f8;}})});}_0x340fee=_[_0x325c('0x33')]({},_0x340fee,_0x43c668[_0x325c('0x38')]);var _0x4699c6={'where':_0x340fee[_0x325c('0x32')]};return db[_0x325c('0x24')][_0x325c('0x16')](_0x4699c6)['then'](function(_0xbb3285){_0x3f08f5[_0x325c('0x16')]=_0xbb3285;if(_0x43c668[_0x325c('0x2a')][_0x325c('0x39')]){_0x340fee[_0x325c('0x3a')]=[{'all':!![]}];}return db[_0x325c('0x24')]['findAll'](_0x340fee);})[_0x325c('0x1f')](function(_0xfdc0f5){_0x3f08f5[_0x325c('0x3b')]=_0xfdc0f5;return _0x3f08f5;})[_0x325c('0x1f')](respondWithFilteredResult(_0x145cfd,_0x340fee))[_0x325c('0x3c')](handleError(_0x145cfd,null));}; \ No newline at end of file +var _0x9688=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','Migration','count','includeAll','include','findAll','catch','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x9688,0xc4));var _0x8968=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9688[_0x160c73];return _0xd9302;};'use strict';var pdf=require(_0x8968('0x0'));var emlformat=require(_0x8968('0x1'));var rimraf=require(_0x8968('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8968('0x3'));var rp=require('request-promise');var moment=require(_0x8968('0x4'));var BPromise=require(_0x8968('0x5'));var Mustache=require(_0x8968('0x6'));var util=require('util');var path=require(_0x8968('0x7'));var sox=require('sox');var csv=require(_0x8968('0x8'));var ejs=require(_0x8968('0x9'));var fs=require('fs');var _=require(_0x8968('0xa'));var squel=require(_0x8968('0xb'));var crypto=require(_0x8968('0xc'));var jsforce=require(_0x8968('0xd'));var deskjs=require(_0x8968('0xe'));var toCsv=require(_0x8968('0x8'));var querystring=require('querystring');var Papa=require(_0x8968('0xf'));var Redis=require(_0x8968('0x10'));var authService=require(_0x8968('0x11'));var qs=require(_0x8968('0x12'));var hardwareService=require(_0x8968('0x13'));var logger=require('../../config/logger')(_0x8968('0x14'));var utils=require(_0x8968('0x15'));var config=require(_0x8968('0x16'));var db=require(_0x8968('0x17'))['db'];function respondWithStatusCode(_0x3cadc8,_0x320006){_0x320006=_0x320006||0xcc;return function(_0x1df88b){if(_0x1df88b){return _0x3cadc8[_0x8968('0x18')](_0x320006);}return _0x3cadc8[_0x8968('0x19')](_0x320006)['end']();};}function respondWithResult(_0x2d2a5b,_0x417a28){_0x417a28=_0x417a28||0xc8;return function(_0x50ac70){if(_0x50ac70){return _0x2d2a5b['status'](_0x417a28)[_0x8968('0x1a')](_0x50ac70);}};}function respondWithFilteredResult(_0x554414,_0x127109){return function(_0x45dd5b){if(_0x45dd5b){var _0x53b4be=_0x45dd5b['count'],_0x480125=_0x127109[_0x8968('0x1b')],_0x27afe0=_0x127109[_0x8968('0x1b')]+_0x127109[_0x8968('0x1c')],_0x57a89c;if(_0x27afe0>=_0x53b4be){_0x27afe0=_0x53b4be;_0x57a89c=0xc8;}else{_0x57a89c=0xce;}_0x554414['status'](_0x57a89c);return _0x554414[_0x8968('0x1d')](_0x8968('0x1e'),_0x480125+'-'+_0x27afe0+'/'+_0x53b4be)[_0x8968('0x1a')](_0x45dd5b);}return null;};}function patchUpdates(_0x4ae830){return function(_0x3ab9bf){try{jsonpatch[_0x8968('0x1f')](_0x3ab9bf,_0x4ae830,!![]);}catch(_0x2212e1){return BPromise['reject'](_0x2212e1);}return _0x3ab9bf[_0x8968('0x20')]();};}function saveUpdates(_0x3dc636,_0xc6d5ce){return function(_0x35d324){if(_0x35d324){return _0x35d324[_0x8968('0x21')](_0x3dc636)[_0x8968('0x22')](function(_0x198bc7){return _0x198bc7;});}return null;};}function removeEntity(_0x3f55f3,_0x55f2b2){return function(_0x352373){if(_0x352373){return _0x352373[_0x8968('0x23')]()[_0x8968('0x22')](function(){_0x3f55f3[_0x8968('0x19')](0xcc)[_0x8968('0x24')]();});}};}function handleEntityNotFound(_0x169328,_0x5699c4){return function(_0x10869b){if(!_0x10869b){_0x169328['sendStatus'](0x194);}return _0x10869b;};}function handleError(_0x27a51c,_0x25edbb){_0x25edbb=_0x25edbb||0x1f4;return function(_0x5bd3f2){logger['error'](_0x5bd3f2[_0x8968('0x25')]);if(_0x5bd3f2[_0x8968('0x26')]){delete _0x5bd3f2[_0x8968('0x26')];}_0x27a51c[_0x8968('0x19')](_0x25edbb)[_0x8968('0x27')](_0x5bd3f2);};}exports[_0x8968('0x28')]=function(_0x41eee3,_0x6f65ed){var _0x55ee3e={},_0x5f0902={},_0x5ca920={'count':0x0,'rows':[]};var _0x3fd4fe=db['Migration'][_0x8968('0x29')];_0x5f0902[_0x8968('0x2a')]=_[_0x8968('0x2b')](_0x3fd4fe);_0x5f0902[_0x8968('0x2c')]=_[_0x8968('0x2b')](_0x41eee3[_0x8968('0x2c')]);_0x5f0902[_0x8968('0x2d')]=_[_0x8968('0x2e')](_0x5f0902[_0x8968('0x2a')],_0x5f0902[_0x8968('0x2c')]);_0x55ee3e[_0x8968('0x2f')]=_[_0x8968('0x2e')](_0x5f0902[_0x8968('0x2a')],qs[_0x8968('0x30')](_0x41eee3['query'][_0x8968('0x30')]));_0x55ee3e[_0x8968('0x2f')]=_0x55ee3e[_0x8968('0x2f')][_0x8968('0x31')]?_0x55ee3e['attributes']:_0x5f0902[_0x8968('0x2a')];if(!_0x41eee3[_0x8968('0x2c')]['hasOwnProperty'](_0x8968('0x32'))){_0x55ee3e['limit']=qs[_0x8968('0x1c')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x1c')]);_0x55ee3e['offset']=qs[_0x8968('0x1b')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x1b')]);}_0x55ee3e[_0x8968('0x33')]=qs[_0x8968('0x34')](_0x41eee3[_0x8968('0x2c')][_0x8968('0x34')]);_0x55ee3e[_0x8968('0x35')]=qs['filters'](_[_0x8968('0x36')](_0x41eee3['query'],_0x5f0902[_0x8968('0x2d')]));if(_0x41eee3[_0x8968('0x2c')][_0x8968('0x37')]){_0x55ee3e[_0x8968('0x35')]=_[_0x8968('0x38')](_0x55ee3e['where'],{'$or':_[_0x8968('0x39')](_0x3fd4fe,function(_0x46cd90){if(_0x46cd90[_0x8968('0x3a')][_0x8968('0x3b')]!==_0x8968('0x3c')){var _0x373571={};_0x373571[_0x46cd90[_0x8968('0x3d')]]={'$like':'%'+_0x41eee3[_0x8968('0x2c')][_0x8968('0x37')]+'%'};return _0x373571;}})});}_0x55ee3e=_[_0x8968('0x38')]({},_0x55ee3e,_0x41eee3['options']);var _0x3147fd={'where':_0x55ee3e[_0x8968('0x35')]};return db[_0x8968('0x3e')][_0x8968('0x3f')](_0x3147fd)[_0x8968('0x22')](function(_0x3f073b){_0x5ca920[_0x8968('0x3f')]=_0x3f073b;if(_0x41eee3[_0x8968('0x2c')][_0x8968('0x40')]){_0x55ee3e[_0x8968('0x41')]=[{'all':!![]}];}return db[_0x8968('0x3e')][_0x8968('0x42')](_0x55ee3e);})[_0x8968('0x22')](function(_0x111a7d){_0x5ca920['rows']=_0x111a7d;return _0x5ca920;})[_0x8968('0x22')](respondWithFilteredResult(_0x6f65ed,_0x55ee3e))[_0x8968('0x43')](handleError(_0x6f65ed,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 0722fa5..4b6ca5d 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 _0xf47f=['rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a78d6,_0x140c67){var _0x30884a=function(_0x585924){while(--_0x585924){_0x1a78d6['push'](_0x1a78d6['shift']());}};_0x30884a(++_0x140c67);}(_0xf47f,0xa2));var _0xff47=function(_0x143d33,_0x5ae149){_0x143d33=_0x143d33-0x0;var _0x2ec94e=_0xf47f[_0x143d33];return _0x2ec94e;};'use strict';var _=require(_0xff47('0x0'));var util=require(_0xff47('0x1'));var logger=require(_0xff47('0x2'))(_0xff47('0x3'));var moment=require(_0xff47('0x4'));var BPromise=require(_0xff47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff47('0x6'));var config=require('../../config/environment');var attributes=require(_0xff47('0x7'));module[_0xff47('0x8')]=function(_0x4c723b,_0x3a9775){return _0x4c723b[_0xff47('0x9')](_0xff47('0xa'),attributes,{'tableName':_0xff47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35cb=['bluebird','request-promise','path','rimraf','../../config/environment','define','Migration','util','../../config/logger','api','moment'];(function(_0x12bbc6,_0x1a3eb3){var _0x26a056=function(_0x12626e){while(--_0x12626e){_0x12bbc6['push'](_0x12bbc6['shift']());}};_0x26a056(++_0x1a3eb3);}(_0x35cb,0xe3));var _0xb35c=function(_0x14cd91,_0x4ae5ce){_0x14cd91=_0x14cd91-0x0;var _0x8bb2e6=_0x35cb[_0x14cd91];return _0x8bb2e6;};'use strict';var _=require('lodash');var util=require(_0xb35c('0x0'));var logger=require(_0xb35c('0x1'))(_0xb35c('0x2'));var moment=require(_0xb35c('0x3'));var BPromise=require(_0xb35c('0x4'));var rp=require(_0xb35c('0x5'));var fs=require('fs');var path=require(_0xb35c('0x6'));var rimraf=require(_0xb35c('0x7'));var config=require(_0xb35c('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x29c2d3,_0x441f83){return _0x29c2d3[_0xb35c('0x9')](_0xb35c('0xa'),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 59a04aa..7f549b5 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 _0x5178=['request','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x5178,0x171));var _0x8517=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5178[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x268880,_0x840a79){var _0x53c0b4=function(_0x23864f){while(--_0x23864f){_0x268880['push'](_0x268880['shift']());}};_0x53c0b4(++_0x840a79);}(_0x00bb,0x1d8));var _0xb00b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x00bb[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0972654..6d40e05 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 _0xfe5d=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe5d,0x1ba));var _0xdfe5=function(_0x40c9af,_0x56d817){_0x40c9af=_0x40c9af-0x0;var _0x4dc475=_0xfe5d[_0x40c9af];return _0x4dc475;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdfe5('0x0'));var timeout=require('connect-timeout');var express=require(_0xdfe5('0x1'));var router=express[_0xdfe5('0x2')]();var auth=require(_0xdfe5('0x3'));var interaction=require(_0xdfe5('0x4'));var config=require(_0xdfe5('0x5'));var controller=require(_0xdfe5('0x6'));router[_0xdfe5('0x7')]('/',auth[_0xdfe5('0x8')](),controller[_0xdfe5('0x9')]);router['get'](_0xdfe5('0xa'),auth[_0xdfe5('0x8')](),controller[_0xdfe5('0xb')]);router[_0xdfe5('0xc')]('/',auth[_0xdfe5('0x8')](),controller['create']);router[_0xdfe5('0xd')](_0xdfe5('0xa'),auth[_0xdfe5('0x8')](),controller[_0xdfe5('0xe')]);router[_0xdfe5('0xf')]('/:id',auth[_0xdfe5('0x8')](),controller[_0xdfe5('0x10')]);module[_0xdfe5('0x11')]=router; \ No newline at end of file +var _0x3aca=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3766f4,_0x580673){var _0x183f88=function(_0x4be9ac){while(--_0x4be9ac){_0x3766f4['push'](_0x3766f4['shift']());}};_0x183f88(++_0x580673);}(_0x3aca,0xea));var _0xa3ac=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x3aca[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xa3ac('0x0'));var util=require(_0xa3ac('0x1'));var path=require(_0xa3ac('0x2'));var timeout=require(_0xa3ac('0x3'));var express=require(_0xa3ac('0x4'));var router=express[_0xa3ac('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa3ac('0x6'));var controller=require(_0xa3ac('0x7'));router[_0xa3ac('0x8')]('/',auth[_0xa3ac('0x9')](),controller[_0xa3ac('0xa')]);router[_0xa3ac('0x8')](_0xa3ac('0xb'),auth['isAuthenticated'](),controller[_0xa3ac('0xc')]);router[_0xa3ac('0xd')]('/',auth['isAuthenticated'](),controller[_0xa3ac('0xe')]);router[_0xa3ac('0xf')](_0xa3ac('0xb'),auth[_0xa3ac('0x9')](),controller['update']);router[_0xa3ac('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa3ac('0x11')]);module[_0xa3ac('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 9b7cebc..450f5e8 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 _0x69ff=['sequelize','exports','localnet','externip','STRING'];(function(_0x3d4804,_0x48cfc0){var _0x2d8b76=function(_0x4866c1){while(--_0x4866c1){_0x3d4804['push'](_0x3d4804['shift']());}};_0x2d8b76(++_0x48cfc0);}(_0x69ff,0xaf));var _0xf69f=function(_0x1e59d8,_0x90c61a){_0x1e59d8=_0x1e59d8-0x0;var _0x5055b3=_0x69ff[_0x1e59d8];return _0x5055b3;};'use strict';var Sequelize=require(_0xf69f('0x0'));module[_0xf69f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf69f('0x2'),_0xf69f('0x3'))},'value':{'type':Sequelize[_0xf69f('0x4')]}}; \ No newline at end of file +var _0x28d5=['externip','STRING','sequelize','exports','ENUM','localnet'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x28d5,0xf8));var _0x528d=function(_0x58235f,_0x5e3186){_0x58235f=_0x58235f-0x0;var _0x461ccc=_0x28d5[_0x58235f];return _0x461ccc;};'use strict';var Sequelize=require(_0x528d('0x0'));module[_0x528d('0x1')]={'type':{'type':Sequelize[_0x528d('0x2')](_0x528d('0x3'),_0x528d('0x4'))},'value':{'type':Sequelize[_0x528d('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d3b2f33..3059205 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 _0xe19d=['VIRTUAL','include','findAll','show','params','includeAll','options','create','transaction','body','type','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','render','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','Network,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','end','stack','name','index','Network','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key'];(function(_0x47643e,_0x337374){var _0x2aa5db=function(_0x5dcbf2){while(--_0x5dcbf2){_0x47643e['push'](_0x47643e['shift']());}};_0x2aa5db(++_0x337374);}(_0xe19d,0xe6));var _0xde19=function(_0x1427e2,_0x5a60ba){_0x1427e2=_0x1427e2-0x0;var _0x3b2772=_0xe19d[_0x1427e2];return _0x3b2772;};'use strict';var pdf=require(_0xde19('0x0'));var emlformat=require(_0xde19('0x1'));var rimraf=require(_0xde19('0x2'));var zipdir=require(_0xde19('0x3'));var jsonpatch=require(_0xde19('0x4'));var rp=require(_0xde19('0x5'));var moment=require(_0xde19('0x6'));var BPromise=require(_0xde19('0x7'));var Mustache=require(_0xde19('0x8'));var util=require(_0xde19('0x9'));var path=require(_0xde19('0xa'));var sox=require(_0xde19('0xb'));var csv=require(_0xde19('0xc'));var ejs=require(_0xde19('0xd'));var fs=require('fs');var _=require(_0xde19('0xe'));var squel=require(_0xde19('0xf'));var crypto=require(_0xde19('0x10'));var jsforce=require(_0xde19('0x11'));var deskjs=require(_0xde19('0x12'));var toCsv=require(_0xde19('0xc'));var querystring=require(_0xde19('0x13'));var Papa=require(_0xde19('0x14'));var Redis=require(_0xde19('0x15'));var authService=require(_0xde19('0x16'));var qs=require(_0xde19('0x17'));var hardwareService=require(_0xde19('0x18'));var logger=require('../../config/logger')(_0xde19('0x19'));var utils=require(_0xde19('0x1a'));var config=require(_0xde19('0x1b'));var db=require(_0xde19('0x1c'))['db'];var jayson=require(_0xde19('0x1d'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5bb1ea,_0x1679c,_0x3aab35){if(_0x3aab35){var _0x30381a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30381a[_0xde19('0x1e')](_0x1679c)){return _0x5bb1ea;}else{throw new Error(_0xde19('0x1f'));}}else{return _0x5bb1ea;}}function respondWithRpcPromise(_0x28b477,_0x5bba80,_0x440e31,_0x5e7e91){return new BPromise(function(_0x261ae2,_0x4a8bb7){var _0x5528bb=_0x5e7e91||client;return _0x5528bb[_0xde19('0x20')](_0x28b477,_0x440e31)[_0xde19('0x21')](function(_0x954c72){logger[_0xde19('0x22')]('Network,\x20%s,\x20%s',_0x5bba80,_0xde19('0x23'));logger[_0xde19('0x24')](_0xde19('0x25'),_0x5bba80,_0xde19('0x23'),JSON[_0xde19('0x26')](_0x954c72));if(_0x954c72['error']){if(_0x954c72['error'][_0xde19('0x27')]===0x1f4){logger['error'](_0xde19('0x28'),_0x5bba80,_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);return _0x4a8bb7(_0x954c72[_0xde19('0x29')]['message']);}logger[_0xde19('0x29')](_0xde19('0x28'),_0x5bba80,_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);return _0x261ae2(_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);}else{logger[_0xde19('0x22')](_0xde19('0x28'),_0x5bba80,'request\x20sent');_0x261ae2(_0x954c72[_0xde19('0x2b')][_0xde19('0x2a')]);}})[_0xde19('0x2c')](function(_0x64eb32){logger[_0xde19('0x29')](_0xde19('0x28'),_0x5bba80,_0x64eb32);_0x4a8bb7(_0x64eb32);});});}function respondWithStatusCode(_0x31ebd7,_0x369a8e){_0x369a8e=_0x369a8e||0xcc;return function(_0x5330ee){if(_0x5330ee){return _0x31ebd7[_0xde19('0x2d')](_0x369a8e);}return _0x31ebd7[_0xde19('0x2e')](_0x369a8e)['end']();};}function respondWithResult(_0x1320aa,_0x117511){_0x117511=_0x117511||0xc8;return function(_0x5d1042){if(_0x5d1042){return _0x1320aa[_0xde19('0x2e')](_0x117511)[_0xde19('0x2f')](_0x5d1042);}};}function respondWithFilteredResult(_0x4b829f,_0x2c79ca){return function(_0x4db06a){if(_0x4db06a){var _0x254bea=_0x4db06a[_0xde19('0x30')],_0x48938d=_0x2c79ca[_0xde19('0x31')],_0x3e6bb8=_0x2c79ca[_0xde19('0x31')]+_0x2c79ca[_0xde19('0x32')],_0x2ea9d8;if(_0x3e6bb8>=_0x254bea){_0x3e6bb8=_0x254bea;_0x2ea9d8=0xc8;}else{_0x2ea9d8=0xce;}_0x4b829f[_0xde19('0x2e')](_0x2ea9d8);return _0x4b829f[_0xde19('0x33')]('Content-Range',_0x48938d+'-'+_0x3e6bb8+'/'+_0x254bea)[_0xde19('0x2f')](_0x4db06a);}return null;};}function patchUpdates(_0x15447d){return function(_0x1254e2){try{jsonpatch[_0xde19('0x34')](_0x1254e2,_0x15447d,!![]);}catch(_0x110f04){return BPromise[_0xde19('0x35')](_0x110f04);}return _0x1254e2[_0xde19('0x36')]();};}function saveUpdates(_0x58950a,_0x120922){return function(_0x47cdc0){if(_0x47cdc0){return _0x47cdc0[_0xde19('0x37')](_0x58950a)['then'](function(_0x419511){return _0x419511;});}return null;};}function removeEntity(_0x1b64f5,_0x368cfa){return function(_0x16caec){if(_0x16caec){return _0x16caec[_0xde19('0x38')]()[_0xde19('0x21')](function(){_0x1b64f5[_0xde19('0x2e')](0xcc)[_0xde19('0x39')]();});}};}function handleEntityNotFound(_0x5a56fa,_0x130baa){return function(_0x3ed977){if(!_0x3ed977){_0x5a56fa[_0xde19('0x2d')](0x194);}return _0x3ed977;};}function handleError(_0x3e88d0,_0x99d155){_0x99d155=_0x99d155||0x1f4;return function(_0x19a3e0){logger[_0xde19('0x29')](_0x19a3e0[_0xde19('0x3a')]);if(_0x19a3e0['name']){delete _0x19a3e0[_0xde19('0x3b')];}_0x3e88d0[_0xde19('0x2e')](_0x99d155)['send'](_0x19a3e0);};}exports[_0xde19('0x3c')]=function(_0x2a2ed,_0x1ff590){var _0x28bcc8={},_0x592ad9={},_0x1051da={'count':0x0,'rows':[]};var _0x34a489=db[_0xde19('0x3d')][_0xde19('0x3e')];_0x592ad9[_0xde19('0x3f')]=_[_0xde19('0x40')](_0x34a489);_0x592ad9[_0xde19('0x41')]=_[_0xde19('0x40')](_0x2a2ed[_0xde19('0x41')]);_0x592ad9[_0xde19('0x42')]=_['intersection'](_0x592ad9[_0xde19('0x3f')],_0x592ad9['query']);_0x28bcc8[_0xde19('0x43')]=_[_0xde19('0x44')](_0x592ad9[_0xde19('0x3f')],qs[_0xde19('0x45')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x45')]));_0x28bcc8['attributes']=_0x28bcc8['attributes'][_0xde19('0x46')]?_0x28bcc8[_0xde19('0x43')]:_0x592ad9[_0xde19('0x3f')];if(!_0x2a2ed['query'][_0xde19('0x47')](_0xde19('0x48'))){_0x28bcc8[_0xde19('0x32')]=qs[_0xde19('0x32')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x32')]);_0x28bcc8[_0xde19('0x31')]=qs[_0xde19('0x31')](_0x2a2ed[_0xde19('0x41')]['offset']);}_0x28bcc8['order']=qs[_0xde19('0x49')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x49')]);_0x28bcc8[_0xde19('0x4a')]=qs['filters'](_[_0xde19('0x4b')](_0x2a2ed[_0xde19('0x41')],_0x592ad9[_0xde19('0x42')]));if(_0x2a2ed[_0xde19('0x41')][_0xde19('0x4c')]){_0x28bcc8[_0xde19('0x4a')]=_[_0xde19('0x4d')](_0x28bcc8[_0xde19('0x4a')],{'$or':_['map'](_0x34a489,function(_0x2b648){if(_0x2b648['type'][_0xde19('0x4e')]!==_0xde19('0x4f')){var _0xa74496={};_0xa74496[_0x2b648['field']]={'$like':'%'+_0x2a2ed[_0xde19('0x41')][_0xde19('0x4c')]+'%'};return _0xa74496;}})});}_0x28bcc8=_[_0xde19('0x4d')]({},_0x28bcc8,_0x2a2ed['options']);var _0x1c7cef={'where':_0x28bcc8[_0xde19('0x4a')]};return db[_0xde19('0x3d')][_0xde19('0x30')](_0x1c7cef)[_0xde19('0x21')](function(_0x1167b3){_0x1051da[_0xde19('0x30')]=_0x1167b3;if(_0x2a2ed[_0xde19('0x41')]['includeAll']){_0x28bcc8[_0xde19('0x50')]=[{'all':!![]}];}return db['Network'][_0xde19('0x51')](_0x28bcc8);})[_0xde19('0x21')](function(_0x2b9fdf){_0x1051da['rows']=_0x2b9fdf;return _0x1051da;})[_0xde19('0x21')](respondWithFilteredResult(_0x1ff590,_0x28bcc8))[_0xde19('0x2c')](handleError(_0x1ff590,null));};exports[_0xde19('0x52')]=function(_0x24ff23,_0x39291d){var _0x58c92a={'raw':!![],'where':{'id':_0x24ff23[_0xde19('0x53')]['id']}},_0x5773d6={};_0x5773d6['model']=_['keys'](db['Network'][_0xde19('0x3e')]);_0x5773d6['query']=_[_0xde19('0x40')](_0x24ff23['query']);_0x5773d6['filters']=_[_0xde19('0x44')](_0x5773d6['model'],_0x5773d6[_0xde19('0x41')]);_0x58c92a[_0xde19('0x43')]=_[_0xde19('0x44')](_0x5773d6['model'],qs[_0xde19('0x45')](_0x24ff23[_0xde19('0x41')][_0xde19('0x45')]));_0x58c92a[_0xde19('0x43')]=_0x58c92a[_0xde19('0x43')][_0xde19('0x46')]?_0x58c92a[_0xde19('0x43')]:_0x5773d6[_0xde19('0x3f')];if(_0x24ff23[_0xde19('0x41')][_0xde19('0x54')]){_0x58c92a[_0xde19('0x50')]=[{'all':!![]}];}_0x58c92a=_[_0xde19('0x4d')]({},_0x58c92a,_0x24ff23[_0xde19('0x55')]);return db['Network']['find'](_0x58c92a)[_0xde19('0x21')](handleEntityNotFound(_0x39291d,null))[_0xde19('0x21')](respondWithResult(_0x39291d,null))['catch'](handleError(_0x39291d,null));};exports[_0xde19('0x56')]=function(_0x4323bd,_0x3c02e4,_0x449974){var _0x33cfe4;return db['sequelize'][_0xde19('0x57')](function(_0x44024c){return db[_0xde19('0x3d')][_0xde19('0x56')](_0x4323bd[_0xde19('0x58')],{'raw':!![]})[_0xde19('0x21')](function(_0x43a1bc){_0x33cfe4=_0x43a1bc;return db[_0xde19('0x3d')][_0xde19('0x51')]({'where':{'type':_0x4323bd[_0xde19('0x58')][_0xde19('0x59')]},'raw':!![]});})[_0xde19('0x21')](function(_0x29839b){var _0x401e64=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),_0xde19('0x5e'));var _0x27e5ee=ejs['render'](_0x401e64,{'networks':_0x29839b||[]});fs[_0xde19('0x5f')](util['format'](_0xde19('0x60'),_0x4323bd[_0xde19('0x58')]['type'][_0xde19('0x61')]()),_0x27e5ee);})['then'](function(){return respondWithRpcPromise(_0xde19('0x62'),'create',{'module':_0xde19('0x63')});})[_0xde19('0x21')](function(){return _0x33cfe4;});})[_0xde19('0x21')](respondWithResult(_0x3c02e4,0xc9))['catch'](handleError(_0x3c02e4,null));};exports[_0xde19('0x37')]=function(_0x46f5a2,_0x31df87,_0x1c81cf){var _0x135fa2;return db['sequelize']['transaction'](function(_0x2f5933){return db[_0xde19('0x3d')][_0xde19('0x64')]({'where':{'id':_0x46f5a2[_0xde19('0x53')]['id']}})[_0xde19('0x21')](handleEntityNotFound(_0x31df87,null))['then'](saveUpdates(_0x46f5a2[_0xde19('0x58')],null))['then'](function(_0x470553){if(_0x470553){_0x135fa2=_0x470553;return db['Network']['findAll']({'where':{'type':_0x135fa2[_0xde19('0x59')]},'raw':!![]});}return null;})[_0xde19('0x21')](function(_0xff00c7){if(_0xff00c7){var _0x57cdf3=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),'utf8');var _0xc53359=ejs[_0xde19('0x65')](_0x57cdf3,{'networks':_0xff00c7||[]});fs[_0xde19('0x5f')](util[_0xde19('0x66')](_0xde19('0x60'),_0x135fa2[_0xde19('0x59')][_0xde19('0x61')]()),_0xc53359);return respondWithRpcPromise(_0xde19('0x62'),'update',{'module':_0xde19('0x63')});}return null;})['then'](function(_0x1f14cf){if(_0x1f14cf){return _0x135fa2;}return null;});})[_0xde19('0x21')](respondWithResult(_0x31df87,null))[_0xde19('0x2c')](handleError(_0x31df87,null));};exports['destroy']=function(_0x55a7f2,_0x1f874d,_0x34d5a4){var _0x5b21d2;return db[_0xde19('0x3d')][_0xde19('0x64')]({'where':{'id':_0x55a7f2[_0xde19('0x53')]['id']}})['then'](function(_0x3839c4){_0x5b21d2=_0x3839c4;return _0x3839c4;})[_0xde19('0x21')](handleEntityNotFound(_0x1f874d,null))[_0xde19('0x21')](removeEntity(_0x1f874d,null))[_0xde19('0x21')](function(){if(_0x5b21d2){return db[_0xde19('0x3d')][_0xde19('0x51')]({'where':{'type':_0x5b21d2[_0xde19('0x59')]},'raw':!![]});}})[_0xde19('0x21')](function(_0x1a3406){if(_0x1a3406){var _0x351690=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),_0xde19('0x5e'));var _0x5e959b=ejs[_0xde19('0x65')](_0x351690,{'networks':_0x1a3406||[]});fs[_0xde19('0x5f')](util[_0xde19('0x66')](_0xde19('0x60'),_0x5b21d2[_0xde19('0x59')][_0xde19('0x61')]()),_0x5e959b);return respondWithRpcPromise(_0xde19('0x62'),'destroy',{'module':_0xde19('0x63')});}})['catch'](handleError(_0x1f874d,null));}; \ No newline at end of file +var _0xb14c=['find','create','sequelize','transaction','findAll','body','readFileSync','join','root','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','catch','server/files/templates/network.ejs','utf8','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','status','end','count','offset','Content-Range','json','apply','reject','save','update','sendStatus','name','index','Network','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','merge','map','type','key','VIRTUAL','field','includeAll','include','show','params','fields'];(function(_0x42dab9,_0x22de42){var _0x8ab5ea=function(_0x4b7ec1){while(--_0x4b7ec1){_0x42dab9['push'](_0x42dab9['shift']());}};_0x8ab5ea(++_0x22de42);}(_0xb14c,0xd4));var _0xcb14=function(_0x486eff,_0x5cb3b0){_0x486eff=_0x486eff-0x0;var _0x95293b=_0xb14c[_0x486eff];return _0x95293b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcb14('0x0'));var rimraf=require(_0xcb14('0x1'));var zipdir=require(_0xcb14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb14('0x3'));var moment=require(_0xcb14('0x4'));var BPromise=require(_0xcb14('0x5'));var Mustache=require(_0xcb14('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcb14('0x7'));var csv=require(_0xcb14('0x8'));var ejs=require(_0xcb14('0x9'));var fs=require('fs');var _=require(_0xcb14('0xa'));var squel=require(_0xcb14('0xb'));var crypto=require(_0xcb14('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcb14('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb14('0xe'));var Papa=require(_0xcb14('0xf'));var Redis=require(_0xcb14('0x10'));var authService=require(_0xcb14('0x11'));var qs=require(_0xcb14('0x12'));var hardwareService=require(_0xcb14('0x13'));var logger=require(_0xcb14('0x14'))(_0xcb14('0x15'));var utils=require(_0xcb14('0x16'));var config=require('../../config/environment');var db=require(_0xcb14('0x17'))['db'];var jayson=require(_0xcb14('0x18'));var client=jayson[_0xcb14('0x19')][_0xcb14('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x504a6a,_0x18c0ee,_0x1b34bb){if(_0x1b34bb){var _0x4ebd97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ebd97['test'](_0x18c0ee)){return _0x504a6a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x504a6a;}}function respondWithRpcPromise(_0x1d8627,_0x3b737d,_0x19eb13,_0x4f1e48){return new BPromise(function(_0x1484db,_0x40211f){var _0x144d98=_0x4f1e48||client;return _0x144d98[_0xcb14('0x1b')](_0x1d8627,_0x19eb13)[_0xcb14('0x1c')](function(_0x4d0b08){logger['info'](_0xcb14('0x1d'),_0x3b737d,'request\x20sent');logger['debug'](_0xcb14('0x1e'),_0x3b737d,_0xcb14('0x1f'),JSON[_0xcb14('0x20')](_0x4d0b08));if(_0x4d0b08[_0xcb14('0x21')]){if(_0x4d0b08['error'][_0xcb14('0x22')]===0x1f4){logger[_0xcb14('0x21')]('Network,\x20%s,\x20%s',_0x3b737d,_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);return _0x40211f(_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);}logger[_0xcb14('0x21')](_0xcb14('0x1d'),_0x3b737d,_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);return _0x1484db(_0x4d0b08[_0xcb14('0x21')][_0xcb14('0x23')]);}else{logger[_0xcb14('0x24')](_0xcb14('0x1d'),_0x3b737d,_0xcb14('0x1f'));_0x1484db(_0x4d0b08[_0xcb14('0x25')][_0xcb14('0x23')]);}})['catch'](function(_0x51be0e){logger[_0xcb14('0x21')](_0xcb14('0x1d'),_0x3b737d,_0x51be0e);_0x40211f(_0x51be0e);});});}function respondWithStatusCode(_0x525bbd,_0x454eb7){_0x454eb7=_0x454eb7||0xcc;return function(_0xd38d7d){if(_0xd38d7d){return _0x525bbd['sendStatus'](_0x454eb7);}return _0x525bbd[_0xcb14('0x26')](_0x454eb7)[_0xcb14('0x27')]();};}function respondWithResult(_0x385b71,_0x1adba6){_0x1adba6=_0x1adba6||0xc8;return function(_0x27aa8a){if(_0x27aa8a){return _0x385b71[_0xcb14('0x26')](_0x1adba6)['json'](_0x27aa8a);}};}function respondWithFilteredResult(_0x1ba536,_0x477c09){return function(_0x196c08){if(_0x196c08){var _0x416a6b=_0x196c08[_0xcb14('0x28')],_0xc366cd=_0x477c09[_0xcb14('0x29')],_0x2e4e8e=_0x477c09['offset']+_0x477c09['limit'],_0x5bdb59;if(_0x2e4e8e>=_0x416a6b){_0x2e4e8e=_0x416a6b;_0x5bdb59=0xc8;}else{_0x5bdb59=0xce;}_0x1ba536['status'](_0x5bdb59);return _0x1ba536['set'](_0xcb14('0x2a'),_0xc366cd+'-'+_0x2e4e8e+'/'+_0x416a6b)[_0xcb14('0x2b')](_0x196c08);}return null;};}function patchUpdates(_0x2c54ea){return function(_0x487e00){try{jsonpatch[_0xcb14('0x2c')](_0x487e00,_0x2c54ea,!![]);}catch(_0x124191){return BPromise[_0xcb14('0x2d')](_0x124191);}return _0x487e00[_0xcb14('0x2e')]();};}function saveUpdates(_0x4246c4,_0x5dd7f2){return function(_0x11903d){if(_0x11903d){return _0x11903d[_0xcb14('0x2f')](_0x4246c4)['then'](function(_0x1e03a5){return _0x1e03a5;});}return null;};}function removeEntity(_0x56190f,_0x1346b0){return function(_0x530cf8){if(_0x530cf8){return _0x530cf8['destroy']()['then'](function(){_0x56190f[_0xcb14('0x26')](0xcc)[_0xcb14('0x27')]();});}};}function handleEntityNotFound(_0x2bfe31,_0x11bd16){return function(_0x49e976){if(!_0x49e976){_0x2bfe31[_0xcb14('0x30')](0x194);}return _0x49e976;};}function handleError(_0x18c2f8,_0x2bacc5){_0x2bacc5=_0x2bacc5||0x1f4;return function(_0x170016){logger['error'](_0x170016['stack']);if(_0x170016[_0xcb14('0x31')]){delete _0x170016[_0xcb14('0x31')];}_0x18c2f8['status'](_0x2bacc5)['send'](_0x170016);};}exports[_0xcb14('0x32')]=function(_0x48608e,_0x11c766){var _0xec38a4={},_0x2a65b2={},_0x3487a2={'count':0x0,'rows':[]};var _0x110579=db[_0xcb14('0x33')][_0xcb14('0x34')];_0x2a65b2[_0xcb14('0x35')]=_[_0xcb14('0x36')](_0x110579);_0x2a65b2[_0xcb14('0x37')]=_['keys'](_0x48608e['query']);_0x2a65b2['filters']=_[_0xcb14('0x38')](_0x2a65b2[_0xcb14('0x35')],_0x2a65b2[_0xcb14('0x37')]);_0xec38a4[_0xcb14('0x39')]=_[_0xcb14('0x38')](_0x2a65b2[_0xcb14('0x35')],qs['fields'](_0x48608e[_0xcb14('0x37')]['fields']));_0xec38a4[_0xcb14('0x39')]=_0xec38a4[_0xcb14('0x39')][_0xcb14('0x3a')]?_0xec38a4[_0xcb14('0x39')]:_0x2a65b2[_0xcb14('0x35')];if(!_0x48608e[_0xcb14('0x37')][_0xcb14('0x3b')](_0xcb14('0x3c'))){_0xec38a4['limit']=qs['limit'](_0x48608e[_0xcb14('0x37')][_0xcb14('0x3d')]);_0xec38a4[_0xcb14('0x29')]=qs['offset'](_0x48608e[_0xcb14('0x37')][_0xcb14('0x29')]);}_0xec38a4['order']=qs[_0xcb14('0x3e')](_0x48608e['query'][_0xcb14('0x3e')]);_0xec38a4[_0xcb14('0x3f')]=qs['filters'](_['pick'](_0x48608e[_0xcb14('0x37')],_0x2a65b2[_0xcb14('0x40')]));if(_0x48608e[_0xcb14('0x37')]['filter']){_0xec38a4[_0xcb14('0x3f')]=_[_0xcb14('0x41')](_0xec38a4[_0xcb14('0x3f')],{'$or':_[_0xcb14('0x42')](_0x110579,function(_0x5ed5c7){if(_0x5ed5c7[_0xcb14('0x43')][_0xcb14('0x44')]!==_0xcb14('0x45')){var _0x2c2147={};_0x2c2147[_0x5ed5c7[_0xcb14('0x46')]]={'$like':'%'+_0x48608e[_0xcb14('0x37')]['filter']+'%'};return _0x2c2147;}})});}_0xec38a4=_[_0xcb14('0x41')]({},_0xec38a4,_0x48608e['options']);var _0x362354={'where':_0xec38a4[_0xcb14('0x3f')]};return db['Network'][_0xcb14('0x28')](_0x362354)['then'](function(_0x2ed8e1){_0x3487a2[_0xcb14('0x28')]=_0x2ed8e1;if(_0x48608e[_0xcb14('0x37')][_0xcb14('0x47')]){_0xec38a4[_0xcb14('0x48')]=[{'all':!![]}];}return db[_0xcb14('0x33')]['findAll'](_0xec38a4);})[_0xcb14('0x1c')](function(_0xeab65a){_0x3487a2['rows']=_0xeab65a;return _0x3487a2;})[_0xcb14('0x1c')](respondWithFilteredResult(_0x11c766,_0xec38a4))['catch'](handleError(_0x11c766,null));};exports[_0xcb14('0x49')]=function(_0x51c067,_0x2da09b){var _0x5c8fa6={'raw':!![],'where':{'id':_0x51c067[_0xcb14('0x4a')]['id']}},_0x8fcb6f={};_0x8fcb6f['model']=_[_0xcb14('0x36')](db[_0xcb14('0x33')][_0xcb14('0x34')]);_0x8fcb6f[_0xcb14('0x37')]=_[_0xcb14('0x36')](_0x51c067[_0xcb14('0x37')]);_0x8fcb6f[_0xcb14('0x40')]=_[_0xcb14('0x38')](_0x8fcb6f['model'],_0x8fcb6f[_0xcb14('0x37')]);_0x5c8fa6['attributes']=_['intersection'](_0x8fcb6f[_0xcb14('0x35')],qs[_0xcb14('0x4b')](_0x51c067[_0xcb14('0x37')][_0xcb14('0x4b')]));_0x5c8fa6['attributes']=_0x5c8fa6['attributes'][_0xcb14('0x3a')]?_0x5c8fa6[_0xcb14('0x39')]:_0x8fcb6f[_0xcb14('0x35')];if(_0x51c067[_0xcb14('0x37')]['includeAll']){_0x5c8fa6['include']=[{'all':!![]}];}_0x5c8fa6=_[_0xcb14('0x41')]({},_0x5c8fa6,_0x51c067['options']);return db[_0xcb14('0x33')][_0xcb14('0x4c')](_0x5c8fa6)['then'](handleEntityNotFound(_0x2da09b,null))['then'](respondWithResult(_0x2da09b,null))['catch'](handleError(_0x2da09b,null));};exports[_0xcb14('0x4d')]=function(_0x308019,_0x5b32ea,_0x583381){var _0x8534b0;return db[_0xcb14('0x4e')][_0xcb14('0x4f')](function(_0x19c43b){return db[_0xcb14('0x33')][_0xcb14('0x4d')](_0x308019['body'],{'raw':!![]})[_0xcb14('0x1c')](function(_0xecdbd2){_0x8534b0=_0xecdbd2;return db[_0xcb14('0x33')][_0xcb14('0x50')]({'where':{'type':_0x308019[_0xcb14('0x51')][_0xcb14('0x43')]},'raw':!![]});})[_0xcb14('0x1c')](function(_0x11c61e){var _0x564890=fs[_0xcb14('0x52')](path[_0xcb14('0x53')](config[_0xcb14('0x54')],'server/files/templates/network.ejs'),'utf8');var _0x4fcee4=ejs[_0xcb14('0x55')](_0x564890,{'networks':_0x11c61e||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')](_0xcb14('0x58'),_0x308019[_0xcb14('0x51')]['type'][_0xcb14('0x59')]()),_0x4fcee4);})['then'](function(){return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x4d'),{'module':_0xcb14('0x5b')});})[_0xcb14('0x1c')](function(){return _0x8534b0;});})[_0xcb14('0x1c')](respondWithResult(_0x5b32ea,0xc9))[_0xcb14('0x5c')](handleError(_0x5b32ea,null));};exports[_0xcb14('0x2f')]=function(_0x17ed7d,_0x211406,_0x2858d6){var _0x24cd40;return db[_0xcb14('0x4e')][_0xcb14('0x4f')](function(_0x274e3f){return db[_0xcb14('0x33')]['find']({'where':{'id':_0x17ed7d['params']['id']}})[_0xcb14('0x1c')](handleEntityNotFound(_0x211406,null))[_0xcb14('0x1c')](saveUpdates(_0x17ed7d['body'],null))[_0xcb14('0x1c')](function(_0x23fe89){if(_0x23fe89){_0x24cd40=_0x23fe89;return db[_0xcb14('0x33')]['findAll']({'where':{'type':_0x24cd40[_0xcb14('0x43')]},'raw':!![]});}return null;})[_0xcb14('0x1c')](function(_0xbd3339){if(_0xbd3339){var _0x3c0e64=fs[_0xcb14('0x52')](path[_0xcb14('0x53')](config[_0xcb14('0x54')],_0xcb14('0x5d')),_0xcb14('0x5e'));var _0x4ec661=ejs[_0xcb14('0x55')](_0x3c0e64,{'networks':_0xbd3339||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')](_0xcb14('0x58'),_0x24cd40['type'][_0xcb14('0x59')]()),_0x4ec661);return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x2f'),{'module':_0xcb14('0x5b')});}return null;})[_0xcb14('0x1c')](function(_0x362dad){if(_0x362dad){return _0x24cd40;}return null;});})[_0xcb14('0x1c')](respondWithResult(_0x211406,null))[_0xcb14('0x5c')](handleError(_0x211406,null));};exports[_0xcb14('0x5f')]=function(_0x2b90da,_0x1a315e,_0x57eede){var _0x11e8af;return db['Network']['find']({'where':{'id':_0x2b90da[_0xcb14('0x4a')]['id']}})['then'](function(_0x3b457e){_0x11e8af=_0x3b457e;return _0x3b457e;})['then'](handleEntityNotFound(_0x1a315e,null))[_0xcb14('0x1c')](removeEntity(_0x1a315e,null))[_0xcb14('0x1c')](function(){if(_0x11e8af){return db['Network'][_0xcb14('0x50')]({'where':{'type':_0x11e8af['type']},'raw':!![]});}})[_0xcb14('0x1c')](function(_0x257439){if(_0x257439){var _0x307535=fs['readFileSync'](path['join'](config['root'],_0xcb14('0x5d')),_0xcb14('0x5e'));var _0xf44638=ejs[_0xcb14('0x55')](_0x307535,{'networks':_0x257439||[]});fs[_0xcb14('0x56')](util[_0xcb14('0x57')]('/etc/asterisk/sip_xcally_%s.conf',_0x11e8af[_0xcb14('0x43')][_0xcb14('0x59')]()),_0xf44638);return respondWithRpcPromise(_0xcb14('0x5a'),_0xcb14('0x5f'),{'module':_0xcb14('0x5b')});}})['catch'](handleError(_0x1a315e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index da039ae..d8172cb 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 _0xc197=['api','bluebird','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc197,0x1ac));var _0x7c19=function(_0x4dd6fc,_0x5653b0){_0x4dd6fc=_0x4dd6fc-0x0;var _0x2d6354=_0xc197[_0x4dd6fc];return _0x2d6354;};'use strict';var _=require(_0x7c19('0x0'));var util=require(_0x7c19('0x1'));var logger=require('../../config/logger')(_0x7c19('0x2'));var moment=require('moment');var BPromise=require(_0x7c19('0x3'));var rp=require(_0x7c19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c19('0x5'));var attributes=require(_0x7c19('0x6'));module[_0x7c19('0x7')]=function(_0x1655bf,_0x2add27){return _0x1655bf[_0x7c19('0x8')]('Network',attributes,{'tableName':_0x7c19('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa438=['../../config/environment','./network.attributes','exports','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa438,0x130));var _0x8a43=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa438[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8a43('0x0'));var logger=require(_0x8a43('0x1'))(_0x8a43('0x2'));var moment=require(_0x8a43('0x3'));var BPromise=require(_0x8a43('0x4'));var rp=require(_0x8a43('0x5'));var fs=require('fs');var path=require(_0x8a43('0x6'));var rimraf=require(_0x8a43('0x7'));var config=require(_0x8a43('0x8'));var attributes=require(_0x8a43('0x9'));module[_0x8a43('0xa')]=function(_0x4469dd,_0x46b9c1){return _0x4469dd['define'](_0x8a43('0xb'),attributes,{'tableName':_0x8a43('0xc'),'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 3f6321d..930d391 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4ac63b,_0x380e76){var _0x206816=function(_0x1ae994){while(--_0x1ae994){_0x4ac63b['push'](_0x4ac63b['shift']());}};_0x206816(++_0x380e76);}(_0xeff8,0x186));var _0x8eff=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xeff8[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('Network,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xd75d67,_0x3274bb){_0xd75d67=_0xd75d67-0x0;var _0x8d7d3a=_0x3f8a[_0xd75d67];return _0x8d7d3a;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('Network,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 6541cba..105fec4 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 _0x031c=['/:id/applications','getApplications','/:id/interactions','/:id/users','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x3c75e6,_0x6adf45){var _0x183ba2=function(_0x4dd7d0){while(--_0x4dd7d0){_0x3c75e6['push'](_0x3c75e6['shift']());}};_0x183ba2(++_0x6adf45);}(_0x031c,0x133));var _0xc031=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x031c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc031('0x0'));var util=require(_0xc031('0x1'));var path=require(_0xc031('0x2'));var timeout=require(_0xc031('0x3'));var express=require(_0xc031('0x4'));var router=express[_0xc031('0x5')]();var auth=require(_0xc031('0x6'));var interaction=require(_0xc031('0x7'));var config=require(_0xc031('0x8'));var controller=require(_0xc031('0x9'));router[_0xc031('0xa')]('/',auth[_0xc031('0xb')](),controller[_0xc031('0xc')]);router[_0xc031('0xa')](_0xc031('0xd'),auth[_0xc031('0xb')](),controller[_0xc031('0xe')]);router[_0xc031('0xa')](_0xc031('0xf'),auth[_0xc031('0xb')](),controller[_0xc031('0x10')]);router[_0xc031('0xa')](_0xc031('0x11'),auth['isAuthenticated'](),controller[_0xc031('0x12')]);router[_0xc031('0xa')](_0xc031('0x13'),auth[_0xc031('0xb')](),controller[_0xc031('0x14')]);router[_0xc031('0xa')](_0xc031('0x15'),auth[_0xc031('0xb')](),controller[_0xc031('0x16')]);router[_0xc031('0xa')](_0xc031('0x17'),auth[_0xc031('0xb')](),controller['getInteractions']);router[_0xc031('0xa')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller['getAgents']);router['post']('/',auth[_0xc031('0xb')](),controller['create']);router[_0xc031('0x19')](_0xc031('0x11'),auth[_0xc031('0xb')](),controller[_0xc031('0x1a')]);router[_0xc031('0x19')](_0xc031('0x13'),auth[_0xc031('0xb')](),controller[_0xc031('0x1b')]);router[_0xc031('0x19')](_0xc031('0x1c'),controller[_0xc031('0x1d')]);router[_0xc031('0x19')]('/:id/applications',auth[_0xc031('0xb')](),controller[_0xc031('0x1e')]);router[_0xc031('0x19')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller['addAgents']);router['post'](_0xc031('0x1f'),auth['isAuthenticated'](),controller[_0xc031('0x20')]);router[_0xc031('0x21')](_0xc031('0xf'),auth[_0xc031('0xb')](),controller[_0xc031('0x22')]);router[_0xc031('0x23')](_0xc031('0xf'),auth['isAuthenticated'](),controller[_0xc031('0x24')]);router[_0xc031('0x23')](_0xc031('0x11'),auth[_0xc031('0xb')](),controller[_0xc031('0x25')]);router[_0xc031('0x23')]('/:id/canned_answers',auth[_0xc031('0xb')](),controller[_0xc031('0x26')]);router[_0xc031('0x23')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller[_0xc031('0x27')]);module[_0xc031('0x28')]=router; \ No newline at end of file +var _0xce26=['util','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/users','/:id/send','send','put','delete','removeAnswers','removeAgents','exports'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xce26,0x100));var _0x6ce2=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xce26[_0x75f869];return _0x10af8b;};'use strict';var multer=require('multer');var util=require(_0x6ce2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ce2('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ce2('0x2'));var config=require(_0x6ce2('0x3'));var controller=require(_0x6ce2('0x4'));router['get']('/',auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x6')]);router[_0x6ce2('0x7')](_0x6ce2('0x8'),auth[_0x6ce2('0x5')](),controller['describe']);router[_0x6ce2('0x7')](_0x6ce2('0x9'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0xa')]);router[_0x6ce2('0x7')](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller['getDispositions']);router[_0x6ce2('0x7')](_0x6ce2('0xc'),auth['isAuthenticated'](),controller[_0x6ce2('0xd')]);router['get']('/:id/applications',auth[_0x6ce2('0x5')](),controller[_0x6ce2('0xe')]);router[_0x6ce2('0x7')](_0x6ce2('0xf'),auth['isAuthenticated'](),controller[_0x6ce2('0x10')]);router['get']('/:id/users',auth[_0x6ce2('0x5')](),controller['getAgents']);router[_0x6ce2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ce2('0x11')](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x12')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6ce2('0x13')]);router['post'](_0x6ce2('0x14'),controller[_0x6ce2('0x15')]);router['post'](_0x6ce2('0x16'),auth['isAuthenticated'](),controller[_0x6ce2('0x17')]);router[_0x6ce2('0x11')](_0x6ce2('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6ce2('0x11')](_0x6ce2('0x19'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x1a')]);router[_0x6ce2('0x1b')](_0x6ce2('0x9'),auth[_0x6ce2('0x5')](),controller['update']);router[_0x6ce2('0x1c')](_0x6ce2('0x9'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x6ce2('0xb'),auth[_0x6ce2('0x5')](),controller['removeDispositions']);router[_0x6ce2('0x1c')](_0x6ce2('0xc'),auth[_0x6ce2('0x5')](),controller[_0x6ce2('0x1d')]);router[_0x6ce2('0x1c')](_0x6ce2('0x18'),auth['isAuthenticated'](),controller[_0x6ce2('0x1e')]);module[_0x6ce2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index adfc3a2..aa96d4f 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 _0x79d3=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','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'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x79d3,0x13b));var _0x379d=function(_0x5dbb2,_0x1e3317){_0x5dbb2=_0x5dbb2-0x0;var _0x4ba922=_0x79d3[_0x5dbb2];return _0x4ba922;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x379d('0x0'));module[_0x379d('0x1')]={'name':{'type':Sequelize[_0x379d('0x2')],'unique':_0x379d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x379d('0x2')]},'token':{'type':Sequelize[_0x379d('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x379d('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x379d('0x4');}},'notificationSound':{'type':Sequelize[_0x379d('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x379d('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x379d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x379d('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x379d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x379d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x379d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x379d('0x5')],'defaultValue':![],'comment':_0x379d('0x8'),'set':function(_0x178143){if(!_0x178143)this[_0x379d('0x9')](_0x379d('0xa'),null);this[_0x379d('0x9')](_0x379d('0xb'),_0x178143);}}}; \ No newline at end of file +var _0xfedd=['mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x394862,_0x17c8cf){var _0x46ec78=function(_0x2e1d78){while(--_0x2e1d78){_0x394862['push'](_0x394862['shift']());}};_0x46ec78(++_0x17c8cf);}(_0xfedd,0x160));var _0xdfed=function(_0x69dc6b,_0x37c643){_0x69dc6b=_0x69dc6b-0x0;var _0xa89e64=_0xfedd[_0x69dc6b];return _0xa89e64;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdfed('0x0'));module[_0xdfed('0x1')]={'name':{'type':Sequelize[_0xdfed('0x2')],'unique':_0xdfed('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdfed('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdfed('0x4')]();}},'replyUri':{'type':Sequelize[_0xdfed('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xdfed('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdfed('0x5')],'defaultValue':function(){return _0xdfed('0x6');}},'notificationSound':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdfed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xdfed('0x2')]},'queueTransfer':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdfed('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdfed('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xdfed('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xdfed('0x7')],'defaultValue':![],'comment':_0xdfed('0xa'),'set':function(_0xcd7c39){if(!_0xcd7c39)this[_0xdfed('0xb')]('mandatoryDispositionPauseId',null);this[_0xdfed('0xb')](_0xdfed('0xc'),_0xcd7c39);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 346328a..e7e28b6 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 _0x3c11=['describe','OpnechannelAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','OpenchannelAccountId','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','Applications','account','list','orderBy','priority','asc','Contacts','defaults','contact','firstName','lastName','threadId','externalUrl','spread','messageId','interaction','applications','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','findOne','getApplications','getInteractions','OpenchannelInteraction','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','getAgents','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','status','end','json','count','offset','set','reject','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','find','body','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x498719,_0x1b25ca){var _0x5a8a90=function(_0x356f71){while(--_0x356f71){_0x498719['push'](_0x498719['shift']());}};_0x5a8a90(++_0x1b25ca);}(_0x3c11,0x1c2));var _0x13c1=function(_0x5d664b,_0x3c485c){_0x5d664b=_0x5d664b-0x0;var _0x49aeb3=_0x3c11[_0x5d664b];return _0x49aeb3;};'use strict';var pdf=require(_0x13c1('0x0'));var emlformat=require(_0x13c1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13c1('0x2'));var jsonpatch=require(_0x13c1('0x3'));var rp=require(_0x13c1('0x4'));var moment=require(_0x13c1('0x5'));var BPromise=require(_0x13c1('0x6'));var Mustache=require(_0x13c1('0x7'));var util=require(_0x13c1('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x13c1('0x9'));var ejs=require(_0x13c1('0xa'));var fs=require('fs');var _=require(_0x13c1('0xb'));var squel=require('squel');var crypto=require(_0x13c1('0xc'));var jsforce=require(_0x13c1('0xd'));var deskjs=require(_0x13c1('0xe'));var toCsv=require(_0x13c1('0x9'));var querystring=require(_0x13c1('0xf'));var Papa=require(_0x13c1('0x10'));var Redis=require('ioredis');var authService=require(_0x13c1('0x11'));var qs=require(_0x13c1('0x12'));var hardwareService=require(_0x13c1('0x13'));var logger=require(_0x13c1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x13c1('0x15'));var db=require('../../mysqldb')['db'];config[_0x13c1('0x16')]=_['defaults'](config[_0x13c1('0x16')],{'host':_0x13c1('0x17'),'port':0x18eb});var socket=require(_0x13c1('0x18'))(new Redis(config[_0x13c1('0x16')]));require('./openchannelAccount.socket')[_0x13c1('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x13c1('0x1a')][_0x13c1('0x1b')]({'port':0x232c});var client9002=jayson[_0x13c1('0x1a')][_0x13c1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x493aa0,_0xde6681,_0x21dbcc){if(_0x21dbcc){var _0x5c6ecc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c6ecc[_0x13c1('0x1c')](_0xde6681)){return _0x493aa0;}else{throw new Error(_0x13c1('0x1d'));}}else{return _0x493aa0;}}function respondWithRpcPromise(_0x4f51a2,_0x44efd3,_0x89e5d4,_0x3f0bb7){return new BPromise(function(_0x109991,_0x26050f){var _0x1bcd91=_0x3f0bb7||client;return _0x1bcd91[_0x13c1('0x1e')](_0x4f51a2,_0x89e5d4)['then'](function(_0x478ef4){logger[_0x13c1('0x1f')](_0x13c1('0x20'),_0x44efd3,_0x13c1('0x21'));logger['debug'](_0x13c1('0x22'),_0x44efd3,'request\x20sent',JSON[_0x13c1('0x23')](_0x478ef4));if(_0x478ef4[_0x13c1('0x24')]){if(_0x478ef4[_0x13c1('0x24')]['code']===0x1f4){logger[_0x13c1('0x24')](_0x13c1('0x20'),_0x44efd3,_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);return _0x26050f(_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);}logger[_0x13c1('0x24')](_0x13c1('0x20'),_0x44efd3,_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);return _0x109991(_0x478ef4['error'][_0x13c1('0x25')]);}else{logger[_0x13c1('0x1f')](_0x13c1('0x20'),_0x44efd3,'request\x20sent');_0x109991(_0x478ef4['result'][_0x13c1('0x25')]);}})['catch'](function(_0x4297dc){logger['error'](_0x13c1('0x20'),_0x44efd3,_0x4297dc);_0x26050f(_0x4297dc);});});}function respondWithStatusCode(_0xdc972b,_0x1a1e53){_0x1a1e53=_0x1a1e53||0xcc;return function(_0x8efbef){if(_0x8efbef){return _0xdc972b['sendStatus'](_0x1a1e53);}return _0xdc972b[_0x13c1('0x26')](_0x1a1e53)[_0x13c1('0x27')]();};}function respondWithResult(_0x145121,_0x5c2dca){_0x5c2dca=_0x5c2dca||0xc8;return function(_0x58c0c2){if(_0x58c0c2){return _0x145121[_0x13c1('0x26')](_0x5c2dca)[_0x13c1('0x28')](_0x58c0c2);}};}function respondWithFilteredResult(_0x202b1f,_0x185e5a){return function(_0x3e330b){if(_0x3e330b){var _0x3b50ff=_0x3e330b[_0x13c1('0x29')],_0x47b264=_0x185e5a['offset'],_0x35fe76=_0x185e5a[_0x13c1('0x2a')]+_0x185e5a['limit'],_0x96773c;if(_0x35fe76>=_0x3b50ff){_0x35fe76=_0x3b50ff;_0x96773c=0xc8;}else{_0x96773c=0xce;}_0x202b1f[_0x13c1('0x26')](_0x96773c);return _0x202b1f[_0x13c1('0x2b')]('Content-Range',_0x47b264+'-'+_0x35fe76+'/'+_0x3b50ff)[_0x13c1('0x28')](_0x3e330b);}return null;};}function patchUpdates(_0x43e1f2){return function(_0x3a5bb5){try{jsonpatch['apply'](_0x3a5bb5,_0x43e1f2,!![]);}catch(_0x466963){return BPromise[_0x13c1('0x2c')](_0x466963);}return _0x3a5bb5[_0x13c1('0x2d')]();};}function saveUpdates(_0x338be2,_0x2e4a76){return function(_0x3798c4){if(_0x3798c4){return _0x3798c4[_0x13c1('0x2e')](_0x338be2)[_0x13c1('0x2f')](function(_0x265982){return _0x265982;});}return null;};}function removeEntity(_0x4cf8b0,_0x593585){return function(_0x4b7127){if(_0x4b7127){return _0x4b7127['destroy']()[_0x13c1('0x2f')](function(){var _0x1935e5=_0x4b7127[_0x13c1('0x30')]({'plain':!![]});var _0x47650a=_0x13c1('0x31');return db[_0x13c1('0x32')][_0x13c1('0x33')]({'where':{'type':_0x47650a,'resourceId':_0x1935e5['id']}})['then'](function(){return _0x4b7127;});})[_0x13c1('0x2f')](function(){_0x4cf8b0[_0x13c1('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c5d6,_0x2840a9){return function(_0x295ad4){if(!_0x295ad4){_0x51c5d6[_0x13c1('0x34')](0x194);}return _0x295ad4;};}function handleError(_0x73be19,_0x9f77){_0x9f77=_0x9f77||0x1f4;return function(_0x7d45d7){logger[_0x13c1('0x24')](_0x7d45d7[_0x13c1('0x35')]);if(_0x7d45d7[_0x13c1('0x36')]){delete _0x7d45d7[_0x13c1('0x36')];}_0x73be19[_0x13c1('0x26')](_0x9f77)[_0x13c1('0x37')](_0x7d45d7);};}exports[_0x13c1('0x38')]=function(_0xda4454,_0x578f8a){var _0x5c2a14={'include':[{'model':db[_0x13c1('0x39')],'as':_0x13c1('0x3a')}]},_0xb8acb2={},_0x2b7194={'count':0x0,'rows':[]};var _0x281d4b=db[_0x13c1('0x3b')][_0x13c1('0x3c')];_0xb8acb2[_0x13c1('0x3d')]=_['keys'](_0x281d4b);_0xb8acb2['query']=_[_0x13c1('0x3e')](_0xda4454['query']);_0xb8acb2[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0xb8acb2[_0x13c1('0x3d')],_0xb8acb2[_0x13c1('0x41')]);_0x5c2a14[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0xb8acb2[_0x13c1('0x3d')],qs['fields'](_0xda4454['query'][_0x13c1('0x43')]));_0x5c2a14[_0x13c1('0x42')]=_0x5c2a14[_0x13c1('0x42')][_0x13c1('0x44')]?_0x5c2a14[_0x13c1('0x42')]:_0xb8acb2[_0x13c1('0x3d')];if(!_0xda4454[_0x13c1('0x41')]['hasOwnProperty'](_0x13c1('0x45'))){_0x5c2a14[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0xda4454[_0x13c1('0x41')][_0x13c1('0x46')]);_0x5c2a14[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0xda4454['query']['offset']);}_0x5c2a14[_0x13c1('0x47')]=qs[_0x13c1('0x48')](_0xda4454[_0x13c1('0x41')]['sort']);_0x5c2a14['where']=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0xda4454[_0x13c1('0x41')],_0xb8acb2['filters']));if(_0xda4454['query'][_0x13c1('0x4a')]){_0x5c2a14[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x5c2a14[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x281d4b,function(_0x34b4dc){if(_0x34b4dc[_0x13c1('0x4e')][_0x13c1('0x4f')]!=='VIRTUAL'){var _0x3d6096={};_0x3d6096[_0x34b4dc[_0x13c1('0x50')]]={'$like':'%'+_0xda4454[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0x3d6096;}})});}_0x5c2a14=_[_0x13c1('0x4c')]({},_0x5c2a14,_0xda4454[_0x13c1('0x51')]);var _0x55e544={'where':_0x5c2a14[_0x13c1('0x4b')]};return db[_0x13c1('0x3b')][_0x13c1('0x29')](_0x55e544)[_0x13c1('0x2f')](function(_0x21b66f){_0x2b7194[_0x13c1('0x29')]=_0x21b66f;if(_0xda4454[_0x13c1('0x41')][_0x13c1('0x52')]){_0x5c2a14[_0x13c1('0x53')]=[{'all':!![]}];}return db[_0x13c1('0x3b')][_0x13c1('0x54')](_0x5c2a14);})[_0x13c1('0x2f')](function(_0x283303){_0x2b7194[_0x13c1('0x55')]=_0x283303;return _0x2b7194;})[_0x13c1('0x2f')](respondWithFilteredResult(_0x578f8a,_0x5c2a14))[_0x13c1('0x56')](handleError(_0x578f8a,null));};exports['show']=function(_0x13d2f4,_0xc632aa){var _0xf9fdd6={'raw':![],'where':{'id':_0x13d2f4['params']['id']},'include':[{'model':db['Pause'],'as':_0x13c1('0x3a')}]},_0x2e2d00={};_0x2e2d00[_0x13c1('0x3d')]=_['keys'](db[_0x13c1('0x3b')][_0x13c1('0x3c')]);_0x2e2d00[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x13d2f4['query']);_0x2e2d00[_0x13c1('0x3f')]=_['intersection'](_0x2e2d00[_0x13c1('0x3d')],_0x2e2d00[_0x13c1('0x41')]);_0xf9fdd6['attributes']=_['intersection'](_0x2e2d00[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x13d2f4['query'][_0x13c1('0x43')]));_0xf9fdd6[_0x13c1('0x42')]=_0xf9fdd6[_0x13c1('0x42')][_0x13c1('0x44')]?_0xf9fdd6['attributes']:_0x2e2d00['model'];if(_0x13d2f4[_0x13c1('0x41')][_0x13c1('0x52')]){_0xf9fdd6[_0x13c1('0x53')]=[{'all':!![]}];}_0xf9fdd6=_[_0x13c1('0x4c')]({},_0xf9fdd6,_0x13d2f4[_0x13c1('0x51')]);return db['OpenchannelAccount'][_0x13c1('0x57')](_0xf9fdd6)[_0x13c1('0x2f')](handleEntityNotFound(_0xc632aa,null))['then'](respondWithResult(_0xc632aa,null))['catch'](handleError(_0xc632aa,null));};exports['create']=function(_0x38d745,_0x4a3f4d){return db[_0x13c1('0x3b')]['create'](_0x38d745[_0x13c1('0x58')],{})['then'](function(_0x1dc16b){var _0x5a4902=_0x38d745[_0x13c1('0x59')][_0x13c1('0x30')]({'plain':!![]});if(!_0x5a4902)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a4902['role']===_0x13c1('0x59')){var _0x20ae90=_0x1dc16b[_0x13c1('0x30')]({'plain':!![]});var _0x50048a='OpenchannelAccounts';return db[_0x13c1('0x5a')][_0x13c1('0x57')]({'where':{'name':_0x50048a,'userProfileId':_0x5a4902[_0x13c1('0x5b')]},'raw':!![]})[_0x13c1('0x2f')](function(_0x1ca186){if(_0x1ca186&&_0x1ca186[_0x13c1('0x5c')]===0x0){return db[_0x13c1('0x32')][_0x13c1('0x5d')]({'name':_0x20ae90[_0x13c1('0x36')],'resourceId':_0x20ae90['id'],'type':_0x1ca186[_0x13c1('0x36')],'sectionId':_0x1ca186['id']},{})[_0x13c1('0x2f')](function(){return _0x1dc16b;});}else{return _0x1dc16b;}})['catch'](function(_0x4dc9e4){logger['error'](_0x13c1('0x5e'),_0x4dc9e4);throw _0x4dc9e4;});}return _0x1dc16b;})[_0x13c1('0x2f')](respondWithResult(_0x4a3f4d,0xc9))[_0x13c1('0x56')](handleError(_0x4a3f4d,null));};exports[_0x13c1('0x2e')]=function(_0x215d64,_0x3e16d8){if(_0x215d64[_0x13c1('0x58')]['id']){delete _0x215d64['body']['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x215d64[_0x13c1('0x5f')]['id']},'include':[{'model':db[_0x13c1('0x39')],'as':_0x13c1('0x3a')}]})[_0x13c1('0x2f')](handleEntityNotFound(_0x3e16d8,null))[_0x13c1('0x2f')](saveUpdates(_0x215d64[_0x13c1('0x58')],null))[_0x13c1('0x2f')](respondWithResult(_0x3e16d8,null))['catch'](handleError(_0x3e16d8,null));};exports[_0x13c1('0x33')]=function(_0x94070a,_0x29d778){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x94070a['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x29d778,null))[_0x13c1('0x2f')](removeEntity(_0x29d778,null))[_0x13c1('0x56')](handleError(_0x29d778,null));};exports[_0x13c1('0x60')]=function(_0x105729,_0x47adf6){return db['OpenchannelAccount']['describe']()[_0x13c1('0x2f')](respondWithResult(_0x47adf6,null))[_0x13c1('0x56')](handleError(_0x47adf6,null));};exports['addDisposition']=function(_0x594c59,_0x5b4bd9,_0x2cf4ac){if(_0x594c59[_0x13c1('0x58')]['id']){delete _0x594c59[_0x13c1('0x58')]['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x594c59[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x5b4bd9,null))['then'](function(_0x1f6647){if(_0x1f6647){_0x594c59[_0x13c1('0x58')][_0x13c1('0x61')]=_0x1f6647['id'];return db[_0x13c1('0x62')]['create'](_0x594c59[_0x13c1('0x58')]);}})[_0x13c1('0x2f')](respondWithResult(_0x5b4bd9,null))[_0x13c1('0x56')](handleError(_0x5b4bd9,null));};exports[_0x13c1('0x63')]=function(_0x477a3e,_0x4d4534,_0x5667e2){var _0x123258={'raw':![],'where':{}};var _0x17d5f3={};var _0x4bc8f3={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x477a3e[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d4534,null))[_0x13c1('0x2f')](function(_0x25ef8c){if(_0x25ef8c){_0x17d5f3[_0x13c1('0x3d')]=_['keys'](db['Disposition'][_0x13c1('0x3c')]);_0x17d5f3[_0x13c1('0x41')]=_['keys'](_0x477a3e['query']);_0x17d5f3['filters']=_[_0x13c1('0x40')](_0x17d5f3['model'],_0x17d5f3[_0x13c1('0x41')]);_0x123258[_0x13c1('0x42')]=_['intersection'](_0x17d5f3['model'],qs[_0x13c1('0x43')](_0x477a3e[_0x13c1('0x41')][_0x13c1('0x43')]));_0x123258[_0x13c1('0x42')]=_0x123258['attributes'][_0x13c1('0x44')]?_0x123258[_0x13c1('0x42')]:_0x17d5f3[_0x13c1('0x3d')];if(!_0x477a3e[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x123258[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x477a3e[_0x13c1('0x41')][_0x13c1('0x46')]);_0x123258[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0x477a3e[_0x13c1('0x41')]['offset']);}_0x123258['order']=qs[_0x13c1('0x48')](_0x477a3e[_0x13c1('0x41')]['sort']);_0x123258[_0x13c1('0x4b')]=qs['filters'](_['pick'](_0x477a3e[_0x13c1('0x41')],_0x17d5f3['filters']));_0x123258[_0x13c1('0x4b')]['OpenchannelAccountId']=_0x25ef8c['id'];if(_0x477a3e[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x123258[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x123258['where'],{'$or':_[_0x13c1('0x4d')](_0x123258['attributes'],function(_0x202cad){var _0x514e6c={};_0x514e6c[_0x202cad]={'$like':'%'+_0x477a3e['query'][_0x13c1('0x4a')]+'%'};return _0x514e6c;})});}_0x123258=_['merge']({},_0x123258,_0x477a3e[_0x13c1('0x51')]);return db[_0x13c1('0x62')][_0x13c1('0x29')]({'where':_0x123258[_0x13c1('0x4b')]})[_0x13c1('0x2f')](function(_0x482259){_0x4bc8f3[_0x13c1('0x29')]=_0x482259;if(_0x477a3e[_0x13c1('0x41')][_0x13c1('0x52')]){_0x123258[_0x13c1('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x13c1('0x54')](_0x123258);})['then'](function(_0x3ae399){_0x4bc8f3[_0x13c1('0x55')]=_0x3ae399;return _0x4bc8f3;});}})['then'](respondWithFilteredResult(_0x4d4534,_0x123258))[_0x13c1('0x56')](handleError(_0x4d4534,null));};exports[_0x13c1('0x65')]=function(_0x5b5d20,_0x854986,_0x3cad81){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x5b5d20['params']['id']}})['then'](handleEntityNotFound(_0x854986,null))['then'](function(_0x7f132a){if(_0x7f132a){return _0x7f132a[_0x13c1('0x65')](_0x5b5d20[_0x13c1('0x41')][_0x13c1('0x66')]);}})[_0x13c1('0x2f')](respondWithStatusCode(_0x854986,null))[_0x13c1('0x56')](handleError(_0x854986,null));};exports[_0x13c1('0x67')]=function(_0x1a61f2,_0x4d598f,_0x2e0d6b){if(_0x1a61f2[_0x13c1('0x58')]['id']){delete _0x1a61f2[_0x13c1('0x58')]['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x1a61f2['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x4d598f,null))[_0x13c1('0x2f')](function(_0x16d70a){if(_0x16d70a){_0x1a61f2[_0x13c1('0x58')]['OpenchannelAccountId']=_0x16d70a['id'];return db['CannedAnswer'][_0x13c1('0x5d')](_0x1a61f2[_0x13c1('0x58')]);}})[_0x13c1('0x2f')](respondWithResult(_0x4d598f,null))[_0x13c1('0x56')](handleError(_0x4d598f,null));};exports[_0x13c1('0x68')]=function(_0x2290f0,_0x41a4ed,_0x3a5f27){var _0x4cb82f={'raw':![],'where':{}};var _0x6ec14e={};var _0x7d2b31={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x2290f0[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x41a4ed,null))[_0x13c1('0x2f')](function(_0x377394){if(_0x377394){_0x6ec14e[_0x13c1('0x3d')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x6ec14e[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x2290f0['query']);_0x6ec14e[_0x13c1('0x3f')]=_['intersection'](_0x6ec14e[_0x13c1('0x3d')],_0x6ec14e[_0x13c1('0x41')]);_0x4cb82f['attributes']=_[_0x13c1('0x40')](_0x6ec14e[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x43')]));_0x4cb82f[_0x13c1('0x42')]=_0x4cb82f[_0x13c1('0x42')][_0x13c1('0x44')]?_0x4cb82f[_0x13c1('0x42')]:_0x6ec14e[_0x13c1('0x3d')];if(!_0x2290f0[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x4cb82f[_0x13c1('0x46')]=qs['limit'](_0x2290f0[_0x13c1('0x41')]['limit']);_0x4cb82f['offset']=qs[_0x13c1('0x2a')](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x2a')]);}_0x4cb82f['order']=qs['sort'](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x48')]);_0x4cb82f[_0x13c1('0x4b')]=qs['filters'](_['pick'](_0x2290f0[_0x13c1('0x41')],_0x6ec14e[_0x13c1('0x3f')]));_0x4cb82f['where'][_0x13c1('0x69')]=_0x377394['id'];if(_0x2290f0[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x4cb82f['where']=_[_0x13c1('0x4c')](_0x4cb82f[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x4cb82f[_0x13c1('0x42')],function(_0x3b23d5){var _0x520c8e={};_0x520c8e[_0x3b23d5]={'$like':'%'+_0x2290f0['query']['filter']+'%'};return _0x520c8e;})});}_0x4cb82f=_[_0x13c1('0x4c')]({},_0x4cb82f,_0x2290f0[_0x13c1('0x51')]);return db[_0x13c1('0x6a')][_0x13c1('0x29')]({'where':_0x4cb82f[_0x13c1('0x4b')]})[_0x13c1('0x2f')](function(_0x1740a3){_0x7d2b31[_0x13c1('0x29')]=_0x1740a3;if(_0x2290f0[_0x13c1('0x41')][_0x13c1('0x52')]){_0x4cb82f['include']=[{'all':!![]}];}return db[_0x13c1('0x6a')][_0x13c1('0x54')](_0x4cb82f);})[_0x13c1('0x2f')](function(_0x29993c){_0x7d2b31['rows']=_0x29993c;return _0x7d2b31;});}})[_0x13c1('0x2f')](respondWithFilteredResult(_0x41a4ed,_0x4cb82f))[_0x13c1('0x56')](handleError(_0x41a4ed,null));};exports['removeAnswers']=function(_0x4a4e99,_0x155d01,_0xce3180){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x4a4e99['params']['id']}})['then'](handleEntityNotFound(_0x155d01,null))[_0x13c1('0x2f')](function(_0x1df203){if(_0x1df203){return _0x1df203[_0x13c1('0x6b')](_0x4a4e99[_0x13c1('0x41')][_0x13c1('0x66')]);}})[_0x13c1('0x2f')](respondWithStatusCode(_0x155d01,null))[_0x13c1('0x56')](handleError(_0x155d01,null));};exports[_0x13c1('0x6c')]=function(_0xc7835a,_0x1f306a,_0x5db277){var _0x597124={'body':_0xc7835a[_0x13c1('0x58')],'channel':_0x13c1('0x6d')};var _0x4de279=[];var _0x46f2e4=[];var _0x401daa={};var _0x3e8e26=![];return db['CmContact'][_0x13c1('0x60')]()['then'](function(_0x43c837){if(!_0x43c837){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x70'));}_0x4de279=_['difference'](_['keys'](_0x43c837),[_0x13c1('0x71'),'updatedAt']);_0x46f2e4=_[_0x13c1('0x72')](_[_0x13c1('0x3e')](_0x43c837),[_0x13c1('0x71'),_0x13c1('0x73'),_0x13c1('0x74'),_0x13c1('0x75')]);if(_0xc7835a[_0x13c1('0x58')]['id']){delete _0xc7835a['body']['id'];}if(_[_0x13c1('0x76')](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')])){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x78'));}if(_[_0x13c1('0x76')](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')])||_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')]===''){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x79'));}if(_['isNil'](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')])){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46f2e4);}if(!_['includes'](_0x46f2e4,_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')])){throw new db[(_0x13c1('0x6e'))]['ValidationError'](_0x13c1('0x7b')+_0x46f2e4);}_0x401daa[_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')]]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')];})['then'](function(){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0xc7835a['params']['id']},'include':[{'model':db[_0x13c1('0x7c')],'as':_0x13c1('0x7d'),'include':[{'model':db[_0x13c1('0x7e')],'as':'Contacts','where':_0x401daa,'limit':0x1,'order':[[_0x13c1('0x73'),_0x13c1('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0x13c1('0x80')}]});})[_0x13c1('0x2f')](handleEntityNotFound(_0x1f306a,null))[_0x13c1('0x2f')](function(_0x166abd){if(_0x166abd&&_0x166abd[_0x13c1('0x7d')]){_0x597124[_0x13c1('0x81')]=_0x166abd;_0x597124['applications']=_0x166abd['Applications'];_0x597124[_0x13c1('0x82')]=_0x166abd[_0x13c1('0x7d')];_0x597124['applications']=_[_0x13c1('0x83')](_0x597124['applications'],[_0x13c1('0x84')],[_0x13c1('0x85')]);if(_0x597124[_0x13c1('0x81')]['Applications']){delete _0x597124[_0x13c1('0x81')][_0x13c1('0x80')];}if(_0x597124[_0x13c1('0x81')][_0x13c1('0x7d')]&&_0x597124['account'][_0x13c1('0x7d')][_0x13c1('0x86')][_0x13c1('0x44')]){return _0x597124[_0x13c1('0x81')][_0x13c1('0x7d')][_0x13c1('0x86')][0x0];}var _0x3ee929=_[_0x13c1('0x87')](_0xc7835a[_0x13c1('0x58')],{'firstName':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')],'ListId':_0x166abd[_0x13c1('0x75')]});_0x3ee929[_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')]]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')];return db[_0x13c1('0x7e')][_0x13c1('0x5d')](_0x3ee929,{'fields':_0x4de279,'raw':!![]});}})[_0x13c1('0x2f')](handleEntityNotFound(_0x1f306a,null))[_0x13c1('0x2f')](function(_0xc8bcf9){_0x597124[_0x13c1('0x88')]=_0xc8bcf9;if(_0xc8bcf9){var _0x359f84={'ContactId':_0xc8bcf9['id'],'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'from':(_0xc8bcf9[_0x13c1('0x89')]||'')+'\x20'+(_0xc8bcf9[_0x13c1('0x8a')]||'')};var _0x2d41b2={'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'closed':![]};if(_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]){_0x2d41b2['threadId']=_0xc7835a[_0x13c1('0x58')]['threadId'];return db['OpenchannelInteraction'][_0x13c1('0x57')]({'where':_0x2d41b2})[_0x13c1('0x2f')](function(_0x2537f2){if(_0x2537f2){return[_0x2537f2,![]];}_0x359f84['threadId']=_0xc7835a['body'][_0x13c1('0x8b')];_0x359f84[_0x13c1('0x8c')]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8c')];return db['OpenchannelInteraction'][_0x13c1('0x5d')](_0x359f84)[_0x13c1('0x2f')](function(_0x2136f0){return[_0x2136f0,!![]];});});}else{_0x2d41b2[_0x13c1('0x8b')]=null;}_0x2d41b2['ContactId']=_0xc8bcf9['id'];return db['OpenchannelInteraction'][_0x13c1('0x57')]({'where':_0x2d41b2})[_0x13c1('0x2f')](function(_0x367e2e){if(_0x367e2e){return[_0x367e2e,![]];}return db['OpenchannelInteraction'][_0x13c1('0x5d')](_0x359f84)[_0x13c1('0x2f')](function(_0x63b362){return[_0x63b362,!![]];});});}})[_0x13c1('0x8d')](function(_0x10bcff,_0xe428ed){if(_0x10bcff){_0x3e8e26=_0xe428ed;if(!_0xe428ed){var _0x1fd403={'from':(_0x597124[_0x13c1('0x88')][_0x13c1('0x89')]||'')+'\x20'+(_0x597124['contact']['lastName']||'')};if(_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]&&_0xc7835a['body'][_0x13c1('0x8e')]&&_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]!=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8e')]){_0x1fd403[_0x13c1('0x8b')]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8e')];}return _0x10bcff[_0x13c1('0x2e')](_0x1fd403);}else{return _0x10bcff;}}})[_0x13c1('0x2f')](function(_0x45621a){_0x597124[_0x13c1('0x8f')]=_0x45621a[_0x13c1('0x30')]({'plain':!![]});_0x597124[_0x13c1('0x8f')]['created']=_0x3e8e26;if(_0x597124[_0x13c1('0x8f')]['created']){if(_0x597124['account']['autoclose']){_0x597124[_0x13c1('0x90')][_0x13c1('0x91')]({'id':0x0,'priority':_0x597124[_0x13c1('0x90')][_0x13c1('0x44')]+0x1,'app':_0x13c1('0x92'),'appdata':'unmanaged','interval':_0x13c1('0x93')});}}return db[_0x13c1('0x94')]['create']({'body':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')],'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'OpenchannelInteractionId':_0x45621a['id'],'direction':'in','ContactId':_0x597124[_0x13c1('0x88')]['id'],'AttachmentId':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x95')]});})[_0x13c1('0x2f')](function(_0x417ee0){_0x597124[_0x13c1('0x25')]=_0x417ee0;if(_0x597124[_0x13c1('0x8f')]['UserId']){return db[_0x13c1('0x96')]['find']({'attributes':['id','name'],'where':{'id':_0x597124[_0x13c1('0x8f')][_0x13c1('0x97')]}})[_0x13c1('0x2f')](function(_0x2585e7){if(_0x2585e7){_0x597124[_0x13c1('0x90')][_0x13c1('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2585e7[_0x13c1('0x36')]+','+(_0x597124[_0x13c1('0x81')][_0x13c1('0x99')]||0xa),'interval':_0x13c1('0x93')});_0x597124[_0x13c1('0x9a')]=![];}return respondWithRpcPromise(_0x13c1('0x9b'),_0x13c1('0x9c'),_0x597124);});}return respondWithRpcPromise(_0x13c1('0x9b'),_0x13c1('0x9c'),_0x597124);})[_0x13c1('0x2f')](function(_0x51b492){respondWithRpcPromise('EventManager',_0x13c1('0x9d'),{'event':_0x13c1('0x6c'),'message':_0x51b492},client9002);return _0x51b492;})['then'](respondWithResult(_0x1f306a,null))['catch'](handleError(_0x1f306a,null));};exports['addApplications']=function(_0x4b750c,_0x3b9e78,_0x1ff114){return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x4b750c[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3b9e78,null))[_0x13c1('0x2f')](function(_0x12ffff){if(_0x12ffff){return db[_0x13c1('0x9e')][_0x13c1('0x9f')](function(_0x113742){return db['OpenchannelApplication'][_0x13c1('0x33')]({'where':{'OpenchannelAccountId':_0x4b750c[_0x13c1('0x5f')]['id']},'transaction':_0x113742})[_0x13c1('0x2f')](function(_0x344273){var _0x17df41=_['map'](_0x4b750c[_0x13c1('0x58')],function(_0x295bbb){_0x295bbb[_0x13c1('0x69')]=_0x4b750c['params']['id'];return _0x295bbb;});return db[_0x13c1('0xa0')][_0x13c1('0xa1')](_0x17df41,{'transaction':_0x113742});});})[_0x13c1('0x2f')](function(){return db[_0x13c1('0xa0')][_0x13c1('0xa2')]({'where':{'OpenchannelAccountId':_0x4b750c[_0x13c1('0x5f')]['id']},'order':_0x13c1('0x84')});});}})['then'](respondWithResult(_0x3b9e78,null))[_0x13c1('0x56')](handleError(_0x3b9e78,null));};exports['getApplications']=function(_0x4f191c,_0x571a03,_0x308b27){var _0x197a25={};var _0x26914a={};var _0x3853e7;var _0x54debe;return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x4f191c[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x571a03,null))['then'](function(_0xe1233d){if(_0xe1233d){_0x3853e7=_0xe1233d;_0x26914a['model']=_[_0x13c1('0x3e')](db[_0x13c1('0xa0')][_0x13c1('0x3c')]);_0x26914a['query']=_[_0x13c1('0x3e')](_0x4f191c['query']);_0x26914a[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0x26914a[_0x13c1('0x3d')],_0x26914a[_0x13c1('0x41')]);_0x197a25[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0x26914a[_0x13c1('0x3d')],qs['fields'](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x43')]));_0x197a25[_0x13c1('0x42')]=_0x197a25[_0x13c1('0x42')][_0x13c1('0x44')]?_0x197a25[_0x13c1('0x42')]:_0x26914a[_0x13c1('0x3d')];_0x197a25['order']=qs[_0x13c1('0x48')](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x48')]);_0x197a25[_0x13c1('0x4b')]=qs['filters'](_[_0x13c1('0x49')](_0x4f191c[_0x13c1('0x41')],_0x26914a[_0x13c1('0x3f')]));if(_0x4f191c['query']['filter']){_0x197a25[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x197a25[_0x13c1('0x4b')],{'$or':_['map'](_0x197a25[_0x13c1('0x42')],function(_0x38496e){var _0xef424c={};_0xef424c[_0x38496e]={'$like':'%'+_0x4f191c[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0xef424c;})});}_0x197a25=_[_0x13c1('0x4c')]({},_0x197a25,_0x4f191c[_0x13c1('0x51')]);return _0x3853e7[_0x13c1('0xa4')](_0x197a25);}})[_0x13c1('0x2f')](function(_0x31f4cc){if(_0x31f4cc){_0x54debe=_0x31f4cc[_0x13c1('0x44')];if(!_0x4f191c['query']['hasOwnProperty'](_0x13c1('0x45'))){_0x197a25[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x4f191c[_0x13c1('0x41')]['limit']);_0x197a25[_0x13c1('0x2a')]=qs['offset'](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x2a')]);}return _0x3853e7[_0x13c1('0xa4')](_0x197a25);}})['then'](function(_0x36d2c7){if(_0x36d2c7){return _0x36d2c7?{'count':_0x54debe,'rows':_0x36d2c7}:null;}})[_0x13c1('0x2f')](respondWithResult(_0x571a03,null))[_0x13c1('0x56')](handleError(_0x571a03,null));};exports[_0x13c1('0xa5')]=function(_0x14dd9b,_0x464652,_0x20b114){var _0x3c50bc={'raw':![],'where':{}};var _0x10ce6d={};var _0xe73a4a={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x14dd9b[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x464652,null))[_0x13c1('0x2f')](function(_0x4a2b8c){if(_0x4a2b8c){_0x10ce6d[_0x13c1('0x3d')]=_[_0x13c1('0x3e')](db[_0x13c1('0xa6')][_0x13c1('0x3c')]);_0x10ce6d[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x14dd9b['query']);_0x10ce6d[_0x13c1('0x3f')]=_['intersection'](_0x10ce6d[_0x13c1('0x3d')],_0x10ce6d[_0x13c1('0x41')]);_0x3c50bc[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0x10ce6d[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x43')]));_0x3c50bc[_0x13c1('0x42')]=_0x3c50bc[_0x13c1('0x42')][_0x13c1('0x44')]?_0x3c50bc['attributes']:_0x10ce6d[_0x13c1('0x3d')];if(!_0x14dd9b[_0x13c1('0x41')]['hasOwnProperty'](_0x13c1('0x45'))){_0x3c50bc[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x46')]);_0x3c50bc['offset']=qs[_0x13c1('0x2a')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x2a')]);}_0x3c50bc[_0x13c1('0x47')]=qs['sort'](_0x14dd9b[_0x13c1('0x41')]['sort']);_0x3c50bc['where']=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0x14dd9b['query'],_0x10ce6d['filters']));_0x3c50bc[_0x13c1('0x4b')][_0x13c1('0x69')]=_0x4a2b8c['id'];if(_0x14dd9b[_0x13c1('0x41')]['filter']){_0x3c50bc['where']=_[_0x13c1('0x4c')](_0x3c50bc[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x3c50bc[_0x13c1('0x42')],function(_0x41fffc){var _0x2da97f={};_0x2da97f[_0x41fffc]={'$like':'%'+_0x14dd9b[_0x13c1('0x41')]['filter']+'%'};return _0x2da97f;})});}_0x3c50bc=_[_0x13c1('0x4c')]({},_0x3c50bc,_0x14dd9b[_0x13c1('0x51')]);return db[_0x13c1('0xa6')][_0x13c1('0x29')]({'where':_0x3c50bc[_0x13c1('0x4b')]})['then'](function(_0x483c57){_0xe73a4a[_0x13c1('0x29')]=_0x483c57;if(_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x52')]){_0x3c50bc[_0x13c1('0x53')]=[{'model':db[_0x13c1('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x13c1('0xa7'),'attributes':[_0x13c1('0x36'),_0x13c1('0xa8'),_0x13c1('0xa9')],'required':![]},{'model':db[_0x13c1('0xaa')],'as':'Tags','attributes':['id',_0x13c1('0x36'),_0x13c1('0xab')],'where':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]?{'id':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]}:undefined,'required':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]?!![]:![]}];}return db[_0x13c1('0xa6')][_0x13c1('0x54')](_0x3c50bc);})[_0x13c1('0x2f')](function(_0x93a00c){_0xe73a4a[_0x13c1('0x55')]=_0x93a00c;return _0xe73a4a;});}})['then'](respondWithFilteredResult(_0x464652,_0x3c50bc))[_0x13c1('0x56')](handleError(_0x464652,null));};exports['addAgents']=function(_0x527dc0,_0x410010,_0x2e1e9f){return db['OpenchannelAccount'][_0x13c1('0x57')]({'where':{'id':_0x527dc0['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x410010,null))['then'](function(_0x3d301b){if(_0x3d301b){return _0x3d301b[_0x13c1('0xad')](_0x527dc0['body'][_0x13c1('0x66')],_[_0x13c1('0xae')](_0x527dc0['body'],['ids','id'])||{})[_0x13c1('0x8d')](function(_0x1bd5ed){for(var _0x8ea669=0x0;_0x8ea669<_0x527dc0[_0x13c1('0x58')][_0x13c1('0x66')][_0x13c1('0x44')];_0x8ea669+=0x1){socket[_0x13c1('0xaf')]('userOpenchannelAccount:save',{'UserId':_0x527dc0[_0x13c1('0x58')][_0x13c1('0x66')][_0x8ea669],'OpenchannelAccountId':_0x527dc0[_0x13c1('0x5f')]['id']});}return _0x1bd5ed;});}})[_0x13c1('0x2f')](respondWithResult(_0x410010,null))[_0x13c1('0x56')](handleError(_0x410010,null));};exports[_0x13c1('0xb0')]=function(_0x522d4f,_0x37c949,_0x192f4a){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x522d4f[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x37c949,null))[_0x13c1('0x2f')](function(_0x206026){if(_0x206026){return _0x206026[_0x13c1('0xb0')](_0x522d4f[_0x13c1('0x41')][_0x13c1('0x66')])['then'](function(){if(_[_0x13c1('0xb1')](_0x522d4f['query'][_0x13c1('0x66')])){for(var _0x20bdc4=0x0;_0x20bdc4<_0x522d4f[_0x13c1('0x41')]['ids'][_0x13c1('0x44')];_0x20bdc4+=0x1){socket[_0x13c1('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x522d4f['query'][_0x13c1('0x66')][_0x20bdc4]),'OpenchannelAccountId':Number(_0x522d4f[_0x13c1('0x5f')]['id'])});}}else{socket[_0x13c1('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x522d4f['query'][_0x13c1('0x66')]),'OpenchannelAccountId':Number(_0x522d4f[_0x13c1('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x37c949,null))[_0x13c1('0x56')](handleError(_0x37c949,null));};exports[_0x13c1('0xb2')]=function(_0x136ea4,_0x3a86f9,_0x4f52b1){var _0x4a60fb={};var _0x183f3e={};var _0xf8b3e2;var _0x3e7162;return db['OpenchannelAccount'][_0x13c1('0xa3')]({'where':{'id':_0x136ea4['params']['id']}})['then'](handleEntityNotFound(_0x3a86f9,null))[_0x13c1('0x2f')](function(_0x5d688a){if(_0x5d688a){_0xf8b3e2=_0x5d688a;_0x183f3e[_0x13c1('0x3d')]=_[_0x13c1('0x3e')](db[_0x13c1('0x96')][_0x13c1('0x3c')]);_0x183f3e['query']=_[_0x13c1('0x3e')](_0x136ea4[_0x13c1('0x41')]);_0x183f3e[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0x183f3e['model'],_0x183f3e['query']);_0x4a60fb['attributes']=_[_0x13c1('0x40')](_0x183f3e[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x136ea4[_0x13c1('0x41')][_0x13c1('0x43')]));_0x4a60fb[_0x13c1('0x42')]=_0x4a60fb[_0x13c1('0x42')][_0x13c1('0x44')]?_0x4a60fb[_0x13c1('0x42')]:_0x183f3e[_0x13c1('0x3d')];_0x4a60fb['order']=qs[_0x13c1('0x48')](_0x136ea4['query'][_0x13c1('0x48')]);_0x4a60fb[_0x13c1('0x4b')]=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0x136ea4['query'],_0x183f3e['filters']));if(_0x136ea4[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x4a60fb['where']=_['merge'](_0x4a60fb[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x4a60fb[_0x13c1('0x42')],function(_0x3e6d49){var _0x2d34fb={};_0x2d34fb[_0x3e6d49]={'$like':'%'+_0x136ea4[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0x2d34fb;})});}_0x4a60fb=_[_0x13c1('0x4c')]({},_0x4a60fb,_0x136ea4['options']);return _0xf8b3e2[_0x13c1('0xb2')](_0x4a60fb);}})[_0x13c1('0x2f')](function(_0x34ca19){if(_0x34ca19){_0x3e7162=_0x34ca19['length'];if(!_0x136ea4[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x4a60fb[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x136ea4[_0x13c1('0x41')][_0x13c1('0x46')]);_0x4a60fb[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0x136ea4[_0x13c1('0x41')]['offset']);}return _0xf8b3e2[_0x13c1('0xb2')](_0x4a60fb);}})[_0x13c1('0x2f')](function(_0x11369b){if(_0x11369b){return _0x11369b?{'count':_0x3e7162,'rows':_0x11369b}:null;}})['then'](respondWithResult(_0x3a86f9,null))[_0x13c1('0x56')](handleError(_0x3a86f9,null));};exports[_0x13c1('0x37')]=function(_0x58e629,_0x39411e,_0x471c5a){var _0x24435b,_0x231c0a,_0x23ef4c;if(_[_0x13c1('0x76')](_0x58e629[_0x13c1('0x58')][_0x13c1('0x58')])||_0x58e629['body'][_0x13c1('0x58')]===''){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x58e629['body']['to'])){}_0x24435b=_0x58e629[_0x13c1('0x58')]['to'];return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x58e629[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))['then'](function(_0x541836){if(_0x541836){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x541836['id']},'include':[{'model':db['CmList'],'as':_0x13c1('0x7d'),'include':[{'model':db['CmContact'],'as':_0x13c1('0x86'),'where':{[_0x541836['mapKey']]:_0x24435b},'limit':0x1,'order':[[_0x13c1('0x73'),'DESC']]}]}]})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))[_0x13c1('0x2f')](function(_0x34be74){if(_0x34be74&&_0x34be74[_0x13c1('0x7d')]){_0x231c0a=_0x34be74[_0x13c1('0x30')]({'plain':!![]});if(_0x231c0a[_0x13c1('0x7d')]&&_0x231c0a['List']['Contacts'][_0x13c1('0x44')]){return _0x231c0a[_0x13c1('0x7d')][_0x13c1('0x86')][0x0];}return db[_0x13c1('0x7e')]['create'](_[_0x13c1('0x87')](_0x58e629[_0x13c1('0x58')],{'firstName':_0x24435b,[_0x34be74[_0x13c1('0x7a')]]:_0x24435b,'phone':_0x24435b,'ListId':_0x231c0a[_0x13c1('0x75')]}));}})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))[_0x13c1('0x2f')](function(_0x33d551){if(_0x33d551){_0x23ef4c=_0x33d551;return db[_0x13c1('0xa6')][_0x13c1('0x57')]({'where':{'ContactId':_0x23ef4c['id'],'closed':![],'OpenchannelAccountId':_0x231c0a['id']}})[_0x13c1('0x2f')](function(_0x4b444f){if(_0x4b444f){return[_0x4b444f,![]];}return db[_0x13c1('0xa6')][_0x13c1('0x5d')]({'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id'],'OpenchannelAccountId':_0x231c0a['id'],'lastMsgDirection':_0x13c1('0xb3'),'Messages':[_[_0x13c1('0x4c')](_0x58e629[_0x13c1('0x58')],{'read':![],'body':_0x58e629[_0x13c1('0x58')]['body'],'OpenchannelAccountId':_0x231c0a['id'],'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x13c1('0xb4')}]})['then'](function(_0x11d825){return[_0x11d825,!![]];});});}})[_0x13c1('0x8d')](function(_0x2ff4c6,_0x11ff18){if(_0x11ff18){return _0x2ff4c6;}return db[_0x13c1('0x94')][_0x13c1('0x5d')](_[_0x13c1('0x4c')](_0x58e629[_0x13c1('0x58')],{'read':![],'body':_0x58e629[_0x13c1('0x58')]['body'],'OpenchannelAccountId':_0x231c0a['id'],'OpenchannelInteractionId':_0x2ff4c6['id'],'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id']}))[_0x13c1('0x2f')](function(_0x553ba0){_0x2ff4c6['dataValues']['Messages']=[];_0x2ff4c6[_0x13c1('0xb5')][_0x13c1('0xb4')][_0x13c1('0x91')](_0x553ba0[_0x13c1('0xb5')]);return _0x2ff4c6;});});}})[_0x13c1('0x2f')](respondWithResult(_0x39411e,null))[_0x13c1('0x56')](handleError(_0x39411e,null));}; \ No newline at end of file +var _0x83ac=['stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','reject','update','destroy','get','OpenchannelAccounts','sendStatus','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','model','keys','query','intersection','fields','attributes','nolimit','sort','filters','filter','where','merge','type','key','VIRTUAL','field','options','findAll','show','Pause','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','order','pick','OpenchannelAccountId','map','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','hasOwnProperty','include','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','list','applications','orderBy','priority','defaults','ListId','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','includeAll','Contact','fullname','internal','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2cd863,_0x434fcf){var _0x3ad0b3=function(_0x2fd4e2){while(--_0x2fd4e2){_0x2cd863['push'](_0x2cd863['shift']());}};_0x3ad0b3(++_0x434fcf);}(_0x83ac,0x15d));var _0xc83a=function(_0x586184,_0x14ddff){_0x586184=_0x586184-0x0;var _0x40cda7=_0x83ac[_0x586184];return _0x40cda7;};'use strict';var pdf=require(_0xc83a('0x0'));var emlformat=require(_0xc83a('0x1'));var rimraf=require(_0xc83a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc83a('0x3'));var moment=require(_0xc83a('0x4'));var BPromise=require(_0xc83a('0x5'));var Mustache=require(_0xc83a('0x6'));var util=require(_0xc83a('0x7'));var path=require(_0xc83a('0x8'));var sox=require('sox');var csv=require(_0xc83a('0x9'));var ejs=require(_0xc83a('0xa'));var fs=require('fs');var _=require(_0xc83a('0xb'));var squel=require(_0xc83a('0xc'));var crypto=require(_0xc83a('0xd'));var jsforce=require(_0xc83a('0xe'));var deskjs=require(_0xc83a('0xf'));var toCsv=require(_0xc83a('0x9'));var querystring=require(_0xc83a('0x10'));var Papa=require('papaparse');var Redis=require(_0xc83a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc83a('0x12'));var hardwareService=require(_0xc83a('0x13'));var logger=require(_0xc83a('0x14'))(_0xc83a('0x15'));var utils=require(_0xc83a('0x16'));var config=require('../../config/environment');var db=require(_0xc83a('0x17'))['db'];config[_0xc83a('0x18')]=_['defaults'](config[_0xc83a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc83a('0x19'))(new Redis(config[_0xc83a('0x18')]));require(_0xc83a('0x1a'))[_0xc83a('0x1b')](socket);var jayson=require(_0xc83a('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc83a('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x3783f3,_0x2ee044,_0x52ae67){if(_0x52ae67){var _0x10f1dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10f1dd[_0xc83a('0x1e')](_0x2ee044)){return _0x3783f3;}else{throw new Error(_0xc83a('0x1f'));}}else{return _0x3783f3;}}function respondWithRpcPromise(_0x9d030e,_0x50f0c8,_0x5829ab,_0xdbb6fd){return new BPromise(function(_0x45dbe4,_0x5a8282){var _0x4b7593=_0xdbb6fd||client;return _0x4b7593[_0xc83a('0x20')](_0x9d030e,_0x5829ab)[_0xc83a('0x21')](function(_0x52c99d){logger[_0xc83a('0x22')](_0xc83a('0x23'),_0x50f0c8,_0xc83a('0x24'));logger[_0xc83a('0x25')](_0xc83a('0x26'),_0x50f0c8,_0xc83a('0x24'),JSON[_0xc83a('0x27')](_0x52c99d));if(_0x52c99d[_0xc83a('0x28')]){if(_0x52c99d[_0xc83a('0x28')][_0xc83a('0x29')]===0x1f4){logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x52c99d['error'][_0xc83a('0x2a')]);return _0x5a8282(_0x52c99d['error'][_0xc83a('0x2a')]);}logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x52c99d[_0xc83a('0x28')]['message']);return _0x45dbe4(_0x52c99d[_0xc83a('0x28')][_0xc83a('0x2a')]);}else{logger[_0xc83a('0x22')](_0xc83a('0x23'),_0x50f0c8,'request\x20sent');_0x45dbe4(_0x52c99d[_0xc83a('0x2b')][_0xc83a('0x2a')]);}})[_0xc83a('0x2c')](function(_0x90d88c){logger[_0xc83a('0x28')](_0xc83a('0x23'),_0x50f0c8,_0x90d88c);_0x5a8282(_0x90d88c);});});}function respondWithStatusCode(_0x2ce281,_0x2ac69e){_0x2ac69e=_0x2ac69e||0xcc;return function(_0x2456a7){if(_0x2456a7){return _0x2ce281['sendStatus'](_0x2ac69e);}return _0x2ce281[_0xc83a('0x2d')](_0x2ac69e)[_0xc83a('0x2e')]();};}function respondWithResult(_0x2ec299,_0x120781){_0x120781=_0x120781||0xc8;return function(_0x10df05){if(_0x10df05){return _0x2ec299[_0xc83a('0x2d')](_0x120781)[_0xc83a('0x2f')](_0x10df05);}};}function respondWithFilteredResult(_0x412e08,_0x42a062){return function(_0x83eaa5){if(_0x83eaa5){var _0xef7d0a=_0x83eaa5[_0xc83a('0x30')],_0x120186=_0x42a062[_0xc83a('0x31')],_0x293157=_0x42a062[_0xc83a('0x31')]+_0x42a062[_0xc83a('0x32')],_0x3938d4;if(_0x293157>=_0xef7d0a){_0x293157=_0xef7d0a;_0x3938d4=0xc8;}else{_0x3938d4=0xce;}_0x412e08[_0xc83a('0x2d')](_0x3938d4);return _0x412e08[_0xc83a('0x33')]('Content-Range',_0x120186+'-'+_0x293157+'/'+_0xef7d0a)[_0xc83a('0x2f')](_0x83eaa5);}return null;};}function patchUpdates(_0x6c05a3){return function(_0x47049d){try{jsonpatch[_0xc83a('0x34')](_0x47049d,_0x6c05a3,!![]);}catch(_0x39d1b0){return BPromise[_0xc83a('0x35')](_0x39d1b0);}return _0x47049d['save']();};}function saveUpdates(_0x451b3d,_0x4ba60a){return function(_0x1b9103){if(_0x1b9103){return _0x1b9103[_0xc83a('0x36')](_0x451b3d)[_0xc83a('0x21')](function(_0x60d6ab){return _0x60d6ab;});}return null;};}function removeEntity(_0xcbe612,_0x350e8b){return function(_0x17d007){if(_0x17d007){return _0x17d007[_0xc83a('0x37')]()[_0xc83a('0x21')](function(){var _0x4dc180=_0x17d007[_0xc83a('0x38')]({'plain':!![]});var _0x42df3c=_0xc83a('0x39');return db['UserProfileResource'][_0xc83a('0x37')]({'where':{'type':_0x42df3c,'resourceId':_0x4dc180['id']}})[_0xc83a('0x21')](function(){return _0x17d007;});})[_0xc83a('0x21')](function(){_0xcbe612[_0xc83a('0x2d')](0xcc)[_0xc83a('0x2e')]();});}};}function handleEntityNotFound(_0x1e8093,_0x238522){return function(_0x156f8e){if(!_0x156f8e){_0x1e8093[_0xc83a('0x3a')](0x194);}return _0x156f8e;};}function handleError(_0x11bb8b,_0xbf1805){_0xbf1805=_0xbf1805||0x1f4;return function(_0x3775e3){logger[_0xc83a('0x28')](_0x3775e3[_0xc83a('0x3b')]);if(_0x3775e3[_0xc83a('0x3c')]){delete _0x3775e3[_0xc83a('0x3c')];}_0x11bb8b[_0xc83a('0x2d')](_0xbf1805)[_0xc83a('0x3d')](_0x3775e3);};}exports[_0xc83a('0x3e')]=function(_0x23af0e,_0xb7219d){var _0x2f4d18={'include':[{'model':db['Pause'],'as':_0xc83a('0x3f')}]},_0x8447d2={},_0x1a708c={'count':0x0,'rows':[]};var _0x243ea1=db[_0xc83a('0x40')]['rawAttributes'];_0x8447d2[_0xc83a('0x41')]=_[_0xc83a('0x42')](_0x243ea1);_0x8447d2['query']=_[_0xc83a('0x42')](_0x23af0e[_0xc83a('0x43')]);_0x8447d2['filters']=_['intersection'](_0x8447d2['model'],_0x8447d2[_0xc83a('0x43')]);_0x2f4d18['attributes']=_[_0xc83a('0x44')](_0x8447d2['model'],qs[_0xc83a('0x45')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x45')]));_0x2f4d18[_0xc83a('0x46')]=_0x2f4d18[_0xc83a('0x46')]['length']?_0x2f4d18[_0xc83a('0x46')]:_0x8447d2[_0xc83a('0x41')];if(!_0x23af0e[_0xc83a('0x43')]['hasOwnProperty'](_0xc83a('0x47'))){_0x2f4d18[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x32')]);_0x2f4d18['offset']=qs['offset'](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x2f4d18['order']=qs[_0xc83a('0x48')](_0x23af0e[_0xc83a('0x43')][_0xc83a('0x48')]);_0x2f4d18['where']=qs['filters'](_['pick'](_0x23af0e[_0xc83a('0x43')],_0x8447d2[_0xc83a('0x49')]));if(_0x23af0e[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x2f4d18[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x2f4d18['where'],{'$or':_['map'](_0x243ea1,function(_0x506e1a){if(_0x506e1a[_0xc83a('0x4d')][_0xc83a('0x4e')]!==_0xc83a('0x4f')){var _0x52e56b={};_0x52e56b[_0x506e1a[_0xc83a('0x50')]]={'$like':'%'+_0x23af0e[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x52e56b;}})});}_0x2f4d18=_[_0xc83a('0x4c')]({},_0x2f4d18,_0x23af0e[_0xc83a('0x51')]);var _0xcd05ed={'where':_0x2f4d18[_0xc83a('0x4b')]};return db[_0xc83a('0x40')][_0xc83a('0x30')](_0xcd05ed)[_0xc83a('0x21')](function(_0x19bbe9){_0x1a708c[_0xc83a('0x30')]=_0x19bbe9;if(_0x23af0e[_0xc83a('0x43')]['includeAll']){_0x2f4d18['include']=[{'all':!![]}];}return db[_0xc83a('0x40')][_0xc83a('0x52')](_0x2f4d18);})[_0xc83a('0x21')](function(_0x31d810){_0x1a708c['rows']=_0x31d810;return _0x1a708c;})[_0xc83a('0x21')](respondWithFilteredResult(_0xb7219d,_0x2f4d18))[_0xc83a('0x2c')](handleError(_0xb7219d,null));};exports[_0xc83a('0x53')]=function(_0x2124d0,_0x4a7052){var _0x2e082d={'raw':![],'where':{'id':_0x2124d0['params']['id']},'include':[{'model':db[_0xc83a('0x54')],'as':_0xc83a('0x3f')}]},_0x554aba={};_0x554aba['model']=_[_0xc83a('0x42')](db['OpenchannelAccount'][_0xc83a('0x55')]);_0x554aba['query']=_[_0xc83a('0x42')](_0x2124d0[_0xc83a('0x43')]);_0x554aba[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x554aba[_0xc83a('0x41')],_0x554aba[_0xc83a('0x43')]);_0x2e082d['attributes']=_[_0xc83a('0x44')](_0x554aba[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x2124d0[_0xc83a('0x43')][_0xc83a('0x45')]));_0x2e082d[_0xc83a('0x46')]=_0x2e082d['attributes'][_0xc83a('0x56')]?_0x2e082d['attributes']:_0x554aba[_0xc83a('0x41')];if(_0x2124d0['query']['includeAll']){_0x2e082d['include']=[{'all':!![]}];}_0x2e082d=_[_0xc83a('0x4c')]({},_0x2e082d,_0x2124d0[_0xc83a('0x51')]);return db['OpenchannelAccount']['find'](_0x2e082d)[_0xc83a('0x21')](handleEntityNotFound(_0x4a7052,null))[_0xc83a('0x21')](respondWithResult(_0x4a7052,null))['catch'](handleError(_0x4a7052,null));};exports['create']=function(_0x4809be,_0x50dde0){return db[_0xc83a('0x40')][_0xc83a('0x57')](_0x4809be[_0xc83a('0x58')],{})[_0xc83a('0x21')](function(_0x2bb80b){var _0x510376=_0x4809be[_0xc83a('0x59')][_0xc83a('0x38')]({'plain':!![]});if(!_0x510376)throw new Error(_0xc83a('0x5a'));if(_0x510376['role']==='user'){var _0x21f32b=_0x2bb80b['get']({'plain':!![]});var _0x29237e='OpenchannelAccounts';return db['UserProfileSection'][_0xc83a('0x5b')]({'where':{'name':_0x29237e,'userProfileId':_0x510376[_0xc83a('0x5c')]},'raw':!![]})[_0xc83a('0x21')](function(_0x41cc02){if(_0x41cc02&&_0x41cc02[_0xc83a('0x5d')]===0x0){return db[_0xc83a('0x5e')][_0xc83a('0x57')]({'name':_0x21f32b['name'],'resourceId':_0x21f32b['id'],'type':_0x41cc02['name'],'sectionId':_0x41cc02['id']},{})[_0xc83a('0x21')](function(){return _0x2bb80b;});}else{return _0x2bb80b;}})[_0xc83a('0x2c')](function(_0x3f793a){logger[_0xc83a('0x28')](_0xc83a('0x5f'),_0x3f793a);throw _0x3f793a;});}return _0x2bb80b;})['then'](respondWithResult(_0x50dde0,0xc9))[_0xc83a('0x2c')](handleError(_0x50dde0,null));};exports['update']=function(_0x2460c4,_0x130006){if(_0x2460c4[_0xc83a('0x58')]['id']){delete _0x2460c4[_0xc83a('0x58')]['id'];}return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x2460c4[_0xc83a('0x60')]['id']},'include':[{'model':db[_0xc83a('0x54')],'as':_0xc83a('0x3f')}]})[_0xc83a('0x21')](handleEntityNotFound(_0x130006,null))[_0xc83a('0x21')](saveUpdates(_0x2460c4[_0xc83a('0x58')],null))[_0xc83a('0x21')](respondWithResult(_0x130006,null))['catch'](handleError(_0x130006,null));};exports[_0xc83a('0x37')]=function(_0x5a95e1,_0x608a25){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x5a95e1[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x608a25,null))['then'](removeEntity(_0x608a25,null))[_0xc83a('0x2c')](handleError(_0x608a25,null));};exports[_0xc83a('0x61')]=function(_0x55523a,_0x2ca151){return db['OpenchannelAccount'][_0xc83a('0x61')]()[_0xc83a('0x21')](respondWithResult(_0x2ca151,null))[_0xc83a('0x2c')](handleError(_0x2ca151,null));};exports[_0xc83a('0x62')]=function(_0x599d5f,_0x45e659,_0x2d949b){if(_0x599d5f[_0xc83a('0x58')]['id']){delete _0x599d5f[_0xc83a('0x58')]['id'];}return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x599d5f[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x45e659,null))[_0xc83a('0x21')](function(_0x10384e){if(_0x10384e){_0x599d5f[_0xc83a('0x58')][_0xc83a('0x63')]=_0x10384e['id'];return db[_0xc83a('0x64')][_0xc83a('0x57')](_0x599d5f[_0xc83a('0x58')]);}})[_0xc83a('0x21')](respondWithResult(_0x45e659,null))[_0xc83a('0x2c')](handleError(_0x45e659,null));};exports[_0xc83a('0x65')]=function(_0x43f50d,_0x3be9a7,_0x2f6a5c){var _0x288d52={'raw':![],'where':{}};var _0xd56fe1={};var _0x1eb8be={'count':0x0,'rows':[]};return db[_0xc83a('0x40')]['findOne']({'where':{'id':_0x43f50d[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x3be9a7,null))[_0xc83a('0x21')](function(_0x4ca532){if(_0x4ca532){_0xd56fe1['model']=_[_0xc83a('0x42')](db[_0xc83a('0x64')][_0xc83a('0x55')]);_0xd56fe1['query']=_['keys'](_0x43f50d['query']);_0xd56fe1[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0xd56fe1['model'],_0xd56fe1['query']);_0x288d52[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0xd56fe1['model'],qs[_0xc83a('0x45')](_0x43f50d['query']['fields']));_0x288d52[_0xc83a('0x46')]=_0x288d52[_0xc83a('0x46')][_0xc83a('0x56')]?_0x288d52[_0xc83a('0x46')]:_0xd56fe1['model'];if(!_0x43f50d[_0xc83a('0x43')]['hasOwnProperty'](_0xc83a('0x47'))){_0x288d52[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x32')]);_0x288d52['offset']=qs[_0xc83a('0x31')](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x288d52[_0xc83a('0x66')]=qs['sort'](_0x43f50d[_0xc83a('0x43')][_0xc83a('0x48')]);_0x288d52[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x43f50d[_0xc83a('0x43')],_0xd56fe1[_0xc83a('0x49')]));_0x288d52[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x4ca532['id'];if(_0x43f50d['query'][_0xc83a('0x4a')]){_0x288d52[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x288d52[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x288d52[_0xc83a('0x46')],function(_0x1631b7){var _0x5b3a67={};_0x5b3a67[_0x1631b7]={'$like':'%'+_0x43f50d[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x5b3a67;})});}_0x288d52=_['merge']({},_0x288d52,_0x43f50d[_0xc83a('0x51')]);return db[_0xc83a('0x64')][_0xc83a('0x30')]({'where':_0x288d52['where']})[_0xc83a('0x21')](function(_0x3f71ac){_0x1eb8be[_0xc83a('0x30')]=_0x3f71ac;if(_0x43f50d[_0xc83a('0x43')]['includeAll']){_0x288d52['include']=[{'all':!![]}];}return db[_0xc83a('0x64')]['findAll'](_0x288d52);})[_0xc83a('0x21')](function(_0x2714f5){_0x1eb8be[_0xc83a('0x6a')]=_0x2714f5;return _0x1eb8be;});}})[_0xc83a('0x21')](respondWithFilteredResult(_0x3be9a7,_0x288d52))['catch'](handleError(_0x3be9a7,null));};exports[_0xc83a('0x6b')]=function(_0xf64b16,_0x406a29,_0x4f0276){return db[_0xc83a('0x40')]['find']({'where':{'id':_0xf64b16[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x406a29,null))[_0xc83a('0x21')](function(_0x48926e){if(_0x48926e){return _0x48926e[_0xc83a('0x6b')](_0xf64b16['query'][_0xc83a('0x6c')]);}})['then'](respondWithStatusCode(_0x406a29,null))['catch'](handleError(_0x406a29,null));};exports[_0xc83a('0x6d')]=function(_0x44ee4c,_0x2238e5,_0x343933){if(_0x44ee4c[_0xc83a('0x58')]['id']){delete _0x44ee4c[_0xc83a('0x58')]['id'];}return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x44ee4c[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x2238e5,null))['then'](function(_0x10319a){if(_0x10319a){_0x44ee4c[_0xc83a('0x58')][_0xc83a('0x68')]=_0x10319a['id'];return db[_0xc83a('0x6e')][_0xc83a('0x57')](_0x44ee4c[_0xc83a('0x58')]);}})[_0xc83a('0x21')](respondWithResult(_0x2238e5,null))[_0xc83a('0x2c')](handleError(_0x2238e5,null));};exports[_0xc83a('0x6f')]=function(_0x5cae04,_0x2b2845,_0x46b8dc){var _0x496bd9={'raw':![],'where':{}};var _0x4d47ac={};var _0x10b31d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0x5cae04[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x2b2845,null))['then'](function(_0x4f10c4){if(_0x4f10c4){_0x4d47ac[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x6e')][_0xc83a('0x55')]);_0x4d47ac[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x5cae04[_0xc83a('0x43')]);_0x4d47ac[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x4d47ac[_0xc83a('0x41')],_0x4d47ac[_0xc83a('0x43')]);_0x496bd9['attributes']=_['intersection'](_0x4d47ac[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x45')]));_0x496bd9[_0xc83a('0x46')]=_0x496bd9[_0xc83a('0x46')][_0xc83a('0x56')]?_0x496bd9[_0xc83a('0x46')]:_0x4d47ac['model'];if(!_0x5cae04['query'][_0xc83a('0x71')](_0xc83a('0x47'))){_0x496bd9[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x32')]);_0x496bd9[_0xc83a('0x31')]=qs[_0xc83a('0x31')](_0x5cae04['query'][_0xc83a('0x31')]);}_0x496bd9['order']=qs[_0xc83a('0x48')](_0x5cae04[_0xc83a('0x43')][_0xc83a('0x48')]);_0x496bd9[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x5cae04[_0xc83a('0x43')],_0x4d47ac[_0xc83a('0x49')]));_0x496bd9[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x4f10c4['id'];if(_0x5cae04[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x496bd9[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x496bd9[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x496bd9['attributes'],function(_0x8d2926){var _0x4afad0={};_0x4afad0[_0x8d2926]={'$like':'%'+_0x5cae04[_0xc83a('0x43')][_0xc83a('0x4a')]+'%'};return _0x4afad0;})});}_0x496bd9=_[_0xc83a('0x4c')]({},_0x496bd9,_0x5cae04[_0xc83a('0x51')]);return db['CannedAnswer']['count']({'where':_0x496bd9[_0xc83a('0x4b')]})[_0xc83a('0x21')](function(_0x2429fe){_0x10b31d[_0xc83a('0x30')]=_0x2429fe;if(_0x5cae04[_0xc83a('0x43')]['includeAll']){_0x496bd9[_0xc83a('0x72')]=[{'all':!![]}];}return db[_0xc83a('0x6e')][_0xc83a('0x52')](_0x496bd9);})[_0xc83a('0x21')](function(_0x17281d){_0x10b31d[_0xc83a('0x6a')]=_0x17281d;return _0x10b31d;});}})[_0xc83a('0x21')](respondWithFilteredResult(_0x2b2845,_0x496bd9))['catch'](handleError(_0x2b2845,null));};exports[_0xc83a('0x73')]=function(_0x3ab1fa,_0x4c91da,_0x212f69){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x3ab1fa[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x4c91da,null))[_0xc83a('0x21')](function(_0x25d6b6){if(_0x25d6b6){return _0x25d6b6[_0xc83a('0x73')](_0x3ab1fa['query'][_0xc83a('0x6c')]);}})['then'](respondWithStatusCode(_0x4c91da,null))[_0xc83a('0x2c')](handleError(_0x4c91da,null));};exports[_0xc83a('0x74')]=function(_0x260d24,_0x20f89c,_0x324eec){var _0x1d1e43={'body':_0x260d24[_0xc83a('0x58')],'channel':_0xc83a('0x75')};var _0x21a735=[];var _0x27cf11=[];var _0x2e5cbf={};var _0x340893=![];return db[_0xc83a('0x76')][_0xc83a('0x61')]()['then'](function(_0x38a3e0){if(!_0x38a3e0){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))](_0xc83a('0x79'));}_0x21a735=_['difference'](_[_0xc83a('0x42')](_0x38a3e0),[_0xc83a('0x7a'),'updatedAt']);_0x27cf11=_[_0xc83a('0x7b')](_[_0xc83a('0x42')](_0x38a3e0),['createdAt',_0xc83a('0x7c'),_0xc83a('0x7d'),'ListId']);if(_0x260d24['body']['id']){delete _0x260d24[_0xc83a('0x58')]['id'];}if(_[_0xc83a('0x7e')](_0x260d24[_0xc83a('0x58')][_0xc83a('0x7f')])){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('from\x20is\x20mandatory');}if(_[_0xc83a('0x7e')](_0x260d24['body']['body'])||_0x260d24['body'][_0xc83a('0x58')]===''){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc83a('0x7e')](_0x260d24[_0xc83a('0x58')][_0xc83a('0x80')])){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27cf11);}if(!_[_0xc83a('0x81')](_0x27cf11,_0x260d24[_0xc83a('0x58')]['mapKey'])){throw new db['Sequelize'][(_0xc83a('0x78'))](_0xc83a('0x82')+_0x27cf11);}_0x2e5cbf[_0x260d24[_0xc83a('0x58')][_0xc83a('0x80')]]=_0x260d24[_0xc83a('0x58')]['from'];})[_0xc83a('0x21')](function(){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x260d24[_0xc83a('0x60')]['id']},'include':[{'model':db[_0xc83a('0x83')],'as':_0xc83a('0x84'),'include':[{'model':db[_0xc83a('0x76')],'as':_0xc83a('0x85'),'where':_0x2e5cbf,'limit':0x1,'order':[[_0xc83a('0x7c'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xc83a('0x86')}]});})[_0xc83a('0x21')](handleEntityNotFound(_0x20f89c,null))[_0xc83a('0x21')](function(_0xcec2f6){if(_0xcec2f6&&_0xcec2f6[_0xc83a('0x84')]){_0x1d1e43[_0xc83a('0x87')]=_0xcec2f6;_0x1d1e43['applications']=_0xcec2f6[_0xc83a('0x86')];_0x1d1e43[_0xc83a('0x88')]=_0xcec2f6['List'];_0x1d1e43[_0xc83a('0x89')]=_[_0xc83a('0x8a')](_0x1d1e43[_0xc83a('0x89')],[_0xc83a('0x8b')],['asc']);if(_0x1d1e43[_0xc83a('0x87')]['Applications']){delete _0x1d1e43[_0xc83a('0x87')]['Applications'];}if(_0x1d1e43['account'][_0xc83a('0x84')]&&_0x1d1e43[_0xc83a('0x87')][_0xc83a('0x84')]['Contacts']['length']){return _0x1d1e43[_0xc83a('0x87')][_0xc83a('0x84')][_0xc83a('0x85')][0x0];}var _0x2c87ea=_[_0xc83a('0x8c')](_0x260d24[_0xc83a('0x58')],{'firstName':_0x260d24['body'][_0xc83a('0x7f')],'ListId':_0xcec2f6[_0xc83a('0x8d')]});_0x2c87ea[_0x260d24[_0xc83a('0x58')]['mapKey']]=_0x260d24['body'][_0xc83a('0x7f')];return db[_0xc83a('0x76')][_0xc83a('0x57')](_0x2c87ea,{'fields':_0x21a735,'raw':!![]});}})[_0xc83a('0x21')](handleEntityNotFound(_0x20f89c,null))[_0xc83a('0x21')](function(_0x39e050){_0x1d1e43[_0xc83a('0x8e')]=_0x39e050;if(_0x39e050){var _0x2b564d={'ContactId':_0x39e050['id'],'OpenchannelAccountId':_0x260d24[_0xc83a('0x60')]['id'],'from':(_0x39e050['firstName']||'')+'\x20'+(_0x39e050['lastName']||'')};var _0xf8a504={'OpenchannelAccountId':_0x260d24[_0xc83a('0x60')]['id'],'closed':![]};if(_0x260d24['body'][_0xc83a('0x8f')]){_0xf8a504[_0xc83a('0x8f')]=_0x260d24[_0xc83a('0x58')][_0xc83a('0x8f')];return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':_0xf8a504})[_0xc83a('0x21')](function(_0x19bffa){if(_0x19bffa){return[_0x19bffa,![]];}_0x2b564d[_0xc83a('0x8f')]=_0x260d24[_0xc83a('0x58')]['threadId'];_0x2b564d[_0xc83a('0x91')]=_0x260d24[_0xc83a('0x58')][_0xc83a('0x91')];return db['OpenchannelInteraction'][_0xc83a('0x57')](_0x2b564d)[_0xc83a('0x21')](function(_0x2948d0){return[_0x2948d0,!![]];});});}else{_0xf8a504[_0xc83a('0x8f')]=null;}_0xf8a504[_0xc83a('0x92')]=_0x39e050['id'];return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':_0xf8a504})[_0xc83a('0x21')](function(_0x5baf33){if(_0x5baf33){return[_0x5baf33,![]];}return db[_0xc83a('0x90')][_0xc83a('0x57')](_0x2b564d)[_0xc83a('0x21')](function(_0xdd48f0){return[_0xdd48f0,!![]];});});}})[_0xc83a('0x93')](function(_0x2a34dc,_0x4d0064){if(_0x2a34dc){_0x340893=_0x4d0064;if(!_0x4d0064){var _0x503696={'from':(_0x1d1e43[_0xc83a('0x8e')][_0xc83a('0x94')]||'')+'\x20'+(_0x1d1e43[_0xc83a('0x8e')][_0xc83a('0x95')]||'')};if(_0x260d24['body'][_0xc83a('0x8f')]&&_0x260d24[_0xc83a('0x58')][_0xc83a('0x96')]&&_0x260d24['body'][_0xc83a('0x8f')]!=_0x260d24[_0xc83a('0x58')][_0xc83a('0x96')]){_0x503696[_0xc83a('0x8f')]=_0x260d24['body'][_0xc83a('0x96')];}return _0x2a34dc[_0xc83a('0x36')](_0x503696);}else{return _0x2a34dc;}}})['then'](function(_0x18ff67){_0x1d1e43[_0xc83a('0x97')]=_0x18ff67[_0xc83a('0x38')]({'plain':!![]});_0x1d1e43[_0xc83a('0x97')][_0xc83a('0x98')]=_0x340893;if(_0x1d1e43['interaction'][_0xc83a('0x98')]){if(_0x1d1e43[_0xc83a('0x87')][_0xc83a('0x99')]){_0x1d1e43['applications'][_0xc83a('0x9a')]({'id':0x0,'priority':_0x1d1e43['applications'][_0xc83a('0x56')]+0x1,'app':_0xc83a('0x9b'),'appdata':_0xc83a('0x9c'),'interval':_0xc83a('0x9d')});}}return db['OpenchannelMessage'][_0xc83a('0x57')]({'body':_0x260d24[_0xc83a('0x58')][_0xc83a('0x58')],'OpenchannelAccountId':_0x260d24['params']['id'],'OpenchannelInteractionId':_0x18ff67['id'],'direction':'in','ContactId':_0x1d1e43['contact']['id'],'AttachmentId':_0x260d24[_0xc83a('0x58')]['AttachmentId']});})['then'](function(_0x1585e1){_0x1d1e43[_0xc83a('0x2a')]=_0x1585e1;if(_0x1d1e43[_0xc83a('0x97')][_0xc83a('0x9e')]){return db[_0xc83a('0x9f')][_0xc83a('0x5b')]({'attributes':['id',_0xc83a('0x3c')],'where':{'id':_0x1d1e43['interaction'][_0xc83a('0x9e')]}})['then'](function(_0x227038){if(_0x227038){_0x1d1e43[_0xc83a('0x89')][_0xc83a('0xa0')]({'id':0x0,'priority':0x0,'app':_0xc83a('0xa1'),'appdata':_0x227038[_0xc83a('0x3c')]+','+(_0x1d1e43[_0xc83a('0x87')][_0xc83a('0xa2')]||0xa),'interval':'*,*,*,*'});_0x1d1e43[_0xc83a('0xa3')]=![];}return respondWithRpcPromise(_0xc83a('0xa4'),_0xc83a('0xa5'),_0x1d1e43);});}return respondWithRpcPromise(_0xc83a('0xa4'),'startRouting',_0x1d1e43);})[_0xc83a('0x21')](function(_0x51afa3){respondWithRpcPromise(_0xc83a('0xa6'),_0xc83a('0xa6'),{'event':'notify','message':_0x51afa3},client9002);return _0x51afa3;})[_0xc83a('0x21')](respondWithResult(_0x20f89c,null))[_0xc83a('0x2c')](handleError(_0x20f89c,null));};exports[_0xc83a('0xa7')]=function(_0x8d00c8,_0x127b1f,_0x4f0a4b){return db[_0xc83a('0x40')][_0xc83a('0x70')]({'where':{'id':_0x8d00c8[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x127b1f,null))[_0xc83a('0x21')](function(_0x211595){if(_0x211595){return db[_0xc83a('0xa8')][_0xc83a('0xa9')](function(_0x2eb9b0){return db[_0xc83a('0xaa')][_0xc83a('0x37')]({'where':{'OpenchannelAccountId':_0x8d00c8[_0xc83a('0x60')]['id']},'transaction':_0x2eb9b0})[_0xc83a('0x21')](function(_0x342443){var _0x44077c=_[_0xc83a('0x69')](_0x8d00c8[_0xc83a('0x58')],function(_0x6973b8){_0x6973b8[_0xc83a('0x68')]=_0x8d00c8[_0xc83a('0x60')]['id'];return _0x6973b8;});return db[_0xc83a('0xaa')][_0xc83a('0xab')](_0x44077c,{'transaction':_0x2eb9b0});});})[_0xc83a('0x21')](function(){return db[_0xc83a('0xaa')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x8d00c8[_0xc83a('0x60')]['id']},'order':_0xc83a('0x8b')});});}})['then'](respondWithResult(_0x127b1f,null))['catch'](handleError(_0x127b1f,null));};exports[_0xc83a('0xac')]=function(_0x2e39e0,_0x14cd13,_0x427613){var _0x30fe62={};var _0x1ac713={};var _0x53d5c9;var _0x26a9ed;return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0x2e39e0[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x14cd13,null))[_0xc83a('0x21')](function(_0x13a30a){if(_0x13a30a){_0x53d5c9=_0x13a30a;_0x1ac713['model']=_[_0xc83a('0x42')](db[_0xc83a('0xaa')][_0xc83a('0x55')]);_0x1ac713[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x2e39e0['query']);_0x1ac713['filters']=_['intersection'](_0x1ac713[_0xc83a('0x41')],_0x1ac713[_0xc83a('0x43')]);_0x30fe62[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0x1ac713[_0xc83a('0x41')],qs[_0xc83a('0x45')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x45')]));_0x30fe62[_0xc83a('0x46')]=_0x30fe62[_0xc83a('0x46')][_0xc83a('0x56')]?_0x30fe62[_0xc83a('0x46')]:_0x1ac713['model'];_0x30fe62[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x48')]);_0x30fe62[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x2e39e0[_0xc83a('0x43')],_0x1ac713[_0xc83a('0x49')]));if(_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x30fe62[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x30fe62['where'],{'$or':_[_0xc83a('0x69')](_0x30fe62['attributes'],function(_0x260ee1){var _0x1ff753={};_0x1ff753[_0x260ee1]={'$like':'%'+_0x2e39e0['query'][_0xc83a('0x4a')]+'%'};return _0x1ff753;})});}_0x30fe62=_[_0xc83a('0x4c')]({},_0x30fe62,_0x2e39e0[_0xc83a('0x51')]);return _0x53d5c9[_0xc83a('0xac')](_0x30fe62);}})[_0xc83a('0x21')](function(_0x4ea468){if(_0x4ea468){_0x26a9ed=_0x4ea468[_0xc83a('0x56')];if(!_0x2e39e0['query']['hasOwnProperty'](_0xc83a('0x47'))){_0x30fe62[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x32')]);_0x30fe62[_0xc83a('0x31')]=qs[_0xc83a('0x31')](_0x2e39e0[_0xc83a('0x43')][_0xc83a('0x31')]);}return _0x53d5c9[_0xc83a('0xac')](_0x30fe62);}})[_0xc83a('0x21')](function(_0x5008bc){if(_0x5008bc){return _0x5008bc?{'count':_0x26a9ed,'rows':_0x5008bc}:null;}})[_0xc83a('0x21')](respondWithResult(_0x14cd13,null))[_0xc83a('0x2c')](handleError(_0x14cd13,null));};exports[_0xc83a('0xad')]=function(_0x1e8be0,_0xd96b89,_0x3286bc){var _0x5cba63={'raw':![],'where':{}};var _0xb76163={};var _0x21fdc3={'count':0x0,'rows':[]};return db[_0xc83a('0x40')][_0xc83a('0x70')]({'where':{'id':_0x1e8be0['params']['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0xd96b89,null))[_0xc83a('0x21')](function(_0x47b48a){if(_0x47b48a){_0xb76163[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x90')][_0xc83a('0x55')]);_0xb76163[_0xc83a('0x43')]=_[_0xc83a('0x42')](_0x1e8be0[_0xc83a('0x43')]);_0xb76163['filters']=_[_0xc83a('0x44')](_0xb76163[_0xc83a('0x41')],_0xb76163['query']);_0x5cba63[_0xc83a('0x46')]=_[_0xc83a('0x44')](_0xb76163[_0xc83a('0x41')],qs['fields'](_0x1e8be0[_0xc83a('0x43')]['fields']));_0x5cba63['attributes']=_0x5cba63[_0xc83a('0x46')][_0xc83a('0x56')]?_0x5cba63['attributes']:_0xb76163[_0xc83a('0x41')];if(!_0x1e8be0['query'][_0xc83a('0x71')](_0xc83a('0x47'))){_0x5cba63[_0xc83a('0x32')]=qs[_0xc83a('0x32')](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x32')]);_0x5cba63['offset']=qs['offset'](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x31')]);}_0x5cba63[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0x1e8be0[_0xc83a('0x43')][_0xc83a('0x48')]);_0x5cba63[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0x1e8be0[_0xc83a('0x43')],_0xb76163[_0xc83a('0x49')]));_0x5cba63[_0xc83a('0x4b')][_0xc83a('0x68')]=_0x47b48a['id'];if(_0x1e8be0['query'][_0xc83a('0x4a')]){_0x5cba63[_0xc83a('0x4b')]=_[_0xc83a('0x4c')](_0x5cba63[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x5cba63[_0xc83a('0x46')],function(_0x47b598){var _0x12a91c={};_0x12a91c[_0x47b598]={'$like':'%'+_0x1e8be0['query']['filter']+'%'};return _0x12a91c;})});}_0x5cba63=_[_0xc83a('0x4c')]({},_0x5cba63,_0x1e8be0['options']);return db[_0xc83a('0x90')]['count']({'where':_0x5cba63[_0xc83a('0x4b')]})['then'](function(_0x534e76){_0x21fdc3[_0xc83a('0x30')]=_0x534e76;if(_0x1e8be0[_0xc83a('0x43')][_0xc83a('0xae')]){_0x5cba63[_0xc83a('0x72')]=[{'model':db[_0xc83a('0x76')],'as':_0xc83a('0xaf'),'required':![]},{'model':db[_0xc83a('0x9f')],'as':'Owner','attributes':[_0xc83a('0x3c'),_0xc83a('0xb0'),_0xc83a('0xb1')],'required':![]},{'model':db['Tag'],'as':_0xc83a('0xb2'),'attributes':['id',_0xc83a('0x3c'),_0xc83a('0xb3')],'where':_0x1e8be0['query'][_0xc83a('0xb4')]?{'id':_0x1e8be0[_0xc83a('0x43')][_0xc83a('0xb4')]}:undefined,'required':_0x1e8be0['query'][_0xc83a('0xb4')]?!![]:![]}];}return db[_0xc83a('0x90')][_0xc83a('0x52')](_0x5cba63);})['then'](function(_0x1245b1){_0x21fdc3[_0xc83a('0x6a')]=_0x1245b1;return _0x21fdc3;});}})['then'](respondWithFilteredResult(_0xd96b89,_0x5cba63))[_0xc83a('0x2c')](handleError(_0xd96b89,null));};exports[_0xc83a('0xb5')]=function(_0x5874d6,_0x2fdda6,_0x5903fc){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x5874d6[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x2fdda6,null))['then'](function(_0x58fb0e){if(_0x58fb0e){return _0x58fb0e[_0xc83a('0xb5')](_0x5874d6[_0xc83a('0x58')][_0xc83a('0x6c')],_[_0xc83a('0xb6')](_0x5874d6['body'],[_0xc83a('0x6c'),'id'])||{})[_0xc83a('0x93')](function(_0x1a63c8){for(var _0x40284e=0x0;_0x40284e<_0x5874d6['body'][_0xc83a('0x6c')][_0xc83a('0x56')];_0x40284e+=0x1){socket[_0xc83a('0xb7')]('userOpenchannelAccount:save',{'UserId':_0x5874d6[_0xc83a('0x58')]['ids'][_0x40284e],'OpenchannelAccountId':_0x5874d6[_0xc83a('0x60')]['id']});}return _0x1a63c8;});}})[_0xc83a('0x21')](respondWithResult(_0x2fdda6,null))[_0xc83a('0x2c')](handleError(_0x2fdda6,null));};exports[_0xc83a('0xb8')]=function(_0x2d5e8e,_0x598540,_0x517700){return db[_0xc83a('0x40')][_0xc83a('0x5b')]({'where':{'id':_0x2d5e8e[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x598540,null))[_0xc83a('0x21')](function(_0x1735b9){if(_0x1735b9){return _0x1735b9[_0xc83a('0xb8')](_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')])[_0xc83a('0x21')](function(){if(_[_0xc83a('0xb9')](_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')])){for(var _0x120594=0x0;_0x120594<_0x2d5e8e[_0xc83a('0x43')]['ids'][_0xc83a('0x56')];_0x120594+=0x1){socket[_0xc83a('0xb7')](_0xc83a('0xba'),{'UserId':Number(_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')][_0x120594]),'OpenchannelAccountId':Number(_0x2d5e8e[_0xc83a('0x60')]['id'])});}}else{socket[_0xc83a('0xb7')](_0xc83a('0xba'),{'UserId':Number(_0x2d5e8e[_0xc83a('0x43')][_0xc83a('0x6c')]),'OpenchannelAccountId':Number(_0x2d5e8e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x598540,null))['catch'](handleError(_0x598540,null));};exports[_0xc83a('0xbb')]=function(_0xbe2876,_0x471adc,_0x4c81fa){var _0x51170e={};var _0x278237={};var _0x5609f6;var _0x355aab;return db['OpenchannelAccount'][_0xc83a('0x70')]({'where':{'id':_0xbe2876[_0xc83a('0x60')]['id']}})[_0xc83a('0x21')](handleEntityNotFound(_0x471adc,null))['then'](function(_0x1419ae){if(_0x1419ae){_0x5609f6=_0x1419ae;_0x278237[_0xc83a('0x41')]=_[_0xc83a('0x42')](db[_0xc83a('0x9f')][_0xc83a('0x55')]);_0x278237[_0xc83a('0x43')]=_['keys'](_0xbe2876[_0xc83a('0x43')]);_0x278237[_0xc83a('0x49')]=_[_0xc83a('0x44')](_0x278237['model'],_0x278237[_0xc83a('0x43')]);_0x51170e[_0xc83a('0x46')]=_['intersection'](_0x278237[_0xc83a('0x41')],qs['fields'](_0xbe2876[_0xc83a('0x43')][_0xc83a('0x45')]));_0x51170e[_0xc83a('0x46')]=_0x51170e[_0xc83a('0x46')]['length']?_0x51170e['attributes']:_0x278237[_0xc83a('0x41')];_0x51170e[_0xc83a('0x66')]=qs[_0xc83a('0x48')](_0xbe2876[_0xc83a('0x43')]['sort']);_0x51170e[_0xc83a('0x4b')]=qs[_0xc83a('0x49')](_[_0xc83a('0x67')](_0xbe2876[_0xc83a('0x43')],_0x278237[_0xc83a('0x49')]));if(_0xbe2876[_0xc83a('0x43')][_0xc83a('0x4a')]){_0x51170e[_0xc83a('0x4b')]=_['merge'](_0x51170e[_0xc83a('0x4b')],{'$or':_[_0xc83a('0x69')](_0x51170e[_0xc83a('0x46')],function(_0x238dec){var _0x5b4bd6={};_0x5b4bd6[_0x238dec]={'$like':'%'+_0xbe2876['query'][_0xc83a('0x4a')]+'%'};return _0x5b4bd6;})});}_0x51170e=_[_0xc83a('0x4c')]({},_0x51170e,_0xbe2876['options']);return _0x5609f6[_0xc83a('0xbb')](_0x51170e);}})[_0xc83a('0x21')](function(_0x25d701){if(_0x25d701){_0x355aab=_0x25d701[_0xc83a('0x56')];if(!_0xbe2876[_0xc83a('0x43')][_0xc83a('0x71')](_0xc83a('0x47'))){_0x51170e[_0xc83a('0x32')]=qs['limit'](_0xbe2876[_0xc83a('0x43')][_0xc83a('0x32')]);_0x51170e[_0xc83a('0x31')]=qs['offset'](_0xbe2876['query']['offset']);}return _0x5609f6[_0xc83a('0xbb')](_0x51170e);}})[_0xc83a('0x21')](function(_0x58b7f0){if(_0x58b7f0){return _0x58b7f0?{'count':_0x355aab,'rows':_0x58b7f0}:null;}})['then'](respondWithResult(_0x471adc,null))['catch'](handleError(_0x471adc,null));};exports[_0xc83a('0x3d')]=function(_0x285095,_0x1a0380,_0x2d1f7d){var _0x6f3cdb,_0x28be87,_0x519137;if(_[_0xc83a('0x7e')](_0x285095[_0xc83a('0x58')]['body'])||_0x285095[_0xc83a('0x58')][_0xc83a('0x58')]===''){throw new db[(_0xc83a('0x77'))][(_0xc83a('0x78'))](_0xc83a('0xbc'));}if(_[_0xc83a('0x7e')](_0x285095[_0xc83a('0x58')]['to'])){}_0x6f3cdb=_0x285095[_0xc83a('0x58')]['to'];return db[_0xc83a('0x40')]['findOne']({'where':{'id':_0x285095[_0xc83a('0x60')]['id']}})['then'](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x28141b){if(_0x28141b){return db['OpenchannelAccount'][_0xc83a('0x5b')]({'where':{'id':_0x28141b['id']},'include':[{'model':db[_0xc83a('0x83')],'as':_0xc83a('0x84'),'include':[{'model':db['CmContact'],'as':_0xc83a('0x85'),'where':{[_0x28141b['mapKey']]:_0x6f3cdb},'limit':0x1,'order':[['updatedAt',_0xc83a('0xbd')]]}]}]})[_0xc83a('0x21')](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x394737){if(_0x394737&&_0x394737[_0xc83a('0x84')]){_0x28be87=_0x394737[_0xc83a('0x38')]({'plain':!![]});if(_0x28be87['List']&&_0x28be87[_0xc83a('0x84')][_0xc83a('0x85')][_0xc83a('0x56')]){return _0x28be87[_0xc83a('0x84')][_0xc83a('0x85')][0x0];}return db['CmContact']['create'](_['defaults'](_0x285095['body'],{'firstName':_0x6f3cdb,[_0x394737['mapKey']]:_0x6f3cdb,'phone':_0x6f3cdb,'ListId':_0x28be87[_0xc83a('0x8d')]}));}})[_0xc83a('0x21')](handleEntityNotFound(_0x1a0380,null))[_0xc83a('0x21')](function(_0x2943d8){if(_0x2943d8){_0x519137=_0x2943d8;return db[_0xc83a('0x90')][_0xc83a('0x5b')]({'where':{'ContactId':_0x519137['id'],'closed':![],'OpenchannelAccountId':_0x28be87['id']}})[_0xc83a('0x21')](function(_0x391494){if(_0x391494){return[_0x391494,![]];}return db['OpenchannelInteraction'][_0xc83a('0x57')]({'UserId':_0x285095['user']['id'],'ContactId':_0x519137['id'],'OpenchannelAccountId':_0x28be87['id'],'lastMsgDirection':_0xc83a('0xbe'),'Messages':[_[_0xc83a('0x4c')](_0x285095['body'],{'read':![],'body':_0x285095[_0xc83a('0x58')]['body'],'OpenchannelAccountId':_0x28be87['id'],'UserId':_0x285095[_0xc83a('0x59')]['id'],'ContactId':_0x519137['id']})]},{'include':[{'model':db[_0xc83a('0xbf')],'as':_0xc83a('0xc0')}]})[_0xc83a('0x21')](function(_0x479be4){return[_0x479be4,!![]];});});}})['spread'](function(_0x12a149,_0x15356b){if(_0x15356b){return _0x12a149;}return db[_0xc83a('0xbf')][_0xc83a('0x57')](_[_0xc83a('0x4c')](_0x285095[_0xc83a('0x58')],{'read':![],'body':_0x285095[_0xc83a('0x58')]['body'],'OpenchannelAccountId':_0x28be87['id'],'OpenchannelInteractionId':_0x12a149['id'],'UserId':_0x285095[_0xc83a('0x59')]['id'],'ContactId':_0x519137['id']}))[_0xc83a('0x21')](function(_0x825495){_0x12a149[_0xc83a('0xc1')][_0xc83a('0xc0')]=[];_0x12a149[_0xc83a('0xc1')][_0xc83a('0xc0')]['push'](_0x825495[_0xc83a('0xc1')]);return _0x12a149;});});}})[_0xc83a('0x21')](respondWithResult(_0x1a0380,null))[_0xc83a('0x2c')](handleError(_0x1a0380,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 811cfa7..cc6309c 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 _0xf9b4=['emit','hook','events','setMaxListeners','save','update','remove'];(function(_0xf1aa01,_0x477960){var _0x2e8946=function(_0x37e388){while(--_0x37e388){_0xf1aa01['push'](_0xf1aa01['shift']());}};_0x2e8946(++_0x477960);}(_0xf9b4,0x64));var _0x4f9b=function(_0x3a1077,_0x3bcd8c){_0x3a1077=_0x3a1077-0x0;var _0x44372d=_0xf9b4[_0x3a1077];return _0x44372d;};'use strict';var EventEmitter=require(_0x4f9b('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4f9b('0x1')](0x0);var events={'afterCreate':_0x4f9b('0x2'),'afterUpdate':_0x4f9b('0x3'),'afterDestroy':_0x4f9b('0x4')};function emitEvent(_0x561d1e){return function(_0x3e68ce,_0x1655ba,_0x3f37cb){OpenchannelAccountEvents[_0x4f9b('0x5')](_0x561d1e+':'+_0x3e68ce['id'],_0x3e68ce);OpenchannelAccountEvents[_0x4f9b('0x5')](_0x561d1e,_0x3e68ce);_0x3f37cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x4f9b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xe148=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','hook','exports','events'];(function(_0x114da6,_0x41b730){var _0x2fa6d9=function(_0x3b85c1){while(--_0x3b85c1){_0x114da6['push'](_0x114da6['shift']());}};_0x2fa6d9(++_0x41b730);}(_0xe148,0x109));var _0x8e14=function(_0x455f19,_0x4f8f3a){_0x455f19=_0x455f19-0x0;var _0x422f21=_0xe148[_0x455f19];return _0x422f21;};'use strict';var EventEmitter=require(_0x8e14('0x0'));var OpenchannelAccount=require(_0x8e14('0x1'))['db'][_0x8e14('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8e14('0x3')](0x0);var events={'afterCreate':_0x8e14('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x122b0c){return function(_0x22e11f,_0x1264d8,_0x16b54a){OpenchannelAccountEvents['emit'](_0x122b0c+':'+_0x22e11f['id'],_0x22e11f);OpenchannelAccountEvents['emit'](_0x122b0c,_0x22e11f);_0x16b54a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x8e14('0x5')](e,emitEvent(event));}}module[_0x8e14('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f4af0a2..ef36c92 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 _0xb0c3=['exports','OpenchannelAccount','lodash','util','bluebird','path','rimraf','./openchannelAccount.attributes'];(function(_0x4aee5e,_0x4025de){var _0x4a900d=function(_0x394766){while(--_0x394766){_0x4aee5e['push'](_0x4aee5e['shift']());}};_0x4a900d(++_0x4025de);}(_0xb0c3,0x9a));var _0x3b0c=function(_0x230443,_0x2d27dc){_0x230443=_0x230443-0x0;var _0x245f39=_0xb0c3[_0x230443];return _0x245f39;};'use strict';var _=require(_0x3b0c('0x0'));var util=require(_0x3b0c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3b0c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b0c('0x3'));var rimraf=require(_0x3b0c('0x4'));var config=require('../../config/environment');var attributes=require(_0x3b0c('0x5'));module[_0x3b0c('0x6')]=function(_0x48b241,_0x14bb3e){return _0x48b241['define'](_0x3b0c('0x7'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcce9=['./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x28e4f1,_0x4b3b80){var _0x56f544=function(_0x2f8c15){while(--_0x2f8c15){_0x28e4f1['push'](_0x28e4f1['shift']());}};_0x56f544(++_0x4b3b80);}(_0xcce9,0xd4));var _0x9cce=function(_0x2aacff,_0x29cac9){_0x2aacff=_0x2aacff-0x0;var _0x5b474a=_0xcce9[_0x2aacff];return _0x5b474a;};'use strict';var _=require(_0x9cce('0x0'));var util=require(_0x9cce('0x1'));var logger=require(_0x9cce('0x2'))(_0x9cce('0x3'));var moment=require(_0x9cce('0x4'));var BPromise=require(_0x9cce('0x5'));var rp=require(_0x9cce('0x6'));var fs=require('fs');var path=require(_0x9cce('0x7'));var rimraf=require('rimraf');var config=require(_0x9cce('0x8'));var attributes=require(_0x9cce('0x9'));module[_0x9cce('0xa')]=function(_0x52a521,_0x737449){return _0x52a521[_0x9cce('0xb')](_0x9cce('0xc'),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 d8ab362..ed8f0bb 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0xe80a60,_0x482e2b){var _0x2cca08=function(_0x31c4da){while(--_0x31c4da){_0xe80a60['push'](_0xe80a60['shift']());}};_0x2cca08(++_0x482e2b);}(_0xe14b,0x93));var _0xbe14=function(_0x12cac1,_0x3b514c){_0x12cac1=_0x12cac1-0x0;var _0xa55f9f=_0xe14b[_0x12cac1];return _0xa55f9f;};'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});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file +var _0x326f=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x15b580,_0x343baf){var _0x47cd5e=function(_0x51993a){while(--_0x51993a){_0x15b580['push'](_0x15b580['shift']());}};_0x47cd5e(++_0x343baf);}(_0x326f,0xd1));var _0xf326=function(_0x28fbfc,_0x423782){_0x28fbfc=_0x28fbfc-0x0;var _0x4feca4=_0x326f[_0x28fbfc];return _0x4feca4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});config[_0xf326('0xb')]=_[_0xf326('0xc')](config[_0xf326('0xb')],{'host':_0xf326('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf326('0xe')](socket);function respondWithRpcPromise(_0x1fc80e,_0x163416,_0x2686e1){return new BPromise(function(_0x1f3a33,_0x5db9d7){return client[_0xf326('0xf')](_0x1fc80e,_0x2686e1)['then'](function(_0x1cf441){logger['info'](_0xf326('0x10'),_0x163416,'request\x20sent');logger[_0xf326('0x11')](_0xf326('0x12'),_0x163416,'request\x20sent',JSON[_0xf326('0x13')](_0x1cf441));if(_0x1cf441[_0xf326('0x14')]){if(_0x1cf441[_0xf326('0x14')][_0xf326('0x15')]===0x1f4){logger['error'](_0xf326('0x10'),_0x163416,_0x1cf441['error']['message']);return _0x5db9d7(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}logger[_0xf326('0x14')](_0xf326('0x10'),_0x163416,_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);return _0x1f3a33(_0x1cf441[_0xf326('0x14')][_0xf326('0x16')]);}else{logger['info'](_0xf326('0x10'),_0x163416,_0xf326('0x17'));_0x1f3a33(_0x1cf441[_0xf326('0x18')][_0xf326('0x16')]);}})[_0xf326('0x19')](function(_0x311af0){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x163416,_0x311af0);_0x5db9d7(_0x311af0);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 7d071b2..214082f 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 _0xa47a=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x910521,_0x23719d){var _0x3734a9=function(_0x32bcbb){while(--_0x32bcbb){_0x910521['push'](_0x910521['shift']());}};_0x3734a9(++_0x23719d);}(_0xa47a,0x75));var _0xaa47=function(_0x52b01a,_0x203c72){_0x52b01a=_0x52b01a-0x0;var _0x3b24de=_0xa47a[_0x52b01a];return _0x3b24de;};'use strict';var OpenchannelAccountEvents=require(_0xaa47('0x0'));var events=[_0xaa47('0x1'),_0xaa47('0x2'),_0xaa47('0x3')];function createListener(_0x5e35b6,_0x24274f){return function(_0x162849){_0x24274f[_0xaa47('0x4')](_0x5e35b6,_0x162849);};}function removeListener(_0x53041a,_0x53c9af){return function(){OpenchannelAccountEvents[_0xaa47('0x5')](_0x53041a,_0x53c9af);};}exports[_0xaa47('0x6')]=function(_0x2a70a3){for(var _0x42520d=0x0,_0x561f01=events[_0xaa47('0x7')];_0x42520d<_0x561f01;_0x42520d++){var _0x37f905=events[_0x42520d];var _0x1e309d=createListener(_0xaa47('0x8')+_0x37f905,_0x2a70a3);OpenchannelAccountEvents['on'](_0x37f905,_0x1e309d);}}; \ No newline at end of file +var _0x2a19=['register','openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x1dd46b,_0x4021b7){var _0x545d3a=function(_0x12dd81){while(--_0x12dd81){_0x1dd46b['push'](_0x1dd46b['shift']());}};_0x545d3a(++_0x4021b7);}(_0x2a19,0x1ec));var _0x92a1=function(_0x2c18c2,_0x1edbf1){_0x2c18c2=_0x2c18c2-0x0;var _0x24580e=_0x2a19[_0x2c18c2];return _0x24580e;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x92a1('0x0'),_0x92a1('0x1'),_0x92a1('0x2')];function createListener(_0x3653cb,_0x3c7eb5){return function(_0x3e526f){_0x3c7eb5[_0x92a1('0x3')](_0x3653cb,_0x3e526f);};}function removeListener(_0x52b6f9,_0x51db20){return function(){OpenchannelAccountEvents[_0x92a1('0x4')](_0x52b6f9,_0x51db20);};}exports[_0x92a1('0x5')]=function(_0x1b5462){for(var _0x11a704=0x0,_0x3fc436=events['length'];_0x11a704<_0x3fc436;_0x11a704++){var _0x2d069a=events[_0x11a704];var _0x37c304=createListener(_0x92a1('0x6')+_0x2d069a,_0x1b5462);OpenchannelAccountEvents['on'](_0x2d069a,_0x37c304);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index a6bee0b..a7f6420 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 _0xe7a0=['exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','update','destroy'];(function(_0x36b706,_0xb292c5){var _0x289b63=function(_0x5308b7){while(--_0x5308b7){_0x36b706['push'](_0x36b706['shift']());}};_0x289b63(++_0xb292c5);}(_0xe7a0,0x17b));var _0x0e7a=function(_0x2c45ab,_0x561f98){_0x2c45ab=_0x2c45ab-0x0;var _0x3ae668=_0xe7a0[_0x2c45ab];return _0x3ae668;};'use strict';var multer=require(_0x0e7a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0e7a('0x1'));var express=require('express');var router=express[_0x0e7a('0x2')]();var auth=require(_0x0e7a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0e7a('0x4'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x0e7a('0x5')](),controller[_0x0e7a('0x6')]);router[_0x0e7a('0x7')](_0x0e7a('0x8'),auth[_0x0e7a('0x5')](),controller['show']);router[_0x0e7a('0x9')]('/',auth[_0x0e7a('0x5')](),controller[_0x0e7a('0xa')]);router['put'](_0x0e7a('0x8'),auth[_0x0e7a('0x5')](),controller[_0x0e7a('0xb')]);router['delete'](_0x0e7a('0x8'),auth['isAuthenticated'](),controller[_0x0e7a('0xc')]);module[_0x0e7a('0xd')]=router; \ No newline at end of file +var _0x1645=['update','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1645,0x141));var _0x5164=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1645[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5164('0x0'));var util=require('util');var path=require(_0x5164('0x1'));var timeout=require('connect-timeout');var express=require(_0x5164('0x2'));var router=express[_0x5164('0x3')]();var auth=require(_0x5164('0x4'));var interaction=require(_0x5164('0x5'));var config=require(_0x5164('0x6'));var controller=require(_0x5164('0x7'));router[_0x5164('0x8')]('/',auth[_0x5164('0x9')](),controller[_0x5164('0xa')]);router['get'](_0x5164('0xb'),auth[_0x5164('0x9')](),controller['show']);router[_0x5164('0xc')]('/',auth[_0x5164('0x9')](),controller[_0x5164('0xd')]);router[_0x5164('0xe')](_0x5164('0xb'),auth[_0x5164('0x9')](),controller[_0x5164('0xf')]);router['delete'](_0x5164('0xb'),auth[_0x5164('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 824e614..0255a3a 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 _0x4b20=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3cb667,_0x2eb960){var _0x59f23d=function(_0x29875d){while(--_0x29875d){_0x3cb667['push'](_0x3cb667['shift']());}};_0x59f23d(++_0x2eb960);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x04b2('0x0'));module[_0x04b2('0x1')]={'priority':{'type':Sequelize[_0x04b2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x04b2('0x3')],'allowNull':![],'defaultValue':_0x04b2('0x4')},'appdata':{'type':Sequelize[_0x04b2('0x5')]()},'description':{'type':Sequelize[_0x04b2('0x3')]},'interval':{'type':Sequelize[_0x04b2('0x3')],'defaultValue':_0x04b2('0x6')}}; \ No newline at end of file +var _0xf5c0=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x1c3ecd,_0x14932c){var _0xdfe805=function(_0x160421){while(--_0x160421){_0x1c3ecd['push'](_0x1c3ecd['shift']());}};_0xdfe805(++_0x14932c);}(_0xf5c0,0x9d));var _0x0f5c=function(_0x4ffa03,_0x363a82){_0x4ffa03=_0x4ffa03-0x0;var _0x30d661=_0xf5c0[_0x4ffa03];return _0x30d661;};'use strict';var Sequelize=require(_0x0f5c('0x0'));module[_0x0f5c('0x1')]={'priority':{'type':Sequelize[_0x0f5c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0f5c('0x3')],'allowNull':![],'defaultValue':_0x0f5c('0x4')},'appdata':{'type':Sequelize[_0x0f5c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0f5c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0a2ec35..cff16d0 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x4f6cbc,_0x2b754d){var _0x388649=function(_0x3f09ba){while(--_0x3f09ba){_0x4f6cbc['push'](_0x4f6cbc['shift']());}};_0x388649(++_0x2b754d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x1fe322,_0x4cd748){var _0x2908f0=function(_0x4d3621){while(--_0x4d3621){_0x1fe322['push'](_0x1fe322['shift']());}};_0x2908f0(++_0x4cd748);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index af75eb8..793e16f 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 _0xdd86=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xdd86,0x15d));var _0x6dd8=function(_0x21b5ad,_0x2d7eb4){_0x21b5ad=_0x21b5ad-0x0;var _0x4c1f6=_0xdd86[_0x21b5ad];return _0x4c1f6;};'use strict';var _=require(_0x6dd8('0x0'));var util=require(_0x6dd8('0x1'));var logger=require(_0x6dd8('0x2'))('api');var moment=require(_0x6dd8('0x3'));var BPromise=require(_0x6dd8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dd8('0x5'));var rimraf=require(_0x6dd8('0x6'));var config=require(_0x6dd8('0x7'));var attributes=require(_0x6dd8('0x8'));module[_0x6dd8('0x9')]=function(_0x52a55d,_0xde9f0e){return _0x52a55d[_0x6dd8('0xa')](_0x6dd8('0xb'),attributes,{'tableName':_0x6dd8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6dd8('0xd'),'collate':_0x6dd8('0xe')});}; \ No newline at end of file +var _0x4b48=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x313009,_0x95d7aa){var _0x45de67=function(_0x222d84){while(--_0x222d84){_0x313009['push'](_0x313009['shift']());}};_0x45de67(++_0x95d7aa);}(_0x4b48,0x190));var _0x84b4=function(_0x3cd957,_0x46dd8d){_0x3cd957=_0x3cd957-0x0;var _0x21801b=_0x4b48[_0x3cd957];return _0x21801b;};'use strict';var _=require(_0x84b4('0x0'));var util=require(_0x84b4('0x1'));var logger=require(_0x84b4('0x2'))(_0x84b4('0x3'));var moment=require(_0x84b4('0x4'));var BPromise=require(_0x84b4('0x5'));var rp=require(_0x84b4('0x6'));var fs=require('fs');var path=require(_0x84b4('0x7'));var rimraf=require(_0x84b4('0x8'));var config=require(_0x84b4('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0x84b4('0xa')]=function(_0x39c5d5,_0x1ae2b3){return _0x39c5d5[_0x84b4('0xb')](_0x84b4('0xc'),attributes,{'tableName':_0x84b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index bb796b4..5b77d25 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 _0x7831=['body','options','raw','attributes','limit','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelApplication,\x20%s,\x20%s','result','UpdateOpenchannelApplication','OpenchannelApplication','update'];(function(_0x5f03e6,_0x4bd4a8){var _0x195656=function(_0x475e54){while(--_0x475e54){_0x5f03e6['push'](_0x5f03e6['shift']());}};_0x195656(++_0x4bd4a8);}(_0x7831,0x1ba));var _0x1783=function(_0x4e3956,_0x25f786){_0x4e3956=_0x4e3956-0x0;var _0x66b1cb=_0x7831[_0x4e3956];return _0x66b1cb;};'use strict';var _=require(_0x1783('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1783('0x1'));var rs=require(_0x1783('0x2'));var fs=require('fs');var Redis=require(_0x1783('0x3'));var db=require(_0x1783('0x4'))['db'];var utils=require(_0x1783('0x5'));var logger=require(_0x1783('0x6'))('rpc');var config=require(_0x1783('0x7'));var jayson=require(_0x1783('0x8'));var client=jayson[_0x1783('0x9')][_0x1783('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be863,_0xa22ce8,_0x58e5a7){return new BPromise(function(_0x150dbc,_0x91996d){return client['request'](_0x1be863,_0x58e5a7)['then'](function(_0x1eb8fe){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0xa22ce8,_0x1783('0xb'));logger[_0x1783('0xc')](_0x1783('0xd'),_0xa22ce8,_0x1783('0xb'),JSON[_0x1783('0xe')](_0x1eb8fe));if(_0x1eb8fe[_0x1783('0xf')]){if(_0x1eb8fe[_0x1783('0xf')]['code']===0x1f4){logger[_0x1783('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0xa22ce8,_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);return _0x91996d(_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);}logger[_0x1783('0xf')](_0x1783('0x11'),_0xa22ce8,_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);return _0x150dbc(_0x1eb8fe[_0x1783('0xf')]['message']);}else{logger['info'](_0x1783('0x11'),_0xa22ce8,_0x1783('0xb'));_0x150dbc(_0x1eb8fe[_0x1783('0x12')][_0x1783('0x10')]);}})['catch'](function(_0x554062){logger[_0x1783('0xf')](_0x1783('0x11'),_0xa22ce8,_0x554062);_0x91996d(_0x554062);});});}exports[_0x1783('0x13')]=function(_0x47085f){var _0x4fe34a=this;return new Promise(function(_0x5cfb4b,_0x124a08){return db[_0x1783('0x14')][_0x1783('0x15')](_0x47085f[_0x1783('0x16')],{'raw':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')][_0x1783('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')]['where']||null:null,'attributes':_0x47085f['options']?_0x47085f['options'][_0x1783('0x19')]||null:null,'limit':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')][_0x1783('0x1a')]||null:null})['then'](function(_0x285d34){logger[_0x1783('0x1b')](_0x1783('0x13'),_0x47085f);logger[_0x1783('0xc')](_0x1783('0x13'),_0x47085f,JSON[_0x1783('0xe')](_0x285d34));_0x5cfb4b(_0x285d34);})[_0x1783('0x1c')](function(_0x553891){logger['error'](_0x1783('0x13'),_0x553891[_0x1783('0x10')],_0x47085f);_0x124a08(_0x4fe34a[_0x1783('0xf')](0x1f4,_0x553891['message']));});});}; \ No newline at end of file +var _0xa76a=['error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x126867,_0x1f8092){var _0x586c0c=function(_0x12af44){while(--_0x12af44){_0x126867['push'](_0x126867['shift']());}};_0x586c0c(++_0x1f8092);}(_0xa76a,0xad));var _0xaa76=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xa76a[_0x3d4876];return _0x58ca9d;};'use strict';var _=require('lodash');var util=require(_0xaa76('0x0'));var moment=require(_0xaa76('0x1'));var BPromise=require(_0xaa76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa76('0x3'));var db=require(_0xaa76('0x4'))['db'];var utils=require(_0xaa76('0x5'));var logger=require(_0xaa76('0x6'))(_0xaa76('0x7'));var config=require(_0xaa76('0x8'));var jayson=require(_0xaa76('0x9'));var client=jayson[_0xaa76('0xa')][_0xaa76('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b869a,_0x5e1f71,_0x3f8790){return new BPromise(function(_0x3a8c79,_0x3717ba){return client[_0xaa76('0xc')](_0x3b869a,_0x3f8790)[_0xaa76('0xd')](function(_0x53201b){logger[_0xaa76('0xe')](_0xaa76('0xf'),_0x5e1f71,_0xaa76('0x10'));logger[_0xaa76('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5e1f71,_0xaa76('0x10'),JSON[_0xaa76('0x12')](_0x53201b));if(_0x53201b[_0xaa76('0x13')]){if(_0x53201b[_0xaa76('0x13')][_0xaa76('0x14')]===0x1f4){logger[_0xaa76('0x13')](_0xaa76('0xf'),_0x5e1f71,_0x53201b[_0xaa76('0x13')][_0xaa76('0x15')]);return _0x3717ba(_0x53201b[_0xaa76('0x13')][_0xaa76('0x15')]);}logger[_0xaa76('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x5e1f71,_0x53201b[_0xaa76('0x13')]['message']);return _0x3a8c79(_0x53201b['error'][_0xaa76('0x15')]);}else{logger[_0xaa76('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x5e1f71,'request\x20sent');_0x3a8c79(_0x53201b[_0xaa76('0x16')][_0xaa76('0x15')]);}})['catch'](function(_0x521a8d){logger[_0xaa76('0x13')](_0xaa76('0xf'),_0x5e1f71,_0x521a8d);_0x3717ba(_0x521a8d);});});}exports[_0xaa76('0x17')]=function(_0x1c48c9){var _0x6837c7=this;return new Promise(function(_0x3f8f0e,_0x53f086){return db[_0xaa76('0x18')][_0xaa76('0x19')](_0x1c48c9[_0xaa76('0x1a')],{'raw':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9[_0xaa76('0x1b')][_0xaa76('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9['options'][_0xaa76('0x1d')]||null:null,'attributes':_0x1c48c9['options']?_0x1c48c9[_0xaa76('0x1b')]['attributes']||null:null,'limit':_0x1c48c9[_0xaa76('0x1b')]?_0x1c48c9['options'][_0xaa76('0x1e')]||null:null})['then'](function(_0x291c18){logger[_0xaa76('0xe')](_0xaa76('0x17'),_0x1c48c9);logger[_0xaa76('0x11')](_0xaa76('0x17'),_0x1c48c9,JSON[_0xaa76('0x12')](_0x291c18));_0x3f8f0e(_0x291c18);})[_0xaa76('0x1f')](function(_0x543a84){logger[_0xaa76('0x13')](_0xaa76('0x17'),_0x543a84[_0xaa76('0x15')],_0x1c48c9);_0x53f086(_0x6837c7[_0xaa76('0x13')](0x1f4,_0x543a84[_0xaa76('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 1900e21..2b75131 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 _0x5840=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout','express'];(function(_0x58e57c,_0x2a61c2){var _0x546654=function(_0x429cb1){while(--_0x429cb1){_0x58e57c['push'](_0x58e57c['shift']());}};_0x546654(++_0x2a61c2);}(_0x5840,0x13c));var _0x0584=function(_0x5a5c11,_0x358f6b){_0x5a5c11=_0x5a5c11-0x0;var _0x5d6ba7=_0x5840[_0x5a5c11];return _0x5d6ba7;};'use strict';var multer=require(_0x0584('0x0'));var util=require('util');var path=require(_0x0584('0x1'));var timeout=require(_0x0584('0x2'));var express=require(_0x0584('0x3'));var router=express[_0x0584('0x4')]();var auth=require(_0x0584('0x5'));var interaction=require(_0x0584('0x6'));var config=require(_0x0584('0x7'));var controller=require(_0x0584('0x8'));router[_0x0584('0x9')]('/',auth[_0x0584('0xa')](),controller[_0x0584('0xb')]);router[_0x0584('0x9')](_0x0584('0xc'),auth['isAuthenticated'](),controller[_0x0584('0xd')]);router[_0x0584('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0584('0xe')]);router[_0x0584('0x9')](_0x0584('0xf'),auth[_0x0584('0xa')](),controller[_0x0584('0x10')]);router['get']('/:id/download',auth[_0x0584('0xa')](),controller[_0x0584('0x11')]);router[_0x0584('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0584('0x12')](_0x0584('0xf'),auth['isAuthenticated'](),controller[_0x0584('0x13')]);router[_0x0584('0x12')](_0x0584('0x14'),auth['isAuthenticated'](),interaction[_0x0584('0x15')](_0x0584('0x16'),_0x0584('0x17')),controller[_0x0584('0x18')]);router['put'](_0x0584('0x19'),auth[_0x0584('0xa')](),interaction[_0x0584('0x15')]('openchannel',_0x0584('0x1a')),controller[_0x0584('0x1b')]);router[_0x0584('0x1c')](_0x0584('0x19'),auth['isAuthenticated'](),interaction[_0x0584('0x15')](_0x0584('0x16'),_0x0584('0x1d')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x0584('0x1e')]);module[_0x0584('0x1f')]=router; \ No newline at end of file +var _0x5f10=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','removeTags','exports','multer','util','connect-timeout','express','Router'];(function(_0x5dd469,_0x2a66c4){var _0x59f4b4=function(_0x5a47fa){while(--_0x5a47fa){_0x5dd469['push'](_0x5dd469['shift']());}};_0x59f4b4(++_0x2a66c4);}(_0x5f10,0x1db));var _0x05f1=function(_0x20a761,_0x2ffd85){_0x20a761=_0x20a761-0x0;var _0x284a38=_0x5f10[_0x20a761];return _0x284a38;};'use strict';var multer=require(_0x05f1('0x0'));var util=require(_0x05f1('0x1'));var path=require('path');var timeout=require(_0x05f1('0x2'));var express=require(_0x05f1('0x3'));var router=express[_0x05f1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x05f1('0x5'));var config=require(_0x05f1('0x6'));var controller=require(_0x05f1('0x7'));router['get']('/',auth[_0x05f1('0x8')](),controller[_0x05f1('0x9')]);router['get'](_0x05f1('0xa'),auth[_0x05f1('0x8')](),controller[_0x05f1('0xb')]);router['get'](_0x05f1('0xc'),auth[_0x05f1('0x8')](),controller[_0x05f1('0xd')]);router[_0x05f1('0xe')](_0x05f1('0xf'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x10')]);router[_0x05f1('0xe')](_0x05f1('0x11'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x12')]);router[_0x05f1('0x13')]('/',auth[_0x05f1('0x8')](),controller[_0x05f1('0x14')]);router[_0x05f1('0x13')](_0x05f1('0xf'),auth[_0x05f1('0x8')](),controller['addMessage']);router['post'](_0x05f1('0x15'),auth['isAuthenticated'](),interaction[_0x05f1('0x16')](_0x05f1('0x17'),_0x05f1('0x18')),controller[_0x05f1('0x19')]);router[_0x05f1('0x1a')](_0x05f1('0xc'),auth[_0x05f1('0x8')](),interaction[_0x05f1('0x16')](_0x05f1('0x17'),_0x05f1('0x1b')),controller[_0x05f1('0x1c')]);router[_0x05f1('0x1d')](_0x05f1('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:destroy'),controller['destroy']);router[_0x05f1('0x1d')](_0x05f1('0x15'),auth[_0x05f1('0x8')](),controller[_0x05f1('0x1e')]);module[_0x05f1('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6c13724..3296f24 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 _0x004c=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x004c,0x85));var _0xc004=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x004c[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0xc004('0x0'));module[_0xc004('0x1')]={'closed':{'type':Sequelize[_0xc004('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc004('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc004('0x4')]},'read1stAt':{'type':Sequelize[_0xc004('0x3')]},'threadId':{'type':Sequelize[_0xc004('0x4')]},'externalUrl':{'type':Sequelize[_0xc004('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc004('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc004('0x4')]}}; \ No newline at end of file +var _0x66d9=['exports','BOOLEAN','DATE','STRING','sequelize'];(function(_0x2d17b0,_0x773ed4){var _0x3af5be=function(_0x3b7704){while(--_0x3b7704){_0x2d17b0['push'](_0x2d17b0['shift']());}};_0x3af5be(++_0x773ed4);}(_0x66d9,0x1e9));var _0x966d=function(_0x2c120d,_0x283db8){_0x2c120d=_0x2c120d-0x0;var _0x354271=_0x66d9[_0x2c120d];return _0x354271;};'use strict';var Sequelize=require(_0x966d('0x0'));module[_0x966d('0x1')]={'closed':{'type':Sequelize[_0x966d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x966d('0x3')]},'disposition':{'type':Sequelize[_0x966d('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x966d('0x4')]},'externalUrl':{'type':Sequelize[_0x966d('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x966d('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 4f4a455..e1dac72 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 _0xfbde=['c.lastName','c.email','\x20>\x20?','\x20<\x20?','Messages.count','map','hasOwnProperty','filter','isNil','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','COUNT(*)','%s\x20=\x200','having','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','%s\x20>\x200','sequelize','keyBy','merge','a.key','i.*','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','openchannel_interaction_has_tags','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','Users','Tags','TagIds','rows','catch','params','includeAll','include','options','create','body','find','describe','addMessage','omit','getMessages','findOne','OpenchannelMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','spread','emit','removeTags','download','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','CmContact','Contact','firstName','lastName','Attachment','Owner','fullname','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','Account','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','pipe','System','out','views','downloadInteraction.html','toFile','.pdf','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','ui.OpenchannelInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','user_has_openchannel_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','parse','advancedFilter','forEach','createdAt','value','dateStart','startOf','utc','format','day','and','condition','TagId','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?'];(function(_0x1a9ee9,_0x26d166){var _0x2b618a=function(_0x4a3003){while(--_0x4a3003){_0x1a9ee9['push'](_0x1a9ee9['shift']());}};_0x2b618a(++_0x26d166);}(_0xfbde,0x15d));var _0xefbd=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xfbde[_0x62c958];return _0x57ec61;};'use strict';var pdf=require(_0xefbd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefbd('0x1'));var zipdir=require(_0xefbd('0x2'));var jsonpatch=require(_0xefbd('0x3'));var rp=require(_0xefbd('0x4'));var moment=require(_0xefbd('0x5'));var BPromise=require(_0xefbd('0x6'));var Mustache=require(_0xefbd('0x7'));var util=require(_0xefbd('0x8'));var path=require('path');var sox=require(_0xefbd('0x9'));var csv=require('to-csv');var ejs=require(_0xefbd('0xa'));var fs=require('fs');var _=require(_0xefbd('0xb'));var squel=require(_0xefbd('0xc'));var crypto=require(_0xefbd('0xd'));var jsforce=require(_0xefbd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xefbd('0xf'));var querystring=require(_0xefbd('0x10'));var Papa=require(_0xefbd('0x11'));var Redis=require(_0xefbd('0x12'));var authService=require(_0xefbd('0x13'));var qs=require(_0xefbd('0x14'));var hardwareService=require(_0xefbd('0x15'));var logger=require(_0xefbd('0x16'))(_0xefbd('0x17'));var utils=require('../../config/utils');var config=require(_0xefbd('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xefbd('0x19')](config[_0xefbd('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xefbd('0x1b'))(new Redis(config[_0xefbd('0x1a')]));require(_0xefbd('0x1c'))[_0xefbd('0x1d')](socket);function respondWithStatusCode(_0x25a718,_0x3cabd8){_0x3cabd8=_0x3cabd8||0xcc;return function(_0x596c53){if(_0x596c53){return _0x25a718[_0xefbd('0x1e')](_0x3cabd8);}return _0x25a718[_0xefbd('0x1f')](_0x3cabd8)[_0xefbd('0x20')]();};}function respondWithResult(_0x42d3ab,_0x3a1871){_0x3a1871=_0x3a1871||0xc8;return function(_0x2ce3c8){if(_0x2ce3c8){return _0x42d3ab['status'](_0x3a1871)[_0xefbd('0x21')](_0x2ce3c8);}};}function respondWithFilteredResult(_0x47fcb8,_0x9b283){return function(_0x193a5d){if(_0x193a5d){var _0x4caeba=_0x193a5d[_0xefbd('0x22')],_0x4f9e6d=_0x9b283['offset'],_0x52df4d=_0x9b283[_0xefbd('0x23')]+_0x9b283[_0xefbd('0x24')],_0x68b831;if(_0x52df4d>=_0x4caeba){_0x52df4d=_0x4caeba;_0x68b831=0xc8;}else{_0x68b831=0xce;}_0x47fcb8['status'](_0x68b831);return _0x47fcb8[_0xefbd('0x25')](_0xefbd('0x26'),_0x4f9e6d+'-'+_0x52df4d+'/'+_0x4caeba)[_0xefbd('0x21')](_0x193a5d);}return null;};}function patchUpdates(_0x280867){return function(_0x35cda3){try{jsonpatch[_0xefbd('0x27')](_0x35cda3,_0x280867,!![]);}catch(_0x5e2f02){return BPromise[_0xefbd('0x28')](_0x5e2f02);}return _0x35cda3[_0xefbd('0x29')]();};}function saveUpdates(_0x2b0cea,_0x958544){return function(_0x4b2073){if(_0x4b2073){return _0x4b2073[_0xefbd('0x2a')](_0x2b0cea)[_0xefbd('0x2b')](function(_0x5cabf8){return _0x5cabf8;});}return null;};}function removeEntity(_0x22b5ce,_0x418056){return function(_0x440986){if(_0x440986){return _0x440986[_0xefbd('0x2c')]()[_0xefbd('0x2b')](function(){_0x22b5ce[_0xefbd('0x1f')](0xcc)[_0xefbd('0x20')]();});}};}function handleEntityNotFound(_0x2c061a,_0x43923f){return function(_0x4d73d7){if(!_0x4d73d7){_0x2c061a[_0xefbd('0x1e')](0x194);}return _0x4d73d7;};}function handleError(_0x59751c,_0x57dc38){_0x57dc38=_0x57dc38||0x1f4;return function(_0x278ab9){logger[_0xefbd('0x2d')](_0x278ab9[_0xefbd('0x2e')]);if(_0x278ab9[_0xefbd('0x2f')]){delete _0x278ab9[_0xefbd('0x2f')];}_0x59751c[_0xefbd('0x1f')](_0x57dc38)['send'](_0x278ab9);};}exports[_0xefbd('0x30')]=function(_0x19c485,_0x48e20a){var _0x45fb25={},_0x12a5d6={},_0x58c0ac={'count':0x0,'rows':[]};var _0x5c308c=db[_0xefbd('0x31')][_0xefbd('0x32')];_0x12a5d6[_0xefbd('0x33')]=_[_0xefbd('0x34')](_0x5c308c);_0x12a5d6[_0xefbd('0x35')]=_['keys'](_0x19c485[_0xefbd('0x35')]);_0x12a5d6[_0xefbd('0x36')]=_[_0xefbd('0x37')](_0x12a5d6['model'],_0x12a5d6[_0xefbd('0x35')]);_0x45fb25[_0xefbd('0x38')]=_['intersection'](_0x12a5d6[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x19c485[_0xefbd('0x35')]['fields']));_0x45fb25[_0xefbd('0x38')]=_0x45fb25[_0xefbd('0x38')][_0xefbd('0x3a')]?_0x45fb25[_0xefbd('0x38')]:_0x12a5d6[_0xefbd('0x33')];if(!_0x19c485[_0xefbd('0x35')]['hasOwnProperty'](_0xefbd('0x3b'))){_0x45fb25[_0xefbd('0x24')]=qs[_0xefbd('0x24')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x24')]);_0x45fb25[_0xefbd('0x23')]=qs[_0xefbd('0x23')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x23')]);}_0x45fb25[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x3d')]);_0x45fb25[_0xefbd('0x3e')]=qs[_0xefbd('0x36')](_[_0xefbd('0x3f')](_0x19c485[_0xefbd('0x35')],_0x12a5d6[_0xefbd('0x36')]));var _0x1b77e6=[];var _0x19ddb7=squel[_0xefbd('0x40')]()['field']('id')[_0xefbd('0x41')](_0xefbd('0x2f'))['field'](_0xefbd('0x42'))['from'](_0xefbd('0x43'));var _0x24ce10=squel[_0xefbd('0x40')]()['field']('COUNT(*)')['from'](_0xefbd('0x44'),'me')[_0xefbd('0x3e')](_0xefbd('0x45'))['where'](_0xefbd('0x46'))[_0xefbd('0x3e')]('me.read\x20=\x20false');var _0x532c0a=squel[_0xefbd('0x40')]()[_0xefbd('0x41')]('u.id')['field'](_0xefbd('0x47'))[_0xefbd('0x48')]('user_has_openchannel_interactions','ui')[_0xefbd('0x49')](_0xefbd('0x4a'),'u',_0xefbd('0x4b'));var _0x18626b=squel[_0xefbd('0x40')]()[_0xefbd('0x48')](_0xefbd('0x4c'),'i')[_0xefbd('0x49')](_0xefbd('0x4d'),'ui',_0xefbd('0x4e'))[_0xefbd('0x49')](_0xefbd('0x4a'),'u',_0xefbd('0x4b'))['left_join'](_0xefbd('0x4f'),'c',_0xefbd('0x50'))['left_join'](_0xefbd('0x4a'),'o',_0xefbd('0x51'))[_0xefbd('0x49')](_0xefbd('0x52'),'a',_0xefbd('0x53'))[_0xefbd('0x49')]('openchannel_messages','me',_0xefbd('0x45'));var _0x4b14c3=squel[_0xefbd('0x54')]();if(_0x19c485['query']['advancedFilter']){var _0x2f59e5=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x56')]);_[_0xefbd('0x34')](_0x2f59e5)[_0xefbd('0x57')](function(_0x390a39){var _0x3cc1c0=_0x2f59e5[_0x390a39];if(_0x390a39===_0xefbd('0x58')){var _0x4c8175=moment(_0x3cc1c0[_0xefbd('0x59')][_0xefbd('0x5a')])[_0xefbd('0x5b')]('day')[_0xefbd('0x5c')]()[_0xefbd('0x5d')]();var _0x2baa47=moment(_0x2baa47)[_0xefbd('0x5c')]()['endOf'](_0xefbd('0x5e'))['format']();_0x4b14c3[_0xefbd('0x5f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c8175,_0x2baa47);}else{if(_['isArray'](_0x3cc1c0['condition'])){_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x57')](function(_0x21e0d3){switch(_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x59')]){case'IS':if(_0x390a39!==_0xefbd('0x61')&&_0x390a39!=='Messages.count'){if(_[_0xefbd('0x62')](_0x3cc1c0[_0xefbd('0x59')])&&_0x3cc1c0[_0xefbd('0x59')][_0xefbd('0x3a')]>0x1){_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x64'),_0x3cc1c0[_0xefbd('0x59')]);}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0['value'][0x0]);}}break;case'=':_0x4b14c3['and'](_0x3cc1c0['tableAlias']+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0[_0xefbd('0x59')]);break;case'LIKE':if(_0x390a39===_0xefbd('0x66')){_0x4b14c3[_0xefbd('0x5f')](_0xefbd('0x67')+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x69')+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x6a')+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0['tableAlias']+'.'+_0x390a39+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}break;case'>':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x6b'),_0x3cc1c0[_0xefbd('0x59')]);break;case'<':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x6c'),_0x3cc1c0[_0xefbd('0x59')]);break;}});}else{switch(_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x59')]){case'IS':if(_0x390a39!==_0xefbd('0x61')&&_0x390a39!==_0xefbd('0x6d')){if(_[_0xefbd('0x62')](_0x3cc1c0[_0xefbd('0x59')])&&_0x3cc1c0[_0xefbd('0x59')]['length']>0x1){_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+'\x20IN\x20?',_0x3cc1c0[_0xefbd('0x59')]);}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0[_0xefbd('0x59')][0x0]);}}break;case'=':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0['value']);break;case'LIKE':if(_0x390a39===_0xefbd('0x66')){_0x4b14c3['and'](_0xefbd('0x67')+'\x20LIKE\x20?','%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or']('c.lastName'+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x6a')+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');}break;case'>':_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+'\x20>\x20?',_0x3cc1c0['value']);break;case'<':_0x4b14c3['and'](_0x3cc1c0['tableAlias']+'.'+_0x390a39+'\x20<\x20?',_0x3cc1c0[_0xefbd('0x59')]);break;}}}});}else{var _0x218f05=_(Object[_0xefbd('0x34')](_0x19c485[_0xefbd('0x35')]))[_0xefbd('0x6e')](function(_0x260527){return _0x5c308c[_0xefbd('0x6f')](_0x260527)?_0x260527:undefined;})[_0xefbd('0x70')](function(_0x312662){return!_[_0xefbd('0x71')](_0x312662);})['value']();if(!_['isEmpty'](_0x218f05)){_0x218f05['forEach'](function(_0x2778a9){if(_0x2778a9===_0xefbd('0x72')){_0x18626b[_0xefbd('0x3e')](_0xefbd('0x73'),[][_0xefbd('0x74')](_0x19c485[_0xefbd('0x35')][_0x2778a9]));}else if(_0x2778a9===_0xefbd('0x58')){var _0x4f158d=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0x2778a9])['$gte'];var _0x22db69=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0x2778a9])['$lte'];_0x18626b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f158d,_0x22db69);}else{_0x18626b[_0xefbd('0x3e')]('i.'+_0x2778a9+_0xefbd('0x65'),_0x19c485[_0xefbd('0x35')][_0x2778a9]);}});}if(_0x19c485[_0xefbd('0x35')][_0xefbd('0x70')]){var _0x1b3f09=_0x19c485[_0xefbd('0x35')][_0xefbd('0x70')][_0xefbd('0x75')]('\x5c','\x5c\x5c')[_0xefbd('0x75')]('\x27\x27',_0xefbd('0x76'));if(qs[_0xefbd('0x77')](_0x1b3f09)){_0x4b14c3['or']('i.id\x20LIKE\x20?',_0x1b3f09+'%');}else{var _0xcdd42b=[];_0x1b3f09[_0xefbd('0x78')]('\x20')[_0xefbd('0x57')](function(_0x29d4c1){_0xcdd42b[_0xefbd('0x79')]('+'+_0x29d4c1[_0xefbd('0x7a')]());});var _0x9c4139=_0xcdd42b[_0xefbd('0x7b')]('\x20');_0x4b14c3['or'](_0xefbd('0x7c'),_0x9c4139)['or']('i.from\x20LIKE\x20?',_0x1b3f09+'%')['or'](_0xefbd('0x7d'),_0x1b3f09+'%');}}}_0x18626b[_0xefbd('0x3e')](_0x4b14c3);if(_0x45fb25[_0xefbd('0x3c')]){_0x45fb25['order'][_0xefbd('0x57')](function(_0x12acd8){_0x18626b['order']('i.'+_0x12acd8[0x0],_0x12acd8[0x1]==='DESC'?![]:!![]);});}_0x18626b[_0xefbd('0x7e')](_0xefbd('0x7f'));var _0x8873e9={'type':db['Sequelize']['QueryTypes'][_0xefbd('0x80')],'raw':!![]};var _0x491477=_0x18626b['clone']()[_0xefbd('0x41')](_0xefbd('0x81'));if(!_0x19c485[_0xefbd('0x35')][_0xefbd('0x56')]){if(_0x19c485[_0xefbd('0x35')]['read']){if(_0x19c485[_0xefbd('0x35')]['read']==0x1){_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')](_0xefbd('0x82'),_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x84'));}else{_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')]('%s\x20>\x200',_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x85'));}}if(_0x19c485['query'][_0xefbd('0x86')]){var _0x3085f5=_[_0xefbd('0x62')](_0x19c485['query']['tag'])?_0x19c485[_0xefbd('0x35')][_0xefbd('0x86')]:new Array(_0x19c485['query']['tag']);var _0x19807c=squel['expr']();_0x3085f5[_0xefbd('0x57')](function(_0x4423d8){_0x19807c['or'](_0xefbd('0x87'),'%,'+_0x4423d8+',%');});_0x18626b[_0xefbd('0x83')](_0x19807c);_0x491477[_0xefbd('0x49')]('openchannel_interaction_has_tags','it',_0xefbd('0x88'));_0x491477[_0xefbd('0x49')](_0xefbd('0x43'),'t','t.id\x20=\x20it.TagId');_0x491477['where'](_0xefbd('0x89'),_0x3085f5);}}else{var _0x2f59e5=JSON['parse'](_0x19c485['query'][_0xefbd('0x56')]);_[_0xefbd('0x34')](_0x2f59e5)['forEach'](function(_0x2d22b5){var _0x1ec907=_0x2f59e5[_0x2d22b5];if(_0x2d22b5===_0xefbd('0x61')){var _0x19424b=_0x1ec907['value'];var _0x27c3d3=squel[_0xefbd('0x54')]();_0x19424b[_0xefbd('0x57')](function(_0x14327f){_0x27c3d3['or'](_0xefbd('0x87'),'%,'+_0x14327f+',%');});_0x18626b[_0xefbd('0x83')](_0x27c3d3);_0x491477[_0xefbd('0x49')](_0xefbd('0x8a'),'it',_0xefbd('0x8b'));_0x491477['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x491477[_0xefbd('0x3e')](_0xefbd('0x89'),_0x19424b);}else if(_0x2d22b5==='Messages.count'){if(_0x1ec907[_0xefbd('0x59')]['length']===0x1){if(_0x1ec907[_0xefbd('0x59')][0x0]===0x1){_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')]('%s\x20=\x200',_0x24ce10['toString']()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x84'));}else{_0x491477['where'](util['format'](_0xefbd('0x8c'),_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x85'));}}}});}db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x491477[_0xefbd('0x7a')](),_0x8873e9)[_0xefbd('0x2b')](function(_0xa81098){_0x58c0ac[_0xefbd('0x22')]=_0xa81098[_0xefbd('0x3a')];if(_0x58c0ac['count']===0x0)return[];return db[_0xefbd('0x8d')]['query'](_0x19ddb7[_0xefbd('0x7a')](),_0x8873e9)['then'](function(_0x4d8315){_0x1b77e6=_[_0xefbd('0x8e')](_0x4d8315,'id');_0x8873e9=_[_0xefbd('0x8f')](_0x8873e9,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x18626b[_0xefbd('0x41')](_0x24ce10,_0xefbd('0x6d'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x90'),'Account.key');_0x18626b[_0xefbd('0x41')](_0xefbd('0x91'));_0x18626b['field'](_0xefbd('0x67'),'Contact.firstName');_0x18626b[_0xefbd('0x41')](_0xefbd('0x69'),'Contact.lastName');_0x18626b[_0xefbd('0x41')]('c.email',_0xefbd('0x92'));_0x18626b[_0xefbd('0x41')]('c.phone',_0xefbd('0x93'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x94'),_0xefbd('0x95'));_0x18626b[_0xefbd('0x41')]('c.fax',_0xefbd('0x96'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x97'),'User.name');_0x18626b[_0xefbd('0x41')](_0xefbd('0x98'),'TagIds');_0x18626b[_0xefbd('0x49')](_0xefbd('0x99'),'it',_0xefbd('0x88'));_0x18626b[_0xefbd('0x49')](_0xefbd('0x43'),'t','t.id\x20=\x20it.TagId');_0x18626b[_0xefbd('0x24')](_0x45fb25[_0xefbd('0x24')]);_0x18626b[_0xefbd('0x23')](_0x45fb25[_0xefbd('0x23')]);return db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x18626b[_0xefbd('0x7a')](),_0x8873e9);})['then'](function(_0x4f05da){_0x532c0a[_0xefbd('0x3e')](_0xefbd('0x9a'),_[_0xefbd('0x6e')](_0x4f05da,'id'));return db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x532c0a[_0xefbd('0x7a')](),_0x8873e9)[_0xefbd('0x2b')](function(_0x395cb3){var _0x45a8af=_['groupBy'](_0x395cb3,_0xefbd('0x9b'));_0x4f05da[_0xefbd('0x57')](function(_0x3edbce){if(_0x45a8af[_0x3edbce['id']]){_0x3edbce[_0xefbd('0x9c')]=_[_0xefbd('0x6e')](_0x45a8af[_0x3edbce['id']],function(_0x36a2df){return{'id':_0x36a2df['id']};});}if(_0x3edbce['TagIds']){_0x3edbce[_0xefbd('0x9d')]=[];_0x3edbce[_0xefbd('0x9e')][_0xefbd('0x78')](',')['forEach'](function(_0x54e08a){_0x3edbce[_0xefbd('0x9d')]['push'](_0x1b77e6[_0x54e08a]);});}delete _0x3edbce[_0xefbd('0x9e')];});return _0x4f05da;});});})[_0xefbd('0x2b')](function(_0x1a2a05){_0x58c0ac[_0xefbd('0x9f')]=_0x1a2a05;return _0x58c0ac;})[_0xefbd('0x2b')](respondWithFilteredResult(_0x48e20a,_0x45fb25))[_0xefbd('0xa0')](handleError(_0x48e20a,null));};exports['show']=function(_0x1b79bd,_0x550d48){var _0x1e7378={'raw':![],'where':{'id':_0x1b79bd[_0xefbd('0xa1')]['id']}},_0x319236={};_0x319236[_0xefbd('0x33')]=_[_0xefbd('0x34')](db[_0xefbd('0x31')][_0xefbd('0x32')]);_0x319236['query']=_[_0xefbd('0x34')](_0x1b79bd['query']);_0x319236['filters']=_[_0xefbd('0x37')](_0x319236[_0xefbd('0x33')],_0x319236[_0xefbd('0x35')]);_0x1e7378['attributes']=_['intersection'](_0x319236[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x1b79bd[_0xefbd('0x35')]['fields']));_0x1e7378[_0xefbd('0x38')]=_0x1e7378['attributes']['length']?_0x1e7378[_0xefbd('0x38')]:_0x319236[_0xefbd('0x33')];if(_0x1b79bd[_0xefbd('0x35')][_0xefbd('0xa2')]){_0x1e7378[_0xefbd('0xa3')]=[{'all':!![]}];}_0x1e7378=_[_0xefbd('0x8f')]({},_0x1e7378,_0x1b79bd[_0xefbd('0xa4')]);return db[_0xefbd('0x31')]['find'](_0x1e7378)[_0xefbd('0x2b')](handleEntityNotFound(_0x550d48,null))['then'](respondWithResult(_0x550d48,null))[_0xefbd('0xa0')](handleError(_0x550d48,null));};exports[_0xefbd('0xa5')]=function(_0x314da3,_0x158a67){return db[_0xefbd('0x31')][_0xefbd('0xa5')](_0x314da3[_0xefbd('0xa6')],{})[_0xefbd('0x2b')](respondWithResult(_0x158a67,0xc9))[_0xefbd('0xa0')](handleError(_0x158a67,null));};exports[_0xefbd('0x2a')]=function(_0x244a77,_0x1e94e3){if(_0x244a77['body']['id']){delete _0x244a77[_0xefbd('0xa6')]['id'];}return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x244a77[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x1e94e3,null))[_0xefbd('0x2b')](saveUpdates(_0x244a77[_0xefbd('0xa6')],null))[_0xefbd('0x2b')](respondWithResult(_0x1e94e3,null))[_0xefbd('0xa0')](handleError(_0x1e94e3,null));};exports[_0xefbd('0x2c')]=function(_0x536976,_0xa8472b){return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x536976[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0xa8472b,null))[_0xefbd('0x2b')](removeEntity(_0xa8472b,null))[_0xefbd('0xa0')](handleError(_0xa8472b,null));};exports[_0xefbd('0xa8')]=function(_0xcb01d6,_0x30c5c3){return db[_0xefbd('0x31')][_0xefbd('0xa8')]()[_0xefbd('0x2b')](respondWithResult(_0x30c5c3,null))[_0xefbd('0xa0')](handleError(_0x30c5c3,null));};exports[_0xefbd('0xa9')]=function(_0x22fc90,_0x18f1e2,_0x14bc8b){return db['OpenchannelMessage']['find']({'where':{'id':_0x22fc90['params']['id']}})['then'](handleEntityNotFound(_0x18f1e2,null))[_0xefbd('0x2b')](function(_0x503385){if(_0x503385){return _0x503385[_0xefbd('0xa9')](_0x22fc90['body']['ids'],_[_0xefbd('0xaa')](_0x22fc90['body'],['ids','id'])||{});}})[_0xefbd('0x2b')](respondWithResult(_0x18f1e2,null))['catch'](handleError(_0x18f1e2,null));};exports[_0xefbd('0xab')]=function(_0x46ba97,_0x580193,_0x2faf6c){var _0x23ea1d={'raw':![],'where':{}};var _0x5917df={};var _0xe043f9={'count':0x0,'rows':[]};return db[_0xefbd('0x31')][_0xefbd('0xac')]({'where':{'id':_0x46ba97['params']['id']}})['then'](handleEntityNotFound(_0x580193,null))[_0xefbd('0x2b')](function(_0x5d740f){if(_0x5d740f){_0x5917df[_0xefbd('0x33')]=_[_0xefbd('0x34')](db[_0xefbd('0xad')][_0xefbd('0x32')]);_0x5917df[_0xefbd('0x35')]=_[_0xefbd('0x34')](_0x46ba97['query']);_0x5917df[_0xefbd('0x36')]=_[_0xefbd('0x37')](_0x5917df[_0xefbd('0x33')],_0x5917df[_0xefbd('0x35')]);_0x23ea1d[_0xefbd('0x38')]=_[_0xefbd('0x37')](_0x5917df[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x46ba97[_0xefbd('0x35')][_0xefbd('0x39')]));_0x23ea1d[_0xefbd('0x38')]=_0x23ea1d[_0xefbd('0x38')][_0xefbd('0x3a')]?_0x23ea1d[_0xefbd('0x38')]:_0x5917df[_0xefbd('0x33')];if(!_0x46ba97[_0xefbd('0x35')][_0xefbd('0x6f')]('nolimit')){_0x23ea1d['limit']=qs[_0xefbd('0x24')](_0x46ba97[_0xefbd('0x35')][_0xefbd('0x24')]);_0x23ea1d['offset']=qs[_0xefbd('0x23')](_0x46ba97['query']['offset']);}_0x23ea1d[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x46ba97[_0xefbd('0x35')]['sort']);_0x23ea1d['where']=qs[_0xefbd('0x36')](_[_0xefbd('0x3f')](_0x46ba97[_0xefbd('0x35')],_0x5917df[_0xefbd('0x36')]));_0x23ea1d[_0xefbd('0x3e')][_0xefbd('0x9b')]=_0x5d740f['id'];if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0x70')]){_0x23ea1d[_0xefbd('0x3e')]=_[_0xefbd('0x8f')](_0x23ea1d[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x6e')](_0x23ea1d[_0xefbd('0x38')],function(_0x278a44){var _0x481063={};_0x481063[_0x278a44]={'$like':'%'+_0x46ba97['query'][_0xefbd('0x70')]+'%'};return _0x481063;})});}if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0xae')]){var _0x190bfe=_0x46ba97[_0xefbd('0x35')][_0xefbd('0xae')]['split'](',');var _0x10dfec={};_0x10dfec[_0x190bfe[0x0]]={'$gte':moment(_0x190bfe[0x1])['format'](_0xefbd('0xaf'))};_0x23ea1d[_0xefbd('0x3e')]=_[_0xefbd('0x8f')](_0x23ea1d[_0xefbd('0x3e')],_0x10dfec);}_0x23ea1d=_[_0xefbd('0x8f')]({},_0x23ea1d,_0x46ba97[_0xefbd('0xa4')]);return db['OpenchannelMessage']['count']({'where':_0x23ea1d[_0xefbd('0x3e')]})[_0xefbd('0x2b')](function(_0x89510e){_0xe043f9[_0xefbd('0x22')]=_0x89510e;if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0xa2')]){_0x23ea1d[_0xefbd('0xa3')]=[{'all':!![]}];}return db[_0xefbd('0xad')][_0xefbd('0xb0')](_0x23ea1d);})[_0xefbd('0x2b')](function(_0x302a0e){_0xe043f9[_0xefbd('0x9f')]=_0x302a0e;return _0xe043f9;});}})[_0xefbd('0x2b')](respondWithFilteredResult(_0x580193,_0x23ea1d))['catch'](handleError(_0x580193,null));};exports[_0xefbd('0xb1')]=function(_0xfc59a0,_0x518968,_0x251e8f){return db[_0xefbd('0x31')]['find']({'where':{'id':_0xfc59a0['params']['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x518968,null))[_0xefbd('0x2b')](function(_0x1ded28){if(_0x1ded28){return _0x1ded28[_0xefbd('0xb2')](_0xfc59a0[_0xefbd('0xa6')][_0xefbd('0xb3')],_[_0xefbd('0xaa')](_0xfc59a0[_0xefbd('0xa6')],[_0xefbd('0xb3'),'id'])||{})[_0xefbd('0xb4')](function(){return db['Tag']['findAll']({'attributes':['id',_0xefbd('0x2f'),_0xefbd('0x42')],'where':{'id':_0xfc59a0['body'][_0xefbd('0xb3')]}});})[_0xefbd('0x2b')](function(_0x1b1d99){socket[_0xefbd('0xb5')]('openchannelInteractionTags:save',{'id':Number(_0xfc59a0[_0xefbd('0xa1')]['id']),'tags':_0x1b1d99||[]});return{'id':Number(_0xfc59a0[_0xefbd('0xa1')]['id']),'tags':_0x1b1d99||[]};});}})[_0xefbd('0x2b')](respondWithResult(_0x518968,null))['catch'](handleError(_0x518968,null));};exports[_0xefbd('0xb6')]=function(_0x442409,_0x109e96,_0x14c2e4){return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x442409[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x109e96,null))[_0xefbd('0x2b')](function(_0x596683){if(_0x596683){return _0x596683[_0xefbd('0xb6')](_0x442409['query'][_0xefbd('0xb3')]);}})[_0xefbd('0x2b')](respondWithStatusCode(_0x109e96,null))[_0xefbd('0xa0')](handleError(_0x109e96,null));};exports[_0xefbd('0xb7')]=function(_0x49ddf9,_0x21b4e2){var _0x14db01=moment()['unix']()[_0xefbd('0x7a')]();var _0x12d71a=path[_0xefbd('0x7b')](config[_0xefbd('0xb8')],_0xefbd('0xb9'),_0xefbd('0xba'),_0xefbd('0xbb'));var _0x6f1d5e=path['join'](config[_0xefbd('0xb8')],_0xefbd('0xb9'),'files',_0xefbd('0xbc'));var _0x48eb8c=path[_0xefbd('0x7b')](_0x12d71a,_0x14db01);var _0x2452d6=util[_0xefbd('0x5d')](_0xefbd('0xbd'),_0x49ddf9[_0xefbd('0xa1')]['id'],_0x14db01);var _0x1f23b9=path[_0xefbd('0x7b')](_0x12d71a,_0x2452d6);var _0x26c7c1=![];return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x49ddf9[_0xefbd('0xa1')]['id']},'include':[{'model':db[_0xefbd('0xad')],'as':_0xefbd('0xbe'),'attributes':['id',_0xefbd('0xa6'),_0xefbd('0x58'),_0xefbd('0xbf'),_0xefbd('0xc0')],'include':[{'model':db[_0xefbd('0xc1')],'as':_0xefbd('0xc1'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xefbd('0xc2')],'as':_0xefbd('0xc3'),'attributes':['id',_0xefbd('0xc4'),_0xefbd('0xc5')],'raw':!![]},{'model':db[_0xefbd('0xc6')],'as':_0xefbd('0xc6'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xefbd('0x2f')]},{'model':db[_0xefbd('0xc1')],'as':_0xefbd('0xc7'),'attributes':['id',_0xefbd('0xc8')]}]})[_0xefbd('0x2b')](handleEntityNotFound(_0x21b4e2,null))[_0xefbd('0x2b')](function(_0xebb062){if(_0xebb062){var _0x52de7b=_0xebb062[_0xefbd('0xc9')]({'plain':!![]});_0x26c7c1=!![];var _0x21af63={'format':'A4','border':_0xefbd('0xca'),'header':{'height':_0xefbd('0xcb'),'contents':{'first':_0xefbd('0xcc')}},'footer':{'height':'30px','contents':{'default':util['format'](_0xefbd('0xcd'),util[_0xefbd('0x5d')](_0xefbd('0xce'),_0xefbd('0xcf'),_0x52de7b['id']),moment()[_0xefbd('0x5d')](_0xefbd('0xd0'))[_0xefbd('0x7a')]())}}};fs['mkdirSync'](_0x48eb8c);var _0x50912a={'channel':_0xefbd('0xcf'),'account':_0x52de7b[_0xefbd('0xd1')]['name'],'agent':_0x52de7b[_0xefbd('0xc7')]?_0x52de7b[_0xefbd('0xc7')][_0xefbd('0xc8')]:_0xefbd('0xd2'),'createdAt':moment(_0x52de7b[_0xefbd('0x58')])['format'](_0xefbd('0xaf'))[_0xefbd('0x7a')](),'closedAt':_0x52de7b[_0xefbd('0xd3')]?moment(_0x52de7b[_0xefbd('0xd4')])[_0xefbd('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xefbd('0x7a')]():'','disposition':_0x52de7b[_0xefbd('0xd5')],'visibility':_0x52de7b[_0xefbd('0xd6')]?_0xefbd('0xd7'):'Private','messages':_(_0x52de7b[_0xefbd('0xbe')])['filter']({'secret':![]})[_0xefbd('0x6e')](function(_0x18821b){if(_0x18821b['Attachment']){var _0x4c1b80=path[_0xefbd('0x7b')](_0x6f1d5e,_0x18821b[_0xefbd('0xc6')][_0xefbd('0xd8')]);if(fs[_0xefbd('0xd9')](_0x4c1b80)){fs['createReadStream'](_0x4c1b80)[_0xefbd('0xda')](fs['createWriteStream'](path['join'](_0x48eb8c,_0x18821b[_0xefbd('0xc6')]['basename'])));}}return{'date':moment(_0x18821b[_0xefbd('0x58')])[_0xefbd('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xefbd('0x7a')](),'sender':_0x18821b['direction']==='out'?_0x18821b[_0xefbd('0xc1')]?_0x18821b[_0xefbd('0xc1')][_0xefbd('0xc8')]:_0xefbd('0xdb'):_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc4')]+(_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc5')]?'\x20'+_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc5')]:''),'body':_0x18821b[_0xefbd('0xc6')]?_0x18821b['Attachment']['basename']:_0x18821b[_0xefbd('0xa6')],'direction':_0x18821b['direction']===_0xefbd('0xdc')?'A':'C','secret':_0x18821b['secret'],'attachment':_0x18821b[_0xefbd('0xc6')]};})[_0xefbd('0x59')]()};return ejs['renderFile'](path[_0xefbd('0x7b')](config['root'],'server',_0xefbd('0xdd'),_0xefbd('0xde')),{'interaction':_0x50912a})[_0xefbd('0x2b')](function(_0x5560b5){return new BPromise(function(_0x505c67,_0x2c9204){pdf[_0xefbd('0xa5')](_0x5560b5,_0x21af63)[_0xefbd('0xdf')](path[_0xefbd('0x7b')](_0x48eb8c,'transcript-'+_0x52de7b['id']+'-'+_0x14db01+_0xefbd('0xe0')),function(_0x181386,_0x41b21b){if(_0x181386)return _0x2c9204(_0x181386);_0x505c67(_0x41b21b);});});});}})[_0xefbd('0x2b')](function(){if(_0x26c7c1){return new BPromise(function(_0x2996f6,_0x638bcc){zipdir(_0x48eb8c,{'saveTo':_0x1f23b9},function(_0x19a944,_0x196f95){if(_0x19a944)return _0x638bcc(_0x19a944);return _0x2996f6(_0x196f95);});})[_0xefbd('0x2b')](function(){return new BPromise(function(_0x10dac4,_0x2f3922){rimraf(_0x48eb8c,function(_0x3124a2){if(_0x3124a2)_0x2f3922(_0x3124a2);return _0x10dac4();});});})[_0xefbd('0x2b')](function(){return _0x21b4e2[_0xefbd('0xb7')](_0x1f23b9,_0x2452d6,function(_0x536b82){if(_0x536b82){console['log'](_0xefbd('0xe1'),_0x536b82);}else{fs[_0xefbd('0xe2')](_0x1f23b9);}});});}else{return _0x21b4e2[_0xefbd('0x1e')](0xc8);}})[_0xefbd('0xa0')](handleError(_0x21b4e2,null));}; \ No newline at end of file +var _0xe5d4=['setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','files','tmp','server','attachments','Messages','direction','User','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','createWriteStream','basename','out','System','renderFile','downloadInteraction.html','create','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','send','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','select','field','tools_tags','COUNT(*)','from','openchannel_messages','where','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','createdAt','value','startOf','utc','format','endOf','day','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','\x20IN\x20?','and','tableAlias','\x20=\x20?','LIKE','ContactId','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','hasOwnProperty','filter','isNil','isEmpty','forEach','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','replace','\x27\x27\x27\x27','isNumeric','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','read','%s\x20=\x200','%s\x20>\x200','having','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','`Messages.count`\x20=\x200','sequelize','count','keyBy','a.key','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','u.fullname','User.name','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','Tags','split','catch','show','merge','find','body','params','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','includeAll'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0xe5d4,0x110));var _0x4e5d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe5d4[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x4e5d('0x0'));var emlformat=require(_0x4e5d('0x1'));var rimraf=require(_0x4e5d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4e5d('0x3'));var moment=require(_0x4e5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4e5d('0x5'));var util=require(_0x4e5d('0x6'));var path=require(_0x4e5d('0x7'));var sox=require(_0x4e5d('0x8'));var csv=require(_0x4e5d('0x9'));var ejs=require(_0x4e5d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4e5d('0xb'));var crypto=require(_0x4e5d('0xc'));var jsforce=require(_0x4e5d('0xd'));var deskjs=require(_0x4e5d('0xe'));var toCsv=require(_0x4e5d('0x9'));var querystring=require('querystring');var Papa=require(_0x4e5d('0xf'));var Redis=require(_0x4e5d('0x10'));var authService=require(_0x4e5d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4e5d('0x12'));var logger=require('../../config/logger')(_0x4e5d('0x13'));var utils=require('../../config/utils');var config=require(_0x4e5d('0x14'));var db=require(_0x4e5d('0x15'))['db'];config[_0x4e5d('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e5d('0x17'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x4e5d('0x18')](socket);function respondWithStatusCode(_0x41f799,_0x571651){_0x571651=_0x571651||0xcc;return function(_0x447d0b){if(_0x447d0b){return _0x41f799[_0x4e5d('0x19')](_0x571651);}return _0x41f799[_0x4e5d('0x1a')](_0x571651)[_0x4e5d('0x1b')]();};}function respondWithResult(_0x5c83fc,_0x217552){_0x217552=_0x217552||0xc8;return function(_0x138b06){if(_0x138b06){return _0x5c83fc['status'](_0x217552)['json'](_0x138b06);}};}function respondWithFilteredResult(_0x23f323,_0x4a4411){return function(_0x4b4ee2){if(_0x4b4ee2){var _0x2940d5=_0x4b4ee2['count'],_0xaae217=_0x4a4411['offset'],_0x44b6f7=_0x4a4411['offset']+_0x4a4411[_0x4e5d('0x1c')],_0x3af8b5;if(_0x44b6f7>=_0x2940d5){_0x44b6f7=_0x2940d5;_0x3af8b5=0xc8;}else{_0x3af8b5=0xce;}_0x23f323[_0x4e5d('0x1a')](_0x3af8b5);return _0x23f323[_0x4e5d('0x1d')](_0x4e5d('0x1e'),_0xaae217+'-'+_0x44b6f7+'/'+_0x2940d5)[_0x4e5d('0x1f')](_0x4b4ee2);}return null;};}function patchUpdates(_0x519184){return function(_0x286d75){try{jsonpatch[_0x4e5d('0x20')](_0x286d75,_0x519184,!![]);}catch(_0x46bd26){return BPromise[_0x4e5d('0x21')](_0x46bd26);}return _0x286d75[_0x4e5d('0x22')]();};}function saveUpdates(_0x500bdc,_0x220eb0){return function(_0x53cb98){if(_0x53cb98){return _0x53cb98[_0x4e5d('0x23')](_0x500bdc)['then'](function(_0x426a40){return _0x426a40;});}return null;};}function removeEntity(_0x565c2d,_0x2b3aa3){return function(_0x3450f4){if(_0x3450f4){return _0x3450f4[_0x4e5d('0x24')]()[_0x4e5d('0x25')](function(){_0x565c2d[_0x4e5d('0x1a')](0xcc)[_0x4e5d('0x1b')]();});}};}function handleEntityNotFound(_0x1d3cc0,_0x47817c){return function(_0x3cbcee){if(!_0x3cbcee){_0x1d3cc0[_0x4e5d('0x19')](0x194);}return _0x3cbcee;};}function handleError(_0x242bd9,_0x45898e){_0x45898e=_0x45898e||0x1f4;return function(_0x44b35e){logger['error'](_0x44b35e['stack']);if(_0x44b35e['name']){delete _0x44b35e[_0x4e5d('0x26')];}_0x242bd9[_0x4e5d('0x1a')](_0x45898e)[_0x4e5d('0x27')](_0x44b35e);};}exports[_0x4e5d('0x28')]=function(_0x2ba816,_0x49f888){var _0x4f9d30={},_0x2d5360={},_0x313f7d={'count':0x0,'rows':[]};var _0x3abb86=db[_0x4e5d('0x29')][_0x4e5d('0x2a')];_0x2d5360[_0x4e5d('0x2b')]=_[_0x4e5d('0x2c')](_0x3abb86);_0x2d5360['query']=_['keys'](_0x2ba816[_0x4e5d('0x2d')]);_0x2d5360[_0x4e5d('0x2e')]=_[_0x4e5d('0x2f')](_0x2d5360[_0x4e5d('0x2b')],_0x2d5360['query']);_0x4f9d30[_0x4e5d('0x30')]=_['intersection'](_0x2d5360[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x31')]));_0x4f9d30[_0x4e5d('0x30')]=_0x4f9d30[_0x4e5d('0x30')][_0x4e5d('0x32')]?_0x4f9d30['attributes']:_0x2d5360[_0x4e5d('0x2b')];if(!_0x2ba816[_0x4e5d('0x2d')]['hasOwnProperty'](_0x4e5d('0x33'))){_0x4f9d30[_0x4e5d('0x1c')]=qs[_0x4e5d('0x1c')](_0x2ba816['query'][_0x4e5d('0x1c')]);_0x4f9d30[_0x4e5d('0x34')]=qs[_0x4e5d('0x34')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x34')]);}_0x4f9d30[_0x4e5d('0x35')]=qs[_0x4e5d('0x36')](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x36')]);_0x4f9d30['where']=qs[_0x4e5d('0x2e')](_[_0x4e5d('0x37')](_0x2ba816[_0x4e5d('0x2d')],_0x2d5360[_0x4e5d('0x2e')]));var _0x9097a3=[];var _0x32d435=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')]('id')['field'](_0x4e5d('0x26'))[_0x4e5d('0x39')]('color')['from'](_0x4e5d('0x3a'));var _0x2e252c=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')](_0x4e5d('0x3b'))[_0x4e5d('0x3c')](_0x4e5d('0x3d'),'me')['where']('me.OpenchannelInteractionId\x20=\x20i.id')[_0x4e5d('0x3e')]('me.direction\x20=\x20\x27in\x27')[_0x4e5d('0x3e')](_0x4e5d('0x3f'));var _0x5ee547=squel[_0x4e5d('0x38')]()[_0x4e5d('0x39')](_0x4e5d('0x40'))['field'](_0x4e5d('0x41'))[_0x4e5d('0x3c')](_0x4e5d('0x42'),'ui')[_0x4e5d('0x43')](_0x4e5d('0x44'),'u','u.id\x20=\x20ui.UserId');var _0x232ff7=squel[_0x4e5d('0x38')]()[_0x4e5d('0x3c')]('openchannel_interactions','i')[_0x4e5d('0x43')](_0x4e5d('0x42'),'ui',_0x4e5d('0x45'))[_0x4e5d('0x43')]('users','u',_0x4e5d('0x46'))[_0x4e5d('0x43')]('cm_contacts','c',_0x4e5d('0x47'))['left_join']('users','o',_0x4e5d('0x48'))['left_join'](_0x4e5d('0x49'),'a',_0x4e5d('0x4a'))['left_join']('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id');var _0xcf2e04=squel[_0x4e5d('0x4b')]();if(_0x2ba816['query'][_0x4e5d('0x4c')]){var _0x1d37f3=JSON['parse'](_0x2ba816['query']['advancedFilter']);_[_0x4e5d('0x2c')](_0x1d37f3)['forEach'](function(_0x3081ef){var _0x1c3670=_0x1d37f3[_0x3081ef];if(_0x3081ef===_0x4e5d('0x4d')){var _0x59b6cf=moment(_0x1c3670[_0x4e5d('0x4e')]['dateStart'])[_0x4e5d('0x4f')]('day')[_0x4e5d('0x50')]()[_0x4e5d('0x51')]();var _0x1041d1=moment(_0x1041d1)[_0x4e5d('0x50')]()[_0x4e5d('0x52')](_0x4e5d('0x53'))[_0x4e5d('0x51')]();_0xcf2e04['and'](_0x4e5d('0x54'),_0x59b6cf,_0x1041d1);}else{if(_[_0x4e5d('0x55')](_0x1c3670[_0x4e5d('0x56')])){_0x1c3670[_0x4e5d('0x56')]['forEach'](function(_0x358cab){switch(_0x1c3670[_0x4e5d('0x56')]['value']){case'IS':if(_0x3081ef!==_0x4e5d('0x57')&&_0x3081ef!==_0x4e5d('0x58')){if(_[_0x4e5d('0x55')](_0x1c3670[_0x4e5d('0x4e')])&&_0x1c3670[_0x4e5d('0x4e')][_0x4e5d('0x32')]>0x1){_0xcf2e04['and'](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x59'),_0x1c3670[_0x4e5d('0x4e')]);}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')][0x0]);}}break;case'=':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')]);break;case _0x4e5d('0x5d'):if(_0x3081ef===_0x4e5d('0x5e')){_0xcf2e04[_0x4e5d('0x5a')]('c.firstName'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or'](_0x4e5d('0x60')+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or'](_0x4e5d('0x61')+'\x20LIKE\x20?','%'+_0x1c3670['value']+'%');}else{_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+'\x20LIKE\x20?','%'+_0x1c3670[_0x4e5d('0x4e')]+'%');}break;case'>':_0xcf2e04['and'](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x62'),_0x1c3670[_0x4e5d('0x4e')]);break;case'<':_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x63'),_0x1c3670[_0x4e5d('0x4e')]);break;}});}else{switch(_0x1c3670['condition']['value']){case'IS':if(_0x3081ef!==_0x4e5d('0x57')&&_0x3081ef!==_0x4e5d('0x58')){if(_[_0x4e5d('0x55')](_0x1c3670['value'])&&_0x1c3670[_0x4e5d('0x4e')][_0x4e5d('0x32')]>0x1){_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x59'),_0x1c3670['value']);}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670[_0x4e5d('0x4e')][0x0]);}}break;case'=':_0xcf2e04['and'](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x5c'),_0x1c3670['value']);break;case'LIKE':if(_0x3081ef===_0x4e5d('0x5e')){_0xcf2e04[_0x4e5d('0x5a')]('c.firstName'+'\x20LIKE\x20?','%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or']('c.lastName'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');_0xcf2e04['or']('c.email'+_0x4e5d('0x5f'),'%'+_0x1c3670[_0x4e5d('0x4e')]+'%');}else{_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670['tableAlias']+'.'+_0x3081ef+'\x20LIKE\x20?','%'+_0x1c3670['value']+'%');}break;case'>':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670['tableAlias']+'.'+_0x3081ef+_0x4e5d('0x62'),_0x1c3670['value']);break;case'<':_0xcf2e04[_0x4e5d('0x5a')](_0x1c3670[_0x4e5d('0x5b')]+'.'+_0x3081ef+_0x4e5d('0x63'),_0x1c3670['value']);break;}}}});}else{var _0x1d7c92=_(Object['keys'](_0x2ba816[_0x4e5d('0x2d')]))[_0x4e5d('0x64')](function(_0x4fd737){return _0x3abb86[_0x4e5d('0x65')](_0x4fd737)?_0x4fd737:undefined;})[_0x4e5d('0x66')](function(_0x265724){return!_[_0x4e5d('0x67')](_0x265724);})['value']();if(!_[_0x4e5d('0x68')](_0x1d7c92)){_0x1d7c92[_0x4e5d('0x69')](function(_0x51221c){if(_0x51221c===_0x4e5d('0x6a')){_0x232ff7['where'](_0x4e5d('0x6b'),[][_0x4e5d('0x6c')](_0x2ba816[_0x4e5d('0x2d')][_0x51221c]));}else if(_0x51221c===_0x4e5d('0x4d')){var _0x12c9d2=JSON[_0x4e5d('0x6d')](_0x2ba816[_0x4e5d('0x2d')][_0x51221c])[_0x4e5d('0x6e')];var _0x38c352=JSON[_0x4e5d('0x6d')](_0x2ba816['query'][_0x51221c])['$lte'];_0x232ff7['where'](_0x4e5d('0x54'),_0x12c9d2,_0x38c352);}else{_0x232ff7[_0x4e5d('0x3e')]('i.'+_0x51221c+_0x4e5d('0x5c'),_0x2ba816[_0x4e5d('0x2d')][_0x51221c]);}});}if(_0x2ba816['query'][_0x4e5d('0x66')]){var _0x1b2bff=_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x66')][_0x4e5d('0x6f')]('\x5c','\x5c\x5c')[_0x4e5d('0x6f')]('\x27\x27',_0x4e5d('0x70'));if(qs[_0x4e5d('0x71')](_0x1b2bff)){_0xcf2e04['or']('i.id\x20LIKE\x20?',_0x1b2bff+'%');}else{var _0x552604=[];_0x1b2bff['split']('\x20')[_0x4e5d('0x69')](function(_0x4d4097){_0x552604[_0x4e5d('0x72')]('+'+_0x4d4097[_0x4e5d('0x73')]());});var _0x566ed7=_0x552604[_0x4e5d('0x74')]('\x20');_0xcf2e04['or'](_0x4e5d('0x75'),_0x566ed7)['or'](_0x4e5d('0x76'),_0x1b2bff+'%')['or'](_0x4e5d('0x77'),_0x1b2bff+'%');}}}_0x232ff7[_0x4e5d('0x3e')](_0xcf2e04);if(_0x4f9d30[_0x4e5d('0x35')]){_0x4f9d30[_0x4e5d('0x35')][_0x4e5d('0x69')](function(_0x446456){_0x232ff7[_0x4e5d('0x35')]('i.'+_0x446456[0x0],_0x446456[0x1]==='DESC'?![]:!![]);});}_0x232ff7[_0x4e5d('0x78')]('i.id');var _0x36846c={'type':db[_0x4e5d('0x79')]['QueryTypes'][_0x4e5d('0x7a')],'raw':!![]};var _0x1d16b1=_0x232ff7['clone']()[_0x4e5d('0x39')]('COUNT(*)');if(!_0x2ba816[_0x4e5d('0x2d')]['advancedFilter']){if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x7b')]){if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x7b')]==0x1){_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')](_0x4e5d('0x7c'),_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7['having']('`Messages.count`\x20=\x200');}else{_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')](_0x4e5d('0x7d'),_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x7f'));}}if(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')]){var _0x3b860e=_['isArray'](_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')])?_0x2ba816['query'][_0x4e5d('0x80')]:new Array(_0x2ba816[_0x4e5d('0x2d')][_0x4e5d('0x80')]);var _0x3d3e0d=squel[_0x4e5d('0x4b')]();_0x3b860e['forEach'](function(_0x38a781){_0x3d3e0d['or'](_0x4e5d('0x81'),'%,'+_0x38a781+',%');});_0x232ff7['having'](_0x3d3e0d);_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x82'),'it',_0x4e5d('0x83'));_0x1d16b1['left_join']('tools_tags','t',_0x4e5d('0x84'));_0x1d16b1[_0x4e5d('0x3e')](_0x4e5d('0x85'),_0x3b860e);}}else{var _0x1d37f3=JSON['parse'](_0x2ba816[_0x4e5d('0x2d')]['advancedFilter']);_[_0x4e5d('0x2c')](_0x1d37f3)[_0x4e5d('0x69')](function(_0x97a702){var _0x568137=_0x1d37f3[_0x97a702];if(_0x97a702===_0x4e5d('0x57')){var _0x55eb0a=_0x568137[_0x4e5d('0x4e')];var _0x5b5723=squel[_0x4e5d('0x4b')]();_0x55eb0a[_0x4e5d('0x69')](function(_0x49e28b){_0x5b5723['or'](_0x4e5d('0x81'),'%,'+_0x49e28b+',%');});_0x232ff7[_0x4e5d('0x7e')](_0x5b5723);_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x86'),'it',_0x4e5d('0x87'));_0x1d16b1[_0x4e5d('0x43')](_0x4e5d('0x3a'),'t',_0x4e5d('0x84'));_0x1d16b1[_0x4e5d('0x3e')](_0x4e5d('0x85'),_0x55eb0a);}else if(_0x97a702===_0x4e5d('0x58')){if(_0x568137['value'][_0x4e5d('0x32')]===0x1){if(_0x568137['value'][0x0]===0x1){_0x1d16b1[_0x4e5d('0x3e')](util['format']('%s\x20=\x200',_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x88'));}else{_0x1d16b1[_0x4e5d('0x3e')](util[_0x4e5d('0x51')]('%s\x20>\x200',_0x2e252c[_0x4e5d('0x73')]()));_0x232ff7[_0x4e5d('0x7e')](_0x4e5d('0x7f'));}}}});}db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x1d16b1[_0x4e5d('0x73')](),_0x36846c)['then'](function(_0xd01027){_0x313f7d[_0x4e5d('0x8a')]=_0xd01027[_0x4e5d('0x32')];if(_0x313f7d['count']===0x0)return[];return db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x32d435['toString'](),_0x36846c)['then'](function(_0x35090f){_0x9097a3=_[_0x4e5d('0x8b')](_0x35090f,'id');_0x36846c=_['merge'](_0x36846c,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x232ff7[_0x4e5d('0x39')](_0x2e252c,_0x4e5d('0x58'));_0x232ff7[_0x4e5d('0x39')](_0x4e5d('0x8c'),'Account.key');_0x232ff7['field']('i.*');_0x232ff7['field']('c.firstName','Contact.firstName');_0x232ff7['field'](_0x4e5d('0x60'),_0x4e5d('0x8d'));_0x232ff7['field'](_0x4e5d('0x61'),_0x4e5d('0x8e'));_0x232ff7[_0x4e5d('0x39')]('c.phone',_0x4e5d('0x8f'));_0x232ff7['field'](_0x4e5d('0x90'),_0x4e5d('0x91'));_0x232ff7['field'](_0x4e5d('0x92'),_0x4e5d('0x93'));_0x232ff7['field'](_0x4e5d('0x94'),_0x4e5d('0x95'));_0x232ff7[_0x4e5d('0x39')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4e5d('0x96'));_0x232ff7[_0x4e5d('0x43')]('openchannel_interaction_has_tags','it',_0x4e5d('0x83'));_0x232ff7[_0x4e5d('0x43')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x232ff7[_0x4e5d('0x1c')](_0x4f9d30[_0x4e5d('0x1c')]);_0x232ff7[_0x4e5d('0x34')](_0x4f9d30[_0x4e5d('0x34')]);return db[_0x4e5d('0x89')]['query'](_0x232ff7[_0x4e5d('0x73')](),_0x36846c);})['then'](function(_0x14b3e5){_0x5ee547[_0x4e5d('0x3e')](_0x4e5d('0x97'),_[_0x4e5d('0x64')](_0x14b3e5,'id'));return db[_0x4e5d('0x89')][_0x4e5d('0x2d')](_0x5ee547[_0x4e5d('0x73')](),_0x36846c)[_0x4e5d('0x25')](function(_0x1c2619){var _0x2ddef0=_['groupBy'](_0x1c2619,_0x4e5d('0x98'));_0x14b3e5[_0x4e5d('0x69')](function(_0x17014a){if(_0x2ddef0[_0x17014a['id']]){_0x17014a['Users']=_[_0x4e5d('0x64')](_0x2ddef0[_0x17014a['id']],function(_0x2385f0){return{'id':_0x2385f0['id']};});}if(_0x17014a[_0x4e5d('0x96')]){_0x17014a[_0x4e5d('0x99')]=[];_0x17014a[_0x4e5d('0x96')][_0x4e5d('0x9a')](',')[_0x4e5d('0x69')](function(_0x29c1aa){_0x17014a[_0x4e5d('0x99')][_0x4e5d('0x72')](_0x9097a3[_0x29c1aa]);});}delete _0x17014a[_0x4e5d('0x96')];});return _0x14b3e5;});});})[_0x4e5d('0x25')](function(_0x504614){_0x313f7d['rows']=_0x504614;return _0x313f7d;})[_0x4e5d('0x25')](respondWithFilteredResult(_0x49f888,_0x4f9d30))[_0x4e5d('0x9b')](handleError(_0x49f888,null));};exports[_0x4e5d('0x9c')]=function(_0x5e124d,_0x22107a){var _0x1d4f21={'raw':![],'where':{'id':_0x5e124d['params']['id']}},_0xc3e07a={};_0xc3e07a[_0x4e5d('0x2b')]=_['keys'](db[_0x4e5d('0x29')][_0x4e5d('0x2a')]);_0xc3e07a[_0x4e5d('0x2d')]=_['keys'](_0x5e124d['query']);_0xc3e07a['filters']=_[_0x4e5d('0x2f')](_0xc3e07a['model'],_0xc3e07a[_0x4e5d('0x2d')]);_0x1d4f21['attributes']=_['intersection'](_0xc3e07a[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x5e124d[_0x4e5d('0x2d')]['fields']));_0x1d4f21['attributes']=_0x1d4f21['attributes'][_0x4e5d('0x32')]?_0x1d4f21[_0x4e5d('0x30')]:_0xc3e07a[_0x4e5d('0x2b')];if(_0x5e124d[_0x4e5d('0x2d')]['includeAll']){_0x1d4f21['include']=[{'all':!![]}];}_0x1d4f21=_[_0x4e5d('0x9d')]({},_0x1d4f21,_0x5e124d['options']);return db[_0x4e5d('0x29')][_0x4e5d('0x9e')](_0x1d4f21)[_0x4e5d('0x25')](handleEntityNotFound(_0x22107a,null))['then'](respondWithResult(_0x22107a,null))['catch'](handleError(_0x22107a,null));};exports['create']=function(_0x4a4bc8,_0x2688f5){return db[_0x4e5d('0x29')]['create'](_0x4a4bc8[_0x4e5d('0x9f')],{})['then'](respondWithResult(_0x2688f5,0xc9))[_0x4e5d('0x9b')](handleError(_0x2688f5,null));};exports[_0x4e5d('0x23')]=function(_0x1d639a,_0x415f4a){if(_0x1d639a[_0x4e5d('0x9f')]['id']){delete _0x1d639a[_0x4e5d('0x9f')]['id'];}return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x1d639a[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x415f4a,null))['then'](saveUpdates(_0x1d639a['body'],null))[_0x4e5d('0x25')](respondWithResult(_0x415f4a,null))['catch'](handleError(_0x415f4a,null));};exports[_0x4e5d('0x24')]=function(_0x1599ff,_0x569464){return db[_0x4e5d('0x29')]['find']({'where':{'id':_0x1599ff[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x569464,null))[_0x4e5d('0x25')](removeEntity(_0x569464,null))[_0x4e5d('0x9b')](handleError(_0x569464,null));};exports['describe']=function(_0x4b33ab,_0x398720){return db[_0x4e5d('0x29')][_0x4e5d('0xa1')]()[_0x4e5d('0x25')](respondWithResult(_0x398720,null))[_0x4e5d('0x9b')](handleError(_0x398720,null));};exports['addMessage']=function(_0x358655,_0x5beea3,_0xe7144f){return db[_0x4e5d('0xa2')][_0x4e5d('0x9e')]({'where':{'id':_0x358655['params']['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x5beea3,null))[_0x4e5d('0x25')](function(_0x34ec7c){if(_0x34ec7c){return _0x34ec7c[_0x4e5d('0xa3')](_0x358655[_0x4e5d('0x9f')][_0x4e5d('0xa4')],_[_0x4e5d('0xa5')](_0x358655[_0x4e5d('0x9f')],[_0x4e5d('0xa4'),'id'])||{});}})[_0x4e5d('0x25')](respondWithResult(_0x5beea3,null))['catch'](handleError(_0x5beea3,null));};exports[_0x4e5d('0xa6')]=function(_0x32f737,_0x3fa8e4,_0x20f8e2){var _0x1dd564={'raw':![],'where':{}};var _0x4ed2fe={};var _0x5493ae={'count':0x0,'rows':[]};return db[_0x4e5d('0x29')]['findOne']({'where':{'id':_0x32f737[_0x4e5d('0xa0')]['id']}})[_0x4e5d('0x25')](handleEntityNotFound(_0x3fa8e4,null))[_0x4e5d('0x25')](function(_0x1c7792){if(_0x1c7792){_0x4ed2fe[_0x4e5d('0x2b')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x4ed2fe['query']=_[_0x4e5d('0x2c')](_0x32f737[_0x4e5d('0x2d')]);_0x4ed2fe[_0x4e5d('0x2e')]=_[_0x4e5d('0x2f')](_0x4ed2fe[_0x4e5d('0x2b')],_0x4ed2fe['query']);_0x1dd564[_0x4e5d('0x30')]=_[_0x4e5d('0x2f')](_0x4ed2fe[_0x4e5d('0x2b')],qs[_0x4e5d('0x31')](_0x32f737[_0x4e5d('0x2d')]['fields']));_0x1dd564[_0x4e5d('0x30')]=_0x1dd564[_0x4e5d('0x30')][_0x4e5d('0x32')]?_0x1dd564[_0x4e5d('0x30')]:_0x4ed2fe[_0x4e5d('0x2b')];if(!_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x65')](_0x4e5d('0x33'))){_0x1dd564[_0x4e5d('0x1c')]=qs[_0x4e5d('0x1c')](_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x1c')]);_0x1dd564[_0x4e5d('0x34')]=qs[_0x4e5d('0x34')](_0x32f737['query'][_0x4e5d('0x34')]);}_0x1dd564[_0x4e5d('0x35')]=qs[_0x4e5d('0x36')](_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x36')]);_0x1dd564[_0x4e5d('0x3e')]=qs[_0x4e5d('0x2e')](_[_0x4e5d('0x37')](_0x32f737[_0x4e5d('0x2d')],_0x4ed2fe['filters']));_0x1dd564[_0x4e5d('0x3e')]['OpenchannelInteractionId']=_0x1c7792['id'];if(_0x32f737['query']['filter']){_0x1dd564[_0x4e5d('0x3e')]=_['merge'](_0x1dd564[_0x4e5d('0x3e')],{'$or':_[_0x4e5d('0x64')](_0x1dd564['attributes'],function(_0x3b4e03){var _0x4ffa8a={};_0x4ffa8a[_0x3b4e03]={'$like':'%'+_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x66')]+'%'};return _0x4ffa8a;})});}if(_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x6e')]){var _0x12acee=_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0x6e')]['split'](',');var _0x175434={};_0x175434[_0x12acee[0x0]]={'$gte':moment(_0x12acee[0x1])[_0x4e5d('0x51')](_0x4e5d('0xa7'))};_0x1dd564[_0x4e5d('0x3e')]=_['merge'](_0x1dd564[_0x4e5d('0x3e')],_0x175434);}_0x1dd564=_[_0x4e5d('0x9d')]({},_0x1dd564,_0x32f737[_0x4e5d('0xa8')]);return db[_0x4e5d('0xa2')][_0x4e5d('0x8a')]({'where':_0x1dd564[_0x4e5d('0x3e')]})[_0x4e5d('0x25')](function(_0x578e0d){_0x5493ae['count']=_0x578e0d;if(_0x32f737[_0x4e5d('0x2d')][_0x4e5d('0xa9')]){_0x1dd564['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x1dd564);})[_0x4e5d('0x25')](function(_0x175116){_0x5493ae['rows']=_0x175116;return _0x5493ae;});}})[_0x4e5d('0x25')](respondWithFilteredResult(_0x3fa8e4,_0x1dd564))['catch'](handleError(_0x3fa8e4,null));};exports['addTags']=function(_0x4d0fc6,_0x4b3248,_0x4ccf59){return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x4d0fc6[_0x4e5d('0xa0')]['id']}})['then'](handleEntityNotFound(_0x4b3248,null))['then'](function(_0x34ceda){if(_0x34ceda){return _0x34ceda[_0x4e5d('0xaa')](_0x4d0fc6['body'][_0x4e5d('0xa4')],_['omit'](_0x4d0fc6[_0x4e5d('0x9f')],[_0x4e5d('0xa4'),'id'])||{})[_0x4e5d('0xab')](function(){return db[_0x4e5d('0xac')]['findAll']({'attributes':['id',_0x4e5d('0x26'),_0x4e5d('0xad')],'where':{'id':_0x4d0fc6[_0x4e5d('0x9f')]['ids']}});})['then'](function(_0x468c86){socket[_0x4e5d('0xae')](_0x4e5d('0xaf'),{'id':Number(_0x4d0fc6['params']['id']),'tags':_0x468c86||[]});return{'id':Number(_0x4d0fc6[_0x4e5d('0xa0')]['id']),'tags':_0x468c86||[]};});}})[_0x4e5d('0x25')](respondWithResult(_0x4b3248,null))['catch'](handleError(_0x4b3248,null));};exports['removeTags']=function(_0x38cb52,_0x343d0f,_0x58f3fd){return db[_0x4e5d('0x29')][_0x4e5d('0x9e')]({'where':{'id':_0x38cb52['params']['id']}})['then'](handleEntityNotFound(_0x343d0f,null))[_0x4e5d('0x25')](function(_0x1ee611){if(_0x1ee611){return _0x1ee611[_0x4e5d('0xb0')](_0x38cb52[_0x4e5d('0x2d')][_0x4e5d('0xa4')]);}})[_0x4e5d('0x25')](respondWithStatusCode(_0x343d0f,null))[_0x4e5d('0x9b')](handleError(_0x343d0f,null));};exports[_0x4e5d('0xb1')]=function(_0x30441b,_0x1a3b9f){var _0x42340a=moment()[_0x4e5d('0xb2')]()[_0x4e5d('0x73')]();var _0x58ca31=path[_0x4e5d('0x74')](config[_0x4e5d('0xb3')],'server',_0x4e5d('0xb4'),_0x4e5d('0xb5'));var _0x53bce9=path[_0x4e5d('0x74')](config[_0x4e5d('0xb3')],_0x4e5d('0xb6'),_0x4e5d('0xb4'),_0x4e5d('0xb7'));var _0x5d887d=path[_0x4e5d('0x74')](_0x58ca31,_0x42340a);var _0x4349e6=util['format']('transcript-%d-%s.zip',_0x30441b[_0x4e5d('0xa0')]['id'],_0x42340a);var _0x445ad1=path['join'](_0x58ca31,_0x4349e6);var _0x13c596=![];return db[_0x4e5d('0x29')]['find']({'where':{'id':_0x30441b[_0x4e5d('0xa0')]['id']},'include':[{'model':db[_0x4e5d('0xa2')],'as':_0x4e5d('0xb8'),'attributes':['id','body',_0x4e5d('0x4d'),_0x4e5d('0xb9'),'secret'],'include':[{'model':db[_0x4e5d('0xba')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db['CmContact'],'as':_0x4e5d('0xbb'),'attributes':['id',_0x4e5d('0xbc'),_0x4e5d('0xbd')],'raw':!![]},{'model':db['Attachment'],'as':_0x4e5d('0xbe'),'raw':!![]}]},{'model':db[_0x4e5d('0xbf')],'as':_0x4e5d('0xc0'),'attributes':['id',_0x4e5d('0x26')]},{'model':db[_0x4e5d('0xba')],'as':_0x4e5d('0xc1'),'attributes':['id','fullname']}]})[_0x4e5d('0x25')](handleEntityNotFound(_0x1a3b9f,null))[_0x4e5d('0x25')](function(_0x4210ab){if(_0x4210ab){var _0x1fd08a=_0x4210ab['get']({'plain':!![]});_0x13c596=!![];var _0xccb0d1={'format':'A4','border':'10px','header':{'height':_0x4e5d('0xc2'),'contents':{'first':_0x4e5d('0xc3')}},'footer':{'height':_0x4e5d('0xc4'),'contents':{'default':util[_0x4e5d('0x51')](_0x4e5d('0xc5'),util[_0x4e5d('0x51')](_0x4e5d('0xc6'),_0x4e5d('0xc7'),_0x1fd08a['id']),moment()[_0x4e5d('0x51')](_0x4e5d('0xc8'))[_0x4e5d('0x73')]())}}};fs[_0x4e5d('0xc9')](_0x5d887d);var _0x2e76e0={'channel':_0x4e5d('0xc7'),'account':_0x1fd08a['Account']['name'],'agent':_0x1fd08a[_0x4e5d('0xc1')]?_0x1fd08a[_0x4e5d('0xc1')]['fullname']:_0x4e5d('0xca'),'createdAt':moment(_0x1fd08a[_0x4e5d('0x4d')])[_0x4e5d('0x51')](_0x4e5d('0xa7'))['toString'](),'closedAt':_0x1fd08a[_0x4e5d('0xcb')]?moment(_0x1fd08a[_0x4e5d('0xcc')])[_0x4e5d('0x51')](_0x4e5d('0xa7'))[_0x4e5d('0x73')]():'','disposition':_0x1fd08a[_0x4e5d('0xcd')],'visibility':_0x1fd08a[_0x4e5d('0xce')]?_0x4e5d('0xcf'):_0x4e5d('0xd0'),'messages':_(_0x1fd08a[_0x4e5d('0xb8')])[_0x4e5d('0x66')]({'secret':![]})[_0x4e5d('0x64')](function(_0x16090d){if(_0x16090d[_0x4e5d('0xbe')]){var _0x59dfce=path['join'](_0x53bce9,_0x16090d[_0x4e5d('0xbe')]['basename']);if(fs[_0x4e5d('0xd1')](_0x59dfce)){fs['createReadStream'](_0x59dfce)['pipe'](fs[_0x4e5d('0xd2')](path[_0x4e5d('0x74')](_0x5d887d,_0x16090d[_0x4e5d('0xbe')][_0x4e5d('0xd3')])));}}return{'date':moment(_0x16090d[_0x4e5d('0x4d')])[_0x4e5d('0x51')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x16090d[_0x4e5d('0xb9')]===_0x4e5d('0xd4')?_0x16090d[_0x4e5d('0xba')]?_0x16090d[_0x4e5d('0xba')]['fullname']:_0x4e5d('0xd5'):_0x16090d['Contact'][_0x4e5d('0xbc')]+(_0x16090d[_0x4e5d('0xbb')][_0x4e5d('0xbd')]?'\x20'+_0x16090d['Contact']['lastName']:''),'body':_0x16090d[_0x4e5d('0xbe')]?_0x16090d[_0x4e5d('0xbe')][_0x4e5d('0xd3')]:_0x16090d[_0x4e5d('0x9f')],'direction':_0x16090d[_0x4e5d('0xb9')]===_0x4e5d('0xd4')?'A':'C','secret':_0x16090d['secret'],'attachment':_0x16090d['Attachment']};})[_0x4e5d('0x4e')]()};return ejs[_0x4e5d('0xd6')](path[_0x4e5d('0x74')](config['root'],'server','views',_0x4e5d('0xd7')),{'interaction':_0x2e76e0})[_0x4e5d('0x25')](function(_0x3be30f){return new BPromise(function(_0x5c0cdd,_0x3d5ce5){pdf[_0x4e5d('0xd8')](_0x3be30f,_0xccb0d1)['toFile'](path[_0x4e5d('0x74')](_0x5d887d,_0x4e5d('0xd9')+_0x1fd08a['id']+'-'+_0x42340a+'.pdf'),function(_0x15c5cc,_0x1f7109){if(_0x15c5cc)return _0x3d5ce5(_0x15c5cc);_0x5c0cdd(_0x1f7109);});});});}})['then'](function(){if(_0x13c596){return new BPromise(function(_0x35669f,_0x378d7e){zipdir(_0x5d887d,{'saveTo':_0x445ad1},function(_0x2df4e7,_0x22a04d){if(_0x2df4e7)return _0x378d7e(_0x2df4e7);return _0x35669f(_0x22a04d);});})[_0x4e5d('0x25')](function(){return new BPromise(function(_0x5a8bd9,_0xd6de){rimraf(_0x5d887d,function(_0x4934e3){if(_0x4934e3)_0xd6de(_0x4934e3);return _0x5a8bd9();});});})[_0x4e5d('0x25')](function(){return _0x1a3b9f[_0x4e5d('0xb1')](_0x445ad1,_0x4349e6,function(_0x2fcfc4){if(_0x2fcfc4){console[_0x4e5d('0xda')](_0x4e5d('0xdb'),_0x2fcfc4);}else{fs[_0x4e5d('0xdc')](_0x445ad1);}});});}else{return _0x1a3b9f[_0x4e5d('0x19')](0xc8);}})[_0x4e5d('0x9b')](handleError(_0x1a3b9f,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index acbe0cf..17a7149 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 _0x88bb=['remove','emit','hasOwnProperty','exports','events','OpenchannelInteraction','setMaxListeners'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x88bb,0xeb));var _0xb88b=function(_0x180b1e,_0x239a70){_0x180b1e=_0x180b1e-0x0;var _0x405198=_0x88bb[_0x180b1e];return _0x405198;};'use strict';var EventEmitter=require(_0xb88b('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xb88b('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb88b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb88b('0x3')};function emitEvent(_0x4002fb){return function(_0x50abfc,_0x12576e,_0x4be0c4){OpenchannelInteractionEvents['emit'](_0x4002fb+':'+_0x50abfc['id'],_0x50abfc);OpenchannelInteractionEvents[_0xb88b('0x4')](_0x4002fb,_0x50abfc);_0x4be0c4(null);};}for(var e in events){if(events[_0xb88b('0x5')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb88b('0x6')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2941=['events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','emit','hook'];(function(_0x13feab,_0x4a2ff5){var _0x3cdec2=function(_0x1685a8){while(--_0x1685a8){_0x13feab['push'](_0x13feab['shift']());}};_0x3cdec2(++_0x4a2ff5);}(_0x2941,0x157));var _0x1294=function(_0xf0d35,_0xce9c1c){_0xf0d35=_0xf0d35-0x0;var _0x5ba3bc=_0x2941[_0xf0d35];return _0x5ba3bc;};'use strict';var EventEmitter=require(_0x1294('0x0'));var OpenchannelInteraction=require(_0x1294('0x1'))['db'][_0x1294('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1294('0x3')](0x0);var events={'afterCreate':_0x1294('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x999394){return function(_0x2364cc,_0x42d400,_0x35da8d){OpenchannelInteractionEvents[_0x1294('0x5')](_0x999394+':'+_0x2364cc['id'],_0x2364cc);OpenchannelInteractionEvents[_0x1294('0x5')](_0x999394,_0x2364cc);_0x35da8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x1294('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5010bc8..550a67e 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 _0xa4fb=['define','OpenchannelInteraction','openchannel_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','./openchannelInteraction.attributes','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa4fb,0x150));var _0xba4f=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0xa4fb[_0x5ac0f0];return _0x4aceec;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var logger=require(_0xba4f('0x2'))(_0xba4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba4f('0x4'));var fs=require('fs');var path=require(_0xba4f('0x5'));var rimraf=require(_0xba4f('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4f('0x7'));module[_0xba4f('0x8')]=function(_0x379b0f,_0x18baa8){return _0x379b0f[_0xba4f('0x9')](_0xba4f('0xa'),attributes,{'tableName':_0xba4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1af837,_0x399847,_0x27f65a){if(_0x1af837['changed'](_0xba4f('0xc'))){_0x1af837['closedAt']=moment()[_0xba4f('0xd')](_0xba4f('0xe'));}_0x27f65a(null,_0x1af837);}}});}; \ No newline at end of file +var _0x47c7=['./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x361ff5,_0x40bda2){var _0x107799=function(_0xf3a0e2){while(--_0xf3a0e2){_0x361ff5['push'](_0x361ff5['shift']());}};_0x107799(++_0x40bda2);}(_0x47c7,0x1ab));var _0x747c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x47c7[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10b9f0,_0x21e0f1,_0x363db1){if(_0x10b9f0['changed']('closed')){_0x10b9f0[_0x747c('0xb')]=moment()[_0x747c('0xc')](_0x747c('0xd'));}_0x363db1(null,_0x10b9f0);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c65617d..1b7482b 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 _0x8958=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8958,0x93));var _0x8895=function(_0x473db6,_0x12398){_0x473db6=_0x473db6-0x0;var _0x203e57=_0x8958[_0x473db6];return _0x203e57;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});config[_0x8895('0x7')]=_[_0x8895('0x8')](config[_0x8895('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8895('0x9'))(new Redis(config[_0x8895('0x7')]));require(_0x8895('0xa'))[_0x8895('0xb')](socket);function respondWithRpcPromise(_0x6eab1e,_0x29c126,_0x22a12b){return new BPromise(function(_0xdb3d59,_0x46c467){return client[_0x8895('0xc')](_0x6eab1e,_0x22a12b)['then'](function(_0x1cf600){logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));logger[_0x8895('0x10')](_0x8895('0x11'),_0x29c126,'request\x20sent',JSON[_0x8895('0x12')](_0x1cf600));if(_0x1cf600[_0x8895('0x13')]){if(_0x1cf600[_0x8895('0x13')]['code']===0x1f4){logger['error'](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0x46c467(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0xdb3d59(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}else{logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));_0xdb3d59(_0x1cf600[_0x8895('0x15')][_0x8895('0x14')]);}})[_0x8895('0x16')](function(_0x2da618){logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x2da618);_0x46c467(_0x2da618);});});}exports[_0x8895('0x17')]=function(_0x54e6d4){var _0x522a4e=this;return new Promise(function(_0x4fcbc3,_0x3daf43){return db[_0x8895('0x18')][_0x8895('0x19')](_0x54e6d4[_0x8895('0x1a')],{'raw':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4[_0x8895('0x1b')][_0x8895('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4['options'][_0x8895('0x1d')]||null:null,'attributes':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4[_0x8895('0x1b')][_0x8895('0x1e')]||null:null,'limit':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4['options']['limit']||null:null})[_0x8895('0x1f')](function(_0x398382){logger[_0x8895('0xd')](_0x8895('0x17'),_0x54e6d4);logger['debug'](_0x8895('0x17'),_0x54e6d4,JSON[_0x8895('0x12')](_0x398382));_0x4fcbc3(_0x398382);})[_0x8895('0x16')](function(_0x5486a6){logger['error'](_0x8895('0x17'),_0x5486a6['message'],_0x54e6d4);_0x3daf43(_0x522a4e[_0x8895('0x13')](0x1f4,_0x5486a6[_0x8895('0x14')]));});});};exports[_0x8895('0x20')]=function(_0xf5fb66){return new Promise(function(_0x153220,_0x5c03ea){return db['OpenchannelInteraction'][_0x8895('0x21')]({'where':_0xf5fb66[_0x8895('0x1b')]?_0xf5fb66[_0x8895('0x1b')][_0x8895('0x1d')]||null:null})[_0x8895('0x1f')](function(_0x560b93){if(_0x560b93){return _0x560b93['addTags'](_0xf5fb66[_0x8895('0x1a')][_0x8895('0x22')],_[_0x8895('0x23')](_0xf5fb66[_0x8895('0x1a')],[_0x8895('0x22'),'id'])||{});}})['spread'](function(_0x1da939){logger['info'](_0x8895('0x24'),_0xf5fb66);logger['debug'](_0x8895('0x24'),_0xf5fb66,JSON[_0x8895('0x12')](_0x1da939));_0x153220(_0x1da939);})[_0x8895('0x16')](function(_0x3e71fa){logger[_0x8895('0x13')]('AddTags',_0x3e71fa[_0x8895('0x14')],_0xf5fb66);_0x5c03ea(_this[_0x8895('0x13')](0x1f4,_0x3e71fa[_0x8895('0x14')]));});});}; \ No newline at end of file +var _0xb091=['../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','info','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','ids','omit','AddTags','util','moment','bluebird','randomstring'];(function(_0x4c22be,_0x339703){var _0x42c033=function(_0x4944fb){while(--_0x4944fb){_0x4c22be['push'](_0x4c22be['shift']());}};_0x42c033(++_0x339703);}(_0xb091,0x16e));var _0x1b09=function(_0x1de7a1,_0x5b5a17){_0x1de7a1=_0x1de7a1-0x0;var _0x55ef3c=_0xb091[_0x1de7a1];return _0x55ef3c;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});config[_0x1b09('0x9')]=_['defaults'](config[_0x1b09('0x9')],{'host':_0x1b09('0xa'),'port':0x18eb});var socket=require(_0x1b09('0xb'))(new Redis(config[_0x1b09('0x9')]));require(_0x1b09('0xc'))[_0x1b09('0xd')](socket);function respondWithRpcPromise(_0x211f05,_0x124d02,_0x3249a1){return new BPromise(function(_0x36aa1b,_0x14dac6){return client['request'](_0x211f05,_0x3249a1)[_0x1b09('0xe')](function(_0x894b73){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x124d02,_0x1b09('0xf'));logger[_0x1b09('0x10')](_0x1b09('0x11'),_0x124d02,_0x1b09('0xf'),JSON[_0x1b09('0x12')](_0x894b73));if(_0x894b73[_0x1b09('0x13')]){if(_0x894b73[_0x1b09('0x13')]['code']===0x1f4){logger[_0x1b09('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x14dac6(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}logger[_0x1b09('0x13')](_0x1b09('0x15'),_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x36aa1b(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}else{logger[_0x1b09('0x16')](_0x1b09('0x15'),_0x124d02,_0x1b09('0xf'));_0x36aa1b(_0x894b73['result'][_0x1b09('0x14')]);}})[_0x1b09('0x17')](function(_0x5483ef){logger['error'](_0x1b09('0x15'),_0x124d02,_0x5483ef);_0x14dac6(_0x5483ef);});});}exports['UpdateOpenchannelInteraction']=function(_0x267b5e){var _0x5bb127=this;return new Promise(function(_0x136697,_0x4b2eab){return db[_0x1b09('0x18')][_0x1b09('0x19')](_0x267b5e[_0x1b09('0x1a')],{'raw':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e[_0x1b09('0x1b')][_0x1b09('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x267b5e['options']?_0x267b5e['options'][_0x1b09('0x1d')]||null:null,'attributes':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e['options'][_0x1b09('0x1e')]||null:null,'limit':_0x267b5e[_0x1b09('0x1b')]?_0x267b5e[_0x1b09('0x1b')][_0x1b09('0x1f')]||null:null})['then'](function(_0xe0d931){logger[_0x1b09('0x16')]('UpdateOpenchannelInteraction',_0x267b5e);logger[_0x1b09('0x10')](_0x1b09('0x20'),_0x267b5e,JSON['stringify'](_0xe0d931));_0x136697(_0xe0d931);})[_0x1b09('0x17')](function(_0x108d80){logger[_0x1b09('0x13')](_0x1b09('0x20'),_0x108d80['message'],_0x267b5e);_0x4b2eab(_0x5bb127[_0x1b09('0x13')](0x1f4,_0x108d80[_0x1b09('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2d1ec0){return new Promise(function(_0x406748,_0x26befb){return db[_0x1b09('0x18')][_0x1b09('0x21')]({'where':_0x2d1ec0[_0x1b09('0x1b')]?_0x2d1ec0[_0x1b09('0x1b')]['where']||null:null})[_0x1b09('0xe')](function(_0x3e6a4d){if(_0x3e6a4d){return _0x3e6a4d['addTags'](_0x2d1ec0[_0x1b09('0x1a')][_0x1b09('0x22')],_[_0x1b09('0x23')](_0x2d1ec0[_0x1b09('0x1a')],[_0x1b09('0x22'),'id'])||{});}})['spread'](function(_0x4540de){logger['info'](_0x1b09('0x24'),_0x2d1ec0);logger['debug'](_0x1b09('0x24'),_0x2d1ec0,JSON[_0x1b09('0x12')](_0x4540de));_0x406748(_0x4540de);})[_0x1b09('0x17')](function(_0x2cf3cb){logger[_0x1b09('0x13')](_0x1b09('0x24'),_0x2cf3cb[_0x1b09('0x14')],_0x2d1ec0);_0x26befb(_this[_0x1b09('0x13')](0x1f4,_0x2cf3cb[_0x1b09('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a3a4c04..3ed2885 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 _0x2ae8=['emit','length','openchannelInteraction:','remove','update'];(function(_0x2e2973,_0x54dba4){var _0x21797c=function(_0x1c786d){while(--_0x1c786d){_0x2e2973['push'](_0x2e2973['shift']());}};_0x21797c(++_0x54dba4);}(_0x2ae8,0xe9));var _0x82ae=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2ae8[_0x178e48];return _0x440d7e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x82ae('0x0'),_0x82ae('0x1')];function createListener(_0x46da09,_0x59fa43){return function(_0x33f03a){_0x59fa43[_0x82ae('0x2')](_0x46da09,_0x33f03a);};}function removeListener(_0x4210ee,_0x1d250d){return function(){OpenchannelInteractionEvents['removeListener'](_0x4210ee,_0x1d250d);};}exports['register']=function(_0x409022){for(var _0x3a1b64=0x0,_0x71e8b8=events[_0x82ae('0x3')];_0x3a1b64<_0x71e8b8;_0x3a1b64++){var _0x281dde=events[_0x3a1b64];var _0x534c7a=createListener(_0x82ae('0x4')+_0x281dde,_0x409022);OpenchannelInteractionEvents['on'](_0x281dde,_0x534c7a);}}; \ No newline at end of file +var _0xacc8=['./openchannelInteraction.events','save','remove','update','removeListener','register','length','openchannelInteraction:'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xacc8,0x70));var _0x8acc=function(_0x407604,_0x58f902){_0x407604=_0x407604-0x0;var _0x2da97a=_0xacc8[_0x407604];return _0x2da97a;};'use strict';var OpenchannelInteractionEvents=require(_0x8acc('0x0'));var events=[_0x8acc('0x1'),_0x8acc('0x2'),_0x8acc('0x3')];function createListener(_0x55bbce,_0x50ee9a){return function(_0x151799){_0x50ee9a['emit'](_0x55bbce,_0x151799);};}function removeListener(_0x4a979d,_0x4920e1){return function(){OpenchannelInteractionEvents[_0x8acc('0x4')](_0x4a979d,_0x4920e1);};}exports[_0x8acc('0x5')]=function(_0x2b0ab6){for(var _0x51ed95=0x0,_0x275c5d=events[_0x8acc('0x6')];_0x51ed95<_0x275c5d;_0x51ed95++){var _0x3a8a99=events[_0x51ed95];var _0x528740=createListener(_0x8acc('0x7')+_0x3a8a99,_0x2b0ab6);OpenchannelInteractionEvents['on'](_0x3a8a99,_0x528740);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 44577ab..d207439 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 _0x4d7f=['get','index','/describe','describe','isAuthenticated','show','post','tracked','openchannel','openchannelmessage:create','create','put','/:id','accept','/:id/reject','reject','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xdca99a,_0x5c2571){var _0x31067e=function(_0xdc45fc){while(--_0xdc45fc){_0xdca99a['push'](_0xdca99a['shift']());}};_0x31067e(++_0x5c2571);}(_0x4d7f,0xc1));var _0xf4d7=function(_0x4e4ff8,_0x5c87e4){_0x4e4ff8=_0x4e4ff8-0x0;var _0xb41118=_0x4d7f[_0x4e4ff8];return _0xb41118;};'use strict';var multer=require(_0xf4d7('0x0'));var util=require('util');var path=require(_0xf4d7('0x1'));var timeout=require('connect-timeout');var express=require(_0xf4d7('0x2'));var router=express[_0xf4d7('0x3')]();var auth=require(_0xf4d7('0x4'));var interaction=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var controller=require('./openchannelMessage.controller');router[_0xf4d7('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4d7('0x8')]);router[_0xf4d7('0x7')](_0xf4d7('0x9'),auth['isAuthenticated'](),controller[_0xf4d7('0xa')]);router[_0xf4d7('0x7')]('/:id',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0xc')]);router[_0xf4d7('0xd')]('/',auth['isAuthenticated'](),interaction[_0xf4d7('0xe')](_0xf4d7('0xf'),_0xf4d7('0x10')),controller[_0xf4d7('0x11')]);router[_0xf4d7('0x12')](_0xf4d7('0x13'),auth[_0xf4d7('0xb')](),controller['update']);router[_0xf4d7('0x12')]('/:id/accept',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x14')]);router[_0xf4d7('0x12')](_0xf4d7('0x15'),auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x16')]);router['delete']('/:id',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x17')]);module[_0xf4d7('0x18')]=router; \ No newline at end of file +var _0x83f3=['index','/describe','describe','show','tracked','openchannel','openchannelmessage:create','put','/:id','update','/:id/accept','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x49bf94,_0x1b48c7){var _0x88831d=function(_0x555f68){while(--_0x555f68){_0x49bf94['push'](_0x49bf94['shift']());}};_0x88831d(++_0x1b48c7);}(_0x83f3,0x15d));var _0x383f=function(_0x58af0e,_0x5f544f){_0x58af0e=_0x58af0e-0x0;var _0x36d3b0=_0x83f3[_0x58af0e];return _0x36d3b0;};'use strict';var multer=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var path=require(_0x383f('0x2'));var timeout=require(_0x383f('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x383f('0x4'));var config=require(_0x383f('0x5'));var controller=require('./openchannelMessage.controller');router[_0x383f('0x6')]('/',auth[_0x383f('0x7')](),controller[_0x383f('0x8')]);router[_0x383f('0x6')](_0x383f('0x9'),auth[_0x383f('0x7')](),controller[_0x383f('0xa')]);router[_0x383f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x383f('0xb')]);router['post']('/',auth[_0x383f('0x7')](),interaction[_0x383f('0xc')](_0x383f('0xd'),_0x383f('0xe')),controller['create']);router[_0x383f('0xf')](_0x383f('0x10'),auth[_0x383f('0x7')](),controller[_0x383f('0x11')]);router[_0x383f('0xf')](_0x383f('0x12'),auth[_0x383f('0x7')](),controller['accept']);router[_0x383f('0xf')]('/:id/reject',auth[_0x383f('0x7')](),controller['reject']);router[_0x383f('0x13')](_0x383f('0x10'),auth['isAuthenticated'](),controller[_0x383f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index b4a21ce..6b9c29a 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 _0x44a9=['out','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x44a9,0x8c));var _0x944a=function(_0x5b3423,_0x74e895){_0x5b3423=_0x5b3423-0x0;var _0x56a8ec=_0x44a9[_0x5b3423];return _0x56a8ec;};'use strict';var Sequelize=require('sequelize');module[_0x944a('0x0')]={'body':{'type':Sequelize[_0x944a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x944a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x944a('0x3')]('in','out'),'defaultValue':_0x944a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x944a('0x5')]}}; \ No newline at end of file +var _0x007d=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x9315ee,_0x16e94a){var _0x5543eb=function(_0x1e094c){while(--_0x1e094c){_0x9315ee['push'](_0x9315ee['shift']());}};_0x5543eb(++_0x16e94a);}(_0x007d,0xb5));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd007('0x0'));module['exports']={'body':{'type':Sequelize[_0xd007('0x1')](_0xd007('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd007('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd007('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd007('0x4')]('in',_0xd007('0x5')),'defaultValue':_0xd007('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd007('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c93131e..e32ccef 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 _0x7796=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','update','find','describe','accept','openchannel','read','readAt','format','UserId','user','CmContact','OpenchannelInteractionId','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','OpenchannelInteraction','get','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','http','client','test','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','destroy','end','stack','name','send','index','OpenchannelMessage','rawAttributes','model','keys'];(function(_0x17cb36,_0x3cfc3e){var _0x3ae236=function(_0x47530f){while(--_0x47530f){_0x17cb36['push'](_0x17cb36['shift']());}};_0x3ae236(++_0x3cfc3e);}(_0x7796,0x11f));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6779('0x0'));var rimraf=require(_0x6779('0x1'));var zipdir=require(_0x6779('0x2'));var jsonpatch=require(_0x6779('0x3'));var rp=require(_0x6779('0x4'));var moment=require('moment');var BPromise=require(_0x6779('0x5'));var Mustache=require('mustache');var util=require(_0x6779('0x6'));var path=require(_0x6779('0x7'));var sox=require(_0x6779('0x8'));var csv=require('to-csv');var ejs=require(_0x6779('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6779('0xa'));var jsforce=require(_0x6779('0xb'));var deskjs=require(_0x6779('0xc'));var toCsv=require(_0x6779('0xd'));var querystring=require(_0x6779('0xe'));var Papa=require('papaparse');var Redis=require(_0x6779('0xf'));var authService=require(_0x6779('0x10'));var qs=require(_0x6779('0x11'));var hardwareService=require(_0x6779('0x12'));var logger=require(_0x6779('0x13'))(_0x6779('0x14'));var utils=require(_0x6779('0x15'));var config=require(_0x6779('0x16'));var db=require(_0x6779('0x17'))['db'];config[_0x6779('0x18')]=_[_0x6779('0x19')](config[_0x6779('0x18')],{'host':_0x6779('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x6779('0x1b'));var client=jayson['client'][_0x6779('0x1c')]({'port':0x232c});var client9002=jayson[_0x6779('0x1d')][_0x6779('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2e2669,_0x37b6c4,_0x2687f8){if(_0x2687f8){var _0x5a68aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a68aa[_0x6779('0x1e')](_0x37b6c4)){return _0x2e2669;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2e2669;}}function respondWithRpcPromise(_0x17e3c8,_0x956783,_0x40b728,_0x3b98e1){return new BPromise(function(_0x54e278,_0x48d1c8){var _0x527cd4=_0x3b98e1||client;return _0x527cd4[_0x6779('0x1f')](_0x17e3c8,_0x40b728)[_0x6779('0x20')](function(_0x5b8211){logger['info'](_0x6779('0x21'),_0x956783,_0x6779('0x22'));logger[_0x6779('0x23')](_0x6779('0x24'),_0x956783,_0x6779('0x22'),JSON[_0x6779('0x25')](_0x5b8211));if(_0x5b8211[_0x6779('0x26')]){if(_0x5b8211[_0x6779('0x26')][_0x6779('0x27')]===0x1f4){logger['error'](_0x6779('0x21'),_0x956783,_0x5b8211['error'][_0x6779('0x28')]);return _0x48d1c8(_0x5b8211[_0x6779('0x26')][_0x6779('0x28')]);}logger[_0x6779('0x26')](_0x6779('0x21'),_0x956783,_0x5b8211[_0x6779('0x26')][_0x6779('0x28')]);return _0x54e278(_0x5b8211['error'][_0x6779('0x28')]);}else{logger[_0x6779('0x29')](_0x6779('0x21'),_0x956783,_0x6779('0x22'));_0x54e278(_0x5b8211[_0x6779('0x2a')][_0x6779('0x28')]);}})[_0x6779('0x2b')](function(_0x50e49d){logger['error'](_0x6779('0x21'),_0x956783,_0x50e49d);_0x48d1c8(_0x50e49d);});});}function respondWithStatusCode(_0x4f734f,_0x730ee5){_0x730ee5=_0x730ee5||0xcc;return function(_0xe0965a){if(_0xe0965a){return _0x4f734f[_0x6779('0x2c')](_0x730ee5);}return _0x4f734f[_0x6779('0x2d')](_0x730ee5)['end']();};}function respondWithResult(_0x446d1a,_0x13de81){_0x13de81=_0x13de81||0xc8;return function(_0x55899a){if(_0x55899a){return _0x446d1a[_0x6779('0x2d')](_0x13de81)[_0x6779('0x2e')](_0x55899a);}};}function respondWithFilteredResult(_0x4cf3d0,_0x2ac766){return function(_0x1eab1c){if(_0x1eab1c){var _0x7b3379=_0x1eab1c[_0x6779('0x2f')],_0x47a845=_0x2ac766[_0x6779('0x30')],_0x4186fc=_0x2ac766['offset']+_0x2ac766[_0x6779('0x31')],_0x26870c;if(_0x4186fc>=_0x7b3379){_0x4186fc=_0x7b3379;_0x26870c=0xc8;}else{_0x26870c=0xce;}_0x4cf3d0[_0x6779('0x2d')](_0x26870c);return _0x4cf3d0[_0x6779('0x32')]('Content-Range',_0x47a845+'-'+_0x4186fc+'/'+_0x7b3379)[_0x6779('0x2e')](_0x1eab1c);}return null;};}function patchUpdates(_0x2f8bb9){return function(_0xec9a1){try{jsonpatch[_0x6779('0x33')](_0xec9a1,_0x2f8bb9,!![]);}catch(_0x2719f4){return BPromise[_0x6779('0x34')](_0x2719f4);}return _0xec9a1[_0x6779('0x35')]();};}function saveUpdates(_0x386507,_0x3dbb6f){return function(_0x46e9f2){if(_0x46e9f2){return _0x46e9f2['update'](_0x386507)[_0x6779('0x20')](function(_0x11b4db){return _0x11b4db;});}return null;};}function removeEntity(_0x43efb1,_0x3b01a0){return function(_0x35882b){if(_0x35882b){return _0x35882b[_0x6779('0x36')]()['then'](function(){_0x43efb1[_0x6779('0x2d')](0xcc)[_0x6779('0x37')]();});}};}function handleEntityNotFound(_0x551252,_0x142acf){return function(_0x333c0f){if(!_0x333c0f){_0x551252[_0x6779('0x2c')](0x194);}return _0x333c0f;};}function handleError(_0x20a40d,_0x53c98a){_0x53c98a=_0x53c98a||0x1f4;return function(_0x49c16c){logger[_0x6779('0x26')](_0x49c16c[_0x6779('0x38')]);if(_0x49c16c[_0x6779('0x39')]){delete _0x49c16c['name'];}_0x20a40d[_0x6779('0x2d')](_0x53c98a)[_0x6779('0x3a')](_0x49c16c);};}exports[_0x6779('0x3b')]=function(_0x1b6d0b,_0x39d5be){var _0xe20a27={},_0x4266ba={},_0x5cdb63={'count':0x0,'rows':[]};var _0x5930e9=db[_0x6779('0x3c')][_0x6779('0x3d')];_0x4266ba[_0x6779('0x3e')]=_[_0x6779('0x3f')](_0x5930e9);_0x4266ba[_0x6779('0x40')]=_[_0x6779('0x3f')](_0x1b6d0b['query']);_0x4266ba[_0x6779('0x41')]=_[_0x6779('0x42')](_0x4266ba[_0x6779('0x3e')],_0x4266ba[_0x6779('0x40')]);_0xe20a27[_0x6779('0x43')]=_[_0x6779('0x42')](_0x4266ba[_0x6779('0x3e')],qs['fields'](_0x1b6d0b[_0x6779('0x40')][_0x6779('0x44')]));_0xe20a27[_0x6779('0x43')]=_0xe20a27[_0x6779('0x43')][_0x6779('0x45')]?_0xe20a27[_0x6779('0x43')]:_0x4266ba['model'];if(!_0x1b6d0b[_0x6779('0x40')]['hasOwnProperty'](_0x6779('0x46'))){_0xe20a27[_0x6779('0x31')]=qs['limit'](_0x1b6d0b['query'][_0x6779('0x31')]);_0xe20a27[_0x6779('0x30')]=qs[_0x6779('0x30')](_0x1b6d0b[_0x6779('0x40')][_0x6779('0x30')]);}_0xe20a27['order']=qs[_0x6779('0x47')](_0x1b6d0b['query'][_0x6779('0x47')]);_0xe20a27[_0x6779('0x48')]=qs['filters'](_[_0x6779('0x49')](_0x1b6d0b[_0x6779('0x40')],_0x4266ba[_0x6779('0x41')]));if(_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4a')]){_0xe20a27[_0x6779('0x48')]=_[_0x6779('0x4b')](_0xe20a27[_0x6779('0x48')],{'$or':_['map'](_0x5930e9,function(_0x29f19c){if(_0x29f19c[_0x6779('0x4c')]['key']!==_0x6779('0x4d')){var _0x1c70af={};_0x1c70af[_0x29f19c['field']]={'$like':'%'+_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4a')]+'%'};return _0x1c70af;}})});}_0xe20a27=_[_0x6779('0x4b')]({},_0xe20a27,_0x1b6d0b[_0x6779('0x4e')]);var _0x5c177a={'where':_0xe20a27[_0x6779('0x48')]};return db['OpenchannelMessage'][_0x6779('0x2f')](_0x5c177a)[_0x6779('0x20')](function(_0x2109e4){_0x5cdb63[_0x6779('0x2f')]=_0x2109e4;if(_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4f')]){_0xe20a27[_0x6779('0x50')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6779('0x51')](_0xe20a27);})[_0x6779('0x20')](function(_0x714b1){_0x5cdb63['rows']=_0x714b1;return _0x5cdb63;})['then'](respondWithFilteredResult(_0x39d5be,_0xe20a27))[_0x6779('0x2b')](handleError(_0x39d5be,null));};exports[_0x6779('0x52')]=function(_0x300563,_0x57e125){var _0x4ccc7c={'raw':!![],'where':{'id':_0x300563[_0x6779('0x53')]['id']}},_0x417ebd={};_0x417ebd[_0x6779('0x3e')]=_['keys'](db[_0x6779('0x3c')][_0x6779('0x3d')]);_0x417ebd[_0x6779('0x40')]=_[_0x6779('0x3f')](_0x300563[_0x6779('0x40')]);_0x417ebd[_0x6779('0x41')]=_[_0x6779('0x42')](_0x417ebd[_0x6779('0x3e')],_0x417ebd[_0x6779('0x40')]);_0x4ccc7c[_0x6779('0x43')]=_[_0x6779('0x42')](_0x417ebd[_0x6779('0x3e')],qs[_0x6779('0x44')](_0x300563[_0x6779('0x40')][_0x6779('0x44')]));_0x4ccc7c['attributes']=_0x4ccc7c[_0x6779('0x43')][_0x6779('0x45')]?_0x4ccc7c[_0x6779('0x43')]:_0x417ebd[_0x6779('0x3e')];if(_0x300563[_0x6779('0x40')][_0x6779('0x4f')]){_0x4ccc7c[_0x6779('0x50')]=[{'all':!![]}];}_0x4ccc7c=_['merge']({},_0x4ccc7c,_0x300563[_0x6779('0x4e')]);return db['OpenchannelMessage']['find'](_0x4ccc7c)[_0x6779('0x20')](handleEntityNotFound(_0x57e125,null))[_0x6779('0x20')](respondWithResult(_0x57e125,null))[_0x6779('0x2b')](handleError(_0x57e125,null));};exports['create']=function(_0x154379,_0x1e67df){return db[_0x6779('0x3c')][_0x6779('0x54')](_0x154379[_0x6779('0x55')],{})[_0x6779('0x20')](respondWithResult(_0x1e67df,0xc9))[_0x6779('0x2b')](handleError(_0x1e67df,null));};exports[_0x6779('0x56')]=function(_0xbf1ebb,_0x172f0e){if(_0xbf1ebb[_0x6779('0x55')]['id']){delete _0xbf1ebb[_0x6779('0x55')]['id'];}return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0xbf1ebb[_0x6779('0x53')]['id']}})['then'](handleEntityNotFound(_0x172f0e,null))[_0x6779('0x20')](saveUpdates(_0xbf1ebb[_0x6779('0x55')],null))['then'](respondWithResult(_0x172f0e,null))[_0x6779('0x2b')](handleError(_0x172f0e,null));};exports[_0x6779('0x36')]=function(_0x2bdbe0,_0x3f9383){return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0x2bdbe0['params']['id']}})[_0x6779('0x20')](handleEntityNotFound(_0x3f9383,null))[_0x6779('0x20')](removeEntity(_0x3f9383,null))[_0x6779('0x2b')](handleError(_0x3f9383,null));};exports[_0x6779('0x58')]=function(_0x2c5cee,_0x484497){return db[_0x6779('0x3c')]['describe']()[_0x6779('0x20')](respondWithResult(_0x484497,null))[_0x6779('0x2b')](handleError(_0x484497,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x6779('0x59')]=function(_0x1e2e22,_0x562274,_0x27d220){var _0x416578={'channel':_0x6779('0x5a')};if(_0x1e2e22[_0x6779('0x55')]['id']){delete _0x1e2e22[_0x6779('0x55')]['id'];}_0x1e2e22[_0x6779('0x55')][_0x6779('0x5b')]=!![];_0x1e2e22[_0x6779('0x55')][_0x6779('0x5c')]=moment()[_0x6779('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e2e22[_0x6779('0x55')][_0x6779('0x5e')]=_0x1e2e22['body'][_0x6779('0x5e')]||_0x1e2e22[_0x6779('0x5f')]['id'];return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0x1e2e22[_0x6779('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x6779('0x60')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x562274,null))[_0x6779('0x20')](saveUpdates(_0x1e2e22[_0x6779('0x55')],null))[_0x6779('0x20')](function(_0x34f874){if(_0x34f874){_0x416578['message']=_0x34f874['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x6779('0x57')]({'where':{'id':_0x34f874[_0x6779('0x61')]}});}return null;})[_0x6779('0x20')](handleEntityNotFound(_0x562274,null))[_0x6779('0x20')](function(_0x1db6ba){if(_0x1db6ba){return _0x1db6ba[_0x6779('0x56')]({'UserId':_0x1e2e22[_0x6779('0x55')][_0x6779('0x5e')],'read1stAt':_['isNil'](_0x1db6ba['read1stAt'])?moment()[_0x6779('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6779('0x20')](function(_0x4187a2){if(_0x4187a2){_0x416578['interaction']=_0x4187a2['get']({'plain':!![]});interaction_log['info'](_0x6779('0x62'),_0x1e2e22[_0x6779('0x5f')]['id'],_0x1e2e22[_0x6779('0x5f')][_0x6779('0x39')],_0x1e2e22[_0x6779('0x5f')][_0x6779('0x63')],_0x416578[_0x6779('0x64')]['id'],_0x1e2e22[_0x6779('0x55')]?JSON[_0x6779('0x25')](_0x1e2e22[_0x6779('0x55')]):_0x6779('0x65'));return respondWithRpcPromise(_0x6779('0x66'),'acceptMessage',_0x416578);}return null;})['then'](function(_0x5324de){if(_0x5324de){if(_0x1e2e22['body'][_0x6779('0x67')]){_0x416578[_0x6779('0x28')][_0x6779('0x68')]=util['format'](_0x6779('0x69'),_0x1e2e22['user'][_0x6779('0x39')]);_0x416578[_0x6779('0x28')][_0x6779('0x6a')]=_0x416578[_0x6779('0x6a')];_0x416578[_0x6779('0x28')][_0x6779('0x6b')]='accept';return respondWithRpcPromise(_0x6779('0x6c'),_0x6779('0x6c'),{'event':_0x6779('0x6d'),'message':_0x416578[_0x6779('0x28')]},client9002)['then'](function(){return _0x416578;});}return _0x416578;}return null;})[_0x6779('0x20')](respondWithResult(_0x562274,null))[_0x6779('0x2b')](handleError(_0x562274,null));};var interaction_log=require(_0x6779('0x13'))(_0x6779('0x6e'));exports[_0x6779('0x34')]=function(_0x411dc3,_0x494a6a,_0x1f668d){var _0x3bdc49={'agent':{},'channel':_0x6779('0x5a')};if(_0x411dc3[_0x6779('0x55')]['id']){delete _0x411dc3['body']['id'];}_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')]=_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')]||_0x411dc3[_0x6779('0x5f')]['id'];_0x3bdc49[_0x6779('0x6f')]['id']=_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')];return db['OpenchannelMessage'][_0x6779('0x57')]({'where':{'id':_0x411dc3['params']['id'],'UserId':null}})[_0x6779('0x20')](handleEntityNotFound(_0x494a6a,null))[_0x6779('0x20')](function(_0x20692c){if(_0x20692c){_0x3bdc49[_0x6779('0x28')]=_0x20692c['get']({'plain':!![]});return db[_0x6779('0x70')][_0x6779('0x57')]({'where':{'id':_0x20692c[_0x6779('0x61')]}});}return null;})[_0x6779('0x20')](handleEntityNotFound(_0x494a6a,null))[_0x6779('0x20')](function(_0x555741){if(_0x555741){_0x3bdc49[_0x6779('0x64')]=_0x555741[_0x6779('0x71')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x411dc3['user']['id'],_0x411dc3[_0x6779('0x5f')][_0x6779('0x39')],_0x411dc3[_0x6779('0x5f')][_0x6779('0x63')],_0x3bdc49[_0x6779('0x64')]['id'],_0x411dc3[_0x6779('0x55')]?JSON['stringify'](_0x411dc3[_0x6779('0x55')]):_0x6779('0x65'));return respondWithRpcPromise(_0x6779('0x72'),_0x6779('0x73'),_0x3bdc49);}return null;})[_0x6779('0x20')](function(_0x3573a8){if(_0x3573a8){_0x3573a8[_0x6779('0x28')][_0x6779('0x68')]=util[_0x6779('0x5d')](_0x6779('0x69'),_0x411dc3['user']['name']);_0x3573a8['message'][_0x6779('0x6a')]=_0x3bdc49[_0x6779('0x6a')];_0x3573a8[_0x6779('0x28')]['event']=_0x6779('0x34');respondWithRpcPromise(_0x6779('0x6c'),_0x6779('0x6c'),{'event':_0x6779('0x74'),'message':_0x3573a8[_0x6779('0x28')]},client9002);return _0x3bdc49;}return null;})[_0x6779('0x20')](respondWithResult(_0x494a6a,null))[_0x6779('0x2b')](handleError(_0x494a6a,null));}; \ No newline at end of file +var _0xf84d=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','count','offset','limit','set','reject','save','update','destroy','end','sendStatus','stack','name','send','index','OpenchannelMessage','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','channel','event','EventManager','acceptmessage','openchannel','agent','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3cdec6,_0x29f82b){var _0x484f68=function(_0x3be51e){while(--_0x3be51e){_0x3cdec6['push'](_0x3cdec6['shift']());}};_0x484f68(++_0x29f82b);}(_0xf84d,0x161));var _0xdf84=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xf84d[_0x134d5e];return _0x1e166a;};'use strict';var pdf=require(_0xdf84('0x0'));var emlformat=require(_0xdf84('0x1'));var rimraf=require(_0xdf84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdf84('0x3'));var moment=require(_0xdf84('0x4'));var BPromise=require(_0xdf84('0x5'));var Mustache=require('mustache');var util=require(_0xdf84('0x6'));var path=require(_0xdf84('0x7'));var sox=require(_0xdf84('0x8'));var csv=require(_0xdf84('0x9'));var ejs=require(_0xdf84('0xa'));var fs=require('fs');var _=require(_0xdf84('0xb'));var squel=require(_0xdf84('0xc'));var crypto=require(_0xdf84('0xd'));var jsforce=require(_0xdf84('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf84('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf84('0xf'));var authService=require(_0xdf84('0x10'));var qs=require(_0xdf84('0x11'));var hardwareService=require(_0xdf84('0x12'));var logger=require(_0xdf84('0x13'))(_0xdf84('0x14'));var utils=require(_0xdf84('0x15'));var config=require(_0xdf84('0x16'));var db=require(_0xdf84('0x17'))['db'];config[_0xdf84('0x18')]=_[_0xdf84('0x19')](config['redis'],{'host':_0xdf84('0x1a'),'port':0x18eb});var socket=require(_0xdf84('0x1b'))(new Redis(config['redis']));require(_0xdf84('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xdf84('0x1d')][_0xdf84('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4719f3,_0x471a1a,_0x4ec05e){if(_0x4ec05e){var _0xc4e002=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc4e002[_0xdf84('0x1f')](_0x471a1a)){return _0x4719f3;}else{throw new Error(_0xdf84('0x20'));}}else{return _0x4719f3;}}function respondWithRpcPromise(_0x266b70,_0x1b6f90,_0x50a2c1,_0x4874ae){return new BPromise(function(_0x3acbaf,_0x50b896){var _0x58956d=_0x4874ae||client;return _0x58956d[_0xdf84('0x21')](_0x266b70,_0x50a2c1)[_0xdf84('0x22')](function(_0x1be124){logger[_0xdf84('0x23')](_0xdf84('0x24'),_0x1b6f90,'request\x20sent');logger['debug'](_0xdf84('0x25'),_0x1b6f90,'request\x20sent',JSON[_0xdf84('0x26')](_0x1be124));if(_0x1be124[_0xdf84('0x27')]){if(_0x1be124[_0xdf84('0x27')][_0xdf84('0x28')]===0x1f4){logger[_0xdf84('0x27')](_0xdf84('0x24'),_0x1b6f90,_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);return _0x50b896(_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);}logger['error'](_0xdf84('0x24'),_0x1b6f90,_0x1be124[_0xdf84('0x27')][_0xdf84('0x29')]);return _0x3acbaf(_0x1be124[_0xdf84('0x27')]['message']);}else{logger[_0xdf84('0x23')](_0xdf84('0x24'),_0x1b6f90,_0xdf84('0x2a'));_0x3acbaf(_0x1be124[_0xdf84('0x2b')][_0xdf84('0x29')]);}})[_0xdf84('0x2c')](function(_0x7a4ca8){logger[_0xdf84('0x27')](_0xdf84('0x24'),_0x1b6f90,_0x7a4ca8);_0x50b896(_0x7a4ca8);});});}function respondWithStatusCode(_0x23170c,_0x53a757){_0x53a757=_0x53a757||0xcc;return function(_0x163411){if(_0x163411){return _0x23170c['sendStatus'](_0x53a757);}return _0x23170c[_0xdf84('0x2d')](_0x53a757)['end']();};}function respondWithResult(_0x575416,_0x7ff5da){_0x7ff5da=_0x7ff5da||0xc8;return function(_0x597e86){if(_0x597e86){return _0x575416[_0xdf84('0x2d')](_0x7ff5da)[_0xdf84('0x2e')](_0x597e86);}};}function respondWithFilteredResult(_0x3cdc64,_0x546996){return function(_0x4a8903){if(_0x4a8903){var _0x2c15a9=_0x4a8903[_0xdf84('0x2f')],_0x8e0487=_0x546996[_0xdf84('0x30')],_0x2874e0=_0x546996[_0xdf84('0x30')]+_0x546996[_0xdf84('0x31')],_0x5bba5f;if(_0x2874e0>=_0x2c15a9){_0x2874e0=_0x2c15a9;_0x5bba5f=0xc8;}else{_0x5bba5f=0xce;}_0x3cdc64[_0xdf84('0x2d')](_0x5bba5f);return _0x3cdc64[_0xdf84('0x32')]('Content-Range',_0x8e0487+'-'+_0x2874e0+'/'+_0x2c15a9)['json'](_0x4a8903);}return null;};}function patchUpdates(_0x328940){return function(_0x1257ff){try{jsonpatch['apply'](_0x1257ff,_0x328940,!![]);}catch(_0xd7b4d3){return BPromise[_0xdf84('0x33')](_0xd7b4d3);}return _0x1257ff[_0xdf84('0x34')]();};}function saveUpdates(_0x39d0af,_0x571009){return function(_0x5b8486){if(_0x5b8486){return _0x5b8486[_0xdf84('0x35')](_0x39d0af)[_0xdf84('0x22')](function(_0x1df0bc){return _0x1df0bc;});}return null;};}function removeEntity(_0x408043,_0x56a66d){return function(_0x14eab0){if(_0x14eab0){return _0x14eab0[_0xdf84('0x36')]()[_0xdf84('0x22')](function(){_0x408043[_0xdf84('0x2d')](0xcc)[_0xdf84('0x37')]();});}};}function handleEntityNotFound(_0x3e0f19,_0x339c22){return function(_0x506fac){if(!_0x506fac){_0x3e0f19[_0xdf84('0x38')](0x194);}return _0x506fac;};}function handleError(_0x430fc8,_0x33bc52){_0x33bc52=_0x33bc52||0x1f4;return function(_0x4be2f0){logger[_0xdf84('0x27')](_0x4be2f0[_0xdf84('0x39')]);if(_0x4be2f0[_0xdf84('0x3a')]){delete _0x4be2f0[_0xdf84('0x3a')];}_0x430fc8[_0xdf84('0x2d')](_0x33bc52)[_0xdf84('0x3b')](_0x4be2f0);};}exports[_0xdf84('0x3c')]=function(_0x69faf7,_0x332d60){var _0x48f40c={},_0x18feab={},_0x15e65b={'count':0x0,'rows':[]};var _0x54de4c=db[_0xdf84('0x3d')]['rawAttributes'];_0x18feab[_0xdf84('0x3e')]=_[_0xdf84('0x3f')](_0x54de4c);_0x18feab[_0xdf84('0x40')]=_[_0xdf84('0x3f')](_0x69faf7[_0xdf84('0x40')]);_0x18feab[_0xdf84('0x41')]=_[_0xdf84('0x42')](_0x18feab['model'],_0x18feab[_0xdf84('0x40')]);_0x48f40c[_0xdf84('0x43')]=_['intersection'](_0x18feab[_0xdf84('0x3e')],qs[_0xdf84('0x44')](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x44')]));_0x48f40c[_0xdf84('0x43')]=_0x48f40c['attributes'][_0xdf84('0x45')]?_0x48f40c['attributes']:_0x18feab[_0xdf84('0x3e')];if(!_0x69faf7[_0xdf84('0x40')]['hasOwnProperty'](_0xdf84('0x46'))){_0x48f40c[_0xdf84('0x31')]=qs[_0xdf84('0x31')](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x31')]);_0x48f40c[_0xdf84('0x30')]=qs[_0xdf84('0x30')](_0x69faf7[_0xdf84('0x40')]['offset']);}_0x48f40c[_0xdf84('0x47')]=qs['sort'](_0x69faf7[_0xdf84('0x40')][_0xdf84('0x48')]);_0x48f40c['where']=qs['filters'](_[_0xdf84('0x49')](_0x69faf7['query'],_0x18feab['filters']));if(_0x69faf7[_0xdf84('0x40')][_0xdf84('0x4a')]){_0x48f40c[_0xdf84('0x4b')]=_['merge'](_0x48f40c['where'],{'$or':_[_0xdf84('0x4c')](_0x54de4c,function(_0x486f1c){if(_0x486f1c[_0xdf84('0x4d')]['key']!==_0xdf84('0x4e')){var _0x3685a4={};_0x3685a4[_0x486f1c['field']]={'$like':'%'+_0x69faf7[_0xdf84('0x40')][_0xdf84('0x4a')]+'%'};return _0x3685a4;}})});}_0x48f40c=_[_0xdf84('0x4f')]({},_0x48f40c,_0x69faf7[_0xdf84('0x50')]);var _0x4edf1c={'where':_0x48f40c[_0xdf84('0x4b')]};return db[_0xdf84('0x3d')]['count'](_0x4edf1c)[_0xdf84('0x22')](function(_0x1264dc){_0x15e65b[_0xdf84('0x2f')]=_0x1264dc;if(_0x69faf7[_0xdf84('0x40')][_0xdf84('0x51')]){_0x48f40c[_0xdf84('0x52')]=[{'all':!![]}];}return db[_0xdf84('0x3d')][_0xdf84('0x53')](_0x48f40c);})['then'](function(_0x30f890){_0x15e65b[_0xdf84('0x54')]=_0x30f890;return _0x15e65b;})[_0xdf84('0x22')](respondWithFilteredResult(_0x332d60,_0x48f40c))[_0xdf84('0x2c')](handleError(_0x332d60,null));};exports[_0xdf84('0x55')]=function(_0x37e3bd,_0x9d677f){var _0x4a6a71={'raw':!![],'where':{'id':_0x37e3bd['params']['id']}},_0xce3f33={};_0xce3f33[_0xdf84('0x3e')]=_[_0xdf84('0x3f')](db['OpenchannelMessage'][_0xdf84('0x56')]);_0xce3f33[_0xdf84('0x40')]=_[_0xdf84('0x3f')](_0x37e3bd['query']);_0xce3f33[_0xdf84('0x41')]=_[_0xdf84('0x42')](_0xce3f33[_0xdf84('0x3e')],_0xce3f33['query']);_0x4a6a71[_0xdf84('0x43')]=_[_0xdf84('0x42')](_0xce3f33[_0xdf84('0x3e')],qs['fields'](_0x37e3bd['query'][_0xdf84('0x44')]));_0x4a6a71[_0xdf84('0x43')]=_0x4a6a71[_0xdf84('0x43')][_0xdf84('0x45')]?_0x4a6a71[_0xdf84('0x43')]:_0xce3f33['model'];if(_0x37e3bd[_0xdf84('0x40')][_0xdf84('0x51')]){_0x4a6a71[_0xdf84('0x52')]=[{'all':!![]}];}_0x4a6a71=_[_0xdf84('0x4f')]({},_0x4a6a71,_0x37e3bd[_0xdf84('0x50')]);return db[_0xdf84('0x3d')][_0xdf84('0x57')](_0x4a6a71)[_0xdf84('0x22')](handleEntityNotFound(_0x9d677f,null))[_0xdf84('0x22')](respondWithResult(_0x9d677f,null))[_0xdf84('0x2c')](handleError(_0x9d677f,null));};exports[_0xdf84('0x58')]=function(_0x2e1f1f,_0x3339eb){return db[_0xdf84('0x3d')][_0xdf84('0x58')](_0x2e1f1f[_0xdf84('0x59')],{})[_0xdf84('0x22')](respondWithResult(_0x3339eb,0xc9))[_0xdf84('0x2c')](handleError(_0x3339eb,null));};exports['update']=function(_0x32ad71,_0xc8fa){if(_0x32ad71[_0xdf84('0x59')]['id']){delete _0x32ad71['body']['id'];}return db[_0xdf84('0x3d')][_0xdf84('0x57')]({'where':{'id':_0x32ad71[_0xdf84('0x5a')]['id']}})[_0xdf84('0x22')](handleEntityNotFound(_0xc8fa,null))[_0xdf84('0x22')](saveUpdates(_0x32ad71['body'],null))['then'](respondWithResult(_0xc8fa,null))[_0xdf84('0x2c')](handleError(_0xc8fa,null));};exports[_0xdf84('0x36')]=function(_0xefe04f,_0x1bc630){return db[_0xdf84('0x3d')][_0xdf84('0x57')]({'where':{'id':_0xefe04f[_0xdf84('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1bc630,null))[_0xdf84('0x22')](removeEntity(_0x1bc630,null))[_0xdf84('0x2c')](handleError(_0x1bc630,null));};exports['describe']=function(_0x7c892d,_0x491ce1){return db[_0xdf84('0x3d')][_0xdf84('0x5b')]()[_0xdf84('0x22')](respondWithResult(_0x491ce1,null))[_0xdf84('0x2c')](handleError(_0x491ce1,null));};var interaction_log=require('../../config/logger')(_0xdf84('0x5c'));exports[_0xdf84('0x5d')]=function(_0x8d8b9e,_0x3c3c82,_0x1fbaf8){var _0x581ac0={'channel':'openchannel'};if(_0x8d8b9e[_0xdf84('0x59')]['id']){delete _0x8d8b9e[_0xdf84('0x59')]['id'];}_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x5e')]=!![];_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x5f')]=moment()[_0xdf84('0x60')](_0xdf84('0x61'));_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x62')]=_0x8d8b9e[_0xdf84('0x59')][_0xdf84('0x62')]||_0x8d8b9e[_0xdf84('0x63')]['id'];return db[_0xdf84('0x3d')]['find']({'where':{'id':_0x8d8b9e[_0xdf84('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xdf84('0x64')],'as':_0xdf84('0x65')}]})[_0xdf84('0x22')](handleEntityNotFound(_0x3c3c82,null))[_0xdf84('0x22')](saveUpdates(_0x8d8b9e[_0xdf84('0x59')],null))[_0xdf84('0x22')](function(_0x4756a1){if(_0x4756a1){_0x581ac0[_0xdf84('0x29')]=_0x4756a1['get']({'plain':!![]});return db[_0xdf84('0x66')]['find']({'where':{'id':_0x4756a1[_0xdf84('0x67')]}});}return null;})[_0xdf84('0x22')](handleEntityNotFound(_0x3c3c82,null))['then'](function(_0x5b1d0d){if(_0x5b1d0d){return _0x5b1d0d[_0xdf84('0x35')]({'UserId':_0x8d8b9e[_0xdf84('0x59')]['UserId'],'read1stAt':_[_0xdf84('0x68')](_0x5b1d0d[_0xdf84('0x69')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdf84('0x22')](function(_0x55c758){if(_0x55c758){_0x581ac0[_0xdf84('0x6a')]=_0x55c758['get']({'plain':!![]});interaction_log[_0xdf84('0x23')](_0xdf84('0x6b'),_0x8d8b9e['user']['id'],_0x8d8b9e[_0xdf84('0x63')][_0xdf84('0x3a')],_0x8d8b9e[_0xdf84('0x63')][_0xdf84('0x6c')],_0x581ac0['interaction']['id'],_0x8d8b9e[_0xdf84('0x59')]?JSON[_0xdf84('0x26')](_0x8d8b9e[_0xdf84('0x59')]):_0xdf84('0x6d'));return respondWithRpcPromise(_0xdf84('0x6e'),'acceptMessage',_0x581ac0);}return null;})[_0xdf84('0x22')](function(_0xa78018){if(_0xa78018){if(_0x8d8b9e[_0xdf84('0x59')]['manual']){_0x581ac0[_0xdf84('0x29')]['interface']=util[_0xdf84('0x60')]('SIP/%s',_0x8d8b9e['user'][_0xdf84('0x3a')]);_0x581ac0[_0xdf84('0x29')][_0xdf84('0x6f')]=_0x581ac0[_0xdf84('0x6f')];_0x581ac0[_0xdf84('0x29')][_0xdf84('0x70')]=_0xdf84('0x5d');return respondWithRpcPromise(_0xdf84('0x71'),_0xdf84('0x71'),{'event':_0xdf84('0x72'),'message':_0x581ac0[_0xdf84('0x29')]},client9002)[_0xdf84('0x22')](function(){return _0x581ac0;});}return _0x581ac0;}return null;})[_0xdf84('0x22')](respondWithResult(_0x3c3c82,null))[_0xdf84('0x2c')](handleError(_0x3c3c82,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xdf84('0x33')]=function(_0x1012a0,_0x10ddf2,_0x48dc8c){var _0x242e8a={'agent':{},'channel':_0xdf84('0x73')};if(_0x1012a0[_0xdf84('0x59')]['id']){delete _0x1012a0[_0xdf84('0x59')]['id'];}_0x1012a0[_0xdf84('0x59')]['UserId']=_0x1012a0[_0xdf84('0x59')]['UserId']||_0x1012a0['user']['id'];_0x242e8a[_0xdf84('0x74')]['id']=_0x1012a0[_0xdf84('0x59')][_0xdf84('0x62')];return db[_0xdf84('0x3d')]['find']({'where':{'id':_0x1012a0[_0xdf84('0x5a')]['id'],'UserId':null}})[_0xdf84('0x22')](handleEntityNotFound(_0x10ddf2,null))[_0xdf84('0x22')](function(_0x3c554e){if(_0x3c554e){_0x242e8a[_0xdf84('0x29')]=_0x3c554e[_0xdf84('0x75')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdf84('0x57')]({'where':{'id':_0x3c554e[_0xdf84('0x67')]}});}return null;})[_0xdf84('0x22')](handleEntityNotFound(_0x10ddf2,null))[_0xdf84('0x22')](function(_0x1217c9){if(_0x1217c9){_0x242e8a[_0xdf84('0x6a')]=_0x1217c9[_0xdf84('0x75')]({'plain':!![]});interaction_log['info'](_0xdf84('0x76'),_0x1012a0[_0xdf84('0x63')]['id'],_0x1012a0[_0xdf84('0x63')]['name'],_0x1012a0['user'][_0xdf84('0x6c')],_0x242e8a['interaction']['id'],_0x1012a0[_0xdf84('0x59')]?JSON[_0xdf84('0x26')](_0x1012a0[_0xdf84('0x59')]):_0xdf84('0x6d'));return respondWithRpcPromise(_0xdf84('0x77'),_0xdf84('0x78'),_0x242e8a);}return null;})['then'](function(_0x95fdcf){if(_0x95fdcf){_0x95fdcf[_0xdf84('0x29')][_0xdf84('0x79')]=util[_0xdf84('0x60')](_0xdf84('0x7a'),_0x1012a0['user']['name']);_0x95fdcf[_0xdf84('0x29')]['channel']=_0x242e8a[_0xdf84('0x6f')];_0x95fdcf[_0xdf84('0x29')]['event']=_0xdf84('0x33');respondWithRpcPromise(_0xdf84('0x71'),_0xdf84('0x71'),{'event':_0xdf84('0x7b'),'message':_0x95fdcf[_0xdf84('0x29')]},client9002);return _0x242e8a;}return null;})[_0xdf84('0x22')](respondWithResult(_0x10ddf2,null))['catch'](handleError(_0x10ddf2,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ba20c3c..900cbf6 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 _0x0eab=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','hook'];(function(_0x44fa75,_0xa7d5fc){var _0x178278=function(_0x4ff50a){while(--_0x4ff50a){_0x44fa75['push'](_0x44fa75['shift']());}};_0x178278(++_0xa7d5fc);}(_0x0eab,0xd9));var _0xb0ea=function(_0x34fc01,_0x46c582){_0x34fc01=_0x34fc01-0x0;var _0x4ca1dd=_0x0eab[_0x34fc01];return _0x4ca1dd;};'use strict';var EventEmitter=require(_0xb0ea('0x0'));var OpenchannelMessage=require(_0xb0ea('0x1'))['db'][_0xb0ea('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb0ea('0x3')](0x0);var events={'afterCreate':_0xb0ea('0x4'),'afterUpdate':_0xb0ea('0x5'),'afterDestroy':_0xb0ea('0x6')};function emitEvent(_0x2aafad){return function(_0x59213c,_0x31701d,_0x29083f){OpenchannelMessageEvents['emit'](_0x2aafad+':'+_0x59213c['id'],_0x59213c);OpenchannelMessageEvents['emit'](_0x2aafad,_0x59213c);_0x29083f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xb0ea('0x7')](e,emitEvent(event));}}module[_0xb0ea('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x2c64=['hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x2c64,0xbf));var _0x42c6=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x2c64[_0x1e4150];return _0x1ce3ee;};'use strict';var EventEmitter=require(_0x42c6('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x42c6('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x42c6('0x2')](0x0);var events={'afterCreate':_0x42c6('0x3'),'afterUpdate':_0x42c6('0x4'),'afterDestroy':_0x42c6('0x5')};function emitEvent(_0x588165){return function(_0x336832,_0x12e96f,_0x530259){OpenchannelMessageEvents[_0x42c6('0x6')](_0x588165+':'+_0x336832['id'],_0x336832);OpenchannelMessageEvents[_0x42c6('0x6')](_0x588165,_0x336832);_0x530259(null);};}for(var e in events){if(events[_0x42c6('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x42c6('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 78a6c4f..3088d47 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 _0xa54b=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri'];(function(_0xc14960,_0x16f1b9){var _0x574335=function(_0x555bfe){while(--_0x555bfe){_0xc14960['push'](_0xc14960['shift']());}};_0x574335(++_0x16f1b9);}(_0xa54b,0x76));var _0xba54=function(_0x5abfd0,_0x2019a){_0x5abfd0=_0x5abfd0-0x0;var _0x174135=_0xa54b[_0x5abfd0];return _0x174135;};'use strict';var _=require(_0xba54('0x0'));var util=require(_0xba54('0x1'));var logger=require(_0xba54('0x2'))(_0xba54('0x3'));var moment=require('moment');var BPromise=require(_0xba54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba54('0x5'));var rimraf=require('rimraf');var config=require(_0xba54('0x6'));var attributes=require(_0xba54('0x7'));module[_0xba54('0x8')]=function(_0x4dadcc,_0x534898){return _0x4dadcc[_0xba54('0x9')](_0xba54('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xba54('0xb'),'fields':[_0xba54('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17914d,_0x49b8d7,_0x4f1aa5){var _0x377610=_0x4dadcc[_0xba54('0xd')];var _0x1097c5=_0x17914d[_0xba54('0xe')]({'plain':!![]});if(_0x1097c5[_0xba54('0xf')]['toLowerCase']()==='in'||_0x1097c5['direction'][_0xba54('0x10')]()==='out'&&!_0x1097c5['secret']&&!_[_0xba54('0x11')](_0x1097c5[_0xba54('0x12')])){_0x377610[_0xba54('0x13')][_0xba54('0x14')]({'where':{'id':_0x1097c5[_0xba54('0x15')]}})[_0xba54('0x16')](function(_0x51d697){if(_0x51d697){_0x51d697[_0xba54('0x17')]({'lastMsgAt':_0x1097c5[_0xba54('0x18')],'lastMsgDirection':_0x1097c5[_0xba54('0xf')][_0xba54('0x10')]()});}})[_0xba54('0x19')](function(_0x3cfd4f){console[_0xba54('0x1a')](_0x3cfd4f);});}if(_0x1097c5[_0xba54('0xf')]===_0xba54('0x1b')&&!_0x1097c5[_0xba54('0x1c')]){var _0x9aab2;_0x377610[_0xba54('0x1d')][_0xba54('0x1e')]()['then'](function(_0x5259a5){return _0x377610[_0xba54('0x1f')][_0xba54('0x20')]({'where':{'id':_0x1097c5[_0xba54('0x21')]},'include':[{'model':_0x377610[_0xba54('0x13')],'as':_0xba54('0x22'),'where':{'id':_0x1097c5[_0xba54('0x15')]},'limit':0x1,'include':[{'model':_0x377610[_0xba54('0x1d')],'as':_0xba54('0x23'),'attributes':_[_0xba54('0x24')](_0x5259a5)}]}]});})[_0xba54('0x16')](function(_0x2c35ac){_0x9aab2=_0x2c35ac[_0xba54('0xe')]({'plain':!![]});if(_0x9aab2&&_0x9aab2[_0xba54('0x25')]){logger['info'](_0xba54('0x26'),_0xba54('0x27'),util['format'](_0xba54('0x28'),_0x1097c5['id'],_0x9aab2[_0xba54('0x25')]));if(_0x9aab2[_0xba54('0x22')]&&_0x9aab2[_0xba54('0x22')][_0xba54('0x29')]){_0x1097c5[_0xba54('0x2a')]=_[_0xba54('0x2b')](_0x9aab2[_0xba54('0x22')][0x0],'Contact');_0x1097c5[_0xba54('0x23')]=_0x9aab2[_0xba54('0x22')][0x0][_0xba54('0x23')];}var _0x49b8d7={'method':'POST','uri':encodeURI(_0x9aab2[_0xba54('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x49b8d7[_0xba54('0x2c')]){case _0xba54('0x2d'):_0x49b8d7['qs']=_0x1097c5;break;case'POST':_0x49b8d7[_0xba54('0xc')]=_0x1097c5;break;}return rp(_0x49b8d7)[_0xba54('0x16')](function(_0x1ec9f5){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xba54('0x2e')](_0xba54('0x2f'),_0x1097c5['id'],_0x9aab2['replyUri']));if(_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]&&_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]!=_0x1097c5[_0xba54('0x2a')]['threadId']){return _0x377610[_0xba54('0x13')][_0xba54('0x17')]({'threadId':_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]},{'logging':!![],'where':{'id':_0x1097c5[_0xba54('0x2a')]['id']}});}else{return;}})[_0xba54('0x16')](function(){return _0x17914d[_0xba54('0x17')]({'read':!![]});})['catch'](function(_0x169382){logger[_0xba54('0x1a')](_0xba54('0x26'),_0xba54('0x27'),util[_0xba54('0x31')](_0x169382,{'showHidden':![],'depth':null}));_0x4f1aa5();});}else{_0x4f1aa5();}})[_0xba54('0x32')](function(){_0x4f1aa5();});}else{_0x4f1aa5();}}},'charset':_0xba54('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8111=['OpenchannelMessage','openchannel_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','createdAt','catch','CmContact','describe','find','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','length','Interaction','omit','POST','method','GET','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8111,0x1d6));var _0x1811=function(_0x25565e,_0x4690f6){_0x25565e=_0x25565e-0x0;var _0x910ec5=_0x8111[_0x25565e];return _0x910ec5;};'use strict';var _=require(_0x1811('0x0'));var util=require(_0x1811('0x1'));var logger=require(_0x1811('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1811('0x3'));var rp=require(_0x1811('0x4'));var fs=require('fs');var path=require(_0x1811('0x5'));var rimraf=require(_0x1811('0x6'));var config=require(_0x1811('0x7'));var attributes=require(_0x1811('0x8'));module[_0x1811('0x9')]=function(_0xd28d18,_0xcd155e){return _0xd28d18['define'](_0x1811('0xa'),attributes,{'tableName':_0x1811('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x1811('0xc')],'type':_0x1811('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25da83,_0x27d585,_0x16e668){var _0x5b5df8=_0xd28d18['models'];var _0x13ae70=_0x25da83['get']({'plain':!![]});if(_0x13ae70[_0x1811('0xe')]['toLowerCase']()==='in'||_0x13ae70[_0x1811('0xe')][_0x1811('0xf')]()===_0x1811('0x10')&&!_0x13ae70['secret']&&!_[_0x1811('0x11')](_0x13ae70[_0x1811('0x12')])){_0x5b5df8[_0x1811('0x13')][_0x1811('0x14')]({'where':{'id':_0x13ae70['OpenchannelInteractionId']}})[_0x1811('0x15')](function(_0x2e0557){if(_0x2e0557){_0x2e0557['update']({'lastMsgAt':_0x13ae70[_0x1811('0x16')],'lastMsgDirection':_0x13ae70[_0x1811('0xe')]['toLowerCase']()});}})[_0x1811('0x17')](function(_0xc12cc1){console['error'](_0xc12cc1);});}if(_0x13ae70[_0x1811('0xe')]===_0x1811('0x10')&&!_0x13ae70['secret']){var _0x124538;_0x5b5df8[_0x1811('0x18')][_0x1811('0x19')]()[_0x1811('0x15')](function(_0x3c5290){return _0x5b5df8['OpenchannelAccount'][_0x1811('0x1a')]({'where':{'id':_0x13ae70['OpenchannelAccountId']},'include':[{'model':_0x5b5df8[_0x1811('0x13')],'as':_0x1811('0x1b'),'where':{'id':_0x13ae70['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5b5df8[_0x1811('0x18')],'as':_0x1811('0x1c'),'attributes':_['keys'](_0x3c5290)}]}]});})[_0x1811('0x15')](function(_0x3957e2){_0x124538=_0x3957e2[_0x1811('0x1d')]({'plain':!![]});if(_0x124538&&_0x124538[_0x1811('0x1e')]){logger[_0x1811('0x1f')](_0x1811('0x20'),'afterCreate',util[_0x1811('0x21')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x13ae70['id'],_0x124538[_0x1811('0x1e')]));if(_0x124538[_0x1811('0x1b')]&&_0x124538['Interactions'][_0x1811('0x22')]){_0x13ae70[_0x1811('0x23')]=_[_0x1811('0x24')](_0x124538[_0x1811('0x1b')][0x0],_0x1811('0x1c'));_0x13ae70[_0x1811('0x1c')]=_0x124538[_0x1811('0x1b')][0x0][_0x1811('0x1c')];}var _0x27d585={'method':_0x1811('0x25'),'uri':encodeURI(_0x124538[_0x1811('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x27d585[_0x1811('0x26')]){case _0x1811('0x27'):_0x27d585['qs']=_0x13ae70;break;case _0x1811('0x25'):_0x27d585[_0x1811('0xc')]=_0x13ae70;break;}return rp(_0x27d585)['then'](function(_0x5984aa){logger[_0x1811('0x1f')](_0x1811('0x20'),_0x1811('0x28'),util[_0x1811('0x21')](_0x1811('0x29'),_0x13ae70['id'],_0x124538[_0x1811('0x1e')]));if(_0x5984aa[_0x1811('0xc')][_0x1811('0x2a')]&&_0x5984aa[_0x1811('0xc')]['threadId']!=_0x13ae70[_0x1811('0x23')][_0x1811('0x2a')]){return _0x5b5df8[_0x1811('0x13')][_0x1811('0x2b')]({'threadId':_0x5984aa[_0x1811('0xc')][_0x1811('0x2a')]},{'logging':!![],'where':{'id':_0x13ae70[_0x1811('0x23')]['id']}});}else{return;}})[_0x1811('0x15')](function(){return _0x25da83[_0x1811('0x2b')]({'read':!![]});})[_0x1811('0x17')](function(_0x25dc3b){logger[_0x1811('0x2c')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1811('0x2d')](_0x25dc3b,{'showHidden':![],'depth':null}));_0x16e668();});}else{_0x16e668();}})[_0x1811('0x2e')](function(){_0x16e668();});}else{_0x16e668();}}},'charset':'utf8mb4','collate':_0x1811('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d8e9462..119232b 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 _0xeab8=['raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options'];(function(_0x47d8b9,_0x6865e3){var _0x1af849=function(_0x58dd9a){while(--_0x58dd9a){_0x47d8b9['push'](_0x47d8b9['shift']());}};_0x1af849(++_0x6865e3);}(_0xeab8,0x156));var _0x8eab=function(_0x43dc7f,_0x4ae704){_0x43dc7f=_0x43dc7f-0x0;var _0x18b20c=_0xeab8[_0x43dc7f];return _0x18b20c;};'use strict';var _=require(_0x8eab('0x0'));var util=require(_0x8eab('0x1'));var moment=require(_0x8eab('0x2'));var BPromise=require(_0x8eab('0x3'));var rs=require(_0x8eab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eab('0x6'))(_0x8eab('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8eab('0x8')]['http']({'port':0x232a});config['redis']=_[_0x8eab('0x9')](config[_0x8eab('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8eab('0xb'))(new Redis(config[_0x8eab('0xa')]));require('./openchannelMessage.socket')[_0x8eab('0xc')](socket);function respondWithRpcPromise(_0x285ebe,_0x45aa5b,_0x106541){return new BPromise(function(_0x4e19d0,_0xab18ae){return client[_0x8eab('0xd')](_0x285ebe,_0x106541)[_0x8eab('0xe')](function(_0x8145cb){logger[_0x8eab('0xf')](_0x8eab('0x10'),_0x45aa5b,_0x8eab('0x11'));logger[_0x8eab('0x12')](_0x8eab('0x13'),_0x45aa5b,'request\x20sent',JSON[_0x8eab('0x14')](_0x8145cb));if(_0x8145cb[_0x8eab('0x15')]){if(_0x8145cb['error'][_0x8eab('0x16')]===0x1f4){logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);return _0xab18ae(_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);}logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);return _0x4e19d0(_0x8145cb['error'][_0x8eab('0x17')]);}else{logger['info'](_0x8eab('0x10'),_0x45aa5b,_0x8eab('0x11'));_0x4e19d0(_0x8145cb['result'][_0x8eab('0x17')]);}})[_0x8eab('0x18')](function(_0x19eb20){logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x19eb20);_0xab18ae(_0x19eb20);});});}exports[_0x8eab('0x19')]=function(_0x149ff1){var _0x34bff7=this;return new Promise(function(_0x7f1912,_0x4e706f){return db[_0x8eab('0x1a')][_0x8eab('0x1b')](_0x149ff1[_0x8eab('0x1c')],{'raw':_0x149ff1['options']?_0x149ff1[_0x8eab('0x1d')][_0x8eab('0x1e')]===undefined?!![]:![]:!![]})[_0x8eab('0xe')](function(_0x500815){logger[_0x8eab('0xf')](_0x8eab('0x19'),_0x149ff1);logger[_0x8eab('0x12')](_0x8eab('0x19'),_0x149ff1,JSON[_0x8eab('0x14')](_0x500815));_0x7f1912(_0x500815);})[_0x8eab('0x18')](function(_0x578170){logger[_0x8eab('0x15')]('CreateOpenchannelMessage',_0x578170[_0x8eab('0x17')],_0x149ff1);_0x4e706f(_0x34bff7['error'](0x1f4,_0x578170[_0x8eab('0x17')]));});});}; \ No newline at end of file +var _0x3366=['OpenchannelMessage','create','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','CreateOpenchannelMessage'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x3366,0xc5));var _0x6336=function(_0x2fc6cf,_0x2bb133){_0x2fc6cf=_0x2fc6cf-0x0;var _0xf2ade3=_0x3366[_0x2fc6cf];return _0xf2ade3;};'use strict';var _=require(_0x6336('0x0'));var util=require(_0x6336('0x1'));var moment=require(_0x6336('0x2'));var BPromise=require(_0x6336('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6336('0x4'));var db=require(_0x6336('0x5'))['db'];var utils=require(_0x6336('0x6'));var logger=require(_0x6336('0x7'))(_0x6336('0x8'));var config=require(_0x6336('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6336('0xa')][_0x6336('0xb')]({'port':0x232a});config[_0x6336('0xc')]=_['defaults'](config[_0x6336('0xc')],{'host':_0x6336('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6336('0xc')]));require(_0x6336('0xe'))[_0x6336('0xf')](socket);function respondWithRpcPromise(_0x2dc4ca,_0x13f8e5,_0x456559){return new BPromise(function(_0x77d817,_0x2dd108){return client[_0x6336('0x10')](_0x2dc4ca,_0x456559)[_0x6336('0x11')](function(_0xc18bcb){logger['info'](_0x6336('0x12'),_0x13f8e5,'request\x20sent');logger[_0x6336('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x13f8e5,'request\x20sent',JSON[_0x6336('0x14')](_0xc18bcb));if(_0xc18bcb['error']){if(_0xc18bcb['error']['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);return _0x2dd108(_0xc18bcb[_0x6336('0x15')]['message']);}logger[_0x6336('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);return _0x77d817(_0xc18bcb[_0x6336('0x15')][_0x6336('0x16')]);}else{logger[_0x6336('0x17')](_0x6336('0x12'),_0x13f8e5,_0x6336('0x18'));_0x77d817(_0xc18bcb[_0x6336('0x19')][_0x6336('0x16')]);}})['catch'](function(_0x7cc184){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x13f8e5,_0x7cc184);_0x2dd108(_0x7cc184);});});}exports[_0x6336('0x1a')]=function(_0x1809f2){var _0x50cf53=this;return new Promise(function(_0xee1f87,_0x262920){return db[_0x6336('0x1b')][_0x6336('0x1c')](_0x1809f2['body'],{'raw':_0x1809f2['options']?_0x1809f2[_0x6336('0x1d')][_0x6336('0x1e')]===undefined?!![]:![]:!![]})[_0x6336('0x11')](function(_0x58c1bf){logger[_0x6336('0x17')]('CreateOpenchannelMessage',_0x1809f2);logger[_0x6336('0x13')](_0x6336('0x1a'),_0x1809f2,JSON[_0x6336('0x14')](_0x58c1bf));_0xee1f87(_0x58c1bf);})[_0x6336('0x1f')](function(_0x3eaf47){logger[_0x6336('0x15')](_0x6336('0x1a'),_0x3eaf47[_0x6336('0x16')],_0x1809f2);_0x262920(_0x50cf53[_0x6336('0x15')](0x1f4,_0x3eaf47[_0x6336('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 8ef615e..dcc2679 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 _0xb138=['update','removeListener','length','./openchannelMessage.events','save','remove'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xb138,0x1dd));var _0x8b13=function(_0x3913e2,_0x35f74a){_0x3913e2=_0x3913e2-0x0;var _0x3b63b7=_0xb138[_0x3913e2];return _0x3b63b7;};'use strict';var OpenchannelMessageEvents=require(_0x8b13('0x0'));var events=[_0x8b13('0x1'),_0x8b13('0x2'),_0x8b13('0x3')];function createListener(_0xadad70,_0x185752){return function(_0x20c65c){_0x185752['emit'](_0xadad70,_0x20c65c);};}function removeListener(_0x4411a0,_0x241acb){return function(){OpenchannelMessageEvents[_0x8b13('0x4')](_0x4411a0,_0x241acb);};}exports['register']=function(_0xd19a0f){for(var _0x13f7bd=0x0,_0x5d51b1=events[_0x8b13('0x5')];_0x13f7bd<_0x5d51b1;_0x13f7bd++){var _0x33d1a7=events[_0x13f7bd];var _0x22e157=createListener('openchannelMessage:'+_0x33d1a7,_0xd19a0f);OpenchannelMessageEvents['on'](_0x33d1a7,_0x22e157);}}; \ No newline at end of file +var _0x5ad3=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0x5ad3[_0x32bce8];return _0x38badc;};'use strict';var OpenchannelMessageEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){OpenchannelMessageEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);OpenchannelMessageEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3586b3e..a9cff38 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 _0xd258=['delete','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','/:id','update'];(function(_0x5b2a96,_0x58480b){var _0x1c743c=function(_0xc626f7){while(--_0xc626f7){_0x5b2a96['push'](_0x5b2a96['shift']());}};_0x1c743c(++_0x58480b);}(_0xd258,0x199));var _0x8d25=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd258[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x8d25('0x0'));var path=require(_0x8d25('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d25('0x2'));var router=express[_0x8d25('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d25('0x4'));var config=require(_0x8d25('0x5'));var controller=require(_0x8d25('0x6'));router[_0x8d25('0x7')]('/',auth[_0x8d25('0x8')](),controller['index']);router[_0x8d25('0x7')]('/describe',auth[_0x8d25('0x8')](),controller[_0x8d25('0x9')]);router[_0x8d25('0x7')]('/:id',auth[_0x8d25('0x8')](),controller[_0x8d25('0xa')]);router[_0x8d25('0x7')](_0x8d25('0xb'),auth[_0x8d25('0x8')](),controller[_0x8d25('0xc')]);router[_0x8d25('0x7')]('/:id/teams',auth[_0x8d25('0x8')](),controller[_0x8d25('0xd')]);router[_0x8d25('0x7')](_0x8d25('0xe'),auth[_0x8d25('0x8')](),controller['getAgents']);router[_0x8d25('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d25('0x10')]);router['post'](_0x8d25('0x11'),auth['isAuthenticated'](),controller[_0x8d25('0x12')]);router['post'](_0x8d25('0xe'),auth[_0x8d25('0x8')](),controller[_0x8d25('0x13')]);router[_0x8d25('0x14')](_0x8d25('0x15'),auth['isAuthenticated'](),controller[_0x8d25('0x16')]);router[_0x8d25('0x17')](_0x8d25('0x15'),auth[_0x8d25('0x8')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x8d25('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x568e=['../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','/describe','describe','get','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','connect-timeout','Router','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x568e,0x1b0));var _0xe568=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x568e[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe568('0x0'));var express=require('express');var router=express[_0xe568('0x1')]();var auth=require(_0xe568('0x2'));var interaction=require(_0xe568('0x3'));var config=require('../../config/environment');var controller=require(_0xe568('0x4'));router['get']('/',auth[_0xe568('0x5')](),controller[_0xe568('0x6')]);router['get'](_0xe568('0x7'),auth[_0xe568('0x5')](),controller[_0xe568('0x8')]);router[_0xe568('0x9')]('/:id',auth[_0xe568('0x5')](),controller[_0xe568('0xa')]);router[_0xe568('0x9')](_0xe568('0xb'),auth[_0xe568('0x5')](),controller[_0xe568('0xc')]);router[_0xe568('0x9')]('/:id/teams',auth[_0xe568('0x5')](),controller[_0xe568('0xd')]);router[_0xe568('0x9')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0xf')]);router['post']('/',auth[_0xe568('0x5')](),controller[_0xe568('0x10')]);router[_0xe568('0x11')](_0xe568('0x12'),auth[_0xe568('0x5')](),controller[_0xe568('0x13')]);router[_0xe568('0x11')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0x14')]);router[_0xe568('0x15')](_0xe568('0x16'),auth['isAuthenticated'](),controller[_0xe568('0x17')]);router[_0xe568('0x18')](_0xe568('0x16'),auth[_0xe568('0x5')](),controller[_0xe568('0x19')]);router[_0xe568('0x18')](_0xe568('0x12'),auth['isAuthenticated'](),controller[_0xe568('0x1a')]);router[_0xe568('0x18')](_0xe568('0xe'),auth[_0xe568('0x5')](),controller[_0xe568('0x1b')]);module[_0xe568('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 9229610..af6dbc9 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 _0x9d83=['roundrobin','sequelize','STRING','name','rrmemory','beepall'];(function(_0x155413,_0x1c89b4){var _0x434c71=function(_0x5b74a0){while(--_0x5b74a0){_0x155413['push'](_0x155413['shift']());}};_0x434c71(++_0x1c89b4);}(_0x9d83,0x127));var _0x39d8=function(_0x48a17b,_0x15fe4b){_0x48a17b=_0x48a17b-0x0;var _0x3170db=_0x9d83[_0x48a17b];return _0x3170db;};'use strict';var Sequelize=require(_0x39d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x39d8('0x1')],'unique':_0x39d8('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'](_0x39d8('0x3'),_0x39d8('0x4'),_0x39d8('0x5'))}}; \ No newline at end of file +var _0x4955=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x2c31d3,_0x460193){var _0x3c4057=function(_0x5ec580){while(--_0x5ec580){_0x2c31d3['push'](_0x2c31d3['shift']());}};_0x3c4057(++_0x460193);}(_0x4955,0x1e7));var _0x5495=function(_0x270226,_0x2f4259){_0x270226=_0x270226-0x0;var _0x13bd07=_0x4955[_0x270226];return _0x13bd07;};'use strict';var Sequelize=require(_0x5495('0x0'));module['exports']={'name':{'type':Sequelize[_0x5495('0x1')],'unique':_0x5495('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[_0x5495('0x3')](_0x5495('0x4'),_0x5495('0x5'),_0x5495('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6df8854..15bcfa6 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 _0xa3bd=['findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','teams','User','voicePause','interface','Agents','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','keys','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','OpenchannelQueue','includeAll','findAll','rows','catch','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','map'];(function(_0x55b0ac,_0x443db2){var _0x5dcda2=function(_0x4c1305){while(--_0x4c1305){_0x55b0ac['push'](_0x55b0ac['shift']());}};_0x5dcda2(++_0x443db2);}(_0xa3bd,0x1d3));var _0xda3b=function(_0x2d90d8,_0x14503a){_0x2d90d8=_0x2d90d8-0x0;var _0x1ac508=_0xa3bd[_0x2d90d8];return _0x1ac508;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda3b('0x0'));var rimraf=require(_0xda3b('0x1'));var zipdir=require(_0xda3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda3b('0x3'));var moment=require(_0xda3b('0x4'));var BPromise=require(_0xda3b('0x5'));var Mustache=require(_0xda3b('0x6'));var util=require(_0xda3b('0x7'));var path=require('path');var sox=require(_0xda3b('0x8'));var csv=require(_0xda3b('0x9'));var ejs=require(_0xda3b('0xa'));var fs=require('fs');var _=require(_0xda3b('0xb'));var squel=require(_0xda3b('0xc'));var crypto=require(_0xda3b('0xd'));var jsforce=require(_0xda3b('0xe'));var deskjs=require(_0xda3b('0xf'));var toCsv=require(_0xda3b('0x9'));var querystring=require(_0xda3b('0x10'));var Papa=require(_0xda3b('0x11'));var Redis=require(_0xda3b('0x12'));var authService=require(_0xda3b('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xda3b('0x14'));var logger=require(_0xda3b('0x15'))(_0xda3b('0x16'));var utils=require('../../config/utils');var config=require(_0xda3b('0x17'));var db=require(_0xda3b('0x18'))['db'];config[_0xda3b('0x19')]=_[_0xda3b('0x1a')](config['redis'],{'host':_0xda3b('0x1b'),'port':0x18eb});var socket=require(_0xda3b('0x1c'))(new Redis(config[_0xda3b('0x19')]));require(_0xda3b('0x1d'))[_0xda3b('0x1e')](socket);function respondWithStatusCode(_0x1c4465,_0x368c8f){_0x368c8f=_0x368c8f||0xcc;return function(_0x36d326){if(_0x36d326){return _0x1c4465[_0xda3b('0x1f')](_0x368c8f);}return _0x1c4465[_0xda3b('0x20')](_0x368c8f)['end']();};}function respondWithResult(_0x15bacd,_0x68718c){_0x68718c=_0x68718c||0xc8;return function(_0x7bfbca){if(_0x7bfbca){return _0x15bacd[_0xda3b('0x20')](_0x68718c)[_0xda3b('0x21')](_0x7bfbca);}};}function respondWithFilteredResult(_0x5e2f97,_0xd7f053){return function(_0xdab454){if(_0xdab454){var _0x364305=_0xdab454[_0xda3b('0x22')],_0x349da4=_0xd7f053[_0xda3b('0x23')],_0x331582=_0xd7f053['offset']+_0xd7f053[_0xda3b('0x24')],_0x4fcb13;if(_0x331582>=_0x364305){_0x331582=_0x364305;_0x4fcb13=0xc8;}else{_0x4fcb13=0xce;}_0x5e2f97[_0xda3b('0x20')](_0x4fcb13);return _0x5e2f97[_0xda3b('0x25')](_0xda3b('0x26'),_0x349da4+'-'+_0x331582+'/'+_0x364305)[_0xda3b('0x21')](_0xdab454);}return null;};}function patchUpdates(_0x2fa34e){return function(_0x4f70bb){try{jsonpatch[_0xda3b('0x27')](_0x4f70bb,_0x2fa34e,!![]);}catch(_0x1eb3c5){return BPromise[_0xda3b('0x28')](_0x1eb3c5);}return _0x4f70bb['save']();};}function saveUpdates(_0x42e05e,_0x338437){return function(_0x58d134){if(_0x58d134){return _0x58d134['update'](_0x42e05e)[_0xda3b('0x29')](function(_0x1befee){return _0x1befee;});}return null;};}function removeEntity(_0x12a011,_0x40366b){return function(_0x1cd424){if(_0x1cd424){return _0x1cd424[_0xda3b('0x2a')]()[_0xda3b('0x29')](function(){var _0x58abbd=_0x1cd424[_0xda3b('0x2b')]({'plain':!![]});var _0x48d74e='OpenchannelQueues';return db[_0xda3b('0x2c')][_0xda3b('0x2a')]({'where':{'type':_0x48d74e,'resourceId':_0x58abbd['id']}})[_0xda3b('0x29')](function(){return _0x1cd424;});})[_0xda3b('0x29')](function(){_0x12a011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d6ef,_0x2a6296){return function(_0x47caa6){if(!_0x47caa6){_0x55d6ef[_0xda3b('0x1f')](0x194);}return _0x47caa6;};}function handleError(_0x11b51b,_0x2bffbe){_0x2bffbe=_0x2bffbe||0x1f4;return function(_0x2beb3f){logger[_0xda3b('0x2d')](_0x2beb3f[_0xda3b('0x2e')]);if(_0x2beb3f[_0xda3b('0x2f')]){delete _0x2beb3f[_0xda3b('0x2f')];}_0x11b51b[_0xda3b('0x20')](_0x2bffbe)[_0xda3b('0x30')](_0x2beb3f);};}exports[_0xda3b('0x31')]=function(_0x2eedbd,_0xeeb93d){var _0xf9cdad={},_0x54b94b={},_0x39fc5c={'count':0x0,'rows':[]};var _0x4a2392=db['OpenchannelQueue']['rawAttributes'];_0x54b94b['model']=_[_0xda3b('0x32')](_0x4a2392);_0x54b94b[_0xda3b('0x33')]=_[_0xda3b('0x32')](_0x2eedbd[_0xda3b('0x33')]);_0x54b94b[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x54b94b[_0xda3b('0x36')],_0x54b94b[_0xda3b('0x33')]);_0xf9cdad['attributes']=_[_0xda3b('0x35')](_0x54b94b['model'],qs[_0xda3b('0x37')](_0x2eedbd['query'][_0xda3b('0x37')]));_0xf9cdad[_0xda3b('0x38')]=_0xf9cdad['attributes'][_0xda3b('0x39')]?_0xf9cdad[_0xda3b('0x38')]:_0x54b94b[_0xda3b('0x36')];if(!_0x2eedbd[_0xda3b('0x33')]['hasOwnProperty'](_0xda3b('0x3a'))){_0xf9cdad[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x2eedbd[_0xda3b('0x33')]['limit']);_0xf9cdad[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x2eedbd['query'][_0xda3b('0x23')]);}_0xf9cdad['order']=qs[_0xda3b('0x3b')](_0x2eedbd['query'][_0xda3b('0x3b')]);_0xf9cdad[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x2eedbd['query'],_0x54b94b[_0xda3b('0x34')]));if(_0x2eedbd['query'][_0xda3b('0x3e')]){_0xf9cdad['where']=_[_0xda3b('0x3f')](_0xf9cdad[_0xda3b('0x3c')],{'$or':_['map'](_0x4a2392,function(_0x3fe5cc){if(_0x3fe5cc[_0xda3b('0x40')][_0xda3b('0x41')]!==_0xda3b('0x42')){var _0x1acb45={};_0x1acb45[_0x3fe5cc[_0xda3b('0x43')]]={'$like':'%'+_0x2eedbd[_0xda3b('0x33')]['filter']+'%'};return _0x1acb45;}})});}_0xf9cdad=_[_0xda3b('0x3f')]({},_0xf9cdad,_0x2eedbd[_0xda3b('0x44')]);var _0x41ad16={'where':_0xf9cdad[_0xda3b('0x3c')]};return db[_0xda3b('0x45')][_0xda3b('0x22')](_0x41ad16)[_0xda3b('0x29')](function(_0x2ad3f9){_0x39fc5c[_0xda3b('0x22')]=_0x2ad3f9;if(_0x2eedbd[_0xda3b('0x33')][_0xda3b('0x46')]){_0xf9cdad['include']=[{'all':!![]}];}return db[_0xda3b('0x45')][_0xda3b('0x47')](_0xf9cdad);})['then'](function(_0x789cde){_0x39fc5c[_0xda3b('0x48')]=_0x789cde;return _0x39fc5c;})['then'](respondWithFilteredResult(_0xeeb93d,_0xf9cdad))[_0xda3b('0x49')](handleError(_0xeeb93d,null));};exports['show']=function(_0x1812fc,_0x5de5c4){var _0x41a23d={'raw':!![],'where':{'id':_0x1812fc[_0xda3b('0x4a')]['id']}},_0x2621ee={};_0x2621ee[_0xda3b('0x36')]=_[_0xda3b('0x32')](db[_0xda3b('0x45')][_0xda3b('0x4b')]);_0x2621ee['query']=_[_0xda3b('0x32')](_0x1812fc[_0xda3b('0x33')]);_0x2621ee[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x2621ee[_0xda3b('0x36')],_0x2621ee[_0xda3b('0x33')]);_0x41a23d[_0xda3b('0x38')]=_['intersection'](_0x2621ee['model'],qs[_0xda3b('0x37')](_0x1812fc['query'][_0xda3b('0x37')]));_0x41a23d[_0xda3b('0x38')]=_0x41a23d[_0xda3b('0x38')][_0xda3b('0x39')]?_0x41a23d[_0xda3b('0x38')]:_0x2621ee[_0xda3b('0x36')];if(_0x1812fc[_0xda3b('0x33')]['includeAll']){_0x41a23d['include']=[{'all':!![]}];}_0x41a23d=_[_0xda3b('0x3f')]({},_0x41a23d,_0x1812fc['options']);return db[_0xda3b('0x45')]['find'](_0x41a23d)[_0xda3b('0x29')](handleEntityNotFound(_0x5de5c4,null))[_0xda3b('0x29')](respondWithResult(_0x5de5c4,null))[_0xda3b('0x49')](handleError(_0x5de5c4,null));};exports['create']=function(_0x1d1596,_0x2a4e30){return db['OpenchannelQueue'][_0xda3b('0x4c')](_0x1d1596[_0xda3b('0x4d')],{})['then'](function(_0x40ea5c){var _0x238c51=_0x1d1596['user'][_0xda3b('0x2b')]({'plain':!![]});if(!_0x238c51)throw new Error(_0xda3b('0x4e'));if(_0x238c51[_0xda3b('0x4f')]===_0xda3b('0x50')){var _0x9550b=_0x40ea5c['get']({'plain':!![]});var _0xd4c1c6='OpenchannelQueues';return db[_0xda3b('0x51')]['find']({'where':{'name':_0xd4c1c6,'userProfileId':_0x238c51[_0xda3b('0x52')]},'raw':!![]})[_0xda3b('0x29')](function(_0x5f0ca2){if(_0x5f0ca2&&_0x5f0ca2['autoAssociation']===0x0){return db[_0xda3b('0x2c')]['create']({'name':_0x9550b[_0xda3b('0x2f')],'resourceId':_0x9550b['id'],'type':_0x5f0ca2['name'],'sectionId':_0x5f0ca2['id']},{})[_0xda3b('0x29')](function(){return _0x40ea5c;});}else{return _0x40ea5c;}})[_0xda3b('0x49')](function(_0x5d8af2){logger[_0xda3b('0x2d')](_0xda3b('0x53'),_0x5d8af2);throw _0x5d8af2;});}return _0x40ea5c;})['then'](respondWithResult(_0x2a4e30,0xc9))[_0xda3b('0x49')](handleError(_0x2a4e30,null));};exports[_0xda3b('0x54')]=function(_0x378170,_0x217264){if(_0x378170[_0xda3b('0x4d')]['id']){delete _0x378170[_0xda3b('0x4d')]['id'];}return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x378170[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x217264,null))[_0xda3b('0x29')](saveUpdates(_0x378170[_0xda3b('0x4d')],null))['then'](respondWithResult(_0x217264,null))[_0xda3b('0x49')](handleError(_0x217264,null));};exports[_0xda3b('0x2a')]=function(_0x4d4b95,_0x3aaf14){return db['OpenchannelQueue']['find']({'where':{'id':_0x4d4b95['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x3aaf14,null))[_0xda3b('0x29')](removeEntity(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));};exports[_0xda3b('0x56')]=function(_0x4db5d7,_0x32bfee){return db[_0xda3b('0x45')][_0xda3b('0x56')]()['then'](respondWithResult(_0x32bfee,null))['catch'](handleError(_0x32bfee,null));};exports[_0xda3b('0x57')]=function(_0x46775f,_0x540a71,_0x37e2a5){var _0x3837b4={'raw':!![],'where':{}},_0x5109e0={},_0x206d47;return db[_0xda3b('0x45')]['findOne']({'where':{'id':_0x46775f[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x540a71,null))[_0xda3b('0x29')](function(_0x59933b){if(_0x59933b){_0x206d47=_0x59933b['get']({'plain':!![]});_0x5109e0[_0xda3b('0x36')]=_[_0xda3b('0x32')](db[_0xda3b('0x58')][_0xda3b('0x4b')]);_0x5109e0['query']=_[_0xda3b('0x32')](_0x46775f[_0xda3b('0x33')]);_0x5109e0[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x5109e0['model'],_0x5109e0[_0xda3b('0x33')]);_0x3837b4['attributes']=_[_0xda3b('0x35')](_0x5109e0[_0xda3b('0x36')],qs[_0xda3b('0x37')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x37')]));_0x3837b4[_0xda3b('0x38')]=_0x3837b4[_0xda3b('0x38')][_0xda3b('0x39')]?_0x3837b4[_0xda3b('0x38')]:_0x5109e0['model'];if(!_0x46775f['query'][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x3837b4[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x24')]);_0x3837b4[_0xda3b('0x23')]=qs['offset'](_0x46775f['query'][_0xda3b('0x23')]);}_0x3837b4[_0xda3b('0x5a')]=qs[_0xda3b('0x3b')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x3b')]);_0x3837b4[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x46775f[_0xda3b('0x33')],_0x5109e0[_0xda3b('0x34')]));_0x3837b4[_0xda3b('0x3c')][_0xda3b('0x5b')]=_0x59933b['id'];if(_0x46775f[_0xda3b('0x33')][_0xda3b('0x3e')]){_0x3837b4[_0xda3b('0x3c')]=_[_0xda3b('0x3f')](_0x3837b4[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x3837b4[_0xda3b('0x38')],function(_0x11288b){var _0x13c8dd={};_0x13c8dd[_0x11288b]={'$like':'%'+_0x46775f[_0xda3b('0x33')][_0xda3b('0x3e')]+'%'};return _0x13c8dd;})});}_0x3837b4=_[_0xda3b('0x3f')]({},_0x3837b4,_0x46775f[_0xda3b('0x44')]);return db[_0xda3b('0x58')]['findAll'](_0x3837b4);}})[_0xda3b('0x29')](function(_0x33d204){if(_0x33d204){return db['User'][_0xda3b('0x5d')]({'where':{'id':_[_0xda3b('0x5c')](_0x33d204,_0xda3b('0x5e')),'role':_0xda3b('0x5f')},'attributes':['id',_0xda3b('0x2f'),_0xda3b('0x60'),'updatedAt',_0xda3b('0x61')]});}})[_0xda3b('0x29')](function(_0x567c79){if(_0x567c79){return{'count':_0x567c79[_0xda3b('0x22')],'rows':_[_0xda3b('0x5c')](_0x567c79[_0xda3b('0x48')],function(_0x34c91e){return{'membername':_0x34c91e[_0xda3b('0x2f')],'UserId':_0x34c91e['id'],'queue_name':_0x206d47['name'],'OpenchannelQueueId':_0x206d47['id'],'interface':util[_0xda3b('0x62')](_0xda3b('0x63'),_0xda3b('0x64'),_0x34c91e[_0xda3b('0x2f')]),'penalty':0x0,'paused':_0x34c91e['openchannelPause'],'createdAt':_0x34c91e[_0xda3b('0x61')],'updatedAt':_0x34c91e[_0xda3b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xda3b('0x29')](respondWithFilteredResult(_0x540a71,_0x3837b4))['catch'](handleError(_0x540a71,null));};exports[_0xda3b('0x66')]=function(_0x2490b5,_0x156c37,_0xfb0eb9){var _0x321796={};var _0x5a53cf={};var _0x23b3b1;var _0x1ee054;return db[_0xda3b('0x45')][_0xda3b('0x67')]({'where':{'id':_0x2490b5[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x156c37,null))[_0xda3b('0x29')](function(_0x555b40){if(_0x555b40){_0x23b3b1=_0x555b40;_0x5a53cf[_0xda3b('0x36')]=_['keys'](db[_0xda3b('0x68')][_0xda3b('0x4b')]);_0x5a53cf[_0xda3b('0x33')]=_['keys'](_0x2490b5['query']);_0x5a53cf[_0xda3b('0x34')]=_['intersection'](_0x5a53cf['model'],_0x5a53cf[_0xda3b('0x33')]);_0x321796[_0xda3b('0x38')]=_[_0xda3b('0x35')](_0x5a53cf['model'],qs[_0xda3b('0x37')](_0x2490b5[_0xda3b('0x33')]['fields']));_0x321796[_0xda3b('0x38')]=_0x321796['attributes'][_0xda3b('0x39')]?_0x321796['attributes']:_0x5a53cf[_0xda3b('0x36')];_0x321796['order']=qs[_0xda3b('0x3b')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x3b')]);_0x321796[_0xda3b('0x3c')]=qs['filters'](_[_0xda3b('0x3d')](_0x2490b5['query'],_0x5a53cf[_0xda3b('0x34')]));if(_0x2490b5[_0xda3b('0x33')]['filter']){_0x321796['where']=_[_0xda3b('0x3f')](_0x321796[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x321796['attributes'],function(_0x3a905c){var _0x380e37={};_0x380e37[_0x3a905c]={'$like':'%'+_0x2490b5['query'][_0xda3b('0x3e')]+'%'};return _0x380e37;})});}_0x321796=_['merge']({},_0x321796,_0x2490b5['options']);return _0x23b3b1[_0xda3b('0x66')](_0x321796);}})[_0xda3b('0x29')](function(_0x2a143d){if(_0x2a143d){_0x1ee054=_0x2a143d[_0xda3b('0x39')];if(!_0x2490b5[_0xda3b('0x33')][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x321796[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x24')]);_0x321796[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x23')]);}return _0x23b3b1['getTeams'](_0x321796);}})['then'](function(_0x31002e){if(_0x31002e){return _0x31002e?{'count':_0x1ee054,'rows':_0x31002e}:null;}})[_0xda3b('0x29')](respondWithResult(_0x156c37,null))[_0xda3b('0x49')](handleError(_0x156c37,null));};exports[_0xda3b('0x69')]=function(_0x3a599d,_0x5b6acf,_0x1b2b57){var _0x511b65=_0x3a599d[_0xda3b('0x4d')][_0xda3b('0x6a')];return db[_0xda3b('0x68')][_0xda3b('0x47')]({'where':{'id':_['map'](_0x511b65,'id')},'attributes':['id'],'include':[{'model':db[_0xda3b('0x6b')],'as':'Agents','attributes':['id',_0xda3b('0x2f'),'online',_0xda3b('0x6c'),_0xda3b('0x6d')],'raw':!![]}]})[_0xda3b('0x29')](function(_0x2f9e85){if(_0x2f9e85){var _0x471db1=_['flatMap'](_0x2f9e85,function(_0x555614){var _0x1709b9=_0x555614[_0xda3b('0x2b')]({'plain':!![]});return _0x1709b9[_0xda3b('0x6e')];});return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x3a599d[_0xda3b('0x4a')]['id']}})['then'](function(_0x4b029a){return db[_0xda3b('0x6f')]['transaction'](function(_0x5000cb){return _0x4b029a['addTeams'](_['map'](_0x511b65,'id'),{'transaction':_0x5000cb})[_0xda3b('0x29')](function(){return BPromise[_0xda3b('0x70')](_0x471db1,function(_0x15c1ea){return db[_0xda3b('0x58')][_0xda3b('0x71')]({'where':{'UserId':_0x15c1ea['id'],'OpenchannelQueueId':_0x3a599d[_0xda3b('0x4a')]['id']},'transaction':_0x5000cb});});})[_0xda3b('0x29')](function(){_0x471db1[_0xda3b('0x72')](function(_0x449393){socket[_0xda3b('0x73')](_0xda3b('0x74'),{'UserId':_0x449393['id'],'OpenchannelQueueId':_0x4b029a['id']});});});});});}})[_0xda3b('0x29')](respondWithStatusCode(_0x5b6acf,null))[_0xda3b('0x49')](handleError(_0x5b6acf,null));};exports[_0xda3b('0x75')]=function(_0x4844a7,_0x28e5be,_0x3006d8){return db[_0xda3b('0x68')][_0xda3b('0x47')]({'where':{'id':_0x4844a7[_0xda3b('0x33')][_0xda3b('0x76')]},'attributes':['id'],'include':[{'model':db[_0xda3b('0x6b')],'as':_0xda3b('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28e5be,null))[_0xda3b('0x29')](function(_0x2243a1){var _0x437673=_[_0xda3b('0x5c')](_0x2243a1,'id');var _0x5826fb=[];var _0x521880=[];var _0x2debbe=squel[_0xda3b('0x77')]();_0x2debbe[_0xda3b('0x43')]('tq.TeamId')[_0xda3b('0x78')](_0xda3b('0x79'),'tq')[_0xda3b('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xda3b('0x3c')](_0xda3b('0x7b'),_0x4844a7[_0xda3b('0x4a')]['id']);for(var _0x5d5cfa=0x0;_0x5d5cfa<_0x2243a1['length'];_0x5d5cfa+=0x1){let _0x57e9ee=_0x2243a1[_0x5d5cfa];for(var _0x590a91=0x0;_0x590a91<_0x57e9ee[_0xda3b('0x6e')][_0xda3b('0x39')];_0x590a91+=0x1){let _0x34eae4=_0x57e9ee[_0xda3b('0x6e')][_0x590a91];var _0x17d908=_0x2debbe['clone']();_0x17d908[_0xda3b('0x3c')](_0xda3b('0x7c'),_0x34eae4['id']);_0x521880['push'](db[_0xda3b('0x6f')][_0xda3b('0x33')](_0x17d908[_0xda3b('0x7d')](),{'type':db[_0xda3b('0x6f')][_0xda3b('0x7e')][_0xda3b('0x7f')]})[_0xda3b('0x29')](function(_0x2dffe8){if(_0x2dffe8[_0xda3b('0x39')]===0x1){return _0x34eae4['id'];}else{var _0x925356=_[_0xda3b('0x80')](_[_0xda3b('0x5c')](_0x2dffe8,_0xda3b('0x81')),function(_0x42beb1){return _['includes'](_0x437673,_0x42beb1);});if(_0x925356){return _0x34eae4['id'];}}}));}}return BPromise[_0xda3b('0x82')](_0x521880)[_0xda3b('0x29')](function(_0x547c00){_0x5826fb=_(_0x5826fb)[_0xda3b('0x83')](_0x547c00)[_0xda3b('0x84')]()[_0xda3b('0x85')]();return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x4844a7[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](function(_0x5d8f27){return db[_0xda3b('0x6f')][_0xda3b('0x86')](function(_0x121002){return _0x5d8f27[_0xda3b('0x75')](_0x4844a7[_0xda3b('0x33')]['ids'],{'transaction':_0x121002})[_0xda3b('0x29')](function(){if(!_[_0xda3b('0x87')](_0x5826fb)){return _0x5d8f27[_0xda3b('0x88')](_0x5826fb,{'transaction':_0x121002});}})['then'](function(){_0x5826fb[_0xda3b('0x72')](function(_0xd741bd){socket[_0xda3b('0x73')](_0xda3b('0x89'),{'UserId':_0xd741bd,'OpenchannelQueueId':_0x5d8f27['id']});});});});});});})[_0xda3b('0x29')](respondWithStatusCode(_0x28e5be,null))[_0xda3b('0x49')](handleError(_0x28e5be,null));};exports['addAgents']=function(_0x4c5885,_0x5d35d7,_0x3b758a){return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x4c5885['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x5d35d7,null))['then'](function(_0x58c570){if(_0x58c570){return _0x58c570['addAgents'](_0x4c5885[_0xda3b('0x4d')][_0xda3b('0x76')],_['omit'](_0x4c5885[_0xda3b('0x4d')],[_0xda3b('0x76'),'id'])||{})[_0xda3b('0x8a')](function(_0x1996bf){for(var _0x37e788=0x0;_0x37e788<_0x4c5885[_0xda3b('0x4d')][_0xda3b('0x76')][_0xda3b('0x39')];_0x37e788+=0x1){socket[_0xda3b('0x73')]('userOpenchannelQueue:save',{'UserId':_0x4c5885['body'][_0xda3b('0x76')][_0x37e788],'OpenchannelQueueId':_0x4c5885[_0xda3b('0x4a')]['id']});}return _0x1996bf;});}})[_0xda3b('0x29')](respondWithResult(_0x5d35d7,null))[_0xda3b('0x49')](handleError(_0x5d35d7,null));};exports[_0xda3b('0x88')]=function(_0x56c1bd,_0x23da8e,_0x5b12f9){return db[_0xda3b('0x45')]['find']({'where':{'id':_0x56c1bd['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x23da8e,null))[_0xda3b('0x29')](function(_0x2d709f){if(_0x2d709f){return _0x2d709f['removeAgents'](_0x56c1bd[_0xda3b('0x33')]['ids'])[_0xda3b('0x29')](function(){if(_['isArray'](_0x56c1bd['query'][_0xda3b('0x76')])){for(var _0x222ac3=0x0;_0x222ac3<_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')][_0xda3b('0x39')];_0x222ac3+=0x1){socket[_0xda3b('0x73')](_0xda3b('0x89'),{'UserId':Number(_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')][_0x222ac3]),'OpenchannelQueueId':Number(_0x56c1bd[_0xda3b('0x4a')]['id'])});}}else{socket[_0xda3b('0x73')]('userOpenchannelQueue:remove',{'UserId':Number(_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')]),'OpenchannelQueueId':Number(_0x56c1bd[_0xda3b('0x4a')]['id'])});}});}})[_0xda3b('0x29')](respondWithStatusCode(_0x23da8e,null))[_0xda3b('0x49')](handleError(_0x23da8e,null));};exports[_0xda3b('0x8b')]=function(_0x30aaea,_0x22d1a0,_0x12c342){var _0x3c88fb={};var _0x27c137={};var _0x2abb2f;var _0x4574c2;return db[_0xda3b('0x45')]['findOne']({'where':{'id':_0x30aaea[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x22d1a0,null))[_0xda3b('0x29')](function(_0x2fe491){if(_0x2fe491){_0x2abb2f=_0x2fe491;_0x27c137[_0xda3b('0x36')]=_[_0xda3b('0x32')](db['User'][_0xda3b('0x4b')]);_0x27c137['query']=_[_0xda3b('0x32')](_0x30aaea['query']);_0x27c137[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x27c137[_0xda3b('0x36')],_0x27c137['query']);_0x3c88fb['attributes']=_['intersection'](_0x27c137[_0xda3b('0x36')],qs[_0xda3b('0x37')](_0x30aaea['query'][_0xda3b('0x37')]));_0x3c88fb[_0xda3b('0x38')]=_0x3c88fb['attributes'][_0xda3b('0x39')]?_0x3c88fb[_0xda3b('0x38')]:_0x27c137[_0xda3b('0x36')];_0x3c88fb[_0xda3b('0x5a')]=qs[_0xda3b('0x3b')](_0x30aaea[_0xda3b('0x33')]['sort']);_0x3c88fb[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x30aaea[_0xda3b('0x33')],_0x27c137[_0xda3b('0x34')]));if(_0x30aaea[_0xda3b('0x33')]['filter']){_0x3c88fb[_0xda3b('0x3c')]=_['merge'](_0x3c88fb[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x3c88fb[_0xda3b('0x38')],function(_0x1b27ff){var _0x30f0={};_0x30f0[_0x1b27ff]={'$like':'%'+_0x30aaea[_0xda3b('0x33')][_0xda3b('0x3e')]+'%'};return _0x30f0;})});}_0x3c88fb=_['merge']({},_0x3c88fb,_0x30aaea[_0xda3b('0x44')]);return _0x2abb2f['getAgents'](_0x3c88fb);}})[_0xda3b('0x29')](function(_0x31ecab){if(_0x31ecab){_0x4574c2=_0x31ecab[_0xda3b('0x39')];if(!_0x30aaea[_0xda3b('0x33')][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x3c88fb[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x30aaea[_0xda3b('0x33')][_0xda3b('0x24')]);_0x3c88fb[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x30aaea[_0xda3b('0x33')][_0xda3b('0x23')]);}return _0x2abb2f['getAgents'](_0x3c88fb);}})[_0xda3b('0x29')](function(_0x2f7112){if(_0x2f7112){return _0x2f7112?{'count':_0x4574c2,'rows':_0x2f7112}:null;}})[_0xda3b('0x29')](respondWithResult(_0x22d1a0,null))[_0xda3b('0x49')](handleError(_0x22d1a0,null));}; \ No newline at end of file +var _0xcd56=['redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','map','type','VIRTUAL','field','filter','options','OpenchannelQueue','count','include','findAll','catch','params','merge','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','teams','Team','Agents','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x223b3e,_0x473457){var _0x210292=function(_0x5e1101){while(--_0x5e1101){_0x223b3e['push'](_0x223b3e['shift']());}};_0x210292(++_0x473457);}(_0xcd56,0xfa));var _0x6cd5=function(_0xccabf0,_0x3d82db){_0xccabf0=_0xccabf0-0x0;var _0x591c97=_0xcd56[_0xccabf0];return _0x591c97;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6cd5('0x0'));var zipdir=require(_0x6cd5('0x1'));var jsonpatch=require(_0x6cd5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6cd5('0x3'));var Mustache=require(_0x6cd5('0x4'));var util=require(_0x6cd5('0x5'));var path=require(_0x6cd5('0x6'));var sox=require(_0x6cd5('0x7'));var csv=require(_0x6cd5('0x8'));var ejs=require(_0x6cd5('0x9'));var fs=require('fs');var _=require(_0x6cd5('0xa'));var squel=require(_0x6cd5('0xb'));var crypto=require(_0x6cd5('0xc'));var jsforce=require(_0x6cd5('0xd'));var deskjs=require(_0x6cd5('0xe'));var toCsv=require(_0x6cd5('0x8'));var querystring=require(_0x6cd5('0xf'));var Papa=require(_0x6cd5('0x10'));var Redis=require('ioredis');var authService=require(_0x6cd5('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6cd5('0x12'));var logger=require(_0x6cd5('0x13'))(_0x6cd5('0x14'));var utils=require('../../config/utils');var config=require(_0x6cd5('0x15'));var db=require('../../mysqldb')['db'];config[_0x6cd5('0x16')]=_['defaults'](config[_0x6cd5('0x16')],{'host':_0x6cd5('0x17'),'port':0x18eb});var socket=require(_0x6cd5('0x18'))(new Redis(config[_0x6cd5('0x16')]));require(_0x6cd5('0x19'))[_0x6cd5('0x1a')](socket);function respondWithStatusCode(_0x1d719e,_0x5d66be){_0x5d66be=_0x5d66be||0xcc;return function(_0x1c1904){if(_0x1c1904){return _0x1d719e[_0x6cd5('0x1b')](_0x5d66be);}return _0x1d719e[_0x6cd5('0x1c')](_0x5d66be)['end']();};}function respondWithResult(_0x5671c4,_0x1a6783){_0x1a6783=_0x1a6783||0xc8;return function(_0x2c385c){if(_0x2c385c){return _0x5671c4[_0x6cd5('0x1c')](_0x1a6783)[_0x6cd5('0x1d')](_0x2c385c);}};}function respondWithFilteredResult(_0x4f0486,_0x2be766){return function(_0x2b21d0){if(_0x2b21d0){var _0x446cd5=_0x2b21d0['count'],_0x2de803=_0x2be766[_0x6cd5('0x1e')],_0x430511=_0x2be766[_0x6cd5('0x1e')]+_0x2be766['limit'],_0x3e4a45;if(_0x430511>=_0x446cd5){_0x430511=_0x446cd5;_0x3e4a45=0xc8;}else{_0x3e4a45=0xce;}_0x4f0486[_0x6cd5('0x1c')](_0x3e4a45);return _0x4f0486['set'](_0x6cd5('0x1f'),_0x2de803+'-'+_0x430511+'/'+_0x446cd5)[_0x6cd5('0x1d')](_0x2b21d0);}return null;};}function patchUpdates(_0x1f167c){return function(_0x3149d7){try{jsonpatch[_0x6cd5('0x20')](_0x3149d7,_0x1f167c,!![]);}catch(_0x10c2d1){return BPromise[_0x6cd5('0x21')](_0x10c2d1);}return _0x3149d7[_0x6cd5('0x22')]();};}function saveUpdates(_0x30682c,_0x125387){return function(_0x9d55c2){if(_0x9d55c2){return _0x9d55c2[_0x6cd5('0x23')](_0x30682c)[_0x6cd5('0x24')](function(_0x187dc7){return _0x187dc7;});}return null;};}function removeEntity(_0xa12467,_0x4236c7){return function(_0x80644c){if(_0x80644c){return _0x80644c[_0x6cd5('0x25')]()[_0x6cd5('0x24')](function(){var _0x34c4dc=_0x80644c['get']({'plain':!![]});var _0x14461f='OpenchannelQueues';return db[_0x6cd5('0x26')][_0x6cd5('0x25')]({'where':{'type':_0x14461f,'resourceId':_0x34c4dc['id']}})[_0x6cd5('0x24')](function(){return _0x80644c;});})[_0x6cd5('0x24')](function(){_0xa12467['status'](0xcc)[_0x6cd5('0x27')]();});}};}function handleEntityNotFound(_0x5e15b6,_0x4a0474){return function(_0x88d53b){if(!_0x88d53b){_0x5e15b6[_0x6cd5('0x1b')](0x194);}return _0x88d53b;};}function handleError(_0x5459fb,_0xf14bb0){_0xf14bb0=_0xf14bb0||0x1f4;return function(_0x3ffe93){logger[_0x6cd5('0x28')](_0x3ffe93['stack']);if(_0x3ffe93[_0x6cd5('0x29')]){delete _0x3ffe93[_0x6cd5('0x29')];}_0x5459fb[_0x6cd5('0x1c')](_0xf14bb0)['send'](_0x3ffe93);};}exports[_0x6cd5('0x2a')]=function(_0x56944c,_0x78b8fc){var _0x4a99da={},_0x4fcff0={},_0x18d716={'count':0x0,'rows':[]};var _0x17b84e=db['OpenchannelQueue'][_0x6cd5('0x2b')];_0x4fcff0[_0x6cd5('0x2c')]=_[_0x6cd5('0x2d')](_0x17b84e);_0x4fcff0[_0x6cd5('0x2e')]=_['keys'](_0x56944c[_0x6cd5('0x2e')]);_0x4fcff0[_0x6cd5('0x2f')]=_['intersection'](_0x4fcff0['model'],_0x4fcff0[_0x6cd5('0x2e')]);_0x4a99da['attributes']=_[_0x6cd5('0x30')](_0x4fcff0['model'],qs[_0x6cd5('0x31')](_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x31')]));_0x4a99da[_0x6cd5('0x32')]=_0x4a99da[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x4a99da[_0x6cd5('0x32')]:_0x4fcff0[_0x6cd5('0x2c')];if(!_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x34')]('nolimit')){_0x4a99da[_0x6cd5('0x35')]=qs[_0x6cd5('0x35')](_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x35')]);_0x4a99da[_0x6cd5('0x1e')]=qs['offset'](_0x56944c['query'][_0x6cd5('0x1e')]);}_0x4a99da[_0x6cd5('0x36')]=qs['sort'](_0x56944c['query'][_0x6cd5('0x37')]);_0x4a99da[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x56944c[_0x6cd5('0x2e')],_0x4fcff0[_0x6cd5('0x2f')]));if(_0x56944c[_0x6cd5('0x2e')]['filter']){_0x4a99da['where']=_['merge'](_0x4a99da[_0x6cd5('0x38')],{'$or':_[_0x6cd5('0x3a')](_0x17b84e,function(_0x49c798){if(_0x49c798[_0x6cd5('0x3b')]['key']!==_0x6cd5('0x3c')){var _0x5f2008={};_0x5f2008[_0x49c798[_0x6cd5('0x3d')]]={'$like':'%'+_0x56944c[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x5f2008;}})});}_0x4a99da=_['merge']({},_0x4a99da,_0x56944c[_0x6cd5('0x3f')]);var _0x4689d7={'where':_0x4a99da[_0x6cd5('0x38')]};return db[_0x6cd5('0x40')][_0x6cd5('0x41')](_0x4689d7)['then'](function(_0x105c9a){_0x18d716[_0x6cd5('0x41')]=_0x105c9a;if(_0x56944c[_0x6cd5('0x2e')]['includeAll']){_0x4a99da[_0x6cd5('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x6cd5('0x43')](_0x4a99da);})[_0x6cd5('0x24')](function(_0xbc9419){_0x18d716['rows']=_0xbc9419;return _0x18d716;})['then'](respondWithFilteredResult(_0x78b8fc,_0x4a99da))[_0x6cd5('0x44')](handleError(_0x78b8fc,null));};exports['show']=function(_0x1445e7,_0x5c4572){var _0x35680c={'raw':!![],'where':{'id':_0x1445e7[_0x6cd5('0x45')]['id']}},_0x5b1d1f={};_0x5b1d1f[_0x6cd5('0x2c')]=_['keys'](db[_0x6cd5('0x40')]['rawAttributes']);_0x5b1d1f[_0x6cd5('0x2e')]=_[_0x6cd5('0x2d')](_0x1445e7['query']);_0x5b1d1f[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x5b1d1f[_0x6cd5('0x2c')],_0x5b1d1f[_0x6cd5('0x2e')]);_0x35680c[_0x6cd5('0x32')]=_[_0x6cd5('0x30')](_0x5b1d1f['model'],qs['fields'](_0x1445e7[_0x6cd5('0x2e')]['fields']));_0x35680c[_0x6cd5('0x32')]=_0x35680c['attributes'][_0x6cd5('0x33')]?_0x35680c[_0x6cd5('0x32')]:_0x5b1d1f['model'];if(_0x1445e7['query']['includeAll']){_0x35680c[_0x6cd5('0x42')]=[{'all':!![]}];}_0x35680c=_[_0x6cd5('0x46')]({},_0x35680c,_0x1445e7[_0x6cd5('0x3f')]);return db[_0x6cd5('0x40')]['find'](_0x35680c)[_0x6cd5('0x24')](handleEntityNotFound(_0x5c4572,null))[_0x6cd5('0x24')](respondWithResult(_0x5c4572,null))[_0x6cd5('0x44')](handleError(_0x5c4572,null));};exports[_0x6cd5('0x47')]=function(_0x227ee5,_0x46dc91){return db['OpenchannelQueue'][_0x6cd5('0x47')](_0x227ee5[_0x6cd5('0x48')],{})[_0x6cd5('0x24')](function(_0x2bf7c4){var _0x43bb25=_0x227ee5[_0x6cd5('0x49')][_0x6cd5('0x4a')]({'plain':!![]});if(!_0x43bb25)throw new Error(_0x6cd5('0x4b'));if(_0x43bb25[_0x6cd5('0x4c')]===_0x6cd5('0x49')){var _0x2e7b2b=_0x2bf7c4['get']({'plain':!![]});var _0x4b2412=_0x6cd5('0x4d');return db[_0x6cd5('0x4e')][_0x6cd5('0x4f')]({'where':{'name':_0x4b2412,'userProfileId':_0x43bb25['userProfileId']},'raw':!![]})[_0x6cd5('0x24')](function(_0x38aa9f){if(_0x38aa9f&&_0x38aa9f[_0x6cd5('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e7b2b['name'],'resourceId':_0x2e7b2b['id'],'type':_0x38aa9f[_0x6cd5('0x29')],'sectionId':_0x38aa9f['id']},{})[_0x6cd5('0x24')](function(){return _0x2bf7c4;});}else{return _0x2bf7c4;}})[_0x6cd5('0x44')](function(_0x428cbc){logger[_0x6cd5('0x28')](_0x6cd5('0x51'),_0x428cbc);throw _0x428cbc;});}return _0x2bf7c4;})[_0x6cd5('0x24')](respondWithResult(_0x46dc91,0xc9))['catch'](handleError(_0x46dc91,null));};exports[_0x6cd5('0x23')]=function(_0x3767bb,_0x50e09b){if(_0x3767bb[_0x6cd5('0x48')]['id']){delete _0x3767bb[_0x6cd5('0x48')]['id'];}return db[_0x6cd5('0x40')]['find']({'where':{'id':_0x3767bb[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x50e09b,null))['then'](saveUpdates(_0x3767bb['body'],null))[_0x6cd5('0x24')](respondWithResult(_0x50e09b,null))[_0x6cd5('0x44')](handleError(_0x50e09b,null));};exports[_0x6cd5('0x25')]=function(_0xadce10,_0x5b5077){return db[_0x6cd5('0x40')]['find']({'where':{'id':_0xadce10['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x5b5077,null))['then'](removeEntity(_0x5b5077,null))[_0x6cd5('0x44')](handleError(_0x5b5077,null));};exports[_0x6cd5('0x52')]=function(_0x5f0cc5,_0xca0d78){return db[_0x6cd5('0x40')][_0x6cd5('0x52')]()[_0x6cd5('0x24')](respondWithResult(_0xca0d78,null))[_0x6cd5('0x44')](handleError(_0xca0d78,null));};exports[_0x6cd5('0x53')]=function(_0x264139,_0x1b0da0,_0x575209){var _0x18fc60={'raw':!![],'where':{}},_0x1ad30b={},_0x378977;return db[_0x6cd5('0x40')][_0x6cd5('0x54')]({'where':{'id':_0x264139[_0x6cd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b0da0,null))[_0x6cd5('0x24')](function(_0x8d8f5b){if(_0x8d8f5b){_0x378977=_0x8d8f5b[_0x6cd5('0x4a')]({'plain':!![]});_0x1ad30b[_0x6cd5('0x2c')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x1ad30b[_0x6cd5('0x2e')]=_[_0x6cd5('0x2d')](_0x264139[_0x6cd5('0x2e')]);_0x1ad30b[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x1ad30b[_0x6cd5('0x2c')],_0x1ad30b['query']);_0x18fc60['attributes']=_[_0x6cd5('0x30')](_0x1ad30b[_0x6cd5('0x2c')],qs[_0x6cd5('0x31')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x31')]));_0x18fc60['attributes']=_0x18fc60[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x18fc60['attributes']:_0x1ad30b[_0x6cd5('0x2c')];if(!_0x264139['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0x18fc60[_0x6cd5('0x35')]=qs[_0x6cd5('0x35')](_0x264139[_0x6cd5('0x2e')]['limit']);_0x18fc60[_0x6cd5('0x1e')]=qs[_0x6cd5('0x1e')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x1e')]);}_0x18fc60[_0x6cd5('0x36')]=qs[_0x6cd5('0x37')](_0x264139[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0x18fc60[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x264139[_0x6cd5('0x2e')],_0x1ad30b['filters']));_0x18fc60['where'][_0x6cd5('0x56')]=_0x8d8f5b['id'];if(_0x264139['query'][_0x6cd5('0x3e')]){_0x18fc60['where']=_[_0x6cd5('0x46')](_0x18fc60['where'],{'$or':_['map'](_0x18fc60[_0x6cd5('0x32')],function(_0x3b8ba2){var _0x2a3d02={};_0x2a3d02[_0x3b8ba2]={'$like':'%'+_0x264139['query']['filter']+'%'};return _0x2a3d02;})});}_0x18fc60=_[_0x6cd5('0x46')]({},_0x18fc60,_0x264139[_0x6cd5('0x3f')]);return db[_0x6cd5('0x57')][_0x6cd5('0x43')](_0x18fc60);}})[_0x6cd5('0x24')](function(_0x5ced86){if(_0x5ced86){return db[_0x6cd5('0x58')][_0x6cd5('0x59')]({'where':{'id':_[_0x6cd5('0x3a')](_0x5ced86,_0x6cd5('0x5a')),'role':_0x6cd5('0x5b')},'attributes':['id',_0x6cd5('0x29'),_0x6cd5('0x5c'),_0x6cd5('0x5d'),_0x6cd5('0x5e')]});}})['then'](function(_0xcb3f84){if(_0xcb3f84){return{'count':_0xcb3f84[_0x6cd5('0x41')],'rows':_['map'](_0xcb3f84['rows'],function(_0x38bfa5){return{'membername':_0x38bfa5[_0x6cd5('0x29')],'UserId':_0x38bfa5['id'],'queue_name':_0x378977[_0x6cd5('0x29')],'OpenchannelQueueId':_0x378977['id'],'interface':util['format'](_0x6cd5('0x5f'),_0x6cd5('0x60'),_0x38bfa5[_0x6cd5('0x29')]),'penalty':0x0,'paused':_0x38bfa5['openchannelPause'],'createdAt':_0x38bfa5[_0x6cd5('0x5e')],'updatedAt':_0x38bfa5[_0x6cd5('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cd5('0x24')](respondWithFilteredResult(_0x1b0da0,_0x18fc60))[_0x6cd5('0x44')](handleError(_0x1b0da0,null));};exports[_0x6cd5('0x61')]=function(_0x21a2d9,_0x118bda,_0x3cfcd5){var _0xfecd32={};var _0x43126b={};var _0xc7b8af;var _0x3d5eb0;return db[_0x6cd5('0x40')]['findOne']({'where':{'id':_0x21a2d9['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x118bda,null))[_0x6cd5('0x24')](function(_0x465554){if(_0x465554){_0xc7b8af=_0x465554;_0x43126b['model']=_[_0x6cd5('0x2d')](db['Team'][_0x6cd5('0x2b')]);_0x43126b['query']=_[_0x6cd5('0x2d')](_0x21a2d9[_0x6cd5('0x2e')]);_0x43126b[_0x6cd5('0x2f')]=_[_0x6cd5('0x30')](_0x43126b['model'],_0x43126b[_0x6cd5('0x2e')]);_0xfecd32[_0x6cd5('0x32')]=_['intersection'](_0x43126b[_0x6cd5('0x2c')],qs[_0x6cd5('0x31')](_0x21a2d9[_0x6cd5('0x2e')]['fields']));_0xfecd32[_0x6cd5('0x32')]=_0xfecd32[_0x6cd5('0x32')]['length']?_0xfecd32[_0x6cd5('0x32')]:_0x43126b['model'];_0xfecd32[_0x6cd5('0x36')]=qs[_0x6cd5('0x37')](_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0xfecd32[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x21a2d9[_0x6cd5('0x2e')],_0x43126b[_0x6cd5('0x2f')]));if(_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x3e')]){_0xfecd32['where']=_[_0x6cd5('0x46')](_0xfecd32[_0x6cd5('0x38')],{'$or':_['map'](_0xfecd32[_0x6cd5('0x32')],function(_0x86eeaf){var _0x33c050={};_0x33c050[_0x86eeaf]={'$like':'%'+_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x33c050;})});}_0xfecd32=_['merge']({},_0xfecd32,_0x21a2d9[_0x6cd5('0x3f')]);return _0xc7b8af['getTeams'](_0xfecd32);}})[_0x6cd5('0x24')](function(_0x145bb5){if(_0x145bb5){_0x3d5eb0=_0x145bb5['length'];if(!_0x21a2d9['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0xfecd32['limit']=qs['limit'](_0x21a2d9['query'][_0x6cd5('0x35')]);_0xfecd32[_0x6cd5('0x1e')]=qs['offset'](_0x21a2d9[_0x6cd5('0x2e')][_0x6cd5('0x1e')]);}return _0xc7b8af[_0x6cd5('0x61')](_0xfecd32);}})[_0x6cd5('0x24')](function(_0x18fb59){if(_0x18fb59){return _0x18fb59?{'count':_0x3d5eb0,'rows':_0x18fb59}:null;}})[_0x6cd5('0x24')](respondWithResult(_0x118bda,null))[_0x6cd5('0x44')](handleError(_0x118bda,null));};exports['addTeams']=function(_0x162e4c,_0x5393e0,_0x229e5a){var _0x4a5898=_0x162e4c[_0x6cd5('0x48')][_0x6cd5('0x62')];return db[_0x6cd5('0x63')][_0x6cd5('0x43')]({'where':{'id':_[_0x6cd5('0x3a')](_0x4a5898,'id')},'attributes':['id'],'include':[{'model':db[_0x6cd5('0x58')],'as':_0x6cd5('0x64'),'attributes':['id','name','online','voicePause',_0x6cd5('0x65')],'raw':!![]}]})[_0x6cd5('0x24')](function(_0x27298e){if(_0x27298e){var _0xeb227e=_[_0x6cd5('0x66')](_0x27298e,function(_0x2b4f9b){var _0x4f23ca=_0x2b4f9b[_0x6cd5('0x4a')]({'plain':!![]});return _0x4f23ca[_0x6cd5('0x64')];});return db[_0x6cd5('0x40')][_0x6cd5('0x4f')]({'where':{'id':_0x162e4c[_0x6cd5('0x45')]['id']}})['then'](function(_0x2cbc1f){return db['sequelize'][_0x6cd5('0x67')](function(_0xbb2341){return _0x2cbc1f[_0x6cd5('0x68')](_[_0x6cd5('0x3a')](_0x4a5898,'id'),{'transaction':_0xbb2341})[_0x6cd5('0x24')](function(){return BPromise['each'](_0xeb227e,function(_0x4fb1be){return db[_0x6cd5('0x57')][_0x6cd5('0x69')]({'where':{'UserId':_0x4fb1be['id'],'OpenchannelQueueId':_0x162e4c['params']['id']},'transaction':_0xbb2341});});})[_0x6cd5('0x24')](function(){_0xeb227e[_0x6cd5('0x6a')](function(_0x6fff2d){socket[_0x6cd5('0x6b')]('userOpenchannelQueue:save',{'UserId':_0x6fff2d['id'],'OpenchannelQueueId':_0x2cbc1f['id']});});});});});}})[_0x6cd5('0x24')](respondWithStatusCode(_0x5393e0,null))[_0x6cd5('0x44')](handleError(_0x5393e0,null));};exports[_0x6cd5('0x6c')]=function(_0xda0c3d,_0xac7bff,_0x1eeb28){return db['Team'][_0x6cd5('0x43')]({'where':{'id':_0xda0c3d[_0x6cd5('0x2e')][_0x6cd5('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x6cd5('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cd5('0x24')](handleEntityNotFound(_0xac7bff,null))[_0x6cd5('0x24')](function(_0x78cd17){var _0x20aa88=_[_0x6cd5('0x3a')](_0x78cd17,'id');var _0x5f4f16=[];var _0x3e039e=[];var _0x16741f=squel[_0x6cd5('0x6e')]();_0x16741f['field'](_0x6cd5('0x6f'))[_0x6cd5('0x70')](_0x6cd5('0x71'),'tq')[_0x6cd5('0x72')](_0x6cd5('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6cd5('0x38')](_0x6cd5('0x74'),_0xda0c3d[_0x6cd5('0x45')]['id']);for(var _0x59f87d=0x0;_0x59f87d<_0x78cd17['length'];_0x59f87d+=0x1){let _0x8fac0e=_0x78cd17[_0x59f87d];for(var _0x5b2aa1=0x0;_0x5b2aa1<_0x8fac0e['Agents'][_0x6cd5('0x33')];_0x5b2aa1+=0x1){let _0x38f59e=_0x8fac0e[_0x6cd5('0x64')][_0x5b2aa1];var _0x39affd=_0x16741f[_0x6cd5('0x75')]();_0x39affd[_0x6cd5('0x38')](_0x6cd5('0x76'),_0x38f59e['id']);_0x3e039e[_0x6cd5('0x77')](db[_0x6cd5('0x78')][_0x6cd5('0x2e')](_0x39affd[_0x6cd5('0x79')](),{'type':db[_0x6cd5('0x78')][_0x6cd5('0x7a')][_0x6cd5('0x7b')]})['then'](function(_0x52002c){if(_0x52002c['length']===0x1){return _0x38f59e['id'];}else{var _0x4c6947=_['every'](_['map'](_0x52002c,'TeamId'),function(_0x564751){return _[_0x6cd5('0x7c')](_0x20aa88,_0x564751);});if(_0x4c6947){return _0x38f59e['id'];}}}));}}return BPromise[_0x6cd5('0x7d')](_0x3e039e)[_0x6cd5('0x24')](function(_0x58072f){_0x5f4f16=_(_0x5f4f16)['union'](_0x58072f)[_0x6cd5('0x7e')]()[_0x6cd5('0x7f')]();return db['OpenchannelQueue'][_0x6cd5('0x4f')]({'where':{'id':_0xda0c3d['params']['id']}})[_0x6cd5('0x24')](function(_0x50de7e){return db[_0x6cd5('0x78')][_0x6cd5('0x67')](function(_0x459b83){return _0x50de7e['removeTeams'](_0xda0c3d['query'][_0x6cd5('0x6d')],{'transaction':_0x459b83})[_0x6cd5('0x24')](function(){if(!_[_0x6cd5('0x80')](_0x5f4f16)){return _0x50de7e[_0x6cd5('0x81')](_0x5f4f16,{'transaction':_0x459b83});}})[_0x6cd5('0x24')](function(){_0x5f4f16[_0x6cd5('0x6a')](function(_0x3d1cb7){socket[_0x6cd5('0x6b')]('userOpenchannelQueue:remove',{'UserId':_0x3d1cb7,'OpenchannelQueueId':_0x50de7e['id']});});});});});});})[_0x6cd5('0x24')](respondWithStatusCode(_0xac7bff,null))[_0x6cd5('0x44')](handleError(_0xac7bff,null));};exports[_0x6cd5('0x82')]=function(_0x56f85e,_0x40bac,_0x6aefff){return db['OpenchannelQueue']['find']({'where':{'id':_0x56f85e[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x40bac,null))['then'](function(_0x2f5c75){if(_0x2f5c75){return _0x2f5c75['addAgents'](_0x56f85e['body'][_0x6cd5('0x6d')],_[_0x6cd5('0x83')](_0x56f85e[_0x6cd5('0x48')],[_0x6cd5('0x6d'),'id'])||{})['spread'](function(_0x2c34b3){for(var _0x2d29fe=0x0;_0x2d29fe<_0x56f85e['body'][_0x6cd5('0x6d')][_0x6cd5('0x33')];_0x2d29fe+=0x1){socket[_0x6cd5('0x6b')](_0x6cd5('0x84'),{'UserId':_0x56f85e[_0x6cd5('0x48')][_0x6cd5('0x6d')][_0x2d29fe],'OpenchannelQueueId':_0x56f85e[_0x6cd5('0x45')]['id']});}return _0x2c34b3;});}})['then'](respondWithResult(_0x40bac,null))[_0x6cd5('0x44')](handleError(_0x40bac,null));};exports[_0x6cd5('0x81')]=function(_0x2bef4c,_0x11c1b5,_0x1ab9d5){return db[_0x6cd5('0x40')][_0x6cd5('0x4f')]({'where':{'id':_0x2bef4c['params']['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x11c1b5,null))['then'](function(_0xef702a){if(_0xef702a){return _0xef702a['removeAgents'](_0x2bef4c[_0x6cd5('0x2e')][_0x6cd5('0x6d')])['then'](function(){if(_[_0x6cd5('0x85')](_0x2bef4c[_0x6cd5('0x2e')]['ids'])){for(var _0x157b7d=0x0;_0x157b7d<_0x2bef4c['query'][_0x6cd5('0x6d')][_0x6cd5('0x33')];_0x157b7d+=0x1){socket[_0x6cd5('0x6b')](_0x6cd5('0x86'),{'UserId':Number(_0x2bef4c[_0x6cd5('0x2e')][_0x6cd5('0x6d')][_0x157b7d]),'OpenchannelQueueId':Number(_0x2bef4c[_0x6cd5('0x45')]['id'])});}}else{socket['emit'](_0x6cd5('0x86'),{'UserId':Number(_0x2bef4c['query']['ids']),'OpenchannelQueueId':Number(_0x2bef4c[_0x6cd5('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x11c1b5,null))[_0x6cd5('0x44')](handleError(_0x11c1b5,null));};exports['getAgents']=function(_0x31822b,_0x2dfbd1,_0x3ba698){var _0x388e35={};var _0xc7fa0b={};var _0x3650d6;var _0x127a56;return db[_0x6cd5('0x40')][_0x6cd5('0x54')]({'where':{'id':_0x31822b[_0x6cd5('0x45')]['id']}})[_0x6cd5('0x24')](handleEntityNotFound(_0x2dfbd1,null))[_0x6cd5('0x24')](function(_0x55b275){if(_0x55b275){_0x3650d6=_0x55b275;_0xc7fa0b['model']=_[_0x6cd5('0x2d')](db[_0x6cd5('0x58')][_0x6cd5('0x2b')]);_0xc7fa0b['query']=_[_0x6cd5('0x2d')](_0x31822b[_0x6cd5('0x2e')]);_0xc7fa0b[_0x6cd5('0x2f')]=_['intersection'](_0xc7fa0b[_0x6cd5('0x2c')],_0xc7fa0b[_0x6cd5('0x2e')]);_0x388e35[_0x6cd5('0x32')]=_[_0x6cd5('0x30')](_0xc7fa0b[_0x6cd5('0x2c')],qs['fields'](_0x31822b['query'][_0x6cd5('0x31')]));_0x388e35['attributes']=_0x388e35[_0x6cd5('0x32')][_0x6cd5('0x33')]?_0x388e35[_0x6cd5('0x32')]:_0xc7fa0b[_0x6cd5('0x2c')];_0x388e35['order']=qs[_0x6cd5('0x37')](_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x37')]);_0x388e35[_0x6cd5('0x38')]=qs[_0x6cd5('0x2f')](_[_0x6cd5('0x39')](_0x31822b[_0x6cd5('0x2e')],_0xc7fa0b['filters']));if(_0x31822b['query'][_0x6cd5('0x3e')]){_0x388e35[_0x6cd5('0x38')]=_[_0x6cd5('0x46')](_0x388e35[_0x6cd5('0x38')],{'$or':_[_0x6cd5('0x3a')](_0x388e35[_0x6cd5('0x32')],function(_0x783882){var _0x2fa7bb={};_0x2fa7bb[_0x783882]={'$like':'%'+_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x3e')]+'%'};return _0x2fa7bb;})});}_0x388e35=_['merge']({},_0x388e35,_0x31822b[_0x6cd5('0x3f')]);return _0x3650d6[_0x6cd5('0x87')](_0x388e35);}})['then'](function(_0x505726){if(_0x505726){_0x127a56=_0x505726[_0x6cd5('0x33')];if(!_0x31822b['query'][_0x6cd5('0x34')](_0x6cd5('0x55'))){_0x388e35['limit']=qs[_0x6cd5('0x35')](_0x31822b[_0x6cd5('0x2e')][_0x6cd5('0x35')]);_0x388e35['offset']=qs[_0x6cd5('0x1e')](_0x31822b[_0x6cd5('0x2e')]['offset']);}return _0x3650d6[_0x6cd5('0x87')](_0x388e35);}})[_0x6cd5('0x24')](function(_0x532f73){if(_0x532f73){return _0x532f73?{'count':_0x127a56,'rows':_0x532f73}:null;}})[_0x6cd5('0x24')](respondWithResult(_0x2dfbd1,null))['catch'](handleError(_0x2dfbd1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 48b3767..8c739b9 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 _0x7bdc=['exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','hook'];(function(_0x2d8035,_0x5b7620){var _0x17d217=function(_0x48268b){while(--_0x48268b){_0x2d8035['push'](_0x2d8035['shift']());}};_0x17d217(++_0x5b7620);}(_0x7bdc,0x133));var _0xc7bd=function(_0x45645f,_0x2bb92c){_0x45645f=_0x45645f-0x0;var _0x26bbe2=_0x7bdc[_0x45645f];return _0x26bbe2;};'use strict';var EventEmitter=require(_0xc7bd('0x0'));var OpenchannelQueue=require(_0xc7bd('0x1'))['db'][_0xc7bd('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc7bd('0x3')](0x0);var events={'afterCreate':_0xc7bd('0x4'),'afterUpdate':_0xc7bd('0x5'),'afterDestroy':_0xc7bd('0x6')};function emitEvent(_0x2984cb){return function(_0x1d7439,_0x39937b,_0x3e9fdb){OpenchannelQueueEvents['emit'](_0x2984cb+':'+_0x1d7439['id'],_0x1d7439);OpenchannelQueueEvents['emit'](_0x2984cb,_0x1d7439);_0x3e9fdb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xc7bd('0x7')](e,emitEvent(event));}}module[_0xc7bd('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4e0b=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x378468,_0x12f853){var _0x4985e3=function(_0x25bdf6){while(--_0x25bdf6){_0x378468['push'](_0x378468['shift']());}};_0x4985e3(++_0x12f853);}(_0x4e0b,0x18b));var _0xb4e0=function(_0x3e24b3,_0x4efa5a){_0x3e24b3=_0x3e24b3-0x0;var _0x34a78c=_0x4e0b[_0x3e24b3];return _0x34a78c;};'use strict';var EventEmitter=require(_0xb4e0('0x0'));var OpenchannelQueue=require(_0xb4e0('0x1'))['db'][_0xb4e0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb4e0('0x3')](0x0);var events={'afterCreate':_0xb4e0('0x4'),'afterUpdate':_0xb4e0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c0d34){return function(_0x50216c,_0x3b1006,_0xa44d2a){OpenchannelQueueEvents[_0xb4e0('0x6')](_0x5c0d34+':'+_0x50216c['id'],_0x50216c);OpenchannelQueueEvents[_0xb4e0('0x6')](_0x5c0d34,_0x50216c);_0xa44d2a(null);};}for(var e in events){if(events[_0xb4e0('0x7')](e)){var event=events[e];OpenchannelQueue[_0xb4e0('0x8')](e,emitEvent(event));}}module[_0xb4e0('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 7ac6873..41e31db 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 _0x4afc=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes'];(function(_0x2e6efa,_0x4de839){var _0x59f46c=function(_0x32b967){while(--_0x32b967){_0x2e6efa['push'](_0x2e6efa['shift']());}};_0x59f46c(++_0x4de839);}(_0x4afc,0x15e));var _0xc4af=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4afc[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xc4af('0x0'));var util=require(_0xc4af('0x1'));var logger=require(_0xc4af('0x2'))(_0xc4af('0x3'));var moment=require(_0xc4af('0x4'));var BPromise=require(_0xc4af('0x5'));var rp=require(_0xc4af('0x6'));var fs=require('fs');var path=require(_0xc4af('0x7'));var rimraf=require(_0xc4af('0x8'));var config=require('../../config/environment');var attributes=require(_0xc4af('0x9'));module['exports']=function(_0x4f74d5,_0x5a1c0c){return _0x4f74d5['define'](_0xc4af('0xa'),attributes,{'tableName':_0xc4af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd25f=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xd25f,0xf4));var _0xfd25=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xd25f[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var logger=require(_0xfd25('0x2'))(_0xfd25('0x3'));var moment=require(_0xfd25('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd25('0x5'));var fs=require('fs');var path=require(_0xfd25('0x6'));var rimraf=require(_0xfd25('0x7'));var config=require(_0xfd25('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xfd25('0x9')]=function(_0x3ebf2e,_0x124d58){return _0x3ebf2e[_0xfd25('0xa')](_0xfd25('0xb'),attributes,{'tableName':_0xfd25('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 b573cb3..2d89c6f 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 _0x8388=['model','map','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueue','options','raw','where','attributes','limit','include'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x8388,0x18d));var _0x8838=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8388[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});config[_0x8838('0xb')]=_[_0x8838('0xc')](config[_0x8838('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8838('0xd'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x8838('0xe')](socket);function respondWithRpcPromise(_0x4b5419,_0x4aedc9,_0x336b66){return new BPromise(function(_0x28de3d,_0x1e728e){return client[_0x8838('0xf')](_0x4b5419,_0x336b66)['then'](function(_0xd472af){logger[_0x8838('0x10')](_0x8838('0x11'),_0x4aedc9,_0x8838('0x12'));logger['debug'](_0x8838('0x13'),_0x4aedc9,'request\x20sent',JSON['stringify'](_0xd472af));if(_0xd472af[_0x8838('0x14')]){if(_0xd472af[_0x8838('0x14')][_0x8838('0x15')]===0x1f4){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);return _0x1e728e(_0xd472af[_0x8838('0x14')]['message']);}logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af['error'][_0x8838('0x16')]);return _0x28de3d(_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);}else{logger['info'](_0x8838('0x11'),_0x4aedc9,'request\x20sent');_0x28de3d(_0xd472af[_0x8838('0x17')][_0x8838('0x16')]);}})[_0x8838('0x18')](function(_0x4eb6e2){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0x4eb6e2);_0x1e728e(_0x4eb6e2);});});}exports['GetOpenchannelQueue']=function(_0x93171b){var _0x2a1ccd=this;return new Promise(function(_0x4c5bed,_0x9de0f6){return db[_0x8838('0x19')]['findAll']({'raw':_0x93171b['options']?_0x93171b[_0x8838('0x1a')][_0x8838('0x1b')]===undefined?!![]:![]:!![],'where':_0x93171b[_0x8838('0x1a')]?_0x93171b[_0x8838('0x1a')][_0x8838('0x1c')]||null:null,'attributes':_0x93171b[_0x8838('0x1a')]?_0x93171b[_0x8838('0x1a')][_0x8838('0x1d')]||null:null,'limit':_0x93171b[_0x8838('0x1a')]?_0x93171b['options'][_0x8838('0x1e')]||null:null,'include':_0x93171b['options']?_0x93171b[_0x8838('0x1a')][_0x8838('0x1f')]?_['map'](_0x93171b['options'][_0x8838('0x1f')],function(_0x2df92b){return{'model':db[_0x2df92b[_0x8838('0x20')]],'as':_0x2df92b['as'],'attributes':_0x2df92b[_0x8838('0x1d')],'include':_0x2df92b[_0x8838('0x1f')]?_[_0x8838('0x21')](_0x2df92b[_0x8838('0x1f')],function(_0x1fe141){return{'model':db[_0x1fe141[_0x8838('0x20')]],'as':_0x1fe141['as'],'attributes':_0x1fe141[_0x8838('0x1d')],'include':_0x1fe141['include']?_['map'](_0x1fe141[_0x8838('0x1f')],function(_0x52907a){return{'model':db[_0x52907a[_0x8838('0x20')]],'as':_0x52907a['as'],'attributes':_0x52907a[_0x8838('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x537c9d){logger[_0x8838('0x10')]('GetOpenchannelQueue',_0x93171b);logger['debug'](_0x8838('0x22'),_0x93171b,JSON[_0x8838('0x23')](_0x537c9d));_0x4c5bed(_0x537c9d);})['catch'](function(_0x3d1bbc){logger[_0x8838('0x14')]('GetOpenchannelQueue',_0x3d1bbc[_0x8838('0x16')],_0x93171b);_0x9de0f6(_0x2a1ccd[_0x8838('0x14')](0x1f4,_0x3d1bbc[_0x8838('0x16')]));});});};exports[_0x8838('0x24')]=function(_0x508ed4){var _0x1e8d12=this;return new Promise(function(_0x700132,_0x4a263b){return db['OpenchannelQueue'][_0x8838('0x25')]({'raw':_0x508ed4['options']?_0x508ed4[_0x8838('0x1a')][_0x8838('0x1b')]===undefined?!![]:![]:!![],'where':_0x508ed4[_0x8838('0x1a')]?_0x508ed4['options'][_0x8838('0x1c')]||null:null,'attributes':_0x508ed4[_0x8838('0x1a')]?_0x508ed4[_0x8838('0x1a')]['attributes']||null:null,'include':_0x508ed4[_0x8838('0x1a')]?_0x508ed4[_0x8838('0x1a')][_0x8838('0x1f')]?_['map'](_0x508ed4['options'][_0x8838('0x1f')],function(_0x1ec9f9){return{'model':db[_0x1ec9f9[_0x8838('0x20')]],'as':_0x1ec9f9['as'],'attributes':_0x1ec9f9[_0x8838('0x1d')],'include':_0x1ec9f9['include']?_[_0x8838('0x21')](_0x1ec9f9[_0x8838('0x1f')],function(_0x256d09){return{'model':db[_0x256d09[_0x8838('0x20')]],'as':_0x256d09['as'],'attributes':_0x256d09[_0x8838('0x1d')],'include':_0x256d09[_0x8838('0x1f')]?_[_0x8838('0x21')](_0x256d09[_0x8838('0x1f')],function(_0x53b47a){return{'model':db[_0x53b47a[_0x8838('0x20')]],'as':_0x53b47a['as'],'attributes':_0x53b47a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5af52e){logger['info'](_0x8838('0x24'),_0x508ed4);logger[_0x8838('0x26')](_0x8838('0x24'),_0x508ed4,JSON['stringify'](_0x5af52e));_0x700132(_0x5af52e);})[_0x8838('0x18')](function(_0x324900){logger[_0x8838('0x14')](_0x8838('0x24'),_0x324900[_0x8838('0x16')],_0x508ed4);_0x4a263b(_0x1e8d12[_0x8838('0x14')](0x1f4,_0x324900[_0x8838('0x16')]));});});}; \ No newline at end of file +var _0xe107=['moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./openchannelQueue.socket','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','map','include','model','then','ShowOpenchannelQueue','find','lodash'];(function(_0x74ecfc,_0x33b113){var _0x5d9156=function(_0x31d1ab){while(--_0x31d1ab){_0x74ecfc['push'](_0x74ecfc['shift']());}};_0x5d9156(++_0x33b113);}(_0xe107,0xb3));var _0x7e10=function(_0x49a08e,_0x5731ad){_0x49a08e=_0x49a08e-0x0;var _0x33cecf=_0xe107[_0x49a08e];return _0x33cecf;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7e10('0x8')]=_[_0x7e10('0x9')](config[_0x7e10('0x8')],{'host':_0x7e10('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e10('0xb'))['register'](socket);function respondWithRpcPromise(_0x4e6825,_0x82e6f3,_0x303f73){return new BPromise(function(_0x2b2850,_0x2bd58a){return client[_0x7e10('0xc')](_0x4e6825,_0x303f73)['then'](function(_0x3576c2){logger['info'](_0x7e10('0xd'),_0x82e6f3,_0x7e10('0xe'));logger[_0x7e10('0xf')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x82e6f3,_0x7e10('0xe'),JSON[_0x7e10('0x10')](_0x3576c2));if(_0x3576c2[_0x7e10('0x11')]){if(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x12')]===0x1f4){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2bd58a(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x82e6f3,_0x3576c2[_0x7e10('0x11')]['message']);return _0x2b2850(_0x3576c2[_0x7e10('0x11')][_0x7e10('0x13')]);}else{logger[_0x7e10('0x14')](_0x7e10('0xd'),_0x82e6f3,'request\x20sent');_0x2b2850(_0x3576c2[_0x7e10('0x15')][_0x7e10('0x13')]);}})[_0x7e10('0x16')](function(_0x5d9da3){logger[_0x7e10('0x11')](_0x7e10('0xd'),_0x82e6f3,_0x5d9da3);_0x2bd58a(_0x5d9da3);});});}exports[_0x7e10('0x17')]=function(_0x585df5){var _0xd742e4=this;return new Promise(function(_0x580ac7,_0x45a0cb){return db[_0x7e10('0x18')]['findAll']({'raw':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1a')]===undefined?!![]:![]:!![],'where':_0x585df5[_0x7e10('0x19')]?_0x585df5['options'][_0x7e10('0x1b')]||null:null,'attributes':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1c')]||null:null,'limit':_0x585df5[_0x7e10('0x19')]?_0x585df5[_0x7e10('0x19')][_0x7e10('0x1d')]||null:null,'include':_0x585df5[_0x7e10('0x19')]?_0x585df5['options']['include']?_[_0x7e10('0x1e')](_0x585df5[_0x7e10('0x19')][_0x7e10('0x1f')],function(_0x13eeb3){return{'model':db[_0x13eeb3['model']],'as':_0x13eeb3['as'],'attributes':_0x13eeb3['attributes'],'include':_0x13eeb3[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x13eeb3[_0x7e10('0x1f')],function(_0x13c7d4){return{'model':db[_0x13c7d4[_0x7e10('0x20')]],'as':_0x13c7d4['as'],'attributes':_0x13c7d4[_0x7e10('0x1c')],'include':_0x13c7d4[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x13c7d4[_0x7e10('0x1f')],function(_0x3b020c){return{'model':db[_0x3b020c[_0x7e10('0x20')]],'as':_0x3b020c['as'],'attributes':_0x3b020c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e10('0x21')](function(_0x884343){logger['info']('GetOpenchannelQueue',_0x585df5);logger[_0x7e10('0xf')](_0x7e10('0x17'),_0x585df5,JSON['stringify'](_0x884343));_0x580ac7(_0x884343);})[_0x7e10('0x16')](function(_0x5db8c9){logger[_0x7e10('0x11')](_0x7e10('0x17'),_0x5db8c9[_0x7e10('0x13')],_0x585df5);_0x45a0cb(_0xd742e4[_0x7e10('0x11')](0x1f4,_0x5db8c9[_0x7e10('0x13')]));});});};exports[_0x7e10('0x22')]=function(_0x5bba9c){var _0x3567d2=this;return new Promise(function(_0x5dce0d,_0xc770e4){return db[_0x7e10('0x18')][_0x7e10('0x23')]({'raw':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1a')]===undefined?!![]:![]:!![],'where':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1b')]||null:null,'attributes':_0x5bba9c['options']?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1c')]||null:null,'include':_0x5bba9c[_0x7e10('0x19')]?_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1f')]?_['map'](_0x5bba9c[_0x7e10('0x19')][_0x7e10('0x1f')],function(_0x919821){return{'model':db[_0x919821[_0x7e10('0x20')]],'as':_0x919821['as'],'attributes':_0x919821['attributes'],'include':_0x919821['include']?_[_0x7e10('0x1e')](_0x919821[_0x7e10('0x1f')],function(_0x3042c1){return{'model':db[_0x3042c1[_0x7e10('0x20')]],'as':_0x3042c1['as'],'attributes':_0x3042c1['attributes'],'include':_0x3042c1[_0x7e10('0x1f')]?_[_0x7e10('0x1e')](_0x3042c1['include'],function(_0x21cb6e){return{'model':db[_0x21cb6e[_0x7e10('0x20')]],'as':_0x21cb6e['as'],'attributes':_0x21cb6e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d5aaa){logger[_0x7e10('0x14')](_0x7e10('0x22'),_0x5bba9c);logger[_0x7e10('0xf')](_0x7e10('0x22'),_0x5bba9c,JSON[_0x7e10('0x10')](_0x4d5aaa));_0x5dce0d(_0x4d5aaa);})[_0x7e10('0x16')](function(_0x24a8ec){logger[_0x7e10('0x11')]('ShowOpenchannelQueue',_0x24a8ec[_0x7e10('0x13')],_0x5bba9c);_0xc770e4(_0x3567d2[_0x7e10('0x11')](0x1f4,_0x24a8ec[_0x7e10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index eb5056f..025ea9e 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5490e71..ac8a2d0 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 018c0bf..4deeded 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 _0x4a40=['DATE','moment','sequelize','STRING'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x4a40,0x75));var _0x04a4=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0x4a40[_0x4990d5];return _0x275e25;};'use strict';var moment=require(_0x04a4('0x0'));var Sequelize=require(_0x04a4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x04a4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x04a4('0x2')]},'joinAt':{'type':Sequelize[_0x04a4('0x3')]},'leaveAt':{'type':Sequelize[_0x04a4('0x3')]},'acceptAt':{'type':Sequelize[_0x04a4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x04a4('0x2')]}}; \ No newline at end of file +var _0xb171=['DATE','moment','sequelize','exports','STRING'];(function(_0x124c89,_0x5c77cc){var _0x41b67b=function(_0x1b6970){while(--_0x1b6970){_0x124c89['push'](_0x124c89['shift']());}};_0x41b67b(++_0x5c77cc);}(_0xb171,0x114));var _0x1b17=function(_0x14eb15,_0xabd837){_0x14eb15=_0x14eb15-0x0;var _0xef34fa=_0xb171[_0x14eb15];return _0xef34fa;};'use strict';var moment=require(_0x1b17('0x0'));var Sequelize=require(_0x1b17('0x1'));module[_0x1b17('0x2')]={'uniqueid':{'type':Sequelize[_0x1b17('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1b17('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1b17('0x4')]},'acceptAt':{'type':Sequelize[_0x1b17('0x4')]},'exitAt':{'type':Sequelize[_0x1b17('0x4')]},'reason':{'type':Sequelize[_0x1b17('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1ef1e0d..1d318b9 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 _0x90d2=['util','path','sox','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','includeAll','include','rows','show','merge','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x139eba,_0x3bac75){var _0x315162=function(_0x3fbab2){while(--_0x3fbab2){_0x139eba['push'](_0x139eba['shift']());}};_0x315162(++_0x3bac75);}(_0x90d2,0x1aa));var _0x290d=function(_0xcfd44a,_0x165cc9){_0xcfd44a=_0xcfd44a-0x0;var _0x46af83=_0x90d2[_0xcfd44a];return _0x46af83;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x290d('0x0'));var rimraf=require(_0x290d('0x1'));var zipdir=require(_0x290d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x290d('0x3'));var moment=require(_0x290d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x290d('0x5'));var util=require(_0x290d('0x6'));var path=require(_0x290d('0x7'));var sox=require(_0x290d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x290d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x290d('0xa'));var deskjs=require(_0x290d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x290d('0xc'));var Papa=require(_0x290d('0xd'));var Redis=require(_0x290d('0xe'));var authService=require(_0x290d('0xf'));var qs=require(_0x290d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x290d('0x11'))(_0x290d('0x12'));var utils=require(_0x290d('0x13'));var config=require(_0x290d('0x14'));var db=require(_0x290d('0x15'))['db'];function respondWithStatusCode(_0x5af173,_0x3afec8){_0x3afec8=_0x3afec8||0xcc;return function(_0x13eec2){if(_0x13eec2){return _0x5af173[_0x290d('0x16')](_0x3afec8);}return _0x5af173[_0x290d('0x17')](_0x3afec8)[_0x290d('0x18')]();};}function respondWithResult(_0x51da6c,_0x1b1339){_0x1b1339=_0x1b1339||0xc8;return function(_0x2bd6d3){if(_0x2bd6d3){return _0x51da6c[_0x290d('0x17')](_0x1b1339)[_0x290d('0x19')](_0x2bd6d3);}};}function respondWithFilteredResult(_0x2aaf29,_0x139ca3){return function(_0x4dba9e){if(_0x4dba9e){var _0xce6462=_0x4dba9e[_0x290d('0x1a')],_0x5564dd=_0x139ca3[_0x290d('0x1b')],_0x7c8bd4=_0x139ca3[_0x290d('0x1b')]+_0x139ca3[_0x290d('0x1c')],_0x40eb3b;if(_0x7c8bd4>=_0xce6462){_0x7c8bd4=_0xce6462;_0x40eb3b=0xc8;}else{_0x40eb3b=0xce;}_0x2aaf29[_0x290d('0x17')](_0x40eb3b);return _0x2aaf29[_0x290d('0x1d')](_0x290d('0x1e'),_0x5564dd+'-'+_0x7c8bd4+'/'+_0xce6462)[_0x290d('0x19')](_0x4dba9e);}return null;};}function patchUpdates(_0x1ab66f){return function(_0x52448d){try{jsonpatch[_0x290d('0x1f')](_0x52448d,_0x1ab66f,!![]);}catch(_0x5c4f0d){return BPromise[_0x290d('0x20')](_0x5c4f0d);}return _0x52448d['save']();};}function saveUpdates(_0x31981f,_0x1900ac){return function(_0x36c5ee){if(_0x36c5ee){return _0x36c5ee[_0x290d('0x21')](_0x31981f)[_0x290d('0x22')](function(_0x5c9d2a){return _0x5c9d2a;});}return null;};}function removeEntity(_0x59f8ff,_0x55b3cc){return function(_0x5d6aae){if(_0x5d6aae){return _0x5d6aae[_0x290d('0x23')]()[_0x290d('0x22')](function(){_0x59f8ff[_0x290d('0x17')](0xcc)[_0x290d('0x18')]();});}};}function handleEntityNotFound(_0x40998d,_0x5630bc){return function(_0x57c048){if(!_0x57c048){_0x40998d['sendStatus'](0x194);}return _0x57c048;};}function handleError(_0xf378f2,_0x5203b8){_0x5203b8=_0x5203b8||0x1f4;return function(_0x1ed444){logger['error'](_0x1ed444[_0x290d('0x24')]);if(_0x1ed444[_0x290d('0x25')]){delete _0x1ed444[_0x290d('0x25')];}_0xf378f2[_0x290d('0x17')](_0x5203b8)[_0x290d('0x26')](_0x1ed444);};}exports[_0x290d('0x27')]=function(_0x4759f9,_0x34e310){var _0x53bca1={},_0x3cfd44={},_0x2290df={'count':0x0,'rows':[]};var _0x3525b7=db[_0x290d('0x28')][_0x290d('0x29')];_0x3cfd44[_0x290d('0x2a')]=_[_0x290d('0x2b')](_0x3525b7);_0x3cfd44[_0x290d('0x2c')]=_['keys'](_0x4759f9[_0x290d('0x2c')]);_0x3cfd44[_0x290d('0x2d')]=_['intersection'](_0x3cfd44[_0x290d('0x2a')],_0x3cfd44[_0x290d('0x2c')]);_0x53bca1[_0x290d('0x2e')]=_[_0x290d('0x2f')](_0x3cfd44['model'],qs[_0x290d('0x30')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x30')]));_0x53bca1[_0x290d('0x2e')]=_0x53bca1[_0x290d('0x2e')][_0x290d('0x31')]?_0x53bca1[_0x290d('0x2e')]:_0x3cfd44[_0x290d('0x2a')];if(!_0x4759f9[_0x290d('0x2c')]['hasOwnProperty'](_0x290d('0x32'))){_0x53bca1['limit']=qs[_0x290d('0x1c')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x1c')]);_0x53bca1[_0x290d('0x1b')]=qs[_0x290d('0x1b')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x1b')]);}_0x53bca1[_0x290d('0x33')]=qs[_0x290d('0x34')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x34')]);_0x53bca1[_0x290d('0x35')]=qs[_0x290d('0x2d')](_[_0x290d('0x36')](_0x4759f9[_0x290d('0x2c')],_0x3cfd44['filters']));if(_0x4759f9[_0x290d('0x2c')][_0x290d('0x37')]){_0x53bca1['where']=_['merge'](_0x53bca1[_0x290d('0x35')],{'$or':_[_0x290d('0x38')](_0x3525b7,function(_0x1a5907){if(_0x1a5907['type'][_0x290d('0x39')]!==_0x290d('0x3a')){var _0x202a02={};_0x202a02[_0x1a5907[_0x290d('0x3b')]]={'$like':'%'+_0x4759f9[_0x290d('0x2c')][_0x290d('0x37')]+'%'};return _0x202a02;}})});}_0x53bca1=_['merge']({},_0x53bca1,_0x4759f9['options']);var _0x204517={'where':_0x53bca1[_0x290d('0x35')]};return db[_0x290d('0x28')][_0x290d('0x1a')](_0x204517)[_0x290d('0x22')](function(_0x1f25bc){_0x2290df[_0x290d('0x1a')]=_0x1f25bc;if(_0x4759f9[_0x290d('0x2c')][_0x290d('0x3c')]){_0x53bca1[_0x290d('0x3d')]=[{'all':!![]}];}return db[_0x290d('0x28')]['findAll'](_0x53bca1);})['then'](function(_0x2109d3){_0x2290df[_0x290d('0x3e')]=_0x2109d3;return _0x2290df;})[_0x290d('0x22')](respondWithFilteredResult(_0x34e310,_0x53bca1))['catch'](handleError(_0x34e310,null));};exports[_0x290d('0x3f')]=function(_0x4a8b62,_0x41d381){var _0x420648={'raw':!![],'where':{'id':_0x4a8b62['params']['id']}},_0x5977b0={};_0x5977b0['model']=_['keys'](db['OpenchannelQueueReport'][_0x290d('0x29')]);_0x5977b0['query']=_['keys'](_0x4a8b62[_0x290d('0x2c')]);_0x5977b0[_0x290d('0x2d')]=_['intersection'](_0x5977b0['model'],_0x5977b0['query']);_0x420648['attributes']=_['intersection'](_0x5977b0[_0x290d('0x2a')],qs[_0x290d('0x30')](_0x4a8b62[_0x290d('0x2c')][_0x290d('0x30')]));_0x420648[_0x290d('0x2e')]=_0x420648['attributes']['length']?_0x420648['attributes']:_0x5977b0[_0x290d('0x2a')];if(_0x4a8b62[_0x290d('0x2c')]['includeAll']){_0x420648['include']=[{'all':!![]}];}_0x420648=_[_0x290d('0x40')]({},_0x420648,_0x4a8b62[_0x290d('0x41')]);return db[_0x290d('0x28')][_0x290d('0x42')](_0x420648)[_0x290d('0x22')](handleEntityNotFound(_0x41d381,null))['then'](respondWithResult(_0x41d381,null))[_0x290d('0x43')](handleError(_0x41d381,null));};exports[_0x290d('0x44')]=function(_0x45104e,_0x22b52e){return db[_0x290d('0x28')][_0x290d('0x44')](_0x45104e[_0x290d('0x45')],{})[_0x290d('0x22')](respondWithResult(_0x22b52e,0xc9))[_0x290d('0x43')](handleError(_0x22b52e,null));};exports[_0x290d('0x21')]=function(_0x413baf,_0x36bcc5){if(_0x413baf[_0x290d('0x45')]['id']){delete _0x413baf[_0x290d('0x45')]['id'];}return db[_0x290d('0x28')][_0x290d('0x42')]({'where':{'id':_0x413baf[_0x290d('0x46')]['id']}})[_0x290d('0x22')](handleEntityNotFound(_0x36bcc5,null))[_0x290d('0x22')](saveUpdates(_0x413baf['body'],null))[_0x290d('0x22')](respondWithResult(_0x36bcc5,null))[_0x290d('0x43')](handleError(_0x36bcc5,null));};exports[_0x290d('0x23')]=function(_0x168761,_0x5fa993){return db['OpenchannelQueueReport'][_0x290d('0x42')]({'where':{'id':_0x168761[_0x290d('0x46')]['id']}})[_0x290d('0x22')](handleEntityNotFound(_0x5fa993,null))[_0x290d('0x22')](removeEntity(_0x5fa993,null))[_0x290d('0x43')](handleError(_0x5fa993,null));};exports['describe']=function(_0x21a15f,_0x2038ab){return db[_0x290d('0x28')][_0x290d('0x47')]()[_0x290d('0x22')](respondWithResult(_0x2038ab,null))['catch'](handleError(_0x2038ab,null));}; \ No newline at end of file +var _0x8148=['type','VIRTUAL','field','filter','options','includeAll','include','rows','catch','params','length','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','order','sort','pick','where','merge','map'];(function(_0x433958,_0x231e64){var _0x1d24aa=function(_0x246be3){while(--_0x246be3){_0x433958['push'](_0x433958['shift']());}};_0x1d24aa(++_0x231e64);}(_0x8148,0x117));var _0x8814=function(_0x4b8d14,_0x4ec792){_0x4b8d14=_0x4b8d14-0x0;var _0x54aeba=_0x8148[_0x4b8d14];return _0x54aeba;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8814('0x0'));var jsonpatch=require(_0x8814('0x1'));var rp=require(_0x8814('0x2'));var moment=require('moment');var BPromise=require(_0x8814('0x3'));var Mustache=require('mustache');var util=require(_0x8814('0x4'));var path=require(_0x8814('0x5'));var sox=require('sox');var csv=require(_0x8814('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8814('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8814('0x8'));var deskjs=require(_0x8814('0x9'));var toCsv=require(_0x8814('0x6'));var querystring=require('querystring');var Papa=require(_0x8814('0xa'));var Redis=require(_0x8814('0xb'));var authService=require(_0x8814('0xc'));var qs=require(_0x8814('0xd'));var hardwareService=require(_0x8814('0xe'));var logger=require(_0x8814('0xf'))(_0x8814('0x10'));var utils=require(_0x8814('0x11'));var config=require(_0x8814('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527d99,_0x5e7feb){_0x5e7feb=_0x5e7feb||0xcc;return function(_0x11de93){if(_0x11de93){return _0x527d99[_0x8814('0x13')](_0x5e7feb);}return _0x527d99[_0x8814('0x14')](_0x5e7feb)[_0x8814('0x15')]();};}function respondWithResult(_0xc5e0c6,_0x1663cf){_0x1663cf=_0x1663cf||0xc8;return function(_0x334dfe){if(_0x334dfe){return _0xc5e0c6[_0x8814('0x14')](_0x1663cf)[_0x8814('0x16')](_0x334dfe);}};}function respondWithFilteredResult(_0x364fe5,_0x2a1a69){return function(_0x561683){if(_0x561683){var _0x2462aa=_0x561683[_0x8814('0x17')],_0x286049=_0x2a1a69[_0x8814('0x18')],_0x3be012=_0x2a1a69[_0x8814('0x18')]+_0x2a1a69[_0x8814('0x19')],_0x661648;if(_0x3be012>=_0x2462aa){_0x3be012=_0x2462aa;_0x661648=0xc8;}else{_0x661648=0xce;}_0x364fe5[_0x8814('0x14')](_0x661648);return _0x364fe5['set'](_0x8814('0x1a'),_0x286049+'-'+_0x3be012+'/'+_0x2462aa)[_0x8814('0x16')](_0x561683);}return null;};}function patchUpdates(_0x4adbfe){return function(_0x5811e1){try{jsonpatch[_0x8814('0x1b')](_0x5811e1,_0x4adbfe,!![]);}catch(_0x5b5ada){return BPromise['reject'](_0x5b5ada);}return _0x5811e1['save']();};}function saveUpdates(_0x31513a,_0x1be9fb){return function(_0x47a3d6){if(_0x47a3d6){return _0x47a3d6[_0x8814('0x1c')](_0x31513a)[_0x8814('0x1d')](function(_0x30aec8){return _0x30aec8;});}return null;};}function removeEntity(_0xe1ba1d,_0x3c4456){return function(_0x429188){if(_0x429188){return _0x429188[_0x8814('0x1e')]()[_0x8814('0x1d')](function(){_0xe1ba1d['status'](0xcc)[_0x8814('0x15')]();});}};}function handleEntityNotFound(_0x53a187,_0x39635c){return function(_0x46e941){if(!_0x46e941){_0x53a187[_0x8814('0x13')](0x194);}return _0x46e941;};}function handleError(_0x51ad8b,_0x4b5200){_0x4b5200=_0x4b5200||0x1f4;return function(_0x33c036){logger[_0x8814('0x1f')](_0x33c036[_0x8814('0x20')]);if(_0x33c036[_0x8814('0x21')]){delete _0x33c036['name'];}_0x51ad8b[_0x8814('0x14')](_0x4b5200)[_0x8814('0x22')](_0x33c036);};}exports[_0x8814('0x23')]=function(_0x50bfb1,_0xf0cde5){var _0x1310b9={},_0x2f465a={},_0x112b20={'count':0x0,'rows':[]};var _0x105252=db[_0x8814('0x24')][_0x8814('0x25')];_0x2f465a[_0x8814('0x26')]=_[_0x8814('0x27')](_0x105252);_0x2f465a[_0x8814('0x28')]=_['keys'](_0x50bfb1['query']);_0x2f465a[_0x8814('0x29')]=_['intersection'](_0x2f465a[_0x8814('0x26')],_0x2f465a[_0x8814('0x28')]);_0x1310b9['attributes']=_[_0x8814('0x2a')](_0x2f465a[_0x8814('0x26')],qs['fields'](_0x50bfb1[_0x8814('0x28')][_0x8814('0x2b')]));_0x1310b9[_0x8814('0x2c')]=_0x1310b9[_0x8814('0x2c')]['length']?_0x1310b9['attributes']:_0x2f465a[_0x8814('0x26')];if(!_0x50bfb1[_0x8814('0x28')]['hasOwnProperty']('nolimit')){_0x1310b9[_0x8814('0x19')]=qs[_0x8814('0x19')](_0x50bfb1[_0x8814('0x28')][_0x8814('0x19')]);_0x1310b9[_0x8814('0x18')]=qs[_0x8814('0x18')](_0x50bfb1['query'][_0x8814('0x18')]);}_0x1310b9[_0x8814('0x2d')]=qs['sort'](_0x50bfb1[_0x8814('0x28')][_0x8814('0x2e')]);_0x1310b9['where']=qs['filters'](_[_0x8814('0x2f')](_0x50bfb1['query'],_0x2f465a[_0x8814('0x29')]));if(_0x50bfb1[_0x8814('0x28')]['filter']){_0x1310b9[_0x8814('0x30')]=_[_0x8814('0x31')](_0x1310b9[_0x8814('0x30')],{'$or':_[_0x8814('0x32')](_0x105252,function(_0x1ef877){if(_0x1ef877[_0x8814('0x33')]['key']!==_0x8814('0x34')){var _0x587e13={};_0x587e13[_0x1ef877[_0x8814('0x35')]]={'$like':'%'+_0x50bfb1['query'][_0x8814('0x36')]+'%'};return _0x587e13;}})});}_0x1310b9=_[_0x8814('0x31')]({},_0x1310b9,_0x50bfb1[_0x8814('0x37')]);var _0x47645e={'where':_0x1310b9[_0x8814('0x30')]};return db[_0x8814('0x24')][_0x8814('0x17')](_0x47645e)[_0x8814('0x1d')](function(_0x176992){_0x112b20[_0x8814('0x17')]=_0x176992;if(_0x50bfb1[_0x8814('0x28')][_0x8814('0x38')]){_0x1310b9[_0x8814('0x39')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x1310b9);})['then'](function(_0x342d23){_0x112b20[_0x8814('0x3a')]=_0x342d23;return _0x112b20;})[_0x8814('0x1d')](respondWithFilteredResult(_0xf0cde5,_0x1310b9))[_0x8814('0x3b')](handleError(_0xf0cde5,null));};exports['show']=function(_0x2e2cb1,_0x5564d3){var _0x3e7a52={'raw':!![],'where':{'id':_0x2e2cb1[_0x8814('0x3c')]['id']}},_0x2ae842={};_0x2ae842['model']=_[_0x8814('0x27')](db[_0x8814('0x24')]['rawAttributes']);_0x2ae842[_0x8814('0x28')]=_[_0x8814('0x27')](_0x2e2cb1[_0x8814('0x28')]);_0x2ae842[_0x8814('0x29')]=_['intersection'](_0x2ae842['model'],_0x2ae842[_0x8814('0x28')]);_0x3e7a52[_0x8814('0x2c')]=_[_0x8814('0x2a')](_0x2ae842[_0x8814('0x26')],qs['fields'](_0x2e2cb1[_0x8814('0x28')]['fields']));_0x3e7a52['attributes']=_0x3e7a52[_0x8814('0x2c')][_0x8814('0x3d')]?_0x3e7a52['attributes']:_0x2ae842[_0x8814('0x26')];if(_0x2e2cb1[_0x8814('0x28')][_0x8814('0x38')]){_0x3e7a52[_0x8814('0x39')]=[{'all':!![]}];}_0x3e7a52=_['merge']({},_0x3e7a52,_0x2e2cb1[_0x8814('0x37')]);return db[_0x8814('0x24')]['find'](_0x3e7a52)[_0x8814('0x1d')](handleEntityNotFound(_0x5564d3,null))[_0x8814('0x1d')](respondWithResult(_0x5564d3,null))[_0x8814('0x3b')](handleError(_0x5564d3,null));};exports[_0x8814('0x3e')]=function(_0x5c1bc1,_0xf385a9){return db[_0x8814('0x24')][_0x8814('0x3e')](_0x5c1bc1[_0x8814('0x3f')],{})[_0x8814('0x1d')](respondWithResult(_0xf385a9,0xc9))[_0x8814('0x3b')](handleError(_0xf385a9,null));};exports['update']=function(_0x508d11,_0x1cbdce){if(_0x508d11[_0x8814('0x3f')]['id']){delete _0x508d11['body']['id'];}return db[_0x8814('0x24')][_0x8814('0x40')]({'where':{'id':_0x508d11[_0x8814('0x3c')]['id']}})[_0x8814('0x1d')](handleEntityNotFound(_0x1cbdce,null))[_0x8814('0x1d')](saveUpdates(_0x508d11[_0x8814('0x3f')],null))[_0x8814('0x1d')](respondWithResult(_0x1cbdce,null))[_0x8814('0x3b')](handleError(_0x1cbdce,null));};exports['destroy']=function(_0x4c80ff,_0x423303){return db['OpenchannelQueueReport'][_0x8814('0x40')]({'where':{'id':_0x4c80ff[_0x8814('0x3c')]['id']}})[_0x8814('0x1d')](handleEntityNotFound(_0x423303,null))[_0x8814('0x1d')](removeEntity(_0x423303,null))[_0x8814('0x3b')](handleError(_0x423303,null));};exports['describe']=function(_0x38a8bc,_0x2dd7c9){return db[_0x8814('0x24')][_0x8814('0x41')]()[_0x8814('0x1d')](respondWithResult(_0x2dd7c9,null))['catch'](handleError(_0x2dd7c9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b8ccd2c..8d6cb9f 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 _0x9567=['lodash','util','../../config/logger','api','moment','path','rimraf','./openchannelQueueReport.attributes','define','OpenchannelQueueReport','uniqueid'];(function(_0x406eea,_0x51d589){var _0x3b11ce=function(_0x4ccf9b){while(--_0x4ccf9b){_0x406eea['push'](_0x406eea['shift']());}};_0x3b11ce(++_0x51d589);}(_0x9567,0xdc));var _0x7956=function(_0x32c31d,_0x1b2935){_0x32c31d=_0x32c31d-0x0;var _0x14c6f5=_0x9567[_0x32c31d];return _0x14c6f5;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var logger=require(_0x7956('0x2'))(_0x7956('0x3'));var moment=require(_0x7956('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7956('0x5'));var rimraf=require(_0x7956('0x6'));var config=require('../../config/environment');var attributes=require(_0x7956('0x7'));module['exports']=function(_0x12c09e,_0x48c4b6){return _0x12c09e[_0x7956('0x8')](_0x7956('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x7956('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','OpenchannelQueueReport','report_openchannel_queue','uniqueid'];(function(_0x5e291d,_0x335924){var _0x7597ec=function(_0x59ce56){while(--_0x59ce56){_0x5e291d['push'](_0x5e291d['shift']());}};_0x7597ec(++_0x335924);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x5ebcf4,_0xa13cd7){_0x5ebcf4=_0x5ebcf4-0x0;var _0x365cfd=_0x4fdb[_0x5ebcf4];return _0x365cfd;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[{'name':_0xb4fd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9d08f0b..8f48fe2 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 _0x4e06=['request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','info','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e06,0x1bb));var _0x64e0=function(_0x45996b,_0x145516){_0x45996b=_0x45996b-0x0;var _0x2defda=_0x4e06[_0x45996b];return _0x2defda;};'use strict';var _=require(_0x64e0('0x0'));var util=require(_0x64e0('0x1'));var moment=require(_0x64e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x64e0('0x3'));var fs=require('fs');var Redis=require(_0x64e0('0x4'));var db=require(_0x64e0('0x5'))['db'];var utils=require(_0x64e0('0x6'));var logger=require(_0x64e0('0x7'))(_0x64e0('0x8'));var config=require(_0x64e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64e0('0xa')][_0x64e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cea6c,_0x469504,_0x3bd2ff){return new BPromise(function(_0x1aeec8,_0x243777){return client[_0x64e0('0xc')](_0x2cea6c,_0x3bd2ff)['then'](function(_0x3b4736){logger['info'](_0x64e0('0xd'),_0x469504,_0x64e0('0xe'));logger[_0x64e0('0xf')](_0x64e0('0x10'),_0x469504,_0x64e0('0xe'),JSON['stringify'](_0x3b4736));if(_0x3b4736[_0x64e0('0x11')]){if(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x12')]===0x1f4){logger[_0x64e0('0x11')](_0x64e0('0xd'),_0x469504,_0x3b4736['error']['message']);return _0x243777(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);}logger[_0x64e0('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x469504,_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);return _0x1aeec8(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);}else{logger['info'](_0x64e0('0xd'),_0x469504,_0x64e0('0xe'));_0x1aeec8(_0x3b4736[_0x64e0('0x14')][_0x64e0('0x13')]);}})[_0x64e0('0x15')](function(_0x54ce99){logger[_0x64e0('0x11')](_0x64e0('0xd'),_0x469504,_0x54ce99);_0x243777(_0x54ce99);});});}exports[_0x64e0('0x16')]=function(_0x393904){var _0x51b9a5=this;return new Promise(function(_0x401e18,_0x3d8320){return db[_0x64e0('0x17')][_0x64e0('0x18')](_0x393904[_0x64e0('0x19')],{'raw':_0x393904[_0x64e0('0x1a')]?_0x393904[_0x64e0('0x1a')][_0x64e0('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x57f1b4){logger[_0x64e0('0x1c')](_0x64e0('0x16'),_0x393904);logger[_0x64e0('0xf')](_0x64e0('0x16'),_0x393904,JSON[_0x64e0('0x1d')](_0x57f1b4));_0x401e18(_0x57f1b4);})[_0x64e0('0x15')](function(_0x245d9b){logger['error'](_0x64e0('0x16'),_0x245d9b[_0x64e0('0x13')],_0x393904);_0x3d8320(_0x51b9a5[_0x64e0('0x11')](0x1f4,_0x245d9b[_0x64e0('0x13')]));});});};exports[_0x64e0('0x1e')]=function(_0x5e7808){var _0x547c1e=this;return new Promise(function(_0x49fc91,_0x8d0862){return db['OpenchannelQueueReport'][_0x64e0('0x1f')](_0x5e7808[_0x64e0('0x19')],{'raw':_0x5e7808[_0x64e0('0x1a')]?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7808['options']?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x20')]||null:null,'attributes':_0x5e7808['options']?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x21')]||null:null,'limit':_0x5e7808[_0x64e0('0x1a')]?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x22')]||null:null})['then'](function(_0x43b5f9){logger[_0x64e0('0x1c')](_0x64e0('0x1e'),_0x5e7808);logger[_0x64e0('0xf')](_0x64e0('0x1e'),_0x5e7808,JSON[_0x64e0('0x1d')](_0x43b5f9));_0x49fc91(_0x43b5f9);})['catch'](function(_0x5410a5){logger[_0x64e0('0x11')](_0x64e0('0x1e'),_0x5410a5['message'],_0x5e7808);_0x8d0862(_0x547c1e[_0x64e0('0x11')](0x1f4,_0x5410a5[_0x64e0('0x13')]));});});}; \ No newline at end of file +var _0x0704=['OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateOpenchannelQueueReport'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x0704,0x196));var _0x4070=function(_0x2e99b7,_0x2d7115){_0x2e99b7=_0x2e99b7-0x0;var _0x1ae8a3=_0x0704[_0x2e99b7];return _0x1ae8a3;};'use strict';var _=require('lodash');var util=require(_0x4070('0x0'));var moment=require(_0x4070('0x1'));var BPromise=require(_0x4070('0x2'));var rs=require(_0x4070('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4070('0x4'))['db'];var utils=require(_0x4070('0x5'));var logger=require(_0x4070('0x6'))(_0x4070('0x7'));var config=require('../../config/environment');var jayson=require(_0x4070('0x8'));var client=jayson[_0x4070('0x9')][_0x4070('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e9d,_0x314a50,_0x206c6b){return new BPromise(function(_0xbe42ff,_0x5c2435){return client[_0x4070('0xb')](_0x3a7e9d,_0x206c6b)[_0x4070('0xc')](function(_0x4e14ca){logger[_0x4070('0xd')](_0x4070('0xe'),_0x314a50,'request\x20sent');logger[_0x4070('0xf')](_0x4070('0x10'),_0x314a50,'request\x20sent',JSON['stringify'](_0x4e14ca));if(_0x4e14ca[_0x4070('0x11')]){if(_0x4e14ca[_0x4070('0x11')]['code']===0x1f4){logger[_0x4070('0x11')](_0x4070('0xe'),_0x314a50,_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);return _0x5c2435(_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);}logger[_0x4070('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x314a50,_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);return _0xbe42ff(_0x4e14ca[_0x4070('0x11')][_0x4070('0x12')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x314a50,_0x4070('0x13'));_0xbe42ff(_0x4e14ca[_0x4070('0x14')][_0x4070('0x12')]);}})[_0x4070('0x15')](function(_0x4ee31f){logger[_0x4070('0x11')](_0x4070('0xe'),_0x314a50,_0x4ee31f);_0x5c2435(_0x4ee31f);});});}exports[_0x4070('0x16')]=function(_0x146bbf){var _0x2348e0=this;return new Promise(function(_0x4f29cb,_0x11703f){return db[_0x4070('0x17')][_0x4070('0x18')](_0x146bbf[_0x4070('0x19')],{'raw':_0x146bbf[_0x4070('0x1a')]?_0x146bbf['options'][_0x4070('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x45c95a){logger[_0x4070('0xd')](_0x4070('0x16'),_0x146bbf);logger['debug'](_0x4070('0x16'),_0x146bbf,JSON[_0x4070('0x1c')](_0x45c95a));_0x4f29cb(_0x45c95a);})[_0x4070('0x15')](function(_0x5350a7){logger[_0x4070('0x11')](_0x4070('0x16'),_0x5350a7[_0x4070('0x12')],_0x146bbf);_0x11703f(_0x2348e0[_0x4070('0x11')](0x1f4,_0x5350a7[_0x4070('0x12')]));});});};exports[_0x4070('0x1d')]=function(_0x2668ce){var _0x3881ca=this;return new Promise(function(_0x24aae4,_0x326e04){return db[_0x4070('0x17')][_0x4070('0x1e')](_0x2668ce['body'],{'raw':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')]['where']||null:null,'attributes':_0x2668ce[_0x4070('0x1a')]?_0x2668ce['options'][_0x4070('0x1f')]||null:null,'limit':_0x2668ce[_0x4070('0x1a')]?_0x2668ce[_0x4070('0x1a')][_0x4070('0x20')]||null:null})['then'](function(_0x44602a){logger[_0x4070('0xd')]('UpdateOpenchannelQueueReport',_0x2668ce);logger[_0x4070('0xf')](_0x4070('0x1d'),_0x2668ce,JSON[_0x4070('0x1c')](_0x44602a));_0x24aae4(_0x44602a);})[_0x4070('0x15')](function(_0x57a1e9){logger[_0x4070('0x11')](_0x4070('0x1d'),_0x57a1e9[_0x4070('0x12')],_0x2668ce);_0x326e04(_0x3881ca[_0x4070('0x11')](0x1f4,_0x57a1e9[_0x4070('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5d6d76c..77f5c98 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 _0x2525=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2525,0x9f));var _0x5252=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2525[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x5252('0x0'));var util=require('util');var path=require(_0x5252('0x1'));var timeout=require(_0x5252('0x2'));var express=require(_0x5252('0x3'));var router=express[_0x5252('0x4')]();var auth=require(_0x5252('0x5'));var interaction=require(_0x5252('0x6'));var config=require(_0x5252('0x7'));var controller=require(_0x5252('0x8'));router[_0x5252('0x9')]('/',auth['isAuthenticated'](),controller[_0x5252('0xa')]);router[_0x5252('0x9')](_0x5252('0xb'),auth['isAuthenticated'](),controller[_0x5252('0xc')]);router[_0x5252('0x9')]('/:id',auth[_0x5252('0xd')](),controller[_0x5252('0xe')]);router['post']('/',auth[_0x5252('0xd')](),controller[_0x5252('0xf')]);router[_0x5252('0x10')](_0x5252('0x11'),auth[_0x5252('0xd')](),controller[_0x5252('0x12')]);router[_0x5252('0x13')](_0x5252('0x11'),auth[_0x5252('0xd')](),controller[_0x5252('0x14')]);module[_0x5252('0x15')]=router; \ No newline at end of file +var _0x0ed5=['post','create','put','update','delete','destroy','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x808770,_0x526386){var _0x5e6466=function(_0x28fcec){while(--_0x28fcec){_0x808770['push'](_0x808770['shift']());}};_0x5e6466(++_0x526386);}(_0x0ed5,0x114));var _0x50ed=function(_0x4b38d1,_0x34365a){_0x4b38d1=_0x4b38d1-0x0;var _0x19b924=_0x0ed5[_0x4b38d1];return _0x19b924;};'use strict';var multer=require(_0x50ed('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x50ed('0x1')]();var auth=require(_0x50ed('0x2'));var interaction=require(_0x50ed('0x3'));var config=require(_0x50ed('0x4'));var controller=require(_0x50ed('0x5'));router[_0x50ed('0x6')]('/',auth['isAuthenticated'](),controller[_0x50ed('0x7')]);router[_0x50ed('0x6')](_0x50ed('0x8'),auth[_0x50ed('0x9')](),controller[_0x50ed('0xa')]);router[_0x50ed('0x6')](_0x50ed('0xb'),auth[_0x50ed('0x9')](),controller['show']);router[_0x50ed('0xc')]('/',auth['isAuthenticated'](),controller[_0x50ed('0xd')]);router[_0x50ed('0xe')](_0x50ed('0xb'),auth['isAuthenticated'](),controller[_0x50ed('0xf')]);router[_0x50ed('0x10')]('/:id',auth[_0x50ed('0x9')](),controller[_0x50ed('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b27f607..393118f 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 _0xd508=['sequelize','STRING','agent','queue','DATE','moment'];(function(_0x3d5d43,_0x9d65ef){var _0x54cebc=function(_0x27984e){while(--_0x27984e){_0x3d5d43['push'](_0x3d5d43['shift']());}};_0x54cebc(++_0x9d65ef);}(_0xd508,0xb9));var _0x8d50=function(_0x4ad720,_0x5e8523){_0x4ad720=_0x4ad720-0x0;var _0x30f9de=_0xd508[_0x4ad720];return _0x30f9de;};'use strict';var moment=require(_0x8d50('0x0'));var Sequelize=require(_0x8d50('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8d50('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x8d50('0x3'),_0x8d50('0x4')),'allowNull':![],'defaultValue':_0x8d50('0x4')},'transferredAt':{'type':Sequelize[_0x8d50('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x05a3=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x05a3,0xbc));var _0x305a=function(_0x1b0f72,_0xe71dbd){_0x1b0f72=_0x1b0f72-0x0;var _0x214e11=_0x05a3[_0x1b0f72];return _0x214e11;};'use strict';var moment=require(_0x305a('0x0'));var Sequelize=require(_0x305a('0x1'));module[_0x305a('0x2')]={'uniqueid':{'type':Sequelize[_0x305a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x305a('0x4')](_0x305a('0x5'),_0x305a('0x6'),'queue'),'allowNull':![],'defaultValue':_0x305a('0x7')},'transferredAt':{'type':Sequelize[_0x305a('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 474009c..6c2efc2 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x222dfe,_0x486655){var _0xd98a75=function(_0x8395f0){while(--_0x8395f0){_0x222dfe['push'](_0x222dfe['shift']());}};_0xd98a75(++_0x486655);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelTransferReport'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelTransferReport'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file +var _0xb7e7=['moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','OpenchannelTransferReport','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','find','describe','html-pdf','rimraf','fast-json-patch'];(function(_0x17bb79,_0x50097a){var _0x1964c=function(_0x175a63){while(--_0x175a63){_0x17bb79['push'](_0x17bb79['shift']());}};_0x1964c(++_0x50097a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb7e7[_0x1b828b];return _0x98da1a;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7e('0x11'));var logger=require(_0x7b7e('0x12'))(_0x7b7e('0x13'));var utils=require(_0x7b7e('0x14'));var config=require(_0x7b7e('0x15'));var db=require(_0x7b7e('0x16'))['db'];function respondWithStatusCode(_0x36d2a3,_0x55620b){_0x55620b=_0x55620b||0xcc;return function(_0xaadda){if(_0xaadda){return _0x36d2a3['sendStatus'](_0x55620b);}return _0x36d2a3[_0x7b7e('0x17')](_0x55620b)[_0x7b7e('0x18')]();};}function respondWithResult(_0x50d7d2,_0x422d3a){_0x422d3a=_0x422d3a||0xc8;return function(_0x5976ac){if(_0x5976ac){return _0x50d7d2['status'](_0x422d3a)[_0x7b7e('0x19')](_0x5976ac);}};}function respondWithFilteredResult(_0xd304f5,_0xf067da){return function(_0x457ec5){if(_0x457ec5){var _0x3d2fb2=_0x457ec5[_0x7b7e('0x1a')],_0x5703fd=_0xf067da[_0x7b7e('0x1b')],_0x51baf6=_0xf067da[_0x7b7e('0x1b')]+_0xf067da[_0x7b7e('0x1c')],_0xc7f087;if(_0x51baf6>=_0x3d2fb2){_0x51baf6=_0x3d2fb2;_0xc7f087=0xc8;}else{_0xc7f087=0xce;}_0xd304f5[_0x7b7e('0x17')](_0xc7f087);return _0xd304f5[_0x7b7e('0x1d')](_0x7b7e('0x1e'),_0x5703fd+'-'+_0x51baf6+'/'+_0x3d2fb2)[_0x7b7e('0x19')](_0x457ec5);}return null;};}function patchUpdates(_0x429a0e){return function(_0x12e8e9){try{jsonpatch[_0x7b7e('0x1f')](_0x12e8e9,_0x429a0e,!![]);}catch(_0x448980){return BPromise[_0x7b7e('0x20')](_0x448980);}return _0x12e8e9[_0x7b7e('0x21')]();};}function saveUpdates(_0x864287,_0x3a7b8b){return function(_0x49eddb){if(_0x49eddb){return _0x49eddb[_0x7b7e('0x22')](_0x864287)[_0x7b7e('0x23')](function(_0x24718c){return _0x24718c;});}return null;};}function removeEntity(_0x4c0647,_0x313122){return function(_0xbf0cb3){if(_0xbf0cb3){return _0xbf0cb3[_0x7b7e('0x24')]()[_0x7b7e('0x23')](function(){_0x4c0647[_0x7b7e('0x17')](0xcc)[_0x7b7e('0x18')]();});}};}function handleEntityNotFound(_0x28bf43,_0x10a66a){return function(_0x53bbb3){if(!_0x53bbb3){_0x28bf43['sendStatus'](0x194);}return _0x53bbb3;};}function handleError(_0x4a836a,_0x26ee14){_0x26ee14=_0x26ee14||0x1f4;return function(_0x22598e){logger[_0x7b7e('0x25')](_0x22598e['stack']);if(_0x22598e['name']){delete _0x22598e['name'];}_0x4a836a[_0x7b7e('0x17')](_0x26ee14)[_0x7b7e('0x26')](_0x22598e);};}exports[_0x7b7e('0x27')]=function(_0x7aa71,_0x3ceaf5){var _0x48fad1={},_0x6a1e71={},_0x21a15={'count':0x0,'rows':[]};var _0x4c46b8=db['OpenchannelTransferReport']['rawAttributes'];_0x6a1e71[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](_0x4c46b8);_0x6a1e71['query']=_[_0x7b7e('0x29')](_0x7aa71['query']);_0x6a1e71[_0x7b7e('0x2a')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],_0x6a1e71['query']);_0x48fad1[_0x7b7e('0x2c')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],qs[_0x7b7e('0x2d')](_0x7aa71[_0x7b7e('0x2e')]['fields']));_0x48fad1[_0x7b7e('0x2c')]=_0x48fad1['attributes'][_0x7b7e('0x2f')]?_0x48fad1[_0x7b7e('0x2c')]:_0x6a1e71[_0x7b7e('0x28')];if(!_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x30')](_0x7b7e('0x31'))){_0x48fad1[_0x7b7e('0x1c')]=qs['limit'](_0x7aa71['query'][_0x7b7e('0x1c')]);_0x48fad1[_0x7b7e('0x1b')]=qs['offset'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x1b')]);}_0x48fad1[_0x7b7e('0x32')]=qs['sort'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x33')]);_0x48fad1[_0x7b7e('0x34')]=qs[_0x7b7e('0x2a')](_[_0x7b7e('0x35')](_0x7aa71[_0x7b7e('0x2e')],_0x6a1e71[_0x7b7e('0x2a')]));if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]){_0x48fad1[_0x7b7e('0x34')]=_[_0x7b7e('0x37')](_0x48fad1[_0x7b7e('0x34')],{'$or':_[_0x7b7e('0x38')](_0x4c46b8,function(_0xdcb8ef){if(_0xdcb8ef[_0x7b7e('0x39')][_0x7b7e('0x3a')]!=='VIRTUAL'){var _0x8c80d5={};_0x8c80d5[_0xdcb8ef[_0x7b7e('0x3b')]]={'$like':'%'+_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]+'%'};return _0x8c80d5;}})});}_0x48fad1=_[_0x7b7e('0x37')]({},_0x48fad1,_0x7aa71[_0x7b7e('0x3c')]);var _0x7f15={'where':_0x48fad1[_0x7b7e('0x34')]};return db[_0x7b7e('0x3d')][_0x7b7e('0x1a')](_0x7f15)['then'](function(_0x3d6571){_0x21a15[_0x7b7e('0x1a')]=_0x3d6571;if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0x48fad1['include']=[{'all':!![]}];}return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')](_0x48fad1);})[_0x7b7e('0x23')](function(_0x5c58c0){_0x21a15['rows']=_0x5c58c0;return _0x21a15;})[_0x7b7e('0x23')](respondWithFilteredResult(_0x3ceaf5,_0x48fad1))['catch'](handleError(_0x3ceaf5,null));};exports[_0x7b7e('0x40')]=function(_0x3b16d7,_0x4de331){var _0xa5daaa={'raw':!![],'where':{'id':_0x3b16d7[_0x7b7e('0x41')]['id']}},_0x2074d1={};_0x2074d1[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](db[_0x7b7e('0x3d')][_0x7b7e('0x42')]);_0x2074d1[_0x7b7e('0x2e')]=_[_0x7b7e('0x29')](_0x3b16d7['query']);_0x2074d1['filters']=_[_0x7b7e('0x2b')](_0x2074d1['model'],_0x2074d1[_0x7b7e('0x2e')]);_0xa5daaa['attributes']=_['intersection'](_0x2074d1[_0x7b7e('0x28')],qs['fields'](_0x3b16d7[_0x7b7e('0x2e')]['fields']));_0xa5daaa[_0x7b7e('0x2c')]=_0xa5daaa[_0x7b7e('0x2c')][_0x7b7e('0x2f')]?_0xa5daaa[_0x7b7e('0x2c')]:_0x2074d1['model'];if(_0x3b16d7[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0xa5daaa[_0x7b7e('0x43')]=[{'all':!![]}];}_0xa5daaa=_[_0x7b7e('0x37')]({},_0xa5daaa,_0x3b16d7[_0x7b7e('0x3c')]);return db[_0x7b7e('0x3d')]['find'](_0xa5daaa)['then'](handleEntityNotFound(_0x4de331,null))['then'](respondWithResult(_0x4de331,null))[_0x7b7e('0x44')](handleError(_0x4de331,null));};exports[_0x7b7e('0x45')]=function(_0x2f9de2,_0x2cfe70){return db[_0x7b7e('0x3d')][_0x7b7e('0x45')](_0x2f9de2['body'],{})[_0x7b7e('0x23')](respondWithResult(_0x2cfe70,0xc9))[_0x7b7e('0x44')](handleError(_0x2cfe70,null));};exports['update']=function(_0x5efcb8,_0x1dcb88){if(_0x5efcb8[_0x7b7e('0x46')]['id']){delete _0x5efcb8[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5efcb8[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dcb88,null))[_0x7b7e('0x23')](saveUpdates(_0x5efcb8['body'],null))[_0x7b7e('0x23')](respondWithResult(_0x1dcb88,null))[_0x7b7e('0x44')](handleError(_0x1dcb88,null));};exports[_0x7b7e('0x24')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x23')](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x23')](removeEntity(_0x58e4e6,null))['catch'](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x48')]=function(_0x270c4a,_0x21868a){return db[_0x7b7e('0x3d')][_0x7b7e('0x48')]()['then'](respondWithResult(_0x21868a,null))[_0x7b7e('0x44')](handleError(_0x21868a,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 9864ff6..a300b03 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 _0xda9a=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x321903,_0x43e0bf){var _0x5ef22a=function(_0xa541f3){while(--_0xa541f3){_0x321903['push'](_0x321903['shift']());}};_0x5ef22a(++_0x43e0bf);}(_0xda9a,0x1a3));var _0xada9=function(_0xd344ef,_0x132b5f){_0xd344ef=_0xd344ef-0x0;var _0x50a171=_0xda9a[_0xd344ef];return _0x50a171;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xada9('0x0'));var moment=require(_0xada9('0x1'));var BPromise=require(_0xada9('0x2'));var rp=require(_0xada9('0x3'));var fs=require('fs');var path=require(_0xada9('0x4'));var rimraf=require(_0xada9('0x5'));var config=require(_0xada9('0x6'));var attributes=require(_0xada9('0x7'));module[_0xada9('0x8')]=function(_0x5dee42,_0x5a7b0c){return _0x5dee42[_0xada9('0x9')](_0xada9('0xa'),attributes,{'tableName':_0xada9('0xb'),'paranoid':![],'indexes':[{'name':_0xada9('0xc'),'fields':[_0xada9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3716=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x28eedc,_0x176917){var _0x575e59=function(_0x40f58d){while(--_0x40f58d){_0x28eedc['push'](_0x28eedc['shift']());}};_0x575e59(++_0x176917);}(_0x3716,0x76));var _0x6371=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x3716[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x6371('0x0'));var util=require('util');var logger=require(_0x6371('0x1'))(_0x6371('0x2'));var moment=require(_0x6371('0x3'));var BPromise=require('bluebird');var rp=require(_0x6371('0x4'));var fs=require('fs');var path=require(_0x6371('0x5'));var rimraf=require(_0x6371('0x6'));var config=require(_0x6371('0x7'));var attributes=require(_0x6371('0x8'));module[_0x6371('0x9')]=function(_0x3c1920,_0xe09db3){return _0x3c1920[_0x6371('0xa')](_0x6371('0xb'),attributes,{'tableName':_0x6371('0xc'),'paranoid':![],'indexes':[{'name':_0x6371('0xd'),'fields':[_0x6371('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4c65efe..8f87f0b 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 _0x30a7=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x1fe010,_0x5761eb){var _0x15e4a1=function(_0x45565d){while(--_0x45565d){_0x1fe010['push'](_0x1fe010['shift']());}};_0x15e4a1(++_0x5761eb);}(_0x30a7,0xf1));var _0x730a=function(_0x21b18c,_0x4b553f){_0x21b18c=_0x21b18c-0x0;var _0x5232d7=_0x30a7[_0x21b18c];return _0x5232d7;};'use strict';var _=require('lodash');var util=require(_0x730a('0x0'));var moment=require(_0x730a('0x1'));var BPromise=require(_0x730a('0x2'));var rs=require(_0x730a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x730a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x730a('0x5'))('rpc');var config=require(_0x730a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x730a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b0cca,_0x4d9cc5,_0x1c9ee1){return new BPromise(function(_0xfb74fb,_0x45a63b){return client['request'](_0x1b0cca,_0x1c9ee1)[_0x730a('0x8')](function(_0x324e00){logger[_0x730a('0x9')](_0x730a('0xa'),_0x4d9cc5,'request\x20sent');logger['debug'](_0x730a('0xb'),_0x4d9cc5,_0x730a('0xc'),JSON[_0x730a('0xd')](_0x324e00));if(_0x324e00[_0x730a('0xe')]){if(_0x324e00[_0x730a('0xe')]['code']===0x1f4){logger[_0x730a('0xe')](_0x730a('0xa'),_0x4d9cc5,_0x324e00[_0x730a('0xe')][_0x730a('0xf')]);return _0x45a63b(_0x324e00[_0x730a('0xe')]['message']);}logger[_0x730a('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4d9cc5,_0x324e00['error'][_0x730a('0xf')]);return _0xfb74fb(_0x324e00[_0x730a('0xe')]['message']);}else{logger['info'](_0x730a('0xa'),_0x4d9cc5,_0x730a('0xc'));_0xfb74fb(_0x324e00[_0x730a('0x10')][_0x730a('0xf')]);}})[_0x730a('0x11')](function(_0x515a8a){logger[_0x730a('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4d9cc5,_0x515a8a);_0x45a63b(_0x515a8a);});});} \ No newline at end of file +var _0x921c=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x921c,0x1ab));var _0xc921=function(_0x56988e,_0x573e1c){_0x56988e=_0x56988e-0x0;var _0x3ec530=_0x921c[_0x56988e];return _0x3ec530;};'use strict';var _=require(_0xc921('0x0'));var util=require(_0xc921('0x1'));var moment=require(_0xc921('0x2'));var BPromise=require(_0xc921('0x3'));var rs=require(_0xc921('0x4'));var fs=require('fs');var Redis=require(_0xc921('0x5'));var db=require(_0xc921('0x6'))['db'];var utils=require(_0xc921('0x7'));var logger=require(_0xc921('0x8'))(_0xc921('0x9'));var config=require('../../config/environment');var jayson=require(_0xc921('0xa'));var client=jayson[_0xc921('0xb')][_0xc921('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1419e0,_0x5dec90,_0x14312a){return new BPromise(function(_0x22224d,_0x1db0e9){return client[_0xc921('0xd')](_0x1419e0,_0x14312a)[_0xc921('0xe')](function(_0x442b66){logger[_0xc921('0xf')](_0xc921('0x10'),_0x5dec90,'request\x20sent');logger[_0xc921('0x11')](_0xc921('0x12'),_0x5dec90,_0xc921('0x13'),JSON['stringify'](_0x442b66));if(_0x442b66['error']){if(_0x442b66['error'][_0xc921('0x14')]===0x1f4){logger[_0xc921('0x15')](_0xc921('0x10'),_0x5dec90,_0x442b66[_0xc921('0x15')]['message']);return _0x1db0e9(_0x442b66[_0xc921('0x15')][_0xc921('0x16')]);}logger[_0xc921('0x15')](_0xc921('0x10'),_0x5dec90,_0x442b66['error'][_0xc921('0x16')]);return _0x22224d(_0x442b66[_0xc921('0x15')][_0xc921('0x16')]);}else{logger[_0xc921('0xf')](_0xc921('0x10'),_0x5dec90,'request\x20sent');_0x22224d(_0x442b66[_0xc921('0x17')][_0xc921('0x16')]);}})[_0xc921('0x18')](function(_0x2a046f){logger['error'](_0xc921('0x10'),_0x5dec90,_0x2a046f);_0x1db0e9(_0x2a046f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 22e118d..1695f34 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 _0x0f73=['show','post','create','put','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','/:id'];(function(_0x3098ab,_0x56f9bd){var _0x2026b7=function(_0x50bd8d){while(--_0x50bd8d){_0x3098ab['push'](_0x3098ab['shift']());}};_0x2026b7(++_0x56f9bd);}(_0x0f73,0x146));var _0x30f7=function(_0xe3385a,_0x3258df){_0xe3385a=_0xe3385a-0x0;var _0x203820=_0x0f73[_0xe3385a];return _0x203820;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30f7('0x3')]();var auth=require(_0x30f7('0x4'));var interaction=require(_0x30f7('0x5'));var config=require(_0x30f7('0x6'));var controller=require(_0x30f7('0x7'));router['get']('/',auth[_0x30f7('0x8')](),controller['index']);router['get'](_0x30f7('0x9'),auth[_0x30f7('0x8')](),controller[_0x30f7('0xa')]);router[_0x30f7('0xb')]('/',auth['isAuthenticated'](),controller[_0x30f7('0xc')]);router[_0x30f7('0xd')]('/:id',auth[_0x30f7('0x8')](),controller['update']);router['delete'](_0x30f7('0x9'),auth[_0x30f7('0x8')](),controller[_0x30f7('0xe')]);module[_0x30f7('0xf')]=router; \ No newline at end of file +var _0x2333=['./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x107b09,_0x269e08){var _0x34bc6a=function(_0x55ff0b){while(--_0x55ff0b){_0x107b09['push'](_0x107b09['shift']());}};_0x34bc6a(++_0x269e08);}(_0x2333,0x11a));var _0x3233=function(_0x2b1a24,_0x5f1534){_0x2b1a24=_0x2b1a24-0x0;var _0x3698eb=_0x2333[_0x2b1a24];return _0x3698eb;};'use strict';var multer=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3233('0x2'));var router=express[_0x3233('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3233('0x4'));var config=require(_0x3233('0x5'));var controller=require(_0x3233('0x6'));router[_0x3233('0x7')]('/',auth[_0x3233('0x8')](),controller[_0x3233('0x9')]);router[_0x3233('0x7')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0xb')]);router[_0x3233('0xc')]('/',auth[_0x3233('0x8')](),controller[_0x3233('0xd')]);router[_0x3233('0xe')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0xf')]);router[_0x3233('0x10')](_0x3233('0xa'),auth[_0x3233('0x8')](),controller[_0x3233('0x11')]);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 76ba107..59eb3cb 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 _0x3a63=['name','sequelize','exports','STRING'];(function(_0x21a11d,_0x18d8ec){var _0x474e50=function(_0x45d33b){while(--_0x45d33b){_0x21a11d['push'](_0x21a11d['shift']());}};_0x474e50(++_0x18d8ec);}(_0x3a63,0x81));var _0x33a6=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x3a63[_0x516927];return _0x30749b;};'use strict';var Sequelize=require(_0x33a6('0x0'));module[_0x33a6('0x1')]={'name':{'type':Sequelize[_0x33a6('0x2')],'unique':_0x33a6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x33a6('0x2')]}}; \ No newline at end of file +var _0x4d6e=['sequelize','STRING'];(function(_0x2bf5ca,_0x308a4d){var _0x55342c=function(_0x45b80e){while(--_0x45b80e){_0x2bf5ca['push'](_0x2bf5ca['shift']());}};_0x55342c(++_0x308a4d);}(_0x4d6e,0x1bc));var _0xe4d6=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x4d6e[_0x3e7804];return _0x56efda;};'use strict';var Sequelize=require(_0xe4d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4d6('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe4d6('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 87b4ee3..87b9c64 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 _0xd4a0=['map','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','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/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','Pauses','stack','name','send','Pause','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x11056d,_0x1826da){var _0x59f7d9=function(_0x5a3c54){while(--_0x5a3c54){_0x11056d['push'](_0x11056d['shift']());}};_0x59f7d9(++_0x1826da);}(_0xd4a0,0x15b));var _0x0d4a=function(_0x54dd39,_0x2b71a4){_0x54dd39=_0x54dd39-0x0;var _0x46926e=_0xd4a0[_0x54dd39];return _0x46926e;};'use strict';var pdf=require(_0x0d4a('0x0'));var emlformat=require(_0x0d4a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d4a('0x2'));var rp=require(_0x0d4a('0x3'));var moment=require('moment');var BPromise=require(_0x0d4a('0x4'));var Mustache=require(_0x0d4a('0x5'));var util=require(_0x0d4a('0x6'));var path=require(_0x0d4a('0x7'));var sox=require(_0x0d4a('0x8'));var csv=require(_0x0d4a('0x9'));var ejs=require(_0x0d4a('0xa'));var fs=require('fs');var _=require(_0x0d4a('0xb'));var squel=require(_0x0d4a('0xc'));var crypto=require(_0x0d4a('0xd'));var jsforce=require(_0x0d4a('0xe'));var deskjs=require(_0x0d4a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d4a('0x10'));var Papa=require(_0x0d4a('0x11'));var Redis=require(_0x0d4a('0x12'));var authService=require(_0x0d4a('0x13'));var qs=require(_0x0d4a('0x14'));var hardwareService=require(_0x0d4a('0x15'));var logger=require(_0x0d4a('0x16'))(_0x0d4a('0x17'));var utils=require('../../config/utils');var config=require(_0x0d4a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c60f8,_0x31c4ca){_0x31c4ca=_0x31c4ca||0xcc;return function(_0x43b07b){if(_0x43b07b){return _0x3c60f8[_0x0d4a('0x19')](_0x31c4ca);}return _0x3c60f8[_0x0d4a('0x1a')](_0x31c4ca)[_0x0d4a('0x1b')]();};}function respondWithResult(_0x5c8b0c,_0x42e647){_0x42e647=_0x42e647||0xc8;return function(_0x2c1dd8){if(_0x2c1dd8){return _0x5c8b0c['status'](_0x42e647)[_0x0d4a('0x1c')](_0x2c1dd8);}};}function respondWithFilteredResult(_0x3972dc,_0x29b45a){return function(_0x52a051){if(_0x52a051){var _0x65c64b=_0x52a051[_0x0d4a('0x1d')],_0x17cdf3=_0x29b45a[_0x0d4a('0x1e')],_0x1ece10=_0x29b45a[_0x0d4a('0x1e')]+_0x29b45a[_0x0d4a('0x1f')],_0x33256f;if(_0x1ece10>=_0x65c64b){_0x1ece10=_0x65c64b;_0x33256f=0xc8;}else{_0x33256f=0xce;}_0x3972dc[_0x0d4a('0x1a')](_0x33256f);return _0x3972dc['set'](_0x0d4a('0x20'),_0x17cdf3+'-'+_0x1ece10+'/'+_0x65c64b)[_0x0d4a('0x1c')](_0x52a051);}return null;};}function patchUpdates(_0x520043){return function(_0x5029f3){try{jsonpatch[_0x0d4a('0x21')](_0x5029f3,_0x520043,!![]);}catch(_0x1fd8fa){return BPromise['reject'](_0x1fd8fa);}return _0x5029f3['save']();};}function saveUpdates(_0x4f455b,_0xd85be3){return function(_0x7bb6c1){if(_0x7bb6c1){return _0x7bb6c1[_0x0d4a('0x22')](_0x4f455b)[_0x0d4a('0x23')](function(_0x1f1e8a){return _0x1f1e8a;});}return null;};}function removeEntity(_0x572beb,_0xd319ea){return function(_0x4dfa22){if(_0x4dfa22){return _0x4dfa22[_0x0d4a('0x24')]()[_0x0d4a('0x23')](function(){var _0x3a7bf9=_0x4dfa22[_0x0d4a('0x25')]({'plain':!![]});var _0x59bc41=_0x0d4a('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x59bc41,'resourceId':_0x3a7bf9['id']}})[_0x0d4a('0x23')](function(){return _0x4dfa22;});})[_0x0d4a('0x23')](function(){_0x572beb[_0x0d4a('0x1a')](0xcc)[_0x0d4a('0x1b')]();});}};}function handleEntityNotFound(_0x2694ad,_0x15b63e){return function(_0xe346fc){if(!_0xe346fc){_0x2694ad[_0x0d4a('0x19')](0x194);}return _0xe346fc;};}function handleError(_0x3af4a1,_0x3f190a){_0x3f190a=_0x3f190a||0x1f4;return function(_0xe55262){logger['error'](_0xe55262[_0x0d4a('0x27')]);if(_0xe55262[_0x0d4a('0x28')]){delete _0xe55262[_0x0d4a('0x28')];}_0x3af4a1[_0x0d4a('0x1a')](_0x3f190a)[_0x0d4a('0x29')](_0xe55262);};}exports['index']=function(_0x407b1d,_0x19983a){var _0x1b4879={},_0x5d9690={},_0x1a3d4b={'count':0x0,'rows':[]};var _0x28f88c=db[_0x0d4a('0x2a')]['rawAttributes'];_0x5d9690['model']=_['keys'](_0x28f88c);_0x5d9690['query']=_[_0x0d4a('0x2b')](_0x407b1d[_0x0d4a('0x2c')]);_0x5d9690[_0x0d4a('0x2d')]=_[_0x0d4a('0x2e')](_0x5d9690[_0x0d4a('0x2f')],_0x5d9690[_0x0d4a('0x2c')]);_0x1b4879['attributes']=_[_0x0d4a('0x2e')](_0x5d9690['model'],qs[_0x0d4a('0x30')](_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x30')]));_0x1b4879[_0x0d4a('0x31')]=_0x1b4879[_0x0d4a('0x31')][_0x0d4a('0x32')]?_0x1b4879['attributes']:_0x5d9690[_0x0d4a('0x2f')];if(!_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x33')](_0x0d4a('0x34'))){_0x1b4879['limit']=qs[_0x0d4a('0x1f')](_0x407b1d['query']['limit']);_0x1b4879[_0x0d4a('0x1e')]=qs['offset'](_0x407b1d[_0x0d4a('0x2c')]['offset']);}_0x1b4879[_0x0d4a('0x35')]=qs[_0x0d4a('0x36')](_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x36')]);_0x1b4879['where']=qs[_0x0d4a('0x2d')](_[_0x0d4a('0x37')](_0x407b1d[_0x0d4a('0x2c')],_0x5d9690['filters']));if(_0x407b1d[_0x0d4a('0x2c')]['filter']){_0x1b4879[_0x0d4a('0x38')]=_[_0x0d4a('0x39')](_0x1b4879[_0x0d4a('0x38')],{'$or':_[_0x0d4a('0x3a')](_0x28f88c,function(_0x4eb8d4){if(_0x4eb8d4['type']['key']!==_0x0d4a('0x3b')){var _0x20bb1e={};_0x20bb1e[_0x4eb8d4[_0x0d4a('0x3c')]]={'$like':'%'+_0x407b1d['query'][_0x0d4a('0x3d')]+'%'};return _0x20bb1e;}})});}_0x1b4879=_['merge']({},_0x1b4879,_0x407b1d[_0x0d4a('0x3e')]);var _0x21802b={'where':_0x1b4879[_0x0d4a('0x38')]};return db[_0x0d4a('0x2a')][_0x0d4a('0x1d')](_0x21802b)[_0x0d4a('0x23')](function(_0x74877b){_0x1a3d4b[_0x0d4a('0x1d')]=_0x74877b;if(_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x3f')]){_0x1b4879[_0x0d4a('0x40')]=[{'all':!![]}];}return db['Pause'][_0x0d4a('0x41')](_0x1b4879);})['then'](function(_0x3ec770){_0x1a3d4b[_0x0d4a('0x42')]=_0x3ec770;return _0x1a3d4b;})['then'](respondWithFilteredResult(_0x19983a,_0x1b4879))[_0x0d4a('0x43')](handleError(_0x19983a,null));};exports[_0x0d4a('0x44')]=function(_0x1ad5a3,_0x325c25){var _0xb36453={'raw':!![],'where':{'id':_0x1ad5a3[_0x0d4a('0x45')]['id']}},_0xb427d7={};_0xb427d7[_0x0d4a('0x2f')]=_[_0x0d4a('0x2b')](db[_0x0d4a('0x2a')][_0x0d4a('0x46')]);_0xb427d7[_0x0d4a('0x2c')]=_['keys'](_0x1ad5a3[_0x0d4a('0x2c')]);_0xb427d7[_0x0d4a('0x2d')]=_['intersection'](_0xb427d7['model'],_0xb427d7[_0x0d4a('0x2c')]);_0xb36453['attributes']=_[_0x0d4a('0x2e')](_0xb427d7[_0x0d4a('0x2f')],qs['fields'](_0x1ad5a3[_0x0d4a('0x2c')]['fields']));_0xb36453[_0x0d4a('0x31')]=_0xb36453[_0x0d4a('0x31')][_0x0d4a('0x32')]?_0xb36453[_0x0d4a('0x31')]:_0xb427d7[_0x0d4a('0x2f')];if(_0x1ad5a3[_0x0d4a('0x2c')][_0x0d4a('0x3f')]){_0xb36453[_0x0d4a('0x40')]=[{'all':!![]}];}_0xb36453=_['merge']({},_0xb36453,_0x1ad5a3[_0x0d4a('0x3e')]);return db['Pause'][_0x0d4a('0x47')](_0xb36453)[_0x0d4a('0x23')](handleEntityNotFound(_0x325c25,null))[_0x0d4a('0x23')](respondWithResult(_0x325c25,null))[_0x0d4a('0x43')](handleError(_0x325c25,null));};exports[_0x0d4a('0x48')]=function(_0x5dbb36,_0x41f532){return db[_0x0d4a('0x2a')]['create'](_0x5dbb36[_0x0d4a('0x49')],{})['then'](function(_0x5113bb){var _0x344d2c=_0x5dbb36[_0x0d4a('0x4a')][_0x0d4a('0x25')]({'plain':!![]});if(!_0x344d2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x344d2c[_0x0d4a('0x4b')]==='user'){var _0x593f30=_0x5113bb['get']({'plain':!![]});var _0x5b5451='Pauses';return db[_0x0d4a('0x4c')][_0x0d4a('0x47')]({'where':{'name':_0x5b5451,'userProfileId':_0x344d2c[_0x0d4a('0x4d')]},'raw':!![]})[_0x0d4a('0x23')](function(_0x545c1){if(_0x545c1&&_0x545c1[_0x0d4a('0x4e')]===0x0){return db['UserProfileResource'][_0x0d4a('0x48')]({'name':_0x593f30[_0x0d4a('0x28')],'resourceId':_0x593f30['id'],'type':_0x545c1[_0x0d4a('0x28')],'sectionId':_0x545c1['id']},{})[_0x0d4a('0x23')](function(){return _0x5113bb;});}else{return _0x5113bb;}})[_0x0d4a('0x43')](function(_0x5dabd8){logger[_0x0d4a('0x4f')](_0x0d4a('0x50'),_0x5dabd8);throw _0x5dabd8;});}return _0x5113bb;})[_0x0d4a('0x23')](respondWithResult(_0x41f532,0xc9))[_0x0d4a('0x43')](handleError(_0x41f532,null));};exports[_0x0d4a('0x22')]=function(_0x3f99fc,_0x2421f0){if(_0x3f99fc[_0x0d4a('0x49')]['id']){delete _0x3f99fc['body']['id'];}return db[_0x0d4a('0x2a')][_0x0d4a('0x47')]({'where':{'id':_0x3f99fc['params']['id']}})[_0x0d4a('0x23')](handleEntityNotFound(_0x2421f0,null))[_0x0d4a('0x23')](saveUpdates(_0x3f99fc['body'],null))[_0x0d4a('0x23')](respondWithResult(_0x2421f0,null))['catch'](handleError(_0x2421f0,null));};exports['destroy']=function(_0x33bd67,_0xa6009d){return db[_0x0d4a('0x2a')][_0x0d4a('0x47')]({'where':{'id':_0x33bd67['params']['id']}})[_0x0d4a('0x23')](handleEntityNotFound(_0xa6009d,null))[_0x0d4a('0x23')](removeEntity(_0xa6009d,null))[_0x0d4a('0x43')](handleError(_0xa6009d,null));}; \ No newline at end of file +var _0xa108=['length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','attributes','fields'];(function(_0x488814,_0x3fec59){var _0x58138b=function(_0x575c59){while(--_0x575c59){_0x488814['push'](_0x488814['shift']());}};_0x58138b(++_0x3fec59);}(_0xa108,0xc3));var _0x8a10=function(_0x36ceb9,_0x48bd46){_0x36ceb9=_0x36ceb9-0x0;var _0x4cf26e=_0xa108[_0x36ceb9];return _0x4cf26e;};'use strict';var pdf=require(_0x8a10('0x0'));var emlformat=require(_0x8a10('0x1'));var rimraf=require(_0x8a10('0x2'));var zipdir=require(_0x8a10('0x3'));var jsonpatch=require(_0x8a10('0x4'));var rp=require(_0x8a10('0x5'));var moment=require(_0x8a10('0x6'));var BPromise=require(_0x8a10('0x7'));var Mustache=require(_0x8a10('0x8'));var util=require(_0x8a10('0x9'));var path=require(_0x8a10('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8a10('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a10('0xc'));var crypto=require(_0x8a10('0xd'));var jsforce=require(_0x8a10('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8a10('0xf'));var querystring=require(_0x8a10('0x10'));var Papa=require(_0x8a10('0x11'));var Redis=require(_0x8a10('0x12'));var authService=require(_0x8a10('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a10('0x14'));var utils=require(_0x8a10('0x15'));var config=require(_0x8a10('0x16'));var db=require(_0x8a10('0x17'))['db'];function respondWithStatusCode(_0x4dec6b,_0x58dc13){_0x58dc13=_0x58dc13||0xcc;return function(_0x2b9300){if(_0x2b9300){return _0x4dec6b[_0x8a10('0x18')](_0x58dc13);}return _0x4dec6b[_0x8a10('0x19')](_0x58dc13)[_0x8a10('0x1a')]();};}function respondWithResult(_0x14e642,_0x104ea8){_0x104ea8=_0x104ea8||0xc8;return function(_0x430b86){if(_0x430b86){return _0x14e642[_0x8a10('0x19')](_0x104ea8)[_0x8a10('0x1b')](_0x430b86);}};}function respondWithFilteredResult(_0x4f6040,_0x28de16){return function(_0x431938){if(_0x431938){var _0x4fb449=_0x431938[_0x8a10('0x1c')],_0x44b772=_0x28de16[_0x8a10('0x1d')],_0x5b2205=_0x28de16['offset']+_0x28de16[_0x8a10('0x1e')],_0x1a9f24;if(_0x5b2205>=_0x4fb449){_0x5b2205=_0x4fb449;_0x1a9f24=0xc8;}else{_0x1a9f24=0xce;}_0x4f6040[_0x8a10('0x19')](_0x1a9f24);return _0x4f6040[_0x8a10('0x1f')](_0x8a10('0x20'),_0x44b772+'-'+_0x5b2205+'/'+_0x4fb449)[_0x8a10('0x1b')](_0x431938);}return null;};}function patchUpdates(_0x12045f){return function(_0x6ddb0d){try{jsonpatch[_0x8a10('0x21')](_0x6ddb0d,_0x12045f,!![]);}catch(_0x2603fa){return BPromise['reject'](_0x2603fa);}return _0x6ddb0d['save']();};}function saveUpdates(_0x4cfc2f,_0x4525f2){return function(_0x4e9cf0){if(_0x4e9cf0){return _0x4e9cf0[_0x8a10('0x22')](_0x4cfc2f)[_0x8a10('0x23')](function(_0x56a0a7){return _0x56a0a7;});}return null;};}function removeEntity(_0x4c5880,_0x28ce8d){return function(_0x443450){if(_0x443450){return _0x443450[_0x8a10('0x24')]()[_0x8a10('0x23')](function(){var _0xf90065=_0x443450[_0x8a10('0x25')]({'plain':!![]});var _0x5a08fb=_0x8a10('0x26');return db[_0x8a10('0x27')][_0x8a10('0x24')]({'where':{'type':_0x5a08fb,'resourceId':_0xf90065['id']}})[_0x8a10('0x23')](function(){return _0x443450;});})[_0x8a10('0x23')](function(){_0x4c5880['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad3c7,_0x1c3fee){return function(_0x73f09c){if(!_0x73f09c){_0x1ad3c7['sendStatus'](0x194);}return _0x73f09c;};}function handleError(_0x3b15be,_0x1e4615){_0x1e4615=_0x1e4615||0x1f4;return function(_0x1396e9){logger[_0x8a10('0x28')](_0x1396e9[_0x8a10('0x29')]);if(_0x1396e9[_0x8a10('0x2a')]){delete _0x1396e9[_0x8a10('0x2a')];}_0x3b15be['status'](_0x1e4615)[_0x8a10('0x2b')](_0x1396e9);};}exports[_0x8a10('0x2c')]=function(_0x299b92,_0x5cd7fa){var _0x13c521={},_0x465264={},_0x276d21={'count':0x0,'rows':[]};var _0x1dbbed=db[_0x8a10('0x2d')][_0x8a10('0x2e')];_0x465264[_0x8a10('0x2f')]=_[_0x8a10('0x30')](_0x1dbbed);_0x465264[_0x8a10('0x31')]=_[_0x8a10('0x30')](_0x299b92[_0x8a10('0x31')]);_0x465264[_0x8a10('0x32')]=_[_0x8a10('0x33')](_0x465264[_0x8a10('0x2f')],_0x465264[_0x8a10('0x31')]);_0x13c521[_0x8a10('0x34')]=_['intersection'](_0x465264[_0x8a10('0x2f')],qs[_0x8a10('0x35')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x35')]));_0x13c521[_0x8a10('0x34')]=_0x13c521[_0x8a10('0x34')][_0x8a10('0x36')]?_0x13c521[_0x8a10('0x34')]:_0x465264[_0x8a10('0x2f')];if(!_0x299b92['query']['hasOwnProperty'](_0x8a10('0x37'))){_0x13c521[_0x8a10('0x1e')]=qs[_0x8a10('0x1e')](_0x299b92['query'][_0x8a10('0x1e')]);_0x13c521[_0x8a10('0x1d')]=qs[_0x8a10('0x1d')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x1d')]);}_0x13c521[_0x8a10('0x38')]=qs[_0x8a10('0x39')](_0x299b92[_0x8a10('0x31')][_0x8a10('0x39')]);_0x13c521[_0x8a10('0x3a')]=qs[_0x8a10('0x32')](_[_0x8a10('0x3b')](_0x299b92[_0x8a10('0x31')],_0x465264[_0x8a10('0x32')]));if(_0x299b92[_0x8a10('0x31')][_0x8a10('0x3c')]){_0x13c521[_0x8a10('0x3a')]=_[_0x8a10('0x3d')](_0x13c521['where'],{'$or':_[_0x8a10('0x3e')](_0x1dbbed,function(_0x42d4ec){if(_0x42d4ec[_0x8a10('0x3f')][_0x8a10('0x40')]!==_0x8a10('0x41')){var _0x2de570={};_0x2de570[_0x42d4ec[_0x8a10('0x42')]]={'$like':'%'+_0x299b92[_0x8a10('0x31')]['filter']+'%'};return _0x2de570;}})});}_0x13c521=_[_0x8a10('0x3d')]({},_0x13c521,_0x299b92[_0x8a10('0x43')]);var _0x1039f5={'where':_0x13c521[_0x8a10('0x3a')]};return db[_0x8a10('0x2d')]['count'](_0x1039f5)[_0x8a10('0x23')](function(_0x503051){_0x276d21[_0x8a10('0x1c')]=_0x503051;if(_0x299b92[_0x8a10('0x31')]['includeAll']){_0x13c521[_0x8a10('0x44')]=[{'all':!![]}];}return db['Pause'][_0x8a10('0x45')](_0x13c521);})['then'](function(_0x94cbe){_0x276d21[_0x8a10('0x46')]=_0x94cbe;return _0x276d21;})[_0x8a10('0x23')](respondWithFilteredResult(_0x5cd7fa,_0x13c521))[_0x8a10('0x47')](handleError(_0x5cd7fa,null));};exports[_0x8a10('0x48')]=function(_0x5bd380,_0x231021){var _0x24d20c={'raw':!![],'where':{'id':_0x5bd380['params']['id']}},_0x47d1bf={};_0x47d1bf[_0x8a10('0x2f')]=_[_0x8a10('0x30')](db[_0x8a10('0x2d')][_0x8a10('0x2e')]);_0x47d1bf[_0x8a10('0x31')]=_['keys'](_0x5bd380[_0x8a10('0x31')]);_0x47d1bf[_0x8a10('0x32')]=_['intersection'](_0x47d1bf[_0x8a10('0x2f')],_0x47d1bf[_0x8a10('0x31')]);_0x24d20c[_0x8a10('0x34')]=_[_0x8a10('0x33')](_0x47d1bf['model'],qs[_0x8a10('0x35')](_0x5bd380[_0x8a10('0x31')]['fields']));_0x24d20c[_0x8a10('0x34')]=_0x24d20c[_0x8a10('0x34')][_0x8a10('0x36')]?_0x24d20c[_0x8a10('0x34')]:_0x47d1bf[_0x8a10('0x2f')];if(_0x5bd380[_0x8a10('0x31')][_0x8a10('0x49')]){_0x24d20c[_0x8a10('0x44')]=[{'all':!![]}];}_0x24d20c=_['merge']({},_0x24d20c,_0x5bd380[_0x8a10('0x43')]);return db[_0x8a10('0x2d')][_0x8a10('0x4a')](_0x24d20c)[_0x8a10('0x23')](handleEntityNotFound(_0x231021,null))[_0x8a10('0x23')](respondWithResult(_0x231021,null))[_0x8a10('0x47')](handleError(_0x231021,null));};exports['create']=function(_0x32def4,_0x636b7a){return db['Pause'][_0x8a10('0x4b')](_0x32def4[_0x8a10('0x4c')],{})['then'](function(_0x461bc5){var _0x3835fa=_0x32def4['user'][_0x8a10('0x25')]({'plain':!![]});if(!_0x3835fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3835fa[_0x8a10('0x4d')]===_0x8a10('0x4e')){var _0x1a4de2=_0x461bc5[_0x8a10('0x25')]({'plain':!![]});var _0x26ce70=_0x8a10('0x26');return db[_0x8a10('0x4f')]['find']({'where':{'name':_0x26ce70,'userProfileId':_0x3835fa[_0x8a10('0x50')]},'raw':!![]})[_0x8a10('0x23')](function(_0x30b91f){if(_0x30b91f&&_0x30b91f[_0x8a10('0x51')]===0x0){return db[_0x8a10('0x27')]['create']({'name':_0x1a4de2[_0x8a10('0x2a')],'resourceId':_0x1a4de2['id'],'type':_0x30b91f[_0x8a10('0x2a')],'sectionId':_0x30b91f['id']},{})[_0x8a10('0x23')](function(){return _0x461bc5;});}else{return _0x461bc5;}})[_0x8a10('0x47')](function(_0x16b548){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16b548);throw _0x16b548;});}return _0x461bc5;})[_0x8a10('0x23')](respondWithResult(_0x636b7a,0xc9))['catch'](handleError(_0x636b7a,null));};exports[_0x8a10('0x22')]=function(_0x16f53f,_0x349223){if(_0x16f53f[_0x8a10('0x4c')]['id']){delete _0x16f53f['body']['id'];}return db[_0x8a10('0x2d')][_0x8a10('0x4a')]({'where':{'id':_0x16f53f['params']['id']}})[_0x8a10('0x23')](handleEntityNotFound(_0x349223,null))[_0x8a10('0x23')](saveUpdates(_0x16f53f['body'],null))[_0x8a10('0x23')](respondWithResult(_0x349223,null))[_0x8a10('0x47')](handleError(_0x349223,null));};exports[_0x8a10('0x24')]=function(_0x4bb3ae,_0x41a47f){return db[_0x8a10('0x2d')][_0x8a10('0x4a')]({'where':{'id':_0x4bb3ae[_0x8a10('0x52')]['id']}})[_0x8a10('0x23')](handleEntityNotFound(_0x41a47f,null))['then'](removeEntity(_0x41a47f,null))['catch'](handleError(_0x41a47f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e1299ac..3bae977 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 _0xa0d0=['../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x51fea4,_0x48c945){var _0x6b9c34=function(_0x49d020){while(--_0x49d020){_0x51fea4['push'](_0x51fea4['shift']());}};_0x6b9c34(++_0x48c945);}(_0xa0d0,0x13d));var _0x0a0d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa0d0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a0d('0x0'));var util=require('util');var logger=require(_0x0a0d('0x1'))(_0x0a0d('0x2'));var moment=require('moment');var BPromise=require(_0x0a0d('0x3'));var rp=require(_0x0a0d('0x4'));var fs=require('fs');var path=require(_0x0a0d('0x5'));var rimraf=require(_0x0a0d('0x6'));var config=require(_0x0a0d('0x7'));var attributes=require(_0x0a0d('0x8'));module[_0x0a0d('0x9')]=function(_0x41058b,_0xb885e){return _0x41058b['define'](_0x0a0d('0xa'),attributes,{'tableName':_0x0a0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc439=['request-promise','rimraf','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x13b641,_0x18b7c7){var _0x1e9b7e=function(_0x505c76){while(--_0x505c76){_0x13b641['push'](_0x13b641['shift']());}};_0x1e9b7e(++_0x18b7c7);}(_0xc439,0x102));var _0x9c43=function(_0x2b4aa5,_0x32a8d4){_0x2b4aa5=_0x2b4aa5-0x0;var _0x5b0ed8=_0xc439[_0x2b4aa5];return _0x5b0ed8;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var logger=require(_0x9c43('0x2'))(_0x9c43('0x3'));var moment=require(_0x9c43('0x4'));var BPromise=require(_0x9c43('0x5'));var rp=require(_0x9c43('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c43('0x7'));var config=require(_0x9c43('0x8'));var attributes=require(_0x9c43('0x9'));module['exports']=function(_0x268ba5,_0xf68949){return _0x268ba5[_0x9c43('0xa')](_0x9c43('0xb'),attributes,{'tableName':'tools_pauses','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 b4fe502..567c046 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 _0x68fc=['request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowPause','Pause','find','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x68fc,0xa5));var _0xc68f=function(_0x238c2b,_0x3b9aae){_0x238c2b=_0x238c2b-0x0;var _0x16c704=_0x68fc[_0x238c2b];return _0x16c704;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('Pause,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});}exports[_0xc68f('0x14')]=function(_0x2d9d85){var _0x2c7261=this;return new Promise(function(_0x50fab4,_0x385dbe){return db[_0xc68f('0x15')][_0xc68f('0x16')]({'raw':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x18')]===undefined?!![]:![]:!![],'where':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')]['where']||null:null,'attributes':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x19')]||null:null,'include':_0x2d9d85['options']?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x1a')],function(_0x3da6d9){return{'model':db[_0x3da6d9[_0xc68f('0x1c')]],'as':_0x3da6d9['as'],'attributes':_0x3da6d9['attributes'],'include':_0x3da6d9[_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x3da6d9['include'],function(_0x13dd7c){return{'model':db[_0x13dd7c[_0xc68f('0x1c')]],'as':_0x13dd7c['as'],'attributes':_0x13dd7c[_0xc68f('0x19')],'include':_0x13dd7c[_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x13dd7c['include'],function(_0x1a0810){return{'model':db[_0x1a0810[_0xc68f('0x1c')]],'as':_0x1a0810['as'],'attributes':_0x1a0810['attributes']};}):[]};}):[]};}):[]:[]})[_0xc68f('0xa')](function(_0x27e5b8){logger['info'](_0xc68f('0x14'),_0x2d9d85);logger[_0xc68f('0xe')](_0xc68f('0x14'),_0x2d9d85,JSON[_0xc68f('0xf')](_0x27e5b8));_0x50fab4(_0x27e5b8);})['catch'](function(_0x477a1c){logger[_0xc68f('0x10')](_0xc68f('0x14'),_0x477a1c[_0xc68f('0x12')],_0x2d9d85);_0x385dbe(_0x2c7261[_0xc68f('0x10')](0x1f4,_0x477a1c[_0xc68f('0x12')]));});});}; \ No newline at end of file +var _0xb81a=['message','result','ShowPause','Pause','options','raw','where','attributes','include','map','model','then','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','Pause,\x20%s,\x20%s'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xb81a,0x186));var _0xab81=function(_0x28fce1,_0x787727){_0x28fce1=_0x28fce1-0x0;var _0x171ac3=_0xb81a[_0x28fce1];return _0x171ac3;};'use strict';var _=require('lodash');var util=require(_0xab81('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xab81('0x1'));var fs=require('fs');var Redis=require(_0xab81('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab81('0x3'))(_0xab81('0x4'));var config=require('../../config/environment');var jayson=require(_0xab81('0x5'));var client=jayson[_0xab81('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592bad,_0x152175,_0x5f6b1b){return new BPromise(function(_0x173e79,_0xefc9c6){return client[_0xab81('0x7')](_0x592bad,_0x5f6b1b)['then'](function(_0x41d595){logger[_0xab81('0x8')]('Pause,\x20%s,\x20%s',_0x152175,_0xab81('0x9'));logger[_0xab81('0xa')]('Pause,\x20%s,\x20%s,\x20%s',_0x152175,'request\x20sent',JSON[_0xab81('0xb')](_0x41d595));if(_0x41d595[_0xab81('0xc')]){if(_0x41d595[_0xab81('0xc')][_0xab81('0xd')]===0x1f4){logger['error'](_0xab81('0xe'),_0x152175,_0x41d595[_0xab81('0xc')]['message']);return _0xefc9c6(_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);}logger[_0xab81('0xc')]('Pause,\x20%s,\x20%s',_0x152175,_0x41d595[_0xab81('0xc')][_0xab81('0xf')]);return _0x173e79(_0x41d595['error'][_0xab81('0xf')]);}else{logger['info'](_0xab81('0xe'),_0x152175,_0xab81('0x9'));_0x173e79(_0x41d595[_0xab81('0x10')]['message']);}})['catch'](function(_0x2f2dfa){logger[_0xab81('0xc')]('Pause,\x20%s,\x20%s',_0x152175,_0x2f2dfa);_0xefc9c6(_0x2f2dfa);});});}exports[_0xab81('0x11')]=function(_0x424fad){var _0x1a4e53=this;return new Promise(function(_0x34fe11,_0x2226d1){return db[_0xab81('0x12')]['find']({'raw':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x14')]===undefined?!![]:![]:!![],'where':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x15')]||null:null,'attributes':_0x424fad[_0xab81('0x13')]?_0x424fad[_0xab81('0x13')][_0xab81('0x16')]||null:null,'include':_0x424fad['options']?_0x424fad[_0xab81('0x13')][_0xab81('0x17')]?_[_0xab81('0x18')](_0x424fad[_0xab81('0x13')]['include'],function(_0x4c1b54){return{'model':db[_0x4c1b54[_0xab81('0x19')]],'as':_0x4c1b54['as'],'attributes':_0x4c1b54[_0xab81('0x16')],'include':_0x4c1b54[_0xab81('0x17')]?_[_0xab81('0x18')](_0x4c1b54['include'],function(_0xf3ce6f){return{'model':db[_0xf3ce6f[_0xab81('0x19')]],'as':_0xf3ce6f['as'],'attributes':_0xf3ce6f[_0xab81('0x16')],'include':_0xf3ce6f[_0xab81('0x17')]?_[_0xab81('0x18')](_0xf3ce6f[_0xab81('0x17')],function(_0x2d3d6c){return{'model':db[_0x2d3d6c[_0xab81('0x19')]],'as':_0x2d3d6c['as'],'attributes':_0x2d3d6c[_0xab81('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab81('0x1a')](function(_0x30af24){logger['info'](_0xab81('0x11'),_0x424fad);logger[_0xab81('0xa')](_0xab81('0x11'),_0x424fad,JSON[_0xab81('0xb')](_0x30af24));_0x34fe11(_0x30af24);})['catch'](function(_0xb7429a){logger['error']('ShowPause',_0xb7429a[_0xab81('0xf')],_0x424fad);_0x2226d1(_0x1a4e53['error'](0x1f4,_0xb7429a[_0xab81('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 64c374c..61eb387 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 _0xa665=['get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xa665,0x1c8));var _0x5a66=function(_0x1ebc88,_0x638cd6){_0x1ebc88=_0x1ebc88-0x0;var _0xcef294=_0xa665[_0x1ebc88];return _0xcef294;};'use strict';var multer=require('multer');var util=require(_0x5a66('0x0'));var path=require('path');var timeout=require(_0x5a66('0x1'));var express=require(_0x5a66('0x2'));var router=express[_0x5a66('0x3')]();var auth=require(_0x5a66('0x4'));var interaction=require(_0x5a66('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0x5a66('0x6')]('/',auth[_0x5a66('0x7')](),controller[_0x5a66('0x8')]);router['get'](_0x5a66('0x9'),controller[_0x5a66('0xa')]);router[_0x5a66('0x6')](_0x5a66('0xb'),auth[_0x5a66('0x7')](),controller[_0x5a66('0xc')]);router['get'](_0x5a66('0xd'),auth[_0x5a66('0x7')](),controller[_0x5a66('0xe')]);var upload=multer({'storage':multer[_0x5a66('0xf')]({'destination':function(_0x11fa5c,_0xf44892,_0x5895ad){_0x5895ad(null,path[_0x5a66('0x10')](config['root'],_0x5a66('0x11')));},'filename':function(_0x4cf395,_0x1c8453,_0x4ca70b){_0x1c8453[_0x5a66('0x12')]=_0x1c8453[_0x5a66('0x12')][_0x5a66('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ca70b(null,util[_0x5a66('0x14')](_0x5a66('0x15'),path[_0x5a66('0x16')](_0x1c8453[_0x5a66('0x12')],path['extname'](_0x1c8453[_0x5a66('0x12')])),Date[_0x5a66('0x17')](),path[_0x5a66('0x18')](_0x1c8453[_0x5a66('0x12')])));}})});router[_0x5a66('0x19')]('/',upload[_0x5a66('0x1a')](_0x5a66('0x1b')),controller[_0x5a66('0x1c')]);router[_0x5a66('0x19')](_0x5a66('0x9'),controller[_0x5a66('0x1d')]);router[_0x5a66('0x1e')]('/:id',auth[_0x5a66('0x7')](),controller[_0x5a66('0x1f')]);router[_0x5a66('0x20')](_0x5a66('0xb'),auth[_0x5a66('0x7')](),controller[_0x5a66('0x20')]);module['exports']=router; \ No newline at end of file +var _0x3945=['../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','post','single','upload','webhookPost','put','update','delete','/:id','exports','multer','util','path','express','Router'];(function(_0x81697e,_0x552c16){var _0x1f6e36=function(_0x2a6bbd){while(--_0x2a6bbd){_0x81697e['push'](_0x81697e['shift']());}};_0x1f6e36(++_0x552c16);}(_0x3945,0x1b5));var _0x5394=function(_0x5dbbc5,_0x57a60d){_0x5dbbc5=_0x5dbbc5-0x0;var _0x2f1532=_0x3945[_0x5dbbc5];return _0x2f1532;};'use strict';var multer=require(_0x5394('0x0'));var util=require(_0x5394('0x1'));var path=require(_0x5394('0x2'));var timeout=require('connect-timeout');var express=require(_0x5394('0x3'));var router=express[_0x5394('0x4')]();var auth=require(_0x5394('0x5'));var interaction=require(_0x5394('0x6'));var config=require(_0x5394('0x7'));var controller=require(_0x5394('0x8'));router[_0x5394('0x9')]('/',auth['isAuthenticated'](),controller[_0x5394('0xa')]);router[_0x5394('0x9')](_0x5394('0xb'),controller[_0x5394('0xc')]);router['get']('/:id',auth[_0x5394('0xd')](),controller[_0x5394('0xe')]);router[_0x5394('0x9')](_0x5394('0xf'),auth[_0x5394('0xd')](),controller[_0x5394('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x328796,_0xd1a5bf,_0x2e1634){_0x2e1634(null,path[_0x5394('0x11')](config['root'],_0x5394('0x12')));},'filename':function(_0x4bbaee,_0x5aa828,_0x35b58d){_0x5aa828[_0x5394('0x13')]=_0x5aa828[_0x5394('0x13')][_0x5394('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35b58d(null,util[_0x5394('0x15')](_0x5394('0x16'),path[_0x5394('0x17')](_0x5aa828['originalname'],path[_0x5394('0x18')](_0x5aa828[_0x5394('0x13')])),Date['now'](),path[_0x5394('0x18')](_0x5aa828[_0x5394('0x13')])));}})});router[_0x5394('0x19')]('/',upload[_0x5394('0x1a')]('file'),controller[_0x5394('0x1b')]);router[_0x5394('0x19')](_0x5394('0xb'),controller[_0x5394('0x1c')]);router[_0x5394('0x1d')]('/:id',auth[_0x5394('0xd')](),controller[_0x5394('0x1e')]);router[_0x5394('0x1f')](_0x5394('0x20'),auth[_0x5394('0xd')](),controller[_0x5394('0x1f')]);module[_0x5394('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2d6a890..4c5a7bc 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 _0x6282=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x4ca10b,_0xe380a4){var _0x1395c9=function(_0x164769){while(--_0x164769){_0x4ca10b['push'](_0x4ca10b['shift']());}};_0x1395c9(++_0xe380a4);}(_0x6282,0x131));var _0x2628=function(_0x462d4b,_0x597689){_0x462d4b=_0x462d4b-0x0;var _0x606afe=_0x6282[_0x462d4b];return _0x606afe;};'use strict';var Sequelize=require(_0x2628('0x0'));module['exports']={'name':{'type':Sequelize[_0x2628('0x1')]},'type':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x3'),_0x2628('0x4'))},'description':{'type':Sequelize[_0x2628('0x5')]},'version':{'type':Sequelize[_0x2628('0x5')]},'path':{'type':Sequelize[_0x2628('0x1')],'comment':_0x2628('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2628('0x7')},'sidebar':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x8'),_0x2628('0x9'),_0x2628('0xa'),_0x2628('0xb')),'defaultValue':_0x2628('0xa'),'comment':_0x2628('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x2628('0x1')]},'agentUrl':{'type':Sequelize[_0x2628('0x1')]},'scriptName':{'type':Sequelize[_0x2628('0x1')]},'scriptPath':{'type':Sequelize[_0x2628('0x1')]}}; \ No newline at end of file +var _0x225d=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script'];(function(_0x5ba9e4,_0xe149ee){var _0x3764c9=function(_0x3ae0ee){while(--_0x3ae0ee){_0x5ba9e4['push'](_0x5ba9e4['shift']());}};_0x3764c9(++_0xe149ee);}(_0x225d,0x16f));var _0xd225=function(_0x41cfae,_0x1f02ec){_0x41cfae=_0x41cfae-0x0;var _0x5c6f7e=_0x225d[_0x41cfae];return _0x5c6f7e;};'use strict';var Sequelize=require(_0xd225('0x0'));module['exports']={'name':{'type':Sequelize[_0xd225('0x1')]},'type':{'type':Sequelize[_0xd225('0x2')](_0xd225('0x3'),_0xd225('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xd225('0x5')},'active':{'type':Sequelize[_0xd225('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xd225('0x2')](_0xd225('0x7'),_0xd225('0x8'),_0xd225('0x9'),_0xd225('0xa')),'defaultValue':_0xd225('0x9'),'comment':_0xd225('0xb')},'icon':{'type':Sequelize[_0xd225('0x1')]},'adminUrl':{'type':Sequelize[_0xd225('0x1')]},'agentUrl':{'type':Sequelize[_0xd225('0x1')]},'scriptName':{'type':Sequelize[_0xd225('0x1')]},'scriptPath':{'type':Sequelize[_0xd225('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 24cea71..e3f4790 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 _0xa6b5=['keys','query','filters','intersection','model','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','rawAttributes','fields','length','include','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','create','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','Plugin'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xa6b5,0x7b));var _0x5a6b=function(_0x27ad12,_0x1ed7c8){_0x27ad12=_0x27ad12-0x0;var _0x21eef9=_0xa6b5[_0x27ad12];return _0x21eef9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5a6b('0x0'));var zipdir=require(_0x5a6b('0x1'));var jsonpatch=require(_0x5a6b('0x2'));var rp=require('request-promise');var moment=require(_0x5a6b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a6b('0x4'));var path=require(_0x5a6b('0x5'));var sox=require('sox');var csv=require(_0x5a6b('0x6'));var ejs=require(_0x5a6b('0x7'));var fs=require('fs');var _=require(_0x5a6b('0x8'));var squel=require('squel');var crypto=require(_0x5a6b('0x9'));var jsforce=require(_0x5a6b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5a6b('0x6'));var querystring=require(_0x5a6b('0xb'));var Papa=require(_0x5a6b('0xc'));var extract=require(_0x5a6b('0xd'));var rimraf=require(_0x5a6b('0x0'));var archiver=require(_0x5a6b('0xe'));var Redis=require(_0x5a6b('0xf'));var authService=require(_0x5a6b('0x10'));var qs=require(_0x5a6b('0x11'));var hardwareService=require(_0x5a6b('0x12'));var logger=require(_0x5a6b('0x13'))(_0x5a6b('0x14'));var utils=require(_0x5a6b('0x15'));var config=require('../../config/environment');var db=require(_0x5a6b('0x16'))['db'];config['redis']=_[_0x5a6b('0x17')](config['redis'],{'host':_0x5a6b('0x18'),'port':0x18eb});var socket=require(_0x5a6b('0x19'))(new Redis(config['redis']));require(_0x5a6b('0x1a'))[_0x5a6b('0x1b')](socket);function respondWithStatusCode(_0x184c32,_0x12169b){_0x12169b=_0x12169b||0xcc;return function(_0x565312){if(_0x565312){return _0x184c32['sendStatus'](_0x12169b);}return _0x184c32[_0x5a6b('0x1c')](_0x12169b)[_0x5a6b('0x1d')]();};}function respondWithResult(_0x58120f,_0x21f7fc){_0x21f7fc=_0x21f7fc||0xc8;return function(_0x71bdd){if(_0x71bdd){return _0x58120f[_0x5a6b('0x1c')](_0x21f7fc)[_0x5a6b('0x1e')](_0x71bdd);}};}function respondWithFilteredResult(_0x1876f1,_0x145518){return function(_0x26e8b6){if(_0x26e8b6){var _0x13f90b=_0x26e8b6[_0x5a6b('0x1f')],_0x3da61d=_0x145518['offset'],_0xd8d156=_0x145518[_0x5a6b('0x20')]+_0x145518[_0x5a6b('0x21')],_0x331dba;if(_0xd8d156>=_0x13f90b){_0xd8d156=_0x13f90b;_0x331dba=0xc8;}else{_0x331dba=0xce;}_0x1876f1[_0x5a6b('0x1c')](_0x331dba);return _0x1876f1[_0x5a6b('0x22')](_0x5a6b('0x23'),_0x3da61d+'-'+_0xd8d156+'/'+_0x13f90b)[_0x5a6b('0x1e')](_0x26e8b6);}return null;};}function patchUpdates(_0x2a2a3a){return function(_0x3e57bf){try{jsonpatch[_0x5a6b('0x24')](_0x3e57bf,_0x2a2a3a,!![]);}catch(_0x58763a){return BPromise[_0x5a6b('0x25')](_0x58763a);}return _0x3e57bf[_0x5a6b('0x26')]();};}function saveUpdates(_0x5802bf,_0x3172f7){return function(_0x4d5d75){if(_0x4d5d75){return _0x4d5d75[_0x5a6b('0x27')](_0x5802bf)[_0x5a6b('0x28')](function(_0x2acaf1){return _0x2acaf1;});}return null;};}function removeEntity(_0x484b83,_0x2340c8){return function(_0x151330){if(_0x151330){return _0x151330[_0x5a6b('0x29')]()['then'](function(){var _0x168d47=_0x151330[_0x5a6b('0x2a')]({'plain':!![]});var _0xa1799d=_0x5a6b('0x2b');return db[_0x5a6b('0x2c')][_0x5a6b('0x29')]({'where':{'type':_0xa1799d,'resourceId':_0x168d47['id']}})['then'](function(){return _0x151330;});})[_0x5a6b('0x28')](function(){_0x484b83['status'](0xcc)[_0x5a6b('0x1d')]();});}};}function handleEntityNotFound(_0xb3fb0,_0x26177b){return function(_0x175f72){if(!_0x175f72){_0xb3fb0[_0x5a6b('0x2d')](0x194);}return _0x175f72;};}function handleError(_0x3b86c7,_0x37655c){_0x37655c=_0x37655c||0x1f4;return function(_0x292712){logger[_0x5a6b('0x2e')](_0x292712[_0x5a6b('0x2f')]);if(_0x292712[_0x5a6b('0x30')]){delete _0x292712[_0x5a6b('0x30')];}_0x3b86c7[_0x5a6b('0x1c')](_0x37655c)[_0x5a6b('0x31')](_0x292712);};}exports['index']=function(_0x2183ae,_0x758171){var _0x2843b={},_0x4be0fb={},_0x3a888b={'count':0x0,'rows':[]};var _0x49c6fa=db[_0x5a6b('0x32')]['rawAttributes'];_0x4be0fb['model']=_[_0x5a6b('0x33')](_0x49c6fa);_0x4be0fb[_0x5a6b('0x34')]=_['keys'](_0x2183ae[_0x5a6b('0x34')]);_0x4be0fb[_0x5a6b('0x35')]=_[_0x5a6b('0x36')](_0x4be0fb[_0x5a6b('0x37')],_0x4be0fb[_0x5a6b('0x34')]);_0x2843b[_0x5a6b('0x38')]=_['intersection'](_0x4be0fb[_0x5a6b('0x37')],qs['fields'](_0x2183ae[_0x5a6b('0x34')]['fields']));_0x2843b['attributes']=_0x2843b[_0x5a6b('0x38')]['length']?_0x2843b[_0x5a6b('0x38')]:_0x4be0fb[_0x5a6b('0x37')];if(!_0x2183ae[_0x5a6b('0x34')]['hasOwnProperty'](_0x5a6b('0x39'))){_0x2843b['limit']=qs[_0x5a6b('0x21')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x21')]);_0x2843b['offset']=qs[_0x5a6b('0x20')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x20')]);}_0x2843b[_0x5a6b('0x3a')]=qs[_0x5a6b('0x3b')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x3b')]);_0x2843b[_0x5a6b('0x3c')]=qs['filters'](_[_0x5a6b('0x3d')](_0x2183ae['query'],_0x4be0fb['filters']));if(_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x3e')]){_0x2843b[_0x5a6b('0x3c')]=_[_0x5a6b('0x3f')](_0x2843b['where'],{'$or':_[_0x5a6b('0x40')](_0x49c6fa,function(_0x3368cb){if(_0x3368cb[_0x5a6b('0x41')][_0x5a6b('0x42')]!==_0x5a6b('0x43')){var _0x4935da={};_0x4935da[_0x3368cb[_0x5a6b('0x44')]]={'$like':'%'+_0x2183ae[_0x5a6b('0x34')]['filter']+'%'};return _0x4935da;}})});}_0x2843b=_[_0x5a6b('0x3f')]({},_0x2843b,_0x2183ae[_0x5a6b('0x45')]);var _0x1e37e6={'where':_0x2843b[_0x5a6b('0x3c')]};return db[_0x5a6b('0x32')]['count'](_0x1e37e6)[_0x5a6b('0x28')](function(_0x15db68){_0x3a888b[_0x5a6b('0x1f')]=_0x15db68;if(_0x2183ae['query'][_0x5a6b('0x46')]){_0x2843b['include']=[{'all':!![]}];}return db[_0x5a6b('0x32')][_0x5a6b('0x47')](_0x2843b);})['then'](function(_0xd1873d){_0x3a888b[_0x5a6b('0x48')]=_0xd1873d;return _0x3a888b;})[_0x5a6b('0x28')](respondWithFilteredResult(_0x758171,_0x2843b))[_0x5a6b('0x49')](handleError(_0x758171,null));};exports[_0x5a6b('0x4a')]=function(_0x7e9200,_0x258fa5){var _0x19125a={'raw':!![],'where':{'id':_0x7e9200['params']['id']}},_0x266c70={};_0x266c70[_0x5a6b('0x37')]=_[_0x5a6b('0x33')](db[_0x5a6b('0x32')][_0x5a6b('0x4b')]);_0x266c70[_0x5a6b('0x34')]=_['keys'](_0x7e9200[_0x5a6b('0x34')]);_0x266c70['filters']=_['intersection'](_0x266c70['model'],_0x266c70['query']);_0x19125a[_0x5a6b('0x38')]=_['intersection'](_0x266c70[_0x5a6b('0x37')],qs[_0x5a6b('0x4c')](_0x7e9200[_0x5a6b('0x34')][_0x5a6b('0x4c')]));_0x19125a[_0x5a6b('0x38')]=_0x19125a[_0x5a6b('0x38')][_0x5a6b('0x4d')]?_0x19125a[_0x5a6b('0x38')]:_0x266c70['model'];if(_0x7e9200[_0x5a6b('0x34')][_0x5a6b('0x46')]){_0x19125a[_0x5a6b('0x4e')]=[{'all':!![]}];}_0x19125a=_[_0x5a6b('0x3f')]({},_0x19125a,_0x7e9200[_0x5a6b('0x45')]);return db[_0x5a6b('0x32')]['find'](_0x19125a)[_0x5a6b('0x28')](handleEntityNotFound(_0x258fa5,null))[_0x5a6b('0x28')](respondWithResult(_0x258fa5,null))['catch'](handleError(_0x258fa5,null));};exports[_0x5a6b('0x4f')]=function(_0x536f5b,_0x4ffeb0,_0x11237b){return db['Plugin'][_0x5a6b('0x50')]({'where':{'id':_0x536f5b['params']['id']},'attributes':[_0x5a6b('0x30'),_0x5a6b('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x4ffeb0,null))[_0x5a6b('0x28')](function(_0x8dd3c){if(_0x8dd3c){var _0x2e9d7b=path['join'](config[_0x5a6b('0x51')],_0x5a6b('0x52'),util[_0x5a6b('0x53')](_0x5a6b('0x54'),path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')])));var _0x29d7e3=fs[_0x5a6b('0x56')](_0x2e9d7b);var _0x4ddac2=archiver(_0x5a6b('0x57'),{'zlib':{'level':0x9}});_0x4ddac2['on'](_0x5a6b('0x58'),function(_0x32da26){if(_0x32da26[_0x5a6b('0x59')]===_0x5a6b('0x5a')){logger[_0x5a6b('0x2e')](_0x32da26);}else{throw new db[(_0x5a6b('0x5b'))]['Error'](_0x5a6b('0x5c'));}});_0x4ddac2['on'](_0x5a6b('0x2e'),function(_0x4803cd){throw new db[(_0x5a6b('0x5b'))]['Error'](_0x5a6b('0x5c'));});_0x4ddac2[_0x5a6b('0x5d')](_0x29d7e3);_0x4ddac2['glob'](_0x5a6b('0x5e'),{'cwd':path[_0x5a6b('0x5f')](config[_0x5a6b('0x51')],'server/files/plugins',path[_0x5a6b('0x60')](_0x8dd3c[_0x5a6b('0x5')])),'ignore':[path[_0x5a6b('0x5f')](path['basename'](_0x8dd3c[_0x5a6b('0x5')]),_0x5a6b('0x61')),path[_0x5a6b('0x5f')](path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')]),_0x5a6b('0x62'))],'nodir':!![]})[_0x5a6b('0x63')]();_0x29d7e3['on'](_0x5a6b('0x64'),function(){if(!fs['existsSync'](_0x2e9d7b)){throw new db[(_0x5a6b('0x5b'))][(_0x5a6b('0x65'))](_0x5a6b('0x66'));}return _0x4ffeb0['download'](_0x2e9d7b,util[_0x5a6b('0x53')](_0x5a6b('0x54'),path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')])),function(_0x571ea1){if(_0x571ea1){throw new db[(_0x5a6b('0x5b'))][(_0x5a6b('0x65'))](_0x5a6b('0x67'));}fs['unlinkSync'](_0x2e9d7b);logger[_0x5a6b('0x68')](_0x5a6b('0x69'));logger[_0x5a6b('0x68')](_0x5a6b('0x6a'));});});}return null;})[_0x5a6b('0x49')](handleError(_0x4ffeb0,null));};exports[_0x5a6b('0x6b')]=function(_0x38ad1b,_0x4448a4,_0x3e70ce){var _0x33d366=path[_0x5a6b('0x55')](_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')],path['extname'](_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')]));var _0x399c34=path[_0x5a6b('0x5f')](config['root'],_0x5a6b('0x52'),_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')]);var _0x24515c=path[_0x5a6b('0x5f')](config[_0x5a6b('0x51')],_0x5a6b('0x52'),_0x33d366);logger[_0x5a6b('0x68')](_0x5a6b('0x6e'),_0x399c34);logger[_0x5a6b('0x68')](_0x5a6b('0x6f'),_0x24515c);try{fs[_0x5a6b('0x70')](_0x399c34,parseInt(_0x5a6b('0x71'),0x8));extract(_0x399c34,{'dir':_0x24515c},function(_0x2b1a59){if(_0x2b1a59){logger[_0x5a6b('0x2e')](_0x2b1a59);handleError(_0x2b1a59,!![]);};var _0x586ef9=fs[_0x5a6b('0x72')](_0x24515c);if(_0x586ef9[_0x5a6b('0x4d')]>0x1){removeReferences(_0x399c34,_0x24515c);logger['error'](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}var _0x549cc9=fs[_0x5a6b('0x74')](path[_0x5a6b('0x5f')](_0x24515c,_0x586ef9[0x0]));if(_0x549cc9[_0x5a6b('0x75')]()){removeReferences(_0x399c34,_0x24515c);logger['error'](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}if(_0x549cc9[_0x5a6b('0x76')]()){var _0x5d234b=fs[_0x5a6b('0x72')](path['join'](_0x24515c,_0x586ef9[0x0]));if(_0x5d234b[_0x5a6b('0x4d')]===0x0){removeReferences(_0x399c34,_0x24515c);logger[_0x5a6b('0x2e')](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}var _0x14585d=_0x5d234b['some'](function(_0xac0697){return _0xac0697===_0x5a6b('0x77');});if(!_0x14585d){return _0x3e70ce(new Error('Plugin\x20manifest\x20missing'));}var _0x33a4b7=fs[_0x5a6b('0x78')](path[_0x5a6b('0x5f')](_0x24515c,_0x586ef9[0x0],_0x5a6b('0x77')));var _0x171d21=JSON[_0x5a6b('0x79')](_0x33a4b7);if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x30')]){return _0x3e70ce(new Error(_0x5a6b('0x7b')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x41')]){return _0x3e70ce(new Error(_0x5a6b('0x7c')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7d')]){return _0x3e70ce(new Error(_0x5a6b('0x7e')));}if('undefined'==typeof _0x171d21[_0x5a6b('0x7f')]){return _0x3e70ce(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x171d21[_0x5a6b('0x41')]===_0x5a6b('0x80')){if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7f')]['views']){return _0x3e70ce(new Error(_0x5a6b('0x81')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')]&&'undefined'==typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x84')]){return _0x3e70ce(new Error(_0x5a6b('0x85')));}}else if(_0x171d21[_0x5a6b('0x41')]===_0x5a6b('0x86')){if('undefined'==typeof _0x171d21[_0x5a6b('0x7f')]['scriptName']){return _0x3e70ce(new Error(_0x5a6b('0x87')));}if('undefined'==typeof _0x171d21['parameters'][_0x5a6b('0x88')]){return _0x3e70ce(new Error(_0x5a6b('0x89')));}}else{return _0x3e70ce(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x619f2d=_0x171d21[_0x5a6b('0x30')];var _0x257680=_0x171d21[_0x5a6b('0x8a')];var _0x3fc3f2=_0x171d21[_0x5a6b('0x41')];var _0x53e42b=_0x171d21[_0x5a6b('0x8b')]?_0x171d21[_0x5a6b('0x8b')]:'always';var _0x38a1b7=_0x171d21[_0x5a6b('0x8c')]?_0x171d21[_0x5a6b('0x8c')]:'icon-apps';var _0x49fea4='';var _0x2024a9='';var _0x489c02='';var _0x2549ca='';var _0xa9bd89=_0x171d21['version'];if(_0x3fc3f2===_0x5a6b('0x80')){if('undefined'!=typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')]){var _0x139e2d=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x139e2d)){_0x49fea4=path['join'](_0x5a6b('0x8d'),_0x33d366,_0x586ef9[0x0],_0x139e2d);}else{_0x49fea4=_0x139e2d;}}else{logger[_0x5a6b('0x68')](_0x5a6b('0x8e'));}if(_0x5a6b('0x7a')!=typeof _0x171d21['parameters'][_0x5a6b('0x82')][_0x5a6b('0x84')]){var _0x43e8ff=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x5a6b('0x8f')](_0x43e8ff)){_0x2024a9=path[_0x5a6b('0x5f')](_0x5a6b('0x8d'),_0x33d366,_0x586ef9[0x0],_0x43e8ff);}else{_0x2024a9=_0x43e8ff;}}else{logger['info'](_0x5a6b('0x90'));}}else if(_0x3fc3f2==='script'){_0x489c02=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x91')];_0x2549ca=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x88')];if('undefined'!=typeof _0x171d21['parameters']['views']){if(_0x5a6b('0x7a')!=typeof _0x171d21['parameters'][_0x5a6b('0x82')][_0x5a6b('0x83')]){var _0x139e2d=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x139e2d)){_0x49fea4=path[_0x5a6b('0x5f')]('plugins',_0x33d366,_0x586ef9[0x0],_0x139e2d);}else{_0x49fea4=_0x139e2d;}}if('undefined'!=typeof _0x171d21['parameters']['views'][_0x5a6b('0x84')]){var _0x43e8ff=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5a6b('0x8f')](_0x43e8ff)){_0x2024a9=path['join']('plugins',_0x33d366,_0x586ef9[0x0],_0x43e8ff);}else{_0x2024a9=_0x43e8ff;}}}}var _0x23d885={'name':_0x619f2d,'description':_0x257680,'path':path[_0x5a6b('0x5f')](_0x33d366,_0x586ef9[0x0]),'type':_0x3fc3f2,'sidebar':_0x53e42b,'icon':_0x38a1b7,'adminUrl':_0x49fea4,'agentUrl':_0x2024a9,'scriptName':_0x489c02,'scriptPath':_0x2549ca,'version':_0xa9bd89};removeReferences(_0x399c34,null);return db[_0x5a6b('0x32')]['create'](_0x23d885)['then'](function(_0xd5c97){var _0x56fa54={'role':_0x38ad1b['body'][_0x5a6b('0x92')],'userProfileId':_0x38ad1b[_0x5a6b('0x93')][_0x5a6b('0x94')]};if(!_0x56fa54)throw new Error(_0x5a6b('0x95'));if(_0x56fa54[_0x5a6b('0x92')]===_0x5a6b('0x96')){var _0x470e15=_0xd5c97['get']({'plain':!![]});return db['UserProfileSection'][_0x5a6b('0x50')]({'where':{'name':_0x5a6b('0x2b'),'userProfileId':_0x56fa54[_0x5a6b('0x94')]},'raw':!![]})[_0x5a6b('0x28')](function(_0x10f757){if(_0x10f757&&_0x10f757[_0x5a6b('0x97')]===0x0){return db['UserProfileResource'][_0x5a6b('0x98')]({'name':_0x470e15['name'],'resourceId':_0x470e15['id'],'type':_0x10f757[_0x5a6b('0x30')],'sectionId':_0x10f757['id']},{})[_0x5a6b('0x28')](function(){return _0xd5c97;});}else{return _0xd5c97;}})[_0x5a6b('0x49')](function(_0x42b689){logger[_0x5a6b('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42b689);throw _0x42b689;});}return _0xd5c97;})[_0x5a6b('0x28')](respondWithResult(_0x4448a4,null))[_0x5a6b('0x49')](handleError(_0x4448a4,null));}});}catch(_0x541ca6){_0x4448a4[_0x5a6b('0x1c')](0x1f4)[_0x5a6b('0x31')](_0x541ca6);}};function removeReferences(_0x20e23c,_0x452633){try{if(_0x20e23c){fs[_0x5a6b('0x99')](_0x20e23c);logger['info'](_0x5a6b('0x9a'));}if(_0x452633){rimraf(_0x452633,function(){});logger[_0x5a6b('0x68')](_0x5a6b('0x9b'));}}catch(_0x315ff5){logger[_0x5a6b('0x2e')](_0x315ff5);}}exports['update']=function(_0x57cf89,_0xec1f52,_0x20de7f){return db[_0x5a6b('0x32')]['find']({'where':{'id':_0x57cf89[_0x5a6b('0x9c')]['id']}})['then'](handleEntityNotFound(_0xec1f52,null))[_0x5a6b('0x28')](saveUpdates(_0x57cf89[_0x5a6b('0x93')],null))[_0x5a6b('0x28')](respondWithResult(_0xec1f52,null))[_0x5a6b('0x49')](handleError(_0xec1f52,null));};exports[_0x5a6b('0x9d')]=function(_0x1d523d,_0xef39b3,_0x35f9e3){return db[_0x5a6b('0x32')][_0x5a6b('0x50')]({'where':{'id':_0x1d523d[_0x5a6b('0x9c')]['id']}})[_0x5a6b('0x28')](function(_0x534e7e){if(_0x534e7e){return _0x534e7e[_0x5a6b('0x29')]();}})['then'](function(_0x3906be){rimraf(path[_0x5a6b('0x5f')](config['root'],'server/files/plugins',path[_0x5a6b('0x60')](_0x3906be[_0x5a6b('0x5')])),function(){});return _0x3906be;})[_0x5a6b('0x28')](handleEntityNotFound(_0xef39b3,null))[_0x5a6b('0x28')](respondWithStatusCode(_0xef39b3,null))[_0x5a6b('0x49')](handleError(_0xef39b3,null));};exports[_0x5a6b('0x9e')]=function(_0x1e2e83,_0x5f00cc,_0x3aa27d){return BPromise[_0x5a6b('0x9f')]()[_0x5a6b('0x28')](function(){if(!_0x1e2e83['query'][_0x5a6b('0x5')]){throw new Error(_0x5a6b('0xa0'));}if(!_0x1e2e83['query'][_0x5a6b('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3fa447=_0x1e2e83['query'][_0x5a6b('0xa2')]?_0x1e2e83['query'][_0x5a6b('0xa2')]+':'+_0x1e2e83[_0x5a6b('0x34')]['port']:_0x5a6b('0xa3')+_0x1e2e83[_0x5a6b('0x34')][_0x5a6b('0xa1')];var _0x54374b=_0x1e2e83[_0x5a6b('0x34')]['json']?_0x1e2e83[_0x5a6b('0x34')]['json']:!![];var _0x38dde0=_0x1e2e83['query']['encoding']?_0x1e2e83['query'][_0x5a6b('0xa4')]:null;var _0x1fd79b={'method':_0x1e2e83[_0x5a6b('0xa5')],'uri':util[_0x5a6b('0x53')]('%s%s',_0x3fa447,_0x1e2e83['query']['path']),'json':_0x54374b,'resolveWithFullResponse':!![],'encoding':_0x38dde0,'qs':_0x1e2e83[_0x5a6b('0x34')]};if(_0x1e2e83[_0x5a6b('0xa6')]){_0x1fd79b[_0x5a6b('0xa6')]=_0x1e2e83[_0x5a6b('0xa6')];if(_0x1fd79b[_0x5a6b('0xa6')]['content-length']){delete _0x1fd79b[_0x5a6b('0xa6')][_0x5a6b('0xa7')];}}if(_0x1fd79b[_0x5a6b('0xa6')][_0x5a6b('0xa8')]){delete _0x1fd79b[_0x5a6b('0xa6')]['content-type'];}return rp(_0x1fd79b);})['then'](function(_0xebd22b){if(_0xebd22b){_0x5f00cc['set'](_0xebd22b[_0x5a6b('0xa6')]);logger['info'](_0xebd22b['body']);if(_[_0x5a6b('0xa9')](_0x1e2e83[_0x5a6b('0x34')][_0x5a6b('0x5')],'download')&&_0xebd22b[_0x5a6b('0xaa')]==0x1f4){return _0x5f00cc[_0x5a6b('0x2d')](_0xebd22b[_0x5a6b('0xaa')]);}else{return _0x5f00cc[_0x5a6b('0x1c')](_0xebd22b[_0x5a6b('0xaa')])[_0x5a6b('0x31')](_0xebd22b['body']);}}else{return _0x5f00cc['sendStatus'](0xc8);}})[_0x5a6b('0x49')](handleError(_0x5f00cc,null));};exports[_0x5a6b('0xab')]=function(_0x2c5f4e,_0x30186c,_0x23a71a){return BPromise[_0x5a6b('0x9f')]()[_0x5a6b('0x28')](function(){if(!_0x2c5f4e[_0x5a6b('0x34')]['path']){throw new Error(_0x5a6b('0xa0'));}if(!_0x2c5f4e[_0x5a6b('0x34')]['port']){throw new Error(_0x5a6b('0xac'));}var _0x3e2249=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa2')]?_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa2')]+':'+_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa1')]:'http://localhost:'+_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa1')];var _0x339a69=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x1e')]?_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x1e')]:!![];var _0x2bbb93=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa4')]?_0x2c5f4e[_0x5a6b('0x34')]['encoding']:null;var _0x19f65f={'method':_0x2c5f4e[_0x5a6b('0xa5')],'uri':util[_0x5a6b('0x53')](_0x5a6b('0xad'),_0x3e2249,_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x5')]),'json':_0x339a69,'resolveWithFullResponse':!![],'encoding':_0x2bbb93,'body':_0x2c5f4e[_0x5a6b('0x93')]};if(_0x2c5f4e['headers']){_0x19f65f[_0x5a6b('0xa6')]=_0x2c5f4e[_0x5a6b('0xa6')];if(_0x19f65f[_0x5a6b('0xa6')][_0x5a6b('0xa7')]){delete _0x19f65f[_0x5a6b('0xa6')][_0x5a6b('0xa7')];}}if(_0x19f65f['headers'][_0x5a6b('0xa8')]){delete _0x19f65f[_0x5a6b('0xa6')]['content-type'];}return rp(_0x19f65f);})[_0x5a6b('0x28')](function(_0x79cd95){if(_0x79cd95){_0x30186c[_0x5a6b('0x22')](_0x79cd95[_0x5a6b('0xa6')]);logger[_0x5a6b('0x68')](_0x79cd95[_0x5a6b('0x93')]);return _0x30186c[_0x5a6b('0x1c')](_0x79cd95['statusCode'])[_0x5a6b('0x31')](_0x79cd95[_0x5a6b('0x93')]);}else{return _0x30186c[_0x5a6b('0x2d')](0xc8);}})[_0x5a6b('0x49')](handleError(_0x30186c,null));}; \ No newline at end of file +var _0xcba7=['chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','plugins','create','body','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','set','endsWith','statusCode','send','webhookPost','http://localhost:','%s%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','Plugins','UserProfileResource','destroy','error','stack','name','index','Plugin','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','basename','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s'];(function(_0x54b7b5,_0x40a71d){var _0x17beab=function(_0xdd0513){while(--_0xdd0513){_0x54b7b5['push'](_0x54b7b5['shift']());}};_0x17beab(++_0x40a71d);}(_0xcba7,0x199));var _0x7cba=function(_0x51065f,_0xd93aa8){_0x51065f=_0x51065f-0x0;var _0x42bed3=_0xcba7[_0x51065f];return _0x42bed3;};'use strict';var pdf=require(_0x7cba('0x0'));var emlformat=require(_0x7cba('0x1'));var rimraf=require(_0x7cba('0x2'));var zipdir=require(_0x7cba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cba('0x4'));var moment=require(_0x7cba('0x5'));var BPromise=require(_0x7cba('0x6'));var Mustache=require('mustache');var util=require(_0x7cba('0x7'));var path=require(_0x7cba('0x8'));var sox=require(_0x7cba('0x9'));var csv=require(_0x7cba('0xa'));var ejs=require(_0x7cba('0xb'));var fs=require('fs');var _=require(_0x7cba('0xc'));var squel=require(_0x7cba('0xd'));var crypto=require(_0x7cba('0xe'));var jsforce=require(_0x7cba('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7cba('0xa'));var querystring=require(_0x7cba('0x10'));var Papa=require(_0x7cba('0x11'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x7cba('0x12'));var Redis=require(_0x7cba('0x13'));var authService=require(_0x7cba('0x14'));var qs=require(_0x7cba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cba('0x16'))(_0x7cba('0x17'));var utils=require(_0x7cba('0x18'));var config=require(_0x7cba('0x19'));var db=require(_0x7cba('0x1a'))['db'];config[_0x7cba('0x1b')]=_[_0x7cba('0x1c')](config[_0x7cba('0x1b')],{'host':_0x7cba('0x1d'),'port':0x18eb});var socket=require(_0x7cba('0x1e'))(new Redis(config[_0x7cba('0x1b')]));require(_0x7cba('0x1f'))['register'](socket);function respondWithStatusCode(_0x5877da,_0x252005){_0x252005=_0x252005||0xcc;return function(_0xbf5ce8){if(_0xbf5ce8){return _0x5877da[_0x7cba('0x20')](_0x252005);}return _0x5877da[_0x7cba('0x21')](_0x252005)[_0x7cba('0x22')]();};}function respondWithResult(_0x28dfd1,_0x384768){_0x384768=_0x384768||0xc8;return function(_0x40c869){if(_0x40c869){return _0x28dfd1[_0x7cba('0x21')](_0x384768)[_0x7cba('0x23')](_0x40c869);}};}function respondWithFilteredResult(_0x534503,_0x113e6b){return function(_0x587c41){if(_0x587c41){var _0x55ee32=_0x587c41['count'],_0x4503ec=_0x113e6b[_0x7cba('0x24')],_0x18400b=_0x113e6b['offset']+_0x113e6b[_0x7cba('0x25')],_0x13e2f6;if(_0x18400b>=_0x55ee32){_0x18400b=_0x55ee32;_0x13e2f6=0xc8;}else{_0x13e2f6=0xce;}_0x534503['status'](_0x13e2f6);return _0x534503['set'](_0x7cba('0x26'),_0x4503ec+'-'+_0x18400b+'/'+_0x55ee32)[_0x7cba('0x23')](_0x587c41);}return null;};}function patchUpdates(_0x20d6f4){return function(_0x194c46){try{jsonpatch[_0x7cba('0x27')](_0x194c46,_0x20d6f4,!![]);}catch(_0x4bc835){return BPromise[_0x7cba('0x28')](_0x4bc835);}return _0x194c46['save']();};}function saveUpdates(_0xb8ae3d,_0x3b1a8d){return function(_0x1d39c2){if(_0x1d39c2){return _0x1d39c2[_0x7cba('0x29')](_0xb8ae3d)[_0x7cba('0x2a')](function(_0x3cd540){return _0x3cd540;});}return null;};}function removeEntity(_0x3ebe2e,_0x4a6883){return function(_0x24446a){if(_0x24446a){return _0x24446a['destroy']()['then'](function(){var _0x1c9535=_0x24446a['get']({'plain':!![]});var _0x4af3ab=_0x7cba('0x2b');return db[_0x7cba('0x2c')][_0x7cba('0x2d')]({'where':{'type':_0x4af3ab,'resourceId':_0x1c9535['id']}})[_0x7cba('0x2a')](function(){return _0x24446a;});})['then'](function(){_0x3ebe2e[_0x7cba('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9ce3,_0xd9b2af){return function(_0x1f8065){if(!_0x1f8065){_0x5d9ce3[_0x7cba('0x20')](0x194);}return _0x1f8065;};}function handleError(_0x336dcb,_0x2f4f15){_0x2f4f15=_0x2f4f15||0x1f4;return function(_0x213f3a){logger[_0x7cba('0x2e')](_0x213f3a[_0x7cba('0x2f')]);if(_0x213f3a[_0x7cba('0x30')]){delete _0x213f3a['name'];}_0x336dcb[_0x7cba('0x21')](_0x2f4f15)['send'](_0x213f3a);};}exports[_0x7cba('0x31')]=function(_0x404dec,_0x34b9e6){var _0x16bab3={},_0x42f825={},_0xdcfb3f={'count':0x0,'rows':[]};var _0x442c25=db[_0x7cba('0x32')]['rawAttributes'];_0x42f825[_0x7cba('0x33')]=_['keys'](_0x442c25);_0x42f825[_0x7cba('0x34')]=_[_0x7cba('0x35')](_0x404dec[_0x7cba('0x34')]);_0x42f825[_0x7cba('0x36')]=_[_0x7cba('0x37')](_0x42f825[_0x7cba('0x33')],_0x42f825['query']);_0x16bab3['attributes']=_[_0x7cba('0x37')](_0x42f825[_0x7cba('0x33')],qs[_0x7cba('0x38')](_0x404dec['query']['fields']));_0x16bab3[_0x7cba('0x39')]=_0x16bab3['attributes'][_0x7cba('0x3a')]?_0x16bab3[_0x7cba('0x39')]:_0x42f825[_0x7cba('0x33')];if(!_0x404dec[_0x7cba('0x34')][_0x7cba('0x3b')]('nolimit')){_0x16bab3[_0x7cba('0x25')]=qs[_0x7cba('0x25')](_0x404dec[_0x7cba('0x34')]['limit']);_0x16bab3['offset']=qs[_0x7cba('0x24')](_0x404dec['query'][_0x7cba('0x24')]);}_0x16bab3[_0x7cba('0x3c')]=qs['sort'](_0x404dec[_0x7cba('0x34')][_0x7cba('0x3d')]);_0x16bab3[_0x7cba('0x3e')]=qs[_0x7cba('0x36')](_[_0x7cba('0x3f')](_0x404dec[_0x7cba('0x34')],_0x42f825[_0x7cba('0x36')]));if(_0x404dec[_0x7cba('0x34')]['filter']){_0x16bab3[_0x7cba('0x3e')]=_[_0x7cba('0x40')](_0x16bab3[_0x7cba('0x3e')],{'$or':_[_0x7cba('0x41')](_0x442c25,function(_0x37a22a){if(_0x37a22a[_0x7cba('0x42')][_0x7cba('0x43')]!==_0x7cba('0x44')){var _0x2769f1={};_0x2769f1[_0x37a22a['field']]={'$like':'%'+_0x404dec['query']['filter']+'%'};return _0x2769f1;}})});}_0x16bab3=_['merge']({},_0x16bab3,_0x404dec['options']);var _0x330069={'where':_0x16bab3[_0x7cba('0x3e')]};return db[_0x7cba('0x32')]['count'](_0x330069)['then'](function(_0x3d4612){_0xdcfb3f[_0x7cba('0x45')]=_0x3d4612;if(_0x404dec['query'][_0x7cba('0x46')]){_0x16bab3[_0x7cba('0x47')]=[{'all':!![]}];}return db[_0x7cba('0x32')][_0x7cba('0x48')](_0x16bab3);})[_0x7cba('0x2a')](function(_0x5b5016){_0xdcfb3f[_0x7cba('0x49')]=_0x5b5016;return _0xdcfb3f;})[_0x7cba('0x2a')](respondWithFilteredResult(_0x34b9e6,_0x16bab3))[_0x7cba('0x4a')](handleError(_0x34b9e6,null));};exports[_0x7cba('0x4b')]=function(_0x53e0de,_0x18d59a){var _0x4d5aef={'raw':!![],'where':{'id':_0x53e0de[_0x7cba('0x4c')]['id']}},_0x3c3ffd={};_0x3c3ffd[_0x7cba('0x33')]=_[_0x7cba('0x35')](db[_0x7cba('0x32')][_0x7cba('0x4d')]);_0x3c3ffd[_0x7cba('0x34')]=_['keys'](_0x53e0de['query']);_0x3c3ffd[_0x7cba('0x36')]=_['intersection'](_0x3c3ffd['model'],_0x3c3ffd[_0x7cba('0x34')]);_0x4d5aef[_0x7cba('0x39')]=_[_0x7cba('0x37')](_0x3c3ffd[_0x7cba('0x33')],qs[_0x7cba('0x38')](_0x53e0de[_0x7cba('0x34')][_0x7cba('0x38')]));_0x4d5aef[_0x7cba('0x39')]=_0x4d5aef[_0x7cba('0x39')][_0x7cba('0x3a')]?_0x4d5aef[_0x7cba('0x39')]:_0x3c3ffd['model'];if(_0x53e0de['query']['includeAll']){_0x4d5aef[_0x7cba('0x47')]=[{'all':!![]}];}_0x4d5aef=_['merge']({},_0x4d5aef,_0x53e0de[_0x7cba('0x4e')]);return db[_0x7cba('0x32')][_0x7cba('0x4f')](_0x4d5aef)[_0x7cba('0x2a')](handleEntityNotFound(_0x18d59a,null))[_0x7cba('0x2a')](respondWithResult(_0x18d59a,null))['catch'](handleError(_0x18d59a,null));};exports[_0x7cba('0x50')]=function(_0x3acbf2,_0x5b077f,_0x6e8ab7){return db[_0x7cba('0x32')][_0x7cba('0x4f')]({'where':{'id':_0x3acbf2['params']['id']},'attributes':['name',_0x7cba('0x8')],'raw':!![]})[_0x7cba('0x2a')](handleEntityNotFound(_0x5b077f,null))[_0x7cba('0x2a')](function(_0x1804f5){if(_0x1804f5){var _0x582db0=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),util[_0x7cba('0x54')](_0x7cba('0x55'),path['basename'](_0x1804f5[_0x7cba('0x8')])));var _0x5d67e8=fs[_0x7cba('0x56')](_0x582db0);var _0xf0f9da=archiver(_0x7cba('0x57'),{'zlib':{'level':0x9}});_0xf0f9da['on']('warning',function(_0x18a05f){if(_0x18a05f[_0x7cba('0x58')]===_0x7cba('0x59')){logger['error'](_0x18a05f);}else{throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))](_0x7cba('0x5c'));}});_0xf0f9da['on']('error',function(_0x189fca){throw new db['Sequelize']['Error'](_0x7cba('0x5c'));});_0xf0f9da[_0x7cba('0x5d')](_0x5d67e8);_0xf0f9da[_0x7cba('0x5e')]('**/*',{'cwd':path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),path['dirname'](_0x1804f5['path'])),'ignore':[path['join'](path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')]),'node_modules/**/*'),path['join'](path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x7cba('0x60')]();_0x5d67e8['on'](_0x7cba('0x61'),function(){if(!fs[_0x7cba('0x62')](_0x582db0)){throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))](_0x7cba('0x63'));}return _0x5b077f[_0x7cba('0x50')](_0x582db0,util[_0x7cba('0x54')](_0x7cba('0x55'),path[_0x7cba('0x5f')](_0x1804f5[_0x7cba('0x8')])),function(_0x581f8e){if(_0x581f8e){throw new db[(_0x7cba('0x5a'))][(_0x7cba('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x7cba('0x64')](_0x582db0);logger[_0x7cba('0x65')](_0x7cba('0x66'));logger['info'](_0x7cba('0x67'));});});}return null;})['catch'](handleError(_0x5b077f,null));};exports[_0x7cba('0x68')]=function(_0x4c7726,_0x3d21a2,_0x29429b){var _0x3fe6fb=path[_0x7cba('0x5f')](_0x4c7726[_0x7cba('0x69')][_0x7cba('0x6a')],path[_0x7cba('0x6b')](_0x4c7726['file'][_0x7cba('0x6a')]));var _0x4754f1=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),_0x4c7726['file']['filename']);var _0x10a90a=path[_0x7cba('0x51')](config[_0x7cba('0x52')],_0x7cba('0x53'),_0x3fe6fb);logger[_0x7cba('0x65')](_0x7cba('0x6c'),_0x4754f1);logger[_0x7cba('0x65')](_0x7cba('0x6d'),_0x10a90a);try{fs[_0x7cba('0x6e')](_0x4754f1,parseInt(_0x7cba('0x6f'),0x8));extract(_0x4754f1,{'dir':_0x10a90a},function(_0x9e5092){if(_0x9e5092){logger[_0x7cba('0x2e')](_0x9e5092);handleError(_0x9e5092,!![]);};var _0x25a03b=fs[_0x7cba('0x70')](_0x10a90a);if(_0x25a03b[_0x7cba('0x3a')]>0x1){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}var _0x566bb1=fs[_0x7cba('0x72')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0]));if(_0x566bb1['isFile']()){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}if(_0x566bb1[_0x7cba('0x73')]()){var _0x4832de=fs[_0x7cba('0x70')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0]));if(_0x4832de[_0x7cba('0x3a')]===0x0){removeReferences(_0x4754f1,_0x10a90a);logger[_0x7cba('0x2e')](_0x7cba('0x71'));return _0x29429b(new Error(_0x7cba('0x71')));}var _0x5e8a7a=_0x4832de[_0x7cba('0x74')](function(_0x21dac5){return _0x21dac5===_0x7cba('0x75');});if(!_0x5e8a7a){return _0x29429b(new Error(_0x7cba('0x76')));}var _0x339146=fs[_0x7cba('0x77')](path[_0x7cba('0x51')](_0x10a90a,_0x25a03b[0x0],_0x7cba('0x75')));var _0x3f2c78=JSON[_0x7cba('0x78')](_0x339146);if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x30')]){return _0x29429b(new Error(_0x7cba('0x7a')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x42')]){return _0x29429b(new Error(_0x7cba('0x7b')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7c')]){return _0x29429b(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')]){return _0x29429b(new Error(_0x7cba('0x7e')));}if(_0x3f2c78[_0x7cba('0x42')]===_0x7cba('0x7f')){if(_0x7cba('0x79')==typeof _0x3f2c78['parameters'][_0x7cba('0x80')]){return _0x29429b(new Error(_0x7cba('0x81')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x82')]&&'undefined'==typeof _0x3f2c78['parameters'][_0x7cba('0x80')][_0x7cba('0x83')]){return _0x29429b(new Error(_0x7cba('0x84')));}}else if(_0x3f2c78[_0x7cba('0x42')]===_0x7cba('0x85')){if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x86')]){return _0x29429b(new Error(_0x7cba('0x87')));}if(_0x7cba('0x79')==typeof _0x3f2c78[_0x7cba('0x7d')]['scriptPath']){return _0x29429b(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x29429b(new Error(_0x7cba('0x88')));}var _0x382499=_0x3f2c78[_0x7cba('0x30')];var _0x434ea4=_0x3f2c78[_0x7cba('0x89')];var _0x10017c=_0x3f2c78[_0x7cba('0x42')];var _0x48ee56=_0x3f2c78[_0x7cba('0x8a')]?_0x3f2c78[_0x7cba('0x8a')]:_0x7cba('0x8b');var _0x202115=_0x3f2c78[_0x7cba('0x8c')]?_0x3f2c78[_0x7cba('0x8c')]:_0x7cba('0x8d');var _0xa315df='';var _0x5bf38d='';var _0x9ad875='';var _0xfc8c40='';var _0x838e04=_0x3f2c78[_0x7cba('0x7c')];if(_0x10017c===_0x7cba('0x7f')){if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x82')]){var _0x140cf7=_0x3f2c78[_0x7cba('0x7d')]['views'][_0x7cba('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x140cf7)){_0xa315df=path[_0x7cba('0x51')]('plugins',_0x3fe6fb,_0x25a03b[0x0],_0x140cf7);}else{_0xa315df=_0x140cf7;}}else{logger[_0x7cba('0x65')](_0x7cba('0x8f'));}if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')]['agent']){var _0x3e0edf=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x3e0edf)){_0x5bf38d=path[_0x7cba('0x51')]('plugins',_0x3fe6fb,_0x25a03b[0x0],_0x3e0edf);}else{_0x5bf38d=_0x3e0edf;}}else{logger[_0x7cba('0x65')](_0x7cba('0x90'));}}else if(_0x10017c==='script'){_0x9ad875=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x86')];_0xfc8c40=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x91')];if(_0x7cba('0x79')!=typeof _0x3f2c78[_0x7cba('0x7d')]['views']){if(_0x7cba('0x79')!=typeof _0x3f2c78['parameters']['views'][_0x7cba('0x82')]){var _0x140cf7=_0x3f2c78['parameters'][_0x7cba('0x80')][_0x7cba('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7cba('0x8e')](_0x140cf7)){_0xa315df=path['join'](_0x7cba('0x92'),_0x3fe6fb,_0x25a03b[0x0],_0x140cf7);}else{_0xa315df=_0x140cf7;}}if(_0x7cba('0x79')!=typeof _0x3f2c78['parameters'][_0x7cba('0x80')]['agent']){var _0x3e0edf=_0x3f2c78[_0x7cba('0x7d')][_0x7cba('0x80')][_0x7cba('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3e0edf)){_0x5bf38d=path[_0x7cba('0x51')](_0x7cba('0x92'),_0x3fe6fb,_0x25a03b[0x0],_0x3e0edf);}else{_0x5bf38d=_0x3e0edf;}}}}var _0x4354d8={'name':_0x382499,'description':_0x434ea4,'path':path[_0x7cba('0x51')](_0x3fe6fb,_0x25a03b[0x0]),'type':_0x10017c,'sidebar':_0x48ee56,'icon':_0x202115,'adminUrl':_0xa315df,'agentUrl':_0x5bf38d,'scriptName':_0x9ad875,'scriptPath':_0xfc8c40,'version':_0x838e04};removeReferences(_0x4754f1,null);return db[_0x7cba('0x32')][_0x7cba('0x93')](_0x4354d8)[_0x7cba('0x2a')](function(_0x10a9ad){var _0x49355f={'role':_0x4c7726[_0x7cba('0x94')]['role'],'userProfileId':_0x4c7726['body']['userProfileId']};if(!_0x49355f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49355f[_0x7cba('0x95')]==='user'){var _0xe7acf9=_0x10a9ad[_0x7cba('0x96')]({'plain':!![]});return db['UserProfileSection'][_0x7cba('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x49355f['userProfileId']},'raw':!![]})[_0x7cba('0x2a')](function(_0x385ee3){if(_0x385ee3&&_0x385ee3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe7acf9[_0x7cba('0x30')],'resourceId':_0xe7acf9['id'],'type':_0x385ee3[_0x7cba('0x30')],'sectionId':_0x385ee3['id']},{})[_0x7cba('0x2a')](function(){return _0x10a9ad;});}else{return _0x10a9ad;}})[_0x7cba('0x4a')](function(_0x3fa333){logger[_0x7cba('0x2e')](_0x7cba('0x97'),_0x3fa333);throw _0x3fa333;});}return _0x10a9ad;})[_0x7cba('0x2a')](respondWithResult(_0x3d21a2,null))[_0x7cba('0x4a')](handleError(_0x3d21a2,null));}});}catch(_0x2a3ddb){_0x3d21a2[_0x7cba('0x21')](0x1f4)['send'](_0x2a3ddb);}};function removeReferences(_0x186ae0,_0x4df5db){try{if(_0x186ae0){fs[_0x7cba('0x64')](_0x186ae0);logger[_0x7cba('0x65')](_0x7cba('0x98'));}if(_0x4df5db){rimraf(_0x4df5db,function(){});logger[_0x7cba('0x65')](_0x7cba('0x99'));}}catch(_0x13d16c){logger[_0x7cba('0x2e')](_0x13d16c);}}exports[_0x7cba('0x29')]=function(_0x544d30,_0x3bbea4,_0x49559d){return db[_0x7cba('0x32')][_0x7cba('0x4f')]({'where':{'id':_0x544d30[_0x7cba('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3bbea4,null))[_0x7cba('0x2a')](saveUpdates(_0x544d30[_0x7cba('0x94')],null))[_0x7cba('0x2a')](respondWithResult(_0x3bbea4,null))['catch'](handleError(_0x3bbea4,null));};exports['delete']=function(_0x3e1cdd,_0x198683,_0x4c15ab){return db[_0x7cba('0x32')]['find']({'where':{'id':_0x3e1cdd[_0x7cba('0x4c')]['id']}})['then'](function(_0x15fbbf){if(_0x15fbbf){return _0x15fbbf[_0x7cba('0x2d')]();}})[_0x7cba('0x2a')](function(_0x1a8fdc){rimraf(path['join'](config[_0x7cba('0x52')],_0x7cba('0x53'),path[_0x7cba('0x9a')](_0x1a8fdc['path'])),function(){});return _0x1a8fdc;})['then'](handleEntityNotFound(_0x198683,null))['then'](respondWithStatusCode(_0x198683,null))[_0x7cba('0x4a')](handleError(_0x198683,null));};exports[_0x7cba('0x9b')]=function(_0x36f5d1,_0x412f24,_0x37ab13){return BPromise[_0x7cba('0x9c')]()[_0x7cba('0x2a')](function(){if(!_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')]){throw new Error(_0x7cba('0x9d'));}if(!_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')]){throw new Error(_0x7cba('0x9f'));}var _0x34ff3c=_0x36f5d1[_0x7cba('0x34')]['hostname']?_0x36f5d1[_0x7cba('0x34')][_0x7cba('0xa0')]+':'+_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')]:'http://localhost:'+_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x9e')];var _0x5b1402=_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x23')]?_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x23')]:!![];var _0x2a91b5=_0x36f5d1[_0x7cba('0x34')][_0x7cba('0xa1')]?_0x36f5d1[_0x7cba('0x34')]['encoding']:null;var _0x10000c={'method':_0x36f5d1[_0x7cba('0xa2')],'uri':util[_0x7cba('0x54')]('%s%s',_0x34ff3c,_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')]),'json':_0x5b1402,'resolveWithFullResponse':!![],'encoding':_0x2a91b5,'qs':_0x36f5d1[_0x7cba('0x34')]};if(_0x36f5d1[_0x7cba('0xa3')]){_0x10000c[_0x7cba('0xa3')]=_0x36f5d1['headers'];if(_0x10000c['headers'][_0x7cba('0xa4')]){delete _0x10000c[_0x7cba('0xa3')]['content-length'];}}if(_0x10000c[_0x7cba('0xa3')]['content-type']){delete _0x10000c[_0x7cba('0xa3')][_0x7cba('0xa5')];}return rp(_0x10000c);})[_0x7cba('0x2a')](function(_0x14046d){if(_0x14046d){_0x412f24[_0x7cba('0xa6')](_0x14046d[_0x7cba('0xa3')]);logger[_0x7cba('0x65')](_0x14046d['body']);if(_[_0x7cba('0xa7')](_0x36f5d1[_0x7cba('0x34')][_0x7cba('0x8')],_0x7cba('0x50'))&&_0x14046d[_0x7cba('0xa8')]==0x1f4){return _0x412f24[_0x7cba('0x20')](_0x14046d[_0x7cba('0xa8')]);}else{return _0x412f24['status'](_0x14046d['statusCode'])[_0x7cba('0xa9')](_0x14046d[_0x7cba('0x94')]);}}else{return _0x412f24[_0x7cba('0x20')](0xc8);}})['catch'](handleError(_0x412f24,null));};exports[_0x7cba('0xaa')]=function(_0x4b4875,_0x5cf3e4,_0x44860b){return BPromise[_0x7cba('0x9c')]()[_0x7cba('0x2a')](function(){if(!_0x4b4875[_0x7cba('0x34')]['path']){throw new Error(_0x7cba('0x9d'));}if(!_0x4b4875['query'][_0x7cba('0x9e')]){throw new Error(_0x7cba('0x9f'));}var _0x2d2445=_0x4b4875[_0x7cba('0x34')]['hostname']?_0x4b4875[_0x7cba('0x34')]['hostname']+':'+_0x4b4875[_0x7cba('0x34')][_0x7cba('0x9e')]:_0x7cba('0xab')+_0x4b4875['query'][_0x7cba('0x9e')];var _0x4fc532=_0x4b4875[_0x7cba('0x34')][_0x7cba('0x23')]?_0x4b4875[_0x7cba('0x34')][_0x7cba('0x23')]:!![];var _0x21ed26=_0x4b4875['query'][_0x7cba('0xa1')]?_0x4b4875['query'][_0x7cba('0xa1')]:null;var _0x46948e={'method':_0x4b4875['method'],'uri':util[_0x7cba('0x54')](_0x7cba('0xac'),_0x2d2445,_0x4b4875[_0x7cba('0x34')][_0x7cba('0x8')]),'json':_0x4fc532,'resolveWithFullResponse':!![],'encoding':_0x21ed26,'body':_0x4b4875[_0x7cba('0x94')]};if(_0x4b4875[_0x7cba('0xa3')]){_0x46948e['headers']=_0x4b4875[_0x7cba('0xa3')];if(_0x46948e['headers']['content-length']){delete _0x46948e[_0x7cba('0xa3')][_0x7cba('0xa4')];}}if(_0x46948e['headers'][_0x7cba('0xa5')]){delete _0x46948e[_0x7cba('0xa3')][_0x7cba('0xa5')];}return rp(_0x46948e);})[_0x7cba('0x2a')](function(_0xdca2c9){if(_0xdca2c9){_0x5cf3e4['set'](_0xdca2c9[_0x7cba('0xa3')]);logger['info'](_0xdca2c9['body']);return _0x5cf3e4[_0x7cba('0x21')](_0xdca2c9[_0x7cba('0xa8')])[_0x7cba('0xa9')](_0xdca2c9[_0x7cba('0x94')]);}else{return _0x5cf3e4['sendStatus'](0xc8);}})[_0x7cba('0x4a')](handleError(_0x5cf3e4,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a4df945..91503b5 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 _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x3959cf,_0x2bd925){var _0x41534f=function(_0x5b2e7b){while(--_0x5b2e7b){_0x3959cf['push'](_0x3959cf['shift']());}};_0x41534f(++_0x2bd925);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a30b3,_0x3ddbdb){_0x4a30b3=_0x4a30b3-0x0;var _0x161079=_0xb10b[_0x4a30b3];return _0x161079;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x3ab351,_0x5e169a){var _0x4d0a1f=function(_0xa3466c){while(--_0xa3466c){_0x3ab351['push'](_0x3ab351['shift']());}};_0x4d0a1f(++_0x5e169a);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c217f,_0x82a1ae){_0x4c217f=_0x4c217f-0x0;var _0x4033b2=_0xb10b[_0x4c217f];return _0x4033b2;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c5e1fa2..4a4a1ce 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 _0x5dbc=['path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x5dbc,0x166));var _0xc5db=function(_0x3ae189,_0x2c2ef6){_0x3ae189=_0x3ae189-0x0;var _0x38407d=_0x5dbc[_0x3ae189];return _0x38407d;};'use strict';var _=require(_0xc5db('0x0'));var util=require('util');var logger=require(_0xc5db('0x1'))(_0xc5db('0x2'));var moment=require(_0xc5db('0x3'));var BPromise=require(_0xc5db('0x4'));var rp=require(_0xc5db('0x5'));var fs=require('fs');var path=require(_0xc5db('0x6'));var rimraf=require(_0xc5db('0x7'));var config=require(_0xc5db('0x8'));var attributes=require('./plugin.attributes');module[_0xc5db('0x9')]=function(_0x3b4256,_0x49e0f3){return _0x3b4256[_0xc5db('0xa')](_0xc5db('0xb'),attributes,{'tableName':_0xc5db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ac3=['lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','Plugin','plugins'];(function(_0x11f313,_0x3c91c8){var _0x5d3a3a=function(_0xb0c9fd){while(--_0xb0c9fd){_0x11f313['push'](_0x11f313['shift']());}};_0x5d3a3a(++_0x3c91c8);}(_0x6ac3,0x14a));var _0x36ac=function(_0x8c6df2,_0x20fea7){_0x8c6df2=_0x8c6df2-0x0;var _0x38a7bf=_0x6ac3[_0x8c6df2];return _0x38a7bf;};'use strict';var _=require(_0x36ac('0x0'));var util=require(_0x36ac('0x1'));var logger=require('../../config/logger')(_0x36ac('0x2'));var moment=require('moment');var BPromise=require(_0x36ac('0x3'));var rp=require(_0x36ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36ac('0x5'));var attributes=require('./plugin.attributes');module[_0x36ac('0x6')]=function(_0xf94dce,_0xefd14){return _0xf94dce[_0x36ac('0x7')](_0x36ac('0x8'),attributes,{'tableName':_0x36ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e6ea962..7d79dbd 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 _0x1819=['./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x2b24cf,_0x55c607){var _0x49bc49=function(_0x2dc386){while(--_0x2dc386){_0x2b24cf['push'](_0x2b24cf['shift']());}};_0x49bc49(++_0x55c607);}(_0x1819,0x101));var _0x9181=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x1819[_0x4b6778];return _0x22dbb9;};'use strict';var _=require(_0x9181('0x0'));var util=require(_0x9181('0x1'));var moment=require(_0x9181('0x2'));var BPromise=require('bluebird');var rs=require(_0x9181('0x3'));var fs=require('fs');var Redis=require(_0x9181('0x4'));var db=require(_0x9181('0x5'))['db'];var utils=require(_0x9181('0x6'));var logger=require('../../config/logger')(_0x9181('0x7'));var config=require(_0x9181('0x8'));var jayson=require(_0x9181('0x9'));var client=jayson[_0x9181('0xa')][_0x9181('0xb')]({'port':0x232a});config['redis']=_[_0x9181('0xc')](config[_0x9181('0xd')],{'host':_0x9181('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9181('0xf'))[_0x9181('0x10')](socket);function respondWithRpcPromise(_0x4ff4aa,_0x20544a,_0x3a99c8){return new BPromise(function(_0x2b9810,_0x45f714){return client[_0x9181('0x11')](_0x4ff4aa,_0x3a99c8)[_0x9181('0x12')](function(_0x269552){logger[_0x9181('0x13')]('Plugin,\x20%s,\x20%s',_0x20544a,_0x9181('0x14'));logger[_0x9181('0x15')](_0x9181('0x16'),_0x20544a,_0x9181('0x14'),JSON[_0x9181('0x17')](_0x269552));if(_0x269552['error']){if(_0x269552[_0x9181('0x18')]['code']===0x1f4){logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x269552['error'][_0x9181('0x1a')]);return _0x45f714(_0x269552[_0x9181('0x18')][_0x9181('0x1a')]);}logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x269552[_0x9181('0x18')][_0x9181('0x1a')]);return _0x2b9810(_0x269552[_0x9181('0x18')]['message']);}else{logger['info'](_0x9181('0x19'),_0x20544a,'request\x20sent');_0x2b9810(_0x269552[_0x9181('0x1b')][_0x9181('0x1a')]);}})[_0x9181('0x1c')](function(_0x3044e3){logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x3044e3);_0x45f714(_0x3044e3);});});}exports[_0x9181('0x1d')]=function(_0x4d377b){var _0x3a3ba8=this;return new Promise(function(_0x30ff3d,_0x138498){return db['Plugin'][_0x9181('0x1e')](_0x4d377b[_0x9181('0x1f')],{'raw':_0x4d377b[_0x9181('0x20')]?_0x4d377b[_0x9181('0x20')][_0x9181('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x453f32){logger[_0x9181('0x13')](_0x9181('0x1d'),_0x4d377b);logger['debug']('CreatePlugin',_0x4d377b,JSON[_0x9181('0x17')](_0x453f32));_0x30ff3d(_0x453f32);})[_0x9181('0x1c')](function(_0x422fb9){logger['error'](_0x9181('0x1d'),_0x422fb9[_0x9181('0x1a')],_0x4d377b);_0x138498(_0x3a3ba8[_0x9181('0x18')](0x1f4,_0x422fb9['message']));});});}; \ No newline at end of file +var _0x914b=['./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreatePlugin','Plugin','create','options','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x50a064,_0x1dc725){var _0xd8d4d3=function(_0x359670){while(--_0x359670){_0x50a064['push'](_0x50a064['shift']());}};_0xd8d4d3(++_0x1dc725);}(_0x914b,0x15b));var _0xb914=function(_0x424329,_0x1a3e61){_0x424329=_0x424329-0x0;var _0x324625=_0x914b[_0x424329];return _0x324625;};'use strict';var _=require('lodash');var util=require(_0xb914('0x0'));var moment=require('moment');var BPromise=require(_0xb914('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb914('0x2'))['db'];var utils=require(_0xb914('0x3'));var logger=require(_0xb914('0x4'))(_0xb914('0x5'));var config=require('../../config/environment');var jayson=require(_0xb914('0x6'));var client=jayson[_0xb914('0x7')][_0xb914('0x8')]({'port':0x232a});config[_0xb914('0x9')]=_[_0xb914('0xa')](config[_0xb914('0x9')],{'host':_0xb914('0xb'),'port':0x18eb});var socket=require(_0xb914('0xc'))(new Redis(config[_0xb914('0x9')]));require(_0xb914('0xd'))[_0xb914('0xe')](socket);function respondWithRpcPromise(_0x28b482,_0x1caa18,_0x153b99){return new BPromise(function(_0x5a73ec,_0x49ff3d){return client['request'](_0x28b482,_0x153b99)[_0xb914('0xf')](function(_0xacc33d){logger[_0xb914('0x10')](_0xb914('0x11'),_0x1caa18,'request\x20sent');logger[_0xb914('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1caa18,_0xb914('0x13'),JSON[_0xb914('0x14')](_0xacc33d));if(_0xacc33d[_0xb914('0x15')]){if(_0xacc33d['error'][_0xb914('0x16')]===0x1f4){logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0xacc33d[_0xb914('0x15')]['message']);return _0x49ff3d(_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);}logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);return _0x5a73ec(_0xacc33d[_0xb914('0x15')][_0xb914('0x17')]);}else{logger[_0xb914('0x10')](_0xb914('0x11'),_0x1caa18,_0xb914('0x13'));_0x5a73ec(_0xacc33d[_0xb914('0x18')]['message']);}})['catch'](function(_0x17f326){logger[_0xb914('0x15')](_0xb914('0x11'),_0x1caa18,_0x17f326);_0x49ff3d(_0x17f326);});});}exports[_0xb914('0x19')]=function(_0x4a3c65){var _0x5a92fe=this;return new Promise(function(_0xb5929c,_0x1ee98d){return db[_0xb914('0x1a')][_0xb914('0x1b')](_0x4a3c65['body'],{'raw':_0x4a3c65['options']?_0x4a3c65[_0xb914('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb914('0xf')](function(_0x4f6b78){logger['info'](_0xb914('0x19'),_0x4a3c65);logger[_0xb914('0x12')](_0xb914('0x19'),_0x4a3c65,JSON[_0xb914('0x14')](_0x4f6b78));_0xb5929c(_0x4f6b78);})[_0xb914('0x1d')](function(_0x5ac0b1){logger[_0xb914('0x15')]('CreatePlugin',_0x5ac0b1['message'],_0x4a3c65);_0x1ee98d(_0x5a92fe['error'](0x1f4,_0x5ac0b1[_0xb914('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 052a83d..8ae777d 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 _0xa0b3=['plugin:','update','emit','removeListener','register','length'];(function(_0x5d26ac,_0x18c21b){var _0x5464b3=function(_0x2c4563){while(--_0x2c4563){_0x5d26ac['push'](_0x5d26ac['shift']());}};_0x5464b3(++_0x18c21b);}(_0xa0b3,0x169));var _0x3a0b=function(_0x1c9996,_0x2ef167){_0x1c9996=_0x1c9996-0x0;var _0x3a10a2=_0xa0b3[_0x1c9996];return _0x3a10a2;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0x3a0b('0x0')];function createListener(_0x35cf34,_0x9f79af){return function(_0x142f10){_0x9f79af[_0x3a0b('0x1')](_0x35cf34,_0x142f10);};}function removeListener(_0x4b2c48,_0x2000e4){return function(){PluginEvents[_0x3a0b('0x2')](_0x4b2c48,_0x2000e4);};}exports[_0x3a0b('0x3')]=function(_0x36695a){for(var _0x455ba6=0x0,_0x5850f5=events[_0x3a0b('0x4')];_0x455ba6<_0x5850f5;_0x455ba6++){var _0x111a59=events[_0x455ba6];var _0x1e2115=createListener(_0x3a0b('0x5')+_0x111a59,_0x36695a);PluginEvents['on'](_0x111a59,_0x1e2115);}}; \ No newline at end of file +var _0x140a=['plugin:','./plugin.events','save','remove','emit','removeListener','register','length'];(function(_0x59b4c3,_0x3bcd23){var _0x1d18d4=function(_0x48b68e){while(--_0x48b68e){_0x59b4c3['push'](_0x59b4c3['shift']());}};_0x1d18d4(++_0x3bcd23);}(_0x140a,0x1a9));var _0xa140=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x140a[_0x397e5f];return _0x5302b8;};'use strict';var PluginEvents=require(_0xa140('0x0'));var events=[_0xa140('0x1'),_0xa140('0x2'),'update'];function createListener(_0x407332,_0x45b2fa){return function(_0x4362a2){_0x45b2fa[_0xa140('0x3')](_0x407332,_0x4362a2);};}function removeListener(_0xc5f3f1,_0xc9cccf){return function(){PluginEvents[_0xa140('0x4')](_0xc5f3f1,_0xc9cccf);};}exports[_0xa140('0x5')]=function(_0x5b4908){for(var _0xf3ac64=0x0,_0x2a922c=events[_0xa140('0x6')];_0xf3ac64<_0x2a922c;_0xf3ac64++){var _0x4783a4=events[_0xf3ac64];var _0x53d065=createListener(_0xa140('0x7')+_0x4783a4,_0x5b4908);PluginEvents['on'](_0x4783a4,_0x53d065);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2eb62b0..1d63171 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(_0x491a95,_0x2c253c){var _0x1da527=function(_0x21b8e0){while(--_0x21b8e0){_0x491a95['push'](_0x491a95['shift']());}};_0x1da527(++_0x2c253c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x56bd70,_0x4f8b02){var _0x56486e=function(_0x2482a7){while(--_0x2482a7){_0x56bd70['push'](_0x56bd70['shift']());}};_0x56486e(++_0x4f8b02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 6489daf..ff9e520 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 _0x9a5e=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','params','create','body','script','join','../../files/plugins','cwd','dirname','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9a5e,0xee));var _0xe9a5=function(_0x3a941c,_0x5ced82){_0x3a941c=_0x3a941c-0x0;var _0x570582=_0x9a5e[_0x3a941c];return _0x570582;};'use strict';var _=require(_0xe9a5('0x0'));var pm2=require(_0xe9a5('0x1'));var logger=require(_0xe9a5('0x2'))(_0xe9a5('0x3'));var path=require(_0xe9a5('0x4'));var exec=require(_0xe9a5('0x5'))[_0xe9a5('0x6')];var BPromise=require(_0xe9a5('0x7'));function handleEntityNotFound(_0x3ba487,_0x58754b){return function(_0x4030b9){if(!_0x4030b9){_0x3ba487[_0xe9a5('0x8')](0x194);;}return _0x4030b9;};}function respondWithResult(_0x462b43,_0x4d1c37){_0x4d1c37=_0x4d1c37||0xc8;return function(_0x56f4f6){if(_0x56f4f6){return _0x462b43[_0xe9a5('0x9')](_0x4d1c37)['json'](_0x56f4f6);}return null;};}function handleError(_0xacd9ec,_0x5db440){_0x5db440=_0x5db440||0x1f4;return function(_0xa0039a){logger[_0xe9a5('0xa')](_0xa0039a[_0xe9a5('0xb')]);if(_0xa0039a[_0xe9a5('0xc')]){delete _0xa0039a['name'];}_0xacd9ec[_0xe9a5('0x9')](_0x5db440)[_0xe9a5('0xd')](_0xa0039a);};}function execChildProcess(){return new BPromise(function(_0x2e64ef,_0x4aa233){exec(_0xe9a5('0xe'),function(_0x47a0bc,_0x3fffcc,_0x1e7d7c){logger['info'](_0x3fffcc);logger[_0xe9a5('0xf')](_0x1e7d7c);if(_0x47a0bc){logger[_0xe9a5('0xa')](_0x47a0bc);return _0x4aa233(_0x47a0bc);}return _0x2e64ef(_0x3fffcc);});});}exports[_0xe9a5('0x10')]=function(_0x147c19,_0x54f676){return pm2[_0xe9a5('0x11')]()['then'](function(_0x242aea){if(_0x242aea){var _0x38dc39=_[_0xe9a5('0x12')](_0x242aea,function(_0x30d6f7){return _0x30d6f7[_0xe9a5('0xc')]===_0xe9a5('0x13')||_0x30d6f7['name']===_0xe9a5('0x14');});return{'rows':_0x38dc39,'count':_0x38dc39[_0xe9a5('0x15')]};}return null;})[_0xe9a5('0x16')](respondWithResult(_0x54f676,null))[_0xe9a5('0x17')](handleError(_0x54f676,null));};exports['show']=function(_0xaf8e1c,_0x584e02){return pm2['describe'](_0xaf8e1c[_0xe9a5('0x18')]['id'])[_0xe9a5('0x16')](respondWithResult(_0x584e02,null))[_0xe9a5('0x16')](handleEntityNotFound(_0x584e02,null))[_0xe9a5('0x17')](handleError(_0x584e02,null));};exports[_0xe9a5('0x19')]=function(_0x163199,_0x322f17){if(_0x163199['body'][_0xe9a5('0xc')]&&_0x163199[_0xe9a5('0x1a')][_0xe9a5('0x1b')]){var _0x158d40=path[_0xe9a5('0x1c')](__dirname,_0xe9a5('0x1d'),_0x163199['body']['script']);var _0x50c44e=process[_0xe9a5('0x1e')]();process['chdir'](path[_0xe9a5('0x1f')](_0x158d40));return execChildProcess()['then'](function(_0x50c18b){process['chdir'](_0x50c44e);return pm2['start']({'name':_0x163199[_0xe9a5('0x1a')]['name'],'script':_0x158d40});})[_0xe9a5('0x16')](function(_0x4d7ce9){pm2['dump']();return _0x4d7ce9[0x0];})['then'](respondWithResult(_0x322f17,0xc9))[_0xe9a5('0x17')](handleError(_0x322f17,null));}else{return _0x322f17['status'](0x1f4)[_0xe9a5('0xd')]({'message':_0xe9a5('0x20')});}};exports[_0xe9a5('0x21')]=function(_0x2a4bf2,_0x2eee61){if(_0x2a4bf2[_0xe9a5('0x1a')]['id']){delete _0x2a4bf2['body']['id'];}var _0x49da1b={'online':_0xe9a5('0x22'),'stopped':_0xe9a5('0x23')};if(_0x49da1b[_0xe9a5('0x24')](_0x2a4bf2[_0xe9a5('0x1a')][_0xe9a5('0x9')])){return pm2[_0x49da1b[_0x2a4bf2['body'][_0xe9a5('0x9')]]](_0x2a4bf2[_0xe9a5('0x18')]['id'])['then'](respondWithResult(_0x2eee61,0xc8))[_0xe9a5('0x17')](handleError(_0x2eee61,null));}else{return _0x2eee61[_0xe9a5('0x9')](0x1f4)['send']({'message':_0xe9a5('0x25')});}};exports['destroy']=function(_0x21d28a,_0x1e22f5){if(_0x21d28a['body']['id']){delete _0x21d28a[_0xe9a5('0x1a')]['id'];}if(_0x21d28a[_0xe9a5('0x18')]['id']){return pm2[_0xe9a5('0x26')](_0x21d28a['params']['id'])[_0xe9a5('0x16')](function(_0x1cdbaa){pm2['dump']();return _0x1cdbaa[0x0];})[_0xe9a5('0x16')](respondWithResult(_0x1e22f5,null))['catch'](handleError(_0x1e22f5,null));}else{return _0x1e22f5[_0xe9a5('0x9')](0x1f4)['send']({'message':_0xe9a5('0x27')});}}; \ No newline at end of file +var _0x1e82=['length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','bluebird','status','stack','name','info','error','index','list','reject','express','motion2'];(function(_0x255c8f,_0x55c6b8){var _0x3fad91=function(_0x463d1c){while(--_0x463d1c){_0x255c8f['push'](_0x255c8f['shift']());}};_0x3fad91(++_0x55c6b8);}(_0x1e82,0x8b));var _0x21e8=function(_0x1d991b,_0x364ad6){_0x1d991b=_0x1d991b-0x0;var _0x28a722=_0x1e82[_0x1d991b];return _0x28a722;};'use strict';var _=require(_0x21e8('0x0'));var pm2=require(_0x21e8('0x1'));var logger=require(_0x21e8('0x2'))(_0x21e8('0x3'));var path=require(_0x21e8('0x4'));var exec=require(_0x21e8('0x5'))['exec'];var BPromise=require(_0x21e8('0x6'));function handleEntityNotFound(_0x436415,_0x59fa8f){return function(_0x468459){if(!_0x468459){_0x436415['sendStatus'](0x194);;}return _0x468459;};}function respondWithResult(_0x35a33a,_0x11e388){_0x11e388=_0x11e388||0xc8;return function(_0x38c3d0){if(_0x38c3d0){return _0x35a33a[_0x21e8('0x7')](_0x11e388)['json'](_0x38c3d0);}return null;};}function handleError(_0x45e5c1,_0x3754c9){_0x3754c9=_0x3754c9||0x1f4;return function(_0x43a873){logger['error'](_0x43a873[_0x21e8('0x8')]);if(_0x43a873[_0x21e8('0x9')]){delete _0x43a873[_0x21e8('0x9')];}_0x45e5c1[_0x21e8('0x7')](_0x3754c9)['send'](_0x43a873);};}function execChildProcess(){return new BPromise(function(_0x4d561a,_0x265ea1){exec('npm\x20install',function(_0x131349,_0xc55924,_0x5eb5b7){logger[_0x21e8('0xa')](_0xc55924);logger['info'](_0x5eb5b7);if(_0x131349){logger[_0x21e8('0xb')](_0x131349);return _0x265ea1(_0x131349);}return _0x4d561a(_0xc55924);});});}exports[_0x21e8('0xc')]=function(_0x16a877,_0x4eb523){return pm2[_0x21e8('0xd')]()['then'](function(_0x271ee6){if(_0x271ee6){var _0x3c6bf2=_[_0x21e8('0xe')](_0x271ee6,function(_0x4e3e29){return _0x4e3e29['name']===_0x21e8('0xf')||_0x4e3e29[_0x21e8('0x9')]===_0x21e8('0x10');});return{'rows':_0x3c6bf2,'count':_0x3c6bf2[_0x21e8('0x11')]};}return null;})[_0x21e8('0x12')](respondWithResult(_0x4eb523,null))[_0x21e8('0x13')](handleError(_0x4eb523,null));};exports[_0x21e8('0x14')]=function(_0x2f66f1,_0x1a8a5a){return pm2['describe'](_0x2f66f1[_0x21e8('0x15')]['id'])['then'](respondWithResult(_0x1a8a5a,null))['then'](handleEntityNotFound(_0x1a8a5a,null))[_0x21e8('0x13')](handleError(_0x1a8a5a,null));};exports[_0x21e8('0x16')]=function(_0x227925,_0x2030bb){if(_0x227925['body'][_0x21e8('0x9')]&&_0x227925[_0x21e8('0x17')][_0x21e8('0x18')]){var _0x2e5d89=path[_0x21e8('0x19')](__dirname,_0x21e8('0x1a'),_0x227925[_0x21e8('0x17')][_0x21e8('0x18')]);var _0x4bcb4c=process[_0x21e8('0x1b')]();process[_0x21e8('0x1c')](path['dirname'](_0x2e5d89));return execChildProcess()[_0x21e8('0x12')](function(_0x402f0f){process[_0x21e8('0x1c')](_0x4bcb4c);return pm2[_0x21e8('0x1d')]({'name':_0x227925[_0x21e8('0x17')][_0x21e8('0x9')],'script':_0x2e5d89});})[_0x21e8('0x12')](function(_0x3ed4c3){pm2['dump']();return _0x3ed4c3[0x0];})[_0x21e8('0x12')](respondWithResult(_0x2030bb,0xc9))['catch'](handleError(_0x2030bb,null));}else{return _0x2030bb[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x1f')});}};exports['update']=function(_0x1bdd15,_0x526e32){if(_0x1bdd15[_0x21e8('0x17')]['id']){delete _0x1bdd15[_0x21e8('0x17')]['id'];}var _0x6de0b2={'online':'restart','stopped':_0x21e8('0x20')};if(_0x6de0b2[_0x21e8('0x21')](_0x1bdd15[_0x21e8('0x17')]['status'])){return pm2[_0x6de0b2[_0x1bdd15[_0x21e8('0x17')][_0x21e8('0x7')]]](_0x1bdd15[_0x21e8('0x15')]['id'])[_0x21e8('0x12')](respondWithResult(_0x526e32,0xc8))[_0x21e8('0x13')](handleError(_0x526e32,null));}else{return _0x526e32[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x22')});}};exports[_0x21e8('0x23')]=function(_0xd4f119,_0x4711a4){if(_0xd4f119[_0x21e8('0x17')]['id']){delete _0xd4f119['body']['id'];}if(_0xd4f119[_0x21e8('0x15')]['id']){return pm2[_0x21e8('0x24')](_0xd4f119['params']['id'])['then'](function(_0x51e253){pm2[_0x21e8('0x25')]();return _0x51e253[0x0];})['then'](respondWithResult(_0x4711a4,null))[_0x21e8('0x13')](handleError(_0x4711a4,null));}else{return _0x4711a4[_0x21e8('0x7')](0x1f4)[_0x21e8('0x1e')]({'message':_0x21e8('0x26')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8526b69..704274c 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 _0x8cad=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x474a22,_0x7f6cf2){var _0x3638b6=function(_0x485325){while(--_0x485325){_0x474a22['push'](_0x474a22['shift']());}};_0x3638b6(++_0x7f6cf2);}(_0x8cad,0xfe));var _0xd8ca=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x8cad[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var path=require(_0xd8ca('0x2'));var timeout=require(_0xd8ca('0x3'));var express=require(_0xd8ca('0x4'));var router=express[_0xd8ca('0x5')]();var auth=require(_0xd8ca('0x6'));var interaction=require(_0xd8ca('0x7'));var config=require(_0xd8ca('0x8'));module[_0xd8ca('0x9')]=router; \ No newline at end of file +var _0xe08b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path'];(function(_0x4c95cb,_0x1997fd){var _0x1aa0dc=function(_0x2b4961){while(--_0x2b4961){_0x4c95cb['push'](_0x4c95cb['shift']());}};_0x1aa0dc(++_0x1997fd);}(_0xe08b,0x10e));var _0xbe08=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xe08b[_0x4c06a3];return _0x7ff53c;};'use strict';var multer=require(_0xbe08('0x0'));var util=require('util');var path=require(_0xbe08('0x1'));var timeout=require(_0xbe08('0x2'));var express=require('express');var router=express[_0xbe08('0x3')]();var auth=require(_0xbe08('0x4'));var interaction=require(_0xbe08('0x5'));var config=require(_0xbe08('0x6'));module[_0xbe08('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b5d097e..21c0b7f 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 _0xe5ae=['DATE','INTEGER','STRING'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0xe5ae,0xf4));var _0xee5a=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0xe5ae[_0x3ff2f9];return _0x3b0913;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xee5a('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xee5a('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xee5a('0x1')]},'starttime':{'type':Sequelize[_0xee5a('0x2')]},'responsetime':{'type':Sequelize[_0xee5a('0x2')]},'ringtime':{'type':Sequelize[_0xee5a('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xee5a('0x1')]},'campaigntype':{'type':Sequelize[_0xee5a('0x1')]},'membername':{'type':Sequelize[_0xee5a('0x1')]}}; \ No newline at end of file +var _0x9cbf=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0xe932aa,_0x128838){var _0x4b9acf=function(_0x5676c){while(--_0x5676c){_0xe932aa['push'](_0xe932aa['shift']());}};_0x4b9acf(++_0x128838);}(_0x9cbf,0xfd));var _0xf9cb=function(_0x1bb42c,_0x2d327f){_0x1bb42c=_0x1bb42c-0x0;var _0x415829=_0x9cbf[_0x1bb42c];return _0x415829;};'use strict';var Sequelize=require(_0xf9cb('0x0'));module[_0xf9cb('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf9cb('0x2')]},'scheduledat':{'type':Sequelize[_0xf9cb('0x3')]},'uniqueid':{'type':Sequelize[_0xf9cb('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xf9cb('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf9cb('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf9cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9832b6c..7c5fa71 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 _0x20cc=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x386812,_0x27c823){var _0x4704d2=function(_0x513971){while(--_0x513971){_0x386812['push'](_0x386812['shift']());}};_0x4704d2(++_0x27c823);}(_0x20cc,0x19b));var _0xc20c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x20cc[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var logger=require(_0xc20c('0x2'))('api');var moment=require(_0xc20c('0x3'));var BPromise=require(_0xc20c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc20c('0x5'));var rimraf=require(_0xc20c('0x6'));var config=require(_0xc20c('0x7'));var attributes=require(_0xc20c('0x8'));module[_0xc20c('0x9')]=function(_0x423e72,_0x17434c){return _0x423e72['define'](_0xc20c('0xa'),attributes,{'tableName':_0xc20c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88f7=['api','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x50915a,_0x5f05fb){var _0x287102=function(_0x2a046a){while(--_0x2a046a){_0x50915a['push'](_0x50915a['shift']());}};_0x287102(++_0x5f05fb);}(_0x88f7,0x106));var _0x788f=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x88f7[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x788f('0x0'));var logger=require(_0x788f('0x1'))(_0x788f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x788f('0x3'));var fs=require('fs');var path=require(_0x788f('0x4'));var rimraf=require(_0x788f('0x5'));var config=require(_0x788f('0x6'));var attributes=require(_0x788f('0x7'));module[_0x788f('0x8')]=function(_0x5cc93d,_0x5e0de5){return _0x5cc93d[_0x788f('0x9')](_0x788f('0xa'),attributes,{'tableName':_0x788f('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 9a5040e..d8fdd20 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 _0xdf2a=['client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xef2407,_0x2e717d){var _0x4980ae=function(_0x125a23){while(--_0x125a23){_0xef2407['push'](_0xef2407['shift']());}};_0x4980ae(++_0x2e717d);}(_0xdf2a,0x1f4));var _0xadf2=function(_0x45629,_0x50c90d){_0x45629=_0x45629-0x0;var _0x3584a6=_0xdf2a[_0x45629];return _0x3584a6;};'use strict';var _=require('lodash');var util=require(_0xadf2('0x0'));var moment=require(_0xadf2('0x1'));var BPromise=require(_0xadf2('0x2'));var rs=require(_0xadf2('0x3'));var fs=require('fs');var Redis=require(_0xadf2('0x4'));var db=require(_0xadf2('0x5'))['db'];var utils=require(_0xadf2('0x6'));var logger=require(_0xadf2('0x7'))(_0xadf2('0x8'));var config=require('../../config/environment');var jayson=require(_0xadf2('0x9'));var client=jayson[_0xadf2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd279,_0x20579f,_0x4ba07){return new BPromise(function(_0x5f1d96,_0x48311f){return client[_0xadf2('0xb')](_0x4cd279,_0x4ba07)[_0xadf2('0xc')](function(_0x218349){logger[_0xadf2('0xd')](_0xadf2('0xe'),_0x20579f,_0xadf2('0xf'));logger['debug'](_0xadf2('0x10'),_0x20579f,'request\x20sent',JSON[_0xadf2('0x11')](_0x218349));if(_0x218349[_0xadf2('0x12')]){if(_0x218349['error'][_0xadf2('0x13')]===0x1f4){logger[_0xadf2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x20579f,_0x218349['error']['message']);return _0x48311f(_0x218349[_0xadf2('0x12')]['message']);}logger[_0xadf2('0x12')](_0xadf2('0xe'),_0x20579f,_0x218349[_0xadf2('0x12')][_0xadf2('0x14')]);return _0x5f1d96(_0x218349[_0xadf2('0x12')]['message']);}else{logger[_0xadf2('0xd')](_0xadf2('0xe'),_0x20579f,'request\x20sent');_0x5f1d96(_0x218349[_0xadf2('0x15')]['message']);}})[_0xadf2('0x16')](function(_0x2afa6a){logger[_0xadf2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x20579f,_0x2afa6a);_0x48311f(_0x2afa6a);});});}exports[_0xadf2('0x17')]=function(_0x4b286f){var _0x388aba=this;return new Promise(function(_0x502e85,_0x3ab075){return db[_0xadf2('0x18')][_0xadf2('0x19')](_0x4b286f[_0xadf2('0x1a')],{'raw':_0x4b286f[_0xadf2('0x1b')]?_0x4b286f['options'][_0xadf2('0x1c')]===undefined?!![]:![]:!![]})[_0xadf2('0xc')](function(_0xf3aba7){logger[_0xadf2('0xd')](_0xadf2('0x17'),_0x4b286f);logger[_0xadf2('0x1d')](_0xadf2('0x17'),_0x4b286f,JSON[_0xadf2('0x11')](_0xf3aba7));_0x502e85(_0xf3aba7);})[_0xadf2('0x16')](function(_0x4e51e7){logger[_0xadf2('0x12')](_0xadf2('0x17'),_0x4e51e7[_0xadf2('0x14')],_0x4b286f);_0x3ab075(_0x388aba[_0xadf2('0x12')](0x1f4,_0x4e51e7[_0xadf2('0x14')]));});});}; \ No newline at end of file +var _0xe87e=['options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','CreateReportAgentPreview','body'];(function(_0x4e1e67,_0x1e5858){var _0x28b433=function(_0x6d64d6){while(--_0x6d64d6){_0x4e1e67['push'](_0x4e1e67['shift']());}};_0x28b433(++_0x1e5858);}(_0xe87e,0x1ce));var _0xee87=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xe87e[_0x264b9b];return _0x4c7a0e;};'use strict';var _=require(_0xee87('0x0'));var util=require(_0xee87('0x1'));var moment=require(_0xee87('0x2'));var BPromise=require(_0xee87('0x3'));var rs=require(_0xee87('0x4'));var fs=require('fs');var Redis=require(_0xee87('0x5'));var db=require(_0xee87('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xee87('0x7'))(_0xee87('0x8'));var config=require(_0xee87('0x9'));var jayson=require(_0xee87('0xa'));var client=jayson[_0xee87('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x344d65,_0xa11cca,_0x2d1be8){return new BPromise(function(_0x4ec17d,_0x2dc988){return client[_0xee87('0xc')](_0x344d65,_0x2d1be8)[_0xee87('0xd')](function(_0x5c1d4d){logger[_0xee87('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0xa11cca,_0xee87('0xf'));logger[_0xee87('0x10')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xa11cca,_0xee87('0xf'),JSON[_0xee87('0x11')](_0x5c1d4d));if(_0x5c1d4d[_0xee87('0x12')]){if(_0x5c1d4d['error'][_0xee87('0x13')]===0x1f4){logger[_0xee87('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xa11cca,_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);return _0x2dc988(_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);}logger['error'](_0xee87('0x15'),_0xa11cca,_0x5c1d4d[_0xee87('0x12')]['message']);return _0x4ec17d(_0x5c1d4d[_0xee87('0x12')][_0xee87('0x14')]);}else{logger['info'](_0xee87('0x15'),_0xa11cca,_0xee87('0xf'));_0x4ec17d(_0x5c1d4d['result'][_0xee87('0x14')]);}})['catch'](function(_0x4b5897){logger[_0xee87('0x12')](_0xee87('0x15'),_0xa11cca,_0x4b5897);_0x2dc988(_0x4b5897);});});}exports[_0xee87('0x16')]=function(_0x3cc389){var _0x5218a5=this;return new Promise(function(_0x5b4c5e,_0x14d5a5){return db['ReportAgentPreview']['create'](_0x3cc389[_0xee87('0x17')],{'raw':_0x3cc389[_0xee87('0x18')]?_0x3cc389[_0xee87('0x18')][_0xee87('0x19')]===undefined?!![]:![]:!![]})[_0xee87('0xd')](function(_0x134806){logger['info'](_0xee87('0x16'),_0x3cc389);logger[_0xee87('0x10')](_0xee87('0x16'),_0x3cc389,JSON[_0xee87('0x11')](_0x134806));_0x5b4c5e(_0x134806);})[_0xee87('0x1a')](function(_0x169b03){logger[_0xee87('0x12')]('CreateReportAgentPreview',_0x169b03[_0xee87('0x14')],_0x3cc389);_0x14d5a5(_0x5218a5['error'](0x1f4,_0x169b03[_0xee87('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8021078..278de53 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 _0x110f=['showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','util','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','put','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x110f,0x1e6));var _0xf110=function(_0x115cdf,_0x3247ae){_0x115cdf=_0x115cdf-0x0;var _0x316e36=_0x110f[_0x115cdf];return _0x316e36;};'use strict';var multer=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0xf110('0x2'));var controller=require('./rpc.controller');router[_0xf110('0x3')](_0xf110('0x4'),auth[_0xf110('0x5')](),controller['voiceChannels']);router[_0xf110('0x3')](_0xf110('0x6'),auth[_0xf110('0x5')](),controller['voiceChannelMixMonitor']);router[_0xf110('0x3')](_0xf110('0x7'),auth[_0xf110('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0xf110('0x3')](_0xf110('0x8'),auth[_0xf110('0x5')](),controller['voiceQueues']);router[_0xf110('0x3')](_0xf110('0x9'),auth[_0xf110('0x5')](),controller[_0xf110('0xa')]);router['get'](_0xf110('0xb'),auth[_0xf110('0x5')](),controller['mailQueues']);router[_0xf110('0x3')](_0xf110('0xc'),auth[_0xf110('0x5')](),controller[_0xf110('0xd')]);router['get'](_0xf110('0xe'),auth[_0xf110('0x5')](),controller[_0xf110('0xf')]);router['get'](_0xf110('0x10'),auth[_0xf110('0x5')](),controller['smsQueues']);router[_0xf110('0x3')](_0xf110('0x11'),auth[_0xf110('0x5')](),controller[_0xf110('0x12')]);router[_0xf110('0x3')](_0xf110('0x13'),auth[_0xf110('0x5')](),controller[_0xf110('0x14')]);router[_0xf110('0x3')]('/voice/queues/channels',auth[_0xf110('0x5')](),controller[_0xf110('0x15')]);router[_0xf110('0x3')]('/voice/queues/channels/:uniqueid',auth[_0xf110('0x5')](),controller['voiceQueuesChannel']);router[_0xf110('0x3')](_0xf110('0x16'),auth[_0xf110('0x5')](),controller[_0xf110('0x17')]);router[_0xf110('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xf110('0x5')](),controller[_0xf110('0x18')]);router['get'](_0xf110('0x19'),auth[_0xf110('0x5')](),controller[_0xf110('0x1a')]);router[_0xf110('0x3')](_0xf110('0x1b'),auth['isAuthenticated'](),controller[_0xf110('0x1c')]);router[_0xf110('0x3')]('/outbound/channels',auth[_0xf110('0x5')](),controller[_0xf110('0x1d')]);router[_0xf110('0x3')](_0xf110('0x1e'),auth[_0xf110('0x5')](),controller[_0xf110('0x1f')]);router[_0xf110('0x20')]('/agents/:id/capacity',auth[_0xf110('0x5')](),controller['agentCapacity']);router[_0xf110('0x3')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router['get'](_0xf110('0x21'),auth[_0xf110('0x5')](),controller['trunks']);router[_0xf110('0x3')](_0xf110('0x22'),auth[_0xf110('0x5')](),controller['campaigns']);router[_0xf110('0x3')](_0xf110('0x23'),auth['isAuthenticated'](),controller[_0xf110('0x24')]);router[_0xf110('0x3')](_0xf110('0x25'),auth[_0xf110('0x5')](),controller[_0xf110('0x26')]);router[_0xf110('0x3')](_0xf110('0x27'),auth[_0xf110('0x5')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xf110('0x28'),auth['isAuthenticated'](),controller[_0xf110('0x29')]);router[_0xf110('0x3')](_0xf110('0x2a'),auth[_0xf110('0x5')](),controller[_0xf110('0x2b')]);router[_0xf110('0x3')](_0xf110('0x2c'),auth[_0xf110('0x5')](),controller[_0xf110('0x2d')]);router['post'](_0xf110('0x2e'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x30')));router[_0xf110('0x3')](_0xf110('0x31'),auth[_0xf110('0x5')](),controller[_0xf110('0x32')]);router[_0xf110('0x33')](_0xf110('0x34'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x35')));router[_0xf110('0x3')]('/chat/queues/:id',auth[_0xf110('0x5')](),controller[_0xf110('0x36')]);router[_0xf110('0x33')](_0xf110('0x37'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x38')));router[_0xf110('0x3')](_0xf110('0x39'),auth[_0xf110('0x5')](),controller['showFaxQueues']);router[_0xf110('0x33')](_0xf110('0x3a'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x3b')));router[_0xf110('0x3')](_0xf110('0x3c'),auth[_0xf110('0x5')](),controller[_0xf110('0x3d')]);router[_0xf110('0x33')](_0xf110('0x3e'),auth[_0xf110('0x5')](),controller['queueNotify']('sms'));router[_0xf110('0x3')](_0xf110('0x3f'),auth[_0xf110('0x5')](),controller[_0xf110('0x40')]);router[_0xf110('0x33')]('/agents/:id/notify',auth[_0xf110('0x5')](),controller[_0xf110('0x41')]);module[_0xf110('0x42')]=router; \ No newline at end of file +var _0x32c0=['/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','util','path','express','./rpc.controller','/voice/channels','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x2aaa84,_0x8f150a){var _0x6ec863=function(_0x49dade){while(--_0x49dade){_0x2aaa84['push'](_0x2aaa84['shift']());}};_0x6ec863(++_0x8f150a);}(_0x32c0,0x1bb));var _0x032c=function(_0x2435f6,_0x59337f){_0x2435f6=_0x2435f6-0x0;var _0x5114f1=_0x32c0[_0x2435f6];return _0x5114f1;};'use strict';var multer=require('multer');var util=require(_0x032c('0x0'));var path=require(_0x032c('0x1'));var express=require(_0x032c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x032c('0x3'));router['get'](_0x032c('0x4'),auth['isAuthenticated'](),controller[_0x032c('0x5')]);router[_0x032c('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x032c('0x7')]);router[_0x032c('0x6')](_0x032c('0x8'),auth[_0x032c('0x9')](),controller[_0x032c('0xa')]);router[_0x032c('0x6')](_0x032c('0xb'),auth[_0x032c('0x9')](),controller[_0x032c('0xc')]);router['get'](_0x032c('0xd'),auth[_0x032c('0x9')](),controller[_0x032c('0xe')]);router['get'](_0x032c('0xf'),auth['isAuthenticated'](),controller[_0x032c('0x10')]);router[_0x032c('0x6')](_0x032c('0x11'),auth['isAuthenticated'](),controller[_0x032c('0x12')]);router[_0x032c('0x6')](_0x032c('0x13'),auth[_0x032c('0x9')](),controller['openchannelQueues']);router[_0x032c('0x6')](_0x032c('0x14'),auth[_0x032c('0x9')](),controller[_0x032c('0x15')]);router[_0x032c('0x6')](_0x032c('0x16'),auth[_0x032c('0x9')](),controller[_0x032c('0x17')]);router[_0x032c('0x6')](_0x032c('0x18'),auth[_0x032c('0x9')](),controller[_0x032c('0x19')]);router[_0x032c('0x6')](_0x032c('0x1a'),auth['isAuthenticated'](),controller[_0x032c('0x1b')]);router[_0x032c('0x6')](_0x032c('0x1c'),auth[_0x032c('0x9')](),controller['voiceQueuesChannel']);router[_0x032c('0x6')](_0x032c('0x1d'),auth['isAuthenticated'](),controller[_0x032c('0x1e')]);router[_0x032c('0x6')](_0x032c('0x1f'),auth['isAuthenticated'](),controller[_0x032c('0x20')]);router[_0x032c('0x6')](_0x032c('0x21'),auth[_0x032c('0x9')](),controller['showVoiceQueues']);router['get'](_0x032c('0x22'),auth[_0x032c('0x9')](),controller[_0x032c('0x23')]);router[_0x032c('0x6')](_0x032c('0x24'),auth[_0x032c('0x9')](),controller[_0x032c('0x25')]);router[_0x032c('0x6')]('/agents',auth[_0x032c('0x9')](),controller['agents']);router['put'](_0x032c('0x26'),auth[_0x032c('0x9')](),controller[_0x032c('0x27')]);router['get'](_0x032c('0x28'),auth[_0x032c('0x9')](),controller[_0x032c('0x29')]);router[_0x032c('0x6')]('/trunks',auth[_0x032c('0x9')](),controller['trunks']);router['get'](_0x032c('0x2a'),auth[_0x032c('0x9')](),controller[_0x032c('0x2b')]);router[_0x032c('0x6')](_0x032c('0x2c'),auth[_0x032c('0x9')](),controller[_0x032c('0x2d')]);router['get'](_0x032c('0x2e'),auth[_0x032c('0x9')](),controller[_0x032c('0x2f')]);router[_0x032c('0x6')](_0x032c('0x30'),auth['isAuthenticated'](),controller[_0x032c('0x31')]);router['get'](_0x032c('0x32'),auth[_0x032c('0x9')](),controller[_0x032c('0x33')]);router['get'](_0x032c('0x34'),auth['isAuthenticated'](),controller[_0x032c('0x35')]);router[_0x032c('0x6')](_0x032c('0x36'),auth[_0x032c('0x9')](),controller[_0x032c('0x37')]);router[_0x032c('0x38')](_0x032c('0x39'),auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x3b')));router[_0x032c('0x6')](_0x032c('0x3c'),auth[_0x032c('0x9')](),controller[_0x032c('0x3d')]);router['post'](_0x032c('0x3e'),auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x3f')));router[_0x032c('0x6')](_0x032c('0x40'),auth[_0x032c('0x9')](),controller[_0x032c('0x41')]);router[_0x032c('0x38')](_0x032c('0x42'),auth[_0x032c('0x9')](),controller['queueNotify'](_0x032c('0x43')));router[_0x032c('0x6')](_0x032c('0x44'),auth[_0x032c('0x9')](),controller['showFaxQueues']);router[_0x032c('0x38')]('/openchannel/queues/:id/notify',auth[_0x032c('0x9')](),controller[_0x032c('0x3a')](_0x032c('0x45')));router['get'](_0x032c('0x46'),auth[_0x032c('0x9')](),controller[_0x032c('0x47')]);router[_0x032c('0x38')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x032c('0x6')](_0x032c('0x48'),auth[_0x032c('0x9')](),controller[_0x032c('0x49')]);router[_0x032c('0x38')](_0x032c('0x4a'),auth[_0x032c('0x9')](),controller[_0x032c('0x4b')]);module[_0x032c('0x4c')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4dd5690..98f54be 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 _0x0e00=['rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','body','MemberReport','findAll','user','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','Message','findOne','messageId','Account','update','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','client','http','request','then','error','code','message','catch','status','sendStatus','name','send','isNil'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x0e00,0xd5));var _0x00e0=function(_0x73d1fc,_0x456c85){_0x73d1fc=_0x73d1fc-0x0;var _0x3357c7=_0x0e00[_0x73d1fc];return _0x3357c7;};'use strict';var BPromise=require(_0x00e0('0x0'));var moment=require(_0x00e0('0x1'));var _=require(_0x00e0('0x2'));var util=require(_0x00e0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x00e0('0x4'))(_0x00e0('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x00e0('0x6')][_0x00e0('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x00e0('0x7')]({'port':0x232b});var routingClient=jayson[_0x00e0('0x6')][_0x00e0('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x37a38e,_0x1c3f9e,_0x255846){return new BPromise(function(_0x511438,_0x354c19){var _0x49ae71=_0x255846?_0x255846:amiClient;return _0x49ae71[_0x00e0('0x8')](_0x37a38e,_0x1c3f9e)[_0x00e0('0x9')](function(_0x3f26a0){if(_0x3f26a0[_0x00e0('0xa')]){if(_0x3f26a0[_0x00e0('0xa')][_0x00e0('0xb')]===0x1f4){return _0x354c19(_0x3f26a0[_0x00e0('0xa')]['message']);}return _0x511438(_0x3f26a0['error'][_0x00e0('0xc')]);}else{_0x511438(_0x3f26a0['result']);}})[_0x00e0('0xd')](function(_0x4be184){_0x354c19(_0x4be184);});});}function respondWithResult(_0x44460f,_0x1948c4){_0x1948c4=_0x1948c4||0xc8;return function(_0x2b36e0){if(_0x2b36e0){return _0x44460f[_0x00e0('0xe')](_0x1948c4)['json'](_0x2b36e0);}return _0x44460f[_0x00e0('0xf')](0x194);};}function handleError(_0x1f2d77,_0x4f699d){_0x4f699d=_0x4f699d||0x1f4;return function(_0x7a4d3){logger['error'](_0x7a4d3['stack']);if(_0x7a4d3[_0x00e0('0x10')]){delete _0x7a4d3[_0x00e0('0x10')];}_0x1f2d77['status'](_0x4f699d)[_0x00e0('0x11')](_0x7a4d3);};}function findById(_0x11a07f){return function(_0x7ac30c){if(!_[_0x00e0('0x12')](_0x11a07f)&&!_[_0x00e0('0x12')](_0x7ac30c)&&!_['isNil'](_0x7ac30c[_0x00e0('0x13')])){return _['find'](_0x7ac30c[_0x00e0('0x13')],function(_0x138f6){return _0x138f6['id']==_0x11a07f;});}return null;};}exports['voiceChannels']=function(_0x3d53f3,_0x2533db){return respondWithRpcPromise(_0x00e0('0x14'),_0x3d53f3[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x2533db,null))[_0x00e0('0xd')](handleError(_0x2533db,null));};exports[_0x00e0('0x16')]=function(_0x5bd400,_0x5477f1){return respondWithRpcPromise(_0x00e0('0x17'),_[_0x00e0('0x18')](_0x5bd400[_0x00e0('0x15')],_0x5bd400[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x5477f1,null))[_0x00e0('0xd')](handleError(_0x5477f1,null));};exports[_0x00e0('0x1a')]=function(_0x1232ce,_0x58bf4e){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x1232ce[_0x00e0('0x15')],_0x1232ce[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x58bf4e,null))['catch'](handleError(_0x58bf4e,null));};exports['voiceQueues']=function(_0x3203a9,_0x4c52ec){return respondWithRpcPromise(_0x00e0('0x1b'),_0x3203a9['query'])[_0x00e0('0x9')](respondWithResult(_0x4c52ec,null))[_0x00e0('0xd')](handleError(_0x4c52ec,null));};exports[_0x00e0('0x1c')]=function(_0x577f0b,_0x400ee1){return respondWithRpcPromise('VoiceQueues',_0x577f0b[_0x00e0('0x15')])[_0x00e0('0x9')](findById(_0x577f0b[_0x00e0('0x19')]['id']))[_0x00e0('0x9')](respondWithResult(_0x400ee1,null))[_0x00e0('0xd')](handleError(_0x400ee1,null));};exports[_0x00e0('0x1d')]=function(_0x2d4f3c,_0x222197){return respondWithRpcPromise(_0x00e0('0x1e'),_[_0x00e0('0x18')](_0x2d4f3c[_0x00e0('0x15')],_0x2d4f3c['params']))[_0x00e0('0x9')](respondWithResult(_0x222197,null))[_0x00e0('0xd')](handleError(_0x222197,null));};exports[_0x00e0('0x1f')]=function(_0x6c76ef,_0x2e1edc){return respondWithRpcPromise('VoiceQueuesChannels',_0x6c76ef[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x2e1edc,null))['catch'](handleError(_0x2e1edc,null));};exports['voiceQueuesChannel']=function(_0x48827a,_0x15684b){return respondWithRpcPromise(_0x00e0('0x20'),_[_0x00e0('0x18')](_0x48827a[_0x00e0('0x15')],_0x48827a[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x15684b,null))['catch'](handleError(_0x15684b,null));};exports[_0x00e0('0x21')]=function(_0x5a55ff,_0x421b76){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x00e0('0x18')](_0x5a55ff[_0x00e0('0x15')],_0x5a55ff['params']))[_0x00e0('0x9')](respondWithResult(_0x421b76,null))['catch'](handleError(_0x421b76,null));};exports[_0x00e0('0x22')]=function(_0x544add,_0x4c0c18){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x00e0('0x18')](_0x544add[_0x00e0('0x15')],_0x544add[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x4c0c18,null))['catch'](handleError(_0x4c0c18,null));};exports[_0x00e0('0x23')]=function(_0x522dfb,_0x266dc7){return respondWithRpcPromise(_0x00e0('0x24'),_0x522dfb['query'])['then'](respondWithResult(_0x266dc7,null))['catch'](handleError(_0x266dc7,null));};exports[_0x00e0('0x25')]=function(_0x10f075,_0x3358cb){return respondWithRpcPromise(_0x00e0('0x26'),_0x10f075[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x3358cb,null))[_0x00e0('0xd')](handleError(_0x3358cb,null));};exports[_0x00e0('0x27')]=function(_0x273201,_0x34b1ec){var _0xb353a1;return respondWithRpcPromise(_0x00e0('0x28'),_0x273201['query'])[_0x00e0('0x9')](function(_0x45619b){_0xb353a1=_0x45619b;return respondWithRpcPromise('Agents',_0x273201['query'],routingClient);})['then'](function(_0x3b4cab){return _['merge']({},_0x3b4cab,_0xb353a1);})['then'](respondWithResult(_0x34b1ec,null))[_0x00e0('0xd')](handleError(_0x34b1ec,null));};exports['agentCapacity']=function(_0x4b1cd9,_0xf1d0c2){if(_0x4b1cd9['body']&&_0x4b1cd9['body'][_0x00e0('0x29')]&&_0x4b1cd9['user']&&_0x4b1cd9['user'][_0x00e0('0x10')]){for(var _0x3b2ef2 in _0x4b1cd9['body'][_0x00e0('0x29')]){if(_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')]['hasOwnProperty'](_0x3b2ef2)){db[_0x00e0('0x2b')][_0x00e0('0x2c')]({'where':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2]&&_0x4b1cd9[_0x00e0('0x2a')]['interaction'][_0x3b2ef2][_0x00e0('0x2e')]?{'$notIn':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2]}:{'$ne':null}}})[_0x00e0('0x9')](function(_0xe1b7ed){var _0x16041d=moment()[_0x00e0('0x2f')](_0x00e0('0x30'));for(var _0x21e2e1=0x0,_0x30cf4c=_0xe1b7ed[_0x00e0('0x2e')];_0x21e2e1<_0x30cf4c;_0x21e2e1+=0x1){_0xe1b7ed[_0x21e2e1][_0x00e0('0x31')]({'exitAt':_0x16041d});}});for(var _0x34759f=0x0;_0x34759f<_0x4b1cd9[_0x00e0('0x2a')]['interaction'][_0x3b2ef2][_0x00e0('0x2e')];_0x34759f+=0x1){db['MemberReport'][_0x00e0('0x32')]({'where':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'type':_0x00e0('0x33'),'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2][_0x34759f],'exitAt':null},'defaults':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'interface':_['isNil'](_0x4b1cd9[_0x00e0('0x2d')]['interface'])?util[_0x00e0('0x2f')](_0x00e0('0x34'),_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')]):_0x4b1cd9['user'][_0x00e0('0x35')],'type':_0x00e0('0x33'),'enterAt':moment()['format'](_0x00e0('0x30')),'role':_0x00e0('0x36'),'internal':_0x4b1cd9['user'][_0x00e0('0x37')],'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2][_0x34759f]}});}}}}return respondWithRpcPromise(_0x00e0('0x38'),{'id':_0x4b1cd9[_0x00e0('0x19')]['id'],'capacity':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x39')]},routingClient)['then'](respondWithResult(_0xf1d0c2,null))[_0x00e0('0xd')](handleError(_0xf1d0c2,null));};exports[_0x00e0('0x3a')]=function(_0x5014ff,_0x1f53fb){return respondWithRpcPromise(_0x00e0('0x3b'),_0x5014ff['query'])['then'](respondWithResult(_0x1f53fb,null))[_0x00e0('0xd')](handleError(_0x1f53fb,null));};exports[_0x00e0('0x3c')]=function(_0x487af1,_0x17172b){return respondWithRpcPromise(_0x00e0('0x3d'),_0x487af1[_0x00e0('0x15')])['then'](respondWithResult(_0x17172b,null))[_0x00e0('0xd')](handleError(_0x17172b,null));};exports[_0x00e0('0x3e')]=function(_0x271610,_0x596646){return respondWithRpcPromise(_0x00e0('0x3f'),_0x271610[_0x00e0('0x15')])['then'](respondWithResult(_0x596646,null))['catch'](handleError(_0x596646,null));};exports[_0x00e0('0x40')]=function(_0x147024,_0x45123d){return respondWithRpcPromise(_0x00e0('0x41'),_0x147024[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x45123d,null))['catch'](handleError(_0x45123d,null));};exports[_0x00e0('0x42')]=function(_0x4227de,_0x2b6598){return respondWithRpcPromise('ChatQueues',_0x4227de[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x4227de['params']['id']))['then'](respondWithResult(_0x2b6598,null))[_0x00e0('0xd')](handleError(_0x2b6598,null));};exports[_0x00e0('0x43')]=function(_0x3cc722,_0x212638){return respondWithRpcPromise('MailQueues',_0x3cc722[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x212638,null))[_0x00e0('0xd')](handleError(_0x212638,null));};exports[_0x00e0('0x44')]=function(_0x12f8a8,_0x4f9ada){return respondWithRpcPromise(_0x00e0('0x45'),_0x12f8a8[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x12f8a8[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x4f9ada,null))[_0x00e0('0xd')](handleError(_0x4f9ada,null));};exports[_0x00e0('0x46')]=function(_0x3fba99,_0x3d7b4c){return respondWithRpcPromise(_0x00e0('0x47'),_0x3fba99['query'],mailClient)[_0x00e0('0x9')](respondWithResult(_0x3d7b4c,null))[_0x00e0('0xd')](handleError(_0x3d7b4c,null));};exports[_0x00e0('0x48')]=function(_0x37fa9b,_0x1b71d6){return respondWithRpcPromise(_0x00e0('0x49'),_0x37fa9b[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x1b71d6,null))[_0x00e0('0xd')](handleError(_0x1b71d6,null));};exports[_0x00e0('0x4a')]=function(_0x56a507,_0x106b6a){return respondWithRpcPromise(_0x00e0('0x49'),_0x56a507[_0x00e0('0x15')],routingClient)['then'](findById(_0x56a507[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x106b6a,null))['catch'](handleError(_0x106b6a,null));};exports[_0x00e0('0x4b')]=function(_0x5b25dc,_0x55d292){return respondWithRpcPromise(_0x00e0('0x4c'),_0x5b25dc[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x55d292,null))[_0x00e0('0xd')](handleError(_0x55d292,null));};exports[_0x00e0('0x4d')]=function(_0x18e323,_0x2c3907){return respondWithRpcPromise(_0x00e0('0x4c'),_0x18e323['query'],routingClient)[_0x00e0('0x9')](findById(_0x18e323[_0x00e0('0x19')]['id']))[_0x00e0('0x9')](respondWithResult(_0x2c3907,null))[_0x00e0('0xd')](handleError(_0x2c3907,null));};exports['faxQueues']=function(_0x38f01a,_0x4edee2){return respondWithRpcPromise(_0x00e0('0x4e'),_0x38f01a[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x4edee2,null))[_0x00e0('0xd')](handleError(_0x4edee2,null));};exports[_0x00e0('0x4f')]=function(_0x5d0356,_0x2bf555){return respondWithRpcPromise(_0x00e0('0x4e'),_0x5d0356[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x5d0356[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x2bf555,null))[_0x00e0('0xd')](handleError(_0x2bf555,null));};exports['faxAccounts']=function(_0x3b7d5f,_0x47433b){return respondWithRpcPromise('FaxAccounts',_0x3b7d5f['query'])[_0x00e0('0x9')](respondWithResult(_0x47433b,null))[_0x00e0('0xd')](handleError(_0x47433b,null));};exports[_0x00e0('0x50')]=function(_0xe802c3,_0x5242f5){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0xe802c3[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x5242f5,null))[_0x00e0('0xd')](handleError(_0x5242f5,null));};exports[_0x00e0('0x51')]=function(_0x244fb3,_0x1dd259){return respondWithRpcPromise(_0x00e0('0x52'),_0x244fb3[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x1dd259,null))[_0x00e0('0xd')](handleError(_0x1dd259,null));};exports[_0x00e0('0x53')]=function(_0x8cb933,_0x166c68){return respondWithRpcPromise(_0x00e0('0x54'),_0x8cb933['query'],routingClient)['then'](respondWithResult(_0x166c68,null))[_0x00e0('0xd')](handleError(_0x166c68,null));};exports[_0x00e0('0x55')]=function(_0x33dee8,_0x4251c0){return respondWithRpcPromise(_0x00e0('0x56'),_0x33dee8[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x4251c0,null))[_0x00e0('0xd')](handleError(_0x4251c0,null));};exports[_0x00e0('0x57')]=function(_0x4f8ba0,_0x44f91a){return respondWithRpcPromise(_0x00e0('0x58'),_0x4f8ba0[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x44f91a,null))[_0x00e0('0xd')](handleError(_0x44f91a,null));};exports[_0x00e0('0x59')]=function(_0x38eee5){return function(_0x32890c,_0x2b712e){var _0x2320ce,_0x35de80;var _0x53ae36=_[_0x00e0('0x5a')](_0x38eee5);var _0x2c38f6=_0x38eee5==='chat'?_0x00e0('0x5b'):'Account';return db[_0x53ae36+_0x00e0('0x5c')]['findOne']({'raw':!![],'where':{'id':_0x32890c[_0x00e0('0x19')]['id']}})['then'](function(_0x125000){if(_['isNil'](_0x125000)){throw new Error(_0x53ae36+'\x20Queue\x20not\x20found');}_0x2320ce=_0x125000;return db[_0x53ae36+_0x00e0('0x5d')][_0x00e0('0x5e')]({'where':{'id':_0x32890c[_0x00e0('0x2a')][_0x00e0('0x5f')]},'include':[{'model':db[_0x53ae36+'Interaction'],'as':'Interaction'},{'model':db[_0x53ae36+_0x2c38f6],'as':_0x00e0('0x60')}]});})[_0x00e0('0x9')](function(_0x1f526d){if(_[_0x00e0('0x12')](_0x1f526d)){throw new Error(_0x53ae36+'\x20Message\x20not\x20found');}_0x35de80=_0x1f526d;return _0x1f526d[_0x00e0('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x00e0('0x9')](function(){var _0x21df35={'uniqueid':_0x38eee5+'.'+_0x35de80['id']+'.'+_0x35de80[_0x00e0('0x62')]['id'],'FromUserId':_0x32890c[_0x00e0('0x2d')]['id'],'type':_0x00e0('0x63')};_0x21df35[_0x53ae36+_0x00e0('0x64')]=_0x35de80['id'];_0x21df35[_0x53ae36+_0x00e0('0x65')]=_0x35de80['Interaction']['id'];_0x21df35[_0x00e0('0x66')+_0x53ae36+_0x2c38f6+'Id']=_0x35de80[_0x00e0('0x60')]['id'];_0x21df35['To'+_0x53ae36+_0x00e0('0x67')]=_0x2320ce['id'];return db[_0x53ae36+_0x00e0('0x68')][_0x00e0('0x69')](_0x21df35);})[_0x00e0('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x38eee5,'interaction':_0x35de80['Interaction'],'message':_0x35de80,'account':_0x35de80['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x00e0('0x63'),'appdata':_0x2320ce['name']+','+(_0x35de80[_0x00e0('0x60')][_0x00e0('0x6a')]||0x12c),'interval':_0x00e0('0x6b')}]},routingClient);})[_0x00e0('0x9')](respondWithResult(_0x2b712e,null))['catch'](handleError(_0x2b712e,null));};};exports[_0x00e0('0x6c')]=function(_0x13af4c,_0xac1eb4){var _0x1640bf,_0x2139ab;if(_['isNil'](_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x6d')])){throw new Error(_0x00e0('0x6e'));}var _0x178380=_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x6d')];var _0x59cb7a=_['capitalize'](_0x178380);var _0x37117a=_0x178380===_0x00e0('0x6f')?'Website':_0x00e0('0x60');return db[_0x00e0('0x70')]['findOne']({'raw':!![],'where':{'id':_0x13af4c[_0x00e0('0x19')]['id'],'role':_0x00e0('0x36')}})[_0x00e0('0x9')](function(_0x2dc642){if(_['isNil'](_0x2dc642)){throw new Error('Agent\x20not\x20found');}_0x1640bf=_0x2dc642;return db[_0x59cb7a+_0x00e0('0x5d')]['findOne']({'where':{'id':_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x5f')]},'include':[{'model':db[_0x59cb7a+_0x00e0('0x62')],'as':_0x00e0('0x62')},{'model':db[_0x59cb7a+_0x37117a],'as':_0x00e0('0x60')}]});})['then'](function(_0x410c4a){if(_[_0x00e0('0x12')](_0x410c4a)){throw new Error(_0x59cb7a+_0x00e0('0x71'));}_0x2139ab=_0x410c4a;return _0x410c4a[_0x00e0('0x61')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5bc983={'uniqueid':_0x178380+'.'+_0x2139ab['id']+'.'+_0x2139ab[_0x00e0('0x62')]['id'],'FromUserId':_0x13af4c[_0x00e0('0x2d')]['id'],'type':_0x00e0('0x63'),'ToUserId':_0x1640bf['id']};_0x5bc983[_0x59cb7a+_0x00e0('0x64')]=_0x2139ab['id'];_0x5bc983[_0x59cb7a+'InteractionId']=_0x2139ab[_0x00e0('0x62')]['id'];_0x5bc983[_0x00e0('0x66')+_0x59cb7a+_0x37117a+'Id']=_0x2139ab[_0x00e0('0x60')]['id'];return db[_0x59cb7a+_0x00e0('0x68')][_0x00e0('0x69')](_0x5bc983);})['then'](function(){return respondWithRpcPromise(_0x00e0('0x72'),{'channel':_0x178380,'interaction':_0x2139ab[_0x00e0('0x62')],'message':_0x2139ab,'account':_0x2139ab[_0x00e0('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0x00e0('0x36'),'appdata':_0x1640bf[_0x00e0('0x10')]+','+(_0x2139ab[_0x00e0('0x60')][_0x00e0('0x73')]||0x12c),'interval':_0x00e0('0x6b')}]},routingClient);})['then'](respondWithResult(_0xac1eb4,null))[_0x00e0('0xd')](handleError(_0xac1eb4,null));}; \ No newline at end of file +var _0x912e=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','TransferReport','create','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','Message','From','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','name','hasOwnProperty','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','Trunks','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showFaxQueues','faxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x912e,0x16b));var _0xe912=function(_0x1301ae,_0x85b28c){_0x1301ae=_0x1301ae-0x0;var _0x20a7af=_0x912e[_0x1301ae];return _0x20a7af;};'use strict';var BPromise=require(_0xe912('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0xe912('0x1'))['db'];var logger=require(_0xe912('0x2'))('api');var jayson=require(_0xe912('0x3'));var amiClient=jayson[_0xe912('0x4')]['http']({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson['client'][_0xe912('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x2d4f5c,_0x22fcef,_0x58ba0b){return new BPromise(function(_0x4d4702,_0x10e0e3){var _0x17ef62=_0x58ba0b?_0x58ba0b:amiClient;return _0x17ef62[_0xe912('0x6')](_0x2d4f5c,_0x22fcef)[_0xe912('0x7')](function(_0x452e9a){if(_0x452e9a['error']){if(_0x452e9a[_0xe912('0x8')]['code']===0x1f4){return _0x10e0e3(_0x452e9a['error'][_0xe912('0x9')]);}return _0x4d4702(_0x452e9a[_0xe912('0x8')][_0xe912('0x9')]);}else{_0x4d4702(_0x452e9a[_0xe912('0xa')]);}})[_0xe912('0xb')](function(_0x442469){_0x10e0e3(_0x442469);});});}function respondWithResult(_0x3f5558,_0xdc3606){_0xdc3606=_0xdc3606||0xc8;return function(_0x1efa0e){if(_0x1efa0e){return _0x3f5558[_0xe912('0xc')](_0xdc3606)[_0xe912('0xd')](_0x1efa0e);}return _0x3f5558[_0xe912('0xe')](0x194);};}function handleError(_0x4aa14c,_0x365e2e){_0x365e2e=_0x365e2e||0x1f4;return function(_0x3941c6){logger[_0xe912('0x8')](_0x3941c6[_0xe912('0xf')]);if(_0x3941c6['name']){delete _0x3941c6['name'];}_0x4aa14c[_0xe912('0xc')](_0x365e2e)['send'](_0x3941c6);};}function findById(_0x4386d0){return function(_0x161c6e){if(!_[_0xe912('0x10')](_0x4386d0)&&!_[_0xe912('0x10')](_0x161c6e)&&!_[_0xe912('0x10')](_0x161c6e[_0xe912('0x11')])){return _[_0xe912('0x12')](_0x161c6e['rows'],function(_0x71eb7e){return _0x71eb7e['id']==_0x4386d0;});}return null;};}exports[_0xe912('0x13')]=function(_0x4e0b58,_0xbf137a){return respondWithRpcPromise(_0xe912('0x14'),_0x4e0b58[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0xbf137a,null))['catch'](handleError(_0xbf137a,null));};exports[_0xe912('0x16')]=function(_0x36630e,_0x457a8a){return respondWithRpcPromise(_0xe912('0x17'),_[_0xe912('0x18')](_0x36630e[_0xe912('0x15')],_0x36630e[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x457a8a,null))['catch'](handleError(_0x457a8a,null));};exports[_0xe912('0x1a')]=function(_0x43b1f0,_0x50398a){return respondWithRpcPromise(_0xe912('0x1b'),_[_0xe912('0x18')](_0x43b1f0[_0xe912('0x15')],_0x43b1f0['params']))[_0xe912('0x7')](respondWithResult(_0x50398a,null))['catch'](handleError(_0x50398a,null));};exports[_0xe912('0x1c')]=function(_0x5bff6a,_0x3989c0){return respondWithRpcPromise(_0xe912('0x1d'),_0x5bff6a['query'])[_0xe912('0x7')](respondWithResult(_0x3989c0,null))['catch'](handleError(_0x3989c0,null));};exports[_0xe912('0x1e')]=function(_0x15ca96,_0x5746b2){return respondWithRpcPromise(_0xe912('0x1d'),_0x15ca96[_0xe912('0x15')])[_0xe912('0x7')](findById(_0x15ca96['params']['id']))['then'](respondWithResult(_0x5746b2,null))['catch'](handleError(_0x5746b2,null));};exports[_0xe912('0x1f')]=function(_0x4964a1,_0x34b9ae){return respondWithRpcPromise(_0xe912('0x20'),_[_0xe912('0x18')](_0x4964a1[_0xe912('0x15')],_0x4964a1['params']))[_0xe912('0x7')](respondWithResult(_0x34b9ae,null))['catch'](handleError(_0x34b9ae,null));};exports[_0xe912('0x21')]=function(_0x161f5c,_0x29b3f5){return respondWithRpcPromise(_0xe912('0x22'),_0x161f5c[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x29b3f5,null))[_0xe912('0xb')](handleError(_0x29b3f5,null));};exports['voiceQueuesChannel']=function(_0x36dce7,_0x1a0882){return respondWithRpcPromise(_0xe912('0x23'),_[_0xe912('0x18')](_0x36dce7['query'],_0x36dce7[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x1a0882,null))[_0xe912('0xb')](handleError(_0x1a0882,null));};exports[_0xe912('0x24')]=function(_0x471c19,_0x22456b){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe912('0x18')](_0x471c19[_0xe912('0x15')],_0x471c19[_0xe912('0x19')]))[_0xe912('0x7')](respondWithResult(_0x22456b,null))[_0xe912('0xb')](handleError(_0x22456b,null));};exports[_0xe912('0x25')]=function(_0x3c3575,_0x5f1e2c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe912('0x18')](_0x3c3575[_0xe912('0x15')],_0x3c3575['params']))[_0xe912('0x7')](respondWithResult(_0x5f1e2c,null))[_0xe912('0xb')](handleError(_0x5f1e2c,null));};exports[_0xe912('0x26')]=function(_0x3ba636,_0x3bef6c){return respondWithRpcPromise(_0xe912('0x27'),_0x3ba636[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x3bef6c,null))[_0xe912('0xb')](handleError(_0x3bef6c,null));};exports[_0xe912('0x28')]=function(_0x1bed14,_0x266c52){return respondWithRpcPromise('OutboundChannels',_0x1bed14[_0xe912('0x15')])['then'](respondWithResult(_0x266c52,null))[_0xe912('0xb')](handleError(_0x266c52,null));};exports[_0xe912('0x29')]=function(_0x4053d9,_0x279a09){var _0xee201b;return respondWithRpcPromise('Agents',_0x4053d9[_0xe912('0x15')])['then'](function(_0x43569e){_0xee201b=_0x43569e;return respondWithRpcPromise(_0xe912('0x2a'),_0x4053d9[_0xe912('0x15')],routingClient);})[_0xe912('0x7')](function(_0x287ed6){return _[_0xe912('0x18')]({},_0x287ed6,_0xee201b);})[_0xe912('0x7')](respondWithResult(_0x279a09,null))[_0xe912('0xb')](handleError(_0x279a09,null));};exports[_0xe912('0x2b')]=function(_0x308e34,_0xa378ce){if(_0x308e34[_0xe912('0x2c')]&&_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')]&&_0x308e34['user']&&_0x308e34['user'][_0xe912('0x2e')]){for(var _0x29054c in _0x308e34[_0xe912('0x2c')][_0xe912('0x2d')]){if(_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0xe912('0x2f')](_0x29054c)){db[_0xe912('0x30')][_0xe912('0x31')]({'where':{'channel':_0x29054c,'membername':_0x308e34[_0xe912('0x32')][_0xe912('0x2e')],'type':_0xe912('0x33'),'exitAt':null,'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c]&&_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0xe912('0x34')]?{'$notIn':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c]}:{'$ne':null}}})[_0xe912('0x7')](function(_0x4a8d77){var _0x3f632b=moment()[_0xe912('0x35')](_0xe912('0x36'));for(var _0x284b81=0x0,_0x4f19d1=_0x4a8d77[_0xe912('0x34')];_0x284b81<_0x4f19d1;_0x284b81+=0x1){_0x4a8d77[_0x284b81][_0xe912('0x37')]({'exitAt':_0x3f632b});}});for(var _0x4516ad=0x0;_0x4516ad<_0x308e34[_0xe912('0x2c')]['interaction'][_0x29054c][_0xe912('0x34')];_0x4516ad+=0x1){db[_0xe912('0x30')][_0xe912('0x38')]({'where':{'channel':_0x29054c,'membername':_0x308e34['user'][_0xe912('0x2e')],'type':_0xe912('0x33'),'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0x4516ad],'exitAt':null},'defaults':{'channel':_0x29054c,'membername':_0x308e34[_0xe912('0x32')][_0xe912('0x2e')],'interface':_[_0xe912('0x10')](_0x308e34['user'][_0xe912('0x39')])?util[_0xe912('0x35')](_0xe912('0x3a'),_0x308e34['user']['name']):_0x308e34[_0xe912('0x32')][_0xe912('0x39')],'type':_0xe912('0x33'),'enterAt':moment()[_0xe912('0x35')](_0xe912('0x36')),'role':_0xe912('0x3b'),'internal':_0x308e34[_0xe912('0x32')][_0xe912('0x3c')],'uniqueid':_0x308e34[_0xe912('0x2c')][_0xe912('0x2d')][_0x29054c][_0x4516ad]}});}}}}return respondWithRpcPromise(_0xe912('0x3d'),{'id':_0x308e34[_0xe912('0x19')]['id'],'capacity':_0x308e34[_0xe912('0x2c')]['capacity']},routingClient)[_0xe912('0x7')](respondWithResult(_0xa378ce,null))[_0xe912('0xb')](handleError(_0xa378ce,null));};exports['telephones']=function(_0x520327,_0x144fd7){return respondWithRpcPromise('Telephones',_0x520327[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x144fd7,null))[_0xe912('0xb')](handleError(_0x144fd7,null));};exports['trunks']=function(_0x2700f3,_0x460713){return respondWithRpcPromise(_0xe912('0x3e'),_0x2700f3[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x460713,null))[_0xe912('0xb')](handleError(_0x460713,null));};exports['campaigns']=function(_0x53144c,_0x1dcbd1){return respondWithRpcPromise('Campaigns',_0x53144c[_0xe912('0x15')])[_0xe912('0x7')](respondWithResult(_0x1dcbd1,null))[_0xe912('0xb')](handleError(_0x1dcbd1,null));};exports['chatQueues']=function(_0x5fed77,_0x4f20d1){return respondWithRpcPromise('ChatQueues',_0x5fed77[_0xe912('0x15')],routingClient)['then'](respondWithResult(_0x4f20d1,null))[_0xe912('0xb')](handleError(_0x4f20d1,null));};exports[_0xe912('0x3f')]=function(_0x268086,_0x52d67c){return respondWithRpcPromise(_0xe912('0x40'),_0x268086[_0xe912('0x15')],routingClient)['then'](findById(_0x268086[_0xe912('0x19')]['id']))[_0xe912('0x7')](respondWithResult(_0x52d67c,null))[_0xe912('0xb')](handleError(_0x52d67c,null));};exports[_0xe912('0x41')]=function(_0x44516b,_0x51dcdf){return respondWithRpcPromise(_0xe912('0x42'),_0x44516b[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x51dcdf,null))['catch'](handleError(_0x51dcdf,null));};exports[_0xe912('0x43')]=function(_0x57627a,_0x2e661e){return respondWithRpcPromise(_0xe912('0x42'),_0x57627a[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0x57627a['params']['id']))[_0xe912('0x7')](respondWithResult(_0x2e661e,null))[_0xe912('0xb')](handleError(_0x2e661e,null));};exports[_0xe912('0x44')]=function(_0x5e7304,_0xe826a2){return respondWithRpcPromise(_0xe912('0x45'),_0x5e7304[_0xe912('0x15')],mailClient)[_0xe912('0x7')](respondWithResult(_0xe826a2,null))[_0xe912('0xb')](handleError(_0xe826a2,null));};exports[_0xe912('0x46')]=function(_0x9194e8,_0x5646f0){return respondWithRpcPromise(_0xe912('0x47'),_0x9194e8['query'],routingClient)['then'](respondWithResult(_0x5646f0,null))['catch'](handleError(_0x5646f0,null));};exports[_0xe912('0x48')]=function(_0xce7100,_0x429b7b){return respondWithRpcPromise(_0xe912('0x47'),_0xce7100[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0xce7100['params']['id']))[_0xe912('0x7')](respondWithResult(_0x429b7b,null))[_0xe912('0xb')](handleError(_0x429b7b,null));};exports[_0xe912('0x49')]=function(_0x3ee385,_0x5a8083){return respondWithRpcPromise('SmsQueues',_0x3ee385[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x5a8083,null))[_0xe912('0xb')](handleError(_0x5a8083,null));};exports[_0xe912('0x4a')]=function(_0x5f0d29,_0x4a6d21){return respondWithRpcPromise(_0xe912('0x4b'),_0x5f0d29[_0xe912('0x15')],routingClient)['then'](findById(_0x5f0d29[_0xe912('0x19')]['id']))[_0xe912('0x7')](respondWithResult(_0x4a6d21,null))[_0xe912('0xb')](handleError(_0x4a6d21,null));};exports['faxQueues']=function(_0x3aa7b7,_0xb1423c){return respondWithRpcPromise('FaxQueues',_0x3aa7b7[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0xb1423c,null))['catch'](handleError(_0xb1423c,null));};exports[_0xe912('0x4c')]=function(_0x466b95,_0x5a8ee9){return respondWithRpcPromise('FaxQueues',_0x466b95[_0xe912('0x15')],routingClient)[_0xe912('0x7')](findById(_0x466b95[_0xe912('0x19')]['id']))['then'](respondWithResult(_0x5a8ee9,null))[_0xe912('0xb')](handleError(_0x5a8ee9,null));};exports[_0xe912('0x4d')]=function(_0x45352d,_0x12d90e){return respondWithRpcPromise('FaxAccounts',_0x45352d['query'])[_0xe912('0x7')](respondWithResult(_0x12d90e,null))[_0xe912('0xb')](handleError(_0x12d90e,null));};exports['chatQueuesWaitingInteractions']=function(_0x3ab685,_0x33ee68){return respondWithRpcPromise(_0xe912('0x4e'),_0x3ab685[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x33ee68,null))[_0xe912('0xb')](handleError(_0x33ee68,null));};exports[_0xe912('0x4f')]=function(_0x44d2ba,_0x57de72){return respondWithRpcPromise(_0xe912('0x50'),_0x44d2ba[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x57de72,null))['catch'](handleError(_0x57de72,null));};exports[_0xe912('0x51')]=function(_0x3950cf,_0x5e7883){return respondWithRpcPromise(_0xe912('0x52'),_0x3950cf[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x5e7883,null))[_0xe912('0xb')](handleError(_0x5e7883,null));};exports[_0xe912('0x53')]=function(_0x27a821,_0x3715f0){return respondWithRpcPromise(_0xe912('0x54'),_0x27a821[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x3715f0,null))[_0xe912('0xb')](handleError(_0x3715f0,null));};exports[_0xe912('0x55')]=function(_0x12c00f,_0x401e40){return respondWithRpcPromise(_0xe912('0x56'),_0x12c00f[_0xe912('0x15')],routingClient)[_0xe912('0x7')](respondWithResult(_0x401e40,null))['catch'](handleError(_0x401e40,null));};exports[_0xe912('0x57')]=function(_0x25db75){return function(_0x316445,_0x2088e0){var _0x40d0b3,_0x5dc705;var _0x36b01f=_[_0xe912('0x58')](_0x25db75);var _0x22051d=_0x25db75===_0xe912('0x59')?_0xe912('0x5a'):_0xe912('0x5b');return db[_0x36b01f+_0xe912('0x5c')]['findOne']({'raw':!![],'where':{'id':_0x316445[_0xe912('0x19')]['id']}})[_0xe912('0x7')](function(_0x4844ef){if(_[_0xe912('0x10')](_0x4844ef)){throw new Error(_0x36b01f+_0xe912('0x5d'));}_0x40d0b3=_0x4844ef;return db[_0x36b01f+'Message'][_0xe912('0x5e')]({'where':{'id':_0x316445['body'][_0xe912('0x5f')]},'include':[{'model':db[_0x36b01f+_0xe912('0x60')],'as':_0xe912('0x60')},{'model':db[_0x36b01f+_0x22051d],'as':_0xe912('0x5b')}]});})['then'](function(_0x524b97){if(_[_0xe912('0x10')](_0x524b97)){throw new Error(_0x36b01f+_0xe912('0x61'));}_0x5dc705=_0x524b97;return _0x524b97[_0xe912('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe912('0x7')](function(){var _0xb83669={'uniqueid':_0x25db75+'.'+_0x5dc705['id']+'.'+_0x5dc705[_0xe912('0x60')]['id'],'FromUserId':_0x316445['user']['id'],'type':'queue'};_0xb83669[_0x36b01f+_0xe912('0x63')]=_0x5dc705['id'];_0xb83669[_0x36b01f+_0xe912('0x64')]=_0x5dc705[_0xe912('0x60')]['id'];_0xb83669['From'+_0x36b01f+_0x22051d+'Id']=_0x5dc705['Account']['id'];_0xb83669['To'+_0x36b01f+'QueueId']=_0x40d0b3['id'];return db[_0x36b01f+_0xe912('0x65')][_0xe912('0x66')](_0xb83669);})[_0xe912('0x7')](function(){return respondWithRpcPromise(_0xe912('0x67'),{'channel':_0x25db75,'interaction':_0x5dc705[_0xe912('0x60')],'message':_0x5dc705,'account':_0x5dc705[_0xe912('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x40d0b3[_0xe912('0x2e')]+','+(_0x5dc705['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe912('0x7')](respondWithResult(_0x2088e0,null))[_0xe912('0xb')](handleError(_0x2088e0,null));};};exports[_0xe912('0x68')]=function(_0x1fe30f,_0x3731b3){var _0x3896bc,_0x3a4c4e;if(_['isNil'](_0x1fe30f[_0xe912('0x2c')][_0xe912('0x69')])){throw new Error(_0xe912('0x6a'));}var _0x122b16=_0x1fe30f[_0xe912('0x2c')][_0xe912('0x69')];var _0x10f1b7=_[_0xe912('0x58')](_0x122b16);var _0x5e6728=_0x122b16===_0xe912('0x59')?_0xe912('0x5a'):_0xe912('0x5b');return db[_0xe912('0x6b')][_0xe912('0x5e')]({'raw':!![],'where':{'id':_0x1fe30f[_0xe912('0x19')]['id'],'role':'agent'}})[_0xe912('0x7')](function(_0x31a893){if(_[_0xe912('0x10')](_0x31a893)){throw new Error(_0xe912('0x6c'));}_0x3896bc=_0x31a893;return db[_0x10f1b7+_0xe912('0x6d')][_0xe912('0x5e')]({'where':{'id':_0x1fe30f[_0xe912('0x2c')]['messageId']},'include':[{'model':db[_0x10f1b7+_0xe912('0x60')],'as':'Interaction'},{'model':db[_0x10f1b7+_0x5e6728],'as':_0xe912('0x5b')}]});})[_0xe912('0x7')](function(_0x68cbe0){if(_['isNil'](_0x68cbe0)){throw new Error(_0x10f1b7+_0xe912('0x61'));}_0x3a4c4e=_0x68cbe0;return _0x68cbe0[_0xe912('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe912('0x7')](function(){var _0x412e3b={'uniqueid':_0x122b16+'.'+_0x3a4c4e['id']+'.'+_0x3a4c4e['Interaction']['id'],'FromUserId':_0x1fe30f['user']['id'],'type':'queue','ToUserId':_0x3896bc['id']};_0x412e3b[_0x10f1b7+_0xe912('0x63')]=_0x3a4c4e['id'];_0x412e3b[_0x10f1b7+_0xe912('0x64')]=_0x3a4c4e['Interaction']['id'];_0x412e3b[_0xe912('0x6e')+_0x10f1b7+_0x5e6728+'Id']=_0x3a4c4e[_0xe912('0x5b')]['id'];return db[_0x10f1b7+_0xe912('0x65')][_0xe912('0x66')](_0x412e3b);})['then'](function(){return respondWithRpcPromise(_0xe912('0x67'),{'channel':_0x122b16,'interaction':_0x3a4c4e[_0xe912('0x60')],'message':_0x3a4c4e,'account':_0x3a4c4e[_0xe912('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe912('0x3b'),'appdata':_0x3896bc[_0xe912('0x2e')]+','+(_0x3a4c4e[_0xe912('0x5b')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x3731b3,null))[_0xe912('0xb')](handleError(_0x3731b3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 445926f..c70f20d 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 _0x2d5f=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put'];(function(_0x57dbc6,_0x40eaf0){var _0x362494=function(_0x4f6226){while(--_0x4f6226){_0x57dbc6['push'](_0x57dbc6['shift']());}};_0x362494(++_0x40eaf0);}(_0x2d5f,0xc9));var _0xf2d5=function(_0x5d5979,_0x3b4921){_0x5d5979=_0x5d5979-0x0;var _0x237182=_0x2d5f[_0x5d5979];return _0x237182;};'use strict';var multer=require(_0xf2d5('0x0'));var util=require(_0xf2d5('0x1'));var path=require(_0xf2d5('0x2'));var timeout=require(_0xf2d5('0x3'));var express=require('express');var router=express[_0xf2d5('0x4')]();var auth=require(_0xf2d5('0x5'));var interaction=require(_0xf2d5('0x6'));var config=require(_0xf2d5('0x7'));var controller=require(_0xf2d5('0x8'));router[_0xf2d5('0x9')]('/',auth[_0xf2d5('0xa')](),controller[_0xf2d5('0xb')]);router['get'](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0xd')]);router[_0xf2d5('0x9')](_0xf2d5('0xe'),auth['isAuthenticated'](),controller[_0xf2d5('0xf')]);router[_0xf2d5('0x10')]('/',auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x11')]);router[_0xf2d5('0x12')](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x13')]);router[_0xf2d5('0x14')](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0594=['delete','exports','multer','express','Router','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update'];(function(_0x4e18f8,_0x2c4615){var _0x767833=function(_0x5ae39d){while(--_0x5ae39d){_0x4e18f8['push'](_0x4e18f8['shift']());}};_0x767833(++_0x2c4615);}(_0x0594,0x112));var _0x4059=function(_0x42f5ee,_0x1e7c45){_0x42f5ee=_0x42f5ee-0x0;var _0x55b4ba=_0x0594[_0x42f5ee];return _0x55b4ba;};'use strict';var multer=require(_0x4059('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4059('0x1'));var router=express[_0x4059('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x4059('0x3'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x4059('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4059('0x4')](_0x4059('0x5'),auth[_0x4059('0x6')](),controller[_0x4059('0x7')]);router[_0x4059('0x4')](_0x4059('0x8'),auth[_0x4059('0x6')](),controller[_0x4059('0x9')]);router[_0x4059('0xa')]('/',auth[_0x4059('0x6')](),controller[_0x4059('0xb')]);router[_0x4059('0xc')](_0x4059('0x5'),auth['isAuthenticated'](),controller[_0x4059('0xd')]);router[_0x4059('0xe')](_0x4059('0x5'),auth[_0x4059('0x6')](),controller['destroy']);module[_0x4059('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6f9fe6e..4b6ed90 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 _0xa733=['BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','days','csv','xlsx','custom','default','TEXT','sequelize','exports'];(function(_0x37990d,_0x49b50e){var _0x46853d=function(_0x297f51){while(--_0x297f51){_0x37990d['push'](_0x37990d['shift']());}};_0x46853d(++_0x49b50e);}(_0xa733,0xdf));var _0x3a73=function(_0x33cbd4,_0x1162b2){_0x33cbd4=_0x33cbd4-0x0;var _0x1ce746=_0xa733[_0x33cbd4];return _0x1ce746;};'use strict';var Sequelize=require(_0x3a73('0x0'));module[_0x3a73('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3a73('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3a73('0x3')],'allowNull':![],'defaultValue':_0x3a73('0x4')},'startAt':{'type':Sequelize[_0x3a73('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3a73('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3a73('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3a73('0x7'),'quarters',_0x3a73('0x8'),'weeks',_0x3a73('0x9'),'hours','minutes'),'allowNull':![],'defaultValue':_0x3a73('0x9')},'output':{'type':Sequelize['ENUM'](_0x3a73('0xa'),'pdf',_0x3a73('0xb')),'allowNull':![],'defaultValue':_0x3a73('0xa')},'type':{'type':Sequelize['ENUM'](_0x3a73('0xc'),_0x3a73('0xd')),'allowNull':![],'defaultValue':_0x3a73('0xc')},'sendMail':{'type':Sequelize[_0x3a73('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3a73('0x3')]},'cc':{'type':Sequelize[_0x3a73('0xe')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x3a73('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9afb=['xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv','pdf'];(function(_0x363e6c,_0x17ff9c){var _0x30f48a=function(_0x166b2e){while(--_0x166b2e){_0x363e6c['push'](_0x363e6c['shift']());}};_0x30f48a(++_0x17ff9c);}(_0x9afb,0x130));var _0xb9af=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x9afb[_0x135a1c];return _0x295c98;};'use strict';var Sequelize=require(_0xb9af('0x0'));module[_0xb9af('0x1')]={'name':{'type':Sequelize[_0xb9af('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb9af('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb9af('0x4')},'startAt':{'type':Sequelize[_0xb9af('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb9af('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb9af('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb9af('0x7')](_0xb9af('0x8'),_0xb9af('0x9'),_0xb9af('0xa'),_0xb9af('0xb'),_0xb9af('0xc'),_0xb9af('0xd'),'minutes'),'allowNull':![],'defaultValue':_0xb9af('0xc')},'output':{'type':Sequelize[_0xb9af('0x7')](_0xb9af('0xe'),_0xb9af('0xf'),_0xb9af('0x10')),'allowNull':![],'defaultValue':_0xb9af('0xe')},'type':{'type':Sequelize['ENUM'](_0xb9af('0x11'),_0xb9af('0x12')),'allowNull':![],'defaultValue':_0xb9af('0x11')},'sendMail':{'type':Sequelize[_0xb9af('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xb9af('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xb9af('0x13')]},'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 3875f8a..b2b4d80 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 _0x18c8=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','includeAll','include','Schedule','findAll','catch','show','params','find'];(function(_0x231055,_0x310bae){var _0x1a33fa=function(_0x3550a2){while(--_0x3550a2){_0x231055['push'](_0x231055['shift']());}};_0x1a33fa(++_0x310bae);}(_0x18c8,0x194));var _0x818c=function(_0x656edd,_0x4b9be1){_0x656edd=_0x656edd-0x0;var _0x101389=_0x18c8[_0x656edd];return _0x101389;};'use strict';var pdf=require(_0x818c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x818c('0x1'));var zipdir=require(_0x818c('0x2'));var jsonpatch=require(_0x818c('0x3'));var rp=require(_0x818c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x818c('0x5'));var path=require(_0x818c('0x6'));var sox=require(_0x818c('0x7'));var csv=require(_0x818c('0x8'));var ejs=require(_0x818c('0x9'));var fs=require('fs');var _=require(_0x818c('0xa'));var squel=require(_0x818c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x818c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x818c('0xd'));var Redis=require(_0x818c('0xe'));var authService=require(_0x818c('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x818c('0x10'));var logger=require(_0x818c('0x11'))(_0x818c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x818c('0x13'))['db'];function respondWithStatusCode(_0x20ba68,_0x221542){_0x221542=_0x221542||0xcc;return function(_0x2e0c3b){if(_0x2e0c3b){return _0x20ba68[_0x818c('0x14')](_0x221542);}return _0x20ba68[_0x818c('0x15')](_0x221542)['end']();};}function respondWithResult(_0x3da613,_0x1fb9ce){_0x1fb9ce=_0x1fb9ce||0xc8;return function(_0x707a81){if(_0x707a81){return _0x3da613[_0x818c('0x15')](_0x1fb9ce)[_0x818c('0x16')](_0x707a81);}};}function respondWithFilteredResult(_0x1ac660,_0x39d600){return function(_0x151943){if(_0x151943){var _0x45a167=_0x151943[_0x818c('0x17')],_0x5f1842=_0x39d600['offset'],_0xae557c=_0x39d600['offset']+_0x39d600[_0x818c('0x18')],_0x45b530;if(_0xae557c>=_0x45a167){_0xae557c=_0x45a167;_0x45b530=0xc8;}else{_0x45b530=0xce;}_0x1ac660[_0x818c('0x15')](_0x45b530);return _0x1ac660[_0x818c('0x19')](_0x818c('0x1a'),_0x5f1842+'-'+_0xae557c+'/'+_0x45a167)[_0x818c('0x16')](_0x151943);}return null;};}function patchUpdates(_0x516320){return function(_0x230e36){try{jsonpatch[_0x818c('0x1b')](_0x230e36,_0x516320,!![]);}catch(_0x46a875){return BPromise['reject'](_0x46a875);}return _0x230e36['save']();};}function saveUpdates(_0x54a404,_0xf56ae5){return function(_0x55dd17){if(_0x55dd17){return _0x55dd17[_0x818c('0x1c')](_0x54a404)[_0x818c('0x1d')](function(_0x2892ef){return _0x2892ef;});}return null;};}function removeEntity(_0xb067d7,_0x268efd){return function(_0x55c0c6){if(_0x55c0c6){return _0x55c0c6[_0x818c('0x1e')]()[_0x818c('0x1d')](function(){var _0xb425bf=_0x55c0c6[_0x818c('0x1f')]({'plain':!![]});var _0x54ed74=_0x818c('0x20');return db[_0x818c('0x21')][_0x818c('0x1e')]({'where':{'type':_0x54ed74,'resourceId':_0xb425bf['id']}})[_0x818c('0x1d')](function(){return _0x55c0c6;});})[_0x818c('0x1d')](function(){_0xb067d7['status'](0xcc)[_0x818c('0x22')]();});}};}function handleEntityNotFound(_0x4e9a71,_0x294581){return function(_0xc13300){if(!_0xc13300){_0x4e9a71[_0x818c('0x14')](0x194);}return _0xc13300;};}function handleError(_0x215a6d,_0x42951b){_0x42951b=_0x42951b||0x1f4;return function(_0x2a72fa){logger[_0x818c('0x23')](_0x2a72fa[_0x818c('0x24')]);if(_0x2a72fa[_0x818c('0x25')]){delete _0x2a72fa[_0x818c('0x25')];}_0x215a6d[_0x818c('0x15')](_0x42951b)[_0x818c('0x26')](_0x2a72fa);};}exports[_0x818c('0x27')]=function(_0x44eb44,_0x2c6baf){var _0x2ccd07={},_0x981931={},_0x5bb667={'count':0x0,'rows':[]};var _0x508167=db['Schedule'][_0x818c('0x28')];_0x981931['model']=_[_0x818c('0x29')](_0x508167);_0x981931[_0x818c('0x2a')]=_[_0x818c('0x29')](_0x44eb44[_0x818c('0x2a')]);_0x981931[_0x818c('0x2b')]=_[_0x818c('0x2c')](_0x981931[_0x818c('0x2d')],_0x981931[_0x818c('0x2a')]);_0x2ccd07[_0x818c('0x2e')]=_[_0x818c('0x2c')](_0x981931[_0x818c('0x2d')],qs[_0x818c('0x2f')](_0x44eb44['query']['fields']));_0x2ccd07[_0x818c('0x2e')]=_0x2ccd07[_0x818c('0x2e')][_0x818c('0x30')]?_0x2ccd07[_0x818c('0x2e')]:_0x981931[_0x818c('0x2d')];if(!_0x44eb44[_0x818c('0x2a')][_0x818c('0x31')](_0x818c('0x32'))){_0x2ccd07[_0x818c('0x18')]=qs['limit'](_0x44eb44['query']['limit']);_0x2ccd07[_0x818c('0x33')]=qs[_0x818c('0x33')](_0x44eb44[_0x818c('0x2a')][_0x818c('0x33')]);}_0x2ccd07[_0x818c('0x34')]=qs[_0x818c('0x35')](_0x44eb44[_0x818c('0x2a')]['sort']);_0x2ccd07[_0x818c('0x36')]=qs[_0x818c('0x2b')](_[_0x818c('0x37')](_0x44eb44[_0x818c('0x2a')],_0x981931[_0x818c('0x2b')]));if(_0x44eb44[_0x818c('0x2a')][_0x818c('0x38')]){_0x2ccd07['where']=_['merge'](_0x2ccd07[_0x818c('0x36')],{'$or':_[_0x818c('0x39')](_0x508167,function(_0x354707){if(_0x354707['type'][_0x818c('0x3a')]!==_0x818c('0x3b')){var _0x3a4bb0={};_0x3a4bb0[_0x354707['field']]={'$like':'%'+_0x44eb44[_0x818c('0x2a')]['filter']+'%'};return _0x3a4bb0;}})});}_0x2ccd07=_[_0x818c('0x3c')]({},_0x2ccd07,_0x44eb44[_0x818c('0x3d')]);var _0x20f79d={'where':_0x2ccd07[_0x818c('0x36')]};return db['Schedule'][_0x818c('0x17')](_0x20f79d)[_0x818c('0x1d')](function(_0x4e3d9a){_0x5bb667[_0x818c('0x17')]=_0x4e3d9a;if(_0x44eb44[_0x818c('0x2a')][_0x818c('0x3e')]){_0x2ccd07[_0x818c('0x3f')]=[{'all':!![]}];}return db[_0x818c('0x40')][_0x818c('0x41')](_0x2ccd07);})[_0x818c('0x1d')](function(_0x35ac4a){_0x5bb667['rows']=_0x35ac4a;return _0x5bb667;})['then'](respondWithFilteredResult(_0x2c6baf,_0x2ccd07))[_0x818c('0x42')](handleError(_0x2c6baf,null));};exports[_0x818c('0x43')]=function(_0x423c94,_0x5f3692){var _0x3e4745={'raw':![],'where':{'id':_0x423c94[_0x818c('0x44')]['id']}},_0x12968a={};_0x12968a['model']=_['keys'](db[_0x818c('0x40')]['rawAttributes']);_0x12968a[_0x818c('0x2a')]=_[_0x818c('0x29')](_0x423c94[_0x818c('0x2a')]);_0x12968a[_0x818c('0x2b')]=_['intersection'](_0x12968a[_0x818c('0x2d')],_0x12968a[_0x818c('0x2a')]);_0x3e4745[_0x818c('0x2e')]=_[_0x818c('0x2c')](_0x12968a[_0x818c('0x2d')],qs['fields'](_0x423c94[_0x818c('0x2a')][_0x818c('0x2f')]));_0x3e4745['attributes']=_0x3e4745[_0x818c('0x2e')]['length']?_0x3e4745[_0x818c('0x2e')]:_0x12968a['model'];if(_0x423c94[_0x818c('0x2a')][_0x818c('0x3e')]){_0x3e4745[_0x818c('0x3f')]=[{'all':!![]}];}_0x3e4745=_[_0x818c('0x3c')]({},_0x3e4745,_0x423c94[_0x818c('0x3d')]);return db[_0x818c('0x40')][_0x818c('0x45')](_0x3e4745)[_0x818c('0x1d')](handleEntityNotFound(_0x5f3692,null))[_0x818c('0x1d')](respondWithResult(_0x5f3692,null))[_0x818c('0x42')](handleError(_0x5f3692,null));};exports[_0x818c('0x46')]=function(_0x349718,_0x143947){return db[_0x818c('0x40')][_0x818c('0x46')](_0x349718[_0x818c('0x47')],{})[_0x818c('0x1d')](function(_0x10ea76){var _0x3c6fd4=_0x349718[_0x818c('0x48')][_0x818c('0x1f')]({'plain':!![]});if(!_0x3c6fd4)throw new Error(_0x818c('0x49'));if(_0x3c6fd4[_0x818c('0x4a')]===_0x818c('0x48')){var _0x58c8dd=_0x10ea76[_0x818c('0x1f')]({'plain':!![]});var _0x207106=_0x818c('0x20');return db['UserProfileSection'][_0x818c('0x45')]({'where':{'name':_0x207106,'userProfileId':_0x3c6fd4[_0x818c('0x4b')]},'raw':!![]})[_0x818c('0x1d')](function(_0x26b318){if(_0x26b318&&_0x26b318[_0x818c('0x4c')]===0x0){return db[_0x818c('0x21')][_0x818c('0x46')]({'name':_0x58c8dd['name'],'resourceId':_0x58c8dd['id'],'type':_0x26b318[_0x818c('0x25')],'sectionId':_0x26b318['id']},{})[_0x818c('0x1d')](function(){return _0x10ea76;});}else{return _0x10ea76;}})[_0x818c('0x42')](function(_0x60e24e){logger[_0x818c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x60e24e);throw _0x60e24e;});}return _0x10ea76;})[_0x818c('0x1d')](respondWithResult(_0x143947,0xc9))[_0x818c('0x42')](handleError(_0x143947,null));};exports['update']=function(_0x38ed75,_0x1b485a){if(_0x38ed75[_0x818c('0x47')]['id']){delete _0x38ed75['body']['id'];}return db[_0x818c('0x40')]['find']({'where':{'id':_0x38ed75[_0x818c('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b485a,null))['then'](saveUpdates(_0x38ed75[_0x818c('0x47')],null))[_0x818c('0x1d')](respondWithResult(_0x1b485a,null))['catch'](handleError(_0x1b485a,null));};exports[_0x818c('0x1e')]=function(_0x1952e4,_0x3893b5){return db[_0x818c('0x40')][_0x818c('0x45')]({'where':{'id':_0x1952e4[_0x818c('0x44')]['id']}})[_0x818c('0x1d')](handleEntityNotFound(_0x3893b5,null))[_0x818c('0x1d')](removeEntity(_0x3893b5,null))[_0x818c('0x42')](handleError(_0x3893b5,null));};exports[_0x818c('0x4d')]=function(_0x50b92b,_0x376642,_0x4c6ab7){var _0x363441=require(_0x818c('0x4e'));return db[_0x818c('0x40')][_0x818c('0x45')]({'where':{'id':_0x50b92b[_0x818c('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x376642,null))[_0x818c('0x1d')](function(){_0x363441[_0x818c('0x4d')](_0x50b92b[_0x818c('0x44')]['id']);})['then'](respondWithStatusCode(_0x376642,null))[_0x818c('0x42')](handleError(_0x376642,null));}; \ No newline at end of file +var _0x397f=['field','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','end','sendStatus','stack','name','send','index','Schedule','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL'];(function(_0xa9a28e,_0x2f74d2){var _0x1dc04c=function(_0x59d770){while(--_0x59d770){_0xa9a28e['push'](_0xa9a28e['shift']());}};_0x1dc04c(++_0x2f74d2);}(_0x397f,0x11d));var _0xf397=function(_0x407bac,_0x556c3f){_0x407bac=_0x407bac-0x0;var _0x133a07=_0x397f[_0x407bac];return _0x133a07;};'use strict';var pdf=require(_0xf397('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf397('0x1'));var zipdir=require(_0xf397('0x2'));var jsonpatch=require(_0xf397('0x3'));var rp=require(_0xf397('0x4'));var moment=require('moment');var BPromise=require(_0xf397('0x5'));var Mustache=require(_0xf397('0x6'));var util=require(_0xf397('0x7'));var path=require(_0xf397('0x8'));var sox=require('sox');var csv=require(_0xf397('0x9'));var ejs=require(_0xf397('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf397('0xb'));var crypto=require(_0xf397('0xc'));var jsforce=require(_0xf397('0xd'));var deskjs=require(_0xf397('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf397('0xf'));var Redis=require(_0xf397('0x10'));var authService=require(_0xf397('0x11'));var qs=require(_0xf397('0x12'));var hardwareService=require(_0xf397('0x13'));var logger=require(_0xf397('0x14'))(_0xf397('0x15'));var utils=require(_0xf397('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21b459,_0x1c1ea8){_0x1c1ea8=_0x1c1ea8||0xcc;return function(_0x5957db){if(_0x5957db){return _0x21b459['sendStatus'](_0x1c1ea8);}return _0x21b459[_0xf397('0x17')](_0x1c1ea8)['end']();};}function respondWithResult(_0x212ec1,_0x421df3){_0x421df3=_0x421df3||0xc8;return function(_0x562aba){if(_0x562aba){return _0x212ec1[_0xf397('0x17')](_0x421df3)[_0xf397('0x18')](_0x562aba);}};}function respondWithFilteredResult(_0x11e8d5,_0x4e3f6a){return function(_0x5cf555){if(_0x5cf555){var _0x143dc0=_0x5cf555['count'],_0xafd5e1=_0x4e3f6a[_0xf397('0x19')],_0x479cb9=_0x4e3f6a['offset']+_0x4e3f6a[_0xf397('0x1a')],_0x139611;if(_0x479cb9>=_0x143dc0){_0x479cb9=_0x143dc0;_0x139611=0xc8;}else{_0x139611=0xce;}_0x11e8d5['status'](_0x139611);return _0x11e8d5[_0xf397('0x1b')](_0xf397('0x1c'),_0xafd5e1+'-'+_0x479cb9+'/'+_0x143dc0)['json'](_0x5cf555);}return null;};}function patchUpdates(_0x33ca74){return function(_0x5363f0){try{jsonpatch[_0xf397('0x1d')](_0x5363f0,_0x33ca74,!![]);}catch(_0x66a78){return BPromise[_0xf397('0x1e')](_0x66a78);}return _0x5363f0[_0xf397('0x1f')]();};}function saveUpdates(_0x453bc8,_0x34e0d8){return function(_0x4b85ce){if(_0x4b85ce){return _0x4b85ce[_0xf397('0x20')](_0x453bc8)[_0xf397('0x21')](function(_0x2ec5b0){return _0x2ec5b0;});}return null;};}function removeEntity(_0x4bb7d0,_0xdd0ded){return function(_0x3cda2c){if(_0x3cda2c){return _0x3cda2c[_0xf397('0x22')]()[_0xf397('0x21')](function(){var _0x214e4e=_0x3cda2c[_0xf397('0x23')]({'plain':!![]});var _0x5a0e83=_0xf397('0x24');return db['UserProfileResource'][_0xf397('0x22')]({'where':{'type':_0x5a0e83,'resourceId':_0x214e4e['id']}})['then'](function(){return _0x3cda2c;});})['then'](function(){_0x4bb7d0['status'](0xcc)[_0xf397('0x25')]();});}};}function handleEntityNotFound(_0x4e6980,_0x57bfea){return function(_0x1bc649){if(!_0x1bc649){_0x4e6980[_0xf397('0x26')](0x194);}return _0x1bc649;};}function handleError(_0xcbc09b,_0x2c553a){_0x2c553a=_0x2c553a||0x1f4;return function(_0x3d17f6){logger['error'](_0x3d17f6[_0xf397('0x27')]);if(_0x3d17f6[_0xf397('0x28')]){delete _0x3d17f6[_0xf397('0x28')];}_0xcbc09b[_0xf397('0x17')](_0x2c553a)[_0xf397('0x29')](_0x3d17f6);};}exports[_0xf397('0x2a')]=function(_0x3a7a3d,_0x10fff1){var _0x2d0209={},_0x173285={},_0x4c728e={'count':0x0,'rows':[]};var _0x5c02b8=db[_0xf397('0x2b')][_0xf397('0x2c')];_0x173285[_0xf397('0x2d')]=_['keys'](_0x5c02b8);_0x173285[_0xf397('0x2e')]=_[_0xf397('0x2f')](_0x3a7a3d[_0xf397('0x2e')]);_0x173285[_0xf397('0x30')]=_['intersection'](_0x173285['model'],_0x173285['query']);_0x2d0209[_0xf397('0x31')]=_[_0xf397('0x32')](_0x173285[_0xf397('0x2d')],qs[_0xf397('0x33')](_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x33')]));_0x2d0209[_0xf397('0x31')]=_0x2d0209['attributes'][_0xf397('0x34')]?_0x2d0209['attributes']:_0x173285[_0xf397('0x2d')];if(!_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x35')](_0xf397('0x36'))){_0x2d0209['limit']=qs[_0xf397('0x1a')](_0x3a7a3d['query'][_0xf397('0x1a')]);_0x2d0209['offset']=qs['offset'](_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x19')]);}_0x2d0209[_0xf397('0x37')]=qs[_0xf397('0x38')](_0x3a7a3d[_0xf397('0x2e')]['sort']);_0x2d0209[_0xf397('0x39')]=qs[_0xf397('0x30')](_[_0xf397('0x3a')](_0x3a7a3d[_0xf397('0x2e')],_0x173285[_0xf397('0x30')]));if(_0x3a7a3d[_0xf397('0x2e')][_0xf397('0x3b')]){_0x2d0209[_0xf397('0x39')]=_['merge'](_0x2d0209[_0xf397('0x39')],{'$or':_[_0xf397('0x3c')](_0x5c02b8,function(_0x408413){if(_0x408413[_0xf397('0x3d')]['key']!==_0xf397('0x3e')){var _0x4cdc9c={};_0x4cdc9c[_0x408413[_0xf397('0x3f')]]={'$like':'%'+_0x3a7a3d['query'][_0xf397('0x3b')]+'%'};return _0x4cdc9c;}})});}_0x2d0209=_[_0xf397('0x40')]({},_0x2d0209,_0x3a7a3d[_0xf397('0x41')]);var _0x22429d={'where':_0x2d0209['where']};return db[_0xf397('0x2b')][_0xf397('0x42')](_0x22429d)['then'](function(_0x29630a){_0x4c728e[_0xf397('0x42')]=_0x29630a;if(_0x3a7a3d[_0xf397('0x2e')]['includeAll']){_0x2d0209[_0xf397('0x43')]=[{'all':!![]}];}return db[_0xf397('0x2b')][_0xf397('0x44')](_0x2d0209);})[_0xf397('0x21')](function(_0x412e42){_0x4c728e[_0xf397('0x45')]=_0x412e42;return _0x4c728e;})[_0xf397('0x21')](respondWithFilteredResult(_0x10fff1,_0x2d0209))[_0xf397('0x46')](handleError(_0x10fff1,null));};exports[_0xf397('0x47')]=function(_0x3bf244,_0x2076b9){var _0x407ea0={'raw':![],'where':{'id':_0x3bf244[_0xf397('0x48')]['id']}},_0x2171bb={};_0x2171bb[_0xf397('0x2d')]=_['keys'](db['Schedule'][_0xf397('0x2c')]);_0x2171bb[_0xf397('0x2e')]=_[_0xf397('0x2f')](_0x3bf244[_0xf397('0x2e')]);_0x2171bb[_0xf397('0x30')]=_[_0xf397('0x32')](_0x2171bb[_0xf397('0x2d')],_0x2171bb[_0xf397('0x2e')]);_0x407ea0[_0xf397('0x31')]=_[_0xf397('0x32')](_0x2171bb[_0xf397('0x2d')],qs[_0xf397('0x33')](_0x3bf244['query'][_0xf397('0x33')]));_0x407ea0[_0xf397('0x31')]=_0x407ea0[_0xf397('0x31')][_0xf397('0x34')]?_0x407ea0['attributes']:_0x2171bb[_0xf397('0x2d')];if(_0x3bf244[_0xf397('0x2e')][_0xf397('0x49')]){_0x407ea0[_0xf397('0x43')]=[{'all':!![]}];}_0x407ea0=_['merge']({},_0x407ea0,_0x3bf244[_0xf397('0x41')]);return db[_0xf397('0x2b')][_0xf397('0x4a')](_0x407ea0)[_0xf397('0x21')](handleEntityNotFound(_0x2076b9,null))[_0xf397('0x21')](respondWithResult(_0x2076b9,null))['catch'](handleError(_0x2076b9,null));};exports[_0xf397('0x4b')]=function(_0x2677c2,_0x5c29cd){return db[_0xf397('0x2b')][_0xf397('0x4b')](_0x2677c2[_0xf397('0x4c')],{})['then'](function(_0x226721){var _0x377db8=_0x2677c2[_0xf397('0x4d')]['get']({'plain':!![]});if(!_0x377db8)throw new Error(_0xf397('0x4e'));if(_0x377db8[_0xf397('0x4f')]===_0xf397('0x4d')){var _0x259cb6=_0x226721[_0xf397('0x23')]({'plain':!![]});var _0x337c52=_0xf397('0x24');return db[_0xf397('0x50')][_0xf397('0x4a')]({'where':{'name':_0x337c52,'userProfileId':_0x377db8[_0xf397('0x51')]},'raw':!![]})[_0xf397('0x21')](function(_0x5048be){if(_0x5048be&&_0x5048be[_0xf397('0x52')]===0x0){return db[_0xf397('0x53')][_0xf397('0x4b')]({'name':_0x259cb6[_0xf397('0x28')],'resourceId':_0x259cb6['id'],'type':_0x5048be[_0xf397('0x28')],'sectionId':_0x5048be['id']},{})[_0xf397('0x21')](function(){return _0x226721;});}else{return _0x226721;}})[_0xf397('0x46')](function(_0x238c68){logger[_0xf397('0x54')](_0xf397('0x55'),_0x238c68);throw _0x238c68;});}return _0x226721;})[_0xf397('0x21')](respondWithResult(_0x5c29cd,0xc9))[_0xf397('0x46')](handleError(_0x5c29cd,null));};exports[_0xf397('0x20')]=function(_0x489e38,_0xbda52a){if(_0x489e38['body']['id']){delete _0x489e38['body']['id'];}return db[_0xf397('0x2b')][_0xf397('0x4a')]({'where':{'id':_0x489e38[_0xf397('0x48')]['id']}})[_0xf397('0x21')](handleEntityNotFound(_0xbda52a,null))[_0xf397('0x21')](saveUpdates(_0x489e38[_0xf397('0x4c')],null))[_0xf397('0x21')](respondWithResult(_0xbda52a,null))[_0xf397('0x46')](handleError(_0xbda52a,null));};exports[_0xf397('0x22')]=function(_0x5273da,_0x5d06d4){return db['Schedule'][_0xf397('0x4a')]({'where':{'id':_0x5273da[_0xf397('0x48')]['id']}})[_0xf397('0x21')](handleEntityNotFound(_0x5d06d4,null))[_0xf397('0x21')](removeEntity(_0x5d06d4,null))[_0xf397('0x46')](handleError(_0x5d06d4,null));};exports['run']=function(_0xa75d6e,_0x20ef64,_0x5ced03){var _0x3f4b7b=require(_0xf397('0x56'));return db[_0xf397('0x2b')][_0xf397('0x4a')]({'where':{'id':_0xa75d6e[_0xf397('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x20ef64,null))[_0xf397('0x21')](function(){_0x3f4b7b['run'](_0xa75d6e[_0xf397('0x48')]['id']);})['then'](respondWithStatusCode(_0x20ef64,null))['catch'](handleError(_0x20ef64,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f6ea46f..c2ede58 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 _0x53e2=['api','moment','request-promise','path','../../config/environment','define','Schedule','lodash','util','../../config/logger'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x53e2,0x1c9));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x253e('0x0'));var util=require(_0x253e('0x1'));var logger=require(_0x253e('0x2'))(_0x253e('0x3'));var moment=require(_0x253e('0x4'));var BPromise=require('bluebird');var rp=require(_0x253e('0x5'));var fs=require('fs');var path=require(_0x253e('0x6'));var rimraf=require('rimraf');var config=require(_0x253e('0x7'));var attributes=require('./schedule.attributes');module['exports']=function(_0x5515ba,_0x273e85){return _0x5515ba[_0x253e('0x8')](_0x253e('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c5b=['Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define'];(function(_0x4ed7c6,_0x4715fe){var _0x18a7e4=function(_0xfb57b0){while(--_0xfb57b0){_0x4ed7c6['push'](_0x4ed7c6['shift']());}};_0x18a7e4(++_0x4715fe);}(_0x2c5b,0xd2));var _0xb2c5=function(_0x20fb9e,_0x5f66bb){_0x20fb9e=_0x20fb9e-0x0;var _0x19b17a=_0x2c5b[_0x20fb9e];return _0x19b17a;};'use strict';var _=require('lodash');var util=require(_0xb2c5('0x0'));var logger=require(_0xb2c5('0x1'))(_0xb2c5('0x2'));var moment=require(_0xb2c5('0x3'));var BPromise=require(_0xb2c5('0x4'));var rp=require(_0xb2c5('0x5'));var fs=require('fs');var path=require(_0xb2c5('0x6'));var rimraf=require(_0xb2c5('0x7'));var config=require('../../config/environment');var attributes=require(_0xb2c5('0x8'));module[_0xb2c5('0x9')]=function(_0x1d7470,_0xad49b8){return _0x1d7470[_0xb2c5('0xa')](_0xb2c5('0xb'),attributes,{'tableName':_0xb2c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 584cd5a..7a6e0b3 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 _0x641a=['error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x641a,0x1d4));var _0xa641=function(_0x23ea67,_0x4774c3){_0x23ea67=_0x23ea67-0x0;var _0x234ff6=_0x641a[_0x23ea67];return _0x234ff6;};'use strict';var _=require(_0xa641('0x0'));var util=require(_0xa641('0x1'));var moment=require(_0xa641('0x2'));var BPromise=require('bluebird');var rs=require(_0xa641('0x3'));var fs=require('fs');var Redis=require(_0xa641('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa641('0x5'));var config=require('../../config/environment');var jayson=require(_0xa641('0x6'));var client=jayson[_0xa641('0x7')][_0xa641('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x471a6f,_0x57d154,_0x4391a3){return new BPromise(function(_0x2077c8,_0x5cd83c){return client[_0xa641('0x9')](_0x471a6f,_0x4391a3)[_0xa641('0xa')](function(_0x4d6a23){logger[_0xa641('0xb')]('Schedule,\x20%s,\x20%s',_0x57d154,_0xa641('0xc'));logger[_0xa641('0xd')](_0xa641('0xe'),_0x57d154,_0xa641('0xc'),JSON[_0xa641('0xf')](_0x4d6a23));if(_0x4d6a23[_0xa641('0x10')]){if(_0x4d6a23[_0xa641('0x10')][_0xa641('0x11')]===0x1f4){logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);return _0x5cd83c(_0x4d6a23['error'][_0xa641('0x13')]);}logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);return _0x2077c8(_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);}else{logger['info'](_0xa641('0x12'),_0x57d154,_0xa641('0xc'));_0x2077c8(_0x4d6a23[_0xa641('0x14')][_0xa641('0x13')]);}})[_0xa641('0x15')](function(_0x5b1028){logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x5b1028);_0x5cd83c(_0x5b1028);});});} \ No newline at end of file +var _0xcbfe=['../../config/environment','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','rpc'];(function(_0x39f5aa,_0x38cf43){var _0x5990d3=function(_0x145724){while(--_0x145724){_0x39f5aa['push'](_0x39f5aa['shift']());}};_0x5990d3(++_0x38cf43);}(_0xcbfe,0x72));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xecbf('0x0'));var util=require(_0xecbf('0x1'));var moment=require(_0xecbf('0x2'));var BPromise=require(_0xecbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecbf('0x5'));var config=require(_0xecbf('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xecbf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13e8dd,_0x25e8f9,_0xc3cfeb){return new BPromise(function(_0x22aa8b,_0x51a284){return client[_0xecbf('0x8')](_0x13e8dd,_0xc3cfeb)[_0xecbf('0x9')](function(_0x2570bd){logger['info'](_0xecbf('0xa'),_0x25e8f9,_0xecbf('0xb'));logger[_0xecbf('0xc')](_0xecbf('0xd'),_0x25e8f9,'request\x20sent',JSON[_0xecbf('0xe')](_0x2570bd));if(_0x2570bd['error']){if(_0x2570bd[_0xecbf('0xf')][_0xecbf('0x10')]===0x1f4){logger[_0xecbf('0xf')](_0xecbf('0xa'),_0x25e8f9,_0x2570bd[_0xecbf('0xf')][_0xecbf('0x11')]);return _0x51a284(_0x2570bd[_0xecbf('0xf')]['message']);}logger[_0xecbf('0xf')]('Schedule,\x20%s,\x20%s',_0x25e8f9,_0x2570bd['error'][_0xecbf('0x11')]);return _0x22aa8b(_0x2570bd['error']['message']);}else{logger[_0xecbf('0x12')](_0xecbf('0xa'),_0x25e8f9,_0xecbf('0xb'));_0x22aa8b(_0x2570bd['result'][_0xecbf('0x11')]);}})[_0xecbf('0x13')](function(_0x701144){logger['error'](_0xecbf('0xa'),_0x25e8f9,_0x701144);_0x51a284(_0x701144);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e3f119c..fe03cfc 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 _0x6d13=['/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6d13,0xd0));var _0x36d1=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x6d13[_0x32b4aa];return _0x473160;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x36d1('0x0'));var timeout=require(_0x36d1('0x1'));var express=require(_0x36d1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x36d1('0x3'));var config=require('../../config/environment');var controller=require(_0x36d1('0x4'));router[_0x36d1('0x5')]('/',auth[_0x36d1('0x6')](),controller['index']);router[_0x36d1('0x5')](_0x36d1('0x7'),auth[_0x36d1('0x6')](),controller['describe']);router[_0x36d1('0x5')](_0x36d1('0x8'),auth[_0x36d1('0x6')](),controller[_0x36d1('0x9')]);router[_0x36d1('0x5')](_0x36d1('0xa'),auth[_0x36d1('0x6')](),controller['download']);router[_0x36d1('0xb')]('/',auth[_0x36d1('0x6')](),controller[_0x36d1('0xc')]);router[_0x36d1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x36d1('0xe')]);router[_0x36d1('0xf')](_0x36d1('0x8'),auth[_0x36d1('0x6')](),controller[_0x36d1('0x10')]);module[_0x36d1('0x11')]=router; \ No newline at end of file +var _0x2755=['describe','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x37a6ff,_0x1763e8){var _0x48b655=function(_0x16052d){while(--_0x16052d){_0x37a6ff['push'](_0x37a6ff['shift']());}};_0x48b655(++_0x1763e8);}(_0x2755,0x19a));var _0x5275=function(_0x323913,_0xe010e){_0x323913=_0x323913-0x0;var _0x59968c=_0x2755[_0x323913];return _0x59968c;};'use strict';var multer=require(_0x5275('0x0'));var util=require('util');var path=require(_0x5275('0x1'));var timeout=require(_0x5275('0x2'));var express=require(_0x5275('0x3'));var router=express['Router']();var auth=require(_0x5275('0x4'));var interaction=require(_0x5275('0x5'));var config=require('../../config/environment');var controller=require(_0x5275('0x6'));router[_0x5275('0x7')]('/',auth[_0x5275('0x8')](),controller[_0x5275('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5275('0xa')]);router[_0x5275('0x7')](_0x5275('0xb'),auth[_0x5275('0x8')](),controller[_0x5275('0xc')]);router['get'](_0x5275('0xd'),auth[_0x5275('0x8')](),controller[_0x5275('0xe')]);router[_0x5275('0xf')]('/',auth[_0x5275('0x8')](),controller[_0x5275('0x10')]);router[_0x5275('0x11')](_0x5275('0xb'),auth[_0x5275('0x8')](),controller['update']);router[_0x5275('0x12')]('/:id',auth[_0x5275('0x8')](),controller[_0x5275('0x13')]);module[_0x5275('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d783581..4bd8e9f 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 _0x5340=['path','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5340,0x1cc));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0534('0x0'));var moment=require(_0x0534('0x1'));var path=require(_0x0534('0x2'));var config=require('../../config/environment');module[_0x0534('0x3')]={'format':{'type':Sequelize[_0x0534('0x4')],'get':function(){return this['getDataValue'](_0x0534('0x5'))?path[_0x0534('0x6')](this[_0x0534('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x0534('0x8')]},'channel':{'type':Sequelize[_0x0534('0x8')]},'value':{'type':Sequelize[_0x0534('0x8')],'set':function(_0x515814){var _0x350f37=_0x515814[_0x0534('0x9')](/\\/g,'/');this[_0x0534('0xa')](_0x0534('0x5'),_0x350f37);}},'rating':{'type':Sequelize[_0x0534('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0534('0xb')],'set':function(_0x42ca5a){this[_0x0534('0xa')](_0x0534('0xc'),moment()['subtract'](_0x42ca5a,'ms'));this['setDataValue'](_0x0534('0xd'),moment());this[_0x0534('0xa')](_0x0534('0xe'),_0x42ca5a);}},'startedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0xc')))[_0x0534('0x10')](_0x0534('0x11'))[_0x0534('0x12')]();}},'closedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0xd')))[_0x0534('0x10')](_0x0534('0x11'))[_0x0534('0x12')]();}},'createdAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this['getDataValue'](_0x0534('0x13')))['format'](_0x0534('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0x14')))[_0x0534('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x0534('0x12')]();}}}; \ No newline at end of file +var _0x3349=['format','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','closedAt','DATE','startedAt','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x58b63d,_0x882db9){var _0x460714=function(_0x3df0d0){while(--_0x3df0d0){_0x58b63d['push'](_0x58b63d['shift']());}};_0x460714(++_0x882db9);}(_0x3349,0x142));var _0x9334=function(_0x504187,_0x407042){_0x504187=_0x504187-0x0;var _0x84c53d=_0x3349[_0x504187];return _0x84c53d;};'use strict';var Sequelize=require(_0x9334('0x0'));var moment=require(_0x9334('0x1'));var path=require(_0x9334('0x2'));var config=require(_0x9334('0x3'));module['exports']={'format':{'type':Sequelize[_0x9334('0x4')],'get':function(){return this['getDataValue'](_0x9334('0x5'))?path[_0x9334('0x6')](this[_0x9334('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x9334('0x8')]},'channel':{'type':Sequelize[_0x9334('0x8')]},'value':{'type':Sequelize[_0x9334('0x8')],'set':function(_0x116dd4){var _0x4dab4f=_0x116dd4[_0x9334('0x9')](/\\/g,'/');this[_0x9334('0xa')](_0x9334('0x5'),_0x4dab4f);}},'rating':{'type':Sequelize[_0x9334('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9334('0xb')],'set':function(_0x78eea){this[_0x9334('0xa')]('startedAt',moment()['subtract'](_0x78eea,'ms'));this['setDataValue'](_0x9334('0xc'),moment());this[_0x9334('0xa')]('duration',_0x78eea);}},'startedAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this[_0x9334('0x7')](_0x9334('0xe')))['format'](_0x9334('0xf'))[_0x9334('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9334('0x7')](_0x9334('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9334('0x10')]();}},'createdAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this['getDataValue'](_0x9334('0x11')))[_0x9334('0x12')](_0x9334('0xf'))[_0x9334('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9334('0xd')],'get':function(){return moment(this['getDataValue'](_0x9334('0x13')))['format'](_0x9334('0xf'))[_0x9334('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 67e2549..d9c8cd8 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 _0x35ba=['filters','attributes','intersection','fields','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','duration','createdAt','closedAt','destroy','download','../../components/encryptor','type','uniqueid','value','join','server/files/screen_recordings','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','send','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','index','ScreenRecording','rawAttributes','model','differenceBy','format','query','keys'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x35ba,0x8c));var _0xa35b=function(_0x538a20,_0x5c14d6){_0x538a20=_0x538a20-0x0;var _0xec72f5=_0x35ba[_0x538a20];return _0xec72f5;};'use strict';var pdf=require(_0xa35b('0x0'));var emlformat=require(_0xa35b('0x1'));var rimraf=require(_0xa35b('0x2'));var zipdir=require(_0xa35b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa35b('0x4'));var moment=require(_0xa35b('0x5'));var BPromise=require(_0xa35b('0x6'));var Mustache=require(_0xa35b('0x7'));var util=require(_0xa35b('0x8'));var path=require(_0xa35b('0x9'));var sox=require('sox');var csv=require(_0xa35b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa35b('0xb'));var squel=require(_0xa35b('0xc'));var crypto=require(_0xa35b('0xd'));var jsforce=require(_0xa35b('0xe'));var deskjs=require(_0xa35b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa35b('0x10'));var Papa=require(_0xa35b('0x11'));var Redis=require(_0xa35b('0x12'));var authService=require(_0xa35b('0x13'));var qs=require(_0xa35b('0x14'));var hardwareService=require(_0xa35b('0x15'));var logger=require(_0xa35b('0x16'))(_0xa35b('0x17'));var utils=require(_0xa35b('0x18'));var config=require('../../config/environment');var db=require(_0xa35b('0x19'))['db'];function respondWithStatusCode(_0x5826ab,_0x91d5ea){_0x91d5ea=_0x91d5ea||0xcc;return function(_0x3eb762){if(_0x3eb762){return _0x5826ab[_0xa35b('0x1a')](_0x91d5ea);}return _0x5826ab[_0xa35b('0x1b')](_0x91d5ea)[_0xa35b('0x1c')]();};}function respondWithResult(_0x52dd61,_0x32286e){_0x32286e=_0x32286e||0xc8;return function(_0x511f41){if(_0x511f41){return _0x52dd61[_0xa35b('0x1b')](_0x32286e)['json'](_0x511f41);}};}function respondWithFilteredResult(_0x1020d4,_0x15968f){return function(_0x559610){if(_0x559610){var _0x36a3c1=_0x559610[_0xa35b('0x1d')],_0x42b081=_0x15968f[_0xa35b('0x1e')],_0xd38665=_0x15968f[_0xa35b('0x1e')]+_0x15968f[_0xa35b('0x1f')],_0xb7b44f;if(_0xd38665>=_0x36a3c1){_0xd38665=_0x36a3c1;_0xb7b44f=0xc8;}else{_0xb7b44f=0xce;}_0x1020d4[_0xa35b('0x1b')](_0xb7b44f);return _0x1020d4[_0xa35b('0x20')](_0xa35b('0x21'),_0x42b081+'-'+_0xd38665+'/'+_0x36a3c1)['json'](_0x559610);}return null;};}function patchUpdates(_0x4ab9ab){return function(_0x158d90){try{jsonpatch['apply'](_0x158d90,_0x4ab9ab,!![]);}catch(_0x2283fa){return BPromise[_0xa35b('0x22')](_0x2283fa);}return _0x158d90[_0xa35b('0x23')]();};}function saveUpdates(_0x41cf10,_0x3f224e){return function(_0x36279e){if(_0x36279e){return _0x36279e[_0xa35b('0x24')](_0x41cf10)[_0xa35b('0x25')](function(_0x14951d){return _0x14951d;});}return null;};}function removeEntity(_0x317d62,_0x1cf77a){return function(_0x3a29c9){if(_0x3a29c9){return _0x3a29c9['destroy']()[_0xa35b('0x25')](function(){_0x317d62[_0xa35b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x301f9f,_0x1efafb){return function(_0x21896d){if(!_0x21896d){_0x301f9f['sendStatus'](0x194);}return _0x21896d;};}function handleError(_0x19c655,_0xd980d0){_0xd980d0=_0xd980d0||0x1f4;return function(_0x13aa9b){logger['error'](_0x13aa9b[_0xa35b('0x26')]);if(_0x13aa9b[_0xa35b('0x27')]){delete _0x13aa9b[_0xa35b('0x27')];}_0x19c655[_0xa35b('0x1b')](_0xd980d0)['send'](_0x13aa9b);};}exports[_0xa35b('0x28')]=function(_0x33da60,_0x4a98a5){var _0x463db2={},_0x3eda63={},_0xd5dfaa={'count':0x0,'rows':[]};var _0x4456af=db[_0xa35b('0x29')][_0xa35b('0x2a')];_0x3eda63[_0xa35b('0x2b')]=_[_0xa35b('0x2c')](_['keys'](_0x4456af),[_0xa35b('0x2d')]);_0x3eda63[_0xa35b('0x2e')]=_[_0xa35b('0x2f')](_0x33da60[_0xa35b('0x2e')]);_0x3eda63[_0xa35b('0x30')]=_['intersection'](_0x3eda63[_0xa35b('0x2b')],_0x3eda63[_0xa35b('0x2e')]);_0x463db2[_0xa35b('0x31')]=_[_0xa35b('0x32')](_0x3eda63['model'],qs[_0xa35b('0x33')](_0x33da60[_0xa35b('0x2e')]['fields']));_0x463db2[_0xa35b('0x31')]=_0x463db2['attributes']['length']?_0x463db2[_0xa35b('0x31')]:_0x3eda63[_0xa35b('0x2b')];if(!_0x33da60['query']['hasOwnProperty']('nolimit')){_0x463db2[_0xa35b('0x1f')]=qs[_0xa35b('0x1f')](_0x33da60[_0xa35b('0x2e')]['limit']);_0x463db2[_0xa35b('0x1e')]=qs[_0xa35b('0x1e')](_0x33da60['query'][_0xa35b('0x1e')]);}_0x463db2[_0xa35b('0x34')]=qs[_0xa35b('0x35')](_0x33da60['query'][_0xa35b('0x35')]);_0x463db2[_0xa35b('0x36')]=qs[_0xa35b('0x30')](_['pick'](_0x33da60[_0xa35b('0x2e')],_0x3eda63['filters']));if(_0x33da60[_0xa35b('0x2e')][_0xa35b('0x37')]){_0x463db2[_0xa35b('0x36')]=_[_0xa35b('0x38')](_0x463db2[_0xa35b('0x36')],{'$or':_[_0xa35b('0x39')](_0x4456af,function(_0x5c14a2){if(_0x5c14a2['type']['key']!==_0xa35b('0x3a')){var _0xecc523={};_0xecc523[_0x5c14a2['field']]={'$like':'%'+_0x33da60['query']['filter']+'%'};return _0xecc523;}})});}_0x463db2=_[_0xa35b('0x38')]({},_0x463db2,_0x33da60[_0xa35b('0x3b')]);var _0x31befd={'where':_0x463db2[_0xa35b('0x36')]};return db[_0xa35b('0x29')]['count'](_0x31befd)[_0xa35b('0x25')](function(_0x176f6b){_0xd5dfaa[_0xa35b('0x1d')]=_0x176f6b;if(_0x33da60[_0xa35b('0x2e')][_0xa35b('0x3c')]){_0x463db2[_0xa35b('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0xa35b('0x3e')](_0x463db2);})['then'](function(_0x309897){_0xd5dfaa[_0xa35b('0x3f')]=_0x309897;return _0xd5dfaa;})[_0xa35b('0x25')](respondWithFilteredResult(_0x4a98a5,_0x463db2))[_0xa35b('0x40')](handleError(_0x4a98a5,null));};exports[_0xa35b('0x41')]=function(_0x1b6ef4,_0x4162e5){var _0x795caa={'raw':![],'where':{'id':_0x1b6ef4[_0xa35b('0x42')]['id']}},_0x1915dc={};_0x1915dc['model']=_['keys'](db[_0xa35b('0x29')][_0xa35b('0x2a')]);_0x1915dc['query']=_[_0xa35b('0x2f')](_0x1b6ef4[_0xa35b('0x2e')]);_0x1915dc['filters']=_[_0xa35b('0x32')](_0x1915dc[_0xa35b('0x2b')],_0x1915dc[_0xa35b('0x2e')]);_0x795caa[_0xa35b('0x31')]=_[_0xa35b('0x32')](_0x1915dc[_0xa35b('0x2b')],qs[_0xa35b('0x33')](_0x1b6ef4[_0xa35b('0x2e')][_0xa35b('0x33')]));_0x795caa['attributes']=_0x795caa[_0xa35b('0x31')][_0xa35b('0x43')]?_0x795caa[_0xa35b('0x31')]:_0x1915dc[_0xa35b('0x2b')];if(_0x1b6ef4[_0xa35b('0x2e')][_0xa35b('0x3c')]){_0x795caa[_0xa35b('0x3d')]=[{'all':!![]}];}_0x795caa=_[_0xa35b('0x38')]({},_0x795caa,_0x1b6ef4[_0xa35b('0x3b')]);return db['ScreenRecording'][_0xa35b('0x44')](_0x795caa)[_0xa35b('0x25')](handleEntityNotFound(_0x4162e5,null))[_0xa35b('0x25')](respondWithResult(_0x4162e5,null))['catch'](handleError(_0x4162e5,null));};exports['create']=function(_0xfe1315,_0x18b04f){return db[_0xa35b('0x29')][_0xa35b('0x45')](_0xfe1315[_0xa35b('0x46')],{})[_0xa35b('0x25')](respondWithResult(_0x18b04f,0xc9))[_0xa35b('0x40')](handleError(_0x18b04f,null));};exports[_0xa35b('0x24')]=function(_0x167a4a,_0xa9cfec){if(_0x167a4a[_0xa35b('0x46')]['id']){delete _0x167a4a[_0xa35b('0x46')]['id'];}delete _0x167a4a[_0xa35b('0x46')][_0xa35b('0x47')];delete _0x167a4a['body'][_0xa35b('0x48')];delete _0x167a4a['body'][_0xa35b('0x49')];delete _0x167a4a[_0xa35b('0x46')]['value'];return db[_0xa35b('0x29')][_0xa35b('0x44')]({'where':{'id':_0x167a4a['params']['id']}})[_0xa35b('0x25')](handleEntityNotFound(_0xa9cfec,null))[_0xa35b('0x25')](saveUpdates(_0x167a4a[_0xa35b('0x46')],null))[_0xa35b('0x25')](respondWithResult(_0xa9cfec,null))[_0xa35b('0x40')](handleError(_0xa9cfec,null));};exports[_0xa35b('0x4a')]=function(_0x50436d,_0x4a2834){return db[_0xa35b('0x29')][_0xa35b('0x44')]({'where':{'id':_0x50436d[_0xa35b('0x42')]['id']}})[_0xa35b('0x25')](handleEntityNotFound(_0x4a2834,null))[_0xa35b('0x25')](removeEntity(_0x4a2834,null))['catch'](handleError(_0x4a2834,null));};exports['describe']=function(_0x3ca66a,_0x32c6a2){return db[_0xa35b('0x29')]['describe']()[_0xa35b('0x25')](respondWithResult(_0x32c6a2,null))[_0xa35b('0x40')](handleError(_0x32c6a2,null));};exports[_0xa35b('0x4b')]=function(_0x41ed89,_0x11a4b0,_0x5a764e){var _0x564ed6=require(_0xa35b('0x4c'));var _0xd41b2b=![];var _0x3721fa={};if(_0x41ed89[_0xa35b('0x2e')]['type']&&_0x41ed89[_0xa35b('0x2e')][_0xa35b('0x4d')]===_0xa35b('0x4e')){_0x3721fa[_0xa35b('0x4e')]=_0x41ed89[_0xa35b('0x42')]['id'];}else{_0x3721fa['id']=_0x41ed89['params']['id'];}return db[_0xa35b('0x29')]['find']({'where':_0x3721fa,'attributes':['id',_0xa35b('0x4f')],'raw':!![]})[_0xa35b('0x25')](handleEntityNotFound(_0x11a4b0,null))['then'](function(_0x561f11){if(_0x561f11){var _0x558b95=path[_0xa35b('0x50')](config['root'],_0xa35b('0x51'),_0x561f11[_0xa35b('0x4f')]);var _0x30c4d9=util['format'](_0xa35b('0x52'),_0x558b95);if(fs['existsSync'](_0x30c4d9)){_0xd41b2b=!![];return _0x564ed6['decryptFile'](_0x30c4d9,_0x558b95,config[_0xa35b('0x53')][_0xa35b('0x54')])[_0xa35b('0x25')](function(){return _0x561f11;});}return _0x561f11;}})[_0xa35b('0x25')](function(_0x46549c){if(_0x46549c){var _0x410d6e=path[_0xa35b('0x50')](config['root'],_0xa35b('0x51'),_0x46549c[_0xa35b('0x4f')]);if(!fs[_0xa35b('0x55')](_0x410d6e)){throw new db[(_0xa35b('0x56'))][(_0xa35b('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x46549c[_0xa35b('0x58')]){return _0x11a4b0[_0xa35b('0x4b')](_0x410d6e,_0x46549c['filename']+path[_0xa35b('0x59')](_0x410d6e),function(){if(_0xd41b2b){fs[_0xa35b('0x5a')](_0x410d6e);}});}else{return _0x11a4b0[_0xa35b('0x4b')](_0x410d6e,function(_0x3765ea){if(_0xd41b2b){fs[_0xa35b('0x5a')](_0x410d6e);}});}}})[_0xa35b('0x40')](function(_0x1f6a78){if(_0x1f6a78[_0xa35b('0x5b')]===_0xa35b('0x5c')){_0x11a4b0[_0xa35b('0x1b')](0x194)[_0xa35b('0x5d')]('Not\x20found');}else{return handleError(_0x11a4b0,null);}});}; \ No newline at end of file +var _0x9649=['uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','unlink','message','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ScreenRecording','rawAttributes','model','keys','format','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','options','includeAll','include','findAll','catch','show','params','intersection','create','body','createdAt','closedAt','value','find','describe','download','../../components/encryptor'];(function(_0x5d8ffd,_0x1f5837){var _0x4380b5=function(_0x14208a){while(--_0x14208a){_0x5d8ffd['push'](_0x5d8ffd['shift']());}};_0x4380b5(++_0x1f5837);}(_0x9649,0x118));var _0x9964=function(_0x1b207e,_0x26510d){_0x1b207e=_0x1b207e-0x0;var _0x3572fd=_0x9649[_0x1b207e];return _0x3572fd;};'use strict';var pdf=require(_0x9964('0x0'));var emlformat=require(_0x9964('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require(_0x9964('0x4'));var moment=require('moment');var BPromise=require(_0x9964('0x5'));var Mustache=require(_0x9964('0x6'));var util=require(_0x9964('0x7'));var path=require(_0x9964('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9964('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9964('0x11'));var logger=require('../../config/logger')(_0x9964('0x12'));var utils=require(_0x9964('0x13'));var config=require('../../config/environment');var db=require(_0x9964('0x14'))['db'];function respondWithStatusCode(_0xe9f792,_0x5d7939){_0x5d7939=_0x5d7939||0xcc;return function(_0x2bd6ff){if(_0x2bd6ff){return _0xe9f792['sendStatus'](_0x5d7939);}return _0xe9f792[_0x9964('0x15')](_0x5d7939)[_0x9964('0x16')]();};}function respondWithResult(_0x2473e9,_0x2451df){_0x2451df=_0x2451df||0xc8;return function(_0x22f5ce){if(_0x22f5ce){return _0x2473e9[_0x9964('0x15')](_0x2451df)[_0x9964('0x17')](_0x22f5ce);}};}function respondWithFilteredResult(_0x59efc7,_0x5b722f){return function(_0x37f137){if(_0x37f137){var _0x2be683=_0x37f137[_0x9964('0x18')],_0x561571=_0x5b722f[_0x9964('0x19')],_0x416340=_0x5b722f[_0x9964('0x19')]+_0x5b722f[_0x9964('0x1a')],_0x2b0aba;if(_0x416340>=_0x2be683){_0x416340=_0x2be683;_0x2b0aba=0xc8;}else{_0x2b0aba=0xce;}_0x59efc7['status'](_0x2b0aba);return _0x59efc7[_0x9964('0x1b')](_0x9964('0x1c'),_0x561571+'-'+_0x416340+'/'+_0x2be683)['json'](_0x37f137);}return null;};}function patchUpdates(_0x5bf270){return function(_0x541e4c){try{jsonpatch[_0x9964('0x1d')](_0x541e4c,_0x5bf270,!![]);}catch(_0xc4c0fe){return BPromise[_0x9964('0x1e')](_0xc4c0fe);}return _0x541e4c[_0x9964('0x1f')]();};}function saveUpdates(_0x5bafea,_0x3813d1){return function(_0x5f2bbd){if(_0x5f2bbd){return _0x5f2bbd[_0x9964('0x20')](_0x5bafea)[_0x9964('0x21')](function(_0x209929){return _0x209929;});}return null;};}function removeEntity(_0x3d14b7,_0x2829fb){return function(_0xea9fc2){if(_0xea9fc2){return _0xea9fc2[_0x9964('0x22')]()[_0x9964('0x21')](function(){_0x3d14b7['status'](0xcc)[_0x9964('0x16')]();});}};}function handleEntityNotFound(_0x3069d7,_0x1629f9){return function(_0x30ccf7){if(!_0x30ccf7){_0x3069d7['sendStatus'](0x194);}return _0x30ccf7;};}function handleError(_0x20c522,_0x988bf7){_0x988bf7=_0x988bf7||0x1f4;return function(_0x3b3793){logger[_0x9964('0x23')](_0x3b3793['stack']);if(_0x3b3793[_0x9964('0x24')]){delete _0x3b3793[_0x9964('0x24')];}_0x20c522[_0x9964('0x15')](_0x988bf7)[_0x9964('0x25')](_0x3b3793);};}exports[_0x9964('0x26')]=function(_0xd48c01,_0xcc5362){var _0x33be7b={},_0x4f9a8b={},_0x524564={'count':0x0,'rows':[]};var _0x194dc6=db[_0x9964('0x27')][_0x9964('0x28')];_0x4f9a8b[_0x9964('0x29')]=_['differenceBy'](_[_0x9964('0x2a')](_0x194dc6),[_0x9964('0x2b')]);_0x4f9a8b[_0x9964('0x2c')]=_[_0x9964('0x2a')](_0xd48c01[_0x9964('0x2c')]);_0x4f9a8b['filters']=_['intersection'](_0x4f9a8b[_0x9964('0x29')],_0x4f9a8b[_0x9964('0x2c')]);_0x33be7b['attributes']=_['intersection'](_0x4f9a8b['model'],qs[_0x9964('0x2d')](_0xd48c01[_0x9964('0x2c')][_0x9964('0x2d')]));_0x33be7b['attributes']=_0x33be7b[_0x9964('0x2e')][_0x9964('0x2f')]?_0x33be7b[_0x9964('0x2e')]:_0x4f9a8b[_0x9964('0x29')];if(!_0xd48c01[_0x9964('0x2c')][_0x9964('0x30')]('nolimit')){_0x33be7b[_0x9964('0x1a')]=qs[_0x9964('0x1a')](_0xd48c01[_0x9964('0x2c')]['limit']);_0x33be7b[_0x9964('0x19')]=qs[_0x9964('0x19')](_0xd48c01[_0x9964('0x2c')]['offset']);}_0x33be7b[_0x9964('0x31')]=qs[_0x9964('0x32')](_0xd48c01[_0x9964('0x2c')][_0x9964('0x32')]);_0x33be7b[_0x9964('0x33')]=qs[_0x9964('0x34')](_[_0x9964('0x35')](_0xd48c01[_0x9964('0x2c')],_0x4f9a8b[_0x9964('0x34')]));if(_0xd48c01[_0x9964('0x2c')][_0x9964('0x36')]){_0x33be7b[_0x9964('0x33')]=_[_0x9964('0x37')](_0x33be7b[_0x9964('0x33')],{'$or':_[_0x9964('0x38')](_0x194dc6,function(_0x5feb0e){if(_0x5feb0e[_0x9964('0x39')][_0x9964('0x3a')]!=='VIRTUAL'){var _0xfe79a3={};_0xfe79a3[_0x5feb0e['field']]={'$like':'%'+_0xd48c01[_0x9964('0x2c')][_0x9964('0x36')]+'%'};return _0xfe79a3;}})});}_0x33be7b=_['merge']({},_0x33be7b,_0xd48c01[_0x9964('0x3b')]);var _0x49e32f={'where':_0x33be7b[_0x9964('0x33')]};return db[_0x9964('0x27')][_0x9964('0x18')](_0x49e32f)[_0x9964('0x21')](function(_0x7f18e8){_0x524564[_0x9964('0x18')]=_0x7f18e8;if(_0xd48c01['query'][_0x9964('0x3c')]){_0x33be7b[_0x9964('0x3d')]=[{'all':!![]}];}return db[_0x9964('0x27')][_0x9964('0x3e')](_0x33be7b);})['then'](function(_0x1b3cbe){_0x524564['rows']=_0x1b3cbe;return _0x524564;})[_0x9964('0x21')](respondWithFilteredResult(_0xcc5362,_0x33be7b))[_0x9964('0x3f')](handleError(_0xcc5362,null));};exports[_0x9964('0x40')]=function(_0x2acc2e,_0x3a82d3){var _0x2014f8={'raw':![],'where':{'id':_0x2acc2e[_0x9964('0x41')]['id']}},_0x42eb44={};_0x42eb44[_0x9964('0x29')]=_[_0x9964('0x2a')](db[_0x9964('0x27')]['rawAttributes']);_0x42eb44[_0x9964('0x2c')]=_[_0x9964('0x2a')](_0x2acc2e[_0x9964('0x2c')]);_0x42eb44[_0x9964('0x34')]=_['intersection'](_0x42eb44[_0x9964('0x29')],_0x42eb44['query']);_0x2014f8['attributes']=_[_0x9964('0x42')](_0x42eb44['model'],qs[_0x9964('0x2d')](_0x2acc2e['query'][_0x9964('0x2d')]));_0x2014f8[_0x9964('0x2e')]=_0x2014f8[_0x9964('0x2e')]['length']?_0x2014f8['attributes']:_0x42eb44['model'];if(_0x2acc2e[_0x9964('0x2c')][_0x9964('0x3c')]){_0x2014f8['include']=[{'all':!![]}];}_0x2014f8=_[_0x9964('0x37')]({},_0x2014f8,_0x2acc2e[_0x9964('0x3b')]);return db[_0x9964('0x27')]['find'](_0x2014f8)[_0x9964('0x21')](handleEntityNotFound(_0x3a82d3,null))[_0x9964('0x21')](respondWithResult(_0x3a82d3,null))[_0x9964('0x3f')](handleError(_0x3a82d3,null));};exports[_0x9964('0x43')]=function(_0x562289,_0x35ae99){return db[_0x9964('0x27')][_0x9964('0x43')](_0x562289[_0x9964('0x44')],{})[_0x9964('0x21')](respondWithResult(_0x35ae99,0xc9))['catch'](handleError(_0x35ae99,null));};exports[_0x9964('0x20')]=function(_0x3499c5,_0x556530){if(_0x3499c5[_0x9964('0x44')]['id']){delete _0x3499c5[_0x9964('0x44')]['id'];}delete _0x3499c5[_0x9964('0x44')]['duration'];delete _0x3499c5[_0x9964('0x44')][_0x9964('0x45')];delete _0x3499c5[_0x9964('0x44')][_0x9964('0x46')];delete _0x3499c5['body'][_0x9964('0x47')];return db[_0x9964('0x27')][_0x9964('0x48')]({'where':{'id':_0x3499c5[_0x9964('0x41')]['id']}})['then'](handleEntityNotFound(_0x556530,null))[_0x9964('0x21')](saveUpdates(_0x3499c5[_0x9964('0x44')],null))[_0x9964('0x21')](respondWithResult(_0x556530,null))[_0x9964('0x3f')](handleError(_0x556530,null));};exports[_0x9964('0x22')]=function(_0x4f48d9,_0x20021d){return db[_0x9964('0x27')][_0x9964('0x48')]({'where':{'id':_0x4f48d9[_0x9964('0x41')]['id']}})[_0x9964('0x21')](handleEntityNotFound(_0x20021d,null))[_0x9964('0x21')](removeEntity(_0x20021d,null))[_0x9964('0x3f')](handleError(_0x20021d,null));};exports[_0x9964('0x49')]=function(_0x5e4ee5,_0x30f6c0){return db[_0x9964('0x27')][_0x9964('0x49')]()[_0x9964('0x21')](respondWithResult(_0x30f6c0,null))[_0x9964('0x3f')](handleError(_0x30f6c0,null));};exports[_0x9964('0x4a')]=function(_0x1ed5b5,_0x7641c5,_0x559e56){var _0x25faa5=require(_0x9964('0x4b'));var _0x58815f=![];var _0x17e971={};if(_0x1ed5b5[_0x9964('0x2c')]['type']&&_0x1ed5b5[_0x9964('0x2c')]['type']==='uniqueid'){_0x17e971[_0x9964('0x4c')]=_0x1ed5b5[_0x9964('0x41')]['id'];}else{_0x17e971['id']=_0x1ed5b5[_0x9964('0x41')]['id'];}return db[_0x9964('0x27')][_0x9964('0x48')]({'where':_0x17e971,'attributes':['id',_0x9964('0x47')],'raw':!![]})[_0x9964('0x21')](handleEntityNotFound(_0x7641c5,null))[_0x9964('0x21')](function(_0x19324f){if(_0x19324f){var _0x48e004=path[_0x9964('0x4d')](config[_0x9964('0x4e')],_0x9964('0x4f'),_0x19324f[_0x9964('0x47')]);var _0x2ab69=util[_0x9964('0x2b')]('%s.cypher',_0x48e004);if(fs[_0x9964('0x50')](_0x2ab69)){_0x58815f=!![];return _0x25faa5[_0x9964('0x51')](_0x2ab69,_0x48e004,config[_0x9964('0x52')]['recording'])['then'](function(){return _0x19324f;});}return _0x19324f;}})[_0x9964('0x21')](function(_0x543a43){if(_0x543a43){var _0x3d8653=path['join'](config[_0x9964('0x4e')],'server/files/screen_recordings',_0x543a43[_0x9964('0x47')]);if(!fs[_0x9964('0x50')](_0x3d8653)){throw new db[(_0x9964('0x53'))][(_0x9964('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x543a43['filename']){return _0x7641c5[_0x9964('0x4a')](_0x3d8653,_0x543a43[_0x9964('0x55')]+path['extname'](_0x3d8653),function(){if(_0x58815f){fs[_0x9964('0x56')](_0x3d8653);}});}else{return _0x7641c5['download'](_0x3d8653,function(_0x145e2e){if(_0x58815f){fs[_0x9964('0x56')](_0x3d8653);}});}}})[_0x9964('0x3f')](function(_0x4b2654){if(_0x4b2654[_0x9964('0x57')]==='ScreenRecording\x20not\x20found'){_0x7641c5[_0x9964('0x15')](0x194)[_0x9964('0x25')](_0x9964('0x58'));}else{return handleError(_0x7641c5,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6e302ae..3303f4f 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 _0xab41=['moment','bluebird','request-promise','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','isNil','value','join','existsSync','catch','resolve','finally','lodash','util','../../config/logger','api'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0xab41,0x1ea));var _0x1ab4=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xab41[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x1ab4('0x0'));var util=require(_0x1ab4('0x1'));var logger=require(_0x1ab4('0x2'))(_0x1ab4('0x3'));var moment=require(_0x1ab4('0x4'));var BPromise=require(_0x1ab4('0x5'));var rp=require(_0x1ab4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ab4('0x7'));module[_0x1ab4('0x8')]=function(_0x2d75a0,_0xe141fe){return _0x2d75a0['define'](_0x1ab4('0x9'),attributes,{'tableName':_0x1ab4('0xa'),'paranoid':![],'indexes':[{'name':_0x1ab4('0xb'),'fields':[_0x1ab4('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x33c25b,_0x4cd512,_0x51c34c){return new BPromise(function(_0x23c5e0,_0x387988){if(!_[_0x1ab4('0xc')](_0x33c25b[_0x1ab4('0xd')])){var _0x52a588=path[_0x1ab4('0xe')](config['root'],'server','files',_0x1ab4('0xa'),_0x33c25b[_0x1ab4('0xd')]);if(fs[_0x1ab4('0xf')](_0x52a588)){rimraf(_0x52a588,function(_0x514300){if(_0x514300){console['log'](_0x514300);}});}}_0x23c5e0();})[_0x1ab4('0x10')](function(_0x2a0382){BPromise[_0x1ab4('0x11')]();})[_0x1ab4('0x12')](function(){_0x51c34c();});}}});}; \ No newline at end of file +var _0x6eca=['moment','bluebird','request-promise','path','exports','define','ScreenRecording','screen_recordings','interactionid','isNil','value','join','root','server','files','existsSync','log','lodash','util','api'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6eca,0x1a1));var _0xa6ec=function(_0x6517c5,_0x566314){_0x6517c5=_0x6517c5-0x0;var _0x29a871=_0x6eca[_0x6517c5];return _0x29a871;};'use strict';var _=require(_0xa6ec('0x0'));var util=require(_0xa6ec('0x1'));var logger=require('../../config/logger')(_0xa6ec('0x2'));var moment=require(_0xa6ec('0x3'));var BPromise=require(_0xa6ec('0x4'));var rp=require(_0xa6ec('0x5'));var fs=require('fs');var path=require(_0xa6ec('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xa6ec('0x7')]=function(_0x31d54b,_0x19b423){return _0x31d54b[_0xa6ec('0x8')](_0xa6ec('0x9'),attributes,{'tableName':_0xa6ec('0xa'),'paranoid':![],'indexes':[{'name':_0xa6ec('0xb'),'fields':[_0xa6ec('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x13e7a3,_0x369a02,_0x217e55){return new BPromise(function(_0x646373,_0x1a0c9f){if(!_[_0xa6ec('0xc')](_0x13e7a3[_0xa6ec('0xd')])){var _0x73a49f=path[_0xa6ec('0xe')](config[_0xa6ec('0xf')],_0xa6ec('0x10'),_0xa6ec('0x11'),'screen_recordings',_0x13e7a3[_0xa6ec('0xd')]);if(fs[_0xa6ec('0x12')](_0x73a49f)){rimraf(_0x73a49f,function(_0x4a7297){if(_0x4a7297){console[_0xa6ec('0x13')](_0x4a7297);}});}}_0x646373();})['catch'](function(_0x16b307){BPromise['resolve']();})['finally'](function(){_0x217e55();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 752a8aa..1ce620e 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 _0xed1f=['request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x24d464,_0x2e916e){var _0x3af34d=function(_0x272de1){while(--_0x272de1){_0x24d464['push'](_0x24d464['shift']());}};_0x3af34d(++_0x2e916e);}(_0xed1f,0x6a));var _0xfed1=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xed1f[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x4d9e=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','bluebird','ioredis','../../config/utils'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5005d9,_0x1a9652){_0x5005d9=_0x5005d9-0x0;var _0x527ac2=_0x4d9e[_0x5005d9];return _0x527ac2;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe4d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4d9('0x3'));var logger=require(_0xe4d9('0x4'))('rpc');var config=require(_0xe4d9('0x5'));var jayson=require(_0xe4d9('0x6'));var client=jayson[_0xe4d9('0x7')][_0xe4d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x125dbc,_0x32222c,_0x54a63a){return new BPromise(function(_0x36316f,_0x1d3810){return client[_0xe4d9('0x9')](_0x125dbc,_0x54a63a)[_0xe4d9('0xa')](function(_0x3f8937){logger[_0xe4d9('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0xe4d9('0xc'));logger[_0xe4d9('0xd')](_0xe4d9('0xe'),_0x32222c,_0xe4d9('0xc'),JSON[_0xe4d9('0xf')](_0x3f8937));if(_0x3f8937[_0xe4d9('0x10')]){if(_0x3f8937[_0xe4d9('0x10')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0x3f8937['error']['message']);return _0x1d3810(_0x3f8937['error']['message']);}logger['error'](_0xe4d9('0x11'),_0x32222c,_0x3f8937[_0xe4d9('0x10')][_0xe4d9('0x12')]);return _0x36316f(_0x3f8937['error'][_0xe4d9('0x12')]);}else{logger[_0xe4d9('0xb')](_0xe4d9('0x11'),_0x32222c,_0xe4d9('0xc'));_0x36316f(_0x3f8937['result'][_0xe4d9('0x12')]);}})[_0xe4d9('0x13')](function(_0x4687f8){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x32222c,_0x4687f8);_0x1d3810(_0x4687f8);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0a75eab..2049264 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 _0x790d=['file','addLogo','diskStorage','join','root','%s%s','post','addLogoLogin','preferred','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','server/files/images/logos/','format','logo','extname','originalname'];(function(_0x982a29,_0x596cf3){var _0x5598ec=function(_0x29441c){while(--_0x29441c){_0x982a29['push'](_0x982a29['shift']());}};_0x5598ec(++_0x596cf3);}(_0x790d,0x10f));var _0xd790=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x790d[_0x5ad0d7];return _0xd83bd;};'use strict';var multer=require(_0xd790('0x0'));var util=require(_0xd790('0x1'));var path=require(_0xd790('0x2'));var timeout=require(_0xd790('0x3'));var express=require(_0xd790('0x4'));var router=express[_0xd790('0x5')]();var auth=require(_0xd790('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd790('0x7'));var controller=require(_0xd790('0x8'));router[_0xd790('0x9')]('/',auth[_0xd790('0xa')](),controller[_0xd790('0xb')]);router[_0xd790('0x9')]('/:id',controller[_0xd790('0xc')]);router[_0xd790('0x9')](_0xd790('0xd'),controller[_0xd790('0xe')]);router[_0xd790('0x9')](_0xd790('0xf'),controller[_0xd790('0x10')]);router[_0xd790('0x9')](_0xd790('0x11'),controller['gdpr']);router[_0xd790('0x9')](_0xd790('0x12'),controller[_0xd790('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a0c62,_0x97cf0a,_0x13ddd7){_0x13ddd7(null,path['join'](config['root'],_0xd790('0x14')));},'filename':function(_0x51e1c2,_0x421ade,_0x57eb55){_0x57eb55(null,util[_0xd790('0x15')]('%s%s',_0xd790('0x16'),path[_0xd790('0x17')](_0x421ade[_0xd790('0x18')])));}})});router['post']('/:id/logo',upload['single'](_0xd790('0x19')),controller[_0xd790('0x1a')]);var upload=multer({'storage':multer[_0xd790('0x1b')]({'destination':function(_0x400d7e,_0x1b53c7,_0xba190d){_0xba190d(null,path[_0xd790('0x1c')](config[_0xd790('0x1d')],_0xd790('0x14')));},'filename':function(_0xb4ed46,_0x198f34,_0x2c00fd){_0x2c00fd(null,util[_0xd790('0x15')](_0xd790('0x1e'),'logologin',path[_0xd790('0x17')](_0x198f34[_0xd790('0x18')])));}})});router[_0xd790('0x1f')](_0xd790('0xf'),upload['single'](_0xd790('0x19')),controller[_0xd790('0x20')]);var upload=multer({'storage':multer[_0xd790('0x1b')]({'destination':function(_0x8573e5,_0x35cd69,_0x124abd){_0x124abd(null,path[_0xd790('0x1c')](config['root'],'server/files/images/logos/'));},'filename':function(_0x43c68a,_0x31d94b,_0x195984){_0x195984(null,util[_0xd790('0x15')](_0xd790('0x1e'),_0xd790('0x21'),path[_0xd790('0x17')](_0x31d94b[_0xd790('0x18')])));}})});router['post'](_0xd790('0x12'),upload['single'](_0xd790('0x19')),controller['addPreferred']);router[_0xd790('0x22')]('/:id',auth[_0xd790('0xa')](),controller[_0xd790('0x23')]);module[_0xd790('0x24')]=router; \ No newline at end of file +var _0x34ef=['/:id/preferred','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','%s%s','logologin','extname','addPreferred','put','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x34ef,0x7c));var _0xf34e=function(_0x49103d,_0x51360f){_0x49103d=_0x49103d-0x0;var _0xed1c35=_0x34ef[_0x49103d];return _0xed1c35;};'use strict';var multer=require(_0xf34e('0x0'));var util=require('util');var path=require(_0xf34e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf34e('0x2'));var router=express[_0xf34e('0x3')]();var auth=require(_0xf34e('0x4'));var interaction=require(_0xf34e('0x5'));var config=require(_0xf34e('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0xf34e('0x7')](),controller[_0xf34e('0x8')]);router[_0xf34e('0x9')](_0xf34e('0xa'),controller['show']);router[_0xf34e('0x9')](_0xf34e('0xb'),controller[_0xf34e('0xc')]);router[_0xf34e('0x9')](_0xf34e('0xd'),controller[_0xf34e('0xe')]);router[_0xf34e('0x9')](_0xf34e('0xf'),controller['gdpr']);router[_0xf34e('0x9')](_0xf34e('0x10'),controller['getPreferred']);var upload=multer({'storage':multer[_0xf34e('0x11')]({'destination':function(_0x2c6637,_0x523e42,_0x38cf58){_0x38cf58(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x1161e9,_0x4402f2,_0x2a5adf){_0x2a5adf(null,util[_0xf34e('0x15')]('%s%s',_0xf34e('0x16'),path['extname'](_0x4402f2[_0xf34e('0x17')])));}})});router[_0xf34e('0x18')](_0xf34e('0xb'),upload[_0xf34e('0x19')](_0xf34e('0x1a')),controller[_0xf34e('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c948c,_0x1d71ff,_0x1f5940){_0x1f5940(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x441a3b,_0x44a618,_0x1f2a17){_0x1f2a17(null,util[_0xf34e('0x15')](_0xf34e('0x1c'),_0xf34e('0x1d'),path[_0xf34e('0x1e')](_0x44a618['originalname'])));}})});router[_0xf34e('0x18')](_0xf34e('0xd'),upload[_0xf34e('0x19')]('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xf34e('0x11')]({'destination':function(_0x2229df,_0x5d3592,_0x4075fa){_0x4075fa(null,path[_0xf34e('0x12')](config[_0xf34e('0x13')],_0xf34e('0x14')));},'filename':function(_0x373705,_0x547906,_0x3347bc){_0x3347bc(null,util['format']('%s%s','preferred',path[_0xf34e('0x1e')](_0x547906[_0xf34e('0x17')])));}})});router[_0xf34e('0x18')](_0xf34e('0x10'),upload[_0xf34e('0x19')]('file'),controller[_0xf34e('0x1f')]);router[_0xf34e('0x20')](_0xf34e('0xa'),auth[_0xf34e('0x7')](),controller[_0xf34e('0x21')]);module[_0xf34e('0x22')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 745aefd..dda3b12 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 _0x9f21=['exports','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0xcc4d3a,_0x1d49b2){var _0x1ab399=function(_0x24d259){while(--_0x24d259){_0xcc4d3a['push'](_0xcc4d3a['shift']());}};_0x1ab399(++_0x1d49b2);}(_0x9f21,0x98));var _0x19f2=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x9f21[_0x25bd2a];return _0xb6b479;};'use strict';var Sequelize=require(_0x19f2('0x0'));module[_0x19f2('0x1')]={'min_internal':{'type':Sequelize[_0x19f2('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x19f2('0x2')](0xb),'unique':_0x19f2('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x19f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x19f2('0x4')},'logo':{'type':Sequelize[_0x19f2('0x5')]},'defaultLogo':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x19f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x19f2('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x19f2('0x5')]},'turnpassword':{'type':Sequelize[_0x19f2('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x19f2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x19f2('0x7')},'enableEmailPreview':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x19f2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x19f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x19f2('0x5')],'defaultValue':_0x19f2('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf893=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','sequelize','exports','INTEGER','min_internal'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf893,0x11c));var _0x3f89=function(_0x400358,_0x5427a9){_0x400358=_0x400358-0x0;var _0x2133cf=_0xf893[_0x400358];return _0x2133cf;};'use strict';var Sequelize=require(_0x3f89('0x0'));module[_0x3f89('0x1')]={'min_internal':{'type':Sequelize[_0x3f89('0x2')](0xb),'unique':_0x3f89('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x3f89('0x2')](0xb),'unique':_0x3f89('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x3f89('0x5')],'defaultValue':_0x3f89('0x6')},'logo':{'type':Sequelize[_0x3f89('0x5')]},'defaultLogo':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x3f89('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x3f89('0x5')]},'turnaddr':{'type':Sequelize[_0x3f89('0x5')]},'turnusername':{'type':Sequelize[_0x3f89('0x5')]},'turnpassword':{'type':Sequelize[_0x3f89('0x5')]},'pageTitle':{'type':Sequelize[_0x3f89('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x3f89('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x3f89('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3f89('0x8')},'chatTimeout':{'type':Sequelize[_0x3f89('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x3f89('0x5')]},'defaultPreferred':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x3f89('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x3f89('0x5')]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index b7617b4..612ff86 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 _0x36e6=['VIRTUAL','field','include','findAll','show','params','length','includeAll','update','find','body','join','root','server/files/templates/stun.ejs','readFileSync','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','custom','ValidationError','download','getLogoLogin','preferred','default_loginLogo.png','upperFirst','Sequelize','Logo\x20not\x20found','securePassword','addPreferred','getPreferred','getLicense','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','end','stack','name','send','index','Setting','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type'];(function(_0x31a0a1,_0x333838){var _0x37436d=function(_0x58c142){while(--_0x58c142){_0x31a0a1['push'](_0x31a0a1['shift']());}};_0x37436d(++_0x333838);}(_0x36e6,0xad));var _0x636e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36e6[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x636e('0x0'));var emlformat=require(_0x636e('0x1'));var rimraf=require(_0x636e('0x2'));var zipdir=require(_0x636e('0x3'));var jsonpatch=require(_0x636e('0x4'));var rp=require(_0x636e('0x5'));var moment=require(_0x636e('0x6'));var BPromise=require(_0x636e('0x7'));var Mustache=require(_0x636e('0x8'));var util=require(_0x636e('0x9'));var path=require(_0x636e('0xa'));var sox=require(_0x636e('0xb'));var csv=require(_0x636e('0xc'));var ejs=require(_0x636e('0xd'));var fs=require('fs');var _=require(_0x636e('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x636e('0xf'));var deskjs=require(_0x636e('0x10'));var toCsv=require(_0x636e('0xc'));var querystring=require(_0x636e('0x11'));var Papa=require('papaparse');var Redis=require(_0x636e('0x12'));var authService=require(_0x636e('0x13'));var qs=require(_0x636e('0x14'));var hardwareService=require(_0x636e('0x15'));var logger=require(_0x636e('0x16'))(_0x636e('0x17'));var utils=require(_0x636e('0x18'));var config=require('../../config/environment');var db=require(_0x636e('0x19'))['db'];var jayson=require(_0x636e('0x1a'));var client=jayson[_0x636e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x43c0f8,_0x583750,_0x4273a6){if(_0x4273a6){var _0x9b209c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9b209c[_0x636e('0x1c')](_0x583750)){return _0x43c0f8;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x43c0f8;}}function respondWithRpcPromise(_0x325f38,_0x228e14,_0x43bbc2,_0x2bef45){return new BPromise(function(_0x12dc44,_0x16dd7d){var _0x497fba=_0x2bef45||client;return _0x497fba['request'](_0x325f38,_0x43bbc2)['then'](function(_0x513794){logger[_0x636e('0x1d')](_0x636e('0x1e'),_0x228e14,_0x636e('0x1f'));logger[_0x636e('0x20')](_0x636e('0x21'),_0x228e14,_0x636e('0x1f'),JSON[_0x636e('0x22')](_0x513794));if(_0x513794[_0x636e('0x23')]){if(_0x513794['error'][_0x636e('0x24')]===0x1f4){logger[_0x636e('0x23')](_0x636e('0x1e'),_0x228e14,_0x513794[_0x636e('0x23')][_0x636e('0x25')]);return _0x16dd7d(_0x513794[_0x636e('0x23')][_0x636e('0x25')]);}logger[_0x636e('0x23')](_0x636e('0x1e'),_0x228e14,_0x513794['error']['message']);return _0x12dc44(_0x513794[_0x636e('0x23')][_0x636e('0x25')]);}else{logger['info'](_0x636e('0x1e'),_0x228e14,_0x636e('0x1f'));_0x12dc44(_0x513794[_0x636e('0x26')][_0x636e('0x25')]);}})[_0x636e('0x27')](function(_0xa9453b){logger['error'](_0x636e('0x1e'),_0x228e14,_0xa9453b);_0x16dd7d(_0xa9453b);});});}function respondWithStatusCode(_0x523505,_0xd43a5b){_0xd43a5b=_0xd43a5b||0xcc;return function(_0x438ad4){if(_0x438ad4){return _0x523505[_0x636e('0x28')](_0xd43a5b);}return _0x523505[_0x636e('0x29')](_0xd43a5b)['end']();};}function respondWithResult(_0x250256,_0x1dad76){_0x1dad76=_0x1dad76||0xc8;return function(_0xbe62c5){if(_0xbe62c5){return _0x250256['status'](_0x1dad76)['json'](_0xbe62c5);}};}function respondWithFilteredResult(_0x7f871e,_0x509d62){return function(_0x3c9152){if(_0x3c9152){var _0x25dc8d=_0x3c9152[_0x636e('0x2a')],_0xf462f1=_0x509d62[_0x636e('0x2b')],_0x50918b=_0x509d62[_0x636e('0x2b')]+_0x509d62[_0x636e('0x2c')],_0x5658ba;if(_0x50918b>=_0x25dc8d){_0x50918b=_0x25dc8d;_0x5658ba=0xc8;}else{_0x5658ba=0xce;}_0x7f871e[_0x636e('0x29')](_0x5658ba);return _0x7f871e[_0x636e('0x2d')](_0x636e('0x2e'),_0xf462f1+'-'+_0x50918b+'/'+_0x25dc8d)[_0x636e('0x2f')](_0x3c9152);}return null;};}function patchUpdates(_0x35b234){return function(_0xae6adb){try{jsonpatch[_0x636e('0x30')](_0xae6adb,_0x35b234,!![]);}catch(_0x113ace){return BPromise[_0x636e('0x31')](_0x113ace);}return _0xae6adb[_0x636e('0x32')]();};}function saveUpdates(_0x29ef00,_0x4362bd){return function(_0x356dac){if(_0x356dac){return _0x356dac['update'](_0x29ef00)[_0x636e('0x33')](function(_0x2601b0){return _0x2601b0;});}return null;};}function removeEntity(_0x3e974b,_0x2a5ece){return function(_0x15e965){if(_0x15e965){return _0x15e965['destroy']()[_0x636e('0x33')](function(){_0x3e974b['status'](0xcc)[_0x636e('0x34')]();});}};}function handleEntityNotFound(_0x1b2c7a,_0x270b5f){return function(_0xf30790){if(!_0xf30790){_0x1b2c7a[_0x636e('0x28')](0x194);}return _0xf30790;};}function handleError(_0xbb5f09,_0x11adc2){_0x11adc2=_0x11adc2||0x1f4;return function(_0x1d60ea){logger[_0x636e('0x23')](_0x1d60ea[_0x636e('0x35')]);if(_0x1d60ea[_0x636e('0x36')]){delete _0x1d60ea[_0x636e('0x36')];}_0xbb5f09[_0x636e('0x29')](_0x11adc2)[_0x636e('0x37')](_0x1d60ea);};}exports[_0x636e('0x38')]=function(_0x300545,_0xfa8c7a){var _0x16f6f0={},_0x54a6f1={},_0x2ab630={'count':0x0,'rows':[]};var _0xf9b6c8=db[_0x636e('0x39')][_0x636e('0x3a')];_0x54a6f1[_0x636e('0x3b')]=_[_0x636e('0x3c')](_0xf9b6c8);_0x54a6f1[_0x636e('0x3d')]=_[_0x636e('0x3c')](_0x300545[_0x636e('0x3d')]);_0x54a6f1[_0x636e('0x3e')]=_['intersection'](_0x54a6f1[_0x636e('0x3b')],_0x54a6f1[_0x636e('0x3d')]);_0x16f6f0['attributes']=_[_0x636e('0x3f')](_0x54a6f1[_0x636e('0x3b')],qs['fields'](_0x300545[_0x636e('0x3d')][_0x636e('0x40')]));_0x16f6f0['attributes']=_0x16f6f0[_0x636e('0x41')]['length']?_0x16f6f0[_0x636e('0x41')]:_0x54a6f1[_0x636e('0x3b')];if(!_0x300545[_0x636e('0x3d')][_0x636e('0x42')]('nolimit')){_0x16f6f0['limit']=qs[_0x636e('0x2c')](_0x300545[_0x636e('0x3d')]['limit']);_0x16f6f0[_0x636e('0x2b')]=qs[_0x636e('0x2b')](_0x300545[_0x636e('0x3d')]['offset']);}_0x16f6f0[_0x636e('0x43')]=qs[_0x636e('0x44')](_0x300545[_0x636e('0x3d')][_0x636e('0x44')]);_0x16f6f0[_0x636e('0x45')]=qs[_0x636e('0x3e')](_[_0x636e('0x46')](_0x300545[_0x636e('0x3d')],_0x54a6f1[_0x636e('0x3e')]));if(_0x300545[_0x636e('0x3d')][_0x636e('0x47')]){_0x16f6f0[_0x636e('0x45')]=_[_0x636e('0x48')](_0x16f6f0['where'],{'$or':_[_0x636e('0x49')](_0xf9b6c8,function(_0x3f0340){if(_0x3f0340[_0x636e('0x4a')]['key']!==_0x636e('0x4b')){var _0x251eaf={};_0x251eaf[_0x3f0340[_0x636e('0x4c')]]={'$like':'%'+_0x300545[_0x636e('0x3d')]['filter']+'%'};return _0x251eaf;}})});}_0x16f6f0=_['merge']({},_0x16f6f0,_0x300545['options']);var _0x5c5d68={'where':_0x16f6f0[_0x636e('0x45')]};return db[_0x636e('0x39')][_0x636e('0x2a')](_0x5c5d68)['then'](function(_0x477f99){_0x2ab630[_0x636e('0x2a')]=_0x477f99;if(_0x300545[_0x636e('0x3d')]['includeAll']){_0x16f6f0[_0x636e('0x4d')]=[{'all':!![]}];}return db[_0x636e('0x39')][_0x636e('0x4e')](_0x16f6f0);})[_0x636e('0x33')](function(_0x2e4bf8){_0x2ab630['rows']=_0x2e4bf8;return _0x2ab630;})[_0x636e('0x33')](respondWithFilteredResult(_0xfa8c7a,_0x16f6f0))[_0x636e('0x27')](handleError(_0xfa8c7a,null));};exports[_0x636e('0x4f')]=function(_0x39dc0f,_0x17f326){var _0x16fe57={'raw':![],'where':{'id':_0x39dc0f[_0x636e('0x50')]['id']}},_0x1f29ca={};_0x1f29ca[_0x636e('0x3b')]=_[_0x636e('0x3c')](db[_0x636e('0x39')][_0x636e('0x3a')]);_0x1f29ca['query']=_['keys'](_0x39dc0f[_0x636e('0x3d')]);_0x1f29ca[_0x636e('0x3e')]=_[_0x636e('0x3f')](_0x1f29ca[_0x636e('0x3b')],_0x1f29ca[_0x636e('0x3d')]);_0x16fe57[_0x636e('0x41')]=_[_0x636e('0x3f')](_0x1f29ca[_0x636e('0x3b')],qs['fields'](_0x39dc0f[_0x636e('0x3d')]['fields']));_0x16fe57['attributes']=_0x16fe57[_0x636e('0x41')][_0x636e('0x51')]?_0x16fe57[_0x636e('0x41')]:_0x1f29ca[_0x636e('0x3b')];if(_0x39dc0f['query'][_0x636e('0x52')]){_0x16fe57[_0x636e('0x4d')]=[{'all':!![]}];}_0x16fe57=_[_0x636e('0x48')]({},_0x16fe57,_0x39dc0f['options']);return db['Setting']['find'](_0x16fe57)[_0x636e('0x33')](handleEntityNotFound(_0x17f326,null))[_0x636e('0x33')](respondWithResult(_0x17f326,null))[_0x636e('0x27')](handleError(_0x17f326,null));};exports[_0x636e('0x53')]=function(_0x306e63,_0x91bb7f,_0x2ebdca){var _0x2a9b3d;return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x306e63[_0x636e('0x50')]['id']}})['then'](handleEntityNotFound(_0x91bb7f,null))[_0x636e('0x33')](saveUpdates(_0x306e63[_0x636e('0x55')],null))[_0x636e('0x33')](function(_0xf03a11){if(_0xf03a11){_0x2a9b3d=_0xf03a11['get']({'plain':!![]});var _0x2be0eb=fs['readFileSync'](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x636e('0x58')),'utf8');var _0x524184=ejs['render'](_0x2be0eb,_0x2a9b3d);var _0x27e1d3=fs[_0x636e('0x59')](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x636e('0x5a')),_0x636e('0x5b'));var _0x2981cf=ejs['render'](_0x27e1d3,_0x2a9b3d);fs[_0x636e('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x524184);fs[_0x636e('0x5c')](_0x636e('0x5d'),_0x2981cf);return respondWithRpcPromise(_0x636e('0x5e'),_0x636e('0x53'),{'module':'res_stun_monitor.so'});}})[_0x636e('0x33')](function(){return respondWithRpcPromise(_0x636e('0x5e'),_0x636e('0x53'),{'module':'res_rtp_asterisk.so'});})[_0x636e('0x33')](function(){return _0x2a9b3d||null;})[_0x636e('0x33')](respondWithResult(_0x91bb7f,null))[_0x636e('0x27')](handleError(_0x91bb7f,null));};exports[_0x636e('0x5f')]=function(_0x2de0db,_0x30f732,_0x42ec3b){if(_0x2de0db['file']&&_0x2de0db[_0x636e('0x60')]['filename']){_0x2de0db[_0x636e('0x55')][_0x636e('0x61')]=_0x2de0db[_0x636e('0x60')]['filename'];}return db[_0x636e('0x39')]['find']({'where':{'id':_0x2de0db['params']['id']}})[_0x636e('0x33')](handleEntityNotFound(_0x30f732,null))[_0x636e('0x33')](saveUpdates(_0x2de0db[_0x636e('0x55')],null))[_0x636e('0x33')](respondWithResult(_0x30f732,null))[_0x636e('0x27')](handleError(_0x30f732,null));};exports['addLogoLogin']=function(_0x12bca3,_0x165757,_0x275eb5){if(_0x12bca3[_0x636e('0x60')]&&_0x12bca3[_0x636e('0x60')][_0x636e('0x62')]){_0x12bca3[_0x636e('0x55')][_0x636e('0x63')]=_0x12bca3['file'][_0x636e('0x62')];}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x12bca3[_0x636e('0x50')]['id']}})['then'](handleEntityNotFound(_0x165757,null))[_0x636e('0x33')](saveUpdates(_0x12bca3[_0x636e('0x55')],null))['then'](respondWithResult(_0x165757,null))[_0x636e('0x27')](handleError(_0x165757,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x65')]=function(_0x38045b,_0xfb64b4,_0x401164){var _0x16ed60=_0x636e('0x66');var _0x264798={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2bb630){if(_0x2bb630){_0x264798=_0x2bb630;}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x38045b['params']['id']},'attributes':[_0x636e('0x61'),_0x636e('0x63'),'preferred',_0x636e('0x67'),_0x636e('0x68'),_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xfb64b4,null))[_0x636e('0x33')](function(_0x10a3c6){if(_0x10a3c6){var _0x13a7dc=_0x10a3c6[_0x636e('0x61')]&&fs[_0x636e('0x6a')](path[_0x636e('0x56')](config['root'],_0x16ed60,_[_0x636e('0x6b')](_0x10a3c6[_0x636e('0x61')])))?path[_0x636e('0x56')](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x10a3c6[_0x636e('0x61')])):path['join'](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x636e('0x6c')));var _0x3fdb9c=_0x636e('0x6d')+_['upperFirst'](_0x636e('0x61'));if(_0x10a3c6[_0x3fdb9c]||!_0x264798[_0x636e('0x6e')]){_0x13a7dc=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x636e('0x6c')));}if(!fs[_0x636e('0x6a')](_0x13a7dc)){throw new db['Sequelize'][(_0x636e('0x6f'))]('Logo\x20not\x20found');}return _0xfb64b4[_0x636e('0x70')](_0x13a7dc);}})['catch'](handleError(_0xfb64b4,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x71')]=function(_0xd4e11,_0xaddef2,_0xf80168){var _0x70510c=_0x636e('0x66');var _0x39d365={'custom':![]};return utilLicense['getLicense']()[_0x636e('0x33')](function(_0xcf51a6){if(_0xcf51a6){_0x39d365=_0xcf51a6;}return db['Setting'][_0x636e('0x54')]({'where':{'id':_0xd4e11[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x61'),'loginLogo',_0x636e('0x72'),_0x636e('0x67'),_0x636e('0x68'),_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xaddef2,null))[_0x636e('0x33')](function(_0x41853c){if(_0x41853c){var _0x3bf6c0=_0x41853c['loginLogo']&&fs[_0x636e('0x6a')](path['join'](config['root'],_0x70510c,_[_0x636e('0x6b')](_0x41853c[_0x636e('0x63')])))?path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x41853c[_0x636e('0x63')])):path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x636e('0x73')));var _0x59ca15=_0x636e('0x6d')+_[_0x636e('0x74')]('loginLogo');if(_0x41853c[_0x59ca15]||!_0x39d365[_0x636e('0x6e')]){_0x3bf6c0=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x636e('0x73')));}if(!fs[_0x636e('0x6a')](_0x3bf6c0)){throw new db[(_0x636e('0x75'))][(_0x636e('0x6f'))](_0x636e('0x76'));}return _0xaddef2['download'](_0x3bf6c0);}})[_0x636e('0x27')](handleError(_0xaddef2,null));};exports['gdpr']=function(_0x28cd03,_0x4331de){return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x28cd03[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x77')]})[_0x636e('0x33')](respondWithResult(_0x4331de,null))[_0x636e('0x27')](handleError(_0x4331de,null));};exports[_0x636e('0x78')]=function(_0x1a6efc,_0x31007a,_0xe96fcf){if(_0x1a6efc[_0x636e('0x60')]&&_0x1a6efc['file'][_0x636e('0x62')]){_0x1a6efc['body'][_0x636e('0x72')]=_0x1a6efc[_0x636e('0x60')]['filename'];}return db['Setting'][_0x636e('0x54')]({'where':{'id':_0x1a6efc[_0x636e('0x50')]['id']}})[_0x636e('0x33')](handleEntityNotFound(_0x31007a,null))[_0x636e('0x33')](saveUpdates(_0x1a6efc[_0x636e('0x55')],null))['then'](respondWithResult(_0x31007a,null))['catch'](handleError(_0x31007a,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x79')]=function(_0x6cdb99,_0x4a3245,_0x754c6d){var _0x26649b='server/files/images/logos';var _0x453825={'custom':![]};return utilLicense[_0x636e('0x7a')]()[_0x636e('0x33')](function(_0x3a967a){if(_0x3a967a){_0x453825=_0x3a967a;}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x6cdb99[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x61'),_0x636e('0x63'),_0x636e('0x72'),'defaultLogo','defaultLoginLogo',_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a3245,null))[_0x636e('0x33')](function(_0x345ef3){if(_0x345ef3){var _0x4a55bd=_0x345ef3[_0x636e('0x72')]&&fs[_0x636e('0x6a')](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x26649b,_[_0x636e('0x6b')](_0x345ef3['preferred'])))?path[_0x636e('0x56')](config['root'],_0x26649b,_[_0x636e('0x6b')](_0x345ef3[_0x636e('0x72')])):path['join'](config[_0x636e('0x57')],_0x26649b,_['toLower']('default_preferred.png'));var _0x130c10=_0x636e('0x6d')+_[_0x636e('0x74')](_0x636e('0x72'));if(_0x345ef3[_0x130c10]||!_0x453825[_0x636e('0x6e')]||!_0x453825[_0x636e('0x72')]){_0x4a55bd=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x26649b,_[_0x636e('0x6b')](_0x636e('0x7b')));}if(!fs['existsSync'](_0x4a55bd)){throw new db['Sequelize'][(_0x636e('0x6f'))](_0x636e('0x76'));}return _0x4a3245['download'](_0x4a55bd);}})['catch'](handleError(_0x4a3245,null));}; \ No newline at end of file +var _0xfb45=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','update','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','Setting','findAll','catch','show','params','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','render','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','../../config/license/util','getLogo','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default','custom','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','server/files/images/logos','loginLogo','default_loginLogo.png','upperFirst','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x268628,_0x544dfc){var _0x45c597=function(_0x4649b0){while(--_0x4649b0){_0x268628['push'](_0x268628['shift']());}};_0x45c597(++_0x544dfc);}(_0xfb45,0x6a));var _0x5fb4=function(_0x2f824c,_0x798538){_0x2f824c=_0x2f824c-0x0;var _0x20753d=_0xfb45[_0x2f824c];return _0x20753d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fb4('0x0'));var rimraf=require(_0x5fb4('0x1'));var zipdir=require(_0x5fb4('0x2'));var jsonpatch=require(_0x5fb4('0x3'));var rp=require('request-promise');var moment=require(_0x5fb4('0x4'));var BPromise=require(_0x5fb4('0x5'));var Mustache=require(_0x5fb4('0x6'));var util=require(_0x5fb4('0x7'));var path=require(_0x5fb4('0x8'));var sox=require(_0x5fb4('0x9'));var csv=require(_0x5fb4('0xa'));var ejs=require(_0x5fb4('0xb'));var fs=require('fs');var _=require(_0x5fb4('0xc'));var squel=require('squel');var crypto=require(_0x5fb4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5fb4('0xe'));var toCsv=require(_0x5fb4('0xa'));var querystring=require('querystring');var Papa=require(_0x5fb4('0xf'));var Redis=require(_0x5fb4('0x10'));var authService=require(_0x5fb4('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5fb4('0x12'));var logger=require(_0x5fb4('0x13'))(_0x5fb4('0x14'));var utils=require(_0x5fb4('0x15'));var config=require(_0x5fb4('0x16'));var db=require(_0x5fb4('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5fb4('0x18')][_0x5fb4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2a8734,_0x1a9cac,_0x40f00b){if(_0x40f00b){var _0x195a48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x195a48[_0x5fb4('0x1a')](_0x1a9cac)){return _0x2a8734;}else{throw new Error(_0x5fb4('0x1b'));}}else{return _0x2a8734;}}function respondWithRpcPromise(_0xc82862,_0x48651d,_0x538727,_0x4b9968){return new BPromise(function(_0x2315f8,_0x2d216e){var _0x578387=_0x4b9968||client;return _0x578387['request'](_0xc82862,_0x538727)[_0x5fb4('0x1c')](function(_0x59c84d){logger[_0x5fb4('0x1d')](_0x5fb4('0x1e'),_0x48651d,'request\x20sent');logger[_0x5fb4('0x1f')](_0x5fb4('0x20'),_0x48651d,_0x5fb4('0x21'),JSON['stringify'](_0x59c84d));if(_0x59c84d[_0x5fb4('0x22')]){if(_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x23')]===0x1f4){logger[_0x5fb4('0x22')](_0x5fb4('0x1e'),_0x48651d,_0x59c84d['error'][_0x5fb4('0x24')]);return _0x2d216e(_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x24')]);}logger['error'](_0x5fb4('0x1e'),_0x48651d,_0x59c84d[_0x5fb4('0x22')][_0x5fb4('0x24')]);return _0x2315f8(_0x59c84d['error'][_0x5fb4('0x24')]);}else{logger['info'](_0x5fb4('0x1e'),_0x48651d,_0x5fb4('0x21'));_0x2315f8(_0x59c84d[_0x5fb4('0x25')][_0x5fb4('0x24')]);}})['catch'](function(_0x128e78){logger[_0x5fb4('0x22')](_0x5fb4('0x1e'),_0x48651d,_0x128e78);_0x2d216e(_0x128e78);});});}function respondWithStatusCode(_0x2fae54,_0xca857f){_0xca857f=_0xca857f||0xcc;return function(_0x34f261){if(_0x34f261){return _0x2fae54[_0x5fb4('0x26')](_0xca857f);}return _0x2fae54['status'](_0xca857f)[_0x5fb4('0x27')]();};}function respondWithResult(_0x1f3cb4,_0x44e7f9){_0x44e7f9=_0x44e7f9||0xc8;return function(_0x27d935){if(_0x27d935){return _0x1f3cb4[_0x5fb4('0x28')](_0x44e7f9)['json'](_0x27d935);}};}function respondWithFilteredResult(_0x2901f2,_0x3413e7){return function(_0x227f50){if(_0x227f50){var _0x56daf8=_0x227f50[_0x5fb4('0x29')],_0x1a103c=_0x3413e7[_0x5fb4('0x2a')],_0x181fc1=_0x3413e7[_0x5fb4('0x2a')]+_0x3413e7[_0x5fb4('0x2b')],_0x4cb56e;if(_0x181fc1>=_0x56daf8){_0x181fc1=_0x56daf8;_0x4cb56e=0xc8;}else{_0x4cb56e=0xce;}_0x2901f2[_0x5fb4('0x28')](_0x4cb56e);return _0x2901f2['set'](_0x5fb4('0x2c'),_0x1a103c+'-'+_0x181fc1+'/'+_0x56daf8)[_0x5fb4('0x2d')](_0x227f50);}return null;};}function patchUpdates(_0x51a880){return function(_0x5d02a6){try{jsonpatch[_0x5fb4('0x2e')](_0x5d02a6,_0x51a880,!![]);}catch(_0x4512d7){return BPromise['reject'](_0x4512d7);}return _0x5d02a6['save']();};}function saveUpdates(_0x5d1cda,_0xc25f03){return function(_0xb4e41c){if(_0xb4e41c){return _0xb4e41c[_0x5fb4('0x2f')](_0x5d1cda)['then'](function(_0x374e86){return _0x374e86;});}return null;};}function removeEntity(_0x310feb,_0xb9a173){return function(_0x119506){if(_0x119506){return _0x119506['destroy']()[_0x5fb4('0x1c')](function(){_0x310feb[_0x5fb4('0x28')](0xcc)[_0x5fb4('0x27')]();});}};}function handleEntityNotFound(_0x469f67,_0x5abb12){return function(_0x3eb77f){if(!_0x3eb77f){_0x469f67[_0x5fb4('0x26')](0x194);}return _0x3eb77f;};}function handleError(_0xa2d48d,_0x29dca1){_0x29dca1=_0x29dca1||0x1f4;return function(_0x23ff83){logger[_0x5fb4('0x22')](_0x23ff83[_0x5fb4('0x30')]);if(_0x23ff83[_0x5fb4('0x31')]){delete _0x23ff83[_0x5fb4('0x31')];}_0xa2d48d['status'](_0x29dca1)[_0x5fb4('0x32')](_0x23ff83);};}exports[_0x5fb4('0x33')]=function(_0x2c2427,_0x8626cc){var _0x462ceb={},_0x16553c={},_0x520159={'count':0x0,'rows':[]};var _0x4feec3=db['Setting'][_0x5fb4('0x34')];_0x16553c[_0x5fb4('0x35')]=_[_0x5fb4('0x36')](_0x4feec3);_0x16553c[_0x5fb4('0x37')]=_[_0x5fb4('0x36')](_0x2c2427[_0x5fb4('0x37')]);_0x16553c[_0x5fb4('0x38')]=_['intersection'](_0x16553c[_0x5fb4('0x35')],_0x16553c['query']);_0x462ceb[_0x5fb4('0x39')]=_[_0x5fb4('0x3a')](_0x16553c['model'],qs[_0x5fb4('0x3b')](_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x3b')]));_0x462ceb[_0x5fb4('0x39')]=_0x462ceb['attributes'][_0x5fb4('0x3c')]?_0x462ceb[_0x5fb4('0x39')]:_0x16553c[_0x5fb4('0x35')];if(!_0x2c2427['query'][_0x5fb4('0x3d')](_0x5fb4('0x3e'))){_0x462ceb[_0x5fb4('0x2b')]=qs[_0x5fb4('0x2b')](_0x2c2427['query'][_0x5fb4('0x2b')]);_0x462ceb[_0x5fb4('0x2a')]=qs[_0x5fb4('0x2a')](_0x2c2427[_0x5fb4('0x37')]['offset']);}_0x462ceb[_0x5fb4('0x3f')]=qs['sort'](_0x2c2427[_0x5fb4('0x37')]['sort']);_0x462ceb[_0x5fb4('0x40')]=qs[_0x5fb4('0x38')](_[_0x5fb4('0x41')](_0x2c2427[_0x5fb4('0x37')],_0x16553c[_0x5fb4('0x38')]));if(_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x42')]){_0x462ceb[_0x5fb4('0x40')]=_[_0x5fb4('0x43')](_0x462ceb[_0x5fb4('0x40')],{'$or':_[_0x5fb4('0x44')](_0x4feec3,function(_0x4c6196){if(_0x4c6196['type'][_0x5fb4('0x45')]!==_0x5fb4('0x46')){var _0x1c53c7={};_0x1c53c7[_0x4c6196[_0x5fb4('0x47')]]={'$like':'%'+_0x2c2427[_0x5fb4('0x37')]['filter']+'%'};return _0x1c53c7;}})});}_0x462ceb=_[_0x5fb4('0x43')]({},_0x462ceb,_0x2c2427[_0x5fb4('0x48')]);var _0x3fdf37={'where':_0x462ceb[_0x5fb4('0x40')]};return db['Setting'][_0x5fb4('0x29')](_0x3fdf37)[_0x5fb4('0x1c')](function(_0x2b1e32){_0x520159[_0x5fb4('0x29')]=_0x2b1e32;if(_0x2c2427[_0x5fb4('0x37')][_0x5fb4('0x49')]){_0x462ceb[_0x5fb4('0x4a')]=[{'all':!![]}];}return db[_0x5fb4('0x4b')][_0x5fb4('0x4c')](_0x462ceb);})[_0x5fb4('0x1c')](function(_0x44706e){_0x520159['rows']=_0x44706e;return _0x520159;})[_0x5fb4('0x1c')](respondWithFilteredResult(_0x8626cc,_0x462ceb))[_0x5fb4('0x4d')](handleError(_0x8626cc,null));};exports[_0x5fb4('0x4e')]=function(_0x16c133,_0x289745){var _0x385a63={'raw':![],'where':{'id':_0x16c133[_0x5fb4('0x4f')]['id']}},_0x17f1da={};_0x17f1da['model']=_[_0x5fb4('0x36')](db['Setting'][_0x5fb4('0x34')]);_0x17f1da[_0x5fb4('0x37')]=_['keys'](_0x16c133[_0x5fb4('0x37')]);_0x17f1da['filters']=_[_0x5fb4('0x3a')](_0x17f1da[_0x5fb4('0x35')],_0x17f1da['query']);_0x385a63['attributes']=_[_0x5fb4('0x3a')](_0x17f1da['model'],qs[_0x5fb4('0x3b')](_0x16c133['query'][_0x5fb4('0x3b')]));_0x385a63[_0x5fb4('0x39')]=_0x385a63['attributes'][_0x5fb4('0x3c')]?_0x385a63[_0x5fb4('0x39')]:_0x17f1da[_0x5fb4('0x35')];if(_0x16c133[_0x5fb4('0x37')][_0x5fb4('0x49')]){_0x385a63[_0x5fb4('0x4a')]=[{'all':!![]}];}_0x385a63=_[_0x5fb4('0x43')]({},_0x385a63,_0x16c133[_0x5fb4('0x48')]);return db['Setting']['find'](_0x385a63)[_0x5fb4('0x1c')](handleEntityNotFound(_0x289745,null))['then'](respondWithResult(_0x289745,null))[_0x5fb4('0x4d')](handleError(_0x289745,null));};exports[_0x5fb4('0x2f')]=function(_0xd725cf,_0xc8aa21,_0xc5ded6){var _0x52ed9f;return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0xd725cf[_0x5fb4('0x4f')]['id']}})['then'](handleEntityNotFound(_0xc8aa21,null))[_0x5fb4('0x1c')](saveUpdates(_0xd725cf[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](function(_0x1b8768){if(_0x1b8768){_0x52ed9f=_0x1b8768[_0x5fb4('0x52')]({'plain':!![]});var _0x500569=fs[_0x5fb4('0x53')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x5fb4('0x56')),'utf8');var _0x14c066=ejs[_0x5fb4('0x57')](_0x500569,_0x52ed9f);var _0x206285=fs[_0x5fb4('0x53')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x5fb4('0x58')),_0x5fb4('0x59'));var _0xc47484=ejs['render'](_0x206285,_0x52ed9f);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x14c066);fs[_0x5fb4('0x5a')](_0x5fb4('0x5b'),_0xc47484);return respondWithRpcPromise('Reload',_0x5fb4('0x2f'),{'module':'res_stun_monitor.so'});}})[_0x5fb4('0x1c')](function(){return respondWithRpcPromise(_0x5fb4('0x5c'),_0x5fb4('0x2f'),{'module':_0x5fb4('0x5d')});})['then'](function(){return _0x52ed9f||null;})[_0x5fb4('0x1c')](respondWithResult(_0xc8aa21,null))[_0x5fb4('0x4d')](handleError(_0xc8aa21,null));};exports[_0x5fb4('0x5e')]=function(_0x38a0b4,_0x3ae33b,_0x8d4fb0){if(_0x38a0b4[_0x5fb4('0x5f')]&&_0x38a0b4['file'][_0x5fb4('0x60')]){_0x38a0b4[_0x5fb4('0x51')]['logo']=_0x38a0b4[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x38a0b4[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x3ae33b,null))[_0x5fb4('0x1c')](saveUpdates(_0x38a0b4[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](respondWithResult(_0x3ae33b,null))[_0x5fb4('0x4d')](handleError(_0x3ae33b,null));};exports[_0x5fb4('0x61')]=function(_0x5ad474,_0x46d630,_0x40b813){if(_0x5ad474[_0x5fb4('0x5f')]&&_0x5ad474[_0x5fb4('0x5f')][_0x5fb4('0x60')]){_0x5ad474[_0x5fb4('0x51')]['loginLogo']=_0x5ad474[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x5ad474[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x46d630,null))['then'](saveUpdates(_0x5ad474[_0x5fb4('0x51')],null))[_0x5fb4('0x1c')](respondWithResult(_0x46d630,null))['catch'](handleError(_0x46d630,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x63')]=function(_0x349955,_0x31d8c9,_0x4be7ed){var _0x2ef281='server/files/images/logos';var _0x214124={'custom':![]};return utilLicense[_0x5fb4('0x64')]()[_0x5fb4('0x1c')](function(_0x4d5221){if(_0x4d5221){_0x214124=_0x4d5221;}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x349955[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x65'),'loginLogo',_0x5fb4('0x66'),_0x5fb4('0x67'),_0x5fb4('0x68'),_0x5fb4('0x69')],'raw':!![]});})[_0x5fb4('0x1c')](handleEntityNotFound(_0x31d8c9,null))[_0x5fb4('0x1c')](function(_0x3d5704){if(_0x3d5704){var _0x4cad34=_0x3d5704['logo']&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x2ef281,_['toLower'](_0x3d5704['logo'])))?path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x2ef281,_['toLower'](_0x3d5704['logo'])):path['join'](config[_0x5fb4('0x55')],_0x2ef281,_[_0x5fb4('0x6b')]('default_logo.png'));var _0x54278b=_0x5fb4('0x6c')+_['upperFirst'](_0x5fb4('0x65'));if(_0x3d5704[_0x54278b]||!_0x214124[_0x5fb4('0x6d')]){_0x4cad34=path[_0x5fb4('0x54')](config['root'],_0x2ef281,_['toLower']('default_logo.png'));}if(!fs[_0x5fb4('0x6a')](_0x4cad34)){throw new db[(_0x5fb4('0x6e'))][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0x31d8c9[_0x5fb4('0x71')](_0x4cad34);}})[_0x5fb4('0x4d')](handleError(_0x31d8c9,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x72')]=function(_0x1d2b93,_0xaac510,_0x428d52){var _0x262e2f=_0x5fb4('0x73');var _0x1c2a92={'custom':![]};return utilLicense['getLicense']()[_0x5fb4('0x1c')](function(_0x341b01){if(_0x341b01){_0x1c2a92=_0x341b01;}return db['Setting']['find']({'where':{'id':_0x1d2b93[_0x5fb4('0x4f')]['id']},'attributes':['logo',_0x5fb4('0x74'),'preferred',_0x5fb4('0x67'),_0x5fb4('0x68'),_0x5fb4('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xaac510,null))[_0x5fb4('0x1c')](function(_0x38e1b3){if(_0x38e1b3){var _0x1ab1b9=_0x38e1b3[_0x5fb4('0x74')]&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x262e2f,_[_0x5fb4('0x6b')](_0x38e1b3[_0x5fb4('0x74')])))?path['join'](config[_0x5fb4('0x55')],_0x262e2f,_['toLower'](_0x38e1b3[_0x5fb4('0x74')])):path['join'](config[_0x5fb4('0x55')],_0x262e2f,_[_0x5fb4('0x6b')](_0x5fb4('0x75')));var _0x14b732='default'+_[_0x5fb4('0x76')](_0x5fb4('0x74'));if(_0x38e1b3[_0x14b732]||!_0x1c2a92[_0x5fb4('0x6d')]){_0x1ab1b9=path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x262e2f,_['toLower'](_0x5fb4('0x75')));}if(!fs[_0x5fb4('0x6a')](_0x1ab1b9)){throw new db[(_0x5fb4('0x6e'))][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0xaac510[_0x5fb4('0x71')](_0x1ab1b9);}})[_0x5fb4('0x4d')](handleError(_0xaac510,null));};exports[_0x5fb4('0x77')]=function(_0xa7df89,_0x1018bb){return db[_0x5fb4('0x4b')]['find']({'where':{'id':_0xa7df89[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x78')]})[_0x5fb4('0x1c')](respondWithResult(_0x1018bb,null))[_0x5fb4('0x4d')](handleError(_0x1018bb,null));};exports[_0x5fb4('0x79')]=function(_0x2e04d1,_0x3cd3ff,_0xfa12a3){if(_0x2e04d1[_0x5fb4('0x5f')]&&_0x2e04d1[_0x5fb4('0x5f')][_0x5fb4('0x60')]){_0x2e04d1[_0x5fb4('0x51')][_0x5fb4('0x66')]=_0x2e04d1[_0x5fb4('0x5f')][_0x5fb4('0x60')];}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x2e04d1[_0x5fb4('0x4f')]['id']}})[_0x5fb4('0x1c')](handleEntityNotFound(_0x3cd3ff,null))['then'](saveUpdates(_0x2e04d1[_0x5fb4('0x51')],null))['then'](respondWithResult(_0x3cd3ff,null))[_0x5fb4('0x4d')](handleError(_0x3cd3ff,null));};var utilLicense=require(_0x5fb4('0x62'));exports[_0x5fb4('0x7a')]=function(_0x9488b7,_0x4638f8,_0x47c1c8){var _0x36d2c3=_0x5fb4('0x73');var _0x25aa57={'custom':![]};return utilLicense[_0x5fb4('0x64')]()[_0x5fb4('0x1c')](function(_0x2e0bc6){if(_0x2e0bc6){_0x25aa57=_0x2e0bc6;}return db[_0x5fb4('0x4b')][_0x5fb4('0x50')]({'where':{'id':_0x9488b7[_0x5fb4('0x4f')]['id']},'attributes':[_0x5fb4('0x65'),_0x5fb4('0x74'),_0x5fb4('0x66'),_0x5fb4('0x67'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x4638f8,null))[_0x5fb4('0x1c')](function(_0x21017f){if(_0x21017f){var _0x14f75f=_0x21017f['preferred']&&fs[_0x5fb4('0x6a')](path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x36d2c3,_[_0x5fb4('0x6b')](_0x21017f[_0x5fb4('0x66')])))?path[_0x5fb4('0x54')](config['root'],_0x36d2c3,_['toLower'](_0x21017f['preferred'])):path[_0x5fb4('0x54')](config[_0x5fb4('0x55')],_0x36d2c3,_[_0x5fb4('0x6b')](_0x5fb4('0x7b')));var _0x294b12=_0x5fb4('0x6c')+_['upperFirst'](_0x5fb4('0x66'));if(_0x21017f[_0x294b12]||!_0x25aa57[_0x5fb4('0x6d')]||!_0x25aa57[_0x5fb4('0x66')]){_0x14f75f=path[_0x5fb4('0x54')](config['root'],_0x36d2c3,_['toLower'](_0x5fb4('0x7b')));}if(!fs[_0x5fb4('0x6a')](_0x14f75f)){throw new db['Sequelize'][(_0x5fb4('0x6f'))](_0x5fb4('0x70'));}return _0x4638f8[_0x5fb4('0x71')](_0x14f75f);}})[_0x5fb4('0x4d')](handleError(_0x4638f8,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f4bec14..d4e403a 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 _0x5e40=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings'];(function(_0x57e8e1,_0x6ad2c5){var _0x504ae0=function(_0x519cd7){while(--_0x519cd7){_0x57e8e1['push'](_0x57e8e1['shift']());}};_0x504ae0(++_0x6ad2c5);}(_0x5e40,0xd1));var _0x05e4=function(_0x1c546b,_0x304e8f){_0x1c546b=_0x1c546b-0x0;var _0x18398a=_0x5e40[_0x1c546b];return _0x18398a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x05e4('0x0'))('api');var moment=require(_0x05e4('0x1'));var BPromise=require(_0x05e4('0x2'));var rp=require(_0x05e4('0x3'));var fs=require('fs');var path=require(_0x05e4('0x4'));var rimraf=require(_0x05e4('0x5'));var config=require(_0x05e4('0x6'));var attributes=require(_0x05e4('0x7'));module['exports']=function(_0x47e8f6,_0x5a6190){return _0x47e8f6[_0x05e4('0x8')](_0x05e4('0x9'),attributes,{'tableName':_0x05e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcabc=['path','rimraf','../../config/environment','./setting.attributes','define','Setting','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2fc3ee,_0x56ab8c){var _0x2ad3f4=function(_0x101eca){while(--_0x101eca){_0x2fc3ee['push'](_0x2fc3ee['shift']());}};_0x2ad3f4(++_0x56ab8c);}(_0xcabc,0x7f));var _0xccab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcabc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xccab('0x0'))(_0xccab('0x1'));var moment=require(_0xccab('0x2'));var BPromise=require(_0xccab('0x3'));var rp=require(_0xccab('0x4'));var fs=require('fs');var path=require(_0xccab('0x5'));var rimraf=require(_0xccab('0x6'));var config=require(_0xccab('0x7'));var attributes=require(_0xccab('0x8'));module['exports']=function(_0x550f78,_0x535b46){return _0x550f78[_0xccab('0x9')](_0xccab('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0123f2a..d2183bf 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 _0xa258=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xa258,0x155));var _0x8a25=function(_0x1d7487,_0x535d24){_0x1d7487=_0x1d7487-0x0;var _0xfbfd60=_0xa258[_0x1d7487];return _0xfbfd60;};'use strict';var _=require(_0x8a25('0x0'));var util=require(_0x8a25('0x1'));var moment=require(_0x8a25('0x2'));var BPromise=require(_0x8a25('0x3'));var rs=require(_0x8a25('0x4'));var fs=require('fs');var Redis=require(_0x8a25('0x5'));var db=require(_0x8a25('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a25('0x7'))(_0x8a25('0x8'));var config=require(_0x8a25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8a25('0xa')][_0x8a25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e64af,_0x3e1cec,_0x60b6bf){return new BPromise(function(_0x386256,_0x16a362){return client[_0x8a25('0xc')](_0x3e64af,_0x60b6bf)[_0x8a25('0xd')](function(_0x4c7125){logger[_0x8a25('0xe')](_0x8a25('0xf'),_0x3e1cec,_0x8a25('0x10'));logger[_0x8a25('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x3e1cec,'request\x20sent',JSON[_0x8a25('0x12')](_0x4c7125));if(_0x4c7125[_0x8a25('0x13')]){if(_0x4c7125[_0x8a25('0x13')][_0x8a25('0x14')]===0x1f4){logger[_0x8a25('0x13')](_0x8a25('0xf'),_0x3e1cec,_0x4c7125[_0x8a25('0x13')][_0x8a25('0x15')]);return _0x16a362(_0x4c7125['error'][_0x8a25('0x15')]);}logger[_0x8a25('0x13')](_0x8a25('0xf'),_0x3e1cec,_0x4c7125['error'][_0x8a25('0x15')]);return _0x386256(_0x4c7125[_0x8a25('0x13')]['message']);}else{logger[_0x8a25('0xe')](_0x8a25('0xf'),_0x3e1cec,_0x8a25('0x10'));_0x386256(_0x4c7125[_0x8a25('0x16')][_0x8a25('0x15')]);}})[_0x8a25('0x17')](function(_0x31604f){logger['error'](_0x8a25('0xf'),_0x3e1cec,_0x31604f);_0x16a362(_0x31604f);});});} \ No newline at end of file +var _0x93b8=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x65eb6d,_0x3cd45c){var _0x580e3d=function(_0x346085){while(--_0x346085){_0x65eb6d['push'](_0x65eb6d['shift']());}};_0x580e3d(++_0x3cd45c);}(_0x93b8,0x160));var _0x893b=function(_0x1e33fd,_0x12d3a5){_0x1e33fd=_0x1e33fd-0x0;var _0x4f4ea7=_0x93b8[_0x1e33fd];return _0x4f4ea7;};'use strict';var _=require(_0x893b('0x0'));var util=require(_0x893b('0x1'));var moment=require(_0x893b('0x2'));var BPromise=require(_0x893b('0x3'));var rs=require(_0x893b('0x4'));var fs=require('fs');var Redis=require(_0x893b('0x5'));var db=require(_0x893b('0x6'))['db'];var utils=require(_0x893b('0x7'));var logger=require(_0x893b('0x8'))(_0x893b('0x9'));var config=require('../../config/environment');var jayson=require(_0x893b('0xa'));var client=jayson[_0x893b('0xb')][_0x893b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3db73d,_0x310774,_0x48b5eb){return new BPromise(function(_0x135189,_0x3310dc){return client[_0x893b('0xd')](_0x3db73d,_0x48b5eb)[_0x893b('0xe')](function(_0x21c8ba){logger[_0x893b('0xf')](_0x893b('0x10'),_0x310774,_0x893b('0x11'));logger[_0x893b('0x12')](_0x893b('0x13'),_0x310774,_0x893b('0x11'),JSON[_0x893b('0x14')](_0x21c8ba));if(_0x21c8ba[_0x893b('0x15')]){if(_0x21c8ba[_0x893b('0x15')][_0x893b('0x16')]===0x1f4){logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x21c8ba[_0x893b('0x15')][_0x893b('0x17')]);return _0x3310dc(_0x21c8ba['error']['message']);}logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x21c8ba[_0x893b('0x15')]['message']);return _0x135189(_0x21c8ba[_0x893b('0x15')][_0x893b('0x17')]);}else{logger[_0x893b('0xf')](_0x893b('0x10'),_0x310774,_0x893b('0x11'));_0x135189(_0x21c8ba[_0x893b('0x18')][_0x893b('0x17')]);}})[_0x893b('0x19')](function(_0x8fcc83){logger[_0x893b('0x15')](_0x893b('0x10'),_0x310774,_0x8fcc83);_0x3310dc(_0x8fcc83);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c348471..f37b631 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 _0xc9f7=['describe','get','/:id','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/canned_answers','notify','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','/describe'];(function(_0xf60b0b,_0x2df608){var _0x21ec2a=function(_0x12d274){while(--_0x12d274){_0xf60b0b['push'](_0xf60b0b['shift']());}};_0x21ec2a(++_0x2df608);}(_0xc9f7,0x1e0));var _0x7c9f=function(_0x247408,_0x548427){_0x247408=_0x247408-0x0;var _0x74163b=_0xc9f7[_0x247408];return _0x74163b;};'use strict';var multer=require(_0x7c9f('0x0'));var util=require(_0x7c9f('0x1'));var path=require(_0x7c9f('0x2'));var timeout=require(_0x7c9f('0x3'));var express=require(_0x7c9f('0x4'));var router=express[_0x7c9f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c9f('0x6'));var config=require('../../config/environment');var controller=require('./smsAccount.controller');router['get']('/',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x8')]);router['get'](_0x7c9f('0x9'),auth['isAuthenticated'](),controller[_0x7c9f('0xa')]);router[_0x7c9f('0xb')](_0x7c9f('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x7c9f('0xb')]('/:id/canned_answers',auth[_0x7c9f('0x7')](),controller['getAnswers']);router['get'](_0x7c9f('0xd'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0xe')]);router[_0x7c9f('0xb')](_0x7c9f('0xf'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x10')]);router[_0x7c9f('0xb')](_0x7c9f('0x11'),controller[_0x7c9f('0x12')]);router[_0x7c9f('0xb')](_0x7c9f('0x13'),auth[_0x7c9f('0x7')](),controller['getAgents']);router['post']('/',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x14')]);router[_0x7c9f('0x15')]('/:id/dispositions',auth[_0x7c9f('0x7')](),controller['addDisposition']);router[_0x7c9f('0x15')](_0x7c9f('0x16'),auth[_0x7c9f('0x7')](),controller['addAnswer']);router[_0x7c9f('0x15')]('/:id/notify',controller[_0x7c9f('0x17')]);router[_0x7c9f('0x15')](_0x7c9f('0xd'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x18')]);router[_0x7c9f('0x15')](_0x7c9f('0x19'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1a')]);router[_0x7c9f('0x15')]('/:id/status',controller[_0x7c9f('0x1b')]);router[_0x7c9f('0x15')](_0x7c9f('0x13'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1c')]);router[_0x7c9f('0x1d')](_0x7c9f('0xc'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1e')]);router[_0x7c9f('0x1f')]('/:id',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x20')]);router[_0x7c9f('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7c9f('0x21')]);router[_0x7c9f('0x1f')](_0x7c9f('0x16'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x7c9f('0x1f')]('/:id/users',auth[_0x7c9f('0x7')](),controller['removeAgents']);module[_0x7c9f('0x22')]=router; \ No newline at end of file +var _0x9cfb=['connect-timeout','../../components/auth/service','./smsAccount.controller','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/status','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','/:id/send','send','status','put','update','delete','removeAnswers','removeAgents','exports','multer','util'];(function(_0x3431fb,_0x8bf9e1){var _0x9c6a02=function(_0xf096d0){while(--_0xf096d0){_0x3431fb['push'](_0x3431fb['shift']());}};_0x9c6a02(++_0x8bf9e1);}(_0x9cfb,0xa8));var _0xb9cf=function(_0x3a25c3,_0x301d74){_0x3a25c3=_0x3a25c3-0x0;var _0x445638=_0x9cfb[_0x3a25c3];return _0x445638;};'use strict';var multer=require(_0xb9cf('0x0'));var util=require(_0xb9cf('0x1'));var path=require('path');var timeout=require(_0xb9cf('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb9cf('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb9cf('0x4'));router[_0xb9cf('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb9cf('0x6'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x8')]);router[_0xb9cf('0x5')](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller['show']);router[_0xb9cf('0x5')](_0xb9cf('0xa'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xb')]);router[_0xb9cf('0x5')](_0xb9cf('0xc'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xd')]);router['get']('/:id/applications',auth[_0xb9cf('0x7')](),controller['getApplications']);router[_0xb9cf('0x5')]('/:id/interactions',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0xe')]);router[_0xb9cf('0x5')](_0xb9cf('0xf'),controller['statusGet']);router[_0xb9cf('0x5')](_0xb9cf('0x10'),auth['isAuthenticated'](),controller[_0xb9cf('0x11')]);router[_0xb9cf('0x12')]('/',auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x13')]);router[_0xb9cf('0x12')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb9cf('0x14')]);router[_0xb9cf('0x12')](_0xb9cf('0xc'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x15')]);router[_0xb9cf('0x12')]('/:id/notify',controller[_0xb9cf('0x16')]);router[_0xb9cf('0x12')](_0xb9cf('0x17'),auth['isAuthenticated'](),controller[_0xb9cf('0x18')]);router[_0xb9cf('0x12')](_0xb9cf('0x19'),auth['isAuthenticated'](),controller[_0xb9cf('0x1a')]);router[_0xb9cf('0x12')]('/:id/status',controller[_0xb9cf('0x1b')]);router[_0xb9cf('0x12')](_0xb9cf('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb9cf('0x1c')](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x1d')]);router['delete'](_0xb9cf('0x9'),auth[_0xb9cf('0x7')](),controller['destroy']);router[_0xb9cf('0x1e')](_0xb9cf('0xa'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xb9cf('0xc'),auth['isAuthenticated'](),controller[_0xb9cf('0x1f')]);router['delete'](_0xb9cf('0x10'),auth[_0xb9cf('0x7')](),controller[_0xb9cf('0x20')]);module[_0xb9cf('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f3f6663..564550d 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 _0x8c28=['intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8c28,0x185));var _0x88c2=function(_0x4ed35d,_0x1ba6c8){_0x4ed35d=_0x4ed35d-0x0;var _0x3e1108=_0x8c28[_0x4ed35d];return _0x3e1108;};'use strict';var Sequelize=require(_0x88c2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x88c2('0x1')],'unique':_0x88c2('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x88c2('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x88c2('0x1')],'defaultValue':function(){return rs[_0x88c2('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x88c2('0x4')](_0x88c2('0x5'),_0x88c2('0x6'),_0x88c2('0x7'),_0x88c2('0x8'),_0x88c2('0x9'),'clickatell',_0x88c2('0xa'),'infobip',_0x88c2('0xb'))},'accountSid':{'type':Sequelize[_0x88c2('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x88c2('0x1')]},'smsMethod':{'type':Sequelize[_0x88c2('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x88c2('0x1')]},'password':{'type':Sequelize[_0x88c2('0x1')]},'apiKey':{'type':Sequelize[_0x88c2('0x1')]},'senderString':{'type':Sequelize[_0x88c2('0x1')]},'deliveryReport':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x88c2('0xd');}},'notificationSound':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x88c2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x88c2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x88c2('0xe')],'comment':_0x88c2('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![],'comment':_0x88c2('0x10'),'set':function(_0x772c32){if(!_0x772c32)this[_0x88c2('0x11')](_0x88c2('0x12'),null);this[_0x88c2('0x11')](_0x88c2('0x13'),_0x772c32);}}}; \ No newline at end of file +var _0xcb0b=['mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xcb0b,0x7f));var _0xbcb0=function(_0x52effb,_0x2a610d){_0x52effb=_0x52effb-0x0;var _0x357175=_0xcb0b[_0x52effb];return _0x357175;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbcb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xbcb0('0x1')],'unique':_0xbcb0('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xbcb0('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xbcb0('0x1')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbcb0('0x3')]();}},'phone':{'type':Sequelize[_0xbcb0('0x1')]},'type':{'type':Sequelize[_0xbcb0('0x4')](_0xbcb0('0x5'),'skebby',_0xbcb0('0x6'),_0xbcb0('0x7'),_0xbcb0('0x8'),_0xbcb0('0x9'),'csc','infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xbcb0('0x1')]},'authToken':{'type':Sequelize[_0xbcb0('0x1')]},'smsMethod':{'type':Sequelize[_0xbcb0('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xbcb0('0x1')]},'password':{'type':Sequelize[_0xbcb0('0x1')]},'apiKey':{'type':Sequelize[_0xbcb0('0x1')]},'senderString':{'type':Sequelize[_0xbcb0('0x1')]},'deliveryReport':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0xbcb0('0x1')]},'notificationTemplate':{'type':Sequelize[_0xbcb0('0xb')],'defaultValue':function(){return _0xbcb0('0xc');}},'notificationSound':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbcb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbcb0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xbcb0('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbcb0('0xd')],'comment':_0xbcb0('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xbcb0('0xa')],'defaultValue':![],'comment':_0xbcb0('0xf'),'set':function(_0x5e2718){if(!_0x5e2718)this[_0xbcb0('0x10')]('mandatoryDispositionPauseId',null);this[_0xbcb0('0x10')](_0xbcb0('0x11'),_0x5e2718);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 6b40a53..54dd604 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 _0x63ea=['inspect','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','test','request','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','model','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','params','describe','addDisposition','SmsAccountId','Disposition','order','removeDispositions','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','ids','sms','SmsApplication','Applications','orderBy','priority','account','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','plivo','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','applications','push','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','spread','dataValues','Messages','log','skebby_dispatch_id','connectel','statusInt','requestid','clicksend','status_code','infobip','DELIVERED','groupName'];(function(_0x384eb9,_0x36a714){var _0x1cae55=function(_0x41f31d){while(--_0x41f31d){_0x384eb9['push'](_0x384eb9['shift']());}};_0x1cae55(++_0x36a714);}(_0x63ea,0x1d0));var _0xa63e=function(_0x549844,_0x1eee6){_0x549844=_0x549844-0x0;var _0x2d6928=_0x63ea[_0x549844];return _0x2d6928;};'use strict';var pdf=require(_0xa63e('0x0'));var emlformat=require(_0xa63e('0x1'));var rimraf=require(_0xa63e('0x2'));var zipdir=require(_0xa63e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa63e('0x4'));var moment=require('moment');var BPromise=require(_0xa63e('0x5'));var Mustache=require(_0xa63e('0x6'));var util=require('util');var path=require(_0xa63e('0x7'));var sox=require('sox');var csv=require(_0xa63e('0x8'));var ejs=require(_0xa63e('0x9'));var fs=require('fs');var _=require(_0xa63e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa63e('0xb'));var deskjs=require(_0xa63e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa63e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa63e('0xe'));var qs=require(_0xa63e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa63e('0x10'))(_0xa63e('0x11'));var utils=require(_0xa63e('0x12'));var config=require('../../config/environment');var db=require(_0xa63e('0x13'))['db'];config['redis']=_[_0xa63e('0x14')](config[_0xa63e('0x15')],{'host':_0xa63e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa63e('0x17'))[_0xa63e('0x18')](socket);var jayson=require(_0xa63e('0x19'));var client=jayson[_0xa63e('0x1a')][_0xa63e('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x331ef2,_0x1b5e95,_0x40b1a6){if(_0x40b1a6){var _0xe4aa87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe4aa87[_0xa63e('0x1c')](_0x1b5e95)){return _0x331ef2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x331ef2;}}function respondWithRpcPromise(_0x1d8244,_0x428d23,_0x192bc6,_0xd18831){return new BPromise(function(_0x518279,_0xb0f179){var _0xe98864=_0xd18831||client;return _0xe98864[_0xa63e('0x1d')](_0x1d8244,_0x192bc6)[_0xa63e('0x1e')](function(_0x2e57fe){logger['info'](_0xa63e('0x1f'),_0x428d23,'request\x20sent');logger[_0xa63e('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x428d23,_0xa63e('0x21'),JSON[_0xa63e('0x22')](_0x2e57fe));if(_0x2e57fe['error']){if(_0x2e57fe['error'][_0xa63e('0x23')]===0x1f4){logger['error'](_0xa63e('0x1f'),_0x428d23,_0x2e57fe[_0xa63e('0x24')][_0xa63e('0x25')]);return _0xb0f179(_0x2e57fe[_0xa63e('0x24')]['message']);}logger[_0xa63e('0x24')](_0xa63e('0x1f'),_0x428d23,_0x2e57fe[_0xa63e('0x24')]['message']);return _0x518279(_0x2e57fe[_0xa63e('0x24')][_0xa63e('0x25')]);}else{logger[_0xa63e('0x26')](_0xa63e('0x1f'),_0x428d23,'request\x20sent');_0x518279(_0x2e57fe[_0xa63e('0x27')]['message']);}})[_0xa63e('0x28')](function(_0x3ce648){logger[_0xa63e('0x24')](_0xa63e('0x1f'),_0x428d23,_0x3ce648);_0xb0f179(_0x3ce648);});});}function respondWithStatusCode(_0x10bf71,_0x255c60){_0x255c60=_0x255c60||0xcc;return function(_0xae9b39){if(_0xae9b39){return _0x10bf71[_0xa63e('0x29')](_0x255c60);}return _0x10bf71[_0xa63e('0x2a')](_0x255c60)[_0xa63e('0x2b')]();};}function respondWithResult(_0x3c9791,_0x1c65a1){_0x1c65a1=_0x1c65a1||0xc8;return function(_0x37fb5f){if(_0x37fb5f){return _0x3c9791['status'](_0x1c65a1)[_0xa63e('0x2c')](_0x37fb5f);}};}function respondWithFilteredResult(_0x3dad59,_0x131851){return function(_0x44cec6){if(_0x44cec6){var _0x38b23c=_0x44cec6[_0xa63e('0x2d')],_0x4ea500=_0x131851[_0xa63e('0x2e')],_0x2129cf=_0x131851['offset']+_0x131851[_0xa63e('0x2f')],_0xf71642;if(_0x2129cf>=_0x38b23c){_0x2129cf=_0x38b23c;_0xf71642=0xc8;}else{_0xf71642=0xce;}_0x3dad59['status'](_0xf71642);return _0x3dad59[_0xa63e('0x30')](_0xa63e('0x31'),_0x4ea500+'-'+_0x2129cf+'/'+_0x38b23c)[_0xa63e('0x2c')](_0x44cec6);}return null;};}function patchUpdates(_0x568b42){return function(_0x28c02b){try{jsonpatch[_0xa63e('0x32')](_0x28c02b,_0x568b42,!![]);}catch(_0x2d7b58){return BPromise['reject'](_0x2d7b58);}return _0x28c02b[_0xa63e('0x33')]();};}function saveUpdates(_0x4c460d,_0x422273){return function(_0x3e16fe){if(_0x3e16fe){return _0x3e16fe[_0xa63e('0x34')](_0x4c460d)[_0xa63e('0x1e')](function(_0x3dd324){return _0x3dd324;});}return null;};}function removeEntity(_0x2b57c9,_0x9c015a){return function(_0x4557e9){if(_0x4557e9){return _0x4557e9[_0xa63e('0x35')]()[_0xa63e('0x1e')](function(){var _0x21b462=_0x4557e9[_0xa63e('0x36')]({'plain':!![]});var _0x3ddad9=_0xa63e('0x37');return db[_0xa63e('0x38')][_0xa63e('0x35')]({'where':{'type':_0x3ddad9,'resourceId':_0x21b462['id']}})['then'](function(){return _0x4557e9;});})[_0xa63e('0x1e')](function(){_0x2b57c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x131715,_0x3d054e){return function(_0x8e588b){if(!_0x8e588b){_0x131715[_0xa63e('0x29')](0x194);}return _0x8e588b;};}function handleError(_0x5606b4,_0x58acea){_0x58acea=_0x58acea||0x1f4;return function(_0x5c95fa){logger[_0xa63e('0x24')](_0x5c95fa[_0xa63e('0x39')]);if(_0x5c95fa[_0xa63e('0x3a')]){delete _0x5c95fa[_0xa63e('0x3a')];}_0x5606b4[_0xa63e('0x2a')](_0x58acea)['send'](_0x5c95fa);};}exports[_0xa63e('0x3b')]=function(_0x1c84fa,_0x410146){var _0x7bc704={'include':[{'model':db[_0xa63e('0x3c')],'as':_0xa63e('0x3d')}]},_0x420a6e={},_0x3ac5b9={'count':0x0,'rows':[]};var _0x546c99=db[_0xa63e('0x3e')][_0xa63e('0x3f')];_0x420a6e['model']=_[_0xa63e('0x40')](_0x546c99);_0x420a6e[_0xa63e('0x41')]=_['keys'](_0x1c84fa[_0xa63e('0x41')]);_0x420a6e['filters']=_['intersection'](_0x420a6e['model'],_0x420a6e['query']);_0x7bc704['attributes']=_['intersection'](_0x420a6e[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x43')]));_0x7bc704[_0xa63e('0x44')]=_0x7bc704[_0xa63e('0x44')]['length']?_0x7bc704[_0xa63e('0x44')]:_0x420a6e[_0xa63e('0x42')];if(!_0x1c84fa['query']['hasOwnProperty'](_0xa63e('0x45'))){_0x7bc704['limit']=qs[_0xa63e('0x2f')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x7bc704[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x1c84fa['query'][_0xa63e('0x2e')]);}_0x7bc704['order']=qs[_0xa63e('0x46')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x46')]);_0x7bc704[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x1c84fa[_0xa63e('0x41')],_0x420a6e['filters']));if(_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x7bc704[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x7bc704[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x546c99,function(_0x27d03d){if(_0x27d03d[_0xa63e('0x4d')][_0xa63e('0x4e')]!=='VIRTUAL'){var _0x45ddc1={};_0x45ddc1[_0x27d03d[_0xa63e('0x4f')]]={'$like':'%'+_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x45ddc1;}})});}_0x7bc704=_[_0xa63e('0x4b')]({},_0x7bc704,_0x1c84fa[_0xa63e('0x50')]);var _0x2b6551={'where':_0x7bc704[_0xa63e('0x47')]};return db[_0xa63e('0x3e')][_0xa63e('0x2d')](_0x2b6551)[_0xa63e('0x1e')](function(_0x156c5e){_0x3ac5b9[_0xa63e('0x2d')]=_0x156c5e;if(_0x1c84fa['query'][_0xa63e('0x51')]){_0x7bc704[_0xa63e('0x52')]=[{'all':!![]}];}return db[_0xa63e('0x3e')][_0xa63e('0x53')](_0x7bc704);})[_0xa63e('0x1e')](function(_0x8e0d16){_0x3ac5b9[_0xa63e('0x54')]=_0x8e0d16;return _0x3ac5b9;})[_0xa63e('0x1e')](respondWithFilteredResult(_0x410146,_0x7bc704))[_0xa63e('0x28')](handleError(_0x410146,null));};exports[_0xa63e('0x55')]=function(_0x5a6a71,_0x4d1ffa){var _0x4d9c7f={'raw':![],'where':{'id':_0x5a6a71['params']['id']},'include':[{'model':db[_0xa63e('0x3c')],'as':_0xa63e('0x3d')}]},_0x5b0fe4={};_0x5b0fe4[_0xa63e('0x42')]=_[_0xa63e('0x40')](db['SmsAccount']['rawAttributes']);_0x5b0fe4[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x5a6a71[_0xa63e('0x41')]);_0x5b0fe4[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x5b0fe4['model'],_0x5b0fe4[_0xa63e('0x41')]);_0x4d9c7f[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x5b0fe4['model'],qs['fields'](_0x5a6a71[_0xa63e('0x41')][_0xa63e('0x43')]));_0x4d9c7f['attributes']=_0x4d9c7f[_0xa63e('0x44')][_0xa63e('0x57')]?_0x4d9c7f[_0xa63e('0x44')]:_0x5b0fe4[_0xa63e('0x42')];if(_0x5a6a71['query'][_0xa63e('0x51')]){_0x4d9c7f[_0xa63e('0x52')]=[{'all':!![]}];}_0x4d9c7f=_[_0xa63e('0x4b')]({},_0x4d9c7f,_0x5a6a71['options']);return db[_0xa63e('0x3e')]['find'](_0x4d9c7f)['then'](handleEntityNotFound(_0x4d1ffa,null))[_0xa63e('0x1e')](respondWithResult(_0x4d1ffa,null))[_0xa63e('0x28')](handleError(_0x4d1ffa,null));};exports[_0xa63e('0x58')]=function(_0x24ed2f,_0x2728c7){return db[_0xa63e('0x3e')]['create'](_0x24ed2f[_0xa63e('0x59')],{})[_0xa63e('0x1e')](function(_0x248a2e){var _0x6423a2=_0x24ed2f[_0xa63e('0x5a')][_0xa63e('0x36')]({'plain':!![]});if(!_0x6423a2)throw new Error(_0xa63e('0x5b'));if(_0x6423a2['role']===_0xa63e('0x5a')){var _0xd7b85a=_0x248a2e[_0xa63e('0x36')]({'plain':!![]});var _0x1792b9=_0xa63e('0x37');return db[_0xa63e('0x5c')][_0xa63e('0x5d')]({'where':{'name':_0x1792b9,'userProfileId':_0x6423a2[_0xa63e('0x5e')]},'raw':!![]})['then'](function(_0x27fb42){if(_0x27fb42&&_0x27fb42['autoAssociation']===0x0){return db[_0xa63e('0x38')]['create']({'name':_0xd7b85a[_0xa63e('0x3a')],'resourceId':_0xd7b85a['id'],'type':_0x27fb42[_0xa63e('0x3a')],'sectionId':_0x27fb42['id']},{})['then'](function(){return _0x248a2e;});}else{return _0x248a2e;}})[_0xa63e('0x28')](function(_0x507942){logger[_0xa63e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x507942);throw _0x507942;});}return _0x248a2e;})[_0xa63e('0x1e')](respondWithResult(_0x2728c7,0xc9))[_0xa63e('0x28')](handleError(_0x2728c7,null));};exports[_0xa63e('0x34')]=function(_0x44e2ce,_0x7bffc1){if(_0x44e2ce['body']['id']){delete _0x44e2ce['body']['id'];}return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x44e2ce[_0xa63e('0x5f')]['id']},'include':[{'model':db[_0xa63e('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x7bffc1,null))['then'](saveUpdates(_0x44e2ce[_0xa63e('0x59')],null))['then'](respondWithResult(_0x7bffc1,null))[_0xa63e('0x28')](handleError(_0x7bffc1,null));};exports[_0xa63e('0x35')]=function(_0x4283a7,_0x244c59){return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x4283a7[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x244c59,null))[_0xa63e('0x1e')](removeEntity(_0x244c59,null))[_0xa63e('0x28')](handleError(_0x244c59,null));};exports[_0xa63e('0x60')]=function(_0x7a2b14,_0x566283){return db[_0xa63e('0x3e')][_0xa63e('0x60')]()[_0xa63e('0x1e')](respondWithResult(_0x566283,null))[_0xa63e('0x28')](handleError(_0x566283,null));};exports[_0xa63e('0x61')]=function(_0x234f03,_0x4850c6,_0x15ba20){if(_0x234f03['body']['id']){delete _0x234f03[_0xa63e('0x59')]['id'];}return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x234f03[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x4850c6,null))['then'](function(_0x106b23){if(_0x106b23){_0x234f03['body'][_0xa63e('0x62')]=_0x106b23['id'];return db[_0xa63e('0x63')][_0xa63e('0x58')](_0x234f03[_0xa63e('0x59')]);}})[_0xa63e('0x1e')](respondWithResult(_0x4850c6,null))['catch'](handleError(_0x4850c6,null));};exports['getDispositions']=function(_0x285264,_0x49b05e,_0x51387a){var _0x338de4={'raw':![],'where':{}};var _0x2236ac={};var _0xf6118f={'count':0x0,'rows':[]};return db[_0xa63e('0x3e')]['findOne']({'where':{'id':_0x285264[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x49b05e,null))[_0xa63e('0x1e')](function(_0x319132){if(_0x319132){_0x2236ac['model']=_[_0xa63e('0x40')](db[_0xa63e('0x63')][_0xa63e('0x3f')]);_0x2236ac[_0xa63e('0x41')]=_['keys'](_0x285264[_0xa63e('0x41')]);_0x2236ac[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x2236ac[_0xa63e('0x42')],_0x2236ac[_0xa63e('0x41')]);_0x338de4[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x2236ac[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x285264[_0xa63e('0x41')][_0xa63e('0x43')]));_0x338de4['attributes']=_0x338de4[_0xa63e('0x44')][_0xa63e('0x57')]?_0x338de4['attributes']:_0x2236ac[_0xa63e('0x42')];if(!_0x285264['query']['hasOwnProperty'](_0xa63e('0x45'))){_0x338de4['limit']=qs[_0xa63e('0x2f')](_0x285264[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x338de4[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x285264['query']['offset']);}_0x338de4[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x285264[_0xa63e('0x41')][_0xa63e('0x46')]);_0x338de4[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x285264[_0xa63e('0x41')],_0x2236ac[_0xa63e('0x48')]));_0x338de4[_0xa63e('0x47')]['SmsAccountId']=_0x319132['id'];if(_0x285264[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x338de4[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x338de4[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x338de4['attributes'],function(_0x3bb453){var _0x1166ba={};_0x1166ba[_0x3bb453]={'$like':'%'+_0x285264['query'][_0xa63e('0x4a')]+'%'};return _0x1166ba;})});}_0x338de4=_[_0xa63e('0x4b')]({},_0x338de4,_0x285264[_0xa63e('0x50')]);return db[_0xa63e('0x63')][_0xa63e('0x2d')]({'where':_0x338de4[_0xa63e('0x47')]})[_0xa63e('0x1e')](function(_0x2055c9){_0xf6118f[_0xa63e('0x2d')]=_0x2055c9;if(_0x285264[_0xa63e('0x41')][_0xa63e('0x51')]){_0x338de4[_0xa63e('0x52')]=[{'all':!![]}];}return db[_0xa63e('0x63')][_0xa63e('0x53')](_0x338de4);})[_0xa63e('0x1e')](function(_0x2de13f){_0xf6118f['rows']=_0x2de13f;return _0xf6118f;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x49b05e,_0x338de4))[_0xa63e('0x28')](handleError(_0x49b05e,null));};exports[_0xa63e('0x65')]=function(_0x55a5db,_0x5246e4,_0x309ada){return db['SmsAccount']['find']({'where':{'id':_0x55a5db[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x5246e4,null))[_0xa63e('0x1e')](function(_0x3328ad){if(_0x3328ad){return _0x3328ad[_0xa63e('0x65')](_0x55a5db['query']['ids']);}})[_0xa63e('0x1e')](respondWithStatusCode(_0x5246e4,null))['catch'](handleError(_0x5246e4,null));};exports['addAnswer']=function(_0x172167,_0x48fdf9,_0x57e071){if(_0x172167['body']['id']){delete _0x172167[_0xa63e('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x172167[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x48fdf9,null))['then'](function(_0x495ca2){if(_0x495ca2){_0x172167[_0xa63e('0x59')][_0xa63e('0x62')]=_0x495ca2['id'];return db[_0xa63e('0x66')][_0xa63e('0x58')](_0x172167[_0xa63e('0x59')]);}})[_0xa63e('0x1e')](respondWithResult(_0x48fdf9,null))[_0xa63e('0x28')](handleError(_0x48fdf9,null));};exports[_0xa63e('0x67')]=function(_0x32a38a,_0x271230,_0x5a8636){var _0x39219d={'raw':![],'where':{}};var _0x3651cd={};var _0x5aa561={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa63e('0x68')]({'where':{'id':_0x32a38a[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x271230,null))[_0xa63e('0x1e')](function(_0x3d16bf){if(_0x3d16bf){_0x3651cd['model']=_['keys'](db[_0xa63e('0x66')][_0xa63e('0x3f')]);_0x3651cd['query']=_[_0xa63e('0x40')](_0x32a38a[_0xa63e('0x41')]);_0x3651cd[_0xa63e('0x48')]=_['intersection'](_0x3651cd[_0xa63e('0x42')],_0x3651cd[_0xa63e('0x41')]);_0x39219d[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x3651cd[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x32a38a[_0xa63e('0x41')][_0xa63e('0x43')]));_0x39219d[_0xa63e('0x44')]=_0x39219d[_0xa63e('0x44')][_0xa63e('0x57')]?_0x39219d[_0xa63e('0x44')]:_0x3651cd['model'];if(!_0x32a38a[_0xa63e('0x41')][_0xa63e('0x69')](_0xa63e('0x45'))){_0x39219d[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x32a38a[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x39219d[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x32a38a['query']['offset']);}_0x39219d[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x32a38a['query'][_0xa63e('0x46')]);_0x39219d['where']=qs['filters'](_[_0xa63e('0x49')](_0x32a38a['query'],_0x3651cd['filters']));_0x39219d[_0xa63e('0x47')][_0xa63e('0x62')]=_0x3d16bf['id'];if(_0x32a38a[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x39219d[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x39219d[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x39219d[_0xa63e('0x44')],function(_0x1fdb8d){var _0x2b749d={};_0x2b749d[_0x1fdb8d]={'$like':'%'+_0x32a38a[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x2b749d;})});}_0x39219d=_[_0xa63e('0x4b')]({},_0x39219d,_0x32a38a[_0xa63e('0x50')]);return db[_0xa63e('0x66')]['count']({'where':_0x39219d['where']})[_0xa63e('0x1e')](function(_0x4646d6){_0x5aa561[_0xa63e('0x2d')]=_0x4646d6;if(_0x32a38a[_0xa63e('0x41')][_0xa63e('0x51')]){_0x39219d['include']=[{'all':!![]}];}return db[_0xa63e('0x66')][_0xa63e('0x53')](_0x39219d);})['then'](function(_0x24a5db){_0x5aa561[_0xa63e('0x54')]=_0x24a5db;return _0x5aa561;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x271230,_0x39219d))[_0xa63e('0x28')](handleError(_0x271230,null));};exports[_0xa63e('0x6a')]=function(_0x20a616,_0xe30e1,_0xe8e486){return db[_0xa63e('0x3e')]['find']({'where':{'id':_0x20a616[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0xe30e1,null))[_0xa63e('0x1e')](function(_0x38a13e){if(_0x38a13e){return _0x38a13e[_0xa63e('0x6a')](_0x20a616[_0xa63e('0x41')][_0xa63e('0x6b')]);}})[_0xa63e('0x1e')](respondWithStatusCode(_0xe30e1,null))['catch'](handleError(_0xe30e1,null));};exports['notify']=function(_0x3e286,_0x3f75be,_0x4b6ede){var _0xc024a1={'channel':_0xa63e('0x6c')};var _0x27711e=[];var _0x495adb=[];var _0x1e824d={};return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x3e286['params']['id']},'include':[{'model':db[_0xa63e('0x6d')],'as':_0xa63e('0x6e')}]})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x3cb56c){_0xc024a1['account']=_0x3cb56c;_0xc024a1['applications']=_[_0xa63e('0x6f')](_0x3cb56c[_0xa63e('0x6e')],[_0xa63e('0x70')],['asc']);if(_0xc024a1[_0xa63e('0x71')][_0xa63e('0x6e')]){delete _0xc024a1[_0xa63e('0x71')][_0xa63e('0x6e')];}return db[_0xa63e('0x72')][_0xa63e('0x60')]();})[_0xa63e('0x1e')](function(_0xdc9c47){if(!_0xdc9c47){throw new db['Sequelize']['ValidationError'](_0xa63e('0x73'));}_0x27711e=_[_0xa63e('0x74')](_[_0xa63e('0x40')](_0xdc9c47),['createdAt',_0xa63e('0x75')]);_0x495adb=_[_0xa63e('0x74')](_[_0xa63e('0x40')](_0xdc9c47),[_0xa63e('0x76'),_0xa63e('0x75'),_0xa63e('0x77'),_0xa63e('0x78')]);_0xc024a1['body']={'mapKey':'mobile'};if(_0xc024a1['account'][_0xa63e('0x4d')]){switch(_0xc024a1[_0xa63e('0x71')]['type']){case _0xa63e('0x79'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7b')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7c')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7e')];break;case _0xa63e('0x7f'):_0xc024a1[_0xa63e('0x59')]['from']='+'+_0x3e286[_0xa63e('0x59')][_0xa63e('0x80')];_0xc024a1['body'][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x81')];break;case'connectel':_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['message'];break;case'clicksend':_0xc024a1['body'][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['body'];_0xc024a1['body'][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x82')];break;case _0xa63e('0x83'):_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')]['From'];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['Text'];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x84')];break;case'infobip':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]='+'+_0x3e286['body']['results'][0x0][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x85')][0x0][_0xa63e('0x81')];_0xc024a1[_0xa63e('0x59')]['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x85')][0x0]['messageId'];break;case _0xa63e('0x86'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x87')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x88')][_0xa63e('0x25')];break;case _0xa63e('0x89'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286['body'][_0xa63e('0x8a')];_0xc024a1[_0xa63e('0x59')]['body']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x81')];_0xc024a1['body']['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x8b')];break;case _0xa63e('0x8c'):_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')]['from'];_0xc024a1['body'][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x25')];_0xc024a1[_0xa63e('0x59')]['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x8d')];break;}}if(_0xc024a1[_0xa63e('0x59')]['id']){delete _0xc024a1['body']['id'];}if(_['isNil'](_0xc024a1[_0xa63e('0x59')]['from'])){throw new db['Sequelize']['ValidationError'](_0xa63e('0x8e'));}if(_[_0xa63e('0x8f')](_0xc024a1['body'][_0xa63e('0x59')])||_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]===''){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))](_0xa63e('0x92'));}if(_[_0xa63e('0x8f')](_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')])){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x495adb);}if(!_[_0xa63e('0x94')](_0x495adb,_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')])){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x495adb);}_0x1e824d[_0xc024a1[_0xa63e('0x59')]['mapKey']]=_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')];return db[_0xa63e('0x95')]['find']({'where':{'id':_0xc024a1['account']['ListId']},'include':[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0x96'),'where':_0x1e824d,'limit':0x1,'order':[[_0xa63e('0x75'),_0xa63e('0x97')]]}]});})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x5baded){if(_0x5baded){_0xc024a1[_0xa63e('0x98')]=_[_0xa63e('0x99')](_0x5baded,[_0xa63e('0x96')]);if(_0x5baded['Contacts'][_0xa63e('0x57')]){return _0x5baded['Contacts'][0x0];}var _0x2606d1=_[_0xa63e('0x14')](_0xc024a1['body'],{'firstName':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'ListId':_0x5baded['id']});_0x2606d1[_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')]]=_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')];return db['CmContact'][_0xa63e('0x58')](_0x2606d1,{'fields':_0x27711e,'raw':!![]});}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x763fdb){if(_0x763fdb){_0xc024a1[_0xa63e('0x9a')]=_0x763fdb;var _0x9ab997={'ContactId':_0x763fdb['id'],'phone':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'SmsAccountId':_0x3e286['params']['id']};var _0x18f95b={'ContactId':_0x763fdb['id'],'SmsAccountId':_0x3e286[_0xa63e('0x5f')]['id'],'closed':![]};return db[_0xa63e('0x9b')][_0xa63e('0x5d')]({'where':_0x18f95b})[_0xa63e('0x1e')](function(_0x327648){if(_0x327648){return[_0x327648,![]];}return db[_0xa63e('0x9b')]['create'](_0x9ab997)[_0xa63e('0x1e')](function(_0x31d8eb){return[_0x31d8eb,!![]];});});}})['spread'](function(_0x25d842,_0x4f2650){_0xc024a1[_0xa63e('0x9c')]=_0x25d842[_0xa63e('0x36')]({'plain':!![]});_0xc024a1[_0xa63e('0x9c')][_0xa63e('0x9d')]=![];if(_0x4f2650){if(_0xc024a1[_0xa63e('0x71')]['autoclose']){_0xc024a1[_0xa63e('0x9e')][_0xa63e('0x9f')]({'id':0x0,'priority':_0xc024a1[_0xa63e('0x9e')][_0xa63e('0x57')]+0x1,'app':'close','appdata':_0xa63e('0xa0'),'interval':'*,*,*,*'});}_0xc024a1[_0xa63e('0x9c')][_0xa63e('0x9d')]=!![];}return db[_0xa63e('0xa1')][_0xa63e('0x58')]({'phone':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'messageId':_0xc024a1['body'][_0xa63e('0x7d')],'body':_0xc024a1[_0xa63e('0x59')]['body'],'SmsAccountId':_0x3e286['params']['id'],'SmsInteractionId':_0x25d842['id'],'direction':'in','ContactId':_0x25d842[_0xa63e('0xa2')],'AttachmentId':_0xc024a1[_0xa63e('0x59')][_0xa63e('0xa3')]});})['then'](function(_0x266555){_0xc024a1[_0xa63e('0x25')]=_0x266555;if(_0xc024a1[_0xa63e('0x9c')][_0xa63e('0xa4')]){return db[_0xa63e('0xa5')]['find']({'attributes':['id',_0xa63e('0x3a')],'where':{'id':_0xc024a1['interaction'][_0xa63e('0xa4')]}})[_0xa63e('0x1e')](function(_0x54eaab){if(_0x54eaab){_0xc024a1['applications'][_0xa63e('0xa6')]({'id':0x0,'priority':0x0,'app':_0xa63e('0xa7'),'appdata':_0x54eaab[_0xa63e('0x3a')]+','+(_0xc024a1[_0xa63e('0x71')][_0xa63e('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa63e('0xa9'),_0xa63e('0xaa'),_0xc024a1);});}return respondWithRpcPromise('Start',_0xa63e('0xaa'),_0xc024a1);})[_0xa63e('0x1e')](function(_0xa43ee1){if(_0xa43ee1){var _0xa615ff=0xc8;var _0x34ebaa=_0xa63e('0xab');logger['info'](_0xa63e('0xac'),_0x34ebaa,_0xa615ff,_0xa63e('0xad'));logger[_0xa63e('0x20')](_0xa63e('0xae'),_0x34ebaa,_0xa615ff,_0xa63e('0xad'),JSON[_0xa63e('0x22')](_0xa43ee1));if(_0xc024a1[_0xa63e('0x71')]['type']===_0xa63e('0x79')){return _0x3f75be[_0xa63e('0x2a')](_0xa615ff)[_0xa63e('0x30')](_0xa63e('0xaf'),_0xa63e('0xb0'))[_0xa63e('0xb1')](_0xa63e('0xb2'));}else{return _0x3f75be[_0xa63e('0x2a')](_0xa615ff)['json'](_0xa43ee1);}}})[_0xa63e('0x28')](handleError(_0x3f75be,null));};exports[_0xa63e('0xb3')]=function(_0x6446f0,_0x104cd6,_0x368568){return db['SmsAccount'][_0xa63e('0x68')]({'where':{'id':_0x6446f0[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x104cd6,null))[_0xa63e('0x1e')](function(_0x2930a4){if(_0x2930a4){return db[_0xa63e('0xb4')][_0xa63e('0xb5')](function(_0x4486ec){return db[_0xa63e('0x6d')][_0xa63e('0x35')]({'where':{'SmsAccountId':_0x6446f0['params']['id']},'transaction':_0x4486ec})[_0xa63e('0x1e')](function(_0x12f58b){var _0x536498=_['map'](_0x6446f0['body'],function(_0x3c89c7){_0x3c89c7['SmsAccountId']=_0x6446f0[_0xa63e('0x5f')]['id'];return _0x3c89c7;});return db['SmsApplication'][_0xa63e('0xb6')](_0x536498,{'transaction':_0x4486ec});});})[_0xa63e('0x1e')](function(){return db['SmsApplication'][_0xa63e('0xb7')]({'where':{'SmsAccountId':_0x6446f0[_0xa63e('0x5f')]['id']},'order':_0xa63e('0x70')});});}})['then'](respondWithResult(_0x104cd6,null))[_0xa63e('0x28')](handleError(_0x104cd6,null));};exports[_0xa63e('0xb8')]=function(_0x30152c,_0x19adbf,_0x2c56d8){var _0x2cdf00={};var _0x284197={};var _0xc169a8;var _0x2d9393;return db[_0xa63e('0x3e')][_0xa63e('0x68')]({'where':{'id':_0x30152c[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x19adbf,null))[_0xa63e('0x1e')](function(_0x47c82b){if(_0x47c82b){_0xc169a8=_0x47c82b;_0x284197[_0xa63e('0x42')]=_[_0xa63e('0x40')](db[_0xa63e('0x6d')][_0xa63e('0x3f')]);_0x284197['query']=_[_0xa63e('0x40')](_0x30152c['query']);_0x284197['filters']=_['intersection'](_0x284197['model'],_0x284197[_0xa63e('0x41')]);_0x2cdf00[_0xa63e('0x44')]=_['intersection'](_0x284197[_0xa63e('0x42')],qs['fields'](_0x30152c[_0xa63e('0x41')][_0xa63e('0x43')]));_0x2cdf00[_0xa63e('0x44')]=_0x2cdf00['attributes'][_0xa63e('0x57')]?_0x2cdf00[_0xa63e('0x44')]:_0x284197[_0xa63e('0x42')];_0x2cdf00[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x30152c[_0xa63e('0x41')]['sort']);_0x2cdf00[_0xa63e('0x47')]=qs['filters'](_[_0xa63e('0x49')](_0x30152c[_0xa63e('0x41')],_0x284197[_0xa63e('0x48')]));if(_0x30152c[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x2cdf00[_0xa63e('0x47')]=_['merge'](_0x2cdf00[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x2cdf00['attributes'],function(_0xc1e569){var _0x4540ca={};_0x4540ca[_0xc1e569]={'$like':'%'+_0x30152c[_0xa63e('0x41')]['filter']+'%'};return _0x4540ca;})});}_0x2cdf00=_[_0xa63e('0x4b')]({},_0x2cdf00,_0x30152c['options']);return _0xc169a8['getApplications'](_0x2cdf00);}})[_0xa63e('0x1e')](function(_0xed2777){if(_0xed2777){_0x2d9393=_0xed2777[_0xa63e('0x57')];if(!_0x30152c[_0xa63e('0x41')]['hasOwnProperty'](_0xa63e('0x45'))){_0x2cdf00[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x30152c[_0xa63e('0x41')]['limit']);_0x2cdf00[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x30152c[_0xa63e('0x41')][_0xa63e('0x2e')]);}return _0xc169a8['getApplications'](_0x2cdf00);}})[_0xa63e('0x1e')](function(_0x218c41){if(_0x218c41){return _0x218c41?{'count':_0x2d9393,'rows':_0x218c41}:null;}})[_0xa63e('0x1e')](respondWithResult(_0x19adbf,null))['catch'](handleError(_0x19adbf,null));};exports[_0xa63e('0xb9')]=function(_0x4645ed,_0x52eabf,_0x44053d){var _0x3b43e4={'raw':![],'where':{}};var _0x3697ea={};var _0x1a3122={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4645ed[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x52eabf,null))['then'](function(_0x12bbeb){if(_0x12bbeb){_0x3697ea['model']=_[_0xa63e('0x40')](db[_0xa63e('0x9b')][_0xa63e('0x3f')]);_0x3697ea[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x4645ed[_0xa63e('0x41')]);_0x3697ea[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x3697ea[_0xa63e('0x42')],_0x3697ea[_0xa63e('0x41')]);_0x3b43e4[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x3697ea['model'],qs[_0xa63e('0x43')](_0x4645ed[_0xa63e('0x41')][_0xa63e('0x43')]));_0x3b43e4[_0xa63e('0x44')]=_0x3b43e4[_0xa63e('0x44')][_0xa63e('0x57')]?_0x3b43e4[_0xa63e('0x44')]:_0x3697ea[_0xa63e('0x42')];if(!_0x4645ed['query'][_0xa63e('0x69')]('nolimit')){_0x3b43e4[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x4645ed[_0xa63e('0x41')]['limit']);_0x3b43e4[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x4645ed['query'][_0xa63e('0x2e')]);}_0x3b43e4[_0xa63e('0x64')]=qs['sort'](_0x4645ed[_0xa63e('0x41')][_0xa63e('0x46')]);_0x3b43e4[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x4645ed[_0xa63e('0x41')],_0x3697ea[_0xa63e('0x48')]));_0x3b43e4['where']['SmsAccountId']=_0x12bbeb['id'];if(_0x4645ed[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x3b43e4[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x3b43e4[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x3b43e4['attributes'],function(_0x554ba5){var _0xed7248={};_0xed7248[_0x554ba5]={'$like':'%'+_0x4645ed['query'][_0xa63e('0x4a')]+'%'};return _0xed7248;})});}_0x3b43e4=_[_0xa63e('0x4b')]({},_0x3b43e4,_0x4645ed[_0xa63e('0x50')]);return db[_0xa63e('0x9b')][_0xa63e('0x2d')]({'where':_0x3b43e4[_0xa63e('0x47')]})[_0xa63e('0x1e')](function(_0x27eea3){_0x1a3122['count']=_0x27eea3;if(_0x4645ed[_0xa63e('0x41')]['includeAll']){_0x3b43e4[_0xa63e('0x52')]=[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0xba'),'required':![]},{'model':db[_0xa63e('0xa5')],'as':_0xa63e('0xbb'),'attributes':[_0xa63e('0x3a'),_0xa63e('0xbc'),_0xa63e('0xbd')],'required':![]},{'model':db[_0xa63e('0xbe')],'as':_0xa63e('0xbf'),'attributes':['id','name',_0xa63e('0xc0')],'where':_0x4645ed[_0xa63e('0x41')][_0xa63e('0xc1')]?{'id':_0x4645ed[_0xa63e('0x41')]['tag']}:undefined,'required':_0x4645ed[_0xa63e('0x41')][_0xa63e('0xc1')]?!![]:![]}];}return db[_0xa63e('0x9b')][_0xa63e('0x53')](_0x3b43e4);})[_0xa63e('0x1e')](function(_0x596b16){_0x1a3122[_0xa63e('0x54')]=_0x596b16;return _0x1a3122;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x52eabf,_0x3b43e4))['catch'](handleError(_0x52eabf,null));};exports[_0xa63e('0xb1')]=function(_0x49d2c6,_0x419bbb,_0x23d6ec){var _0x5d2067,_0x276bf4,_0x4639e6;if(_[_0xa63e('0x8f')](_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')])||_0x49d2c6[_0xa63e('0x59')]['body']===''){throw new db[(_0xa63e('0x90'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x49d2c6[_0xa63e('0x59')]['to'])){throw new db['Sequelize'][(_0xa63e('0x91'))]('to\x20is\x20mandatory');}_0x5d2067=_0x49d2c6[_0xa63e('0x59')]['to'];return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x49d2c6[_0xa63e('0x5f')]['id']},'include':[{'model':db[_0xa63e('0x95')],'as':_0xa63e('0xc2'),'include':[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0x96'),'where':{'mobile':_0x5d2067},'limit':0x1,'order':[[_0xa63e('0x75'),_0xa63e('0x97')]]}]}]})[_0xa63e('0x1e')](handleEntityNotFound(_0x419bbb,null))['then'](function(_0x4d590f){if(_0x4d590f&&_0x4d590f[_0xa63e('0xc2')]){_0x276bf4=_0x4d590f['get']({'plain':!![]});if(_0x276bf4[_0xa63e('0xc2')]&&_0x276bf4[_0xa63e('0xc2')][_0xa63e('0x96')][_0xa63e('0x57')]){return _0x276bf4[_0xa63e('0xc2')][_0xa63e('0x96')][0x0];}return db[_0xa63e('0x72')][_0xa63e('0x58')](_[_0xa63e('0x14')](_0x49d2c6[_0xa63e('0x59')],{'firstName':_0x5d2067,'mobile':_0x5d2067,'phone':_0x5d2067,'ListId':_0x276bf4[_0xa63e('0x78')]}));}})[_0xa63e('0x1e')](handleEntityNotFound(_0x419bbb,null))['then'](function(_0x25166d){if(_0x25166d){_0x4639e6=_0x25166d;return db['SmsInteraction'][_0xa63e('0x5d')]({'where':{'ContactId':_0x4639e6['id'],'closed':![],'SmsAccountId':_0x276bf4['id']}})[_0xa63e('0x1e')](function(_0x47b13e){if(_0x47b13e){return[_0x47b13e,![]];}return db[_0xa63e('0x9b')][_0xa63e('0x58')]({'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id'],'SmsAccountId':_0x276bf4['id'],'phone':_0x5d2067,'firstMsgDirection':'out','Messages':[_[_0xa63e('0x4b')](_0x49d2c6[_0xa63e('0x59')],{'read':![],'body':_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')],'phone':_0x5d2067,'SmsAccountId':_0x276bf4['id'],'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id']})]},{'include':[{'model':db[_0xa63e('0xa1')],'as':'Messages'}]})[_0xa63e('0x1e')](function(_0x485a6f){return[_0x485a6f,!![]];});});}})[_0xa63e('0xc3')](function(_0x391559,_0x21b829){if(_0x21b829){return _0x391559;}return db[_0xa63e('0xa1')][_0xa63e('0x58')](_['merge'](_0x49d2c6['body'],{'read':![],'body':_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')],'phone':_0x5d2067,'SmsAccountId':_0x276bf4['id'],'SmsInteractionId':_0x391559['id'],'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id']}))[_0xa63e('0x1e')](function(_0x2e6cb4){_0x391559[_0xa63e('0xc4')][_0xa63e('0xc5')]=[];_0x391559['dataValues'][_0xa63e('0xc5')][_0xa63e('0x9f')](_0x2e6cb4[_0xa63e('0xc4')]);return _0x391559;});})[_0xa63e('0x1e')](respondWithResult(_0x419bbb,null))['catch'](handleError(_0x419bbb,null));};exports['status']=function(_0x493895,_0x1ef523,_0x452f61){if(_0x493895['body']['id']){delete _0x493895[_0xa63e('0x59')]['id'];}console[_0xa63e('0xc6')]('endpoint\x20/status\x20POST\x20/',_0x493895[_0xa63e('0x59')]);var _0xe1f0bb,_0x3faab1,_0xb1d7c2;return db[_0xa63e('0x3e')]['find']({'where':{'id':_0x493895['params']['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x1ef523,null))[_0xa63e('0x1e')](function(_0x216dba){if(_0x216dba){_0xb1d7c2=_0x216dba;logger['debug'](_0xa63e('0xac'),_0xa63e('0x2a'),'received\x20delivery\x20report\x20from',_0x216dba[_0xa63e('0x4d')],util['inspect'](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));switch(_0x216dba[_0xa63e('0x4d')]){case _0xa63e('0x7f'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0xc7')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0xc7')]}});}break;case _0xa63e('0xc8'):if(_0x493895[_0xa63e('0x59')]['requestid']&&_0x493895[_0xa63e('0x59')][_0xa63e('0xc9')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0xc9')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0xca')]}});}break;case _0xa63e('0xcb'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0x82')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0xcc')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0xcc')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0x82')]}});}break;case _0xa63e('0xcd'):var _0x2bc27a=_0x493895[_0xa63e('0x59')][_0xa63e('0x85')][0x0];if(_0x2bc27a['messageId']&&_0x2bc27a[_0xa63e('0x2a')]['groupName']===_0xa63e('0xce')){_0x3faab1=_0x2bc27a['status'][_0xa63e('0xcf')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x2bc27a[_0xa63e('0x7d')]}});}break;case _0xa63e('0x89'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0x7d')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0x7d')]}});}break;case _0xa63e('0x8c'):if(_0x493895[_0xa63e('0x59')]['redif']&&_0x493895['body']['status']){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x493895[_0xa63e('0x59')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1ef523,null))['then'](function(_0x29fe04){if(_0x29fe04){_0xe1f0bb=_0x29fe04;switch(_0xb1d7c2[_0xa63e('0x4d')]){case _0xa63e('0x7f'):if(_0x3faab1===_0xa63e('0xce')){return _0xe1f0bb['update']({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x7f'),util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xc8'):if(_0x3faab1==='1'){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xcb'):if(!_0x493895['body'][_0xa63e('0xd1')]&&_0x3faab1>=0xc8&&_0x3faab1<=0xce){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0xcb'),util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xcd'):var _0x411565=_0x493895['body'][_0xa63e('0x85')][0x0];if(_0x411565['status'][_0xa63e('0xcf')]===_0xa63e('0xce')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),'infobip',util['inspect'](_0x493895['body'],{'showHidden':![],'depth':null}));}break;case _0xa63e('0x89'):if(_0x3faab1=='DELIVERED_TO_GATEWAY'||_0x3faab1==_0xa63e('0xd2')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x89'),util['inspect'](_0x493895['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3faab1===_0xa63e('0xd3')||_0x3faab1===_0xa63e('0xd4')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger['error'](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x8c'),util['inspect'](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xe1f0bb;}})[_0xa63e('0x1e')](respondWithResult(_0x1ef523,null))['catch'](handleError(_0x1ef523,null));};exports[_0xa63e('0xd5')]=function(_0x53b5ff,_0x3b665d,_0x36f6c4){var _0x37d826,_0x1a8f51,_0x291a54;return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x53b5ff[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3b665d,null))[_0xa63e('0x1e')](function(_0x21fb65){if(_0x21fb65){_0x291a54=_0x21fb65;logger[_0xa63e('0x20')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0xd6'),_0x21fb65['type'],util['inspect'](_0x53b5ff['query'],{'showHidden':![],'depth':null}));switch(_0x21fb65[_0xa63e('0x4d')]){case'csc':if(_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd7')]&&_0x53b5ff[_0xa63e('0x41')]['state']){_0x1a8f51=_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd8')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd7')]}});}break;}}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3b665d,null))[_0xa63e('0x1e')](function(_0x5c0ba5){if(_0x5c0ba5){_0x37d826=_0x5c0ba5;switch(_0x291a54[_0xa63e('0x4d')]){case _0xa63e('0x86'):if(_0x1a8f51==='2'||_0x1a8f51==='6'){return _0x37d826[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x86'),util[_0xa63e('0xd0')](_0x53b5ff[_0xa63e('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x37d826;}})[_0xa63e('0x1e')](respondWithResult(_0x3b665d,null))['catch'](handleError(_0x3b665d,null));};exports[_0xa63e('0xd9')]=function(_0x5599de,_0x3ff6fc,_0x249e79){return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x5599de[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3ff6fc,null))['then'](function(_0x92c35f){if(_0x92c35f){return _0x92c35f[_0xa63e('0xd9')](_0x5599de['body'][_0xa63e('0x6b')],_[_0xa63e('0x99')](_0x5599de[_0xa63e('0x59')],['ids','id'])||{})['spread'](function(_0x223333){for(var _0x4b94f1=0x0;_0x4b94f1<_0x5599de[_0xa63e('0x59')]['ids'][_0xa63e('0x57')];_0x4b94f1+=0x1){socket[_0xa63e('0xda')](_0xa63e('0xdb'),{'UserId':_0x5599de[_0xa63e('0x59')][_0xa63e('0x6b')][_0x4b94f1],'SmsAccountId':_0x5599de[_0xa63e('0x5f')]['id']});}return _0x223333;});}})[_0xa63e('0x1e')](respondWithResult(_0x3ff6fc,null))[_0xa63e('0x28')](handleError(_0x3ff6fc,null));};exports[_0xa63e('0xdc')]=function(_0x540321,_0x17d475,_0x241565){return db['SmsAccount'][_0xa63e('0x5d')]({'where':{'id':_0x540321[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x17d475,null))[_0xa63e('0x1e')](function(_0x1fcf8a){if(_0x1fcf8a){return _0x1fcf8a[_0xa63e('0xdc')](_0x540321['query'][_0xa63e('0x6b')])[_0xa63e('0x1e')](function(){if(_[_0xa63e('0xdd')](_0x540321[_0xa63e('0x41')][_0xa63e('0x6b')])){for(var _0x32529b=0x0;_0x32529b<_0x540321['query']['ids']['length'];_0x32529b+=0x1){socket['emit'](_0xa63e('0xde'),{'UserId':Number(_0x540321[_0xa63e('0x41')][_0xa63e('0x6b')][_0x32529b]),'SmsAccountId':Number(_0x540321[_0xa63e('0x5f')]['id'])});}}else{socket[_0xa63e('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x540321[_0xa63e('0x41')]['ids']),'SmsAccountId':Number(_0x540321[_0xa63e('0x5f')]['id'])});}});}})[_0xa63e('0x1e')](respondWithStatusCode(_0x17d475,null))[_0xa63e('0x28')](handleError(_0x17d475,null));};exports['getAgents']=function(_0x39124e,_0x2f5f31,_0x238aa2){var _0x1c308a={};var _0x12f11d={};var _0x2c645a;var _0x54063b;return db['SmsAccount']['findOne']({'where':{'id':_0x39124e['params']['id']}})['then'](handleEntityNotFound(_0x2f5f31,null))[_0xa63e('0x1e')](function(_0x3a0537){if(_0x3a0537){_0x2c645a=_0x3a0537;_0x12f11d[_0xa63e('0x42')]=_['keys'](db[_0xa63e('0xa5')]['rawAttributes']);_0x12f11d[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x39124e['query']);_0x12f11d['filters']=_['intersection'](_0x12f11d[_0xa63e('0x42')],_0x12f11d[_0xa63e('0x41')]);_0x1c308a[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x12f11d[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x39124e[_0xa63e('0x41')][_0xa63e('0x43')]));_0x1c308a[_0xa63e('0x44')]=_0x1c308a['attributes']['length']?_0x1c308a[_0xa63e('0x44')]:_0x12f11d[_0xa63e('0x42')];_0x1c308a[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x39124e['query'][_0xa63e('0x46')]);_0x1c308a['where']=qs[_0xa63e('0x48')](_['pick'](_0x39124e[_0xa63e('0x41')],_0x12f11d[_0xa63e('0x48')]));if(_0x39124e[_0xa63e('0x41')]['filter']){_0x1c308a[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x1c308a[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x1c308a[_0xa63e('0x44')],function(_0x5cda5a){var _0x5fe45b={};_0x5fe45b[_0x5cda5a]={'$like':'%'+_0x39124e[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x5fe45b;})});}_0x1c308a=_['merge']({},_0x1c308a,_0x39124e[_0xa63e('0x50')]);return _0x2c645a[_0xa63e('0xdf')](_0x1c308a);}})[_0xa63e('0x1e')](function(_0x37f886){if(_0x37f886){_0x54063b=_0x37f886[_0xa63e('0x57')];if(!_0x39124e[_0xa63e('0x41')][_0xa63e('0x69')](_0xa63e('0x45'))){_0x1c308a[_0xa63e('0x2f')]=qs['limit'](_0x39124e[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x1c308a[_0xa63e('0x2e')]=qs['offset'](_0x39124e['query'][_0xa63e('0x2e')]);}return _0x2c645a['getAgents'](_0x1c308a);}})[_0xa63e('0x1e')](function(_0x102a2c){if(_0x102a2c){return _0x102a2c?{'count':_0x54063b,'rows':_0x102a2c}:null;}})[_0xa63e('0x1e')](respondWithResult(_0x2f5f31,null))[_0xa63e('0x28')](handleError(_0x2f5f31,null));}; \ No newline at end of file +var _0x0f58=['filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','map','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','account','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','skebby','text','connectel','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','results','originatingAddress','segmentedMessage','replyMessageId','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','DESC','omit','Contacts','defaults','contact','SmsInteraction','spread','created','autoclose','unmanaged','*,*,*,*','interaction','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','stringify','Content-Type','\x0a','transaction','priority','getApplications','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','push','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','clickatell','redif','error_code','infobip','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','count','offset','limit','set','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','SmsAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3bb961,_0x5cd081){var _0xa546f2=function(_0xc082cb){while(--_0xc082cb){_0x3bb961['push'](_0x3bb961['shift']());}};_0xa546f2(++_0x5cd081);}(_0x0f58,0x93));var _0x80f5=function(_0x24e23d,_0x26684a){_0x24e23d=_0x24e23d-0x0;var _0x14db43=_0x0f58[_0x24e23d];return _0x14db43;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x80f5('0x0'));var zipdir=require(_0x80f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80f5('0x2'));var moment=require('moment');var BPromise=require(_0x80f5('0x3'));var Mustache=require(_0x80f5('0x4'));var util=require('util');var path=require(_0x80f5('0x5'));var sox=require(_0x80f5('0x6'));var csv=require(_0x80f5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x80f5('0x8'));var squel=require(_0x80f5('0x9'));var crypto=require('crypto');var jsforce=require(_0x80f5('0xa'));var deskjs=require(_0x80f5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x80f5('0xc'));var Papa=require(_0x80f5('0xd'));var Redis=require(_0x80f5('0xe'));var authService=require(_0x80f5('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x80f5('0x10'))(_0x80f5('0x11'));var utils=require('../../config/utils');var config=require(_0x80f5('0x12'));var db=require(_0x80f5('0x13'))['db'];config[_0x80f5('0x14')]=_['defaults'](config[_0x80f5('0x14')],{'host':_0x80f5('0x15'),'port':0x18eb});var socket=require(_0x80f5('0x16'))(new Redis(config[_0x80f5('0x14')]));require(_0x80f5('0x17'))['register'](socket);var jayson=require(_0x80f5('0x18'));var client=jayson[_0x80f5('0x19')][_0x80f5('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x1a9260,_0x2fcb53,_0x1eba6f){if(_0x1eba6f){var _0x294eff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x294eff[_0x80f5('0x1b')](_0x2fcb53)){return _0x1a9260;}else{throw new Error(_0x80f5('0x1c'));}}else{return _0x1a9260;}}function respondWithRpcPromise(_0x15f15e,_0x352747,_0x2ca2b3,_0x3f01a0){return new BPromise(function(_0x1ef192,_0x4af747){var _0x280a61=_0x3f01a0||client;return _0x280a61[_0x80f5('0x1d')](_0x15f15e,_0x2ca2b3)[_0x80f5('0x1e')](function(_0x120e94){logger[_0x80f5('0x1f')](_0x80f5('0x20'),_0x352747,'request\x20sent');logger['debug'](_0x80f5('0x21'),_0x352747,_0x80f5('0x22'),JSON['stringify'](_0x120e94));if(_0x120e94[_0x80f5('0x23')]){if(_0x120e94[_0x80f5('0x23')][_0x80f5('0x24')]===0x1f4){logger[_0x80f5('0x23')](_0x80f5('0x20'),_0x352747,_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);return _0x4af747(_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);}logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s',_0x352747,_0x120e94['error'][_0x80f5('0x25')]);return _0x1ef192(_0x120e94[_0x80f5('0x23')][_0x80f5('0x25')]);}else{logger[_0x80f5('0x1f')](_0x80f5('0x20'),_0x352747,'request\x20sent');_0x1ef192(_0x120e94['result'][_0x80f5('0x25')]);}})[_0x80f5('0x26')](function(_0xc191f9){logger[_0x80f5('0x23')](_0x80f5('0x20'),_0x352747,_0xc191f9);_0x4af747(_0xc191f9);});});}function respondWithStatusCode(_0x34606a,_0x19c714){_0x19c714=_0x19c714||0xcc;return function(_0x4d37df){if(_0x4d37df){return _0x34606a['sendStatus'](_0x19c714);}return _0x34606a[_0x80f5('0x27')](_0x19c714)['end']();};}function respondWithResult(_0x6c4bc,_0xf7f43e){_0xf7f43e=_0xf7f43e||0xc8;return function(_0x84b8fb){if(_0x84b8fb){return _0x6c4bc[_0x80f5('0x27')](_0xf7f43e)[_0x80f5('0x28')](_0x84b8fb);}};}function respondWithFilteredResult(_0x4dbf7a,_0x238f35){return function(_0x1e0f7d){if(_0x1e0f7d){var _0x37713b=_0x1e0f7d[_0x80f5('0x29')],_0x49c70b=_0x238f35[_0x80f5('0x2a')],_0x2a6c23=_0x238f35['offset']+_0x238f35[_0x80f5('0x2b')],_0x14f159;if(_0x2a6c23>=_0x37713b){_0x2a6c23=_0x37713b;_0x14f159=0xc8;}else{_0x14f159=0xce;}_0x4dbf7a['status'](_0x14f159);return _0x4dbf7a[_0x80f5('0x2c')]('Content-Range',_0x49c70b+'-'+_0x2a6c23+'/'+_0x37713b)[_0x80f5('0x28')](_0x1e0f7d);}return null;};}function patchUpdates(_0x8dac6f){return function(_0x2b5472){try{jsonpatch['apply'](_0x2b5472,_0x8dac6f,!![]);}catch(_0x5c2a3e){return BPromise[_0x80f5('0x2d')](_0x5c2a3e);}return _0x2b5472[_0x80f5('0x2e')]();};}function saveUpdates(_0x3c0c88,_0x4c9a54){return function(_0x2f9d4d){if(_0x2f9d4d){return _0x2f9d4d[_0x80f5('0x2f')](_0x3c0c88)[_0x80f5('0x1e')](function(_0x44e41d){return _0x44e41d;});}return null;};}function removeEntity(_0x33efaa,_0x2fa497){return function(_0x5d7cd7){if(_0x5d7cd7){return _0x5d7cd7['destroy']()[_0x80f5('0x1e')](function(){var _0x12cea8=_0x5d7cd7[_0x80f5('0x30')]({'plain':!![]});var _0x68c0fc=_0x80f5('0x31');return db[_0x80f5('0x32')][_0x80f5('0x33')]({'where':{'type':_0x68c0fc,'resourceId':_0x12cea8['id']}})['then'](function(){return _0x5d7cd7;});})[_0x80f5('0x1e')](function(){_0x33efaa[_0x80f5('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5af48f,_0x5b5b45){return function(_0x5d5d8e){if(!_0x5d5d8e){_0x5af48f[_0x80f5('0x34')](0x194);}return _0x5d5d8e;};}function handleError(_0x38de2d,_0x1bca3c){_0x1bca3c=_0x1bca3c||0x1f4;return function(_0x297a97){logger['error'](_0x297a97[_0x80f5('0x35')]);if(_0x297a97['name']){delete _0x297a97[_0x80f5('0x36')];}_0x38de2d[_0x80f5('0x27')](_0x1bca3c)[_0x80f5('0x37')](_0x297a97);};}exports[_0x80f5('0x38')]=function(_0x334768,_0x88904f){var _0x257edf={'include':[{'model':db[_0x80f5('0x39')],'as':'mandatoryDispositionPause'}]},_0x17b531={},_0x1ba2dc={'count':0x0,'rows':[]};var _0x1bd5f6=db[_0x80f5('0x3a')][_0x80f5('0x3b')];_0x17b531[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](_0x1bd5f6);_0x17b531['query']=_[_0x80f5('0x3d')](_0x334768[_0x80f5('0x3e')]);_0x17b531[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x17b531[_0x80f5('0x3c')],_0x17b531[_0x80f5('0x3e')]);_0x257edf['attributes']=_[_0x80f5('0x40')](_0x17b531[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x257edf[_0x80f5('0x42')]=_0x257edf[_0x80f5('0x42')][_0x80f5('0x43')]?_0x257edf[_0x80f5('0x42')]:_0x17b531['model'];if(!_0x334768[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x257edf[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x334768[_0x80f5('0x3e')]['limit']);_0x257edf[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x2a')]);}_0x257edf[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x334768[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x257edf[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x334768[_0x80f5('0x3e')],_0x17b531[_0x80f5('0x3f')]));if(_0x334768[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x257edf['where']=_[_0x80f5('0x4b')](_0x257edf[_0x80f5('0x48')],{'$or':_['map'](_0x1bd5f6,function(_0x3030dd){if(_0x3030dd[_0x80f5('0x4c')]['key']!==_0x80f5('0x4d')){var _0x559d73={};_0x559d73[_0x3030dd[_0x80f5('0x4e')]]={'$like':'%'+_0x334768['query'][_0x80f5('0x4a')]+'%'};return _0x559d73;}})});}_0x257edf=_[_0x80f5('0x4b')]({},_0x257edf,_0x334768[_0x80f5('0x4f')]);var _0x47077c={'where':_0x257edf['where']};return db[_0x80f5('0x3a')][_0x80f5('0x29')](_0x47077c)[_0x80f5('0x1e')](function(_0x20fb43){_0x1ba2dc[_0x80f5('0x29')]=_0x20fb43;if(_0x334768[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x257edf[_0x80f5('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0x80f5('0x52')](_0x257edf);})['then'](function(_0x4163e8){_0x1ba2dc[_0x80f5('0x53')]=_0x4163e8;return _0x1ba2dc;})[_0x80f5('0x1e')](respondWithFilteredResult(_0x88904f,_0x257edf))[_0x80f5('0x26')](handleError(_0x88904f,null));};exports[_0x80f5('0x54')]=function(_0x3ef5a8,_0x2ff441){var _0x5629e8={'raw':![],'where':{'id':_0x3ef5a8['params']['id']},'include':[{'model':db['Pause'],'as':_0x80f5('0x55')}]},_0x2e7fee={};_0x2e7fee[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db['SmsAccount'][_0x80f5('0x3b')]);_0x2e7fee[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0x3ef5a8[_0x80f5('0x3e')]);_0x2e7fee[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x2e7fee[_0x80f5('0x3c')],_0x2e7fee[_0x80f5('0x3e')]);_0x5629e8[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x2e7fee[_0x80f5('0x3c')],qs['fields'](_0x3ef5a8[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x5629e8[_0x80f5('0x42')]=_0x5629e8[_0x80f5('0x42')][_0x80f5('0x43')]?_0x5629e8[_0x80f5('0x42')]:_0x2e7fee[_0x80f5('0x3c')];if(_0x3ef5a8[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x5629e8[_0x80f5('0x51')]=[{'all':!![]}];}_0x5629e8=_[_0x80f5('0x4b')]({},_0x5629e8,_0x3ef5a8['options']);return db[_0x80f5('0x3a')][_0x80f5('0x56')](_0x5629e8)[_0x80f5('0x1e')](handleEntityNotFound(_0x2ff441,null))['then'](respondWithResult(_0x2ff441,null))[_0x80f5('0x26')](handleError(_0x2ff441,null));};exports['create']=function(_0x222955,_0x3acf85){return db[_0x80f5('0x3a')]['create'](_0x222955[_0x80f5('0x57')],{})[_0x80f5('0x1e')](function(_0x2c11f3){var _0x323367=_0x222955[_0x80f5('0x58')][_0x80f5('0x30')]({'plain':!![]});if(!_0x323367)throw new Error(_0x80f5('0x59'));if(_0x323367[_0x80f5('0x5a')]===_0x80f5('0x58')){var _0x37cf6a=_0x2c11f3[_0x80f5('0x30')]({'plain':!![]});var _0x1f2948=_0x80f5('0x31');return db[_0x80f5('0x5b')][_0x80f5('0x56')]({'where':{'name':_0x1f2948,'userProfileId':_0x323367[_0x80f5('0x5c')]},'raw':!![]})[_0x80f5('0x1e')](function(_0x50d14e){if(_0x50d14e&&_0x50d14e[_0x80f5('0x5d')]===0x0){return db[_0x80f5('0x32')][_0x80f5('0x5e')]({'name':_0x37cf6a['name'],'resourceId':_0x37cf6a['id'],'type':_0x50d14e[_0x80f5('0x36')],'sectionId':_0x50d14e['id']},{})[_0x80f5('0x1e')](function(){return _0x2c11f3;});}else{return _0x2c11f3;}})['catch'](function(_0xbb48b2){logger['error'](_0x80f5('0x5f'),_0xbb48b2);throw _0xbb48b2;});}return _0x2c11f3;})[_0x80f5('0x1e')](respondWithResult(_0x3acf85,0xc9))[_0x80f5('0x26')](handleError(_0x3acf85,null));};exports[_0x80f5('0x2f')]=function(_0x1bcd23,_0x12e89a){if(_0x1bcd23[_0x80f5('0x57')]['id']){delete _0x1bcd23[_0x80f5('0x57')]['id'];}return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x1bcd23['params']['id']},'include':[{'model':db[_0x80f5('0x39')],'as':_0x80f5('0x55')}]})['then'](handleEntityNotFound(_0x12e89a,null))[_0x80f5('0x1e')](saveUpdates(_0x1bcd23[_0x80f5('0x57')],null))[_0x80f5('0x1e')](respondWithResult(_0x12e89a,null))[_0x80f5('0x26')](handleError(_0x12e89a,null));};exports[_0x80f5('0x33')]=function(_0x26aa5d,_0x26d673){return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x26aa5d[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x26d673,null))['then'](removeEntity(_0x26d673,null))[_0x80f5('0x26')](handleError(_0x26d673,null));};exports[_0x80f5('0x61')]=function(_0x295d08,_0x3c1de9){return db[_0x80f5('0x3a')][_0x80f5('0x61')]()[_0x80f5('0x1e')](respondWithResult(_0x3c1de9,null))['catch'](handleError(_0x3c1de9,null));};exports[_0x80f5('0x62')]=function(_0x50f8ff,_0x58143a,_0x451b36){if(_0x50f8ff[_0x80f5('0x57')]['id']){delete _0x50f8ff[_0x80f5('0x57')]['id'];}return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x50f8ff[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x58143a,null))[_0x80f5('0x1e')](function(_0x151958){if(_0x151958){_0x50f8ff[_0x80f5('0x57')][_0x80f5('0x63')]=_0x151958['id'];return db['Disposition'][_0x80f5('0x5e')](_0x50f8ff[_0x80f5('0x57')]);}})[_0x80f5('0x1e')](respondWithResult(_0x58143a,null))['catch'](handleError(_0x58143a,null));};exports['getDispositions']=function(_0x14547b,_0xfeeb2,_0x7907c3){var _0x69d96f={'raw':![],'where':{}};var _0x508095={};var _0x2175f9={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x14547b[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0xfeeb2,null))[_0x80f5('0x1e')](function(_0x1b8ed0){if(_0x1b8ed0){_0x508095[_0x80f5('0x3c')]=_['keys'](db[_0x80f5('0x65')][_0x80f5('0x3b')]);_0x508095[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0x14547b[_0x80f5('0x3e')]);_0x508095[_0x80f5('0x3f')]=_['intersection'](_0x508095['model'],_0x508095[_0x80f5('0x3e')]);_0x69d96f[_0x80f5('0x42')]=_['intersection'](_0x508095[_0x80f5('0x3c')],qs['fields'](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x69d96f[_0x80f5('0x42')]=_0x69d96f['attributes'][_0x80f5('0x43')]?_0x69d96f[_0x80f5('0x42')]:_0x508095[_0x80f5('0x3c')];if(!_0x14547b[_0x80f5('0x3e')]['hasOwnProperty'](_0x80f5('0x45'))){_0x69d96f[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x69d96f[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x2a')]);}_0x69d96f[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x14547b[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x69d96f[_0x80f5('0x48')]=qs['filters'](_[_0x80f5('0x49')](_0x14547b[_0x80f5('0x3e')],_0x508095['filters']));_0x69d96f[_0x80f5('0x48')][_0x80f5('0x63')]=_0x1b8ed0['id'];if(_0x14547b[_0x80f5('0x3e')]['filter']){_0x69d96f[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x69d96f['where'],{'$or':_['map'](_0x69d96f[_0x80f5('0x42')],function(_0xd963ea){var _0x54ce18={};_0x54ce18[_0xd963ea]={'$like':'%'+_0x14547b[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x54ce18;})});}_0x69d96f=_[_0x80f5('0x4b')]({},_0x69d96f,_0x14547b[_0x80f5('0x4f')]);return db['Disposition']['count']({'where':_0x69d96f[_0x80f5('0x48')]})[_0x80f5('0x1e')](function(_0x4f6cef){_0x2175f9[_0x80f5('0x29')]=_0x4f6cef;if(_0x14547b[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x69d96f[_0x80f5('0x51')]=[{'all':!![]}];}return db[_0x80f5('0x65')][_0x80f5('0x52')](_0x69d96f);})[_0x80f5('0x1e')](function(_0x129490){_0x2175f9[_0x80f5('0x53')]=_0x129490;return _0x2175f9;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0xfeeb2,_0x69d96f))['catch'](handleError(_0xfeeb2,null));};exports[_0x80f5('0x66')]=function(_0x401ef3,_0x35c623,_0x455e44){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x401ef3[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x35c623,null))[_0x80f5('0x1e')](function(_0x52df16){if(_0x52df16){return _0x52df16[_0x80f5('0x66')](_0x401ef3['query'][_0x80f5('0x67')]);}})[_0x80f5('0x1e')](respondWithStatusCode(_0x35c623,null))[_0x80f5('0x26')](handleError(_0x35c623,null));};exports[_0x80f5('0x68')]=function(_0x35a516,_0x13a5de,_0x398920){if(_0x35a516['body']['id']){delete _0x35a516[_0x80f5('0x57')]['id'];}return db[_0x80f5('0x3a')]['find']({'where':{'id':_0x35a516[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x13a5de,null))['then'](function(_0x365d42){if(_0x365d42){_0x35a516[_0x80f5('0x57')][_0x80f5('0x63')]=_0x365d42['id'];return db[_0x80f5('0x69')]['create'](_0x35a516[_0x80f5('0x57')]);}})[_0x80f5('0x1e')](respondWithResult(_0x13a5de,null))[_0x80f5('0x26')](handleError(_0x13a5de,null));};exports[_0x80f5('0x6a')]=function(_0x4d8537,_0x91fd94,_0x2ac42b){var _0x29b1dc={'raw':![],'where':{}};var _0x3748b0={};var _0x8d8c6c={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x4d8537[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x91fd94,null))[_0x80f5('0x1e')](function(_0x52247d){if(_0x52247d){_0x3748b0['model']=_['keys'](db['CannedAnswer'][_0x80f5('0x3b')]);_0x3748b0[_0x80f5('0x3e')]=_['keys'](_0x4d8537[_0x80f5('0x3e')]);_0x3748b0[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x3748b0['model'],_0x3748b0[_0x80f5('0x3e')]);_0x29b1dc['attributes']=_[_0x80f5('0x40')](_0x3748b0[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x29b1dc[_0x80f5('0x42')]=_0x29b1dc[_0x80f5('0x42')][_0x80f5('0x43')]?_0x29b1dc[_0x80f5('0x42')]:_0x3748b0[_0x80f5('0x3c')];if(!_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x29b1dc[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x29b1dc[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x4d8537[_0x80f5('0x3e')]['offset']);}_0x29b1dc[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x4d8537[_0x80f5('0x3e')]['sort']);_0x29b1dc['where']=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x4d8537[_0x80f5('0x3e')],_0x3748b0[_0x80f5('0x3f')]));_0x29b1dc[_0x80f5('0x48')]['SmsAccountId']=_0x52247d['id'];if(_0x4d8537['query'][_0x80f5('0x4a')]){_0x29b1dc[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x29b1dc['where'],{'$or':_[_0x80f5('0x6b')](_0x29b1dc['attributes'],function(_0x4c91d9){var _0x5be5c0={};_0x5be5c0[_0x4c91d9]={'$like':'%'+_0x4d8537[_0x80f5('0x3e')]['filter']+'%'};return _0x5be5c0;})});}_0x29b1dc=_['merge']({},_0x29b1dc,_0x4d8537['options']);return db[_0x80f5('0x69')][_0x80f5('0x29')]({'where':_0x29b1dc['where']})[_0x80f5('0x1e')](function(_0x3064dc){_0x8d8c6c[_0x80f5('0x29')]=_0x3064dc;if(_0x4d8537[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x29b1dc['include']=[{'all':!![]}];}return db[_0x80f5('0x69')][_0x80f5('0x52')](_0x29b1dc);})[_0x80f5('0x1e')](function(_0x200ee5){_0x8d8c6c[_0x80f5('0x53')]=_0x200ee5;return _0x8d8c6c;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0x91fd94,_0x29b1dc))[_0x80f5('0x26')](handleError(_0x91fd94,null));};exports[_0x80f5('0x6c')]=function(_0x3f35ca,_0x5c6c48,_0x255648){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x3f35ca[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5c6c48,null))['then'](function(_0x21af08){if(_0x21af08){return _0x21af08['removeAnswers'](_0x3f35ca['query'][_0x80f5('0x67')]);}})[_0x80f5('0x1e')](respondWithStatusCode(_0x5c6c48,null))[_0x80f5('0x26')](handleError(_0x5c6c48,null));};exports[_0x80f5('0x6d')]=function(_0x48dfde,_0x384faa,_0x4e6e7b){var _0x431093={'channel':_0x80f5('0x6e')};var _0x52627b=[];var _0x2367c4=[];var _0x5b610e={};return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x48dfde[_0x80f5('0x60')]['id']},'include':[{'model':db[_0x80f5('0x6f')],'as':_0x80f5('0x70')}]})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x579319){_0x431093['account']=_0x579319;_0x431093[_0x80f5('0x71')]=_[_0x80f5('0x72')](_0x579319[_0x80f5('0x70')],['priority'],['asc']);if(_0x431093[_0x80f5('0x73')]['Applications']){delete _0x431093[_0x80f5('0x73')][_0x80f5('0x70')];}return db[_0x80f5('0x74')][_0x80f5('0x61')]();})[_0x80f5('0x1e')](function(_0x44503a){if(!_0x44503a){throw new db['Sequelize'][(_0x80f5('0x75'))](_0x80f5('0x76'));}_0x52627b=_[_0x80f5('0x77')](_[_0x80f5('0x3d')](_0x44503a),[_0x80f5('0x78'),_0x80f5('0x79')]);_0x2367c4=_[_0x80f5('0x77')](_['keys'](_0x44503a),[_0x80f5('0x78'),_0x80f5('0x79'),_0x80f5('0x7a'),'ListId']);_0x431093[_0x80f5('0x57')]={'mapKey':_0x80f5('0x7b')};if(_0x431093[_0x80f5('0x73')]['type']){switch(_0x431093['account'][_0x80f5('0x4c')]){case _0x80f5('0x7c'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')]['From'];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7e')];_0x431093[_0x80f5('0x57')]['messageId']=_0x48dfde[_0x80f5('0x57')]['MessageSid'];break;case _0x80f5('0x7f'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]='+'+_0x48dfde[_0x80f5('0x57')]['sender'];_0x431093['body']['body']=_0x48dfde['body'][_0x80f5('0x80')];break;case _0x80f5('0x81'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7d')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x25')];break;case _0x80f5('0x82'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x7d')];_0x431093['body'][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x57')];_0x431093['body'][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x84')];break;case _0x80f5('0x85'):_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x86')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x87')];_0x431093[_0x80f5('0x57')][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x88')];break;case'infobip':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]='+'+_0x48dfde['body'][_0x80f5('0x89')][0x0][_0x80f5('0x7d')];_0x431093['body'][_0x80f5('0x57')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x89')][0x0][_0x80f5('0x80')];_0x431093[_0x80f5('0x57')][_0x80f5('0x83')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x89')][0x0][_0x80f5('0x83')];break;case'csc':_0x431093['body'][_0x80f5('0x7d')]=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8a')];_0x431093[_0x80f5('0x57')]['body']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8b')][_0x80f5('0x25')];break;case'clickatell':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde['body']['fromNumber'];_0x431093[_0x80f5('0x57')]['body']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x80')];_0x431093['body'][_0x80f5('0x83')]=_0x48dfde['body'][_0x80f5('0x8c')];break;case _0x80f5('0x8d'):_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')]=_0x48dfde['body'][_0x80f5('0x7d')];_0x431093[_0x80f5('0x57')][_0x80f5('0x57')]=_0x48dfde['body'][_0x80f5('0x25')];_0x431093['body']['messageId']=_0x48dfde[_0x80f5('0x57')][_0x80f5('0x8e')];break;}}if(_0x431093[_0x80f5('0x57')]['id']){delete _0x431093[_0x80f5('0x57')]['id'];}if(_[_0x80f5('0x8f')](_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x91'));}if(_[_0x80f5('0x8f')](_0x431093[_0x80f5('0x57')][_0x80f5('0x57')])||_0x431093['body'][_0x80f5('0x57')]===''){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x92'));}if(_['isNil'](_0x431093[_0x80f5('0x57')][_0x80f5('0x93')])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x94')+_0x2367c4);}if(!_[_0x80f5('0x95')](_0x2367c4,_0x431093[_0x80f5('0x57')]['mapKey'])){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2367c4);}_0x5b610e[_0x431093[_0x80f5('0x57')][_0x80f5('0x93')]]=_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')];return db[_0x80f5('0x96')][_0x80f5('0x56')]({'where':{'id':_0x431093[_0x80f5('0x73')][_0x80f5('0x97')]},'include':[{'model':db[_0x80f5('0x74')],'as':'Contacts','where':_0x5b610e,'limit':0x1,'order':[[_0x80f5('0x79'),_0x80f5('0x98')]]}]});})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x2bc449){if(_0x2bc449){_0x431093['list']=_[_0x80f5('0x99')](_0x2bc449,[_0x80f5('0x9a')]);if(_0x2bc449[_0x80f5('0x9a')][_0x80f5('0x43')]){return _0x2bc449[_0x80f5('0x9a')][0x0];}var _0x2acf80=_[_0x80f5('0x9b')](_0x431093[_0x80f5('0x57')],{'firstName':_0x431093[_0x80f5('0x57')]['from'],'ListId':_0x2bc449['id']});_0x2acf80[_0x431093[_0x80f5('0x57')][_0x80f5('0x93')]]=_0x431093[_0x80f5('0x57')]['from'];return db[_0x80f5('0x74')][_0x80f5('0x5e')](_0x2acf80,{'fields':_0x52627b,'raw':!![]});}})[_0x80f5('0x1e')](handleEntityNotFound(_0x384faa,null))[_0x80f5('0x1e')](function(_0x1a3b36){if(_0x1a3b36){_0x431093[_0x80f5('0x9c')]=_0x1a3b36;var _0x573062={'ContactId':_0x1a3b36['id'],'phone':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')],'SmsAccountId':_0x48dfde[_0x80f5('0x60')]['id']};var _0x1cdcdc={'ContactId':_0x1a3b36['id'],'SmsAccountId':_0x48dfde['params']['id'],'closed':![]};return db[_0x80f5('0x9d')][_0x80f5('0x56')]({'where':_0x1cdcdc})[_0x80f5('0x1e')](function(_0x103d24){if(_0x103d24){return[_0x103d24,![]];}return db['SmsInteraction'][_0x80f5('0x5e')](_0x573062)['then'](function(_0x3c914a){return[_0x3c914a,!![]];});});}})[_0x80f5('0x9e')](function(_0x1857bd,_0x4f810e){_0x431093['interaction']=_0x1857bd[_0x80f5('0x30')]({'plain':!![]});_0x431093['interaction'][_0x80f5('0x9f')]=![];if(_0x4f810e){if(_0x431093[_0x80f5('0x73')][_0x80f5('0xa0')]){_0x431093[_0x80f5('0x71')]['push']({'id':0x0,'priority':_0x431093[_0x80f5('0x71')][_0x80f5('0x43')]+0x1,'app':'close','appdata':_0x80f5('0xa1'),'interval':_0x80f5('0xa2')});}_0x431093[_0x80f5('0xa3')][_0x80f5('0x9f')]=!![];}return db[_0x80f5('0xa4')][_0x80f5('0x5e')]({'phone':_0x431093[_0x80f5('0x57')][_0x80f5('0x7d')],'messageId':_0x431093[_0x80f5('0x57')][_0x80f5('0x83')],'body':_0x431093[_0x80f5('0x57')][_0x80f5('0x57')],'SmsAccountId':_0x48dfde['params']['id'],'SmsInteractionId':_0x1857bd['id'],'direction':'in','ContactId':_0x1857bd[_0x80f5('0xa5')],'AttachmentId':_0x431093['body'][_0x80f5('0xa6')]});})['then'](function(_0x1fa9ae){_0x431093[_0x80f5('0x25')]=_0x1fa9ae;if(_0x431093['interaction'][_0x80f5('0xa7')]){return db[_0x80f5('0xa8')][_0x80f5('0x56')]({'attributes':['id',_0x80f5('0x36')],'where':{'id':_0x431093[_0x80f5('0xa3')][_0x80f5('0xa7')]}})[_0x80f5('0x1e')](function(_0x585906){if(_0x585906){_0x431093[_0x80f5('0x71')]['unshift']({'id':0x0,'priority':0x0,'app':_0x80f5('0xa9'),'appdata':_0x585906['name']+','+(_0x431093[_0x80f5('0x73')][_0x80f5('0xaa')]||0xa),'interval':_0x80f5('0xa2')});}return respondWithRpcPromise(_0x80f5('0xab'),_0x80f5('0xac'),_0x431093);});}return respondWithRpcPromise(_0x80f5('0xab'),'startRouting',_0x431093);})[_0x80f5('0x1e')](function(_0x5290f7){if(_0x5290f7){var _0x2ea2a1=0xc8;var _0x47e092=_0x80f5('0xad');logger[_0x80f5('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47e092,_0x2ea2a1,_0x80f5('0xae'));logger[_0x80f5('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x47e092,_0x2ea2a1,_0x80f5('0xae'),JSON[_0x80f5('0xb0')](_0x5290f7));if(_0x431093[_0x80f5('0x73')][_0x80f5('0x4c')]===_0x80f5('0x7c')){return _0x384faa[_0x80f5('0x27')](_0x2ea2a1)[_0x80f5('0x2c')](_0x80f5('0xb1'),'text/xml')[_0x80f5('0x37')](_0x80f5('0xb2'));}else{return _0x384faa[_0x80f5('0x27')](_0x2ea2a1)[_0x80f5('0x28')](_0x5290f7);}}})['catch'](handleError(_0x384faa,null));};exports['addApplications']=function(_0x4946fb,_0x4f1cab,_0x3720d9){return db['SmsAccount'][_0x80f5('0x64')]({'where':{'id':_0x4946fb[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x4f1cab,null))[_0x80f5('0x1e')](function(_0x493b09){if(_0x493b09){return db['sequelize'][_0x80f5('0xb3')](function(_0x574898){return db[_0x80f5('0x6f')][_0x80f5('0x33')]({'where':{'SmsAccountId':_0x4946fb['params']['id']},'transaction':_0x574898})['then'](function(_0x4941a5){var _0x3c7fcc=_[_0x80f5('0x6b')](_0x4946fb[_0x80f5('0x57')],function(_0x84ecbe){_0x84ecbe['SmsAccountId']=_0x4946fb[_0x80f5('0x60')]['id'];return _0x84ecbe;});return db[_0x80f5('0x6f')]['bulkCreate'](_0x3c7fcc,{'transaction':_0x574898});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x4946fb[_0x80f5('0x60')]['id']},'order':_0x80f5('0xb4')});});}})[_0x80f5('0x1e')](respondWithResult(_0x4f1cab,null))[_0x80f5('0x26')](handleError(_0x4f1cab,null));};exports[_0x80f5('0xb5')]=function(_0x1a24d7,_0x5647db,_0x28948a){var _0x1d36e4={};var _0x2b8e07={};var _0x5d2da3;var _0x487e96;return db[_0x80f5('0x3a')]['findOne']({'where':{'id':_0x1a24d7[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5647db,null))[_0x80f5('0x1e')](function(_0xc58a74){if(_0xc58a74){_0x5d2da3=_0xc58a74;_0x2b8e07[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db[_0x80f5('0x6f')][_0x80f5('0x3b')]);_0x2b8e07['query']=_[_0x80f5('0x3d')](_0x1a24d7['query']);_0x2b8e07[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x2b8e07[_0x80f5('0x3c')],_0x2b8e07[_0x80f5('0x3e')]);_0x1d36e4['attributes']=_[_0x80f5('0x40')](_0x2b8e07[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x1a24d7['query'][_0x80f5('0x41')]));_0x1d36e4[_0x80f5('0x42')]=_0x1d36e4['attributes'][_0x80f5('0x43')]?_0x1d36e4[_0x80f5('0x42')]:_0x2b8e07[_0x80f5('0x3c')];_0x1d36e4[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x1d36e4[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x1a24d7[_0x80f5('0x3e')],_0x2b8e07[_0x80f5('0x3f')]));if(_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x1d36e4['where']=_[_0x80f5('0x4b')](_0x1d36e4[_0x80f5('0x48')],{'$or':_['map'](_0x1d36e4['attributes'],function(_0xcc9f2b){var _0x5d2b4a={};_0x5d2b4a[_0xcc9f2b]={'$like':'%'+_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x5d2b4a;})});}_0x1d36e4=_[_0x80f5('0x4b')]({},_0x1d36e4,_0x1a24d7[_0x80f5('0x4f')]);return _0x5d2da3[_0x80f5('0xb5')](_0x1d36e4);}})[_0x80f5('0x1e')](function(_0x1c7bfa){if(_0x1c7bfa){_0x487e96=_0x1c7bfa[_0x80f5('0x43')];if(!_0x1a24d7[_0x80f5('0x3e')]['hasOwnProperty']('nolimit')){_0x1d36e4[_0x80f5('0x2b')]=qs['limit'](_0x1a24d7[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x1d36e4[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x1a24d7['query']['offset']);}return _0x5d2da3[_0x80f5('0xb5')](_0x1d36e4);}})['then'](function(_0x36eef0){if(_0x36eef0){return _0x36eef0?{'count':_0x487e96,'rows':_0x36eef0}:null;}})[_0x80f5('0x1e')](respondWithResult(_0x5647db,null))['catch'](handleError(_0x5647db,null));};exports['getInteractions']=function(_0xf891fc,_0x5d0f5d,_0x3bb68b){var _0x569070={'raw':![],'where':{}};var _0x140758={};var _0x598f06={'count':0x0,'rows':[]};return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0xf891fc[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5d0f5d,null))[_0x80f5('0x1e')](function(_0x31af4f){if(_0x31af4f){_0x140758[_0x80f5('0x3c')]=_['keys'](db[_0x80f5('0x9d')][_0x80f5('0x3b')]);_0x140758[_0x80f5('0x3e')]=_[_0x80f5('0x3d')](_0xf891fc[_0x80f5('0x3e')]);_0x140758['filters']=_[_0x80f5('0x40')](_0x140758[_0x80f5('0x3c')],_0x140758[_0x80f5('0x3e')]);_0x569070[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x140758[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x569070[_0x80f5('0x42')]=_0x569070['attributes'][_0x80f5('0x43')]?_0x569070[_0x80f5('0x42')]:_0x140758[_0x80f5('0x3c')];if(!_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x569070[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x569070[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0xf891fc['query'][_0x80f5('0x2a')]);}_0x569070['order']=qs['sort'](_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x569070['where']=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0xf891fc[_0x80f5('0x3e')],_0x140758[_0x80f5('0x3f')]));_0x569070['where'][_0x80f5('0x63')]=_0x31af4f['id'];if(_0xf891fc[_0x80f5('0x3e')]['filter']){_0x569070[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x569070[_0x80f5('0x48')],{'$or':_['map'](_0x569070[_0x80f5('0x42')],function(_0x2b2b64){var _0x29a3d9={};_0x29a3d9[_0x2b2b64]={'$like':'%'+_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x4a')]+'%'};return _0x29a3d9;})});}_0x569070=_[_0x80f5('0x4b')]({},_0x569070,_0xf891fc[_0x80f5('0x4f')]);return db[_0x80f5('0x9d')][_0x80f5('0x29')]({'where':_0x569070[_0x80f5('0x48')]})['then'](function(_0x4ec956){_0x598f06[_0x80f5('0x29')]=_0x4ec956;if(_0xf891fc[_0x80f5('0x3e')][_0x80f5('0x50')]){_0x569070['include']=[{'model':db['CmContact'],'as':_0x80f5('0xb6'),'required':![]},{'model':db[_0x80f5('0xa8')],'as':'Owner','attributes':['name','fullname',_0x80f5('0xb7')],'required':![]},{'model':db[_0x80f5('0xb8')],'as':_0x80f5('0xb9'),'attributes':['id',_0x80f5('0x36'),_0x80f5('0xba')],'where':_0xf891fc['query'][_0x80f5('0xbb')]?{'id':_0xf891fc[_0x80f5('0x3e')]['tag']}:undefined,'required':_0xf891fc[_0x80f5('0x3e')][_0x80f5('0xbb')]?!![]:![]}];}return db['SmsInteraction'][_0x80f5('0x52')](_0x569070);})[_0x80f5('0x1e')](function(_0x411dd3){_0x598f06[_0x80f5('0x53')]=_0x411dd3;return _0x598f06;});}})[_0x80f5('0x1e')](respondWithFilteredResult(_0x5d0f5d,_0x569070))[_0x80f5('0x26')](handleError(_0x5d0f5d,null));};exports[_0x80f5('0x37')]=function(_0x265d19,_0x5c01c8,_0x1383e4){var _0x45ebc3,_0x5b9048,_0x39689e;if(_[_0x80f5('0x8f')](_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')])||_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')]===''){throw new db[(_0x80f5('0x90'))][(_0x80f5('0x75'))](_0x80f5('0x92'));}if(_[_0x80f5('0x8f')](_0x265d19[_0x80f5('0x57')]['to'])){throw new db['Sequelize'][(_0x80f5('0x75'))](_0x80f5('0xbc'));}_0x45ebc3=_0x265d19[_0x80f5('0x57')]['to'];return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x265d19[_0x80f5('0x60')]['id']},'include':[{'model':db[_0x80f5('0x96')],'as':_0x80f5('0xbd'),'include':[{'model':db['CmContact'],'as':_0x80f5('0x9a'),'where':{'mobile':_0x45ebc3},'limit':0x1,'order':[[_0x80f5('0x79'),'DESC']]}]}]})[_0x80f5('0x1e')](handleEntityNotFound(_0x5c01c8,null))['then'](function(_0x5c5fbc){if(_0x5c5fbc&&_0x5c5fbc[_0x80f5('0xbd')]){_0x5b9048=_0x5c5fbc['get']({'plain':!![]});if(_0x5b9048['List']&&_0x5b9048[_0x80f5('0xbd')][_0x80f5('0x9a')][_0x80f5('0x43')]){return _0x5b9048['List'][_0x80f5('0x9a')][0x0];}return db[_0x80f5('0x74')][_0x80f5('0x5e')](_[_0x80f5('0x9b')](_0x265d19[_0x80f5('0x57')],{'firstName':_0x45ebc3,'mobile':_0x45ebc3,'phone':_0x45ebc3,'ListId':_0x5b9048['ListId']}));}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5c01c8,null))[_0x80f5('0x1e')](function(_0x2b4687){if(_0x2b4687){_0x39689e=_0x2b4687;return db['SmsInteraction'][_0x80f5('0x56')]({'where':{'ContactId':_0x39689e['id'],'closed':![],'SmsAccountId':_0x5b9048['id']}})[_0x80f5('0x1e')](function(_0x5946d0){if(_0x5946d0){return[_0x5946d0,![]];}return db['SmsInteraction'][_0x80f5('0x5e')]({'UserId':_0x265d19['user']['id'],'ContactId':_0x39689e['id'],'SmsAccountId':_0x5b9048['id'],'phone':_0x45ebc3,'firstMsgDirection':_0x80f5('0xbe'),'Messages':[_[_0x80f5('0x4b')](_0x265d19['body'],{'read':![],'body':_0x265d19[_0x80f5('0x57')]['body'],'phone':_0x45ebc3,'SmsAccountId':_0x5b9048['id'],'UserId':_0x265d19[_0x80f5('0x58')]['id'],'ContactId':_0x39689e['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x80f5('0x1e')](function(_0x171a0a){return[_0x171a0a,!![]];});});}})[_0x80f5('0x9e')](function(_0x3483fa,_0x39286d){if(_0x39286d){return _0x3483fa;}return db[_0x80f5('0xa4')][_0x80f5('0x5e')](_[_0x80f5('0x4b')](_0x265d19[_0x80f5('0x57')],{'read':![],'body':_0x265d19[_0x80f5('0x57')][_0x80f5('0x57')],'phone':_0x45ebc3,'SmsAccountId':_0x5b9048['id'],'SmsInteractionId':_0x3483fa['id'],'UserId':_0x265d19[_0x80f5('0x58')]['id'],'ContactId':_0x39689e['id']}))[_0x80f5('0x1e')](function(_0x4cc516){_0x3483fa[_0x80f5('0xbf')][_0x80f5('0xc0')]=[];_0x3483fa[_0x80f5('0xbf')]['Messages'][_0x80f5('0xc1')](_0x4cc516[_0x80f5('0xbf')]);return _0x3483fa;});})['then'](respondWithResult(_0x5c01c8,null))[_0x80f5('0x26')](handleError(_0x5c01c8,null));};exports[_0x80f5('0x27')]=function(_0xb76a1,_0x330422,_0x476277){if(_0xb76a1[_0x80f5('0x57')]['id']){delete _0xb76a1[_0x80f5('0x57')]['id'];}console[_0x80f5('0xc2')]('endpoint\x20/status\x20POST\x20/',_0xb76a1[_0x80f5('0x57')]);var _0x2ee3c7,_0x153048,_0x45b69d;return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0xb76a1[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x330422,null))['then'](function(_0x495904){if(_0x495904){_0x45b69d=_0x495904;logger['debug'](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xc3'),_0x495904[_0x80f5('0x4c')],util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));switch(_0x495904[_0x80f5('0x4c')]){case'skebby':if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc5')]&&_0xb76a1[_0x80f5('0x57')]['status']){_0x153048=_0xb76a1['body'][_0x80f5('0x27')];return db[_0x80f5('0xa4')]['find']({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc5')]}});}break;case _0x80f5('0x81'):if(_0xb76a1[_0x80f5('0x57')]['requestid']&&_0xb76a1[_0x80f5('0x57')]['statusInt']){_0x153048=_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc6')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0xc7')]}});}break;case _0x80f5('0x82'):if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0x84')]&&_0xb76a1['body'][_0x80f5('0xc8')]){_0x153048=_0xb76a1['body'][_0x80f5('0xc8')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0x84')]}});}break;case'infobip':var _0x92aac8=_0xb76a1[_0x80f5('0x57')][_0x80f5('0x89')][0x0];if(_0x92aac8[_0x80f5('0x83')]&&_0x92aac8[_0x80f5('0x27')][_0x80f5('0xc9')]===_0x80f5('0xca')){_0x153048=_0x92aac8[_0x80f5('0x27')][_0x80f5('0xc9')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0x92aac8['messageId']}});}break;case _0x80f5('0xcb'):if(_0xb76a1['body'][_0x80f5('0x83')]&&_0xb76a1['body']['status']){_0x153048=_0xb76a1[_0x80f5('0x57')]['status'];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1[_0x80f5('0x57')][_0x80f5('0x83')]}});}break;case _0x80f5('0x8d'):if(_0xb76a1[_0x80f5('0x57')][_0x80f5('0xcc')]&&_0xb76a1[_0x80f5('0x57')][_0x80f5('0x27')]){_0x153048=_0xb76a1[_0x80f5('0x57')][_0x80f5('0x27')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0xb76a1['body']['redif']}});}break;}}})[_0x80f5('0x1e')](handleEntityNotFound(_0x330422,null))[_0x80f5('0x1e')](function(_0x3abaec){if(_0x3abaec){_0x2ee3c7=_0x3abaec;switch(_0x45b69d[_0x80f5('0x4c')]){case _0x80f5('0x7f'):if(_0x153048===_0x80f5('0xca')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x80f5('0x27'),_0x80f5('0x7f'),util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x80f5('0x81'):if(_0x153048==='1'){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),'status','skebby',util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xb76a1[_0x80f5('0x57')][_0x80f5('0xcd')]&&_0x153048>=0xc8&&_0x153048<=0xce){return _0x2ee3c7['update']({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),'status',_0x80f5('0x82'),util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x80f5('0xce'):var _0x30c59a=_0xb76a1['body'][_0x80f5('0x89')][0x0];if(_0x30c59a[_0x80f5('0x27')][_0x80f5('0xc9')]===_0x80f5('0xca')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x80f5('0x27'),'infobip',util[_0x80f5('0xc4')](_0xb76a1[_0x80f5('0x57')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x153048=='DELIVERED_TO_GATEWAY'||_0x153048==_0x80f5('0xcf')){return _0x2ee3c7['update']({'read':!![]});}else{logger['error'](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xcb'),util[_0x80f5('0xc4')](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x153048===_0x80f5('0xd0')||_0x153048===_0x80f5('0xd1')){return _0x2ee3c7[_0x80f5('0x2f')]({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0x8d'),util['inspect'](_0xb76a1['body'],{'showHidden':![],'depth':null}));}break;}return _0x2ee3c7;}})[_0x80f5('0x1e')](respondWithResult(_0x330422,null))[_0x80f5('0x26')](handleError(_0x330422,null));};exports[_0x80f5('0xd2')]=function(_0x3a593c,_0x5128f0,_0x24badf){var _0x5a578c,_0x126728,_0x1a32cf;return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x3a593c[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5128f0,null))[_0x80f5('0x1e')](function(_0x2083bc){if(_0x2083bc){_0x1a32cf=_0x2083bc;logger['debug'](_0x80f5('0x21'),'status',_0x80f5('0xc3'),_0x2083bc[_0x80f5('0x4c')],util[_0x80f5('0xc4')](_0x3a593c[_0x80f5('0x3e')],{'showHidden':![],'depth':null}));switch(_0x2083bc[_0x80f5('0x4c')]){case _0x80f5('0xd3'):if(_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd4')]&&_0x3a593c['query'][_0x80f5('0xd5')]){_0x126728=_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd5')];return db[_0x80f5('0xa4')][_0x80f5('0x56')]({'where':{'messageId':_0x3a593c[_0x80f5('0x3e')][_0x80f5('0xd4')]}});}break;}}})[_0x80f5('0x1e')](handleEntityNotFound(_0x5128f0,null))[_0x80f5('0x1e')](function(_0x47f27e){if(_0x47f27e){_0x5a578c=_0x47f27e;switch(_0x1a32cf['type']){case _0x80f5('0xd3'):if(_0x126728==='2'||_0x126728==='6'){return _0x5a578c['update']({'read':!![]});}else{logger[_0x80f5('0x23')](_0x80f5('0x21'),_0x80f5('0x27'),_0x80f5('0xd3'),util[_0x80f5('0xc4')](_0x3a593c['query'],{'showHidden':![],'depth':null}));};break;}return _0x5a578c;}})[_0x80f5('0x1e')](respondWithResult(_0x5128f0,null))[_0x80f5('0x26')](handleError(_0x5128f0,null));};exports[_0x80f5('0xd6')]=function(_0x572927,_0x51e4a9,_0x780e47){return db['SmsAccount'][_0x80f5('0x56')]({'where':{'id':_0x572927[_0x80f5('0x60')]['id']}})['then'](handleEntityNotFound(_0x51e4a9,null))['then'](function(_0x456d72){if(_0x456d72){return _0x456d72[_0x80f5('0xd6')](_0x572927[_0x80f5('0x57')]['ids'],_[_0x80f5('0x99')](_0x572927[_0x80f5('0x57')],[_0x80f5('0x67'),'id'])||{})['spread'](function(_0x36264c){for(var _0x2f69f7=0x0;_0x2f69f7<_0x572927['body'][_0x80f5('0x67')][_0x80f5('0x43')];_0x2f69f7+=0x1){socket[_0x80f5('0xd7')](_0x80f5('0xd8'),{'UserId':_0x572927[_0x80f5('0x57')][_0x80f5('0x67')][_0x2f69f7],'SmsAccountId':_0x572927['params']['id']});}return _0x36264c;});}})[_0x80f5('0x1e')](respondWithResult(_0x51e4a9,null))[_0x80f5('0x26')](handleError(_0x51e4a9,null));};exports[_0x80f5('0xd9')]=function(_0x4965d3,_0x31d52e,_0x551799){return db[_0x80f5('0x3a')][_0x80f5('0x56')]({'where':{'id':_0x4965d3[_0x80f5('0x60')]['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x31d52e,null))[_0x80f5('0x1e')](function(_0x35eb8b){if(_0x35eb8b){return _0x35eb8b[_0x80f5('0xd9')](_0x4965d3['query'][_0x80f5('0x67')])[_0x80f5('0x1e')](function(){if(_[_0x80f5('0xda')](_0x4965d3[_0x80f5('0x3e')][_0x80f5('0x67')])){for(var _0x3362d9=0x0;_0x3362d9<_0x4965d3['query'][_0x80f5('0x67')]['length'];_0x3362d9+=0x1){socket[_0x80f5('0xd7')](_0x80f5('0xdb'),{'UserId':Number(_0x4965d3[_0x80f5('0x3e')]['ids'][_0x3362d9]),'SmsAccountId':Number(_0x4965d3[_0x80f5('0x60')]['id'])});}}else{socket['emit'](_0x80f5('0xdb'),{'UserId':Number(_0x4965d3[_0x80f5('0x3e')][_0x80f5('0x67')]),'SmsAccountId':Number(_0x4965d3[_0x80f5('0x60')]['id'])});}});}})[_0x80f5('0x1e')](respondWithStatusCode(_0x31d52e,null))[_0x80f5('0x26')](handleError(_0x31d52e,null));};exports[_0x80f5('0xdc')]=function(_0x3a4d09,_0x3c826f,_0x15e34b){var _0x37bd55={};var _0x203d80={};var _0x456cd0;var _0x425ba3;return db[_0x80f5('0x3a')][_0x80f5('0x64')]({'where':{'id':_0x3a4d09['params']['id']}})[_0x80f5('0x1e')](handleEntityNotFound(_0x3c826f,null))[_0x80f5('0x1e')](function(_0x5176a5){if(_0x5176a5){_0x456cd0=_0x5176a5;_0x203d80[_0x80f5('0x3c')]=_[_0x80f5('0x3d')](db[_0x80f5('0xa8')][_0x80f5('0x3b')]);_0x203d80[_0x80f5('0x3e')]=_['keys'](_0x3a4d09['query']);_0x203d80[_0x80f5('0x3f')]=_[_0x80f5('0x40')](_0x203d80[_0x80f5('0x3c')],_0x203d80[_0x80f5('0x3e')]);_0x37bd55[_0x80f5('0x42')]=_[_0x80f5('0x40')](_0x203d80[_0x80f5('0x3c')],qs[_0x80f5('0x41')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x41')]));_0x37bd55[_0x80f5('0x42')]=_0x37bd55[_0x80f5('0x42')][_0x80f5('0x43')]?_0x37bd55[_0x80f5('0x42')]:_0x203d80[_0x80f5('0x3c')];_0x37bd55[_0x80f5('0x46')]=qs[_0x80f5('0x47')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x47')]);_0x37bd55[_0x80f5('0x48')]=qs[_0x80f5('0x3f')](_[_0x80f5('0x49')](_0x3a4d09[_0x80f5('0x3e')],_0x203d80[_0x80f5('0x3f')]));if(_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x4a')]){_0x37bd55[_0x80f5('0x48')]=_[_0x80f5('0x4b')](_0x37bd55['where'],{'$or':_['map'](_0x37bd55['attributes'],function(_0x455fae){var _0x4f3375={};_0x4f3375[_0x455fae]={'$like':'%'+_0x3a4d09['query']['filter']+'%'};return _0x4f3375;})});}_0x37bd55=_[_0x80f5('0x4b')]({},_0x37bd55,_0x3a4d09[_0x80f5('0x4f')]);return _0x456cd0[_0x80f5('0xdc')](_0x37bd55);}})['then'](function(_0x4ad20a){if(_0x4ad20a){_0x425ba3=_0x4ad20a[_0x80f5('0x43')];if(!_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x44')](_0x80f5('0x45'))){_0x37bd55[_0x80f5('0x2b')]=qs[_0x80f5('0x2b')](_0x3a4d09[_0x80f5('0x3e')][_0x80f5('0x2b')]);_0x37bd55[_0x80f5('0x2a')]=qs[_0x80f5('0x2a')](_0x3a4d09[_0x80f5('0x3e')]['offset']);}return _0x456cd0['getAgents'](_0x37bd55);}})[_0x80f5('0x1e')](function(_0x17bb9c){if(_0x17bb9c){return _0x17bb9c?{'count':_0x425ba3,'rows':_0x17bb9c}:null;}})['then'](respondWithResult(_0x3c826f,null))[_0x80f5('0x26')](handleError(_0x3c826f,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 368631c..325ccba 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 _0xc2d4=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4267cd,_0x5a3600){var _0x27ecf1=function(_0x32c9b7){while(--_0x32c9b7){_0x4267cd['push'](_0x4267cd['shift']());}};_0x27ecf1(++_0x5a3600);}(_0xc2d4,0x6e));var _0x4c2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc2d4[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4c2d('0x0'));var SmsAccount=require(_0x4c2d('0x1'))['db'][_0x4c2d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4c2d('0x3')](0x0);var events={'afterCreate':_0x4c2d('0x4'),'afterUpdate':_0x4c2d('0x5'),'afterDestroy':_0x4c2d('0x6')};function emitEvent(_0x331dd0){return function(_0x1338fe,_0x4c531e,_0x2e14d1){SmsAccountEvents[_0x4c2d('0x7')](_0x331dd0+':'+_0x1338fe['id'],_0x1338fe);SmsAccountEvents[_0x4c2d('0x7')](_0x331dd0,_0x1338fe);_0x2e14d1(null);};}for(var e in events){if(events[_0x4c2d('0x8')](e)){var event=events[e];SmsAccount[_0x4c2d('0x9')](e,emitEvent(event));}}module[_0x4c2d('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x80f6=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xa7c3dc,_0x554be5){var _0x1e9be9=function(_0x4cd2c2){while(--_0x4cd2c2){_0xa7c3dc['push'](_0xa7c3dc['shift']());}};_0x1e9be9(++_0x554be5);}(_0x80f6,0xe9));var _0x680f=function(_0x52b1d2,_0x412824){_0x52b1d2=_0x52b1d2-0x0;var _0x4b2af3=_0x80f6[_0x52b1d2];return _0x4b2af3;};'use strict';var EventEmitter=require(_0x680f('0x0'));var SmsAccount=require(_0x680f('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x680f('0x2')](0x0);var events={'afterCreate':_0x680f('0x3'),'afterUpdate':'update','afterDestroy':_0x680f('0x4')};function emitEvent(_0x18c45d){return function(_0x5d0ca3,_0x1bf131,_0x3f00db){SmsAccountEvents[_0x680f('0x5')](_0x18c45d+':'+_0x5d0ca3['id'],_0x5d0ca3);SmsAccountEvents[_0x680f('0x5')](_0x18c45d,_0x5d0ca3);_0x3f00db(null);};}for(var e in events){if(events[_0x680f('0x6')](e)){var event=events[e];SmsAccount[_0x680f('0x7')](e,emitEvent(event));}}module[_0x680f('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 ec06be5..d3a84f3 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 _0xf5b0=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x562843,_0x23a145){var _0x430d4b=function(_0x1db536){while(--_0x1db536){_0x562843['push'](_0x562843['shift']());}};_0x430d4b(++_0x23a145);}(_0xf5b0,0x18b));var _0x0f5b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf5b0[_0x543084];return _0x306a57;};'use strict';var _=require(_0x0f5b('0x0'));var util=require(_0x0f5b('0x1'));var logger=require(_0x0f5b('0x2'))(_0x0f5b('0x3'));var moment=require(_0x0f5b('0x4'));var BPromise=require(_0x0f5b('0x5'));var rp=require(_0x0f5b('0x6'));var fs=require('fs');var path=require(_0x0f5b('0x7'));var rimraf=require(_0x0f5b('0x8'));var config=require('../../config/environment');var attributes=require(_0x0f5b('0x9'));module[_0x0f5b('0xa')]=function(_0x6acbe7,_0x5b24f4){return _0x6acbe7[_0x0f5b('0xb')](_0x0f5b('0xc'),attributes,{'tableName':_0x0f5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d6e=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsAccount.attributes','exports','define','lodash'];(function(_0x127580,_0x3903ff){var _0x2c7f9c=function(_0x2ade10){while(--_0x2ade10){_0x127580['push'](_0x127580['shift']());}};_0x2c7f9c(++_0x3903ff);}(_0x2d6e,0x13f));var _0xe2d6=function(_0x6876e1,_0x17ea11){_0x6876e1=_0x6876e1-0x0;var _0x4877f5=_0x2d6e[_0x6876e1];return _0x4877f5;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require(_0xe2d6('0x2'))('api');var moment=require(_0xe2d6('0x3'));var BPromise=require(_0xe2d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe2d6('0x5'));var config=require(_0xe2d6('0x6'));var attributes=require(_0xe2d6('0x7'));module[_0xe2d6('0x8')]=function(_0x28c934,_0x869733){return _0x28c934[_0xe2d6('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index d4bfbae..6791873 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 _0x6529=['model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','debug','stringify','code','error','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map'];(function(_0x5781fc,_0x5ee24b){var _0x1e6e49=function(_0x4d077b){while(--_0x4d077b){_0x5781fc['push'](_0x5781fc['shift']());}};_0x1e6e49(++_0x5ee24b);}(_0x6529,0xbb));var _0x9652=function(_0x48e9b8,_0x4df457){_0x48e9b8=_0x48e9b8-0x0;var _0x449b7f=_0x6529[_0x48e9b8];return _0x449b7f;};'use strict';var _=require(_0x9652('0x0'));var util=require(_0x9652('0x1'));var moment=require(_0x9652('0x2'));var BPromise=require(_0x9652('0x3'));var rs=require(_0x9652('0x4'));var fs=require('fs');var Redis=require(_0x9652('0x5'));var db=require(_0x9652('0x6'))['db'];var utils=require(_0x9652('0x7'));var logger=require('../../config/logger')(_0x9652('0x8'));var config=require(_0x9652('0x9'));var jayson=require(_0x9652('0xa'));var client=jayson[_0x9652('0xb')][_0x9652('0xc')]({'port':0x232a});config[_0x9652('0xd')]=_[_0x9652('0xe')](config[_0x9652('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9652('0xf'))['register'](socket);function respondWithRpcPromise(_0x19d926,_0x2b2f6c,_0x328c9a){return new BPromise(function(_0x5d96c2,_0x2ac389){return client[_0x9652('0x10')](_0x19d926,_0x328c9a)[_0x9652('0x11')](function(_0x452a3e){logger['info'](_0x9652('0x12'),_0x2b2f6c,'request\x20sent');logger[_0x9652('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2b2f6c,'request\x20sent',JSON[_0x9652('0x14')](_0x452a3e));if(_0x452a3e['error']){if(_0x452a3e['error'][_0x9652('0x15')]===0x1f4){logger[_0x9652('0x16')](_0x9652('0x12'),_0x2b2f6c,_0x452a3e[_0x9652('0x16')][_0x9652('0x17')]);return _0x2ac389(_0x452a3e[_0x9652('0x16')]['message']);}logger[_0x9652('0x16')](_0x9652('0x12'),_0x2b2f6c,_0x452a3e[_0x9652('0x16')]['message']);return _0x5d96c2(_0x452a3e[_0x9652('0x16')]['message']);}else{logger[_0x9652('0x18')](_0x9652('0x12'),_0x2b2f6c,_0x9652('0x19'));_0x5d96c2(_0x452a3e[_0x9652('0x1a')][_0x9652('0x17')]);}})['catch'](function(_0x5338d4){logger['error'](_0x9652('0x12'),_0x2b2f6c,_0x5338d4);_0x2ac389(_0x5338d4);});});}exports[_0x9652('0x1b')]=function(_0xd1d677){var _0x56f0ed=this;return new Promise(function(_0x518b6e,_0x210642){return db[_0x9652('0x1c')][_0x9652('0x1d')]({'raw':_0xd1d677[_0x9652('0x1e')]?_0xd1d677[_0x9652('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xd1d677[_0x9652('0x1e')]?_0xd1d677[_0x9652('0x1e')][_0x9652('0x1f')]||null:null,'attributes':_0xd1d677['options']?_0xd1d677[_0x9652('0x1e')][_0x9652('0x20')]||null:null,'include':_0xd1d677[_0x9652('0x1e')]?_0xd1d677['options'][_0x9652('0x21')]?_[_0x9652('0x22')](_0xd1d677['options']['include'],function(_0xd3d636){return{'model':db[_0xd3d636[_0x9652('0x23')]],'as':_0xd3d636['as'],'attributes':_0xd3d636['attributes'],'include':_0xd3d636[_0x9652('0x21')]?_[_0x9652('0x22')](_0xd3d636['include'],function(_0x300730){return{'model':db[_0x300730[_0x9652('0x23')]],'as':_0x300730['as'],'attributes':_0x300730['attributes'],'include':_0x300730[_0x9652('0x21')]?_['map'](_0x300730[_0x9652('0x21')],function(_0x1024f2){return{'model':db[_0x1024f2[_0x9652('0x23')]],'as':_0x1024f2['as'],'attributes':_0x1024f2[_0x9652('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44446d){logger[_0x9652('0x18')]('ShowSmsAccount',_0xd1d677);logger[_0x9652('0x13')](_0x9652('0x1b'),_0xd1d677,JSON['stringify'](_0x44446d));_0x518b6e(_0x44446d);})[_0x9652('0x24')](function(_0x23b48c){logger[_0x9652('0x16')](_0x9652('0x1b'),_0x23b48c[_0x9652('0x17')],_0xd1d677);_0x210642(_0x56f0ed['error'](0x1f4,_0x23b48c['message']));});});}; \ No newline at end of file +var _0xca65=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsAccount.socket','register','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug','lodash','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca65,0x6a));var _0x5ca6=function(_0x690915,_0xa6d93){_0x690915=_0x690915-0x0;var _0x1f6047=_0xca65[_0x690915];return _0x1f6047;};'use strict';var _=require(_0x5ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ca6('0x1'));var fs=require('fs');var Redis=require(_0x5ca6('0x2'));var db=require(_0x5ca6('0x3'))['db'];var utils=require(_0x5ca6('0x4'));var logger=require('../../config/logger')(_0x5ca6('0x5'));var config=require(_0x5ca6('0x6'));var jayson=require(_0x5ca6('0x7'));var client=jayson[_0x5ca6('0x8')][_0x5ca6('0x9')]({'port':0x232a});config[_0x5ca6('0xa')]=_['defaults'](config[_0x5ca6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ca6('0xb'))(new Redis(config[_0x5ca6('0xa')]));require(_0x5ca6('0xc'))[_0x5ca6('0xd')](socket);function respondWithRpcPromise(_0x36332d,_0x211fbc,_0x4d6190){return new BPromise(function(_0x3cbc45,_0x2e6424){return client['request'](_0x36332d,_0x4d6190)[_0x5ca6('0xe')](function(_0x397591){logger[_0x5ca6('0xf')]('SmsAccount,\x20%s,\x20%s',_0x211fbc,_0x5ca6('0x10'));logger['debug'](_0x5ca6('0x11'),_0x211fbc,_0x5ca6('0x10'),JSON[_0x5ca6('0x12')](_0x397591));if(_0x397591[_0x5ca6('0x13')]){if(_0x397591['error'][_0x5ca6('0x14')]===0x1f4){logger['error'](_0x5ca6('0x15'),_0x211fbc,_0x397591[_0x5ca6('0x13')]['message']);return _0x2e6424(_0x397591[_0x5ca6('0x13')][_0x5ca6('0x16')]);}logger['error'](_0x5ca6('0x15'),_0x211fbc,_0x397591[_0x5ca6('0x13')]['message']);return _0x3cbc45(_0x397591[_0x5ca6('0x13')][_0x5ca6('0x16')]);}else{logger[_0x5ca6('0xf')](_0x5ca6('0x15'),_0x211fbc,'request\x20sent');_0x3cbc45(_0x397591[_0x5ca6('0x17')]['message']);}})[_0x5ca6('0x18')](function(_0x325899){logger[_0x5ca6('0x13')](_0x5ca6('0x15'),_0x211fbc,_0x325899);_0x2e6424(_0x325899);});});}exports['ShowSmsAccount']=function(_0x45184c){var _0xd151d7=this;return new Promise(function(_0x58942,_0x2337b3){return db[_0x5ca6('0x19')][_0x5ca6('0x1a')]({'raw':_0x45184c[_0x5ca6('0x1b')]?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1c')]===undefined?!![]:![]:!![],'where':_0x45184c['options']?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1d')]||null:null,'attributes':_0x45184c[_0x5ca6('0x1b')]?_0x45184c[_0x5ca6('0x1b')][_0x5ca6('0x1e')]||null:null,'include':_0x45184c[_0x5ca6('0x1b')]?_0x45184c['options'][_0x5ca6('0x1f')]?_[_0x5ca6('0x20')](_0x45184c[_0x5ca6('0x1b')]['include'],function(_0x5b15a1){return{'model':db[_0x5b15a1[_0x5ca6('0x21')]],'as':_0x5b15a1['as'],'attributes':_0x5b15a1[_0x5ca6('0x1e')],'include':_0x5b15a1[_0x5ca6('0x1f')]?_['map'](_0x5b15a1[_0x5ca6('0x1f')],function(_0x144b79){return{'model':db[_0x144b79[_0x5ca6('0x21')]],'as':_0x144b79['as'],'attributes':_0x144b79[_0x5ca6('0x1e')],'include':_0x144b79[_0x5ca6('0x1f')]?_[_0x5ca6('0x20')](_0x144b79[_0x5ca6('0x1f')],function(_0xa1924d){return{'model':db[_0xa1924d[_0x5ca6('0x21')]],'as':_0xa1924d['as'],'attributes':_0xa1924d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ca6('0xe')](function(_0x5c0b1d){logger[_0x5ca6('0xf')](_0x5ca6('0x22'),_0x45184c);logger[_0x5ca6('0x23')](_0x5ca6('0x22'),_0x45184c,JSON[_0x5ca6('0x12')](_0x5c0b1d));_0x58942(_0x5c0b1d);})['catch'](function(_0x44be89){logger[_0x5ca6('0x13')](_0x5ca6('0x22'),_0x44be89[_0x5ca6('0x16')],_0x45184c);_0x2337b3(_0xd151d7[_0x5ca6('0x13')](0x1f4,_0x44be89['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ca98741..a349836 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 _0xd10b=['smsAccount:','./smsAccount.events','save','update','removeListener','length'];(function(_0x1217bd,_0x38c7da){var _0x2fc8e8=function(_0x3f4cbd){while(--_0x3f4cbd){_0x1217bd['push'](_0x1217bd['shift']());}};_0x2fc8e8(++_0x38c7da);}(_0xd10b,0x1d5));var _0xbd10=function(_0x1fc7b4,_0x44a971){_0x1fc7b4=_0x1fc7b4-0x0;var _0x3e2934=_0xd10b[_0x1fc7b4];return _0x3e2934;};'use strict';var SmsAccountEvents=require(_0xbd10('0x0'));var events=[_0xbd10('0x1'),'remove',_0xbd10('0x2')];function createListener(_0x19738a,_0x1d7412){return function(_0x473f0d){_0x1d7412['emit'](_0x19738a,_0x473f0d);};}function removeListener(_0x409108,_0x343a0d){return function(){SmsAccountEvents[_0xbd10('0x3')](_0x409108,_0x343a0d);};}exports['register']=function(_0x57bffd){for(var _0x17f97f=0x0,_0x27fce6=events[_0xbd10('0x4')];_0x17f97f<_0x27fce6;_0x17f97f++){var _0x19cd6f=events[_0x17f97f];var _0xace0fb=createListener(_0xbd10('0x5')+_0x19cd6f,_0x57bffd);SmsAccountEvents['on'](_0x19cd6f,_0xace0fb);}}; \ No newline at end of file +var _0x38b6=['emit','register','./smsAccount.events','save','remove','update'];(function(_0x2da111,_0x3e3fc7){var _0xafc70=function(_0x1e52e0){while(--_0x1e52e0){_0x2da111['push'](_0x2da111['shift']());}};_0xafc70(++_0x3e3fc7);}(_0x38b6,0x116));var _0x638b=function(_0x457e90,_0x7098cb){_0x457e90=_0x457e90-0x0;var _0x960f26=_0x38b6[_0x457e90];return _0x960f26;};'use strict';var SmsAccountEvents=require(_0x638b('0x0'));var events=[_0x638b('0x1'),_0x638b('0x2'),_0x638b('0x3')];function createListener(_0x3c8fee,_0x4b35eb){return function(_0x511534){_0x4b35eb[_0x638b('0x4')](_0x3c8fee,_0x511534);};}function removeListener(_0x3847d9,_0x28a707){return function(){SmsAccountEvents['removeListener'](_0x3847d9,_0x28a707);};}exports[_0x638b('0x5')]=function(_0x4fa0a1){for(var _0x28def8=0x0,_0x56604f=events['length'];_0x28def8<_0x56604f;_0x28def8++){var _0x29ce95=events[_0x28def8];var _0x45b72b=createListener('smsAccount:'+_0x29ce95,_0x4fa0a1);SmsAccountEvents['on'](_0x29ce95,_0x45b72b);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 538a5d5..02f4b1f 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 _0xa2b7=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','destroy'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0xa2b7,0x1e7));var _0x7a2b=function(_0x5c9d11,_0x56cc05){_0x5c9d11=_0x5c9d11-0x0;var _0x4783e7=_0xa2b7[_0x5c9d11];return _0x4783e7;};'use strict';var multer=require('multer');var util=require(_0x7a2b('0x0'));var path=require(_0x7a2b('0x1'));var timeout=require(_0x7a2b('0x2'));var express=require('express');var router=express[_0x7a2b('0x3')]();var auth=require(_0x7a2b('0x4'));var interaction=require(_0x7a2b('0x5'));var config=require(_0x7a2b('0x6'));var controller=require(_0x7a2b('0x7'));router[_0x7a2b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a2b('0x9')]);router[_0x7a2b('0x8')]('/:id',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xb')]);router[_0x7a2b('0xc')]('/',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xd')]);router['put'](_0x7a2b('0xe'),auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xf')]);router['delete']('/:id',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0x10')]);module[_0x7a2b('0x11')]=router; \ No newline at end of file +var _0x88b2=['isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./smsApplication.controller'];(function(_0x5b73ff,_0x1cba4d){var _0x1c4ba4=function(_0x319db1){while(--_0x319db1){_0x5b73ff['push'](_0x5b73ff['shift']());}};_0x1c4ba4(++_0x1cba4d);}(_0x88b2,0x1df));var _0x288b=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x88b2[_0x2e2681];return _0x368a64;};'use strict';var multer=require(_0x288b('0x0'));var util=require(_0x288b('0x1'));var path=require(_0x288b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x288b('0x3')]();var auth=require(_0x288b('0x4'));var interaction=require(_0x288b('0x5'));var config=require('../../config/environment');var controller=require(_0x288b('0x6'));router['get']('/',auth[_0x288b('0x7')](),controller[_0x288b('0x8')]);router[_0x288b('0x9')]('/:id',auth[_0x288b('0x7')](),controller[_0x288b('0xa')]);router[_0x288b('0xb')]('/',auth[_0x288b('0x7')](),controller['create']);router[_0x288b('0xc')](_0x288b('0xd'),auth[_0x288b('0x7')](),controller[_0x288b('0xe')]);router[_0x288b('0xf')](_0x288b('0xd'),auth['isAuthenticated'](),controller[_0x288b('0x10')]);module[_0x288b('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 4cc32f3..4e495e2 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 _0xf3e2=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x254233,_0x45e922){var _0x24d660=function(_0x46198b){while(--_0x46198b){_0x254233['push'](_0x254233['shift']());}};_0x24d660(++_0x45e922);}(_0xf3e2,0x168));var _0x2f3e=function(_0x12c263,_0x2d9bce){_0x12c263=_0x12c263-0x0;var _0x192cd7=_0xf3e2[_0x12c263];return _0x192cd7;};'use strict';var Sequelize=require(_0x2f3e('0x0'));module[_0x2f3e('0x1')]={'priority':{'type':Sequelize[_0x2f3e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2f3e('0x3')],'allowNull':![],'defaultValue':_0x2f3e('0x4')},'appdata':{'type':Sequelize[_0x2f3e('0x5')]()},'description':{'type':Sequelize[_0x2f3e('0x3')]},'interval':{'type':Sequelize[_0x2f3e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xfbc5=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x45192c,_0x53519d){var _0x5c3816=function(_0x113cdc){while(--_0x113cdc){_0x45192c['push'](_0x45192c['shift']());}};_0x5c3816(++_0x53519d);}(_0xfbc5,0x1ab));var _0x5fbc=function(_0x5ec407,_0x392526){_0x5ec407=_0x5ec407-0x0;var _0x5d1dd5=_0xfbc5[_0x5ec407];return _0x5d1dd5;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x5fbc('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x5fbc('0x1')],'allowNull':![],'defaultValue':_0x5fbc('0x2')},'appdata':{'type':Sequelize[_0x5fbc('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5fbc('0x1')],'defaultValue':_0x5fbc('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 16c452d..f1eff67 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 _0xd540=['sendStatus','status','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','SmsApplication','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x1ef3a8,_0x18083c){var _0x84ccc6=function(_0x2650bf){while(--_0x2650bf){_0x1ef3a8['push'](_0x1ef3a8['shift']());}};_0x84ccc6(++_0x18083c);}(_0xd540,0x7d));var _0x0d54=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0xd540[_0x23733d];return _0x4a9cc4;};'use strict';var pdf=require(_0x0d54('0x0'));var emlformat=require(_0x0d54('0x1'));var rimraf=require(_0x0d54('0x2'));var zipdir=require(_0x0d54('0x3'));var jsonpatch=require(_0x0d54('0x4'));var rp=require(_0x0d54('0x5'));var moment=require(_0x0d54('0x6'));var BPromise=require(_0x0d54('0x7'));var Mustache=require(_0x0d54('0x8'));var util=require(_0x0d54('0x9'));var path=require(_0x0d54('0xa'));var sox=require(_0x0d54('0xb'));var csv=require(_0x0d54('0xc'));var ejs=require(_0x0d54('0xd'));var fs=require('fs');var _=require(_0x0d54('0xe'));var squel=require('squel');var crypto=require(_0x0d54('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0d54('0x10'));var toCsv=require(_0x0d54('0xc'));var querystring=require('querystring');var Papa=require(_0x0d54('0x11'));var Redis=require(_0x0d54('0x12'));var authService=require(_0x0d54('0x13'));var qs=require(_0x0d54('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d54('0x15'))(_0x0d54('0x16'));var utils=require(_0x0d54('0x17'));var config=require('../../config/environment');var db=require(_0x0d54('0x18'))['db'];function respondWithStatusCode(_0x28d02e,_0x1d79e6){_0x1d79e6=_0x1d79e6||0xcc;return function(_0x35c26f){if(_0x35c26f){return _0x28d02e[_0x0d54('0x19')](_0x1d79e6);}return _0x28d02e[_0x0d54('0x1a')](_0x1d79e6)['end']();};}function respondWithResult(_0x5d81dd,_0x4933a6){_0x4933a6=_0x4933a6||0xc8;return function(_0x27f802){if(_0x27f802){return _0x5d81dd[_0x0d54('0x1a')](_0x4933a6)['json'](_0x27f802);}};}function respondWithFilteredResult(_0x49110c,_0x9f54bb){return function(_0xfab612){if(_0xfab612){var _0x6eb19d=_0xfab612[_0x0d54('0x1b')],_0x288e20=_0x9f54bb[_0x0d54('0x1c')],_0x1f85e1=_0x9f54bb[_0x0d54('0x1c')]+_0x9f54bb['limit'],_0x58c3e0;if(_0x1f85e1>=_0x6eb19d){_0x1f85e1=_0x6eb19d;_0x58c3e0=0xc8;}else{_0x58c3e0=0xce;}_0x49110c[_0x0d54('0x1a')](_0x58c3e0);return _0x49110c[_0x0d54('0x1d')](_0x0d54('0x1e'),_0x288e20+'-'+_0x1f85e1+'/'+_0x6eb19d)['json'](_0xfab612);}return null;};}function patchUpdates(_0x340f79){return function(_0x389f71){try{jsonpatch['apply'](_0x389f71,_0x340f79,!![]);}catch(_0x558d3c){return BPromise[_0x0d54('0x1f')](_0x558d3c);}return _0x389f71[_0x0d54('0x20')]();};}function saveUpdates(_0x12ba6c,_0x38d485){return function(_0x102e25){if(_0x102e25){return _0x102e25[_0x0d54('0x21')](_0x12ba6c)[_0x0d54('0x22')](function(_0xba524c){return _0xba524c;});}return null;};}function removeEntity(_0x20162e,_0x5ddab8){return function(_0x3c6709){if(_0x3c6709){return _0x3c6709[_0x0d54('0x23')]()[_0x0d54('0x22')](function(){_0x20162e[_0x0d54('0x1a')](0xcc)[_0x0d54('0x24')]();});}};}function handleEntityNotFound(_0x432664,_0x1c86a9){return function(_0x886ae0){if(!_0x886ae0){_0x432664[_0x0d54('0x19')](0x194);}return _0x886ae0;};}function handleError(_0x5b9f32,_0x580026){_0x580026=_0x580026||0x1f4;return function(_0x5a6c5f){logger[_0x0d54('0x25')](_0x5a6c5f['stack']);if(_0x5a6c5f[_0x0d54('0x26')]){delete _0x5a6c5f[_0x0d54('0x26')];}_0x5b9f32[_0x0d54('0x1a')](_0x580026)[_0x0d54('0x27')](_0x5a6c5f);};}exports[_0x0d54('0x28')]=function(_0x21d39b,_0x6af794){var _0x34f888={},_0x295713={},_0x2a2566={'count':0x0,'rows':[]};var _0x8d9760=db[_0x0d54('0x29')]['rawAttributes'];_0x295713[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](_0x8d9760);_0x295713[_0x0d54('0x2c')]=_[_0x0d54('0x2b')](_0x21d39b[_0x0d54('0x2c')]);_0x295713[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x295713[_0x0d54('0x2a')],_0x295713['query']);_0x34f888['attributes']=_['intersection'](_0x295713['model'],qs[_0x0d54('0x2f')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x2f')]));_0x34f888[_0x0d54('0x30')]=_0x34f888[_0x0d54('0x30')][_0x0d54('0x31')]?_0x34f888[_0x0d54('0x30')]:_0x295713['model'];if(!_0x21d39b['query'][_0x0d54('0x32')](_0x0d54('0x33'))){_0x34f888['limit']=qs[_0x0d54('0x34')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x34')]);_0x34f888[_0x0d54('0x1c')]=qs[_0x0d54('0x1c')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x1c')]);}_0x34f888['order']=qs[_0x0d54('0x35')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x35')]);_0x34f888[_0x0d54('0x36')]=qs[_0x0d54('0x2d')](_[_0x0d54('0x37')](_0x21d39b[_0x0d54('0x2c')],_0x295713[_0x0d54('0x2d')]));if(_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x38')]){_0x34f888['where']=_['merge'](_0x34f888[_0x0d54('0x36')],{'$or':_[_0x0d54('0x39')](_0x8d9760,function(_0x41fe04){if(_0x41fe04[_0x0d54('0x3a')][_0x0d54('0x3b')]!==_0x0d54('0x3c')){var _0x37ab06={};_0x37ab06[_0x41fe04[_0x0d54('0x3d')]]={'$like':'%'+_0x21d39b[_0x0d54('0x2c')]['filter']+'%'};return _0x37ab06;}})});}_0x34f888=_[_0x0d54('0x3e')]({},_0x34f888,_0x21d39b[_0x0d54('0x3f')]);var _0x12ae2b={'where':_0x34f888[_0x0d54('0x36')]};return db[_0x0d54('0x29')][_0x0d54('0x1b')](_0x12ae2b)[_0x0d54('0x22')](function(_0x563ebc){_0x2a2566[_0x0d54('0x1b')]=_0x563ebc;if(_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x40')]){_0x34f888[_0x0d54('0x41')]=[{'all':!![]}];}return db[_0x0d54('0x29')][_0x0d54('0x42')](_0x34f888);})[_0x0d54('0x22')](function(_0x1fd297){_0x2a2566[_0x0d54('0x43')]=_0x1fd297;return _0x2a2566;})[_0x0d54('0x22')](respondWithFilteredResult(_0x6af794,_0x34f888))[_0x0d54('0x44')](handleError(_0x6af794,null));};exports[_0x0d54('0x45')]=function(_0xce3ab0,_0x4b599a){var _0x4db01e={'raw':!![],'where':{'id':_0xce3ab0[_0x0d54('0x46')]['id']}},_0x1c60c7={};_0x1c60c7[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](db['SmsApplication'][_0x0d54('0x47')]);_0x1c60c7[_0x0d54('0x2c')]=_[_0x0d54('0x2b')](_0xce3ab0[_0x0d54('0x2c')]);_0x1c60c7[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x1c60c7[_0x0d54('0x2a')],_0x1c60c7[_0x0d54('0x2c')]);_0x4db01e[_0x0d54('0x30')]=_[_0x0d54('0x2e')](_0x1c60c7[_0x0d54('0x2a')],qs[_0x0d54('0x2f')](_0xce3ab0[_0x0d54('0x2c')][_0x0d54('0x2f')]));_0x4db01e[_0x0d54('0x30')]=_0x4db01e[_0x0d54('0x30')][_0x0d54('0x31')]?_0x4db01e['attributes']:_0x1c60c7[_0x0d54('0x2a')];if(_0xce3ab0['query'][_0x0d54('0x40')]){_0x4db01e['include']=[{'all':!![]}];}_0x4db01e=_['merge']({},_0x4db01e,_0xce3ab0[_0x0d54('0x3f')]);return db[_0x0d54('0x29')]['find'](_0x4db01e)[_0x0d54('0x22')](handleEntityNotFound(_0x4b599a,null))['then'](respondWithResult(_0x4b599a,null))[_0x0d54('0x44')](handleError(_0x4b599a,null));};exports['create']=function(_0x524714,_0x2b7b73){return db[_0x0d54('0x29')][_0x0d54('0x48')](_0x524714[_0x0d54('0x49')],{})[_0x0d54('0x22')](respondWithResult(_0x2b7b73,0xc9))[_0x0d54('0x44')](handleError(_0x2b7b73,null));};exports[_0x0d54('0x21')]=function(_0x42e00a,_0x4e885e){if(_0x42e00a[_0x0d54('0x49')]['id']){delete _0x42e00a[_0x0d54('0x49')]['id'];}return db[_0x0d54('0x29')][_0x0d54('0x4a')]({'where':{'id':_0x42e00a[_0x0d54('0x46')]['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x4e885e,null))['then'](saveUpdates(_0x42e00a[_0x0d54('0x49')],null))[_0x0d54('0x22')](respondWithResult(_0x4e885e,null))[_0x0d54('0x44')](handleError(_0x4e885e,null));};exports[_0x0d54('0x23')]=function(_0x3ffa52,_0x181c5f){return db[_0x0d54('0x29')][_0x0d54('0x4a')]({'where':{'id':_0x3ffa52['params']['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x181c5f,null))[_0x0d54('0x22')](removeEntity(_0x181c5f,null))[_0x0d54('0x44')](handleError(_0x181c5f,null));}; \ No newline at end of file +var _0xd3f3=['limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','SmsApplication','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','field','options','includeAll','include','findAll','params','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x95b2a1,_0x2b4e22){var _0x1c1f23=function(_0x4f6322){while(--_0x4f6322){_0x95b2a1['push'](_0x95b2a1['shift']());}};_0x1c1f23(++_0x2b4e22);}(_0xd3f3,0x72));var _0x3d3f=function(_0x2bad97,_0x14832c){_0x2bad97=_0x2bad97-0x0;var _0xa7ec73=_0xd3f3[_0x2bad97];return _0xa7ec73;};'use strict';var pdf=require(_0x3d3f('0x0'));var emlformat=require(_0x3d3f('0x1'));var rimraf=require(_0x3d3f('0x2'));var zipdir=require(_0x3d3f('0x3'));var jsonpatch=require(_0x3d3f('0x4'));var rp=require(_0x3d3f('0x5'));var moment=require('moment');var BPromise=require(_0x3d3f('0x6'));var Mustache=require(_0x3d3f('0x7'));var util=require(_0x3d3f('0x8'));var path=require('path');var sox=require(_0x3d3f('0x9'));var csv=require('to-csv');var ejs=require(_0x3d3f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d3f('0xb'));var crypto=require('crypto');var jsforce=require(_0x3d3f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d3f('0xd'));var querystring=require(_0x3d3f('0xe'));var Papa=require(_0x3d3f('0xf'));var Redis=require(_0x3d3f('0x10'));var authService=require(_0x3d3f('0x11'));var qs=require(_0x3d3f('0x12'));var hardwareService=require(_0x3d3f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3d3f('0x14'));var config=require(_0x3d3f('0x15'));var db=require(_0x3d3f('0x16'))['db'];function respondWithStatusCode(_0x30f6ce,_0x412144){_0x412144=_0x412144||0xcc;return function(_0x13bb47){if(_0x13bb47){return _0x30f6ce[_0x3d3f('0x17')](_0x412144);}return _0x30f6ce[_0x3d3f('0x18')](_0x412144)['end']();};}function respondWithResult(_0x551bda,_0x13a203){_0x13a203=_0x13a203||0xc8;return function(_0x2a19e9){if(_0x2a19e9){return _0x551bda[_0x3d3f('0x18')](_0x13a203)[_0x3d3f('0x19')](_0x2a19e9);}};}function respondWithFilteredResult(_0x408218,_0xb518f){return function(_0x27894e){if(_0x27894e){var _0x5a121f=_0x27894e[_0x3d3f('0x1a')],_0x1f6732=_0xb518f[_0x3d3f('0x1b')],_0x57b1ad=_0xb518f[_0x3d3f('0x1b')]+_0xb518f[_0x3d3f('0x1c')],_0x45b75b;if(_0x57b1ad>=_0x5a121f){_0x57b1ad=_0x5a121f;_0x45b75b=0xc8;}else{_0x45b75b=0xce;}_0x408218[_0x3d3f('0x18')](_0x45b75b);return _0x408218[_0x3d3f('0x1d')](_0x3d3f('0x1e'),_0x1f6732+'-'+_0x57b1ad+'/'+_0x5a121f)[_0x3d3f('0x19')](_0x27894e);}return null;};}function patchUpdates(_0x51c01f){return function(_0x5054c1){try{jsonpatch[_0x3d3f('0x1f')](_0x5054c1,_0x51c01f,!![]);}catch(_0x39894c){return BPromise[_0x3d3f('0x20')](_0x39894c);}return _0x5054c1[_0x3d3f('0x21')]();};}function saveUpdates(_0x4288c2,_0x132dfa){return function(_0x37eefd){if(_0x37eefd){return _0x37eefd[_0x3d3f('0x22')](_0x4288c2)[_0x3d3f('0x23')](function(_0x365795){return _0x365795;});}return null;};}function removeEntity(_0x11c817,_0x2cc404){return function(_0x46d818){if(_0x46d818){return _0x46d818[_0x3d3f('0x24')]()[_0x3d3f('0x23')](function(){_0x11c817[_0x3d3f('0x18')](0xcc)[_0x3d3f('0x25')]();});}};}function handleEntityNotFound(_0x4ba69,_0x7df3ef){return function(_0x5cbb49){if(!_0x5cbb49){_0x4ba69[_0x3d3f('0x17')](0x194);}return _0x5cbb49;};}function handleError(_0x235ec7,_0x35bb29){_0x35bb29=_0x35bb29||0x1f4;return function(_0x564919){logger['error'](_0x564919['stack']);if(_0x564919[_0x3d3f('0x26')]){delete _0x564919[_0x3d3f('0x26')];}_0x235ec7[_0x3d3f('0x18')](_0x35bb29)[_0x3d3f('0x27')](_0x564919);};}exports[_0x3d3f('0x28')]=function(_0x385490,_0x505814){var _0x2eb91c={},_0x1b8702={},_0x2d8233={'count':0x0,'rows':[]};var _0x5161f3=db[_0x3d3f('0x29')][_0x3d3f('0x2a')];_0x1b8702[_0x3d3f('0x2b')]=_['keys'](_0x5161f3);_0x1b8702[_0x3d3f('0x2c')]=_[_0x3d3f('0x2d')](_0x385490[_0x3d3f('0x2c')]);_0x1b8702[_0x3d3f('0x2e')]=_[_0x3d3f('0x2f')](_0x1b8702[_0x3d3f('0x2b')],_0x1b8702[_0x3d3f('0x2c')]);_0x2eb91c[_0x3d3f('0x30')]=_[_0x3d3f('0x2f')](_0x1b8702[_0x3d3f('0x2b')],qs[_0x3d3f('0x31')](_0x385490['query'][_0x3d3f('0x31')]));_0x2eb91c[_0x3d3f('0x30')]=_0x2eb91c[_0x3d3f('0x30')][_0x3d3f('0x32')]?_0x2eb91c[_0x3d3f('0x30')]:_0x1b8702[_0x3d3f('0x2b')];if(!_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x33')](_0x3d3f('0x34'))){_0x2eb91c[_0x3d3f('0x1c')]=qs[_0x3d3f('0x1c')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x1c')]);_0x2eb91c[_0x3d3f('0x1b')]=qs[_0x3d3f('0x1b')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x1b')]);}_0x2eb91c[_0x3d3f('0x35')]=qs[_0x3d3f('0x36')](_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x36')]);_0x2eb91c['where']=qs[_0x3d3f('0x2e')](_[_0x3d3f('0x37')](_0x385490[_0x3d3f('0x2c')],_0x1b8702[_0x3d3f('0x2e')]));if(_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x38')]){_0x2eb91c[_0x3d3f('0x39')]=_[_0x3d3f('0x3a')](_0x2eb91c[_0x3d3f('0x39')],{'$or':_[_0x3d3f('0x3b')](_0x5161f3,function(_0x1ff9e1){if(_0x1ff9e1['type']['key']!==_0x3d3f('0x3c')){var _0x3a7879={};_0x3a7879[_0x1ff9e1[_0x3d3f('0x3d')]]={'$like':'%'+_0x385490[_0x3d3f('0x2c')]['filter']+'%'};return _0x3a7879;}})});}_0x2eb91c=_['merge']({},_0x2eb91c,_0x385490[_0x3d3f('0x3e')]);var _0xdc03d9={'where':_0x2eb91c['where']};return db['SmsApplication'][_0x3d3f('0x1a')](_0xdc03d9)[_0x3d3f('0x23')](function(_0x4cdb8d){_0x2d8233[_0x3d3f('0x1a')]=_0x4cdb8d;if(_0x385490[_0x3d3f('0x2c')][_0x3d3f('0x3f')]){_0x2eb91c[_0x3d3f('0x40')]=[{'all':!![]}];}return db[_0x3d3f('0x29')][_0x3d3f('0x41')](_0x2eb91c);})[_0x3d3f('0x23')](function(_0x496eda){_0x2d8233['rows']=_0x496eda;return _0x2d8233;})[_0x3d3f('0x23')](respondWithFilteredResult(_0x505814,_0x2eb91c))['catch'](handleError(_0x505814,null));};exports['show']=function(_0x4cbfce,_0x3ae97d){var _0x217cf8={'raw':!![],'where':{'id':_0x4cbfce[_0x3d3f('0x42')]['id']}},_0x51a3ca={};_0x51a3ca['model']=_['keys'](db[_0x3d3f('0x29')][_0x3d3f('0x2a')]);_0x51a3ca[_0x3d3f('0x2c')]=_['keys'](_0x4cbfce[_0x3d3f('0x2c')]);_0x51a3ca['filters']=_['intersection'](_0x51a3ca[_0x3d3f('0x2b')],_0x51a3ca['query']);_0x217cf8[_0x3d3f('0x30')]=_[_0x3d3f('0x2f')](_0x51a3ca[_0x3d3f('0x2b')],qs['fields'](_0x4cbfce['query'][_0x3d3f('0x31')]));_0x217cf8['attributes']=_0x217cf8[_0x3d3f('0x30')]['length']?_0x217cf8['attributes']:_0x51a3ca[_0x3d3f('0x2b')];if(_0x4cbfce[_0x3d3f('0x2c')][_0x3d3f('0x3f')]){_0x217cf8[_0x3d3f('0x40')]=[{'all':!![]}];}_0x217cf8=_[_0x3d3f('0x3a')]({},_0x217cf8,_0x4cbfce[_0x3d3f('0x3e')]);return db['SmsApplication'][_0x3d3f('0x43')](_0x217cf8)['then'](handleEntityNotFound(_0x3ae97d,null))[_0x3d3f('0x23')](respondWithResult(_0x3ae97d,null))[_0x3d3f('0x44')](handleError(_0x3ae97d,null));};exports[_0x3d3f('0x45')]=function(_0x311775,_0x102976){return db[_0x3d3f('0x29')][_0x3d3f('0x45')](_0x311775[_0x3d3f('0x46')],{})[_0x3d3f('0x23')](respondWithResult(_0x102976,0xc9))[_0x3d3f('0x44')](handleError(_0x102976,null));};exports[_0x3d3f('0x22')]=function(_0x1fdc5a,_0x77351e){if(_0x1fdc5a[_0x3d3f('0x46')]['id']){delete _0x1fdc5a['body']['id'];}return db[_0x3d3f('0x29')]['find']({'where':{'id':_0x1fdc5a[_0x3d3f('0x42')]['id']}})[_0x3d3f('0x23')](handleEntityNotFound(_0x77351e,null))[_0x3d3f('0x23')](saveUpdates(_0x1fdc5a[_0x3d3f('0x46')],null))['then'](respondWithResult(_0x77351e,null))[_0x3d3f('0x44')](handleError(_0x77351e,null));};exports['destroy']=function(_0x2584d1,_0x49f656){return db['SmsApplication'][_0x3d3f('0x43')]({'where':{'id':_0x2584d1[_0x3d3f('0x42')]['id']}})[_0x3d3f('0x23')](handleEntityNotFound(_0x49f656,null))['then'](removeEntity(_0x49f656,null))[_0x3d3f('0x44')](handleError(_0x49f656,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e23e6e9..a25aa5e 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 _0xc4aa=['bluebird','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','moment'];(function(_0x5b5998,_0x49aac3){var _0x29b320=function(_0x4b42fe){while(--_0x4b42fe){_0x5b5998['push'](_0x5b5998['shift']());}};_0x29b320(++_0x49aac3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f2f=['SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define'];(function(_0x1d5352,_0x4f7974){var _0x3395c2=function(_0x1f062a){while(--_0x1f062a){_0x1d5352['push'](_0x1d5352['shift']());}};_0x3395c2(++_0x4f7974);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b0149,_0x1b1155){_0x5b0149=_0x5b0149-0x0;var _0x54a814=_0x5f2f[_0x5b0149];return _0x54a814;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5f2('0xc'),'collate':_0xf5f2('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1aa3f7e..327e26b 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 _0x21ca=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x305a06,_0xe9a81c){var _0x145f84=function(_0x3f7ec2){while(--_0x3f7ec2){_0x305a06['push'](_0x305a06['shift']());}};_0x145f84(++_0xe9a81c);}(_0x21ca,0xe5));var _0xa21c=function(_0x27a21c,_0x431713){_0x27a21c=_0x27a21c-0x0;var _0x47bbcf=_0x21ca[_0x27a21c];return _0x47bbcf;};'use strict';var _=require(_0xa21c('0x0'));var util=require(_0xa21c('0x1'));var moment=require(_0xa21c('0x2'));var BPromise=require(_0xa21c('0x3'));var rs=require(_0xa21c('0x4'));var fs=require('fs');var Redis=require(_0xa21c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa21c('0x6'));var config=require(_0xa21c('0x7'));var jayson=require(_0xa21c('0x8'));var client=jayson[_0xa21c('0x9')][_0xa21c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eeb36,_0x5a6ace,_0x1dc100){return new BPromise(function(_0x24daa8,_0x189f5e){return client['request'](_0x3eeb36,_0x1dc100)[_0xa21c('0xb')](function(_0x4aa830){logger[_0xa21c('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5a6ace,'request\x20sent');logger[_0xa21c('0xd')](_0xa21c('0xe'),_0x5a6ace,_0xa21c('0xf'),JSON[_0xa21c('0x10')](_0x4aa830));if(_0x4aa830[_0xa21c('0x11')]){if(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x12')]===0x1f4){logger[_0xa21c('0x11')](_0xa21c('0x13'),_0x5a6ace,_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);return _0x189f5e(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);}logger['error'](_0xa21c('0x13'),_0x5a6ace,_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);return _0x24daa8(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);}else{logger[_0xa21c('0xc')](_0xa21c('0x13'),_0x5a6ace,_0xa21c('0xf'));_0x24daa8(_0x4aa830[_0xa21c('0x15')][_0xa21c('0x14')]);}})[_0xa21c('0x16')](function(_0x289984){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5a6ace,_0x289984);_0x189f5e(_0x289984);});});} \ No newline at end of file +var _0x9f6f=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x52085a,_0x1e5058){var _0x32ac7e=function(_0x17c5c5){while(--_0x17c5c5){_0x52085a['push'](_0x52085a['shift']());}};_0x32ac7e(++_0x1e5058);}(_0x9f6f,0x1c7));var _0xf9f6=function(_0x2a553a,_0x247f96){_0x2a553a=_0x2a553a-0x0;var _0x5055cb=_0x9f6f[_0x2a553a];return _0x5055cb;};'use strict';var _=require(_0xf9f6('0x0'));var util=require(_0xf9f6('0x1'));var moment=require(_0xf9f6('0x2'));var BPromise=require(_0xf9f6('0x3'));var rs=require(_0xf9f6('0x4'));var fs=require('fs');var Redis=require(_0xf9f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf9f6('0x6'));var logger=require(_0xf9f6('0x7'))(_0xf9f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9f6('0x9'));var client=jayson[_0xf9f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58b287,_0x138677,_0x4d5001){return new BPromise(function(_0x268831,_0x3cca85){return client['request'](_0x58b287,_0x4d5001)[_0xf9f6('0xb')](function(_0x3056a6){logger[_0xf9f6('0xc')](_0xf9f6('0xd'),_0x138677,_0xf9f6('0xe'));logger[_0xf9f6('0xf')](_0xf9f6('0x10'),_0x138677,_0xf9f6('0xe'),JSON[_0xf9f6('0x11')](_0x3056a6));if(_0x3056a6['error']){if(_0x3056a6['error'][_0xf9f6('0x12')]===0x1f4){logger[_0xf9f6('0x13')]('SmsApplication,\x20%s,\x20%s',_0x138677,_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);return _0x3cca85(_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);}logger[_0xf9f6('0x13')](_0xf9f6('0xd'),_0x138677,_0x3056a6[_0xf9f6('0x13')]['message']);return _0x268831(_0x3056a6[_0xf9f6('0x13')][_0xf9f6('0x14')]);}else{logger[_0xf9f6('0xc')](_0xf9f6('0xd'),_0x138677,'request\x20sent');_0x268831(_0x3056a6[_0xf9f6('0x15')][_0xf9f6('0x14')]);}})[_0xf9f6('0x16')](function(_0x5460ec){logger[_0xf9f6('0x13')](_0xf9f6('0xd'),_0x138677,_0x5460ec);_0x3cca85(_0x5460ec);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7bb1208..5d6fa96 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 _0x0ded=['./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/messages','tracked','sms','smsinteraction:addtags','addTags','put','update','smsinteraction:destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x230ba2,_0x49d042){var _0x1d18e1=function(_0x3ae23e){while(--_0x3ae23e){_0x230ba2['push'](_0x230ba2['shift']());}};_0x1d18e1(++_0x49d042);}(_0x0ded,0x14c));var _0xd0de=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x0ded[_0x466af7];return _0x348c96;};'use strict';var multer=require(_0xd0de('0x0'));var util=require(_0xd0de('0x1'));var path=require(_0xd0de('0x2'));var timeout=require(_0xd0de('0x3'));var express=require(_0xd0de('0x4'));var router=express[_0xd0de('0x5')]();var auth=require(_0xd0de('0x6'));var interaction=require(_0xd0de('0x7'));var config=require(_0xd0de('0x8'));var controller=require(_0xd0de('0x9'));router[_0xd0de('0xa')]('/',auth[_0xd0de('0xb')](),controller['index']);router[_0xd0de('0xa')](_0xd0de('0xc'),auth[_0xd0de('0xb')](),controller[_0xd0de('0xd')]);router['get'](_0xd0de('0xe'),auth[_0xd0de('0xb')](),controller[_0xd0de('0xf')]);router[_0xd0de('0xa')]('/:id/messages',auth[_0xd0de('0xb')](),controller[_0xd0de('0x10')]);router[_0xd0de('0xa')](_0xd0de('0x11'),auth[_0xd0de('0xb')](),controller['download']);router[_0xd0de('0x12')]('/',auth['isAuthenticated'](),controller[_0xd0de('0x13')]);router[_0xd0de('0x12')](_0xd0de('0x14'),auth['isAuthenticated'](),controller['addMessage']);router[_0xd0de('0x12')]('/:id/tags',auth[_0xd0de('0xb')](),interaction[_0xd0de('0x15')](_0xd0de('0x16'),_0xd0de('0x17')),controller[_0xd0de('0x18')]);router[_0xd0de('0x19')](_0xd0de('0xe'),auth[_0xd0de('0xb')](),interaction[_0xd0de('0x15')]('sms','smsinteraction:update'),controller[_0xd0de('0x1a')]);router['delete'](_0xd0de('0xe'),auth[_0xd0de('0xb')](),interaction['tracked'](_0xd0de('0x16'),_0xd0de('0x1b')),controller['destroy']);router[_0xd0de('0x1c')](_0xd0de('0x1d'),auth[_0xd0de('0xb')](),controller['removeTags']);module[_0xd0de('0x1e')]=router; \ No newline at end of file +var _0x512b=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x512b,0xbf));var _0xb512=function(_0x46ea8f,_0x21cead){_0x46ea8f=_0x46ea8f-0x0;var _0x108e2f=_0x512b[_0x46ea8f];return _0x108e2f;};'use strict';var multer=require(_0xb512('0x0'));var util=require(_0xb512('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb512('0x2'));var router=express[_0xb512('0x3')]();var auth=require(_0xb512('0x4'));var interaction=require(_0xb512('0x5'));var config=require(_0xb512('0x6'));var controller=require(_0xb512('0x7'));router[_0xb512('0x8')]('/',auth[_0xb512('0x9')](),controller[_0xb512('0xa')]);router['get'](_0xb512('0xb'),auth['isAuthenticated'](),controller[_0xb512('0xc')]);router[_0xb512('0x8')](_0xb512('0xd'),auth[_0xb512('0x9')](),controller[_0xb512('0xe')]);router['get'](_0xb512('0xf'),auth[_0xb512('0x9')](),controller[_0xb512('0x10')]);router[_0xb512('0x8')](_0xb512('0x11'),auth[_0xb512('0x9')](),controller[_0xb512('0x12')]);router['post']('/',auth[_0xb512('0x9')](),controller['create']);router[_0xb512('0x13')](_0xb512('0xf'),auth[_0xb512('0x9')](),controller[_0xb512('0x14')]);router[_0xb512('0x13')](_0xb512('0x15'),auth[_0xb512('0x9')](),interaction['tracked'](_0xb512('0x16'),_0xb512('0x17')),controller[_0xb512('0x18')]);router[_0xb512('0x19')](_0xb512('0xd'),auth['isAuthenticated'](),interaction['tracked']('sms',_0xb512('0x1a')),controller[_0xb512('0x1b')]);router[_0xb512('0x1c')]('/:id',auth['isAuthenticated'](),interaction[_0xb512('0x1d')](_0xb512('0x16'),_0xb512('0x1e')),controller[_0xb512('0x1f')]);router[_0xb512('0x1c')](_0xb512('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb512('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index fb2ee6f..375f2a8 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 _0xb686=['sequelize','moment','exports','STRING','DATE','ENUM','out'];(function(_0x288ca8,_0x47b4cb){var _0x17ebc4=function(_0x3e7bc2){while(--_0x3e7bc2){_0x288ca8['push'](_0x288ca8['shift']());}};_0x17ebc4(++_0x47b4cb);}(_0xb686,0xd2));var _0x6b68=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb686[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x6b68('0x0'));var moment=require(_0x6b68('0x1'));module[_0x6b68('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6b68('0x3')]},'note':{'type':Sequelize[_0x6b68('0x3')]},'phone':{'type':Sequelize[_0x6b68('0x3')]},'read1stAt':{'type':Sequelize[_0x6b68('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6b68('0x5')]('in',_0x6b68('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6b68('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6b68('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xfd0c=['DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x24e721,_0x4aec0c){var _0x16434e=function(_0x273166){while(--_0x273166){_0x24e721['push'](_0x24e721['shift']());}};_0x16434e(++_0x4aec0c);}(_0xfd0c,0x146));var _0xcfd0=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xfd0c[_0x7275e9];return _0x17b99d;};'use strict';var Sequelize=require(_0xcfd0('0x0'));var moment=require(_0xcfd0('0x1'));module[_0xcfd0('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcfd0('0x3')]},'disposition':{'type':Sequelize[_0xcfd0('0x4')]},'note':{'type':Sequelize[_0xcfd0('0x4')]},'phone':{'type':Sequelize[_0xcfd0('0x4')]},'read1stAt':{'type':Sequelize[_0xcfd0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcfd0('0x5')]('in',_0xcfd0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcfd0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcfd0('0x5')]('in',_0xcfd0('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f7c8cd4..d13192d 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 _0x41d0=['disposition','Messages','out','System','renderFile','views','downloadInteraction.html','transcript-','.pdf','download','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','end','error','stack','name','send','index','SmsInteraction','model','keys','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filters','select','field','color','from','COUNT(*)','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','ui.UserId\x20=\x20i.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','advancedFilter','parse','forEach','createdAt','day','utc','format','endOf','isArray','condition','value','TagId','Messages.count','and','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','map','filter','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','`Messages.count`\x20=\x200','%s\x20>\x200','having','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','`Messages.count`\x20>\x200','sequelize','count','then','keyBy','Account.key','i.*','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','u.fullname','User.name','TagIds','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','Users','Tags','push','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','merge','$gte','options','include','findAll','spread','Tag','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','direction','User','CmContact','Contact','firstName','lastName','SmsAccount','fullname','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x41d0,0x1c6));var _0x041d=function(_0x1ff385,_0x2f30bb){_0x1ff385=_0x1ff385-0x0;var _0x563380=_0x41d0[_0x1ff385];return _0x563380;};'use strict';var pdf=require(_0x041d('0x0'));var emlformat=require(_0x041d('0x1'));var rimraf=require(_0x041d('0x2'));var zipdir=require(_0x041d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x041d('0x4'));var moment=require(_0x041d('0x5'));var BPromise=require(_0x041d('0x6'));var Mustache=require(_0x041d('0x7'));var util=require(_0x041d('0x8'));var path=require(_0x041d('0x9'));var sox=require(_0x041d('0xa'));var csv=require(_0x041d('0xb'));var ejs=require(_0x041d('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x041d('0xd'));var crypto=require('crypto');var jsforce=require(_0x041d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x041d('0xb'));var querystring=require(_0x041d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x041d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x041d('0x11'))('api');var utils=require(_0x041d('0x12'));var config=require(_0x041d('0x13'));var db=require(_0x041d('0x14'))['db'];config[_0x041d('0x15')]=_[_0x041d('0x16')](config[_0x041d('0x15')],{'host':_0x041d('0x17'),'port':0x18eb});var socket=require(_0x041d('0x18'))(new Redis(config[_0x041d('0x15')]));require('./smsInteraction.socket')[_0x041d('0x19')](socket);function respondWithStatusCode(_0x3205ea,_0x61dc3b){_0x61dc3b=_0x61dc3b||0xcc;return function(_0x1efe79){if(_0x1efe79){return _0x3205ea[_0x041d('0x1a')](_0x61dc3b);}return _0x3205ea[_0x041d('0x1b')](_0x61dc3b)['end']();};}function respondWithResult(_0xaadc6f,_0x167cfe){_0x167cfe=_0x167cfe||0xc8;return function(_0x362289){if(_0x362289){return _0xaadc6f[_0x041d('0x1b')](_0x167cfe)[_0x041d('0x1c')](_0x362289);}};}function respondWithFilteredResult(_0x1c581b,_0x5a5ecb){return function(_0x488468){if(_0x488468){var _0x239ac3=_0x488468['count'],_0x32a20e=_0x5a5ecb[_0x041d('0x1d')],_0x4fb80b=_0x5a5ecb[_0x041d('0x1d')]+_0x5a5ecb[_0x041d('0x1e')],_0x15b10b;if(_0x4fb80b>=_0x239ac3){_0x4fb80b=_0x239ac3;_0x15b10b=0xc8;}else{_0x15b10b=0xce;}_0x1c581b['status'](_0x15b10b);return _0x1c581b[_0x041d('0x1f')]('Content-Range',_0x32a20e+'-'+_0x4fb80b+'/'+_0x239ac3)['json'](_0x488468);}return null;};}function patchUpdates(_0x22a8d9){return function(_0x597c1d){try{jsonpatch[_0x041d('0x20')](_0x597c1d,_0x22a8d9,!![]);}catch(_0x339d10){return BPromise[_0x041d('0x21')](_0x339d10);}return _0x597c1d[_0x041d('0x22')]();};}function saveUpdates(_0xb6ec9a,_0x6ee379){return function(_0x437841){if(_0x437841){return _0x437841[_0x041d('0x23')](_0xb6ec9a)['then'](function(_0x1fee9a){return _0x1fee9a;});}return null;};}function removeEntity(_0x302aaa,_0x6058d7){return function(_0x6c8547){if(_0x6c8547){return _0x6c8547[_0x041d('0x24')]()['then'](function(){_0x302aaa[_0x041d('0x1b')](0xcc)[_0x041d('0x25')]();});}};}function handleEntityNotFound(_0x3e04e3,_0x3b34a7){return function(_0x315d73){if(!_0x315d73){_0x3e04e3[_0x041d('0x1a')](0x194);}return _0x315d73;};}function handleError(_0x2ae739,_0x927bb1){_0x927bb1=_0x927bb1||0x1f4;return function(_0x1ca19c){logger[_0x041d('0x26')](_0x1ca19c[_0x041d('0x27')]);if(_0x1ca19c[_0x041d('0x28')]){delete _0x1ca19c[_0x041d('0x28')];}_0x2ae739[_0x041d('0x1b')](_0x927bb1)[_0x041d('0x29')](_0x1ca19c);};}exports[_0x041d('0x2a')]=function(_0x1df7cc,_0x414dbc){var _0x189028={},_0x18b06b={},_0x3cd52c={'count':0x0,'rows':[]};var _0x30ec8f=db[_0x041d('0x2b')]['rawAttributes'];_0x18b06b[_0x041d('0x2c')]=_[_0x041d('0x2d')](_0x30ec8f);_0x18b06b['query']=_[_0x041d('0x2d')](_0x1df7cc['query']);_0x18b06b['filters']=_[_0x041d('0x2e')](_0x18b06b['model'],_0x18b06b[_0x041d('0x2f')]);_0x189028[_0x041d('0x30')]=_['intersection'](_0x18b06b[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x31')]));_0x189028['attributes']=_0x189028[_0x041d('0x30')][_0x041d('0x32')]?_0x189028[_0x041d('0x30')]:_0x18b06b[_0x041d('0x2c')];if(!_0x1df7cc[_0x041d('0x2f')]['hasOwnProperty'](_0x041d('0x33'))){_0x189028['limit']=qs[_0x041d('0x1e')](_0x1df7cc[_0x041d('0x2f')]['limit']);_0x189028['offset']=qs[_0x041d('0x1d')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x1d')]);}_0x189028['order']=qs[_0x041d('0x34')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x34')]);_0x189028[_0x041d('0x35')]=qs['filters'](_[_0x041d('0x36')](_0x1df7cc['query'],_0x18b06b[_0x041d('0x37')]));var _0x229e2d=[];var _0x4831c8=squel[_0x041d('0x38')]()['field']('id')[_0x041d('0x39')](_0x041d('0x28'))['field'](_0x041d('0x3a'))[_0x041d('0x3b')]('tools_tags');var _0x1979f6=squel[_0x041d('0x38')]()[_0x041d('0x39')](_0x041d('0x3c'))[_0x041d('0x3b')](_0x041d('0x3d'),'me')[_0x041d('0x35')](_0x041d('0x3e'))[_0x041d('0x35')](_0x041d('0x3f'))[_0x041d('0x35')](_0x041d('0x40'));var _0x5887ac=squel[_0x041d('0x38')]()[_0x041d('0x39')](_0x041d('0x41'))[_0x041d('0x39')]('ui.SmsInteractionId')[_0x041d('0x3b')](_0x041d('0x42'),'ui')[_0x041d('0x43')](_0x041d('0x44'),'u',_0x041d('0x45'));var _0x10156e=squel[_0x041d('0x38')]()[_0x041d('0x3b')](_0x041d('0x46'),'i')['left_join'](_0x041d('0x42'),'ui',_0x041d('0x47'))['left_join']('users','u','u.id\x20=\x20ui.UserId')['left_join']('cm_contacts','c',_0x041d('0x48'))[_0x041d('0x43')]('users','o','o.id\x20=\x20i.UserId')[_0x041d('0x43')](_0x041d('0x49'),'a',_0x041d('0x4a'))[_0x041d('0x43')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id');var _0x2bbfa1=squel[_0x041d('0x4b')]();if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x4c')]){var _0x32a291=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')]['advancedFilter']);_[_0x041d('0x2d')](_0x32a291)[_0x041d('0x4e')](function(_0x2e9abc){var _0x12a2a1=_0x32a291[_0x2e9abc];if(_0x2e9abc===_0x041d('0x4f')){var _0x4f5045=moment(_0x12a2a1['value']['dateStart'])['startOf'](_0x041d('0x50'))[_0x041d('0x51')]()[_0x041d('0x52')]();var _0x59409c=moment(_0x59409c)['utc']()[_0x041d('0x53')](_0x041d('0x50'))[_0x041d('0x52')]();_0x2bbfa1['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f5045,_0x59409c);}else{if(_[_0x041d('0x54')](_0x12a2a1['condition'])){_0x12a2a1['condition']['forEach'](function(_0x1d40f3){switch(_0x12a2a1[_0x041d('0x55')][_0x041d('0x56')]){case'IS':if(_0x2e9abc!==_0x041d('0x57')&&_0x2e9abc!==_0x041d('0x58')){if(_['isArray'](_0x12a2a1['value'])&&_0x12a2a1[_0x041d('0x56')][_0x041d('0x32')]>0x1){_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+'\x20IN\x20?',_0x12a2a1[_0x041d('0x56')]);}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x5b'),_0x12a2a1['value'][0x0]);}}break;case'=':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x5b'),_0x12a2a1['value']);break;case _0x041d('0x5c'):if(_0x2e9abc===_0x041d('0x5d')){_0x2bbfa1['and'](_0x041d('0x5e')+'\x20LIKE\x20?','%'+_0x12a2a1[_0x041d('0x56')]+'%');_0x2bbfa1['or'](_0x041d('0x5f')+_0x041d('0x60'),'%'+_0x12a2a1['value']+'%');_0x2bbfa1['or'](_0x041d('0x61')+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}break;case'>':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x62'),_0x12a2a1['value']);break;case'<':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x63'),_0x12a2a1[_0x041d('0x56')]);break;}});}else{switch(_0x12a2a1['condition'][_0x041d('0x56')]){case'IS':if(_0x2e9abc!==_0x041d('0x57')&&_0x2e9abc!=='Messages.count'){if(_['isArray'](_0x12a2a1[_0x041d('0x56')])&&_0x12a2a1[_0x041d('0x56')]['length']>0x1){_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x64'),_0x12a2a1[_0x041d('0x56')]);}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+'\x20=\x20?',_0x12a2a1[_0x041d('0x56')][0x0]);}}break;case'=':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+'\x20=\x20?',_0x12a2a1[_0x041d('0x56')]);break;case _0x041d('0x5c'):if(_0x2e9abc===_0x041d('0x5d')){_0x2bbfa1[_0x041d('0x59')](_0x041d('0x5e')+_0x041d('0x60'),'%'+_0x12a2a1['value']+'%');_0x2bbfa1['or']('c.lastName'+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');_0x2bbfa1['or'](_0x041d('0x61')+'\x20LIKE\x20?','%'+_0x12a2a1[_0x041d('0x56')]+'%');}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}break;case'>':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x62'),_0x12a2a1['value']);break;case'<':_0x2bbfa1['and'](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x63'),_0x12a2a1[_0x041d('0x56')]);break;}}}});}else{var _0x3a42b4=_(Object['keys'](_0x1df7cc['query']))[_0x041d('0x65')](function(_0x5880f9){return _0x30ec8f['hasOwnProperty'](_0x5880f9)?_0x5880f9:undefined;})[_0x041d('0x66')](function(_0x3e5ea3){return!_['isNil'](_0x3e5ea3);})[_0x041d('0x56')]();if(!_[_0x041d('0x67')](_0x3a42b4)){_0x3a42b4[_0x041d('0x4e')](function(_0x5469a8){if(_0x5469a8===_0x041d('0x68')){_0x10156e[_0x041d('0x35')](_0x041d('0x69'),[][_0x041d('0x6a')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8]));}else if(_0x5469a8==='createdAt'){var _0x1a6453=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8])['$gte'];var _0x30da8a=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8])['$lte'];_0x10156e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1a6453,_0x30da8a);}else{_0x10156e['where']('i.'+_0x5469a8+_0x041d('0x5b'),_0x1df7cc[_0x041d('0x2f')][_0x5469a8]);}});}if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x66')]){var _0x3cefdc=_0x1df7cc[_0x041d('0x2f')]['filter']['replace']('\x5c','\x5c\x5c')[_0x041d('0x6b')]('\x27\x27',_0x041d('0x6c'));if(qs[_0x041d('0x6d')](_0x3cefdc)){_0x2bbfa1['or'](_0x041d('0x6e'),_0x3cefdc+'%')['or']('i.phone\x20LIKE\x20?',_0x3cefdc+'%');}else{var _0x5a969e=[];_0x3cefdc[_0x041d('0x6f')]('\x20')['forEach'](function(_0x1d09c1){_0x5a969e['push']('+'+_0x1d09c1[_0x041d('0x70')]());});var _0x17471e=_0x5a969e[_0x041d('0x71')]('\x20');_0x2bbfa1['or'](_0x041d('0x72'),_0x17471e)['or'](_0x041d('0x73'),_0x3cefdc+'%');}}}_0x10156e[_0x041d('0x35')](_0x2bbfa1);if(_0x189028[_0x041d('0x74')]){_0x189028['order'][_0x041d('0x4e')](function(_0x2b9359){_0x10156e[_0x041d('0x74')]('i.'+_0x2b9359[0x0],_0x2b9359[0x1]===_0x041d('0x75')?![]:!![]);});}_0x10156e[_0x041d('0x76')]('i.id');var _0x40fdfb={'type':db[_0x041d('0x77')][_0x041d('0x78')][_0x041d('0x79')],'raw':!![]};var _0x54e0f4=_0x10156e[_0x041d('0x7a')]()[_0x041d('0x39')]('COUNT(*)');if(!_0x1df7cc['query']['advancedFilter']){if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x7b')]){if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x7b')]==0x1){_0x54e0f4['where'](util['format'](_0x041d('0x7c'),_0x1979f6[_0x041d('0x70')]()));_0x10156e['having'](_0x041d('0x7d'));}else{_0x54e0f4[_0x041d('0x35')](util[_0x041d('0x52')](_0x041d('0x7e'),_0x1979f6[_0x041d('0x70')]()));_0x10156e[_0x041d('0x7f')]('`Messages.count`\x20>\x200');}}if(_0x1df7cc['query'][_0x041d('0x80')]){var _0x1a383e=_[_0x041d('0x54')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x80')])?_0x1df7cc[_0x041d('0x2f')]['tag']:new Array(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x80')]);var _0x33754a=squel[_0x041d('0x4b')]();_0x1a383e[_0x041d('0x4e')](function(_0x5d4418){_0x33754a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5d4418+',%');});_0x10156e[_0x041d('0x7f')](_0x33754a);_0x54e0f4[_0x041d('0x43')](_0x041d('0x81'),'it',_0x041d('0x82'));_0x54e0f4[_0x041d('0x43')]('tools_tags','t',_0x041d('0x83'));_0x54e0f4[_0x041d('0x35')](_0x041d('0x84'),_0x1a383e);}}else{var _0x32a291=JSON[_0x041d('0x4d')](_0x1df7cc['query']['advancedFilter']);_[_0x041d('0x2d')](_0x32a291)[_0x041d('0x4e')](function(_0x1f55e4){var _0x5569a2=_0x32a291[_0x1f55e4];if(_0x1f55e4===_0x041d('0x57')){var _0x999cbb=_0x5569a2[_0x041d('0x56')];var _0x3e7e22=squel[_0x041d('0x4b')]();_0x999cbb[_0x041d('0x4e')](function(_0x1fcabf){_0x3e7e22['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fcabf+',%');});_0x10156e['having'](_0x3e7e22);_0x54e0f4[_0x041d('0x43')](_0x041d('0x85'),'it',_0x041d('0x86'));_0x54e0f4[_0x041d('0x43')](_0x041d('0x87'),'t',_0x041d('0x83'));_0x54e0f4[_0x041d('0x35')](_0x041d('0x84'),_0x999cbb);}else if(_0x1f55e4==='Messages.count'){if(_0x5569a2[_0x041d('0x56')][_0x041d('0x32')]===0x1){if(_0x5569a2[_0x041d('0x56')][0x0]===0x1){_0x54e0f4[_0x041d('0x35')](util[_0x041d('0x52')]('%s\x20=\x200',_0x1979f6['toString']()));_0x10156e[_0x041d('0x7f')]('`Messages.count`\x20=\x200');}else{_0x54e0f4['where'](util['format'](_0x041d('0x7e'),_0x1979f6[_0x041d('0x70')]()));_0x10156e['having'](_0x041d('0x88'));}}}});}db[_0x041d('0x89')][_0x041d('0x2f')](_0x54e0f4[_0x041d('0x70')](),_0x40fdfb)['then'](function(_0x48131e){_0x3cd52c[_0x041d('0x8a')]=_0x48131e[_0x041d('0x32')];if(_0x3cd52c[_0x041d('0x8a')]===0x0)return[];return db[_0x041d('0x89')][_0x041d('0x2f')](_0x4831c8[_0x041d('0x70')](),_0x40fdfb)[_0x041d('0x8b')](function(_0x465264){_0x229e2d=_[_0x041d('0x8c')](_0x465264,'id');_0x40fdfb=_['merge'](_0x40fdfb,{'model':db[_0x041d('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x10156e['field'](_0x1979f6,_0x041d('0x58'));_0x10156e[_0x041d('0x39')]('a.key',_0x041d('0x8d'));_0x10156e[_0x041d('0x39')](_0x041d('0x8e'));_0x10156e['field']('c.firstName','Contact.firstName');_0x10156e[_0x041d('0x39')]('c.lastName','Contact.lastName');_0x10156e[_0x041d('0x39')](_0x041d('0x61'),'Contact.email');_0x10156e['field'](_0x041d('0x8f'),_0x041d('0x90'));_0x10156e[_0x041d('0x39')](_0x041d('0x91'),_0x041d('0x92'));_0x10156e['field'](_0x041d('0x93'),'Contact.fax');_0x10156e['field'](_0x041d('0x94'),_0x041d('0x95'));_0x10156e[_0x041d('0x39')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x041d('0x96'));_0x10156e['left_join'](_0x041d('0x81'),'it',_0x041d('0x82'));_0x10156e[_0x041d('0x43')]('tools_tags','t',_0x041d('0x83'));_0x10156e['limit'](_0x189028['limit']);_0x10156e[_0x041d('0x1d')](_0x189028[_0x041d('0x1d')]);return db[_0x041d('0x89')][_0x041d('0x2f')](_0x10156e[_0x041d('0x70')](),_0x40fdfb);})[_0x041d('0x8b')](function(_0x39140a){_0x5887ac[_0x041d('0x35')](_0x041d('0x97'),_[_0x041d('0x65')](_0x39140a,'id'));return db['sequelize'][_0x041d('0x2f')](_0x5887ac[_0x041d('0x70')](),_0x40fdfb)[_0x041d('0x8b')](function(_0x3f6378){var _0x239235=_['groupBy'](_0x3f6378,_0x041d('0x98'));_0x39140a['forEach'](function(_0x1e32ae){if(_0x239235[_0x1e32ae['id']]){_0x1e32ae[_0x041d('0x99')]=_[_0x041d('0x65')](_0x239235[_0x1e32ae['id']],function(_0x1775ef){return{'id':_0x1775ef['id']};});}if(_0x1e32ae[_0x041d('0x96')]){_0x1e32ae[_0x041d('0x9a')]=[];_0x1e32ae[_0x041d('0x96')]['split'](',')[_0x041d('0x4e')](function(_0x35ff4b){_0x1e32ae['Tags'][_0x041d('0x9b')](_0x229e2d[_0x35ff4b]);});}delete _0x1e32ae[_0x041d('0x96')];});return _0x39140a;});});})[_0x041d('0x8b')](function(_0x370f5c){_0x3cd52c[_0x041d('0x9c')]=_0x370f5c;return _0x3cd52c;})[_0x041d('0x8b')](respondWithFilteredResult(_0x414dbc,_0x189028))[_0x041d('0x9d')](handleError(_0x414dbc,null));};exports[_0x041d('0x9e')]=function(_0x310417,_0x34d4da){var _0x4f02a7={'raw':![],'where':{'id':_0x310417[_0x041d('0x9f')]['id']}},_0x480bdf={};_0x480bdf['model']=_[_0x041d('0x2d')](db['SmsInteraction'][_0x041d('0xa0')]);_0x480bdf[_0x041d('0x2f')]=_['keys'](_0x310417[_0x041d('0x2f')]);_0x480bdf[_0x041d('0x37')]=_[_0x041d('0x2e')](_0x480bdf[_0x041d('0x2c')],_0x480bdf[_0x041d('0x2f')]);_0x4f02a7['attributes']=_[_0x041d('0x2e')](_0x480bdf[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x310417[_0x041d('0x2f')][_0x041d('0x31')]));_0x4f02a7[_0x041d('0x30')]=_0x4f02a7[_0x041d('0x30')][_0x041d('0x32')]?_0x4f02a7['attributes']:_0x480bdf[_0x041d('0x2c')];if(_0x310417[_0x041d('0x2f')][_0x041d('0xa1')]){_0x4f02a7['include']=[{'all':!![]}];}_0x4f02a7=_['merge']({},_0x4f02a7,_0x310417['options']);return db['SmsInteraction']['find'](_0x4f02a7)[_0x041d('0x8b')](handleEntityNotFound(_0x34d4da,null))[_0x041d('0x8b')](respondWithResult(_0x34d4da,null))[_0x041d('0x9d')](handleError(_0x34d4da,null));};exports['create']=function(_0x16992c,_0x1cccbd){return db['SmsInteraction'][_0x041d('0xa2')](_0x16992c[_0x041d('0xa3')],{})['then'](respondWithResult(_0x1cccbd,0xc9))['catch'](handleError(_0x1cccbd,null));};exports[_0x041d('0x23')]=function(_0x103a30,_0x267330){if(_0x103a30[_0x041d('0xa3')]['id']){delete _0x103a30['body']['id'];}return db['SmsInteraction'][_0x041d('0xa4')]({'where':{'id':_0x103a30['params']['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x267330,null))[_0x041d('0x8b')](saveUpdates(_0x103a30['body'],null))[_0x041d('0x8b')](respondWithResult(_0x267330,null))[_0x041d('0x9d')](handleError(_0x267330,null));};exports['destroy']=function(_0x51bfca,_0x25ff2a){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x51bfca[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x25ff2a,null))['then'](removeEntity(_0x25ff2a,null))['catch'](handleError(_0x25ff2a,null));};exports[_0x041d('0xa5')]=function(_0x4886f2,_0x161f74){return db['SmsInteraction'][_0x041d('0xa5')]()[_0x041d('0x8b')](respondWithResult(_0x161f74,null))[_0x041d('0x9d')](handleError(_0x161f74,null));};exports[_0x041d('0xa6')]=function(_0xd46f77,_0x1c542c,_0x424f20){return db[_0x041d('0xa7')]['find']({'where':{'id':_0xd46f77[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x1c542c,null))[_0x041d('0x8b')](function(_0x3e17c7){if(_0x3e17c7){return _0x3e17c7['addMessage'](_0xd46f77[_0x041d('0xa3')][_0x041d('0xa8')],_[_0x041d('0xa9')](_0xd46f77[_0x041d('0xa3')],['ids','id'])||{});}})[_0x041d('0x8b')](respondWithResult(_0x1c542c,null))[_0x041d('0x9d')](handleError(_0x1c542c,null));};exports[_0x041d('0xaa')]=function(_0x5340c6,_0x517d1c,_0x57e5ad){var _0x360073={'raw':![],'where':{}};var _0xdb5f1e={};var _0x1a0b70={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x041d('0xab')]({'where':{'id':_0x5340c6[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x517d1c,null))[_0x041d('0x8b')](function(_0x5e6578){if(_0x5e6578){_0xdb5f1e[_0x041d('0x2c')]=_[_0x041d('0x2d')](db['SmsMessage'][_0x041d('0xa0')]);_0xdb5f1e[_0x041d('0x2f')]=_[_0x041d('0x2d')](_0x5340c6[_0x041d('0x2f')]);_0xdb5f1e['filters']=_[_0x041d('0x2e')](_0xdb5f1e[_0x041d('0x2c')],_0xdb5f1e['query']);_0x360073[_0x041d('0x30')]=_[_0x041d('0x2e')](_0xdb5f1e[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x31')]));_0x360073['attributes']=_0x360073[_0x041d('0x30')][_0x041d('0x32')]?_0x360073[_0x041d('0x30')]:_0xdb5f1e[_0x041d('0x2c')];if(!_0x5340c6[_0x041d('0x2f')][_0x041d('0xac')]('nolimit')){_0x360073[_0x041d('0x1e')]=qs[_0x041d('0x1e')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x1e')]);_0x360073['offset']=qs[_0x041d('0x1d')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x1d')]);}_0x360073['order']=qs[_0x041d('0x34')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x34')]);_0x360073[_0x041d('0x35')]=qs[_0x041d('0x37')](_['pick'](_0x5340c6[_0x041d('0x2f')],_0xdb5f1e[_0x041d('0x37')]));_0x360073[_0x041d('0x35')][_0x041d('0x98')]=_0x5e6578['id'];if(_0x5340c6['query'][_0x041d('0x66')]){_0x360073[_0x041d('0x35')]=_[_0x041d('0xad')](_0x360073[_0x041d('0x35')],{'$or':_[_0x041d('0x65')](_0x360073[_0x041d('0x30')],function(_0x2846dd){var _0x51b7f2={};_0x51b7f2[_0x2846dd]={'$like':'%'+_0x5340c6[_0x041d('0x2f')][_0x041d('0x66')]+'%'};return _0x51b7f2;})});}if(_0x5340c6[_0x041d('0x2f')][_0x041d('0xae')]){var _0x503870=_0x5340c6[_0x041d('0x2f')][_0x041d('0xae')][_0x041d('0x6f')](',');var _0x24909d={};_0x24909d[_0x503870[0x0]]={'$gte':moment(_0x503870[0x1])[_0x041d('0x52')]('YYYY-MM-DD\x20HH:mm:ss')};_0x360073[_0x041d('0x35')]=_[_0x041d('0xad')](_0x360073[_0x041d('0x35')],_0x24909d);}_0x360073=_[_0x041d('0xad')]({},_0x360073,_0x5340c6[_0x041d('0xaf')]);return db['SmsMessage'][_0x041d('0x8a')]({'where':_0x360073['where']})[_0x041d('0x8b')](function(_0x2a45b8){_0x1a0b70[_0x041d('0x8a')]=_0x2a45b8;if(_0x5340c6['query']['includeAll']){_0x360073[_0x041d('0xb0')]=[{'all':!![]}];}return db[_0x041d('0xa7')][_0x041d('0xb1')](_0x360073);})[_0x041d('0x8b')](function(_0x56d271){_0x1a0b70[_0x041d('0x9c')]=_0x56d271;return _0x1a0b70;});}})['then'](respondWithFilteredResult(_0x517d1c,_0x360073))[_0x041d('0x9d')](handleError(_0x517d1c,null));};exports['addTags']=function(_0x4f2e51,_0x1c089e,_0x2f97a8){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x4f2e51['params']['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x1c089e,null))[_0x041d('0x8b')](function(_0x1fb854){if(_0x1fb854){return _0x1fb854['setTags'](_0x4f2e51[_0x041d('0xa3')][_0x041d('0xa8')],_['omit'](_0x4f2e51[_0x041d('0xa3')],[_0x041d('0xa8'),'id'])||{})[_0x041d('0xb2')](function(){return db[_0x041d('0xb3')][_0x041d('0xb1')]({'attributes':['id',_0x041d('0x28'),_0x041d('0x3a')],'where':{'id':_0x4f2e51[_0x041d('0xa3')][_0x041d('0xa8')]}});})[_0x041d('0x8b')](function(_0x50536b){socket[_0x041d('0xb4')]('smsInteractionTags:save',{'id':Number(_0x4f2e51[_0x041d('0x9f')]['id']),'tags':_0x50536b||[]});return{'id':Number(_0x4f2e51[_0x041d('0x9f')]['id']),'tags':_0x50536b||[]};});}})['then'](respondWithResult(_0x1c089e,null))[_0x041d('0x9d')](handleError(_0x1c089e,null));};exports[_0x041d('0xb5')]=function(_0x5971a4,_0x27a807,_0x19cef7){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x5971a4[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x27a807,null))['then'](function(_0x5357a9){if(_0x5357a9){return _0x5357a9[_0x041d('0xb5')](_0x5971a4[_0x041d('0x2f')]['ids']);}})[_0x041d('0x8b')](respondWithStatusCode(_0x27a807,null))['catch'](handleError(_0x27a807,null));};exports['download']=function(_0x466677,_0x1cd4b3){var _0x63c94f=moment()[_0x041d('0xb6')]()[_0x041d('0x70')]();var _0x3bdccd=path[_0x041d('0x71')](config[_0x041d('0xb7')],_0x041d('0xb8'),_0x041d('0xb9'),_0x041d('0xba'));var _0x1b2a26=path[_0x041d('0x71')](config[_0x041d('0xb7')],_0x041d('0xb8'),_0x041d('0xb9'),_0x041d('0xbb'));var _0xd06f0a=path[_0x041d('0x71')](_0x3bdccd,_0x63c94f);var _0x5e0584=util['format'](_0x041d('0xbc'),_0x466677[_0x041d('0x9f')]['id'],_0x63c94f);var _0x5a5402=path['join'](_0x3bdccd,_0x5e0584);var _0x3eecfb=![];return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x466677[_0x041d('0x9f')]['id']},'include':[{'model':db[_0x041d('0xa7')],'as':'Messages','attributes':['id',_0x041d('0xa3'),_0x041d('0x4f'),_0x041d('0xbd'),'secret'],'include':[{'model':db[_0x041d('0xbe')],'as':_0x041d('0xbe'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x041d('0xbf')],'as':_0x041d('0xc0'),'attributes':['id',_0x041d('0xc1'),_0x041d('0xc2')],'raw':!![]}]},{'model':db[_0x041d('0xc3')],'as':'Account','attributes':['id','name']},{'model':db[_0x041d('0xbe')],'as':'Owner','attributes':['id',_0x041d('0xc4')]}]})['then'](handleEntityNotFound(_0x1cd4b3,null))[_0x041d('0x8b')](function(_0x1d7d1a){if(_0x1d7d1a){var _0x1543bd=_0x1d7d1a[_0x041d('0xc5')]({'plain':!![]});_0x3eecfb=!![];var _0x3e27a9={'format':'A4','border':_0x041d('0xc6'),'header':{'height':_0x041d('0xc7'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x041d('0xc8'),'contents':{'default':util[_0x041d('0x52')](_0x041d('0xc9'),util[_0x041d('0x52')](_0x041d('0xca'),_0x041d('0xcb'),_0x1543bd['id']),moment()[_0x041d('0x52')]('YYYY-MM-DD')[_0x041d('0x70')]())}}};fs[_0x041d('0xcc')](_0xd06f0a);var _0x352945={'channel':_0x041d('0xcb'),'account':_0x1543bd['Account'][_0x041d('0x28')],'agent':_0x1543bd['Owner']?_0x1543bd[_0x041d('0xcd')][_0x041d('0xc4')]:_0x041d('0xce'),'createdAt':moment(_0x1543bd['createdAt'])[_0x041d('0x52')](_0x041d('0xcf'))['toString'](),'closedAt':_0x1543bd['closed']?moment(_0x1543bd[_0x041d('0xd0')])['format'](_0x041d('0xcf'))[_0x041d('0x70')]():'','disposition':_0x1543bd[_0x041d('0xd1')],'messages':_(_0x1543bd[_0x041d('0xd2')])[_0x041d('0x66')]({'secret':![]})[_0x041d('0x65')](function(_0x41ae39){return{'date':moment(_0x41ae39[_0x041d('0x4f')])[_0x041d('0x52')](_0x041d('0xcf'))[_0x041d('0x70')](),'sender':_0x41ae39['direction']===_0x041d('0xd3')?_0x41ae39[_0x041d('0xbe')]?_0x41ae39[_0x041d('0xbe')][_0x041d('0xc4')]:_0x041d('0xd4'):_0x41ae39['Contact']['firstName']+(_0x41ae39[_0x041d('0xc0')][_0x041d('0xc2')]?'\x20'+_0x41ae39[_0x041d('0xc0')]['lastName']:''),'body':_0x41ae39[_0x041d('0xa3')],'direction':_0x41ae39[_0x041d('0xbd')]===_0x041d('0xd3')?'A':'C','secret':_0x41ae39['secret']};})[_0x041d('0x56')]()};return ejs[_0x041d('0xd5')](path[_0x041d('0x71')](config[_0x041d('0xb7')],'server',_0x041d('0xd6'),_0x041d('0xd7')),{'interaction':_0x352945})[_0x041d('0x8b')](function(_0x3f1faa){return new BPromise(function(_0xbc4ab1,_0x1af156){pdf[_0x041d('0xa2')](_0x3f1faa,_0x3e27a9)['toFile'](path['join'](_0xd06f0a,_0x041d('0xd8')+_0x1543bd['id']+'-'+_0x63c94f+_0x041d('0xd9')),function(_0x4c036b,_0x5e9f3f){if(_0x4c036b)return _0x1af156(_0x4c036b);_0xbc4ab1(_0x5e9f3f);});});});}})['then'](function(){if(_0x3eecfb){return new BPromise(function(_0xf0fa5f,_0x4c1fe5){zipdir(_0xd06f0a,{'saveTo':_0x5a5402},function(_0x2c4576,_0x352f74){if(_0x2c4576)return _0x4c1fe5(_0x2c4576);return _0xf0fa5f(_0x352f74);});})['then'](function(){return new BPromise(function(_0x4c9030,_0x5f23d6){rimraf(_0xd06f0a,function(_0x1d36d5){if(_0x1d36d5)_0x5f23d6(_0x1d36d5);return _0x4c9030();});});})['then'](function(){return _0x1cd4b3[_0x041d('0xda')](_0x5a5402,_0x5e0584,function(_0x274106){if(_0x274106){console[_0x041d('0xdb')](_0x041d('0xdc'),_0x274106);}else{fs['unlinkSync'](_0x5a5402);}});});}else{return _0x1cd4b3[_0x041d('0x1a')](0xc8);}})[_0x041d('0x9d')](handleError(_0x1cd4b3,null));}; \ No newline at end of file +var _0xfcf0=['tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','%s\x20=\x200','`Messages.count`\x20>\x200','sequelize','merge','Account.key','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','Tags','split','rows','catch','show','params','SmsInteraction','include','options','find','create','body','describe','SmsMessage','addMessage','ids','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','spread','Tag','color','emit','smsInteractionTags:save','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Messages','direction','User','fullname','CmContact','Contact','firstName','lastName','SmsAccount','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','mkdirSync','Account','Owner','N.A.','closedAt','disposition','System','out','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','COUNT(*)','from','me.SmsInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','ui.UserId\x20=\x20i.UserId','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_messages','expr','advancedFilter','parse','forEach','value','dateStart','startOf','format','utc','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','Messages.count','c.lastName','map','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','filter','replace','\x27\x27\x27\x27','isNumeric','push','toString','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','QueryTypes','clone','read','having','`Messages.count`\x20=\x200'];(function(_0x124e2d,_0x3ec839){var _0x345e75=function(_0x59f7f9){while(--_0x59f7f9){_0x124e2d['push'](_0x124e2d['shift']());}};_0x345e75(++_0x3ec839);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0xfcf0[_0x4dbba7];return _0x43ef83;};'use strict';var pdf=require(_0x0fcf('0x0'));var emlformat=require(_0x0fcf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0fcf('0x2'));var jsonpatch=require(_0x0fcf('0x3'));var rp=require(_0x0fcf('0x4'));var moment=require(_0x0fcf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fcf('0x6'));var util=require(_0x0fcf('0x7'));var path=require(_0x0fcf('0x8'));var sox=require(_0x0fcf('0x9'));var csv=require(_0x0fcf('0xa'));var ejs=require(_0x0fcf('0xb'));var fs=require('fs');var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0xa'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0fcf('0x13'));var logger=require('../../config/logger')(_0x0fcf('0x14'));var utils=require(_0x0fcf('0x15'));var config=require(_0x0fcf('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0fcf('0x17')](config[_0x0fcf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fcf('0x19'))(new Redis(config[_0x0fcf('0x18')]));require(_0x0fcf('0x1a'))[_0x0fcf('0x1b')](socket);function respondWithStatusCode(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xcc;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x1c')](_0x48bba6);}return _0x25fadc[_0x0fcf('0x1d')](_0x48bba6)['end']();};}function respondWithResult(_0x3c09c4,_0x610106){_0x610106=_0x610106||0xc8;return function(_0x445207){if(_0x445207){return _0x3c09c4[_0x0fcf('0x1d')](_0x610106)['json'](_0x445207);}};}function respondWithFilteredResult(_0x3e78d0,_0x2f8289){return function(_0x1a8477){if(_0x1a8477){var _0x8581bd=_0x1a8477[_0x0fcf('0x1e')],_0x19cfbd=_0x2f8289['offset'],_0x567320=_0x2f8289[_0x0fcf('0x1f')]+_0x2f8289[_0x0fcf('0x20')],_0x18ea32;if(_0x567320>=_0x8581bd){_0x567320=_0x8581bd;_0x18ea32=0xc8;}else{_0x18ea32=0xce;}_0x3e78d0['status'](_0x18ea32);return _0x3e78d0[_0x0fcf('0x21')]('Content-Range',_0x19cfbd+'-'+_0x567320+'/'+_0x8581bd)[_0x0fcf('0x22')](_0x1a8477);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x23')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x24')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x25')](_0x2f03ce)[_0x0fcf('0x26')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x27')]()[_0x0fcf('0x26')](function(){_0x5841a9[_0x0fcf('0x1d')](0xcc)[_0x0fcf('0x28')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x29')](_0x41b7a2[_0x0fcf('0x2a')]);if(_0x41b7a2[_0x0fcf('0x2b')]){delete _0x41b7a2[_0x0fcf('0x2b')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x2c')](_0x41b7a2);};}exports[_0x0fcf('0x2d')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=db['SmsInteraction'][_0x0fcf('0x2e')];_0x5d9bcd[_0x0fcf('0x2f')]=_['keys'](_0x428194);_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x200517[_0x0fcf('0x30')]);_0x5d9bcd[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x5d9bcd[_0x0fcf('0x2f')],_0x5d9bcd['query']);_0x49fd0e[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x5d9bcd[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x35')]));_0x49fd0e['attributes']=_0x49fd0e[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x49fd0e[_0x0fcf('0x34')]:_0x5d9bcd[_0x0fcf('0x2f')];if(!_0x200517[_0x0fcf('0x30')][_0x0fcf('0x37')](_0x0fcf('0x38'))){_0x49fd0e[_0x0fcf('0x20')]=qs[_0x0fcf('0x20')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x20')]);_0x49fd0e[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x200517[_0x0fcf('0x30')]['offset']);}_0x49fd0e['order']=qs[_0x0fcf('0x39')](_0x200517['query']['sort']);_0x49fd0e[_0x0fcf('0x3a')]=qs[_0x0fcf('0x32')](_[_0x0fcf('0x3b')](_0x200517['query'],_0x5d9bcd['filters']));var _0x1417ac=[];var _0x15db0d=squel[_0x0fcf('0x3c')]()['field']('id')[_0x0fcf('0x3d')](_0x0fcf('0x2b'))[_0x0fcf('0x3d')]('color')['from']('tools_tags');var _0x3c24cb=squel[_0x0fcf('0x3c')]()[_0x0fcf('0x3d')](_0x0fcf('0x3e'))[_0x0fcf('0x3f')]('sms_messages','me')[_0x0fcf('0x3a')](_0x0fcf('0x40'))[_0x0fcf('0x3a')]('me.direction\x20=\x20\x27in\x27')['where'](_0x0fcf('0x41'));var _0xe97d6b=squel[_0x0fcf('0x3c')]()[_0x0fcf('0x3d')](_0x0fcf('0x42'))['field'](_0x0fcf('0x43'))[_0x0fcf('0x3f')](_0x0fcf('0x44'),'ui')[_0x0fcf('0x45')]('users','u','u.id\x20=\x20ui.UserId');var _0x252000=squel[_0x0fcf('0x3c')]()['from'](_0x0fcf('0x46'),'i')[_0x0fcf('0x45')]('user_has_sms_interactions','ui',_0x0fcf('0x47'))[_0x0fcf('0x45')](_0x0fcf('0x48'),'u',_0x0fcf('0x49'))[_0x0fcf('0x45')]('cm_contacts','c',_0x0fcf('0x4a'))[_0x0fcf('0x45')]('users','o','o.id\x20=\x20i.UserId')[_0x0fcf('0x45')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x0fcf('0x45')](_0x0fcf('0x4b'),'me',_0x0fcf('0x40'));var _0xb9b6ff=squel[_0x0fcf('0x4c')]();if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x4d')]){var _0x5cebd8=JSON[_0x0fcf('0x4e')](_0x200517[_0x0fcf('0x30')]['advancedFilter']);_[_0x0fcf('0x31')](_0x5cebd8)[_0x0fcf('0x4f')](function(_0x3e24fc){var _0x4b2308=_0x5cebd8[_0x3e24fc];if(_0x3e24fc==='createdAt'){var _0x41b297=moment(_0x4b2308[_0x0fcf('0x50')][_0x0fcf('0x51')])[_0x0fcf('0x52')]('day')['utc']()[_0x0fcf('0x53')]();var _0x3c06c3=moment(_0x3c06c3)[_0x0fcf('0x54')]()[_0x0fcf('0x55')](_0x0fcf('0x56'))[_0x0fcf('0x53')]();_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x58'),_0x41b297,_0x3c06c3);}else{if(_['isArray'](_0x4b2308['condition'])){_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x4f')](function(_0x28d2f4){switch(_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x50')]){case'IS':if(_0x3e24fc!==_0x0fcf('0x5a')&&_0x3e24fc!=='Messages.count'){if(_[_0x0fcf('0x5b')](_0x4b2308[_0x0fcf('0x50')])&&_0x4b2308['value'][_0x0fcf('0x36')]>0x1){_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5d'),_0x4b2308['value']);}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')][0x0]);}}break;case'=':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')]);break;case _0x0fcf('0x5f'):if(_0x3e24fc===_0x0fcf('0x60')){_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x61')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or']('c.lastName'+_0x0fcf('0x62'),'%'+_0x4b2308['value']+'%');_0xb9b6ff['or'](_0x0fcf('0x63')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20LIKE\x20?','%'+_0x4b2308[_0x0fcf('0x50')]+'%');}break;case'>':_0xb9b6ff['and'](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x64'),_0x4b2308['value']);break;case'<':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20<\x20?',_0x4b2308[_0x0fcf('0x50')]);break;}});}else{switch(_0x4b2308[_0x0fcf('0x59')][_0x0fcf('0x50')]){case'IS':if(_0x3e24fc!==_0x0fcf('0x5a')&&_0x3e24fc!==_0x0fcf('0x65')){if(_['isArray'](_0x4b2308['value'])&&_0x4b2308[_0x0fcf('0x50')]['length']>0x1){_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+'\x20IN\x20?',_0x4b2308['value']);}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308['value'][0x0]);}}break;case'=':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+_0x0fcf('0x5e'),_0x4b2308[_0x0fcf('0x50')]);break;case _0x0fcf('0x5f'):if(_0x3e24fc==='ContactId'){_0xb9b6ff[_0x0fcf('0x57')](_0x0fcf('0x61')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or'](_0x0fcf('0x66')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');_0xb9b6ff['or'](_0x0fcf('0x63')+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}else{_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+_0x0fcf('0x62'),'%'+_0x4b2308[_0x0fcf('0x50')]+'%');}break;case'>':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308[_0x0fcf('0x5c')]+'.'+_0x3e24fc+_0x0fcf('0x64'),_0x4b2308[_0x0fcf('0x50')]);break;case'<':_0xb9b6ff[_0x0fcf('0x57')](_0x4b2308['tableAlias']+'.'+_0x3e24fc+'\x20<\x20?',_0x4b2308[_0x0fcf('0x50')]);break;}}}});}else{var _0x38c2e0=_(Object['keys'](_0x200517[_0x0fcf('0x30')]))[_0x0fcf('0x67')](function(_0x447c25){return _0x428194[_0x0fcf('0x37')](_0x447c25)?_0x447c25:undefined;})['filter'](function(_0x540859){return!_[_0x0fcf('0x68')](_0x540859);})[_0x0fcf('0x50')]();if(!_[_0x0fcf('0x69')](_0x38c2e0)){_0x38c2e0[_0x0fcf('0x4f')](function(_0x1abf75){if(_0x1abf75==='SmsAccountId'){_0x252000[_0x0fcf('0x3a')](_0x0fcf('0x6a'),[][_0x0fcf('0x6b')](_0x200517[_0x0fcf('0x30')][_0x1abf75]));}else if(_0x1abf75===_0x0fcf('0x6c')){var _0x52cb97=JSON['parse'](_0x200517[_0x0fcf('0x30')][_0x1abf75])[_0x0fcf('0x6d')];var _0x8c2777=JSON[_0x0fcf('0x4e')](_0x200517[_0x0fcf('0x30')][_0x1abf75])[_0x0fcf('0x6e')];_0x252000[_0x0fcf('0x3a')](_0x0fcf('0x58'),_0x52cb97,_0x8c2777);}else{_0x252000[_0x0fcf('0x3a')]('i.'+_0x1abf75+_0x0fcf('0x5e'),_0x200517['query'][_0x1abf75]);}});}if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x6f')]){var _0x1c5ec1=_0x200517[_0x0fcf('0x30')][_0x0fcf('0x6f')][_0x0fcf('0x70')]('\x5c','\x5c\x5c')[_0x0fcf('0x70')]('\x27\x27',_0x0fcf('0x71'));if(qs[_0x0fcf('0x72')](_0x1c5ec1)){_0xb9b6ff['or']('i.id\x20LIKE\x20?',_0x1c5ec1+'%')['or']('i.phone\x20LIKE\x20?',_0x1c5ec1+'%');}else{var _0x5a1cd9=[];_0x1c5ec1['split']('\x20')[_0x0fcf('0x4f')](function(_0x57c221){_0x5a1cd9[_0x0fcf('0x73')]('+'+_0x57c221[_0x0fcf('0x74')]());});var _0x3da414=_0x5a1cd9['join']('\x20');_0xb9b6ff['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x3da414)['or'](_0x0fcf('0x75'),_0x1c5ec1+'%');}}}_0x252000[_0x0fcf('0x3a')](_0xb9b6ff);if(_0x49fd0e['order']){_0x49fd0e[_0x0fcf('0x76')][_0x0fcf('0x4f')](function(_0x5936a6){_0x252000[_0x0fcf('0x76')]('i.'+_0x5936a6[0x0],_0x5936a6[0x1]===_0x0fcf('0x77')?![]:!![]);});}_0x252000[_0x0fcf('0x78')](_0x0fcf('0x79'));var _0x7cc9a0={'type':db[_0x0fcf('0x7a')][_0x0fcf('0x7b')]['SELECT'],'raw':!![]};var _0x3edb41=_0x252000[_0x0fcf('0x7c')]()[_0x0fcf('0x3d')](_0x0fcf('0x3e'));if(!_0x200517[_0x0fcf('0x30')][_0x0fcf('0x4d')]){if(_0x200517['query']['read']){if(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x7d')]==0x1){_0x3edb41[_0x0fcf('0x3a')](util[_0x0fcf('0x53')]('%s\x20=\x200',_0x3c24cb[_0x0fcf('0x74')]()));_0x252000[_0x0fcf('0x7e')](_0x0fcf('0x7f'));}else{_0x3edb41[_0x0fcf('0x3a')](util[_0x0fcf('0x53')]('%s\x20>\x200',_0x3c24cb['toString']()));_0x252000[_0x0fcf('0x7e')]('`Messages.count`\x20>\x200');}}if(_0x200517[_0x0fcf('0x30')]['tag']){var _0x4ebc2f=_[_0x0fcf('0x5b')](_0x200517[_0x0fcf('0x30')][_0x0fcf('0x80')])?_0x200517[_0x0fcf('0x30')]['tag']:new Array(_0x200517[_0x0fcf('0x30')][_0x0fcf('0x80')]);var _0x1bbaca=squel[_0x0fcf('0x4c')]();_0x4ebc2f['forEach'](function(_0x376d26){_0x1bbaca['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x376d26+',%');});_0x252000[_0x0fcf('0x7e')](_0x1bbaca);_0x3edb41['left_join'](_0x0fcf('0x81'),'it',_0x0fcf('0x82'));_0x3edb41['left_join'](_0x0fcf('0x83'),'t',_0x0fcf('0x84'));_0x3edb41[_0x0fcf('0x3a')]('t.id\x20IN\x20?',_0x4ebc2f);}}else{var _0x5cebd8=JSON['parse'](_0x200517[_0x0fcf('0x30')]['advancedFilter']);_[_0x0fcf('0x31')](_0x5cebd8)[_0x0fcf('0x4f')](function(_0x38c703){var _0xf0c6d2=_0x5cebd8[_0x38c703];if(_0x38c703===_0x0fcf('0x5a')){var _0x17662e=_0xf0c6d2[_0x0fcf('0x50')];var _0x344720=squel[_0x0fcf('0x4c')]();_0x17662e['forEach'](function(_0x27d46a){_0x344720['or'](_0x0fcf('0x85'),'%,'+_0x27d46a+',%');});_0x252000[_0x0fcf('0x7e')](_0x344720);_0x3edb41[_0x0fcf('0x45')](_0x0fcf('0x86'),'it',_0x0fcf('0x87'));_0x3edb41[_0x0fcf('0x45')](_0x0fcf('0x83'),'t','t.id\x20=\x20it.TagId');_0x3edb41[_0x0fcf('0x3a')](_0x0fcf('0x88'),_0x17662e);}else if(_0x38c703===_0x0fcf('0x65')){if(_0xf0c6d2[_0x0fcf('0x50')][_0x0fcf('0x36')]===0x1){if(_0xf0c6d2[_0x0fcf('0x50')][0x0]===0x1){_0x3edb41[_0x0fcf('0x3a')](util['format'](_0x0fcf('0x89'),_0x3c24cb['toString']()));_0x252000[_0x0fcf('0x7e')](_0x0fcf('0x7f'));}else{_0x3edb41[_0x0fcf('0x3a')](util['format']('%s\x20>\x200',_0x3c24cb['toString']()));_0x252000['having'](_0x0fcf('0x8a'));}}}});}db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x3edb41[_0x0fcf('0x74')](),_0x7cc9a0)[_0x0fcf('0x26')](function(_0x3259e4){_0x4af80d[_0x0fcf('0x1e')]=_0x3259e4[_0x0fcf('0x36')];if(_0x4af80d[_0x0fcf('0x1e')]===0x0)return[];return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x15db0d['toString'](),_0x7cc9a0)[_0x0fcf('0x26')](function(_0xdfdf98){_0x1417ac=_['keyBy'](_0xdfdf98,'id');_0x7cc9a0=_[_0x0fcf('0x8c')](_0x7cc9a0,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x252000[_0x0fcf('0x3d')](_0x3c24cb,_0x0fcf('0x65'));_0x252000['field']('a.key',_0x0fcf('0x8d'));_0x252000[_0x0fcf('0x3d')]('i.*');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x61'),_0x0fcf('0x8e'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x66'),_0x0fcf('0x8f'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x63'),'Contact.email');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x90'),_0x0fcf('0x91'));_0x252000[_0x0fcf('0x3d')]('c.mobile',_0x0fcf('0x92'));_0x252000['field']('c.fax','Contact.fax');_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x93'),_0x0fcf('0x94'));_0x252000[_0x0fcf('0x3d')](_0x0fcf('0x95'),_0x0fcf('0x96'));_0x252000[_0x0fcf('0x45')](_0x0fcf('0x81'),'it',_0x0fcf('0x82'));_0x252000['left_join'](_0x0fcf('0x83'),'t',_0x0fcf('0x84'));_0x252000[_0x0fcf('0x20')](_0x49fd0e[_0x0fcf('0x20')]);_0x252000[_0x0fcf('0x1f')](_0x49fd0e[_0x0fcf('0x1f')]);return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0x252000[_0x0fcf('0x74')](),_0x7cc9a0);})['then'](function(_0x56e098){_0xe97d6b['where'](_0x0fcf('0x97'),_[_0x0fcf('0x67')](_0x56e098,'id'));return db[_0x0fcf('0x8b')][_0x0fcf('0x30')](_0xe97d6b['toString'](),_0x7cc9a0)['then'](function(_0x5c7fd7){var _0x9f5010=_['groupBy'](_0x5c7fd7,_0x0fcf('0x98'));_0x56e098['forEach'](function(_0xaadf5d){if(_0x9f5010[_0xaadf5d['id']]){_0xaadf5d['Users']=_[_0x0fcf('0x67')](_0x9f5010[_0xaadf5d['id']],function(_0x5214f0){return{'id':_0x5214f0['id']};});}if(_0xaadf5d['TagIds']){_0xaadf5d[_0x0fcf('0x99')]=[];_0xaadf5d['TagIds'][_0x0fcf('0x9a')](',')[_0x0fcf('0x4f')](function(_0x3e26d5){_0xaadf5d[_0x0fcf('0x99')][_0x0fcf('0x73')](_0x1417ac[_0x3e26d5]);});}delete _0xaadf5d[_0x0fcf('0x96')];});return _0x56e098;});});})[_0x0fcf('0x26')](function(_0x512dbd){_0x4af80d[_0x0fcf('0x9b')]=_0x512dbd;return _0x4af80d;})[_0x0fcf('0x26')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x9c')](handleError(_0x35180d,null));};exports[_0x0fcf('0x9d')]=function(_0x180702,_0x57a1c0){var _0x1031a1={'raw':![],'where':{'id':_0x180702[_0x0fcf('0x9e')]['id']}},_0x3bc4a5={};_0x3bc4a5[_0x0fcf('0x2f')]=_[_0x0fcf('0x31')](db[_0x0fcf('0x9f')][_0x0fcf('0x2e')]);_0x3bc4a5[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x180702['query']);_0x3bc4a5[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x3bc4a5[_0x0fcf('0x2f')],_0x3bc4a5[_0x0fcf('0x30')]);_0x1031a1[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x3bc4a5[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x180702[_0x0fcf('0x30')][_0x0fcf('0x35')]));_0x1031a1[_0x0fcf('0x34')]=_0x1031a1[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x1031a1['attributes']:_0x3bc4a5[_0x0fcf('0x2f')];if(_0x180702[_0x0fcf('0x30')]['includeAll']){_0x1031a1[_0x0fcf('0xa0')]=[{'all':!![]}];}_0x1031a1=_[_0x0fcf('0x8c')]({},_0x1031a1,_0x180702[_0x0fcf('0xa1')]);return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')](_0x1031a1)['then'](handleEntityNotFound(_0x57a1c0,null))['then'](respondWithResult(_0x57a1c0,null))['catch'](handleError(_0x57a1c0,null));};exports[_0x0fcf('0xa3')]=function(_0x4b0216,_0x2bce6e){return db[_0x0fcf('0x9f')]['create'](_0x4b0216[_0x0fcf('0xa4')],{})[_0x0fcf('0x26')](respondWithResult(_0x2bce6e,0xc9))[_0x0fcf('0x9c')](handleError(_0x2bce6e,null));};exports[_0x0fcf('0x25')]=function(_0x173f04,_0x3545d5){if(_0x173f04[_0x0fcf('0xa4')]['id']){delete _0x173f04[_0x0fcf('0xa4')]['id'];}return db[_0x0fcf('0x9f')]['find']({'where':{'id':_0x173f04[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x3545d5,null))[_0x0fcf('0x26')](saveUpdates(_0x173f04['body'],null))[_0x0fcf('0x26')](respondWithResult(_0x3545d5,null))[_0x0fcf('0x9c')](handleError(_0x3545d5,null));};exports[_0x0fcf('0x27')]=function(_0x71ac37,_0x208a1e){return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')]({'where':{'id':_0x71ac37['params']['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x208a1e,null))[_0x0fcf('0x26')](removeEntity(_0x208a1e,null))[_0x0fcf('0x9c')](handleError(_0x208a1e,null));};exports[_0x0fcf('0xa5')]=function(_0x57d614,_0x42a9e8){return db['SmsInteraction'][_0x0fcf('0xa5')]()[_0x0fcf('0x26')](respondWithResult(_0x42a9e8,null))['catch'](handleError(_0x42a9e8,null));};exports['addMessage']=function(_0x10d4d0,_0x142fd1,_0xed8835){return db[_0x0fcf('0xa6')][_0x0fcf('0xa2')]({'where':{'id':_0x10d4d0[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x142fd1,null))[_0x0fcf('0x26')](function(_0x2a0ba3){if(_0x2a0ba3){return _0x2a0ba3[_0x0fcf('0xa7')](_0x10d4d0['body'][_0x0fcf('0xa8')],_['omit'](_0x10d4d0['body'],[_0x0fcf('0xa8'),'id'])||{});}})['then'](respondWithResult(_0x142fd1,null))['catch'](handleError(_0x142fd1,null));};exports['getMessages']=function(_0x22c9d9,_0x33cd4f,_0x3d7267){var _0x1e43af={'raw':![],'where':{}};var _0x1169f5={};var _0x17486b={'count':0x0,'rows':[]};return db[_0x0fcf('0x9f')][_0x0fcf('0xa9')]({'where':{'id':_0x22c9d9[_0x0fcf('0x9e')]['id']}})['then'](handleEntityNotFound(_0x33cd4f,null))[_0x0fcf('0x26')](function(_0x2f14a3){if(_0x2f14a3){_0x1169f5[_0x0fcf('0x2f')]=_[_0x0fcf('0x31')](db[_0x0fcf('0xa6')][_0x0fcf('0x2e')]);_0x1169f5['query']=_[_0x0fcf('0x31')](_0x22c9d9[_0x0fcf('0x30')]);_0x1169f5[_0x0fcf('0x32')]=_[_0x0fcf('0x33')](_0x1169f5[_0x0fcf('0x2f')],_0x1169f5['query']);_0x1e43af[_0x0fcf('0x34')]=_[_0x0fcf('0x33')](_0x1169f5[_0x0fcf('0x2f')],qs[_0x0fcf('0x35')](_0x22c9d9[_0x0fcf('0x30')]['fields']));_0x1e43af[_0x0fcf('0x34')]=_0x1e43af[_0x0fcf('0x34')][_0x0fcf('0x36')]?_0x1e43af[_0x0fcf('0x34')]:_0x1169f5['model'];if(!_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x37')](_0x0fcf('0x38'))){_0x1e43af['limit']=qs['limit'](_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x20')]);_0x1e43af[_0x0fcf('0x1f')]=qs[_0x0fcf('0x1f')](_0x22c9d9[_0x0fcf('0x30')]['offset']);}_0x1e43af[_0x0fcf('0x76')]=qs[_0x0fcf('0x39')](_0x22c9d9[_0x0fcf('0x30')]['sort']);_0x1e43af[_0x0fcf('0x3a')]=qs[_0x0fcf('0x32')](_['pick'](_0x22c9d9[_0x0fcf('0x30')],_0x1169f5[_0x0fcf('0x32')]));_0x1e43af[_0x0fcf('0x3a')][_0x0fcf('0x98')]=_0x2f14a3['id'];if(_0x22c9d9[_0x0fcf('0x30')]['filter']){_0x1e43af[_0x0fcf('0x3a')]=_['merge'](_0x1e43af[_0x0fcf('0x3a')],{'$or':_['map'](_0x1e43af['attributes'],function(_0x24eb94){var _0x302d0a={};_0x302d0a[_0x24eb94]={'$like':'%'+_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6f')]+'%'};return _0x302d0a;})});}if(_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6d')]){var _0x3753b6=_0x22c9d9[_0x0fcf('0x30')][_0x0fcf('0x6d')]['split'](',');var _0x1e805c={};_0x1e805c[_0x3753b6[0x0]]={'$gte':moment(_0x3753b6[0x1])[_0x0fcf('0x53')](_0x0fcf('0xaa'))};_0x1e43af[_0x0fcf('0x3a')]=_[_0x0fcf('0x8c')](_0x1e43af[_0x0fcf('0x3a')],_0x1e805c);}_0x1e43af=_[_0x0fcf('0x8c')]({},_0x1e43af,_0x22c9d9['options']);return db[_0x0fcf('0xa6')][_0x0fcf('0x1e')]({'where':_0x1e43af['where']})[_0x0fcf('0x26')](function(_0x59ef9e){_0x17486b[_0x0fcf('0x1e')]=_0x59ef9e;if(_0x22c9d9['query'][_0x0fcf('0xab')]){_0x1e43af[_0x0fcf('0xa0')]=[{'all':!![]}];}return db[_0x0fcf('0xa6')][_0x0fcf('0xac')](_0x1e43af);})[_0x0fcf('0x26')](function(_0x291b94){_0x17486b['rows']=_0x291b94;return _0x17486b;});}})[_0x0fcf('0x26')](respondWithFilteredResult(_0x33cd4f,_0x1e43af))[_0x0fcf('0x9c')](handleError(_0x33cd4f,null));};exports[_0x0fcf('0xad')]=function(_0x4310fd,_0x142a45,_0x4cf71e){return db['SmsInteraction'][_0x0fcf('0xa2')]({'where':{'id':_0x4310fd[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x142a45,null))[_0x0fcf('0x26')](function(_0x3c24a7){if(_0x3c24a7){return _0x3c24a7['setTags'](_0x4310fd[_0x0fcf('0xa4')][_0x0fcf('0xa8')],_['omit'](_0x4310fd['body'],[_0x0fcf('0xa8'),'id'])||{})[_0x0fcf('0xae')](function(){return db[_0x0fcf('0xaf')][_0x0fcf('0xac')]({'attributes':['id',_0x0fcf('0x2b'),_0x0fcf('0xb0')],'where':{'id':_0x4310fd[_0x0fcf('0xa4')][_0x0fcf('0xa8')]}});})[_0x0fcf('0x26')](function(_0x1a8991){socket[_0x0fcf('0xb1')](_0x0fcf('0xb2'),{'id':Number(_0x4310fd[_0x0fcf('0x9e')]['id']),'tags':_0x1a8991||[]});return{'id':Number(_0x4310fd[_0x0fcf('0x9e')]['id']),'tags':_0x1a8991||[]};});}})[_0x0fcf('0x26')](respondWithResult(_0x142a45,null))[_0x0fcf('0x9c')](handleError(_0x142a45,null));};exports['removeTags']=function(_0x5da695,_0x427c18,_0x29d642){return db[_0x0fcf('0x9f')][_0x0fcf('0xa2')]({'where':{'id':_0x5da695[_0x0fcf('0x9e')]['id']}})[_0x0fcf('0x26')](handleEntityNotFound(_0x427c18,null))['then'](function(_0x16b1e2){if(_0x16b1e2){return _0x16b1e2['removeTags'](_0x5da695[_0x0fcf('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x427c18,null))[_0x0fcf('0x9c')](handleError(_0x427c18,null));};exports[_0x0fcf('0xb3')]=function(_0xe72342,_0x5a5b50){var _0x5beacc=moment()[_0x0fcf('0xb4')]()[_0x0fcf('0x74')]();var _0x111178=path[_0x0fcf('0xb5')](config[_0x0fcf('0xb6')],'server',_0x0fcf('0xb7'),_0x0fcf('0xb8'));var _0x1a64e8=path[_0x0fcf('0xb5')](config[_0x0fcf('0xb6')],_0x0fcf('0xb9'),_0x0fcf('0xb7'),_0x0fcf('0xba'));var _0x1ec4d4=path[_0x0fcf('0xb5')](_0x111178,_0x5beacc);var _0x28b94f=util[_0x0fcf('0x53')](_0x0fcf('0xbb'),_0xe72342[_0x0fcf('0x9e')]['id'],_0x5beacc);var _0x36dd2e=path[_0x0fcf('0xb5')](_0x111178,_0x28b94f);var _0x4e80c7=![];return db['SmsInteraction']['find']({'where':{'id':_0xe72342[_0x0fcf('0x9e')]['id']},'include':[{'model':db['SmsMessage'],'as':_0x0fcf('0xbc'),'attributes':['id',_0x0fcf('0xa4'),'createdAt',_0x0fcf('0xbd'),'secret'],'include':[{'model':db[_0x0fcf('0xbe')],'as':'User','attributes':['id',_0x0fcf('0xbf')],'raw':!![]},{'model':db[_0x0fcf('0xc0')],'as':_0x0fcf('0xc1'),'attributes':['id',_0x0fcf('0xc2'),_0x0fcf('0xc3')],'raw':!![]}]},{'model':db[_0x0fcf('0xc4')],'as':'Account','attributes':['id',_0x0fcf('0x2b')]},{'model':db[_0x0fcf('0xbe')],'as':'Owner','attributes':['id',_0x0fcf('0xbf')]}]})['then'](handleEntityNotFound(_0x5a5b50,null))['then'](function(_0x205af2){if(_0x205af2){var _0x6c9166=_0x205af2[_0x0fcf('0xc5')]({'plain':!![]});_0x4e80c7=!![];var _0x3eec37={'format':'A4','border':_0x0fcf('0xc6'),'header':{'height':_0x0fcf('0xc7'),'contents':{'first':_0x0fcf('0xc8')}},'footer':{'height':_0x0fcf('0xc9'),'contents':{'default':util['format'](_0x0fcf('0xca'),util[_0x0fcf('0x53')](_0x0fcf('0xcb'),_0x0fcf('0xcc'),_0x6c9166['id']),moment()['format']('YYYY-MM-DD')[_0x0fcf('0x74')]())}}};fs[_0x0fcf('0xcd')](_0x1ec4d4);var _0x119aea={'channel':_0x0fcf('0xcc'),'account':_0x6c9166[_0x0fcf('0xce')]['name'],'agent':_0x6c9166['Owner']?_0x6c9166[_0x0fcf('0xcf')][_0x0fcf('0xbf')]:_0x0fcf('0xd0'),'createdAt':moment(_0x6c9166[_0x0fcf('0x6c')])['format'](_0x0fcf('0xaa'))[_0x0fcf('0x74')](),'closedAt':_0x6c9166['closed']?moment(_0x6c9166[_0x0fcf('0xd1')])[_0x0fcf('0x53')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0fcf('0x74')]():'','disposition':_0x6c9166[_0x0fcf('0xd2')],'messages':_(_0x6c9166[_0x0fcf('0xbc')])[_0x0fcf('0x6f')]({'secret':![]})[_0x0fcf('0x67')](function(_0x3e6783){return{'date':moment(_0x3e6783[_0x0fcf('0x6c')])['format'](_0x0fcf('0xaa'))[_0x0fcf('0x74')](),'sender':_0x3e6783[_0x0fcf('0xbd')]==='out'?_0x3e6783[_0x0fcf('0xbe')]?_0x3e6783[_0x0fcf('0xbe')][_0x0fcf('0xbf')]:_0x0fcf('0xd3'):_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc2')]+(_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc3')]?'\x20'+_0x3e6783[_0x0fcf('0xc1')][_0x0fcf('0xc3')]:''),'body':_0x3e6783[_0x0fcf('0xa4')],'direction':_0x3e6783['direction']===_0x0fcf('0xd4')?'A':'C','secret':_0x3e6783['secret']};})[_0x0fcf('0x50')]()};return ejs[_0x0fcf('0xd5')](path[_0x0fcf('0xb5')](config['root'],_0x0fcf('0xb9'),'views',_0x0fcf('0xd6')),{'interaction':_0x119aea})['then'](function(_0x1e8a19){return new BPromise(function(_0x1ead7e,_0x56bbcd){pdf[_0x0fcf('0xa3')](_0x1e8a19,_0x3eec37)['toFile'](path[_0x0fcf('0xb5')](_0x1ec4d4,_0x0fcf('0xd7')+_0x6c9166['id']+'-'+_0x5beacc+_0x0fcf('0xd8')),function(_0x5c2961,_0x467f82){if(_0x5c2961)return _0x56bbcd(_0x5c2961);_0x1ead7e(_0x467f82);});});});}})['then'](function(){if(_0x4e80c7){return new BPromise(function(_0x37f0dd,_0x46fafb){zipdir(_0x1ec4d4,{'saveTo':_0x36dd2e},function(_0x38de26,_0x371be6){if(_0x38de26)return _0x46fafb(_0x38de26);return _0x37f0dd(_0x371be6);});})[_0x0fcf('0x26')](function(){return new BPromise(function(_0x394831,_0x1ac087){rimraf(_0x1ec4d4,function(_0x3a6ae0){if(_0x3a6ae0)_0x1ac087(_0x3a6ae0);return _0x394831();});});})[_0x0fcf('0x26')](function(){return _0x5a5b50[_0x0fcf('0xb3')](_0x36dd2e,_0x28b94f,function(_0x4d8911){if(_0x4d8911){console[_0x0fcf('0xd9')](_0x0fcf('0xda'),_0x4d8911);}else{fs[_0x0fcf('0xdb')](_0x36dd2e);}});});}else{return _0x5a5b50[_0x0fcf('0x1c')](0xc8);}})['catch'](handleError(_0x5a5b50,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 95e1610..0251646 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 _0xa644=['../../mysqldb','setMaxListeners','update','emit','hook','events'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xa644,0x15b));var _0x4a64=function(_0x4111c4,_0x4351d6){_0x4111c4=_0x4111c4-0x0;var _0x2877f3=_0xa644[_0x4111c4];return _0x2877f3;};'use strict';var EventEmitter=require(_0x4a64('0x0'));var SmsInteraction=require(_0x4a64('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4a64('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a64('0x3'),'afterDestroy':'remove'};function emitEvent(_0xb913a5){return function(_0x292ba6,_0x236018,_0xa2deb9){SmsInteractionEvents[_0x4a64('0x4')](_0xb913a5+':'+_0x292ba6['id'],_0x292ba6);SmsInteractionEvents[_0x4a64('0x4')](_0xb913a5,_0x292ba6);_0xa2deb9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4a64('0x5')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xdc4e=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5cca33,_0x1a1607){var _0x1fbc89=function(_0x22312e){while(--_0x22312e){_0x5cca33['push'](_0x5cca33['shift']());}};_0x1fbc89(++_0x1a1607);}(_0xdc4e,0x1cd));var _0xedc4=function(_0x1b46fb,_0x57ba0a){_0x1b46fb=_0x1b46fb-0x0;var _0x15b9c6=_0xdc4e[_0x1b46fb];return _0x15b9c6;};'use strict';var EventEmitter=require(_0xedc4('0x0'));var SmsInteraction=require(_0xedc4('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xedc4('0x2')](0x0);var events={'afterCreate':_0xedc4('0x3'),'afterUpdate':'update','afterDestroy':_0xedc4('0x4')};function emitEvent(_0x4cbaf2){return function(_0x1c8d8c,_0x3e4cbc,_0x13f464){SmsInteractionEvents[_0xedc4('0x5')](_0x4cbaf2+':'+_0x1c8d8c['id'],_0x1c8d8c);SmsInteractionEvents['emit'](_0x4cbaf2,_0x1c8d8c);_0x13f464(null);};}for(var e in events){if(events[_0xedc4('0x6')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xedc4('0x7')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index daeacbc..0f5ea42 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 _0x2bad=['rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise'];(function(_0x11d12c,_0x2fa186){var _0x5d53ac=function(_0x443513){while(--_0x443513){_0x11d12c['push'](_0x11d12c['shift']());}};_0x5d53ac(++_0x2fa186);}(_0x2bad,0xb1));var _0xd2ba=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0x2bad[_0x19faae];return _0x363543;};'use strict';var _=require('lodash');var util=require(_0xd2ba('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd2ba('0x1'));var BPromise=require('bluebird');var rp=require(_0xd2ba('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2ba('0x3'));var config=require(_0xd2ba('0x4'));var attributes=require(_0xd2ba('0x5'));module['exports']=function(_0xd31c03,_0x55effd){return _0xd31c03['define'](_0xd2ba('0x6'),attributes,{'tableName':_0xd2ba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cbe5b,_0x4b57f0,_0x47b179){if(_0x3cbe5b[_0xd2ba('0x8')]('closed')){_0x3cbe5b[_0xd2ba('0x9')]=moment()[_0xd2ba('0xa')](_0xd2ba('0xb'));}_0x47b179(null,_0x3cbe5b);}}});}; \ No newline at end of file +var _0x6931=['changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x225ea2,_0x1cf40c){var _0x1247bf=function(_0x406658){while(--_0x406658){_0x225ea2['push'](_0x225ea2['shift']());}};_0x1247bf(++_0x1cf40c);}(_0x6931,0xb7));var _0x1693=function(_0x4c35a8,_0xb4be1c){_0x4c35a8=_0x4c35a8-0x0;var _0x402d59=_0x6931[_0x4c35a8];return _0x402d59;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var logger=require(_0x1693('0x2'))(_0x1693('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1693('0x4'));var fs=require('fs');var path=require(_0x1693('0x5'));var rimraf=require(_0x1693('0x6'));var config=require(_0x1693('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0xf9873c,_0x3b8a78){return _0xf9873c[_0x1693('0x8')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25ed0b,_0x5096c3,_0x506091){if(_0x25ed0b[_0x1693('0x9')]('closed')){_0x25ed0b['closedAt']=moment()[_0x1693('0xa')](_0x1693('0xb'));}_0x506091(null,_0x25ed0b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 3487cf1..5ef77b8 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 _0x1405=['update','body','options','limit','then','info','AddTagsToSmsInteraction','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1405,0x7f));var _0x5140=function(_0x28d773,_0x132cce){_0x28d773=_0x28d773-0x0;var _0xb28fc0=_0x1405[_0x28d773];return _0xb28fc0;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var moment=require(_0x5140('0x2'));var BPromise=require('bluebird');var rs=require(_0x5140('0x3'));var fs=require('fs');var Redis=require(_0x5140('0x4'));var db=require(_0x5140('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5140('0x6'))(_0x5140('0x7'));var config=require(_0x5140('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5140('0x9')][_0x5140('0xa')]({'port':0x232a});config[_0x5140('0xb')]=_[_0x5140('0xc')](config['redis'],{'host':_0x5140('0xd'),'port':0x18eb});var socket=require(_0x5140('0xe'))(new Redis(config[_0x5140('0xb')]));require(_0x5140('0xf'))[_0x5140('0x10')](socket);function respondWithRpcPromise(_0x467323,_0x5c7d56,_0x4c82c6){return new BPromise(function(_0x3c2c9e,_0x42edee){return client[_0x5140('0x11')](_0x467323,_0x4c82c6)['then'](function(_0x3fa967){logger['info'](_0x5140('0x12'),_0x5c7d56,_0x5140('0x13'));logger[_0x5140('0x14')](_0x5140('0x15'),_0x5c7d56,_0x5140('0x13'),JSON[_0x5140('0x16')](_0x3fa967));if(_0x3fa967[_0x5140('0x17')]){if(_0x3fa967[_0x5140('0x17')]['code']===0x1f4){logger[_0x5140('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x5c7d56,_0x3fa967['error'][_0x5140('0x18')]);return _0x42edee(_0x3fa967[_0x5140('0x17')][_0x5140('0x18')]);}logger[_0x5140('0x17')](_0x5140('0x12'),_0x5c7d56,_0x3fa967[_0x5140('0x17')][_0x5140('0x18')]);return _0x3c2c9e(_0x3fa967['error'][_0x5140('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5c7d56,_0x5140('0x13'));_0x3c2c9e(_0x3fa967[_0x5140('0x19')][_0x5140('0x18')]);}})[_0x5140('0x1a')](function(_0x3afb38){logger[_0x5140('0x17')](_0x5140('0x12'),_0x5c7d56,_0x3afb38);_0x42edee(_0x3afb38);});});}exports[_0x5140('0x1b')]=function(_0x2326ae){var _0x900d98=this;return new Promise(function(_0x463841,_0x147fe1){return db[_0x5140('0x1c')][_0x5140('0x1d')](_0x2326ae[_0x5140('0x1e')],{'raw':_0x2326ae[_0x5140('0x1f')]?_0x2326ae['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2326ae[_0x5140('0x1f')]?_0x2326ae[_0x5140('0x1f')]['where']||null:null,'attributes':_0x2326ae['options']?_0x2326ae['options']['attributes']||null:null,'limit':_0x2326ae[_0x5140('0x1f')]?_0x2326ae[_0x5140('0x1f')][_0x5140('0x20')]||null:null})[_0x5140('0x21')](function(_0x146508){logger[_0x5140('0x22')](_0x5140('0x1b'),_0x2326ae);logger[_0x5140('0x14')](_0x5140('0x1b'),_0x2326ae,JSON['stringify'](_0x146508));_0x463841(_0x146508);})[_0x5140('0x1a')](function(_0x650073){logger['error'](_0x5140('0x1b'),_0x650073[_0x5140('0x18')],_0x2326ae);_0x147fe1(_0x900d98[_0x5140('0x17')](0x1f4,_0x650073[_0x5140('0x18')]));});});};exports[_0x5140('0x23')]=function(_0x3fc1d2){return new Promise(function(_0x31fa1e,_0x35d974){return db[_0x5140('0x1c')]['find']({'where':_0x3fc1d2['options']?_0x3fc1d2[_0x5140('0x1f')]['where']||null:null})[_0x5140('0x21')](function(_0x22c872){if(_0x22c872){return _0x22c872['addTags'](_0x3fc1d2['body'][_0x5140('0x24')],_[_0x5140('0x25')](_0x3fc1d2[_0x5140('0x1e')],[_0x5140('0x24'),'id'])||{});}})['spread'](function(_0xf62fec){logger[_0x5140('0x22')](_0x5140('0x26'),_0x3fc1d2);logger[_0x5140('0x14')](_0x5140('0x26'),_0x3fc1d2,JSON[_0x5140('0x16')](_0xf62fec));_0x31fa1e(_0xf62fec);})[_0x5140('0x1a')](function(_0x2f2b97){logger[_0x5140('0x17')]('AddTags',_0x2f2b97[_0x5140('0x18')],_0x3fc1d2);_0x35d974(_this[_0x5140('0x17')](0x1f4,_0x2f2b97[_0x5140('0x18')]));});});}; \ No newline at end of file +var _0xf05c=['client','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsInteraction','update','options','attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','where','addTags','body','omit','ids','AddTags','lodash','util','ioredis','rpc','../../config/environment'];(function(_0x5578c0,_0x4f9a4d){var _0x24ae5d=function(_0x2c004a){while(--_0x2c004a){_0x5578c0['push'](_0x5578c0['shift']());}};_0x24ae5d(++_0x4f9a4d);}(_0xf05c,0x12d));var _0xcf05=function(_0x204a46,_0x428ae9){_0x204a46=_0x204a46-0x0;var _0xcd8d81=_0xf05c[_0x204a46];return _0xcd8d81;};'use strict';var _=require(_0xcf05('0x0'));var util=require(_0xcf05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf05('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcf05('0x3'));var config=require(_0xcf05('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xcf05('0x5')][_0xcf05('0x6')]({'port':0x232a});config[_0xcf05('0x7')]=_[_0xcf05('0x8')](config[_0xcf05('0x7')],{'host':_0xcf05('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf05('0xa'))['register'](socket);function respondWithRpcPromise(_0x4b3426,_0x3b4826,_0x31188d){return new BPromise(function(_0x8bbcf2,_0x2a86e9){return client[_0xcf05('0xb')](_0x4b3426,_0x31188d)[_0xcf05('0xc')](function(_0x27244a){logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x3b4826,_0xcf05('0xf'));logger[_0xcf05('0x10')](_0xcf05('0x11'),_0x3b4826,_0xcf05('0xf'),JSON[_0xcf05('0x12')](_0x27244a));if(_0x27244a['error']){if(_0x27244a[_0xcf05('0x13')]['code']===0x1f4){logger[_0xcf05('0x13')](_0xcf05('0xe'),_0x3b4826,_0x27244a['error'][_0xcf05('0x14')]);return _0x2a86e9(_0x27244a[_0xcf05('0x13')][_0xcf05('0x14')]);}logger[_0xcf05('0x13')](_0xcf05('0xe'),_0x3b4826,_0x27244a['error'][_0xcf05('0x14')]);return _0x8bbcf2(_0x27244a[_0xcf05('0x13')]['message']);}else{logger[_0xcf05('0xd')](_0xcf05('0xe'),_0x3b4826,'request\x20sent');_0x8bbcf2(_0x27244a['result']['message']);}})[_0xcf05('0x15')](function(_0x35d971){logger['error'](_0xcf05('0xe'),_0x3b4826,_0x35d971);_0x2a86e9(_0x35d971);});});}exports['UpdateSmsInteraction']=function(_0x4a4c9f){var _0x242192=this;return new Promise(function(_0x169901,_0x17cb0d){return db[_0xcf05('0x16')][_0xcf05('0x17')](_0x4a4c9f['body'],{'raw':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f['options']['where']||null:null,'attributes':_0x4a4c9f[_0xcf05('0x18')]?_0x4a4c9f[_0xcf05('0x18')][_0xcf05('0x19')]||null:null,'limit':_0x4a4c9f['options']?_0x4a4c9f[_0xcf05('0x18')]['limit']||null:null})[_0xcf05('0xc')](function(_0x4abbf7){logger[_0xcf05('0xd')](_0xcf05('0x1a'),_0x4a4c9f);logger[_0xcf05('0x10')](_0xcf05('0x1a'),_0x4a4c9f,JSON[_0xcf05('0x12')](_0x4abbf7));_0x169901(_0x4abbf7);})[_0xcf05('0x15')](function(_0x5f3ee2){logger[_0xcf05('0x13')](_0xcf05('0x1a'),_0x5f3ee2[_0xcf05('0x14')],_0x4a4c9f);_0x17cb0d(_0x242192[_0xcf05('0x13')](0x1f4,_0x5f3ee2[_0xcf05('0x14')]));});});};exports[_0xcf05('0x1b')]=function(_0x2c404a){return new Promise(function(_0x25756d,_0x5005a9){return db[_0xcf05('0x16')]['find']({'where':_0x2c404a['options']?_0x2c404a[_0xcf05('0x18')][_0xcf05('0x1c')]||null:null})[_0xcf05('0xc')](function(_0x3ba32f){if(_0x3ba32f){return _0x3ba32f[_0xcf05('0x1d')](_0x2c404a[_0xcf05('0x1e')]['ids'],_[_0xcf05('0x1f')](_0x2c404a[_0xcf05('0x1e')],[_0xcf05('0x20'),'id'])||{});}})['spread'](function(_0x13a3c4){logger['info'](_0xcf05('0x21'),_0x2c404a);logger[_0xcf05('0x10')](_0xcf05('0x21'),_0x2c404a,JSON['stringify'](_0x13a3c4));_0x25756d(_0x13a3c4);})[_0xcf05('0x15')](function(_0x58e14e){logger['error'](_0xcf05('0x21'),_0x58e14e['message'],_0x2c404a);_0x5005a9(_this['error'](0x1f4,_0x58e14e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a004412..a27303b 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 _0x61b1=['./smsInteraction.events','save','remove','update','removeListener','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61b1,0x1b0));var _0x161b=function(_0x585180,_0x32b440){_0x585180=_0x585180-0x0;var _0x1946df=_0x61b1[_0x585180];return _0x1946df;};'use strict';var SmsInteractionEvents=require(_0x161b('0x0'));var events=[_0x161b('0x1'),_0x161b('0x2'),_0x161b('0x3')];function createListener(_0x189691,_0x5b6e31){return function(_0x34e3b7){_0x5b6e31['emit'](_0x189691,_0x34e3b7);};}function removeListener(_0x26b38f,_0x3480a4){return function(){SmsInteractionEvents[_0x161b('0x4')](_0x26b38f,_0x3480a4);};}exports['register']=function(_0x53ecdc){for(var _0x3f2f24=0x0,_0x449a77=events[_0x161b('0x5')];_0x3f2f24<_0x449a77;_0x3f2f24++){var _0x5a8bcd=events[_0x3f2f24];var _0x105ef7=createListener('smsInteraction:'+_0x5a8bcd,_0x53ecdc);SmsInteractionEvents['on'](_0x5a8bcd,_0x105ef7);}}; \ No newline at end of file +var _0x1bd7=['update','emit','removeListener','length','smsInteraction:','./smsInteraction.events','remove'];(function(_0x3daa9d,_0x4d5b17){var _0x348d4b=function(_0x564e6e){while(--_0x564e6e){_0x3daa9d['push'](_0x3daa9d['shift']());}};_0x348d4b(++_0x4d5b17);}(_0x1bd7,0x9f));var _0x71bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bd7[_0x2641f9];return _0x585741;};'use strict';var SmsInteractionEvents=require(_0x71bd('0x0'));var events=['save',_0x71bd('0x1'),_0x71bd('0x2')];function createListener(_0x579d1d,_0x31ed57){return function(_0x40a50c){_0x31ed57[_0x71bd('0x3')](_0x579d1d,_0x40a50c);};}function removeListener(_0x22d4f2,_0x2c0dee){return function(){SmsInteractionEvents[_0x71bd('0x4')](_0x22d4f2,_0x2c0dee);};}exports['register']=function(_0x133e0b){for(var _0x36c67d=0x0,_0x12d94e=events[_0x71bd('0x5')];_0x36c67d<_0x12d94e;_0x36c67d++){var _0x496ab9=events[_0x36c67d];var _0x30f53c=createListener(_0x71bd('0x6')+_0x496ab9,_0x133e0b);SmsInteractionEvents['on'](_0x496ab9,_0x30f53c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 647e6fc..2182f29 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 _0x93b5=['get','/describe','isAuthenticated','describe','post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','reject','delete','/:id','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x93b5,0x178));var _0x593b=function(_0x495770,_0x3fee46){_0x495770=_0x495770-0x0;var _0x59c454=_0x93b5[_0x495770];return _0x59c454;};'use strict';var multer=require(_0x593b('0x0'));var util=require(_0x593b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x593b('0x2'));var router=express[_0x593b('0x3')]();var auth=require(_0x593b('0x4'));var interaction=require(_0x593b('0x5'));var config=require('../../config/environment');var controller=require(_0x593b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x593b('0x7')]);router[_0x593b('0x8')](_0x593b('0x9'),auth[_0x593b('0xa')](),controller[_0x593b('0xb')]);router['get']('/:id',auth[_0x593b('0xa')](),controller['show']);router[_0x593b('0xc')]('/',auth[_0x593b('0xa')](),interaction[_0x593b('0xd')](_0x593b('0xe'),_0x593b('0xf')),controller['create']);router[_0x593b('0xc')]('/:id/status',controller[_0x593b('0x10')]);router[_0x593b('0x11')]('/:id',auth[_0x593b('0xa')](),controller[_0x593b('0x12')]);router[_0x593b('0x11')](_0x593b('0x13'),auth[_0x593b('0xa')](),controller['accept']);router[_0x593b('0x11')]('/:id/reject',auth[_0x593b('0xa')](),controller[_0x593b('0x14')]);router[_0x593b('0x15')](_0x593b('0x16'),auth[_0x593b('0xa')](),controller['destroy']);module[_0x593b('0x17')]=router; \ No newline at end of file +var _0x6d47=['post','tracked','create','status','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1c9b46,_0x507d41){var _0x2d199c=function(_0x4740a8){while(--_0x4740a8){_0x1c9b46['push'](_0x1c9b46['shift']());}};_0x2d199c(++_0x507d41);}(_0x6d47,0x98));var _0x76d4=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x6d47[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x76d4('0x0'));var util=require(_0x76d4('0x1'));var path=require(_0x76d4('0x2'));var timeout=require(_0x76d4('0x3'));var express=require(_0x76d4('0x4'));var router=express[_0x76d4('0x5')]();var auth=require(_0x76d4('0x6'));var interaction=require(_0x76d4('0x7'));var config=require('../../config/environment');var controller=require(_0x76d4('0x8'));router[_0x76d4('0x9')]('/',auth[_0x76d4('0xa')](),controller[_0x76d4('0xb')]);router[_0x76d4('0x9')](_0x76d4('0xc'),auth[_0x76d4('0xa')](),controller[_0x76d4('0xd')]);router[_0x76d4('0x9')](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0xf')]);router[_0x76d4('0x10')]('/',auth[_0x76d4('0xa')](),interaction[_0x76d4('0x11')]('sms','smsmessage:create'),controller[_0x76d4('0x12')]);router[_0x76d4('0x10')]('/:id/status',controller[_0x76d4('0x13')]);router['put'](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x14')]);router[_0x76d4('0x15')]('/:id/accept',auth[_0x76d4('0xa')](),controller[_0x76d4('0x16')]);router['put'](_0x76d4('0x17'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x18')]);router[_0x76d4('0x19')](_0x76d4('0xe'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x1a')]);module[_0x76d4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 1503e94..94105b8 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 _0x9576=['DATE','BOOLEAN','sequelize','exports','TEXT','medium','out','STRING'];(function(_0x146982,_0x2e890d){var _0x4bc3d4=function(_0x13e8d4){while(--_0x13e8d4){_0x146982['push'](_0x146982['shift']());}};_0x4bc3d4(++_0x2e890d);}(_0x9576,0x182));var _0x6957=function(_0x19e73a,_0x38a3c6){_0x19e73a=_0x19e73a-0x0;var _0x55b7e9=_0x9576[_0x19e73a];return _0x55b7e9;};'use strict';var Sequelize=require(_0x6957('0x0'));module[_0x6957('0x1')]={'body':{'type':Sequelize[_0x6957('0x2')](_0x6957('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6957('0x4')),'defaultValue':_0x6957('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6957('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6957('0x5')]},'readAt':{'type':Sequelize[_0x6957('0x6')]},'secret':{'type':Sequelize[_0x6957('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x737d=['DATE','BOOLEAN','sequelize','exports','out','STRING'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x737d,0xbc));var _0xd737=function(_0x46eb1a,_0x2ec67e){_0x46eb1a=_0x46eb1a-0x0;var _0x4ddb9f=_0x737d[_0x46eb1a];return _0x4ddb9f;};'use strict';var Sequelize=require(_0xd737('0x0'));module[_0xd737('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd737('0x2')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd737('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd737('0x4')]},'secret':{'type':Sequelize[_0xd737('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3d040db..eba6b87 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 _0xd8fb=['sms-interactions','sms','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','event','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','update','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','indexOf','sent','delivered','plivio','infobip','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','offset','limit','json','apply','reject','save','sendStatus','stack','name','send','index','SmsMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','interface','channel','EventManager','acceptmessage'];(function(_0x1c4205,_0x4cacf2){var _0x1c2598=function(_0x1df2c4){while(--_0x1df2c4){_0x1c4205['push'](_0x1c4205['shift']());}};_0x1c2598(++_0x4cacf2);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5e4531,_0x1ee689){_0x5e4531=_0x5e4531-0x0;var _0x741336=_0xd8fb[_0x5e4531];return _0x741336;};'use strict';var pdf=require(_0xbd8f('0x0'));var emlformat=require(_0xbd8f('0x1'));var rimraf=require(_0xbd8f('0x2'));var zipdir=require(_0xbd8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd8f('0x4'));var Mustache=require(_0xbd8f('0x5'));var util=require('util');var path=require(_0xbd8f('0x6'));var sox=require(_0xbd8f('0x7'));var csv=require('to-csv');var ejs=require(_0xbd8f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbd8f('0xf'));var logger=require(_0xbd8f('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbd8f('0x11'));var db=require(_0xbd8f('0x12'))['db'];config[_0xbd8f('0x13')]=_['defaults'](config[_0xbd8f('0x13')],{'host':_0xbd8f('0x14'),'port':0x18eb});var socket=require(_0xbd8f('0x15'))(new Redis(config[_0xbd8f('0x13')]));require(_0xbd8f('0x16'))[_0xbd8f('0x17')](socket);var jayson=require(_0xbd8f('0x18'));var client=jayson[_0xbd8f('0x19')][_0xbd8f('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xbd8f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x829fb2,_0xa57e91,_0x10d72e){if(_0x10d72e){var _0x4da96f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4da96f[_0xbd8f('0x1b')](_0xa57e91)){return _0x829fb2;}else{throw new Error(_0xbd8f('0x1c'));}}else{return _0x829fb2;}}function respondWithRpcPromise(_0x5ebf8b,_0x15be97,_0xf5e7a,_0x504adb){return new BPromise(function(_0x4435b9,_0x36a6af){var _0x47d317=_0x504adb||client;return _0x47d317['request'](_0x5ebf8b,_0xf5e7a)[_0xbd8f('0x1d')](function(_0x5d2fdb){logger['info'](_0xbd8f('0x1e'),_0x15be97,'request\x20sent');logger[_0xbd8f('0x1f')](_0xbd8f('0x20'),_0x15be97,_0xbd8f('0x21'),JSON[_0xbd8f('0x22')](_0x5d2fdb));if(_0x5d2fdb[_0xbd8f('0x23')]){if(_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x24')]===0x1f4){logger[_0xbd8f('0x23')](_0xbd8f('0x1e'),_0x15be97,_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);return _0x36a6af(_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);}logger[_0xbd8f('0x23')](_0xbd8f('0x1e'),_0x15be97,_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);return _0x4435b9(_0x5d2fdb['error'][_0xbd8f('0x25')]);}else{logger[_0xbd8f('0x26')](_0xbd8f('0x1e'),_0x15be97,_0xbd8f('0x21'));_0x4435b9(_0x5d2fdb[_0xbd8f('0x27')][_0xbd8f('0x25')]);}})[_0xbd8f('0x28')](function(_0x264e62){logger['error'](_0xbd8f('0x1e'),_0x15be97,_0x264e62);_0x36a6af(_0x264e62);});});}function respondWithStatusCode(_0x421f3e,_0x5a3a8c){_0x5a3a8c=_0x5a3a8c||0xcc;return function(_0x339df7){if(_0x339df7){return _0x421f3e['sendStatus'](_0x5a3a8c);}return _0x421f3e[_0xbd8f('0x29')](_0x5a3a8c)[_0xbd8f('0x2a')]();};}function respondWithResult(_0x991401,_0x202126){_0x202126=_0x202126||0xc8;return function(_0x2aefa2){if(_0x2aefa2){return _0x991401[_0xbd8f('0x29')](_0x202126)['json'](_0x2aefa2);}};}function respondWithFilteredResult(_0x166de7,_0x14f3cb){return function(_0x39714d){if(_0x39714d){var _0x3ee851=_0x39714d['count'],_0x3d2e1b=_0x14f3cb[_0xbd8f('0x2b')],_0x2ac26f=_0x14f3cb[_0xbd8f('0x2b')]+_0x14f3cb[_0xbd8f('0x2c')],_0x2a4b32;if(_0x2ac26f>=_0x3ee851){_0x2ac26f=_0x3ee851;_0x2a4b32=0xc8;}else{_0x2a4b32=0xce;}_0x166de7[_0xbd8f('0x29')](_0x2a4b32);return _0x166de7['set']('Content-Range',_0x3d2e1b+'-'+_0x2ac26f+'/'+_0x3ee851)[_0xbd8f('0x2d')](_0x39714d);}return null;};}function patchUpdates(_0x3cdec2){return function(_0x2fd6f8){try{jsonpatch[_0xbd8f('0x2e')](_0x2fd6f8,_0x3cdec2,!![]);}catch(_0x57c0cc){return BPromise[_0xbd8f('0x2f')](_0x57c0cc);}return _0x2fd6f8[_0xbd8f('0x30')]();};}function saveUpdates(_0x31d7be,_0x2137ed){return function(_0x25ad9a){if(_0x25ad9a){return _0x25ad9a['update'](_0x31d7be)[_0xbd8f('0x1d')](function(_0x407785){return _0x407785;});}return null;};}function removeEntity(_0x383807,_0x3949c2){return function(_0x2df6a6){if(_0x2df6a6){return _0x2df6a6['destroy']()[_0xbd8f('0x1d')](function(){_0x383807['status'](0xcc)[_0xbd8f('0x2a')]();});}};}function handleEntityNotFound(_0x1e77c7,_0x337bc4){return function(_0x386a29){if(!_0x386a29){_0x1e77c7[_0xbd8f('0x31')](0x194);}return _0x386a29;};}function handleError(_0x1569a0,_0x4a2bc8){_0x4a2bc8=_0x4a2bc8||0x1f4;return function(_0x4bafcd){logger['error'](_0x4bafcd[_0xbd8f('0x32')]);if(_0x4bafcd[_0xbd8f('0x33')]){delete _0x4bafcd[_0xbd8f('0x33')];}_0x1569a0[_0xbd8f('0x29')](_0x4a2bc8)[_0xbd8f('0x34')](_0x4bafcd);};}exports[_0xbd8f('0x35')]=function(_0x2f5f59,_0x30c1c2){var _0x2d4882={},_0x2a6145={},_0x3d4c9a={'count':0x0,'rows':[]};var _0x339c70=db[_0xbd8f('0x36')][_0xbd8f('0x37')];_0x2a6145[_0xbd8f('0x38')]=_['keys'](_0x339c70);_0x2a6145[_0xbd8f('0x39')]=_[_0xbd8f('0x3a')](_0x2f5f59['query']);_0x2a6145[_0xbd8f('0x3b')]=_[_0xbd8f('0x3c')](_0x2a6145[_0xbd8f('0x38')],_0x2a6145['query']);_0x2d4882[_0xbd8f('0x3d')]=_['intersection'](_0x2a6145[_0xbd8f('0x38')],qs[_0xbd8f('0x3e')](_0x2f5f59[_0xbd8f('0x39')]['fields']));_0x2d4882[_0xbd8f('0x3d')]=_0x2d4882[_0xbd8f('0x3d')][_0xbd8f('0x3f')]?_0x2d4882['attributes']:_0x2a6145[_0xbd8f('0x38')];if(!_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x40')](_0xbd8f('0x41'))){_0x2d4882[_0xbd8f('0x2c')]=qs[_0xbd8f('0x2c')](_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x2c')]);_0x2d4882[_0xbd8f('0x2b')]=qs['offset'](_0x2f5f59['query'][_0xbd8f('0x2b')]);}_0x2d4882[_0xbd8f('0x42')]=qs[_0xbd8f('0x43')](_0x2f5f59[_0xbd8f('0x39')]['sort']);_0x2d4882[_0xbd8f('0x44')]=qs[_0xbd8f('0x3b')](_[_0xbd8f('0x45')](_0x2f5f59[_0xbd8f('0x39')],_0x2a6145[_0xbd8f('0x3b')]));if(_0x2f5f59['query']['filter']){_0x2d4882[_0xbd8f('0x44')]=_['merge'](_0x2d4882[_0xbd8f('0x44')],{'$or':_[_0xbd8f('0x46')](_0x339c70,function(_0xede200){if(_0xede200[_0xbd8f('0x47')][_0xbd8f('0x48')]!==_0xbd8f('0x49')){var _0x1ea49a={};_0x1ea49a[_0xede200[_0xbd8f('0x4a')]]={'$like':'%'+_0x2f5f59['query'][_0xbd8f('0x4b')]+'%'};return _0x1ea49a;}})});}_0x2d4882=_[_0xbd8f('0x4c')]({},_0x2d4882,_0x2f5f59[_0xbd8f('0x4d')]);var _0x3e564f={'where':_0x2d4882[_0xbd8f('0x44')]};return db[_0xbd8f('0x36')][_0xbd8f('0x4e')](_0x3e564f)[_0xbd8f('0x1d')](function(_0x5668b6){_0x3d4c9a[_0xbd8f('0x4e')]=_0x5668b6;if(_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x4f')]){_0x2d4882[_0xbd8f('0x50')]=[{'all':!![]}];}return db[_0xbd8f('0x36')][_0xbd8f('0x51')](_0x2d4882);})[_0xbd8f('0x1d')](function(_0x439bbd){_0x3d4c9a[_0xbd8f('0x52')]=_0x439bbd;return _0x3d4c9a;})[_0xbd8f('0x1d')](respondWithFilteredResult(_0x30c1c2,_0x2d4882))[_0xbd8f('0x28')](handleError(_0x30c1c2,null));};exports[_0xbd8f('0x53')]=function(_0x3d0ffa,_0x1457d6){var _0x467566={'raw':!![],'where':{'id':_0x3d0ffa[_0xbd8f('0x54')]['id']}},_0x21790b={};_0x21790b[_0xbd8f('0x38')]=_[_0xbd8f('0x3a')](db['SmsMessage'][_0xbd8f('0x37')]);_0x21790b[_0xbd8f('0x39')]=_[_0xbd8f('0x3a')](_0x3d0ffa[_0xbd8f('0x39')]);_0x21790b['filters']=_[_0xbd8f('0x3c')](_0x21790b['model'],_0x21790b[_0xbd8f('0x39')]);_0x467566[_0xbd8f('0x3d')]=_[_0xbd8f('0x3c')](_0x21790b[_0xbd8f('0x38')],qs['fields'](_0x3d0ffa[_0xbd8f('0x39')][_0xbd8f('0x3e')]));_0x467566[_0xbd8f('0x3d')]=_0x467566[_0xbd8f('0x3d')][_0xbd8f('0x3f')]?_0x467566[_0xbd8f('0x3d')]:_0x21790b['model'];if(_0x3d0ffa[_0xbd8f('0x39')]['includeAll']){_0x467566[_0xbd8f('0x50')]=[{'all':!![]}];}_0x467566=_[_0xbd8f('0x4c')]({},_0x467566,_0x3d0ffa[_0xbd8f('0x4d')]);return db[_0xbd8f('0x36')][_0xbd8f('0x55')](_0x467566)[_0xbd8f('0x1d')](handleEntityNotFound(_0x1457d6,null))[_0xbd8f('0x1d')](respondWithResult(_0x1457d6,null))[_0xbd8f('0x28')](handleError(_0x1457d6,null));};exports[_0xbd8f('0x56')]=function(_0x4a4247,_0xf7443b){return db['SmsMessage'][_0xbd8f('0x56')](_0x4a4247[_0xbd8f('0x57')],{})['then'](respondWithResult(_0xf7443b,0xc9))[_0xbd8f('0x28')](handleError(_0xf7443b,null));};exports['update']=function(_0x58d891,_0x5e924c){if(_0x58d891['body']['id']){delete _0x58d891[_0xbd8f('0x57')]['id'];}return db[_0xbd8f('0x36')][_0xbd8f('0x55')]({'where':{'id':_0x58d891[_0xbd8f('0x54')]['id']}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x5e924c,null))['then'](saveUpdates(_0x58d891['body'],null))[_0xbd8f('0x1d')](respondWithResult(_0x5e924c,null))[_0xbd8f('0x28')](handleError(_0x5e924c,null));};exports[_0xbd8f('0x58')]=function(_0x120b58,_0x29e20a){return db['SmsMessage'][_0xbd8f('0x55')]({'where':{'id':_0x120b58['params']['id']}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x29e20a,null))[_0xbd8f('0x1d')](removeEntity(_0x29e20a,null))[_0xbd8f('0x28')](handleError(_0x29e20a,null));};exports['describe']=function(_0x3255be,_0x1d1757){return db[_0xbd8f('0x36')][_0xbd8f('0x59')]()['then'](respondWithResult(_0x1d1757,null))['catch'](handleError(_0x1d1757,null));};var interaction_log=require(_0xbd8f('0x10'))('sms-interactions');exports[_0xbd8f('0x5a')]=function(_0x20226c,_0x33471e,_0x93452d){var _0x4a86a9={'channel':'sms'};if(_0x20226c[_0xbd8f('0x57')]['id']){delete _0x20226c[_0xbd8f('0x57')]['id'];}_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5b')]=!![];_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5c')]=moment()[_0xbd8f('0x5d')](_0xbd8f('0x5e'));_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5f')]=_0x20226c[_0xbd8f('0x57')]['UserId']||_0x20226c[_0xbd8f('0x60')]['id'];return db[_0xbd8f('0x36')][_0xbd8f('0x55')]({'where':{'id':_0x20226c[_0xbd8f('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xbd8f('0x61')],'as':_0xbd8f('0x62')}]})['then'](handleEntityNotFound(_0x33471e,null))[_0xbd8f('0x1d')](saveUpdates(_0x20226c[_0xbd8f('0x57')],null))['then'](function(_0x5e18fc){if(_0x5e18fc){_0x4a86a9[_0xbd8f('0x25')]=_0x5e18fc[_0xbd8f('0x63')]({'plain':!![]});return db[_0xbd8f('0x64')]['find']({'where':{'id':_0x5e18fc['SmsInteractionId']}});}return null;})[_0xbd8f('0x1d')](handleEntityNotFound(_0x33471e,null))['then'](function(_0x565e63){if(_0x565e63){return _0x565e63['update']({'UserId':_0x20226c['body']['UserId'],'read1stAt':_[_0xbd8f('0x65')](_0x565e63['read1stAt'])?moment()[_0xbd8f('0x5d')](_0xbd8f('0x5e')):undefined});}return null;})['then'](function(_0x1fcb28){if(_0x1fcb28){_0x4a86a9[_0xbd8f('0x66')]=_0x1fcb28[_0xbd8f('0x63')]({'plain':!![]});interaction_log[_0xbd8f('0x26')](_0xbd8f('0x67'),_0x20226c['user']['id'],_0x20226c['user'][_0xbd8f('0x33')],_0x20226c[_0xbd8f('0x60')][_0xbd8f('0x68')],_0x4a86a9[_0xbd8f('0x66')]['id'],_0x20226c[_0xbd8f('0x57')]?JSON[_0xbd8f('0x22')](_0x20226c['body']):'null');return respondWithRpcPromise(_0xbd8f('0x69'),_0xbd8f('0x6a'),_0x4a86a9);}return null;})['then'](function(_0x31ce0d){if(_0x31ce0d){if(_0x20226c[_0xbd8f('0x57')]['manual']){_0x4a86a9[_0xbd8f('0x25')][_0xbd8f('0x6b')]=util[_0xbd8f('0x5d')]('SIP/%s',_0x20226c['user'][_0xbd8f('0x33')]);_0x4a86a9[_0xbd8f('0x25')][_0xbd8f('0x6c')]=_0x4a86a9[_0xbd8f('0x6c')];_0x4a86a9[_0xbd8f('0x25')]['event']=_0xbd8f('0x5a');return respondWithRpcPromise(_0xbd8f('0x6d'),_0xbd8f('0x6d'),{'event':_0xbd8f('0x6e'),'message':_0x4a86a9[_0xbd8f('0x25')]},client9002)[_0xbd8f('0x1d')](function(){return _0x4a86a9;});}return _0x4a86a9;}return null;})[_0xbd8f('0x1d')](respondWithResult(_0x33471e,null))[_0xbd8f('0x28')](handleError(_0x33471e,null));};var interaction_log=require(_0xbd8f('0x10'))(_0xbd8f('0x6f'));exports[_0xbd8f('0x2f')]=function(_0x3d5026,_0x34eec5,_0x40fc53){var _0x3fdecd={'agent':{},'channel':_0xbd8f('0x70')};if(_0x3d5026[_0xbd8f('0x57')]['id']){delete _0x3d5026[_0xbd8f('0x57')]['id'];}_0x3d5026['body'][_0xbd8f('0x5f')]=_0x3d5026[_0xbd8f('0x57')][_0xbd8f('0x5f')]||_0x3d5026[_0xbd8f('0x60')]['id'];_0x3fdecd[_0xbd8f('0x71')]['id']=_0x3d5026[_0xbd8f('0x57')]['UserId'];return db['SmsMessage'][_0xbd8f('0x55')]({'where':{'id':_0x3d5026[_0xbd8f('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34eec5,null))[_0xbd8f('0x1d')](function(_0x4c2a24){if(_0x4c2a24){_0x3fdecd[_0xbd8f('0x25')]=_0x4c2a24[_0xbd8f('0x63')]({'plain':!![]});return db[_0xbd8f('0x64')][_0xbd8f('0x55')]({'where':{'id':_0x4c2a24['SmsInteractionId']}});}return null;})[_0xbd8f('0x1d')](handleEntityNotFound(_0x34eec5,null))[_0xbd8f('0x1d')](function(_0x84e98d){if(_0x84e98d){_0x3fdecd['interaction']=_0x84e98d[_0xbd8f('0x63')]({'plain':!![]});interaction_log[_0xbd8f('0x26')](_0xbd8f('0x72'),_0x3d5026[_0xbd8f('0x60')]['id'],_0x3d5026['user'][_0xbd8f('0x33')],_0x3d5026[_0xbd8f('0x60')][_0xbd8f('0x68')],_0x3fdecd[_0xbd8f('0x66')]['id'],_0x3d5026[_0xbd8f('0x57')]?JSON[_0xbd8f('0x22')](_0x3d5026[_0xbd8f('0x57')]):_0xbd8f('0x73'));return respondWithRpcPromise('RejectMessage',_0xbd8f('0x74'),_0x3fdecd);}return null;})['then'](function(_0x3da31b){if(_0x3da31b){_0x3da31b['message'][_0xbd8f('0x6b')]=util[_0xbd8f('0x5d')]('SIP/%s',_0x3d5026[_0xbd8f('0x60')][_0xbd8f('0x33')]);_0x3da31b[_0xbd8f('0x25')][_0xbd8f('0x6c')]=_0x3fdecd['channel'];_0x3da31b[_0xbd8f('0x25')][_0xbd8f('0x75')]=_0xbd8f('0x2f');respondWithRpcPromise(_0xbd8f('0x6d'),'EventManager',{'event':'rejectmessage','message':_0x3da31b[_0xbd8f('0x25')]},client9002);return _0x3fdecd;}return null;})[_0xbd8f('0x1d')](respondWithResult(_0x34eec5,null))[_0xbd8f('0x28')](handleError(_0x34eec5,null));};exports[_0xbd8f('0x29')]=function(_0x24a567,_0x53076d,_0xe5c73f){if(_0x24a567[_0xbd8f('0x57')]['id']){delete _0x24a567[_0xbd8f('0x57')]['id'];}var _0x11a05a;return db[_0xbd8f('0x36')]['find']({'where':{'id':_0x24a567['params']['id']}})['then'](handleEntityNotFound(_0x53076d,null))[_0xbd8f('0x1d')](function(_0x5df0e1){if(_0x5df0e1){_0x11a05a=_0x5df0e1;return db['SmsAccount']['find']({'where':{'id':_0x5df0e1[_0xbd8f('0x76')]}});}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x53076d,null))[_0xbd8f('0x1d')](function(_0x258fe3){if(_0x258fe3){logger[_0xbd8f('0x1f')](_0xbd8f('0x20'),_0xbd8f('0x29'),_0xbd8f('0x77'),_0x258fe3['type'],util[_0xbd8f('0x78')](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));switch(_0x258fe3[_0xbd8f('0x47')]){case'twilio':if(_0x24a567[_0xbd8f('0x57')][_0xbd8f('0x79')]&&_0x24a567[_0xbd8f('0x57')][_0xbd8f('0x79')]===_0x11a05a[_0xbd8f('0x7a')]){return _0x11a05a[_0xbd8f('0x7b')]({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x7d'),util['inspect'](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));}break;case _0xbd8f('0x7e'):if(_0x24a567[_0xbd8f('0x57')]['MessageUUID']&&_0x24a567[_0xbd8f('0x57')]['MessageUUID']===_0x11a05a[_0xbd8f('0x7a')]&&_[_0xbd8f('0x7f')]([_0xbd8f('0x80'),_0xbd8f('0x81')],_0x24a567[_0xbd8f('0x57')]['Status'])>=0x0){return _0x11a05a[_0xbd8f('0x7b')]({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x82'),util[_0xbd8f('0x78')](_0x24a567['body'],{'showHidden':![],'depth':null}));}break;case _0xbd8f('0x83'):var _0x314308=_0x24a567['body']['results'][0x0];if(_0x314308[_0xbd8f('0x29')]['groupName']==='DELIVERED'){return _0x11a05a['update']({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x83'),util['inspect'](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x11a05a;}})[_0xbd8f('0x1d')](respondWithResult(_0x53076d,null))['catch'](handleError(_0x53076d,null));}; \ No newline at end of file +var _0x7217=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','SmsMessage','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','show','include','find','create','body','params','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SIP/%s','channel','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','event','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','sent','delivered','Status','infobip','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash'];(function(_0x4b8412,_0x235b3d){var _0x1ed9ed=function(_0x455209){while(--_0x455209){_0x4b8412['push'](_0x4b8412['shift']());}};_0x1ed9ed(++_0x235b3d);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7721('0x14'));var logger=require(_0x7721('0x15'))(_0x7721('0x16'));var utils=require(_0x7721('0x17'));var config=require(_0x7721('0x18'));var db=require(_0x7721('0x19'))['db'];config[_0x7721('0x1a')]=_[_0x7721('0x1b')](config['redis'],{'host':_0x7721('0x1c'),'port':0x18eb});var socket=require(_0x7721('0x1d'))(new Redis(config['redis']));require(_0x7721('0x1e'))[_0x7721('0x1f')](socket);var jayson=require(_0x7721('0x20'));var client=jayson[_0x7721('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x7721('0x21')][_0x7721('0x22')]({'port':0x232a});function checkPasswordPattern(_0x534f1b,_0x4e199a,_0x4b183e){if(_0x4b183e){var _0x5ed54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ed54[_0x7721('0x23')](_0x4e199a)){return _0x534f1b;}else{throw new Error(_0x7721('0x24'));}}else{return _0x534f1b;}}function respondWithRpcPromise(_0x32550d,_0x5ed94b,_0x20f669,_0x54a838){return new BPromise(function(_0x3fc09e,_0x5cb0e6){var _0xfec626=_0x54a838||client;return _0xfec626[_0x7721('0x25')](_0x32550d,_0x20f669)[_0x7721('0x26')](function(_0x3e140d){logger[_0x7721('0x27')](_0x7721('0x28'),_0x5ed94b,_0x7721('0x29'));logger[_0x7721('0x2a')](_0x7721('0x2b'),_0x5ed94b,_0x7721('0x29'),JSON['stringify'](_0x3e140d));if(_0x3e140d[_0x7721('0x2c')]){if(_0x3e140d[_0x7721('0x2c')][_0x7721('0x2d')]===0x1f4){logger[_0x7721('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x5ed94b,_0x3e140d[_0x7721('0x2c')]['message']);return _0x5cb0e6(_0x3e140d[_0x7721('0x2c')][_0x7721('0x2e')]);}logger[_0x7721('0x2c')](_0x7721('0x28'),_0x5ed94b,_0x3e140d[_0x7721('0x2c')][_0x7721('0x2e')]);return _0x3fc09e(_0x3e140d[_0x7721('0x2c')]['message']);}else{logger[_0x7721('0x27')](_0x7721('0x28'),_0x5ed94b,_0x7721('0x29'));_0x3fc09e(_0x3e140d[_0x7721('0x2f')][_0x7721('0x2e')]);}})[_0x7721('0x30')](function(_0x424e05){logger[_0x7721('0x2c')](_0x7721('0x28'),_0x5ed94b,_0x424e05);_0x5cb0e6(_0x424e05);});});}function respondWithStatusCode(_0x52316e,_0x258ddf){_0x258ddf=_0x258ddf||0xcc;return function(_0x5b0551){if(_0x5b0551){return _0x52316e['sendStatus'](_0x258ddf);}return _0x52316e[_0x7721('0x31')](_0x258ddf)[_0x7721('0x32')]();};}function respondWithResult(_0x53c904,_0x158d98){_0x158d98=_0x158d98||0xc8;return function(_0x1ea4d){if(_0x1ea4d){return _0x53c904[_0x7721('0x31')](_0x158d98)[_0x7721('0x33')](_0x1ea4d);}};}function respondWithFilteredResult(_0x1da2d8,_0x5c54f0){return function(_0x471651){if(_0x471651){var _0x2871c5=_0x471651[_0x7721('0x34')],_0x497f9f=_0x5c54f0['offset'],_0x4a25c9=_0x5c54f0[_0x7721('0x35')]+_0x5c54f0[_0x7721('0x36')],_0xfde9ec;if(_0x4a25c9>=_0x2871c5){_0x4a25c9=_0x2871c5;_0xfde9ec=0xc8;}else{_0xfde9ec=0xce;}_0x1da2d8[_0x7721('0x31')](_0xfde9ec);return _0x1da2d8['set'](_0x7721('0x37'),_0x497f9f+'-'+_0x4a25c9+'/'+_0x2871c5)[_0x7721('0x33')](_0x471651);}return null;};}function patchUpdates(_0x1492d4){return function(_0x3f15e2){try{jsonpatch[_0x7721('0x38')](_0x3f15e2,_0x1492d4,!![]);}catch(_0x508202){return BPromise[_0x7721('0x39')](_0x508202);}return _0x3f15e2[_0x7721('0x3a')]();};}function saveUpdates(_0xb2386d,_0x5c5b33){return function(_0x35de7a){if(_0x35de7a){return _0x35de7a[_0x7721('0x3b')](_0xb2386d)['then'](function(_0x217592){return _0x217592;});}return null;};}function removeEntity(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(_0x326c50){return _0x326c50[_0x7721('0x3c')]()[_0x7721('0x26')](function(){_0x5ce026[_0x7721('0x31')](0xcc)[_0x7721('0x32')]();});}};}function handleEntityNotFound(_0x2f1fe0,_0x15545a){return function(_0x25bdd9){if(!_0x25bdd9){_0x2f1fe0[_0x7721('0x3d')](0x194);}return _0x25bdd9;};}function handleError(_0x385454,_0x5c806d){_0x5c806d=_0x5c806d||0x1f4;return function(_0xd1df68){logger['error'](_0xd1df68[_0x7721('0x3e')]);if(_0xd1df68[_0x7721('0x3f')]){delete _0xd1df68[_0x7721('0x3f')];}_0x385454[_0x7721('0x31')](_0x5c806d)[_0x7721('0x40')](_0xd1df68);};}exports[_0x7721('0x41')]=function(_0x482b70,_0x557c34){var _0x4cadef={},_0x539560={},_0x18001c={'count':0x0,'rows':[]};var _0x1b3f8d=db[_0x7721('0x42')][_0x7721('0x43')];_0x539560['model']=_[_0x7721('0x44')](_0x1b3f8d);_0x539560['query']=_[_0x7721('0x44')](_0x482b70[_0x7721('0x45')]);_0x539560['filters']=_[_0x7721('0x46')](_0x539560[_0x7721('0x47')],_0x539560['query']);_0x4cadef['attributes']=_[_0x7721('0x46')](_0x539560[_0x7721('0x47')],qs[_0x7721('0x48')](_0x482b70[_0x7721('0x45')]['fields']));_0x4cadef[_0x7721('0x49')]=_0x4cadef[_0x7721('0x49')][_0x7721('0x4a')]?_0x4cadef[_0x7721('0x49')]:_0x539560[_0x7721('0x47')];if(!_0x482b70['query'][_0x7721('0x4b')]('nolimit')){_0x4cadef[_0x7721('0x36')]=qs['limit'](_0x482b70[_0x7721('0x45')][_0x7721('0x36')]);_0x4cadef[_0x7721('0x35')]=qs['offset'](_0x482b70[_0x7721('0x45')][_0x7721('0x35')]);}_0x4cadef[_0x7721('0x4c')]=qs['sort'](_0x482b70[_0x7721('0x45')][_0x7721('0x4d')]);_0x4cadef[_0x7721('0x4e')]=qs[_0x7721('0x4f')](_[_0x7721('0x50')](_0x482b70[_0x7721('0x45')],_0x539560[_0x7721('0x4f')]));if(_0x482b70['query']['filter']){_0x4cadef[_0x7721('0x4e')]=_[_0x7721('0x51')](_0x4cadef[_0x7721('0x4e')],{'$or':_[_0x7721('0x52')](_0x1b3f8d,function(_0x335145){if(_0x335145[_0x7721('0x53')][_0x7721('0x54')]!==_0x7721('0x55')){var _0xa601bc={};_0xa601bc[_0x335145[_0x7721('0x56')]]={'$like':'%'+_0x482b70['query']['filter']+'%'};return _0xa601bc;}})});}_0x4cadef=_[_0x7721('0x51')]({},_0x4cadef,_0x482b70[_0x7721('0x57')]);var _0x151f69={'where':_0x4cadef[_0x7721('0x4e')]};return db['SmsMessage'][_0x7721('0x34')](_0x151f69)[_0x7721('0x26')](function(_0x56c3d9){_0x18001c[_0x7721('0x34')]=_0x56c3d9;if(_0x482b70['query'][_0x7721('0x58')]){_0x4cadef['include']=[{'all':!![]}];}return db[_0x7721('0x42')][_0x7721('0x59')](_0x4cadef);})[_0x7721('0x26')](function(_0x4eda58){_0x18001c[_0x7721('0x5a')]=_0x4eda58;return _0x18001c;})[_0x7721('0x26')](respondWithFilteredResult(_0x557c34,_0x4cadef))['catch'](handleError(_0x557c34,null));};exports[_0x7721('0x5b')]=function(_0x1196c2,_0xf88e8c){var _0x5c4078={'raw':!![],'where':{'id':_0x1196c2['params']['id']}},_0x20ba21={};_0x20ba21[_0x7721('0x47')]=_[_0x7721('0x44')](db[_0x7721('0x42')][_0x7721('0x43')]);_0x20ba21[_0x7721('0x45')]=_[_0x7721('0x44')](_0x1196c2[_0x7721('0x45')]);_0x20ba21[_0x7721('0x4f')]=_[_0x7721('0x46')](_0x20ba21[_0x7721('0x47')],_0x20ba21[_0x7721('0x45')]);_0x5c4078[_0x7721('0x49')]=_[_0x7721('0x46')](_0x20ba21[_0x7721('0x47')],qs[_0x7721('0x48')](_0x1196c2['query'][_0x7721('0x48')]));_0x5c4078[_0x7721('0x49')]=_0x5c4078[_0x7721('0x49')][_0x7721('0x4a')]?_0x5c4078[_0x7721('0x49')]:_0x20ba21[_0x7721('0x47')];if(_0x1196c2[_0x7721('0x45')]['includeAll']){_0x5c4078[_0x7721('0x5c')]=[{'all':!![]}];}_0x5c4078=_[_0x7721('0x51')]({},_0x5c4078,_0x1196c2[_0x7721('0x57')]);return db[_0x7721('0x42')][_0x7721('0x5d')](_0x5c4078)[_0x7721('0x26')](handleEntityNotFound(_0xf88e8c,null))[_0x7721('0x26')](respondWithResult(_0xf88e8c,null))[_0x7721('0x30')](handleError(_0xf88e8c,null));};exports[_0x7721('0x5e')]=function(_0x3b968d,_0x8eca10){return db['SmsMessage'][_0x7721('0x5e')](_0x3b968d[_0x7721('0x5f')],{})[_0x7721('0x26')](respondWithResult(_0x8eca10,0xc9))[_0x7721('0x30')](handleError(_0x8eca10,null));};exports[_0x7721('0x3b')]=function(_0x3e7918,_0x41644f){if(_0x3e7918[_0x7721('0x5f')]['id']){delete _0x3e7918[_0x7721('0x5f')]['id'];}return db[_0x7721('0x42')][_0x7721('0x5d')]({'where':{'id':_0x3e7918[_0x7721('0x60')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x41644f,null))[_0x7721('0x26')](saveUpdates(_0x3e7918[_0x7721('0x5f')],null))['then'](respondWithResult(_0x41644f,null))['catch'](handleError(_0x41644f,null));};exports['destroy']=function(_0x885a3a,_0x4f2fe6){return db['SmsMessage']['find']({'where':{'id':_0x885a3a['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x4f2fe6,null))[_0x7721('0x26')](removeEntity(_0x4f2fe6,null))[_0x7721('0x30')](handleError(_0x4f2fe6,null));};exports['describe']=function(_0x5181d7,_0x5925b7){return db['SmsMessage']['describe']()[_0x7721('0x26')](respondWithResult(_0x5925b7,null))['catch'](handleError(_0x5925b7,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x7721('0x61')]=function(_0x2e9155,_0x1ff090,_0x4a94c8){var _0x2a025c={'channel':_0x7721('0x62')};if(_0x2e9155[_0x7721('0x5f')]['id']){delete _0x2e9155[_0x7721('0x5f')]['id'];}_0x2e9155[_0x7721('0x5f')][_0x7721('0x63')]=!![];_0x2e9155[_0x7721('0x5f')][_0x7721('0x64')]=moment()[_0x7721('0x65')](_0x7721('0x66'));_0x2e9155[_0x7721('0x5f')][_0x7721('0x67')]=_0x2e9155[_0x7721('0x5f')][_0x7721('0x67')]||_0x2e9155[_0x7721('0x68')]['id'];return db['SmsMessage'][_0x7721('0x5d')]({'where':{'id':_0x2e9155[_0x7721('0x60')]['id'],'UserId':null},'include':[{'model':db[_0x7721('0x69')],'as':_0x7721('0x6a')}]})['then'](handleEntityNotFound(_0x1ff090,null))[_0x7721('0x26')](saveUpdates(_0x2e9155[_0x7721('0x5f')],null))['then'](function(_0x3e7df3){if(_0x3e7df3){_0x2a025c['message']=_0x3e7df3[_0x7721('0x6b')]({'plain':!![]});return db[_0x7721('0x6c')][_0x7721('0x5d')]({'where':{'id':_0x3e7df3[_0x7721('0x6d')]}});}return null;})[_0x7721('0x26')](handleEntityNotFound(_0x1ff090,null))[_0x7721('0x26')](function(_0x3121e0){if(_0x3121e0){return _0x3121e0[_0x7721('0x3b')]({'UserId':_0x2e9155[_0x7721('0x5f')]['UserId'],'read1stAt':_[_0x7721('0x6e')](_0x3121e0[_0x7721('0x6f')])?moment()[_0x7721('0x65')](_0x7721('0x66')):undefined});}return null;})[_0x7721('0x26')](function(_0x3ed425){if(_0x3ed425){_0x2a025c[_0x7721('0x70')]=_0x3ed425['get']({'plain':!![]});interaction_log[_0x7721('0x27')](_0x7721('0x71'),_0x2e9155['user']['id'],_0x2e9155[_0x7721('0x68')]['name'],_0x2e9155[_0x7721('0x68')][_0x7721('0x72')],_0x2a025c[_0x7721('0x70')]['id'],_0x2e9155[_0x7721('0x5f')]?JSON[_0x7721('0x73')](_0x2e9155[_0x7721('0x5f')]):_0x7721('0x74'));return respondWithRpcPromise('AcceptMessage',_0x7721('0x75'),_0x2a025c);}return null;})[_0x7721('0x26')](function(_0x280b1d){if(_0x280b1d){if(_0x2e9155['body']['manual']){_0x2a025c['message']['interface']=util['format'](_0x7721('0x76'),_0x2e9155[_0x7721('0x68')]['name']);_0x2a025c[_0x7721('0x2e')][_0x7721('0x77')]=_0x2a025c[_0x7721('0x77')];_0x2a025c[_0x7721('0x2e')]['event']=_0x7721('0x61');return respondWithRpcPromise(_0x7721('0x78'),_0x7721('0x78'),{'event':_0x7721('0x79'),'message':_0x2a025c[_0x7721('0x2e')]},client9002)['then'](function(){return _0x2a025c;});}return _0x2a025c;}return null;})[_0x7721('0x26')](respondWithResult(_0x1ff090,null))[_0x7721('0x30')](handleError(_0x1ff090,null));};var interaction_log=require(_0x7721('0x15'))('sms-interactions');exports['reject']=function(_0x76d89e,_0x752564,_0x423040){var _0x42ca24={'agent':{},'channel':_0x7721('0x62')};if(_0x76d89e['body']['id']){delete _0x76d89e['body']['id'];}_0x76d89e[_0x7721('0x5f')][_0x7721('0x67')]=_0x76d89e[_0x7721('0x5f')][_0x7721('0x67')]||_0x76d89e[_0x7721('0x68')]['id'];_0x42ca24[_0x7721('0x7a')]['id']=_0x76d89e[_0x7721('0x5f')]['UserId'];return db[_0x7721('0x42')][_0x7721('0x5d')]({'where':{'id':_0x76d89e[_0x7721('0x60')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x752564,null))[_0x7721('0x26')](function(_0x1a53d6){if(_0x1a53d6){_0x42ca24[_0x7721('0x2e')]=_0x1a53d6[_0x7721('0x6b')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x1a53d6[_0x7721('0x6d')]}});}return null;})[_0x7721('0x26')](handleEntityNotFound(_0x752564,null))[_0x7721('0x26')](function(_0x42c849){if(_0x42c849){_0x42ca24[_0x7721('0x70')]=_0x42c849[_0x7721('0x6b')]({'plain':!![]});interaction_log['info'](_0x7721('0x7b'),_0x76d89e[_0x7721('0x68')]['id'],_0x76d89e[_0x7721('0x68')]['name'],_0x76d89e[_0x7721('0x68')][_0x7721('0x72')],_0x42ca24[_0x7721('0x70')]['id'],_0x76d89e[_0x7721('0x5f')]?JSON[_0x7721('0x73')](_0x76d89e['body']):_0x7721('0x74'));return respondWithRpcPromise('RejectMessage',_0x7721('0x7c'),_0x42ca24);}return null;})[_0x7721('0x26')](function(_0x2d5433){if(_0x2d5433){_0x2d5433[_0x7721('0x2e')][_0x7721('0x7d')]=util[_0x7721('0x65')](_0x7721('0x76'),_0x76d89e[_0x7721('0x68')][_0x7721('0x3f')]);_0x2d5433[_0x7721('0x2e')][_0x7721('0x77')]=_0x42ca24['channel'];_0x2d5433[_0x7721('0x2e')][_0x7721('0x7e')]=_0x7721('0x39');respondWithRpcPromise('EventManager',_0x7721('0x78'),{'event':_0x7721('0x7f'),'message':_0x2d5433[_0x7721('0x2e')]},client9002);return _0x42ca24;}return null;})[_0x7721('0x26')](respondWithResult(_0x752564,null))[_0x7721('0x30')](handleError(_0x752564,null));};exports['status']=function(_0x1276ce,_0x22f15a,_0x44326d){if(_0x1276ce[_0x7721('0x5f')]['id']){delete _0x1276ce[_0x7721('0x5f')]['id'];}var _0x51f3d7;return db['SmsMessage'][_0x7721('0x5d')]({'where':{'id':_0x1276ce[_0x7721('0x60')]['id']}})['then'](handleEntityNotFound(_0x22f15a,null))[_0x7721('0x26')](function(_0x4c8fb9){if(_0x4c8fb9){_0x51f3d7=_0x4c8fb9;return db[_0x7721('0x80')][_0x7721('0x5d')]({'where':{'id':_0x4c8fb9['SmsAccountId']}});}})[_0x7721('0x26')](handleEntityNotFound(_0x22f15a,null))['then'](function(_0x56069f){if(_0x56069f){logger['debug'](_0x7721('0x2b'),_0x7721('0x31'),_0x7721('0x81'),_0x56069f['type'],util['inspect'](_0x1276ce['body'],{'showHidden':![],'depth':null}));switch(_0x56069f[_0x7721('0x53')]){case _0x7721('0x82'):if(_0x1276ce[_0x7721('0x5f')][_0x7721('0x83')]&&_0x1276ce[_0x7721('0x5f')][_0x7721('0x83')]===_0x51f3d7['messageId']){return _0x51f3d7[_0x7721('0x3b')]({'read':!![]});}else{logger[_0x7721('0x2c')](_0x7721('0x84'),_0x7721('0x31'),_0x7721('0x82'),util[_0x7721('0x85')](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7721('0x86'):if(_0x1276ce[_0x7721('0x5f')][_0x7721('0x87')]&&_0x1276ce[_0x7721('0x5f')][_0x7721('0x87')]===_0x51f3d7['messageId']&&_['indexOf']([_0x7721('0x88'),_0x7721('0x89')],_0x1276ce['body'][_0x7721('0x8a')])>=0x0){return _0x51f3d7['update']({'read':!![]});}else{logger['error'](_0x7721('0x84'),'status','plivio',util[_0x7721('0x85')](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7721('0x8b'):var _0x3698b3=_0x1276ce[_0x7721('0x5f')]['results'][0x0];if(_0x3698b3[_0x7721('0x31')][_0x7721('0x8c')]===_0x7721('0x8d')){return _0x51f3d7[_0x7721('0x3b')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7721('0x31'),_0x7721('0x8b'),util['inspect'](_0x1276ce[_0x7721('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x51f3d7;}})[_0x7721('0x26')](respondWithResult(_0x22f15a,null))['catch'](handleError(_0x22f15a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4d4593d..e94640e 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 _0xb56d=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xb56d,0x14b));var _0xdb56=function(_0x30ff26,_0x2171ff){_0x30ff26=_0x30ff26-0x0;var _0x4ee1e1=_0xb56d[_0x30ff26];return _0x4ee1e1;};'use strict';var EventEmitter=require(_0xdb56('0x0'));var SmsMessage=require(_0xdb56('0x1'))['db'][_0xdb56('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdb56('0x3')](0x0);var events={'afterCreate':_0xdb56('0x4'),'afterUpdate':_0xdb56('0x5'),'afterDestroy':_0xdb56('0x6')};function emitEvent(_0x9c0474){return function(_0x296c1b,_0x170ade,_0x1fd92b){SmsMessageEvents['emit'](_0x9c0474+':'+_0x296c1b['id'],_0x296c1b);SmsMessageEvents[_0xdb56('0x7')](_0x9c0474,_0x296c1b);_0x1fd92b(null);};}for(var e in events){if(events[_0xdb56('0x8')](e)){var event=events[e];SmsMessage[_0xdb56('0x9')](e,emitEvent(event));}}module[_0xdb56('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0x9565=['remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0xb4063c,_0x555fb4){var _0x52594e=function(_0x38b017){while(--_0x38b017){_0xb4063c['push'](_0xb4063c['shift']());}};_0x52594e(++_0x555fb4);}(_0x9565,0x18c));var _0x5956=function(_0x234f49,_0x202a45){_0x234f49=_0x234f49-0x0;var _0x3b8171=_0x9565[_0x234f49];return _0x3b8171;};'use strict';var EventEmitter=require(_0x5956('0x0'));var SmsMessage=require(_0x5956('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5956('0x2'),'afterUpdate':'update','afterDestroy':_0x5956('0x3')};function emitEvent(_0x2a170f){return function(_0x4c602e,_0x18a7d9,_0x5b1b83){SmsMessageEvents[_0x5956('0x4')](_0x2a170f+':'+_0x4c602e['id'],_0x4c602e);SmsMessageEvents[_0x5956('0x4')](_0x2a170f,_0x4c602e);_0x5b1b83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x5956('0x5')](e,emitEvent(event));}}module[_0x5956('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 8ad9587..2ab7f10 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 _0x67c1=['isNil','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','POST','internal_order_id','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','toString','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','md5','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','message','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','SmsMessage','messageId','body','models','get','direction','toLowerCase','out','secret'];(function(_0x50e669,_0x2ad6ea){var _0x33ad4b=function(_0x52af46){while(--_0x52af46){_0x50e669['push'](_0x50e669['shift']());}};_0x33ad4b(++_0x2ad6ea);}(_0x67c1,0xc6));var _0x167c=function(_0x659c6b,_0x4e04ae){_0x659c6b=_0x659c6b-0x0;var _0x441348=_0x67c1[_0x659c6b];return _0x441348;};'use strict';var _=require(_0x167c('0x0'));var util=require(_0x167c('0x1'));var logger=require(_0x167c('0x2'))(_0x167c('0x3'));var moment=require(_0x167c('0x4'));var BPromise=require('bluebird');var rp=require(_0x167c('0x5'));var fs=require('fs');var path=require(_0x167c('0x6'));var rimraf=require(_0x167c('0x7'));var config=require(_0x167c('0x8'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x226bb4,_0x48603c){return _0x226bb4['define'](_0x167c('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x167c('0xa'),'fields':[_0x167c('0xa')]},{'name':'fti_sms_messages','fields':[_0x167c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56cd4a,_0x9116ee,_0x1d128d){var _0x446d95=_0x226bb4[_0x167c('0xc')];var _0x51575d=_0x56cd4a[_0x167c('0xd')]({'plain':!![]});if(_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()==='in'||_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()===_0x167c('0x10')&&!_0x51575d[_0x167c('0x11')]&&!_[_0x167c('0x12')](_0x51575d['UserId'])){_0x446d95[_0x167c('0x13')][_0x167c('0x14')]({'where':{'id':_0x51575d['SmsInteractionId']}})[_0x167c('0x15')](function(_0x3b34bf){if(_0x3b34bf){_0x3b34bf[_0x167c('0x16')]({'lastMsgAt':_0x51575d[_0x167c('0x17')],'lastMsgDirection':_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()});}})[_0x167c('0x18')](function(_0x5cd727){console[_0x167c('0x19')](_0x5cd727);});}if(_0x51575d[_0x167c('0xe')]===_0x167c('0x10')&&!_0x51575d[_0x167c('0x11')]){var _0xe4a51f;_0x446d95[_0x167c('0x1a')]['find']({'where':{'id':_0x51575d[_0x167c('0x1b')]},'raw':!![]})['then'](function(_0x5ea03a){_0xe4a51f=_0x5ea03a;if(_0xe4a51f&&_0xe4a51f[_0x167c('0x1c')]){switch(_0xe4a51f['type']){case _0x167c('0x1d'):var _0x1047ea=require(_0x167c('0x1d'));if(_0xe4a51f['accountSid']&&_0xe4a51f[_0x167c('0x1e')]&&_0xe4a51f[_0x167c('0x1f')]){var _0x5c69e4=new _0x1047ea(_0xe4a51f[_0x167c('0x20')],_0xe4a51f[_0x167c('0x1e')]);_0x5c69e4[_0x167c('0x21')][_0x167c('0x22')]({'body':_0x51575d[_0x167c('0xb')],'to':_0x51575d['phone'],'from':_0xe4a51f[_0x167c('0x1f')],'statusCallback':_0xe4a51f['remote']+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')]})[_0x167c('0x15')](function(_0x15d6ea){if(_0x15d6ea[_0x167c('0x26')]){return _0x56cd4a[_0x167c('0x16')]({'messageId':_0x15d6ea[_0x167c('0x26')]});}})[_0x167c('0x18')](function(_0x160464){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x1d'),util['inspect'](_0x160464,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'twilio',_0x167c('0x29'));}break;case'skebby':var _0x7f4d65=_0x167c('0x2a');if(_0xe4a51f[_0x167c('0x2b')]&&_0xe4a51f[_0x167c('0x2c')]){var _0x4d63f4={'recipient':[_0x51575d[_0x167c('0x1f')]],'message':_0x51575d[_0x167c('0xb')],'message_type':_0xe4a51f[_0x167c('0x2d')]};var _0x25133e={'url':_0x7f4d65+_0x167c('0x2e')+_0xe4a51f[_0x167c('0x2b')]+_0x167c('0x2f')+_0xe4a51f[_0x167c('0x2c')],'method':'GET'};rp(_0x25133e)[_0x167c('0x15')](function(_0x1a660b){var _0x51d090=_0x1a660b[_0x167c('0x30')](';');var _0x2e8cbd={'user_key':_0x51d090[0x0],'session_key':_0x51d090[0x1]};_0x25133e={'url':_0x7f4d65+'sms','method':_0x167c('0x31'),'headers':{'user_key':_0x2e8cbd['user_key'],'Session_key':_0x2e8cbd['session_key']},'json':!![],'body':_0x4d63f4};return rp(_0x25133e);})[_0x167c('0x15')](function(_0x2df058){if(_0x2df058['total_sent']>=0x1){var _0x4a7193={'messageId':_0x2df058[_0x167c('0x32')]};if(_0xe4a51f[_0x167c('0x2d')]!=='GP'||!_0xe4a51f[_0x167c('0x33')]){_0x4a7193[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x4a7193);}else{return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'skebby',util[_0x167c('0x35')](_0x2df058,{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x288b52){return logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x36'),util['inspect'](_0x288b52,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x36'),_0x167c('0x37'));}break;case _0x167c('0x38'):if(_0xe4a51f[_0x167c('0x1e')]){var _0x3cd8a1={'recipient':_0x51575d[_0x167c('0x1f')],'message':_0x51575d[_0x167c('0xb')],'sender':_0xe4a51f['senderString']||_0xe4a51f[_0x167c('0x1f')],'authorization':_0xe4a51f['authToken']};var _0x9116ee={'method':_0x167c('0x31'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x3cd8a1,'json':!![]};rp(_0x9116ee)[_0x167c('0x15')](function(_0x4a167a){var _0x4a4545={'messageId':_0x4a167a[_0x167c('0x39')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x4a4545['read']=!![];}return _0x56cd4a[_0x167c('0x16')](_0x4a4545);})[_0x167c('0x18')](function(_0xb0c55c){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x38'),util['inspect'](_0xb0c55c,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x38'),_0x167c('0x3a'));}break;case'clicksend':if(_0xe4a51f[_0x167c('0x2b')]&&_0xe4a51f[_0x167c('0x2c')]){var _0x3cd8a1={'messages':[{'source':_0x167c('0x3b'),'to':_0x51575d['phone'],'body':_0x51575d[_0x167c('0xb')],'from':_0xe4a51f[_0x167c('0x3c')]||_0xe4a51f[_0x167c('0x1f')]}]};var _0x6a2160=util['format']('%s:%s',_0xe4a51f[_0x167c('0x2b')],_0xe4a51f[_0x167c('0x2c')]);var _0x9116ee={'method':_0x167c('0x31'),'uri':_0x167c('0x3d'),'body':_0x3cd8a1,'headers':{'Authorization':util[_0x167c('0x3e')](_0x167c('0x3f'),new Buffer(_0x6a2160)['toString'](_0x167c('0x40')))},'json':!![]};rp(_0x9116ee)['then'](function(_0x236c3e){if(_0x236c3e['http_code']>=0xc8&&_0x236c3e[_0x167c('0x41')]<=0xce){if(_0x236c3e[_0x167c('0x42')]&&_0x236c3e[_0x167c('0x42')][_0x167c('0x43')]>0x0){var _0xc29080=_['head'](_0x236c3e['data'][_0x167c('0x21')]);var _0x27c60f={'messageId':_0xc29080['message_id']};if(!_0xe4a51f[_0x167c('0x33')]){_0x27c60f['read']=!![];}return _0x56cd4a[_0x167c('0x16')](_0x27c60f);}else{logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),'clickSend',util[_0x167c('0x35')](_0x236c3e,{'showHidden':![],'depth':null}));}}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),util[_0x167c('0x35')](_0x236c3e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4aae4e){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),util[_0x167c('0x35')](_0x4aae4e,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),_0x167c('0x37'));}break;case _0x167c('0x45'):if(_0xe4a51f[_0x167c('0x46')]&&_0xe4a51f[_0x167c('0x1e')]){var _0x3cd8a1={'dst':_0x51575d[_0x167c('0x1f')],'text':_0x51575d[_0x167c('0xb')],'src':_0xe4a51f[_0x167c('0x3c')]||_0xe4a51f[_0x167c('0x1f')],'url':_0xe4a51f[_0x167c('0x47')]+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')]};var _0x6a2160=util[_0x167c('0x3e')]('%s:%s',_0xe4a51f['authId'],_0xe4a51f[_0x167c('0x1e')]);var _0x9116ee={'method':_0x167c('0x31'),'uri':util[_0x167c('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0xe4a51f[_0x167c('0x46')]),'body':_0x3cd8a1,'headers':{'Authorization':util[_0x167c('0x3e')](_0x167c('0x3f'),new Buffer(_0x6a2160)[_0x167c('0x48')](_0x167c('0x40')))},'json':!![]};rp(_0x9116ee)[_0x167c('0x15')](function(_0x433a90){var _0x230c8b={'messageId':_0x433a90['message_uuid'][0x0]};return _0x56cd4a[_0x167c('0x16')](_0x230c8b);})['catch'](function(_0x10999e){logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x45'),util['inspect'](_0x10999e,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x45'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x167c('0x49'):if(_0xe4a51f['username']&&_0xe4a51f[_0x167c('0x2c')]){if(_0xe4a51f[_0x167c('0x4a')]){var _0x4f6d16={'method':'POST','uri':_0xe4a51f[_0x167c('0x4a')]+'/auth/1/session','body':{'username':_0xe4a51f[_0x167c('0x2b')],'password':_0xe4a51f[_0x167c('0x2c')]},'json':!![]};return rp(_0x4f6d16)['then'](function(_0x5c74c7){var _0x335cb0={'method':'POST','uri':_0xe4a51f[_0x167c('0x4a')]+_0x167c('0x4b'),'body':{'messages':[{'from':_0xe4a51f['phone'],'destinations':[{'to':_0x51575d[_0x167c('0x1f')]}],'text':_0x51575d['body'],'notifyUrl':_0xe4a51f['remote']+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')],'notifyContentType':_0x167c('0x4c'),'callbackData':_0xe4a51f['phone']+';'+_0x51575d['body']}]},'headers':{'Authorization':_0x167c('0x4d')+_0x5c74c7[_0x167c('0x25')]},'json':!![]};return rp(_0x335cb0)['then'](function(_0x47e04d){if(_0x47e04d[_0x167c('0x21')]){var _0x35da93={'messageId':_0x47e04d['messages'][0x0][_0x167c('0xa')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x35da93[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x35da93);}else{return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x49'),util['inspect'](_0x47e04d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5c9073){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'infobip',util[_0x167c('0x35')](_0x5c9073,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x167c('0x27'),'afterCreate',_0x167c('0x49'),_0x167c('0x4e'));}}else{logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x49'),_0x167c('0x37'));}break;case _0x167c('0x4f'):var _0x16d4ad=require(_0x167c('0x50'));if(_0xe4a51f[_0x167c('0x51')]){var _0x5a6231={};_0x5a6231[_0x167c('0x52')]=_0xe4a51f[_0x167c('0x2b')];_0x5a6231[_0x167c('0x1f')]=_0x51575d[_0x167c('0x1f')];_0x5a6231['sender']=_0xe4a51f[_0x167c('0x1f')];_0x5a6231[_0x167c('0x53')]=_0x51575d[_0x167c('0xb')];_0x5a6231[_0x167c('0x54')]=+new Date();var _0x620be3='';var _0x29574b='';var _0x1e0a46=Object['keys'](_0x5a6231);_0x1e0a46[_0x167c('0x55')]();for(var _0xc18042=0x0;_0xc18042<_0x1e0a46[_0x167c('0x56')];_0xc18042++){if(_0x620be3!=''){_0x620be3+='&';}_0x620be3+=_0x1e0a46[_0xc18042]+'='+encodeURIComponent(_0x5a6231[_0x1e0a46[_0xc18042]]);_0x29574b+=_0x5a6231[_0x1e0a46[_0xc18042]];}_0x29574b+=_0xe4a51f[_0x167c('0x51')];_0x29574b=_0x16d4ad['createHash'](_0x167c('0x57'))[_0x167c('0x16')](_0x29574b)['digest'](_0x167c('0x58'));if(_0x620be3!==''){_0x620be3+='&';}_0x620be3+=_0x167c('0x59')+_0x29574b;var _0x25133e={'method':'GET','uri':_0x167c('0x5a')+_0x620be3,'json':!![]};return rp(_0x25133e)['then'](function(_0x35282b){var _0x2fc41a=Object[_0x167c('0x5b')](_0x35282b);if(_0x35282b[_0x2fc41a[0x0]][_0x167c('0x19')]&&parseInt(_0x35282b[_0x2fc41a[0x0]][_0x167c('0x19')])===0x0){var _0x292239={'messageId':_0x35282b[_0x2fc41a[0x0]][_0x167c('0x5c')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x292239[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x292239);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x4f'),util['inspect'](_0x35282b[_0x167c('0x19')],{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x57aaa6){return logger['error'](_0x167c('0x27'),'afterCreate',_0x167c('0x4f'),util[_0x167c('0x35')](_0x57aaa6,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'csc',_0x167c('0x5d'));}break;case _0x167c('0x5e'):if(_0xe4a51f[_0x167c('0x51')]){var _0x4562f1={'method':_0x167c('0x31'),'uri':_0x167c('0x5f'),'headers':{'Authorization':_0xe4a51f[_0x167c('0x51')]},'body':{'content':_0x51575d['body'],'to':[_0x51575d[_0x167c('0x1f')]],'from':_0xe4a51f[_0x167c('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x167c('0x60')},'json':!![]};rp(_0x4562f1)['then'](function(_0x2b35cb){if(!_0x2b35cb['error']){var _0x3f5596={'messageId':_0x2b35cb['messages'][0x0][_0x167c('0x61')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x3f5596[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x3f5596);}else{return logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x5e'),util['inspect'](_0x2b35cb[_0x167c('0x19')],{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x614ccf){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x5e'),util['inspect'](_0x614ccf,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0xe4a51f[_0x167c('0x51')]){var _0x2f7a8d={};var _0x25133e={'method':_0x167c('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x167c('0x62')+_0xe4a51f[_0x167c('0x51')],'Content-Type':'application/json'},'body':{'from':_0xe4a51f['phone'],'to':_0x51575d[_0x167c('0x1f')],'text':_0x51575d[_0x167c('0xb')]},'json':!![]};return rp(_0x25133e)[_0x167c('0x15')](function(_0x17669e){if(_0x17669e[_0x167c('0x63')]==0xca){_0x2f7a8d['message']=_0x17669e;var _0x155567={'method':_0x167c('0x31'),'uri':_0x167c('0x64'),'headers':{'Authorization':_0x167c('0x62')+_0xe4a51f['apiKey'],'Content-Type':_0x167c('0x4c')},'body':{'refid':_0x2f7a8d['message']['refid']},'json':!![]};return rp(_0x155567)['then'](function(_0x35a835){_0x2f7a8d[_0x167c('0x65')]=_0x35a835;var _0x52b8fe={'messageId':_0x2f7a8d[_0x167c('0x66')][_0x167c('0x67')],'read':!![]};return _0x56cd4a[_0x167c('0x16')](_0x52b8fe);});}else{return logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x68'),util[_0x167c('0x35')](_0x17669e,{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x178d20){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x68'),util['inspect'](_0x178d20,{'showHidden':![],'depth':null}));});}else{return logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),'intelepeer',_0x167c('0x69'));}break;}}})[_0x167c('0x6a')](function(){_0x1d128d();});}else{_0x1d128d();}}},'charset':'utf8mb4','collate':_0x167c('0x6b')});}; \ No newline at end of file +var _0x442b=['sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','createHash','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','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','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','then','update','direction','catch','error','find','type','accountSid','authToken','phone','create','body','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','login?username=','username','&password=','split'];(function(_0x1891b3,_0x48cd0a){var _0xfc8cd=function(_0xd95825){while(--_0xd95825){_0x1891b3['push'](_0x1891b3['shift']());}};_0xfc8cd(++_0x48cd0a);}(_0x442b,0x134));var _0xb442=function(_0x176734,_0x326384){_0x176734=_0x176734-0x0;var _0xfac033=_0x442b[_0x176734];return _0xfac033;};'use strict';var _=require('lodash');var util=require(_0xb442('0x0'));var logger=require(_0xb442('0x1'))('api');var moment=require(_0xb442('0x2'));var BPromise=require(_0xb442('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb442('0x4'));var rimraf=require(_0xb442('0x5'));var config=require('../../config/environment');var attributes=require(_0xb442('0x6'));module[_0xb442('0x7')]=function(_0x485203,_0x38b808){return _0x485203['define'](_0xb442('0x8'),attributes,{'tableName':_0xb442('0x9'),'paranoid':![],'indexes':[{'name':_0xb442('0xa'),'fields':[_0xb442('0xa')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xb442('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57bab0,_0x2b4769,_0x342b44){var _0x563996=_0x485203[_0xb442('0xc')];var _0x1b2470=_0x57bab0[_0xb442('0xd')]({'plain':!![]});if(_0x1b2470['direction']['toLowerCase']()==='in'||_0x1b2470['direction'][_0xb442('0xe')]()===_0xb442('0xf')&&!_0x1b2470[_0xb442('0x10')]&&!_[_0xb442('0x11')](_0x1b2470[_0xb442('0x12')])){_0x563996[_0xb442('0x13')][_0xb442('0x14')]({'where':{'id':_0x1b2470['SmsInteractionId']}})[_0xb442('0x15')](function(_0x2f5096){if(_0x2f5096){_0x2f5096[_0xb442('0x16')]({'lastMsgAt':_0x1b2470['createdAt'],'lastMsgDirection':_0x1b2470[_0xb442('0x17')][_0xb442('0xe')]()});}})[_0xb442('0x18')](function(_0x427000){console[_0xb442('0x19')](_0x427000);});}if(_0x1b2470[_0xb442('0x17')]==='out'&&!_0x1b2470[_0xb442('0x10')]){var _0x1a7aef;_0x563996['SmsAccount'][_0xb442('0x1a')]({'where':{'id':_0x1b2470['SmsAccountId']},'raw':!![]})[_0xb442('0x15')](function(_0x2adc45){_0x1a7aef=_0x2adc45;if(_0x1a7aef&&_0x1a7aef[_0xb442('0x1b')]){switch(_0x1a7aef['type']){case'twilio':var _0x2b74d5=require('twilio');if(_0x1a7aef[_0xb442('0x1c')]&&_0x1a7aef[_0xb442('0x1d')]&&_0x1a7aef[_0xb442('0x1e')]){var _0x28cd5b=new _0x2b74d5(_0x1a7aef[_0xb442('0x1c')],_0x1a7aef[_0xb442('0x1d')]);_0x28cd5b['messages'][_0xb442('0x1f')]({'body':_0x1b2470[_0xb442('0x20')],'to':_0x1b2470['phone'],'from':_0x1a7aef[_0xb442('0x1e')],'statusCallback':_0x1a7aef['remote']+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef[_0xb442('0x23')]})[_0xb442('0x15')](function(_0x768619){if(_0x768619['sid']){return _0x57bab0['update']({'messageId':_0x768619[_0xb442('0x24')]});}})[_0xb442('0x18')](function(_0x326705){logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x27'),util['inspect'](_0x326705,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xb442('0x27'),_0xb442('0x28'));}break;case _0xb442('0x29'):var _0x4bf15e=_0xb442('0x2a');if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){var _0x4aac64={'recipient':[_0x1b2470[_0xb442('0x1e')]],'message':_0x1b2470['body'],'message_type':_0x1a7aef[_0xb442('0x2c')]};var _0x18bdc1={'url':_0x4bf15e+_0xb442('0x2d')+_0x1a7aef[_0xb442('0x2e')]+_0xb442('0x2f')+_0x1a7aef[_0xb442('0x2b')],'method':'GET'};rp(_0x18bdc1)['then'](function(_0x3555e9){var _0x5e7552=_0x3555e9[_0xb442('0x30')](';');var _0x568eeb={'user_key':_0x5e7552[0x0],'session_key':_0x5e7552[0x1]};_0x18bdc1={'url':_0x4bf15e+_0xb442('0x31'),'method':_0xb442('0x32'),'headers':{'user_key':_0x568eeb[_0xb442('0x33')],'Session_key':_0x568eeb[_0xb442('0x34')]},'json':!![],'body':_0x4aac64};return rp(_0x18bdc1);})[_0xb442('0x15')](function(_0x2aeff3){if(_0x2aeff3['total_sent']>=0x1){var _0x40c141={'messageId':_0x2aeff3[_0xb442('0x35')]};if(_0x1a7aef[_0xb442('0x2c')]!=='GP'||!_0x1a7aef[_0xb442('0x36')]){_0x40c141[_0xb442('0x37')]=!![];}return _0x57bab0['update'](_0x40c141);}else{return logger['error'](_0xb442('0x25'),'afterCreate',_0xb442('0x29'),util['inspect'](_0x2aeff3,{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x20a1b1){return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x29'),util[_0xb442('0x38')](_0x20a1b1,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x29'),_0xb442('0x39'));}break;case _0xb442('0x3a'):if(_0x1a7aef[_0xb442('0x1d')]){var _0x1eb6b0={'recipient':_0x1b2470['phone'],'message':_0x1b2470[_0xb442('0x20')],'sender':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef[_0xb442('0x1e')],'authorization':_0x1a7aef[_0xb442('0x1d')]};var _0x2b4769={'method':_0xb442('0x32'),'uri':_0xb442('0x3c'),'body':_0x1eb6b0,'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x3501c9){var _0x1413a0={'messageId':_0x3501c9[_0xb442('0x3d')]};if(!_0x1a7aef['deliveryReport']){_0x1413a0['read']=!![];}return _0x57bab0[_0xb442('0x16')](_0x1413a0);})[_0xb442('0x18')](function(_0x32f2cd){logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x3a'),util[_0xb442('0x38')](_0x32f2cd,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0xb442('0x3e'));}break;case _0xb442('0x3f'):if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){var _0x1eb6b0={'messages':[{'source':_0xb442('0x40'),'to':_0x1b2470['phone'],'body':_0x1b2470['body'],'from':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef[_0xb442('0x1e')]}]};var _0x2a6e6a=util[_0xb442('0x41')](_0xb442('0x42'),_0x1a7aef[_0xb442('0x2e')],_0x1a7aef['password']);var _0x2b4769={'method':_0xb442('0x32'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1eb6b0,'headers':{'Authorization':util['format'](_0xb442('0x43'),new Buffer(_0x2a6e6a)['toString'](_0xb442('0x44')))},'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x10eac1){if(_0x10eac1[_0xb442('0x45')]>=0xc8&&_0x10eac1['http_code']<=0xce){if(_0x10eac1['data']&&_0x10eac1[_0xb442('0x46')][_0xb442('0x47')]>0x0){var _0x2e305a=_[_0xb442('0x48')](_0x10eac1[_0xb442('0x46')][_0xb442('0x49')]);var _0x180e35={'messageId':_0x2e305a[_0xb442('0x4a')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x180e35[_0xb442('0x37')]=!![];}return _0x57bab0[_0xb442('0x16')](_0x180e35);}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),util[_0xb442('0x38')](_0x10eac1,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xb442('0x25'),_0xb442('0x26'),'clickSend',util['inspect'](_0x10eac1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x518787){logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),util[_0xb442('0x38')](_0x518787,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4b'),_0xb442('0x39'));}break;case _0xb442('0x4c'):if(_0x1a7aef[_0xb442('0x4d')]&&_0x1a7aef[_0xb442('0x1d')]){var _0x1eb6b0={'dst':_0x1b2470[_0xb442('0x1e')],'text':_0x1b2470[_0xb442('0x20')],'src':_0x1a7aef[_0xb442('0x3b')]||_0x1a7aef['phone'],'url':_0x1a7aef[_0xb442('0x4e')]+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef['token']};var _0x2a6e6a=util['format'](_0xb442('0x42'),_0x1a7aef[_0xb442('0x4d')],_0x1a7aef[_0xb442('0x1d')]);var _0x2b4769={'method':_0xb442('0x32'),'uri':util['format'](_0xb442('0x4f'),_0x1a7aef[_0xb442('0x4d')]),'body':_0x1eb6b0,'headers':{'Authorization':util[_0xb442('0x41')](_0xb442('0x43'),new Buffer(_0x2a6e6a)[_0xb442('0x50')](_0xb442('0x44')))},'json':!![]};rp(_0x2b4769)[_0xb442('0x15')](function(_0x21f54c){var _0x240278={'messageId':_0x21f54c['message_uuid'][0x0]};return _0x57bab0[_0xb442('0x16')](_0x240278);})[_0xb442('0x18')](function(_0x46e6ed){logger[_0xb442('0x19')](_0xb442('0x25'),'afterCreate',_0xb442('0x4c'),util[_0xb442('0x38')](_0x46e6ed,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x4c'),_0xb442('0x51'));}break;case _0xb442('0x52'):if(_0x1a7aef['username']&&_0x1a7aef[_0xb442('0x2b')]){if(_0x1a7aef[_0xb442('0x53')]){var _0x21a948={'method':'POST','uri':_0x1a7aef['baseUrl']+_0xb442('0x54'),'body':{'username':_0x1a7aef['username'],'password':_0x1a7aef[_0xb442('0x2b')]},'json':!![]};return rp(_0x21a948)['then'](function(_0x26ec03){var _0x1092ee={'method':_0xb442('0x32'),'uri':_0x1a7aef[_0xb442('0x53')]+_0xb442('0x55'),'body':{'messages':[{'from':_0x1a7aef['phone'],'destinations':[{'to':_0x1b2470[_0xb442('0x1e')]}],'text':_0x1b2470[_0xb442('0x20')],'notifyUrl':_0x1a7aef[_0xb442('0x4e')]+_0xb442('0x21')+_0x1b2470['id']+_0xb442('0x22')+_0x1a7aef[_0xb442('0x23')],'notifyContentType':_0xb442('0x56'),'callbackData':_0x1a7aef['phone']+';'+_0x1b2470[_0xb442('0x20')]}]},'headers':{'Authorization':_0xb442('0x57')+_0x26ec03[_0xb442('0x23')]},'json':!![]};return rp(_0x1092ee)[_0xb442('0x15')](function(_0x4d14fd){if(_0x4d14fd[_0xb442('0x49')]){var _0x13ab4e={'messageId':_0x4d14fd[_0xb442('0x49')][0x0][_0xb442('0xa')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x13ab4e[_0xb442('0x37')]=!![];}return _0x57bab0[_0xb442('0x16')](_0x13ab4e);}else{return logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb442('0x26'),'infobip',util[_0xb442('0x38')](_0x4d14fd,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x151c9d){return logger[_0xb442('0x19')](_0xb442('0x25'),'afterCreate',_0xb442('0x52'),util[_0xb442('0x38')](_0x151c9d,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb442('0x26'),_0xb442('0x52'),_0xb442('0x58'));}}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case _0xb442('0x59'):var _0x5814a6=require(_0xb442('0x5a'));if(_0x1a7aef[_0xb442('0x5b')]){var _0x3c03d7={};_0x3c03d7[_0xb442('0x5c')]=_0x1a7aef[_0xb442('0x2e')];_0x3c03d7['phone']=_0x1b2470[_0xb442('0x1e')];_0x3c03d7[_0xb442('0x5d')]=_0x1a7aef[_0xb442('0x1e')];_0x3c03d7[_0xb442('0x5e')]=_0x1b2470[_0xb442('0x20')];_0x3c03d7[_0xb442('0x5f')]=+new Date();var _0x40c4b3='';var _0x53aa70='';var _0x325b25=Object[_0xb442('0x60')](_0x3c03d7);_0x325b25[_0xb442('0x61')]();for(var _0x10071f=0x0;_0x10071f<_0x325b25['length'];_0x10071f++){if(_0x40c4b3!=''){_0x40c4b3+='&';}_0x40c4b3+=_0x325b25[_0x10071f]+'='+encodeURIComponent(_0x3c03d7[_0x325b25[_0x10071f]]);_0x53aa70+=_0x3c03d7[_0x325b25[_0x10071f]];}_0x53aa70+=_0x1a7aef[_0xb442('0x5b')];_0x53aa70=_0x5814a6[_0xb442('0x62')]('md5')[_0xb442('0x16')](_0x53aa70)['digest']('hex');if(_0x40c4b3!==''){_0x40c4b3+='&';}_0x40c4b3+=_0xb442('0x63')+_0x53aa70;var _0x18bdc1={'method':'GET','uri':_0xb442('0x64')+_0x40c4b3,'json':!![]};return rp(_0x18bdc1)[_0xb442('0x15')](function(_0x4604e1){var _0x44ce3f=Object[_0xb442('0x60')](_0x4604e1);if(_0x4604e1[_0x44ce3f[0x0]]['error']&&parseInt(_0x4604e1[_0x44ce3f[0x0]][_0xb442('0x19')])===0x0){var _0x4ba675={'messageId':_0x4604e1[_0x44ce3f[0x0]][_0xb442('0x65')]};if(!_0x1a7aef[_0xb442('0x36')]){_0x4ba675[_0xb442('0x37')]=!![];}return _0x57bab0['update'](_0x4ba675);}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'csc',util[_0xb442('0x38')](_0x4604e1[_0xb442('0x19')],{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x2dd72f){return logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x59'),util[_0xb442('0x38')](_0x2dd72f,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x59'),_0xb442('0x66'));}break;case'clickatell':if(_0x1a7aef[_0xb442('0x5b')]){var _0x42af01={'method':_0xb442('0x32'),'uri':_0xb442('0x67'),'headers':{'Authorization':_0x1a7aef['apiKey']},'body':{'content':_0x1b2470[_0xb442('0x20')],'to':[_0x1b2470[_0xb442('0x1e')]],'from':_0x1a7aef['phone'],'binary':![],'clientMessageId':_0xb442('0x68'),'charset':_0xb442('0x69')},'json':!![]};rp(_0x42af01)[_0xb442('0x15')](function(_0x11cf78){if(!_0x11cf78[_0xb442('0x19')]){var _0x153987={'messageId':_0x11cf78['messages'][0x0]['apiMessageId']};if(!_0x1a7aef['deliveryReport']){_0x153987['read']=!![];}return _0x57bab0[_0xb442('0x16')](_0x153987);}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6a'),util[_0xb442('0x38')](_0x11cf78['error'],{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0x32c194){return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),'clickatell',util[_0xb442('0x38')](_0x32c194,{'showHidden':![],'depth':null}));});}else{logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6a'),_0xb442('0x66'));}break;case _0xb442('0x6b'):if(_0x1a7aef[_0xb442('0x5b')]){var _0x50cb6={};var _0x18bdc1={'method':_0xb442('0x32'),'uri':_0xb442('0x6c'),'headers':{'Authorization':_0xb442('0x6d')+_0x1a7aef[_0xb442('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x1a7aef['phone'],'to':_0x1b2470['phone'],'text':_0x1b2470['body']},'json':!![]};return rp(_0x18bdc1)[_0xb442('0x15')](function(_0x3b8aa7){if(_0x3b8aa7[_0xb442('0x6e')]==0xca){_0x50cb6[_0xb442('0x6f')]=_0x3b8aa7;var _0x5efd86={'method':_0xb442('0x32'),'uri':_0xb442('0x70'),'headers':{'Authorization':_0xb442('0x6d')+_0x1a7aef[_0xb442('0x5b')],'Content-Type':'application/json'},'body':{'refid':_0x50cb6[_0xb442('0x6f')]['refid']},'json':!![]};return rp(_0x5efd86)[_0xb442('0x15')](function(_0xa823e0){_0x50cb6[_0xb442('0x71')]=_0xa823e0;var _0x23b043={'messageId':_0x50cb6[_0xb442('0x6f')][_0xb442('0x72')],'read':!![]};return _0x57bab0[_0xb442('0x16')](_0x23b043);});}else{return logger['error'](_0xb442('0x25'),'afterCreate',_0xb442('0x6b'),util['inspect'](_0x3b8aa7,{'showHidden':![],'depth':null}));}})[_0xb442('0x18')](function(_0xe58090){return logger['error'](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6b'),util[_0xb442('0x38')](_0xe58090,{'showHidden':![],'depth':null}));});}else{return logger[_0xb442('0x19')](_0xb442('0x25'),_0xb442('0x26'),_0xb442('0x6b'),_0xb442('0x73'));}break;}}})[_0xb442('0x74')](function(){_0x342b44();});}else{_0x342b44();}}},'charset':_0xb442('0x75'),'collate':_0xb442('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 74e77e2..1e98523 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 _0xf441=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','options','raw','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53eebd,_0x4c0421){var _0x197d85=function(_0x1b5122){while(--_0x1b5122){_0x53eebd['push'](_0x53eebd['shift']());}};_0x197d85(++_0x4c0421);}(_0xf441,0x156));var _0x1f44=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xf441[_0x59162a];return _0x35e50d;};'use strict';var _=require(_0x1f44('0x0'));var util=require(_0x1f44('0x1'));var moment=require(_0x1f44('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f44('0x3'));var db=require(_0x1f44('0x4'))['db'];var utils=require(_0x1f44('0x5'));var logger=require(_0x1f44('0x6'))(_0x1f44('0x7'));var config=require(_0x1f44('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f44('0x9')][_0x1f44('0xa')]({'port':0x232a});config[_0x1f44('0xb')]=_[_0x1f44('0xc')](config[_0x1f44('0xb')],{'host':_0x1f44('0xd'),'port':0x18eb});var socket=require(_0x1f44('0xe'))(new Redis(config[_0x1f44('0xb')]));require(_0x1f44('0xf'))[_0x1f44('0x10')](socket);function respondWithRpcPromise(_0x179adb,_0x49de25,_0x5e5a17){return new BPromise(function(_0x1c95bb,_0x272104){return client[_0x1f44('0x11')](_0x179adb,_0x5e5a17)[_0x1f44('0x12')](function(_0x8920b7){logger[_0x1f44('0x13')](_0x1f44('0x14'),_0x49de25,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49de25,_0x1f44('0x15'),JSON[_0x1f44('0x16')](_0x8920b7));if(_0x8920b7[_0x1f44('0x17')]){if(_0x8920b7[_0x1f44('0x17')]['code']===0x1f4){logger[_0x1f44('0x17')](_0x1f44('0x14'),_0x49de25,_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);return _0x272104(_0x8920b7['error']['message']);}logger['error'](_0x1f44('0x14'),_0x49de25,_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);return _0x1c95bb(_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);}else{logger['info'](_0x1f44('0x14'),_0x49de25,'request\x20sent');_0x1c95bb(_0x8920b7[_0x1f44('0x19')]['message']);}})[_0x1f44('0x1a')](function(_0x17af0b){logger[_0x1f44('0x17')](_0x1f44('0x14'),_0x49de25,_0x17af0b);_0x272104(_0x17af0b);});});}exports[_0x1f44('0x1b')]=function(_0x47cf51){var _0x30789a=this;return new Promise(function(_0xc50809,_0xffd8b4){return db[_0x1f44('0x1c')]['create'](_0x47cf51['body'],{'raw':_0x47cf51[_0x1f44('0x1d')]?_0x47cf51['options'][_0x1f44('0x1e')]===undefined?!![]:![]:!![]})[_0x1f44('0x12')](function(_0x2d9247){logger['info'](_0x1f44('0x1b'),_0x47cf51);logger[_0x1f44('0x1f')](_0x1f44('0x1b'),_0x47cf51,JSON['stringify'](_0x2d9247));_0xc50809(_0x2d9247);})['catch'](function(_0x1f9f4b){logger[_0x1f44('0x17')]('CreateSmsMessage',_0x1f9f4b[_0x1f44('0x18')],_0x47cf51);_0xffd8b4(_0x30789a[_0x1f44('0x17')](0x1f4,_0x1f9f4b[_0x1f44('0x18')]));});});}; \ No newline at end of file +var _0x2975=['info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then'];(function(_0x13c635,_0x2021b0){var _0x576ac6=function(_0x573352){while(--_0x573352){_0x13c635['push'](_0x13c635['shift']());}};_0x576ac6(++_0x2021b0);}(_0x2975,0x192));var _0x5297=function(_0x422cfe,_0x54920a){_0x422cfe=_0x422cfe-0x0;var _0x31f9bd=_0x2975[_0x422cfe];return _0x31f9bd;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require('moment');var BPromise=require(_0x5297('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5297('0x2'));var db=require(_0x5297('0x3'))['db'];var utils=require(_0x5297('0x4'));var logger=require(_0x5297('0x5'))(_0x5297('0x6'));var config=require(_0x5297('0x7'));var jayson=require(_0x5297('0x8'));var client=jayson[_0x5297('0x9')]['http']({'port':0x232a});config[_0x5297('0xa')]=_[_0x5297('0xb')](config[_0x5297('0xa')],{'host':_0x5297('0xc'),'port':0x18eb});var socket=require(_0x5297('0xd'))(new Redis(config[_0x5297('0xa')]));require(_0x5297('0xe'))[_0x5297('0xf')](socket);function respondWithRpcPromise(_0x35c282,_0x1d53e3,_0x5ca71c){return new BPromise(function(_0x37fddc,_0x14e19a){return client[_0x5297('0x10')](_0x35c282,_0x5ca71c)[_0x5297('0x11')](function(_0x2a85b1){logger[_0x5297('0x12')](_0x5297('0x13'),_0x1d53e3,'request\x20sent');logger[_0x5297('0x14')](_0x5297('0x15'),_0x1d53e3,_0x5297('0x16'),JSON[_0x5297('0x17')](_0x2a85b1));if(_0x2a85b1['error']){if(_0x2a85b1[_0x5297('0x18')][_0x5297('0x19')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1d53e3,_0x2a85b1[_0x5297('0x18')][_0x5297('0x1a')]);return _0x14e19a(_0x2a85b1['error'][_0x5297('0x1a')]);}logger['error'](_0x5297('0x13'),_0x1d53e3,_0x2a85b1[_0x5297('0x18')][_0x5297('0x1a')]);return _0x37fddc(_0x2a85b1['error'][_0x5297('0x1a')]);}else{logger[_0x5297('0x12')](_0x5297('0x13'),_0x1d53e3,_0x5297('0x16'));_0x37fddc(_0x2a85b1[_0x5297('0x1b')][_0x5297('0x1a')]);}})[_0x5297('0x1c')](function(_0x3db466){logger[_0x5297('0x18')]('SmsMessage,\x20%s,\x20%s',_0x1d53e3,_0x3db466);_0x14e19a(_0x3db466);});});}exports['CreateSmsMessage']=function(_0x4a549e){var _0x4a2cc0=this;return new Promise(function(_0x202f0f,_0x513754){return db[_0x5297('0x1d')][_0x5297('0x1e')](_0x4a549e[_0x5297('0x1f')],{'raw':_0x4a549e[_0x5297('0x20')]?_0x4a549e[_0x5297('0x20')][_0x5297('0x21')]===undefined?!![]:![]:!![]})[_0x5297('0x11')](function(_0x102063){logger['info']('CreateSmsMessage',_0x4a549e);logger[_0x5297('0x14')](_0x5297('0x22'),_0x4a549e,JSON[_0x5297('0x17')](_0x102063));_0x202f0f(_0x102063);})[_0x5297('0x1c')](function(_0x6eb5ab){logger['error'](_0x5297('0x22'),_0x6eb5ab[_0x5297('0x1a')],_0x4a549e);_0x513754(_0x4a2cc0[_0x5297('0x18')](0x1f4,_0x6eb5ab[_0x5297('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e099a5a..60d9c2a 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 _0x4489=['register','smsMessage:','./smsMessage.events','remove'];(function(_0x393a34,_0x2486b3){var _0x7ad02c=function(_0x8c105b){while(--_0x8c105b){_0x393a34['push'](_0x393a34['shift']());}};_0x7ad02c(++_0x2486b3);}(_0x4489,0x1d2));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0x9448('0x0'));var events=['save',_0x9448('0x1'),'update'];function createListener(_0xce6228,_0x161084){return function(_0x15a44){_0x161084['emit'](_0xce6228,_0x15a44);};}function removeListener(_0x271a72,_0x6e86e7){return function(){SmsMessageEvents['removeListener'](_0x271a72,_0x6e86e7);};}exports[_0x9448('0x2')]=function(_0x2cf7b9){for(var _0x163759=0x0,_0x16dd22=events['length'];_0x163759<_0x16dd22;_0x163759++){var _0xf770d1=events[_0x163759];var _0x575243=createListener(_0x9448('0x3')+_0xf770d1,_0x2cf7b9);SmsMessageEvents['on'](_0xf770d1,_0x575243);}}; \ No newline at end of file +var _0x7fbe=['save','remove','update','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7fbe,0x8f));var _0xe7fb=function(_0x14f6db,_0x4d9f26){_0x14f6db=_0x14f6db-0x0;var _0x45344d=_0x7fbe[_0x14f6db];return _0x45344d;};'use strict';var SmsMessageEvents=require(_0xe7fb('0x0'));var events=[_0xe7fb('0x1'),_0xe7fb('0x2'),_0xe7fb('0x3')];function createListener(_0x267428,_0x2fdd18){return function(_0x137f39){_0x2fdd18['emit'](_0x267428,_0x137f39);};}function removeListener(_0x1413e0,_0x3ffefe){return function(){SmsMessageEvents[_0xe7fb('0x4')](_0x1413e0,_0x3ffefe);};}exports[_0xe7fb('0x5')]=function(_0x5e7ee0){for(var _0x591bc5=0x0,_0x31fceb=events[_0xe7fb('0x6')];_0x591bc5<_0x31fceb;_0x591bc5++){var _0x2a58f7=events[_0x591bc5];var _0x1f1ccf=createListener(_0xe7fb('0x7')+_0x2a58f7,_0x5e7ee0);SmsMessageEvents['on'](_0x2a58f7,_0x1f1ccf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index bf7beea..368aee6 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 _0xb12a=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb12a,0x142));var _0xab12=function(_0x282da8,_0x20e762){_0x282da8=_0x282da8-0x0;var _0x3e9090=_0xb12a[_0x282da8];return _0x3e9090;};'use strict';var multer=require(_0xab12('0x0'));var util=require(_0xab12('0x1'));var path=require(_0xab12('0x2'));var timeout=require(_0xab12('0x3'));var express=require(_0xab12('0x4'));var router=express[_0xab12('0x5')]();var auth=require(_0xab12('0x6'));var interaction=require(_0xab12('0x7'));var config=require(_0xab12('0x8'));var controller=require(_0xab12('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xab12('0xa')]);router[_0xab12('0xb')](_0xab12('0xc'),auth['isAuthenticated'](),controller[_0xab12('0xd')]);router[_0xab12('0xb')](_0xab12('0xe'),auth[_0xab12('0xf')](),controller[_0xab12('0x10')]);router['get'](_0xab12('0x11'),auth['isAuthenticated'](),controller[_0xab12('0x12')]);router[_0xab12('0xb')](_0xab12('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0xab12('0xb')](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x15')]);router['post']('/',auth[_0xab12('0xf')](),controller[_0xab12('0x16')]);router[_0xab12('0x17')](_0xab12('0x13'),auth['isAuthenticated'](),controller[_0xab12('0x18')]);router[_0xab12('0x17')](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x19')]);router[_0xab12('0x1a')](_0xab12('0xe'),auth['isAuthenticated'](),controller[_0xab12('0x1b')]);router[_0xab12('0x1c')](_0xab12('0xe'),auth[_0xab12('0xf')](),controller['destroy']);router[_0xab12('0x1c')](_0xab12('0x13'),auth[_0xab12('0xf')](),controller[_0xab12('0x1d')]);router['delete'](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x1e')]);module[_0xab12('0x1f')]=router; \ No newline at end of file +var _0x8c93=['show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','put','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x8c93,0x96));var _0x38c9=function(_0x1d787e,_0x300518){_0x1d787e=_0x1d787e-0x0;var _0x28b3e2=_0x8c93[_0x1d787e];return _0x28b3e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x38c9('0x0'));var timeout=require(_0x38c9('0x1'));var express=require(_0x38c9('0x2'));var router=express['Router']();var auth=require(_0x38c9('0x3'));var interaction=require(_0x38c9('0x4'));var config=require(_0x38c9('0x5'));var controller=require(_0x38c9('0x6'));router[_0x38c9('0x7')]('/',auth[_0x38c9('0x8')](),controller['index']);router[_0x38c9('0x7')](_0x38c9('0x9'),auth[_0x38c9('0x8')](),controller[_0x38c9('0xa')]);router[_0x38c9('0x7')](_0x38c9('0xb'),auth['isAuthenticated'](),controller[_0x38c9('0xc')]);router[_0x38c9('0x7')](_0x38c9('0xd'),auth[_0x38c9('0x8')](),controller[_0x38c9('0xe')]);router[_0x38c9('0x7')](_0x38c9('0xf'),auth[_0x38c9('0x8')](),controller[_0x38c9('0x10')]);router[_0x38c9('0x7')]('/:id/users',auth[_0x38c9('0x8')](),controller[_0x38c9('0x11')]);router[_0x38c9('0x12')]('/',auth[_0x38c9('0x8')](),controller[_0x38c9('0x13')]);router['post']('/:id/teams',auth[_0x38c9('0x8')](),controller['addTeams']);router['post'](_0x38c9('0x14'),auth[_0x38c9('0x8')](),controller['addAgents']);router[_0x38c9('0x15')]('/:id',auth[_0x38c9('0x8')](),controller['update']);router[_0x38c9('0x16')](_0x38c9('0xb'),auth['isAuthenticated'](),controller[_0x38c9('0x17')]);router[_0x38c9('0x16')]('/:id/teams',auth[_0x38c9('0x8')](),controller[_0x38c9('0x18')]);router[_0x38c9('0x16')]('/:id/users',auth[_0x38c9('0x8')](),controller[_0x38c9('0x19')]);module[_0x38c9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index cc415e3..8e73cd7 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 _0xa90a=['exports','name','ENUM','rrmemory','roundrobin'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa90a,0xb4));var _0xaa90=function(_0x35c094,_0x3bb7d3){_0x35c094=_0x35c094-0x0;var _0x2aa0bb=_0xa90a[_0x35c094];return _0x2aa0bb;};'use strict';var Sequelize=require('sequelize');module[_0xaa90('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xaa90('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa90('0x2')](_0xaa90('0x3'),'beepall',_0xaa90('0x4'))}}; \ No newline at end of file +var _0x1a8d=['INTEGER','rrmemory','roundrobin','STRING','name'];(function(_0x3bd8aa,_0x225695){var _0x976907=function(_0xd4c77a){while(--_0xd4c77a){_0x3bd8aa['push'](_0x3bd8aa['shift']());}};_0x976907(++_0x225695);}(_0x1a8d,0xb2));var _0xd1a8=function(_0xbac667,_0x3f113f){_0xbac667=_0xbac667-0x0;var _0xfce68f=_0x1a8d[_0xbac667];return _0xfce68f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd1a8('0x0')],'unique':_0xd1a8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd1a8('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd1a8('0x3'),'beepall',_0xd1a8('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4ebf46e..8ad6868 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 _0x0ba7=['query','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','User','findAndCountAll','UserId','agent','name','smsPause','updatedAt','createdAt','map','format','%s/%s','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','sequelize','each','forEach','emit','removeTeams','ids','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','addAgents','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','SmsQueue','rawAttributes','model','keys'];(function(_0x435c80,_0x29a3a1){var _0x1795d7=function(_0x5c7e11){while(--_0x5c7e11){_0x435c80['push'](_0x435c80['shift']());}};_0x1795d7(++_0x29a3a1);}(_0x0ba7,0x16d));var _0x70ba=function(_0x1b66b3,_0x173c72){_0x1b66b3=_0x1b66b3-0x0;var _0x404b96=_0x0ba7[_0x1b66b3];return _0x404b96;};'use strict';var pdf=require(_0x70ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x70ba('0x1'));var zipdir=require(_0x70ba('0x2'));var jsonpatch=require(_0x70ba('0x3'));var rp=require(_0x70ba('0x4'));var moment=require('moment');var BPromise=require(_0x70ba('0x5'));var Mustache=require(_0x70ba('0x6'));var util=require(_0x70ba('0x7'));var path=require(_0x70ba('0x8'));var sox=require(_0x70ba('0x9'));var csv=require(_0x70ba('0xa'));var ejs=require(_0x70ba('0xb'));var fs=require('fs');var _=require(_0x70ba('0xc'));var squel=require(_0x70ba('0xd'));var crypto=require(_0x70ba('0xe'));var jsforce=require(_0x70ba('0xf'));var deskjs=require(_0x70ba('0x10'));var toCsv=require(_0x70ba('0xa'));var querystring=require(_0x70ba('0x11'));var Papa=require(_0x70ba('0x12'));var Redis=require('ioredis');var authService=require(_0x70ba('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x70ba('0x14'));var logger=require(_0x70ba('0x15'))(_0x70ba('0x16'));var utils=require(_0x70ba('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x70ba('0x18')]=_['defaults'](config[_0x70ba('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x70ba('0x19'))(new Redis(config[_0x70ba('0x18')]));require('./smsQueue.socket')[_0x70ba('0x1a')](socket);function respondWithStatusCode(_0x57d84e,_0x51321d){_0x51321d=_0x51321d||0xcc;return function(_0x2728e1){if(_0x2728e1){return _0x57d84e[_0x70ba('0x1b')](_0x51321d);}return _0x57d84e[_0x70ba('0x1c')](_0x51321d)[_0x70ba('0x1d')]();};}function respondWithResult(_0x29734b,_0x232138){_0x232138=_0x232138||0xc8;return function(_0x164521){if(_0x164521){return _0x29734b[_0x70ba('0x1c')](_0x232138)[_0x70ba('0x1e')](_0x164521);}};}function respondWithFilteredResult(_0x30ac22,_0x41e11b){return function(_0x3a52a8){if(_0x3a52a8){var _0xb6d69a=_0x3a52a8[_0x70ba('0x1f')],_0x5ed907=_0x41e11b[_0x70ba('0x20')],_0x5dad2d=_0x41e11b[_0x70ba('0x20')]+_0x41e11b[_0x70ba('0x21')],_0x489cf9;if(_0x5dad2d>=_0xb6d69a){_0x5dad2d=_0xb6d69a;_0x489cf9=0xc8;}else{_0x489cf9=0xce;}_0x30ac22[_0x70ba('0x1c')](_0x489cf9);return _0x30ac22[_0x70ba('0x22')](_0x70ba('0x23'),_0x5ed907+'-'+_0x5dad2d+'/'+_0xb6d69a)[_0x70ba('0x1e')](_0x3a52a8);}return null;};}function patchUpdates(_0x415879){return function(_0x40b82c){try{jsonpatch[_0x70ba('0x24')](_0x40b82c,_0x415879,!![]);}catch(_0x221529){return BPromise[_0x70ba('0x25')](_0x221529);}return _0x40b82c[_0x70ba('0x26')]();};}function saveUpdates(_0x273ce4,_0x5ebe9d){return function(_0x3b31ef){if(_0x3b31ef){return _0x3b31ef[_0x70ba('0x27')](_0x273ce4)['then'](function(_0x123b0c){return _0x123b0c;});}return null;};}function removeEntity(_0x5519d4,_0x4868a1){return function(_0x112aeb){if(_0x112aeb){return _0x112aeb['destroy']()[_0x70ba('0x28')](function(){var _0x304a41=_0x112aeb['get']({'plain':!![]});var _0xf403fc='SmsQueues';return db['UserProfileResource'][_0x70ba('0x29')]({'where':{'type':_0xf403fc,'resourceId':_0x304a41['id']}})['then'](function(){return _0x112aeb;});})[_0x70ba('0x28')](function(){_0x5519d4[_0x70ba('0x1c')](0xcc)[_0x70ba('0x1d')]();});}};}function handleEntityNotFound(_0x33e218,_0x2c6d18){return function(_0x265423){if(!_0x265423){_0x33e218['sendStatus'](0x194);}return _0x265423;};}function handleError(_0x2d840e,_0x190bb5){_0x190bb5=_0x190bb5||0x1f4;return function(_0x797467){logger['error'](_0x797467[_0x70ba('0x2a')]);if(_0x797467['name']){delete _0x797467['name'];}_0x2d840e['status'](_0x190bb5)[_0x70ba('0x2b')](_0x797467);};}exports[_0x70ba('0x2c')]=function(_0x5b6e6e,_0x51b3e3){var _0x16dc2f={},_0x4ff810={},_0x102661={'count':0x0,'rows':[]};var _0x45d972=db[_0x70ba('0x2d')][_0x70ba('0x2e')];_0x4ff810[_0x70ba('0x2f')]=_[_0x70ba('0x30')](_0x45d972);_0x4ff810[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x5b6e6e[_0x70ba('0x31')]);_0x4ff810[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0x4ff810['model'],_0x4ff810['query']);_0x16dc2f[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x4ff810[_0x70ba('0x2f')],qs['fields'](_0x5b6e6e['query']['fields']));_0x16dc2f[_0x70ba('0x34')]=_0x16dc2f[_0x70ba('0x34')][_0x70ba('0x35')]?_0x16dc2f['attributes']:_0x4ff810[_0x70ba('0x2f')];if(!_0x5b6e6e['query']['hasOwnProperty'](_0x70ba('0x36'))){_0x16dc2f['limit']=qs[_0x70ba('0x21')](_0x5b6e6e[_0x70ba('0x31')]['limit']);_0x16dc2f[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x5b6e6e[_0x70ba('0x31')]['offset']);}_0x16dc2f[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x38')]);_0x16dc2f['where']=qs[_0x70ba('0x32')](_['pick'](_0x5b6e6e[_0x70ba('0x31')],_0x4ff810[_0x70ba('0x32')]));if(_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x39')]){_0x16dc2f[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x16dc2f[_0x70ba('0x3a')],{'$or':_['map'](_0x45d972,function(_0x29bab7){if(_0x29bab7[_0x70ba('0x3c')][_0x70ba('0x3d')]!==_0x70ba('0x3e')){var _0x18d1f9={};_0x18d1f9[_0x29bab7[_0x70ba('0x3f')]]={'$like':'%'+_0x5b6e6e['query'][_0x70ba('0x39')]+'%'};return _0x18d1f9;}})});}_0x16dc2f=_[_0x70ba('0x3b')]({},_0x16dc2f,_0x5b6e6e[_0x70ba('0x40')]);var _0x499bd8={'where':_0x16dc2f['where']};return db['SmsQueue'][_0x70ba('0x1f')](_0x499bd8)[_0x70ba('0x28')](function(_0x3424ea){_0x102661['count']=_0x3424ea;if(_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x41')]){_0x16dc2f[_0x70ba('0x42')]=[{'all':!![]}];}return db[_0x70ba('0x2d')][_0x70ba('0x43')](_0x16dc2f);})['then'](function(_0x5ee74c){_0x102661[_0x70ba('0x44')]=_0x5ee74c;return _0x102661;})[_0x70ba('0x28')](respondWithFilteredResult(_0x51b3e3,_0x16dc2f))[_0x70ba('0x45')](handleError(_0x51b3e3,null));};exports['show']=function(_0x595645,_0x2fc262){var _0x4d6467={'raw':!![],'where':{'id':_0x595645[_0x70ba('0x46')]['id']}},_0x30fdcd={};_0x30fdcd[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db[_0x70ba('0x2d')]['rawAttributes']);_0x30fdcd[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x595645[_0x70ba('0x31')]);_0x30fdcd[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0x30fdcd[_0x70ba('0x2f')],_0x30fdcd[_0x70ba('0x31')]);_0x4d6467[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x30fdcd[_0x70ba('0x2f')],qs[_0x70ba('0x47')](_0x595645[_0x70ba('0x31')][_0x70ba('0x47')]));_0x4d6467[_0x70ba('0x34')]=_0x4d6467[_0x70ba('0x34')]['length']?_0x4d6467[_0x70ba('0x34')]:_0x30fdcd[_0x70ba('0x2f')];if(_0x595645['query'][_0x70ba('0x41')]){_0x4d6467[_0x70ba('0x42')]=[{'all':!![]}];}_0x4d6467=_[_0x70ba('0x3b')]({},_0x4d6467,_0x595645[_0x70ba('0x40')]);return db[_0x70ba('0x2d')][_0x70ba('0x48')](_0x4d6467)[_0x70ba('0x28')](handleEntityNotFound(_0x2fc262,null))['then'](respondWithResult(_0x2fc262,null))[_0x70ba('0x45')](handleError(_0x2fc262,null));};exports[_0x70ba('0x49')]=function(_0x390cd0,_0x3d1f89){return db[_0x70ba('0x2d')][_0x70ba('0x49')](_0x390cd0[_0x70ba('0x4a')],{})[_0x70ba('0x28')](function(_0xc574b){var _0x23439d=_0x390cd0[_0x70ba('0x4b')][_0x70ba('0x4c')]({'plain':!![]});if(!_0x23439d)throw new Error(_0x70ba('0x4d'));if(_0x23439d[_0x70ba('0x4e')]===_0x70ba('0x4b')){var _0x2536cd=_0xc574b[_0x70ba('0x4c')]({'plain':!![]});var _0x4a848b=_0x70ba('0x4f');return db[_0x70ba('0x50')][_0x70ba('0x48')]({'where':{'name':_0x4a848b,'userProfileId':_0x23439d[_0x70ba('0x51')]},'raw':!![]})['then'](function(_0x47c40c){if(_0x47c40c&&_0x47c40c['autoAssociation']===0x0){return db[_0x70ba('0x52')][_0x70ba('0x49')]({'name':_0x2536cd['name'],'resourceId':_0x2536cd['id'],'type':_0x47c40c['name'],'sectionId':_0x47c40c['id']},{})[_0x70ba('0x28')](function(){return _0xc574b;});}else{return _0xc574b;}})[_0x70ba('0x45')](function(_0x3e3779){logger[_0x70ba('0x53')](_0x70ba('0x54'),_0x3e3779);throw _0x3e3779;});}return _0xc574b;})[_0x70ba('0x28')](respondWithResult(_0x3d1f89,0xc9))[_0x70ba('0x45')](handleError(_0x3d1f89,null));};exports['update']=function(_0x538e11,_0x361699){if(_0x538e11[_0x70ba('0x4a')]['id']){delete _0x538e11[_0x70ba('0x4a')]['id'];}return db[_0x70ba('0x2d')]['find']({'where':{'id':_0x538e11[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x361699,null))['then'](saveUpdates(_0x538e11['body'],null))['then'](respondWithResult(_0x361699,null))['catch'](handleError(_0x361699,null));};exports[_0x70ba('0x29')]=function(_0x2c4eaa,_0x1cb9c7){return db['SmsQueue'][_0x70ba('0x48')]({'where':{'id':_0x2c4eaa[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x1cb9c7,null))['then'](removeEntity(_0x1cb9c7,null))[_0x70ba('0x45')](handleError(_0x1cb9c7,null));};exports[_0x70ba('0x55')]=function(_0x4a231c,_0x49f89a){return db[_0x70ba('0x2d')][_0x70ba('0x55')]()[_0x70ba('0x28')](respondWithResult(_0x49f89a,null))[_0x70ba('0x45')](handleError(_0x49f89a,null));};exports[_0x70ba('0x56')]=function(_0x3717a0,_0x44cb31,_0x5e7a92){var _0x8ab9c6={'raw':!![],'where':{}},_0x27d101={},_0x4de412;return db['SmsQueue'][_0x70ba('0x57')]({'where':{'id':_0x3717a0[_0x70ba('0x46')]['id']}})['then'](handleEntityNotFound(_0x44cb31,null))['then'](function(_0x3279bf){if(_0x3279bf){_0x4de412=_0x3279bf['get']({'plain':!![]});_0x27d101['model']=_[_0x70ba('0x30')](db[_0x70ba('0x58')][_0x70ba('0x2e')]);_0x27d101[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x3717a0[_0x70ba('0x31')]);_0x27d101[_0x70ba('0x32')]=_['intersection'](_0x27d101[_0x70ba('0x2f')],_0x27d101[_0x70ba('0x31')]);_0x8ab9c6[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x27d101[_0x70ba('0x2f')],qs[_0x70ba('0x47')](_0x3717a0['query'][_0x70ba('0x47')]));_0x8ab9c6['attributes']=_0x8ab9c6[_0x70ba('0x34')]['length']?_0x8ab9c6[_0x70ba('0x34')]:_0x27d101[_0x70ba('0x2f')];if(!_0x3717a0[_0x70ba('0x31')][_0x70ba('0x59')](_0x70ba('0x36'))){_0x8ab9c6[_0x70ba('0x21')]=qs['limit'](_0x3717a0[_0x70ba('0x31')]['limit']);_0x8ab9c6['offset']=qs[_0x70ba('0x20')](_0x3717a0[_0x70ba('0x31')]['offset']);}_0x8ab9c6[_0x70ba('0x37')]=qs['sort'](_0x3717a0[_0x70ba('0x31')][_0x70ba('0x38')]);_0x8ab9c6[_0x70ba('0x3a')]=qs['filters'](_[_0x70ba('0x5a')](_0x3717a0['query'],_0x27d101[_0x70ba('0x32')]));_0x8ab9c6['where'][_0x70ba('0x5b')]=_0x3279bf['id'];if(_0x3717a0[_0x70ba('0x31')][_0x70ba('0x39')]){_0x8ab9c6[_0x70ba('0x3a')]=_['merge'](_0x8ab9c6[_0x70ba('0x3a')],{'$or':_['map'](_0x8ab9c6[_0x70ba('0x34')],function(_0x28e490){var _0x1b69d7={};_0x1b69d7[_0x28e490]={'$like':'%'+_0x3717a0[_0x70ba('0x31')]['filter']+'%'};return _0x1b69d7;})});}_0x8ab9c6=_[_0x70ba('0x3b')]({},_0x8ab9c6,_0x3717a0[_0x70ba('0x40')]);return db[_0x70ba('0x58')][_0x70ba('0x43')](_0x8ab9c6);}})[_0x70ba('0x28')](function(_0x42c42f){if(_0x42c42f){return db[_0x70ba('0x5c')][_0x70ba('0x5d')]({'where':{'id':_['map'](_0x42c42f,_0x70ba('0x5e')),'role':_0x70ba('0x5f')},'attributes':['id',_0x70ba('0x60'),_0x70ba('0x61'),_0x70ba('0x62'),_0x70ba('0x63')]});}})[_0x70ba('0x28')](function(_0x4d83ab){if(_0x4d83ab){return{'count':_0x4d83ab[_0x70ba('0x1f')],'rows':_[_0x70ba('0x64')](_0x4d83ab[_0x70ba('0x44')],function(_0x139e9a){return{'membername':_0x139e9a[_0x70ba('0x60')],'UserId':_0x139e9a['id'],'queue_name':_0x4de412[_0x70ba('0x60')],'SmsQueueId':_0x4de412['id'],'interface':util[_0x70ba('0x65')](_0x70ba('0x66'),'SIP',_0x139e9a['name']),'penalty':0x0,'paused':_0x139e9a[_0x70ba('0x61')],'createdAt':_0x139e9a[_0x70ba('0x63')],'updatedAt':_0x139e9a[_0x70ba('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x44cb31,_0x8ab9c6))[_0x70ba('0x45')](handleError(_0x44cb31,null));};exports[_0x70ba('0x67')]=function(_0x6df701,_0x4985be,_0x3e341a){var _0x31f911={};var _0xa9009d={};var _0x466a8b;var _0x3877ce;return db[_0x70ba('0x2d')][_0x70ba('0x57')]({'where':{'id':_0x6df701['params']['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x4985be,null))['then'](function(_0x5a6009){if(_0x5a6009){_0x466a8b=_0x5a6009;_0xa9009d[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db[_0x70ba('0x68')][_0x70ba('0x2e')]);_0xa9009d[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x6df701[_0x70ba('0x31')]);_0xa9009d[_0x70ba('0x32')]=_['intersection'](_0xa9009d[_0x70ba('0x2f')],_0xa9009d[_0x70ba('0x31')]);_0x31f911[_0x70ba('0x34')]=_['intersection'](_0xa9009d['model'],qs['fields'](_0x6df701[_0x70ba('0x31')]['fields']));_0x31f911['attributes']=_0x31f911['attributes'][_0x70ba('0x35')]?_0x31f911[_0x70ba('0x34')]:_0xa9009d[_0x70ba('0x2f')];_0x31f911[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x6df701['query']['sort']);_0x31f911[_0x70ba('0x3a')]=qs[_0x70ba('0x32')](_['pick'](_0x6df701[_0x70ba('0x31')],_0xa9009d[_0x70ba('0x32')]));if(_0x6df701[_0x70ba('0x31')]['filter']){_0x31f911[_0x70ba('0x3a')]=_['merge'](_0x31f911[_0x70ba('0x3a')],{'$or':_[_0x70ba('0x64')](_0x31f911['attributes'],function(_0xf8e8){var _0x5d6dcb={};_0x5d6dcb[_0xf8e8]={'$like':'%'+_0x6df701[_0x70ba('0x31')][_0x70ba('0x39')]+'%'};return _0x5d6dcb;})});}_0x31f911=_['merge']({},_0x31f911,_0x6df701[_0x70ba('0x40')]);return _0x466a8b[_0x70ba('0x67')](_0x31f911);}})[_0x70ba('0x28')](function(_0xb3c58c){if(_0xb3c58c){_0x3877ce=_0xb3c58c[_0x70ba('0x35')];if(!_0x6df701[_0x70ba('0x31')][_0x70ba('0x59')](_0x70ba('0x36'))){_0x31f911[_0x70ba('0x21')]=qs[_0x70ba('0x21')](_0x6df701['query'][_0x70ba('0x21')]);_0x31f911[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x6df701[_0x70ba('0x31')]['offset']);}return _0x466a8b[_0x70ba('0x67')](_0x31f911);}})['then'](function(_0x1ced9f){if(_0x1ced9f){return _0x1ced9f?{'count':_0x3877ce,'rows':_0x1ced9f}:null;}})['then'](respondWithResult(_0x4985be,null))[_0x70ba('0x45')](handleError(_0x4985be,null));};exports[_0x70ba('0x69')]=function(_0x56a430,_0x15a587,_0x849a57){var _0x8608f9=_0x56a430[_0x70ba('0x4a')][_0x70ba('0x6a')];return db[_0x70ba('0x68')][_0x70ba('0x43')]({'where':{'id':_[_0x70ba('0x64')](_0x8608f9,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x70ba('0x6b'),'attributes':['id',_0x70ba('0x60'),_0x70ba('0x6c'),_0x70ba('0x6d'),_0x70ba('0x6e')],'raw':!![]}]})[_0x70ba('0x28')](function(_0x263f33){if(_0x263f33){var _0x352146=_['flatMap'](_0x263f33,function(_0x17c4d1){var _0x3b4ee6=_0x17c4d1[_0x70ba('0x4c')]({'plain':!![]});return _0x3b4ee6['Agents'];});return db[_0x70ba('0x2d')][_0x70ba('0x48')]({'where':{'id':_0x56a430[_0x70ba('0x46')]['id']}})['then'](function(_0x5f29d0){return db[_0x70ba('0x6f')]['transaction'](function(_0x5e6759){return _0x5f29d0[_0x70ba('0x69')](_[_0x70ba('0x64')](_0x8608f9,'id'),{'transaction':_0x5e6759})[_0x70ba('0x28')](function(){return BPromise[_0x70ba('0x70')](_0x352146,function(_0x1eec17){return db[_0x70ba('0x58')]['findOrCreate']({'where':{'UserId':_0x1eec17['id'],'SmsQueueId':_0x56a430['params']['id']},'transaction':_0x5e6759});});})[_0x70ba('0x28')](function(){_0x352146[_0x70ba('0x71')](function(_0xa9e109){socket[_0x70ba('0x72')]('userSmsQueue:save',{'UserId':_0xa9e109['id'],'SmsQueueId':_0x5f29d0['id']});});});});});}})[_0x70ba('0x28')](respondWithStatusCode(_0x15a587,null))[_0x70ba('0x45')](handleError(_0x15a587,null));};exports[_0x70ba('0x73')]=function(_0xa1e932,_0x1aefed,_0x3e3e45){return db[_0x70ba('0x68')][_0x70ba('0x43')]({'where':{'id':_0xa1e932[_0x70ba('0x31')][_0x70ba('0x74')]},'attributes':['id'],'include':[{'model':db[_0x70ba('0x5c')],'as':_0x70ba('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x70ba('0x28')](handleEntityNotFound(_0x1aefed,null))[_0x70ba('0x28')](function(_0x53df7a){var _0x45bf67=_[_0x70ba('0x64')](_0x53df7a,'id');var _0x407b29=[];var _0x48efcc=[];var _0x5f2e0a=squel['select']();_0x5f2e0a[_0x70ba('0x3f')](_0x70ba('0x75'))[_0x70ba('0x76')](_0x70ba('0x77'),'tq')['join'](_0x70ba('0x78'),'ut',_0x70ba('0x79'))[_0x70ba('0x3a')](_0x70ba('0x7a'),_0xa1e932['params']['id']);for(var _0x488a4b=0x0;_0x488a4b<_0x53df7a['length'];_0x488a4b+=0x1){let _0x443ecb=_0x53df7a[_0x488a4b];for(var _0x5deba6=0x0;_0x5deba6<_0x443ecb[_0x70ba('0x6b')]['length'];_0x5deba6+=0x1){let _0x81bf0a=_0x443ecb[_0x70ba('0x6b')][_0x5deba6];var _0x4f9d65=_0x5f2e0a['clone']();_0x4f9d65[_0x70ba('0x3a')]('ut.UserId\x20=\x20?',_0x81bf0a['id']);_0x48efcc['push'](db[_0x70ba('0x6f')][_0x70ba('0x31')](_0x4f9d65[_0x70ba('0x7b')](),{'type':db[_0x70ba('0x6f')][_0x70ba('0x7c')][_0x70ba('0x7d')]})[_0x70ba('0x28')](function(_0x2c9391){if(_0x2c9391[_0x70ba('0x35')]===0x1){return _0x81bf0a['id'];}else{var _0x26c4a7=_[_0x70ba('0x7e')](_[_0x70ba('0x64')](_0x2c9391,_0x70ba('0x7f')),function(_0x3fcab5){return _[_0x70ba('0x80')](_0x45bf67,_0x3fcab5);});if(_0x26c4a7){return _0x81bf0a['id'];}}}));}}return BPromise['all'](_0x48efcc)[_0x70ba('0x28')](function(_0x3783f7){_0x407b29=_(_0x407b29)[_0x70ba('0x81')](_0x3783f7)['compact']()[_0x70ba('0x82')]();return db[_0x70ba('0x2d')]['find']({'where':{'id':_0xa1e932[_0x70ba('0x46')]['id']}})['then'](function(_0x4cf238){return db[_0x70ba('0x6f')]['transaction'](function(_0x33f16b){return _0x4cf238['removeTeams'](_0xa1e932[_0x70ba('0x31')][_0x70ba('0x74')],{'transaction':_0x33f16b})[_0x70ba('0x28')](function(){if(!_[_0x70ba('0x83')](_0x407b29)){return _0x4cf238[_0x70ba('0x84')](_0x407b29,{'transaction':_0x33f16b});}})[_0x70ba('0x28')](function(){_0x407b29[_0x70ba('0x71')](function(_0x360b23){socket[_0x70ba('0x72')]('userSmsQueue:remove',{'UserId':_0x360b23,'SmsQueueId':_0x4cf238['id']});});});});});});})[_0x70ba('0x28')](respondWithStatusCode(_0x1aefed,null))['catch'](handleError(_0x1aefed,null));};exports[_0x70ba('0x85')]=function(_0x2ad5a6,_0x14c624,_0x1359cc){return db[_0x70ba('0x2d')][_0x70ba('0x48')]({'where':{'id':_0x2ad5a6[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x14c624,null))[_0x70ba('0x28')](function(_0x5ebb9a){if(_0x5ebb9a){return _0x5ebb9a['addAgents'](_0x2ad5a6['body'][_0x70ba('0x74')],_['omit'](_0x2ad5a6[_0x70ba('0x4a')],[_0x70ba('0x74'),'id'])||{})[_0x70ba('0x86')](function(_0x5cbf63){for(var _0x1fc1a3=0x0;_0x1fc1a3<_0x2ad5a6[_0x70ba('0x4a')][_0x70ba('0x74')][_0x70ba('0x35')];_0x1fc1a3+=0x1){socket[_0x70ba('0x72')](_0x70ba('0x87'),{'UserId':_0x2ad5a6['body']['ids'][_0x1fc1a3],'SmsQueueId':_0x2ad5a6[_0x70ba('0x46')]['id']});}return _0x5cbf63;});}})[_0x70ba('0x28')](respondWithResult(_0x14c624,null))['catch'](handleError(_0x14c624,null));};exports[_0x70ba('0x84')]=function(_0x5905df,_0xe5e6ff,_0x2ef0af){return db['SmsQueue'][_0x70ba('0x48')]({'where':{'id':_0x5905df[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0xe5e6ff,null))[_0x70ba('0x28')](function(_0x4bb009){if(_0x4bb009){return _0x4bb009[_0x70ba('0x84')](_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')])[_0x70ba('0x28')](function(){if(_['isArray'](_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')])){for(var _0xeed7d5=0x0;_0xeed7d5<_0x5905df[_0x70ba('0x31')]['ids']['length'];_0xeed7d5+=0x1){socket[_0x70ba('0x72')](_0x70ba('0x88'),{'UserId':Number(_0x5905df['query'][_0x70ba('0x74')][_0xeed7d5]),'SmsQueueId':Number(_0x5905df[_0x70ba('0x46')]['id'])});}}else{socket[_0x70ba('0x72')](_0x70ba('0x88'),{'UserId':Number(_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')]),'SmsQueueId':Number(_0x5905df[_0x70ba('0x46')]['id'])});}});}})[_0x70ba('0x28')](respondWithStatusCode(_0xe5e6ff,null))[_0x70ba('0x45')](handleError(_0xe5e6ff,null));};exports[_0x70ba('0x89')]=function(_0x2740ac,_0x2772f2,_0x1d90be){var _0xa83ff8={};var _0xf94e68={};var _0x203622;var _0x459a61;return db['SmsQueue'][_0x70ba('0x57')]({'where':{'id':_0x2740ac[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x2772f2,null))[_0x70ba('0x28')](function(_0x322af0){if(_0x322af0){_0x203622=_0x322af0;_0xf94e68[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db['User']['rawAttributes']);_0xf94e68[_0x70ba('0x31')]=_['keys'](_0x2740ac[_0x70ba('0x31')]);_0xf94e68[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0xf94e68[_0x70ba('0x2f')],_0xf94e68[_0x70ba('0x31')]);_0xa83ff8[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0xf94e68['model'],qs[_0x70ba('0x47')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x47')]));_0xa83ff8[_0x70ba('0x34')]=_0xa83ff8[_0x70ba('0x34')][_0x70ba('0x35')]?_0xa83ff8['attributes']:_0xf94e68[_0x70ba('0x2f')];_0xa83ff8[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x38')]);_0xa83ff8[_0x70ba('0x3a')]=qs[_0x70ba('0x32')](_['pick'](_0x2740ac['query'],_0xf94e68[_0x70ba('0x32')]));if(_0x2740ac[_0x70ba('0x31')]['filter']){_0xa83ff8[_0x70ba('0x3a')]=_['merge'](_0xa83ff8[_0x70ba('0x3a')],{'$or':_[_0x70ba('0x64')](_0xa83ff8[_0x70ba('0x34')],function(_0x49aa28){var _0x4206b0={};_0x4206b0[_0x49aa28]={'$like':'%'+_0x2740ac[_0x70ba('0x31')][_0x70ba('0x39')]+'%'};return _0x4206b0;})});}_0xa83ff8=_[_0x70ba('0x3b')]({},_0xa83ff8,_0x2740ac[_0x70ba('0x40')]);return _0x203622['getAgents'](_0xa83ff8);}})[_0x70ba('0x28')](function(_0x237d3b){if(_0x237d3b){_0x459a61=_0x237d3b[_0x70ba('0x35')];if(!_0x2740ac['query'][_0x70ba('0x59')](_0x70ba('0x36'))){_0xa83ff8['limit']=qs[_0x70ba('0x21')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x21')]);_0xa83ff8[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x20')]);}return _0x203622[_0x70ba('0x89')](_0xa83ff8);}})[_0x70ba('0x28')](function(_0x48c6c0){if(_0x48c6c0){return _0x48c6c0?{'count':_0x459a61,'rows':_0x48c6c0}:null;}})[_0x70ba('0x28')](respondWithResult(_0x2772f2,null))[_0x70ba('0x45')](handleError(_0x2772f2,null));}; \ No newline at end of file +var _0xca66=['spread','isArray','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','index','SmsQueue','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','params','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','rows','format','%s/%s','smsPause','createdAt','getTeams','Team','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xca66,0x8b));var _0x6ca6=function(_0x15130f,_0x332f3f){_0x15130f=_0x15130f-0x0;var _0x255ee9=_0xca66[_0x15130f];return _0x255ee9;};'use strict';var pdf=require(_0x6ca6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca6('0x1'));var jsonpatch=require(_0x6ca6('0x2'));var rp=require(_0x6ca6('0x3'));var moment=require('moment');var BPromise=require(_0x6ca6('0x4'));var Mustache=require('mustache');var util=require(_0x6ca6('0x5'));var path=require('path');var sox=require(_0x6ca6('0x6'));var csv=require(_0x6ca6('0x7'));var ejs=require(_0x6ca6('0x8'));var fs=require('fs');var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x7'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var hardwareService=require(_0x6ca6('0x12'));var logger=require('../../config/logger')(_0x6ca6('0x13'));var utils=require(_0x6ca6('0x14'));var config=require(_0x6ca6('0x15'));var db=require(_0x6ca6('0x16'))['db'];config[_0x6ca6('0x17')]=_[_0x6ca6('0x18')](config['redis'],{'host':_0x6ca6('0x19'),'port':0x18eb});var socket=require(_0x6ca6('0x1a'))(new Redis(config['redis']));require(_0x6ca6('0x1b'))[_0x6ca6('0x1c')](socket);function respondWithStatusCode(_0x3f417f,_0x3570f1){_0x3570f1=_0x3570f1||0xcc;return function(_0xc774c){if(_0xc774c){return _0x3f417f[_0x6ca6('0x1d')](_0x3570f1);}return _0x3f417f['status'](_0x3570f1)['end']();};}function respondWithResult(_0x5785b1,_0x36ff3e){_0x36ff3e=_0x36ff3e||0xc8;return function(_0x19e94f){if(_0x19e94f){return _0x5785b1[_0x6ca6('0x1e')](_0x36ff3e)[_0x6ca6('0x1f')](_0x19e94f);}};}function respondWithFilteredResult(_0x2c4a5c,_0x3d7f3f){return function(_0x25dc6c){if(_0x25dc6c){var _0x4f056d=_0x25dc6c[_0x6ca6('0x20')],_0x2391ce=_0x3d7f3f[_0x6ca6('0x21')],_0x10be57=_0x3d7f3f[_0x6ca6('0x21')]+_0x3d7f3f[_0x6ca6('0x22')],_0xc97f0;if(_0x10be57>=_0x4f056d){_0x10be57=_0x4f056d;_0xc97f0=0xc8;}else{_0xc97f0=0xce;}_0x2c4a5c[_0x6ca6('0x1e')](_0xc97f0);return _0x2c4a5c[_0x6ca6('0x23')](_0x6ca6('0x24'),_0x2391ce+'-'+_0x10be57+'/'+_0x4f056d)[_0x6ca6('0x1f')](_0x25dc6c);}return null;};}function patchUpdates(_0x4c3be9){return function(_0x28a982){try{jsonpatch[_0x6ca6('0x25')](_0x28a982,_0x4c3be9,!![]);}catch(_0x38cad4){return BPromise[_0x6ca6('0x26')](_0x38cad4);}return _0x28a982[_0x6ca6('0x27')]();};}function saveUpdates(_0x438694,_0x593f15){return function(_0xfb962d){if(_0xfb962d){return _0xfb962d[_0x6ca6('0x28')](_0x438694)['then'](function(_0x4927c1){return _0x4927c1;});}return null;};}function removeEntity(_0xfbf496,_0x216701){return function(_0xfe0760){if(_0xfe0760){return _0xfe0760[_0x6ca6('0x29')]()[_0x6ca6('0x2a')](function(){var _0x541122=_0xfe0760[_0x6ca6('0x2b')]({'plain':!![]});var _0x1d6caa=_0x6ca6('0x2c');return db[_0x6ca6('0x2d')][_0x6ca6('0x29')]({'where':{'type':_0x1d6caa,'resourceId':_0x541122['id']}})[_0x6ca6('0x2a')](function(){return _0xfe0760;});})[_0x6ca6('0x2a')](function(){_0xfbf496[_0x6ca6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b07f,_0x144ec5){return function(_0x9467bd){if(!_0x9467bd){_0x55b07f[_0x6ca6('0x1d')](0x194);}return _0x9467bd;};}function handleError(_0x141c0f,_0x552f3e){_0x552f3e=_0x552f3e||0x1f4;return function(_0x5ea6f7){logger[_0x6ca6('0x2e')](_0x5ea6f7['stack']);if(_0x5ea6f7['name']){delete _0x5ea6f7[_0x6ca6('0x2f')];}_0x141c0f[_0x6ca6('0x1e')](_0x552f3e)['send'](_0x5ea6f7);};}exports[_0x6ca6('0x30')]=function(_0xf829ee,_0xac50e8){var _0x566543={},_0x484411={},_0x28af50={'count':0x0,'rows':[]};var _0x23112a=db[_0x6ca6('0x31')][_0x6ca6('0x32')];_0x484411['model']=_[_0x6ca6('0x33')](_0x23112a);_0x484411[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0xf829ee[_0x6ca6('0x34')]);_0x484411['filters']=_['intersection'](_0x484411['model'],_0x484411['query']);_0x566543['attributes']=_[_0x6ca6('0x35')](_0x484411[_0x6ca6('0x36')],qs[_0x6ca6('0x37')](_0xf829ee['query'][_0x6ca6('0x37')]));_0x566543[_0x6ca6('0x38')]=_0x566543[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x566543['attributes']:_0x484411[_0x6ca6('0x36')];if(!_0xf829ee[_0x6ca6('0x34')][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x566543['limit']=qs[_0x6ca6('0x22')](_0xf829ee['query'][_0x6ca6('0x22')]);_0x566543['offset']=qs['offset'](_0xf829ee[_0x6ca6('0x34')][_0x6ca6('0x21')]);}_0x566543[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0xf829ee['query']['sort']);_0x566543[_0x6ca6('0x3e')]=qs[_0x6ca6('0x3f')](_['pick'](_0xf829ee[_0x6ca6('0x34')],_0x484411['filters']));if(_0xf829ee[_0x6ca6('0x34')]['filter']){_0x566543[_0x6ca6('0x3e')]=_[_0x6ca6('0x40')](_0x566543[_0x6ca6('0x3e')],{'$or':_[_0x6ca6('0x41')](_0x23112a,function(_0x33b5e6){if(_0x33b5e6[_0x6ca6('0x42')][_0x6ca6('0x43')]!==_0x6ca6('0x44')){var _0x5c3ffc={};_0x5c3ffc[_0x33b5e6[_0x6ca6('0x45')]]={'$like':'%'+_0xf829ee['query']['filter']+'%'};return _0x5c3ffc;}})});}_0x566543=_[_0x6ca6('0x40')]({},_0x566543,_0xf829ee[_0x6ca6('0x46')]);var _0x52cc41={'where':_0x566543[_0x6ca6('0x3e')]};return db['SmsQueue'][_0x6ca6('0x20')](_0x52cc41)[_0x6ca6('0x2a')](function(_0x3f9e8f){_0x28af50[_0x6ca6('0x20')]=_0x3f9e8f;if(_0xf829ee['query']['includeAll']){_0x566543[_0x6ca6('0x47')]=[{'all':!![]}];}return db[_0x6ca6('0x31')][_0x6ca6('0x48')](_0x566543);})[_0x6ca6('0x2a')](function(_0x4e6d4){_0x28af50['rows']=_0x4e6d4;return _0x28af50;})[_0x6ca6('0x2a')](respondWithFilteredResult(_0xac50e8,_0x566543))[_0x6ca6('0x49')](handleError(_0xac50e8,null));};exports['show']=function(_0x317b5e,_0x3b60db){var _0x323051={'raw':!![],'where':{'id':_0x317b5e[_0x6ca6('0x4a')]['id']}},_0x2fda54={};_0x2fda54[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x31')][_0x6ca6('0x32')]);_0x2fda54['query']=_[_0x6ca6('0x33')](_0x317b5e[_0x6ca6('0x34')]);_0x2fda54[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x2fda54[_0x6ca6('0x36')],_0x2fda54[_0x6ca6('0x34')]);_0x323051[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x2fda54['model'],qs['fields'](_0x317b5e[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x323051[_0x6ca6('0x38')]=_0x323051[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x323051[_0x6ca6('0x38')]:_0x2fda54[_0x6ca6('0x36')];if(_0x317b5e['query']['includeAll']){_0x323051[_0x6ca6('0x47')]=[{'all':!![]}];}_0x323051=_[_0x6ca6('0x40')]({},_0x323051,_0x317b5e['options']);return db[_0x6ca6('0x31')][_0x6ca6('0x4b')](_0x323051)[_0x6ca6('0x2a')](handleEntityNotFound(_0x3b60db,null))[_0x6ca6('0x2a')](respondWithResult(_0x3b60db,null))[_0x6ca6('0x49')](handleError(_0x3b60db,null));};exports[_0x6ca6('0x4c')]=function(_0x13efc1,_0x5f27f5){return db[_0x6ca6('0x31')][_0x6ca6('0x4c')](_0x13efc1[_0x6ca6('0x4d')],{})['then'](function(_0x408df3){var _0x4dd78d=_0x13efc1[_0x6ca6('0x4e')]['get']({'plain':!![]});if(!_0x4dd78d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dd78d['role']===_0x6ca6('0x4e')){var _0x1603a7=_0x408df3[_0x6ca6('0x2b')]({'plain':!![]});var _0x5546c3=_0x6ca6('0x2c');return db['UserProfileSection'][_0x6ca6('0x4b')]({'where':{'name':_0x5546c3,'userProfileId':_0x4dd78d[_0x6ca6('0x4f')]},'raw':!![]})[_0x6ca6('0x2a')](function(_0x18602d){if(_0x18602d&&_0x18602d[_0x6ca6('0x50')]===0x0){return db[_0x6ca6('0x2d')][_0x6ca6('0x4c')]({'name':_0x1603a7[_0x6ca6('0x2f')],'resourceId':_0x1603a7['id'],'type':_0x18602d[_0x6ca6('0x2f')],'sectionId':_0x18602d['id']},{})[_0x6ca6('0x2a')](function(){return _0x408df3;});}else{return _0x408df3;}})[_0x6ca6('0x49')](function(_0x5578fb){logger[_0x6ca6('0x2e')](_0x6ca6('0x51'),_0x5578fb);throw _0x5578fb;});}return _0x408df3;})[_0x6ca6('0x2a')](respondWithResult(_0x5f27f5,0xc9))[_0x6ca6('0x49')](handleError(_0x5f27f5,null));};exports[_0x6ca6('0x28')]=function(_0x594209,_0x14d87a){if(_0x594209[_0x6ca6('0x4d')]['id']){delete _0x594209[_0x6ca6('0x4d')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x594209['params']['id']}})['then'](handleEntityNotFound(_0x14d87a,null))[_0x6ca6('0x2a')](saveUpdates(_0x594209[_0x6ca6('0x4d')],null))[_0x6ca6('0x2a')](respondWithResult(_0x14d87a,null))['catch'](handleError(_0x14d87a,null));};exports['destroy']=function(_0x387adf,_0x2cbf30){return db[_0x6ca6('0x31')]['find']({'where':{'id':_0x387adf[_0x6ca6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2cbf30,null))[_0x6ca6('0x2a')](removeEntity(_0x2cbf30,null))[_0x6ca6('0x49')](handleError(_0x2cbf30,null));};exports[_0x6ca6('0x52')]=function(_0x16af08,_0x511eb1){return db[_0x6ca6('0x31')]['describe']()['then'](respondWithResult(_0x511eb1,null))[_0x6ca6('0x49')](handleError(_0x511eb1,null));};exports[_0x6ca6('0x53')]=function(_0x1b9da5,_0x35854a,_0x50321f){var _0x2b893c={'raw':!![],'where':{}},_0x1c12ae={},_0x2c4053;return db[_0x6ca6('0x31')][_0x6ca6('0x54')]({'where':{'id':_0x1b9da5[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x35854a,null))[_0x6ca6('0x2a')](function(_0x98004d){if(_0x98004d){_0x2c4053=_0x98004d[_0x6ca6('0x2b')]({'plain':!![]});_0x1c12ae[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x55')][_0x6ca6('0x32')]);_0x1c12ae[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x1b9da5['query']);_0x1c12ae[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x1c12ae[_0x6ca6('0x36')],_0x1c12ae[_0x6ca6('0x34')]);_0x2b893c[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x1c12ae[_0x6ca6('0x36')],qs[_0x6ca6('0x37')](_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x2b893c[_0x6ca6('0x38')]=_0x2b893c[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x2b893c[_0x6ca6('0x38')]:_0x1c12ae[_0x6ca6('0x36')];if(!_0x1b9da5[_0x6ca6('0x34')]['hasOwnProperty'](_0x6ca6('0x3b'))){_0x2b893c[_0x6ca6('0x22')]=qs[_0x6ca6('0x22')](_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x22')]);_0x2b893c[_0x6ca6('0x21')]=qs['offset'](_0x1b9da5['query']['offset']);}_0x2b893c[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x1b9da5['query'][_0x6ca6('0x3d')]);_0x2b893c[_0x6ca6('0x3e')]=qs[_0x6ca6('0x3f')](_['pick'](_0x1b9da5[_0x6ca6('0x34')],_0x1c12ae[_0x6ca6('0x3f')]));_0x2b893c[_0x6ca6('0x3e')][_0x6ca6('0x56')]=_0x98004d['id'];if(_0x1b9da5[_0x6ca6('0x34')]['filter']){_0x2b893c['where']=_[_0x6ca6('0x40')](_0x2b893c[_0x6ca6('0x3e')],{'$or':_['map'](_0x2b893c[_0x6ca6('0x38')],function(_0x43ec39){var _0x217dc8={};_0x217dc8[_0x43ec39]={'$like':'%'+_0x1b9da5[_0x6ca6('0x34')][_0x6ca6('0x57')]+'%'};return _0x217dc8;})});}_0x2b893c=_[_0x6ca6('0x40')]({},_0x2b893c,_0x1b9da5[_0x6ca6('0x46')]);return db[_0x6ca6('0x55')][_0x6ca6('0x48')](_0x2b893c);}})['then'](function(_0x4d6098){if(_0x4d6098){return db[_0x6ca6('0x58')][_0x6ca6('0x59')]({'where':{'id':_[_0x6ca6('0x41')](_0x4d6098,_0x6ca6('0x5a')),'role':_0x6ca6('0x5b')},'attributes':['id',_0x6ca6('0x2f'),'smsPause',_0x6ca6('0x5c'),'createdAt']});}})[_0x6ca6('0x2a')](function(_0x44bbe6){if(_0x44bbe6){return{'count':_0x44bbe6[_0x6ca6('0x20')],'rows':_[_0x6ca6('0x41')](_0x44bbe6[_0x6ca6('0x5d')],function(_0x5a2775){return{'membername':_0x5a2775['name'],'UserId':_0x5a2775['id'],'queue_name':_0x2c4053[_0x6ca6('0x2f')],'SmsQueueId':_0x2c4053['id'],'interface':util[_0x6ca6('0x5e')](_0x6ca6('0x5f'),'SIP',_0x5a2775[_0x6ca6('0x2f')]),'penalty':0x0,'paused':_0x5a2775[_0x6ca6('0x60')],'createdAt':_0x5a2775[_0x6ca6('0x61')],'updatedAt':_0x5a2775[_0x6ca6('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35854a,_0x2b893c))[_0x6ca6('0x49')](handleError(_0x35854a,null));};exports[_0x6ca6('0x62')]=function(_0x3637c9,_0x48d7cb,_0x680c6f){var _0x574c7a={};var _0x6f225b={};var _0x1652f7;var _0x246535;return db[_0x6ca6('0x31')][_0x6ca6('0x54')]({'where':{'id':_0x3637c9[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x48d7cb,null))['then'](function(_0x5d9d14){if(_0x5d9d14){_0x1652f7=_0x5d9d14;_0x6f225b[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x63')]['rawAttributes']);_0x6f225b[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x3637c9[_0x6ca6('0x34')]);_0x6f225b[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x6f225b[_0x6ca6('0x36')],_0x6f225b['query']);_0x574c7a['attributes']=_[_0x6ca6('0x35')](_0x6f225b['model'],qs[_0x6ca6('0x37')](_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x574c7a[_0x6ca6('0x38')]=_0x574c7a[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x574c7a[_0x6ca6('0x38')]:_0x6f225b['model'];_0x574c7a[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x3d')]);_0x574c7a['where']=qs['filters'](_['pick'](_0x3637c9[_0x6ca6('0x34')],_0x6f225b[_0x6ca6('0x3f')]));if(_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x57')]){_0x574c7a[_0x6ca6('0x3e')]=_['merge'](_0x574c7a[_0x6ca6('0x3e')],{'$or':_[_0x6ca6('0x41')](_0x574c7a['attributes'],function(_0x233193){var _0x33791f={};_0x33791f[_0x233193]={'$like':'%'+_0x3637c9[_0x6ca6('0x34')]['filter']+'%'};return _0x33791f;})});}_0x574c7a=_[_0x6ca6('0x40')]({},_0x574c7a,_0x3637c9[_0x6ca6('0x46')]);return _0x1652f7['getTeams'](_0x574c7a);}})[_0x6ca6('0x2a')](function(_0x5d97d4){if(_0x5d97d4){_0x246535=_0x5d97d4[_0x6ca6('0x39')];if(!_0x3637c9[_0x6ca6('0x34')][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x574c7a[_0x6ca6('0x22')]=qs['limit'](_0x3637c9[_0x6ca6('0x34')]['limit']);_0x574c7a[_0x6ca6('0x21')]=qs[_0x6ca6('0x21')](_0x3637c9[_0x6ca6('0x34')]['offset']);}return _0x1652f7['getTeams'](_0x574c7a);}})[_0x6ca6('0x2a')](function(_0x250106){if(_0x250106){return _0x250106?{'count':_0x246535,'rows':_0x250106}:null;}})[_0x6ca6('0x2a')](respondWithResult(_0x48d7cb,null))[_0x6ca6('0x49')](handleError(_0x48d7cb,null));};exports[_0x6ca6('0x64')]=function(_0x2b224f,_0x1b8c6e,_0x43f97f){var _0x5ed025=_0x2b224f[_0x6ca6('0x4d')][_0x6ca6('0x65')];return db[_0x6ca6('0x63')][_0x6ca6('0x48')]({'where':{'id':_[_0x6ca6('0x41')](_0x5ed025,'id')},'attributes':['id'],'include':[{'model':db[_0x6ca6('0x58')],'as':_0x6ca6('0x66'),'attributes':['id',_0x6ca6('0x2f'),_0x6ca6('0x67'),_0x6ca6('0x68'),'interface'],'raw':!![]}]})[_0x6ca6('0x2a')](function(_0x2753e5){if(_0x2753e5){var _0x2b0a5b=_[_0x6ca6('0x69')](_0x2753e5,function(_0x471049){var _0x1e3c64=_0x471049['get']({'plain':!![]});return _0x1e3c64[_0x6ca6('0x66')];});return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x2b224f['params']['id']}})[_0x6ca6('0x2a')](function(_0x4d5c23){return db[_0x6ca6('0x6a')][_0x6ca6('0x6b')](function(_0x435e0d){return _0x4d5c23['addTeams'](_[_0x6ca6('0x41')](_0x5ed025,'id'),{'transaction':_0x435e0d})['then'](function(){return BPromise[_0x6ca6('0x6c')](_0x2b0a5b,function(_0x5a1da4){return db['UserSmsQueue'][_0x6ca6('0x6d')]({'where':{'UserId':_0x5a1da4['id'],'SmsQueueId':_0x2b224f[_0x6ca6('0x4a')]['id']},'transaction':_0x435e0d});});})[_0x6ca6('0x2a')](function(){_0x2b0a5b[_0x6ca6('0x6e')](function(_0x3aeba2){socket['emit'](_0x6ca6('0x6f'),{'UserId':_0x3aeba2['id'],'SmsQueueId':_0x4d5c23['id']});});});});});}})[_0x6ca6('0x2a')](respondWithStatusCode(_0x1b8c6e,null))[_0x6ca6('0x49')](handleError(_0x1b8c6e,null));};exports[_0x6ca6('0x70')]=function(_0x231894,_0x203030,_0x5e6f79){return db[_0x6ca6('0x63')][_0x6ca6('0x48')]({'where':{'id':_0x231894[_0x6ca6('0x34')][_0x6ca6('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ca6('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x203030,null))[_0x6ca6('0x2a')](function(_0x54a9c0){var _0x1b04cd=_[_0x6ca6('0x41')](_0x54a9c0,'id');var _0x239cf5=[];var _0x5a7711=[];var _0x31cec5=squel[_0x6ca6('0x72')]();_0x31cec5['field'](_0x6ca6('0x73'))['from'](_0x6ca6('0x74'),'tq')[_0x6ca6('0x75')](_0x6ca6('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6ca6('0x3e')]('SmsQueueId\x20=\x20?',_0x231894[_0x6ca6('0x4a')]['id']);for(var _0x4c0dc3=0x0;_0x4c0dc3<_0x54a9c0[_0x6ca6('0x39')];_0x4c0dc3+=0x1){let _0x20f752=_0x54a9c0[_0x4c0dc3];for(var _0x49d7a6=0x0;_0x49d7a6<_0x20f752[_0x6ca6('0x66')][_0x6ca6('0x39')];_0x49d7a6+=0x1){let _0x50be27=_0x20f752[_0x6ca6('0x66')][_0x49d7a6];var _0x29bb05=_0x31cec5[_0x6ca6('0x77')]();_0x29bb05[_0x6ca6('0x3e')](_0x6ca6('0x78'),_0x50be27['id']);_0x5a7711[_0x6ca6('0x79')](db[_0x6ca6('0x6a')][_0x6ca6('0x34')](_0x29bb05['toString'](),{'type':db[_0x6ca6('0x6a')]['QueryTypes'][_0x6ca6('0x7a')]})['then'](function(_0x49a777){if(_0x49a777[_0x6ca6('0x39')]===0x1){return _0x50be27['id'];}else{var _0x327de1=_['every'](_[_0x6ca6('0x41')](_0x49a777,'TeamId'),function(_0x575777){return _[_0x6ca6('0x7b')](_0x1b04cd,_0x575777);});if(_0x327de1){return _0x50be27['id'];}}}));}}return BPromise[_0x6ca6('0x7c')](_0x5a7711)[_0x6ca6('0x2a')](function(_0x1ae672){_0x239cf5=_(_0x239cf5)[_0x6ca6('0x7d')](_0x1ae672)[_0x6ca6('0x7e')]()[_0x6ca6('0x7f')]();return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x231894['params']['id']}})[_0x6ca6('0x2a')](function(_0x5f57a8){return db['sequelize']['transaction'](function(_0x138e13){return _0x5f57a8[_0x6ca6('0x70')](_0x231894[_0x6ca6('0x34')][_0x6ca6('0x71')],{'transaction':_0x138e13})[_0x6ca6('0x2a')](function(){if(!_[_0x6ca6('0x80')](_0x239cf5)){return _0x5f57a8[_0x6ca6('0x81')](_0x239cf5,{'transaction':_0x138e13});}})[_0x6ca6('0x2a')](function(){_0x239cf5[_0x6ca6('0x6e')](function(_0x377b88){socket[_0x6ca6('0x82')](_0x6ca6('0x83'),{'UserId':_0x377b88,'SmsQueueId':_0x5f57a8['id']});});});});});});})[_0x6ca6('0x2a')](respondWithStatusCode(_0x203030,null))[_0x6ca6('0x49')](handleError(_0x203030,null));};exports[_0x6ca6('0x84')]=function(_0x151e6b,_0x414c95,_0x4badbe){return db['SmsQueue'][_0x6ca6('0x4b')]({'where':{'id':_0x151e6b[_0x6ca6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x414c95,null))['then'](function(_0x9edf69){if(_0x9edf69){return _0x9edf69[_0x6ca6('0x84')](_0x151e6b[_0x6ca6('0x4d')][_0x6ca6('0x71')],_['omit'](_0x151e6b[_0x6ca6('0x4d')],[_0x6ca6('0x71'),'id'])||{})[_0x6ca6('0x85')](function(_0x17ed8a){for(var _0x387c7e=0x0;_0x387c7e<_0x151e6b[_0x6ca6('0x4d')][_0x6ca6('0x71')][_0x6ca6('0x39')];_0x387c7e+=0x1){socket[_0x6ca6('0x82')](_0x6ca6('0x6f'),{'UserId':_0x151e6b[_0x6ca6('0x4d')]['ids'][_0x387c7e],'SmsQueueId':_0x151e6b[_0x6ca6('0x4a')]['id']});}return _0x17ed8a;});}})[_0x6ca6('0x2a')](respondWithResult(_0x414c95,null))[_0x6ca6('0x49')](handleError(_0x414c95,null));};exports['removeAgents']=function(_0x49945e,_0x1abfda,_0x10916e){return db[_0x6ca6('0x31')][_0x6ca6('0x4b')]({'where':{'id':_0x49945e['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x1abfda,null))[_0x6ca6('0x2a')](function(_0x333596){if(_0x333596){return _0x333596[_0x6ca6('0x81')](_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')])[_0x6ca6('0x2a')](function(){if(_[_0x6ca6('0x86')](_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')])){for(var _0x81faf=0x0;_0x81faf<_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')][_0x6ca6('0x39')];_0x81faf+=0x1){socket[_0x6ca6('0x82')](_0x6ca6('0x83'),{'UserId':Number(_0x49945e[_0x6ca6('0x34')][_0x6ca6('0x71')][_0x81faf]),'SmsQueueId':Number(_0x49945e['params']['id'])});}}else{socket['emit'](_0x6ca6('0x83'),{'UserId':Number(_0x49945e['query'][_0x6ca6('0x71')]),'SmsQueueId':Number(_0x49945e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1abfda,null))[_0x6ca6('0x49')](handleError(_0x1abfda,null));};exports[_0x6ca6('0x87')]=function(_0x281b6e,_0x3cb167,_0x4b830d){var _0x4d5528={};var _0x34ea3e={};var _0x3050a6;var _0x3fc98e;return db[_0x6ca6('0x31')]['findOne']({'where':{'id':_0x281b6e[_0x6ca6('0x4a')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x3cb167,null))[_0x6ca6('0x2a')](function(_0x5de503){if(_0x5de503){_0x3050a6=_0x5de503;_0x34ea3e[_0x6ca6('0x36')]=_['keys'](db[_0x6ca6('0x58')][_0x6ca6('0x32')]);_0x34ea3e[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x281b6e[_0x6ca6('0x34')]);_0x34ea3e[_0x6ca6('0x3f')]=_[_0x6ca6('0x35')](_0x34ea3e[_0x6ca6('0x36')],_0x34ea3e[_0x6ca6('0x34')]);_0x4d5528[_0x6ca6('0x38')]=_[_0x6ca6('0x35')](_0x34ea3e[_0x6ca6('0x36')],qs['fields'](_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x37')]));_0x4d5528[_0x6ca6('0x38')]=_0x4d5528[_0x6ca6('0x38')][_0x6ca6('0x39')]?_0x4d5528[_0x6ca6('0x38')]:_0x34ea3e[_0x6ca6('0x36')];_0x4d5528[_0x6ca6('0x3c')]=qs[_0x6ca6('0x3d')](_0x281b6e[_0x6ca6('0x34')]['sort']);_0x4d5528['where']=qs[_0x6ca6('0x3f')](_['pick'](_0x281b6e[_0x6ca6('0x34')],_0x34ea3e[_0x6ca6('0x3f')]));if(_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x57')]){_0x4d5528['where']=_['merge'](_0x4d5528['where'],{'$or':_[_0x6ca6('0x41')](_0x4d5528[_0x6ca6('0x38')],function(_0x3564c1){var _0x4721d8={};_0x4721d8[_0x3564c1]={'$like':'%'+_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x57')]+'%'};return _0x4721d8;})});}_0x4d5528=_['merge']({},_0x4d5528,_0x281b6e[_0x6ca6('0x46')]);return _0x3050a6[_0x6ca6('0x87')](_0x4d5528);}})[_0x6ca6('0x2a')](function(_0x1b270c){if(_0x1b270c){_0x3fc98e=_0x1b270c[_0x6ca6('0x39')];if(!_0x281b6e['query'][_0x6ca6('0x3a')](_0x6ca6('0x3b'))){_0x4d5528['limit']=qs[_0x6ca6('0x22')](_0x281b6e[_0x6ca6('0x34')][_0x6ca6('0x22')]);_0x4d5528[_0x6ca6('0x21')]=qs[_0x6ca6('0x21')](_0x281b6e['query'][_0x6ca6('0x21')]);}return _0x3050a6[_0x6ca6('0x87')](_0x4d5528);}})[_0x6ca6('0x2a')](function(_0x453109){if(_0x453109){return _0x453109?{'count':_0x3fc98e,'rows':_0x453109}:null;}})[_0x6ca6('0x2a')](respondWithResult(_0x3cb167,null))[_0x6ca6('0x49')](handleError(_0x3cb167,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index a1bdfb6..48d77b4 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 _0x10a6=['emit','hook','exports','events','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x4cb487,_0x1502f3){var _0x4eabd9=function(_0x2842f3){while(--_0x2842f3){_0x4cb487['push'](_0x4cb487['shift']());}};_0x4eabd9(++_0x1502f3);}(_0x10a6,0x1e0));var _0x610a=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x10a6[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x610a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x610a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x610a('0x2')](0x0);var events={'afterCreate':_0x610a('0x3'),'afterUpdate':_0x610a('0x4'),'afterDestroy':_0x610a('0x5')};function emitEvent(_0x30a39d){return function(_0x3ffeb1,_0x2cd2c7,_0x13e4d4){SmsQueueEvents[_0x610a('0x6')](_0x30a39d+':'+_0x3ffeb1['id'],_0x3ffeb1);SmsQueueEvents[_0x610a('0x6')](_0x30a39d,_0x3ffeb1);_0x13e4d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x610a('0x7')](e,emitEvent(event));}}module[_0x610a('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xaede=['events','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x18b66a,_0x238c7c){var _0x3c2d0d=function(_0x2fb978){while(--_0x2fb978){_0x18b66a['push'](_0x18b66a['shift']());}};_0x3c2d0d(++_0x238c7c);}(_0xaede,0x6c));var _0xeaed=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaede[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xeaed('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xeaed('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xeaed('0x2')](0x0);var events={'afterCreate':_0xeaed('0x3'),'afterUpdate':'update','afterDestroy':_0xeaed('0x4')};function emitEvent(_0x5c5c9b){return function(_0x28570e,_0x36f78f,_0x49bd46){SmsQueueEvents[_0xeaed('0x5')](_0x5c5c9b+':'+_0x28570e['id'],_0x28570e);SmsQueueEvents[_0xeaed('0x5')](_0x5c5c9b,_0x28570e);_0x49bd46(null);};}for(var e in events){if(events[_0xeaed('0x6')](e)){var event=events[e];SmsQueue[_0xeaed('0x7')](e,emitEvent(event));}}module[_0xeaed('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 36cb840..3c7c663 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 _0xb511=['rimraf','../../config/environment','exports','define','SmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb511,0x165));var _0x1b51=function(_0x5231da,_0x4f4898){_0x5231da=_0x5231da-0x0;var _0x1a36c1=_0xb511[_0x5231da];return _0x1a36c1;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./smsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','./smsQueue.attributes','exports'];(function(_0x4f9ad5,_0x3a7fed){var _0x4bc194=function(_0x4e6d61){while(--_0x4e6d61){_0x4f9ad5['push'](_0x4f9ad5['shift']());}};_0x4bc194(++_0x3a7fed);}(_0x4c60,0xc1));var _0x04c6=function(_0x32b58a,_0x43447e){_0x32b58a=_0x32b58a-0x0;var _0x13b2b3=_0x4c60[_0x32b58a];return _0x13b2b3;};'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/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index e6fd154..cf70134 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 _0x5c85=['options','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','register','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0x5c85,0xc1));var _0x55c8=function(_0x4d0449,_0x12acb2){_0x4d0449=_0x4d0449-0x0;var _0x4b44c8=_0x5c85[_0x4d0449];return _0x4b44c8;};'use strict';var _=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var moment=require(_0x55c8('0x2'));var BPromise=require(_0x55c8('0x3'));var rs=require(_0x55c8('0x4'));var fs=require('fs');var Redis=require(_0x55c8('0x5'));var db=require(_0x55c8('0x6'))['db'];var utils=require(_0x55c8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x55c8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55c8('0x9')]({'port':0x232a});config[_0x55c8('0xa')]=_[_0x55c8('0xb')](config['redis'],{'host':_0x55c8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55c8('0xa')]));require('./smsQueue.socket')[_0x55c8('0xd')](socket);function respondWithRpcPromise(_0x316791,_0x80f28e,_0x3064dc){return new BPromise(function(_0x26ed35,_0x1e548d){return client[_0x55c8('0xe')](_0x316791,_0x3064dc)[_0x55c8('0xf')](function(_0x3f994f){logger['info']('SmsQueue,\x20%s,\x20%s',_0x80f28e,'request\x20sent');logger[_0x55c8('0x10')](_0x55c8('0x11'),_0x80f28e,_0x55c8('0x12'),JSON[_0x55c8('0x13')](_0x3f994f));if(_0x3f994f[_0x55c8('0x14')]){if(_0x3f994f[_0x55c8('0x14')]['code']===0x1f4){logger['error'](_0x55c8('0x15'),_0x80f28e,_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);return _0x1e548d(_0x3f994f['error'][_0x55c8('0x16')]);}logger[_0x55c8('0x14')]('SmsQueue,\x20%s,\x20%s',_0x80f28e,_0x3f994f[_0x55c8('0x14')]['message']);return _0x26ed35(_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);}else{logger[_0x55c8('0x17')](_0x55c8('0x15'),_0x80f28e,_0x55c8('0x12'));_0x26ed35(_0x3f994f[_0x55c8('0x18')]['message']);}})[_0x55c8('0x19')](function(_0x1e83ef){logger[_0x55c8('0x14')](_0x55c8('0x15'),_0x80f28e,_0x1e83ef);_0x1e548d(_0x1e83ef);});});}exports[_0x55c8('0x1a')]=function(_0x3397de){var _0x8f3932=this;return new Promise(function(_0xe07cfe,_0x477e5a){return db[_0x55c8('0x1b')][_0x55c8('0x1c')]({'raw':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')][_0x55c8('0x1e')]||null:null,'attributes':_0x3397de['options']?_0x3397de['options'][_0x55c8('0x1f')]||null:null,'limit':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')][_0x55c8('0x20')]||null:null,'include':_0x3397de[_0x55c8('0x1d')]?_0x3397de['options'][_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x3397de['options'][_0x55c8('0x21')],function(_0x1dbef2){return{'model':db[_0x1dbef2[_0x55c8('0x23')]],'as':_0x1dbef2['as'],'attributes':_0x1dbef2['attributes'],'include':_0x1dbef2[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x1dbef2['include'],function(_0x2e25f1){return{'model':db[_0x2e25f1[_0x55c8('0x23')]],'as':_0x2e25f1['as'],'attributes':_0x2e25f1['attributes'],'include':_0x2e25f1[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x2e25f1[_0x55c8('0x21')],function(_0x29963f){return{'model':db[_0x29963f['model']],'as':_0x29963f['as'],'attributes':_0x29963f[_0x55c8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x55c8('0xf')](function(_0x2118cf){logger['info'](_0x55c8('0x1a'),_0x3397de);logger[_0x55c8('0x10')](_0x55c8('0x1a'),_0x3397de,JSON[_0x55c8('0x13')](_0x2118cf));_0xe07cfe(_0x2118cf);})['catch'](function(_0x2b179a){logger[_0x55c8('0x14')](_0x55c8('0x1a'),_0x2b179a['message'],_0x3397de);_0x477e5a(_0x8f3932[_0x55c8('0x14')](0x1f4,_0x2b179a[_0x55c8('0x16')]));});});};exports[_0x55c8('0x24')]=function(_0x996580){var _0x3f5215=this;return new Promise(function(_0x71aa89,_0x2f5598){return db[_0x55c8('0x1b')]['find']({'raw':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')][_0x55c8('0x1e')]||null:null,'attributes':_0x996580[_0x55c8('0x1d')]?_0x996580['options'][_0x55c8('0x1f')]||null:null,'include':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')]['include']?_[_0x55c8('0x22')](_0x996580[_0x55c8('0x1d')][_0x55c8('0x21')],function(_0x364ef2){return{'model':db[_0x364ef2[_0x55c8('0x23')]],'as':_0x364ef2['as'],'attributes':_0x364ef2[_0x55c8('0x1f')],'include':_0x364ef2[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x364ef2[_0x55c8('0x21')],function(_0xa7348a){return{'model':db[_0xa7348a[_0x55c8('0x23')]],'as':_0xa7348a['as'],'attributes':_0xa7348a[_0x55c8('0x1f')],'include':_0xa7348a[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0xa7348a[_0x55c8('0x21')],function(_0x5ae700){return{'model':db[_0x5ae700['model']],'as':_0x5ae700['as'],'attributes':_0x5ae700[_0x55c8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x55c8('0xf')](function(_0x57ead9){logger[_0x55c8('0x17')](_0x55c8('0x24'),_0x996580);logger[_0x55c8('0x10')](_0x55c8('0x24'),_0x996580,JSON['stringify'](_0x57ead9));_0x71aa89(_0x57ead9);})[_0x55c8('0x19')](function(_0x5117aa){logger[_0x55c8('0x14')]('ShowSmsQueue',_0x5117aa[_0x55c8('0x16')],_0x996580);_0x2f5598(_0x3f5215[_0x55c8('0x14')](0x1f4,_0x5117aa[_0x55c8('0x16')]));});});}; \ No newline at end of file +var _0xaf40=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','include','model','attributes','map','ShowSmsQueue','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xaf40,0x75));var _0x0af4=function(_0x526196,_0x5ef7ec){_0x526196=_0x526196-0x0;var _0x3bd4b6=_0xaf40[_0x526196];return _0x3bd4b6;};'use strict';var _=require('lodash');var util=require(_0x0af4('0x0'));var moment=require(_0x0af4('0x1'));var BPromise=require(_0x0af4('0x2'));var rs=require(_0x0af4('0x3'));var fs=require('fs');var Redis=require(_0x0af4('0x4'));var db=require(_0x0af4('0x5'))['db'];var utils=require(_0x0af4('0x6'));var logger=require(_0x0af4('0x7'))(_0x0af4('0x8'));var config=require(_0x0af4('0x9'));var jayson=require(_0x0af4('0xa'));var client=jayson[_0x0af4('0xb')][_0x0af4('0xc')]({'port':0x232a});config[_0x0af4('0xd')]=_[_0x0af4('0xe')](config['redis'],{'host':_0x0af4('0xf'),'port':0x18eb});var socket=require(_0x0af4('0x10'))(new Redis(config[_0x0af4('0xd')]));require(_0x0af4('0x11'))['register'](socket);function respondWithRpcPromise(_0x51b6bd,_0x16e623,_0x1681a6){return new BPromise(function(_0x1cb9ab,_0x565b2a){return client[_0x0af4('0x12')](_0x51b6bd,_0x1681a6)[_0x0af4('0x13')](function(_0x17387b){logger[_0x0af4('0x14')](_0x0af4('0x15'),_0x16e623,'request\x20sent');logger[_0x0af4('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x16e623,_0x0af4('0x17'),JSON[_0x0af4('0x18')](_0x17387b));if(_0x17387b[_0x0af4('0x19')]){if(_0x17387b[_0x0af4('0x19')][_0x0af4('0x1a')]===0x1f4){logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);return _0x565b2a(_0x17387b['error'][_0x0af4('0x1b')]);}logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);return _0x1cb9ab(_0x17387b[_0x0af4('0x19')][_0x0af4('0x1b')]);}else{logger[_0x0af4('0x14')](_0x0af4('0x15'),_0x16e623,_0x0af4('0x17'));_0x1cb9ab(_0x17387b[_0x0af4('0x1c')][_0x0af4('0x1b')]);}})[_0x0af4('0x1d')](function(_0x8d5d9a){logger[_0x0af4('0x19')](_0x0af4('0x15'),_0x16e623,_0x8d5d9a);_0x565b2a(_0x8d5d9a);});});}exports[_0x0af4('0x1e')]=function(_0x2d7c81){var _0x158b61=this;return new Promise(function(_0xee965e,_0x3a35db){return db[_0x0af4('0x1f')][_0x0af4('0x20')]({'raw':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')][_0x0af4('0x22')]||null:null,'attributes':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['attributes']||null:null,'limit':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81[_0x0af4('0x21')]['limit']||null:null,'include':_0x2d7c81[_0x0af4('0x21')]?_0x2d7c81['options'][_0x0af4('0x23')]?_['map'](_0x2d7c81[_0x0af4('0x21')][_0x0af4('0x23')],function(_0x22b8cb){return{'model':db[_0x22b8cb[_0x0af4('0x24')]],'as':_0x22b8cb['as'],'attributes':_0x22b8cb[_0x0af4('0x25')],'include':_0x22b8cb[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x22b8cb[_0x0af4('0x23')],function(_0x4a25df){return{'model':db[_0x4a25df[_0x0af4('0x24')]],'as':_0x4a25df['as'],'attributes':_0x4a25df[_0x0af4('0x25')],'include':_0x4a25df[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x4a25df['include'],function(_0x671395){return{'model':db[_0x671395['model']],'as':_0x671395['as'],'attributes':_0x671395['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55ac36){logger[_0x0af4('0x14')](_0x0af4('0x1e'),_0x2d7c81);logger[_0x0af4('0x16')](_0x0af4('0x1e'),_0x2d7c81,JSON[_0x0af4('0x18')](_0x55ac36));_0xee965e(_0x55ac36);})[_0x0af4('0x1d')](function(_0x40d858){logger[_0x0af4('0x19')](_0x0af4('0x1e'),_0x40d858[_0x0af4('0x1b')],_0x2d7c81);_0x3a35db(_0x158b61[_0x0af4('0x19')](0x1f4,_0x40d858[_0x0af4('0x1b')]));});});};exports[_0x0af4('0x27')]=function(_0xee6ec0){var _0x365a54=this;return new Promise(function(_0x274bc3,_0x1615eb){return db['SmsQueue']['find']({'raw':_0xee6ec0['options']?_0xee6ec0[_0x0af4('0x21')][_0x0af4('0x28')]===undefined?!![]:![]:!![],'where':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0[_0x0af4('0x21')]['where']||null:null,'attributes':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0[_0x0af4('0x21')][_0x0af4('0x25')]||null:null,'include':_0xee6ec0[_0x0af4('0x21')]?_0xee6ec0['options'][_0x0af4('0x23')]?_[_0x0af4('0x26')](_0xee6ec0['options'][_0x0af4('0x23')],function(_0x22039f){return{'model':db[_0x22039f[_0x0af4('0x24')]],'as':_0x22039f['as'],'attributes':_0x22039f['attributes'],'include':_0x22039f[_0x0af4('0x23')]?_[_0x0af4('0x26')](_0x22039f[_0x0af4('0x23')],function(_0x5a1371){return{'model':db[_0x5a1371[_0x0af4('0x24')]],'as':_0x5a1371['as'],'attributes':_0x5a1371[_0x0af4('0x25')],'include':_0x5a1371[_0x0af4('0x23')]?_['map'](_0x5a1371[_0x0af4('0x23')],function(_0x4021eb){return{'model':db[_0x4021eb[_0x0af4('0x24')]],'as':_0x4021eb['as'],'attributes':_0x4021eb[_0x0af4('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x280446){logger[_0x0af4('0x14')](_0x0af4('0x27'),_0xee6ec0);logger[_0x0af4('0x16')](_0x0af4('0x27'),_0xee6ec0,JSON[_0x0af4('0x18')](_0x280446));_0x274bc3(_0x280446);})[_0x0af4('0x1d')](function(_0x17dc7d){logger[_0x0af4('0x19')](_0x0af4('0x27'),_0x17dc7d['message'],_0xee6ec0);_0x1615eb(_0x365a54[_0x0af4('0x19')](0x1f4,_0x17dc7d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 948b53c..f37479e 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 _0xdba3=['register','length','./smsQueue.events','save','update','emit','removeListener'];(function(_0x51f12a,_0x2371da){var _0xd378b=function(_0x5a00b0){while(--_0x5a00b0){_0x51f12a['push'](_0x51f12a['shift']());}};_0xd378b(++_0x2371da);}(_0xdba3,0x19f));var _0x3dba=function(_0xa9a402,_0x3d9102){_0xa9a402=_0xa9a402-0x0;var _0x497163=_0xdba3[_0xa9a402];return _0x497163;};'use strict';var SmsQueueEvents=require(_0x3dba('0x0'));var events=[_0x3dba('0x1'),'remove',_0x3dba('0x2')];function createListener(_0x36351d,_0x2d9be4){return function(_0x10ec9b){_0x2d9be4[_0x3dba('0x3')](_0x36351d,_0x10ec9b);};}function removeListener(_0x2a7760,_0x3e018a){return function(){SmsQueueEvents[_0x3dba('0x4')](_0x2a7760,_0x3e018a);};}exports[_0x3dba('0x5')]=function(_0x374134){for(var _0x50995d=0x0,_0xa6f5ad=events[_0x3dba('0x6')];_0x50995d<_0xa6f5ad;_0x50995d++){var _0x4ed4f8=events[_0x50995d];var _0x5c1f2a=createListener('smsQueue:'+_0x4ed4f8,_0x374134);SmsQueueEvents['on'](_0x4ed4f8,_0x5c1f2a);}}; \ No newline at end of file +var _0xe314=['update','emit','removeListener','length','smsQueue:','save','remove'];(function(_0x226642,_0x5b611d){var _0x41ec1a=function(_0x3d1b32){while(--_0x3d1b32){_0x226642['push'](_0x226642['shift']());}};_0x41ec1a(++_0x5b611d);}(_0xe314,0x7c));var _0x4e31=function(_0x8131d9,_0x2b2b89){_0x8131d9=_0x8131d9-0x0;var _0x55b063=_0xe314[_0x8131d9];return _0x55b063;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x4e31('0x0'),_0x4e31('0x1'),_0x4e31('0x2')];function createListener(_0xc8a121,_0x27fc63){return function(_0x21e52f){_0x27fc63[_0x4e31('0x3')](_0xc8a121,_0x21e52f);};}function removeListener(_0x13b7fa,_0x63cecc){return function(){SmsQueueEvents[_0x4e31('0x4')](_0x13b7fa,_0x63cecc);};}exports['register']=function(_0x49b2a7){for(var _0x3c5e06=0x0,_0x29d63d=events[_0x4e31('0x5')];_0x3c5e06<_0x29d63d;_0x3c5e06++){var _0x311a10=events[_0x3c5e06];var _0x430fb9=createListener(_0x4e31('0x6')+_0x311a10,_0x49b2a7);SmsQueueEvents['on'](_0x311a10,_0x430fb9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a7298c7..182c0ec 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 _0xf435=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf435,0x174));var _0x5f43=function(_0xa35025,_0x5a3c3d){_0xa35025=_0xa35025-0x0;var _0xcd1b2f=_0xf435[_0xa35025];return _0xcd1b2f;};'use strict';var multer=require('multer');var util=require(_0x5f43('0x0'));var path=require(_0x5f43('0x1'));var timeout=require(_0x5f43('0x2'));var express=require(_0x5f43('0x3'));var router=express[_0x5f43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5f43('0x5'));var config=require(_0x5f43('0x6'));var controller=require(_0x5f43('0x7'));router[_0x5f43('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f43('0x9')]);router[_0x5f43('0x8')](_0x5f43('0xa'),auth['isAuthenticated'](),controller[_0x5f43('0xb')]);router[_0x5f43('0x8')](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller[_0x5f43('0xe')]);router[_0x5f43('0xf')]('/',auth[_0x5f43('0xd')](),controller[_0x5f43('0x10')]);router[_0x5f43('0x11')](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller['update']);router['delete'](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller[_0x5f43('0x12')]);module[_0x5f43('0x13')]=router; \ No newline at end of file +var _0xf603=['./smsQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf603,0x124));var _0x3f60=function(_0xfa8a07,_0x36234a){_0xfa8a07=_0xfa8a07-0x0;var _0x5911e8=_0xf603[_0xfa8a07];return _0x5911e8;};'use strict';var multer=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var path=require('path');var timeout=require(_0x3f60('0x2'));var express=require(_0x3f60('0x3'));var router=express[_0x3f60('0x4')]();var auth=require(_0x3f60('0x5'));var interaction=require(_0x3f60('0x6'));var config=require(_0x3f60('0x7'));var controller=require(_0x3f60('0x8'));router[_0x3f60('0x9')]('/',auth[_0x3f60('0xa')](),controller['index']);router['get']('/describe',auth[_0x3f60('0xa')](),controller[_0x3f60('0xb')]);router[_0x3f60('0x9')](_0x3f60('0xc'),auth[_0x3f60('0xa')](),controller[_0x3f60('0xd')]);router[_0x3f60('0xe')]('/',auth[_0x3f60('0xa')](),controller[_0x3f60('0xf')]);router[_0x3f60('0x10')](_0x3f60('0xc'),auth[_0x3f60('0xa')](),controller[_0x3f60('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3f60('0x12')]);module[_0x3f60('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 56f8cf4..5fa9a97 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 _0x0c80=['STRING','DATE','sequelize','exports'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x0c80,0x8e));var _0x00c8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0c80[_0x46698a];return _0x356db0;};'use strict';var moment=require('moment');var Sequelize=require(_0x00c8('0x0'));module[_0x00c8('0x1')]={'uniqueid':{'type':Sequelize[_0x00c8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x00c8('0x2')]},'joinAt':{'type':Sequelize[_0x00c8('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb471=['STRING','DATE','moment','sequelize'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0xb471,0xb2));var _0x1b47=function(_0x512076,_0x21509b){_0x512076=_0x512076-0x0;var _0x88c447=_0xb471[_0x512076];return _0x88c447;};'use strict';var moment=require(_0x1b47('0x0'));var Sequelize=require(_0x1b47('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1b47('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1b47('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1b47('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1b47('0x3')]},'reason':{'type':Sequelize[_0x1b47('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 022f5c2..dba94f6 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 _0x3495=['../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','limit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x58ae1c,_0x445cfe){var _0x316337=function(_0x131bef){while(--_0x131bef){_0x58ae1c['push'](_0x58ae1c['shift']());}};_0x316337(++_0x445cfe);}(_0x3495,0x1de));var _0x5349=function(_0x9a7dd6,_0x53af91){_0x9a7dd6=_0x9a7dd6-0x0;var _0x294df1=_0x3495[_0x9a7dd6];return _0x294df1;};'use strict';var pdf=require(_0x5349('0x0'));var emlformat=require(_0x5349('0x1'));var rimraf=require(_0x5349('0x2'));var zipdir=require(_0x5349('0x3'));var jsonpatch=require(_0x5349('0x4'));var rp=require(_0x5349('0x5'));var moment=require(_0x5349('0x6'));var BPromise=require(_0x5349('0x7'));var Mustache=require(_0x5349('0x8'));var util=require('util');var path=require(_0x5349('0x9'));var sox=require(_0x5349('0xa'));var csv=require('to-csv');var ejs=require(_0x5349('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xe'));var querystring=require(_0x5349('0xf'));var Papa=require(_0x5349('0x10'));var Redis=require(_0x5349('0x11'));var authService=require(_0x5349('0x12'));var qs=require(_0x5349('0x13'));var hardwareService=require(_0x5349('0x14'));var logger=require('../../config/logger')(_0x5349('0x15'));var utils=require('../../config/utils');var config=require(_0x5349('0x16'));var db=require(_0x5349('0x17'))['db'];function respondWithStatusCode(_0xcf06a8,_0x11d230){_0x11d230=_0x11d230||0xcc;return function(_0x2f5172){if(_0x2f5172){return _0xcf06a8[_0x5349('0x18')](_0x11d230);}return _0xcf06a8[_0x5349('0x19')](_0x11d230)[_0x5349('0x1a')]();};}function respondWithResult(_0x3227bd,_0x3890a8){_0x3890a8=_0x3890a8||0xc8;return function(_0x534e31){if(_0x534e31){return _0x3227bd[_0x5349('0x19')](_0x3890a8)[_0x5349('0x1b')](_0x534e31);}};}function respondWithFilteredResult(_0x47b25d,_0x1ed049){return function(_0x269f7f){if(_0x269f7f){var _0x2fe611=_0x269f7f[_0x5349('0x1c')],_0x49bbec=_0x1ed049['offset'],_0x5bcb3a=_0x1ed049[_0x5349('0x1d')]+_0x1ed049['limit'],_0x558fbb;if(_0x5bcb3a>=_0x2fe611){_0x5bcb3a=_0x2fe611;_0x558fbb=0xc8;}else{_0x558fbb=0xce;}_0x47b25d[_0x5349('0x19')](_0x558fbb);return _0x47b25d[_0x5349('0x1e')](_0x5349('0x1f'),_0x49bbec+'-'+_0x5bcb3a+'/'+_0x2fe611)[_0x5349('0x1b')](_0x269f7f);}return null;};}function patchUpdates(_0x4e128c){return function(_0x22d1ca){try{jsonpatch[_0x5349('0x20')](_0x22d1ca,_0x4e128c,!![]);}catch(_0x8abbe3){return BPromise[_0x5349('0x21')](_0x8abbe3);}return _0x22d1ca['save']();};}function saveUpdates(_0xeaab5a,_0x3594a4){return function(_0x4f2cb6){if(_0x4f2cb6){return _0x4f2cb6['update'](_0xeaab5a)['then'](function(_0x423581){return _0x423581;});}return null;};}function removeEntity(_0x48ba3c,_0x270593){return function(_0x1ff911){if(_0x1ff911){return _0x1ff911[_0x5349('0x22')]()[_0x5349('0x23')](function(){_0x48ba3c[_0x5349('0x19')](0xcc)[_0x5349('0x1a')]();});}};}function handleEntityNotFound(_0x303250,_0x43a0c2){return function(_0x2a3258){if(!_0x2a3258){_0x303250[_0x5349('0x18')](0x194);}return _0x2a3258;};}function handleError(_0x1a84ce,_0x52520){_0x52520=_0x52520||0x1f4;return function(_0x57af6c){logger[_0x5349('0x24')](_0x57af6c[_0x5349('0x25')]);if(_0x57af6c[_0x5349('0x26')]){delete _0x57af6c['name'];}_0x1a84ce[_0x5349('0x19')](_0x52520)['send'](_0x57af6c);};}exports[_0x5349('0x27')]=function(_0x203896,_0x1db8cc){var _0x49153e={},_0x1b5e87={},_0xc3e727={'count':0x0,'rows':[]};var _0x228dce=db[_0x5349('0x28')][_0x5349('0x29')];_0x1b5e87[_0x5349('0x2a')]=_[_0x5349('0x2b')](_0x228dce);_0x1b5e87[_0x5349('0x2c')]=_[_0x5349('0x2b')](_0x203896['query']);_0x1b5e87[_0x5349('0x2d')]=_[_0x5349('0x2e')](_0x1b5e87['model'],_0x1b5e87[_0x5349('0x2c')]);_0x49153e['attributes']=_[_0x5349('0x2e')](_0x1b5e87[_0x5349('0x2a')],qs[_0x5349('0x2f')](_0x203896[_0x5349('0x2c')][_0x5349('0x2f')]));_0x49153e[_0x5349('0x30')]=_0x49153e['attributes'][_0x5349('0x31')]?_0x49153e[_0x5349('0x30')]:_0x1b5e87[_0x5349('0x2a')];if(!_0x203896[_0x5349('0x2c')]['hasOwnProperty']('nolimit')){_0x49153e[_0x5349('0x32')]=qs[_0x5349('0x32')](_0x203896[_0x5349('0x2c')]['limit']);_0x49153e[_0x5349('0x1d')]=qs['offset'](_0x203896[_0x5349('0x2c')][_0x5349('0x1d')]);}_0x49153e[_0x5349('0x33')]=qs[_0x5349('0x34')](_0x203896[_0x5349('0x2c')][_0x5349('0x34')]);_0x49153e['where']=qs['filters'](_[_0x5349('0x35')](_0x203896[_0x5349('0x2c')],_0x1b5e87[_0x5349('0x2d')]));if(_0x203896[_0x5349('0x2c')][_0x5349('0x36')]){_0x49153e[_0x5349('0x37')]=_[_0x5349('0x38')](_0x49153e['where'],{'$or':_['map'](_0x228dce,function(_0x246f27){if(_0x246f27['type']['key']!==_0x5349('0x39')){var _0x4e5b28={};_0x4e5b28[_0x246f27[_0x5349('0x3a')]]={'$like':'%'+_0x203896[_0x5349('0x2c')][_0x5349('0x36')]+'%'};return _0x4e5b28;}})});}_0x49153e=_['merge']({},_0x49153e,_0x203896[_0x5349('0x3b')]);var _0x47a41a={'where':_0x49153e[_0x5349('0x37')]};return db[_0x5349('0x28')][_0x5349('0x1c')](_0x47a41a)['then'](function(_0x48a765){_0xc3e727['count']=_0x48a765;if(_0x203896[_0x5349('0x2c')][_0x5349('0x3c')]){_0x49153e[_0x5349('0x3d')]=[{'all':!![]}];}return db[_0x5349('0x28')][_0x5349('0x3e')](_0x49153e);})[_0x5349('0x23')](function(_0x50c506){_0xc3e727['rows']=_0x50c506;return _0xc3e727;})[_0x5349('0x23')](respondWithFilteredResult(_0x1db8cc,_0x49153e))[_0x5349('0x3f')](handleError(_0x1db8cc,null));};exports[_0x5349('0x40')]=function(_0x53f062,_0x7ca6dc){var _0x30ea46={'raw':!![],'where':{'id':_0x53f062[_0x5349('0x41')]['id']}},_0x30faff={};_0x30faff['model']=_[_0x5349('0x2b')](db['SmsQueueReport'][_0x5349('0x29')]);_0x30faff[_0x5349('0x2c')]=_['keys'](_0x53f062[_0x5349('0x2c')]);_0x30faff[_0x5349('0x2d')]=_[_0x5349('0x2e')](_0x30faff[_0x5349('0x2a')],_0x30faff[_0x5349('0x2c')]);_0x30ea46[_0x5349('0x30')]=_[_0x5349('0x2e')](_0x30faff['model'],qs['fields'](_0x53f062[_0x5349('0x2c')][_0x5349('0x2f')]));_0x30ea46[_0x5349('0x30')]=_0x30ea46[_0x5349('0x30')]['length']?_0x30ea46[_0x5349('0x30')]:_0x30faff['model'];if(_0x53f062['query'][_0x5349('0x3c')]){_0x30ea46[_0x5349('0x3d')]=[{'all':!![]}];}_0x30ea46=_[_0x5349('0x38')]({},_0x30ea46,_0x53f062[_0x5349('0x3b')]);return db['SmsQueueReport'][_0x5349('0x42')](_0x30ea46)[_0x5349('0x23')](handleEntityNotFound(_0x7ca6dc,null))[_0x5349('0x23')](respondWithResult(_0x7ca6dc,null))[_0x5349('0x3f')](handleError(_0x7ca6dc,null));};exports[_0x5349('0x43')]=function(_0x25b4c3,_0x2c42ee){return db[_0x5349('0x28')][_0x5349('0x43')](_0x25b4c3[_0x5349('0x44')],{})[_0x5349('0x23')](respondWithResult(_0x2c42ee,0xc9))[_0x5349('0x3f')](handleError(_0x2c42ee,null));};exports[_0x5349('0x45')]=function(_0x191cef,_0x591c50){if(_0x191cef['body']['id']){delete _0x191cef[_0x5349('0x44')]['id'];}return db[_0x5349('0x28')][_0x5349('0x42')]({'where':{'id':_0x191cef[_0x5349('0x41')]['id']}})[_0x5349('0x23')](handleEntityNotFound(_0x591c50,null))[_0x5349('0x23')](saveUpdates(_0x191cef['body'],null))[_0x5349('0x23')](respondWithResult(_0x591c50,null))[_0x5349('0x3f')](handleError(_0x591c50,null));};exports[_0x5349('0x22')]=function(_0x3652dc,_0x26d06a){return db[_0x5349('0x28')]['find']({'where':{'id':_0x3652dc[_0x5349('0x41')]['id']}})['then'](handleEntityNotFound(_0x26d06a,null))[_0x5349('0x23')](removeEntity(_0x26d06a,null))[_0x5349('0x3f')](handleError(_0x26d06a,null));};exports[_0x5349('0x46')]=function(_0x3f4db2,_0x259701){return db['SmsQueueReport'][_0x5349('0x46')]()[_0x5349('0x23')](respondWithResult(_0x259701,null))[_0x5349('0x3f')](handleError(_0x259701,null));}; \ No newline at end of file +var _0x3746=['hasOwnProperty','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','length','include','find','create','update','body','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','stack','name','send','SmsQueueReport','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x530e0e,_0x54d536){var _0x2742fb=function(_0x248145){while(--_0x248145){_0x530e0e['push'](_0x530e0e['shift']());}};_0x2742fb(++_0x54d536);}(_0x3746,0xa9));var _0x6374=function(_0x27e4df,_0x5258e8){_0x27e4df=_0x27e4df-0x0;var _0xb0b082=_0x3746[_0x27e4df];return _0xb0b082;};'use strict';var pdf=require(_0x6374('0x0'));var emlformat=require(_0x6374('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6374('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6374('0x3'));var moment=require(_0x6374('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6374('0x5'));var path=require(_0x6374('0x6'));var sox=require(_0x6374('0x7'));var csv=require(_0x6374('0x8'));var ejs=require(_0x6374('0x9'));var fs=require('fs');var _=require(_0x6374('0xa'));var squel=require(_0x6374('0xb'));var crypto=require(_0x6374('0xc'));var jsforce=require(_0x6374('0xd'));var deskjs=require(_0x6374('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6374('0xf'));var Papa=require('papaparse');var Redis=require(_0x6374('0x10'));var authService=require(_0x6374('0x11'));var qs=require(_0x6374('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6374('0x13'))(_0x6374('0x14'));var utils=require(_0x6374('0x15'));var config=require('../../config/environment');var db=require(_0x6374('0x16'))['db'];function respondWithStatusCode(_0x874f4e,_0x4d3a4e){_0x4d3a4e=_0x4d3a4e||0xcc;return function(_0x8c230){if(_0x8c230){return _0x874f4e[_0x6374('0x17')](_0x4d3a4e);}return _0x874f4e[_0x6374('0x18')](_0x4d3a4e)['end']();};}function respondWithResult(_0x24289e,_0x397b4c){_0x397b4c=_0x397b4c||0xc8;return function(_0x3916b5){if(_0x3916b5){return _0x24289e['status'](_0x397b4c)[_0x6374('0x19')](_0x3916b5);}};}function respondWithFilteredResult(_0x55ae57,_0x485331){return function(_0x22c866){if(_0x22c866){var _0x4ffe00=_0x22c866[_0x6374('0x1a')],_0x17d71b=_0x485331[_0x6374('0x1b')],_0x3a2b3a=_0x485331[_0x6374('0x1b')]+_0x485331[_0x6374('0x1c')],_0x1fdaa6;if(_0x3a2b3a>=_0x4ffe00){_0x3a2b3a=_0x4ffe00;_0x1fdaa6=0xc8;}else{_0x1fdaa6=0xce;}_0x55ae57[_0x6374('0x18')](_0x1fdaa6);return _0x55ae57[_0x6374('0x1d')](_0x6374('0x1e'),_0x17d71b+'-'+_0x3a2b3a+'/'+_0x4ffe00)[_0x6374('0x19')](_0x22c866);}return null;};}function patchUpdates(_0xd6236b){return function(_0x4f8db8){try{jsonpatch[_0x6374('0x1f')](_0x4f8db8,_0xd6236b,!![]);}catch(_0x435ab6){return BPromise[_0x6374('0x20')](_0x435ab6);}return _0x4f8db8[_0x6374('0x21')]();};}function saveUpdates(_0x3b8ed2,_0x3ec117){return function(_0x101d49){if(_0x101d49){return _0x101d49['update'](_0x3b8ed2)['then'](function(_0x2c29ae){return _0x2c29ae;});}return null;};}function removeEntity(_0x5a406a,_0x465c25){return function(_0x43d559){if(_0x43d559){return _0x43d559[_0x6374('0x22')]()[_0x6374('0x23')](function(){_0x5a406a['status'](0xcc)[_0x6374('0x24')]();});}};}function handleEntityNotFound(_0x2227c9,_0x190870){return function(_0x1148e5){if(!_0x1148e5){_0x2227c9[_0x6374('0x17')](0x194);}return _0x1148e5;};}function handleError(_0xd0a6b5,_0x46a3e2){_0x46a3e2=_0x46a3e2||0x1f4;return function(_0x1a8808){logger['error'](_0x1a8808[_0x6374('0x25')]);if(_0x1a8808[_0x6374('0x26')]){delete _0x1a8808[_0x6374('0x26')];}_0xd0a6b5['status'](_0x46a3e2)[_0x6374('0x27')](_0x1a8808);};}exports['index']=function(_0x39fcba,_0x46bb34){var _0x8d5419={},_0x1cb029={},_0x42bc95={'count':0x0,'rows':[]};var _0x3cf16d=db[_0x6374('0x28')][_0x6374('0x29')];_0x1cb029[_0x6374('0x2a')]=_['keys'](_0x3cf16d);_0x1cb029[_0x6374('0x2b')]=_[_0x6374('0x2c')](_0x39fcba[_0x6374('0x2b')]);_0x1cb029['filters']=_[_0x6374('0x2d')](_0x1cb029[_0x6374('0x2a')],_0x1cb029['query']);_0x8d5419[_0x6374('0x2e')]=_['intersection'](_0x1cb029['model'],qs['fields'](_0x39fcba['query']['fields']));_0x8d5419[_0x6374('0x2e')]=_0x8d5419['attributes']['length']?_0x8d5419[_0x6374('0x2e')]:_0x1cb029[_0x6374('0x2a')];if(!_0x39fcba[_0x6374('0x2b')][_0x6374('0x2f')]('nolimit')){_0x8d5419[_0x6374('0x1c')]=qs['limit'](_0x39fcba[_0x6374('0x2b')][_0x6374('0x1c')]);_0x8d5419[_0x6374('0x1b')]=qs[_0x6374('0x1b')](_0x39fcba[_0x6374('0x2b')][_0x6374('0x1b')]);}_0x8d5419[_0x6374('0x30')]=qs[_0x6374('0x31')](_0x39fcba[_0x6374('0x2b')]['sort']);_0x8d5419[_0x6374('0x32')]=qs[_0x6374('0x33')](_['pick'](_0x39fcba[_0x6374('0x2b')],_0x1cb029[_0x6374('0x33')]));if(_0x39fcba[_0x6374('0x2b')][_0x6374('0x34')]){_0x8d5419[_0x6374('0x32')]=_[_0x6374('0x35')](_0x8d5419['where'],{'$or':_[_0x6374('0x36')](_0x3cf16d,function(_0x2a4220){if(_0x2a4220[_0x6374('0x37')][_0x6374('0x38')]!==_0x6374('0x39')){var _0x45d194={};_0x45d194[_0x2a4220[_0x6374('0x3a')]]={'$like':'%'+_0x39fcba['query'][_0x6374('0x34')]+'%'};return _0x45d194;}})});}_0x8d5419=_[_0x6374('0x35')]({},_0x8d5419,_0x39fcba[_0x6374('0x3b')]);var _0x5096a0={'where':_0x8d5419[_0x6374('0x32')]};return db[_0x6374('0x28')]['count'](_0x5096a0)[_0x6374('0x23')](function(_0x2ea34c){_0x42bc95[_0x6374('0x1a')]=_0x2ea34c;if(_0x39fcba[_0x6374('0x2b')][_0x6374('0x3c')]){_0x8d5419['include']=[{'all':!![]}];}return db[_0x6374('0x28')][_0x6374('0x3d')](_0x8d5419);})[_0x6374('0x23')](function(_0x4808af){_0x42bc95[_0x6374('0x3e')]=_0x4808af;return _0x42bc95;})[_0x6374('0x23')](respondWithFilteredResult(_0x46bb34,_0x8d5419))[_0x6374('0x3f')](handleError(_0x46bb34,null));};exports['show']=function(_0x42bcbd,_0x5804e3){var _0x100d53={'raw':!![],'where':{'id':_0x42bcbd['params']['id']}},_0x50fde9={};_0x50fde9[_0x6374('0x2a')]=_[_0x6374('0x2c')](db['SmsQueueReport'][_0x6374('0x29')]);_0x50fde9[_0x6374('0x2b')]=_['keys'](_0x42bcbd[_0x6374('0x2b')]);_0x50fde9[_0x6374('0x33')]=_[_0x6374('0x2d')](_0x50fde9[_0x6374('0x2a')],_0x50fde9[_0x6374('0x2b')]);_0x100d53[_0x6374('0x2e')]=_[_0x6374('0x2d')](_0x50fde9['model'],qs['fields'](_0x42bcbd['query']['fields']));_0x100d53['attributes']=_0x100d53['attributes'][_0x6374('0x40')]?_0x100d53['attributes']:_0x50fde9[_0x6374('0x2a')];if(_0x42bcbd[_0x6374('0x2b')]['includeAll']){_0x100d53[_0x6374('0x41')]=[{'all':!![]}];}_0x100d53=_[_0x6374('0x35')]({},_0x100d53,_0x42bcbd[_0x6374('0x3b')]);return db[_0x6374('0x28')][_0x6374('0x42')](_0x100d53)[_0x6374('0x23')](handleEntityNotFound(_0x5804e3,null))['then'](respondWithResult(_0x5804e3,null))[_0x6374('0x3f')](handleError(_0x5804e3,null));};exports[_0x6374('0x43')]=function(_0x1b4ae5,_0x178527){return db['SmsQueueReport'][_0x6374('0x43')](_0x1b4ae5['body'],{})[_0x6374('0x23')](respondWithResult(_0x178527,0xc9))['catch'](handleError(_0x178527,null));};exports[_0x6374('0x44')]=function(_0x5cdb59,_0x140ac4){if(_0x5cdb59[_0x6374('0x45')]['id']){delete _0x5cdb59['body']['id'];}return db[_0x6374('0x28')][_0x6374('0x42')]({'where':{'id':_0x5cdb59[_0x6374('0x46')]['id']}})[_0x6374('0x23')](handleEntityNotFound(_0x140ac4,null))[_0x6374('0x23')](saveUpdates(_0x5cdb59[_0x6374('0x45')],null))[_0x6374('0x23')](respondWithResult(_0x140ac4,null))[_0x6374('0x3f')](handleError(_0x140ac4,null));};exports[_0x6374('0x22')]=function(_0x20187a,_0x2588b5){return db[_0x6374('0x28')][_0x6374('0x42')]({'where':{'id':_0x20187a[_0x6374('0x46')]['id']}})['then'](handleEntityNotFound(_0x2588b5,null))['then'](removeEntity(_0x2588b5,null))['catch'](handleError(_0x2588b5,null));};exports[_0x6374('0x47')]=function(_0x449658,_0x3dfa0d){return db[_0x6374('0x28')][_0x6374('0x47')]()[_0x6374('0x23')](respondWithResult(_0x3dfa0d,null))['catch'](handleError(_0x3dfa0d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 29fada1..f054870 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 _0x6602=['request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','util','api','moment','bluebird'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x6602,0xf8));var _0x2660=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x6602[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var util=require(_0x2660('0x0'));var logger=require('../../config/logger')(_0x2660('0x1'));var moment=require(_0x2660('0x2'));var BPromise=require(_0x2660('0x3'));var rp=require(_0x2660('0x4'));var fs=require('fs');var path=require(_0x2660('0x5'));var rimraf=require(_0x2660('0x6'));var config=require(_0x2660('0x7'));var attributes=require(_0x2660('0x8'));module[_0x2660('0x9')]=function(_0x51ac83,_0x10dc1c){return _0x51ac83[_0x2660('0xa')](_0x2660('0xb'),attributes,{'tableName':_0x2660('0xc'),'paranoid':![],'indexes':[{'name':_0x2660('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9559=['define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','request-promise','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x2c7505,_0xfb5c33){var _0x216b84=function(_0xecd3ea){while(--_0xecd3ea){_0x2c7505['push'](_0x2c7505['shift']());}};_0x216b84(++_0xfb5c33);}(_0x9559,0x7c));var _0x9955=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x9559[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0x9955('0x0'));var util=require(_0x9955('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9955('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9955('0x3'));var attributes=require(_0x9955('0x4'));module[_0x9955('0x5')]=function(_0x47e155,_0x571f91){return _0x47e155[_0x9955('0x6')](_0x9955('0x7'),attributes,{'tableName':_0x9955('0x8'),'paranoid':![],'indexes':[{'name':_0x9955('0x9'),'fields':[_0x9955('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index fd8eff1..0334a67 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 _0x163d=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','create','body','options','CreateSmsQueueReport','stringify','SmsQueueReport','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x163d,0x128));var _0xd163=function(_0x4ed668,_0x4b6086){_0x4ed668=_0x4ed668-0x0;var _0xf3a788=_0x163d[_0x4ed668];return _0xf3a788;};'use strict';var _=require(_0xd163('0x0'));var util=require(_0xd163('0x1'));var moment=require('moment');var BPromise=require(_0xd163('0x2'));var rs=require(_0xd163('0x3'));var fs=require('fs');var Redis=require(_0xd163('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd163('0x5'))(_0xd163('0x6'));var config=require(_0xd163('0x7'));var jayson=require(_0xd163('0x8'));var client=jayson[_0xd163('0x9')][_0xd163('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb37c,_0x2bcfa5,_0x338546){return new BPromise(function(_0x5a30db,_0x5ce866){return client[_0xd163('0xb')](_0x3fb37c,_0x338546)[_0xd163('0xc')](function(_0x12590d){logger[_0xd163('0xd')](_0xd163('0xe'),_0x2bcfa5,_0xd163('0xf'));logger[_0xd163('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2bcfa5,_0xd163('0xf'),JSON['stringify'](_0x12590d));if(_0x12590d[_0xd163('0x11')]){if(_0x12590d[_0xd163('0x11')]['code']===0x1f4){logger['error'](_0xd163('0xe'),_0x2bcfa5,_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);return _0x5ce866(_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);}logger[_0xd163('0x11')](_0xd163('0xe'),_0x2bcfa5,_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);return _0x5a30db(_0x12590d[_0xd163('0x11')]['message']);}else{logger[_0xd163('0xd')](_0xd163('0xe'),_0x2bcfa5,_0xd163('0xf'));_0x5a30db(_0x12590d[_0xd163('0x13')][_0xd163('0x12')]);}})[_0xd163('0x14')](function(_0x13c092){logger['error'](_0xd163('0xe'),_0x2bcfa5,_0x13c092);_0x5ce866(_0x13c092);});});}exports['CreateSmsQueueReport']=function(_0x5bbf05){var _0x4eef91=this;return new Promise(function(_0x4364fb,_0x55ad01){return db['SmsQueueReport'][_0xd163('0x15')](_0x5bbf05[_0xd163('0x16')],{'raw':_0x5bbf05[_0xd163('0x17')]?_0x5bbf05[_0xd163('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47e394){logger[_0xd163('0xd')](_0xd163('0x18'),_0x5bbf05);logger[_0xd163('0x10')]('CreateSmsQueueReport',_0x5bbf05,JSON[_0xd163('0x19')](_0x47e394));_0x4364fb(_0x47e394);})[_0xd163('0x14')](function(_0x93bc23){logger[_0xd163('0x11')](_0xd163('0x18'),_0x93bc23[_0xd163('0x12')],_0x5bbf05);_0x55ad01(_0x4eef91[_0xd163('0x11')](0x1f4,_0x93bc23['message']));});});};exports['UpdateSmsQueueReport']=function(_0x821720){var _0x43cb10=this;return new Promise(function(_0xc01737,_0x5d38df){return db[_0xd163('0x1a')][_0xd163('0x1b')](_0x821720[_0xd163('0x16')],{'raw':_0x821720[_0xd163('0x17')]?_0x821720[_0xd163('0x17')][_0xd163('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x821720[_0xd163('0x17')]?_0x821720[_0xd163('0x17')][_0xd163('0x1d')]||null:null,'attributes':_0x821720['options']?_0x821720['options'][_0xd163('0x1e')]||null:null,'limit':_0x821720['options']?_0x821720[_0xd163('0x17')][_0xd163('0x1f')]||null:null})[_0xd163('0xc')](function(_0x1424c7){logger['info'](_0xd163('0x20'),_0x821720);logger[_0xd163('0x10')](_0xd163('0x20'),_0x821720,JSON[_0xd163('0x19')](_0x1424c7));_0xc01737(_0x1424c7);})[_0xd163('0x14')](function(_0x139fe0){logger['error'](_0xd163('0x20'),_0x139fe0[_0xd163('0x12')],_0x821720);_0x5d38df(_0x43cb10['error'](0x1f4,_0x139fe0[_0xd163('0x12')]));});});}; \ No newline at end of file +var _0x327b=['SmsQueueReport','create','body','options','raw','update','where','attributes','limit','UpdateSmsQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','code','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport'];(function(_0x110121,_0x1e538a){var _0x77bcf0=function(_0x359894){while(--_0x359894){_0x110121['push'](_0x110121['shift']());}};_0x77bcf0(++_0x1e538a);}(_0x327b,0x1c4));var _0xb327=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x327b[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb327('0x0'));var BPromise=require(_0xb327('0x1'));var rs=require(_0xb327('0x2'));var fs=require('fs');var Redis=require(_0xb327('0x3'));var db=require(_0xb327('0x4'))['db'];var utils=require(_0xb327('0x5'));var logger=require(_0xb327('0x6'))(_0xb327('0x7'));var config=require(_0xb327('0x8'));var jayson=require(_0xb327('0x9'));var client=jayson['client'][_0xb327('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38a618,_0x411363,_0x287e0f){return new BPromise(function(_0x578cec,_0x3c7ab3){return client[_0xb327('0xb')](_0x38a618,_0x287e0f)[_0xb327('0xc')](function(_0x2c6f5d){logger[_0xb327('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x411363,'request\x20sent');logger[_0xb327('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x411363,_0xb327('0xf'),JSON[_0xb327('0x10')](_0x2c6f5d));if(_0x2c6f5d['error']){if(_0x2c6f5d['error'][_0xb327('0x11')]===0x1f4){logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x2c6f5d[_0xb327('0x12')][_0xb327('0x14')]);return _0x3c7ab3(_0x2c6f5d['error'][_0xb327('0x14')]);}logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x2c6f5d[_0xb327('0x12')][_0xb327('0x14')]);return _0x578cec(_0x2c6f5d[_0xb327('0x12')]['message']);}else{logger[_0xb327('0xd')](_0xb327('0x13'),_0x411363,_0xb327('0xf'));_0x578cec(_0x2c6f5d[_0xb327('0x15')]['message']);}})[_0xb327('0x16')](function(_0x10d8e6){logger[_0xb327('0x12')](_0xb327('0x13'),_0x411363,_0x10d8e6);_0x3c7ab3(_0x10d8e6);});});}exports[_0xb327('0x17')]=function(_0x2b8427){var _0x194f1c=this;return new Promise(function(_0x194ed6,_0x4f3270){return db[_0xb327('0x18')][_0xb327('0x19')](_0x2b8427[_0xb327('0x1a')],{'raw':_0x2b8427[_0xb327('0x1b')]?_0x2b8427[_0xb327('0x1b')][_0xb327('0x1c')]===undefined?!![]:![]:!![]})[_0xb327('0xc')](function(_0x3480e0){logger[_0xb327('0xd')]('CreateSmsQueueReport',_0x2b8427);logger[_0xb327('0xe')](_0xb327('0x17'),_0x2b8427,JSON[_0xb327('0x10')](_0x3480e0));_0x194ed6(_0x3480e0);})[_0xb327('0x16')](function(_0x319340){logger['error']('CreateSmsQueueReport',_0x319340[_0xb327('0x14')],_0x2b8427);_0x4f3270(_0x194f1c[_0xb327('0x12')](0x1f4,_0x319340[_0xb327('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x107a65){var _0x38f176=this;return new Promise(function(_0x3050ca,_0x3e99d4){return db[_0xb327('0x18')][_0xb327('0x1d')](_0x107a65[_0xb327('0x1a')],{'raw':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')][_0xb327('0x1e')]||null:null,'attributes':_0x107a65[_0xb327('0x1b')]?_0x107a65[_0xb327('0x1b')][_0xb327('0x1f')]||null:null,'limit':_0x107a65['options']?_0x107a65[_0xb327('0x1b')][_0xb327('0x20')]||null:null})[_0xb327('0xc')](function(_0x3e4784){logger[_0xb327('0xd')](_0xb327('0x21'),_0x107a65);logger[_0xb327('0xe')](_0xb327('0x21'),_0x107a65,JSON['stringify'](_0x3e4784));_0x3050ca(_0x3e4784);})['catch'](function(_0x52e68b){logger[_0xb327('0x12')]('UpdateSmsQueueReport',_0x52e68b['message'],_0x107a65);_0x3e99d4(_0x38f176[_0xb327('0x12')](0x1f4,_0x52e68b[_0xb327('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 7e9d926..6908fb8 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 _0xf3f3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1ced6b,_0x45fa84){var _0x17dd9c=function(_0x5d928c){while(--_0x5d928c){_0x1ced6b['push'](_0x1ced6b['shift']());}};_0x17dd9c(++_0x45fa84);}(_0xf3f3,0x119));var _0x3f3f=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0xf3f3[_0x2f54b6];return _0x169f21;};'use strict';var multer=require('multer');var util=require(_0x3f3f('0x0'));var path=require(_0x3f3f('0x1'));var timeout=require(_0x3f3f('0x2'));var express=require('express');var router=express[_0x3f3f('0x3')]();var auth=require(_0x3f3f('0x4'));var interaction=require(_0x3f3f('0x5'));var config=require(_0x3f3f('0x6'));var controller=require(_0x3f3f('0x7'));router['get']('/',auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x9')]);router[_0x3f3f('0xa')]('/describe',auth[_0x3f3f('0x8')](),controller[_0x3f3f('0xb')]);router[_0x3f3f('0xa')](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller['show']);router[_0x3f3f('0xd')]('/',auth['isAuthenticated'](),controller[_0x3f3f('0xe')]);router[_0x3f3f('0xf')](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x10')]);router['delete'](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x11')]);module[_0x3f3f('0x12')]=router; \ No newline at end of file +var _0x2e94=['post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5a8194,_0x7621f7){var _0x58534d=function(_0x2d2db3){while(--_0x2d2db3){_0x5a8194['push'](_0x5a8194['shift']());}};_0x58534d(++_0x7621f7);}(_0x2e94,0x15d));var _0x42e9=function(_0x33fb76,_0x16578f){_0x33fb76=_0x33fb76-0x0;var _0x1d6134=_0x2e94[_0x33fb76];return _0x1d6134;};'use strict';var multer=require(_0x42e9('0x0'));var util=require('util');var path=require(_0x42e9('0x1'));var timeout=require('connect-timeout');var express=require(_0x42e9('0x2'));var router=express[_0x42e9('0x3')]();var auth=require(_0x42e9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x42e9('0x5')]('/',auth[_0x42e9('0x6')](),controller[_0x42e9('0x7')]);router[_0x42e9('0x5')](_0x42e9('0x8'),auth[_0x42e9('0x6')](),controller[_0x42e9('0x9')]);router[_0x42e9('0x5')](_0x42e9('0xa'),auth[_0x42e9('0x6')](),controller[_0x42e9('0xb')]);router[_0x42e9('0xc')]('/',auth[_0x42e9('0x6')](),controller[_0x42e9('0xd')]);router[_0x42e9('0xe')](_0x42e9('0xa'),auth[_0x42e9('0x6')](),controller[_0x42e9('0xf')]);router[_0x42e9('0x10')]('/:id',auth[_0x42e9('0x6')](),controller[_0x42e9('0x11')]);module[_0x42e9('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index f28f809..3dbfd56 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 _0x244c=['STRING','account','agent','queue','NOW','moment','sequelize'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x244c,0x1d3));var _0xc244=function(_0x14f287,_0x51e926){_0x14f287=_0x14f287-0x0;var _0x528d52=_0x244c[_0x14f287];return _0x528d52;};'use strict';var moment=require(_0xc244('0x0'));var Sequelize=require(_0xc244('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc244('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc244('0x3'),_0xc244('0x4'),_0xc244('0x5')),'allowNull':![],'defaultValue':_0xc244('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xc244('0x6')]}}; \ No newline at end of file +var _0x80dc=['exports','ENUM','agent','queue','DATE','NOW','moment'];(function(_0x22b5f0,_0x2d55bb){var _0x308d7b=function(_0x5a8839){while(--_0x5a8839){_0x22b5f0['push'](_0x22b5f0['shift']());}};_0x308d7b(++_0x2d55bb);}(_0x80dc,0x92));var _0xc80d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x80dc[_0xbd08b4];return _0x314f1e;};'use strict';var moment=require(_0xc80d('0x0'));var Sequelize=require('sequelize');module[_0xc80d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc80d('0x2')]('account',_0xc80d('0x3'),'queue'),'allowNull':![],'defaultValue':_0xc80d('0x4')},'transferredAt':{'type':Sequelize[_0xc80d('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xc80d('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 43cccde..d8b60b6 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 _0xa46f=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','includeAll','include','findAll','show','merge','options','find','catch','create','body','update','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','error','name','send','index','SmsTransferReport','rawAttributes'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xa46f,0x140));var _0xfa46=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0xa46f[_0x58a4ac];return _0x545810;};'use strict';var pdf=require(_0xfa46('0x0'));var emlformat=require(_0xfa46('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa46('0x2'));var rp=require(_0xfa46('0x3'));var moment=require(_0xfa46('0x4'));var BPromise=require(_0xfa46('0x5'));var Mustache=require(_0xfa46('0x6'));var util=require(_0xfa46('0x7'));var path=require(_0xfa46('0x8'));var sox=require(_0xfa46('0x9'));var csv=require(_0xfa46('0xa'));var ejs=require(_0xfa46('0xb'));var fs=require('fs');var _=require(_0xfa46('0xc'));var squel=require(_0xfa46('0xd'));var crypto=require('crypto');var jsforce=require(_0xfa46('0xe'));var deskjs=require(_0xfa46('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfa46('0x10'));var Papa=require(_0xfa46('0x11'));var Redis=require('ioredis');var authService=require(_0xfa46('0x12'));var qs=require(_0xfa46('0x13'));var hardwareService=require(_0xfa46('0x14'));var logger=require(_0xfa46('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xfa46('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe05245,_0x2045f6){_0x2045f6=_0x2045f6||0xcc;return function(_0x271d9a){if(_0x271d9a){return _0xe05245[_0xfa46('0x17')](_0x2045f6);}return _0xe05245[_0xfa46('0x18')](_0x2045f6)[_0xfa46('0x19')]();};}function respondWithResult(_0x209414,_0x52ea67){_0x52ea67=_0x52ea67||0xc8;return function(_0xd14247){if(_0xd14247){return _0x209414[_0xfa46('0x18')](_0x52ea67)[_0xfa46('0x1a')](_0xd14247);}};}function respondWithFilteredResult(_0x21f05e,_0x57efa0){return function(_0x33a012){if(_0x33a012){var _0x274534=_0x33a012[_0xfa46('0x1b')],_0x43e638=_0x57efa0[_0xfa46('0x1c')],_0x443726=_0x57efa0[_0xfa46('0x1c')]+_0x57efa0[_0xfa46('0x1d')],_0x17fba0;if(_0x443726>=_0x274534){_0x443726=_0x274534;_0x17fba0=0xc8;}else{_0x17fba0=0xce;}_0x21f05e['status'](_0x17fba0);return _0x21f05e[_0xfa46('0x1e')]('Content-Range',_0x43e638+'-'+_0x443726+'/'+_0x274534)['json'](_0x33a012);}return null;};}function patchUpdates(_0x25af89){return function(_0x54be67){try{jsonpatch[_0xfa46('0x1f')](_0x54be67,_0x25af89,!![]);}catch(_0x544cbd){return BPromise['reject'](_0x544cbd);}return _0x54be67[_0xfa46('0x20')]();};}function saveUpdates(_0x2bad57,_0x432196){return function(_0x4ac4f6){if(_0x4ac4f6){return _0x4ac4f6['update'](_0x2bad57)[_0xfa46('0x21')](function(_0x527fb8){return _0x527fb8;});}return null;};}function removeEntity(_0x449295,_0x136b8a){return function(_0x5f221e){if(_0x5f221e){return _0x5f221e['destroy']()['then'](function(){_0x449295[_0xfa46('0x18')](0xcc)[_0xfa46('0x19')]();});}};}function handleEntityNotFound(_0x38f402,_0x266773){return function(_0x2c3bee){if(!_0x2c3bee){_0x38f402[_0xfa46('0x17')](0x194);}return _0x2c3bee;};}function handleError(_0x461900,_0x16b509){_0x16b509=_0x16b509||0x1f4;return function(_0x3710f6){logger[_0xfa46('0x22')](_0x3710f6['stack']);if(_0x3710f6[_0xfa46('0x23')]){delete _0x3710f6[_0xfa46('0x23')];}_0x461900['status'](_0x16b509)[_0xfa46('0x24')](_0x3710f6);};}exports[_0xfa46('0x25')]=function(_0x52379a,_0x2cdf1f){var _0x51eb1e={},_0x87c359={},_0xf4dfd1={'count':0x0,'rows':[]};var _0xb69860=db[_0xfa46('0x26')][_0xfa46('0x27')];_0x87c359['model']=_[_0xfa46('0x28')](_0xb69860);_0x87c359[_0xfa46('0x29')]=_['keys'](_0x52379a[_0xfa46('0x29')]);_0x87c359[_0xfa46('0x2a')]=_[_0xfa46('0x2b')](_0x87c359[_0xfa46('0x2c')],_0x87c359['query']);_0x51eb1e[_0xfa46('0x2d')]=_['intersection'](_0x87c359[_0xfa46('0x2c')],qs[_0xfa46('0x2e')](_0x52379a['query']['fields']));_0x51eb1e[_0xfa46('0x2d')]=_0x51eb1e['attributes'][_0xfa46('0x2f')]?_0x51eb1e[_0xfa46('0x2d')]:_0x87c359[_0xfa46('0x2c')];if(!_0x52379a[_0xfa46('0x29')][_0xfa46('0x30')]('nolimit')){_0x51eb1e[_0xfa46('0x1d')]=qs[_0xfa46('0x1d')](_0x52379a[_0xfa46('0x29')][_0xfa46('0x1d')]);_0x51eb1e['offset']=qs[_0xfa46('0x1c')](_0x52379a[_0xfa46('0x29')]['offset']);}_0x51eb1e[_0xfa46('0x31')]=qs[_0xfa46('0x32')](_0x52379a[_0xfa46('0x29')][_0xfa46('0x32')]);_0x51eb1e[_0xfa46('0x33')]=qs[_0xfa46('0x2a')](_[_0xfa46('0x34')](_0x52379a[_0xfa46('0x29')],_0x87c359['filters']));if(_0x52379a[_0xfa46('0x29')]['filter']){_0x51eb1e['where']=_['merge'](_0x51eb1e[_0xfa46('0x33')],{'$or':_[_0xfa46('0x35')](_0xb69860,function(_0x1845e8){if(_0x1845e8[_0xfa46('0x36')][_0xfa46('0x37')]!==_0xfa46('0x38')){var _0x3d1457={};_0x3d1457[_0x1845e8[_0xfa46('0x39')]]={'$like':'%'+_0x52379a[_0xfa46('0x29')][_0xfa46('0x3a')]+'%'};return _0x3d1457;}})});}_0x51eb1e=_['merge']({},_0x51eb1e,_0x52379a['options']);var _0x1652b4={'where':_0x51eb1e[_0xfa46('0x33')]};return db[_0xfa46('0x26')][_0xfa46('0x1b')](_0x1652b4)['then'](function(_0x4fe78f){_0xf4dfd1[_0xfa46('0x1b')]=_0x4fe78f;if(_0x52379a[_0xfa46('0x29')][_0xfa46('0x3b')]){_0x51eb1e[_0xfa46('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xfa46('0x3d')](_0x51eb1e);})['then'](function(_0x5b6369){_0xf4dfd1['rows']=_0x5b6369;return _0xf4dfd1;})[_0xfa46('0x21')](respondWithFilteredResult(_0x2cdf1f,_0x51eb1e))['catch'](handleError(_0x2cdf1f,null));};exports[_0xfa46('0x3e')]=function(_0x184dfd,_0x1d55ff){var _0x3c97f3={'raw':!![],'where':{'id':_0x184dfd['params']['id']}},_0x520b4f={};_0x520b4f[_0xfa46('0x2c')]=_[_0xfa46('0x28')](db[_0xfa46('0x26')][_0xfa46('0x27')]);_0x520b4f[_0xfa46('0x29')]=_[_0xfa46('0x28')](_0x184dfd[_0xfa46('0x29')]);_0x520b4f[_0xfa46('0x2a')]=_[_0xfa46('0x2b')](_0x520b4f[_0xfa46('0x2c')],_0x520b4f[_0xfa46('0x29')]);_0x3c97f3[_0xfa46('0x2d')]=_['intersection'](_0x520b4f['model'],qs[_0xfa46('0x2e')](_0x184dfd[_0xfa46('0x29')]['fields']));_0x3c97f3[_0xfa46('0x2d')]=_0x3c97f3[_0xfa46('0x2d')][_0xfa46('0x2f')]?_0x3c97f3[_0xfa46('0x2d')]:_0x520b4f['model'];if(_0x184dfd['query'][_0xfa46('0x3b')]){_0x3c97f3['include']=[{'all':!![]}];}_0x3c97f3=_[_0xfa46('0x3f')]({},_0x3c97f3,_0x184dfd[_0xfa46('0x40')]);return db[_0xfa46('0x26')][_0xfa46('0x41')](_0x3c97f3)[_0xfa46('0x21')](handleEntityNotFound(_0x1d55ff,null))[_0xfa46('0x21')](respondWithResult(_0x1d55ff,null))[_0xfa46('0x42')](handleError(_0x1d55ff,null));};exports[_0xfa46('0x43')]=function(_0x45a0ed,_0x5aaff){return db[_0xfa46('0x26')]['create'](_0x45a0ed[_0xfa46('0x44')],{})[_0xfa46('0x21')](respondWithResult(_0x5aaff,0xc9))[_0xfa46('0x42')](handleError(_0x5aaff,null));};exports[_0xfa46('0x45')]=function(_0x3065cc,_0x197a32){if(_0x3065cc['body']['id']){delete _0x3065cc[_0xfa46('0x44')]['id'];}return db[_0xfa46('0x26')][_0xfa46('0x41')]({'where':{'id':_0x3065cc[_0xfa46('0x46')]['id']}})[_0xfa46('0x21')](handleEntityNotFound(_0x197a32,null))[_0xfa46('0x21')](saveUpdates(_0x3065cc[_0xfa46('0x44')],null))[_0xfa46('0x21')](respondWithResult(_0x197a32,null))[_0xfa46('0x42')](handleError(_0x197a32,null));};exports['destroy']=function(_0x28939c,_0x22bba5){return db[_0xfa46('0x26')]['find']({'where':{'id':_0x28939c['params']['id']}})[_0xfa46('0x21')](handleEntityNotFound(_0x22bba5,null))['then'](removeEntity(_0x22bba5,null))['catch'](handleError(_0x22bba5,null));};exports[_0xfa46('0x47')]=function(_0x285eee,_0x3936fd){return db[_0xfa46('0x26')]['describe']()['then'](respondWithResult(_0x3936fd,null))[_0xfa46('0x42')](handleError(_0x3936fd,null));}; \ No newline at end of file +var _0x46f1=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','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','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','type','key','VIRTUAL','field','filter','options','SmsTransferReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x46f1,0x12c));var _0x146f=function(_0x34f12b,_0x5ab1e1){_0x34f12b=_0x34f12b-0x0;var _0x551f17=_0x46f1[_0x34f12b];return _0x551f17;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x146f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x146f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x146f('0x2'));var moment=require(_0x146f('0x3'));var BPromise=require(_0x146f('0x4'));var Mustache=require(_0x146f('0x5'));var util=require(_0x146f('0x6'));var path=require(_0x146f('0x7'));var sox=require(_0x146f('0x8'));var csv=require('to-csv');var ejs=require(_0x146f('0x9'));var fs=require('fs');var _=require(_0x146f('0xa'));var squel=require(_0x146f('0xb'));var crypto=require(_0x146f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x146f('0xd'));var toCsv=require(_0x146f('0xe'));var querystring=require(_0x146f('0xf'));var Papa=require(_0x146f('0x10'));var Redis=require(_0x146f('0x11'));var authService=require(_0x146f('0x12'));var qs=require(_0x146f('0x13'));var hardwareService=require(_0x146f('0x14'));var logger=require(_0x146f('0x15'))(_0x146f('0x16'));var utils=require(_0x146f('0x17'));var config=require(_0x146f('0x18'));var db=require(_0x146f('0x19'))['db'];function respondWithStatusCode(_0x11c50c,_0x1b5dda){_0x1b5dda=_0x1b5dda||0xcc;return function(_0x20b7f1){if(_0x20b7f1){return _0x11c50c[_0x146f('0x1a')](_0x1b5dda);}return _0x11c50c[_0x146f('0x1b')](_0x1b5dda)[_0x146f('0x1c')]();};}function respondWithResult(_0x3df018,_0x348d49){_0x348d49=_0x348d49||0xc8;return function(_0x3e3bdb){if(_0x3e3bdb){return _0x3df018[_0x146f('0x1b')](_0x348d49)[_0x146f('0x1d')](_0x3e3bdb);}};}function respondWithFilteredResult(_0x3e42ed,_0x4d8b8e){return function(_0x2716c){if(_0x2716c){var _0x556595=_0x2716c[_0x146f('0x1e')],_0x3bf1cc=_0x4d8b8e['offset'],_0x4826f3=_0x4d8b8e[_0x146f('0x1f')]+_0x4d8b8e[_0x146f('0x20')],_0x5063d0;if(_0x4826f3>=_0x556595){_0x4826f3=_0x556595;_0x5063d0=0xc8;}else{_0x5063d0=0xce;}_0x3e42ed[_0x146f('0x1b')](_0x5063d0);return _0x3e42ed[_0x146f('0x21')](_0x146f('0x22'),_0x3bf1cc+'-'+_0x4826f3+'/'+_0x556595)[_0x146f('0x1d')](_0x2716c);}return null;};}function patchUpdates(_0x3dc6a9){return function(_0x30cb7f){try{jsonpatch[_0x146f('0x23')](_0x30cb7f,_0x3dc6a9,!![]);}catch(_0x2a96e7){return BPromise[_0x146f('0x24')](_0x2a96e7);}return _0x30cb7f[_0x146f('0x25')]();};}function saveUpdates(_0x58ebd3,_0x6aacd9){return function(_0x5a04c1){if(_0x5a04c1){return _0x5a04c1[_0x146f('0x26')](_0x58ebd3)[_0x146f('0x27')](function(_0xba6554){return _0xba6554;});}return null;};}function removeEntity(_0x1063c5,_0x41d9fc){return function(_0xe86836){if(_0xe86836){return _0xe86836[_0x146f('0x28')]()[_0x146f('0x27')](function(){_0x1063c5[_0x146f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162fa8,_0x3416e5){return function(_0x25e5b2){if(!_0x25e5b2){_0x162fa8[_0x146f('0x1a')](0x194);}return _0x25e5b2;};}function handleError(_0x1e3a7e,_0x56b823){_0x56b823=_0x56b823||0x1f4;return function(_0x1c8873){logger[_0x146f('0x29')](_0x1c8873['stack']);if(_0x1c8873[_0x146f('0x2a')]){delete _0x1c8873[_0x146f('0x2a')];}_0x1e3a7e[_0x146f('0x1b')](_0x56b823)['send'](_0x1c8873);};}exports[_0x146f('0x2b')]=function(_0x44da29,_0xdba92e){var _0x171367={},_0x40f2e3={},_0x1cbdec={'count':0x0,'rows':[]};var _0x4bf655=db['SmsTransferReport'][_0x146f('0x2c')];_0x40f2e3[_0x146f('0x2d')]=_['keys'](_0x4bf655);_0x40f2e3[_0x146f('0x2e')]=_[_0x146f('0x2f')](_0x44da29[_0x146f('0x2e')]);_0x40f2e3['filters']=_[_0x146f('0x30')](_0x40f2e3[_0x146f('0x2d')],_0x40f2e3[_0x146f('0x2e')]);_0x171367[_0x146f('0x31')]=_[_0x146f('0x30')](_0x40f2e3['model'],qs[_0x146f('0x32')](_0x44da29[_0x146f('0x2e')][_0x146f('0x32')]));_0x171367[_0x146f('0x31')]=_0x171367[_0x146f('0x31')]['length']?_0x171367['attributes']:_0x40f2e3['model'];if(!_0x44da29['query'][_0x146f('0x33')](_0x146f('0x34'))){_0x171367[_0x146f('0x20')]=qs['limit'](_0x44da29[_0x146f('0x2e')][_0x146f('0x20')]);_0x171367[_0x146f('0x1f')]=qs[_0x146f('0x1f')](_0x44da29[_0x146f('0x2e')][_0x146f('0x1f')]);}_0x171367['order']=qs['sort'](_0x44da29[_0x146f('0x2e')][_0x146f('0x35')]);_0x171367[_0x146f('0x36')]=qs[_0x146f('0x37')](_['pick'](_0x44da29[_0x146f('0x2e')],_0x40f2e3[_0x146f('0x37')]));if(_0x44da29[_0x146f('0x2e')]['filter']){_0x171367[_0x146f('0x36')]=_[_0x146f('0x38')](_0x171367['where'],{'$or':_['map'](_0x4bf655,function(_0x541034){if(_0x541034[_0x146f('0x39')][_0x146f('0x3a')]!==_0x146f('0x3b')){var _0x33d784={};_0x33d784[_0x541034[_0x146f('0x3c')]]={'$like':'%'+_0x44da29[_0x146f('0x2e')][_0x146f('0x3d')]+'%'};return _0x33d784;}})});}_0x171367=_[_0x146f('0x38')]({},_0x171367,_0x44da29[_0x146f('0x3e')]);var _0x5f502d={'where':_0x171367[_0x146f('0x36')]};return db[_0x146f('0x3f')]['count'](_0x5f502d)[_0x146f('0x27')](function(_0x3acda6){_0x1cbdec[_0x146f('0x1e')]=_0x3acda6;if(_0x44da29['query'][_0x146f('0x40')]){_0x171367[_0x146f('0x41')]=[{'all':!![]}];}return db[_0x146f('0x3f')][_0x146f('0x42')](_0x171367);})[_0x146f('0x27')](function(_0x33a680){_0x1cbdec[_0x146f('0x43')]=_0x33a680;return _0x1cbdec;})['then'](respondWithFilteredResult(_0xdba92e,_0x171367))[_0x146f('0x44')](handleError(_0xdba92e,null));};exports['show']=function(_0x37b525,_0x5b6cd0){var _0x524b86={'raw':!![],'where':{'id':_0x37b525[_0x146f('0x45')]['id']}},_0x4fcd96={};_0x4fcd96[_0x146f('0x2d')]=_[_0x146f('0x2f')](db['SmsTransferReport']['rawAttributes']);_0x4fcd96[_0x146f('0x2e')]=_[_0x146f('0x2f')](_0x37b525[_0x146f('0x2e')]);_0x4fcd96['filters']=_['intersection'](_0x4fcd96['model'],_0x4fcd96[_0x146f('0x2e')]);_0x524b86[_0x146f('0x31')]=_[_0x146f('0x30')](_0x4fcd96[_0x146f('0x2d')],qs[_0x146f('0x32')](_0x37b525['query']['fields']));_0x524b86[_0x146f('0x31')]=_0x524b86['attributes'][_0x146f('0x46')]?_0x524b86[_0x146f('0x31')]:_0x4fcd96[_0x146f('0x2d')];if(_0x37b525[_0x146f('0x2e')][_0x146f('0x40')]){_0x524b86[_0x146f('0x41')]=[{'all':!![]}];}_0x524b86=_[_0x146f('0x38')]({},_0x524b86,_0x37b525[_0x146f('0x3e')]);return db[_0x146f('0x3f')][_0x146f('0x47')](_0x524b86)[_0x146f('0x27')](handleEntityNotFound(_0x5b6cd0,null))[_0x146f('0x27')](respondWithResult(_0x5b6cd0,null))[_0x146f('0x44')](handleError(_0x5b6cd0,null));};exports['create']=function(_0x4f00cb,_0x4633aa){return db[_0x146f('0x3f')][_0x146f('0x48')](_0x4f00cb[_0x146f('0x49')],{})[_0x146f('0x27')](respondWithResult(_0x4633aa,0xc9))['catch'](handleError(_0x4633aa,null));};exports[_0x146f('0x26')]=function(_0x206b1b,_0x176400){if(_0x206b1b[_0x146f('0x49')]['id']){delete _0x206b1b[_0x146f('0x49')]['id'];}return db[_0x146f('0x3f')][_0x146f('0x47')]({'where':{'id':_0x206b1b['params']['id']}})[_0x146f('0x27')](handleEntityNotFound(_0x176400,null))[_0x146f('0x27')](saveUpdates(_0x206b1b['body'],null))['then'](respondWithResult(_0x176400,null))[_0x146f('0x44')](handleError(_0x176400,null));};exports[_0x146f('0x28')]=function(_0x19db67,_0x156900){return db[_0x146f('0x3f')][_0x146f('0x47')]({'where':{'id':_0x19db67[_0x146f('0x45')]['id']}})[_0x146f('0x27')](handleEntityNotFound(_0x156900,null))[_0x146f('0x27')](removeEntity(_0x156900,null))[_0x146f('0x44')](handleError(_0x156900,null));};exports[_0x146f('0x4a')]=function(_0x181180,_0x5ba60f){return db[_0x146f('0x3f')][_0x146f('0x4a')]()['then'](respondWithResult(_0x5ba60f,null))[_0x146f('0x44')](handleError(_0x5ba60f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 84c9fb3..4a0c856 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 _0x0eb4=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x13df12,_0xab501c){var _0x52d018=function(_0x1f2915){while(--_0x1f2915){_0x13df12['push'](_0x13df12['shift']());}};_0x52d018(++_0xab501c);}(_0x0eb4,0x1b8));var _0x40eb=function(_0x378447,_0x4c48e6){_0x378447=_0x378447-0x0;var _0x4a49dc=_0x0eb4[_0x378447];return _0x4a49dc;};'use strict';var _=require(_0x40eb('0x0'));var util=require(_0x40eb('0x1'));var logger=require(_0x40eb('0x2'))('api');var moment=require(_0x40eb('0x3'));var BPromise=require(_0x40eb('0x4'));var rp=require(_0x40eb('0x5'));var fs=require('fs');var path=require(_0x40eb('0x6'));var rimraf=require(_0x40eb('0x7'));var config=require('../../config/environment');var attributes=require(_0x40eb('0x8'));module[_0x40eb('0x9')]=function(_0x56e3ae,_0x74da4d){return _0x56e3ae[_0x40eb('0xa')](_0x40eb('0xb'),attributes,{'tableName':_0x40eb('0xc'),'paranoid':![],'indexes':[{'name':_0x40eb('0xd'),'fields':[_0x40eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x409c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x5e4d7a,_0x474456){var _0x446c84=function(_0x254e70){while(--_0x254e70){_0x5e4d7a['push'](_0x5e4d7a['shift']());}};_0x446c84(++_0x474456);}(_0x409c,0x1df));var _0xc409=function(_0x27edfd,_0x10ef8f){_0x27edfd=_0x27edfd-0x0;var _0x17741b=_0x409c[_0x27edfd];return _0x17741b;};'use strict';var _=require(_0xc409('0x0'));var util=require(_0xc409('0x1'));var logger=require(_0xc409('0x2'))(_0xc409('0x3'));var moment=require(_0xc409('0x4'));var BPromise=require(_0xc409('0x5'));var rp=require(_0xc409('0x6'));var fs=require('fs');var path=require(_0xc409('0x7'));var rimraf=require(_0xc409('0x8'));var config=require(_0xc409('0x9'));var attributes=require(_0xc409('0xa'));module['exports']=function(_0x460a02,_0x15edbe){return _0x460a02[_0xc409('0xb')](_0xc409('0xc'),attributes,{'tableName':_0xc409('0xd'),'paranoid':![],'indexes':[{'name':_0xc409('0xe'),'fields':[_0xc409('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7f6d114..a0d1901 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 _0xeca8=['../../config/environment','jayson/promise','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeca8,0x1f2));var _0x8eca=function(_0x1a13fc,_0x4cdc71){_0x1a13fc=_0x1a13fc-0x0;var _0x2cb974=_0xeca8[_0x1a13fc];return _0x2cb974;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var moment=require(_0x8eca('0x2'));var BPromise=require(_0x8eca('0x3'));var rs=require(_0x8eca('0x4'));var fs=require('fs');var Redis=require(_0x8eca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eca('0x6'));var logger=require('../../config/logger')(_0x8eca('0x7'));var config=require(_0x8eca('0x8'));var jayson=require(_0x8eca('0x9'));var client=jayson['client'][_0x8eca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12c679,_0xe6e3f2,_0x39f40a){return new BPromise(function(_0xedaeca,_0x3b901f){return client['request'](_0x12c679,_0x39f40a)[_0x8eca('0xb')](function(_0x19208c){logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));logger[_0x8eca('0xf')](_0x8eca('0x10'),_0xe6e3f2,_0x8eca('0xe'),JSON[_0x8eca('0x11')](_0x19208c));if(_0x19208c[_0x8eca('0x12')]){if(_0x19208c['error'][_0x8eca('0x13')]===0x1f4){logger['error'](_0x8eca('0xd'),_0xe6e3f2,_0x19208c[_0x8eca('0x12')]['message']);return _0x3b901f(_0x19208c[_0x8eca('0x12')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xe6e3f2,_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);return _0xedaeca(_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);}else{logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));_0xedaeca(_0x19208c['result'][_0x8eca('0x14')]);}})[_0x8eca('0x15')](function(_0x4b8c67){logger[_0x8eca('0x12')](_0x8eca('0xd'),_0xe6e3f2,_0x4b8c67);_0x3b901f(_0x4b8c67);});});} \ No newline at end of file +var _0x9b0d=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util'];(function(_0x3bb859,_0x589816){var _0x3bf534=function(_0xa586c){while(--_0xa586c){_0x3bb859['push'](_0x3bb859['shift']());}};_0x3bf534(++_0x589816);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x273f73,_0x1f54ef){_0x273f73=_0x273f73-0x0;var _0xd9181=_0x9b0d[_0x273f73];return _0xd9181;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var moment=require(_0xd9b0('0x1'));var BPromise=require(_0xd9b0('0x2'));var rs=require(_0xd9b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9b0('0x4'))['db'];var utils=require(_0xd9b0('0x5'));var logger=require(_0xd9b0('0x6'))(_0xd9b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9b0('0x8'));var client=jayson[_0xd9b0('0x9')][_0xd9b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c012,_0x58bd64,_0x384d09){return new BPromise(function(_0x33f402,_0x510adc){return client[_0xd9b0('0xb')](_0x31c012,_0x384d09)[_0xd9b0('0xc')](function(_0x48181a){logger[_0xd9b0('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x58bd64,_0xd9b0('0xe'));logger['debug'](_0xd9b0('0xf'),_0x58bd64,_0xd9b0('0xe'),JSON[_0xd9b0('0x10')](_0x48181a));if(_0x48181a[_0xd9b0('0x11')]){if(_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x12')]===0x1f4){logger['error'](_0xd9b0('0x13'),_0x58bd64,_0x48181a[_0xd9b0('0x11')]['message']);return _0x510adc(_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x14')]);}logger[_0xd9b0('0x11')](_0xd9b0('0x13'),_0x58bd64,_0x48181a[_0xd9b0('0x11')][_0xd9b0('0x14')]);return _0x33f402(_0x48181a['error'][_0xd9b0('0x14')]);}else{logger['info'](_0xd9b0('0x13'),_0x58bd64,_0xd9b0('0xe'));_0x33f402(_0x48181a[_0xd9b0('0x15')][_0xd9b0('0x14')]);}})[_0xd9b0('0x16')](function(_0x3e7547){logger[_0xd9b0('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x58bd64,_0x3e7547);_0x510adc(_0x3e7547);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index b317cf5..01d8cae 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 _0xfb39=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','format','basename','originalname','extname','post','single','file','put','update','delete'];(function(_0x46330,_0x367396){var _0xdb4806=function(_0x3647d2){while(--_0x3647d2){_0x46330['push'](_0x46330['shift']());}};_0xdb4806(++_0x367396);}(_0xfb39,0xd3));var _0x9fb3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xfb39[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x9fb3('0x0'));var path=require(_0x9fb3('0x1'));var timeout=require(_0x9fb3('0x2'));var express=require(_0x9fb3('0x3'));var router=express[_0x9fb3('0x4')]();var auth=require(_0x9fb3('0x5'));var interaction=require(_0x9fb3('0x6'));var config=require(_0x9fb3('0x7'));var controller=require('./sound.controller');router[_0x9fb3('0x8')]('/',auth[_0x9fb3('0x9')](),controller[_0x9fb3('0xa')]);router[_0x9fb3('0x8')](_0x9fb3('0xb'),auth['isAuthenticated'](),controller[_0x9fb3('0xc')]);router[_0x9fb3('0x8')](_0x9fb3('0xd'),auth[_0x9fb3('0x9')](),controller[_0x9fb3('0xe')]);var upload=multer({'storage':multer[_0x9fb3('0xf')]({'destination':function(_0x1d6aec,_0x5e28ff,_0x5a6787){_0x5a6787(null,path[_0x9fb3('0x10')](config[_0x9fb3('0x11')],_0x9fb3('0x12')));},'filename':function(_0xfd408e,_0x29406f,_0x3556ad){_0x29406f['originalname']=_0x29406f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3556ad(null,util[_0x9fb3('0x13')]('%s-%s%s',path[_0x9fb3('0x14')](_0x29406f[_0x9fb3('0x15')],path[_0x9fb3('0x16')](_0x29406f[_0x9fb3('0x15')])),Date['now'](),path[_0x9fb3('0x16')](_0x29406f[_0x9fb3('0x15')])));}})});router[_0x9fb3('0x17')]('/',upload[_0x9fb3('0x18')](_0x9fb3('0x19')),controller['create']);router[_0x9fb3('0x1a')](_0x9fb3('0xb'),auth[_0x9fb3('0x9')](),controller[_0x9fb3('0x1b')]);router[_0x9fb3('0x1c')](_0x9fb3('0xb'),auth['isAuthenticated'](),controller[_0x9fb3('0x1c')]);module[_0x9fb3('0x1d')]=router; \ No newline at end of file +var _0xe1d5=['../../config/environment','./sound.controller','isAuthenticated','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xfc2420,_0x149f71){var _0x59db5b=function(_0x3dcfa0){while(--_0x3dcfa0){_0xfc2420['push'](_0xfc2420['shift']());}};_0x59db5b(++_0x149f71);}(_0xe1d5,0xd9));var _0x5e1d=function(_0x5d8884,_0x39205b){_0x5d8884=_0x5d8884-0x0;var _0x36cd24=_0xe1d5[_0x5d8884];return _0x36cd24;};'use strict';var multer=require(_0x5e1d('0x0'));var util=require(_0x5e1d('0x1'));var path=require('path');var timeout=require(_0x5e1d('0x2'));var express=require(_0x5e1d('0x3'));var router=express[_0x5e1d('0x4')]();var auth=require(_0x5e1d('0x5'));var interaction=require(_0x5e1d('0x6'));var config=require(_0x5e1d('0x7'));var controller=require(_0x5e1d('0x8'));router['get']('/',auth[_0x5e1d('0x9')](),controller['index']);router['get'](_0x5e1d('0xa'),auth['isAuthenticated'](),controller[_0x5e1d('0xb')]);router[_0x5e1d('0xc')](_0x5e1d('0xd'),auth[_0x5e1d('0x9')](),controller[_0x5e1d('0xe')]);var upload=multer({'storage':multer[_0x5e1d('0xf')]({'destination':function(_0x50b2ed,_0x2af64a,_0x1bac72){_0x1bac72(null,path[_0x5e1d('0x10')](config[_0x5e1d('0x11')],_0x5e1d('0x12')));},'filename':function(_0x1edb72,_0x29a448,_0x451cfc){_0x29a448[_0x5e1d('0x13')]=_0x29a448['originalname'][_0x5e1d('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x451cfc(null,util['format'](_0x5e1d('0x15'),path[_0x5e1d('0x16')](_0x29a448[_0x5e1d('0x13')],path[_0x5e1d('0x17')](_0x29a448['originalname'])),Date[_0x5e1d('0x18')](),path[_0x5e1d('0x17')](_0x29a448[_0x5e1d('0x13')])));}})});router[_0x5e1d('0x19')]('/',upload[_0x5e1d('0x1a')](_0x5e1d('0x1b')),controller[_0x5e1d('0x1c')]);router[_0x5e1d('0x1d')]('/:id',auth[_0x5e1d('0x9')](),controller[_0x5e1d('0x1e')]);router[_0x5e1d('0x1f')](_0x5e1d('0xa'),auth['isAuthenticated'](),controller[_0x5e1d('0x1f')]);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 7cc13eb..1fb0b84 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 _0x32a7=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x44c79f,_0x21f727){var _0x4089ef=function(_0x5a237a){while(--_0x5a237a){_0x44c79f['push'](_0x44c79f['shift']());}};_0x4089ef(++_0x21f727);}(_0x32a7,0x100));var _0x732a=function(_0x716de7,_0x234dc5){_0x716de7=_0x716de7-0x0;var _0x55791c=_0x32a7[_0x716de7];return _0x55791c;};'use strict';var Sequelize=require(_0x732a('0x0'));module[_0x732a('0x1')]={'name':{'type':Sequelize[_0x732a('0x2')],'unique':_0x732a('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x732a('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x732a('0x2')]},'original_format':{'type':Sequelize[_0x732a('0x2')]},'original_duration':{'type':Sequelize[_0x732a('0x4')]},'original_sampleCount':{'type':Sequelize[_0x732a('0x5')]},'original_channelCount':{'type':Sequelize[_0x732a('0x6')]},'original_bitRate':{'type':Sequelize[_0x732a('0x5')]},'original_sampleRate':{'type':Sequelize[_0x732a('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x732a('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x732a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x732a('0x6')]},'converted_bitRate':{'type':Sequelize[_0x732a('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe72d=['FLOAT','INTEGER','BIGINT','sequelize','STRING','name'];(function(_0x87d93b,_0x5225e9){var _0x1c0f01=function(_0x28d911){while(--_0x28d911){_0x87d93b['push'](_0x87d93b['shift']());}};_0x1c0f01(++_0x5225e9);}(_0xe72d,0x129));var _0xde72=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xe72d[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0xde72('0x0'));module['exports']={'name':{'type':Sequelize[_0xde72('0x1')],'unique':_0xde72('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xde72('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xde72('0x1')]},'original_format':{'type':Sequelize[_0xde72('0x1')]},'original_duration':{'type':Sequelize[_0xde72('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xde72('0x4')]},'original_bitRate':{'type':Sequelize[_0xde72('0x5')]},'original_sampleRate':{'type':Sequelize[_0xde72('0x4')]},'converted_format':{'type':Sequelize[_0xde72('0x1')]},'converted_duration':{'type':Sequelize[_0xde72('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xde72('0x5')]},'converted_channelCount':{'type':Sequelize[_0xde72('0x4')]},'converted_bitRate':{'type':Sequelize[_0xde72('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xde72('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 85aff15..f207e5e 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 _0x1e94=['../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','sendStatus','stack','name','send','index','Sound','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','error','unlinkSync','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x50ab95,_0x480438){var _0x2c62cd=function(_0x2af369){while(--_0x2af369){_0x50ab95['push'](_0x50ab95['shift']());}};_0x2c62cd(++_0x480438);}(_0x1e94,0x1ed));var _0x41e9=function(_0x596c9b,_0x10b4a6){_0x596c9b=_0x596c9b-0x0;var _0x43e0ba=_0x1e94[_0x596c9b];return _0x43e0ba;};'use strict';var pdf=require(_0x41e9('0x0'));var emlformat=require(_0x41e9('0x1'));var rimraf=require(_0x41e9('0x2'));var zipdir=require(_0x41e9('0x3'));var jsonpatch=require(_0x41e9('0x4'));var rp=require(_0x41e9('0x5'));var moment=require('moment');var BPromise=require(_0x41e9('0x6'));var Mustache=require(_0x41e9('0x7'));var util=require('util');var path=require(_0x41e9('0x8'));var sox=require(_0x41e9('0x9'));var csv=require('to-csv');var ejs=require(_0x41e9('0xa'));var fs=require('fs');var _=require(_0x41e9('0xb'));var squel=require('squel');var crypto=require(_0x41e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x41e9('0xd'));var toCsv=require(_0x41e9('0xe'));var querystring=require('querystring');var Papa=require(_0x41e9('0xf'));var Redis=require('ioredis');var authService=require(_0x41e9('0x10'));var qs=require(_0x41e9('0x11'));var hardwareService=require(_0x41e9('0x12'));var logger=require(_0x41e9('0x13'))(_0x41e9('0x14'));var utils=require('../../config/utils');var config=require(_0x41e9('0x15'));var db=require(_0x41e9('0x16'))['db'];function respondWithStatusCode(_0x2eb8df,_0x3ffca7){_0x3ffca7=_0x3ffca7||0xcc;return function(_0x1af719){if(_0x1af719){return _0x2eb8df['sendStatus'](_0x3ffca7);}return _0x2eb8df['status'](_0x3ffca7)['end']();};}function respondWithResult(_0x9baf7f,_0x3930ec){_0x3930ec=_0x3930ec||0xc8;return function(_0x56d4f3){if(_0x56d4f3){return _0x9baf7f[_0x41e9('0x17')](_0x3930ec)[_0x41e9('0x18')](_0x56d4f3);}};}function respondWithFilteredResult(_0x284196,_0x41ef97){return function(_0xacfd0a){if(_0xacfd0a){var _0x1f8317=_0xacfd0a['count'],_0x87bda5=_0x41ef97[_0x41e9('0x19')],_0x4025b9=_0x41ef97['offset']+_0x41ef97[_0x41e9('0x1a')],_0x3677a8;if(_0x4025b9>=_0x1f8317){_0x4025b9=_0x1f8317;_0x3677a8=0xc8;}else{_0x3677a8=0xce;}_0x284196[_0x41e9('0x17')](_0x3677a8);return _0x284196[_0x41e9('0x1b')](_0x41e9('0x1c'),_0x87bda5+'-'+_0x4025b9+'/'+_0x1f8317)[_0x41e9('0x18')](_0xacfd0a);}return null;};}function patchUpdates(_0x4099d5){return function(_0x425915){try{jsonpatch[_0x41e9('0x1d')](_0x425915,_0x4099d5,!![]);}catch(_0x5dbd3c){return BPromise[_0x41e9('0x1e')](_0x5dbd3c);}return _0x425915[_0x41e9('0x1f')]();};}function saveUpdates(_0x4358a9,_0xd77a28){return function(_0x59600){if(_0x59600){return _0x59600[_0x41e9('0x20')](_0x4358a9)[_0x41e9('0x21')](function(_0x6e17f){return _0x6e17f;});}return null;};}function removeEntity(_0x376dd8,_0x3891be){return function(_0x278cf3){if(_0x278cf3){return _0x278cf3[_0x41e9('0x22')]()['then'](function(){var _0xcdd8b9=_0x278cf3[_0x41e9('0x23')]({'plain':!![]});var _0x12bb63=_0x41e9('0x24');return db[_0x41e9('0x25')][_0x41e9('0x22')]({'where':{'type':_0x12bb63,'resourceId':_0xcdd8b9['id']}})[_0x41e9('0x21')](function(){return _0x278cf3;});})['then'](function(){_0x376dd8['status'](0xcc)[_0x41e9('0x26')]();});}};}function handleEntityNotFound(_0x5a2eda,_0x3b6f8d){return function(_0x597009){if(!_0x597009){_0x5a2eda[_0x41e9('0x27')](0x194);}return _0x597009;};}function handleError(_0x19ebac,_0x342a78){_0x342a78=_0x342a78||0x1f4;return function(_0xd5edbf){logger['error'](_0xd5edbf[_0x41e9('0x28')]);if(_0xd5edbf[_0x41e9('0x29')]){delete _0xd5edbf['name'];}_0x19ebac[_0x41e9('0x17')](_0x342a78)[_0x41e9('0x2a')](_0xd5edbf);};}exports[_0x41e9('0x2b')]=function(_0x26af6c,_0x13b75e){var _0x1de780={},_0x518977={},_0x1a466e={'count':0x0,'rows':[]};var _0x521d77=db[_0x41e9('0x2c')]['rawAttributes'];_0x518977[_0x41e9('0x2d')]=_[_0x41e9('0x2e')](_0x521d77);_0x518977[_0x41e9('0x2f')]=_[_0x41e9('0x2e')](_0x26af6c[_0x41e9('0x2f')]);_0x518977[_0x41e9('0x30')]=_[_0x41e9('0x31')](_0x518977['model'],_0x518977[_0x41e9('0x2f')]);_0x1de780['attributes']=_[_0x41e9('0x31')](_0x518977[_0x41e9('0x2d')],qs[_0x41e9('0x32')](_0x26af6c[_0x41e9('0x2f')]['fields']));_0x1de780[_0x41e9('0x33')]=_0x1de780['attributes'][_0x41e9('0x34')]?_0x1de780[_0x41e9('0x33')]:_0x518977['model'];if(!_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x35')](_0x41e9('0x36'))){_0x1de780[_0x41e9('0x1a')]=qs['limit'](_0x26af6c[_0x41e9('0x2f')]['limit']);_0x1de780[_0x41e9('0x19')]=qs[_0x41e9('0x19')](_0x26af6c['query'][_0x41e9('0x19')]);}_0x1de780[_0x41e9('0x37')]=qs['sort'](_0x26af6c['query'][_0x41e9('0x38')]);_0x1de780[_0x41e9('0x39')]=qs[_0x41e9('0x30')](_[_0x41e9('0x3a')](_0x26af6c[_0x41e9('0x2f')],_0x518977[_0x41e9('0x30')]));if(_0x26af6c['query'][_0x41e9('0x3b')]){_0x1de780[_0x41e9('0x39')]=_[_0x41e9('0x3c')](_0x1de780['where'],{'$or':_[_0x41e9('0x3d')](_0x521d77,function(_0x411844){if(_0x411844[_0x41e9('0x3e')][_0x41e9('0x3f')]!==_0x41e9('0x40')){var _0x148fd1={};_0x148fd1[_0x411844['field']]={'$like':'%'+_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x3b')]+'%'};return _0x148fd1;}})});}_0x1de780=_[_0x41e9('0x3c')]({},_0x1de780,_0x26af6c['options']);var _0x535be4={'where':_0x1de780['where']};return db['Sound'][_0x41e9('0x41')](_0x535be4)['then'](function(_0x512123){_0x1a466e['count']=_0x512123;if(_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x42')]){_0x1de780[_0x41e9('0x43')]=[{'all':!![]}];}return db['Sound'][_0x41e9('0x44')](_0x1de780);})[_0x41e9('0x21')](function(_0x4ba825){_0x1a466e[_0x41e9('0x45')]=_0x4ba825;return _0x1a466e;})['then'](respondWithFilteredResult(_0x13b75e,_0x1de780))[_0x41e9('0x46')](handleError(_0x13b75e,null));};exports[_0x41e9('0x47')]=function(_0xa89087,_0x5a27ea){var _0x39ac6f={'raw':!![],'where':{'id':_0xa89087[_0x41e9('0x48')]['id']}},_0x55e7bd={};_0x55e7bd['model']=_[_0x41e9('0x2e')](db[_0x41e9('0x2c')][_0x41e9('0x49')]);_0x55e7bd[_0x41e9('0x2f')]=_[_0x41e9('0x2e')](_0xa89087[_0x41e9('0x2f')]);_0x55e7bd[_0x41e9('0x30')]=_[_0x41e9('0x31')](_0x55e7bd[_0x41e9('0x2d')],_0x55e7bd[_0x41e9('0x2f')]);_0x39ac6f['attributes']=_[_0x41e9('0x31')](_0x55e7bd[_0x41e9('0x2d')],qs[_0x41e9('0x32')](_0xa89087[_0x41e9('0x2f')][_0x41e9('0x32')]));_0x39ac6f['attributes']=_0x39ac6f['attributes'][_0x41e9('0x34')]?_0x39ac6f[_0x41e9('0x33')]:_0x55e7bd[_0x41e9('0x2d')];if(_0xa89087[_0x41e9('0x2f')]['includeAll']){_0x39ac6f[_0x41e9('0x43')]=[{'all':!![]}];}_0x39ac6f=_[_0x41e9('0x3c')]({},_0x39ac6f,_0xa89087[_0x41e9('0x4a')]);return db[_0x41e9('0x2c')][_0x41e9('0x4b')](_0x39ac6f)[_0x41e9('0x21')](handleEntityNotFound(_0x5a27ea,null))[_0x41e9('0x21')](respondWithResult(_0x5a27ea,null))[_0x41e9('0x46')](handleError(_0x5a27ea,null));};exports[_0x41e9('0x4c')]=function(_0x26c66b,_0x840b2f,_0x44fee9){return db['Sound'][_0x41e9('0x4b')]({'where':{'id':_0x26c66b[_0x41e9('0x48')]['id']},'attributes':['name',_0x41e9('0x4d'),'converted_format'],'raw':!![]})[_0x41e9('0x21')](handleEntityNotFound(_0x840b2f,null))[_0x41e9('0x21')](function(_0x151122){if(_0x151122){if(!fs[_0x41e9('0x4e')](path[_0x41e9('0x4f')](config[_0x41e9('0x50')],_0x41e9('0x51'),_0x151122['save_name']+'.'+_0x151122[_0x41e9('0x52')]))){throw new db[(_0x41e9('0x53'))][(_0x41e9('0x54'))](_0x41e9('0x55'));}return _0x840b2f['download'](path[_0x41e9('0x4f')](config['root'],_0x41e9('0x51'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x151122[_0x41e9('0x4d')],_0x151122['converted_format'])),util['format'](_0x41e9('0x57'),_0x151122['name'],_0x151122[_0x41e9('0x52')]));}return null;})[_0x41e9('0x46')](handleError(_0x840b2f,null));};exports[_0x41e9('0x58')]=function(_0x2544ad,_0x14aa7d,_0x417a7d){var _0x403fe7={'name':path[_0x41e9('0x59')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')],path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')])),'save_name':path[_0x41e9('0x59')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')],path['extname'](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')])),'original_format':path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')])[_0x41e9('0x5e')](0x1),'converted_format':_0x41e9('0x5f')};var _0x40d55b=path[_0x41e9('0x4f')](config['root'],_0x41e9('0x60'),_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')]);var _0x3f50c8=path[_0x41e9('0x4f')](config[_0x41e9('0x50')],'server/files/sounds/converted',util['format'](_0x41e9('0x57'),path[_0x41e9('0x59')](_0x2544ad['file'][_0x41e9('0x5d')],path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')])),_0x403fe7['converted_format']));logger[_0x41e9('0x61')](_0x41e9('0x62'),_0x40d55b);logger[_0x41e9('0x61')]('Sound\x20upload\x20destination:\x20%s',_0x3f50c8);try{fs[_0x41e9('0x63')](_0x40d55b,parseInt(_0x41e9('0x64'),0x8));var _0x779ee1=sox['transcode'](_0x40d55b,_0x3f50c8,{'sampleRate':0x1f40,'format':_0x41e9('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x779ee1['on'](_0x41e9('0x65'),function(_0x4dc9fb){fs[_0x41e9('0x66')](_0x40d55b);_0x14aa7d[_0x41e9('0x17')](0x1f4)['send'](_0x4dc9fb);});_0x779ee1['on']('src',function(_0xc9da33){_0x403fe7[_0x41e9('0x67')]=isNaN(_0xc9da33[_0x41e9('0x68')])?null:_0xc9da33['duration']*0x3e8;_0x403fe7[_0x41e9('0x69')]=isNaN(_0xc9da33['sampleCount'])?null:_0xc9da33['sampleCount'];_0x403fe7[_0x41e9('0x6a')]=isNaN(_0xc9da33['channelCount'])?null:_0xc9da33[_0x41e9('0x6b')];_0x403fe7[_0x41e9('0x6c')]=isNaN(_0xc9da33[_0x41e9('0x6d')])?null:_0xc9da33['bitRate'];_0x403fe7[_0x41e9('0x6e')]=isNaN(_0xc9da33[_0x41e9('0x6f')])?null:_0xc9da33[_0x41e9('0x6f')];});_0x779ee1['on'](_0x41e9('0x70'),function(_0x298272){_0x403fe7[_0x41e9('0x71')]=isNaN(_0x298272[_0x41e9('0x68')])?null:_0x298272['duration']*0x3e8;_0x403fe7['converted_sampleCount']=isNaN(_0x298272[_0x41e9('0x72')])?null:_0x298272[_0x41e9('0x72')];_0x403fe7[_0x41e9('0x73')]=isNaN(_0x298272[_0x41e9('0x6b')])?null:_0x298272[_0x41e9('0x6b')];_0x403fe7[_0x41e9('0x74')]=isNaN(_0x298272['bitRate'])?null:_0x298272[_0x41e9('0x6d')];_0x403fe7[_0x41e9('0x75')]=isNaN(_0x298272['sampleRate'])?null:_0x298272[_0x41e9('0x6f')];});_0x779ee1['on'](_0x41e9('0x26'),function(){fs[_0x41e9('0x63')](_0x3f50c8,parseInt(_0x41e9('0x64'),0x8));return db[_0x41e9('0x2c')][_0x41e9('0x58')](_0x403fe7)[_0x41e9('0x21')](function(_0x5fb9af){var _0x10153e={'role':_0x2544ad['body'][_0x41e9('0x76')],'userProfileId':_0x2544ad['body']['userProfileId']};if(!_0x10153e)throw new Error(_0x41e9('0x77'));if(_0x10153e[_0x41e9('0x76')]==='user'){var _0x14eafb=_0x5fb9af['get']({'plain':!![]});return db[_0x41e9('0x78')][_0x41e9('0x4b')]({'where':{'name':_0x41e9('0x24'),'userProfileId':_0x10153e[_0x41e9('0x79')]},'raw':!![]})[_0x41e9('0x21')](function(_0x34c1d6){if(_0x34c1d6&&_0x34c1d6[_0x41e9('0x7a')]===0x0){return db[_0x41e9('0x25')][_0x41e9('0x58')]({'name':_0x14eafb[_0x41e9('0x29')],'resourceId':_0x14eafb['id'],'type':_0x34c1d6[_0x41e9('0x29')],'sectionId':_0x34c1d6['id']},{})['then'](function(){return _0x5fb9af;});}else{return _0x5fb9af;}})['catch'](function(_0xa8cc7f){logger[_0x41e9('0x65')](_0x41e9('0x7b'),_0xa8cc7f);throw _0xa8cc7f;});}return _0x5fb9af;})[_0x41e9('0x21')](respondWithResult(_0x14aa7d,null))['catch'](handleError(_0x14aa7d,null));});_0x779ee1['start']();}catch(_0x3d795e){_0x14aa7d['status'](0x1f4)['send'](_0x3d795e);}};exports[_0x41e9('0x20')]=function(_0x209dcf,_0x419327,_0x18692e){return db[_0x41e9('0x2c')][_0x41e9('0x4b')]({'where':{'id':_0x209dcf['params']['id']}})['then'](handleEntityNotFound(_0x419327,null))[_0x41e9('0x21')](saveUpdates(_[_0x41e9('0x3a')](_0x209dcf[_0x41e9('0x7c')],[_0x41e9('0x29'),_0x41e9('0x7d')]),null))[_0x41e9('0x21')](respondWithResult(_0x419327,null))['catch'](handleError(_0x419327,null));};exports[_0x41e9('0x7e')]=function(_0x559511,_0x3bea6b,_0x5cd27d){return db['Sound']['find']({'where':{'id':_0x559511[_0x41e9('0x48')]['id']}})[_0x41e9('0x21')](function(_0x1bc8b4){if(_0x1bc8b4){return _0x1bc8b4['destroy']();}})['then'](function(_0x77e128){var _0x30d3f0=path[_0x41e9('0x4f')](config[_0x41e9('0x50')],_0x41e9('0x60'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x77e128[_0x41e9('0x4d')],_0x77e128[_0x41e9('0x7f')]));var _0x2e7725=path[_0x41e9('0x4f')](config['root'],_0x41e9('0x51'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x77e128[_0x41e9('0x4d')],_0x77e128[_0x41e9('0x52')]));fs[_0x41e9('0x66')](_0x30d3f0);fs['unlinkSync'](_0x2e7725);return _0x77e128;})[_0x41e9('0x21')](function(_0xed8681){if(_0xed8681){return _0x3bea6b['status'](0xcc)[_0x41e9('0x26')]();}})[_0x41e9('0x21')](handleEntityNotFound(_0x3bea6b,null))['catch'](handleError(_0x3bea6b,null));}; \ No newline at end of file +var _0xf486=['save_name','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','format','converted_format','%s.%s','file','originalname','basename','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','delete','original_format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','limit','set','save','then','destroy','Sounds','sendStatus','error','stack','name','send','index','Sound','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','count','include','findAll','rows','catch','show','params','keys','download','find'];(function(_0x442ffd,_0x13ce65){var _0x1264d2=function(_0x2b5ea0){while(--_0x2b5ea0){_0x442ffd['push'](_0x442ffd['shift']());}};_0x1264d2(++_0x13ce65);}(_0xf486,0x19d));var _0x6f48=function(_0x33829d,_0x184f9e){_0x33829d=_0x33829d-0x0;var _0x72b35d=_0xf486[_0x33829d];return _0x72b35d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6f48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f48('0x1'));var rp=require(_0x6f48('0x2'));var moment=require(_0x6f48('0x3'));var BPromise=require(_0x6f48('0x4'));var Mustache=require(_0x6f48('0x5'));var util=require(_0x6f48('0x6'));var path=require(_0x6f48('0x7'));var sox=require(_0x6f48('0x8'));var csv=require(_0x6f48('0x9'));var ejs=require(_0x6f48('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f48('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f48('0xc'));var deskjs=require(_0x6f48('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6f48('0xe'));var Papa=require(_0x6f48('0xf'));var Redis=require('ioredis');var authService=require(_0x6f48('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6f48('0x11'));var logger=require(_0x6f48('0x12'))(_0x6f48('0x13'));var utils=require('../../config/utils');var config=require(_0x6f48('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551f9f,_0x34c2b0){_0x34c2b0=_0x34c2b0||0xcc;return function(_0x4ff494){if(_0x4ff494){return _0x551f9f['sendStatus'](_0x34c2b0);}return _0x551f9f[_0x6f48('0x15')](_0x34c2b0)[_0x6f48('0x16')]();};}function respondWithResult(_0x528d4c,_0x3ab0a3){_0x3ab0a3=_0x3ab0a3||0xc8;return function(_0x54c81a){if(_0x54c81a){return _0x528d4c['status'](_0x3ab0a3)[_0x6f48('0x17')](_0x54c81a);}};}function respondWithFilteredResult(_0x25ed41,_0x300259){return function(_0x530e83){if(_0x530e83){var _0xe283e5=_0x530e83['count'],_0x56af75=_0x300259[_0x6f48('0x18')],_0x1a9987=_0x300259['offset']+_0x300259[_0x6f48('0x19')],_0x2d0816;if(_0x1a9987>=_0xe283e5){_0x1a9987=_0xe283e5;_0x2d0816=0xc8;}else{_0x2d0816=0xce;}_0x25ed41[_0x6f48('0x15')](_0x2d0816);return _0x25ed41[_0x6f48('0x1a')]('Content-Range',_0x56af75+'-'+_0x1a9987+'/'+_0xe283e5)[_0x6f48('0x17')](_0x530e83);}return null;};}function patchUpdates(_0x36c53b){return function(_0x1476eb){try{jsonpatch['apply'](_0x1476eb,_0x36c53b,!![]);}catch(_0x4833c0){return BPromise['reject'](_0x4833c0);}return _0x1476eb[_0x6f48('0x1b')]();};}function saveUpdates(_0x35d0da,_0x52fe54){return function(_0x36c847){if(_0x36c847){return _0x36c847['update'](_0x35d0da)[_0x6f48('0x1c')](function(_0x5e8323){return _0x5e8323;});}return null;};}function removeEntity(_0x77b9bc,_0x47e09c){return function(_0x5a0945){if(_0x5a0945){return _0x5a0945[_0x6f48('0x1d')]()[_0x6f48('0x1c')](function(){var _0x31fbbe=_0x5a0945['get']({'plain':!![]});var _0x202eec=_0x6f48('0x1e');return db['UserProfileResource'][_0x6f48('0x1d')]({'where':{'type':_0x202eec,'resourceId':_0x31fbbe['id']}})[_0x6f48('0x1c')](function(){return _0x5a0945;});})[_0x6f48('0x1c')](function(){_0x77b9bc[_0x6f48('0x15')](0xcc)[_0x6f48('0x16')]();});}};}function handleEntityNotFound(_0x1fcab0,_0x45ed2b){return function(_0x38e31d){if(!_0x38e31d){_0x1fcab0[_0x6f48('0x1f')](0x194);}return _0x38e31d;};}function handleError(_0x518cf2,_0x126848){_0x126848=_0x126848||0x1f4;return function(_0x2e788b){logger[_0x6f48('0x20')](_0x2e788b[_0x6f48('0x21')]);if(_0x2e788b[_0x6f48('0x22')]){delete _0x2e788b[_0x6f48('0x22')];}_0x518cf2[_0x6f48('0x15')](_0x126848)[_0x6f48('0x23')](_0x2e788b);};}exports[_0x6f48('0x24')]=function(_0x696bfb,_0xf4d652){var _0x30414e={},_0x2f7393={},_0x1741f4={'count':0x0,'rows':[]};var _0x1c6a32=db[_0x6f48('0x25')][_0x6f48('0x26')];_0x2f7393[_0x6f48('0x27')]=_['keys'](_0x1c6a32);_0x2f7393['query']=_['keys'](_0x696bfb[_0x6f48('0x28')]);_0x2f7393[_0x6f48('0x29')]=_[_0x6f48('0x2a')](_0x2f7393[_0x6f48('0x27')],_0x2f7393[_0x6f48('0x28')]);_0x30414e[_0x6f48('0x2b')]=_[_0x6f48('0x2a')](_0x2f7393['model'],qs[_0x6f48('0x2c')](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x2c')]));_0x30414e['attributes']=_0x30414e[_0x6f48('0x2b')][_0x6f48('0x2d')]?_0x30414e[_0x6f48('0x2b')]:_0x2f7393['model'];if(!_0x696bfb[_0x6f48('0x28')]['hasOwnProperty'](_0x6f48('0x2e'))){_0x30414e[_0x6f48('0x19')]=qs['limit'](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x19')]);_0x30414e[_0x6f48('0x18')]=qs[_0x6f48('0x18')](_0x696bfb[_0x6f48('0x28')]['offset']);}_0x30414e[_0x6f48('0x2f')]=qs[_0x6f48('0x30')](_0x696bfb[_0x6f48('0x28')][_0x6f48('0x30')]);_0x30414e[_0x6f48('0x31')]=qs['filters'](_[_0x6f48('0x32')](_0x696bfb['query'],_0x2f7393[_0x6f48('0x29')]));if(_0x696bfb[_0x6f48('0x28')][_0x6f48('0x33')]){_0x30414e[_0x6f48('0x31')]=_[_0x6f48('0x34')](_0x30414e[_0x6f48('0x31')],{'$or':_[_0x6f48('0x35')](_0x1c6a32,function(_0x294b21){if(_0x294b21[_0x6f48('0x36')]['key']!=='VIRTUAL'){var _0x4622c6={};_0x4622c6[_0x294b21[_0x6f48('0x37')]]={'$like':'%'+_0x696bfb[_0x6f48('0x28')][_0x6f48('0x33')]+'%'};return _0x4622c6;}})});}_0x30414e=_[_0x6f48('0x34')]({},_0x30414e,_0x696bfb[_0x6f48('0x38')]);var _0x25d528={'where':_0x30414e[_0x6f48('0x31')]};return db[_0x6f48('0x25')][_0x6f48('0x39')](_0x25d528)[_0x6f48('0x1c')](function(_0x3877a6){_0x1741f4[_0x6f48('0x39')]=_0x3877a6;if(_0x696bfb[_0x6f48('0x28')]['includeAll']){_0x30414e[_0x6f48('0x3a')]=[{'all':!![]}];}return db[_0x6f48('0x25')][_0x6f48('0x3b')](_0x30414e);})['then'](function(_0x59f9ad){_0x1741f4[_0x6f48('0x3c')]=_0x59f9ad;return _0x1741f4;})['then'](respondWithFilteredResult(_0xf4d652,_0x30414e))[_0x6f48('0x3d')](handleError(_0xf4d652,null));};exports[_0x6f48('0x3e')]=function(_0x5ca755,_0x2fca2f){var _0x377b2b={'raw':!![],'where':{'id':_0x5ca755[_0x6f48('0x3f')]['id']}},_0x14baf4={};_0x14baf4[_0x6f48('0x27')]=_[_0x6f48('0x40')](db['Sound']['rawAttributes']);_0x14baf4['query']=_[_0x6f48('0x40')](_0x5ca755[_0x6f48('0x28')]);_0x14baf4[_0x6f48('0x29')]=_['intersection'](_0x14baf4['model'],_0x14baf4[_0x6f48('0x28')]);_0x377b2b[_0x6f48('0x2b')]=_[_0x6f48('0x2a')](_0x14baf4[_0x6f48('0x27')],qs['fields'](_0x5ca755[_0x6f48('0x28')]['fields']));_0x377b2b[_0x6f48('0x2b')]=_0x377b2b['attributes']['length']?_0x377b2b[_0x6f48('0x2b')]:_0x14baf4['model'];if(_0x5ca755[_0x6f48('0x28')]['includeAll']){_0x377b2b['include']=[{'all':!![]}];}_0x377b2b=_[_0x6f48('0x34')]({},_0x377b2b,_0x5ca755[_0x6f48('0x38')]);return db[_0x6f48('0x25')]['find'](_0x377b2b)[_0x6f48('0x1c')](handleEntityNotFound(_0x2fca2f,null))[_0x6f48('0x1c')](respondWithResult(_0x2fca2f,null))[_0x6f48('0x3d')](handleError(_0x2fca2f,null));};exports[_0x6f48('0x41')]=function(_0x468212,_0x4a1d13,_0x1984c1){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x468212[_0x6f48('0x3f')]['id']},'attributes':[_0x6f48('0x22'),_0x6f48('0x43'),'converted_format'],'raw':!![]})[_0x6f48('0x1c')](handleEntityNotFound(_0x4a1d13,null))[_0x6f48('0x1c')](function(_0x82702f){if(_0x82702f){if(!fs[_0x6f48('0x44')](path[_0x6f48('0x45')](config['root'],_0x6f48('0x46'),_0x82702f[_0x6f48('0x43')]+'.'+_0x82702f['converted_format']))){throw new db[(_0x6f48('0x47'))][(_0x6f48('0x48'))](_0x6f48('0x49'));}return _0x4a1d13[_0x6f48('0x41')](path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x46'),util[_0x6f48('0x4b')]('%s.%s',_0x82702f[_0x6f48('0x43')],_0x82702f[_0x6f48('0x4c')])),util['format'](_0x6f48('0x4d'),_0x82702f['name'],_0x82702f['converted_format']));}return null;})[_0x6f48('0x3d')](handleError(_0x4a1d13,null));};exports['create']=function(_0x266ec5,_0x325106,_0x1d6913){var _0x209167={'name':path['basename'](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x4f')],path['extname'](_0x266ec5['file'][_0x6f48('0x4f')])),'save_name':path[_0x6f48('0x50')](_0x266ec5[_0x6f48('0x4e')]['filename'],path[_0x6f48('0x51')](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x52')])),'original_format':path[_0x6f48('0x51')](_0x266ec5['file'][_0x6f48('0x4f')])[_0x6f48('0x53')](0x1),'converted_format':_0x6f48('0x54')};var _0x3d1aa0=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x55'),_0x266ec5['file'][_0x6f48('0x52')]);var _0x3d47e6=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x46'),util[_0x6f48('0x4b')]('%s.%s',path['basename'](_0x266ec5[_0x6f48('0x4e')]['filename'],path[_0x6f48('0x51')](_0x266ec5[_0x6f48('0x4e')][_0x6f48('0x52')])),_0x209167[_0x6f48('0x4c')]));logger[_0x6f48('0x56')](_0x6f48('0x57'),_0x3d1aa0);logger[_0x6f48('0x56')](_0x6f48('0x58'),_0x3d47e6);try{fs[_0x6f48('0x59')](_0x3d1aa0,parseInt(_0x6f48('0x5a'),0x8));var _0x54c4ff=sox[_0x6f48('0x5b')](_0x3d1aa0,_0x3d47e6,{'sampleRate':0x1f40,'format':_0x6f48('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54c4ff['on'](_0x6f48('0x20'),function(_0x10b7c2){fs[_0x6f48('0x5c')](_0x3d1aa0);_0x325106[_0x6f48('0x15')](0x1f4)[_0x6f48('0x23')](_0x10b7c2);});_0x54c4ff['on']('src',function(_0x57a108){_0x209167[_0x6f48('0x5d')]=isNaN(_0x57a108[_0x6f48('0x5e')])?null:_0x57a108[_0x6f48('0x5e')]*0x3e8;_0x209167[_0x6f48('0x5f')]=isNaN(_0x57a108[_0x6f48('0x60')])?null:_0x57a108[_0x6f48('0x60')];_0x209167[_0x6f48('0x61')]=isNaN(_0x57a108[_0x6f48('0x62')])?null:_0x57a108[_0x6f48('0x62')];_0x209167[_0x6f48('0x63')]=isNaN(_0x57a108[_0x6f48('0x64')])?null:_0x57a108[_0x6f48('0x64')];_0x209167[_0x6f48('0x65')]=isNaN(_0x57a108['sampleRate'])?null:_0x57a108[_0x6f48('0x66')];});_0x54c4ff['on']('dest',function(_0x4e4d54){_0x209167[_0x6f48('0x67')]=isNaN(_0x4e4d54[_0x6f48('0x5e')])?null:_0x4e4d54['duration']*0x3e8;_0x209167[_0x6f48('0x68')]=isNaN(_0x4e4d54['sampleCount'])?null:_0x4e4d54['sampleCount'];_0x209167[_0x6f48('0x69')]=isNaN(_0x4e4d54['channelCount'])?null:_0x4e4d54[_0x6f48('0x62')];_0x209167[_0x6f48('0x6a')]=isNaN(_0x4e4d54['bitRate'])?null:_0x4e4d54[_0x6f48('0x64')];_0x209167[_0x6f48('0x6b')]=isNaN(_0x4e4d54['sampleRate'])?null:_0x4e4d54['sampleRate'];});_0x54c4ff['on'](_0x6f48('0x16'),function(){fs[_0x6f48('0x59')](_0x3d47e6,parseInt(_0x6f48('0x5a'),0x8));return db['Sound'][_0x6f48('0x6c')](_0x209167)['then'](function(_0x5b49ff){var _0x37eca4={'role':_0x266ec5[_0x6f48('0x6d')][_0x6f48('0x6e')],'userProfileId':_0x266ec5[_0x6f48('0x6d')][_0x6f48('0x6f')]};if(!_0x37eca4)throw new Error(_0x6f48('0x70'));if(_0x37eca4[_0x6f48('0x6e')]===_0x6f48('0x71')){var _0xd4aec1=_0x5b49ff[_0x6f48('0x72')]({'plain':!![]});return db[_0x6f48('0x73')][_0x6f48('0x42')]({'where':{'name':_0x6f48('0x1e'),'userProfileId':_0x37eca4[_0x6f48('0x6f')]},'raw':!![]})[_0x6f48('0x1c')](function(_0x301dae){if(_0x301dae&&_0x301dae[_0x6f48('0x74')]===0x0){return db[_0x6f48('0x75')][_0x6f48('0x6c')]({'name':_0xd4aec1[_0x6f48('0x22')],'resourceId':_0xd4aec1['id'],'type':_0x301dae[_0x6f48('0x22')],'sectionId':_0x301dae['id']},{})[_0x6f48('0x1c')](function(){return _0x5b49ff;});}else{return _0x5b49ff;}})[_0x6f48('0x3d')](function(_0x4e54ce){logger[_0x6f48('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e54ce);throw _0x4e54ce;});}return _0x5b49ff;})[_0x6f48('0x1c')](respondWithResult(_0x325106,null))[_0x6f48('0x3d')](handleError(_0x325106,null));});_0x54c4ff['start']();}catch(_0x3a6157){_0x325106[_0x6f48('0x15')](0x1f4)[_0x6f48('0x23')](_0x3a6157);}};exports['update']=function(_0x3658e2,_0xb30a8e,_0x3ac648){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x3658e2[_0x6f48('0x3f')]['id']}})[_0x6f48('0x1c')](handleEntityNotFound(_0xb30a8e,null))[_0x6f48('0x1c')](saveUpdates(_['pick'](_0x3658e2[_0x6f48('0x6d')],[_0x6f48('0x22'),'description']),null))[_0x6f48('0x1c')](respondWithResult(_0xb30a8e,null))[_0x6f48('0x3d')](handleError(_0xb30a8e,null));};exports[_0x6f48('0x76')]=function(_0x8a01c5,_0xbe6eb2,_0x54ca6f){return db[_0x6f48('0x25')][_0x6f48('0x42')]({'where':{'id':_0x8a01c5[_0x6f48('0x3f')]['id']}})[_0x6f48('0x1c')](function(_0x208bf1){if(_0x208bf1){return _0x208bf1['destroy']();}})[_0x6f48('0x1c')](function(_0x5efb03){var _0x59029c=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],_0x6f48('0x55'),util[_0x6f48('0x4b')]('%s.%s',_0x5efb03['save_name'],_0x5efb03[_0x6f48('0x77')]));var _0x1c5eb9=path[_0x6f48('0x45')](config[_0x6f48('0x4a')],'server/files/sounds/converted',util[_0x6f48('0x4b')](_0x6f48('0x4d'),_0x5efb03[_0x6f48('0x43')],_0x5efb03[_0x6f48('0x4c')]));fs[_0x6f48('0x5c')](_0x59029c);fs['unlinkSync'](_0x1c5eb9);return _0x5efb03;})[_0x6f48('0x1c')](function(_0x4c32b3){if(_0x4c32b3){return _0xbe6eb2[_0x6f48('0x15')](0xcc)['end']();}})['then'](handleEntityNotFound(_0xbe6eb2,null))[_0x6f48('0x3d')](handleError(_0xbe6eb2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 0a4dfb9..d7ff37f 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 _0x53b4=['bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment'];(function(_0x933a0b,_0x8985b0){var _0x3d4991=function(_0x52a0aa){while(--_0x52a0aa){_0x933a0b['push'](_0x933a0b['shift']());}};_0x3d4991(++_0x8985b0);}(_0x53b4,0xb1));var _0x453b=function(_0x46a14f,_0x46ca40){_0x46a14f=_0x46a14f-0x0;var _0x4e26f9=_0x53b4[_0x46a14f];return _0x4e26f9;};'use strict';var _=require(_0x453b('0x0'));var util=require(_0x453b('0x1'));var logger=require(_0x453b('0x2'))(_0x453b('0x3'));var moment=require(_0x453b('0x4'));var BPromise=require(_0x453b('0x5'));var rp=require(_0x453b('0x6'));var fs=require('fs');var path=require(_0x453b('0x7'));var rimraf=require('rimraf');var config=require(_0x453b('0x8'));var attributes=require(_0x453b('0x9'));module[_0x453b('0xa')]=function(_0x37f584,_0x5d996e){return _0x37f584[_0x453b('0xb')](_0x453b('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b20=['./sound.attributes','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2bc4df,_0x397a6f){var _0x4bcc54=function(_0xc72ce8){while(--_0xc72ce8){_0x2bc4df['push'](_0x2bc4df['shift']());}};_0x4bcc54(++_0x397a6f);}(_0x1b20,0xc6));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x01b2('0x0'));var util=require(_0x01b2('0x1'));var logger=require(_0x01b2('0x2'))(_0x01b2('0x3'));var moment=require(_0x01b2('0x4'));var BPromise=require(_0x01b2('0x5'));var rp=require(_0x01b2('0x6'));var fs=require('fs');var path=require(_0x01b2('0x7'));var rimraf=require(_0x01b2('0x8'));var config=require(_0x01b2('0x9'));var attributes=require(_0x01b2('0xa'));module['exports']=function(_0x46956f,_0x1d38f9){return _0x46956f['define'](_0x01b2('0xb'),attributes,{'tableName':_0x01b2('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 f9fec1e..c866ea0 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x417a02,_0x7ec2d2){var _0x207bea=function(_0x410280){while(--_0x410280){_0x417a02['push'](_0x417a02['shift']());}};_0x207bea(++_0x7ec2d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d550,_0x1c3fd0){_0x56d550=_0x56d550-0x0;var _0x5e6a91=_0xb10b[_0x56d550];return _0x5e6a91;};'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 _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x1b1173,_0x2ffb6c){var _0xb5bbbf=function(_0x3e8ee2){while(--_0x3e8ee2){_0x1b1173['push'](_0x1b1173['shift']());}};_0xb5bbbf(++_0x2ffb6c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 116bd66..0cc34d4 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 _0xc8be=['index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated'];(function(_0x3345bb,_0x5bd0ce){var _0x1a0975=function(_0x10fcc0){while(--_0x10fcc0){_0x3345bb['push'](_0x3345bb['shift']());}};_0x1a0975(++_0x5bd0ce);}(_0xc8be,0x15d));var _0xec8b=function(_0x176770,_0xcba693){_0x176770=_0x176770-0x0;var _0x36885a=_0xc8be[_0x176770];return _0x36885a;};'use strict';var multer=require(_0xec8b('0x0'));var util=require(_0xec8b('0x1'));var path=require(_0xec8b('0x2'));var timeout=require(_0xec8b('0x3'));var express=require(_0xec8b('0x4'));var router=express[_0xec8b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xec8b('0x6'));var config=require(_0xec8b('0x7'));var controller=require(_0xec8b('0x8'));router[_0xec8b('0x9')]('/',auth[_0xec8b('0xa')](),controller[_0xec8b('0xb')]);router[_0xec8b('0x9')]('/:id',auth[_0xec8b('0xa')](),controller['show']);router[_0xec8b('0xc')]('/',auth[_0xec8b('0xa')](),controller[_0xec8b('0xd')]);router[_0xec8b('0xe')](_0xec8b('0xf'),auth['isAuthenticated'](),controller[_0xec8b('0x10')]);router[_0xec8b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xec8b('0x12')]);module[_0xec8b('0x13')]=router; \ No newline at end of file +var _0x33f5=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x33f5,0xfa));var _0x533f=function(_0x474906,_0x2777a2){_0x474906=_0x474906-0x0;var _0x64b28a=_0x33f5[_0x474906];return _0x64b28a;};'use strict';var multer=require('multer');var util=require(_0x533f('0x0'));var path=require(_0x533f('0x1'));var timeout=require('connect-timeout');var express=require(_0x533f('0x2'));var router=express['Router']();var auth=require(_0x533f('0x3'));var interaction=require(_0x533f('0x4'));var config=require(_0x533f('0x5'));var controller=require(_0x533f('0x6'));router[_0x533f('0x7')]('/',auth[_0x533f('0x8')](),controller[_0x533f('0x9')]);router['get'](_0x533f('0xa'),auth['isAuthenticated'](),controller[_0x533f('0xb')]);router[_0x533f('0xc')]('/',auth[_0x533f('0x8')](),controller[_0x533f('0xd')]);router[_0x533f('0xe')]('/:id',auth[_0x533f('0x8')](),controller['update']);router[_0x533f('0xf')](_0x533f('0xa'),auth[_0x533f('0x8')](),controller[_0x533f('0x10')]);module[_0x533f('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index aae53a6..7b5fd54 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 _0x5f90=['medium','out','exports','TEXT'];(function(_0x261ef8,_0xb95320){var _0x46069e=function(_0x2518c6){while(--_0x2518c6){_0x261ef8['push'](_0x261ef8['shift']());}};_0x46069e(++_0xb95320);}(_0x5f90,0x1de));var _0x05f9=function(_0x2009f2,_0x5dd74e){_0x2009f2=_0x2009f2-0x0;var _0x9b0e1d=_0x5f90[_0x2009f2];return _0x9b0e1d;};'use strict';var Sequelize=require('sequelize');module[_0x05f9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x05f9('0x1')](_0x05f9('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x05f9('0x3')),'defaultValue':_0x05f9('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0x8d1b=['medium','ENUM','out','sequelize','TEXT'];(function(_0x293dcd,_0x32543b){var _0x1b68fb=function(_0x4b7249){while(--_0x4b7249){_0x293dcd['push'](_0x293dcd['shift']());}};_0x1b68fb(++_0x32543b);}(_0x8d1b,0x8a));var _0xb8d1=function(_0x4de3d8,_0x3cbcec){_0x4de3d8=_0x4de3d8-0x0;var _0x36b156=_0x8d1b[_0x4de3d8];return _0x36b156;};'use strict';var Sequelize=require(_0xb8d1('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xb8d1('0x1')](_0xb8d1('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xb8d1('0x3')]('in',_0xb8d1('0x4')),'defaultValue':_0xb8d1('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c533ac7..a06780e 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 _0xe81d=['json','count','offset','limit','set','apply','reject','then','end','error','stack','name','send','index','SquareMessage','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','update','destroy','html-pdf','eml-format','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1dee17,_0x5dc47c){var _0x24c740=function(_0x434a51){while(--_0x434a51){_0x1dee17['push'](_0x1dee17['shift']());}};_0x24c740(++_0x5dc47c);}(_0xe81d,0x142));var _0xde81=function(_0x10dc60,_0x52cc33){_0x10dc60=_0x10dc60-0x0;var _0x31366d=_0xe81d[_0x10dc60];return _0x31366d;};'use strict';var pdf=require(_0xde81('0x0'));var emlformat=require(_0xde81('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde81('0x2'));var moment=require(_0xde81('0x3'));var BPromise=require(_0xde81('0x4'));var Mustache=require('mustache');var util=require(_0xde81('0x5'));var path=require(_0xde81('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde81('0x7'));var fs=require('fs');var _=require(_0xde81('0x8'));var squel=require(_0xde81('0x9'));var crypto=require(_0xde81('0xa'));var jsforce=require(_0xde81('0xb'));var deskjs=require(_0xde81('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde81('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xde81('0xe'));var qs=require(_0xde81('0xf'));var hardwareService=require(_0xde81('0x10'));var logger=require(_0xde81('0x11'))('api');var utils=require(_0xde81('0x12'));var config=require(_0xde81('0x13'));var db=require(_0xde81('0x14'))['db'];function respondWithStatusCode(_0x18b742,_0x3a3280){_0x3a3280=_0x3a3280||0xcc;return function(_0x58ba52){if(_0x58ba52){return _0x18b742[_0xde81('0x15')](_0x3a3280);}return _0x18b742[_0xde81('0x16')](_0x3a3280)['end']();};}function respondWithResult(_0x4e320e,_0x5570d9){_0x5570d9=_0x5570d9||0xc8;return function(_0x146dd9){if(_0x146dd9){return _0x4e320e[_0xde81('0x16')](_0x5570d9)[_0xde81('0x17')](_0x146dd9);}};}function respondWithFilteredResult(_0x4e8af6,_0x3d07c1){return function(_0x2b8407){if(_0x2b8407){var _0x2992cb=_0x2b8407[_0xde81('0x18')],_0x446052=_0x3d07c1['offset'],_0x2f3e0c=_0x3d07c1[_0xde81('0x19')]+_0x3d07c1[_0xde81('0x1a')],_0x5ca7fb;if(_0x2f3e0c>=_0x2992cb){_0x2f3e0c=_0x2992cb;_0x5ca7fb=0xc8;}else{_0x5ca7fb=0xce;}_0x4e8af6[_0xde81('0x16')](_0x5ca7fb);return _0x4e8af6[_0xde81('0x1b')]('Content-Range',_0x446052+'-'+_0x2f3e0c+'/'+_0x2992cb)[_0xde81('0x17')](_0x2b8407);}return null;};}function patchUpdates(_0x4e0e77){return function(_0x56b30d){try{jsonpatch[_0xde81('0x1c')](_0x56b30d,_0x4e0e77,!![]);}catch(_0x516d0d){return BPromise[_0xde81('0x1d')](_0x516d0d);}return _0x56b30d['save']();};}function saveUpdates(_0x27975c,_0x241e8e){return function(_0x562160){if(_0x562160){return _0x562160['update'](_0x27975c)[_0xde81('0x1e')](function(_0x4d353d){return _0x4d353d;});}return null;};}function removeEntity(_0x7e19c8,_0x159297){return function(_0x1f0a22){if(_0x1f0a22){return _0x1f0a22['destroy']()[_0xde81('0x1e')](function(){_0x7e19c8[_0xde81('0x16')](0xcc)[_0xde81('0x1f')]();});}};}function handleEntityNotFound(_0x489cf9,_0xd8a8a6){return function(_0x130fd4){if(!_0x130fd4){_0x489cf9[_0xde81('0x15')](0x194);}return _0x130fd4;};}function handleError(_0x200968,_0x3d65cb){_0x3d65cb=_0x3d65cb||0x1f4;return function(_0x5cf373){logger[_0xde81('0x20')](_0x5cf373[_0xde81('0x21')]);if(_0x5cf373[_0xde81('0x22')]){delete _0x5cf373['name'];}_0x200968['status'](_0x3d65cb)[_0xde81('0x23')](_0x5cf373);};}exports[_0xde81('0x24')]=function(_0x4412df,_0x2b851d){var _0x9778e9={},_0x57c88f={},_0x2eb51b={'count':0x0,'rows':[]};var _0x1f2e0c=db[_0xde81('0x25')]['rawAttributes'];_0x57c88f[_0xde81('0x26')]=_[_0xde81('0x27')](_0x1f2e0c);_0x57c88f[_0xde81('0x28')]=_[_0xde81('0x27')](_0x4412df[_0xde81('0x28')]);_0x57c88f[_0xde81('0x29')]=_['intersection'](_0x57c88f[_0xde81('0x26')],_0x57c88f['query']);_0x9778e9[_0xde81('0x2a')]=_[_0xde81('0x2b')](_0x57c88f['model'],qs[_0xde81('0x2c')](_0x4412df['query'][_0xde81('0x2c')]));_0x9778e9['attributes']=_0x9778e9[_0xde81('0x2a')]['length']?_0x9778e9[_0xde81('0x2a')]:_0x57c88f[_0xde81('0x26')];if(!_0x4412df[_0xde81('0x28')]['hasOwnProperty'](_0xde81('0x2d'))){_0x9778e9[_0xde81('0x1a')]=qs['limit'](_0x4412df[_0xde81('0x28')][_0xde81('0x1a')]);_0x9778e9[_0xde81('0x19')]=qs['offset'](_0x4412df[_0xde81('0x28')][_0xde81('0x19')]);}_0x9778e9[_0xde81('0x2e')]=qs[_0xde81('0x2f')](_0x4412df[_0xde81('0x28')][_0xde81('0x2f')]);_0x9778e9['where']=qs[_0xde81('0x29')](_['pick'](_0x4412df[_0xde81('0x28')],_0x57c88f['filters']));if(_0x4412df[_0xde81('0x28')]['filter']){_0x9778e9[_0xde81('0x30')]=_[_0xde81('0x31')](_0x9778e9[_0xde81('0x30')],{'$or':_[_0xde81('0x32')](_0x1f2e0c,function(_0x32bc94){if(_0x32bc94[_0xde81('0x33')][_0xde81('0x34')]!=='VIRTUAL'){var _0x3bee39={};_0x3bee39[_0x32bc94[_0xde81('0x35')]]={'$like':'%'+_0x4412df['query'][_0xde81('0x36')]+'%'};return _0x3bee39;}})});}_0x9778e9=_['merge']({},_0x9778e9,_0x4412df[_0xde81('0x37')]);var _0x2ac874={'where':_0x9778e9[_0xde81('0x30')]};return db[_0xde81('0x25')][_0xde81('0x18')](_0x2ac874)['then'](function(_0x44ee3b){_0x2eb51b['count']=_0x44ee3b;if(_0x4412df['query'][_0xde81('0x38')]){_0x9778e9[_0xde81('0x39')]=[{'all':!![]}];}return db['SquareMessage'][_0xde81('0x3a')](_0x9778e9);})['then'](function(_0x2efb61){_0x2eb51b['rows']=_0x2efb61;return _0x2eb51b;})[_0xde81('0x1e')](respondWithFilteredResult(_0x2b851d,_0x9778e9))[_0xde81('0x3b')](handleError(_0x2b851d,null));};exports[_0xde81('0x3c')]=function(_0x2016b6,_0x389226){var _0x347ab2={'raw':!![],'where':{'id':_0x2016b6[_0xde81('0x3d')]['id']}},_0x43abdc={};_0x43abdc['model']=_['keys'](db['SquareMessage'][_0xde81('0x3e')]);_0x43abdc['query']=_[_0xde81('0x27')](_0x2016b6[_0xde81('0x28')]);_0x43abdc[_0xde81('0x29')]=_['intersection'](_0x43abdc[_0xde81('0x26')],_0x43abdc[_0xde81('0x28')]);_0x347ab2[_0xde81('0x2a')]=_[_0xde81('0x2b')](_0x43abdc[_0xde81('0x26')],qs[_0xde81('0x2c')](_0x2016b6[_0xde81('0x28')][_0xde81('0x2c')]));_0x347ab2[_0xde81('0x2a')]=_0x347ab2[_0xde81('0x2a')][_0xde81('0x3f')]?_0x347ab2['attributes']:_0x43abdc['model'];if(_0x2016b6[_0xde81('0x28')]['includeAll']){_0x347ab2[_0xde81('0x39')]=[{'all':!![]}];}_0x347ab2=_['merge']({},_0x347ab2,_0x2016b6[_0xde81('0x37')]);return db['SquareMessage'][_0xde81('0x40')](_0x347ab2)['then'](handleEntityNotFound(_0x389226,null))['then'](respondWithResult(_0x389226,null))[_0xde81('0x3b')](handleError(_0x389226,null));};exports[_0xde81('0x41')]=function(_0x2c8089,_0x456120){return db['SquareMessage'][_0xde81('0x41')](_0x2c8089[_0xde81('0x42')],{})[_0xde81('0x1e')](respondWithResult(_0x456120,0xc9))[_0xde81('0x3b')](handleError(_0x456120,null));};exports[_0xde81('0x43')]=function(_0x3d6722,_0x1eae0b){if(_0x3d6722[_0xde81('0x42')]['id']){delete _0x3d6722['body']['id'];}return db['SquareMessage'][_0xde81('0x40')]({'where':{'id':_0x3d6722[_0xde81('0x3d')]['id']}})[_0xde81('0x1e')](handleEntityNotFound(_0x1eae0b,null))['then'](saveUpdates(_0x3d6722[_0xde81('0x42')],null))[_0xde81('0x1e')](respondWithResult(_0x1eae0b,null))[_0xde81('0x3b')](handleError(_0x1eae0b,null));};exports[_0xde81('0x44')]=function(_0x7addfd,_0x2a1f5e){return db[_0xde81('0x25')][_0xde81('0x40')]({'where':{'id':_0x7addfd[_0xde81('0x3d')]['id']}})[_0xde81('0x1e')](handleEntityNotFound(_0x2a1f5e,null))[_0xde81('0x1e')](removeEntity(_0x2a1f5e,null))[_0xde81('0x3b')](handleError(_0x2a1f5e,null));}; \ No newline at end of file +var _0x2605=['attributes','fields','nolimit','sort','where','pick','merge','map','type','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','SquareMessage','query','filters','intersection','model'];(function(_0x503139,_0x494581){var _0x396ea6=function(_0x5b36dd){while(--_0x5b36dd){_0x503139['push'](_0x503139['shift']());}};_0x396ea6(++_0x494581);}(_0x2605,0xe8));var _0x5260=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x2605[_0xb24fad];return _0x173226;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5260('0x0'));var rimraf=require(_0x5260('0x1'));var zipdir=require(_0x5260('0x2'));var jsonpatch=require(_0x5260('0x3'));var rp=require(_0x5260('0x4'));var moment=require(_0x5260('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5260('0x6'));var util=require(_0x5260('0x7'));var path=require(_0x5260('0x8'));var sox=require('sox');var csv=require(_0x5260('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5260('0xa'));var squel=require(_0x5260('0xb'));var crypto=require(_0x5260('0xc'));var jsforce=require(_0x5260('0xd'));var deskjs=require(_0x5260('0xe'));var toCsv=require(_0x5260('0x9'));var querystring=require(_0x5260('0xf'));var Papa=require('papaparse');var Redis=require(_0x5260('0x10'));var authService=require(_0x5260('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5260('0x12'))(_0x5260('0x13'));var utils=require(_0x5260('0x14'));var config=require(_0x5260('0x15'));var db=require(_0x5260('0x16'))['db'];function respondWithStatusCode(_0x4aca08,_0x27ca87){_0x27ca87=_0x27ca87||0xcc;return function(_0xc5a8c5){if(_0xc5a8c5){return _0x4aca08[_0x5260('0x17')](_0x27ca87);}return _0x4aca08['status'](_0x27ca87)['end']();};}function respondWithResult(_0x24a830,_0x476967){_0x476967=_0x476967||0xc8;return function(_0x2ec8ed){if(_0x2ec8ed){return _0x24a830[_0x5260('0x18')](_0x476967)['json'](_0x2ec8ed);}};}function respondWithFilteredResult(_0x58cf16,_0x46c4e3){return function(_0x21a3a4){if(_0x21a3a4){var _0x5cef4e=_0x21a3a4[_0x5260('0x19')],_0x1cfc82=_0x46c4e3[_0x5260('0x1a')],_0x500ac5=_0x46c4e3[_0x5260('0x1a')]+_0x46c4e3[_0x5260('0x1b')],_0x52e4fd;if(_0x500ac5>=_0x5cef4e){_0x500ac5=_0x5cef4e;_0x52e4fd=0xc8;}else{_0x52e4fd=0xce;}_0x58cf16[_0x5260('0x18')](_0x52e4fd);return _0x58cf16[_0x5260('0x1c')](_0x5260('0x1d'),_0x1cfc82+'-'+_0x500ac5+'/'+_0x5cef4e)[_0x5260('0x1e')](_0x21a3a4);}return null;};}function patchUpdates(_0x1aeb38){return function(_0x336c94){try{jsonpatch[_0x5260('0x1f')](_0x336c94,_0x1aeb38,!![]);}catch(_0x2eb676){return BPromise[_0x5260('0x20')](_0x2eb676);}return _0x336c94[_0x5260('0x21')]();};}function saveUpdates(_0x2dd570,_0x2fb150){return function(_0x1472b3){if(_0x1472b3){return _0x1472b3[_0x5260('0x22')](_0x2dd570)['then'](function(_0x2f430a){return _0x2f430a;});}return null;};}function removeEntity(_0x56e8e7,_0x1a307f){return function(_0x2b0c26){if(_0x2b0c26){return _0x2b0c26[_0x5260('0x23')]()[_0x5260('0x24')](function(){_0x56e8e7[_0x5260('0x18')](0xcc)[_0x5260('0x25')]();});}};}function handleEntityNotFound(_0x116a1b,_0x55e2c2){return function(_0x19a6d7){if(!_0x19a6d7){_0x116a1b['sendStatus'](0x194);}return _0x19a6d7;};}function handleError(_0x10f52a,_0x57d8f6){_0x57d8f6=_0x57d8f6||0x1f4;return function(_0x257d2a){logger[_0x5260('0x26')](_0x257d2a[_0x5260('0x27')]);if(_0x257d2a[_0x5260('0x28')]){delete _0x257d2a[_0x5260('0x28')];}_0x10f52a[_0x5260('0x18')](_0x57d8f6)[_0x5260('0x29')](_0x257d2a);};}exports[_0x5260('0x2a')]=function(_0x5b58f4,_0x3b3b13){var _0x2f3a03={},_0x492253={},_0x26dc73={'count':0x0,'rows':[]};var _0x2b61b0=db[_0x5260('0x2b')]['rawAttributes'];_0x492253['model']=_['keys'](_0x2b61b0);_0x492253[_0x5260('0x2c')]=_['keys'](_0x5b58f4['query']);_0x492253[_0x5260('0x2d')]=_[_0x5260('0x2e')](_0x492253[_0x5260('0x2f')],_0x492253[_0x5260('0x2c')]);_0x2f3a03[_0x5260('0x30')]=_['intersection'](_0x492253[_0x5260('0x2f')],qs[_0x5260('0x31')](_0x5b58f4[_0x5260('0x2c')][_0x5260('0x31')]));_0x2f3a03['attributes']=_0x2f3a03['attributes']['length']?_0x2f3a03[_0x5260('0x30')]:_0x492253['model'];if(!_0x5b58f4['query']['hasOwnProperty'](_0x5260('0x32'))){_0x2f3a03[_0x5260('0x1b')]=qs['limit'](_0x5b58f4['query'][_0x5260('0x1b')]);_0x2f3a03['offset']=qs[_0x5260('0x1a')](_0x5b58f4['query'][_0x5260('0x1a')]);}_0x2f3a03['order']=qs[_0x5260('0x33')](_0x5b58f4['query'][_0x5260('0x33')]);_0x2f3a03[_0x5260('0x34')]=qs[_0x5260('0x2d')](_[_0x5260('0x35')](_0x5b58f4[_0x5260('0x2c')],_0x492253[_0x5260('0x2d')]));if(_0x5b58f4[_0x5260('0x2c')]['filter']){_0x2f3a03['where']=_[_0x5260('0x36')](_0x2f3a03[_0x5260('0x34')],{'$or':_[_0x5260('0x37')](_0x2b61b0,function(_0x217466){if(_0x217466[_0x5260('0x38')]['key']!=='VIRTUAL'){var _0x3f3250={};_0x3f3250[_0x217466['field']]={'$like':'%'+_0x5b58f4[_0x5260('0x2c')][_0x5260('0x39')]+'%'};return _0x3f3250;}})});}_0x2f3a03=_['merge']({},_0x2f3a03,_0x5b58f4['options']);var _0x52cd18={'where':_0x2f3a03[_0x5260('0x34')]};return db['SquareMessage'][_0x5260('0x19')](_0x52cd18)[_0x5260('0x24')](function(_0x241067){_0x26dc73[_0x5260('0x19')]=_0x241067;if(_0x5b58f4[_0x5260('0x2c')][_0x5260('0x3a')]){_0x2f3a03[_0x5260('0x3b')]=[{'all':!![]}];}return db[_0x5260('0x2b')][_0x5260('0x3c')](_0x2f3a03);})[_0x5260('0x24')](function(_0x3cf8dd){_0x26dc73[_0x5260('0x3d')]=_0x3cf8dd;return _0x26dc73;})[_0x5260('0x24')](respondWithFilteredResult(_0x3b3b13,_0x2f3a03))[_0x5260('0x3e')](handleError(_0x3b3b13,null));};exports[_0x5260('0x3f')]=function(_0x4c89fb,_0x2c1493){var _0x2326dc={'raw':!![],'where':{'id':_0x4c89fb[_0x5260('0x40')]['id']}},_0x109af9={};_0x109af9[_0x5260('0x2f')]=_['keys'](db['SquareMessage']['rawAttributes']);_0x109af9[_0x5260('0x2c')]=_[_0x5260('0x41')](_0x4c89fb[_0x5260('0x2c')]);_0x109af9['filters']=_[_0x5260('0x2e')](_0x109af9[_0x5260('0x2f')],_0x109af9[_0x5260('0x2c')]);_0x2326dc[_0x5260('0x30')]=_[_0x5260('0x2e')](_0x109af9['model'],qs['fields'](_0x4c89fb[_0x5260('0x2c')][_0x5260('0x31')]));_0x2326dc['attributes']=_0x2326dc['attributes'][_0x5260('0x42')]?_0x2326dc[_0x5260('0x30')]:_0x109af9[_0x5260('0x2f')];if(_0x4c89fb['query'][_0x5260('0x3a')]){_0x2326dc['include']=[{'all':!![]}];}_0x2326dc=_['merge']({},_0x2326dc,_0x4c89fb['options']);return db[_0x5260('0x2b')][_0x5260('0x43')](_0x2326dc)[_0x5260('0x24')](handleEntityNotFound(_0x2c1493,null))[_0x5260('0x24')](respondWithResult(_0x2c1493,null))['catch'](handleError(_0x2c1493,null));};exports['create']=function(_0x9df75a,_0x3c1e1e){return db[_0x5260('0x2b')][_0x5260('0x44')](_0x9df75a[_0x5260('0x45')],{})[_0x5260('0x24')](respondWithResult(_0x3c1e1e,0xc9))['catch'](handleError(_0x3c1e1e,null));};exports[_0x5260('0x22')]=function(_0xf64a8b,_0x1a1d35){if(_0xf64a8b[_0x5260('0x45')]['id']){delete _0xf64a8b[_0x5260('0x45')]['id'];}return db[_0x5260('0x2b')][_0x5260('0x43')]({'where':{'id':_0xf64a8b[_0x5260('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a1d35,null))[_0x5260('0x24')](saveUpdates(_0xf64a8b[_0x5260('0x45')],null))[_0x5260('0x24')](respondWithResult(_0x1a1d35,null))['catch'](handleError(_0x1a1d35,null));};exports[_0x5260('0x23')]=function(_0xc5409e,_0x565a6e){return db[_0x5260('0x2b')][_0x5260('0x43')]({'where':{'id':_0xc5409e[_0x5260('0x40')]['id']}})['then'](handleEntityNotFound(_0x565a6e,null))['then'](removeEntity(_0x565a6e,null))[_0x5260('0x3e')](handleError(_0x565a6e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 66b8153..0e7ede1 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 _0x5a73=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x28bddc,_0x386002){var _0x4d6757=function(_0xc1b8e0){while(--_0xc1b8e0){_0x28bddc['push'](_0x28bddc['shift']());}};_0x4d6757(++_0x386002);}(_0x5a73,0x19c));var _0x35a7=function(_0x2e19a6,_0x1e4a33){_0x2e19a6=_0x2e19a6-0x0;var _0x37cd23=_0x5a73[_0x2e19a6];return _0x37cd23;};'use strict';var _=require(_0x35a7('0x0'));var util=require(_0x35a7('0x1'));var logger=require(_0x35a7('0x2'))('api');var moment=require(_0x35a7('0x3'));var BPromise=require(_0x35a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35a7('0x5'));var config=require(_0x35a7('0x6'));var attributes=require(_0x35a7('0x7'));module[_0x35a7('0x8')]=function(_0x4b81a0,_0x44e2d1){return _0x4b81a0[_0x35a7('0x9')](_0x35a7('0xa'),attributes,{'tableName':_0x35a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa65a=['exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5eeea3,_0x5cd230){var _0x20bb43=function(_0x265a91){while(--_0x265a91){_0x5eeea3['push'](_0x5eeea3['shift']());}};_0x20bb43(++_0x5cd230);}(_0xa65a,0x97));var _0xaa65=function(_0x3a00e0,_0x498b47){_0x3a00e0=_0x3a00e0-0x0;var _0x4f1e06=_0xa65a[_0x3a00e0];return _0x4f1e06;};'use strict';var _=require(_0xaa65('0x0'));var util=require('util');var logger=require(_0xaa65('0x1'))(_0xaa65('0x2'));var moment=require(_0xaa65('0x3'));var BPromise=require(_0xaa65('0x4'));var rp=require(_0xaa65('0x5'));var fs=require('fs');var path=require(_0xaa65('0x6'));var rimraf=require(_0xaa65('0x7'));var config=require(_0xaa65('0x8'));var attributes=require('./squareMessage.attributes');module[_0xaa65('0x9')]=function(_0x55350f,_0x39ccb4){return _0x55350f['define']('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 0e3e03b..e00a8b0 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 _0x16a2=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x417c49,_0x38059c){var _0x54b704=function(_0x322a85){while(--_0x322a85){_0x417c49['push'](_0x417c49['shift']());}};_0x54b704(++_0x38059c);}(_0x16a2,0x83));var _0x216a=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x16a2[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var moment=require(_0x216a('0x2'));var BPromise=require(_0x216a('0x3'));var rs=require(_0x216a('0x4'));var fs=require('fs');var Redis=require(_0x216a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x216a('0x6'));var logger=require(_0x216a('0x7'))('rpc');var config=require(_0x216a('0x8'));var jayson=require(_0x216a('0x9'));var client=jayson[_0x216a('0xa')][_0x216a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16361d,_0x524b49,_0x1202f6){return new BPromise(function(_0x217034,_0x3df27a){return client[_0x216a('0xc')](_0x16361d,_0x1202f6)['then'](function(_0x142ba0){logger[_0x216a('0xd')](_0x216a('0xe'),_0x524b49,_0x216a('0xf'));logger[_0x216a('0x10')](_0x216a('0x11'),_0x524b49,_0x216a('0xf'),JSON['stringify'](_0x142ba0));if(_0x142ba0[_0x216a('0x12')]){if(_0x142ba0[_0x216a('0x12')][_0x216a('0x13')]===0x1f4){logger[_0x216a('0x12')](_0x216a('0xe'),_0x524b49,_0x142ba0['error']['message']);return _0x3df27a(_0x142ba0[_0x216a('0x12')][_0x216a('0x14')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x524b49,_0x142ba0[_0x216a('0x12')][_0x216a('0x14')]);return _0x217034(_0x142ba0['error'][_0x216a('0x14')]);}else{logger['info'](_0x216a('0xe'),_0x524b49,_0x216a('0xf'));_0x217034(_0x142ba0[_0x216a('0x15')][_0x216a('0x14')]);}})[_0x216a('0x16')](function(_0xde4955){logger[_0x216a('0x12')](_0x216a('0xe'),_0x524b49,_0xde4955);_0x3df27a(_0xde4955);});});}exports[_0x216a('0x17')]=function(_0x3bec76){var _0x580b24=this;return new Promise(function(_0x241d6e,_0x2da589){return db[_0x216a('0x18')][_0x216a('0x19')](_0x3bec76[_0x216a('0x1a')],{'raw':_0x3bec76[_0x216a('0x1b')]?_0x3bec76[_0x216a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x216a('0x1c')](function(_0x59ab91){logger[_0x216a('0xd')]('CreateSquareMessage',_0x3bec76);logger[_0x216a('0x10')](_0x216a('0x17'),_0x3bec76,JSON['stringify'](_0x59ab91));_0x241d6e(_0x59ab91);})[_0x216a('0x16')](function(_0x2abd9d){logger[_0x216a('0x12')]('CreateSquareMessage',_0x2abd9d[_0x216a('0x14')],_0x3bec76);_0x2da589(_0x580b24['error'](0x1f4,_0x2abd9d['message']));});});}; \ No newline at end of file +var _0x0b61=['catch','CreateSquareMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3d0bdc,_0x565310){var _0x4888ca=function(_0x49119c){while(--_0x49119c){_0x3d0bdc['push'](_0x3d0bdc['shift']());}};_0x4888ca(++_0x565310);}(_0x0b61,0x1d0));var _0x10b6=function(_0x3e0fab,_0x285e29){_0x3e0fab=_0x3e0fab-0x0;var _0x36cde8=_0x0b61[_0x3e0fab];return _0x36cde8;};'use strict';var _=require(_0x10b6('0x0'));var util=require(_0x10b6('0x1'));var moment=require(_0x10b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x10b6('0x3'));var fs=require('fs');var Redis=require(_0x10b6('0x4'));var db=require(_0x10b6('0x5'))['db'];var utils=require(_0x10b6('0x6'));var logger=require(_0x10b6('0x7'))(_0x10b6('0x8'));var config=require(_0x10b6('0x9'));var jayson=require(_0x10b6('0xa'));var client=jayson[_0x10b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d46a1,_0x5ada32,_0xc1eda0){return new BPromise(function(_0x1c1c7d,_0x5e44a5){return client[_0x10b6('0xc')](_0x3d46a1,_0xc1eda0)[_0x10b6('0xd')](function(_0x5432eb){logger['info'](_0x10b6('0xe'),_0x5ada32,_0x10b6('0xf'));logger[_0x10b6('0x10')](_0x10b6('0x11'),_0x5ada32,_0x10b6('0xf'),JSON[_0x10b6('0x12')](_0x5432eb));if(_0x5432eb['error']){if(_0x5432eb[_0x10b6('0x13')]['code']===0x1f4){logger[_0x10b6('0x13')]('SquareMessage,\x20%s,\x20%s',_0x5ada32,_0x5432eb['error'][_0x10b6('0x14')]);return _0x5e44a5(_0x5432eb[_0x10b6('0x13')][_0x10b6('0x14')]);}logger['error'](_0x10b6('0xe'),_0x5ada32,_0x5432eb[_0x10b6('0x13')]['message']);return _0x1c1c7d(_0x5432eb[_0x10b6('0x13')][_0x10b6('0x14')]);}else{logger[_0x10b6('0x15')](_0x10b6('0xe'),_0x5ada32,'request\x20sent');_0x1c1c7d(_0x5432eb['result'][_0x10b6('0x14')]);}})[_0x10b6('0x16')](function(_0x1e040d){logger[_0x10b6('0x13')]('SquareMessage,\x20%s,\x20%s',_0x5ada32,_0x1e040d);_0x5e44a5(_0x1e040d);});});}exports[_0x10b6('0x17')]=function(_0x4c025b){var _0x546e63=this;return new Promise(function(_0x5682d0,_0x219a9a){return db['SquareMessage']['create'](_0x4c025b[_0x10b6('0x18')],{'raw':_0x4c025b[_0x10b6('0x19')]?_0x4c025b['options'][_0x10b6('0x1a')]===undefined?!![]:![]:!![]})[_0x10b6('0xd')](function(_0x3afaf7){logger['info']('CreateSquareMessage',_0x4c025b);logger[_0x10b6('0x10')](_0x10b6('0x17'),_0x4c025b,JSON[_0x10b6('0x12')](_0x3afaf7));_0x5682d0(_0x3afaf7);})[_0x10b6('0x16')](function(_0x20f192){logger[_0x10b6('0x13')]('CreateSquareMessage',_0x20f192[_0x10b6('0x14')],_0x4c025b);_0x219a9a(_0x546e63['error'](0x1f4,_0x20f192['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a1f8eb4..7cbe1b3 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 _0xca56=['test','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','15s'];(function(_0x3a7933,_0xf6cdf8){var _0x5c5815=function(_0x51a6ca){while(--_0x51a6ca){_0x3a7933['push'](_0x3a7933['shift']());}};_0x5c5815(++_0xf6cdf8);}(_0xca56,0xee));var _0x6ca5=function(_0x48d05c,_0x3e5459){_0x48d05c=_0x48d05c-0x0;var _0x21cd3a=_0xca56[_0x48d05c];return _0x21cd3a;};'use strict';var multer=require(_0x6ca5('0x0'));var util=require(_0x6ca5('0x1'));var path=require(_0x6ca5('0x2'));var timeout=require(_0x6ca5('0x3'));var express=require(_0x6ca5('0x4'));var router=express[_0x6ca5('0x5')]();var auth=require(_0x6ca5('0x6'));var interaction=require(_0x6ca5('0x7'));var config=require(_0x6ca5('0x8'));var controller=require('./squareOdbc.controller');router[_0x6ca5('0x9')]('/',auth[_0x6ca5('0xa')](),controller[_0x6ca5('0xb')]);router[_0x6ca5('0x9')]('/:id',auth[_0x6ca5('0xa')](),controller[_0x6ca5('0xc')]);router['get']('/:id/test',auth[_0x6ca5('0xa')](),timeout(_0x6ca5('0xd')),controller[_0x6ca5('0xe')]);router[_0x6ca5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ca5('0x10')](_0x6ca5('0x11'),auth[_0x6ca5('0xa')](),controller[_0x6ca5('0x12')]);router[_0x6ca5('0x13')]('/:id',auth[_0x6ca5('0xa')](),controller['destroy']);module[_0x6ca5('0x14')]=router; \ No newline at end of file +var _0xb7fc=['Router','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','15s','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x37a06b,_0x340326){var _0x5d9300=function(_0x81df56){while(--_0x81df56){_0x37a06b['push'](_0x37a06b['shift']());}};_0x5d9300(++_0x340326);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0xb7fc[_0x95ac8b];return _0x5b0792;};'use strict';var multer=require(_0xcb7f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb7f('0x1'));var express=require(_0xcb7f('0x2'));var router=express[_0xcb7f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb7f('0x4'));var controller=require(_0xcb7f('0x5'));router[_0xcb7f('0x6')]('/',auth[_0xcb7f('0x7')](),controller[_0xcb7f('0x8')]);router[_0xcb7f('0x6')]('/:id',auth[_0xcb7f('0x7')](),controller[_0xcb7f('0x9')]);router[_0xcb7f('0x6')]('/:id/test',auth[_0xcb7f('0x7')](),timeout(_0xcb7f('0xa')),controller['test']);router[_0xcb7f('0xb')]('/',auth[_0xcb7f('0x7')](),controller['create']);router[_0xcb7f('0xc')](_0xcb7f('0xd'),auth[_0xcb7f('0x7')](),controller[_0xcb7f('0xe')]);router[_0xcb7f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcb7f('0x10')]);module[_0xcb7f('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index db2cab9..8ec8d37 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 _0xe34c=['name','sequelize','exports','STRING'];(function(_0x15ec84,_0x4e3947){var _0x5f476e=function(_0x4bd083){while(--_0x4bd083){_0x15ec84['push'](_0x15ec84['shift']());}};_0x5f476e(++_0x4e3947);}(_0xe34c,0x121));var _0xce34=function(_0x57d194,_0x43c173){_0x57d194=_0x57d194-0x0;var _0x224a92=_0xe34c[_0x57d194];return _0x224a92;};'use strict';var Sequelize=require(_0xce34('0x0'));module[_0xce34('0x1')]={'name':{'type':Sequelize[_0xce34('0x2')],'unique':_0xce34('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xce34('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeb4c=['sequelize','STRING'];(function(_0x3ddb2,_0x386ec3){var _0x41cc1f=function(_0x13e620){while(--_0x13e620){_0x3ddb2['push'](_0x3ddb2['shift']());}};_0x41cc1f(++_0x386ec3);}(_0xeb4c,0x1b2));var _0xceb4=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xeb4c[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xceb4('0x0'));module['exports']={'name':{'type':Sequelize[_0xceb4('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xceb4('0x1')]},'description':{'type':Sequelize[_0xceb4('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 9c5830c..2ba4b06 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 _0xc6f2=['count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','stack','index','SquareOdbc','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','closeSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json'];(function(_0x54e83f,_0x4977f7){var _0x1bfd30=function(_0x50d170){while(--_0x50d170){_0x54e83f['push'](_0x54e83f['shift']());}};_0x1bfd30(++_0x4977f7);}(_0xc6f2,0xdd));var _0x2c6f=function(_0x10b6d1,_0x1244dd){_0x10b6d1=_0x10b6d1-0x0;var _0x11c1f4=_0xc6f2[_0x10b6d1];return _0x11c1f4;};'use strict';var pdf=require(_0x2c6f('0x0'));var emlformat=require(_0x2c6f('0x1'));var rimraf=require(_0x2c6f('0x2'));var zipdir=require(_0x2c6f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c6f('0x4'));var moment=require('moment');var BPromise=require(_0x2c6f('0x5'));var Mustache=require('mustache');var util=require(_0x2c6f('0x6'));var path=require('path');var sox=require(_0x2c6f('0x7'));var csv=require(_0x2c6f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2c6f('0x9'));var crypto=require('crypto');var jsforce=require(_0x2c6f('0xa'));var deskjs=require(_0x2c6f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c6f('0xc'));var Redis=require(_0x2c6f('0xd'));var authService=require(_0x2c6f('0xe'));var qs=require(_0x2c6f('0xf'));var hardwareService=require(_0x2c6f('0x10'));var logger=require(_0x2c6f('0x11'))(_0x2c6f('0x12'));var utils=require(_0x2c6f('0x13'));var config=require(_0x2c6f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d784,_0x20aa54){_0x20aa54=_0x20aa54||0xcc;return function(_0x4b39e8){if(_0x4b39e8){return _0x29d784[_0x2c6f('0x15')](_0x20aa54);}return _0x29d784['status'](_0x20aa54)[_0x2c6f('0x16')]();};}function respondWithResult(_0x17fdd2,_0x92cccb){_0x92cccb=_0x92cccb||0xc8;return function(_0x419e94){if(_0x419e94){return _0x17fdd2[_0x2c6f('0x17')](_0x92cccb)[_0x2c6f('0x18')](_0x419e94);}};}function respondWithFilteredResult(_0x442ce4,_0x4e9497){return function(_0x4aa22a){if(_0x4aa22a){var _0x540f2c=_0x4aa22a[_0x2c6f('0x19')],_0x3c78bf=_0x4e9497[_0x2c6f('0x1a')],_0x24fb0d=_0x4e9497[_0x2c6f('0x1a')]+_0x4e9497['limit'],_0x3e381d;if(_0x24fb0d>=_0x540f2c){_0x24fb0d=_0x540f2c;_0x3e381d=0xc8;}else{_0x3e381d=0xce;}_0x442ce4[_0x2c6f('0x17')](_0x3e381d);return _0x442ce4[_0x2c6f('0x1b')](_0x2c6f('0x1c'),_0x3c78bf+'-'+_0x24fb0d+'/'+_0x540f2c)[_0x2c6f('0x18')](_0x4aa22a);}return null;};}function patchUpdates(_0x2e05d8){return function(_0x3b298b){try{jsonpatch['apply'](_0x3b298b,_0x2e05d8,!![]);}catch(_0x4337db){return BPromise[_0x2c6f('0x1d')](_0x4337db);}return _0x3b298b[_0x2c6f('0x1e')]();};}function saveUpdates(_0x876134,_0x133f95){return function(_0xa5357b){if(_0xa5357b){return _0xa5357b[_0x2c6f('0x1f')](_0x876134)[_0x2c6f('0x20')](function(_0x33d241){return _0x33d241;});}return null;};}function removeEntity(_0xae0faf,_0x3485d1){return function(_0x52ce97){if(_0x52ce97){return _0x52ce97[_0x2c6f('0x21')]()[_0x2c6f('0x20')](function(){var _0x148526=_0x52ce97[_0x2c6f('0x22')]({'plain':!![]});var _0x425e57='ODBC';return db[_0x2c6f('0x23')][_0x2c6f('0x21')]({'where':{'type':_0x425e57,'resourceId':_0x148526['id']}})[_0x2c6f('0x20')](function(){return _0x52ce97;});})[_0x2c6f('0x20')](function(){_0xae0faf[_0x2c6f('0x17')](0xcc)[_0x2c6f('0x16')]();});}};}function handleEntityNotFound(_0x4c7cd7,_0x14f80a){return function(_0x44a403){if(!_0x44a403){_0x4c7cd7[_0x2c6f('0x15')](0x194);}return _0x44a403;};}function handleError(_0x5d35d5,_0x528530){_0x528530=_0x528530||0x1f4;return function(_0x2db40b){logger['error'](_0x2db40b[_0x2c6f('0x24')]);if(_0x2db40b['name']){delete _0x2db40b['name'];}_0x5d35d5[_0x2c6f('0x17')](_0x528530)['send'](_0x2db40b);};}exports[_0x2c6f('0x25')]=function(_0x43848f,_0x170333){var _0x591198={},_0xa36aea={},_0x527cdd={'count':0x0,'rows':[]};var _0x1a9b9e=db[_0x2c6f('0x26')][_0x2c6f('0x27')];_0xa36aea[_0x2c6f('0x28')]=_[_0x2c6f('0x29')](_0x1a9b9e);_0xa36aea[_0x2c6f('0x2a')]=_[_0x2c6f('0x29')](_0x43848f[_0x2c6f('0x2a')]);_0xa36aea[_0x2c6f('0x2b')]=_['intersection'](_0xa36aea['model'],_0xa36aea[_0x2c6f('0x2a')]);_0x591198[_0x2c6f('0x2c')]=_[_0x2c6f('0x2d')](_0xa36aea[_0x2c6f('0x28')],qs[_0x2c6f('0x2e')](_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x2e')]));_0x591198[_0x2c6f('0x2c')]=_0x591198[_0x2c6f('0x2c')][_0x2c6f('0x2f')]?_0x591198[_0x2c6f('0x2c')]:_0xa36aea[_0x2c6f('0x28')];if(!_0x43848f[_0x2c6f('0x2a')]['hasOwnProperty']('nolimit')){_0x591198[_0x2c6f('0x30')]=qs[_0x2c6f('0x30')](_0x43848f['query'][_0x2c6f('0x30')]);_0x591198[_0x2c6f('0x1a')]=qs['offset'](_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x1a')]);}_0x591198[_0x2c6f('0x31')]=qs[_0x2c6f('0x32')](_0x43848f[_0x2c6f('0x2a')]['sort']);_0x591198[_0x2c6f('0x33')]=qs[_0x2c6f('0x2b')](_['pick'](_0x43848f[_0x2c6f('0x2a')],_0xa36aea[_0x2c6f('0x2b')]));if(_0x43848f['query'][_0x2c6f('0x34')]){_0x591198[_0x2c6f('0x33')]=_[_0x2c6f('0x35')](_0x591198[_0x2c6f('0x33')],{'$or':_[_0x2c6f('0x36')](_0x1a9b9e,function(_0x30417f){if(_0x30417f['type'][_0x2c6f('0x37')]!==_0x2c6f('0x38')){var _0x31ff99={};_0x31ff99[_0x30417f[_0x2c6f('0x39')]]={'$like':'%'+_0x43848f['query']['filter']+'%'};return _0x31ff99;}})});}_0x591198=_[_0x2c6f('0x35')]({},_0x591198,_0x43848f[_0x2c6f('0x3a')]);var _0x59acce={'where':_0x591198[_0x2c6f('0x33')]};return db[_0x2c6f('0x26')][_0x2c6f('0x19')](_0x59acce)[_0x2c6f('0x20')](function(_0x25b874){_0x527cdd[_0x2c6f('0x19')]=_0x25b874;if(_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x3b')]){_0x591198['include']=[{'all':!![]}];}return db[_0x2c6f('0x26')][_0x2c6f('0x3c')](_0x591198);})[_0x2c6f('0x20')](function(_0x16383c){_0x527cdd['rows']=_0x16383c;return _0x527cdd;})['then'](respondWithFilteredResult(_0x170333,_0x591198))[_0x2c6f('0x3d')](handleError(_0x170333,null));};exports[_0x2c6f('0x3e')]=function(_0x37c06e,_0x1bee8e){var _0xb40948={'raw':!![],'where':{'id':_0x37c06e['params']['id']}},_0x5ecee0={};_0x5ecee0[_0x2c6f('0x28')]=_['keys'](db['SquareOdbc']['rawAttributes']);_0x5ecee0['query']=_[_0x2c6f('0x29')](_0x37c06e[_0x2c6f('0x2a')]);_0x5ecee0[_0x2c6f('0x2b')]=_['intersection'](_0x5ecee0[_0x2c6f('0x28')],_0x5ecee0[_0x2c6f('0x2a')]);_0xb40948['attributes']=_[_0x2c6f('0x2d')](_0x5ecee0[_0x2c6f('0x28')],qs[_0x2c6f('0x2e')](_0x37c06e[_0x2c6f('0x2a')][_0x2c6f('0x2e')]));_0xb40948['attributes']=_0xb40948['attributes'][_0x2c6f('0x2f')]?_0xb40948[_0x2c6f('0x2c')]:_0x5ecee0[_0x2c6f('0x28')];if(_0x37c06e[_0x2c6f('0x2a')][_0x2c6f('0x3b')]){_0xb40948[_0x2c6f('0x3f')]=[{'all':!![]}];}_0xb40948=_[_0x2c6f('0x35')]({},_0xb40948,_0x37c06e['options']);return db[_0x2c6f('0x26')][_0x2c6f('0x40')](_0xb40948)['then'](handleEntityNotFound(_0x1bee8e,null))[_0x2c6f('0x20')](respondWithResult(_0x1bee8e,null))[_0x2c6f('0x3d')](handleError(_0x1bee8e,null));};exports[_0x2c6f('0x41')]=function(_0x4c6d07,_0x31eff5){return db[_0x2c6f('0x26')]['create'](_0x4c6d07[_0x2c6f('0x42')],{})[_0x2c6f('0x20')](function(_0x14966b){var _0x2efab5=_0x4c6d07[_0x2c6f('0x43')][_0x2c6f('0x22')]({'plain':!![]});if(!_0x2efab5)throw new Error(_0x2c6f('0x44'));if(_0x2efab5[_0x2c6f('0x45')]===_0x2c6f('0x43')){var _0x598a6b=_0x14966b[_0x2c6f('0x22')]({'plain':!![]});var _0x30e1cd=_0x2c6f('0x46');return db[_0x2c6f('0x47')][_0x2c6f('0x40')]({'where':{'name':_0x30e1cd,'userProfileId':_0x2efab5[_0x2c6f('0x48')]},'raw':!![]})[_0x2c6f('0x20')](function(_0x55caeb){if(_0x55caeb&&_0x55caeb[_0x2c6f('0x49')]===0x0){return db[_0x2c6f('0x23')][_0x2c6f('0x41')]({'name':_0x598a6b[_0x2c6f('0x4a')],'resourceId':_0x598a6b['id'],'type':_0x55caeb[_0x2c6f('0x4a')],'sectionId':_0x55caeb['id']},{})[_0x2c6f('0x20')](function(){return _0x14966b;});}else{return _0x14966b;}})[_0x2c6f('0x3d')](function(_0x549d1){logger[_0x2c6f('0x4b')](_0x2c6f('0x4c'),_0x549d1);throw _0x549d1;});}return _0x14966b;})[_0x2c6f('0x20')](respondWithResult(_0x31eff5,0xc9))[_0x2c6f('0x3d')](handleError(_0x31eff5,null));};exports['update']=function(_0x453cc9,_0x1b770b){if(_0x453cc9[_0x2c6f('0x42')]['id']){delete _0x453cc9[_0x2c6f('0x42')]['id'];}return db['SquareOdbc'][_0x2c6f('0x40')]({'where':{'id':_0x453cc9[_0x2c6f('0x4d')]['id']}})[_0x2c6f('0x20')](handleEntityNotFound(_0x1b770b,null))[_0x2c6f('0x20')](saveUpdates(_0x453cc9[_0x2c6f('0x42')],null))[_0x2c6f('0x20')](respondWithResult(_0x1b770b,null))[_0x2c6f('0x3d')](handleError(_0x1b770b,null));};exports['destroy']=function(_0x48d5ac,_0x13249b){return db[_0x2c6f('0x26')][_0x2c6f('0x40')]({'where':{'id':_0x48d5ac[_0x2c6f('0x4d')]['id']}})[_0x2c6f('0x20')](handleEntityNotFound(_0x13249b,null))['then'](removeEntity(_0x13249b,null))[_0x2c6f('0x3d')](handleError(_0x13249b,null));};exports[_0x2c6f('0x4e')]=function(_0x18efff,_0x245ce2,_0x27ef5e){var _0x1d8924;return db[_0x2c6f('0x26')][_0x2c6f('0x40')]({'where':{'id':_0x18efff[_0x2c6f('0x4d')]['id']},'attributes':['id',_0x2c6f('0x4f')]})['then'](handleEntityNotFound(_0x245ce2,null))['then'](function(_0x216192){if(_0x216192){var _0x627497=require(_0x2c6f('0x50'))();_0x627497['openSync'](_0x216192[_0x2c6f('0x4f')]);_0x627497[_0x2c6f('0x51')]();return _0x216192;}})[_0x2c6f('0x20')](respondWithResult(_0x245ce2,null))[_0x2c6f('0x3d')](handleError(_0x245ce2,null));}; \ No newline at end of file +var _0x1156=['index','SquareOdbc','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','dsn','odbc','openSync','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','end','error','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1156,0x181));var _0x6115=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1156[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require(_0x6115('0x0'));var emlformat=require(_0x6115('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6115('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6115('0x3'));var moment=require(_0x6115('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6115('0x5'));var util=require('util');var path=require(_0x6115('0x6'));var sox=require(_0x6115('0x7'));var csv=require(_0x6115('0x8'));var ejs=require(_0x6115('0x9'));var fs=require('fs');var _=require(_0x6115('0xa'));var squel=require(_0x6115('0xb'));var crypto=require(_0x6115('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6115('0xd'));var toCsv=require(_0x6115('0x8'));var querystring=require(_0x6115('0xe'));var Papa=require(_0x6115('0xf'));var Redis=require(_0x6115('0x10'));var authService=require(_0x6115('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6115('0x12'));var logger=require(_0x6115('0x13'))('api');var utils=require(_0x6115('0x14'));var config=require(_0x6115('0x15'));var db=require(_0x6115('0x16'))['db'];function respondWithStatusCode(_0xa5fb38,_0x13a616){_0x13a616=_0x13a616||0xcc;return function(_0x2a1034){if(_0x2a1034){return _0xa5fb38[_0x6115('0x17')](_0x13a616);}return _0xa5fb38[_0x6115('0x18')](_0x13a616)['end']();};}function respondWithResult(_0x55fb1a,_0x2547f9){_0x2547f9=_0x2547f9||0xc8;return function(_0x5e95af){if(_0x5e95af){return _0x55fb1a[_0x6115('0x18')](_0x2547f9)['json'](_0x5e95af);}};}function respondWithFilteredResult(_0x4a54e1,_0x410899){return function(_0x9b9b01){if(_0x9b9b01){var _0x585edc=_0x9b9b01[_0x6115('0x19')],_0x26b237=_0x410899[_0x6115('0x1a')],_0x878f6=_0x410899['offset']+_0x410899['limit'],_0x138f8d;if(_0x878f6>=_0x585edc){_0x878f6=_0x585edc;_0x138f8d=0xc8;}else{_0x138f8d=0xce;}_0x4a54e1[_0x6115('0x18')](_0x138f8d);return _0x4a54e1['set'](_0x6115('0x1b'),_0x26b237+'-'+_0x878f6+'/'+_0x585edc)[_0x6115('0x1c')](_0x9b9b01);}return null;};}function patchUpdates(_0x5d8089){return function(_0x455f9f){try{jsonpatch[_0x6115('0x1d')](_0x455f9f,_0x5d8089,!![]);}catch(_0x1581cd){return BPromise[_0x6115('0x1e')](_0x1581cd);}return _0x455f9f[_0x6115('0x1f')]();};}function saveUpdates(_0x3e1a70,_0x39cbe6){return function(_0x1e8869){if(_0x1e8869){return _0x1e8869['update'](_0x3e1a70)[_0x6115('0x20')](function(_0x2e9c15){return _0x2e9c15;});}return null;};}function removeEntity(_0x4e30f1,_0x48a88f){return function(_0x44e968){if(_0x44e968){return _0x44e968['destroy']()[_0x6115('0x20')](function(){var _0x2b0673=_0x44e968[_0x6115('0x21')]({'plain':!![]});var _0x35da55=_0x6115('0x22');return db[_0x6115('0x23')][_0x6115('0x24')]({'where':{'type':_0x35da55,'resourceId':_0x2b0673['id']}})['then'](function(){return _0x44e968;});})[_0x6115('0x20')](function(){_0x4e30f1[_0x6115('0x18')](0xcc)[_0x6115('0x25')]();});}};}function handleEntityNotFound(_0x44658e,_0x36f681){return function(_0x506ec3){if(!_0x506ec3){_0x44658e[_0x6115('0x17')](0x194);}return _0x506ec3;};}function handleError(_0x348a55,_0x3f361b){_0x3f361b=_0x3f361b||0x1f4;return function(_0x4a9c29){logger[_0x6115('0x26')](_0x4a9c29['stack']);if(_0x4a9c29[_0x6115('0x27')]){delete _0x4a9c29[_0x6115('0x27')];}_0x348a55[_0x6115('0x18')](_0x3f361b)['send'](_0x4a9c29);};}exports[_0x6115('0x28')]=function(_0x31611c,_0x1b95c3){var _0x498464={},_0x3670b9={},_0x3e825f={'count':0x0,'rows':[]};var _0x14422d=db[_0x6115('0x29')]['rawAttributes'];_0x3670b9['model']=_[_0x6115('0x2a')](_0x14422d);_0x3670b9[_0x6115('0x2b')]=_[_0x6115('0x2a')](_0x31611c[_0x6115('0x2b')]);_0x3670b9[_0x6115('0x2c')]=_[_0x6115('0x2d')](_0x3670b9[_0x6115('0x2e')],_0x3670b9[_0x6115('0x2b')]);_0x498464[_0x6115('0x2f')]=_['intersection'](_0x3670b9[_0x6115('0x2e')],qs[_0x6115('0x30')](_0x31611c['query'][_0x6115('0x30')]));_0x498464[_0x6115('0x2f')]=_0x498464[_0x6115('0x2f')][_0x6115('0x31')]?_0x498464[_0x6115('0x2f')]:_0x3670b9[_0x6115('0x2e')];if(!_0x31611c[_0x6115('0x2b')]['hasOwnProperty'](_0x6115('0x32'))){_0x498464['limit']=qs[_0x6115('0x33')](_0x31611c[_0x6115('0x2b')][_0x6115('0x33')]);_0x498464['offset']=qs[_0x6115('0x1a')](_0x31611c[_0x6115('0x2b')][_0x6115('0x1a')]);}_0x498464[_0x6115('0x34')]=qs[_0x6115('0x35')](_0x31611c[_0x6115('0x2b')]['sort']);_0x498464['where']=qs['filters'](_[_0x6115('0x36')](_0x31611c[_0x6115('0x2b')],_0x3670b9['filters']));if(_0x31611c[_0x6115('0x2b')]['filter']){_0x498464[_0x6115('0x37')]=_[_0x6115('0x38')](_0x498464['where'],{'$or':_[_0x6115('0x39')](_0x14422d,function(_0x1a6816){if(_0x1a6816[_0x6115('0x3a')][_0x6115('0x3b')]!==_0x6115('0x3c')){var _0x1437b2={};_0x1437b2[_0x1a6816[_0x6115('0x3d')]]={'$like':'%'+_0x31611c[_0x6115('0x2b')][_0x6115('0x3e')]+'%'};return _0x1437b2;}})});}_0x498464=_[_0x6115('0x38')]({},_0x498464,_0x31611c[_0x6115('0x3f')]);var _0x127b61={'where':_0x498464[_0x6115('0x37')]};return db[_0x6115('0x29')]['count'](_0x127b61)[_0x6115('0x20')](function(_0x2412ab){_0x3e825f[_0x6115('0x19')]=_0x2412ab;if(_0x31611c[_0x6115('0x2b')]['includeAll']){_0x498464['include']=[{'all':!![]}];}return db[_0x6115('0x29')][_0x6115('0x40')](_0x498464);})[_0x6115('0x20')](function(_0x3ecbdb){_0x3e825f[_0x6115('0x41')]=_0x3ecbdb;return _0x3e825f;})[_0x6115('0x20')](respondWithFilteredResult(_0x1b95c3,_0x498464))[_0x6115('0x42')](handleError(_0x1b95c3,null));};exports[_0x6115('0x43')]=function(_0x269625,_0x55a6b3){var _0x19cd51={'raw':!![],'where':{'id':_0x269625[_0x6115('0x44')]['id']}},_0x18753a={};_0x18753a[_0x6115('0x2e')]=_[_0x6115('0x2a')](db[_0x6115('0x29')][_0x6115('0x45')]);_0x18753a[_0x6115('0x2b')]=_[_0x6115('0x2a')](_0x269625[_0x6115('0x2b')]);_0x18753a[_0x6115('0x2c')]=_[_0x6115('0x2d')](_0x18753a[_0x6115('0x2e')],_0x18753a[_0x6115('0x2b')]);_0x19cd51[_0x6115('0x2f')]=_[_0x6115('0x2d')](_0x18753a[_0x6115('0x2e')],qs[_0x6115('0x30')](_0x269625[_0x6115('0x2b')]['fields']));_0x19cd51[_0x6115('0x2f')]=_0x19cd51['attributes']['length']?_0x19cd51[_0x6115('0x2f')]:_0x18753a[_0x6115('0x2e')];if(_0x269625[_0x6115('0x2b')][_0x6115('0x46')]){_0x19cd51[_0x6115('0x47')]=[{'all':!![]}];}_0x19cd51=_[_0x6115('0x38')]({},_0x19cd51,_0x269625['options']);return db[_0x6115('0x29')][_0x6115('0x48')](_0x19cd51)[_0x6115('0x20')](handleEntityNotFound(_0x55a6b3,null))[_0x6115('0x20')](respondWithResult(_0x55a6b3,null))[_0x6115('0x42')](handleError(_0x55a6b3,null));};exports[_0x6115('0x49')]=function(_0x49d4d3,_0x30f199){return db[_0x6115('0x29')][_0x6115('0x49')](_0x49d4d3['body'],{})[_0x6115('0x20')](function(_0x48a946){var _0xe7eeca=_0x49d4d3[_0x6115('0x4a')][_0x6115('0x21')]({'plain':!![]});if(!_0xe7eeca)throw new Error(_0x6115('0x4b'));if(_0xe7eeca[_0x6115('0x4c')]===_0x6115('0x4a')){var _0x458d08=_0x48a946['get']({'plain':!![]});var _0x2dfff8=_0x6115('0x22');return db[_0x6115('0x4d')][_0x6115('0x48')]({'where':{'name':_0x2dfff8,'userProfileId':_0xe7eeca['userProfileId']},'raw':!![]})[_0x6115('0x20')](function(_0x58cc59){if(_0x58cc59&&_0x58cc59[_0x6115('0x4e')]===0x0){return db['UserProfileResource'][_0x6115('0x49')]({'name':_0x458d08[_0x6115('0x27')],'resourceId':_0x458d08['id'],'type':_0x58cc59[_0x6115('0x27')],'sectionId':_0x58cc59['id']},{})[_0x6115('0x20')](function(){return _0x48a946;});}else{return _0x48a946;}})[_0x6115('0x42')](function(_0x2e01a8){logger[_0x6115('0x26')](_0x6115('0x4f'),_0x2e01a8);throw _0x2e01a8;});}return _0x48a946;})['then'](respondWithResult(_0x30f199,0xc9))[_0x6115('0x42')](handleError(_0x30f199,null));};exports[_0x6115('0x50')]=function(_0x1b05cd,_0x5901d2){if(_0x1b05cd[_0x6115('0x51')]['id']){delete _0x1b05cd[_0x6115('0x51')]['id'];}return db[_0x6115('0x29')][_0x6115('0x48')]({'where':{'id':_0x1b05cd[_0x6115('0x44')]['id']}})[_0x6115('0x20')](handleEntityNotFound(_0x5901d2,null))[_0x6115('0x20')](saveUpdates(_0x1b05cd['body'],null))[_0x6115('0x20')](respondWithResult(_0x5901d2,null))[_0x6115('0x42')](handleError(_0x5901d2,null));};exports[_0x6115('0x24')]=function(_0x3efbba,_0x2c261a){return db[_0x6115('0x29')][_0x6115('0x48')]({'where':{'id':_0x3efbba[_0x6115('0x44')]['id']}})[_0x6115('0x20')](handleEntityNotFound(_0x2c261a,null))[_0x6115('0x20')](removeEntity(_0x2c261a,null))[_0x6115('0x42')](handleError(_0x2c261a,null));};exports['test']=function(_0x21a1d5,_0x47e06b,_0x4e5bc5){var _0xd594d1;return db['SquareOdbc']['find']({'where':{'id':_0x21a1d5[_0x6115('0x44')]['id']},'attributes':['id',_0x6115('0x52')]})[_0x6115('0x20')](handleEntityNotFound(_0x47e06b,null))['then'](function(_0x1d8c30){if(_0x1d8c30){var _0x315d24=require(_0x6115('0x53'))();_0x315d24[_0x6115('0x54')](_0x1d8c30[_0x6115('0x52')]);_0x315d24['closeSync']();return _0x1d8c30;}})['then'](respondWithResult(_0x47e06b,null))[_0x6115('0x42')](handleError(_0x47e06b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6e1927a..580942c 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 _0x1966=['define','SquareOdbc','square_odbc','lodash','util','../../config/logger','request-promise','path','./squareOdbc.attributes','exports'];(function(_0x3a2225,_0xb6600){var _0x5c8040=function(_0x2bdb09){while(--_0x2bdb09){_0x3a2225['push'](_0x3a2225['shift']());}};_0x5c8040(++_0xb6600);}(_0x1966,0x1a7));var _0x6196=function(_0x5eed81,_0x131d60){_0x5eed81=_0x5eed81-0x0;var _0x50b1cf=_0x1966[_0x5eed81];return _0x50b1cf;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var logger=require(_0x6196('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6196('0x3'));var fs=require('fs');var path=require(_0x6196('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6196('0x5'));module[_0x6196('0x6')]=function(_0x36efd9,_0x509e0d){return _0x36efd9[_0x6196('0x7')](_0x6196('0x8'),attributes,{'tableName':_0x6196('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef83=['SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0xef83,0x8e));var _0x3ef8=function(_0x23cfaf,_0x1d8545){_0x23cfaf=_0x23cfaf-0x0;var _0xf8af44=_0xef83[_0x23cfaf];return _0xf8af44;};'use strict';var _=require(_0x3ef8('0x0'));var util=require(_0x3ef8('0x1'));var logger=require('../../config/logger')(_0x3ef8('0x2'));var moment=require(_0x3ef8('0x3'));var BPromise=require(_0x3ef8('0x4'));var rp=require(_0x3ef8('0x5'));var fs=require('fs');var path=require(_0x3ef8('0x6'));var rimraf=require(_0x3ef8('0x7'));var config=require(_0x3ef8('0x8'));var attributes=require(_0x3ef8('0x9'));module[_0x3ef8('0xa')]=function(_0x4fc6ae,_0x323a95){return _0x4fc6ae[_0x3ef8('0xb')](_0x3ef8('0xc'),attributes,{'tableName':_0x3ef8('0xd'),'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 f29e609..06047b6 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 _0xcc47=['include','map','model','then','stringify','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes'];(function(_0x1e4134,_0x202371){var _0x57ea60=function(_0x475646){while(--_0x475646){_0x1e4134['push'](_0x1e4134['shift']());}};_0x57ea60(++_0x202371);}(_0xcc47,0x18b));var _0x7cc4=function(_0xf8dd1f,_0x5288ae){_0xf8dd1f=_0xf8dd1f-0x0;var _0x53993f=_0xcc47[_0xf8dd1f];return _0x53993f;};'use strict';var _=require(_0x7cc4('0x0'));var util=require('util');var moment=require(_0x7cc4('0x1'));var BPromise=require(_0x7cc4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7cc4('0x3'));var logger=require('../../config/logger')(_0x7cc4('0x4'));var config=require(_0x7cc4('0x5'));var jayson=require(_0x7cc4('0x6'));var client=jayson[_0x7cc4('0x7')][_0x7cc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x521841,_0x38d00d,_0x48390e){return new BPromise(function(_0x2b9d83,_0x94dc1e){return client[_0x7cc4('0x9')](_0x521841,_0x48390e)['then'](function(_0x36bfc0){logger['info'](_0x7cc4('0xa'),_0x38d00d,_0x7cc4('0xb'));logger[_0x7cc4('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x38d00d,'request\x20sent',JSON['stringify'](_0x36bfc0));if(_0x36bfc0['error']){if(_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xe')]===0x1f4){logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xf')]);return _0x94dc1e(_0x36bfc0[_0x7cc4('0xd')]['message']);}logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x36bfc0['error']['message']);return _0x2b9d83(_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xf')]);}else{logger[_0x7cc4('0x10')](_0x7cc4('0xa'),_0x38d00d,_0x7cc4('0xb'));_0x2b9d83(_0x36bfc0[_0x7cc4('0x11')][_0x7cc4('0xf')]);}})[_0x7cc4('0x12')](function(_0x555c5a){logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x555c5a);_0x94dc1e(_0x555c5a);});});}exports[_0x7cc4('0x13')]=function(_0x129fa9){var _0x233f37=this;return new Promise(function(_0x305a03,_0x3351f7){return db['SquareOdbc'][_0x7cc4('0x14')]({'raw':_0x129fa9['options']?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x16')]===undefined?!![]:![]:!![],'where':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x17')]||null:null,'attributes':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x18')]||null:null,'include':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x19')]?_[_0x7cc4('0x1a')](_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x19')],function(_0x3f37a2){return{'model':db[_0x3f37a2[_0x7cc4('0x1b')]],'as':_0x3f37a2['as'],'attributes':_0x3f37a2[_0x7cc4('0x18')],'include':_0x3f37a2[_0x7cc4('0x19')]?_[_0x7cc4('0x1a')](_0x3f37a2[_0x7cc4('0x19')],function(_0x226407){return{'model':db[_0x226407[_0x7cc4('0x1b')]],'as':_0x226407['as'],'attributes':_0x226407[_0x7cc4('0x18')],'include':_0x226407['include']?_[_0x7cc4('0x1a')](_0x226407['include'],function(_0x292aaa){return{'model':db[_0x292aaa[_0x7cc4('0x1b')]],'as':_0x292aaa['as'],'attributes':_0x292aaa[_0x7cc4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7cc4('0x1c')](function(_0x3184b6){logger[_0x7cc4('0x10')](_0x7cc4('0x13'),_0x129fa9);logger[_0x7cc4('0xc')](_0x7cc4('0x13'),_0x129fa9,JSON[_0x7cc4('0x1d')](_0x3184b6));_0x305a03(_0x3184b6);})['catch'](function(_0x2b683c){logger[_0x7cc4('0xd')](_0x7cc4('0x13'),_0x2b683c[_0x7cc4('0xf')],_0x129fa9);_0x3351f7(_0x233f37[_0x7cc4('0xd')](0x1f4,_0x2b683c[_0x7cc4('0xf')]));});});}; \ No newline at end of file +var _0xecc1=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','include','map','attributes','model','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x305da3,_0x4e4517){var _0x9a0b13=function(_0x2ca0e8){while(--_0x2ca0e8){_0x305da3['push'](_0x305da3['shift']());}};_0x9a0b13(++_0x4e4517);}(_0xecc1,0x129));var _0x1ecc=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xecc1[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0x1ecc('0x0'));var util=require('util');var moment=require(_0x1ecc('0x1'));var BPromise=require(_0x1ecc('0x2'));var rs=require(_0x1ecc('0x3'));var fs=require('fs');var Redis=require(_0x1ecc('0x4'));var db=require(_0x1ecc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ecc('0x6'))(_0x1ecc('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ecc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25136e,_0x288756,_0x9cbcb3){return new BPromise(function(_0x20ab19,_0xdd040d){return client['request'](_0x25136e,_0x9cbcb3)['then'](function(_0x1db777){logger[_0x1ecc('0x9')](_0x1ecc('0xa'),_0x288756,_0x1ecc('0xb'));logger[_0x1ecc('0xc')](_0x1ecc('0xd'),_0x288756,_0x1ecc('0xb'),JSON['stringify'](_0x1db777));if(_0x1db777[_0x1ecc('0xe')]){if(_0x1db777[_0x1ecc('0xe')]['code']===0x1f4){logger['error'](_0x1ecc('0xa'),_0x288756,_0x1db777[_0x1ecc('0xe')]['message']);return _0xdd040d(_0x1db777[_0x1ecc('0xe')][_0x1ecc('0xf')]);}logger[_0x1ecc('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x288756,_0x1db777['error'][_0x1ecc('0xf')]);return _0x20ab19(_0x1db777['error'][_0x1ecc('0xf')]);}else{logger[_0x1ecc('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x288756,_0x1ecc('0xb'));_0x20ab19(_0x1db777[_0x1ecc('0x10')]['message']);}})['catch'](function(_0x33d8b4){logger[_0x1ecc('0xe')](_0x1ecc('0xa'),_0x288756,_0x33d8b4);_0xdd040d(_0x33d8b4);});});}exports[_0x1ecc('0x11')]=function(_0x3803f0){var _0x504d07=this;return new Promise(function(_0x5a6d64,_0xfa6b52){return db[_0x1ecc('0x12')][_0x1ecc('0x13')]({'raw':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3803f0['options']?_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x15')]||null:null,'attributes':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0[_0x1ecc('0x14')]['attributes']||null:null,'include':_0x3803f0[_0x1ecc('0x14')]?_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x16')]?_[_0x1ecc('0x17')](_0x3803f0[_0x1ecc('0x14')][_0x1ecc('0x16')],function(_0x4e9459){return{'model':db[_0x4e9459['model']],'as':_0x4e9459['as'],'attributes':_0x4e9459[_0x1ecc('0x18')],'include':_0x4e9459['include']?_['map'](_0x4e9459['include'],function(_0x2ec80e){return{'model':db[_0x2ec80e[_0x1ecc('0x19')]],'as':_0x2ec80e['as'],'attributes':_0x2ec80e[_0x1ecc('0x18')],'include':_0x2ec80e[_0x1ecc('0x16')]?_[_0x1ecc('0x17')](_0x2ec80e['include'],function(_0x30e7a6){return{'model':db[_0x30e7a6[_0x1ecc('0x19')]],'as':_0x30e7a6['as'],'attributes':_0x30e7a6[_0x1ecc('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x556d88){logger['info']('ShowSquareOdbc',_0x3803f0);logger[_0x1ecc('0xc')]('ShowSquareOdbc',_0x3803f0,JSON[_0x1ecc('0x1a')](_0x556d88));_0x5a6d64(_0x556d88);})[_0x1ecc('0x1b')](function(_0x570194){logger[_0x1ecc('0xe')]('ShowSquareOdbc',_0x570194['message'],_0x3803f0);_0xfa6b52(_0x504d07['error'](0x1f4,_0x570194['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 35da973..c29a1da 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 _0x7144=['show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0x7144,0x129));var _0x4714=function(_0x5979b7,_0x4326a7){_0x5979b7=_0x5979b7-0x0;var _0x4d85c9=_0x7144[_0x5979b7];return _0x4d85c9;};'use strict';var multer=require(_0x4714('0x0'));var util=require(_0x4714('0x1'));var path=require(_0x4714('0x2'));var timeout=require('connect-timeout');var express=require(_0x4714('0x3'));var router=express['Router']();var auth=require(_0x4714('0x4'));var interaction=require(_0x4714('0x5'));var config=require(_0x4714('0x6'));var controller=require(_0x4714('0x7'));router[_0x4714('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4714('0x8')](_0x4714('0x9'),auth[_0x4714('0xa')](),controller[_0x4714('0xb')]);router[_0x4714('0x8')](_0x4714('0xc'),auth['isAuthenticated'](),controller[_0x4714('0xd')]);router[_0x4714('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4714('0xe')](_0x4714('0xc'),auth[_0x4714('0xa')](),controller[_0x4714('0xf')]);router[_0x4714('0x10')]('/:id',auth[_0x4714('0xa')](),controller[_0x4714('0x11')]);router[_0x4714('0x12')](_0x4714('0x9'),auth['isAuthenticated'](),controller[_0x4714('0x13')]);router[_0x4714('0x12')](_0x4714('0xc'),auth[_0x4714('0xa')](),controller[_0x4714('0x14')]);module[_0x4714('0x15')]=router; \ No newline at end of file +var _0x8e9f=['/:id/users','getUsers','post','create','addUsers','put','update','/:id','destroy','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8e9f,0x170));var _0xf8e9=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x8e9f[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0xf8e9('0x0'));var util=require(_0xf8e9('0x1'));var path=require('path');var timeout=require(_0xf8e9('0x2'));var express=require('express');var router=express[_0xf8e9('0x3')]();var auth=require(_0xf8e9('0x4'));var interaction=require(_0xf8e9('0x5'));var config=require(_0xf8e9('0x6'));var controller=require(_0xf8e9('0x7'));router[_0xf8e9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf8e9('0x8')]('/:id',auth[_0xf8e9('0x9')](),controller['show']);router[_0xf8e9('0x8')](_0xf8e9('0xa'),auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xb')]);router[_0xf8e9('0xc')]('/',auth['isAuthenticated'](),controller[_0xf8e9('0xd')]);router['post']('/:id/users',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0xe')]);router[_0xf8e9('0xf')]('/:id',auth[_0xf8e9('0x9')](),controller[_0xf8e9('0x10')]);router['delete'](_0xf8e9('0x11'),auth['isAuthenticated'](),controller[_0xf8e9('0x12')]);router[_0xf8e9('0x13')](_0xf8e9('0xa'),auth[_0xf8e9('0x9')](),controller['removeUsers']);module[_0xf8e9('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9a97f8e..7c6fbed 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 _0x80c3=['getDataValue','production','utf8','sequelize','name','TEXT','BLOB','long','preproduction'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x80c3,0x18f));var _0x380c=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x80c3[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require(_0x380c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x380c('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x380c('0x2')]},'preproduction':{'type':Sequelize[_0x380c('0x3')](_0x380c('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0x380c('0x5'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x380c('0x3')](_0x380c('0x4')),'get':function(){if(this[_0x380c('0x6')]('production')){return this[_0x380c('0x6')](_0x380c('0x7'))['toString'](_0x380c('0x8'));}}}}; \ No newline at end of file +var _0xec46=['getDataValue','preproduction','utf8','production','toString','sequelize','exports','STRING','name','BLOB','long'];(function(_0x3482d8,_0x1bfebc){var _0x2eb94d=function(_0x17cfe2){while(--_0x17cfe2){_0x3482d8['push'](_0x3482d8['shift']());}};_0x2eb94d(++_0x1bfebc);}(_0xec46,0x19c));var _0x6ec4=function(_0x2b0d9d,_0x2f313f){_0x2b0d9d=_0x2b0d9d-0x0;var _0x482cc9=_0xec46[_0x2b0d9d];return _0x482cc9;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'name':{'type':Sequelize[_0x6ec4('0x2')],'unique':_0x6ec4('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x6ec4('0x4')](_0x6ec4('0x5')),'get':function(){if(this[_0x6ec4('0x6')]('preproduction')){return this[_0x6ec4('0x6')](_0x6ec4('0x7'))['toString'](_0x6ec4('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x6ec4('0x5')),'get':function(){if(this[_0x6ec4('0x6')](_0x6ec4('0x9'))){return this[_0x6ec4('0x6')](_0x6ec4('0x9'))[_0x6ec4('0xa')](_0x6ec4('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ffe2391..4ea6d13 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 _0x1c73=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SquareProjects','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','SquareProject','include','findAll','rows','catch','show','params','create','body'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x1c73,0x1ec));var _0x31c7=function(_0x207177,_0x5d450c){_0x207177=_0x207177-0x0;var _0x1ed60c=_0x1c73[_0x207177];return _0x1ed60c;};'use strict';var pdf=require(_0x31c7('0x0'));var emlformat=require(_0x31c7('0x1'));var rimraf=require(_0x31c7('0x2'));var zipdir=require(_0x31c7('0x3'));var jsonpatch=require(_0x31c7('0x4'));var rp=require('request-promise');var moment=require(_0x31c7('0x5'));var BPromise=require(_0x31c7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x31c7('0x7'));var sox=require('sox');var csv=require(_0x31c7('0x8'));var ejs=require(_0x31c7('0x9'));var fs=require('fs');var _=require(_0x31c7('0xa'));var squel=require(_0x31c7('0xb'));var crypto=require(_0x31c7('0xc'));var jsforce=require(_0x31c7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x31c7('0x8'));var querystring=require(_0x31c7('0xe'));var Papa=require('papaparse');var Redis=require(_0x31c7('0xf'));var authService=require(_0x31c7('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x31c7('0x11'));var logger=require(_0x31c7('0x12'))(_0x31c7('0x13'));var utils=require(_0x31c7('0x14'));var config=require(_0x31c7('0x15'));var db=require(_0x31c7('0x16'))['db'];config[_0x31c7('0x17')]=_[_0x31c7('0x18')](config[_0x31c7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x31c7('0x19'))(new Redis(config[_0x31c7('0x17')]));require(_0x31c7('0x1a'))[_0x31c7('0x1b')](socket);function respondWithStatusCode(_0x425b5d,_0x3abe82){_0x3abe82=_0x3abe82||0xcc;return function(_0x558c5b){if(_0x558c5b){return _0x425b5d[_0x31c7('0x1c')](_0x3abe82);}return _0x425b5d[_0x31c7('0x1d')](_0x3abe82)[_0x31c7('0x1e')]();};}function respondWithResult(_0x145b32,_0x45168b){_0x45168b=_0x45168b||0xc8;return function(_0x51d1b9){if(_0x51d1b9){return _0x145b32[_0x31c7('0x1d')](_0x45168b)['json'](_0x51d1b9);}};}function respondWithFilteredResult(_0x461115,_0x2dee14){return function(_0x3677f8){if(_0x3677f8){var _0x40e258=_0x3677f8[_0x31c7('0x1f')],_0x27d1e7=_0x2dee14[_0x31c7('0x20')],_0x1257bd=_0x2dee14[_0x31c7('0x20')]+_0x2dee14[_0x31c7('0x21')],_0x1e3098;if(_0x1257bd>=_0x40e258){_0x1257bd=_0x40e258;_0x1e3098=0xc8;}else{_0x1e3098=0xce;}_0x461115[_0x31c7('0x1d')](_0x1e3098);return _0x461115[_0x31c7('0x22')](_0x31c7('0x23'),_0x27d1e7+'-'+_0x1257bd+'/'+_0x40e258)['json'](_0x3677f8);}return null;};}function patchUpdates(_0x4d2377){return function(_0x1a5aa2){try{jsonpatch[_0x31c7('0x24')](_0x1a5aa2,_0x4d2377,!![]);}catch(_0x2338e7){return BPromise[_0x31c7('0x25')](_0x2338e7);}return _0x1a5aa2[_0x31c7('0x26')]();};}function saveUpdates(_0x56b8f2,_0x1b6318){return function(_0x5e2cf3){if(_0x5e2cf3){return _0x5e2cf3[_0x31c7('0x27')](_0x56b8f2)['then'](function(_0x48a8c0){return _0x48a8c0;});}return null;};}function removeEntity(_0x56d683,_0x2a5d48){return function(_0x1ff008){if(_0x1ff008){return _0x1ff008[_0x31c7('0x28')]()[_0x31c7('0x29')](function(){var _0x4f3075=_0x1ff008[_0x31c7('0x2a')]({'plain':!![]});var _0x501e6c=_0x31c7('0x2b');return db[_0x31c7('0x2c')]['destroy']({'where':{'type':_0x501e6c,'resourceId':_0x4f3075['id']}})['then'](function(){return _0x1ff008;});})[_0x31c7('0x29')](function(){_0x56d683[_0x31c7('0x1d')](0xcc)[_0x31c7('0x1e')]();});}};}function handleEntityNotFound(_0xa5db9a,_0x617fbb){return function(_0x2f7980){if(!_0x2f7980){_0xa5db9a[_0x31c7('0x1c')](0x194);}return _0x2f7980;};}function handleError(_0x4bba92,_0x24488d){_0x24488d=_0x24488d||0x1f4;return function(_0x56f0fe){logger[_0x31c7('0x2d')](_0x56f0fe[_0x31c7('0x2e')]);if(_0x56f0fe[_0x31c7('0x2f')]){delete _0x56f0fe[_0x31c7('0x2f')];}_0x4bba92[_0x31c7('0x1d')](_0x24488d)[_0x31c7('0x30')](_0x56f0fe);};}exports['index']=function(_0x48ffdd,_0x4edb86){var _0x2386bb={},_0x3f7ad7={},_0x46b1b2={'count':0x0,'rows':[]};var _0x3d9ac5=db['SquareProject'][_0x31c7('0x31')];_0x3f7ad7[_0x31c7('0x32')]=_[_0x31c7('0x33')](_0x3d9ac5);_0x3f7ad7[_0x31c7('0x34')]=_[_0x31c7('0x33')](_0x48ffdd['query']);_0x3f7ad7[_0x31c7('0x35')]=_['intersection'](_0x3f7ad7[_0x31c7('0x32')],_0x3f7ad7[_0x31c7('0x34')]);_0x2386bb['attributes']=_[_0x31c7('0x36')](_0x3f7ad7['model'],qs[_0x31c7('0x37')](_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x37')]));_0x2386bb['attributes']=_0x2386bb[_0x31c7('0x38')][_0x31c7('0x39')]?_0x2386bb[_0x31c7('0x38')]:_0x3f7ad7[_0x31c7('0x32')];if(!_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x3a')](_0x31c7('0x3b'))){_0x2386bb[_0x31c7('0x21')]=qs['limit'](_0x48ffdd['query'][_0x31c7('0x21')]);_0x2386bb[_0x31c7('0x20')]=qs[_0x31c7('0x20')](_0x48ffdd['query'][_0x31c7('0x20')]);}_0x2386bb[_0x31c7('0x3c')]=qs[_0x31c7('0x3d')](_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x3d')]);_0x2386bb[_0x31c7('0x3e')]=qs[_0x31c7('0x35')](_[_0x31c7('0x3f')](_0x48ffdd[_0x31c7('0x34')],_0x3f7ad7[_0x31c7('0x35')]));if(_0x48ffdd['query'][_0x31c7('0x40')]){_0x2386bb[_0x31c7('0x3e')]=_[_0x31c7('0x41')](_0x2386bb[_0x31c7('0x3e')],{'$or':_['map'](_0x3d9ac5,function(_0x5e4acd){if(_0x5e4acd['type']['key']!==_0x31c7('0x42')){var _0x20ec32={};_0x20ec32[_0x5e4acd[_0x31c7('0x43')]]={'$like':'%'+_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x40')]+'%'};return _0x20ec32;}})});}_0x2386bb=_[_0x31c7('0x41')]({},_0x2386bb,_0x48ffdd[_0x31c7('0x44')]);var _0x2be2dc={'where':_0x2386bb[_0x31c7('0x3e')]};return db[_0x31c7('0x45')][_0x31c7('0x1f')](_0x2be2dc)[_0x31c7('0x29')](function(_0x155e92){_0x46b1b2[_0x31c7('0x1f')]=_0x155e92;if(_0x48ffdd[_0x31c7('0x34')]['includeAll']){_0x2386bb[_0x31c7('0x46')]=[{'all':!![]}];}return db[_0x31c7('0x45')][_0x31c7('0x47')](_0x2386bb);})['then'](function(_0x13dc4c){_0x46b1b2[_0x31c7('0x48')]=_0x13dc4c;return _0x46b1b2;})['then'](respondWithFilteredResult(_0x4edb86,_0x2386bb))[_0x31c7('0x49')](handleError(_0x4edb86,null));};exports[_0x31c7('0x4a')]=function(_0x4ff15b,_0x1f4c2e){var _0x4ba556={'raw':![],'where':{'id':_0x4ff15b[_0x31c7('0x4b')]['id']}},_0x110b9c={};_0x110b9c['model']=_[_0x31c7('0x33')](db[_0x31c7('0x45')][_0x31c7('0x31')]);_0x110b9c[_0x31c7('0x34')]=_['keys'](_0x4ff15b[_0x31c7('0x34')]);_0x110b9c[_0x31c7('0x35')]=_['intersection'](_0x110b9c[_0x31c7('0x32')],_0x110b9c[_0x31c7('0x34')]);_0x4ba556[_0x31c7('0x38')]=_['intersection'](_0x110b9c[_0x31c7('0x32')],qs[_0x31c7('0x37')](_0x4ff15b[_0x31c7('0x34')][_0x31c7('0x37')]));_0x4ba556[_0x31c7('0x38')]=_0x4ba556['attributes'][_0x31c7('0x39')]?_0x4ba556[_0x31c7('0x38')]:_0x110b9c[_0x31c7('0x32')];if(_0x4ff15b['query']['includeAll']){_0x4ba556['include']=[{'all':!![]}];}_0x4ba556=_[_0x31c7('0x41')]({},_0x4ba556,_0x4ff15b[_0x31c7('0x44')]);return db[_0x31c7('0x45')]['find'](_0x4ba556)[_0x31c7('0x29')](handleEntityNotFound(_0x1f4c2e,null))[_0x31c7('0x29')](respondWithResult(_0x1f4c2e,null))[_0x31c7('0x49')](handleError(_0x1f4c2e,null));};exports[_0x31c7('0x4c')]=function(_0x24ba28,_0x4943ae){return db[_0x31c7('0x45')][_0x31c7('0x4c')](_0x24ba28[_0x31c7('0x4d')],{})['then'](function(_0x4aab13){var _0x1d5072=_0x24ba28['user']['get']({'plain':!![]});if(!_0x1d5072)throw new Error(_0x31c7('0x4e'));if(_0x1d5072[_0x31c7('0x4f')]===_0x31c7('0x50')){var _0x4523d0=_0x4aab13[_0x31c7('0x2a')]({'plain':!![]});var _0x324a71=_0x31c7('0x2b');return db[_0x31c7('0x51')]['find']({'where':{'name':_0x324a71,'userProfileId':_0x1d5072[_0x31c7('0x52')]},'raw':!![]})[_0x31c7('0x29')](function(_0x16855e){if(_0x16855e&&_0x16855e[_0x31c7('0x53')]===0x0){return db[_0x31c7('0x2c')][_0x31c7('0x4c')]({'name':_0x4523d0['name'],'resourceId':_0x4523d0['id'],'type':_0x16855e[_0x31c7('0x2f')],'sectionId':_0x16855e['id']},{})[_0x31c7('0x29')](function(){return _0x4aab13;});}else{return _0x4aab13;}})[_0x31c7('0x49')](function(_0x3a8a9f){logger[_0x31c7('0x2d')](_0x31c7('0x54'),_0x3a8a9f);throw _0x3a8a9f;});}return _0x4aab13;})[_0x31c7('0x29')](respondWithResult(_0x4943ae,0xc9))[_0x31c7('0x49')](handleError(_0x4943ae,null));};exports[_0x31c7('0x27')]=function(_0x5c952b,_0x1ac9b7){if(_0x5c952b[_0x31c7('0x4d')]['id']){delete _0x5c952b[_0x31c7('0x4d')]['id'];}return db[_0x31c7('0x45')]['find']({'where':{'id':_0x5c952b[_0x31c7('0x4b')]['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x1ac9b7,null))[_0x31c7('0x29')](saveUpdates(_0x5c952b['body'],null))[_0x31c7('0x29')](respondWithResult(_0x1ac9b7,null))[_0x31c7('0x49')](handleError(_0x1ac9b7,null));};exports[_0x31c7('0x28')]=function(_0x529f6d,_0x1dc763){return db[_0x31c7('0x45')][_0x31c7('0x55')]({'where':{'id':_0x529f6d['params']['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x1dc763,null))[_0x31c7('0x29')](removeEntity(_0x1dc763,null))[_0x31c7('0x49')](handleError(_0x1dc763,null));};exports[_0x31c7('0x56')]=function(_0x81e6b3,_0x35b09a,_0x1a74cf){return db[_0x31c7('0x45')]['find']({'where':{'id':_0x81e6b3['params']['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x35b09a,null))[_0x31c7('0x29')](function(_0x2a3fd7){if(_0x2a3fd7){return _0x2a3fd7[_0x31c7('0x56')](_0x81e6b3[_0x31c7('0x4d')]['ids'],_[_0x31c7('0x57')](_0x81e6b3[_0x31c7('0x4d')],[_0x31c7('0x58'),'id'])||{});}})[_0x31c7('0x29')](respondWithResult(_0x35b09a,null))[_0x31c7('0x49')](handleError(_0x35b09a,null));};exports[_0x31c7('0x59')]=function(_0x6dc0c6,_0x3a5384,_0x14229f){return db['SquareProject']['find']({'where':{'id':_0x6dc0c6[_0x31c7('0x4b')]['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x3a5384,null))[_0x31c7('0x29')](function(_0x54da24){if(_0x54da24){return _0x54da24[_0x31c7('0x59')](_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')])['then'](function(){if(_['isArray'](_0x6dc0c6['query'][_0x31c7('0x58')])){for(var _0x28ed85=0x0;_0x28ed85<_0x6dc0c6['query'][_0x31c7('0x58')][_0x31c7('0x39')];_0x28ed85+=0x1){socket[_0x31c7('0x5a')](_0x31c7('0x5b'),{'UserId':Number(_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')][_0x28ed85]),'SquareProjectId':Number(_0x6dc0c6[_0x31c7('0x4b')]['id'])});}}else{socket[_0x31c7('0x5a')](_0x31c7('0x5b'),{'UserId':Number(_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')]),'SquareProjectId':Number(_0x6dc0c6[_0x31c7('0x4b')]['id'])});}});}})[_0x31c7('0x29')](respondWithStatusCode(_0x3a5384,null))[_0x31c7('0x49')](handleError(_0x3a5384,null));};exports[_0x31c7('0x5c')]=function(_0x49ca98,_0x28be35,_0x897a50){var _0x1aea32={};var _0x2626b4={};var _0x1bb1fd;var _0x4e876f;return db[_0x31c7('0x45')][_0x31c7('0x5d')]({'where':{'id':_0x49ca98[_0x31c7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28be35,null))['then'](function(_0x3cc48e){if(_0x3cc48e){_0x1bb1fd=_0x3cc48e;_0x2626b4['model']=_['keys'](db[_0x31c7('0x5e')]['rawAttributes']);_0x2626b4[_0x31c7('0x34')]=_[_0x31c7('0x33')](_0x49ca98[_0x31c7('0x34')]);_0x2626b4[_0x31c7('0x35')]=_[_0x31c7('0x36')](_0x2626b4[_0x31c7('0x32')],_0x2626b4[_0x31c7('0x34')]);_0x1aea32[_0x31c7('0x38')]=_[_0x31c7('0x36')](_0x2626b4[_0x31c7('0x32')],qs[_0x31c7('0x37')](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x37')]));_0x1aea32['attributes']=_0x1aea32['attributes'][_0x31c7('0x39')]?_0x1aea32[_0x31c7('0x38')]:_0x2626b4[_0x31c7('0x32')];_0x1aea32[_0x31c7('0x3c')]=qs[_0x31c7('0x3d')](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x3d')]);_0x1aea32[_0x31c7('0x3e')]=qs[_0x31c7('0x35')](_[_0x31c7('0x3f')](_0x49ca98[_0x31c7('0x34')],_0x2626b4[_0x31c7('0x35')]));if(_0x49ca98['query'][_0x31c7('0x40')]){_0x1aea32['where']=_[_0x31c7('0x41')](_0x1aea32[_0x31c7('0x3e')],{'$or':_['map'](_0x1aea32[_0x31c7('0x38')],function(_0x3a0ff1){var _0x2e0731={};_0x2e0731[_0x3a0ff1]={'$like':'%'+_0x49ca98[_0x31c7('0x34')][_0x31c7('0x40')]+'%'};return _0x2e0731;})});}_0x1aea32=_[_0x31c7('0x41')]({},_0x1aea32,_0x49ca98[_0x31c7('0x44')]);return _0x1bb1fd[_0x31c7('0x5c')](_0x1aea32);}})['then'](function(_0x17c9ab){if(_0x17c9ab){_0x4e876f=_0x17c9ab[_0x31c7('0x39')];if(!_0x49ca98[_0x31c7('0x34')][_0x31c7('0x3a')]('nolimit')){_0x1aea32[_0x31c7('0x21')]=qs[_0x31c7('0x21')](_0x49ca98['query'][_0x31c7('0x21')]);_0x1aea32[_0x31c7('0x20')]=qs['offset'](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x20')]);}return _0x1bb1fd[_0x31c7('0x5c')](_0x1aea32);}})[_0x31c7('0x29')](function(_0x15f716){if(_0x15f716){return _0x15f716?{'count':_0x4e876f,'rows':_0x15f716}:null;}})[_0x31c7('0x29')](respondWithResult(_0x28be35,null))['catch'](handleError(_0x28be35,null));}; \ No newline at end of file +var _0xe1c7=['omit','ids','isArray','userSquareProject:remove','emit','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','UserProfileResource','error','stack','send','index','SquareProject','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','show','params','options','find','catch','create','body','user','get','SquareProjects','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1c7,0x67));var _0x7e1c=function(_0x421e36,_0x18776e){_0x421e36=_0x421e36-0x0;var _0x20b3e3=_0xe1c7[_0x421e36];return _0x20b3e3;};'use strict';var pdf=require(_0x7e1c('0x0'));var emlformat=require(_0x7e1c('0x1'));var rimraf=require(_0x7e1c('0x2'));var zipdir=require(_0x7e1c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e1c('0x4'));var moment=require(_0x7e1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e1c('0x6'));var util=require(_0x7e1c('0x7'));var path=require(_0x7e1c('0x8'));var sox=require(_0x7e1c('0x9'));var csv=require(_0x7e1c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e1c('0xb'));var squel=require(_0x7e1c('0xc'));var crypto=require(_0x7e1c('0xd'));var jsforce=require(_0x7e1c('0xe'));var deskjs=require(_0x7e1c('0xf'));var toCsv=require(_0x7e1c('0xa'));var querystring=require(_0x7e1c('0x10'));var Papa=require('papaparse');var Redis=require(_0x7e1c('0x11'));var authService=require(_0x7e1c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e1c('0x13'))(_0x7e1c('0x14'));var utils=require(_0x7e1c('0x15'));var config=require(_0x7e1c('0x16'));var db=require('../../mysqldb')['db'];config[_0x7e1c('0x17')]=_['defaults'](config[_0x7e1c('0x17')],{'host':_0x7e1c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e1c('0x19'))[_0x7e1c('0x1a')](socket);function respondWithStatusCode(_0x401e5a,_0x1c5263){_0x1c5263=_0x1c5263||0xcc;return function(_0x2e6f86){if(_0x2e6f86){return _0x401e5a[_0x7e1c('0x1b')](_0x1c5263);}return _0x401e5a[_0x7e1c('0x1c')](_0x1c5263)[_0x7e1c('0x1d')]();};}function respondWithResult(_0x75f91,_0x2ed1a0){_0x2ed1a0=_0x2ed1a0||0xc8;return function(_0x2c1828){if(_0x2c1828){return _0x75f91[_0x7e1c('0x1c')](_0x2ed1a0)['json'](_0x2c1828);}};}function respondWithFilteredResult(_0x2f4067,_0x501786){return function(_0x193711){if(_0x193711){var _0x23c256=_0x193711[_0x7e1c('0x1e')],_0x17de31=_0x501786['offset'],_0x584b2f=_0x501786[_0x7e1c('0x1f')]+_0x501786[_0x7e1c('0x20')],_0x1357cb;if(_0x584b2f>=_0x23c256){_0x584b2f=_0x23c256;_0x1357cb=0xc8;}else{_0x1357cb=0xce;}_0x2f4067[_0x7e1c('0x1c')](_0x1357cb);return _0x2f4067[_0x7e1c('0x21')](_0x7e1c('0x22'),_0x17de31+'-'+_0x584b2f+'/'+_0x23c256)[_0x7e1c('0x23')](_0x193711);}return null;};}function patchUpdates(_0x3c9bcb){return function(_0x238b97){try{jsonpatch[_0x7e1c('0x24')](_0x238b97,_0x3c9bcb,!![]);}catch(_0x1f525c){return BPromise[_0x7e1c('0x25')](_0x1f525c);}return _0x238b97[_0x7e1c('0x26')]();};}function saveUpdates(_0x598c4e,_0x424714){return function(_0x1ec2e2){if(_0x1ec2e2){return _0x1ec2e2['update'](_0x598c4e)[_0x7e1c('0x27')](function(_0xedf63c){return _0xedf63c;});}return null;};}function removeEntity(_0x326cc9,_0x744313){return function(_0x2b3115){if(_0x2b3115){return _0x2b3115[_0x7e1c('0x28')]()[_0x7e1c('0x27')](function(){var _0x43e2cb=_0x2b3115['get']({'plain':!![]});var _0x5396c5='SquareProjects';return db[_0x7e1c('0x29')]['destroy']({'where':{'type':_0x5396c5,'resourceId':_0x43e2cb['id']}})[_0x7e1c('0x27')](function(){return _0x2b3115;});})[_0x7e1c('0x27')](function(){_0x326cc9[_0x7e1c('0x1c')](0xcc)[_0x7e1c('0x1d')]();});}};}function handleEntityNotFound(_0x34837f,_0x13244e){return function(_0x231317){if(!_0x231317){_0x34837f[_0x7e1c('0x1b')](0x194);}return _0x231317;};}function handleError(_0x206285,_0x29ee42){_0x29ee42=_0x29ee42||0x1f4;return function(_0x11ebdf){logger[_0x7e1c('0x2a')](_0x11ebdf[_0x7e1c('0x2b')]);if(_0x11ebdf['name']){delete _0x11ebdf['name'];}_0x206285[_0x7e1c('0x1c')](_0x29ee42)[_0x7e1c('0x2c')](_0x11ebdf);};}exports[_0x7e1c('0x2d')]=function(_0x1ecc55,_0x58b4a0){var _0x3e274f={},_0x41d2d6={},_0x1cec9a={'count':0x0,'rows':[]};var _0x47ebc5=db[_0x7e1c('0x2e')][_0x7e1c('0x2f')];_0x41d2d6['model']=_['keys'](_0x47ebc5);_0x41d2d6[_0x7e1c('0x30')]=_[_0x7e1c('0x31')](_0x1ecc55['query']);_0x41d2d6[_0x7e1c('0x32')]=_['intersection'](_0x41d2d6[_0x7e1c('0x33')],_0x41d2d6[_0x7e1c('0x30')]);_0x3e274f[_0x7e1c('0x34')]=_[_0x7e1c('0x35')](_0x41d2d6[_0x7e1c('0x33')],qs['fields'](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x36')]));_0x3e274f['attributes']=_0x3e274f[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x3e274f[_0x7e1c('0x34')]:_0x41d2d6[_0x7e1c('0x33')];if(!_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x38')](_0x7e1c('0x39'))){_0x3e274f['limit']=qs['limit'](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x20')]);_0x3e274f['offset']=qs[_0x7e1c('0x1f')](_0x1ecc55[_0x7e1c('0x30')]['offset']);}_0x3e274f[_0x7e1c('0x3a')]=qs[_0x7e1c('0x3b')](_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3b')]);_0x3e274f[_0x7e1c('0x3c')]=qs[_0x7e1c('0x32')](_[_0x7e1c('0x3d')](_0x1ecc55['query'],_0x41d2d6[_0x7e1c('0x32')]));if(_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3e')]){_0x3e274f[_0x7e1c('0x3c')]=_[_0x7e1c('0x3f')](_0x3e274f[_0x7e1c('0x3c')],{'$or':_[_0x7e1c('0x40')](_0x47ebc5,function(_0x3b0fcb){if(_0x3b0fcb[_0x7e1c('0x41')]['key']!==_0x7e1c('0x42')){var _0x127759={};_0x127759[_0x3b0fcb[_0x7e1c('0x43')]]={'$like':'%'+_0x1ecc55[_0x7e1c('0x30')][_0x7e1c('0x3e')]+'%'};return _0x127759;}})});}_0x3e274f=_[_0x7e1c('0x3f')]({},_0x3e274f,_0x1ecc55['options']);var _0x22c7f3={'where':_0x3e274f[_0x7e1c('0x3c')]};return db[_0x7e1c('0x2e')][_0x7e1c('0x1e')](_0x22c7f3)[_0x7e1c('0x27')](function(_0x23cbc2){_0x1cec9a[_0x7e1c('0x1e')]=_0x23cbc2;if(_0x1ecc55['query'][_0x7e1c('0x44')]){_0x3e274f[_0x7e1c('0x45')]=[{'all':!![]}];}return db['SquareProject'][_0x7e1c('0x46')](_0x3e274f);})[_0x7e1c('0x27')](function(_0x5ea775){_0x1cec9a['rows']=_0x5ea775;return _0x1cec9a;})[_0x7e1c('0x27')](respondWithFilteredResult(_0x58b4a0,_0x3e274f))['catch'](handleError(_0x58b4a0,null));};exports[_0x7e1c('0x47')]=function(_0x570326,_0x58c114){var _0x432f0e={'raw':![],'where':{'id':_0x570326[_0x7e1c('0x48')]['id']}},_0x4bd543={};_0x4bd543[_0x7e1c('0x33')]=_[_0x7e1c('0x31')](db['SquareProject'][_0x7e1c('0x2f')]);_0x4bd543[_0x7e1c('0x30')]=_[_0x7e1c('0x31')](_0x570326[_0x7e1c('0x30')]);_0x4bd543[_0x7e1c('0x32')]=_[_0x7e1c('0x35')](_0x4bd543[_0x7e1c('0x33')],_0x4bd543['query']);_0x432f0e['attributes']=_['intersection'](_0x4bd543[_0x7e1c('0x33')],qs[_0x7e1c('0x36')](_0x570326['query']['fields']));_0x432f0e[_0x7e1c('0x34')]=_0x432f0e[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x432f0e[_0x7e1c('0x34')]:_0x4bd543[_0x7e1c('0x33')];if(_0x570326[_0x7e1c('0x30')][_0x7e1c('0x44')]){_0x432f0e[_0x7e1c('0x45')]=[{'all':!![]}];}_0x432f0e=_[_0x7e1c('0x3f')]({},_0x432f0e,_0x570326[_0x7e1c('0x49')]);return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')](_0x432f0e)[_0x7e1c('0x27')](handleEntityNotFound(_0x58c114,null))[_0x7e1c('0x27')](respondWithResult(_0x58c114,null))[_0x7e1c('0x4b')](handleError(_0x58c114,null));};exports[_0x7e1c('0x4c')]=function(_0x18d7cf,_0x214c44){return db['SquareProject'][_0x7e1c('0x4c')](_0x18d7cf[_0x7e1c('0x4d')],{})[_0x7e1c('0x27')](function(_0x547d39){var _0x5855cf=_0x18d7cf[_0x7e1c('0x4e')]['get']({'plain':!![]});if(!_0x5855cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5855cf['role']===_0x7e1c('0x4e')){var _0x341ca7=_0x547d39[_0x7e1c('0x4f')]({'plain':!![]});var _0x26bf5b=_0x7e1c('0x50');return db[_0x7e1c('0x51')][_0x7e1c('0x4a')]({'where':{'name':_0x26bf5b,'userProfileId':_0x5855cf[_0x7e1c('0x52')]},'raw':!![]})['then'](function(_0x285115){if(_0x285115&&_0x285115[_0x7e1c('0x53')]===0x0){return db[_0x7e1c('0x29')][_0x7e1c('0x4c')]({'name':_0x341ca7[_0x7e1c('0x54')],'resourceId':_0x341ca7['id'],'type':_0x285115[_0x7e1c('0x54')],'sectionId':_0x285115['id']},{})['then'](function(){return _0x547d39;});}else{return _0x547d39;}})['catch'](function(_0x3cf70e){logger[_0x7e1c('0x2a')](_0x7e1c('0x55'),_0x3cf70e);throw _0x3cf70e;});}return _0x547d39;})[_0x7e1c('0x27')](respondWithResult(_0x214c44,0xc9))[_0x7e1c('0x4b')](handleError(_0x214c44,null));};exports['update']=function(_0x36636b,_0x4384eb){if(_0x36636b[_0x7e1c('0x4d')]['id']){delete _0x36636b[_0x7e1c('0x4d')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x36636b[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x4384eb,null))[_0x7e1c('0x27')](saveUpdates(_0x36636b[_0x7e1c('0x4d')],null))[_0x7e1c('0x27')](respondWithResult(_0x4384eb,null))[_0x7e1c('0x4b')](handleError(_0x4384eb,null));};exports['destroy']=function(_0x52dd3e,_0x252027){return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')]({'where':{'id':_0x52dd3e[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x252027,null))[_0x7e1c('0x27')](removeEntity(_0x252027,null))[_0x7e1c('0x4b')](handleError(_0x252027,null));};exports['addUsers']=function(_0x9b6c66,_0x5ef455,_0x411024){return db[_0x7e1c('0x2e')][_0x7e1c('0x4a')]({'where':{'id':_0x9b6c66[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x5ef455,null))[_0x7e1c('0x27')](function(_0x52584f){if(_0x52584f){return _0x52584f[_0x7e1c('0x56')](_0x9b6c66[_0x7e1c('0x4d')]['ids'],_[_0x7e1c('0x57')](_0x9b6c66[_0x7e1c('0x4d')],['ids','id'])||{});}})[_0x7e1c('0x27')](respondWithResult(_0x5ef455,null))['catch'](handleError(_0x5ef455,null));};exports['removeUsers']=function(_0xb18358,_0x1e3b24,_0x32227e){return db['SquareProject'][_0x7e1c('0x4a')]({'where':{'id':_0xb18358[_0x7e1c('0x48')]['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x1e3b24,null))[_0x7e1c('0x27')](function(_0x5c35d9){if(_0x5c35d9){return _0x5c35d9['removeUsers'](_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')])[_0x7e1c('0x27')](function(){if(_[_0x7e1c('0x59')](_0xb18358['query'][_0x7e1c('0x58')])){for(var _0x3f2957=0x0;_0x3f2957<_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')][_0x7e1c('0x37')];_0x3f2957+=0x1){socket['emit'](_0x7e1c('0x5a'),{'UserId':Number(_0xb18358[_0x7e1c('0x30')][_0x7e1c('0x58')][_0x3f2957]),'SquareProjectId':Number(_0xb18358[_0x7e1c('0x48')]['id'])});}}else{socket[_0x7e1c('0x5b')](_0x7e1c('0x5a'),{'UserId':Number(_0xb18358['query'][_0x7e1c('0x58')]),'SquareProjectId':Number(_0xb18358[_0x7e1c('0x48')]['id'])});}});}})[_0x7e1c('0x27')](respondWithStatusCode(_0x1e3b24,null))[_0x7e1c('0x4b')](handleError(_0x1e3b24,null));};exports[_0x7e1c('0x5c')]=function(_0x3d48db,_0x57e793,_0x4c81e1){var _0x4af3d6={};var _0x8e12ff={};var _0x2d72f1;var _0x4eb740;return db[_0x7e1c('0x2e')][_0x7e1c('0x5d')]({'where':{'id':_0x3d48db['params']['id']}})[_0x7e1c('0x27')](handleEntityNotFound(_0x57e793,null))[_0x7e1c('0x27')](function(_0x4762a7){if(_0x4762a7){_0x2d72f1=_0x4762a7;_0x8e12ff['model']=_['keys'](db[_0x7e1c('0x5e')][_0x7e1c('0x2f')]);_0x8e12ff['query']=_[_0x7e1c('0x31')](_0x3d48db[_0x7e1c('0x30')]);_0x8e12ff[_0x7e1c('0x32')]=_['intersection'](_0x8e12ff[_0x7e1c('0x33')],_0x8e12ff[_0x7e1c('0x30')]);_0x4af3d6[_0x7e1c('0x34')]=_[_0x7e1c('0x35')](_0x8e12ff[_0x7e1c('0x33')],qs[_0x7e1c('0x36')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x36')]));_0x4af3d6[_0x7e1c('0x34')]=_0x4af3d6[_0x7e1c('0x34')][_0x7e1c('0x37')]?_0x4af3d6[_0x7e1c('0x34')]:_0x8e12ff[_0x7e1c('0x33')];_0x4af3d6[_0x7e1c('0x3a')]=qs[_0x7e1c('0x3b')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x3b')]);_0x4af3d6[_0x7e1c('0x3c')]=qs[_0x7e1c('0x32')](_[_0x7e1c('0x3d')](_0x3d48db[_0x7e1c('0x30')],_0x8e12ff[_0x7e1c('0x32')]));if(_0x3d48db['query']['filter']){_0x4af3d6[_0x7e1c('0x3c')]=_[_0x7e1c('0x3f')](_0x4af3d6[_0x7e1c('0x3c')],{'$or':_[_0x7e1c('0x40')](_0x4af3d6[_0x7e1c('0x34')],function(_0x36f673){var _0x11c394={};_0x11c394[_0x36f673]={'$like':'%'+_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x3e')]+'%'};return _0x11c394;})});}_0x4af3d6=_['merge']({},_0x4af3d6,_0x3d48db[_0x7e1c('0x49')]);return _0x2d72f1[_0x7e1c('0x5c')](_0x4af3d6);}})[_0x7e1c('0x27')](function(_0x12348c){if(_0x12348c){_0x4eb740=_0x12348c[_0x7e1c('0x37')];if(!_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x38')]('nolimit')){_0x4af3d6[_0x7e1c('0x20')]=qs[_0x7e1c('0x20')](_0x3d48db['query']['limit']);_0x4af3d6[_0x7e1c('0x1f')]=qs[_0x7e1c('0x1f')](_0x3d48db[_0x7e1c('0x30')][_0x7e1c('0x1f')]);}return _0x2d72f1['getUsers'](_0x4af3d6);}})[_0x7e1c('0x27')](function(_0x5121ee){if(_0x5121ee){return _0x5121ee?{'count':_0x4eb740,'rows':_0x5121ee}:null;}})[_0x7e1c('0x27')](respondWithResult(_0x57e793,null))[_0x7e1c('0x4b')](handleError(_0x57e793,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f9a99c0..efb6da4 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 _0xe149=['exports','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x4e6766,_0x43c16a){var _0x13fc37=function(_0x3e7a3b){while(--_0x3e7a3b){_0x4e6766['push'](_0x4e6766['shift']());}};_0x13fc37(++_0x43c16a);}(_0xe149,0xf6));var _0x9e14=function(_0x4a6e97,_0x48375b){_0x4a6e97=_0x4a6e97-0x0;var _0x216a49=_0xe149[_0x4a6e97];return _0x216a49;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x9e14('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e14('0x1'),'afterUpdate':_0x9e14('0x2'),'afterDestroy':_0x9e14('0x3')};function emitEvent(_0xb0ef36){return function(_0x3794a9,_0x3a8fa9,_0x813cde){SquareProjectEvents[_0x9e14('0x4')](_0xb0ef36+':'+_0x3794a9['id'],_0x3794a9);SquareProjectEvents[_0x9e14('0x4')](_0xb0ef36,_0x3794a9);_0x813cde(null);};}for(var e in events){if(events[_0x9e14('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x9e14('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x0fc7=['exports','../../mysqldb','SquareProject','save','remove','hasOwnProperty','hook'];(function(_0x37aa85,_0x39ceaf){var _0xfb9983=function(_0x444151){while(--_0x444151){_0x37aa85['push'](_0x37aa85['shift']());}};_0xfb9983(++_0x39ceaf);}(_0x0fc7,0xb0));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x70fc('0x0'))['db'][_0x70fc('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x70fc('0x2'),'afterUpdate':'update','afterDestroy':_0x70fc('0x3')};function emitEvent(_0x29ee23){return function(_0x4dde0e,_0x29fdaa,_0x467379){SquareProjectEvents['emit'](_0x29ee23+':'+_0x4dde0e['id'],_0x4dde0e);SquareProjectEvents['emit'](_0x29ee23,_0x4dde0e);_0x467379(null);};}for(var e in events){if(events[_0x70fc('0x4')](e)){var event=events[e];SquareProject[_0x70fc('0x5')](e,emitEvent(event));}}module[_0x70fc('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 17193e6..949f421 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 _0xa887=['square_projects','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x220b5f,_0x10f186){var _0x28389e=function(_0x10de49){while(--_0x10de49){_0x220b5f['push'](_0x220b5f['shift']());}};_0x28389e(++_0x10f186);}(_0xa887,0x1a5));var _0x7a88=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa887[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x7a88('0x0'));var util=require(_0x7a88('0x1'));var logger=require(_0x7a88('0x2'))(_0x7a88('0x3'));var moment=require('moment');var BPromise=require(_0x7a88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a88('0x5'));var rimraf=require('rimraf');var config=require(_0x7a88('0x6'));var attributes=require(_0x7a88('0x7'));module[_0x7a88('0x8')]=function(_0x4f1491,_0x39e597){return _0x4f1491[_0x7a88('0x9')](_0x7a88('0xa'),attributes,{'tableName':_0x7a88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba04=['square_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x57ba30,_0x26d7ba){var _0x26276d=function(_0x36b15c){while(--_0x36b15c){_0x57ba30['push'](_0x57ba30['shift']());}};_0x26276d(++_0x26d7ba);}(_0xba04,0x1e1));var _0x4ba0=function(_0x220d04,_0x2df8a1){_0x220d04=_0x220d04-0x0;var _0x2316fe=_0xba04[_0x220d04];return _0x2316fe;};'use strict';var _=require(_0x4ba0('0x0'));var util=require(_0x4ba0('0x1'));var logger=require(_0x4ba0('0x2'))(_0x4ba0('0x3'));var moment=require(_0x4ba0('0x4'));var BPromise=require(_0x4ba0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ba0('0x6'));var rimraf=require(_0x4ba0('0x7'));var config=require(_0x4ba0('0x8'));var attributes=require('./squareProject.attributes');module[_0x4ba0('0x9')]=function(_0x299e3c,_0xc8c1c5){return _0x299e3c[_0x4ba0('0xa')]('SquareProject',attributes,{'tableName':_0x4ba0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1412a9f..a58ca25 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x57fabd,_0x632258){var _0x24cdd7=function(_0xab78c3){while(--_0xab78c3){_0x57fabd['push'](_0x57fabd['shift']());}};_0x24cdd7(++_0x632258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3cae90,_0xff850b){var _0x4fe50e=function(_0x39be82){while(--_0x39be82){_0x3cae90['push'](_0x3cae90['shift']());}};_0x4fe50e(++_0xff850b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index bd05fe5..a169bbc 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 _0xf3dc=['squareProject:','./squareProject.events','save','remove','emit'];(function(_0x26c06d,_0x1c3890){var _0x3e648a=function(_0x13aeb4){while(--_0x13aeb4){_0x26c06d['push'](_0x26c06d['shift']());}};_0x3e648a(++_0x1c3890);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xf3dc[_0x49052b];return _0x48c045;};'use strict';var SquareProjectEvents=require(_0xcf3d('0x0'));var events=[_0xcf3d('0x1'),_0xcf3d('0x2'),'update'];function createListener(_0x44bb46,_0x1b869b){return function(_0x42319d){_0x1b869b[_0xcf3d('0x3')](_0x44bb46,_0x42319d);};}function removeListener(_0x17b83e,_0x44b3da){return function(){SquareProjectEvents['removeListener'](_0x17b83e,_0x44b3da);};}exports['register']=function(_0x55074b){for(var _0x5b1441=0x0,_0x4e3427=events['length'];_0x5b1441<_0x4e3427;_0x5b1441++){var _0x1a69de=events[_0x5b1441];var _0x10d808=createListener(_0xcf3d('0x4')+_0x1a69de,_0x55074b);SquareProjectEvents['on'](_0x1a69de,_0x10d808);}}; \ No newline at end of file +var _0x6b61=['update','emit','register','length','squareProject:','./squareProject.events','remove'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x6b61,0x16a));var _0x16b6=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x6b61[_0x3b96cf];return _0x2e315a;};'use strict';var SquareProjectEvents=require(_0x16b6('0x0'));var events=['save',_0x16b6('0x1'),_0x16b6('0x2')];function createListener(_0xbeab11,_0x2f73f2){return function(_0xffc401){_0x2f73f2[_0x16b6('0x3')](_0xbeab11,_0xffc401);};}function removeListener(_0x213f9e,_0x12ffdd){return function(){SquareProjectEvents['removeListener'](_0x213f9e,_0x12ffdd);};}exports[_0x16b6('0x4')]=function(_0x173c5d){for(var _0x594a8f=0x0,_0x3d06d6=events[_0x16b6('0x5')];_0x594a8f<_0x3d06d6;_0x594a8f++){var _0x59552d=events[_0x594a8f];var _0x460269=createListener(_0x16b6('0x6')+_0x59552d,_0x173c5d);SquareProjectEvents['on'](_0x59552d,_0x460269);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8dbaa17..fcd84a6 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 _0x6cba=['get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x45d2fc,_0x487f93){var _0x4e2cd7=function(_0x58a8b5){while(--_0x58a8b5){_0x45d2fc['push'](_0x45d2fc['shift']());}};_0x4e2cd7(++_0x487f93);}(_0x6cba,0x173));var _0xa6cb=function(_0x25c208,_0x2d8234){_0x25c208=_0x25c208-0x0;var _0x32cae8=_0x6cba[_0x25c208];return _0x32cae8;};'use strict';var multer=require(_0xa6cb('0x0'));var util=require(_0xa6cb('0x1'));var path=require(_0xa6cb('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6cb('0x3'));var router=express[_0xa6cb('0x4')]();var auth=require(_0xa6cb('0x5'));var interaction=require(_0xa6cb('0x6'));var config=require(_0xa6cb('0x7'));var controller=require(_0xa6cb('0x8'));router[_0xa6cb('0x9')]('/',auth[_0xa6cb('0xa')](),controller[_0xa6cb('0xb')]);router[_0xa6cb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa6cb('0xc')]);router[_0xa6cb('0x9')](_0xa6cb('0xd'),auth[_0xa6cb('0xa')](),controller[_0xa6cb('0xe')]);router[_0xa6cb('0xf')]('/',auth[_0xa6cb('0xa')](),controller['create']);router[_0xa6cb('0x10')](_0xa6cb('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa6cb('0x11'),auth['isAuthenticated'](),controller[_0xa6cb('0x12')]);module[_0xa6cb('0x13')]=router; \ No newline at end of file +var _0x3a0f=['delete','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x21de93,_0x83f4a9){var _0x18952d=function(_0xa0f2e0){while(--_0xa0f2e0){_0x21de93['push'](_0x21de93['shift']());}};_0x18952d(++_0x83f4a9);}(_0x3a0f,0x145));var _0xf3a0=function(_0x9806fb,_0x52cd4d){_0x9806fb=_0x9806fb-0x0;var _0x173a7b=_0x3a0f[_0x9806fb];return _0x173a7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3a0('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf3a0('0x1')]();var auth=require(_0xf3a0('0x2'));var interaction=require(_0xf3a0('0x3'));var config=require(_0xf3a0('0x4'));var controller=require(_0xf3a0('0x5'));router[_0xf3a0('0x6')]('/',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0x8')]);router['get'](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xa')]);router[_0xf3a0('0x6')]('/:id/download',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xb')]);router[_0xf3a0('0xc')]('/',auth[_0xf3a0('0x7')](),controller[_0xf3a0('0xd')]);router[_0xf3a0('0xe')](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller['update']);router[_0xf3a0('0xf')](_0xf3a0('0x9'),auth[_0xf3a0('0x7')](),controller['destroy']);module[_0xf3a0('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 9b673bd..2d7efd4 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 _0x0240=['STRING'];(function(_0x1bd2e7,_0x2dc5e9){var _0x41e060=function(_0x29f108){while(--_0x29f108){_0x1bd2e7['push'](_0x1bd2e7['shift']());}};_0x41e060(++_0x2dc5e9);}(_0x0240,0x16a));var _0x0024=function(_0x2dffff,_0x8639df){_0x2dffff=_0x2dffff-0x0;var _0x44e79b=_0x0240[_0x2dffff];return _0x44e79b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0024('0x0')]},'callerid':{'type':Sequelize[_0x0024('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0024('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0024('0x0')]},'dnid':{'type':Sequelize[_0x0024('0x0')]},'projectName':{'type':Sequelize[_0x0024('0x0')]},'saveName':{'type':Sequelize[_0x0024('0x0')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x0024('0x0')]}}; \ No newline at end of file +var _0x6814=['STRING','sequelize'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x6814,0x113));var _0x4681=function(_0x5bc59c,_0x4ea9a5){_0x5bc59c=_0x5bc59c-0x0;var _0x3322d8=_0x6814[_0x5bc59c];return _0x3322d8;};'use strict';var Sequelize=require(_0x4681('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4681('0x1')]},'calleridname':{'type':Sequelize[_0x4681('0x1')]},'context':{'type':Sequelize[_0x4681('0x1')]},'extension':{'type':Sequelize[_0x4681('0x1')]},'priority':{'type':Sequelize[_0x4681('0x1')]},'accountcode':{'type':Sequelize[_0x4681('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4681('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4681('0x1')]},'savePath':{'type':Sequelize[_0x4681('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 5301935..fded558 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 _0x4e81=['eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','update','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x4e81,0x1bc));var _0x14e8=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x4e81[_0x56ba92];return _0x8fe94d;};'use strict';var pdf=require(_0x14e8('0x0'));var emlformat=require(_0x14e8('0x1'));var rimraf=require(_0x14e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e8('0x3'));var BPromise=require(_0x14e8('0x4'));var Mustache=require(_0x14e8('0x5'));var util=require(_0x14e8('0x6'));var path=require(_0x14e8('0x7'));var sox=require(_0x14e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0xe'));var querystring=require(_0x14e8('0xf'));var Papa=require(_0x14e8('0x10'));var Redis=require(_0x14e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var db=require(_0x14e8('0x18'))['db'];function respondWithStatusCode(_0x30df66,_0x52d13c){_0x52d13c=_0x52d13c||0xcc;return function(_0x37eccb){if(_0x37eccb){return _0x30df66['sendStatus'](_0x52d13c);}return _0x30df66[_0x14e8('0x19')](_0x52d13c)[_0x14e8('0x1a')]();};}function respondWithResult(_0x32a01d,_0x5a95b7){_0x5a95b7=_0x5a95b7||0xc8;return function(_0x22fa86){if(_0x22fa86){return _0x32a01d['status'](_0x5a95b7)[_0x14e8('0x1b')](_0x22fa86);}};}function respondWithFilteredResult(_0x58d26e,_0x347216){return function(_0x3761a1){if(_0x3761a1){var _0xc6101f=_0x3761a1[_0x14e8('0x1c')],_0x135996=_0x347216[_0x14e8('0x1d')],_0x52e64f=_0x347216[_0x14e8('0x1d')]+_0x347216[_0x14e8('0x1e')],_0x10c4a9;if(_0x52e64f>=_0xc6101f){_0x52e64f=_0xc6101f;_0x10c4a9=0xc8;}else{_0x10c4a9=0xce;}_0x58d26e[_0x14e8('0x19')](_0x10c4a9);return _0x58d26e[_0x14e8('0x1f')](_0x14e8('0x20'),_0x135996+'-'+_0x52e64f+'/'+_0xc6101f)['json'](_0x3761a1);}return null;};}function patchUpdates(_0x328c5a){return function(_0x233cd8){try{jsonpatch[_0x14e8('0x21')](_0x233cd8,_0x328c5a,!![]);}catch(_0x7b10f2){return BPromise[_0x14e8('0x22')](_0x7b10f2);}return _0x233cd8['save']();};}function saveUpdates(_0xc967c9,_0x1cefdc){return function(_0x2abfec){if(_0x2abfec){return _0x2abfec['update'](_0xc967c9)[_0x14e8('0x23')](function(_0x47f060){return _0x47f060;});}return null;};}function removeEntity(_0x4cca43,_0xb33beb){return function(_0x3e8d5c){if(_0x3e8d5c){return _0x3e8d5c[_0x14e8('0x24')]()[_0x14e8('0x23')](function(){_0x4cca43['status'](0xcc)[_0x14e8('0x1a')]();});}};}function handleEntityNotFound(_0x5b11f9,_0x31bdd3){return function(_0x185a0e){if(!_0x185a0e){_0x5b11f9['sendStatus'](0x194);}return _0x185a0e;};}function handleError(_0x58a3a1,_0x4e7ec5){_0x4e7ec5=_0x4e7ec5||0x1f4;return function(_0x4a758c){logger[_0x14e8('0x25')](_0x4a758c[_0x14e8('0x26')]);if(_0x4a758c[_0x14e8('0x27')]){delete _0x4a758c[_0x14e8('0x27')];}_0x58a3a1['status'](_0x4e7ec5)[_0x14e8('0x28')](_0x4a758c);};}exports[_0x14e8('0x29')]=function(_0x3c09cb,_0x2f5818){var _0x28035a={},_0xfc0545={},_0x2813ae={'count':0x0,'rows':[]};var _0x4abc29=db[_0x14e8('0x2a')][_0x14e8('0x2b')];_0xfc0545[_0x14e8('0x2c')]=_['keys'](_0x4abc29);_0xfc0545['query']=_['keys'](_0x3c09cb[_0x14e8('0x2d')]);_0xfc0545[_0x14e8('0x2e')]=_['intersection'](_0xfc0545[_0x14e8('0x2c')],_0xfc0545[_0x14e8('0x2d')]);_0x28035a[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0xfc0545['model'],qs[_0x14e8('0x31')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x28035a[_0x14e8('0x2f')]=_0x28035a[_0x14e8('0x2f')]['length']?_0x28035a[_0x14e8('0x2f')]:_0xfc0545[_0x14e8('0x2c')];if(!_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x32')]('nolimit')){_0x28035a[_0x14e8('0x1e')]=qs['limit'](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1e')]);_0x28035a[_0x14e8('0x1d')]=qs[_0x14e8('0x1d')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1d')]);}_0x28035a[_0x14e8('0x33')]=qs[_0x14e8('0x34')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x34')]);_0x28035a[_0x14e8('0x35')]=qs[_0x14e8('0x2e')](_['pick'](_0x3c09cb['query'],_0xfc0545['filters']));if(_0x3c09cb[_0x14e8('0x2d')]['filter']){_0x28035a[_0x14e8('0x35')]=_['merge'](_0x28035a[_0x14e8('0x35')],{'$or':_[_0x14e8('0x36')](_0x4abc29,function(_0x41fe2a){if(_0x41fe2a[_0x14e8('0x37')]['key']!==_0x14e8('0x38')){var _0x514415={};_0x514415[_0x41fe2a[_0x14e8('0x39')]]={'$like':'%'+_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x3a')]+'%'};return _0x514415;}})});}_0x28035a=_[_0x14e8('0x3b')]({},_0x28035a,_0x3c09cb[_0x14e8('0x3c')]);var _0x4ede06={'where':_0x28035a['where']};return db[_0x14e8('0x2a')]['count'](_0x4ede06)[_0x14e8('0x23')](function(_0x20f69d){_0x2813ae[_0x14e8('0x1c')]=_0x20f69d;if(_0x3c09cb['query'][_0x14e8('0x3d')]){_0x28035a[_0x14e8('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x14e8('0x3f')](_0x28035a);})[_0x14e8('0x23')](function(_0x1f429a){_0x2813ae[_0x14e8('0x40')]=_0x1f429a;return _0x2813ae;})[_0x14e8('0x23')](respondWithFilteredResult(_0x2f5818,_0x28035a))[_0x14e8('0x41')](handleError(_0x2f5818,null));};exports[_0x14e8('0x42')]=function(_0x38ec58,_0x33743a){var _0x18faf5={'raw':!![],'where':{'id':_0x38ec58[_0x14e8('0x43')]['id']}},_0x11f0ee={};_0x11f0ee[_0x14e8('0x2c')]=_[_0x14e8('0x44')](db[_0x14e8('0x2a')]['rawAttributes']);_0x11f0ee[_0x14e8('0x2d')]=_['keys'](_0x38ec58['query']);_0x11f0ee['filters']=_[_0x14e8('0x30')](_0x11f0ee['model'],_0x11f0ee[_0x14e8('0x2d')]);_0x18faf5[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x11f0ee[_0x14e8('0x2c')],qs[_0x14e8('0x31')](_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x18faf5[_0x14e8('0x2f')]=_0x18faf5[_0x14e8('0x2f')][_0x14e8('0x45')]?_0x18faf5[_0x14e8('0x2f')]:_0x11f0ee['model'];if(_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x3d')]){_0x18faf5[_0x14e8('0x3e')]=[{'all':!![]}];}_0x18faf5=_[_0x14e8('0x3b')]({},_0x18faf5,_0x38ec58['options']);return db[_0x14e8('0x2a')][_0x14e8('0x46')](_0x18faf5)['then'](handleEntityNotFound(_0x33743a,null))['then'](respondWithResult(_0x33743a,null))[_0x14e8('0x41')](handleError(_0x33743a,null));};exports['create']=function(_0x58b609,_0x257cc1){return db[_0x14e8('0x2a')]['create'](_0x58b609[_0x14e8('0x47')],{})[_0x14e8('0x23')](respondWithResult(_0x257cc1,0xc9))['catch'](handleError(_0x257cc1,null));};exports[_0x14e8('0x48')]=function(_0x1994fb,_0x1dee01){if(_0x1994fb[_0x14e8('0x47')]['id']){delete _0x1994fb[_0x14e8('0x47')]['id'];}return db[_0x14e8('0x2a')][_0x14e8('0x46')]({'where':{'id':_0x1994fb[_0x14e8('0x43')]['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1dee01,null))[_0x14e8('0x23')](saveUpdates(_0x1994fb[_0x14e8('0x47')],null))[_0x14e8('0x23')](respondWithResult(_0x1dee01,null))[_0x14e8('0x41')](handleError(_0x1dee01,null));};exports[_0x14e8('0x24')]=function(_0x1bf742,_0x1f50bc){return db['SquareRecording'][_0x14e8('0x46')]({'where':{'id':_0x1bf742['params']['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x23')](removeEntity(_0x1f50bc,null))[_0x14e8('0x41')](handleError(_0x1f50bc,null));};exports[_0x14e8('0x49')]=function(_0x5dcb68,_0x4d91df,_0x59b172){var _0x291fe2=require('../../components/encryptor');var _0x55f9b0=![];var _0xd2b281={};if(_0x5dcb68[_0x14e8('0x2d')]['type']&&_0x5dcb68[_0x14e8('0x2d')][_0x14e8('0x37')]===_0x14e8('0x4a')){_0xd2b281[_0x14e8('0x4a')]=_0x5dcb68['params']['id'];}else{_0xd2b281['id']=_0x5dcb68['params']['id'];}return db[_0x14e8('0x2a')][_0x14e8('0x46')]({'where':_0xd2b281,'attributes':['id',_0x14e8('0x4b'),_0x14e8('0x4c')],'raw':!![]})[_0x14e8('0x23')](handleEntityNotFound(_0x4d91df,null))[_0x14e8('0x23')](function(_0x5686f6){if(_0x5686f6){var _0xff7f40=_0x5686f6[_0x14e8('0x4b')];var _0x2baf94=util[_0x14e8('0x4d')]('%s.cypher',_0xff7f40);if(fs[_0x14e8('0x4e')](_0x2baf94)){_0x55f9b0=!![];return _0x291fe2[_0x14e8('0x4f')](_0x2baf94,_0xff7f40,config[_0x14e8('0x50')][_0x14e8('0x51')])['then'](function(){return _0x5686f6;});}return _0x5686f6;}})[_0x14e8('0x23')](function(_0x45020b){if(_0x45020b){var _0x17e482=_0x45020b[_0x14e8('0x4b')];if(!fs[_0x14e8('0x4e')](_0x17e482)){throw new db[(_0x14e8('0x52'))][(_0x14e8('0x53'))](_0x14e8('0x54'));}if(_0x45020b['filename']){return _0x4d91df['download'](_0x17e482,_0x45020b[_0x14e8('0x4c')]+path[_0x14e8('0x55')](_0x17e482),function(){if(_0x55f9b0){fs[_0x14e8('0x56')](_0x17e482);}});}else{return _0x4d91df[_0x14e8('0x49')](_0x17e482,function(_0x3f0b2a){if(_0x55f9b0){fs['unlink'](_0x17e482);}});}}})['catch'](function(_0x4c49e5){if(_0x4c49e5[_0x14e8('0x57')]===_0x14e8('0x54')){_0x4d91df[_0x14e8('0x19')](0x194)['send'](_0x14e8('0x58'));}else{return handleError(_0x4d91df,null);}});}; \ No newline at end of file +var _0x5ec6=['attributes','fields','length','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','field','options','SquareRecording','includeAll','include','findAll','rows','catch','params','merge','find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection'];(function(_0x190e03,_0x2b861a){var _0x3cca82=function(_0x91a386){while(--_0x91a386){_0x190e03['push'](_0x190e03['shift']());}};_0x3cca82(++_0x2b861a);}(_0x5ec6,0x7f));var _0x65ec=function(_0x197d21,_0x481fcb){_0x197d21=_0x197d21-0x0;var _0x5b9aba=_0x5ec6[_0x197d21];return _0x5b9aba;};'use strict';var pdf=require(_0x65ec('0x0'));var emlformat=require(_0x65ec('0x1'));var rimraf=require(_0x65ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ec('0x3'));var rp=require('request-promise');var moment=require(_0x65ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65ec('0x5'));var util=require('util');var path=require(_0x65ec('0x6'));var sox=require('sox');var csv=require(_0x65ec('0x7'));var ejs=require(_0x65ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0x7'));var querystring=require(_0x65ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x65ec('0xe'));var logger=require(_0x65ec('0xf'))('api');var utils=require(_0x65ec('0x10'));var config=require(_0x65ec('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f87a,_0x45cfb0){_0x45cfb0=_0x45cfb0||0xcc;return function(_0x53d62b){if(_0x53d62b){return _0x43f87a[_0x65ec('0x12')](_0x45cfb0);}return _0x43f87a[_0x65ec('0x13')](_0x45cfb0)[_0x65ec('0x14')]();};}function respondWithResult(_0x2b1c1a,_0x2c8314){_0x2c8314=_0x2c8314||0xc8;return function(_0x434e20){if(_0x434e20){return _0x2b1c1a[_0x65ec('0x13')](_0x2c8314)[_0x65ec('0x15')](_0x434e20);}};}function respondWithFilteredResult(_0x58c81f,_0x28be8b){return function(_0x3ed6f7){if(_0x3ed6f7){var _0x35d06b=_0x3ed6f7[_0x65ec('0x16')],_0x4bbe88=_0x28be8b[_0x65ec('0x17')],_0x5a0442=_0x28be8b['offset']+_0x28be8b[_0x65ec('0x18')],_0x25cdd4;if(_0x5a0442>=_0x35d06b){_0x5a0442=_0x35d06b;_0x25cdd4=0xc8;}else{_0x25cdd4=0xce;}_0x58c81f[_0x65ec('0x13')](_0x25cdd4);return _0x58c81f[_0x65ec('0x19')](_0x65ec('0x1a'),_0x4bbe88+'-'+_0x5a0442+'/'+_0x35d06b)[_0x65ec('0x15')](_0x3ed6f7);}return null;};}function patchUpdates(_0xd81ed3){return function(_0x37c494){try{jsonpatch[_0x65ec('0x1b')](_0x37c494,_0xd81ed3,!![]);}catch(_0x2127e2){return BPromise[_0x65ec('0x1c')](_0x2127e2);}return _0x37c494[_0x65ec('0x1d')]();};}function saveUpdates(_0x3a8cef,_0x2e9b1d){return function(_0x1467ac){if(_0x1467ac){return _0x1467ac[_0x65ec('0x1e')](_0x3a8cef)[_0x65ec('0x1f')](function(_0x15d4eb){return _0x15d4eb;});}return null;};}function removeEntity(_0x130d4e,_0x1326cc){return function(_0x4ff93c){if(_0x4ff93c){return _0x4ff93c[_0x65ec('0x20')]()[_0x65ec('0x1f')](function(){_0x130d4e[_0x65ec('0x13')](0xcc)[_0x65ec('0x14')]();});}};}function handleEntityNotFound(_0x1d60fb,_0x163e55){return function(_0x47288d){if(!_0x47288d){_0x1d60fb['sendStatus'](0x194);}return _0x47288d;};}function handleError(_0xf1ff97,_0xd598d2){_0xd598d2=_0xd598d2||0x1f4;return function(_0x13ac27){logger[_0x65ec('0x21')](_0x13ac27[_0x65ec('0x22')]);if(_0x13ac27[_0x65ec('0x23')]){delete _0x13ac27[_0x65ec('0x23')];}_0xf1ff97[_0x65ec('0x13')](_0xd598d2)[_0x65ec('0x24')](_0x13ac27);};}exports['index']=function(_0x10baef,_0x30f0cf){var _0x251831={},_0x23b1a3={},_0x4de451={'count':0x0,'rows':[]};var _0x3f98c9=db['SquareRecording'][_0x65ec('0x25')];_0x23b1a3[_0x65ec('0x26')]=_[_0x65ec('0x27')](_0x3f98c9);_0x23b1a3[_0x65ec('0x28')]=_[_0x65ec('0x27')](_0x10baef[_0x65ec('0x28')]);_0x23b1a3[_0x65ec('0x29')]=_[_0x65ec('0x2a')](_0x23b1a3[_0x65ec('0x26')],_0x23b1a3[_0x65ec('0x28')]);_0x251831[_0x65ec('0x2b')]=_['intersection'](_0x23b1a3['model'],qs[_0x65ec('0x2c')](_0x10baef['query'][_0x65ec('0x2c')]));_0x251831[_0x65ec('0x2b')]=_0x251831['attributes'][_0x65ec('0x2d')]?_0x251831[_0x65ec('0x2b')]:_0x23b1a3[_0x65ec('0x26')];if(!_0x10baef[_0x65ec('0x28')]['hasOwnProperty'](_0x65ec('0x2e'))){_0x251831[_0x65ec('0x18')]=qs[_0x65ec('0x18')](_0x10baef[_0x65ec('0x28')][_0x65ec('0x18')]);_0x251831[_0x65ec('0x17')]=qs[_0x65ec('0x17')](_0x10baef[_0x65ec('0x28')][_0x65ec('0x17')]);}_0x251831[_0x65ec('0x2f')]=qs['sort'](_0x10baef[_0x65ec('0x28')][_0x65ec('0x30')]);_0x251831['where']=qs[_0x65ec('0x29')](_[_0x65ec('0x31')](_0x10baef[_0x65ec('0x28')],_0x23b1a3[_0x65ec('0x29')]));if(_0x10baef[_0x65ec('0x28')][_0x65ec('0x32')]){_0x251831[_0x65ec('0x33')]=_['merge'](_0x251831[_0x65ec('0x33')],{'$or':_[_0x65ec('0x34')](_0x3f98c9,function(_0x40efca){if(_0x40efca[_0x65ec('0x35')]['key']!==_0x65ec('0x36')){var _0xaa4b9d={};_0xaa4b9d[_0x40efca[_0x65ec('0x37')]]={'$like':'%'+_0x10baef[_0x65ec('0x28')]['filter']+'%'};return _0xaa4b9d;}})});}_0x251831=_['merge']({},_0x251831,_0x10baef[_0x65ec('0x38')]);var _0x5cfe58={'where':_0x251831[_0x65ec('0x33')]};return db[_0x65ec('0x39')]['count'](_0x5cfe58)[_0x65ec('0x1f')](function(_0x1fbc2b){_0x4de451[_0x65ec('0x16')]=_0x1fbc2b;if(_0x10baef[_0x65ec('0x28')][_0x65ec('0x3a')]){_0x251831[_0x65ec('0x3b')]=[{'all':!![]}];}return db[_0x65ec('0x39')][_0x65ec('0x3c')](_0x251831);})[_0x65ec('0x1f')](function(_0x2ce56f){_0x4de451[_0x65ec('0x3d')]=_0x2ce56f;return _0x4de451;})['then'](respondWithFilteredResult(_0x30f0cf,_0x251831))[_0x65ec('0x3e')](handleError(_0x30f0cf,null));};exports['show']=function(_0x2654b2,_0x278d43){var _0x218e3f={'raw':!![],'where':{'id':_0x2654b2[_0x65ec('0x3f')]['id']}},_0x1bfc44={};_0x1bfc44[_0x65ec('0x26')]=_['keys'](db[_0x65ec('0x39')]['rawAttributes']);_0x1bfc44['query']=_[_0x65ec('0x27')](_0x2654b2[_0x65ec('0x28')]);_0x1bfc44[_0x65ec('0x29')]=_[_0x65ec('0x2a')](_0x1bfc44[_0x65ec('0x26')],_0x1bfc44['query']);_0x218e3f['attributes']=_[_0x65ec('0x2a')](_0x1bfc44[_0x65ec('0x26')],qs[_0x65ec('0x2c')](_0x2654b2[_0x65ec('0x28')][_0x65ec('0x2c')]));_0x218e3f['attributes']=_0x218e3f['attributes'][_0x65ec('0x2d')]?_0x218e3f[_0x65ec('0x2b')]:_0x1bfc44[_0x65ec('0x26')];if(_0x2654b2[_0x65ec('0x28')][_0x65ec('0x3a')]){_0x218e3f[_0x65ec('0x3b')]=[{'all':!![]}];}_0x218e3f=_[_0x65ec('0x40')]({},_0x218e3f,_0x2654b2['options']);return db[_0x65ec('0x39')][_0x65ec('0x41')](_0x218e3f)[_0x65ec('0x1f')](handleEntityNotFound(_0x278d43,null))['then'](respondWithResult(_0x278d43,null))[_0x65ec('0x3e')](handleError(_0x278d43,null));};exports[_0x65ec('0x42')]=function(_0x549c82,_0x11fa5f){return db[_0x65ec('0x39')][_0x65ec('0x42')](_0x549c82[_0x65ec('0x43')],{})[_0x65ec('0x1f')](respondWithResult(_0x11fa5f,0xc9))['catch'](handleError(_0x11fa5f,null));};exports[_0x65ec('0x1e')]=function(_0x3a5d81,_0x83305e){if(_0x3a5d81[_0x65ec('0x43')]['id']){delete _0x3a5d81['body']['id'];}return db[_0x65ec('0x39')]['find']({'where':{'id':_0x3a5d81[_0x65ec('0x3f')]['id']}})[_0x65ec('0x1f')](handleEntityNotFound(_0x83305e,null))[_0x65ec('0x1f')](saveUpdates(_0x3a5d81['body'],null))['then'](respondWithResult(_0x83305e,null))[_0x65ec('0x3e')](handleError(_0x83305e,null));};exports[_0x65ec('0x20')]=function(_0xf5419,_0x2111af){return db[_0x65ec('0x39')][_0x65ec('0x41')]({'where':{'id':_0xf5419[_0x65ec('0x3f')]['id']}})[_0x65ec('0x1f')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x1f')](removeEntity(_0x2111af,null))[_0x65ec('0x3e')](handleError(_0x2111af,null));};exports[_0x65ec('0x44')]=function(_0x4058e4,_0x2150bc,_0x308209){var _0x11d2d6=require(_0x65ec('0x45'));var _0x22c28c=![];var _0x5eb6d3={};if(_0x4058e4[_0x65ec('0x28')][_0x65ec('0x35')]&&_0x4058e4['query'][_0x65ec('0x35')]===_0x65ec('0x46')){_0x5eb6d3[_0x65ec('0x46')]=_0x4058e4['params']['id'];}else{_0x5eb6d3['id']=_0x4058e4[_0x65ec('0x3f')]['id'];}return db[_0x65ec('0x39')][_0x65ec('0x41')]({'where':_0x5eb6d3,'attributes':['id','savePath',_0x65ec('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x2150bc,null))['then'](function(_0x2b2af6){if(_0x2b2af6){var _0x8d0bae=_0x2b2af6[_0x65ec('0x48')];var _0x5cb107=util[_0x65ec('0x49')](_0x65ec('0x4a'),_0x8d0bae);if(fs[_0x65ec('0x4b')](_0x5cb107)){_0x22c28c=!![];return _0x11d2d6[_0x65ec('0x4c')](_0x5cb107,_0x8d0bae,config[_0x65ec('0x4d')][_0x65ec('0x4e')])[_0x65ec('0x1f')](function(){return _0x2b2af6;});}return _0x2b2af6;}})[_0x65ec('0x1f')](function(_0x462ed5){if(_0x462ed5){var _0x4b7658=_0x462ed5['savePath'];if(!fs[_0x65ec('0x4b')](_0x4b7658)){throw new db['Sequelize'][(_0x65ec('0x4f'))]('SquareRecording\x20not\x20found');}if(_0x462ed5[_0x65ec('0x47')]){return _0x2150bc[_0x65ec('0x44')](_0x4b7658,_0x462ed5[_0x65ec('0x47')]+path[_0x65ec('0x50')](_0x4b7658),function(){if(_0x22c28c){fs[_0x65ec('0x51')](_0x4b7658);}});}else{return _0x2150bc[_0x65ec('0x44')](_0x4b7658,function(_0x355c4c){if(_0x22c28c){fs['unlink'](_0x4b7658);}});}}})[_0x65ec('0x3e')](function(_0x474bc0){if(_0x474bc0[_0x65ec('0x52')]===_0x65ec('0x53')){_0x2150bc[_0x65ec('0x13')](0x194)['send'](_0x65ec('0x54'));}else{return handleError(_0x2150bc,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0bc24dc..77a582c 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 _0x943a=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','SquareRecording'];(function(_0x30ec42,_0x3639e1){var _0x2d8415=function(_0x4dcb3c){while(--_0x4dcb3c){_0x30ec42['push'](_0x30ec42['shift']());}};_0x2d8415(++_0x3639e1);}(_0x943a,0x1c9));var _0xa943=function(_0x5f5632,_0x3cba31){_0x5f5632=_0x5f5632-0x0;var _0x3c00f0=_0x943a[_0x5f5632];return _0x3c00f0;};'use strict';var _=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var logger=require(_0xa943('0x2'))(_0xa943('0x3'));var moment=require(_0xa943('0x4'));var BPromise=require(_0xa943('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa943('0x6'));var rimraf=require(_0xa943('0x7'));var config=require(_0xa943('0x8'));var attributes=require('./squareRecording.attributes');module[_0xa943('0x9')]=function(_0xd66edf,_0x3d2ac3){return _0xd66edf['define'](_0xa943('0xa'),attributes,{'tableName':_0xa943('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dda=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','../../config/logger','moment'];(function(_0x1a5c5f,_0x38f990){var _0x589676=function(_0x5814a6){while(--_0x5814a6){_0x1a5c5f['push'](_0x1a5c5f['shift']());}};_0x589676(++_0x38f990);}(_0x6dda,0x80));var _0xa6dd=function(_0x510ee2,_0x3b9cfa){_0x510ee2=_0x510ee2-0x0;var _0x19ba14=_0x6dda[_0x510ee2];return _0x19ba14;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6dd('0x0'))('api');var moment=require(_0xa6dd('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6dd('0x2'));var rimraf=require(_0xa6dd('0x3'));var config=require(_0xa6dd('0x4'));var attributes=require(_0xa6dd('0x5'));module[_0xa6dd('0x6')]=function(_0x314f6e,_0x530edc){return _0x314f6e[_0xa6dd('0x7')](_0xa6dd('0x8'),attributes,{'tableName':_0xa6dd('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 6ddfdc2..19d1cba 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 _0xe3f2=['stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x453424,_0x1ea996){var _0x96ddad=function(_0x68f1a3){while(--_0x68f1a3){_0x453424['push'](_0x453424['shift']());}};_0x96ddad(++_0x1ea996);}(_0xe3f2,0x1b0));var _0x2e3f=function(_0xfbd83a,_0x433eea){_0xfbd83a=_0xfbd83a-0x0;var _0x3729ad=_0xe3f2[_0xfbd83a];return _0x3729ad;};'use strict';var _=require(_0x2e3f('0x0'));var util=require(_0x2e3f('0x1'));var moment=require(_0x2e3f('0x2'));var BPromise=require(_0x2e3f('0x3'));var rs=require(_0x2e3f('0x4'));var fs=require('fs');var Redis=require(_0x2e3f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e3f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2e3f('0x7'));var client=jayson[_0x2e3f('0x8')][_0x2e3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a9ff,_0x15c394,_0x325ec9){return new BPromise(function(_0x2e746b,_0x57c0e2){return client['request'](_0x14a9ff,_0x325ec9)[_0x2e3f('0xa')](function(_0x5ab5df){logger[_0x2e3f('0xb')](_0x2e3f('0xc'),_0x15c394,_0x2e3f('0xd'));logger[_0x2e3f('0xe')](_0x2e3f('0xf'),_0x15c394,_0x2e3f('0xd'),JSON[_0x2e3f('0x10')](_0x5ab5df));if(_0x5ab5df['error']){if(_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x12')]===0x1f4){logger[_0x2e3f('0x11')](_0x2e3f('0xc'),_0x15c394,_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);return _0x57c0e2(_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);}logger[_0x2e3f('0x11')](_0x2e3f('0xc'),_0x15c394,_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);return _0x2e746b(_0x5ab5df['error']['message']);}else{logger[_0x2e3f('0xb')](_0x2e3f('0xc'),_0x15c394,_0x2e3f('0xd'));_0x2e746b(_0x5ab5df[_0x2e3f('0x14')][_0x2e3f('0x13')]);}})[_0x2e3f('0x15')](function(_0x20b61a){logger[_0x2e3f('0x11')]('SquareRecording,\x20%s,\x20%s',_0x15c394,_0x20b61a);_0x57c0e2(_0x20b61a);});});}exports[_0x2e3f('0x16')]=function(_0xf0a0a6){var _0x462dc9=this;return new Promise(function(_0x56c6e7,_0x285944){return db[_0x2e3f('0x17')][_0x2e3f('0x18')](_0xf0a0a6[_0x2e3f('0x19')],{'raw':_0xf0a0a6[_0x2e3f('0x1a')]?_0xf0a0a6[_0x2e3f('0x1a')][_0x2e3f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42b3f8){logger[_0x2e3f('0xb')](_0x2e3f('0x16'),_0xf0a0a6);logger[_0x2e3f('0xe')](_0x2e3f('0x16'),_0xf0a0a6,JSON[_0x2e3f('0x10')](_0x42b3f8));_0x56c6e7(_0x42b3f8);})['catch'](function(_0x9fbda7){logger['error'](_0x2e3f('0x16'),_0x9fbda7[_0x2e3f('0x13')],_0xf0a0a6);_0x285944(_0x462dc9[_0x2e3f('0x11')](0x1f4,_0x9fbda7[_0x2e3f('0x13')]));});});}; \ No newline at end of file +var _0x2e9f=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareRecording,\x20%s,\x20%s','catch','CreateSquareRecording','create','body','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e9f,0x6e));var _0xf2e9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2e9f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf2e9('0x0'));var BPromise=require(_0xf2e9('0x1'));var rs=require(_0xf2e9('0x2'));var fs=require('fs');var Redis=require(_0xf2e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2e9('0x4'));var logger=require('../../config/logger')(_0xf2e9('0x5'));var config=require(_0xf2e9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf2e9('0x7')][_0xf2e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33484a,_0x9577be,_0x5f2dd0){return new BPromise(function(_0x37a68f,_0x50133f){return client['request'](_0x33484a,_0x5f2dd0)['then'](function(_0x1a8054){logger[_0xf2e9('0x9')]('SquareRecording,\x20%s,\x20%s',_0x9577be,_0xf2e9('0xa'));logger[_0xf2e9('0xb')](_0xf2e9('0xc'),_0x9577be,_0xf2e9('0xa'),JSON[_0xf2e9('0xd')](_0x1a8054));if(_0x1a8054['error']){if(_0x1a8054['error']['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x9577be,_0x1a8054[_0xf2e9('0xe')]['message']);return _0x50133f(_0x1a8054[_0xf2e9('0xe')][_0xf2e9('0xf')]);}logger[_0xf2e9('0xe')](_0xf2e9('0x10'),_0x9577be,_0x1a8054['error'][_0xf2e9('0xf')]);return _0x37a68f(_0x1a8054[_0xf2e9('0xe')][_0xf2e9('0xf')]);}else{logger[_0xf2e9('0x9')](_0xf2e9('0x10'),_0x9577be,_0xf2e9('0xa'));_0x37a68f(_0x1a8054['result']['message']);}})[_0xf2e9('0x11')](function(_0x1ee2af){logger[_0xf2e9('0xe')](_0xf2e9('0x10'),_0x9577be,_0x1ee2af);_0x50133f(_0x1ee2af);});});}exports[_0xf2e9('0x12')]=function(_0x4147cf){var _0x3c283a=this;return new Promise(function(_0x28fc5a,_0x9ca7c4){return db['SquareRecording'][_0xf2e9('0x13')](_0x4147cf[_0xf2e9('0x14')],{'raw':_0x4147cf[_0xf2e9('0x15')]?_0x4147cf[_0xf2e9('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c8a15){logger[_0xf2e9('0x9')](_0xf2e9('0x12'),_0x4147cf);logger[_0xf2e9('0xb')](_0xf2e9('0x12'),_0x4147cf,JSON[_0xf2e9('0xd')](_0x1c8a15));_0x28fc5a(_0x1c8a15);})[_0xf2e9('0x11')](function(_0x117778){logger[_0xf2e9('0xe')](_0xf2e9('0x12'),_0x117778['message'],_0x4147cf);_0x9ca7c4(_0x3c283a[_0xf2e9('0xe')](0x1f4,_0x117778[_0xf2e9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b4d14bd..dbb5f70 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 _0xf76d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','describe','/:id','isAuthenticated','post','create','destroy','exports','multer'];(function(_0x501ab8,_0x4cfecd){var _0x3527c5=function(_0x5dc4f5){while(--_0x5dc4f5){_0x501ab8['push'](_0x501ab8['shift']());}};_0x3527c5(++_0x4cfecd);}(_0xf76d,0x164));var _0xdf76=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xf76d[_0x1b64dd];return _0xeb464c;};'use strict';var multer=require(_0xdf76('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf76('0x1'));var express=require(_0xdf76('0x2'));var router=express[_0xdf76('0x3')]();var auth=require(_0xdf76('0x4'));var interaction=require(_0xdf76('0x5'));var config=require(_0xdf76('0x6'));var controller=require(_0xdf76('0x7'));router[_0xdf76('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf76('0x9')]);router[_0xdf76('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xdf76('0xa')]);router[_0xdf76('0x8')](_0xdf76('0xb'),auth[_0xdf76('0xc')](),controller['show']);router[_0xdf76('0xd')]('/',auth[_0xdf76('0xc')](),controller[_0xdf76('0xe')]);router['put'](_0xdf76('0xb'),auth[_0xdf76('0xc')](),controller['update']);router['delete'](_0xdf76('0xb'),auth['isAuthenticated'](),controller[_0xdf76('0xf')]);module[_0xdf76('0x10')]=router; \ No newline at end of file +var _0x1c9c=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','/describe','isAuthenticated','show','post','put','/:id','delete'];(function(_0x568591,_0x12546f){var _0x37865c=function(_0x186a5d){while(--_0x186a5d){_0x568591['push'](_0x568591['shift']());}};_0x37865c(++_0x12546f);}(_0x1c9c,0xe6));var _0xc1c9=function(_0x257e65,_0x3f4a68){_0x257e65=_0x257e65-0x0;var _0x3eef2f=_0x1c9c[_0x257e65];return _0x3eef2f;};'use strict';var multer=require(_0xc1c9('0x0'));var util=require(_0xc1c9('0x1'));var path=require(_0xc1c9('0x2'));var timeout=require(_0xc1c9('0x3'));var express=require('express');var router=express[_0xc1c9('0x4')]();var auth=require(_0xc1c9('0x5'));var interaction=require(_0xc1c9('0x6'));var config=require(_0xc1c9('0x7'));var controller=require(_0xc1c9('0x8'));router[_0xc1c9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1c9('0x9')](_0xc1c9('0xa'),auth[_0xc1c9('0xb')](),controller['describe']);router['get']('/:id',auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xc')]);router[_0xc1c9('0xd')]('/',auth[_0xc1c9('0xb')](),controller['create']);router[_0xc1c9('0xe')](_0xc1c9('0xf'),auth[_0xc1c9('0xb')](),controller['update']);router[_0xc1c9('0x10')](_0xc1c9('0xf'),auth[_0xc1c9('0xb')](),controller[_0xc1c9('0x11')]);module[_0xc1c9('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 e325e63..789007d 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 _0xe13e=['STRING','DATE'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xee13('0x0')]},'network_script':{'type':Sequelize[_0xee13('0x0')]},'request':{'type':Sequelize[_0xee13('0x0')]},'channel':{'type':Sequelize[_0xee13('0x0')]},'language':{'type':Sequelize[_0xee13('0x0')]},'type':{'type':Sequelize[_0xee13('0x0')]},'uniqueid':{'type':Sequelize[_0xee13('0x0')]},'version':{'type':Sequelize[_0xee13('0x0')]},'callerid':{'type':Sequelize[_0xee13('0x0')]},'calleridname':{'type':Sequelize[_0xee13('0x0')]},'callingpres':{'type':Sequelize[_0xee13('0x0')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xee13('0x0')]},'callingtns':{'type':Sequelize[_0xee13('0x0')]},'dnid':{'type':Sequelize[_0xee13('0x0')]},'rdnis':{'type':Sequelize[_0xee13('0x0')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xee13('0x0')]},'priority':{'type':Sequelize[_0xee13('0x0')]},'enhanced':{'type':Sequelize[_0xee13('0x0')]},'accountcode':{'type':Sequelize[_0xee13('0x0')]},'threadid':{'type':Sequelize[_0xee13('0x0')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xee13('0x1')]},'leaveAt':{'type':Sequelize[_0xee13('0x1')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0884=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4088('0x0'));module[_0x4088('0x1')]={'network':{'type':Sequelize[_0x4088('0x2')]},'network_script':{'type':Sequelize[_0x4088('0x2')]},'request':{'type':Sequelize[_0x4088('0x2')]},'channel':{'type':Sequelize[_0x4088('0x2')]},'language':{'type':Sequelize[_0x4088('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4088('0x2')]},'version':{'type':Sequelize[_0x4088('0x2')]},'callerid':{'type':Sequelize[_0x4088('0x2')]},'calleridname':{'type':Sequelize[_0x4088('0x2')]},'callingpres':{'type':Sequelize[_0x4088('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x4088('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x4088('0x2')]},'context':{'type':Sequelize[_0x4088('0x2')]},'extension':{'type':Sequelize[_0x4088('0x2')]},'priority':{'type':Sequelize[_0x4088('0x2')]},'enhanced':{'type':Sequelize[_0x4088('0x2')]},'accountcode':{'type':Sequelize[_0x4088('0x2')]},'threadid':{'type':Sequelize[_0x4088('0x2')]},'project_name':{'type':Sequelize[_0x4088('0x2')]},'joinAt':{'type':Sequelize[_0x4088('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4088('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 f7ab05e..d77c984 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 _0x48a0=['intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','include','rows','params','length','includeAll','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SquareReport','rawAttributes','model','keys','filters'];(function(_0x2ffd40,_0x66e6e){var _0x2d13b2=function(_0x4db30b){while(--_0x4db30b){_0x2ffd40['push'](_0x2ffd40['shift']());}};_0x2d13b2(++_0x66e6e);}(_0x48a0,0xac));var _0x048a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x48a0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x048a('0x0'));var emlformat=require(_0x048a('0x1'));var rimraf=require(_0x048a('0x2'));var zipdir=require(_0x048a('0x3'));var jsonpatch=require(_0x048a('0x4'));var rp=require(_0x048a('0x5'));var moment=require(_0x048a('0x6'));var BPromise=require(_0x048a('0x7'));var Mustache=require('mustache');var util=require(_0x048a('0x8'));var path=require(_0x048a('0x9'));var sox=require(_0x048a('0xa'));var csv=require(_0x048a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x048a('0xc'));var crypto=require(_0x048a('0xd'));var jsforce=require(_0x048a('0xe'));var deskjs=require(_0x048a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x048a('0x10'));var Redis=require('ioredis');var authService=require(_0x048a('0x11'));var qs=require(_0x048a('0x12'));var hardwareService=require(_0x048a('0x13'));var logger=require('../../config/logger')(_0x048a('0x14'));var utils=require('../../config/utils');var config=require(_0x048a('0x15'));var db=require(_0x048a('0x16'))['db'];function respondWithStatusCode(_0x454368,_0xa42781){_0xa42781=_0xa42781||0xcc;return function(_0xc7780c){if(_0xc7780c){return _0x454368[_0x048a('0x17')](_0xa42781);}return _0x454368[_0x048a('0x18')](_0xa42781)[_0x048a('0x19')]();};}function respondWithResult(_0x26ec91,_0x1f4700){_0x1f4700=_0x1f4700||0xc8;return function(_0x42fcdd){if(_0x42fcdd){return _0x26ec91[_0x048a('0x18')](_0x1f4700)[_0x048a('0x1a')](_0x42fcdd);}};}function respondWithFilteredResult(_0x3ddcba,_0x34bea3){return function(_0x257bea){if(_0x257bea){var _0x2ab916=_0x257bea[_0x048a('0x1b')],_0x26a145=_0x34bea3[_0x048a('0x1c')],_0x46814b=_0x34bea3['offset']+_0x34bea3[_0x048a('0x1d')],_0x46e489;if(_0x46814b>=_0x2ab916){_0x46814b=_0x2ab916;_0x46e489=0xc8;}else{_0x46e489=0xce;}_0x3ddcba['status'](_0x46e489);return _0x3ddcba[_0x048a('0x1e')](_0x048a('0x1f'),_0x26a145+'-'+_0x46814b+'/'+_0x2ab916)[_0x048a('0x1a')](_0x257bea);}return null;};}function patchUpdates(_0x47345d){return function(_0x49b64a){try{jsonpatch[_0x048a('0x20')](_0x49b64a,_0x47345d,!![]);}catch(_0x235c8d){return BPromise[_0x048a('0x21')](_0x235c8d);}return _0x49b64a[_0x048a('0x22')]();};}function saveUpdates(_0x36c348,_0x2a1b8f){return function(_0x388bc2){if(_0x388bc2){return _0x388bc2[_0x048a('0x23')](_0x36c348)[_0x048a('0x24')](function(_0x4c22a9){return _0x4c22a9;});}return null;};}function removeEntity(_0x17f20b,_0x57ff1e){return function(_0x2905f8){if(_0x2905f8){return _0x2905f8[_0x048a('0x25')]()[_0x048a('0x24')](function(){_0x17f20b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2193ac,_0x37fea5){return function(_0x5cce36){if(!_0x5cce36){_0x2193ac['sendStatus'](0x194);}return _0x5cce36;};}function handleError(_0x53304a,_0x3bf2c0){_0x3bf2c0=_0x3bf2c0||0x1f4;return function(_0xc1258b){logger[_0x048a('0x26')](_0xc1258b[_0x048a('0x27')]);if(_0xc1258b[_0x048a('0x28')]){delete _0xc1258b[_0x048a('0x28')];}_0x53304a['status'](_0x3bf2c0)[_0x048a('0x29')](_0xc1258b);};}exports['index']=function(_0x5b69ea,_0x4bd3a0){var _0x4860e9={},_0x53c32f={},_0x14ed93={'count':0x0,'rows':[]};var _0x11413d=db[_0x048a('0x2a')][_0x048a('0x2b')];_0x53c32f[_0x048a('0x2c')]=_[_0x048a('0x2d')](_0x11413d);_0x53c32f['query']=_[_0x048a('0x2d')](_0x5b69ea['query']);_0x53c32f[_0x048a('0x2e')]=_[_0x048a('0x2f')](_0x53c32f[_0x048a('0x2c')],_0x53c32f[_0x048a('0x30')]);_0x4860e9[_0x048a('0x31')]=_[_0x048a('0x2f')](_0x53c32f[_0x048a('0x2c')],qs['fields'](_0x5b69ea[_0x048a('0x30')][_0x048a('0x32')]));_0x4860e9[_0x048a('0x31')]=_0x4860e9[_0x048a('0x31')]['length']?_0x4860e9['attributes']:_0x53c32f[_0x048a('0x2c')];if(!_0x5b69ea[_0x048a('0x30')][_0x048a('0x33')](_0x048a('0x34'))){_0x4860e9[_0x048a('0x1d')]=qs[_0x048a('0x1d')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x1d')]);_0x4860e9[_0x048a('0x1c')]=qs[_0x048a('0x1c')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x1c')]);}_0x4860e9[_0x048a('0x35')]=qs[_0x048a('0x36')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x36')]);_0x4860e9[_0x048a('0x37')]=qs['filters'](_[_0x048a('0x38')](_0x5b69ea[_0x048a('0x30')],_0x53c32f[_0x048a('0x2e')]));if(_0x5b69ea[_0x048a('0x30')][_0x048a('0x39')]){_0x4860e9[_0x048a('0x37')]=_[_0x048a('0x3a')](_0x4860e9[_0x048a('0x37')],{'$or':_[_0x048a('0x3b')](_0x11413d,function(_0x2797e6){if(_0x2797e6['type']['key']!==_0x048a('0x3c')){var _0x38f6a1={};_0x38f6a1[_0x2797e6[_0x048a('0x3d')]]={'$like':'%'+_0x5b69ea[_0x048a('0x30')][_0x048a('0x39')]+'%'};return _0x38f6a1;}})});}_0x4860e9=_[_0x048a('0x3a')]({},_0x4860e9,_0x5b69ea[_0x048a('0x3e')]);var _0xab490a={'where':_0x4860e9[_0x048a('0x37')]};return db[_0x048a('0x2a')]['count'](_0xab490a)[_0x048a('0x24')](function(_0x1928ec){_0x14ed93[_0x048a('0x1b')]=_0x1928ec;if(_0x5b69ea[_0x048a('0x30')]['includeAll']){_0x4860e9[_0x048a('0x3f')]=[{'all':!![]}];}return db[_0x048a('0x2a')]['findAll'](_0x4860e9);})['then'](function(_0x2f1869){_0x14ed93[_0x048a('0x40')]=_0x2f1869;return _0x14ed93;})['then'](respondWithFilteredResult(_0x4bd3a0,_0x4860e9))['catch'](handleError(_0x4bd3a0,null));};exports['show']=function(_0x213099,_0x2920f1){var _0x49c147={'raw':!![],'where':{'id':_0x213099[_0x048a('0x41')]['id']}},_0x3a4488={};_0x3a4488[_0x048a('0x2c')]=_[_0x048a('0x2d')](db[_0x048a('0x2a')][_0x048a('0x2b')]);_0x3a4488[_0x048a('0x30')]=_[_0x048a('0x2d')](_0x213099['query']);_0x3a4488[_0x048a('0x2e')]=_[_0x048a('0x2f')](_0x3a4488[_0x048a('0x2c')],_0x3a4488['query']);_0x49c147[_0x048a('0x31')]=_[_0x048a('0x2f')](_0x3a4488[_0x048a('0x2c')],qs[_0x048a('0x32')](_0x213099[_0x048a('0x30')][_0x048a('0x32')]));_0x49c147[_0x048a('0x31')]=_0x49c147['attributes'][_0x048a('0x42')]?_0x49c147[_0x048a('0x31')]:_0x3a4488[_0x048a('0x2c')];if(_0x213099['query'][_0x048a('0x43')]){_0x49c147[_0x048a('0x3f')]=[{'all':!![]}];}_0x49c147=_[_0x048a('0x3a')]({},_0x49c147,_0x213099[_0x048a('0x3e')]);return db['SquareReport'][_0x048a('0x44')](_0x49c147)[_0x048a('0x24')](handleEntityNotFound(_0x2920f1,null))[_0x048a('0x24')](respondWithResult(_0x2920f1,null))[_0x048a('0x45')](handleError(_0x2920f1,null));};exports[_0x048a('0x46')]=function(_0x4129ab,_0x36ec66){return db[_0x048a('0x2a')][_0x048a('0x46')](_0x4129ab[_0x048a('0x47')],{})[_0x048a('0x24')](respondWithResult(_0x36ec66,0xc9))['catch'](handleError(_0x36ec66,null));};exports[_0x048a('0x23')]=function(_0x3ad95f,_0x457230){if(_0x3ad95f['body']['id']){delete _0x3ad95f[_0x048a('0x47')]['id'];}return db[_0x048a('0x2a')][_0x048a('0x44')]({'where':{'id':_0x3ad95f['params']['id']}})[_0x048a('0x24')](handleEntityNotFound(_0x457230,null))['then'](saveUpdates(_0x3ad95f[_0x048a('0x47')],null))[_0x048a('0x24')](respondWithResult(_0x457230,null))[_0x048a('0x45')](handleError(_0x457230,null));};exports[_0x048a('0x25')]=function(_0x2fd272,_0x2efa96){return db[_0x048a('0x2a')][_0x048a('0x44')]({'where':{'id':_0x2fd272[_0x048a('0x41')]['id']}})[_0x048a('0x24')](handleEntityNotFound(_0x2efa96,null))[_0x048a('0x24')](removeEntity(_0x2efa96,null))['catch'](handleError(_0x2efa96,null));};exports[_0x048a('0x48')]=function(_0x23a50a,_0x3c578d){return db['SquareReport']['describe']()['then'](respondWithResult(_0x3c578d,null))[_0x048a('0x45')](handleError(_0x3c578d,null));}; \ No newline at end of file +var _0xaa7a=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','error','stack','name','index','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','filter','map','type','key','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','html-pdf'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xaa7a,0x1db));var _0xaaa7=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xaa7a[_0xef4ef0];return _0x39b60b;};'use strict';var pdf=require(_0xaaa7('0x0'));var emlformat=require(_0xaaa7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaaa7('0x2'));var jsonpatch=require(_0xaaa7('0x3'));var rp=require(_0xaaa7('0x4'));var moment=require(_0xaaa7('0x5'));var BPromise=require(_0xaaa7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaaa7('0x7'));var sox=require(_0xaaa7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xaaa7('0x9'));var crypto=require(_0xaaa7('0xa'));var jsforce=require(_0xaaa7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaaa7('0xc'));var querystring=require(_0xaaa7('0xd'));var Papa=require(_0xaaa7('0xe'));var Redis=require(_0xaaa7('0xf'));var authService=require(_0xaaa7('0x10'));var qs=require(_0xaaa7('0x11'));var hardwareService=require(_0xaaa7('0x12'));var logger=require(_0xaaa7('0x13'))(_0xaaa7('0x14'));var utils=require(_0xaaa7('0x15'));var config=require(_0xaaa7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26cc96,_0xb3148d){_0xb3148d=_0xb3148d||0xcc;return function(_0x4d58ac){if(_0x4d58ac){return _0x26cc96[_0xaaa7('0x17')](_0xb3148d);}return _0x26cc96[_0xaaa7('0x18')](_0xb3148d)[_0xaaa7('0x19')]();};}function respondWithResult(_0x52737b,_0x572f49){_0x572f49=_0x572f49||0xc8;return function(_0x4e44c0){if(_0x4e44c0){return _0x52737b['status'](_0x572f49)[_0xaaa7('0x1a')](_0x4e44c0);}};}function respondWithFilteredResult(_0x1750cf,_0x57d19f){return function(_0x26a5c7){if(_0x26a5c7){var _0x47a9b9=_0x26a5c7[_0xaaa7('0x1b')],_0x2dbb9a=_0x57d19f[_0xaaa7('0x1c')],_0x42320f=_0x57d19f['offset']+_0x57d19f['limit'],_0x11b612;if(_0x42320f>=_0x47a9b9){_0x42320f=_0x47a9b9;_0x11b612=0xc8;}else{_0x11b612=0xce;}_0x1750cf[_0xaaa7('0x18')](_0x11b612);return _0x1750cf['set'](_0xaaa7('0x1d'),_0x2dbb9a+'-'+_0x42320f+'/'+_0x47a9b9)[_0xaaa7('0x1a')](_0x26a5c7);}return null;};}function patchUpdates(_0xc786d4){return function(_0x27de9e){try{jsonpatch[_0xaaa7('0x1e')](_0x27de9e,_0xc786d4,!![]);}catch(_0x1f617f){return BPromise['reject'](_0x1f617f);}return _0x27de9e['save']();};}function saveUpdates(_0x2fc63b,_0x32f496){return function(_0x29299f){if(_0x29299f){return _0x29299f[_0xaaa7('0x1f')](_0x2fc63b)['then'](function(_0x15c814){return _0x15c814;});}return null;};}function removeEntity(_0xce22a6,_0x167193){return function(_0x52e601){if(_0x52e601){return _0x52e601['destroy']()[_0xaaa7('0x20')](function(){_0xce22a6[_0xaaa7('0x18')](0xcc)[_0xaaa7('0x19')]();});}};}function handleEntityNotFound(_0x553923,_0x42f48d){return function(_0x5d5735){if(!_0x5d5735){_0x553923[_0xaaa7('0x17')](0x194);}return _0x5d5735;};}function handleError(_0x21592c,_0x15994d){_0x15994d=_0x15994d||0x1f4;return function(_0x1396e0){logger[_0xaaa7('0x21')](_0x1396e0[_0xaaa7('0x22')]);if(_0x1396e0[_0xaaa7('0x23')]){delete _0x1396e0[_0xaaa7('0x23')];}_0x21592c[_0xaaa7('0x18')](_0x15994d)['send'](_0x1396e0);};}exports[_0xaaa7('0x24')]=function(_0x31d31f,_0x19c22f){var _0x138890={},_0x21b4e7={},_0x1a2320={'count':0x0,'rows':[]};var _0x145c37=db[_0xaaa7('0x25')][_0xaaa7('0x26')];_0x21b4e7[_0xaaa7('0x27')]=_[_0xaaa7('0x28')](_0x145c37);_0x21b4e7[_0xaaa7('0x29')]=_[_0xaaa7('0x28')](_0x31d31f[_0xaaa7('0x29')]);_0x21b4e7[_0xaaa7('0x2a')]=_[_0xaaa7('0x2b')](_0x21b4e7[_0xaaa7('0x27')],_0x21b4e7['query']);_0x138890[_0xaaa7('0x2c')]=_[_0xaaa7('0x2b')](_0x21b4e7[_0xaaa7('0x27')],qs[_0xaaa7('0x2d')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x2d')]));_0x138890[_0xaaa7('0x2c')]=_0x138890[_0xaaa7('0x2c')][_0xaaa7('0x2e')]?_0x138890['attributes']:_0x21b4e7['model'];if(!_0x31d31f['query'][_0xaaa7('0x2f')]('nolimit')){_0x138890[_0xaaa7('0x30')]=qs[_0xaaa7('0x30')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x30')]);_0x138890['offset']=qs[_0xaaa7('0x1c')](_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x1c')]);}_0x138890[_0xaaa7('0x31')]=qs['sort'](_0x31d31f[_0xaaa7('0x29')]['sort']);_0x138890[_0xaaa7('0x32')]=qs['filters'](_['pick'](_0x31d31f[_0xaaa7('0x29')],_0x21b4e7[_0xaaa7('0x2a')]));if(_0x31d31f['query'][_0xaaa7('0x33')]){_0x138890[_0xaaa7('0x32')]=_['merge'](_0x138890['where'],{'$or':_[_0xaaa7('0x34')](_0x145c37,function(_0x22dfaf){if(_0x22dfaf[_0xaaa7('0x35')][_0xaaa7('0x36')]!=='VIRTUAL'){var _0x9717f2={};_0x9717f2[_0x22dfaf['field']]={'$like':'%'+_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x33')]+'%'};return _0x9717f2;}})});}_0x138890=_[_0xaaa7('0x37')]({},_0x138890,_0x31d31f[_0xaaa7('0x38')]);var _0x4ec28a={'where':_0x138890[_0xaaa7('0x32')]};return db['SquareReport'][_0xaaa7('0x1b')](_0x4ec28a)[_0xaaa7('0x20')](function(_0x3c2a1b){_0x1a2320[_0xaaa7('0x1b')]=_0x3c2a1b;if(_0x31d31f[_0xaaa7('0x29')][_0xaaa7('0x39')]){_0x138890[_0xaaa7('0x3a')]=[{'all':!![]}];}return db[_0xaaa7('0x25')][_0xaaa7('0x3b')](_0x138890);})[_0xaaa7('0x20')](function(_0x48c512){_0x1a2320[_0xaaa7('0x3c')]=_0x48c512;return _0x1a2320;})['then'](respondWithFilteredResult(_0x19c22f,_0x138890))[_0xaaa7('0x3d')](handleError(_0x19c22f,null));};exports['show']=function(_0x1bda94,_0x276cfc){var _0x50d915={'raw':!![],'where':{'id':_0x1bda94[_0xaaa7('0x3e')]['id']}},_0x4ef059={};_0x4ef059[_0xaaa7('0x27')]=_[_0xaaa7('0x28')](db[_0xaaa7('0x25')]['rawAttributes']);_0x4ef059[_0xaaa7('0x29')]=_[_0xaaa7('0x28')](_0x1bda94[_0xaaa7('0x29')]);_0x4ef059[_0xaaa7('0x2a')]=_[_0xaaa7('0x2b')](_0x4ef059[_0xaaa7('0x27')],_0x4ef059[_0xaaa7('0x29')]);_0x50d915['attributes']=_[_0xaaa7('0x2b')](_0x4ef059[_0xaaa7('0x27')],qs[_0xaaa7('0x2d')](_0x1bda94[_0xaaa7('0x29')][_0xaaa7('0x2d')]));_0x50d915[_0xaaa7('0x2c')]=_0x50d915['attributes'][_0xaaa7('0x2e')]?_0x50d915['attributes']:_0x4ef059[_0xaaa7('0x27')];if(_0x1bda94[_0xaaa7('0x29')][_0xaaa7('0x39')]){_0x50d915[_0xaaa7('0x3a')]=[{'all':!![]}];}_0x50d915=_['merge']({},_0x50d915,_0x1bda94[_0xaaa7('0x38')]);return db[_0xaaa7('0x25')][_0xaaa7('0x3f')](_0x50d915)[_0xaaa7('0x20')](handleEntityNotFound(_0x276cfc,null))[_0xaaa7('0x20')](respondWithResult(_0x276cfc,null))[_0xaaa7('0x3d')](handleError(_0x276cfc,null));};exports[_0xaaa7('0x40')]=function(_0x2c41ff,_0x6c5c6b){return db['SquareReport']['create'](_0x2c41ff[_0xaaa7('0x41')],{})[_0xaaa7('0x20')](respondWithResult(_0x6c5c6b,0xc9))['catch'](handleError(_0x6c5c6b,null));};exports[_0xaaa7('0x1f')]=function(_0x44eeab,_0x5deee5){if(_0x44eeab[_0xaaa7('0x41')]['id']){delete _0x44eeab['body']['id'];}return db[_0xaaa7('0x25')][_0xaaa7('0x3f')]({'where':{'id':_0x44eeab[_0xaaa7('0x3e')]['id']}})[_0xaaa7('0x20')](handleEntityNotFound(_0x5deee5,null))[_0xaaa7('0x20')](saveUpdates(_0x44eeab[_0xaaa7('0x41')],null))[_0xaaa7('0x20')](respondWithResult(_0x5deee5,null))[_0xaaa7('0x3d')](handleError(_0x5deee5,null));};exports[_0xaaa7('0x42')]=function(_0x3b2344,_0x557346){return db[_0xaaa7('0x25')][_0xaaa7('0x3f')]({'where':{'id':_0x3b2344[_0xaaa7('0x3e')]['id']}})[_0xaaa7('0x20')](handleEntityNotFound(_0x557346,null))[_0xaaa7('0x20')](removeEntity(_0x557346,null))['catch'](handleError(_0x557346,null));};exports[_0xaaa7('0x43')]=function(_0x3b0291,_0x9ea366){return db[_0xaaa7('0x25')]['describe']()['then'](respondWithResult(_0x9ea366,null))[_0xaaa7('0x3d')](handleError(_0x9ea366,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b8bbdf8..4b6b3b7 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 _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x3f406e,_0x84a1f8){var _0x3da112=function(_0x4f5644){while(--_0x4f5644){_0x3f406e['push'](_0x3f406e['shift']());}};_0x3da112(++_0x84a1f8);}(_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':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x5322f6,_0x517a5c){var _0x5d4125=function(_0x5494cd){while(--_0x5494cd){_0x5322f6['push'](_0x5322f6['shift']());}};_0x5d4125(++_0x517a5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d72baa9..4bc247f 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 _0x5a2a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','create','body','options','raw','then','UpdateSquareReport','SquareReport','where','attributes','limit'];(function(_0x1336fc,_0x5c10d6){var _0x25a6ef=function(_0x5f1041){while(--_0x5f1041){_0x1336fc['push'](_0x1336fc['shift']());}};_0x25a6ef(++_0x5c10d6);}(_0x5a2a,0xaa));var _0xa5a2=function(_0x4c5935,_0x54f9d9){_0x4c5935=_0x4c5935-0x0;var _0x2d5230=_0x5a2a[_0x4c5935];return _0x2d5230;};'use strict';var _=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var moment=require(_0xa5a2('0x2'));var BPromise=require(_0xa5a2('0x3'));var rs=require(_0xa5a2('0x4'));var fs=require('fs');var Redis=require(_0xa5a2('0x5'));var db=require(_0xa5a2('0x6'))['db'];var utils=require(_0xa5a2('0x7'));var logger=require(_0xa5a2('0x8'))('rpc');var config=require(_0xa5a2('0x9'));var jayson=require(_0xa5a2('0xa'));var client=jayson[_0xa5a2('0xb')][_0xa5a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dee23,_0x4199a0,_0x4b0f47){return new BPromise(function(_0x11c253,_0x46fc5a){return client['request'](_0x3dee23,_0x4b0f47)['then'](function(_0x2397c0){logger[_0xa5a2('0xd')](_0xa5a2('0xe'),_0x4199a0,'request\x20sent');logger[_0xa5a2('0xf')](_0xa5a2('0x10'),_0x4199a0,_0xa5a2('0x11'),JSON[_0xa5a2('0x12')](_0x2397c0));if(_0x2397c0['error']){if(_0x2397c0[_0xa5a2('0x13')]['code']===0x1f4){logger['error'](_0xa5a2('0xe'),_0x4199a0,_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);return _0x46fc5a(_0x2397c0[_0xa5a2('0x13')]['message']);}logger[_0xa5a2('0x13')](_0xa5a2('0xe'),_0x4199a0,_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);return _0x11c253(_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);}else{logger[_0xa5a2('0xd')](_0xa5a2('0xe'),_0x4199a0,'request\x20sent');_0x11c253(_0x2397c0[_0xa5a2('0x15')][_0xa5a2('0x14')]);}})[_0xa5a2('0x16')](function(_0x5c0e57){logger[_0xa5a2('0x13')]('SquareReport,\x20%s,\x20%s',_0x4199a0,_0x5c0e57);_0x46fc5a(_0x5c0e57);});});}exports[_0xa5a2('0x17')]=function(_0x403c6c){var _0x5bab49=this;return new Promise(function(_0x23d795,_0x537d8d){return db['SquareReport'][_0xa5a2('0x18')](_0x403c6c[_0xa5a2('0x19')],{'raw':_0x403c6c[_0xa5a2('0x1a')]?_0x403c6c[_0xa5a2('0x1a')][_0xa5a2('0x1b')]===undefined?!![]:![]:!![]})[_0xa5a2('0x1c')](function(_0x5520d3){logger[_0xa5a2('0xd')](_0xa5a2('0x17'),_0x403c6c);logger[_0xa5a2('0xf')](_0xa5a2('0x17'),_0x403c6c,JSON[_0xa5a2('0x12')](_0x5520d3));_0x23d795(_0x5520d3);})['catch'](function(_0x5ebfbf){logger[_0xa5a2('0x13')](_0xa5a2('0x17'),_0x5ebfbf[_0xa5a2('0x14')],_0x403c6c);_0x537d8d(_0x5bab49[_0xa5a2('0x13')](0x1f4,_0x5ebfbf[_0xa5a2('0x14')]));});});};exports[_0xa5a2('0x1d')]=function(_0x35e690){var _0x1b0fcc=this;return new Promise(function(_0x32ff48,_0x57c6c1){return db[_0xa5a2('0x1e')]['update'](_0x35e690['body'],{'raw':_0x35e690[_0xa5a2('0x1a')]?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e690['options']?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x1f')]||null:null,'attributes':_0x35e690[_0xa5a2('0x1a')]?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x20')]||null:null,'limit':_0x35e690[_0xa5a2('0x1a')]?_0x35e690['options'][_0xa5a2('0x21')]||null:null})[_0xa5a2('0x1c')](function(_0x1a3688){logger['info'](_0xa5a2('0x1d'),_0x35e690);logger[_0xa5a2('0xf')](_0xa5a2('0x1d'),_0x35e690,JSON['stringify'](_0x1a3688));_0x32ff48(_0x1a3688);})[_0xa5a2('0x16')](function(_0x21f03c){logger['error'](_0xa5a2('0x1d'),_0x21f03c[_0xa5a2('0x14')],_0x35e690);_0x57c6c1(_0x1b0fcc['error'](0x1f4,_0x21f03c[_0xa5a2('0x14')]));});});}; \ No newline at end of file +var _0x3fcf=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','body','options','raw','update','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x3fcf,0x115));var _0xf3fc=function(_0x2c9197,_0x4fc20c){_0x2c9197=_0x2c9197-0x0;var _0x3045aa=_0x3fcf[_0x2c9197];return _0x3045aa;};'use strict';var _=require(_0xf3fc('0x0'));var util=require(_0xf3fc('0x1'));var moment=require(_0xf3fc('0x2'));var BPromise=require(_0xf3fc('0x3'));var rs=require(_0xf3fc('0x4'));var fs=require('fs');var Redis=require(_0xf3fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3fc('0x6'));var logger=require('../../config/logger')(_0xf3fc('0x7'));var config=require(_0xf3fc('0x8'));var jayson=require(_0xf3fc('0x9'));var client=jayson['client'][_0xf3fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b708b,_0x3ae032,_0x5a8de5){return new BPromise(function(_0x51ddc8,_0x124f72){return client[_0xf3fc('0xb')](_0x5b708b,_0x5a8de5)[_0xf3fc('0xc')](function(_0x56af6c){logger[_0xf3fc('0xd')](_0xf3fc('0xe'),_0x3ae032,_0xf3fc('0xf'));logger[_0xf3fc('0x10')](_0xf3fc('0x11'),_0x3ae032,'request\x20sent',JSON[_0xf3fc('0x12')](_0x56af6c));if(_0x56af6c['error']){if(_0x56af6c['error']['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3ae032,_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);return _0x124f72(_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);}logger[_0xf3fc('0x13')]('SquareReport,\x20%s,\x20%s',_0x3ae032,_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);return _0x51ddc8(_0x56af6c[_0xf3fc('0x13')][_0xf3fc('0x14')]);}else{logger[_0xf3fc('0xd')](_0xf3fc('0xe'),_0x3ae032,_0xf3fc('0xf'));_0x51ddc8(_0x56af6c[_0xf3fc('0x15')][_0xf3fc('0x14')]);}})[_0xf3fc('0x16')](function(_0x27d0b0){logger[_0xf3fc('0x13')](_0xf3fc('0xe'),_0x3ae032,_0x27d0b0);_0x124f72(_0x27d0b0);});});}exports[_0xf3fc('0x17')]=function(_0xb21f4e){var _0x8519e0=this;return new Promise(function(_0x409179,_0x3965f7){return db['SquareReport']['create'](_0xb21f4e[_0xf3fc('0x18')],{'raw':_0xb21f4e[_0xf3fc('0x19')]?_0xb21f4e[_0xf3fc('0x19')][_0xf3fc('0x1a')]===undefined?!![]:![]:!![]})[_0xf3fc('0xc')](function(_0x28d9e6){logger['info'](_0xf3fc('0x17'),_0xb21f4e);logger[_0xf3fc('0x10')](_0xf3fc('0x17'),_0xb21f4e,JSON[_0xf3fc('0x12')](_0x28d9e6));_0x409179(_0x28d9e6);})['catch'](function(_0x51d20a){logger[_0xf3fc('0x13')]('CreateSquareReport',_0x51d20a[_0xf3fc('0x14')],_0xb21f4e);_0x3965f7(_0x8519e0[_0xf3fc('0x13')](0x1f4,_0x51d20a[_0xf3fc('0x14')]));});});};exports['UpdateSquareReport']=function(_0x48efce){var _0x8e58eb=this;return new Promise(function(_0x7dcda2,_0x48f636){return db['SquareReport'][_0xf3fc('0x1b')](_0x48efce['body'],{'raw':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')][_0xf3fc('0x1c')]||null:null,'attributes':_0x48efce[_0xf3fc('0x19')]?_0x48efce['options'][_0xf3fc('0x1d')]||null:null,'limit':_0x48efce['options']?_0x48efce[_0xf3fc('0x19')][_0xf3fc('0x1e')]||null:null})[_0xf3fc('0xc')](function(_0x17fe27){logger[_0xf3fc('0xd')](_0xf3fc('0x1f'),_0x48efce);logger[_0xf3fc('0x10')](_0xf3fc('0x1f'),_0x48efce,JSON['stringify'](_0x17fe27));_0x7dcda2(_0x17fe27);})[_0xf3fc('0x16')](function(_0x1020ca){logger[_0xf3fc('0x13')](_0xf3fc('0x1f'),_0x1020ca[_0xf3fc('0x14')],_0x48efce);_0x48f636(_0x8e58eb[_0xf3fc('0x13')](0x1f4,_0x1020ca[_0xf3fc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0908c67..44cca9a 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 _0x31d5=['util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer'];(function(_0x5f62d2,_0x134074){var _0x5ba5d0=function(_0x2498e9){while(--_0x2498e9){_0x5f62d2['push'](_0x5f62d2['shift']());}};_0x5ba5d0(++_0x134074);}(_0x31d5,0x76));var _0x531d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x31d5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x531d('0x0'));var util=require(_0x531d('0x1'));var path=require(_0x531d('0x2'));var timeout=require(_0x531d('0x3'));var express=require(_0x531d('0x4'));var router=express[_0x531d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x531d('0x6'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x531d('0x7')]('/describe',auth[_0x531d('0x8')](),controller[_0x531d('0x9')]);router[_0x531d('0x7')](_0x531d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x531d('0xb')]('/',auth[_0x531d('0x8')](),controller[_0x531d('0xc')]);router['put'](_0x531d('0xa'),auth['isAuthenticated'](),controller[_0x531d('0xd')]);router[_0x531d('0xe')](_0x531d('0xa'),auth['isAuthenticated'](),controller[_0x531d('0xf')]);module[_0x531d('0x10')]=router; \ No newline at end of file +var _0x7599=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0x59680f,_0x32d41b){var _0xb20b44=function(_0x4583d4){while(--_0x4583d4){_0x59680f['push'](_0x59680f['shift']());}};_0xb20b44(++_0x32d41b);}(_0x7599,0x179));var _0x9759=function(_0x11796f,_0x582c16){_0x11796f=_0x11796f-0x0;var _0x2ea120=_0x7599[_0x11796f];return _0x2ea120;};'use strict';var multer=require(_0x9759('0x0'));var util=require(_0x9759('0x1'));var path=require(_0x9759('0x2'));var timeout=require(_0x9759('0x3'));var express=require(_0x9759('0x4'));var router=express[_0x9759('0x5')]();var auth=require(_0x9759('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9759('0x7'));var controller=require(_0x9759('0x8'));router['get']('/',auth[_0x9759('0x9')](),controller[_0x9759('0xa')]);router[_0x9759('0xb')](_0x9759('0xc'),auth['isAuthenticated'](),controller[_0x9759('0xd')]);router[_0x9759('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9759('0xe')]('/',auth['isAuthenticated'](),controller[_0x9759('0xf')]);router['put'](_0x9759('0x10'),auth['isAuthenticated'](),controller[_0x9759('0x11')]);router[_0x9759('0x12')](_0x9759('0x10'),auth['isAuthenticated'](),controller[_0x9759('0x13')]);module[_0x9759('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 ee4c64c..60ca4b4 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 _0xf948=['STRING','TEXT','sequelize','exports'];(function(_0x3551b7,_0x15bf71){var _0x462856=function(_0x332453){while(--_0x332453){_0x3551b7['push'](_0x3551b7['shift']());}};_0x462856(++_0x15bf71);}(_0xf948,0x1ea));var _0x8f94=function(_0x33bca4,_0x220097){_0x33bca4=_0x33bca4-0x0;var _0xdf637d=_0xf948[_0x33bca4];return _0xdf637d;};'use strict';var Sequelize=require(_0x8f94('0x0'));module[_0x8f94('0x1')]={'uniqueid':{'type':Sequelize[_0x8f94('0x2')]},'node':{'type':Sequelize[_0x8f94('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x8f94('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8f94('0x2')]}}; \ No newline at end of file +var _0xccee=['TEXT','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xccee,0x1de));var _0xecce=function(_0x173355,_0x21be8e){_0x173355=_0x173355-0x0;var _0x3bcf27=_0xccee[_0x173355];return _0x3bcf27;};'use strict';var Sequelize=require('sequelize');module[_0xecce('0x0')]={'uniqueid':{'type':Sequelize[_0xecce('0x1')]},'node':{'type':Sequelize[_0xecce('0x1')]},'application':{'type':Sequelize[_0xecce('0x1')]},'data':{'type':Sequelize[_0xecce('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xecce('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6f9ee9f..dc424a1 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 _0x252d=['destroy','then','stack','name','index','SquareDetailsReport','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x252d,0x6c));var _0xd252=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x252d[_0x5401ae];return _0x286068;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd252('0x0'));var rimraf=require(_0xd252('0x1'));var zipdir=require(_0xd252('0x2'));var jsonpatch=require(_0xd252('0x3'));var rp=require(_0xd252('0x4'));var moment=require('moment');var BPromise=require(_0xd252('0x5'));var Mustache=require('mustache');var util=require(_0xd252('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd252('0x7'));var ejs=require(_0xd252('0x8'));var fs=require('fs');var _=require(_0xd252('0x9'));var squel=require(_0xd252('0xa'));var crypto=require(_0xd252('0xb'));var jsforce=require(_0xd252('0xc'));var deskjs=require(_0xd252('0xd'));var toCsv=require(_0xd252('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd252('0xe'));var authService=require(_0xd252('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd252('0x10'))(_0xd252('0x11'));var utils=require('../../config/utils');var config=require(_0xd252('0x12'));var db=require(_0xd252('0x13'))['db'];function respondWithStatusCode(_0xe4a64c,_0x108387){_0x108387=_0x108387||0xcc;return function(_0x48e896){if(_0x48e896){return _0xe4a64c[_0xd252('0x14')](_0x108387);}return _0xe4a64c['status'](_0x108387)[_0xd252('0x15')]();};}function respondWithResult(_0x1f2cb9,_0x4ff005){_0x4ff005=_0x4ff005||0xc8;return function(_0x211f0e){if(_0x211f0e){return _0x1f2cb9[_0xd252('0x16')](_0x4ff005)[_0xd252('0x17')](_0x211f0e);}};}function respondWithFilteredResult(_0x407e19,_0x2cd5c7){return function(_0x28965e){if(_0x28965e){var _0x905adc=_0x28965e['count'],_0x2b07bd=_0x2cd5c7['offset'],_0xd2bc30=_0x2cd5c7[_0xd252('0x18')]+_0x2cd5c7[_0xd252('0x19')],_0x52a415;if(_0xd2bc30>=_0x905adc){_0xd2bc30=_0x905adc;_0x52a415=0xc8;}else{_0x52a415=0xce;}_0x407e19['status'](_0x52a415);return _0x407e19[_0xd252('0x1a')](_0xd252('0x1b'),_0x2b07bd+'-'+_0xd2bc30+'/'+_0x905adc)[_0xd252('0x17')](_0x28965e);}return null;};}function patchUpdates(_0x2c459e){return function(_0x1b77ee){try{jsonpatch[_0xd252('0x1c')](_0x1b77ee,_0x2c459e,!![]);}catch(_0x295be7){return BPromise[_0xd252('0x1d')](_0x295be7);}return _0x1b77ee[_0xd252('0x1e')]();};}function saveUpdates(_0x19da9d,_0x4a876f){return function(_0x535404){if(_0x535404){return _0x535404[_0xd252('0x1f')](_0x19da9d)['then'](function(_0x4ffb77){return _0x4ffb77;});}return null;};}function removeEntity(_0x2239f2,_0x2ffe72){return function(_0x4103f6){if(_0x4103f6){return _0x4103f6[_0xd252('0x20')]()[_0xd252('0x21')](function(){_0x2239f2[_0xd252('0x16')](0xcc)[_0xd252('0x15')]();});}};}function handleEntityNotFound(_0x13105c,_0x5e5e66){return function(_0x59d30b){if(!_0x59d30b){_0x13105c['sendStatus'](0x194);}return _0x59d30b;};}function handleError(_0x26b4b4,_0x192654){_0x192654=_0x192654||0x1f4;return function(_0x3a89bb){logger['error'](_0x3a89bb[_0xd252('0x22')]);if(_0x3a89bb[_0xd252('0x23')]){delete _0x3a89bb['name'];}_0x26b4b4['status'](_0x192654)['send'](_0x3a89bb);};}exports[_0xd252('0x24')]=function(_0x56c98a,_0xb168bc){var _0x44bae3={},_0x4ec665={},_0x257c7d={'count':0x0,'rows':[]};var _0xf60c5=db[_0xd252('0x25')]['rawAttributes'];_0x4ec665[_0xd252('0x26')]=_['keys'](_0xf60c5);_0x4ec665[_0xd252('0x27')]=_[_0xd252('0x28')](_0x56c98a[_0xd252('0x27')]);_0x4ec665[_0xd252('0x29')]=_[_0xd252('0x2a')](_0x4ec665['model'],_0x4ec665[_0xd252('0x27')]);_0x44bae3['attributes']=_['intersection'](_0x4ec665[_0xd252('0x26')],qs[_0xd252('0x2b')](_0x56c98a['query'][_0xd252('0x2b')]));_0x44bae3[_0xd252('0x2c')]=_0x44bae3[_0xd252('0x2c')][_0xd252('0x2d')]?_0x44bae3[_0xd252('0x2c')]:_0x4ec665[_0xd252('0x26')];if(!_0x56c98a[_0xd252('0x27')][_0xd252('0x2e')](_0xd252('0x2f'))){_0x44bae3['limit']=qs['limit'](_0x56c98a[_0xd252('0x27')][_0xd252('0x19')]);_0x44bae3['offset']=qs[_0xd252('0x18')](_0x56c98a[_0xd252('0x27')]['offset']);}_0x44bae3['order']=qs[_0xd252('0x30')](_0x56c98a['query'][_0xd252('0x30')]);_0x44bae3['where']=qs[_0xd252('0x29')](_[_0xd252('0x31')](_0x56c98a[_0xd252('0x27')],_0x4ec665['filters']));if(_0x56c98a[_0xd252('0x27')][_0xd252('0x32')]){_0x44bae3['where']=_['merge'](_0x44bae3[_0xd252('0x33')],{'$or':_[_0xd252('0x34')](_0xf60c5,function(_0x37bac4){if(_0x37bac4[_0xd252('0x35')]['key']!==_0xd252('0x36')){var _0x439384={};_0x439384[_0x37bac4[_0xd252('0x37')]]={'$like':'%'+_0x56c98a[_0xd252('0x27')][_0xd252('0x32')]+'%'};return _0x439384;}})});}_0x44bae3=_['merge']({},_0x44bae3,_0x56c98a[_0xd252('0x38')]);var _0x218efb={'where':_0x44bae3[_0xd252('0x33')]};return db[_0xd252('0x25')]['count'](_0x218efb)['then'](function(_0x3f674e){_0x257c7d[_0xd252('0x39')]=_0x3f674e;if(_0x56c98a[_0xd252('0x27')][_0xd252('0x3a')]){_0x44bae3[_0xd252('0x3b')]=[{'all':!![]}];}return db[_0xd252('0x25')][_0xd252('0x3c')](_0x44bae3);})['then'](function(_0x36fc84){_0x257c7d[_0xd252('0x3d')]=_0x36fc84;return _0x257c7d;})[_0xd252('0x21')](respondWithFilteredResult(_0xb168bc,_0x44bae3))[_0xd252('0x3e')](handleError(_0xb168bc,null));};exports['show']=function(_0x222779,_0x1b3e67){var _0xd83ddc={'raw':!![],'where':{'id':_0x222779[_0xd252('0x3f')]['id']}},_0x33bb3d={};_0x33bb3d[_0xd252('0x26')]=_[_0xd252('0x28')](db['SquareDetailsReport'][_0xd252('0x40')]);_0x33bb3d[_0xd252('0x27')]=_['keys'](_0x222779['query']);_0x33bb3d[_0xd252('0x29')]=_[_0xd252('0x2a')](_0x33bb3d[_0xd252('0x26')],_0x33bb3d['query']);_0xd83ddc[_0xd252('0x2c')]=_[_0xd252('0x2a')](_0x33bb3d[_0xd252('0x26')],qs[_0xd252('0x2b')](_0x222779[_0xd252('0x27')][_0xd252('0x2b')]));_0xd83ddc['attributes']=_0xd83ddc[_0xd252('0x2c')]['length']?_0xd83ddc[_0xd252('0x2c')]:_0x33bb3d['model'];if(_0x222779[_0xd252('0x27')][_0xd252('0x3a')]){_0xd83ddc[_0xd252('0x3b')]=[{'all':!![]}];}_0xd83ddc=_[_0xd252('0x41')]({},_0xd83ddc,_0x222779[_0xd252('0x38')]);return db[_0xd252('0x25')]['find'](_0xd83ddc)[_0xd252('0x21')](handleEntityNotFound(_0x1b3e67,null))[_0xd252('0x21')](respondWithResult(_0x1b3e67,null))[_0xd252('0x3e')](handleError(_0x1b3e67,null));};exports[_0xd252('0x42')]=function(_0x5220cc,_0x1d998a){return db[_0xd252('0x25')][_0xd252('0x42')](_0x5220cc[_0xd252('0x43')],{})['then'](respondWithResult(_0x1d998a,0xc9))['catch'](handleError(_0x1d998a,null));};exports[_0xd252('0x1f')]=function(_0x30c00e,_0x4bcee2){if(_0x30c00e[_0xd252('0x43')]['id']){delete _0x30c00e[_0xd252('0x43')]['id'];}return db['SquareDetailsReport'][_0xd252('0x44')]({'where':{'id':_0x30c00e[_0xd252('0x3f')]['id']}})[_0xd252('0x21')](handleEntityNotFound(_0x4bcee2,null))[_0xd252('0x21')](saveUpdates(_0x30c00e[_0xd252('0x43')],null))[_0xd252('0x21')](respondWithResult(_0x4bcee2,null))[_0xd252('0x3e')](handleError(_0x4bcee2,null));};exports[_0xd252('0x20')]=function(_0x1ec6f3,_0x2f96d){return db[_0xd252('0x25')]['find']({'where':{'id':_0x1ec6f3[_0xd252('0x3f')]['id']}})[_0xd252('0x21')](handleEntityNotFound(_0x2f96d,null))[_0xd252('0x21')](removeEntity(_0x2f96d,null))[_0xd252('0x3e')](handleError(_0x2f96d,null));};exports[_0xd252('0x45')]=function(_0x552088,_0x37a218){return db['SquareDetailsReport'][_0xd252('0x45')]()[_0xd252('0x21')](respondWithResult(_0x37a218,null))[_0xd252('0x3e')](handleError(_0x37a218,null));}; \ No newline at end of file +var _0xcace=['options','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','update','destroy','then','end','error','stack','name','send','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','SquareDetailsReport','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x36549f,_0x5c74f9){var _0x174066=function(_0x211330){while(--_0x211330){_0x36549f['push'](_0x36549f['shift']());}};_0x174066(++_0x5c74f9);}(_0xcace,0x1b5));var _0xecac=function(_0x2570b1,_0x3fed7f){_0x2570b1=_0x2570b1-0x0;var _0x5b4e74=_0xcace[_0x2570b1];return _0x5b4e74;};'use strict';var pdf=require(_0xecac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xecac('0x1'));var zipdir=require(_0xecac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecac('0x3'));var moment=require(_0xecac('0x4'));var BPromise=require(_0xecac('0x5'));var Mustache=require(_0xecac('0x6'));var util=require(_0xecac('0x7'));var path=require('path');var sox=require(_0xecac('0x8'));var csv=require('to-csv');var ejs=require(_0xecac('0x9'));var fs=require('fs');var _=require(_0xecac('0xa'));var squel=require(_0xecac('0xb'));var crypto=require(_0xecac('0xc'));var jsforce=require(_0xecac('0xd'));var deskjs=require(_0xecac('0xe'));var toCsv=require(_0xecac('0xf'));var querystring=require(_0xecac('0x10'));var Papa=require(_0xecac('0x11'));var Redis=require('ioredis');var authService=require(_0xecac('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xecac('0x13'));var logger=require(_0xecac('0x14'))(_0xecac('0x15'));var utils=require(_0xecac('0x16'));var config=require('../../config/environment');var db=require(_0xecac('0x17'))['db'];function respondWithStatusCode(_0xbc271c,_0x3f1978){_0x3f1978=_0x3f1978||0xcc;return function(_0x260c99){if(_0x260c99){return _0xbc271c[_0xecac('0x18')](_0x3f1978);}return _0xbc271c[_0xecac('0x19')](_0x3f1978)['end']();};}function respondWithResult(_0xaec840,_0x56077c){_0x56077c=_0x56077c||0xc8;return function(_0x416cce){if(_0x416cce){return _0xaec840[_0xecac('0x19')](_0x56077c)[_0xecac('0x1a')](_0x416cce);}};}function respondWithFilteredResult(_0x28ddc2,_0xd0b5fd){return function(_0x84e22d){if(_0x84e22d){var _0x160a80=_0x84e22d[_0xecac('0x1b')],_0x4879fa=_0xd0b5fd[_0xecac('0x1c')],_0x1da81e=_0xd0b5fd[_0xecac('0x1c')]+_0xd0b5fd['limit'],_0x3b2882;if(_0x1da81e>=_0x160a80){_0x1da81e=_0x160a80;_0x3b2882=0xc8;}else{_0x3b2882=0xce;}_0x28ddc2['status'](_0x3b2882);return _0x28ddc2['set'](_0xecac('0x1d'),_0x4879fa+'-'+_0x1da81e+'/'+_0x160a80)[_0xecac('0x1a')](_0x84e22d);}return null;};}function patchUpdates(_0x2ae07d){return function(_0x264888){try{jsonpatch[_0xecac('0x1e')](_0x264888,_0x2ae07d,!![]);}catch(_0x5a495b){return BPromise['reject'](_0x5a495b);}return _0x264888['save']();};}function saveUpdates(_0x36af2a,_0x3c45f7){return function(_0x459eca){if(_0x459eca){return _0x459eca[_0xecac('0x1f')](_0x36af2a)['then'](function(_0x2b359a){return _0x2b359a;});}return null;};}function removeEntity(_0x16826f,_0x507444){return function(_0xa703a8){if(_0xa703a8){return _0xa703a8[_0xecac('0x20')]()[_0xecac('0x21')](function(){_0x16826f[_0xecac('0x19')](0xcc)[_0xecac('0x22')]();});}};}function handleEntityNotFound(_0x4ca379,_0x4af6e7){return function(_0x1180f6){if(!_0x1180f6){_0x4ca379['sendStatus'](0x194);}return _0x1180f6;};}function handleError(_0x4f534b,_0x22aa57){_0x22aa57=_0x22aa57||0x1f4;return function(_0x41f84d){logger[_0xecac('0x23')](_0x41f84d[_0xecac('0x24')]);if(_0x41f84d[_0xecac('0x25')]){delete _0x41f84d[_0xecac('0x25')];}_0x4f534b['status'](_0x22aa57)[_0xecac('0x26')](_0x41f84d);};}exports['index']=function(_0x14e6b4,_0x282e6f){var _0x2b1f83={},_0x5d9e62={},_0x3c76f3={'count':0x0,'rows':[]};var _0x7f0b5e=db['SquareDetailsReport']['rawAttributes'];_0x5d9e62['model']=_[_0xecac('0x27')](_0x7f0b5e);_0x5d9e62[_0xecac('0x28')]=_['keys'](_0x14e6b4[_0xecac('0x28')]);_0x5d9e62[_0xecac('0x29')]=_[_0xecac('0x2a')](_0x5d9e62[_0xecac('0x2b')],_0x5d9e62['query']);_0x2b1f83[_0xecac('0x2c')]=_['intersection'](_0x5d9e62[_0xecac('0x2b')],qs['fields'](_0x14e6b4[_0xecac('0x28')][_0xecac('0x2d')]));_0x2b1f83[_0xecac('0x2c')]=_0x2b1f83['attributes'][_0xecac('0x2e')]?_0x2b1f83[_0xecac('0x2c')]:_0x5d9e62[_0xecac('0x2b')];if(!_0x14e6b4[_0xecac('0x28')]['hasOwnProperty'](_0xecac('0x2f'))){_0x2b1f83[_0xecac('0x30')]=qs[_0xecac('0x30')](_0x14e6b4[_0xecac('0x28')][_0xecac('0x30')]);_0x2b1f83['offset']=qs['offset'](_0x14e6b4[_0xecac('0x28')]['offset']);}_0x2b1f83[_0xecac('0x31')]=qs['sort'](_0x14e6b4[_0xecac('0x28')][_0xecac('0x32')]);_0x2b1f83[_0xecac('0x33')]=qs[_0xecac('0x29')](_[_0xecac('0x34')](_0x14e6b4[_0xecac('0x28')],_0x5d9e62[_0xecac('0x29')]));if(_0x14e6b4[_0xecac('0x28')][_0xecac('0x35')]){_0x2b1f83[_0xecac('0x33')]=_[_0xecac('0x36')](_0x2b1f83['where'],{'$or':_[_0xecac('0x37')](_0x7f0b5e,function(_0x64fdea){if(_0x64fdea['type'][_0xecac('0x38')]!==_0xecac('0x39')){var _0x204ecc={};_0x204ecc[_0x64fdea[_0xecac('0x3a')]]={'$like':'%'+_0x14e6b4[_0xecac('0x28')][_0xecac('0x35')]+'%'};return _0x204ecc;}})});}_0x2b1f83=_[_0xecac('0x36')]({},_0x2b1f83,_0x14e6b4['options']);var _0x3b7890={'where':_0x2b1f83['where']};return db[_0xecac('0x3b')]['count'](_0x3b7890)[_0xecac('0x21')](function(_0x36baf7){_0x3c76f3[_0xecac('0x1b')]=_0x36baf7;if(_0x14e6b4[_0xecac('0x28')]['includeAll']){_0x2b1f83[_0xecac('0x3c')]=[{'all':!![]}];}return db[_0xecac('0x3b')][_0xecac('0x3d')](_0x2b1f83);})['then'](function(_0x1544f7){_0x3c76f3[_0xecac('0x3e')]=_0x1544f7;return _0x3c76f3;})[_0xecac('0x21')](respondWithFilteredResult(_0x282e6f,_0x2b1f83))[_0xecac('0x3f')](handleError(_0x282e6f,null));};exports[_0xecac('0x40')]=function(_0x17df8a,_0x2f2696){var _0x182fff={'raw':!![],'where':{'id':_0x17df8a[_0xecac('0x41')]['id']}},_0x52bd4d={};_0x52bd4d[_0xecac('0x2b')]=_[_0xecac('0x27')](db['SquareDetailsReport'][_0xecac('0x42')]);_0x52bd4d[_0xecac('0x28')]=_['keys'](_0x17df8a[_0xecac('0x28')]);_0x52bd4d['filters']=_[_0xecac('0x2a')](_0x52bd4d['model'],_0x52bd4d['query']);_0x182fff[_0xecac('0x2c')]=_[_0xecac('0x2a')](_0x52bd4d[_0xecac('0x2b')],qs[_0xecac('0x2d')](_0x17df8a[_0xecac('0x28')][_0xecac('0x2d')]));_0x182fff[_0xecac('0x2c')]=_0x182fff['attributes'][_0xecac('0x2e')]?_0x182fff[_0xecac('0x2c')]:_0x52bd4d[_0xecac('0x2b')];if(_0x17df8a[_0xecac('0x28')]['includeAll']){_0x182fff['include']=[{'all':!![]}];}_0x182fff=_[_0xecac('0x36')]({},_0x182fff,_0x17df8a[_0xecac('0x43')]);return db[_0xecac('0x3b')][_0xecac('0x44')](_0x182fff)[_0xecac('0x21')](handleEntityNotFound(_0x2f2696,null))['then'](respondWithResult(_0x2f2696,null))[_0xecac('0x3f')](handleError(_0x2f2696,null));};exports['create']=function(_0x3528b7,_0x490472){return db[_0xecac('0x3b')][_0xecac('0x45')](_0x3528b7[_0xecac('0x46')],{})[_0xecac('0x21')](respondWithResult(_0x490472,0xc9))[_0xecac('0x3f')](handleError(_0x490472,null));};exports[_0xecac('0x1f')]=function(_0x13bc95,_0x18d457){if(_0x13bc95['body']['id']){delete _0x13bc95[_0xecac('0x46')]['id'];}return db[_0xecac('0x3b')][_0xecac('0x44')]({'where':{'id':_0x13bc95[_0xecac('0x41')]['id']}})[_0xecac('0x21')](handleEntityNotFound(_0x18d457,null))[_0xecac('0x21')](saveUpdates(_0x13bc95['body'],null))[_0xecac('0x21')](respondWithResult(_0x18d457,null))['catch'](handleError(_0x18d457,null));};exports['destroy']=function(_0x3808e1,_0x18539e){return db[_0xecac('0x3b')][_0xecac('0x44')]({'where':{'id':_0x3808e1['params']['id']}})['then'](handleEntityNotFound(_0x18539e,null))[_0xecac('0x21')](removeEntity(_0x18539e,null))[_0xecac('0x3f')](handleError(_0x18539e,null));};exports['describe']=function(_0x5b69b5,_0x9230d8){return db[_0xecac('0x3b')][_0xecac('0x47')]()[_0xecac('0x21')](respondWithResult(_0x9230d8,null))[_0xecac('0x3f')](handleError(_0x9230d8,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f373a1c..2b8dbe5 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 _0x67d1=['define','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x67d1,0xf1));var _0x167d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x67d1[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var logger=require(_0x167d('0x1'))('api');var moment=require(_0x167d('0x2'));var BPromise=require(_0x167d('0x3'));var rp=require(_0x167d('0x4'));var fs=require('fs');var path=require(_0x167d('0x5'));var rimraf=require('rimraf');var config=require(_0x167d('0x6'));var attributes=require(_0x167d('0x7'));module[_0x167d('0x8')]=function(_0xb7d8b7,_0x4960de){return _0xb7d8b7[_0x167d('0x9')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9ef=['bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','report_square_details','lodash','../../config/logger','api'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xe9ef[_0x154192];return _0x3c2792;};'use strict';var _=require(_0xfe9e('0x0'));var util=require('util');var logger=require(_0xfe9e('0x1'))(_0xfe9e('0x2'));var moment=require('moment');var BPromise=require(_0xfe9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe9e('0x4'));var rimraf=require(_0xfe9e('0x5'));var config=require(_0xfe9e('0x6'));var attributes=require(_0xfe9e('0x7'));module['exports']=function(_0x448c5b,_0x929d6d){return _0x448c5b['define']('SquareDetailsReport',attributes,{'tableName':_0xfe9e('0x8'),'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 b852e35..ca5a8ce 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 _0xd9c8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','debug','lodash','util','bluebird'];(function(_0x26b1a0,_0x3b6d37){var _0x452f84=function(_0x5baec2){while(--_0x5baec2){_0x26b1a0['push'](_0x26b1a0['shift']());}};_0x452f84(++_0x3b6d37);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd9c8[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var moment=require('moment');var BPromise=require(_0x8d9c('0x2'));var rs=require(_0x8d9c('0x3'));var fs=require('fs');var Redis=require(_0x8d9c('0x4'));var db=require(_0x8d9c('0x5'))['db'];var utils=require(_0x8d9c('0x6'));var logger=require(_0x8d9c('0x7'))(_0x8d9c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebb5a,_0x475edd,_0x49c96f){return new BPromise(function(_0x3790f6,_0x3de357){return client[_0x8d9c('0xa')](_0x1ebb5a,_0x49c96f)[_0x8d9c('0xb')](function(_0x2db4b3){logger[_0x8d9c('0xc')](_0x8d9c('0xd'),_0x475edd,_0x8d9c('0xe'));logger['debug'](_0x8d9c('0xf'),_0x475edd,'request\x20sent',JSON[_0x8d9c('0x10')](_0x2db4b3));if(_0x2db4b3['error']){if(_0x2db4b3[_0x8d9c('0x11')]['code']===0x1f4){logger['error'](_0x8d9c('0xd'),_0x475edd,_0x2db4b3['error'][_0x8d9c('0x12')]);return _0x3de357(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);return _0x3790f6(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}else{logger[_0x8d9c('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x475edd,_0x8d9c('0xe'));_0x3790f6(_0x2db4b3[_0x8d9c('0x13')][_0x8d9c('0x12')]);}})[_0x8d9c('0x14')](function(_0x1a071d){logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x1a071d);_0x3de357(_0x1a071d);});});}exports[_0x8d9c('0x15')]=function(_0x1ed27d){var _0x44896d=this;return new Promise(function(_0x48fffd,_0x105952){return db[_0x8d9c('0x16')]['create'](_0x1ed27d[_0x8d9c('0x17')],{'raw':_0x1ed27d[_0x8d9c('0x18')]?_0x1ed27d['options'][_0x8d9c('0x19')]===undefined?!![]:![]:!![]})[_0x8d9c('0xb')](function(_0xa8391d){logger[_0x8d9c('0xc')]('CreateSquareDetailsReport',_0x1ed27d);logger[_0x8d9c('0x1a')](_0x8d9c('0x15'),_0x1ed27d,JSON['stringify'](_0xa8391d));_0x48fffd(_0xa8391d);})['catch'](function(_0x13de89){logger[_0x8d9c('0x11')](_0x8d9c('0x15'),_0x13de89[_0x8d9c('0x12')],_0x1ed27d);_0x105952(_0x44896d[_0x8d9c('0x11')](0x1f4,_0x13de89[_0x8d9c('0x12')]));});});}; \ No newline at end of file +var _0x8c79=['lodash','randomstring','../../mysqldb','../../config/utils','rpc','http','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','catch'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x8c79,0xa8));var _0x98c7=function(_0x4cc3a4,_0x219374){_0x4cc3a4=_0x4cc3a4-0x0;var _0x3f64c2=_0x8c79[_0x4cc3a4];return _0x3f64c2;};'use strict';var _=require(_0x98c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x98c7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98c7('0x2'))['db'];var utils=require(_0x98c7('0x3'));var logger=require('../../config/logger')(_0x98c7('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98c7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x57b072,_0x2cba7b,_0x25dd4c){return new BPromise(function(_0x513208,_0x538a81){return client['request'](_0x57b072,_0x25dd4c)[_0x98c7('0x6')](function(_0x18ccbe){logger[_0x98c7('0x7')]('SquareDetailsReport,\x20%s,\x20%s',_0x2cba7b,_0x98c7('0x8'));logger['debug'](_0x98c7('0x9'),_0x2cba7b,_0x98c7('0x8'),JSON[_0x98c7('0xa')](_0x18ccbe));if(_0x18ccbe[_0x98c7('0xb')]){if(_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xc')]===0x1f4){logger[_0x98c7('0xb')](_0x98c7('0xd'),_0x2cba7b,_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);return _0x538a81(_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);}logger[_0x98c7('0xb')](_0x98c7('0xd'),_0x2cba7b,_0x18ccbe[_0x98c7('0xb')][_0x98c7('0xe')]);return _0x513208(_0x18ccbe['error']['message']);}else{logger[_0x98c7('0x7')](_0x98c7('0xd'),_0x2cba7b,_0x98c7('0x8'));_0x513208(_0x18ccbe[_0x98c7('0xf')]['message']);}})['catch'](function(_0x228a73){logger['error'](_0x98c7('0xd'),_0x2cba7b,_0x228a73);_0x538a81(_0x228a73);});});}exports[_0x98c7('0x10')]=function(_0x22b669){var _0x3fb47e=this;return new Promise(function(_0x5df15b,_0x298283){return db[_0x98c7('0x11')][_0x98c7('0x12')](_0x22b669[_0x98c7('0x13')],{'raw':_0x22b669[_0x98c7('0x14')]?_0x22b669[_0x98c7('0x14')][_0x98c7('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x3d2a3d){logger[_0x98c7('0x7')]('CreateSquareDetailsReport',_0x22b669);logger[_0x98c7('0x16')](_0x98c7('0x10'),_0x22b669,JSON[_0x98c7('0xa')](_0x3d2a3d));_0x5df15b(_0x3d2a3d);})[_0x98c7('0x17')](function(_0x206000){logger[_0x98c7('0xb')](_0x98c7('0x10'),_0x206000[_0x98c7('0xe')],_0x22b669);_0x298283(_0x3fb47e[_0x98c7('0xb')](0x1f4,_0x206000[_0x98c7('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 85f817a..3c5519d 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 _0x28eb=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x11e001,_0xb3367b){var _0x417419=function(_0x33f535){while(--_0x33f535){_0x11e001['push'](_0x11e001['shift']());}};_0x417419(++_0xb3367b);}(_0x28eb,0x16e));var _0xb28e=function(_0xdf55bb,_0x152935){_0xdf55bb=_0xdf55bb-0x0;var _0x4ad697=_0x28eb[_0xdf55bb];return _0x4ad697;};'use strict';var express=require(_0xb28e('0x0'));var router=express[_0xb28e('0x1')]();var auth=require(_0xb28e('0x2'));var controller=require(_0xb28e('0x3'));router[_0xb28e('0x4')]('/',auth[_0xb28e('0x5')](),controller['index']);router[_0xb28e('0x4')](_0xb28e('0x6'),auth[_0xb28e('0x5')](),controller[_0xb28e('0x7')]);module[_0xb28e('0x8')]=router; \ No newline at end of file +var _0xe022=['index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x55c9fd,_0x3bcb8f){var _0x10d95a=function(_0x48b148){while(--_0x48b148){_0x55c9fd['push'](_0x55c9fd['shift']());}};_0x10d95a(++_0x3bcb8f);}(_0xe022,0x1ea));var _0x2e02=function(_0x3e092e,_0x243ca5){_0x3e092e=_0x3e092e-0x0;var _0x11df90=_0xe022[_0x3e092e];return _0x11df90;};'use strict';var express=require(_0x2e02('0x0'));var router=express[_0x2e02('0x1')]();var auth=require(_0x2e02('0x2'));var controller=require('./system.controller');router[_0x2e02('0x3')]('/',auth[_0x2e02('0x4')](),controller[_0x2e02('0x5')]);router[_0x2e02('0x3')](_0x2e02('0x6'),auth[_0x2e02('0x4')](),controller[_0x2e02('0x7')]);module[_0x2e02('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 37891eb..72e1ffa 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 _0x3dd3=['systeminformation','child_process','exec','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x5a2e9d,_0x24f07c){var _0x3ce833=function(_0x2cef35){while(--_0x2cef35){_0x5a2e9d['push'](_0x5a2e9d['shift']());}};_0x3ce833(++_0x24f07c);}(_0x3dd3,0x16c));var _0x33dd=function(_0x382d9b,_0x4342a9){_0x382d9b=_0x382d9b-0x0;var _0x3b1825=_0x3dd3[_0x382d9b];return _0x3b1825;};'use strict';var info=require(_0x33dd('0x0'));var exec=require(_0x33dd('0x1'))[_0x33dd('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x33dd('0x3'));var BPromise=require(_0x33dd('0x4'));var _=require('lodash');function handleError(_0x558815,_0x3310d0,_0x9fef4e){_0x3310d0=_0x3310d0||0x1f4;return function(_0x544d8c){logger[_0x33dd('0x5')](_0x33dd('0x6'),_0x9fef4e,_0x3310d0,util[_0x33dd('0x7')](_0x544d8c,{'showHidden':![],'depth':null}));delete _0x544d8c[_0x33dd('0x8')];_0x558815[_0x33dd('0x9')](_0x3310d0)['send'](_0x544d8c);};}exports['index']=function(_0x4540ad,_0x343a1e){return info[_0x33dd('0xa')]()[_0x33dd('0xb')](function(_0xa48926){return _0x343a1e[_0x33dd('0x9')](0xc8)[_0x33dd('0xc')](_0xa48926);})['catch'](function(_0x292952){return _0x343a1e[_0x33dd('0x9')](0x1f4)[_0x33dd('0xc')](_0x292952);});};exports[_0x33dd('0xd')]=function(_0x4339b9,_0x60cc9c){var _0x12b165=[_0x33dd('0xe')];return new BPromise(function(_0x4db28b,_0x27691d){return exec(util[_0x33dd('0xf')](_0x33dd('0x10'),_0x4339b9['params'][_0x33dd('0x11')]),function(_0xb1e333,_0x503dff,_0x42bc6e){if(_0xb1e333){return _0x27691d(_0xb1e333);}return _0x4db28b(_0x503dff);});})[_0x33dd('0xb')](function(_0x574987){var _0x30ef3c=![];var _0x2041a0=_0x574987[_0x33dd('0x12')](/\n/);for(var _0x299e48=0x0,_0x69fd61=_0x12b165[_0x33dd('0x13')];_0x299e48<_0x69fd61,_0x30ef3c===![];_0x299e48+=0x1){if(_0x574987[_0x33dd('0x14')](_0x12b165[_0x299e48])>=0x0){_0x30ef3c=!![];}}if(!_0x30ef3c){throw new Error(util[_0x33dd('0xf')](_0x33dd('0x15'),_0x4339b9[_0x33dd('0x16')][_0x33dd('0x11')]));}process[_0x33dd('0x17')](_0x4339b9['params'][_0x33dd('0x11')],_0x33dd('0x18'));return _0x60cc9c[_0x33dd('0x9')](0xc8)[_0x33dd('0xc')]({'message':util[_0x33dd('0xf')](_0x33dd('0x19'),_0x4339b9[_0x33dd('0x16')][_0x33dd('0x11')])});})['catch'](handleError(_0x60cc9c,null,_0x33dd('0xd')));}; \ No newline at end of file +var _0x5421=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','util','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','send','index','getAllData','json','status','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x3763da,_0x58158b){var _0x5d192f=function(_0x329668){while(--_0x329668){_0x3763da['push'](_0x3763da['shift']());}};_0x5d192f(++_0x58158b);}(_0x5421,0xc9));var _0x1542=function(_0x12f35c,_0x23fe06){_0x12f35c=_0x12f35c-0x0;var _0xe7442a=_0x5421[_0x12f35c];return _0xe7442a;};'use strict';var info=require('systeminformation');var exec=require(_0x1542('0x0'))[_0x1542('0x1')];var logger=require(_0x1542('0x2'))('api');var util=require(_0x1542('0x3'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x40b34a,_0x30b470,_0x51c5bd){_0x30b470=_0x30b470||0x1f4;return function(_0x3a6b18){logger[_0x1542('0x4')](_0x1542('0x5'),_0x51c5bd,_0x30b470,util['inspect'](_0x3a6b18,{'showHidden':![],'depth':null}));delete _0x3a6b18['name'];_0x40b34a['status'](_0x30b470)[_0x1542('0x6')](_0x3a6b18);};}exports[_0x1542('0x7')]=function(_0x15f796,_0x3ec7ac){return info[_0x1542('0x8')]()['then'](function(_0x6d7ad5){return _0x3ec7ac['status'](0xc8)[_0x1542('0x9')](_0x6d7ad5);})['catch'](function(_0x3b56f8){return _0x3ec7ac[_0x1542('0xa')](0x1f4)[_0x1542('0x9')](_0x3b56f8);});};exports['killProcess']=function(_0x5be261,_0x18d704){var _0x22c6d1=['components/import/cm'];return new BPromise(function(_0x3bc64f,_0x1ee7d1){return exec(util[_0x1542('0xb')](_0x1542('0xc'),_0x5be261['params'][_0x1542('0xd')]),function(_0xdfa924,_0xe838f1,_0x39a850){if(_0xdfa924){return _0x1ee7d1(_0xdfa924);}return _0x3bc64f(_0xe838f1);});})[_0x1542('0xe')](function(_0xe299db){var _0x370102=![];var _0x544390=_0xe299db['split'](/\n/);for(var _0x21df8a=0x0,_0x2b63da=_0x22c6d1[_0x1542('0xf')];_0x21df8a<_0x2b63da,_0x370102===![];_0x21df8a+=0x1){if(_0xe299db[_0x1542('0x10')](_0x22c6d1[_0x21df8a])>=0x0){_0x370102=!![];}}if(!_0x370102){throw new Error(util[_0x1542('0xb')](_0x1542('0x11'),_0x5be261['params'][_0x1542('0xd')]));}process[_0x1542('0x12')](_0x5be261['params'][_0x1542('0xd')],_0x1542('0x13'));return _0x18d704[_0x1542('0xa')](0xc8)[_0x1542('0x9')]({'message':util[_0x1542('0xb')](_0x1542('0x14'),_0x5be261['params'][_0x1542('0xd')])});})['catch'](handleError(_0x18d704,null,_0x1542('0x15')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e0db1e0..01151af 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 _0x8603=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x297d6f,_0x12c8be){var _0x4e0852=function(_0x37780e){while(--_0x37780e){_0x297d6f['push'](_0x297d6f['shift']());}};_0x4e0852(++_0x12c8be);}(_0x8603,0x190));var _0x3860=function(_0x1eff1a,_0x5d05a9){_0x1eff1a=_0x1eff1a-0x0;var _0x478b4b=_0x8603[_0x1eff1a];return _0x478b4b;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./tag.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3860('0xb')](_0x3860('0x8'),auth['isAuthenticated'](),controller[_0x3860('0xc')]);router[_0x3860('0xd')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xe')]);module['exports']=router; \ No newline at end of file +var _0x8603=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x553c2a,_0x592c23){var _0x37988b=function(_0x5ccdf1){while(--_0x5ccdf1){_0x553c2a['push'](_0x553c2a['shift']());}};_0x37988b(++_0x592c23);}(_0x8603,0x190));var _0x3860=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x8603[_0x5528c3];return _0x47ec1b;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./tag.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3860('0xb')](_0x3860('0x8'),auth['isAuthenticated'](),controller[_0x3860('0xc')]);router[_0x3860('0xd')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7e77a8c..1cd1e8c 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 _0x77a9=['name','#0091EA','sequelize','exports','STRING'];(function(_0x202606,_0x2555f5){var _0x3bce6c=function(_0x4d461a){while(--_0x4d461a){_0x202606['push'](_0x202606['shift']());}};_0x3bce6c(++_0x2555f5);}(_0x77a9,0xe8));var _0x977a=function(_0x298d35,_0x416e41){_0x298d35=_0x298d35-0x0;var _0x495725=_0x77a9[_0x298d35];return _0x495725;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'name':{'type':Sequelize[_0x977a('0x2')],'unique':_0x977a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x977a('0x2')],'defaultValue':_0x977a('0x4')},'description':{'type':Sequelize[_0x977a('0x2')]}}; \ No newline at end of file +var _0x3916=['sequelize','exports','STRING','name','#0091EA'];(function(_0x2cf7a5,_0x44dd28){var _0x241fba=function(_0x5fc7b4){while(--_0x5fc7b4){_0x2cf7a5['push'](_0x2cf7a5['shift']());}};_0x241fba(++_0x44dd28);}(_0x3916,0x1c7));var _0x6391=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0x3916[_0xfbe06e];return _0x24e5b6;};'use strict';var Sequelize=require(_0x6391('0x0'));module[_0x6391('0x1')]={'name':{'type':Sequelize[_0x6391('0x2')],'unique':_0x6391('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x6391('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f0fdac3..c4aa9a6 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 _0xbfdd=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','sendStatus','stack','name','send','index','Tag','rawAttributes','keys','query','intersection','model','attributes','fields','order','sort','where','filters','pick','merge','map','key','field','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x584a03,_0x59e0c8){var _0x29d9c9=function(_0x27ea6f){while(--_0x27ea6f){_0x584a03['push'](_0x584a03['shift']());}};_0x29d9c9(++_0x59e0c8);}(_0xbfdd,0xe6));var _0xdbfd=function(_0x1e5725,_0x3f4e13){_0x1e5725=_0x1e5725-0x0;var _0x4b5cf8=_0xbfdd[_0x1e5725];return _0x4b5cf8;};'use strict';var pdf=require(_0xdbfd('0x0'));var emlformat=require(_0xdbfd('0x1'));var rimraf=require(_0xdbfd('0x2'));var zipdir=require(_0xdbfd('0x3'));var jsonpatch=require(_0xdbfd('0x4'));var rp=require(_0xdbfd('0x5'));var moment=require(_0xdbfd('0x6'));var BPromise=require(_0xdbfd('0x7'));var Mustache=require(_0xdbfd('0x8'));var util=require('util');var path=require(_0xdbfd('0x9'));var sox=require('sox');var csv=require(_0xdbfd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdbfd('0xb'));var squel=require('squel');var crypto=require(_0xdbfd('0xc'));var jsforce=require(_0xdbfd('0xd'));var deskjs=require(_0xdbfd('0xe'));var toCsv=require(_0xdbfd('0xa'));var querystring=require(_0xdbfd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbfd('0x10'));var hardwareService=require(_0xdbfd('0x11'));var logger=require(_0xdbfd('0x12'))(_0xdbfd('0x13'));var utils=require(_0xdbfd('0x14'));var config=require(_0xdbfd('0x15'));var db=require(_0xdbfd('0x16'))['db'];function respondWithStatusCode(_0x526bc6,_0x1d5525){_0x1d5525=_0x1d5525||0xcc;return function(_0x1a0877){if(_0x1a0877){return _0x526bc6['sendStatus'](_0x1d5525);}return _0x526bc6[_0xdbfd('0x17')](_0x1d5525)[_0xdbfd('0x18')]();};}function respondWithResult(_0x3c5131,_0x18b0df){_0x18b0df=_0x18b0df||0xc8;return function(_0x2b891a){if(_0x2b891a){return _0x3c5131['status'](_0x18b0df)[_0xdbfd('0x19')](_0x2b891a);}};}function respondWithFilteredResult(_0x50c4e9,_0x5e1894){return function(_0x24963f){if(_0x24963f){var _0x10800c=_0x24963f[_0xdbfd('0x1a')],_0x8dd8e7=_0x5e1894[_0xdbfd('0x1b')],_0x38ff8a=_0x5e1894[_0xdbfd('0x1b')]+_0x5e1894[_0xdbfd('0x1c')],_0x566321;if(_0x38ff8a>=_0x10800c){_0x38ff8a=_0x10800c;_0x566321=0xc8;}else{_0x566321=0xce;}_0x50c4e9[_0xdbfd('0x17')](_0x566321);return _0x50c4e9[_0xdbfd('0x1d')](_0xdbfd('0x1e'),_0x8dd8e7+'-'+_0x38ff8a+'/'+_0x10800c)['json'](_0x24963f);}return null;};}function patchUpdates(_0x631db1){return function(_0x472fea){try{jsonpatch[_0xdbfd('0x1f')](_0x472fea,_0x631db1,!![]);}catch(_0x3f277d){return BPromise[_0xdbfd('0x20')](_0x3f277d);}return _0x472fea[_0xdbfd('0x21')]();};}function saveUpdates(_0x551d13,_0x3d519a){return function(_0x207a92){if(_0x207a92){return _0x207a92[_0xdbfd('0x22')](_0x551d13)[_0xdbfd('0x23')](function(_0x35a965){return _0x35a965;});}return null;};}function removeEntity(_0x2849dc,_0x3b0941){return function(_0x3e6183){if(_0x3e6183){return _0x3e6183[_0xdbfd('0x24')]()['then'](function(){var _0x3e436d=_0x3e6183[_0xdbfd('0x25')]({'plain':!![]});var _0x69d6ce=_0xdbfd('0x26');return db['UserProfileResource'][_0xdbfd('0x24')]({'where':{'type':_0x69d6ce,'resourceId':_0x3e436d['id']}})[_0xdbfd('0x23')](function(){return _0x3e6183;});})[_0xdbfd('0x23')](function(){_0x2849dc[_0xdbfd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4459ee,_0x2becfe){return function(_0x4d1117){if(!_0x4d1117){_0x4459ee[_0xdbfd('0x27')](0x194);}return _0x4d1117;};}function handleError(_0x20b1d9,_0x5f3a0e){_0x5f3a0e=_0x5f3a0e||0x1f4;return function(_0xc080c){logger['error'](_0xc080c[_0xdbfd('0x28')]);if(_0xc080c[_0xdbfd('0x29')]){delete _0xc080c[_0xdbfd('0x29')];}_0x20b1d9['status'](_0x5f3a0e)[_0xdbfd('0x2a')](_0xc080c);};}exports[_0xdbfd('0x2b')]=function(_0x6bff36,_0x1eb232){var _0x1f95d4={},_0x83076c={},_0x3802a0={'count':0x0,'rows':[]};var _0x3b29a8=db[_0xdbfd('0x2c')][_0xdbfd('0x2d')];_0x83076c['model']=_[_0xdbfd('0x2e')](_0x3b29a8);_0x83076c[_0xdbfd('0x2f')]=_[_0xdbfd('0x2e')](_0x6bff36['query']);_0x83076c['filters']=_[_0xdbfd('0x30')](_0x83076c[_0xdbfd('0x31')],_0x83076c['query']);_0x1f95d4[_0xdbfd('0x32')]=_[_0xdbfd('0x30')](_0x83076c[_0xdbfd('0x31')],qs['fields'](_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x33')]));_0x1f95d4[_0xdbfd('0x32')]=_0x1f95d4['attributes']['length']?_0x1f95d4[_0xdbfd('0x32')]:_0x83076c[_0xdbfd('0x31')];if(!_0x6bff36[_0xdbfd('0x2f')]['hasOwnProperty']('nolimit')){_0x1f95d4['limit']=qs['limit'](_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x1c')]);_0x1f95d4[_0xdbfd('0x1b')]=qs[_0xdbfd('0x1b')](_0x6bff36[_0xdbfd('0x2f')]['offset']);}_0x1f95d4[_0xdbfd('0x34')]=qs[_0xdbfd('0x35')](_0x6bff36['query'][_0xdbfd('0x35')]);_0x1f95d4[_0xdbfd('0x36')]=qs[_0xdbfd('0x37')](_[_0xdbfd('0x38')](_0x6bff36['query'],_0x83076c[_0xdbfd('0x37')]));if(_0x6bff36[_0xdbfd('0x2f')]['filter']){_0x1f95d4[_0xdbfd('0x36')]=_[_0xdbfd('0x39')](_0x1f95d4['where'],{'$or':_[_0xdbfd('0x3a')](_0x3b29a8,function(_0x4b7bbb){if(_0x4b7bbb['type'][_0xdbfd('0x3b')]!=='VIRTUAL'){var _0x9421f1={};_0x9421f1[_0x4b7bbb[_0xdbfd('0x3c')]]={'$like':'%'+_0x6bff36[_0xdbfd('0x2f')]['filter']+'%'};return _0x9421f1;}})});}_0x1f95d4=_[_0xdbfd('0x39')]({},_0x1f95d4,_0x6bff36[_0xdbfd('0x3d')]);var _0x2afe64={'where':_0x1f95d4['where']};return db[_0xdbfd('0x2c')][_0xdbfd('0x1a')](_0x2afe64)['then'](function(_0x3a9c07){_0x3802a0[_0xdbfd('0x1a')]=_0x3a9c07;if(_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x3e')]){_0x1f95d4[_0xdbfd('0x3f')]=[{'all':!![]}];}return db[_0xdbfd('0x2c')][_0xdbfd('0x40')](_0x1f95d4);})[_0xdbfd('0x23')](function(_0x3318d8){_0x3802a0[_0xdbfd('0x41')]=_0x3318d8;return _0x3802a0;})['then'](respondWithFilteredResult(_0x1eb232,_0x1f95d4))[_0xdbfd('0x42')](handleError(_0x1eb232,null));};exports[_0xdbfd('0x43')]=function(_0x68360d,_0x1cd93a){var _0x4022bf={'raw':!![],'where':{'id':_0x68360d[_0xdbfd('0x44')]['id']}},_0x43da7e={};_0x43da7e[_0xdbfd('0x31')]=_[_0xdbfd('0x2e')](db['Tag'][_0xdbfd('0x2d')]);_0x43da7e[_0xdbfd('0x2f')]=_[_0xdbfd('0x2e')](_0x68360d[_0xdbfd('0x2f')]);_0x43da7e[_0xdbfd('0x37')]=_[_0xdbfd('0x30')](_0x43da7e[_0xdbfd('0x31')],_0x43da7e[_0xdbfd('0x2f')]);_0x4022bf[_0xdbfd('0x32')]=_[_0xdbfd('0x30')](_0x43da7e[_0xdbfd('0x31')],qs[_0xdbfd('0x33')](_0x68360d[_0xdbfd('0x2f')]['fields']));_0x4022bf[_0xdbfd('0x32')]=_0x4022bf['attributes'][_0xdbfd('0x45')]?_0x4022bf['attributes']:_0x43da7e[_0xdbfd('0x31')];if(_0x68360d[_0xdbfd('0x2f')][_0xdbfd('0x3e')]){_0x4022bf[_0xdbfd('0x3f')]=[{'all':!![]}];}_0x4022bf=_['merge']({},_0x4022bf,_0x68360d['options']);return db[_0xdbfd('0x2c')]['find'](_0x4022bf)[_0xdbfd('0x23')](handleEntityNotFound(_0x1cd93a,null))[_0xdbfd('0x23')](respondWithResult(_0x1cd93a,null))['catch'](handleError(_0x1cd93a,null));};exports[_0xdbfd('0x46')]=function(_0x4cbec2,_0x4a5aa3){return db[_0xdbfd('0x2c')][_0xdbfd('0x46')](_0x4cbec2[_0xdbfd('0x47')],{})[_0xdbfd('0x23')](function(_0x550106){var _0x2434fa=_0x4cbec2[_0xdbfd('0x48')][_0xdbfd('0x25')]({'plain':!![]});if(!_0x2434fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2434fa[_0xdbfd('0x49')]===_0xdbfd('0x48')){var _0x4ea613=_0x550106[_0xdbfd('0x25')]({'plain':!![]});var _0xf74ecf=_0xdbfd('0x26');return db[_0xdbfd('0x4a')][_0xdbfd('0x4b')]({'where':{'name':_0xf74ecf,'userProfileId':_0x2434fa['userProfileId']},'raw':!![]})[_0xdbfd('0x23')](function(_0x36b668){if(_0x36b668&&_0x36b668['autoAssociation']===0x0){return db[_0xdbfd('0x4c')][_0xdbfd('0x46')]({'name':_0x4ea613[_0xdbfd('0x29')],'resourceId':_0x4ea613['id'],'type':_0x36b668['name'],'sectionId':_0x36b668['id']},{})[_0xdbfd('0x23')](function(){return _0x550106;});}else{return _0x550106;}})[_0xdbfd('0x42')](function(_0x45b09f){logger['error'](_0xdbfd('0x4d'),_0x45b09f);throw _0x45b09f;});}return _0x550106;})['then'](respondWithResult(_0x4a5aa3,0xc9))[_0xdbfd('0x42')](handleError(_0x4a5aa3,null));};exports[_0xdbfd('0x22')]=function(_0x460fa0,_0x5bf341){if(_0x460fa0[_0xdbfd('0x47')]['id']){delete _0x460fa0[_0xdbfd('0x47')]['id'];}return db[_0xdbfd('0x2c')][_0xdbfd('0x4b')]({'where':{'id':_0x460fa0[_0xdbfd('0x44')]['id']}})[_0xdbfd('0x23')](handleEntityNotFound(_0x5bf341,null))[_0xdbfd('0x23')](saveUpdates(_0x460fa0[_0xdbfd('0x47')],null))[_0xdbfd('0x23')](respondWithResult(_0x5bf341,null))[_0xdbfd('0x42')](handleError(_0x5bf341,null));};exports['destroy']=function(_0x3dc0fc,_0x1dbbbf){return db['Tag'][_0xdbfd('0x4b')]({'where':{'id':_0x3dc0fc['params']['id']}})['then'](handleEntityNotFound(_0x1dbbbf,null))[_0xdbfd('0x23')](removeEntity(_0x1dbbbf,null))[_0xdbfd('0x42')](handleError(_0x1dbbbf,null));}; \ No newline at end of file +var _0x5cfc=['../../config/environment','status','count','offset','limit','set','json','reject','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','index','Tag','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0x5cfc,0x15d));var _0xc5cf=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x5cfc[_0x5a1cc9];return _0x471761;};'use strict';var pdf=require(_0xc5cf('0x0'));var emlformat=require(_0xc5cf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc5cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5cf('0x3'));var moment=require(_0xc5cf('0x4'));var BPromise=require(_0xc5cf('0x5'));var Mustache=require(_0xc5cf('0x6'));var util=require('util');var path=require(_0xc5cf('0x7'));var sox=require(_0xc5cf('0x8'));var csv=require('to-csv');var ejs=require(_0xc5cf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc5cf('0xa'));var crypto=require(_0xc5cf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc5cf('0xc'));var toCsv=require(_0xc5cf('0xd'));var querystring=require('querystring');var Papa=require(_0xc5cf('0xe'));var Redis=require(_0xc5cf('0xf'));var authService=require(_0xc5cf('0x10'));var qs=require(_0xc5cf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5cf('0x12'))(_0xc5cf('0x13'));var utils=require(_0xc5cf('0x14'));var config=require(_0xc5cf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x568972,_0x24ab95){_0x24ab95=_0x24ab95||0xcc;return function(_0x48c549){if(_0x48c549){return _0x568972['sendStatus'](_0x24ab95);}return _0x568972[_0xc5cf('0x16')](_0x24ab95)['end']();};}function respondWithResult(_0x157e8e,_0x550695){_0x550695=_0x550695||0xc8;return function(_0x4f284b){if(_0x4f284b){return _0x157e8e['status'](_0x550695)['json'](_0x4f284b);}};}function respondWithFilteredResult(_0x113d05,_0x5742c3){return function(_0x44ce40){if(_0x44ce40){var _0x6f65e3=_0x44ce40[_0xc5cf('0x17')],_0x4275e6=_0x5742c3[_0xc5cf('0x18')],_0x372b1d=_0x5742c3['offset']+_0x5742c3[_0xc5cf('0x19')],_0x9eba43;if(_0x372b1d>=_0x6f65e3){_0x372b1d=_0x6f65e3;_0x9eba43=0xc8;}else{_0x9eba43=0xce;}_0x113d05[_0xc5cf('0x16')](_0x9eba43);return _0x113d05[_0xc5cf('0x1a')]('Content-Range',_0x4275e6+'-'+_0x372b1d+'/'+_0x6f65e3)[_0xc5cf('0x1b')](_0x44ce40);}return null;};}function patchUpdates(_0x324dc0){return function(_0x161f97){try{jsonpatch['apply'](_0x161f97,_0x324dc0,!![]);}catch(_0x5ba4ca){return BPromise[_0xc5cf('0x1c')](_0x5ba4ca);}return _0x161f97['save']();};}function saveUpdates(_0x545fb7,_0x43472a){return function(_0x5e81b2){if(_0x5e81b2){return _0x5e81b2[_0xc5cf('0x1d')](_0x545fb7)[_0xc5cf('0x1e')](function(_0x426c30){return _0x426c30;});}return null;};}function removeEntity(_0x512ddb,_0x5394db){return function(_0x330a3a){if(_0x330a3a){return _0x330a3a[_0xc5cf('0x1f')]()[_0xc5cf('0x1e')](function(){var _0x23209f=_0x330a3a['get']({'plain':!![]});var _0x9672e0=_0xc5cf('0x20');return db[_0xc5cf('0x21')][_0xc5cf('0x1f')]({'where':{'type':_0x9672e0,'resourceId':_0x23209f['id']}})[_0xc5cf('0x1e')](function(){return _0x330a3a;});})[_0xc5cf('0x1e')](function(){_0x512ddb['status'](0xcc)[_0xc5cf('0x22')]();});}};}function handleEntityNotFound(_0x3a3525,_0x215468){return function(_0x30a9c2){if(!_0x30a9c2){_0x3a3525[_0xc5cf('0x23')](0x194);}return _0x30a9c2;};}function handleError(_0x275b42,_0x27633e){_0x27633e=_0x27633e||0x1f4;return function(_0x59c3fe){logger[_0xc5cf('0x24')](_0x59c3fe[_0xc5cf('0x25')]);if(_0x59c3fe['name']){delete _0x59c3fe['name'];}_0x275b42[_0xc5cf('0x16')](_0x27633e)['send'](_0x59c3fe);};}exports[_0xc5cf('0x26')]=function(_0x213525,_0x55d119){var _0x404bfe={},_0x1aac55={},_0x3e938a={'count':0x0,'rows':[]};var _0x46bf2e=db[_0xc5cf('0x27')][_0xc5cf('0x28')];_0x1aac55[_0xc5cf('0x29')]=_[_0xc5cf('0x2a')](_0x46bf2e);_0x1aac55[_0xc5cf('0x2b')]=_[_0xc5cf('0x2a')](_0x213525[_0xc5cf('0x2b')]);_0x1aac55[_0xc5cf('0x2c')]=_[_0xc5cf('0x2d')](_0x1aac55[_0xc5cf('0x29')],_0x1aac55[_0xc5cf('0x2b')]);_0x404bfe[_0xc5cf('0x2e')]=_[_0xc5cf('0x2d')](_0x1aac55[_0xc5cf('0x29')],qs[_0xc5cf('0x2f')](_0x213525['query'][_0xc5cf('0x2f')]));_0x404bfe[_0xc5cf('0x2e')]=_0x404bfe['attributes'][_0xc5cf('0x30')]?_0x404bfe['attributes']:_0x1aac55['model'];if(!_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x31')]('nolimit')){_0x404bfe[_0xc5cf('0x19')]=qs[_0xc5cf('0x19')](_0x213525[_0xc5cf('0x2b')]['limit']);_0x404bfe[_0xc5cf('0x18')]=qs['offset'](_0x213525[_0xc5cf('0x2b')]['offset']);}_0x404bfe['order']=qs['sort'](_0x213525['query']['sort']);_0x404bfe[_0xc5cf('0x32')]=qs[_0xc5cf('0x2c')](_[_0xc5cf('0x33')](_0x213525[_0xc5cf('0x2b')],_0x1aac55[_0xc5cf('0x2c')]));if(_0x213525['query'][_0xc5cf('0x34')]){_0x404bfe[_0xc5cf('0x32')]=_[_0xc5cf('0x35')](_0x404bfe['where'],{'$or':_[_0xc5cf('0x36')](_0x46bf2e,function(_0x589e4f){if(_0x589e4f[_0xc5cf('0x37')]['key']!==_0xc5cf('0x38')){var _0x302cd3={};_0x302cd3[_0x589e4f[_0xc5cf('0x39')]]={'$like':'%'+_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x34')]+'%'};return _0x302cd3;}})});}_0x404bfe=_[_0xc5cf('0x35')]({},_0x404bfe,_0x213525[_0xc5cf('0x3a')]);var _0xdea622={'where':_0x404bfe['where']};return db[_0xc5cf('0x27')]['count'](_0xdea622)[_0xc5cf('0x1e')](function(_0x3fb118){_0x3e938a[_0xc5cf('0x17')]=_0x3fb118;if(_0x213525[_0xc5cf('0x2b')][_0xc5cf('0x3b')]){_0x404bfe[_0xc5cf('0x3c')]=[{'all':!![]}];}return db['Tag'][_0xc5cf('0x3d')](_0x404bfe);})['then'](function(_0x48ac65){_0x3e938a[_0xc5cf('0x3e')]=_0x48ac65;return _0x3e938a;})[_0xc5cf('0x1e')](respondWithFilteredResult(_0x55d119,_0x404bfe))['catch'](handleError(_0x55d119,null));};exports['show']=function(_0x1771e8,_0x26f395){var _0x170300={'raw':!![],'where':{'id':_0x1771e8[_0xc5cf('0x3f')]['id']}},_0x3ba6ce={};_0x3ba6ce[_0xc5cf('0x29')]=_[_0xc5cf('0x2a')](db['Tag'][_0xc5cf('0x28')]);_0x3ba6ce[_0xc5cf('0x2b')]=_[_0xc5cf('0x2a')](_0x1771e8[_0xc5cf('0x2b')]);_0x3ba6ce[_0xc5cf('0x2c')]=_['intersection'](_0x3ba6ce[_0xc5cf('0x29')],_0x3ba6ce[_0xc5cf('0x2b')]);_0x170300[_0xc5cf('0x2e')]=_['intersection'](_0x3ba6ce[_0xc5cf('0x29')],qs[_0xc5cf('0x2f')](_0x1771e8[_0xc5cf('0x2b')][_0xc5cf('0x2f')]));_0x170300[_0xc5cf('0x2e')]=_0x170300['attributes'][_0xc5cf('0x30')]?_0x170300[_0xc5cf('0x2e')]:_0x3ba6ce[_0xc5cf('0x29')];if(_0x1771e8[_0xc5cf('0x2b')][_0xc5cf('0x3b')]){_0x170300[_0xc5cf('0x3c')]=[{'all':!![]}];}_0x170300=_['merge']({},_0x170300,_0x1771e8['options']);return db[_0xc5cf('0x27')][_0xc5cf('0x40')](_0x170300)['then'](handleEntityNotFound(_0x26f395,null))[_0xc5cf('0x1e')](respondWithResult(_0x26f395,null))['catch'](handleError(_0x26f395,null));};exports['create']=function(_0x59fde2,_0x1d86eb){return db['Tag']['create'](_0x59fde2['body'],{})[_0xc5cf('0x1e')](function(_0x51062f){var _0x57572d=_0x59fde2[_0xc5cf('0x41')]['get']({'plain':!![]});if(!_0x57572d)throw new Error(_0xc5cf('0x42'));if(_0x57572d[_0xc5cf('0x43')]===_0xc5cf('0x41')){var _0x596ce5=_0x51062f['get']({'plain':!![]});var _0x1c7239=_0xc5cf('0x20');return db[_0xc5cf('0x44')][_0xc5cf('0x40')]({'where':{'name':_0x1c7239,'userProfileId':_0x57572d[_0xc5cf('0x45')]},'raw':!![]})[_0xc5cf('0x1e')](function(_0x52088f){if(_0x52088f&&_0x52088f[_0xc5cf('0x46')]===0x0){return db[_0xc5cf('0x21')]['create']({'name':_0x596ce5[_0xc5cf('0x47')],'resourceId':_0x596ce5['id'],'type':_0x52088f[_0xc5cf('0x47')],'sectionId':_0x52088f['id']},{})['then'](function(){return _0x51062f;});}else{return _0x51062f;}})[_0xc5cf('0x48')](function(_0x37e443){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e443);throw _0x37e443;});}return _0x51062f;})[_0xc5cf('0x1e')](respondWithResult(_0x1d86eb,0xc9))[_0xc5cf('0x48')](handleError(_0x1d86eb,null));};exports[_0xc5cf('0x1d')]=function(_0x15594c,_0x485739){if(_0x15594c['body']['id']){delete _0x15594c[_0xc5cf('0x49')]['id'];}return db['Tag'][_0xc5cf('0x40')]({'where':{'id':_0x15594c[_0xc5cf('0x3f')]['id']}})[_0xc5cf('0x1e')](handleEntityNotFound(_0x485739,null))[_0xc5cf('0x1e')](saveUpdates(_0x15594c[_0xc5cf('0x49')],null))[_0xc5cf('0x1e')](respondWithResult(_0x485739,null))[_0xc5cf('0x48')](handleError(_0x485739,null));};exports['destroy']=function(_0xd28ac9,_0x41e8e2){return db[_0xc5cf('0x27')]['find']({'where':{'id':_0xd28ac9[_0xc5cf('0x3f')]['id']}})[_0xc5cf('0x1e')](handleEntityNotFound(_0x41e8e2,null))[_0xc5cf('0x1e')](removeEntity(_0x41e8e2,null))[_0xc5cf('0x48')](handleError(_0x41e8e2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7d542a0..c1e34af 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 _0x16db=['api','bluebird','path','rimraf','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x16db,0x147));var _0xb16d=function(_0x5205e7,_0x2ebe05){_0x5205e7=_0x5205e7-0x0;var _0x459853=_0x16db[_0x5205e7];return _0x459853;};'use strict';var _=require(_0xb16d('0x0'));var util=require(_0xb16d('0x1'));var logger=require(_0xb16d('0x2'))(_0xb16d('0x3'));var moment=require('moment');var BPromise=require(_0xb16d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb16d('0x5'));var rimraf=require(_0xb16d('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x28e2d9,_0xa15963){return _0x28e2d9[_0xb16d('0x7')](_0xb16d('0x8'),attributes,{'tableName':_0xb16d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d19=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x46d84a,_0x130941){var _0x1d5080=function(_0x5a6531){while(--_0x5a6531){_0x46d84a['push'](_0x46d84a['shift']());}};_0x1d5080(++_0x130941);}(_0x8d19,0x16e));var _0x98d1=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x8d19[_0x6173fc];return _0x965fbe;};'use strict';var _=require(_0x98d1('0x0'));var util=require(_0x98d1('0x1'));var logger=require(_0x98d1('0x2'))(_0x98d1('0x3'));var moment=require(_0x98d1('0x4'));var BPromise=require(_0x98d1('0x5'));var rp=require(_0x98d1('0x6'));var fs=require('fs');var path=require(_0x98d1('0x7'));var rimraf=require(_0x98d1('0x8'));var config=require(_0x98d1('0x9'));var attributes=require(_0x98d1('0xa'));module[_0x98d1('0xb')]=function(_0x5c27bc,_0x5c00c2){return _0x5c27bc[_0x98d1('0xc')]('Tag',attributes,{'tableName':'tools_tags','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 fed7899..d800bac 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 _0x435c=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1aef47,_0x302cc9){var _0x4cf42b=function(_0x17184f){while(--_0x17184f){_0x1aef47['push'](_0x1aef47['shift']());}};_0x4cf42b(++_0x302cc9);}(_0x435c,0x178));var _0xc435=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x435c[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0xc435('0x0'));var util=require(_0xc435('0x1'));var moment=require(_0xc435('0x2'));var BPromise=require(_0xc435('0x3'));var rs=require(_0xc435('0x4'));var fs=require('fs');var Redis=require(_0xc435('0x5'));var db=require(_0xc435('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc435('0x7'));var config=require('../../config/environment');var jayson=require(_0xc435('0x8'));var client=jayson[_0xc435('0x9')][_0xc435('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22890d,_0x3bc103,_0x3730f3){return new BPromise(function(_0x55acff,_0xf061b0){return client[_0xc435('0xb')](_0x22890d,_0x3730f3)[_0xc435('0xc')](function(_0x5e86c4){logger['info'](_0xc435('0xd'),_0x3bc103,_0xc435('0xe'));logger['debug'](_0xc435('0xf'),_0x3bc103,'request\x20sent',JSON[_0xc435('0x10')](_0x5e86c4));if(_0x5e86c4[_0xc435('0x11')]){if(_0x5e86c4['error'][_0xc435('0x12')]===0x1f4){logger[_0xc435('0x11')]('Tag,\x20%s,\x20%s',_0x3bc103,_0x5e86c4[_0xc435('0x11')]['message']);return _0xf061b0(_0x5e86c4[_0xc435('0x11')][_0xc435('0x13')]);}logger[_0xc435('0x11')](_0xc435('0xd'),_0x3bc103,_0x5e86c4['error'][_0xc435('0x13')]);return _0x55acff(_0x5e86c4['error']['message']);}else{logger[_0xc435('0x14')](_0xc435('0xd'),_0x3bc103,_0xc435('0xe'));_0x55acff(_0x5e86c4['result'][_0xc435('0x13')]);}})[_0xc435('0x15')](function(_0x9f39e8){logger[_0xc435('0x11')](_0xc435('0xd'),_0x3bc103,_0x9f39e8);_0xf061b0(_0x9f39e8);});});} \ No newline at end of file +var _0xaa4a=['client','http','then','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x372431,_0x5df362){var _0xd43b03=function(_0x4cda84){while(--_0x4cda84){_0x372431['push'](_0x372431['shift']());}};_0xd43b03(++_0x5df362);}(_0xaa4a,0x109));var _0xaaa4=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xaa4a[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xaaa4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaaa4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaa4('0x2'))['db'];var utils=require(_0xaaa4('0x3'));var logger=require(_0xaaa4('0x4'))(_0xaaa4('0x5'));var config=require(_0xaaa4('0x6'));var jayson=require(_0xaaa4('0x7'));var client=jayson[_0xaaa4('0x8')][_0xaaa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf660f7,_0x52e20f,_0x127562){return new BPromise(function(_0x59a02f,_0x178961){return client['request'](_0xf660f7,_0x127562)[_0xaaa4('0xa')](function(_0x45a410){logger[_0xaaa4('0xb')](_0xaaa4('0xc'),_0x52e20f,'request\x20sent');logger['debug'](_0xaaa4('0xd'),_0x52e20f,'request\x20sent',JSON[_0xaaa4('0xe')](_0x45a410));if(_0x45a410['error']){if(_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x10')]===0x1f4){logger['error'](_0xaaa4('0xc'),_0x52e20f,_0x45a410['error'][_0xaaa4('0x11')]);return _0x178961(_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x11')]);}logger[_0xaaa4('0xf')](_0xaaa4('0xc'),_0x52e20f,_0x45a410[_0xaaa4('0xf')][_0xaaa4('0x11')]);return _0x59a02f(_0x45a410[_0xaaa4('0xf')]['message']);}else{logger[_0xaaa4('0xb')](_0xaaa4('0xc'),_0x52e20f,_0xaaa4('0x12'));_0x59a02f(_0x45a410[_0xaaa4('0x13')][_0xaaa4('0x11')]);}})[_0xaaa4('0x14')](function(_0x1f2ee9){logger[_0xaaa4('0xf')](_0xaaa4('0xc'),_0x52e20f,_0x1f2ee9);_0x178961(_0x1f2ee9);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 514d80b..594adf4 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 _0xab3c=['/:id/queues','addQueues','post','addAgents','put','update','destroy','delete','removeQueues','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getQueues','/:id/users','getAgents'];(function(_0x784a9f,_0x1acdd7){var _0x23c18b=function(_0x3bc9d2){while(--_0x3bc9d2){_0x784a9f['push'](_0x784a9f['shift']());}};_0x23c18b(++_0x1acdd7);}(_0xab3c,0x150));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xcab3('0x0'));var path=require(_0xcab3('0x1'));var timeout=require('connect-timeout');var express=require(_0xcab3('0x2'));var router=express[_0xcab3('0x3')]();var auth=require(_0xcab3('0x4'));var interaction=require(_0xcab3('0x5'));var config=require(_0xcab3('0x6'));var controller=require('./team.controller');router[_0xcab3('0x7')]('/',auth['isAuthenticated'](),controller[_0xcab3('0x8')]);router['get'](_0xcab3('0x9'),auth[_0xcab3('0xa')](),controller['show']);router[_0xcab3('0x7')]('/:id/queues',auth[_0xcab3('0xa')](),controller[_0xcab3('0xb')]);router[_0xcab3('0x7')](_0xcab3('0xc'),auth[_0xcab3('0xa')](),controller[_0xcab3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xcab3('0xe'),auth[_0xcab3('0xa')](),controller[_0xcab3('0xf')]);router[_0xcab3('0x10')](_0xcab3('0xc'),auth['isAuthenticated'](),controller[_0xcab3('0x11')]);router[_0xcab3('0x12')](_0xcab3('0x9'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xcab3('0x14')]);router[_0xcab3('0x15')](_0xcab3('0xe'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x16')]);router[_0xcab3('0x15')](_0xcab3('0xc'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x17')]);module[_0xcab3('0x18')]=router; \ No newline at end of file +var _0xddab=['Router','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','get','/:id','show','/:id/queues','/:id/users','getAgents','post','create','addQueues','addAgents','put','destroy','removeQueues','delete','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x5a7ed0,_0x27aae9){var _0x4a8cae=function(_0x443370){while(--_0x443370){_0x5a7ed0['push'](_0x5a7ed0['shift']());}};_0x4a8cae(++_0x27aae9);}(_0xddab,0x168));var _0xbdda=function(_0xa38c8e,_0x417d67){_0xa38c8e=_0xa38c8e-0x0;var _0x328786=_0xddab[_0xa38c8e];return _0x328786;};'use strict';var multer=require('multer');var util=require(_0xbdda('0x0'));var path=require(_0xbdda('0x1'));var timeout=require(_0xbdda('0x2'));var express=require(_0xbdda('0x3'));var router=express[_0xbdda('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbdda('0x5'));var config=require(_0xbdda('0x6'));var controller=require(_0xbdda('0x7'));router['get']('/',auth[_0xbdda('0x8')](),controller[_0xbdda('0x9')]);router[_0xbdda('0xa')](_0xbdda('0xb'),auth[_0xbdda('0x8')](),controller[_0xbdda('0xc')]);router[_0xbdda('0xa')](_0xbdda('0xd'),auth['isAuthenticated'](),controller['getQueues']);router[_0xbdda('0xa')](_0xbdda('0xe'),auth['isAuthenticated'](),controller[_0xbdda('0xf')]);router[_0xbdda('0x10')]('/',auth[_0xbdda('0x8')](),controller[_0xbdda('0x11')]);router[_0xbdda('0x10')](_0xbdda('0xd'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x12')]);router[_0xbdda('0x10')](_0xbdda('0xe'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x13')]);router[_0xbdda('0x14')](_0xbdda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbdda('0xb'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x15')]);router['delete'](_0xbdda('0xd'),auth[_0xbdda('0x8')](),controller[_0xbdda('0x16')]);router[_0xbdda('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xbdda('0x18')]);module[_0xbdda('0x19')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 45cba1b..f035299 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 _0x836f=['STRING','name','sequelize','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x836f,0x132));var _0xf836=function(_0x428396,_0x5612fa){_0x428396=_0x428396-0x0;var _0x31b899=_0x836f[_0x428396];return _0x31b899;};'use strict';var Sequelize=require(_0xf836('0x0'));module[_0xf836('0x1')]={'name':{'type':Sequelize[_0xf836('0x2')],'allowNull':![],'unique':_0xf836('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2476=['exports','STRING','name'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x2476,0xcf));var _0x6247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2476[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6247('0x0')]={'name':{'type':Sequelize[_0x6247('0x1')],'allowNull':![],'unique':_0x6247('0x2')},'description':{'type':Sequelize[_0x6247('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 758b2a6..0f6fc06 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 _0x22b4=['omit','spread','emit','removeAgents','voice','chat','fax','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','get','Teams','UserProfileResource','end','error','stack','name','send','index','Team','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','Sequelize','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s'];(function(_0x3450af,_0x56beae){var _0x489a90=function(_0x451db1){while(--_0x451db1){_0x3450af['push'](_0x3450af['shift']());}};_0x489a90(++_0x56beae);}(_0x22b4,0x8b));var _0x422b=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x22b4[_0x49b207];return _0x2dc8fa;};'use strict';var pdf=require(_0x422b('0x0'));var emlformat=require(_0x422b('0x1'));var rimraf=require(_0x422b('0x2'));var zipdir=require(_0x422b('0x3'));var jsonpatch=require(_0x422b('0x4'));var rp=require(_0x422b('0x5'));var moment=require('moment');var BPromise=require(_0x422b('0x6'));var Mustache=require(_0x422b('0x7'));var util=require('util');var path=require(_0x422b('0x8'));var sox=require(_0x422b('0x9'));var csv=require(_0x422b('0xa'));var ejs=require(_0x422b('0xb'));var fs=require('fs');var _=require(_0x422b('0xc'));var squel=require(_0x422b('0xd'));var crypto=require('crypto');var jsforce=require(_0x422b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x422b('0xa'));var querystring=require(_0x422b('0xf'));var Papa=require(_0x422b('0x10'));var Redis=require(_0x422b('0x11'));var authService=require(_0x422b('0x12'));var qs=require(_0x422b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x422b('0x14'))(_0x422b('0x15'));var utils=require(_0x422b('0x16'));var config=require(_0x422b('0x17'));var db=require(_0x422b('0x18'))['db'];config[_0x422b('0x19')]=_[_0x422b('0x1a')](config[_0x422b('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x422b('0x19')]));require(_0x422b('0x1b'))[_0x422b('0x1c')](socket);function respondWithStatusCode(_0x803900,_0x2eadaa){_0x2eadaa=_0x2eadaa||0xcc;return function(_0x310622){if(_0x310622){return _0x803900[_0x422b('0x1d')](_0x2eadaa);}return _0x803900[_0x422b('0x1e')](_0x2eadaa)['end']();};}function respondWithResult(_0x1e40eb,_0x50a914){_0x50a914=_0x50a914||0xc8;return function(_0x3a98d6){if(_0x3a98d6){return _0x1e40eb[_0x422b('0x1e')](_0x50a914)[_0x422b('0x1f')](_0x3a98d6);}};}function respondWithFilteredResult(_0x2718e3,_0x328f45){return function(_0x433d0b){if(_0x433d0b){var _0x5aa006=_0x433d0b['count'],_0x338cf4=_0x328f45[_0x422b('0x20')],_0x29bef6=_0x328f45[_0x422b('0x20')]+_0x328f45[_0x422b('0x21')],_0x1fdb00;if(_0x29bef6>=_0x5aa006){_0x29bef6=_0x5aa006;_0x1fdb00=0xc8;}else{_0x1fdb00=0xce;}_0x2718e3[_0x422b('0x1e')](_0x1fdb00);return _0x2718e3[_0x422b('0x22')](_0x422b('0x23'),_0x338cf4+'-'+_0x29bef6+'/'+_0x5aa006)[_0x422b('0x1f')](_0x433d0b);}return null;};}function patchUpdates(_0x51049c){return function(_0x38665f){try{jsonpatch['apply'](_0x38665f,_0x51049c,!![]);}catch(_0x542b3c){return BPromise[_0x422b('0x24')](_0x542b3c);}return _0x38665f['save']();};}function saveUpdates(_0x44f98c,_0x5d1582){return function(_0x3f7619){if(_0x3f7619){return _0x3f7619[_0x422b('0x25')](_0x44f98c)[_0x422b('0x26')](function(_0x5d0f47){return _0x5d0f47;});}return null;};}function removeEntity(_0x394c50,_0x21fb07){return function(_0x3c34db){if(_0x3c34db){return _0x3c34db[_0x422b('0x27')]()[_0x422b('0x26')](function(){var _0x3e4c83=_0x3c34db[_0x422b('0x28')]({'plain':!![]});var _0x1f7d44=_0x422b('0x29');return db[_0x422b('0x2a')][_0x422b('0x27')]({'where':{'type':_0x1f7d44,'resourceId':_0x3e4c83['id']}})['then'](function(){return _0x3c34db;});})[_0x422b('0x26')](function(){_0x394c50[_0x422b('0x1e')](0xcc)[_0x422b('0x2b')]();});}};}function handleEntityNotFound(_0x5b375f,_0x48d2d9){return function(_0x49e645){if(!_0x49e645){_0x5b375f[_0x422b('0x1d')](0x194);}return _0x49e645;};}function handleError(_0x33fb06,_0x556d53){_0x556d53=_0x556d53||0x1f4;return function(_0xf19907){logger[_0x422b('0x2c')](_0xf19907[_0x422b('0x2d')]);if(_0xf19907[_0x422b('0x2e')]){delete _0xf19907[_0x422b('0x2e')];}_0x33fb06[_0x422b('0x1e')](_0x556d53)[_0x422b('0x2f')](_0xf19907);};}exports[_0x422b('0x30')]=function(_0x51c408,_0x55779d){var _0xb8eaaa={},_0x429cff={},_0x1a73c6={'count':0x0,'rows':[]};var _0x58d571=db[_0x422b('0x31')][_0x422b('0x32')];_0x429cff['model']=_[_0x422b('0x33')](_0x58d571);_0x429cff[_0x422b('0x34')]=_[_0x422b('0x33')](_0x51c408[_0x422b('0x34')]);_0x429cff[_0x422b('0x35')]=_[_0x422b('0x36')](_0x429cff[_0x422b('0x37')],_0x429cff[_0x422b('0x34')]);_0xb8eaaa[_0x422b('0x38')]=_[_0x422b('0x36')](_0x429cff[_0x422b('0x37')],qs[_0x422b('0x39')](_0x51c408['query'][_0x422b('0x39')]));_0xb8eaaa[_0x422b('0x38')]=_0xb8eaaa['attributes'][_0x422b('0x3a')]?_0xb8eaaa[_0x422b('0x38')]:_0x429cff[_0x422b('0x37')];if(!_0x51c408[_0x422b('0x34')][_0x422b('0x3b')](_0x422b('0x3c'))){_0xb8eaaa[_0x422b('0x21')]=qs[_0x422b('0x21')](_0x51c408[_0x422b('0x34')][_0x422b('0x21')]);_0xb8eaaa['offset']=qs[_0x422b('0x20')](_0x51c408[_0x422b('0x34')][_0x422b('0x20')]);}_0xb8eaaa[_0x422b('0x3d')]=qs[_0x422b('0x3e')](_0x51c408[_0x422b('0x34')][_0x422b('0x3e')]);_0xb8eaaa[_0x422b('0x3f')]=qs[_0x422b('0x35')](_[_0x422b('0x40')](_0x51c408['query'],_0x429cff[_0x422b('0x35')]));if(_0x51c408[_0x422b('0x34')][_0x422b('0x41')]){_0xb8eaaa[_0x422b('0x3f')]=_[_0x422b('0x42')](_0xb8eaaa[_0x422b('0x3f')],{'$or':_[_0x422b('0x43')](_0x58d571,function(_0x3a0c12){if(_0x3a0c12['type'][_0x422b('0x44')]!==_0x422b('0x45')){var _0xc37ba7={};_0xc37ba7[_0x3a0c12['field']]={'$like':'%'+_0x51c408[_0x422b('0x34')][_0x422b('0x41')]+'%'};return _0xc37ba7;}})});}_0xb8eaaa=_[_0x422b('0x42')]({},_0xb8eaaa,_0x51c408[_0x422b('0x46')]);var _0x219d5c={'where':_0xb8eaaa[_0x422b('0x3f')]};return db[_0x422b('0x31')][_0x422b('0x47')](_0x219d5c)[_0x422b('0x26')](function(_0xc06469){_0x1a73c6[_0x422b('0x47')]=_0xc06469;if(_0x51c408[_0x422b('0x34')][_0x422b('0x48')]){_0xb8eaaa[_0x422b('0x49')]=[{'all':!![]}];}return db[_0x422b('0x31')][_0x422b('0x4a')](_0xb8eaaa);})[_0x422b('0x26')](function(_0x386eaa){_0x1a73c6[_0x422b('0x4b')]=_0x386eaa;return _0x1a73c6;})['then'](respondWithFilteredResult(_0x55779d,_0xb8eaaa))[_0x422b('0x4c')](handleError(_0x55779d,null));};exports[_0x422b('0x4d')]=function(_0x40d3f8,_0x239cf9){var _0x35853e={'raw':![],'where':{'id':_0x40d3f8[_0x422b('0x4e')]['id']}},_0x45862b={};_0x45862b[_0x422b('0x37')]=_['keys'](db[_0x422b('0x31')][_0x422b('0x32')]);_0x45862b[_0x422b('0x34')]=_[_0x422b('0x33')](_0x40d3f8[_0x422b('0x34')]);_0x45862b[_0x422b('0x35')]=_['intersection'](_0x45862b[_0x422b('0x37')],_0x45862b[_0x422b('0x34')]);_0x35853e[_0x422b('0x38')]=_[_0x422b('0x36')](_0x45862b[_0x422b('0x37')],qs[_0x422b('0x39')](_0x40d3f8[_0x422b('0x34')][_0x422b('0x39')]));_0x35853e[_0x422b('0x38')]=_0x35853e[_0x422b('0x38')][_0x422b('0x3a')]?_0x35853e['attributes']:_0x45862b[_0x422b('0x37')];if(_0x40d3f8[_0x422b('0x34')][_0x422b('0x48')]){_0x35853e['include']=[{'all':!![]}];}_0x35853e=_[_0x422b('0x42')]({},_0x35853e,_0x40d3f8[_0x422b('0x46')]);return db[_0x422b('0x31')][_0x422b('0x4f')](_0x35853e)['then'](handleEntityNotFound(_0x239cf9,null))['then'](respondWithResult(_0x239cf9,null))[_0x422b('0x4c')](handleError(_0x239cf9,null));};exports[_0x422b('0x50')]=function(_0x26ac0,_0x5b70de){return db[_0x422b('0x31')][_0x422b('0x50')](_0x26ac0[_0x422b('0x51')],{})[_0x422b('0x26')](function(_0x4db99b){var _0x427f2e=_0x26ac0[_0x422b('0x52')]['get']({'plain':!![]});if(!_0x427f2e)throw new Error(_0x422b('0x53'));if(_0x427f2e[_0x422b('0x54')]===_0x422b('0x52')){var _0x3b3a92=_0x4db99b[_0x422b('0x28')]({'plain':!![]});var _0x530234='Teams';return db[_0x422b('0x55')][_0x422b('0x4f')]({'where':{'name':_0x530234,'userProfileId':_0x427f2e[_0x422b('0x56')]},'raw':!![]})['then'](function(_0x23f45d){if(_0x23f45d&&_0x23f45d[_0x422b('0x57')]===0x0){return db[_0x422b('0x2a')][_0x422b('0x50')]({'name':_0x3b3a92[_0x422b('0x2e')],'resourceId':_0x3b3a92['id'],'type':_0x23f45d['name'],'sectionId':_0x23f45d['id']},{})['then'](function(){return _0x4db99b;});}else{return _0x4db99b;}})[_0x422b('0x4c')](function(_0x222220){logger[_0x422b('0x2c')](_0x422b('0x58'),_0x222220);throw _0x222220;});}return _0x4db99b;})[_0x422b('0x26')](respondWithResult(_0x5b70de,0xc9))[_0x422b('0x4c')](handleError(_0x5b70de,null));};exports[_0x422b('0x25')]=function(_0x181f07,_0x36d650){if(_0x181f07['body']['id']){delete _0x181f07['body']['id'];}return db['Team'][_0x422b('0x4f')]({'where':{'id':_0x181f07['params']['id']}})['then'](handleEntityNotFound(_0x36d650,null))[_0x422b('0x26')](saveUpdates(_0x181f07[_0x422b('0x51')],null))[_0x422b('0x26')](respondWithResult(_0x36d650,null))[_0x422b('0x4c')](handleError(_0x36d650,null));};exports[_0x422b('0x27')]=function(_0x1797a9,_0x841d5){return db[_0x422b('0x31')][_0x422b('0x4f')]({'where':{'id':_0x1797a9[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x841d5,null))['then'](removeEntity(_0x841d5,null))[_0x422b('0x4c')](handleError(_0x841d5,null));};exports[_0x422b('0x59')]=function(_0xfa0b09,_0x186779,_0x22b617){return db[_0x422b('0x31')][_0x422b('0x5a')]({'where':{'id':_0xfa0b09[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x186779,null))['then'](function(_0x7d8316){if(!_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')]||!utils['isValidChannel'](_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')])){throw new db['Sequelize'][(_0x422b('0x5c'))](_0x422b('0x5d'));}var _0x46b99f={};var _0x7bce93={};_0x7bce93[_0x422b('0x37')]=_['keys'](db[_[_0x422b('0x5e')](_0xfa0b09['query'][_0x422b('0x5b')][_0x422b('0x5f')]())+_0x422b('0x60')][_0x422b('0x32')]);_0x7bce93['query']=_[_0x422b('0x33')](_0xfa0b09[_0x422b('0x34')]);_0x7bce93[_0x422b('0x35')]=_[_0x422b('0x36')](_0x7bce93[_0x422b('0x37')],_0x7bce93['query']);_0x46b99f[_0x422b('0x38')]=_['intersection'](_0x7bce93['model'],qs[_0x422b('0x39')](_0xfa0b09['query']['fields']));_0x46b99f[_0x422b('0x38')]=_0x46b99f[_0x422b('0x38')]['length']?_0x46b99f[_0x422b('0x38')]:_0x7bce93[_0x422b('0x37')];_0x46b99f['limit']=qs[_0x422b('0x21')](_0xfa0b09['query'][_0x422b('0x21')]);_0x46b99f[_0x422b('0x20')]=qs[_0x422b('0x20')](_0xfa0b09[_0x422b('0x34')][_0x422b('0x20')]);_0x46b99f['order']=qs[_0x422b('0x3e')](_0xfa0b09[_0x422b('0x34')][_0x422b('0x3e')]);_0x46b99f[_0x422b('0x3f')]=qs[_0x422b('0x35')](_['pick'](_0xfa0b09[_0x422b('0x34')],_0x7bce93[_0x422b('0x35')]));_0x46b99f=_[_0x422b('0x42')]({},_0x46b99f,_0xfa0b09[_0x422b('0x46')]);return _0x7d8316[_0x422b('0x28')+_['capitalize'](_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')][_0x422b('0x5f')]())+_0x422b('0x61')](_0x46b99f);})[_0x422b('0x26')](respondWithResult(_0x186779,null))[_0x422b('0x4c')](handleError(_0x186779,null));};exports[_0x422b('0x62')]=function(_0x3c28c2,_0x5247fc,_0x46010f){return db[_0x422b('0x31')][_0x422b('0x5a')]({'where':{'id':_0x3c28c2[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](function(_0x3b9c74){if(_0x3b9c74){if(!_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')]||!utils[_0x422b('0x63')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')])){throw new db[(_0x422b('0x64'))][(_0x422b('0x5c'))](_0x422b('0x5d'));}return _0x3b9c74[_0x422b('0x65')+_[_0x422b('0x5e')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')]['toLowerCase']())+_0x422b('0x61')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x66')]);}return null;})[_0x422b('0x26')](handleEntityNotFound(_0x5247fc,null))['then'](respondWithStatusCode(_0x5247fc,null))['catch'](handleError(_0x5247fc,null));};exports[_0x422b('0x67')]=function(_0xa76faf,_0x42c934,_0x585c30){return db[_0x422b('0x31')]['findOne']({'where':{'id':_0xa76faf[_0x422b('0x4e')]['id']}})['then'](function(_0x562ab2){if(_0x562ab2){if(!_0xa76faf[_0x422b('0x34')][_0x422b('0x5b')]||!utils[_0x422b('0x63')](_0xa76faf[_0x422b('0x34')][_0x422b('0x5b')])){throw new db[(_0x422b('0x64'))]['ValidationError']('Unknown\x20channel');}return _0x562ab2[_0x422b('0x68')+_[_0x422b('0x5e')](_0xa76faf['query'][_0x422b('0x5b')]['toLowerCase']())+_0x422b('0x61')](_0xa76faf['query'][_0x422b('0x66')]);}return null;})['then'](handleEntityNotFound(_0x42c934,null))[_0x422b('0x26')](respondWithStatusCode(_0x42c934,null))['catch'](handleError(_0x42c934,null));};exports[_0x422b('0x69')]=function(_0x1702d5,_0x740647,_0x274538){return db[_0x422b('0x31')][_0x422b('0x4f')]({'where':{'id':_0x1702d5[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x740647,null))[_0x422b('0x26')](function(_0x2b04d1){if(_0x2b04d1){var _0x4e3545=['Voice',_0x422b('0x6a'),_0x422b('0x6b'),_0x422b('0x6c'),_0x422b('0x6d'),_0x422b('0x6e')];return BPromise[_0x422b('0x6f')](_0x4e3545,function(_0x4e8047){return _0x2b04d1[_0x422b('0x28')+_0x4e8047+_0x422b('0x61')]({'attributes':['id','name']})['then'](function(_0x231724){return BPromise['each'](_0x231724,function(_0x5da4d0){return _0x5da4d0[_0x422b('0x69')](_0x1702d5[_0x422b('0x51')][_0x422b('0x66')])[_0x422b('0x26')](function(){if(_0x4e8047==='Voice'){return db[_0x422b('0x70')][_0x422b('0x4a')]({'where':{'id':_0x1702d5[_0x422b('0x51')][_0x422b('0x66')]},'attributes':['id',_0x422b('0x2e'),_0x422b('0x71'),_0x422b('0x72'),_0x422b('0x73')],'raw':!![]})[_0x422b('0x26')](function(_0x3ee2bd){return BPromise[_0x422b('0x6f')](_[_0x422b('0x41')](_0x3ee2bd,{'online':0x1}),function(_0x52cd7a){return db[_0x422b('0x74')][_0x422b('0x75')]({'membername':_0x52cd7a[_0x422b('0x2e')],'UserId':_0x52cd7a['id'],'queue_name':_0x5da4d0[_0x422b('0x2e')],'VoiceQueueId':_0x5da4d0['id'],'interface':_[_0x422b('0x76')](_0x52cd7a[_0x422b('0x73')])?util[_0x422b('0x77')](_0x422b('0x78'),_0x52cd7a[_0x422b('0x2e')]):_0x52cd7a[_0x422b('0x73')],'paused':_0x52cd7a[_0x422b('0x72')]||![],'penalty':0x0});});});}});});})[_0x422b('0x26')](function(){return _0x2b04d1;});})[_0x422b('0x26')](function(){return _0x2b04d1;});}})[_0x422b('0x26')](function(_0xecafb0){if(_0xecafb0){return _0xecafb0[_0x422b('0x69')](_0x1702d5['body'][_0x422b('0x66')],_[_0x422b('0x79')](_0x1702d5['body'],[_0x422b('0x66'),'id'])||{})[_0x422b('0x7a')](function(_0x42dbad){for(var _0x3a1371=0x0;_0x3a1371<_0x1702d5[_0x422b('0x51')][_0x422b('0x66')][_0x422b('0x3a')];_0x3a1371+=0x1){socket[_0x422b('0x7b')]('userTeam:save',{'UserId':_0x1702d5[_0x422b('0x51')][_0x422b('0x66')][_0x3a1371],'TeamId':_0x1702d5[_0x422b('0x4e')]['id']});}return _0x42dbad;});}})[_0x422b('0x26')](respondWithResult(_0x740647,null))[_0x422b('0x4c')](handleError(_0x740647,null));};exports[_0x422b('0x7c')]=function(_0x3bfe00,_0xa1ce61,_0x4ae1ca){return db['Team'][_0x422b('0x4f')]({'where':{'id':_0x3bfe00[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0xa1ce61,null))['then'](function(_0x535de9){if(_0x535de9){return BPromise[_0x422b('0x6f')]([_0x422b('0x7d'),_0x422b('0x7e'),'mail','sms',_0x422b('0x7f'),'openchannel'],function(_0x3b6f6c){return _0x535de9[_0x422b('0x28')+_[_0x422b('0x5e')](_0x3b6f6c)+_0x422b('0x61')]({'attributes':['id',_0x422b('0x2e')]})[_0x422b('0x26')](function(_0x5947c5){return BPromise[_0x422b('0x6f')](_0x5947c5,function(_0x1c8e9d){return _0x1c8e9d[_0x422b('0x7c')](_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')])['then'](function(){if(_0x3b6f6c===_0x422b('0x7d')){return db[_0x422b('0x74')]['destroy']({'where':{'VoiceQueueId':_0x1c8e9d['id'],'UserId':_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]}});}});});})[_0x422b('0x26')](function(){return _0x535de9;});})[_0x422b('0x26')](function(){return _0x535de9;});}})[_0x422b('0x26')](function(_0x705a04){if(_0x705a04){return _0x705a04['removeAgents'](_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')])['then'](function(){if(_['isArray'](_0x3bfe00['query']['ids'])){for(var _0x2a1333=0x0;_0x2a1333<_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]['length'];_0x2a1333+=0x1){socket['emit'](_0x422b('0x80'),{'UserId':Number(_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')][_0x2a1333]),'TeamId':Number(_0x3bfe00[_0x422b('0x4e')]['id'])});}}else{socket[_0x422b('0x7b')](_0x422b('0x80'),{'UserId':Number(_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]),'TeamId':Number(_0x3bfe00[_0x422b('0x4e')]['id'])});}});}})[_0x422b('0x26')](respondWithStatusCode(_0xa1ce61,null))[_0x422b('0x4c')](handleError(_0xa1ce61,null));};exports['getAgents']=function(_0x11518b,_0x571686,_0x4d956e){var _0x5e8bbd={};var _0x1e774a={};var _0x119b72;var _0x30db8e;return db[_0x422b('0x31')]['findOne']({'where':{'id':_0x11518b['params']['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x571686,null))[_0x422b('0x26')](function(_0xa65fa8){if(_0xa65fa8){_0x119b72=_0xa65fa8;_0x1e774a[_0x422b('0x37')]=_[_0x422b('0x33')](db[_0x422b('0x70')][_0x422b('0x32')]);_0x1e774a[_0x422b('0x34')]=_['keys'](_0x11518b[_0x422b('0x34')]);_0x1e774a[_0x422b('0x35')]=_[_0x422b('0x36')](_0x1e774a[_0x422b('0x37')],_0x1e774a[_0x422b('0x34')]);_0x5e8bbd[_0x422b('0x38')]=_[_0x422b('0x36')](_0x1e774a[_0x422b('0x37')],qs[_0x422b('0x39')](_0x11518b[_0x422b('0x34')][_0x422b('0x39')]));_0x5e8bbd['attributes']=_0x5e8bbd[_0x422b('0x38')]['length']?_0x5e8bbd[_0x422b('0x38')]:_0x1e774a[_0x422b('0x37')];_0x5e8bbd[_0x422b('0x3d')]=qs[_0x422b('0x3e')](_0x11518b[_0x422b('0x34')]['sort']);_0x5e8bbd[_0x422b('0x3f')]=qs['filters'](_[_0x422b('0x40')](_0x11518b[_0x422b('0x34')],_0x1e774a[_0x422b('0x35')]));if(_0x11518b[_0x422b('0x34')][_0x422b('0x41')]){_0x5e8bbd[_0x422b('0x3f')]=_['merge'](_0x5e8bbd[_0x422b('0x3f')],{'$or':_[_0x422b('0x43')](_0x5e8bbd[_0x422b('0x38')],function(_0x31ec57){var _0x3d160a={};_0x3d160a[_0x31ec57]={'$like':'%'+_0x11518b[_0x422b('0x34')][_0x422b('0x41')]+'%'};return _0x3d160a;})});}_0x5e8bbd=_[_0x422b('0x42')]({},_0x5e8bbd,_0x11518b['options']);return _0x119b72[_0x422b('0x81')](_0x5e8bbd);}})[_0x422b('0x26')](function(_0x50f2b6){if(_0x50f2b6){_0x30db8e=_0x50f2b6[_0x422b('0x3a')];if(!_0x11518b[_0x422b('0x34')][_0x422b('0x3b')](_0x422b('0x3c'))){_0x5e8bbd[_0x422b('0x21')]=qs[_0x422b('0x21')](_0x11518b['query'][_0x422b('0x21')]);_0x5e8bbd[_0x422b('0x20')]=qs['offset'](_0x11518b['query']['offset']);}return _0x119b72['getAgents'](_0x5e8bbd);}})[_0x422b('0x26')](function(_0x369c08){if(_0x369c08){return _0x369c08?{'count':_0x30db8e,'rows':_0x369c08}:null;}})[_0x422b('0x26')](respondWithResult(_0x571686,null))[_0x422b('0x4c')](handleError(_0x571686,null));}; \ No newline at end of file +var _0x44fe=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','error','send','index','Team','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','User','online','UserVoiceQueueRt','upsert','interface','omit','spread','emit','removeAgents','voice','chat','mail','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x3b8fd4,_0x1efbef){var _0x265d29=function(_0x563107){while(--_0x563107){_0x3b8fd4['push'](_0x3b8fd4['shift']());}};_0x265d29(++_0x1efbef);}(_0x44fe,0x16f));var _0xe44f=function(_0x46ab04,_0x4af14f){_0x46ab04=_0x46ab04-0x0;var _0x27b681=_0x44fe[_0x46ab04];return _0x27b681;};'use strict';var pdf=require(_0xe44f('0x0'));var emlformat=require(_0xe44f('0x1'));var rimraf=require(_0xe44f('0x2'));var zipdir=require(_0xe44f('0x3'));var jsonpatch=require(_0xe44f('0x4'));var rp=require(_0xe44f('0x5'));var moment=require(_0xe44f('0x6'));var BPromise=require(_0xe44f('0x7'));var Mustache=require(_0xe44f('0x8'));var util=require(_0xe44f('0x9'));var path=require(_0xe44f('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe44f('0xb'));var fs=require('fs');var _=require(_0xe44f('0xc'));var squel=require('squel');var crypto=require(_0xe44f('0xd'));var jsforce=require(_0xe44f('0xe'));var deskjs=require(_0xe44f('0xf'));var toCsv=require(_0xe44f('0x10'));var querystring=require(_0xe44f('0x11'));var Papa=require('papaparse');var Redis=require(_0xe44f('0x12'));var authService=require(_0xe44f('0x13'));var qs=require(_0xe44f('0x14'));var hardwareService=require(_0xe44f('0x15'));var logger=require(_0xe44f('0x16'))(_0xe44f('0x17'));var utils=require(_0xe44f('0x18'));var config=require(_0xe44f('0x19'));var db=require(_0xe44f('0x1a'))['db'];config['redis']=_[_0xe44f('0x1b')](config[_0xe44f('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe44f('0x1d'))(new Redis(config[_0xe44f('0x1c')]));require(_0xe44f('0x1e'))[_0xe44f('0x1f')](socket);function respondWithStatusCode(_0x3c78e1,_0x2e2942){_0x2e2942=_0x2e2942||0xcc;return function(_0x3ec218){if(_0x3ec218){return _0x3c78e1[_0xe44f('0x20')](_0x2e2942);}return _0x3c78e1['status'](_0x2e2942)[_0xe44f('0x21')]();};}function respondWithResult(_0x1fa09f,_0x9ccdfd){_0x9ccdfd=_0x9ccdfd||0xc8;return function(_0x190fec){if(_0x190fec){return _0x1fa09f[_0xe44f('0x22')](_0x9ccdfd)[_0xe44f('0x23')](_0x190fec);}};}function respondWithFilteredResult(_0x3ee3f9,_0x4029fe){return function(_0x396c29){if(_0x396c29){var _0x1678e2=_0x396c29['count'],_0x163af0=_0x4029fe[_0xe44f('0x24')],_0x3e7d5e=_0x4029fe[_0xe44f('0x24')]+_0x4029fe[_0xe44f('0x25')],_0x4c70e5;if(_0x3e7d5e>=_0x1678e2){_0x3e7d5e=_0x1678e2;_0x4c70e5=0xc8;}else{_0x4c70e5=0xce;}_0x3ee3f9[_0xe44f('0x22')](_0x4c70e5);return _0x3ee3f9[_0xe44f('0x26')](_0xe44f('0x27'),_0x163af0+'-'+_0x3e7d5e+'/'+_0x1678e2)[_0xe44f('0x23')](_0x396c29);}return null;};}function patchUpdates(_0x239ef5){return function(_0xecbcfe){try{jsonpatch['apply'](_0xecbcfe,_0x239ef5,!![]);}catch(_0x487bca){return BPromise[_0xe44f('0x28')](_0x487bca);}return _0xecbcfe[_0xe44f('0x29')]();};}function saveUpdates(_0x298b90,_0x3f7ef8){return function(_0xf3c259){if(_0xf3c259){return _0xf3c259['update'](_0x298b90)['then'](function(_0x412b36){return _0x412b36;});}return null;};}function removeEntity(_0x1bb107,_0x1cc44e){return function(_0x20c7aa){if(_0x20c7aa){return _0x20c7aa['destroy']()[_0xe44f('0x2a')](function(){var _0xb84f2d=_0x20c7aa[_0xe44f('0x2b')]({'plain':!![]});var _0x90d216='Teams';return db[_0xe44f('0x2c')][_0xe44f('0x2d')]({'where':{'type':_0x90d216,'resourceId':_0xb84f2d['id']}})[_0xe44f('0x2a')](function(){return _0x20c7aa;});})['then'](function(){_0x1bb107['status'](0xcc)[_0xe44f('0x21')]();});}};}function handleEntityNotFound(_0x42f994,_0x466e26){return function(_0x5246c3){if(!_0x5246c3){_0x42f994[_0xe44f('0x20')](0x194);}return _0x5246c3;};}function handleError(_0x561579,_0x373d29){_0x373d29=_0x373d29||0x1f4;return function(_0x28b761){logger[_0xe44f('0x2e')](_0x28b761['stack']);if(_0x28b761['name']){delete _0x28b761['name'];}_0x561579['status'](_0x373d29)[_0xe44f('0x2f')](_0x28b761);};}exports[_0xe44f('0x30')]=function(_0x4aea1a,_0x23f70d){var _0x180047={},_0x386272={},_0x267724={'count':0x0,'rows':[]};var _0x443820=db[_0xe44f('0x31')]['rawAttributes'];_0x386272[_0xe44f('0x32')]=_['keys'](_0x443820);_0x386272[_0xe44f('0x33')]=_[_0xe44f('0x34')](_0x4aea1a[_0xe44f('0x33')]);_0x386272['filters']=_[_0xe44f('0x35')](_0x386272['model'],_0x386272[_0xe44f('0x33')]);_0x180047[_0xe44f('0x36')]=_[_0xe44f('0x35')](_0x386272['model'],qs['fields'](_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x37')]));_0x180047[_0xe44f('0x36')]=_0x180047[_0xe44f('0x36')]['length']?_0x180047[_0xe44f('0x36')]:_0x386272[_0xe44f('0x32')];if(!_0x4aea1a['query'][_0xe44f('0x38')](_0xe44f('0x39'))){_0x180047['limit']=qs[_0xe44f('0x25')](_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x25')]);_0x180047[_0xe44f('0x24')]=qs[_0xe44f('0x24')](_0x4aea1a[_0xe44f('0x33')]['offset']);}_0x180047['order']=qs[_0xe44f('0x3a')](_0x4aea1a['query'][_0xe44f('0x3a')]);_0x180047[_0xe44f('0x3b')]=qs['filters'](_[_0xe44f('0x3c')](_0x4aea1a[_0xe44f('0x33')],_0x386272[_0xe44f('0x3d')]));if(_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x3e')]){_0x180047[_0xe44f('0x3b')]=_[_0xe44f('0x3f')](_0x180047[_0xe44f('0x3b')],{'$or':_[_0xe44f('0x40')](_0x443820,function(_0x288441){if(_0x288441[_0xe44f('0x41')][_0xe44f('0x42')]!==_0xe44f('0x43')){var _0x2a82ca={};_0x2a82ca[_0x288441[_0xe44f('0x44')]]={'$like':'%'+_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x3e')]+'%'};return _0x2a82ca;}})});}_0x180047=_[_0xe44f('0x3f')]({},_0x180047,_0x4aea1a[_0xe44f('0x45')]);var _0x4ce3ae={'where':_0x180047['where']};return db[_0xe44f('0x31')][_0xe44f('0x46')](_0x4ce3ae)['then'](function(_0x56fff6){_0x267724[_0xe44f('0x46')]=_0x56fff6;if(_0x4aea1a[_0xe44f('0x33')][_0xe44f('0x47')]){_0x180047[_0xe44f('0x48')]=[{'all':!![]}];}return db['Team'][_0xe44f('0x49')](_0x180047);})[_0xe44f('0x2a')](function(_0x11e16b){_0x267724[_0xe44f('0x4a')]=_0x11e16b;return _0x267724;})[_0xe44f('0x2a')](respondWithFilteredResult(_0x23f70d,_0x180047))[_0xe44f('0x4b')](handleError(_0x23f70d,null));};exports['show']=function(_0x1012ee,_0x4df5fa){var _0x10afcb={'raw':![],'where':{'id':_0x1012ee[_0xe44f('0x4c')]['id']}},_0x32ec55={};_0x32ec55[_0xe44f('0x32')]=_['keys'](db['Team'][_0xe44f('0x4d')]);_0x32ec55[_0xe44f('0x33')]=_['keys'](_0x1012ee['query']);_0x32ec55['filters']=_[_0xe44f('0x35')](_0x32ec55[_0xe44f('0x32')],_0x32ec55['query']);_0x10afcb[_0xe44f('0x36')]=_['intersection'](_0x32ec55[_0xe44f('0x32')],qs['fields'](_0x1012ee['query'][_0xe44f('0x37')]));_0x10afcb[_0xe44f('0x36')]=_0x10afcb[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x10afcb[_0xe44f('0x36')]:_0x32ec55[_0xe44f('0x32')];if(_0x1012ee['query'][_0xe44f('0x47')]){_0x10afcb['include']=[{'all':!![]}];}_0x10afcb=_[_0xe44f('0x3f')]({},_0x10afcb,_0x1012ee[_0xe44f('0x45')]);return db[_0xe44f('0x31')][_0xe44f('0x4f')](_0x10afcb)[_0xe44f('0x2a')](handleEntityNotFound(_0x4df5fa,null))['then'](respondWithResult(_0x4df5fa,null))[_0xe44f('0x4b')](handleError(_0x4df5fa,null));};exports['create']=function(_0x5ab359,_0x4dd00f){return db[_0xe44f('0x31')][_0xe44f('0x50')](_0x5ab359[_0xe44f('0x51')],{})[_0xe44f('0x2a')](function(_0x5a64e0){var _0x1e235a=_0x5ab359[_0xe44f('0x52')]['get']({'plain':!![]});if(!_0x1e235a)throw new Error(_0xe44f('0x53'));if(_0x1e235a[_0xe44f('0x54')]===_0xe44f('0x52')){var _0x164f7b=_0x5a64e0['get']({'plain':!![]});var _0xb56f92=_0xe44f('0x55');return db[_0xe44f('0x56')][_0xe44f('0x4f')]({'where':{'name':_0xb56f92,'userProfileId':_0x1e235a[_0xe44f('0x57')]},'raw':!![]})['then'](function(_0x3a8ab5){if(_0x3a8ab5&&_0x3a8ab5[_0xe44f('0x58')]===0x0){return db[_0xe44f('0x2c')][_0xe44f('0x50')]({'name':_0x164f7b[_0xe44f('0x59')],'resourceId':_0x164f7b['id'],'type':_0x3a8ab5[_0xe44f('0x59')],'sectionId':_0x3a8ab5['id']},{})[_0xe44f('0x2a')](function(){return _0x5a64e0;});}else{return _0x5a64e0;}})[_0xe44f('0x4b')](function(_0x5a4662){logger[_0xe44f('0x2e')](_0xe44f('0x5a'),_0x5a4662);throw _0x5a4662;});}return _0x5a64e0;})[_0xe44f('0x2a')](respondWithResult(_0x4dd00f,0xc9))[_0xe44f('0x4b')](handleError(_0x4dd00f,null));};exports[_0xe44f('0x5b')]=function(_0x312ff5,_0x2a0d2d){if(_0x312ff5[_0xe44f('0x51')]['id']){delete _0x312ff5[_0xe44f('0x51')]['id'];}return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x312ff5['params']['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x2a0d2d,null))[_0xe44f('0x2a')](saveUpdates(_0x312ff5[_0xe44f('0x51')],null))[_0xe44f('0x2a')](respondWithResult(_0x2a0d2d,null))[_0xe44f('0x4b')](handleError(_0x2a0d2d,null));};exports['destroy']=function(_0x417872,_0x2ce4fc){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x417872[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x2ce4fc,null))[_0xe44f('0x2a')](removeEntity(_0x2ce4fc,null))[_0xe44f('0x4b')](handleError(_0x2ce4fc,null));};exports[_0xe44f('0x5c')]=function(_0x4849a5,_0x37d01d,_0x4a5bbe){return db[_0xe44f('0x31')][_0xe44f('0x5d')]({'where':{'id':_0x4849a5[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x37d01d,null))['then'](function(_0x5c9efb){if(!_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')]||!utils[_0xe44f('0x5f')](_0x4849a5[_0xe44f('0x33')]['channel'])){throw new db[(_0xe44f('0x60'))][(_0xe44f('0x61'))](_0xe44f('0x62'));}var _0x5b1e61={};var _0x2abb2a={};_0x2abb2a[_0xe44f('0x32')]=_[_0xe44f('0x34')](db[_[_0xe44f('0x63')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x65')]['rawAttributes']);_0x2abb2a[_0xe44f('0x33')]=_['keys'](_0x4849a5['query']);_0x2abb2a[_0xe44f('0x3d')]=_[_0xe44f('0x35')](_0x2abb2a[_0xe44f('0x32')],_0x2abb2a['query']);_0x5b1e61['attributes']=_['intersection'](_0x2abb2a[_0xe44f('0x32')],qs[_0xe44f('0x37')](_0x4849a5['query']['fields']));_0x5b1e61[_0xe44f('0x36')]=_0x5b1e61[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x5b1e61[_0xe44f('0x36')]:_0x2abb2a['model'];_0x5b1e61[_0xe44f('0x25')]=qs[_0xe44f('0x25')](_0x4849a5['query']['limit']);_0x5b1e61[_0xe44f('0x24')]=qs['offset'](_0x4849a5[_0xe44f('0x33')]['offset']);_0x5b1e61[_0xe44f('0x66')]=qs[_0xe44f('0x3a')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x3a')]);_0x5b1e61['where']=qs[_0xe44f('0x3d')](_['pick'](_0x4849a5[_0xe44f('0x33')],_0x2abb2a['filters']));_0x5b1e61=_[_0xe44f('0x3f')]({},_0x5b1e61,_0x4849a5[_0xe44f('0x45')]);return _0x5c9efb[_0xe44f('0x2b')+_[_0xe44f('0x63')](_0x4849a5[_0xe44f('0x33')][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x67')](_0x5b1e61);})[_0xe44f('0x2a')](respondWithResult(_0x37d01d,null))['catch'](handleError(_0x37d01d,null));};exports['addQueues']=function(_0x38f95f,_0x50909f,_0x38423b){return db[_0xe44f('0x31')][_0xe44f('0x5d')]({'where':{'id':_0x38f95f['params']['id']}})['then'](function(_0x4eb196){if(_0x4eb196){if(!_0x38f95f[_0xe44f('0x51')][_0xe44f('0x5e')]||!utils['isValidChannel'](_0x38f95f[_0xe44f('0x51')][_0xe44f('0x5e')])){throw new db['Sequelize'][(_0xe44f('0x61'))]('Unknown\x20channel');}return _0x4eb196[_0xe44f('0x68')+_['capitalize'](_0x38f95f['body'][_0xe44f('0x5e')][_0xe44f('0x64')]())+_0xe44f('0x67')](_0x38f95f[_0xe44f('0x51')][_0xe44f('0x69')]);}return null;})[_0xe44f('0x2a')](handleEntityNotFound(_0x50909f,null))['then'](respondWithStatusCode(_0x50909f,null))[_0xe44f('0x4b')](handleError(_0x50909f,null));};exports[_0xe44f('0x6a')]=function(_0x118923,_0x105e1,_0x28b60b){return db[_0xe44f('0x31')]['findOne']({'where':{'id':_0x118923[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](function(_0x3c4a14){if(_0x3c4a14){if(!_0x118923[_0xe44f('0x33')][_0xe44f('0x5e')]||!utils[_0xe44f('0x5f')](_0x118923['query'][_0xe44f('0x5e')])){throw new db['Sequelize'][(_0xe44f('0x61'))](_0xe44f('0x62'));}return _0x3c4a14[_0xe44f('0x6b')+_[_0xe44f('0x63')](_0x118923[_0xe44f('0x33')][_0xe44f('0x5e')]['toLowerCase']())+_0xe44f('0x67')](_0x118923[_0xe44f('0x33')][_0xe44f('0x69')]);}return null;})[_0xe44f('0x2a')](handleEntityNotFound(_0x105e1,null))[_0xe44f('0x2a')](respondWithStatusCode(_0x105e1,null))[_0xe44f('0x4b')](handleError(_0x105e1,null));};exports[_0xe44f('0x6c')]=function(_0x2efa1e,_0x2bd549,_0x288d57){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x2efa1e[_0xe44f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2bd549,null))[_0xe44f('0x2a')](function(_0x1da6ff){if(_0x1da6ff){var _0x34a889=[_0xe44f('0x6d'),_0xe44f('0x6e'),_0xe44f('0x6f'),_0xe44f('0x70'),'Fax',_0xe44f('0x71')];return BPromise[_0xe44f('0x72')](_0x34a889,function(_0xa0b70d){return _0x1da6ff[_0xe44f('0x2b')+_0xa0b70d+_0xe44f('0x67')]({'attributes':['id','name']})['then'](function(_0x5cf03d){return BPromise['each'](_0x5cf03d,function(_0x5f08f2){return _0x5f08f2[_0xe44f('0x6c')](_0x2efa1e[_0xe44f('0x51')][_0xe44f('0x69')])[_0xe44f('0x2a')](function(){if(_0xa0b70d===_0xe44f('0x6d')){return db[_0xe44f('0x73')][_0xe44f('0x49')]({'where':{'id':_0x2efa1e['body'][_0xe44f('0x69')]},'attributes':['id',_0xe44f('0x59'),_0xe44f('0x74'),'voicePause','interface'],'raw':!![]})[_0xe44f('0x2a')](function(_0x417197){return BPromise[_0xe44f('0x72')](_[_0xe44f('0x3e')](_0x417197,{'online':0x1}),function(_0x4740b4){return db[_0xe44f('0x75')][_0xe44f('0x76')]({'membername':_0x4740b4['name'],'UserId':_0x4740b4['id'],'queue_name':_0x5f08f2[_0xe44f('0x59')],'VoiceQueueId':_0x5f08f2['id'],'interface':_['isNil'](_0x4740b4[_0xe44f('0x77')])?util['format']('SIP/%s',_0x4740b4[_0xe44f('0x59')]):_0x4740b4['interface'],'paused':_0x4740b4['voicePause']||![],'penalty':0x0});});});}});});})[_0xe44f('0x2a')](function(){return _0x1da6ff;});})[_0xe44f('0x2a')](function(){return _0x1da6ff;});}})[_0xe44f('0x2a')](function(_0x4f07ce){if(_0x4f07ce){return _0x4f07ce['addAgents'](_0x2efa1e[_0xe44f('0x51')]['ids'],_[_0xe44f('0x78')](_0x2efa1e[_0xe44f('0x51')],[_0xe44f('0x69'),'id'])||{})[_0xe44f('0x79')](function(_0x2c14a4){for(var _0x59956b=0x0;_0x59956b<_0x2efa1e['body'][_0xe44f('0x69')]['length'];_0x59956b+=0x1){socket[_0xe44f('0x7a')]('userTeam:save',{'UserId':_0x2efa1e[_0xe44f('0x51')][_0xe44f('0x69')][_0x59956b],'TeamId':_0x2efa1e[_0xe44f('0x4c')]['id']});}return _0x2c14a4;});}})[_0xe44f('0x2a')](respondWithResult(_0x2bd549,null))['catch'](handleError(_0x2bd549,null));};exports[_0xe44f('0x7b')]=function(_0x529069,_0x3017fb,_0x1fac7f){return db[_0xe44f('0x31')][_0xe44f('0x4f')]({'where':{'id':_0x529069['params']['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x3017fb,null))[_0xe44f('0x2a')](function(_0x2e7a2c){if(_0x2e7a2c){return BPromise[_0xe44f('0x72')]([_0xe44f('0x7c'),_0xe44f('0x7d'),_0xe44f('0x7e'),'sms','fax','openchannel'],function(_0x12dc9e){return _0x2e7a2c[_0xe44f('0x2b')+_['capitalize'](_0x12dc9e)+_0xe44f('0x67')]({'attributes':['id','name']})['then'](function(_0x540325){return BPromise[_0xe44f('0x72')](_0x540325,function(_0x539eeb){return _0x539eeb[_0xe44f('0x7b')](_0x529069[_0xe44f('0x33')]['ids'])['then'](function(){if(_0x12dc9e==='voice'){return db['UserVoiceQueueRt'][_0xe44f('0x2d')]({'where':{'VoiceQueueId':_0x539eeb['id'],'UserId':_0x529069[_0xe44f('0x33')]['ids']}});}});});})[_0xe44f('0x2a')](function(){return _0x2e7a2c;});})[_0xe44f('0x2a')](function(){return _0x2e7a2c;});}})['then'](function(_0x5904bf){if(_0x5904bf){return _0x5904bf['removeAgents'](_0x529069[_0xe44f('0x33')][_0xe44f('0x69')])[_0xe44f('0x2a')](function(){if(_['isArray'](_0x529069[_0xe44f('0x33')][_0xe44f('0x69')])){for(var _0x122f4d=0x0;_0x122f4d<_0x529069['query'][_0xe44f('0x69')][_0xe44f('0x4e')];_0x122f4d+=0x1){socket[_0xe44f('0x7a')](_0xe44f('0x7f'),{'UserId':Number(_0x529069[_0xe44f('0x33')]['ids'][_0x122f4d]),'TeamId':Number(_0x529069[_0xe44f('0x4c')]['id'])});}}else{socket[_0xe44f('0x7a')](_0xe44f('0x7f'),{'UserId':Number(_0x529069[_0xe44f('0x33')]['ids']),'TeamId':Number(_0x529069[_0xe44f('0x4c')]['id'])});}});}})[_0xe44f('0x2a')](respondWithStatusCode(_0x3017fb,null))['catch'](handleError(_0x3017fb,null));};exports['getAgents']=function(_0x4305cf,_0x44ebb4,_0xa5720a){var _0x5906ab={};var _0x43b0d3={};var _0xb5e40d;var _0x36b38d;return db['Team'][_0xe44f('0x5d')]({'where':{'id':_0x4305cf[_0xe44f('0x4c')]['id']}})[_0xe44f('0x2a')](handleEntityNotFound(_0x44ebb4,null))['then'](function(_0x743117){if(_0x743117){_0xb5e40d=_0x743117;_0x43b0d3[_0xe44f('0x32')]=_['keys'](db[_0xe44f('0x73')][_0xe44f('0x4d')]);_0x43b0d3[_0xe44f('0x33')]=_['keys'](_0x4305cf[_0xe44f('0x33')]);_0x43b0d3[_0xe44f('0x3d')]=_[_0xe44f('0x35')](_0x43b0d3[_0xe44f('0x32')],_0x43b0d3['query']);_0x5906ab[_0xe44f('0x36')]=_[_0xe44f('0x35')](_0x43b0d3[_0xe44f('0x32')],qs[_0xe44f('0x37')](_0x4305cf[_0xe44f('0x33')]['fields']));_0x5906ab[_0xe44f('0x36')]=_0x5906ab[_0xe44f('0x36')][_0xe44f('0x4e')]?_0x5906ab[_0xe44f('0x36')]:_0x43b0d3[_0xe44f('0x32')];_0x5906ab[_0xe44f('0x66')]=qs[_0xe44f('0x3a')](_0x4305cf[_0xe44f('0x33')][_0xe44f('0x3a')]);_0x5906ab['where']=qs[_0xe44f('0x3d')](_[_0xe44f('0x3c')](_0x4305cf[_0xe44f('0x33')],_0x43b0d3[_0xe44f('0x3d')]));if(_0x4305cf[_0xe44f('0x33')][_0xe44f('0x3e')]){_0x5906ab[_0xe44f('0x3b')]=_[_0xe44f('0x3f')](_0x5906ab[_0xe44f('0x3b')],{'$or':_[_0xe44f('0x40')](_0x5906ab['attributes'],function(_0x4eb2f4){var _0x57188e={};_0x57188e[_0x4eb2f4]={'$like':'%'+_0x4305cf[_0xe44f('0x33')]['filter']+'%'};return _0x57188e;})});}_0x5906ab=_['merge']({},_0x5906ab,_0x4305cf[_0xe44f('0x45')]);return _0xb5e40d['getAgents'](_0x5906ab);}})[_0xe44f('0x2a')](function(_0x1e77ad){if(_0x1e77ad){_0x36b38d=_0x1e77ad['length'];if(!_0x4305cf[_0xe44f('0x33')]['hasOwnProperty'](_0xe44f('0x39'))){_0x5906ab[_0xe44f('0x25')]=qs[_0xe44f('0x25')](_0x4305cf[_0xe44f('0x33')][_0xe44f('0x25')]);_0x5906ab[_0xe44f('0x24')]=qs[_0xe44f('0x24')](_0x4305cf['query'][_0xe44f('0x24')]);}return _0xb5e40d[_0xe44f('0x80')](_0x5906ab);}})[_0xe44f('0x2a')](function(_0x58deda){if(_0x58deda){return _0x58deda?{'count':_0x36b38d,'rows':_0x58deda}:null;}})[_0xe44f('0x2a')](respondWithResult(_0x44ebb4,null))['catch'](handleError(_0x44ebb4,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index d3c8d45..4096d29 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 _0xf634=['remove','emit','hasOwnProperty','exports','save','update'];(function(_0x346252,_0x59b4c4){var _0xe534a=function(_0x5a9a62){while(--_0x5a9a62){_0x346252['push'](_0x346252['shift']());}};_0xe534a(++_0x59b4c4);}(_0xf634,0x7c));var _0x4f63=function(_0x4d48d7,_0xdc8e0c){_0x4d48d7=_0x4d48d7-0x0;var _0x1c0b2f=_0xf634[_0x4d48d7];return _0x1c0b2f;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f63('0x0'),'afterUpdate':_0x4f63('0x1'),'afterDestroy':_0x4f63('0x2')};function emitEvent(_0x30f8b4){return function(_0x3d14b3,_0x172bf8,_0x5c513d){TeamEvents[_0x4f63('0x3')](_0x30f8b4+':'+_0x3d14b3['id'],_0x3d14b3);TeamEvents['emit'](_0x30f8b4,_0x3d14b3);_0x5c513d(null);};}for(var e in events){if(events[_0x4f63('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x4f63('0x5')]=TeamEvents; \ No newline at end of file +var _0x33bc=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xfdec06,_0x9fa2f4){var _0x58a539=function(_0xfc799c){while(--_0xfc799c){_0xfdec06['push'](_0xfdec06['shift']());}};_0x58a539(++_0x9fa2f4);}(_0x33bc,0x1e5));var _0xc33b=function(_0x54e532,_0x183b26){_0x54e532=_0x54e532-0x0;var _0x216cd8=_0x33bc[_0x54e532];return _0x216cd8;};'use strict';var EventEmitter=require(_0xc33b('0x0'));var Team=require(_0xc33b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc33b('0x2'),'afterUpdate':_0xc33b('0x3'),'afterDestroy':_0xc33b('0x4')};function emitEvent(_0x4f0e91){return function(_0x4ec9f9,_0x36d095,_0x412bff){TeamEvents['emit'](_0x4f0e91+':'+_0x4ec9f9['id'],_0x4ec9f9);TeamEvents[_0xc33b('0x5')](_0x4f0e91,_0x4ec9f9);_0x412bff(null);};}for(var e in events){if(events[_0xc33b('0x6')](e)){var event=events[e];Team[_0xc33b('0x7')](e,emitEvent(event));}}module[_0xc33b('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 4e62e65..e99d247 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 _0x5e23=['api','bluebird','path','rimraf','../../config/environment','define','Team','teams','lodash','util','../../config/logger'];(function(_0xb81bad,_0x36a4df){var _0x4ebc82=function(_0x3f8581){while(--_0x3f8581){_0xb81bad['push'](_0xb81bad['shift']());}};_0x4ebc82(++_0x36a4df);}(_0x5e23,0xd9));var _0x35e2=function(_0x19d587,_0x24fb5b){_0x19d587=_0x19d587-0x0;var _0x254247=_0x5e23[_0x19d587];return _0x254247;};'use strict';var _=require(_0x35e2('0x0'));var util=require(_0x35e2('0x1'));var logger=require(_0x35e2('0x2'))(_0x35e2('0x3'));var moment=require('moment');var BPromise=require(_0x35e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35e2('0x5'));var rimraf=require(_0x35e2('0x6'));var config=require(_0x35e2('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0xe4b37,_0x520b05){return _0xe4b37[_0x35e2('0x8')](_0x35e2('0x9'),attributes,{'tableName':_0x35e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9832=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','teams','lodash','util'];(function(_0x5850c0,_0x3c2c){var _0x113882=function(_0x1d8200){while(--_0x1d8200){_0x5850c0['push'](_0x5850c0['shift']());}};_0x113882(++_0x3c2c);}(_0x9832,0x1ec));var _0x2983=function(_0x37edba,_0xa77c93){_0x37edba=_0x37edba-0x0;var _0x14b6c0=_0x9832[_0x37edba];return _0x14b6c0;};'use strict';var _=require(_0x2983('0x0'));var util=require(_0x2983('0x1'));var logger=require(_0x2983('0x2'))(_0x2983('0x3'));var moment=require(_0x2983('0x4'));var BPromise=require(_0x2983('0x5'));var rp=require(_0x2983('0x6'));var fs=require('fs');var path=require(_0x2983('0x7'));var rimraf=require(_0x2983('0x8'));var config=require(_0x2983('0x9'));var attributes=require(_0x2983('0xa'));module[_0x2983('0xb')]=function(_0x263b82,_0x3d6755){return _0x263b82['define']('Team',attributes,{'tableName':_0x2983('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 26f17b3..91bf92d 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 _0x5e5e=['Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./team.socket','info'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0x5e5e,0xf9));var _0xe5e5=function(_0x445ab3,_0x4671d8){_0x445ab3=_0x445ab3-0x0;var _0x4e5ae9=_0x5e5e[_0x445ab3];return _0x4e5ae9;};'use strict';var _=require(_0xe5e5('0x0'));var util=require('util');var moment=require(_0xe5e5('0x1'));var BPromise=require(_0xe5e5('0x2'));var rs=require(_0xe5e5('0x3'));var fs=require('fs');var Redis=require(_0xe5e5('0x4'));var db=require(_0xe5e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5e5('0x6'))(_0xe5e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5e5('0x8')]['http']({'port':0x232a});config[_0xe5e5('0x9')]=_[_0xe5e5('0xa')](config[_0xe5e5('0x9')],{'host':_0xe5e5('0xb'),'port':0x18eb});var socket=require(_0xe5e5('0xc'))(new Redis(config[_0xe5e5('0x9')]));require(_0xe5e5('0xd'))['register'](socket);function respondWithRpcPromise(_0x15b992,_0x49b6b7,_0x5b5c5b){return new BPromise(function(_0x422c9a,_0x5d591a){return client['request'](_0x15b992,_0x5b5c5b)['then'](function(_0x4f9514){logger[_0xe5e5('0xe')](_0xe5e5('0xf'),_0x49b6b7,'request\x20sent');logger[_0xe5e5('0x10')](_0xe5e5('0x11'),_0x49b6b7,'request\x20sent',JSON[_0xe5e5('0x12')](_0x4f9514));if(_0x4f9514[_0xe5e5('0x13')]){if(_0x4f9514[_0xe5e5('0x13')]['code']===0x1f4){logger[_0xe5e5('0x13')](_0xe5e5('0xf'),_0x49b6b7,_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);return _0x5d591a(_0x4f9514[_0xe5e5('0x13')]['message']);}logger[_0xe5e5('0x13')](_0xe5e5('0xf'),_0x49b6b7,_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);return _0x422c9a(_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);}else{logger[_0xe5e5('0xe')]('Team,\x20%s,\x20%s',_0x49b6b7,_0xe5e5('0x15'));_0x422c9a(_0x4f9514[_0xe5e5('0x16')][_0xe5e5('0x14')]);}})[_0xe5e5('0x17')](function(_0x33cbc8){logger[_0xe5e5('0x13')]('Team,\x20%s,\x20%s',_0x49b6b7,_0x33cbc8);_0x5d591a(_0x33cbc8);});});} \ No newline at end of file +var _0x3052=['redis','localhost','socket.io-emitter','./team.socket','register','request','then','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x3052,0xb9));var _0x2305=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3052[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x2305('0x0'));var moment=require(_0x2305('0x1'));var BPromise=require('bluebird');var rs=require(_0x2305('0x2'));var fs=require('fs');var Redis=require(_0x2305('0x3'));var db=require(_0x2305('0x4'))['db'];var utils=require(_0x2305('0x5'));var logger=require('../../config/logger')(_0x2305('0x6'));var config=require(_0x2305('0x7'));var jayson=require(_0x2305('0x8'));var client=jayson[_0x2305('0x9')][_0x2305('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2305('0xb')],{'host':_0x2305('0xc'),'port':0x18eb});var socket=require(_0x2305('0xd'))(new Redis(config[_0x2305('0xb')]));require(_0x2305('0xe'))[_0x2305('0xf')](socket);function respondWithRpcPromise(_0x29c63f,_0x450082,_0x43a2ea){return new BPromise(function(_0x275b0f,_0x457c70){return client[_0x2305('0x10')](_0x29c63f,_0x43a2ea)[_0x2305('0x11')](function(_0x5dddff){logger['info']('Team,\x20%s,\x20%s',_0x450082,_0x2305('0x12'));logger[_0x2305('0x13')](_0x2305('0x14'),_0x450082,_0x2305('0x12'),JSON['stringify'](_0x5dddff));if(_0x5dddff[_0x2305('0x15')]){if(_0x5dddff[_0x2305('0x15')][_0x2305('0x16')]===0x1f4){logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);return _0x457c70(_0x5dddff['error']['message']);}logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);return _0x275b0f(_0x5dddff[_0x2305('0x15')][_0x2305('0x18')]);}else{logger[_0x2305('0x19')]('Team,\x20%s,\x20%s',_0x450082,_0x2305('0x12'));_0x275b0f(_0x5dddff[_0x2305('0x1a')]['message']);}})[_0x2305('0x1b')](function(_0x991a95){logger[_0x2305('0x15')](_0x2305('0x17'),_0x450082,_0x991a95);_0x457c70(_0x991a95);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4f2959d..e96628d 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 _0xd9c5=['length','team:','./team.events','save','remove','update','emit'];(function(_0x1dfb5d,_0x7ee3f6){var _0x112a9e=function(_0x360f64){while(--_0x360f64){_0x1dfb5d['push'](_0x1dfb5d['shift']());}};_0x112a9e(++_0x7ee3f6);}(_0xd9c5,0x1ec));var _0x5d9c=function(_0xb491dd,_0x494e4c){_0xb491dd=_0xb491dd-0x0;var _0x341aaf=_0xd9c5[_0xb491dd];return _0x341aaf;};'use strict';var TeamEvents=require(_0x5d9c('0x0'));var events=[_0x5d9c('0x1'),_0x5d9c('0x2'),_0x5d9c('0x3')];function createListener(_0x568d88,_0x241185){return function(_0x2298a2){_0x241185[_0x5d9c('0x4')](_0x568d88,_0x2298a2);};}function removeListener(_0x58daf4,_0x1c2666){return function(){TeamEvents['removeListener'](_0x58daf4,_0x1c2666);};}exports['register']=function(_0x273580){for(var _0x4367ff=0x0,_0x3f6769=events[_0x5d9c('0x5')];_0x4367ff<_0x3f6769;_0x4367ff++){var _0xa58d83=events[_0x4367ff];var _0x222d5e=createListener(_0x5d9c('0x6')+_0xa58d83,_0x273580);TeamEvents['on'](_0xa58d83,_0x222d5e);}}; \ No newline at end of file +var _0xf31d=['save','remove','update','emit','removeListener','register','length','./team.events'];(function(_0x1dd2cc,_0x36ddfe){var _0x305d8e=function(_0x27df09){while(--_0x27df09){_0x1dd2cc['push'](_0x1dd2cc['shift']());}};_0x305d8e(++_0x36ddfe);}(_0xf31d,0x67));var _0xdf31=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0xf31d[_0x4d674b];return _0x535a1f;};'use strict';var TeamEvents=require(_0xdf31('0x0'));var events=[_0xdf31('0x1'),_0xdf31('0x2'),_0xdf31('0x3')];function createListener(_0x220f89,_0x44c97b){return function(_0xe9b786){_0x44c97b[_0xdf31('0x4')](_0x220f89,_0xe9b786);};}function removeListener(_0x2ee298,_0x24d19f){return function(){TeamEvents[_0xdf31('0x5')](_0x2ee298,_0x24d19f);};}exports[_0xdf31('0x6')]=function(_0x19afba){for(var _0x527641=0x0,_0x4d6ec9=events[_0xdf31('0x7')];_0x527641<_0x4d6ec9;_0x527641++){var _0xb08798=events[_0x527641];var _0x1b0d3a=createListener('team:'+_0xb08798,_0x19afba);TeamEvents['on'](_0xb08798,_0x1b0d3a);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ca1579c..b1cd3f0 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 _0xbca8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x2512e4,_0x2f98ee){var _0x5a7f2d=function(_0x3bbece){while(--_0x3bbece){_0x2512e4['push'](_0x2512e4['shift']());}};_0x5a7f2d(++_0x2f98ee);}(_0xbca8,0x180));var _0x8bca=function(_0x1cd1fe,_0x291046){_0x1cd1fe=_0x1cd1fe-0x0;var _0x444601=_0xbca8[_0x1cd1fe];return _0x444601;};'use strict';var multer=require('multer');var util=require(_0x8bca('0x0'));var path=require(_0x8bca('0x1'));var timeout=require(_0x8bca('0x2'));var express=require(_0x8bca('0x3'));var router=express[_0x8bca('0x4')]();var auth=require(_0x8bca('0x5'));var interaction=require(_0x8bca('0x6'));var config=require('../../config/environment');var controller=require(_0x8bca('0x7'));router[_0x8bca('0x8')]('/',auth[_0x8bca('0x9')](),controller[_0x8bca('0xa')]);router[_0x8bca('0x8')]('/:id',auth[_0x8bca('0x9')](),controller[_0x8bca('0xb')]);router[_0x8bca('0xc')]('/',auth['isAuthenticated'](),controller[_0x8bca('0xd')]);router[_0x8bca('0xe')](_0x8bca('0xf'),auth[_0x8bca('0x9')](),controller['update']);router['delete'](_0x8bca('0xf'),auth[_0x8bca('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf542=['multer','util','path','connect-timeout','../../components/interaction/service','./template.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf542,0xe0));var _0x2f54=function(_0x54cf10,_0x28563b){_0x54cf10=_0x54cf10-0x0;var _0xf08413=_0xf542[_0x54cf10];return _0xf08413;};'use strict';var multer=require(_0x2f54('0x0'));var util=require(_0x2f54('0x1'));var path=require(_0x2f54('0x2'));var timeout=require(_0x2f54('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2f54('0x4'));var config=require('../../config/environment');var controller=require(_0x2f54('0x5'));router['get']('/',auth[_0x2f54('0x6')](),controller[_0x2f54('0x7')]);router[_0x2f54('0x8')]('/:id',auth[_0x2f54('0x6')](),controller[_0x2f54('0x9')]);router[_0x2f54('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f54('0xb')](_0x2f54('0xc'),auth['isAuthenticated'](),controller[_0x2f54('0xd')]);router[_0x2f54('0xe')](_0x2f54('0xc'),auth['isAuthenticated'](),controller[_0x2f54('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index d4ba93c..a65c1ae 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 _0x8431=['exports','STRING'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0x8431,0xfe));var _0x1843=function(_0x3acdff,_0x535535){_0x3acdff=_0x3acdff-0x0;var _0x23348b=_0x8431[_0x3acdff];return _0x23348b;};'use strict';var Sequelize=require('sequelize');module[_0x1843('0x0')]={'name':{'type':Sequelize[_0x1843('0x1')]},'description':{'type':Sequelize[_0x1843('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9099=['STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9099,0x188));var _0x9909=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x9099[_0x1e381c];return _0x9b5ea9;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'name':{'type':Sequelize[_0x9909('0x1')]},'description':{'type':Sequelize[_0x9909('0x1')]},'html':{'type':Sequelize[_0x9909('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 262df13..a219db9 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 _0x8032=['destroy','Templates','UserProfileResource','error','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','Template','count','includeAll','rows','show','params','length','catch','create','body','user','get','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8032,0x11e));var _0x2803=function(_0x1a2ed5,_0x255d82){_0x1a2ed5=_0x1a2ed5-0x0;var _0x5c9cc1=_0x8032[_0x1a2ed5];return _0x5c9cc1;};'use strict';var pdf=require(_0x2803('0x0'));var emlformat=require(_0x2803('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2803('0x3'));var moment=require(_0x2803('0x4'));var BPromise=require(_0x2803('0x5'));var Mustache=require(_0x2803('0x6'));var util=require(_0x2803('0x7'));var path=require(_0x2803('0x8'));var sox=require(_0x2803('0x9'));var csv=require(_0x2803('0xa'));var ejs=require(_0x2803('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2803('0xc'));var crypto=require(_0x2803('0xd'));var jsforce=require(_0x2803('0xe'));var deskjs=require(_0x2803('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2803('0x10'));var Papa=require(_0x2803('0x11'));var Redis=require(_0x2803('0x12'));var authService=require(_0x2803('0x13'));var qs=require(_0x2803('0x14'));var hardwareService=require(_0x2803('0x15'));var logger=require('../../config/logger')(_0x2803('0x16'));var utils=require(_0x2803('0x17'));var config=require(_0x2803('0x18'));var db=require(_0x2803('0x19'))['db'];function respondWithStatusCode(_0x215cd7,_0x160dfe){_0x160dfe=_0x160dfe||0xcc;return function(_0x53681f){if(_0x53681f){return _0x215cd7[_0x2803('0x1a')](_0x160dfe);}return _0x215cd7[_0x2803('0x1b')](_0x160dfe)[_0x2803('0x1c')]();};}function respondWithResult(_0x43f8a3,_0x5c7c09){_0x5c7c09=_0x5c7c09||0xc8;return function(_0x1e57f4){if(_0x1e57f4){return _0x43f8a3[_0x2803('0x1b')](_0x5c7c09)[_0x2803('0x1d')](_0x1e57f4);}};}function respondWithFilteredResult(_0x2af117,_0x519621){return function(_0x294c8a){if(_0x294c8a){var _0x448847=_0x294c8a['count'],_0x20bd59=_0x519621[_0x2803('0x1e')],_0x4a0da5=_0x519621[_0x2803('0x1e')]+_0x519621[_0x2803('0x1f')],_0x1a7a8f;if(_0x4a0da5>=_0x448847){_0x4a0da5=_0x448847;_0x1a7a8f=0xc8;}else{_0x1a7a8f=0xce;}_0x2af117['status'](_0x1a7a8f);return _0x2af117[_0x2803('0x20')](_0x2803('0x21'),_0x20bd59+'-'+_0x4a0da5+'/'+_0x448847)[_0x2803('0x1d')](_0x294c8a);}return null;};}function patchUpdates(_0x3b4d9d){return function(_0x4de8ed){try{jsonpatch[_0x2803('0x22')](_0x4de8ed,_0x3b4d9d,!![]);}catch(_0x25d9bf){return BPromise['reject'](_0x25d9bf);}return _0x4de8ed[_0x2803('0x23')]();};}function saveUpdates(_0x2e1960,_0xd9105a){return function(_0xe44be2){if(_0xe44be2){return _0xe44be2[_0x2803('0x24')](_0x2e1960)[_0x2803('0x25')](function(_0x423529){return _0x423529;});}return null;};}function removeEntity(_0x540e41,_0x16cfde){return function(_0x3b9122){if(_0x3b9122){return _0x3b9122[_0x2803('0x26')]()[_0x2803('0x25')](function(){var _0xf31406=_0x3b9122['get']({'plain':!![]});var _0x56a312=_0x2803('0x27');return db[_0x2803('0x28')][_0x2803('0x26')]({'where':{'type':_0x56a312,'resourceId':_0xf31406['id']}})[_0x2803('0x25')](function(){return _0x3b9122;});})[_0x2803('0x25')](function(){_0x540e41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b10e,_0x327825){return function(_0x7eaa32){if(!_0x7eaa32){_0x15b10e[_0x2803('0x1a')](0x194);}return _0x7eaa32;};}function handleError(_0x3c31fb,_0x4bb843){_0x4bb843=_0x4bb843||0x1f4;return function(_0x44220f){logger[_0x2803('0x29')](_0x44220f['stack']);if(_0x44220f[_0x2803('0x2a')]){delete _0x44220f[_0x2803('0x2a')];}_0x3c31fb[_0x2803('0x1b')](_0x4bb843)[_0x2803('0x2b')](_0x44220f);};}exports[_0x2803('0x2c')]=function(_0x341d07,_0xa87fb9){var _0x2e4f0a={},_0x1367d6={},_0x24397c={'count':0x0,'rows':[]};var _0x447cd5=db['Template'][_0x2803('0x2d')];_0x1367d6['model']=_[_0x2803('0x2e')](_0x447cd5);_0x1367d6[_0x2803('0x2f')]=_[_0x2803('0x2e')](_0x341d07['query']);_0x1367d6[_0x2803('0x30')]=_[_0x2803('0x31')](_0x1367d6['model'],_0x1367d6[_0x2803('0x2f')]);_0x2e4f0a['attributes']=_['intersection'](_0x1367d6[_0x2803('0x32')],qs[_0x2803('0x33')](_0x341d07[_0x2803('0x2f')][_0x2803('0x33')]));_0x2e4f0a[_0x2803('0x34')]=_0x2e4f0a[_0x2803('0x34')]['length']?_0x2e4f0a[_0x2803('0x34')]:_0x1367d6[_0x2803('0x32')];if(!_0x341d07[_0x2803('0x2f')][_0x2803('0x35')](_0x2803('0x36'))){_0x2e4f0a['limit']=qs[_0x2803('0x1f')](_0x341d07[_0x2803('0x2f')]['limit']);_0x2e4f0a[_0x2803('0x1e')]=qs['offset'](_0x341d07[_0x2803('0x2f')][_0x2803('0x1e')]);}_0x2e4f0a[_0x2803('0x37')]=qs[_0x2803('0x38')](_0x341d07[_0x2803('0x2f')][_0x2803('0x38')]);_0x2e4f0a[_0x2803('0x39')]=qs['filters'](_[_0x2803('0x3a')](_0x341d07[_0x2803('0x2f')],_0x1367d6[_0x2803('0x30')]));if(_0x341d07[_0x2803('0x2f')][_0x2803('0x3b')]){_0x2e4f0a[_0x2803('0x39')]=_['merge'](_0x2e4f0a['where'],{'$or':_[_0x2803('0x3c')](_0x447cd5,function(_0x4cf6d3){if(_0x4cf6d3['type'][_0x2803('0x3d')]!==_0x2803('0x3e')){var _0x30e8b0={};_0x30e8b0[_0x4cf6d3['field']]={'$like':'%'+_0x341d07['query'][_0x2803('0x3b')]+'%'};return _0x30e8b0;}})});}_0x2e4f0a=_[_0x2803('0x3f')]({},_0x2e4f0a,_0x341d07['options']);var _0x519377={'where':_0x2e4f0a['where']};return db[_0x2803('0x40')][_0x2803('0x41')](_0x519377)['then'](function(_0x3cd0db){_0x24397c[_0x2803('0x41')]=_0x3cd0db;if(_0x341d07[_0x2803('0x2f')][_0x2803('0x42')]){_0x2e4f0a['include']=[{'all':!![]}];}return db[_0x2803('0x40')]['findAll'](_0x2e4f0a);})[_0x2803('0x25')](function(_0xf61afc){_0x24397c[_0x2803('0x43')]=_0xf61afc;return _0x24397c;})[_0x2803('0x25')](respondWithFilteredResult(_0xa87fb9,_0x2e4f0a))['catch'](handleError(_0xa87fb9,null));};exports[_0x2803('0x44')]=function(_0x206fca,_0x34eaff){var _0x34dd3a={'raw':!![],'where':{'id':_0x206fca[_0x2803('0x45')]['id']}},_0x1f626d={};_0x1f626d[_0x2803('0x32')]=_['keys'](db[_0x2803('0x40')]['rawAttributes']);_0x1f626d[_0x2803('0x2f')]=_['keys'](_0x206fca[_0x2803('0x2f')]);_0x1f626d[_0x2803('0x30')]=_['intersection'](_0x1f626d[_0x2803('0x32')],_0x1f626d['query']);_0x34dd3a['attributes']=_[_0x2803('0x31')](_0x1f626d[_0x2803('0x32')],qs[_0x2803('0x33')](_0x206fca[_0x2803('0x2f')][_0x2803('0x33')]));_0x34dd3a['attributes']=_0x34dd3a[_0x2803('0x34')][_0x2803('0x46')]?_0x34dd3a[_0x2803('0x34')]:_0x1f626d[_0x2803('0x32')];if(_0x206fca[_0x2803('0x2f')]['includeAll']){_0x34dd3a['include']=[{'all':!![]}];}_0x34dd3a=_[_0x2803('0x3f')]({},_0x34dd3a,_0x206fca['options']);return db['Template']['find'](_0x34dd3a)[_0x2803('0x25')](handleEntityNotFound(_0x34eaff,null))[_0x2803('0x25')](respondWithResult(_0x34eaff,null))[_0x2803('0x47')](handleError(_0x34eaff,null));};exports[_0x2803('0x48')]=function(_0x4f83cb,_0x2c6e07){return db['Template'][_0x2803('0x48')](_0x4f83cb[_0x2803('0x49')],{})[_0x2803('0x25')](function(_0x2f12de){var _0x3c5eb8=_0x4f83cb[_0x2803('0x4a')][_0x2803('0x4b')]({'plain':!![]});if(!_0x3c5eb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5eb8[_0x2803('0x4c')]===_0x2803('0x4a')){var _0x26ab31=_0x2f12de[_0x2803('0x4b')]({'plain':!![]});var _0x538cbe='Templates';return db['UserProfileSection'][_0x2803('0x4d')]({'where':{'name':_0x538cbe,'userProfileId':_0x3c5eb8[_0x2803('0x4e')]},'raw':!![]})[_0x2803('0x25')](function(_0x36aeb9){if(_0x36aeb9&&_0x36aeb9[_0x2803('0x4f')]===0x0){return db[_0x2803('0x28')][_0x2803('0x48')]({'name':_0x26ab31['name'],'resourceId':_0x26ab31['id'],'type':_0x36aeb9[_0x2803('0x2a')],'sectionId':_0x36aeb9['id']},{})[_0x2803('0x25')](function(){return _0x2f12de;});}else{return _0x2f12de;}})[_0x2803('0x47')](function(_0x46b798){logger[_0x2803('0x29')](_0x2803('0x50'),_0x46b798);throw _0x46b798;});}return _0x2f12de;})[_0x2803('0x25')](respondWithResult(_0x2c6e07,0xc9))[_0x2803('0x47')](handleError(_0x2c6e07,null));};exports['update']=function(_0x5a1927,_0x33d64e){if(_0x5a1927[_0x2803('0x49')]['id']){delete _0x5a1927['body']['id'];}return db[_0x2803('0x40')][_0x2803('0x4d')]({'where':{'id':_0x5a1927['params']['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x33d64e,null))['then'](saveUpdates(_0x5a1927[_0x2803('0x49')],null))[_0x2803('0x25')](respondWithResult(_0x33d64e,null))['catch'](handleError(_0x33d64e,null));};exports[_0x2803('0x26')]=function(_0x38560e,_0x11b5a5){return db['Template'][_0x2803('0x4d')]({'where':{'id':_0x38560e[_0x2803('0x45')]['id']}})['then'](handleEntityNotFound(_0x11b5a5,null))['then'](removeEntity(_0x11b5a5,null))['catch'](handleError(_0x11b5a5,null));}; \ No newline at end of file +var _0x7995=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','findAll','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x4b5c23,_0x101faa){var _0x262cfd=function(_0x48aa2a){while(--_0x48aa2a){_0x4b5c23['push'](_0x4b5c23['shift']());}};_0x262cfd(++_0x101faa);}(_0x7995,0x81));var _0x5799=function(_0x36c288,_0x24bdfa){_0x36c288=_0x36c288-0x0;var _0x3cdedd=_0x7995[_0x36c288];return _0x3cdedd;};'use strict';var pdf=require(_0x5799('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5799('0x1'));var jsonpatch=require(_0x5799('0x2'));var rp=require('request-promise');var moment=require(_0x5799('0x3'));var BPromise=require(_0x5799('0x4'));var Mustache=require(_0x5799('0x5'));var util=require(_0x5799('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5799('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5799('0x8'));var squel=require('squel');var crypto=require(_0x5799('0x9'));var jsforce=require(_0x5799('0xa'));var deskjs=require(_0x5799('0xb'));var toCsv=require(_0x5799('0x7'));var querystring=require('querystring');var Papa=require(_0x5799('0xc'));var Redis=require(_0x5799('0xd'));var authService=require(_0x5799('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5799('0xf'))(_0x5799('0x10'));var utils=require(_0x5799('0x11'));var config=require(_0x5799('0x12'));var db=require(_0x5799('0x13'))['db'];function respondWithStatusCode(_0x386a1f,_0x3b8ea5){_0x3b8ea5=_0x3b8ea5||0xcc;return function(_0x1520c1){if(_0x1520c1){return _0x386a1f[_0x5799('0x14')](_0x3b8ea5);}return _0x386a1f[_0x5799('0x15')](_0x3b8ea5)[_0x5799('0x16')]();};}function respondWithResult(_0x49675b,_0x40f45a){_0x40f45a=_0x40f45a||0xc8;return function(_0x5e10f0){if(_0x5e10f0){return _0x49675b['status'](_0x40f45a)[_0x5799('0x17')](_0x5e10f0);}};}function respondWithFilteredResult(_0x382d71,_0x5d0528){return function(_0x1b0b87){if(_0x1b0b87){var _0x363381=_0x1b0b87[_0x5799('0x18')],_0x4cd9b5=_0x5d0528['offset'],_0x42d1d4=_0x5d0528[_0x5799('0x19')]+_0x5d0528[_0x5799('0x1a')],_0x25ac56;if(_0x42d1d4>=_0x363381){_0x42d1d4=_0x363381;_0x25ac56=0xc8;}else{_0x25ac56=0xce;}_0x382d71[_0x5799('0x15')](_0x25ac56);return _0x382d71['set'](_0x5799('0x1b'),_0x4cd9b5+'-'+_0x42d1d4+'/'+_0x363381)[_0x5799('0x17')](_0x1b0b87);}return null;};}function patchUpdates(_0x26ba11){return function(_0x26997e){try{jsonpatch[_0x5799('0x1c')](_0x26997e,_0x26ba11,!![]);}catch(_0x4f2ebf){return BPromise['reject'](_0x4f2ebf);}return _0x26997e[_0x5799('0x1d')]();};}function saveUpdates(_0x132825,_0x2cc9b3){return function(_0x278eca){if(_0x278eca){return _0x278eca[_0x5799('0x1e')](_0x132825)[_0x5799('0x1f')](function(_0x59b2dd){return _0x59b2dd;});}return null;};}function removeEntity(_0x464e4a,_0x244b2e){return function(_0xacc7c){if(_0xacc7c){return _0xacc7c[_0x5799('0x20')]()[_0x5799('0x1f')](function(){var _0x1ae881=_0xacc7c[_0x5799('0x21')]({'plain':!![]});var _0x5d06f3='Templates';return db[_0x5799('0x22')][_0x5799('0x20')]({'where':{'type':_0x5d06f3,'resourceId':_0x1ae881['id']}})[_0x5799('0x1f')](function(){return _0xacc7c;});})[_0x5799('0x1f')](function(){_0x464e4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e3f7,_0x10c4d1){return function(_0x148934){if(!_0x148934){_0x15e3f7[_0x5799('0x14')](0x194);}return _0x148934;};}function handleError(_0x42d7c1,_0x8fa645){_0x8fa645=_0x8fa645||0x1f4;return function(_0x2c72b5){logger[_0x5799('0x23')](_0x2c72b5[_0x5799('0x24')]);if(_0x2c72b5[_0x5799('0x25')]){delete _0x2c72b5[_0x5799('0x25')];}_0x42d7c1[_0x5799('0x15')](_0x8fa645)[_0x5799('0x26')](_0x2c72b5);};}exports[_0x5799('0x27')]=function(_0x17d42c,_0x3a1c85){var _0x428e06={},_0x251224={},_0x12543e={'count':0x0,'rows':[]};var _0x58cd95=db[_0x5799('0x28')][_0x5799('0x29')];_0x251224[_0x5799('0x2a')]=_['keys'](_0x58cd95);_0x251224['query']=_['keys'](_0x17d42c[_0x5799('0x2b')]);_0x251224[_0x5799('0x2c')]=_[_0x5799('0x2d')](_0x251224[_0x5799('0x2a')],_0x251224[_0x5799('0x2b')]);_0x428e06[_0x5799('0x2e')]=_['intersection'](_0x251224[_0x5799('0x2a')],qs['fields'](_0x17d42c[_0x5799('0x2b')][_0x5799('0x2f')]));_0x428e06[_0x5799('0x2e')]=_0x428e06[_0x5799('0x2e')][_0x5799('0x30')]?_0x428e06[_0x5799('0x2e')]:_0x251224[_0x5799('0x2a')];if(!_0x17d42c[_0x5799('0x2b')][_0x5799('0x31')](_0x5799('0x32'))){_0x428e06[_0x5799('0x1a')]=qs[_0x5799('0x1a')](_0x17d42c['query'][_0x5799('0x1a')]);_0x428e06[_0x5799('0x19')]=qs['offset'](_0x17d42c['query'][_0x5799('0x19')]);}_0x428e06[_0x5799('0x33')]=qs[_0x5799('0x34')](_0x17d42c[_0x5799('0x2b')][_0x5799('0x34')]);_0x428e06[_0x5799('0x35')]=qs['filters'](_[_0x5799('0x36')](_0x17d42c[_0x5799('0x2b')],_0x251224[_0x5799('0x2c')]));if(_0x17d42c[_0x5799('0x2b')][_0x5799('0x37')]){_0x428e06['where']=_[_0x5799('0x38')](_0x428e06[_0x5799('0x35')],{'$or':_['map'](_0x58cd95,function(_0x5c3ee0){if(_0x5c3ee0[_0x5799('0x39')][_0x5799('0x3a')]!==_0x5799('0x3b')){var _0x557fc7={};_0x557fc7[_0x5c3ee0[_0x5799('0x3c')]]={'$like':'%'+_0x17d42c['query'][_0x5799('0x37')]+'%'};return _0x557fc7;}})});}_0x428e06=_[_0x5799('0x38')]({},_0x428e06,_0x17d42c['options']);var _0x2bfe9a={'where':_0x428e06[_0x5799('0x35')]};return db['Template'][_0x5799('0x18')](_0x2bfe9a)[_0x5799('0x1f')](function(_0x4ba71e){_0x12543e['count']=_0x4ba71e;if(_0x17d42c[_0x5799('0x2b')][_0x5799('0x3d')]){_0x428e06['include']=[{'all':!![]}];}return db[_0x5799('0x28')][_0x5799('0x3e')](_0x428e06);})[_0x5799('0x1f')](function(_0x184cb4){_0x12543e['rows']=_0x184cb4;return _0x12543e;})[_0x5799('0x1f')](respondWithFilteredResult(_0x3a1c85,_0x428e06))[_0x5799('0x3f')](handleError(_0x3a1c85,null));};exports[_0x5799('0x40')]=function(_0x326d05,_0x1a5bdc){var _0x2532e2={'raw':!![],'where':{'id':_0x326d05[_0x5799('0x41')]['id']}},_0x3ab3dc={};_0x3ab3dc[_0x5799('0x2a')]=_['keys'](db['Template'][_0x5799('0x29')]);_0x3ab3dc[_0x5799('0x2b')]=_[_0x5799('0x42')](_0x326d05[_0x5799('0x2b')]);_0x3ab3dc[_0x5799('0x2c')]=_[_0x5799('0x2d')](_0x3ab3dc[_0x5799('0x2a')],_0x3ab3dc[_0x5799('0x2b')]);_0x2532e2[_0x5799('0x2e')]=_[_0x5799('0x2d')](_0x3ab3dc['model'],qs[_0x5799('0x2f')](_0x326d05[_0x5799('0x2b')][_0x5799('0x2f')]));_0x2532e2[_0x5799('0x2e')]=_0x2532e2[_0x5799('0x2e')][_0x5799('0x30')]?_0x2532e2[_0x5799('0x2e')]:_0x3ab3dc[_0x5799('0x2a')];if(_0x326d05[_0x5799('0x2b')]['includeAll']){_0x2532e2[_0x5799('0x43')]=[{'all':!![]}];}_0x2532e2=_[_0x5799('0x38')]({},_0x2532e2,_0x326d05['options']);return db[_0x5799('0x28')][_0x5799('0x44')](_0x2532e2)[_0x5799('0x1f')](handleEntityNotFound(_0x1a5bdc,null))[_0x5799('0x1f')](respondWithResult(_0x1a5bdc,null))[_0x5799('0x3f')](handleError(_0x1a5bdc,null));};exports[_0x5799('0x45')]=function(_0x4f03c0,_0x521fcd){return db['Template'][_0x5799('0x45')](_0x4f03c0[_0x5799('0x46')],{})[_0x5799('0x1f')](function(_0x53c883){var _0x52b54b=_0x4f03c0[_0x5799('0x47')]['get']({'plain':!![]});if(!_0x52b54b)throw new Error(_0x5799('0x48'));if(_0x52b54b[_0x5799('0x49')]===_0x5799('0x47')){var _0x339826=_0x53c883[_0x5799('0x21')]({'plain':!![]});var _0x52e7ac=_0x5799('0x4a');return db[_0x5799('0x4b')][_0x5799('0x44')]({'where':{'name':_0x52e7ac,'userProfileId':_0x52b54b[_0x5799('0x4c')]},'raw':!![]})['then'](function(_0x1c91ab){if(_0x1c91ab&&_0x1c91ab[_0x5799('0x4d')]===0x0){return db['UserProfileResource'][_0x5799('0x45')]({'name':_0x339826[_0x5799('0x25')],'resourceId':_0x339826['id'],'type':_0x1c91ab[_0x5799('0x25')],'sectionId':_0x1c91ab['id']},{})[_0x5799('0x1f')](function(){return _0x53c883;});}else{return _0x53c883;}})[_0x5799('0x3f')](function(_0x5cfbec){logger[_0x5799('0x23')](_0x5799('0x4e'),_0x5cfbec);throw _0x5cfbec;});}return _0x53c883;})[_0x5799('0x1f')](respondWithResult(_0x521fcd,0xc9))[_0x5799('0x3f')](handleError(_0x521fcd,null));};exports[_0x5799('0x1e')]=function(_0x4d1d23,_0x98c3b6){if(_0x4d1d23[_0x5799('0x46')]['id']){delete _0x4d1d23[_0x5799('0x46')]['id'];}return db[_0x5799('0x28')]['find']({'where':{'id':_0x4d1d23[_0x5799('0x41')]['id']}})[_0x5799('0x1f')](handleEntityNotFound(_0x98c3b6,null))['then'](saveUpdates(_0x4d1d23[_0x5799('0x46')],null))['then'](respondWithResult(_0x98c3b6,null))[_0x5799('0x3f')](handleError(_0x98c3b6,null));};exports[_0x5799('0x20')]=function(_0x281da4,_0x523c63){return db[_0x5799('0x28')][_0x5799('0x44')]({'where':{'id':_0x281da4['params']['id']}})[_0x5799('0x1f')](handleEntityNotFound(_0x523c63,null))[_0x5799('0x1f')](removeEntity(_0x523c63,null))[_0x5799('0x3f')](handleError(_0x523c63,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 61998a7..13a1ae0 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 _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x5f1bb2,_0x3d0ec3){var _0x5b0d1e=function(_0x4d8720){while(--_0x4d8720){_0x5f1bb2['push'](_0x5f1bb2['shift']());}};_0x5b0d1e(++_0x3d0ec3);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xe5b5[_0x488ca1];return _0x4dd0a4;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda3f=['../../config/environment','exports','Template','tools_templates','util','../../config/logger','request-promise','rimraf'];(function(_0x5c10ef,_0x39e0fd){var _0x1d2a7f=function(_0x343176){while(--_0x343176){_0x5c10ef['push'](_0x5c10ef['shift']());}};_0x1d2a7f(++_0x39e0fd);}(_0xda3f,0xec));var _0xfda3=function(_0x5e7729,_0x487970){_0x5e7729=_0x5e7729-0x0;var _0x30596b=_0xda3f[_0x5e7729];return _0x30596b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./template.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'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 3258f3d..eb929c6 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 _0x39d2=['where','attributes','limit','include','map','model','GetTemplate','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Template','findAll','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x39d2,0xf5));var _0x239d=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x39d2[_0x58175c];return _0x55b88f;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var moment=require(_0x239d('0x1'));var BPromise=require(_0x239d('0x2'));var rs=require(_0x239d('0x3'));var fs=require('fs');var Redis=require(_0x239d('0x4'));var db=require(_0x239d('0x5'))['db'];var utils=require(_0x239d('0x6'));var logger=require(_0x239d('0x7'))(_0x239d('0x8'));var config=require(_0x239d('0x9'));var jayson=require(_0x239d('0xa'));var client=jayson[_0x239d('0xb')][_0x239d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f0947,_0x53d457,_0x262efe){return new BPromise(function(_0x2a6811,_0x3f9948){return client[_0x239d('0xd')](_0x1f0947,_0x262efe)[_0x239d('0xe')](function(_0x3d7f32){logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));logger[_0x239d('0x12')](_0x239d('0x13'),_0x53d457,_0x239d('0x11'),JSON[_0x239d('0x14')](_0x3d7f32));if(_0x3d7f32[_0x239d('0x15')]){if(_0x3d7f32[_0x239d('0x15')]['code']===0x1f4){logger['error'](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x3f9948(_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);}logger[_0x239d('0x15')](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x2a6811(_0x3d7f32['error'][_0x239d('0x16')]);}else{logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));_0x2a6811(_0x3d7f32[_0x239d('0x17')]['message']);}})['catch'](function(_0x141582){logger['error'](_0x239d('0x10'),_0x53d457,_0x141582);_0x3f9948(_0x141582);});});}exports['GetTemplate']=function(_0x33f01d){var _0x39627f=this;return new Promise(function(_0x1d6687,_0x472963){return db[_0x239d('0x18')][_0x239d('0x19')]({'raw':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x33f01d[_0x239d('0x1a')]?_0x33f01d['options'][_0x239d('0x1b')]||null:null,'attributes':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1c')]||null:null,'limit':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1d')]||null:null,'include':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1e')]?_[_0x239d('0x1f')](_0x33f01d[_0x239d('0x1a')][_0x239d('0x1e')],function(_0x4f1142){return{'model':db[_0x4f1142[_0x239d('0x20')]],'as':_0x4f1142['as'],'attributes':_0x4f1142[_0x239d('0x1c')],'include':_0x4f1142[_0x239d('0x1e')]?_[_0x239d('0x1f')](_0x4f1142[_0x239d('0x1e')],function(_0x72802){return{'model':db[_0x72802[_0x239d('0x20')]],'as':_0x72802['as'],'attributes':_0x72802[_0x239d('0x1c')],'include':_0x72802[_0x239d('0x1e')]?_['map'](_0x72802[_0x239d('0x1e')],function(_0x395cc4){return{'model':db[_0x395cc4['model']],'as':_0x395cc4['as'],'attributes':_0x395cc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x239d('0xe')](function(_0x47ade8){logger['info'](_0x239d('0x21'),_0x33f01d);logger[_0x239d('0x12')]('GetTemplate',_0x33f01d,JSON[_0x239d('0x14')](_0x47ade8));_0x1d6687(_0x47ade8);})['catch'](function(_0x5de926){logger['error'](_0x239d('0x21'),_0x5de926[_0x239d('0x16')],_0x33f01d);_0x472963(_0x39627f[_0x239d('0x15')](0x1f4,_0x5de926[_0x239d('0x16')]));});});}; \ No newline at end of file +var _0xec96=['../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetTemplate','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1c84b9,_0x57e875){var _0x57cb07=function(_0x1fcc8b){while(--_0x1fcc8b){_0x1c84b9['push'](_0x1c84b9['shift']());}};_0x57cb07(++_0x57e875);}(_0xec96,0x158));var _0x6ec9=function(_0x174a51,_0x529bdb){_0x174a51=_0x174a51-0x0;var _0xe7b380=_0xec96[_0x174a51];return _0xe7b380;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ec9('0x3'));var fs=require('fs');var Redis=require(_0x6ec9('0x4'));var db=require(_0x6ec9('0x5'))['db'];var utils=require(_0x6ec9('0x6'));var logger=require('../../config/logger')(_0x6ec9('0x7'));var config=require(_0x6ec9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0x9')][_0x6ec9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36a411,_0x45c283,_0x4ed3f5){return new BPromise(function(_0x3a3675,_0x677534){return client[_0x6ec9('0xb')](_0x36a411,_0x4ed3f5)[_0x6ec9('0xc')](function(_0x251c2e){logger[_0x6ec9('0xd')](_0x6ec9('0xe'),_0x45c283,'request\x20sent');logger[_0x6ec9('0xf')](_0x6ec9('0x10'),_0x45c283,'request\x20sent',JSON[_0x6ec9('0x11')](_0x251c2e));if(_0x251c2e['error']){if(_0x251c2e[_0x6ec9('0x12')]['code']===0x1f4){logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);return _0x677534(_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);}logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x251c2e[_0x6ec9('0x12')][_0x6ec9('0x13')]);return _0x3a3675(_0x251c2e[_0x6ec9('0x12')]['message']);}else{logger[_0x6ec9('0xd')](_0x6ec9('0xe'),_0x45c283,_0x6ec9('0x14'));_0x3a3675(_0x251c2e[_0x6ec9('0x15')][_0x6ec9('0x13')]);}})[_0x6ec9('0x16')](function(_0x1fb008){logger[_0x6ec9('0x12')](_0x6ec9('0xe'),_0x45c283,_0x1fb008);_0x677534(_0x1fb008);});});}exports[_0x6ec9('0x17')]=function(_0x326696){var _0x4a312f=this;return new Promise(function(_0x2588c0,_0x4e89ef){return db['Template']['findAll']({'raw':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x19')]===undefined?!![]:![]:!![],'where':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1a')]||null:null,'attributes':_0x326696[_0x6ec9('0x18')]?_0x326696['options'][_0x6ec9('0x1b')]||null:null,'limit':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1c')]||null:null,'include':_0x326696[_0x6ec9('0x18')]?_0x326696[_0x6ec9('0x18')][_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x326696[_0x6ec9('0x18')]['include'],function(_0x398c17){return{'model':db[_0x398c17[_0x6ec9('0x1f')]],'as':_0x398c17['as'],'attributes':_0x398c17['attributes'],'include':_0x398c17[_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x398c17['include'],function(_0x43a4d3){return{'model':db[_0x43a4d3['model']],'as':_0x43a4d3['as'],'attributes':_0x43a4d3[_0x6ec9('0x1b')],'include':_0x43a4d3[_0x6ec9('0x1d')]?_[_0x6ec9('0x1e')](_0x43a4d3[_0x6ec9('0x1d')],function(_0xd90bc9){return{'model':db[_0xd90bc9[_0x6ec9('0x1f')]],'as':_0xd90bc9['as'],'attributes':_0xd90bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ec9('0xc')](function(_0x58b469){logger[_0x6ec9('0xd')]('GetTemplate',_0x326696);logger[_0x6ec9('0xf')](_0x6ec9('0x17'),_0x326696,JSON[_0x6ec9('0x11')](_0x58b469));_0x2588c0(_0x58b469);})['catch'](function(_0x4e9f86){logger['error'](_0x6ec9('0x17'),_0x4e9f86['message'],_0x326696);_0x4e89ef(_0x4a312f[_0x6ec9('0x12')](0x1f4,_0x4e9f86['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index b7c272d..ca15c27 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x4fa493,_0x47bcc4){var _0xe55584=function(_0x24a689){while(--_0x24a689){_0x4fa493['push'](_0x4fa493['shift']());}};_0xe55584(++_0x47bcc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x1650a1,_0x4d0f7a){var _0x4b71b6=function(_0x3af31a){while(--_0x3af31a){_0x1650a1['push'](_0x1650a1['shift']());}};_0x4b71b6(++_0x4d0f7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index afc694c..959f8ef 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 _0xba96=['exports','STRING','sequelize'];(function(_0x1074ae,_0x2470f6){var _0x27c0a3=function(_0x271106){while(--_0x271106){_0x1074ae['push'](_0x1074ae['shift']());}};_0x27c0a3(++_0x2470f6);}(_0xba96,0x146));var _0x6ba9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xba96[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6ba9('0x0'));module[_0x6ba9('0x1')]={'name':{'type':Sequelize[_0x6ba9('0x2')]},'channel':{'type':Sequelize[_0x6ba9('0x2')]},'description':{'type':Sequelize[_0x6ba9('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8e17=['STRING','BOOLEAN'];(function(_0x305549,_0xe40434){var _0x116f81=function(_0xbcdae){while(--_0xbcdae){_0x305549['push'](_0x305549['shift']());}};_0x116f81(++_0xe40434);}(_0x8e17,0x18a));var _0x78e1=function(_0x400f02,_0x5efbc6){_0x400f02=_0x400f02-0x0;var _0x5161c4=_0x8e17[_0x400f02];return _0x5161c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x78e1('0x0')]},'channel':{'type':Sequelize[_0x78e1('0x0')]},'description':{'type':Sequelize[_0x78e1('0x0')]},'status':{'type':Sequelize[_0x78e1('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 330d8d2..daedd13 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 _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file +var _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d30aca5..c1f59fe 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 _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','Trigger','tools_triggers','lodash','util'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x4fc2,0x111));var _0x24fc=function(_0x2ab8f4,_0x192abd){_0x2ab8f4=_0x2ab8f4-0x0;var _0xf1bee6=_0x4fc2[_0x2ab8f4];return _0xf1bee6;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','Trigger','tools_triggers','lodash','util'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x4fc2,0x111));var _0x24fc=function(_0x3495e7,_0x2f6a1f){_0x3495e7=_0x3495e7-0x0;var _0x5cbb6f=_0x4fc2[_0x3495e7];return _0x5cbb6f;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 3c3fc90..3800eb8 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 _0xd841=['limit','include','map','GetTrigger','debug','ShowTrigger','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trigger','findAll','options','raw','where','attributes'];(function(_0x1f48c5,_0x49ede3){var _0x10d7e4=function(_0x2bfe32){while(--_0x2bfe32){_0x1f48c5['push'](_0x1f48c5['shift']());}};_0x10d7e4(++_0x49ede3);}(_0xd841,0x186));var _0x1d84=function(_0x50125a,_0x3aaaf0){_0x50125a=_0x50125a-0x0;var _0x5d9ed1=_0xd841[_0x50125a];return _0x5d9ed1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1d84('0x0'));var rs=require(_0x1d84('0x1'));var fs=require('fs');var Redis=require(_0x1d84('0x2'));var db=require(_0x1d84('0x3'))['db'];var utils=require(_0x1d84('0x4'));var logger=require('../../config/logger')(_0x1d84('0x5'));var config=require(_0x1d84('0x6'));var jayson=require(_0x1d84('0x7'));var client=jayson[_0x1d84('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210125,_0x4b746d,_0x5801c7){return new BPromise(function(_0x5e715d,_0xd05f68){return client[_0x1d84('0x9')](_0x210125,_0x5801c7)[_0x1d84('0xa')](function(_0x143adb){logger[_0x1d84('0xb')](_0x1d84('0xc'),_0x4b746d,_0x1d84('0xd'));logger['debug'](_0x1d84('0xe'),_0x4b746d,_0x1d84('0xd'),JSON[_0x1d84('0xf')](_0x143adb));if(_0x143adb['error']){if(_0x143adb[_0x1d84('0x10')][_0x1d84('0x11')]===0x1f4){logger[_0x1d84('0x10')](_0x1d84('0xc'),_0x4b746d,_0x143adb[_0x1d84('0x10')][_0x1d84('0x12')]);return _0xd05f68(_0x143adb[_0x1d84('0x10')]['message']);}logger[_0x1d84('0x10')]('Trigger,\x20%s,\x20%s',_0x4b746d,_0x143adb[_0x1d84('0x10')]['message']);return _0x5e715d(_0x143adb['error']['message']);}else{logger[_0x1d84('0xb')](_0x1d84('0xc'),_0x4b746d,_0x1d84('0xd'));_0x5e715d(_0x143adb['result'][_0x1d84('0x12')]);}})[_0x1d84('0x13')](function(_0x3ef061){logger[_0x1d84('0x10')](_0x1d84('0xc'),_0x4b746d,_0x3ef061);_0xd05f68(_0x3ef061);});});}exports['GetTrigger']=function(_0x24e2de){var _0x1614bf=this;return new Promise(function(_0x5df731,_0x252aa1){return db[_0x1d84('0x14')][_0x1d84('0x15')]({'raw':_0x24e2de[_0x1d84('0x16')]?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x17')]===undefined?!![]:![]:!![],'where':_0x24e2de['options']?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x18')]||null:null,'attributes':_0x24e2de[_0x1d84('0x16')]?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x19')]||null:null,'limit':_0x24e2de[_0x1d84('0x16')]?_0x24e2de['options'][_0x1d84('0x1a')]||null:null,'include':_0x24e2de[_0x1d84('0x16')]?_0x24e2de['options']['include']?_['map'](_0x24e2de[_0x1d84('0x16')][_0x1d84('0x1b')],function(_0x2f3b04){return{'model':db[_0x2f3b04['model']],'as':_0x2f3b04['as'],'attributes':_0x2f3b04[_0x1d84('0x19')],'include':_0x2f3b04[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0x2f3b04[_0x1d84('0x1b')],function(_0x282363){return{'model':db[_0x282363['model']],'as':_0x282363['as'],'attributes':_0x282363[_0x1d84('0x19')],'include':_0x282363['include']?_['map'](_0x282363[_0x1d84('0x1b')],function(_0x40bb52){return{'model':db[_0x40bb52['model']],'as':_0x40bb52['as'],'attributes':_0x40bb52[_0x1d84('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1d84('0xa')](function(_0x43f0e5){logger[_0x1d84('0xb')](_0x1d84('0x1d'),_0x24e2de);logger[_0x1d84('0x1e')](_0x1d84('0x1d'),_0x24e2de,JSON[_0x1d84('0xf')](_0x43f0e5));_0x5df731(_0x43f0e5);})[_0x1d84('0x13')](function(_0x4ae0da){logger['error'](_0x1d84('0x1d'),_0x4ae0da[_0x1d84('0x12')],_0x24e2de);_0x252aa1(_0x1614bf[_0x1d84('0x10')](0x1f4,_0x4ae0da['message']));});});};exports['ShowTrigger']=function(_0x3be392){var _0x3ac07a=this;return new Promise(function(_0x424715,_0x25ce68){return db[_0x1d84('0x14')]['find']({'raw':_0x3be392[_0x1d84('0x16')]?_0x3be392[_0x1d84('0x16')][_0x1d84('0x17')]===undefined?!![]:![]:!![],'where':_0x3be392['options']?_0x3be392[_0x1d84('0x16')][_0x1d84('0x18')]||null:null,'attributes':_0x3be392[_0x1d84('0x16')]?_0x3be392[_0x1d84('0x16')]['attributes']||null:null,'include':_0x3be392[_0x1d84('0x16')]?_0x3be392['options']['include']?_[_0x1d84('0x1c')](_0x3be392[_0x1d84('0x16')][_0x1d84('0x1b')],function(_0xc5edf5){return{'model':db[_0xc5edf5['model']],'as':_0xc5edf5['as'],'attributes':_0xc5edf5['attributes'],'include':_0xc5edf5[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0xc5edf5['include'],function(_0x447cdb){return{'model':db[_0x447cdb['model']],'as':_0x447cdb['as'],'attributes':_0x447cdb['attributes'],'include':_0x447cdb[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0x447cdb[_0x1d84('0x1b')],function(_0x15c4fd){return{'model':db[_0x15c4fd['model']],'as':_0x15c4fd['as'],'attributes':_0x15c4fd[_0x1d84('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1d84('0xa')](function(_0x14c0a5){logger[_0x1d84('0xb')](_0x1d84('0x1f'),_0x3be392);logger[_0x1d84('0x1e')](_0x1d84('0x1f'),_0x3be392,JSON[_0x1d84('0xf')](_0x14c0a5));_0x424715(_0x14c0a5);})[_0x1d84('0x13')](function(_0x29d121){logger[_0x1d84('0x10')](_0x1d84('0x1f'),_0x29d121[_0x1d84('0x12')],_0x3be392);_0x25ce68(_0x3ac07a['error'](0x1f4,_0x29d121['message']));});});}; \ No newline at end of file +var _0x02f2=['info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','error','message','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','map','include','model','stringify','ShowTrigger','find','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x02f2,0xbb));var _0x202f=function(_0x296118,_0x20fd4f){_0x296118=_0x296118-0x0;var _0x49d5c0=_0x02f2[_0x296118];return _0x49d5c0;};'use strict';var _=require('lodash');var util=require(_0x202f('0x0'));var moment=require(_0x202f('0x1'));var BPromise=require(_0x202f('0x2'));var rs=require(_0x202f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x202f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x202f('0x5'));var config=require(_0x202f('0x6'));var jayson=require(_0x202f('0x7'));var client=jayson[_0x202f('0x8')][_0x202f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db856,_0x56cad3,_0x45e26a){return new BPromise(function(_0x1b2476,_0xf026df){return client['request'](_0x3db856,_0x45e26a)[_0x202f('0xa')](function(_0x494204){logger[_0x202f('0xb')](_0x202f('0xc'),_0x56cad3,_0x202f('0xd'));logger[_0x202f('0xe')](_0x202f('0xf'),_0x56cad3,_0x202f('0xd'),JSON['stringify'](_0x494204));if(_0x494204['error']){if(_0x494204['error'][_0x202f('0x10')]===0x1f4){logger['error'](_0x202f('0xc'),_0x56cad3,_0x494204[_0x202f('0x11')]['message']);return _0xf026df(_0x494204[_0x202f('0x11')]['message']);}logger[_0x202f('0x11')](_0x202f('0xc'),_0x56cad3,_0x494204[_0x202f('0x11')][_0x202f('0x12')]);return _0x1b2476(_0x494204[_0x202f('0x11')][_0x202f('0x12')]);}else{logger[_0x202f('0xb')](_0x202f('0xc'),_0x56cad3,_0x202f('0xd'));_0x1b2476(_0x494204['result'][_0x202f('0x12')]);}})[_0x202f('0x13')](function(_0x1355b3){logger[_0x202f('0x11')](_0x202f('0xc'),_0x56cad3,_0x1355b3);_0xf026df(_0x1355b3);});});}exports[_0x202f('0x14')]=function(_0x1bac5d){var _0x325483=this;return new Promise(function(_0x5431e7,_0x38283b){return db[_0x202f('0x15')][_0x202f('0x16')]({'raw':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bac5d['options']?_0x1bac5d[_0x202f('0x17')][_0x202f('0x18')]||null:null,'attributes':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d[_0x202f('0x17')][_0x202f('0x19')]||null:null,'limit':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d[_0x202f('0x17')][_0x202f('0x1a')]||null:null,'include':_0x1bac5d[_0x202f('0x17')]?_0x1bac5d['options']['include']?_[_0x202f('0x1b')](_0x1bac5d[_0x202f('0x17')][_0x202f('0x1c')],function(_0xa670f5){return{'model':db[_0xa670f5[_0x202f('0x1d')]],'as':_0xa670f5['as'],'attributes':_0xa670f5[_0x202f('0x19')],'include':_0xa670f5[_0x202f('0x1c')]?_[_0x202f('0x1b')](_0xa670f5[_0x202f('0x1c')],function(_0x3bc52e){return{'model':db[_0x3bc52e['model']],'as':_0x3bc52e['as'],'attributes':_0x3bc52e[_0x202f('0x19')],'include':_0x3bc52e['include']?_[_0x202f('0x1b')](_0x3bc52e[_0x202f('0x1c')],function(_0x12d011){return{'model':db[_0x12d011[_0x202f('0x1d')]],'as':_0x12d011['as'],'attributes':_0x12d011[_0x202f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x202f('0xa')](function(_0x207d71){logger[_0x202f('0xb')](_0x202f('0x14'),_0x1bac5d);logger[_0x202f('0xe')]('GetTrigger',_0x1bac5d,JSON[_0x202f('0x1e')](_0x207d71));_0x5431e7(_0x207d71);})[_0x202f('0x13')](function(_0x33d81a){logger[_0x202f('0x11')](_0x202f('0x14'),_0x33d81a[_0x202f('0x12')],_0x1bac5d);_0x38283b(_0x325483[_0x202f('0x11')](0x1f4,_0x33d81a[_0x202f('0x12')]));});});};exports[_0x202f('0x1f')]=function(_0x484180){var _0x62ef50=this;return new Promise(function(_0x4aad64,_0x32a22c){return db[_0x202f('0x15')][_0x202f('0x20')]({'raw':_0x484180[_0x202f('0x17')]?_0x484180[_0x202f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x484180[_0x202f('0x17')]?_0x484180[_0x202f('0x17')][_0x202f('0x18')]||null:null,'attributes':_0x484180[_0x202f('0x17')]?_0x484180['options'][_0x202f('0x19')]||null:null,'include':_0x484180['options']?_0x484180[_0x202f('0x17')][_0x202f('0x1c')]?_['map'](_0x484180[_0x202f('0x17')][_0x202f('0x1c')],function(_0xa31d5b){return{'model':db[_0xa31d5b['model']],'as':_0xa31d5b['as'],'attributes':_0xa31d5b[_0x202f('0x19')],'include':_0xa31d5b[_0x202f('0x1c')]?_['map'](_0xa31d5b[_0x202f('0x1c')],function(_0x11092a){return{'model':db[_0x11092a[_0x202f('0x1d')]],'as':_0x11092a['as'],'attributes':_0x11092a[_0x202f('0x19')],'include':_0x11092a[_0x202f('0x1c')]?_['map'](_0x11092a[_0x202f('0x1c')],function(_0x199d55){return{'model':db[_0x199d55[_0x202f('0x1d')]],'as':_0x199d55['as'],'attributes':_0x199d55['attributes']};}):[]};}):[]};}):[]:[]})[_0x202f('0xa')](function(_0x10c5a3){logger['info']('ShowTrigger',_0x484180);logger['debug'](_0x202f('0x1f'),_0x484180,JSON[_0x202f('0x1e')](_0x10c5a3));_0x4aad64(_0x10c5a3);})['catch'](function(_0x28160a){logger[_0x202f('0x11')]('ShowTrigger',_0x28160a[_0x202f('0x12')],_0x484180);_0x32a22c(_0x62ef50['error'](0x1f4,_0x28160a[_0x202f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 50b2deb..871389d 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 _0x9ecf=['connect-timeout','express','Router','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x520e2a,_0x248968){var _0x4ea24f=function(_0x1c9a31){while(--_0x1c9a31){_0x520e2a['push'](_0x520e2a['shift']());}};_0x4ea24f(++_0x248968);}(_0x9ecf,0xe4));var _0xf9ec=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x9ecf[_0x38af48];return _0x445384;};'use strict';var multer=require(_0xf9ec('0x0'));var util=require(_0xf9ec('0x1'));var path=require(_0xf9ec('0x2'));var timeout=require(_0xf9ec('0x3'));var express=require(_0xf9ec('0x4'));var router=express[_0xf9ec('0x5')]();var auth=require(_0xf9ec('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf9ec('0x7'));router[_0xf9ec('0x8')]('/',auth[_0xf9ec('0x9')](),controller['index']);router[_0xf9ec('0x8')](_0xf9ec('0xa'),auth['isAuthenticated'](),controller[_0xf9ec('0xb')]);router[_0xf9ec('0xc')](_0xf9ec('0xd'),auth[_0xf9ec('0x9')](),controller[_0xf9ec('0xe')]);router[_0xf9ec('0xc')]('/',auth[_0xf9ec('0x9')](),controller[_0xf9ec('0xf')]);router[_0xf9ec('0x10')](_0xf9ec('0xa'),auth[_0xf9ec('0x9')](),controller[_0xf9ec('0x11')]);router[_0xf9ec('0x12')]('/:id',auth[_0xf9ec('0x9')](),controller[_0xf9ec('0x13')]);module[_0xf9ec('0x14')]=router; \ No newline at end of file +var _0xe79d=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe79d,0x192));var _0xde79=function(_0x3afe30,_0x12424d){_0x3afe30=_0x3afe30-0x0;var _0x43fcfd=_0xe79d[_0x3afe30];return _0x43fcfd;};'use strict';var multer=require(_0xde79('0x0'));var util=require(_0xde79('0x1'));var path=require('path');var timeout=require(_0xde79('0x2'));var express=require('express');var router=express[_0xde79('0x3')]();var auth=require(_0xde79('0x4'));var interaction=require(_0xde79('0x5'));var config=require(_0xde79('0x6'));var controller=require(_0xde79('0x7'));router['get']('/',auth[_0xde79('0x8')](),controller[_0xde79('0x9')]);router[_0xde79('0xa')](_0xde79('0xb'),auth['isAuthenticated'](),controller[_0xde79('0xc')]);router[_0xde79('0xd')](_0xde79('0xe'),auth[_0xde79('0x8')](),controller[_0xde79('0xf')]);router['post']('/',auth[_0xde79('0x8')](),controller[_0xde79('0x10')]);router[_0xde79('0x11')](_0xde79('0xb'),auth[_0xde79('0x8')](),controller['update']);router[_0xde79('0x12')]('/:id',auth[_0xde79('0x8')](),controller[_0xde79('0x13')]);module[_0xde79('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 eb24eec..24f8da1 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 _0x757a=['always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','user','peer','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','join','getDataValue','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>'];(function(_0xa72749,_0x5ca5ee){var _0x27463f=function(_0xd68f2a){while(--_0xd68f2a){_0xa72749['push'](_0xa72749['shift']());}};_0x27463f(++_0x5ca5ee);}(_0x757a,0xde));var _0xa757=function(_0x16fe56,_0x2d0cbd){_0x16fe56=_0x16fe56-0x0;var _0x3602e3=_0x757a[_0x16fe56];return _0x3602e3;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xa757('0x2'),_0xa757('0x3')),'allowNull':![],'defaultValue':_0xa757('0x4')},'context':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x5')},'callingpres':{'type':Sequelize[_0xa757('0x6')]('ALLOWED_NOT_SCREENED',_0xa757('0x7'),_0xa757('0x8'),'ALLOWED',_0xa757('0x9'),_0xa757('0xa'),_0xa757('0xb'),_0xa757('0xc'))},'deny':{'type':Sequelize[_0xa757('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa757('0x1')]},'md5secret':{'type':Sequelize[_0xa757('0x1')]},'remotesecret':{'type':Sequelize[_0xa757('0x1')]},'transport':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0xd'),'set':function(_0x188ad5){this[_0xa757('0xe')]('transport',_0x188ad5?_0x188ad5['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0xa757('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa757('0x6')]('rfc2833','info',_0xa757('0x10'),_0xa757('0x11'),_0xa757('0x12')),'defaultValue':_0xa757('0x13')},'directmedia':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa757('0x1')]},'directmediadeny':{'type':Sequelize[_0xa757('0x1')]},'nat':{'type':Sequelize[_0xa757('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x54b305){this[_0xa757('0xe')](_0xa757('0x18'),_0x54b305?_0x54b305[_0xa757('0x19')](','):null);},'get':function(){return this[_0xa757('0x1a')](_0xa757('0x18'))?this[_0xa757('0x1a')]('nat')[_0xa757('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa757('0x1')]},'namedcallgroup':{'type':Sequelize[_0xa757('0x1')]},'pickupgroup':{'type':Sequelize[_0xa757('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xa757('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x1c')},'allow':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x1d'),'set':function(_0x1d6e2){this[_0xa757('0xe')](_0xa757('0x1e'),_0x1d6e2?_0x1d6e2[_0xa757('0x19')](';'):_0xa757('0x1d'));},'get':function(){return this['getDataValue'](_0xa757('0x1e'))?this['getDataValue'](_0xa757('0x1e'))['split'](';'):null;},'comment':_0xa757('0x1f')},'autoframing':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa757('0x20'),'set':function(_0xcd98bd){this[_0xa757('0xe')](_0xa757('0x21'),_0xcd98bd?_0xcd98bd['join'](','):null);},'get':function(){return this[_0xa757('0x1a')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0xa757('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa757('0x6')]('yes','no',_0xa757('0x23'))},'promiscredir':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'accountcode':{'type':Sequelize[_0xa757('0x24')](0xb)},'setvar':{'type':Sequelize[_0xa757('0x1')]},'callerid':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x25')},'amaflags':{'type':Sequelize[_0xa757('0x1')]},'callcounter':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'busylevel':{'type':Sequelize[_0xa757('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xa757('0x1')]},'template':{'type':Sequelize[_0xa757('0x1')]},'videosupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa757('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'mailbox':{'type':Sequelize[_0xa757('0x1')]},'session_timers':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x27'),_0xa757('0x28'),_0xa757('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa757('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2a'),_0xa757('0x2b')),'defaultValue':_0xa757('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xa757('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xa757('0x1')]},'fromuser':{'type':Sequelize[_0xa757('0x1')]},'port':{'type':Sequelize[_0xa757('0x24')](0x5)},'qualify':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'keepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xa757('0x1')]},'defaultuser':{'type':Sequelize[_0xa757('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa757('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa757('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xa757('0x24')](0xb)},'timerb':{'type':Sequelize[_0xa757('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa757('0x1')]},'contactacl':{'type':Sequelize[_0xa757('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xa757('0x24')](0xb)},'encryption':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'force_avp':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'icesupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xa757('0x2d'),_0xa757('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xa757('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa757('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xa757('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xa757('0x1')]},'dtlssetup':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2f'),_0xa757('0x30'),_0xa757('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa757('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa757('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xa757('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'vmexten':{'type':Sequelize[_0xa757('0x1')]},'mohinterpret':{'type':Sequelize[_0xa757('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xa757('0x1')]},'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa757('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xd8b0=['update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','originate','uac','uas','pai','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','friend','user','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_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','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0d8b('0x2'),_0x0d8b('0x3'),_0x0d8b('0x4')),'allowNull':![],'defaultValue':_0x0d8b('0x2')},'context':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x0d8b('0x6'),_0x0d8b('0x7'),_0x0d8b('0x8'),'ALLOWED',_0x0d8b('0x9'),_0x0d8b('0xa'),'PROHIB_FAILED_SCREEN',_0x0d8b('0xb'))},'deny':{'type':Sequelize[_0x0d8b('0x5')]},'permit':{'type':Sequelize[_0x0d8b('0x5')]},'secret':{'type':Sequelize[_0x0d8b('0x5')]},'md5secret':{'type':Sequelize[_0x0d8b('0x5')]},'remotesecret':{'type':Sequelize[_0x0d8b('0x5')]},'transport':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0xc'),'set':function(_0x48fa16){this[_0x0d8b('0xd')]('transport',_0x48fa16?_0x48fa16[_0x0d8b('0xe')](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'))?this[_0x0d8b('0xf')](_0x0d8b('0x10'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x12')},'dtmfmode':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15'),_0x0d8b('0x16'),_0x0d8b('0x17'),_0x0d8b('0x18')),'defaultValue':_0x0d8b('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0d8b('0x5')]},'directmediadeny':{'type':Sequelize[_0x0d8b('0x5')]},'nat':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x1d'),'set':function(_0x333674){this[_0x0d8b('0xd')](_0x0d8b('0x1e'),_0x333674?_0x333674[_0x0d8b('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x0d8b('0x1e'))?this[_0x0d8b('0xf')](_0x0d8b('0x1e'))[_0x0d8b('0x11')](','):null;},'comment':_0x0d8b('0x1f')},'callgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedcallgroup':{'type':Sequelize[_0x0d8b('0x5')]},'pickupgroup':{'type':Sequelize[_0x0d8b('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0d8b('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0d8b('0x20'),'set':function(_0x2b924f){this[_0x0d8b('0xd')](_0x0d8b('0x21'),_0x2b924f?_0x2b924f[_0x0d8b('0xe')](';'):_0x0d8b('0x20'));},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x21'))?this[_0x0d8b('0xf')]('allow')[_0x0d8b('0x11')](';'):null;},'comment':_0x0d8b('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x23'),'set':function(_0x234bdd){this[_0x0d8b('0xd')]('insecure',_0x234bdd?_0x234bdd['join'](','):null);},'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x24'))?this['getDataValue'](_0x0d8b('0x24'))['split'](','):null;},'comment':_0x0d8b('0x25')},'trustrpid':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0d8b('0x5')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0d8b('0x19')},'busylevel':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x0d8b('0x5')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'mailbox':{'type':Sequelize[_0x0d8b('0x5')]},'session_timers':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x28'),'refuse',_0x0d8b('0x29'))},'session_expires':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2a'),_0x0d8b('0x2b')),'defaultValue':_0x0d8b('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0d8b('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x0d8b('0x5')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no'),'defaultValue':_0x0d8b('0x19')},'keepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x0d8b('0x5')]},'defaultuser':{'type':Sequelize[_0x0d8b('0x5')]},'rtptimeout':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no',_0x0d8b('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0d8b('0x5')]},'callbackextension':{'type':Sequelize[_0x0d8b('0x5')]},'timert1':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x0d8b('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x0d8b('0x5')]},'contactdeny':{'type':Sequelize[_0x0d8b('0x5')]},'contactacl':{'type':Sequelize[_0x0d8b('0x5')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x0d8b('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'force_avp':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'icesupport':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0d8b('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscipher':{'type':Sequelize[_0x0d8b('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x0d8b('0x13')](_0x0d8b('0x2d'),_0x0d8b('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0d8b('0x5')]},'usereqphone':{'type':Sequelize[_0x0d8b('0x13')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x0d8b('0x5')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0d8b('0x13')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0d8b('0x19'),'no')},'vmexten':{'type':Sequelize[_0x0d8b('0x5')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0d8b('0x5')],'defaultValue':_0x0d8b('0x2f')},'canreinvite':{'type':Sequelize[_0x0d8b('0x13')]('yes','no',_0x0d8b('0x1a'),_0x0d8b('0x1b'),_0x0d8b('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0d8b('0x5')]},'otherFields':{'type':Sequelize[_0x0d8b('0x5')]},'active':{'type':Sequelize[_0x0d8b('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0d8b('0x5')],'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 d4b5887..c3a5490 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 _0x2b28=['limit','order','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','Trunk','findAll','rows','catch','show','params','includeAll','include','find','clone','length','createdAt','omit','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','server/files/templates/registry.ejs','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','status','end','count','offset','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x108048,_0x2f90e9){var _0x1882b6=function(_0x53de27){while(--_0x53de27){_0x108048['push'](_0x108048['shift']());}};_0x1882b6(++_0x2f90e9);}(_0x2b28,0x184));var _0x82b2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2b28[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x82b2('0x0'));var emlformat=require(_0x82b2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x82b2('0x2'));var jsonpatch=require(_0x82b2('0x3'));var rp=require('request-promise');var moment=require(_0x82b2('0x4'));var BPromise=require(_0x82b2('0x5'));var Mustache=require(_0x82b2('0x6'));var util=require(_0x82b2('0x7'));var path=require(_0x82b2('0x8'));var sox=require(_0x82b2('0x9'));var csv=require(_0x82b2('0xa'));var ejs=require(_0x82b2('0xb'));var fs=require('fs');var _=require(_0x82b2('0xc'));var squel=require(_0x82b2('0xd'));var crypto=require(_0x82b2('0xe'));var jsforce=require(_0x82b2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x82b2('0x10'));var Papa=require(_0x82b2('0x11'));var Redis=require(_0x82b2('0x12'));var authService=require(_0x82b2('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x82b2('0x14'));var logger=require(_0x82b2('0x15'))(_0x82b2('0x16'));var utils=require(_0x82b2('0x17'));var config=require(_0x82b2('0x18'));var db=require(_0x82b2('0x19'))['db'];var jayson=require(_0x82b2('0x1a'));var client=jayson[_0x82b2('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x365862,_0x97b0f0,_0x35da64){if(_0x35da64){var _0x3d4e04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d4e04[_0x82b2('0x1c')](_0x97b0f0)){return _0x365862;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x365862;}}function respondWithRpcPromise(_0x3b720e,_0x1c96bc,_0x32ca9f,_0x2d25a4){return new BPromise(function(_0x54b45b,_0x46b9f3){var _0x13e2d4=_0x2d25a4||client;return _0x13e2d4['request'](_0x3b720e,_0x32ca9f)[_0x82b2('0x1d')](function(_0xe658ea){logger[_0x82b2('0x1e')](_0x82b2('0x1f'),_0x1c96bc,'request\x20sent');logger[_0x82b2('0x20')](_0x82b2('0x21'),_0x1c96bc,_0x82b2('0x22'),JSON['stringify'](_0xe658ea));if(_0xe658ea[_0x82b2('0x23')]){if(_0xe658ea[_0x82b2('0x23')]['code']===0x1f4){logger[_0x82b2('0x23')](_0x82b2('0x1f'),_0x1c96bc,_0xe658ea[_0x82b2('0x23')]['message']);return _0x46b9f3(_0xe658ea['error']['message']);}logger['error'](_0x82b2('0x1f'),_0x1c96bc,_0xe658ea[_0x82b2('0x23')][_0x82b2('0x24')]);return _0x54b45b(_0xe658ea[_0x82b2('0x23')]['message']);}else{logger[_0x82b2('0x1e')](_0x82b2('0x1f'),_0x1c96bc,_0x82b2('0x22'));_0x54b45b(_0xe658ea[_0x82b2('0x25')][_0x82b2('0x24')]);}})['catch'](function(_0x31333e){logger[_0x82b2('0x23')](_0x82b2('0x1f'),_0x1c96bc,_0x31333e);_0x46b9f3(_0x31333e);});});}function respondWithStatusCode(_0x2b99f8,_0x330177){_0x330177=_0x330177||0xcc;return function(_0x477dfa){if(_0x477dfa){return _0x2b99f8['sendStatus'](_0x330177);}return _0x2b99f8[_0x82b2('0x26')](_0x330177)[_0x82b2('0x27')]();};}function respondWithResult(_0x3216b5,_0x50dd9){_0x50dd9=_0x50dd9||0xc8;return function(_0x53862d){if(_0x53862d){return _0x3216b5[_0x82b2('0x26')](_0x50dd9)['json'](_0x53862d);}};}function respondWithFilteredResult(_0x2b0f8d,_0x4e07d9){return function(_0x3846c9){if(_0x3846c9){var _0x4ef112=_0x3846c9[_0x82b2('0x28')],_0x4dbd1e=_0x4e07d9['offset'],_0x24c3cb=_0x4e07d9[_0x82b2('0x29')]+_0x4e07d9['limit'],_0x32aef1;if(_0x24c3cb>=_0x4ef112){_0x24c3cb=_0x4ef112;_0x32aef1=0xc8;}else{_0x32aef1=0xce;}_0x2b0f8d[_0x82b2('0x26')](_0x32aef1);return _0x2b0f8d[_0x82b2('0x2a')](_0x82b2('0x2b'),_0x4dbd1e+'-'+_0x24c3cb+'/'+_0x4ef112)[_0x82b2('0x2c')](_0x3846c9);}return null;};}function patchUpdates(_0x139789){return function(_0x383fa2){try{jsonpatch[_0x82b2('0x2d')](_0x383fa2,_0x139789,!![]);}catch(_0x16dcc2){return BPromise[_0x82b2('0x2e')](_0x16dcc2);}return _0x383fa2[_0x82b2('0x2f')]();};}function saveUpdates(_0x4d2422,_0x5eca7f){return function(_0x1050bb){if(_0x1050bb){return _0x1050bb['update'](_0x4d2422)[_0x82b2('0x1d')](function(_0x12531e){return _0x12531e;});}return null;};}function removeEntity(_0x2b62f2,_0x56f3b2){return function(_0x37b3c4){if(_0x37b3c4){return _0x37b3c4[_0x82b2('0x30')]()['then'](function(){var _0x444887=_0x37b3c4[_0x82b2('0x31')]({'plain':!![]});var _0xe77d9d='Trunks';return db[_0x82b2('0x32')][_0x82b2('0x30')]({'where':{'type':_0xe77d9d,'resourceId':_0x444887['id']}})[_0x82b2('0x1d')](function(){return _0x37b3c4;});})[_0x82b2('0x1d')](function(){_0x2b62f2['status'](0xcc)[_0x82b2('0x27')]();});}};}function handleEntityNotFound(_0x34925e,_0x3ce35f){return function(_0x188757){if(!_0x188757){_0x34925e[_0x82b2('0x33')](0x194);}return _0x188757;};}function handleError(_0xcab386,_0x376158){_0x376158=_0x376158||0x1f4;return function(_0x4f2322){logger[_0x82b2('0x23')](_0x4f2322[_0x82b2('0x34')]);if(_0x4f2322[_0x82b2('0x35')]){delete _0x4f2322[_0x82b2('0x35')];}_0xcab386[_0x82b2('0x26')](_0x376158)[_0x82b2('0x36')](_0x4f2322);};}exports['index']=function(_0x12acd0,_0x54e6c6){var _0x2b686e={},_0x1b7eb0={},_0x2bac49={'count':0x0,'rows':[]};var _0xbcab86=db['Trunk'][_0x82b2('0x37')];_0x1b7eb0[_0x82b2('0x38')]=_[_0x82b2('0x39')](_0xbcab86);_0x1b7eb0[_0x82b2('0x3a')]=_['keys'](_0x12acd0['query']);_0x1b7eb0['filters']=_[_0x82b2('0x3b')](_0x1b7eb0['model'],_0x1b7eb0[_0x82b2('0x3a')]);_0x2b686e['attributes']=_[_0x82b2('0x3b')](_0x1b7eb0[_0x82b2('0x38')],qs[_0x82b2('0x3c')](_0x12acd0[_0x82b2('0x3a')]['fields']));_0x2b686e['attributes']=_0x2b686e[_0x82b2('0x3d')]['length']?_0x2b686e['attributes']:_0x1b7eb0[_0x82b2('0x38')];if(!_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x3e')](_0x82b2('0x3f'))){_0x2b686e[_0x82b2('0x40')]=qs['limit'](_0x12acd0['query'][_0x82b2('0x40')]);_0x2b686e[_0x82b2('0x29')]=qs['offset'](_0x12acd0['query'][_0x82b2('0x29')]);}_0x2b686e[_0x82b2('0x41')]=qs['sort'](_0x12acd0[_0x82b2('0x3a')]['sort']);_0x2b686e[_0x82b2('0x42')]=qs[_0x82b2('0x43')](_[_0x82b2('0x44')](_0x12acd0[_0x82b2('0x3a')],_0x1b7eb0[_0x82b2('0x43')]));if(_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x45')]){_0x2b686e['where']=_[_0x82b2('0x46')](_0x2b686e['where'],{'$or':_[_0x82b2('0x47')](_0xbcab86,function(_0x5407ea){if(_0x5407ea[_0x82b2('0x48')][_0x82b2('0x49')]!==_0x82b2('0x4a')){var _0x15da8d={};_0x15da8d[_0x5407ea[_0x82b2('0x4b')]]={'$like':'%'+_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x45')]+'%'};return _0x15da8d;}})});}_0x2b686e=_['merge']({},_0x2b686e,_0x12acd0[_0x82b2('0x4c')]);var _0x22bc06={'where':_0x2b686e[_0x82b2('0x42')]};return db[_0x82b2('0x4d')][_0x82b2('0x28')](_0x22bc06)[_0x82b2('0x1d')](function(_0x5883f8){_0x2bac49[_0x82b2('0x28')]=_0x5883f8;if(_0x12acd0[_0x82b2('0x3a')]['includeAll']){_0x2b686e['include']=[{'all':!![]}];}return db[_0x82b2('0x4d')][_0x82b2('0x4e')](_0x2b686e);})[_0x82b2('0x1d')](function(_0x3e6fe2){_0x2bac49[_0x82b2('0x4f')]=_0x3e6fe2;return _0x2bac49;})[_0x82b2('0x1d')](respondWithFilteredResult(_0x54e6c6,_0x2b686e))[_0x82b2('0x50')](handleError(_0x54e6c6,null));};exports[_0x82b2('0x51')]=function(_0x2d07be,_0x2d4a95){var _0x1d2ef1={'raw':![],'where':{'id':_0x2d07be[_0x82b2('0x52')]['id']}},_0x14ace2={};_0x14ace2[_0x82b2('0x38')]=_[_0x82b2('0x39')](db['Trunk']['rawAttributes']);_0x14ace2[_0x82b2('0x3a')]=_[_0x82b2('0x39')](_0x2d07be[_0x82b2('0x3a')]);_0x14ace2[_0x82b2('0x43')]=_['intersection'](_0x14ace2[_0x82b2('0x38')],_0x14ace2[_0x82b2('0x3a')]);_0x1d2ef1[_0x82b2('0x3d')]=_[_0x82b2('0x3b')](_0x14ace2[_0x82b2('0x38')],qs['fields'](_0x2d07be[_0x82b2('0x3a')][_0x82b2('0x3c')]));_0x1d2ef1[_0x82b2('0x3d')]=_0x1d2ef1['attributes']['length']?_0x1d2ef1[_0x82b2('0x3d')]:_0x14ace2[_0x82b2('0x38')];if(_0x2d07be[_0x82b2('0x3a')][_0x82b2('0x53')]){_0x1d2ef1[_0x82b2('0x54')]=[{'all':!![]}];}_0x1d2ef1=_[_0x82b2('0x46')]({},_0x1d2ef1,_0x2d07be['options']);return db[_0x82b2('0x4d')][_0x82b2('0x55')](_0x1d2ef1)[_0x82b2('0x1d')](handleEntityNotFound(_0x2d4a95,null))[_0x82b2('0x1d')](respondWithResult(_0x2d4a95,null))[_0x82b2('0x50')](handleError(_0x2d4a95,null));};exports[_0x82b2('0x56')]=function(_0x505faa,_0xe79328){var _0x46940b={'raw':![],'where':{'id':_0x505faa['params']['id']}},_0xec35df={};_0xec35df[_0x82b2('0x38')]=_[_0x82b2('0x39')](db[_0x82b2('0x4d')]['rawAttributes']);_0x46940b[_0x82b2('0x3d')]=_[_0x82b2('0x3b')](_0xec35df[_0x82b2('0x38')],qs[_0x82b2('0x3c')](_0x505faa[_0x82b2('0x3a')][_0x82b2('0x3c')]));_0x46940b[_0x82b2('0x3d')]=_0x46940b[_0x82b2('0x3d')][_0x82b2('0x57')]?_0x46940b[_0x82b2('0x3d')]:_0xec35df[_0x82b2('0x38')];if(_0x505faa[_0x82b2('0x3a')][_0x82b2('0x53')]){_0x46940b[_0x82b2('0x54')]=[{'all':!![]}];}_0x46940b=_[_0x82b2('0x46')]({},_0x46940b,_0x505faa[_0x82b2('0x4c')]);return db[_0x82b2('0x4d')][_0x82b2('0x55')](_0x46940b)['then'](handleEntityNotFound(_0xe79328,null))[_0x82b2('0x1d')](function(_0x1b4650){if(_0x1b4650){var _0x2aee14=_0x1b4650[_0x82b2('0x31')]({'plain':!![]});_0x2aee14=qs['omit'](_0x2aee14,['id',_0x82b2('0x58'),'updatedAt']);_0x505faa['body']=_[_0x82b2('0x59')](_0x505faa[_0x82b2('0x5a')],['id','createdAt','updatedAt']);return db['Trunk']['create'](_[_0x82b2('0x46')](_0x2aee14,_0x505faa[_0x82b2('0x5a')]),{'include':_0x505faa[_0x82b2('0x3a')][_0x82b2('0x53')]?[{'all':!![]}]:undefined})[_0x82b2('0x1d')](function(_0x471f83){var _0x410c96=_0x505faa[_0x82b2('0x5b')]['get']({'plain':!![]});if(!_0x410c96)throw new Error(_0x82b2('0x5c'));if(_0x410c96[_0x82b2('0x5d')]===_0x82b2('0x5b')){var _0x3530c3=_0x471f83[_0x82b2('0x31')]({'plain':!![]});var _0x38ed7c=_0x82b2('0x5e');return db[_0x82b2('0x5f')][_0x82b2('0x55')]({'where':{'name':_0x38ed7c,'userProfileId':_0x410c96[_0x82b2('0x60')]},'raw':!![]})[_0x82b2('0x1d')](function(_0x597bec){if(_0x597bec&&_0x597bec[_0x82b2('0x61')]===0x0){return db['UserProfileResource'][_0x82b2('0x62')]({'name':_0x3530c3[_0x82b2('0x35')],'resourceId':_0x3530c3['id'],'type':_0x597bec['name'],'sectionId':_0x597bec['id']},{})['then'](function(){return _0x471f83;});}else{return _0x471f83;}})['catch'](function(_0x3ad9c0){logger[_0x82b2('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ad9c0);throw _0x3ad9c0;});}return _0x471f83;});}})[_0x82b2('0x1d')](respondWithResult(_0xe79328,0xc9))[_0x82b2('0x50')](handleError(_0xe79328,null));};exports[_0x82b2('0x62')]=function(_0x16efc6,_0x50b964,_0x3b794d){var _0x21f65b;return db[_0x82b2('0x4d')][_0x82b2('0x62')](_0x16efc6['body'],{'raw':!![]})[_0x82b2('0x1d')](function(_0x15279a){_0x21f65b=_0x15279a;return db['Trunk'][_0x82b2('0x4e')]({'raw':!![]});})['then'](function(_0x55be60){var _0x358dfd=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],'server/files/templates/trunk.ejs'),_0x82b2('0x66'));var _0x3c97b0=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],_0x82b2('0x67')),_0x82b2('0x66'));var _0x4478cd=ejs[_0x82b2('0x68')](_0x358dfd,{'trunks':_0x55be60||[]});fs[_0x82b2('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4478cd);if(_0x21f65b[_0x82b2('0x6a')]){var _0x56b041=ejs[_0x82b2('0x68')](_0x3c97b0,{'trunks':_0x55be60||[]});fs[_0x82b2('0x69')](_0x82b2('0x6b'),_0x56b041);}})['then'](function(){return respondWithRpcPromise(_0x82b2('0x6c'),_0x82b2('0x62'),{'module':_0x82b2('0x6d')});})[_0x82b2('0x1d')](function(){var _0x5b4815=_0x16efc6['user'][_0x82b2('0x31')]({'plain':!![]});if(!_0x5b4815)throw new Error(_0x82b2('0x5c'));if(_0x5b4815[_0x82b2('0x5d')]==='user'){var _0x3f315d=_0x21f65b[_0x82b2('0x31')]({'plain':!![]});return db[_0x82b2('0x5f')]['find']({'where':{'name':_0x82b2('0x5e'),'userProfileId':_0x5b4815[_0x82b2('0x60')]},'raw':!![]})['then'](function(_0x21f9c6){if(_0x21f9c6&&_0x21f9c6[_0x82b2('0x61')]===0x0){return db[_0x82b2('0x32')]['create']({'name':_0x3f315d['name'],'resourceId':_0x3f315d['id'],'type':_0x21f9c6[_0x82b2('0x35')],'sectionId':_0x21f9c6['id']},{})[_0x82b2('0x1d')](function(){return _0x21f65b;});}else{return _0x21f65b;}})[_0x82b2('0x50')](function(_0xb751e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb751e7);throw _0xb751e7;});}return _0x21f65b;})[_0x82b2('0x1d')](respondWithResult(_0x50b964,0xc9))[_0x82b2('0x50')](handleError(_0x50b964,null));};exports[_0x82b2('0x6e')]=function(_0x3e0ff2,_0x43cc15,_0x3f344b){var _0x472b1b;return db[_0x82b2('0x4d')][_0x82b2('0x55')]({'where':{'id':_0x3e0ff2[_0x82b2('0x52')]['id']}})[_0x82b2('0x1d')](handleEntityNotFound(_0x43cc15,null))['then'](saveUpdates(_0x3e0ff2[_0x82b2('0x5a')],null))['then'](function(_0x458068){if(_0x458068){_0x472b1b=_0x458068;return db[_0x82b2('0x4d')]['findAll']({'raw':!![]});}})[_0x82b2('0x1d')](function(_0xa00187){if(_0xa00187){var _0x2b7b12=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config['root'],_0x82b2('0x6f')),_0x82b2('0x66'));var _0x511c6a=fs['readFileSync'](path[_0x82b2('0x64')](config[_0x82b2('0x65')],_0x82b2('0x67')),'utf8');var _0x30db07=ejs['render'](_0x2b7b12,{'trunks':_0xa00187||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x30db07);var _0x1f3bf1=ejs[_0x82b2('0x68')](_0x511c6a,{'trunks':_0xa00187||[]});fs['writeFileSync'](_0x82b2('0x6b'),_0x1f3bf1);return respondWithRpcPromise(_0x82b2('0x6c'),'update',{'module':_0x82b2('0x6d')});}return null;})[_0x82b2('0x1d')](function(_0x3e31d8){if(_0x3e31d8){return _0x472b1b;}})['then'](respondWithResult(_0x43cc15,null))['catch'](handleError(_0x43cc15,null));};exports[_0x82b2('0x30')]=function(_0x2e6f19,_0x41c711,_0x43738c){var _0x41aeae;return db[_0x82b2('0x4d')][_0x82b2('0x55')]({'where':{'id':_0x2e6f19[_0x82b2('0x52')]['id']}})[_0x82b2('0x1d')](handleEntityNotFound(_0x41c711,null))[_0x82b2('0x1d')](removeEntity(_0x41c711,null))[_0x82b2('0x1d')](function(){return db[_0x82b2('0x4d')][_0x82b2('0x4e')]({'raw':!![]});})[_0x82b2('0x1d')](function(_0x1e242b){var _0x3aae8c=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],'server/files/templates/trunk.ejs'),_0x82b2('0x66'));var _0x5c1711=fs[_0x82b2('0x63')](path['join'](config[_0x82b2('0x65')],_0x82b2('0x67')),_0x82b2('0x66'));var _0x397b09=ejs[_0x82b2('0x68')](_0x3aae8c,{'trunks':_0x1e242b});var _0x56d4cf=ejs['render'](_0x5c1711,{'trunks':_0x1e242b});fs[_0x82b2('0x69')](_0x82b2('0x70'),_0x397b09);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x56d4cf);return respondWithRpcPromise(_0x82b2('0x6c'),_0x82b2('0x30'),{'module':_0x82b2('0x6d')});})[_0x82b2('0x50')](handleError(_0x41c711,null));}; \ No newline at end of file +var _0xef7b=['find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','chan_sip.so','userProfileId','utf8','readFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Trunks','stack','name','send','Trunk','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','include','rows','catch','params','rawAttributes'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0xef7b,0x87));var _0xbef7=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0xef7b[_0x30cc1a];return _0xb3f18f;};'use strict';var pdf=require(_0xbef7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbef7('0x1'));var zipdir=require(_0xbef7('0x2'));var jsonpatch=require(_0xbef7('0x3'));var rp=require(_0xbef7('0x4'));var moment=require(_0xbef7('0x5'));var BPromise=require(_0xbef7('0x6'));var Mustache=require(_0xbef7('0x7'));var util=require('util');var path=require(_0xbef7('0x8'));var sox=require('sox');var csv=require(_0xbef7('0x9'));var ejs=require(_0xbef7('0xa'));var fs=require('fs');var _=require(_0xbef7('0xb'));var squel=require(_0xbef7('0xc'));var crypto=require(_0xbef7('0xd'));var jsforce=require(_0xbef7('0xe'));var deskjs=require(_0xbef7('0xf'));var toCsv=require(_0xbef7('0x9'));var querystring=require(_0xbef7('0x10'));var Papa=require('papaparse');var Redis=require(_0xbef7('0x11'));var authService=require(_0xbef7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbef7('0x13'));var utils=require(_0xbef7('0x14'));var config=require(_0xbef7('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbef7('0x16'));var client=jayson['client'][_0xbef7('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4751af,_0x16cca8,_0x4c4a75){if(_0x4c4a75){var _0x9d7f07=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9d7f07['test'](_0x16cca8)){return _0x4751af;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4751af;}}function respondWithRpcPromise(_0x2a2b8d,_0x587af2,_0x556bf8,_0x1b4926){return new BPromise(function(_0xa60e2e,_0x2cbe6e){var _0x3d3c26=_0x1b4926||client;return _0x3d3c26[_0xbef7('0x18')](_0x2a2b8d,_0x556bf8)[_0xbef7('0x19')](function(_0x544b88){logger[_0xbef7('0x1a')]('Trunk,\x20%s,\x20%s',_0x587af2,_0xbef7('0x1b'));logger[_0xbef7('0x1c')](_0xbef7('0x1d'),_0x587af2,_0xbef7('0x1b'),JSON['stringify'](_0x544b88));if(_0x544b88[_0xbef7('0x1e')]){if(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x1f')]===0x1f4){logger[_0xbef7('0x1e')](_0xbef7('0x20'),_0x587af2,_0x544b88['error'][_0xbef7('0x21')]);return _0x2cbe6e(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);}logger['error'](_0xbef7('0x20'),_0x587af2,_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);return _0xa60e2e(_0x544b88[_0xbef7('0x1e')][_0xbef7('0x21')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x587af2,_0xbef7('0x1b'));_0xa60e2e(_0x544b88[_0xbef7('0x22')][_0xbef7('0x21')]);}})['catch'](function(_0x233020){logger[_0xbef7('0x1e')]('Trunk,\x20%s,\x20%s',_0x587af2,_0x233020);_0x2cbe6e(_0x233020);});});}function respondWithStatusCode(_0x4ca6d9,_0x2b837f){_0x2b837f=_0x2b837f||0xcc;return function(_0xc95ec6){if(_0xc95ec6){return _0x4ca6d9[_0xbef7('0x23')](_0x2b837f);}return _0x4ca6d9[_0xbef7('0x24')](_0x2b837f)[_0xbef7('0x25')]();};}function respondWithResult(_0x33918d,_0x4be6e4){_0x4be6e4=_0x4be6e4||0xc8;return function(_0xfcb9f2){if(_0xfcb9f2){return _0x33918d[_0xbef7('0x24')](_0x4be6e4)[_0xbef7('0x26')](_0xfcb9f2);}};}function respondWithFilteredResult(_0x37a821,_0x5ef8d2){return function(_0xd3f9a9){if(_0xd3f9a9){var _0x3ba3f8=_0xd3f9a9[_0xbef7('0x27')],_0xa63c84=_0x5ef8d2[_0xbef7('0x28')],_0x2e8f72=_0x5ef8d2[_0xbef7('0x28')]+_0x5ef8d2[_0xbef7('0x29')],_0x50466f;if(_0x2e8f72>=_0x3ba3f8){_0x2e8f72=_0x3ba3f8;_0x50466f=0xc8;}else{_0x50466f=0xce;}_0x37a821[_0xbef7('0x24')](_0x50466f);return _0x37a821[_0xbef7('0x2a')](_0xbef7('0x2b'),_0xa63c84+'-'+_0x2e8f72+'/'+_0x3ba3f8)[_0xbef7('0x26')](_0xd3f9a9);}return null;};}function patchUpdates(_0x259c78){return function(_0x1ec98d){try{jsonpatch[_0xbef7('0x2c')](_0x1ec98d,_0x259c78,!![]);}catch(_0x751860){return BPromise[_0xbef7('0x2d')](_0x751860);}return _0x1ec98d[_0xbef7('0x2e')]();};}function saveUpdates(_0x27c1db,_0x4454be){return function(_0x290a66){if(_0x290a66){return _0x290a66[_0xbef7('0x2f')](_0x27c1db)[_0xbef7('0x19')](function(_0x60d852){return _0x60d852;});}return null;};}function removeEntity(_0x2d6cc1,_0x37e6c7){return function(_0x5cde96){if(_0x5cde96){return _0x5cde96[_0xbef7('0x30')]()['then'](function(){var _0x21ad3c=_0x5cde96[_0xbef7('0x31')]({'plain':!![]});var _0x53237c=_0xbef7('0x32');return db['UserProfileResource'][_0xbef7('0x30')]({'where':{'type':_0x53237c,'resourceId':_0x21ad3c['id']}})[_0xbef7('0x19')](function(){return _0x5cde96;});})['then'](function(){_0x2d6cc1[_0xbef7('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446270,_0xb04d6a){return function(_0x52d955){if(!_0x52d955){_0x446270[_0xbef7('0x23')](0x194);}return _0x52d955;};}function handleError(_0xb4c0e4,_0x4d9d30){_0x4d9d30=_0x4d9d30||0x1f4;return function(_0x8ab067){logger[_0xbef7('0x1e')](_0x8ab067[_0xbef7('0x33')]);if(_0x8ab067[_0xbef7('0x34')]){delete _0x8ab067['name'];}_0xb4c0e4[_0xbef7('0x24')](_0x4d9d30)[_0xbef7('0x35')](_0x8ab067);};}exports['index']=function(_0x15de0f,_0x3b0f7d){var _0xc856e3={},_0x59ce7a={},_0x212e58={'count':0x0,'rows':[]};var _0x280f92=db[_0xbef7('0x36')]['rawAttributes'];_0x59ce7a[_0xbef7('0x37')]=_[_0xbef7('0x38')](_0x280f92);_0x59ce7a[_0xbef7('0x39')]=_[_0xbef7('0x38')](_0x15de0f[_0xbef7('0x39')]);_0x59ce7a[_0xbef7('0x3a')]=_[_0xbef7('0x3b')](_0x59ce7a[_0xbef7('0x37')],_0x59ce7a[_0xbef7('0x39')]);_0xc856e3['attributes']=_[_0xbef7('0x3b')](_0x59ce7a[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x15de0f['query'][_0xbef7('0x3c')]));_0xc856e3[_0xbef7('0x3d')]=_0xc856e3[_0xbef7('0x3d')][_0xbef7('0x3e')]?_0xc856e3[_0xbef7('0x3d')]:_0x59ce7a['model'];if(!_0x15de0f['query'][_0xbef7('0x3f')](_0xbef7('0x40'))){_0xc856e3[_0xbef7('0x29')]=qs['limit'](_0x15de0f['query']['limit']);_0xc856e3[_0xbef7('0x28')]=qs[_0xbef7('0x28')](_0x15de0f['query'][_0xbef7('0x28')]);}_0xc856e3[_0xbef7('0x41')]=qs[_0xbef7('0x42')](_0x15de0f[_0xbef7('0x39')][_0xbef7('0x42')]);_0xc856e3[_0xbef7('0x43')]=qs[_0xbef7('0x3a')](_[_0xbef7('0x44')](_0x15de0f[_0xbef7('0x39')],_0x59ce7a[_0xbef7('0x3a')]));if(_0x15de0f[_0xbef7('0x39')][_0xbef7('0x45')]){_0xc856e3[_0xbef7('0x43')]=_[_0xbef7('0x46')](_0xc856e3[_0xbef7('0x43')],{'$or':_[_0xbef7('0x47')](_0x280f92,function(_0x1544d5){if(_0x1544d5['type']['key']!==_0xbef7('0x48')){var _0x44232b={};_0x44232b[_0x1544d5[_0xbef7('0x49')]]={'$like':'%'+_0x15de0f['query'][_0xbef7('0x45')]+'%'};return _0x44232b;}})});}_0xc856e3=_[_0xbef7('0x46')]({},_0xc856e3,_0x15de0f[_0xbef7('0x4a')]);var _0x140f21={'where':_0xc856e3[_0xbef7('0x43')]};return db[_0xbef7('0x36')][_0xbef7('0x27')](_0x140f21)[_0xbef7('0x19')](function(_0x351e65){_0x212e58[_0xbef7('0x27')]=_0x351e65;if(_0x15de0f[_0xbef7('0x39')][_0xbef7('0x4b')]){_0xc856e3[_0xbef7('0x4c')]=[{'all':!![]}];}return db[_0xbef7('0x36')]['findAll'](_0xc856e3);})[_0xbef7('0x19')](function(_0x58cce2){_0x212e58[_0xbef7('0x4d')]=_0x58cce2;return _0x212e58;})[_0xbef7('0x19')](respondWithFilteredResult(_0x3b0f7d,_0xc856e3))[_0xbef7('0x4e')](handleError(_0x3b0f7d,null));};exports['show']=function(_0x59bcd5,_0x5dc6ce){var _0x3f0c6d={'raw':![],'where':{'id':_0x59bcd5[_0xbef7('0x4f')]['id']}},_0x3f51f4={};_0x3f51f4[_0xbef7('0x37')]=_[_0xbef7('0x38')](db[_0xbef7('0x36')][_0xbef7('0x50')]);_0x3f51f4[_0xbef7('0x39')]=_['keys'](_0x59bcd5[_0xbef7('0x39')]);_0x3f51f4['filters']=_[_0xbef7('0x3b')](_0x3f51f4[_0xbef7('0x37')],_0x3f51f4[_0xbef7('0x39')]);_0x3f0c6d[_0xbef7('0x3d')]=_[_0xbef7('0x3b')](_0x3f51f4[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x59bcd5[_0xbef7('0x39')][_0xbef7('0x3c')]));_0x3f0c6d[_0xbef7('0x3d')]=_0x3f0c6d['attributes'][_0xbef7('0x3e')]?_0x3f0c6d[_0xbef7('0x3d')]:_0x3f51f4['model'];if(_0x59bcd5[_0xbef7('0x39')]['includeAll']){_0x3f0c6d['include']=[{'all':!![]}];}_0x3f0c6d=_[_0xbef7('0x46')]({},_0x3f0c6d,_0x59bcd5[_0xbef7('0x4a')]);return db[_0xbef7('0x36')][_0xbef7('0x51')](_0x3f0c6d)[_0xbef7('0x19')](handleEntityNotFound(_0x5dc6ce,null))['then'](respondWithResult(_0x5dc6ce,null))[_0xbef7('0x4e')](handleError(_0x5dc6ce,null));};exports['clone']=function(_0x3e0c03,_0x2f1a59){var _0x55971e={'raw':![],'where':{'id':_0x3e0c03['params']['id']}},_0xe2431={};_0xe2431[_0xbef7('0x37')]=_['keys'](db['Trunk'][_0xbef7('0x50')]);_0x55971e[_0xbef7('0x3d')]=_[_0xbef7('0x3b')](_0xe2431[_0xbef7('0x37')],qs[_0xbef7('0x3c')](_0x3e0c03[_0xbef7('0x39')][_0xbef7('0x3c')]));_0x55971e['attributes']=_0x55971e[_0xbef7('0x3d')]['length']?_0x55971e['attributes']:_0xe2431['model'];if(_0x3e0c03['query'][_0xbef7('0x4b')]){_0x55971e[_0xbef7('0x4c')]=[{'all':!![]}];}_0x55971e=_['merge']({},_0x55971e,_0x3e0c03[_0xbef7('0x4a')]);return db[_0xbef7('0x36')]['find'](_0x55971e)[_0xbef7('0x19')](handleEntityNotFound(_0x2f1a59,null))[_0xbef7('0x19')](function(_0xc01a6b){if(_0xc01a6b){var _0x170ef0=_0xc01a6b['get']({'plain':!![]});_0x170ef0=qs['omit'](_0x170ef0,['id',_0xbef7('0x52'),_0xbef7('0x53')]);_0x3e0c03[_0xbef7('0x54')]=_[_0xbef7('0x55')](_0x3e0c03[_0xbef7('0x54')],['id','createdAt','updatedAt']);return db['Trunk'][_0xbef7('0x56')](_[_0xbef7('0x46')](_0x170ef0,_0x3e0c03[_0xbef7('0x54')]),{'include':_0x3e0c03[_0xbef7('0x39')][_0xbef7('0x4b')]?[{'all':!![]}]:undefined})[_0xbef7('0x19')](function(_0x22efe4){var _0x5a6d1a=_0x3e0c03[_0xbef7('0x57')][_0xbef7('0x31')]({'plain':!![]});if(!_0x5a6d1a)throw new Error(_0xbef7('0x58'));if(_0x5a6d1a[_0xbef7('0x59')]===_0xbef7('0x57')){var _0x41a7e9=_0x22efe4['get']({'plain':!![]});var _0xe9c9c8=_0xbef7('0x32');return db[_0xbef7('0x5a')][_0xbef7('0x51')]({'where':{'name':_0xe9c9c8,'userProfileId':_0x5a6d1a['userProfileId']},'raw':!![]})[_0xbef7('0x19')](function(_0x366ef1){if(_0x366ef1&&_0x366ef1[_0xbef7('0x5b')]===0x0){return db[_0xbef7('0x5c')][_0xbef7('0x56')]({'name':_0x41a7e9['name'],'resourceId':_0x41a7e9['id'],'type':_0x366ef1['name'],'sectionId':_0x366ef1['id']},{})[_0xbef7('0x19')](function(){return _0x22efe4;});}else{return _0x22efe4;}})[_0xbef7('0x4e')](function(_0x25007f){logger[_0xbef7('0x1e')](_0xbef7('0x5d'),_0x25007f);throw _0x25007f;});}return _0x22efe4;});}})[_0xbef7('0x19')](respondWithResult(_0x2f1a59,0xc9))['catch'](handleError(_0x2f1a59,null));};exports['create']=function(_0x551526,_0x32fdf9,_0xfe4a93){var _0x3b8b30;return db[_0xbef7('0x36')][_0xbef7('0x56')](_0x551526[_0xbef7('0x54')],{'raw':!![]})['then'](function(_0x5b8f75){_0x3b8b30=_0x5b8f75;return db[_0xbef7('0x36')]['findAll']({'raw':!![]});})[_0xbef7('0x19')](function(_0x54a2e3){var _0x530022=fs['readFileSync'](path['join'](config[_0xbef7('0x5e')],_0xbef7('0x5f')),'utf8');var _0x56a9ae=fs['readFileSync'](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),'utf8');var _0x1ed990=ejs[_0xbef7('0x62')](_0x530022,{'trunks':_0x54a2e3||[]});fs['writeFileSync'](_0xbef7('0x63'),_0x1ed990);if(_0x3b8b30[_0xbef7('0x64')]){var _0x2ec195=ejs[_0xbef7('0x62')](_0x56a9ae,{'trunks':_0x54a2e3||[]});fs[_0xbef7('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x2ec195);}})[_0xbef7('0x19')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xbef7('0x66')});})[_0xbef7('0x19')](function(){var _0x16c2cf=_0x551526[_0xbef7('0x57')][_0xbef7('0x31')]({'plain':!![]});if(!_0x16c2cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16c2cf['role']===_0xbef7('0x57')){var _0xefae11=_0x3b8b30[_0xbef7('0x31')]({'plain':!![]});return db[_0xbef7('0x5a')]['find']({'where':{'name':_0xbef7('0x32'),'userProfileId':_0x16c2cf[_0xbef7('0x67')]},'raw':!![]})[_0xbef7('0x19')](function(_0x14160){if(_0x14160&&_0x14160['autoAssociation']===0x0){return db[_0xbef7('0x5c')][_0xbef7('0x56')]({'name':_0xefae11['name'],'resourceId':_0xefae11['id'],'type':_0x14160['name'],'sectionId':_0x14160['id']},{})['then'](function(){return _0x3b8b30;});}else{return _0x3b8b30;}})['catch'](function(_0x2a23c7){logger[_0xbef7('0x1e')](_0xbef7('0x5d'),_0x2a23c7);throw _0x2a23c7;});}return _0x3b8b30;})[_0xbef7('0x19')](respondWithResult(_0x32fdf9,0xc9))[_0xbef7('0x4e')](handleError(_0x32fdf9,null));};exports[_0xbef7('0x2f')]=function(_0x4701cd,_0x3011f6,_0x390959){var _0x53d6df;return db[_0xbef7('0x36')][_0xbef7('0x51')]({'where':{'id':_0x4701cd[_0xbef7('0x4f')]['id']}})[_0xbef7('0x19')](handleEntityNotFound(_0x3011f6,null))[_0xbef7('0x19')](saveUpdates(_0x4701cd['body'],null))[_0xbef7('0x19')](function(_0x18122c){if(_0x18122c){_0x53d6df=_0x18122c;return db[_0xbef7('0x36')]['findAll']({'raw':!![]});}})[_0xbef7('0x19')](function(_0x53eb79){if(_0x53eb79){var _0x1060a6=fs['readFileSync'](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x5f')),_0xbef7('0x68'));var _0x3147=fs[_0xbef7('0x69')](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),_0xbef7('0x68'));var _0x131c0b=ejs['render'](_0x1060a6,{'trunks':_0x53eb79||[]});fs[_0xbef7('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x131c0b);var _0x3a9a1e=ejs[_0xbef7('0x62')](_0x3147,{'trunks':_0x53eb79||[]});fs['writeFileSync'](_0xbef7('0x6a'),_0x3a9a1e);return respondWithRpcPromise(_0xbef7('0x6b'),'update',{'module':_0xbef7('0x66')});}return null;})['then'](function(_0x2e2b62){if(_0x2e2b62){return _0x53d6df;}})[_0xbef7('0x19')](respondWithResult(_0x3011f6,null))[_0xbef7('0x4e')](handleError(_0x3011f6,null));};exports[_0xbef7('0x30')]=function(_0x15e245,_0x57a7a8,_0x4bdbc1){var _0x3f4ebd;return db[_0xbef7('0x36')][_0xbef7('0x51')]({'where':{'id':_0x15e245[_0xbef7('0x4f')]['id']}})[_0xbef7('0x19')](handleEntityNotFound(_0x57a7a8,null))['then'](removeEntity(_0x57a7a8,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x115c43){var _0x3ec116=fs[_0xbef7('0x69')](path['join'](config['root'],_0xbef7('0x5f')),_0xbef7('0x68'));var _0x395299=fs[_0xbef7('0x69')](path[_0xbef7('0x60')](config[_0xbef7('0x5e')],_0xbef7('0x61')),_0xbef7('0x68'));var _0x30a3fa=ejs[_0xbef7('0x62')](_0x3ec116,{'trunks':_0x115c43});var _0x54653b=ejs[_0xbef7('0x62')](_0x395299,{'trunks':_0x115c43});fs['writeFileSync'](_0xbef7('0x63'),_0x30a3fa);fs[_0xbef7('0x65')](_0xbef7('0x6a'),_0x54653b);return respondWithRpcPromise(_0xbef7('0x6b'),'destroy',{'module':_0xbef7('0x66')});})[_0xbef7('0x4e')](handleError(_0x57a7a8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index e5bb9be..925f4d9 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 _0x7d86=['exports','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes'];(function(_0x145d77,_0x43130d){var _0x4bdb7e=function(_0x2f2540){while(--_0x2f2540){_0x145d77['push'](_0x145d77['shift']());}};_0x4bdb7e(++_0x43130d);}(_0x7d86,0x86));var _0x67d8=function(_0x4e8665,_0x13738f){_0x4e8665=_0x4e8665-0x0;var _0x1dd146=_0x7d86[_0x4e8665];return _0x1dd146;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var logger=require(_0x67d8('0x1'))(_0x67d8('0x2'));var moment=require(_0x67d8('0x3'));var BPromise=require(_0x67d8('0x4'));var rp=require(_0x67d8('0x5'));var fs=require('fs');var path=require(_0x67d8('0x6'));var rimraf=require(_0x67d8('0x7'));var config=require('../../config/environment');var attributes=require(_0x67d8('0x8'));module[_0x67d8('0x9')]=function(_0x8dd593,_0x2bc414){return _0x8dd593[_0x67d8('0xa')](_0x67d8('0xb'),attributes,{'tableName':_0x67d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3248=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks'];(function(_0x161ce3,_0x4f0c0e){var _0x3e53b9=function(_0x3c1efe){while(--_0x3c1efe){_0x161ce3['push'](_0x161ce3['shift']());}};_0x3e53b9(++_0x4f0c0e);}(_0x3248,0x1b0));var _0x8324=function(_0x3f82a4,_0x52276e){_0x3f82a4=_0x3f82a4-0x0;var _0x20886e=_0x3248[_0x3f82a4];return _0x20886e;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var logger=require(_0x8324('0x2'))(_0x8324('0x3'));var moment=require(_0x8324('0x4'));var BPromise=require(_0x8324('0x5'));var rp=require(_0x8324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8324('0x7'));var attributes=require(_0x8324('0x8'));module['exports']=function(_0x18edd2,_0x283f5f){return _0x18edd2[_0x8324('0x9')](_0x8324('0xa'),attributes,{'tableName':_0x8324('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index df74dbd..d572430 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 _0x6080=['stringify','error','message','catch','GetTrunk','findAll','options','where','map','include','model','attributes','debug','ShowTrunk','Trunk','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x52b52b,_0x3cf1d1){var _0x4c5141=function(_0x3f2f12){while(--_0x3f2f12){_0x52b52b['push'](_0x52b52b['shift']());}};_0x4c5141(++_0x3cf1d1);}(_0x6080,0x1a8));var _0x0608=function(_0x3b576a,_0x3263f9){_0x3b576a=_0x3b576a-0x0;var _0x527de1=_0x6080[_0x3b576a];return _0x527de1;};'use strict';var _=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var moment=require(_0x0608('0x2'));var BPromise=require(_0x0608('0x3'));var rs=require(_0x0608('0x4'));var fs=require('fs');var Redis=require(_0x0608('0x5'));var db=require(_0x0608('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0608('0x7'))(_0x0608('0x8'));var config=require('../../config/environment');var jayson=require(_0x0608('0x9'));var client=jayson[_0x0608('0xa')][_0x0608('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3a63,_0x1f0d3e,_0xcb8e3c){return new BPromise(function(_0x110f9d,_0x116b7e){return client[_0x0608('0xc')](_0x5d3a63,_0xcb8e3c)[_0x0608('0xd')](function(_0xf6cca3){logger[_0x0608('0xe')](_0x0608('0xf'),_0x1f0d3e,_0x0608('0x10'));logger['debug'](_0x0608('0x11'),_0x1f0d3e,_0x0608('0x10'),JSON[_0x0608('0x12')](_0xf6cca3));if(_0xf6cca3[_0x0608('0x13')]){if(_0xf6cca3[_0x0608('0x13')]['code']===0x1f4){logger[_0x0608('0x13')]('Trunk,\x20%s,\x20%s',_0x1f0d3e,_0xf6cca3[_0x0608('0x13')]['message']);return _0x116b7e(_0xf6cca3[_0x0608('0x13')][_0x0608('0x14')]);}logger[_0x0608('0x13')](_0x0608('0xf'),_0x1f0d3e,_0xf6cca3[_0x0608('0x13')]['message']);return _0x110f9d(_0xf6cca3[_0x0608('0x13')][_0x0608('0x14')]);}else{logger[_0x0608('0xe')]('Trunk,\x20%s,\x20%s',_0x1f0d3e,'request\x20sent');_0x110f9d(_0xf6cca3['result'][_0x0608('0x14')]);}})[_0x0608('0x15')](function(_0x26ccfb){logger['error'](_0x0608('0xf'),_0x1f0d3e,_0x26ccfb);_0x116b7e(_0x26ccfb);});});}exports[_0x0608('0x16')]=function(_0x3a7fab){var _0xc47971=this;return new Promise(function(_0x331fdb,_0x1976ae){return db['Trunk'][_0x0608('0x17')]({'raw':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab[_0x0608('0x18')][_0x0608('0x19')]||null:null,'attributes':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab['options']['attributes']||null:null,'limit':_0x3a7fab['options']?_0x3a7fab[_0x0608('0x18')]['limit']||null:null,'include':_0x3a7fab['options']?_0x3a7fab[_0x0608('0x18')]['include']?_[_0x0608('0x1a')](_0x3a7fab[_0x0608('0x18')][_0x0608('0x1b')],function(_0x14362c){return{'model':db[_0x14362c[_0x0608('0x1c')]],'as':_0x14362c['as'],'attributes':_0x14362c[_0x0608('0x1d')],'include':_0x14362c[_0x0608('0x1b')]?_[_0x0608('0x1a')](_0x14362c['include'],function(_0x58d74f){return{'model':db[_0x58d74f[_0x0608('0x1c')]],'as':_0x58d74f['as'],'attributes':_0x58d74f[_0x0608('0x1d')],'include':_0x58d74f['include']?_[_0x0608('0x1a')](_0x58d74f[_0x0608('0x1b')],function(_0xe0ce74){return{'model':db[_0xe0ce74[_0x0608('0x1c')]],'as':_0xe0ce74['as'],'attributes':_0xe0ce74['attributes']};}):[]};}):[]};}):[]:[]})[_0x0608('0xd')](function(_0x4a4580){logger[_0x0608('0xe')](_0x0608('0x16'),_0x3a7fab);logger[_0x0608('0x1e')](_0x0608('0x16'),_0x3a7fab,JSON[_0x0608('0x12')](_0x4a4580));_0x331fdb(_0x4a4580);})[_0x0608('0x15')](function(_0x358458){logger[_0x0608('0x13')](_0x0608('0x16'),_0x358458[_0x0608('0x14')],_0x3a7fab);_0x1976ae(_0xc47971['error'](0x1f4,_0x358458[_0x0608('0x14')]));});});};exports[_0x0608('0x1f')]=function(_0x3c3a58){var _0x47811b=this;return new Promise(function(_0x1b9a78,_0x1334c1){return db[_0x0608('0x20')]['find']({'raw':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58[_0x0608('0x18')][_0x0608('0x21')]===undefined?!![]:![]:!![],'where':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58[_0x0608('0x18')][_0x0608('0x19')]||null:null,'attributes':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58['options'][_0x0608('0x1d')]||null:null,'include':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58['options'][_0x0608('0x1b')]?_[_0x0608('0x1a')](_0x3c3a58[_0x0608('0x18')][_0x0608('0x1b')],function(_0x200c6a){return{'model':db[_0x200c6a['model']],'as':_0x200c6a['as'],'attributes':_0x200c6a['attributes'],'include':_0x200c6a['include']?_[_0x0608('0x1a')](_0x200c6a[_0x0608('0x1b')],function(_0x32a016){return{'model':db[_0x32a016[_0x0608('0x1c')]],'as':_0x32a016['as'],'attributes':_0x32a016[_0x0608('0x1d')],'include':_0x32a016['include']?_['map'](_0x32a016[_0x0608('0x1b')],function(_0x101961){return{'model':db[_0x101961[_0x0608('0x1c')]],'as':_0x101961['as'],'attributes':_0x101961[_0x0608('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0608('0xd')](function(_0xb3402f){logger[_0x0608('0xe')](_0x0608('0x1f'),_0x3c3a58);logger['debug'](_0x0608('0x1f'),_0x3c3a58,JSON['stringify'](_0xb3402f));_0x1b9a78(_0xb3402f);})[_0x0608('0x15')](function(_0x47344c){logger[_0x0608('0x13')](_0x0608('0x1f'),_0x47344c[_0x0608('0x14')],_0x3c3a58);_0x1334c1(_0x47811b[_0x0608('0x13')](0x1f4,_0x47344c['message']));});});}; \ No newline at end of file +var _0x6f0e=['options','raw','where','limit','include','map','model','attributes','then','debug','ShowTrunk','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','GetTrunk','findAll'];(function(_0x1d4987,_0x2858f9){var _0x518d4c=function(_0x550e6b){while(--_0x550e6b){_0x1d4987['push'](_0x1d4987['shift']());}};_0x518d4c(++_0x2858f9);}(_0x6f0e,0x6f));var _0xe6f0=function(_0x11fd15,_0x54f416){_0x11fd15=_0x11fd15-0x0;var _0xe2210b=_0x6f0e[_0x11fd15];return _0xe2210b;};'use strict';var _=require('lodash');var util=require(_0xe6f0('0x0'));var moment=require('moment');var BPromise=require(_0xe6f0('0x1'));var rs=require(_0xe6f0('0x2'));var fs=require('fs');var Redis=require(_0xe6f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6f0('0x4'));var logger=require(_0xe6f0('0x5'))('rpc');var config=require(_0xe6f0('0x6'));var jayson=require(_0xe6f0('0x7'));var client=jayson[_0xe6f0('0x8')][_0xe6f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d9d0d,_0xdd4e6e,_0x3c8872){return new BPromise(function(_0x238a96,_0x43e11d){return client[_0xe6f0('0xa')](_0x3d9d0d,_0x3c8872)['then'](function(_0x785b3){logger['info'](_0xe6f0('0xb'),_0xdd4e6e,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0xdd4e6e,'request\x20sent',JSON[_0xe6f0('0xc')](_0x785b3));if(_0x785b3[_0xe6f0('0xd')]){if(_0x785b3[_0xe6f0('0xd')][_0xe6f0('0xe')]===0x1f4){logger[_0xe6f0('0xd')](_0xe6f0('0xb'),_0xdd4e6e,_0x785b3[_0xe6f0('0xd')][_0xe6f0('0xf')]);return _0x43e11d(_0x785b3[_0xe6f0('0xd')]['message']);}logger[_0xe6f0('0xd')](_0xe6f0('0xb'),_0xdd4e6e,_0x785b3[_0xe6f0('0xd')]['message']);return _0x238a96(_0x785b3[_0xe6f0('0xd')]['message']);}else{logger[_0xe6f0('0x10')]('Trunk,\x20%s,\x20%s',_0xdd4e6e,_0xe6f0('0x11'));_0x238a96(_0x785b3[_0xe6f0('0x12')]['message']);}})['catch'](function(_0x2dd199){logger[_0xe6f0('0xd')]('Trunk,\x20%s,\x20%s',_0xdd4e6e,_0x2dd199);_0x43e11d(_0x2dd199);});});}exports[_0xe6f0('0x13')]=function(_0x2de4b1){var _0x2e46eb=this;return new Promise(function(_0x19ec61,_0x1add5c){return db['Trunk'][_0xe6f0('0x14')]({'raw':_0x2de4b1['options']?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x16')]===undefined?!![]:![]:!![],'where':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1['options'][_0xe6f0('0x17')]||null:null,'attributes':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1['options']['attributes']||null:null,'limit':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x18')]||null:null,'include':_0x2de4b1[_0xe6f0('0x15')]?_0x2de4b1[_0xe6f0('0x15')][_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x2de4b1['options']['include'],function(_0x489111){return{'model':db[_0x489111[_0xe6f0('0x1b')]],'as':_0x489111['as'],'attributes':_0x489111[_0xe6f0('0x1c')],'include':_0x489111[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x489111[_0xe6f0('0x19')],function(_0x4c28a6){return{'model':db[_0x4c28a6[_0xe6f0('0x1b')]],'as':_0x4c28a6['as'],'attributes':_0x4c28a6[_0xe6f0('0x1c')],'include':_0x4c28a6[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x4c28a6[_0xe6f0('0x19')],function(_0x14507c){return{'model':db[_0x14507c[_0xe6f0('0x1b')]],'as':_0x14507c['as'],'attributes':_0x14507c[_0xe6f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe6f0('0x1d')](function(_0x113099){logger['info'](_0xe6f0('0x13'),_0x2de4b1);logger[_0xe6f0('0x1e')]('GetTrunk',_0x2de4b1,JSON[_0xe6f0('0xc')](_0x113099));_0x19ec61(_0x113099);})['catch'](function(_0x282f43){logger[_0xe6f0('0xd')](_0xe6f0('0x13'),_0x282f43[_0xe6f0('0xf')],_0x2de4b1);_0x1add5c(_0x2e46eb[_0xe6f0('0xd')](0x1f4,_0x282f43[_0xe6f0('0xf')]));});});};exports['ShowTrunk']=function(_0x918a4){var _0x10db1a=this;return new Promise(function(_0x3f1c51,_0x82e9a3){return db['Trunk']['find']({'raw':_0x918a4[_0xe6f0('0x15')]?_0x918a4[_0xe6f0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x918a4['options']?_0x918a4['options'][_0xe6f0('0x17')]||null:null,'attributes':_0x918a4[_0xe6f0('0x15')]?_0x918a4['options']['attributes']||null:null,'include':_0x918a4[_0xe6f0('0x15')]?_0x918a4[_0xe6f0('0x15')][_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x918a4[_0xe6f0('0x15')][_0xe6f0('0x19')],function(_0x55a620){return{'model':db[_0x55a620[_0xe6f0('0x1b')]],'as':_0x55a620['as'],'attributes':_0x55a620['attributes'],'include':_0x55a620[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0x55a620[_0xe6f0('0x19')],function(_0xa26b10){return{'model':db[_0xa26b10[_0xe6f0('0x1b')]],'as':_0xa26b10['as'],'attributes':_0xa26b10[_0xe6f0('0x1c')],'include':_0xa26b10[_0xe6f0('0x19')]?_[_0xe6f0('0x1a')](_0xa26b10[_0xe6f0('0x19')],function(_0x502070){return{'model':db[_0x502070[_0xe6f0('0x1b')]],'as':_0x502070['as'],'attributes':_0x502070[_0xe6f0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe6f0('0x1d')](function(_0x11e749){logger[_0xe6f0('0x10')](_0xe6f0('0x1f'),_0x918a4);logger[_0xe6f0('0x1e')]('ShowTrunk',_0x918a4,JSON[_0xe6f0('0xc')](_0x11e749));_0x3f1c51(_0x11e749);})[_0xe6f0('0x20')](function(_0x54d5ef){logger['error'](_0xe6f0('0x1f'),_0x54d5ef[_0xe6f0('0xf')],_0x918a4);_0x82e9a3(_0x10db1a['error'](0x1f4,_0x54d5ef[_0xe6f0('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 571b925..75aafd2 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 _0xa73c=['getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','addQueues','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','login','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/:id','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes'];(function(_0x1275ca,_0x3bd8a0){var _0x473a9d=function(_0x5b1b56){while(--_0x5b1b56){_0x1275ca['push'](_0x1275ca['shift']());}};_0x473a9d(++_0x3bd8a0);}(_0xa73c,0x15e));var _0xca73=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa73c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xca73('0x0'));var util=require('util');var path=require(_0xca73('0x1'));var timeout=require(_0xca73('0x2'));var express=require('express');var router=express[_0xca73('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xca73('0x4'));var config=require(_0xca73('0x5'));var controller=require(_0xca73('0x6'));router[_0xca73('0x7')]('/',auth[_0xca73('0x8')](),controller['index']);router['get'](_0xca73('0x9'),auth[_0xca73('0x8')](),controller[_0xca73('0xa')]);router[_0xca73('0x7')](_0xca73('0xb'),auth[_0xca73('0x8')](),controller['show']);router[_0xca73('0x7')](_0xca73('0xc'),controller[_0xca73('0xd')]);router[_0xca73('0x7')](_0xca73('0xe'),auth[_0xca73('0x8')](),controller[_0xca73('0xf')]);router[_0xca73('0x7')](_0xca73('0x10'),auth[_0xca73('0x8')](),controller['getQueues']);router[_0xca73('0x7')]('/:id/queues_rt',auth[_0xca73('0x8')](),controller[_0xca73('0x11')]);router['get']('/:id/groups',auth[_0xca73('0x8')](),controller['getGroups']);router[_0xca73('0x7')]('/:id/recordings',auth[_0xca73('0x8')](),controller[_0xca73('0x12')]);router[_0xca73('0x7')]('/:id/screen_recordings',auth[_0xca73('0x8')](),controller[_0xca73('0x13')]);router[_0xca73('0x7')](_0xca73('0x14'),auth[_0xca73('0x8')](),controller[_0xca73('0x15')]);router[_0xca73('0x7')](_0xca73('0x16'),auth[_0xca73('0x8')](),controller[_0xca73('0x17')]);router[_0xca73('0x7')](_0xca73('0x18'),auth['isAuthenticated'](),controller[_0xca73('0x19')]);router[_0xca73('0x7')](_0xca73('0x1a'),auth[_0xca73('0x8')](),controller['getSmsInteractions']);router[_0xca73('0x7')]('/:id/fax/interactions',auth[_0xca73('0x8')](),controller['getFaxInteractions']);router[_0xca73('0x7')](_0xca73('0x1b'),auth[_0xca73('0x8')](),controller[_0xca73('0x1c')]);router['get'](_0xca73('0x1d'),auth[_0xca73('0x8')](),controller[_0xca73('0x1e')]);router[_0xca73('0x7')](_0xca73('0x1f'),auth[_0xca73('0x8')](),controller[_0xca73('0x20')]);router[_0xca73('0x7')](_0xca73('0x21'),auth[_0xca73('0x8')](),controller[_0xca73('0x22')]);router['get']('/:id/fax_accounts',auth[_0xca73('0x8')](),controller[_0xca73('0x23')]);router['get'](_0xca73('0x24'),auth[_0xca73('0x8')](),controller['getMailAccounts']);router[_0xca73('0x7')](_0xca73('0x25'),auth[_0xca73('0x8')](),controller['getOpenchannelAccounts']);router['get'](_0xca73('0x26'),auth[_0xca73('0x8')](),controller[_0xca73('0x27')]);router[_0xca73('0x7')](_0xca73('0x28'),auth['isAuthenticated'](),controller[_0xca73('0x29')]);router[_0xca73('0x7')](_0xca73('0x2a'),auth[_0xca73('0x8')](),controller['getSquareProjects']);router['get'](_0xca73('0x2b'),auth[_0xca73('0x8')](),controller[_0xca73('0x2c')]);router[_0xca73('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0xca73('0x2d')](_0xca73('0x2e'),auth[_0xca73('0x8')](),controller['bulkCreate']);router['post'](_0xca73('0xe'),auth[_0xca73('0x8')](),controller['addContacts']);router[_0xca73('0x2d')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca73('0x2d')]('/:id/queues',auth['isAuthenticated'](),controller[_0xca73('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a7ff1,_0x2228e6,_0x4a4339){_0x4a4339(null,path[_0xca73('0x30')](config[_0xca73('0x31')],_0xca73('0x32')));},'filename':function(_0x1ba463,_0x958577,_0x3b42f3){_0x3b42f3(null,util[_0xca73('0x33')](_0xca73('0x34'),Date[_0xca73('0x35')](),_0x958577['originalname']));}})});router[_0xca73('0x2d')](_0xca73('0xc'),upload[_0xca73('0x36')](_0xca73('0x37')),controller[_0xca73('0x38')]);router[_0xca73('0x2d')]('/:id/login',auth[_0xca73('0x8')](),controller[_0xca73('0x39')]);router[_0xca73('0x2d')]('/:id/logout',auth[_0xca73('0x8')](),controller['logout']);router[_0xca73('0x2d')]('/:id/pause',auth[_0xca73('0x8')](),controller['pause']);router['post'](_0xca73('0x3a'),auth[_0xca73('0x8')](),controller['unpause']);router[_0xca73('0x2d')](_0xca73('0x1b'),auth[_0xca73('0x8')](),controller[_0xca73('0x3b')]);router[_0xca73('0x2d')](_0xca73('0x3c'),auth[_0xca73('0x8')](),controller[_0xca73('0x3d')]);router[_0xca73('0x2d')](_0xca73('0x3e'),auth[_0xca73('0x8')](),controller[_0xca73('0x3f')]);router[_0xca73('0x2d')](_0xca73('0x40'),auth[_0xca73('0x8')](),controller[_0xca73('0x41')]);router[_0xca73('0x2d')](_0xca73('0x42'),auth[_0xca73('0x8')](),controller['addSmsInteractions']);router[_0xca73('0x2d')](_0xca73('0x43'),auth[_0xca73('0x8')](),controller[_0xca73('0x44')]);router[_0xca73('0x2d')](_0xca73('0x45'),auth[_0xca73('0x8')](),controller[_0xca73('0x46')]);router[_0xca73('0x2d')](_0xca73('0x24'),auth[_0xca73('0x8')](),controller[_0xca73('0x47')]);router[_0xca73('0x2d')]('/:id/openchannel_accounts',auth[_0xca73('0x8')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xca73('0x48')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xca73('0x49')]);router['post'](_0xca73('0x2a'),auth['isAuthenticated'](),controller[_0xca73('0x4a')]);router[_0xca73('0x2d')](_0xca73('0x4b'),auth[_0xca73('0x8')](),controller[_0xca73('0x4c')]);router[_0xca73('0x4d')]('/:id',auth[_0xca73('0x8')](),controller[_0xca73('0x4e')]);router[_0xca73('0x4d')](_0xca73('0x4f'),auth[_0xca73('0x8')](),controller[_0xca73('0x50')]);router[_0xca73('0x51')](_0xca73('0x10'),auth[_0xca73('0x8')](),controller[_0xca73('0x52')]);router['delete'](_0xca73('0x1b'),auth['isAuthenticated'](),controller[_0xca73('0x53')]);router[_0xca73('0x51')](_0xca73('0xb'),auth[_0xca73('0x8')](),controller[_0xca73('0x54')]);router[_0xca73('0x51')](_0xca73('0x3c'),auth[_0xca73('0x8')](),controller[_0xca73('0x55')]);router[_0xca73('0x51')](_0xca73('0x3e'),auth[_0xca73('0x8')](),controller[_0xca73('0x56')]);router[_0xca73('0x51')](_0xca73('0x40'),auth[_0xca73('0x8')](),controller[_0xca73('0x57')]);router[_0xca73('0x51')](_0xca73('0x42'),auth[_0xca73('0x8')](),controller[_0xca73('0x58')]);router['delete']('/:id/openchannel_interactions',auth[_0xca73('0x8')](),controller[_0xca73('0x59')]);router[_0xca73('0x51')](_0xca73('0x45'),auth[_0xca73('0x8')](),controller[_0xca73('0x5a')]);router[_0xca73('0x51')](_0xca73('0x24'),auth[_0xca73('0x8')](),controller[_0xca73('0x5b')]);router[_0xca73('0x51')](_0xca73('0x25'),auth[_0xca73('0x8')](),controller['removeOpenchannelAccounts']);router[_0xca73('0x51')](_0xca73('0x26'),auth['isAuthenticated'](),controller[_0xca73('0x5c')]);router[_0xca73('0x51')](_0xca73('0x28'),auth[_0xca73('0x8')](),controller[_0xca73('0x5d')]);router[_0xca73('0x51')](_0xca73('0x2a'),auth[_0xca73('0x8')](),controller[_0xca73('0x5e')]);router[_0xca73('0x51')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0xca73('0x5f')]=router; \ No newline at end of file +var _0x6a7f=['/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addMailAccounts','addSmsAccounts','addSquareProjects','createApiKey','put','changePassword','removeQueues','/:id/teams','removeTeams','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','addContacts','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname'];(function(_0x3a50ae,_0x4a505b){var _0x3a16f4=function(_0x508359){while(--_0x508359){_0x3a50ae['push'](_0x3a50ae['shift']());}};_0x3a16f4(++_0x4a505b);}(_0x6a7f,0x106));var _0xf6a7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a7f[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xf6a7('0x0'));var util=require(_0xf6a7('0x1'));var path=require(_0xf6a7('0x2'));var timeout=require(_0xf6a7('0x3'));var express=require(_0xf6a7('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6a7('0x5'));var controller=require(_0xf6a7('0x6'));router['get']('/',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x8')]);router[_0xf6a7('0x9')](_0xf6a7('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf6a7('0x9')](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0xc')]);router['get']('/:id/avatar',controller[_0xf6a7('0xd')]);router[_0xf6a7('0x9')](_0xf6a7('0xe'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0xf')]);router[_0xf6a7('0x9')](_0xf6a7('0x10'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x11')]);router['get']('/:id/queues_rt',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x12')]);router[_0xf6a7('0x9')](_0xf6a7('0x13'),auth['isAuthenticated'](),controller[_0xf6a7('0x14')]);router['get'](_0xf6a7('0x15'),auth['isAuthenticated'](),controller[_0xf6a7('0x16')]);router[_0xf6a7('0x9')](_0xf6a7('0x17'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x18')]);router['get'](_0xf6a7('0x19'),auth[_0xf6a7('0x7')](),controller['getChatInteractions']);router[_0xf6a7('0x9')](_0xf6a7('0x1a'),auth['isAuthenticated'](),controller[_0xf6a7('0x1b')]);router[_0xf6a7('0x9')](_0xf6a7('0x1c'),auth['isAuthenticated'](),controller[_0xf6a7('0x1d')]);router[_0xf6a7('0x9')]('/:id/sms/interactions',auth[_0xf6a7('0x7')](),controller['getSmsInteractions']);router['get'](_0xf6a7('0x1e'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x1f')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xf6a7('0x20')]);router[_0xf6a7('0x9')](_0xf6a7('0x21'),auth['isAuthenticated'](),controller[_0xf6a7('0x22')]);router[_0xf6a7('0x9')](_0xf6a7('0x23'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x24')]);router['get'](_0xf6a7('0x25'),auth['isAuthenticated'](),controller[_0xf6a7('0x26')]);router[_0xf6a7('0x9')](_0xf6a7('0x27'),auth['isAuthenticated'](),controller[_0xf6a7('0x28')]);router[_0xf6a7('0x9')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller['getMailAccounts']);router[_0xf6a7('0x9')](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2b')]);router[_0xf6a7('0x9')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2d')]);router[_0xf6a7('0x9')](_0xf6a7('0x2e'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get']('/:id/square_projects',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x2f')]);router[_0xf6a7('0x9')](_0xf6a7('0x30'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x31')]);router['get'](_0xf6a7('0x32'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x33')]);router[_0xf6a7('0x34')](_0xf6a7('0x35'),auth[_0xf6a7('0x7')](),controller['bulkCreate']);router[_0xf6a7('0x34')](_0xf6a7('0xe'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x36')]);router[_0xf6a7('0x34')]('/',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x37')]);router[_0xf6a7('0x34')](_0xf6a7('0x10'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x38')]);var upload=multer({'storage':multer[_0xf6a7('0x39')]({'destination':function(_0x54f324,_0x308a38,_0x34ecc6){_0x34ecc6(null,path[_0xf6a7('0x3a')](config[_0xf6a7('0x3b')],_0xf6a7('0x3c')));},'filename':function(_0x1442c2,_0x5a2253,_0x53cfff){_0x53cfff(null,util[_0xf6a7('0x3d')](_0xf6a7('0x3e'),Date[_0xf6a7('0x3f')](),_0x5a2253[_0xf6a7('0x40')]));}})});router[_0xf6a7('0x34')](_0xf6a7('0x41'),upload[_0xf6a7('0x42')](_0xf6a7('0x43')),controller[_0xf6a7('0x44')]);router['post'](_0xf6a7('0x45'),auth['isAuthenticated'](),controller[_0xf6a7('0x46')]);router['post'](_0xf6a7('0x47'),auth['isAuthenticated'](),controller[_0xf6a7('0x48')]);router[_0xf6a7('0x34')](_0xf6a7('0x49'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4a')]);router[_0xf6a7('0x34')]('/:id/unpause',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4b')]);router[_0xf6a7('0x34')]('/:id/teams',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4c')]);router[_0xf6a7('0x34')](_0xf6a7('0x4d'),auth['isAuthenticated'](),controller[_0xf6a7('0x4e')]);router[_0xf6a7('0x34')]('/:id/mail_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x4f')]);router['post']('/:id/fax_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x50')]);router[_0xf6a7('0x34')](_0xf6a7('0x51'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x52')]);router[_0xf6a7('0x34')]('/:id/openchannel_interactions',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x53')]);router[_0xf6a7('0x34')](_0xf6a7('0x27'),auth[_0xf6a7('0x7')](),controller['addFaxAccounts']);router[_0xf6a7('0x34')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x54')]);router[_0xf6a7('0x34')](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller['addOpenchannelAccounts']);router[_0xf6a7('0x34')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x55')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xf6a7('0x34')]('/:id/square_projects',auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x56')]);router[_0xf6a7('0x34')](_0xf6a7('0x32'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x57')]);router['put'](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller['update']);router[_0xf6a7('0x58')]('/:id/password',auth['isAuthenticated'](),controller[_0xf6a7('0x59')]);router['delete'](_0xf6a7('0x10'),auth['isAuthenticated'](),controller[_0xf6a7('0x5a')]);router['delete'](_0xf6a7('0x5b'),auth['isAuthenticated'](),controller[_0xf6a7('0x5c')]);router[_0xf6a7('0x5d')](_0xf6a7('0xb'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x5e')]);router[_0xf6a7('0x5d')](_0xf6a7('0x4d'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x5f')]);router[_0xf6a7('0x5d')](_0xf6a7('0x60'),auth['isAuthenticated'](),controller[_0xf6a7('0x61')]);router[_0xf6a7('0x5d')](_0xf6a7('0x62'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x63')]);router[_0xf6a7('0x5d')](_0xf6a7('0x51'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router[_0xf6a7('0x5d')](_0xf6a7('0x64'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x65')]);router[_0xf6a7('0x5d')](_0xf6a7('0x27'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x66')]);router[_0xf6a7('0x5d')](_0xf6a7('0x29'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x67')]);router['delete'](_0xf6a7('0x2a'),auth[_0xf6a7('0x7')](),controller['removeOpenchannelAccounts']);router[_0xf6a7('0x5d')](_0xf6a7('0x2c'),auth[_0xf6a7('0x7')](),controller['removeSmsAccounts']);router[_0xf6a7('0x5d')](_0xf6a7('0x2e'),auth['isAuthenticated'](),controller[_0xf6a7('0x68')]);router[_0xf6a7('0x5d')](_0xf6a7('0x69'),auth[_0xf6a7('0x7')](),controller[_0xf6a7('0x6a')]);router['delete'](_0xf6a7('0x32'),auth['isAuthenticated'](),controller[_0xf6a7('0x6b')]);module[_0xf6a7('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 5ffb9fc..5cb28fb 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 _0xa3fc=['screenrecording','sequelize','moment','util','lodash','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','internal','toLowerCase','admin','user','telephone','INTEGER','accountcode','callerid','format','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false'];(function(_0x11bc3c,_0x1293f0){var _0x234a8b=function(_0x3c15ac){while(--_0x3c15ac){_0x11bc3c['push'](_0x11bc3c['shift']());}};_0x234a8b(++_0x1293f0);}(_0xa3fc,0xb1));var _0xca3f=function(_0x307c57,_0x2ff9e5){_0x307c57=_0x307c57-0x0;var _0x232faa=_0xa3fc[_0x307c57];return _0x232faa;};'use strict';var Sequelize=require(_0xca3f('0x0'));var moment=require(_0xca3f('0x1'));var util=require(_0xca3f('0x2'));var _=require(_0xca3f('0x3'));module['exports']={'name':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x496ba6){this[_0xca3f('0x5')](_0xca3f('0x6'),_0x496ba6);this[_0xca3f('0x5')](_0xca3f('0x7'),_0x496ba6);},'comment':_0xca3f('0x8')},'fullname':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'set':function(_0x4ecf10){this['setDataValue'](_0xca3f('0x9'),_0x4ecf10);this['setDataValue']('callerid',util['format'](_0xca3f('0xa'),_0x4ecf10,this['getDataValue'](_0xca3f('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x56f9df){if(_0x56f9df){this[_0xca3f('0x5')]('email',_0x56f9df[_0xca3f('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0xca3f('0xd'),_0xca3f('0xe'),'agent',_0xca3f('0xf')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':![],'unique':'internal','set':function(_0x42f0ce){this[_0xca3f('0x5')](_0xca3f('0xb'),_0x42f0ce);this[_0xca3f('0x5')](_0xca3f('0x11'),_0x42f0ce);this['setDataValue'](_0xca3f('0x12'),util[_0xca3f('0x13')]('\x22%s\x22\x20<%s>',this[_0xca3f('0x14')]('fullname'),_0x42f0ce));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xca3f('0x4')]},'mobile':{'type':Sequelize[_0xca3f('0x4')]},'address':{'type':Sequelize[_0xca3f('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xca3f('0x4')]},'city':{'type':Sequelize[_0xca3f('0x4')]},'country':{'type':Sequelize[_0xca3f('0x4')]},'online':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':_0xca3f('0x16')},'lastPauseAt':{'type':Sequelize[_0xca3f('0x17')]},'chatCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xca3f('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xca3f('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xca3f('0x18')},'ipaddr':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xca3f('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x1a'),_0xca3f('0xe'),_0xca3f('0x1b')),'allowNull':!![],'defaultValue':_0xca3f('0x1a')},'context':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x1c'),_0xca3f('0x1d'),_0xca3f('0x1e'),_0xca3f('0x1f'),'PROHIB_NOT_SCREENED',_0xca3f('0x20'),_0xca3f('0x21'),_0xca3f('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x23'),'set':function(_0x122d81){this[_0xca3f('0x5')](_0xca3f('0x24'),_0x122d81?_0x122d81['join'](','):null);},'get':function(){return this[_0xca3f('0x14')]('transport')?this[_0xca3f('0x14')](_0xca3f('0x24'))['split'](','):null;},'comment':_0xca3f('0x25')},'dtmfmode':{'type':Sequelize[_0xca3f('0x19')]('rfc2833',_0xca3f('0x26'),_0xca3f('0x27'),_0xca3f('0x28'),'auto'),'allowNull':!![],'defaultValue':_0xca3f('0x29')},'directmedia':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x2b'),'update',_0xca3f('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x2d'),'set':function(_0x5a722c){this[_0xca3f('0x5')](_0xca3f('0x2e'),_0x5a722c?_0x5a722c[_0xca3f('0x2f')](','):null);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x2e'))?this[_0xca3f('0x14')](_0xca3f('0x2e'))['split'](','):null;},'comment':_0xca3f('0x30')},'callgroup':{'type':Sequelize[_0xca3f('0x4')]},'namedcallgroup':{'type':Sequelize[_0xca3f('0x4')]},'pickupgroup':{'type':Sequelize[_0xca3f('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xca3f('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xca3f('0x4')]},'disallow':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca3f('0x31'),'set':function(_0x39337f){this[_0xca3f('0x5')]('allow',_0x39337f?_0x39337f['join'](';'):_0xca3f('0x31'));},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x32'))?this[_0xca3f('0x14')](_0xca3f('0x32'))[_0xca3f('0x33')](';'):null;},'comment':_0xca3f('0x34')},'autoframing':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'set':function(_0x4cf75d){this[_0xca3f('0x5')](_0xca3f('0x35'),_0x4cf75d?_0x4cf75d[_0xca3f('0x2f')](','):null);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x35'))?this[_0xca3f('0x14')](_0xca3f('0x35'))[_0xca3f('0x33')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x37')},'amaflags':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xca3f('0x19')]('yes','no',_0xca3f('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x39'),_0xca3f('0x3a'),_0xca3f('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x3c'),_0xca3f('0x3d')),'allowNull':!![],'defaultValue':_0xca3f('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xca3f('0x2a')},'keepalive':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x3e'),_0xca3f('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x40'),_0xca3f('0x41'),_0xca3f('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x2b'),_0xca3f('0x43'),_0xca3f('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xca3f('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1402c3){this[_0xca3f('0x5')](_0xca3f('0x45'),_0x1402c3);var _0x221d6f=this[_0xca3f('0x46')]({'plain':!![]});switch(_0x1402c3){case 0x0:case 0x1:var _0x4a308f=_0x221d6f[_0xca3f('0x24')]?_[_0xca3f('0x47')](_0x221d6f[_0xca3f('0x24')])?_0x221d6f[_0xca3f('0x24')]['join']():_0x221d6f[_0xca3f('0x24')]:'udp';if(_0x4a308f==='wss'){_0x4a308f=_0xca3f('0x23');}this[_0xca3f('0x5')](_0xca3f('0x24'),_0x4a308f);this['setDataValue'](_0xca3f('0x48'),'no');this[_0xca3f('0x5')](_0xca3f('0x49'),null);this[_0xca3f('0x5')]('force_avp',null);this[_0xca3f('0x5')](_0xca3f('0x4a'),null);this[_0xca3f('0x5')](_0xca3f('0x4b'),null);this[_0xca3f('0x5')](_0xca3f('0x4c'),null);this[_0xca3f('0x5')](_0xca3f('0x4d'),null);this[_0xca3f('0x5')]('dtlscertfile',null);this[_0xca3f('0x5')](_0xca3f('0x4e'),null);this['setDataValue'](_0xca3f('0x4f'),'no');break;case 0x2:this[_0xca3f('0x5')](_0xca3f('0x24'),'wss');this[_0xca3f('0x5')](_0xca3f('0x48'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x49'),_0xca3f('0x2a'));this[_0xca3f('0x5')]('force_avp',_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4a'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4b'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4c'),'no');this[_0xca3f('0x5')]('dtlssetup',_0xca3f('0x42'));this['setDataValue']('dtlscertfile',_0x221d6f['dtlscertfile']||_0xca3f('0x50'));this[_0xca3f('0x5')]('dtlsprivatekey',_0x221d6f[_0xca3f('0x4e')]||'/etc/pki/tls/private/motion.key');this[_0xca3f('0x5')](_0xca3f('0x4f'),_0xca3f('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xca3f('0x51')],'set':function(_0x2aabf5){this[_0xca3f('0x5')](_0xca3f('0x52'),_0x2aabf5?_0x2aabf5[_0xca3f('0x2f')](','):[]);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x52'))?_['map'](this[_0xca3f('0x14')](_0xca3f('0x52'))[_0xca3f('0x33')](','),function(_0xa46643){return parseInt(_0xa46643,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xca3f('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xca3f('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xca3f('0x4')]},'passwordResetAt':{'type':Sequelize[_0xca3f('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x53'))?this['getDataValue'](_0xca3f('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x874595){if(typeof _0x874595===_0xca3f('0x54')){var _0x32c68c=_0x874595==='1'?!![]:_0x874595==='0'?![]:_0x874595===_0xca3f('0x55')?!![]:_0x874595===_0xca3f('0x56')?![]:![];this[_0xca3f('0x5')]('screenrecording',_0x32c68c);}else{this[_0xca3f('0x5')](_0xca3f('0x57'),_0x874595);}}}}; \ No newline at end of file +var _0x4977=['PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','force_rport,comedia','nat','join','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uas','fingerprint','active','passive','update,nonat','showWebBar','get','wss','udp','encryption','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','admin','user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x2598e7,_0x5129c9){var _0x36120e=function(_0x34d15a){while(--_0x34d15a){_0x2598e7['push'](_0x2598e7['shift']());}};_0x36120e(++_0x5129c9);}(_0x4977,0x8e));var _0x7497=function(_0x2259c9,_0x44be9a){_0x2259c9=_0x2259c9-0x0;var _0x2f5271=_0x4977[_0x2259c9];return _0x2f5271;};'use strict';var Sequelize=require(_0x7497('0x0'));var moment=require(_0x7497('0x1'));var util=require(_0x7497('0x2'));var _=require(_0x7497('0x3'));module[_0x7497('0x4')]={'name':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'unique':_0x7497('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5b8968){this['setDataValue'](_0x7497('0x6'),_0x5b8968);this[_0x7497('0x7')](_0x7497('0x8'),_0x5b8968);},'comment':_0x7497('0x9')},'fullname':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'set':function(_0x39ea56){this['setDataValue'](_0x7497('0xa'),_0x39ea56);this[_0x7497('0x7')](_0x7497('0xb'),util[_0x7497('0xc')](_0x7497('0xd'),_0x39ea56,this['getDataValue'](_0x7497('0xe'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'unique':_0x7497('0xf'),'validate':{'isEmail':!![]},'set':function(_0x445e36){if(_0x445e36){this[_0x7497('0x7')](_0x7497('0xf'),_0x445e36[_0x7497('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x7497('0x11'),_0x7497('0x12'),_0x7497('0x13'),_0x7497('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':![],'unique':_0x7497('0xe'),'set':function(_0x1e9ca0){this[_0x7497('0x7')](_0x7497('0xe'),_0x1e9ca0);this[_0x7497('0x7')](_0x7497('0x16'),_0x1e9ca0);this[_0x7497('0x7')]('callerid',util[_0x7497('0xc')]('\x22%s\x22\x20<%s>',this[_0x7497('0x17')](_0x7497('0xa')),_0x1e9ca0));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7497('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x7497('0x5')]},'zipcode':{'type':Sequelize[_0x7497('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7497('0x5')]},'country':{'type':Sequelize[_0x7497('0x5')]},'online':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x7497('0x19')},'lastPauseAt':{'type':Sequelize[_0x7497('0x1a')]},'chatCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x7497('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':_0x7497('0x1b')},'ipaddr':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x7497('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7497('0x1c')]('friend','user','peer'),'allowNull':!![],'defaultValue':_0x7497('0x1d')},'context':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x1e'),_0x7497('0x1f'),'ALLOWED_FAILED_SCREEN',_0x7497('0x20'),_0x7497('0x21'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x7497('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2326b8){this[_0x7497('0x7')]('transport',_0x2326b8?_0x2326b8['join'](','):null);},'get':function(){return this[_0x7497('0x17')]('transport')?this['getDataValue'](_0x7497('0x23'))[_0x7497('0x24')](','):null;},'comment':_0x7497('0x25')},'dtmfmode':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x26'),_0x7497('0x27'),_0x7497('0x28'),_0x7497('0x29'),_0x7497('0x2a')),'allowNull':!![],'defaultValue':_0x7497('0x26')},'directmedia':{'type':Sequelize[_0x7497('0x1c')]('yes','no',_0x7497('0x2b'),'update',_0x7497('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':_0x7497('0x2d'),'set':function(_0x4b7e2c){this[_0x7497('0x7')](_0x7497('0x2e'),_0x4b7e2c?_0x4b7e2c[_0x7497('0x2f')](','):null);},'get':function(){return this[_0x7497('0x17')]('nat')?this['getDataValue'](_0x7497('0x2e'))[_0x7497('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x7497('0x5')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x7497('0x5')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7497('0x5')]},'disallow':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'defaultValue':_0x7497('0x30')},'allow':{'type':Sequelize[_0x7497('0x5')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1ca97d){this[_0x7497('0x7')](_0x7497('0x31'),_0x1ca97d?_0x1ca97d['join'](';'):_0x7497('0x32'));},'get':function(){return this[_0x7497('0x17')]('allow')?this[_0x7497('0x17')](_0x7497('0x31'))[_0x7497('0x24')](';'):null;},'comment':_0x7497('0x33')},'autoframing':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x19d86c){this[_0x7497('0x7')](_0x7497('0x35'),_0x19d86c?_0x19d86c[_0x7497('0x2f')](','):null);},'get':function(){return this[_0x7497('0x17')](_0x7497('0x35'))?this[_0x7497('0x17')](_0x7497('0x35'))[_0x7497('0x24')](','):null;},'comment':_0x7497('0x36')},'trustrpid':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':_0x7497('0x34')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x7497('0x39'),_0x7497('0x3a'),_0x7497('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x7497('0x1c')]('uac','uas'),'allowNull':!![],'defaultValue':_0x7497('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x7497('0x1c')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no',_0x7497('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x3e'),_0x7497('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7497('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x7497('0x34'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no','nonat','update',_0x7497('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x7497('0x1a')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x31cfaa){this[_0x7497('0x7')](_0x7497('0x41'),_0x31cfaa);var _0x4716ba=this[_0x7497('0x42')]({'plain':!![]});switch(_0x31cfaa){case 0x0:case 0x1:var _0x4524d0=_0x4716ba[_0x7497('0x23')]?_['isArray'](_0x4716ba['transport'])?_0x4716ba['transport'][_0x7497('0x2f')]():_0x4716ba[_0x7497('0x23')]:'udp';if(_0x4524d0===_0x7497('0x43')){_0x4524d0=_0x7497('0x44');}this['setDataValue']('transport',_0x4524d0);this[_0x7497('0x7')](_0x7497('0x45'),'no');this[_0x7497('0x7')]('avpf',null);this[_0x7497('0x7')]('force_avp',null);this[_0x7497('0x7')](_0x7497('0x46'),null);this[_0x7497('0x7')]('dtlsenable',null);this[_0x7497('0x7')](_0x7497('0x47'),null);this[_0x7497('0x7')](_0x7497('0x48'),null);this[_0x7497('0x7')](_0x7497('0x49'),null);this[_0x7497('0x7')]('dtlsprivatekey',null);this[_0x7497('0x7')](_0x7497('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x7497('0x23'),'wss');this['setDataValue'](_0x7497('0x45'),'yes');this[_0x7497('0x7')](_0x7497('0x4b'),_0x7497('0x34'));this[_0x7497('0x7')]('force_avp',_0x7497('0x34'));this[_0x7497('0x7')](_0x7497('0x46'),_0x7497('0x34'));this[_0x7497('0x7')](_0x7497('0x4c'),_0x7497('0x34'));this['setDataValue'](_0x7497('0x47'),'no');this[_0x7497('0x7')](_0x7497('0x48'),_0x7497('0x4d'));this[_0x7497('0x7')](_0x7497('0x49'),_0x4716ba[_0x7497('0x49')]||_0x7497('0x4e'));this[_0x7497('0x7')]('dtlsprivatekey',_0x4716ba[_0x7497('0x4f')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x7497('0x4a'),_0x7497('0x34'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x5578ec){this[_0x7497('0x7')]('permissions',_0x5578ec?_0x5578ec['join'](','):[]);},'get':function(){return this[_0x7497('0x17')](_0x7497('0x50'))?_[_0x7497('0x51')](this[_0x7497('0x17')](_0x7497('0x50'))[_0x7497('0x24')](','),function(_0x59e004){return parseInt(_0x59e004,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7497('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7497('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7497('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7497('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7497('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7497('0x1c')](_0x7497('0x34'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x7497('0x1a')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7497('0x52')],'get':function(){return this[_0x7497('0x17')](_0x7497('0x53'))?this[_0x7497('0x17')](_0x7497('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7497('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x7497('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x1eb6c3){if(typeof _0x1eb6c3===_0x7497('0x54')){var _0x59a692=_0x1eb6c3==='1'?!![]:_0x1eb6c3==='0'?![]:_0x1eb6c3===_0x7497('0x55')?!![]:_0x1eb6c3===_0x7497('0x56')?![]:![];this['setDataValue']('screenrecording',_0x59a692);}else{this[_0x7497('0x7')](_0x7497('0x57'),_0x1eb6c3);}}}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 4d237ad..8e14280 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 _0xd73e=['pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','unpause','chatPause','faxPause','smsPause','pauseType','lastPauseAt','manual','chat','sms','openchannel','Team','getTeams','addTeams','removeTeams','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$overlap','$contains','$contained','$any','firstName','Contact','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','apiKeyIat','removeApiKey','API\x20key\x20not\x20available','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','get','Users','Agents','agent','Telephones','filter','map','value','role','find','name','UserProfileResource','stack','send','index','rawAttributes','keys','password','salt','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','sequelize','col','field','lower','User','rows','show','params','differenceBy','intersection','includeAll','include','bulkCreate','update','body','describe','addContacts','omit','agent\x20role','telephone','admin','user','../../config/license/util','users','isNil','format','count\x20%s:\x20%s','Setting','securePassword','min_internal','max','internal','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','permissions','101','102','110','104','106','109','100','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','online','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','Queues','ids','penalty','spread','voice','VoiceQueue','findAll','SIP/%s','channel','Unknown\x20channel','remove','emit','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','join','root','download','server/files/images/','findOne','CmContact','options','getContacts','List','Tags','tag','getQueues','pick','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','intrf','user:%s','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','push','UserVoiceQueue.penalty','each','upsert','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','loginInPause','PAUSE','LOGININPAUSE','concat','logout','forEach','all'];(function(_0x2822b3,_0x49842b){var _0x4b9178=function(_0x265ccd){while(--_0x265ccd){_0x2822b3['push'](_0x2822b3['shift']());}};_0x4b9178(++_0x49842b);}(_0xd73e,0x19a));var _0xed73=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd73e[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xed73('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed73('0x1'));var jsonpatch=require(_0xed73('0x2'));var rp=require(_0xed73('0x3'));var moment=require('moment');var BPromise=require(_0xed73('0x4'));var Mustache=require(_0xed73('0x5'));var util=require(_0xed73('0x6'));var path=require('path');var sox=require(_0xed73('0x7'));var csv=require(_0xed73('0x8'));var ejs=require(_0xed73('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed73('0xa'));var crypto=require(_0xed73('0xb'));var jsforce=require(_0xed73('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xed73('0x8'));var querystring=require(_0xed73('0xd'));var Papa=require(_0xed73('0xe'));var Redis=require(_0xed73('0xf'));var authService=require(_0xed73('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xed73('0x11'));var logger=require('../../config/logger')(_0xed73('0x12'));var utils=require(_0xed73('0x13'));var config=require(_0xed73('0x14'));var db=require(_0xed73('0x15'))['db'];config[_0xed73('0x16')]=_[_0xed73('0x17')](config[_0xed73('0x16')],{'host':_0xed73('0x18'),'port':0x18eb});var socket=require(_0xed73('0x19'))(new Redis(config['redis']));require(_0xed73('0x1a'))['register'](socket);var jayson=require(_0xed73('0x1b'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3edeec,_0xbda24d,_0x2f5cff){if(_0x2f5cff){var _0x5b35eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b35eb[_0xed73('0x1c')](_0xbda24d)){return _0x3edeec;}else{throw new Error(_0xed73('0x1d'));}}else{return _0x3edeec;}}function respondWithRpcPromise(_0x89c242,_0x1620e1,_0x289019,_0x59d496){return new BPromise(function(_0x408105,_0x1ec20d){var _0x46d88f=_0x59d496||client;return _0x46d88f[_0xed73('0x1e')](_0x89c242,_0x289019)[_0xed73('0x1f')](function(_0x8282ae){logger['info'](_0xed73('0x20'),_0x1620e1,_0xed73('0x21'));logger['debug'](_0xed73('0x22'),_0x1620e1,_0xed73('0x21'),JSON[_0xed73('0x23')](_0x8282ae));if(_0x8282ae[_0xed73('0x24')]){if(_0x8282ae[_0xed73('0x24')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x1620e1,_0x8282ae[_0xed73('0x24')][_0xed73('0x25')]);return _0x1ec20d(_0x8282ae['error']['message']);}logger['error']('User,\x20%s,\x20%s',_0x1620e1,_0x8282ae[_0xed73('0x24')][_0xed73('0x25')]);return _0x408105(_0x8282ae['error'][_0xed73('0x25')]);}else{logger['info'](_0xed73('0x20'),_0x1620e1,_0xed73('0x21'));_0x408105(_0x8282ae[_0xed73('0x26')][_0xed73('0x25')]);}})[_0xed73('0x27')](function(_0x1d9f44){logger['error'](_0xed73('0x20'),_0x1620e1,_0x1d9f44);_0x1ec20d(_0x1d9f44);});});}function respondWithStatusCode(_0x2162dc,_0x56994e){_0x56994e=_0x56994e||0xcc;return function(_0x3fb5a4){if(_0x3fb5a4){return _0x2162dc[_0xed73('0x28')](_0x56994e);}return _0x2162dc[_0xed73('0x29')](_0x56994e)[_0xed73('0x2a')]();};}function respondWithResult(_0x1c1ef6,_0x3eda27){_0x3eda27=_0x3eda27||0xc8;return function(_0x4fe5df){if(_0x4fe5df){return _0x1c1ef6['status'](_0x3eda27)[_0xed73('0x2b')](_0x4fe5df);}};}function respondWithFilteredResult(_0x295427,_0x1e8b61){return function(_0x179898){if(_0x179898){var _0x136bb2=_0x179898[_0xed73('0x2c')],_0x467ef6=_0x1e8b61[_0xed73('0x2d')],_0x4f6061=_0x1e8b61[_0xed73('0x2d')]+_0x1e8b61[_0xed73('0x2e')],_0x29b9be;if(_0x4f6061>=_0x136bb2){_0x4f6061=_0x136bb2;_0x29b9be=0xc8;}else{_0x29b9be=0xce;}_0x295427[_0xed73('0x29')](_0x29b9be);return _0x295427[_0xed73('0x2f')](_0xed73('0x30'),_0x467ef6+'-'+_0x4f6061+'/'+_0x136bb2)[_0xed73('0x2b')](_0x179898);}return null;};}function patchUpdates(_0x58ee22){return function(_0x1747e7){try{jsonpatch['apply'](_0x1747e7,_0x58ee22,!![]);}catch(_0x42fa3a){return BPromise['reject'](_0x42fa3a);}return _0x1747e7[_0xed73('0x31')]();};}function saveUpdates(_0x583804,_0x3db005){return function(_0x34a352){if(_0x34a352){return _0x34a352['update'](_0x583804)['then'](function(_0xe224f){return _0xe224f;});}return null;};}function removeEntity(_0x5041ce,_0x2f7caf){return function(_0x1e8cb0){if(_0x1e8cb0){return _0x1e8cb0[_0xed73('0x32')]()[_0xed73('0x1f')](function(){var _0x2ec51f=_0x1e8cb0[_0xed73('0x33')]({'plain':!![]});var _0x313fa2=[{'name':_0xed73('0x34'),'value':'user','ignore':!![]},{'name':_0xed73('0x35'),'value':_0xed73('0x36'),'ignore':![]},{'name':_0xed73('0x37'),'value':'telephone','ignore':![]}];var _0x175678=_(_0x313fa2)[_0xed73('0x38')]('ignore')[_0xed73('0x39')]('value')[_0xed73('0x3a')]();if(_['includes'](_0x175678,_0x2ec51f[_0xed73('0x3b')])){return;}var _0x15a1f0=_[_0xed73('0x3c')](_0x313fa2,[_0xed73('0x3a'),_0x2ec51f[_0xed73('0x3b')]])[_0xed73('0x3d')];return db[_0xed73('0x3e')][_0xed73('0x32')]({'where':{'type':_0x15a1f0,'resourceId':_0x2ec51f['id']}})[_0xed73('0x1f')](function(){return _0x1e8cb0;});})[_0xed73('0x1f')](function(){_0x5041ce[_0xed73('0x29')](0xcc)[_0xed73('0x2a')]();});}};}function handleEntityNotFound(_0x5bb983,_0x308de1){return function(_0x1da25e){if(!_0x1da25e){_0x5bb983[_0xed73('0x28')](0x194);}return _0x1da25e;};}function handleError(_0x20d528,_0x3c5055){_0x3c5055=_0x3c5055||0x1f4;return function(_0xb603d8){logger['error'](_0xb603d8[_0xed73('0x3f')]);if(_0xb603d8[_0xed73('0x3d')]){delete _0xb603d8['name'];}_0x20d528[_0xed73('0x29')](_0x3c5055)[_0xed73('0x40')](_0xb603d8);};}exports[_0xed73('0x41')]=function(_0x5f18b6,_0x4ee537){var _0xb3749d={},_0x5610d0={},_0x36439f={'count':0x0,'rows':[]};var _0x41d672=db['User'][_0xed73('0x42')];_0x5610d0['model']=_['differenceBy'](_[_0xed73('0x43')](_0x41d672),[_0xed73('0x44'),_0xed73('0x45')]);_0x5610d0['query']=_['keys'](_0x5f18b6['query']);_0x5610d0['filters']=_['intersection'](_0x5610d0[_0xed73('0x46')],_0x5610d0['query']);_0xb3749d[_0xed73('0x47')]=_['intersection'](_0x5610d0[_0xed73('0x46')],qs[_0xed73('0x48')](_0x5f18b6[_0xed73('0x49')][_0xed73('0x48')]));_0xb3749d[_0xed73('0x47')]=_0xb3749d['attributes'][_0xed73('0x4a')]?_0xb3749d[_0xed73('0x47')]:_0x5610d0[_0xed73('0x46')];if(!_0x5f18b6[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0xb3749d['limit']=qs[_0xed73('0x2e')](_0x5f18b6[_0xed73('0x49')]['limit']);_0xb3749d[_0xed73('0x2d')]=qs['offset'](_0x5f18b6[_0xed73('0x49')][_0xed73('0x2d')]);}_0xb3749d[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x5f18b6[_0xed73('0x49')]['sort']);_0xb3749d[_0xed73('0x4f')]=qs['filters'](_['pick'](_0x5f18b6[_0xed73('0x49')],_0x5610d0[_0xed73('0x50')]));if(_0x5f18b6[_0xed73('0x49')][_0xed73('0x38')]){_0xb3749d[_0xed73('0x4f')]=_[_0xed73('0x51')](_0xb3749d[_0xed73('0x4f')],{'$or':_['map'](_0x41d672,function(_0x2b58ce){return db['sequelize']['where'](db[_0xed73('0x52')]['fn']('lower',db[_0xed73('0x52')][_0xed73('0x53')](_0x2b58ce[_0xed73('0x54')])),{'$like':db[_0xed73('0x52')]['fn'](_0xed73('0x55'),'%'+_0x5f18b6['query']['filter']+'%')});})});}_0xb3749d=_[_0xed73('0x51')]({},_0xb3749d,_0x5f18b6['options']);var _0x271694={'where':_0xb3749d['where']};return db[_0xed73('0x56')][_0xed73('0x2c')](_0x271694)['then'](function(_0x44290d){_0x36439f[_0xed73('0x2c')]=_0x44290d;if(_0x5f18b6[_0xed73('0x49')]['includeAll']){_0xb3749d['include']=[{'all':!![]}];}return db['User']['findAll'](_0xb3749d);})['then'](function(_0x560d0a){_0x36439f[_0xed73('0x57')]=_0x560d0a;return _0x36439f;})[_0xed73('0x1f')](respondWithFilteredResult(_0x4ee537,_0xb3749d))[_0xed73('0x27')](handleError(_0x4ee537,null));};exports[_0xed73('0x58')]=function(_0x4a072f,_0x3d63ef){var _0x14099c={'raw':![],'where':{'id':_0x4a072f[_0xed73('0x59')]['id']}},_0x2f4856={};_0x2f4856['model']=_[_0xed73('0x5a')](_['keys'](db[_0xed73('0x56')][_0xed73('0x42')]),[_0xed73('0x44'),_0xed73('0x45')]);_0x2f4856[_0xed73('0x49')]=_[_0xed73('0x43')](_0x4a072f[_0xed73('0x49')]);_0x2f4856[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x2f4856[_0xed73('0x46')],_0x2f4856[_0xed73('0x49')]);_0x14099c['attributes']=_['intersection'](_0x2f4856[_0xed73('0x46')],qs[_0xed73('0x48')](_0x4a072f['query'][_0xed73('0x48')]));_0x14099c[_0xed73('0x47')]=_0x14099c[_0xed73('0x47')][_0xed73('0x4a')]?_0x14099c[_0xed73('0x47')]:_0x2f4856['model'];if(_0x4a072f[_0xed73('0x49')][_0xed73('0x5c')]){_0x14099c[_0xed73('0x5d')]=[{'all':!![]}];}_0x14099c=_[_0xed73('0x51')]({},_0x14099c,_0x4a072f['options']);return db[_0xed73('0x56')]['find'](_0x14099c)[_0xed73('0x1f')](handleEntityNotFound(_0x3d63ef,null))[_0xed73('0x1f')](respondWithResult(_0x3d63ef,null))['catch'](handleError(_0x3d63ef,null));};exports[_0xed73('0x5e')]=function(_0x30a8fe,_0x339e05){return db[_0xed73('0x56')][_0xed73('0x5e')](_0x30a8fe['body'],{'raw':![],'individualHooks':!![]})[_0xed73('0x1f')](respondWithResult(_0x339e05,0xc9))['catch'](handleError(_0x339e05,null));};exports[_0xed73('0x5f')]=function(_0x442364,_0x14f626){if(_0x442364[_0xed73('0x60')]['id']){delete _0x442364['body']['id'];}delete _0x442364['body'][_0xed73('0x3b')];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x442364[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x14f626,null))[_0xed73('0x1f')](saveUpdates(_0x442364['body'],null))['then'](respondWithResult(_0x14f626,null))[_0xed73('0x27')](handleError(_0x14f626,null));};exports[_0xed73('0x61')]=function(_0x5c2fe8,_0x165649){return db[_0xed73('0x56')][_0xed73('0x61')]()['then'](respondWithResult(_0x165649,null))['catch'](handleError(_0x165649,null));};exports[_0xed73('0x62')]=function(_0x359f38,_0x3b30af,_0x2e1e30){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x359f38[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3b30af,null))[_0xed73('0x1f')](function(_0x136d14){if(_0x136d14){return _0x136d14[_0xed73('0x62')](_0x359f38['body']['ids'],_[_0xed73('0x63')](_0x359f38[_0xed73('0x60')],['ids','id'])||{});}})[_0xed73('0x1f')](respondWithResult(_0x3b30af,null))[_0xed73('0x27')](handleError(_0x3b30af,null));};var getLicense=function(_0x376a98){return new BPromise(function(_0x55e68a,_0x494821){var _0x1e0ef5=0x0;_0x376a98[_0xed73('0x60')]['role']===_0xed73('0x36')&&_0x55e68a(_0xed73('0x64'));return db[_0xed73('0x56')][_0xed73('0x2c')]({'where':{'$or':[{'role':_0x376a98[_0xed73('0x60')]['role']==='telephone'?_0xed73('0x65'):[_0xed73('0x66'),_0xed73('0x67')]}]}})[_0xed73('0x1f')](function(_0x2fa4b5){_0x1e0ef5=_0x2fa4b5;return require(_0xed73('0x68'))['getLicense']();})[_0xed73('0x1f')](function(_0x5513a6){var _0xf51195=_0x376a98[_0xed73('0x60')][_0xed73('0x3b')]===_0xed73('0x65')?'telephones':_0xed73('0x69');if(!_[_0xed73('0x6a')](_0x5513a6[_0xf51195])&&_0x1e0ef5>=_0x5513a6[_0xf51195]){return _0x494821({'message':'License\x20limit\x20reached'});}return _0x55e68a(util[_0xed73('0x6b')](_0xed73('0x6c'),_0xf51195,_0x1e0ef5));})[_0xed73('0x27')](function(_0x337ad9){return _0x494821(_0x337ad9);});});};exports['create']=function(_0x1ce2c,_0x26d9bc){return getLicense(_0x1ce2c)[_0xed73('0x1f')](function(_0x10ae6c){if(!_0x1ce2c[_0xed73('0x60')]['internal']){var _0x565477;return db[_0xed73('0x6d')]['findById'](0x1)[_0xed73('0x1f')](function(_0x2dee05){_0x2dee05['securePassword']=!![];return checkPasswordPattern(_0x2dee05,_0x1ce2c[_0xed73('0x60')][_0xed73('0x44')],_0x2dee05[_0xed73('0x6e')]);})[_0xed73('0x1f')](function(_0x2e5e91){_0x565477=_0x2e5e91[_0xed73('0x6f')];return db[_0xed73('0x56')][_0xed73('0x70')](_0xed73('0x71'));})[_0xed73('0x1f')](function(_0x2e335c){if(_[_0xed73('0x6a')](_0x2e335c)){if(_0x565477){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x565477;}else{_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=0x1;}}else{if(_['isNil'](_0x565477)||_0x565477==_0x2e335c){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x2e335c+0x1;}else if(_0x565477>_0x2e335c){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x565477;}else{return db['sequelize'][_0xed73('0x49')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xed73('0x52')][_0xed73('0x72')][_0xed73('0x73')]})[_0xed73('0x1f')](function(_0x253b21){if(_0x253b21&&_0x253b21[_0xed73('0x4a')]){for(var _0xb4df8c=0x0,_0x3114f5=_0x253b21[_0xed73('0x4a')];_0xb4df8c<_0x3114f5&&_[_0xed73('0x6a')](_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]);_0xb4df8c++){if(_0x565477<=_0x253b21[_0xb4df8c]['from']){_0x1ce2c[_0xed73('0x60')]['internal']=_0x253b21[_0xb4df8c]['from'];}else if(_0x565477>_0x253b21[_0xb4df8c][_0xed73('0x74')]&&_0x565477<=_0x253b21[_0xb4df8c]['to']){_0x1ce2c[_0xed73('0x60')]['internal']=_0x565477;}}}if(_[_0xed73('0x6a')](_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')])){_0x1ce2c[_0xed73('0x60')]['internal']=_0x2e335c+0x1;}});}}});}})[_0xed73('0x1f')](function(){if(_0x1ce2c[_0xed73('0x60')][_0xed73('0x75')]){_0x1ce2c[_0xed73('0x60')][_0xed73('0x76')]=_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')];_0x1ce2c[_0xed73('0x60')][_0xed73('0x77')]={'mailbox':_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')],'password':_0x1ce2c[_0xed73('0x60')][_0xed73('0x44')],'fullname':_0x1ce2c[_0xed73('0x60')]['fullname'],'email':_0x1ce2c[_0xed73('0x60')]['email']};}if(_0x1ce2c[_0xed73('0x60')]&&_0x1ce2c['body'][_0xed73('0x3b')]===_0xed73('0x36')){_0x1ce2c[_0xed73('0x60')][_0xed73('0x78')]=[_0xed73('0x79'),_0xed73('0x7a'),'103',_0xed73('0x7b'),_0xed73('0x7c'),'105',_0xed73('0x7d'),'107','108',_0xed73('0x7e'),_0xed73('0x7f'),'111'];}return db['User'][_0xed73('0x80')](_0x1ce2c[_0xed73('0x60')],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xed73('0x1f')](function(_0x10c1bf){if(_0x1ce2c[_0xed73('0x60')]['role']===_0xed73('0x67'))return _0x10c1bf;var _0x5dc721=_0x1ce2c[_0xed73('0x67')]['get']({'plain':!![]});if(!_0x5dc721)throw new Error(_0xed73('0x81'));if(_0x5dc721['role']==='user'){var _0xd0a7ed=_0x10c1bf[_0xed73('0x33')]({'plain':!![]});var _0x15d42e=[{'name':_0xed73('0x35'),'value':'agent'},{'name':'Telephones','value':_0xed73('0x65')}];var _0x1ef12c=_[_0xed73('0x3c')](_0x15d42e,[_0xed73('0x3a'),_0xd0a7ed[_0xed73('0x3b')]])[_0xed73('0x3d')];return db[_0xed73('0x82')][_0xed73('0x3c')]({'where':{'name':_0x1ef12c,'userProfileId':_0x5dc721['userProfileId']},'raw':!![]})['then'](function(_0xa9509a){if(_0xa9509a&&_0xa9509a[_0xed73('0x83')]===0x0){return db['UserProfileResource'][_0xed73('0x80')]({'name':_0xd0a7ed['name'],'resourceId':_0xd0a7ed['id'],'type':_0xa9509a[_0xed73('0x3d')],'sectionId':_0xa9509a['id']},{})[_0xed73('0x1f')](function(){return _0x10c1bf;});}else{return _0x10c1bf;}})[_0xed73('0x27')](function(_0x4e4e18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e4e18);throw _0x4e4e18;});}return _0x10c1bf;})[_0xed73('0x1f')](respondWithResult(_0x26d9bc,0xc9))['catch'](handleError(_0x26d9bc,null));};exports['changePassword']=function(_0x10d740,_0x2219fd,_0x4d099a){var _0x18f975=![];if(_0x10d740[_0xed73('0x60')]['id']){delete _0x10d740[_0xed73('0x60')]['id'];}if(!_[_0xed73('0x6a')](_0x10d740[_0xed73('0x60')][_0xed73('0x84')])){if(_0x10d740[_0xed73('0x60')][_0xed73('0x84')]===_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x10d740['params']['id']}})[_0xed73('0x1f')](function(_0x219805){if(_0x219805){if(_0x219805['id']==_0x10d740['user']['id']){if(!_0x10d740['body']['oldPassword']||!_0x10d740[_0xed73('0x60')]['newPassword']){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x88'));}if(!_0x219805[_0xed73('0x89')](_0x10d740[_0xed73('0x60')][_0xed73('0x84')])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8a'));}if(_0x10d740[_0xed73('0x60')]['oldPassword']==_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8b'));}return _0x219805;}else if(_0x10d740['user']['role']==_0xed73('0x66')){if(!_0x10d740[_0xed73('0x60')]['newPassword']){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x219805;}else if(_0x10d740[_0xed73('0x67')][_0xed73('0x3b')]=='user'){if(!_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new db[(_0xed73('0x86'))]['ValidationError'](_0xed73('0x8c'));}if(_0x219805[_0xed73('0x3b')]!=_0xed73('0x36')){throw new db['Sequelize'][(_0xed73('0x87'))](_0xed73('0x8d'));}return _0x219805;}else{throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8d'));}}return null;})[_0xed73('0x1f')](handleEntityNotFound(_0x2219fd,null))[_0xed73('0x1f')](function(_0x2f554e){return db[_0xed73('0x6d')]['findOne']({'attributes':['id',_0xed73('0x6e')]})[_0xed73('0x1f')](function(_0x563c78){_0x18f975=_0x563c78['securePassword'];return checkPasswordPattern(_0x2f554e,_0x10d740[_0xed73('0x60')]['newPassword'],_0x18f975);});})[_0xed73('0x1f')](saveUpdates({'password':_0x10d740[_0xed73('0x60')][_0xed73('0x85')],'passwordResetAt':_0x10d740[_0xed73('0x67')]['id']==_0x10d740['params']['id']?moment():null},null))['then'](respondWithResult(_0x2219fd,null))[_0xed73('0x27')](handleError(_0x2219fd,null));};exports['addQueues']=function(_0x4d1386,_0x509104,_0x1319f6){var _0x50d7af=_0x4d1386['body']['channel'];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x4d1386[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),_0xed73('0x3b'),_0xed73('0x8e'),'loginInPause',_0xed73('0x8f'),_0xed73('0x90')]})[_0xed73('0x1f')](handleEntityNotFound(_0x509104,null))[_0xed73('0x1f')](function(_0x20b20d){if(_0x20b20d){if(!utils[_0xed73('0x91')](_0x50d7af)){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Unknown\x20channel');}return _0x20b20d[_0xed73('0x92')+_[_0xed73('0x93')](_0x50d7af[_0xed73('0x94')]())+_0xed73('0x95')](_0x4d1386[_0xed73('0x60')][_0xed73('0x96')],{'penalty':_0x4d1386[_0xed73('0x60')][_0xed73('0x97')]||0x0})[_0xed73('0x98')](function(_0x4dac07){for(var _0x4c7492=0x0;_0x4c7492<_0x4d1386[_0xed73('0x60')]['ids'][_0xed73('0x4a')];_0x4c7492+=0x1){var _0x114cd7={'UserId':_0x4d1386[_0xed73('0x59')]['id']};_0x114cd7[_[_0xed73('0x93')](_0x50d7af['toLowerCase']())+'QueueId']=_0x4d1386[_0xed73('0x60')][_0xed73('0x96')][_0x4c7492];socket['emit'](_0xed73('0x67')+_[_0xed73('0x93')](_0x50d7af[_0xed73('0x94')]())+'Queue:save',_0x114cd7);}return _0x4dac07;})['then'](function(){if(_0x50d7af===_0xed73('0x99')){return db[_0xed73('0x9a')][_0xed73('0x9b')]({'where':{'id':_0x4d1386[_0xed73('0x60')][_0xed73('0x96')]||[]},'raw':!![],'attributes':['id',_0xed73('0x3d')]});}})[_0xed73('0x1f')](function(_0x256f1c){var _0x5dc60f=_0x20b20d[_0xed73('0x33')]({'plain':!![]});var _0x5dc87c=[];if(_0x50d7af==='voice'&&_0x5dc60f['role']===_0xed73('0x36')&&_0x5dc60f[_0xed73('0x8e')]){for(var _0x39bcde=0x0;_0x39bcde<_0x256f1c['length'];_0x39bcde+=0x1){_0x5dc87c['push']({'membername':_0x5dc60f[_0xed73('0x3d')],'UserId':_0x5dc60f['id'],'queue_name':_0x256f1c[_0x39bcde][_0xed73('0x3d')],'VoiceQueueId':_0x256f1c[_0x39bcde]['id'],'interface':_[_0xed73('0x6a')](_0x5dc60f[_0xed73('0x90')])?util[_0xed73('0x6b')](_0xed73('0x9c'),_0x5dc60f['name']):_0x5dc60f[_0xed73('0x90')],'paused':_0x5dc60f[_0xed73('0x8f')]||![],'penalty':_0x4d1386[_0xed73('0x60')][_0xed73('0x97')]||0x0});}return BPromise['each'](_0x5dc87c,function(_0x32c4ba){return db['UserVoiceQueueRt']['upsert'](_0x32c4ba);});}return _0x20b20d;});}})[_0xed73('0x1f')](respondWithStatusCode(_0x509104,null))[_0xed73('0x27')](handleError(_0x509104,null));};exports['removeQueues']=function(_0x17a671,_0x58e8cc,_0x1c45a1){var _0x2868d7;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x17a671[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),'role']})[_0xed73('0x1f')](handleEntityNotFound(_0x58e8cc,null))['then'](function(_0x1b1be0){if(_0x1b1be0){_0x2868d7=_0x1b1be0;if(!_0x17a671[_0xed73('0x49')][_0xed73('0x9d')]||!utils['isValidChannel'](_0x17a671[_0xed73('0x49')]['channel'])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x9e'));}return _0x1b1be0[_0xed73('0x9f')+_[_0xed73('0x93')](_0x17a671[_0xed73('0x49')][_0xed73('0x9d')][_0xed73('0x94')]())+'Queues'](_0x17a671[_0xed73('0x49')]['ids']);}})['then'](function(_0x1fd107){for(var _0x534ad5=0x0;_0x534ad5<_0x17a671[_0xed73('0x49')]['ids'][_0xed73('0x4a')];_0x534ad5+=0x1){var _0x3b3162={'UserId':_0x17a671[_0xed73('0x59')]['id']};_0x3b3162[_['capitalize'](_0x17a671[_0xed73('0x49')][_0xed73('0x9d')][_0xed73('0x94')]())+'QueueId']=_0x17a671[_0xed73('0x49')][_0xed73('0x96')][_0x534ad5];socket[_0xed73('0xa0')](_0xed73('0x67')+_[_0xed73('0x93')](_0x17a671[_0xed73('0x49')]['channel'][_0xed73('0x94')]())+_0xed73('0xa1'),_0x3b3162);}return _0x1fd107;})[_0xed73('0x1f')](function(){if(_0x17a671[_0xed73('0x49')][_0xed73('0x9d')]===_0xed73('0x99')){return db[_0xed73('0xa2')][_0xed73('0x32')]({'where':{'UserId':_0x17a671[_0xed73('0x59')]['id'],'VoiceQueueId':_0x17a671[_0xed73('0x49')][_0xed73('0x96')]},'individualHooks':!![]})['then'](function(){return _0x2868d7;});}return _0x2868d7;})[_0xed73('0x1f')](respondWithStatusCode(_0x58e8cc,null))[_0xed73('0x27')](handleError(_0x58e8cc,null));};exports[_0xed73('0xa3')]=function(_0x2bc846,_0x21df9d,_0x59dbe6){_0x2bc846['body'][_0xed73('0xa4')]=_0x2bc846[_0xed73('0xa5')][_0xed73('0xa6')];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x2bc846[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x21df9d,null))[_0xed73('0x1f')](saveUpdates(_0x2bc846[_0xed73('0x60')],null))[_0xed73('0x1f')](respondWithResult(_0x21df9d,null))[_0xed73('0x27')](handleError(_0x21df9d,null));};exports[_0xed73('0xa7')]=function(_0x5a7233,_0x448d40,_0xbdbf4){var _0xd11f2d=path[_0xed73('0xa8')](config[_0xed73('0xa9')],'server/files/images/logos/default_profile.png');return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x5a7233[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0xa4')],'raw':!![]})[_0xed73('0x1f')](handleEntityNotFound(_0x448d40,null))[_0xed73('0x1f')](function(_0x223c11){if(_0x223c11){if(_['isNil'](_0x223c11[_0xed73('0xa4')])){return _0x448d40[_0xed73('0xaa')](_0xd11f2d);}else{if(!fs['existsSync'](path['join'](config[_0xed73('0xa9')],_0xed73('0xab'),_0x223c11[_0xed73('0xa4')]))){return _0x448d40[_0xed73('0xaa')](_0xd11f2d);}return _0x448d40['download'](path[_0xed73('0xa8')](config[_0xed73('0xa9')],_0xed73('0xab'),_0x223c11['userpic']));}}})[_0xed73('0x27')](handleError(_0x448d40,null));};exports['getContacts']=function(_0x552145,_0x15d073,_0x1dfd13){var _0x3bf695={};var _0x25dc4d={};var _0x1e736a;var _0x5c5523;return db['User'][_0xed73('0xac')]({'where':{'id':_0x552145[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x15d073,null))['then'](function(_0xcaec55){if(_0xcaec55){_0x1e736a=_0xcaec55;_0x25dc4d[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xad')][_0xed73('0x42')]);_0x25dc4d['query']=_[_0xed73('0x43')](_0x552145['query']);_0x25dc4d[_0xed73('0x50')]=_['intersection'](_0x25dc4d[_0xed73('0x46')],_0x25dc4d[_0xed73('0x49')]);_0x3bf695[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x25dc4d['model'],qs['fields'](_0x552145[_0xed73('0x49')]['fields']));_0x3bf695[_0xed73('0x47')]=_0x3bf695[_0xed73('0x47')][_0xed73('0x4a')]?_0x3bf695[_0xed73('0x47')]:_0x25dc4d[_0xed73('0x46')];_0x3bf695[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x552145[_0xed73('0x49')]['sort']);_0x3bf695[_0xed73('0x4f')]=qs['filters'](_['pick'](_0x552145[_0xed73('0x49')],_0x25dc4d[_0xed73('0x50')]));if(_0x552145[_0xed73('0x49')]['filter']){_0x3bf695[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x3bf695['where'],{'$or':_[_0xed73('0x39')](_0x3bf695[_0xed73('0x47')],function(_0x52a327){var _0x887269={};_0x887269[_0x52a327]={'$like':'%'+_0x552145[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x887269;})});}_0x3bf695=_[_0xed73('0x51')]({},_0x3bf695,_0x552145[_0xed73('0xae')]);return _0x1e736a[_0xed73('0xaf')](_0x3bf695);}})[_0xed73('0x1f')](function(_0x2afa85){if(_0x2afa85){_0x5c5523=_0x2afa85[_0xed73('0x4a')];if(_0x552145[_0xed73('0x49')][_0xed73('0x4b')]('includeAll')){_0x3bf695[_0xed73('0x5d')]=[{'model':db['CmList'],'as':_0xed73('0xb0'),'required':![]},{'model':db['Tag'],'as':_0xed73('0xb1'),'attributes':['id','name','color'],'where':_0x552145[_0xed73('0x49')]['tag']?{'id':_0x552145[_0xed73('0x49')][_0xed73('0xb2')]}:undefined,'required':_0x552145[_0xed73('0x49')][_0xed73('0xb2')]?!![]:![]}];}if(!_0x552145['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x3bf695[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x552145[_0xed73('0x49')][_0xed73('0x2e')]);_0x3bf695[_0xed73('0x2d')]=qs['offset'](_0x552145['query'][_0xed73('0x2d')]);}return _0x1e736a[_0xed73('0xaf')](_0x3bf695);}})['then'](function(_0x18ef2b){if(_0x18ef2b){return _0x18ef2b?{'count':_0x5c5523,'rows':_0x18ef2b}:null;}})[_0xed73('0x1f')](respondWithResult(_0x15d073,null))[_0xed73('0x27')](handleError(_0x15d073,null));};exports[_0xed73('0xb3')]=function(_0x1baeba,_0x898308,_0x4532ec){var _0x2d500e;var _0xc4a61b;var _0x4d3488={};var _0x2e019c;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x1baeba[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),_0xed73('0x3b')]})[_0xed73('0x1f')](handleEntityNotFound(_0x898308,null))['then'](function(_0x119035){if(!utils[_0xed73('0x91')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])){throw new db[(_0xed73('0x86'))]['ValidationError'](_0xed73('0x9e'));}_0x2d500e=_0x119035;var _0x1cc9a8={};_0x1cc9a8[_0xed73('0x46')]=_[_0xed73('0x43')](db[_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+'Queue'][_0xed73('0x42')]);_0x1cc9a8[_0xed73('0x49')]=_['keys'](_0x1baeba[_0xed73('0x49')]);_0x1cc9a8['filters']=_[_0xed73('0x5b')](_0x1cc9a8[_0xed73('0x46')],_0x1cc9a8[_0xed73('0x49')]);_0x4d3488[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x1cc9a8[_0xed73('0x46')],qs['fields'](_0x1baeba[_0xed73('0x49')]['fields']));_0x4d3488['attributes']=_0x4d3488['attributes'][_0xed73('0x4a')]?_0x4d3488[_0xed73('0x47')]:_0x1cc9a8[_0xed73('0x46')];_0x4d3488[_0xed73('0x4d')]=qs['sort'](_0x1baeba['query'][_0xed73('0x4e')]);_0x4d3488[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x1baeba[_0xed73('0x49')],_0x1cc9a8['filters']));if(_0x1baeba[_0xed73('0x49')][_0xed73('0x38')]){_0x4d3488['where']=_['merge'](_0x4d3488[_0xed73('0x4f')],{'$or':_['map'](_0x4d3488[_0xed73('0x47')],function(_0x31bc64){var _0x269e61={};_0x269e61[_0x31bc64]={'$like':'%'+_0x1baeba['query']['filter']+'%'};return _0x269e61;})});}_0x4d3488=_[_0xed73('0x51')]({},_0x4d3488,_0x1baeba[_0xed73('0xae')]);switch(_0x2d500e['role']){case'admin':return db[_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0xb5')][_0xed73('0x9b')](_0x4d3488);case _0xed73('0x67'):case _0xed73('0x36'):return _0x2d500e[_0xed73('0x33')+_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0x95')](_0x4d3488);default:throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0xb6'));}})['then'](function(_0x1be691){_0x2e019c=_0x1be691[_0xed73('0x4a')];if(!_0x1baeba['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x4d3488[_0xed73('0x2e')]=qs['limit'](_0x1baeba[_0xed73('0x49')][_0xed73('0x2e')]);_0x4d3488[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x1baeba[_0xed73('0x49')][_0xed73('0x2d')]);}switch(_0x2d500e[_0xed73('0x3b')]){case _0xed73('0x66'):return db[_[_0xed73('0x93')](_0x1baeba['query']['channel'])+_0xed73('0xb5')][_0xed73('0x9b')](_0x4d3488);case _0xed73('0x67'):case _0xed73('0x36'):return _0x2d500e[_0xed73('0x33')+_['capitalize'](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0x95')](_0x4d3488);}})['then'](function(_0x4d947e){return{'count':_0x2e019c,'rows':_0x4d947e};})[_0xed73('0x1f')](respondWithResult(_0x898308,null))[_0xed73('0x27')](handleError(_0x898308,null));};exports[_0xed73('0xb7')]=function(_0x4fbfe4,_0x548dc7,_0x2248e3){var _0x18b291={};var _0x4464d8={};var _0x554865;var _0x22ca3c;return db['User']['findOne']({'where':{'id':_0x4fbfe4[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x548dc7,null))[_0xed73('0x1f')](function(_0x50a46a){if(_0x50a46a){_0x554865=_0x50a46a;_0x4464d8[_0xed73('0x46')]=_[_0xed73('0x43')](db['UserVoiceQueueRt'][_0xed73('0x42')]);_0x4464d8[_0xed73('0x49')]=_[_0xed73('0x43')](_0x4fbfe4[_0xed73('0x49')]);_0x4464d8['filters']=_[_0xed73('0x5b')](_0x4464d8[_0xed73('0x46')],_0x4464d8[_0xed73('0x49')]);_0x18b291[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x4464d8['model'],qs['fields'](_0x4fbfe4['query'][_0xed73('0x48')]));_0x18b291['attributes']=_0x18b291[_0xed73('0x47')][_0xed73('0x4a')]?_0x18b291[_0xed73('0x47')]:_0x4464d8['model'];_0x18b291[_0xed73('0x4d')]=qs['sort'](_0x4fbfe4[_0xed73('0x49')][_0xed73('0x4e')]);_0x18b291['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x4fbfe4[_0xed73('0x49')],_0x4464d8['filters']));if(_0x4fbfe4[_0xed73('0x49')][_0xed73('0x38')]){_0x18b291[_0xed73('0x4f')]=_['merge'](_0x18b291[_0xed73('0x4f')],{'$or':_['map'](_0x18b291[_0xed73('0x47')],function(_0x2a2caf){var _0x679991={};_0x679991[_0x2a2caf]={'$like':'%'+_0x4fbfe4[_0xed73('0x49')]['filter']+'%'};return _0x679991;})});}_0x18b291=_['merge']({},_0x18b291,_0x4fbfe4['options']);return _0x554865[_0xed73('0xb7')](_0x18b291);}})[_0xed73('0x1f')](function(_0xac6cc5){if(_0xac6cc5){_0x22ca3c=_0xac6cc5['length'];if(!_0x4fbfe4[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x18b291[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x4fbfe4['query']['limit']);_0x18b291[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x4fbfe4[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x554865[_0xed73('0xb7')](_0x18b291);}})[_0xed73('0x1f')](function(_0x5740d4){if(_0x5740d4){return _0x5740d4?{'count':_0x22ca3c,'rows':_0x5740d4}:null;}})[_0xed73('0x1f')](respondWithResult(_0x548dc7,null))[_0xed73('0x27')](handleError(_0x548dc7,null));};exports[_0xed73('0xb8')]=function(_0x4f328b,_0x3389ec,_0x33a064){var _0x1114fc={};var _0xc1996f={};var _0x390441;var _0x418e10;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x4f328b[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3389ec,null))[_0xed73('0x1f')](function(_0x5510f1){if(_0x5510f1){_0x390441=_0x5510f1;_0xc1996f['model']=_[_0xed73('0x43')](db[_0xed73('0xb9')][_0xed73('0x42')]);_0xc1996f[_0xed73('0x49')]=_['keys'](_0x4f328b[_0xed73('0x49')]);_0xc1996f[_0xed73('0x50')]=_[_0xed73('0x5b')](_0xc1996f[_0xed73('0x46')],_0xc1996f[_0xed73('0x49')]);_0x1114fc[_0xed73('0x47')]=_[_0xed73('0x5b')](_0xc1996f[_0xed73('0x46')],qs[_0xed73('0x48')](_0x4f328b[_0xed73('0x49')][_0xed73('0x48')]));_0x1114fc[_0xed73('0x47')]=_0x1114fc[_0xed73('0x47')][_0xed73('0x4a')]?_0x1114fc[_0xed73('0x47')]:_0xc1996f[_0xed73('0x46')];_0x1114fc['order']=qs[_0xed73('0x4e')](_0x4f328b[_0xed73('0x49')][_0xed73('0x4e')]);_0x1114fc['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x4f328b[_0xed73('0x49')],_0xc1996f[_0xed73('0x50')]));if(_0x4f328b[_0xed73('0x49')][_0xed73('0x38')]){_0x1114fc['where']=_[_0xed73('0x51')](_0x1114fc[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x1114fc[_0xed73('0x47')],function(_0x3fd3ed){var _0x2b9e86={};_0x2b9e86[_0x3fd3ed]={'$like':'%'+_0x4f328b['query'][_0xed73('0x38')]+'%'};return _0x2b9e86;})});}_0x1114fc=_[_0xed73('0x51')]({},_0x1114fc,_0x4f328b[_0xed73('0xae')]);return _0x390441['getGroups'](_0x1114fc);}})['then'](function(_0x3f2535){if(_0x3f2535){_0x418e10=_0x3f2535[_0xed73('0x4a')];if(!_0x4f328b['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x1114fc[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x4f328b[_0xed73('0x49')][_0xed73('0x2e')]);_0x1114fc['offset']=qs['offset'](_0x4f328b['query']['offset']);}return _0x390441[_0xed73('0xb8')](_0x1114fc);}})[_0xed73('0x1f')](function(_0x115bde){if(_0x115bde){return _0x115bde?{'count':_0x418e10,'rows':_0x115bde}:null;}})['then'](respondWithResult(_0x3389ec,null))['catch'](handleError(_0x3389ec,null));};exports[_0xed73('0xba')]=function(_0x26e6ae,_0x490432,_0x257f2e){var _0x117776={'raw':!![],'where':{}};var _0x531f3c={};var _0x262d94={'count':0x0,'rows':[]};return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x26e6ae[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x490432,null))[_0xed73('0x1f')](function(_0x4e33d7){if(_0x4e33d7){_0x531f3c[_0xed73('0x46')]=_[_0xed73('0x43')](db['VoiceRecording'][_0xed73('0x42')]);_0x531f3c[_0xed73('0x49')]=_[_0xed73('0x43')](_0x26e6ae[_0xed73('0x49')]);_0x531f3c[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x531f3c[_0xed73('0x46')],_0x531f3c[_0xed73('0x49')]);_0x117776[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x531f3c[_0xed73('0x46')],qs[_0xed73('0x48')](_0x26e6ae[_0xed73('0x49')]['fields']));_0x117776[_0xed73('0x47')]=_0x117776['attributes'][_0xed73('0x4a')]?_0x117776[_0xed73('0x47')]:_0x531f3c['model'];if(!_0x26e6ae[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0x117776['limit']=qs['limit'](_0x26e6ae['query']['limit']);_0x117776[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x26e6ae[_0xed73('0x49')][_0xed73('0x2d')]);}_0x117776[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x26e6ae['query'][_0xed73('0x4e')]);_0x117776[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x26e6ae[_0xed73('0x49')],_0x531f3c[_0xed73('0x50')]));_0x117776[_0xed73('0x4f')][_0xed73('0xbb')]=_0x4e33d7['id'];if(_0x26e6ae[_0xed73('0x49')][_0xed73('0x38')]){_0x117776[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x117776['where'],{'$or':_[_0xed73('0x39')](_0x117776[_0xed73('0x47')],function(_0x5b0401){var _0x3c94c4={};_0x3c94c4[_0x5b0401]={'$like':'%'+_0x26e6ae[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x3c94c4;})});}_0x117776=_[_0xed73('0x51')]({},_0x117776,_0x26e6ae[_0xed73('0xae')]);return db[_0xed73('0xbc')][_0xed73('0x2c')]({'where':_0x117776['where']})[_0xed73('0x1f')](function(_0x2b2429){_0x262d94[_0xed73('0x2c')]=_0x2b2429;if(_0x26e6ae[_0xed73('0x49')][_0xed73('0x5c')]){_0x117776[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xbc')][_0xed73('0x9b')](_0x117776);})['then'](function(_0x299cb2){_0x262d94[_0xed73('0x57')]=_0x299cb2;return _0x262d94;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x490432,_0x117776))[_0xed73('0x27')](handleError(_0x490432,null));};exports[_0xed73('0xbd')]=function(_0x564f59,_0x26907b,_0x35bda2){var _0x2ef911={'raw':!![],'where':{}};var _0x53dabc={};var _0x555d44={'count':0x0,'rows':[]};return db[_0xed73('0x56')]['findOne']({'where':{'id':_0x564f59[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x26907b,null))['then'](function(_0x5498bd){if(_0x5498bd){_0x53dabc['model']=_[_0xed73('0x43')](db[_0xed73('0xbe')][_0xed73('0x42')]);_0x53dabc[_0xed73('0x49')]=_['keys'](_0x564f59['query']);_0x53dabc[_0xed73('0x50')]=_['intersection'](_0x53dabc['model'],_0x53dabc[_0xed73('0x49')]);_0x2ef911['attributes']=_[_0xed73('0x5b')](_0x53dabc[_0xed73('0x46')],qs[_0xed73('0x48')](_0x564f59[_0xed73('0x49')][_0xed73('0x48')]));_0x2ef911['attributes']=_0x2ef911[_0xed73('0x47')][_0xed73('0x4a')]?_0x2ef911[_0xed73('0x47')]:_0x53dabc[_0xed73('0x46')];if(!_0x564f59['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x2ef911['limit']=qs[_0xed73('0x2e')](_0x564f59[_0xed73('0x49')][_0xed73('0x2e')]);_0x2ef911[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x564f59[_0xed73('0x49')][_0xed73('0x2d')]);}_0x2ef911[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x564f59[_0xed73('0x49')][_0xed73('0x4e')]);_0x2ef911['where']=qs['filters'](_['pick'](_0x564f59[_0xed73('0x49')],_0x53dabc['filters']));_0x2ef911[_0xed73('0x4f')][_0xed73('0xbb')]=_0x5498bd['id'];if(_0x564f59[_0xed73('0x49')][_0xed73('0x38')]){_0x2ef911['where']=_[_0xed73('0x51')](_0x2ef911[_0xed73('0x4f')],{'$or':_['map'](_0x2ef911[_0xed73('0x47')],function(_0x2912aa){var _0x33f63e={};_0x33f63e[_0x2912aa]={'$like':'%'+_0x564f59[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x33f63e;})});}_0x2ef911=_['merge']({},_0x2ef911,_0x564f59['options']);return db[_0xed73('0xbe')][_0xed73('0x2c')]({'where':_0x2ef911['where']})[_0xed73('0x1f')](function(_0x3ea2b9){_0x555d44[_0xed73('0x2c')]=_0x3ea2b9;if(_0x564f59[_0xed73('0x49')][_0xed73('0x5c')]){_0x2ef911[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xbe')]['findAll'](_0x2ef911);})[_0xed73('0x1f')](function(_0x1173cb){_0x555d44[_0xed73('0x57')]=_0x1173cb;return _0x555d44;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x26907b,_0x2ef911))[_0xed73('0x27')](handleError(_0x26907b,null));};exports[_0xed73('0xbf')]=function(_0x2cd7ea,_0x2927a5,_0x162aba){var _0x413471={};var _0x42ae8b={};var _0xfcbad4;var _0x2fce3e;return db[_0xed73('0x56')]['findOne']({'where':{'id':_0x2cd7ea['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x2927a5,null))[_0xed73('0x1f')](function(_0x67b6bb){if(_0x67b6bb){_0xfcbad4=_0x67b6bb;_0x42ae8b['model']=_[_0xed73('0x43')](db['ChatInteraction'][_0xed73('0x42')]);_0x42ae8b['query']=_[_0xed73('0x43')](_0x2cd7ea['query']);_0x42ae8b[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x42ae8b['model'],_0x42ae8b[_0xed73('0x49')]);_0x413471['attributes']=_[_0xed73('0x5b')](_0x42ae8b[_0xed73('0x46')],qs[_0xed73('0x48')](_0x2cd7ea[_0xed73('0x49')]['fields']));_0x413471[_0xed73('0x47')]=_0x413471[_0xed73('0x47')][_0xed73('0x4a')]?_0x413471[_0xed73('0x47')]:_0x42ae8b[_0xed73('0x46')];_0x413471['order']=qs[_0xed73('0x4e')](_0x2cd7ea[_0xed73('0x49')][_0xed73('0x4e')]);_0x413471['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2cd7ea[_0xed73('0x49')],_0x42ae8b[_0xed73('0x50')]));if(_0x2cd7ea[_0xed73('0x49')][_0xed73('0x38')]){_0x413471[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x413471['where'],{'$or':_[_0xed73('0x39')](_0x413471[_0xed73('0x47')],function(_0x138f99){var _0x3d699b={};_0x3d699b[_0x138f99]={'$like':'%'+_0x2cd7ea[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x3d699b;})});}_0x413471=_[_0xed73('0x51')]({},_0x413471,_0x2cd7ea['options']);return _0xfcbad4['getChatInteractions'](_0x413471);}})[_0xed73('0x1f')](function(_0x16e734){if(_0x16e734){_0x2fce3e=_0x16e734['length'];if(!_0x2cd7ea['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x413471['limit']=qs['limit'](_0x2cd7ea[_0xed73('0x49')][_0xed73('0x2e')]);_0x413471['offset']=qs[_0xed73('0x2d')](_0x2cd7ea[_0xed73('0x49')]['offset']);}return _0xfcbad4['getChatInteractions'](_0x413471);}})[_0xed73('0x1f')](function(_0xde401){if(_0xde401){return _0xde401?{'count':_0x2fce3e,'rows':_0xde401}:null;}})[_0xed73('0x1f')](respondWithResult(_0x2927a5,null))[_0xed73('0x27')](handleError(_0x2927a5,null));};exports[_0xed73('0xc0')]=function(_0x2f97f4,_0x21cd8a,_0x2d7be7){var _0x26c473={};var _0x293d0e={};var _0x48735b;var _0xd0f2e8;return db['User'][_0xed73('0xac')]({'where':{'id':_0x2f97f4[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x21cd8a,null))['then'](function(_0x45d9db){if(_0x45d9db){_0x48735b=_0x45d9db;_0x293d0e[_0xed73('0x46')]=_[_0xed73('0x43')](db['OpenchannelInteraction'][_0xed73('0x42')]);_0x293d0e[_0xed73('0x49')]=_[_0xed73('0x43')](_0x2f97f4[_0xed73('0x49')]);_0x293d0e[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x293d0e[_0xed73('0x46')],_0x293d0e[_0xed73('0x49')]);_0x26c473[_0xed73('0x47')]=_['intersection'](_0x293d0e[_0xed73('0x46')],qs[_0xed73('0x48')](_0x2f97f4['query'][_0xed73('0x48')]));_0x26c473[_0xed73('0x47')]=_0x26c473[_0xed73('0x47')][_0xed73('0x4a')]?_0x26c473['attributes']:_0x293d0e[_0xed73('0x46')];_0x26c473[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2f97f4['query'][_0xed73('0x4e')]);_0x26c473[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x2f97f4['query'],_0x293d0e[_0xed73('0x50')]));if(_0x2f97f4[_0xed73('0x49')][_0xed73('0x38')]){_0x26c473[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x26c473[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x26c473['attributes'],function(_0x4c51d8){var _0x19a672={};_0x19a672[_0x4c51d8]={'$like':'%'+_0x2f97f4[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x19a672;})});}_0x26c473=_[_0xed73('0x51')]({},_0x26c473,_0x2f97f4[_0xed73('0xae')]);return _0x48735b[_0xed73('0xc0')](_0x26c473);}})['then'](function(_0x3b6db6){if(_0x3b6db6){_0xd0f2e8=_0x3b6db6[_0xed73('0x4a')];if(!_0x2f97f4['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x26c473[_0xed73('0x2e')]=qs['limit'](_0x2f97f4[_0xed73('0x49')][_0xed73('0x2e')]);_0x26c473[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x2f97f4[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x48735b[_0xed73('0xc0')](_0x26c473);}})[_0xed73('0x1f')](function(_0x3d3b35){if(_0x3d3b35){return _0x3d3b35?{'count':_0xd0f2e8,'rows':_0x3d3b35}:null;}})['then'](respondWithResult(_0x21cd8a,null))[_0xed73('0x27')](handleError(_0x21cd8a,null));};exports[_0xed73('0xc1')]=function(_0x5dc2c8,_0x26e44a,_0x386a7b){var _0x1f6fcd={'raw':!![],'where':{}};var _0x179a47={};var _0x34d0e5={'count':0x0,'rows':[]};return db['User'][_0xed73('0xac')]({'where':{'id':_0x5dc2c8['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x26e44a,null))[_0xed73('0x1f')](function(_0x1ec1ce){if(_0x1ec1ce){_0x179a47[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc2')][_0xed73('0x42')]);_0x179a47['query']=_[_0xed73('0x43')](_0x5dc2c8[_0xed73('0x49')]);_0x179a47[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x179a47[_0xed73('0x46')],_0x179a47[_0xed73('0x49')]);_0x1f6fcd[_0xed73('0x47')]=_['intersection'](_0x179a47[_0xed73('0x46')],qs[_0xed73('0x48')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x48')]));_0x1f6fcd[_0xed73('0x47')]=_0x1f6fcd['attributes']['length']?_0x1f6fcd[_0xed73('0x47')]:_0x179a47[_0xed73('0x46')];if(!_0x5dc2c8['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x1f6fcd[_0xed73('0x2e')]=qs['limit'](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x2e')]);_0x1f6fcd[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x2d')]);}_0x1f6fcd[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x4e')]);_0x1f6fcd[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x5dc2c8['query'],_0x179a47[_0xed73('0x50')]));_0x1f6fcd[_0xed73('0x4f')][_0xed73('0xbb')]=_0x1ec1ce['id'];if(_0x5dc2c8[_0xed73('0x49')][_0xed73('0x38')]){_0x1f6fcd[_0xed73('0x4f')]=_['merge'](_0x1f6fcd[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x1f6fcd[_0xed73('0x47')],function(_0x2b9ac6){var _0x281858={};_0x281858[_0x2b9ac6]={'$like':'%'+_0x5dc2c8[_0xed73('0x49')]['filter']+'%'};return _0x281858;})});}_0x1f6fcd=_[_0xed73('0x51')]({},_0x1f6fcd,_0x5dc2c8[_0xed73('0xae')]);return db[_0xed73('0xc2')][_0xed73('0x2c')]({'where':_0x1f6fcd['where']})[_0xed73('0x1f')](function(_0x5a5f47){_0x34d0e5[_0xed73('0x2c')]=_0x5a5f47;if(_0x5dc2c8[_0xed73('0x49')]['includeAll']){_0x1f6fcd[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xc2')][_0xed73('0x9b')](_0x1f6fcd);})[_0xed73('0x1f')](function(_0x2a48f4){_0x34d0e5[_0xed73('0x57')]=_0x2a48f4;return _0x34d0e5;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x26e44a,_0x1f6fcd))[_0xed73('0x27')](handleError(_0x26e44a,null));};exports[_0xed73('0xc3')]=function(_0x269ef5,_0x361e98,_0x4037bc){var _0x37cb67={};var _0x13e2f9={};var _0x131f11;var _0x2158fc;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x269ef5[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x361e98,null))['then'](function(_0xc29326){if(_0xc29326){_0x131f11=_0xc29326;_0x13e2f9[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc4')][_0xed73('0x42')]);_0x13e2f9[_0xed73('0x49')]=_[_0xed73('0x43')](_0x269ef5[_0xed73('0x49')]);_0x13e2f9[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x13e2f9[_0xed73('0x46')],_0x13e2f9['query']);_0x37cb67[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x13e2f9[_0xed73('0x46')],qs[_0xed73('0x48')](_0x269ef5[_0xed73('0x49')][_0xed73('0x48')]));_0x37cb67[_0xed73('0x47')]=_0x37cb67[_0xed73('0x47')]['length']?_0x37cb67[_0xed73('0x47')]:_0x13e2f9[_0xed73('0x46')];_0x37cb67[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x269ef5[_0xed73('0x49')][_0xed73('0x4e')]);_0x37cb67[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x269ef5[_0xed73('0x49')],_0x13e2f9[_0xed73('0x50')]));if(_0x269ef5[_0xed73('0x49')][_0xed73('0x38')]){_0x37cb67[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x37cb67[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x37cb67[_0xed73('0x47')],function(_0x568556){var _0x291004={};_0x291004[_0x568556]={'$like':'%'+_0x269ef5[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x291004;})});}_0x37cb67=_[_0xed73('0x51')]({},_0x37cb67,_0x269ef5[_0xed73('0xae')]);return _0x131f11[_0xed73('0xc3')](_0x37cb67);}})[_0xed73('0x1f')](function(_0x4541b8){if(_0x4541b8){_0x2158fc=_0x4541b8[_0xed73('0x4a')];if(!_0x269ef5[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x37cb67[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x269ef5[_0xed73('0x49')][_0xed73('0x2e')]);_0x37cb67['offset']=qs[_0xed73('0x2d')](_0x269ef5['query'][_0xed73('0x2d')]);}return _0x131f11[_0xed73('0xc3')](_0x37cb67);}})[_0xed73('0x1f')](function(_0x2b0d0c){if(_0x2b0d0c){return _0x2b0d0c?{'count':_0x2158fc,'rows':_0x2b0d0c}:null;}})[_0xed73('0x1f')](respondWithResult(_0x361e98,null))[_0xed73('0x27')](handleError(_0x361e98,null));};exports[_0xed73('0xc5')]=function(_0x1f275f,_0x99f59f,_0x465356){var _0x43bd23={};var _0xd6d0df={};var _0x5efef8;var _0x2e774b;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x1f275f[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x99f59f,null))[_0xed73('0x1f')](function(_0x41e054){if(_0x41e054){_0x5efef8=_0x41e054;_0xd6d0df[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc6')][_0xed73('0x42')]);_0xd6d0df['query']=_[_0xed73('0x43')](_0x1f275f[_0xed73('0x49')]);_0xd6d0df[_0xed73('0x50')]=_[_0xed73('0x5b')](_0xd6d0df[_0xed73('0x46')],_0xd6d0df[_0xed73('0x49')]);_0x43bd23[_0xed73('0x47')]=_[_0xed73('0x5b')](_0xd6d0df[_0xed73('0x46')],qs['fields'](_0x1f275f[_0xed73('0x49')][_0xed73('0x48')]));_0x43bd23[_0xed73('0x47')]=_0x43bd23[_0xed73('0x47')][_0xed73('0x4a')]?_0x43bd23[_0xed73('0x47')]:_0xd6d0df['model'];_0x43bd23[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x1f275f[_0xed73('0x49')][_0xed73('0x4e')]);_0x43bd23[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x1f275f[_0xed73('0x49')],_0xd6d0df[_0xed73('0x50')]));if(_0x1f275f[_0xed73('0x49')][_0xed73('0x38')]){_0x43bd23[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x43bd23[_0xed73('0x4f')],{'$or':_['map'](_0x43bd23[_0xed73('0x47')],function(_0x308204){var _0x4055d9={};_0x4055d9[_0x308204]={'$like':'%'+_0x1f275f[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x4055d9;})});}_0x43bd23=_[_0xed73('0x51')]({},_0x43bd23,_0x1f275f['options']);return _0x5efef8['getFaxInteractions'](_0x43bd23);}})['then'](function(_0x2bc6e4){if(_0x2bc6e4){_0x2e774b=_0x2bc6e4[_0xed73('0x4a')];if(!_0x1f275f[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0x43bd23[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x1f275f[_0xed73('0x49')][_0xed73('0x2e')]);_0x43bd23['offset']=qs[_0xed73('0x2d')](_0x1f275f['query'][_0xed73('0x2d')]);}return _0x5efef8[_0xed73('0xc5')](_0x43bd23);}})[_0xed73('0x1f')](function(_0x59e22e){if(_0x59e22e){return _0x59e22e?{'count':_0x2e774b,'rows':_0x59e22e}:null;}})[_0xed73('0x1f')](respondWithResult(_0x99f59f,null))['catch'](handleError(_0x99f59f,null));};exports[_0xed73('0xc7')]=function(_0x19fb26,_0x38e807,_0x8c0b46){var _0x125b60;var _0x1e8736;var _0x417c25;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x19fb26[_0xed73('0x59')]['id'],'role':'agent'},'attributes':['id',_0xed73('0x3d'),_0xed73('0xc8'),'mobile',_0xed73('0x3b'),_0xed73('0x71'),'loginInPause']})['then'](handleEntityNotFound(_0x38e807,null))[_0xed73('0x1f')](function(_0x482a9c){if(_0x482a9c){_0x125b60=_0x482a9c;if(_0x19fb26['body'][_0xed73('0x90')]){_0x417c25=util['format']('LOCAL/%s@from-sip/n',_0x125b60[_0x19fb26[_0xed73('0x60')][_0xed73('0x90')]]);}else if(_0x19fb26[_0xed73('0x60')]['intrf']){_0x417c25=util[_0xed73('0x6b')](_0xed73('0x9c'),_0x19fb26[_0xed73('0x60')][_0xed73('0xc9')]);}else{_0x417c25=util['format'](_0xed73('0x9c'),_0x125b60[_0xed73('0x3d')]);}socket['to'](util['format'](_0xed73('0xca'),_0x125b60['name']))['emit']('user:forcelogout',{'ip':_0x19fb26['headers'][_0xed73('0xcb')]||_0x19fb26[_0xed73('0xcc')][_0xed73('0xcd')]||_0x19fb26[_0xed73('0xce')][_0xed73('0xcd')]||_0x19fb26['connection']['socket']['remoteAddress']});return db[_0xed73('0xa2')]['destroy']({'where':{'membername':_0x125b60[_0xed73('0x3d')]},'individualHooks':!![]});}})[_0xed73('0x1f')](function(_0x4c44ef){if(_0x125b60){return _0x125b60[_0xed73('0xcf')]({'raw':!![]});}})[_0xed73('0x1f')](function(_0x1862ed){var _0x203980=[];if(_0x1862ed){_0x1e8736=_0x1862ed;if(_0x1e8736['length']){for(var _0x3a4aa5=0x0;_0x3a4aa5<_0x1e8736[_0xed73('0x4a')];_0x3a4aa5++){_0x203980[_0xed73('0xd0')]({'membername':_0x125b60['name'],'UserId':_0x125b60['id'],'queue_name':_0x1e8736[_0x3a4aa5][_0xed73('0x3d')],'VoiceQueueId':_0x1e8736[_0x3a4aa5]['id'],'interface':_0x417c25,'paused':_0x125b60['loginInPause']||![],'penalty':_0x1e8736[_0x3a4aa5][_0xed73('0xd1')]||0x0});}return BPromise[_0xed73('0xd2')](_0x203980,function(_0x8287c7){return db[_0xed73('0xa2')][_0xed73('0xd3')](_0x8287c7);});}}})['then'](function(){return db[_0xed73('0xd4')]['findAll']({'where':{'membername':_0x125b60[_0xed73('0x3d')],'exitAt':null}});})[_0xed73('0x1f')](function(_0x1f56c3){var _0x4d3940=[];_0x1f56c3['forEach'](function(_0x1c9d2a){_0x4d3940[_0xed73('0xd0')](_0x1c9d2a[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5'))}));});return BPromise['all'](_0x4d3940);})[_0xed73('0x1f')](function(){var _0x2b1b19=[];var _0x49e8c4=[];var _0x498cfe=utils[_0xed73('0xd6')]();var _0x4f7a1d={'membername':_0x125b60[_0xed73('0x3d')],'interface':_0x417c25,'enterAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'role':_0x125b60[_0xed73('0x3b')],'internal':_0x125b60[_0xed73('0x71')]};_0x498cfe['forEach'](function(_0x140f11){_0x2b1b19[_0xed73('0xd0')](_['merge']({'channel':_0x140f11,'type':_0xed73('0xd7'),'data1':_0x19fb26[_0xed73('0x60')][_0xed73('0xd8')],'data2':_0x417c25},_0x4f7a1d));if(_0x125b60[_0xed73('0xd9')]){_0x49e8c4['push'](_[_0xed73('0x51')]({'channel':_0x140f11,'type':_0xed73('0xda'),'data1':_0xed73('0xdb')},_0x4f7a1d));}});return db[_0xed73('0xd4')][_0xed73('0x5e')](_0x2b1b19[_0xed73('0xdc')](_0x49e8c4),{'individualHooks':!![]});})['then'](function(){return _0x125b60[_0xed73('0x5f')]({'online':!![],'lastLoginAt':moment()['format'](_0xed73('0xd5')),'voicePause':_0x125b60[_0xed73('0xd9')]||![],'mailPause':_0x125b60['loginInPause']||![],'chatPause':_0x125b60[_0xed73('0xd9')]||![],'faxPause':_0x125b60[_0xed73('0xd9')]||![],'smsPause':_0x125b60[_0xed73('0xd9')]||![],'openchannelPause':_0x125b60[_0xed73('0xd9')]||![],'pauseType':_0x125b60[_0xed73('0xd9')]?_0xed73('0xdb'):null,'interface':_0x417c25,'lastPauseAt':moment()['format'](_0xed73('0xd5'))});})['then'](respondWithResult(_0x38e807,null))[_0xed73('0x27')](handleError(_0x38e807,null));};exports[_0xed73('0xdd')]=function(_0x4ba230,_0x369de6,_0x4306c7){var _0x2a6c39;return db[_0xed73('0x56')]['find']({'where':{'id':_0x4ba230['params']['id'],'role':'agent'},'attributes':['id',_0xed73('0x3d'),'role']})['then'](handleEntityNotFound(_0x369de6,null))['then'](function(_0x1457eb){if(_0x1457eb){_0x2a6c39=_0x1457eb;return db[_0xed73('0xa2')][_0xed73('0x32')]({'where':{'membername':_0x2a6c39['name']},'individualHooks':!![]});}})[_0xed73('0x1f')](function(){return db['MemberReport'][_0xed73('0x9b')]({'where':{'membername':_0x2a6c39['name'],'exitAt':null}});})[_0xed73('0x1f')](function(_0x5622f0){var _0x9cc3f6=[];_0x5622f0[_0xed73('0xde')](function(_0x2a81fc){_0x9cc3f6[_0xed73('0xd0')](_0x2a81fc[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5'))}));});return BPromise[_0xed73('0xdf')](_0x9cc3f6);})[_0xed73('0x1f')](function(){return _0x2a6c39[_0xed73('0x5f')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xed73('0x1f')](respondWithResult(_0x369de6,null))[_0xed73('0x27')](handleError(_0x369de6,null));};exports[_0xed73('0xe0')]=function(_0xec8731,_0x8da06c,_0x2aed27){var _0x46e910;return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x1},{'where':{'UserId':_0xec8731[_0xed73('0x59')]['id']},'individualHooks':!![]})[_0xed73('0x1f')](function(){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0xec8731[_0xed73('0x59')]['id'],'role':_0xed73('0x36')},'attributes':['id','name',_0xed73('0x3b'),'internal',_0xed73('0x90')]});})['then'](handleEntityNotFound(_0x8da06c,null))[_0xed73('0x1f')](function(_0x62f4a2){if(_0x62f4a2){_0x46e910=_0x62f4a2;return respondWithRpcPromise(_0xed73('0xe1'),_0xed73('0xe0'),{'id':_0x46e910['id'],'name':_0x46e910[_0xed73('0x3d')],'pause':!![]});}})[_0xed73('0x1f')](function(){if(_0x46e910){return db['MemberReport'][_0xed73('0x9b')]({'where':{'membername':_0x46e910[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});}})[_0xed73('0x1f')](function(_0x2a1cc8){if(_0x2a1cc8[_0xed73('0x4a')]){var _0x368619=moment()['format'](_0xed73('0xd5'));for(var _0x271648=0x0,_0x40e62c=_0x2a1cc8['length'];_0x271648<_0x40e62c;_0x271648++){_0x2a1cc8[_0x271648][_0xed73('0xe2')]({'exitAt':_0x368619});}}})[_0xed73('0x1f')](function(){var _0x19f85c=[];var _0x1be889=utils[_0xed73('0xd6')]();_0x1be889[_0xed73('0xde')](function(_0x3dd287){_0x19f85c[_0xed73('0xd0')]({'channel':_0x3dd287,'membername':_0x46e910[_0xed73('0x3d')],'interface':_[_0xed73('0x6a')](_0x46e910['interface'])?util[_0xed73('0x6b')]('SIP/%s',_0x46e910[_0xed73('0x3d')]):_0x46e910[_0xed73('0x90')],'type':_0xed73('0xda'),'enterAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'data1':_0xec8731[_0xed73('0x60')]['type']||_0xed73('0xe3'),'role':_0x46e910[_0xed73('0x3b')],'internal':_0x46e910[_0xed73('0x71')]});});return db[_0xed73('0xd4')][_0xed73('0x5e')](_0x19f85c,{'individualHooks':!![]});})[_0xed73('0x1f')](function(){return _0x46e910['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xec8731['body'][_0xed73('0xe4')]||_0xed73('0xe3'),'lastPauseAt':moment()[_0xed73('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x8da06c,null))[_0xed73('0x27')](handleError(_0x8da06c,null));};exports[_0xed73('0xe5')]=function(_0x593172,_0xda8253,_0x340f15){var _0x4e75fc;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x593172['params']['id']},'attributes':['id','name',_0xed73('0x3b'),_0xed73('0x8f'),'mailPause',_0xed73('0xe6'),_0xed73('0xe7'),'openchannelPause',_0xed73('0xe8'),_0xed73('0xe9'),_0xed73('0xea')]})[_0xed73('0x1f')](handleEntityNotFound(_0xda8253,null))[_0xed73('0x1f')](function(_0x5d618f){if(_0x5d618f){_0x4e75fc=_0x5d618f;if(_0x593172[_0xed73('0x60')][_0xed73('0x9d')]&&!utils[_0xed73('0x91')](_0x593172[_0xed73('0x60')][_0xed73('0x9d')])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Unknown\x20channel');}switch(_0x593172[_0xed73('0x60')][_0xed73('0x9d')]){case _0xed73('0x99'):return respondWithRpcPromise(_0xed73('0xe1'),_0xed73('0xe5'),{'id':_0x4e75fc['id'],'name':_0x4e75fc[_0xed73('0x3d')],'pause':![]})[_0xed73('0x1f')](function(){return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4e75fc['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0xed73('0x3c')]({'where':{'channel':_0x593172['body'][_0xed73('0x9d')],'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});})[_0xed73('0x1f')](function(_0x27335e){if(_0x27335e){return _0x27335e[_0xed73('0x5f')]({'exitAt':moment()['format'](_0xed73('0xd5')),'data2':_0xed73('0xeb')},{'individualHooks':!![]});}return null;})[_0xed73('0x1f')](function(){return _0x4e75fc[_0xed73('0x5f')]({'voicePause':![]});});case'mail':case _0xed73('0xec'):case'fax':case _0xed73('0xed'):case _0xed73('0xee'):return db['MemberReport'][_0xed73('0x3c')]({'where':{'channel':_0x593172[_0xed73('0x60')][_0xed73('0x9d')],'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}})[_0xed73('0x1f')](function(_0x4046f4){if(_0x4046f4){return _0x4046f4['update']({'exitAt':moment()[_0xed73('0x6b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xed73('0xeb')},{'individualHooks':!![]});}return null;})[_0xed73('0x1f')](function(){var _0x2b2dbe={};_[_0xed73('0x2f')](_0x2b2dbe,util[_0xed73('0x6b')]('%s%s',_0x593172[_0xed73('0x60')][_0xed73('0x9d')],'Pause'),![]);return _0x4e75fc[_0xed73('0x5f')](_0x2b2dbe);});default:return respondWithRpcPromise('QueuePause',_0xed73('0xe5'),{'id':_0x4e75fc['id'],'name':_0x4e75fc[_0xed73('0x3d')],'pause':![]})[_0xed73('0x1f')](function(){return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4e75fc['id']}});})[_0xed73('0x1f')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});})[_0xed73('0x1f')](function(_0x51544a){var _0xf0d577=[];_0x51544a[_0xed73('0xde')](function(_0x1b695f){_0xf0d577[_0xed73('0xd0')](_0x1b695f[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'data2':_0xed73('0xeb')}));});return BPromise[_0xed73('0xdf')](_0xf0d577);})[_0xed73('0x1f')](function(){return _0x4e75fc['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xed73('0x1f')](respondWithResult(_0xda8253,null))[_0xed73('0x27')](handleError(_0xda8253,null));};exports['getTeams']=function(_0x639a07,_0x56453b,_0x3043b2){var _0x21ddf3={};var _0x5830fa={};var _0x2286bc;var _0x4ec2ba;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x639a07[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x56453b,null))[_0xed73('0x1f')](function(_0x52163a){if(_0x52163a){_0x2286bc=_0x52163a;_0x5830fa[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xef')][_0xed73('0x42')]);_0x5830fa['query']=_['keys'](_0x639a07[_0xed73('0x49')]);_0x5830fa[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x5830fa[_0xed73('0x46')],_0x5830fa[_0xed73('0x49')]);_0x21ddf3['attributes']=_[_0xed73('0x5b')](_0x5830fa[_0xed73('0x46')],qs[_0xed73('0x48')](_0x639a07[_0xed73('0x49')][_0xed73('0x48')]));_0x21ddf3[_0xed73('0x47')]=_0x21ddf3[_0xed73('0x47')][_0xed73('0x4a')]?_0x21ddf3[_0xed73('0x47')]:_0x5830fa[_0xed73('0x46')];_0x21ddf3[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x639a07[_0xed73('0x49')]['sort']);_0x21ddf3['where']=qs['filters'](_[_0xed73('0xb4')](_0x639a07[_0xed73('0x49')],_0x5830fa[_0xed73('0x50')]));if(_0x639a07[_0xed73('0x49')]['filter']){_0x21ddf3[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x21ddf3['where'],{'$or':_[_0xed73('0x39')](_0x21ddf3[_0xed73('0x47')],function(_0x11d7cf){var _0x441088={};_0x441088[_0x11d7cf]={'$like':'%'+_0x639a07['query']['filter']+'%'};return _0x441088;})});}_0x21ddf3=_[_0xed73('0x51')]({},_0x21ddf3,_0x639a07[_0xed73('0xae')]);return _0x2286bc[_0xed73('0xf0')](_0x21ddf3);}})[_0xed73('0x1f')](function(_0x1e6e73){if(_0x1e6e73){_0x4ec2ba=_0x1e6e73[_0xed73('0x4a')];if(!_0x639a07['query'][_0xed73('0x4b')]('nolimit')){_0x21ddf3[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x639a07[_0xed73('0x49')][_0xed73('0x2e')]);_0x21ddf3[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x639a07[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x2286bc[_0xed73('0xf0')](_0x21ddf3);}})[_0xed73('0x1f')](function(_0x20289f){if(_0x20289f){return _0x20289f?{'count':_0x4ec2ba,'rows':_0x20289f}:null;}})[_0xed73('0x1f')](respondWithResult(_0x56453b,null))['catch'](handleError(_0x56453b,null));};exports[_0xed73('0xf1')]=function(_0x4f9664,_0x3fd36a,_0x59d609){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x4f9664['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3fd36a,null))[_0xed73('0x1f')](function(_0x5774f7){if(_0x5774f7){return _0x5774f7[_0xed73('0xf1')](_0x4f9664[_0xed73('0x60')][_0xed73('0x96')],_[_0xed73('0x63')](_0x4f9664[_0xed73('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x3fd36a,null))[_0xed73('0x27')](handleError(_0x3fd36a,null));};exports[_0xed73('0xf2')]=function(_0x476ec0,_0x4420e9,_0x589b04){return db['User']['find']({'where':{'id':_0x476ec0[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x4420e9,null))[_0xed73('0x1f')](function(_0x2bf18e){if(_0x2bf18e){return _0x2bf18e['removeTeams'](_0x476ec0[_0xed73('0x49')]['ids']);}})[_0xed73('0x1f')](respondWithStatusCode(_0x4420e9,null))[_0xed73('0x27')](handleError(_0x4420e9,null));};exports[_0xed73('0xf3')]=function(_0x2df8dd,_0x1beb3e,_0x2c26ce){var _0x889d36={};var _0x4a15df={};var _0x2305f0;var _0x546a75;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x2df8dd['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x1beb3e,null))[_0xed73('0x1f')](function(_0x10c8ee){if(_0x10c8ee){_0x2305f0=_0x10c8ee;_0x4a15df['model']=_[_0xed73('0x43')](db['CmList'][_0xed73('0x42')]);_0x4a15df[_0xed73('0x49')]=_[_0xed73('0x43')](_0x2df8dd[_0xed73('0x49')]);_0x4a15df[_0xed73('0x50')]=_['intersection'](_0x4a15df[_0xed73('0x46')],_0x4a15df[_0xed73('0x49')]);_0x889d36[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x4a15df[_0xed73('0x46')],qs['fields'](_0x2df8dd[_0xed73('0x49')][_0xed73('0x48')]));_0x889d36[_0xed73('0x47')]=_0x889d36[_0xed73('0x47')][_0xed73('0x4a')]?_0x889d36[_0xed73('0x47')]:_0x4a15df[_0xed73('0x46')];_0x889d36[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2df8dd[_0xed73('0x49')][_0xed73('0x4e')]);_0x889d36[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2df8dd[_0xed73('0x49')],_0x4a15df['filters']));if(_0x2df8dd['query'][_0xed73('0x38')]){_0x889d36['where']=_['merge'](_0x889d36[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x889d36[_0xed73('0x47')],function(_0x3252f4){var _0x564e6f={};_0x564e6f[_0x3252f4]={'$like':'%'+_0x2df8dd[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x564e6f;})});}_0x889d36=_[_0xed73('0x51')]({},_0x889d36,_0x2df8dd[_0xed73('0xae')]);return _0x2305f0[_0xed73('0xf3')](_0x889d36);}})['then'](function(_0x3cfb31){if(_0x3cfb31){_0x546a75=_0x3cfb31[_0xed73('0x4a')];if(!_0x2df8dd[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x889d36['limit']=qs['limit'](_0x2df8dd[_0xed73('0x49')][_0xed73('0x2e')]);_0x889d36[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x2df8dd[_0xed73('0x49')]['offset']);}return _0x2305f0['getLists'](_0x889d36);}})['then'](function(_0x458239){if(_0x458239){return _0x458239?{'count':_0x546a75,'rows':_0x458239}:null;}})[_0xed73('0x1f')](respondWithResult(_0x1beb3e,null))['catch'](handleError(_0x1beb3e,null));};exports[_0xed73('0xf4')]=function(_0x2ccae1,_0x222d34,_0x41f8e2){var _0x4d4cf8={};var _0x597e85={};var _0x1eec66;var _0x4b180a;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x2ccae1[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x222d34,null))[_0xed73('0x1f')](function(_0x1fa8aa){if(_0x1fa8aa){_0x1eec66=_0x1fa8aa;_0x597e85[_0xed73('0x46')]=_[_0xed73('0x43')](db['User'][_0xed73('0x42')]);_0x597e85[_0xed73('0x49')]=_['keys'](_0x2ccae1['query']);_0x597e85[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x597e85[_0xed73('0x46')],_0x597e85[_0xed73('0x49')]);_0x4d4cf8['attributes']=_['intersection'](_0x597e85['model'],qs['fields'](_0x2ccae1[_0xed73('0x49')][_0xed73('0x48')]));_0x4d4cf8[_0xed73('0x47')]=_0x4d4cf8[_0xed73('0x47')][_0xed73('0x4a')]?_0x4d4cf8[_0xed73('0x47')]:_0x597e85['model'];_0x4d4cf8[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2ccae1[_0xed73('0x49')]['sort']);_0x4d4cf8[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2ccae1[_0xed73('0x49')],_0x597e85[_0xed73('0x50')]));if(_0x2ccae1[_0xed73('0x49')][_0xed73('0x38')]){_0x4d4cf8['where']=_['merge'](_0x4d4cf8[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x4d4cf8[_0xed73('0x47')],function(_0x477cb1){var _0x2edca5={};_0x2edca5[_0x477cb1]={'$like':'%'+_0x2ccae1[_0xed73('0x49')]['filter']+'%'};return _0x2edca5;})});}_0x4d4cf8[_0xed73('0x46')]=db[_0xed73('0x56')];_0x4d4cf8['as']=_0xed73('0x35');_0x4d4cf8=_[_0xed73('0x51')]({},_0x4d4cf8,_0x2ccae1[_0xed73('0xae')]);return _0x1eec66[_0xed73('0xcf')]({'include':[_0x4d4cf8]});}})[_0xed73('0x1f')](function(_0x4188f4){if(_0x4188f4){var _0x2e3d6d={},_0x57df59=[],_0x6649ef=0x0;for(var _0x1f78ef=0x0;_0x1f78ef<_0x4188f4['length'];_0x1f78ef+=0x1){for(var _0xccf836=0x0,_0x552308;_0xccf836<_0x4188f4[_0x1f78ef][_0xed73('0x35')]['length'];_0xccf836+=0x1){_0x552308=_0x4188f4[_0x1f78ef][_0xed73('0x35')][_0xccf836][_0xed73('0x33')]({'plain':!![]});_0x2e3d6d[_0x552308['id']]=_0x552308;}}_0x2e3d6d=_['values'](_0x2e3d6d);for(var _0x443adc=qs[_0xed73('0x2d')](_0x2ccae1[_0xed73('0x49')][_0xed73('0x2d')]);_0x443adc<_0x2e3d6d[_0xed73('0x4a')]&&_0x57df59[_0xed73('0x4a')]=_0x587d42){_0x32863a=_0x587d42;_0x23dc8b=0xc8;}else{_0x23dc8b=0xce;}_0x2591aa['status'](_0x23dc8b);return _0x2591aa[_0x1ae2('0x34')](_0x1ae2('0x35'),_0x136b94+'-'+_0x32863a+'/'+_0x587d42)[_0x1ae2('0x31')](_0x3707cf);}return null;};}function patchUpdates(_0x593555){return function(_0x4f8193){try{jsonpatch[_0x1ae2('0x36')](_0x4f8193,_0x593555,!![]);}catch(_0x4390e8){return BPromise['reject'](_0x4390e8);}return _0x4f8193[_0x1ae2('0x37')]();};}function saveUpdates(_0x32bc8a,_0x5634c5){return function(_0x41e197){if(_0x41e197){return _0x41e197[_0x1ae2('0x38')](_0x32bc8a)[_0x1ae2('0x22')](function(_0x1d118d){return _0x1d118d;});}return null;};}function removeEntity(_0x526d17,_0x553694){return function(_0x30b3fd){if(_0x30b3fd){return _0x30b3fd[_0x1ae2('0x39')]()[_0x1ae2('0x22')](function(){var _0x2bde1e=_0x30b3fd[_0x1ae2('0x3a')]({'plain':!![]});var _0x17965a=[{'name':_0x1ae2('0x3b'),'value':_0x1ae2('0x3c'),'ignore':!![]},{'name':_0x1ae2('0x3d'),'value':_0x1ae2('0x3e'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x2bd6fb=_(_0x17965a)[_0x1ae2('0x3f')](_0x1ae2('0x40'))[_0x1ae2('0x41')](_0x1ae2('0x42'))[_0x1ae2('0x42')]();if(_[_0x1ae2('0x43')](_0x2bd6fb,_0x2bde1e[_0x1ae2('0x44')])){return;}var _0x2ed9ce=_[_0x1ae2('0x45')](_0x17965a,['value',_0x2bde1e[_0x1ae2('0x44')]])['name'];return db[_0x1ae2('0x46')][_0x1ae2('0x39')]({'where':{'type':_0x2ed9ce,'resourceId':_0x2bde1e['id']}})[_0x1ae2('0x22')](function(){return _0x30b3fd;});})[_0x1ae2('0x22')](function(){_0x526d17[_0x1ae2('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2398fc,_0x565a0b){return function(_0xecb5f2){if(!_0xecb5f2){_0x2398fc[_0x1ae2('0x2e')](0x194);}return _0xecb5f2;};}function handleError(_0x2339f9,_0x3e2566){_0x3e2566=_0x3e2566||0x1f4;return function(_0x15a558){logger[_0x1ae2('0x29')](_0x15a558[_0x1ae2('0x47')]);if(_0x15a558[_0x1ae2('0x48')]){delete _0x15a558['name'];}_0x2339f9[_0x1ae2('0x30')](_0x3e2566)[_0x1ae2('0x49')](_0x15a558);};}exports['index']=function(_0x206718,_0x23e5ea){var _0x1956ef={},_0x24fe93={},_0x5b5227={'count':0x0,'rows':[]};var _0xa29bd6=db[_0x1ae2('0x4a')]['rawAttributes'];_0x24fe93[_0x1ae2('0x4b')]=_[_0x1ae2('0x4c')](_['keys'](_0xa29bd6),['password',_0x1ae2('0x4d')]);_0x24fe93[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x206718[_0x1ae2('0x4e')]);_0x24fe93[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x24fe93['model'],_0x24fe93[_0x1ae2('0x4e')]);_0x1956ef[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x24fe93[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x206718['query'][_0x1ae2('0x53')]));_0x1956ef[_0x1ae2('0x52')]=_0x1956ef[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x1956ef[_0x1ae2('0x52')]:_0x24fe93[_0x1ae2('0x4b')];if(!_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x1956ef[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x1956ef['offset']=qs[_0x1ae2('0x32')](_0x206718['query'][_0x1ae2('0x32')]);}_0x1956ef[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x1956ef[_0x1ae2('0x58')]=qs['filters'](_['pick'](_0x206718[_0x1ae2('0x4e')],_0x24fe93[_0x1ae2('0x50')]));if(_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x1956ef[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x1956ef[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0xa29bd6,function(_0x5f1a63){return db[_0x1ae2('0x5a')][_0x1ae2('0x58')](db[_0x1ae2('0x5a')]['fn'](_0x1ae2('0x5b'),db[_0x1ae2('0x5a')][_0x1ae2('0x5c')](_0x5f1a63[_0x1ae2('0x5d')])),{'$like':db[_0x1ae2('0x5a')]['fn'](_0x1ae2('0x5b'),'%'+_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%')});})});}_0x1956ef=_[_0x1ae2('0x59')]({},_0x1956ef,_0x206718[_0x1ae2('0x5e')]);var _0x85fc96={'where':_0x1956ef['where']};return db[_0x1ae2('0x4a')][_0x1ae2('0x5f')](_0x85fc96)[_0x1ae2('0x22')](function(_0x507308){_0x5b5227[_0x1ae2('0x5f')]=_0x507308;if(_0x206718[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x1956ef[_0x1ae2('0x61')]=[{'all':!![]}];}return db[_0x1ae2('0x4a')][_0x1ae2('0x62')](_0x1956ef);})[_0x1ae2('0x22')](function(_0x470b5b){_0x5b5227[_0x1ae2('0x63')]=_0x470b5b;return _0x5b5227;})[_0x1ae2('0x22')](respondWithFilteredResult(_0x23e5ea,_0x1956ef))['catch'](handleError(_0x23e5ea,null));};exports[_0x1ae2('0x64')]=function(_0x999c58,_0x1fea33){var _0x3adced={'raw':![],'where':{'id':_0x999c58[_0x1ae2('0x65')]['id']}},_0x521d87={};_0x521d87[_0x1ae2('0x4b')]=_['differenceBy'](_[_0x1ae2('0x4f')](db[_0x1ae2('0x4a')][_0x1ae2('0x66')]),[_0x1ae2('0x67'),_0x1ae2('0x4d')]);_0x521d87[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x999c58['query']);_0x521d87[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x521d87['model'],_0x521d87[_0x1ae2('0x4e')]);_0x3adced[_0x1ae2('0x52')]=_['intersection'](_0x521d87['model'],qs[_0x1ae2('0x53')](_0x999c58[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3adced[_0x1ae2('0x52')]=_0x3adced[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3adced[_0x1ae2('0x52')]:_0x521d87[_0x1ae2('0x4b')];if(_0x999c58[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x3adced[_0x1ae2('0x61')]=[{'all':!![]}];}_0x3adced=_['merge']({},_0x3adced,_0x999c58['options']);return db['User'][_0x1ae2('0x45')](_0x3adced)['then'](handleEntityNotFound(_0x1fea33,null))[_0x1ae2('0x22')](respondWithResult(_0x1fea33,null))[_0x1ae2('0x2d')](handleError(_0x1fea33,null));};exports[_0x1ae2('0x68')]=function(_0x5ce68b,_0x14869b){return db[_0x1ae2('0x4a')][_0x1ae2('0x68')](_0x5ce68b[_0x1ae2('0x69')],{'raw':![],'individualHooks':!![]})[_0x1ae2('0x22')](respondWithResult(_0x14869b,0xc9))[_0x1ae2('0x2d')](handleError(_0x14869b,null));};exports[_0x1ae2('0x38')]=function(_0xe44647,_0xd1098a){if(_0xe44647['body']['id']){delete _0xe44647[_0x1ae2('0x69')]['id'];}delete _0xe44647['body']['role'];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0xe44647[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0xd1098a,null))[_0x1ae2('0x22')](saveUpdates(_0xe44647[_0x1ae2('0x69')],null))[_0x1ae2('0x22')](respondWithResult(_0xd1098a,null))[_0x1ae2('0x2d')](handleError(_0xd1098a,null));};exports[_0x1ae2('0x6a')]=function(_0x502f22,_0x3102af){return db[_0x1ae2('0x4a')][_0x1ae2('0x6a')]()[_0x1ae2('0x22')](respondWithResult(_0x3102af,null))[_0x1ae2('0x2d')](handleError(_0x3102af,null));};exports['addContacts']=function(_0x527b17,_0x448a20,_0xcadf2f){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x527b17[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x448a20,null))['then'](function(_0x3cb462){if(_0x3cb462){return _0x3cb462[_0x1ae2('0x6b')](_0x527b17[_0x1ae2('0x69')]['ids'],_[_0x1ae2('0x6c')](_0x527b17[_0x1ae2('0x69')],[_0x1ae2('0x6d'),'id'])||{});}})[_0x1ae2('0x22')](respondWithResult(_0x448a20,null))[_0x1ae2('0x2d')](handleError(_0x448a20,null));};var getLicense=function(_0x3114a2){return new BPromise(function(_0xf7a68,_0x4bbf30){var _0x177ea4=0x0;_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x3e')&&_0xf7a68(_0x1ae2('0x6e'));return db[_0x1ae2('0x4a')][_0x1ae2('0x5f')]({'where':{'$or':[{'role':_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x6f')?_0x1ae2('0x6f'):[_0x1ae2('0x70'),_0x1ae2('0x3c')]}]}})[_0x1ae2('0x22')](function(_0x21703e){_0x177ea4=_0x21703e;return require('../../config/license/util')[_0x1ae2('0x71')]();})[_0x1ae2('0x22')](function(_0x479bf8){var _0x1e2c55=_0x3114a2[_0x1ae2('0x69')][_0x1ae2('0x44')]==='telephone'?_0x1ae2('0x72'):'users';if(!_['isNil'](_0x479bf8[_0x1e2c55])&&_0x177ea4>=_0x479bf8[_0x1e2c55]){return _0x4bbf30({'message':_0x1ae2('0x73')});}return _0xf7a68(util[_0x1ae2('0x74')](_0x1ae2('0x75'),_0x1e2c55,_0x177ea4));})[_0x1ae2('0x2d')](function(_0x13c55c){return _0x4bbf30(_0x13c55c);});});};exports[_0x1ae2('0x76')]=function(_0x2038c3,_0x2780f1){return getLicense(_0x2038c3)[_0x1ae2('0x22')](function(_0x246258){if(!_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]){var _0x276f67;return db[_0x1ae2('0x78')][_0x1ae2('0x79')](0x1)['then'](function(_0x2207e4){_0x2207e4[_0x1ae2('0x7a')]=!![];return checkPasswordPattern(_0x2207e4,_0x2038c3[_0x1ae2('0x69')]['password'],_0x2207e4[_0x1ae2('0x7a')]);})[_0x1ae2('0x22')](function(_0x380234){_0x276f67=_0x380234[_0x1ae2('0x7b')];return db[_0x1ae2('0x4a')][_0x1ae2('0x7c')](_0x1ae2('0x77'));})[_0x1ae2('0x22')](function(_0x5e06ce){if(_[_0x1ae2('0x7d')](_0x5e06ce)){if(_0x276f67){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x276f67;}else{_0x2038c3['body'][_0x1ae2('0x77')]=0x1;}}else{if(_[_0x1ae2('0x7d')](_0x276f67)||_0x276f67==_0x5e06ce){_0x2038c3['body'][_0x1ae2('0x77')]=_0x5e06ce+0x1;}else if(_0x276f67>_0x5e06ce){_0x2038c3[_0x1ae2('0x69')]['internal']=_0x276f67;}else{return db[_0x1ae2('0x5a')][_0x1ae2('0x4e')](_0x1ae2('0x7e'),{'type':db['sequelize']['QueryTypes'][_0x1ae2('0x7f')]})[_0x1ae2('0x22')](function(_0x5ed24c){if(_0x5ed24c&&_0x5ed24c[_0x1ae2('0x54')]){for(var _0x52cfdd=0x0,_0x4819ab=_0x5ed24c[_0x1ae2('0x54')];_0x52cfdd<_0x4819ab&&_[_0x1ae2('0x7d')](_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]);_0x52cfdd++){if(_0x276f67<=_0x5ed24c[_0x52cfdd][_0x1ae2('0x80')]){_0x2038c3[_0x1ae2('0x69')]['internal']=_0x5ed24c[_0x52cfdd][_0x1ae2('0x80')];}else if(_0x276f67>_0x5ed24c[_0x52cfdd]['from']&&_0x276f67<=_0x5ed24c[_0x52cfdd]['to']){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x276f67;}}}if(_[_0x1ae2('0x7d')](_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')])){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x77')]=_0x5e06ce+0x1;}});}}});}})[_0x1ae2('0x22')](function(){if(_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x81')]){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x82')]=_0x2038c3[_0x1ae2('0x69')]['internal'];_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x83')]={'mailbox':_0x2038c3['body'][_0x1ae2('0x77')],'password':_0x2038c3[_0x1ae2('0x69')]['password'],'fullname':_0x2038c3[_0x1ae2('0x69')]['fullname'],'email':_0x2038c3[_0x1ae2('0x69')]['email']};}if(_0x2038c3[_0x1ae2('0x69')]&&_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x44')]===_0x1ae2('0x3e')){_0x2038c3[_0x1ae2('0x69')][_0x1ae2('0x84')]=['101',_0x1ae2('0x85'),_0x1ae2('0x86'),_0x1ae2('0x87'),_0x1ae2('0x88'),'105',_0x1ae2('0x89'),_0x1ae2('0x8a'),_0x1ae2('0x8b'),_0x1ae2('0x8c'),'100','111'];}return db[_0x1ae2('0x4a')][_0x1ae2('0x76')](_0x2038c3[_0x1ae2('0x69')],{'include':[{'model':db[_0x1ae2('0x83')],'as':_0x1ae2('0x83')}]});})[_0x1ae2('0x22')](function(_0x2adf64){if(_0x2038c3['body']['role']===_0x1ae2('0x3c'))return _0x2adf64;var _0x191b35=_0x2038c3[_0x1ae2('0x3c')][_0x1ae2('0x3a')]({'plain':!![]});if(!_0x191b35)throw new Error(_0x1ae2('0x8d'));if(_0x191b35[_0x1ae2('0x44')]==='user'){var _0x7d1374=_0x2adf64[_0x1ae2('0x3a')]({'plain':!![]});var _0x3527f1=[{'name':_0x1ae2('0x3d'),'value':_0x1ae2('0x3e')},{'name':_0x1ae2('0x8e'),'value':'telephone'}];var _0x471446=_['find'](_0x3527f1,[_0x1ae2('0x42'),_0x7d1374[_0x1ae2('0x44')]])[_0x1ae2('0x48')];return db[_0x1ae2('0x8f')]['find']({'where':{'name':_0x471446,'userProfileId':_0x191b35['userProfileId']},'raw':!![]})[_0x1ae2('0x22')](function(_0x27ed09){if(_0x27ed09&&_0x27ed09['autoAssociation']===0x0){return db[_0x1ae2('0x46')][_0x1ae2('0x76')]({'name':_0x7d1374[_0x1ae2('0x48')],'resourceId':_0x7d1374['id'],'type':_0x27ed09[_0x1ae2('0x48')],'sectionId':_0x27ed09['id']},{})[_0x1ae2('0x22')](function(){return _0x2adf64;});}else{return _0x2adf64;}})[_0x1ae2('0x2d')](function(_0x58fe89){logger[_0x1ae2('0x29')](_0x1ae2('0x90'),_0x58fe89);throw _0x58fe89;});}return _0x2adf64;})[_0x1ae2('0x22')](respondWithResult(_0x2780f1,0xc9))['catch'](handleError(_0x2780f1,null));};exports[_0x1ae2('0x91')]=function(_0x5c7fc0,_0x106ae1,_0x143a0e){var _0x2b6c75=![];if(_0x5c7fc0[_0x1ae2('0x69')]['id']){delete _0x5c7fc0[_0x1ae2('0x69')]['id'];}if(!_['isNil'](_0x5c7fc0[_0x1ae2('0x69')]['oldPassword'])){if(_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]===_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new Error(_0x1ae2('0x94'));}}return db['User'][_0x1ae2('0x45')]({'where':{'id':_0x5c7fc0['params']['id']}})['then'](function(_0x23d2e9){if(_0x23d2e9){if(_0x23d2e9['id']==_0x5c7fc0[_0x1ae2('0x3c')]['id']){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]||!_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x23d2e9[_0x1ae2('0x96')](_0x5c7fc0['body'][_0x1ae2('0x92')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x98'));}if(_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x92')]==_0x5c7fc0['body'][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x99'));}return _0x23d2e9;}else if(_0x5c7fc0[_0x1ae2('0x3c')][_0x1ae2('0x44')]=='admin'){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x23d2e9;}else if(_0x5c7fc0[_0x1ae2('0x3c')][_0x1ae2('0x44')]==_0x1ae2('0x3c')){if(!_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')]){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x9a'));}if(_0x23d2e9[_0x1ae2('0x44')]!=_0x1ae2('0x3e')){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0x9b'));}return _0x23d2e9;}else{throw new db[(_0x1ae2('0x95'))]['ValidationError'](_0x1ae2('0x9b'));}}return null;})['then'](handleEntityNotFound(_0x106ae1,null))[_0x1ae2('0x22')](function(_0x17f913){return db[_0x1ae2('0x78')][_0x1ae2('0x9c')]({'attributes':['id','securePassword']})[_0x1ae2('0x22')](function(_0x1dd981){_0x2b6c75=_0x1dd981[_0x1ae2('0x7a')];return checkPasswordPattern(_0x17f913,_0x5c7fc0[_0x1ae2('0x69')][_0x1ae2('0x93')],_0x2b6c75);});})[_0x1ae2('0x22')](saveUpdates({'password':_0x5c7fc0['body'][_0x1ae2('0x93')],'passwordResetAt':_0x5c7fc0[_0x1ae2('0x3c')]['id']==_0x5c7fc0[_0x1ae2('0x65')]['id']?moment():null},null))[_0x1ae2('0x22')](respondWithResult(_0x106ae1,null))[_0x1ae2('0x2d')](handleError(_0x106ae1,null));};exports['addQueues']=function(_0x429fdd,_0x228936,_0x23941a){var _0x5b2430=_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x9d')];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x429fdd[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),'role',_0x1ae2('0x9e'),_0x1ae2('0x9f'),'voicePause',_0x1ae2('0xa0')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x228936,null))[_0x1ae2('0x22')](function(_0x1c075b){if(_0x1c075b){if(!utils[_0x1ae2('0xa1')](_0x5b2430)){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}return _0x1c075b[_0x1ae2('0xa3')+_[_0x1ae2('0xa4')](_0x5b2430['toLowerCase']())+_0x1ae2('0xa5')](_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')],{'penalty':_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0xa6')]||0x0})[_0x1ae2('0xa7')](function(_0x3c618d){for(var _0x103f09=0x0;_0x103f09<_0x429fdd['body'][_0x1ae2('0x6d')][_0x1ae2('0x54')];_0x103f09+=0x1){var _0x175ad8={'UserId':_0x429fdd[_0x1ae2('0x65')]['id']};_0x175ad8[_['capitalize'](_0x5b2430[_0x1ae2('0xa8')]())+_0x1ae2('0xa9')]=_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')][_0x103f09];socket[_0x1ae2('0xaa')](_0x1ae2('0x3c')+_[_0x1ae2('0xa4')](_0x5b2430[_0x1ae2('0xa8')]())+_0x1ae2('0xab'),_0x175ad8);}return _0x3c618d;})[_0x1ae2('0x22')](function(){if(_0x5b2430==='voice'){return db[_0x1ae2('0xac')][_0x1ae2('0x62')]({'where':{'id':_0x429fdd[_0x1ae2('0x69')][_0x1ae2('0x6d')]||[]},'raw':!![],'attributes':['id',_0x1ae2('0x48')]});}})['then'](function(_0x2faed1){var _0x64a62=_0x1c075b[_0x1ae2('0x3a')]({'plain':!![]});var _0x4523fa=[];if(_0x5b2430===_0x1ae2('0xad')&&_0x64a62[_0x1ae2('0x44')]===_0x1ae2('0x3e')&&_0x64a62[_0x1ae2('0x9e')]){for(var _0xe18ba3=0x0;_0xe18ba3<_0x2faed1['length'];_0xe18ba3+=0x1){_0x4523fa[_0x1ae2('0xae')]({'membername':_0x64a62[_0x1ae2('0x48')],'UserId':_0x64a62['id'],'queue_name':_0x2faed1[_0xe18ba3][_0x1ae2('0x48')],'VoiceQueueId':_0x2faed1[_0xe18ba3]['id'],'interface':_['isNil'](_0x64a62[_0x1ae2('0xa0')])?util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x64a62[_0x1ae2('0x48')]):_0x64a62['interface'],'paused':_0x64a62[_0x1ae2('0xb0')]||![],'penalty':_0x429fdd['body'][_0x1ae2('0xa6')]||0x0});}return BPromise[_0x1ae2('0xb1')](_0x4523fa,function(_0x579d8d){return db[_0x1ae2('0xb2')][_0x1ae2('0xb3')](_0x579d8d);});}return _0x1c075b;});}})[_0x1ae2('0x22')](respondWithStatusCode(_0x228936,null))[_0x1ae2('0x2d')](handleError(_0x228936,null));};exports[_0x1ae2('0xb4')]=function(_0xe9c276,_0x4d2b80,_0x56bb8a){var _0x4cb34b;return db['User'][_0x1ae2('0x45')]({'where':{'id':_0xe9c276[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x4d2b80,null))[_0x1ae2('0x22')](function(_0x1903dc){if(_0x1903dc){_0x4cb34b=_0x1903dc;if(!_0xe9c276[_0x1ae2('0x4e')]['channel']||!utils['isValidChannel'](_0xe9c276['query'][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}return _0x1903dc[_0x1ae2('0xb5')+_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x9d')][_0x1ae2('0xa8')]())+_0x1ae2('0xa5')](_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')]);}})[_0x1ae2('0x22')](function(_0x2d5aa3){for(var _0x1a3905=0x0;_0x1a3905<_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')][_0x1ae2('0x54')];_0x1a3905+=0x1){var _0x5ebfbd={'UserId':_0xe9c276[_0x1ae2('0x65')]['id']};_0x5ebfbd[_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')]['channel'][_0x1ae2('0xa8')]())+_0x1ae2('0xa9')]=_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x6d')][_0x1a3905];socket['emit'](_0x1ae2('0x3c')+_[_0x1ae2('0xa4')](_0xe9c276[_0x1ae2('0x4e')]['channel'][_0x1ae2('0xa8')]())+'Queue:remove',_0x5ebfbd);}return _0x2d5aa3;})[_0x1ae2('0x22')](function(){if(_0xe9c276[_0x1ae2('0x4e')][_0x1ae2('0x9d')]===_0x1ae2('0xad')){return db['UserVoiceQueueRt'][_0x1ae2('0x39')]({'where':{'UserId':_0xe9c276[_0x1ae2('0x65')]['id'],'VoiceQueueId':_0xe9c276['query']['ids']},'individualHooks':!![]})[_0x1ae2('0x22')](function(){return _0x4cb34b;});}return _0x4cb34b;})['then'](respondWithStatusCode(_0x4d2b80,null))[_0x1ae2('0x2d')](handleError(_0x4d2b80,null));};exports[_0x1ae2('0xb6')]=function(_0x981575,_0x1c5931,_0x5d9e73){_0x981575['body'][_0x1ae2('0xb7')]=_0x981575[_0x1ae2('0xb8')]['filename'];return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x981575[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c5931,null))[_0x1ae2('0x22')](saveUpdates(_0x981575[_0x1ae2('0x69')],null))[_0x1ae2('0x22')](respondWithResult(_0x1c5931,null))[_0x1ae2('0x2d')](handleError(_0x1c5931,null));};exports[_0x1ae2('0xb9')]=function(_0x182953,_0x54cd9c,_0x134d20){var _0x37f4e1=path[_0x1ae2('0xba')](config[_0x1ae2('0xbb')],_0x1ae2('0xbc'));return db['User'][_0x1ae2('0x45')]({'where':{'id':_0x182953[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0xb7')],'raw':!![]})[_0x1ae2('0x22')](handleEntityNotFound(_0x54cd9c,null))[_0x1ae2('0x22')](function(_0x24bb17){if(_0x24bb17){if(_[_0x1ae2('0x7d')](_0x24bb17[_0x1ae2('0xb7')])){return _0x54cd9c[_0x1ae2('0xbd')](_0x37f4e1);}else{if(!fs['existsSync'](path['join'](config['root'],_0x1ae2('0xbe'),_0x24bb17['userpic']))){return _0x54cd9c['download'](_0x37f4e1);}return _0x54cd9c['download'](path[_0x1ae2('0xba')](config['root'],_0x1ae2('0xbe'),_0x24bb17[_0x1ae2('0xb7')]));}}})[_0x1ae2('0x2d')](handleError(_0x54cd9c,null));};exports[_0x1ae2('0xbf')]=function(_0x4343e7,_0x24aad7,_0x4de631){var _0x3b9167={};var _0x32f018={};var _0x21e7fc;var _0x6024a1;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x4343e7[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x24aad7,null))[_0x1ae2('0x22')](function(_0x5b1b06){if(_0x5b1b06){_0x21e7fc=_0x5b1b06;_0x32f018[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db['CmContact'][_0x1ae2('0x66')]);_0x32f018['query']=_[_0x1ae2('0x4f')](_0x4343e7[_0x1ae2('0x4e')]);_0x32f018[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x32f018[_0x1ae2('0x4b')],_0x32f018[_0x1ae2('0x4e')]);_0x3b9167['attributes']=_[_0x1ae2('0x51')](_0x32f018['model'],qs[_0x1ae2('0x53')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3b9167['attributes']=_0x3b9167[_0x1ae2('0x52')]['length']?_0x3b9167[_0x1ae2('0x52')]:_0x32f018[_0x1ae2('0x4b')];_0x3b9167[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x4343e7[_0x1ae2('0x4e')]['sort']);_0x3b9167['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x4343e7[_0x1ae2('0x4e')],_0x32f018[_0x1ae2('0x50')]));if(_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3b9167[_0x1ae2('0x58')]=_['merge'](_0x3b9167[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x3b9167[_0x1ae2('0x52')],function(_0x2402ce){var _0x533eb9={};_0x533eb9[_0x2402ce]={'$like':'%'+_0x4343e7['query'][_0x1ae2('0x3f')]+'%'};return _0x533eb9;})});}_0x3b9167=_[_0x1ae2('0x59')]({},_0x3b9167,_0x4343e7['options']);return _0x21e7fc[_0x1ae2('0xbf')](_0x3b9167);}})['then'](function(_0x12af75){if(_0x12af75){_0x6024a1=_0x12af75['length'];if(_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0x60'))){_0x3b9167['include']=[{'model':db['CmList'],'as':_0x1ae2('0xc1'),'required':![]},{'model':db[_0x1ae2('0xc2')],'as':_0x1ae2('0xc3'),'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0xc4')],'where':_0x4343e7['query'][_0x1ae2('0xc5')]?{'id':_0x4343e7['query'][_0x1ae2('0xc5')]}:undefined,'required':_0x4343e7['query']['tag']?!![]:![]}];}if(!_0x4343e7['query']['hasOwnProperty'](_0x1ae2('0xc6'))){_0x3b9167[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3b9167[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x4343e7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x21e7fc[_0x1ae2('0xbf')](_0x3b9167);}})[_0x1ae2('0x22')](function(_0x413c58){if(_0x413c58){return _0x413c58?{'count':_0x6024a1,'rows':_0x413c58}:null;}})['then'](respondWithResult(_0x24aad7,null))['catch'](handleError(_0x24aad7,null));};exports[_0x1ae2('0xc7')]=function(_0x53107b,_0x5853f0,_0x441499){var _0x430063;var _0x3cd564;var _0x3dcd4c={};var _0x6f9bb5;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x53107b[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x5853f0,null))[_0x1ae2('0x22')](function(_0x42671d){if(!utils[_0x1ae2('0xa1')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}_0x430063=_0x42671d;var _0x18a259={};_0x18a259[_0x1ae2('0x4b')]=_['keys'](db[_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')]['channel'])+_0x1ae2('0xc8')][_0x1ae2('0x66')]);_0x18a259[_0x1ae2('0x4e')]=_['keys'](_0x53107b[_0x1ae2('0x4e')]);_0x18a259['filters']=_['intersection'](_0x18a259[_0x1ae2('0x4b')],_0x18a259[_0x1ae2('0x4e')]);_0x3dcd4c[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x18a259['model'],qs[_0x1ae2('0x53')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x3dcd4c[_0x1ae2('0x52')]=_0x3dcd4c[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3dcd4c[_0x1ae2('0x52')]:_0x18a259[_0x1ae2('0x4b')];_0x3dcd4c[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x3dcd4c[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x53107b[_0x1ae2('0x4e')],_0x18a259[_0x1ae2('0x50')]));if(_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3dcd4c[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x3dcd4c[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x3dcd4c[_0x1ae2('0x52')],function(_0x56341a){var _0x358a37={};_0x358a37[_0x56341a]={'$like':'%'+_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x358a37;})});}_0x3dcd4c=_[_0x1ae2('0x59')]({},_0x3dcd4c,_0x53107b[_0x1ae2('0x5e')]);switch(_0x430063[_0x1ae2('0x44')]){case'admin':return db[_['capitalize'](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xc8')]['findAll'](_0x3dcd4c);case'user':case _0x1ae2('0x3e'):return _0x430063['get'+_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+'Queues'](_0x3dcd4c);default:throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xc9'));}})[_0x1ae2('0x22')](function(_0x2d8445){_0x6f9bb5=_0x2d8445[_0x1ae2('0x54')];if(!_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x3dcd4c[_0x1ae2('0x33')]=qs['limit'](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3dcd4c[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}switch(_0x430063[_0x1ae2('0x44')]){case _0x1ae2('0x70'):return db[_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xc8')][_0x1ae2('0x62')](_0x3dcd4c);case _0x1ae2('0x3c'):case'agent':return _0x430063[_0x1ae2('0x3a')+_[_0x1ae2('0xa4')](_0x53107b[_0x1ae2('0x4e')][_0x1ae2('0x9d')])+_0x1ae2('0xa5')](_0x3dcd4c);}})[_0x1ae2('0x22')](function(_0x1009e8){return{'count':_0x6f9bb5,'rows':_0x1009e8};})['then'](respondWithResult(_0x5853f0,null))[_0x1ae2('0x2d')](handleError(_0x5853f0,null));};exports['getVoiceQueuesRt']=function(_0x9922f7,_0x4d990f,_0x57f2b9){var _0x3c7614={};var _0x2d594f={};var _0xdf4935;var _0x1c39f2;return db['User'][_0x1ae2('0x9c')]({'where':{'id':_0x9922f7['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x4d990f,null))[_0x1ae2('0x22')](function(_0x34272c){if(_0x34272c){_0xdf4935=_0x34272c;_0x2d594f[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xb2')][_0x1ae2('0x66')]);_0x2d594f[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x9922f7['query']);_0x2d594f[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x2d594f[_0x1ae2('0x4b')],_0x2d594f[_0x1ae2('0x4e')]);_0x3c7614[_0x1ae2('0x52')]=_['intersection'](_0x2d594f[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x9922f7[_0x1ae2('0x4e')]['fields']));_0x3c7614['attributes']=_0x3c7614[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x3c7614[_0x1ae2('0x52')]:_0x2d594f[_0x1ae2('0x4b')];_0x3c7614[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x3c7614['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x9922f7[_0x1ae2('0x4e')],_0x2d594f[_0x1ae2('0x50')]));if(_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x3c7614['where']=_[_0x1ae2('0x59')](_0x3c7614['where'],{'$or':_['map'](_0x3c7614[_0x1ae2('0x52')],function(_0x76e7a2){var _0x45d2ee={};_0x45d2ee[_0x76e7a2]={'$like':'%'+_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x45d2ee;})});}_0x3c7614=_[_0x1ae2('0x59')]({},_0x3c7614,_0x9922f7[_0x1ae2('0x5e')]);return _0xdf4935['getVoiceQueuesRt'](_0x3c7614);}})[_0x1ae2('0x22')](function(_0x59b50a){if(_0x59b50a){_0x1c39f2=_0x59b50a[_0x1ae2('0x54')];if(!_0x9922f7[_0x1ae2('0x4e')]['hasOwnProperty'](_0x1ae2('0xc6'))){_0x3c7614[_0x1ae2('0x33')]=qs['limit'](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x3c7614[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x9922f7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0xdf4935[_0x1ae2('0xca')](_0x3c7614);}})[_0x1ae2('0x22')](function(_0x5b8823){if(_0x5b8823){return _0x5b8823?{'count':_0x1c39f2,'rows':_0x5b8823}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x4d990f,null))['catch'](handleError(_0x4d990f,null));};exports[_0x1ae2('0xcb')]=function(_0x3cb3b4,_0x5d612f,_0x3e0f0f){var _0x44f748={};var _0x5c2651={};var _0x3a6383;var _0x195299;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3cb3b4['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5d612f,null))['then'](function(_0xf42e92){if(_0xf42e92){_0x3a6383=_0xf42e92;_0x5c2651['model']=_[_0x1ae2('0x4f')](db['ChatGroup'][_0x1ae2('0x66')]);_0x5c2651[_0x1ae2('0x4e')]=_['keys'](_0x3cb3b4[_0x1ae2('0x4e')]);_0x5c2651[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x5c2651['model'],_0x5c2651[_0x1ae2('0x4e')]);_0x44f748[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x5c2651['model'],qs[_0x1ae2('0x53')](_0x3cb3b4['query'][_0x1ae2('0x53')]));_0x44f748[_0x1ae2('0x52')]=_0x44f748[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x44f748[_0x1ae2('0x52')]:_0x5c2651[_0x1ae2('0x4b')];_0x44f748['order']=qs[_0x1ae2('0x57')](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x44f748[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x3cb3b4['query'],_0x5c2651[_0x1ae2('0x50')]));if(_0x3cb3b4[_0x1ae2('0x4e')]['filter']){_0x44f748[_0x1ae2('0x58')]=_['merge'](_0x44f748['where'],{'$or':_[_0x1ae2('0x41')](_0x44f748[_0x1ae2('0x52')],function(_0x36375a){var _0x1394fb={};_0x1394fb[_0x36375a]={'$like':'%'+_0x3cb3b4['query'][_0x1ae2('0x3f')]+'%'};return _0x1394fb;})});}_0x44f748=_['merge']({},_0x44f748,_0x3cb3b4[_0x1ae2('0x5e')]);return _0x3a6383[_0x1ae2('0xcb')](_0x44f748);}})[_0x1ae2('0x22')](function(_0x5db503){if(_0x5db503){_0x195299=_0x5db503['length'];if(!_0x3cb3b4[_0x1ae2('0x4e')]['hasOwnProperty'](_0x1ae2('0xc6'))){_0x44f748[_0x1ae2('0x33')]=qs['limit'](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x44f748[_0x1ae2('0x32')]=qs['offset'](_0x3cb3b4[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x3a6383['getGroups'](_0x44f748);}})['then'](function(_0x2207ec){if(_0x2207ec){return _0x2207ec?{'count':_0x195299,'rows':_0x2207ec}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5d612f,null))['catch'](handleError(_0x5d612f,null));};exports[_0x1ae2('0xcc')]=function(_0xc5ebbd,_0x2bc980,_0xc50b48){var _0x5cf485={'raw':!![],'where':{}};var _0x3251e9={};var _0x565063={'count':0x0,'rows':[]};return db[_0x1ae2('0x4a')]['findOne']({'where':{'id':_0xc5ebbd[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x2bc980,null))['then'](function(_0x1bea83){if(_0x1bea83){_0x3251e9[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xcd')][_0x1ae2('0x66')]);_0x3251e9[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0xc5ebbd[_0x1ae2('0x4e')]);_0x3251e9['filters']=_[_0x1ae2('0x51')](_0x3251e9[_0x1ae2('0x4b')],_0x3251e9[_0x1ae2('0x4e')]);_0x5cf485[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x3251e9['model'],qs[_0x1ae2('0x53')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x5cf485[_0x1ae2('0x52')]=_0x5cf485[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x5cf485[_0x1ae2('0x52')]:_0x3251e9[_0x1ae2('0x4b')];if(!_0xc5ebbd['query'][_0x1ae2('0x55')]('nolimit')){_0x5cf485[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x5cf485['offset']=qs[_0x1ae2('0x32')](_0xc5ebbd['query'][_0x1ae2('0x32')]);}_0x5cf485[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x5cf485[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0xc5ebbd['query'],_0x3251e9[_0x1ae2('0x50')]));_0x5cf485[_0x1ae2('0x58')][_0x1ae2('0xce')]=_0x1bea83['id'];if(_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x5cf485[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x5cf485[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x5cf485[_0x1ae2('0x52')],function(_0x170dba){var _0x597c28={};_0x597c28[_0x170dba]={'$like':'%'+_0xc5ebbd[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x597c28;})});}_0x5cf485=_[_0x1ae2('0x59')]({},_0x5cf485,_0xc5ebbd[_0x1ae2('0x5e')]);return db[_0x1ae2('0xcd')][_0x1ae2('0x5f')]({'where':_0x5cf485[_0x1ae2('0x58')]})[_0x1ae2('0x22')](function(_0x56314a){_0x565063[_0x1ae2('0x5f')]=_0x56314a;if(_0xc5ebbd['query'][_0x1ae2('0x60')]){_0x5cf485[_0x1ae2('0x61')]=[{'all':!![]}];}return db['VoiceRecording'][_0x1ae2('0x62')](_0x5cf485);})[_0x1ae2('0x22')](function(_0xb08016){_0x565063[_0x1ae2('0x63')]=_0xb08016;return _0x565063;});}})['then'](respondWithFilteredResult(_0x2bc980,_0x5cf485))[_0x1ae2('0x2d')](handleError(_0x2bc980,null));};exports['getScreenRecordings']=function(_0x38eaa0,_0x26bd97,_0x65d881){var _0x420d6c={'raw':!![],'where':{}};var _0x53c434={};var _0x334846={'count':0x0,'rows':[]};return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x38eaa0[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x26bd97,null))['then'](function(_0x222545){if(_0x222545){_0x53c434[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xcf')][_0x1ae2('0x66')]);_0x53c434[_0x1ae2('0x4e')]=_['keys'](_0x38eaa0[_0x1ae2('0x4e')]);_0x53c434[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x53c434[_0x1ae2('0x4b')],_0x53c434[_0x1ae2('0x4e')]);_0x420d6c[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x53c434[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x420d6c[_0x1ae2('0x52')]=_0x420d6c[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x420d6c[_0x1ae2('0x52')]:_0x53c434[_0x1ae2('0x4b')];if(!_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x420d6c[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x420d6c['offset']=qs[_0x1ae2('0x32')](_0x38eaa0['query'][_0x1ae2('0x32')]);}_0x420d6c[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x420d6c[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x38eaa0[_0x1ae2('0x4e')],_0x53c434['filters']));_0x420d6c['where'][_0x1ae2('0xce')]=_0x222545['id'];if(_0x38eaa0['query']['filter']){_0x420d6c[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x420d6c[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x420d6c[_0x1ae2('0x52')],function(_0x33be5d){var _0x59e265={};_0x59e265[_0x33be5d]={'$like':'%'+_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x59e265;})});}_0x420d6c=_[_0x1ae2('0x59')]({},_0x420d6c,_0x38eaa0[_0x1ae2('0x5e')]);return db[_0x1ae2('0xcf')]['count']({'where':_0x420d6c['where']})[_0x1ae2('0x22')](function(_0x113489){_0x334846[_0x1ae2('0x5f')]=_0x113489;if(_0x38eaa0[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x420d6c['include']=[{'all':!![]}];}return db[_0x1ae2('0xcf')]['findAll'](_0x420d6c);})['then'](function(_0x58da09){_0x334846[_0x1ae2('0x63')]=_0x58da09;return _0x334846;});}})[_0x1ae2('0x22')](respondWithFilteredResult(_0x26bd97,_0x420d6c))[_0x1ae2('0x2d')](handleError(_0x26bd97,null));};exports[_0x1ae2('0xd0')]=function(_0x5b7c13,_0xd92e1c,_0x1840da){var _0x34fa88={};var _0x12950e={};var _0x553548;var _0x5d5bca;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x5b7c13[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0xd92e1c,null))['then'](function(_0x10ce8c){if(_0x10ce8c){_0x553548=_0x10ce8c;_0x12950e['model']=_[_0x1ae2('0x4f')](db['ChatInteraction'][_0x1ae2('0x66')]);_0x12950e[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x5b7c13[_0x1ae2('0x4e')]);_0x12950e[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x12950e[_0x1ae2('0x4b')],_0x12950e['query']);_0x34fa88['attributes']=_[_0x1ae2('0x51')](_0x12950e[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x5b7c13['query']['fields']));_0x34fa88['attributes']=_0x34fa88['attributes'][_0x1ae2('0x54')]?_0x34fa88[_0x1ae2('0x52')]:_0x12950e['model'];_0x34fa88['order']=qs['sort'](_0x5b7c13['query']['sort']);_0x34fa88[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x5b7c13[_0x1ae2('0x4e')],_0x12950e[_0x1ae2('0x50')]));if(_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x34fa88[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x34fa88['where'],{'$or':_[_0x1ae2('0x41')](_0x34fa88[_0x1ae2('0x52')],function(_0x5cd45a){var _0xf7e18={};_0xf7e18[_0x5cd45a]={'$like':'%'+_0x5b7c13['query'][_0x1ae2('0x3f')]+'%'};return _0xf7e18;})});}_0x34fa88=_[_0x1ae2('0x59')]({},_0x34fa88,_0x5b7c13['options']);return _0x553548['getChatInteractions'](_0x34fa88);}})['then'](function(_0x5ca5dd){if(_0x5ca5dd){_0x5d5bca=_0x5ca5dd['length'];if(!_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x34fa88[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x34fa88[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x5b7c13[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x553548['getChatInteractions'](_0x34fa88);}})[_0x1ae2('0x22')](function(_0xf1513f){if(_0xf1513f){return _0xf1513f?{'count':_0x5d5bca,'rows':_0xf1513f}:null;}})[_0x1ae2('0x22')](respondWithResult(_0xd92e1c,null))[_0x1ae2('0x2d')](handleError(_0xd92e1c,null));};exports[_0x1ae2('0xd1')]=function(_0x3085a1,_0x369d7a,_0x377bd7){var _0x35e526={};var _0x58d9c0={};var _0x2e7409;var _0x2c6813;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3085a1['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x369d7a,null))[_0x1ae2('0x22')](function(_0xb596b3){if(_0xb596b3){_0x2e7409=_0xb596b3;_0x58d9c0['model']=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd2')]['rawAttributes']);_0x58d9c0[_0x1ae2('0x4e')]=_['keys'](_0x3085a1['query']);_0x58d9c0[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x58d9c0['model'],_0x58d9c0[_0x1ae2('0x4e')]);_0x35e526[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x58d9c0[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x3085a1[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x35e526[_0x1ae2('0x52')]=_0x35e526[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x35e526[_0x1ae2('0x52')]:_0x58d9c0[_0x1ae2('0x4b')];_0x35e526['order']=qs['sort'](_0x3085a1[_0x1ae2('0x4e')]['sort']);_0x35e526[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x3085a1['query'],_0x58d9c0[_0x1ae2('0x50')]));if(_0x3085a1[_0x1ae2('0x4e')]['filter']){_0x35e526[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x35e526[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x35e526[_0x1ae2('0x52')],function(_0x1dabd1){var _0x4781c6={};_0x4781c6[_0x1dabd1]={'$like':'%'+_0x3085a1['query'][_0x1ae2('0x3f')]+'%'};return _0x4781c6;})});}_0x35e526=_[_0x1ae2('0x59')]({},_0x35e526,_0x3085a1[_0x1ae2('0x5e')]);return _0x2e7409[_0x1ae2('0xd1')](_0x35e526);}})[_0x1ae2('0x22')](function(_0x3c97a5){if(_0x3c97a5){_0x2c6813=_0x3c97a5['length'];if(!_0x3085a1['query'][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x35e526[_0x1ae2('0x33')]=qs['limit'](_0x3085a1[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x35e526[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x3085a1[_0x1ae2('0x4e')]['offset']);}return _0x2e7409['getOpenchannelInteractions'](_0x35e526);}})[_0x1ae2('0x22')](function(_0x180afc){if(_0x180afc){return _0x180afc?{'count':_0x2c6813,'rows':_0x180afc}:null;}})['then'](respondWithResult(_0x369d7a,null))[_0x1ae2('0x2d')](handleError(_0x369d7a,null));};exports[_0x1ae2('0xd3')]=function(_0xaa5ba0,_0x324405,_0x32e17b){var _0x50a3bf={'raw':!![],'where':{}};var _0x46a04f={};var _0x516fa7={'count':0x0,'rows':[]};return db['User'][_0x1ae2('0x9c')]({'where':{'id':_0xaa5ba0[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x324405,null))[_0x1ae2('0x22')](function(_0x343729){if(_0x343729){_0x46a04f['model']=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd4')]['rawAttributes']);_0x46a04f['query']=_[_0x1ae2('0x4f')](_0xaa5ba0[_0x1ae2('0x4e')]);_0x46a04f[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x46a04f[_0x1ae2('0x4b')],_0x46a04f[_0x1ae2('0x4e')]);_0x50a3bf[_0x1ae2('0x52')]=_['intersection'](_0x46a04f[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0xaa5ba0['query'][_0x1ae2('0x53')]));_0x50a3bf[_0x1ae2('0x52')]=_0x50a3bf[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x50a3bf[_0x1ae2('0x52')]:_0x46a04f[_0x1ae2('0x4b')];if(!_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x50a3bf[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x50a3bf[_0x1ae2('0x32')]=qs['offset'](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}_0x50a3bf[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x50a3bf['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0xaa5ba0['query'],_0x46a04f[_0x1ae2('0x50')]));_0x50a3bf[_0x1ae2('0x58')]['UserId']=_0x343729['id'];if(_0xaa5ba0['query'][_0x1ae2('0x3f')]){_0x50a3bf[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x50a3bf[_0x1ae2('0x58')],{'$or':_['map'](_0x50a3bf[_0x1ae2('0x52')],function(_0xd5c93b){var _0x3f2493={};_0x3f2493[_0xd5c93b]={'$like':'%'+_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x3f2493;})});}_0x50a3bf=_['merge']({},_0x50a3bf,_0xaa5ba0['options']);return db[_0x1ae2('0xd4')][_0x1ae2('0x5f')]({'where':_0x50a3bf['where']})['then'](function(_0x2e960b){_0x516fa7['count']=_0x2e960b;if(_0xaa5ba0[_0x1ae2('0x4e')][_0x1ae2('0x60')]){_0x50a3bf[_0x1ae2('0x61')]=[{'all':!![]}];}return db[_0x1ae2('0xd4')][_0x1ae2('0x62')](_0x50a3bf);})[_0x1ae2('0x22')](function(_0x310a4a){_0x516fa7['rows']=_0x310a4a;return _0x516fa7;});}})[_0x1ae2('0x22')](respondWithFilteredResult(_0x324405,_0x50a3bf))[_0x1ae2('0x2d')](handleError(_0x324405,null));};exports[_0x1ae2('0xd5')]=function(_0x4b203a,_0x5b4521,_0x4630d4){var _0x4a365d={};var _0x56968a={};var _0x37c416;var _0x302cee;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x4b203a['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5b4521,null))[_0x1ae2('0x22')](function(_0x30ee39){if(_0x30ee39){_0x37c416=_0x30ee39;_0x56968a[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0xd6')][_0x1ae2('0x66')]);_0x56968a['query']=_[_0x1ae2('0x4f')](_0x4b203a['query']);_0x56968a[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x56968a[_0x1ae2('0x4b')],_0x56968a['query']);_0x4a365d[_0x1ae2('0x52')]=_[_0x1ae2('0x51')](_0x56968a[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x4a365d[_0x1ae2('0x52')]=_0x4a365d['attributes'][_0x1ae2('0x54')]?_0x4a365d[_0x1ae2('0x52')]:_0x56968a['model'];_0x4a365d[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x4b203a[_0x1ae2('0x4e')]['sort']);_0x4a365d[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x4b203a[_0x1ae2('0x4e')],_0x56968a[_0x1ae2('0x50')]));if(_0x4b203a[_0x1ae2('0x4e')]['filter']){_0x4a365d['where']=_[_0x1ae2('0x59')](_0x4a365d[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x4a365d[_0x1ae2('0x52')],function(_0x491bcc){var _0x1416d0={};_0x1416d0[_0x491bcc]={'$like':'%'+_0x4b203a['query'][_0x1ae2('0x3f')]+'%'};return _0x1416d0;})});}_0x4a365d=_[_0x1ae2('0x59')]({},_0x4a365d,_0x4b203a['options']);return _0x37c416[_0x1ae2('0xd5')](_0x4a365d);}})[_0x1ae2('0x22')](function(_0x292707){if(_0x292707){_0x302cee=_0x292707[_0x1ae2('0x54')];if(!_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x4a365d[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x4b203a[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x4a365d[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x4b203a[_0x1ae2('0x4e')]['offset']);}return _0x37c416[_0x1ae2('0xd5')](_0x4a365d);}})[_0x1ae2('0x22')](function(_0x37303a){if(_0x37303a){return _0x37303a?{'count':_0x302cee,'rows':_0x37303a}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5b4521,null))[_0x1ae2('0x2d')](handleError(_0x5b4521,null));};exports['getFaxInteractions']=function(_0x5721e7,_0x5e94b1,_0x2ab791){var _0x1420ff={};var _0x511b97={};var _0x1b265f;var _0x5bc36e;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x5721e7[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x5e94b1,null))[_0x1ae2('0x22')](function(_0x54fd8c){if(_0x54fd8c){_0x1b265f=_0x54fd8c;_0x511b97[_0x1ae2('0x4b')]=_['keys'](db[_0x1ae2('0xd7')][_0x1ae2('0x66')]);_0x511b97[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x5721e7[_0x1ae2('0x4e')]);_0x511b97[_0x1ae2('0x50')]=_['intersection'](_0x511b97[_0x1ae2('0x4b')],_0x511b97['query']);_0x1420ff['attributes']=_[_0x1ae2('0x51')](_0x511b97[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x5721e7[_0x1ae2('0x4e')]['fields']));_0x1420ff['attributes']=_0x1420ff[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x1420ff[_0x1ae2('0x52')]:_0x511b97['model'];_0x1420ff[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x5721e7[_0x1ae2('0x4e')]['sort']);_0x1420ff['where']=qs[_0x1ae2('0x50')](_[_0x1ae2('0xc0')](_0x5721e7[_0x1ae2('0x4e')],_0x511b97[_0x1ae2('0x50')]));if(_0x5721e7['query'][_0x1ae2('0x3f')]){_0x1420ff[_0x1ae2('0x58')]=_['merge'](_0x1420ff['where'],{'$or':_[_0x1ae2('0x41')](_0x1420ff[_0x1ae2('0x52')],function(_0x2dcd1b){var _0x4b478f={};_0x4b478f[_0x2dcd1b]={'$like':'%'+_0x5721e7[_0x1ae2('0x4e')]['filter']+'%'};return _0x4b478f;})});}_0x1420ff=_[_0x1ae2('0x59')]({},_0x1420ff,_0x5721e7[_0x1ae2('0x5e')]);return _0x1b265f[_0x1ae2('0xd8')](_0x1420ff);}})[_0x1ae2('0x22')](function(_0xb77ba6){if(_0xb77ba6){_0x5bc36e=_0xb77ba6[_0x1ae2('0x54')];if(!_0x5721e7[_0x1ae2('0x4e')][_0x1ae2('0x55')]('nolimit')){_0x1420ff['limit']=qs[_0x1ae2('0x33')](_0x5721e7['query'][_0x1ae2('0x33')]);_0x1420ff[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x5721e7[_0x1ae2('0x4e')][_0x1ae2('0x32')]);}return _0x1b265f['getFaxInteractions'](_0x1420ff);}})[_0x1ae2('0x22')](function(_0xc5a05a){if(_0xc5a05a){return _0xc5a05a?{'count':_0x5bc36e,'rows':_0xc5a05a}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x5e94b1,null))[_0x1ae2('0x2d')](handleError(_0x5e94b1,null));};exports[_0x1ae2('0xd9')]=function(_0x251dc8,_0x22bc3a,_0x26c653){var _0x2495a3;var _0x40cbaf;var _0x496486;return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x251dc8[_0x1ae2('0x65')]['id'],'role':_0x1ae2('0x3e')},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0xda'),_0x1ae2('0xdb'),'role',_0x1ae2('0x77'),_0x1ae2('0x9f')]})[_0x1ae2('0x22')](handleEntityNotFound(_0x22bc3a,null))['then'](function(_0x4c6584){if(_0x4c6584){_0x2495a3=_0x4c6584;if(_0x251dc8['body'][_0x1ae2('0xa0')]){_0x496486=util[_0x1ae2('0x74')](_0x1ae2('0xdc'),_0x2495a3[_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xa0')]]);}else if(_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xdd')]){_0x496486=util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x251dc8[_0x1ae2('0x69')][_0x1ae2('0xdd')]);}else{_0x496486=util['format'](_0x1ae2('0xaf'),_0x2495a3[_0x1ae2('0x48')]);}socket['to'](util['format'](_0x1ae2('0xde'),_0x2495a3[_0x1ae2('0x48')]))[_0x1ae2('0xaa')](_0x1ae2('0xdf'),{'ip':_0x251dc8[_0x1ae2('0xe0')][_0x1ae2('0xe1')]||_0x251dc8[_0x1ae2('0xe2')][_0x1ae2('0xe3')]||_0x251dc8['socket']['remoteAddress']||_0x251dc8['connection'][_0x1ae2('0xe4')]['remoteAddress']});return db[_0x1ae2('0xb2')][_0x1ae2('0x39')]({'where':{'membername':_0x2495a3['name']},'individualHooks':!![]});}})[_0x1ae2('0x22')](function(_0x58a11f){if(_0x2495a3){return _0x2495a3['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x314c76){var _0x2122d9=[];if(_0x314c76){_0x40cbaf=_0x314c76;if(_0x40cbaf[_0x1ae2('0x54')]){for(var _0x217f8b=0x0;_0x217f8b<_0x40cbaf[_0x1ae2('0x54')];_0x217f8b++){_0x2122d9[_0x1ae2('0xae')]({'membername':_0x2495a3[_0x1ae2('0x48')],'UserId':_0x2495a3['id'],'queue_name':_0x40cbaf[_0x217f8b][_0x1ae2('0x48')],'VoiceQueueId':_0x40cbaf[_0x217f8b]['id'],'interface':_0x496486,'paused':_0x2495a3[_0x1ae2('0x9f')]||![],'penalty':_0x40cbaf[_0x217f8b][_0x1ae2('0xe5')]||0x0});}return BPromise['each'](_0x2122d9,function(_0x3f57b7){return db[_0x1ae2('0xb2')]['upsert'](_0x3f57b7);});}}})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0xe6')][_0x1ae2('0x62')]({'where':{'membername':_0x2495a3['name'],'exitAt':null}});})[_0x1ae2('0x22')](function(_0x18a1c4){var _0x434b69=[];_0x18a1c4[_0x1ae2('0xe7')](function(_0x503f62){_0x434b69[_0x1ae2('0xae')](_0x503f62['update']({'exitAt':moment()['format'](_0x1ae2('0xe8'))}));});return BPromise[_0x1ae2('0xe9')](_0x434b69);})[_0x1ae2('0x22')](function(){var _0x4941fa=[];var _0x5eb0e2=[];var _0x1ebeee=utils[_0x1ae2('0xea')]();var _0xe5d3c5={'membername':_0x2495a3[_0x1ae2('0x48')],'interface':_0x496486,'enterAt':moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2495a3['role'],'internal':_0x2495a3['internal']};_0x1ebeee['forEach'](function(_0x54fe6e){_0x4941fa[_0x1ae2('0xae')](_['merge']({'channel':_0x54fe6e,'type':_0x1ae2('0xeb'),'data1':_0x251dc8[_0x1ae2('0x69')]['device'],'data2':_0x496486},_0xe5d3c5));if(_0x2495a3['loginInPause']){_0x5eb0e2[_0x1ae2('0xae')](_[_0x1ae2('0x59')]({'channel':_0x54fe6e,'type':_0x1ae2('0xec'),'data1':'LOGININPAUSE'},_0xe5d3c5));}});return db[_0x1ae2('0xe6')][_0x1ae2('0x68')](_0x4941fa[_0x1ae2('0xed')](_0x5eb0e2),{'individualHooks':!![]});})['then'](function(){return _0x2495a3['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2495a3[_0x1ae2('0x9f')]||![],'mailPause':_0x2495a3[_0x1ae2('0x9f')]||![],'chatPause':_0x2495a3[_0x1ae2('0x9f')]||![],'faxPause':_0x2495a3['loginInPause']||![],'smsPause':_0x2495a3[_0x1ae2('0x9f')]||![],'openchannelPause':_0x2495a3['loginInPause']||![],'pauseType':_0x2495a3[_0x1ae2('0x9f')]?'LOGININPAUSE':null,'interface':_0x496486,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1ae2('0x22')](respondWithResult(_0x22bc3a,null))[_0x1ae2('0x2d')](handleError(_0x22bc3a,null));};exports[_0x1ae2('0xee')]=function(_0x5422a7,_0x5cbb20,_0x5cd722){var _0x537864;return db[_0x1ae2('0x4a')]['find']({'where':{'id':_0x5422a7['params']['id'],'role':'agent'},'attributes':['id','name','role']})[_0x1ae2('0x22')](handleEntityNotFound(_0x5cbb20,null))['then'](function(_0x2b2038){if(_0x2b2038){_0x537864=_0x2b2038;return db[_0x1ae2('0xb2')][_0x1ae2('0x39')]({'where':{'membername':_0x537864[_0x1ae2('0x48')]},'individualHooks':!![]});}})[_0x1ae2('0x22')](function(){return db['MemberReport'][_0x1ae2('0x62')]({'where':{'membername':_0x537864[_0x1ae2('0x48')],'exitAt':null}});})[_0x1ae2('0x22')](function(_0x24220c){var _0x519532=[];_0x24220c[_0x1ae2('0xe7')](function(_0x4e474f){_0x519532[_0x1ae2('0xae')](_0x4e474f[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8'))}));});return BPromise[_0x1ae2('0xe9')](_0x519532);})['then'](function(){return _0x537864['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x1ae2('0x22')](respondWithResult(_0x5cbb20,null))['catch'](handleError(_0x5cbb20,null));};exports[_0x1ae2('0xef')]=function(_0x43978d,_0x4faa5c,_0x358460){var _0x3a4728;return db[_0x1ae2('0xb2')][_0x1ae2('0x38')]({'paused':0x1},{'where':{'UserId':_0x43978d[_0x1ae2('0x65')]['id']},'individualHooks':!![]})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x43978d[_0x1ae2('0x65')]['id'],'role':_0x1ae2('0x3e')},'attributes':['id',_0x1ae2('0x48'),_0x1ae2('0x44'),_0x1ae2('0x77'),_0x1ae2('0xa0')]});})[_0x1ae2('0x22')](handleEntityNotFound(_0x4faa5c,null))[_0x1ae2('0x22')](function(_0x154d9e){if(_0x154d9e){_0x3a4728=_0x154d9e;return respondWithRpcPromise(_0x1ae2('0xf0'),_0x1ae2('0xef'),{'id':_0x3a4728['id'],'name':_0x3a4728[_0x1ae2('0x48')],'pause':!![]});}})[_0x1ae2('0x22')](function(){if(_0x3a4728){return db[_0x1ae2('0xe6')][_0x1ae2('0x62')]({'where':{'membername':_0x3a4728[_0x1ae2('0x48')],'type':_0x1ae2('0xec'),'exitAt':null}});}})['then'](function(_0x23282c){if(_0x23282c[_0x1ae2('0x54')]){var _0x2ad03a=moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2b1fb4=0x0,_0x586be5=_0x23282c['length'];_0x2b1fb4<_0x586be5;_0x2b1fb4++){_0x23282c[_0x2b1fb4][_0x1ae2('0xf1')]({'exitAt':_0x2ad03a});}}})[_0x1ae2('0x22')](function(){var _0x185f4a=[];var _0x594e2c=utils[_0x1ae2('0xea')]();_0x594e2c[_0x1ae2('0xe7')](function(_0x3d8a71){_0x185f4a['push']({'channel':_0x3d8a71,'membername':_0x3a4728[_0x1ae2('0x48')],'interface':_[_0x1ae2('0x7d')](_0x3a4728[_0x1ae2('0xa0')])?util[_0x1ae2('0x74')](_0x1ae2('0xaf'),_0x3a4728['name']):_0x3a4728['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x1ae2('0xe8')),'data1':_0x43978d[_0x1ae2('0x69')]['type']||_0x1ae2('0xf2'),'role':_0x3a4728['role'],'internal':_0x3a4728[_0x1ae2('0x77')]});});return db['MemberReport'][_0x1ae2('0x68')](_0x185f4a,{'individualHooks':!![]});})[_0x1ae2('0x22')](function(){return _0x3a4728[_0x1ae2('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x43978d[_0x1ae2('0x69')][_0x1ae2('0xf3')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x1ae2('0xe8'))});})['then'](respondWithResult(_0x4faa5c,null))['catch'](handleError(_0x4faa5c,null));};exports[_0x1ae2('0xf4')]=function(_0x2d9f97,_0x5087e8,_0x3ccb5c){var _0x39b56b;return db['User']['find']({'where':{'id':_0x2d9f97[_0x1ae2('0x65')]['id']},'attributes':['id',_0x1ae2('0x48'),'role',_0x1ae2('0xb0'),'mailPause',_0x1ae2('0xf5'),_0x1ae2('0xf6'),_0x1ae2('0xf7'),_0x1ae2('0xf8'),_0x1ae2('0xf9'),'lastPauseAt']})[_0x1ae2('0x22')](handleEntityNotFound(_0x5087e8,null))[_0x1ae2('0x22')](function(_0x2adc19){if(_0x2adc19){_0x39b56b=_0x2adc19;if(_0x2d9f97[_0x1ae2('0x69')][_0x1ae2('0x9d')]&&!utils[_0x1ae2('0xa1')](_0x2d9f97['body'][_0x1ae2('0x9d')])){throw new db[(_0x1ae2('0x95'))][(_0x1ae2('0x97'))](_0x1ae2('0xa2'));}switch(_0x2d9f97[_0x1ae2('0x69')]['channel']){case'voice':return respondWithRpcPromise(_0x1ae2('0xf0'),'unpause',{'id':_0x39b56b['id'],'name':_0x39b56b[_0x1ae2('0x48')],'pause':![]})[_0x1ae2('0x22')](function(){return db[_0x1ae2('0xb2')]['update']({'paused':0x0},{'where':{'UserId':_0x39b56b['id']},'individualHooks':!![]});})['then'](function(){return db[_0x1ae2('0xe6')][_0x1ae2('0x45')]({'where':{'channel':_0x2d9f97[_0x1ae2('0x69')][_0x1ae2('0x9d')],'membername':_0x39b56b[_0x1ae2('0x48')],'type':'PAUSE','exitAt':null}});})[_0x1ae2('0x22')](function(_0x47f8d2){if(_0x47f8d2){return _0x47f8d2[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8')),'data2':_0x1ae2('0xfa')},{'individualHooks':!![]});}return null;})[_0x1ae2('0x22')](function(){return _0x39b56b['update']({'voicePause':![]});});case _0x1ae2('0xfb'):case _0x1ae2('0xfc'):case _0x1ae2('0xfd'):case _0x1ae2('0xfe'):case _0x1ae2('0xff'):return db['MemberReport'][_0x1ae2('0x45')]({'where':{'channel':_0x2d9f97['body'][_0x1ae2('0x9d')],'membername':_0x39b56b['name'],'type':_0x1ae2('0xec'),'exitAt':null}})['then'](function(_0x282647){if(_0x282647){return _0x282647[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1ae2('0xfa')},{'individualHooks':!![]});}return null;})[_0x1ae2('0x22')](function(){var _0x261e38={};_['set'](_0x261e38,util[_0x1ae2('0x74')](_0x1ae2('0x100'),_0x2d9f97['body'][_0x1ae2('0x9d')],_0x1ae2('0x101')),![]);return _0x39b56b[_0x1ae2('0x38')](_0x261e38);});default:return respondWithRpcPromise(_0x1ae2('0xf0'),_0x1ae2('0xf4'),{'id':_0x39b56b['id'],'name':_0x39b56b[_0x1ae2('0x48')],'pause':![]})['then'](function(){return db[_0x1ae2('0xb2')][_0x1ae2('0x38')]({'paused':0x0},{'where':{'UserId':_0x39b56b['id']}});})[_0x1ae2('0x22')](function(){return db['MemberReport'][_0x1ae2('0x62')]({'where':{'membername':_0x39b56b[_0x1ae2('0x48')],'type':'PAUSE','exitAt':null}});})[_0x1ae2('0x22')](function(_0x29302f){var _0x53c091=[];_0x29302f['forEach'](function(_0x2c4182){_0x53c091[_0x1ae2('0xae')](_0x2c4182[_0x1ae2('0x38')]({'exitAt':moment()[_0x1ae2('0x74')](_0x1ae2('0xe8')),'data2':_0x1ae2('0xfa')}));});return BPromise[_0x1ae2('0xe9')](_0x53c091);})[_0x1ae2('0x22')](function(){return _0x39b56b[_0x1ae2('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x5087e8,null))[_0x1ae2('0x2d')](handleError(_0x5087e8,null));};exports[_0x1ae2('0x102')]=function(_0x2e392a,_0x58051f,_0x386618){var _0x227ddf={};var _0x247694={};var _0x4d9e01;var _0x2b6b4d;return db[_0x1ae2('0x4a')]['findOne']({'where':{'id':_0x2e392a['params']['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x58051f,null))[_0x1ae2('0x22')](function(_0x2e5b7e){if(_0x2e5b7e){_0x4d9e01=_0x2e5b7e;_0x247694['model']=_['keys'](db[_0x1ae2('0x103')][_0x1ae2('0x66')]);_0x247694['query']=_[_0x1ae2('0x4f')](_0x2e392a[_0x1ae2('0x4e')]);_0x247694['filters']=_[_0x1ae2('0x51')](_0x247694[_0x1ae2('0x4b')],_0x247694[_0x1ae2('0x4e')]);_0x227ddf[_0x1ae2('0x52')]=_['intersection'](_0x247694[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x227ddf[_0x1ae2('0x52')]=_0x227ddf[_0x1ae2('0x52')][_0x1ae2('0x54')]?_0x227ddf[_0x1ae2('0x52')]:_0x247694['model'];_0x227ddf[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x227ddf[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x2e392a[_0x1ae2('0x4e')],_0x247694[_0x1ae2('0x50')]));if(_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x227ddf[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x227ddf[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x227ddf['attributes'],function(_0x267e6a){var _0x3d4a60={};_0x3d4a60[_0x267e6a]={'$like':'%'+_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x3d4a60;})});}_0x227ddf=_[_0x1ae2('0x59')]({},_0x227ddf,_0x2e392a[_0x1ae2('0x5e')]);return _0x4d9e01['getTeams'](_0x227ddf);}})[_0x1ae2('0x22')](function(_0x24c08e){if(_0x24c08e){_0x2b6b4d=_0x24c08e[_0x1ae2('0x54')];if(!_0x2e392a['query'][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x227ddf[_0x1ae2('0x33')]=qs['limit'](_0x2e392a[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x227ddf[_0x1ae2('0x32')]=qs[_0x1ae2('0x32')](_0x2e392a['query']['offset']);}return _0x4d9e01[_0x1ae2('0x102')](_0x227ddf);}})[_0x1ae2('0x22')](function(_0xbe776){if(_0xbe776){return _0xbe776?{'count':_0x2b6b4d,'rows':_0xbe776}:null;}})['then'](respondWithResult(_0x58051f,null))[_0x1ae2('0x2d')](handleError(_0x58051f,null));};exports['addTeams']=function(_0x178850,_0x29a764,_0x2d0df9){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x178850[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x29a764,null))['then'](function(_0x23867e){if(_0x23867e){return _0x23867e[_0x1ae2('0x104')](_0x178850[_0x1ae2('0x69')][_0x1ae2('0x6d')],_[_0x1ae2('0x6c')](_0x178850[_0x1ae2('0x69')],[_0x1ae2('0x6d'),'id'])||{});}})[_0x1ae2('0x22')](respondWithResult(_0x29a764,null))['catch'](handleError(_0x29a764,null));};exports['removeTeams']=function(_0x168a30,_0x374b46,_0x589828){return db[_0x1ae2('0x4a')][_0x1ae2('0x45')]({'where':{'id':_0x168a30[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x374b46,null))[_0x1ae2('0x22')](function(_0x18f820){if(_0x18f820){return _0x18f820[_0x1ae2('0x105')](_0x168a30['query']['ids']);}})[_0x1ae2('0x22')](respondWithStatusCode(_0x374b46,null))[_0x1ae2('0x2d')](handleError(_0x374b46,null));};exports[_0x1ae2('0x106')]=function(_0x3858ab,_0x90467b,_0x497f9e){var _0x39ab53={};var _0x42487e={};var _0x4acc3d;var _0x117bdf;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x3858ab[_0x1ae2('0x65')]['id']}})[_0x1ae2('0x22')](handleEntityNotFound(_0x90467b,null))[_0x1ae2('0x22')](function(_0x5b0f03){if(_0x5b0f03){_0x4acc3d=_0x5b0f03;_0x42487e[_0x1ae2('0x4b')]=_[_0x1ae2('0x4f')](db[_0x1ae2('0x107')][_0x1ae2('0x66')]);_0x42487e[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x3858ab[_0x1ae2('0x4e')]);_0x42487e[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x42487e[_0x1ae2('0x4b')],_0x42487e['query']);_0x39ab53['attributes']=_[_0x1ae2('0x51')](_0x42487e[_0x1ae2('0x4b')],qs[_0x1ae2('0x53')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0x39ab53[_0x1ae2('0x52')]=_0x39ab53['attributes'][_0x1ae2('0x54')]?_0x39ab53['attributes']:_0x42487e[_0x1ae2('0x4b')];_0x39ab53[_0x1ae2('0x56')]=qs[_0x1ae2('0x57')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0x39ab53[_0x1ae2('0x58')]=qs[_0x1ae2('0x50')](_['pick'](_0x3858ab['query'],_0x42487e[_0x1ae2('0x50')]));if(_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0x39ab53[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0x39ab53[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0x39ab53['attributes'],function(_0x55dff5){var _0x1dab7f={};_0x1dab7f[_0x55dff5]={'$like':'%'+_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x1dab7f;})});}_0x39ab53=_['merge']({},_0x39ab53,_0x3858ab[_0x1ae2('0x5e')]);return _0x4acc3d[_0x1ae2('0x106')](_0x39ab53);}})[_0x1ae2('0x22')](function(_0x300f06){if(_0x300f06){_0x117bdf=_0x300f06[_0x1ae2('0x54')];if(!_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x55')](_0x1ae2('0xc6'))){_0x39ab53[_0x1ae2('0x33')]=qs[_0x1ae2('0x33')](_0x3858ab[_0x1ae2('0x4e')][_0x1ae2('0x33')]);_0x39ab53['offset']=qs[_0x1ae2('0x32')](_0x3858ab['query'][_0x1ae2('0x32')]);}return _0x4acc3d[_0x1ae2('0x106')](_0x39ab53);}})[_0x1ae2('0x22')](function(_0x4cc176){if(_0x4cc176){return _0x4cc176?{'count':_0x117bdf,'rows':_0x4cc176}:null;}})[_0x1ae2('0x22')](respondWithResult(_0x90467b,null))['catch'](handleError(_0x90467b,null));};exports[_0x1ae2('0x108')]=function(_0x2bbb0c,_0x72c852,_0x2b6714){var _0xc58301={};var _0x59f78a={};var _0x1428f2;var _0x3fca94;return db[_0x1ae2('0x4a')][_0x1ae2('0x9c')]({'where':{'id':_0x2bbb0c[_0x1ae2('0x65')]['id']}})['then'](handleEntityNotFound(_0x72c852,null))[_0x1ae2('0x22')](function(_0x264b71){if(_0x264b71){_0x1428f2=_0x264b71;_0x59f78a[_0x1ae2('0x4b')]=_['keys'](db[_0x1ae2('0x4a')][_0x1ae2('0x66')]);_0x59f78a[_0x1ae2('0x4e')]=_[_0x1ae2('0x4f')](_0x2bbb0c['query']);_0x59f78a[_0x1ae2('0x50')]=_[_0x1ae2('0x51')](_0x59f78a[_0x1ae2('0x4b')],_0x59f78a[_0x1ae2('0x4e')]);_0xc58301[_0x1ae2('0x52')]=_['intersection'](_0x59f78a[_0x1ae2('0x4b')],qs['fields'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x53')]));_0xc58301[_0x1ae2('0x52')]=_0xc58301['attributes'][_0x1ae2('0x54')]?_0xc58301['attributes']:_0x59f78a[_0x1ae2('0x4b')];_0xc58301[_0x1ae2('0x56')]=qs['sort'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x57')]);_0xc58301['where']=qs['filters'](_[_0x1ae2('0xc0')](_0x2bbb0c[_0x1ae2('0x4e')],_0x59f78a[_0x1ae2('0x50')]));if(_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x3f')]){_0xc58301[_0x1ae2('0x58')]=_[_0x1ae2('0x59')](_0xc58301[_0x1ae2('0x58')],{'$or':_[_0x1ae2('0x41')](_0xc58301[_0x1ae2('0x52')],function(_0x4ebb60){var _0x5db535={};_0x5db535[_0x4ebb60]={'$like':'%'+_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x3f')]+'%'};return _0x5db535;})});}_0xc58301[_0x1ae2('0x4b')]=db[_0x1ae2('0x4a')];_0xc58301['as']='Agents';_0xc58301=_[_0x1ae2('0x59')]({},_0xc58301,_0x2bbb0c[_0x1ae2('0x5e')]);return _0x1428f2[_0x1ae2('0x109')]({'include':[_0xc58301]});}})[_0x1ae2('0x22')](function(_0x1b31fd){if(_0x1b31fd){var _0x83aaa0={},_0x41b63b=[],_0xc46250=0x0;for(var _0x530921=0x0;_0x530921<_0x1b31fd[_0x1ae2('0x54')];_0x530921+=0x1){for(var _0x2c0be0=0x0,_0x6b25f5;_0x2c0be0<_0x1b31fd[_0x530921][_0x1ae2('0x3d')][_0x1ae2('0x54')];_0x2c0be0+=0x1){_0x6b25f5=_0x1b31fd[_0x530921]['Agents'][_0x2c0be0][_0x1ae2('0x3a')]({'plain':!![]});_0x83aaa0[_0x6b25f5['id']]=_0x6b25f5;}}_0x83aaa0=_['values'](_0x83aaa0);for(var _0x3e1bc4=qs['offset'](_0x2bbb0c[_0x1ae2('0x4e')][_0x1ae2('0x32')]);_0x3e1bc4<_0x83aaa0[_0x1ae2('0x54')]&&_0x41b63b[_0x1ae2('0x54')]=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x5ee0bf,_0x543b20){var _0x4a7f91=function(_0x4ff8a4){while(--_0x4ff8a4){_0x5ee0bf['push'](_0x5ee0bf['shift']());}};_0x4a7f91(++_0x543b20);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e6951,_0x4d39ee){_0x1e6951=_0x1e6951-0x0;var _0x235723=_0xb10b[_0x1e6951];return _0x235723;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index fb4cee6..46df812 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 _0x0b26=['length','user:','./user.events','remove','update','removeListener'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0x0b26,0x104));var _0x60b2=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0x0b26[_0xb47dc0];return _0x57f0b0;};'use strict';var UserEvents=require(_0x60b2('0x0'));var events=['save',_0x60b2('0x1'),_0x60b2('0x2')];function createListener(_0x1c4c43,_0x45eeab){return function(_0x2c7dae){_0x45eeab['emit'](_0x1c4c43,_0x2c7dae);};}function removeListener(_0xf44d58,_0x4673c2){return function(){UserEvents[_0x60b2('0x3')](_0xf44d58,_0x4673c2);};}exports['register']=function(_0x3f58f7){for(var _0x42e4a3=0x0,_0x364cb7=events[_0x60b2('0x4')];_0x42e4a3<_0x364cb7;_0x42e4a3++){var _0x56576c=events[_0x42e4a3];var _0x2016fb=createListener(_0x60b2('0x5')+_0x56576c,_0x3f58f7);UserEvents['on'](_0x56576c,_0x2016fb);}}; \ No newline at end of file +var _0xb082=['./user.events','remove','update','emit','removeListener','register','length'];(function(_0x43374b,_0x3931b3){var _0x50859a=function(_0x297e86){while(--_0x297e86){_0x43374b['push'](_0x43374b['shift']());}};_0x50859a(++_0x3931b3);}(_0xb082,0x1b2));var _0x2b08=function(_0x4c8f27,_0xf36871){_0x4c8f27=_0x4c8f27-0x0;var _0x5690bf=_0xb082[_0x4c8f27];return _0x5690bf;};'use strict';var UserEvents=require(_0x2b08('0x0'));var events=['save',_0x2b08('0x1'),_0x2b08('0x2')];function createListener(_0x3ae1e1,_0x3000a4){return function(_0x11ee0f){_0x3000a4[_0x2b08('0x3')](_0x3ae1e1,_0x11ee0f);};}function removeListener(_0x143579,_0x476ddd){return function(){UserEvents[_0x2b08('0x4')](_0x143579,_0x476ddd);};}exports[_0x2b08('0x5')]=function(_0x460b6e){for(var _0x4c5d4f=0x0,_0x39c6c0=events[_0x2b08('0x6')];_0x4c5d4f<_0x39c6c0;_0x4c5d4f++){var _0x3adea0=events[_0x4c5d4f];var _0x2db405=createListener('user:'+_0x3adea0,_0x460b6e);UserEvents['on'](_0x3adea0,_0x2db405);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f89d646..93dc305 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 _0x90b5=['connect-timeout','express','Router','../../config/environment','exports','multer','path'];(function(_0x7d5b1b,_0x20e692){var _0x51988c=function(_0x4b8e77){while(--_0x4b8e77){_0x7d5b1b['push'](_0x7d5b1b['shift']());}};_0x51988c(++_0x20e692);}(_0x90b5,0x139));var _0x590b=function(_0xed40c9,_0x2539d8){_0xed40c9=_0xed40c9-0x0;var _0x3b5d78=_0x90b5[_0xed40c9];return _0x3b5d78;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x590b('0x5'));module[_0x590b('0x6')]=router; \ No newline at end of file +var _0xa4dc=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xab92b5,_0x184d79){var _0x3a758c=function(_0x3eae35){while(--_0x3eae35){_0xab92b5['push'](_0xab92b5['shift']());}};_0x3a758c(++_0x184d79);}(_0xa4dc,0x16a));var _0xca4d=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa4dc[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var auth=require(_0xca4d('0x4'));var interaction=require(_0xca4d('0x5'));var config=require(_0xca4d('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 288bab1..56c0dbe 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 _0x4a9b=['exports','sequelize'];(function(_0x25ed73,_0x8a06c0){var _0x2d44ad=function(_0x503673){while(--_0x503673){_0x25ed73['push'](_0x25ed73['shift']());}};_0x2d44ad(++_0x8a06c0);}(_0x4a9b,0x19f));var _0xb4a9=function(_0x32b017,_0x311116){_0x32b017=_0x32b017-0x0;var _0x344911=_0x4a9b[_0x32b017];return _0x344911;};'use strict';var Sequelize=require(_0xb4a9('0x0'));module[_0xb4a9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b25=['exports','sequelize'];(function(_0xb0ed66,_0x424e5e){var _0x15de71=function(_0x3ec047){while(--_0x3ec047){_0xb0ed66['push'](_0xb0ed66['shift']());}};_0x15de71(++_0x424e5e);}(_0x6b25,0x19b));var _0x56b2=function(_0x5d7ebd,_0x3471c0){_0x5d7ebd=_0x5d7ebd-0x0;var _0x306386=_0x6b25[_0x5d7ebd];return _0x306386;};'use strict';var Sequelize=require(_0x56b2('0x0'));module[_0x56b2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 7726342..6bf7a79 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 _0x87fe=['moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api'];(function(_0x1824d2,_0x382926){var _0x4d9feb=function(_0x3f648b){while(--_0x3f648b){_0x1824d2['push'](_0x1824d2['shift']());}};_0x4d9feb(++_0x382926);}(_0x87fe,0x19f));var _0xe87f=function(_0x135704,_0x539aee){_0x135704=_0x135704-0x0;var _0x24e9fd=_0x87fe[_0x135704];return _0x24e9fd;};'use strict';var _=require(_0xe87f('0x0'));var util=require('util');var logger=require(_0xe87f('0x1'))(_0xe87f('0x2'));var moment=require(_0xe87f('0x3'));var BPromise=require(_0xe87f('0x4'));var rp=require(_0xe87f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe87f('0x6'));var attributes=require(_0xe87f('0x7'));module['exports']=function(_0x55801c,_0x2fcb15){return _0x55801c[_0xe87f('0x8')](_0xe87f('0x9'),attributes,{'tableName':_0xe87f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4468=['define','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58a274,_0x400d8c){var _0x32964f=function(_0x201683){while(--_0x201683){_0x58a274['push'](_0x58a274['shift']());}};_0x32964f(++_0x400d8c);}(_0x4468,0xd4));var _0x8446=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x4468[_0x341e0f];return _0x59555a;};'use strict';var _=require('lodash');var util=require(_0x8446('0x0'));var logger=require(_0x8446('0x1'))(_0x8446('0x2'));var moment=require(_0x8446('0x3'));var BPromise=require(_0x8446('0x4'));var rp=require(_0x8446('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8446('0x6'));var config=require(_0x8446('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x83bbdf,_0x26a0db){return _0x83bbdf[_0x8446('0x8')]('UserChatQueue',attributes,{'tableName':_0x8446('0x9'),'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 f01e01a..7c5de99 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 _0xb5bb=['result','catch','lodash','util','moment','randomstring','ioredis','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3bbda1,_0x3261b0){var _0xf33156=function(_0x52fd12){while(--_0x52fd12){_0x3bbda1['push'](_0x3bbda1['shift']());}};_0xf33156(++_0x3261b0);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x40c6a0,_0x1cc177){_0x40c6a0=_0x40c6a0-0x0;var _0x57deb1=_0xb5bb[_0x40c6a0];return _0x57deb1;};'use strict';var _=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var moment=require(_0xbb5b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb5b('0x3'));var fs=require('fs');var Redis=require(_0xbb5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb5b('0x5')][_0xbb5b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b03cd,_0x1d8453,_0x10d8fb){return new BPromise(function(_0x31eaa6,_0x11cc7e){return client[_0xbb5b('0x7')](_0x5b03cd,_0x10d8fb)[_0xbb5b('0x8')](function(_0x1b90ec){logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));logger[_0xbb5b('0xc')](_0xbb5b('0xd'),_0x1d8453,_0xbb5b('0xb'),JSON[_0xbb5b('0xe')](_0x1b90ec));if(_0x1b90ec[_0xbb5b('0xf')]){if(_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x10')]===0x1f4){logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')]['message']);return _0x11cc7e(_0x1b90ec[_0xbb5b('0xf')]['message']);}logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x11')]);return _0x31eaa6(_0x1b90ec['error'][_0xbb5b('0x11')]);}else{logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));_0x31eaa6(_0x1b90ec[_0xbb5b('0x12')]['message']);}})[_0xbb5b('0x13')](function(_0x380044){logger[_0xbb5b('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1d8453,_0x380044);_0x11cc7e(_0x380044);});});} \ No newline at end of file +var _0x645a=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x645a,0x1cf));var _0xa645=function(_0x89c40f,_0xd92eb2){_0x89c40f=_0x89c40f-0x0;var _0x17acbb=_0x645a[_0x89c40f];return _0x17acbb;};'use strict';var _=require(_0xa645('0x0'));var util=require(_0xa645('0x1'));var moment=require(_0xa645('0x2'));var BPromise=require('bluebird');var rs=require(_0xa645('0x3'));var fs=require('fs');var Redis=require(_0xa645('0x4'));var db=require(_0xa645('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa645('0x6'))(_0xa645('0x7'));var config=require(_0xa645('0x8'));var jayson=require(_0xa645('0x9'));var client=jayson[_0xa645('0xa')][_0xa645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a511c,_0x2159bf,_0x3d21fe){return new BPromise(function(_0x2f9489,_0x11ecf1){return client['request'](_0x3a511c,_0x3d21fe)[_0xa645('0xc')](function(_0x2b97ff){logger[_0xa645('0xd')](_0xa645('0xe'),_0x2159bf,_0xa645('0xf'));logger[_0xa645('0x10')](_0xa645('0x11'),_0x2159bf,_0xa645('0xf'),JSON[_0xa645('0x12')](_0x2b97ff));if(_0x2b97ff[_0xa645('0x13')]){if(_0x2b97ff[_0xa645('0x13')]['code']===0x1f4){logger[_0xa645('0x13')](_0xa645('0xe'),_0x2159bf,_0x2b97ff['error'][_0xa645('0x14')]);return _0x11ecf1(_0x2b97ff[_0xa645('0x13')][_0xa645('0x14')]);}logger[_0xa645('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2159bf,_0x2b97ff[_0xa645('0x13')][_0xa645('0x14')]);return _0x2f9489(_0x2b97ff[_0xa645('0x13')]['message']);}else{logger[_0xa645('0xd')](_0xa645('0xe'),_0x2159bf,_0xa645('0xf'));_0x2f9489(_0x2b97ff[_0xa645('0x15')][_0xa645('0x14')]);}})['catch'](function(_0x2fb3a1){logger[_0xa645('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x2159bf,_0x2fb3a1);_0x11ecf1(_0x2fb3a1);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 5fe5137..495c22e 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 _0x2d72=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x28a87b,_0x564dfe){var _0x333015=function(_0x2d14d3){while(--_0x2d14d3){_0x28a87b['push'](_0x28a87b['shift']());}};_0x333015(++_0x564dfe);}(_0x2d72,0xa8));var _0x22d7=function(_0x3a5309,_0x5bf491){_0x3a5309=_0x3a5309-0x0;var _0x2c24d0=_0x2d72[_0x3a5309];return _0x2c24d0;};'use strict';var multer=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var path=require(_0x22d7('0x2'));var timeout=require(_0x22d7('0x3'));var express=require(_0x22d7('0x4'));var router=express[_0x22d7('0x5')]();var auth=require(_0x22d7('0x6'));var interaction=require(_0x22d7('0x7'));var config=require(_0x22d7('0x8'));module[_0x22d7('0x9')]=router; \ No newline at end of file +var _0x4f0d=['../../components/interaction/service','exports','Router','../../components/auth/service'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0xdb01a,_0x54a83a){_0xdb01a=_0xdb01a-0x0;var _0x107ede=_0x4f0d[_0xdb01a];return _0x107ede;};'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[_0xd4f0('0x0')]();var auth=require(_0xd4f0('0x1'));var interaction=require(_0xd4f0('0x2'));var config=require('../../config/environment');module[_0xd4f0('0x3')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c3bd2e0..ece2822 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 _0x8cf2=['exports','INTEGER','STRING','sequelize'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x8cf2,0x1a7));var _0x28cf=function(_0x503710,_0x128925){_0x503710=_0x503710-0x0;var _0x27d67f=_0x8cf2[_0x503710];return _0x27d67f;};'use strict';var Sequelize=require(_0x28cf('0x0'));module[_0x28cf('0x1')]={'penalty':{'type':Sequelize[_0x28cf('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x28cf('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x28cf('0x3')]}}; \ No newline at end of file +var _0x7192=['STRING','sequelize','exports'];(function(_0x434a02,_0x42739f){var _0x3be474=function(_0x4e837a){while(--_0x4e837a){_0x434a02['push'](_0x434a02['shift']());}};_0x3be474(++_0x42739f);}(_0x7192,0x17e));var _0x2719=function(_0x28239a,_0x1ab8b0){_0x28239a=_0x28239a-0x0;var _0x2b0ceb=_0x7192[_0x28239a];return _0x2b0ceb;};'use strict';var Sequelize=require(_0x2719('0x0'));module[_0x2719('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2719('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 3f78696..f8813de 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 _0x1396=['moment','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x1396,0x14c));var _0x6139=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x1396[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x6139('0x0'));var util=require(_0x6139('0x1'));var logger=require(_0x6139('0x2'))(_0x6139('0x3'));var moment=require(_0x6139('0x4'));var BPromise=require('bluebird');var rp=require(_0x6139('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6139('0x6'));var config=require(_0x6139('0x7'));var attributes=require(_0x6139('0x8'));module[_0x6139('0x9')]=function(_0x5b1679,_0x22bc4b){return _0x5b1679[_0x6139('0xa')](_0x6139('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e27=['request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x39ec3b,_0x853748){var _0x104228=function(_0x575224){while(--_0x575224){_0x39ec3b['push'](_0x39ec3b['shift']());}};_0x104228(++_0x853748);}(_0x2e27,0x128));var _0x72e2=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0x2e27[_0x34232c];return _0x4d4f4e;};'use strict';var _=require(_0x72e2('0x0'));var util=require(_0x72e2('0x1'));var logger=require(_0x72e2('0x2'))('api');var moment=require(_0x72e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x72e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72e2('0x5'));var config=require(_0x72e2('0x6'));var attributes=require(_0x72e2('0x7'));module[_0x72e2('0x8')]=function(_0x4431a4,_0x119899){return _0x4431a4[_0x72e2('0x9')](_0x72e2('0xa'),attributes,{'tableName':_0x72e2('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 a5a84d8..4236462 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 _0xc28b=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xc28b,0xb3));var _0xbc28=function(_0x3d839a,_0x259485){_0x3d839a=_0x3d839a-0x0;var _0x26d010=_0xc28b[_0x3d839a];return _0x26d010;};'use strict';var _=require('lodash');var util=require(_0xbc28('0x0'));var moment=require(_0xbc28('0x1'));var BPromise=require(_0xbc28('0x2'));var rs=require(_0xbc28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc28('0x4'))['db'];var utils=require(_0xbc28('0x5'));var logger=require(_0xbc28('0x6'))('rpc');var config=require(_0xbc28('0x7'));var jayson=require(_0xbc28('0x8'));var client=jayson[_0xbc28('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0d49,_0x4d15bd,_0x345b7a){return new BPromise(function(_0x2e62ed,_0x37143b){return client[_0xbc28('0xa')](_0x4e0d49,_0x345b7a)['then'](function(_0x597382){logger[_0xbc28('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x4d15bd,'request\x20sent');logger[_0xbc28('0xc')](_0xbc28('0xd'),_0x4d15bd,_0xbc28('0xe'),JSON[_0xbc28('0xf')](_0x597382));if(_0x597382[_0xbc28('0x10')]){if(_0x597382[_0xbc28('0x10')][_0xbc28('0x11')]===0x1f4){logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x597382[_0xbc28('0x10')]['message']);return _0x37143b(_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);}logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);return _0x2e62ed(_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);}else{logger['info'](_0xbc28('0x12'),_0x4d15bd,_0xbc28('0xe'));_0x2e62ed(_0x597382[_0xbc28('0x14')]['message']);}})[_0xbc28('0x15')](function(_0x3f123b){logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x3f123b);_0x37143b(_0x3f123b);});});} \ No newline at end of file +var _0x4478=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x41c0b9,_0xcaa6da){var _0x123245=function(_0x12b62d){while(--_0x12b62d){_0x41c0b9['push'](_0x41c0b9['shift']());}};_0x123245(++_0xcaa6da);}(_0x4478,0x131));var _0x8447=function(_0x417dd6,_0x209f6a){_0x417dd6=_0x417dd6-0x0;var _0x1d115a=_0x4478[_0x417dd6];return _0x1d115a;};'use strict';var _=require(_0x8447('0x0'));var util=require(_0x8447('0x1'));var moment=require(_0x8447('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8447('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8447('0x4'));var logger=require(_0x8447('0x5'))(_0x8447('0x6'));var config=require(_0x8447('0x7'));var jayson=require(_0x8447('0x8'));var client=jayson[_0x8447('0x9')][_0x8447('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290588,_0x1e27f8,_0x5bb567){return new BPromise(function(_0x88c060,_0x5a502c){return client[_0x8447('0xb')](_0x290588,_0x5bb567)[_0x8447('0xc')](function(_0x1dbbf4){logger['info'](_0x8447('0xd'),_0x1e27f8,_0x8447('0xe'));logger[_0x8447('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1e27f8,'request\x20sent',JSON[_0x8447('0x10')](_0x1dbbf4));if(_0x1dbbf4[_0x8447('0x11')]){if(_0x1dbbf4[_0x8447('0x11')][_0x8447('0x12')]===0x1f4){logger[_0x8447('0x11')](_0x8447('0xd'),_0x1e27f8,_0x1dbbf4[_0x8447('0x11')]['message']);return _0x5a502c(_0x1dbbf4[_0x8447('0x11')]['message']);}logger[_0x8447('0x11')](_0x8447('0xd'),_0x1e27f8,_0x1dbbf4[_0x8447('0x11')][_0x8447('0x13')]);return _0x88c060(_0x1dbbf4[_0x8447('0x11')][_0x8447('0x13')]);}else{logger[_0x8447('0x14')](_0x8447('0xd'),_0x1e27f8,_0x8447('0xe'));_0x88c060(_0x1dbbf4['result'][_0x8447('0x13')]);}})[_0x8447('0x15')](function(_0x155dd0){logger['error'](_0x8447('0xd'),_0x1e27f8,_0x155dd0);_0x5a502c(_0x155dd0);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4901e9e..34a0d9d 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 _0x41fe=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x41fe,0xd1));var _0xe41f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x41fe[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var path=require(_0xe41f('0x2'));var timeout=require(_0xe41f('0x3'));var express=require(_0xe41f('0x4'));var router=express[_0xe41f('0x5')]();var auth=require(_0xe41f('0x6'));var interaction=require(_0xe41f('0x7'));var config=require(_0xe41f('0x8'));module[_0xe41f('0x9')]=router; \ No newline at end of file +var _0x96fd=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x181f75,_0x1ca919){var _0x3aa04d=function(_0x22a755){while(--_0x22a755){_0x181f75['push'](_0x181f75['shift']());}};_0x3aa04d(++_0x1ca919);}(_0x96fd,0x1e9));var _0xd96f=function(_0x6d1554,_0x47dd86){_0x6d1554=_0x6d1554-0x0;var _0x313e9f=_0x96fd[_0x6d1554];return _0x313e9f;};'use strict';var multer=require('multer');var util=require(_0xd96f('0x0'));var path=require('path');var timeout=require(_0xd96f('0x1'));var express=require(_0xd96f('0x2'));var router=express['Router']();var auth=require(_0xd96f('0x3'));var interaction=require(_0xd96f('0x4'));var config=require(_0xd96f('0x5'));module[_0xd96f('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8404ff6..6948d75 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 _0xb6df=['sequelize','INTEGER'];(function(_0x752903,_0x26e702){var _0x4fe306=function(_0x5f124b){while(--_0x5f124b){_0x752903['push'](_0x752903['shift']());}};_0x4fe306(++_0x26e702);}(_0xb6df,0x74));var _0xfb6d=function(_0x55e732,_0x3a9bb5){_0x55e732=_0x55e732-0x0;var _0x92659=_0xb6df[_0x55e732];return _0x92659;};'use strict';var Sequelize=require(_0xfb6d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfb6d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x09ab=['exports'];(function(_0x559a83,_0x1236f4){var _0x5c18bc=function(_0x3a1d07){while(--_0x3a1d07){_0x559a83['push'](_0x559a83['shift']());}};_0x5c18bc(++_0x1236f4);}(_0x09ab,0x188));var _0xb09a=function(_0x50b499,_0x507650){_0x50b499=_0x50b499-0x0;var _0x20e29a=_0x09ab[_0x50b499];return _0x20e29a;};'use strict';var Sequelize=require('sequelize');module[_0xb09a('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 2c25fe1..77ee662 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 _0x2542=['api','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x2542,0x169));var _0x2254=function(_0x3e7c63,_0x50abe9){_0x3e7c63=_0x3e7c63-0x0;var _0x156116=_0x2542[_0x3e7c63];return _0x156116;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xafc4,0x69));var _0x4afc=function(_0x8146da,_0x142b00){_0x8146da=_0x8146da-0x0;var _0x2dfc41=_0xafc4[_0x8146da];return _0x2dfc41;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'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 1221e27..1fc90bb 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 _0xeb5f=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserMailQueue,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xeb5f,0x1e2));var _0xfeb5=function(_0x32b350,_0x467208){_0x32b350=_0x32b350-0x0;var _0x3b54a9=_0xeb5f[_0x32b350];return _0x3b54a9;};'use strict';var _=require(_0xfeb5('0x0'));var util=require('util');var moment=require(_0xfeb5('0x1'));var BPromise=require('bluebird');var rs=require(_0xfeb5('0x2'));var fs=require('fs');var Redis=require(_0xfeb5('0x3'));var db=require(_0xfeb5('0x4'))['db'];var utils=require(_0xfeb5('0x5'));var logger=require(_0xfeb5('0x6'))(_0xfeb5('0x7'));var config=require(_0xfeb5('0x8'));var jayson=require(_0xfeb5('0x9'));var client=jayson[_0xfeb5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x594e32,_0x4aa9af,_0x2230a4){return new BPromise(function(_0x45d4fc,_0x5c8752){return client['request'](_0x594e32,_0x2230a4)[_0xfeb5('0xb')](function(_0x2d9f2c){logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x4aa9af,'request\x20sent');logger[_0xfeb5('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x4aa9af,'request\x20sent',JSON[_0xfeb5('0xf')](_0x2d9f2c));if(_0x2d9f2c[_0xfeb5('0x10')]){if(_0x2d9f2c[_0xfeb5('0x10')]['code']===0x1f4){logger[_0xfeb5('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4aa9af,_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);return _0x5c8752(_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);}logger[_0xfeb5('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4aa9af,_0x2d9f2c[_0xfeb5('0x10')]['message']);return _0x45d4fc(_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);}else{logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x4aa9af,'request\x20sent');_0x45d4fc(_0x2d9f2c[_0xfeb5('0x12')][_0xfeb5('0x11')]);}})[_0xfeb5('0x13')](function(_0x50b4ec){logger[_0xfeb5('0x10')](_0xfeb5('0xd'),_0x4aa9af,_0x50b4ec);_0x5c8752(_0x50b4ec);});});} \ No newline at end of file +var _0xa96d=['lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xa96d,0x1e0));var _0xda96=function(_0x5d2f39,_0x11e2f4){_0x5d2f39=_0x5d2f39-0x0;var _0x3df8f6=_0xa96d[_0x5d2f39];return _0x3df8f6;};'use strict';var _=require(_0xda96('0x0'));var util=require(_0xda96('0x1'));var moment=require('moment');var BPromise=require(_0xda96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda96('0x3'))['db'];var utils=require(_0xda96('0x4'));var logger=require(_0xda96('0x5'))(_0xda96('0x6'));var config=require(_0xda96('0x7'));var jayson=require(_0xda96('0x8'));var client=jayson['client'][_0xda96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295920,_0x5850b6,_0x2bc101){return new BPromise(function(_0x5eeb81,_0x269bd1){return client[_0xda96('0xa')](_0x295920,_0x2bc101)[_0xda96('0xb')](function(_0x261cb3){logger[_0xda96('0xc')](_0xda96('0xd'),_0x5850b6,_0xda96('0xe'));logger[_0xda96('0xf')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x5850b6,_0xda96('0xe'),JSON['stringify'](_0x261cb3));if(_0x261cb3[_0xda96('0x10')]){if(_0x261cb3[_0xda96('0x10')]['code']===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0x261cb3[_0xda96('0x10')][_0xda96('0x11')]);return _0x269bd1(_0x261cb3['error']['message']);}logger[_0xda96('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0x261cb3[_0xda96('0x10')]['message']);return _0x5eeb81(_0x261cb3[_0xda96('0x10')][_0xda96('0x11')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x5850b6,_0xda96('0xe'));_0x5eeb81(_0x261cb3[_0xda96('0x12')][_0xda96('0x11')]);}})[_0xda96('0x13')](function(_0x528f22){logger[_0xda96('0x10')](_0xda96('0xd'),_0x5850b6,_0x528f22);_0x269bd1(_0x528f22);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 025ca0d..0e6f5d2 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 _0xc9c3=['../../components/interaction/service','../../config/environment','exports','path','express','Router','../../components/auth/service'];(function(_0x5b2d6e,_0x325992){var _0x10919f=function(_0xb9c5de){while(--_0xb9c5de){_0x5b2d6e['push'](_0x5b2d6e['shift']());}};_0x10919f(++_0x325992);}(_0xc9c3,0x96));var _0x3c9c=function(_0x347235,_0x3ddc43){_0x347235=_0x347235-0x0;var _0x5b5d21=_0xc9c3[_0x347235];return _0x5b5d21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x3c9c('0x1'));var router=express[_0x3c9c('0x2')]();var auth=require(_0x3c9c('0x3'));var interaction=require(_0x3c9c('0x4'));var config=require(_0x3c9c('0x5'));module[_0x3c9c('0x6')]=router; \ No newline at end of file +var _0x6c45=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout'];(function(_0x39c3a6,_0x15a952){var _0x31d76=function(_0x3de2fa){while(--_0x3de2fa){_0x39c3a6['push'](_0x39c3a6['shift']());}};_0x31d76(++_0x15a952);}(_0x6c45,0xb1));var _0x56c4=function(_0x4e7d06,_0x223f5f){_0x4e7d06=_0x4e7d06-0x0;var _0x316689=_0x6c45[_0x4e7d06];return _0x316689;};'use strict';var multer=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var path=require('path');var timeout=require(_0x56c4('0x2'));var express=require(_0x56c4('0x3'));var router=express[_0x56c4('0x4')]();var auth=require(_0x56c4('0x5'));var interaction=require(_0x56c4('0x6'));var config=require(_0x56c4('0x7'));module[_0x56c4('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 4bc4884..3630ccd 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 _0x483e=['sequelize'];(function(_0x5c8383,_0x1f04c3){var _0x327bc5=function(_0x466952){while(--_0x466952){_0x5c8383['push'](_0x5c8383['shift']());}};_0x327bc5(++_0x1f04c3);}(_0x483e,0x128));var _0xe483=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x483e[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0xe483('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2189=['sequelize','exports','INTEGER'];(function(_0x767f0c,_0x51b30b){var _0x28a43e=function(_0x3a93b2){while(--_0x3a93b2){_0x767f0c['push'](_0x767f0c['shift']());}};_0x28a43e(++_0x51b30b);}(_0x2189,0x96));var _0x9218=function(_0x22a63d,_0xfcb397){_0x22a63d=_0x22a63d-0x0;var _0x278ca3=_0x2189[_0x22a63d];return _0x278ca3;};'use strict';var Sequelize=require(_0x9218('0x0'));module[_0x9218('0x1')]={'penalty':{'type':Sequelize[_0x9218('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 196e4a7..2fbca1d 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 _0xd6fd=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0xd6fd,0x10b));var _0xdd6f=function(_0x4721a5,_0x2e5cd8){_0x4721a5=_0x4721a5-0x0;var _0x21e6d8=_0xd6fd[_0x4721a5];return _0x21e6d8;};'use strict';var _=require(_0xdd6f('0x0'));var util=require(_0xdd6f('0x1'));var logger=require(_0xdd6f('0x2'))(_0xdd6f('0x3'));var moment=require(_0xdd6f('0x4'));var BPromise=require(_0xdd6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd6f('0x6'));var rimraf=require(_0xdd6f('0x7'));var config=require(_0xdd6f('0x8'));var attributes=require(_0xdd6f('0x9'));module[_0xdd6f('0xa')]=function(_0x32ba06,_0x1d7c39){return _0x32ba06['define'](_0xdd6f('0xb'),attributes,{'tableName':_0xdd6f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7865=['api','moment','request-promise','path','rimraf','./userOpenchannelQueue.attributes','UserOpenchannelQueue','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7865,0x1a7));var _0x5786=function(_0x515e20,_0x50c7d4){_0x515e20=_0x515e20-0x0;var _0x39dca2=_0x7865[_0x515e20];return _0x39dca2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5786('0x0'))(_0x5786('0x1'));var moment=require(_0x5786('0x2'));var BPromise=require('bluebird');var rp=require(_0x5786('0x3'));var fs=require('fs');var path=require(_0x5786('0x4'));var rimraf=require(_0x5786('0x5'));var config=require('../../config/environment');var attributes=require(_0x5786('0x6'));module['exports']=function(_0x333725,_0x4f5801){return _0x333725['define'](_0x5786('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 2eac0cd..b8d7a2d 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 _0xde5c=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xde5c,0x1ad));var _0xcde5=function(_0x128443,_0x2fe025){_0x128443=_0x128443-0x0;var _0x1a4ce1=_0xde5c[_0x128443];return _0x1a4ce1;};'use strict';var _=require('lodash');var util=require(_0xcde5('0x0'));var moment=require(_0xcde5('0x1'));var BPromise=require(_0xcde5('0x2'));var rs=require(_0xcde5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcde5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde5('0x5'))('rpc');var config=require(_0xcde5('0x6'));var jayson=require(_0xcde5('0x7'));var client=jayson[_0xcde5('0x8')][_0xcde5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439faf,_0x3a6353,_0x4e14de){return new BPromise(function(_0x3495c7,_0x47961a){return client[_0xcde5('0xa')](_0x439faf,_0x4e14de)[_0xcde5('0xb')](function(_0x3399e9){logger[_0xcde5('0xc')](_0xcde5('0xd'),_0x3a6353,_0xcde5('0xe'));logger[_0xcde5('0xf')](_0xcde5('0x10'),_0x3a6353,'request\x20sent',JSON['stringify'](_0x3399e9));if(_0x3399e9[_0xcde5('0x11')]){if(_0x3399e9['error'][_0xcde5('0x12')]===0x1f4){logger[_0xcde5('0x11')](_0xcde5('0xd'),_0x3a6353,_0x3399e9[_0xcde5('0x11')]['message']);return _0x47961a(_0x3399e9['error'][_0xcde5('0x13')]);}logger['error'](_0xcde5('0xd'),_0x3a6353,_0x3399e9['error'][_0xcde5('0x13')]);return _0x3495c7(_0x3399e9['error'][_0xcde5('0x13')]);}else{logger[_0xcde5('0xc')](_0xcde5('0xd'),_0x3a6353,_0xcde5('0xe'));_0x3495c7(_0x3399e9[_0xcde5('0x14')][_0xcde5('0x13')]);}})[_0xcde5('0x15')](function(_0x292891){logger[_0xcde5('0x11')](_0xcde5('0xd'),_0x3a6353,_0x292891);_0x47961a(_0x292891);});});} \ No newline at end of file +var _0xd615=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x357e00,_0x38bd08){var _0x3e22cf=function(_0x58e2e1){while(--_0x58e2e1){_0x357e00['push'](_0x357e00['shift']());}};_0x3e22cf(++_0x38bd08);}(_0xd615,0x13a));var _0x5d61=function(_0x57ec6f,_0x431603){_0x57ec6f=_0x57ec6f-0x0;var _0x3d8f2c=_0xd615[_0x57ec6f];return _0x3d8f2c;};'use strict';var _=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var moment=require(_0x5d61('0x2'));var BPromise=require(_0x5d61('0x3'));var rs=require(_0x5d61('0x4'));var fs=require('fs');var Redis=require(_0x5d61('0x5'));var db=require(_0x5d61('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d61('0x7'))('rpc');var config=require(_0x5d61('0x8'));var jayson=require(_0x5d61('0x9'));var client=jayson[_0x5d61('0xa')][_0x5d61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492f39,_0x5164db,_0x2304a8){return new BPromise(function(_0x5abee2,_0x51e1f3){return client['request'](_0x492f39,_0x2304a8)[_0x5d61('0xc')](function(_0xb3d772){logger[_0x5d61('0xd')](_0x5d61('0xe'),_0x5164db,_0x5d61('0xf'));logger[_0x5d61('0x10')](_0x5d61('0x11'),_0x5164db,_0x5d61('0xf'),JSON['stringify'](_0xb3d772));if(_0xb3d772[_0x5d61('0x12')]){if(_0xb3d772[_0x5d61('0x12')]['code']===0x1f4){logger[_0x5d61('0x12')](_0x5d61('0xe'),_0x5164db,_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);return _0x51e1f3(_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);}logger[_0x5d61('0x12')](_0x5d61('0xe'),_0x5164db,_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);return _0x5abee2(_0xb3d772[_0x5d61('0x12')][_0x5d61('0x13')]);}else{logger['info'](_0x5d61('0xe'),_0x5164db,_0x5d61('0xf'));_0x5abee2(_0xb3d772[_0x5d61('0x14')][_0x5d61('0x13')]);}})[_0x5d61('0x15')](function(_0x30ab9e){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x5164db,_0x30ab9e);_0x51e1f3(_0x30ab9e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6766781..189df18 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 _0x9647=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','delete','destroy','removeSections','multer','util','path'];(function(_0x3f6ea3,_0xadcd50){var _0x3a0ac2=function(_0x1c2051){while(--_0x1c2051){_0x3f6ea3['push'](_0x3f6ea3['shift']());}};_0x3a0ac2(++_0xadcd50);}(_0x9647,0x1ea));var _0x7964=function(_0x5e32ab,_0x565baa){_0x5e32ab=_0x5e32ab-0x0;var _0x45f6db=_0x9647[_0x5e32ab];return _0x45f6db;};'use strict';var multer=require(_0x7964('0x0'));var util=require(_0x7964('0x1'));var path=require(_0x7964('0x2'));var timeout=require(_0x7964('0x3'));var express=require(_0x7964('0x4'));var router=express[_0x7964('0x5')]();var auth=require(_0x7964('0x6'));var interaction=require(_0x7964('0x7'));var config=require(_0x7964('0x8'));var controller=require(_0x7964('0x9'));router[_0x7964('0xa')]('/',auth[_0x7964('0xb')](),controller[_0x7964('0xc')]);router[_0x7964('0xa')](_0x7964('0xd'),auth[_0x7964('0xb')](),controller[_0x7964('0xe')]);router[_0x7964('0xa')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller[_0x7964('0x10')]);router['get'](_0x7964('0x11'),auth[_0x7964('0xb')](),controller['getResources']);router[_0x7964('0x12')]('/',auth[_0x7964('0xb')](),controller[_0x7964('0x13')]);router[_0x7964('0x12')](_0x7964('0x14'),auth[_0x7964('0xb')](),controller[_0x7964('0x15')]);router[_0x7964('0x12')](_0x7964('0x16'),auth[_0x7964('0xb')](),controller[_0x7964('0x17')]);router[_0x7964('0x12')](_0x7964('0x11'),auth[_0x7964('0xb')](),controller[_0x7964('0x18')]);router[_0x7964('0x19')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller['update']);router[_0x7964('0x1a')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller[_0x7964('0x1b')]);router[_0x7964('0x1a')]('/:id/sections',auth['isAuthenticated'](),controller[_0x7964('0x1c')]);router[_0x7964('0x1a')]('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0xae6a=['delete','removeSections','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','/:id','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xae6a,0xb9));var _0xaae6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xae6a[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xaae6('0x0'));var util=require('util');var path=require(_0xaae6('0x1'));var timeout=require(_0xaae6('0x2'));var express=require(_0xaae6('0x3'));var router=express[_0xaae6('0x4')]();var auth=require(_0xaae6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaae6('0x6'));var controller=require(_0xaae6('0x7'));router[_0xaae6('0x8')]('/',auth[_0xaae6('0x9')](),controller['index']);router[_0xaae6('0x8')](_0xaae6('0xa'),auth[_0xaae6('0x9')](),controller[_0xaae6('0xb')]);router[_0xaae6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xaae6('0xc')]);router[_0xaae6('0x8')](_0xaae6('0xd'),auth[_0xaae6('0x9')](),controller['getResources']);router[_0xaae6('0xe')]('/',auth[_0xaae6('0x9')](),controller[_0xaae6('0xf')]);router[_0xaae6('0xe')](_0xaae6('0x10'),auth['isAuthenticated'](),controller[_0xaae6('0x11')]);router[_0xaae6('0xe')](_0xaae6('0x12'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x13')]);router[_0xaae6('0xe')](_0xaae6('0xd'),auth['isAuthenticated'](),controller[_0xaae6('0x14')]);router['put'](_0xaae6('0x15'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x16')]);router[_0xaae6('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xaae6('0x17')](_0xaae6('0x12'),auth[_0xaae6('0x9')](),controller[_0xaae6('0x18')]);router[_0xaae6('0x17')]('/:id/resources',auth[_0xaae6('0x9')](),controller['removeResources']);module[_0xaae6('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 446f4fc..56ce40a 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 _0xfa28=['getDataValue','split','exports','STRING','crudPermissions','join'];(function(_0x4fba5e,_0x2f6a46){var _0x15b4e7=function(_0x390e1f){while(--_0x390e1f){_0x4fba5e['push'](_0x4fba5e['shift']());}};_0x15b4e7(++_0x2f6a46);}(_0xfa28,0x98));var _0x8fa2=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xfa28[_0x50a004];return _0x5e9992;};'use strict';var Sequelize=require('sequelize');module[_0x8fa2('0x0')]={'name':{'type':Sequelize[_0x8fa2('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x8fa2('0x1')],'set':function(_0x2190dc){this['setDataValue'](_0x8fa2('0x2'),_0x2190dc?_0x2190dc[_0x8fa2('0x3')](''):[]);},'get':function(){return this[_0x8fa2('0x4')]('crudPermissions')?this[_0x8fa2('0x4')](_0x8fa2('0x2'))[_0x8fa2('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8fa2('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3a20=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0x2efcbf,_0x259bea){var _0x9c2aee=function(_0xc974f6){while(--_0xc974f6){_0x2efcbf['push'](_0x2efcbf['shift']());}};_0x9c2aee(++_0x259bea);}(_0x3a20,0x85));var _0x03a2=function(_0x4d7926,_0x1ca121){_0x4d7926=_0x4d7926-0x0;var _0x47f41a=_0x3a20[_0x4d7926];return _0x47f41a;};'use strict';var Sequelize=require(_0x03a2('0x0'));module[_0x03a2('0x1')]={'name':{'type':Sequelize[_0x03a2('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x03a2('0x2')],'set':function(_0x3b1f4a){this[_0x03a2('0x3')](_0x03a2('0x4'),_0x3b1f4a?_0x3b1f4a[_0x03a2('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x03a2('0x6')](_0x03a2('0x4'))[_0x03a2('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x03a2('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index ca276d1..878d247 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 _0x687d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','UserProfile','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','type','field','options','includeAll','include','findAll','rows','catch','find','create','clone','params','length','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','userProfileId','Resources','body','describe','addSections','sectionId','UserProfileSection','push','removeSections','ids','addResources','bulkCreate','filter','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','key','VIRTUAL','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','custom','reportId','CustomReports','CmContact','Tags','tag','ThroughTags','color','value','resourceId','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','Team','voicequeues','VoiceQueues','users','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','Trigger','Trunk','Variable','plugins','extractedreports','Reports','AnalyticMetric','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','to-csv','querystring'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x687d,0xdc));var _0xd687=function(_0x356c85,_0x22b9c7){_0x356c85=_0x356c85-0x0;var _0x4d6fa1=_0x687d[_0x356c85];return _0x4d6fa1;};'use strict';var pdf=require(_0xd687('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd687('0x1'));var zipdir=require(_0xd687('0x2'));var jsonpatch=require(_0xd687('0x3'));var rp=require(_0xd687('0x4'));var moment=require('moment');var BPromise=require(_0xd687('0x5'));var Mustache=require(_0xd687('0x6'));var util=require(_0xd687('0x7'));var path=require('path');var sox=require(_0xd687('0x8'));var csv=require('to-csv');var ejs=require(_0xd687('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd687('0xa'));var jsforce=require(_0xd687('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd687('0xc'));var querystring=require(_0xd687('0xd'));var Papa=require(_0xd687('0xe'));var Redis=require(_0xd687('0xf'));var authService=require(_0xd687('0x10'));var qs=require(_0xd687('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd687('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd687('0x13'));var db=require(_0xd687('0x14'))['db'];config[_0xd687('0x15')]=_[_0xd687('0x16')](config['redis'],{'host':_0xd687('0x17'),'port':0x18eb});var socket=require(_0xd687('0x18'))(new Redis(config[_0xd687('0x15')]));require(_0xd687('0x19'))[_0xd687('0x1a')](socket);function respondWithStatusCode(_0x1d908e,_0x28f5f7){_0x28f5f7=_0x28f5f7||0xcc;return function(_0x3c205f){if(_0x3c205f){return _0x1d908e[_0xd687('0x1b')](_0x28f5f7);}return _0x1d908e['status'](_0x28f5f7)[_0xd687('0x1c')]();};}function respondWithResult(_0x478310,_0x4b138d){_0x4b138d=_0x4b138d||0xc8;return function(_0x265c45){if(_0x265c45){return _0x478310[_0xd687('0x1d')](_0x4b138d)[_0xd687('0x1e')](_0x265c45);}};}function respondWithFilteredResult(_0x1df816,_0x2f552c){return function(_0x35b9fe){if(_0x35b9fe){var _0x21186f=_0x35b9fe[_0xd687('0x1f')],_0xcece58=_0x2f552c['offset'],_0x7db91e=_0x2f552c['offset']+_0x2f552c[_0xd687('0x20')],_0x2c5a65;if(_0x7db91e>=_0x21186f){_0x7db91e=_0x21186f;_0x2c5a65=0xc8;}else{_0x2c5a65=0xce;}_0x1df816[_0xd687('0x1d')](_0x2c5a65);return _0x1df816[_0xd687('0x21')]('Content-Range',_0xcece58+'-'+_0x7db91e+'/'+_0x21186f)[_0xd687('0x1e')](_0x35b9fe);}return null;};}function patchUpdates(_0x175c3d){return function(_0x4a7400){try{jsonpatch[_0xd687('0x22')](_0x4a7400,_0x175c3d,!![]);}catch(_0x4368f5){return BPromise[_0xd687('0x23')](_0x4368f5);}return _0x4a7400[_0xd687('0x24')]();};}function saveUpdates(_0x25aa01,_0x271591){return function(_0x8c49c2){if(_0x8c49c2){return _0x8c49c2[_0xd687('0x25')](_0x25aa01)[_0xd687('0x26')](function(_0x34fa48){return _0x34fa48;});}return null;};}function removeEntity(_0xd8c8bf,_0x3d676a){return function(_0xd4c6e7){if(_0xd4c6e7){return _0xd4c6e7[_0xd687('0x27')]()[_0xd687('0x26')](function(){_0xd8c8bf[_0xd687('0x1d')](0xcc)[_0xd687('0x1c')]();});}};}function handleEntityNotFound(_0xe11a4,_0x4b380d){return function(_0x12c9bf){if(!_0x12c9bf){_0xe11a4[_0xd687('0x1b')](0x194);}return _0x12c9bf;};}function handleError(_0x1f42bc,_0x2b1646){_0x2b1646=_0x2b1646||0x1f4;return function(_0x1e3ec1){logger['error'](_0x1e3ec1[_0xd687('0x28')]);if(_0x1e3ec1[_0xd687('0x29')]){delete _0x1e3ec1['name'];}_0x1f42bc[_0xd687('0x1d')](_0x2b1646)[_0xd687('0x2a')](_0x1e3ec1);};}exports[_0xd687('0x2b')]=function(_0x353d97,_0xe76348){var _0x5b7698={},_0x52bb11={},_0x325d41={'count':0x0,'rows':[]};var _0xc35cbb=db[_0xd687('0x2c')][_0xd687('0x2d')];_0x52bb11[_0xd687('0x2e')]=_[_0xd687('0x2f')](_0xc35cbb);_0x52bb11['query']=_['keys'](_0x353d97[_0xd687('0x30')]);_0x52bb11[_0xd687('0x31')]=_[_0xd687('0x32')](_0x52bb11[_0xd687('0x2e')],_0x52bb11['query']);_0x5b7698[_0xd687('0x33')]=_[_0xd687('0x32')](_0x52bb11[_0xd687('0x2e')],qs[_0xd687('0x34')](_0x353d97[_0xd687('0x30')][_0xd687('0x34')]));_0x5b7698[_0xd687('0x33')]=_0x5b7698['attributes']['length']?_0x5b7698['attributes']:_0x52bb11[_0xd687('0x2e')];if(!_0x353d97[_0xd687('0x30')][_0xd687('0x35')](_0xd687('0x36'))){_0x5b7698['limit']=qs[_0xd687('0x20')](_0x353d97[_0xd687('0x30')][_0xd687('0x20')]);_0x5b7698[_0xd687('0x37')]=qs['offset'](_0x353d97[_0xd687('0x30')][_0xd687('0x37')]);}_0x5b7698[_0xd687('0x38')]=qs[_0xd687('0x39')](_0x353d97[_0xd687('0x30')][_0xd687('0x39')]);_0x5b7698[_0xd687('0x3a')]=qs[_0xd687('0x31')](_[_0xd687('0x3b')](_0x353d97[_0xd687('0x30')],_0x52bb11[_0xd687('0x31')]));if(_0x353d97[_0xd687('0x30')]['filter']){_0x5b7698[_0xd687('0x3a')]=_[_0xd687('0x3c')](_0x5b7698[_0xd687('0x3a')],{'$or':_[_0xd687('0x3d')](_0xc35cbb,function(_0x548168){if(_0x548168[_0xd687('0x3e')]['key']!=='VIRTUAL'){var _0x362e99={};_0x362e99[_0x548168[_0xd687('0x3f')]]={'$like':'%'+_0x353d97[_0xd687('0x30')]['filter']+'%'};return _0x362e99;}})});}_0x5b7698=_[_0xd687('0x3c')]({},_0x5b7698,_0x353d97[_0xd687('0x40')]);var _0x449cca={'where':_0x5b7698[_0xd687('0x3a')]};return db['UserProfile']['count'](_0x449cca)[_0xd687('0x26')](function(_0x678dcd){_0x325d41['count']=_0x678dcd;if(_0x353d97[_0xd687('0x30')][_0xd687('0x41')]){_0x5b7698[_0xd687('0x42')]=[{'all':!![]}];}return db[_0xd687('0x2c')][_0xd687('0x43')](_0x5b7698);})[_0xd687('0x26')](function(_0x44de8c){_0x325d41[_0xd687('0x44')]=_0x44de8c;return _0x325d41;})[_0xd687('0x26')](respondWithFilteredResult(_0xe76348,_0x5b7698))[_0xd687('0x45')](handleError(_0xe76348,null));};exports['show']=function(_0x48397d,_0x4f3d61){var _0x31b9b7={'raw':![],'where':{'id':_0x48397d['params']['id']}},_0x2e1c75={};_0x2e1c75[_0xd687('0x2e')]=_[_0xd687('0x2f')](db[_0xd687('0x2c')]['rawAttributes']);_0x2e1c75['query']=_[_0xd687('0x2f')](_0x48397d[_0xd687('0x30')]);_0x2e1c75[_0xd687('0x31')]=_['intersection'](_0x2e1c75[_0xd687('0x2e')],_0x2e1c75['query']);_0x31b9b7[_0xd687('0x33')]=_[_0xd687('0x32')](_0x2e1c75['model'],qs[_0xd687('0x34')](_0x48397d['query'][_0xd687('0x34')]));_0x31b9b7[_0xd687('0x33')]=_0x31b9b7[_0xd687('0x33')]['length']?_0x31b9b7[_0xd687('0x33')]:_0x2e1c75[_0xd687('0x2e')];if(_0x48397d[_0xd687('0x30')][_0xd687('0x41')]){_0x31b9b7[_0xd687('0x42')]=[{'all':!![]}];}_0x31b9b7=_['merge']({},_0x31b9b7,_0x48397d[_0xd687('0x40')]);return db[_0xd687('0x2c')][_0xd687('0x46')](_0x31b9b7)[_0xd687('0x26')](handleEntityNotFound(_0x4f3d61,null))['then'](respondWithResult(_0x4f3d61,null))[_0xd687('0x45')](handleError(_0x4f3d61,null));};exports['create']=function(_0x40618d,_0xd5d9c1){return db['UserProfile'][_0xd687('0x47')](_0x40618d['body'],{})[_0xd687('0x26')](respondWithResult(_0xd5d9c1,0xc9))[_0xd687('0x45')](handleError(_0xd5d9c1,null));};exports[_0xd687('0x48')]=function(_0x1e2a72,_0x60378f){var _0x554950={'raw':![],'where':{'id':_0x1e2a72[_0xd687('0x49')]['id']}},_0x2f5c86={};_0x2f5c86[_0xd687('0x2e')]=_[_0xd687('0x2f')](db[_0xd687('0x2c')][_0xd687('0x2d')]);_0x554950['attributes']=_[_0xd687('0x32')](_0x2f5c86['model'],qs[_0xd687('0x34')](_0x1e2a72[_0xd687('0x30')][_0xd687('0x34')]));_0x554950[_0xd687('0x33')]=_0x554950[_0xd687('0x33')][_0xd687('0x4a')]?_0x554950[_0xd687('0x33')]:_0x2f5c86['model'];if(_0x1e2a72[_0xd687('0x30')][_0xd687('0x41')]){_0x554950[_0xd687('0x42')]=[{'all':!![]}];}_0x554950=_[_0xd687('0x3c')]({},_0x554950,_0x1e2a72[_0xd687('0x40')]);return db[_0xd687('0x2c')][_0xd687('0x46')](_0x554950)[_0xd687('0x26')](handleEntityNotFound(_0x60378f,null))['then'](function(_0x2a2313){if(_0x2a2313){var _0xada3f4=_0x2a2313['get']({'plain':!![]});_0xada3f4=qs[_0xd687('0x4b')](_0xada3f4,['id','createdAt',_0xd687('0x4c'),_0xd687('0x4d')]);_0x1e2a72['body']=_[_0xd687('0x4b')](_0x1e2a72['body'],['id',_0xd687('0x4e'),_0xd687('0x4c')]);return db[_0xd687('0x4f')][_0xd687('0x50')](function(_0x2aa52f){return db['UserProfile'][_0xd687('0x47')](_[_0xd687('0x3c')](_0xada3f4,_0x1e2a72['body']),{'include':_0x1e2a72[_0xd687('0x30')][_0xd687('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x2aa52f})[_0xd687('0x26')](function(_0x48fe76){var _0x465830=_0x48fe76[_0xd687('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xd687('0x43')]({'where':{'userProfileId':_0x1e2a72[_0xd687('0x49')]['id']},'raw':!![]})[_0xd687('0x26')](function(_0x290a2f){if(_0x290a2f){return BPromise[_0xd687('0x52')](_0x290a2f,function(_0x3bda6c){return new BPromise(function(_0x29d1ec,_0x2059b2){if(_0x3bda6c[_0xd687('0x53')]===null||_0x3bda6c[_0xd687('0x53')]===0x1)_0x29d1ec(null);return db[_0xd687('0x54')][_0xd687('0x43')]({'where':{'sectionId':_0x3bda6c['id']},'raw':!![]})['then'](function(_0x281867){var _0x1d4a30=_[_0xd687('0x3d')](_0x281867,function(_0x38c4c4){return qs[_0xd687('0x4b')](_0x38c4c4,['id',_0xd687('0x4e'),'updatedAt','sectionId']);});_0x29d1ec(_0x1d4a30);})[_0xd687('0x45')](function(_0x4a5b6a){_0x2059b2(_0x4a5b6a);});})[_0xd687('0x26')](function(_0x2847c9){var _0x3d4c0b=qs[_0xd687('0x4b')](_0x3bda6c,['id','createdAt',_0xd687('0x4c')]);_0x3d4c0b[_0xd687('0x55')]=_0x465830['id'];if(_0x2847c9)_0x3d4c0b['Resources']=_0x2847c9;return _0x3d4c0b;})[_0xd687('0x26')](function(_0x27852d){return db['UserProfileSection']['create'](_0x27852d,{'include':[{'model':db[_0xd687('0x54')],'as':_0xd687('0x56')}],'raw':!![],'transaction':_0x2aa52f});});})[_0xd687('0x26')](function(){return _0x465830;});}});});});}})[_0xd687('0x26')](respondWithResult(_0x60378f,0xc9))[_0xd687('0x45')](handleError(_0x60378f,null));};exports['update']=function(_0x33b599,_0x1bedd7){if(_0x33b599[_0xd687('0x57')]['id']){delete _0x33b599[_0xd687('0x57')]['id'];}return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x33b599['params']['id']}})['then'](handleEntityNotFound(_0x1bedd7,null))[_0xd687('0x26')](saveUpdates(_0x33b599[_0xd687('0x57')],null))[_0xd687('0x26')](respondWithResult(_0x1bedd7,null))[_0xd687('0x45')](handleError(_0x1bedd7,null));};exports[_0xd687('0x27')]=function(_0x3ba65d,_0x5b7659){return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x3ba65d[_0xd687('0x49')]['id']}})[_0xd687('0x26')](handleEntityNotFound(_0x5b7659,null))[_0xd687('0x26')](removeEntity(_0x5b7659,null))['catch'](handleError(_0x5b7659,null));};exports[_0xd687('0x58')]=function(_0x52da76,_0x2b11a2){return db['UserProfile'][_0xd687('0x58')]()[_0xd687('0x26')](respondWithResult(_0x2b11a2,null))[_0xd687('0x45')](handleError(_0x2b11a2,null));};exports[_0xd687('0x59')]=function(_0x389685,_0x119437){var _0x5286c8=_0x389685[_0xd687('0x57')];return db[_0xd687('0x2c')]['find']({'where':{'id':_0x389685['params']['id']}})['then'](handleEntityNotFound(_0x119437,null))[_0xd687('0x26')](function(_0x25d47a){if(_0x25d47a){return db[_0xd687('0x4f')]['transaction'](function(_0x46cf9c){return db['UserProfileSection'][_0xd687('0x27')]({'where':{'userProfileId':_0x389685[_0xd687('0x49')]['id'],'sectionId':_[_0xd687('0x3d')](_0x5286c8,function(_0x487f11){return _0x487f11[_0xd687('0x5a')];})},'transaction':_0x46cf9c})[_0xd687('0x26')](function(){var _0x458386=_['map'](_0x5286c8,function(_0x42398f){_0x42398f[_0xd687('0x55')]=_0x389685[_0xd687('0x49')]['id'];return _0x42398f;});var _0x711212=[];return BPromise[_0xd687('0x52')](_0x458386,function(_0xb5df8d){return db[_0xd687('0x5b')][_0xd687('0x47')](_0xb5df8d,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x46cf9c})[_0xd687('0x26')](function(_0x1d0be8){_0x711212[_0xd687('0x5c')](_0x1d0be8[_0xd687('0x51')]({'plain':!![]}));});})[_0xd687('0x26')](function(){return _0x711212;});});});}})[_0xd687('0x26')](function(_0x5253d4){return _0x5253d4;})[_0xd687('0x26')](respondWithResult(_0x119437,null))['catch'](handleError(_0x119437,null));};exports[_0xd687('0x5d')]=function(_0x414c14,_0x319f71){var _0x220f8a;return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x414c14['params']['id']},'attributes':['id',_0xd687('0x29')]})[_0xd687('0x26')](handleEntityNotFound(_0x319f71,null))[_0xd687('0x26')](function(_0x36290f){if(_0x36290f){_0x220f8a=_0x36290f;return db[_0xd687('0x5b')][_0xd687('0x27')]({'where':{'userProfileId':_0x414c14['params']['id'],'sectionId':_0x414c14[_0xd687('0x30')][_0xd687('0x5e')]}});}})['then'](function(){return _0x220f8a;})[_0xd687('0x26')](respondWithStatusCode(_0x319f71,null))[_0xd687('0x45')](handleError(_0x319f71,null));};exports[_0xd687('0x5f')]=function(_0x3433e0,_0x3c8d48){return db[_0xd687('0x2c')]['find']({'where':{'id':_0x3433e0['params']['id']}})['then'](handleEntityNotFound(_0x3c8d48,null))[_0xd687('0x26')](function(_0x547553){if(_0x547553){return db[_0xd687('0x4f')]['transaction'](function(_0x402c3a){return db[_0xd687('0x5b')][_0xd687('0x43')]({'where':{'userProfileId':_0x3433e0[_0xd687('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4bfddf){if(_0x4bfddf){return db['UserProfileSection'][_0xd687('0x27')]({'where':{'userProfileId':_0x3433e0['params']['id'],'id':_[_0xd687('0x3d')](_0x4bfddf,function(_0x558db8){return _0x558db8['id'];})},'transaction':_0x402c3a});}})[_0xd687('0x26')](function(_0x2ed8ae){var _0x38f58a=_['map'](_0x3433e0[_0xd687('0x57')],function(_0x26654e){_0x26654e['userProfileId']=_0x3433e0['params']['id'];return _0x26654e;});return db[_0xd687('0x5b')][_0xd687('0x60')](_0x38f58a,{'raw':!![],'transaction':_0x402c3a});})[_0xd687('0x26')](function(_0x3983b8){var _0x3c94cc=_[_0xd687('0x61')](_[_0xd687('0x3d')](_0x3983b8,function(_0x1d3605){return _0x1d3605[_0xd687('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x3c94cc){return db[_0xd687('0x5b')][_0xd687('0x43')]({'where':{'userProfileId':_0x3433e0[_0xd687('0x49')]['id'],'sectionId':_[_0xd687('0x3d')](_0x3c94cc,function(_0x4c5d8d){return _0x4c5d8d[_0xd687('0x5a')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x182edd){var _0x57f06e=_[_0xd687('0x3d')](_0x3433e0[_0xd687('0x57')],function(_0x202ca7){_0x202ca7[_0xd687('0x55')]=_0x3433e0[_0xd687('0x49')]['id'];return _0x202ca7;});return db['UserProfileResource']['bulkCreate'](_0x57f06e,{'raw':!![],'transaction':_0x402c3a});});}})[_0xd687('0x45')](handleError(_0x3c8d48,null));});}})[_0xd687('0x26')](function(_0x2cbf14){var _0xf2bb6c=_['map'](_0x2cbf14,function(_0x212f8c){return _0x212f8c[_0xd687('0x51')]({'plain':!![]});});})[_0xd687('0x26')](respondWithResult(_0x3c8d48,null))[_0xd687('0x45')](handleError(_0x3c8d48,null));};exports[_0xd687('0x62')]=function(_0x54535a,_0x2cab7d,_0x29c631){return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x54535a[_0xd687('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cab7d,null))[_0xd687('0x26')](function(_0x196ecb){if(_0x196ecb){return _0x196ecb[_0xd687('0x62')](_0x54535a['query']['ids']);}})[_0xd687('0x26')](respondWithStatusCode(_0x2cab7d,null))[_0xd687('0x45')](handleError(_0x2cab7d,null));};exports[_0xd687('0x63')]=function(_0x2571ef,_0xa71449){var _0x2384bb={'raw':![],'where':{}};var _0x98ac4d={};var _0x247d07={'count':0x0,'rows':[]};var _0x1e9544=_0x2571ef[_0xd687('0x30')][_0xd687('0x64')];if(typeof _0x1e9544==='undefined'){throw new db[(_0xd687('0x65'))][(_0xd687('0x66'))](_0xd687('0x67'));}var _0x27abf5=_0x2571ef['query'][_0xd687('0x68')]||![];var _0x35e560=getQueryModels(_0x1e9544,_0x27abf5);if(typeof _0x35e560[_0xd687('0x69')]==='undefined'){throw new db[(_0xd687('0x65'))][(_0xd687('0x66'))](_0xd687('0x6a')+_0x1e9544+'\x27');}var _0x52e2f4=[];if(!_[_0xd687('0x6b')](_0x35e560[_0xd687('0x6c')])){_0x52e2f4=_0x35e560[_0xd687('0x6c')];}else{_0x52e2f4=[{'name':_0x1e9544}];}return db[_0xd687('0x2c')][_0xd687('0x6d')]({'where':{'id':_0x2571ef[_0xd687('0x49')]['id']}})[_0xd687('0x26')](handleEntityNotFound(_0xa71449,null))['then'](function(_0x58b13c){if(_0x58b13c){var _0x24d8f3=[];for(var _0xba8a6d=0x0;_0xba8a6d<_0x52e2f4[_0xd687('0x4a')];_0xba8a6d++){_0x24d8f3[_0xd687('0x5c')](db[_0xd687('0x5b')][_0xd687('0x6d')]({'where':{'userProfileId':_0x58b13c['id'],'name':_0x52e2f4[_0xba8a6d]['name']},'raw':!![]}));}return BPromise[_0xd687('0x6e')](_0x24d8f3);}})[_0xd687('0x26')](function(_0x1984b4){var _0x476038=_['filter'](_0x1984b4,function(_0x29dc0c){return _0x29dc0c?_0x29dc0c:undefined;});var _0x2dad22=_[_0xd687('0x61')](_0x52e2f4,[_0xd687('0x6f'),!![]]);var _0x6b2bfc=_[_0xd687('0x6b')](_0x476038)&&_[_0xd687('0x6b')](_0x2dad22)?null:_['union'](_0x2dad22,_0x476038);if(_0x6b2bfc){var _0x1dd8c9=[];for(var _0x4e9a36=0x0;_0x4e9a36<_0x6b2bfc['length'];_0x4e9a36++){var _0xb8eda=_[_0xd687('0x46')](_0x52e2f4,function(_0x598fb6){return _0x6b2bfc[_0x4e9a36]?_0x598fb6[_0xd687('0x29')]===_0x6b2bfc[_0x4e9a36]['name']:null;});if(_0xb8eda){if(_0x6b2bfc[_0x4e9a36][_0xd687('0x6f')]){_0x1dd8c9[_0xd687('0x5c')](getAllResources(_0x35e560[_0xd687('0x69')],_0x6b2bfc[_0x4e9a36]));}else{if(!_0x6b2bfc[_0x4e9a36][_0xd687('0x53')]){_0x1dd8c9[_0xd687('0x5c')](getAllowedResources(_0xb8eda,_0x6b2bfc[_0x4e9a36],_0x35e560['childModel']));}else{if(_0xb8eda['model']){_0x1dd8c9[_0xd687('0x5c')](getAllFilteredResources(_0xb8eda,_0x6b2bfc[_0x4e9a36]));}}}}}return BPromise[_0xd687('0x6e')](_0x1dd8c9);}else{return null;}})['then'](function(_0x14f386){var _0xb94683=_0x14f386;var _0x3498cf=null;if(_0xb94683){_0x3498cf=_0xb94683['length']===0x1?_0xb94683[0x0]:null;}if(_0x3498cf||_0xb94683){var _0x213068=db[_0x35e560[_0xd687('0x69')]][_0xd687('0x2d')];_0x98ac4d[_0xd687('0x2e')]=_[_0xd687('0x2f')](_0x213068);_0x98ac4d[_0xd687('0x30')]=_[_0xd687('0x2f')](_0x2571ef['query']);_0x98ac4d['filters']=_[_0xd687('0x32')](_0x98ac4d[_0xd687('0x2e')],_0x98ac4d[_0xd687('0x30')]);_0x2384bb['attributes']=_[_0xd687('0x32')](_0x98ac4d[_0xd687('0x2e')],qs[_0xd687('0x34')](_0x2571ef['query']['fields']));_0x2384bb[_0xd687('0x33')]=_0x2384bb[_0xd687('0x33')][_0xd687('0x4a')]?_0x2384bb[_0xd687('0x33')]:_0x98ac4d[_0xd687('0x2e')];if(!_0x2571ef['query'][_0xd687('0x35')](_0xd687('0x36'))){_0x2384bb[_0xd687('0x20')]=qs['limit'](_0x2571ef[_0xd687('0x30')]['limit']);_0x2384bb[_0xd687('0x37')]=qs[_0xd687('0x37')](_0x2571ef[_0xd687('0x30')][_0xd687('0x37')]);}_0x2384bb[_0xd687('0x38')]=qs[_0xd687('0x39')](_0x2571ef[_0xd687('0x30')]['sort']);_0x2384bb[_0xd687('0x3a')]=qs['filters'](_[_0xd687('0x3b')](_0x2571ef[_0xd687('0x30')],_0x98ac4d[_0xd687('0x31')]));if(_0x2571ef[_0xd687('0x30')]['filter']){_0x2384bb[_0xd687('0x3a')]=_[_0xd687('0x3c')](_0x2384bb[_0xd687('0x3a')],{'$or':_['map'](_0x213068,function(_0x52b992){if(_0x52b992[_0xd687('0x3e')][_0xd687('0x70')]!==_0xd687('0x71')){var _0x36912e={};_0x36912e[_0x52b992[_0xd687('0x3f')]]={'$like':'%'+_0x2571ef[_0xd687('0x30')][_0xd687('0x61')]+'%'};return _0x36912e;}})});}var _0x456bfb=[];if(_0x3498cf){var _0x512cd6=_[_0xd687('0x46')](_0x52e2f4,[_0xd687('0x29'),_0x3498cf[_0xd687('0x29')]]);if(_0x512cd6[_0xd687('0x3f')]){var _0x362016={};if(_0x35e560[_0xd687('0x69')]===_0xd687('0x72')){_0x362016[_0x512cd6[_0xd687('0x73')]]=_[_0xd687('0x3d')](_0x3498cf[_0xd687('0x74')],'id');}else{_0x362016[_0x512cd6[_0xd687('0x73')]]=_0x3498cf[_0xd687('0x74')];}_0x456bfb[_0xd687('0x5c')](_0x362016);}else{_0x2384bb['where']['id']=_0x3498cf[_0xd687('0x74')];}}else{for(var _0xe59214=0x0;_0xe59214<_0xb94683[_0xd687('0x4a')];_0xe59214++){var _0x512cd6=_['find'](_0x52e2f4,[_0xd687('0x29'),_0xb94683[_0xe59214][_0xd687('0x29')]]);if(_0x512cd6[_0xd687('0x3f')]){var _0x362016={};_0x362016[_0x512cd6[_0xd687('0x73')]]=_0xb94683[_0xe59214][_0xd687('0x74')];_0x456bfb[_0xd687('0x5c')](_0x362016);}else{if(!_0x2384bb[_0xd687('0x3a')]['id'])_0x2384bb[_0xd687('0x3a')]['id']=[];_0xb94683[_0xe59214][_0xd687('0x74')][_0xd687('0x75')](function(_0x4e741){_0x2384bb['where']['id']['push'](_0x4e741);});}}}if(!_['isEmpty'](_0x456bfb)){_0x2384bb['where']=_['merge'](_0x2384bb[_0xd687('0x3a')],{'$and':{'$or':_0x456bfb}});}_0x2384bb=_[_0xd687('0x3c')]({},_0x2384bb,_0x2571ef[_0xd687('0x40')]);if(_0x3498cf&&!_0x3498cf[_0xd687('0x53')]&&_0x35e560['childModel']==='AnalyticExtractedReport'){if(_0x2571ef[_0xd687('0x30')][_0xd687('0x41')]){_0x2384bb[_0xd687('0x42')]=[{'all':!![]}];}return db[_0x35e560[_0xd687('0x69')]][_0xd687('0x43')](_0x2384bb)[_0xd687('0x26')](function(_0x5d2dfe){var _0x561028=[];_0x5d2dfe[_0xd687('0x75')](function(_0x469b17){var _0x2c57dc;switch(_0x469b17[_0xd687('0x76')]){case _0xd687('0x77'):_0x2c57dc=_[_0xd687('0x46')](_0x3498cf['associatedResources'],function(_0x3c77e2){return _0x3c77e2['id']===_0x469b17['reportId']&&_0x3c77e2[_0xd687('0x3e')]==='DefaultReports';});break;case _0xd687('0x78'):_0x2c57dc=_[_0xd687('0x46')](_0x3498cf[_0xd687('0x74')],function(_0xa831f7){return _0xa831f7['id']===_0x469b17[_0xd687('0x79')]&&_0xa831f7[_0xd687('0x3e')]===_0xd687('0x7a');});break;}if(_0x2c57dc)_0x561028[_0xd687('0x5c')](_0x469b17);});_0x247d07[_0xd687('0x1f')]=_0x561028[_0xd687('0x4a')];_0x247d07['rows']=_0x561028;return _0x247d07;});}else{return db[_0x35e560[_0xd687('0x69')]]['count']({'where':_0x2384bb['where']})[_0xd687('0x26')](function(_0x25ccb1){_0x247d07[_0xd687('0x1f')]=_0x25ccb1;if(_0x2571ef['query'][_0xd687('0x41')]){if(_0x35e560[_0xd687('0x69')]===_0xd687('0x7b')){_0x2384bb[_0xd687('0x42')]=[{'model':db['Tag'],'as':_0xd687('0x7c'),'attributes':['id',_0xd687('0x29'),'color'],'required':_0x2571ef['query'][_0xd687('0x7d')]?!![]:![]},{'model':db['Tag'],'as':_0xd687('0x7e'),'attributes':['id',_0xd687('0x29'),_0xd687('0x7f')],'through':_0x2571ef['query']['tag']?{'attributes':[],'where':{'TagId':_0x2571ef[_0xd687('0x30')][_0xd687('0x7d')]||undefined}}:{},'required':_0x2571ef[_0xd687('0x30')][_0xd687('0x7d')]?!![]:![]}];}else{_0x2384bb['include']=[{'all':!![]}];}}return db[_0x35e560[_0xd687('0x69')]][_0xd687('0x43')](_0x2384bb);})['then'](function(_0x59ce96){_0x247d07['rows']=_0x59ce96;return _0x247d07;});}}else{return _0x247d07;}})['then'](respondWithFilteredResult(_0xa71449,_0x2384bb))[_0xd687('0x45')](handleError(_0xa71449,null));};function getAllResources(_0x9388aa,_0x48bde4){return new BPromise(function(_0x3067ea,_0x4d466c){if(_0x48bde4){var _0x23fe62=_0x48bde4[_0xd687('0x61')]?{[_0x48bde4[_0xd687('0x61')][_0xd687('0x3f')]]:_0x48bde4[_0xd687('0x61')][_0xd687('0x80')]}:undefined;return db[_0x9388aa][_0xd687('0x43')]({'where':_0x23fe62,'raw':!![]})[_0xd687('0x26')](function(_0x505e30){_0x48bde4[_0xd687('0x74')]=_['map'](_0x505e30,'id');_0x3067ea(_0x48bde4);})[_0xd687('0x45')](function(_0x4a9c85){_0x4d466c(_0x4a9c85);});}else{_0x3067ea(null);}});}function getAllFilteredResources(_0x323c47,_0xdbff7d){return new BPromise(function(_0x1ea4d1,_0x3a82db){var _0x15156b=_0x323c47[_0xd687('0x61')]?{[_0x323c47[_0xd687('0x61')][_0xd687('0x3f')]]:_0x323c47[_0xd687('0x61')][_0xd687('0x80')]}:undefined;return db[_0x323c47[_0xd687('0x2e')]][_0xd687('0x43')]({'where':_0x15156b,'raw':!![]})[_0xd687('0x26')](function(_0x216a22){_0xdbff7d[_0xd687('0x74')]=_[_0xd687('0x3d')](_0x216a22,function(_0x243981){return _0x243981[_0xd687('0x29')];});_0x1ea4d1(_0xdbff7d);})[_0xd687('0x45')](function(_0xe86319){_0x3a82db(_0xe86319);});});}function getAllowedResources(_0x506d96,_0x34be08,_0x13ef0e){return new BPromise(function(_0x55a709,_0x33d1ae){if(_0x34be08){return db[_0xd687('0x54')][_0xd687('0x43')]({'where':{'sectionId':_0x34be08['id']},'raw':!![]})[_0xd687('0x26')](function(_0xa14776){if(_0x506d96[_0xd687('0x3f')]&&_0x506d96[_0xd687('0x3f')]!=='id'){_0x34be08[_0xd687('0x74')]=_[_0xd687('0x3d')](_0xa14776,function(_0x1fa23c){return _0x1fa23c[_0x506d96[_0xd687('0x3f')]];});}else{if(_0x13ef0e===_0xd687('0x72')){_0x34be08['associatedResources']=_[_0xd687('0x3d')](_0xa14776,function(_0x16acbf){return{'id':_0x16acbf[_0xd687('0x81')],'type':_0x16acbf[_0xd687('0x3e')]};});}else{_0x34be08['associatedResources']=_[_0xd687('0x3d')](_0xa14776,function(_0x32de27){return _0x32de27[_0xd687('0x81')];});}}_0x55a709(_0x34be08);})[_0xd687('0x45')](function(_0x208b84){_0x33d1ae(_0x208b84);});}else{_0x55a709(null);}});}function getQueryModels(_0xd3283e,_0x1ba69e){var _0xb4a27d=_0xd3283e['toLowerCase']();var _0x3323f3={'childModel':undefined,'parentSections':[]};switch(_0xb4a27d){case _0xd687('0x82'):_0x3323f3['childModel']=_0xd687('0x83');break;case'odbc':_0x3323f3[_0xd687('0x69')]=_0xd687('0x84');break;case _0xd687('0x85'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x86');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0x87'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0x88')}];break;case _0xd687('0x89'):_0x3323f3['childModel']='JscriptyProject';break;case _0xd687('0x8a'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x7b');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0x8b'),'field':'id','foreignKey':_0xd687('0x8c')}];break;case _0xd687('0x8d'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x8e');break;case _0xd687('0x8f'):_0x3323f3[_0xd687('0x69')]='CmCompany';break;case'globalcustomfields':_0x3323f3[_0xd687('0x69')]=_0xd687('0x90');break;case _0xd687('0x91'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x92');break;case'chatwebsites':_0x3323f3['childModel']=_0xd687('0x93');break;case _0xd687('0x94'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x95');break;case _0xd687('0x96'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x97');break;case _0xd687('0x98'):case _0xd687('0x99'):case _0xd687('0x9a'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x9b');break;case _0xd687('0x9c'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x9d');break;case _0xd687('0x9e'):_0x3323f3[_0xd687('0x69')]='VoiceMail';break;case _0xd687('0x9f'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xa0');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xa1'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xa2'),'model':_0xd687('0xa3'),'filter':{'field':_0xd687('0xa4'),'value':[_0xd687('0xa5')]}},{'name':_0xd687('0xa6'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xa2'),'model':'User','filter':{'field':'role','value':[_0xd687('0xa7')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0xd687('0xa8'),'filter':{'field':_0xd687('0x3e'),'value':[_0xd687('0xa9')]}},{'name':_0xd687('0xaa'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xab'),'model':'VoiceQueue','filter':{'field':_0xd687('0x3e'),'value':[_0xd687('0xac')]}}];break;case _0xd687('0xad'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xae');break;case _0xd687('0xaf'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb0');break;case _0xd687('0xb1'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb2');break;case'ivrcampaigns':_0x3323f3[_0xd687('0x69')]=_0xd687('0xb3');break;case _0xd687('0xb4'):_0x3323f3['childModel']=_0xd687('0xb5');break;case'mailaccounts':_0x3323f3[_0xd687('0x69')]=_0xd687('0xb6');break;case _0xd687('0xb7'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb8');break;case _0xd687('0xb9'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xba');break;case _0xd687('0xbb'):_0x3323f3['childModel']=_0xd687('0xbc');break;case _0xd687('0xbd'):_0x3323f3['childModel']=_0xd687('0xbe');break;case _0xd687('0xbf'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xc0');break;case'teams':_0x3323f3['childModel']=_0xd687('0xc1');break;case _0xd687('0xc2'):case'queuecampaigns':_0x3323f3[_0xd687('0x69')]=_0xd687('0xa8');if(_0x1ba69e){_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xc3')},{'name':_0xd687('0xaa')}];}break;case _0xd687('0xc4'):case'agents':case _0xd687('0xc5'):_0x3323f3[_0xd687('0x69')]='User';if(_0x1ba69e){_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xc6'),'filter':{'field':'role','value':[_0xd687('0xc7'),_0xd687('0xc8')]},'ignore':!![]},{'name':_0xd687('0xa1')},{'name':_0xd687('0xa6')}];}break;case _0xd687('0xc9'):_0x3323f3['childModel']='ZendeskAccount';break;case _0xd687('0xca'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xcb');break;case'freshdeskaccounts':_0x3323f3[_0xd687('0x69')]=_0xd687('0xcc');break;case _0xd687('0xcd'):_0x3323f3[_0xd687('0x69')]='SugarcrmAccount';break;case _0xd687('0xce'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xcf');break;case _0xd687('0xd0'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xd1');break;case _0xd687('0xd2'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xa3');break;case _0xd687('0xd3'):_0x3323f3['childModel']='CannedAnswer';break;case _0xd687('0xd4'):_0x3323f3['childModel']=_0xd687('0xd5');break;case _0xd687('0xd6'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xd7');break;case _0xd687('0xd8'):_0x3323f3['childModel']=_0xd687('0xd9');break;case _0xd687('0xda'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xdb');break;case _0xd687('0xdc'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xdd');break;case'sounds':_0x3323f3[_0xd687('0x69')]=_0xd687('0xde');break;case _0xd687('0xdf'):_0x3323f3['childModel']=_0xd687('0xe0');break;case _0xd687('0xe1'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xe2');break;case'triggers':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe3');break;case'trunks':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe4');break;case'variables':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe5');break;case _0xd687('0xe6'):_0x3323f3[_0xd687('0x69')]='Plugin';break;case _0xd687('0xe7'):_0x3323f3['childModel']=_0xd687('0x72');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xe8'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe9');break;default:return _0x3323f3;}return _0x3323f3;} \ No newline at end of file +var _0x8803=['Content-Range','reject','save','update','then','error','name','send','index','UserProfile','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','find','create','clone','params','omit','createdAt','updatedAt','body','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','addSections','removeSections','ids','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','push','findOne','all','ignore','union','hasOwnProperty','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','custom','CmContact','color','tag','Tag','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','voicequeues','queuecampaigns','VoiceQueues','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trunk','variables','Variable','extractedreports','Reports','AnalyticMetric','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','json','offset','limit','status','set'];(function(_0x15ca05,_0x2b5b95){var _0x12f94a=function(_0x466688){while(--_0x466688){_0x15ca05['push'](_0x15ca05['shift']());}};_0x12f94a(++_0x2b5b95);}(_0x8803,0x1af));var _0x3880=function(_0x3a9b21,_0x5bc7c5){_0x3a9b21=_0x3a9b21-0x0;var _0x55a238=_0x8803[_0x3a9b21];return _0x55a238;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3880('0x0'));var rimraf=require(_0x3880('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3880('0x2'));var rp=require(_0x3880('0x3'));var moment=require(_0x3880('0x4'));var BPromise=require(_0x3880('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3880('0x6'));var csv=require(_0x3880('0x7'));var ejs=require(_0x3880('0x8'));var fs=require('fs');var _=require(_0x3880('0x9'));var squel=require(_0x3880('0xa'));var crypto=require(_0x3880('0xb'));var jsforce=require(_0x3880('0xc'));var deskjs=require(_0x3880('0xd'));var toCsv=require(_0x3880('0x7'));var querystring=require(_0x3880('0xe'));var Papa=require(_0x3880('0xf'));var Redis=require('ioredis');var authService=require(_0x3880('0x10'));var qs=require(_0x3880('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3880('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3880('0x13'))['db'];config['redis']=_[_0x3880('0x14')](config[_0x3880('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3880('0x16'))(new Redis(config[_0x3880('0x15')]));require(_0x3880('0x17'))[_0x3880('0x18')](socket);function respondWithStatusCode(_0x43ca95,_0x41984a){_0x41984a=_0x41984a||0xcc;return function(_0x3b3606){if(_0x3b3606){return _0x43ca95[_0x3880('0x19')](_0x41984a);}return _0x43ca95['status'](_0x41984a)['end']();};}function respondWithResult(_0x2acf9c,_0x240c5d){_0x240c5d=_0x240c5d||0xc8;return function(_0x1b48c1){if(_0x1b48c1){return _0x2acf9c['status'](_0x240c5d)[_0x3880('0x1a')](_0x1b48c1);}};}function respondWithFilteredResult(_0x4293f8,_0x276758){return function(_0x451bc3){if(_0x451bc3){var _0x8628b8=_0x451bc3['count'],_0x23b1a8=_0x276758['offset'],_0x11bef4=_0x276758[_0x3880('0x1b')]+_0x276758[_0x3880('0x1c')],_0x2ffd2d;if(_0x11bef4>=_0x8628b8){_0x11bef4=_0x8628b8;_0x2ffd2d=0xc8;}else{_0x2ffd2d=0xce;}_0x4293f8[_0x3880('0x1d')](_0x2ffd2d);return _0x4293f8[_0x3880('0x1e')](_0x3880('0x1f'),_0x23b1a8+'-'+_0x11bef4+'/'+_0x8628b8)[_0x3880('0x1a')](_0x451bc3);}return null;};}function patchUpdates(_0x5ceb79){return function(_0x42eed9){try{jsonpatch['apply'](_0x42eed9,_0x5ceb79,!![]);}catch(_0x5cff23){return BPromise[_0x3880('0x20')](_0x5cff23);}return _0x42eed9[_0x3880('0x21')]();};}function saveUpdates(_0x563c26,_0x1c5b3a){return function(_0x2812a0){if(_0x2812a0){return _0x2812a0[_0x3880('0x22')](_0x563c26)['then'](function(_0xc78a0c){return _0xc78a0c;});}return null;};}function removeEntity(_0x4070c7,_0x516df4){return function(_0x3ba068){if(_0x3ba068){return _0x3ba068['destroy']()[_0x3880('0x23')](function(){_0x4070c7[_0x3880('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2028f5,_0x532123){return function(_0x30a047){if(!_0x30a047){_0x2028f5[_0x3880('0x19')](0x194);}return _0x30a047;};}function handleError(_0x21e070,_0x417709){_0x417709=_0x417709||0x1f4;return function(_0x1276e7){logger[_0x3880('0x24')](_0x1276e7['stack']);if(_0x1276e7[_0x3880('0x25')]){delete _0x1276e7[_0x3880('0x25')];}_0x21e070[_0x3880('0x1d')](_0x417709)[_0x3880('0x26')](_0x1276e7);};}exports[_0x3880('0x27')]=function(_0x21500d,_0x2a9995){var _0x19c282={},_0xc8c42a={},_0x5b704e={'count':0x0,'rows':[]};var _0x4177e5=db[_0x3880('0x28')][_0x3880('0x29')];_0xc8c42a['model']=_[_0x3880('0x2a')](_0x4177e5);_0xc8c42a[_0x3880('0x2b')]=_[_0x3880('0x2a')](_0x21500d[_0x3880('0x2b')]);_0xc8c42a[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0xc8c42a[_0x3880('0x2e')],_0xc8c42a[_0x3880('0x2b')]);_0x19c282[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0xc8c42a['model'],qs[_0x3880('0x30')](_0x21500d[_0x3880('0x2b')][_0x3880('0x30')]));_0x19c282['attributes']=_0x19c282['attributes'][_0x3880('0x31')]?_0x19c282[_0x3880('0x2f')]:_0xc8c42a[_0x3880('0x2e')];if(!_0x21500d['query']['hasOwnProperty'](_0x3880('0x32'))){_0x19c282[_0x3880('0x1c')]=qs[_0x3880('0x1c')](_0x21500d[_0x3880('0x2b')]['limit']);_0x19c282['offset']=qs[_0x3880('0x1b')](_0x21500d[_0x3880('0x2b')][_0x3880('0x1b')]);}_0x19c282[_0x3880('0x33')]=qs[_0x3880('0x34')](_0x21500d['query']['sort']);_0x19c282[_0x3880('0x35')]=qs['filters'](_['pick'](_0x21500d[_0x3880('0x2b')],_0xc8c42a[_0x3880('0x2c')]));if(_0x21500d[_0x3880('0x2b')][_0x3880('0x36')]){_0x19c282['where']=_[_0x3880('0x37')](_0x19c282[_0x3880('0x35')],{'$or':_[_0x3880('0x38')](_0x4177e5,function(_0x138f1e){if(_0x138f1e[_0x3880('0x39')][_0x3880('0x3a')]!==_0x3880('0x3b')){var _0x56084c={};_0x56084c[_0x138f1e[_0x3880('0x3c')]]={'$like':'%'+_0x21500d[_0x3880('0x2b')][_0x3880('0x36')]+'%'};return _0x56084c;}})});}_0x19c282=_[_0x3880('0x37')]({},_0x19c282,_0x21500d[_0x3880('0x3d')]);var _0x3e5a8e={'where':_0x19c282[_0x3880('0x35')]};return db[_0x3880('0x28')][_0x3880('0x3e')](_0x3e5a8e)[_0x3880('0x23')](function(_0xba7aae){_0x5b704e[_0x3880('0x3e')]=_0xba7aae;if(_0x21500d[_0x3880('0x2b')][_0x3880('0x3f')]){_0x19c282[_0x3880('0x40')]=[{'all':!![]}];}return db['UserProfile'][_0x3880('0x41')](_0x19c282);})[_0x3880('0x23')](function(_0x37eae7){_0x5b704e[_0x3880('0x42')]=_0x37eae7;return _0x5b704e;})['then'](respondWithFilteredResult(_0x2a9995,_0x19c282))[_0x3880('0x43')](handleError(_0x2a9995,null));};exports[_0x3880('0x44')]=function(_0x126d3d,_0x1d3a60){var _0x2f0bfb={'raw':![],'where':{'id':_0x126d3d['params']['id']}},_0x214499={};_0x214499[_0x3880('0x2e')]=_[_0x3880('0x2a')](db[_0x3880('0x28')][_0x3880('0x29')]);_0x214499[_0x3880('0x2b')]=_['keys'](_0x126d3d[_0x3880('0x2b')]);_0x214499['filters']=_[_0x3880('0x2d')](_0x214499['model'],_0x214499[_0x3880('0x2b')]);_0x2f0bfb[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0x214499[_0x3880('0x2e')],qs['fields'](_0x126d3d[_0x3880('0x2b')][_0x3880('0x30')]));_0x2f0bfb['attributes']=_0x2f0bfb[_0x3880('0x2f')]['length']?_0x2f0bfb[_0x3880('0x2f')]:_0x214499[_0x3880('0x2e')];if(_0x126d3d['query']['includeAll']){_0x2f0bfb[_0x3880('0x40')]=[{'all':!![]}];}_0x2f0bfb=_[_0x3880('0x37')]({},_0x2f0bfb,_0x126d3d[_0x3880('0x3d')]);return db[_0x3880('0x28')][_0x3880('0x45')](_0x2f0bfb)[_0x3880('0x23')](handleEntityNotFound(_0x1d3a60,null))[_0x3880('0x23')](respondWithResult(_0x1d3a60,null))[_0x3880('0x43')](handleError(_0x1d3a60,null));};exports[_0x3880('0x46')]=function(_0x291013,_0x24d744){return db['UserProfile'][_0x3880('0x46')](_0x291013['body'],{})['then'](respondWithResult(_0x24d744,0xc9))[_0x3880('0x43')](handleError(_0x24d744,null));};exports[_0x3880('0x47')]=function(_0x2959aa,_0x4fbc68){var _0x5a68ec={'raw':![],'where':{'id':_0x2959aa[_0x3880('0x48')]['id']}},_0xf9fe2e={};_0xf9fe2e[_0x3880('0x2e')]=_[_0x3880('0x2a')](db['UserProfile'][_0x3880('0x29')]);_0x5a68ec[_0x3880('0x2f')]=_['intersection'](_0xf9fe2e['model'],qs['fields'](_0x2959aa[_0x3880('0x2b')][_0x3880('0x30')]));_0x5a68ec[_0x3880('0x2f')]=_0x5a68ec[_0x3880('0x2f')]['length']?_0x5a68ec[_0x3880('0x2f')]:_0xf9fe2e[_0x3880('0x2e')];if(_0x2959aa[_0x3880('0x2b')]['includeAll']){_0x5a68ec[_0x3880('0x40')]=[{'all':!![]}];}_0x5a68ec=_[_0x3880('0x37')]({},_0x5a68ec,_0x2959aa[_0x3880('0x3d')]);return db[_0x3880('0x28')][_0x3880('0x45')](_0x5a68ec)[_0x3880('0x23')](handleEntityNotFound(_0x4fbc68,null))['then'](function(_0x289e8d){if(_0x289e8d){var _0x20a3bb=_0x289e8d['get']({'plain':!![]});_0x20a3bb=qs[_0x3880('0x49')](_0x20a3bb,['id',_0x3880('0x4a'),_0x3880('0x4b'),'crudPermissions']);_0x2959aa[_0x3880('0x4c')]=_[_0x3880('0x49')](_0x2959aa['body'],['id',_0x3880('0x4a'),_0x3880('0x4b')]);return db[_0x3880('0x4d')][_0x3880('0x4e')](function(_0x170ffa){return db[_0x3880('0x28')]['create'](_[_0x3880('0x37')](_0x20a3bb,_0x2959aa[_0x3880('0x4c')]),{'include':_0x2959aa[_0x3880('0x2b')][_0x3880('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x170ffa})[_0x3880('0x23')](function(_0x5744f6){var _0x3bb2a1=_0x5744f6[_0x3880('0x4f')]({'plain':!![]});return db[_0x3880('0x50')]['findAll']({'where':{'userProfileId':_0x2959aa[_0x3880('0x48')]['id']},'raw':!![]})[_0x3880('0x23')](function(_0x33253e){if(_0x33253e){return BPromise[_0x3880('0x51')](_0x33253e,function(_0x6d8a86){return new BPromise(function(_0x5c5b86,_0x5373ee){if(_0x6d8a86[_0x3880('0x52')]===null||_0x6d8a86[_0x3880('0x52')]===0x1)_0x5c5b86(null);return db[_0x3880('0x53')][_0x3880('0x41')]({'where':{'sectionId':_0x6d8a86['id']},'raw':!![]})[_0x3880('0x23')](function(_0x1347af){var _0x125204=_[_0x3880('0x38')](_0x1347af,function(_0x3f57a5){return qs['omit'](_0x3f57a5,['id',_0x3880('0x4a'),_0x3880('0x4b'),_0x3880('0x54')]);});_0x5c5b86(_0x125204);})[_0x3880('0x43')](function(_0x5e6bb9){_0x5373ee(_0x5e6bb9);});})[_0x3880('0x23')](function(_0x39e7cf){var _0x2dd330=qs['omit'](_0x6d8a86,['id','createdAt',_0x3880('0x4b')]);_0x2dd330[_0x3880('0x55')]=_0x3bb2a1['id'];if(_0x39e7cf)_0x2dd330['Resources']=_0x39e7cf;return _0x2dd330;})[_0x3880('0x23')](function(_0x1a0ec0){return db['UserProfileSection'][_0x3880('0x46')](_0x1a0ec0,{'include':[{'model':db['UserProfileResource'],'as':_0x3880('0x56')}],'raw':!![],'transaction':_0x170ffa});});})[_0x3880('0x23')](function(){return _0x3bb2a1;});}});});});}})[_0x3880('0x23')](respondWithResult(_0x4fbc68,0xc9))['catch'](handleError(_0x4fbc68,null));};exports[_0x3880('0x22')]=function(_0x4981ce,_0x303a66){if(_0x4981ce[_0x3880('0x4c')]['id']){delete _0x4981ce[_0x3880('0x4c')]['id'];}return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x4981ce['params']['id']}})[_0x3880('0x23')](handleEntityNotFound(_0x303a66,null))['then'](saveUpdates(_0x4981ce[_0x3880('0x4c')],null))[_0x3880('0x23')](respondWithResult(_0x303a66,null))[_0x3880('0x43')](handleError(_0x303a66,null));};exports[_0x3880('0x57')]=function(_0x13b109,_0x3e9436){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x13b109['params']['id']}})['then'](handleEntityNotFound(_0x3e9436,null))[_0x3880('0x23')](removeEntity(_0x3e9436,null))[_0x3880('0x43')](handleError(_0x3e9436,null));};exports['describe']=function(_0x3c5155,_0x4fcfdf){return db['UserProfile']['describe']()[_0x3880('0x23')](respondWithResult(_0x4fcfdf,null))[_0x3880('0x43')](handleError(_0x4fcfdf,null));};exports[_0x3880('0x58')]=function(_0x2895dc,_0xe8ef0a){var _0x11038a=_0x2895dc[_0x3880('0x4c')];return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x2895dc[_0x3880('0x48')]['id']}})[_0x3880('0x23')](handleEntityNotFound(_0xe8ef0a,null))[_0x3880('0x23')](function(_0x3da3e0){if(_0x3da3e0){return db['sequelize'][_0x3880('0x4e')](function(_0x1a20ea){return db[_0x3880('0x50')][_0x3880('0x57')]({'where':{'userProfileId':_0x2895dc[_0x3880('0x48')]['id'],'sectionId':_[_0x3880('0x38')](_0x11038a,function(_0x36401c){return _0x36401c[_0x3880('0x54')];})},'transaction':_0x1a20ea})[_0x3880('0x23')](function(){var _0x29f922=_['map'](_0x11038a,function(_0x29da3a){_0x29da3a[_0x3880('0x55')]=_0x2895dc[_0x3880('0x48')]['id'];return _0x29da3a;});var _0x5ddd75=[];return BPromise[_0x3880('0x51')](_0x29f922,function(_0x32beef){return db[_0x3880('0x50')][_0x3880('0x46')](_0x32beef,{'include':[{'model':db[_0x3880('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0x1a20ea})[_0x3880('0x23')](function(_0x5127da){_0x5ddd75['push'](_0x5127da[_0x3880('0x4f')]({'plain':!![]}));});})[_0x3880('0x23')](function(){return _0x5ddd75;});});});}})[_0x3880('0x23')](function(_0x1c4f68){return _0x1c4f68;})['then'](respondWithResult(_0xe8ef0a,null))[_0x3880('0x43')](handleError(_0xe8ef0a,null));};exports[_0x3880('0x59')]=function(_0x3ab93e,_0x33afe9){var _0x3d7bab;return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x3ab93e[_0x3880('0x48')]['id']},'attributes':['id',_0x3880('0x25')]})['then'](handleEntityNotFound(_0x33afe9,null))[_0x3880('0x23')](function(_0x521c97){if(_0x521c97){_0x3d7bab=_0x521c97;return db['UserProfileSection'][_0x3880('0x57')]({'where':{'userProfileId':_0x3ab93e['params']['id'],'sectionId':_0x3ab93e[_0x3880('0x2b')][_0x3880('0x5a')]}});}})[_0x3880('0x23')](function(){return _0x3d7bab;})[_0x3880('0x23')](respondWithStatusCode(_0x33afe9,null))[_0x3880('0x43')](handleError(_0x33afe9,null));};exports[_0x3880('0x5b')]=function(_0x576c4d,_0x2e67e0){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x576c4d[_0x3880('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e67e0,null))[_0x3880('0x23')](function(_0x2eb431){if(_0x2eb431){return db[_0x3880('0x4d')][_0x3880('0x4e')](function(_0x4741df){return db[_0x3880('0x50')][_0x3880('0x41')]({'where':{'userProfileId':_0x576c4d['params']['id']},'attributes':['id'],'raw':!![]})[_0x3880('0x23')](function(_0x5aec2b){if(_0x5aec2b){return db[_0x3880('0x50')][_0x3880('0x57')]({'where':{'userProfileId':_0x576c4d['params']['id'],'id':_[_0x3880('0x38')](_0x5aec2b,function(_0xb2217b){return _0xb2217b['id'];})},'transaction':_0x4741df});}})[_0x3880('0x23')](function(_0x3412ab){var _0xb29868=_[_0x3880('0x38')](_0x576c4d[_0x3880('0x4c')],function(_0x342c0e){_0x342c0e[_0x3880('0x55')]=_0x576c4d[_0x3880('0x48')]['id'];return _0x342c0e;});return db[_0x3880('0x50')][_0x3880('0x5c')](_0xb29868,{'raw':!![],'transaction':_0x4741df});})[_0x3880('0x23')](function(_0x4e7618){var _0x3940b1=_['filter'](_['map'](_0x4e7618,function(_0x49729d){return _0x49729d[_0x3880('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3940b1){return db[_0x3880('0x50')]['findAll']({'where':{'userProfileId':_0x576c4d[_0x3880('0x48')]['id'],'sectionId':_[_0x3880('0x38')](_0x3940b1,function(_0x52087f){return _0x52087f[_0x3880('0x54')];})},'attributes':['id',_0x3880('0x54')],'raw':!![]})['then'](function(_0x719520){var _0x4d4792=_[_0x3880('0x38')](_0x576c4d[_0x3880('0x4c')],function(_0x2edd3a){_0x2edd3a[_0x3880('0x55')]=_0x576c4d[_0x3880('0x48')]['id'];return _0x2edd3a;});return db['UserProfileResource'][_0x3880('0x5c')](_0x4d4792,{'raw':!![],'transaction':_0x4741df});});}})[_0x3880('0x43')](handleError(_0x2e67e0,null));});}})[_0x3880('0x23')](function(_0x165ba9){var _0x2176c6=_['map'](_0x165ba9,function(_0x4d5f77){return _0x4d5f77[_0x3880('0x4f')]({'plain':!![]});});})[_0x3880('0x23')](respondWithResult(_0x2e67e0,null))[_0x3880('0x43')](handleError(_0x2e67e0,null));};exports[_0x3880('0x5d')]=function(_0x58bcc2,_0x37ff2f,_0x26feff){return db[_0x3880('0x28')][_0x3880('0x45')]({'where':{'id':_0x58bcc2['params']['id']}})[_0x3880('0x23')](handleEntityNotFound(_0x37ff2f,null))[_0x3880('0x23')](function(_0x5208a4){if(_0x5208a4){return _0x5208a4[_0x3880('0x5d')](_0x58bcc2['query']['ids']);}})[_0x3880('0x23')](respondWithStatusCode(_0x37ff2f,null))['catch'](handleError(_0x37ff2f,null));};exports[_0x3880('0x5e')]=function(_0x3be6c8,_0x3ceef5){var _0x53368a={'raw':![],'where':{}};var _0x267e18={};var _0x24c80f={'count':0x0,'rows':[]};var _0x2174de=_0x3be6c8[_0x3880('0x2b')][_0x3880('0x5f')];if(typeof _0x2174de===_0x3880('0x60')){throw new db[(_0x3880('0x61'))][(_0x3880('0x62'))](_0x3880('0x63'));}var _0x1c3353=_0x3be6c8['query'][_0x3880('0x64')]||![];var _0x41c8fc=getQueryModels(_0x2174de,_0x1c3353);if(typeof _0x41c8fc[_0x3880('0x65')]==='undefined'){throw new db[(_0x3880('0x61'))][(_0x3880('0x62'))](_0x3880('0x66')+_0x2174de+'\x27');}var _0x2a2943=[];if(!_[_0x3880('0x67')](_0x41c8fc[_0x3880('0x68')])){_0x2a2943=_0x41c8fc[_0x3880('0x68')];}else{_0x2a2943=[{'name':_0x2174de}];}return db[_0x3880('0x28')]['findOne']({'where':{'id':_0x3be6c8[_0x3880('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ceef5,null))['then'](function(_0x3792ea){if(_0x3792ea){var _0x21726b=[];for(var _0x5f0587=0x0;_0x5f0587<_0x2a2943[_0x3880('0x31')];_0x5f0587++){_0x21726b[_0x3880('0x69')](db[_0x3880('0x50')][_0x3880('0x6a')]({'where':{'userProfileId':_0x3792ea['id'],'name':_0x2a2943[_0x5f0587][_0x3880('0x25')]},'raw':!![]}));}return BPromise[_0x3880('0x6b')](_0x21726b);}})[_0x3880('0x23')](function(_0x5a9381){var _0xd5a0a5=_['filter'](_0x5a9381,function(_0x3d4294){return _0x3d4294?_0x3d4294:undefined;});var _0x53a524=_[_0x3880('0x36')](_0x2a2943,[_0x3880('0x6c'),!![]]);var _0x47ba7b=_['isEmpty'](_0xd5a0a5)&&_[_0x3880('0x67')](_0x53a524)?null:_[_0x3880('0x6d')](_0x53a524,_0xd5a0a5);if(_0x47ba7b){var _0x285620=[];for(var _0x668c39=0x0;_0x668c39<_0x47ba7b['length'];_0x668c39++){var _0x5564cd=_[_0x3880('0x45')](_0x2a2943,function(_0x2e63ec){return _0x47ba7b[_0x668c39]?_0x2e63ec[_0x3880('0x25')]===_0x47ba7b[_0x668c39][_0x3880('0x25')]:null;});if(_0x5564cd){if(_0x47ba7b[_0x668c39][_0x3880('0x6c')]){_0x285620[_0x3880('0x69')](getAllResources(_0x41c8fc[_0x3880('0x65')],_0x47ba7b[_0x668c39]));}else{if(!_0x47ba7b[_0x668c39][_0x3880('0x52')]){_0x285620['push'](getAllowedResources(_0x5564cd,_0x47ba7b[_0x668c39],_0x41c8fc[_0x3880('0x65')]));}else{if(_0x5564cd['model']){_0x285620[_0x3880('0x69')](getAllFilteredResources(_0x5564cd,_0x47ba7b[_0x668c39]));}}}}}return BPromise[_0x3880('0x6b')](_0x285620);}else{return null;}})['then'](function(_0x2fdf5c){var _0x44e697=_0x2fdf5c;var _0x1109fa=null;if(_0x44e697){_0x1109fa=_0x44e697[_0x3880('0x31')]===0x1?_0x44e697[0x0]:null;}if(_0x1109fa||_0x44e697){var _0x1ddbfe=db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x29')];_0x267e18[_0x3880('0x2e')]=_[_0x3880('0x2a')](_0x1ddbfe);_0x267e18[_0x3880('0x2b')]=_['keys'](_0x3be6c8[_0x3880('0x2b')]);_0x267e18[_0x3880('0x2c')]=_[_0x3880('0x2d')](_0x267e18['model'],_0x267e18[_0x3880('0x2b')]);_0x53368a[_0x3880('0x2f')]=_[_0x3880('0x2d')](_0x267e18[_0x3880('0x2e')],qs[_0x3880('0x30')](_0x3be6c8[_0x3880('0x2b')][_0x3880('0x30')]));_0x53368a['attributes']=_0x53368a[_0x3880('0x2f')][_0x3880('0x31')]?_0x53368a['attributes']:_0x267e18[_0x3880('0x2e')];if(!_0x3be6c8['query'][_0x3880('0x6e')](_0x3880('0x32'))){_0x53368a['limit']=qs[_0x3880('0x1c')](_0x3be6c8[_0x3880('0x2b')]['limit']);_0x53368a[_0x3880('0x1b')]=qs[_0x3880('0x1b')](_0x3be6c8[_0x3880('0x2b')]['offset']);}_0x53368a[_0x3880('0x33')]=qs[_0x3880('0x34')](_0x3be6c8[_0x3880('0x2b')]['sort']);_0x53368a[_0x3880('0x35')]=qs['filters'](_['pick'](_0x3be6c8['query'],_0x267e18[_0x3880('0x2c')]));if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x36')]){_0x53368a['where']=_[_0x3880('0x37')](_0x53368a[_0x3880('0x35')],{'$or':_[_0x3880('0x38')](_0x1ddbfe,function(_0x122a6b){if(_0x122a6b[_0x3880('0x39')][_0x3880('0x3a')]!==_0x3880('0x3b')){var _0x314fdb={};_0x314fdb[_0x122a6b[_0x3880('0x3c')]]={'$like':'%'+_0x3be6c8[_0x3880('0x2b')][_0x3880('0x36')]+'%'};return _0x314fdb;}})});}var _0x349289=[];if(_0x1109fa){var _0x29ec72=_[_0x3880('0x45')](_0x2a2943,[_0x3880('0x25'),_0x1109fa[_0x3880('0x25')]]);if(_0x29ec72[_0x3880('0x3c')]){var _0x36de2e={};if(_0x41c8fc[_0x3880('0x65')]===_0x3880('0x6f')){_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_[_0x3880('0x38')](_0x1109fa[_0x3880('0x71')],'id');}else{_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_0x1109fa[_0x3880('0x71')];}_0x349289[_0x3880('0x69')](_0x36de2e);}else{_0x53368a['where']['id']=_0x1109fa[_0x3880('0x71')];}}else{for(var _0x699e21=0x0;_0x699e21<_0x44e697[_0x3880('0x31')];_0x699e21++){var _0x29ec72=_[_0x3880('0x45')](_0x2a2943,[_0x3880('0x25'),_0x44e697[_0x699e21][_0x3880('0x25')]]);if(_0x29ec72[_0x3880('0x3c')]){var _0x36de2e={};_0x36de2e[_0x29ec72[_0x3880('0x70')]]=_0x44e697[_0x699e21][_0x3880('0x71')];_0x349289['push'](_0x36de2e);}else{if(!_0x53368a[_0x3880('0x35')]['id'])_0x53368a['where']['id']=[];_0x44e697[_0x699e21][_0x3880('0x71')][_0x3880('0x72')](function(_0x2b161d){_0x53368a[_0x3880('0x35')]['id']['push'](_0x2b161d);});}}}if(!_[_0x3880('0x67')](_0x349289)){_0x53368a['where']=_[_0x3880('0x37')](_0x53368a['where'],{'$and':{'$or':_0x349289}});}_0x53368a=_['merge']({},_0x53368a,_0x3be6c8[_0x3880('0x3d')]);if(_0x1109fa&&!_0x1109fa[_0x3880('0x52')]&&_0x41c8fc['childModel']===_0x3880('0x6f')){if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x3f')]){_0x53368a[_0x3880('0x40')]=[{'all':!![]}];}return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x41')](_0x53368a)[_0x3880('0x23')](function(_0x337ef8){var _0x56f7d5=[];_0x337ef8['forEach'](function(_0x125b3c){var _0x3c537c;switch(_0x125b3c[_0x3880('0x73')]){case _0x3880('0x74'):_0x3c537c=_[_0x3880('0x45')](_0x1109fa[_0x3880('0x71')],function(_0x2ee8dc){return _0x2ee8dc['id']===_0x125b3c[_0x3880('0x75')]&&_0x2ee8dc[_0x3880('0x39')]==='DefaultReports';});break;case _0x3880('0x76'):_0x3c537c=_[_0x3880('0x45')](_0x1109fa[_0x3880('0x71')],function(_0x52744b){return _0x52744b['id']===_0x125b3c[_0x3880('0x75')]&&_0x52744b[_0x3880('0x39')]==='CustomReports';});break;}if(_0x3c537c)_0x56f7d5[_0x3880('0x69')](_0x125b3c);});_0x24c80f[_0x3880('0x3e')]=_0x56f7d5[_0x3880('0x31')];_0x24c80f[_0x3880('0x42')]=_0x56f7d5;return _0x24c80f;});}else{return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x3e')]({'where':_0x53368a['where']})['then'](function(_0x5d9352){_0x24c80f['count']=_0x5d9352;if(_0x3be6c8[_0x3880('0x2b')][_0x3880('0x3f')]){if(_0x41c8fc['childModel']===_0x3880('0x77')){_0x53368a[_0x3880('0x40')]=[{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x3880('0x78')],'required':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]?!![]:![]},{'model':db[_0x3880('0x7a')],'as':'ThroughTags','attributes':['id',_0x3880('0x25'),_0x3880('0x78')],'through':_0x3be6c8[_0x3880('0x2b')]['tag']?{'attributes':[],'where':{'TagId':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]||undefined}}:{},'required':_0x3be6c8[_0x3880('0x2b')][_0x3880('0x79')]?!![]:![]}];}else{_0x53368a[_0x3880('0x40')]=[{'all':!![]}];}}return db[_0x41c8fc[_0x3880('0x65')]][_0x3880('0x41')](_0x53368a);})['then'](function(_0x4c3b9c){_0x24c80f[_0x3880('0x42')]=_0x4c3b9c;return _0x24c80f;});}}else{return _0x24c80f;}})[_0x3880('0x23')](respondWithFilteredResult(_0x3ceef5,_0x53368a))[_0x3880('0x43')](handleError(_0x3ceef5,null));};function getAllResources(_0x324e94,_0x5863a0){return new BPromise(function(_0xe36398,_0x495764){if(_0x5863a0){var _0x367097=_0x5863a0['filter']?{[_0x5863a0[_0x3880('0x36')][_0x3880('0x3c')]]:_0x5863a0[_0x3880('0x36')]['value']}:undefined;return db[_0x324e94][_0x3880('0x41')]({'where':_0x367097,'raw':!![]})['then'](function(_0x5f1f3f){_0x5863a0[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5f1f3f,'id');_0xe36398(_0x5863a0);})[_0x3880('0x43')](function(_0x39e588){_0x495764(_0x39e588);});}else{_0xe36398(null);}});}function getAllFilteredResources(_0x443c77,_0x4b420e){return new BPromise(function(_0x408b36,_0xea604c){var _0x3cb7de=_0x443c77[_0x3880('0x36')]?{[_0x443c77['filter'][_0x3880('0x3c')]]:_0x443c77[_0x3880('0x36')][_0x3880('0x7b')]}:undefined;return db[_0x443c77[_0x3880('0x2e')]][_0x3880('0x41')]({'where':_0x3cb7de,'raw':!![]})[_0x3880('0x23')](function(_0xabc2f8){_0x4b420e['associatedResources']=_[_0x3880('0x38')](_0xabc2f8,function(_0x1dd3aa){return _0x1dd3aa[_0x3880('0x25')];});_0x408b36(_0x4b420e);})[_0x3880('0x43')](function(_0x331d78){_0xea604c(_0x331d78);});});}function getAllowedResources(_0x27d396,_0x2bb1ad,_0x563b1b){return new BPromise(function(_0x3fdb35,_0x264128){if(_0x2bb1ad){return db['UserProfileResource'][_0x3880('0x41')]({'where':{'sectionId':_0x2bb1ad['id']},'raw':!![]})['then'](function(_0x5c8814){if(_0x27d396[_0x3880('0x3c')]&&_0x27d396[_0x3880('0x3c')]!=='id'){_0x2bb1ad['associatedResources']=_[_0x3880('0x38')](_0x5c8814,function(_0x484af0){return _0x484af0[_0x27d396[_0x3880('0x3c')]];});}else{if(_0x563b1b===_0x3880('0x6f')){_0x2bb1ad[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5c8814,function(_0xcaf7e3){return{'id':_0xcaf7e3[_0x3880('0x7c')],'type':_0xcaf7e3['type']};});}else{_0x2bb1ad[_0x3880('0x71')]=_[_0x3880('0x38')](_0x5c8814,function(_0x3501c9){return _0x3501c9[_0x3880('0x7c')];});}}_0x3fdb35(_0x2bb1ad);})[_0x3880('0x43')](function(_0x18fffa){_0x264128(_0x18fffa);});}else{_0x3fdb35(null);}});}function getQueryModels(_0x627b20,_0x4a0c73){var _0x50cb63=_0x627b20[_0x3880('0x7d')]();var _0x147f7a={'childModel':undefined,'parentSections':[]};switch(_0x50cb63){case _0x3880('0x7e'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x7f');break;case _0x3880('0x80'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x81');break;case'squarerecordings':_0x147f7a[_0x3880('0x65')]=_0x3880('0x82');_0x147f7a['parentSections']=[{'name':_0x3880('0x83'),'field':'name','foreignKey':_0x3880('0x84')}];break;case'projects':_0x147f7a[_0x3880('0x65')]='JscriptyProject';break;case _0x3880('0x85'):_0x147f7a[_0x3880('0x65')]='CmContact';_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0x86'),'field':'id','foreignKey':_0x3880('0x87')}];break;case _0x3880('0x88'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x89');break;case _0x3880('0x8a'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8b');break;case _0x3880('0x8c'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8d');break;case _0x3880('0x8e'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x8f');break;case _0x3880('0x90'):_0x147f7a['childModel']=_0x3880('0x91');break;case _0x3880('0x92'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x93');break;case _0x3880('0x94'):_0x147f7a['childModel']=_0x3880('0x95');break;case _0x3880('0x96'):case _0x3880('0x97'):case _0x3880('0x98'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x99');break;case'contexts':_0x147f7a['childModel']='VoiceContext';break;case _0x3880('0x9a'):_0x147f7a[_0x3880('0x65')]='VoiceMail';break;case _0x3880('0x9b'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x9c');_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0x9d'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0x9e'),'model':_0x3880('0x9f'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xa1')]}},{'name':_0x3880('0xa2'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0x9e'),'model':_0x3880('0x9f'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xa3')]}},{'name':'VoiceQueues','field':_0x3880('0x25'),'foreignKey':'queue','model':_0x3880('0xa4'),'filter':{'field':_0x3880('0x39'),'value':[_0x3880('0xa5')]}},{'name':_0x3880('0xa6'),'field':_0x3880('0x25'),'foreignKey':_0x3880('0xa7'),'model':_0x3880('0xa4'),'filter':{'field':_0x3880('0x39'),'value':[_0x3880('0xa8')]}}];break;case _0x3880('0xa9'):_0x147f7a['childModel']='VoiceMusicOnHold';break;case _0x3880('0xaa'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xab');break;case _0x3880('0xac'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xad');break;case'ivrcampaigns':_0x147f7a[_0x3880('0x65')]=_0x3880('0xae');break;case _0x3880('0xaf'):_0x147f7a['childModel']=_0x3880('0xb0');break;case _0x3880('0xb1'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xb2');break;case _0x3880('0xb3'):_0x147f7a['childModel']=_0x3880('0xb4');break;case _0x3880('0xb5'):_0x147f7a['childModel']=_0x3880('0xb6');break;case _0x3880('0xb7'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xb8');break;case _0x3880('0xb9'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xba');break;case _0x3880('0xbb'):_0x147f7a[_0x3880('0x65')]='SmsAccount';break;case _0x3880('0xbc'):_0x147f7a[_0x3880('0x65')]='Team';break;case _0x3880('0xbd'):case _0x3880('0xbe'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xa4');if(_0x4a0c73){_0x147f7a['parentSections']=[{'name':_0x3880('0xbf')},{'name':_0x3880('0xa6')}];}break;case'users':case'agents':case _0x3880('0xc0'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x9f');if(_0x4a0c73){_0x147f7a[_0x3880('0x68')]=[{'name':_0x3880('0xc1'),'filter':{'field':_0x3880('0xa0'),'value':[_0x3880('0xc2'),_0x3880('0xc3')]},'ignore':!![]},{'name':_0x3880('0x9d')},{'name':_0x3880('0xa2')}];}break;case _0x3880('0xc4'):_0x147f7a['childModel']=_0x3880('0xc5');break;case _0x3880('0xc6'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xc7');break;case _0x3880('0xc8'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xc9');break;case _0x3880('0xca'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xcb');break;case _0x3880('0xcc'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xcd');break;case _0x3880('0xce'):_0x147f7a['childModel']='ZohoAccount';break;case _0x3880('0xcf'):_0x147f7a[_0x3880('0x65')]='User';break;case _0x3880('0xd0'):_0x147f7a['childModel']=_0x3880('0xd1');break;case _0x3880('0xd2'):_0x147f7a['childModel']=_0x3880('0xd3');break;case _0x3880('0xd4'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xd5');break;case _0x3880('0xd6'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xd7');break;case'pauses':_0x147f7a[_0x3880('0x65')]=_0x3880('0xd8');break;case _0x3880('0xd9'):_0x147f7a['childModel']=_0x3880('0xda');break;case _0x3880('0xdb'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xdc');break;case _0x3880('0xdd'):_0x147f7a[_0x3880('0x65')]=_0x3880('0x7a');break;case _0x3880('0xde'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xdf');break;case _0x3880('0xe0'):_0x147f7a[_0x3880('0x65')]='Trigger';break;case'trunks':_0x147f7a[_0x3880('0x65')]=_0x3880('0xe1');break;case _0x3880('0xe2'):_0x147f7a[_0x3880('0x65')]=_0x3880('0xe3');break;case'plugins':_0x147f7a[_0x3880('0x65')]='Plugin';break;case _0x3880('0xe4'):_0x147f7a[_0x3880('0x65')]='AnalyticExtractedReport';_0x147f7a['parentSections']=[{'name':_0x3880('0xe5'),'field':'id','foreignKey':_0x3880('0x75')}];break;case'metrics':_0x147f7a['childModel']=_0x3880('0xe6');break;default:return _0x147f7a;}return _0x147f7a;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 40fd52c..3605e65 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 _0x069e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x8a376f,_0x3aa020){var _0x53278d=function(_0x216492){while(--_0x216492){_0x8a376f['push'](_0x8a376f['shift']());}};_0x53278d(++_0x3aa020);}(_0x069e,0x108));var _0xe069=function(_0x4a73f2,_0x352409){_0x4a73f2=_0x4a73f2-0x0;var _0x4190ee=_0x069e[_0x4a73f2];return _0x4190ee;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe069('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe069('0x1')](0x0);var events={'afterCreate':_0xe069('0x2'),'afterUpdate':_0xe069('0x3'),'afterDestroy':_0xe069('0x4')};function emitEvent(_0x3e83dc){return function(_0x4631eb,_0x43383f,_0x2f5a5c){UserProfileEvents[_0xe069('0x5')](_0x3e83dc+':'+_0x4631eb['id'],_0x4631eb);UserProfileEvents[_0xe069('0x5')](_0x3e83dc,_0x4631eb);_0x2f5a5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xe069('0x6')](e,emitEvent(event));}}module[_0xe069('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x553a=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0x553a,0x192));var _0xa553=function(_0x4684af,_0x34880f){_0x4684af=_0x4684af-0x0;var _0x3bb413=_0x553a[_0x4684af];return _0x3bb413;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa553('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa553('0x1')](0x0);var events={'afterCreate':_0xa553('0x2'),'afterUpdate':_0xa553('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d5106){return function(_0x367421,_0x50ecee,_0x4b0e9b){UserProfileEvents[_0xa553('0x4')](_0x4d5106+':'+_0x367421['id'],_0x367421);UserProfileEvents['emit'](_0x4d5106,_0x367421);_0x4b0e9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa553('0x5')](e,emitEvent(event));}}module[_0xa553('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 a067cc7..994974f 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 _0xd96a=['moment','bluebird','../../config/environment','exports','define','user_profiles','../../config/logger','api'];(function(_0x81767f,_0x1ac614){var _0x17a9ee=function(_0x5ac3ac){while(--_0x5ac3ac){_0x81767f['push'](_0x81767f['shift']());}};_0x17a9ee(++_0x1ac614);}(_0xd96a,0x15e));var _0xad96=function(_0x9c6b63,_0x33bbd4){_0x9c6b63=_0x9c6b63-0x0;var _0x15d177=_0xd96a[_0x9c6b63];return _0x15d177;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xad96('0x0'))(_0xad96('0x1'));var moment=require(_0xad96('0x2'));var BPromise=require(_0xad96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad96('0x4'));var attributes=require('./userProfile.attributes');module[_0xad96('0x5')]=function(_0x3560d8,_0x3faf15){return _0x3560d8[_0xad96('0x6')]('UserProfile',attributes,{'tableName':_0xad96('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad07=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles'];(function(_0x49f626,_0x3667dd){var _0x109c63=function(_0x27e67e){while(--_0x27e67e){_0x49f626['push'](_0x49f626['shift']());}};_0x109c63(++_0x3667dd);}(_0xad07,0xfd));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7ad0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7ad0('0x1'));var BPromise=require(_0x7ad0('0x2'));var rp=require(_0x7ad0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad0('0x4'));var config=require(_0x7ad0('0x5'));var attributes=require(_0x7ad0('0x6'));module[_0x7ad0('0x7')]=function(_0x869b82,_0x115677){return _0x869b82[_0x7ad0('0x8')](_0x7ad0('0x9'),attributes,{'tableName':_0x7ad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index fc2d369..ca27b7c 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 _0xb348=['request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UserProfile,\x20%s,\x20%s','result','catch','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./userProfile.socket','register'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb348,0xa6));var _0x8b34=function(_0x41c911,_0x1c1a3a){_0x41c911=_0x41c911-0x0;var _0x30b972=_0xb348[_0x41c911];return _0x30b972;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8b34('0x0'));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(_0x8b34('0x1'))(_0x8b34('0x2'));var config=require(_0x8b34('0x3'));var jayson=require(_0x8b34('0x4'));var client=jayson[_0x8b34('0x5')]['http']({'port':0x232a});config['redis']=_[_0x8b34('0x6')](config[_0x8b34('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b34('0x7')]));require(_0x8b34('0x8'))[_0x8b34('0x9')](socket);function respondWithRpcPromise(_0x1fa56c,_0x56006a,_0x583335){return new BPromise(function(_0x3dfce8,_0x77efc9){return client[_0x8b34('0xa')](_0x1fa56c,_0x583335)['then'](function(_0x8f1ec7){logger[_0x8b34('0xb')]('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8b34('0xc'));logger[_0x8b34('0xd')](_0x8b34('0xe'),_0x56006a,_0x8b34('0xc'),JSON[_0x8b34('0xf')](_0x8f1ec7));if(_0x8f1ec7['error']){if(_0x8f1ec7['error'][_0x8b34('0x10')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);return _0x77efc9(_0x8f1ec7['error'][_0x8b34('0x12')]);}logger[_0x8b34('0x11')](_0x8b34('0x13'),_0x56006a,_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);return _0x3dfce8(_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8b34('0xc'));_0x3dfce8(_0x8f1ec7[_0x8b34('0x14')][_0x8b34('0x12')]);}})[_0x8b34('0x15')](function(_0x606fa0){logger['error'](_0x8b34('0x13'),_0x56006a,_0x606fa0);_0x77efc9(_0x606fa0);});});} \ No newline at end of file +var _0x2ca1=['rpc','../../config/environment','http','localhost','redis','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x424ebf,_0x4c64d3){var _0x4c6aef=function(_0x3e17eb){while(--_0x3e17eb){_0x424ebf['push'](_0x424ebf['shift']());}};_0x4c6aef(++_0x4c64d3);}(_0x2ca1,0x76));var _0x12ca=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x2ca1[_0x46361e];return _0x14e302;};'use strict';var _=require(_0x12ca('0x0'));var util=require(_0x12ca('0x1'));var moment=require(_0x12ca('0x2'));var BPromise=require(_0x12ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x12ca('0x5'));var logger=require(_0x12ca('0x6'))(_0x12ca('0x7'));var config=require(_0x12ca('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x12ca('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x12ca('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12ca('0xb')]));require(_0x12ca('0xc'))[_0x12ca('0xd')](socket);function respondWithRpcPromise(_0x5f5226,_0x2496ef,_0x5d582e){return new BPromise(function(_0xcf0973,_0x5b0634){return client[_0x12ca('0xe')](_0x5f5226,_0x5d582e)[_0x12ca('0xf')](function(_0x39c971){logger['info'](_0x12ca('0x10'),_0x2496ef,_0x12ca('0x11'));logger[_0x12ca('0x12')](_0x12ca('0x13'),_0x2496ef,_0x12ca('0x11'),JSON[_0x12ca('0x14')](_0x39c971));if(_0x39c971[_0x12ca('0x15')]){if(_0x39c971[_0x12ca('0x15')][_0x12ca('0x16')]===0x1f4){logger[_0x12ca('0x15')](_0x12ca('0x10'),_0x2496ef,_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);return _0x5b0634(_0x39c971['error'][_0x12ca('0x17')]);}logger[_0x12ca('0x15')]('UserProfile,\x20%s,\x20%s',_0x2496ef,_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);return _0xcf0973(_0x39c971[_0x12ca('0x15')][_0x12ca('0x17')]);}else{logger['info'](_0x12ca('0x10'),_0x2496ef,'request\x20sent');_0xcf0973(_0x39c971[_0x12ca('0x18')]['message']);}})['catch'](function(_0x4b337b){logger[_0x12ca('0x15')]('UserProfile,\x20%s,\x20%s',_0x2496ef,_0x4b337b);_0x5b0634(_0x4b337b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 2b399bd..1aa7f0e 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 _0xdfe7=['length','userProfile:','save','remove','emit','removeListener'];(function(_0x302129,_0xfc7610){var _0x439552=function(_0x1177da){while(--_0x1177da){_0x302129['push'](_0x302129['shift']());}};_0x439552(++_0xfc7610);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x42941c,_0x502f33){_0x42941c=_0x42941c-0x0;var _0x210723=_0xdfe7[_0x42941c];return _0x210723;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x7dfe('0x0'),_0x7dfe('0x1'),'update'];function createListener(_0x162e75,_0x36c721){return function(_0x388848){_0x36c721[_0x7dfe('0x2')](_0x162e75,_0x388848);};}function removeListener(_0x527490,_0x2c07d2){return function(){UserProfileEvents[_0x7dfe('0x3')](_0x527490,_0x2c07d2);};}exports['register']=function(_0x262561){for(var _0x3d8220=0x0,_0x23d0c1=events[_0x7dfe('0x4')];_0x3d8220<_0x23d0c1;_0x3d8220++){var _0x56d67e=events[_0x3d8220];var _0x3fc0a0=createListener(_0x7dfe('0x5')+_0x56d67e,_0x262561);UserProfileEvents['on'](_0x56d67e,_0x3fc0a0);}}; \ No newline at end of file +var _0xf95f=['length','userProfile:','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0x2417bc,_0x15e3be){var _0x2a99af=function(_0x5b35e2){while(--_0x5b35e2){_0x2417bc['push'](_0x2417bc['shift']());}};_0x2a99af(++_0x15e3be);}(_0xf95f,0x142));var _0xff95=function(_0x27e2c8,_0x5f40a0){_0x27e2c8=_0x27e2c8-0x0;var _0x5454d4=_0xf95f[_0x27e2c8];return _0x5454d4;};'use strict';var UserProfileEvents=require(_0xff95('0x0'));var events=[_0xff95('0x1'),_0xff95('0x2'),_0xff95('0x3')];function createListener(_0x109eae,_0x2c7ada){return function(_0x1a42e0){_0x2c7ada[_0xff95('0x4')](_0x109eae,_0x1a42e0);};}function removeListener(_0x1e81fe,_0x498f22){return function(){UserProfileEvents[_0xff95('0x5')](_0x1e81fe,_0x498f22);};}exports['register']=function(_0x3f72b4){for(var _0x4fb1ed=0x0,_0x314fb4=events[_0xff95('0x6')];_0x4fb1ed<_0x314fb4;_0x4fb1ed++){var _0x2b9ce9=events[_0x4fb1ed];var _0x1a42b2=createListener(_0xff95('0x7')+_0x2b9ce9,_0x3f72b4);UserProfileEvents['on'](_0x2b9ce9,_0x1a42b2);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c6fe3ca..8881970 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 _0xbc95=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/:id','show','post'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x47e70a,_0x1c3714){_0x47e70a=_0x47e70a-0x0;var _0x3a9900=_0xbc95[_0x47e70a];return _0x3a9900;};'use strict';var multer=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var path=require(_0x5bc9('0x2'));var timeout=require(_0x5bc9('0x3'));var express=require(_0x5bc9('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bc9('0x5'));var controller=require(_0x5bc9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5bc9('0x7')]('/describe',auth[_0x5bc9('0x8')](),controller['describe']);router['get'](_0x5bc9('0x9'),auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xa')]);router[_0x5bc9('0xb')]('/',auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xc')]);router['put'](_0x5bc9('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x5bc9('0xd')]('/:id',auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xe')]);module[_0x5bc9('0xf')]=router; \ No newline at end of file +var _0xd3c8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd3c8,0x161));var _0x8d3c=function(_0x7bdb48,_0x3ce177){_0x7bdb48=_0x7bdb48-0x0;var _0x5f0847=_0xd3c8[_0x7bdb48];return _0x5f0847;};'use strict';var multer=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var path=require(_0x8d3c('0x2'));var timeout=require(_0x8d3c('0x3'));var express=require(_0x8d3c('0x4'));var router=express['Router']();var auth=require(_0x8d3c('0x5'));var interaction=require(_0x8d3c('0x6'));var config=require(_0x8d3c('0x7'));var controller=require(_0x8d3c('0x8'));router['get']('/',auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xa')]);router[_0x8d3c('0xb')](_0x8d3c('0xc'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xd')]);router[_0x8d3c('0xb')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8d3c('0x10')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0x11')]);router[_0x8d3c('0x12')](_0x8d3c('0xe'),auth[_0x8d3c('0x9')](),controller[_0x8d3c('0x13')]);module[_0x8d3c('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 829a563..89582a0 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 _0xee32=['exports','STRING'];(function(_0x186339,_0x2a828a){var _0x128945=function(_0x92fcd4){while(--_0x92fcd4){_0x186339['push'](_0x186339['shift']());}};_0x128945(++_0x2a828a);}(_0xee32,0x172));var _0x2ee3=function(_0x2fd09,_0x2c20ea){_0x2fd09=_0x2fd09-0x0;var _0x13be55=_0xee32[_0x2fd09];return _0x13be55;};'use strict';var Sequelize=require('sequelize');module[_0x2ee3('0x0')]={'name':{'type':Sequelize[_0x2ee3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2ee3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xfaff=['STRING','INTEGER'];(function(_0x3be988,_0x5e92d8){var _0x4d194a=function(_0x3827b3){while(--_0x3827b3){_0x3be988['push'](_0x3be988['shift']());}};_0x4d194a(++_0x5e92d8);}(_0xfaff,0xde));var _0xffaf=function(_0x35576b,_0x34c6c8){_0x35576b=_0x35576b-0x0;var _0x269e5c=_0xfaff[_0x35576b];return _0x269e5c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xffaf('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xffaf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xffaf('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 851a1c5..9d79168 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 _0xf452=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xd74d2,_0xab9924){var _0xfd602=function(_0xe708fc){while(--_0xe708fc){_0xd74d2['push'](_0xd74d2['shift']());}};_0xfd602(++_0xab9924);}(_0xf452,0x13b));var _0x2f45=function(_0x45e34a,_0x7473c2){_0x45e34a=_0x45e34a-0x0;var _0x3193fa=_0xf452[_0x45e34a];return _0x3193fa;};'use strict';var pdf=require(_0x2f45('0x0'));var emlformat=require(_0x2f45('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2f45('0x2'));var jsonpatch=require(_0x2f45('0x3'));var rp=require(_0x2f45('0x4'));var moment=require(_0x2f45('0x5'));var BPromise=require(_0x2f45('0x6'));var Mustache=require(_0x2f45('0x7'));var util=require(_0x2f45('0x8'));var path=require(_0x2f45('0x9'));var sox=require(_0x2f45('0xa'));var csv=require(_0x2f45('0xb'));var ejs=require(_0x2f45('0xc'));var fs=require('fs');var _=require(_0x2f45('0xd'));var squel=require(_0x2f45('0xe'));var crypto=require(_0x2f45('0xf'));var jsforce=require(_0x2f45('0x10'));var deskjs=require(_0x2f45('0x11'));var toCsv=require(_0x2f45('0xb'));var querystring=require(_0x2f45('0x12'));var Papa=require(_0x2f45('0x13'));var Redis=require(_0x2f45('0x14'));var authService=require(_0x2f45('0x15'));var qs=require(_0x2f45('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f45('0x17'));var utils=require(_0x2f45('0x18'));var config=require(_0x2f45('0x19'));var db=require(_0x2f45('0x1a'))['db'];function respondWithStatusCode(_0x148d14,_0x58b083){_0x58b083=_0x58b083||0xcc;return function(_0x14b367){if(_0x14b367){return _0x148d14['sendStatus'](_0x58b083);}return _0x148d14[_0x2f45('0x1b')](_0x58b083)[_0x2f45('0x1c')]();};}function respondWithResult(_0x4b6ee9,_0x2c3a9d){_0x2c3a9d=_0x2c3a9d||0xc8;return function(_0x2b43e7){if(_0x2b43e7){return _0x4b6ee9[_0x2f45('0x1b')](_0x2c3a9d)['json'](_0x2b43e7);}};}function respondWithFilteredResult(_0x141b82,_0x4c8274){return function(_0x70b84b){if(_0x70b84b){var _0x469fbe=_0x70b84b[_0x2f45('0x1d')],_0x5bd134=_0x4c8274['offset'],_0x2ac0bf=_0x4c8274['offset']+_0x4c8274['limit'],_0xf24703;if(_0x2ac0bf>=_0x469fbe){_0x2ac0bf=_0x469fbe;_0xf24703=0xc8;}else{_0xf24703=0xce;}_0x141b82[_0x2f45('0x1b')](_0xf24703);return _0x141b82[_0x2f45('0x1e')](_0x2f45('0x1f'),_0x5bd134+'-'+_0x2ac0bf+'/'+_0x469fbe)[_0x2f45('0x20')](_0x70b84b);}return null;};}function patchUpdates(_0x589c2f){return function(_0xb71b1f){try{jsonpatch[_0x2f45('0x21')](_0xb71b1f,_0x589c2f,!![]);}catch(_0x2cf411){return BPromise[_0x2f45('0x22')](_0x2cf411);}return _0xb71b1f[_0x2f45('0x23')]();};}function saveUpdates(_0x33c5ba,_0x4e748b){return function(_0x54683c){if(_0x54683c){return _0x54683c[_0x2f45('0x24')](_0x33c5ba)[_0x2f45('0x25')](function(_0x3d64b4){return _0x3d64b4;});}return null;};}function removeEntity(_0x434dfa,_0x275a61){return function(_0x303dbf){if(_0x303dbf){return _0x303dbf[_0x2f45('0x26')]()[_0x2f45('0x25')](function(){_0x434dfa['status'](0xcc)[_0x2f45('0x1c')]();});}};}function handleEntityNotFound(_0x190636,_0x4cfd00){return function(_0x7ff562){if(!_0x7ff562){_0x190636[_0x2f45('0x27')](0x194);}return _0x7ff562;};}function handleError(_0x53a10d,_0x1b8870){_0x1b8870=_0x1b8870||0x1f4;return function(_0x19bef7){logger[_0x2f45('0x28')](_0x19bef7[_0x2f45('0x29')]);if(_0x19bef7[_0x2f45('0x2a')]){delete _0x19bef7['name'];}_0x53a10d['status'](_0x1b8870)[_0x2f45('0x2b')](_0x19bef7);};}exports['index']=function(_0x4a5df2,_0x3c9541){var _0x507d86={},_0x44bf0f={},_0x264139={'count':0x0,'rows':[]};var _0x166792=db[_0x2f45('0x2c')][_0x2f45('0x2d')];_0x44bf0f[_0x2f45('0x2e')]=_[_0x2f45('0x2f')](_0x166792);_0x44bf0f[_0x2f45('0x30')]=_['keys'](_0x4a5df2[_0x2f45('0x30')]);_0x44bf0f[_0x2f45('0x31')]=_['intersection'](_0x44bf0f[_0x2f45('0x2e')],_0x44bf0f['query']);_0x507d86[_0x2f45('0x32')]=_[_0x2f45('0x33')](_0x44bf0f[_0x2f45('0x2e')],qs['fields'](_0x4a5df2['query'][_0x2f45('0x34')]));_0x507d86['attributes']=_0x507d86[_0x2f45('0x32')][_0x2f45('0x35')]?_0x507d86['attributes']:_0x44bf0f[_0x2f45('0x2e')];if(!_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x36')](_0x2f45('0x37'))){_0x507d86[_0x2f45('0x38')]=qs['limit'](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x38')]);_0x507d86[_0x2f45('0x39')]=qs['offset'](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x39')]);}_0x507d86[_0x2f45('0x3a')]=qs[_0x2f45('0x3b')](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3b')]);_0x507d86[_0x2f45('0x3c')]=qs[_0x2f45('0x31')](_[_0x2f45('0x3d')](_0x4a5df2['query'],_0x44bf0f['filters']));if(_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3e')]){_0x507d86[_0x2f45('0x3c')]=_[_0x2f45('0x3f')](_0x507d86[_0x2f45('0x3c')],{'$or':_[_0x2f45('0x40')](_0x166792,function(_0x5cb0dd){if(_0x5cb0dd[_0x2f45('0x41')][_0x2f45('0x42')]!==_0x2f45('0x43')){var _0x4d4219={};_0x4d4219[_0x5cb0dd[_0x2f45('0x44')]]={'$like':'%'+_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3e')]+'%'};return _0x4d4219;}})});}_0x507d86=_['merge']({},_0x507d86,_0x4a5df2[_0x2f45('0x45')]);var _0xd3b524={'where':_0x507d86[_0x2f45('0x3c')]};return db[_0x2f45('0x2c')][_0x2f45('0x1d')](_0xd3b524)['then'](function(_0x125538){_0x264139[_0x2f45('0x1d')]=_0x125538;if(_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x46')]){_0x507d86[_0x2f45('0x47')]=[{'all':!![]}];}return db['UserProfileResource'][_0x2f45('0x48')](_0x507d86);})[_0x2f45('0x25')](function(_0x38910c){_0x264139[_0x2f45('0x49')]=_0x38910c;return _0x264139;})[_0x2f45('0x25')](respondWithFilteredResult(_0x3c9541,_0x507d86))[_0x2f45('0x4a')](handleError(_0x3c9541,null));};exports['show']=function(_0x4cc893,_0x5a8fc6){var _0x428f36={'raw':![],'where':{'id':_0x4cc893[_0x2f45('0x4b')]['id']}},_0x921194={};_0x921194[_0x2f45('0x2e')]=_[_0x2f45('0x2f')](db[_0x2f45('0x2c')][_0x2f45('0x2d')]);_0x921194['query']=_['keys'](_0x4cc893[_0x2f45('0x30')]);_0x921194['filters']=_['intersection'](_0x921194[_0x2f45('0x2e')],_0x921194[_0x2f45('0x30')]);_0x428f36[_0x2f45('0x32')]=_[_0x2f45('0x33')](_0x921194['model'],qs[_0x2f45('0x34')](_0x4cc893[_0x2f45('0x30')][_0x2f45('0x34')]));_0x428f36[_0x2f45('0x32')]=_0x428f36[_0x2f45('0x32')]['length']?_0x428f36[_0x2f45('0x32')]:_0x921194['model'];if(_0x4cc893[_0x2f45('0x30')][_0x2f45('0x46')]){_0x428f36[_0x2f45('0x47')]=[{'all':!![]}];}_0x428f36=_[_0x2f45('0x3f')]({},_0x428f36,_0x4cc893['options']);return db[_0x2f45('0x2c')][_0x2f45('0x4c')](_0x428f36)[_0x2f45('0x25')](handleEntityNotFound(_0x5a8fc6,null))['then'](respondWithResult(_0x5a8fc6,null))[_0x2f45('0x4a')](handleError(_0x5a8fc6,null));};exports[_0x2f45('0x4d')]=function(_0x30b948,_0xfa4d68){return db['UserProfileResource']['create'](_0x30b948[_0x2f45('0x4e')],{})['then'](respondWithResult(_0xfa4d68,0xc9))[_0x2f45('0x4a')](handleError(_0xfa4d68,null));};exports['update']=function(_0x42da7c,_0x5c16c7){if(_0x42da7c[_0x2f45('0x4e')]['id']){delete _0x42da7c[_0x2f45('0x4e')]['id'];}return db[_0x2f45('0x2c')][_0x2f45('0x4c')]({'where':{'id':_0x42da7c['params']['id']}})[_0x2f45('0x25')](handleEntityNotFound(_0x5c16c7,null))['then'](saveUpdates(_0x42da7c[_0x2f45('0x4e')],null))[_0x2f45('0x25')](respondWithResult(_0x5c16c7,null))[_0x2f45('0x4a')](handleError(_0x5c16c7,null));};exports[_0x2f45('0x26')]=function(_0x93e709,_0x34eca8){return db['UserProfileResource'][_0x2f45('0x4c')]({'where':{'id':_0x93e709[_0x2f45('0x4b')]['id']}})[_0x2f45('0x25')](handleEntityNotFound(_0x34eca8,null))['then'](removeEntity(_0x34eca8,null))[_0x2f45('0x4a')](handleError(_0x34eca8,null));};exports[_0x2f45('0x4f')]=function(_0x1e212b,_0x10e452){return db[_0x2f45('0x2c')][_0x2f45('0x4f')]()[_0x2f45('0x25')](respondWithResult(_0x10e452,null))[_0x2f45('0x4a')](handleError(_0x10e452,null));}; \ No newline at end of file +var _0x4abf=['error','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','UserProfileResource','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','describe','html-pdf','eml-format','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','reject','then','sendStatus'];(function(_0x3dd5d2,_0x52b2f5){var _0x8b5683=function(_0x5550a2){while(--_0x5550a2){_0x3dd5d2['push'](_0x3dd5d2['shift']());}};_0x8b5683(++_0x52b2f5);}(_0x4abf,0xac));var _0xf4ab=function(_0x436b7f,_0xe5b65f){_0x436b7f=_0x436b7f-0x0;var _0x590b79=_0x4abf[_0x436b7f];return _0x590b79;};'use strict';var pdf=require(_0xf4ab('0x0'));var emlformat=require(_0xf4ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf4ab('0x3'));var Mustache=require(_0xf4ab('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf4ab('0x5'));var csv=require(_0xf4ab('0x6'));var ejs=require(_0xf4ab('0x7'));var fs=require('fs');var _=require(_0xf4ab('0x8'));var squel=require('squel');var crypto=require(_0xf4ab('0x9'));var jsforce=require(_0xf4ab('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf4ab('0x6'));var querystring=require('querystring');var Papa=require(_0xf4ab('0xb'));var Redis=require(_0xf4ab('0xc'));var authService=require(_0xf4ab('0xd'));var qs=require(_0xf4ab('0xe'));var hardwareService=require(_0xf4ab('0xf'));var logger=require(_0xf4ab('0x10'))(_0xf4ab('0x11'));var utils=require(_0xf4ab('0x12'));var config=require(_0xf4ab('0x13'));var db=require(_0xf4ab('0x14'))['db'];function respondWithStatusCode(_0x1df98f,_0x2d2e13){_0x2d2e13=_0x2d2e13||0xcc;return function(_0x1968f6){if(_0x1968f6){return _0x1df98f['sendStatus'](_0x2d2e13);}return _0x1df98f['status'](_0x2d2e13)[_0xf4ab('0x15')]();};}function respondWithResult(_0x54eabf,_0x35eab2){_0x35eab2=_0x35eab2||0xc8;return function(_0x1b7453){if(_0x1b7453){return _0x54eabf[_0xf4ab('0x16')](_0x35eab2)[_0xf4ab('0x17')](_0x1b7453);}};}function respondWithFilteredResult(_0x1f2d12,_0x37bbd6){return function(_0x47abb8){if(_0x47abb8){var _0x2e7b69=_0x47abb8[_0xf4ab('0x18')],_0x1c5202=_0x37bbd6[_0xf4ab('0x19')],_0xc26111=_0x37bbd6['offset']+_0x37bbd6[_0xf4ab('0x1a')],_0x5d50cb;if(_0xc26111>=_0x2e7b69){_0xc26111=_0x2e7b69;_0x5d50cb=0xc8;}else{_0x5d50cb=0xce;}_0x1f2d12[_0xf4ab('0x16')](_0x5d50cb);return _0x1f2d12[_0xf4ab('0x1b')](_0xf4ab('0x1c'),_0x1c5202+'-'+_0xc26111+'/'+_0x2e7b69)[_0xf4ab('0x17')](_0x47abb8);}return null;};}function patchUpdates(_0x2ac208){return function(_0x2ae65c){try{jsonpatch['apply'](_0x2ae65c,_0x2ac208,!![]);}catch(_0x4d8753){return BPromise[_0xf4ab('0x1d')](_0x4d8753);}return _0x2ae65c['save']();};}function saveUpdates(_0x18355c,_0x1727af){return function(_0x3c1394){if(_0x3c1394){return _0x3c1394['update'](_0x18355c)[_0xf4ab('0x1e')](function(_0x2fb02d){return _0x2fb02d;});}return null;};}function removeEntity(_0x3df1ef,_0x43e837){return function(_0xcd9799){if(_0xcd9799){return _0xcd9799['destroy']()[_0xf4ab('0x1e')](function(){_0x3df1ef[_0xf4ab('0x16')](0xcc)[_0xf4ab('0x15')]();});}};}function handleEntityNotFound(_0x248d13,_0x152d48){return function(_0xb5c618){if(!_0xb5c618){_0x248d13[_0xf4ab('0x1f')](0x194);}return _0xb5c618;};}function handleError(_0x5e4442,_0x910ef1){_0x910ef1=_0x910ef1||0x1f4;return function(_0x54e816){logger[_0xf4ab('0x20')](_0x54e816['stack']);if(_0x54e816['name']){delete _0x54e816['name'];}_0x5e4442['status'](_0x910ef1)['send'](_0x54e816);};}exports['index']=function(_0x5f5af2,_0x19d6a8){var _0x9863d1={},_0x1abd31={},_0x425e4e={'count':0x0,'rows':[]};var _0x1efb48=db['UserProfileResource']['rawAttributes'];_0x1abd31[_0xf4ab('0x21')]=_[_0xf4ab('0x22')](_0x1efb48);_0x1abd31['query']=_[_0xf4ab('0x22')](_0x5f5af2['query']);_0x1abd31[_0xf4ab('0x23')]=_[_0xf4ab('0x24')](_0x1abd31[_0xf4ab('0x21')],_0x1abd31[_0xf4ab('0x25')]);_0x9863d1[_0xf4ab('0x26')]=_[_0xf4ab('0x24')](_0x1abd31[_0xf4ab('0x21')],qs[_0xf4ab('0x27')](_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x27')]));_0x9863d1[_0xf4ab('0x26')]=_0x9863d1['attributes'][_0xf4ab('0x28')]?_0x9863d1['attributes']:_0x1abd31[_0xf4ab('0x21')];if(!_0x5f5af2[_0xf4ab('0x25')]['hasOwnProperty']('nolimit')){_0x9863d1[_0xf4ab('0x1a')]=qs[_0xf4ab('0x1a')](_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x1a')]);_0x9863d1[_0xf4ab('0x19')]=qs['offset'](_0x5f5af2['query'][_0xf4ab('0x19')]);}_0x9863d1[_0xf4ab('0x29')]=qs[_0xf4ab('0x2a')](_0x5f5af2['query'][_0xf4ab('0x2a')]);_0x9863d1[_0xf4ab('0x2b')]=qs[_0xf4ab('0x23')](_[_0xf4ab('0x2c')](_0x5f5af2[_0xf4ab('0x25')],_0x1abd31[_0xf4ab('0x23')]));if(_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x2d')]){_0x9863d1[_0xf4ab('0x2b')]=_[_0xf4ab('0x2e')](_0x9863d1[_0xf4ab('0x2b')],{'$or':_[_0xf4ab('0x2f')](_0x1efb48,function(_0x5f1722){if(_0x5f1722[_0xf4ab('0x30')][_0xf4ab('0x31')]!==_0xf4ab('0x32')){var _0x460637={};_0x460637[_0x5f1722[_0xf4ab('0x33')]]={'$like':'%'+_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x2d')]+'%'};return _0x460637;}})});}_0x9863d1=_[_0xf4ab('0x2e')]({},_0x9863d1,_0x5f5af2[_0xf4ab('0x34')]);var _0x179ff2={'where':_0x9863d1[_0xf4ab('0x2b')]};return db[_0xf4ab('0x35')][_0xf4ab('0x18')](_0x179ff2)[_0xf4ab('0x1e')](function(_0x4ed7d4){_0x425e4e[_0xf4ab('0x18')]=_0x4ed7d4;if(_0x5f5af2[_0xf4ab('0x25')][_0xf4ab('0x36')]){_0x9863d1[_0xf4ab('0x37')]=[{'all':!![]}];}return db['UserProfileResource'][_0xf4ab('0x38')](_0x9863d1);})[_0xf4ab('0x1e')](function(_0x220281){_0x425e4e[_0xf4ab('0x39')]=_0x220281;return _0x425e4e;})['then'](respondWithFilteredResult(_0x19d6a8,_0x9863d1))[_0xf4ab('0x3a')](handleError(_0x19d6a8,null));};exports[_0xf4ab('0x3b')]=function(_0x2c97c1,_0x4bde74){var _0x1aeacb={'raw':![],'where':{'id':_0x2c97c1[_0xf4ab('0x3c')]['id']}},_0x4cf010={};_0x4cf010[_0xf4ab('0x21')]=_[_0xf4ab('0x22')](db[_0xf4ab('0x35')][_0xf4ab('0x3d')]);_0x4cf010['query']=_[_0xf4ab('0x22')](_0x2c97c1[_0xf4ab('0x25')]);_0x4cf010['filters']=_[_0xf4ab('0x24')](_0x4cf010[_0xf4ab('0x21')],_0x4cf010[_0xf4ab('0x25')]);_0x1aeacb['attributes']=_[_0xf4ab('0x24')](_0x4cf010['model'],qs[_0xf4ab('0x27')](_0x2c97c1[_0xf4ab('0x25')]['fields']));_0x1aeacb[_0xf4ab('0x26')]=_0x1aeacb[_0xf4ab('0x26')][_0xf4ab('0x28')]?_0x1aeacb[_0xf4ab('0x26')]:_0x4cf010['model'];if(_0x2c97c1['query'][_0xf4ab('0x36')]){_0x1aeacb['include']=[{'all':!![]}];}_0x1aeacb=_['merge']({},_0x1aeacb,_0x2c97c1[_0xf4ab('0x34')]);return db[_0xf4ab('0x35')][_0xf4ab('0x3e')](_0x1aeacb)[_0xf4ab('0x1e')](handleEntityNotFound(_0x4bde74,null))[_0xf4ab('0x1e')](respondWithResult(_0x4bde74,null))[_0xf4ab('0x3a')](handleError(_0x4bde74,null));};exports[_0xf4ab('0x3f')]=function(_0x2fe6b9,_0x2f99b5){return db[_0xf4ab('0x35')][_0xf4ab('0x3f')](_0x2fe6b9[_0xf4ab('0x40')],{})[_0xf4ab('0x1e')](respondWithResult(_0x2f99b5,0xc9))['catch'](handleError(_0x2f99b5,null));};exports[_0xf4ab('0x41')]=function(_0x1c5501,_0x571adc){if(_0x1c5501[_0xf4ab('0x40')]['id']){delete _0x1c5501[_0xf4ab('0x40')]['id'];}return db[_0xf4ab('0x35')]['find']({'where':{'id':_0x1c5501[_0xf4ab('0x3c')]['id']}})['then'](handleEntityNotFound(_0x571adc,null))[_0xf4ab('0x1e')](saveUpdates(_0x1c5501[_0xf4ab('0x40')],null))[_0xf4ab('0x1e')](respondWithResult(_0x571adc,null))[_0xf4ab('0x3a')](handleError(_0x571adc,null));};exports[_0xf4ab('0x42')]=function(_0x448646,_0x25e6cc){return db['UserProfileResource'][_0xf4ab('0x3e')]({'where':{'id':_0x448646[_0xf4ab('0x3c')]['id']}})[_0xf4ab('0x1e')](handleEntityNotFound(_0x25e6cc,null))[_0xf4ab('0x1e')](removeEntity(_0x25e6cc,null))[_0xf4ab('0x3a')](handleError(_0x25e6cc,null));};exports[_0xf4ab('0x43')]=function(_0x271eae,_0x4412f4){return db[_0xf4ab('0x35')][_0xf4ab('0x43')]()['then'](respondWithResult(_0x4412f4,null))[_0xf4ab('0x3a')](handleError(_0x4412f4,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4020f27..cb3d55f 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 _0xc714=['resourceId','sectionId','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc714,0x144));var _0x4c71=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc714[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c71('0x0'))(_0x4c71('0x1'));var moment=require(_0x4c71('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c71('0x4'));var config=require(_0x4c71('0x5'));var attributes=require(_0x4c71('0x6'));module[_0x4c71('0x7')]=function(_0x466862,_0x2edd53){return _0x466862[_0x4c71('0x8')](_0x4c71('0x9'),attributes,{'tableName':_0x4c71('0xa'),'paranoid':![],'indexes':[{'name':_0x4c71('0xb'),'fields':[_0x4c71('0xc'),_0x4c71('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7221=['rimraf','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4148a2,_0x39c942){var _0x27b22f=function(_0x12451c){while(--_0x12451c){_0x4148a2['push'](_0x4148a2['shift']());}};_0x27b22f(++_0x39c942);}(_0x7221,0x198));var _0x1722=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x7221[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0x1722('0x0'));var util=require(_0x1722('0x1'));var logger=require(_0x1722('0x2'))(_0x1722('0x3'));var moment=require(_0x1722('0x4'));var BPromise=require(_0x1722('0x5'));var rp=require(_0x1722('0x6'));var fs=require('fs');var path=require(_0x1722('0x7'));var rimraf=require(_0x1722('0x8'));var config=require('../../config/environment');var attributes=require(_0x1722('0x9'));module[_0x1722('0xa')]=function(_0x56311f,_0x529ea1){return _0x56311f['define']('UserProfileResource',attributes,{'tableName':_0x1722('0xb'),'paranoid':![],'indexes':[{'name':_0x1722('0xc'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e1b0844..0063b97 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x53ec,0x192));var _0xc53e=function(_0x1bd85d,_0xdc683f){_0x1bd85d=_0x1bd85d-0x0;var _0xd40669=_0x53ec[_0x1bd85d];return _0xd40669;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x7b84=['jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x56e414,_0x271b18){var _0x46a7b1=function(_0x1cd640){while(--_0x1cd640){_0x56e414['push'](_0x56e414['shift']());}};_0x46a7b1(++_0x271b18);}(_0x7b84,0x17c));var _0x47b8=function(_0x5bd8ed,_0x536443){_0x5bd8ed=_0x5bd8ed-0x0;var _0x1254db=_0x7b84[_0x5bd8ed];return _0x1254db;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 11afc2f..541ca40 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 _0x2621=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x2621,0x14c));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var path=require(_0x1262('0x2'));var timeout=require('connect-timeout');var express=require(_0x1262('0x3'));var router=express[_0x1262('0x4')]();var auth=require(_0x1262('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x1262('0x6')]('/',auth[_0x1262('0x7')](),controller[_0x1262('0x8')]);router[_0x1262('0x6')](_0x1262('0x9'),auth['isAuthenticated'](),controller[_0x1262('0xa')]);router[_0x1262('0x6')](_0x1262('0xb'),auth['isAuthenticated'](),controller[_0x1262('0xc')]);router[_0x1262('0xd')]('/',auth['isAuthenticated'](),controller[_0x1262('0xe')]);router[_0x1262('0xf')](_0x1262('0xb'),auth[_0x1262('0x7')](),controller[_0x1262('0x10')]);router[_0x1262('0x11')](_0x1262('0xb'),auth[_0x1262('0x7')](),controller[_0x1262('0x12')]);module[_0x1262('0x13')]=router; \ No newline at end of file +var _0x6bec=['post','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x5a133b,_0xfa797){var _0x5ef421=function(_0xa9339f){while(--_0xa9339f){_0x5a133b['push'](_0x5a133b['shift']());}};_0x5ef421(++_0xfa797);}(_0x6bec,0x8d));var _0xc6be=function(_0x22d208,_0x5dea90){_0x22d208=_0x22d208-0x0;var _0xff3ba=_0x6bec[_0x22d208];return _0xff3ba;};'use strict';var multer=require(_0xc6be('0x0'));var util=require(_0xc6be('0x1'));var path=require(_0xc6be('0x2'));var timeout=require(_0xc6be('0x3'));var express=require(_0xc6be('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6be('0x5'));var controller=require('./userProfileSection.controller');router[_0xc6be('0x6')]('/',auth[_0xc6be('0x7')](),controller[_0xc6be('0x8')]);router['get']('/describe',auth[_0xc6be('0x7')](),controller[_0xc6be('0x9')]);router['get'](_0xc6be('0xa'),auth[_0xc6be('0x7')](),controller[_0xc6be('0xb')]);router[_0xc6be('0xc')]('/',auth[_0xc6be('0x7')](),controller['create']);router[_0xc6be('0xd')](_0xc6be('0xa'),auth['isAuthenticated'](),controller[_0xc6be('0xe')]);router[_0xc6be('0xf')](_0xc6be('0xa'),auth[_0xc6be('0x7')](),controller['destroy']);module[_0xc6be('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index fc45853..5751630 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 _0xcb91=['BOOLEAN','crudPermissions','join','getDataValue','split','STRING','INTEGER'];(function(_0x4a1534,_0x3aca4c){var _0x292e20=function(_0x98dca1){while(--_0x98dca1){_0x4a1534['push'](_0x4a1534['shift']());}};_0x292e20(++_0x3aca4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0xcb91[_0x4c1ec2];return _0x3f6f1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x1cb9('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x1cb9('0x0')],'set':function(_0x2c17b8){this['setDataValue'](_0x1cb9('0x3'),_0x2c17b8?_0x2c17b8[_0x1cb9('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x1cb9('0x3'))?this[_0x1cb9('0x5')]('crudPermissions')[_0x1cb9('0x6')](''):[];}}}; \ No newline at end of file +var _0x9c44=['BOOLEAN','crudPermissions','getDataValue','split','STRING','INTEGER'];(function(_0x2e48ad,_0x564396){var _0x4719d4=function(_0x4ee8d1){while(--_0x4ee8d1){_0x2e48ad['push'](_0x2e48ad['shift']());}};_0x4719d4(++_0x564396);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x49c4('0x0')],'set':function(_0x4e0313){this['setDataValue'](_0x49c4('0x3'),_0x4e0313?_0x4e0313['join'](''):[]);},'get':function(){return this[_0x49c4('0x4')](_0x49c4('0x3'))?this[_0x49c4('0x4')](_0x49c4('0x3'))[_0x49c4('0x5')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2f93a8f..97ddd01 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 _0x0274=['count','offset','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','UserProfileSection','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','field','filter','options','include','findAll','rows','show','params','length','includeAll','create','body','update','find','catch','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0274,0x1e9));var _0x4027=function(_0x36969d,_0x4d8059){_0x36969d=_0x36969d-0x0;var _0xbb52dc=_0x0274[_0x36969d];return _0xbb52dc;};'use strict';var pdf=require(_0x4027('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4027('0x1'));var jsonpatch=require(_0x4027('0x2'));var rp=require(_0x4027('0x3'));var moment=require(_0x4027('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4027('0x5'));var util=require(_0x4027('0x6'));var path=require(_0x4027('0x7'));var sox=require('sox');var csv=require(_0x4027('0x8'));var ejs=require(_0x4027('0x9'));var fs=require('fs');var _=require(_0x4027('0xa'));var squel=require(_0x4027('0xb'));var crypto=require(_0x4027('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4027('0x8'));var querystring=require('querystring');var Papa=require(_0x4027('0xd'));var Redis=require(_0x4027('0xe'));var authService=require(_0x4027('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4027('0x10'));var logger=require(_0x4027('0x11'))(_0x4027('0x12'));var utils=require(_0x4027('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9009,_0x27e62b){_0x27e62b=_0x27e62b||0xcc;return function(_0x2f3893){if(_0x2f3893){return _0x3d9009['sendStatus'](_0x27e62b);}return _0x3d9009[_0x4027('0x14')](_0x27e62b)['end']();};}function respondWithResult(_0x4d15a7,_0x7fea70){_0x7fea70=_0x7fea70||0xc8;return function(_0x50094d){if(_0x50094d){return _0x4d15a7[_0x4027('0x14')](_0x7fea70)[_0x4027('0x15')](_0x50094d);}};}function respondWithFilteredResult(_0x5db33b,_0x34b306){return function(_0x347eae){if(_0x347eae){var _0x599ba7=_0x347eae[_0x4027('0x16')],_0x1364d1=_0x34b306['offset'],_0x4fa85e=_0x34b306[_0x4027('0x17')]+_0x34b306['limit'],_0xbcf1bb;if(_0x4fa85e>=_0x599ba7){_0x4fa85e=_0x599ba7;_0xbcf1bb=0xc8;}else{_0xbcf1bb=0xce;}_0x5db33b[_0x4027('0x14')](_0xbcf1bb);return _0x5db33b[_0x4027('0x18')](_0x4027('0x19'),_0x1364d1+'-'+_0x4fa85e+'/'+_0x599ba7)['json'](_0x347eae);}return null;};}function patchUpdates(_0x2c8fc6){return function(_0x310856){try{jsonpatch[_0x4027('0x1a')](_0x310856,_0x2c8fc6,!![]);}catch(_0x37176d){return BPromise[_0x4027('0x1b')](_0x37176d);}return _0x310856[_0x4027('0x1c')]();};}function saveUpdates(_0x5f0bfb,_0x8bede6){return function(_0x12e8ce){if(_0x12e8ce){return _0x12e8ce['update'](_0x5f0bfb)[_0x4027('0x1d')](function(_0x502045){return _0x502045;});}return null;};}function removeEntity(_0x40d125,_0x1214c5){return function(_0x3beac5){if(_0x3beac5){return _0x3beac5[_0x4027('0x1e')]()[_0x4027('0x1d')](function(){_0x40d125[_0x4027('0x14')](0xcc)[_0x4027('0x1f')]();});}};}function handleEntityNotFound(_0x1c849a,_0x24c20d){return function(_0x3c48ef){if(!_0x3c48ef){_0x1c849a[_0x4027('0x20')](0x194);}return _0x3c48ef;};}function handleError(_0x360401,_0x54ec9f){_0x54ec9f=_0x54ec9f||0x1f4;return function(_0x2d4710){logger[_0x4027('0x21')](_0x2d4710[_0x4027('0x22')]);if(_0x2d4710[_0x4027('0x23')]){delete _0x2d4710[_0x4027('0x23')];}_0x360401[_0x4027('0x14')](_0x54ec9f)[_0x4027('0x24')](_0x2d4710);};}exports['index']=function(_0x4cbcb2,_0x2c3e26){var _0x3ba3ca={},_0xd3d7dd={},_0x635f7c={'count':0x0,'rows':[]};var _0x23dd02=db[_0x4027('0x25')][_0x4027('0x26')];_0xd3d7dd[_0x4027('0x27')]=_[_0x4027('0x28')](_0x23dd02);_0xd3d7dd['query']=_[_0x4027('0x28')](_0x4cbcb2[_0x4027('0x29')]);_0xd3d7dd[_0x4027('0x2a')]=_[_0x4027('0x2b')](_0xd3d7dd['model'],_0xd3d7dd['query']);_0x3ba3ca[_0x4027('0x2c')]=_[_0x4027('0x2b')](_0xd3d7dd[_0x4027('0x27')],qs[_0x4027('0x2d')](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x2d')]));_0x3ba3ca['attributes']=_0x3ba3ca[_0x4027('0x2c')]['length']?_0x3ba3ca['attributes']:_0xd3d7dd['model'];if(!_0x4cbcb2[_0x4027('0x29')][_0x4027('0x2e')](_0x4027('0x2f'))){_0x3ba3ca[_0x4027('0x30')]=qs['limit'](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x30')]);_0x3ba3ca[_0x4027('0x17')]=qs['offset'](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x17')]);}_0x3ba3ca[_0x4027('0x31')]=qs[_0x4027('0x32')](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x32')]);_0x3ba3ca[_0x4027('0x33')]=qs[_0x4027('0x2a')](_[_0x4027('0x34')](_0x4cbcb2['query'],_0xd3d7dd[_0x4027('0x2a')]));if(_0x4cbcb2[_0x4027('0x29')]['filter']){_0x3ba3ca[_0x4027('0x33')]=_[_0x4027('0x35')](_0x3ba3ca['where'],{'$or':_[_0x4027('0x36')](_0x23dd02,function(_0x371a24){if(_0x371a24[_0x4027('0x37')][_0x4027('0x38')]!=='VIRTUAL'){var _0x44e040={};_0x44e040[_0x371a24[_0x4027('0x39')]]={'$like':'%'+_0x4cbcb2[_0x4027('0x29')][_0x4027('0x3a')]+'%'};return _0x44e040;}})});}_0x3ba3ca=_[_0x4027('0x35')]({},_0x3ba3ca,_0x4cbcb2[_0x4027('0x3b')]);var _0x4de376={'where':_0x3ba3ca[_0x4027('0x33')]};return db[_0x4027('0x25')][_0x4027('0x16')](_0x4de376)[_0x4027('0x1d')](function(_0x2a5abc){_0x635f7c[_0x4027('0x16')]=_0x2a5abc;if(_0x4cbcb2['query']['includeAll']){_0x3ba3ca[_0x4027('0x3c')]=[{'all':!![]}];}return db[_0x4027('0x25')][_0x4027('0x3d')](_0x3ba3ca);})[_0x4027('0x1d')](function(_0x2ae16d){_0x635f7c[_0x4027('0x3e')]=_0x2ae16d;return _0x635f7c;})[_0x4027('0x1d')](respondWithFilteredResult(_0x2c3e26,_0x3ba3ca))['catch'](handleError(_0x2c3e26,null));};exports[_0x4027('0x3f')]=function(_0x99ed9d,_0x5306a1){var _0x5998ec={'raw':![],'where':{'id':_0x99ed9d[_0x4027('0x40')]['id']}},_0x20b790={};_0x20b790[_0x4027('0x27')]=_[_0x4027('0x28')](db[_0x4027('0x25')][_0x4027('0x26')]);_0x20b790['query']=_[_0x4027('0x28')](_0x99ed9d['query']);_0x20b790[_0x4027('0x2a')]=_[_0x4027('0x2b')](_0x20b790[_0x4027('0x27')],_0x20b790[_0x4027('0x29')]);_0x5998ec[_0x4027('0x2c')]=_[_0x4027('0x2b')](_0x20b790[_0x4027('0x27')],qs['fields'](_0x99ed9d[_0x4027('0x29')][_0x4027('0x2d')]));_0x5998ec[_0x4027('0x2c')]=_0x5998ec[_0x4027('0x2c')][_0x4027('0x41')]?_0x5998ec[_0x4027('0x2c')]:_0x20b790['model'];if(_0x99ed9d['query'][_0x4027('0x42')]){_0x5998ec[_0x4027('0x3c')]=[{'all':!![]}];}_0x5998ec=_['merge']({},_0x5998ec,_0x99ed9d[_0x4027('0x3b')]);return db[_0x4027('0x25')]['find'](_0x5998ec)[_0x4027('0x1d')](handleEntityNotFound(_0x5306a1,null))['then'](respondWithResult(_0x5306a1,null))['catch'](handleError(_0x5306a1,null));};exports[_0x4027('0x43')]=function(_0x1ec156,_0x5ad280){return db['UserProfileSection']['create'](_0x1ec156[_0x4027('0x44')],{})['then'](respondWithResult(_0x5ad280,0xc9))['catch'](handleError(_0x5ad280,null));};exports[_0x4027('0x45')]=function(_0x47fad7,_0x4656ad){if(_0x47fad7[_0x4027('0x44')]['id']){delete _0x47fad7['body']['id'];}return db['UserProfileSection'][_0x4027('0x46')]({'where':{'id':_0x47fad7[_0x4027('0x40')]['id']}})[_0x4027('0x1d')](handleEntityNotFound(_0x4656ad,null))['then'](saveUpdates(_0x47fad7['body'],null))[_0x4027('0x1d')](respondWithResult(_0x4656ad,null))[_0x4027('0x47')](handleError(_0x4656ad,null));};exports[_0x4027('0x1e')]=function(_0x2469ca,_0x76bd5c){return db['UserProfileSection'][_0x4027('0x46')]({'where':{'id':_0x2469ca[_0x4027('0x40')]['id']}})[_0x4027('0x1d')](handleEntityNotFound(_0x76bd5c,null))[_0x4027('0x1d')](removeEntity(_0x76bd5c,null))[_0x4027('0x47')](handleError(_0x76bd5c,null));};exports[_0x4027('0x48')]=function(_0x5f6740,_0x3c88f4){return db[_0x4027('0x25')][_0x4027('0x48')]()[_0x4027('0x1d')](respondWithResult(_0x3c88f4,null))[_0x4027('0x47')](handleError(_0x3c88f4,null));}; \ No newline at end of file +var _0x7a3e=['reject','save','then','destroy','end','error','stack','name','index','UserProfileSection','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply'];(function(_0x4853fc,_0x52cd55){var _0x23be73=function(_0x541448){while(--_0x541448){_0x4853fc['push'](_0x4853fc['shift']());}};_0x23be73(++_0x52cd55);}(_0x7a3e,0x199));var _0xe7a3=function(_0x19a751,_0x2cabc5){_0x19a751=_0x19a751-0x0;var _0x310874=_0x7a3e[_0x19a751];return _0x310874;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe7a3('0x0'));var rimraf=require(_0xe7a3('0x1'));var zipdir=require(_0xe7a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require(_0xe7a3('0x5'));var Mustache=require(_0xe7a3('0x6'));var util=require(_0xe7a3('0x7'));var path=require(_0xe7a3('0x8'));var sox=require(_0xe7a3('0x9'));var csv=require(_0xe7a3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe7a3('0xb'));var squel=require('squel');var crypto=require(_0xe7a3('0xc'));var jsforce=require(_0xe7a3('0xd'));var deskjs=require(_0xe7a3('0xe'));var toCsv=require(_0xe7a3('0xa'));var querystring=require(_0xe7a3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe7a3('0x10'));var hardwareService=require(_0xe7a3('0x11'));var logger=require(_0xe7a3('0x12'))(_0xe7a3('0x13'));var utils=require('../../config/utils');var config=require(_0xe7a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57a106,_0x517471){_0x517471=_0x517471||0xcc;return function(_0x9009af){if(_0x9009af){return _0x57a106[_0xe7a3('0x15')](_0x517471);}return _0x57a106[_0xe7a3('0x16')](_0x517471)['end']();};}function respondWithResult(_0x1723e3,_0x362216){_0x362216=_0x362216||0xc8;return function(_0x299305){if(_0x299305){return _0x1723e3[_0xe7a3('0x16')](_0x362216)[_0xe7a3('0x17')](_0x299305);}};}function respondWithFilteredResult(_0x4e09f0,_0x1fc5f7){return function(_0x13a573){if(_0x13a573){var _0x315b01=_0x13a573[_0xe7a3('0x18')],_0x8362ac=_0x1fc5f7[_0xe7a3('0x19')],_0x4c4046=_0x1fc5f7[_0xe7a3('0x19')]+_0x1fc5f7['limit'],_0x79c347;if(_0x4c4046>=_0x315b01){_0x4c4046=_0x315b01;_0x79c347=0xc8;}else{_0x79c347=0xce;}_0x4e09f0[_0xe7a3('0x16')](_0x79c347);return _0x4e09f0[_0xe7a3('0x1a')](_0xe7a3('0x1b'),_0x8362ac+'-'+_0x4c4046+'/'+_0x315b01)[_0xe7a3('0x17')](_0x13a573);}return null;};}function patchUpdates(_0x16b471){return function(_0x2da287){try{jsonpatch[_0xe7a3('0x1c')](_0x2da287,_0x16b471,!![]);}catch(_0x5aa0e9){return BPromise[_0xe7a3('0x1d')](_0x5aa0e9);}return _0x2da287[_0xe7a3('0x1e')]();};}function saveUpdates(_0x160b05,_0x293e37){return function(_0x532c74){if(_0x532c74){return _0x532c74['update'](_0x160b05)[_0xe7a3('0x1f')](function(_0x43b9eb){return _0x43b9eb;});}return null;};}function removeEntity(_0x4ed737,_0x28dcef){return function(_0xa4d8a3){if(_0xa4d8a3){return _0xa4d8a3[_0xe7a3('0x20')]()[_0xe7a3('0x1f')](function(){_0x4ed737[_0xe7a3('0x16')](0xcc)[_0xe7a3('0x21')]();});}};}function handleEntityNotFound(_0x40a418,_0x2b735b){return function(_0x116b9d){if(!_0x116b9d){_0x40a418['sendStatus'](0x194);}return _0x116b9d;};}function handleError(_0x28f1d2,_0xa04857){_0xa04857=_0xa04857||0x1f4;return function(_0x32bfe4){logger[_0xe7a3('0x22')](_0x32bfe4[_0xe7a3('0x23')]);if(_0x32bfe4[_0xe7a3('0x24')]){delete _0x32bfe4['name'];}_0x28f1d2[_0xe7a3('0x16')](_0xa04857)['send'](_0x32bfe4);};}exports[_0xe7a3('0x25')]=function(_0x58146a,_0x4851d2){var _0x45ad84={},_0x124213={},_0x1fd004={'count':0x0,'rows':[]};var _0x4ca85c=db[_0xe7a3('0x26')][_0xe7a3('0x27')];_0x124213['model']=_['keys'](_0x4ca85c);_0x124213[_0xe7a3('0x28')]=_['keys'](_0x58146a['query']);_0x124213['filters']=_[_0xe7a3('0x29')](_0x124213[_0xe7a3('0x2a')],_0x124213[_0xe7a3('0x28')]);_0x45ad84[_0xe7a3('0x2b')]=_[_0xe7a3('0x29')](_0x124213[_0xe7a3('0x2a')],qs[_0xe7a3('0x2c')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2c')]));_0x45ad84['attributes']=_0x45ad84[_0xe7a3('0x2b')][_0xe7a3('0x2d')]?_0x45ad84[_0xe7a3('0x2b')]:_0x124213[_0xe7a3('0x2a')];if(!_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2e')]('nolimit')){_0x45ad84[_0xe7a3('0x2f')]=qs[_0xe7a3('0x2f')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x2f')]);_0x45ad84['offset']=qs['offset'](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x19')]);}_0x45ad84[_0xe7a3('0x30')]=qs[_0xe7a3('0x31')](_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x31')]);_0x45ad84[_0xe7a3('0x32')]=qs[_0xe7a3('0x33')](_[_0xe7a3('0x34')](_0x58146a['query'],_0x124213[_0xe7a3('0x33')]));if(_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x35')]){_0x45ad84[_0xe7a3('0x32')]=_[_0xe7a3('0x36')](_0x45ad84[_0xe7a3('0x32')],{'$or':_[_0xe7a3('0x37')](_0x4ca85c,function(_0x161dc3){if(_0x161dc3[_0xe7a3('0x38')][_0xe7a3('0x39')]!==_0xe7a3('0x3a')){var _0x20437c={};_0x20437c[_0x161dc3[_0xe7a3('0x3b')]]={'$like':'%'+_0x58146a[_0xe7a3('0x28')]['filter']+'%'};return _0x20437c;}})});}_0x45ad84=_['merge']({},_0x45ad84,_0x58146a[_0xe7a3('0x3c')]);var _0x5380bf={'where':_0x45ad84[_0xe7a3('0x32')]};return db[_0xe7a3('0x26')][_0xe7a3('0x18')](_0x5380bf)[_0xe7a3('0x1f')](function(_0x43f13d){_0x1fd004[_0xe7a3('0x18')]=_0x43f13d;if(_0x58146a[_0xe7a3('0x28')][_0xe7a3('0x3d')]){_0x45ad84['include']=[{'all':!![]}];}return db[_0xe7a3('0x26')][_0xe7a3('0x3e')](_0x45ad84);})['then'](function(_0x3499e3){_0x1fd004[_0xe7a3('0x3f')]=_0x3499e3;return _0x1fd004;})[_0xe7a3('0x1f')](respondWithFilteredResult(_0x4851d2,_0x45ad84))[_0xe7a3('0x40')](handleError(_0x4851d2,null));};exports['show']=function(_0x1d89d7,_0x45a6b0){var _0x543d5a={'raw':![],'where':{'id':_0x1d89d7[_0xe7a3('0x41')]['id']}},_0x876f2={};_0x876f2['model']=_[_0xe7a3('0x42')](db[_0xe7a3('0x26')]['rawAttributes']);_0x876f2['query']=_[_0xe7a3('0x42')](_0x1d89d7[_0xe7a3('0x28')]);_0x876f2[_0xe7a3('0x33')]=_[_0xe7a3('0x29')](_0x876f2['model'],_0x876f2[_0xe7a3('0x28')]);_0x543d5a[_0xe7a3('0x2b')]=_['intersection'](_0x876f2['model'],qs[_0xe7a3('0x2c')](_0x1d89d7[_0xe7a3('0x28')]['fields']));_0x543d5a[_0xe7a3('0x2b')]=_0x543d5a[_0xe7a3('0x2b')][_0xe7a3('0x2d')]?_0x543d5a[_0xe7a3('0x2b')]:_0x876f2[_0xe7a3('0x2a')];if(_0x1d89d7[_0xe7a3('0x28')]['includeAll']){_0x543d5a[_0xe7a3('0x43')]=[{'all':!![]}];}_0x543d5a=_[_0xe7a3('0x36')]({},_0x543d5a,_0x1d89d7[_0xe7a3('0x3c')]);return db[_0xe7a3('0x26')][_0xe7a3('0x44')](_0x543d5a)['then'](handleEntityNotFound(_0x45a6b0,null))[_0xe7a3('0x1f')](respondWithResult(_0x45a6b0,null))['catch'](handleError(_0x45a6b0,null));};exports[_0xe7a3('0x45')]=function(_0x5c4d10,_0x5e66c6){return db[_0xe7a3('0x26')][_0xe7a3('0x45')](_0x5c4d10[_0xe7a3('0x46')],{})[_0xe7a3('0x1f')](respondWithResult(_0x5e66c6,0xc9))[_0xe7a3('0x40')](handleError(_0x5e66c6,null));};exports[_0xe7a3('0x47')]=function(_0x1d1ec0,_0x1bd15c){if(_0x1d1ec0['body']['id']){delete _0x1d1ec0[_0xe7a3('0x46')]['id'];}return db[_0xe7a3('0x26')][_0xe7a3('0x44')]({'where':{'id':_0x1d1ec0[_0xe7a3('0x41')]['id']}})['then'](handleEntityNotFound(_0x1bd15c,null))[_0xe7a3('0x1f')](saveUpdates(_0x1d1ec0[_0xe7a3('0x46')],null))[_0xe7a3('0x1f')](respondWithResult(_0x1bd15c,null))[_0xe7a3('0x40')](handleError(_0x1bd15c,null));};exports[_0xe7a3('0x20')]=function(_0x1d8c6e,_0xf3604d){return db[_0xe7a3('0x26')][_0xe7a3('0x44')]({'where':{'id':_0x1d8c6e[_0xe7a3('0x41')]['id']}})[_0xe7a3('0x1f')](handleEntityNotFound(_0xf3604d,null))[_0xe7a3('0x1f')](removeEntity(_0xf3604d,null))[_0xe7a3('0x40')](handleError(_0xf3604d,null));};exports[_0xe7a3('0x48')]=function(_0x37b09a,_0x2ee268){return db[_0xe7a3('0x26')][_0xe7a3('0x48')]()[_0xe7a3('0x1f')](respondWithResult(_0x2ee268,null))[_0xe7a3('0x40')](handleError(_0x2ee268,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c90c4a8..6181a2a 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 _0x53cf=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x5a097c,_0x28506f){var _0x51b539=function(_0xd64448){while(--_0xd64448){_0x5a097c['push'](_0x5a097c['shift']());}};_0x51b539(++_0x28506f);}(_0x53cf,0xd4));var _0xf53c=function(_0x35b15b,_0x566c8f){_0x35b15b=_0x35b15b-0x0;var _0x46cbfb=_0x53cf[_0x35b15b];return _0x46cbfb;};'use strict';var _=require(_0xf53c('0x0'));var util=require(_0xf53c('0x1'));var logger=require('../../config/logger')(_0xf53c('0x2'));var moment=require(_0xf53c('0x3'));var BPromise=require(_0xf53c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf53c('0x5'));var rimraf=require(_0xf53c('0x6'));var config=require(_0xf53c('0x7'));var attributes=require(_0xf53c('0x8'));module[_0xf53c('0x9')]=function(_0x3f9a3f,_0x427a48){return _0x3f9a3f[_0xf53c('0xa')](_0xf53c('0xb'),attributes,{'tableName':_0xf53c('0xc'),'paranoid':![],'indexes':[{'name':_0xf53c('0xd'),'fields':[_0xf53c('0xe'),_0xf53c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x207c=['path','../../config/environment','define','UserProfileSection','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x207c,0x1e8));var _0xc207=function(_0x1a4c27,_0x5a4b45){_0x1a4c27=_0x1a4c27-0x0;var _0x578d9=_0x207c[_0x1a4c27];return _0x578d9;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xc207('0xa'),'fields':[_0xc207('0xb'),_0xc207('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 0f20d51..37de796 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 _0x4d4e=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x5b3aca,_0x3d0d08){_0x5b3aca=_0x5b3aca-0x0;var _0x3c93b1=_0x4d4e[_0x5b3aca];return _0x3c93b1;};'use strict';var _=require(_0xe4d4('0x0'));var util=require('util');var moment=require(_0xe4d4('0x1'));var BPromise=require(_0xe4d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d4('0x3'));var db=require(_0xe4d4('0x4'))['db'];var utils=require(_0xe4d4('0x5'));var logger=require(_0xe4d4('0x6'))(_0xe4d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6652,_0x4e9d70,_0xf010c6){return new BPromise(function(_0x3e422b,_0x14ec7a){return client[_0xe4d4('0x9')](_0x5b6652,_0xf010c6)[_0xe4d4('0xa')](function(_0x58cce7){logger['info'](_0xe4d4('0xb'),_0x4e9d70,_0xe4d4('0xc'));logger[_0xe4d4('0xd')](_0xe4d4('0xe'),_0x4e9d70,_0xe4d4('0xc'),JSON[_0xe4d4('0xf')](_0x58cce7));if(_0x58cce7[_0xe4d4('0x10')]){if(_0x58cce7[_0xe4d4('0x10')]['code']===0x1f4){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7[_0xe4d4('0x10')]['message']);return _0x14ec7a(_0x58cce7[_0xe4d4('0x10')][_0xe4d4('0x11')]);}logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7['error']['message']);return _0x3e422b(_0x58cce7[_0xe4d4('0x10')]['message']);}else{logger[_0xe4d4('0x12')](_0xe4d4('0xb'),_0x4e9d70,'request\x20sent');_0x3e422b(_0x58cce7[_0xe4d4('0x13')][_0xe4d4('0x11')]);}})[_0xe4d4('0x14')](function(_0xad05a7){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0xad05a7);_0x14ec7a(_0xad05a7);});});} \ No newline at end of file +var _0x5638=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5638,0xb3));var _0x8563=function(_0x5ec5f3,_0x5da82a){_0x5ec5f3=_0x5ec5f3-0x0;var _0x1ad7be=_0x5638[_0x5ec5f3];return _0x1ad7be;};'use strict';var _=require(_0x8563('0x0'));var util=require(_0x8563('0x1'));var moment=require(_0x8563('0x2'));var BPromise=require('bluebird');var rs=require(_0x8563('0x3'));var fs=require('fs');var Redis=require(_0x8563('0x4'));var db=require(_0x8563('0x5'))['db'];var utils=require(_0x8563('0x6'));var logger=require('../../config/logger')(_0x8563('0x7'));var config=require(_0x8563('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8563('0x9')][_0x8563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30e2ea,_0x13454a,_0xa29962){return new BPromise(function(_0x3c4b71,_0x45ead6){return client[_0x8563('0xb')](_0x30e2ea,_0xa29962)[_0x8563('0xc')](function(_0xa0bedb){logger[_0x8563('0xd')](_0x8563('0xe'),_0x13454a,'request\x20sent');logger[_0x8563('0xf')](_0x8563('0x10'),_0x13454a,_0x8563('0x11'),JSON['stringify'](_0xa0bedb));if(_0xa0bedb['error']){if(_0xa0bedb[_0x8563('0x12')]['code']===0x1f4){logger[_0x8563('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);return _0x45ead6(_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);}logger['error'](_0x8563('0xe'),_0x13454a,_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);return _0x3c4b71(_0xa0bedb[_0x8563('0x12')][_0x8563('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0x8563('0x11'));_0x3c4b71(_0xa0bedb['result'][_0x8563('0x13')]);}})[_0x8563('0x14')](function(_0x4d199a){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x13454a,_0x4d199a);_0x45ead6(_0x4d199a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 77a79d7..cc87399 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 _0xf52f=['../../components/auth/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x495537,_0x5bd4b3){var _0x719f9b=function(_0x5b3cc6){while(--_0x5b3cc6){_0x495537['push'](_0x495537['shift']());}};_0x719f9b(++_0x5bd4b3);}(_0xf52f,0x113));var _0xff52=function(_0x246568,_0x57af04){_0x246568=_0x246568-0x0;var _0x19b302=_0xf52f[_0x246568];return _0x19b302;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var auth=require(_0xff52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xff52('0x6'));module[_0xff52('0x7')]=router; \ No newline at end of file +var _0x6931=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57c9cb,_0x4735d8){var _0x5ef282=function(_0x43ab6e){while(--_0x43ab6e){_0x57c9cb['push'](_0x57c9cb['shift']());}};_0x5ef282(++_0x4735d8);}(_0x6931,0x1a9));var _0x1693=function(_0x2d20a8,_0x2d500e){_0x2d20a8=_0x2d20a8-0x0;var _0x46d9db=_0x6931[_0x2d20a8];return _0x46d9db;};'use strict';var multer=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var timeout=require(_0x1693('0x3'));var express=require(_0x1693('0x4'));var router=express[_0x1693('0x5')]();var auth=require(_0x1693('0x6'));var interaction=require(_0x1693('0x7'));var config=require('../../config/environment');module[_0x1693('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 825ff27..b488fd5 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 _0xcf7e=['INTEGER','sequelize','exports'];(function(_0x240525,_0x4c1624){var _0x162759=function(_0x5cc0e0){while(--_0x5cc0e0){_0x240525['push'](_0x240525['shift']());}};_0x162759(++_0x4c1624);}(_0xcf7e,0x64));var _0xecf7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xcf7e[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xecf7('0x0'));module[_0xecf7('0x1')]={'penalty':{'type':Sequelize[_0xecf7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb042=['exports','INTEGER','sequelize'];(function(_0x1a0620,_0x4f40c3){var _0x475abc=function(_0x276d92){while(--_0x276d92){_0x1a0620['push'](_0x1a0620['shift']());}};_0x475abc(++_0x4f40c3);}(_0xb042,0x1be));var _0x2b04=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xb042[_0x39e283];return _0x7de89f;};'use strict';var Sequelize=require(_0x2b04('0x0'));module[_0x2b04('0x1')]={'penalty':{'type':Sequelize[_0x2b04('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 288ad91..e14b648 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 _0xa282=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','api','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x37b196,_0x2f3ad3){var _0x2dc4ec=function(_0x6dabad){while(--_0x6dabad){_0x37b196['push'](_0x37b196['shift']());}};_0x2dc4ec(++_0x2f3ad3);}(_0xa282,0x1f3));var _0x2a28=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xa282[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x2a28('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a28('0x1'));var moment=require('moment');var BPromise=require(_0x2a28('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a28('0x3'));var rimraf=require(_0x2a28('0x4'));var config=require(_0x2a28('0x5'));var attributes=require(_0x2a28('0x6'));module[_0x2a28('0x7')]=function(_0x133fe9,_0x19b6e9){return _0x133fe9[_0x2a28('0x8')](_0x2a28('0x9'),attributes,{'tableName':_0x2a28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6efe=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x59ed01,_0x18bd6b){var _0x1441ef=function(_0x1a79b2){while(--_0x1a79b2){_0x59ed01['push'](_0x59ed01['shift']());}};_0x1441ef(++_0x18bd6b);}(_0x6efe,0xc6));var _0xe6ef=function(_0xf8db3d,_0x36c144){_0xf8db3d=_0xf8db3d-0x0;var _0x4ea659=_0x6efe[_0xf8db3d];return _0x4ea659;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ef('0x5'));var rimraf=require(_0xe6ef('0x6'));var config=require(_0xe6ef('0x7'));var attributes=require(_0xe6ef('0x8'));module[_0xe6ef('0x9')]=function(_0x573395,_0x17fc74){return _0x573395[_0xe6ef('0xa')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index c672cca..f7f05c4 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 _0x12a1=['code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','stringify','error'];(function(_0x11acf3,_0x2b6ffb){var _0x27ab14=function(_0x5cd819){while(--_0x5cd819){_0x11acf3['push'](_0x11acf3['shift']());}};_0x27ab14(++_0x2b6ffb);}(_0x12a1,0x190));var _0x112a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x12a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x112a('0x0'));var util=require(_0x112a('0x1'));var moment=require(_0x112a('0x2'));var BPromise=require(_0x112a('0x3'));var rs=require(_0x112a('0x4'));var fs=require('fs');var Redis=require(_0x112a('0x5'));var db=require(_0x112a('0x6'))['db'];var utils=require(_0x112a('0x7'));var logger=require('../../config/logger')(_0x112a('0x8'));var config=require(_0x112a('0x9'));var jayson=require(_0x112a('0xa'));var client=jayson['client'][_0x112a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7e6787,_0x9b4a24,_0x5211e4){return new BPromise(function(_0x576817,_0x25050d){return client[_0x112a('0xc')](_0x7e6787,_0x5211e4)[_0x112a('0xd')](function(_0x1d06d3){logger[_0x112a('0xe')](_0x112a('0xf'),_0x9b4a24,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x9b4a24,'request\x20sent',JSON[_0x112a('0x10')](_0x1d06d3));if(_0x1d06d3[_0x112a('0x11')]){if(_0x1d06d3[_0x112a('0x11')][_0x112a('0x12')]===0x1f4){logger[_0x112a('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x9b4a24,_0x1d06d3[_0x112a('0x11')][_0x112a('0x13')]);return _0x25050d(_0x1d06d3[_0x112a('0x11')][_0x112a('0x13')]);}logger[_0x112a('0x11')](_0x112a('0xf'),_0x9b4a24,_0x1d06d3['error'][_0x112a('0x13')]);return _0x576817(_0x1d06d3[_0x112a('0x11')]['message']);}else{logger[_0x112a('0xe')](_0x112a('0xf'),_0x9b4a24,_0x112a('0x14'));_0x576817(_0x1d06d3['result']['message']);}})[_0x112a('0x15')](function(_0x3f976f){logger[_0x112a('0x11')](_0x112a('0xf'),_0x9b4a24,_0x3f976f);_0x25050d(_0x3f976f);});});} \ No newline at end of file +var _0x9605=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','catch'];(function(_0x4b9f35,_0x287585){var _0x200ea1=function(_0x9bf668){while(--_0x9bf668){_0x4b9f35['push'](_0x4b9f35['shift']());}};_0x200ea1(++_0x287585);}(_0x9605,0x1f4));var _0x5960=function(_0x23f07a,_0x2f6593){_0x23f07a=_0x23f07a-0x0;var _0x5c5870=_0x9605[_0x23f07a];return _0x5c5870;};'use strict';var _=require('lodash');var util=require(_0x5960('0x0'));var moment=require('moment');var BPromise=require(_0x5960('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5960('0x2'))['db'];var utils=require(_0x5960('0x3'));var logger=require(_0x5960('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5960('0x5'));var client=jayson[_0x5960('0x6')][_0x5960('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x266ea9,_0x244332,_0x1a4f60){return new BPromise(function(_0x54d0f4,_0x213ef6){return client[_0x5960('0x8')](_0x266ea9,_0x1a4f60)[_0x5960('0x9')](function(_0x28ea23){logger[_0x5960('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x244332,_0x5960('0xb'));logger[_0x5960('0xc')](_0x5960('0xd'),_0x244332,_0x5960('0xb'),JSON[_0x5960('0xe')](_0x28ea23));if(_0x28ea23['error']){if(_0x28ea23[_0x5960('0xf')][_0x5960('0x10')]===0x1f4){logger[_0x5960('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x244332,_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);return _0x213ef6(_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);}logger[_0x5960('0xf')](_0x5960('0x12'),_0x244332,_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);return _0x54d0f4(_0x28ea23[_0x5960('0xf')][_0x5960('0x11')]);}else{logger[_0x5960('0xa')](_0x5960('0x12'),_0x244332,_0x5960('0xb'));_0x54d0f4(_0x28ea23['result'][_0x5960('0x11')]);}})[_0x5960('0x13')](function(_0x19c39a){logger['error'](_0x5960('0x12'),_0x244332,_0x19c39a);_0x213ef6(_0x19c39a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 82b7d36..fb400e0 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 _0x277c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x2b91ea,_0x3904c4){var _0x30a5ec=function(_0x1b6351){while(--_0x1b6351){_0x2b91ea['push'](_0x2b91ea['shift']());}};_0x30a5ec(++_0x3904c4);}(_0x277c,0x153));var _0xc277=function(_0x2ec2ba,_0x26d588){_0x2ec2ba=_0x2ec2ba-0x0;var _0x1d7eeb=_0x277c[_0x2ec2ba];return _0x1d7eeb;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));module[_0xc277('0x8')]=router; \ No newline at end of file +var _0x2bd8=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x185631,_0x5f306a){var _0x57c8f8=function(_0x45b24c){while(--_0x45b24c){_0x185631['push'](_0x185631['shift']());}};_0x57c8f8(++_0x5f306a);}(_0x2bd8,0x130));var _0x82bd=function(_0xe2f52,_0x45fd6c){_0xe2f52=_0xe2f52-0x0;var _0x544b7c=_0x2bd8[_0xe2f52];return _0x544b7c;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var auth=require(_0x82bd('0x5'));var interaction=require(_0x82bd('0x6'));var config=require(_0x82bd('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index b4ad6f5..577b43d 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 _0xd2d5=['INTEGER','sequelize','exports'];(function(_0x49efb2,_0x4b9081){var _0x2cd91b=function(_0x34a682){while(--_0x34a682){_0x49efb2['push'](_0x49efb2['shift']());}};_0x2cd91b(++_0x4b9081);}(_0xd2d5,0x18a));var _0x5d2d=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xd2d5[_0x9b2bb0];return _0x2cdb3b;};'use strict';var Sequelize=require(_0x5d2d('0x0'));module[_0x5d2d('0x1')]={'penalty':{'type':Sequelize[_0x5d2d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xee6f=['INTEGER','sequelize','exports'];(function(_0x40eba9,_0x1937ff){var _0x142491=function(_0x3a8db3){while(--_0x3a8db3){_0x40eba9['push'](_0x40eba9['shift']());}};_0x142491(++_0x1937ff);}(_0xee6f,0x19f));var _0xfee6=function(_0x3ab164,_0x2fa5e9){_0x3ab164=_0x3ab164-0x0;var _0x39565e=_0xee6f[_0x3ab164];return _0x39565e;};'use strict';var Sequelize=require(_0xfee6('0x0'));module[_0xfee6('0x1')]={'penalty':{'type':Sequelize[_0xfee6('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 9ae8302..14b3508 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 _0x909e=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird'];(function(_0x4e074e,_0x35a42e){var _0x1fb96a=function(_0x432263){while(--_0x432263){_0x4e074e['push'](_0x4e074e['shift']());}};_0x1fb96a(++_0x35a42e);}(_0x909e,0x1a0));var _0xe909=function(_0x450518,_0x4f223b){_0x450518=_0x450518-0x0;var _0x180686=_0x909e[_0x450518];return _0x180686;};'use strict';var _=require(_0xe909('0x0'));var util=require(_0xe909('0x1'));var logger=require('../../config/logger')(_0xe909('0x2'));var moment=require('moment');var BPromise=require(_0xe909('0x3'));var rp=require(_0xe909('0x4'));var fs=require('fs');var path=require(_0xe909('0x5'));var rimraf=require(_0xe909('0x6'));var config=require(_0xe909('0x7'));var attributes=require(_0xe909('0x8'));module[_0xe909('0x9')]=function(_0x5064f0,_0x2a32e6){return _0x5064f0['define'](_0xe909('0xa'),attributes,{'tableName':_0xe909('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x127b=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x30e0f5,_0x5e4826){var _0x3b5800=function(_0x3d9155){while(--_0x3d9155){_0x30e0f5['push'](_0x30e0f5['shift']());}};_0x3b5800(++_0x5e4826);}(_0x127b,0xa0));var _0xb127=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x127b[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var util=require(_0xb127('0x0'));var logger=require(_0xb127('0x1'))(_0xb127('0x2'));var moment=require('moment');var BPromise=require(_0xb127('0x3'));var rp=require(_0xb127('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb127('0x5'));var config=require(_0xb127('0x6'));var attributes=require(_0xb127('0x7'));module['exports']=function(_0x211ab9,_0x3e1878){return _0x211ab9[_0xb127('0x8')](_0xb127('0x9'),attributes,{'tableName':_0xb127('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 416939a..19e17ec 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 _0x4a71=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x4a71,0xf7));var _0x14a7=function(_0x57b691,_0x47652b){_0x57b691=_0x57b691-0x0;var _0xb096bc=_0x4a71[_0x57b691];return _0xb096bc;};'use strict';var _=require(_0x14a7('0x0'));var util=require(_0x14a7('0x1'));var moment=require(_0x14a7('0x2'));var BPromise=require(_0x14a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a7('0x4'))['db'];var utils=require(_0x14a7('0x5'));var logger=require(_0x14a7('0x6'))(_0x14a7('0x7'));var config=require(_0x14a7('0x8'));var jayson=require(_0x14a7('0x9'));var client=jayson[_0x14a7('0xa')][_0x14a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24b2ac,_0x2c7094,_0x59e14b){return new BPromise(function(_0x4198cc,_0x4980c8){return client[_0x14a7('0xc')](_0x24b2ac,_0x59e14b)[_0x14a7('0xd')](function(_0x44b140){logger['info'](_0x14a7('0xe'),_0x2c7094,_0x14a7('0xf'));logger[_0x14a7('0x10')](_0x14a7('0x11'),_0x2c7094,_0x14a7('0xf'),JSON['stringify'](_0x44b140));if(_0x44b140[_0x14a7('0x12')]){if(_0x44b140[_0x14a7('0x12')][_0x14a7('0x13')]===0x1f4){logger['error'](_0x14a7('0xe'),_0x2c7094,_0x44b140['error']['message']);return _0x4980c8(_0x44b140[_0x14a7('0x12')]['message']);}logger[_0x14a7('0x12')](_0x14a7('0xe'),_0x2c7094,_0x44b140[_0x14a7('0x12')][_0x14a7('0x14')]);return _0x4198cc(_0x44b140[_0x14a7('0x12')][_0x14a7('0x14')]);}else{logger[_0x14a7('0x15')](_0x14a7('0xe'),_0x2c7094,_0x14a7('0xf'));_0x4198cc(_0x44b140[_0x14a7('0x16')][_0x14a7('0x14')]);}})[_0x14a7('0x17')](function(_0x1e1598){logger[_0x14a7('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2c7094,_0x1e1598);_0x4980c8(_0x1e1598);});});} \ No newline at end of file +var _0x2a70=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x34f276,_0x1c41fc){var _0x24e21a=function(_0xa8c8bc){while(--_0xa8c8bc){_0x34f276['push'](_0x34f276['shift']());}};_0x24e21a(++_0x1c41fc);}(_0x2a70,0x134));var _0x02a7=function(_0x463e29,_0xfc1e0c){_0x463e29=_0x463e29-0x0;var _0x4a09ad=_0x2a70[_0x463e29];return _0x4a09ad;};'use strict';var _=require(_0x02a7('0x0'));var util=require(_0x02a7('0x1'));var moment=require(_0x02a7('0x2'));var BPromise=require(_0x02a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02a7('0x4'));var db=require(_0x02a7('0x5'))['db'];var utils=require(_0x02a7('0x6'));var logger=require('../../config/logger')(_0x02a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x02a7('0x8')][_0x02a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1eb3b0,_0x41bd44,_0xdac391){return new BPromise(function(_0x3d7760,_0x165122){return client[_0x02a7('0xa')](_0x1eb3b0,_0xdac391)[_0x02a7('0xb')](function(_0x32c74d){logger[_0x02a7('0xc')](_0x02a7('0xd'),_0x41bd44,'request\x20sent');logger[_0x02a7('0xe')](_0x02a7('0xf'),_0x41bd44,'request\x20sent',JSON[_0x02a7('0x10')](_0x32c74d));if(_0x32c74d['error']){if(_0x32c74d[_0x02a7('0x11')][_0x02a7('0x12')]===0x1f4){logger[_0x02a7('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x41bd44,_0x32c74d['error'][_0x02a7('0x13')]);return _0x165122(_0x32c74d[_0x02a7('0x11')][_0x02a7('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x41bd44,_0x32c74d[_0x02a7('0x11')][_0x02a7('0x13')]);return _0x3d7760(_0x32c74d[_0x02a7('0x11')]['message']);}else{logger[_0x02a7('0xc')](_0x02a7('0xd'),_0x41bd44,_0x02a7('0x14'));_0x3d7760(_0x32c74d[_0x02a7('0x15')][_0x02a7('0x13')]);}})['catch'](function(_0x24ff1d){logger['error'](_0x02a7('0xd'),_0x41bd44,_0x24ff1d);_0x165122(_0x24ff1d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 503c2ff..478a8d8 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 _0x8085=['connect-timeout','express','Router','../../components/auth/service','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8085,0x71));var _0x5808=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x8085[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var auth=require(_0x5808('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x5808('0x5')]=router; \ No newline at end of file +var _0xc6ac=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x50b0c1,_0x1a847d){_0x50b0c1=_0x50b0c1-0x0;var _0x2cde07=_0xc6ac[_0x50b0c1];return _0x2cde07;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var auth=require(_0xcc6a('0x6'));var interaction=require(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));module[_0xcc6a('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5d8d915..4a01161 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 _0xd79e=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x1a23d,_0xabcefd){var _0x1e2fb4=function(_0xacd27){while(--_0xacd27){_0x1a23d['push'](_0x1a23d['shift']());}};_0x1e2fb4(++_0xabcefd);}(_0xd79e,0x70));var _0xed79=function(_0x5bceca,_0x4eb998){_0x5bceca=_0x5bceca-0x0;var _0x2d3889=_0xd79e[_0x5bceca];return _0x2d3889;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xed79('0x0')},'membername':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'comment':_0xed79('0x0')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'unique':'queue_interface','comment':_0xed79('0x0')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'unique':_0xed79('0x2'),'comment':_0xed79('0x0')},'penalty':{'type':Sequelize[_0xed79('0x3')](0xb),'defaultValue':0x0,'comment':_0xed79('0x0')},'paused':{'type':Sequelize[_0xed79('0x3')](0xb),'defaultValue':0x0,'comment':_0xed79('0x0')}}; \ No newline at end of file +var _0xec40=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0xec40,0xb9));var _0x0ec4=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0xec40[_0x329437];return _0x3789d9;};'use strict';var Sequelize=require(_0x0ec4('0x0'));module[_0x0ec4('0x1')]={'uniqueid':{'type':Sequelize[_0x0ec4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0ec4('0x3')},'membername':{'type':Sequelize[_0x0ec4('0x4')],'allowNull':![],'comment':_0x0ec4('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0ec4('0x4')],'allowNull':![],'unique':_0x0ec4('0x5'),'comment':_0x0ec4('0x3')},'VoiceQueueId':{'type':Sequelize[_0x0ec4('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0ec4('0x5'),'comment':_0x0ec4('0x3')},'penalty':{'type':Sequelize[_0x0ec4('0x2')](0xb),'defaultValue':0x0,'comment':_0x0ec4('0x3')},'paused':{'type':Sequelize[_0x0ec4('0x2')](0xb),'defaultValue':0x0,'comment':_0x0ec4('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0227ceb..2daecb2 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 _0x3445=['update','remove','emit','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x4829be,_0x1c3f24){var _0x1333e7=function(_0x2348be){while(--_0x2348be){_0x4829be['push'](_0x4829be['shift']());}};_0x1333e7(++_0x1c3f24);}(_0x3445,0x95));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x5344('0x0'))['db'][_0x5344('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5344('0x2')](0x0);var events={'afterCreate':_0x5344('0x3'),'afterUpdate':_0x5344('0x4'),'afterDestroy':_0x5344('0x5')};function emitEvent(_0x2d520c){return function(_0x563962,_0x20a77f,_0x27c2d4){UserVoiceQueueRtEvents[_0x5344('0x6')](_0x2d520c+':'+_0x563962['id'],_0x563962);UserVoiceQueueRtEvents[_0x5344('0x6')](_0x2d520c,_0x563962);_0x27c2d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5344('0x7')](e,emitEvent(event));}}module[_0x5344('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf369=['hook','exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xf369,0x17c));var _0x9f36=function(_0x2168bf,_0x3e93f4){_0x2168bf=_0x2168bf-0x0;var _0x3008bc=_0xf369[_0x2168bf];return _0x3008bc;};'use strict';var EventEmitter=require(_0x9f36('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x9f36('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9f36('0x2')](0x0);var events={'afterCreate':_0x9f36('0x3'),'afterUpdate':_0x9f36('0x4'),'afterDestroy':_0x9f36('0x5')};function emitEvent(_0x3b497a){return function(_0x17158e,_0x357665,_0x471c3c){UserVoiceQueueRtEvents[_0x9f36('0x6')](_0x3b497a+':'+_0x17158e['id'],_0x17158e);UserVoiceQueueRtEvents['emit'](_0x3b497a,_0x17158e);_0x471c3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x9f36('0x7')](e,emitEvent(event));}}module[_0x9f36('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8d913c0..8a6b426 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 _0x26ad=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x321c7b,_0x589c78){var _0x31e12b=function(_0x2d4ded){while(--_0x2d4ded){_0x321c7b['push'](_0x321c7b['shift']());}};_0x31e12b(++_0x589c78);}(_0x26ad,0x17c));var _0xd26a=function(_0xc83285,_0x3860f3){_0xc83285=_0xc83285-0x0;var _0x59ef36=_0x26ad[_0xc83285];return _0x59ef36;};'use strict';var _=require(_0xd26a('0x0'));var util=require(_0xd26a('0x1'));var logger=require(_0xd26a('0x2'))(_0xd26a('0x3'));var moment=require(_0xd26a('0x4'));var BPromise=require(_0xd26a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd26a('0x6'));var rimraf=require(_0xd26a('0x7'));var config=require(_0xd26a('0x8'));var attributes=require(_0xd26a('0x9'));module[_0xd26a('0xa')]=function(_0x3126df,_0x4cf662){return _0x3126df[_0xd26a('0xb')](_0xd26a('0xc'),attributes,{'tableName':_0xd26a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0110=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x3f4f4c,_0x152171){var _0x3d48b3=function(_0x18a8a4){while(--_0x18a8a4){_0x3f4f4c['push'](_0x3f4f4c['shift']());}};_0x3d48b3(++_0x152171);}(_0x0110,0x128));var _0x0011=function(_0x5a55e5,_0x5e7139){_0x5a55e5=_0x5a55e5-0x0;var _0x5b3ad8=_0x0110[_0x5a55e5];return _0x5b3ad8;};'use strict';var _=require(_0x0011('0x0'));var util=require(_0x0011('0x1'));var logger=require(_0x0011('0x2'))(_0x0011('0x3'));var moment=require(_0x0011('0x4'));var BPromise=require(_0x0011('0x5'));var rp=require(_0x0011('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0011('0x7'));var config=require(_0x0011('0x8'));var attributes=require(_0x0011('0x9'));module[_0x0011('0xa')]=function(_0x300571,_0x180dfc){return _0x300571[_0x0011('0xb')](_0x0011('0xc'),attributes,{'tableName':_0x0011('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 32db451..b73de82 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 _0x58e6=['redis','defaults','localhost','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x44d9b8,_0x261968){var _0x2e2c3e=function(_0x45ce77){while(--_0x45ce77){_0x44d9b8['push'](_0x44d9b8['shift']());}};_0x2e2c3e(++_0x261968);}(_0x58e6,0xe4));var _0x658e=function(_0x2bdaf8,_0x36cb7d){_0x2bdaf8=_0x2bdaf8-0x0;var _0x3a31a3=_0x58e6[_0x2bdaf8];return _0x3a31a3;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x658e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x658e('0x3'))['db'];var utils=require(_0x658e('0x4'));var logger=require(_0x658e('0x5'))(_0x658e('0x6'));var config=require(_0x658e('0x7'));var jayson=require(_0x658e('0x8'));var client=jayson['client'][_0x658e('0x9')]({'port':0x232a});config[_0x658e('0xa')]=_[_0x658e('0xb')](config[_0x658e('0xa')],{'host':_0x658e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x658e('0xd')](socket);function respondWithRpcPromise(_0x23754f,_0x4a38df,_0x15799a){return new BPromise(function(_0x127d78,_0x45db85){return client['request'](_0x23754f,_0x15799a)[_0x658e('0xe')](function(_0x42061a){logger[_0x658e('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4a38df,_0x658e('0x10'));logger[_0x658e('0x11')](_0x658e('0x12'),_0x4a38df,'request\x20sent',JSON[_0x658e('0x13')](_0x42061a));if(_0x42061a[_0x658e('0x14')]){if(_0x42061a['error']['code']===0x1f4){logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x42061a[_0x658e('0x14')]['message']);return _0x45db85(_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);}logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);return _0x127d78(_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);}else{logger[_0x658e('0xf')](_0x658e('0x15'),_0x4a38df,_0x658e('0x10'));_0x127d78(_0x42061a[_0x658e('0x17')][_0x658e('0x16')]);}})[_0x658e('0x18')](function(_0x4e0405){logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x4e0405);_0x45db85(_0x4e0405);});});}exports['GetVoiceQueueRtPauses']=function(_0x2bbf51){var _0x3101fe=this;return new Promise(function(_0x49b273,_0x492b96){return db['UserVoiceQueueRt'][_0x658e('0x19')]({'raw':_0x2bbf51[_0x658e('0x1a')]?_0x2bbf51[_0x658e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2bbf51[_0x658e('0x1a')]?_0x2bbf51[_0x658e('0x1a')][_0x658e('0x1b')]||null:null,'attributes':[[db[_0x658e('0x1c')]['fn'](_0x658e('0x1d'),db[_0x658e('0x1c')]['fn']('IF',db[_0x658e('0x1c')][_0x658e('0x1e')](_0x658e('0x1f')))),_0x658e('0x20')]]})[_0x658e('0xe')](function(_0x360853){logger[_0x658e('0xf')]('GetVoiceQueueRtPauses',_0x2bbf51);logger['debug'](_0x658e('0x21'),_0x2bbf51,JSON[_0x658e('0x13')](_0x360853));_0x49b273(_0x360853);})['catch'](function(_0x149ee5){logger['error'](_0x658e('0x21'),_0x149ee5[_0x658e('0x16')],_0x2bbf51);_0x492b96(_0x3101fe[_0x658e('0x14')](0x1f4,_0x149ee5['message']));});});}; \ No newline at end of file +var _0x6e03=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6e03,0x18c));var _0x36e0=function(_0x3dcd8f,_0x2381a1){_0x3dcd8f=_0x3dcd8f-0x0;var _0x585be7=_0x6e03[_0x3dcd8f];return _0x585be7;};'use strict';var _=require('lodash');var util=require(_0x36e0('0x0'));var moment=require(_0x36e0('0x1'));var BPromise=require(_0x36e0('0x2'));var rs=require(_0x36e0('0x3'));var fs=require('fs');var Redis=require(_0x36e0('0x4'));var db=require(_0x36e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36e0('0x6'));var config=require(_0x36e0('0x7'));var jayson=require(_0x36e0('0x8'));var client=jayson['client'][_0x36e0('0x9')]({'port':0x232a});config[_0x36e0('0xa')]=_[_0x36e0('0xb')](config['redis'],{'host':_0x36e0('0xc'),'port':0x18eb});var socket=require(_0x36e0('0xd'))(new Redis(config[_0x36e0('0xa')]));require(_0x36e0('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b071e,_0x3bdecc,_0x338bb5){return new BPromise(function(_0x41cc94,_0x2ef880){return client[_0x36e0('0xf')](_0x1b071e,_0x338bb5)[_0x36e0('0x10')](function(_0x19c83b){logger['info'](_0x36e0('0x11'),_0x3bdecc,'request\x20sent');logger[_0x36e0('0x12')](_0x36e0('0x13'),_0x3bdecc,'request\x20sent',JSON[_0x36e0('0x14')](_0x19c83b));if(_0x19c83b['error']){if(_0x19c83b['error'][_0x36e0('0x15')]===0x1f4){logger[_0x36e0('0x16')](_0x36e0('0x11'),_0x3bdecc,_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);return _0x2ef880(_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);}logger[_0x36e0('0x16')](_0x36e0('0x11'),_0x3bdecc,_0x19c83b['error']['message']);return _0x41cc94(_0x19c83b[_0x36e0('0x16')][_0x36e0('0x17')]);}else{logger[_0x36e0('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdecc,_0x36e0('0x19'));_0x41cc94(_0x19c83b[_0x36e0('0x1a')][_0x36e0('0x17')]);}})[_0x36e0('0x1b')](function(_0x131b16){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3bdecc,_0x131b16);_0x2ef880(_0x131b16);});});}exports[_0x36e0('0x1c')]=function(_0x3b0b90){var _0x5d2b01=this;return new Promise(function(_0x1f6e08,_0x466b12){return db['UserVoiceQueueRt'][_0x36e0('0x1d')]({'raw':_0x3b0b90[_0x36e0('0x1e')]?_0x3b0b90[_0x36e0('0x1e')][_0x36e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x3b0b90[_0x36e0('0x1e')]?_0x3b0b90[_0x36e0('0x1e')][_0x36e0('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x36e0('0x21')]['fn']('IF',db[_0x36e0('0x21')]['literal'](_0x36e0('0x22')))),_0x36e0('0x23')]]})['then'](function(_0x4602f2){logger[_0x36e0('0x18')](_0x36e0('0x1c'),_0x3b0b90);logger['debug'](_0x36e0('0x1c'),_0x3b0b90,JSON[_0x36e0('0x14')](_0x4602f2));_0x1f6e08(_0x4602f2);})[_0x36e0('0x1b')](function(_0x23c8c7){logger[_0x36e0('0x16')](_0x36e0('0x1c'),_0x23c8c7[_0x36e0('0x17')],_0x3b0b90);_0x466b12(_0x5d2b01[_0x36e0('0x16')](0x1f4,_0x23c8c7[_0x36e0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2ae7433..e63888c 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 _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x4f8e3a,_0x4b3bce){var _0x3e78bb=function(_0x1423a3){while(--_0x1423a3){_0x4f8e3a['push'](_0x4f8e3a['shift']());}};_0x3e78bb(++_0x4b3bce);}(_0x84e7,0x122));var _0x784e=function(_0x59521a,_0x5d9ace){_0x59521a=_0x59521a-0x0;var _0x11fd4d=_0x84e7[_0x59521a];return _0x11fd4d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){UserVoiceQueueRtEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('userVoiceQueueRt:'+_0xfaa170,_0x133296);UserVoiceQueueRtEvents['on'](_0xfaa170,_0x24654d);}}; \ No newline at end of file +var _0x7c09=['save','remove','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x65f773,_0x16dab4){var _0xbe68a6=function(_0x202ab5){while(--_0x202ab5){_0x65f773['push'](_0x65f773['shift']());}};_0xbe68a6(++_0x16dab4);}(_0x7c09,0x102));var _0x97c0=function(_0x1abe3f,_0x49a6df){_0x1abe3f=_0x1abe3f-0x0;var _0x1520b0=_0x7c09[_0x1abe3f];return _0x1520b0;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){UserVoiceQueueRtEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);UserVoiceQueueRtEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index b235dba..a7fb37d 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 _0x4483=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x237ca6,_0x438308){var _0x3465c3=function(_0x3eab93){while(--_0x3eab93){_0x237ca6['push'](_0x237ca6['shift']());}};_0x3465c3(++_0x438308);}(_0x4483,0x1a3));var _0x3448=function(_0x38e7da,_0x50474a){_0x38e7da=_0x38e7da-0x0;var _0xf24a25=_0x4483[_0x38e7da];return _0xf24a25;};'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 auth=require(_0x3448('0x5'));var interaction=require(_0x3448('0x6'));var config=require(_0x3448('0x7'));var controller=require('./variable.controller');router[_0x3448('0x8')]('/',auth[_0x3448('0x9')](),controller[_0x3448('0xa')]);router[_0x3448('0x8')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0xc')]);router[_0x3448('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3448('0xe')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0xf')]);router[_0x3448('0x10')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0x11')]);module[_0x3448('0x12')]=router; \ No newline at end of file +var _0x9c00=['/:id','show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0xf2d165,_0x40bd94){var _0x1465dc=function(_0x141382){while(--_0x141382){_0xf2d165['push'](_0xf2d165['shift']());}};_0x1465dc(++_0x40bd94);}(_0x9c00,0x1a0));var _0x09c0=function(_0x24c086,_0x58503a){_0x24c086=_0x24c086-0x0;var _0x437816=_0x9c00[_0x24c086];return _0x437816;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0xb')]('/',auth[_0x09c0('0x8')](),controller['create']);router[_0x09c0('0xc')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xd')]);router[_0x09c0('0xe')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);module[_0x09c0('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 598ef91..35860b0 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 _0x97a0=['exports','STRING','sequelize'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x97a0,0xc5));var _0x097a=function(_0x27c2dd,_0x45aec3){_0x27c2dd=_0x27c2dd-0x0;var _0x9456e1=_0x97a0[_0x27c2dd];return _0x9456e1;};'use strict';var Sequelize=require(_0x097a('0x0'));module[_0x097a('0x1')]={'name':{'type':Sequelize[_0x097a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x097a('0x2')]}}; \ No newline at end of file +var _0xaa1e=['sequelize','exports','STRING','name'];(function(_0x580381,_0x587ccb){var _0x31c9aa=function(_0x370a03){while(--_0x370a03){_0x580381['push'](_0x580381['shift']());}};_0x31c9aa(++_0x587ccb);}(_0xaa1e,0x7c));var _0xeaa1=function(_0x2e48bf,_0x4bde87){_0x2e48bf=_0x2e48bf-0x0;var _0x2b6b2d=_0xaa1e[_0x2e48bf];return _0x2b6b2d;};'use strict';var Sequelize=require(_0xeaa1('0x0'));module[_0xeaa1('0x1')]={'name':{'type':Sequelize[_0xeaa1('0x2')],'unique':_0xeaa1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeaa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 2a20f22..c23e392 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 _0xe205=['filters','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','then','get','Variables','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','Variable','include','findAll','catch','show','params'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0xe205,0xa7));var _0x5e20=function(_0x39eda7,_0x5c84cb){_0x39eda7=_0x39eda7-0x0;var _0x81efe9=_0xe205[_0x39eda7];return _0x81efe9;};'use strict';var pdf=require(_0x5e20('0x0'));var emlformat=require(_0x5e20('0x1'));var rimraf=require(_0x5e20('0x2'));var zipdir=require(_0x5e20('0x3'));var jsonpatch=require(_0x5e20('0x4'));var rp=require(_0x5e20('0x5'));var moment=require(_0x5e20('0x6'));var BPromise=require(_0x5e20('0x7'));var Mustache=require(_0x5e20('0x8'));var util=require('util');var path=require(_0x5e20('0x9'));var sox=require(_0x5e20('0xa'));var csv=require(_0x5e20('0xb'));var ejs=require(_0x5e20('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xb'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var hardwareService=require(_0x5e20('0x12'));var logger=require('../../config/logger')(_0x5e20('0x13'));var utils=require(_0x5e20('0x14'));var config=require(_0x5e20('0x15'));var db=require(_0x5e20('0x16'))['db'];function respondWithStatusCode(_0x165824,_0x296dfd){_0x296dfd=_0x296dfd||0xcc;return function(_0x54deee){if(_0x54deee){return _0x165824[_0x5e20('0x17')](_0x296dfd);}return _0x165824[_0x5e20('0x18')](_0x296dfd)[_0x5e20('0x19')]();};}function respondWithResult(_0x5868c0,_0x1dc92e){_0x1dc92e=_0x1dc92e||0xc8;return function(_0x5d827e){if(_0x5d827e){return _0x5868c0[_0x5e20('0x18')](_0x1dc92e)['json'](_0x5d827e);}};}function respondWithFilteredResult(_0x15587b,_0x330cdf){return function(_0x275026){if(_0x275026){var _0x148ada=_0x275026[_0x5e20('0x1a')],_0x294df8=_0x330cdf[_0x5e20('0x1b')],_0x542b3c=_0x330cdf[_0x5e20('0x1b')]+_0x330cdf[_0x5e20('0x1c')],_0xeaeb77;if(_0x542b3c>=_0x148ada){_0x542b3c=_0x148ada;_0xeaeb77=0xc8;}else{_0xeaeb77=0xce;}_0x15587b[_0x5e20('0x18')](_0xeaeb77);return _0x15587b[_0x5e20('0x1d')](_0x5e20('0x1e'),_0x294df8+'-'+_0x542b3c+'/'+_0x148ada)['json'](_0x275026);}return null;};}function patchUpdates(_0x434686){return function(_0xd38d1f){try{jsonpatch['apply'](_0xd38d1f,_0x434686,!![]);}catch(_0x295eb3){return BPromise[_0x5e20('0x1f')](_0x295eb3);}return _0xd38d1f[_0x5e20('0x20')]();};}function saveUpdates(_0x2d373d,_0x4a45bd){return function(_0x2954fc){if(_0x2954fc){return _0x2954fc['update'](_0x2d373d)['then'](function(_0x57c7c5){return _0x57c7c5;});}return null;};}function removeEntity(_0x5d0d1a,_0xe562ba){return function(_0x5cca90){if(_0x5cca90){return _0x5cca90[_0x5e20('0x21')]()[_0x5e20('0x22')](function(){var _0x30d849=_0x5cca90[_0x5e20('0x23')]({'plain':!![]});var _0x3ef7fa=_0x5e20('0x24');return db['UserProfileResource'][_0x5e20('0x21')]({'where':{'type':_0x3ef7fa,'resourceId':_0x30d849['id']}})['then'](function(){return _0x5cca90;});})['then'](function(){_0x5d0d1a[_0x5e20('0x18')](0xcc)[_0x5e20('0x19')]();});}};}function handleEntityNotFound(_0x2bae08,_0x1b01af){return function(_0xbf7a24){if(!_0xbf7a24){_0x2bae08[_0x5e20('0x17')](0x194);}return _0xbf7a24;};}function handleError(_0x2973b3,_0x5809fd){_0x5809fd=_0x5809fd||0x1f4;return function(_0x3bf4f4){logger[_0x5e20('0x25')](_0x3bf4f4[_0x5e20('0x26')]);if(_0x3bf4f4[_0x5e20('0x27')]){delete _0x3bf4f4['name'];}_0x2973b3[_0x5e20('0x18')](_0x5809fd)[_0x5e20('0x28')](_0x3bf4f4);};}exports[_0x5e20('0x29')]=function(_0x222e7a,_0xbed73a){var _0x19709b={},_0x5ec45b={},_0xbc2b0e={'count':0x0,'rows':[]};var _0x34a3d6=db['Variable'][_0x5e20('0x2a')];_0x5ec45b[_0x5e20('0x2b')]=_[_0x5e20('0x2c')](_0x34a3d6);_0x5ec45b[_0x5e20('0x2d')]=_[_0x5e20('0x2c')](_0x222e7a[_0x5e20('0x2d')]);_0x5ec45b['filters']=_[_0x5e20('0x2e')](_0x5ec45b[_0x5e20('0x2b')],_0x5ec45b[_0x5e20('0x2d')]);_0x19709b[_0x5e20('0x2f')]=_[_0x5e20('0x2e')](_0x5ec45b[_0x5e20('0x2b')],qs[_0x5e20('0x30')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x30')]));_0x19709b[_0x5e20('0x2f')]=_0x19709b[_0x5e20('0x2f')]['length']?_0x19709b[_0x5e20('0x2f')]:_0x5ec45b[_0x5e20('0x2b')];if(!_0x222e7a[_0x5e20('0x2d')]['hasOwnProperty'](_0x5e20('0x31'))){_0x19709b[_0x5e20('0x1c')]=qs[_0x5e20('0x1c')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x1c')]);_0x19709b[_0x5e20('0x1b')]=qs[_0x5e20('0x1b')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x1b')]);}_0x19709b[_0x5e20('0x32')]=qs[_0x5e20('0x33')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x33')]);_0x19709b[_0x5e20('0x34')]=qs['filters'](_[_0x5e20('0x35')](_0x222e7a['query'],_0x5ec45b['filters']));if(_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x36')]){_0x19709b['where']=_[_0x5e20('0x37')](_0x19709b[_0x5e20('0x34')],{'$or':_['map'](_0x34a3d6,function(_0x3f3908){if(_0x3f3908[_0x5e20('0x38')][_0x5e20('0x39')]!==_0x5e20('0x3a')){var _0x15ce1d={};_0x15ce1d[_0x3f3908[_0x5e20('0x3b')]]={'$like':'%'+_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x36')]+'%'};return _0x15ce1d;}})});}_0x19709b=_[_0x5e20('0x37')]({},_0x19709b,_0x222e7a[_0x5e20('0x3c')]);var _0x473b69={'where':_0x19709b[_0x5e20('0x34')]};return db[_0x5e20('0x3d')][_0x5e20('0x1a')](_0x473b69)[_0x5e20('0x22')](function(_0x3d618c){_0xbc2b0e[_0x5e20('0x1a')]=_0x3d618c;if(_0x222e7a[_0x5e20('0x2d')]['includeAll']){_0x19709b[_0x5e20('0x3e')]=[{'all':!![]}];}return db[_0x5e20('0x3d')][_0x5e20('0x3f')](_0x19709b);})[_0x5e20('0x22')](function(_0x39018d){_0xbc2b0e['rows']=_0x39018d;return _0xbc2b0e;})[_0x5e20('0x22')](respondWithFilteredResult(_0xbed73a,_0x19709b))[_0x5e20('0x40')](handleError(_0xbed73a,null));};exports[_0x5e20('0x41')]=function(_0x24c05f,_0x4d973a){var _0x30d3ef={'raw':!![],'where':{'id':_0x24c05f[_0x5e20('0x42')]['id']}},_0x5c7ae8={};_0x5c7ae8[_0x5e20('0x2b')]=_[_0x5e20('0x2c')](db['Variable'][_0x5e20('0x2a')]);_0x5c7ae8[_0x5e20('0x2d')]=_[_0x5e20('0x2c')](_0x24c05f[_0x5e20('0x2d')]);_0x5c7ae8[_0x5e20('0x43')]=_[_0x5e20('0x2e')](_0x5c7ae8[_0x5e20('0x2b')],_0x5c7ae8[_0x5e20('0x2d')]);_0x30d3ef['attributes']=_[_0x5e20('0x2e')](_0x5c7ae8[_0x5e20('0x2b')],qs[_0x5e20('0x30')](_0x24c05f['query'][_0x5e20('0x30')]));_0x30d3ef['attributes']=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x44')]?_0x30d3ef[_0x5e20('0x2f')]:_0x5c7ae8[_0x5e20('0x2b')];if(_0x24c05f[_0x5e20('0x2d')]['includeAll']){_0x30d3ef[_0x5e20('0x3e')]=[{'all':!![]}];}_0x30d3ef=_['merge']({},_0x30d3ef,_0x24c05f['options']);return db[_0x5e20('0x3d')][_0x5e20('0x45')](_0x30d3ef)[_0x5e20('0x22')](handleEntityNotFound(_0x4d973a,null))[_0x5e20('0x22')](respondWithResult(_0x4d973a,null))[_0x5e20('0x40')](handleError(_0x4d973a,null));};exports[_0x5e20('0x46')]=function(_0x57c794,_0x59c79f){return db['Variable'][_0x5e20('0x46')](_0x57c794[_0x5e20('0x47')],{})['then'](function(_0x22b84e){var _0x27d41c=_0x57c794[_0x5e20('0x48')][_0x5e20('0x23')]({'plain':!![]});if(!_0x27d41c)throw new Error(_0x5e20('0x49'));if(_0x27d41c['role']===_0x5e20('0x48')){var _0x245b52=_0x22b84e[_0x5e20('0x23')]({'plain':!![]});var _0x2a705f=_0x5e20('0x24');return db[_0x5e20('0x4a')][_0x5e20('0x45')]({'where':{'name':_0x2a705f,'userProfileId':_0x27d41c[_0x5e20('0x4b')]},'raw':!![]})['then'](function(_0x5bbc8e){if(_0x5bbc8e&&_0x5bbc8e['autoAssociation']===0x0){return db[_0x5e20('0x4c')][_0x5e20('0x46')]({'name':_0x245b52['name'],'resourceId':_0x245b52['id'],'type':_0x5bbc8e[_0x5e20('0x27')],'sectionId':_0x5bbc8e['id']},{})['then'](function(){return _0x22b84e;});}else{return _0x22b84e;}})[_0x5e20('0x40')](function(_0x4afb72){logger[_0x5e20('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4afb72);throw _0x4afb72;});}return _0x22b84e;})[_0x5e20('0x22')](respondWithResult(_0x59c79f,0xc9))[_0x5e20('0x40')](handleError(_0x59c79f,null));};exports[_0x5e20('0x4d')]=function(_0x190e07,_0x2a64ba){if(_0x190e07[_0x5e20('0x47')]['id']){delete _0x190e07[_0x5e20('0x47')]['id'];}return db[_0x5e20('0x3d')][_0x5e20('0x45')]({'where':{'id':_0x190e07[_0x5e20('0x42')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x2a64ba,null))[_0x5e20('0x22')](saveUpdates(_0x190e07[_0x5e20('0x47')],null))[_0x5e20('0x22')](respondWithResult(_0x2a64ba,null))[_0x5e20('0x40')](handleError(_0x2a64ba,null));};exports[_0x5e20('0x21')]=function(_0x1619fa,_0x1ace56){return db['Variable']['find']({'where':{'id':_0x1619fa[_0x5e20('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ace56,null))[_0x5e20('0x22')](removeEntity(_0x1ace56,null))[_0x5e20('0x40')](handleError(_0x1ace56,null));}; \ No newline at end of file +var _0xc368=['then','destroy','Variables','UserProfileResource','error','name','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','Variable','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update'];(function(_0x332e03,_0x376dff){var _0x3af09e=function(_0x2b2122){while(--_0x2b2122){_0x332e03['push'](_0x332e03['shift']());}};_0x3af09e(++_0x376dff);}(_0xc368,0x7b));var _0x8c36=function(_0x25f985,_0x25b3ec){_0x25f985=_0x25f985-0x0;var _0x448c3f=_0xc368[_0x25f985];return _0x448c3f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8c36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c36('0x1'));var jsonpatch=require(_0x8c36('0x2'));var rp=require(_0x8c36('0x3'));var moment=require(_0x8c36('0x4'));var BPromise=require(_0x8c36('0x5'));var Mustache=require('mustache');var util=require(_0x8c36('0x6'));var path=require(_0x8c36('0x7'));var sox=require(_0x8c36('0x8'));var csv=require(_0x8c36('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x9'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var hardwareService=require(_0x8c36('0x10'));var logger=require('../../config/logger')(_0x8c36('0x11'));var utils=require(_0x8c36('0x12'));var config=require(_0x8c36('0x13'));var db=require(_0x8c36('0x14'))['db'];function respondWithStatusCode(_0x2a8e73,_0x451c24){_0x451c24=_0x451c24||0xcc;return function(_0xa09884){if(_0xa09884){return _0x2a8e73[_0x8c36('0x15')](_0x451c24);}return _0x2a8e73[_0x8c36('0x16')](_0x451c24)[_0x8c36('0x17')]();};}function respondWithResult(_0x43736d,_0x25a83e){_0x25a83e=_0x25a83e||0xc8;return function(_0x3c824b){if(_0x3c824b){return _0x43736d[_0x8c36('0x16')](_0x25a83e)['json'](_0x3c824b);}};}function respondWithFilteredResult(_0x31d8bf,_0x5e32ad){return function(_0xea7509){if(_0xea7509){var _0x3f83aa=_0xea7509[_0x8c36('0x18')],_0x29e791=_0x5e32ad[_0x8c36('0x19')],_0x1fc68e=_0x5e32ad[_0x8c36('0x19')]+_0x5e32ad[_0x8c36('0x1a')],_0xcfdbf7;if(_0x1fc68e>=_0x3f83aa){_0x1fc68e=_0x3f83aa;_0xcfdbf7=0xc8;}else{_0xcfdbf7=0xce;}_0x31d8bf['status'](_0xcfdbf7);return _0x31d8bf[_0x8c36('0x1b')](_0x8c36('0x1c'),_0x29e791+'-'+_0x1fc68e+'/'+_0x3f83aa)[_0x8c36('0x1d')](_0xea7509);}return null;};}function patchUpdates(_0x2d5e5b){return function(_0x3ef5ba){try{jsonpatch['apply'](_0x3ef5ba,_0x2d5e5b,!![]);}catch(_0x15100f){return BPromise[_0x8c36('0x1e')](_0x15100f);}return _0x3ef5ba[_0x8c36('0x1f')]();};}function saveUpdates(_0x137d5c,_0xc30310){return function(_0x2b07ad){if(_0x2b07ad){return _0x2b07ad[_0x8c36('0x20')](_0x137d5c)[_0x8c36('0x21')](function(_0x153735){return _0x153735;});}return null;};}function removeEntity(_0x474c5d,_0x2ed541){return function(_0x14ee6b){if(_0x14ee6b){return _0x14ee6b[_0x8c36('0x22')]()['then'](function(){var _0x5891ef=_0x14ee6b['get']({'plain':!![]});var _0x55b844=_0x8c36('0x23');return db[_0x8c36('0x24')][_0x8c36('0x22')]({'where':{'type':_0x55b844,'resourceId':_0x5891ef['id']}})[_0x8c36('0x21')](function(){return _0x14ee6b;});})[_0x8c36('0x21')](function(){_0x474c5d[_0x8c36('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d39ca,_0x49f6f9){return function(_0x40b66f){if(!_0x40b66f){_0x1d39ca['sendStatus'](0x194);}return _0x40b66f;};}function handleError(_0x10613e,_0x1afee4){_0x1afee4=_0x1afee4||0x1f4;return function(_0x271ec4){logger[_0x8c36('0x25')](_0x271ec4['stack']);if(_0x271ec4['name']){delete _0x271ec4[_0x8c36('0x26')];}_0x10613e[_0x8c36('0x16')](_0x1afee4)['send'](_0x271ec4);};}exports['index']=function(_0x418663,_0x2b5a8c){var _0x502fa3={},_0x1280a1={},_0xb29f20={'count':0x0,'rows':[]};var _0x3ca98e=db['Variable']['rawAttributes'];_0x1280a1[_0x8c36('0x27')]=_[_0x8c36('0x28')](_0x3ca98e);_0x1280a1[_0x8c36('0x29')]=_[_0x8c36('0x28')](_0x418663[_0x8c36('0x29')]);_0x1280a1[_0x8c36('0x2a')]=_[_0x8c36('0x2b')](_0x1280a1[_0x8c36('0x27')],_0x1280a1[_0x8c36('0x29')]);_0x502fa3[_0x8c36('0x2c')]=_[_0x8c36('0x2b')](_0x1280a1[_0x8c36('0x27')],qs[_0x8c36('0x2d')](_0x418663[_0x8c36('0x29')][_0x8c36('0x2d')]));_0x502fa3[_0x8c36('0x2c')]=_0x502fa3[_0x8c36('0x2c')]['length']?_0x502fa3['attributes']:_0x1280a1['model'];if(!_0x418663[_0x8c36('0x29')][_0x8c36('0x2e')](_0x8c36('0x2f'))){_0x502fa3[_0x8c36('0x1a')]=qs[_0x8c36('0x1a')](_0x418663[_0x8c36('0x29')][_0x8c36('0x1a')]);_0x502fa3['offset']=qs[_0x8c36('0x19')](_0x418663['query'][_0x8c36('0x19')]);}_0x502fa3['order']=qs[_0x8c36('0x30')](_0x418663[_0x8c36('0x29')][_0x8c36('0x30')]);_0x502fa3['where']=qs[_0x8c36('0x2a')](_[_0x8c36('0x31')](_0x418663[_0x8c36('0x29')],_0x1280a1[_0x8c36('0x2a')]));if(_0x418663[_0x8c36('0x29')][_0x8c36('0x32')]){_0x502fa3[_0x8c36('0x33')]=_[_0x8c36('0x34')](_0x502fa3[_0x8c36('0x33')],{'$or':_[_0x8c36('0x35')](_0x3ca98e,function(_0x4719de){if(_0x4719de[_0x8c36('0x36')][_0x8c36('0x37')]!==_0x8c36('0x38')){var _0x250bf7={};_0x250bf7[_0x4719de[_0x8c36('0x39')]]={'$like':'%'+_0x418663[_0x8c36('0x29')]['filter']+'%'};return _0x250bf7;}})});}_0x502fa3=_[_0x8c36('0x34')]({},_0x502fa3,_0x418663['options']);var _0x51960e={'where':_0x502fa3[_0x8c36('0x33')]};return db[_0x8c36('0x3a')][_0x8c36('0x18')](_0x51960e)['then'](function(_0x5a50d6){_0xb29f20[_0x8c36('0x18')]=_0x5a50d6;if(_0x418663[_0x8c36('0x29')][_0x8c36('0x3b')]){_0x502fa3['include']=[{'all':!![]}];}return db['Variable'][_0x8c36('0x3c')](_0x502fa3);})['then'](function(_0x568290){_0xb29f20[_0x8c36('0x3d')]=_0x568290;return _0xb29f20;})[_0x8c36('0x21')](respondWithFilteredResult(_0x2b5a8c,_0x502fa3))[_0x8c36('0x3e')](handleError(_0x2b5a8c,null));};exports[_0x8c36('0x3f')]=function(_0x2a0272,_0x3acf07){var _0x3033fd={'raw':!![],'where':{'id':_0x2a0272[_0x8c36('0x40')]['id']}},_0x343be6={};_0x343be6[_0x8c36('0x27')]=_['keys'](db[_0x8c36('0x3a')][_0x8c36('0x41')]);_0x343be6[_0x8c36('0x29')]=_[_0x8c36('0x28')](_0x2a0272[_0x8c36('0x29')]);_0x343be6['filters']=_[_0x8c36('0x2b')](_0x343be6[_0x8c36('0x27')],_0x343be6[_0x8c36('0x29')]);_0x3033fd[_0x8c36('0x2c')]=_[_0x8c36('0x2b')](_0x343be6[_0x8c36('0x27')],qs['fields'](_0x2a0272[_0x8c36('0x29')][_0x8c36('0x2d')]));_0x3033fd[_0x8c36('0x2c')]=_0x3033fd[_0x8c36('0x2c')][_0x8c36('0x42')]?_0x3033fd[_0x8c36('0x2c')]:_0x343be6[_0x8c36('0x27')];if(_0x2a0272['query'][_0x8c36('0x3b')]){_0x3033fd[_0x8c36('0x43')]=[{'all':!![]}];}_0x3033fd=_[_0x8c36('0x34')]({},_0x3033fd,_0x2a0272[_0x8c36('0x44')]);return db[_0x8c36('0x3a')][_0x8c36('0x45')](_0x3033fd)[_0x8c36('0x21')](handleEntityNotFound(_0x3acf07,null))[_0x8c36('0x21')](respondWithResult(_0x3acf07,null))[_0x8c36('0x3e')](handleError(_0x3acf07,null));};exports[_0x8c36('0x46')]=function(_0x1303ea,_0x114d10){return db['Variable']['create'](_0x1303ea[_0x8c36('0x47')],{})[_0x8c36('0x21')](function(_0xd46608){var _0x3e61d2=_0x1303ea['user'][_0x8c36('0x48')]({'plain':!![]});if(!_0x3e61d2)throw new Error(_0x8c36('0x49'));if(_0x3e61d2['role']==='user'){var _0x4edf8e=_0xd46608[_0x8c36('0x48')]({'plain':!![]});var _0x23189b=_0x8c36('0x23');return db[_0x8c36('0x4a')][_0x8c36('0x45')]({'where':{'name':_0x23189b,'userProfileId':_0x3e61d2[_0x8c36('0x4b')]},'raw':!![]})['then'](function(_0x3e4be4){if(_0x3e4be4&&_0x3e4be4[_0x8c36('0x4c')]===0x0){return db[_0x8c36('0x24')][_0x8c36('0x46')]({'name':_0x4edf8e['name'],'resourceId':_0x4edf8e['id'],'type':_0x3e4be4['name'],'sectionId':_0x3e4be4['id']},{})['then'](function(){return _0xd46608;});}else{return _0xd46608;}})[_0x8c36('0x3e')](function(_0x3e4b78){logger[_0x8c36('0x25')](_0x8c36('0x4d'),_0x3e4b78);throw _0x3e4b78;});}return _0xd46608;})[_0x8c36('0x21')](respondWithResult(_0x114d10,0xc9))[_0x8c36('0x3e')](handleError(_0x114d10,null));};exports[_0x8c36('0x20')]=function(_0xd2b403,_0x2c9d63){if(_0xd2b403['body']['id']){delete _0xd2b403['body']['id'];}return db[_0x8c36('0x3a')]['find']({'where':{'id':_0xd2b403['params']['id']}})[_0x8c36('0x21')](handleEntityNotFound(_0x2c9d63,null))['then'](saveUpdates(_0xd2b403[_0x8c36('0x47')],null))[_0x8c36('0x21')](respondWithResult(_0x2c9d63,null))['catch'](handleError(_0x2c9d63,null));};exports[_0x8c36('0x22')]=function(_0x5af860,_0x31fbde){return db[_0x8c36('0x3a')][_0x8c36('0x45')]({'where':{'id':_0x5af860['params']['id']}})[_0x8c36('0x21')](handleEntityNotFound(_0x31fbde,null))[_0x8c36('0x21')](removeEntity(_0x31fbde,null))[_0x8c36('0x3e')](handleError(_0x31fbde,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 3440e43..f9f3956 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 _0x8f9d=['define','Variable','tools_variables','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0xb28c53,_0xa65eb4){var _0x502ab=function(_0x15890c){while(--_0x15890c){_0xb28c53['push'](_0xb28c53['shift']());}};_0x502ab(++_0xa65eb4);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e8d=['request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2aa32b,_0x3f058c){var _0x29ae13=function(_0x331163){while(--_0x331163){_0x2aa32b['push'](_0x2aa32b['shift']());}};_0x29ae13(++_0x3f058c);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x1d6855,_0x2221cd){_0x1d6855=_0x1d6855-0x0;var _0x2f369c=_0x5e8d[_0x1d6855];return _0x2f369c;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var logger=require(_0xd5e8('0x2'))(_0xd5e8('0x3'));var moment=require(_0xd5e8('0x4'));var BPromise=require(_0xd5e8('0x5'));var rp=require(_0xd5e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5e8('0x7'));var config=require(_0xd5e8('0x8'));var attributes=require('./variable.attributes');module[_0xd5e8('0x9')]=function(_0x2ea3be,_0x195f41){return _0x2ea3be['define'](_0xd5e8('0xa'),attributes,{'tableName':_0xd5e8('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 d011c93..f2277a3 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 _0xf933=['code','message','result','catch','find','options','raw','where','attributes','map','include','ShowVariable','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0xf933,0x123));var _0x3f93=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf933[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x3f93('0x0'));var util=require(_0x3f93('0x1'));var moment=require(_0x3f93('0x2'));var BPromise=require(_0x3f93('0x3'));var rs=require(_0x3f93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f93('0x5'))['db'];var utils=require(_0x3f93('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f93('0x7'));var jayson=require(_0x3f93('0x8'));var client=jayson['client'][_0x3f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27822f,_0x4efebf,_0x191470){return new BPromise(function(_0x2445e9,_0x567693){return client[_0x3f93('0xa')](_0x27822f,_0x191470)[_0x3f93('0xb')](function(_0x57ec39){logger[_0x3f93('0xc')](_0x3f93('0xd'),_0x4efebf,_0x3f93('0xe'));logger[_0x3f93('0xf')](_0x3f93('0x10'),_0x4efebf,_0x3f93('0xe'),JSON[_0x3f93('0x11')](_0x57ec39));if(_0x57ec39[_0x3f93('0x12')]){if(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x13')]===0x1f4){logger[_0x3f93('0x12')]('Variable,\x20%s,\x20%s',_0x4efebf,_0x57ec39['error'][_0x3f93('0x14')]);return _0x567693(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);}logger[_0x3f93('0x12')](_0x3f93('0xd'),_0x4efebf,_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);return _0x2445e9(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);}else{logger['info'](_0x3f93('0xd'),_0x4efebf,_0x3f93('0xe'));_0x2445e9(_0x57ec39[_0x3f93('0x15')][_0x3f93('0x14')]);}})[_0x3f93('0x16')](function(_0x285dbf){logger[_0x3f93('0x12')](_0x3f93('0xd'),_0x4efebf,_0x285dbf);_0x567693(_0x285dbf);});});}exports['ShowVariable']=function(_0x52e86d){var _0x18f390=this;return new Promise(function(_0x43b079,_0x3c2f4b){return db['Variable'][_0x3f93('0x17')]({'raw':_0x52e86d['options']?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x19')]===undefined?!![]:![]:!![],'where':_0x52e86d[_0x3f93('0x18')]?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1a')]||null:null,'attributes':_0x52e86d['options']?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1b')]||null:null,'include':_0x52e86d[_0x3f93('0x18')]?_0x52e86d['options']['include']?_[_0x3f93('0x1c')](_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1d')],function(_0x815ec0){return{'model':db[_0x815ec0['model']],'as':_0x815ec0['as'],'attributes':_0x815ec0[_0x3f93('0x1b')],'include':_0x815ec0[_0x3f93('0x1d')]?_[_0x3f93('0x1c')](_0x815ec0['include'],function(_0x3c032c){return{'model':db[_0x3c032c['model']],'as':_0x3c032c['as'],'attributes':_0x3c032c['attributes'],'include':_0x3c032c[_0x3f93('0x1d')]?_[_0x3f93('0x1c')](_0x3c032c[_0x3f93('0x1d')],function(_0x23f757){return{'model':db[_0x23f757['model']],'as':_0x23f757['as'],'attributes':_0x23f757[_0x3f93('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f93('0xb')](function(_0x2b3403){logger[_0x3f93('0xc')](_0x3f93('0x1e'),_0x52e86d);logger[_0x3f93('0xf')](_0x3f93('0x1e'),_0x52e86d,JSON[_0x3f93('0x11')](_0x2b3403));_0x43b079(_0x2b3403);})['catch'](function(_0x912e8){logger[_0x3f93('0x12')](_0x3f93('0x1e'),_0x912e8[_0x3f93('0x14')],_0x52e86d);_0x3c2f4b(_0x18f390[_0x3f93('0x12')](0x1f4,_0x912e8['message']));});});}; \ No newline at end of file +var _0x8e89=['result','catch','ShowVariable','Variable','find','options','raw','include','map','model','attributes','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x5ecf44,_0x15dfe7){var _0x1bee63=function(_0x3c4b48){while(--_0x3c4b48){_0x5ecf44['push'](_0x5ecf44['shift']());}};_0x1bee63(++_0x15dfe7);}(_0x8e89,0x156));var _0x98e8=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x8e89[_0x384231];return _0x2480bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x98e8('0x0'));var BPromise=require(_0x98e8('0x1'));var rs=require(_0x98e8('0x2'));var fs=require('fs');var Redis=require(_0x98e8('0x3'));var db=require(_0x98e8('0x4'))['db'];var utils=require(_0x98e8('0x5'));var logger=require(_0x98e8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x98e8('0x7'));var client=jayson[_0x98e8('0x8')][_0x98e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2e01,_0x549645,_0x16c5d8){return new BPromise(function(_0x2854d5,_0x5273a3){return client[_0x98e8('0xa')](_0x2b2e01,_0x16c5d8)[_0x98e8('0xb')](function(_0x120808){logger['info'](_0x98e8('0xc'),_0x549645,_0x98e8('0xd'));logger[_0x98e8('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x549645,_0x98e8('0xd'),JSON['stringify'](_0x120808));if(_0x120808[_0x98e8('0xf')]){if(_0x120808[_0x98e8('0xf')]['code']===0x1f4){logger[_0x98e8('0xf')]('Variable,\x20%s,\x20%s',_0x549645,_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);return _0x5273a3(_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);}logger['error'](_0x98e8('0xc'),_0x549645,_0x120808[_0x98e8('0xf')]['message']);return _0x2854d5(_0x120808[_0x98e8('0xf')][_0x98e8('0x10')]);}else{logger[_0x98e8('0x11')](_0x98e8('0xc'),_0x549645,_0x98e8('0xd'));_0x2854d5(_0x120808[_0x98e8('0x12')][_0x98e8('0x10')]);}})[_0x98e8('0x13')](function(_0x211a74){logger['error'](_0x98e8('0xc'),_0x549645,_0x211a74);_0x5273a3(_0x211a74);});});}exports[_0x98e8('0x14')]=function(_0x9f8fe5){var _0xfe915a=this;return new Promise(function(_0x5b69ff,_0x1277f){return db[_0x98e8('0x15')][_0x98e8('0x16')]({'raw':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x18')]===undefined?!![]:![]:!![],'where':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')]['where']||null:null,'attributes':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5['options']['attributes']||null:null,'include':_0x9f8fe5[_0x98e8('0x17')]?_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x9f8fe5[_0x98e8('0x17')][_0x98e8('0x19')],function(_0x41e31d){return{'model':db[_0x41e31d[_0x98e8('0x1b')]],'as':_0x41e31d['as'],'attributes':_0x41e31d[_0x98e8('0x1c')],'include':_0x41e31d[_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x41e31d[_0x98e8('0x19')],function(_0x746373){return{'model':db[_0x746373[_0x98e8('0x1b')]],'as':_0x746373['as'],'attributes':_0x746373[_0x98e8('0x1c')],'include':_0x746373[_0x98e8('0x19')]?_[_0x98e8('0x1a')](_0x746373['include'],function(_0x323be8){return{'model':db[_0x323be8['model']],'as':_0x323be8['as'],'attributes':_0x323be8['attributes']};}):[]};}):[]};}):[]:[]})[_0x98e8('0xb')](function(_0x227edd){logger[_0x98e8('0x11')](_0x98e8('0x14'),_0x9f8fe5);logger[_0x98e8('0xe')](_0x98e8('0x14'),_0x9f8fe5,JSON[_0x98e8('0x1d')](_0x227edd));_0x5b69ff(_0x227edd);})[_0x98e8('0x13')](function(_0x26ed5c){logger[_0x98e8('0xf')](_0x98e8('0x14'),_0x26ed5c[_0x98e8('0x10')],_0x9f8fe5);_0x1277f(_0xfe915a[_0x98e8('0xf')](0x1f4,_0x26ed5c[_0x98e8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 057e75e..6d9400d 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 _0x94d6=['Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','/reset','reset','pull','/restart'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x94d6,0x197));var _0x694d=function(_0x1b70d6,_0x3901e7){_0x1b70d6=_0x1b70d6-0x0;var _0x2d0467=_0x94d6[_0x1b70d6];return _0x2d0467;};'use strict';var express=require('express');var router=express[_0x694d('0x0')]();var auth=require(_0x694d('0x1'));var controller=require(_0x694d('0x2'));router[_0x694d('0x3')]('/',controller[_0x694d('0x4')]);router[_0x694d('0x3')]('/fetch',auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller['fetch']);router[_0x694d('0x3')](_0x694d('0x7'),auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller[_0x694d('0x8')]);router['get']('/pull',auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller[_0x694d('0x9')]);router['get'](_0x694d('0xa'),auth[_0x694d('0x5')](),controller['restart']);router['get']('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file +var _0xf61e=['reset','pull','/restart','restart','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x11d31c,_0x10975c){var _0x4b6a13=function(_0x117e19){while(--_0x117e19){_0x11d31c['push'](_0x11d31c['shift']());}};_0x4b6a13(++_0x10975c);}(_0xf61e,0xf6));var _0xef61=function(_0x3bbcf2,_0x12edce){_0x3bbcf2=_0x3bbcf2-0x0;var _0x10aaeb=_0xf61e[_0x3bbcf2];return _0x10aaeb;};'use strict';var express=require('express');var router=express[_0xef61('0x0')]();var auth=require(_0xef61('0x1'));var controller=require(_0xef61('0x2'));router[_0xef61('0x3')]('/',controller[_0xef61('0x4')]);router[_0xef61('0x3')](_0xef61('0x5'),auth[_0xef61('0x6')](),auth[_0xef61('0x7')](),controller[_0xef61('0x8')]);router['get'](_0xef61('0x9'),auth['isAuthenticated'](),auth[_0xef61('0x7')](),controller[_0xef61('0xa')]);router[_0xef61('0x3')]('/pull',auth['isAuthenticated'](),auth[_0xef61('0x7')](),controller[_0xef61('0xb')]);router[_0xef61('0x3')](_0xef61('0xc'),auth[_0xef61('0x6')](),controller[_0xef61('0xd')]);router[_0xef61('0x3')]('/migrations',controller[_0xef61('0xe')]);module[_0xef61('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index e6797c0..3315b91 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 _0xcf59=['tags','latest','2.0.0','status','json','origin','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','server','length','replace','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','fetch'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xcf59,0x1c5));var _0x9cf5=function(_0x9102f8,_0x578620){_0x9102f8=_0x9102f8-0x0;var _0x356161=_0xcf59[_0x9102f8];return _0x356161;};'use strict';var Umzug=require(_0x9cf5('0x0'));var path=require(_0x9cf5('0x1'));var fs=require('fs');var _=require(_0x9cf5('0x2'));var pkginfo=require('pkginfo')(module,_0x9cf5('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x9cf5('0x4')];var db=require(_0x9cf5('0x5'))['db'];var config=require(_0x9cf5('0x6'));var pm2=require(_0x9cf5('0x7'));var logger=require('../../config/logger')(_0x9cf5('0x8'));var git=require(_0x9cf5('0x9'))(config[_0x9cf5('0xa')]);exports[_0x9cf5('0xb')]=function(_0x30d0c0,_0x30105e){var _0x373ac3={'current':module[_0x9cf5('0xc')][_0x9cf5('0x3')],'phonebar':0x2};if(_0x30d0c0[_0x9cf5('0xd')]&&_0x30d0c0['query']['latest']){return git[_0x9cf5('0xe')]()[_0x9cf5('0xf')](function(_0x3b1518,_0xc3da46){_0x373ac3['latest']=(_0x3b1518?module[_0x9cf5('0xc')][_0x9cf5('0x3')]:_0xc3da46[_0x9cf5('0x10')])||_0x9cf5('0x11');return _0x30105e[_0x9cf5('0x12')](0xc8)['json'](_0x373ac3);});}else{return _0x30105e[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')](_0x373ac3);}};exports[_0x9cf5('0xe')]=function(_0x27e7b0,_0x366338){return git[_0x9cf5('0xe')]([_0x9cf5('0x14'),'master'],function(_0x1d904b){if(_0x1d904b){logger['error'](_0x1d904b);return _0x366338[_0x9cf5('0x12')](0x1f4)[_0x9cf5('0x13')](_0x1d904b);}logger['info'](_0x9cf5('0x15'));return _0x366338[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':_0x9cf5('0x16')});});};exports[_0x9cf5('0x17')]=function(_0x52026b,_0x3ac4c9){return git[_0x9cf5('0x17')]([_0x9cf5('0x18'),_0x9cf5('0x19')],function(_0x1736c8){if(_0x1736c8){logger[_0x9cf5('0x1a')](_0x1736c8);return _0x3ac4c9['status'](0x1f4)[_0x9cf5('0x13')](_0x1736c8);}logger[_0x9cf5('0x1b')](_0x9cf5('0x1c'));return _0x3ac4c9[_0x9cf5('0x12')](0xc8)['json']({'output':_0x9cf5('0x1d')});});};exports['pull']=function(_0x5a2a54,_0x19b7dc){exec(_0x9cf5('0x1e'),function(_0x2df66b,_0x296fef,_0x4edbfd){logger['info'](_0x296fef);logger['info'](_0x4edbfd);if(_0x2df66b){logger[_0x9cf5('0x1a')](_0x2df66b);return _0x19b7dc[_0x9cf5('0x12')](0x1f4)['json'](_0x2df66b);}return _0x19b7dc[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':_0x296fef});});};exports[_0x9cf5('0x1f')]=function(_0x4dcbb6,_0x3f3daf){return pm2['restart'](_0x9cf5('0x20'))[_0x9cf5('0x21')](function(_0x1a3349){logger['info'](_0x9cf5('0x22'),_0x1a3349);return _0x3f3daf[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9cf5('0x23')](function(_0x426aba){logger[_0x9cf5('0x1a')](_0x426aba);return _0x3f3daf[_0x9cf5('0x12')](0x1f4)['json'](_0x426aba);});};exports[_0x9cf5('0x24')]=function(_0x2235cd,_0x51b783){var _0x3dc4f3=fs['readdirSync'](path[_0x9cf5('0x25')](config['root'],_0x9cf5('0x26'),'migrations'));var _0x574ffd=[];for(var _0x51dc59=0x0;_0x51dc59<_0x3dc4f3[_0x9cf5('0x27')];_0x51dc59++){var _0x498c69=_0x3dc4f3[_0x51dc59][_0x9cf5('0x28')](_0x9cf5('0x29'),'');if(compareVersions(module['exports'][_0x9cf5('0x3')],_0x498c69)===-0x1){_0x574ffd[_0x9cf5('0x2a')](_0x498c69);}}if(_0x574ffd[_0x9cf5('0x27')]){var _0x347e91=_0x574ffd[_0x9cf5('0x2b')](compareVersions);var _0x404eff=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9cf5('0x2c')],'modelName':_0x9cf5('0x2c'),'columnName':_0x9cf5('0x3')},'migrations':{'params':[db[_0x9cf5('0x2d')][_0x9cf5('0x2e')](),db[_0x9cf5('0x2d')]['constructor'],function(){throw new Error(_0x9cf5('0x2f'));}],'path':path[_0x9cf5('0x25')](config['root'],_0x9cf5('0x26'),_0x9cf5('0x24')),'pattern':/\.js$/}});_0x404eff['up']({'migrations':_[_0x9cf5('0x30')](_0x347e91,function(_0x3427d0){return _0x3427d0+_0x9cf5('0x29');})})[_0x9cf5('0x21')](function(){return _0x51b783[_0x9cf5('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9cf5('0xc')]['version']+'\x20to\x20'+_[_0x9cf5('0x31')](_0x347e91),'migrations':_[_0x9cf5('0x25')](_0x347e91)});})['catch'](function(_0x31fa9b){if(_0x31fa9b instanceof db[_0x9cf5('0x2d')][_0x9cf5('0x32')]){return _0x51b783['status'](0xc8)['json']({'output':_0x9cf5('0x33')});}else{return _0x51b783[_0x9cf5('0x12')](0x1f4)['json'](_0x31fa9b);}});}else{return _0x51b783[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x8bea=['status','json','origin','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','.js','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','fetch','tags','exports','latest','2.0.0'];(function(_0x337441,_0x58e955){var _0x544ad7=function(_0x1e0eb4){while(--_0x1e0eb4){_0x337441['push'](_0x337441['shift']());}};_0x544ad7(++_0x58e955);}(_0x8bea,0x132));var _0xa8be=function(_0x4cffd0,_0x43de82){_0x4cffd0=_0x4cffd0-0x0;var _0x12ac47=_0x8bea[_0x4cffd0];return _0x12ac47;};'use strict';var Umzug=require(_0xa8be('0x0'));var path=require(_0xa8be('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xa8be('0x2'));var compareVersions=require(_0xa8be('0x3'));var exec=require(_0xa8be('0x4'))[_0xa8be('0x5')];var db=require(_0xa8be('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xa8be('0x7'));var logger=require(_0xa8be('0x8'))(_0xa8be('0x9'));var git=require(_0xa8be('0xa'))(config[_0xa8be('0xb')]);exports[_0xa8be('0xc')]=function(_0x4624f6,_0x96917d){var _0x5d7f2d={'current':module['exports'][_0xa8be('0x2')],'phonebar':0x2};if(_0x4624f6['query']&&_0x4624f6['query']['latest']){return git[_0xa8be('0xd')]()[_0xa8be('0xe')](function(_0x43cb95,_0xc76b97){_0x5d7f2d['latest']=(_0x43cb95?module[_0xa8be('0xf')][_0xa8be('0x2')]:_0xc76b97[_0xa8be('0x10')])||_0xa8be('0x11');return _0x96917d[_0xa8be('0x12')](0xc8)['json'](_0x5d7f2d);});}else{return _0x96917d[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')](_0x5d7f2d);}};exports[_0xa8be('0xd')]=function(_0x3d1893,_0x4c9ef9){return git[_0xa8be('0xd')]([_0xa8be('0x14'),'master'],function(_0x2cdd88){if(_0x2cdd88){logger[_0xa8be('0x15')](_0x2cdd88);return _0x4c9ef9[_0xa8be('0x12')](0x1f4)['json'](_0x2cdd88);}logger[_0xa8be('0x16')]('git\x20fetch');return _0x4c9ef9[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x17')});});};exports[_0xa8be('0x18')]=function(_0x204598,_0x284461){return git[_0xa8be('0x18')]([_0xa8be('0x19'),_0xa8be('0x1a')],function(_0x26230c){if(_0x26230c){logger[_0xa8be('0x15')](_0x26230c);return _0x284461[_0xa8be('0x12')](0x1f4)[_0xa8be('0x13')](_0x26230c);}logger[_0xa8be('0x16')](_0xa8be('0x1b'));return _0x284461[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x1c')});});};exports[_0xa8be('0x1d')]=function(_0x264e5a,_0x49be0e){exec(_0xa8be('0x1e'),function(_0x463588,_0x218a2f,_0x307ad3){logger[_0xa8be('0x16')](_0x218a2f);logger[_0xa8be('0x16')](_0x307ad3);if(_0x463588){logger['error'](_0x463588);return _0x49be0e[_0xa8be('0x12')](0x1f4)[_0xa8be('0x13')](_0x463588);}return _0x49be0e['status'](0xc8)[_0xa8be('0x13')]({'output':_0x218a2f});});};exports[_0xa8be('0x1f')]=function(_0x5cfbb8,_0xd75b99){return pm2[_0xa8be('0x1f')](_0xa8be('0x20'))[_0xa8be('0x21')](function(_0x141401){logger[_0xa8be('0x16')](_0xa8be('0x22'),_0x141401);return _0xd75b99[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xa8be('0x23')](function(_0xfe7ced){logger['error'](_0xfe7ced);return _0xd75b99[_0xa8be('0x12')](0x1f4)['json'](_0xfe7ced);});};exports[_0xa8be('0x24')]=function(_0x5d6391,_0x294522){var _0x28620e=fs[_0xa8be('0x25')](path[_0xa8be('0x26')](config[_0xa8be('0xb')],_0xa8be('0x27'),_0xa8be('0x24')));var _0x510d49=[];for(var _0x4bc671=0x0;_0x4bc671<_0x28620e['length'];_0x4bc671++){var _0x27a520=_0x28620e[_0x4bc671]['replace'](_0xa8be('0x28'),'');if(compareVersions(module[_0xa8be('0xf')][_0xa8be('0x2')],_0x27a520)===-0x1){_0x510d49['push'](_0x27a520);}}if(_0x510d49[_0xa8be('0x29')]){var _0x9e9c43=_0x510d49[_0xa8be('0x2a')](compareVersions);var _0x4e15b1=new Umzug({'storage':_0xa8be('0x2b'),'storageOptions':{'model':db[_0xa8be('0x2c')],'modelName':'Migration','columnName':_0xa8be('0x2')},'migrations':{'params':[db[_0xa8be('0x2b')][_0xa8be('0x2d')](),db['sequelize'][_0xa8be('0x2e')],function(){throw new Error(_0xa8be('0x2f'));}],'path':path[_0xa8be('0x26')](config[_0xa8be('0xb')],_0xa8be('0x27'),_0xa8be('0x24')),'pattern':/\.js$/}});_0x4e15b1['up']({'migrations':_[_0xa8be('0x30')](_0x9e9c43,function(_0xca81e2){return _0xca81e2+_0xa8be('0x28');})})[_0xa8be('0x21')](function(){return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x31')+module[_0xa8be('0xf')][_0xa8be('0x2')]+_0xa8be('0x32')+_[_0xa8be('0x33')](_0x9e9c43),'migrations':_[_0xa8be('0x26')](_0x9e9c43)});})[_0xa8be('0x23')](function(_0x27a3dc){if(_0x27a3dc instanceof db['sequelize'][_0xa8be('0x34')]){return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x294522['status'](0x1f4)[_0xa8be('0x13')](_0x27a3dc);}});}else{return _0x294522[_0xa8be('0x12')](0xc8)[_0xa8be('0x13')]({'output':_0xa8be('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index daf115c..969a2b0 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 _0x8aad=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./voiceAgentReport.controller','index','get','/describe','describe','/:id','isAuthenticated','create','put'];(function(_0xb4824c,_0x103c51){var _0x2cc444=function(_0x50ddad){while(--_0x50ddad){_0xb4824c['push'](_0xb4824c['shift']());}};_0x2cc444(++_0x103c51);}(_0x8aad,0x146));var _0xd8aa=function(_0x156a40,_0x124b9f){_0x156a40=_0x156a40-0x0;var _0x2189b7=_0x8aad[_0x156a40];return _0x2189b7;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var auth=require(_0xd8aa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8aa('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8aa('0x6')]);router[_0xd8aa('0x7')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x7')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['show']);router['post']('/',auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0xd')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['update']);router[_0xd8aa('0xe')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xf')]);module[_0xd8aa('0x10')]=router; \ No newline at end of file +var _0x1261=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','destroy'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0x1261,0x144));var _0x1126=function(_0x41eb44,_0x229d85){_0x41eb44=_0x41eb44-0x0;var _0x334ba7=_0x1261[_0x41eb44];return _0x334ba7;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0xf')]);router[_0x1126('0x10')]('/:id',auth[_0x1126('0xd')](),controller['update']);router['delete'](_0x1126('0xc'),auth['isAuthenticated'](),controller[_0x1126('0x11')]);module[_0x1126('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 5502275..c422d2a 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 _0x64a7=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x40e21d,_0xe32def){var _0x30f13e=function(_0x9ae612){while(--_0x9ae612){_0x40e21d['push'](_0x40e21d['shift']());}};_0x30f13e(++_0xe32def);}(_0x64a7,0xfd));var _0x764a=function(_0x1d4118,_0x50aa9d){_0x1d4118=_0x1d4118-0x0;var _0x2d61e2=_0x64a7[_0x1d4118];return _0x2d61e2;};'use strict';var Sequelize=require(_0x764a('0x0'));module[_0x764a('0x1')]={'type':{'type':Sequelize[_0x764a('0x2')]},'uniqueid':{'type':Sequelize[_0x764a('0x2')]},'calleridnum':{'type':Sequelize[_0x764a('0x2')]},'calleridname':{'type':Sequelize[_0x764a('0x2')]},'queue':{'type':Sequelize[_0x764a('0x2')]},'interface':{'type':Sequelize[_0x764a('0x2')]},'membername':{'type':Sequelize[_0x764a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x764a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x764a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x764a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x764a('0x3')]},'agentdumpAt':{'type':Sequelize[_0x764a('0x3')]},'holdtime':{'type':Sequelize[_0x764a('0x4')]},'agentcomplete':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x764a('0x4')]},'agentacw':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x764a('0x2')]},'lastevent':{'type':Sequelize[_0x764a('0x2')]},'channel':{'type':Sequelize[_0x764a('0x2')]},'channelstate':{'type':Sequelize[_0x764a('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x764a('0x2')]},'connectedlinename':{'type':Sequelize[_0x764a('0x2')]},'language':{'type':Sequelize[_0x764a('0x2')]},'accountcode':{'type':Sequelize[_0x764a('0x2')]},'context':{'type':Sequelize[_0x764a('0x2')]},'exten':{'type':Sequelize[_0x764a('0x2')]},'priority':{'type':Sequelize[_0x764a('0x2')]},'destchannel':{'type':Sequelize[_0x764a('0x2')]},'destchannelstate':{'type':Sequelize[_0x764a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x764a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x764a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x764a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x764a('0x2')]},'destlanguage':{'type':Sequelize[_0x764a('0x2')]},'destaccountcode':{'type':Sequelize[_0x764a('0x2')]},'destcontext':{'type':Sequelize[_0x764a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x764a('0x2')]},'destuniqueid':{'type':Sequelize[_0x764a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x764a('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x764a('0x2')]},'transfer':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x764a('0x6')},'transferexten':{'type':Sequelize[_0x764a('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x764a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe1a5=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe1a5,0xd7));var _0x5e1a=function(_0x184902,_0x271a88){_0x184902=_0x184902-0x0;var _0x38de0c=_0xe1a5[_0x184902];return _0x38de0c;};'use strict';var Sequelize=require(_0x5e1a('0x0'));module[_0x5e1a('0x1')]={'type':{'type':Sequelize[_0x5e1a('0x2')]},'uniqueid':{'type':Sequelize[_0x5e1a('0x2')]},'calleridnum':{'type':Sequelize[_0x5e1a('0x2')]},'calleridname':{'type':Sequelize[_0x5e1a('0x2')]},'queue':{'type':Sequelize[_0x5e1a('0x2')]},'interface':{'type':Sequelize[_0x5e1a('0x2')]},'membername':{'type':Sequelize[_0x5e1a('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x5e1a('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5e1a('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5e1a('0x3')]},'holdtime':{'type':Sequelize[_0x5e1a('0x4')]},'agentcomplete':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5e1a('0x4')]},'agentacw':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x5e1a('0x2')]},'lastevent':{'type':Sequelize[_0x5e1a('0x2')]},'channel':{'type':Sequelize[_0x5e1a('0x2')]},'channelstate':{'type':Sequelize[_0x5e1a('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5e1a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5e1a('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5e1a('0x2')]},'accountcode':{'type':Sequelize[_0x5e1a('0x2')]},'context':{'type':Sequelize[_0x5e1a('0x2')]},'exten':{'type':Sequelize[_0x5e1a('0x2')]},'priority':{'type':Sequelize[_0x5e1a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5e1a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x5e1a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5e1a('0x2')]},'destcalleridname':{'type':Sequelize[_0x5e1a('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5e1a('0x2')]},'destlanguage':{'type':Sequelize[_0x5e1a('0x2')]},'destaccountcode':{'type':Sequelize[_0x5e1a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5e1a('0x2')]},'destpriority':{'type':Sequelize[_0x5e1a('0x2')]},'destuniqueid':{'type':Sequelize[_0x5e1a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5e1a('0x2')]},'transfer':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5e1a('0x2')],'comment':_0x5e1a('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x5e1a('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 6033b27..3ecfb88 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 _0x8572=['update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','VoiceAgentReport','includeAll','findAll','show','params','options','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save'];(function(_0xc6e36,_0x28947c){var _0x183089=function(_0x46dabb){while(--_0x46dabb){_0xc6e36['push'](_0xc6e36['shift']());}};_0x183089(++_0x28947c);}(_0x8572,0x14d));var _0x2857=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x8572[_0x4a7631];return _0x1a5a6f;};'use strict';var pdf=require(_0x2857('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2857('0x1'));var zipdir=require(_0x2857('0x2'));var jsonpatch=require(_0x2857('0x3'));var rp=require(_0x2857('0x4'));var moment=require(_0x2857('0x5'));var BPromise=require(_0x2857('0x6'));var Mustache=require(_0x2857('0x7'));var util=require(_0x2857('0x8'));var path=require(_0x2857('0x9'));var sox=require(_0x2857('0xa'));var csv=require('to-csv');var ejs=require(_0x2857('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2857('0xc'));var deskjs=require(_0x2857('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2857('0xe'));var Papa=require(_0x2857('0xf'));var Redis=require(_0x2857('0x10'));var authService=require(_0x2857('0x11'));var qs=require(_0x2857('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2857('0x13'));var utils=require(_0x2857('0x14'));var config=require(_0x2857('0x15'));var db=require(_0x2857('0x16'))['db'];function respondWithStatusCode(_0x27f386,_0x348168){_0x348168=_0x348168||0xcc;return function(_0x2d6534){if(_0x2d6534){return _0x27f386[_0x2857('0x17')](_0x348168);}return _0x27f386[_0x2857('0x18')](_0x348168)[_0x2857('0x19')]();};}function respondWithResult(_0x34f7ec,_0x13b683){_0x13b683=_0x13b683||0xc8;return function(_0x5eb87c){if(_0x5eb87c){return _0x34f7ec[_0x2857('0x18')](_0x13b683)[_0x2857('0x1a')](_0x5eb87c);}};}function respondWithFilteredResult(_0x3db4de,_0x46862f){return function(_0x470e45){if(_0x470e45){var _0x10cbf3=_0x470e45[_0x2857('0x1b')],_0x5eb998=_0x46862f[_0x2857('0x1c')],_0x5dd712=_0x46862f[_0x2857('0x1c')]+_0x46862f['limit'],_0x51f7f7;if(_0x5dd712>=_0x10cbf3){_0x5dd712=_0x10cbf3;_0x51f7f7=0xc8;}else{_0x51f7f7=0xce;}_0x3db4de[_0x2857('0x18')](_0x51f7f7);return _0x3db4de['set'](_0x2857('0x1d'),_0x5eb998+'-'+_0x5dd712+'/'+_0x10cbf3)['json'](_0x470e45);}return null;};}function patchUpdates(_0x229e35){return function(_0x1ebf5b){try{jsonpatch[_0x2857('0x1e')](_0x1ebf5b,_0x229e35,!![]);}catch(_0x678f4d){return BPromise['reject'](_0x678f4d);}return _0x1ebf5b[_0x2857('0x1f')]();};}function saveUpdates(_0xfd40fb,_0x57f83a){return function(_0x2f6168){if(_0x2f6168){return _0x2f6168[_0x2857('0x20')](_0xfd40fb)[_0x2857('0x21')](function(_0x333ce3){return _0x333ce3;});}return null;};}function removeEntity(_0x43cc52,_0x4dcd4b){return function(_0x1c241a){if(_0x1c241a){return _0x1c241a[_0x2857('0x22')]()[_0x2857('0x21')](function(){_0x43cc52[_0x2857('0x18')](0xcc)[_0x2857('0x19')]();});}};}function handleEntityNotFound(_0x552029,_0x2399bf){return function(_0x1800f7){if(!_0x1800f7){_0x552029[_0x2857('0x17')](0x194);}return _0x1800f7;};}function handleError(_0x3e0ed1,_0x50d7ac){_0x50d7ac=_0x50d7ac||0x1f4;return function(_0x4b2a6b){logger[_0x2857('0x23')](_0x4b2a6b[_0x2857('0x24')]);if(_0x4b2a6b[_0x2857('0x25')]){delete _0x4b2a6b[_0x2857('0x25')];}_0x3e0ed1[_0x2857('0x18')](_0x50d7ac)[_0x2857('0x26')](_0x4b2a6b);};}exports[_0x2857('0x27')]=function(_0x5c9111,_0x32e4ed){var _0x2c5974={},_0x301a31={},_0x57d3dd={'count':0x0,'rows':[]};var _0x16a243=db['VoiceAgentReport'][_0x2857('0x28')];_0x301a31[_0x2857('0x29')]=_['keys'](_0x16a243);_0x301a31['query']=_[_0x2857('0x2a')](_0x5c9111[_0x2857('0x2b')]);_0x301a31[_0x2857('0x2c')]=_[_0x2857('0x2d')](_0x301a31[_0x2857('0x29')],_0x301a31[_0x2857('0x2b')]);_0x2c5974[_0x2857('0x2e')]=_['intersection'](_0x301a31[_0x2857('0x29')],qs['fields'](_0x5c9111[_0x2857('0x2b')][_0x2857('0x2f')]));_0x2c5974[_0x2857('0x2e')]=_0x2c5974['attributes'][_0x2857('0x30')]?_0x2c5974[_0x2857('0x2e')]:_0x301a31[_0x2857('0x29')];if(!_0x5c9111['query']['hasOwnProperty'](_0x2857('0x31'))){_0x2c5974[_0x2857('0x32')]=qs[_0x2857('0x32')](_0x5c9111['query']['limit']);_0x2c5974[_0x2857('0x1c')]=qs[_0x2857('0x1c')](_0x5c9111[_0x2857('0x2b')]['offset']);}_0x2c5974[_0x2857('0x33')]=qs[_0x2857('0x34')](_0x5c9111[_0x2857('0x2b')]['sort']);_0x2c5974[_0x2857('0x35')]=qs[_0x2857('0x2c')](_[_0x2857('0x36')](_0x5c9111[_0x2857('0x2b')],_0x301a31['filters']));if(_0x5c9111['query'][_0x2857('0x37')]){_0x2c5974['where']=_['merge'](_0x2c5974[_0x2857('0x35')],{'$or':_[_0x2857('0x38')](_0x16a243,function(_0x51da48){if(_0x51da48[_0x2857('0x39')][_0x2857('0x3a')]!==_0x2857('0x3b')){var _0x538c05={};_0x538c05[_0x51da48[_0x2857('0x3c')]]={'$like':'%'+_0x5c9111[_0x2857('0x2b')]['filter']+'%'};return _0x538c05;}})});}_0x2c5974=_[_0x2857('0x3d')]({},_0x2c5974,_0x5c9111['options']);var _0x443eea={'where':_0x2c5974[_0x2857('0x35')]};return db[_0x2857('0x3e')][_0x2857('0x1b')](_0x443eea)[_0x2857('0x21')](function(_0x235dda){_0x57d3dd[_0x2857('0x1b')]=_0x235dda;if(_0x5c9111[_0x2857('0x2b')][_0x2857('0x3f')]){_0x2c5974['include']=[{'all':!![]}];}return db[_0x2857('0x3e')][_0x2857('0x40')](_0x2c5974);})['then'](function(_0x362a4b){_0x57d3dd['rows']=_0x362a4b;return _0x57d3dd;})[_0x2857('0x21')](respondWithFilteredResult(_0x32e4ed,_0x2c5974))['catch'](handleError(_0x32e4ed,null));};exports[_0x2857('0x41')]=function(_0x415989,_0x3151bc){var _0x112755={'raw':![],'where':{'id':_0x415989[_0x2857('0x42')]['id']}},_0x29736b={};_0x29736b[_0x2857('0x29')]=_[_0x2857('0x2a')](db[_0x2857('0x3e')][_0x2857('0x28')]);_0x29736b[_0x2857('0x2b')]=_['keys'](_0x415989[_0x2857('0x2b')]);_0x29736b[_0x2857('0x2c')]=_[_0x2857('0x2d')](_0x29736b[_0x2857('0x29')],_0x29736b[_0x2857('0x2b')]);_0x112755['attributes']=_['intersection'](_0x29736b[_0x2857('0x29')],qs[_0x2857('0x2f')](_0x415989['query']['fields']));_0x112755[_0x2857('0x2e')]=_0x112755[_0x2857('0x2e')][_0x2857('0x30')]?_0x112755[_0x2857('0x2e')]:_0x29736b[_0x2857('0x29')];if(_0x415989[_0x2857('0x2b')][_0x2857('0x3f')]){_0x112755['include']=[{'all':!![]}];}_0x112755=_[_0x2857('0x3d')]({},_0x112755,_0x415989[_0x2857('0x43')]);return db[_0x2857('0x3e')][_0x2857('0x44')](_0x112755)[_0x2857('0x21')](handleEntityNotFound(_0x3151bc,null))[_0x2857('0x21')](respondWithResult(_0x3151bc,null))[_0x2857('0x45')](handleError(_0x3151bc,null));};exports[_0x2857('0x46')]=function(_0x2c0b89,_0x58d8fe){return db['VoiceAgentReport'][_0x2857('0x46')](_0x2c0b89['body'],{})[_0x2857('0x21')](respondWithResult(_0x58d8fe,0xc9))['catch'](handleError(_0x58d8fe,null));};exports[_0x2857('0x20')]=function(_0x14222f,_0x5b684d){if(_0x14222f[_0x2857('0x47')]['id']){delete _0x14222f[_0x2857('0x47')]['id'];}return db[_0x2857('0x3e')][_0x2857('0x44')]({'where':{'id':_0x14222f[_0x2857('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b684d,null))['then'](saveUpdates(_0x14222f[_0x2857('0x47')],null))['then'](respondWithResult(_0x5b684d,null))[_0x2857('0x45')](handleError(_0x5b684d,null));};exports[_0x2857('0x22')]=function(_0x2589d9,_0x3a862d){return db[_0x2857('0x3e')][_0x2857('0x44')]({'where':{'id':_0x2589d9[_0x2857('0x42')]['id']}})[_0x2857('0x21')](handleEntityNotFound(_0x3a862d,null))[_0x2857('0x21')](removeEntity(_0x3a862d,null))['catch'](handleError(_0x3a862d,null));};exports[_0x2857('0x48')]=function(_0x229d31,_0x1fceb7){return db[_0x2857('0x3e')]['describe']()[_0x2857('0x21')](respondWithResult(_0x1fceb7,null))[_0x2857('0x45')](handleError(_0x1fceb7,null));}; \ No newline at end of file +var _0xfdde=['save','then','destroy','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','field','merge','includeAll','include','findAll','rows','catch','show','params','fields','create','body','update','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x3aa657,_0x14a170){var _0x2802c7=function(_0xc8832a){while(--_0xc8832a){_0x3aa657['push'](_0x3aa657['shift']());}};_0x2802c7(++_0x14a170);}(_0xfdde,0x104));var _0xefdd=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0xfdde[_0x57e196];return _0x5941ab;};'use strict';var pdf=require(_0xefdd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefdd('0x1'));var zipdir=require(_0xefdd('0x2'));var jsonpatch=require(_0xefdd('0x3'));var rp=require(_0xefdd('0x4'));var moment=require('moment');var BPromise=require(_0xefdd('0x5'));var Mustache=require(_0xefdd('0x6'));var util=require(_0xefdd('0x7'));var path=require(_0xefdd('0x8'));var sox=require(_0xefdd('0x9'));var csv=require(_0xefdd('0xa'));var ejs=require(_0xefdd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xefdd('0xc'));var crypto=require(_0xefdd('0xd'));var jsforce=require(_0xefdd('0xe'));var deskjs=require(_0xefdd('0xf'));var toCsv=require(_0xefdd('0xa'));var querystring=require('querystring');var Papa=require(_0xefdd('0x10'));var Redis=require(_0xefdd('0x11'));var authService=require(_0xefdd('0x12'));var qs=require(_0xefdd('0x13'));var hardwareService=require(_0xefdd('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2dc5,_0x590363){_0x590363=_0x590363||0xcc;return function(_0x1f22a1){if(_0x1f22a1){return _0x5e2dc5[_0xefdd('0x15')](_0x590363);}return _0x5e2dc5[_0xefdd('0x16')](_0x590363)[_0xefdd('0x17')]();};}function respondWithResult(_0x9c8ab7,_0x4e6df9){_0x4e6df9=_0x4e6df9||0xc8;return function(_0x3c0d85){if(_0x3c0d85){return _0x9c8ab7[_0xefdd('0x16')](_0x4e6df9)[_0xefdd('0x18')](_0x3c0d85);}};}function respondWithFilteredResult(_0xa68fe5,_0x2d1a68){return function(_0x26124a){if(_0x26124a){var _0x3c3f99=_0x26124a[_0xefdd('0x19')],_0x375a6d=_0x2d1a68[_0xefdd('0x1a')],_0x10f46c=_0x2d1a68[_0xefdd('0x1a')]+_0x2d1a68[_0xefdd('0x1b')],_0x385d93;if(_0x10f46c>=_0x3c3f99){_0x10f46c=_0x3c3f99;_0x385d93=0xc8;}else{_0x385d93=0xce;}_0xa68fe5[_0xefdd('0x16')](_0x385d93);return _0xa68fe5[_0xefdd('0x1c')](_0xefdd('0x1d'),_0x375a6d+'-'+_0x10f46c+'/'+_0x3c3f99)[_0xefdd('0x18')](_0x26124a);}return null;};}function patchUpdates(_0x5172f7){return function(_0x2a05ff){try{jsonpatch[_0xefdd('0x1e')](_0x2a05ff,_0x5172f7,!![]);}catch(_0x4cb48f){return BPromise[_0xefdd('0x1f')](_0x4cb48f);}return _0x2a05ff[_0xefdd('0x20')]();};}function saveUpdates(_0x1bb7db,_0x279e69){return function(_0x43d729){if(_0x43d729){return _0x43d729['update'](_0x1bb7db)[_0xefdd('0x21')](function(_0x48fa76){return _0x48fa76;});}return null;};}function removeEntity(_0x12fbb7,_0x45c2c7){return function(_0x403f80){if(_0x403f80){return _0x403f80[_0xefdd('0x22')]()[_0xefdd('0x21')](function(){_0x12fbb7['status'](0xcc)[_0xefdd('0x17')]();});}};}function handleEntityNotFound(_0x7eff74,_0x204df4){return function(_0x12446c){if(!_0x12446c){_0x7eff74[_0xefdd('0x15')](0x194);}return _0x12446c;};}function handleError(_0x4650b5,_0x2de0e2){_0x2de0e2=_0x2de0e2||0x1f4;return function(_0x4cef25){logger[_0xefdd('0x23')](_0x4cef25[_0xefdd('0x24')]);if(_0x4cef25[_0xefdd('0x25')]){delete _0x4cef25[_0xefdd('0x25')];}_0x4650b5[_0xefdd('0x16')](_0x2de0e2)[_0xefdd('0x26')](_0x4cef25);};}exports[_0xefdd('0x27')]=function(_0x5e0642,_0x521db4){var _0x1aec1d={},_0x1dac48={},_0x17caff={'count':0x0,'rows':[]};var _0x114a06=db[_0xefdd('0x28')][_0xefdd('0x29')];_0x1dac48[_0xefdd('0x2a')]=_['keys'](_0x114a06);_0x1dac48[_0xefdd('0x2b')]=_[_0xefdd('0x2c')](_0x5e0642[_0xefdd('0x2b')]);_0x1dac48[_0xefdd('0x2d')]=_[_0xefdd('0x2e')](_0x1dac48[_0xefdd('0x2a')],_0x1dac48['query']);_0x1aec1d[_0xefdd('0x2f')]=_[_0xefdd('0x2e')](_0x1dac48[_0xefdd('0x2a')],qs['fields'](_0x5e0642[_0xefdd('0x2b')]['fields']));_0x1aec1d[_0xefdd('0x2f')]=_0x1aec1d['attributes'][_0xefdd('0x30')]?_0x1aec1d[_0xefdd('0x2f')]:_0x1dac48['model'];if(!_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x31')](_0xefdd('0x32'))){_0x1aec1d[_0xefdd('0x1b')]=qs['limit'](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x1b')]);_0x1aec1d[_0xefdd('0x1a')]=qs['offset'](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x1a')]);}_0x1aec1d[_0xefdd('0x33')]=qs[_0xefdd('0x34')](_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x34')]);_0x1aec1d['where']=qs[_0xefdd('0x2d')](_[_0xefdd('0x35')](_0x5e0642[_0xefdd('0x2b')],_0x1dac48['filters']));if(_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x36')]){_0x1aec1d[_0xefdd('0x37')]=_['merge'](_0x1aec1d['where'],{'$or':_[_0xefdd('0x38')](_0x114a06,function(_0x5a5aef){if(_0x5a5aef['type'][_0xefdd('0x39')]!=='VIRTUAL'){var _0x2c6c47={};_0x2c6c47[_0x5a5aef[_0xefdd('0x3a')]]={'$like':'%'+_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x36')]+'%'};return _0x2c6c47;}})});}_0x1aec1d=_[_0xefdd('0x3b')]({},_0x1aec1d,_0x5e0642['options']);var _0x5f4730={'where':_0x1aec1d['where']};return db['VoiceAgentReport'][_0xefdd('0x19')](_0x5f4730)[_0xefdd('0x21')](function(_0xf14967){_0x17caff[_0xefdd('0x19')]=_0xf14967;if(_0x5e0642[_0xefdd('0x2b')][_0xefdd('0x3c')]){_0x1aec1d[_0xefdd('0x3d')]=[{'all':!![]}];}return db[_0xefdd('0x28')][_0xefdd('0x3e')](_0x1aec1d);})[_0xefdd('0x21')](function(_0x5b8873){_0x17caff[_0xefdd('0x3f')]=_0x5b8873;return _0x17caff;})[_0xefdd('0x21')](respondWithFilteredResult(_0x521db4,_0x1aec1d))[_0xefdd('0x40')](handleError(_0x521db4,null));};exports[_0xefdd('0x41')]=function(_0x5d7322,_0x4ff923){var _0x59e534={'raw':![],'where':{'id':_0x5d7322[_0xefdd('0x42')]['id']}},_0x2c6b6a={};_0x2c6b6a[_0xefdd('0x2a')]=_[_0xefdd('0x2c')](db[_0xefdd('0x28')]['rawAttributes']);_0x2c6b6a['query']=_[_0xefdd('0x2c')](_0x5d7322[_0xefdd('0x2b')]);_0x2c6b6a['filters']=_[_0xefdd('0x2e')](_0x2c6b6a[_0xefdd('0x2a')],_0x2c6b6a['query']);_0x59e534[_0xefdd('0x2f')]=_['intersection'](_0x2c6b6a[_0xefdd('0x2a')],qs[_0xefdd('0x43')](_0x5d7322[_0xefdd('0x2b')][_0xefdd('0x43')]));_0x59e534[_0xefdd('0x2f')]=_0x59e534[_0xefdd('0x2f')][_0xefdd('0x30')]?_0x59e534[_0xefdd('0x2f')]:_0x2c6b6a[_0xefdd('0x2a')];if(_0x5d7322[_0xefdd('0x2b')][_0xefdd('0x3c')]){_0x59e534[_0xefdd('0x3d')]=[{'all':!![]}];}_0x59e534=_[_0xefdd('0x3b')]({},_0x59e534,_0x5d7322['options']);return db['VoiceAgentReport']['find'](_0x59e534)['then'](handleEntityNotFound(_0x4ff923,null))[_0xefdd('0x21')](respondWithResult(_0x4ff923,null))['catch'](handleError(_0x4ff923,null));};exports[_0xefdd('0x44')]=function(_0x4e4448,_0x5634ee){return db[_0xefdd('0x28')]['create'](_0x4e4448[_0xefdd('0x45')],{})[_0xefdd('0x21')](respondWithResult(_0x5634ee,0xc9))[_0xefdd('0x40')](handleError(_0x5634ee,null));};exports[_0xefdd('0x46')]=function(_0x2b0521,_0x5d2ce1){if(_0x2b0521[_0xefdd('0x45')]['id']){delete _0x2b0521[_0xefdd('0x45')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x2b0521[_0xefdd('0x42')]['id']}})[_0xefdd('0x21')](handleEntityNotFound(_0x5d2ce1,null))[_0xefdd('0x21')](saveUpdates(_0x2b0521[_0xefdd('0x45')],null))[_0xefdd('0x21')](respondWithResult(_0x5d2ce1,null))['catch'](handleError(_0x5d2ce1,null));};exports['destroy']=function(_0x2a1fac,_0x125f3){return db[_0xefdd('0x28')][_0xefdd('0x47')]({'where':{'id':_0x2a1fac['params']['id']}})['then'](handleEntityNotFound(_0x125f3,null))[_0xefdd('0x21')](removeEntity(_0x125f3,null))[_0xefdd('0x40')](handleError(_0x125f3,null));};exports[_0xefdd('0x48')]=function(_0x39453a,_0x31c50a){return db[_0xefdd('0x28')]['describe']()['then'](respondWithResult(_0x31c50a,null))[_0xefdd('0x40')](handleError(_0x31c50a,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 2c806cf..b61ca70 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 _0xf295=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','VoiceAgentReport','uniqueid','destuniqueid','lodash'];(function(_0x153ad6,_0x237146){var _0x261f02=function(_0x402f77){while(--_0x402f77){_0x153ad6['push'](_0x153ad6['shift']());}};_0x261f02(++_0x237146);}(_0xf295,0x137));var _0x5f29=function(_0x423a85,_0x59e206){_0x423a85=_0x423a85-0x0;var _0x5bb0dc=_0xf295[_0x423a85];return _0x5bb0dc;};'use strict';var _=require(_0x5f29('0x0'));var util=require(_0x5f29('0x1'));var logger=require('../../config/logger')(_0x5f29('0x2'));var moment=require(_0x5f29('0x3'));var BPromise=require(_0x5f29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f29('0x5'));var rimraf=require(_0x5f29('0x6'));var config=require(_0x5f29('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x5f29('0x8')]=function(_0x283c77,_0xf99f23){return _0x283c77['define'](_0x5f29('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5f29('0xa'),_0x5f29('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda4f=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','request-promise'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0xda4f,0x167));var _0xfda4=function(_0x577c12,_0x516ebc){_0x577c12=_0x577c12-0x0;var _0x58ae0f=_0xda4f[_0x577c12];return _0x58ae0f;};'use strict';var _=require(_0xfda4('0x0'));var util=require(_0xfda4('0x1'));var logger=require('../../config/logger')(_0xfda4('0x2'));var moment=require(_0xfda4('0x3'));var BPromise=require('bluebird');var rp=require(_0xfda4('0x4'));var fs=require('fs');var path=require(_0xfda4('0x5'));var rimraf=require(_0xfda4('0x6'));var config=require(_0xfda4('0x7'));var attributes=require(_0xfda4('0x8'));module[_0xfda4('0x9')]=function(_0x1757d1,_0x3d73db){return _0x1757d1[_0xfda4('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xfda4('0xb'),'paranoid':![],'indexes':[{'fields':[_0xfda4('0xc'),_0xfda4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index a91d8b0..bc7669f 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x21383b,_0x5158af){var _0x1e55ed=function(_0x3bbc5d){while(--_0x3bbc5d){_0x21383b['push'](_0x21383b['shift']());}};_0x1e55ed(++_0x5158af);}(_0x814b,0x1a2));var _0xb814=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x814b[_0x1ad926];return _0x1b81dc;};'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')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x410b6a,_0x505cb3){var _0x44e11d=function(_0x543712){while(--_0x543712){_0x410b6a['push'](_0x410b6a['shift']());}};_0x44e11d(++_0x505cb3);}(_0x7a54,0x106));var _0x47a5=function(_0x42318b,_0x2e033b){_0x42318b=_0x42318b-0x0;var _0x2ece27=_0x7a54[_0x42318b];return _0x2ece27;};'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')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 093ae2e..1ebc833 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 _0x71fe=['describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe'];(function(_0xc4891,_0x5b95eb){var _0x15225b=function(_0x52db55){while(--_0x52db55){_0xc4891['push'](_0xc4891['shift']());}};_0x15225b(++_0x5b95eb);}(_0x71fe,0xaa));var _0xe71f=function(_0x1db6e1,_0x79416c){_0x1db6e1=_0x1db6e1-0x0;var _0x262d7c=_0x71fe[_0x1db6e1];return _0x262d7c;};'use strict';var multer=require(_0xe71f('0x0'));var util=require(_0xe71f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe71f('0x2'));var router=express[_0xe71f('0x3')]();var auth=require(_0xe71f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe71f('0x5'));var controller=require(_0xe71f('0x6'));router[_0xe71f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe71f('0x8')]);router[_0xe71f('0x7')](_0xe71f('0x9'),auth['isAuthenticated'](),controller[_0xe71f('0xa')]);router['get'](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0xd')]);router[_0xe71f('0xe')]('/',auth[_0xe71f('0xc')](),controller['create']);router[_0xe71f('0xf')](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0x10')]);router[_0xe71f('0x11')](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0x12')]);module[_0xe71f('0x13')]=router; \ No newline at end of file +var _0x8801=['get','isAuthenticated','index','/describe','show','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10b975,_0xc0742c){var _0x42bbc8=function(_0x13ac57){while(--_0x13ac57){_0x10b975['push'](_0x10b975['shift']());}};_0x42bbc8(++_0xc0742c);}(_0x8801,0x15f));var _0x1880=function(_0x2263db,_0x4a8c53){_0x2263db=_0x2263db-0x0;var _0x28a9e5=_0x8801[_0x2263db];return _0x28a9e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1880('0x0'));var timeout=require(_0x1880('0x1'));var express=require(_0x1880('0x2'));var router=express[_0x1880('0x3')]();var auth=require(_0x1880('0x4'));var interaction=require(_0x1880('0x5'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router[_0x1880('0x6')]('/',auth[_0x1880('0x7')](),controller[_0x1880('0x8')]);router[_0x1880('0x6')](_0x1880('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1880('0x6')]('/:id',auth[_0x1880('0x7')](),controller[_0x1880('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x1880('0xb')](_0x1880('0xc'),auth[_0x1880('0x7')](),controller[_0x1880('0xd')]);router[_0x1880('0xe')]('/:id',auth[_0x1880('0x7')](),controller[_0x1880('0xf')]);module[_0x1880('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 89e9e52..06757a4 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 _0xe740=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x3b5964,_0x2f21c4){var _0xbc8296=function(_0x1f0789){while(--_0x1f0789){_0x3b5964['push'](_0x3b5964['shift']());}};_0xbc8296(++_0x2f21c4);}(_0xe740,0x1a9));var _0x0e74=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xe740[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x0e74('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0e74('0x1')](_0x0e74('0x2'),_0x0e74('0x3'),_0x0e74('0x4'),_0x0e74('0x5'),_0x0e74('0x6'),_0x0e74('0x7'))},'tag':{'type':Sequelize[_0x0e74('0x8')]},'accountcode':{'type':Sequelize[_0x0e74('0x8')]},'source':{'type':Sequelize[_0x0e74('0x8')]},'destination':{'type':Sequelize[_0x0e74('0x8')]},'destinationcontext':{'type':Sequelize[_0x0e74('0x8')]},'callerid':{'type':Sequelize[_0x0e74('0x8')]},'channel':{'type':Sequelize[_0x0e74('0x8')]},'destinationchannel':{'type':Sequelize[_0x0e74('0x8')]},'lastapplication':{'type':Sequelize[_0x0e74('0x8')]},'lastdata':{'type':Sequelize[_0x0e74('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0e74('0xa')]},'answertime':{'type':Sequelize[_0x0e74('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x0e74('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0e74('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0e74('0x8')]},'amaflags':{'type':Sequelize[_0x0e74('0x8')]},'userfield':{'type':Sequelize[_0x0e74('0x8')]},'userDisposition':{'type':Sequelize[_0x0e74('0x8')]},'note':{'type':Sequelize[_0x0e74('0x8')]},'prefix':{'type':Sequelize[_0x0e74('0x8')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf958=['outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','internal','inbound-fax'];(function(_0x11ae72,_0x52e8da){var _0xcacb7e=function(_0x4a5b4a){while(--_0x4a5b4a){_0x11ae72['push'](_0x11ae72['shift']());}};_0xcacb7e(++_0x52e8da);}(_0xf958,0x1e9));var _0x8f95=function(_0x37eec6,_0x42111d){_0x37eec6=_0x37eec6-0x0;var _0x531cfb=_0xf958[_0x37eec6];return _0x531cfb;};'use strict';var Sequelize=require(_0x8f95('0x0'));module[_0x8f95('0x1')]={'uniqueid':{'type':Sequelize[_0x8f95('0x2')]},'type':{'type':Sequelize['ENUM'](_0x8f95('0x3'),_0x8f95('0x4'),'outbound',_0x8f95('0x5'),_0x8f95('0x6'),_0x8f95('0x7'))},'tag':{'type':Sequelize[_0x8f95('0x2')]},'accountcode':{'type':Sequelize[_0x8f95('0x2')]},'source':{'type':Sequelize[_0x8f95('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x8f95('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8f95('0x2')]},'destinationchannel':{'type':Sequelize[_0x8f95('0x2')]},'lastapplication':{'type':Sequelize[_0x8f95('0x2')]},'lastdata':{'type':Sequelize[_0x8f95('0x8')]},'starttime':{'type':Sequelize[_0x8f95('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8f95('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8f95('0xa')]},'billableseconds':{'type':Sequelize[_0x8f95('0xa')]},'mohtime':{'type':Sequelize[_0x8f95('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8f95('0x2')]},'userfield':{'type':Sequelize[_0x8f95('0x2')]},'userDisposition':{'type':Sequelize[_0x8f95('0x2')]},'note':{'type':Sequelize[_0x8f95('0x2')]},'prefix':{'type':Sequelize[_0x8f95('0x2')]},'routeid':{'type':Sequelize[_0x8f95('0xa')]},'sipcallid':{'type':Sequelize[_0x8f95('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 98dd117..747be80 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 _0xd9fb=['includeAll','include','alias','User','rows','catch','find','create','params','describe','uniqueid','body','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','VoiceCallReport'];(function(_0x1319c7,_0x55b9d8){var _0x4a6dca=function(_0x144739){while(--_0x144739){_0x1319c7['push'](_0x1319c7['shift']());}};_0x4a6dca(++_0x55b9d8);}(_0xd9fb,0x189));var _0xbd9f=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xd9fb[_0x2f3848];return _0x102668;};'use strict';var pdf=require(_0xbd9f('0x0'));var emlformat=require(_0xbd9f('0x1'));var rimraf=require(_0xbd9f('0x2'));var zipdir=require(_0xbd9f('0x3'));var jsonpatch=require(_0xbd9f('0x4'));var rp=require(_0xbd9f('0x5'));var moment=require(_0xbd9f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xbd9f('0x7'));var util=require(_0xbd9f('0x8'));var path=require('path');var sox=require(_0xbd9f('0x9'));var csv=require('to-csv');var ejs=require(_0xbd9f('0xa'));var fs=require('fs');var _=require(_0xbd9f('0xb'));var squel=require('squel');var crypto=require(_0xbd9f('0xc'));var jsforce=require(_0xbd9f('0xd'));var deskjs=require(_0xbd9f('0xe'));var toCsv=require(_0xbd9f('0xf'));var querystring=require('querystring');var Papa=require(_0xbd9f('0x10'));var Redis=require(_0xbd9f('0x11'));var authService=require(_0xbd9f('0x12'));var qs=require(_0xbd9f('0x13'));var hardwareService=require(_0xbd9f('0x14'));var logger=require(_0xbd9f('0x15'))(_0xbd9f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x513cdc,_0x135923){_0x135923=_0x135923||0xcc;return function(_0x5e800a){if(_0x5e800a){return _0x513cdc[_0xbd9f('0x17')](_0x135923);}return _0x513cdc[_0xbd9f('0x18')](_0x135923)[_0xbd9f('0x19')]();};}function respondWithResult(_0x530513,_0x1430fc){_0x1430fc=_0x1430fc||0xc8;return function(_0x5beefe){if(_0x5beefe){return _0x530513[_0xbd9f('0x18')](_0x1430fc)[_0xbd9f('0x1a')](_0x5beefe);}};}function respondWithFilteredResult(_0x91c2bc,_0x1c6ade){return function(_0x5ec72a){if(_0x5ec72a){var _0x442253=_0x5ec72a[_0xbd9f('0x1b')],_0x25557f=_0x1c6ade[_0xbd9f('0x1c')],_0x104cfd=_0x1c6ade[_0xbd9f('0x1c')]+_0x1c6ade['limit'],_0x1deb0f;if(_0x104cfd>=_0x442253){_0x104cfd=_0x442253;_0x1deb0f=0xc8;}else{_0x1deb0f=0xce;}_0x91c2bc['status'](_0x1deb0f);return _0x91c2bc[_0xbd9f('0x1d')]('Content-Range',_0x25557f+'-'+_0x104cfd+'/'+_0x442253)[_0xbd9f('0x1a')](_0x5ec72a);}return null;};}function patchUpdates(_0x3cc2ce){return function(_0x1b78d0){try{jsonpatch[_0xbd9f('0x1e')](_0x1b78d0,_0x3cc2ce,!![]);}catch(_0x2c276b){return BPromise[_0xbd9f('0x1f')](_0x2c276b);}return _0x1b78d0[_0xbd9f('0x20')]();};}function saveUpdates(_0xe82e22,_0x5af956){return function(_0x365775){if(_0x365775){return _0x365775[_0xbd9f('0x21')](_0xe82e22)[_0xbd9f('0x22')](function(_0x144051){return _0x144051;});}return null;};}function removeEntity(_0x17bc1d,_0x135f49){return function(_0x5f7881){if(_0x5f7881){return _0x5f7881[_0xbd9f('0x23')]()[_0xbd9f('0x22')](function(){_0x17bc1d[_0xbd9f('0x18')](0xcc)[_0xbd9f('0x19')]();});}};}function handleEntityNotFound(_0x4e929d,_0x3bde09){return function(_0x10697a){if(!_0x10697a){_0x4e929d[_0xbd9f('0x17')](0x194);}return _0x10697a;};}function handleError(_0x18b387,_0x5d74e0){_0x5d74e0=_0x5d74e0||0x1f4;return function(_0x3e0ba5){logger[_0xbd9f('0x24')](_0x3e0ba5[_0xbd9f('0x25')]);if(_0x3e0ba5[_0xbd9f('0x26')]){delete _0x3e0ba5[_0xbd9f('0x26')];}_0x18b387[_0xbd9f('0x18')](_0x5d74e0)[_0xbd9f('0x27')](_0x3e0ba5);};}exports['index']=function(_0xd89fc2,_0xd54e7c){var _0xa46ce3={},_0x892315={},_0x25a5c8={'count':0x0,'rows':[]};var _0x5ac251=db['VoiceCallReport'][_0xbd9f('0x28')];_0x892315[_0xbd9f('0x29')]=_[_0xbd9f('0x2a')](_0x5ac251);_0x892315['query']=_[_0xbd9f('0x2a')](_0xd89fc2[_0xbd9f('0x2b')]);_0x892315[_0xbd9f('0x2c')]=_['intersection'](_0x892315[_0xbd9f('0x29')],_0x892315[_0xbd9f('0x2b')]);_0xa46ce3[_0xbd9f('0x2d')]=_[_0xbd9f('0x2e')](_0x892315[_0xbd9f('0x29')],qs[_0xbd9f('0x2f')](_0xd89fc2[_0xbd9f('0x2b')]['fields']));_0xa46ce3['attributes']=_0xa46ce3[_0xbd9f('0x2d')][_0xbd9f('0x30')]?_0xa46ce3[_0xbd9f('0x2d')]:_0x892315[_0xbd9f('0x29')];if(!_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x31')](_0xbd9f('0x32'))){_0xa46ce3[_0xbd9f('0x33')]=qs[_0xbd9f('0x33')](_0xd89fc2['query']['limit']);_0xa46ce3[_0xbd9f('0x1c')]=qs['offset'](_0xd89fc2['query'][_0xbd9f('0x1c')]);}_0xa46ce3[_0xbd9f('0x34')]=qs[_0xbd9f('0x35')](_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x35')]);_0xa46ce3[_0xbd9f('0x36')]=qs[_0xbd9f('0x2c')](_[_0xbd9f('0x37')](_0xd89fc2['query'],_0x892315[_0xbd9f('0x2c')]));if(_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x38')]){_0xa46ce3['where']=_['merge'](_0xa46ce3[_0xbd9f('0x36')],{'$or':_[_0xbd9f('0x39')](_0x5ac251,function(_0x505d00){if(_0x505d00[_0xbd9f('0x3a')]['key']!==_0xbd9f('0x3b')){var _0x2483e2={};_0x2483e2[_0x505d00[_0xbd9f('0x3c')]]={'$like':'%'+_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x38')]+'%'};return _0x2483e2;}})});}_0xa46ce3=_['merge']({},_0xa46ce3,_0xd89fc2[_0xbd9f('0x3d')]);var _0x2c9943={'where':_0xa46ce3['where']};return db[_0xbd9f('0x3e')][_0xbd9f('0x1b')](_0x2c9943)[_0xbd9f('0x22')](function(_0x1aa397){_0x25a5c8['count']=_0x1aa397;if(_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x3f')]){_0xa46ce3[_0xbd9f('0x40')]=[{'attributes':['id',_0xbd9f('0x26'),'fullname',_0xbd9f('0x41')],'model':db[_0xbd9f('0x42')],'as':_0xbd9f('0x42')}];}return db[_0xbd9f('0x3e')]['findAll'](_0xa46ce3);})['then'](function(_0x39eb9e){_0x25a5c8[_0xbd9f('0x43')]=_0x39eb9e;return _0x25a5c8;})['then'](respondWithFilteredResult(_0xd54e7c,_0xa46ce3))[_0xbd9f('0x44')](handleError(_0xd54e7c,null));};exports['show']=function(_0x3e6caf,_0x47a5b4){var _0x32395e={'raw':!![],'where':{'id':_0x3e6caf['params']['id']}},_0x342ada={};_0x342ada['model']=_['keys'](db[_0xbd9f('0x3e')][_0xbd9f('0x28')]);_0x342ada['query']=_['keys'](_0x3e6caf[_0xbd9f('0x2b')]);_0x342ada[_0xbd9f('0x2c')]=_[_0xbd9f('0x2e')](_0x342ada[_0xbd9f('0x29')],_0x342ada['query']);_0x32395e[_0xbd9f('0x2d')]=_[_0xbd9f('0x2e')](_0x342ada[_0xbd9f('0x29')],qs[_0xbd9f('0x2f')](_0x3e6caf[_0xbd9f('0x2b')]['fields']));_0x32395e[_0xbd9f('0x2d')]=_0x32395e[_0xbd9f('0x2d')][_0xbd9f('0x30')]?_0x32395e[_0xbd9f('0x2d')]:_0x342ada['model'];if(_0x3e6caf[_0xbd9f('0x2b')][_0xbd9f('0x3f')]){_0x32395e[_0xbd9f('0x40')]=[{'all':!![]}];}_0x32395e=_['merge']({},_0x32395e,_0x3e6caf['options']);return db[_0xbd9f('0x3e')][_0xbd9f('0x45')](_0x32395e)[_0xbd9f('0x22')](handleEntityNotFound(_0x47a5b4,null))[_0xbd9f('0x22')](respondWithResult(_0x47a5b4,null))['catch'](handleError(_0x47a5b4,null));};exports[_0xbd9f('0x46')]=function(_0x174125,_0x11ad68){return db[_0xbd9f('0x3e')]['create'](_0x174125['body'],{})[_0xbd9f('0x22')](respondWithResult(_0x11ad68,0xc9))[_0xbd9f('0x44')](handleError(_0x11ad68,null));};exports[_0xbd9f('0x23')]=function(_0x585065,_0x381646){return db[_0xbd9f('0x3e')][_0xbd9f('0x45')]({'where':{'id':_0x585065[_0xbd9f('0x47')]['id']}})[_0xbd9f('0x22')](handleEntityNotFound(_0x381646,null))[_0xbd9f('0x22')](removeEntity(_0x381646,null))[_0xbd9f('0x44')](handleError(_0x381646,null));};exports[_0xbd9f('0x48')]=function(_0xcaa162,_0x3e4c37){return db[_0xbd9f('0x3e')][_0xbd9f('0x48')]()[_0xbd9f('0x22')](respondWithResult(_0x3e4c37,null))[_0xbd9f('0x44')](handleError(_0x3e4c37,null));};exports[_0xbd9f('0x21')]=function(_0x53dd0d,_0x14ac76){if(_0x53dd0d['body'][_0xbd9f('0x49')]){delete _0x53dd0d[_0xbd9f('0x4a')]['uniqueid'];}return db['VoiceCallReport'][_0xbd9f('0x45')]({'where':{'uniqueid':_0x53dd0d[_0xbd9f('0x47')]['id'],'UserId':{'$or':[null,_0x53dd0d[_0xbd9f('0x4b')]['id']]}}})[_0xbd9f('0x22')](handleEntityNotFound(_0x14ac76,null))[_0xbd9f('0x22')](saveUpdates(_0x53dd0d[_0xbd9f('0x4a')],null))[_0xbd9f('0x22')](respondWithResult(_0x14ac76,null))[_0xbd9f('0x44')](handleError(_0x14ac76,null));}; \ No newline at end of file +var _0x6011=['status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','type','field','options','VoiceCallReport','count','fullname','alias','User','findAll','rows','catch','show','includeAll','find','create','body','params','describe','uniqueid','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4e0f70,_0x870a71){var _0x460281=function(_0x3f4a9f){while(--_0x3f4a9f){_0x4e0f70['push'](_0x4e0f70['shift']());}};_0x460281(++_0x870a71);}(_0x6011,0x196));var _0x1601=function(_0x3daa91,_0x199f26){_0x3daa91=_0x3daa91-0x0;var _0x4c14c0=_0x6011[_0x3daa91];return _0x4c14c0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1601('0x0'));var moment=require(_0x1601('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x1601('0x2'));var util=require(_0x1601('0x3'));var path=require(_0x1601('0x4'));var sox=require(_0x1601('0x5'));var csv=require(_0x1601('0x6'));var ejs=require(_0x1601('0x7'));var fs=require('fs');var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x6'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1601('0x10'));var utils=require('../../config/utils');var config=require(_0x1601('0x11'));var db=require(_0x1601('0x12'))['db'];function respondWithStatusCode(_0x14db9f,_0x24cc39){_0x24cc39=_0x24cc39||0xcc;return function(_0x263bef){if(_0x263bef){return _0x14db9f[_0x1601('0x13')](_0x24cc39);}return _0x14db9f[_0x1601('0x14')](_0x24cc39)[_0x1601('0x15')]();};}function respondWithResult(_0x5da646,_0x11bbe5){_0x11bbe5=_0x11bbe5||0xc8;return function(_0x555d4f){if(_0x555d4f){return _0x5da646[_0x1601('0x14')](_0x11bbe5)['json'](_0x555d4f);}};}function respondWithFilteredResult(_0x2f0837,_0x3b6554){return function(_0x4bb5c1){if(_0x4bb5c1){var _0x1b40be=_0x4bb5c1['count'],_0x39873a=_0x3b6554[_0x1601('0x16')],_0x12ddb0=_0x3b6554[_0x1601('0x16')]+_0x3b6554[_0x1601('0x17')],_0x595c96;if(_0x12ddb0>=_0x1b40be){_0x12ddb0=_0x1b40be;_0x595c96=0xc8;}else{_0x595c96=0xce;}_0x2f0837[_0x1601('0x14')](_0x595c96);return _0x2f0837[_0x1601('0x18')](_0x1601('0x19'),_0x39873a+'-'+_0x12ddb0+'/'+_0x1b40be)[_0x1601('0x1a')](_0x4bb5c1);}return null;};}function patchUpdates(_0x3ae0c6){return function(_0x1ce2b2){try{jsonpatch['apply'](_0x1ce2b2,_0x3ae0c6,!![]);}catch(_0x4d077e){return BPromise[_0x1601('0x1b')](_0x4d077e);}return _0x1ce2b2[_0x1601('0x1c')]();};}function saveUpdates(_0xb09057,_0x5bd8fb){return function(_0x2c3b5d){if(_0x2c3b5d){return _0x2c3b5d[_0x1601('0x1d')](_0xb09057)[_0x1601('0x1e')](function(_0x2e2e0d){return _0x2e2e0d;});}return null;};}function removeEntity(_0x3fa19f,_0x54398a){return function(_0x1b8314){if(_0x1b8314){return _0x1b8314[_0x1601('0x1f')]()[_0x1601('0x1e')](function(){_0x3fa19f['status'](0xcc)[_0x1601('0x15')]();});}};}function handleEntityNotFound(_0x330033,_0x4f918b){return function(_0x2b01da){if(!_0x2b01da){_0x330033[_0x1601('0x13')](0x194);}return _0x2b01da;};}function handleError(_0x5c9543,_0x5ae062){_0x5ae062=_0x5ae062||0x1f4;return function(_0x65fb4f){logger[_0x1601('0x20')](_0x65fb4f[_0x1601('0x21')]);if(_0x65fb4f['name']){delete _0x65fb4f[_0x1601('0x22')];}_0x5c9543[_0x1601('0x14')](_0x5ae062)[_0x1601('0x23')](_0x65fb4f);};}exports[_0x1601('0x24')]=function(_0x296c34,_0x47ed39){var _0x4b2f0d={},_0x1fa0a6={},_0x1aef35={'count':0x0,'rows':[]};var _0x18509c=db['VoiceCallReport'][_0x1601('0x25')];_0x1fa0a6['model']=_[_0x1601('0x26')](_0x18509c);_0x1fa0a6[_0x1601('0x27')]=_[_0x1601('0x26')](_0x296c34['query']);_0x1fa0a6[_0x1601('0x28')]=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],_0x1fa0a6[_0x1601('0x27')]);_0x4b2f0d['attributes']=_[_0x1601('0x29')](_0x1fa0a6[_0x1601('0x2a')],qs[_0x1601('0x2b')](_0x296c34[_0x1601('0x27')][_0x1601('0x2b')]));_0x4b2f0d[_0x1601('0x2c')]=_0x4b2f0d[_0x1601('0x2c')][_0x1601('0x2d')]?_0x4b2f0d[_0x1601('0x2c')]:_0x1fa0a6[_0x1601('0x2a')];if(!_0x296c34[_0x1601('0x27')][_0x1601('0x2e')](_0x1601('0x2f'))){_0x4b2f0d['limit']=qs[_0x1601('0x17')](_0x296c34[_0x1601('0x27')][_0x1601('0x17')]);_0x4b2f0d[_0x1601('0x16')]=qs[_0x1601('0x16')](_0x296c34['query'][_0x1601('0x16')]);}_0x4b2f0d[_0x1601('0x30')]=qs['sort'](_0x296c34[_0x1601('0x27')]['sort']);_0x4b2f0d[_0x1601('0x31')]=qs[_0x1601('0x28')](_['pick'](_0x296c34[_0x1601('0x27')],_0x1fa0a6[_0x1601('0x28')]));if(_0x296c34[_0x1601('0x27')][_0x1601('0x32')]){_0x4b2f0d[_0x1601('0x31')]=_[_0x1601('0x33')](_0x4b2f0d[_0x1601('0x31')],{'$or':_['map'](_0x18509c,function(_0x39da55){if(_0x39da55[_0x1601('0x34')]['key']!=='VIRTUAL'){var _0x431439={};_0x431439[_0x39da55[_0x1601('0x35')]]={'$like':'%'+_0x296c34[_0x1601('0x27')][_0x1601('0x32')]+'%'};return _0x431439;}})});}_0x4b2f0d=_[_0x1601('0x33')]({},_0x4b2f0d,_0x296c34[_0x1601('0x36')]);var _0x36d496={'where':_0x4b2f0d['where']};return db[_0x1601('0x37')][_0x1601('0x38')](_0x36d496)['then'](function(_0x5c79d2){_0x1aef35[_0x1601('0x38')]=_0x5c79d2;if(_0x296c34['query']['includeAll']){_0x4b2f0d['include']=[{'attributes':['id',_0x1601('0x22'),_0x1601('0x39'),_0x1601('0x3a')],'model':db[_0x1601('0x3b')],'as':_0x1601('0x3b')}];}return db[_0x1601('0x37')][_0x1601('0x3c')](_0x4b2f0d);})[_0x1601('0x1e')](function(_0x388f3b){_0x1aef35[_0x1601('0x3d')]=_0x388f3b;return _0x1aef35;})[_0x1601('0x1e')](respondWithFilteredResult(_0x47ed39,_0x4b2f0d))[_0x1601('0x3e')](handleError(_0x47ed39,null));};exports[_0x1601('0x3f')]=function(_0x50a517,_0x44ae24){var _0x47dddd={'raw':!![],'where':{'id':_0x50a517['params']['id']}},_0x5acf66={};_0x5acf66[_0x1601('0x2a')]=_[_0x1601('0x26')](db[_0x1601('0x37')]['rawAttributes']);_0x5acf66['query']=_[_0x1601('0x26')](_0x50a517[_0x1601('0x27')]);_0x5acf66[_0x1601('0x28')]=_['intersection'](_0x5acf66[_0x1601('0x2a')],_0x5acf66['query']);_0x47dddd[_0x1601('0x2c')]=_[_0x1601('0x29')](_0x5acf66[_0x1601('0x2a')],qs[_0x1601('0x2b')](_0x50a517['query'][_0x1601('0x2b')]));_0x47dddd['attributes']=_0x47dddd[_0x1601('0x2c')][_0x1601('0x2d')]?_0x47dddd['attributes']:_0x5acf66[_0x1601('0x2a')];if(_0x50a517[_0x1601('0x27')][_0x1601('0x40')]){_0x47dddd['include']=[{'all':!![]}];}_0x47dddd=_[_0x1601('0x33')]({},_0x47dddd,_0x50a517['options']);return db[_0x1601('0x37')][_0x1601('0x41')](_0x47dddd)[_0x1601('0x1e')](handleEntityNotFound(_0x44ae24,null))[_0x1601('0x1e')](respondWithResult(_0x44ae24,null))[_0x1601('0x3e')](handleError(_0x44ae24,null));};exports[_0x1601('0x42')]=function(_0x3c2f96,_0x2bccd0){return db[_0x1601('0x37')]['create'](_0x3c2f96[_0x1601('0x43')],{})['then'](respondWithResult(_0x2bccd0,0xc9))[_0x1601('0x3e')](handleError(_0x2bccd0,null));};exports[_0x1601('0x1f')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x37')]['find']({'where':{'id':_0x4a8039[_0x1601('0x44')]['id']}})[_0x1601('0x1e')](handleEntityNotFound(_0xbaeefc,null))[_0x1601('0x1e')](removeEntity(_0xbaeefc,null))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x45')]=function(_0xf14c98,_0x2b422c){return db[_0x1601('0x37')][_0x1601('0x45')]()[_0x1601('0x1e')](respondWithResult(_0x2b422c,null))['catch'](handleError(_0x2b422c,null));};exports[_0x1601('0x1d')]=function(_0x4b6f90,_0x354deb){if(_0x4b6f90[_0x1601('0x43')][_0x1601('0x46')]){delete _0x4b6f90['body']['uniqueid'];}return db[_0x1601('0x37')][_0x1601('0x41')]({'where':{'uniqueid':_0x4b6f90['params']['id'],'UserId':{'$or':[null,_0x4b6f90['user']['id']]}}})['then'](handleEntityNotFound(_0x354deb,null))[_0x1601('0x1e')](saveUpdates(_0x4b6f90['body'],null))[_0x1601('0x1e')](respondWithResult(_0x354deb,null))[_0x1601('0x3e')](handleError(_0x354deb,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3348bc4..48185f0 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 _0xc01e=['bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','uniqueid','lodash','util','../../config/logger'];(function(_0x5a3af,_0x5a9f06){var _0x2c54f2=function(_0x3335af){while(--_0x3335af){_0x5a3af['push'](_0x5a3af['shift']());}};_0x2c54f2(++_0x5a9f06);}(_0xc01e,0x1f1));var _0xec01=function(_0x348885,_0x13a871){_0x348885=_0x348885-0x0;var _0x7c01ef=_0xc01e[_0x348885];return _0x7c01ef;};'use strict';var _=require(_0xec01('0x0'));var util=require(_0xec01('0x1'));var logger=require(_0xec01('0x2'))('api');var moment=require('moment');var BPromise=require(_0xec01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec01('0x4'));var rimraf=require(_0xec01('0x5'));var config=require(_0xec01('0x6'));var attributes=require(_0xec01('0x7'));module[_0xec01('0x8')]=function(_0x54d1ad,_0x1841c2){return _0x54d1ad['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xec01('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa418=['define','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x2da690,_0x555497){var _0x2e9697=function(_0x36f859){while(--_0x36f859){_0x2da690['push'](_0x2da690['shift']());}};_0x2e9697(++_0x555497);}(_0xa418,0x153));var _0x8a41=function(_0x104999,_0xe4a670){_0x104999=_0x104999-0x0;var _0x1c9492=_0xa418[_0x104999];return _0x1c9492;};'use strict';var _=require('lodash');var util=require(_0x8a41('0x0'));var logger=require(_0x8a41('0x1'))(_0x8a41('0x2'));var moment=require(_0x8a41('0x3'));var BPromise=require(_0x8a41('0x4'));var rp=require(_0x8a41('0x5'));var fs=require('fs');var path=require(_0x8a41('0x6'));var rimraf=require(_0x8a41('0x7'));var config=require(_0x8a41('0x8'));var attributes=require(_0x8a41('0x9'));module[_0x8a41('0xa')]=function(_0x35efe7,_0x260c82){return _0x35efe7[_0x8a41('0xb')]('VoiceCallReport',attributes,{'tableName':_0x8a41('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8a41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ecd1cd2..3aa7000 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 _0x1a85=['../../config/logger','rpc','client','request','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceCallReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','CreateVoiceCallReport','VoiceCallReport','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3d6941,_0x543ea6){var _0x590de9=function(_0x2ac022){while(--_0x2ac022){_0x3d6941['push'](_0x3d6941['shift']());}};_0x590de9(++_0x543ea6);}(_0x1a85,0x170));var _0x51a8=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x1a85[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x51a8('0x0'));var util=require(_0x51a8('0x1'));var moment=require('moment');var BPromise=require(_0x51a8('0x2'));var rs=require(_0x51a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51a8('0x4'))['db'];var utils=require(_0x51a8('0x5'));var logger=require(_0x51a8('0x6'))(_0x51a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb575b,_0x3c851a,_0x3faf3f){return new BPromise(function(_0xbb3677,_0x2ab0fe){return client[_0x51a8('0x9')](_0xcb575b,_0x3faf3f)['then'](function(_0x239960){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,'request\x20sent');logger['debug'](_0x51a8('0xa'),_0x3c851a,_0x51a8('0xb'),JSON['stringify'](_0x239960));if(_0x239960[_0x51a8('0xc')]){if(_0x239960[_0x51a8('0xc')]['code']===0x1f4){logger[_0x51a8('0xc')](_0x51a8('0xd'),_0x3c851a,_0x239960['error'][_0x51a8('0xe')]);return _0x2ab0fe(_0x239960[_0x51a8('0xc')][_0x51a8('0xe')]);}logger[_0x51a8('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,_0x239960[_0x51a8('0xc')][_0x51a8('0xe')]);return _0xbb3677(_0x239960['error'][_0x51a8('0xe')]);}else{logger[_0x51a8('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,_0x51a8('0xb'));_0xbb3677(_0x239960[_0x51a8('0x10')][_0x51a8('0xe')]);}})[_0x51a8('0x11')](function(_0x2c0122){logger[_0x51a8('0xc')](_0x51a8('0xd'),_0x3c851a,_0x2c0122);_0x2ab0fe(_0x2c0122);});});}exports[_0x51a8('0x12')]=function(_0x140931){var _0x3b0fd4=this;return new Promise(function(_0x58ba50,_0x4a00c2){return db['VoiceCallReport'][_0x51a8('0x13')]({'raw':_0x140931['options']?_0x140931[_0x51a8('0x14')][_0x51a8('0x15')]===undefined?!![]:![]:!![],'where':_0x140931[_0x51a8('0x14')]?_0x140931[_0x51a8('0x14')][_0x51a8('0x16')]||null:null,'attributes':_0x140931['options']?_0x140931[_0x51a8('0x14')][_0x51a8('0x17')]||null:null,'limit':_0x140931[_0x51a8('0x14')]?_0x140931[_0x51a8('0x14')][_0x51a8('0x18')]||null:null,'include':_0x140931[_0x51a8('0x14')]?_0x140931['options'][_0x51a8('0x19')]?_['map'](_0x140931[_0x51a8('0x14')][_0x51a8('0x19')],function(_0xb7e940){return{'model':db[_0xb7e940['model']],'as':_0xb7e940['as'],'attributes':_0xb7e940['attributes'],'include':_0xb7e940[_0x51a8('0x19')]?_[_0x51a8('0x1a')](_0xb7e940[_0x51a8('0x19')],function(_0x3a7ac5){return{'model':db[_0x3a7ac5[_0x51a8('0x1b')]],'as':_0x3a7ac5['as'],'attributes':_0x3a7ac5[_0x51a8('0x17')],'include':_0x3a7ac5[_0x51a8('0x19')]?_[_0x51a8('0x1a')](_0x3a7ac5[_0x51a8('0x19')],function(_0xf503f8){return{'model':db[_0xf503f8['model']],'as':_0xf503f8['as'],'attributes':_0xf503f8[_0x51a8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1c')](function(_0x556658){logger[_0x51a8('0xf')]('GetVoiceCallReport',_0x140931);logger[_0x51a8('0x1d')](_0x51a8('0x12'),_0x140931,JSON[_0x51a8('0x1e')](_0x556658));_0x58ba50(_0x556658);})[_0x51a8('0x11')](function(_0x4fc148){logger[_0x51a8('0xc')](_0x51a8('0x12'),_0x4fc148[_0x51a8('0xe')],_0x140931);_0x4a00c2(_0x3b0fd4['error'](0x1f4,_0x4fc148['message']));});});};exports[_0x51a8('0x1f')]=function(_0x35af62){var _0x28fb3c=this;return new Promise(function(_0xac53e8,_0x270e10){return db[_0x51a8('0x20')]['create'](_0x35af62['body'],{'raw':_0x35af62['options']?_0x35af62[_0x51a8('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4313c7){logger[_0x51a8('0xf')]('CreateVoiceCallReport',_0x35af62);logger['debug'](_0x51a8('0x1f'),_0x35af62,JSON['stringify'](_0x4313c7));_0xac53e8(_0x4313c7);})[_0x51a8('0x11')](function(_0x5169f6){logger[_0x51a8('0xc')](_0x51a8('0x1f'),_0x5169f6[_0x51a8('0xe')],_0x35af62);_0x270e10(_0x28fb3c['error'](0x1f4,_0x5169f6[_0x51a8('0xe')]));});});};exports[_0x51a8('0x21')]=function(_0x4fea28){var _0x40a9a3=this;return new Promise(function(_0x5421c1,_0x20cea8){return db['VoiceCallReport']['update'](_0x4fea28['body'],{'raw':_0x4fea28['options']?_0x4fea28[_0x51a8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fea28[_0x51a8('0x14')]?_0x4fea28[_0x51a8('0x14')][_0x51a8('0x16')]||null:null,'attributes':_0x4fea28[_0x51a8('0x14')]?_0x4fea28['options'][_0x51a8('0x17')]||null:null,'limit':_0x4fea28[_0x51a8('0x14')]?_0x4fea28[_0x51a8('0x14')][_0x51a8('0x18')]||null:null})[_0x51a8('0x1c')](function(_0x512be3){logger[_0x51a8('0xf')](_0x51a8('0x21'),_0x4fea28);logger[_0x51a8('0x1d')](_0x51a8('0x21'),_0x4fea28,JSON[_0x51a8('0x1e')](_0x512be3));_0x5421c1(_0x512be3);})[_0x51a8('0x11')](function(_0x21957d){logger[_0x51a8('0xc')](_0x51a8('0x21'),_0x21957d[_0x51a8('0xe')],_0x4fea28);_0x20cea8(_0x40a9a3[_0x51a8('0xc')](0x1f4,_0x21957d[_0x51a8('0xe')]));});});}; \ No newline at end of file +var _0x5f85=['code','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','options','raw','where','attributes','map','include','model','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','VoiceCallReport','update','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','then','info','debug','request\x20sent','stringify','error'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x5f85,0x1b8));var _0x55f8=function(_0x58f629,_0x1e23ff){_0x58f629=_0x58f629-0x0;var _0x55eeb0=_0x5f85[_0x58f629];return _0x55eeb0;};'use strict';var _=require(_0x55f8('0x0'));var util=require(_0x55f8('0x1'));var moment=require(_0x55f8('0x2'));var BPromise=require(_0x55f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x55f8('0x5'));var logger=require('../../config/logger')(_0x55f8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55f8('0x7')][_0x55f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23120b,_0x2ef985,_0x4d8801){return new BPromise(function(_0x337215,_0x1c97a8){return client['request'](_0x23120b,_0x4d8801)[_0x55f8('0x9')](function(_0x537013){logger[_0x55f8('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x2ef985,'request\x20sent');logger[_0x55f8('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2ef985,_0x55f8('0xc'),JSON[_0x55f8('0xd')](_0x537013));if(_0x537013[_0x55f8('0xe')]){if(_0x537013[_0x55f8('0xe')][_0x55f8('0xf')]===0x1f4){logger[_0x55f8('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x2ef985,_0x537013[_0x55f8('0xe')]['message']);return _0x1c97a8(_0x537013['error'][_0x55f8('0x10')]);}logger[_0x55f8('0xe')](_0x55f8('0x11'),_0x2ef985,_0x537013[_0x55f8('0xe')][_0x55f8('0x10')]);return _0x337215(_0x537013[_0x55f8('0xe')][_0x55f8('0x10')]);}else{logger[_0x55f8('0xa')](_0x55f8('0x11'),_0x2ef985,_0x55f8('0xc'));_0x337215(_0x537013[_0x55f8('0x12')][_0x55f8('0x10')]);}})['catch'](function(_0x5ac0a6){logger['error'](_0x55f8('0x11'),_0x2ef985,_0x5ac0a6);_0x1c97a8(_0x5ac0a6);});});}exports[_0x55f8('0x13')]=function(_0x3f2b38){var _0x2d249b=this;return new Promise(function(_0x69bd15,_0x189e9b){return db['VoiceCallReport']['findAll']({'raw':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x15')]===undefined?!![]:![]:!![],'where':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x16')]||null:null,'attributes':_0x3f2b38['options']?_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x17')]||null:null,'limit':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')]['limit']||null:null,'include':_0x3f2b38[_0x55f8('0x14')]?_0x3f2b38[_0x55f8('0x14')]['include']?_[_0x55f8('0x18')](_0x3f2b38[_0x55f8('0x14')][_0x55f8('0x19')],function(_0x408e5c){return{'model':db[_0x408e5c['model']],'as':_0x408e5c['as'],'attributes':_0x408e5c['attributes'],'include':_0x408e5c[_0x55f8('0x19')]?_['map'](_0x408e5c[_0x55f8('0x19')],function(_0x4e38f7){return{'model':db[_0x4e38f7[_0x55f8('0x1a')]],'as':_0x4e38f7['as'],'attributes':_0x4e38f7[_0x55f8('0x17')],'include':_0x4e38f7[_0x55f8('0x19')]?_[_0x55f8('0x18')](_0x4e38f7['include'],function(_0x4d855d){return{'model':db[_0x4d855d[_0x55f8('0x1a')]],'as':_0x4d855d['as'],'attributes':_0x4d855d[_0x55f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x55f8('0x9')](function(_0x5a345f){logger[_0x55f8('0xa')](_0x55f8('0x13'),_0x3f2b38);logger['debug'](_0x55f8('0x13'),_0x3f2b38,JSON[_0x55f8('0xd')](_0x5a345f));_0x69bd15(_0x5a345f);})[_0x55f8('0x1b')](function(_0xc02dac){logger[_0x55f8('0xe')]('GetVoiceCallReport',_0xc02dac[_0x55f8('0x10')],_0x3f2b38);_0x189e9b(_0x2d249b['error'](0x1f4,_0xc02dac[_0x55f8('0x10')]));});});};exports['CreateVoiceCallReport']=function(_0x450c94){var _0x57edeb=this;return new Promise(function(_0x48a3d,_0x3a7f8b){return db['VoiceCallReport'][_0x55f8('0x1c')](_0x450c94[_0x55f8('0x1d')],{'raw':_0x450c94[_0x55f8('0x14')]?_0x450c94[_0x55f8('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x55f8('0x9')](function(_0xdab32){logger[_0x55f8('0xa')]('CreateVoiceCallReport',_0x450c94);logger[_0x55f8('0xb')](_0x55f8('0x1e'),_0x450c94,JSON['stringify'](_0xdab32));_0x48a3d(_0xdab32);})[_0x55f8('0x1b')](function(_0x3a76bf){logger['error'](_0x55f8('0x1e'),_0x3a76bf[_0x55f8('0x10')],_0x450c94);_0x3a7f8b(_0x57edeb[_0x55f8('0xe')](0x1f4,_0x3a76bf[_0x55f8('0x10')]));});});};exports[_0x55f8('0x1f')]=function(_0x5469da){var _0x22487d=this;return new Promise(function(_0x288cb3,_0x5c3be4){return db[_0x55f8('0x20')][_0x55f8('0x21')](_0x5469da['body'],{'raw':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5469da['options']?_0x5469da[_0x55f8('0x14')][_0x55f8('0x16')]||null:null,'attributes':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')][_0x55f8('0x17')]||null:null,'limit':_0x5469da[_0x55f8('0x14')]?_0x5469da[_0x55f8('0x14')][_0x55f8('0x22')]||null:null})['then'](function(_0x55d209){logger[_0x55f8('0xa')]('UpdateVoiceCallReport',_0x5469da);logger[_0x55f8('0xb')](_0x55f8('0x1f'),_0x5469da,JSON[_0x55f8('0xd')](_0x55d209));_0x288cb3(_0x55d209);})['catch'](function(_0xdf6169){logger[_0x55f8('0xe')](_0x55f8('0x1f'),_0xdf6169[_0x55f8('0x10')],_0x5469da);_0x5c3be4(_0x22487d[_0x55f8('0xe')](0x1f4,_0xdf6169['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f60f945..d24bf27 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 _0xa90d=['multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports'];(function(_0x2a960f,_0x5aab73){var _0x5027df=function(_0x13bf75){while(--_0x13bf75){_0x2a960f['push'](_0x2a960f['shift']());}};_0x5027df(++_0x5aab73);}(_0xa90d,0x186));var _0xda90=function(_0x10c899,_0x6d4d75){_0x10c899=_0x10c899-0x0;var _0x2c89d7=_0xa90d[_0x10c899];return _0x2c89d7;};'use strict';var multer=require(_0xda90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda90('0x1'));var express=require('express');var router=express[_0xda90('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xda90('0x3'));var config=require(_0xda90('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xda90('0x5')]('/',auth[_0xda90('0x6')](),controller[_0xda90('0x7')]);router[_0xda90('0x5')](_0xda90('0x8'),auth[_0xda90('0x6')](),controller[_0xda90('0x9')]);router['post']('/',auth[_0xda90('0x6')](),controller[_0xda90('0xa')]);router[_0xda90('0xb')](_0xda90('0x8'),auth[_0xda90('0x6')](),controller[_0xda90('0xc')]);router[_0xda90('0xd')](_0xda90('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xda90('0xe')]=router; \ No newline at end of file +var _0x4098=['./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','Router','../../components/auth/service'];(function(_0xcb259a,_0x37c291){var _0x21e90b=function(_0x1056c9){while(--_0x1056c9){_0xcb259a['push'](_0xcb259a['shift']());}};_0x21e90b(++_0x37c291);}(_0x4098,0x129));var _0x8409=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x4098[_0x1ebb10];return _0x20d709;};'use strict';var multer=require(_0x8409('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8409('0x1')]();var auth=require(_0x8409('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8409('0x3'));router[_0x8409('0x4')]('/',auth['isAuthenticated'](),controller[_0x8409('0x5')]);router[_0x8409('0x4')](_0x8409('0x6'),auth[_0x8409('0x7')](),controller[_0x8409('0x8')]);router[_0x8409('0x9')]('/',auth[_0x8409('0x7')](),controller['create']);router[_0x8409('0xa')]('/:id',auth[_0x8409('0x7')](),controller[_0x8409('0xb')]);router[_0x8409('0xc')](_0x8409('0x6'),auth['isAuthenticated'](),controller[_0x8409('0xd')]);module[_0x8409('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 3f9f745..87fc3df 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 _0xdd49=['STRING','name','options','join','getDataValue','split','BOOLEAN','exports'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xdd49,0x177));var _0x9dd4=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0xdd49[_0x153846];return _0x3ee557;};'use strict';var Sequelize=require('sequelize');module[_0x9dd4('0x0')]={'name':{'type':Sequelize[_0x9dd4('0x1')]},'prefix':{'type':Sequelize[_0x9dd4('0x1')],'unique':_0x9dd4('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x575dc5){this['setDataValue'](_0x9dd4('0x3'),_0x575dc5?_0x575dc5[_0x9dd4('0x4')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x9dd4('0x5')](_0x9dd4('0x3'))[_0x9dd4('0x6')](''):[];}},'auth':{'type':Sequelize[_0x9dd4('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x9dd4('0x1')]},'record':{'type':Sequelize[_0x9dd4('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9dd4('0x1')]},'description':{'type':Sequelize[_0x9dd4('0x1')]}}; \ No newline at end of file +var _0x5807=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x55eef6,_0x1550bb){var _0x367185=function(_0xb24b49){while(--_0xb24b49){_0x55eef6['push'](_0x55eef6['shift']());}};_0x367185(++_0x1550bb);}(_0x5807,0xe8));var _0x7580=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x5807[_0x351509];return _0x4e9861;};'use strict';var Sequelize=require(_0x7580('0x0'));module[_0x7580('0x1')]={'name':{'type':Sequelize[_0x7580('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x7580('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x36567c){this[_0x7580('0x4')](_0x7580('0x5'),_0x36567c?_0x36567c[_0x7580('0x6')](''):[]);},'get':function(){return this[_0x7580('0x7')](_0x7580('0x5'))?this[_0x7580('0x7')](_0x7580('0x5'))[_0x7580('0x8')](''):[];}},'auth':{'type':Sequelize[_0x7580('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x7580('0x2')]},'record':{'type':Sequelize[_0x7580('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4909d34..b1b3152 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 _0x4cbd=['include','findAll','catch','params','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','name','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cbd,0xb2));var _0xd4cb=function(_0x42701f,_0x3d2f90){_0x42701f=_0x42701f-0x0;var _0x36aafb=_0x4cbd[_0x42701f];return _0x36aafb;};'use strict';var pdf=require(_0xd4cb('0x0'));var emlformat=require(_0xd4cb('0x1'));var rimraf=require(_0xd4cb('0x2'));var zipdir=require(_0xd4cb('0x3'));var jsonpatch=require(_0xd4cb('0x4'));var rp=require(_0xd4cb('0x5'));var moment=require('moment');var BPromise=require(_0xd4cb('0x6'));var Mustache=require(_0xd4cb('0x7'));var util=require(_0xd4cb('0x8'));var path=require(_0xd4cb('0x9'));var sox=require('sox');var csv=require(_0xd4cb('0xa'));var ejs=require(_0xd4cb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd4cb('0xc'));var crypto=require(_0xd4cb('0xd'));var jsforce=require(_0xd4cb('0xe'));var deskjs=require(_0xd4cb('0xf'));var toCsv=require(_0xd4cb('0xa'));var querystring=require(_0xd4cb('0x10'));var Papa=require(_0xd4cb('0x11'));var Redis=require(_0xd4cb('0x12'));var authService=require(_0xd4cb('0x13'));var qs=require(_0xd4cb('0x14'));var hardwareService=require(_0xd4cb('0x15'));var logger=require('../../config/logger')(_0xd4cb('0x16'));var utils=require(_0xd4cb('0x17'));var config=require(_0xd4cb('0x18'));var db=require(_0xd4cb('0x19'))['db'];function respondWithStatusCode(_0x39a77a,_0x224c4a){_0x224c4a=_0x224c4a||0xcc;return function(_0xa91591){if(_0xa91591){return _0x39a77a[_0xd4cb('0x1a')](_0x224c4a);}return _0x39a77a[_0xd4cb('0x1b')](_0x224c4a)[_0xd4cb('0x1c')]();};}function respondWithResult(_0x2b73cc,_0x312a43){_0x312a43=_0x312a43||0xc8;return function(_0x240353){if(_0x240353){return _0x2b73cc[_0xd4cb('0x1b')](_0x312a43)[_0xd4cb('0x1d')](_0x240353);}};}function respondWithFilteredResult(_0x4e26cd,_0x1c44ad){return function(_0x842b41){if(_0x842b41){var _0xb59120=_0x842b41[_0xd4cb('0x1e')],_0x5ac614=_0x1c44ad[_0xd4cb('0x1f')],_0x5dfcfa=_0x1c44ad['offset']+_0x1c44ad[_0xd4cb('0x20')],_0x544f72;if(_0x5dfcfa>=_0xb59120){_0x5dfcfa=_0xb59120;_0x544f72=0xc8;}else{_0x544f72=0xce;}_0x4e26cd[_0xd4cb('0x1b')](_0x544f72);return _0x4e26cd['set'](_0xd4cb('0x21'),_0x5ac614+'-'+_0x5dfcfa+'/'+_0xb59120)['json'](_0x842b41);}return null;};}function patchUpdates(_0x5736d9){return function(_0x38fc6e){try{jsonpatch[_0xd4cb('0x22')](_0x38fc6e,_0x5736d9,!![]);}catch(_0x1c08e8){return BPromise['reject'](_0x1c08e8);}return _0x38fc6e[_0xd4cb('0x23')]();};}function saveUpdates(_0x4f0292,_0x514ecb){return function(_0x5b2e03){if(_0x5b2e03){return _0x5b2e03[_0xd4cb('0x24')](_0x4f0292)[_0xd4cb('0x25')](function(_0x1b5bd1){return _0x1b5bd1;});}return null;};}function removeEntity(_0x59f25f,_0x59221e){return function(_0x5be89e){if(_0x5be89e){return _0x5be89e[_0xd4cb('0x26')]()[_0xd4cb('0x25')](function(){var _0x18d283=_0x5be89e[_0xd4cb('0x27')]({'plain':!![]});var _0x4275cc=_0xd4cb('0x28');return db[_0xd4cb('0x29')][_0xd4cb('0x26')]({'where':{'type':_0x4275cc,'resourceId':_0x18d283['id']}})[_0xd4cb('0x25')](function(){return _0x5be89e;});})[_0xd4cb('0x25')](function(){_0x59f25f[_0xd4cb('0x1b')](0xcc)[_0xd4cb('0x1c')]();});}};}function handleEntityNotFound(_0x107903,_0x2433fc){return function(_0x2e24ed){if(!_0x2e24ed){_0x107903[_0xd4cb('0x1a')](0x194);}return _0x2e24ed;};}function handleError(_0x26d53e,_0x22e471){_0x22e471=_0x22e471||0x1f4;return function(_0x4a992e){logger[_0xd4cb('0x2a')](_0x4a992e[_0xd4cb('0x2b')]);if(_0x4a992e['name']){delete _0x4a992e['name'];}_0x26d53e[_0xd4cb('0x1b')](_0x22e471)[_0xd4cb('0x2c')](_0x4a992e);};}exports[_0xd4cb('0x2d')]=function(_0x720774,_0xb2951e){var _0x2c10c4={},_0x171e41={},_0xd9bff0={'count':0x0,'rows':[]};var _0x4e86bf=db[_0xd4cb('0x2e')][_0xd4cb('0x2f')];_0x171e41[_0xd4cb('0x30')]=_[_0xd4cb('0x31')](_0x4e86bf);_0x171e41[_0xd4cb('0x32')]=_['keys'](_0x720774[_0xd4cb('0x32')]);_0x171e41[_0xd4cb('0x33')]=_[_0xd4cb('0x34')](_0x171e41[_0xd4cb('0x30')],_0x171e41[_0xd4cb('0x32')]);_0x2c10c4['attributes']=_[_0xd4cb('0x34')](_0x171e41['model'],qs[_0xd4cb('0x35')](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x35')]));_0x2c10c4[_0xd4cb('0x36')]=_0x2c10c4[_0xd4cb('0x36')][_0xd4cb('0x37')]?_0x2c10c4[_0xd4cb('0x36')]:_0x171e41[_0xd4cb('0x30')];if(!_0x720774[_0xd4cb('0x32')]['hasOwnProperty']('nolimit')){_0x2c10c4[_0xd4cb('0x20')]=qs[_0xd4cb('0x20')](_0x720774[_0xd4cb('0x32')]['limit']);_0x2c10c4[_0xd4cb('0x1f')]=qs['offset'](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x1f')]);}_0x2c10c4[_0xd4cb('0x38')]=qs[_0xd4cb('0x39')](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x39')]);_0x2c10c4[_0xd4cb('0x3a')]=qs[_0xd4cb('0x33')](_[_0xd4cb('0x3b')](_0x720774[_0xd4cb('0x32')],_0x171e41[_0xd4cb('0x33')]));if(_0x720774[_0xd4cb('0x32')][_0xd4cb('0x3c')]){_0x2c10c4['where']=_['merge'](_0x2c10c4[_0xd4cb('0x3a')],{'$or':_[_0xd4cb('0x3d')](_0x4e86bf,function(_0x62f8ca){if(_0x62f8ca[_0xd4cb('0x3e')][_0xd4cb('0x3f')]!==_0xd4cb('0x40')){var _0x5540c3={};_0x5540c3[_0x62f8ca[_0xd4cb('0x41')]]={'$like':'%'+_0x720774['query'][_0xd4cb('0x3c')]+'%'};return _0x5540c3;}})});}_0x2c10c4=_[_0xd4cb('0x42')]({},_0x2c10c4,_0x720774['options']);var _0x324b81={'where':_0x2c10c4[_0xd4cb('0x3a')]};return db['VoiceChanSpy'][_0xd4cb('0x1e')](_0x324b81)[_0xd4cb('0x25')](function(_0x2ff096){_0xd9bff0[_0xd4cb('0x1e')]=_0x2ff096;if(_0x720774[_0xd4cb('0x32')][_0xd4cb('0x43')]){_0x2c10c4[_0xd4cb('0x44')]=[{'all':!![]}];}return db[_0xd4cb('0x2e')][_0xd4cb('0x45')](_0x2c10c4);})[_0xd4cb('0x25')](function(_0x55d3df){_0xd9bff0['rows']=_0x55d3df;return _0xd9bff0;})['then'](respondWithFilteredResult(_0xb2951e,_0x2c10c4))[_0xd4cb('0x46')](handleError(_0xb2951e,null));};exports['show']=function(_0x3b4d21,_0x296609){var _0x39c419={'raw':![],'where':{'id':_0x3b4d21[_0xd4cb('0x47')]['id']}},_0x51f30b={};_0x51f30b['model']=_[_0xd4cb('0x31')](db['VoiceChanSpy']['rawAttributes']);_0x51f30b[_0xd4cb('0x32')]=_[_0xd4cb('0x31')](_0x3b4d21[_0xd4cb('0x32')]);_0x51f30b[_0xd4cb('0x33')]=_[_0xd4cb('0x34')](_0x51f30b[_0xd4cb('0x30')],_0x51f30b['query']);_0x39c419[_0xd4cb('0x36')]=_[_0xd4cb('0x34')](_0x51f30b[_0xd4cb('0x30')],qs['fields'](_0x3b4d21[_0xd4cb('0x32')][_0xd4cb('0x35')]));_0x39c419[_0xd4cb('0x36')]=_0x39c419[_0xd4cb('0x36')][_0xd4cb('0x37')]?_0x39c419[_0xd4cb('0x36')]:_0x51f30b['model'];if(_0x3b4d21['query']['includeAll']){_0x39c419['include']=[{'all':!![]}];}_0x39c419=_[_0xd4cb('0x42')]({},_0x39c419,_0x3b4d21[_0xd4cb('0x48')]);return db[_0xd4cb('0x2e')][_0xd4cb('0x49')](_0x39c419)[_0xd4cb('0x25')](handleEntityNotFound(_0x296609,null))[_0xd4cb('0x25')](respondWithResult(_0x296609,null))[_0xd4cb('0x46')](handleError(_0x296609,null));};exports[_0xd4cb('0x4a')]=function(_0x33683b,_0x1f154b){return db[_0xd4cb('0x2e')][_0xd4cb('0x4a')](_0x33683b[_0xd4cb('0x4b')],{})['then'](function(_0x244fed){var _0x2ee13f=_0x33683b['user'][_0xd4cb('0x27')]({'plain':!![]});if(!_0x2ee13f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ee13f[_0xd4cb('0x4c')]===_0xd4cb('0x4d')){var _0x4f3688=_0x244fed[_0xd4cb('0x27')]({'plain':!![]});var _0xc561b1=_0xd4cb('0x28');return db[_0xd4cb('0x4e')]['find']({'where':{'name':_0xc561b1,'userProfileId':_0x2ee13f[_0xd4cb('0x4f')]},'raw':!![]})['then'](function(_0x3128eb){if(_0x3128eb&&_0x3128eb[_0xd4cb('0x50')]===0x0){return db[_0xd4cb('0x29')][_0xd4cb('0x4a')]({'name':_0x4f3688[_0xd4cb('0x51')],'resourceId':_0x4f3688['id'],'type':_0x3128eb[_0xd4cb('0x51')],'sectionId':_0x3128eb['id']},{})[_0xd4cb('0x25')](function(){return _0x244fed;});}else{return _0x244fed;}})[_0xd4cb('0x46')](function(_0x126e93){logger[_0xd4cb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x126e93);throw _0x126e93;});}return _0x244fed;})[_0xd4cb('0x25')](respondWithResult(_0x1f154b,0xc9))[_0xd4cb('0x46')](handleError(_0x1f154b,null));};exports['update']=function(_0x64fb02,_0x49bd3b){if(_0x64fb02[_0xd4cb('0x4b')]['id']){delete _0x64fb02[_0xd4cb('0x4b')]['id'];}return db[_0xd4cb('0x2e')][_0xd4cb('0x49')]({'where':{'id':_0x64fb02[_0xd4cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x49bd3b,null))['then'](saveUpdates(_0x64fb02[_0xd4cb('0x4b')],null))[_0xd4cb('0x25')](respondWithResult(_0x49bd3b,null))[_0xd4cb('0x46')](handleError(_0x49bd3b,null));};exports[_0xd4cb('0x26')]=function(_0x38382f,_0xdf670b){return db[_0xd4cb('0x2e')][_0xd4cb('0x49')]({'where':{'id':_0x38382f[_0xd4cb('0x47')]['id']}})[_0xd4cb('0x25')](handleEntityNotFound(_0xdf670b,null))[_0xd4cb('0x25')](removeEntity(_0xdf670b,null))[_0xd4cb('0x46')](handleError(_0xdf670b,null));}; \ No newline at end of file +var _0x05bf=['filter','map','type','VIRTUAL','field','merge','options','include','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','VoiceChanSpy','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x37bd36,_0x32f3a2){var _0x3beb96=function(_0x4f058d){while(--_0x4f058d){_0x37bd36['push'](_0x37bd36['shift']());}};_0x3beb96(++_0x32f3a2);}(_0x05bf,0x10e));var _0xf05b=function(_0x3a99a7,_0x4e2892){_0x3a99a7=_0x3a99a7-0x0;var _0x1a6bed=_0x05bf[_0x3a99a7];return _0x1a6bed;};'use strict';var pdf=require(_0xf05b('0x0'));var emlformat=require(_0xf05b('0x1'));var rimraf=require(_0xf05b('0x2'));var zipdir=require(_0xf05b('0x3'));var jsonpatch=require(_0xf05b('0x4'));var rp=require('request-promise');var moment=require(_0xf05b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf05b('0x6'));var util=require(_0xf05b('0x7'));var path=require(_0xf05b('0x8'));var sox=require(_0xf05b('0x9'));var csv=require('to-csv');var ejs=require(_0xf05b('0xa'));var fs=require('fs');var _=require(_0xf05b('0xb'));var squel=require(_0xf05b('0xc'));var crypto=require(_0xf05b('0xd'));var jsforce=require(_0xf05b('0xe'));var deskjs=require(_0xf05b('0xf'));var toCsv=require(_0xf05b('0x10'));var querystring=require(_0xf05b('0x11'));var Papa=require(_0xf05b('0x12'));var Redis=require('ioredis');var authService=require(_0xf05b('0x13'));var qs=require(_0xf05b('0x14'));var hardwareService=require(_0xf05b('0x15'));var logger=require(_0xf05b('0x16'))(_0xf05b('0x17'));var utils=require(_0xf05b('0x18'));var config=require(_0xf05b('0x19'));var db=require(_0xf05b('0x1a'))['db'];function respondWithStatusCode(_0x390eb4,_0x4daf49){_0x4daf49=_0x4daf49||0xcc;return function(_0x4e0ac8){if(_0x4e0ac8){return _0x390eb4[_0xf05b('0x1b')](_0x4daf49);}return _0x390eb4[_0xf05b('0x1c')](_0x4daf49)[_0xf05b('0x1d')]();};}function respondWithResult(_0x59823a,_0x29303c){_0x29303c=_0x29303c||0xc8;return function(_0x119406){if(_0x119406){return _0x59823a['status'](_0x29303c)['json'](_0x119406);}};}function respondWithFilteredResult(_0x7983e7,_0x34202e){return function(_0x3e5d53){if(_0x3e5d53){var _0xc9d746=_0x3e5d53[_0xf05b('0x1e')],_0x46d18d=_0x34202e[_0xf05b('0x1f')],_0x2d72ea=_0x34202e[_0xf05b('0x1f')]+_0x34202e[_0xf05b('0x20')],_0x235d57;if(_0x2d72ea>=_0xc9d746){_0x2d72ea=_0xc9d746;_0x235d57=0xc8;}else{_0x235d57=0xce;}_0x7983e7['status'](_0x235d57);return _0x7983e7[_0xf05b('0x21')](_0xf05b('0x22'),_0x46d18d+'-'+_0x2d72ea+'/'+_0xc9d746)[_0xf05b('0x23')](_0x3e5d53);}return null;};}function patchUpdates(_0x45a80d){return function(_0x50e4aa){try{jsonpatch[_0xf05b('0x24')](_0x50e4aa,_0x45a80d,!![]);}catch(_0x1d5e36){return BPromise[_0xf05b('0x25')](_0x1d5e36);}return _0x50e4aa[_0xf05b('0x26')]();};}function saveUpdates(_0x5a2998,_0x3278fd){return function(_0x2dd06d){if(_0x2dd06d){return _0x2dd06d[_0xf05b('0x27')](_0x5a2998)[_0xf05b('0x28')](function(_0xdecd8a){return _0xdecd8a;});}return null;};}function removeEntity(_0x5b7c29,_0x1be651){return function(_0x397a97){if(_0x397a97){return _0x397a97[_0xf05b('0x29')]()[_0xf05b('0x28')](function(){var _0x1c3f2d=_0x397a97[_0xf05b('0x2a')]({'plain':!![]});var _0x9a39dd=_0xf05b('0x2b');return db[_0xf05b('0x2c')][_0xf05b('0x29')]({'where':{'type':_0x9a39dd,'resourceId':_0x1c3f2d['id']}})[_0xf05b('0x28')](function(){return _0x397a97;});})[_0xf05b('0x28')](function(){_0x5b7c29['status'](0xcc)[_0xf05b('0x1d')]();});}};}function handleEntityNotFound(_0x27fe10,_0x4ff7ea){return function(_0x535010){if(!_0x535010){_0x27fe10[_0xf05b('0x1b')](0x194);}return _0x535010;};}function handleError(_0x250161,_0x532d2f){_0x532d2f=_0x532d2f||0x1f4;return function(_0x5a4c6f){logger[_0xf05b('0x2d')](_0x5a4c6f[_0xf05b('0x2e')]);if(_0x5a4c6f['name']){delete _0x5a4c6f['name'];}_0x250161[_0xf05b('0x1c')](_0x532d2f)[_0xf05b('0x2f')](_0x5a4c6f);};}exports['index']=function(_0x23dc4,_0x2a2d06){var _0x2e3a05={},_0x2616ce={},_0x4704ff={'count':0x0,'rows':[]};var _0x4da1bd=db[_0xf05b('0x30')]['rawAttributes'];_0x2616ce['model']=_[_0xf05b('0x31')](_0x4da1bd);_0x2616ce[_0xf05b('0x32')]=_[_0xf05b('0x31')](_0x23dc4['query']);_0x2616ce[_0xf05b('0x33')]=_[_0xf05b('0x34')](_0x2616ce[_0xf05b('0x35')],_0x2616ce['query']);_0x2e3a05[_0xf05b('0x36')]=_['intersection'](_0x2616ce['model'],qs[_0xf05b('0x37')](_0x23dc4['query'][_0xf05b('0x37')]));_0x2e3a05['attributes']=_0x2e3a05['attributes'][_0xf05b('0x38')]?_0x2e3a05[_0xf05b('0x36')]:_0x2616ce[_0xf05b('0x35')];if(!_0x23dc4[_0xf05b('0x32')][_0xf05b('0x39')]('nolimit')){_0x2e3a05['limit']=qs['limit'](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x20')]);_0x2e3a05[_0xf05b('0x1f')]=qs['offset'](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x1f')]);}_0x2e3a05[_0xf05b('0x3a')]=qs[_0xf05b('0x3b')](_0x23dc4[_0xf05b('0x32')][_0xf05b('0x3b')]);_0x2e3a05[_0xf05b('0x3c')]=qs[_0xf05b('0x33')](_[_0xf05b('0x3d')](_0x23dc4[_0xf05b('0x32')],_0x2616ce[_0xf05b('0x33')]));if(_0x23dc4['query'][_0xf05b('0x3e')]){_0x2e3a05['where']=_['merge'](_0x2e3a05[_0xf05b('0x3c')],{'$or':_[_0xf05b('0x3f')](_0x4da1bd,function(_0x3839c4){if(_0x3839c4[_0xf05b('0x40')]['key']!==_0xf05b('0x41')){var _0x49aaaa={};_0x49aaaa[_0x3839c4[_0xf05b('0x42')]]={'$like':'%'+_0x23dc4['query'][_0xf05b('0x3e')]+'%'};return _0x49aaaa;}})});}_0x2e3a05=_[_0xf05b('0x43')]({},_0x2e3a05,_0x23dc4[_0xf05b('0x44')]);var _0x5d45d5={'where':_0x2e3a05['where']};return db[_0xf05b('0x30')][_0xf05b('0x1e')](_0x5d45d5)[_0xf05b('0x28')](function(_0x1efd65){_0x4704ff[_0xf05b('0x1e')]=_0x1efd65;if(_0x23dc4[_0xf05b('0x32')]['includeAll']){_0x2e3a05[_0xf05b('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x2e3a05);})[_0xf05b('0x28')](function(_0x76b334){_0x4704ff['rows']=_0x76b334;return _0x4704ff;})['then'](respondWithFilteredResult(_0x2a2d06,_0x2e3a05))[_0xf05b('0x46')](handleError(_0x2a2d06,null));};exports['show']=function(_0xce0776,_0x2231cf){var _0x449b06={'raw':![],'where':{'id':_0xce0776[_0xf05b('0x47')]['id']}},_0x42f9ca={};_0x42f9ca[_0xf05b('0x35')]=_[_0xf05b('0x31')](db[_0xf05b('0x30')]['rawAttributes']);_0x42f9ca[_0xf05b('0x32')]=_[_0xf05b('0x31')](_0xce0776['query']);_0x42f9ca[_0xf05b('0x33')]=_[_0xf05b('0x34')](_0x42f9ca[_0xf05b('0x35')],_0x42f9ca[_0xf05b('0x32')]);_0x449b06['attributes']=_[_0xf05b('0x34')](_0x42f9ca[_0xf05b('0x35')],qs[_0xf05b('0x37')](_0xce0776['query']['fields']));_0x449b06[_0xf05b('0x36')]=_0x449b06['attributes'][_0xf05b('0x38')]?_0x449b06[_0xf05b('0x36')]:_0x42f9ca['model'];if(_0xce0776[_0xf05b('0x32')][_0xf05b('0x48')]){_0x449b06['include']=[{'all':!![]}];}_0x449b06=_[_0xf05b('0x43')]({},_0x449b06,_0xce0776['options']);return db[_0xf05b('0x30')][_0xf05b('0x49')](_0x449b06)[_0xf05b('0x28')](handleEntityNotFound(_0x2231cf,null))['then'](respondWithResult(_0x2231cf,null))[_0xf05b('0x46')](handleError(_0x2231cf,null));};exports[_0xf05b('0x4a')]=function(_0x211ae0,_0x28e584){return db[_0xf05b('0x30')][_0xf05b('0x4a')](_0x211ae0[_0xf05b('0x4b')],{})[_0xf05b('0x28')](function(_0x552f20){var _0x5093fb=_0x211ae0[_0xf05b('0x4c')][_0xf05b('0x2a')]({'plain':!![]});if(!_0x5093fb)throw new Error(_0xf05b('0x4d'));if(_0x5093fb[_0xf05b('0x4e')]==='user'){var _0x226435=_0x552f20['get']({'plain':!![]});var _0x4f5710=_0xf05b('0x2b');return db[_0xf05b('0x4f')][_0xf05b('0x49')]({'where':{'name':_0x4f5710,'userProfileId':_0x5093fb['userProfileId']},'raw':!![]})[_0xf05b('0x28')](function(_0x18acaf){if(_0x18acaf&&_0x18acaf[_0xf05b('0x50')]===0x0){return db[_0xf05b('0x2c')][_0xf05b('0x4a')]({'name':_0x226435[_0xf05b('0x51')],'resourceId':_0x226435['id'],'type':_0x18acaf[_0xf05b('0x51')],'sectionId':_0x18acaf['id']},{})[_0xf05b('0x28')](function(){return _0x552f20;});}else{return _0x552f20;}})[_0xf05b('0x46')](function(_0x571ab6){logger[_0xf05b('0x2d')](_0xf05b('0x52'),_0x571ab6);throw _0x571ab6;});}return _0x552f20;})['then'](respondWithResult(_0x28e584,0xc9))[_0xf05b('0x46')](handleError(_0x28e584,null));};exports[_0xf05b('0x27')]=function(_0x2abe25,_0x1c1fbb){if(_0x2abe25[_0xf05b('0x4b')]['id']){delete _0x2abe25[_0xf05b('0x4b')]['id'];}return db[_0xf05b('0x30')][_0xf05b('0x49')]({'where':{'id':_0x2abe25[_0xf05b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c1fbb,null))['then'](saveUpdates(_0x2abe25[_0xf05b('0x4b')],null))[_0xf05b('0x28')](respondWithResult(_0x1c1fbb,null))[_0xf05b('0x46')](handleError(_0x1c1fbb,null));};exports[_0xf05b('0x29')]=function(_0x194f4c,_0x48b38e){return db[_0xf05b('0x30')][_0xf05b('0x49')]({'where':{'id':_0x194f4c[_0xf05b('0x47')]['id']}})[_0xf05b('0x28')](handleEntityNotFound(_0x48b38e,null))['then'](removeEntity(_0x48b38e,null))[_0xf05b('0x46')](handleError(_0x48b38e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 39f57e4..3ce679e 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 _0xc805=['bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','push','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x59b24d,_0x4debc7){var _0x1da612=function(_0x407752){while(--_0x407752){_0x59b24d['push'](_0x59b24d['shift']());}};_0x1da612(++_0x4debc7);}(_0xc805,0x171));var _0x5c80=function(_0x531b74,_0x3a473b){_0x531b74=_0x531b74-0x0;var _0x513d17=_0xc805[_0x531b74];return _0x513d17;};'use strict';var _=require(_0x5c80('0x0'));var util=require('util');var BPromise=require(_0x5c80('0x1'));var attributes=require(_0x5c80('0x2'));var getUserApplications=function(_0x3767f4,_0x116744,_0x222706){var _0x516604=0x1;var _0xc535db=[];var _0xcc02b3={'context':_0x116744['context']||_0x5c80('0x3'),'exten':util['format'](_0x5c80('0x4'),_0x3767f4[_0x5c80('0x5')],_0x222706),'type':_0x5c80('0x6'),'isApp':![],'ChanSpyId':_0x3767f4['id'],'UserId':_0x116744['id']};_0xc535db['push'](_[_0x5c80('0x7')]({'app':_0x5c80('0x8'),'appdata':util[_0x5c80('0x9')](_0x5c80('0xa'),'chanspy'),'priority':_0x516604++},_0xcc02b3));if(_0x3767f4['record']){_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':'MixMonitor','appdata':util[_0x5c80('0x9')](_0x5c80('0xc'),_0x3767f4[_0x5c80('0xd')]),'priority':_0x516604++},_0xcc02b3));}if(_0x3767f4[_0x5c80('0xe')]){_0xc535db['push'](_[_0x5c80('0x7')]({'app':_0x5c80('0xf'),'appdata':_0x3767f4['password'],'priority':_0x516604++},_0xcc02b3));}_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':_0x5c80('0x10'),'appdata':util[_0x5c80('0x9')](_0x5c80('0x11'),_0x116744[_0x5c80('0x12')],_0x3767f4[_0x5c80('0x13')]?_0x3767f4['options']['join'](''):''),'priority':_0x516604++},_0xcc02b3));if(_0x3767f4[_0x5c80('0x14')]){_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':_0x5c80('0x15'),'priority':_0x516604++},_0xcc02b3));}return _0xc535db;};var getChanSpyApplications=function(_0x86f337,_0x4c943b){var _0x1d42f7=[];for(var _0x164726=0x0,_0xe36edd=0x1;_0x164726<_0x4c943b[_0x5c80('0x16')];_0x164726++,_0xe36edd=0x1){_0x1d42f7=_0x1d42f7[_0x5c80('0x17')](getUserApplications(_0x86f337,_0x4c943b[_0x164726],_0x4c943b[_0x164726][_0x5c80('0x18')]));if(_0x4c943b[_0x164726][_0x5c80('0x18')]!=_0x4c943b[_0x164726][_0x5c80('0x12')]){_0x1d42f7=_0x1d42f7[_0x5c80('0x17')](getUserApplications(_0x86f337,_0x4c943b[_0x164726],_0x4c943b[_0x164726][_0x5c80('0x12')]));}}return _0x1d42f7;};var getChanSpyPromise=function(_0x3338d5,_0x18a225){return new BPromise(function(_0x38e3ee,_0x4e2447){return _0x3338d5[_0x5c80('0x19')][_0x5c80('0x1a')]({'attributes':['id',_0x5c80('0x12'),_0x5c80('0x18')],'where':{'role':_0x5c80('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5c80('0x1c')](function(_0x4c1147){if(_0x4c1147){return _0x38e3ee(getChanSpyApplications(_0x18a225,_0x4c1147));}return _0x38e3ee([]);})[_0x5c80('0x1d')](function(_0x4f1dba){_0x4e2447(_0x4f1dba);});});};module[_0x5c80('0x1e')]=function(_0x3b1585,_0x1a9fdb){var _0x4b305a=_0x3b1585['models'];return _0x3b1585[_0x5c80('0x1f')](_0x5c80('0x20'),attributes,{'tableName':_0x5c80('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x33f83c,_0x31cf79,_0x28981b){return getChanSpyPromise(_0x4b305a,_0x33f83c)['then'](function(_0x5ae145){if(_0x5ae145&&_0x5ae145[_0x5c80('0x16')]){return _0x4b305a[_0x5c80('0x22')][_0x5c80('0x23')](_0x5ae145);}})[_0x5c80('0x1c')](function(){_0x28981b();})[_0x5c80('0x1d')](function(_0x5aa162){_0x28981b(_0x5aa162);});},'afterUpdate':function(_0x4e0fb3,_0x9519c3,_0x3778da){return _0x4b305a['VoiceExtension'][_0x5c80('0x24')]({'where':{'ChanSpyId':_0x4e0fb3['id']}})[_0x5c80('0x1c')](function(){return getChanSpyPromise(_0x4b305a,_0x4e0fb3);})[_0x5c80('0x1c')](function(_0x1bf8a6){if(_0x1bf8a6&&_0x1bf8a6[_0x5c80('0x16')]){return _0x4b305a[_0x5c80('0x22')][_0x5c80('0x23')](_0x1bf8a6);}})[_0x5c80('0x1c')](function(){_0x3778da();})[_0x5c80('0x1d')](function(_0x446527){_0x3778da(_0x446527);});},'afterDestroy':function(_0x2c6380,_0x347986,_0x2bcccc){return _0x4b305a['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x2c6380['id']}})[_0x5c80('0x1c')](function(){_0x2bcccc();})[_0x5c80('0x1d')](function(_0x536a20){_0x2bcccc(_0x536a20);});}}});}; \ No newline at end of file +var _0xcc73=['SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','catch','models','VoiceChanSpy','then','bulkCreate','destroy','VoiceExtension','util','bluebird','context','from-sip','format','%s%s','prefix','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','Authenticate','password','ChanSpy'];(function(_0x10afec,_0x181559){var _0x34c458=function(_0x46e5c8){while(--_0x46e5c8){_0x10afec['push'](_0x10afec['shift']());}};_0x34c458(++_0x181559);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xcc73[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var BPromise=require(_0x3cc7('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5055f9,_0x11b326,_0x571514){var _0x445dce=0x1;var _0x5054fb=[];var _0x5de4be={'context':_0x11b326[_0x3cc7('0x2')]||_0x3cc7('0x3'),'exten':util[_0x3cc7('0x4')](_0x3cc7('0x5'),_0x5055f9[_0x3cc7('0x6')],_0x571514),'type':'system','isApp':![],'ChanSpyId':_0x5055f9['id'],'UserId':_0x11b326['id']};_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x9'),'appdata':util[_0x3cc7('0x4')]('CDR(type)=%s',_0x3cc7('0xa')),'priority':_0x445dce++},_0x5de4be));if(_0x5055f9[_0x3cc7('0xb')]){_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0xc'),'appdata':util[_0x3cc7('0x4')](_0x3cc7('0xd'),_0x5055f9['recordingFormat']),'priority':_0x445dce++},_0x5de4be));}if(_0x5055f9['auth']){_0x5054fb[_0x3cc7('0x7')](_['merge']({'app':_0x3cc7('0xe'),'appdata':_0x5055f9[_0x3cc7('0xf')],'priority':_0x445dce++},_0x5de4be));}_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x10'),'appdata':util[_0x3cc7('0x4')](_0x3cc7('0x11'),_0x11b326[_0x3cc7('0x12')],_0x5055f9[_0x3cc7('0x13')]?_0x5055f9[_0x3cc7('0x13')][_0x3cc7('0x14')](''):''),'priority':_0x445dce++},_0x5de4be));if(_0x5055f9[_0x3cc7('0xb')]){_0x5054fb[_0x3cc7('0x7')](_[_0x3cc7('0x8')]({'app':_0x3cc7('0x15'),'priority':_0x445dce++},_0x5de4be));}return _0x5054fb;};var getChanSpyApplications=function(_0x857775,_0x2c4688){var _0x1320a8=[];for(var _0x386a31=0x0,_0x3f1ef0=0x1;_0x386a31<_0x2c4688[_0x3cc7('0x16')];_0x386a31++,_0x3f1ef0=0x1){_0x1320a8=_0x1320a8[_0x3cc7('0x17')](getUserApplications(_0x857775,_0x2c4688[_0x386a31],_0x2c4688[_0x386a31][_0x3cc7('0x18')]));if(_0x2c4688[_0x386a31][_0x3cc7('0x18')]!=_0x2c4688[_0x386a31][_0x3cc7('0x12')]){_0x1320a8=_0x1320a8[_0x3cc7('0x17')](getUserApplications(_0x857775,_0x2c4688[_0x386a31],_0x2c4688[_0x386a31][_0x3cc7('0x12')]));}}return _0x1320a8;};var getChanSpyPromise=function(_0x2483c9,_0x382727){return new BPromise(function(_0x54f825,_0x4d2396){return _0x2483c9[_0x3cc7('0x19')]['findAll']({'attributes':['id',_0x3cc7('0x12'),_0x3cc7('0x18')],'where':{'role':_0x3cc7('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x490730){if(_0x490730){return _0x54f825(getChanSpyApplications(_0x382727,_0x490730));}return _0x54f825([]);})[_0x3cc7('0x1b')](function(_0xffbcd9){_0x4d2396(_0xffbcd9);});});};module['exports']=function(_0x40906b,_0x2ff800){var _0x4bc893=_0x40906b[_0x3cc7('0x1c')];return _0x40906b['define'](_0x3cc7('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cfcee,_0x3b1fe6,_0x8f8709){return getChanSpyPromise(_0x4bc893,_0x1cfcee)[_0x3cc7('0x1e')](function(_0x29d2c8){if(_0x29d2c8&&_0x29d2c8[_0x3cc7('0x16')]){return _0x4bc893['VoiceExtension'][_0x3cc7('0x1f')](_0x29d2c8);}})[_0x3cc7('0x1e')](function(){_0x8f8709();})[_0x3cc7('0x1b')](function(_0x5f0a09){_0x8f8709(_0x5f0a09);});},'afterUpdate':function(_0x358c12,_0x595e7e,_0x58793b){return _0x4bc893['VoiceExtension'][_0x3cc7('0x20')]({'where':{'ChanSpyId':_0x358c12['id']}})[_0x3cc7('0x1e')](function(){return getChanSpyPromise(_0x4bc893,_0x358c12);})['then'](function(_0x5518cf){if(_0x5518cf&&_0x5518cf[_0x3cc7('0x16')]){return _0x4bc893[_0x3cc7('0x21')][_0x3cc7('0x1f')](_0x5518cf);}})[_0x3cc7('0x1e')](function(){_0x58793b();})[_0x3cc7('0x1b')](function(_0x3af533){_0x58793b(_0x3af533);});},'afterDestroy':function(_0x1e14b4,_0x3a5d5b,_0x30ccb6){return _0x4bc893[_0x3cc7('0x21')][_0x3cc7('0x20')]({'where':{'ChanSpyId':_0x1e14b4['id']}})[_0x3cc7('0x1e')](function(){_0x30ccb6();})[_0x3cc7('0x1b')](function(_0x160474){_0x30ccb6(_0x160474);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 5e61216..7aa4ecb 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 _0x7341=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x1a265f,_0x30b296){var _0x13a6ac=function(_0x10c4ce){while(--_0x10c4ce){_0x1a265f['push'](_0x1a265f['shift']());}};_0x13a6ac(++_0x30b296);}(_0x7341,0xe4));var _0x1734=function(_0x2459a6,_0x3b270b){_0x2459a6=_0x2459a6-0x0;var _0x16d459=_0x7341[_0x2459a6];return _0x16d459;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});} \ No newline at end of file +var _0x32f8=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x4653f7,_0x3d3ae3){var _0x5454da=function(_0x448f55){while(--_0x448f55){_0x4653f7['push'](_0x4653f7['shift']());}};_0x5454da(++_0x3d3ae3);}(_0x32f8,0xaf));var _0x832f=function(_0x104146,_0x37b3c6){_0x104146=_0x104146-0x0;var _0x11fd8f=_0x32f8[_0x104146];return _0x11fd8f;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var moment=require(_0x832f('0x2'));var BPromise=require('bluebird');var rs=require(_0x832f('0x3'));var fs=require('fs');var Redis=require(_0x832f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x832f('0x5'));var logger=require(_0x832f('0x6'))(_0x832f('0x7'));var config=require(_0x832f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x832f('0x9')][_0x832f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x449633,_0x4ebc6f,_0x418e83){return new BPromise(function(_0x34b9de,_0x568d25){return client[_0x832f('0xb')](_0x449633,_0x418e83)[_0x832f('0xc')](function(_0x1dd4ff){logger[_0x832f('0xd')](_0x832f('0xe'),_0x4ebc6f,'request\x20sent');logger[_0x832f('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4ebc6f,_0x832f('0x10'),JSON[_0x832f('0x11')](_0x1dd4ff));if(_0x1dd4ff['error']){if(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x13')]===0x1f4){logger[_0x832f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ebc6f,_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);return _0x568d25(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);}logger[_0x832f('0x12')](_0x832f('0xe'),_0x4ebc6f,_0x1dd4ff[_0x832f('0x12')]['message']);return _0x34b9de(_0x1dd4ff[_0x832f('0x12')][_0x832f('0x14')]);}else{logger[_0x832f('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x4ebc6f,_0x832f('0x10'));_0x34b9de(_0x1dd4ff['result'][_0x832f('0x14')]);}})[_0x832f('0x15')](function(_0x5f4977){logger['error'](_0x832f('0xe'),_0x4ebc6f,_0x5f4977);_0x568d25(_0x5f4977);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 944506d..5e260f2 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 _0xdf5d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x50077e,_0x4e3100){var _0x3fbe80=function(_0x5a6541){while(--_0x5a6541){_0x50077e['push'](_0x50077e['shift']());}};_0x3fbe80(++_0x4e3100);}(_0xdf5d,0x126));var _0xddf5=function(_0x4776cf,_0x354d03){_0x4776cf=_0x4776cf-0x0;var _0x197de4=_0xdf5d[_0x4776cf];return _0x197de4;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var auth=require(_0xddf5('0x6'));var interaction=require(_0xddf5('0x7'));var config=require('../../config/environment');var controller=require(_0xddf5('0x8'));router[_0xddf5('0x9')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xb')]);router[_0xddf5('0x9')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xd')]);router[_0xddf5('0xe')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xf')]);router[_0xddf5('0x10')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x11')]);router[_0xddf5('0x12')]('/:id',auth[_0xddf5('0xa')](),controller[_0xddf5('0x13')]);module[_0xddf5('0x14')]=router; \ No newline at end of file +var _0x6582=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x3f79cc,_0x4e3db4){var _0x3fc412=function(_0xd39269){while(--_0xd39269){_0x3f79cc['push'](_0x3f79cc['shift']());}};_0x3fc412(++_0x4e3db4);}(_0x6582,0x108));var _0x2658=function(_0x332684,_0x4c5b5b){_0x332684=_0x332684-0x0;var _0x42c520=_0x6582[_0x332684];return _0x42c520;};'use strict';var multer=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var path=require(_0x2658('0x2'));var timeout=require(_0x2658('0x3'));var express=require(_0x2658('0x4'));var router=express['Router']();var auth=require(_0x2658('0x5'));var interaction=require(_0x2658('0x6'));var config=require(_0x2658('0x7'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2658('0x8')]);router[_0x2658('0x9')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0xc')]);router[_0x2658('0xd')]('/',auth['isAuthenticated'](),controller[_0x2658('0xe')]);router[_0x2658('0xf')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0x10')]);router[_0x2658('0x11')](_0x2658('0xa'),auth[_0x2658('0xb')](),controller[_0x2658('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7f0d88e..673cc8b 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 _0x372d=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x358413,_0x35fd8f){var _0x1faeed=function(_0x283063){while(--_0x283063){_0x358413['push'](_0x358413['shift']());}};_0x1faeed(++_0x35fd8f);}(_0x372d,0x15e));var _0xd372=function(_0x260aaa,_0x172c23){_0x260aaa=_0x260aaa-0x0;var _0xc3f81d=_0x372d[_0x260aaa];return _0xc3f81d;};'use strict';var Sequelize=require(_0xd372('0x0'));module[_0xd372('0x1')]={'name':{'type':Sequelize[_0xd372('0x2')],'unique':_0xd372('0x3')},'description':{'type':Sequelize[_0xd372('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd372('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x37ad=['BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x37ad,0x113));var _0xd37a=function(_0x44353d,_0x267761){_0x44353d=_0x44353d-0x0;var _0x93dd90=_0x37ad[_0x44353d];return _0x93dd90;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd37a('0x0')],'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 850bf13..dc1c2de 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 _0xbbe9=['rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','chan_sip.so','server/files/templates/context.ejs','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','get','Contexts','sendStatus','name','send','index','VoiceContext'];(function(_0x242371,_0xaef678){var _0x364ed9=function(_0x1d67d6){while(--_0x1d67d6){_0x242371['push'](_0x242371['shift']());}};_0x364ed9(++_0xaef678);}(_0xbbe9,0x16b));var _0x9bbe=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xbbe9[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bbe('0x0'));var rimraf=require(_0x9bbe('0x1'));var zipdir=require(_0x9bbe('0x2'));var jsonpatch=require(_0x9bbe('0x3'));var rp=require(_0x9bbe('0x4'));var moment=require(_0x9bbe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9bbe('0x6'));var util=require(_0x9bbe('0x7'));var path=require(_0x9bbe('0x8'));var sox=require(_0x9bbe('0x9'));var csv=require('to-csv');var ejs=require(_0x9bbe('0xa'));var fs=require('fs');var _=require(_0x9bbe('0xb'));var squel=require(_0x9bbe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bbe('0xd'));var toCsv=require(_0x9bbe('0xe'));var querystring=require(_0x9bbe('0xf'));var Papa=require('papaparse');var Redis=require(_0x9bbe('0x10'));var authService=require(_0x9bbe('0x11'));var qs=require(_0x9bbe('0x12'));var hardwareService=require(_0x9bbe('0x13'));var logger=require(_0x9bbe('0x14'))(_0x9bbe('0x15'));var utils=require('../../config/utils');var config=require(_0x9bbe('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9bbe('0x17'));var client=jayson[_0x9bbe('0x18')][_0x9bbe('0x19')]({'port':0x232a});function checkPasswordPattern(_0xf2c299,_0x4e293b,_0x21e576){if(_0x21e576){var _0x32290e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32290e[_0x9bbe('0x1a')](_0x4e293b)){return _0xf2c299;}else{throw new Error(_0x9bbe('0x1b'));}}else{return _0xf2c299;}}function respondWithRpcPromise(_0x587096,_0x2b3ab7,_0x203f75,_0x1f2a08){return new BPromise(function(_0x44a417,_0x67af6){var _0x55d3a2=_0x1f2a08||client;return _0x55d3a2[_0x9bbe('0x1c')](_0x587096,_0x203f75)[_0x9bbe('0x1d')](function(_0x31004e){logger[_0x9bbe('0x1e')](_0x9bbe('0x1f'),_0x2b3ab7,'request\x20sent');logger[_0x9bbe('0x20')](_0x9bbe('0x21'),_0x2b3ab7,'request\x20sent',JSON[_0x9bbe('0x22')](_0x31004e));if(_0x31004e[_0x9bbe('0x23')]){if(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x24')]===0x1f4){logger['error'](_0x9bbe('0x1f'),_0x2b3ab7,_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);return _0x67af6(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);}logger[_0x9bbe('0x23')]('VoiceContext,\x20%s,\x20%s',_0x2b3ab7,_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);return _0x44a417(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);}else{logger[_0x9bbe('0x1e')](_0x9bbe('0x1f'),_0x2b3ab7,_0x9bbe('0x26'));_0x44a417(_0x31004e['result']['message']);}})[_0x9bbe('0x27')](function(_0x25310c){logger[_0x9bbe('0x23')](_0x9bbe('0x1f'),_0x2b3ab7,_0x25310c);_0x67af6(_0x25310c);});});}function respondWithStatusCode(_0x48885d,_0x2fa438){_0x2fa438=_0x2fa438||0xcc;return function(_0x1813f9){if(_0x1813f9){return _0x48885d['sendStatus'](_0x2fa438);}return _0x48885d[_0x9bbe('0x28')](_0x2fa438)[_0x9bbe('0x29')]();};}function respondWithResult(_0x45eb6f,_0x16e9b2){_0x16e9b2=_0x16e9b2||0xc8;return function(_0x5776a2){if(_0x5776a2){return _0x45eb6f['status'](_0x16e9b2)[_0x9bbe('0x2a')](_0x5776a2);}};}function respondWithFilteredResult(_0x59c947,_0x425c3e){return function(_0x2984be){if(_0x2984be){var _0x3a796e=_0x2984be[_0x9bbe('0x2b')],_0x265f61=_0x425c3e[_0x9bbe('0x2c')],_0x512a09=_0x425c3e[_0x9bbe('0x2c')]+_0x425c3e['limit'],_0xbd0d7b;if(_0x512a09>=_0x3a796e){_0x512a09=_0x3a796e;_0xbd0d7b=0xc8;}else{_0xbd0d7b=0xce;}_0x59c947[_0x9bbe('0x28')](_0xbd0d7b);return _0x59c947['set'](_0x9bbe('0x2d'),_0x265f61+'-'+_0x512a09+'/'+_0x3a796e)[_0x9bbe('0x2a')](_0x2984be);}return null;};}function patchUpdates(_0xcd681){return function(_0x296cf1){try{jsonpatch[_0x9bbe('0x2e')](_0x296cf1,_0xcd681,!![]);}catch(_0x8f66aa){return BPromise[_0x9bbe('0x2f')](_0x8f66aa);}return _0x296cf1[_0x9bbe('0x30')]();};}function saveUpdates(_0x2bd37f,_0x15fa43){return function(_0x256bad){if(_0x256bad){return _0x256bad['update'](_0x2bd37f)['then'](function(_0x165e81){return _0x165e81;});}return null;};}function removeEntity(_0x4cc036,_0x9a74b2){return function(_0x5451b6){if(_0x5451b6){return _0x5451b6[_0x9bbe('0x31')]()[_0x9bbe('0x1d')](function(){var _0x545bea=_0x5451b6[_0x9bbe('0x32')]({'plain':!![]});var _0x51e45b=_0x9bbe('0x33');return db['UserProfileResource'][_0x9bbe('0x31')]({'where':{'type':_0x51e45b,'resourceId':_0x545bea['id']}})[_0x9bbe('0x1d')](function(){return _0x5451b6;});})[_0x9bbe('0x1d')](function(){_0x4cc036[_0x9bbe('0x28')](0xcc)[_0x9bbe('0x29')]();});}};}function handleEntityNotFound(_0x268550,_0x43b3b7){return function(_0x15f44d){if(!_0x15f44d){_0x268550[_0x9bbe('0x34')](0x194);}return _0x15f44d;};}function handleError(_0x134e6e,_0x53d3bc){_0x53d3bc=_0x53d3bc||0x1f4;return function(_0x1fc648){logger[_0x9bbe('0x23')](_0x1fc648['stack']);if(_0x1fc648[_0x9bbe('0x35')]){delete _0x1fc648['name'];}_0x134e6e[_0x9bbe('0x28')](_0x53d3bc)[_0x9bbe('0x36')](_0x1fc648);};}exports[_0x9bbe('0x37')]=function(_0x4c0e98,_0x28d425){var _0x373c31={},_0x2cdb8a={},_0x35acb4={'count':0x0,'rows':[]};var _0x5d2004=db[_0x9bbe('0x38')][_0x9bbe('0x39')];_0x2cdb8a['model']=_[_0x9bbe('0x3a')](_0x5d2004);_0x2cdb8a[_0x9bbe('0x3b')]=_[_0x9bbe('0x3a')](_0x4c0e98[_0x9bbe('0x3b')]);_0x2cdb8a[_0x9bbe('0x3c')]=_['intersection'](_0x2cdb8a[_0x9bbe('0x3d')],_0x2cdb8a[_0x9bbe('0x3b')]);_0x373c31[_0x9bbe('0x3e')]=_[_0x9bbe('0x3f')](_0x2cdb8a[_0x9bbe('0x3d')],qs[_0x9bbe('0x40')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x40')]));_0x373c31[_0x9bbe('0x3e')]=_0x373c31['attributes'][_0x9bbe('0x41')]?_0x373c31[_0x9bbe('0x3e')]:_0x2cdb8a['model'];if(!_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x42')](_0x9bbe('0x43'))){_0x373c31['limit']=qs[_0x9bbe('0x44')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x44')]);_0x373c31['offset']=qs[_0x9bbe('0x2c')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x2c')]);}_0x373c31[_0x9bbe('0x45')]=qs[_0x9bbe('0x46')](_0x4c0e98['query'][_0x9bbe('0x46')]);_0x373c31[_0x9bbe('0x47')]=qs[_0x9bbe('0x3c')](_[_0x9bbe('0x48')](_0x4c0e98['query'],_0x2cdb8a[_0x9bbe('0x3c')]));if(_0x4c0e98['query']['filter']){_0x373c31[_0x9bbe('0x47')]=_['merge'](_0x373c31[_0x9bbe('0x47')],{'$or':_['map'](_0x5d2004,function(_0x19cb02){if(_0x19cb02[_0x9bbe('0x49')][_0x9bbe('0x4a')]!==_0x9bbe('0x4b')){var _0x34f115={};_0x34f115[_0x19cb02[_0x9bbe('0x4c')]]={'$like':'%'+_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x4d')]+'%'};return _0x34f115;}})});}_0x373c31=_['merge']({},_0x373c31,_0x4c0e98[_0x9bbe('0x4e')]);var _0x44d066={'where':_0x373c31[_0x9bbe('0x47')]};return db[_0x9bbe('0x38')][_0x9bbe('0x2b')](_0x44d066)[_0x9bbe('0x1d')](function(_0x31e13c){_0x35acb4[_0x9bbe('0x2b')]=_0x31e13c;if(_0x4c0e98['query'][_0x9bbe('0x4f')]){_0x373c31[_0x9bbe('0x50')]=[{'all':!![]}];}return db[_0x9bbe('0x38')][_0x9bbe('0x51')](_0x373c31);})[_0x9bbe('0x1d')](function(_0x5b5d6b){_0x35acb4[_0x9bbe('0x52')]=_0x5b5d6b;return _0x35acb4;})['then'](respondWithFilteredResult(_0x28d425,_0x373c31))[_0x9bbe('0x27')](handleError(_0x28d425,null));};exports[_0x9bbe('0x53')]=function(_0x40110e,_0x216946){var _0x57e0c6={'raw':![],'where':{'id':_0x40110e[_0x9bbe('0x54')]['id']}},_0x153d8a={};_0x153d8a[_0x9bbe('0x3d')]=_[_0x9bbe('0x3a')](db['VoiceContext'][_0x9bbe('0x39')]);_0x153d8a['query']=_[_0x9bbe('0x3a')](_0x40110e[_0x9bbe('0x3b')]);_0x153d8a[_0x9bbe('0x3c')]=_[_0x9bbe('0x3f')](_0x153d8a[_0x9bbe('0x3d')],_0x153d8a['query']);_0x57e0c6[_0x9bbe('0x3e')]=_[_0x9bbe('0x3f')](_0x153d8a['model'],qs[_0x9bbe('0x40')](_0x40110e['query'][_0x9bbe('0x40')]));_0x57e0c6['attributes']=_0x57e0c6[_0x9bbe('0x3e')][_0x9bbe('0x41')]?_0x57e0c6['attributes']:_0x153d8a[_0x9bbe('0x3d')];if(_0x40110e[_0x9bbe('0x3b')]['includeAll']){_0x57e0c6[_0x9bbe('0x50')]=[{'all':!![]}];}_0x57e0c6=_[_0x9bbe('0x55')]({},_0x57e0c6,_0x40110e['options']);return db[_0x9bbe('0x38')][_0x9bbe('0x56')](_0x57e0c6)[_0x9bbe('0x1d')](handleEntityNotFound(_0x216946,null))[_0x9bbe('0x1d')](respondWithResult(_0x216946,null))[_0x9bbe('0x27')](handleError(_0x216946,null));};exports[_0x9bbe('0x57')]=function(_0x128a32,_0xf26e7b,_0x2aa07f){var _0x56b61a;return db[_0x9bbe('0x38')][_0x9bbe('0x57')](_0x128a32[_0x9bbe('0x58')],{'raw':!![]})[_0x9bbe('0x1d')](function(_0x4705e5){_0x56b61a=_0x4705e5;return db['VoiceContext'][_0x9bbe('0x51')]({'raw':!![]});})[_0x9bbe('0x1d')](function(_0x5f471f){var _0x40b950=fs[_0x9bbe('0x59')](path[_0x9bbe('0x5a')](config[_0x9bbe('0x5b')],'server/files/templates/context.ejs'),_0x9bbe('0x5c'));var _0x50102f=ejs[_0x9bbe('0x5d')](_0x40b950,{'contexts':_0x5f471f||[]});fs['writeFileSync'](_0x9bbe('0x5e'),_0x50102f);})['then'](function(){return respondWithRpcPromise(_0x9bbe('0x5f'),_0x9bbe('0x57'),{'module':'chan_sip.so'});})[_0x9bbe('0x1d')](function(){var _0x2c6e03=_0x128a32[_0x9bbe('0x60')][_0x9bbe('0x32')]({'plain':!![]});if(!_0x2c6e03)throw new Error(_0x9bbe('0x61'));if(_0x2c6e03[_0x9bbe('0x62')]===_0x9bbe('0x60')){var _0xbc499f=_0x56b61a['get']({'plain':!![]});return db['UserProfileSection'][_0x9bbe('0x56')]({'where':{'name':_0x9bbe('0x33'),'userProfileId':_0x2c6e03['userProfileId']},'raw':!![]})[_0x9bbe('0x1d')](function(_0x555eb0){if(_0x555eb0&&_0x555eb0[_0x9bbe('0x63')]===0x0){return db['UserProfileResource'][_0x9bbe('0x57')]({'name':_0xbc499f[_0x9bbe('0x35')],'resourceId':_0xbc499f['id'],'type':_0x555eb0['name'],'sectionId':_0x555eb0['id']},{})['then'](function(){return _0x56b61a;});}else{return _0x56b61a;}})[_0x9bbe('0x27')](function(_0x6906f8){logger[_0x9bbe('0x23')](_0x9bbe('0x64'),_0x6906f8);throw _0x6906f8;});}return _0x56b61a;})[_0x9bbe('0x1d')](respondWithResult(_0xf26e7b,0xc9))[_0x9bbe('0x27')](handleError(_0xf26e7b,null));};exports['update']=function(_0x1b153c,_0x107da9,_0xdf99cf){var _0x5532a1;return db[_0x9bbe('0x38')][_0x9bbe('0x56')]({'where':{'id':_0x1b153c[_0x9bbe('0x54')]['id']}})[_0x9bbe('0x1d')](handleEntityNotFound(_0x107da9,null))[_0x9bbe('0x1d')](saveUpdates(_0x1b153c[_0x9bbe('0x58')],null))[_0x9bbe('0x1d')](function(_0x733378){if(_0x733378){_0x5532a1=_0x733378;return db[_0x9bbe('0x38')]['findAll']({'raw':!![]});}})[_0x9bbe('0x1d')](function(_0x41cade){var _0x322d4a=fs['readFileSync'](path['join'](config[_0x9bbe('0x5b')],'server/files/templates/context.ejs'),_0x9bbe('0x5c'));var _0x5890c1=ejs[_0x9bbe('0x5d')](_0x322d4a,{'contexts':_0x41cade||[]});fs['writeFileSync'](_0x9bbe('0x5e'),_0x5890c1);})['then'](function(){return respondWithRpcPromise(_0x9bbe('0x5f'),_0x9bbe('0x65'),{'module':_0x9bbe('0x66')});})[_0x9bbe('0x1d')](function(){return _0x5532a1;})[_0x9bbe('0x1d')](respondWithResult(_0x107da9,null))[_0x9bbe('0x27')](handleError(_0x107da9,null));};exports[_0x9bbe('0x31')]=function(_0x4bf98c,_0x20663b,_0x20f091){var _0x3e9b2f;return db[_0x9bbe('0x38')]['find']({'where':{'id':_0x4bf98c[_0x9bbe('0x54')]['id']}})[_0x9bbe('0x1d')](handleEntityNotFound(_0x20663b,null))['then'](removeEntity(_0x20663b,null))[_0x9bbe('0x1d')](function(){return db[_0x9bbe('0x38')][_0x9bbe('0x51')]({'raw':!![]});})[_0x9bbe('0x1d')](function(_0x5f25b6){var _0x731518=fs[_0x9bbe('0x59')](path[_0x9bbe('0x5a')](config[_0x9bbe('0x5b')],_0x9bbe('0x67')),'utf8');var _0x2aa6da=ejs['render'](_0x731518,{'contexts':_0x5f25b6});fs[_0x9bbe('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2aa6da);return respondWithRpcPromise(_0x9bbe('0x5f'),'destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x20663b,null));}; \ No newline at end of file +var _0x1d25=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','then','Contexts','UserProfileResource','destroy','stack','name','send','index','VoiceContext','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','find','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','Reload','root','render','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s'];(function(_0x3da10c,_0x4cf1b3){var _0x9ccf1=function(_0x427814){while(--_0x427814){_0x3da10c['push'](_0x3da10c['shift']());}};_0x9ccf1(++_0x4cf1b3);}(_0x1d25,0x185));var _0x51d2=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x1d25[_0x328534];return _0x2796c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51d2('0x1'));var jsonpatch=require(_0x51d2('0x2'));var rp=require(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require(_0x51d2('0x5'));var Mustache=require(_0x51d2('0x6'));var util=require(_0x51d2('0x7'));var path=require(_0x51d2('0x8'));var sox=require(_0x51d2('0x9'));var csv=require(_0x51d2('0xa'));var ejs=require(_0x51d2('0xb'));var fs=require('fs');var _=require(_0x51d2('0xc'));var squel=require('squel');var crypto=require(_0x51d2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x51d2('0xe'));var toCsv=require(_0x51d2('0xa'));var querystring=require(_0x51d2('0xf'));var Papa=require('papaparse');var Redis=require(_0x51d2('0x10'));var authService=require(_0x51d2('0x11'));var qs=require(_0x51d2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d2('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x51d2('0x14'));var db=require(_0x51d2('0x15'))['db'];var jayson=require(_0x51d2('0x16'));var client=jayson['client'][_0x51d2('0x17')]({'port':0x232a});function checkPasswordPattern(_0x262b1a,_0xa9807c,_0x1ada88){if(_0x1ada88){var _0x449f5a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x449f5a['test'](_0xa9807c)){return _0x262b1a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x262b1a;}}function respondWithRpcPromise(_0x10bc4e,_0x3505b7,_0x3eca27,_0x23a504){return new BPromise(function(_0x185b63,_0x3809b0){var _0x31f997=_0x23a504||client;return _0x31f997[_0x51d2('0x18')](_0x10bc4e,_0x3eca27)['then'](function(_0x49df3c){logger[_0x51d2('0x19')](_0x51d2('0x1a'),_0x3505b7,_0x51d2('0x1b'));logger[_0x51d2('0x1c')](_0x51d2('0x1d'),_0x3505b7,_0x51d2('0x1b'),JSON[_0x51d2('0x1e')](_0x49df3c));if(_0x49df3c['error']){if(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x20')]===0x1f4){logger[_0x51d2('0x1f')](_0x51d2('0x1a'),_0x3505b7,_0x49df3c[_0x51d2('0x1f')]['message']);return _0x3809b0(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);}logger['error'](_0x51d2('0x1a'),_0x3505b7,_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);return _0x185b63(_0x49df3c[_0x51d2('0x1f')][_0x51d2('0x21')]);}else{logger[_0x51d2('0x19')]('VoiceContext,\x20%s,\x20%s',_0x3505b7,_0x51d2('0x1b'));_0x185b63(_0x49df3c['result']['message']);}})[_0x51d2('0x22')](function(_0x22d116){logger[_0x51d2('0x1f')](_0x51d2('0x1a'),_0x3505b7,_0x22d116);_0x3809b0(_0x22d116);});});}function respondWithStatusCode(_0x3f16b8,_0x4e5c1d){_0x4e5c1d=_0x4e5c1d||0xcc;return function(_0x45104f){if(_0x45104f){return _0x3f16b8[_0x51d2('0x23')](_0x4e5c1d);}return _0x3f16b8[_0x51d2('0x24')](_0x4e5c1d)[_0x51d2('0x25')]();};}function respondWithResult(_0x5a3d5b,_0x2c2e6c){_0x2c2e6c=_0x2c2e6c||0xc8;return function(_0x5a047b){if(_0x5a047b){return _0x5a3d5b[_0x51d2('0x24')](_0x2c2e6c)['json'](_0x5a047b);}};}function respondWithFilteredResult(_0x54832c,_0x366a67){return function(_0x25d1b4){if(_0x25d1b4){var _0x397007=_0x25d1b4[_0x51d2('0x26')],_0x5e4189=_0x366a67[_0x51d2('0x27')],_0x26d73b=_0x366a67['offset']+_0x366a67['limit'],_0x5e9c4a;if(_0x26d73b>=_0x397007){_0x26d73b=_0x397007;_0x5e9c4a=0xc8;}else{_0x5e9c4a=0xce;}_0x54832c[_0x51d2('0x24')](_0x5e9c4a);return _0x54832c[_0x51d2('0x28')]('Content-Range',_0x5e4189+'-'+_0x26d73b+'/'+_0x397007)[_0x51d2('0x29')](_0x25d1b4);}return null;};}function patchUpdates(_0x3db14f){return function(_0x4bebf2){try{jsonpatch[_0x51d2('0x2a')](_0x4bebf2,_0x3db14f,!![]);}catch(_0x13562c){return BPromise[_0x51d2('0x2b')](_0x13562c);}return _0x4bebf2[_0x51d2('0x2c')]();};}function saveUpdates(_0x340f31,_0x3af390){return function(_0x5de86){if(_0x5de86){return _0x5de86[_0x51d2('0x2d')](_0x340f31)[_0x51d2('0x2e')](function(_0x57ca0e){return _0x57ca0e;});}return null;};}function removeEntity(_0x33ff1d,_0x1aab01){return function(_0x49f48c){if(_0x49f48c){return _0x49f48c['destroy']()[_0x51d2('0x2e')](function(){var _0x1fb20e=_0x49f48c['get']({'plain':!![]});var _0xf58089=_0x51d2('0x2f');return db[_0x51d2('0x30')][_0x51d2('0x31')]({'where':{'type':_0xf58089,'resourceId':_0x1fb20e['id']}})[_0x51d2('0x2e')](function(){return _0x49f48c;});})[_0x51d2('0x2e')](function(){_0x33ff1d[_0x51d2('0x24')](0xcc)[_0x51d2('0x25')]();});}};}function handleEntityNotFound(_0x242007,_0x2651fc){return function(_0x4038eb){if(!_0x4038eb){_0x242007[_0x51d2('0x23')](0x194);}return _0x4038eb;};}function handleError(_0x37fe38,_0xc82c70){_0xc82c70=_0xc82c70||0x1f4;return function(_0x5aae22){logger['error'](_0x5aae22[_0x51d2('0x32')]);if(_0x5aae22[_0x51d2('0x33')]){delete _0x5aae22[_0x51d2('0x33')];}_0x37fe38['status'](_0xc82c70)[_0x51d2('0x34')](_0x5aae22);};}exports[_0x51d2('0x35')]=function(_0x15cea6,_0x45628d){var _0x2a651d={},_0x365b75={},_0x35d43d={'count':0x0,'rows':[]};var _0x1a6bb7=db[_0x51d2('0x36')][_0x51d2('0x37')];_0x365b75[_0x51d2('0x38')]=_['keys'](_0x1a6bb7);_0x365b75[_0x51d2('0x39')]=_[_0x51d2('0x3a')](_0x15cea6[_0x51d2('0x39')]);_0x365b75[_0x51d2('0x3b')]=_[_0x51d2('0x3c')](_0x365b75[_0x51d2('0x38')],_0x365b75[_0x51d2('0x39')]);_0x2a651d[_0x51d2('0x3d')]=_[_0x51d2('0x3c')](_0x365b75[_0x51d2('0x38')],qs['fields'](_0x15cea6['query'][_0x51d2('0x3e')]));_0x2a651d[_0x51d2('0x3d')]=_0x2a651d['attributes'][_0x51d2('0x3f')]?_0x2a651d[_0x51d2('0x3d')]:_0x365b75[_0x51d2('0x38')];if(!_0x15cea6['query'][_0x51d2('0x40')](_0x51d2('0x41'))){_0x2a651d[_0x51d2('0x42')]=qs[_0x51d2('0x42')](_0x15cea6[_0x51d2('0x39')][_0x51d2('0x42')]);_0x2a651d['offset']=qs[_0x51d2('0x27')](_0x15cea6['query'][_0x51d2('0x27')]);}_0x2a651d['order']=qs[_0x51d2('0x43')](_0x15cea6[_0x51d2('0x39')]['sort']);_0x2a651d[_0x51d2('0x44')]=qs[_0x51d2('0x3b')](_[_0x51d2('0x45')](_0x15cea6[_0x51d2('0x39')],_0x365b75[_0x51d2('0x3b')]));if(_0x15cea6[_0x51d2('0x39')][_0x51d2('0x46')]){_0x2a651d['where']=_[_0x51d2('0x47')](_0x2a651d['where'],{'$or':_[_0x51d2('0x48')](_0x1a6bb7,function(_0xe2650f){if(_0xe2650f[_0x51d2('0x49')]['key']!==_0x51d2('0x4a')){var _0x46165e={};_0x46165e[_0xe2650f[_0x51d2('0x4b')]]={'$like':'%'+_0x15cea6['query'][_0x51d2('0x46')]+'%'};return _0x46165e;}})});}_0x2a651d=_[_0x51d2('0x47')]({},_0x2a651d,_0x15cea6[_0x51d2('0x4c')]);var _0x30926c={'where':_0x2a651d[_0x51d2('0x44')]};return db['VoiceContext'][_0x51d2('0x26')](_0x30926c)[_0x51d2('0x2e')](function(_0x14a5fa){_0x35d43d[_0x51d2('0x26')]=_0x14a5fa;if(_0x15cea6[_0x51d2('0x39')][_0x51d2('0x4d')]){_0x2a651d[_0x51d2('0x4e')]=[{'all':!![]}];}return db[_0x51d2('0x36')]['findAll'](_0x2a651d);})[_0x51d2('0x2e')](function(_0x5c2218){_0x35d43d[_0x51d2('0x4f')]=_0x5c2218;return _0x35d43d;})[_0x51d2('0x2e')](respondWithFilteredResult(_0x45628d,_0x2a651d))[_0x51d2('0x22')](handleError(_0x45628d,null));};exports[_0x51d2('0x50')]=function(_0x1c72f4,_0x549ee4){var _0x2d87d6={'raw':![],'where':{'id':_0x1c72f4[_0x51d2('0x51')]['id']}},_0x45c35a={};_0x45c35a[_0x51d2('0x38')]=_['keys'](db[_0x51d2('0x36')][_0x51d2('0x37')]);_0x45c35a[_0x51d2('0x39')]=_['keys'](_0x1c72f4[_0x51d2('0x39')]);_0x45c35a[_0x51d2('0x3b')]=_[_0x51d2('0x3c')](_0x45c35a[_0x51d2('0x38')],_0x45c35a['query']);_0x2d87d6[_0x51d2('0x3d')]=_[_0x51d2('0x3c')](_0x45c35a[_0x51d2('0x38')],qs[_0x51d2('0x3e')](_0x1c72f4[_0x51d2('0x39')]['fields']));_0x2d87d6['attributes']=_0x2d87d6[_0x51d2('0x3d')][_0x51d2('0x3f')]?_0x2d87d6['attributes']:_0x45c35a[_0x51d2('0x38')];if(_0x1c72f4[_0x51d2('0x39')][_0x51d2('0x4d')]){_0x2d87d6[_0x51d2('0x4e')]=[{'all':!![]}];}_0x2d87d6=_[_0x51d2('0x47')]({},_0x2d87d6,_0x1c72f4[_0x51d2('0x4c')]);return db[_0x51d2('0x36')][_0x51d2('0x52')](_0x2d87d6)[_0x51d2('0x2e')](handleEntityNotFound(_0x549ee4,null))[_0x51d2('0x2e')](respondWithResult(_0x549ee4,null))[_0x51d2('0x22')](handleError(_0x549ee4,null));};exports['create']=function(_0xbc65e6,_0xc16140,_0x12793d){var _0xb45cf4;return db[_0x51d2('0x36')][_0x51d2('0x53')](_0xbc65e6[_0x51d2('0x54')],{'raw':!![]})[_0x51d2('0x2e')](function(_0x176503){_0xb45cf4=_0x176503;return db[_0x51d2('0x36')][_0x51d2('0x55')]({'raw':!![]});})[_0x51d2('0x2e')](function(_0x59a386){var _0x346512=fs[_0x51d2('0x56')](path[_0x51d2('0x57')](config['root'],_0x51d2('0x58')),'utf8');var _0x1a30f1=ejs['render'](_0x346512,{'contexts':_0x59a386||[]});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0x1a30f1);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x51d2('0x5b')});})[_0x51d2('0x2e')](function(){var _0x4ddcce=_0xbc65e6[_0x51d2('0x5c')][_0x51d2('0x5d')]({'plain':!![]});if(!_0x4ddcce)throw new Error(_0x51d2('0x5e'));if(_0x4ddcce[_0x51d2('0x5f')]===_0x51d2('0x5c')){var _0x434904=_0xb45cf4[_0x51d2('0x5d')]({'plain':!![]});return db[_0x51d2('0x60')]['find']({'where':{'name':_0x51d2('0x2f'),'userProfileId':_0x4ddcce[_0x51d2('0x61')]},'raw':!![]})[_0x51d2('0x2e')](function(_0x526364){if(_0x526364&&_0x526364[_0x51d2('0x62')]===0x0){return db[_0x51d2('0x30')][_0x51d2('0x53')]({'name':_0x434904[_0x51d2('0x33')],'resourceId':_0x434904['id'],'type':_0x526364['name'],'sectionId':_0x526364['id']},{})[_0x51d2('0x2e')](function(){return _0xb45cf4;});}else{return _0xb45cf4;}})[_0x51d2('0x22')](function(_0x578bb7){logger[_0x51d2('0x1f')](_0x51d2('0x63'),_0x578bb7);throw _0x578bb7;});}return _0xb45cf4;})[_0x51d2('0x2e')](respondWithResult(_0xc16140,0xc9))[_0x51d2('0x22')](handleError(_0xc16140,null));};exports[_0x51d2('0x2d')]=function(_0x481aba,_0x9effd8,_0x1fd038){var _0x5b7f23;return db[_0x51d2('0x36')][_0x51d2('0x52')]({'where':{'id':_0x481aba[_0x51d2('0x51')]['id']}})[_0x51d2('0x2e')](handleEntityNotFound(_0x9effd8,null))['then'](saveUpdates(_0x481aba[_0x51d2('0x54')],null))[_0x51d2('0x2e')](function(_0x173a01){if(_0x173a01){_0x5b7f23=_0x173a01;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x51d2('0x2e')](function(_0x288622){var _0x5897ad=fs['readFileSync'](path[_0x51d2('0x57')](config['root'],_0x51d2('0x58')),_0x51d2('0x64'));var _0x579e40=ejs['render'](_0x5897ad,{'contexts':_0x288622||[]});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0x579e40);})[_0x51d2('0x2e')](function(){return respondWithRpcPromise(_0x51d2('0x65'),_0x51d2('0x2d'),{'module':'chan_sip.so'});})[_0x51d2('0x2e')](function(){return _0x5b7f23;})[_0x51d2('0x2e')](respondWithResult(_0x9effd8,null))[_0x51d2('0x22')](handleError(_0x9effd8,null));};exports[_0x51d2('0x31')]=function(_0x8c7896,_0x5de6aa,_0x4eab51){var _0x468024;return db[_0x51d2('0x36')][_0x51d2('0x52')]({'where':{'id':_0x8c7896['params']['id']}})[_0x51d2('0x2e')](handleEntityNotFound(_0x5de6aa,null))['then'](removeEntity(_0x5de6aa,null))[_0x51d2('0x2e')](function(){return db['VoiceContext'][_0x51d2('0x55')]({'raw':!![]});})[_0x51d2('0x2e')](function(_0x2a5d14){var _0x4f83dc=fs['readFileSync'](path[_0x51d2('0x57')](config[_0x51d2('0x66')],'server/files/templates/context.ejs'),_0x51d2('0x64'));var _0xc6bbdf=ejs[_0x51d2('0x67')](_0x4f83dc,{'contexts':_0x2a5d14});fs[_0x51d2('0x59')](_0x51d2('0x5a'),_0xc6bbdf);return respondWithRpcPromise(_0x51d2('0x65'),'destroy',{'module':_0x51d2('0x5b')});})[_0x51d2('0x22')](handleError(_0x5de6aa,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index bc37598..3de21f2 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 _0x6bac=['exports','define','VoiceContext','voice_contexts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x2b7238,_0x22e973){var _0x413e1b=function(_0x53b78e){while(--_0x53b78e){_0x2b7238['push'](_0x2b7238['shift']());}};_0x413e1b(++_0x22e973);}(_0x6bac,0x7c));var _0xc6ba=function(_0x91641f,_0x53bd1b){_0x91641f=_0x91641f-0x0;var _0x4f94d2=_0x6bac[_0x91641f];return _0x4f94d2;};'use strict';var _=require('lodash');var util=require(_0xc6ba('0x0'));var logger=require(_0xc6ba('0x1'))('api');var moment=require(_0xc6ba('0x2'));var BPromise=require(_0xc6ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ba('0x4'));var rimraf=require(_0xc6ba('0x5'));var config=require(_0xc6ba('0x6'));var attributes=require(_0xc6ba('0x7'));module[_0xc6ba('0x8')]=function(_0xe0f12f,_0x375fdc){return _0xe0f12f[_0xc6ba('0x9')](_0xc6ba('0xa'),attributes,{'tableName':_0xc6ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd4c=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3885ea,_0x539be0){var _0x24d3c5=function(_0x3eedc6){while(--_0x3eedc6){_0x3885ea['push'](_0x3885ea['shift']());}};_0x24d3c5(++_0x539be0);}(_0xfd4c,0x1e6));var _0xcfd4=function(_0x1063f3,_0x12453d){_0x1063f3=_0x1063f3-0x0;var _0x46f4b8=_0xfd4c[_0x1063f3];return _0x46f4b8;};'use strict';var _=require(_0xcfd4('0x0'));var util=require(_0xcfd4('0x1'));var logger=require('../../config/logger')(_0xcfd4('0x2'));var moment=require(_0xcfd4('0x3'));var BPromise=require('bluebird');var rp=require(_0xcfd4('0x4'));var fs=require('fs');var path=require(_0xcfd4('0x5'));var rimraf=require(_0xcfd4('0x6'));var config=require(_0xcfd4('0x7'));var attributes=require(_0xcfd4('0x8'));module[_0xcfd4('0x9')]=function(_0x58e90d,_0x10f821){return _0x58e90d[_0xcfd4('0xa')](_0xcfd4('0xb'),attributes,{'tableName':_0xcfd4('0xc'),'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 3434669..aa14525 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 _0x3339=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','VoiceContext,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x3339,0xf1));var _0x9333=function(_0x462f03,_0x5d5aba){_0x462f03=_0x462f03-0x0;var _0x5268ed=_0x3339[_0x462f03];return _0x5268ed;};'use strict';var _=require(_0x9333('0x0'));var util=require(_0x9333('0x1'));var moment=require(_0x9333('0x2'));var BPromise=require(_0x9333('0x3'));var rs=require(_0x9333('0x4'));var fs=require('fs');var Redis=require(_0x9333('0x5'));var db=require(_0x9333('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9333('0x7'));var config=require(_0x9333('0x8'));var jayson=require(_0x9333('0x9'));var client=jayson['client'][_0x9333('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x379ec9,_0x3af575,_0x3ce4f8){return new BPromise(function(_0x449dd5,_0x37d034){return client[_0x9333('0xb')](_0x379ec9,_0x3ce4f8)[_0x9333('0xc')](function(_0x5e7019){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3af575,'request\x20sent');logger[_0x9333('0xd')](_0x9333('0xe'),_0x3af575,'request\x20sent',JSON['stringify'](_0x5e7019));if(_0x5e7019[_0x9333('0xf')]){if(_0x5e7019[_0x9333('0xf')][_0x9333('0x10')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3af575,_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);return _0x37d034(_0x5e7019[_0x9333('0xf')]['message']);}logger['error'](_0x9333('0x12'),_0x3af575,_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);return _0x449dd5(_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);}else{logger[_0x9333('0x13')](_0x9333('0x12'),_0x3af575,'request\x20sent');_0x449dd5(_0x5e7019[_0x9333('0x14')][_0x9333('0x11')]);}})[_0x9333('0x15')](function(_0x26aef8){logger[_0x9333('0xf')](_0x9333('0x12'),_0x3af575,_0x26aef8);_0x37d034(_0x26aef8);});});} \ No newline at end of file +var _0x7e25=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x52a181,_0x32dedc){var _0x4655dd=function(_0x2b6d67){while(--_0x2b6d67){_0x52a181['push'](_0x52a181['shift']());}};_0x4655dd(++_0x32dedc);}(_0x7e25,0xdd));var _0x57e2=function(_0x81697e,_0x552c16){_0x81697e=_0x81697e-0x0;var _0x1f6e36=_0x7e25[_0x81697e];return _0x1f6e36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57e2('0x0'));var BPromise=require(_0x57e2('0x1'));var rs=require(_0x57e2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57e2('0x3'))['db'];var utils=require(_0x57e2('0x4'));var logger=require(_0x57e2('0x5'))(_0x57e2('0x6'));var config=require('../../config/environment');var jayson=require(_0x57e2('0x7'));var client=jayson['client'][_0x57e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18d95d,_0x47bd40,_0x38a668){return new BPromise(function(_0x109b25,_0x24af83){return client[_0x57e2('0x9')](_0x18d95d,_0x38a668)[_0x57e2('0xa')](function(_0x2b0171){logger[_0x57e2('0xb')](_0x57e2('0xc'),_0x47bd40,_0x57e2('0xd'));logger[_0x57e2('0xe')](_0x57e2('0xf'),_0x47bd40,_0x57e2('0xd'),JSON['stringify'](_0x2b0171));if(_0x2b0171['error']){if(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x11')]===0x1f4){logger[_0x57e2('0x10')]('VoiceContext,\x20%s,\x20%s',_0x47bd40,_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);return _0x24af83(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);}logger[_0x57e2('0x10')](_0x57e2('0xc'),_0x47bd40,_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);return _0x109b25(_0x2b0171[_0x57e2('0x10')][_0x57e2('0x12')]);}else{logger[_0x57e2('0xb')](_0x57e2('0xc'),_0x47bd40,'request\x20sent');_0x109b25(_0x2b0171[_0x57e2('0x13')][_0x57e2('0x12')]);}})[_0x57e2('0x14')](function(_0x4a1eb2){logger[_0x57e2('0x10')]('VoiceContext,\x20%s,\x20%s',_0x47bd40,_0x4a1eb2);_0x24af83(_0x4a1eb2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c18d75b..689c622 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 _0x0628=['delete','destroy','util','path','express','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','put','update'];(function(_0xe28053,_0x42d05c){var _0x344c2a=function(_0x1532c4){while(--_0x1532c4){_0xe28053['push'](_0xe28053['shift']());}};_0x344c2a(++_0x42d05c);}(_0x0628,0x1af));var _0x8062=function(_0x11d65b,_0x175964){_0x11d65b=_0x11d65b-0x0;var _0x41e1c9=_0x0628[_0x11d65b];return _0x41e1c9;};'use strict';var multer=require('multer');var util=require(_0x8062('0x0'));var path=require(_0x8062('0x1'));var timeout=require('connect-timeout');var express=require(_0x8062('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8062('0x3'));var config=require('../../config/environment');var controller=require(_0x8062('0x4'));router[_0x8062('0x5')]('/',auth[_0x8062('0x6')](),controller['index']);router['get']('/describe',auth[_0x8062('0x6')](),controller[_0x8062('0x7')]);router['get'](_0x8062('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8062('0x6')](),controller['create']);router[_0x8062('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8062('0xa')]);router[_0x8062('0xb')](_0x8062('0x8'),auth[_0x8062('0x6')](),controller[_0x8062('0xc')]);module['exports']=router; \ No newline at end of file +var _0xd74c=['destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','post','create','put','/:id','delete'];(function(_0x5e436d,_0x592fe8){var _0x355f6e=function(_0x3981a0){while(--_0x3981a0){_0x5e436d['push'](_0x5e436d['shift']());}};_0x355f6e(++_0x592fe8);}(_0xd74c,0x112));var _0xcd74=function(_0x3e460f,_0x3b405a){_0x3e460f=_0x3e460f-0x0;var _0x47c13b=_0xd74c[_0x3e460f];return _0x47c13b;};'use strict';var multer=require('multer');var util=require(_0xcd74('0x0'));var path=require(_0xcd74('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcd74('0x2')]();var auth=require(_0xcd74('0x3'));var interaction=require(_0xcd74('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0xcd74('0x5')]('/',auth[_0xcd74('0x6')](),controller[_0xcd74('0x7')]);router[_0xcd74('0x5')]('/describe',auth[_0xcd74('0x6')](),controller[_0xcd74('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcd74('0x9')]('/',auth[_0xcd74('0x6')](),controller[_0xcd74('0xa')]);router[_0xcd74('0xb')](_0xcd74('0xc'),auth[_0xcd74('0x6')](),controller['update']);router[_0xcd74('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcd74('0xe')]);module[_0xcd74('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a831647..20d6734 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 _0xbba2=['STRING','INTEGER','DATE','sequelize','exports'];(function(_0x5db569,_0x25707b){var _0x247b44=function(_0x4b7dfd){while(--_0x4b7dfd){_0x5db569['push'](_0x5db569['shift']());}};_0x247b44(++_0x25707b);}(_0xbba2,0x6c));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2bba('0x0'));module[_0x2bba('0x1')]={'privilege':{'type':Sequelize[_0x2bba('0x2')]},'channel':{'type':Sequelize[_0x2bba('0x2')]},'channelstate':{'type':Sequelize[_0x2bba('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2bba('0x2')]},'calleridnum':{'type':Sequelize[_0x2bba('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2bba('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2bba('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2bba('0x2')]},'exten':{'type':Sequelize[_0x2bba('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2bba('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x2bba('0x2')]},'destchannelstate':{'type':Sequelize[_0x2bba('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2bba('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2bba('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2bba('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2bba('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2bba('0x2')]},'destcontext':{'type':Sequelize[_0x2bba('0x2')]},'destexten':{'type':Sequelize[_0x2bba('0x2')]},'destpriority':{'type':Sequelize[_0x2bba('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x2bba('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x2bba('0x2')]},'starttime':{'type':Sequelize[_0x2bba('0x4')]},'answertime':{'type':Sequelize[_0x2bba('0x4')]},'endtime':{'type':Sequelize[_0x2bba('0x4')]},'lastevent':{'type':Sequelize[_0x2bba('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x2bba('0x3')]},'duration':{'type':Sequelize[_0x2bba('0x3')]},'holdtime':{'type':Sequelize[_0x2bba('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb7ff=['sequelize','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3ebc3a,_0x2f47ea){var _0x158c41=function(_0x39a877){while(--_0x39a877){_0x3ebc3a['push'](_0x3ebc3a['shift']());}};_0x158c41(++_0x2f47ea);}(_0xb7ff,0x6e));var _0xfb7f=function(_0x34f64e,_0x36b50c){_0x34f64e=_0x34f64e-0x0;var _0x5eecc6=_0xb7ff[_0x34f64e];return _0x5eecc6;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xfb7f('0x1')]},'channel':{'type':Sequelize[_0xfb7f('0x1')]},'channelstate':{'type':Sequelize[_0xfb7f('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfb7f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfb7f('0x1')]},'connectedlinename':{'type':Sequelize[_0xfb7f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xfb7f('0x1')]},'context':{'type':Sequelize[_0xfb7f('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xfb7f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xfb7f('0x1')]},'destchannel':{'type':Sequelize[_0xfb7f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xfb7f('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfb7f('0x1')]},'destexten':{'type':Sequelize[_0xfb7f('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xfb7f('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xfb7f('0x1')]},'dialstatus':{'type':Sequelize[_0xfb7f('0x1')]},'starttime':{'type':Sequelize[_0xfb7f('0x3')]},'answertime':{'type':Sequelize[_0xfb7f('0x3')]},'endtime':{'type':Sequelize[_0xfb7f('0x3')]},'lastevent':{'type':Sequelize[_0xfb7f('0x1')],'comment':_0xfb7f('0x4')},'routeId':{'type':Sequelize[_0xfb7f('0x2')]},'duration':{'type':Sequelize[_0xfb7f('0x2')]},'holdtime':{'type':Sequelize[_0xfb7f('0x2')]},'billableseconds':{'type':Sequelize[_0xfb7f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index d20a26a..3db2a7d 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 _0xc9d4=['findAll','catch','keys','fields','include','find','create','VoiceDialReport','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','end','error','stack','name','send','index','rawAttributes','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc9d4,0xf0));var _0x4c9d=function(_0x5ee72e,_0x489c74){_0x5ee72e=_0x5ee72e-0x0;var _0x96d856=_0xc9d4[_0x5ee72e];return _0x96d856;};'use strict';var pdf=require(_0x4c9d('0x0'));var emlformat=require(_0x4c9d('0x1'));var rimraf=require(_0x4c9d('0x2'));var zipdir=require(_0x4c9d('0x3'));var jsonpatch=require(_0x4c9d('0x4'));var rp=require(_0x4c9d('0x5'));var moment=require(_0x4c9d('0x6'));var BPromise=require(_0x4c9d('0x7'));var Mustache=require(_0x4c9d('0x8'));var util=require(_0x4c9d('0x9'));var path=require(_0x4c9d('0xa'));var sox=require(_0x4c9d('0xb'));var csv=require(_0x4c9d('0xc'));var ejs=require(_0x4c9d('0xd'));var fs=require('fs');var _=require(_0x4c9d('0xe'));var squel=require(_0x4c9d('0xf'));var crypto=require('crypto');var jsforce=require(_0x4c9d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4c9d('0xc'));var querystring=require(_0x4c9d('0x11'));var Papa=require(_0x4c9d('0x12'));var Redis=require(_0x4c9d('0x13'));var authService=require(_0x4c9d('0x14'));var qs=require(_0x4c9d('0x15'));var hardwareService=require(_0x4c9d('0x16'));var logger=require(_0x4c9d('0x17'))(_0x4c9d('0x18'));var utils=require(_0x4c9d('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449d01,_0x3fea59){_0x3fea59=_0x3fea59||0xcc;return function(_0x28badc){if(_0x28badc){return _0x449d01[_0x4c9d('0x1a')](_0x3fea59);}return _0x449d01[_0x4c9d('0x1b')](_0x3fea59)['end']();};}function respondWithResult(_0x23ee64,_0x25bf2f){_0x25bf2f=_0x25bf2f||0xc8;return function(_0x579bd6){if(_0x579bd6){return _0x23ee64['status'](_0x25bf2f)[_0x4c9d('0x1c')](_0x579bd6);}};}function respondWithFilteredResult(_0xb0fa62,_0x3a81d4){return function(_0x2522e3){if(_0x2522e3){var _0x399c69=_0x2522e3[_0x4c9d('0x1d')],_0x3d2980=_0x3a81d4[_0x4c9d('0x1e')],_0x5eadc0=_0x3a81d4[_0x4c9d('0x1e')]+_0x3a81d4[_0x4c9d('0x1f')],_0x65ca85;if(_0x5eadc0>=_0x399c69){_0x5eadc0=_0x399c69;_0x65ca85=0xc8;}else{_0x65ca85=0xce;}_0xb0fa62[_0x4c9d('0x1b')](_0x65ca85);return _0xb0fa62[_0x4c9d('0x20')]('Content-Range',_0x3d2980+'-'+_0x5eadc0+'/'+_0x399c69)[_0x4c9d('0x1c')](_0x2522e3);}return null;};}function patchUpdates(_0x122063){return function(_0x4d36f3){try{jsonpatch[_0x4c9d('0x21')](_0x4d36f3,_0x122063,!![]);}catch(_0x64fd5b){return BPromise[_0x4c9d('0x22')](_0x64fd5b);}return _0x4d36f3['save']();};}function saveUpdates(_0x317565,_0x30ccaf){return function(_0x3ff54b){if(_0x3ff54b){return _0x3ff54b[_0x4c9d('0x23')](_0x317565)[_0x4c9d('0x24')](function(_0x5e064a){return _0x5e064a;});}return null;};}function removeEntity(_0x5b5202,_0x5acc74){return function(_0x471c1a){if(_0x471c1a){return _0x471c1a['destroy']()[_0x4c9d('0x24')](function(){_0x5b5202['status'](0xcc)[_0x4c9d('0x25')]();});}};}function handleEntityNotFound(_0x3b6c98,_0x1f77a0){return function(_0x580c94){if(!_0x580c94){_0x3b6c98[_0x4c9d('0x1a')](0x194);}return _0x580c94;};}function handleError(_0x27d5a9,_0x18806b){_0x18806b=_0x18806b||0x1f4;return function(_0x3cbd5d){logger[_0x4c9d('0x26')](_0x3cbd5d[_0x4c9d('0x27')]);if(_0x3cbd5d[_0x4c9d('0x28')]){delete _0x3cbd5d[_0x4c9d('0x28')];}_0x27d5a9[_0x4c9d('0x1b')](_0x18806b)[_0x4c9d('0x29')](_0x3cbd5d);};}exports[_0x4c9d('0x2a')]=function(_0x588f07,_0x2c86bb){var _0xfc6d04={},_0x19cca6={},_0x5745b7={'count':0x0,'rows':[]};var _0xa050fa=db['VoiceDialReport'][_0x4c9d('0x2b')];_0x19cca6['model']=_['keys'](_0xa050fa);_0x19cca6[_0x4c9d('0x2c')]=_['keys'](_0x588f07[_0x4c9d('0x2c')]);_0x19cca6[_0x4c9d('0x2d')]=_[_0x4c9d('0x2e')](_0x19cca6[_0x4c9d('0x2f')],_0x19cca6['query']);_0xfc6d04[_0x4c9d('0x30')]=_[_0x4c9d('0x2e')](_0x19cca6[_0x4c9d('0x2f')],qs['fields'](_0x588f07['query']['fields']));_0xfc6d04[_0x4c9d('0x30')]=_0xfc6d04[_0x4c9d('0x30')][_0x4c9d('0x31')]?_0xfc6d04['attributes']:_0x19cca6[_0x4c9d('0x2f')];if(!_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x32')](_0x4c9d('0x33'))){_0xfc6d04[_0x4c9d('0x1f')]=qs[_0x4c9d('0x1f')](_0x588f07['query'][_0x4c9d('0x1f')]);_0xfc6d04[_0x4c9d('0x1e')]=qs['offset'](_0x588f07[_0x4c9d('0x2c')]['offset']);}_0xfc6d04[_0x4c9d('0x34')]=qs[_0x4c9d('0x35')](_0x588f07['query'][_0x4c9d('0x35')]);_0xfc6d04['where']=qs[_0x4c9d('0x2d')](_['pick'](_0x588f07[_0x4c9d('0x2c')],_0x19cca6[_0x4c9d('0x2d')]));if(_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x36')]){_0xfc6d04[_0x4c9d('0x37')]=_[_0x4c9d('0x38')](_0xfc6d04[_0x4c9d('0x37')],{'$or':_[_0x4c9d('0x39')](_0xa050fa,function(_0x41580b){if(_0x41580b[_0x4c9d('0x3a')][_0x4c9d('0x3b')]!==_0x4c9d('0x3c')){var _0x143286={};_0x143286[_0x41580b[_0x4c9d('0x3d')]]={'$like':'%'+_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x36')]+'%'};return _0x143286;}})});}_0xfc6d04=_[_0x4c9d('0x38')]({},_0xfc6d04,_0x588f07[_0x4c9d('0x3e')]);var _0x16cbea={'where':_0xfc6d04['where']};return db['VoiceDialReport']['count'](_0x16cbea)[_0x4c9d('0x24')](function(_0x40eebe){_0x5745b7[_0x4c9d('0x1d')]=_0x40eebe;if(_0x588f07['query'][_0x4c9d('0x3f')]){_0xfc6d04['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x4c9d('0x40')](_0xfc6d04);})[_0x4c9d('0x24')](function(_0x4a1c3d){_0x5745b7['rows']=_0x4a1c3d;return _0x5745b7;})[_0x4c9d('0x24')](respondWithFilteredResult(_0x2c86bb,_0xfc6d04))[_0x4c9d('0x41')](handleError(_0x2c86bb,null));};exports['show']=function(_0x2b0b0a,_0x5aa548){var _0x4ee746={'raw':!![],'where':{'id':_0x2b0b0a['params']['id']}},_0x42c4f2={};_0x42c4f2[_0x4c9d('0x2f')]=_[_0x4c9d('0x42')](db['VoiceDialReport'][_0x4c9d('0x2b')]);_0x42c4f2['query']=_[_0x4c9d('0x42')](_0x2b0b0a['query']);_0x42c4f2[_0x4c9d('0x2d')]=_['intersection'](_0x42c4f2[_0x4c9d('0x2f')],_0x42c4f2['query']);_0x4ee746[_0x4c9d('0x30')]=_[_0x4c9d('0x2e')](_0x42c4f2[_0x4c9d('0x2f')],qs[_0x4c9d('0x43')](_0x2b0b0a[_0x4c9d('0x2c')][_0x4c9d('0x43')]));_0x4ee746[_0x4c9d('0x30')]=_0x4ee746['attributes'][_0x4c9d('0x31')]?_0x4ee746[_0x4c9d('0x30')]:_0x42c4f2[_0x4c9d('0x2f')];if(_0x2b0b0a['query'][_0x4c9d('0x3f')]){_0x4ee746[_0x4c9d('0x44')]=[{'all':!![]}];}_0x4ee746=_[_0x4c9d('0x38')]({},_0x4ee746,_0x2b0b0a['options']);return db['VoiceDialReport'][_0x4c9d('0x45')](_0x4ee746)[_0x4c9d('0x24')](handleEntityNotFound(_0x5aa548,null))[_0x4c9d('0x24')](respondWithResult(_0x5aa548,null))[_0x4c9d('0x41')](handleError(_0x5aa548,null));};exports[_0x4c9d('0x46')]=function(_0x4c5c1d,_0x1a901f){return db[_0x4c9d('0x47')][_0x4c9d('0x46')](_0x4c5c1d[_0x4c9d('0x48')],{})[_0x4c9d('0x24')](respondWithResult(_0x1a901f,0xc9))[_0x4c9d('0x41')](handleError(_0x1a901f,null));};exports[_0x4c9d('0x23')]=function(_0x12c737,_0x419289){if(_0x12c737[_0x4c9d('0x48')]['id']){delete _0x12c737[_0x4c9d('0x48')]['id'];}return db['VoiceDialReport'][_0x4c9d('0x45')]({'where':{'id':_0x12c737[_0x4c9d('0x49')]['id']}})[_0x4c9d('0x24')](handleEntityNotFound(_0x419289,null))[_0x4c9d('0x24')](saveUpdates(_0x12c737[_0x4c9d('0x48')],null))[_0x4c9d('0x24')](respondWithResult(_0x419289,null))[_0x4c9d('0x41')](handleError(_0x419289,null));};exports[_0x4c9d('0x4a')]=function(_0x2269d3,_0x2690d9){return db[_0x4c9d('0x47')][_0x4c9d('0x45')]({'where':{'id':_0x2269d3['params']['id']}})[_0x4c9d('0x24')](handleEntityNotFound(_0x2690d9,null))['then'](removeEntity(_0x2690d9,null))[_0x4c9d('0x41')](handleError(_0x2690d9,null));};exports[_0x4c9d('0x4b')]=function(_0x512f64,_0xe2681f){return db[_0x4c9d('0x47')][_0x4c9d('0x4b')]()[_0x4c9d('0x24')](respondWithResult(_0xe2681f,null))[_0x4c9d('0x41')](handleError(_0xe2681f,null));}; \ No newline at end of file +var _0xa0e2=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VoiceDialReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xa0e2,0xaa));var _0x2a0e=function(_0x52af0a,_0x2a86e3){_0x52af0a=_0x52af0a-0x0;var _0x2bfc96=_0xa0e2[_0x52af0a];return _0x2bfc96;};'use strict';var pdf=require(_0x2a0e('0x0'));var emlformat=require(_0x2a0e('0x1'));var rimraf=require(_0x2a0e('0x2'));var zipdir=require(_0x2a0e('0x3'));var jsonpatch=require(_0x2a0e('0x4'));var rp=require(_0x2a0e('0x5'));var moment=require(_0x2a0e('0x6'));var BPromise=require(_0x2a0e('0x7'));var Mustache=require(_0x2a0e('0x8'));var util=require(_0x2a0e('0x9'));var path=require(_0x2a0e('0xa'));var sox=require('sox');var csv=require(_0x2a0e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a0e('0xc'));var jsforce=require(_0x2a0e('0xd'));var deskjs=require(_0x2a0e('0xe'));var toCsv=require(_0x2a0e('0xb'));var querystring=require(_0x2a0e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a0e('0x10'));var hardwareService=require(_0x2a0e('0x11'));var logger=require(_0x2a0e('0x12'))(_0x2a0e('0x13'));var utils=require(_0x2a0e('0x14'));var config=require(_0x2a0e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262f88,_0xc78297){_0xc78297=_0xc78297||0xcc;return function(_0x59322f){if(_0x59322f){return _0x262f88[_0x2a0e('0x16')](_0xc78297);}return _0x262f88[_0x2a0e('0x17')](_0xc78297)[_0x2a0e('0x18')]();};}function respondWithResult(_0x24989a,_0x1628b0){_0x1628b0=_0x1628b0||0xc8;return function(_0xe3b396){if(_0xe3b396){return _0x24989a[_0x2a0e('0x17')](_0x1628b0)[_0x2a0e('0x19')](_0xe3b396);}};}function respondWithFilteredResult(_0x2daf40,_0x2530cd){return function(_0x48cb5b){if(_0x48cb5b){var _0x62c4e8=_0x48cb5b[_0x2a0e('0x1a')],_0x23f640=_0x2530cd[_0x2a0e('0x1b')],_0x426646=_0x2530cd[_0x2a0e('0x1b')]+_0x2530cd['limit'],_0x1adc2d;if(_0x426646>=_0x62c4e8){_0x426646=_0x62c4e8;_0x1adc2d=0xc8;}else{_0x1adc2d=0xce;}_0x2daf40[_0x2a0e('0x17')](_0x1adc2d);return _0x2daf40[_0x2a0e('0x1c')](_0x2a0e('0x1d'),_0x23f640+'-'+_0x426646+'/'+_0x62c4e8)[_0x2a0e('0x19')](_0x48cb5b);}return null;};}function patchUpdates(_0x31d271){return function(_0x5265b7){try{jsonpatch[_0x2a0e('0x1e')](_0x5265b7,_0x31d271,!![]);}catch(_0x24e7f7){return BPromise[_0x2a0e('0x1f')](_0x24e7f7);}return _0x5265b7['save']();};}function saveUpdates(_0x19972b,_0x961c0a){return function(_0x160c8f){if(_0x160c8f){return _0x160c8f[_0x2a0e('0x20')](_0x19972b)[_0x2a0e('0x21')](function(_0x75ead2){return _0x75ead2;});}return null;};}function removeEntity(_0x2e5a29,_0x49ba44){return function(_0x2762b2){if(_0x2762b2){return _0x2762b2[_0x2a0e('0x22')]()[_0x2a0e('0x21')](function(){_0x2e5a29[_0x2a0e('0x17')](0xcc)[_0x2a0e('0x18')]();});}};}function handleEntityNotFound(_0x575860,_0x229e23){return function(_0x179e7f){if(!_0x179e7f){_0x575860['sendStatus'](0x194);}return _0x179e7f;};}function handleError(_0x2e6081,_0x44ca42){_0x44ca42=_0x44ca42||0x1f4;return function(_0x213719){logger[_0x2a0e('0x23')](_0x213719[_0x2a0e('0x24')]);if(_0x213719[_0x2a0e('0x25')]){delete _0x213719[_0x2a0e('0x25')];}_0x2e6081[_0x2a0e('0x17')](_0x44ca42)['send'](_0x213719);};}exports[_0x2a0e('0x26')]=function(_0x44f5b6,_0x5d8d67){var _0x26d967={},_0x2eb3cc={},_0x183e78={'count':0x0,'rows':[]};var _0x48fd28=db[_0x2a0e('0x27')][_0x2a0e('0x28')];_0x2eb3cc[_0x2a0e('0x29')]=_['keys'](_0x48fd28);_0x2eb3cc[_0x2a0e('0x2a')]=_[_0x2a0e('0x2b')](_0x44f5b6[_0x2a0e('0x2a')]);_0x2eb3cc[_0x2a0e('0x2c')]=_[_0x2a0e('0x2d')](_0x2eb3cc[_0x2a0e('0x29')],_0x2eb3cc[_0x2a0e('0x2a')]);_0x26d967[_0x2a0e('0x2e')]=_[_0x2a0e('0x2d')](_0x2eb3cc['model'],qs[_0x2a0e('0x2f')](_0x44f5b6['query'][_0x2a0e('0x2f')]));_0x26d967[_0x2a0e('0x2e')]=_0x26d967['attributes'][_0x2a0e('0x30')]?_0x26d967['attributes']:_0x2eb3cc[_0x2a0e('0x29')];if(!_0x44f5b6['query'][_0x2a0e('0x31')](_0x2a0e('0x32'))){_0x26d967['limit']=qs[_0x2a0e('0x33')](_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x33')]);_0x26d967['offset']=qs['offset'](_0x44f5b6['query'][_0x2a0e('0x1b')]);}_0x26d967[_0x2a0e('0x34')]=qs[_0x2a0e('0x35')](_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x35')]);_0x26d967[_0x2a0e('0x36')]=qs[_0x2a0e('0x2c')](_[_0x2a0e('0x37')](_0x44f5b6[_0x2a0e('0x2a')],_0x2eb3cc[_0x2a0e('0x2c')]));if(_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x38')]){_0x26d967[_0x2a0e('0x36')]=_[_0x2a0e('0x39')](_0x26d967[_0x2a0e('0x36')],{'$or':_[_0x2a0e('0x3a')](_0x48fd28,function(_0x6bdaa5){if(_0x6bdaa5[_0x2a0e('0x3b')][_0x2a0e('0x3c')]!==_0x2a0e('0x3d')){var _0x2c0ac4={};_0x2c0ac4[_0x6bdaa5[_0x2a0e('0x3e')]]={'$like':'%'+_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x38')]+'%'};return _0x2c0ac4;}})});}_0x26d967=_[_0x2a0e('0x39')]({},_0x26d967,_0x44f5b6[_0x2a0e('0x3f')]);var _0x24f020={'where':_0x26d967[_0x2a0e('0x36')]};return db[_0x2a0e('0x27')][_0x2a0e('0x1a')](_0x24f020)['then'](function(_0x59734f){_0x183e78[_0x2a0e('0x1a')]=_0x59734f;if(_0x44f5b6[_0x2a0e('0x2a')][_0x2a0e('0x40')]){_0x26d967[_0x2a0e('0x41')]=[{'all':!![]}];}return db[_0x2a0e('0x27')]['findAll'](_0x26d967);})['then'](function(_0x1f6db3){_0x183e78[_0x2a0e('0x42')]=_0x1f6db3;return _0x183e78;})[_0x2a0e('0x21')](respondWithFilteredResult(_0x5d8d67,_0x26d967))[_0x2a0e('0x43')](handleError(_0x5d8d67,null));};exports[_0x2a0e('0x44')]=function(_0x41bd5d,_0x2ace69){var _0x3e75e9={'raw':!![],'where':{'id':_0x41bd5d[_0x2a0e('0x45')]['id']}},_0x1133ff={};_0x1133ff[_0x2a0e('0x29')]=_[_0x2a0e('0x2b')](db[_0x2a0e('0x27')]['rawAttributes']);_0x1133ff[_0x2a0e('0x2a')]=_[_0x2a0e('0x2b')](_0x41bd5d[_0x2a0e('0x2a')]);_0x1133ff[_0x2a0e('0x2c')]=_[_0x2a0e('0x2d')](_0x1133ff[_0x2a0e('0x29')],_0x1133ff[_0x2a0e('0x2a')]);_0x3e75e9[_0x2a0e('0x2e')]=_['intersection'](_0x1133ff[_0x2a0e('0x29')],qs[_0x2a0e('0x2f')](_0x41bd5d['query'][_0x2a0e('0x2f')]));_0x3e75e9[_0x2a0e('0x2e')]=_0x3e75e9['attributes'][_0x2a0e('0x30')]?_0x3e75e9['attributes']:_0x1133ff[_0x2a0e('0x29')];if(_0x41bd5d['query']['includeAll']){_0x3e75e9[_0x2a0e('0x41')]=[{'all':!![]}];}_0x3e75e9=_[_0x2a0e('0x39')]({},_0x3e75e9,_0x41bd5d[_0x2a0e('0x3f')]);return db[_0x2a0e('0x27')][_0x2a0e('0x46')](_0x3e75e9)[_0x2a0e('0x21')](handleEntityNotFound(_0x2ace69,null))[_0x2a0e('0x21')](respondWithResult(_0x2ace69,null))[_0x2a0e('0x43')](handleError(_0x2ace69,null));};exports[_0x2a0e('0x47')]=function(_0x5ce514,_0x538a92){return db[_0x2a0e('0x27')]['create'](_0x5ce514[_0x2a0e('0x48')],{})['then'](respondWithResult(_0x538a92,0xc9))[_0x2a0e('0x43')](handleError(_0x538a92,null));};exports[_0x2a0e('0x20')]=function(_0x1f01f3,_0x417952){if(_0x1f01f3[_0x2a0e('0x48')]['id']){delete _0x1f01f3[_0x2a0e('0x48')]['id'];}return db[_0x2a0e('0x27')][_0x2a0e('0x46')]({'where':{'id':_0x1f01f3[_0x2a0e('0x45')]['id']}})[_0x2a0e('0x21')](handleEntityNotFound(_0x417952,null))[_0x2a0e('0x21')](saveUpdates(_0x1f01f3[_0x2a0e('0x48')],null))[_0x2a0e('0x21')](respondWithResult(_0x417952,null))['catch'](handleError(_0x417952,null));};exports['destroy']=function(_0x387efc,_0xb5227){return db[_0x2a0e('0x27')]['find']({'where':{'id':_0x387efc['params']['id']}})[_0x2a0e('0x21')](handleEntityNotFound(_0xb5227,null))[_0x2a0e('0x21')](removeEntity(_0xb5227,null))[_0x2a0e('0x43')](handleError(_0xb5227,null));};exports[_0x2a0e('0x49')]=function(_0x5504f5,_0x5e515d){return db[_0x2a0e('0x27')]['describe']()[_0x2a0e('0x21')](respondWithResult(_0x5e515d,null))[_0x2a0e('0x43')](handleError(_0x5e515d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1b9f90b..43c7028 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 _0x94df=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x94df,0xa3));var _0xf94d=function(_0x5975af,_0x4aac11){_0x5975af=_0x5975af-0x0;var _0x1e4e07=_0x94df[_0x5975af];return _0x1e4e07;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var logger=require(_0xf94d('0x2'))(_0xf94d('0x3'));var moment=require(_0xf94d('0x4'));var BPromise=require(_0xf94d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf94d('0x6'));var rimraf=require(_0xf94d('0x7'));var config=require(_0xf94d('0x8'));var attributes=require(_0xf94d('0x9'));module[_0xf94d('0xa')]=function(_0x32b0bd,_0x40bfd4){return _0x32b0bd[_0xf94d('0xb')](_0xf94d('0xc'),attributes,{'tableName':_0xf94d('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf94d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f69=['uniqueid','../../config/logger','moment','bluebird','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x0f69,0x173));var _0x90f6=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x0f69[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90f6('0x0'))('api');var moment=require(_0x90f6('0x1'));var BPromise=require(_0x90f6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f6('0x3'));var rimraf=require(_0x90f6('0x4'));var config=require('../../config/environment');var attributes=require(_0x90f6('0x5'));module['exports']=function(_0x1840a5,_0x3dfd95){return _0x1840a5[_0x90f6('0x6')](_0x90f6('0x7'),attributes,{'tableName':_0x90f6('0x8'),'paranoid':![],'indexes':[{'fields':[_0x90f6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 46c28e5..ce94969 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 _0x4f99=['message','result','create','body','options','raw','CreateVoiceDialReport','VoiceDialReport','update','attributes','limit','UpdateVoiceDialReport','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f99,0x157));var _0x94f9=function(_0xe6055a,_0x51b582){_0xe6055a=_0xe6055a-0x0;var _0x66d236=_0x4f99[_0xe6055a];return _0x66d236;};'use strict';var _=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var moment=require('moment');var BPromise=require(_0x94f9('0x2'));var rs=require(_0x94f9('0x3'));var fs=require('fs');var Redis=require(_0x94f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94f9('0x5'));var logger=require(_0x94f9('0x6'))('rpc');var config=require(_0x94f9('0x7'));var jayson=require(_0x94f9('0x8'));var client=jayson[_0x94f9('0x9')][_0x94f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36bfd9,_0x484a54,_0x1e4823){return new BPromise(function(_0x5a4301,_0x3550f0){return client['request'](_0x36bfd9,_0x1e4823)[_0x94f9('0xb')](function(_0x50af31){logger[_0x94f9('0xc')](_0x94f9('0xd'),_0x484a54,_0x94f9('0xe'));logger[_0x94f9('0xf')](_0x94f9('0x10'),_0x484a54,_0x94f9('0xe'),JSON[_0x94f9('0x11')](_0x50af31));if(_0x50af31['error']){if(_0x50af31[_0x94f9('0x12')][_0x94f9('0x13')]===0x1f4){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x3550f0(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x5a4301(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}else{logger[_0x94f9('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x484a54,_0x94f9('0xe'));_0x5a4301(_0x50af31[_0x94f9('0x15')][_0x94f9('0x14')]);}})['catch'](function(_0x490841){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x490841);_0x3550f0(_0x490841);});});}exports['CreateVoiceDialReport']=function(_0x2d1f09){var _0x5b0e86=this;return new Promise(function(_0x2f3ded,_0x46372b){return db['VoiceDialReport'][_0x94f9('0x16')](_0x2d1f09[_0x94f9('0x17')],{'raw':_0x2d1f09[_0x94f9('0x18')]?_0x2d1f09[_0x94f9('0x18')][_0x94f9('0x19')]===undefined?!![]:![]:!![]})[_0x94f9('0xb')](function(_0x4b9051){logger[_0x94f9('0xc')]('CreateVoiceDialReport',_0x2d1f09);logger['debug'](_0x94f9('0x1a'),_0x2d1f09,JSON[_0x94f9('0x11')](_0x4b9051));_0x2f3ded(_0x4b9051);})['catch'](function(_0x8dca1c){logger[_0x94f9('0x12')](_0x94f9('0x1a'),_0x8dca1c[_0x94f9('0x14')],_0x2d1f09);_0x46372b(_0x5b0e86[_0x94f9('0x12')](0x1f4,_0x8dca1c[_0x94f9('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x35851e){var _0x152f40=this;return new Promise(function(_0x16f655,_0x267216){return db[_0x94f9('0x1b')][_0x94f9('0x1c')](_0x35851e['body'],{'raw':_0x35851e['options']?_0x35851e['options'][_0x94f9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35851e['options']?_0x35851e['options']['where']||null:null,'attributes':_0x35851e[_0x94f9('0x18')]?_0x35851e[_0x94f9('0x18')][_0x94f9('0x1d')]||null:null,'limit':_0x35851e[_0x94f9('0x18')]?_0x35851e[_0x94f9('0x18')][_0x94f9('0x1e')]||null:null})['then'](function(_0x4a6e12){logger[_0x94f9('0xc')](_0x94f9('0x1f'),_0x35851e);logger['debug'](_0x94f9('0x1f'),_0x35851e,JSON[_0x94f9('0x11')](_0x4a6e12));_0x16f655(_0x4a6e12);})[_0x94f9('0x20')](function(_0x20984c){logger[_0x94f9('0x12')](_0x94f9('0x1f'),_0x20984c[_0x94f9('0x14')],_0x35851e);_0x267216(_0x152f40['error'](0x1f4,_0x20984c[_0x94f9('0x14')]));});});}; \ No newline at end of file +var _0x57cf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceDialReport','body','options','CreateVoiceDialReport','raw','where','attributes','then','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring'];(function(_0x12cbd8,_0x8ef0ce){var _0x2fb1ab=function(_0x57242c){while(--_0x57242c){_0x12cbd8['push'](_0x12cbd8['shift']());}};_0x2fb1ab(++_0x8ef0ce);}(_0x57cf,0x11b));var _0xf57c=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0x57cf[_0x130705];return _0x1fa991;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var moment=require(_0xf57c('0x2'));var BPromise=require(_0xf57c('0x3'));var rs=require(_0xf57c('0x4'));var fs=require('fs');var Redis=require(_0xf57c('0x5'));var db=require(_0xf57c('0x6'))['db'];var utils=require(_0xf57c('0x7'));var logger=require(_0xf57c('0x8'))(_0xf57c('0x9'));var config=require('../../config/environment');var jayson=require(_0xf57c('0xa'));var client=jayson['client'][_0xf57c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5816f5,_0x53ed52,_0x21a69d){return new BPromise(function(_0x4867f6,_0x2cbb69){return client[_0xf57c('0xc')](_0x5816f5,_0x21a69d)['then'](function(_0x5b5314){logger[_0xf57c('0xd')](_0xf57c('0xe'),_0x53ed52,_0xf57c('0xf'));logger[_0xf57c('0x10')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x53ed52,_0xf57c('0xf'),JSON[_0xf57c('0x11')](_0x5b5314));if(_0x5b5314[_0xf57c('0x12')]){if(_0x5b5314['error'][_0xf57c('0x13')]===0x1f4){logger['error'](_0xf57c('0xe'),_0x53ed52,_0x5b5314[_0xf57c('0x12')]['message']);return _0x2cbb69(_0x5b5314[_0xf57c('0x12')]['message']);}logger[_0xf57c('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x53ed52,_0x5b5314[_0xf57c('0x12')][_0xf57c('0x14')]);return _0x4867f6(_0x5b5314[_0xf57c('0x12')][_0xf57c('0x14')]);}else{logger[_0xf57c('0xd')](_0xf57c('0xe'),_0x53ed52,_0xf57c('0xf'));_0x4867f6(_0x5b5314[_0xf57c('0x15')]['message']);}})[_0xf57c('0x16')](function(_0x524084){logger[_0xf57c('0x12')](_0xf57c('0xe'),_0x53ed52,_0x524084);_0x2cbb69(_0x524084);});});}exports['CreateVoiceDialReport']=function(_0x385a4f){var _0x36723a=this;return new Promise(function(_0x3eb951,_0x9ede98){return db[_0xf57c('0x17')]['create'](_0x385a4f[_0xf57c('0x18')],{'raw':_0x385a4f[_0xf57c('0x19')]?_0x385a4f[_0xf57c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3ac299){logger[_0xf57c('0xd')](_0xf57c('0x1a'),_0x385a4f);logger[_0xf57c('0x10')](_0xf57c('0x1a'),_0x385a4f,JSON[_0xf57c('0x11')](_0x3ac299));_0x3eb951(_0x3ac299);})[_0xf57c('0x16')](function(_0x396e18){logger[_0xf57c('0x12')]('CreateVoiceDialReport',_0x396e18[_0xf57c('0x14')],_0x385a4f);_0x9ede98(_0x36723a[_0xf57c('0x12')](0x1f4,_0x396e18['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3c4923){var _0x53ea83=this;return new Promise(function(_0x1741cd,_0xcde0f0){return db[_0xf57c('0x17')]['update'](_0x3c4923[_0xf57c('0x18')],{'raw':_0x3c4923[_0xf57c('0x19')]?_0x3c4923['options'][_0xf57c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')][_0xf57c('0x1c')]||null:null,'attributes':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')][_0xf57c('0x1d')]||null:null,'limit':_0x3c4923[_0xf57c('0x19')]?_0x3c4923[_0xf57c('0x19')]['limit']||null:null})[_0xf57c('0x1e')](function(_0x1f5f3b){logger['info'](_0xf57c('0x1f'),_0x3c4923);logger[_0xf57c('0x10')](_0xf57c('0x1f'),_0x3c4923,JSON[_0xf57c('0x11')](_0x1f5f3b));_0x1741cd(_0x1f5f3b);})[_0xf57c('0x16')](function(_0x3bf095){logger[_0xf57c('0x12')](_0xf57c('0x1f'),_0x3bf095[_0xf57c('0x14')],_0x3c4923);_0xcde0f0(_0x53ea83[_0xf57c('0x12')](0x1f4,_0x3bf095['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 5c1ca71..5063e0b 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 _0x390a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','post','/:id/applications','update','exports','multer','util','path'];(function(_0x342116,_0x51b80a){var _0x166870=function(_0x550702){while(--_0x550702){_0x342116['push'](_0x342116['shift']());}};_0x166870(++_0x51b80a);}(_0x390a,0xc9));var _0xa390=function(_0x484fbe,_0x322832){_0x484fbe=_0x484fbe-0x0;var _0x2f9ebb=_0x390a[_0x484fbe];return _0x2f9ebb;};'use strict';var multer=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var path=require(_0xa390('0x2'));var timeout=require(_0xa390('0x3'));var express=require('express');var router=express[_0xa390('0x4')]();var auth=require(_0xa390('0x5'));var interaction=require(_0xa390('0x6'));var config=require(_0xa390('0x7'));var controller=require('./voiceExtension.controller');router[_0xa390('0x8')]('/',auth[_0xa390('0x9')](),controller[_0xa390('0xa')]);router['get'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['show']);router['post']('/',auth[_0xa390('0x9')](),controller[_0xa390('0xc')]);router[_0xa390('0xd')](_0xa390('0xe'),auth[_0xa390('0x9')](),controller['addApplications']);router['put'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller[_0xa390('0xf')]);router['delete'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['destroy']);module[_0xa390('0x10')]=router; \ No newline at end of file +var _0x0c71=['get','isAuthenticated','index','/:id','post','addApplications','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c71,0xfb));var _0x10c7=function(_0x525d27,_0x28306c){_0x525d27=_0x525d27-0x0;var _0x59ef61=_0x0c71[_0x525d27];return _0x59ef61;};'use strict';var multer=require('multer');var util=require(_0x10c7('0x0'));var path=require('path');var timeout=require(_0x10c7('0x1'));var express=require(_0x10c7('0x2'));var router=express[_0x10c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x10c7('0x4'));var controller=require('./voiceExtension.controller');router[_0x10c7('0x5')]('/',auth[_0x10c7('0x6')](),controller[_0x10c7('0x7')]);router[_0x10c7('0x5')](_0x10c7('0x8'),auth[_0x10c7('0x6')](),controller['show']);router[_0x10c7('0x9')]('/',auth[_0x10c7('0x6')](),controller['create']);router[_0x10c7('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x10c7('0xa')]);router[_0x10c7('0xb')]('/:id',auth[_0x10c7('0x6')](),controller[_0x10c7('0xc')]);router[_0x10c7('0xd')](_0x10c7('0x8'),auth[_0x10c7('0x6')](),controller[_0x10c7('0xe')]);module[_0x10c7('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 4e7d385..68b8ad4 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 _0x9354=['NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9354,0x96));var _0x4935=function(_0x494a42,_0x1f2103){_0x494a42=_0x494a42-0x0;var _0x254792=_0x9354[_0x494a42];return _0x254792;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'context':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':_0x4935('0x2')},'priority':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x4935('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':_0x4935('0x3')},'appdata':{'type':Sequelize[_0x4935('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4935('0x4')](_0x4935('0x5'),_0x4935('0x6'),_0x4935('0x7'),_0x4935('0x8'),_0x4935('0x9'),'system',_0x4935('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':_0x4935('0xb')},'IntervalId':{'type':Sequelize[_0x4935('0xc')]},'isApp':{'type':Sequelize[_0x4935('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4935('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4935('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x4935('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x4935('0xe')],'get':function(_0x32916f){return this[_0x4935('0xf')](_0x4935('0x10'));}}}; \ No newline at end of file +var _0x4e81=['NoOp','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','exten','sequelize','exports','STRING','compositeIndex'];(function(_0x55e5b9,_0x1be20e){var _0x58d1e7=function(_0x3cba6d){while(--_0x3cba6d){_0x55e5b9['push'](_0x55e5b9['shift']());}};_0x58d1e7(++_0x1be20e);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4e81[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'context':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x14e8('0x3')},'tag':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':_0x14e8('0x4')},'appdata':{'type':Sequelize[_0x14e8('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x14e8('0x5'),_0x14e8('0x6'),_0x14e8('0x7'),_0x14e8('0x8'),_0x14e8('0x9'),_0x14e8('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x14e8('0x2')]},'interval':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'defaultValue':_0x14e8('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x14e8('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x14e8('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x14e8('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x14e8('0xd')]},'recordingFormat':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':_0x14e8('0xe')},'answer':{'type':Sequelize[_0x14e8('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x37eccb){return this['getDataValue'](_0x14e8('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 6707798..51b286d 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 _0xc97f=['apply','reject','save','update','destroy','then','inbound','OutboundRoutes','InternalRoutes','internal','ignore','map','value','includes','type','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','key','field','options','includeAll','include','rows','catch','show','params','length','find','body','outbound','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x4fdb24,_0x1cbee6){var _0x21abd1=function(_0x3e4c28){while(--_0x3e4c28){_0x4fdb24['push'](_0x4fdb24['shift']());}};_0x21abd1(++_0x1cbee6);}(_0xc97f,0xb0));var _0xfc97=function(_0xefebe8,_0x3c9675){_0xefebe8=_0xefebe8-0x0;var _0x1f0046=_0xc97f[_0xefebe8];return _0x1f0046;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc97('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc97('0x1'));var rp=require(_0xfc97('0x2'));var moment=require('moment');var BPromise=require(_0xfc97('0x3'));var Mustache=require(_0xfc97('0x4'));var util=require(_0xfc97('0x5'));var path=require(_0xfc97('0x6'));var sox=require('sox');var csv=require(_0xfc97('0x7'));var ejs=require(_0xfc97('0x8'));var fs=require('fs');var _=require(_0xfc97('0x9'));var squel=require(_0xfc97('0xa'));var crypto=require(_0xfc97('0xb'));var jsforce=require(_0xfc97('0xc'));var deskjs=require(_0xfc97('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc97('0xe'));var authService=require(_0xfc97('0xf'));var qs=require(_0xfc97('0x10'));var hardwareService=require(_0xfc97('0x11'));var logger=require('../../config/logger')(_0xfc97('0x12'));var utils=require(_0xfc97('0x13'));var config=require(_0xfc97('0x14'));var db=require(_0xfc97('0x15'))['db'];config['redis']=_[_0xfc97('0x16')](config[_0xfc97('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc97('0x18'))(new Redis(config['redis']));require(_0xfc97('0x19'))['register'](socket);function respondWithStatusCode(_0x3d9c8c,_0x32e2c0){_0x32e2c0=_0x32e2c0||0xcc;return function(_0x4bad2b){if(_0x4bad2b){return _0x3d9c8c[_0xfc97('0x1a')](_0x32e2c0);}return _0x3d9c8c[_0xfc97('0x1b')](_0x32e2c0)[_0xfc97('0x1c')]();};}function respondWithResult(_0x3200c9,_0x592bf2){_0x592bf2=_0x592bf2||0xc8;return function(_0x5c0bbf){if(_0x5c0bbf){return _0x3200c9[_0xfc97('0x1b')](_0x592bf2)[_0xfc97('0x1d')](_0x5c0bbf);}};}function respondWithFilteredResult(_0x311a27,_0x53a720){return function(_0x5c1bcb){if(_0x5c1bcb){var _0x506cbe=_0x5c1bcb[_0xfc97('0x1e')],_0x3cf127=_0x53a720[_0xfc97('0x1f')],_0x340071=_0x53a720['offset']+_0x53a720[_0xfc97('0x20')],_0x133848;if(_0x340071>=_0x506cbe){_0x340071=_0x506cbe;_0x133848=0xc8;}else{_0x133848=0xce;}_0x311a27['status'](_0x133848);return _0x311a27['set'](_0xfc97('0x21'),_0x3cf127+'-'+_0x340071+'/'+_0x506cbe)[_0xfc97('0x1d')](_0x5c1bcb);}return null;};}function patchUpdates(_0x27c789){return function(_0x23a727){try{jsonpatch[_0xfc97('0x22')](_0x23a727,_0x27c789,!![]);}catch(_0x299bd3){return BPromise[_0xfc97('0x23')](_0x299bd3);}return _0x23a727[_0xfc97('0x24')]();};}function saveUpdates(_0x36df40,_0x546f23){return function(_0x2cf679){if(_0x2cf679){return _0x2cf679[_0xfc97('0x25')](_0x36df40)['then'](function(_0x462a47){return _0x462a47;});}return null;};}function removeEntity(_0x46d233,_0x5ea573){return function(_0x55693c){if(_0x55693c){return _0x55693c[_0xfc97('0x26')]()[_0xfc97('0x27')](function(){var _0x1e8340=_0x55693c['get']({'plain':!![]});var _0x1c8cb4=[{'name':'InboundRoutes','value':_0xfc97('0x28'),'ignore':![]},{'name':_0xfc97('0x29'),'value':'outbound','ignore':![]},{'name':_0xfc97('0x2a'),'value':_0xfc97('0x2b'),'ignore':![]}];var _0x811c86=_(_0x1c8cb4)['filter'](_0xfc97('0x2c'))[_0xfc97('0x2d')]('value')[_0xfc97('0x2e')]();if(_[_0xfc97('0x2f')](_0x811c86,_0x1e8340['type'])){return;}var _0x2d29dc=_['find'](_0x1c8cb4,[_0xfc97('0x2e'),_0x1e8340[_0xfc97('0x30')]])['name'];return db[_0xfc97('0x31')][_0xfc97('0x26')]({'where':{'type':_0x2d29dc,'resourceId':_0x1e8340['id']}})[_0xfc97('0x27')](function(){return _0x55693c;});})[_0xfc97('0x27')](function(){_0x46d233['status'](0xcc)[_0xfc97('0x1c')]();});}};}function handleEntityNotFound(_0xb0f5d2,_0x3e69b9){return function(_0x19dc43){if(!_0x19dc43){_0xb0f5d2[_0xfc97('0x1a')](0x194);}return _0x19dc43;};}function handleError(_0x2bf631,_0x13f7c4){_0x13f7c4=_0x13f7c4||0x1f4;return function(_0x3039fb){logger[_0xfc97('0x32')](_0x3039fb[_0xfc97('0x33')]);if(_0x3039fb[_0xfc97('0x34')]){delete _0x3039fb['name'];}_0x2bf631[_0xfc97('0x1b')](_0x13f7c4)[_0xfc97('0x35')](_0x3039fb);};}exports[_0xfc97('0x36')]=function(_0x37c0b3,_0x25e517){var _0x4df3e4={},_0xcc0eaa={},_0x2c8bbf={'count':0x0,'rows':[]};var _0x1e8e90=db[_0xfc97('0x37')][_0xfc97('0x38')];_0xcc0eaa[_0xfc97('0x39')]=_[_0xfc97('0x3a')](_0x1e8e90);_0xcc0eaa[_0xfc97('0x3b')]=_[_0xfc97('0x3a')](_0x37c0b3[_0xfc97('0x3b')]);_0xcc0eaa[_0xfc97('0x3c')]=_['intersection'](_0xcc0eaa[_0xfc97('0x39')],_0xcc0eaa[_0xfc97('0x3b')]);_0x4df3e4[_0xfc97('0x3d')]=_[_0xfc97('0x3e')](_0xcc0eaa[_0xfc97('0x39')],qs['fields'](_0x37c0b3['query'][_0xfc97('0x3f')]));_0x4df3e4[_0xfc97('0x3d')]=_0x4df3e4[_0xfc97('0x3d')]['length']?_0x4df3e4[_0xfc97('0x3d')]:_0xcc0eaa['model'];if(!_0x37c0b3['query'][_0xfc97('0x40')](_0xfc97('0x41'))){_0x4df3e4[_0xfc97('0x20')]=qs[_0xfc97('0x20')](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x20')]);_0x4df3e4[_0xfc97('0x1f')]=qs['offset'](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x1f')]);}_0x4df3e4[_0xfc97('0x42')]=qs[_0xfc97('0x43')](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x43')]);_0x4df3e4[_0xfc97('0x44')]=qs[_0xfc97('0x3c')](_['pick'](_0x37c0b3[_0xfc97('0x3b')],_0xcc0eaa[_0xfc97('0x3c')]));if(_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x45')]){_0x4df3e4[_0xfc97('0x44')]=_[_0xfc97('0x46')](_0x4df3e4[_0xfc97('0x44')],{'$or':_[_0xfc97('0x2d')](_0x1e8e90,function(_0x8a3e74){if(_0x8a3e74['type'][_0xfc97('0x47')]!=='VIRTUAL'){var _0x42de8a={};_0x42de8a[_0x8a3e74[_0xfc97('0x48')]]={'$like':'%'+_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x45')]+'%'};return _0x42de8a;}})});}_0x4df3e4=_[_0xfc97('0x46')]({},_0x4df3e4,_0x37c0b3[_0xfc97('0x49')]);var _0x40280a={'where':_0x4df3e4[_0xfc97('0x44')]};return db[_0xfc97('0x37')][_0xfc97('0x1e')](_0x40280a)[_0xfc97('0x27')](function(_0xdaed4d){_0x2c8bbf[_0xfc97('0x1e')]=_0xdaed4d;if(_0x37c0b3['query'][_0xfc97('0x4a')]){_0x4df3e4[_0xfc97('0x4b')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x4df3e4);})['then'](function(_0x240bd){_0x2c8bbf[_0xfc97('0x4c')]=_0x240bd;return _0x2c8bbf;})[_0xfc97('0x27')](respondWithFilteredResult(_0x25e517,_0x4df3e4))[_0xfc97('0x4d')](handleError(_0x25e517,null));};exports[_0xfc97('0x4e')]=function(_0xb7d1c2,_0x579bb2){var _0x3ccaa7={'raw':![],'where':{'id':_0xb7d1c2[_0xfc97('0x4f')]['id']}},_0x11aa8c={};_0x11aa8c[_0xfc97('0x39')]=_[_0xfc97('0x3a')](db[_0xfc97('0x37')][_0xfc97('0x38')]);_0x11aa8c['query']=_[_0xfc97('0x3a')](_0xb7d1c2[_0xfc97('0x3b')]);_0x11aa8c[_0xfc97('0x3c')]=_[_0xfc97('0x3e')](_0x11aa8c[_0xfc97('0x39')],_0x11aa8c['query']);_0x3ccaa7[_0xfc97('0x3d')]=_[_0xfc97('0x3e')](_0x11aa8c[_0xfc97('0x39')],qs[_0xfc97('0x3f')](_0xb7d1c2[_0xfc97('0x3b')][_0xfc97('0x3f')]));_0x3ccaa7['attributes']=_0x3ccaa7['attributes'][_0xfc97('0x50')]?_0x3ccaa7[_0xfc97('0x3d')]:_0x11aa8c[_0xfc97('0x39')];if(_0xb7d1c2['query'][_0xfc97('0x4a')]){_0x3ccaa7[_0xfc97('0x4b')]=[{'all':!![]}];}_0x3ccaa7=_['merge']({},_0x3ccaa7,_0xb7d1c2[_0xfc97('0x49')]);return db[_0xfc97('0x37')]['find'](_0x3ccaa7)[_0xfc97('0x27')](handleEntityNotFound(_0x579bb2,null))['then'](respondWithResult(_0x579bb2,null))[_0xfc97('0x4d')](handleError(_0x579bb2,null));};exports[_0xfc97('0x26')]=function(_0x4a897a,_0x1e8d13){return db['VoiceExtension'][_0xfc97('0x51')]({'where':{'id':_0x4a897a[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x1e8d13,null))[_0xfc97('0x27')](removeEntity(_0x1e8d13,null))[_0xfc97('0x4d')](handleError(_0x1e8d13,null));};exports['create']=function(_0x145476,_0x553909){if(_0x145476[_0xfc97('0x52')][_0xfc97('0x30')]===_0xfc97('0x53')&&!_['startsWith'](_0x145476[_0xfc97('0x52')][_0xfc97('0x54')],'_')){_0x145476[_0xfc97('0x52')][_0xfc97('0x54')]='_'[_0xfc97('0x55')](_0x145476['body']['exten']);}return db[_0xfc97('0x37')]['create'](_0x145476[_0xfc97('0x52')],{'raw':![]})['then'](function(_0x2ec97d){var _0x49681c=_0x145476[_0xfc97('0x56')][_0xfc97('0x57')]({'plain':!![]});if(!_0x49681c)throw new Error(_0xfc97('0x58'));if(_0x49681c[_0xfc97('0x59')]===_0xfc97('0x56')){var _0x523511=_0x2ec97d[_0xfc97('0x57')]({'plain':!![]});var _0x100503=[{'name':'InboundRoutes','value':_0xfc97('0x28')},{'name':'OutboundRoutes','value':_0xfc97('0x53')},{'name':_0xfc97('0x2a'),'value':_0xfc97('0x2b')}];var _0x3c6887=_[_0xfc97('0x51')](_0x100503,[_0xfc97('0x2e'),_0x523511[_0xfc97('0x30')]])[_0xfc97('0x34')];return db[_0xfc97('0x5a')][_0xfc97('0x51')]({'where':{'name':_0x3c6887,'userProfileId':_0x49681c[_0xfc97('0x5b')]},'raw':!![]})['then'](function(_0x26ac2b){if(_0x26ac2b&&_0x26ac2b[_0xfc97('0x5c')]===0x0){return db['UserProfileResource'][_0xfc97('0x5d')]({'name':_0x523511[_0xfc97('0x34')],'resourceId':_0x523511['id'],'type':_0x26ac2b[_0xfc97('0x34')],'sectionId':_0x26ac2b['id']},{})['then'](function(){return _0x2ec97d;});}else{return _0x2ec97d;}})['catch'](function(_0x357fce){logger[_0xfc97('0x32')](_0xfc97('0x5e'),_0x357fce);throw _0x357fce;});}return _0x2ec97d;})['then'](respondWithResult(_0x553909,0xc9))[_0xfc97('0x4d')](handleError(_0x553909,null));};exports['update']=function(_0x3f2189,_0x2cee1f){if(_0x3f2189[_0xfc97('0x52')]['id']){delete _0x3f2189['body']['id'];}return db[_0xfc97('0x37')][_0xfc97('0x51')]({'where':{'id':_0x3f2189[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x2cee1f,null))[_0xfc97('0x27')](function(_0xef36e){if(_0xef36e){return db[_0xfc97('0x37')][_0xfc97('0x25')](_['pick'](_0x3f2189['body'],[_0xfc97('0x54'),_0xfc97('0x5f'),_0xfc97('0x60'),_0xfc97('0x61'),_0xfc97('0x62'),_0xfc97('0x63')]),{'where':{'context':_0xef36e[_0xfc97('0x5f')],'exten':_0xef36e['exten']},'individualHooks':!![]})['then'](function(_0x3f49d4){return _0x3f49d4;});}return null;})[_0xfc97('0x27')](respondWithStatusCode(_0x2cee1f,null))[_0xfc97('0x4d')](handleError(_0x2cee1f,null));};exports[_0xfc97('0x64')]=function(_0x5c854a,_0x1c66bb,_0x4951ab){return db[_0xfc97('0x37')]['findOne']({'where':{'id':_0x5c854a[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x1c66bb,null))[_0xfc97('0x27')](function(_0x258c97){if(_0x258c97){return db['sequelize'][_0xfc97('0x65')](function(_0x345c0d){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x5c854a[_0xfc97('0x4f')]['id']},'transaction':_0x345c0d})[_0xfc97('0x27')](function(_0x3713a0){var _0x326039=_['map'](_0x5c854a[_0xfc97('0x52')],function(_0x12e59b){_0x12e59b[_0xfc97('0x66')]=_0x5c854a[_0xfc97('0x4f')]['id'];return _0x12e59b;});return db[_0xfc97('0x37')][_0xfc97('0x67')](_0x326039,{'transaction':_0x345c0d});});})[_0xfc97('0x27')](function(){return db[_0xfc97('0x37')][_0xfc97('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c854a[_0xfc97('0x4f')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xfc97('0x27')](respondWithResult(_0x1c66bb,null))['catch'](handleError(_0x1c66bb,null));}; \ No newline at end of file +var _0x6587=['../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','VoiceExtension','keys','query','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','startsWith','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x6587,0x1eb));var _0x7658=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6587[_0x3c4737];return _0x2bb926;};'use strict';var pdf=require(_0x7658('0x0'));var emlformat=require(_0x7658('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7658('0x2'));var jsonpatch=require(_0x7658('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7658('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7658('0x5'));var sox=require(_0x7658('0x6'));var csv=require(_0x7658('0x7'));var ejs=require(_0x7658('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7658('0x9'));var crypto=require(_0x7658('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7658('0x7'));var querystring=require(_0x7658('0xb'));var Papa=require(_0x7658('0xc'));var Redis=require(_0x7658('0xd'));var authService=require(_0x7658('0xe'));var qs=require(_0x7658('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7658('0x10'))(_0x7658('0x11'));var utils=require(_0x7658('0x12'));var config=require(_0x7658('0x13'));var db=require(_0x7658('0x14'))['db'];config['redis']=_[_0x7658('0x15')](config['redis'],{'host':_0x7658('0x16'),'port':0x18eb});var socket=require(_0x7658('0x17'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x7658('0x18')](socket);function respondWithStatusCode(_0x46b7e9,_0x5d4e0c){_0x5d4e0c=_0x5d4e0c||0xcc;return function(_0x52192d){if(_0x52192d){return _0x46b7e9[_0x7658('0x19')](_0x5d4e0c);}return _0x46b7e9['status'](_0x5d4e0c)[_0x7658('0x1a')]();};}function respondWithResult(_0x10ef41,_0x35d94a){_0x35d94a=_0x35d94a||0xc8;return function(_0x1e8418){if(_0x1e8418){return _0x10ef41[_0x7658('0x1b')](_0x35d94a)[_0x7658('0x1c')](_0x1e8418);}};}function respondWithFilteredResult(_0xa0186d,_0x5028e8){return function(_0x16d113){if(_0x16d113){var _0x455ee3=_0x16d113[_0x7658('0x1d')],_0x27ae39=_0x5028e8[_0x7658('0x1e')],_0x34114e=_0x5028e8[_0x7658('0x1e')]+_0x5028e8['limit'],_0x4b11e9;if(_0x34114e>=_0x455ee3){_0x34114e=_0x455ee3;_0x4b11e9=0xc8;}else{_0x4b11e9=0xce;}_0xa0186d['status'](_0x4b11e9);return _0xa0186d[_0x7658('0x1f')](_0x7658('0x20'),_0x27ae39+'-'+_0x34114e+'/'+_0x455ee3)['json'](_0x16d113);}return null;};}function patchUpdates(_0x786281){return function(_0x424667){try{jsonpatch['apply'](_0x424667,_0x786281,!![]);}catch(_0x5c49b7){return BPromise[_0x7658('0x21')](_0x5c49b7);}return _0x424667['save']();};}function saveUpdates(_0x2ffb3f,_0x1ac2b1){return function(_0x3c382f){if(_0x3c382f){return _0x3c382f[_0x7658('0x22')](_0x2ffb3f)[_0x7658('0x23')](function(_0x3434df){return _0x3434df;});}return null;};}function removeEntity(_0x2380f7,_0x456c89){return function(_0x859db0){if(_0x859db0){return _0x859db0[_0x7658('0x24')]()[_0x7658('0x23')](function(){var _0x30915b=_0x859db0['get']({'plain':!![]});var _0x21df63=[{'name':_0x7658('0x25'),'value':_0x7658('0x26'),'ignore':![]},{'name':_0x7658('0x27'),'value':_0x7658('0x28'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x247431=_(_0x21df63)[_0x7658('0x29')](_0x7658('0x2a'))[_0x7658('0x2b')]('value')[_0x7658('0x2c')]();if(_[_0x7658('0x2d')](_0x247431,_0x30915b[_0x7658('0x2e')])){return;}var _0x89e500=_[_0x7658('0x2f')](_0x21df63,['value',_0x30915b[_0x7658('0x2e')]])[_0x7658('0x30')];return db[_0x7658('0x31')][_0x7658('0x24')]({'where':{'type':_0x89e500,'resourceId':_0x30915b['id']}})[_0x7658('0x23')](function(){return _0x859db0;});})[_0x7658('0x23')](function(){_0x2380f7[_0x7658('0x1b')](0xcc)[_0x7658('0x1a')]();});}};}function handleEntityNotFound(_0x1587cc,_0x436f6a){return function(_0x2665a4){if(!_0x2665a4){_0x1587cc['sendStatus'](0x194);}return _0x2665a4;};}function handleError(_0x1e3270,_0x70cac6){_0x70cac6=_0x70cac6||0x1f4;return function(_0x1310f2){logger[_0x7658('0x32')](_0x1310f2['stack']);if(_0x1310f2[_0x7658('0x30')]){delete _0x1310f2[_0x7658('0x30')];}_0x1e3270[_0x7658('0x1b')](_0x70cac6)[_0x7658('0x33')](_0x1310f2);};}exports[_0x7658('0x34')]=function(_0xfa9efc,_0x5856c1){var _0x5d9710={},_0xae434c={},_0x48e708={'count':0x0,'rows':[]};var _0x3eeecc=db[_0x7658('0x35')]['rawAttributes'];_0xae434c['model']=_[_0x7658('0x36')](_0x3eeecc);_0xae434c['query']=_[_0x7658('0x36')](_0xfa9efc[_0x7658('0x37')]);_0xae434c['filters']=_['intersection'](_0xae434c[_0x7658('0x38')],_0xae434c[_0x7658('0x37')]);_0x5d9710[_0x7658('0x39')]=_[_0x7658('0x3a')](_0xae434c[_0x7658('0x38')],qs[_0x7658('0x3b')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x3b')]));_0x5d9710[_0x7658('0x39')]=_0x5d9710[_0x7658('0x39')][_0x7658('0x3c')]?_0x5d9710[_0x7658('0x39')]:_0xae434c[_0x7658('0x38')];if(!_0xfa9efc[_0x7658('0x37')]['hasOwnProperty'](_0x7658('0x3d'))){_0x5d9710[_0x7658('0x3e')]=qs[_0x7658('0x3e')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x3e')]);_0x5d9710[_0x7658('0x1e')]=qs[_0x7658('0x1e')](_0xfa9efc[_0x7658('0x37')][_0x7658('0x1e')]);}_0x5d9710[_0x7658('0x3f')]=qs[_0x7658('0x40')](_0xfa9efc[_0x7658('0x37')]['sort']);_0x5d9710[_0x7658('0x41')]=qs[_0x7658('0x42')](_[_0x7658('0x43')](_0xfa9efc[_0x7658('0x37')],_0xae434c[_0x7658('0x42')]));if(_0xfa9efc[_0x7658('0x37')][_0x7658('0x29')]){_0x5d9710[_0x7658('0x41')]=_[_0x7658('0x44')](_0x5d9710['where'],{'$or':_[_0x7658('0x2b')](_0x3eeecc,function(_0x4b2a7a){if(_0x4b2a7a['type'][_0x7658('0x45')]!==_0x7658('0x46')){var _0x36003f={};_0x36003f[_0x4b2a7a[_0x7658('0x47')]]={'$like':'%'+_0xfa9efc[_0x7658('0x37')][_0x7658('0x29')]+'%'};return _0x36003f;}})});}_0x5d9710=_[_0x7658('0x44')]({},_0x5d9710,_0xfa9efc[_0x7658('0x48')]);var _0x1bd9d3={'where':_0x5d9710[_0x7658('0x41')]};return db[_0x7658('0x35')]['count'](_0x1bd9d3)[_0x7658('0x23')](function(_0x362b70){_0x48e708['count']=_0x362b70;if(_0xfa9efc[_0x7658('0x37')][_0x7658('0x49')]){_0x5d9710[_0x7658('0x4a')]=[{'all':!![]}];}return db[_0x7658('0x35')][_0x7658('0x4b')](_0x5d9710);})[_0x7658('0x23')](function(_0x3228f1){_0x48e708[_0x7658('0x4c')]=_0x3228f1;return _0x48e708;})[_0x7658('0x23')](respondWithFilteredResult(_0x5856c1,_0x5d9710))[_0x7658('0x4d')](handleError(_0x5856c1,null));};exports[_0x7658('0x4e')]=function(_0x918496,_0x30145e){var _0xc97ef4={'raw':![],'where':{'id':_0x918496[_0x7658('0x4f')]['id']}},_0x3ef77a={};_0x3ef77a[_0x7658('0x38')]=_[_0x7658('0x36')](db[_0x7658('0x35')][_0x7658('0x50')]);_0x3ef77a[_0x7658('0x37')]=_[_0x7658('0x36')](_0x918496[_0x7658('0x37')]);_0x3ef77a[_0x7658('0x42')]=_[_0x7658('0x3a')](_0x3ef77a['model'],_0x3ef77a[_0x7658('0x37')]);_0xc97ef4[_0x7658('0x39')]=_[_0x7658('0x3a')](_0x3ef77a[_0x7658('0x38')],qs[_0x7658('0x3b')](_0x918496['query']['fields']));_0xc97ef4[_0x7658('0x39')]=_0xc97ef4[_0x7658('0x39')][_0x7658('0x3c')]?_0xc97ef4[_0x7658('0x39')]:_0x3ef77a[_0x7658('0x38')];if(_0x918496[_0x7658('0x37')]['includeAll']){_0xc97ef4[_0x7658('0x4a')]=[{'all':!![]}];}_0xc97ef4=_[_0x7658('0x44')]({},_0xc97ef4,_0x918496['options']);return db[_0x7658('0x35')][_0x7658('0x2f')](_0xc97ef4)['then'](handleEntityNotFound(_0x30145e,null))[_0x7658('0x23')](respondWithResult(_0x30145e,null))[_0x7658('0x4d')](handleError(_0x30145e,null));};exports[_0x7658('0x24')]=function(_0x4d4a6e,_0x3f3606){return db[_0x7658('0x35')][_0x7658('0x2f')]({'where':{'id':_0x4d4a6e[_0x7658('0x4f')]['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x3f3606,null))[_0x7658('0x23')](removeEntity(_0x3f3606,null))['catch'](handleError(_0x3f3606,null));};exports['create']=function(_0x3b9076,_0x3281ce){if(_0x3b9076[_0x7658('0x51')]['type']===_0x7658('0x28')&&!_[_0x7658('0x52')](_0x3b9076[_0x7658('0x51')]['exten'],'_')){_0x3b9076[_0x7658('0x51')]['exten']='_'[_0x7658('0x53')](_0x3b9076[_0x7658('0x51')]['exten']);}return db[_0x7658('0x35')][_0x7658('0x54')](_0x3b9076[_0x7658('0x51')],{'raw':![]})[_0x7658('0x23')](function(_0x36c9a8){var _0x321b8f=_0x3b9076['user']['get']({'plain':!![]});if(!_0x321b8f)throw new Error(_0x7658('0x55'));if(_0x321b8f['role']===_0x7658('0x56')){var _0x3133c3=_0x36c9a8['get']({'plain':!![]});var _0x5996fb=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x7658('0x27'),'value':_0x7658('0x28')},{'name':'InternalRoutes','value':'internal'}];var _0x5b3524=_['find'](_0x5996fb,[_0x7658('0x2c'),_0x3133c3[_0x7658('0x2e')]])['name'];return db[_0x7658('0x57')]['find']({'where':{'name':_0x5b3524,'userProfileId':_0x321b8f['userProfileId']},'raw':!![]})[_0x7658('0x23')](function(_0x51c520){if(_0x51c520&&_0x51c520[_0x7658('0x58')]===0x0){return db[_0x7658('0x31')][_0x7658('0x54')]({'name':_0x3133c3[_0x7658('0x30')],'resourceId':_0x3133c3['id'],'type':_0x51c520[_0x7658('0x30')],'sectionId':_0x51c520['id']},{})[_0x7658('0x23')](function(){return _0x36c9a8;});}else{return _0x36c9a8;}})['catch'](function(_0x50314f){logger['error'](_0x7658('0x59'),_0x50314f);throw _0x50314f;});}return _0x36c9a8;})[_0x7658('0x23')](respondWithResult(_0x3281ce,0xc9))[_0x7658('0x4d')](handleError(_0x3281ce,null));};exports[_0x7658('0x22')]=function(_0x4866df,_0x95846b){if(_0x4866df[_0x7658('0x51')]['id']){delete _0x4866df[_0x7658('0x51')]['id'];}return db[_0x7658('0x35')][_0x7658('0x2f')]({'where':{'id':_0x4866df[_0x7658('0x4f')]['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x95846b,null))[_0x7658('0x23')](function(_0x3ddbd1){if(_0x3ddbd1){return db[_0x7658('0x35')][_0x7658('0x22')](_[_0x7658('0x43')](_0x4866df[_0x7658('0x51')],[_0x7658('0x5a'),_0x7658('0x5b'),_0x7658('0x5c'),_0x7658('0x5d'),_0x7658('0x5e'),_0x7658('0x5f')]),{'where':{'context':_0x3ddbd1[_0x7658('0x5b')],'exten':_0x3ddbd1[_0x7658('0x5a')]},'individualHooks':!![]})['then'](function(_0x5aae3d){return _0x5aae3d;});}return null;})[_0x7658('0x23')](respondWithStatusCode(_0x95846b,null))[_0x7658('0x4d')](handleError(_0x95846b,null));};exports[_0x7658('0x60')]=function(_0x274c1a,_0x1a19af,_0x6a7515){return db['VoiceExtension'][_0x7658('0x61')]({'where':{'id':_0x274c1a['params']['id']}})[_0x7658('0x23')](handleEntityNotFound(_0x1a19af,null))[_0x7658('0x23')](function(_0x4f3554){if(_0x4f3554){return db[_0x7658('0x62')][_0x7658('0x63')](function(_0x471bdc){return db[_0x7658('0x35')]['destroy']({'where':{'VoiceExtensionId':_0x274c1a['params']['id']},'transaction':_0x471bdc})[_0x7658('0x23')](function(_0x2f0cc3){var _0x143b74=_[_0x7658('0x2b')](_0x274c1a['body'],function(_0x65fe9b){_0x65fe9b[_0x7658('0x64')]=_0x274c1a[_0x7658('0x4f')]['id'];return _0x65fe9b;});return db[_0x7658('0x35')][_0x7658('0x65')](_0x143b74,{'transaction':_0x471bdc});});})[_0x7658('0x23')](function(){return db[_0x7658('0x35')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x274c1a[_0x7658('0x4f')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x7658('0x23')](respondWithResult(_0x1a19af,null))[_0x7658('0x4d')](handleError(_0x1a19af,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 303ec3c..6313bc8 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 _0xe55d=['hasOwnProperty','../../mysqldb','VoiceExtension','setMaxListeners','save','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe55d,0x1db));var _0xde55=function(_0x2053ac,_0x2ecb7a){_0x2053ac=_0x2053ac-0x0;var _0x48aa7c=_0xe55d[_0x2053ac];return _0x48aa7c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xde55('0x0'))['db'][_0xde55('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xde55('0x2')](0x0);var events={'afterCreate':_0xde55('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x524122){return function(_0x130fca,_0x5c1aab,_0x1a05e8){VoiceExtensionEvents[_0xde55('0x4')](_0x524122+':'+_0x130fca['id'],_0x130fca);VoiceExtensionEvents['emit'](_0x524122,_0x130fca);_0x1a05e8(null);};}for(var e in events){if(events[_0xde55('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x11c4=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x69f185,_0x1c72b6){var _0x1c6a87=function(_0x165b1b){while(--_0x165b1b){_0x69f185['push'](_0x69f185['shift']());}};_0x1c6a87(++_0x1c72b6);}(_0x11c4,0x129));var _0x411c=function(_0x2a5d4d,_0x4489da){_0x2a5d4d=_0x2a5d4d-0x0;var _0x3e1687=_0x11c4[_0x2a5d4d];return _0x3e1687;};'use strict';var EventEmitter=require(_0x411c('0x0'));var VoiceExtension=require(_0x411c('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x411c('0x2')](0x0);var events={'afterCreate':_0x411c('0x3'),'afterUpdate':'update','afterDestroy':_0x411c('0x4')};function emitEvent(_0x3796ec){return function(_0x299f23,_0x595127,_0x2a1c5b){VoiceExtensionEvents[_0x411c('0x5')](_0x3796ec+':'+_0x299f23['id'],_0x299f23);VoiceExtensionEvents[_0x411c('0x5')](_0x3796ec,_0x299f23);_0x2a1c5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x411c('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 9ba47a5..69914ac 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 _0xe96f=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','lodash'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0xe96f,0x199));var _0xfe96=function(_0x2d3e94,_0x5b5398){_0x2d3e94=_0x2d3e94-0x0;var _0x5ad0bf=_0xe96f[_0x2d3e94];return _0x5ad0bf;};'use strict';var _=require(_0xfe96('0x0'));var util=require(_0xfe96('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe96('0x2'));var BPromise=require(_0xfe96('0x3'));var rp=require(_0xfe96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe96('0x5'));var config=require(_0xfe96('0x6'));var attributes=require(_0xfe96('0x7'));module[_0xfe96('0x8')]=function(_0x1c300f,_0x35947d){return _0x1c300f[_0xfe96('0x9')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d3d=['api','request-promise','path','rimraf','exports','define','voice_extensions','lodash','util','../../config/logger'];(function(_0x3fce78,_0x17ab27){var _0x4035d1=function(_0x392bed){while(--_0x392bed){_0x3fce78['push'](_0x3fce78['shift']());}};_0x4035d1(++_0x17ab27);}(_0x0d3d,0x1ab));var _0xd0d3=function(_0x25485c,_0x2c375d){_0x25485c=_0x25485c-0x0;var _0x3d6270=_0x0d3d[_0x25485c];return _0x3d6270;};'use strict';var _=require(_0xd0d3('0x0'));var util=require(_0xd0d3('0x1'));var logger=require(_0xd0d3('0x2'))(_0xd0d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd0d3('0x4'));var fs=require('fs');var path=require(_0xd0d3('0x5'));var rimraf=require(_0xd0d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceExtension.attributes');module[_0xd0d3('0x7')]=function(_0x34ab79,_0x30db12){return _0x34ab79[_0xd0d3('0x8')]('VoiceExtension',attributes,{'tableName':_0xd0d3('0x9'),'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 d5ea77a..edaaa86 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 _0x9ffd=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3e8201,_0x5eebdb){var _0x171226=function(_0x26872a){while(--_0x26872a){_0x3e8201['push'](_0x3e8201['shift']());}};_0x171226(++_0x5eebdb);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3adda4,_0x4c0598){_0x3adda4=_0x3adda4-0x0;var _0x496381=_0x9ffd[_0x3adda4];return _0x496381;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}exports[_0xd9ff('0x1b')]=function(_0x39ef37){var _0x46a6ab=this;return new Promise(function(_0x4c8740,_0x4cf8ec){return db[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'raw':_0x39ef37['options']?_0x39ef37['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ef37['options']?_0x39ef37[_0xd9ff('0x1e')]['where']||null:null,'attributes':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x1f')]||null:null,'limit':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x20')]||null:null,'include':_0x39ef37['options']?_0x39ef37['options'][_0xd9ff('0x21')]?_['map'](_0x39ef37[_0xd9ff('0x1e')]['include'],function(_0x285002){return{'model':db[_0x285002['model']],'as':_0x285002['as'],'attributes':_0x285002[_0xd9ff('0x1f')],'include':_0x285002[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x285002[_0xd9ff('0x21')],function(_0x5d685e){return{'model':db[_0x5d685e[_0xd9ff('0x23')]],'as':_0x5d685e['as'],'attributes':_0x5d685e[_0xd9ff('0x1f')],'include':_0x5d685e[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x5d685e['include'],function(_0x1d3684){return{'model':db[_0x1d3684[_0xd9ff('0x23')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0xd9ff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9ff('0x11')](function(_0x263d3a){logger[_0xd9ff('0x12')](_0xd9ff('0x1b'),_0x39ef37);logger[_0xd9ff('0x24')](_0xd9ff('0x1b'),_0x39ef37,JSON['stringify'](_0x263d3a));_0x4c8740(_0x263d3a);})[_0xd9ff('0x1a')](function(_0x4ba2be){logger[_0xd9ff('0x16')](_0xd9ff('0x1b'),_0x4ba2be[_0xd9ff('0x18')],_0x39ef37);_0x4cf8ec(_0x46a6ab['error'](0x1f4,_0x4ba2be[_0xd9ff('0x18')]));});});}; \ No newline at end of file +var _0x4483=['message','request\x20sent','GetVoiceExtension','VoiceExtension','findAll','options','where','limit','map','include','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4483,0x1a3));var _0x3448=function(_0x2ed4ce,_0x281b1a){_0x2ed4ce=_0x2ed4ce-0x0;var _0xf09301=_0x4483[_0x2ed4ce];return _0xf09301;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});config[_0x3448('0xc')]=_[_0x3448('0xd')](config[_0x3448('0xc')],{'host':_0x3448('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3448('0xf'))[_0x3448('0x10')](socket);function respondWithRpcPromise(_0xc36409,_0x6f82ca,_0x3f4364){return new BPromise(function(_0x1e645a,_0x2bdf02){return client[_0x3448('0x11')](_0xc36409,_0x3f4364)[_0x3448('0x12')](function(_0x35bb7b){logger[_0x3448('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x6f82ca,'request\x20sent');logger[_0x3448('0x14')](_0x3448('0x15'),_0x6f82ca,'request\x20sent',JSON[_0x3448('0x16')](_0x35bb7b));if(_0x35bb7b[_0x3448('0x17')]){if(_0x35bb7b[_0x3448('0x17')]['code']===0x1f4){logger[_0x3448('0x17')](_0x3448('0x18'),_0x6f82ca,_0x35bb7b['error'][_0x3448('0x19')]);return _0x2bdf02(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}logger['error'](_0x3448('0x18'),_0x6f82ca,_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);return _0x1e645a(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}else{logger[_0x3448('0x13')](_0x3448('0x18'),_0x6f82ca,_0x3448('0x1a'));_0x1e645a(_0x35bb7b['result'][_0x3448('0x19')]);}})['catch'](function(_0x48f94a){logger['error'](_0x3448('0x18'),_0x6f82ca,_0x48f94a);_0x2bdf02(_0x48f94a);});});}exports[_0x3448('0x1b')]=function(_0xda4040){var _0x5b5e26=this;return new Promise(function(_0x3df082,_0x392c8d){return db[_0x3448('0x1c')][_0x3448('0x1d')]({'raw':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xda4040['options']?_0xda4040['options'][_0x3448('0x1f')]||null:null,'attributes':_0xda4040[_0x3448('0x1e')]?_0xda4040['options']['attributes']||null:null,'limit':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')][_0x3448('0x20')]||null:null,'include':_0xda4040[_0x3448('0x1e')]?_0xda4040[_0x3448('0x1e')]['include']?_[_0x3448('0x21')](_0xda4040[_0x3448('0x1e')][_0x3448('0x22')],function(_0x2088de){return{'model':db[_0x2088de[_0x3448('0x23')]],'as':_0x2088de['as'],'attributes':_0x2088de['attributes'],'include':_0x2088de[_0x3448('0x22')]?_[_0x3448('0x21')](_0x2088de['include'],function(_0x19a479){return{'model':db[_0x19a479[_0x3448('0x23')]],'as':_0x19a479['as'],'attributes':_0x19a479[_0x3448('0x24')],'include':_0x19a479[_0x3448('0x22')]?_[_0x3448('0x21')](_0x19a479[_0x3448('0x22')],function(_0x31be64){return{'model':db[_0x31be64[_0x3448('0x23')]],'as':_0x31be64['as'],'attributes':_0x31be64['attributes']};}):[]};}):[]};}):[]:[]})[_0x3448('0x12')](function(_0x450704){logger[_0x3448('0x13')]('GetVoiceExtension',_0xda4040);logger[_0x3448('0x14')]('GetVoiceExtension',_0xda4040,JSON['stringify'](_0x450704));_0x3df082(_0x450704);})['catch'](function(_0x52fb48){logger[_0x3448('0x17')]('GetVoiceExtension',_0x52fb48['message'],_0xda4040);_0x392c8d(_0x5b5e26[_0x3448('0x17')](0x1f4,_0x52fb48[_0x3448('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 59e89b2..ff88d75 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 _0xccbe=['save','remove','update','emit'];(function(_0x5f3f91,_0xfc0e59){var _0x15cc1d=function(_0x1ea56c){while(--_0x1ea56c){_0x5f3f91['push'](_0x5f3f91['shift']());}};_0x15cc1d(++_0xfc0e59);}(_0xccbe,0x188));var _0xeccb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xccbe[_0x4c12ec];return _0x3ae42c;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xeccb('0x0'),_0xeccb('0x1'),_0xeccb('0x2')];function createListener(_0x47292c,_0x383101){return function(_0x4b05c0){_0x383101[_0xeccb('0x3')](_0x47292c,_0x4b05c0);};}function removeListener(_0x48bc6b,_0x58162f){return function(){VoiceExtensionEvents['removeListener'](_0x48bc6b,_0x58162f);};}exports['register']=function(_0xf60748){for(var _0x578a94=0x0,_0x5567c1=events['length'];_0x578a94<_0x5567c1;_0x578a94++){var _0x23871e=events[_0x578a94];var _0x3e2936=createListener('voiceExtension:'+_0x23871e,_0xf60748);VoiceExtensionEvents['on'](_0x23871e,_0x3e2936);}}; \ No newline at end of file +var _0xaf1c=['removeListener','register','voiceExtension:','save','remove','update','emit'];(function(_0x592efc,_0x275170){var _0x416bb7=function(_0x3b071a){while(--_0x3b071a){_0x592efc['push'](_0x592efc['shift']());}};_0x416bb7(++_0x275170);}(_0xaf1c,0x168));var _0xcaf1=function(_0xea0069,_0x750a62){_0xea0069=_0xea0069-0x0;var _0x4def95=_0xaf1c[_0xea0069];return _0x4def95;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xcaf1('0x0'),_0xcaf1('0x1'),_0xcaf1('0x2')];function createListener(_0x45bc31,_0x4e62d3){return function(_0x46a63b){_0x4e62d3[_0xcaf1('0x3')](_0x45bc31,_0x46a63b);};}function removeListener(_0x1a9dd0,_0x209b3f){return function(){VoiceExtensionEvents[_0xcaf1('0x4')](_0x1a9dd0,_0x209b3f);};}exports[_0xcaf1('0x5')]=function(_0x134b75){for(var _0x599f9e=0x0,_0x26d550=events['length'];_0x599f9e<_0x26d550;_0x599f9e++){var _0x4291e5=events[_0x599f9e];var _0x439f2a=createListener(_0xcaf1('0x6')+_0x4291e5,_0x134b75);VoiceExtensionEvents['on'](_0x4291e5,_0x439f2a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 16f038c..80f6522 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 _0xbf02=['isAuthenticated','get','/:id','show','/:id/messages','post','create','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5366bd,_0x14b8b8){var _0xc46787=function(_0x450fb1){while(--_0x450fb1){_0x5366bd['push'](_0x5366bd['shift']());}};_0xc46787(++_0x14b8b8);}(_0xbf02,0x1bb));var _0x2bf0=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xbf02[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x2bf0('0x0'));var path=require(_0x2bf0('0x1'));var timeout=require(_0x2bf0('0x2'));var express=require(_0x2bf0('0x3'));var router=express[_0x2bf0('0x4')]();var auth=require(_0x2bf0('0x5'));var interaction=require(_0x2bf0('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth[_0x2bf0('0x7')](),controller['index']);router[_0x2bf0('0x8')](_0x2bf0('0x9'),auth['isAuthenticated'](),controller[_0x2bf0('0xa')]);router[_0x2bf0('0x8')](_0x2bf0('0xb'),auth[_0x2bf0('0x7')](),controller['getMessages']);router[_0x2bf0('0xc')]('/',auth[_0x2bf0('0x7')](),controller[_0x2bf0('0xd')]);router['put'](_0x2bf0('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2bf0('0x9'),auth[_0x2bf0('0x7')](),controller[_0x2bf0('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4e1c=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','getMessages','post','put','/:id','destroy','exports','multer'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x4e1c,0x71));var _0xc4e1=function(_0x7c8431,_0x3837d3){_0x7c8431=_0x7c8431-0x0;var _0x2e27eb=_0x4e1c[_0x7c8431];return _0x2e27eb;};'use strict';var multer=require(_0xc4e1('0x0'));var util=require(_0xc4e1('0x1'));var path=require(_0xc4e1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4e1('0x3'));var router=express[_0xc4e1('0x4')]();var auth=require(_0xc4e1('0x5'));var interaction=require(_0xc4e1('0x6'));var config=require(_0xc4e1('0x7'));var controller=require(_0xc4e1('0x8'));router[_0xc4e1('0x9')]('/',auth['isAuthenticated'](),controller[_0xc4e1('0xa')]);router[_0xc4e1('0x9')]('/:id',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xc')]);router[_0xc4e1('0x9')]('/:id/messages',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xd')]);router[_0xc4e1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc4e1('0xf')](_0xc4e1('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc4e1('0x10'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x11')]);module[_0xc4e1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6ce7dac..76c366f 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 _0xa1b3=['mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20'];(function(_0x6deac7,_0x2d8aa4){var _0x23e545=function(_0x492df5){while(--_0x492df5){_0x6deac7['push'](_0x6deac7['shift']());}};_0x23e545(++_0x2d8aa4);}(_0xa1b3,0x1a3));var _0x3a1b=function(_0x13b3b8,_0x112fd7){_0x13b3b8=_0x13b3b8-0x0;var _0x438623=_0xa1b3[_0x13b3b8];return _0x438623;};'use strict';var Sequelize=require('sequelize');module[_0x3a1b('0x0')]={'customer_id':{'type':Sequelize[_0x3a1b('0x1')]},'context':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':_0x3a1b('0x2'),'unique':_0x3a1b('0x3')},'mailbox':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x3a1b('0x1')]},'email':{'type':Sequelize[_0x3a1b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x41cc7c){this[_0x3a1b('0x4')](_0x3a1b('0x5'),typeof _0x41cc7c===_0x3a1b('0x6')&&_0x41cc7c[_0x3a1b('0x7')]()?_0x41cc7c['trim']():null);}},'pager':{'type':Sequelize[_0x3a1b('0x1')]},'tz':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':_0x3a1b('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':_0x3a1b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3a1b('0x1')]},'callback':{'type':Sequelize[_0x3a1b('0x1')]},'review':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3a1b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3a1b('0xc')},'emailsubject':{'type':Sequelize[_0x3a1b('0x1')]},'emailbody':{'type':Sequelize[_0x3a1b('0x1')]},'maxsecs':{'type':Sequelize[_0x3a1b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3a1b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3a1b('0xe')],'get':function(){return this[_0x3a1b('0xf')](_0x3a1b('0x10'))+_0x3a1b('0x11')+this[_0x3a1b('0xf')](_0x3a1b('0x12'));}}}; \ No newline at end of file +var _0xc99e=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','trim','ENUM','yes'];(function(_0x235712,_0x403217){var _0x47e607=function(_0x5e8254){while(--_0x5e8254){_0x235712['push'](_0x235712['shift']());}};_0x47e607(++_0x403217);}(_0xc99e,0x7f));var _0xec99=function(_0x132c1b,_0x5739d1){_0x132c1b=_0x132c1b-0x0;var _0x559dc9=_0xc99e[_0x132c1b];return _0x559dc9;};'use strict';var Sequelize=require(_0xec99('0x0'));module[_0xec99('0x1')]={'customer_id':{'type':Sequelize[_0xec99('0x2')]},'context':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'from-voicemail','unique':_0xec99('0x3')},'mailbox':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'','allowNull':![],'unique':_0xec99('0x3')},'password':{'type':Sequelize[_0xec99('0x2')]},'fullname':{'type':Sequelize[_0xec99('0x2')]},'email':{'type':Sequelize[_0xec99('0x2')],'validate':{'isEmail':!![]},'set':function(_0x560545){this[_0xec99('0x4')]('email',typeof _0x560545==='string'&&_0x560545['trim']()?_0x560545[_0xec99('0x5')]():null);}},'pager':{'type':Sequelize[_0xec99('0x2')]},'tz':{'type':Sequelize[_0xec99('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':_0xec99('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xec99('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xec99('0x2')]},'callback':{'type':Sequelize[_0xec99('0x2')]},'review':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xec99('0x6')](_0xec99('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xec99('0x6')]('yes','no'),'defaultValue':_0xec99('0x7'),'allowNull':![]},'stamp':{'type':_0xec99('0x8')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xec99('0x2')]},'maxsecs':{'type':Sequelize[_0xec99('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xec99('0xa')],'get':function(){return this[_0xec99('0xb')](_0xec99('0xc'))+_0xec99('0xd')+this[_0xec99('0xb')](_0xec99('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index efe197e..b23dc76 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 _0x200b=['index','VoiceMail','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','options','includeAll','findAll','rows','catch','show','length','include','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','update','body','params','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','html-pdf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','sendStatus','error','stack','name'];(function(_0xb8111f,_0x2b0a3b){var _0x233d1b=function(_0x416f63){while(--_0x416f63){_0xb8111f['push'](_0xb8111f['shift']());}};_0x233d1b(++_0x2b0a3b);}(_0x200b,0x7d));var _0xb200=function(_0x450a9f,_0x3d02c1){_0x450a9f=_0x450a9f-0x0;var _0x7c9ef4=_0x200b[_0x450a9f];return _0x7c9ef4;};'use strict';var pdf=require(_0xb200('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb200('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb200('0x2'));var moment=require(_0xb200('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb200('0x4'));var util=require(_0xb200('0x5'));var path=require(_0xb200('0x6'));var sox=require('sox');var csv=require(_0xb200('0x7'));var ejs=require(_0xb200('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb200('0x9'));var jsforce=require(_0xb200('0xa'));var deskjs=require(_0xb200('0xb'));var toCsv=require(_0xb200('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb200('0xc'));var qs=require(_0xb200('0xd'));var hardwareService=require(_0xb200('0xe'));var logger=require('../../config/logger')(_0xb200('0xf'));var utils=require('../../config/utils');var config=require(_0xb200('0x10'));var db=require(_0xb200('0x11'))['db'];function respondWithStatusCode(_0x57c2b4,_0x47f0c5){_0x47f0c5=_0x47f0c5||0xcc;return function(_0x2b4008){if(_0x2b4008){return _0x57c2b4['sendStatus'](_0x47f0c5);}return _0x57c2b4[_0xb200('0x12')](_0x47f0c5)[_0xb200('0x13')]();};}function respondWithResult(_0x4eedee,_0x5731f4){_0x5731f4=_0x5731f4||0xc8;return function(_0xf165a9){if(_0xf165a9){return _0x4eedee[_0xb200('0x12')](_0x5731f4)[_0xb200('0x14')](_0xf165a9);}};}function respondWithFilteredResult(_0x312a3c,_0x56b8ee){return function(_0x66cc44){if(_0x66cc44){var _0x3eedbe=_0x66cc44[_0xb200('0x15')],_0x36dced=_0x56b8ee[_0xb200('0x16')],_0x37f1a6=_0x56b8ee[_0xb200('0x16')]+_0x56b8ee[_0xb200('0x17')],_0x359dcb;if(_0x37f1a6>=_0x3eedbe){_0x37f1a6=_0x3eedbe;_0x359dcb=0xc8;}else{_0x359dcb=0xce;}_0x312a3c['status'](_0x359dcb);return _0x312a3c[_0xb200('0x18')](_0xb200('0x19'),_0x36dced+'-'+_0x37f1a6+'/'+_0x3eedbe)[_0xb200('0x14')](_0x66cc44);}return null;};}function patchUpdates(_0x596cbc){return function(_0x41c2fb){try{jsonpatch[_0xb200('0x1a')](_0x41c2fb,_0x596cbc,!![]);}catch(_0x3e68ed){return BPromise[_0xb200('0x1b')](_0x3e68ed);}return _0x41c2fb['save']();};}function saveUpdates(_0x92de50,_0x36b91e){return function(_0x2c167f){if(_0x2c167f){return _0x2c167f['update'](_0x92de50)[_0xb200('0x1c')](function(_0x41c350){return _0x41c350;});}return null;};}function removeEntity(_0x77fdba,_0x5014da){return function(_0x55e7ff){if(_0x55e7ff){return _0x55e7ff[_0xb200('0x1d')]()[_0xb200('0x1c')](function(){var _0x49c72b=_0x55e7ff[_0xb200('0x1e')]({'plain':!![]});var _0x2d70f3='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x2d70f3,'resourceId':_0x49c72b['id']}})['then'](function(){return _0x55e7ff;});})['then'](function(){_0x77fdba['status'](0xcc)[_0xb200('0x13')]();});}};}function handleEntityNotFound(_0x16a187,_0x2cae2f){return function(_0x3cfac9){if(!_0x3cfac9){_0x16a187[_0xb200('0x1f')](0x194);}return _0x3cfac9;};}function handleError(_0x55f9b8,_0x5eb65a){_0x5eb65a=_0x5eb65a||0x1f4;return function(_0x33bf2e){logger[_0xb200('0x20')](_0x33bf2e[_0xb200('0x21')]);if(_0x33bf2e[_0xb200('0x22')]){delete _0x33bf2e['name'];}_0x55f9b8[_0xb200('0x12')](_0x5eb65a)['send'](_0x33bf2e);};}exports[_0xb200('0x23')]=function(_0x290548,_0x402227){var _0x4a1328={},_0x3c9190={},_0x148a1b={'count':0x0,'rows':[]};var _0x31186b=db[_0xb200('0x24')][_0xb200('0x25')];_0x3c9190['model']=_[_0xb200('0x26')](_0x31186b);_0x3c9190[_0xb200('0x27')]=_[_0xb200('0x26')](_0x290548[_0xb200('0x27')]);_0x3c9190[_0xb200('0x28')]=_[_0xb200('0x29')](_0x3c9190[_0xb200('0x2a')],_0x3c9190['query']);_0x4a1328['attributes']=_[_0xb200('0x29')](_0x3c9190[_0xb200('0x2a')],qs['fields'](_0x290548[_0xb200('0x27')][_0xb200('0x2b')]));_0x4a1328[_0xb200('0x2c')]=_0x4a1328[_0xb200('0x2c')]['length']?_0x4a1328[_0xb200('0x2c')]:_0x3c9190[_0xb200('0x2a')];if(!_0x290548[_0xb200('0x27')][_0xb200('0x2d')](_0xb200('0x2e'))){_0x4a1328[_0xb200('0x17')]=qs[_0xb200('0x17')](_0x290548[_0xb200('0x27')][_0xb200('0x17')]);_0x4a1328[_0xb200('0x16')]=qs[_0xb200('0x16')](_0x290548[_0xb200('0x27')][_0xb200('0x16')]);}_0x4a1328['order']=qs[_0xb200('0x2f')](_0x290548[_0xb200('0x27')][_0xb200('0x2f')]);_0x4a1328[_0xb200('0x30')]=qs['filters'](_[_0xb200('0x31')](_0x290548[_0xb200('0x27')],_0x3c9190[_0xb200('0x28')]));if(_0x290548[_0xb200('0x27')][_0xb200('0x32')]){_0x4a1328[_0xb200('0x30')]=_['merge'](_0x4a1328[_0xb200('0x30')],{'$or':_[_0xb200('0x33')](_0x31186b,function(_0x535df0){if(_0x535df0[_0xb200('0x34')][_0xb200('0x35')]!=='VIRTUAL'){var _0x7918d3={};_0x7918d3[_0x535df0['field']]={'$like':'%'+_0x290548[_0xb200('0x27')][_0xb200('0x32')]+'%'};return _0x7918d3;}})});}_0x4a1328=_['merge']({},_0x4a1328,_0x290548[_0xb200('0x36')]);var _0x17a1dc={'where':_0x4a1328[_0xb200('0x30')]};return db[_0xb200('0x24')][_0xb200('0x15')](_0x17a1dc)[_0xb200('0x1c')](function(_0x3b4ced){_0x148a1b[_0xb200('0x15')]=_0x3b4ced;if(_0x290548['query'][_0xb200('0x37')]){_0x4a1328['include']=[{'all':!![]}];}return db['VoiceMail'][_0xb200('0x38')](_0x4a1328);})[_0xb200('0x1c')](function(_0x3685ba){_0x148a1b[_0xb200('0x39')]=_0x3685ba;return _0x148a1b;})[_0xb200('0x1c')](respondWithFilteredResult(_0x402227,_0x4a1328))[_0xb200('0x3a')](handleError(_0x402227,null));};exports[_0xb200('0x3b')]=function(_0x6d6067,_0x17d530){var _0x42301f={'raw':!![],'where':{'id':_0x6d6067['params']['id']}},_0x4d4032={};_0x4d4032[_0xb200('0x2a')]=_['keys'](db[_0xb200('0x24')][_0xb200('0x25')]);_0x4d4032[_0xb200('0x27')]=_[_0xb200('0x26')](_0x6d6067['query']);_0x4d4032['filters']=_['intersection'](_0x4d4032[_0xb200('0x2a')],_0x4d4032['query']);_0x42301f['attributes']=_[_0xb200('0x29')](_0x4d4032['model'],qs[_0xb200('0x2b')](_0x6d6067[_0xb200('0x27')][_0xb200('0x2b')]));_0x42301f[_0xb200('0x2c')]=_0x42301f[_0xb200('0x2c')][_0xb200('0x3c')]?_0x42301f[_0xb200('0x2c')]:_0x4d4032['model'];if(_0x6d6067[_0xb200('0x27')]['includeAll']){_0x42301f[_0xb200('0x3d')]=[{'all':!![]}];}_0x42301f=_[_0xb200('0x3e')]({},_0x42301f,_0x6d6067[_0xb200('0x36')]);return db[_0xb200('0x24')]['find'](_0x42301f)[_0xb200('0x1c')](handleEntityNotFound(_0x17d530,null))[_0xb200('0x1c')](respondWithResult(_0x17d530,null))[_0xb200('0x3a')](handleError(_0x17d530,null));};exports['create']=function(_0x4c98ad,_0x25fa53){return db[_0xb200('0x24')][_0xb200('0x3f')](_0x4c98ad['body'],{})[_0xb200('0x1c')](function(_0x27dead){var _0x4f21a9=_0x4c98ad[_0xb200('0x40')][_0xb200('0x1e')]({'plain':!![]});if(!_0x4f21a9)throw new Error(_0xb200('0x41'));if(_0x4f21a9[_0xb200('0x42')]===_0xb200('0x40')){var _0x39a28e=_0x27dead[_0xb200('0x1e')]({'plain':!![]});var _0x17cf70='Voicemails';return db[_0xb200('0x43')][_0xb200('0x44')]({'where':{'name':_0x17cf70,'userProfileId':_0x4f21a9[_0xb200('0x45')]},'raw':!![]})[_0xb200('0x1c')](function(_0x139e37){if(_0x139e37&&_0x139e37['autoAssociation']===0x0){return db[_0xb200('0x46')]['create']({'name':_0x39a28e[_0xb200('0x22')],'resourceId':_0x39a28e['id'],'type':_0x139e37['name'],'sectionId':_0x139e37['id']},{})[_0xb200('0x1c')](function(){return _0x27dead;});}else{return _0x27dead;}})[_0xb200('0x3a')](function(_0x39b031){logger[_0xb200('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b031);throw _0x39b031;});}return _0x27dead;})[_0xb200('0x1c')](respondWithResult(_0x25fa53,0xc9))[_0xb200('0x3a')](handleError(_0x25fa53,null));};exports[_0xb200('0x47')]=function(_0x4a5ff1,_0x44cffd){if(_0x4a5ff1[_0xb200('0x48')]['id']){delete _0x4a5ff1[_0xb200('0x48')]['id'];}return db[_0xb200('0x24')]['find']({'where':{'id':_0x4a5ff1[_0xb200('0x49')]['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x44cffd,null))['then'](saveUpdates(_0x4a5ff1[_0xb200('0x48')],null))['then'](respondWithResult(_0x44cffd,null))[_0xb200('0x3a')](handleError(_0x44cffd,null));};exports[_0xb200('0x1d')]=function(_0x405c95,_0x46f9e0){return db[_0xb200('0x24')]['find']({'where':{'id':_0x405c95['params']['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x46f9e0,null))[_0xb200('0x1c')](removeEntity(_0x46f9e0,null))[_0xb200('0x3a')](handleError(_0x46f9e0,null));};exports[_0xb200('0x4a')]=function(_0x46e708,_0x15cc49,_0x46ef96){return db[_0xb200('0x24')][_0xb200('0x4b')]({'where':{'id':_0x46e708['params']['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x15cc49,null))[_0xb200('0x1c')](function(_0xd47e0d){var _0x55fee5;var _0x44c0e1={},_0x479e45={};_0x479e45[_0xb200('0x2a')]=_[_0xb200('0x26')](db[_0xb200('0x4c')][_0xb200('0x25')]);_0x479e45[_0xb200('0x27')]=_[_0xb200('0x26')](_0x46e708[_0xb200('0x27')]);_0x479e45[_0xb200('0x28')]=_[_0xb200('0x29')](_0x479e45[_0xb200('0x2a')],_0x479e45[_0xb200('0x27')]);_0x44c0e1[_0xb200('0x2c')]=_['intersection'](_0x479e45['model'],qs[_0xb200('0x2b')](_0x46e708[_0xb200('0x27')]['fields']));_0x44c0e1[_0xb200('0x2c')]=_0x44c0e1[_0xb200('0x2c')]['length']?_0x44c0e1['attributes']:_0x479e45[_0xb200('0x2a')];if(!_0x46e708[_0xb200('0x27')][_0xb200('0x2d')](_0xb200('0x2e'))){_0x44c0e1[_0xb200('0x17')]=qs[_0xb200('0x17')](_0x46e708[_0xb200('0x27')][_0xb200('0x17')]);_0x44c0e1['offset']=qs[_0xb200('0x16')](_0x46e708[_0xb200('0x27')][_0xb200('0x16')]);}_0x44c0e1[_0xb200('0x4d')]=qs['sort'](_0x46e708[_0xb200('0x27')][_0xb200('0x2f')]);_0x44c0e1[_0xb200('0x30')]=qs['filters'](_[_0xb200('0x31')](_0x46e708[_0xb200('0x27')],_0x479e45[_0xb200('0x28')]));if(_0x46e708[_0xb200('0x27')]['filter']){_0x44c0e1['where']=_[_0xb200('0x3e')](_0x44c0e1[_0xb200('0x30')],{'$or':_['map'](_0x44c0e1[_0xb200('0x2c')],function(_0x45ae05){var _0x1e7a05={};_0x1e7a05[_0x45ae05]={'$like':'%'+_0x46e708[_0xb200('0x27')]['filter']+'%'};return _0x1e7a05;})});}_0x44c0e1[_0xb200('0x30')]=_[_0xb200('0x3e')](_0x44c0e1['where'],{'mailboxuser':_0xd47e0d[_0xb200('0x4e')]});_0x44c0e1=_[_0xb200('0x3e')]({},_0x44c0e1,_0x46e708[_0xb200('0x36')]);return db[_0xb200('0x4c')][_0xb200('0x4f')](_0x44c0e1)['then'](respondWithFilteredResult(_0x15cc49,_0x44c0e1));})['catch'](handleError(_0x15cc49,null));}; \ No newline at end of file +var _0x368f=['findOne','VoiceMailMessage','pick','map','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','Voicemails','UserProfileResource','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x368f,0xbe));var _0xf368=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x368f[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xf368('0x0'));var emlformat=require(_0xf368('0x1'));var rimraf=require(_0xf368('0x2'));var zipdir=require(_0xf368('0x3'));var jsonpatch=require(_0xf368('0x4'));var rp=require(_0xf368('0x5'));var moment=require(_0xf368('0x6'));var BPromise=require(_0xf368('0x7'));var Mustache=require(_0xf368('0x8'));var util=require(_0xf368('0x9'));var path=require(_0xf368('0xa'));var sox=require(_0xf368('0xb'));var csv=require(_0xf368('0xc'));var ejs=require(_0xf368('0xd'));var fs=require('fs');var _=require(_0xf368('0xe'));var squel=require(_0xf368('0xf'));var crypto=require(_0xf368('0x10'));var jsforce=require(_0xf368('0x11'));var deskjs=require(_0xf368('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf368('0x13'));var authService=require(_0xf368('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf368('0x15'))('api');var utils=require(_0xf368('0x16'));var config=require(_0xf368('0x17'));var db=require(_0xf368('0x18'))['db'];function respondWithStatusCode(_0xa32c91,_0x3ab876){_0x3ab876=_0x3ab876||0xcc;return function(_0x2ccb9c){if(_0x2ccb9c){return _0xa32c91['sendStatus'](_0x3ab876);}return _0xa32c91[_0xf368('0x19')](_0x3ab876)[_0xf368('0x1a')]();};}function respondWithResult(_0x364498,_0x187b83){_0x187b83=_0x187b83||0xc8;return function(_0x3e6509){if(_0x3e6509){return _0x364498['status'](_0x187b83)[_0xf368('0x1b')](_0x3e6509);}};}function respondWithFilteredResult(_0x18d7af,_0x22c0aa){return function(_0x2c7fe1){if(_0x2c7fe1){var _0x36e3c0=_0x2c7fe1[_0xf368('0x1c')],_0x1781cb=_0x22c0aa[_0xf368('0x1d')],_0x3352b1=_0x22c0aa[_0xf368('0x1d')]+_0x22c0aa[_0xf368('0x1e')],_0x1fa78e;if(_0x3352b1>=_0x36e3c0){_0x3352b1=_0x36e3c0;_0x1fa78e=0xc8;}else{_0x1fa78e=0xce;}_0x18d7af['status'](_0x1fa78e);return _0x18d7af[_0xf368('0x1f')](_0xf368('0x20'),_0x1781cb+'-'+_0x3352b1+'/'+_0x36e3c0)[_0xf368('0x1b')](_0x2c7fe1);}return null;};}function patchUpdates(_0x4b96e7){return function(_0x5059f2){try{jsonpatch['apply'](_0x5059f2,_0x4b96e7,!![]);}catch(_0x41c9a1){return BPromise[_0xf368('0x21')](_0x41c9a1);}return _0x5059f2[_0xf368('0x22')]();};}function saveUpdates(_0x59cf3d,_0x4513cf){return function(_0x3da262){if(_0x3da262){return _0x3da262[_0xf368('0x23')](_0x59cf3d)['then'](function(_0x528a60){return _0x528a60;});}return null;};}function removeEntity(_0x1781b0,_0x596cae){return function(_0x186202){if(_0x186202){return _0x186202[_0xf368('0x24')]()['then'](function(){var _0x5e7142=_0x186202[_0xf368('0x25')]({'plain':!![]});var _0x124102=_0xf368('0x26');return db[_0xf368('0x27')]['destroy']({'where':{'type':_0x124102,'resourceId':_0x5e7142['id']}})['then'](function(){return _0x186202;});})[_0xf368('0x28')](function(){_0x1781b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed9687,_0x165949){return function(_0x2b9fb2){if(!_0x2b9fb2){_0xed9687[_0xf368('0x29')](0x194);}return _0x2b9fb2;};}function handleError(_0x1c9443,_0x33a98b){_0x33a98b=_0x33a98b||0x1f4;return function(_0x428a7c){logger[_0xf368('0x2a')](_0x428a7c[_0xf368('0x2b')]);if(_0x428a7c[_0xf368('0x2c')]){delete _0x428a7c[_0xf368('0x2c')];}_0x1c9443[_0xf368('0x19')](_0x33a98b)[_0xf368('0x2d')](_0x428a7c);};}exports[_0xf368('0x2e')]=function(_0x4e183e,_0x2fb7d5){var _0x3eea23={},_0x42549b={},_0x4277a6={'count':0x0,'rows':[]};var _0x54c8c5=db[_0xf368('0x2f')][_0xf368('0x30')];_0x42549b[_0xf368('0x31')]=_['keys'](_0x54c8c5);_0x42549b['query']=_[_0xf368('0x32')](_0x4e183e[_0xf368('0x33')]);_0x42549b[_0xf368('0x34')]=_['intersection'](_0x42549b['model'],_0x42549b['query']);_0x3eea23[_0xf368('0x35')]=_[_0xf368('0x36')](_0x42549b['model'],qs[_0xf368('0x37')](_0x4e183e[_0xf368('0x33')][_0xf368('0x37')]));_0x3eea23['attributes']=_0x3eea23['attributes'][_0xf368('0x38')]?_0x3eea23[_0xf368('0x35')]:_0x42549b[_0xf368('0x31')];if(!_0x4e183e[_0xf368('0x33')][_0xf368('0x39')](_0xf368('0x3a'))){_0x3eea23[_0xf368('0x1e')]=qs[_0xf368('0x1e')](_0x4e183e['query'][_0xf368('0x1e')]);_0x3eea23['offset']=qs['offset'](_0x4e183e['query']['offset']);}_0x3eea23[_0xf368('0x3b')]=qs[_0xf368('0x3c')](_0x4e183e[_0xf368('0x33')][_0xf368('0x3c')]);_0x3eea23[_0xf368('0x3d')]=qs[_0xf368('0x34')](_['pick'](_0x4e183e[_0xf368('0x33')],_0x42549b[_0xf368('0x34')]));if(_0x4e183e['query'][_0xf368('0x3e')]){_0x3eea23[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x3eea23[_0xf368('0x3d')],{'$or':_['map'](_0x54c8c5,function(_0x51be7a){if(_0x51be7a[_0xf368('0x40')][_0xf368('0x41')]!==_0xf368('0x42')){var _0x39d974={};_0x39d974[_0x51be7a[_0xf368('0x43')]]={'$like':'%'+_0x4e183e[_0xf368('0x33')][_0xf368('0x3e')]+'%'};return _0x39d974;}})});}_0x3eea23=_[_0xf368('0x3f')]({},_0x3eea23,_0x4e183e[_0xf368('0x44')]);var _0x27269b={'where':_0x3eea23[_0xf368('0x3d')]};return db[_0xf368('0x2f')]['count'](_0x27269b)[_0xf368('0x28')](function(_0x1f66bf){_0x4277a6[_0xf368('0x1c')]=_0x1f66bf;if(_0x4e183e[_0xf368('0x33')][_0xf368('0x45')]){_0x3eea23[_0xf368('0x46')]=[{'all':!![]}];}return db[_0xf368('0x2f')][_0xf368('0x47')](_0x3eea23);})['then'](function(_0x340803){_0x4277a6[_0xf368('0x48')]=_0x340803;return _0x4277a6;})[_0xf368('0x28')](respondWithFilteredResult(_0x2fb7d5,_0x3eea23))['catch'](handleError(_0x2fb7d5,null));};exports[_0xf368('0x49')]=function(_0x595914,_0x22e75f){var _0x3fa371={'raw':!![],'where':{'id':_0x595914[_0xf368('0x4a')]['id']}},_0x1f43d0={};_0x1f43d0[_0xf368('0x31')]=_[_0xf368('0x32')](db['VoiceMail'][_0xf368('0x30')]);_0x1f43d0[_0xf368('0x33')]=_['keys'](_0x595914[_0xf368('0x33')]);_0x1f43d0[_0xf368('0x34')]=_[_0xf368('0x36')](_0x1f43d0[_0xf368('0x31')],_0x1f43d0[_0xf368('0x33')]);_0x3fa371[_0xf368('0x35')]=_[_0xf368('0x36')](_0x1f43d0[_0xf368('0x31')],qs[_0xf368('0x37')](_0x595914[_0xf368('0x33')][_0xf368('0x37')]));_0x3fa371['attributes']=_0x3fa371[_0xf368('0x35')][_0xf368('0x38')]?_0x3fa371[_0xf368('0x35')]:_0x1f43d0['model'];if(_0x595914[_0xf368('0x33')][_0xf368('0x45')]){_0x3fa371[_0xf368('0x46')]=[{'all':!![]}];}_0x3fa371=_[_0xf368('0x3f')]({},_0x3fa371,_0x595914[_0xf368('0x44')]);return db['VoiceMail'][_0xf368('0x4b')](_0x3fa371)[_0xf368('0x28')](handleEntityNotFound(_0x22e75f,null))['then'](respondWithResult(_0x22e75f,null))[_0xf368('0x4c')](handleError(_0x22e75f,null));};exports[_0xf368('0x4d')]=function(_0x26b979,_0x4aaf3d){return db[_0xf368('0x2f')][_0xf368('0x4d')](_0x26b979[_0xf368('0x4e')],{})[_0xf368('0x28')](function(_0x36a064){var _0x5db82f=_0x26b979['user'][_0xf368('0x25')]({'plain':!![]});if(!_0x5db82f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5db82f[_0xf368('0x4f')]===_0xf368('0x50')){var _0x3f0e05=_0x36a064[_0xf368('0x25')]({'plain':!![]});var _0x4ce38e=_0xf368('0x26');return db[_0xf368('0x51')][_0xf368('0x4b')]({'where':{'name':_0x4ce38e,'userProfileId':_0x5db82f[_0xf368('0x52')]},'raw':!![]})['then'](function(_0x10462b){if(_0x10462b&&_0x10462b[_0xf368('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f0e05[_0xf368('0x2c')],'resourceId':_0x3f0e05['id'],'type':_0x10462b['name'],'sectionId':_0x10462b['id']},{})['then'](function(){return _0x36a064;});}else{return _0x36a064;}})[_0xf368('0x4c')](function(_0x41395a){logger[_0xf368('0x2a')](_0xf368('0x54'),_0x41395a);throw _0x41395a;});}return _0x36a064;})[_0xf368('0x28')](respondWithResult(_0x4aaf3d,0xc9))[_0xf368('0x4c')](handleError(_0x4aaf3d,null));};exports[_0xf368('0x23')]=function(_0x9bc90,_0x1003ae){if(_0x9bc90['body']['id']){delete _0x9bc90[_0xf368('0x4e')]['id'];}return db[_0xf368('0x2f')][_0xf368('0x4b')]({'where':{'id':_0x9bc90[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x1003ae,null))['then'](saveUpdates(_0x9bc90[_0xf368('0x4e')],null))[_0xf368('0x28')](respondWithResult(_0x1003ae,null))[_0xf368('0x4c')](handleError(_0x1003ae,null));};exports[_0xf368('0x24')]=function(_0x5c9eac,_0x3118de){return db[_0xf368('0x2f')]['find']({'where':{'id':_0x5c9eac[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x3118de,null))[_0xf368('0x28')](removeEntity(_0x3118de,null))['catch'](handleError(_0x3118de,null));};exports[_0xf368('0x55')]=function(_0x2f50d6,_0x41b6ce,_0x7a9290){return db['VoiceMail'][_0xf368('0x56')]({'where':{'id':_0x2f50d6[_0xf368('0x4a')]['id']}})[_0xf368('0x28')](handleEntityNotFound(_0x41b6ce,null))[_0xf368('0x28')](function(_0x764e69){var _0x3cc5e7;var _0x68af10={},_0x583b33={};_0x583b33[_0xf368('0x31')]=_[_0xf368('0x32')](db[_0xf368('0x57')][_0xf368('0x30')]);_0x583b33[_0xf368('0x33')]=_[_0xf368('0x32')](_0x2f50d6['query']);_0x583b33[_0xf368('0x34')]=_['intersection'](_0x583b33[_0xf368('0x31')],_0x583b33[_0xf368('0x33')]);_0x68af10[_0xf368('0x35')]=_[_0xf368('0x36')](_0x583b33[_0xf368('0x31')],qs['fields'](_0x2f50d6[_0xf368('0x33')][_0xf368('0x37')]));_0x68af10[_0xf368('0x35')]=_0x68af10[_0xf368('0x35')][_0xf368('0x38')]?_0x68af10[_0xf368('0x35')]:_0x583b33['model'];if(!_0x2f50d6[_0xf368('0x33')][_0xf368('0x39')](_0xf368('0x3a'))){_0x68af10[_0xf368('0x1e')]=qs[_0xf368('0x1e')](_0x2f50d6['query']['limit']);_0x68af10[_0xf368('0x1d')]=qs[_0xf368('0x1d')](_0x2f50d6['query'][_0xf368('0x1d')]);}_0x68af10[_0xf368('0x3b')]=qs[_0xf368('0x3c')](_0x2f50d6['query']['sort']);_0x68af10[_0xf368('0x3d')]=qs['filters'](_[_0xf368('0x58')](_0x2f50d6[_0xf368('0x33')],_0x583b33[_0xf368('0x34')]));if(_0x2f50d6['query'][_0xf368('0x3e')]){_0x68af10[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x68af10[_0xf368('0x3d')],{'$or':_[_0xf368('0x59')](_0x68af10['attributes'],function(_0x420de7){var _0x5585c1={};_0x5585c1[_0x420de7]={'$like':'%'+_0x2f50d6[_0xf368('0x33')][_0xf368('0x3e')]+'%'};return _0x5585c1;})});}_0x68af10[_0xf368('0x3d')]=_[_0xf368('0x3f')](_0x68af10[_0xf368('0x3d')],{'mailboxuser':_0x764e69[_0xf368('0x5a')]});_0x68af10=_[_0xf368('0x3f')]({},_0x68af10,_0x2f50d6['options']);return db['VoiceMailMessage'][_0xf368('0x5b')](_0x68af10)['then'](respondWithFilteredResult(_0x41b6ce,_0x68af10));})['catch'](handleError(_0x41b6ce,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f379744..4843037 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 _0xa629=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x537b35,_0x318af3){var _0x13c414=function(_0x4d1618){while(--_0x4d1618){_0x537b35['push'](_0x537b35['shift']());}};_0x13c414(++_0x318af3);}(_0xa629,0x1f0));var _0x9a62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa629[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9a62('0x0'));var logger=require(_0x9a62('0x1'))(_0x9a62('0x2'));var moment=require(_0x9a62('0x3'));var BPromise=require(_0x9a62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a62('0x5'));var rimraf=require(_0x9a62('0x6'));var config=require(_0x9a62('0x7'));var attributes=require(_0x9a62('0x8'));module[_0x9a62('0x9')]=function(_0x25c493,_0x3889fa){return _0x25c493[_0x9a62('0xa')](_0x9a62('0xb'),attributes,{'tableName':_0x9a62('0xc'),'paranoid':![],'indexes':[{'name':_0x9a62('0xd'),'fields':[_0x9a62('0xe'),_0x9a62('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec8d=['util','api','moment','bluebird','request-promise','path','./voiceMail.attributes','exports','define','voice_voicemail','mailbox'];(function(_0xc73b7a,_0x5043d8){var _0x29b837=function(_0x34b8dd){while(--_0x34b8dd){_0xc73b7a['push'](_0xc73b7a['shift']());}};_0x29b837(++_0x5043d8);}(_0xec8d,0x16b));var _0xdec8=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xec8d[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require('lodash');var util=require(_0xdec8('0x0'));var logger=require('../../config/logger')(_0xdec8('0x1'));var moment=require(_0xdec8('0x2'));var BPromise=require(_0xdec8('0x3'));var rp=require(_0xdec8('0x4'));var fs=require('fs');var path=require(_0xdec8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdec8('0x6'));module[_0xdec8('0x7')]=function(_0xece6b2,_0x104ac6){return _0xece6b2[_0xdec8('0x8')]('VoiceMail',attributes,{'tableName':_0xdec8('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xdec8('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 85ee682..96da7fc 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 _0xe4b3=['client','http','then','info','debug','request\x20sent','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0xe4b3,0x11c));var _0x3e4b=function(_0x5451bf,_0x1e4a55){_0x5451bf=_0x5451bf-0x0;var _0x46c705=_0xe4b3[_0x5451bf];return _0x46c705;};'use strict';var _=require(_0x3e4b('0x0'));var util=require(_0x3e4b('0x1'));var moment=require(_0x3e4b('0x2'));var BPromise=require(_0x3e4b('0x3'));var rs=require(_0x3e4b('0x4'));var fs=require('fs');var Redis=require(_0x3e4b('0x5'));var db=require(_0x3e4b('0x6'))['db'];var utils=require(_0x3e4b('0x7'));var logger=require(_0x3e4b('0x8'))(_0x3e4b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e4b('0xa')][_0x3e4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267b74,_0x7be0c3,_0x2e352a){return new BPromise(function(_0x1bbc45,_0x18a336){return client['request'](_0x267b74,_0x2e352a)[_0x3e4b('0xc')](function(_0x2875be){logger[_0x3e4b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,'request\x20sent');logger[_0x3e4b('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x7be0c3,_0x3e4b('0xf'),JSON['stringify'](_0x2875be));if(_0x2875be['error']){if(_0x2875be[_0x3e4b('0x10')]['code']===0x1f4){logger[_0x3e4b('0x10')](_0x3e4b('0x11'),_0x7be0c3,_0x2875be['error'][_0x3e4b('0x12')]);return _0x18a336(_0x2875be[_0x3e4b('0x10')][_0x3e4b('0x12')]);}logger[_0x3e4b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,_0x2875be[_0x3e4b('0x10')]['message']);return _0x1bbc45(_0x2875be[_0x3e4b('0x10')]['message']);}else{logger['info'](_0x3e4b('0x11'),_0x7be0c3,_0x3e4b('0xf'));_0x1bbc45(_0x2875be[_0x3e4b('0x13')]['message']);}})[_0x3e4b('0x14')](function(_0x5a4fce){logger[_0x3e4b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,_0x5a4fce);_0x18a336(_0x5a4fce);});});} \ No newline at end of file +var _0x9f56=['info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x40fd35,_0x2368e9){var _0x581a3e=function(_0x8df041){while(--_0x8df041){_0x40fd35['push'](_0x40fd35['shift']());}};_0x581a3e(++_0x2368e9);}(_0x9f56,0x1d6));var _0x69f5=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x9f56[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x69f5('0x0'));var util=require(_0x69f5('0x1'));var moment=require('moment');var BPromise=require(_0x69f5('0x2'));var rs=require(_0x69f5('0x3'));var fs=require('fs');var Redis=require(_0x69f5('0x4'));var db=require(_0x69f5('0x5'))['db'];var utils=require(_0x69f5('0x6'));var logger=require(_0x69f5('0x7'))(_0x69f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x69f5('0x9'));var client=jayson[_0x69f5('0xa')][_0x69f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15264a,_0x2c52fa,_0x352da3){return new BPromise(function(_0x3b68a0,_0x181760){return client[_0x69f5('0xc')](_0x15264a,_0x352da3)['then'](function(_0x4dbf71){logger[_0x69f5('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2c52fa,_0x69f5('0xe'));logger[_0x69f5('0xf')](_0x69f5('0x10'),_0x2c52fa,'request\x20sent',JSON[_0x69f5('0x11')](_0x4dbf71));if(_0x4dbf71[_0x69f5('0x12')]){if(_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x2c52fa,_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x14')]);return _0x181760(_0x4dbf71['error'][_0x69f5('0x14')]);}logger[_0x69f5('0x12')](_0x69f5('0x15'),_0x2c52fa,_0x4dbf71[_0x69f5('0x12')][_0x69f5('0x14')]);return _0x3b68a0(_0x4dbf71[_0x69f5('0x12')]['message']);}else{logger['info'](_0x69f5('0x15'),_0x2c52fa,'request\x20sent');_0x3b68a0(_0x4dbf71[_0x69f5('0x16')]['message']);}})['catch'](function(_0x233452){logger[_0x69f5('0x12')](_0x69f5('0x15'),_0x2c52fa,_0x233452);_0x181760(_0x233452);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index e43ac1f..232edc6 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 _0xeb84=['post','create','put','update','delete','exports','multer','path','express','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download'];(function(_0x4d10d4,_0x524297){var _0x2eaa19=function(_0x3d7e50){while(--_0x3d7e50){_0x4d10d4['push'](_0x4d10d4['shift']());}};_0x2eaa19(++_0x524297);}(_0xeb84,0xba));var _0x4eb8=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0xeb84[_0x5ad771];return _0x5b5dce;};'use strict';var multer=require(_0x4eb8('0x0'));var util=require('util');var path=require(_0x4eb8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4eb8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4eb8('0x3'));var config=require(_0x4eb8('0x4'));var controller=require(_0x4eb8('0x5'));router[_0x4eb8('0x6')]('/',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0x8')]);router['get'](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xa')]);router[_0x4eb8('0x6')]('/:id/download',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xb')]);router[_0x4eb8('0xc')]('/',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xd')]);router[_0x4eb8('0xe')](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xf')]);router[_0x4eb8('0x10')](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller['destroy']);module[_0x4eb8('0x11')]=router; \ No newline at end of file +var _0x94f8=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','util','path'];(function(_0x3c5a7a,_0x47f782){var _0x4eeb5f=function(_0x19c7b9){while(--_0x19c7b9){_0x3c5a7a['push'](_0x3c5a7a['shift']());}};_0x4eeb5f(++_0x47f782);}(_0x94f8,0xb9));var _0x894f=function(_0x4301c7,_0x34373b){_0x4301c7=_0x4301c7-0x0;var _0x167782=_0x94f8[_0x4301c7];return _0x167782;};'use strict';var multer=require('multer');var util=require(_0x894f('0x0'));var path=require(_0x894f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x894f('0x2'));var interaction=require(_0x894f('0x3'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x894f('0x4')]('/',auth[_0x894f('0x5')](),controller[_0x894f('0x6')]);router[_0x894f('0x4')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller[_0x894f('0x8')]);router[_0x894f('0x4')](_0x894f('0x9'),auth[_0x894f('0x5')](),controller[_0x894f('0xa')]);router[_0x894f('0xb')]('/',auth[_0x894f('0x5')](),controller[_0x894f('0xc')]);router[_0x894f('0xd')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller['update']);router[_0x894f('0xe')](_0x894f('0x7'),auth[_0x894f('0x5')](),controller[_0x894f('0xf')]);module[_0x894f('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 75b9178..758560a 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 _0x71d5=['TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x51d078,_0x45554f){var _0x1d7695=function(_0x3bbf1d){while(--_0x3bbf1d){_0x51d078['push'](_0x51d078['shift']());}};_0x1d7695(++_0x45554f);}(_0x71d5,0x109));var _0x571d=function(_0x3bbb97,_0x539f0a){_0x3bbb97=_0x3bbb97-0x0;var _0xec491d=_0x71d5[_0x3bbb97];return _0xec491d;};'use strict';var Sequelize=require(_0x571d('0x0'));module[_0x571d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5bd40e){return this[_0x571d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x571d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x571d('0x5')](_0x571d('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'stamp':{'type':_0x571d('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x4dfd=['INTEGER','STRING','long','TIMESTAMP','VIRTUAL','getDataValue'];(function(_0xa76be9,_0x1929f8){var _0x2faaaf=function(_0x223240){while(--_0x223240){_0xa76be9['push'](_0xa76be9['shift']());}};_0x2faaaf(++_0x1929f8);}(_0x4dfd,0x148));var _0xd4df=function(_0x234b2f,_0x608519){_0x234b2f=_0x234b2f-0x0;var _0x7c0659=_0x4dfd[_0x234b2f];return _0x7c0659;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd4df('0x0')],'get':function(_0x1a04f4){return this[_0xd4df('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xd4df('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xd4df('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd4df('0x3')],'defaultValue':''},'stamp':{'type':_0xd4df('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1b629c2..903d573 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 _0xc6d8=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','VoiceMailMessage','includeAll','include','rows','catch','show','params','create','body','find','msg_id','recording','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','html-pdf','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x5af9d9,_0x1f1101){var _0x3ef1d2=function(_0x285d2d){while(--_0x285d2d){_0x5af9d9['push'](_0x5af9d9['shift']());}};_0x3ef1d2(++_0x1f1101);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4e62ca,_0xe85442){_0x4e62ca=_0x4e62ca-0x0;var _0x16007a=_0xc6d8[_0x4e62ca];return _0x16007a;};'use strict';var pdf=require(_0x8c6d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c6d('0x2'));var rp=require('request-promise');var moment=require(_0x8c6d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8c6d('0x4'));var path=require(_0x8c6d('0x5'));var sox=require(_0x8c6d('0x6'));var csv=require(_0x8c6d('0x7'));var ejs=require(_0x8c6d('0x8'));var fs=require('fs');var _=require(_0x8c6d('0x9'));var squel=require(_0x8c6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8c6d('0xb'));var deskjs=require(_0x8c6d('0xc'));var toCsv=require(_0x8c6d('0x7'));var querystring=require('querystring');var Papa=require(_0x8c6d('0xd'));var Redis=require(_0x8c6d('0xe'));var authService=require(_0x8c6d('0xf'));var qs=require(_0x8c6d('0x10'));var hardwareService=require(_0x8c6d('0x11'));var logger=require(_0x8c6d('0x12'))(_0x8c6d('0x13'));var utils=require(_0x8c6d('0x14'));var config=require('../../config/environment');var db=require(_0x8c6d('0x15'))['db'];function respondWithStatusCode(_0x559d17,_0x4c0878){_0x4c0878=_0x4c0878||0xcc;return function(_0x22d0fb){if(_0x22d0fb){return _0x559d17[_0x8c6d('0x16')](_0x4c0878);}return _0x559d17[_0x8c6d('0x17')](_0x4c0878)[_0x8c6d('0x18')]();};}function respondWithResult(_0x30ecfa,_0xe294e7){_0xe294e7=_0xe294e7||0xc8;return function(_0x42d746){if(_0x42d746){return _0x30ecfa[_0x8c6d('0x17')](_0xe294e7)[_0x8c6d('0x19')](_0x42d746);}};}function respondWithFilteredResult(_0x31d943,_0x4fb956){return function(_0x16c6b5){if(_0x16c6b5){var _0x4b2bb1=_0x16c6b5[_0x8c6d('0x1a')],_0x16af06=_0x4fb956['offset'],_0x4dd4b6=_0x4fb956[_0x8c6d('0x1b')]+_0x4fb956[_0x8c6d('0x1c')],_0x150a16;if(_0x4dd4b6>=_0x4b2bb1){_0x4dd4b6=_0x4b2bb1;_0x150a16=0xc8;}else{_0x150a16=0xce;}_0x31d943['status'](_0x150a16);return _0x31d943[_0x8c6d('0x1d')]('Content-Range',_0x16af06+'-'+_0x4dd4b6+'/'+_0x4b2bb1)['json'](_0x16c6b5);}return null;};}function patchUpdates(_0x21b8ee){return function(_0x5c962e){try{jsonpatch[_0x8c6d('0x1e')](_0x5c962e,_0x21b8ee,!![]);}catch(_0x174a4f){return BPromise[_0x8c6d('0x1f')](_0x174a4f);}return _0x5c962e[_0x8c6d('0x20')]();};}function saveUpdates(_0x5ac817,_0x56854a){return function(_0x5512be){if(_0x5512be){return _0x5512be['update'](_0x5ac817)[_0x8c6d('0x21')](function(_0x507e0c){return _0x507e0c;});}return null;};}function removeEntity(_0xc3288,_0x4b6835){return function(_0x4c378b){if(_0x4c378b){return _0x4c378b[_0x8c6d('0x22')]()[_0x8c6d('0x21')](function(){_0xc3288['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51bb08,_0x47d3a0){return function(_0x2a85b5){if(!_0x2a85b5){_0x51bb08[_0x8c6d('0x16')](0x194);}return _0x2a85b5;};}function handleError(_0x292ae4,_0x48f64a){_0x48f64a=_0x48f64a||0x1f4;return function(_0x41c904){logger['error'](_0x41c904[_0x8c6d('0x23')]);if(_0x41c904['name']){delete _0x41c904[_0x8c6d('0x24')];}_0x292ae4[_0x8c6d('0x17')](_0x48f64a)[_0x8c6d('0x25')](_0x41c904);};}exports[_0x8c6d('0x26')]=function(_0x1e6755,_0x3e3cd3){var _0x9c269d={},_0x41957d={},_0x3eab38={'count':0x0,'rows':[]};var _0x4c307c=db['VoiceMailMessage'][_0x8c6d('0x27')];_0x41957d[_0x8c6d('0x28')]=_[_0x8c6d('0x29')](_[_0x8c6d('0x2a')](_0x4c307c),[_0x8c6d('0x24')]);_0x41957d[_0x8c6d('0x2b')]=_[_0x8c6d('0x2a')](_0x1e6755[_0x8c6d('0x2b')]);_0x41957d[_0x8c6d('0x2c')]=_[_0x8c6d('0x2d')](_0x41957d[_0x8c6d('0x28')],_0x41957d[_0x8c6d('0x2b')]);_0x9c269d['attributes']=_[_0x8c6d('0x2d')](_0x41957d[_0x8c6d('0x28')],qs[_0x8c6d('0x2e')](_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x2e')]));_0x9c269d[_0x8c6d('0x2f')]=_0x9c269d[_0x8c6d('0x2f')][_0x8c6d('0x30')]?_0x9c269d[_0x8c6d('0x2f')]:_0x41957d['model'];if(!_0x1e6755[_0x8c6d('0x2b')]['hasOwnProperty'](_0x8c6d('0x31'))){_0x9c269d[_0x8c6d('0x1c')]=qs[_0x8c6d('0x1c')](_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x1c')]);_0x9c269d[_0x8c6d('0x1b')]=qs['offset'](_0x1e6755['query'][_0x8c6d('0x1b')]);}_0x9c269d[_0x8c6d('0x32')]=qs[_0x8c6d('0x33')](_0x1e6755[_0x8c6d('0x2b')]['sort']);_0x9c269d[_0x8c6d('0x34')]=qs[_0x8c6d('0x2c')](_[_0x8c6d('0x35')](_0x1e6755[_0x8c6d('0x2b')],_0x41957d[_0x8c6d('0x2c')]));if(_0x1e6755[_0x8c6d('0x2b')]['filter']){_0x9c269d[_0x8c6d('0x34')]=_[_0x8c6d('0x36')](_0x9c269d[_0x8c6d('0x34')],{'$or':_[_0x8c6d('0x37')](_0x4c307c,function(_0xff4b5b){if(_0xff4b5b[_0x8c6d('0x38')][_0x8c6d('0x39')]!==_0x8c6d('0x3a')){var _0x24200c={};_0x24200c[_0xff4b5b[_0x8c6d('0x3b')]]={'$like':'%'+_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x3c')]+'%'};return _0x24200c;}})});}_0x9c269d=_['merge']({},_0x9c269d,_0x1e6755[_0x8c6d('0x3d')]);var _0x82b885={'where':_0x9c269d[_0x8c6d('0x34')]};return db[_0x8c6d('0x3e')][_0x8c6d('0x1a')](_0x82b885)['then'](function(_0x26027f){_0x3eab38[_0x8c6d('0x1a')]=_0x26027f;if(_0x1e6755['query'][_0x8c6d('0x3f')]){_0x9c269d[_0x8c6d('0x40')]=[{'all':!![]}];}return db[_0x8c6d('0x3e')]['findAll'](_0x9c269d);})[_0x8c6d('0x21')](function(_0xb7293d){_0x3eab38[_0x8c6d('0x41')]=_0xb7293d;return _0x3eab38;})[_0x8c6d('0x21')](respondWithFilteredResult(_0x3e3cd3,_0x9c269d))[_0x8c6d('0x42')](handleError(_0x3e3cd3,null));};exports[_0x8c6d('0x43')]=function(_0x305910,_0x2bbf60){var _0x925988={'raw':!![],'where':{'id':_0x305910[_0x8c6d('0x44')]['id']}},_0x2113ed={};_0x2113ed['model']=_['keys'](db['VoiceMailMessage'][_0x8c6d('0x27')]);_0x2113ed[_0x8c6d('0x2b')]=_[_0x8c6d('0x2a')](_0x305910[_0x8c6d('0x2b')]);_0x2113ed[_0x8c6d('0x2c')]=_['intersection'](_0x2113ed[_0x8c6d('0x28')],_0x2113ed[_0x8c6d('0x2b')]);_0x925988[_0x8c6d('0x2f')]=_['intersection'](_0x2113ed[_0x8c6d('0x28')],qs[_0x8c6d('0x2e')](_0x305910['query']['fields']));_0x925988['attributes']=_0x925988['attributes']['length']?_0x925988[_0x8c6d('0x2f')]:_0x2113ed[_0x8c6d('0x28')];if(_0x305910[_0x8c6d('0x2b')][_0x8c6d('0x3f')]){_0x925988[_0x8c6d('0x40')]=[{'all':!![]}];}_0x925988=_['merge']({},_0x925988,_0x305910['options']);return db['VoiceMailMessage']['find'](_0x925988)[_0x8c6d('0x21')](handleEntityNotFound(_0x2bbf60,null))['then'](respondWithResult(_0x2bbf60,null))[_0x8c6d('0x42')](handleError(_0x2bbf60,null));};exports[_0x8c6d('0x45')]=function(_0x38c127,_0x8a980b){return db[_0x8c6d('0x3e')][_0x8c6d('0x45')](_0x38c127['body'],{})[_0x8c6d('0x21')](respondWithResult(_0x8a980b,0xc9))[_0x8c6d('0x42')](handleError(_0x8a980b,null));};exports['update']=function(_0xe0693a,_0xc0547e){if(_0xe0693a['body']['id']){delete _0xe0693a[_0x8c6d('0x46')]['id'];}return db[_0x8c6d('0x3e')][_0x8c6d('0x47')]({'where':{'id':_0xe0693a[_0x8c6d('0x44')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0xc0547e,null))[_0x8c6d('0x21')](saveUpdates(_0xe0693a[_0x8c6d('0x46')],null))[_0x8c6d('0x21')](respondWithResult(_0xc0547e,null))[_0x8c6d('0x42')](handleError(_0xc0547e,null));};exports[_0x8c6d('0x22')]=function(_0x361956,_0x23792d){return db[_0x8c6d('0x3e')][_0x8c6d('0x47')]({'where':{'id':_0x361956[_0x8c6d('0x44')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0x23792d,null))['then'](removeEntity(_0x23792d,null))['catch'](handleError(_0x23792d,null));};exports['download']=function(_0x28da18,_0x1f3ea6,_0x4919b8){return db[_0x8c6d('0x3e')]['find']({'where':{'id':_0x28da18[_0x8c6d('0x44')]['id']},'attributes':['id','recording',_0x8c6d('0x48')]})[_0x8c6d('0x21')](handleEntityNotFound(_0x1f3ea6,null))[_0x8c6d('0x21')](function(_0x5e2dbb){if(_0x5e2dbb){if(!_0x5e2dbb[_0x8c6d('0x49')]){throw new db['Sequelize'][(_0x8c6d('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0xcbcc60={'Content-Type':_0x8c6d('0x4b'),'Content-Disposition':_0x8c6d('0x4c')};if(_0x5e2dbb[_0x8c6d('0x48')]){_0xcbcc60['Content-Disposition']=_0x8c6d('0x4d')+_0x5e2dbb[_0x8c6d('0x48')]+_0x8c6d('0x4e');}_0x1f3ea6[_0x8c6d('0x1d')](_0xcbcc60);return _0x1f3ea6[_0x8c6d('0x25')](new Buffer(_0x5e2dbb[_0x8c6d('0x49')]));}})[_0x8c6d('0x42')](handleError(_0x1f3ea6,null));}; \ No newline at end of file +var _0x9aea=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','VoiceMailMessage','find','create','body','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','recording','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0xa221f5,_0x3cc639){var _0x3762ca=function(_0x4038bd){while(--_0x4038bd){_0xa221f5['push'](_0xa221f5['shift']());}};_0x3762ca(++_0x3cc639);}(_0x9aea,0xdd));var _0xa9ae=function(_0x1ac867,_0x444598){_0x1ac867=_0x1ac867-0x0;var _0x224334=_0x9aea[_0x1ac867];return _0x224334;};'use strict';var pdf=require(_0xa9ae('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa9ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9ae('0x2'));var rp=require(_0xa9ae('0x3'));var moment=require('moment');var BPromise=require(_0xa9ae('0x4'));var Mustache=require(_0xa9ae('0x5'));var util=require(_0xa9ae('0x6'));var path=require(_0xa9ae('0x7'));var sox=require(_0xa9ae('0x8'));var csv=require('to-csv');var ejs=require(_0xa9ae('0x9'));var fs=require('fs');var _=require(_0xa9ae('0xa'));var squel=require(_0xa9ae('0xb'));var crypto=require('crypto');var jsforce=require(_0xa9ae('0xc'));var deskjs=require(_0xa9ae('0xd'));var toCsv=require(_0xa9ae('0xe'));var querystring=require(_0xa9ae('0xf'));var Papa=require(_0xa9ae('0x10'));var Redis=require(_0xa9ae('0x11'));var authService=require(_0xa9ae('0x12'));var qs=require(_0xa9ae('0x13'));var hardwareService=require(_0xa9ae('0x14'));var logger=require('../../config/logger')(_0xa9ae('0x15'));var utils=require('../../config/utils');var config=require(_0xa9ae('0x16'));var db=require(_0xa9ae('0x17'))['db'];function respondWithStatusCode(_0x112ab5,_0x378871){_0x378871=_0x378871||0xcc;return function(_0x35f861){if(_0x35f861){return _0x112ab5[_0xa9ae('0x18')](_0x378871);}return _0x112ab5[_0xa9ae('0x19')](_0x378871)[_0xa9ae('0x1a')]();};}function respondWithResult(_0x56de45,_0x1859c3){_0x1859c3=_0x1859c3||0xc8;return function(_0x365e90){if(_0x365e90){return _0x56de45[_0xa9ae('0x19')](_0x1859c3)[_0xa9ae('0x1b')](_0x365e90);}};}function respondWithFilteredResult(_0x4d0bd9,_0x28ce2d){return function(_0x1ec742){if(_0x1ec742){var _0x31c03e=_0x1ec742['count'],_0x40b756=_0x28ce2d[_0xa9ae('0x1c')],_0x77b0a4=_0x28ce2d[_0xa9ae('0x1c')]+_0x28ce2d[_0xa9ae('0x1d')],_0xddb095;if(_0x77b0a4>=_0x31c03e){_0x77b0a4=_0x31c03e;_0xddb095=0xc8;}else{_0xddb095=0xce;}_0x4d0bd9['status'](_0xddb095);return _0x4d0bd9['set'](_0xa9ae('0x1e'),_0x40b756+'-'+_0x77b0a4+'/'+_0x31c03e)['json'](_0x1ec742);}return null;};}function patchUpdates(_0x59e7dd){return function(_0x18911b){try{jsonpatch[_0xa9ae('0x1f')](_0x18911b,_0x59e7dd,!![]);}catch(_0xbfd2ff){return BPromise[_0xa9ae('0x20')](_0xbfd2ff);}return _0x18911b['save']();};}function saveUpdates(_0x27371a,_0x3d5d81){return function(_0x39f133){if(_0x39f133){return _0x39f133[_0xa9ae('0x21')](_0x27371a)[_0xa9ae('0x22')](function(_0x2e204d){return _0x2e204d;});}return null;};}function removeEntity(_0x971ee1,_0x5a062d){return function(_0xc021cf){if(_0xc021cf){return _0xc021cf['destroy']()['then'](function(){_0x971ee1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afd07,_0x4edd55){return function(_0x13fb05){if(!_0x13fb05){_0x1afd07['sendStatus'](0x194);}return _0x13fb05;};}function handleError(_0x2ff25c,_0x38eaeb){_0x38eaeb=_0x38eaeb||0x1f4;return function(_0x93d637){logger[_0xa9ae('0x23')](_0x93d637[_0xa9ae('0x24')]);if(_0x93d637[_0xa9ae('0x25')]){delete _0x93d637[_0xa9ae('0x25')];}_0x2ff25c['status'](_0x38eaeb)[_0xa9ae('0x26')](_0x93d637);};}exports[_0xa9ae('0x27')]=function(_0x2aac9e,_0xfe9ef1){var _0x222db7={},_0x428934={},_0xb12fa8={'count':0x0,'rows':[]};var _0x5dfcd7=db['VoiceMailMessage'][_0xa9ae('0x28')];_0x428934[_0xa9ae('0x29')]=_[_0xa9ae('0x2a')](_[_0xa9ae('0x2b')](_0x5dfcd7),[_0xa9ae('0x25')]);_0x428934['query']=_['keys'](_0x2aac9e[_0xa9ae('0x2c')]);_0x428934[_0xa9ae('0x2d')]=_[_0xa9ae('0x2e')](_0x428934[_0xa9ae('0x29')],_0x428934[_0xa9ae('0x2c')]);_0x222db7[_0xa9ae('0x2f')]=_['intersection'](_0x428934['model'],qs[_0xa9ae('0x30')](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x30')]));_0x222db7[_0xa9ae('0x2f')]=_0x222db7[_0xa9ae('0x2f')][_0xa9ae('0x31')]?_0x222db7[_0xa9ae('0x2f')]:_0x428934[_0xa9ae('0x29')];if(!_0x2aac9e['query'][_0xa9ae('0x32')]('nolimit')){_0x222db7[_0xa9ae('0x1d')]=qs[_0xa9ae('0x1d')](_0x2aac9e[_0xa9ae('0x2c')]['limit']);_0x222db7[_0xa9ae('0x1c')]=qs[_0xa9ae('0x1c')](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x1c')]);}_0x222db7[_0xa9ae('0x33')]=qs['sort'](_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x34')]);_0x222db7[_0xa9ae('0x35')]=qs['filters'](_['pick'](_0x2aac9e[_0xa9ae('0x2c')],_0x428934[_0xa9ae('0x2d')]));if(_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x36')]){_0x222db7['where']=_[_0xa9ae('0x37')](_0x222db7[_0xa9ae('0x35')],{'$or':_[_0xa9ae('0x38')](_0x5dfcd7,function(_0x9766c9){if(_0x9766c9[_0xa9ae('0x39')]['key']!==_0xa9ae('0x3a')){var _0x4b890e={};_0x4b890e[_0x9766c9[_0xa9ae('0x3b')]]={'$like':'%'+_0x2aac9e[_0xa9ae('0x2c')][_0xa9ae('0x36')]+'%'};return _0x4b890e;}})});}_0x222db7=_['merge']({},_0x222db7,_0x2aac9e[_0xa9ae('0x3c')]);var _0x1ffcab={'where':_0x222db7[_0xa9ae('0x35')]};return db['VoiceMailMessage'][_0xa9ae('0x3d')](_0x1ffcab)[_0xa9ae('0x22')](function(_0x4e2001){_0xb12fa8[_0xa9ae('0x3d')]=_0x4e2001;if(_0x2aac9e['query'][_0xa9ae('0x3e')]){_0x222db7[_0xa9ae('0x3f')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa9ae('0x40')](_0x222db7);})[_0xa9ae('0x22')](function(_0x234da5){_0xb12fa8[_0xa9ae('0x41')]=_0x234da5;return _0xb12fa8;})[_0xa9ae('0x22')](respondWithFilteredResult(_0xfe9ef1,_0x222db7))[_0xa9ae('0x42')](handleError(_0xfe9ef1,null));};exports['show']=function(_0x3da6ce,_0xa12887){var _0x511fb2={'raw':!![],'where':{'id':_0x3da6ce[_0xa9ae('0x43')]['id']}},_0x5609d4={};_0x5609d4[_0xa9ae('0x29')]=_[_0xa9ae('0x2b')](db[_0xa9ae('0x44')]['rawAttributes']);_0x5609d4[_0xa9ae('0x2c')]=_[_0xa9ae('0x2b')](_0x3da6ce[_0xa9ae('0x2c')]);_0x5609d4[_0xa9ae('0x2d')]=_[_0xa9ae('0x2e')](_0x5609d4[_0xa9ae('0x29')],_0x5609d4[_0xa9ae('0x2c')]);_0x511fb2['attributes']=_[_0xa9ae('0x2e')](_0x5609d4[_0xa9ae('0x29')],qs['fields'](_0x3da6ce[_0xa9ae('0x2c')]['fields']));_0x511fb2[_0xa9ae('0x2f')]=_0x511fb2[_0xa9ae('0x2f')][_0xa9ae('0x31')]?_0x511fb2[_0xa9ae('0x2f')]:_0x5609d4[_0xa9ae('0x29')];if(_0x3da6ce[_0xa9ae('0x2c')][_0xa9ae('0x3e')]){_0x511fb2['include']=[{'all':!![]}];}_0x511fb2=_[_0xa9ae('0x37')]({},_0x511fb2,_0x3da6ce[_0xa9ae('0x3c')]);return db['VoiceMailMessage'][_0xa9ae('0x45')](_0x511fb2)[_0xa9ae('0x22')](handleEntityNotFound(_0xa12887,null))[_0xa9ae('0x22')](respondWithResult(_0xa12887,null))[_0xa9ae('0x42')](handleError(_0xa12887,null));};exports[_0xa9ae('0x46')]=function(_0x76502d,_0x571cb4){return db[_0xa9ae('0x44')]['create'](_0x76502d[_0xa9ae('0x47')],{})[_0xa9ae('0x22')](respondWithResult(_0x571cb4,0xc9))['catch'](handleError(_0x571cb4,null));};exports['update']=function(_0x1c2861,_0x3c558e){if(_0x1c2861[_0xa9ae('0x47')]['id']){delete _0x1c2861[_0xa9ae('0x47')]['id'];}return db[_0xa9ae('0x44')][_0xa9ae('0x45')]({'where':{'id':_0x1c2861[_0xa9ae('0x43')]['id']}})[_0xa9ae('0x22')](handleEntityNotFound(_0x3c558e,null))['then'](saveUpdates(_0x1c2861['body'],null))[_0xa9ae('0x22')](respondWithResult(_0x3c558e,null))[_0xa9ae('0x42')](handleError(_0x3c558e,null));};exports['destroy']=function(_0x2aada4,_0x38f24c){return db[_0xa9ae('0x44')][_0xa9ae('0x45')]({'where':{'id':_0x2aada4[_0xa9ae('0x43')]['id']}})[_0xa9ae('0x22')](handleEntityNotFound(_0x38f24c,null))[_0xa9ae('0x22')](removeEntity(_0x38f24c,null))[_0xa9ae('0x42')](handleError(_0x38f24c,null));};exports['download']=function(_0x30cc88,_0x1713cb,_0x5ea18d){return db[_0xa9ae('0x44')]['find']({'where':{'id':_0x30cc88['params']['id']},'attributes':['id','recording',_0xa9ae('0x48')]})[_0xa9ae('0x22')](handleEntityNotFound(_0x1713cb,null))['then'](function(_0x4840ea){if(_0x4840ea){if(!_0x4840ea['recording']){throw new db[(_0xa9ae('0x49'))]['ValidationError'](_0xa9ae('0x4a'));}var _0x2c1976={'Content-Type':'audio/wav','Content-Disposition':_0xa9ae('0x4b')};if(_0x4840ea['msg_id']){_0x2c1976[_0xa9ae('0x4c')]=_0xa9ae('0x4d')+_0x4840ea[_0xa9ae('0x48')]+_0xa9ae('0x4e');}_0x1713cb[_0xa9ae('0x4f')](_0x2c1976);return _0x1713cb[_0xa9ae('0x26')](new Buffer(_0x4840ea[_0xa9ae('0x50')]));}})[_0xa9ae('0x42')](handleError(_0x1713cb,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f2d2fb1..c5977ec 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 _0x0657=['request-promise','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x0657,0x1aa));var _0x7065=function(_0x586aa3,_0x56cee8){_0x586aa3=_0x586aa3-0x0;var _0x1eeb9f=_0x0657[_0x586aa3];return _0x1eeb9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7065('0x0'))(_0x7065('0x1'));var moment=require(_0x7065('0x2'));var BPromise=require(_0x7065('0x3'));var rp=require(_0x7065('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7065('0x5'));module[_0x7065('0x6')]=function(_0x310991,_0x4b7140){return _0x310991['define'](_0x7065('0x7'),attributes,{'tableName':_0x7065('0x8'),'paranoid':![],'indexes':[{'name':_0x7065('0x9'),'fields':[_0x7065('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3580=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define'];(function(_0x3bdc60,_0x1097ed){var _0x3358a3=function(_0x3687f1){while(--_0x3687f1){_0x3bdc60['push'](_0x3bdc60['shift']());}};_0x3358a3(++_0x1097ed);}(_0x3580,0x1b6));var _0x0358=function(_0x24fb96,_0x4d1674){_0x24fb96=_0x24fb96-0x0;var _0x584c04=_0x3580[_0x24fb96];return _0x584c04;};'use strict';var _=require(_0x0358('0x0'));var util=require(_0x0358('0x1'));var logger=require(_0x0358('0x2'))(_0x0358('0x3'));var moment=require(_0x0358('0x4'));var BPromise=require(_0x0358('0x5'));var rp=require(_0x0358('0x6'));var fs=require('fs');var path=require(_0x0358('0x7'));var rimraf=require(_0x0358('0x8'));var config=require('../../config/environment');var attributes=require(_0x0358('0x9'));module[_0x0358('0xa')]=function(_0x23ee51,_0x5e9b3b){return _0x23ee51[_0x0358('0xb')](_0x0358('0xc'),attributes,{'tableName':_0x0358('0xd'),'paranoid':![],'indexes':[{'name':_0x0358('0xe'),'fields':[_0x0358('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2423c4a..668282a 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 _0xa888=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x34f896,_0x17a8e7){var _0x567415=function(_0x554c03){while(--_0x554c03){_0x34f896['push'](_0x34f896['shift']());}};_0x567415(++_0x17a8e7);}(_0xa888,0x193));var _0x8a88=function(_0x12dfcd,_0x5008f6){_0x12dfcd=_0x12dfcd-0x0;var _0x25e2c9=_0xa888[_0x12dfcd];return _0x25e2c9;};'use strict';var _=require(_0x8a88('0x0'));var util=require(_0x8a88('0x1'));var moment=require(_0x8a88('0x2'));var BPromise=require(_0x8a88('0x3'));var rs=require(_0x8a88('0x4'));var fs=require('fs');var Redis=require(_0x8a88('0x5'));var db=require(_0x8a88('0x6'))['db'];var utils=require(_0x8a88('0x7'));var logger=require(_0x8a88('0x8'))(_0x8a88('0x9'));var config=require(_0x8a88('0xa'));var jayson=require(_0x8a88('0xb'));var client=jayson['client'][_0x8a88('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e2b82,_0x58910b,_0x179285){return new BPromise(function(_0x5a7fab,_0x217085){return client[_0x8a88('0xd')](_0x4e2b82,_0x179285)[_0x8a88('0xe')](function(_0x30d107){logger['info'](_0x8a88('0xf'),_0x58910b,'request\x20sent');logger[_0x8a88('0x10')](_0x8a88('0x11'),_0x58910b,_0x8a88('0x12'),JSON[_0x8a88('0x13')](_0x30d107));if(_0x30d107['error']){if(_0x30d107[_0x8a88('0x14')][_0x8a88('0x15')]===0x1f4){logger[_0x8a88('0x14')](_0x8a88('0xf'),_0x58910b,_0x30d107['error'][_0x8a88('0x16')]);return _0x217085(_0x30d107[_0x8a88('0x14')][_0x8a88('0x16')]);}logger[_0x8a88('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x58910b,_0x30d107[_0x8a88('0x14')][_0x8a88('0x16')]);return _0x5a7fab(_0x30d107['error']['message']);}else{logger[_0x8a88('0x17')](_0x8a88('0xf'),_0x58910b,_0x8a88('0x12'));_0x5a7fab(_0x30d107['result'][_0x8a88('0x16')]);}})['catch'](function(_0x5dacab){logger[_0x8a88('0x14')](_0x8a88('0xf'),_0x58910b,_0x5dacab);_0x217085(_0x5dacab);});});} \ No newline at end of file +var _0xfc19=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xfc19,0xd1));var _0x9fc1=function(_0x41d1fa,_0xa250bf){_0x41d1fa=_0x41d1fa-0x0;var _0x450b97=_0xfc19[_0x41d1fa];return _0x450b97;};'use strict';var _=require(_0x9fc1('0x0'));var util=require(_0x9fc1('0x1'));var moment=require(_0x9fc1('0x2'));var BPromise=require(_0x9fc1('0x3'));var rs=require(_0x9fc1('0x4'));var fs=require('fs');var Redis=require(_0x9fc1('0x5'));var db=require(_0x9fc1('0x6'))['db'];var utils=require(_0x9fc1('0x7'));var logger=require(_0x9fc1('0x8'))(_0x9fc1('0x9'));var config=require(_0x9fc1('0xa'));var jayson=require(_0x9fc1('0xb'));var client=jayson[_0x9fc1('0xc')][_0x9fc1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5e28ac,_0x5bcddc,_0x537e55){return new BPromise(function(_0x2fdd7a,_0x541628){return client[_0x9fc1('0xe')](_0x5e28ac,_0x537e55)[_0x9fc1('0xf')](function(_0x134b8a){logger[_0x9fc1('0x10')](_0x9fc1('0x11'),_0x5bcddc,'request\x20sent');logger[_0x9fc1('0x12')](_0x9fc1('0x13'),_0x5bcddc,_0x9fc1('0x14'),JSON[_0x9fc1('0x15')](_0x134b8a));if(_0x134b8a['error']){if(_0x134b8a[_0x9fc1('0x16')]['code']===0x1f4){logger['error'](_0x9fc1('0x11'),_0x5bcddc,_0x134b8a[_0x9fc1('0x16')][_0x9fc1('0x17')]);return _0x541628(_0x134b8a[_0x9fc1('0x16')]['message']);}logger[_0x9fc1('0x16')](_0x9fc1('0x11'),_0x5bcddc,_0x134b8a[_0x9fc1('0x16')]['message']);return _0x2fdd7a(_0x134b8a['error'][_0x9fc1('0x17')]);}else{logger[_0x9fc1('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x5bcddc,'request\x20sent');_0x2fdd7a(_0x134b8a[_0x9fc1('0x18')][_0x9fc1('0x17')]);}})[_0x9fc1('0x19')](function(_0x142481){logger[_0x9fc1('0x16')](_0x9fc1('0x11'),_0x5bcddc,_0x142481);_0x541628(_0x142481);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 79402e0..6b2a71f 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 _0x593e=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout'];(function(_0xeb483e,_0x21a05a){var _0x483188=function(_0xdcedd6){while(--_0xdcedd6){_0xeb483e['push'](_0xeb483e['shift']());}};_0x483188(++_0x21a05a);}(_0x593e,0xcb));var _0xe593=function(_0xfda873,_0x5e4fff){_0xfda873=_0xfda873-0x0;var _0x488ee7=_0x593e[_0xfda873];return _0x488ee7;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var auth=require(_0xe593('0x6'));var interaction=require(_0xe593('0x7'));var config=require('../../config/environment');var controller=require(_0xe593('0x8'));router[_0xe593('0x9')]('/',auth[_0xe593('0xa')](),controller[_0xe593('0xb')]);router[_0xe593('0x9')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0xd')]);router[_0xe593('0x9')](_0xe593('0xe'),auth['isAuthenticated'](),controller[_0xe593('0xf')]);router[_0xe593('0x10')]('/',auth[_0xe593('0xa')](),controller['create']);router['post'](_0xe593('0xe'),auth[_0xe593('0xa')](),controller[_0xe593('0x11')]);router['put'](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0x12')]);router[_0xe593('0x13')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0x14')]);router[_0xe593('0x13')](_0xe593('0x15'),auth[_0xe593('0xa')](),controller['removeSound']);module[_0xe593('0x16')]=router; \ No newline at end of file +var _0xd3d1=['getSounds','create','post','addSound','put','update','delete','destroy','removeSound','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds'];(function(_0x3afaae,_0x1ee943){var _0x21c7cc=function(_0x4f545d){while(--_0x4f545d){_0x3afaae['push'](_0x3afaae['shift']());}};_0x21c7cc(++_0x1ee943);}(_0xd3d1,0x172));var _0x1d3d=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xd3d1[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var auth=require(_0x1d3d('0x4'));var interaction=require(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var controller=require(_0x1d3d('0x7'));router[_0x1d3d('0x8')]('/',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xa')]);router[_0x1d3d('0x8')](_0x1d3d('0xb'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xc')]);router[_0x1d3d('0x8')](_0x1d3d('0xd'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xe')]);router['post']('/',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0xf')]);router[_0x1d3d('0x10')](_0x1d3d('0xd'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x11')]);router[_0x1d3d('0x12')](_0x1d3d('0xb'),auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x13')]);router[_0x1d3d('0x14')]('/:id',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x15')]);router['delete']('/:id/sounds/:id2',auth[_0x1d3d('0x9')](),controller[_0x1d3d('0x16')]);module[_0x1d3d('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c84f781..2b85e8b 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 _0xff52=['quietmp3nb','quietmp3','mp3','STRING','BOOLEAN','sequelize','exports','name','ENUM','files','mp3nb'];(function(_0x2cb4a2,_0x2bf0a2){var _0x4e3e58=function(_0x1c5ea1){while(--_0x1c5ea1){_0x2cb4a2['push'](_0x2cb4a2['shift']());}};_0x4e3e58(++_0x2bf0a2);}(_0xff52,0x1a7));var _0x2ff5=function(_0x266da8,_0x47419a){_0x266da8=_0x266da8-0x0;var _0x5cdbe0=_0xff52[_0x266da8];return _0x5cdbe0;};'use strict';var Sequelize=require(_0x2ff5('0x0'));module[_0x2ff5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2ff5('0x2')},'mode':{'type':Sequelize[_0x2ff5('0x3')]('custom',_0x2ff5('0x4'),_0x2ff5('0x5'),_0x2ff5('0x6'),_0x2ff5('0x7'),_0x2ff5('0x8')),'allowNull':!![],'defaultValue':_0x2ff5('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2ff5('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1cd4=['mp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','files'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cd4,0x95));var _0x41cd=function(_0x3f2f56,_0x27e1b8){_0x3f2f56=_0x3f2f56-0x0;var _0x26a4a7=_0x1cd4[_0x3f2f56];return _0x26a4a7;};'use strict';var Sequelize=require(_0x41cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x41cd('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x41cd('0x2')]('custom',_0x41cd('0x3'),_0x41cd('0x4'),'quietmp3nb','quietmp3',_0x41cd('0x5')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x41cd('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x41cd('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x41cd('0x6')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x41cd('0x7')},'defaultEntry':{'type':Sequelize[_0x41cd('0x8')],'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 d774177..1b1df97 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 _0x5c87=['message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','Sequelize','removeSound','id2','pick','getSounds','nolimit','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','VoiceMusicOnHold','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','sequelize','mode','files','join','root','server/files/moh','mkdirSync','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError'];(function(_0x1b1a41,_0x37fdba){var _0x2ef3b7=function(_0x4ee4e0){while(--_0x4ee4e0){_0x1b1a41['push'](_0x1b1a41['shift']());}};_0x2ef3b7(++_0x37fdba);}(_0x5c87,0x85));var _0x75c8=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x5c87[_0x42245d];return _0x4b211a;};'use strict';var pdf=require(_0x75c8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x75c8('0x1'));var zipdir=require(_0x75c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x75c8('0x3'));var BPromise=require(_0x75c8('0x4'));var Mustache=require('mustache');var util=require(_0x75c8('0x5'));var path=require(_0x75c8('0x6'));var sox=require(_0x75c8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x75c8('0x8'));var squel=require(_0x75c8('0x9'));var crypto=require(_0x75c8('0xa'));var jsforce=require(_0x75c8('0xb'));var deskjs=require(_0x75c8('0xc'));var toCsv=require(_0x75c8('0xd'));var querystring=require(_0x75c8('0xe'));var Papa=require(_0x75c8('0xf'));var Redis=require(_0x75c8('0x10'));var authService=require(_0x75c8('0x11'));var qs=require(_0x75c8('0x12'));var hardwareService=require(_0x75c8('0x13'));var logger=require(_0x75c8('0x14'))(_0x75c8('0x15'));var utils=require(_0x75c8('0x16'));var config=require(_0x75c8('0x17'));var db=require(_0x75c8('0x18'))['db'];function respondWithStatusCode(_0x8a5f5b,_0x291547){_0x291547=_0x291547||0xcc;return function(_0x15635d){if(_0x15635d){return _0x8a5f5b[_0x75c8('0x19')](_0x291547);}return _0x8a5f5b[_0x75c8('0x1a')](_0x291547)[_0x75c8('0x1b')]();};}function respondWithResult(_0x1c15bb,_0x3a1439){_0x3a1439=_0x3a1439||0xc8;return function(_0x15ce40){if(_0x15ce40){return _0x1c15bb[_0x75c8('0x1a')](_0x3a1439)[_0x75c8('0x1c')](_0x15ce40);}};}function respondWithFilteredResult(_0x9ffb28,_0x28c46e){return function(_0x955658){if(_0x955658){var _0x15b57d=_0x955658[_0x75c8('0x1d')],_0x58ba75=_0x28c46e['offset'],_0x3e1f23=_0x28c46e[_0x75c8('0x1e')]+_0x28c46e['limit'],_0x1099d4;if(_0x3e1f23>=_0x15b57d){_0x3e1f23=_0x15b57d;_0x1099d4=0xc8;}else{_0x1099d4=0xce;}_0x9ffb28['status'](_0x1099d4);return _0x9ffb28[_0x75c8('0x1f')](_0x75c8('0x20'),_0x58ba75+'-'+_0x3e1f23+'/'+_0x15b57d)[_0x75c8('0x1c')](_0x955658);}return null;};}function patchUpdates(_0x580daf){return function(_0x1aa4e0){try{jsonpatch[_0x75c8('0x21')](_0x1aa4e0,_0x580daf,!![]);}catch(_0x285b96){return BPromise[_0x75c8('0x22')](_0x285b96);}return _0x1aa4e0[_0x75c8('0x23')]();};}function saveUpdates(_0x48fa32,_0x32f170){return function(_0x3e8b58){if(_0x3e8b58){return _0x3e8b58[_0x75c8('0x24')](_0x48fa32)[_0x75c8('0x25')](function(_0x5c010e){return _0x5c010e;});}return null;};}function removeEntity(_0x51ccd0,_0x7bbae4){return function(_0x522a79){if(_0x522a79){return _0x522a79['destroy']()['then'](function(){var _0x2cabff=_0x522a79[_0x75c8('0x26')]({'plain':!![]});var _0x416e64=_0x75c8('0x27');return db[_0x75c8('0x28')][_0x75c8('0x29')]({'where':{'type':_0x416e64,'resourceId':_0x2cabff['id']}})[_0x75c8('0x25')](function(){return _0x522a79;});})[_0x75c8('0x25')](function(){_0x51ccd0[_0x75c8('0x1a')](0xcc)[_0x75c8('0x1b')]();});}};}function handleEntityNotFound(_0xd6cf59,_0x9fd700){return function(_0x3cfcae){if(!_0x3cfcae){_0xd6cf59[_0x75c8('0x19')](0x194);}return _0x3cfcae;};}function handleError(_0x222d33,_0x1511aa){_0x1511aa=_0x1511aa||0x1f4;return function(_0x7cfdbb){logger[_0x75c8('0x2a')](_0x7cfdbb[_0x75c8('0x2b')]);if(_0x7cfdbb[_0x75c8('0x2c')]){delete _0x7cfdbb[_0x75c8('0x2c')];}_0x222d33['status'](_0x1511aa)[_0x75c8('0x2d')](_0x7cfdbb);};}exports[_0x75c8('0x2e')]=function(_0x92db8a,_0xc92df5){var _0x2fe868={},_0x59ca1b={},_0x1efc87={'count':0x0,'rows':[]};var _0x115372=db[_0x75c8('0x2f')]['rawAttributes'];_0x59ca1b[_0x75c8('0x30')]=_[_0x75c8('0x31')](_0x115372);_0x59ca1b[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x92db8a[_0x75c8('0x32')]);_0x59ca1b[_0x75c8('0x33')]=_['intersection'](_0x59ca1b['model'],_0x59ca1b[_0x75c8('0x32')]);_0x2fe868[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x59ca1b[_0x75c8('0x30')],qs[_0x75c8('0x36')](_0x92db8a['query'][_0x75c8('0x36')]));_0x2fe868[_0x75c8('0x34')]=_0x2fe868['attributes'][_0x75c8('0x37')]?_0x2fe868[_0x75c8('0x34')]:_0x59ca1b['model'];if(!_0x92db8a[_0x75c8('0x32')][_0x75c8('0x38')]('nolimit')){_0x2fe868['limit']=qs['limit'](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x39')]);_0x2fe868[_0x75c8('0x1e')]=qs['offset'](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x1e')]);}_0x2fe868[_0x75c8('0x3a')]=qs[_0x75c8('0x3b')](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x3b')]);_0x2fe868[_0x75c8('0x3c')]=qs[_0x75c8('0x33')](_['pick'](_0x92db8a[_0x75c8('0x32')],_0x59ca1b['filters']));if(_0x92db8a[_0x75c8('0x32')][_0x75c8('0x3d')]){_0x2fe868[_0x75c8('0x3c')]=_[_0x75c8('0x3e')](_0x2fe868[_0x75c8('0x3c')],{'$or':_[_0x75c8('0x3f')](_0x115372,function(_0x4d1e26){if(_0x4d1e26[_0x75c8('0x40')][_0x75c8('0x41')]!==_0x75c8('0x42')){var _0x2ccf08={};_0x2ccf08[_0x4d1e26[_0x75c8('0x43')]]={'$like':'%'+_0x92db8a['query'][_0x75c8('0x3d')]+'%'};return _0x2ccf08;}})});}_0x2fe868=_['merge']({},_0x2fe868,_0x92db8a[_0x75c8('0x44')]);var _0x523e09={'where':_0x2fe868[_0x75c8('0x3c')]};return db[_0x75c8('0x2f')]['count'](_0x523e09)[_0x75c8('0x25')](function(_0x130796){_0x1efc87[_0x75c8('0x1d')]=_0x130796;if(_0x92db8a[_0x75c8('0x32')][_0x75c8('0x45')]){_0x2fe868[_0x75c8('0x46')]=[{'all':!![]}];}return db[_0x75c8('0x2f')][_0x75c8('0x47')](_0x2fe868);})[_0x75c8('0x25')](function(_0x46cd36){_0x1efc87[_0x75c8('0x48')]=_0x46cd36;return _0x1efc87;})[_0x75c8('0x25')](respondWithFilteredResult(_0xc92df5,_0x2fe868))[_0x75c8('0x49')](handleError(_0xc92df5,null));};exports['show']=function(_0x50f7b1,_0x309ae){var _0x15e139={'raw':![],'where':{'id':_0x50f7b1[_0x75c8('0x4a')]['id']}},_0x5beda0={};_0x5beda0['model']=_['keys'](db['VoiceMusicOnHold'][_0x75c8('0x4b')]);_0x5beda0[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x50f7b1[_0x75c8('0x32')]);_0x5beda0['filters']=_[_0x75c8('0x35')](_0x5beda0['model'],_0x5beda0[_0x75c8('0x32')]);_0x15e139[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x5beda0[_0x75c8('0x30')],qs['fields'](_0x50f7b1['query'][_0x75c8('0x36')]));_0x15e139['attributes']=_0x15e139[_0x75c8('0x34')][_0x75c8('0x37')]?_0x15e139[_0x75c8('0x34')]:_0x5beda0['model'];if(_0x50f7b1[_0x75c8('0x32')][_0x75c8('0x45')]){_0x15e139['include']=[{'all':!![]}];}_0x15e139=_[_0x75c8('0x3e')]({},_0x15e139,_0x50f7b1['options']);return db[_0x75c8('0x2f')][_0x75c8('0x4c')](_0x15e139)['then'](handleEntityNotFound(_0x309ae,null))[_0x75c8('0x25')](respondWithResult(_0x309ae,null))[_0x75c8('0x49')](handleError(_0x309ae,null));};exports[_0x75c8('0x24')]=function(_0xd886a8,_0x686953){if(_0xd886a8[_0x75c8('0x4d')]['id']){delete _0xd886a8[_0x75c8('0x4d')]['id'];}return db[_0x75c8('0x2f')][_0x75c8('0x4c')]({'where':{'id':_0xd886a8[_0x75c8('0x4a')]['id']}})[_0x75c8('0x25')](handleEntityNotFound(_0x686953,null))[_0x75c8('0x25')](saveUpdates(_0xd886a8[_0x75c8('0x4d')],null))[_0x75c8('0x25')](respondWithResult(_0x686953,null))['catch'](handleError(_0x686953,null));};exports['create']=function(_0x4267e2,_0x2eee3f,_0x2e5e3d){return db[_0x75c8('0x4e')]['transaction'](function(_0x169e72){if(_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x4f')]===_0x75c8('0x50')){_0x4267e2[_0x75c8('0x4d')]['directory']=path[_0x75c8('0x51')](config[_0x75c8('0x52')],_0x75c8('0x53'),_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x2c')]);}return db[_0x75c8('0x2f')]['create'](_0x4267e2[_0x75c8('0x4d')],{'transaction':_0x169e72})[_0x75c8('0x25')](function(_0x29bb85){if(_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x4f')]===_0x75c8('0x50')){fs[_0x75c8('0x54')](_0x29bb85[_0x75c8('0x55')],parseInt('0777',0x8));}var _0x2c1a34=_0x4267e2['user'][_0x75c8('0x26')]({'plain':!![]});if(!_0x2c1a34)throw new Error(_0x75c8('0x56'));if(_0x2c1a34[_0x75c8('0x57')]===_0x75c8('0x58')){var _0x4c2126=_0x29bb85[_0x75c8('0x26')]({'plain':!![]});return db[_0x75c8('0x59')][_0x75c8('0x4c')]({'where':{'name':_0x75c8('0x27'),'userProfileId':_0x2c1a34[_0x75c8('0x5a')]},'raw':!![]})[_0x75c8('0x25')](function(_0xb2d5b7){if(_0xb2d5b7&&_0xb2d5b7['autoAssociation']===0x0){return db[_0x75c8('0x28')]['create']({'name':_0x4c2126[_0x75c8('0x2c')],'resourceId':_0x4c2126['id'],'type':_0xb2d5b7[_0x75c8('0x2c')],'sectionId':_0xb2d5b7['id']},{})[_0x75c8('0x25')](function(){return _0x29bb85;});}else{return _0x29bb85;}})[_0x75c8('0x49')](function(_0x160169){logger[_0x75c8('0x2a')](_0x75c8('0x5b'),_0x160169);});}return _0x29bb85;});})[_0x75c8('0x25')](respondWithResult(_0x2eee3f,0xc9))[_0x75c8('0x49')](handleError(_0x2eee3f,null));};exports['destroy']=function(_0x78ec3d,_0x39b2fc,_0x4020b6){var _0x3abb0a;return db[_0x75c8('0x2f')]['find']({'where':{'id':_0x78ec3d[_0x75c8('0x4a')]['id']}})['then'](function(_0x2be9ff){if(_0x2be9ff){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0xb3e4b1){return _0x2be9ff['destroy']({'transaction':_0xb3e4b1,'raw':!![]})[_0x75c8('0x25')](function(_0xdb60ff){if(_0xdb60ff['directory']){fs[_0x75c8('0x5d')](_0xdb60ff[_0x75c8('0x55')])[_0x75c8('0x5e')](function(_0x71be4){fs['unlinkSync'](path[_0x75c8('0x51')](_0xdb60ff[_0x75c8('0x55')],_0x71be4));});fs[_0x75c8('0x5f')](_0xdb60ff['directory']);}return _0xdb60ff;});})['catch'](function(_0x53327a){throw new db['Sequelize'][(_0x75c8('0x60'))](_0x53327a[_0x75c8('0x61')]);});}})[_0x75c8('0x25')](handleEntityNotFound(_0x39b2fc,null))['then'](removeEntity(_0x39b2fc,null))[_0x75c8('0x49')](handleError(_0x39b2fc,null));};exports[_0x75c8('0x62')]=function(_0x1098aa,_0xddf9f,_0x4b2df8){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0x37836c){var _0x56ec02;return db[_0x75c8('0x2f')][_0x75c8('0x4c')]({'where':{'id':_0x1098aa['params']['id']}})[_0x75c8('0x25')](function(_0x2e35f4){if(_0x2e35f4){_0x56ec02=_0x2e35f4;return _0x2e35f4['addSound'](_0x1098aa[_0x75c8('0x4d')]['id'],{'transaction':_0x37836c});}})[_0x75c8('0x25')](function(_0x5d70b1){if(_0x5d70b1){return db[_0x75c8('0x63')][_0x75c8('0x64')]({'where':{'id':_0x1098aa[_0x75c8('0x4d')]['id']},'attributes':['id','name',_0x75c8('0x65'),_0x75c8('0x66'),_0x75c8('0x67')],'raw':!![]});}})[_0x75c8('0x25')](function(_0x581281){if(_0x581281){var _0x5999c4=path[_0x75c8('0x51')](config['root'],_0x75c8('0x68'),util['format'](_0x75c8('0x69'),path['basename'](_0x581281[_0x75c8('0x65')],path[_0x75c8('0x6a')](_0x581281[_0x75c8('0x65')])),_0x581281[_0x75c8('0x66')]));var _0x2cc3c1=path['join'](config['root'],_0x75c8('0x53'),_0x56ec02['name'],util[_0x75c8('0x6b')](_0x75c8('0x69'),_0x581281[_0x75c8('0x2c')],_0x581281[_0x75c8('0x66')]));fs[_0x75c8('0x6c')](_0x5999c4,_0x2cc3c1);return _0x581281;}})[_0x75c8('0x49')](function(_0x46b059){throw new db[(_0x75c8('0x6d'))]['ValidationError'](_0x46b059[_0x75c8('0x61')]);});})[_0x75c8('0x25')](handleEntityNotFound(_0xddf9f,null))[_0x75c8('0x25')](respondWithResult(_0xddf9f,0xc9))[_0x75c8('0x49')](handleError(_0xddf9f,null));};exports[_0x75c8('0x6e')]=function(_0x204fe5,_0x3696b8,_0xb583){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0x194b26){var _0x110d28;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x204fe5[_0x75c8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3696b8,null))['then'](function(_0x56833c){if(_0x56833c){_0x110d28=_0x56833c;return _0x56833c['removeSound'](_0x204fe5[_0x75c8('0x4a')]['id2']);}})[_0x75c8('0x25')](function(_0x119774){if(_0x119774){return db[_0x75c8('0x63')][_0x75c8('0x64')]({'where':{'id':_0x204fe5[_0x75c8('0x4a')][_0x75c8('0x6f')]},'attributes':['id','name',_0x75c8('0x65'),'converted_format',_0x75c8('0x67')],'raw':!![]});}})['then'](function(_0x1456c8){if(_0x1456c8){fs['unlinkSync'](path[_0x75c8('0x51')](_0x110d28['directory'],util[_0x75c8('0x6b')](_0x75c8('0x69'),_0x1456c8[_0x75c8('0x2c')],_0x1456c8[_0x75c8('0x66')])));return _0x1456c8;}})['catch'](function(_0x107d9a){throw new db['Sequelize'][(_0x75c8('0x60'))](_0x107d9a[_0x75c8('0x61')]);});})['then'](handleEntityNotFound(_0x3696b8,null))[_0x75c8('0x25')](respondWithStatusCode(_0x3696b8,0xcc))['catch'](handleError(_0x3696b8,null));};exports['getSounds']=function(_0x1365bd,_0xe94579,_0x460172){var _0x391c8a={};var _0x232df3={};var _0x1e523;var _0x5f2e0f;return db[_0x75c8('0x2f')][_0x75c8('0x64')]({'where':{'id':_0x1365bd[_0x75c8('0x4a')]['id']}})[_0x75c8('0x25')](handleEntityNotFound(_0xe94579,null))['then'](function(_0x22e257){if(_0x22e257){_0x1e523=_0x22e257;_0x232df3[_0x75c8('0x30')]=_[_0x75c8('0x31')](db[_0x75c8('0x63')][_0x75c8('0x4b')]);_0x232df3[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x1365bd[_0x75c8('0x32')]);_0x232df3[_0x75c8('0x33')]=_[_0x75c8('0x35')](_0x232df3[_0x75c8('0x30')],_0x232df3[_0x75c8('0x32')]);_0x391c8a[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x232df3['model'],qs[_0x75c8('0x36')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x36')]));_0x391c8a['attributes']=_0x391c8a[_0x75c8('0x34')][_0x75c8('0x37')]?_0x391c8a['attributes']:_0x232df3[_0x75c8('0x30')];_0x391c8a[_0x75c8('0x3a')]=qs[_0x75c8('0x3b')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3b')]);_0x391c8a[_0x75c8('0x3c')]=qs[_0x75c8('0x33')](_[_0x75c8('0x70')](_0x1365bd[_0x75c8('0x32')],_0x232df3[_0x75c8('0x33')]));if(_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3d')]){_0x391c8a[_0x75c8('0x3c')]=_['merge'](_0x391c8a[_0x75c8('0x3c')],{'$or':_[_0x75c8('0x3f')](_0x391c8a[_0x75c8('0x34')],function(_0x2636c6){var _0x4d4426={};_0x4d4426[_0x2636c6]={'$like':'%'+_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3d')]+'%'};return _0x4d4426;})});}_0x391c8a=_[_0x75c8('0x3e')]({},_0x391c8a,_0x1365bd[_0x75c8('0x44')]);return _0x1e523[_0x75c8('0x71')](_0x391c8a);}})[_0x75c8('0x25')](function(_0x242dd7){if(_0x242dd7){_0x5f2e0f=_0x242dd7[_0x75c8('0x37')];if(!_0x1365bd[_0x75c8('0x32')][_0x75c8('0x38')](_0x75c8('0x72'))){_0x391c8a[_0x75c8('0x39')]=qs[_0x75c8('0x39')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x39')]);_0x391c8a[_0x75c8('0x1e')]=qs[_0x75c8('0x1e')](_0x1365bd['query']['offset']);}return _0x1e523[_0x75c8('0x71')](_0x391c8a);}})[_0x75c8('0x25')](function(_0x4bd98f){if(_0x4bd98f){return _0x4bd98f?{'count':_0x5f2e0f,'rows':_0x4bd98f}:null;}})[_0x75c8('0x25')](respondWithResult(_0xe94579,null))[_0x75c8('0x49')](handleError(_0xe94579,null));}; \ No newline at end of file +var _0x385c=['rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','catch','show','find','body','params','sequelize','transaction','files','directory','join','root','server/files/moh','create','mode','mkdirSync','user','MusicOnHolds','autoAssociation','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','Sound','converted_format','createdAt','format','%s.%s','save_name','symlinkSync','removeSound','findOne','id2','getSounds','sort','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','index','VoiceMusicOnHold'];(function(_0x2d7125,_0x595e62){var _0x14ce33=function(_0x113ca0){while(--_0x113ca0){_0x2d7125['push'](_0x2d7125['shift']());}};_0x14ce33(++_0x595e62);}(_0x385c,0xa1));var _0xc385=function(_0x24f33f,_0x41f78d){_0x24f33f=_0x24f33f-0x0;var _0xd91e63=_0x385c[_0x24f33f];return _0xd91e63;};'use strict';var pdf=require(_0xc385('0x0'));var emlformat=require(_0xc385('0x1'));var rimraf=require(_0xc385('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc385('0x3'));var rp=require(_0xc385('0x4'));var moment=require(_0xc385('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc385('0x6'));var util=require(_0xc385('0x7'));var path=require('path');var sox=require(_0xc385('0x8'));var csv=require(_0xc385('0x9'));var ejs=require(_0xc385('0xa'));var fs=require('fs');var _=require(_0xc385('0xb'));var squel=require(_0xc385('0xc'));var crypto=require('crypto');var jsforce=require(_0xc385('0xd'));var deskjs=require(_0xc385('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc385('0xf'));var Redis=require(_0xc385('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc385('0x11'));var hardwareService=require(_0xc385('0x12'));var logger=require('../../config/logger')(_0xc385('0x13'));var utils=require(_0xc385('0x14'));var config=require('../../config/environment');var db=require(_0xc385('0x15'))['db'];function respondWithStatusCode(_0x2f5628,_0x5aedc6){_0x5aedc6=_0x5aedc6||0xcc;return function(_0x2afe27){if(_0x2afe27){return _0x2f5628[_0xc385('0x16')](_0x5aedc6);}return _0x2f5628['status'](_0x5aedc6)[_0xc385('0x17')]();};}function respondWithResult(_0x45a1ad,_0x386df5){_0x386df5=_0x386df5||0xc8;return function(_0x4a9603){if(_0x4a9603){return _0x45a1ad['status'](_0x386df5)[_0xc385('0x18')](_0x4a9603);}};}function respondWithFilteredResult(_0x22f356,_0x2d7c61){return function(_0xe9c466){if(_0xe9c466){var _0x26dd74=_0xe9c466['count'],_0x5e15c5=_0x2d7c61[_0xc385('0x19')],_0x480d94=_0x2d7c61[_0xc385('0x19')]+_0x2d7c61[_0xc385('0x1a')],_0x139acb;if(_0x480d94>=_0x26dd74){_0x480d94=_0x26dd74;_0x139acb=0xc8;}else{_0x139acb=0xce;}_0x22f356[_0xc385('0x1b')](_0x139acb);return _0x22f356[_0xc385('0x1c')](_0xc385('0x1d'),_0x5e15c5+'-'+_0x480d94+'/'+_0x26dd74)[_0xc385('0x18')](_0xe9c466);}return null;};}function patchUpdates(_0x45c160){return function(_0x530058){try{jsonpatch[_0xc385('0x1e')](_0x530058,_0x45c160,!![]);}catch(_0xd1a295){return BPromise[_0xc385('0x1f')](_0xd1a295);}return _0x530058[_0xc385('0x20')]();};}function saveUpdates(_0x5dd1ef,_0x1248db){return function(_0x53eeb1){if(_0x53eeb1){return _0x53eeb1[_0xc385('0x21')](_0x5dd1ef)['then'](function(_0x8a3bc5){return _0x8a3bc5;});}return null;};}function removeEntity(_0x5c51b1,_0x551af4){return function(_0x1c69db){if(_0x1c69db){return _0x1c69db[_0xc385('0x22')]()[_0xc385('0x23')](function(){var _0x48ff96=_0x1c69db[_0xc385('0x24')]({'plain':!![]});var _0x16e965='MusicOnHolds';return db[_0xc385('0x25')][_0xc385('0x22')]({'where':{'type':_0x16e965,'resourceId':_0x48ff96['id']}})[_0xc385('0x23')](function(){return _0x1c69db;});})[_0xc385('0x23')](function(){_0x5c51b1[_0xc385('0x1b')](0xcc)[_0xc385('0x17')]();});}};}function handleEntityNotFound(_0x50309d,_0x45b48e){return function(_0x5aeb3c){if(!_0x5aeb3c){_0x50309d['sendStatus'](0x194);}return _0x5aeb3c;};}function handleError(_0x15019d,_0x130032){_0x130032=_0x130032||0x1f4;return function(_0x40a121){logger[_0xc385('0x26')](_0x40a121['stack']);if(_0x40a121[_0xc385('0x27')]){delete _0x40a121['name'];}_0x15019d[_0xc385('0x1b')](_0x130032)[_0xc385('0x28')](_0x40a121);};}exports[_0xc385('0x29')]=function(_0x23046e,_0x26fbce){var _0x5a4393={},_0x5eedf6={},_0x485381={'count':0x0,'rows':[]};var _0x2584bb=db[_0xc385('0x2a')][_0xc385('0x2b')];_0x5eedf6[_0xc385('0x2c')]=_[_0xc385('0x2d')](_0x2584bb);_0x5eedf6[_0xc385('0x2e')]=_['keys'](_0x23046e[_0xc385('0x2e')]);_0x5eedf6[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x5eedf6[_0xc385('0x2c')],_0x5eedf6[_0xc385('0x2e')]);_0x5a4393['attributes']=_[_0xc385('0x30')](_0x5eedf6[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x23046e[_0xc385('0x2e')][_0xc385('0x31')]));_0x5a4393[_0xc385('0x32')]=_0x5a4393[_0xc385('0x32')][_0xc385('0x33')]?_0x5a4393[_0xc385('0x32')]:_0x5eedf6[_0xc385('0x2c')];if(!_0x23046e['query'][_0xc385('0x34')]('nolimit')){_0x5a4393['limit']=qs[_0xc385('0x1a')](_0x23046e[_0xc385('0x2e')]['limit']);_0x5a4393[_0xc385('0x19')]=qs[_0xc385('0x19')](_0x23046e['query'][_0xc385('0x19')]);}_0x5a4393['order']=qs['sort'](_0x23046e[_0xc385('0x2e')]['sort']);_0x5a4393['where']=qs[_0xc385('0x2f')](_[_0xc385('0x35')](_0x23046e[_0xc385('0x2e')],_0x5eedf6['filters']));if(_0x23046e[_0xc385('0x2e')][_0xc385('0x36')]){_0x5a4393['where']=_[_0xc385('0x37')](_0x5a4393['where'],{'$or':_[_0xc385('0x38')](_0x2584bb,function(_0x47aab5){if(_0x47aab5[_0xc385('0x39')][_0xc385('0x3a')]!==_0xc385('0x3b')){var _0x1af4e9={};_0x1af4e9[_0x47aab5[_0xc385('0x3c')]]={'$like':'%'+_0x23046e[_0xc385('0x2e')][_0xc385('0x36')]+'%'};return _0x1af4e9;}})});}_0x5a4393=_[_0xc385('0x37')]({},_0x5a4393,_0x23046e[_0xc385('0x3d')]);var _0x2144f2={'where':_0x5a4393['where']};return db['VoiceMusicOnHold'][_0xc385('0x3e')](_0x2144f2)[_0xc385('0x23')](function(_0x2f360e){_0x485381[_0xc385('0x3e')]=_0x2f360e;if(_0x23046e[_0xc385('0x2e')][_0xc385('0x3f')]){_0x5a4393['include']=[{'all':!![]}];}return db[_0xc385('0x2a')][_0xc385('0x40')](_0x5a4393);})['then'](function(_0xbd8f27){_0x485381['rows']=_0xbd8f27;return _0x485381;})[_0xc385('0x23')](respondWithFilteredResult(_0x26fbce,_0x5a4393))[_0xc385('0x41')](handleError(_0x26fbce,null));};exports[_0xc385('0x42')]=function(_0x384d2a,_0x4e5ae7){var _0x3ecac0={'raw':![],'where':{'id':_0x384d2a['params']['id']}},_0x559fca={};_0x559fca[_0xc385('0x2c')]=_[_0xc385('0x2d')](db[_0xc385('0x2a')][_0xc385('0x2b')]);_0x559fca[_0xc385('0x2e')]=_['keys'](_0x384d2a[_0xc385('0x2e')]);_0x559fca['filters']=_['intersection'](_0x559fca[_0xc385('0x2c')],_0x559fca[_0xc385('0x2e')]);_0x3ecac0[_0xc385('0x32')]=_[_0xc385('0x30')](_0x559fca[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x384d2a[_0xc385('0x2e')][_0xc385('0x31')]));_0x3ecac0[_0xc385('0x32')]=_0x3ecac0[_0xc385('0x32')][_0xc385('0x33')]?_0x3ecac0[_0xc385('0x32')]:_0x559fca[_0xc385('0x2c')];if(_0x384d2a[_0xc385('0x2e')]['includeAll']){_0x3ecac0['include']=[{'all':!![]}];}_0x3ecac0=_['merge']({},_0x3ecac0,_0x384d2a[_0xc385('0x3d')]);return db[_0xc385('0x2a')][_0xc385('0x43')](_0x3ecac0)[_0xc385('0x23')](handleEntityNotFound(_0x4e5ae7,null))[_0xc385('0x23')](respondWithResult(_0x4e5ae7,null))['catch'](handleError(_0x4e5ae7,null));};exports[_0xc385('0x21')]=function(_0x2f164f,_0x4955ea){if(_0x2f164f['body']['id']){delete _0x2f164f[_0xc385('0x44')]['id'];}return db[_0xc385('0x2a')]['find']({'where':{'id':_0x2f164f[_0xc385('0x45')]['id']}})['then'](handleEntityNotFound(_0x4955ea,null))[_0xc385('0x23')](saveUpdates(_0x2f164f[_0xc385('0x44')],null))['then'](respondWithResult(_0x4955ea,null))[_0xc385('0x41')](handleError(_0x4955ea,null));};exports['create']=function(_0x56db5e,_0x429d8e,_0x5ef535){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x44921f){if(_0x56db5e['body']['mode']===_0xc385('0x48')){_0x56db5e['body'][_0xc385('0x49')]=path[_0xc385('0x4a')](config[_0xc385('0x4b')],_0xc385('0x4c'),_0x56db5e['body'][_0xc385('0x27')]);}return db[_0xc385('0x2a')][_0xc385('0x4d')](_0x56db5e[_0xc385('0x44')],{'transaction':_0x44921f})[_0xc385('0x23')](function(_0x5a7bf2){if(_0x56db5e[_0xc385('0x44')][_0xc385('0x4e')]==='files'){fs[_0xc385('0x4f')](_0x5a7bf2[_0xc385('0x49')],parseInt('0777',0x8));}var _0x5d84c4=_0x56db5e[_0xc385('0x50')]['get']({'plain':!![]});if(!_0x5d84c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d84c4['role']===_0xc385('0x50')){var _0x5554e6=_0x5a7bf2['get']({'plain':!![]});return db['UserProfileSection'][_0xc385('0x43')]({'where':{'name':_0xc385('0x51'),'userProfileId':_0x5d84c4['userProfileId']},'raw':!![]})[_0xc385('0x23')](function(_0x5f6125){if(_0x5f6125&&_0x5f6125[_0xc385('0x52')]===0x0){return db[_0xc385('0x25')][_0xc385('0x4d')]({'name':_0x5554e6['name'],'resourceId':_0x5554e6['id'],'type':_0x5f6125[_0xc385('0x27')],'sectionId':_0x5f6125['id']},{})[_0xc385('0x23')](function(){return _0x5a7bf2;});}else{return _0x5a7bf2;}})[_0xc385('0x41')](function(_0x1fc40f){logger[_0xc385('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fc40f);});}return _0x5a7bf2;});})[_0xc385('0x23')](respondWithResult(_0x429d8e,0xc9))[_0xc385('0x41')](handleError(_0x429d8e,null));};exports['destroy']=function(_0x1d9b5b,_0x3282f5,_0x3589ee){var _0x3f605d;return db[_0xc385('0x2a')]['find']({'where':{'id':_0x1d9b5b[_0xc385('0x45')]['id']}})[_0xc385('0x23')](function(_0x4e9e07){if(_0x4e9e07){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x17fa82){return _0x4e9e07[_0xc385('0x22')]({'transaction':_0x17fa82,'raw':!![]})[_0xc385('0x23')](function(_0x2a4bb2){if(_0x2a4bb2['directory']){fs[_0xc385('0x53')](_0x2a4bb2['directory'])['forEach'](function(_0x58c7b7){fs[_0xc385('0x54')](path['join'](_0x2a4bb2[_0xc385('0x49')],_0x58c7b7));});fs[_0xc385('0x55')](_0x2a4bb2[_0xc385('0x49')]);}return _0x2a4bb2;});})[_0xc385('0x41')](function(_0x4eb458){throw new db[(_0xc385('0x56'))][(_0xc385('0x57'))](_0x4eb458[_0xc385('0x58')]);});}})[_0xc385('0x23')](handleEntityNotFound(_0x3282f5,null))[_0xc385('0x23')](removeEntity(_0x3282f5,null))['catch'](handleError(_0x3282f5,null));};exports['addSound']=function(_0x25245e,_0x26f6f5,_0x97a59a){return db[_0xc385('0x46')][_0xc385('0x47')](function(_0x1c7381){var _0x564f62;return db[_0xc385('0x2a')][_0xc385('0x43')]({'where':{'id':_0x25245e['params']['id']}})[_0xc385('0x23')](function(_0x208635){if(_0x208635){_0x564f62=_0x208635;return _0x208635['addSound'](_0x25245e[_0xc385('0x44')]['id'],{'transaction':_0x1c7381});}})[_0xc385('0x23')](function(_0x134b34){if(_0x134b34){return db[_0xc385('0x59')]['findOne']({'where':{'id':_0x25245e['body']['id']},'attributes':['id','name','save_name',_0xc385('0x5a'),_0xc385('0x5b')],'raw':!![]});}})['then'](function(_0x330796){if(_0x330796){var _0x1e7260=path[_0xc385('0x4a')](config['root'],'server/files/sounds/converted',util[_0xc385('0x5c')](_0xc385('0x5d'),path['basename'](_0x330796['save_name'],path['extname'](_0x330796[_0xc385('0x5e')])),_0x330796['converted_format']));var _0x3d1aef=path[_0xc385('0x4a')](config[_0xc385('0x4b')],_0xc385('0x4c'),_0x564f62[_0xc385('0x27')],util[_0xc385('0x5c')](_0xc385('0x5d'),_0x330796[_0xc385('0x27')],_0x330796[_0xc385('0x5a')]));fs[_0xc385('0x5f')](_0x1e7260,_0x3d1aef);return _0x330796;}})[_0xc385('0x41')](function(_0x52d102){throw new db[(_0xc385('0x56'))]['ValidationError'](_0x52d102['message']);});})['then'](handleEntityNotFound(_0x26f6f5,null))[_0xc385('0x23')](respondWithResult(_0x26f6f5,0xc9))['catch'](handleError(_0x26f6f5,null));};exports[_0xc385('0x60')]=function(_0x33bbdb,_0x230c54,_0x135091){return db['sequelize'][_0xc385('0x47')](function(_0x532c56){var _0x545249;return db[_0xc385('0x2a')][_0xc385('0x61')]({'where':{'id':_0x33bbdb['params']['id']}})[_0xc385('0x23')](handleEntityNotFound(_0x230c54,null))['then'](function(_0x4be8c1){if(_0x4be8c1){_0x545249=_0x4be8c1;return _0x4be8c1[_0xc385('0x60')](_0x33bbdb['params'][_0xc385('0x62')]);}})[_0xc385('0x23')](function(_0x2d255e){if(_0x2d255e){return db['Sound'][_0xc385('0x61')]({'where':{'id':_0x33bbdb[_0xc385('0x45')]['id2']},'attributes':['id',_0xc385('0x27'),_0xc385('0x5e'),'converted_format',_0xc385('0x5b')],'raw':!![]});}})[_0xc385('0x23')](function(_0x42635b){if(_0x42635b){fs[_0xc385('0x54')](path[_0xc385('0x4a')](_0x545249[_0xc385('0x49')],util['format'](_0xc385('0x5d'),_0x42635b[_0xc385('0x27')],_0x42635b[_0xc385('0x5a')])));return _0x42635b;}})[_0xc385('0x41')](function(_0x4879bb){throw new db['Sequelize']['ValidationError'](_0x4879bb['message']);});})[_0xc385('0x23')](handleEntityNotFound(_0x230c54,null))[_0xc385('0x23')](respondWithStatusCode(_0x230c54,0xcc))[_0xc385('0x41')](handleError(_0x230c54,null));};exports[_0xc385('0x63')]=function(_0x1fa2c9,_0x237298,_0x360afb){var _0x2efb7e={};var _0x2e057f={};var _0x5db4eb;var _0xf44f37;return db[_0xc385('0x2a')][_0xc385('0x61')]({'where':{'id':_0x1fa2c9[_0xc385('0x45')]['id']}})[_0xc385('0x23')](handleEntityNotFound(_0x237298,null))[_0xc385('0x23')](function(_0x335086){if(_0x335086){_0x5db4eb=_0x335086;_0x2e057f['model']=_['keys'](db[_0xc385('0x59')]['rawAttributes']);_0x2e057f[_0xc385('0x2e')]=_[_0xc385('0x2d')](_0x1fa2c9[_0xc385('0x2e')]);_0x2e057f[_0xc385('0x2f')]=_[_0xc385('0x30')](_0x2e057f['model'],_0x2e057f[_0xc385('0x2e')]);_0x2efb7e[_0xc385('0x32')]=_[_0xc385('0x30')](_0x2e057f[_0xc385('0x2c')],qs[_0xc385('0x31')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x31')]));_0x2efb7e[_0xc385('0x32')]=_0x2efb7e[_0xc385('0x32')][_0xc385('0x33')]?_0x2efb7e['attributes']:_0x2e057f['model'];_0x2efb7e['order']=qs[_0xc385('0x64')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x64')]);_0x2efb7e['where']=qs[_0xc385('0x2f')](_[_0xc385('0x35')](_0x1fa2c9['query'],_0x2e057f[_0xc385('0x2f')]));if(_0x1fa2c9['query'][_0xc385('0x36')]){_0x2efb7e['where']=_[_0xc385('0x37')](_0x2efb7e['where'],{'$or':_[_0xc385('0x38')](_0x2efb7e[_0xc385('0x32')],function(_0x16c81a){var _0x4b715b={};_0x4b715b[_0x16c81a]={'$like':'%'+_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x36')]+'%'};return _0x4b715b;})});}_0x2efb7e=_[_0xc385('0x37')]({},_0x2efb7e,_0x1fa2c9['options']);return _0x5db4eb[_0xc385('0x63')](_0x2efb7e);}})[_0xc385('0x23')](function(_0x5f2725){if(_0x5f2725){_0xf44f37=_0x5f2725[_0xc385('0x33')];if(!_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x34')](_0xc385('0x65'))){_0x2efb7e['limit']=qs[_0xc385('0x1a')](_0x1fa2c9[_0xc385('0x2e')][_0xc385('0x1a')]);_0x2efb7e[_0xc385('0x19')]=qs['offset'](_0x1fa2c9[_0xc385('0x2e')]['offset']);}return _0x5db4eb[_0xc385('0x63')](_0x2efb7e);}})[_0xc385('0x23')](function(_0x280db0){if(_0x280db0){return _0x280db0?{'count':_0xf44f37,'rows':_0x280db0}:null;}})[_0xc385('0x23')](respondWithResult(_0x237298,null))['catch'](handleError(_0x237298,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0482df2..32e3626 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 _0xd5e4=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util','../../config/logger','api','bluebird','request-promise'];(function(_0x59c348,_0x140d8f){var _0x544bb5=function(_0x468a62){while(--_0x468a62){_0x59c348['push'](_0x59c348['shift']());}};_0x544bb5(++_0x140d8f);}(_0xd5e4,0x193));var _0x4d5e=function(_0x63faf6,_0x593906){_0x63faf6=_0x63faf6-0x0;var _0x8dcb9c=_0xd5e4[_0x63faf6];return _0x8dcb9c;};'use strict';var _=require('lodash');var util=require(_0x4d5e('0x0'));var logger=require(_0x4d5e('0x1'))(_0x4d5e('0x2'));var moment=require('moment');var BPromise=require(_0x4d5e('0x3'));var rp=require(_0x4d5e('0x4'));var fs=require('fs');var path=require(_0x4d5e('0x5'));var rimraf=require(_0x4d5e('0x6'));var config=require(_0x4d5e('0x7'));var attributes=require(_0x4d5e('0x8'));module[_0x4d5e('0x9')]=function(_0x373929,_0x623b20){return _0x373929[_0x4d5e('0xa')](_0x4d5e('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0da0=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0da0,0x1ac));var _0x00da=function(_0x30e285,_0x3a5f8b){_0x30e285=_0x30e285-0x0;var _0x20c72a=_0x0da0[_0x30e285];return _0x20c72a;};'use strict';var _=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var logger=require(_0x00da('0x2'))(_0x00da('0x3'));var moment=require(_0x00da('0x4'));var BPromise=require(_0x00da('0x5'));var rp=require(_0x00da('0x6'));var fs=require('fs');var path=require(_0x00da('0x7'));var rimraf=require('rimraf');var config=require(_0x00da('0x8'));var attributes=require(_0x00da('0x9'));module[_0x00da('0xa')]=function(_0x40f367,_0x1da7ed){return _0x40f367['define'](_0x00da('0xb'),attributes,{'tableName':_0x00da('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 b52f699..a5c4899 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 _0x16a6=['message','catch','lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x11ef0d,_0x48d609){var _0x1800ec=function(_0x275eb6){while(--_0x275eb6){_0x11ef0d['push'](_0x11ef0d['shift']());}};_0x1800ec(++_0x48d609);}(_0x16a6,0x6e));var _0x616a=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x16a6[_0xd63e3a];return _0x19c178;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var moment=require(_0x616a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x616a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x616a('0x4'));var logger=require('../../config/logger')(_0x616a('0x5'));var config=require('../../config/environment');var jayson=require(_0x616a('0x6'));var client=jayson['client'][_0x616a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7e7331,_0x4e7afc,_0x33b0e9){return new BPromise(function(_0x3317de,_0x39d29c){return client[_0x616a('0x8')](_0x7e7331,_0x33b0e9)['then'](function(_0x100237){logger[_0x616a('0x9')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4e7afc,_0x616a('0xa'));logger['debug'](_0x616a('0xb'),_0x4e7afc,'request\x20sent',JSON[_0x616a('0xc')](_0x100237));if(_0x100237[_0x616a('0xd')]){if(_0x100237['error'][_0x616a('0xe')]===0x1f4){logger[_0x616a('0xd')](_0x616a('0xf'),_0x4e7afc,_0x100237[_0x616a('0xd')]['message']);return _0x39d29c(_0x100237[_0x616a('0xd')][_0x616a('0x10')]);}logger[_0x616a('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4e7afc,_0x100237[_0x616a('0xd')]['message']);return _0x3317de(_0x100237[_0x616a('0xd')][_0x616a('0x10')]);}else{logger[_0x616a('0x9')](_0x616a('0xf'),_0x4e7afc,_0x616a('0xa'));_0x3317de(_0x100237['result'][_0x616a('0x10')]);}})[_0x616a('0x11')](function(_0x57571c){logger[_0x616a('0xd')](_0x616a('0xf'),_0x4e7afc,_0x57571c);_0x39d29c(_0x57571c);});});} \ No newline at end of file +var _0x78cb=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3c03c5,_0x36e62e){var _0xd6c224=function(_0x124e0e){while(--_0x124e0e){_0x3c03c5['push'](_0x3c03c5['shift']());}};_0xd6c224(++_0x36e62e);}(_0x78cb,0x1d7));var _0xb78c=function(_0xad6ce9,_0x997b4b){_0xad6ce9=_0xad6ce9-0x0;var _0x1a34de=_0x78cb[_0xad6ce9];return _0x1a34de;};'use strict';var _=require(_0xb78c('0x0'));var util=require('util');var moment=require(_0xb78c('0x1'));var BPromise=require(_0xb78c('0x2'));var rs=require(_0xb78c('0x3'));var fs=require('fs');var Redis=require(_0xb78c('0x4'));var db=require(_0xb78c('0x5'))['db'];var utils=require(_0xb78c('0x6'));var logger=require(_0xb78c('0x7'))(_0xb78c('0x8'));var config=require(_0xb78c('0x9'));var jayson=require(_0xb78c('0xa'));var client=jayson[_0xb78c('0xb')][_0xb78c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x446cf6,_0x446463,_0x58eaec){return new BPromise(function(_0x3adf16,_0x2b18fb){return client[_0xb78c('0xd')](_0x446cf6,_0x58eaec)[_0xb78c('0xe')](function(_0x4517d6){logger[_0xb78c('0xf')](_0xb78c('0x10'),_0x446463,'request\x20sent');logger[_0xb78c('0x11')](_0xb78c('0x12'),_0x446463,_0xb78c('0x13'),JSON[_0xb78c('0x14')](_0x4517d6));if(_0x4517d6[_0xb78c('0x15')]){if(_0x4517d6[_0xb78c('0x15')][_0xb78c('0x16')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x4517d6[_0xb78c('0x15')]['message']);return _0x2b18fb(_0x4517d6[_0xb78c('0x15')][_0xb78c('0x17')]);}logger[_0xb78c('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x4517d6[_0xb78c('0x15')][_0xb78c('0x17')]);return _0x3adf16(_0x4517d6['error']['message']);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0xb78c('0x13'));_0x3adf16(_0x4517d6[_0xb78c('0x18')][_0xb78c('0x17')]);}})[_0xb78c('0x19')](function(_0x1df03b){logger[_0xb78c('0x15')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x446463,_0x1df03b);_0x2b18fb(_0x1df03b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 859eac2..28e4274 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 _0x064b=['show','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe'];(function(_0x32873f,_0x9399b0){var _0x4cff00=function(_0x448889){while(--_0x448889){_0x32873f['push'](_0x32873f['shift']());}};_0x4cff00(++_0x9399b0);}(_0x064b,0xd9));var _0xb064=function(_0x55c124,_0x630c5d){_0x55c124=_0x55c124-0x0;var _0x4cdac6=_0x064b[_0x55c124];return _0x4cdac6;};'use strict';var multer=require(_0xb064('0x0'));var util=require(_0xb064('0x1'));var path=require(_0xb064('0x2'));var timeout=require(_0xb064('0x3'));var express=require('express');var router=express[_0xb064('0x4')]();var auth=require(_0xb064('0x5'));var interaction=require(_0xb064('0x6'));var config=require(_0xb064('0x7'));var controller=require(_0xb064('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb064('0x9')](_0xb064('0xa'),auth[_0xb064('0xb')](),controller[_0xb064('0xc')]);router['get']('/:id',auth[_0xb064('0xb')](),controller[_0xb064('0xd')]);router[_0xb064('0x9')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller[_0xb064('0xf')]);router[_0xb064('0x10')]('/',auth[_0xb064('0xb')](),controller[_0xb064('0x11')]);router[_0xb064('0x10')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller[_0xb064('0x12')]);router[_0xb064('0x13')](_0xb064('0x14'),auth['isAuthenticated'](),controller[_0xb064('0x15')]);router[_0xb064('0x16')](_0xb064('0x14'),auth[_0xb064('0xb')](),controller['destroy']);router[_0xb064('0x16')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x50a8=['get','isAuthenticated','index','/describe','/:id','show','/:id/users','post','create','update','delete','destroy','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x1fbeaf,_0x256fbd){var _0x13daa3=function(_0x295348){while(--_0x295348){_0x1fbeaf['push'](_0x1fbeaf['shift']());}};_0x13daa3(++_0x256fbd);}(_0x50a8,0x198));var _0x850a=function(_0x1194d1,_0x71821b){_0x1194d1=_0x1194d1-0x0;var _0x24c777=_0x50a8[_0x1194d1];return _0x24c777;};'use strict';var multer=require(_0x850a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x850a('0x1'));var router=express['Router']();var auth=require(_0x850a('0x2'));var interaction=require(_0x850a('0x3'));var config=require(_0x850a('0x4'));var controller=require(_0x850a('0x5'));router[_0x850a('0x6')]('/',auth[_0x850a('0x7')](),controller[_0x850a('0x8')]);router[_0x850a('0x6')](_0x850a('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x850a('0x6')](_0x850a('0xa'),auth[_0x850a('0x7')](),controller[_0x850a('0xb')]);router['get'](_0x850a('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x850a('0xd')]('/',auth[_0x850a('0x7')](),controller[_0x850a('0xe')]);router[_0x850a('0xd')](_0x850a('0xc'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x850a('0xa'),auth['isAuthenticated'](),controller[_0x850a('0xf')]);router[_0x850a('0x10')](_0x850a('0xa'),auth[_0x850a('0x7')](),controller[_0x850a('0x11')]);router['delete'](_0x850a('0xc'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index f81ea5b..4327747 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 _0x1b4f=['exports','STRING','name','VIRTUAL','system-','INTEGER','sequelize'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0x1b4f,0xd8));var _0xf1b4=function(_0x133173,_0x37cb55){_0x133173=_0x133173-0x0;var _0x2cf355=_0x1b4f[_0x133173];return _0x2cf355;};'use strict';var Sequelize=require(_0xf1b4('0x0'));module[_0xf1b4('0x1')]={'name':{'type':Sequelize[_0xf1b4('0x2')],'allowNull':![],'unique':_0xf1b4('0x3')},'prefix':{'type':Sequelize[_0xf1b4('0x4')],'get':function(_0x215e23){return _0xf1b4('0x5')+this['getDataValue'](_0xf1b4('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf1b4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf1b4('0x6')]}}; \ No newline at end of file +var _0x188d=['name','system-','getDataValue','STRING','INTEGER','sequelize','exports'];(function(_0x1fde72,_0x22eda2){var _0x6d633=function(_0x22775f){while(--_0x22775f){_0x1fde72['push'](_0x1fde72['shift']());}};_0x6d633(++_0x22eda2);}(_0x188d,0x140));var _0xd188=function(_0x24c39a,_0x48fc91){_0x24c39a=_0x24c39a-0x0;var _0x4c2fa6=_0x188d[_0x24c39a];return _0x4c2fa6;};'use strict';var Sequelize=require(_0xd188('0x0'));module[_0xd188('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd188('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x21894c){return _0xd188('0x3')+this[_0xd188('0x4')](_0xd188('0x2'))+'-';}},'description':{'type':Sequelize[_0xd188('0x5')]},'callerIdAll':{'type':Sequelize[_0xd188('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0xd188('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 0e71128..cb37cbf 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 _0x7fbe=['findOne','User','options','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','VoicePrefix','includeAll','include','findAll','params','catch','describe','sequelize','create','VoiceExtension','find','VoiceExtensionId','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','NoOp','Voice\x20Prefix','VoicePrefixId','map','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','addAgents','body','ids','omit','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x11eb54,_0x35c410){_0x11eb54=_0x11eb54-0x0;var _0x248fe0=_0x7fbe[_0x11eb54];return _0x248fe0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var hardwareService=require(_0xe7fb('0x13'));var logger=require(_0xe7fb('0x14'))(_0xe7fb('0x15'));var utils=require(_0xe7fb('0x16'));var config=require(_0xe7fb('0x17'));var db=require(_0xe7fb('0x18'))['db'];config[_0xe7fb('0x19')]=_[_0xe7fb('0x1a')](config[_0xe7fb('0x19')],{'host':_0xe7fb('0x1b'),'port':0x18eb});var socket=require(_0xe7fb('0x1c'))(new Redis(config[_0xe7fb('0x19')]));require(_0xe7fb('0x1d'))['register'](socket);function respondWithStatusCode(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xcc;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1e')](_0x2225e5);}return _0x278b75[_0xe7fb('0x1f')](_0x2225e5)['end']();};}function respondWithResult(_0xa76acf,_0x559129){_0x559129=_0x559129||0xc8;return function(_0x12fff6){if(_0x12fff6){return _0xa76acf[_0xe7fb('0x1f')](_0x559129)[_0xe7fb('0x20')](_0x12fff6);}};}function respondWithFilteredResult(_0x17e8a8,_0x562262){return function(_0x892b0f){if(_0x892b0f){var _0x5ebc87=_0x892b0f[_0xe7fb('0x21')],_0x293a47=_0x562262[_0xe7fb('0x22')],_0x546463=_0x562262[_0xe7fb('0x22')]+_0x562262['limit'],_0x1e77fd;if(_0x546463>=_0x5ebc87){_0x546463=_0x5ebc87;_0x1e77fd=0xc8;}else{_0x1e77fd=0xce;}_0x17e8a8[_0xe7fb('0x1f')](_0x1e77fd);return _0x17e8a8['set'](_0xe7fb('0x23'),_0x293a47+'-'+_0x546463+'/'+_0x5ebc87)['json'](_0x892b0f);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x24')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x25')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x26')](_0x4742bd)[_0xe7fb('0x27')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x28')]({'plain':!![]});var _0x2996ae='VoicePrefixes';return db[_0xe7fb('0x29')][_0xe7fb('0x2a')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x27')](function(){return _0x35e4db;});})[_0xe7fb('0x27')](function(){_0x5bea27[_0xe7fb('0x1f')](0xcc)[_0xe7fb('0x2b')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1e')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2c')](_0x4fd290[_0xe7fb('0x2d')]);if(_0x4fd290[_0xe7fb('0x2e')]){delete _0x4fd290[_0xe7fb('0x2e')];}_0x3bdee9[_0xe7fb('0x1f')](_0xead63)[_0xe7fb('0x2f')](_0x4fd290);};}exports[_0xe7fb('0x30')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=db['VoicePrefix'][_0xe7fb('0x31')];_0x1742f3['model']=_[_0xe7fb('0x32')](_0x547a04);_0x1742f3[_0xe7fb('0x33')]=_[_0xe7fb('0x32')](_0x3dd0be[_0xe7fb('0x33')]);_0x1742f3['filters']=_[_0xe7fb('0x34')](_0x1742f3[_0xe7fb('0x35')],_0x1742f3[_0xe7fb('0x33')]);_0x3d1fb5[_0xe7fb('0x36')]=_[_0xe7fb('0x34')](_0x1742f3['model'],qs[_0xe7fb('0x37')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0x3d1fb5[_0xe7fb('0x36')]=_0x3d1fb5[_0xe7fb('0x36')][_0xe7fb('0x38')]?_0x3d1fb5[_0xe7fb('0x36')]:_0x1742f3[_0xe7fb('0x35')];if(!_0x3dd0be[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x39'))){_0x3d1fb5[_0xe7fb('0x3a')]=qs[_0xe7fb('0x3a')](_0x3dd0be['query'][_0xe7fb('0x3a')]);_0x3d1fb5[_0xe7fb('0x22')]=qs[_0xe7fb('0x22')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x22')]);}_0x3d1fb5[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x3d1fb5[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x33')],_0x1742f3[_0xe7fb('0x3e')]));if(_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x3d1fb5[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x3d1fb5[_0xe7fb('0x3d')],{'$or':_['map'](_0x547a04,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x42')][_0xe7fb('0x43')]!==_0xe7fb('0x44')){var _0x50d952={};_0x50d952[_0x261ec5[_0xe7fb('0x45')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x50d952;}})});}_0x3d1fb5=_[_0xe7fb('0x41')]({},_0x3d1fb5,_0x3dd0be['options']);var _0x2f976f={'where':_0x3d1fb5[_0xe7fb('0x3d')]};return db[_0xe7fb('0x46')][_0xe7fb('0x21')](_0x2f976f)[_0xe7fb('0x27')](function(_0xb729fc){_0x29d1ca['count']=_0xb729fc;if(_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x47')]){_0x3d1fb5[_0xe7fb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xe7fb('0x49')](_0x3d1fb5);})[_0xe7fb('0x27')](function(_0x5d42ac){_0x29d1ca['rows']=_0x5d42ac;return _0x29d1ca;})['then'](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports['show']=function(_0x900d67,_0x957ca3){var _0xed62e9={'raw':![],'where':{'id':_0x900d67[_0xe7fb('0x4a')]['id']}},_0x492f0f={};_0x492f0f['model']=_[_0xe7fb('0x32')](db[_0xe7fb('0x46')]['rawAttributes']);_0x492f0f[_0xe7fb('0x33')]=_[_0xe7fb('0x32')](_0x900d67[_0xe7fb('0x33')]);_0x492f0f[_0xe7fb('0x3e')]=_['intersection'](_0x492f0f[_0xe7fb('0x35')],_0x492f0f[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x36')]=_['intersection'](_0x492f0f[_0xe7fb('0x35')],qs[_0xe7fb('0x37')](_0x900d67[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0xed62e9[_0xe7fb('0x36')]=_0xed62e9['attributes'][_0xe7fb('0x38')]?_0xed62e9['attributes']:_0x492f0f[_0xe7fb('0x35')];if(_0x900d67[_0xe7fb('0x33')][_0xe7fb('0x47')]){_0xed62e9[_0xe7fb('0x48')]=[{'all':!![]}];}_0xed62e9=_[_0xe7fb('0x41')]({},_0xed62e9,_0x900d67['options']);return db[_0xe7fb('0x46')]['find'](_0xed62e9)['then'](handleEntityNotFound(_0x957ca3,null))[_0xe7fb('0x27')](respondWithResult(_0x957ca3,null))[_0xe7fb('0x4b')](handleError(_0x957ca3,null));};exports[_0xe7fb('0x2a')]=function(_0x589555,_0x3d4b01){return db[_0xe7fb('0x46')]['find']({'where':{'id':_0x589555['params']['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x3d4b01,null))[_0xe7fb('0x27')](removeEntity(_0x3d4b01,null))[_0xe7fb('0x4b')](handleError(_0x3d4b01,null));};exports[_0xe7fb('0x4c')]=function(_0x2dc09c,_0x1f0533){return db[_0xe7fb('0x46')][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x1f0533,null))[_0xe7fb('0x4b')](handleError(_0x1f0533,null));};exports['create']=function(_0x1cb5d4,_0x102da9){var _0x5cedfb;return db[_0xe7fb('0x4d')]['transaction'](function(_0x239c56){return db['VoicePrefix'][_0xe7fb('0x4e')](_0x1cb5d4['body'],{'transaction':_0x239c56})[_0xe7fb('0x27')](function(_0x59158c){_0x5cedfb=_0x59158c[_0xe7fb('0x28')]({'plain':!![]});return db[_0xe7fb('0x4f')][_0xe7fb('0x50')]({'where':{'id':_0x5cedfb[_0xe7fb('0x51')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x2f959d){return createVoicePrefixExtensions(_0x5cedfb,_0x2f959d,_0x239c56);});});})[_0xe7fb('0x27')](function(){var _0x582a4a=_0x1cb5d4['user'][_0xe7fb('0x28')]({'plain':!![]});if(!_0x582a4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x582a4a['role']==='user'){var _0x50b8df=_0x5cedfb;return db['UserProfileSection'][_0xe7fb('0x50')]({'where':{'name':_0xe7fb('0x52'),'userProfileId':_0x582a4a[_0xe7fb('0x53')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x59c92d){if(_0x59c92d&&_0x59c92d[_0xe7fb('0x54')]===0x0){return db[_0xe7fb('0x29')][_0xe7fb('0x4e')]({'name':_0x50b8df['name'],'resourceId':_0x50b8df['id'],'type':_0x59c92d['name'],'sectionId':_0x59c92d['id']},{})[_0xe7fb('0x27')](function(){return _0x5cedfb;});}else{return _0x5cedfb;}})[_0xe7fb('0x4b')](function(_0x300b8e){logger['error'](_0xe7fb('0x55'),_0x300b8e);throw _0x300b8e;});}return _0x5cedfb;})[_0xe7fb('0x27')](respondWithResult(_0x102da9,null))[_0xe7fb('0x4b')](handleError(_0x102da9,null));};function Extension(_0x2a7e4d,_0x548cd4,_0x4b35f9,_0x2f620d){this[_0xe7fb('0x56')]=_0xe7fb('0x57');this[_0xe7fb('0x58')]=_0x2a7e4d;this[_0xe7fb('0x59')]=_0x4b35f9;this['type']=_0xe7fb('0x5a');this[_0xe7fb('0x5b')]=_0xe7fb('0x5c');this['priority']=_0x548cd4;this['appdata']=_0x2f620d;}function createVoicePrefixExtensions(_0x425bee,_0x3b69f7,_0x14fe1b){return new BPromise(function(_0x1c4035,_0x40f546){var _0x3385e2=new Extension(formatPrefixName(_0x425bee['prefix']),0x1,_0xe7fb('0x5d'),_0xe7fb('0x5e'));_0x3385e2[_0xe7fb('0x5f')]=_0x425bee['id'];return db[_0xe7fb('0x4f')][_0xe7fb('0x4e')](_0x3385e2,{'transaction':_0x14fe1b})[_0xe7fb('0x27')](function(_0x554092){var _0x2e457c=_0x554092['get']({'plain':!![]});var _0x1eda1d=_[_0xe7fb('0x60')](addVoicePrefixExtensions(_0x425bee,_0x3b69f7),function(_0x116c7e){_0x116c7e[_0xe7fb('0x51')]=_0x2e457c['id'];_0x116c7e['VoicePrefixId']=_0x425bee['id'];return _0x116c7e;});return db['VoiceExtension'][_0xe7fb('0x61')](_0x1eda1d,{'transaction':_0x14fe1b})[_0xe7fb('0x27')](function(_0x25aeb2){if(!_0x25aeb2){return _0x40f546(_0xe7fb('0x62'));}else{return _0x1c4035(_0x25aeb2);}})[_0xe7fb('0x4b')](function(_0x50dc34){return _0x40f546(_0x50dc34);});});;});};function addVoicePrefixExtensions(_0x4096d4,_0x58d4ec){var _0x127b0e=[];var _0x51ff25=formatPrefixName(_0x4096d4['prefix']);_0x127b0e[_0xe7fb('0x63')](new Extension(_0x51ff25,0x2,_0xe7fb('0x64'),_0xe7fb('0x65')+_0x4096d4['name']));if(_0x4096d4[_0xe7fb('0x66')]){_0x127b0e[_0xe7fb('0x63')](new Extension(_0x51ff25,0x3,_0xe7fb('0x64'),_0xe7fb('0x67')+_0x4096d4[_0xe7fb('0x66')]));}else{_0x127b0e['push'](new Extension(_0x51ff25,0x3,_0xe7fb('0x5d'),_0xe7fb('0x68')));}_0x127b0e['push'](new Extension(_0x51ff25,0x4,_0xe7fb('0x69'),_0x58d4ec[_0xe7fb('0x56')]+','+'${EXTEN:'+(0x8+_0x4096d4[_0xe7fb('0x2e')]['length'])+'}'+','+0x1));return _0x127b0e;}function formatPrefixName(_0x2705ef){var _0x1dc9c1='_';for(var _0xa93f35=0x0;_0xa93f35<_0x2705ef['length'];_0xa93f35++){if(_0x2705ef[_0xe7fb('0x6a')](_0xa93f35)=='-'){_0x1dc9c1+=_0x2705ef[_0xe7fb('0x6a')](_0xa93f35);}else{_0x1dc9c1+='['+_0x2705ef[_0xe7fb('0x6a')](_0xa93f35)+']';}}_0x1dc9c1+='.';return _0x1dc9c1;}exports[_0xe7fb('0x26')]=function(_0x35487f,_0x15ff86,_0xcdc72e){var _0x187040=_0x35487f['body'];_0x187040['prefix']=_0xe7fb('0x6b')+_0x187040[_0xe7fb('0x2e')]+'-';return db[_0xe7fb('0x4d')]['transaction'](function(_0x519c5f){return db[_0xe7fb('0x46')][_0xe7fb('0x26')](_0x187040,{'where':{'id':_0x187040['id']},'transaction':_0x519c5f})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x4f')][_0xe7fb('0x2a')]({'where':{'VoicePrefixId':_0x187040['id']},'transaction':_0x519c5f})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x4f')][_0xe7fb('0x50')]({'where':{'id':_0x187040[_0xe7fb('0x51')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x1ff5e7){return createVoicePrefixExtensions(_0x187040,_0x1ff5e7,_0x519c5f);});});});})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x46')]['findById'](_0x187040['id']);})['then'](respondWithResult(_0x15ff86,null))[_0xe7fb('0x4b')](handleError(_0x15ff86,null));};exports[_0xe7fb('0x6c')]=function(_0x178395,_0x16cd8f,_0x8dd368){return db['VoicePrefix'][_0xe7fb('0x50')]({'where':{'id':_0x178395[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x16cd8f,null))[_0xe7fb('0x27')](function(_0x16553c){if(_0x16553c){return _0x16553c[_0xe7fb('0x6c')](_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')],_[_0xe7fb('0x6f')](_0x178395['body'],[_0xe7fb('0x6e'),'id'])||{})['spread'](function(_0x279663){for(var _0x2f13f2=0x0;_0x2f13f2<_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')][_0xe7fb('0x38')];_0x2f13f2+=0x1){socket['emit'](_0xe7fb('0x70'),{'UserId':_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')][_0x2f13f2],'VoicePrefixId':_0x178395[_0xe7fb('0x4a')]['id']});}return _0x279663;});}})[_0xe7fb('0x27')](respondWithResult(_0x16cd8f,null))[_0xe7fb('0x4b')](handleError(_0x16cd8f,null));};exports[_0xe7fb('0x71')]=function(_0x17e640,_0x3d139f,_0x59731e){return db[_0xe7fb('0x46')][_0xe7fb('0x50')]({'where':{'id':_0x17e640[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x3d139f,null))['then'](function(_0x4b5f7e){if(_0x4b5f7e){return _0x4b5f7e['removeAgents'](_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')])[_0xe7fb('0x27')](function(){if(_[_0xe7fb('0x72')](_0x17e640['query'][_0xe7fb('0x6e')])){for(var _0x2d4c5e=0x0;_0x2d4c5e<_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')]['length'];_0x2d4c5e+=0x1){socket[_0xe7fb('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')][_0x2d4c5e]),'VoicePrefixId':Number(_0x17e640[_0xe7fb('0x4a')]['id'])});}}else{socket[_0xe7fb('0x73')](_0xe7fb('0x74'),{'UserId':Number(_0x17e640['query'][_0xe7fb('0x6e')]),'VoicePrefixId':Number(_0x17e640['params']['id'])});}});}})[_0xe7fb('0x27')](respondWithStatusCode(_0x3d139f,null))['catch'](handleError(_0x3d139f,null));};exports[_0xe7fb('0x75')]=function(_0x38f52c,_0x4c37cd,_0x2b6d69){var _0x31642f={};var _0xb19e94={};var _0x4181fd;var _0x58e344;return db[_0xe7fb('0x46')][_0xe7fb('0x76')]({'where':{'id':_0x38f52c[_0xe7fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c37cd,null))[_0xe7fb('0x27')](function(_0x4b2cc4){if(_0x4b2cc4){_0x4181fd=_0x4b2cc4;_0xb19e94['model']=_['keys'](db[_0xe7fb('0x77')][_0xe7fb('0x31')]);_0xb19e94['query']=_[_0xe7fb('0x32')](_0x38f52c[_0xe7fb('0x33')]);_0xb19e94[_0xe7fb('0x3e')]=_[_0xe7fb('0x34')](_0xb19e94[_0xe7fb('0x35')],_0xb19e94[_0xe7fb('0x33')]);_0x31642f[_0xe7fb('0x36')]=_[_0xe7fb('0x34')](_0xb19e94[_0xe7fb('0x35')],qs[_0xe7fb('0x37')](_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0x31642f[_0xe7fb('0x36')]=_0x31642f[_0xe7fb('0x36')][_0xe7fb('0x38')]?_0x31642f[_0xe7fb('0x36')]:_0xb19e94[_0xe7fb('0x35')];_0x31642f[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x38f52c[_0xe7fb('0x33')]['sort']);_0x31642f[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x38f52c[_0xe7fb('0x33')],_0xb19e94[_0xe7fb('0x3e')]));if(_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x31642f['where']=_['merge'](_0x31642f[_0xe7fb('0x3d')],{'$or':_['map'](_0x31642f[_0xe7fb('0x36')],function(_0x496205){var _0x4abac2={};_0x4abac2[_0x496205]={'$like':'%'+_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x4abac2;})});}_0x31642f=_[_0xe7fb('0x41')]({},_0x31642f,_0x38f52c[_0xe7fb('0x78')]);return _0x4181fd[_0xe7fb('0x75')](_0x31642f);}})[_0xe7fb('0x27')](function(_0x5be801){if(_0x5be801){_0x58e344=_0x5be801[_0xe7fb('0x38')];if(!_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x79')](_0xe7fb('0x39'))){_0x31642f[_0xe7fb('0x3a')]=qs[_0xe7fb('0x3a')](_0x38f52c['query']['limit']);_0x31642f['offset']=qs[_0xe7fb('0x22')](_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x22')]);}return _0x4181fd['getAgents'](_0x31642f);}})[_0xe7fb('0x27')](function(_0x57ee3b){if(_0x57ee3b){return _0x57ee3b?{'count':_0x58e344,'rows':_0x57ee3b}:null;}})[_0xe7fb('0x27')](respondWithResult(_0x4c37cd,null))[_0xe7fb('0x4b')](handleError(_0x4c37cd,null));}; \ No newline at end of file +var _0xe0ae=['VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','map','Extensions\x20creation\x20failed','CDR(prefix)=','callerIdAll','push','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','sequelize','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','end','error','stack','name','index','VoicePrefix','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','catch','params','options','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection'];(function(_0x50ac27,_0x1306e3){var _0x45f86a=function(_0x512a96){while(--_0x512a96){_0x50ac27['push'](_0x50ac27['shift']());}};_0x45f86a(++_0x1306e3);}(_0xe0ae,0xa1));var _0xee0a=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0xe0ae[_0x3238ea];return _0x4aaac2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee0a('0x0'));var zipdir=require(_0xee0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee0a('0x2'));var moment=require('moment');var BPromise=require(_0xee0a('0x3'));var Mustache=require(_0xee0a('0x4'));var util=require('util');var path=require(_0xee0a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee0a('0x6'));var fs=require('fs');var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xee0a('0xe'));var logger=require(_0xee0a('0xf'))('api');var utils=require(_0xee0a('0x10'));var config=require('../../config/environment');var db=require(_0xee0a('0x11'))['db'];config[_0xee0a('0x12')]=_['defaults'](config[_0xee0a('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0xee0a('0x13'))(new Redis(config[_0xee0a('0x12')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xcc;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a);}return _0x325a8e[_0xee0a('0x15')](_0x41b70a)['end']();};}function respondWithResult(_0xb891a9,_0xd39431){_0xd39431=_0xd39431||0xc8;return function(_0x50063f){if(_0x50063f){return _0xb891a9[_0xee0a('0x15')](_0xd39431)[_0xee0a('0x16')](_0x50063f);}};}function respondWithFilteredResult(_0x1bc8e1,_0x198b61){return function(_0x4f711b){if(_0x4f711b){var _0x3114b2=_0x4f711b[_0xee0a('0x17')],_0x1d7a8a=_0x198b61[_0xee0a('0x18')],_0x14ef67=_0x198b61[_0xee0a('0x18')]+_0x198b61[_0xee0a('0x19')],_0x55c474;if(_0x14ef67>=_0x3114b2){_0x14ef67=_0x3114b2;_0x55c474=0xc8;}else{_0x55c474=0xce;}_0x1bc8e1['status'](_0x55c474);return _0x1bc8e1[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x14ef67+'/'+_0x3114b2)[_0xee0a('0x16')](_0x4f711b);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){var _0x1fe1a3=_0x567810[_0xee0a('0x21')]({'plain':!![]});var _0x4c61e2='VoicePrefixes';return db['UserProfileResource'][_0xee0a('0x20')]({'where':{'type':_0x4c61e2,'resourceId':_0x1fe1a3['id']}})['then'](function(){return _0x567810;});})['then'](function(){_0x27989c[_0xee0a('0x15')](0xcc)[_0xee0a('0x22')]();});}};}function handleEntityNotFound(_0xe5365f,_0x50d415){return function(_0x3c3d48){if(!_0x3c3d48){_0xe5365f[_0xee0a('0x14')](0x194);}return _0x3c3d48;};}function handleError(_0x15b1c0,_0x30d1f1){_0x30d1f1=_0x30d1f1||0x1f4;return function(_0x2e7f18){logger[_0xee0a('0x23')](_0x2e7f18[_0xee0a('0x24')]);if(_0x2e7f18[_0xee0a('0x25')]){delete _0x2e7f18[_0xee0a('0x25')];}_0x15b1c0[_0xee0a('0x15')](_0x30d1f1)['send'](_0x2e7f18);};}exports[_0xee0a('0x26')]=function(_0x1a97e0,_0x284be5){var _0x34569c={},_0x45feeb={},_0x3faad3={'count':0x0,'rows':[]};var _0x4cf1df=db[_0xee0a('0x27')][_0xee0a('0x28')];_0x45feeb[_0xee0a('0x29')]=_[_0xee0a('0x2a')](_0x4cf1df);_0x45feeb['query']=_[_0xee0a('0x2a')](_0x1a97e0['query']);_0x45feeb[_0xee0a('0x2b')]=_[_0xee0a('0x2c')](_0x45feeb[_0xee0a('0x29')],_0x45feeb[_0xee0a('0x2d')]);_0x34569c[_0xee0a('0x2e')]=_[_0xee0a('0x2c')](_0x45feeb[_0xee0a('0x29')],qs[_0xee0a('0x2f')](_0x1a97e0['query'][_0xee0a('0x2f')]));_0x34569c[_0xee0a('0x2e')]=_0x34569c['attributes'][_0xee0a('0x30')]?_0x34569c[_0xee0a('0x2e')]:_0x45feeb[_0xee0a('0x29')];if(!_0x1a97e0['query'][_0xee0a('0x31')](_0xee0a('0x32'))){_0x34569c[_0xee0a('0x19')]=qs['limit'](_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x19')]);_0x34569c[_0xee0a('0x18')]=qs['offset'](_0x1a97e0['query'][_0xee0a('0x18')]);}_0x34569c[_0xee0a('0x33')]=qs[_0xee0a('0x34')](_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x34')]);_0x34569c[_0xee0a('0x35')]=qs[_0xee0a('0x2b')](_[_0xee0a('0x36')](_0x1a97e0[_0xee0a('0x2d')],_0x45feeb['filters']));if(_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x37')]){_0x34569c['where']=_[_0xee0a('0x38')](_0x34569c[_0xee0a('0x35')],{'$or':_['map'](_0x4cf1df,function(_0x2fdf87){if(_0x2fdf87[_0xee0a('0x39')][_0xee0a('0x3a')]!==_0xee0a('0x3b')){var _0x10f9ac={};_0x10f9ac[_0x2fdf87[_0xee0a('0x3c')]]={'$like':'%'+_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x37')]+'%'};return _0x10f9ac;}})});}_0x34569c=_[_0xee0a('0x38')]({},_0x34569c,_0x1a97e0['options']);var _0x429eca={'where':_0x34569c[_0xee0a('0x35')]};return db[_0xee0a('0x27')][_0xee0a('0x17')](_0x429eca)['then'](function(_0x4857ea){_0x3faad3[_0xee0a('0x17')]=_0x4857ea;if(_0x1a97e0[_0xee0a('0x2d')][_0xee0a('0x3d')]){_0x34569c[_0xee0a('0x3e')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3f')](_0x34569c);})[_0xee0a('0x1f')](function(_0x4c398c){_0x3faad3['rows']=_0x4c398c;return _0x3faad3;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x284be5,_0x34569c))[_0xee0a('0x40')](handleError(_0x284be5,null));};exports['show']=function(_0x3293b5,_0x9cd98d){var _0x5f2071={'raw':![],'where':{'id':_0x3293b5[_0xee0a('0x41')]['id']}},_0x140783={};_0x140783[_0xee0a('0x29')]=_[_0xee0a('0x2a')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x140783[_0xee0a('0x2d')]=_['keys'](_0x3293b5['query']);_0x140783[_0xee0a('0x2b')]=_['intersection'](_0x140783['model'],_0x140783['query']);_0x5f2071[_0xee0a('0x2e')]=_[_0xee0a('0x2c')](_0x140783['model'],qs['fields'](_0x3293b5['query']['fields']));_0x5f2071[_0xee0a('0x2e')]=_0x5f2071[_0xee0a('0x2e')][_0xee0a('0x30')]?_0x5f2071[_0xee0a('0x2e')]:_0x140783[_0xee0a('0x29')];if(_0x3293b5[_0xee0a('0x2d')]['includeAll']){_0x5f2071[_0xee0a('0x3e')]=[{'all':!![]}];}_0x5f2071=_['merge']({},_0x5f2071,_0x3293b5[_0xee0a('0x42')]);return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x5f2071)[_0xee0a('0x1f')](handleEntityNotFound(_0x9cd98d,null))['then'](respondWithResult(_0x9cd98d,null))[_0xee0a('0x40')](handleError(_0x9cd98d,null));};exports[_0xee0a('0x20')]=function(_0x290940,_0x12e47f){return db[_0xee0a('0x27')][_0xee0a('0x43')]({'where':{'id':_0x290940[_0xee0a('0x41')]['id']}})['then'](handleEntityNotFound(_0x12e47f,null))['then'](removeEntity(_0x12e47f,null))[_0xee0a('0x40')](handleError(_0x12e47f,null));};exports[_0xee0a('0x44')]=function(_0x1936c8,_0x4590b8){return db[_0xee0a('0x27')][_0xee0a('0x44')]()[_0xee0a('0x1f')](respondWithResult(_0x4590b8,null))[_0xee0a('0x40')](handleError(_0x4590b8,null));};exports[_0xee0a('0x45')]=function(_0x364766,_0x3fdd2e){var _0x335356;return db['sequelize'][_0xee0a('0x46')](function(_0x33fee4){return db[_0xee0a('0x27')][_0xee0a('0x45')](_0x364766[_0xee0a('0x47')],{'transaction':_0x33fee4})['then'](function(_0xc053b5){_0x335356=_0xc053b5[_0xee0a('0x21')]({'plain':!![]});return db[_0xee0a('0x48')][_0xee0a('0x43')]({'where':{'id':_0x335356[_0xee0a('0x49')]},'raw':!![]})['then'](function(_0x1cd43f){return createVoicePrefixExtensions(_0x335356,_0x1cd43f,_0x33fee4);});});})[_0xee0a('0x1f')](function(){var _0x176201=_0x364766[_0xee0a('0x4a')][_0xee0a('0x21')]({'plain':!![]});if(!_0x176201)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176201[_0xee0a('0x4b')]===_0xee0a('0x4a')){var _0x1dc00d=_0x335356;return db[_0xee0a('0x4c')][_0xee0a('0x43')]({'where':{'name':_0xee0a('0x4d'),'userProfileId':_0x176201[_0xee0a('0x4e')]},'raw':!![]})[_0xee0a('0x1f')](function(_0x407d00){if(_0x407d00&&_0x407d00[_0xee0a('0x4f')]===0x0){return db[_0xee0a('0x50')][_0xee0a('0x45')]({'name':_0x1dc00d[_0xee0a('0x25')],'resourceId':_0x1dc00d['id'],'type':_0x407d00[_0xee0a('0x25')],'sectionId':_0x407d00['id']},{})[_0xee0a('0x1f')](function(){return _0x335356;});}else{return _0x335356;}})[_0xee0a('0x40')](function(_0x3e4ed5){logger[_0xee0a('0x23')](_0xee0a('0x51'),_0x3e4ed5);throw _0x3e4ed5;});}return _0x335356;})[_0xee0a('0x1f')](respondWithResult(_0x3fdd2e,null))[_0xee0a('0x40')](handleError(_0x3fdd2e,null));};function Extension(_0x3abf82,_0x509c7e,_0x51b1a8,_0x59a52a){this[_0xee0a('0x52')]='from-sip';this[_0xee0a('0x53')]=_0x3abf82;this[_0xee0a('0x54')]=_0x51b1a8;this[_0xee0a('0x39')]=_0xee0a('0x55');this['description']=_0xee0a('0x56');this[_0xee0a('0x57')]=_0x509c7e;this[_0xee0a('0x58')]=_0x59a52a;}function createVoicePrefixExtensions(_0x1d6398,_0x301f69,_0x99e2b0){return new BPromise(function(_0xf576ea,_0x3c9456){var _0x101c8e=new Extension(formatPrefixName(_0x1d6398[_0xee0a('0x59')]),0x1,_0xee0a('0x5a'),_0xee0a('0x5b'));_0x101c8e[_0xee0a('0x5c')]=_0x1d6398['id'];return db[_0xee0a('0x48')]['create'](_0x101c8e,{'transaction':_0x99e2b0})[_0xee0a('0x1f')](function(_0x5cb68f){var _0x2dcfc5=_0x5cb68f[_0xee0a('0x21')]({'plain':!![]});var _0x4a5197=_[_0xee0a('0x5d')](addVoicePrefixExtensions(_0x1d6398,_0x301f69),function(_0x501baa){_0x501baa[_0xee0a('0x49')]=_0x2dcfc5['id'];_0x501baa['VoicePrefixId']=_0x1d6398['id'];return _0x501baa;});return db['VoiceExtension']['bulkCreate'](_0x4a5197,{'transaction':_0x99e2b0})[_0xee0a('0x1f')](function(_0x368e77){if(!_0x368e77){return _0x3c9456(_0xee0a('0x5e'));}else{return _0xf576ea(_0x368e77);}})[_0xee0a('0x40')](function(_0x14e1f1){return _0x3c9456(_0x14e1f1);});});;});};function addVoicePrefixExtensions(_0x45919b,_0x44ac69){var _0xe583e5=[];var _0x5c05dc=formatPrefixName(_0x45919b[_0xee0a('0x59')]);_0xe583e5['push'](new Extension(_0x5c05dc,0x2,'Set',_0xee0a('0x5f')+_0x45919b[_0xee0a('0x25')]));if(_0x45919b[_0xee0a('0x60')]){_0xe583e5[_0xee0a('0x61')](new Extension(_0x5c05dc,0x3,_0xee0a('0x62'),_0xee0a('0x63')+_0x45919b[_0xee0a('0x60')]));}else{_0xe583e5[_0xee0a('0x61')](new Extension(_0x5c05dc,0x3,'NoOp',_0xee0a('0x64')));}_0xe583e5['push'](new Extension(_0x5c05dc,0x4,_0xee0a('0x65'),_0x44ac69[_0xee0a('0x52')]+','+_0xee0a('0x66')+(0x8+_0x45919b[_0xee0a('0x25')][_0xee0a('0x30')])+'}'+','+0x1));return _0xe583e5;}function formatPrefixName(_0x2c7bba){var _0x56fcc8='_';for(var _0x25e37c=0x0;_0x25e37c<_0x2c7bba[_0xee0a('0x30')];_0x25e37c++){if(_0x2c7bba[_0xee0a('0x67')](_0x25e37c)=='-'){_0x56fcc8+=_0x2c7bba['charAt'](_0x25e37c);}else{_0x56fcc8+='['+_0x2c7bba[_0xee0a('0x67')](_0x25e37c)+']';}}_0x56fcc8+='.';return _0x56fcc8;}exports[_0xee0a('0x68')]=function(_0x4d5c5b,_0x46e0b1,_0x4b76b9){var _0x491ea3=_0x4d5c5b['body'];_0x491ea3['prefix']=_0xee0a('0x69')+_0x491ea3['name']+'-';return db[_0xee0a('0x6a')]['transaction'](function(_0x318c5a){return db[_0xee0a('0x27')][_0xee0a('0x68')](_0x491ea3,{'where':{'id':_0x491ea3['id']},'transaction':_0x318c5a})[_0xee0a('0x1f')](function(){return db['VoiceExtension'][_0xee0a('0x20')]({'where':{'VoicePrefixId':_0x491ea3['id']},'transaction':_0x318c5a})[_0xee0a('0x1f')](function(){return db[_0xee0a('0x48')][_0xee0a('0x43')]({'where':{'id':_0x491ea3[_0xee0a('0x49')]},'raw':!![]})['then'](function(_0x10aeda){return createVoicePrefixExtensions(_0x491ea3,_0x10aeda,_0x318c5a);});});});})[_0xee0a('0x1f')](function(){return db[_0xee0a('0x27')]['findById'](_0x491ea3['id']);})[_0xee0a('0x1f')](respondWithResult(_0x46e0b1,null))[_0xee0a('0x40')](handleError(_0x46e0b1,null));};exports['addAgents']=function(_0x122c18,_0x3d78ac,_0x3f701d){return db[_0xee0a('0x27')][_0xee0a('0x43')]({'where':{'id':_0x122c18[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x3d78ac,null))[_0xee0a('0x1f')](function(_0x55e141){if(_0x55e141){return _0x55e141[_0xee0a('0x6b')](_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')],_[_0xee0a('0x6d')](_0x122c18[_0xee0a('0x47')],[_0xee0a('0x6c'),'id'])||{})[_0xee0a('0x6e')](function(_0x58e951){for(var _0x3752cc=0x0;_0x3752cc<_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')][_0xee0a('0x30')];_0x3752cc+=0x1){socket['emit'](_0xee0a('0x6f'),{'UserId':_0x122c18[_0xee0a('0x47')][_0xee0a('0x6c')][_0x3752cc],'VoicePrefixId':_0x122c18[_0xee0a('0x41')]['id']});}return _0x58e951;});}})[_0xee0a('0x1f')](respondWithResult(_0x3d78ac,null))['catch'](handleError(_0x3d78ac,null));};exports['removeAgents']=function(_0x357bc0,_0x11ffbb,_0x2a3eaf){return db['VoicePrefix'][_0xee0a('0x43')]({'where':{'id':_0x357bc0[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x11ffbb,null))[_0xee0a('0x1f')](function(_0x118592){if(_0x118592){return _0x118592[_0xee0a('0x70')](_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')])['then'](function(){if(_[_0xee0a('0x71')](_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')])){for(var _0x2f3324=0x0;_0x2f3324<_0x357bc0[_0xee0a('0x2d')]['ids'][_0xee0a('0x30')];_0x2f3324+=0x1){socket[_0xee0a('0x72')](_0xee0a('0x73'),{'UserId':Number(_0x357bc0[_0xee0a('0x2d')][_0xee0a('0x6c')][_0x2f3324]),'VoicePrefixId':Number(_0x357bc0['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x357bc0['query'][_0xee0a('0x6c')]),'VoicePrefixId':Number(_0x357bc0['params']['id'])});}});}})[_0xee0a('0x1f')](respondWithStatusCode(_0x11ffbb,null))[_0xee0a('0x40')](handleError(_0x11ffbb,null));};exports['getAgents']=function(_0x1dacee,_0x59dd8b,_0xaf2aac){var _0x5750bb={};var _0x1f9f9e={};var _0x1c6713;var _0x527470;return db[_0xee0a('0x27')][_0xee0a('0x74')]({'where':{'id':_0x1dacee[_0xee0a('0x41')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x59dd8b,null))['then'](function(_0x1baba3){if(_0x1baba3){_0x1c6713=_0x1baba3;_0x1f9f9e[_0xee0a('0x29')]=_[_0xee0a('0x2a')](db[_0xee0a('0x75')][_0xee0a('0x28')]);_0x1f9f9e[_0xee0a('0x2d')]=_['keys'](_0x1dacee[_0xee0a('0x2d')]);_0x1f9f9e[_0xee0a('0x2b')]=_[_0xee0a('0x2c')](_0x1f9f9e[_0xee0a('0x29')],_0x1f9f9e[_0xee0a('0x2d')]);_0x5750bb[_0xee0a('0x2e')]=_['intersection'](_0x1f9f9e[_0xee0a('0x29')],qs[_0xee0a('0x2f')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x2f')]));_0x5750bb[_0xee0a('0x2e')]=_0x5750bb[_0xee0a('0x2e')]['length']?_0x5750bb[_0xee0a('0x2e')]:_0x1f9f9e[_0xee0a('0x29')];_0x5750bb[_0xee0a('0x33')]=qs[_0xee0a('0x34')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x34')]);_0x5750bb[_0xee0a('0x35')]=qs[_0xee0a('0x2b')](_[_0xee0a('0x36')](_0x1dacee[_0xee0a('0x2d')],_0x1f9f9e[_0xee0a('0x2b')]));if(_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x37')]){_0x5750bb[_0xee0a('0x35')]=_[_0xee0a('0x38')](_0x5750bb['where'],{'$or':_[_0xee0a('0x5d')](_0x5750bb[_0xee0a('0x2e')],function(_0x5529b7){var _0x16641b={};_0x16641b[_0x5529b7]={'$like':'%'+_0x1dacee[_0xee0a('0x2d')]['filter']+'%'};return _0x16641b;})});}_0x5750bb=_['merge']({},_0x5750bb,_0x1dacee[_0xee0a('0x42')]);return _0x1c6713['getAgents'](_0x5750bb);}})[_0xee0a('0x1f')](function(_0x375cea){if(_0x375cea){_0x527470=_0x375cea['length'];if(!_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x31')](_0xee0a('0x32'))){_0x5750bb[_0xee0a('0x19')]=qs[_0xee0a('0x19')](_0x1dacee['query'][_0xee0a('0x19')]);_0x5750bb[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x1dacee[_0xee0a('0x2d')][_0xee0a('0x18')]);}return _0x1c6713[_0xee0a('0x76')](_0x5750bb);}})[_0xee0a('0x1f')](function(_0x2f9b13){if(_0x2f9b13){return _0x2f9b13?{'count':_0x527470,'rows':_0x2f9b13}:null;}})[_0xee0a('0x1f')](respondWithResult(_0x59dd8b,null))[_0xee0a('0x40')](handleError(_0x59dd8b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9c2dc6a..c24dfa9 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 _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','save','update'];(function(_0x4ed494,_0x273272){var _0x59d5c4=function(_0x40886d){while(--_0x40886d){_0x4ed494['push'](_0x4ed494['shift']());}};_0x59d5c4(++_0x273272);}(_0x54ef,0x112));var _0xf54e=function(_0x41bd3d,_0x13a475){_0x41bd3d=_0x41bd3d-0x0;var _0x4a7351=_0x54ef[_0x41bd3d];return _0x4a7351;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var VoicePrefix=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){VoicePrefixEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);VoicePrefixEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];VoicePrefix[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xcca7=['../../mysqldb','VoicePrefix','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x132889,_0x2207a8){var _0xd93752=function(_0x572faa){while(--_0x572faa){_0x132889['push'](_0x132889['shift']());}};_0xd93752(++_0x2207a8);}(_0xcca7,0x1aa));var _0x7cca=function(_0x80e6b6,_0x480dc8){_0x80e6b6=_0x80e6b6-0x0;var _0x402f71=_0xcca7[_0x80e6b6];return _0x402f71;};'use strict';var EventEmitter=require(_0x7cca('0x0'));var VoicePrefix=require(_0x7cca('0x1'))['db'][_0x7cca('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7cca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7cca('0x4')};function emitEvent(_0x533b00){return function(_0x3b86a4,_0x9523f7,_0x2126f7){VoicePrefixEvents[_0x7cca('0x5')](_0x533b00+':'+_0x3b86a4['id'],_0x3b86a4);VoicePrefixEvents[_0x7cca('0x5')](_0x533b00,_0x3b86a4);_0x2126f7(null);};}for(var e in events){if(events[_0x7cca('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8858427..0deafc1 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 _0x58c6=['bluebird','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x46c30c,_0x1ac896){var _0x45c5c1=function(_0x21ad77){while(--_0x21ad77){_0x46c30c['push'](_0x46c30c['shift']());}};_0x45c5c1(++_0x1ac896);}(_0x58c6,0x1d2));var _0x658c=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x58c6[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x658c('0x0'));var util=require(_0x658c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x658c('0x2'));var rp=require(_0x658c('0x3'));var fs=require('fs');var path=require(_0x658c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x658c('0x5'));module[_0x658c('0x6')]=function(_0x37d0ff,_0x2bb588){return _0x37d0ff['define'](_0x658c('0x7'),attributes,{'tableName':_0x658c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0419=['request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x389cda,_0x31155c){var _0x5889bc=function(_0x32f473){while(--_0x32f473){_0x389cda['push'](_0x389cda['shift']());}};_0x5889bc(++_0x31155c);}(_0x0419,0xe5));var _0x9041=function(_0x85f077,_0x362348){_0x85f077=_0x85f077-0x0;var _0x37f55d=_0x0419[_0x85f077];return _0x37f55d;};'use strict';var _=require(_0x9041('0x0'));var util=require(_0x9041('0x1'));var logger=require(_0x9041('0x2'))(_0x9041('0x3'));var moment=require(_0x9041('0x4'));var BPromise=require('bluebird');var rp=require(_0x9041('0x5'));var fs=require('fs');var path=require(_0x9041('0x6'));var rimraf=require('rimraf');var config=require(_0x9041('0x7'));var attributes=require(_0x9041('0x8'));module[_0x9041('0x9')]=function(_0xc8a0ad,_0x49f26b){return _0xc8a0ad[_0x9041('0xa')](_0x9041('0xb'),attributes,{'tableName':_0x9041('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 66db1fa..0b81884 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 _0x3f5f=['message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','debug','request\x20sent','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x4f57e4,_0x18914d){var _0x4a584c=function(_0x312dcb){while(--_0x312dcb){_0x4f57e4['push'](_0x4f57e4['shift']());}};_0x4a584c(++_0x18914d);}(_0x3f5f,0xff));var _0xf3f5=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x3f5f[_0x47568e];return _0x33815b;};'use strict';var _=require(_0xf3f5('0x0'));var util=require('util');var moment=require(_0xf3f5('0x1'));var BPromise=require(_0xf3f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3f5('0x3'));var db=require(_0xf3f5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3f5('0x5'))('rpc');var config=require(_0xf3f5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf3f5('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf3f5('0x8')](config[_0xf3f5('0x9')],{'host':_0xf3f5('0xa'),'port':0x18eb});var socket=require(_0xf3f5('0xb'))(new Redis(config[_0xf3f5('0x9')]));require(_0xf3f5('0xc'))[_0xf3f5('0xd')](socket);function respondWithRpcPromise(_0x2636c8,_0x892e5a,_0x3c16eb){return new BPromise(function(_0x1c6c9e,_0x4b68d8){return client[_0xf3f5('0xe')](_0x2636c8,_0x3c16eb)['then'](function(_0x498235){logger[_0xf3f5('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x892e5a,'request\x20sent');logger[_0xf3f5('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x892e5a,_0xf3f5('0x11'),JSON[_0xf3f5('0x12')](_0x498235));if(_0x498235[_0xf3f5('0x13')]){if(_0x498235['error']['code']===0x1f4){logger[_0xf3f5('0x13')](_0xf3f5('0x14'),_0x892e5a,_0x498235[_0xf3f5('0x13')][_0xf3f5('0x15')]);return _0x4b68d8(_0x498235[_0xf3f5('0x13')][_0xf3f5('0x15')]);}logger[_0xf3f5('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x892e5a,_0x498235['error'][_0xf3f5('0x15')]);return _0x1c6c9e(_0x498235['error'][_0xf3f5('0x15')]);}else{logger[_0xf3f5('0xf')](_0xf3f5('0x14'),_0x892e5a,_0xf3f5('0x11'));_0x1c6c9e(_0x498235['result'][_0xf3f5('0x15')]);}})[_0xf3f5('0x16')](function(_0x5ebb52){logger[_0xf3f5('0x13')](_0xf3f5('0x14'),_0x892e5a,_0x5ebb52);_0x4b68d8(_0x5ebb52);});});} \ No newline at end of file +var _0xb866=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2387bc,_0x2caed2){var _0x58c250=function(_0x9441e6){while(--_0x9441e6){_0x2387bc['push'](_0x2387bc['shift']());}};_0x58c250(++_0x2caed2);}(_0xb866,0x1d5));var _0x6b86=function(_0x1b02bd,_0x3ae7f2){_0x1b02bd=_0x1b02bd-0x0;var _0x368901=_0xb866[_0x1b02bd];return _0x368901;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b86('0x0'));var BPromise=require('bluebird');var rs=require(_0x6b86('0x1'));var fs=require('fs');var Redis=require(_0x6b86('0x2'));var db=require(_0x6b86('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b86('0x4'))(_0x6b86('0x5'));var config=require(_0x6b86('0x6'));var jayson=require(_0x6b86('0x7'));var client=jayson[_0x6b86('0x8')][_0x6b86('0x9')]({'port':0x232a});config[_0x6b86('0xa')]=_[_0x6b86('0xb')](config[_0x6b86('0xa')],{'host':_0x6b86('0xc'),'port':0x18eb});var socket=require(_0x6b86('0xd'))(new Redis(config[_0x6b86('0xa')]));require(_0x6b86('0xe'))['register'](socket);function respondWithRpcPromise(_0x53e9ab,_0x48724b,_0x1cb7c1){return new BPromise(function(_0x3e4ed9,_0x392dfe){return client[_0x6b86('0xf')](_0x53e9ab,_0x1cb7c1)['then'](function(_0x18da85){logger[_0x6b86('0x10')](_0x6b86('0x11'),_0x48724b,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x48724b,_0x6b86('0x12'),JSON[_0x6b86('0x13')](_0x18da85));if(_0x18da85[_0x6b86('0x14')]){if(_0x18da85['error'][_0x6b86('0x15')]===0x1f4){logger['error'](_0x6b86('0x11'),_0x48724b,_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);return _0x392dfe(_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);}logger[_0x6b86('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x48724b,_0x18da85['error']['message']);return _0x3e4ed9(_0x18da85[_0x6b86('0x14')][_0x6b86('0x16')]);}else{logger[_0x6b86('0x10')](_0x6b86('0x11'),_0x48724b,_0x6b86('0x12'));_0x3e4ed9(_0x18da85[_0x6b86('0x17')]['message']);}})[_0x6b86('0x18')](function(_0xcaf5fb){logger[_0x6b86('0x14')](_0x6b86('0x11'),_0x48724b,_0xcaf5fb);_0x392dfe(_0xcaf5fb);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1404302..255e2a4 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 _0x0642=['emit','removeListener','register','voicePrefix:','save','update'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0x0642,0x9a));var _0x2064=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x0642[_0x1d5400];return _0x21d9fe;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2064('0x0'),'remove',_0x2064('0x1')];function createListener(_0x42d6b6,_0x2c25e6){return function(_0x3dddd6){_0x2c25e6[_0x2064('0x2')](_0x42d6b6,_0x3dddd6);};}function removeListener(_0x170935,_0x3a703b){return function(){VoicePrefixEvents[_0x2064('0x3')](_0x170935,_0x3a703b);};}exports[_0x2064('0x4')]=function(_0x446e31){for(var _0x207947=0x0,_0x461cc9=events['length'];_0x207947<_0x461cc9;_0x207947++){var _0x5b859b=events[_0x207947];var _0x5f3141=createListener(_0x2064('0x5')+_0x5b859b,_0x446e31);VoicePrefixEvents['on'](_0x5b859b,_0x5f3141);}}; \ No newline at end of file +var _0x979b=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','length'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x979b,0x1c9));var _0xb979=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0x979b[_0x223c0d];return _0x207827;};'use strict';var VoicePrefixEvents=require(_0xb979('0x0'));var events=[_0xb979('0x1'),_0xb979('0x2'),_0xb979('0x3')];function createListener(_0x5bef4d,_0x122884){return function(_0x5aa7e1){_0x122884[_0xb979('0x4')](_0x5bef4d,_0x5aa7e1);};}function removeListener(_0x1b8154,_0xb81e52){return function(){VoicePrefixEvents[_0xb979('0x5')](_0x1b8154,_0xb81e52);};}exports['register']=function(_0x1db7a6){for(var _0x1a71e1=0x0,_0x57f045=events[_0xb979('0x6')];_0x1a71e1<_0x57f045;_0x1a71e1++){var _0x21fee0=events[_0x1a71e1];var _0x1ec814=createListener(_0xb979('0x7')+_0x21fee0,_0x1db7a6);VoicePrefixEvents['on'](_0x21fee0,_0x1ec814);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6123cb8..84e1445 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 _0x685b=['/:id/teams','addTeams','addAgents','addLists','addBlackLists','update','delete','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x5b493b,_0x3ce256){var _0x101aab=function(_0x344aa5){while(--_0x344aa5){_0x5b493b['push'](_0x5b493b['shift']());}};_0x101aab(++_0x3ce256);}(_0x685b,0xbd));var _0xb685=function(_0x558615,_0x1eb496){_0x558615=_0x558615-0x0;var _0x1e032a=_0x685b[_0x558615];return _0x1e032a;};'use strict';var multer=require(_0xb685('0x0'));var util=require(_0xb685('0x1'));var path=require(_0xb685('0x2'));var timeout=require(_0xb685('0x3'));var express=require(_0xb685('0x4'));var router=express['Router']();var auth=require(_0xb685('0x5'));var interaction=require(_0xb685('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0xb685('0x7')]('/',auth[_0xb685('0x8')](),controller[_0xb685('0x9')]);router['get'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller['show']);router['get']('/:id/hoppers',auth[_0xb685('0x8')](),controller['getHoppers']);router[_0xb685('0x7')]('/:id/hopper_histories',auth[_0xb685('0x8')](),controller[_0xb685('0xb')]);router[_0xb685('0x7')](_0xb685('0xc'),auth['isAuthenticated'](),controller[_0xb685('0xd')]);router[_0xb685('0x7')](_0xb685('0xe'),auth[_0xb685('0x8')](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0xb685('0x8')](),controller['getTeams']);router[_0xb685('0x7')](_0xb685('0xf'),auth[_0xb685('0x8')](),controller[_0xb685('0x10')]);router[_0xb685('0x7')](_0xb685('0x11'),auth[_0xb685('0x8')](),controller[_0xb685('0x12')]);router['get'](_0xb685('0x13'),auth[_0xb685('0x8')](),controller[_0xb685('0x14')]);router['get'](_0xb685('0x15'),auth[_0xb685('0x8')](),controller[_0xb685('0x16')]);router[_0xb685('0x17')]('/',auth[_0xb685('0x8')](),controller[_0xb685('0x18')]);router[_0xb685('0x17')](_0xb685('0x19'),auth['isAuthenticated'](),controller[_0xb685('0x1a')]);router[_0xb685('0x17')](_0xb685('0x1b'),auth[_0xb685('0x8')](),controller[_0xb685('0x1c')]);router[_0xb685('0x17')]('/:id/users',auth[_0xb685('0x8')](),controller[_0xb685('0x1d')]);router['post']('/:id/lists',auth[_0xb685('0x8')](),controller[_0xb685('0x1e')]);router['post'](_0xb685('0x15'),auth['isAuthenticated'](),controller[_0xb685('0x1f')]);router['put'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller[_0xb685('0x20')]);router['delete'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller['destroy']);router[_0xb685('0x21')](_0xb685('0x1b'),auth[_0xb685('0x8')](),controller[_0xb685('0x22')]);router[_0xb685('0x21')](_0xb685('0xf'),auth[_0xb685('0x8')](),controller['removeAgents']);router[_0xb685('0x21')](_0xb685('0x13'),auth[_0xb685('0x8')](),controller['removeLists']);router[_0xb685('0x21')](_0xb685('0x15'),auth[_0xb685('0x8')](),controller['removeBlackLists']);module[_0xb685('0x23')]=router; \ No newline at end of file +var _0xf2a0=['index','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get'];(function(_0xbb24fe,_0x2365ad){var _0x2f372e=function(_0x319098){while(--_0x319098){_0xbb24fe['push'](_0xbb24fe['shift']());}};_0x2f372e(++_0x2365ad);}(_0xf2a0,0x7e));var _0x0f2a=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0xf2a0[_0x52dd39];return _0x1d4076;};'use strict';var multer=require('multer');var util=require(_0x0f2a('0x0'));var path=require(_0x0f2a('0x1'));var timeout=require(_0x0f2a('0x2'));var express=require('express');var router=express[_0x0f2a('0x3')]();var auth=require(_0x0f2a('0x4'));var interaction=require(_0x0f2a('0x5'));var config=require(_0x0f2a('0x6'));var controller=require(_0x0f2a('0x7'));router[_0x0f2a('0x8')]('/',auth['isAuthenticated'](),controller[_0x0f2a('0x9')]);router['get'](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xc')]);router[_0x0f2a('0x8')]('/:id/hoppers',auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xd')]);router[_0x0f2a('0x8')](_0x0f2a('0xe'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0xf')]);router[_0x0f2a('0x8')](_0x0f2a('0x10'),auth['isAuthenticated'](),controller[_0x0f2a('0x11')]);router[_0x0f2a('0x8')](_0x0f2a('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x0f2a('0x8')]('/:id/teams',auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x13')]);router['get'](_0x0f2a('0x14'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x15')]);router['get'](_0x0f2a('0x16'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x17')]);router[_0x0f2a('0x8')](_0x0f2a('0x18'),auth['isAuthenticated'](),controller[_0x0f2a('0x19')]);router[_0x0f2a('0x8')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x1b')]);router[_0x0f2a('0x1c')]('/',auth['isAuthenticated'](),controller[_0x0f2a('0x1d')]);router[_0x0f2a('0x1c')](_0x0f2a('0x1e'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x1f')]);router[_0x0f2a('0x1c')](_0x0f2a('0x20'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x21')]);router[_0x0f2a('0x1c')](_0x0f2a('0x14'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x22')]);router['post'](_0x0f2a('0x18'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x23')]);router[_0x0f2a('0x1c')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x24')]);router[_0x0f2a('0x25')](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x26')]);router[_0x0f2a('0x27')](_0x0f2a('0xa'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x28')]);router[_0x0f2a('0x27')](_0x0f2a('0x20'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x29')]);router[_0x0f2a('0x27')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router[_0x0f2a('0x27')](_0x0f2a('0x18'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x2a')]);router[_0x0f2a('0x27')](_0x0f2a('0x1a'),auth[_0x0f2a('0xb')](),controller[_0x0f2a('0x2b')]);module[_0x0f2a('0x2c')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 32ccdee..4930a7b 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 _0x0b1f=['join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#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,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','outbound','inbound','STRING','default','ringall','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','ENUM','once','TEXT','periodic_announce','joinempty'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x0b1f,0x101));var _0xf0b1=function(_0x29dc65,_0x52b92f){_0x29dc65=_0x29dc65-0x0;var _0x2a5025=_0x0b1f[_0x29dc65];return _0x2a5025;};'use strict';var Sequelize=require(_0xf0b1('0x0'));module[_0xf0b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xf0b1('0x2')),'allowNull':![],'defaultValue':_0xf0b1('0x3')},'musiconhold':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':_0xf0b1('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xf0b1('0x6'),'leastrecent',_0xf0b1('0x7'),'random',_0xf0b1('0x8'),'linear',_0xf0b1('0x9'),_0xf0b1('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x300de5){this[_0xf0b1('0xb')](_0xf0b1('0xc'),_0x300de5?_0x300de5:_0xf0b1('0x8'));},'get':function(){var _0xa8a127=this[_0xf0b1('0xd')](_0xf0b1('0xe'));var _0x4dfb9f=this[_0xf0b1('0xd')]('dialMethod');var _0x3a9841=this[_0xf0b1('0xd')](_0xf0b1('0xc'));if(_0xa8a127===_0xf0b1('0x3')){return _0x3a9841;}if(_0x4dfb9f===_0xf0b1('0xf')&&_0x3a9841===_0xf0b1('0x8')||_0x4dfb9f===_0xf0b1('0xf')&&_0x3a9841===_0xf0b1('0x10')){return _0x3a9841;}if(_0x4dfb9f===_0xf0b1('0x11')||_0x4dfb9f===_0xf0b1('0x12')||_0x4dfb9f===_0xf0b1('0x13')){return _0x3a9841;}return null;}},'servicelevel':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'timeout':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xf0b1('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf0b1('0x15'),'no'),'defaultValue':_0xf0b1('0x15')},'autopause':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf0b1('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf0b1('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xf0b1('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf0b1('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf0b1('0x4')]},'queue_youarenext':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf0b1('0x4')]},'queue_quantity1':{'type':Sequelize[_0xf0b1('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xf0b1('0x4')]},'queue_less_than':{'type':Sequelize[_0xf0b1('0x4')]},'periodic_announce':{'type':Sequelize[_0xf0b1('0x18')],'set':function(_0x1f7269){this['setDataValue']('periodic_announce',_0x1f7269?_0x1f7269['join'](','):[]);},'get':function(){return this['getDataValue'](_0xf0b1('0x19'))?this[_0xf0b1('0xd')](_0xf0b1('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':_0xf0b1('0x15'),'set':function(_0x4cc310){this['setDataValue'](_0xf0b1('0x1a'),_0x4cc310?_0x4cc310[_0xf0b1('0x1b')](','):[]);},'get':function(){return this[_0xf0b1('0xd')]('joinempty')?this['getDataValue'](_0xf0b1('0x1a'))[_0xf0b1('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'no','set':function(_0x63146c){this[_0xf0b1('0xb')](_0xf0b1('0x1d'),_0x63146c?_0x63146c[_0xf0b1('0x1b')](','):[]);},'get':function(){return this[_0xf0b1('0xd')](_0xf0b1('0x1d'))?this[_0xf0b1('0xd')](_0xf0b1('0x1d'))[_0xf0b1('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf0b1('0x4')]},'description':{'type':Sequelize[_0xf0b1('0x4')]},'acw':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':0x0,'set':function(_0x170069){this[_0xf0b1('0xb')](_0xf0b1('0x1f'),_0x170069);if(_0x170069){if(this['getDataValue'](_0xf0b1('0x20'))<0x2){this[_0xf0b1('0xb')](_0xf0b1('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xf0b1('0x11'),_0xf0b1('0x13'),_0xf0b1('0x12'),'booked'),'defaultValue':_0xf0b1('0x11'),'comment':_0xf0b1('0x21')},'dialLimitChannel':{'type':Sequelize[_0xf0b1('0x14')](0x4)[_0xf0b1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf0b1('0x23')},'dialLimitQueue':{'type':Sequelize[_0xf0b1('0x14')](0x4)[_0xf0b1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf0b1('0x24')},'dialPowerLevel':{'type':Sequelize[_0xf0b1('0x25')](0x2)[_0xf0b1('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x26'),_0xf0b1('0x27')),'defaultValue':_0xf0b1('0x27'),'comment':_0xf0b1('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf0b1('0x25')](0x2)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf0b1('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xf0b1('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf0b1('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf0b1('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf0b1('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'tTxX','comment':_0xf0b1('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf0b1('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf0b1('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf0b1('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf0b1('0x30')},'dialTimezone':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf0b1('0x31')},'dialPrefix':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x32'),_0xf0b1('0x33'),_0xf0b1('0x34')),'defaultValue':_0xf0b1('0x32')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf0b1('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf0b1('0x36')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf0b1('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf0b1('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf0b1('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf0b1('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xf0b1('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf0b1('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf0b1('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf0b1('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf0b1('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf0b1('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xf0b1('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':0x0,'comment':_0xf0b1('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x3f'),_0xf0b1('0x40')),'defaultValue':_0xf0b1('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xf0b1('0x4')],'comment':_0xf0b1('0x41')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf0b1('0x42')},'dialCutDigit':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf0b1('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf0b1('0x14')],'allowNull':!![],'comment':_0xf0b1('0x44')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf0b1('0x45'),'set':function(_0x3b6de4){if(!_0x3b6de4)this[_0xf0b1('0xb')](_0xf0b1('0x46'),null);this[_0xf0b1('0xb')]('mandatoryDisposition',_0x3b6de4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf0b1('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xfd0f=['INTEGER','yes','all','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\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,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','default','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','predictive'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x3e40d4,_0x13173a){_0x3e40d4=_0x3e40d4-0x0;var _0x49d47a=_0xfd0f[_0x3e40d4];return _0x49d47a;};'use strict';var Sequelize=require(_0xffd0('0x0'));module[_0xffd0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xffd0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xffd0('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xffd0('0x5')},'announce':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xffd0('0x3')]('rr',_0xffd0('0x7'),_0xffd0('0x8'),_0xffd0('0x9'),_0xffd0('0xa'),_0xffd0('0xb'),_0xffd0('0xc'),'wrandom',_0xffd0('0xd')),'allowNull':![],'defaultValue':_0xffd0('0x7'),'set':function(_0x1b3842){this[_0xffd0('0xe')]('strategy',_0x1b3842?_0x1b3842:'rrmemory');},'get':function(){var _0x2c343c=this[_0xffd0('0xf')](_0xffd0('0x10'));var _0x4d36ba=this['getDataValue'](_0xffd0('0x11'));var _0x4edae9=this['getDataValue'](_0xffd0('0x12'));if(_0x2c343c===_0xffd0('0x4')){return _0x4edae9;}if(_0x4d36ba===_0xffd0('0x13')&&_0x4edae9==='rrmemory'||_0x4d36ba===_0xffd0('0x13')&&_0x4edae9===_0xffd0('0x14')){return _0x4edae9;}if(_0x4d36ba==='progressive'||_0x4d36ba===_0xffd0('0x15')||_0x4d36ba==='power'){return _0x4edae9;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xffd0('0x6')]},'weight':{'type':Sequelize[_0xffd0('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xffd0('0x17')},'autopause':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no',_0xffd0('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xffd0('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xffd0('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':_0xffd0('0x17')},'announce_holdtime':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no',_0xffd0('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xffd0('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xffd0('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xffd0('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xffd0('0x6')]},'queue_quantity1':{'type':Sequelize[_0xffd0('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xffd0('0x6')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x56f39a){this[_0xffd0('0xe')](_0xffd0('0x1a'),_0x56f39a?_0x56f39a[_0xffd0('0x1b')](','):[]);},'get':function(){return this[_0xffd0('0xf')](_0xffd0('0x1a'))?this[_0xffd0('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xffd0('0x17'),'set':function(_0x5bb7f1){this[_0xffd0('0xe')](_0xffd0('0x1c'),_0x5bb7f1?_0x5bb7f1['join'](','):[]);},'get':function(){return this[_0xffd0('0xf')]('joinempty')?this['getDataValue']('joinempty')[_0xffd0('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':'no','set':function(_0x25f6ad){this[_0xffd0('0xe')](_0xffd0('0x1e'),_0x25f6ad?_0x25f6ad['join'](','):[]);},'get':function(){return this[_0xffd0('0xf')](_0xffd0('0x1e'))?this['getDataValue'](_0xffd0('0x1e'))[_0xffd0('0x1d')](','):[];}},'reportholdtime':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xffd0('0x6')]},'acw':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'set':function(_0x49e076){this[_0xffd0('0xe')](_0xffd0('0x20'),_0x49e076);if(_0x49e076){if(this['getDataValue'](_0xffd0('0x21'))<0x2){this['setDataValue'](_0xffd0('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xffd0('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffd0('0x22')},'dialMethod':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x23'),_0xffd0('0x24'),_0xffd0('0x25'),_0xffd0('0x15'),_0xffd0('0x13')),'defaultValue':_0xffd0('0x24'),'comment':_0xffd0('0x26')},'dialLimitChannel':{'type':Sequelize[_0xffd0('0x16')](0x4)[_0xffd0('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffd0('0x28')},'dialLimitQueue':{'type':Sequelize[_0xffd0('0x16')](0x4)[_0xffd0('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffd0('0x29')},'dialPowerLevel':{'type':Sequelize[_0xffd0('0x2a')](0x2)[_0xffd0('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x2b'),_0xffd0('0x2c')),'defaultValue':_0xffd0('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xffd0('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xffd0('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xffd0('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':_0xffd0('0x2f'),'comment':_0xffd0('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x31')},'dialQueueProject':{'type':Sequelize[_0xffd0('0x6')],'comment':_0xffd0('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffd0('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x3,'comment':_0xffd0('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffd0('0x37')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xffd0('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xffd0('0x38')},'dialTimezone':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xffd0('0x6')],'defaultValue':_0xffd0('0x39')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xffd0('0x3a'),_0xffd0('0x3b')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'comment':_0xffd0('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xffd0('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xffd0('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xffd0('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xffd0('0x16')](0x9)[_0xffd0('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xffd0('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xffd0('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xffd0('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xffd0('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xffd0('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xffd0('0x42')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffd0('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xffd0('0x16')](0x5)[_0xffd0('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xffd0('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':0x0,'comment':_0xffd0('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xffd0('0x3')](_0xffd0('0x46'),_0xffd0('0x47')),'defaultValue':_0xffd0('0x46')},'dialQueueProject2':{'type':Sequelize[_0xffd0('0x6')],'comment':_0xffd0('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffd0('0x48')},'dialCutDigit':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffd0('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xffd0('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0xffd0('0x1f')],'defaultValue':![],'comment':_0xffd0('0x4b'),'set':function(_0x25e029){if(!_0x25e029)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xffd0('0x4c'),_0x25e029);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xffd0('0x16')](0x3)[_0xffd0('0x27')],'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 c832d31..68b9f25 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 _0x4213=['sort','where','filters','pick','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','QueueCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','UserProfileSection','findOne','CmHopper','hasOwnProperty','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','voicePause','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','compact','ids','isEmpty','removeAgents','destroy','userVoiceQueue:remove','addAgents','online','push','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','createdAt','NOW()','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','count','offset','limit','status','set','reject','save','update','then','get','inbound','outbound','filter','ignore','map','value','type','UserProfileResource','error','stack','name','send','index','VoiceQueue','model','keys','query','intersection','fields','attributes','length','nolimit','order'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4213,0x77));var _0x3421=function(_0xd51f13,_0x236119){_0xd51f13=_0xd51f13-0x0;var _0x4d7ad8=_0x4213[_0xd51f13];return _0x4d7ad8;};'use strict';var pdf=require(_0x3421('0x0'));var emlformat=require(_0x3421('0x1'));var rimraf=require(_0x3421('0x2'));var zipdir=require(_0x3421('0x3'));var jsonpatch=require(_0x3421('0x4'));var rp=require(_0x3421('0x5'));var moment=require(_0x3421('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3421('0x7'));var util=require('util');var path=require(_0x3421('0x8'));var sox=require(_0x3421('0x9'));var csv=require(_0x3421('0xa'));var ejs=require(_0x3421('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0xa'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3421('0x12'))(_0x3421('0x13'));var utils=require(_0x3421('0x14'));var config=require(_0x3421('0x15'));var db=require(_0x3421('0x16'))['db'];config[_0x3421('0x17')]=_[_0x3421('0x18')](config['redis'],{'host':_0x3421('0x19'),'port':0x18eb});var socket=require(_0x3421('0x1a'))(new Redis(config[_0x3421('0x17')]));require(_0x3421('0x1b'))[_0x3421('0x1c')](socket);function respondWithStatusCode(_0x3f4672,_0x25ffd4){_0x25ffd4=_0x25ffd4||0xcc;return function(_0x59ea4a){if(_0x59ea4a){return _0x3f4672[_0x3421('0x1d')](_0x25ffd4);}return _0x3f4672['status'](_0x25ffd4)[_0x3421('0x1e')]();};}function respondWithResult(_0x5257ad,_0x59ae45){_0x59ae45=_0x59ae45||0xc8;return function(_0x1e33ab){if(_0x1e33ab){return _0x5257ad['status'](_0x59ae45)[_0x3421('0x1f')](_0x1e33ab);}};}function respondWithFilteredResult(_0x23694b,_0x52af2d){return function(_0x3584d6){if(_0x3584d6){var _0x3dec08=_0x3584d6[_0x3421('0x20')],_0x130d3c=_0x52af2d[_0x3421('0x21')],_0x104cc5=_0x52af2d[_0x3421('0x21')]+_0x52af2d[_0x3421('0x22')],_0x18acc1;if(_0x104cc5>=_0x3dec08){_0x104cc5=_0x3dec08;_0x18acc1=0xc8;}else{_0x18acc1=0xce;}_0x23694b[_0x3421('0x23')](_0x18acc1);return _0x23694b[_0x3421('0x24')]('Content-Range',_0x130d3c+'-'+_0x104cc5+'/'+_0x3dec08)[_0x3421('0x1f')](_0x3584d6);}return null;};}function patchUpdates(_0x4b59a5){return function(_0x5820f6){try{jsonpatch['apply'](_0x5820f6,_0x4b59a5,!![]);}catch(_0x33155b){return BPromise[_0x3421('0x25')](_0x33155b);}return _0x5820f6[_0x3421('0x26')]();};}function saveUpdates(_0x256cc5,_0x132e8e){return function(_0x39bed4){if(_0x39bed4){return _0x39bed4[_0x3421('0x27')](_0x256cc5)[_0x3421('0x28')](function(_0xb9af5f){return _0xb9af5f;});}return null;};}function removeEntity(_0x34389e,_0x48fb3d){return function(_0x57a4af){if(_0x57a4af){return _0x57a4af['destroy']()[_0x3421('0x28')](function(){var _0x958899=_0x57a4af[_0x3421('0x29')]({'plain':!![]});var _0x5bc28a=[{'name':'VoiceQueues','value':_0x3421('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x3421('0x2b'),'ignore':![]}];var _0x487944=_(_0x5bc28a)[_0x3421('0x2c')](_0x3421('0x2d'))[_0x3421('0x2e')](_0x3421('0x2f'))[_0x3421('0x2f')]();if(_['includes'](_0x487944,_0x958899[_0x3421('0x30')])){return;}var _0x52fd41=_['find'](_0x5bc28a,[_0x3421('0x2f'),_0x958899['type']])['name'];return db[_0x3421('0x31')]['destroy']({'where':{'type':_0x52fd41,'resourceId':_0x958899['id']}})[_0x3421('0x28')](function(){return _0x57a4af;});})['then'](function(){_0x34389e[_0x3421('0x23')](0xcc)[_0x3421('0x1e')]();});}};}function handleEntityNotFound(_0x48d828,_0x3f7c0b){return function(_0x3bc7c1){if(!_0x3bc7c1){_0x48d828[_0x3421('0x1d')](0x194);}return _0x3bc7c1;};}function handleError(_0x4a0ac7,_0x3a89b6){_0x3a89b6=_0x3a89b6||0x1f4;return function(_0x50d61b){logger[_0x3421('0x32')](_0x50d61b[_0x3421('0x33')]);if(_0x50d61b[_0x3421('0x34')]){delete _0x50d61b[_0x3421('0x34')];}_0x4a0ac7[_0x3421('0x23')](_0x3a89b6)[_0x3421('0x35')](_0x50d61b);};}exports[_0x3421('0x36')]=function(_0x37151d,_0x94559a){var _0x220f14={},_0x4e44b4={},_0x556557={'count':0x0,'rows':[]};var _0x1239d9=db[_0x3421('0x37')]['rawAttributes'];_0x4e44b4[_0x3421('0x38')]=_[_0x3421('0x39')](_0x1239d9);_0x4e44b4[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x37151d[_0x3421('0x3a')]);_0x4e44b4['filters']=_[_0x3421('0x3b')](_0x4e44b4[_0x3421('0x38')],_0x4e44b4[_0x3421('0x3a')]);_0x220f14['attributes']=_[_0x3421('0x3b')](_0x4e44b4['model'],qs[_0x3421('0x3c')](_0x37151d[_0x3421('0x3a')][_0x3421('0x3c')]));_0x220f14[_0x3421('0x3d')]=_0x220f14[_0x3421('0x3d')][_0x3421('0x3e')]?_0x220f14[_0x3421('0x3d')]:_0x4e44b4['model'];if(!_0x37151d['query']['hasOwnProperty'](_0x3421('0x3f'))){_0x220f14['limit']=qs['limit'](_0x37151d[_0x3421('0x3a')]['limit']);_0x220f14[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x37151d['query'][_0x3421('0x21')]);}_0x220f14[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x37151d[_0x3421('0x3a')]['sort']);_0x220f14[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x37151d[_0x3421('0x3a')],_0x4e44b4[_0x3421('0x43')]));if(_0x37151d['query'][_0x3421('0x2c')]){_0x220f14[_0x3421('0x42')]=_['merge'](_0x220f14[_0x3421('0x42')],{'$or':_['map'](_0x1239d9,function(_0x4da2f5){if(_0x4da2f5['type'][_0x3421('0x45')]!==_0x3421('0x46')){var _0x41bdb7={};_0x41bdb7[_0x4da2f5[_0x3421('0x47')]]={'$like':'%'+_0x37151d[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x41bdb7;}})});}_0x220f14=_[_0x3421('0x48')]({},_0x220f14,_0x37151d[_0x3421('0x49')]);var _0x33198f={'where':_0x220f14[_0x3421('0x42')]};return db[_0x3421('0x37')][_0x3421('0x20')](_0x33198f)[_0x3421('0x28')](function(_0x3d016d){_0x556557['count']=_0x3d016d;if(_0x37151d[_0x3421('0x3a')][_0x3421('0x4a')]){_0x220f14[_0x3421('0x4b')]=[{'all':!![]}];}return db[_0x3421('0x37')]['findAll'](_0x220f14);})[_0x3421('0x28')](function(_0x4da769){_0x556557[_0x3421('0x4c')]=_0x4da769;return _0x556557;})[_0x3421('0x28')](respondWithFilteredResult(_0x94559a,_0x220f14))[_0x3421('0x4d')](handleError(_0x94559a,null));};exports[_0x3421('0x4e')]=function(_0x2f9a84,_0x60fb09){var _0x435ba7={'raw':![],'where':{'id':_0x2f9a84[_0x3421('0x4f')]['id']}},_0x305951={};_0x305951[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x37')][_0x3421('0x50')]);_0x305951['query']=_[_0x3421('0x39')](_0x2f9a84['query']);_0x305951[_0x3421('0x43')]=_[_0x3421('0x3b')](_0x305951[_0x3421('0x38')],_0x305951[_0x3421('0x3a')]);_0x435ba7[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x305951[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x2f9a84[_0x3421('0x3a')][_0x3421('0x3c')]));_0x435ba7['attributes']=_0x435ba7[_0x3421('0x3d')][_0x3421('0x3e')]?_0x435ba7[_0x3421('0x3d')]:_0x305951['model'];if(_0x2f9a84['query'][_0x3421('0x4a')]){_0x435ba7[_0x3421('0x4b')]=[{'all':!![]}];}_0x435ba7=_[_0x3421('0x48')]({},_0x435ba7,_0x2f9a84['options']);return db[_0x3421('0x37')][_0x3421('0x51')](_0x435ba7)[_0x3421('0x28')](handleEntityNotFound(_0x60fb09,null))[_0x3421('0x28')](respondWithResult(_0x60fb09,null))['catch'](handleError(_0x60fb09,null));};exports[_0x3421('0x52')]=function(_0x1bcf74,_0x3f7ff3){return db['VoiceQueue']['create'](_0x1bcf74['body'],{})[_0x3421('0x28')](function(_0x1021f8){var _0x5a9ccf=_0x1bcf74['user'][_0x3421('0x29')]({'plain':!![]});if(!_0x5a9ccf)throw new Error(_0x3421('0x53'));if(_0x5a9ccf[_0x3421('0x54')]===_0x3421('0x55')){var _0x127835=_0x1021f8['get']({'plain':!![]});var _0x27d284=[{'name':_0x3421('0x56'),'value':_0x3421('0x2a')},{'name':_0x3421('0x57'),'value':'outbound'}];var _0x1d243f=_[_0x3421('0x51')](_0x27d284,[_0x3421('0x2f'),_0x127835['type']])[_0x3421('0x34')];return db['UserProfileSection']['find']({'where':{'name':_0x1d243f,'userProfileId':_0x5a9ccf[_0x3421('0x58')]},'raw':!![]})['then'](function(_0x4e33a0){if(_0x4e33a0&&_0x4e33a0[_0x3421('0x59')]===0x0){return db[_0x3421('0x31')]['create']({'name':_0x127835[_0x3421('0x34')],'resourceId':_0x127835['id'],'type':_0x4e33a0[_0x3421('0x34')],'sectionId':_0x4e33a0['id']},{})[_0x3421('0x28')](function(){return _0x1021f8;});}else{return _0x1021f8;}})[_0x3421('0x4d')](function(_0x1c73b9){logger[_0x3421('0x32')](_0x3421('0x5a'),_0x1c73b9);throw _0x1c73b9;});}return _0x1021f8;})[_0x3421('0x28')](respondWithResult(_0x3f7ff3,0xc9))[_0x3421('0x4d')](handleError(_0x3f7ff3,null));};exports['clone']=function(_0x1e4add,_0x23ddd5){var _0x5bef38={'raw':![],'where':{'id':_0x1e4add[_0x3421('0x4f')]['id']}},_0x3950fa={};_0x3950fa[_0x3421('0x38')]=_['keys'](db[_0x3421('0x37')][_0x3421('0x50')]);_0x5bef38[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x3950fa[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x1e4add[_0x3421('0x3a')][_0x3421('0x3c')]));_0x5bef38[_0x3421('0x3d')]=_0x5bef38[_0x3421('0x3d')][_0x3421('0x3e')]?_0x5bef38[_0x3421('0x3d')]:_0x3950fa[_0x3421('0x38')];if(_0x1e4add[_0x3421('0x3a')][_0x3421('0x4a')]){_0x5bef38['include']=[{'all':!![]}];}_0x5bef38=_[_0x3421('0x48')]({},_0x5bef38,_0x1e4add[_0x3421('0x49')]);return db[_0x3421('0x37')][_0x3421('0x51')](_0x5bef38)[_0x3421('0x28')](handleEntityNotFound(_0x23ddd5,null))[_0x3421('0x28')](function(_0x32c9a7){if(_0x32c9a7){var _0x374a6a=_0x32c9a7['get']({'plain':!![]});_0x374a6a=qs[_0x3421('0x5b')](_0x374a6a,['id','createdAt',_0x3421('0x5c')]);_0x1e4add[_0x3421('0x5d')]=_[_0x3421('0x5b')](_0x1e4add[_0x3421('0x5d')],['id','createdAt',_0x3421('0x5c')]);return db[_0x3421('0x37')][_0x3421('0x52')](_[_0x3421('0x48')](_0x374a6a,_0x1e4add[_0x3421('0x5d')]),{'include':_0x1e4add[_0x3421('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x3421('0x28')](function(_0x1d23f1){var _0x1e9971=_0x1e4add[_0x3421('0x55')][_0x3421('0x29')]({'plain':!![]});if(!_0x1e9971)throw new Error(_0x3421('0x53'));if(_0x1e9971[_0x3421('0x54')]===_0x3421('0x55')){var _0x4edb4e=_0x1d23f1[_0x3421('0x29')]({'plain':!![]});var _0x46717b=[{'name':_0x3421('0x56'),'value':_0x3421('0x2a')},{'name':_0x3421('0x57'),'value':'outbound'}];var _0x5763c1=_[_0x3421('0x51')](_0x46717b,[_0x3421('0x2f'),_0x4edb4e[_0x3421('0x30')]])['name'];return db[_0x3421('0x5e')]['find']({'where':{'name':_0x5763c1,'userProfileId':_0x1e9971[_0x3421('0x58')]},'raw':!![]})['then'](function(_0x4f23c5){if(_0x4f23c5&&_0x4f23c5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4edb4e[_0x3421('0x34')],'resourceId':_0x4edb4e['id'],'type':_0x4f23c5[_0x3421('0x34')],'sectionId':_0x4f23c5['id']},{})[_0x3421('0x28')](function(){return _0x1d23f1;});}else{return _0x1d23f1;}})[_0x3421('0x4d')](function(_0xa05828){logger[_0x3421('0x32')](_0x3421('0x5a'),_0xa05828);throw _0xa05828;});}return _0x1d23f1;});}})[_0x3421('0x28')](respondWithResult(_0x23ddd5,0xc9))[_0x3421('0x4d')](handleError(_0x23ddd5,null));};exports[_0x3421('0x27')]=function(_0x5c7a78,_0x297184){if(_0x5c7a78['body']['id']){delete _0x5c7a78[_0x3421('0x5d')]['id'];}return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x5c7a78[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x297184,null))[_0x3421('0x28')](saveUpdates(_0x5c7a78[_0x3421('0x5d')],null))[_0x3421('0x28')](respondWithResult(_0x297184,null))[_0x3421('0x4d')](handleError(_0x297184,null));};exports['destroy']=function(_0x2fe3b7,_0x14516b){return db[_0x3421('0x37')]['find']({'where':{'id':_0x2fe3b7['params']['id']}})['then'](handleEntityNotFound(_0x14516b,null))['then'](removeEntity(_0x14516b,null))[_0x3421('0x4d')](handleError(_0x14516b,null));};exports['getHoppers']=function(_0x2b3837,_0x8aee05,_0x2a6a3b){var _0x10d3f9={'raw':![],'where':{}};var _0x47e504={};var _0x1e64c2={'count':0x0,'rows':[]};return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x2b3837[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x8aee05,null))[_0x3421('0x28')](function(_0x5011ec){if(_0x5011ec){_0x47e504[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x60')][_0x3421('0x50')]);_0x47e504[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x2b3837[_0x3421('0x3a')]);_0x47e504['filters']=_['intersection'](_0x47e504[_0x3421('0x38')],_0x47e504[_0x3421('0x3a')]);_0x10d3f9[_0x3421('0x3d')]=_['intersection'](_0x47e504[_0x3421('0x38')],qs['fields'](_0x2b3837[_0x3421('0x3a')]['fields']));_0x10d3f9[_0x3421('0x3d')]=_0x10d3f9[_0x3421('0x3d')][_0x3421('0x3e')]?_0x10d3f9[_0x3421('0x3d')]:_0x47e504[_0x3421('0x38')];if(!_0x2b3837[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x10d3f9[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x22')]);_0x10d3f9['offset']=qs[_0x3421('0x21')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x21')]);}_0x10d3f9[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x41')]);_0x10d3f9[_0x3421('0x42')]=qs['filters'](_[_0x3421('0x44')](_0x2b3837['query'],_0x47e504['filters']));_0x10d3f9['where'][_0x3421('0x62')]=_0x5011ec['id'];if(_0x2b3837[_0x3421('0x3a')][_0x3421('0x2c')]){_0x10d3f9[_0x3421('0x42')]=_['merge'](_0x10d3f9[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x10d3f9[_0x3421('0x3d')],function(_0x1e2abf){var _0x22d82c={};_0x22d82c[_0x1e2abf]={'$like':'%'+_0x2b3837[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x22d82c;})});}_0x10d3f9=_[_0x3421('0x48')]({},_0x10d3f9,_0x2b3837[_0x3421('0x49')]);return db[_0x3421('0x60')][_0x3421('0x20')]({'where':_0x10d3f9[_0x3421('0x42')]})[_0x3421('0x28')](function(_0x170340){_0x1e64c2[_0x3421('0x20')]=_0x170340;if(_0x2b3837[_0x3421('0x3a')][_0x3421('0x4a')]){_0x10d3f9['include']=[{'all':!![]}];}return db['CmHopper'][_0x3421('0x63')](_0x10d3f9);})['then'](function(_0x16b93b){_0x1e64c2[_0x3421('0x4c')]=_0x16b93b;return _0x1e64c2;});}})['then'](respondWithFilteredResult(_0x8aee05,_0x10d3f9))[_0x3421('0x4d')](handleError(_0x8aee05,null));};exports[_0x3421('0x64')]=function(_0x3b9bbe,_0x87404,_0x718eb6){var _0x46042a={'raw':!![],'where':{}};var _0x31a08c={};var _0x9d0656={'count':0x0,'rows':[]};return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x3b9bbe[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x87404,null))[_0x3421('0x28')](function(_0x4fcc52){if(_0x4fcc52){_0x31a08c[_0x3421('0x38')]=_['keys'](db[_0x3421('0x65')][_0x3421('0x50')]);_0x31a08c['query']=_[_0x3421('0x39')](_0x3b9bbe['query']);_0x31a08c['filters']=_[_0x3421('0x3b')](_0x31a08c[_0x3421('0x38')],_0x31a08c[_0x3421('0x3a')]);_0x46042a['attributes']=_[_0x3421('0x3b')](_0x31a08c[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x3b9bbe['query']['fields']));_0x46042a[_0x3421('0x3d')]=_0x46042a[_0x3421('0x3d')][_0x3421('0x3e')]?_0x46042a[_0x3421('0x3d')]:_0x31a08c['model'];if(!_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x46042a[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x22')]);_0x46042a[_0x3421('0x21')]=qs['offset'](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x21')]);}_0x46042a['order']=qs['sort'](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x41')]);_0x46042a[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x3b9bbe['query'],_0x31a08c['filters']));_0x46042a[_0x3421('0x42')]['VoiceQueueId']=_0x4fcc52['id'];if(_0x3b9bbe['query'][_0x3421('0x2c')]){_0x46042a[_0x3421('0x42')]=_[_0x3421('0x48')](_0x46042a[_0x3421('0x42')],{'$or':_['map'](_0x46042a['attributes'],function(_0x335331){var _0x5a922d={};_0x5a922d[_0x335331]={'$like':'%'+_0x3b9bbe['query'][_0x3421('0x2c')]+'%'};return _0x5a922d;})});}_0x46042a=_[_0x3421('0x48')]({},_0x46042a,_0x3b9bbe[_0x3421('0x49')]);return db['CmHopperHistory']['count']({'where':_0x46042a['where']})[_0x3421('0x28')](function(_0x1fad28){_0x9d0656[_0x3421('0x20')]=_0x1fad28;if(_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x4a')]){_0x46042a[_0x3421('0x4b')]=[{'all':!![]}];}return db[_0x3421('0x65')]['findAll'](_0x46042a);})[_0x3421('0x28')](function(_0x210490){_0x9d0656[_0x3421('0x4c')]=_0x210490;return _0x9d0656;});}})[_0x3421('0x28')](respondWithFilteredResult(_0x87404,_0x46042a))[_0x3421('0x4d')](handleError(_0x87404,null));};exports[_0x3421('0x66')]=function(_0x381a66,_0x298985,_0x276656){var _0x5f54b8={'raw':!![],'where':{}};var _0x524ea3={};var _0x171d32={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x381a66['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x298985,null))[_0x3421('0x28')](function(_0x1decdf){if(_0x1decdf){_0x524ea3[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmHopperFinal']['rawAttributes']);_0x524ea3[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x381a66[_0x3421('0x3a')]);_0x524ea3[_0x3421('0x43')]=_['intersection'](_0x524ea3[_0x3421('0x38')],_0x524ea3[_0x3421('0x3a')]);_0x5f54b8[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x524ea3[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x381a66[_0x3421('0x3a')]['fields']));_0x5f54b8[_0x3421('0x3d')]=_0x5f54b8[_0x3421('0x3d')]['length']?_0x5f54b8[_0x3421('0x3d')]:_0x524ea3[_0x3421('0x38')];if(!_0x381a66[_0x3421('0x3a')]['hasOwnProperty'](_0x3421('0x3f'))){_0x5f54b8[_0x3421('0x22')]=qs['limit'](_0x381a66[_0x3421('0x3a')][_0x3421('0x22')]);_0x5f54b8[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x381a66[_0x3421('0x3a')][_0x3421('0x21')]);}_0x5f54b8[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x381a66['query'][_0x3421('0x41')]);_0x5f54b8['where']=qs['filters'](_[_0x3421('0x44')](_0x381a66[_0x3421('0x3a')],_0x524ea3[_0x3421('0x43')]));_0x5f54b8[_0x3421('0x42')]['VoiceQueueId']=_0x1decdf['id'];if(_0x381a66[_0x3421('0x3a')][_0x3421('0x2c')]){_0x5f54b8[_0x3421('0x42')]=_[_0x3421('0x48')](_0x5f54b8[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x5f54b8[_0x3421('0x3d')],function(_0x31814a){var _0x18c232={};_0x18c232[_0x31814a]={'$like':'%'+_0x381a66[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x18c232;})});}_0x5f54b8=_[_0x3421('0x48')]({},_0x5f54b8,_0x381a66[_0x3421('0x49')]);return db[_0x3421('0x67')][_0x3421('0x20')]({'where':_0x5f54b8[_0x3421('0x42')]})[_0x3421('0x28')](function(_0x34f980){_0x171d32[_0x3421('0x20')]=_0x34f980;if(_0x381a66[_0x3421('0x3a')][_0x3421('0x4a')]){_0x5f54b8['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x3421('0x63')](_0x5f54b8);})[_0x3421('0x28')](function(_0x1a7038){_0x171d32[_0x3421('0x4c')]=_0x1a7038;return _0x171d32;});}})['then'](respondWithFilteredResult(_0x298985,_0x5f54b8))[_0x3421('0x4d')](handleError(_0x298985,null));};exports[_0x3421('0x68')]=function(_0x594404,_0xadd73a,_0x2eb3f4){var _0x4ea7b2={'raw':!![],'where':{}};var _0x5cd2b7={};var _0x4693dd={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x594404[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0xadd73a,null))[_0x3421('0x28')](function(_0x3c0134){if(_0x3c0134){_0x5cd2b7[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmHopperBlack'][_0x3421('0x50')]);_0x5cd2b7['query']=_['keys'](_0x594404[_0x3421('0x3a')]);_0x5cd2b7[_0x3421('0x43')]=_['intersection'](_0x5cd2b7[_0x3421('0x38')],_0x5cd2b7['query']);_0x4ea7b2[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x5cd2b7[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x594404[_0x3421('0x3a')][_0x3421('0x3c')]));_0x4ea7b2[_0x3421('0x3d')]=_0x4ea7b2[_0x3421('0x3d')][_0x3421('0x3e')]?_0x4ea7b2[_0x3421('0x3d')]:_0x5cd2b7[_0x3421('0x38')];if(!_0x594404[_0x3421('0x3a')]['hasOwnProperty'](_0x3421('0x3f'))){_0x4ea7b2['limit']=qs['limit'](_0x594404[_0x3421('0x3a')][_0x3421('0x22')]);_0x4ea7b2[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x594404['query'][_0x3421('0x21')]);}_0x4ea7b2[_0x3421('0x40')]=qs['sort'](_0x594404[_0x3421('0x3a')]['sort']);_0x4ea7b2[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x594404['query'],_0x5cd2b7[_0x3421('0x43')]));_0x4ea7b2[_0x3421('0x42')][_0x3421('0x62')]=_0x3c0134['id'];if(_0x594404[_0x3421('0x3a')][_0x3421('0x2c')]){_0x4ea7b2[_0x3421('0x42')]=_[_0x3421('0x48')](_0x4ea7b2[_0x3421('0x42')],{'$or':_['map'](_0x4ea7b2[_0x3421('0x3d')],function(_0x37f415){var _0x3c96bd={};_0x3c96bd[_0x37f415]={'$like':'%'+_0x594404[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x3c96bd;})});}_0x4ea7b2=_[_0x3421('0x48')]({},_0x4ea7b2,_0x594404[_0x3421('0x49')]);return db['CmHopperBlack'][_0x3421('0x20')]({'where':_0x4ea7b2[_0x3421('0x42')]})['then'](function(_0x52b089){_0x4693dd['count']=_0x52b089;if(_0x594404[_0x3421('0x3a')][_0x3421('0x4a')]){_0x4ea7b2['include']=[{'all':!![]}];}return db[_0x3421('0x69')][_0x3421('0x63')](_0x4ea7b2);})[_0x3421('0x28')](function(_0x2b596b){_0x4693dd[_0x3421('0x4c')]=_0x2b596b;return _0x4693dd;});}})[_0x3421('0x28')](respondWithFilteredResult(_0xadd73a,_0x4ea7b2))[_0x3421('0x4d')](handleError(_0xadd73a,null));};exports['getTeams']=function(_0x224e26,_0x11a0b4,_0x3ce37c){var _0x1e2a67={};var _0x26379d={};var _0x21513f;var _0x5d7002;return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x224e26['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x11a0b4,null))[_0x3421('0x28')](function(_0x25cc13){if(_0x25cc13){_0x21513f=_0x25cc13;_0x26379d[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x6a')][_0x3421('0x50')]);_0x26379d[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x224e26[_0x3421('0x3a')]);_0x26379d['filters']=_[_0x3421('0x3b')](_0x26379d[_0x3421('0x38')],_0x26379d['query']);_0x1e2a67[_0x3421('0x3d')]=_['intersection'](_0x26379d[_0x3421('0x38')],qs['fields'](_0x224e26['query'][_0x3421('0x3c')]));_0x1e2a67[_0x3421('0x3d')]=_0x1e2a67[_0x3421('0x3d')]['length']?_0x1e2a67[_0x3421('0x3d')]:_0x26379d[_0x3421('0x38')];_0x1e2a67[_0x3421('0x40')]=qs['sort'](_0x224e26[_0x3421('0x3a')][_0x3421('0x41')]);_0x1e2a67['where']=qs['filters'](_[_0x3421('0x44')](_0x224e26[_0x3421('0x3a')],_0x26379d[_0x3421('0x43')]));if(_0x224e26[_0x3421('0x3a')][_0x3421('0x2c')]){_0x1e2a67[_0x3421('0x42')]=_['merge'](_0x1e2a67['where'],{'$or':_['map'](_0x1e2a67[_0x3421('0x3d')],function(_0x1b638d){var _0x343110={};_0x343110[_0x1b638d]={'$like':'%'+_0x224e26[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x343110;})});}_0x1e2a67=_['merge']({},_0x1e2a67,_0x224e26[_0x3421('0x49')]);return _0x21513f[_0x3421('0x6b')](_0x1e2a67);}})[_0x3421('0x28')](function(_0x46c15e){if(_0x46c15e){_0x5d7002=_0x46c15e[_0x3421('0x3e')];if(!_0x224e26['query'][_0x3421('0x61')]('nolimit')){_0x1e2a67[_0x3421('0x22')]=qs['limit'](_0x224e26[_0x3421('0x3a')][_0x3421('0x22')]);_0x1e2a67[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x224e26[_0x3421('0x3a')][_0x3421('0x21')]);}return _0x21513f[_0x3421('0x6b')](_0x1e2a67);}})[_0x3421('0x28')](function(_0x4a05a6){if(_0x4a05a6){return _0x4a05a6?{'count':_0x5d7002,'rows':_0x4a05a6}:null;}})[_0x3421('0x28')](respondWithResult(_0x11a0b4,null))['catch'](handleError(_0x11a0b4,null));};exports[_0x3421('0x6c')]=function(_0x31ec58,_0xc5bafd,_0x40d067){var _0x45128a=_0x31ec58['body'][_0x3421('0x6d')];return db[_0x3421('0x6a')]['findAll']({'where':{'id':_['map'](_0x45128a,'id')},'attributes':['id'],'include':[{'model':db[_0x3421('0x6e')],'as':_0x3421('0x6f'),'attributes':['id','name','online',_0x3421('0x70'),'interface'],'raw':!![]}]})[_0x3421('0x28')](function(_0x22c132){if(_0x22c132){var _0x5486c5=_['flatMap'](_0x22c132,function(_0x11e6ae){var _0x183b7e=_0x11e6ae[_0x3421('0x29')]({'plain':!![]});_0x183b7e[_0x3421('0x6f')][_0x3421('0x71')](function(_0xf81bb2){_0xf81bb2[_0x3421('0x72')]=_[_0x3421('0x51')](_0x45128a,{'id':_0x183b7e['id']})['penalty'];});return _0x183b7e[_0x3421('0x6f')];});return db['VoiceQueue'][_0x3421('0x51')]({'where':{'id':_0x31ec58[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](function(_0x2a6cee){return db[_0x3421('0x73')][_0x3421('0x74')](function(_0x858e81){return _0x2a6cee[_0x3421('0x6c')](_[_0x3421('0x2e')](_0x45128a,'id'),{'transaction':_0x858e81})[_0x3421('0x28')](function(){return BPromise[_0x3421('0x75')](_0x5486c5,function(_0x32d757){return db[_0x3421('0x76')][_0x3421('0x77')]({'where':{'UserId':_0x32d757['id'],'VoiceQueueId':_0x31ec58['params']['id']},'defaults':{'penalty':_0x32d757[_0x3421('0x72')]},'transaction':_0x858e81});});})['then'](function(){return BPromise[_0x3421('0x75')](_['filter'](_0x5486c5,{'online':!![]}),function(_0x553f40){return db[_0x3421('0x78')][_0x3421('0x79')]({'membername':_0x553f40[_0x3421('0x34')],'UserId':_0x553f40['id'],'queue_name':_0x2a6cee['name'],'VoiceQueueId':_0x2a6cee['id'],'interface':_[_0x3421('0x7a')](_0x553f40[_0x3421('0x7b')])?util[_0x3421('0x7c')](_0x3421('0x7d'),_0x553f40[_0x3421('0x34')]):_0x553f40[_0x3421('0x7b')],'paused':_0x553f40[_0x3421('0x70')]||![],'penalty':_0x553f40['penalty']},{'transaction':_0x858e81});});})['then'](function(){_0x5486c5['forEach'](function(_0x145b46){socket[_0x3421('0x7e')](_0x3421('0x7f'),{'UserId':_0x145b46['id'],'VoiceQueueId':_0x2a6cee['id']});});});});});}})[_0x3421('0x28')](respondWithStatusCode(_0xc5bafd,null))[_0x3421('0x4d')](handleError(_0xc5bafd,null));};exports[_0x3421('0x80')]=function(_0x3779dd,_0x2096b3,_0x747105){return db[_0x3421('0x6a')][_0x3421('0x63')]({'where':{'id':_0x3779dd[_0x3421('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3421('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2096b3,null))[_0x3421('0x28')](function(_0x353e96){var _0x4b1799=_[_0x3421('0x2e')](_0x353e96,'id');var _0x5a6f2f=[];var _0x550726=[];var _0x1e7cb3=squel[_0x3421('0x81')]();_0x1e7cb3[_0x3421('0x47')](_0x3421('0x82'))[_0x3421('0x83')](_0x3421('0x84'),'tq')[_0x3421('0x85')](_0x3421('0x86'),'ut',_0x3421('0x87'))[_0x3421('0x42')](_0x3421('0x88'),_0x3779dd[_0x3421('0x4f')]['id']);for(var _0x43bd50=0x0;_0x43bd50<_0x353e96['length'];_0x43bd50+=0x1){let _0x1cfb31=_0x353e96[_0x43bd50];for(var _0x4ee6bf=0x0;_0x4ee6bf<_0x1cfb31[_0x3421('0x6f')][_0x3421('0x3e')];_0x4ee6bf+=0x1){let _0x2321e1=_0x1cfb31[_0x3421('0x6f')][_0x4ee6bf];var _0x447164=_0x1e7cb3[_0x3421('0x89')]();_0x447164[_0x3421('0x42')]('ut.UserId\x20=\x20?',_0x2321e1['id']);_0x550726['push'](db[_0x3421('0x73')][_0x3421('0x3a')](_0x447164[_0x3421('0x8a')](),{'type':db['sequelize'][_0x3421('0x8b')][_0x3421('0x8c')]})['then'](function(_0x2b47b7){if(_0x2b47b7[_0x3421('0x3e')]===0x1){return _0x2321e1['id'];}else{var _0x3ccc23=_['every'](_[_0x3421('0x2e')](_0x2b47b7,_0x3421('0x8d')),function(_0x153b87){return _['includes'](_0x4b1799,_0x153b87);});if(_0x3ccc23){return _0x2321e1['id'];}}}));}}return BPromise[_0x3421('0x8e')](_0x550726)[_0x3421('0x28')](function(_0x11a5d9){_0x5a6f2f=_(_0x5a6f2f)['union'](_0x11a5d9)[_0x3421('0x8f')]()['value']();return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x3779dd[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](function(_0x5a00b9){return db[_0x3421('0x73')][_0x3421('0x74')](function(_0x514806){return _0x5a00b9[_0x3421('0x80')](_0x3779dd['query'][_0x3421('0x90')],{'transaction':_0x514806})[_0x3421('0x28')](function(){if(!_[_0x3421('0x91')](_0x5a6f2f)){return _0x5a00b9[_0x3421('0x92')](_0x5a6f2f,{'transaction':_0x514806})[_0x3421('0x28')](function(){return db['UserVoiceQueueRt'][_0x3421('0x93')]({'where':{'VoiceQueueId':_0x3779dd[_0x3421('0x4f')]['id'],'UserId':_0x5a6f2f},'transaction':_0x514806});});}})[_0x3421('0x28')](function(){_0x5a6f2f[_0x3421('0x71')](function(_0x211072){socket[_0x3421('0x7e')](_0x3421('0x94'),{'UserId':_0x211072,'VoiceQueueId':_0x5a00b9['id']});});});});});});})[_0x3421('0x28')](respondWithStatusCode(_0x2096b3,null))[_0x3421('0x4d')](handleError(_0x2096b3,null));};exports[_0x3421('0x95')]=function(_0x11f562,_0x1a5ed4,_0xac9646){var _0x33bca8,_0x406702;return db[_0x3421('0x37')]['find']({'where':{'id':_0x11f562[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x1a5ed4,null))[_0x3421('0x28')](function(_0x24e579){if(_0x24e579){_0x406702=_0x24e579;return _0x24e579['addAgents'](_0x11f562['body'][_0x3421('0x90')],_[_0x3421('0x5b')](_0x11f562[_0x3421('0x5d')],[_0x3421('0x90'),'id'])||{})['spread'](function(_0x181fd7){for(var _0x4772d8=0x0;_0x4772d8<_0x11f562['body'][_0x3421('0x90')][_0x3421('0x3e')];_0x4772d8+=0x1){socket[_0x3421('0x7e')](_0x3421('0x7f'),{'UserId':_0x11f562[_0x3421('0x5d')][_0x3421('0x90')][_0x4772d8],'VoiceQueueId':_0x11f562[_0x3421('0x4f')]['id']});}return _0x181fd7;});}})[_0x3421('0x28')](function(_0x44937a){_0x33bca8=_0x44937a||[];if(_0x406702){return db[_0x3421('0x6e')][_0x3421('0x63')]({'where':{'id':_0x11f562[_0x3421('0x5d')]['ids']},'attributes':['id',_0x3421('0x34'),_0x3421('0x96'),'voicePause',_0x3421('0x7b')],'raw':!![]});}})[_0x3421('0x28')](function(_0x3b51b0){if(!_[_0x3421('0x91')](_0x3b51b0)){var _0x961efd=[];for(var _0x35bd62=0x0;_0x35bd62<_0x3b51b0[_0x3421('0x3e')];_0x35bd62++){if(_0x3b51b0[_0x35bd62][_0x3421('0x96')]){_0x961efd[_0x3421('0x97')](db['UserVoiceQueueRt'][_0x3421('0x79')]({'membername':_0x3b51b0[_0x35bd62][_0x3421('0x34')],'UserId':_0x3b51b0[_0x35bd62]['id'],'queue_name':_0x406702[_0x3421('0x34')],'VoiceQueueId':_0x406702['id'],'interface':_[_0x3421('0x7a')](_0x3b51b0[_0x35bd62][_0x3421('0x7b')])?util[_0x3421('0x7c')](_0x3421('0x7d'),_0x3b51b0[_0x35bd62][_0x3421('0x34')]):_0x3b51b0[_0x35bd62][_0x3421('0x7b')],'paused':_0x3b51b0[_0x35bd62][_0x3421('0x70')]||![],'penalty':_0x11f562[_0x3421('0x5d')]['penalty']||0x0}));}}return BPromise['all'](_0x961efd);}})[_0x3421('0x28')](function(){return _0x33bca8;})[_0x3421('0x28')](respondWithResult(_0x1a5ed4,null))[_0x3421('0x4d')](handleError(_0x1a5ed4,null));};exports[_0x3421('0x92')]=function(_0x35daa1,_0x48416a,_0x9b98b8){return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x35daa1[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x48416a,null))['then'](function(_0x7091ba){if(_0x7091ba){return _0x7091ba[_0x3421('0x92')](_0x35daa1[_0x3421('0x3a')]['ids'])[_0x3421('0x28')](function(){if(_['isArray'](_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')])){for(var _0x1f1230=0x0;_0x1f1230<_0x35daa1[_0x3421('0x3a')]['ids'][_0x3421('0x3e')];_0x1f1230+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')][_0x1f1230]),'VoiceQueueId':Number(_0x35daa1[_0x3421('0x4f')]['id'])});}}else{socket['emit'](_0x3421('0x94'),{'UserId':Number(_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')]),'VoiceQueueId':Number(_0x35daa1['params']['id'])});}});}})[_0x3421('0x28')](function(_0x45606b){return db[_0x3421('0x78')][_0x3421('0x93')]({'where':{'VoiceQueueId':_0x35daa1[_0x3421('0x4f')]['id'],'UserId':_0x35daa1[_0x3421('0x3a')]['ids']}})[_0x3421('0x28')](function(){return _0x45606b;});})[_0x3421('0x28')](respondWithStatusCode(_0x48416a,null))[_0x3421('0x4d')](handleError(_0x48416a,null));};exports[_0x3421('0x98')]=function(_0xe4e968,_0x2fbf37,_0xf2da27){var _0x54f2eb={};var _0x5cdd55={};var _0x101d62;var _0x723738;return db[_0x3421('0x37')]['findOne']({'where':{'id':_0xe4e968[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x2fbf37,null))[_0x3421('0x28')](function(_0x225990){if(_0x225990){_0x101d62=_0x225990;_0x5cdd55['model']=_[_0x3421('0x39')](db[_0x3421('0x6e')][_0x3421('0x50')]);_0x5cdd55[_0x3421('0x3a')]=_['keys'](_0xe4e968[_0x3421('0x3a')]);_0x5cdd55[_0x3421('0x43')]=_['intersection'](_0x5cdd55[_0x3421('0x38')],_0x5cdd55['query']);_0x54f2eb['attributes']=_[_0x3421('0x3b')](_0x5cdd55[_0x3421('0x38')],qs['fields'](_0xe4e968[_0x3421('0x3a')]['fields']));_0x54f2eb[_0x3421('0x3d')]=_0x54f2eb['attributes'][_0x3421('0x3e')]?_0x54f2eb['attributes']:_0x5cdd55[_0x3421('0x38')];_0x54f2eb[_0x3421('0x40')]=qs[_0x3421('0x41')](_0xe4e968[_0x3421('0x3a')][_0x3421('0x41')]);_0x54f2eb[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xe4e968['query'],_0x5cdd55[_0x3421('0x43')]));if(_0xe4e968['query'][_0x3421('0x2c')]){_0x54f2eb[_0x3421('0x42')]=_[_0x3421('0x48')](_0x54f2eb[_0x3421('0x42')],{'$or':_['map'](_0x54f2eb[_0x3421('0x3d')],function(_0x4c1b9a){var _0x43c4aa={};_0x43c4aa[_0x4c1b9a]={'$like':'%'+_0xe4e968[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x43c4aa;})});}_0x54f2eb=_[_0x3421('0x48')]({},_0x54f2eb,_0xe4e968[_0x3421('0x49')]);return _0x101d62['getAgents'](_0x54f2eb);}})[_0x3421('0x28')](function(_0x3e6886){if(_0x3e6886){_0x723738=_0x3e6886[_0x3421('0x3e')];if(!_0xe4e968['query'][_0x3421('0x61')](_0x3421('0x3f'))){_0x54f2eb['limit']=qs[_0x3421('0x22')](_0xe4e968['query'][_0x3421('0x22')]);_0x54f2eb[_0x3421('0x21')]=qs[_0x3421('0x21')](_0xe4e968[_0x3421('0x3a')]['offset']);}return _0x101d62[_0x3421('0x98')](_0x54f2eb);}})['then'](function(_0xc098c7){if(_0xc098c7){return _0xc098c7?{'count':_0x723738,'rows':_0xc098c7}:null;}})[_0x3421('0x28')](respondWithResult(_0x2fbf37,null))[_0x3421('0x4d')](handleError(_0x2fbf37,null));};exports[_0x3421('0x99')]=function(_0xbc4725,_0xb40b25,_0x291a77){var _0x31b107={};var _0x1ed3f9={};var _0x85386a;var _0x4f3236;return db['VoiceQueue']['findOne']({'where':{'id':_0xbc4725[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0xb40b25,null))['then'](function(_0x4c4d9c){if(_0x4c4d9c){_0x85386a=_0x4c4d9c;_0x1ed3f9['model']=_[_0x3421('0x39')](db[_0x3421('0x78')][_0x3421('0x50')]);_0x1ed3f9['query']=_[_0x3421('0x39')](_0xbc4725['query']);_0x1ed3f9[_0x3421('0x43')]=_[_0x3421('0x3b')](_0x1ed3f9['model'],_0x1ed3f9['query']);_0x31b107[_0x3421('0x3d')]=_['intersection'](_0x1ed3f9[_0x3421('0x38')],qs[_0x3421('0x3c')](_0xbc4725[_0x3421('0x3a')][_0x3421('0x3c')]));_0x31b107[_0x3421('0x3d')]=_0x31b107['attributes']['length']?_0x31b107[_0x3421('0x3d')]:_0x1ed3f9['model'];_0x31b107['order']=qs[_0x3421('0x41')](_0xbc4725[_0x3421('0x3a')][_0x3421('0x41')]);_0x31b107[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xbc4725[_0x3421('0x3a')],_0x1ed3f9[_0x3421('0x43')]));if(_0xbc4725['query'][_0x3421('0x2c')]){_0x31b107[_0x3421('0x42')]=_['merge'](_0x31b107[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x31b107[_0x3421('0x3d')],function(_0x2b819d){var _0x418906={};_0x418906[_0x2b819d]={'$like':'%'+_0xbc4725[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x418906;})});}_0x31b107=_[_0x3421('0x48')]({},_0x31b107,_0xbc4725['options']);return _0x85386a[_0x3421('0x99')](_0x31b107);}})[_0x3421('0x28')](function(_0x4701a0){if(_0x4701a0){_0x4f3236=_0x4701a0[_0x3421('0x3e')];if(!_0xbc4725[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x31b107[_0x3421('0x22')]=qs[_0x3421('0x22')](_0xbc4725[_0x3421('0x3a')]['limit']);_0x31b107[_0x3421('0x21')]=qs[_0x3421('0x21')](_0xbc4725['query']['offset']);}return _0x85386a[_0x3421('0x99')](_0x31b107);}})[_0x3421('0x28')](function(_0x3d2ff1){return _0x3d2ff1?{'count':_0x4f3236,'rows':_0x3d2ff1}:null;})[_0x3421('0x28')](respondWithResult(_0xb40b25,null))[_0x3421('0x4d')](handleError(_0xb40b25,null));};exports[_0x3421('0x9a')]=function(_0x439d82,_0x4ff438,_0x3a3d37){var _0x28e11e={};var _0x9997c0={};var _0x5a09e1;var _0x591f4a;return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x439d82[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x4ff438,null))[_0x3421('0x28')](function(_0x45f97b){if(_0x45f97b){_0x5a09e1=_0x45f97b;_0x9997c0['model']=_[_0x3421('0x39')](db[_0x3421('0x9b')][_0x3421('0x50')]);_0x9997c0[_0x3421('0x3a')]=_['keys'](_0x439d82[_0x3421('0x3a')]);_0x9997c0[_0x3421('0x43')]=_['intersection'](_0x9997c0[_0x3421('0x38')],_0x9997c0[_0x3421('0x3a')]);_0x28e11e['attributes']=_[_0x3421('0x3b')](_0x9997c0[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x439d82[_0x3421('0x3a')][_0x3421('0x3c')]));_0x28e11e['attributes']=_0x28e11e['attributes'][_0x3421('0x3e')]?_0x28e11e[_0x3421('0x3d')]:_0x9997c0[_0x3421('0x38')];_0x28e11e[_0x3421('0x40')]=qs['sort'](_0x439d82['query'][_0x3421('0x41')]);_0x28e11e[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x439d82[_0x3421('0x3a')],_0x9997c0['filters']));if(_0x439d82[_0x3421('0x3a')][_0x3421('0x2c')]){_0x28e11e[_0x3421('0x42')]=_[_0x3421('0x48')](_0x28e11e[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x28e11e[_0x3421('0x3d')],function(_0x4276e0){var _0x363b79={};_0x363b79[_0x4276e0]={'$like':'%'+_0x439d82[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x363b79;})});}_0x28e11e=_['merge']({},_0x28e11e,_0x439d82[_0x3421('0x49')]);return _0x5a09e1['getLists'](_0x28e11e);}})[_0x3421('0x28')](function(_0x39f60c){if(_0x39f60c){_0x591f4a=_0x39f60c[_0x3421('0x3e')];if(!_0x439d82[_0x3421('0x3a')][_0x3421('0x61')]('nolimit')){_0x28e11e[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x439d82[_0x3421('0x3a')]['limit']);_0x28e11e[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x439d82[_0x3421('0x3a')][_0x3421('0x21')]);}return _0x5a09e1['getLists'](_0x28e11e);}})[_0x3421('0x28')](function(_0x5a8ac2){if(_0x5a8ac2){return _0x5a8ac2?{'count':_0x591f4a,'rows':_0x5a8ac2}:null;}})['then'](respondWithResult(_0x4ff438,null))['catch'](handleError(_0x4ff438,null));};exports[_0x3421('0x9c')]=function(_0x210bd1,_0x3b70c7,_0x90106c){var _0x29ab38,_0x21a250;return db['VoiceQueue'][_0x3421('0x51')]({'where':{'id':_0x210bd1['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x3b70c7,null))[_0x3421('0x28')](function(_0x34eb81){if(_0x34eb81){_0x21a250=_0x34eb81;return _0x34eb81[_0x3421('0x9c')](_0x210bd1[_0x3421('0x5d')][_0x3421('0x90')],_['omit'](_0x210bd1[_0x3421('0x5d')],['ids','id'])||{});}return null;})[_0x3421('0x9d')](function(_0x3e0a2a){var _0x15fc97;_0x29ab38=_0x3e0a2a||[];var _0x4859d1=[];if(_0x3e0a2a){for(var _0x704898=0x0;_0x704898<_0x3e0a2a[_0x3421('0x3e')];_0x704898+=0x1){var _0x74d856=_0x3e0a2a[_0x704898][_0x3421('0x29')]({'plain':!![]});_0x21a250[_0x3421('0x9e')]=_0x210bd1[_0x3421('0x5d')][_0x3421('0x9e')]?_0x210bd1[_0x3421('0x5d')]['dialCheckDuplicateType']:_0x21a250[_0x3421('0x9e')];switch(_0x21a250[_0x3421('0x9e')]){case _0x3421('0x9f'):_0x15fc97=squel['insert']()[_0x3421('0xa0')](_0x3421('0xa1'))['fromQuery']([_0x3421('0xa2'),_0x3421('0xa3'),'ContactId',_0x3421('0xa4'),_0x3421('0x62'),_0x3421('0xa5'),_0x3421('0x5c')],squel[_0x3421('0x81')]()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),'scheduledAt')[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856['CmListId']['toString'](),_0x3421('0xa4'))[_0x3421('0x47')](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),'VoiceQueueId')[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0x5c'))[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))['where'](_0x3421('0xaa'),_0x74d856[_0x3421('0xab')][_0x3421('0x8a')]())[_0x3421('0x42')](_0x3421('0xac'))[_0x3421('0x42')](_0x3421('0xad'),squel[_0x3421('0x81')]()['field'](_0x3421('0xae'))[_0x3421('0x83')](_0x3421('0xaf'))[_0x3421('0x42')](_0x3421('0x88'),_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]()))[_0x3421('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3421('0x81')]()['field'](_0x3421('0xb0'))[_0x3421('0x83')]('cm_hopper')[_0x3421('0x42')](_0x3421('0x88'),_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]())))[_0x3421('0x8a')]();break;case _0x3421('0xb1'):_0x15fc97=squel[_0x3421('0xb2')]()['into'](_0x3421('0xa1'))[_0x3421('0xb3')]([_0x3421('0xa2'),_0x3421('0xa3'),_0x3421('0xa7'),_0x3421('0xa4'),'VoiceQueueId',_0x3421('0xa5'),_0x3421('0x5c')],squel['select']()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa3'))[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856[_0x3421('0xab')][_0x3421('0x8a')](),_0x3421('0xa4'))['field'](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0x5c'))['from']('cm_contacts')[_0x3421('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x74d856[_0x3421('0xab')]['toString']())[_0x3421('0x42')](_0x3421('0xac'))[_0x3421('0x42')](_0x3421('0xad'),squel['select']()[_0x3421('0x47')](_0x3421('0xb0'))[_0x3421('0x83')](_0x3421('0xa1'))[_0x3421('0x42')]('VoiceQueueId\x20=\x20?',_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]())))['toString']();break;default:_0x15fc97=squel[_0x3421('0xb2')]()[_0x3421('0xa0')](_0x3421('0xa1'))[_0x3421('0xb3')]([_0x3421('0xa2'),_0x3421('0xa3'),'ContactId',_0x3421('0xa4'),_0x3421('0x62'),_0x3421('0xa5'),_0x3421('0x5c')],squel[_0x3421('0x81')]()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa3'))[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856[_0x3421('0xab')][_0x3421('0x8a')](),_0x3421('0xa4'))[_0x3421('0x47')](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')]('NOW()',_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),'updatedAt')[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))[_0x3421('0x42')](_0x3421('0xaa'),_0x74d856[_0x3421('0xab')]['toString']())[_0x3421('0x42')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4859d1[_0x3421('0x97')](db['sequelize']['query'](_0x15fc97));}return BPromise[_0x3421('0x8e')](_0x4859d1);}})[_0x3421('0x28')](function(){return _0x29ab38;})['then'](respondWithResult(_0x3b70c7,null))[_0x3421('0x4d')](handleError(_0x3b70c7,null));};exports[_0x3421('0xb4')]=function(_0x568356,_0x5f4b12,_0x1e5c94){return db[_0x3421('0x37')]['find']({'where':{'id':_0x568356['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x5f4b12,null))[_0x3421('0x28')](function(_0x4dcb14){if(_0x4dcb14){return _0x4dcb14[_0x3421('0xb4')](_0x568356['query'][_0x3421('0x90')]);}})[_0x3421('0x28')](function(_0x55716e){if(_0x55716e){return db[_0x3421('0x60')][_0x3421('0x93')]({'where':{'ListId':_0x568356['query']['ids'],'VoiceQueueId':_0x568356[_0x3421('0x4f')]['id']}})['then'](function(){return _0x55716e;});}})['then'](respondWithStatusCode(_0x5f4b12,null))[_0x3421('0x4d')](handleError(_0x5f4b12,null));};exports[_0x3421('0xb5')]=function(_0xd0440c,_0x12d791,_0x160660){var _0x14de59={};var _0x17a098={};var _0xc6ab5a;var _0x36cea3;return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0xd0440c['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x12d791,null))[_0x3421('0x28')](function(_0x15d027){if(_0x15d027){_0xc6ab5a=_0x15d027;_0x17a098[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmList'][_0x3421('0x50')]);_0x17a098['query']=_[_0x3421('0x39')](_0xd0440c[_0x3421('0x3a')]);_0x17a098['filters']=_[_0x3421('0x3b')](_0x17a098[_0x3421('0x38')],_0x17a098[_0x3421('0x3a')]);_0x14de59[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x17a098['model'],qs[_0x3421('0x3c')](_0xd0440c[_0x3421('0x3a')][_0x3421('0x3c')]));_0x14de59['attributes']=_0x14de59[_0x3421('0x3d')]['length']?_0x14de59[_0x3421('0x3d')]:_0x17a098['model'];_0x14de59['order']=qs[_0x3421('0x41')](_0xd0440c['query'][_0x3421('0x41')]);_0x14de59[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xd0440c['query'],_0x17a098['filters']));if(_0xd0440c['query'][_0x3421('0x2c')]){_0x14de59[_0x3421('0x42')]=_[_0x3421('0x48')](_0x14de59['where'],{'$or':_[_0x3421('0x2e')](_0x14de59[_0x3421('0x3d')],function(_0xad550b){var _0x34dde2={};_0x34dde2[_0xad550b]={'$like':'%'+_0xd0440c['query']['filter']+'%'};return _0x34dde2;})});}_0x14de59=_[_0x3421('0x48')]({},_0x14de59,_0xd0440c['options']);return _0xc6ab5a[_0x3421('0xb5')](_0x14de59);}})['then'](function(_0x4c6cf2){if(_0x4c6cf2){_0x36cea3=_0x4c6cf2[_0x3421('0x3e')];if(!_0xd0440c[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x14de59[_0x3421('0x22')]=qs['limit'](_0xd0440c[_0x3421('0x3a')]['limit']);_0x14de59['offset']=qs[_0x3421('0x21')](_0xd0440c[_0x3421('0x3a')][_0x3421('0x21')]);}return _0xc6ab5a[_0x3421('0xb5')](_0x14de59);}})[_0x3421('0x28')](function(_0x867fb7){if(_0x867fb7){return _0x867fb7?{'count':_0x36cea3,'rows':_0x867fb7}:null;}})[_0x3421('0x28')](respondWithResult(_0x12d791,null))['catch'](handleError(_0x12d791,null));};exports[_0x3421('0xb6')]=function(_0x408ff7,_0x407e33,_0x424180){var _0x476c1d,_0x20144b;return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x408ff7['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x407e33,null))['then'](function(_0x530df4){if(_0x530df4){_0x20144b=_0x530df4;return _0x530df4[_0x3421('0xb6')](_0x408ff7[_0x3421('0x5d')][_0x3421('0x90')],_[_0x3421('0x5b')](_0x408ff7['body'],['ids','id'])||{});}return null;})[_0x3421('0x9d')](function(_0x1ab60d){var _0x548600;_0x476c1d=_0x1ab60d||[];var _0x435c48=[];if(_0x1ab60d){for(var _0x166464=0x0;_0x166464<_0x1ab60d[_0x3421('0x3e')];_0x166464+=0x1){var _0x3e7313=_0x1ab60d[_0x166464][_0x3421('0x29')]({'plain':!![]});_0x548600=squel[_0x3421('0xb2')]()[_0x3421('0xa0')]('cm_hopper_black')['fromQuery']([_0x3421('0xa2'),_0x3421('0xa7'),'ListId',_0x3421('0x62'),'createdAt','updatedAt'],squel['select']()[_0x3421('0x47')]('phone','phone')['field']('id',_0x3421('0xa7'))['field'](_0x3e7313['CmListId'][_0x3421('0x8a')](),_0x3421('0xa4'))[_0x3421('0x47')](_0x408ff7[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')](_0x3421('0xa6'),'createdAt')['field'](_0x3421('0xa6'),_0x3421('0x5c'))[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))[_0x3421('0x42')](_0x3421('0xaa'),_0x3e7313[_0x3421('0xab')][_0x3421('0x8a')]())[_0x3421('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x3421('0x8a')]();_0x435c48[_0x3421('0x97')](db[_0x3421('0x73')][_0x3421('0x3a')](_0x548600));}return BPromise[_0x3421('0x8e')](_0x435c48);}})[_0x3421('0x28')](function(){return _0x476c1d;})['then'](respondWithResult(_0x407e33,null))[_0x3421('0x4d')](handleError(_0x407e33,null));};exports[_0x3421('0xb7')]=function(_0x3406e4,_0x230890,_0x2c85f0){return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x3406e4['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x230890,null))[_0x3421('0x28')](function(_0xdc6baa){if(_0xdc6baa){return _0xdc6baa[_0x3421('0xb7')](_0x3406e4[_0x3421('0x3a')][_0x3421('0x90')]);}})[_0x3421('0x28')](function(_0x5e4498){if(_0x5e4498){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3406e4[_0x3421('0x3a')]['ids'],'VoiceQueueId':_0x3406e4['params']['id']}})[_0x3421('0x28')](function(){return _0x5e4498;});}})[_0x3421('0x28')](respondWithStatusCode(_0x230890,null))[_0x3421('0x4d')](handleError(_0x230890,null));}; \ No newline at end of file +var _0x9ffd=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','update','then','inbound','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','merge','where','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','QueueCampaigns','autoAssociation','findOne','CmHopper','hasOwnProperty','pick','map','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','team_has_voice_queues','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','removeAgents','addAgents','spread','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x306989,_0x1a986e){var _0xaab1bf=function(_0x308e6d){while(--_0x308e6d){_0x306989['push'](_0x306989['shift']());}};_0xaab1bf(++_0x1a986e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5ac992,_0x3e25b3){_0x5ac992=_0x5ac992-0x0;var _0x536470=_0x9ffd[_0x5ac992];return _0x536470;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');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('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd9ff('0x11'));var logger=require(_0xd9ff('0x12'))(_0xd9ff('0x13'));var utils=require(_0xd9ff('0x14'));var config=require(_0xd9ff('0x15'));var db=require(_0xd9ff('0x16'))['db'];config[_0xd9ff('0x17')]=_[_0xd9ff('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd9ff('0x19'))(new Redis(config[_0xd9ff('0x17')]));require(_0xd9ff('0x1a'))[_0xd9ff('0x1b')](socket);function respondWithStatusCode(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xcc;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1c')](_0x556aa4);}return _0x12c39a['status'](_0x556aa4)[_0xd9ff('0x1d')]();};}function respondWithResult(_0x5db010,_0x4ffe54){_0x4ffe54=_0x4ffe54||0xc8;return function(_0x547e28){if(_0x547e28){return _0x5db010['status'](_0x4ffe54)[_0xd9ff('0x1e')](_0x547e28);}};}function respondWithFilteredResult(_0x4f9d6d,_0x35679e){return function(_0xa30fd2){if(_0xa30fd2){var _0x39c6ce=_0xa30fd2[_0xd9ff('0x1f')],_0x3afd19=_0x35679e[_0xd9ff('0x20')],_0x5f45c4=_0x35679e[_0xd9ff('0x20')]+_0x35679e[_0xd9ff('0x21')],_0x2d4df1;if(_0x5f45c4>=_0x39c6ce){_0x5f45c4=_0x39c6ce;_0x2d4df1=0xc8;}else{_0x2d4df1=0xce;}_0x4f9d6d[_0xd9ff('0x22')](_0x2d4df1);return _0x4f9d6d[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x3afd19+'-'+_0x5f45c4+'/'+_0x39c6ce)['json'](_0xa30fd2);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x25')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x26')](_0x4b1477)[_0xd9ff('0x27')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){var _0x1136e9=_0x42a828['get']({'plain':!![]});var _0x3ca906=[{'name':'VoiceQueues','value':_0xd9ff('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xd9ff('0x29'),'ignore':![]}];var _0x159e56=_(_0x3ca906)[_0xd9ff('0x2a')](_0xd9ff('0x2b'))['map'](_0xd9ff('0x2c'))[_0xd9ff('0x2c')]();if(_[_0xd9ff('0x2d')](_0x159e56,_0x1136e9[_0xd9ff('0x2e')])){return;}var _0x5c1c1f=_[_0xd9ff('0x2f')](_0x3ca906,[_0xd9ff('0x2c'),_0x1136e9[_0xd9ff('0x2e')]])[_0xd9ff('0x30')];return db[_0xd9ff('0x31')][_0xd9ff('0x32')]({'where':{'type':_0x5c1c1f,'resourceId':_0x1136e9['id']}})[_0xd9ff('0x27')](function(){return _0x42a828;});})[_0xd9ff('0x27')](function(){_0x9f074e[_0xd9ff('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcea5db,_0x4ba2be){return function(_0x1d55fd){if(!_0x1d55fd){_0xcea5db[_0xd9ff('0x1c')](0x194);}return _0x1d55fd;};}function handleError(_0xbdd352,_0x552d08){_0x552d08=_0x552d08||0x1f4;return function(_0x2ba4d3){logger[_0xd9ff('0x33')](_0x2ba4d3[_0xd9ff('0x34')]);if(_0x2ba4d3[_0xd9ff('0x30')]){delete _0x2ba4d3['name'];}_0xbdd352[_0xd9ff('0x22')](_0x552d08)['send'](_0x2ba4d3);};}exports[_0xd9ff('0x35')]=function(_0x2419f5,_0x323cb5){var _0x206424={},_0x20685b={},_0xdf3947={'count':0x0,'rows':[]};var _0x2cc2ae=db[_0xd9ff('0x36')][_0xd9ff('0x37')];_0x20685b[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](_0x2cc2ae);_0x20685b[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x2419f5[_0xd9ff('0x3a')]);_0x20685b['filters']=_[_0xd9ff('0x3b')](_0x20685b[_0xd9ff('0x38')],_0x20685b[_0xd9ff('0x3a')]);_0x206424['attributes']=_[_0xd9ff('0x3b')](_0x20685b['model'],qs[_0xd9ff('0x3c')](_0x2419f5['query'][_0xd9ff('0x3c')]));_0x206424['attributes']=_0x206424[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x206424[_0xd9ff('0x3d')]:_0x20685b['model'];if(!_0x2419f5['query']['hasOwnProperty'](_0xd9ff('0x3f'))){_0x206424[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x206424[_0xd9ff('0x20')]=qs['offset'](_0x2419f5['query']['offset']);}_0x206424[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x206424['where']=qs[_0xd9ff('0x42')](_['pick'](_0x2419f5[_0xd9ff('0x3a')],_0x20685b[_0xd9ff('0x42')]));if(_0x2419f5[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x206424['where']=_[_0xd9ff('0x43')](_0x206424[_0xd9ff('0x44')],{'$or':_['map'](_0x2cc2ae,function(_0x459215){if(_0x459215[_0xd9ff('0x2e')][_0xd9ff('0x45')]!==_0xd9ff('0x46')){var _0x1fe44d={};_0x1fe44d[_0x459215[_0xd9ff('0x47')]]={'$like':'%'+_0x2419f5['query'][_0xd9ff('0x2a')]+'%'};return _0x1fe44d;}})});}_0x206424=_[_0xd9ff('0x43')]({},_0x206424,_0x2419f5[_0xd9ff('0x48')]);var _0x39fbbb={'where':_0x206424[_0xd9ff('0x44')]};return db['VoiceQueue'][_0xd9ff('0x1f')](_0x39fbbb)[_0xd9ff('0x27')](function(_0xe0bc49){_0xdf3947['count']=_0xe0bc49;if(_0x2419f5['query'][_0xd9ff('0x49')]){_0x206424[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x36')][_0xd9ff('0x4b')](_0x206424);})[_0xd9ff('0x27')](function(_0x30c69d){_0xdf3947['rows']=_0x30c69d;return _0xdf3947;})[_0xd9ff('0x27')](respondWithFilteredResult(_0x323cb5,_0x206424))[_0xd9ff('0x4c')](handleError(_0x323cb5,null));};exports['show']=function(_0x1c6e88,_0x45a05e){var _0x13a1ec={'raw':![],'where':{'id':_0x1c6e88[_0xd9ff('0x4d')]['id']}},_0x477432={};_0x477432['model']=_['keys'](db['VoiceQueue'][_0xd9ff('0x37')]);_0x477432['query']=_[_0xd9ff('0x39')](_0x1c6e88[_0xd9ff('0x3a')]);_0x477432[_0xd9ff('0x42')]=_['intersection'](_0x477432[_0xd9ff('0x38')],_0x477432[_0xd9ff('0x3a')]);_0x13a1ec['attributes']=_[_0xd9ff('0x3b')](_0x477432[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x1c6e88[_0xd9ff('0x3a')]['fields']));_0x13a1ec[_0xd9ff('0x3d')]=_0x13a1ec['attributes'][_0xd9ff('0x3e')]?_0x13a1ec['attributes']:_0x477432[_0xd9ff('0x38')];if(_0x1c6e88[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x13a1ec[_0xd9ff('0x4a')]=[{'all':!![]}];}_0x13a1ec=_[_0xd9ff('0x43')]({},_0x13a1ec,_0x1c6e88['options']);return db[_0xd9ff('0x36')][_0xd9ff('0x2f')](_0x13a1ec)[_0xd9ff('0x27')](handleEntityNotFound(_0x45a05e,null))[_0xd9ff('0x27')](respondWithResult(_0x45a05e,null))['catch'](handleError(_0x45a05e,null));};exports['create']=function(_0x4c22dc,_0x7399a5){return db[_0xd9ff('0x36')][_0xd9ff('0x4e')](_0x4c22dc['body'],{})[_0xd9ff('0x27')](function(_0x61eec4){var _0x6d1082=_0x4c22dc[_0xd9ff('0x4f')][_0xd9ff('0x50')]({'plain':!![]});if(!_0x6d1082)throw new Error(_0xd9ff('0x51'));if(_0x6d1082[_0xd9ff('0x52')]===_0xd9ff('0x4f')){var _0x1ad160=_0x61eec4[_0xd9ff('0x50')]({'plain':!![]});var _0x5dcb5=[{'name':_0xd9ff('0x53'),'value':_0xd9ff('0x28')},{'name':'QueueCampaigns','value':_0xd9ff('0x29')}];var _0x4ccf41=_[_0xd9ff('0x2f')](_0x5dcb5,['value',_0x1ad160[_0xd9ff('0x2e')]])['name'];return db[_0xd9ff('0x54')]['find']({'where':{'name':_0x4ccf41,'userProfileId':_0x6d1082[_0xd9ff('0x55')]},'raw':!![]})['then'](function(_0x3fbeda){if(_0x3fbeda&&_0x3fbeda['autoAssociation']===0x0){return db[_0xd9ff('0x31')]['create']({'name':_0x1ad160[_0xd9ff('0x30')],'resourceId':_0x1ad160['id'],'type':_0x3fbeda[_0xd9ff('0x30')],'sectionId':_0x3fbeda['id']},{})[_0xd9ff('0x27')](function(){return _0x61eec4;});}else{return _0x61eec4;}})[_0xd9ff('0x4c')](function(_0x4df17b){logger[_0xd9ff('0x33')](_0xd9ff('0x56'),_0x4df17b);throw _0x4df17b;});}return _0x61eec4;})[_0xd9ff('0x27')](respondWithResult(_0x7399a5,0xc9))['catch'](handleError(_0x7399a5,null));};exports[_0xd9ff('0x57')]=function(_0x32e1b9,_0x19b033){var _0x2e29aa={'raw':![],'where':{'id':_0x32e1b9['params']['id']}},_0x11dd0c={};_0x11dd0c[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x36')][_0xd9ff('0x37')]);_0x2e29aa[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x11dd0c[_0xd9ff('0x38')],qs['fields'](_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x2e29aa['attributes']=_0x2e29aa[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x2e29aa['attributes']:_0x11dd0c[_0xd9ff('0x38')];if(_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x2e29aa['include']=[{'all':!![]}];}_0x2e29aa=_['merge']({},_0x2e29aa,_0x32e1b9[_0xd9ff('0x48')]);return db['VoiceQueue'][_0xd9ff('0x2f')](_0x2e29aa)[_0xd9ff('0x27')](handleEntityNotFound(_0x19b033,null))[_0xd9ff('0x27')](function(_0x102aea){if(_0x102aea){var _0x53a230=_0x102aea['get']({'plain':!![]});_0x53a230=qs['omit'](_0x53a230,['id',_0xd9ff('0x58'),_0xd9ff('0x59')]);_0x32e1b9[_0xd9ff('0x5a')]=_[_0xd9ff('0x5b')](_0x32e1b9[_0xd9ff('0x5a')],['id','createdAt',_0xd9ff('0x59')]);return db['VoiceQueue'][_0xd9ff('0x4e')](_[_0xd9ff('0x43')](_0x53a230,_0x32e1b9[_0xd9ff('0x5a')]),{'include':_0x32e1b9[_0xd9ff('0x3a')][_0xd9ff('0x49')]?[{'all':!![]}]:undefined})[_0xd9ff('0x27')](function(_0xed12df){var _0xfcafbe=_0x32e1b9['user'][_0xd9ff('0x50')]({'plain':!![]});if(!_0xfcafbe)throw new Error(_0xd9ff('0x51'));if(_0xfcafbe['role']==='user'){var _0x3e8766=_0xed12df['get']({'plain':!![]});var _0x1c968f=[{'name':_0xd9ff('0x53'),'value':'inbound'},{'name':_0xd9ff('0x5c'),'value':_0xd9ff('0x29')}];var _0x54aca7=_[_0xd9ff('0x2f')](_0x1c968f,[_0xd9ff('0x2c'),_0x3e8766['type']])[_0xd9ff('0x30')];return db['UserProfileSection']['find']({'where':{'name':_0x54aca7,'userProfileId':_0xfcafbe[_0xd9ff('0x55')]},'raw':!![]})[_0xd9ff('0x27')](function(_0x1a08a9){if(_0x1a08a9&&_0x1a08a9[_0xd9ff('0x5d')]===0x0){return db['UserProfileResource'][_0xd9ff('0x4e')]({'name':_0x3e8766[_0xd9ff('0x30')],'resourceId':_0x3e8766['id'],'type':_0x1a08a9[_0xd9ff('0x30')],'sectionId':_0x1a08a9['id']},{})[_0xd9ff('0x27')](function(){return _0xed12df;});}else{return _0xed12df;}})[_0xd9ff('0x4c')](function(_0x255edf){logger[_0xd9ff('0x33')](_0xd9ff('0x56'),_0x255edf);throw _0x255edf;});}return _0xed12df;});}})['then'](respondWithResult(_0x19b033,0xc9))['catch'](handleError(_0x19b033,null));};exports['update']=function(_0x275fb9,_0x31db27){if(_0x275fb9['body']['id']){delete _0x275fb9[_0xd9ff('0x5a')]['id'];}return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x275fb9[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x27')](saveUpdates(_0x275fb9[_0xd9ff('0x5a')],null))[_0xd9ff('0x27')](respondWithResult(_0x31db27,null))['catch'](handleError(_0x31db27,null));};exports[_0xd9ff('0x32')]=function(_0x1ef766,_0x228413){return db['VoiceQueue'][_0xd9ff('0x2f')]({'where':{'id':_0x1ef766['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x228413,null))[_0xd9ff('0x27')](removeEntity(_0x228413,null))[_0xd9ff('0x4c')](handleError(_0x228413,null));};exports['getHoppers']=function(_0x24f1a2,_0xc94fb0,_0x4222e8){var _0x1cd620={'raw':![],'where':{}};var _0x56a74c={};var _0x29b8cd={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x24f1a2['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0xc94fb0,null))[_0xd9ff('0x27')](function(_0x2619c9){if(_0x2619c9){_0x56a74c['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0x5f')][_0xd9ff('0x37')]);_0x56a74c[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x24f1a2['query']);_0x56a74c[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x56a74c['model'],_0x56a74c[_0xd9ff('0x3a')]);_0x1cd620[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x56a74c['model'],qs[_0xd9ff('0x3c')](_0x24f1a2['query'][_0xd9ff('0x3c')]));_0x1cd620['attributes']=_0x1cd620[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x1cd620[_0xd9ff('0x3d')]:_0x56a74c[_0xd9ff('0x38')];if(!_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x1cd620[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x24f1a2[_0xd9ff('0x3a')]['limit']);_0x1cd620[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}_0x1cd620[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x24f1a2['query']['sort']);_0x1cd620[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x24f1a2[_0xd9ff('0x3a')],_0x56a74c[_0xd9ff('0x42')]));_0x1cd620[_0xd9ff('0x44')]['VoiceQueueId']=_0x2619c9['id'];if(_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x1cd620[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x1cd620[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x1cd620['attributes'],function(_0x124214){var _0x3aef79={};_0x3aef79[_0x124214]={'$like':'%'+_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x3aef79;})});}_0x1cd620=_[_0xd9ff('0x43')]({},_0x1cd620,_0x24f1a2[_0xd9ff('0x48')]);return db[_0xd9ff('0x5f')][_0xd9ff('0x1f')]({'where':_0x1cd620['where']})[_0xd9ff('0x27')](function(_0x4c2ad5){_0x29b8cd[_0xd9ff('0x1f')]=_0x4c2ad5;if(_0x24f1a2[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x1cd620[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x5f')][_0xd9ff('0x4b')](_0x1cd620);})[_0xd9ff('0x27')](function(_0x2b66f6){_0x29b8cd[_0xd9ff('0x63')]=_0x2b66f6;return _0x29b8cd;});}})[_0xd9ff('0x27')](respondWithFilteredResult(_0xc94fb0,_0x1cd620))[_0xd9ff('0x4c')](handleError(_0xc94fb0,null));};exports[_0xd9ff('0x64')]=function(_0xa908a3,_0x5d29b9,_0x4413c4){var _0x3d5742={'raw':!![],'where':{}};var _0x191786={};var _0x19ecf3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0xa908a3[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d29b9,null))[_0xd9ff('0x27')](function(_0x1afdd4){if(_0x1afdd4){_0x191786[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x65')][_0xd9ff('0x37')]);_0x191786[_0xd9ff('0x3a')]=_['keys'](_0xa908a3[_0xd9ff('0x3a')]);_0x191786['filters']=_[_0xd9ff('0x3b')](_0x191786[_0xd9ff('0x38')],_0x191786[_0xd9ff('0x3a')]);_0x3d5742[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x191786[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x3d5742[_0xd9ff('0x3d')]=_0x3d5742[_0xd9ff('0x3d')]['length']?_0x3d5742[_0xd9ff('0x3d')]:_0x191786[_0xd9ff('0x38')];if(!_0xa908a3['query'][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x3d5742[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3d5742['offset']=qs['offset'](_0xa908a3[_0xd9ff('0x3a')]['offset']);}_0x3d5742['order']=qs['sort'](_0xa908a3['query'][_0xd9ff('0x41')]);_0x3d5742[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_['pick'](_0xa908a3['query'],_0x191786[_0xd9ff('0x42')]));_0x3d5742['where'][_0xd9ff('0x66')]=_0x1afdd4['id'];if(_0xa908a3['query'][_0xd9ff('0x2a')]){_0x3d5742[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x3d5742[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x3d5742['attributes'],function(_0x511eb9){var _0x33c03c={};_0x33c03c[_0x511eb9]={'$like':'%'+_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x33c03c;})});}_0x3d5742=_[_0xd9ff('0x43')]({},_0x3d5742,_0xa908a3[_0xd9ff('0x48')]);return db['CmHopperHistory'][_0xd9ff('0x1f')]({'where':_0x3d5742[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x7fdc57){_0x19ecf3[_0xd9ff('0x1f')]=_0x7fdc57;if(_0xa908a3[_0xd9ff('0x3a')][_0xd9ff('0x49')]){_0x3d5742[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x65')][_0xd9ff('0x4b')](_0x3d5742);})[_0xd9ff('0x27')](function(_0x311b25){_0x19ecf3[_0xd9ff('0x63')]=_0x311b25;return _0x19ecf3;});}})['then'](respondWithFilteredResult(_0x5d29b9,_0x3d5742))[_0xd9ff('0x4c')](handleError(_0x5d29b9,null));};exports[_0xd9ff('0x67')]=function(_0x548ac4,_0x57434d,_0x499020){var _0x34321b={'raw':!![],'where':{}};var _0x4eb4b0={};var _0x3a0425={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x548ac4[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x57434d,null))[_0xd9ff('0x27')](function(_0x120391){if(_0x120391){_0x4eb4b0[_0xd9ff('0x38')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x4eb4b0[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x548ac4[_0xd9ff('0x3a')]);_0x4eb4b0['filters']=_[_0xd9ff('0x3b')](_0x4eb4b0[_0xd9ff('0x38')],_0x4eb4b0[_0xd9ff('0x3a')]);_0x34321b[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x4eb4b0[_0xd9ff('0x38')],qs['fields'](_0x548ac4[_0xd9ff('0x3a')]['fields']));_0x34321b[_0xd9ff('0x3d')]=_0x34321b[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x34321b[_0xd9ff('0x3d')]:_0x4eb4b0['model'];if(!_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x60')]('nolimit')){_0x34321b['limit']=qs['limit'](_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x34321b['offset']=qs[_0xd9ff('0x20')](_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}_0x34321b['order']=qs['sort'](_0x548ac4['query'][_0xd9ff('0x41')]);_0x34321b['where']=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x548ac4['query'],_0x4eb4b0[_0xd9ff('0x42')]));_0x34321b[_0xd9ff('0x44')][_0xd9ff('0x66')]=_0x120391['id'];if(_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x34321b['where']=_[_0xd9ff('0x43')](_0x34321b['where'],{'$or':_['map'](_0x34321b['attributes'],function(_0x42d61f){var _0x373b7a={};_0x373b7a[_0x42d61f]={'$like':'%'+_0x548ac4[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x373b7a;})});}_0x34321b=_['merge']({},_0x34321b,_0x548ac4['options']);return db[_0xd9ff('0x68')][_0xd9ff('0x1f')]({'where':_0x34321b[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x28afbb){_0x3a0425['count']=_0x28afbb;if(_0x548ac4['query'][_0xd9ff('0x49')]){_0x34321b[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x68')][_0xd9ff('0x4b')](_0x34321b);})[_0xd9ff('0x27')](function(_0xd96303){_0x3a0425['rows']=_0xd96303;return _0x3a0425;});}})[_0xd9ff('0x27')](respondWithFilteredResult(_0x57434d,_0x34321b))['catch'](handleError(_0x57434d,null));};exports['getHopperBlacks']=function(_0x16c6fd,_0x397c39,_0x33fee6){var _0x348087={'raw':!![],'where':{}};var _0x49c47c={};var _0x4e3fdd={'count':0x0,'rows':[]};return db[_0xd9ff('0x36')]['findOne']({'where':{'id':_0x16c6fd['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x397c39,null))['then'](function(_0x1035ff){if(_0x1035ff){_0x49c47c['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0x69')][_0xd9ff('0x37')]);_0x49c47c[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x16c6fd[_0xd9ff('0x3a')]);_0x49c47c[_0xd9ff('0x42')]=_['intersection'](_0x49c47c[_0xd9ff('0x38')],_0x49c47c['query']);_0x348087['attributes']=_[_0xd9ff('0x3b')](_0x49c47c[_0xd9ff('0x38')],qs['fields'](_0x16c6fd[_0xd9ff('0x3a')]['fields']));_0x348087['attributes']=_0x348087[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x348087[_0xd9ff('0x3d')]:_0x49c47c[_0xd9ff('0x38')];if(!_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x348087[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x348087[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x16c6fd['query']['offset']);}_0x348087['order']=qs[_0xd9ff('0x41')](_0x16c6fd['query'][_0xd9ff('0x41')]);_0x348087[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x16c6fd['query'],_0x49c47c[_0xd9ff('0x42')]));_0x348087['where'][_0xd9ff('0x66')]=_0x1035ff['id'];if(_0x16c6fd['query']['filter']){_0x348087['where']=_[_0xd9ff('0x43')](_0x348087['where'],{'$or':_[_0xd9ff('0x62')](_0x348087['attributes'],function(_0x3f443b){var _0x387c71={};_0x387c71[_0x3f443b]={'$like':'%'+_0x16c6fd[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x387c71;})});}_0x348087=_[_0xd9ff('0x43')]({},_0x348087,_0x16c6fd[_0xd9ff('0x48')]);return db['CmHopperBlack']['count']({'where':_0x348087[_0xd9ff('0x44')]})[_0xd9ff('0x27')](function(_0x3205ef){_0x4e3fdd[_0xd9ff('0x1f')]=_0x3205ef;if(_0x16c6fd[_0xd9ff('0x3a')]['includeAll']){_0x348087[_0xd9ff('0x4a')]=[{'all':!![]}];}return db[_0xd9ff('0x69')][_0xd9ff('0x4b')](_0x348087);})[_0xd9ff('0x27')](function(_0x3278f6){_0x4e3fdd[_0xd9ff('0x63')]=_0x3278f6;return _0x4e3fdd;});}})['then'](respondWithFilteredResult(_0x397c39,_0x348087))[_0xd9ff('0x4c')](handleError(_0x397c39,null));};exports[_0xd9ff('0x6a')]=function(_0x39aad6,_0x3d6ab3,_0x1b7050){var _0x3cf38a={};var _0x1c8e55={};var _0x1ae8b5;var _0x29fdb8;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x39aad6[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x3d6ab3,null))[_0xd9ff('0x27')](function(_0x385787){if(_0x385787){_0x1ae8b5=_0x385787;_0x1c8e55[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x6b')]['rawAttributes']);_0x1c8e55[_0xd9ff('0x3a')]=_[_0xd9ff('0x39')](_0x39aad6[_0xd9ff('0x3a')]);_0x1c8e55[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x1c8e55[_0xd9ff('0x38')],_0x1c8e55[_0xd9ff('0x3a')]);_0x3cf38a[_0xd9ff('0x3d')]=_['intersection'](_0x1c8e55[_0xd9ff('0x38')],qs['fields'](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x3cf38a[_0xd9ff('0x3d')]=_0x3cf38a[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x3cf38a[_0xd9ff('0x3d')]:_0x1c8e55[_0xd9ff('0x38')];_0x3cf38a['order']=qs[_0xd9ff('0x41')](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x3cf38a[_0xd9ff('0x44')]=qs['filters'](_[_0xd9ff('0x61')](_0x39aad6[_0xd9ff('0x3a')],_0x1c8e55['filters']));if(_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x3cf38a['where']=_['merge'](_0x3cf38a['where'],{'$or':_['map'](_0x3cf38a[_0xd9ff('0x3d')],function(_0x218279){var _0x31f1c0={};_0x31f1c0[_0x218279]={'$like':'%'+_0x39aad6['query']['filter']+'%'};return _0x31f1c0;})});}_0x3cf38a=_[_0xd9ff('0x43')]({},_0x3cf38a,_0x39aad6['options']);return _0x1ae8b5[_0xd9ff('0x6a')](_0x3cf38a);}})[_0xd9ff('0x27')](function(_0xc6c3e7){if(_0xc6c3e7){_0x29fdb8=_0xc6c3e7['length'];if(!_0x39aad6['query']['hasOwnProperty'](_0xd9ff('0x3f'))){_0x3cf38a[_0xd9ff('0x21')]=qs['limit'](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3cf38a[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x39aad6[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x1ae8b5[_0xd9ff('0x6a')](_0x3cf38a);}})[_0xd9ff('0x27')](function(_0x34c584){if(_0x34c584){return _0x34c584?{'count':_0x29fdb8,'rows':_0x34c584}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x3d6ab3,null))[_0xd9ff('0x4c')](handleError(_0x3d6ab3,null));};exports[_0xd9ff('0x6c')]=function(_0x1112d7,_0x2f83d5,_0x107734){var _0x11c2de=_0x1112d7[_0xd9ff('0x5a')][_0xd9ff('0x6d')];return db[_0xd9ff('0x6b')][_0xd9ff('0x4b')]({'where':{'id':_[_0xd9ff('0x62')](_0x11c2de,'id')},'attributes':['id'],'include':[{'model':db[_0xd9ff('0x6e')],'as':_0xd9ff('0x6f'),'attributes':['id',_0xd9ff('0x30'),_0xd9ff('0x70'),_0xd9ff('0x71'),_0xd9ff('0x72')],'raw':!![]}]})[_0xd9ff('0x27')](function(_0x45db83){if(_0x45db83){var _0x4a9657=_[_0xd9ff('0x73')](_0x45db83,function(_0x24c947){var _0x5df5af=_0x24c947[_0xd9ff('0x50')]({'plain':!![]});_0x5df5af[_0xd9ff('0x6f')][_0xd9ff('0x74')](function(_0x220781){_0x220781[_0xd9ff('0x75')]=_[_0xd9ff('0x2f')](_0x11c2de,{'id':_0x5df5af['id']})['penalty'];});return _0x5df5af['Agents'];});return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x1112d7['params']['id']}})[_0xd9ff('0x27')](function(_0x3f0c4d){return db['sequelize'][_0xd9ff('0x76')](function(_0x972158){return _0x3f0c4d[_0xd9ff('0x6c')](_[_0xd9ff('0x62')](_0x11c2de,'id'),{'transaction':_0x972158})['then'](function(){return BPromise[_0xd9ff('0x77')](_0x4a9657,function(_0x4290e9){return db['UserVoiceQueue'][_0xd9ff('0x78')]({'where':{'UserId':_0x4290e9['id'],'VoiceQueueId':_0x1112d7[_0xd9ff('0x4d')]['id']},'defaults':{'penalty':_0x4290e9['penalty']},'transaction':_0x972158});});})[_0xd9ff('0x27')](function(){return BPromise[_0xd9ff('0x77')](_[_0xd9ff('0x2a')](_0x4a9657,{'online':!![]}),function(_0x5b2e9c){return db[_0xd9ff('0x79')][_0xd9ff('0x7a')]({'membername':_0x5b2e9c[_0xd9ff('0x30')],'UserId':_0x5b2e9c['id'],'queue_name':_0x3f0c4d['name'],'VoiceQueueId':_0x3f0c4d['id'],'interface':_[_0xd9ff('0x7b')](_0x5b2e9c['interface'])?util[_0xd9ff('0x7c')](_0xd9ff('0x7d'),_0x5b2e9c[_0xd9ff('0x30')]):_0x5b2e9c[_0xd9ff('0x72')],'paused':_0x5b2e9c[_0xd9ff('0x71')]||![],'penalty':_0x5b2e9c[_0xd9ff('0x75')]},{'transaction':_0x972158});});})['then'](function(){_0x4a9657[_0xd9ff('0x74')](function(_0x3cf2ef){socket[_0xd9ff('0x7e')](_0xd9ff('0x7f'),{'UserId':_0x3cf2ef['id'],'VoiceQueueId':_0x3f0c4d['id']});});});});});}})[_0xd9ff('0x27')](respondWithStatusCode(_0x2f83d5,null))['catch'](handleError(_0x2f83d5,null));};exports[_0xd9ff('0x80')]=function(_0x6e3861,_0x55a784,_0x1a89ef){return db[_0xd9ff('0x6b')][_0xd9ff('0x4b')]({'where':{'id':_0x6e3861[_0xd9ff('0x3a')][_0xd9ff('0x81')]},'attributes':['id'],'include':[{'model':db[_0xd9ff('0x6e')],'as':_0xd9ff('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xd9ff('0x27')](handleEntityNotFound(_0x55a784,null))[_0xd9ff('0x27')](function(_0x3566c4){var _0x236134=_[_0xd9ff('0x62')](_0x3566c4,'id');var _0x8be873=[];var _0x46a4e1=[];var _0x44fb42=squel[_0xd9ff('0x82')]();_0x44fb42['field']('tq.TeamId')['from'](_0xd9ff('0x83'),'tq')['join'](_0xd9ff('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoiceQueueId\x20=\x20?',_0x6e3861[_0xd9ff('0x4d')]['id']);for(var _0x57e0af=0x0;_0x57e0af<_0x3566c4['length'];_0x57e0af+=0x1){let _0x474b4c=_0x3566c4[_0x57e0af];for(var _0x144cf7=0x0;_0x144cf7<_0x474b4c[_0xd9ff('0x6f')][_0xd9ff('0x3e')];_0x144cf7+=0x1){let _0x23251b=_0x474b4c[_0xd9ff('0x6f')][_0x144cf7];var _0x2450da=_0x44fb42[_0xd9ff('0x57')]();_0x2450da[_0xd9ff('0x44')](_0xd9ff('0x85'),_0x23251b['id']);_0x46a4e1[_0xd9ff('0x86')](db[_0xd9ff('0x87')][_0xd9ff('0x3a')](_0x2450da[_0xd9ff('0x88')](),{'type':db['sequelize']['QueryTypes'][_0xd9ff('0x89')]})[_0xd9ff('0x27')](function(_0x131f51){if(_0x131f51[_0xd9ff('0x3e')]===0x1){return _0x23251b['id'];}else{var _0xdac6e4=_[_0xd9ff('0x8a')](_[_0xd9ff('0x62')](_0x131f51,_0xd9ff('0x8b')),function(_0x52b045){return _[_0xd9ff('0x2d')](_0x236134,_0x52b045);});if(_0xdac6e4){return _0x23251b['id'];}}}));}}return BPromise[_0xd9ff('0x8c')](_0x46a4e1)[_0xd9ff('0x27')](function(_0x2179c9){_0x8be873=_(_0x8be873)['union'](_0x2179c9)['compact']()[_0xd9ff('0x2c')]();return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x6e3861[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](function(_0x5273c8){return db[_0xd9ff('0x87')][_0xd9ff('0x76')](function(_0x1ed60d){return _0x5273c8[_0xd9ff('0x80')](_0x6e3861[_0xd9ff('0x3a')][_0xd9ff('0x81')],{'transaction':_0x1ed60d})[_0xd9ff('0x27')](function(){if(!_['isEmpty'](_0x8be873)){return _0x5273c8[_0xd9ff('0x8d')](_0x8be873,{'transaction':_0x1ed60d})[_0xd9ff('0x27')](function(){return db[_0xd9ff('0x79')][_0xd9ff('0x32')]({'where':{'VoiceQueueId':_0x6e3861[_0xd9ff('0x4d')]['id'],'UserId':_0x8be873},'transaction':_0x1ed60d});});}})['then'](function(){_0x8be873[_0xd9ff('0x74')](function(_0x32b1d5){socket[_0xd9ff('0x7e')]('userVoiceQueue:remove',{'UserId':_0x32b1d5,'VoiceQueueId':_0x5273c8['id']});});});});});});})[_0xd9ff('0x27')](respondWithStatusCode(_0x55a784,null))[_0xd9ff('0x4c')](handleError(_0x55a784,null));};exports[_0xd9ff('0x8e')]=function(_0x51c346,_0x1c0405,_0x55e136){var _0x5e07ae,_0x5da4ad;return db['VoiceQueue']['find']({'where':{'id':_0x51c346[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x1c0405,null))['then'](function(_0x2d8405){if(_0x2d8405){_0x5da4ad=_0x2d8405;return _0x2d8405[_0xd9ff('0x8e')](_0x51c346[_0xd9ff('0x5a')]['ids'],_[_0xd9ff('0x5b')](_0x51c346['body'],['ids','id'])||{})[_0xd9ff('0x8f')](function(_0x21680f){for(var _0xdf5553=0x0;_0xdf5553<_0x51c346['body']['ids'][_0xd9ff('0x3e')];_0xdf5553+=0x1){socket[_0xd9ff('0x7e')]('userVoiceQueue:save',{'UserId':_0x51c346[_0xd9ff('0x5a')][_0xd9ff('0x81')][_0xdf5553],'VoiceQueueId':_0x51c346[_0xd9ff('0x4d')]['id']});}return _0x21680f;});}})[_0xd9ff('0x27')](function(_0x3cc589){_0x5e07ae=_0x3cc589||[];if(_0x5da4ad){return db[_0xd9ff('0x6e')][_0xd9ff('0x4b')]({'where':{'id':_0x51c346['body'][_0xd9ff('0x81')]},'attributes':['id',_0xd9ff('0x30'),'online',_0xd9ff('0x71'),_0xd9ff('0x72')],'raw':!![]});}})['then'](function(_0x703858){if(!_['isEmpty'](_0x703858)){var _0x2c4bd8=[];for(var _0x26999a=0x0;_0x26999a<_0x703858['length'];_0x26999a++){if(_0x703858[_0x26999a][_0xd9ff('0x70')]){_0x2c4bd8['push'](db[_0xd9ff('0x79')][_0xd9ff('0x7a')]({'membername':_0x703858[_0x26999a][_0xd9ff('0x30')],'UserId':_0x703858[_0x26999a]['id'],'queue_name':_0x5da4ad[_0xd9ff('0x30')],'VoiceQueueId':_0x5da4ad['id'],'interface':_[_0xd9ff('0x7b')](_0x703858[_0x26999a][_0xd9ff('0x72')])?util['format']('SIP/%s',_0x703858[_0x26999a][_0xd9ff('0x30')]):_0x703858[_0x26999a]['interface'],'paused':_0x703858[_0x26999a][_0xd9ff('0x71')]||![],'penalty':_0x51c346[_0xd9ff('0x5a')]['penalty']||0x0}));}}return BPromise['all'](_0x2c4bd8);}})['then'](function(){return _0x5e07ae;})[_0xd9ff('0x27')](respondWithResult(_0x1c0405,null))[_0xd9ff('0x4c')](handleError(_0x1c0405,null));};exports[_0xd9ff('0x8d')]=function(_0x4f1073,_0x378a24,_0x36d88f){return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x4f1073[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x378a24,null))[_0xd9ff('0x27')](function(_0x5e064d){if(_0x5e064d){return _0x5e064d[_0xd9ff('0x8d')](_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')])[_0xd9ff('0x27')](function(){if(_[_0xd9ff('0x90')](_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')])){for(var _0x21988b=0x0;_0x21988b<_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')][_0xd9ff('0x3e')];_0x21988b+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4f1073[_0xd9ff('0x3a')]['ids'][_0x21988b]),'VoiceQueueId':Number(_0x4f1073['params']['id'])});}}else{socket[_0xd9ff('0x7e')](_0xd9ff('0x91'),{'UserId':Number(_0x4f1073[_0xd9ff('0x3a')][_0xd9ff('0x81')]),'VoiceQueueId':Number(_0x4f1073[_0xd9ff('0x4d')]['id'])});}});}})['then'](function(_0x29fff7){return db['UserVoiceQueueRt'][_0xd9ff('0x32')]({'where':{'VoiceQueueId':_0x4f1073[_0xd9ff('0x4d')]['id'],'UserId':_0x4f1073['query'][_0xd9ff('0x81')]}})[_0xd9ff('0x27')](function(){return _0x29fff7;});})[_0xd9ff('0x27')](respondWithStatusCode(_0x378a24,null))[_0xd9ff('0x4c')](handleError(_0x378a24,null));};exports[_0xd9ff('0x92')]=function(_0x3f0d6c,_0x18a476,_0x538c67){var _0x3c03b3={};var _0x1e3932={};var _0x10f559;var _0x6228cb;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x3f0d6c['params']['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x18a476,null))[_0xd9ff('0x27')](function(_0x109dc3){if(_0x109dc3){_0x10f559=_0x109dc3;_0x1e3932['model']=_[_0xd9ff('0x39')](db['User'][_0xd9ff('0x37')]);_0x1e3932['query']=_[_0xd9ff('0x39')](_0x3f0d6c[_0xd9ff('0x3a')]);_0x1e3932[_0xd9ff('0x42')]=_['intersection'](_0x1e3932[_0xd9ff('0x38')],_0x1e3932['query']);_0x3c03b3[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x1e3932[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x3f0d6c[_0xd9ff('0x3a')]['fields']));_0x3c03b3[_0xd9ff('0x3d')]=_0x3c03b3[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x3c03b3[_0xd9ff('0x3d')]:_0x1e3932[_0xd9ff('0x38')];_0x3c03b3[_0xd9ff('0x40')]=qs['sort'](_0x3f0d6c['query'][_0xd9ff('0x41')]);_0x3c03b3[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x3f0d6c[_0xd9ff('0x3a')],_0x1e3932[_0xd9ff('0x42')]));if(_0x3f0d6c[_0xd9ff('0x3a')]['filter']){_0x3c03b3[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x3c03b3[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x3c03b3[_0xd9ff('0x3d')],function(_0x173293){var _0x4ffed7={};_0x4ffed7[_0x173293]={'$like':'%'+_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x4ffed7;})});}_0x3c03b3=_[_0xd9ff('0x43')]({},_0x3c03b3,_0x3f0d6c[_0xd9ff('0x48')]);return _0x10f559[_0xd9ff('0x92')](_0x3c03b3);}})[_0xd9ff('0x27')](function(_0x5c0a6e){if(_0x5c0a6e){_0x6228cb=_0x5c0a6e['length'];if(!_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x3c03b3[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x3c03b3[_0xd9ff('0x20')]=qs['offset'](_0x3f0d6c[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x10f559[_0xd9ff('0x92')](_0x3c03b3);}})[_0xd9ff('0x27')](function(_0x219b57){if(_0x219b57){return _0x219b57?{'count':_0x6228cb,'rows':_0x219b57}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x18a476,null))['catch'](handleError(_0x18a476,null));};exports[_0xd9ff('0x93')]=function(_0x586c56,_0x51209e,_0x23ed20){var _0x32e672={};var _0x2fdb78={};var _0x30abd8;var _0x3c8f01;return db[_0xd9ff('0x36')][_0xd9ff('0x5e')]({'where':{'id':_0x586c56[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51209e,null))[_0xd9ff('0x27')](function(_0x4c07bf){if(_0x4c07bf){_0x30abd8=_0x4c07bf;_0x2fdb78[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db[_0xd9ff('0x79')][_0xd9ff('0x37')]);_0x2fdb78['query']=_[_0xd9ff('0x39')](_0x586c56[_0xd9ff('0x3a')]);_0x2fdb78[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x2fdb78[_0xd9ff('0x38')],_0x2fdb78[_0xd9ff('0x3a')]);_0x32e672[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x2fdb78[_0xd9ff('0x38')],qs['fields'](_0x586c56[_0xd9ff('0x3a')]['fields']));_0x32e672['attributes']=_0x32e672[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x32e672[_0xd9ff('0x3d')]:_0x2fdb78[_0xd9ff('0x38')];_0x32e672[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x41')]);_0x32e672[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x586c56[_0xd9ff('0x3a')],_0x2fdb78['filters']));if(_0x586c56[_0xd9ff('0x3a')]['filter']){_0x32e672[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x32e672['where'],{'$or':_['map'](_0x32e672[_0xd9ff('0x3d')],function(_0x2ee0f3){var _0x51e968={};_0x51e968[_0x2ee0f3]={'$like':'%'+_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x51e968;})});}_0x32e672=_['merge']({},_0x32e672,_0x586c56[_0xd9ff('0x48')]);return _0x30abd8['getMembers'](_0x32e672);}})[_0xd9ff('0x27')](function(_0x210071){if(_0x210071){_0x3c8f01=_0x210071[_0xd9ff('0x3e')];if(!_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x32e672[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x32e672[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x586c56[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x30abd8['getMembers'](_0x32e672);}})[_0xd9ff('0x27')](function(_0xd68b90){return _0xd68b90?{'count':_0x3c8f01,'rows':_0xd68b90}:null;})[_0xd9ff('0x27')](respondWithResult(_0x51209e,null))[_0xd9ff('0x4c')](handleError(_0x51209e,null));};exports[_0xd9ff('0x94')]=function(_0x314f18,_0x534496,_0x5ba463){var _0x5a583d={};var _0x51f5f1={};var _0x4699d3;var _0x2e91a8;return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0x314f18[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x534496,null))['then'](function(_0x5cd1e7){if(_0x5cd1e7){_0x4699d3=_0x5cd1e7;_0x51f5f1[_0xd9ff('0x38')]=_[_0xd9ff('0x39')](db['CmList']['rawAttributes']);_0x51f5f1['query']=_['keys'](_0x314f18['query']);_0x51f5f1[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x51f5f1[_0xd9ff('0x38')],_0x51f5f1[_0xd9ff('0x3a')]);_0x5a583d[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x51f5f1[_0xd9ff('0x38')],qs[_0xd9ff('0x3c')](_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x5a583d[_0xd9ff('0x3d')]=_0x5a583d[_0xd9ff('0x3d')][_0xd9ff('0x3e')]?_0x5a583d[_0xd9ff('0x3d')]:_0x51f5f1[_0xd9ff('0x38')];_0x5a583d[_0xd9ff('0x40')]=qs[_0xd9ff('0x41')](_0x314f18['query'][_0xd9ff('0x41')]);_0x5a583d['where']=qs[_0xd9ff('0x42')](_['pick'](_0x314f18[_0xd9ff('0x3a')],_0x51f5f1[_0xd9ff('0x42')]));if(_0x314f18[_0xd9ff('0x3a')]['filter']){_0x5a583d['where']=_['merge'](_0x5a583d['where'],{'$or':_['map'](_0x5a583d[_0xd9ff('0x3d')],function(_0x2031e9){var _0x3b50d9={};_0x3b50d9[_0x2031e9]={'$like':'%'+_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x3b50d9;})});}_0x5a583d=_[_0xd9ff('0x43')]({},_0x5a583d,_0x314f18['options']);return _0x4699d3[_0xd9ff('0x94')](_0x5a583d);}})[_0xd9ff('0x27')](function(_0x55cc92){if(_0x55cc92){_0x2e91a8=_0x55cc92['length'];if(!_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x60')](_0xd9ff('0x3f'))){_0x5a583d['limit']=qs[_0xd9ff('0x21')](_0x314f18[_0xd9ff('0x3a')]['limit']);_0x5a583d[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x314f18[_0xd9ff('0x3a')][_0xd9ff('0x20')]);}return _0x4699d3['getLists'](_0x5a583d);}})['then'](function(_0x46d12c){if(_0x46d12c){return _0x46d12c?{'count':_0x2e91a8,'rows':_0x46d12c}:null;}})[_0xd9ff('0x27')](respondWithResult(_0x534496,null))['catch'](handleError(_0x534496,null));};exports[_0xd9ff('0x95')]=function(_0x5c2f70,_0x39c2de,_0x70b6d8){var _0x10400b,_0x15bfd8;return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x5c2f70['params']['id']}})['then'](handleEntityNotFound(_0x39c2de,null))[_0xd9ff('0x27')](function(_0x47b1d7){if(_0x47b1d7){_0x15bfd8=_0x47b1d7;return _0x47b1d7[_0xd9ff('0x95')](_0x5c2f70['body'][_0xd9ff('0x81')],_[_0xd9ff('0x5b')](_0x5c2f70[_0xd9ff('0x5a')],['ids','id'])||{});}return null;})[_0xd9ff('0x8f')](function(_0xd4caa3){var _0x57cb46;_0x10400b=_0xd4caa3||[];var _0x4f8ed7=[];if(_0xd4caa3){for(var _0x538494=0x0;_0x538494<_0xd4caa3[_0xd9ff('0x3e')];_0x538494+=0x1){var _0x216224=_0xd4caa3[_0x538494][_0xd9ff('0x50')]({'plain':!![]});_0x15bfd8[_0xd9ff('0x96')]=_0x5c2f70[_0xd9ff('0x5a')][_0xd9ff('0x96')]?_0x5c2f70[_0xd9ff('0x5a')][_0xd9ff('0x96')]:_0x15bfd8['dialCheckDuplicateType'];switch(_0x15bfd8[_0xd9ff('0x96')]){case _0xd9ff('0x97'):_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')](_0xd9ff('0x9a'))[_0xd9ff('0x9b')]([_0xd9ff('0x9c'),_0xd9ff('0x9d'),_0xd9ff('0x9e'),'ListId','VoiceQueueId','createdAt',_0xd9ff('0x59')],squel[_0xd9ff('0x82')]()['field'](_0xd9ff('0x9c'),'phone')['field'](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))[_0xd9ff('0x47')](_0x216224[_0xd9ff('0xa0')]['toString'](),_0xd9ff('0xa1'))[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))['field']('NOW()',_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x59'))[_0xd9ff('0xa2')](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x216224[_0xd9ff('0xa0')][_0xd9ff('0x88')]())[_0xd9ff('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xd9ff('0x44')](_0xd9ff('0xa6'),squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0xa7'))[_0xd9ff('0xa2')](_0xd9ff('0xa8'))[_0xd9ff('0x44')](_0xd9ff('0xa9'),_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')]()))[_0xd9ff('0x44')](_0xd9ff('0xa6'),squel['select']()[_0xd9ff('0x47')](_0xd9ff('0xaa'))[_0xd9ff('0xa2')](_0xd9ff('0x9a'))['where'](_0xd9ff('0xa9'),_0x5c2f70['params']['id']['toString']())))[_0xd9ff('0x88')]();break;case _0xd9ff('0xab'):_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')](_0xd9ff('0x9a'))[_0xd9ff('0x9b')]([_0xd9ff('0x9c'),'scheduledAt',_0xd9ff('0x9e'),_0xd9ff('0xa1'),'VoiceQueueId',_0xd9ff('0x58'),_0xd9ff('0x59')],squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))['field'](_0x216224['CmListId'][_0xd9ff('0x88')](),_0xd9ff('0xa1'))[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),'createdAt')[_0xd9ff('0x47')]('NOW()',_0xd9ff('0x59'))[_0xd9ff('0xa2')]('cm_contacts')[_0xd9ff('0x44')](_0xd9ff('0xa4'))['where'](_0xd9ff('0xa5'),_0x216224['CmListId']['toString']())[_0xd9ff('0x44')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xd9ff('0xa6'),squel['select']()[_0xd9ff('0x47')](_0xd9ff('0xaa'))[_0xd9ff('0xa2')](_0xd9ff('0x9a'))[_0xd9ff('0x44')]('VoiceQueueId\x20=\x20?',_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')]())))['toString']();break;default:_0x57cb46=squel[_0xd9ff('0x98')]()[_0xd9ff('0x99')]('cm_hopper')['fromQuery']([_0xd9ff('0x9c'),'scheduledAt','ContactId','ListId',_0xd9ff('0x66'),'createdAt','updatedAt'],squel[_0xd9ff('0x82')]()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))['field'](_0xd9ff('0x9f'),_0xd9ff('0x9d'))[_0xd9ff('0x47')]('id',_0xd9ff('0x9e'))['field'](_0x216224[_0xd9ff('0xa0')]['toString'](),'ListId')[_0xd9ff('0x47')](_0x5c2f70[_0xd9ff('0x4d')]['id'][_0xd9ff('0x88')](),_0xd9ff('0x66'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),'updatedAt')[_0xd9ff('0xa2')](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x216224['CmListId'][_0xd9ff('0x88')]())[_0xd9ff('0x44')](_0xd9ff('0xac')))[_0xd9ff('0x88')]();}_0x4f8ed7[_0xd9ff('0x86')](db['sequelize'][_0xd9ff('0x3a')](_0x57cb46));}return BPromise[_0xd9ff('0x8c')](_0x4f8ed7);}})[_0xd9ff('0x27')](function(){return _0x10400b;})[_0xd9ff('0x27')](respondWithResult(_0x39c2de,null))[_0xd9ff('0x4c')](handleError(_0x39c2de,null));};exports[_0xd9ff('0xad')]=function(_0x2dad33,_0x54fd9c,_0x18cd6f){return db[_0xd9ff('0x36')]['find']({'where':{'id':_0x2dad33[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0x54fd9c,null))[_0xd9ff('0x27')](function(_0x24bfca){if(_0x24bfca){return _0x24bfca[_0xd9ff('0xad')](_0x2dad33[_0xd9ff('0x3a')][_0xd9ff('0x81')]);}})[_0xd9ff('0x27')](function(_0x2e542f){if(_0x2e542f){return db[_0xd9ff('0x5f')]['destroy']({'where':{'ListId':_0x2dad33[_0xd9ff('0x3a')][_0xd9ff('0x81')],'VoiceQueueId':_0x2dad33['params']['id']}})[_0xd9ff('0x27')](function(){return _0x2e542f;});}})['then'](respondWithStatusCode(_0x54fd9c,null))[_0xd9ff('0x4c')](handleError(_0x54fd9c,null));};exports[_0xd9ff('0xae')]=function(_0x4fef50,_0xb03842,_0x258eec){var _0x36df60={};var _0x4a4075={};var _0x96db43;var _0x5450c2;return db['VoiceQueue'][_0xd9ff('0x5e')]({'where':{'id':_0x4fef50[_0xd9ff('0x4d')]['id']}})[_0xd9ff('0x27')](handleEntityNotFound(_0xb03842,null))[_0xd9ff('0x27')](function(_0x2277ad){if(_0x2277ad){_0x96db43=_0x2277ad;_0x4a4075['model']=_[_0xd9ff('0x39')](db[_0xd9ff('0xaf')][_0xd9ff('0x37')]);_0x4a4075[_0xd9ff('0x3a')]=_['keys'](_0x4fef50[_0xd9ff('0x3a')]);_0x4a4075[_0xd9ff('0x42')]=_[_0xd9ff('0x3b')](_0x4a4075[_0xd9ff('0x38')],_0x4a4075[_0xd9ff('0x3a')]);_0x36df60[_0xd9ff('0x3d')]=_[_0xd9ff('0x3b')](_0x4a4075[_0xd9ff('0x38')],qs['fields'](_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x3c')]));_0x36df60[_0xd9ff('0x3d')]=_0x36df60['attributes'][_0xd9ff('0x3e')]?_0x36df60[_0xd9ff('0x3d')]:_0x4a4075[_0xd9ff('0x38')];_0x36df60['order']=qs[_0xd9ff('0x41')](_0x4fef50['query'][_0xd9ff('0x41')]);_0x36df60[_0xd9ff('0x44')]=qs[_0xd9ff('0x42')](_[_0xd9ff('0x61')](_0x4fef50[_0xd9ff('0x3a')],_0x4a4075[_0xd9ff('0x42')]));if(_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x2a')]){_0x36df60[_0xd9ff('0x44')]=_[_0xd9ff('0x43')](_0x36df60[_0xd9ff('0x44')],{'$or':_[_0xd9ff('0x62')](_0x36df60[_0xd9ff('0x3d')],function(_0x12ed06){var _0x27b34c={};_0x27b34c[_0x12ed06]={'$like':'%'+_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x2a')]+'%'};return _0x27b34c;})});}_0x36df60=_[_0xd9ff('0x43')]({},_0x36df60,_0x4fef50[_0xd9ff('0x48')]);return _0x96db43[_0xd9ff('0xae')](_0x36df60);}})[_0xd9ff('0x27')](function(_0x5c09c4){if(_0x5c09c4){_0x5450c2=_0x5c09c4[_0xd9ff('0x3e')];if(!_0x4fef50[_0xd9ff('0x3a')]['hasOwnProperty']('nolimit')){_0x36df60[_0xd9ff('0x21')]=qs[_0xd9ff('0x21')](_0x4fef50[_0xd9ff('0x3a')][_0xd9ff('0x21')]);_0x36df60[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x4fef50['query'][_0xd9ff('0x20')]);}return _0x96db43[_0xd9ff('0xae')](_0x36df60);}})[_0xd9ff('0x27')](function(_0xed2875){if(_0xed2875){return _0xed2875?{'count':_0x5450c2,'rows':_0xed2875}:null;}})[_0xd9ff('0x27')](respondWithResult(_0xb03842,null))['catch'](handleError(_0xb03842,null));};exports['addBlackLists']=function(_0x12b512,_0xb4be84,_0x5de7ff){var _0x172027,_0x32119e;return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x12b512[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb4be84,null))[_0xd9ff('0x27')](function(_0x4f378c){if(_0x4f378c){_0x32119e=_0x4f378c;return _0x4f378c[_0xd9ff('0xb0')](_0x12b512['body'][_0xd9ff('0x81')],_[_0xd9ff('0x5b')](_0x12b512[_0xd9ff('0x5a')],[_0xd9ff('0x81'),'id'])||{});}return null;})[_0xd9ff('0x8f')](function(_0x3c9f51){var _0x23c031;_0x172027=_0x3c9f51||[];var _0x57d141=[];if(_0x3c9f51){for(var _0x39417a=0x0;_0x39417a<_0x3c9f51['length'];_0x39417a+=0x1){var _0x558e6e=_0x3c9f51[_0x39417a]['get']({'plain':!![]});_0x23c031=squel['insert']()[_0xd9ff('0x99')](_0xd9ff('0xb1'))['fromQuery']([_0xd9ff('0x9c'),'ContactId',_0xd9ff('0xa1'),'VoiceQueueId',_0xd9ff('0x58'),_0xd9ff('0x59')],squel['select']()[_0xd9ff('0x47')](_0xd9ff('0x9c'),_0xd9ff('0x9c'))[_0xd9ff('0x47')]('id','ContactId')[_0xd9ff('0x47')](_0x558e6e[_0xd9ff('0xa0')][_0xd9ff('0x88')](),_0xd9ff('0xa1'))['field'](_0x12b512[_0xd9ff('0x4d')]['id']['toString'](),'VoiceQueueId')[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x58'))[_0xd9ff('0x47')](_0xd9ff('0x9f'),_0xd9ff('0x59'))['from'](_0xd9ff('0xa3'))[_0xd9ff('0x44')](_0xd9ff('0xa4'))[_0xd9ff('0x44')](_0xd9ff('0xa5'),_0x558e6e['CmListId'][_0xd9ff('0x88')]())[_0xd9ff('0x44')](_0xd9ff('0xac')))[_0xd9ff('0x88')]();_0x57d141[_0xd9ff('0x86')](db[_0xd9ff('0x87')][_0xd9ff('0x3a')](_0x23c031));}return BPromise[_0xd9ff('0x8c')](_0x57d141);}})['then'](function(){return _0x172027;})[_0xd9ff('0x27')](respondWithResult(_0xb4be84,null))['catch'](handleError(_0xb4be84,null));};exports[_0xd9ff('0xb2')]=function(_0x2c36b0,_0x35e09a,_0x2d605e){return db[_0xd9ff('0x36')][_0xd9ff('0x2f')]({'where':{'id':_0x2c36b0[_0xd9ff('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35e09a,null))[_0xd9ff('0x27')](function(_0x4727d4){if(_0x4727d4){return _0x4727d4['removeBlackLists'](_0x2c36b0[_0xd9ff('0x3a')][_0xd9ff('0x81')]);}})[_0xd9ff('0x27')](function(_0x4d0ba8){if(_0x4d0ba8){return db['CmHopperBlack'][_0xd9ff('0x32')]({'where':{'ListId':_0x2c36b0[_0xd9ff('0x3a')][_0xd9ff('0x81')],'VoiceQueueId':_0x2c36b0['params']['id']}})[_0xd9ff('0x27')](function(){return _0x4d0ba8;});}})['then'](respondWithStatusCode(_0x35e09a,null))['catch'](handleError(_0x35e09a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ecdaf19..9e4eb4a 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 _0xbaa9=['events','VoiceQueue','update','remove','emit','hook','exports'];(function(_0x283e73,_0x463465){var _0x218a15=function(_0x1ba107){while(--_0x1ba107){_0x283e73['push'](_0x283e73['shift']());}};_0x218a15(++_0x463465);}(_0xbaa9,0x188));var _0x9baa=function(_0x298da7,_0x4b6114){_0x298da7=_0x298da7-0x0;var _0x1cc5dc=_0xbaa9[_0x298da7];return _0x1cc5dc;};'use strict';var EventEmitter=require(_0x9baa('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x9baa('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9baa('0x2'),'afterDestroy':_0x9baa('0x3')};function emitEvent(_0x3b8019){return function(_0xcc6496,_0x1c16be,_0x10543a){VoiceQueueEvents['emit'](_0x3b8019+':'+_0xcc6496['id'],_0xcc6496);VoiceQueueEvents[_0x9baa('0x4')](_0x3b8019,_0xcc6496);_0x10543a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x9baa('0x5')](e,emitEvent(event));}}module[_0x9baa('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x79c6=['hook','events','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4cd357,_0x368b0e){var _0x126e8c=function(_0x527992){while(--_0x527992){_0x4cd357['push'](_0x4cd357['shift']());}};_0x126e8c(++_0x368b0e);}(_0x79c6,0x81));var _0x679c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x79c6[_0x1b6c6d];return _0x290d9d;};'use strict';var EventEmitter=require(_0x679c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x679c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x679c('0x2')](0x0);var events={'afterCreate':_0x679c('0x3'),'afterUpdate':_0x679c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9bf){return function(_0x596e9c,_0x3e24f6,_0x1b87a5){VoiceQueueEvents[_0x679c('0x5')](_0x56d9bf+':'+_0x596e9c['id'],_0x596e9c);VoiceQueueEvents[_0x679c('0x5')](_0x56d9bf,_0x596e9c);_0x1b87a5(null);};}for(var e in events){if(events[_0x679c('0x6')](e)){var event=events[e];VoiceQueue[_0x679c('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 8a8efbc..571aa4f 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 _0x13f6=['request-promise','rimraf','../../config/environment','./voiceQueue.attributes','lodash','util','moment','bluebird'];(function(_0x743f56,_0x5335a1){var _0x51a115=function(_0x4f2ca7){while(--_0x4f2ca7){_0x743f56['push'](_0x743f56['shift']());}};_0x51a115(++_0x5335a1);}(_0x13f6,0x124));var _0x613f=function(_0x4c2ceb,_0x3788ce){_0x4c2ceb=_0x4c2ceb-0x0;var _0x227fd1=_0x13f6[_0x4c2ceb];return _0x227fd1;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('VoiceQueue',attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2750=['rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b7611,_0x21db55){var _0x44bf5b=function(_0x5e1650){while(--_0x5e1650){_0x1b7611['push'](_0x1b7611['shift']());}};_0x44bf5b(++_0x21db55);}(_0x2750,0x13b));var _0x0275=function(_0x880368,_0x1175e0){_0x880368=_0x880368-0x0;var _0x547d64=_0x2750[_0x880368];return _0x547d64;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'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 34fd763..1df5408 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x305e9c,_0x154e63){var _0x5c6454=function(_0x534247){while(--_0x534247){_0x305e9c['push'](_0x305e9c['shift']());}};_0x5c6454(++_0x154e63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x339d2a,_0x3ffdf7){var _0x4f0363=function(_0x15c2ba){while(--_0x15c2ba){_0x339d2a['push'](_0x339d2a['shift']());}};_0x4f0363(++_0x3ffdf7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index bb4a09f..ac004fc 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 _0xa7ae=['update','emit','removeListener','voiceQueue:','./voiceQueue.events','remove'];(function(_0x21bb01,_0x4988f2){var _0x4a8035=function(_0x1a91f9){while(--_0x1a91f9){_0x21bb01['push'](_0x21bb01['shift']());}};_0x4a8035(++_0x4988f2);}(_0xa7ae,0x1a8));var _0xea7a=function(_0x2bb240,_0x22cf2c){_0x2bb240=_0x2bb240-0x0;var _0x2de128=_0xa7ae[_0x2bb240];return _0x2de128;};'use strict';var VoiceQueueEvents=require(_0xea7a('0x0'));var events=['save',_0xea7a('0x1'),_0xea7a('0x2')];function createListener(_0x1f1694,_0x67ebba){return function(_0x54eb9b){_0x67ebba[_0xea7a('0x3')](_0x1f1694,_0x54eb9b);};}function removeListener(_0x5a411e,_0x55e901){return function(){VoiceQueueEvents[_0xea7a('0x4')](_0x5a411e,_0x55e901);};}exports['register']=function(_0x142b8b){for(var _0x2d27c1=0x0,_0x3595ca=events['length'];_0x2d27c1<_0x3595ca;_0x2d27c1++){var _0x33d628=events[_0x2d27c1];var _0x2166cd=createListener(_0xea7a('0x5')+_0x33d628,_0x142b8b);VoiceQueueEvents['on'](_0x33d628,_0x2166cd);}}; \ No newline at end of file +var _0xea34=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x4944f1,_0x482a52){var _0x433494=function(_0x40d7f3){while(--_0x40d7f3){_0x4944f1['push'](_0x4944f1['shift']());}};_0x433494(++_0x482a52);}(_0xea34,0x99));var _0x4ea3=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xea34[_0x30faec];return _0x29484f;};'use strict';var VoiceQueueEvents=require(_0x4ea3('0x0'));var events=[_0x4ea3('0x1'),_0x4ea3('0x2'),_0x4ea3('0x3')];function createListener(_0x158338,_0x3473c4){return function(_0x3df1e3){_0x3473c4[_0x4ea3('0x4')](_0x158338,_0x3df1e3);};}function removeListener(_0x1ab7e2,_0x5538e2){return function(){VoiceQueueEvents[_0x4ea3('0x5')](_0x1ab7e2,_0x5538e2);};}exports['register']=function(_0x437c2b){for(var _0x3e42fc=0x0,_0xd8cd79=events[_0x4ea3('0x6')];_0x3e42fc<_0xd8cd79;_0x3e42fc++){var _0x2716a2=events[_0x3e42fc];var _0x4401cd=createListener(_0x4ea3('0x7')+_0x2716a2,_0x437c2b);VoiceQueueEvents['on'](_0x2716a2,_0x4401cd);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1fd576e..ec36f3f 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 _0x305e=['Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x305e,0x88));var _0xe305=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x305e[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xe305('0x0'));var util=require(_0xe305('0x1'));var path=require(_0xe305('0x2'));var timeout=require(_0xe305('0x3'));var express=require('express');var router=express[_0xe305('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe305('0x5'));var config=require(_0xe305('0x6'));var controller=require(_0xe305('0x7'));router[_0xe305('0x8')]('/',auth[_0xe305('0x9')](),controller['index']);router[_0xe305('0x8')](_0xe305('0xa'),auth[_0xe305('0x9')](),controller[_0xe305('0xb')]);router[_0xe305('0x8')](_0xe305('0xc'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xe305('0x8')](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0xe')]);router[_0xe305('0xf')]('/',auth[_0xe305('0x9')](),controller[_0xe305('0x10')]);router['put'](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0x11')]);router[_0xe305('0x12')](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0x13')]);module['exports']=router; \ No newline at end of file +var _0xabd0=['destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','show','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabd0,0x17d));var _0x0abd=function(_0x5d0fd0,_0x1a3f0d){_0x5d0fd0=_0x5d0fd0-0x0;var _0x556cfa=_0xabd0[_0x5d0fd0];return _0x556cfa;};'use strict';var multer=require('multer');var util=require(_0x0abd('0x0'));var path=require(_0x0abd('0x1'));var timeout=require(_0x0abd('0x2'));var express=require(_0x0abd('0x3'));var router=express[_0x0abd('0x4')]();var auth=require(_0x0abd('0x5'));var interaction=require(_0x0abd('0x6'));var config=require(_0x0abd('0x7'));var controller=require(_0x0abd('0x8'));router['get']('/',auth[_0x0abd('0x9')](),controller[_0x0abd('0xa')]);router[_0x0abd('0xb')](_0x0abd('0xc'),auth['isAuthenticated'](),controller[_0x0abd('0xd')]);router[_0x0abd('0xb')]('/index',auth['isAuthenticated'](),controller[_0x0abd('0xe')]);router[_0x0abd('0xb')](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x10')]);router['post']('/',auth[_0x0abd('0x9')](),controller[_0x0abd('0x11')]);router['put'](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x12')]);router['delete'](_0x0abd('0xf'),auth[_0x0abd('0x9')](),controller[_0x0abd('0x13')]);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 3e67044..67a8d5a 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 _0x3d34=['getDataValue','queuecallerjoinAt','format','diff','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE'];(function(_0x266aa2,_0x1fa8ea){var _0x4a1209=function(_0x19d755){while(--_0x19d755){_0x266aa2['push'](_0x266aa2['shift']());}};_0x4a1209(++_0x1fa8ea);}(_0x3d34,0xdb));var _0x43d3=function(_0x23bf66,_0x2f57be){_0x23bf66=_0x23bf66-0x0;var _0xbf7653=_0x3d34[_0x23bf66];return _0xbf7653;};'use strict';var Sequelize=require(_0x43d3('0x0'));var moment=require(_0x43d3('0x1'));module[_0x43d3('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x43d3('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43d3('0x3')]},'queue':{'type':Sequelize[_0x43d3('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x43d3('0x4')],'set':function(_0x39eb45){var _0x13e735=moment(_0x39eb45);var _0x2a1399=moment(this[_0x43d3('0x5')](_0x43d3('0x6')))[_0x43d3('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2ef6cc=_0x13e735[_0x43d3('0x8')](_0x2a1399,'seconds');this[_0x43d3('0x9')]('queuecallerleaveAt',_0x39eb45);this[_0x43d3('0x9')](_0x43d3('0xa'),_0x2ef6cc||null);}},'position':{'type':Sequelize[_0x43d3('0xb')]},'count':{'type':Sequelize[_0x43d3('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x43d3('0x3')],'comment':_0x43d3('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x43d3('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x43d3('0x3')]},'context':{'type':Sequelize[_0x43d3('0x3')]},'exten':{'type':Sequelize[_0x43d3('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x43d3('0xb')]},'mohtime':{'type':Sequelize[_0x43d3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x43d3('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x43d3('0x3')]},'transferuniqueid':{'type':Sequelize[_0x43d3('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x43d3('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4236=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x3aed78,_0x543bf4){var _0x589655=function(_0x5c5640){while(--_0x5c5640){_0x3aed78['push'](_0x3aed78['shift']());}};_0x589655(++_0x543bf4);}(_0x4236,0x134));var _0x6423=function(_0x43db25,_0x5204ae){_0x43db25=_0x43db25-0x0;var _0x5d0da1=_0x4236[_0x43db25];return _0x5d0da1;};'use strict';var Sequelize=require(_0x6423('0x0'));var moment=require(_0x6423('0x1'));module[_0x6423('0x2')]={'type':{'type':Sequelize[_0x6423('0x3')]},'uniqueid':{'type':Sequelize[_0x6423('0x3')]},'calleridnum':{'type':Sequelize[_0x6423('0x3')]},'calleridname':{'type':Sequelize[_0x6423('0x3')]},'queue':{'type':Sequelize[_0x6423('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2fa817){var _0x5e914a=moment(_0x2fa817);var _0x42d6e9=moment(this[_0x6423('0x5')]('queuecallerjoinAt'))['format'](_0x6423('0x6'));var _0x4a450e=_0x5e914a[_0x6423('0x7')](_0x42d6e9,_0x6423('0x8'));this[_0x6423('0x9')](_0x6423('0xa'),_0x2fa817);this[_0x6423('0x9')](_0x6423('0xb'),_0x4a450e||null);}},'position':{'type':Sequelize[_0x6423('0xc')]},'count':{'type':Sequelize[_0x6423('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerexit':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6423('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x6423('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x6423('0x3')]},'connectedlinenum':{'type':Sequelize[_0x6423('0x3')]},'connectedlinename':{'type':Sequelize[_0x6423('0x3')]},'accountcode':{'type':Sequelize[_0x6423('0x3')]},'context':{'type':Sequelize[_0x6423('0x3')]},'exten':{'type':Sequelize[_0x6423('0x3')]},'priority':{'type':Sequelize[_0x6423('0x3')]},'holdtime':{'type':Sequelize[_0x6423('0xc')]},'mohtime':{'type':Sequelize[_0x6423('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6423('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6423('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6423('0x3')],'comment':_0x6423('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6423('0x3')]},'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 e11d217..e50b175 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 _0x0713=['keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','model'];(function(_0x42a290,_0x5c038e){var _0x23367b=function(_0x52bea3){while(--_0x52bea3){_0x42a290['push'](_0x42a290['shift']());}};_0x23367b(++_0x5c038e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var hardwareService=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];config[_0x3071('0x19')]=_[_0x3071('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3071('0x1b'))(new Redis(config['redis']));require(_0x3071('0x1c'))[_0x3071('0x1d')](socket);function respondWithStatusCode(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xcc;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1e')](_0x104e73);}return _0x5d4883[_0x3071('0x1f')](_0x104e73)[_0x3071('0x20')]();};}function respondWithResult(_0x1f14e1,_0x1caa5d){_0x1caa5d=_0x1caa5d||0xc8;return function(_0x2a6a4b){if(_0x2a6a4b){return _0x1f14e1[_0x3071('0x1f')](_0x1caa5d)[_0x3071('0x21')](_0x2a6a4b);}};}function respondWithFilteredResult(_0x21aad3,_0x344ea6){return function(_0x5f3c22){if(_0x5f3c22){var _0x224996=_0x5f3c22[_0x3071('0x22')],_0x17dbda=_0x344ea6[_0x3071('0x23')],_0x1068d9=_0x344ea6[_0x3071('0x23')]+_0x344ea6[_0x3071('0x24')],_0x108a83;if(_0x1068d9>=_0x224996){_0x1068d9=_0x224996;_0x108a83=0xc8;}else{_0x108a83=0xce;}_0x21aad3['status'](_0x108a83);return _0x21aad3[_0x3071('0x25')](_0x3071('0x26'),_0x17dbda+'-'+_0x1068d9+'/'+_0x224996)[_0x3071('0x21')](_0x5f3c22);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x27')](_0x833074);}return _0xb8f4e3[_0x3071('0x28')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x29')](_0x457b57)[_0x3071('0x2a')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x2b')]()[_0x3071('0x2a')](function(){_0x481a51[_0x3071('0x1f')](0xcc)[_0x3071('0x20')]();});}};}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('0x2c')]);if(_0x177138[_0x3071('0x2d')]){delete _0x177138[_0x3071('0x2d')];}_0x2e5f93[_0x3071('0x1f')](_0x3f1e6e)[_0x3071('0x2e')](_0x177138);};}exports[_0x3071('0x2f')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=db['VoiceQueueReport'][_0x3071('0x30')];_0x292205[_0x3071('0x31')]=_[_0x3071('0x32')](_0x5aba96);_0x292205[_0x3071('0x33')]=_[_0x3071('0x32')](_0x177b5f[_0x3071('0x33')]);_0x292205[_0x3071('0x34')]=_[_0x3071('0x35')](_0x292205['model'],_0x292205['query']);_0x32f1b4['attributes']=_[_0x3071('0x35')](_0x292205[_0x3071('0x31')],qs['fields'](_0x177b5f[_0x3071('0x33')][_0x3071('0x36')]));_0x32f1b4[_0x3071('0x37')]=_0x32f1b4[_0x3071('0x37')]['length']?_0x32f1b4[_0x3071('0x37')]:_0x292205[_0x3071('0x31')];if(!_0x177b5f[_0x3071('0x33')][_0x3071('0x38')](_0x3071('0x39'))){_0x32f1b4[_0x3071('0x24')]=qs[_0x3071('0x24')](_0x177b5f[_0x3071('0x33')]['limit']);_0x32f1b4[_0x3071('0x23')]=qs['offset'](_0x177b5f['query'][_0x3071('0x23')]);}_0x32f1b4[_0x3071('0x3a')]=qs['sort'](_0x177b5f[_0x3071('0x33')][_0x3071('0x3b')]);_0x32f1b4[_0x3071('0x3c')]=qs[_0x3071('0x34')](_[_0x3071('0x3d')](_0x177b5f[_0x3071('0x33')],_0x292205['filters']));if(_0x177b5f[_0x3071('0x33')][_0x3071('0x3e')]){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4['where'],{'$or':_[_0x3071('0x40')](_0x5aba96,function(_0x43133a){if(_0x43133a['type']['key']!==_0x3071('0x41')){var _0x185f63={};_0x185f63[_0x43133a[_0x3071('0x42')]]={'$like':'%'+_0x177b5f['query'][_0x3071('0x3e')]+'%'};return _0x185f63;}})});}_0x32f1b4=_['merge']({},_0x32f1b4,_0x177b5f[_0x3071('0x43')]);var _0x4b7928={'where':_0x32f1b4[_0x3071('0x3c')]};return db[_0x3071('0x44')][_0x3071('0x22')](_0x4b7928)[_0x3071('0x2a')](function(_0x30ab68){_0x254fc8['count']=_0x30ab68;if(_0x177b5f['query'][_0x3071('0x45')]){_0x32f1b4[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x44')][_0x3071('0x47')](_0x32f1b4);})['then'](function(_0x3cfc05){_0x254fc8[_0x3071('0x48')]=_0x3cfc05;return _0x254fc8;})[_0x3071('0x2a')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))[_0x3071('0x49')](handleError(_0x3921a1,null));};exports[_0x3071('0x4a')]=function(_0xb9a4b8,_0x56a9d8){var _0x35a50d={'raw':![],'where':{'id':_0xb9a4b8['params']['id']}},_0x596113={};_0x596113['model']=_['keys'](db[_0x3071('0x44')][_0x3071('0x30')]);_0x596113[_0x3071('0x33')]=_[_0x3071('0x32')](_0xb9a4b8[_0x3071('0x33')]);_0x596113[_0x3071('0x34')]=_[_0x3071('0x35')](_0x596113[_0x3071('0x31')],_0x596113['query']);_0x35a50d[_0x3071('0x37')]=_[_0x3071('0x35')](_0x596113[_0x3071('0x31')],qs[_0x3071('0x36')](_0xb9a4b8[_0x3071('0x33')]['fields']));_0x35a50d['attributes']=_0x35a50d[_0x3071('0x37')][_0x3071('0x4b')]?_0x35a50d[_0x3071('0x37')]:_0x596113[_0x3071('0x31')];if(_0xb9a4b8[_0x3071('0x33')]['includeAll']){_0x35a50d[_0x3071('0x46')]=[{'all':!![]}];}_0x35a50d=_['merge']({},_0x35a50d,_0xb9a4b8[_0x3071('0x43')]);return db['VoiceQueueReport']['find'](_0x35a50d)[_0x3071('0x2a')](handleEntityNotFound(_0x56a9d8,null))['then'](respondWithResult(_0x56a9d8,null))[_0x3071('0x49')](handleError(_0x56a9d8,null));};exports['create']=function(_0x717c43,_0x1d75e5){return db[_0x3071('0x44')][_0x3071('0x4c')](_0x717c43['body'],{})[_0x3071('0x2a')](respondWithResult(_0x1d75e5,0xc9))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x29')]=function(_0x4b6bbb,_0x46924d){if(_0x4b6bbb[_0x3071('0x4d')]['id']){delete _0x4b6bbb['body']['id'];}return db[_0x3071('0x44')][_0x3071('0x4e')]({'where':{'id':_0x4b6bbb[_0x3071('0x4f')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x46924d,null))[_0x3071('0x2a')](saveUpdates(_0x4b6bbb[_0x3071('0x4d')],null))[_0x3071('0x2a')](respondWithResult(_0x46924d,null))['catch'](handleError(_0x46924d,null));};exports[_0x3071('0x2b')]=function(_0x486b7a,_0x443b0e){return db[_0x3071('0x44')]['find']({'where':{'id':_0x486b7a[_0x3071('0x4f')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x443b0e,null))[_0x3071('0x2a')](removeEntity(_0x443b0e,null))[_0x3071('0x49')](handleError(_0x443b0e,null));};exports[_0x3071('0x50')]=function(_0x26c8e4,_0x3ab6d4){return db[_0x3071('0x44')][_0x3071('0x50')]()[_0x3071('0x2a')](respondWithResult(_0x3ab6d4,null))[_0x3071('0x49')](handleError(_0x3ab6d4,null));};exports[_0x3071('0x51')]=function(_0x24977b,_0x114f1f){var _0x1656de={},_0x12be97={},_0x596cdd={'count':0x0,'rows':[]};_0x12be97['model']=_[_0x3071('0x32')](db['VoiceQueueReport'][_0x3071('0x30')]);_0x12be97[_0x3071('0x33')]=_[_0x3071('0x32')](_0x24977b['query']);_0x12be97[_0x3071('0x34')]=_[_0x3071('0x35')](_0x12be97['model'],_0x12be97['query']);_0x1656de[_0x3071('0x37')]=_[_0x3071('0x35')](_0x12be97[_0x3071('0x31')],qs[_0x3071('0x36')](_0x24977b['query'][_0x3071('0x36')]));_0x1656de[_0x3071('0x37')]=_0x1656de[_0x3071('0x37')][_0x3071('0x4b')]?_0x1656de[_0x3071('0x37')]:_0x12be97['model'];if(!_0x24977b[_0x3071('0x33')][_0x3071('0x38')](_0x3071('0x39'))){_0x1656de[_0x3071('0x24')]=qs[_0x3071('0x24')](_0x24977b[_0x3071('0x33')][_0x3071('0x24')]);_0x1656de['offset']=qs['offset'](_0x24977b[_0x3071('0x33')]['offset']);}_0x1656de[_0x3071('0x3a')]=qs[_0x3071('0x3b')](_0x24977b['query'][_0x3071('0x3b')]);_0x1656de[_0x3071('0x3c')]=qs['filters'](_[_0x3071('0x3d')](_0x24977b[_0x3071('0x33')],_0x12be97[_0x3071('0x34')]));if(_0x24977b[_0x3071('0x33')][_0x3071('0x3e')]){_0x1656de['where']=_[_0x3071('0x3f')](_0x1656de[_0x3071('0x3c')],{'$or':_[_0x3071('0x40')](_0x1656de['attributes'],function(_0x1b0f81){var _0x238fa9={};_0x238fa9[_0x1b0f81]={'$like':'%'+_0x24977b[_0x3071('0x33')][_0x3071('0x3e')]+'%'};return _0x238fa9;})});}_0x1656de=_[_0x3071('0x3f')]({},_0x1656de,_0x24977b[_0x3071('0x43')]);var _0xe93f28={'where':_0x1656de[_0x3071('0x3c')]};return db[_0x3071('0x44')]['count'](_0xe93f28)[_0x3071('0x2a')](function(_0x29a58e){_0x596cdd[_0x3071('0x22')]=_0x29a58e;if(_0x24977b[_0x3071('0x33')][_0x3071('0x45')]){_0x1656de[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x44')][_0x3071('0x47')](_0x1656de);})[_0x3071('0x2a')](function(_0x302680){_0x596cdd[_0x3071('0x48')]=_0x302680;return _0x596cdd;})['then'](respondWithFilteredResult(_0x114f1f,_0x1656de,_0x3071('0x51')))[_0x3071('0x49')](handleError(_0x114f1f,null,_0x3071('0x51')));}; \ No newline at end of file +var _0xa9e0=['../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','VoiceQueueReport','rows','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','pick','map','findAll','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0a9e('0x13')]=_[_0x0a9e('0x14')](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x15'),'port':0x18eb});var socket=require(_0x0a9e('0x16'))(new Redis(config[_0x0a9e('0x13')]));require('./voiceQueueReport.socket')[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xcc;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x18')](_0x2b4227);}return _0x239b12[_0x0a9e('0x19')](_0x2b4227)['end']();};}function respondWithResult(_0x22dccb,_0x5d0880){_0x5d0880=_0x5d0880||0xc8;return function(_0x1985b6){if(_0x1985b6){return _0x22dccb['status'](_0x5d0880)[_0x0a9e('0x1a')](_0x1985b6);}};}function respondWithFilteredResult(_0x12066b,_0x48f32d){return function(_0x225616){if(_0x225616){var _0x5a0a06=_0x225616[_0x0a9e('0x1b')],_0x459eb1=_0x48f32d[_0x0a9e('0x1c')],_0x478723=_0x48f32d[_0x0a9e('0x1c')]+_0x48f32d[_0x0a9e('0x1d')],_0x106033;if(_0x478723>=_0x5a0a06){_0x478723=_0x5a0a06;_0x106033=0xc8;}else{_0x106033=0xce;}_0x12066b[_0x0a9e('0x19')](_0x106033);return _0x12066b[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x459eb1+'-'+_0x478723+'/'+_0x5a0a06)[_0x0a9e('0x1a')](_0x225616);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x20')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x21')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x22')](_0x5a09ef)[_0x0a9e('0x23')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){_0x4abc77[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x18')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x26')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x27')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x28')](_0x33161b);};}exports[_0x0a9e('0x29')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['VoiceQueueReport'][_0x0a9e('0x2a')];_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x14de77);_0x1538a4[_0x0a9e('0x2d')]=_['keys'](_0x25fba9[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x2b')],_0x1538a4[_0x0a9e('0x2d')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x2b')],qs[_0x0a9e('0x31')](_0x25fba9['query'][_0x0a9e('0x31')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x2b')];if(!_0x25fba9[_0x0a9e('0x2d')]['hasOwnProperty'](_0x0a9e('0x33'))){_0x140511[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x1d')]);_0x140511[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x25fba9[_0x0a9e('0x2d')]['offset']);}_0x140511[_0x0a9e('0x34')]=qs['sort'](_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x140511[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x25fba9[_0x0a9e('0x2d')],_0x1538a4[_0x0a9e('0x2e')]));if(_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x37')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x36')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x38')][_0x0a9e('0x39')]!==_0x0a9e('0x3a')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x3b')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x37')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x36')]};return db['VoiceQueueReport']['count'](_0x1a180b)[_0x0a9e('0x23')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x3f')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x40')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x41')](handleError(_0x14433c,null));};exports[_0x0a9e('0x42')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x43')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x3f')][_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1459bb[_0x0a9e('0x2d')]);_0x2cfea9[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2cfea9[_0x0a9e('0x2b')],_0x2cfea9[_0x0a9e('0x2d')]);_0x316c8f[_0x0a9e('0x30')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x31')](_0x1459bb[_0x0a9e('0x2d')][_0x0a9e('0x31')]));_0x316c8f[_0x0a9e('0x30')]=_0x316c8f[_0x0a9e('0x30')][_0x0a9e('0x32')]?_0x316c8f[_0x0a9e('0x30')]:_0x2cfea9[_0x0a9e('0x2b')];if(_0x1459bb[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x316c8f[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x44')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3f')][_0x0a9e('0x45')](_0x316c8f)[_0x0a9e('0x23')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x23')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x41')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x46')]=function(_0x21eb86,_0x44dd99){return db['VoiceQueueReport'][_0x0a9e('0x46')](_0x21eb86['body'],{})[_0x0a9e('0x23')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x41')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x22')]=function(_0x562fb4,_0x14bec2){if(_0x562fb4[_0x0a9e('0x47')]['id']){delete _0x562fb4[_0x0a9e('0x47')]['id'];}return db[_0x0a9e('0x3f')][_0x0a9e('0x45')]({'where':{'id':_0x562fb4[_0x0a9e('0x43')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x14bec2,null))['then'](saveUpdates(_0x562fb4[_0x0a9e('0x47')],null))[_0x0a9e('0x23')](respondWithResult(_0x14bec2,null))[_0x0a9e('0x41')](handleError(_0x14bec2,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x3f')][_0x0a9e('0x45')]({'where':{'id':_0x409789[_0x0a9e('0x43')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x41')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x3f')][_0x0a9e('0x48')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x41')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x49')]=function(_0x30decb,_0x2e5165){var _0x375c18={},_0x5d38ae={},_0x4b1b9f={'count':0x0,'rows':[]};_0x5d38ae['model']=_[_0x0a9e('0x2c')](db[_0x0a9e('0x3f')][_0x0a9e('0x2a')]);_0x5d38ae['query']=_[_0x0a9e('0x2c')](_0x30decb[_0x0a9e('0x2d')]);_0x5d38ae['filters']=_['intersection'](_0x5d38ae[_0x0a9e('0x2b')],_0x5d38ae['query']);_0x375c18[_0x0a9e('0x30')]=_['intersection'](_0x5d38ae[_0x0a9e('0x2b')],qs[_0x0a9e('0x31')](_0x30decb[_0x0a9e('0x2d')]['fields']));_0x375c18[_0x0a9e('0x30')]=_0x375c18[_0x0a9e('0x30')]['length']?_0x375c18['attributes']:_0x5d38ae[_0x0a9e('0x2b')];if(!_0x30decb[_0x0a9e('0x2d')]['hasOwnProperty'](_0x0a9e('0x33'))){_0x375c18['limit']=qs[_0x0a9e('0x1d')](_0x30decb['query'][_0x0a9e('0x1d')]);_0x375c18['offset']=qs['offset'](_0x30decb['query'][_0x0a9e('0x1c')]);}_0x375c18['order']=qs[_0x0a9e('0x35')](_0x30decb[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x375c18[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x4a')](_0x30decb[_0x0a9e('0x2d')],_0x5d38ae[_0x0a9e('0x2e')]));if(_0x30decb['query'][_0x0a9e('0x37')]){_0x375c18[_0x0a9e('0x36')]=_[_0x0a9e('0x44')](_0x375c18[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x4b')](_0x375c18[_0x0a9e('0x30')],function(_0x5d86e9){var _0x956fbe={};_0x956fbe[_0x5d86e9]={'$like':'%'+_0x30decb[_0x0a9e('0x2d')]['filter']+'%'};return _0x956fbe;})});}_0x375c18=_[_0x0a9e('0x44')]({},_0x375c18,_0x30decb['options']);var _0x20c668={'where':_0x375c18['where']};return db['VoiceQueueReport']['count'](_0x20c668)[_0x0a9e('0x23')](function(_0x49d231){_0x4b1b9f[_0x0a9e('0x1b')]=_0x49d231;if(_0x30decb[_0x0a9e('0x2d')][_0x0a9e('0x3d')]){_0x375c18[_0x0a9e('0x3e')]=[{'all':!![]}];}return db[_0x0a9e('0x3f')][_0x0a9e('0x4c')](_0x375c18);})['then'](function(_0x1627a7){_0x4b1b9f['rows']=_0x1627a7;return _0x4b1b9f;})[_0x0a9e('0x23')](respondWithFilteredResult(_0x2e5165,_0x375c18,_0x0a9e('0x49')))[_0x0a9e('0x41')](handleError(_0x2e5165,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1382ea8..f3a3e66 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 _0x8e24=['hasOwnProperty','hook','exports','setMaxListeners','save','update','remove','emit'];(function(_0x3c458b,_0x2b0243){var _0x4711ee=function(_0x2bb47d){while(--_0x2bb47d){_0x3c458b['push'](_0x3c458b['shift']());}};_0x4711ee(++_0x2b0243);}(_0x8e24,0x133));var _0x48e2=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x8e24[_0x3c2166];return _0x30ccc3;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x48e2('0x0')](0x0);var events={'afterCreate':_0x48e2('0x1'),'afterUpdate':_0x48e2('0x2'),'afterDestroy':_0x48e2('0x3')};function emitEvent(_0x2adc9e){return function(_0x57a06f,_0x136e2d,_0x4e3cca){VoiceQueueReportEvents[_0x48e2('0x4')](_0x2adc9e+':'+_0x57a06f['id'],_0x57a06f);VoiceQueueReportEvents[_0x48e2('0x4')](_0x2adc9e,_0x57a06f);_0x4e3cca(null);};}for(var e in events){if(events[_0x48e2('0x5')](e)){var event=events[e];VoiceQueueReport[_0x48e2('0x6')](e,emitEvent(event));}}module[_0x48e2('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x122e=['hook','events','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x1d9e40,_0x1c44db){var _0x2ee94f=function(_0x37a330){while(--_0x37a330){_0x1d9e40['push'](_0x1d9e40['shift']());}};_0x2ee94f(++_0x1c44db);}(_0x122e,0x1d9));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xe122('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xe122('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe122('0x2')](0x0);var events={'afterCreate':_0xe122('0x3'),'afterUpdate':_0xe122('0x4'),'afterDestroy':_0xe122('0x5')};function emitEvent(_0x3a7fd3){return function(_0x2a9fc2,_0x25816c,_0x4cf89d){VoiceQueueReportEvents['emit'](_0x3a7fd3+':'+_0x2a9fc2['id'],_0x2a9fc2);VoiceQueueReportEvents[_0xe122('0x6')](_0x3a7fd3,_0x2a9fc2);_0x4cf89d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe122('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c7eae5b..edca0e0 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 _0xc198=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','util'];(function(_0x196dc2,_0x237677){var _0x3307c4=function(_0x1e0ca3){while(--_0x1e0ca3){_0x196dc2['push'](_0x196dc2['shift']());}};_0x3307c4(++_0x237677);}(_0xc198,0x125));var _0x8c19=function(_0x344f44,_0x47b1de){_0x344f44=_0x344f44-0x0;var _0xad5654=_0xc198[_0x344f44];return _0xad5654;};'use strict';var _=require('lodash');var util=require(_0x8c19('0x0'));var logger=require(_0x8c19('0x1'))('api');var moment=require(_0x8c19('0x2'));var BPromise=require(_0x8c19('0x3'));var rp=require(_0x8c19('0x4'));var fs=require('fs');var path=require(_0x8c19('0x5'));var rimraf=require(_0x8c19('0x6'));var config=require(_0x8c19('0x7'));var attributes=require(_0x8c19('0x8'));module[_0x8c19('0x9')]=function(_0x4d2f60,_0x2330a8){return _0x4d2f60[_0x8c19('0xa')](_0x8c19('0xb'),attributes,{'tableName':_0x8c19('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x8c19('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c05=['rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1d219c,_0x50820a){var _0x3d9fde=function(_0x2e5b62){while(--_0x2e5b62){_0x1d219c['push'](_0x1d219c['shift']());}};_0x3d9fde(++_0x50820a);}(_0x3c05,0x120));var _0x53c0=function(_0x1a46de,_0xb41b5e){_0x1a46de=_0x1a46de-0x0;var _0x525c8a=_0x3c05[_0x1a46de];return _0x525c8a;};'use strict';var _=require(_0x53c0('0x0'));var util=require(_0x53c0('0x1'));var logger=require(_0x53c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x53c0('0x3'));var rp=require(_0x53c0('0x4'));var fs=require('fs');var path=require(_0x53c0('0x5'));var rimraf=require(_0x53c0('0x6'));var config=require(_0x53c0('0x7'));var attributes=require(_0x53c0('0x8'));module['exports']=function(_0x23a1c8,_0x126f78){return _0x23a1c8[_0x53c0('0x9')](_0x53c0('0xa'),attributes,{'tableName':_0x53c0('0xb'),'paranoid':![],'indexes':[{'fields':[_0x53c0('0xc')]},{'fields':[_0x53c0('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 4e8d7ad..b355490 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 _0x8596=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','then','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','defaults','localhost','redis','register','request','info','request\x20sent','debug','stringify','code','message','error','VoiceQueueReport,\x20%s,\x20%s','result'];(function(_0x3d70dc,_0x2e7008){var _0x5d6828=function(_0x136f2f){while(--_0x136f2f){_0x3d70dc['push'](_0x3d70dc['shift']());}};_0x5d6828(++_0x2e7008);}(_0x8596,0x86));var _0x6859=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8596[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6859('0x0'));var util=require(_0x6859('0x1'));var moment=require('moment');var BPromise=require(_0x6859('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6859('0x3'));var db=require(_0x6859('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6859('0x5'))('rpc');var config=require(_0x6859('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6859('0x7')]['http']({'port':0x232a});config['redis']=_[_0x6859('0x8')](config['redis'],{'host':_0x6859('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6859('0xa')]));require('./voiceQueueReport.socket')[_0x6859('0xb')](socket);function respondWithRpcPromise(_0x14f8c7,_0x19ed66,_0x3e4500){return new BPromise(function(_0x16810c,_0x14b647){return client[_0x6859('0xc')](_0x14f8c7,_0x3e4500)['then'](function(_0x10827a){logger[_0x6859('0xd')]('VoiceQueueReport,\x20%s,\x20%s',_0x19ed66,_0x6859('0xe'));logger[_0x6859('0xf')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x19ed66,_0x6859('0xe'),JSON[_0x6859('0x10')](_0x10827a));if(_0x10827a['error']){if(_0x10827a['error'][_0x6859('0x11')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x19ed66,_0x10827a['error'][_0x6859('0x12')]);return _0x14b647(_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);}logger['error'](_0x6859('0x14'),_0x19ed66,_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);return _0x16810c(_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);}else{logger['info'](_0x6859('0x14'),_0x19ed66,_0x6859('0xe'));_0x16810c(_0x10827a[_0x6859('0x15')][_0x6859('0x12')]);}})[_0x6859('0x16')](function(_0xe7f75e){logger[_0x6859('0x13')](_0x6859('0x14'),_0x19ed66,_0xe7f75e);_0x14b647(_0xe7f75e);});});}exports[_0x6859('0x17')]=function(_0x2dff6d){var _0x1172b4=this;return new Promise(function(_0xdf9200,_0xb18ec1){return db[_0x6859('0x18')][_0x6859('0x19')]({'raw':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dff6d['options']?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1c')]||null:null,'attributes':_0x2dff6d['options']?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1d')]||null:null,'limit':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d['options']['limit']||null:null,'include':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d['options'][_0x6859('0x1e')]?_[_0x6859('0x1f')](_0x2dff6d['options'][_0x6859('0x1e')],function(_0x28ace1){return{'model':db[_0x28ace1[_0x6859('0x20')]],'as':_0x28ace1['as'],'attributes':_0x28ace1[_0x6859('0x1d')],'include':_0x28ace1[_0x6859('0x1e')]?_['map'](_0x28ace1[_0x6859('0x1e')],function(_0x3b2425){return{'model':db[_0x3b2425[_0x6859('0x20')]],'as':_0x3b2425['as'],'attributes':_0x3b2425['attributes'],'include':_0x3b2425[_0x6859('0x1e')]?_[_0x6859('0x1f')](_0x3b2425[_0x6859('0x1e')],function(_0x27bb46){return{'model':db[_0x27bb46['model']],'as':_0x27bb46['as'],'attributes':_0x27bb46[_0x6859('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6859('0x21')](function(_0x475ee2){logger[_0x6859('0xd')](_0x6859('0x17'),_0x2dff6d);logger['debug'](_0x6859('0x17'),_0x2dff6d,JSON[_0x6859('0x10')](_0x475ee2));_0xdf9200(_0x475ee2);})['catch'](function(_0x1ed99f){logger['error'](_0x6859('0x17'),_0x1ed99f[_0x6859('0x12')],_0x2dff6d);_0xb18ec1(_0x1172b4[_0x6859('0x13')](0x1f4,_0x1ed99f[_0x6859('0x12')]));});});};exports['CreateVoiceQueueReport']=function(_0x1c158c){var _0x418413=this;return new Promise(function(_0x211bf3,_0x1d1374){return db[_0x6859('0x18')][_0x6859('0x22')](_0x1c158c[_0x6859('0x23')],{'raw':_0x1c158c[_0x6859('0x1a')]?_0x1c158c[_0x6859('0x1a')][_0x6859('0x1b')]===undefined?!![]:![]:!![]})[_0x6859('0x21')](function(_0x2d9a67){logger['info'](_0x6859('0x24'),_0x1c158c);logger['debug'](_0x6859('0x24'),_0x1c158c,JSON[_0x6859('0x10')](_0x2d9a67));_0x211bf3(_0x2d9a67);})[_0x6859('0x16')](function(_0x1a4b0c){logger[_0x6859('0x13')]('CreateVoiceQueueReport',_0x1a4b0c['message'],_0x1c158c);_0x1d1374(_0x418413[_0x6859('0x13')](0x1f4,_0x1a4b0c['message']));});});};exports[_0x6859('0x25')]=function(_0x4484d1){var _0x251e79=this;return new Promise(function(_0x574c40,_0x339657){return db[_0x6859('0x18')][_0x6859('0x26')](_0x4484d1[_0x6859('0x23')],{'raw':_0x4484d1[_0x6859('0x1a')]?_0x4484d1['options'][_0x6859('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4484d1['options']?_0x4484d1['options']['where']||null:null,'attributes':_0x4484d1[_0x6859('0x1a')]?_0x4484d1[_0x6859('0x1a')][_0x6859('0x1d')]||null:null,'limit':_0x4484d1[_0x6859('0x1a')]?_0x4484d1[_0x6859('0x1a')]['limit']||null:null})[_0x6859('0x21')](function(_0x4dd9c3){logger[_0x6859('0xd')](_0x6859('0x25'),_0x4484d1);logger[_0x6859('0xf')]('UpdateVoiceQueueReport',_0x4484d1,JSON[_0x6859('0x10')](_0x4dd9c3));_0x574c40(_0x4dd9c3);})[_0x6859('0x16')](function(_0x4e2ab4){logger[_0x6859('0x13')](_0x6859('0x25'),_0x4e2ab4[_0x6859('0x12')],_0x4484d1);_0x339657(_0x251e79[_0x6859('0x13')](0x1f4,_0x4e2ab4['message']));});});}; \ No newline at end of file +var _0x64f4=['body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','VoiceQueueReport','create'];(function(_0x4c2f76,_0x449a49){var _0x2066a6=function(_0x3a6b8b){while(--_0x3a6b8b){_0x4c2f76['push'](_0x4c2f76['shift']());}};_0x2066a6(++_0x449a49);}(_0x64f4,0x1d8));var _0x464f=function(_0xa3b671,_0xd5c20b){_0xa3b671=_0xa3b671-0x0;var _0x626bb3=_0x64f4[_0xa3b671];return _0x626bb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x464f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x464f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x464f('0x2'));var logger=require(_0x464f('0x3'))(_0x464f('0x4'));var config=require(_0x464f('0x5'));var jayson=require(_0x464f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x464f('0x7')]=_[_0x464f('0x8')](config[_0x464f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x464f('0x9'))(new Redis(config[_0x464f('0x7')]));require(_0x464f('0xa'))[_0x464f('0xb')](socket);function respondWithRpcPromise(_0x576621,_0x1db2e6,_0x444e50){return new BPromise(function(_0x1fe20b,_0x54ef80){return client[_0x464f('0xc')](_0x576621,_0x444e50)[_0x464f('0xd')](function(_0x5ec5f5){logger[_0x464f('0xe')](_0x464f('0xf'),_0x1db2e6,_0x464f('0x10'));logger[_0x464f('0x11')](_0x464f('0x12'),_0x1db2e6,_0x464f('0x10'),JSON[_0x464f('0x13')](_0x5ec5f5));if(_0x5ec5f5[_0x464f('0x14')]){if(_0x5ec5f5['error']['code']===0x1f4){logger[_0x464f('0x14')](_0x464f('0xf'),_0x1db2e6,_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);return _0x54ef80(_0x5ec5f5['error'][_0x464f('0x15')]);}logger[_0x464f('0x14')](_0x464f('0xf'),_0x1db2e6,_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);return _0x1fe20b(_0x5ec5f5[_0x464f('0x14')][_0x464f('0x15')]);}else{logger['info'](_0x464f('0xf'),_0x1db2e6,_0x464f('0x10'));_0x1fe20b(_0x5ec5f5[_0x464f('0x16')][_0x464f('0x15')]);}})[_0x464f('0x17')](function(_0x17f05d){logger[_0x464f('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x1db2e6,_0x17f05d);_0x54ef80(_0x17f05d);});});}exports['GetVoiceQueueReport']=function(_0x16831f){var _0x189364=this;return new Promise(function(_0x14fce8,_0x5c54d8){return db['VoiceQueueReport']['findAll']({'raw':_0x16831f[_0x464f('0x18')]?_0x16831f[_0x464f('0x18')][_0x464f('0x19')]===undefined?!![]:![]:!![],'where':_0x16831f['options']?_0x16831f['options'][_0x464f('0x1a')]||null:null,'attributes':_0x16831f['options']?_0x16831f['options'][_0x464f('0x1b')]||null:null,'limit':_0x16831f[_0x464f('0x18')]?_0x16831f[_0x464f('0x18')][_0x464f('0x1c')]||null:null,'include':_0x16831f['options']?_0x16831f[_0x464f('0x18')][_0x464f('0x1d')]?_['map'](_0x16831f[_0x464f('0x18')]['include'],function(_0x53486b){return{'model':db[_0x53486b['model']],'as':_0x53486b['as'],'attributes':_0x53486b[_0x464f('0x1b')],'include':_0x53486b['include']?_['map'](_0x53486b[_0x464f('0x1d')],function(_0x138706){return{'model':db[_0x138706['model']],'as':_0x138706['as'],'attributes':_0x138706[_0x464f('0x1b')],'include':_0x138706[_0x464f('0x1d')]?_[_0x464f('0x1e')](_0x138706[_0x464f('0x1d')],function(_0x1cd8e4){return{'model':db[_0x1cd8e4[_0x464f('0x1f')]],'as':_0x1cd8e4['as'],'attributes':_0x1cd8e4[_0x464f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x464f('0xd')](function(_0x3ca987){logger[_0x464f('0xe')](_0x464f('0x20'),_0x16831f);logger[_0x464f('0x11')]('GetVoiceQueueReport',_0x16831f,JSON['stringify'](_0x3ca987));_0x14fce8(_0x3ca987);})[_0x464f('0x17')](function(_0x32f8a9){logger[_0x464f('0x14')](_0x464f('0x20'),_0x32f8a9[_0x464f('0x15')],_0x16831f);_0x5c54d8(_0x189364[_0x464f('0x14')](0x1f4,_0x32f8a9[_0x464f('0x15')]));});});};exports['CreateVoiceQueueReport']=function(_0x4fc2db){var _0xfd7966=this;return new Promise(function(_0x592eba,_0x37363c){return db[_0x464f('0x21')][_0x464f('0x22')](_0x4fc2db[_0x464f('0x23')],{'raw':_0x4fc2db[_0x464f('0x18')]?_0x4fc2db[_0x464f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x464f('0xd')](function(_0x2c3679){logger[_0x464f('0xe')]('CreateVoiceQueueReport',_0x4fc2db);logger[_0x464f('0x11')](_0x464f('0x24'),_0x4fc2db,JSON[_0x464f('0x13')](_0x2c3679));_0x592eba(_0x2c3679);})[_0x464f('0x17')](function(_0x55c516){logger[_0x464f('0x14')](_0x464f('0x24'),_0x55c516[_0x464f('0x15')],_0x4fc2db);_0x37363c(_0xfd7966[_0x464f('0x14')](0x1f4,_0x55c516[_0x464f('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x462b33){var _0x58ee28=this;return new Promise(function(_0x2d97f7,_0x15fd96){return db[_0x464f('0x21')][_0x464f('0x25')](_0x462b33[_0x464f('0x23')],{'raw':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x1a')]||null:null,'attributes':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')][_0x464f('0x1b')]||null:null,'limit':_0x462b33[_0x464f('0x18')]?_0x462b33[_0x464f('0x18')]['limit']||null:null})[_0x464f('0xd')](function(_0x2fe1b2){logger[_0x464f('0xe')](_0x464f('0x26'),_0x462b33);logger['debug'](_0x464f('0x26'),_0x462b33,JSON[_0x464f('0x13')](_0x2fe1b2));_0x2d97f7(_0x2fe1b2);})[_0x464f('0x17')](function(_0x1b1e6f){logger['error']('UpdateVoiceQueueReport',_0x1b1e6f[_0x464f('0x15')],_0x462b33);_0x15fd96(_0x58ee28['error'](0x1f4,_0x1b1e6f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 41d1f2a..23a383f 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 _0xa7c8=['update','removeListener','register','length','./voiceQueueReport.events','remove'];(function(_0x11c01d,_0x2df2bf){var _0x531c48=function(_0x381064){while(--_0x381064){_0x11c01d['push'](_0x11c01d['shift']());}};_0x531c48(++_0x2df2bf);}(_0xa7c8,0x82));var _0x8a7c=function(_0x42eeaf,_0x24fbf1){_0x42eeaf=_0x42eeaf-0x0;var _0x4f73a0=_0xa7c8[_0x42eeaf];return _0x4f73a0;};'use strict';var VoiceQueueReportEvents=require(_0x8a7c('0x0'));var events=['save',_0x8a7c('0x1'),_0x8a7c('0x2')];function createListener(_0x2a6321,_0x563c48){return function(_0x43eebc){_0x563c48['emit'](_0x2a6321,_0x43eebc);};}function removeListener(_0xd11d72,_0x15003d){return function(){VoiceQueueReportEvents[_0x8a7c('0x3')](_0xd11d72,_0x15003d);};}exports[_0x8a7c('0x4')]=function(_0x566951){for(var _0xa29ec6=0x0,_0x5456f1=events[_0x8a7c('0x5')];_0xa29ec6<_0x5456f1;_0xa29ec6++){var _0x60a146=events[_0xa29ec6];var _0x2fa463=createListener('voiceQueueReport:'+_0x60a146,_0x566951);VoiceQueueReportEvents['on'](_0x60a146,_0x2fa463);}}; \ No newline at end of file +var _0xa620=['save','remove','update','removeListener','length','voiceQueueReport:'];(function(_0x4e6b06,_0x2973df){var _0x46442c=function(_0x5159c9){while(--_0x5159c9){_0x4e6b06['push'](_0x4e6b06['shift']());}};_0x46442c(++_0x2973df);}(_0xa620,0x138));var _0x0a62=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0xa620[_0x40f991];return _0x38eca2;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x0a62('0x0'),_0x0a62('0x1'),_0x0a62('0x2')];function createListener(_0x1bd386,_0x5de26b){return function(_0x49c97c){_0x5de26b['emit'](_0x1bd386,_0x49c97c);};}function removeListener(_0x2bbb26,_0x4d4956){return function(){VoiceQueueReportEvents[_0x0a62('0x3')](_0x2bbb26,_0x4d4956);};}exports['register']=function(_0x3e31c2){for(var _0x56faff=0x0,_0x1a0416=events[_0x0a62('0x4')];_0x56faff<_0x1a0416;_0x56faff++){var _0x5967e5=events[_0x56faff];var _0x38016c=createListener(_0x0a62('0x5')+_0x5967e5,_0x3e31c2);VoiceQueueReportEvents['on'](_0x5967e5,_0x38016c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 2520dfd..e071951 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 _0x307e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x5abe0a,_0x3dcc84){var _0x5e5169=function(_0x278a90){while(--_0x278a90){_0x5abe0a['push'](_0x5abe0a['shift']());}};_0x5e5169(++_0x3dcc84);}(_0x307e,0xc9));var _0xe307=function(_0xad71da,_0x592494){_0xad71da=_0xad71da-0x0;var _0xe6056e=_0x307e[_0xad71da];return _0xe6056e;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var auth=require(_0xe307('0x5'));var interaction=require(_0xe307('0x6'));var config=require('../../config/environment');var controller=require(_0xe307('0x7'));router['get']('/',auth[_0xe307('0x8')](),controller[_0xe307('0x9')]);router[_0xe307('0xa')]('/:id',auth[_0xe307('0x8')](),controller[_0xe307('0xb')]);router[_0xe307('0xc')]('/',auth[_0xe307('0x8')](),controller[_0xe307('0xd')]);router[_0xe307('0xe')](_0xe307('0xf'),auth[_0xe307('0x8')](),controller[_0xe307('0x10')]);router[_0xe307('0x11')](_0xe307('0xf'),auth[_0xe307('0x8')](),controller[_0xe307('0x12')]);module[_0xe307('0x13')]=router; \ No newline at end of file +var _0x5bc1=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x50edd8,_0x4d6889){var _0x1bcc3f=function(_0x7f901b){while(--_0x7f901b){_0x50edd8['push'](_0x50edd8['shift']());}};_0x1bcc3f(++_0x4d6889);}(_0x5bc1,0xb5));var _0x15bc=function(_0x2c921c,_0x3c6a85){_0x2c921c=_0x2c921c-0x0;var _0x440bf2=_0x5bc1[_0x2c921c];return _0x440bf2;};'use strict';var multer=require('multer');var util=require(_0x15bc('0x0'));var path=require(_0x15bc('0x1'));var timeout=require(_0x15bc('0x2'));var express=require(_0x15bc('0x3'));var router=express[_0x15bc('0x4')]();var auth=require(_0x15bc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x15bc('0x6'));router[_0x15bc('0x7')]('/',auth[_0x15bc('0x8')](),controller['index']);router[_0x15bc('0x7')]('/:id',auth[_0x15bc('0x8')](),controller[_0x15bc('0x9')]);router[_0x15bc('0xa')]('/',auth[_0x15bc('0x8')](),controller[_0x15bc('0xb')]);router[_0x15bc('0xc')](_0x15bc('0xd'),auth[_0x15bc('0x8')](),controller[_0x15bc('0xe')]);router[_0x15bc('0xf')]('/:id',auth[_0x15bc('0x8')](),controller[_0x15bc('0x10')]);module[_0x15bc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9eacb09..70f3ac1 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 _0x4b84=['sequelize','moment','STRING','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x4b84[_0x2265da];return _0x430c2b;};'use strict';var Sequelize=require(_0x44b8('0x0'));var moment=require(_0x44b8('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x44b8('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xbd50=['sequelize','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a96ef,_0x5c1383){var _0x330714=function(_0x1bc221){while(--_0x1bc221){_0x4a96ef['push'](_0x4a96ef['shift']());}};_0x330714(++_0x5c1383);}(_0xbd50,0x196));var _0x0bd5=function(_0x446566,_0x11eb35){_0x446566=_0x446566-0x0;var _0x4a2966=_0xbd50[_0x446566];return _0x4a2966;};'use strict';var Sequelize=require(_0x0bd5('0x0'));var moment=require(_0x0bd5('0x1'));module[_0x0bd5('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0bd5('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0bd5('0x4')],'allowNull':![],'defaultValue':moment()[_0x0bd5('0x5')](_0x0bd5('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1a36f64..23dc3a4 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 _0x19af=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','reject','update','then','end','error','name','send','VoiceQueuesLog','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','field','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','destroy','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x24897a,_0x2c9aa0){var _0x3fb7b0=function(_0x1699ce){while(--_0x1699ce){_0x24897a['push'](_0x24897a['shift']());}};_0x3fb7b0(++_0x2c9aa0);}(_0x19af,0xf3));var _0xf19a=function(_0x1d5759,_0x417e09){_0x1d5759=_0x1d5759-0x0;var _0x51ddcd=_0x19af[_0x1d5759];return _0x51ddcd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf19a('0x0'));var zipdir=require(_0xf19a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf19a('0x2'));var moment=require('moment');var BPromise=require(_0xf19a('0x3'));var Mustache=require('mustache');var util=require(_0xf19a('0x4'));var path=require(_0xf19a('0x5'));var sox=require(_0xf19a('0x6'));var csv=require(_0xf19a('0x7'));var ejs=require(_0xf19a('0x8'));var fs=require('fs');var _=require(_0xf19a('0x9'));var squel=require('squel');var crypto=require(_0xf19a('0xa'));var jsforce=require(_0xf19a('0xb'));var deskjs=require(_0xf19a('0xc'));var toCsv=require(_0xf19a('0x7'));var querystring=require(_0xf19a('0xd'));var Papa=require(_0xf19a('0xe'));var Redis=require(_0xf19a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf19a('0x10'));var hardwareService=require(_0xf19a('0x11'));var logger=require('../../config/logger')(_0xf19a('0x12'));var utils=require(_0xf19a('0x13'));var config=require(_0xf19a('0x14'));var db=require(_0xf19a('0x15'))['db'];function respondWithStatusCode(_0x498d2d,_0x50e987){_0x50e987=_0x50e987||0xcc;return function(_0x151145){if(_0x151145){return _0x498d2d['sendStatus'](_0x50e987);}return _0x498d2d[_0xf19a('0x16')](_0x50e987)['end']();};}function respondWithResult(_0x5415bc,_0x43be34){_0x43be34=_0x43be34||0xc8;return function(_0x35b8e0){if(_0x35b8e0){return _0x5415bc['status'](_0x43be34)['json'](_0x35b8e0);}};}function respondWithFilteredResult(_0x89f8a6,_0x1b4030){return function(_0xd1badc){if(_0xd1badc){var _0x4366cd=_0xd1badc[_0xf19a('0x17')],_0x12a3d0=_0x1b4030[_0xf19a('0x18')],_0x5454ca=_0x1b4030[_0xf19a('0x18')]+_0x1b4030[_0xf19a('0x19')],_0x29b2bd;if(_0x5454ca>=_0x4366cd){_0x5454ca=_0x4366cd;_0x29b2bd=0xc8;}else{_0x29b2bd=0xce;}_0x89f8a6[_0xf19a('0x16')](_0x29b2bd);return _0x89f8a6['set'](_0xf19a('0x1a'),_0x12a3d0+'-'+_0x5454ca+'/'+_0x4366cd)['json'](_0xd1badc);}return null;};}function patchUpdates(_0x2a9ec){return function(_0xdc44a7){try{jsonpatch['apply'](_0xdc44a7,_0x2a9ec,!![]);}catch(_0x5987d2){return BPromise[_0xf19a('0x1b')](_0x5987d2);}return _0xdc44a7['save']();};}function saveUpdates(_0x3b3ac4,_0x2f4045){return function(_0x7818d){if(_0x7818d){return _0x7818d[_0xf19a('0x1c')](_0x3b3ac4)[_0xf19a('0x1d')](function(_0x37dc06){return _0x37dc06;});}return null;};}function removeEntity(_0x14e0e6,_0x38c2c9){return function(_0x1b5869){if(_0x1b5869){return _0x1b5869['destroy']()['then'](function(){_0x14e0e6['status'](0xcc)[_0xf19a('0x1e')]();});}};}function handleEntityNotFound(_0x45682e,_0xd51f13){return function(_0x3f62c4){if(!_0x3f62c4){_0x45682e['sendStatus'](0x194);}return _0x3f62c4;};}function handleError(_0x336803,_0x2f6045){_0x2f6045=_0x2f6045||0x1f4;return function(_0x254ee5){logger[_0xf19a('0x1f')](_0x254ee5['stack']);if(_0x254ee5[_0xf19a('0x20')]){delete _0x254ee5[_0xf19a('0x20')];}_0x336803[_0xf19a('0x16')](_0x2f6045)[_0xf19a('0x21')](_0x254ee5);};}exports['index']=function(_0x1bbfc0,_0x5d2488){var _0x490d9a={},_0x13e591={},_0x1e70fc={'count':0x0,'rows':[]};var _0x597cd5=db[_0xf19a('0x22')]['rawAttributes'];_0x13e591['model']=_['keys'](_0x597cd5);_0x13e591['query']=_[_0xf19a('0x23')](_0x1bbfc0[_0xf19a('0x24')]);_0x13e591[_0xf19a('0x25')]=_[_0xf19a('0x26')](_0x13e591[_0xf19a('0x27')],_0x13e591[_0xf19a('0x24')]);_0x490d9a[_0xf19a('0x28')]=_[_0xf19a('0x26')](_0x13e591['model'],qs['fields'](_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x29')]));_0x490d9a['attributes']=_0x490d9a[_0xf19a('0x28')][_0xf19a('0x2a')]?_0x490d9a[_0xf19a('0x28')]:_0x13e591[_0xf19a('0x27')];if(!_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x2b')](_0xf19a('0x2c'))){_0x490d9a[_0xf19a('0x19')]=qs[_0xf19a('0x19')](_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x19')]);_0x490d9a['offset']=qs[_0xf19a('0x18')](_0x1bbfc0[_0xf19a('0x24')]['offset']);}_0x490d9a[_0xf19a('0x2d')]=qs[_0xf19a('0x2e')](_0x1bbfc0['query']['sort']);_0x490d9a[_0xf19a('0x2f')]=qs['filters'](_[_0xf19a('0x30')](_0x1bbfc0['query'],_0x13e591[_0xf19a('0x25')]));if(_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x31')]){_0x490d9a[_0xf19a('0x2f')]=_['merge'](_0x490d9a[_0xf19a('0x2f')],{'$or':_[_0xf19a('0x32')](_0x597cd5,function(_0x583bdc){if(_0x583bdc['type'][_0xf19a('0x33')]!=='VIRTUAL'){var _0x2fc8b3={};_0x2fc8b3[_0x583bdc[_0xf19a('0x34')]]={'$like':'%'+_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x31')]+'%'};return _0x2fc8b3;}})});}_0x490d9a=_['merge']({},_0x490d9a,_0x1bbfc0['options']);var _0x576f7f={'where':_0x490d9a['where']};return db['VoiceQueuesLog'][_0xf19a('0x17')](_0x576f7f)[_0xf19a('0x1d')](function(_0x2a6c81){_0x1e70fc[_0xf19a('0x17')]=_0x2a6c81;if(_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x35')]){_0x490d9a[_0xf19a('0x36')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x490d9a);})[_0xf19a('0x1d')](function(_0xbdf538){_0x1e70fc['rows']=_0xbdf538;return _0x1e70fc;})['then'](respondWithFilteredResult(_0x5d2488,_0x490d9a))[_0xf19a('0x37')](handleError(_0x5d2488,null));};exports[_0xf19a('0x38')]=function(_0x36d31a,_0x5d9897){var _0x26915f={'raw':!![],'where':{'id':_0x36d31a[_0xf19a('0x39')]['id']}},_0x19f921={};_0x19f921[_0xf19a('0x27')]=_['keys'](db[_0xf19a('0x22')][_0xf19a('0x3a')]);_0x19f921['query']=_[_0xf19a('0x23')](_0x36d31a[_0xf19a('0x24')]);_0x19f921['filters']=_[_0xf19a('0x26')](_0x19f921['model'],_0x19f921[_0xf19a('0x24')]);_0x26915f[_0xf19a('0x28')]=_['intersection'](_0x19f921[_0xf19a('0x27')],qs[_0xf19a('0x29')](_0x36d31a[_0xf19a('0x24')][_0xf19a('0x29')]));_0x26915f['attributes']=_0x26915f[_0xf19a('0x28')]['length']?_0x26915f[_0xf19a('0x28')]:_0x19f921[_0xf19a('0x27')];if(_0x36d31a[_0xf19a('0x24')][_0xf19a('0x35')]){_0x26915f[_0xf19a('0x36')]=[{'all':!![]}];}_0x26915f=_[_0xf19a('0x3b')]({},_0x26915f,_0x36d31a['options']);return db[_0xf19a('0x22')][_0xf19a('0x3c')](_0x26915f)[_0xf19a('0x1d')](handleEntityNotFound(_0x5d9897,null))['then'](respondWithResult(_0x5d9897,null))[_0xf19a('0x37')](handleError(_0x5d9897,null));};exports['create']=function(_0x5c34a6,_0x344647){return db[_0xf19a('0x22')][_0xf19a('0x3d')](_0x5c34a6['body'],{})[_0xf19a('0x1d')](respondWithResult(_0x344647,0xc9))[_0xf19a('0x37')](handleError(_0x344647,null));};exports[_0xf19a('0x1c')]=function(_0x47151d,_0x3ad02f){if(_0x47151d['body']['id']){delete _0x47151d[_0xf19a('0x3e')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x47151d[_0xf19a('0x39')]['id']}})[_0xf19a('0x1d')](handleEntityNotFound(_0x3ad02f,null))[_0xf19a('0x1d')](saveUpdates(_0x47151d[_0xf19a('0x3e')],null))['then'](respondWithResult(_0x3ad02f,null))[_0xf19a('0x37')](handleError(_0x3ad02f,null));};exports[_0xf19a('0x3f')]=function(_0x442f3d,_0x321dca){return db[_0xf19a('0x22')][_0xf19a('0x3c')]({'where':{'id':_0x442f3d['params']['id']}})[_0xf19a('0x1d')](handleEntityNotFound(_0x321dca,null))['then'](removeEntity(_0x321dca,null))[_0xf19a('0x37')](handleError(_0x321dca,null));}; \ No newline at end of file +var _0x47d2=['apply','reject','save','update','then','end','error','stack','name','send','VoiceQueuesLog','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','include','rows','show','params','keys','includeAll','find','create','body','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x47d2,0x1d4));var _0x247d=function(_0x2ba049,_0x14ad52){_0x2ba049=_0x2ba049-0x0;var _0x1380e5=_0x47d2[_0x2ba049];return _0x1380e5;};'use strict';var pdf=require(_0x247d('0x0'));var emlformat=require(_0x247d('0x1'));var rimraf=require(_0x247d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x247d('0x3'));var rp=require(_0x247d('0x4'));var moment=require(_0x247d('0x5'));var BPromise=require(_0x247d('0x6'));var Mustache=require(_0x247d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x247d('0x8'));var csv=require(_0x247d('0x9'));var ejs=require(_0x247d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x247d('0xb'));var crypto=require('crypto');var jsforce=require(_0x247d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x247d('0x9'));var querystring=require(_0x247d('0xd'));var Papa=require(_0x247d('0xe'));var Redis=require(_0x247d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x247d('0x10'));var hardwareService=require(_0x247d('0x11'));var logger=require(_0x247d('0x12'))(_0x247d('0x13'));var utils=require(_0x247d('0x14'));var config=require(_0x247d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x733789,_0x2c830f){_0x2c830f=_0x2c830f||0xcc;return function(_0x2e2f6d){if(_0x2e2f6d){return _0x733789[_0x247d('0x16')](_0x2c830f);}return _0x733789['status'](_0x2c830f)['end']();};}function respondWithResult(_0x44552c,_0x4c7b3b){_0x4c7b3b=_0x4c7b3b||0xc8;return function(_0x5017f1){if(_0x5017f1){return _0x44552c[_0x247d('0x17')](_0x4c7b3b)['json'](_0x5017f1);}};}function respondWithFilteredResult(_0x24f01e,_0x5dcca6){return function(_0x2e4238){if(_0x2e4238){var _0x617767=_0x2e4238[_0x247d('0x18')],_0x5a3789=_0x5dcca6[_0x247d('0x19')],_0x259b0f=_0x5dcca6[_0x247d('0x19')]+_0x5dcca6['limit'],_0x1f043c;if(_0x259b0f>=_0x617767){_0x259b0f=_0x617767;_0x1f043c=0xc8;}else{_0x1f043c=0xce;}_0x24f01e[_0x247d('0x17')](_0x1f043c);return _0x24f01e[_0x247d('0x1a')](_0x247d('0x1b'),_0x5a3789+'-'+_0x259b0f+'/'+_0x617767)[_0x247d('0x1c')](_0x2e4238);}return null;};}function patchUpdates(_0x30ed18){return function(_0x2417dc){try{jsonpatch[_0x247d('0x1d')](_0x2417dc,_0x30ed18,!![]);}catch(_0x4f96ce){return BPromise[_0x247d('0x1e')](_0x4f96ce);}return _0x2417dc[_0x247d('0x1f')]();};}function saveUpdates(_0x830428,_0x47d2e3){return function(_0x5af56e){if(_0x5af56e){return _0x5af56e[_0x247d('0x20')](_0x830428)[_0x247d('0x21')](function(_0x42fb92){return _0x42fb92;});}return null;};}function removeEntity(_0x16e080,_0x18f1a7){return function(_0x8489b4){if(_0x8489b4){return _0x8489b4['destroy']()[_0x247d('0x21')](function(){_0x16e080['status'](0xcc)[_0x247d('0x22')]();});}};}function handleEntityNotFound(_0x4d8116,_0x50d91a){return function(_0x5209eb){if(!_0x5209eb){_0x4d8116[_0x247d('0x16')](0x194);}return _0x5209eb;};}function handleError(_0x2bfd0b,_0x2569bc){_0x2569bc=_0x2569bc||0x1f4;return function(_0xd6dcff){logger[_0x247d('0x23')](_0xd6dcff[_0x247d('0x24')]);if(_0xd6dcff[_0x247d('0x25')]){delete _0xd6dcff[_0x247d('0x25')];}_0x2bfd0b[_0x247d('0x17')](_0x2569bc)[_0x247d('0x26')](_0xd6dcff);};}exports['index']=function(_0x344dc9,_0x1f3b04){var _0x5dcfc8={},_0x2caf1a={},_0xeee5ae={'count':0x0,'rows':[]};var _0x477807=db[_0x247d('0x27')][_0x247d('0x28')];_0x2caf1a[_0x247d('0x29')]=_['keys'](_0x477807);_0x2caf1a[_0x247d('0x2a')]=_['keys'](_0x344dc9[_0x247d('0x2a')]);_0x2caf1a[_0x247d('0x2b')]=_[_0x247d('0x2c')](_0x2caf1a['model'],_0x2caf1a[_0x247d('0x2a')]);_0x5dcfc8['attributes']=_['intersection'](_0x2caf1a[_0x247d('0x29')],qs[_0x247d('0x2d')](_0x344dc9[_0x247d('0x2a')][_0x247d('0x2d')]));_0x5dcfc8[_0x247d('0x2e')]=_0x5dcfc8[_0x247d('0x2e')]['length']?_0x5dcfc8[_0x247d('0x2e')]:_0x2caf1a['model'];if(!_0x344dc9['query'][_0x247d('0x2f')](_0x247d('0x30'))){_0x5dcfc8[_0x247d('0x31')]=qs[_0x247d('0x31')](_0x344dc9['query'][_0x247d('0x31')]);_0x5dcfc8[_0x247d('0x19')]=qs[_0x247d('0x19')](_0x344dc9[_0x247d('0x2a')][_0x247d('0x19')]);}_0x5dcfc8[_0x247d('0x32')]=qs['sort'](_0x344dc9[_0x247d('0x2a')][_0x247d('0x33')]);_0x5dcfc8[_0x247d('0x34')]=qs[_0x247d('0x2b')](_[_0x247d('0x35')](_0x344dc9[_0x247d('0x2a')],_0x2caf1a[_0x247d('0x2b')]));if(_0x344dc9[_0x247d('0x2a')][_0x247d('0x36')]){_0x5dcfc8[_0x247d('0x34')]=_[_0x247d('0x37')](_0x5dcfc8[_0x247d('0x34')],{'$or':_[_0x247d('0x38')](_0x477807,function(_0x59fd0f){if(_0x59fd0f['type']['key']!==_0x247d('0x39')){var _0x18a42f={};_0x18a42f[_0x59fd0f[_0x247d('0x3a')]]={'$like':'%'+_0x344dc9[_0x247d('0x2a')][_0x247d('0x36')]+'%'};return _0x18a42f;}})});}_0x5dcfc8=_[_0x247d('0x37')]({},_0x5dcfc8,_0x344dc9[_0x247d('0x3b')]);var _0x50a0ae={'where':_0x5dcfc8[_0x247d('0x34')]};return db['VoiceQueuesLog'][_0x247d('0x18')](_0x50a0ae)[_0x247d('0x21')](function(_0x2d962b){_0xeee5ae[_0x247d('0x18')]=_0x2d962b;if(_0x344dc9[_0x247d('0x2a')]['includeAll']){_0x5dcfc8[_0x247d('0x3c')]=[{'all':!![]}];}return db[_0x247d('0x27')]['findAll'](_0x5dcfc8);})[_0x247d('0x21')](function(_0x3483f9){_0xeee5ae[_0x247d('0x3d')]=_0x3483f9;return _0xeee5ae;})['then'](respondWithFilteredResult(_0x1f3b04,_0x5dcfc8))['catch'](handleError(_0x1f3b04,null));};exports[_0x247d('0x3e')]=function(_0x417a6b,_0x417daf){var _0x5a95b2={'raw':!![],'where':{'id':_0x417a6b[_0x247d('0x3f')]['id']}},_0xf27542={};_0xf27542['model']=_['keys'](db[_0x247d('0x27')][_0x247d('0x28')]);_0xf27542[_0x247d('0x2a')]=_[_0x247d('0x40')](_0x417a6b[_0x247d('0x2a')]);_0xf27542[_0x247d('0x2b')]=_[_0x247d('0x2c')](_0xf27542[_0x247d('0x29')],_0xf27542[_0x247d('0x2a')]);_0x5a95b2[_0x247d('0x2e')]=_[_0x247d('0x2c')](_0xf27542[_0x247d('0x29')],qs['fields'](_0x417a6b[_0x247d('0x2a')][_0x247d('0x2d')]));_0x5a95b2[_0x247d('0x2e')]=_0x5a95b2['attributes']['length']?_0x5a95b2['attributes']:_0xf27542['model'];if(_0x417a6b['query'][_0x247d('0x41')]){_0x5a95b2['include']=[{'all':!![]}];}_0x5a95b2=_[_0x247d('0x37')]({},_0x5a95b2,_0x417a6b['options']);return db['VoiceQueuesLog'][_0x247d('0x42')](_0x5a95b2)[_0x247d('0x21')](handleEntityNotFound(_0x417daf,null))[_0x247d('0x21')](respondWithResult(_0x417daf,null))['catch'](handleError(_0x417daf,null));};exports[_0x247d('0x43')]=function(_0x5745e6,_0x2dec4b){return db[_0x247d('0x27')]['create'](_0x5745e6[_0x247d('0x44')],{})[_0x247d('0x21')](respondWithResult(_0x2dec4b,0xc9))[_0x247d('0x45')](handleError(_0x2dec4b,null));};exports['update']=function(_0x372949,_0x201a16){if(_0x372949[_0x247d('0x44')]['id']){delete _0x372949['body']['id'];}return db[_0x247d('0x27')][_0x247d('0x42')]({'where':{'id':_0x372949[_0x247d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x201a16,null))['then'](saveUpdates(_0x372949[_0x247d('0x44')],null))[_0x247d('0x21')](respondWithResult(_0x201a16,null))[_0x247d('0x45')](handleError(_0x201a16,null));};exports[_0x247d('0x46')]=function(_0x4e7391,_0x5b3423){return db[_0x247d('0x27')][_0x247d('0x42')]({'where':{'id':_0x4e7391['params']['id']}})['then'](handleEntityNotFound(_0x5b3423,null))[_0x247d('0x21')](removeEntity(_0x5b3423,null))[_0x247d('0x45')](handleError(_0x5b3423,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fc4e876..65e6e0a 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 _0x3dfa=['path','../../config/environment','define','VoiceQueuesLog','voice_queues_log','dtm','util','moment','bluebird'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x3dfa,0x19b));var _0xa3df=function(_0x273be5,_0x4fe892){_0x273be5=_0x273be5-0x0;var _0x29a5be=_0x3dfa[_0x273be5];return _0x29a5be;};'use strict';var _=require('lodash');var util=require(_0xa3df('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa3df('0x1'));var BPromise=require(_0xa3df('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3df('0x3'));var rimraf=require('rimraf');var config=require(_0xa3df('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x1b104f,_0x467845){return _0x1b104f[_0xa3df('0x5')](_0xa3df('0x6'),attributes,{'tableName':_0xa3df('0x7'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xa3df('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0x15fa=['VoiceQueuesLog','event_dtm','dtm','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0xfe1c6e,_0x4aeebf){var _0x284e19=function(_0x1993d4){while(--_0x1993d4){_0xfe1c6e['push'](_0xfe1c6e['shift']());}};_0x284e19(++_0x4aeebf);}(_0x15fa,0x1cb));var _0xa15f=function(_0x41584e,_0x489d3c){_0x41584e=_0x41584e-0x0;var _0x456c48=_0x15fa[_0x41584e];return _0x456c48;};'use strict';var _=require(_0xa15f('0x0'));var util=require(_0xa15f('0x1'));var logger=require(_0xa15f('0x2'))(_0xa15f('0x3'));var moment=require(_0xa15f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa15f('0x5'));var rimraf=require(_0xa15f('0x6'));var config=require(_0xa15f('0x7'));var attributes=require(_0xa15f('0x8'));module['exports']=function(_0x5eff86,_0x1dd048){return _0x5eff86['define'](_0xa15f('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xa15f('0xa'),'fields':['event',_0xa15f('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 381a2ac..fb4745b 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 _0xa849=['http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21783f,_0x21fd7c){var _0xd87dba=function(_0x4824d5){while(--_0x4824d5){_0x21783f['push'](_0x21783f['shift']());}};_0xd87dba(++_0x21fd7c);}(_0xa849,0x175));var _0x9a84=function(_0x457d00,_0x4cc70c){_0x457d00=_0x457d00-0x0;var _0x5a87f6=_0xa849[_0x457d00];return _0x5a87f6;};'use strict';var _=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var moment=require(_0x9a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a84('0x3'));var fs=require('fs');var Redis=require(_0x9a84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a84('0x5'));var logger=require(_0x9a84('0x6'))(_0x9a84('0x7'));var config=require(_0x9a84('0x8'));var jayson=require(_0x9a84('0x9'));var client=jayson[_0x9a84('0xa')][_0x9a84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5685,_0x4db29a,_0x305fdb){return new BPromise(function(_0x9e4193,_0xce5400){return client[_0x9a84('0xc')](_0x2f5685,_0x305fdb)[_0x9a84('0xd')](function(_0x23794c){logger['info'](_0x9a84('0xe'),_0x4db29a,_0x9a84('0xf'));logger[_0x9a84('0x10')](_0x9a84('0x11'),_0x4db29a,'request\x20sent',JSON[_0x9a84('0x12')](_0x23794c));if(_0x23794c['error']){if(_0x23794c[_0x9a84('0x13')][_0x9a84('0x14')]===0x1f4){logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);return _0xce5400(_0x23794c[_0x9a84('0x13')]['message']);}logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);return _0x9e4193(_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);}else{logger['info'](_0x9a84('0xe'),_0x4db29a,_0x9a84('0xf'));_0x9e4193(_0x23794c[_0x9a84('0x16')]['message']);}})[_0x9a84('0x17')](function(_0x2dca64){logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x2dca64);_0xce5400(_0x2dca64);});});} \ No newline at end of file +var _0xd28c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x17b78c,_0x4a0e12){var _0x3ff573=function(_0x5e133c){while(--_0x5e133c){_0x17b78c['push'](_0x17b78c['shift']());}};_0x3ff573(++_0x4a0e12);}(_0xd28c,0x1c9));var _0xcd28=function(_0xd1f84,_0x1e955a){_0xd1f84=_0xd1f84-0x0;var _0x55651d=_0xd28c[_0xd1f84];return _0x55651d;};'use strict';var _=require(_0xcd28('0x0'));var util=require(_0xcd28('0x1'));var moment=require(_0xcd28('0x2'));var BPromise=require(_0xcd28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd28('0x4'));var db=require(_0xcd28('0x5'))['db'];var utils=require(_0xcd28('0x6'));var logger=require(_0xcd28('0x7'))(_0xcd28('0x8'));var config=require('../../config/environment');var jayson=require(_0xcd28('0x9'));var client=jayson[_0xcd28('0xa')][_0xcd28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x559104,_0x4b2431,_0xe46543){return new BPromise(function(_0x35c145,_0x257ef1){return client['request'](_0x559104,_0xe46543)[_0xcd28('0xc')](function(_0x4c9e77){logger[_0xcd28('0xd')](_0xcd28('0xe'),_0x4b2431,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4b2431,'request\x20sent',JSON[_0xcd28('0xf')](_0x4c9e77));if(_0x4c9e77[_0xcd28('0x10')]){if(_0x4c9e77['error'][_0xcd28('0x11')]===0x1f4){logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x4c9e77[_0xcd28('0x10')]['message']);return _0x257ef1(_0x4c9e77[_0xcd28('0x10')][_0xcd28('0x12')]);}logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x4c9e77['error'][_0xcd28('0x12')]);return _0x35c145(_0x4c9e77[_0xcd28('0x10')][_0xcd28('0x12')]);}else{logger['info'](_0xcd28('0xe'),_0x4b2431,_0xcd28('0x13'));_0x35c145(_0x4c9e77[_0xcd28('0x14')][_0xcd28('0x12')]);}})[_0xcd28('0x15')](function(_0x1c1f5a){logger[_0xcd28('0x10')](_0xcd28('0xe'),_0x4b2431,_0x1c1f5a);_0x257ef1(_0x1c1f5a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2798315..33f81c7 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 _0x867f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','update','exports','multer'];(function(_0x1537a5,_0xbcbd4b){var _0x3f4aa2=function(_0x31ee61){while(--_0x31ee61){_0x1537a5['push'](_0x1537a5['shift']());}};_0x3f4aa2(++_0xbcbd4b);}(_0x867f,0xe6));var _0xf867=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0x867f[_0x3c6125];return _0x2f47b8;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require(_0xf867('0x3'));var express=require(_0xf867('0x4'));var router=express[_0xf867('0x5')]();var auth=require(_0xf867('0x6'));var interaction=require(_0xf867('0x7'));var config=require(_0xf867('0x8'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0xf867('0x9')](),controller[_0xf867('0xa')]);router[_0xf867('0xb')](_0xf867('0xc'),auth[_0xf867('0x9')](),controller['describe']);router['get'](_0xf867('0xd'),auth['isAuthenticated'](),controller[_0xf867('0xe')]);router[_0xf867('0xb')](_0xf867('0xf'),auth[_0xf867('0x9')](),controller[_0xf867('0x10')]);router[_0xf867('0xb')](_0xf867('0x11'),controller[_0xf867('0x12')]);router['post']('/',auth[_0xf867('0x9')](),controller['create']);router['put'](_0xf867('0xd'),auth[_0xf867('0x9')](),controller[_0xf867('0x13')]);router['delete']('/:id',auth[_0xf867('0x9')](),controller['destroy']);module[_0xf867('0x14')]=router; \ No newline at end of file +var _0x780f=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','create','put','delete','destroy','multer','util'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x780f,0x6c));var _0xf780=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x780f[_0x4327fe];return _0x138651;};'use strict';var multer=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var path=require(_0xf780('0x2'));var timeout=require(_0xf780('0x3'));var express=require(_0xf780('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf780('0x5'));var config=require(_0xf780('0x6'));var controller=require(_0xf780('0x7'));router[_0xf780('0x8')]('/',auth['isAuthenticated'](),controller[_0xf780('0x9')]);router['get'](_0xf780('0xa'),auth[_0xf780('0xb')](),controller[_0xf780('0xc')]);router[_0xf780('0x8')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller['show']);router[_0xf780('0x8')](_0xf780('0xe'),auth[_0xf780('0xb')](),controller[_0xf780('0xf')]);router[_0xf780('0x8')](_0xf780('0x10'),controller[_0xf780('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf780('0x12')]);router[_0xf780('0x13')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller['update']);router[_0xf780('0x14')](_0xf780('0xd'),auth[_0xf780('0xb')](),controller[_0xf780('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 6ecebf4..d457d53 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 _0xd3ba=['format','MM-DD-YYYY\x20HH:mm','toString','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','channel','split','DATE','createdAt'];(function(_0x5b7fae,_0x1e0c52){var _0x29d85d=function(_0x4731ff){while(--_0x4731ff){_0x5b7fae['push'](_0x5b7fae['shift']());}};_0x29d85d(++_0x1e0c52);}(_0xd3ba,0x1d4));var _0xad3b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd3ba[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xad3b('0x0'));var moment=require('moment');var path=require(_0xad3b('0x1'));module[_0xad3b('0x2')]={'format':{'type':Sequelize[_0xad3b('0x3')],'get':function(){return this[_0xad3b('0x4')](_0xad3b('0x5'))?path[_0xad3b('0x6')](this['getDataValue'](_0xad3b('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xad3b('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x4b8632){if(_0x4b8632){this['setDataValue'](_0xad3b('0x8'),_0x4b8632);this['setDataValue']('membername',_0x4b8632[_0xad3b('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xad3b('0x7')]},'calleridnum':{'type':Sequelize[_0xad3b('0x7')]},'calleridname':{'type':Sequelize[_0xad3b('0x7')]},'connectedlinenum':{'type':Sequelize[_0xad3b('0x7')]},'connectedlinename':{'type':Sequelize[_0xad3b('0x7')]},'accountcode':{'type':Sequelize[_0xad3b('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xad3b('0x7')]},'value':{'type':Sequelize[_0xad3b('0x7')]},'type':{'type':Sequelize[_0xad3b('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xad3b('0x7')]},'createdAt':{'type':Sequelize[_0xad3b('0xa')],'get':function(){return moment(this[_0xad3b('0x4')](_0xad3b('0xb')))[_0xad3b('0xc')](_0xad3b('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xad3b('0xa')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xad3b('0xc')](_0xad3b('0xd'))[_0xad3b('0xe')]();}}}; \ No newline at end of file +var _0x4e36=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','toString','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','split','INTEGER'];(function(_0x56e1e8,_0x5b0546){var _0x312201=function(_0x52a3f6){while(--_0x52a3f6){_0x56e1e8['push'](_0x56e1e8['shift']());}};_0x312201(++_0x5b0546);}(_0x4e36,0x138));var _0x64e3=function(_0x178477,_0x1597ea){_0x178477=_0x178477-0x0;var _0x1ddf8a=_0x4e36[_0x178477];return _0x1ddf8a;};'use strict';var Sequelize=require(_0x64e3('0x0'));var moment=require(_0x64e3('0x1'));var path=require(_0x64e3('0x2'));module[_0x64e3('0x3')]={'format':{'type':Sequelize[_0x64e3('0x4')],'get':function(){return this[_0x64e3('0x5')](_0x64e3('0x6'))?path[_0x64e3('0x7')](this[_0x64e3('0x5')](_0x64e3('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x64e3('0x8')]},'channel':{'type':Sequelize[_0x64e3('0x8')],'set':function(_0x3c4a43){if(_0x3c4a43){this[_0x64e3('0x9')]('channel',_0x3c4a43);this[_0x64e3('0x9')]('membername',_0x3c4a43[_0x64e3('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x64e3('0x8')]},'calleridnum':{'type':Sequelize[_0x64e3('0x8')]},'calleridname':{'type':Sequelize[_0x64e3('0x8')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x64e3('0x8')]},'accountcode':{'type':Sequelize[_0x64e3('0x8')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x64e3('0x8')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x64e3('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x64e3('0x8')]},'userDisposition':{'type':Sequelize[_0x64e3('0x8')]},'createdAt':{'type':Sequelize[_0x64e3('0xc')],'get':function(){return moment(this[_0x64e3('0x5')](_0x64e3('0xd')))[_0x64e3('0xe')](_0x64e3('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x64e3('0xc')],'get':function(){return moment(this['getDataValue'](_0x64e3('0x10')))[_0x64e3('0xe')](_0x64e3('0xf'))[_0x64e3('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 79de3cb..b4874a5 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 _0x008c=['findAll','rows','show','params','merge','find','catch','create','update','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','extname','unlink','Not\x20found','sequelize','col','token','$and','push','ValidationError','filename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','VoiceRecording','rawAttributes','model','keys','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','key','field','includeAll','include'];(function(_0x469e92,_0x3520b2){var _0x5c2d1c=function(_0x3082cc){while(--_0x3082cc){_0x469e92['push'](_0x469e92['shift']());}};_0x5c2d1c(++_0x3520b2);}(_0x008c,0x188));var _0xc008=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0x008c[_0x4ec3ab];return _0x229613;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['differenceBy'](_[_0xc008('0x25')](_0x4caaf4),[_0xc008('0x26')]);_0x4fce9c[_0xc008('0x27')]=_[_0xc008('0x25')](_0x2e31c2['query']);_0x4fce9c[_0xc008('0x28')]=_[_0xc008('0x29')](_0x4fce9c['model'],_0x4fce9c['query']);_0x5e2aca['attributes']=_[_0xc008('0x29')](_0x4fce9c[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x2a')]));_0x5e2aca[_0xc008('0x2b')]=_0x5e2aca[_0xc008('0x2b')][_0xc008('0x2c')]?_0x5e2aca[_0xc008('0x2b')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x27')][_0xc008('0x2d')]('nolimit')){_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2e')](_0x2e31c2['query'][_0xc008('0x2e')]);_0x5e2aca[_0xc008('0x1a')]=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2f')]=qs[_0xc008('0x30')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x30')]);_0x5e2aca['where']=qs[_0xc008('0x28')](_[_0xc008('0x31')](_0x2e31c2[_0xc008('0x27')],_0x4fce9c[_0xc008('0x28')]));if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x32')]){_0x5e2aca[_0xc008('0x33')]=_['merge'](_0x5e2aca[_0xc008('0x33')],{'$or':_[_0xc008('0x34')](_0x4caaf4,function(_0x50e1d4){if(_0x50e1d4[_0xc008('0x35')][_0xc008('0x36')]!=='VIRTUAL'){var _0x263473={};_0x263473[_0x50e1d4[_0xc008('0x37')]]={'$like':'%'+_0x2e31c2[_0xc008('0x27')]['filter']+'%'};return _0x263473;}})});}_0x5e2aca=_['merge']({},_0x5e2aca,_0x2e31c2['options']);var _0x234f2a={'where':_0x5e2aca['where']};return db[_0xc008('0x22')][_0xc008('0x19')](_0x234f2a)[_0xc008('0x1d')](function(_0x440459){_0x4adbab[_0xc008('0x19')]=_0x440459;if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x38')]){_0x5e2aca[_0xc008('0x39')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x3a')](_0x5e2aca);})[_0xc008('0x1d')](function(_0xdfca2e){_0x4adbab[_0xc008('0x3b')]=_0xdfca2e;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))['catch'](handleError(_0x5bebd9,null));};exports[_0xc008('0x3c')]=function(_0x23c4db,_0x30b7df){var _0x2e98e5={'raw':![],'where':{'id':_0x23c4db[_0xc008('0x3d')]['id']}},_0x49a16d={};_0x49a16d[_0xc008('0x24')]=_[_0xc008('0x25')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x49a16d['query']=_[_0xc008('0x25')](_0x23c4db[_0xc008('0x27')]);_0x49a16d[_0xc008('0x28')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],_0x49a16d['query']);_0x2e98e5[_0xc008('0x2b')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x23c4db['query'][_0xc008('0x2a')]));_0x2e98e5[_0xc008('0x2b')]=_0x2e98e5[_0xc008('0x2b')]['length']?_0x2e98e5[_0xc008('0x2b')]:_0x49a16d['model'];if(_0x23c4db[_0xc008('0x27')]['includeAll']){_0x2e98e5[_0xc008('0x39')]=[{'all':!![]}];}_0x2e98e5=_[_0xc008('0x3e')]({},_0x2e98e5,_0x23c4db['options']);return db[_0xc008('0x22')][_0xc008('0x3f')](_0x2e98e5)[_0xc008('0x1d')](handleEntityNotFound(_0x30b7df,null))['then'](respondWithResult(_0x30b7df,null))[_0xc008('0x40')](handleError(_0x30b7df,null));};exports[_0xc008('0x41')]=function(_0x200469,_0x44fc5d){return db[_0xc008('0x22')][_0xc008('0x41')](_0x200469['body'],{})['then'](respondWithResult(_0x44fc5d,0xc9))['catch'](handleError(_0x44fc5d,null));};exports[_0xc008('0x42')]=function(_0x36417a,_0x103a83){if(_0x36417a[_0xc008('0x43')]['id']){delete _0x36417a[_0xc008('0x43')]['id'];}return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x36417a[_0xc008('0x3d')]['id']}})['then'](handleEntityNotFound(_0x103a83,null))['then'](saveUpdates(_0x36417a['body'],null))[_0xc008('0x1d')](respondWithResult(_0x103a83,null))[_0xc008('0x40')](handleError(_0x103a83,null));};exports[_0xc008('0x1c')]=function(_0x511383,_0x28bc33){return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x511383[_0xc008('0x3d')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x1d')](removeEntity(_0x28bc33,null))[_0xc008('0x40')](handleError(_0x28bc33,null));};exports[_0xc008('0x44')]=function(_0x3fd7d9,_0x3965b7){return db['VoiceRecording']['describe']()[_0xc008('0x1d')](respondWithResult(_0x3965b7,null))['catch'](handleError(_0x3965b7,null));};exports[_0xc008('0x45')]=function(_0x36e6f8,_0x201e52,_0x5598fa){var _0x144ab2=require(_0xc008('0x46'));var _0xee64=![];var _0x8b9775={};if(_0x36e6f8[_0xc008('0x27')]['type']&&_0x36e6f8[_0xc008('0x27')][_0xc008('0x35')]==='uniqueid'){_0x8b9775[_0xc008('0x47')]=_0x36e6f8[_0xc008('0x3d')]['id'];}else{_0x8b9775['id']=_0x36e6f8['params']['id'];}return db['VoiceRecording'][_0xc008('0x3f')]({'where':_0x8b9775,'attributes':['id',_0xc008('0x48')],'raw':!![]})[_0xc008('0x1d')](handleEntityNotFound(_0x201e52,null))[_0xc008('0x1d')](function(_0x14b6a0){if(_0x14b6a0){var _0x588b60=_0x14b6a0['value'];var _0x34b72a=util['format'](_0xc008('0x49'),_0x588b60);if(fs[_0xc008('0x4a')](_0x34b72a)){_0xee64=!![];return _0x144ab2[_0xc008('0x4b')](_0x34b72a,_0x588b60,config[_0xc008('0x4c')][_0xc008('0x4d')])[_0xc008('0x1d')](function(){return _0x14b6a0;});}return _0x14b6a0;}})['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=_0x2ea742[_0xc008('0x48')];if(!fs[_0xc008('0x4a')](_0xbd7422)){throw new db[(_0xc008('0x4e'))]['ValidationError'](_0xc008('0x4f'));}if(_0x2ea742['filename']){return _0x201e52['download'](_0xbd7422,_0x2ea742['filename']+path[_0xc008('0x50')](_0xbd7422),function(){if(_0xee64){fs[_0xc008('0x51')](_0xbd7422);}});}else{return _0x201e52[_0xc008('0x45')](_0xbd7422,function(_0x5f58d7){if(_0xee64){fs[_0xc008('0x51')](_0xbd7422);}});}}})[_0xc008('0x40')](function(_0x3dda82){if(_0x3dda82['message']===_0xc008('0x4f')){_0x201e52[_0xc008('0x17')](0x194)[_0xc008('0x20')](_0xc008('0x52'));}else{return handleError(_0x201e52,null);}});};exports['downloads']=function(_0x4022dd,_0x4eaa6d,_0x23ef33){var _0x422e1f=require(_0xc008('0x46'));var _0x943c91=![];var _0x192c87={'$and':[db[_0xc008('0x53')]['where'](db[_0xc008('0x53')]['fn']('MD5',db['sequelize'][_0xc008('0x54')](_0xc008('0x47'))),_0x4022dd['query'][_0xc008('0x55')])]};if(_0x4022dd[_0xc008('0x27')][_0xc008('0x35')]&&_0x4022dd[_0xc008('0x27')][_0xc008('0x35')]===_0xc008('0x47')){_0x192c87[_0xc008('0x56')]['push']({'uniqueid':_0x4022dd[_0xc008('0x3d')]['id']});}else{_0x192c87[_0xc008('0x56')][_0xc008('0x57')]({'id':_0x4022dd[_0xc008('0x3d')]['id']});}return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':_0x192c87,'attributes':['id',_0xc008('0x48')],'raw':!![]})[_0xc008('0x1d')](handleEntityNotFound(_0x4eaa6d,null))[_0xc008('0x1d')](function(_0x37d193){if(_0x37d193){var _0x1bef66=util[_0xc008('0x26')](_0xc008('0x49'),_0x37d193[_0xc008('0x48')]);if(fs['existsSync'](_0x1bef66)){_0x943c91=!![];return _0x422e1f[_0xc008('0x4b')](_0x1bef66,_0x37d193[_0xc008('0x48')],config[_0xc008('0x4c')]['recording'])[_0xc008('0x1d')](function(){return _0x37d193;});}return _0x37d193;}})[_0xc008('0x1d')](function(_0x5e76d8){if(_0x5e76d8){if(!fs['existsSync'](_0x5e76d8[_0xc008('0x48')])){throw new db[(_0xc008('0x4e'))][(_0xc008('0x58'))](_0xc008('0x4f'));}if(_0x5e76d8[_0xc008('0x59')]){return _0x4eaa6d[_0xc008('0x45')](_0x5e76d8[_0xc008('0x48')],_0x5e76d8[_0xc008('0x59')]+path[_0xc008('0x50')](_0x5e76d8[_0xc008('0x48')]),function(){if(_0x943c91){fs[_0xc008('0x51')](_0x5e76d8['value']);}});}else{return _0x4eaa6d[_0xc008('0x45')](_0x5e76d8[_0xc008('0x48')],function(_0xfdb5e3){if(_0x943c91){fs[_0xc008('0x51')](_0x5e76d8['value']);}});}}})[_0xc008('0x40')](handleError(_0x4eaa6d,null));}; \ No newline at end of file +var _0xcb91=['pick','filter','merge','map','type','key','field','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','../../components/encryptor','uniqueid','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','push','value','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xcb91[_0x193e28];return _0x20ef59;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require(_0x1cb9('0x11'))('api');var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var db=require(_0x1cb9('0x14'))['db'];function respondWithStatusCode(_0x3fdd83,_0x46af58){_0x46af58=_0x46af58||0xcc;return function(_0x5445e1){if(_0x5445e1){return _0x3fdd83['sendStatus'](_0x46af58);}return _0x3fdd83['status'](_0x46af58)[_0x1cb9('0x15')]();};}function respondWithResult(_0x282bc6,_0x384496){_0x384496=_0x384496||0xc8;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['status'](_0x384496)[_0x1cb9('0x16')](_0x1c714f);}};}function respondWithFilteredResult(_0x6ef389,_0x1b3cd7){return function(_0x8dfa55){if(_0x8dfa55){var _0x3e2d11=_0x8dfa55[_0x1cb9('0x17')],_0x5806d8=_0x1b3cd7[_0x1cb9('0x18')],_0x5572cb=_0x1b3cd7[_0x1cb9('0x18')]+_0x1b3cd7[_0x1cb9('0x19')],_0xd446a3;if(_0x5572cb>=_0x3e2d11){_0x5572cb=_0x3e2d11;_0xd446a3=0xc8;}else{_0xd446a3=0xce;}_0x6ef389[_0x1cb9('0x1a')](_0xd446a3);return _0x6ef389[_0x1cb9('0x1b')]('Content-Range',_0x5806d8+'-'+_0x5572cb+'/'+_0x3e2d11)['json'](_0x8dfa55);}return null;};}function patchUpdates(_0x1b2fa6){return function(_0x41ac41){try{jsonpatch[_0x1cb9('0x1c')](_0x41ac41,_0x1b2fa6,!![]);}catch(_0x31481a){return BPromise[_0x1cb9('0x1d')](_0x31481a);}return _0x41ac41[_0x1cb9('0x1e')]();};}function saveUpdates(_0x24fa1f,_0x4ac422){return function(_0x559bcc){if(_0x559bcc){return _0x559bcc[_0x1cb9('0x1f')](_0x24fa1f)['then'](function(_0x4750b1){return _0x4750b1;});}return null;};}function removeEntity(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x20')]()[_0x1cb9('0x21')](function(){_0x2265ea[_0x1cb9('0x1a')](0xcc)[_0x1cb9('0x15')]();});}};}function handleEntityNotFound(_0x45b8d3,_0x27db16){return function(_0x59ebea){if(!_0x59ebea){_0x45b8d3['sendStatus'](0x194);}return _0x59ebea;};}function handleError(_0x6c6f61,_0x557199){_0x557199=_0x557199||0x1f4;return function(_0x10a419){logger[_0x1cb9('0x22')](_0x10a419[_0x1cb9('0x23')]);if(_0x10a419[_0x1cb9('0x24')]){delete _0x10a419[_0x1cb9('0x24')];}_0x6c6f61['status'](_0x557199)[_0x1cb9('0x25')](_0x10a419);};}exports[_0x1cb9('0x26')]=function(_0x4c8d76,_0xd6891c){var _0x21effa={},_0x41a9a0={},_0x1804fd={'count':0x0,'rows':[]};var _0x406821=db[_0x1cb9('0x27')][_0x1cb9('0x28')];_0x41a9a0[_0x1cb9('0x29')]=_[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821),['format']);_0x41a9a0[_0x1cb9('0x2c')]=_['keys'](_0x4c8d76[_0x1cb9('0x2c')]);_0x41a9a0['filters']=_[_0x1cb9('0x2d')](_0x41a9a0[_0x1cb9('0x29')],_0x41a9a0[_0x1cb9('0x2c')]);_0x21effa[_0x1cb9('0x2e')]=_['intersection'](_0x41a9a0[_0x1cb9('0x29')],qs['fields'](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x2f')]));_0x21effa[_0x1cb9('0x2e')]=_0x21effa['attributes'][_0x1cb9('0x30')]?_0x21effa['attributes']:_0x41a9a0[_0x1cb9('0x29')];if(!_0x4c8d76['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x21effa[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x4c8d76['query'][_0x1cb9('0x19')]);_0x21effa[_0x1cb9('0x18')]=qs[_0x1cb9('0x18')](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x18')]);}_0x21effa[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x34')]);_0x21effa[_0x1cb9('0x35')]=qs[_0x1cb9('0x36')](_[_0x1cb9('0x37')](_0x4c8d76[_0x1cb9('0x2c')],_0x41a9a0['filters']));if(_0x4c8d76['query'][_0x1cb9('0x38')]){_0x21effa[_0x1cb9('0x35')]=_[_0x1cb9('0x39')](_0x21effa[_0x1cb9('0x35')],{'$or':_[_0x1cb9('0x3a')](_0x406821,function(_0x3a06e6){if(_0x3a06e6[_0x1cb9('0x3b')][_0x1cb9('0x3c')]!=='VIRTUAL'){var _0x2aa59b={};_0x2aa59b[_0x3a06e6[_0x1cb9('0x3d')]]={'$like':'%'+_0x4c8d76[_0x1cb9('0x2c')]['filter']+'%'};return _0x2aa59b;}})});}_0x21effa=_[_0x1cb9('0x39')]({},_0x21effa,_0x4c8d76['options']);var _0x313e34={'where':_0x21effa['where']};return db[_0x1cb9('0x27')][_0x1cb9('0x17')](_0x313e34)[_0x1cb9('0x21')](function(_0x2bcacd){_0x1804fd[_0x1cb9('0x17')]=_0x2bcacd;if(_0x4c8d76[_0x1cb9('0x2c')][_0x1cb9('0x3e')]){_0x21effa['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x1cb9('0x3f')](_0x21effa);})[_0x1cb9('0x21')](function(_0x7a0d8b){_0x1804fd[_0x1cb9('0x40')]=_0x7a0d8b;return _0x1804fd;})[_0x1cb9('0x21')](respondWithFilteredResult(_0xd6891c,_0x21effa))[_0x1cb9('0x41')](handleError(_0xd6891c,null));};exports[_0x1cb9('0x42')]=function(_0x4a670c,_0xbcaa32){var _0x47edad={'raw':![],'where':{'id':_0x4a670c['params']['id']}},_0x576ef2={};_0x576ef2[_0x1cb9('0x29')]=_[_0x1cb9('0x2b')](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0x576ef2[_0x1cb9('0x2c')]=_['keys'](_0x4a670c[_0x1cb9('0x2c')]);_0x576ef2['filters']=_[_0x1cb9('0x2d')](_0x576ef2[_0x1cb9('0x29')],_0x576ef2[_0x1cb9('0x2c')]);_0x47edad['attributes']=_[_0x1cb9('0x2d')](_0x576ef2['model'],qs[_0x1cb9('0x2f')](_0x4a670c[_0x1cb9('0x2c')]['fields']));_0x47edad['attributes']=_0x47edad[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x47edad[_0x1cb9('0x2e')]:_0x576ef2[_0x1cb9('0x29')];if(_0x4a670c[_0x1cb9('0x2c')]['includeAll']){_0x47edad[_0x1cb9('0x43')]=[{'all':!![]}];}_0x47edad=_['merge']({},_0x47edad,_0x4a670c['options']);return db['VoiceRecording'][_0x1cb9('0x44')](_0x47edad)[_0x1cb9('0x21')](handleEntityNotFound(_0xbcaa32,null))[_0x1cb9('0x21')](respondWithResult(_0xbcaa32,null))[_0x1cb9('0x41')](handleError(_0xbcaa32,null));};exports[_0x1cb9('0x45')]=function(_0x2a8b7f,_0x40ca68){return db[_0x1cb9('0x27')][_0x1cb9('0x45')](_0x2a8b7f[_0x1cb9('0x46')],{})[_0x1cb9('0x21')](respondWithResult(_0x40ca68,0xc9))['catch'](handleError(_0x40ca68,null));};exports[_0x1cb9('0x1f')]=function(_0x237125,_0xf082dd){if(_0x237125['body']['id']){delete _0x237125[_0x1cb9('0x46')]['id'];}return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x237125[_0x1cb9('0x47')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0xf082dd,null))['then'](saveUpdates(_0x237125[_0x1cb9('0x46')],null))['then'](respondWithResult(_0xf082dd,null))[_0x1cb9('0x41')](handleError(_0xf082dd,null));};exports['destroy']=function(_0x1cf2ee,_0x3aed49){return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':{'id':_0x1cf2ee['params']['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x3aed49,null))[_0x1cb9('0x21')](removeEntity(_0x3aed49,null))[_0x1cb9('0x41')](handleError(_0x3aed49,null));};exports[_0x1cb9('0x48')]=function(_0x21072f,_0x3e6889){return db[_0x1cb9('0x27')][_0x1cb9('0x48')]()[_0x1cb9('0x21')](respondWithResult(_0x3e6889,null))[_0x1cb9('0x41')](handleError(_0x3e6889,null));};exports['download']=function(_0x5092a6,_0x28c65d,_0x1b3cdf){var _0x19e83a=require(_0x1cb9('0x49'));var _0x20b253=![];var _0x2d076b={};if(_0x5092a6[_0x1cb9('0x2c')][_0x1cb9('0x3b')]&&_0x5092a6[_0x1cb9('0x2c')][_0x1cb9('0x3b')]==='uniqueid'){_0x2d076b[_0x1cb9('0x4a')]=_0x5092a6['params']['id'];}else{_0x2d076b['id']=_0x5092a6[_0x1cb9('0x47')]['id'];}return db['VoiceRecording'][_0x1cb9('0x44')]({'where':_0x2d076b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x28c65d,null))[_0x1cb9('0x21')](function(_0x3b0c2e){if(_0x3b0c2e){var _0x303da3=_0x3b0c2e['value'];var _0x3c157f=util[_0x1cb9('0x4b')]('%s.cypher',_0x303da3);if(fs['existsSync'](_0x3c157f)){_0x20b253=!![];return _0x19e83a[_0x1cb9('0x4c')](_0x3c157f,_0x303da3,config[_0x1cb9('0x4d')][_0x1cb9('0x4e')])[_0x1cb9('0x21')](function(){return _0x3b0c2e;});}return _0x3b0c2e;}})[_0x1cb9('0x21')](function(_0x310d6d){if(_0x310d6d){var _0x17ce94=_0x310d6d['value'];if(!fs[_0x1cb9('0x4f')](_0x17ce94)){throw new db[(_0x1cb9('0x50'))][(_0x1cb9('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x310d6d[_0x1cb9('0x52')]){return _0x28c65d[_0x1cb9('0x53')](_0x17ce94,_0x310d6d[_0x1cb9('0x52')]+path[_0x1cb9('0x54')](_0x17ce94),function(){if(_0x20b253){fs[_0x1cb9('0x55')](_0x17ce94);}});}else{return _0x28c65d[_0x1cb9('0x53')](_0x17ce94,function(_0x5ae762){if(_0x20b253){fs[_0x1cb9('0x55')](_0x17ce94);}});}}})[_0x1cb9('0x41')](function(_0x41e81f){if(_0x41e81f[_0x1cb9('0x56')]===_0x1cb9('0x57')){_0x28c65d[_0x1cb9('0x1a')](0x194)[_0x1cb9('0x25')](_0x1cb9('0x58'));}else{return handleError(_0x28c65d,null);}});};exports[_0x1cb9('0x59')]=function(_0x3a4cbe,_0x370c97,_0x55fb51){var _0xfc39e1=require(_0x1cb9('0x49'));var _0xebc79f=![];var _0x11fd9a={'$and':[db['sequelize']['where'](db[_0x1cb9('0x5a')]['fn'](_0x1cb9('0x5b'),db[_0x1cb9('0x5a')][_0x1cb9('0x5c')](_0x1cb9('0x4a'))),_0x3a4cbe[_0x1cb9('0x2c')][_0x1cb9('0x5d')])]};if(_0x3a4cbe[_0x1cb9('0x2c')]['type']&&_0x3a4cbe['query'][_0x1cb9('0x3b')]==='uniqueid'){_0x11fd9a['$and']['push']({'uniqueid':_0x3a4cbe['params']['id']});}else{_0x11fd9a['$and'][_0x1cb9('0x5e')]({'id':_0x3a4cbe[_0x1cb9('0x47')]['id']});}return db[_0x1cb9('0x27')][_0x1cb9('0x44')]({'where':_0x11fd9a,'attributes':['id',_0x1cb9('0x5f')],'raw':!![]})[_0x1cb9('0x21')](handleEntityNotFound(_0x370c97,null))['then'](function(_0x27d7ef){if(_0x27d7ef){var _0x3e1207=util['format']('%s.cypher',_0x27d7ef[_0x1cb9('0x5f')]);if(fs[_0x1cb9('0x4f')](_0x3e1207)){_0xebc79f=!![];return _0xfc39e1[_0x1cb9('0x4c')](_0x3e1207,_0x27d7ef[_0x1cb9('0x5f')],config[_0x1cb9('0x4d')]['recording'])['then'](function(){return _0x27d7ef;});}return _0x27d7ef;}})['then'](function(_0x270282){if(_0x270282){if(!fs[_0x1cb9('0x4f')](_0x270282[_0x1cb9('0x5f')])){throw new db[(_0x1cb9('0x50'))][(_0x1cb9('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x270282[_0x1cb9('0x52')]){return _0x370c97[_0x1cb9('0x53')](_0x270282['value'],_0x270282['filename']+path[_0x1cb9('0x54')](_0x270282['value']),function(){if(_0xebc79f){fs[_0x1cb9('0x55')](_0x270282[_0x1cb9('0x5f')]);}});}else{return _0x370c97[_0x1cb9('0x53')](_0x270282[_0x1cb9('0x5f')],function(_0x3619a2){if(_0xebc79f){fs[_0x1cb9('0x55')](_0x270282['value']);}});}}})[_0x1cb9('0x41')](handleError(_0x370c97,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a1ac027..574243a 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 _0x427f=['exports','define','VoiceRecording','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x131e3f,_0x42e89e){var _0x19912d=function(_0x32e947){while(--_0x32e947){_0x131e3f['push'](_0x131e3f['shift']());}};_0x19912d(++_0x42e89e);}(_0x427f,0x122));var _0xf427=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x427f[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf427('0x0'))('api');var moment=require(_0xf427('0x1'));var BPromise=require(_0xf427('0x2'));var rp=require(_0xf427('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf427('0x4'));var config=require(_0xf427('0x5'));var attributes=require(_0xf427('0x6'));module[_0xf427('0x7')]=function(_0x126107,_0x461d3a){return _0x126107[_0xf427('0x8')](_0xf427('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xf427('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3939=['request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fb6a4,_0x8aa23b){var _0x1409a9=function(_0x67cdbd){while(--_0x67cdbd){_0x2fb6a4['push'](_0x2fb6a4['shift']());}};_0x1409a9(++_0x8aa23b);}(_0x3939,0x78));var _0x9393=function(_0x801232,_0x458ec4){_0x801232=_0x801232-0x0;var _0x59f4b5=_0x3939[_0x801232];return _0x59f4b5;};'use strict';var _=require(_0x9393('0x0'));var util=require(_0x9393('0x1'));var logger=require(_0x9393('0x2'))(_0x9393('0x3'));var moment=require(_0x9393('0x4'));var BPromise=require(_0x9393('0x5'));var rp=require(_0x9393('0x6'));var fs=require('fs');var path=require(_0x9393('0x7'));var rimraf=require('rimraf');var config=require(_0x9393('0x8'));var attributes=require(_0x9393('0x9'));module[_0x9393('0xa')]=function(_0x1e3174,_0x403360){return _0x1e3174[_0x9393('0xb')](_0x9393('0xc'),attributes,{'tableName':_0x9393('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 8e1d802..5dc06cf 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 _0x5f9d=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','limit','Setting','findOne','VoiceRecording','create','callRecordingEncryption','existsSync','value','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x5f9d,0x1df));var _0xd5f9=function(_0x1c583,_0x2b75d5){_0x1c583=_0x1c583-0x0;var _0x2cc901=_0x5f9d[_0x1c583];return _0x2cc901;};'use strict';var _=require('lodash');var util=require(_0xd5f9('0x0'));var moment=require(_0xd5f9('0x1'));var BPromise=require(_0xd5f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5f9('0x3'))['db'];var utils=require(_0xd5f9('0x4'));var logger=require(_0xd5f9('0x5'))('rpc');var config=require(_0xd5f9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd5f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f11c3,_0x11ea28,_0x3a6309){return new BPromise(function(_0x13eba9,_0x37c127){return client['request'](_0x3f11c3,_0x3a6309)[_0xd5f9('0x8')](function(_0x31d262){logger[_0xd5f9('0x9')](_0xd5f9('0xa'),_0x11ea28,_0xd5f9('0xb'));logger[_0xd5f9('0xc')](_0xd5f9('0xd'),_0x11ea28,_0xd5f9('0xb'),JSON[_0xd5f9('0xe')](_0x31d262));if(_0x31d262[_0xd5f9('0xf')]){if(_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x10')]===0x1f4){logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x11')]);return _0x37c127(_0x31d262[_0xd5f9('0xf')]['message']);}logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x31d262['error'][_0xd5f9('0x11')]);return _0x13eba9(_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x11')]);}else{logger[_0xd5f9('0x9')](_0xd5f9('0xa'),_0x11ea28,_0xd5f9('0xb'));_0x13eba9(_0x31d262['result'][_0xd5f9('0x11')]);}})[_0xd5f9('0x12')](function(_0x411db6){logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x411db6);_0x37c127(_0x411db6);});});}exports[_0xd5f9('0x13')]=function(_0x530428){var _0x5cc791=this;return new Promise(function(_0x50f061,_0x517b9b){return db['VoiceRecording'][_0xd5f9('0x14')](_0x530428[_0xd5f9('0x15')],{'raw':_0x530428['options']?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530428[_0xd5f9('0x16')]?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x18')]||null:null,'attributes':_0x530428['options']?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x19')]||null:null,'limit':_0x530428[_0xd5f9('0x16')]?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x1a')]||null:null})[_0xd5f9('0x8')](function(_0xc6e845){logger['info'](_0xd5f9('0x13'),_0x530428);logger[_0xd5f9('0xc')](_0xd5f9('0x13'),_0x530428,JSON['stringify'](_0xc6e845));_0x50f061(_0xc6e845);})[_0xd5f9('0x12')](function(_0x1b152f){logger[_0xd5f9('0xf')](_0xd5f9('0x13'),_0x1b152f[_0xd5f9('0x11')],_0x530428);_0x517b9b(_0x5cc791[_0xd5f9('0xf')](0x1f4,_0x1b152f[_0xd5f9('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x2fc338){var _0x2ea21b=this;return new Promise(function(_0x4c3cd9,_0x13d991){var _0x5d41ec=require('../../components/encryptor');var _0x118dd5;return db[_0xd5f9('0x1b')][_0xd5f9('0x1c')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0xe11413){_0x118dd5=_0xe11413;return db[_0xd5f9('0x1d')][_0xd5f9('0x1e')](_0x2fc338['body']);})[_0xd5f9('0x8')](function(_0x2fb7f6){if(_0x118dd5[_0xd5f9('0x1f')]&&fs[_0xd5f9('0x20')](_0x2fb7f6[_0xd5f9('0x21')])){var _0x39baa8=util['format'](_0xd5f9('0x22'),_0x2fb7f6[_0xd5f9('0x21')]);return _0x5d41ec['encryptFile'](_0x2fb7f6[_0xd5f9('0x21')],_0x39baa8,config[_0xd5f9('0x23')][_0xd5f9('0x24')])[_0xd5f9('0x8')](function(){fs[_0xd5f9('0x25')](_0x2fb7f6[_0xd5f9('0x21')]);logger['info'](_0xd5f9('0x26'));return _0x2fb7f6;});}return _0x2fb7f6;})[_0xd5f9('0x8')](function(_0x6db563){logger[_0xd5f9('0x9')](_0xd5f9('0x27'),_0x2fc338);logger['debug'](_0xd5f9('0x27'),_0x2fc338,JSON[_0xd5f9('0xe')](_0x6db563));_0x4c3cd9(_0x6db563);})[_0xd5f9('0x12')](function(_0x28c596){logger['error']('CreateVoiceRecording',_0x28c596[_0xd5f9('0x11')],_0x2fc338);_0x13d991(_0x2ea21b[_0xd5f9('0xf')](0x1f4,_0x28c596['message']));});});}; \ No newline at end of file +var _0x5331=['stringify','error','code','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','attributes','limit','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x57b449,_0x2be95c){var _0x2ab683=function(_0x3860ee){while(--_0x3860ee){_0x57b449['push'](_0x57b449['shift']());}};_0x2ab683(++_0x2be95c);}(_0x5331,0xa4));var _0x1533=function(_0x5deee9,_0xf7bae7){_0x5deee9=_0x5deee9-0x0;var _0x1d84e0=_0x5331[_0x5deee9];return _0x1d84e0;};'use strict';var _=require(_0x1533('0x0'));var util=require(_0x1533('0x1'));var moment=require(_0x1533('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1533('0x3'));var db=require(_0x1533('0x4'))['db'];var utils=require(_0x1533('0x5'));var logger=require('../../config/logger')(_0x1533('0x6'));var config=require(_0x1533('0x7'));var jayson=require(_0x1533('0x8'));var client=jayson[_0x1533('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b578e,_0x1b9d6e,_0x3f3ff9){return new BPromise(function(_0x286b7b,_0x43eef3){return client[_0x1533('0xa')](_0x5b578e,_0x3f3ff9)[_0x1533('0xb')](function(_0x3597c2){logger[_0x1533('0xc')](_0x1533('0xd'),_0x1b9d6e,_0x1533('0xe'));logger['debug'](_0x1533('0xf'),_0x1b9d6e,_0x1533('0xe'),JSON[_0x1533('0x10')](_0x3597c2));if(_0x3597c2[_0x1533('0x11')]){if(_0x3597c2[_0x1533('0x11')][_0x1533('0x12')]===0x1f4){logger['error'](_0x1533('0xd'),_0x1b9d6e,_0x3597c2[_0x1533('0x11')]['message']);return _0x43eef3(_0x3597c2[_0x1533('0x11')][_0x1533('0x13')]);}logger[_0x1533('0x11')](_0x1533('0xd'),_0x1b9d6e,_0x3597c2[_0x1533('0x11')]['message']);return _0x286b7b(_0x3597c2[_0x1533('0x11')][_0x1533('0x13')]);}else{logger[_0x1533('0xc')](_0x1533('0xd'),_0x1b9d6e,'request\x20sent');_0x286b7b(_0x3597c2[_0x1533('0x14')][_0x1533('0x13')]);}})['catch'](function(_0x3c30d7){logger['error'](_0x1533('0xd'),_0x1b9d6e,_0x3c30d7);_0x43eef3(_0x3c30d7);});});}exports[_0x1533('0x15')]=function(_0x3aac1d){var _0x4914c1=this;return new Promise(function(_0x158d9c,_0x48d149){return db[_0x1533('0x16')][_0x1533('0x17')](_0x3aac1d[_0x1533('0x18')],{'raw':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d[_0x1533('0x19')][_0x1533('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d['options']['where']||null:null,'attributes':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d[_0x1533('0x19')][_0x1533('0x1b')]||null:null,'limit':_0x3aac1d[_0x1533('0x19')]?_0x3aac1d['options'][_0x1533('0x1c')]||null:null})[_0x1533('0xb')](function(_0x44cddd){logger['info'](_0x1533('0x15'),_0x3aac1d);logger[_0x1533('0x1d')](_0x1533('0x15'),_0x3aac1d,JSON['stringify'](_0x44cddd));_0x158d9c(_0x44cddd);})[_0x1533('0x1e')](function(_0x548d5b){logger['error'](_0x1533('0x15'),_0x548d5b[_0x1533('0x13')],_0x3aac1d);_0x48d149(_0x4914c1['error'](0x1f4,_0x548d5b['message']));});});};exports[_0x1533('0x1f')]=function(_0x270172){var _0xc7f328=this;return new Promise(function(_0x42c28c,_0x12abc9){var _0x2bcb6e=require('../../components/encryptor');var _0x1ccb9d;return db[_0x1533('0x20')][_0x1533('0x21')]({'attributes':['id',_0x1533('0x22')],'where':{'id':0x1},'raw':!![]})[_0x1533('0xb')](function(_0x221fb1){_0x1ccb9d=_0x221fb1;return db['VoiceRecording'][_0x1533('0x23')](_0x270172[_0x1533('0x18')]);})['then'](function(_0x387631){if(_0x1ccb9d['callRecordingEncryption']&&fs[_0x1533('0x24')](_0x387631[_0x1533('0x25')])){var _0x193a2a=util[_0x1533('0x26')](_0x1533('0x27'),_0x387631[_0x1533('0x25')]);return _0x2bcb6e[_0x1533('0x28')](_0x387631['value'],_0x193a2a,config[_0x1533('0x29')][_0x1533('0x2a')])[_0x1533('0xb')](function(){fs[_0x1533('0x2b')](_0x387631[_0x1533('0x25')]);logger[_0x1533('0xc')](_0x1533('0x2c'));return _0x387631;});}return _0x387631;})[_0x1533('0xb')](function(_0x3ed06d){logger['info'](_0x1533('0x1f'),_0x270172);logger[_0x1533('0x1d')](_0x1533('0x1f'),_0x270172,JSON[_0x1533('0x10')](_0x3ed06d));_0x42c28c(_0x3ed06d);})[_0x1533('0x1e')](function(_0x3c891c){logger['error'](_0x1533('0x1f'),_0x3c891c[_0x1533('0x13')],_0x270172);_0x12abc9(_0xc7f328[_0x1533('0x11')](0x1f4,_0x3c891c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9bc9b0c..3cfc55b 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 _0x6579=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x121976,_0x1f5e72){var _0x5e3b46=function(_0x1b68b8){while(--_0x1b68b8){_0x121976['push'](_0x121976['shift']());}};_0x5e3b46(++_0x1f5e72);}(_0x6579,0x126));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9657('0x0'));var util=require(_0x9657('0x1'));var path=require(_0x9657('0x2'));var timeout=require(_0x9657('0x3'));var express=require(_0x9657('0x4'));var router=express['Router']();var auth=require(_0x9657('0x5'));var interaction=require(_0x9657('0x6'));var config=require(_0x9657('0x7'));var controller=require(_0x9657('0x8'));router[_0x9657('0x9')]('/',auth['isAuthenticated'](),controller[_0x9657('0xa')]);router[_0x9657('0x9')]('/:id',auth[_0x9657('0xb')](),controller[_0x9657('0xc')]);router[_0x9657('0xd')]('/',auth['isAuthenticated'](),controller[_0x9657('0xe')]);router[_0x9657('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9657('0x10')]);router[_0x9657('0x11')](_0x9657('0x12'),auth[_0x9657('0xb')](),controller['destroy']);module[_0x9657('0x13')]=router; \ No newline at end of file +var _0x3003=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports'];(function(_0x2df537,_0x1359a8){var _0x288850=function(_0x2468a1){while(--_0x2468a1){_0x2df537['push'](_0x2df537['shift']());}};_0x288850(++_0x1359a8);}(_0x3003,0x144));var _0x3300=function(_0x3e6dad,_0x17da5a){_0x3e6dad=_0x3e6dad-0x0;var _0x4999e7=_0x3003[_0x3e6dad];return _0x4999e7;};'use strict';var multer=require(_0x3300('0x0'));var util=require(_0x3300('0x1'));var path=require(_0x3300('0x2'));var timeout=require(_0x3300('0x3'));var express=require(_0x3300('0x4'));var router=express['Router']();var auth=require(_0x3300('0x5'));var interaction=require(_0x3300('0x6'));var config=require(_0x3300('0x7'));var controller=require(_0x3300('0x8'));router[_0x3300('0x9')]('/',auth[_0x3300('0xa')](),controller[_0x3300('0xb')]);router[_0x3300('0x9')](_0x3300('0xc'),auth[_0x3300('0xa')](),controller['show']);router[_0x3300('0xd')]('/',auth[_0x3300('0xa')](),controller[_0x3300('0xe')]);router[_0x3300('0xf')]('/:id',auth[_0x3300('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3300('0xa')](),controller[_0x3300('0x10')]);module[_0x3300('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0271b2a..c8baa45 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 _0x1ad1=['sequelize','moment','ENUM','blind','attended','STRING','Yes'];(function(_0x3ec7d8,_0x3006b4){var _0x2b1a23=function(_0xe7d9f){while(--_0xe7d9f){_0x3ec7d8['push'](_0x3ec7d8['shift']());}};_0x2b1a23(++_0x3006b4);}(_0x1ad1,0x1ea));var _0x11ad=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1ad1[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x11ad('0x0'));var moment=require(_0x11ad('0x1'));module['exports']={'type':{'type':Sequelize[_0x11ad('0x2')](_0x11ad('0x3'),_0x11ad('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x11ad('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x11ad('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x11ad('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x11ad('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x11ad('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x11ad('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x11ad('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x11ad('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x11ad('0x5')]},'transfereecontext':{'type':Sequelize[_0x11ad('0x5')]},'transfereeexten':{'type':Sequelize[_0x11ad('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x11ad('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x11ad('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x11ad('0x5')]}}; \ No newline at end of file +var _0x98bb=['Yes','sequelize','moment','exports','attended','STRING','ENUM'];(function(_0x4ffa03,_0x363a82){var _0x30d661=function(_0x36ba86){while(--_0x36ba86){_0x4ffa03['push'](_0x4ffa03['shift']());}};_0x30d661(++_0x363a82);}(_0x98bb,0xe8));var _0xb98b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x98bb[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xb98b('0x0'));var moment=require(_0xb98b('0x1'));module[_0xb98b('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xb98b('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xb98b('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb98b('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb98b('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb98b('0x4')]},'transferercontext':{'type':Sequelize[_0xb98b('0x4')]},'transfererexten':{'type':Sequelize[_0xb98b('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xb98b('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xb98b('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xb98b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb98b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xb98b('0x4')]},'transfereecontext':{'type':Sequelize[_0xb98b('0x4')]},'transfereeexten':{'type':Sequelize[_0xb98b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb98b('0x4')]},'isexternal':{'type':Sequelize[_0xb98b('0x5')](_0xb98b('0x6'),'No')},'context':{'type':Sequelize[_0xb98b('0x4')]},'extension':{'type':Sequelize[_0xb98b('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5e2de0b..4a2285c 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 _0xe937=['rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','merge','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VoiceTransferReport'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe937,0x6b));var _0x7e93=function(_0x4d41d3,_0x38df41){_0x4d41d3=_0x4d41d3-0x0;var _0x3e8307=_0xe937[_0x4d41d3];return _0x3e8307;};'use strict';var pdf=require(_0x7e93('0x0'));var emlformat=require(_0x7e93('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7e93('0x2'));var jsonpatch=require(_0x7e93('0x3'));var rp=require('request-promise');var moment=require(_0x7e93('0x4'));var BPromise=require(_0x7e93('0x5'));var Mustache=require(_0x7e93('0x6'));var util=require(_0x7e93('0x7'));var path=require(_0x7e93('0x8'));var sox=require(_0x7e93('0x9'));var csv=require(_0x7e93('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e93('0xb'));var squel=require(_0x7e93('0xc'));var crypto=require(_0x7e93('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7e93('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7e93('0xf'));var Papa=require(_0x7e93('0x10'));var Redis=require(_0x7e93('0x11'));var authService=require(_0x7e93('0x12'));var qs=require(_0x7e93('0x13'));var hardwareService=require(_0x7e93('0x14'));var logger=require(_0x7e93('0x15'))(_0x7e93('0x16'));var utils=require(_0x7e93('0x17'));var config=require(_0x7e93('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499f0e,_0x21a542){_0x21a542=_0x21a542||0xcc;return function(_0x3cf79d){if(_0x3cf79d){return _0x499f0e[_0x7e93('0x19')](_0x21a542);}return _0x499f0e[_0x7e93('0x1a')](_0x21a542)['end']();};}function respondWithResult(_0x5d5276,_0x5ce4d2){_0x5ce4d2=_0x5ce4d2||0xc8;return function(_0x5a2a71){if(_0x5a2a71){return _0x5d5276[_0x7e93('0x1a')](_0x5ce4d2)[_0x7e93('0x1b')](_0x5a2a71);}};}function respondWithFilteredResult(_0x420e35,_0xadaca2){return function(_0x188e21){if(_0x188e21){var _0x4b07ec=_0x188e21[_0x7e93('0x1c')],_0x4e0f19=_0xadaca2[_0x7e93('0x1d')],_0x172242=_0xadaca2[_0x7e93('0x1d')]+_0xadaca2['limit'],_0x43baa5;if(_0x172242>=_0x4b07ec){_0x172242=_0x4b07ec;_0x43baa5=0xc8;}else{_0x43baa5=0xce;}_0x420e35[_0x7e93('0x1a')](_0x43baa5);return _0x420e35[_0x7e93('0x1e')](_0x7e93('0x1f'),_0x4e0f19+'-'+_0x172242+'/'+_0x4b07ec)[_0x7e93('0x1b')](_0x188e21);}return null;};}function patchUpdates(_0x13ca38){return function(_0x3dd42f){try{jsonpatch[_0x7e93('0x20')](_0x3dd42f,_0x13ca38,!![]);}catch(_0x32cd29){return BPromise[_0x7e93('0x21')](_0x32cd29);}return _0x3dd42f[_0x7e93('0x22')]();};}function saveUpdates(_0x12bbed,_0x182f3f){return function(_0x2165ef){if(_0x2165ef){return _0x2165ef[_0x7e93('0x23')](_0x12bbed)[_0x7e93('0x24')](function(_0x819ab9){return _0x819ab9;});}return null;};}function removeEntity(_0x379227,_0x4f8aab){return function(_0x4de593){if(_0x4de593){return _0x4de593[_0x7e93('0x25')]()[_0x7e93('0x24')](function(){_0x379227['status'](0xcc)[_0x7e93('0x26')]();});}};}function handleEntityNotFound(_0x3f6163,_0x1b8f2f){return function(_0x373f3c){if(!_0x373f3c){_0x3f6163[_0x7e93('0x19')](0x194);}return _0x373f3c;};}function handleError(_0x11466f,_0x50bf23){_0x50bf23=_0x50bf23||0x1f4;return function(_0x4b7213){logger[_0x7e93('0x27')](_0x4b7213[_0x7e93('0x28')]);if(_0x4b7213['name']){delete _0x4b7213[_0x7e93('0x29')];}_0x11466f[_0x7e93('0x1a')](_0x50bf23)[_0x7e93('0x2a')](_0x4b7213);};}exports[_0x7e93('0x2b')]=function(_0x33f405,_0xc5ea98){var _0x557bf0={},_0x3d2c53={},_0x2acdaa={'count':0x0,'rows':[]};var _0x48f6ed=db[_0x7e93('0x2c')][_0x7e93('0x2d')];_0x3d2c53[_0x7e93('0x2e')]=_['keys'](_0x48f6ed);_0x3d2c53[_0x7e93('0x2f')]=_[_0x7e93('0x30')](_0x33f405[_0x7e93('0x2f')]);_0x3d2c53[_0x7e93('0x31')]=_[_0x7e93('0x32')](_0x3d2c53['model'],_0x3d2c53[_0x7e93('0x2f')]);_0x557bf0['attributes']=_[_0x7e93('0x32')](_0x3d2c53[_0x7e93('0x2e')],qs[_0x7e93('0x33')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x33')]));_0x557bf0[_0x7e93('0x34')]=_0x557bf0[_0x7e93('0x34')][_0x7e93('0x35')]?_0x557bf0[_0x7e93('0x34')]:_0x3d2c53[_0x7e93('0x2e')];if(!_0x33f405['query'][_0x7e93('0x36')](_0x7e93('0x37'))){_0x557bf0[_0x7e93('0x38')]=qs[_0x7e93('0x38')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x38')]);_0x557bf0[_0x7e93('0x1d')]=qs[_0x7e93('0x1d')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x1d')]);}_0x557bf0[_0x7e93('0x39')]=qs['sort'](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x3a')]);_0x557bf0[_0x7e93('0x3b')]=qs[_0x7e93('0x31')](_[_0x7e93('0x3c')](_0x33f405['query'],_0x3d2c53[_0x7e93('0x31')]));if(_0x33f405['query'][_0x7e93('0x3d')]){_0x557bf0['where']=_['merge'](_0x557bf0[_0x7e93('0x3b')],{'$or':_['map'](_0x48f6ed,function(_0x5736df){if(_0x5736df[_0x7e93('0x3e')][_0x7e93('0x3f')]!==_0x7e93('0x40')){var _0x930c94={};_0x930c94[_0x5736df[_0x7e93('0x41')]]={'$like':'%'+_0x33f405['query'][_0x7e93('0x3d')]+'%'};return _0x930c94;}})});}_0x557bf0=_['merge']({},_0x557bf0,_0x33f405[_0x7e93('0x42')]);var _0x3ded48={'where':_0x557bf0[_0x7e93('0x3b')]};return db[_0x7e93('0x2c')][_0x7e93('0x1c')](_0x3ded48)[_0x7e93('0x24')](function(_0x518ab3){_0x2acdaa[_0x7e93('0x1c')]=_0x518ab3;if(_0x33f405['query'][_0x7e93('0x43')]){_0x557bf0[_0x7e93('0x44')]=[{'all':!![]}];}return db[_0x7e93('0x2c')]['findAll'](_0x557bf0);})[_0x7e93('0x24')](function(_0x5f1766){_0x2acdaa[_0x7e93('0x45')]=_0x5f1766;return _0x2acdaa;})[_0x7e93('0x24')](respondWithFilteredResult(_0xc5ea98,_0x557bf0))[_0x7e93('0x46')](handleError(_0xc5ea98,null));};exports['show']=function(_0x17ac7f,_0x23ad78){var _0x53fae9={'raw':!![],'where':{'id':_0x17ac7f[_0x7e93('0x47')]['id']}},_0x22c71a={};_0x22c71a[_0x7e93('0x2e')]=_['keys'](db[_0x7e93('0x2c')][_0x7e93('0x2d')]);_0x22c71a[_0x7e93('0x2f')]=_[_0x7e93('0x30')](_0x17ac7f[_0x7e93('0x2f')]);_0x22c71a['filters']=_['intersection'](_0x22c71a[_0x7e93('0x2e')],_0x22c71a[_0x7e93('0x2f')]);_0x53fae9['attributes']=_[_0x7e93('0x32')](_0x22c71a[_0x7e93('0x2e')],qs[_0x7e93('0x33')](_0x17ac7f['query']['fields']));_0x53fae9[_0x7e93('0x34')]=_0x53fae9[_0x7e93('0x34')][_0x7e93('0x35')]?_0x53fae9[_0x7e93('0x34')]:_0x22c71a[_0x7e93('0x2e')];if(_0x17ac7f[_0x7e93('0x2f')][_0x7e93('0x43')]){_0x53fae9[_0x7e93('0x44')]=[{'all':!![]}];}_0x53fae9=_[_0x7e93('0x48')]({},_0x53fae9,_0x17ac7f['options']);return db['VoiceTransferReport'][_0x7e93('0x49')](_0x53fae9)[_0x7e93('0x24')](handleEntityNotFound(_0x23ad78,null))[_0x7e93('0x24')](respondWithResult(_0x23ad78,null))[_0x7e93('0x46')](handleError(_0x23ad78,null));};exports[_0x7e93('0x4a')]=function(_0x597b2e,_0x233801){return db['VoiceTransferReport'][_0x7e93('0x4a')](_0x597b2e[_0x7e93('0x4b')],{})[_0x7e93('0x24')](respondWithResult(_0x233801,0xc9))[_0x7e93('0x46')](handleError(_0x233801,null));};exports['update']=function(_0x4917a8,_0x152bf9){if(_0x4917a8['body']['id']){delete _0x4917a8[_0x7e93('0x4b')]['id'];}return db[_0x7e93('0x2c')][_0x7e93('0x49')]({'where':{'id':_0x4917a8['params']['id']}})[_0x7e93('0x24')](handleEntityNotFound(_0x152bf9,null))[_0x7e93('0x24')](saveUpdates(_0x4917a8['body'],null))[_0x7e93('0x24')](respondWithResult(_0x152bf9,null))[_0x7e93('0x46')](handleError(_0x152bf9,null));};exports[_0x7e93('0x25')]=function(_0x4e82b6,_0x5c0345){return db[_0x7e93('0x2c')][_0x7e93('0x49')]({'where':{'id':_0x4e82b6['params']['id']}})['then'](handleEntityNotFound(_0x5c0345,null))[_0x7e93('0x24')](removeEntity(_0x5c0345,null))[_0x7e93('0x46')](handleError(_0x5c0345,null));}; \ No newline at end of file +var _0x83ac=['rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','options','count','findAll','rows','catch','includeAll','include','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','VoiceTransferReport'];(function(_0x5ac8bc,_0xd6a1ff){var _0x44227a=function(_0x551e15){while(--_0x551e15){_0x5ac8bc['push'](_0x5ac8bc['shift']());}};_0x44227a(++_0xd6a1ff);}(_0x83ac,0x66));var _0xc83a=function(_0x5b745e,_0x504ae2){_0x5b745e=_0x5b745e-0x0;var _0x49d6df=_0x83ac[_0x5b745e];return _0x49d6df;};'use strict';var pdf=require(_0xc83a('0x0'));var emlformat=require(_0xc83a('0x1'));var rimraf=require(_0xc83a('0x2'));var zipdir=require(_0xc83a('0x3'));var jsonpatch=require(_0xc83a('0x4'));var rp=require('request-promise');var moment=require(_0xc83a('0x5'));var BPromise=require(_0xc83a('0x6'));var Mustache=require(_0xc83a('0x7'));var util=require('util');var path=require(_0xc83a('0x8'));var sox=require(_0xc83a('0x9'));var csv=require(_0xc83a('0xa'));var ejs=require(_0xc83a('0xb'));var fs=require('fs');var _=require(_0xc83a('0xc'));var squel=require(_0xc83a('0xd'));var crypto=require('crypto');var jsforce=require(_0xc83a('0xe'));var deskjs=require(_0xc83a('0xf'));var toCsv=require(_0xc83a('0xa'));var querystring=require(_0xc83a('0x10'));var Papa=require(_0xc83a('0x11'));var Redis=require(_0xc83a('0x12'));var authService=require(_0xc83a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc83a('0x14'))(_0xc83a('0x15'));var utils=require(_0xc83a('0x16'));var config=require('../../config/environment');var db=require(_0xc83a('0x17'))['db'];function respondWithStatusCode(_0x592123,_0x12b74d){_0x12b74d=_0x12b74d||0xcc;return function(_0x1d74ff){if(_0x1d74ff){return _0x592123[_0xc83a('0x18')](_0x12b74d);}return _0x592123['status'](_0x12b74d)[_0xc83a('0x19')]();};}function respondWithResult(_0x5a89ce,_0x1a01cc){_0x1a01cc=_0x1a01cc||0xc8;return function(_0x5d52d8){if(_0x5d52d8){return _0x5a89ce[_0xc83a('0x1a')](_0x1a01cc)[_0xc83a('0x1b')](_0x5d52d8);}};}function respondWithFilteredResult(_0x4b247a,_0x5b2bc4){return function(_0xc8f8db){if(_0xc8f8db){var _0x4750c8=_0xc8f8db['count'],_0x5f1532=_0x5b2bc4[_0xc83a('0x1c')],_0x1cdbb2=_0x5b2bc4['offset']+_0x5b2bc4[_0xc83a('0x1d')],_0x3fb4da;if(_0x1cdbb2>=_0x4750c8){_0x1cdbb2=_0x4750c8;_0x3fb4da=0xc8;}else{_0x3fb4da=0xce;}_0x4b247a['status'](_0x3fb4da);return _0x4b247a[_0xc83a('0x1e')](_0xc83a('0x1f'),_0x5f1532+'-'+_0x1cdbb2+'/'+_0x4750c8)['json'](_0xc8f8db);}return null;};}function patchUpdates(_0x5bd036){return function(_0x511841){try{jsonpatch['apply'](_0x511841,_0x5bd036,!![]);}catch(_0x290dea){return BPromise[_0xc83a('0x20')](_0x290dea);}return _0x511841[_0xc83a('0x21')]();};}function saveUpdates(_0xe5a5fb,_0xbf9f6b){return function(_0x58c8f6){if(_0x58c8f6){return _0x58c8f6[_0xc83a('0x22')](_0xe5a5fb)[_0xc83a('0x23')](function(_0x357e96){return _0x357e96;});}return null;};}function removeEntity(_0x2393de,_0x1def84){return function(_0x435d85){if(_0x435d85){return _0x435d85[_0xc83a('0x24')]()['then'](function(){_0x2393de[_0xc83a('0x1a')](0xcc)[_0xc83a('0x19')]();});}};}function handleEntityNotFound(_0x2c330c,_0x23ded4){return function(_0x45d0fd){if(!_0x45d0fd){_0x2c330c['sendStatus'](0x194);}return _0x45d0fd;};}function handleError(_0x3d991a,_0x425b94){_0x425b94=_0x425b94||0x1f4;return function(_0xb34e45){logger[_0xc83a('0x25')](_0xb34e45['stack']);if(_0xb34e45[_0xc83a('0x26')]){delete _0xb34e45['name'];}_0x3d991a[_0xc83a('0x1a')](_0x425b94)[_0xc83a('0x27')](_0xb34e45);};}exports[_0xc83a('0x28')]=function(_0x18d613,_0x5a0e4f){var _0x27f364={},_0x172634={},_0x632e24={'count':0x0,'rows':[]};var _0xb2c2cc=db[_0xc83a('0x29')][_0xc83a('0x2a')];_0x172634['model']=_[_0xc83a('0x2b')](_0xb2c2cc);_0x172634[_0xc83a('0x2c')]=_[_0xc83a('0x2b')](_0x18d613[_0xc83a('0x2c')]);_0x172634[_0xc83a('0x2d')]=_[_0xc83a('0x2e')](_0x172634[_0xc83a('0x2f')],_0x172634[_0xc83a('0x2c')]);_0x27f364[_0xc83a('0x30')]=_[_0xc83a('0x2e')](_0x172634['model'],qs[_0xc83a('0x31')](_0x18d613[_0xc83a('0x2c')][_0xc83a('0x31')]));_0x27f364[_0xc83a('0x30')]=_0x27f364[_0xc83a('0x30')][_0xc83a('0x32')]?_0x27f364[_0xc83a('0x30')]:_0x172634['model'];if(!_0x18d613[_0xc83a('0x2c')][_0xc83a('0x33')](_0xc83a('0x34'))){_0x27f364[_0xc83a('0x1d')]=qs['limit'](_0x18d613[_0xc83a('0x2c')]['limit']);_0x27f364[_0xc83a('0x1c')]=qs[_0xc83a('0x1c')](_0x18d613[_0xc83a('0x2c')]['offset']);}_0x27f364[_0xc83a('0x35')]=qs[_0xc83a('0x36')](_0x18d613[_0xc83a('0x2c')][_0xc83a('0x36')]);_0x27f364[_0xc83a('0x37')]=qs[_0xc83a('0x2d')](_['pick'](_0x18d613['query'],_0x172634['filters']));if(_0x18d613[_0xc83a('0x2c')][_0xc83a('0x38')]){_0x27f364[_0xc83a('0x37')]=_['merge'](_0x27f364[_0xc83a('0x37')],{'$or':_[_0xc83a('0x39')](_0xb2c2cc,function(_0x5beb89){if(_0x5beb89[_0xc83a('0x3a')][_0xc83a('0x3b')]!==_0xc83a('0x3c')){var _0x1966a3={};_0x1966a3[_0x5beb89['field']]={'$like':'%'+_0x18d613[_0xc83a('0x2c')][_0xc83a('0x38')]+'%'};return _0x1966a3;}})});}_0x27f364=_['merge']({},_0x27f364,_0x18d613[_0xc83a('0x3d')]);var _0x316cf7={'where':_0x27f364['where']};return db[_0xc83a('0x29')]['count'](_0x316cf7)['then'](function(_0x1a0b74){_0x632e24[_0xc83a('0x3e')]=_0x1a0b74;if(_0x18d613[_0xc83a('0x2c')]['includeAll']){_0x27f364['include']=[{'all':!![]}];}return db['VoiceTransferReport'][_0xc83a('0x3f')](_0x27f364);})[_0xc83a('0x23')](function(_0x3c07a6){_0x632e24[_0xc83a('0x40')]=_0x3c07a6;return _0x632e24;})[_0xc83a('0x23')](respondWithFilteredResult(_0x5a0e4f,_0x27f364))[_0xc83a('0x41')](handleError(_0x5a0e4f,null));};exports['show']=function(_0x181d7c,_0x4e4bcf){var _0x147b61={'raw':!![],'where':{'id':_0x181d7c['params']['id']}},_0x362c5b={};_0x362c5b[_0xc83a('0x2f')]=_['keys'](db[_0xc83a('0x29')]['rawAttributes']);_0x362c5b[_0xc83a('0x2c')]=_[_0xc83a('0x2b')](_0x181d7c['query']);_0x362c5b[_0xc83a('0x2d')]=_[_0xc83a('0x2e')](_0x362c5b[_0xc83a('0x2f')],_0x362c5b[_0xc83a('0x2c')]);_0x147b61['attributes']=_[_0xc83a('0x2e')](_0x362c5b[_0xc83a('0x2f')],qs[_0xc83a('0x31')](_0x181d7c[_0xc83a('0x2c')][_0xc83a('0x31')]));_0x147b61[_0xc83a('0x30')]=_0x147b61[_0xc83a('0x30')][_0xc83a('0x32')]?_0x147b61[_0xc83a('0x30')]:_0x362c5b[_0xc83a('0x2f')];if(_0x181d7c[_0xc83a('0x2c')][_0xc83a('0x42')]){_0x147b61[_0xc83a('0x43')]=[{'all':!![]}];}_0x147b61=_['merge']({},_0x147b61,_0x181d7c[_0xc83a('0x3d')]);return db['VoiceTransferReport']['find'](_0x147b61)[_0xc83a('0x23')](handleEntityNotFound(_0x4e4bcf,null))[_0xc83a('0x23')](respondWithResult(_0x4e4bcf,null))[_0xc83a('0x41')](handleError(_0x4e4bcf,null));};exports[_0xc83a('0x44')]=function(_0x13fd0d,_0x4d94b7){return db[_0xc83a('0x29')][_0xc83a('0x44')](_0x13fd0d[_0xc83a('0x45')],{})[_0xc83a('0x23')](respondWithResult(_0x4d94b7,0xc9))[_0xc83a('0x41')](handleError(_0x4d94b7,null));};exports[_0xc83a('0x22')]=function(_0x40de84,_0x106ad4){if(_0x40de84[_0xc83a('0x45')]['id']){delete _0x40de84[_0xc83a('0x45')]['id'];}return db[_0xc83a('0x29')][_0xc83a('0x46')]({'where':{'id':_0x40de84[_0xc83a('0x47')]['id']}})[_0xc83a('0x23')](handleEntityNotFound(_0x106ad4,null))[_0xc83a('0x23')](saveUpdates(_0x40de84[_0xc83a('0x45')],null))[_0xc83a('0x23')](respondWithResult(_0x106ad4,null))[_0xc83a('0x41')](handleError(_0x106ad4,null));};exports['destroy']=function(_0x5e9fe6,_0x378755){return db[_0xc83a('0x29')][_0xc83a('0x46')]({'where':{'id':_0x5e9fe6[_0xc83a('0x47')]['id']}})[_0xc83a('0x23')](handleEntityNotFound(_0x378755,null))[_0xc83a('0x23')](removeEntity(_0x378755,null))[_0xc83a('0x41')](handleError(_0x378755,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 9dc6e27..c167967 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 _0x06ba=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36e9ff,_0x270255){var _0x5a46f6=function(_0x38a9cd){while(--_0x38a9cd){_0x36e9ff['push'](_0x36e9ff['shift']());}};_0x5a46f6(++_0x270255);}(_0x06ba,0xa2));var _0xa06b=function(_0xcd6be6,_0x1eb5fa){_0xcd6be6=_0xcd6be6-0x0;var _0x4c5e59=_0x06ba[_0xcd6be6];return _0x4c5e59;};'use strict';var _=require(_0xa06b('0x0'));var util=require('util');var logger=require(_0xa06b('0x1'))(_0xa06b('0x2'));var moment=require(_0xa06b('0x3'));var BPromise=require(_0xa06b('0x4'));var rp=require(_0xa06b('0x5'));var fs=require('fs');var path=require(_0xa06b('0x6'));var rimraf=require('rimraf');var config=require(_0xa06b('0x7'));var attributes=require(_0xa06b('0x8'));module[_0xa06b('0x9')]=function(_0x119810,_0x12ca4c){return _0x119810[_0xa06b('0xa')](_0xa06b('0xb'),attributes,{'tableName':_0xa06b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc389=['exports','define','report_call_transfer','lodash','api','bluebird','request-promise','path','./voiceTransferReport.attributes'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xc389,0x1d7));var _0x9c38=function(_0x35f29f,_0x4619f4){_0x35f29f=_0x35f29f-0x0;var _0x233b90=_0xc389[_0x35f29f];return _0x233b90;};'use strict';var _=require(_0x9c38('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c38('0x1'));var moment=require('moment');var BPromise=require(_0x9c38('0x2'));var rp=require(_0x9c38('0x3'));var fs=require('fs');var path=require(_0x9c38('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c38('0x5'));module[_0x9c38('0x6')]=function(_0x3f8f8d,_0x530a2a){return _0x3f8f8d[_0x9c38('0x7')]('VoiceTransferReport',attributes,{'tableName':_0x9c38('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 4d8c1a5..603372b 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 _0xbf43=['body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf43,0x84));var _0x3bf4=function(_0x1d2dd8,_0x2b874c){_0x1d2dd8=_0x1d2dd8-0x0;var _0x49a344=_0xbf43[_0x1d2dd8];return _0x49a344;};'use strict';var _=require(_0x3bf4('0x0'));var util=require(_0x3bf4('0x1'));var moment=require('moment');var BPromise=require(_0x3bf4('0x2'));var rs=require(_0x3bf4('0x3'));var fs=require('fs');var Redis=require(_0x3bf4('0x4'));var db=require(_0x3bf4('0x5'))['db'];var utils=require(_0x3bf4('0x6'));var logger=require(_0x3bf4('0x7'))(_0x3bf4('0x8'));var config=require(_0x3bf4('0x9'));var jayson=require(_0x3bf4('0xa'));var client=jayson[_0x3bf4('0xb')][_0x3bf4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46991a,_0x6cde37,_0x4519d5){return new BPromise(function(_0x4c9406,_0x19b51e){return client[_0x3bf4('0xd')](_0x46991a,_0x4519d5)[_0x3bf4('0xe')](function(_0xd2cee8){logger[_0x3bf4('0xf')](_0x3bf4('0x10'),_0x6cde37,_0x3bf4('0x11'));logger['debug'](_0x3bf4('0x12'),_0x6cde37,_0x3bf4('0x11'),JSON[_0x3bf4('0x13')](_0xd2cee8));if(_0xd2cee8[_0x3bf4('0x14')]){if(_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x15')]===0x1f4){logger[_0x3bf4('0x14')](_0x3bf4('0x10'),_0x6cde37,_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);return _0x19b51e(_0xd2cee8['error']['message']);}logger['error'](_0x3bf4('0x10'),_0x6cde37,_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);return _0x4c9406(_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);}else{logger[_0x3bf4('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x6cde37,'request\x20sent');_0x4c9406(_0xd2cee8[_0x3bf4('0x17')][_0x3bf4('0x16')]);}})[_0x3bf4('0x18')](function(_0x54a3b7){logger['error'](_0x3bf4('0x10'),_0x6cde37,_0x54a3b7);_0x19b51e(_0x54a3b7);});});}exports[_0x3bf4('0x19')]=function(_0x145d47){var _0x1fdc29=this;return new Promise(function(_0x224a74,_0x3caa13){return db[_0x3bf4('0x1a')][_0x3bf4('0x1b')](_0x145d47[_0x3bf4('0x1c')],{'raw':_0x145d47[_0x3bf4('0x1d')]?_0x145d47[_0x3bf4('0x1d')][_0x3bf4('0x1e')]===undefined?!![]:![]:!![]})[_0x3bf4('0xe')](function(_0x1755ff){logger['info'](_0x3bf4('0x19'),_0x145d47);logger[_0x3bf4('0x1f')](_0x3bf4('0x19'),_0x145d47,JSON['stringify'](_0x1755ff));_0x224a74(_0x1755ff);})[_0x3bf4('0x18')](function(_0x1a1981){logger['error'](_0x3bf4('0x19'),_0x1a1981[_0x3bf4('0x16')],_0x145d47);_0x3caa13(_0x1fdc29[_0x3bf4('0x14')](0x1f4,_0x1a1981['message']));});});}; \ No newline at end of file +var _0x4178=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceTransferReport','body','options','CreateVoiceTransferReport','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0x305d86,_0x18176d){var _0x5a354c=function(_0x3547a8){while(--_0x3547a8){_0x305d86['push'](_0x305d86['shift']());}};_0x5a354c(++_0x18176d);}(_0x4178,0x107));var _0x8417=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4178[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x8417('0x0'));var util=require(_0x8417('0x1'));var moment=require(_0x8417('0x2'));var BPromise=require(_0x8417('0x3'));var rs=require(_0x8417('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8417('0x5'));var logger=require(_0x8417('0x6'))(_0x8417('0x7'));var config=require('../../config/environment');var jayson=require(_0x8417('0x8'));var client=jayson[_0x8417('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492ac4,_0x429237,_0x199ed1){return new BPromise(function(_0x3ecf15,_0x724201){return client[_0x8417('0xa')](_0x492ac4,_0x199ed1)['then'](function(_0x47be62){logger[_0x8417('0xb')](_0x8417('0xc'),_0x429237,_0x8417('0xd'));logger[_0x8417('0xe')](_0x8417('0xf'),_0x429237,'request\x20sent',JSON[_0x8417('0x10')](_0x47be62));if(_0x47be62['error']){if(_0x47be62['error'][_0x8417('0x11')]===0x1f4){logger[_0x8417('0x12')](_0x8417('0xc'),_0x429237,_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);return _0x724201(_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);}logger[_0x8417('0x12')](_0x8417('0xc'),_0x429237,_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);return _0x3ecf15(_0x47be62[_0x8417('0x12')][_0x8417('0x13')]);}else{logger[_0x8417('0xb')](_0x8417('0xc'),_0x429237,_0x8417('0xd'));_0x3ecf15(_0x47be62['result'][_0x8417('0x13')]);}})['catch'](function(_0x36d383){logger[_0x8417('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x429237,_0x36d383);_0x724201(_0x36d383);});});}exports['CreateVoiceTransferReport']=function(_0x36f329){var _0x411742=this;return new Promise(function(_0x222d02,_0x2e9c08){return db[_0x8417('0x14')]['create'](_0x36f329[_0x8417('0x15')],{'raw':_0x36f329[_0x8417('0x16')]?_0x36f329[_0x8417('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3e5d62){logger['info'](_0x8417('0x17'),_0x36f329);logger[_0x8417('0xe')]('CreateVoiceTransferReport',_0x36f329,JSON[_0x8417('0x10')](_0x3e5d62));_0x222d02(_0x3e5d62);})[_0x8417('0x18')](function(_0x25e135){logger[_0x8417('0x12')](_0x8417('0x17'),_0x25e135['message'],_0x36f329);_0x2e9c08(_0x411742[_0x8417('0x12')](0x1f4,_0x25e135[_0x8417('0x13')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 9d360ef..2eb4452 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b8d=['./config/pm2/config','sync','then','listen','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','name','None','seedDB','./config/seedDB','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x24c955,_0x5d01e1){var _0xc60b68=function(_0x49e623){while(--_0x49e623){_0x24c955['push'](_0x24c955['shift']());}};_0xc60b68(++_0x5d01e1);}(_0x4b8d,0x77));var _0xd4b8=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x4b8d[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0xd4b8('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xd4b8('0x1'));var config=require(_0xd4b8('0x2'));var logger=require(_0xd4b8('0x3'))(_0xd4b8('0x4'));var pm2=require(_0xd4b8('0x5'));var pm2Config=require(_0xd4b8('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0xd4b8('0x7')]()[_0xd4b8('0x8')](function(){return rpc[_0xd4b8('0x9')]();})[_0xd4b8('0x8')](function(_0x474834){logger[_0xd4b8('0xa')](_0x474834);return chat[_0xd4b8('0xb')]();})['then'](function(){return schedule[_0xd4b8('0xb')]();})['then'](function(_0x54088a){logger[_0xd4b8('0xa')](_0x54088a);return pm2[_0xd4b8('0xb')](pm2Config);})[_0xd4b8('0x8')](function(_0x4cb19f){logger[_0xd4b8('0xa')](_0xd4b8('0xc'),_[_0xd4b8('0xd')](_[_0xd4b8('0xe')](_0x4cb19f,{'status':_0xd4b8('0xf')}),'name')[_0xd4b8('0x10')]());logger[_0xd4b8('0xa')](_0xd4b8('0x11'),_[_0xd4b8('0xd')](_['filter'](_0x4cb19f,function(_0x23d275){return _0x23d275['status']!==_0xd4b8('0xf');}),_0xd4b8('0x12'))[_0xd4b8('0x10')]()||_0xd4b8('0x13'));config[_0xd4b8('0x14')]&&require(_0xd4b8('0x15'))['default']();require('./config/license')['default']();})[_0xd4b8('0x16')](function(_0x3ddcd3){logger[_0xd4b8('0x17')](_0xd4b8('0x18'),_0x3ddcd3);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xbb08=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','listen','info','start','Online\x20apps:','map','name','join','status','online','None','seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/environment'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0xbb08,0x101));var _0x8bb0=function(_0x1aaa3c,_0x347f8d){_0x1aaa3c=_0x1aaa3c-0x0;var _0x3857ef=_0xbb08[_0x1aaa3c];return _0x3857ef;};'use strict';var _=require(_0x8bb0('0x0'));var mysqldb=require(_0x8bb0('0x1'));var rpc=require('./rpc');var config=require(_0x8bb0('0x2'));var logger=require(_0x8bb0('0x3'))(_0x8bb0('0x4'));var pm2=require(_0x8bb0('0x5'));var pm2Config=require(_0x8bb0('0x6'));var schedule=require(_0x8bb0('0x7'));var chat=require(_0x8bb0('0x8'));function main(){return mysqldb['db']['sequelize'][_0x8bb0('0x9')]()[_0x8bb0('0xa')](function(){return rpc[_0x8bb0('0xb')]();})['then'](function(_0x430547){logger[_0x8bb0('0xc')](_0x430547);return chat['start']();})['then'](function(){return schedule[_0x8bb0('0xd')]();})[_0x8bb0('0xa')](function(_0x25f837){logger[_0x8bb0('0xc')](_0x25f837);return pm2[_0x8bb0('0xd')](pm2Config);})[_0x8bb0('0xa')](function(_0x169aa4){logger[_0x8bb0('0xc')](_0x8bb0('0xe'),_[_0x8bb0('0xf')](_['filter'](_0x169aa4,{'status':'online'}),_0x8bb0('0x10'))[_0x8bb0('0x11')]());logger[_0x8bb0('0xc')]('Offline\x20apps:',_[_0x8bb0('0xf')](_['filter'](_0x169aa4,function(_0x49e0eb){return _0x49e0eb[_0x8bb0('0x12')]!==_0x8bb0('0x13');}),_0x8bb0('0x10'))[_0x8bb0('0x11')]()||_0x8bb0('0x14'));config[_0x8bb0('0x15')]&&require('./config/seedDB')[_0x8bb0('0x16')]();require('./config/license')[_0x8bb0('0x16')]();})[_0x8bb0('0x17')](function(_0x34c8c5){logger[_0x8bb0('0x18')](_0x8bb0('0x19'),_0x34c8c5);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6cba0c4..b469fa0 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 _0xbfdb=['/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','now','regenerateApiKey','verify','sign','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','user','ChatInteraction','findOne','closed','then','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','use','authorization','startsWith','headers','Basic','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','query','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','canUpdate','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','Forbidden','setTokenCookie','motion.token','cookie','motion.user','redirect'];(function(_0x6f60cf,_0x365101){var _0x585644=function(_0x49112c){while(--_0x49112c){_0x6f60cf['push'](_0x6f60cf['shift']());}};_0x585644(++_0x365101);}(_0xbfdb,0x174));var _0xbbfd=function(_0x5ee00d,_0x46bf3b){_0x5ee00d=_0x5ee00d-0x0;var _0x314c74=_0xbfdb[_0x5ee00d];return _0x314c74;};'use strict';var db=require(_0xbbfd('0x0'))['db'];var config=require(_0xbbfd('0x1'));var hardwareConf=require(_0xbbfd('0x2'));var _=require(_0xbbfd('0x3'));var jwt=require(_0xbbfd('0x4'));var expressJwt=require(_0xbbfd('0x5'));var compose=require(_0xbbfd('0x6'));var basicAuth=require(_0xbbfd('0x7'));var crypto=require(_0xbbfd('0x8'));var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0xbbfd('0x9')][_0xbbfd('0xa')]});var userAttributes=['id',_0xbbfd('0xb'),_0xbbfd('0xc'),_0xbbfd('0xd'),_0xbbfd('0xe'),_0xbbfd('0xf'),'userpic',_0xbbfd('0x10'),'voicePause',_0xbbfd('0x11'),_0xbbfd('0x12'),_0xbbfd('0x13'),_0xbbfd('0x14'),_0xbbfd('0x15'),_0xbbfd('0x16'),'showWebBar',_0xbbfd('0x17'),_0xbbfd('0x18'),_0xbbfd('0x19'),_0xbbfd('0x1a')];exports[_0xbbfd('0x1b')]=function(){return isAuthenticated(!![])['use'](function(_0xb00406,_0x3ef1b6,_0xee4219){if(_0xb00406[_0xbbfd('0x1c')]){_0xee4219();}else{return db[_0xbbfd('0x1d')][_0xbbfd('0x1e')]({'where':{'id':_0xb00406['params']['id']},'attributes':['id',_0xbbfd('0x1f'),'disposition'],'raw':!![]})[_0xbbfd('0x20')](function(_0x2faae5){if(_0x2faae5&&_0x2faae5[_0xbbfd('0x1f')]){return _0x3ef1b6[_0xbbfd('0x21')](_0x2faae5['disposition']===_0xbbfd('0x22')?0x195:0x193)[_0xbbfd('0x23')]({'message':_0x2faae5[_0xbbfd('0x24')]==='unmanaged'?_0xbbfd('0x25'):_0xbbfd('0x26')});}else{_0xee4219();}})[_0xbbfd('0x27')](function(_0x3aa19d){_0xee4219(_0x3aa19d);});}});};function isAuthenticated(_0x47af7d){return compose()[_0xbbfd('0x28')](function(_0x1fd32a,_0x48565e,_0x32371e){if(_0x1fd32a['headers'][_0xbbfd('0x29')]){if(_[_0xbbfd('0x2a')](_0x1fd32a[_0xbbfd('0x2b')][_0xbbfd('0x29')],_0xbbfd('0x2c'))){var _0x1bfba1=basicAuth(_0x1fd32a);db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'name':_0x1bfba1[_0xbbfd('0xd')]}})[_0xbbfd('0x20')](function(_0x3e8dcb){if(!_0x3e8dcb||!_0x3e8dcb[_0xbbfd('0x2f')](_0x1bfba1[_0xbbfd('0x30')])){return _0x48565e[_0xbbfd('0x21')](0x191)[_0xbbfd('0x23')]({'message':_0xbbfd('0x31')});}_0x1fd32a[_0xbbfd('0x1c')]={'id':_0x3e8dcb['id']};_0x32371e();})[_0xbbfd('0x27')](function(_0x6cec6){_0x32371e(_0x6cec6);});}else if(_[_0xbbfd('0x2a')](_0x1fd32a['headers'][_0xbbfd('0x29')],_0xbbfd('0x32'))){validateJwt(_0x1fd32a,_0x48565e,_0x32371e);}else{if(_0x47af7d){_0x32371e();}else{return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x33')});}}}else if(_0x1fd32a['query'][_0xbbfd('0x34')]){try{var _0x44c0b4=jwt['verify'](_0x1fd32a[_0xbbfd('0x35')]['apikey'],config[_0xbbfd('0x9')][_0xbbfd('0xa')],{'audience':hardwareConf[_0xbbfd('0x36')](),'issuer':hardwareConf['getUuid']()});db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'id':_0x44c0b4[_0xbbfd('0x37')]}})[_0xbbfd('0x20')](function(_0x3963a6){if(!_0x3963a6||!_[_0xbbfd('0x38')](_0x3963a6[_0xbbfd('0x39')],_0x44c0b4[_0xbbfd('0x3a')])){return _0x48565e[_0xbbfd('0x21')](0x193)['json']({'message':_0xbbfd('0x3b')});}_0x1fd32a['user']={'id':_0x3963a6['id']};_0x32371e();})[_0xbbfd('0x27')](function(_0x3f696a){_0x32371e(_0x3f696a);});}catch(_0x3a2082){console['log'](_0x3a2082);return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3c')});}}else if(_0x47af7d){_0x32371e();}else{return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x33')});}})[_0xbbfd('0x28')](function(_0x40310c,_0x39ed10,_0x598ea4){if(_0x40310c[_0xbbfd('0x1c')]){db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'id':_0x40310c['user']['id']},'attributes':userAttributes})[_0xbbfd('0x20')](function(_0x2d8de4){if(!_0x2d8de4){return _0x39ed10[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3d')});}_0x40310c['user']=_0x2d8de4;_0x598ea4();})[_0xbbfd('0x27')](function(_0x4222da){_0x598ea4(_0x4222da);});}else if(_0x47af7d){_0x598ea4();}else{return _0x39ed10[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3e')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x63535b,_0x3037ef,_0xecf4d0){return require(_0xbbfd('0x3f'))[_0xbbfd('0x40')]()['then'](function(_0x1a5a09){if(_0x1a5a09[_0xbbfd('0x41')]){_0xecf4d0();}else{return _0x3037ef[_0xbbfd('0x21')](0x193)['json']({'message':'Forbidden'});}})[_0xbbfd('0x27')](function(_0x333792){_0xecf4d0(_0x333792);});});}exports[_0xbbfd('0x42')]=canUpdate;function signToken(_0x5499c3,_0x2b525c){return jwt['sign']({'id':_0x5499c3,'role':_0x2b525c},config[_0xbbfd('0x9')]['session'],{'expiresIn':0x15180});}exports[_0xbbfd('0x43')]=signToken;exports[_0xbbfd('0x44')]=function(_0xb042a5){if(!_0xb042a5){throw new Error(_0xbbfd('0x45'));}return compose()[_0xbbfd('0x28')](isAuthenticated())[_0xbbfd('0x28')](function meetsRequirements(_0x595620,_0x3252a7,_0x5418e3){if(config['userRoles'][_0xbbfd('0x46')](_0x595620[_0xbbfd('0x1c')]['role'])>=config[_0xbbfd('0x47')][_0xbbfd('0x46')](_0xb042a5)){return _0x5418e3();}else{return _0x3252a7[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x48')});}});};exports[_0xbbfd('0x49')]=function(_0xc18803,_0x16d3ce){if(!_0xc18803[_0xbbfd('0x1c')]){return _0x16d3ce[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0xd4e78c=signToken(_0xc18803[_0xbbfd('0x1c')]['id'],_0xc18803['user'][_0xbbfd('0xb')]);_0x16d3ce['cookie'](_0xbbfd('0x4a'),_0xd4e78c);_0x16d3ce[_0xbbfd('0x4b')](_0xbbfd('0x4c'),JSON['stringify'](_['pick'](_0xc18803[_0xbbfd('0x1c')],userAttributes)));_0x16d3ce[_0xbbfd('0x4d')](_0xbbfd('0x4e'));};exports[_0xbbfd('0x4f')]=function(_0x10adf8){if(_[_0xbbfd('0x50')](_0x10adf8['apiKeyNonce'])||_[_0xbbfd('0x50')](_0x10adf8[_0xbbfd('0x51')]))return null;else return createJwt(_0x10adf8);};exports[_0xbbfd('0x52')]=function(_0x405a2a){_0x405a2a[_0xbbfd('0x39')]=crypto[_0xbbfd('0x53')](0x10)[_0xbbfd('0x54')](_0xbbfd('0x55'));_0x405a2a[_0xbbfd('0x51')]=Math['floor'](Date[_0xbbfd('0x56')]()/0x3e8)[_0xbbfd('0x54')]();return createJwt(_0x405a2a);};exports[_0xbbfd('0x57')]=function(_0x508500,_0x5f1973){if(_0x508500[_0xbbfd('0x35')][_0xbbfd('0x34')]){jwt[_0xbbfd('0x58')](_0x508500[_0xbbfd('0x35')]['apikey'],config[_0xbbfd('0x9')]['session'],{'nonce':_0x5f1973[_0xbbfd('0x39')],'iat':_0x5f1973[_0xbbfd('0x51')],'audience':hardwareConf[_0xbbfd('0x36')](),'issuer':hardwareConf[_0xbbfd('0x36')]()});return generateApiKey(_0x5f1973);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x56dac5){return jwt[_0xbbfd('0x59')]({'iat':_0x56dac5[_0xbbfd('0x51')],'nonce':_0x56dac5[_0xbbfd('0x39')]},config[_0xbbfd('0x9')]['session'],{'algorithm':'HS512','subject':_0x56dac5['id'][_0xbbfd('0x54')](),'issuer':hardwareConf[_0xbbfd('0x36')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0x1d67=['faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','closed','disposition','then','status','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','authenticate','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','verify','apikey','getUuid','User','find','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','log','User\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','stringify','pick','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','floor','now','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','../../mysqldb','../../config/license/hardware','jsonwebtoken','ipaddr.js','secrets','session','role','fullname','name','internal','email','userpic','voicePause','mailPause'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x1d67,0x1ea));var _0x71d6=function(_0x38db16,_0x504dc5){_0x38db16=_0x38db16-0x0;var _0x580f2e=_0x1d67[_0x38db16];return _0x580f2e;};'use strict';var db=require(_0x71d6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x71d6('0x1'));var _=require('lodash');var jwt=require(_0x71d6('0x2'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var ipaddr=require(_0x71d6('0x3'));var validateJwt=expressJwt({'secret':config[_0x71d6('0x4')][_0x71d6('0x5')]});var userAttributes=['id',_0x71d6('0x6'),_0x71d6('0x7'),_0x71d6('0x8'),_0x71d6('0x9'),_0x71d6('0xa'),_0x71d6('0xb'),'permissions',_0x71d6('0xc'),'chatPause',_0x71d6('0xd'),_0x71d6('0xe'),_0x71d6('0xf'),_0x71d6('0x10'),_0x71d6('0x11'),_0x71d6('0x12'),_0x71d6('0x13'),'phoneBarRemoteControl',_0x71d6('0x14'),_0x71d6('0x15')];exports[_0x71d6('0x16')]=function(){return isAuthenticated(!![])[_0x71d6('0x17')](function(_0x54252a,_0x4b7280,_0x282a24){if(_0x54252a['user']){_0x282a24();}else{return db[_0x71d6('0x18')][_0x71d6('0x19')]({'where':{'id':_0x54252a['params']['id']},'attributes':['id',_0x71d6('0x1a'),_0x71d6('0x1b')],'raw':!![]})[_0x71d6('0x1c')](function(_0xeab9cb){if(_0xeab9cb&&_0xeab9cb[_0x71d6('0x1a')]){return _0x4b7280[_0x71d6('0x1d')](_0xeab9cb[_0x71d6('0x1b')]==='unmanaged'?0x195:0x193)[_0x71d6('0x1e')]({'message':_0xeab9cb[_0x71d6('0x1b')]==='unmanaged'?_0x71d6('0x1f'):_0x71d6('0x20')});}else{_0x282a24();}})[_0x71d6('0x21')](function(_0x42ab92){_0x282a24(_0x42ab92);});}});};function isAuthenticated(_0x2ca02b){return compose()[_0x71d6('0x17')](function(_0x4ec9b0,_0xcb9512,_0xc86f47){if(_0x4ec9b0[_0x71d6('0x22')][_0x71d6('0x23')]){if(_[_0x71d6('0x24')](_0x4ec9b0['headers'][_0x71d6('0x23')],'Basic')){var _0x1d3a01=basicAuth(_0x4ec9b0);db['User']['find']({'where':{'name':_0x1d3a01[_0x71d6('0x8')]}})[_0x71d6('0x1c')](function(_0x564e9c){if(!_0x564e9c||!_0x564e9c[_0x71d6('0x25')](_0x1d3a01[_0x71d6('0x26')])){return _0xcb9512[_0x71d6('0x1d')](0x191)[_0x71d6('0x1e')]({'message':_0x71d6('0x27')});}_0x4ec9b0[_0x71d6('0x28')]={'id':_0x564e9c['id']};_0xc86f47();})[_0x71d6('0x21')](function(_0x3017cf){_0xc86f47(_0x3017cf);});}else if(_[_0x71d6('0x24')](_0x4ec9b0[_0x71d6('0x22')][_0x71d6('0x23')],_0x71d6('0x29'))){validateJwt(_0x4ec9b0,_0xcb9512,_0xc86f47);}else{if(_0x2ca02b){_0xc86f47();}else{return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x2a')});}}}else if(_0x4ec9b0[_0x71d6('0x2b')]['apikey']){try{var _0x1cb469=jwt[_0x71d6('0x2c')](_0x4ec9b0['query'][_0x71d6('0x2d')],config[_0x71d6('0x4')][_0x71d6('0x5')],{'audience':hardwareConf[_0x71d6('0x2e')](),'issuer':hardwareConf[_0x71d6('0x2e')]()});db[_0x71d6('0x2f')][_0x71d6('0x30')]({'where':{'id':_0x1cb469['sub']}})[_0x71d6('0x1c')](function(_0x141c1c){if(!_0x141c1c||!_[_0x71d6('0x31')](_0x141c1c[_0x71d6('0x32')],_0x1cb469['nonce'])){return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x33')});}_0x4ec9b0[_0x71d6('0x28')]={'id':_0x141c1c['id']};_0xc86f47();})['catch'](function(_0x301e12){_0xc86f47(_0x301e12);});}catch(_0xbddf05){console[_0x71d6('0x34')](_0xbddf05);return _0xcb9512['status'](0x193)['json']({'message':'Unrecognized\x20API\x20access\x20key'});}}else if(_0x2ca02b){_0xc86f47();}else{return _0xcb9512['status'](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x2a')});}})['use'](function(_0x3166f6,_0x20e72f,_0x57f860){if(_0x3166f6[_0x71d6('0x28')]){db[_0x71d6('0x2f')][_0x71d6('0x30')]({'where':{'id':_0x3166f6['user']['id']},'attributes':userAttributes})[_0x71d6('0x1c')](function(_0x56142f){if(!_0x56142f){return _0x20e72f[_0x71d6('0x1d')](0x194)[_0x71d6('0x1e')]({'message':_0x71d6('0x35')});}_0x3166f6['user']=_0x56142f;_0x57f860();})[_0x71d6('0x21')](function(_0x4068bb){_0x57f860(_0x4068bb);});}else if(_0x2ca02b){_0x57f860();}else{return _0x20e72f['status'](0x194)[_0x71d6('0x1e')]({'message':'User\x20object\x20not\x20found.'});}});}exports[_0x71d6('0x36')]=isAuthenticated;function canUpdate(){return compose()[_0x71d6('0x17')](function(_0x4818c4,_0x43335b,_0x41a622){return require(_0x71d6('0x37'))[_0x71d6('0x38')]()['then'](function(_0x5cb0f3){if(_0x5cb0f3[_0x71d6('0x39')]){_0x41a622();}else{return _0x43335b[_0x71d6('0x1d')](0x193)['json']({'message':_0x71d6('0x3a')});}})['catch'](function(_0x3e1f74){_0x41a622(_0x3e1f74);});});}exports[_0x71d6('0x3b')]=canUpdate;function signToken(_0x189783,_0x247ea7){return jwt[_0x71d6('0x3c')]({'id':_0x189783,'role':_0x247ea7},config[_0x71d6('0x4')]['session'],{'expiresIn':0x15180});}exports[_0x71d6('0x3d')]=signToken;exports['hasRole']=function(_0x44bb76){if(!_0x44bb76){throw new Error(_0x71d6('0x3e'));}return compose()[_0x71d6('0x17')](isAuthenticated())[_0x71d6('0x17')](function meetsRequirements(_0x294cc4,_0x33aa35,_0x3a406f){if(config[_0x71d6('0x3f')][_0x71d6('0x40')](_0x294cc4[_0x71d6('0x28')][_0x71d6('0x6')])>=config[_0x71d6('0x3f')][_0x71d6('0x40')](_0x44bb76)){return _0x3a406f();}else{return _0x33aa35[_0x71d6('0x1d')](0x193)[_0x71d6('0x1e')]({'message':_0x71d6('0x3a')});}});};exports[_0x71d6('0x41')]=function(_0x54cd10,_0x3bc8d7){if(!_0x54cd10[_0x71d6('0x28')]){return _0x3bc8d7[_0x71d6('0x1d')](0x194)[_0x71d6('0x1e')]({'message':_0x71d6('0x42')});}var _0x2cbf72=signToken(_0x54cd10['user']['id'],_0x54cd10[_0x71d6('0x28')][_0x71d6('0x6')]);_0x3bc8d7[_0x71d6('0x43')](_0x71d6('0x44'),_0x2cbf72);_0x3bc8d7['cookie'](_0x71d6('0x45'),JSON[_0x71d6('0x46')](_[_0x71d6('0x47')](_0x54cd10[_0x71d6('0x28')],userAttributes)));_0x3bc8d7[_0x71d6('0x48')](_0x71d6('0x49'));};exports[_0x71d6('0x4a')]=function(_0x31d08b){if(_[_0x71d6('0x4b')](_0x31d08b['apiKeyNonce'])||_[_0x71d6('0x4b')](_0x31d08b[_0x71d6('0x4c')]))return null;else return createJwt(_0x31d08b);};exports[_0x71d6('0x4d')]=function(_0xe0fdba){_0xe0fdba[_0x71d6('0x32')]=crypto[_0x71d6('0x4e')](0x10)[_0x71d6('0x4f')](_0x71d6('0x50'));_0xe0fdba[_0x71d6('0x4c')]=Math[_0x71d6('0x51')](Date[_0x71d6('0x52')]()/0x3e8)['toString']();return createJwt(_0xe0fdba);};exports['regenerateApiKey']=function(_0x5f08ac,_0x5e449f){if(_0x5f08ac['query']['apikey']){jwt[_0x71d6('0x2c')](_0x5f08ac[_0x71d6('0x2b')][_0x71d6('0x2d')],config['secrets'][_0x71d6('0x5')],{'nonce':_0x5e449f[_0x71d6('0x32')],'iat':_0x5e449f[_0x71d6('0x4c')],'audience':hardwareConf[_0x71d6('0x2e')](),'issuer':hardwareConf[_0x71d6('0x2e')]()});return generateApiKey(_0x5e449f);}else{throw{'message':_0x71d6('0x53')};}};function createJwt(_0x3a4b25){return jwt[_0x71d6('0x3c')]({'iat':_0x3a4b25[_0x71d6('0x4c')],'nonce':_0x3a4b25[_0x71d6('0x32')]},config[_0x71d6('0x4')][_0x71d6('0x5')],{'algorithm':'HS512','subject':_0x3a4b25['id'][_0x71d6('0x4f')](),'issuer':hardwareConf[_0x71d6('0x2e')](),'audience':hardwareConf[_0x71d6('0x2e')]()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d4ef0d5..4a06b39 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 _0x4d24=['binary','end','final','write','close','unlink','decryptFile','algorithm','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update'];(function(_0x32e61e,_0x297c14){var _0x357194=function(_0x207e37){while(--_0x207e37){_0x32e61e['push'](_0x32e61e['shift']());}};_0x357194(++_0x297c14);}(_0x4d24,0x6e));var _0x44d2=function(_0x5e9383,_0x268888){_0x5e9383=_0x5e9383-0x0;var _0x4e830a=_0x4d24[_0x5e9383];return _0x4e830a;};'use strict';var crypto=require(_0x44d2('0x0'));var fs=require('fs');var BPromise=require(_0x44d2('0x1'));var defaultOptions={'algorithm':_0x44d2('0x2')};function combineOptions(_0x304301){var _0x1b15f8={};for(var _0x1b5e2b in defaultOptions){if(defaultOptions[_0x44d2('0x3')](_0x1b5e2b)){_0x1b15f8[_0x1b5e2b]=defaultOptions[_0x1b5e2b];}}if(_0x304301){for(var _0x3014ff in _0x304301){if(_0x304301[_0x44d2('0x3')](_0x3014ff)){_0x1b15f8[_0x3014ff]=_0x304301[_0x3014ff];}}}return _0x1b15f8;}exports[_0x44d2('0x4')]=function(_0x3f5d9a,_0x322f89,_0x282295,_0x33d789){return new BPromise(function(_0x26bffe,_0x5eff1d){_0x33d789=combineOptions(_0x33d789);var _0x147b48=new Buffer(_0x282295);var _0x131bda=fs['createReadStream'](_0x3f5d9a);var _0x2ac229=fs[_0x44d2('0x5')](_0x322f89);var _0x121e3d=crypto[_0x44d2('0x6')](_0x33d789['algorithm'],_0x147b48);_0x131bda['on'](_0x44d2('0x7'),function(_0x3bbbe6){var _0xd7fb0b=new Buffer(_0x121e3d[_0x44d2('0x8')](_0x3bbbe6),_0x44d2('0x9'));_0x2ac229['write'](_0xd7fb0b);});_0x131bda['on'](_0x44d2('0xa'),function(){try{var _0x3d0dd5=new Buffer(_0x121e3d[_0x44d2('0xb')](_0x44d2('0x9')),_0x44d2('0x9'));_0x2ac229[_0x44d2('0xc')](_0x3d0dd5);_0x2ac229[_0x44d2('0xa')]();_0x2ac229['on'](_0x44d2('0xd'),function(){return _0x26bffe(_0x322f89);});}catch(_0xdd60ec){fs[_0x44d2('0xe')](_0x322f89);return _0x5eff1d(_0xdd60ec);}});});};exports[_0x44d2('0xf')]=function(_0x32f43a,_0x95e834,_0x3cde7a,_0x1bb2d7){return new BPromise(function(_0x4b7abb,_0x5c4543){_0x1bb2d7=combineOptions(_0x1bb2d7);var _0xe9084=new Buffer(_0x3cde7a);var _0x1a4996=fs['createReadStream'](_0x32f43a);var _0x4cde81=fs[_0x44d2('0x5')](_0x95e834);var _0x11bdb5=crypto['createDecipher'](_0x1bb2d7[_0x44d2('0x10')],_0xe9084);_0x1a4996['on']('data',function(_0x28470b){var _0x34e116=new Buffer(_0x11bdb5[_0x44d2('0x8')](_0x28470b),_0x44d2('0x9'));_0x4cde81[_0x44d2('0xc')](_0x34e116);});_0x1a4996['on'](_0x44d2('0xa'),function(){try{var _0x321686=new Buffer(_0x11bdb5[_0x44d2('0xb')](_0x44d2('0x9')),_0x44d2('0x9'));_0x4cde81[_0x44d2('0xc')](_0x321686);_0x4cde81['end']();_0x4cde81['on'](_0x44d2('0xd'),function(){return _0x4b7abb(_0x95e834);});}catch(_0x26c6e8){fs['unlink'](_0x95e834);return _0x5c4543(_0x26c6e8);}});});}; \ No newline at end of file +var _0x5049=['createDecipher','algorithm','final','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','close','unlink'];(function(_0x9cf6cf,_0x3f5373){var _0x58acb5=function(_0x34b8b2){while(--_0x34b8b2){_0x9cf6cf['push'](_0x9cf6cf['shift']());}};_0x58acb5(++_0x3f5373);}(_0x5049,0x1b3));var _0x9504=function(_0x4abb30,_0x3da88f){_0x4abb30=_0x4abb30-0x0;var _0x235472=_0x5049[_0x4abb30];return _0x235472;};'use strict';var crypto=require(_0x9504('0x0'));var fs=require('fs');var BPromise=require(_0x9504('0x1'));var defaultOptions={'algorithm':_0x9504('0x2')};function combineOptions(_0x27d063){var _0x3a26a7={};for(var _0x454c1d in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x454c1d)){_0x3a26a7[_0x454c1d]=defaultOptions[_0x454c1d];}}if(_0x27d063){for(var _0x3ef9e6 in _0x27d063){if(_0x27d063[_0x9504('0x3')](_0x3ef9e6)){_0x3a26a7[_0x3ef9e6]=_0x27d063[_0x3ef9e6];}}}return _0x3a26a7;}exports[_0x9504('0x4')]=function(_0x279373,_0x2a9e04,_0x2c2512,_0x6d283a){return new BPromise(function(_0x4c0ad7,_0x1b6bde){_0x6d283a=combineOptions(_0x6d283a);var _0x2d5eb0=new Buffer(_0x2c2512);var _0x3ac276=fs[_0x9504('0x5')](_0x279373);var _0x33cefe=fs[_0x9504('0x6')](_0x2a9e04);var _0x405712=crypto[_0x9504('0x7')](_0x6d283a['algorithm'],_0x2d5eb0);_0x3ac276['on'](_0x9504('0x8'),function(_0x4f780d){var _0xd37b08=new Buffer(_0x405712[_0x9504('0x9')](_0x4f780d),_0x9504('0xa'));_0x33cefe[_0x9504('0xb')](_0xd37b08);});_0x3ac276['on'](_0x9504('0xc'),function(){try{var _0x1c443d=new Buffer(_0x405712['final'](_0x9504('0xa')),'binary');_0x33cefe[_0x9504('0xb')](_0x1c443d);_0x33cefe[_0x9504('0xc')]();_0x33cefe['on'](_0x9504('0xd'),function(){return _0x4c0ad7(_0x2a9e04);});}catch(_0x18fcee){fs[_0x9504('0xe')](_0x2a9e04);return _0x1b6bde(_0x18fcee);}});});};exports['decryptFile']=function(_0x46382e,_0x3c5145,_0x2b91d2,_0x3d5741){return new BPromise(function(_0x4d6a66,_0x26682e){_0x3d5741=combineOptions(_0x3d5741);var _0x1d46ef=new Buffer(_0x2b91d2);var _0x3628d0=fs[_0x9504('0x5')](_0x46382e);var _0x36e1fb=fs[_0x9504('0x6')](_0x3c5145);var _0x1a96d1=crypto[_0x9504('0xf')](_0x3d5741[_0x9504('0x10')],_0x1d46ef);_0x3628d0['on']('data',function(_0x27d544){var _0x476d8e=new Buffer(_0x1a96d1[_0x9504('0x9')](_0x27d544),'binary');_0x36e1fb[_0x9504('0xb')](_0x476d8e);});_0x3628d0['on'](_0x9504('0xc'),function(){try{var _0x491d1f=new Buffer(_0x1a96d1[_0x9504('0x11')](_0x9504('0xa')),_0x9504('0xa'));_0x36e1fb['write'](_0x491d1f);_0x36e1fb[_0x9504('0xc')]();_0x36e1fb['on']('close',function(){return _0x4d6a66(_0x3c5145);});}catch(_0x385fa4){fs['unlink'](_0x3c5145);return _0x26682e(_0x385fa4);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 038583d..05a468f 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 _0x9095=['.csv','length','existsSync','join','mkdirSync','push','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','catch','inspect','Failed','util','lodash','to-csv','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x40746b,_0x46ebf8){var _0x27eea6=function(_0x4ee7ea){while(--_0x4ee7ea){_0x40746b['push'](_0x40746b['shift']());}};_0x27eea6(++_0x46ebf8);}(_0x9095,0xdc));var _0x5909=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x9095[_0x5235a6];return _0x1cf37e;};'use strict';var util=require(_0x5909('0x0'));var path=require('path');var _=require(_0x5909('0x1'));var csv=require(_0x5909('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x5909('0x3'));var db=require(_0x5909('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x5909('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x5909('0x6')][0x2]);var QUERY=process[_0x5909('0x6')][0x3];var PATH=process[_0x5909('0x6')][0x4];function analyticExtractedReport(_0x9ac0ae,_0x422c4d){var _0x4ec313={'status':_0x9ac0ae};var _0x3f7bfe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x422c4d){_0x4ec313['savename']=_0x422c4d;}return db[_0x5909('0x7')]['update'](_0x4ec313,_0x3f7bfe);}function main(){var _0x449c08=0x1388;var _0x4ac1ca;logger[_0x5909('0x8')](util[_0x5909('0x9')](_0x5909('0xa'),EXTRACTED_REPORT_ID,_0x5909('0xb')));return db[_0x5909('0xc')][_0x5909('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5909('0xe'),_0x5909('0xf')]})[_0x5909('0x10')](function(_0x2d51d0){if(_0x2d51d0){_0x4ac1ca=_0x2d51d0;_0x449c08=_0x4ac1ca[_0x5909('0xf')]||0x1388;}})[_0x5909('0x10')](function(){return dbH['sequelize']['query'](util[_0x5909('0x9')](_0x5909('0x11'),QUERY),{'type':dbH[_0x5909('0x12')][_0x5909('0x13')][_0x5909('0x14')]});})[_0x5909('0x10')](function(_0x17b463){if(!_0x17b463[0x0][_0x5909('0x15')]){return analyticExtractedReport('Empty');}var _0x303930=[];var _0x26db51=0x0;var _0x1b69b2=!![];if(_0x17b463&&_0x17b463['length']){var _0x277d2f=_0x17b463[0x0][_0x5909('0x15')]%(_0x26db51+_0x449c08);if(_0x4ac1ca[_0x5909('0xe')]){for(;_0x1b69b2;_0x26db51+=_0x449c08,_0x277d2f=_0x17b463[0x0][_0x5909('0x15')]%(_0x26db51+_0x449c08)){if(_0x277d2f==0x0||_0x277d2f==_0x17b463[0x0][_0x5909('0x15')]){_0x1b69b2=![];}_0x303930['push'](dbH[_0x5909('0x12')][_0x5909('0x16')](util[_0x5909('0x9')](_0x5909('0x17'),QUERY,_0x449c08,_0x26db51),{'type':dbH[_0x5909('0x12')]['QueryTypes']['SELECT']}));}}else{_0x303930['push'](dbH['sequelize'][_0x5909('0x16')](QUERY,{'type':dbH[_0x5909('0x12')]['QueryTypes'][_0x5909('0x14')]}));}}var _0x1f6411=path[_0x5909('0x18')](PATH);var _0x24cdff=path[_0x5909('0x19')](PATH,_0x5909('0x1a'));var _0x4897ae=_0x4ac1ca[_0x5909('0xe')]&&_0x303930[_0x5909('0x1b')]>0x1;var _0x43ff31=[];if(!fs[_0x5909('0x1c')](path[_0x5909('0x1d')](_0x1f6411,_0x24cdff))&&_0x4897ae){fs[_0x5909('0x1e')](path[_0x5909('0x1d')](_0x1f6411,_0x24cdff));}return BPromise['each'](_0x303930,function(_0x469234){_0x43ff31[_0x5909('0x1f')](_0x469234);})[_0x5909('0x10')](function(){for(var _0x2a9816=0x0;_0x2a9816<_0x43ff31[_0x5909('0x1b')];_0x2a9816+=0x1){var _0x1482f0;var _0x2a2b69=_0x43ff31[_0x2a9816];if(_0x4897ae){_0x1482f0=path[_0x5909('0x1d')](_0x1f6411,_0x24cdff,util['format'](_0x5909('0x20'),_0x24cdff,_0x2a9816,_0x5909('0x21')));}else{_0x1482f0=path[_0x5909('0x1d')](_0x1f6411,util[_0x5909('0x9')](_0x5909('0x22'),_0x24cdff,_0x5909('0x21')));}fs[_0x5909('0x23')](_0x1482f0,csv(_0x2a2b69));}})[_0x5909('0x10')](function(){if(_0x4897ae){zipdir(path[_0x5909('0x1d')](_0x1f6411,_0x24cdff),{'saveTo':path[_0x5909('0x1d')](_0x1f6411,util[_0x5909('0x9')](_0x5909('0x22'),_0x24cdff,_0x5909('0x24')))},function(_0x49f946,_0x37375d){});rimraf(path['join'](_0x1f6411,_0x24cdff),function(){});}})['then'](function(){logger[_0x5909('0x8')](util[_0x5909('0x9')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5909('0xb')));return analyticExtractedReport(_0x5909('0x25'),_0x4897ae?util['format']('%s.%s',_0x24cdff,_0x4897ae?_0x5909('0x24'):'csv'):null);});})[_0x5909('0x26')](function(_0x497053){logger[_0x5909('0x8')](util[_0x5909('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5909('0xb')),util[_0x5909('0x27')](_0x497053,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5909('0x28'));});}main(); \ No newline at end of file +var _0x91a6=['../../config/logger','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x91a6,0xda));var _0x691a=function(_0x1ac474,_0x45df28){_0x1ac474=_0x1ac474-0x0;var _0x43961f=_0x91a6[_0x1ac474];return _0x43961f;};'use strict';var util=require(_0x691a('0x0'));var path=require(_0x691a('0x1'));var _=require(_0x691a('0x2'));var csv=require(_0x691a('0x3'));var fs=require('fs');var BPromise=require(_0x691a('0x4'));var zipdir=require(_0x691a('0x5'));var rimraf=require('rimraf');var db=require(_0x691a('0x6'))['db'];var dbH=require(_0x691a('0x6'))['dbH'];var logger=require(_0x691a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x691a('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x691a('0x8')][0x4];function analyticExtractedReport(_0x373e8c,_0x3f1ad4){var _0x3eda6c={'status':_0x373e8c};var _0x49509e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f1ad4){_0x3eda6c['savename']=_0x3f1ad4;}return db[_0x691a('0x9')][_0x691a('0xa')](_0x3eda6c,_0x49509e);}function main(){var _0x4835c3=0x1388;var _0x23303e;logger[_0x691a('0xb')](util['format'](_0x691a('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x691a('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x691a('0xe'),_0x691a('0xf')]})[_0x691a('0x10')](function(_0x1a949f){if(_0x1a949f){_0x23303e=_0x1a949f;_0x4835c3=_0x23303e[_0x691a('0xf')]||0x1388;}})['then'](function(){return dbH[_0x691a('0x11')][_0x691a('0x12')](util[_0x691a('0x13')](_0x691a('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x691a('0x15')]});})[_0x691a('0x10')](function(_0x5cd109){if(!_0x5cd109[0x0][_0x691a('0x16')]){return analyticExtractedReport(_0x691a('0x17'));}var _0x36cfed=[];var _0x46ee71=0x0;var _0x3d7891=!![];if(_0x5cd109&&_0x5cd109[_0x691a('0x18')]){var _0x332cf9=_0x5cd109[0x0][_0x691a('0x16')]%(_0x46ee71+_0x4835c3);if(_0x23303e['split']){for(;_0x3d7891;_0x46ee71+=_0x4835c3,_0x332cf9=_0x5cd109[0x0][_0x691a('0x16')]%(_0x46ee71+_0x4835c3)){if(_0x332cf9==0x0||_0x332cf9==_0x5cd109[0x0][_0x691a('0x16')]){_0x3d7891=![];}_0x36cfed[_0x691a('0x19')](dbH['sequelize']['query'](util[_0x691a('0x13')](_0x691a('0x1a'),QUERY,_0x4835c3,_0x46ee71),{'type':dbH[_0x691a('0x11')][_0x691a('0x1b')]['SELECT']}));}}else{_0x36cfed[_0x691a('0x19')](dbH[_0x691a('0x11')][_0x691a('0x12')](QUERY,{'type':dbH[_0x691a('0x11')][_0x691a('0x1b')][_0x691a('0x15')]}));}}var _0x39a3e3=path[_0x691a('0x1c')](PATH);var _0x90d9ec=path[_0x691a('0x1d')](PATH,_0x691a('0x1e'));var _0x14f0c8=_0x23303e[_0x691a('0xe')]&&_0x36cfed['length']>0x1;var _0x236bd4=[];if(!fs[_0x691a('0x1f')](path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec))&&_0x14f0c8){fs['mkdirSync'](path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec));}return BPromise[_0x691a('0x21')](_0x36cfed,function(_0x17941c){_0x236bd4['push'](_0x17941c);})[_0x691a('0x10')](function(){for(var _0x325395=0x0;_0x325395<_0x236bd4[_0x691a('0x18')];_0x325395+=0x1){var _0x230d03;var _0x2e268f=_0x236bd4[_0x325395];if(_0x14f0c8){_0x230d03=path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec,util['format'](_0x691a('0x22'),_0x90d9ec,_0x325395,'csv'));}else{_0x230d03=path[_0x691a('0x20')](_0x39a3e3,util[_0x691a('0x13')](_0x691a('0x23'),_0x90d9ec,_0x691a('0x24')));}fs['writeFileSync'](_0x230d03,csv(_0x2e268f));}})['then'](function(){if(_0x14f0c8){zipdir(path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec),{'saveTo':path[_0x691a('0x20')](_0x39a3e3,util['format'](_0x691a('0x23'),_0x90d9ec,_0x691a('0x25')))},function(_0x3c623c,_0x14c689){});rimraf(path[_0x691a('0x20')](_0x39a3e3,_0x90d9ec),function(){});}})[_0x691a('0x10')](function(){logger[_0x691a('0xb')](util['format'](_0x691a('0x26'),EXTRACTED_REPORT_ID,_0x691a('0x27')));return analyticExtractedReport(_0x691a('0x28'),_0x14f0c8?util[_0x691a('0x13')](_0x691a('0x23'),_0x90d9ec,_0x14f0c8?'zip':_0x691a('0x24')):null);});})[_0x691a('0x29')](function(_0x447f72){logger[_0x691a('0xb')](util['format'](_0x691a('0x2a'),EXTRACTED_REPORT_ID,_0x691a('0x27')),util[_0x691a('0x2b')](_0x447f72,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x691a('0x2c'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index b811018..6b9519d 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 _0x736d=['black','body','toString','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','pdf','pipe','createWriteStream','finish','error','log','err','end','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','Setting','find','split','splitSizePdf','then','length','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','landscape','header'];(function(_0x45a47d,_0x32f7ab){var _0xe96f10=function(_0x27e27e){while(--_0x27e27e){_0x45a47d['push'](_0x45a47d['shift']());}};_0xe96f10(++_0x32f7ab);}(_0x736d,0x174));var _0xd736=function(_0x3b0675,_0x17502a){_0x3b0675=_0x3b0675-0x0;var _0x11b775=_0x736d[_0x3b0675];return _0x11b775;};'use strict';var _=require(_0xd736('0x0'));var fs=require('fs');var BPromise=require(_0xd736('0x1'));var util=require(_0xd736('0x2'));var path=require(_0xd736('0x3'));var moment=require(_0xd736('0x4'));var PdfPrinter=require(_0xd736('0x5'));var zipdir=require(_0xd736('0x6'));var rimraf=require(_0xd736('0x7'));var db=require(_0xd736('0x8'))['db'];var dbH=require(_0xd736('0x8'))[_0xd736('0x9')];var logger=require(_0xd736('0xa'))(_0xd736('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xd736('0xc')][0x2]);var QUERY=process[_0xd736('0xc')][0x3];var PATH=process[_0xd736('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd736('0xd');var _extractedReport;function analyticExtractedReport(_0xe62499,_0x3d0c5d){var _0xcfa227={'status':_0xe62499};var _0x1af333={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3d0c5d){_0xcfa227[_0xd736('0xe')]=_0x3d0c5d;}return db['AnalyticExtractedReport'][_0xd736('0xf')](_0xcfa227,_0x1af333);}function getHeader(_0x485cd4){var _0x48a69d=[];for(var _0x519d5f in _0x485cd4){if(_0x485cd4[_0xd736('0x10')](_0x519d5f)){_0x48a69d[_0xd736('0x11')]({'text':_0x519d5f,'style':_0xd736('0x12')});}}return _0x48a69d;}function extractReport(_0x3dc91f){var _0x86d8b5=0x1388;var _0x182a10;if(!_0x3dc91f[0x0][_0xd736('0x13')]){return analyticExtractedReport(_0xd736('0x14'));}var _0x35f9b5=[];var _0x13bb3a=0x0;var _0x391037=!![];var _0xfaac7d=path[_0xd736('0x15')](PATH);var _0x18a08d=path['basename'](PATH,'.pdf');var _0x30e88d=![];var _0x45d4a0=[];return db[_0xd736('0x16')][_0xd736('0x17')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd736('0x18'),'splitSizePdf']})['then'](function(_0x374dc8){if(_0x374dc8){_0x182a10=_0x374dc8;_0x86d8b5=_0x182a10[_0xd736('0x19')]||0x3e8;}})[_0xd736('0x1a')](function(){if(_0x3dc91f&&_0x3dc91f[_0xd736('0x1b')]){var _0x176604=_0x3dc91f[0x0][_0xd736('0x13')]%(_0x13bb3a+_0x86d8b5);if(_0x182a10[_0xd736('0x18')]){for(;_0x391037;_0x13bb3a+=_0x86d8b5,_0x176604=_0x3dc91f[0x0][_0xd736('0x13')]%(_0x13bb3a+_0x86d8b5)){if(_0x176604==0x0||_0x176604==_0x3dc91f[0x0][_0xd736('0x13')]){_0x391037=![];}_0x35f9b5[_0xd736('0x11')](dbH[_0xd736('0x1c')][_0xd736('0x1d')](util['format'](_0xd736('0x1e'),QUERY,_0x86d8b5,_0x13bb3a),{'type':dbH[_0xd736('0x1c')]['QueryTypes']['SELECT']}));}}else{_0x35f9b5['push'](dbH[_0xd736('0x1c')]['query'](QUERY,{'type':dbH[_0xd736('0x1c')][_0xd736('0x1f')]['SELECT']}));}}_0x30e88d=_0x182a10[_0xd736('0x18')]&&_0x35f9b5[_0xd736('0x1b')]>0x1;if(!fs[_0xd736('0x20')](path[_0xd736('0x21')](_0xfaac7d,_0x18a08d))&&_0x30e88d){fs[_0xd736('0x22')](path[_0xd736('0x21')](_0xfaac7d,_0x18a08d));}return BPromise[_0xd736('0x23')](_0x35f9b5,function(_0x4ec9d9){_0x45d4a0['push'](_0x4ec9d9);});})[_0xd736('0x1a')](function(){return BPromise[_0xd736('0x23')](_0x35f9b5,function(_0x52233d,_0xd12f27){var _0x286d23;var _0x354397=util['format'](_0xd736('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xd736('0x25')])[_0xd736('0x26')](FORMAT),moment(_extractedReport[_0xd736('0x27')])[_0xd736('0x26')](FORMAT));var _0x12178a={'pageSize':'A4','pageOrientation':_0xd736('0x28'),'content':[{'text':_0x354397,'style':_0xd736('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd736('0x2a')}}};var _0x1d3a96={'headerRows':0x1,'body':[]};_0x1d3a96[_0xd736('0x2b')][_0xd736('0x11')](getHeader(_0x52233d[0x0]));var _0x1d6053;for(var _0x5333d2=0x0;_0x5333d2<_0x52233d[_0xd736('0x1b')];_0x5333d2+=0x1){_0x1d6053=[];for(var _0x74d93a in _0x52233d[_0x5333d2]){if(_0x52233d[_0x5333d2][_0xd736('0x10')](_0x74d93a)){_0x1d6053[_0xd736('0x11')](_0x52233d[_0x5333d2][_0x74d93a]?_[_0xd736('0x2c')](_0x52233d[_0x5333d2][_0x74d93a]):'');}}_0x1d3a96[_0xd736('0x2b')][_0xd736('0x11')](_0x1d6053);}_0x12178a[_0xd736('0x2d')][_0xd736('0x11')]({'table':_0x1d3a96});return new BPromise(function(_0x158b10,_0x31c548){var _0x109c88=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xd736('0x2e'),'italics':__dirname+_0xd736('0x2f'),'bolditalics':__dirname+_0xd736('0x30')}});var _0x314fa5=_0x109c88['createPdfKitDocument'](_0x12178a);if(_0x30e88d){_0x286d23=path[_0xd736('0x21')](_0xfaac7d,_0x18a08d,util['format']('%s%d.%s',_0x18a08d,_0xd12f27,_0xd736('0x31')));}else{_0x286d23=path[_0xd736('0x21')](_0xfaac7d,util[_0xd736('0x26')]('%s.%s',_0x18a08d,_0xd736('0x31')));}var _0x34f057=_0x314fa5[_0xd736('0x32')](fs[_0xd736('0x33')](_0x286d23));_0x34f057['on'](_0xd736('0x34'),function(){_0x158b10();});_0x34f057['on'](_0xd736('0x35'),function(_0x2b009f){console[_0xd736('0x36')](_0xd736('0x37'),_0x2b009f);_0x31c548(_0x2b009f);});_0x314fa5[_0xd736('0x38')]();});});})[_0xd736('0x1a')](function(){if(_0x30e88d){return new BPromise(function(_0x2ad726,_0x1623ec){zipdir(path[_0xd736('0x21')](_0xfaac7d,_0x18a08d),{'saveTo':path[_0xd736('0x21')](_0xfaac7d,util[_0xd736('0x26')](_0xd736('0x39'),_0x18a08d,_0xd736('0x3a')))},function(_0xe612d8){if(_0xe612d8){_0x1623ec(_0xe612d8);}else{_0x2ad726();}});});}})[_0xd736('0x1a')](function(){if(_0x30e88d){rimraf(path[_0xd736('0x21')](_0xfaac7d,_0x18a08d),function(){});}})[_0xd736('0x1a')](function(){logger[_0xd736('0x3b')](util[_0xd736('0x26')](_0xd736('0x3c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd736('0x3d'),_0x30e88d?util[_0xd736('0x26')]('%s.%s',_0x18a08d,_0x30e88d?_0xd736('0x3a'):_0xd736('0x31')):null);});}function main(){logger[_0xd736('0x3b')](util[_0xd736('0x26')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd736('0x3e')));return db[_0xd736('0x3f')][_0xd736('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd736('0x1a')](function(_0x2682e5){_extractedReport=_0x2682e5;return dbH[_0xd736('0x1c')][_0xd736('0x1d')](util[_0xd736('0x26')](_0xd736('0x41'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xd736('0x1a')](extractReport)['catch'](function(_0xb1cbde){logger[_0xd736('0x3b')](util[_0xd736('0x26')](_0xd736('0x42'),EXTRACTED_REPORT_ID,_0xd736('0x3e')),util[_0xd736('0x43')](_0xb1cbde,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd736('0x44'));});}main(); \ No newline at end of file +var _0x8c4a=['Setting','find','split','splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','join','mkdirSync','each','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','black','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','zip','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','hasOwnProperty','num','Empty','basename','.pdf'];(function(_0x4b373a,_0x3fc14e){var _0x1a5312=function(_0x1d8590){while(--_0x1d8590){_0x4b373a['push'](_0x4b373a['shift']());}};_0x1a5312(++_0x3fc14e);}(_0x8c4a,0x72));var _0xa8c4=function(_0x521ad0,_0x5f0fb4){_0x521ad0=_0x521ad0-0x0;var _0x8c0e72=_0x8c4a[_0x521ad0];return _0x8c0e72;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0xa8c4('0x0'));var util=require(_0xa8c4('0x1'));var path=require('path');var moment=require(_0xa8c4('0x2'));var PdfPrinter=require(_0xa8c4('0x3'));var zipdir=require(_0xa8c4('0x4'));var rimraf=require(_0xa8c4('0x5'));var db=require(_0xa8c4('0x6'))['db'];var dbH=require(_0xa8c4('0x6'))['dbH'];var logger=require(_0xa8c4('0x7'))(_0xa8c4('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xa8c4('0x9')][0x2]);var QUERY=process[_0xa8c4('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xa8c4('0x9')][0x5];var FORMAT=_0xa8c4('0xa');var _extractedReport;function analyticExtractedReport(_0x23cd1f,_0x188615){var _0x552f96={'status':_0x23cd1f};var _0x34d29c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x188615){_0x552f96['savename']=_0x188615;}return db[_0xa8c4('0xb')][_0xa8c4('0xc')](_0x552f96,_0x34d29c);}function getHeader(_0x197a0a){var _0x19db89=[];for(var _0x14360f in _0x197a0a){if(_0x197a0a[_0xa8c4('0xd')](_0x14360f)){_0x19db89['push']({'text':_0x14360f,'style':'tableHeader'});}}return _0x19db89;}function extractReport(_0x431eeb){var _0x54a606=0x1388;var _0x3fc8ae;if(!_0x431eeb[0x0][_0xa8c4('0xe')]){return analyticExtractedReport(_0xa8c4('0xf'));}var _0x571264=[];var _0x31f9fb=0x0;var _0x2f3621=!![];var _0xd06876=path['dirname'](PATH);var _0x125ff8=path[_0xa8c4('0x10')](PATH,_0xa8c4('0x11'));var _0x34abe1=![];var _0x51a86c=[];return db[_0xa8c4('0x12')][_0xa8c4('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa8c4('0x14'),_0xa8c4('0x15')]})[_0xa8c4('0x16')](function(_0x2f1092){if(_0x2f1092){_0x3fc8ae=_0x2f1092;_0x54a606=_0x3fc8ae['splitSizePdf']||0x3e8;}})[_0xa8c4('0x16')](function(){if(_0x431eeb&&_0x431eeb[_0xa8c4('0x17')]){var _0x3c3575=_0x431eeb[0x0]['num']%(_0x31f9fb+_0x54a606);if(_0x3fc8ae[_0xa8c4('0x14')]){for(;_0x2f3621;_0x31f9fb+=_0x54a606,_0x3c3575=_0x431eeb[0x0][_0xa8c4('0xe')]%(_0x31f9fb+_0x54a606)){if(_0x3c3575==0x0||_0x3c3575==_0x431eeb[0x0][_0xa8c4('0xe')]){_0x2f3621=![];}_0x571264['push'](dbH[_0xa8c4('0x18')][_0xa8c4('0x19')](util[_0xa8c4('0x1a')](_0xa8c4('0x1b'),QUERY,_0x54a606,_0x31f9fb),{'type':dbH[_0xa8c4('0x18')][_0xa8c4('0x1c')][_0xa8c4('0x1d')]}));}}else{_0x571264['push'](dbH[_0xa8c4('0x18')][_0xa8c4('0x19')](QUERY,{'type':dbH[_0xa8c4('0x18')]['QueryTypes'][_0xa8c4('0x1d')]}));}}_0x34abe1=_0x3fc8ae[_0xa8c4('0x14')]&&_0x571264[_0xa8c4('0x17')]>0x1;if(!fs['existsSync'](path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8))&&_0x34abe1){fs[_0xa8c4('0x1f')](path['join'](_0xd06876,_0x125ff8));}return BPromise[_0xa8c4('0x20')](_0x571264,function(_0xeaea0b){_0x51a86c[_0xa8c4('0x21')](_0xeaea0b);});})[_0xa8c4('0x16')](function(){return BPromise[_0xa8c4('0x20')](_0x571264,function(_0xd748b3,_0x5771af){var _0x55d267;var _0x87090a=util['format'](_0xa8c4('0x22'),NAME,_extractedReport[_0xa8c4('0x23')],moment(_extractedReport[_0xa8c4('0x24')])[_0xa8c4('0x1a')](FORMAT),moment(_extractedReport[_0xa8c4('0x25')])['format'](FORMAT));var _0x3eae12={'pageSize':'A4','pageOrientation':_0xa8c4('0x26'),'content':[{'text':_0x87090a,'style':_0xa8c4('0x27')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa8c4('0x28')}}};var _0x14b0bd={'headerRows':0x1,'body':[]};_0x14b0bd[_0xa8c4('0x29')][_0xa8c4('0x21')](getHeader(_0xd748b3[0x0]));var _0x15cd02;for(var _0x4ee77a=0x0;_0x4ee77a<_0xd748b3[_0xa8c4('0x17')];_0x4ee77a+=0x1){_0x15cd02=[];for(var _0x47d7e5 in _0xd748b3[_0x4ee77a]){if(_0xd748b3[_0x4ee77a]['hasOwnProperty'](_0x47d7e5)){_0x15cd02[_0xa8c4('0x21')](_0xd748b3[_0x4ee77a][_0x47d7e5]?_[_0xa8c4('0x2a')](_0xd748b3[_0x4ee77a][_0x47d7e5]):'');}}_0x14b0bd['body'][_0xa8c4('0x21')](_0x15cd02);}_0x3eae12[_0xa8c4('0x2b')][_0xa8c4('0x21')]({'table':_0x14b0bd});return new BPromise(function(_0x49b3bf,_0x18c808){var _0x19e8d7=new PdfPrinter({'Roboto':{'normal':__dirname+_0xa8c4('0x2c'),'bold':__dirname+_0xa8c4('0x2d'),'italics':__dirname+_0xa8c4('0x2e'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x58efd5=_0x19e8d7[_0xa8c4('0x2f')](_0x3eae12);if(_0x34abe1){_0x55d267=path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8,util[_0xa8c4('0x1a')]('%s%d.%s',_0x125ff8,_0x5771af,_0xa8c4('0x30')));}else{_0x55d267=path[_0xa8c4('0x1e')](_0xd06876,util[_0xa8c4('0x1a')](_0xa8c4('0x31'),_0x125ff8,_0xa8c4('0x30')));}var _0x30c274=_0x58efd5[_0xa8c4('0x32')](fs[_0xa8c4('0x33')](_0x55d267));_0x30c274['on'](_0xa8c4('0x34'),function(){_0x49b3bf();});_0x30c274['on'](_0xa8c4('0x35'),function(_0x336c18){console[_0xa8c4('0x36')](_0xa8c4('0x37'),_0x336c18);_0x18c808(_0x336c18);});_0x58efd5['end']();});});})['then'](function(){if(_0x34abe1){return new BPromise(function(_0x300e1a,_0x3eccc7){zipdir(path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8),{'saveTo':path[_0xa8c4('0x1e')](_0xd06876,util['format'](_0xa8c4('0x31'),_0x125ff8,_0xa8c4('0x38')))},function(_0x3d5676){if(_0x3d5676){_0x3eccc7(_0x3d5676);}else{_0x300e1a();}});});}})['then'](function(){if(_0x34abe1){rimraf(path[_0xa8c4('0x1e')](_0xd06876,_0x125ff8),function(){});}})[_0xa8c4('0x16')](function(){logger[_0xa8c4('0x39')](util[_0xa8c4('0x1a')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa8c4('0x3a')));return analyticExtractedReport(_0xa8c4('0x3b'),_0x34abe1?util['format'](_0xa8c4('0x31'),_0x125ff8,_0x34abe1?_0xa8c4('0x38'):_0xa8c4('0x30')):null);});}function main(){logger[_0xa8c4('0x39')](util[_0xa8c4('0x1a')](_0xa8c4('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xa8c4('0xb')][_0xa8c4('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa8c4('0x16')](function(_0x5bc656){_extractedReport=_0x5bc656;return dbH[_0xa8c4('0x18')]['query'](util[_0xa8c4('0x1a')](_0xa8c4('0x3e'),QUERY),{'type':dbH[_0xa8c4('0x18')][_0xa8c4('0x1c')][_0xa8c4('0x1d')]});})[_0xa8c4('0x16')](extractReport)[_0xa8c4('0x3f')](function(_0x56e6df){logger[_0xa8c4('0x39')](util['format'](_0xa8c4('0x40'),EXTRACTED_REPORT_ID,'PDF'),util[_0xa8c4('0x41')](_0x56e6df,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ba1c9b9..65d7269 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 _0xfc4f=['analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0xfc4f,0x1d2));var _0xffc4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfc4f[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var path=require(_0xffc4('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xffc4('0x1'));var BPromise=require(_0xffc4('0x2'));var zipdir=require(_0xffc4('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xffc4('0x4'))[_0xffc4('0x5')];var logger=require(_0xffc4('0x6'))(_0xffc4('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xffc4('0x8')][0x2]);var QUERY=process[_0xffc4('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x2c4bff,_0x2979cc){var _0xe69bac={'status':_0x2c4bff};var _0x1948ac={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2979cc){_0xe69bac[_0xffc4('0x9')]=_0x2979cc;}return db[_0xffc4('0xa')]['update'](_0xe69bac,_0x1948ac);}function main(){var _0x182241=0x1388;var _0x327284;logger['info'](util[_0xffc4('0xb')](_0xffc4('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xffc4('0xd')][_0xffc4('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xffc4('0xf'),_0xffc4('0x10')]})[_0xffc4('0x11')](function(_0xf39e2d){if(_0xf39e2d){_0x327284=_0xf39e2d;_0x182241=_0x327284[_0xffc4('0x10')]||0x1388;}})['then'](function(){return dbH[_0xffc4('0x12')][_0xffc4('0x13')](util[_0xffc4('0xb')](_0xffc4('0x14'),QUERY),{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]});})[_0xffc4('0x11')](function(_0x139600){if(!_0x139600[0x0]['num']){return analyticExtractedReport(_0xffc4('0x17'));}var _0x3f3ab6=[];var _0x134eb6=0x0;var _0x26ca79=!![];if(_0x327284[_0xffc4('0xf')]){if(_0x139600&&_0x139600[_0xffc4('0x18')]){var _0x375af9=_0x139600[0x0][_0xffc4('0x19')]%(_0x134eb6+_0x182241);for(;_0x26ca79;_0x134eb6+=_0x182241,_0x375af9=_0x139600[0x0][_0xffc4('0x19')]%(_0x134eb6+_0x182241)){if(_0x375af9==0x0||_0x375af9==_0x139600[0x0][_0xffc4('0x19')]){_0x26ca79=![];}_0x3f3ab6['push'](dbH[_0xffc4('0x12')][_0xffc4('0x13')](util[_0xffc4('0xb')](_0xffc4('0x1a'),QUERY,_0x182241,_0x134eb6),{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]}));}}}else{_0x3f3ab6['push'](dbH['sequelize'][_0xffc4('0x13')](QUERY,{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]}));}var _0x53c82a=path[_0xffc4('0x1b')](PATH);var _0x4a75bf=path['basename'](PATH,_0xffc4('0x1c'));var _0x15f909=_0x327284[_0xffc4('0xf')]&&_0x3f3ab6[_0xffc4('0x18')]>0x1;var _0x34e1a0=[];if(!fs[_0xffc4('0x1d')](path['join'](_0x53c82a,_0x4a75bf))&&_0x15f909){fs[_0xffc4('0x1e')](path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf));}return BPromise[_0xffc4('0x20')](_0x3f3ab6,function(_0x10d8dc){_0x34e1a0['push'](_0x10d8dc);})[_0xffc4('0x11')](function(){for(var _0x36cc4d=0x0;_0x36cc4d<_0x34e1a0['length'];_0x36cc4d+=0x1){var _0x38387e;var _0x9113df=_0x34e1a0[_0x36cc4d];if(_0x15f909){_0x38387e=path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf,util[_0xffc4('0xb')](_0xffc4('0x21'),_0x4a75bf,_0x36cc4d,_0xffc4('0x22')));}else{_0x38387e=path[_0xffc4('0x1f')](_0x53c82a,util['format'](_0xffc4('0x23'),_0x4a75bf,'xlsx'));}fs[_0xffc4('0x24')](_0x38387e,json2xls(_0x9113df),_0xffc4('0x25'));}})[_0xffc4('0x11')](function(){if(_0x15f909){zipdir(path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf),{'saveTo':path[_0xffc4('0x1f')](_0x53c82a,util[_0xffc4('0xb')](_0xffc4('0x23'),_0x4a75bf,'zip'))},function(_0x54d9a0,_0x2bd0ad){});rimraf(path['join'](_0x53c82a,_0x4a75bf),function(){});}})[_0xffc4('0x11')](function(){logger[_0xffc4('0x26')](util[_0xffc4('0xb')](_0xffc4('0x27'),EXTRACTED_REPORT_ID,_0xffc4('0x28')));return analyticExtractedReport(_0xffc4('0x29'),_0x15f909?util[_0xffc4('0xb')](_0xffc4('0x23'),_0x4a75bf,_0x15f909?'zip':'xlsx'):null);});})['catch'](function(_0x2eb1a5){logger[_0xffc4('0x26')](util['format'](_0xffc4('0x2a'),EXTRACTED_REPORT_ID,_0xffc4('0x28')),util['inspect'](_0x2eb1a5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xa9a7=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','mkdirSync','join','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','push'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa9a7,0x1bf));var _0x7a9a=function(_0x29b398,_0x6f6888){_0x29b398=_0x29b398-0x0;var _0x379b4b=_0xa9a7[_0x29b398];return _0x379b4b;};'use strict';var util=require('util');var path=require('path');var _=require(_0x7a9a('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7a9a('0x1'));var zipdir=require(_0x7a9a('0x2'));var rimraf=require('rimraf');var db=require(_0x7a9a('0x3'))['db'];var dbH=require(_0x7a9a('0x3'))[_0x7a9a('0x4')];var logger=require(_0x7a9a('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7a9a('0x6')][0x2]);var QUERY=process[_0x7a9a('0x6')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x539852,_0x12f328){var _0x33007b={'status':_0x539852};var _0x48be35={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12f328){_0x33007b[_0x7a9a('0x7')]=_0x12f328;}return db[_0x7a9a('0x8')][_0x7a9a('0x9')](_0x33007b,_0x48be35);}function main(){var _0x241327=0x1388;var _0x2b06eb;logger[_0x7a9a('0xa')](util[_0x7a9a('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7a9a('0xc')));return db[_0x7a9a('0xd')][_0x7a9a('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7a9a('0xf')]})['then'](function(_0x4060dc){if(_0x4060dc){_0x2b06eb=_0x4060dc;_0x241327=_0x2b06eb[_0x7a9a('0xf')]||0x1388;}})[_0x7a9a('0x10')](function(){return dbH[_0x7a9a('0x11')][_0x7a9a('0x12')](util[_0x7a9a('0xb')](_0x7a9a('0x13'),QUERY),{'type':dbH[_0x7a9a('0x11')]['QueryTypes'][_0x7a9a('0x14')]});})['then'](function(_0x511879){if(!_0x511879[0x0][_0x7a9a('0x15')]){return analyticExtractedReport(_0x7a9a('0x16'));}var _0x2691fe=[];var _0x5d6246=0x0;var _0x5b9682=!![];if(_0x2b06eb[_0x7a9a('0x17')]){if(_0x511879&&_0x511879[_0x7a9a('0x18')]){var _0x52c7d0=_0x511879[0x0][_0x7a9a('0x15')]%(_0x5d6246+_0x241327);for(;_0x5b9682;_0x5d6246+=_0x241327,_0x52c7d0=_0x511879[0x0]['num']%(_0x5d6246+_0x241327)){if(_0x52c7d0==0x0||_0x52c7d0==_0x511879[0x0]['num']){_0x5b9682=![];}_0x2691fe[_0x7a9a('0x19')](dbH[_0x7a9a('0x11')][_0x7a9a('0x12')](util[_0x7a9a('0xb')](_0x7a9a('0x1a'),QUERY,_0x241327,_0x5d6246),{'type':dbH[_0x7a9a('0x11')][_0x7a9a('0x1b')][_0x7a9a('0x14')]}));}}}else{_0x2691fe[_0x7a9a('0x19')](dbH['sequelize'][_0x7a9a('0x12')](QUERY,{'type':dbH[_0x7a9a('0x11')][_0x7a9a('0x1b')][_0x7a9a('0x14')]}));}var _0x1b318c=path[_0x7a9a('0x1c')](PATH);var _0x4fc41f=path[_0x7a9a('0x1d')](PATH,'.xlsx');var _0x231e51=_0x2b06eb[_0x7a9a('0x17')]&&_0x2691fe[_0x7a9a('0x18')]>0x1;var _0x4e0c63=[];if(!fs[_0x7a9a('0x1e')](path['join'](_0x1b318c,_0x4fc41f))&&_0x231e51){fs[_0x7a9a('0x1f')](path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f));}return BPromise['each'](_0x2691fe,function(_0x4e38ae){_0x4e0c63[_0x7a9a('0x19')](_0x4e38ae);})[_0x7a9a('0x10')](function(){for(var _0x3f4c87=0x0;_0x3f4c87<_0x4e0c63[_0x7a9a('0x18')];_0x3f4c87+=0x1){var _0x46b6d5;var _0x22ccbe=_0x4e0c63[_0x3f4c87];if(_0x231e51){_0x46b6d5=path['join'](_0x1b318c,_0x4fc41f,util[_0x7a9a('0xb')](_0x7a9a('0x21'),_0x4fc41f,_0x3f4c87,'xlsx'));}else{_0x46b6d5=path[_0x7a9a('0x20')](_0x1b318c,util[_0x7a9a('0xb')]('%s.%s',_0x4fc41f,_0x7a9a('0x22')));}fs[_0x7a9a('0x23')](_0x46b6d5,json2xls(_0x22ccbe),_0x7a9a('0x24'));}})[_0x7a9a('0x10')](function(){if(_0x231e51){zipdir(path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f),{'saveTo':path['join'](_0x1b318c,util[_0x7a9a('0xb')](_0x7a9a('0x25'),_0x4fc41f,_0x7a9a('0x26')))},function(_0x165f84,_0x512247){});rimraf(path[_0x7a9a('0x20')](_0x1b318c,_0x4fc41f),function(){});}})[_0x7a9a('0x10')](function(){logger[_0x7a9a('0xa')](util['format'](_0x7a9a('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x231e51?util[_0x7a9a('0xb')](_0x7a9a('0x25'),_0x4fc41f,_0x231e51?'zip':_0x7a9a('0x22')):null);});})[_0x7a9a('0x28')](function(_0x139190){logger[_0x7a9a('0xa')](util[_0x7a9a('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x7a9a('0x29')](_0x139190,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7a9a('0x2a'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 67a34b2..6882e3e 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 _0x586d=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','map','tag','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','format','type','context','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN}','priority','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0xcf2382,_0x1da16e){var _0x1ade36=function(_0x2124a2){while(--_0x2124a2){_0xcf2382['push'](_0xcf2382['shift']());}};_0x1ade36(++_0x1da16e);}(_0x586d,0xaf));var _0xd586=function(_0x5e0109,_0x1cf94d){_0x5e0109=_0x5e0109-0x0;var _0x10961c=_0x586d[_0x5e0109];return _0x10961c;};'use strict';var _=require(_0xd586('0x0'));var util=require(_0xd586('0x1'));function rewrite(_0x5d4c61,_0x49f322){var _0x372a78=this;return _0x5d4c61[_0xd586('0x2')]['Interval'][_0xd586('0x3')]({'raw':!![]})[_0xd586('0x4')](function(_0x3c8677){_0x372a78[_0xd586('0x5')]=_0x3c8677;return _0x5d4c61['models'][_0xd586('0x6')]['findAll']({'where':{'IntervalId':_0x49f322[_0xd586('0x7')]},'raw':!![]});})[_0xd586('0x4')](function(_0x2ad9c3){return _0x5d4c61['models'][_0xd586('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xd586('0x8')](_['map'](_0x2ad9c3,_0xd586('0x9')))}},'order':[{'raw':_0xd586('0xa')}],'raw':!![]});})[_0xd586('0x4')](function(_0x2924ea){var _0x3403ac=_[_0xd586('0xb')](_0x2924ea,{'priority':'1'});var _0x4ae3e0=_['filter'](_0x2924ea,{'isApp':0x1});var _0x336859=_[_0xd586('0xc')](_0x4ae3e0,_0xd586('0x9'));var _0x42ea4c=[_0xd586('0xd'),_0xd586('0xe')];var _0x364a36=[];var _0x14dd3a=[];for(var _0x39eddc in _0x336859){if(_0x336859[_0xd586('0xf')](_0x39eddc)){_0x372a78['priority']=0x2;_0x372a78[_0xd586('0x10')]=[];_0x372a78[_0xd586('0x11')]=_[_0xd586('0x12')](_0x3403ac,{'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')]});_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':util[_0xd586('0x15')]('CDR(type)=%s',_0x336859[_0x39eddc][0x0][_0xd586('0x16')]),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});if(_0x336859[_0x39eddc][0x0]['type']==='outbound'){if(_0x372a78[_0xd586('0x11')]){_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':_0xd586('0x19')+(_0x372a78[_0xd586('0x11')][_0xd586('0x1a')]?'${EXTEN:'+_0x372a78['extension'][_0xd586('0x1a')]+'}':_0xd586('0x1b')),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}_0x372a78['extensions'][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':'CDR(routeid)='+_0x336859[_0x39eddc][0x0][_0xd586('0x18')],'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});var _0x544745=_0x372a78[_0xd586('0x1c')]++;_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'ExecIf','appdata':_0xd586('0x1d')+(_0x544745+0x2)+_0xd586('0x1e')+(_0x544745+0x1)+')','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x544745,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});if(_0x372a78['extension']){_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0x372a78['extension']['cutdigits']?_0xd586('0x1f')+_0x372a78[_0xd586('0x11')][_0xd586('0x1a')]+'}':_0xd586('0x20'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});}_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':'Set','appdata':_0xd586('0x21')+_0x336859[_0x39eddc][0x0]['VoiceExtensionId'],'context':_0x336859[_0x39eddc][0x0]['context'],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});if(_0x372a78[_0xd586('0x11')]&&_0x372a78[_0xd586('0x11')]['hasOwnProperty'](_0xd586('0x22'))&&_0x372a78['extension'][_0xd586('0x22')]!==_0xd586('0x23')){_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0xd586('0x24'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0xd586('0x25')+_0x372a78[_0xd586('0x11')]['recordingFormat']||'wav','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}}_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x26'),'context':_0x336859[_0x39eddc][0x0]['context'],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78['extensions'][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x27'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});for(var _0x1d13bb=0x0,_0x41f3df=0x0;_0x1d13bb<_0x336859[_0x39eddc][_0xd586('0x28')];_0x1d13bb+=0x1,_0x41f3df=0x0){var _0x277cda=_0x336859[_0x39eddc][_0x1d13bb];if(_0x277cda['type']){_0x277cda[_0xd586('0x16')]=_0x277cda[_0xd586('0x16')]['toLowerCase']();}var _0x3c1cdc=[];var _0x4cf832=[];delete _0x277cda['id'];delete _0x277cda['createdAt'];delete _0x277cda[_0xd586('0x29')];var _0x41ee41=_0x277cda[_0xd586('0x2a')]!==_0xd586('0x2b')?[_0x277cda[_0xd586('0x2a')]]:_0x277cda[_0xd586('0x7')]?_[_0xd586('0x2c')](_['filter'](_0x372a78[_0xd586('0x5')],{'IntervalId':_0x277cda[_0xd586('0x7')]}),_0xd586('0x2a')):[];if(_0x277cda[_0xd586('0xf')](_0xd586('0x2d'))){if(_0x277cda['tag']&&_0x277cda[_0xd586('0x2d')]!=='--'){_0x3c1cdc['push']({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':'CDR(tag)='+_0x277cda[_0xd586('0x2d')],'context':_0x277cda['context'],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}if(_0x277cda[_0xd586('0x16')]===_0xd586('0x2e')&&_0x277cda[_0xd586('0xf')](_0xd586('0x2f'))){if(_0x277cda[_0xd586('0x2f')]){_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':_0xd586('0x31')+_0x277cda[_0xd586('0x2f')]+')','context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}else{_0x3c1cdc['push']({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda['exten'],'priority':_0x41ee41['length']+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}if(_0x277cda[_0xd586('0xf')](_0xd586('0x32'))){if(_0x42ea4c[_0xd586('0x33')](_0x277cda[_0xd586('0x34')]['toLowerCase']())>=0x0&&_0x277cda['appType']!==_0xd586('0x35')){if(_0x277cda[_0xd586('0x32')]){_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x277cda['context'],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41['length']+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda['type'],'app':'Set','appdata':_0xd586('0x36'),'context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41['length']+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}else{_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':_0xd586('0x37'),'context':_0x277cda['context'],'exten':_0x277cda['exten'],'priority':_0x41ee41['length']+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda['VoiceExtensionId']});_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x38'),'context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}}for(var _0x495aeb=0x0;_0x495aeb<_0x41ee41[_0xd586('0x28')];_0x495aeb+=0x1){var _0x520628=_0x372a78[_0xd586('0x1c')]+_0x41ee41[_0xd586('0x28')];var _0x459061=_0x495aeb===_0x41ee41[_0xd586('0x28')]-0x1?_0x372a78[_0xd586('0x1c')]+_0x3c1cdc['length']+_0x4cf832[_0xd586('0x28')]+0x2:_0x372a78[_0xd586('0x1c')]+_0x495aeb+0x1;_0x3c1cdc[_0xd586('0x39')](_0x495aeb,0x0,{'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x3a'),'appdata':_0x41ee41[_0x495aeb]+'?'+_0x277cda['context']+_0xd586('0x3b')+_0x520628+':'+_0x277cda['context']+',${EXTEN},'+_0x459061,'exten':_0x277cda['exten'],'context':_0x277cda[_0xd586('0x17')],'priority':_0x372a78[_0xd586('0x1c')]+_0x495aeb,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}_0x277cda[_0xd586('0x1c')]=_0x3c1cdc[_0xd586('0x28')]?_[_0xd586('0x3c')](_0x3c1cdc)[_0xd586('0x1c')]+0x1:_0x372a78[_0xd586('0x1c')];_0x372a78[_0xd586('0x1c')]=(_0x4cf832['length']?_[_0xd586('0x3c')](_0x4cf832)[_0xd586('0x1c')]:_0x277cda['priority'])+0x1;_0x372a78[_0xd586('0x10')]=_[_0xd586('0x3d')](_0x372a78[_0xd586('0x10')],_0x3c1cdc,[_0x277cda],_0x4cf832);}_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x3e'),'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'priority':_0x372a78['priority'],'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x364a36['push'](_0x336859[_0x39eddc][0x0]['VoiceExtensionId']);_0x14dd3a=_['concat'](_0x14dd3a,_0x372a78[_0xd586('0x10')]);}}return _0x5d4c61[_0xd586('0x3f')](function(_0x1b2358){return _0x5d4c61[_0xd586('0x2')][_0xd586('0x6')][_0xd586('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x364a36}},'transaction':_0x1b2358})[_0xd586('0x4')](function(_0x25d4e7){return _0x5d4c61[_0xd586('0x2')][_0xd586('0x6')][_0xd586('0x41')](_[_0xd586('0x42')](_0x14dd3a,_0xd586('0x1c')),{'transaction':_0x1b2358});});});})[_0xd586('0x43')](function(_0x4dfbe2){console[_0xd586('0x44')](_0x4dfbe2);});}exports[_0xd586('0x45')]=rewrite; \ No newline at end of file +var _0x583b=['length','interval','*,*,*,*','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','error','rewrite','Interval','then','models','findAll','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x583b,0x174));var _0xb583=function(_0x5f5497,_0x50803a){_0x5f5497=_0x5f5497-0x0;var _0x10e943=_0x583b[_0x5f5497];return _0x10e943;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x116db4,_0x2b9e38){var _0x3d73ba=this;return _0x116db4['models'][_0xb583('0x0')]['findAll']({'raw':!![]})[_0xb583('0x1')](function(_0x3de958){_0x3d73ba['intervals']=_0x3de958;return _0x116db4[_0xb583('0x2')]['VoiceExtension'][_0xb583('0x3')]({'where':{'IntervalId':_0x2b9e38[_0xb583('0x4')]},'raw':!![]});})[_0xb583('0x1')](function(_0x3a1d04){return _0x116db4[_0xb583('0x2')][_0xb583('0x5')][_0xb583('0x3')]({'where':{'exten':{'$in':_[_0xb583('0x6')](_[_0xb583('0x7')](_0x3a1d04,_0xb583('0x8')))}},'order':[{'raw':_0xb583('0x9')}],'raw':!![]});})[_0xb583('0x1')](function(_0x25c6c4){var _0x5c1c5a=_[_0xb583('0xa')](_0x25c6c4,{'priority':'1'});var _0x352708=_[_0xb583('0xa')](_0x25c6c4,{'isApp':0x1});var _0x49dfc1=_[_0xb583('0xb')](_0x352708,'exten');var _0x176e10=[_0xb583('0xc'),_0xb583('0xd')];var _0x49cba0=[];var _0x4b99fa=[];for(var _0x38c8c6 in _0x49dfc1){if(_0x49dfc1[_0xb583('0xe')](_0x38c8c6)){_0x3d73ba[_0xb583('0xf')]=0x2;_0x3d73ba[_0xb583('0x10')]=[];_0x3d73ba['extension']=_['find'](_0x5c1c5a,{'exten':_0x49dfc1[_0x38c8c6][0x0]['exten']});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':util[_0xb583('0x14')](_0xb583('0x15'),_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')]),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0]['exten'],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')]===_0xb583('0x18')){if(_0x3d73ba[_0xb583('0x19')]){_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x1a')+(_0x3d73ba[_0xb583('0x19')]['cutdigits']?_0xb583('0x1b')+_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]+'}':_0xb583('0x1d')),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x3d73ba[_0xb583('0x10')]['push']({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x1e')+_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')],'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0]['exten'],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});var _0x494f9e=_0x3d73ba[_0xb583('0xf')]++;_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0]['type'],'app':_0xb583('0x1f'),'appdata':_0xb583('0x20')+(_0x494f9e+0x2)+'):Goto('+(_0x494f9e+0x1)+')','context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x494f9e,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x3d73ba[_0xb583('0x19')]){_0x3d73ba['extensions'][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x3d73ba[_0xb583('0x19')][_0xb583('0x1c')]+'}':_0xb583('0x21'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba['priority']++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x22')+_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId'],'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});if(_0x3d73ba['extension']&&_0x3d73ba['extension'][_0xb583('0xe')](_0xb583('0x23'))&&_0x3d73ba['extension']['recordingFormat']!=='none'){_0x3d73ba['extensions'][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x24'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x25')+_0x3d73ba[_0xb583('0x19')][_0xb583('0x23')]||_0xb583('0x26'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x27'),'context':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x16')],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba['priority']++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')]['push']({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x28'),'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x29'),'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'priority':_0x3d73ba[_0xb583('0xf')]++,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});for(var _0x4b7d05=0x0,_0x50904b=0x0;_0x4b7d05<_0x49dfc1[_0x38c8c6][_0xb583('0x2a')];_0x4b7d05+=0x1,_0x50904b=0x0){var _0x2f92e5=_0x49dfc1[_0x38c8c6][_0x4b7d05];if(_0x2f92e5[_0xb583('0x12')]){_0x2f92e5[_0xb583('0x12')]=_0x2f92e5[_0xb583('0x12')]['toLowerCase']();}var _0x12e79d=[];var _0xb12dbc=[];delete _0x2f92e5['id'];delete _0x2f92e5['createdAt'];delete _0x2f92e5['updatedAt'];var _0x4f5489=_0x2f92e5[_0xb583('0x2b')]!==_0xb583('0x2c')?[_0x2f92e5[_0xb583('0x2b')]]:_0x2f92e5[_0xb583('0x4')]?_[_0xb583('0x7')](_['filter'](_0x3d73ba[_0xb583('0x2d')],{'IntervalId':_0x2f92e5[_0xb583('0x4')]}),_0xb583('0x2b')):[];if(_0x2f92e5[_0xb583('0xe')]('tag')){if(_0x2f92e5[_0xb583('0x2e')]&&_0x2f92e5[_0xb583('0x2e')]!=='--'){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':'Set','appdata':'CDR(tag)='+_0x2f92e5['tag'],'context':_0x2f92e5['context'],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}if(_0x2f92e5[_0xb583('0x12')]===_0xb583('0x18')&&_0x2f92e5['hasOwnProperty'](_0xb583('0x2f'))){if(_0x2f92e5[_0xb583('0x2f')]){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x30')+_0x2f92e5[_0xb583('0x2f')]+')','context':_0x2f92e5['context'],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}else{_0x12e79d['push']({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x31'),'context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba['priority']+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}if(_0x2f92e5[_0xb583('0xe')](_0xb583('0x32'))){if(_0x176e10[_0xb583('0x33')](_0x2f92e5[_0xb583('0x34')][_0xb583('0x35')]())>=0x0&&_0x2f92e5[_0xb583('0x36')]!==_0xb583('0x37')){if(_0x2f92e5['answer']){_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':_0xb583('0x38'),'context':_0x2f92e5['context'],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5['type'],'app':_0xb583('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489['length']+_0x3d73ba['priority']+_0x50904b++,'VoiceExtensionId':_0x2f92e5['VoiceExtensionId']});}else{_0x12e79d[_0xb583('0x11')]({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5[_0xb583('0x8')],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});_0x12e79d['push']({'type':_0x2f92e5[_0xb583('0x12')],'app':_0xb583('0x13'),'appdata':_0xb583('0x39'),'context':_0x2f92e5[_0xb583('0x16')],'exten':_0x2f92e5['exten'],'priority':_0x4f5489[_0xb583('0x2a')]+_0x3d73ba[_0xb583('0xf')]+_0x50904b++,'VoiceExtensionId':_0x2f92e5[_0xb583('0x17')]});}}}for(var _0x227be4=0x0;_0x227be4<_0x4f5489[_0xb583('0x2a')];_0x227be4+=0x1){var _0x2b8b56=_0x3d73ba[_0xb583('0xf')]+_0x4f5489['length'];var _0x481425=_0x227be4===_0x4f5489[_0xb583('0x2a')]-0x1?_0x3d73ba['priority']+_0x12e79d[_0xb583('0x2a')]+_0xb12dbc['length']+0x2:_0x3d73ba[_0xb583('0xf')]+_0x227be4+0x1;_0x12e79d[_0xb583('0x3a')](_0x227be4,0x0,{'type':_0x2f92e5['type'],'app':_0xb583('0x3b'),'appdata':_0x4f5489[_0x227be4]+'?'+_0x2f92e5[_0xb583('0x16')]+',${EXTEN},'+_0x2b8b56+':'+_0x2f92e5[_0xb583('0x16')]+_0xb583('0x3c')+_0x481425,'exten':_0x2f92e5[_0xb583('0x8')],'context':_0x2f92e5['context'],'priority':_0x3d73ba['priority']+_0x227be4,'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]});}_0x2f92e5[_0xb583('0xf')]=_0x12e79d['length']?_['last'](_0x12e79d)[_0xb583('0xf')]+0x1:_0x3d73ba[_0xb583('0xf')];_0x3d73ba['priority']=(_0xb12dbc[_0xb583('0x2a')]?_[_0xb583('0x3d')](_0xb12dbc)[_0xb583('0xf')]:_0x2f92e5['priority'])+0x1;_0x3d73ba['extensions']=_[_0xb583('0x3e')](_0x3d73ba[_0xb583('0x10')],_0x12e79d,[_0x2f92e5],_0xb12dbc);}_0x3d73ba[_0xb583('0x10')][_0xb583('0x11')]({'type':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x12')],'app':_0xb583('0x3f'),'exten':_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x8')],'context':_0x49dfc1[_0x38c8c6][0x0]['context'],'priority':_0x3d73ba[_0xb583('0xf')],'VoiceExtensionId':_0x49dfc1[_0x38c8c6][0x0]['VoiceExtensionId']});_0x49cba0[_0xb583('0x11')](_0x49dfc1[_0x38c8c6][0x0][_0xb583('0x17')]);_0x4b99fa=_['concat'](_0x4b99fa,_0x3d73ba['extensions']);}}return _0x116db4[_0xb583('0x40')](function(_0x61cb0c){return _0x116db4[_0xb583('0x2')][_0xb583('0x5')][_0xb583('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x49cba0}},'transaction':_0x61cb0c})[_0xb583('0x1')](function(_0x59f51e){return _0x116db4['models']['VoiceExtension']['bulkCreate'](_['sortBy'](_0x4b99fa,_0xb583('0xf')),{'transaction':_0x61cb0c});});});})[_0xb583('0x42')](function(_0x3f9b9b){console[_0xb583('0x43')](_0x3f9b9b);});}exports[_0xb583('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index a7b7303..34eab0a 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 _0x7001=['lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','Missing\x20ListId\x20parameter!','contact','test','isNil','error','errors','length','message','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','duplicate','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','ListId\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','catch','sequelize','all','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','stringify','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','split','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x7001,0x1a3));var _0x1700=function(_0x20b71e,_0x22eb05){_0x20b71e=_0x20b71e-0x0;var _0x5dee1e=_0x7001[_0x20b71e];return _0x5dee1e;};'use strict';var BPromise=require(_0x1700('0x0'));var util=require('util');var _=require(_0x1700('0x1'));var fs=require('fs');var squel=require(_0x1700('0x2'));var Papa=require('papaparse');var Redis=require(_0x1700('0x3'));var db=require(_0x1700('0x4'))['db'];var config=require(_0x1700('0x5'));var logger=require(_0x1700('0x6'))(_0x1700('0x7'));config['redis']=_[_0x1700('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1700('0x9'))(new Redis(config['redis']));require(_0x1700('0xa'))[_0x1700('0xb')](socket);try{if(!process[_0x1700('0xc')][0x2]||process[_0x1700('0xc')][0x2]===_0x1700('0xd')||process['argv'][0x2]===_0x1700('0xe')){throw new Error(_0x1700('0xf'));}var FILEPATH=process[_0x1700('0xc')][0x2];if(!process['argv'][0x3]||process[_0x1700('0xc')][0x3]===_0x1700('0xd')||process[_0x1700('0xc')][0x3]===_0x1700('0xe')||!process[_0x1700('0xc')][0x4]||process[_0x1700('0xc')][0x4]===_0x1700('0xd')||process[_0x1700('0xc')][0x4]===_0x1700('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1700('0x10')](process[_0x1700('0xc')][0x3]['split'](','),process[_0x1700('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x1700('0xc')][0x5]===_0x1700('0xd')||process[_0x1700('0xc')][0x5]===_0x1700('0xe')){throw new Error(_0x1700('0x11'));}var LISTID=process[_0x1700('0xc')][0x5];var COMPANYID=process[_0x1700('0xc')][0x6]&&process[_0x1700('0xc')][0x6]!==_0x1700('0xd')&&process['argv'][0x6]!==_0x1700('0xe')?process[_0x1700('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x1700('0xc')][0x7]!==_0x1700('0xd')&&process['argv'][0x7]!=='null'?process[_0x1700('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x1700('0xd')||process[_0x1700('0xc')][0x8]===_0x1700('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1700('0xc')][0x8];}catch(_0x38f03c){logger['error'](_0x38f03c);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(_0x1dfe01,_0x296643,_0x4e86a1,_0x1155c7){var _0x2ca38b={'message':_0x296643};_0x2ca38b[_0x1dfe01]=!![];if(_0x4e86a1){_0x2ca38b[_0x1700('0x12')]=_0x4e86a1;}if(_0x1155c7){_0x2ca38b['index']=_0x1155c7;}return _0x2ca38b;}function isEmail(_0xe9afde){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))*$/[_0x1700('0x13')](_0xe9afde);}function checkRow(_0x47c09a,_0x46e9b5,_0x325a7d){return new BPromise(function(_0x488956,_0x1b5014){if(_[_0x1700('0x14')](_0x47c09a)){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x325a7d));}if(_0x47c09a[_0x1700('0x16')]&&_0x47c09a[_0x1700('0x16')][_0x1700('0x17')]){var _0x184891=_['map'](_0x47c09a[_0x1700('0x16')],_0x1700('0x18'))['join'](';');return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x184891,null,_0x325a7d));}var _0x2efc4f={};for(var _0x179e17 in FIELDS){if(FIELDS['hasOwnProperty'](_0x179e17)&&FIELDS[_0x179e17]){_0x2efc4f[_0x179e17]=_0x47c09a[_0x1700('0x19')][0x0][FIELDS[_0x179e17]]||_0x47c09a[_0x1700('0x19')][0x0]['\ufeff'+FIELDS[_0x179e17]];}}if(!_0x2efc4f[_0x1700('0x1a')]){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),'firstName\x20not\x20specified!',null,_0x325a7d));}if(!_0x2efc4f[_0x1700('0x1b')]){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x1c'),null,_0x325a7d));}if(_0x2efc4f[_0x1700('0x1d')]){var _0xb0929f=moment(_0x2efc4f['birthDate'],_0x1700('0x1e'));if(!_0xb0929f[_0x1700('0x1f')]()){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x20'),null,_0x325a7d));}}if(_0x2efc4f[_0x1700('0x21')]){if(!isEmail(_0x2efc4f[_0x1700('0x21')])){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x22'),null,_0x325a7d));}}_0x2efc4f['ListId']=LISTID;_0x2efc4f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x46e9b5){var _0x42fbd6={};for(var _0x6d6ef9=0x0,_0x1098d9=DUPLICATES[_0x1700('0x17')];_0x6d6ef9<_0x1098d9;_0x6d6ef9+=0x1){_0x42fbd6[DUPLICATES[_0x6d6ef9]]=_0x2efc4f[DUPLICATES[_0x6d6ef9]];}var _0x445ce1=_['find'](_0x46e9b5,_0x42fbd6);if(_0x445ce1){return _0x1b5014(handleCheckRowError(_0x1700('0x23'),'Duplicate\x20Contact',_0x445ce1,_0x325a7d));}}return db[_0x1700('0x24')][_0x1700('0x25')](_0x2efc4f,{'raw':!![],'hooks':![],'fields':_[_0x1700('0x26')](_0x2efc4f)})[_0x1700('0x27')](function(_0x33fffb){if(DUPLICATES&&DUPLICATES['length']&&_0x46e9b5){_0x46e9b5[_0x1700('0x28')](_[_0x1700('0x29')](_0x2efc4f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x33fffb['id'];return _0x488956();})['catch'](function(_0x5c7dbc){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x2a')+(_0x5c7dbc['message']||JSON['stringify'](_0x5c7dbc)),null,_0x325a7d));});});}function checkHopper(){function _0x52685a(){return function(_0x4683ca){logger[_0x1700('0x15')](_0x1700('0x2b'),_0x1700('0x2c'),util['inspect'](_0x4683ca,{'showHidden':![],'depth':null}));};}var _0x3a823b=function(_0x2f0073,_0x288e24){var _0x4d586f=squel['insert']()[_0x1700('0x2d')](_0x1700('0x2e'))[_0x1700('0x2f')]([_0x1700('0x1b'),_0x1700('0x30'),_0x1700('0x31'),'ListId',_0x288e24,_0x1700('0x32'),'updatedAt'],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),_0x1700('0x1b'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x30'))[_0x1700('0x34')]('id','ContactId')[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x2f0073['id'][_0x1700('0x36')](),_0x288e24)[_0x1700('0x34')]('NOW()',_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x38'))[_0x1700('0x39')](_0x1700('0x3a'))[_0x1700('0x3b')](_0x1700('0x3c'))['where']('ListId\x20=\x20?',LISTID[_0x1700('0x36')]())[_0x1700('0x3b')](_0x1700('0x3d'))[_0x1700('0x3b')](_0x1700('0x3e'),squel['select']()['field'](_0x1700('0x1b'))['from'](_0x1700('0x2e'))['where'](_0x288e24+_0x1700('0x3f'),_0x2f0073['id'][_0x1700('0x36')]())))[_0x1700('0x36')]();return _0x4d586f;};var _0x5df904=function(_0x5166bc,_0x4cecda){var _0x196530=squel['insert']()[_0x1700('0x2d')](_0x1700('0x2e'))[_0x1700('0x2f')]([_0x1700('0x1b'),_0x1700('0x30'),'ContactId',_0x1700('0x37'),_0x4cecda,'createdAt','updatedAt'],squel[_0x1700('0x33')]()['field']('phone',_0x1700('0x1b'))[_0x1700('0x34')]('NOW()',_0x1700('0x30'))[_0x1700('0x34')]('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x5166bc['id']['toString'](),_0x4cecda)[_0x1700('0x34')]('NOW()',_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x38'))['from'](_0x1700('0x3a'))['where'](_0x1700('0x3c'))['where']('ListId\x20=\x20?',LISTID[_0x1700('0x36')]())['where'](_0x1700('0x40'),squel[_0x1700('0x41')](hopperContacts))['where'](_0x1700('0x3d'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x1700('0x34')](_0x1700('0x42'))[_0x1700('0x39')](_0x1700('0x43'))[_0x1700('0x3b')](_0x4cecda+'\x20=\x20?',_0x5166bc['id'][_0x1700('0x36')]()))[_0x1700('0x3b')](_0x1700('0x3e'),squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'))[_0x1700('0x39')]('cm_hopper')[_0x1700('0x3b')](_0x4cecda+_0x1700('0x3f'),_0x5166bc['id'][_0x1700('0x36')]())))[_0x1700('0x36')]();return _0x196530;};function _0x110189(_0x241cab,_0x12e6a9){var _0x2b2a30=squel[_0x1700('0x44')]()[_0x1700('0x2d')]('cm_hopper')[_0x1700('0x2f')](['phone','scheduledAt','ContactId','ListId',_0x12e6a9,'createdAt',_0x1700('0x38')],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),'phone')['field'](_0x1700('0x35'),_0x1700('0x30'))[_0x1700('0x34')]('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x241cab['id']['toString'](),_0x12e6a9)[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x32'))['field']('NOW()',_0x1700('0x38'))[_0x1700('0x39')](_0x1700('0x3a'))[_0x1700('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x1700('0x45'),LISTID[_0x1700('0x36')]())['where'](_0x1700('0x40'),squel['str'](hopperContacts))[_0x1700('0x3b')](_0x1700('0x3d')))[_0x1700('0x36')]();return _0x2b2a30;}function _0x2491a9(_0x31da15,_0x4129ed){var _0xaec396=squel[_0x1700('0x44')]()[_0x1700('0x2d')](_0x1700('0x46'))[_0x1700('0x2f')]([_0x1700('0x1b'),'ContactId','ListId',_0x4129ed,_0x1700('0x32'),_0x1700('0x38')],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),'phone')['field']('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),'ListId')['field'](_0x31da15['id'][_0x1700('0x36')](),_0x4129ed)[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),'updatedAt')[_0x1700('0x39')]('cm_contacts')[_0x1700('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x1700('0x45'),LISTID[_0x1700('0x36')]())[_0x1700('0x3b')](_0x1700('0x40'),squel[_0x1700('0x41')](hopperContacts))[_0x1700('0x3b')](_0x1700('0x3d')))[_0x1700('0x36')]();return _0xaec396;}return db[_0x1700('0x47')][_0x1700('0x48')]({'where':{'type':_0x1700('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x4b'),'where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x136e18){var _0x4b0e1a=[];if(_0x136e18){var _0x39dde4;for(var _0x3c4df4=0x0,_0x29f46f;_0x3c4df4<_0x136e18[_0x1700('0x17')];_0x3c4df4+=0x1){_0x29f46f=_0x136e18[_0x3c4df4]['get']({'plain':!![]});switch(_0x29f46f[_0x1700('0x4c')]){case _0x1700('0x4d'):_0x4b0e1a[_0x1700('0x28')](db['sequelize'][_0x1700('0x4e')](_0x5df904(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})['catch'](_0x52685a()));break;case _0x1700('0x50'):_0x4b0e1a[_0x1700('0x28')](db['sequelize']['query'](_0x3a823b(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})[_0x1700('0x51')](_0x52685a()));break;default:_0x4b0e1a[_0x1700('0x28')](db[_0x1700('0x52')][_0x1700('0x4e')](_0x110189(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})['catch'](_0x52685a()));}}}return _0x4b0e1a;})[_0x1700('0x53')]()['then'](function(){return db['VoiceQueue'][_0x1700('0x48')]({'where':{'type':_0x1700('0x49')},'attributes':['id'],'include':[{'model':db[_0x1700('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x3056aa){var _0x265e4b=[];if(_0x3056aa){var _0x24cddf;for(var _0x557a14=0x0,_0x4ecee8;_0x557a14<_0x3056aa[_0x1700('0x17')];_0x557a14+=0x1){_0x4ecee8=_0x3056aa[_0x557a14][_0x1700('0x54')]({'plain':!![]});_0x265e4b[_0x1700('0x28')](db['sequelize'][_0x1700('0x4e')](_0x2491a9(_0x4ecee8,_0x1700('0x4f')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));}}return _0x265e4b;})[_0x1700('0x53')]();})[_0x1700('0x27')](function(){return db[_0x1700('0x55')][_0x1700('0x48')]({'attributes':['id',_0x1700('0x4c')],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x4b'),'where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x2c9af2){var _0x5fa545=[];if(_0x2c9af2){for(var _0x29dc49=0x0,_0x568ac8;_0x29dc49<_0x2c9af2[_0x1700('0x17')];_0x29dc49+=0x1){_0x568ac8=_0x2c9af2[_0x29dc49]['get']({'plain':!![]});switch(_0x568ac8[_0x1700('0x4c')]){case _0x1700('0x4d'):_0x5fa545[_0x1700('0x28')](db['sequelize']['query'](_0x5df904(_0x568ac8,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));break;case _0x1700('0x50'):_0x5fa545['push'](db[_0x1700('0x52')][_0x1700('0x4e')](_0x3a823b(_0x568ac8,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));break;default:_0x5fa545[_0x1700('0x28')](db[_0x1700('0x52')][_0x1700('0x4e')](_0x110189(_0x568ac8,_0x1700('0x56')))[_0x1700('0x27')](function(){})[_0x1700('0x51')](_0x52685a()));}}}return _0x5fa545;})[_0x1700('0x53')]();})[_0x1700('0x27')](function(){return db[_0x1700('0x55')][_0x1700('0x48')]({'attributes':['id'],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x4c15f2){var _0x5c69d7=[];if(_0x4c15f2){for(var _0x2e2c81=0x0,_0x5a28a4;_0x2e2c81<_0x4c15f2[_0x1700('0x17')];_0x2e2c81+=0x1){_0x5a28a4=_0x4c15f2[_0x2e2c81][_0x1700('0x54')]({'plain':!![]});_0x5c69d7[_0x1700('0x28')](db[_0x1700('0x52')]['query'](_0x2491a9(_0x5a28a4,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));}}return _0x5c69d7;})[_0x1700('0x53')]();})[_0x1700('0x51')](function(_0x4ca03a){logger[_0x1700('0x15')](_0x1700('0x58'),'generalCheckHopper',_0x4ca03a[_0x1700('0x18')]);});}var processPromises=function(_0x3a2928){return BPromise[_0x1700('0x53')](promises)[_0x1700('0x27')](function(_0x4a9f36){})[_0x1700('0x51')](function(_0x1f6495){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x1700('0x59')](_0x1f6495));})['finally'](function(){socket[_0x1700('0x5a')](_0x1700('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3a2928){return _0x3a2928[_0x1700('0x5c')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x1700('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0x1700('0x27')](function(){socket[_0x1700('0x5a')](_0x1700('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1700('0x5d')](FILEPATH);}catch(_0x5484cb){logger[_0x1700('0x15')](_0x1700('0x5e'),JSON[_0x1700('0x59')](_0x5484cb));}finally{process[_0x1700('0x5f')](0x0);}});};process['on'](_0x1700('0x60'),function(){logger[_0x1700('0x61')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x1700('0x62')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1700('0x63')](',');return db[_0x1700('0x24')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1700('0x27')](function(_0x36a82b){var _0x2977f1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1700('0x64')](_0x2977f1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3da393,_0x24220e){total+=0x1;var _0x57c430=total;promises['push'](checkRow(_0x3da393,_0x36a82b,_0x57c430)[_0x1700('0x27')](function(){success+=0x1;})[_0x1700('0x51')](function(_0x13a673){if(_0x13a673[_0x1700('0x15')]){errors+=0x1;delete _0x13a673['error'];}else if(_0x13a673[_0x1700('0x23')]){duplicates+=0x1;delete _0x13a673[_0x1700('0x23')];}rows[_0x1700('0x28')](_0x13a673);}));if(total%0xc8===0x0){_0x24220e[_0x1700('0x65')]();return processPromises(_0x24220e);}},'complete':function(){return processPromises()[_0x1700('0x27')](function(){logger['info'](_0x1700('0x66'));endCsv();});},'error':function(_0x479312,_0x1741aa){logger[_0x1700('0x61')](_0x1700('0x67'),JSON[_0x1700('0x59')](_0x479312));endCsv();}});})[_0x1700('0x51')](function(_0x161bb4){logger[_0x1700('0x15')](_0x1700('0x68'),JSON[_0x1700('0x59')](_0x161bb4));});}main(); \ No newline at end of file +var _0x0b18=['insert','into','fromQuery','str','calleridnum','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','stringify','checkHopper','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?'];(function(_0x4aa728,_0x3e3220){var _0x73886f=function(_0x12b830){while(--_0x12b830){_0x4aa728['push'](_0x4aa728['shift']());}};_0x73886f(++_0x3e3220);}(_0x0b18,0x96));var _0x80b1=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x0b18[_0x81f000];return _0x337aa2;};'use strict';var BPromise=require(_0x80b1('0x0'));var util=require(_0x80b1('0x1'));var _=require(_0x80b1('0x2'));var fs=require('fs');var squel=require(_0x80b1('0x3'));var Papa=require(_0x80b1('0x4'));var Redis=require('ioredis');var db=require(_0x80b1('0x5'))['db'];var config=require(_0x80b1('0x6'));var logger=require('../../../config/logger')('api');config['redis']=_[_0x80b1('0x7')](config[_0x80b1('0x8')],{'host':_0x80b1('0x9'),'port':0x18eb});var socket=require(_0x80b1('0xa'))(new Redis(config[_0x80b1('0x8')]));require(_0x80b1('0xb'))[_0x80b1('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x80b1('0xd')][0x2]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x2]===_0x80b1('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x80b1('0xd')][0x2];if(!process[_0x80b1('0xd')][0x3]||process['argv'][0x3]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x3]==='null'||!process[_0x80b1('0xd')][0x4]||process['argv'][0x4]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x4]===_0x80b1('0xf')){throw new Error(_0x80b1('0x10'));}var FIELDS=_[_0x80b1('0x11')](process['argv'][0x3][_0x80b1('0x12')](','),process[_0x80b1('0xd')][0x4][_0x80b1('0x12')](','));if(!process[_0x80b1('0xd')][0x5]||process[_0x80b1('0xd')][0x5]===_0x80b1('0xe')||process['argv'][0x5]===_0x80b1('0xf')){throw new Error(_0x80b1('0x13'));}var LISTID=process[_0x80b1('0xd')][0x5];var COMPANYID=process[_0x80b1('0xd')][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!==_0x80b1('0xf')?process[_0x80b1('0xd')][0x6]:null;var DUPLICATES=process[_0x80b1('0xd')][0x7]&&process[_0x80b1('0xd')][0x7]!=='undefined'&&process[_0x80b1('0xd')][0x7]!==_0x80b1('0xf')?process[_0x80b1('0xd')][0x7]:null;if(!process[_0x80b1('0xd')][0x8]||process['argv'][0x8]===_0x80b1('0xe')||process[_0x80b1('0xd')][0x8]===_0x80b1('0xf')){throw new Error(_0x80b1('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4e1706){logger[_0x80b1('0x15')](_0x4e1706);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(_0x1ea8c6,_0x4d11b4,_0x1968fe,_0x4f52da){var _0x3660ac={'message':_0x4d11b4};_0x3660ac[_0x1ea8c6]=!![];if(_0x1968fe){_0x3660ac['contact']=_0x1968fe;}if(_0x4f52da){_0x3660ac[_0x80b1('0x16')]=_0x4f52da;}return _0x3660ac;}function isEmail(_0x113238){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))*$/[_0x80b1('0x17')](_0x113238);}function checkRow(_0x15307c,_0x4b4b1b,_0x49a4d0){return new BPromise(function(_0x26d069,_0x46e5d8){if(_[_0x80b1('0x18')](_0x15307c)){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x19'),null,_0x49a4d0));}if(_0x15307c['errors']&&_0x15307c[_0x80b1('0x1a')][_0x80b1('0x1b')]){var _0x5e76f9=_['map'](_0x15307c[_0x80b1('0x1a')],_0x80b1('0x1c'))['join'](';');return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x5e76f9,null,_0x49a4d0));}var _0x4dcb1d={};for(var _0x587ea1 in FIELDS){if(FIELDS[_0x80b1('0x1d')](_0x587ea1)&&FIELDS[_0x587ea1]){_0x4dcb1d[_0x587ea1]=_0x15307c['data'][0x0][FIELDS[_0x587ea1]]||_0x15307c[_0x80b1('0x1e')][0x0]['\ufeff'+FIELDS[_0x587ea1]];}}if(!_0x4dcb1d[_0x80b1('0x1f')]){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x20'),null,_0x49a4d0));}if(!_0x4dcb1d[_0x80b1('0x21')]){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x22'),null,_0x49a4d0));}if(_0x4dcb1d[_0x80b1('0x23')]){var _0xe9b1ae=moment(_0x4dcb1d['birthDate'],_0x80b1('0x24'));if(!_0xe9b1ae[_0x80b1('0x25')]()){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),_0x80b1('0x26'),null,_0x49a4d0));}}if(_0x4dcb1d['email']){if(!isEmail(_0x4dcb1d[_0x80b1('0x27')])){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x49a4d0));}}_0x4dcb1d['ListId']=LISTID;_0x4dcb1d[_0x80b1('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x80b1('0x1b')]&&_0x4b4b1b){var _0x8f04f6={};for(var _0x5d413d=0x0,_0xa263f7=DUPLICATES['length'];_0x5d413d<_0xa263f7;_0x5d413d+=0x1){_0x8f04f6[DUPLICATES[_0x5d413d]]=_0x4dcb1d[DUPLICATES[_0x5d413d]];}var _0x417c67=_['find'](_0x4b4b1b,_0x8f04f6);if(_0x417c67){return _0x46e5d8(handleCheckRowError('duplicate',_0x80b1('0x29'),_0x417c67,_0x49a4d0));}}return db[_0x80b1('0x2a')][_0x80b1('0x2b')](_0x4dcb1d,{'raw':!![],'hooks':![],'fields':_[_0x80b1('0x2c')](_0x4dcb1d)})[_0x80b1('0x2d')](function(_0x19d034){if(DUPLICATES&&DUPLICATES[_0x80b1('0x1b')]&&_0x4b4b1b){_0x4b4b1b['push'](_[_0x80b1('0x2e')](_0x4dcb1d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x19d034['id'];return _0x26d069();})[_0x80b1('0x2f')](function(_0x1b83ea){return _0x46e5d8(handleCheckRowError(_0x80b1('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1b83ea[_0x80b1('0x1c')]||JSON[_0x80b1('0x30')](_0x1b83ea)),null,_0x49a4d0));});});}function checkHopper(){function _0x58eb04(){return function(_0x357a37){logger[_0x80b1('0x15')]('cmContact',_0x80b1('0x31'),util['inspect'](_0x357a37,{'showHidden':![],'depth':null}));};}var _0x544237=function(_0x42aa92,_0x42f2a7){var _0x5d3816=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x80b1('0x32'),_0x80b1('0x33'),_0x80b1('0x34'),_0x42f2a7,_0x80b1('0x35'),_0x80b1('0x36')],squel['select']()[_0x80b1('0x37')](_0x80b1('0x21'),_0x80b1('0x21'))[_0x80b1('0x37')]('NOW()',_0x80b1('0x32'))[_0x80b1('0x37')]('id','ContactId')[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x42aa92['id'][_0x80b1('0x38')](),_0x42f2a7)[_0x80b1('0x37')](_0x80b1('0x39'),'createdAt')[_0x80b1('0x37')](_0x80b1('0x39'),_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))[_0x80b1('0x3c')](_0x80b1('0x3d'))['where'](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())[_0x80b1('0x3c')](_0x80b1('0x3f'))['where'](_0x80b1('0x40'),squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'))['from'](_0x80b1('0x42'))[_0x80b1('0x3c')](_0x42f2a7+_0x80b1('0x43'),_0x42aa92['id'][_0x80b1('0x38')]())))[_0x80b1('0x38')]();return _0x5d3816;};var _0x266558=function(_0x5850ec,_0x30e524){var _0x5efa44=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x42'))[_0x80b1('0x46')]([_0x80b1('0x21'),'scheduledAt',_0x80b1('0x33'),_0x80b1('0x34'),_0x30e524,'createdAt',_0x80b1('0x36')],squel[_0x80b1('0x41')]()[_0x80b1('0x37')]('phone',_0x80b1('0x21'))[_0x80b1('0x37')](_0x80b1('0x39'),_0x80b1('0x32'))[_0x80b1('0x37')]('id',_0x80b1('0x33'))[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),'ListId')[_0x80b1('0x37')](_0x5850ec['id']['toString'](),_0x30e524)[_0x80b1('0x37')]('NOW()',_0x80b1('0x35'))['field'](_0x80b1('0x39'),_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))['where'](_0x80b1('0x3d'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')](_0x80b1('0x3f'))['where'](_0x80b1('0x40'),squel['select']()[_0x80b1('0x37')](_0x80b1('0x48'))['from']('cm_hopper_final')[_0x80b1('0x3c')](_0x30e524+_0x80b1('0x43'),_0x5850ec['id'][_0x80b1('0x38')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x80b1('0x21'))[_0x80b1('0x3a')]('cm_hopper')[_0x80b1('0x3c')](_0x30e524+_0x80b1('0x43'),_0x5850ec['id'][_0x80b1('0x38')]())))['toString']();return _0x5efa44;};function _0x352fe4(_0x28b344,_0x6110b6){var _0x36690c=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x42'))[_0x80b1('0x46')](['phone',_0x80b1('0x32'),'ContactId',_0x80b1('0x34'),_0x6110b6,_0x80b1('0x35'),'updatedAt'],squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'),'phone')['field'](_0x80b1('0x39'),'scheduledAt')['field']('id',_0x80b1('0x33'))['field'](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x28b344['id'][_0x80b1('0x38')](),_0x6110b6)[_0x80b1('0x37')]('NOW()',_0x80b1('0x35'))[_0x80b1('0x37')]('NOW()',_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))['where'](_0x80b1('0x3d'))['where'](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())[_0x80b1('0x3c')](_0x80b1('0x49'),squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x80b1('0x38')]();return _0x36690c;}function _0x195af4(_0x2f5f2b,_0x227ea9){var _0x5c7b2e=squel[_0x80b1('0x44')]()[_0x80b1('0x45')](_0x80b1('0x4a'))[_0x80b1('0x46')](['phone',_0x80b1('0x33'),_0x80b1('0x34'),_0x227ea9,_0x80b1('0x35'),_0x80b1('0x36')],squel[_0x80b1('0x41')]()[_0x80b1('0x37')](_0x80b1('0x21'),_0x80b1('0x21'))[_0x80b1('0x37')]('id',_0x80b1('0x33'))[_0x80b1('0x37')](LISTID[_0x80b1('0x38')](),_0x80b1('0x34'))[_0x80b1('0x37')](_0x2f5f2b['id']['toString'](),_0x227ea9)[_0x80b1('0x37')]('NOW()','createdAt')['field']('NOW()',_0x80b1('0x36'))[_0x80b1('0x3a')](_0x80b1('0x3b'))[_0x80b1('0x3c')](_0x80b1('0x3d'))[_0x80b1('0x3c')](_0x80b1('0x3e'),LISTID[_0x80b1('0x38')]())['where'](_0x80b1('0x49'),squel[_0x80b1('0x47')](hopperContacts))[_0x80b1('0x3c')](_0x80b1('0x3f')))[_0x80b1('0x38')]();return _0x5c7b2e;}return db[_0x80b1('0x4b')][_0x80b1('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x80b1('0x4d')],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x4f'),'where':{'id':LISTID}}]})[_0x80b1('0x2d')](function(_0x1aa7d7){var _0x1872dd=[];if(_0x1aa7d7){var _0x5ea402;for(var _0x11bc98=0x0,_0x4dafa1;_0x11bc98<_0x1aa7d7['length'];_0x11bc98+=0x1){_0x4dafa1=_0x1aa7d7[_0x11bc98][_0x80b1('0x50')]({'plain':!![]});switch(_0x4dafa1[_0x80b1('0x4d')]){case _0x80b1('0x51'):_0x1872dd[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x266558(_0x4dafa1,_0x80b1('0x54')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;case _0x80b1('0x55'):_0x1872dd['push'](db[_0x80b1('0x56')][_0x80b1('0x53')](_0x544237(_0x4dafa1,'VoiceQueueId'))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;default:_0x1872dd['push'](db['sequelize']['query'](_0x352fe4(_0x4dafa1,_0x80b1('0x54')))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}}return _0x1872dd;})[_0x80b1('0x57')]()['then'](function(){return db[_0x80b1('0x4b')][_0x80b1('0x4c')]({'where':{'type':_0x80b1('0x58')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x80b1('0x59'),'where':{'id':LISTID}}]})[_0x80b1('0x2d')](function(_0x4dcea4){var _0x4ea9ae=[];if(_0x4dcea4){var _0x20d000;for(var _0x26943e=0x0,_0x4f1c27;_0x26943e<_0x4dcea4[_0x80b1('0x1b')];_0x26943e+=0x1){_0x4f1c27=_0x4dcea4[_0x26943e][_0x80b1('0x50')]({'plain':!![]});_0x4ea9ae[_0x80b1('0x52')](db[_0x80b1('0x56')][_0x80b1('0x53')](_0x195af4(_0x4f1c27,_0x80b1('0x54')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}return _0x4ea9ae;})['all']();})[_0x80b1('0x2d')](function(){return db[_0x80b1('0x5a')]['findAll']({'attributes':['id',_0x80b1('0x4d')],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x380cd9){var _0x5c45c0=[];if(_0x380cd9){for(var _0x35e5db=0x0,_0x58f14f;_0x35e5db<_0x380cd9[_0x80b1('0x1b')];_0x35e5db+=0x1){_0x58f14f=_0x380cd9[_0x35e5db]['get']({'plain':!![]});switch(_0x58f14f['dialCheckDuplicateType']){case'always':_0x5c45c0[_0x80b1('0x52')](db['sequelize']['query'](_0x266558(_0x58f14f,_0x80b1('0x5b')))[_0x80b1('0x2d')](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;case _0x80b1('0x55'):_0x5c45c0[_0x80b1('0x52')](db[_0x80b1('0x56')]['query'](_0x544237(_0x58f14f,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));break;default:_0x5c45c0[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x352fe4(_0x58f14f,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}}return _0x5c45c0;})[_0x80b1('0x57')]();})[_0x80b1('0x2d')](function(){return db[_0x80b1('0x5a')][_0x80b1('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x80b1('0x4e')],'as':_0x80b1('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x107d66){var _0x346e30=[];if(_0x107d66){for(var _0xe42597=0x0,_0x22300d;_0xe42597<_0x107d66[_0x80b1('0x1b')];_0xe42597+=0x1){_0x22300d=_0x107d66[_0xe42597][_0x80b1('0x50')]({'plain':!![]});_0x346e30[_0x80b1('0x52')](db['sequelize'][_0x80b1('0x53')](_0x195af4(_0x22300d,_0x80b1('0x5b')))['then'](function(){})[_0x80b1('0x2f')](_0x58eb04()));}}return _0x346e30;})['all']();})[_0x80b1('0x2f')](function(_0x4b9ab7){logger[_0x80b1('0x15')](_0x80b1('0x5c'),'generalCheckHopper',_0x4b9ab7[_0x80b1('0x1c')]);});}var processPromises=function(_0x257ec2){return BPromise[_0x80b1('0x57')](promises)[_0x80b1('0x2d')](function(_0x4abfe9){})['catch'](function(_0x29d8cf){logger[_0x80b1('0x15')](_0x80b1('0x5d'),JSON[_0x80b1('0x30')](_0x29d8cf));})['finally'](function(){socket[_0x80b1('0x5e')](_0x80b1('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x257ec2){return _0x257ec2[_0x80b1('0x60')]();}});};var endCsv=function(){return BPromise[_0x80b1('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x80b1('0x5e')](_0x80b1('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x80b1('0x62')](FILEPATH);}catch(_0x1961bd){logger[_0x80b1('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x80b1('0x30')](_0x1961bd));}finally{process[_0x80b1('0x63')](0x0);}});};process['on'](_0x80b1('0x64'),function(){logger[_0x80b1('0x65')](_0x80b1('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0x80b1('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x80b1('0x12')](',');return db[_0x80b1('0x2a')][_0x80b1('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x80b1('0x2d')](function(_0x546b95){var _0x59af65=fs[_0x80b1('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x80b1('0x68')](_0x59af65,{'header':!![],'skipEmptyLines':!![],'step':function(_0x480d61,_0x44a268){total+=0x1;var _0x249cc7=total;promises['push'](checkRow(_0x480d61,_0x546b95,_0x249cc7)['then'](function(){success+=0x1;})['catch'](function(_0x3d416f){if(_0x3d416f[_0x80b1('0x15')]){errors+=0x1;delete _0x3d416f['error'];}else if(_0x3d416f['duplicate']){duplicates+=0x1;delete _0x3d416f[_0x80b1('0x69')];}rows[_0x80b1('0x52')](_0x3d416f);}));if(total%0xc8===0x0){_0x44a268[_0x80b1('0x6a')]();return processPromises(_0x44a268);}},'complete':function(){return processPromises()['then'](function(){logger[_0x80b1('0x65')](_0x80b1('0x6b'));endCsv();});},'error':function(_0x4ca125,_0x134ad7){logger[_0x80b1('0x65')](_0x80b1('0x6c'),JSON[_0x80b1('0x30')](_0x4ca125));endCsv();}});})[_0x80b1('0x2f')](function(_0x15ecbe){logger[_0x80b1('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x80b1('0x30')](_0x15ecbe));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 8a03b9b..5bdaabf 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 _0x334c=['message','sequelize','query','spread','main','stringify','send','start','socket_timestamp','.csv','writeFileSync','parse','createReadStream','data','length','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','affectedRows','contact:import:','unlink','catch','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId','cm_hopper_black','ListId','fields','field','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code'];(function(_0xf21a7f,_0x104756){var _0x3b4f6a=function(_0x19bff7){while(--_0x19bff7){_0xf21a7f['push'](_0xf21a7f['shift']());}};_0x3b4f6a(++_0x104756);}(_0x334c,0x148));var _0xc334=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x334c[_0x313df3];return _0x241d59;};'use strict';var fs=require('fs');var path=require(_0xc334('0x0'));var _=require(_0xc334('0x1'));var Papa=require(_0xc334('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xc334('0x3'));var squel=require(_0xc334('0x4'));var Redis=require(_0xc334('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xc334('0x6'));var logger=require('../../../config/logger')('import');config['redis']=_[_0xc334('0x7')](config[_0xc334('0x8')],{'host':_0xc334('0x9'),'port':0x18eb});var socket=require(_0xc334('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc334('0xb')](_0xc334('0xc'));function isEmail(_0x33fc60){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))*$/[_0xc334('0xd')](_0x33fc60);}function selectNotIn(_0x1ec277,_0x3eb343,_0x55ef59,_0x1d3fec,_0x3144d2){return squel[_0xc334('0xe')]()['field'](_0xc334('0xf'))['from'](_0x1d3fec)[_0xc334('0x10')](_0x3eb343,null,_0x3eb343+_0xc334('0x11')+_0x1d3fec+'.'+_0x55ef59)[_0xc334('0x12')](_0x1d3fec+'.'+_0x55ef59+_0xc334('0x13')+_0x1ec277+'.'+_0x55ef59)[_0xc334('0x12')](_0x3eb343+_0xc334('0x14')+_0x3144d2[_0xc334('0x10')]()+')');}function insertCmHopper(_0x516e39,_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc0c418){var _0x53c6ed=['cm_contacts.phone',_0xc334('0x15'),_0xc334('0x16'),'cm_contacts.ListId',_0x4ceae1+'.'+_0x5e7f98,_0xc334('0x17'),_0xc334('0x18'),_0xc334('0x19'),_0xc334('0x1a'),'\x22'+_0xc0c418+'\x22'];return squel[_0xc334('0x1b')]()[_0xc334('0x1c')](_0xc334('0x1d'))[_0xc334('0x1e')]([_0xc334('0xf'),_0xc334('0x1f'),_0xc334('0x20'),'ListId',_0x5e7f98,_0xc334('0x21'),_0xc334('0x22'),_0xc334('0x23'),_0xc334('0x24'),'recallme'],squel[_0xc334('0xe')]()['fields'](_0x53c6ed)[_0xc334('0x25')](_0x4ceae1)[_0xc334('0x10')](_0xc334('0x26'),null,_0xc334('0x27')+_0x4ceae1+_0xc334('0x28'))['join'](_0x3d0cb6,null,_0x3d0cb6+'.id\x20=\x20'+_0x4ceae1+'.'+_0x5e7f98)[_0xc334('0x12')](_0x4ceae1+_0xc334('0x29'),_0x516e39)[_0xc334('0x12')](_0xc334('0x2a'),NOW)[_0xc334('0x12')](_0xc334('0x2b'),selectNotIn(_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc334('0x1d'),[_0xc334('0x2c'),'\x22onlyIfOpen\x22']))[_0xc334('0x12')](_0xc334('0x2b'),selectNotIn(_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc334('0x1d'),[_0xc334('0x2c')])))['toString']();}function insertCmHopperBlack(_0x128ef0,_0x44bde9,_0x5d0046,_0xa6ea46){var _0x398eca=['cm_contacts.phone',_0xc334('0x16'),_0xc334('0x2d'),_0x44bde9+'.'+_0xa6ea46,_0xc334('0x17'),'cm_contacts.updatedAt'];return squel['insert']()[_0xc334('0x1c')](_0xc334('0x2e'))[_0xc334('0x1e')]([_0xc334('0xf'),_0xc334('0x20'),_0xc334('0x2f'),_0xa6ea46,_0xc334('0x21'),_0xc334('0x22')],squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x398eca)[_0xc334('0x25')](_0x44bde9)[_0xc334('0x10')](_0xc334('0x26'),null,_0xc334('0x27')+_0x44bde9+_0xc334('0x28'))[_0xc334('0x10')](_0x5d0046,null,_0x5d0046+_0xc334('0x11')+_0x44bde9+'.'+_0xa6ea46)[_0xc334('0x12')](_0x44bde9+_0xc334('0x29'),_0x128ef0)[_0xc334('0x12')](_0xc334('0x2a'),NOW)[_0xc334('0x12')](_0xc334('0x2b'),squel[_0xc334('0xe')]()[_0xc334('0x31')](_0xc334('0xf'))[_0xc334('0x25')](_0xc334('0x2e'))['where'](_0xc334('0x32'),_0x128ef0)[_0xc334('0x12')](_0xa6ea46+_0xc334('0x33'),_0x44bde9+'.'+_0xa6ea46)))[_0xc334('0x34')]();}function insertCmContact(_0x2a70af,_0x4ad9fc,_0x9540ab,_0x54510c){var _0x313af0=_[_0xc334('0x35')](_[_0xc334('0x36')](_0x54510c),[_0xc334('0x2f'),_0xc334('0x37'),_0xc334('0x21'),_0xc334('0x22')]);return squel['insert']()[_0xc334('0x1c')]('cm_contacts')[_0xc334('0x1e')](_0x313af0,squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x313af0)[_0xc334('0x25')](_0x4ad9fc)[_0xc334('0x12')]('('+_0x9540ab['join'](',')+_0xc334('0x38'),squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x9540ab)['from'](_0xc334('0x26'))[_0xc334('0x12')](_0xc334('0x32'),_0x2a70af))['where'](_0xc334('0x39'),squel[_0xc334('0xe')]()[_0xc334('0x31')](_0xc334('0x3a'),_0xc334('0x3b'))[_0xc334('0x25')](_0x4ad9fc)[_0xc334('0x3c')](_0x9540ab['join'](','))))[_0xc334('0x34')]();}function handleStop(){logger[_0xc334('0x3d')](_0xc334('0x3e'));stopped=!![];}function handleUncaughtException(_0x5cb59c){logger[_0xc334('0x3f')](_0x5cb59c['message']);process[_0xc334('0x40')](0x1);}function handleError(_0x141aa2,_0x3ae5f3){stats[_0xc334('0x41')][_0xc334('0x42')]({'name':_0x3ae5f3[_0xc334('0x43')],'message':_0x3ae5f3[_0xc334('0x44')],'row':_0x141aa2});}function handleQuery(_0x30d344){logger[_0xc334('0x3d')](_0x30d344);return db[_0xc334('0x45')][_0xc334('0x46')](_0x30d344)[_0xc334('0x47')](function(_0x4779be){results[_0xc334('0x42')](_0x4779be);})['catch'](function(_0x103a0f){logger['error'](_0x103a0f[_0xc334('0x44')]);});}function main(_0x14d816,_0x251c12,_0x3cd932,_0x44a8d2){logger[_0xc334('0x3d')](_0xc334('0x48'),_0x14d816,JSON[_0xc334('0x49')](_0x251c12));process[_0xc334('0x4a')](_0xc334('0x4b'));var _0xc3db43=_0x251c12['binding'];var _0x57f30a=_0x251c12[_0xc334('0x4c')];var _0xb647ee=path[_0xc334('0x10')](config['root'],'server/files/tmp',_0x57f30a+_0xc334('0x4d'));var _0x356320=_[_0xc334('0x36')](_0xc3db43)[_0xc334('0x10')]();logger[_0xc334('0x3d')]('header',_0x356320);fs[_0xc334('0x4e')](_0xb647ee,_0x356320+'\x0a');Papa[_0xc334('0x4f')](fs[_0xc334('0x50')](_0x14d816),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd5edb7,_0x532181){try{for(var _0xd30c91=0x0,_0xa59cad=[];_0xd30c91<_0xd5edb7[_0xc334('0x51')][_0xc334('0x52')];_0xd30c91++){stats['rows']+=0x1;if(_0xd5edb7[_0xc334('0x41')][_0xd30c91]){handleError(_0xd5edb7[_0xc334('0x51')][_0xd30c91],_0xd5edb7[_0xc334('0x41')][_0xd30c91]);}else{var _0x1646d1=[];for(var _0x574ed6 in _0xc3db43){if(_0xc3db43['hasOwnProperty'](_0x574ed6)){if(_0xd5edb7['data'][_0xd30c91][_0xc3db43[_0x574ed6]]){var _0x4e247c=_[_0xc334('0x53')](_0xd5edb7[_0xc334('0x51')][_0xd30c91][_0xc3db43[_0x574ed6]]['replace'](/"/g,'\x27'));switch(_0x574ed6){case _0xc334('0x1f'):var _0xe5379=moment(_0x4e247c,_0xc334('0xc'),!![]);if(_0xe5379['isValid']()){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x54'));}break;case'priority':var _0xcab0ac=parseInt(_0x4e247c);_0x4e247c=_[_0xc334('0x55')](_0xcab0ac)||_0xcab0ac<0x0||_0xcab0ac>0x4?_0x44a8d2?0x3:0x2:_0xcab0ac;_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');break;case'UserId':var _0x16e2af=parseInt(_0x4e247c);if(_[_0xc334('0x56')](_0x16e2af)&&_['includes'](_0x3cd932,_0x16e2af)){_0xa59cad['push']('\x22'+_0x16e2af+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x57'));}break;case _0xc334('0x58'):if(isEmail(_0x4e247c)){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x59'));}break;case _0xc334('0x5a'):var _0x5e64dd=moment(_0x4e247c,'YYYY-MM-DD',!![]);if(_0x5e64dd['isValid']()){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xa59cad['push']('\x22'+_0x4e247c+'\x22');}}else{switch(_0x574ed6){case _0xc334('0x5b'):case'phone':_0x1646d1[_0xc334('0x42')](_0x574ed6+_0xc334('0x5c'));break;default:_0xa59cad['push']('\x22\x22');}}}}if(_0x1646d1[_0xc334('0x52')]){handleError(_0xd5edb7[_0xc334('0x51')][_0xd30c91],{'code':_0xc334('0x5d'),'message':_0x1646d1[_0xc334('0x10')]()});}else{fs[_0xc334('0x5e')](_0xb647ee,_0xa59cad[_0xc334('0x10')]()+'\x0a');}_0xa59cad=[];}if(!(stats[_0xc334('0x5f')]%0xc8)){socket[_0xc334('0x60')]('contact:import:'+_0x57f30a,stats);stats[_0xc334('0x41')]=[];}}if(stopped){logger[_0xc334('0x3d')]('Abort\x20parser');_0x532181[_0xc334('0x61')]();}}catch(_0x128972){handleError(_0xd5edb7['data'][_0xd30c91],{'code':_0xc334('0x62'),'message':_0x128972[_0xc334('0x44')]});logger[_0xc334('0x3f')](_0xc334('0x63'),_0x128972[_0xc334('0x44')]);}},'complete':function(){try{var _0x5374c8=[];var _0x3ebb86=_0xc334('0x26');if(_0x251c12[_0xc334('0x64')]&&_0x251c12[_0xc334('0x64')][_0xc334('0x52')]){_0x3ebb86=_0xc334('0x65')+_0x57f30a;_0x5374c8[_0xc334('0x42')](_0xc334('0x66')+_0x3ebb86+_0xc334('0x67'));}var _0x26c119=util[_0xc334('0xb')](_0xc334('0x68'),_0xb647ee,_0x3ebb86,_0x356320,_0x251c12[_0xc334('0x2f')],_0x251c12[_0xc334('0x37')]||null,NOW,NOW);if(_[_0xc334('0x69')](_0xc3db43[_0xc334('0x1f')])){_0x26c119+=_0xc334('0x6a');}_0x5374c8[_0xc334('0x42')](_0x26c119);if(_0x251c12['duplicates']&&_0x251c12[_0xc334('0x64')]['length']){_0x5374c8['push'](insertCmContact(_0x251c12[_0xc334('0x2f')],_0x3ebb86,_0x251c12[_0xc334('0x64')],_0xc3db43));_0x5374c8['push']('DROP\x20TABLE\x20'+_0x3ebb86+';');}_0x5374c8[_0xc334('0x42')](insertCmHopper(_0x251c12[_0xc334('0x2f')],_0xc334('0x6b'),_0xc334('0x6c'),_0xc334('0x6d'),_0x44a8d2));_0x5374c8[_0xc334('0x42')](insertCmHopperBlack(_0x251c12['ListId'],_0xc334('0x6e'),_0xc334('0x6c'),_0xc334('0x6d')));_0x5374c8[_0xc334('0x42')](insertCmHopper(_0x251c12[_0xc334('0x2f')],'campaigns_has_cm_lists',_0xc334('0x6f'),'CampaignId',_0x44a8d2));_0x5374c8[_0xc334('0x42')](insertCmHopperBlack(_0x251c12[_0xc334('0x2f')],_0xc334('0x70'),'campaigns',_0xc334('0x71')));BPromise['each'](_0x5374c8,handleQuery)['then'](function(_0x2adaac){stats['finish']=!![];stats[_0xc334('0x72')]=_0x251c12[_0xc334('0x64')]&&_0x251c12['duplicates']['length']?results[0x2][_0xc334('0x72')]:results[0x0]['affectedRows'];socket['emit'](_0xc334('0x73')+_0x57f30a,stats);fs[_0xc334('0x74')](_0x14d816);fs[_0xc334('0x74')](_0xb647ee);process[_0xc334('0x40')](0x0);})[_0xc334('0x75')](function(_0x5586d3){logger[_0xc334('0x3f')](_0x5586d3[_0xc334('0x44')]);process['exit'](0x1);});}catch(_0x3a4e1e){logger[_0xc334('0x3f')](_0xc334('0x76'),_0x3a4e1e[_0xc334('0x44')]);process[_0xc334('0x40')](0x1);}},'error':function(_0x59478e,_0x2906f3,_0x183abc,_0x53bfd2){throw new Error(_0x53bfd2);}});}function validate(){if(process[_0xc334('0x77')]&&process[_0xc334('0x77')]['length']<0x4){throw new Error(_0xc334('0x78'));}var _0x54e4ec=path[_0xc334('0x10')](config[_0xc334('0x79')],_0xc334('0x7a'),process[_0xc334('0x77')][0x2]);if(!fs[_0xc334('0x7b')](_0x54e4ec)){throw new Error(_0xc334('0x7c'));}var _0x5e49bc={};try{_0x5e49bc=JSON[_0xc334('0x4f')](process['argv'][0x3]);if(!_0x5e49bc['binding']){throw new Error(_0xc334('0x7d'));}if(!_0x5e49bc[_0xc334('0x7e')][_0xc334('0xf')]){throw new Error(_0xc334('0x7f'));}if(!_0x5e49bc[_0xc334('0x7e')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x4554c0=0x0;if(_0x5e49bc['binding'][_0xc334('0x24')]){_0x4554c0=0x1;}if(!_0x5e49bc[_0xc334('0x2f')]){throw new Error(_0xc334('0x80'));}}catch(_0x4e1c58){throw new Error('body\x20id\x20mandatory');}var _0x565455=[];try{_0x565455=_[_0xc334('0x81')](JSON[_0xc334('0x4f')](process[_0xc334('0x77')][0x4]),'id');}catch(_0x458e30){logger['info']('No\x20agent\x20available');}main(_0x54e4ec,_0x5e49bc,_0x565455,_0x4554c0);}validate();process['on'](_0xc334('0x82'),handleStop);process['on'](_0xc334('0x83'),handleUncaughtException); \ No newline at end of file +var _0x9c1b=['.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper_black','fromQuery','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','sequelize','query','spread','push','catch','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','errors','hasOwnProperty','trim','data','replace','scheduledat','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','ListId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','field','from','.id\x20=\x20','where','\x20=\x20'];(function(_0x5a77f1,_0x471a86){var _0x502b48=function(_0x4c77ee){while(--_0x4c77ee){_0x5a77f1['push'](_0x5a77f1['shift']());}};_0x502b48(++_0x471a86);}(_0x9c1b,0xff));var _0xb9c1=function(_0x3ba79c,_0x1547d2){_0x3ba79c=_0x3ba79c-0x0;var _0xd2d1a4=_0x9c1b[_0x3ba79c];return _0xd2d1a4;};'use strict';var fs=require('fs');var path=require(_0xb9c1('0x0'));var _=require(_0xb9c1('0x1'));var Papa=require('papaparse');var util=require(_0xb9c1('0x2'));var BPromise=require(_0xb9c1('0x3'));var moment=require(_0xb9c1('0x4'));var squel=require('squel');var Redis=require(_0xb9c1('0x5'));var db=require(_0xb9c1('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xb9c1('0x7'))(_0xb9c1('0x8'));config['redis']=_[_0xb9c1('0x9')](config[_0xb9c1('0xa')],{'host':_0xb9c1('0xb'),'port':0x18eb});var socket=require(_0xb9c1('0xc'))(new Redis(config[_0xb9c1('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xb9c1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xc16e94){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0xc16e94);}function selectNotIn(_0x303582,_0x3dbc8c,_0x39af61,_0x1bfde0,_0x15f893){return squel['select']()[_0xb9c1('0xe')]('phone')[_0xb9c1('0xf')](_0x1bfde0)['join'](_0x3dbc8c,null,_0x3dbc8c+_0xb9c1('0x10')+_0x1bfde0+'.'+_0x39af61)[_0xb9c1('0x11')](_0x1bfde0+'.'+_0x39af61+_0xb9c1('0x12')+_0x303582+'.'+_0x39af61)[_0xb9c1('0x11')](_0x3dbc8c+_0xb9c1('0x13')+_0x15f893[_0xb9c1('0x14')]()+')');}function insertCmHopper(_0xd39ff2,_0x20d4ac,_0xea2994,_0x25386e,_0x3d37a6){var _0x2e166e=[_0xb9c1('0x15'),_0xb9c1('0x16'),'cm_contacts.id',_0xb9c1('0x17'),_0x20d4ac+'.'+_0x25386e,'cm_contacts.createdAt',_0xb9c1('0x18'),_0xb9c1('0x19'),_0xb9c1('0x1a'),'\x22'+_0x3d37a6+'\x22'];return squel[_0xb9c1('0x1b')]()['into'](_0xb9c1('0x1c'))['fromQuery']([_0xb9c1('0x1d'),'scheduledat',_0xb9c1('0x1e'),'ListId',_0x25386e,_0xb9c1('0x1f'),_0xb9c1('0x20'),_0xb9c1('0x21'),_0xb9c1('0x22'),'recallme'],squel[_0xb9c1('0x23')]()[_0xb9c1('0x24')](_0x2e166e)[_0xb9c1('0xf')](_0x20d4ac)[_0xb9c1('0x14')](_0xb9c1('0x25'),null,_0xb9c1('0x26')+_0x20d4ac+_0xb9c1('0x27'))['join'](_0xea2994,null,_0xea2994+_0xb9c1('0x10')+_0x20d4ac+'.'+_0x25386e)['where'](_0x20d4ac+'.CmListId\x20=\x20?',_0xd39ff2)[_0xb9c1('0x11')](_0xb9c1('0x28'),NOW)[_0xb9c1('0x11')](_0xb9c1('0x29'),selectNotIn(_0x20d4ac,_0xea2994,_0x25386e,_0xb9c1('0x1c'),['\x22always\x22',_0xb9c1('0x2a')]))['where'](_0xb9c1('0x29'),selectNotIn(_0x20d4ac,_0xea2994,_0x25386e,_0xb9c1('0x1c'),[_0xb9c1('0x2b')])))[_0xb9c1('0x2c')]();}function insertCmHopperBlack(_0xc86e3b,_0x520c08,_0x26afb6,_0x48f21d){var _0x13f8e7=[_0xb9c1('0x15'),_0xb9c1('0x2d'),_0xb9c1('0x17'),_0x520c08+'.'+_0x48f21d,_0xb9c1('0x2e'),_0xb9c1('0x18')];return squel['insert']()[_0xb9c1('0x2f')](_0xb9c1('0x30'))[_0xb9c1('0x31')](['phone',_0xb9c1('0x1e'),'ListId',_0x48f21d,'createdAt','updatedAt'],squel[_0xb9c1('0x23')]()['fields'](_0x13f8e7)[_0xb9c1('0xf')](_0x520c08)[_0xb9c1('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x520c08+'.CmListId')[_0xb9c1('0x14')](_0x26afb6,null,_0x26afb6+'.id\x20=\x20'+_0x520c08+'.'+_0x48f21d)[_0xb9c1('0x11')](_0x520c08+_0xb9c1('0x32'),_0xc86e3b)[_0xb9c1('0x11')](_0xb9c1('0x28'),NOW)[_0xb9c1('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb9c1('0x23')]()[_0xb9c1('0xe')](_0xb9c1('0x1d'))['from'](_0xb9c1('0x30'))[_0xb9c1('0x11')](_0xb9c1('0x33'),_0xc86e3b)[_0xb9c1('0x11')](_0x48f21d+_0xb9c1('0x34'),_0x520c08+'.'+_0x48f21d)))[_0xb9c1('0x2c')]();}function insertCmContact(_0x42006c,_0x448f77,_0x263408,_0x1e347f){var _0x557590=_[_0xb9c1('0x35')](_[_0xb9c1('0x36')](_0x1e347f),['ListId',_0xb9c1('0x37'),_0xb9c1('0x1f'),_0xb9c1('0x20')]);return squel[_0xb9c1('0x1b')]()[_0xb9c1('0x2f')](_0xb9c1('0x25'))[_0xb9c1('0x31')](_0x557590,squel[_0xb9c1('0x23')]()['fields'](_0x557590)['from'](_0x448f77)['where']('('+_0x263408[_0xb9c1('0x14')](',')+')\x20NOT\x20IN\x20?',squel[_0xb9c1('0x23')]()['fields'](_0x263408)[_0xb9c1('0xf')](_0xb9c1('0x25'))[_0xb9c1('0x11')](_0xb9c1('0x33'),_0x42006c))[_0xb9c1('0x11')]('id\x20IN\x20?',squel[_0xb9c1('0x23')]()[_0xb9c1('0xe')](_0xb9c1('0x38'),_0xb9c1('0x39'))['from'](_0x448f77)['group'](_0x263408[_0xb9c1('0x14')](','))))[_0xb9c1('0x2c')]();}function handleStop(){logger[_0xb9c1('0x3a')](_0xb9c1('0x3b'));stopped=!![];}function handleUncaughtException(_0x3de0ad){logger[_0xb9c1('0x3c')](_0x3de0ad[_0xb9c1('0x3d')]);process[_0xb9c1('0x3e')](0x1);}function handleError(_0x4baf40,_0x12a1cd){stats['errors']['push']({'name':_0x12a1cd['code'],'message':_0x12a1cd[_0xb9c1('0x3d')],'row':_0x4baf40});}function handleQuery(_0xaab34f){logger[_0xb9c1('0x3a')](_0xaab34f);return db[_0xb9c1('0x3f')][_0xb9c1('0x40')](_0xaab34f)[_0xb9c1('0x41')](function(_0x306311){results[_0xb9c1('0x42')](_0x306311);})[_0xb9c1('0x43')](function(_0x4769b0){logger[_0xb9c1('0x3c')](_0x4769b0[_0xb9c1('0x3d')]);});}function main(_0x34ae00,_0x2ec54a,_0x55cccf,_0x4934bc){logger[_0xb9c1('0x3a')](_0xb9c1('0x44'),_0x34ae00,JSON[_0xb9c1('0x45')](_0x2ec54a));process['send'](_0xb9c1('0x46'));var _0x460c0a=_0x2ec54a[_0xb9c1('0x47')];var _0xc1a98f=_0x2ec54a[_0xb9c1('0x48')];var _0x354a83=path[_0xb9c1('0x14')](config[_0xb9c1('0x49')],_0xb9c1('0x4a'),_0xc1a98f+_0xb9c1('0x4b'));var _0x31b381=_[_0xb9c1('0x36')](_0x460c0a)[_0xb9c1('0x14')]();logger['info'](_0xb9c1('0x4c'),_0x31b381);fs[_0xb9c1('0x4d')](_0x354a83,_0x31b381+'\x0a');Papa['parse'](fs[_0xb9c1('0x4e')](_0x34ae00),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e96c9,_0x14c6d0){try{for(var _0xe32269=0x0,_0x28ac27=[];_0xe32269<_0x3e96c9['data'][_0xb9c1('0x4f')];_0xe32269++){stats[_0xb9c1('0x50')]+=0x1;if(_0x3e96c9[_0xb9c1('0x51')][_0xe32269]){handleError(_0x3e96c9['data'][_0xe32269],_0x3e96c9[_0xb9c1('0x51')][_0xe32269]);}else{var _0x262cce=[];for(var _0x2013a8 in _0x460c0a){if(_0x460c0a[_0xb9c1('0x52')](_0x2013a8)){if(_0x3e96c9['data'][_0xe32269][_0x460c0a[_0x2013a8]]){var _0x5bf45a=_[_0xb9c1('0x53')](_0x3e96c9[_0xb9c1('0x54')][_0xe32269][_0x460c0a[_0x2013a8]][_0xb9c1('0x55')](/"/g,'\x27'));switch(_0x2013a8){case _0xb9c1('0x56'):var _0x34d3cf=moment(_0x5bf45a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x34d3cf[_0xb9c1('0x57')]()){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb9c1('0x21'):var _0x5be616=parseInt(_0x5bf45a);_0x5bf45a=_[_0xb9c1('0x58')](_0x5be616)||_0x5be616<0x0||_0x5be616>0x4?_0x4934bc?0x3:0x2:_0x5be616;_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');break;case _0xb9c1('0x22'):var _0x4fc155=parseInt(_0x5bf45a);if(_[_0xb9c1('0x59')](_0x4fc155)&&_[_0xb9c1('0x5a')](_0x55cccf,_0x4fc155)){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x4fc155+'\x22');}else{_0x262cce['push'](_0xb9c1('0x5b'));}break;case'email':if(isEmail(_0x5bf45a)){_0x28ac27['push']('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')](_0xb9c1('0x5c'));}break;case _0xb9c1('0x5d'):var _0x567ab2=moment(_0x5bf45a,_0xb9c1('0x5e'),!![]);if(_0x567ab2['isValid']()){_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}else{_0x262cce[_0xb9c1('0x42')](_0xb9c1('0x5f'));}break;default:_0x28ac27[_0xb9c1('0x42')]('\x22'+_0x5bf45a+'\x22');}}else{switch(_0x2013a8){case _0xb9c1('0x60'):case _0xb9c1('0x1d'):_0x262cce[_0xb9c1('0x42')](_0x2013a8+_0xb9c1('0x61'));break;default:_0x28ac27[_0xb9c1('0x42')]('\x22\x22');}}}}if(_0x262cce[_0xb9c1('0x4f')]){handleError(_0x3e96c9[_0xb9c1('0x54')][_0xe32269],{'code':_0xb9c1('0x62'),'message':_0x262cce[_0xb9c1('0x14')]()});}else{fs[_0xb9c1('0x63')](_0x354a83,_0x28ac27['join']()+'\x0a');}_0x28ac27=[];}if(!(stats[_0xb9c1('0x50')]%0xc8)){socket['emit'](_0xb9c1('0x64')+_0xc1a98f,stats);stats[_0xb9c1('0x51')]=[];}}if(stopped){logger[_0xb9c1('0x3a')](_0xb9c1('0x65'));_0x14c6d0[_0xb9c1('0x66')]();}}catch(_0x31accc){handleError(_0x3e96c9[_0xb9c1('0x54')][_0xe32269],{'code':_0xb9c1('0x67'),'message':_0x31accc[_0xb9c1('0x3d')]});logger[_0xb9c1('0x3c')](_0xb9c1('0x68'),_0x31accc['message']);}},'complete':function(){try{var _0x4af73e=[];var _0x18c5b6=_0xb9c1('0x25');if(_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')]['length']){_0x18c5b6=_0xb9c1('0x6a')+_0xc1a98f;_0x4af73e[_0xb9c1('0x42')](_0xb9c1('0x6b')+_0x18c5b6+_0xb9c1('0x6c'));}var _0x21b3fa=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',_0x354a83,_0x18c5b6,_0x31b381,_0x2ec54a[_0xb9c1('0x6d')],_0x2ec54a[_0xb9c1('0x37')]||null,NOW,NOW);if(_[_0xb9c1('0x6e')](_0x460c0a[_0xb9c1('0x56')])){_0x21b3fa+=_0xb9c1('0x6f');}_0x4af73e[_0xb9c1('0x42')](_0x21b3fa);if(_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')][_0xb9c1('0x4f')]){_0x4af73e[_0xb9c1('0x42')](insertCmContact(_0x2ec54a['ListId'],_0x18c5b6,_0x2ec54a['duplicates'],_0x460c0a));_0x4af73e[_0xb9c1('0x42')](_0xb9c1('0x70')+_0x18c5b6+';');}_0x4af73e[_0xb9c1('0x42')](insertCmHopper(_0x2ec54a[_0xb9c1('0x6d')],'voice_queues_has_cm_lists',_0xb9c1('0x71'),'VoiceQueueId',_0x4934bc));_0x4af73e[_0xb9c1('0x42')](insertCmHopperBlack(_0x2ec54a['ListId'],_0xb9c1('0x72'),_0xb9c1('0x71'),'VoiceQueueId'));_0x4af73e[_0xb9c1('0x42')](insertCmHopper(_0x2ec54a[_0xb9c1('0x6d')],_0xb9c1('0x73'),_0xb9c1('0x74'),_0xb9c1('0x75'),_0x4934bc));_0x4af73e[_0xb9c1('0x42')](insertCmHopperBlack(_0x2ec54a['ListId'],'campaigns_has_cm_blacklists',_0xb9c1('0x74'),_0xb9c1('0x75')));BPromise[_0xb9c1('0x76')](_0x4af73e,handleQuery)[_0xb9c1('0x77')](function(_0x56bc5c){stats[_0xb9c1('0x78')]=!![];stats[_0xb9c1('0x79')]=_0x2ec54a[_0xb9c1('0x69')]&&_0x2ec54a[_0xb9c1('0x69')][_0xb9c1('0x4f')]?results[0x2][_0xb9c1('0x79')]:results[0x0][_0xb9c1('0x79')];socket[_0xb9c1('0x7a')]('contact:import:'+_0xc1a98f,stats);fs[_0xb9c1('0x7b')](_0x34ae00);fs['unlink'](_0x354a83);process[_0xb9c1('0x3e')](0x0);})['catch'](function(_0x521edf){logger[_0xb9c1('0x3c')](_0x521edf['message']);process[_0xb9c1('0x3e')](0x1);});}catch(_0x3e7b67){logger['error']('complete',_0x3e7b67[_0xb9c1('0x3d')]);process[_0xb9c1('0x3e')](0x1);}},'error':function(_0x5cc18d,_0x435134,_0x240486,_0x577599){throw new Error(_0x577599);}});}function validate(){if(process[_0xb9c1('0x7c')]&&process['argv'][_0xb9c1('0x4f')]<0x4){throw new Error(_0xb9c1('0x7d'));}var _0x3acc44=path[_0xb9c1('0x14')](config[_0xb9c1('0x49')],_0xb9c1('0x4a'),process[_0xb9c1('0x7c')][0x2]);if(!fs[_0xb9c1('0x7e')](_0x3acc44)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x57ea70={};try{_0x57ea70=JSON[_0xb9c1('0x7f')](process[_0xb9c1('0x7c')][0x3]);if(!_0x57ea70[_0xb9c1('0x47')]){throw new Error(_0xb9c1('0x80'));}if(!_0x57ea70[_0xb9c1('0x47')]['phone']){throw new Error(_0xb9c1('0x81'));}if(!_0x57ea70[_0xb9c1('0x47')][_0xb9c1('0x60')]){throw new Error(_0xb9c1('0x82'));}var _0x52cdd9=0x0;if(_0x57ea70[_0xb9c1('0x47')][_0xb9c1('0x22')]){_0x52cdd9=0x1;}if(!_0x57ea70['ListId']){throw new Error(_0xb9c1('0x83'));}}catch(_0x26ca8b){throw new Error(_0xb9c1('0x84'));}var _0x16cdf7=[];try{_0x16cdf7=_[_0xb9c1('0x85')](JSON[_0xb9c1('0x7f')](process[_0xb9c1('0x7c')][0x4]),'id');}catch(_0x27b71b){logger[_0xb9c1('0x3a')](_0xb9c1('0x86'));}main(_0x3acc44,_0x57ea70,_0x16cdf7,_0x52cdd9);}validate();process['on'](_0xb9c1('0x87'),handleStop);process['on'](_0xb9c1('0x88'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 3045a5a..ae343fc 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 _0xadb5=['uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','calleridname','Queue','UniqueId'];(function(_0x2c7623,_0x33f839){var _0x244dbf=function(_0x302a6a){while(--_0x302a6a){_0x2c7623['push'](_0x2c7623['shift']());}};_0x244dbf(++_0x33f839);}(_0xadb5,0xad));var _0x5adb=function(_0x551d99,_0xc035a7){_0x551d99=_0x551d99-0x0;var _0x17ffaf=_0xadb5[_0x551d99];return _0x17ffaf;};'use strict';exports['getSubjects']=function(_0x2e4c9a,_0x49fc17){var _0x3d6340=[{'type':_0x5adb('0x0'),'content':_0x5adb('0x1'),'variableName':null}];switch(_0x2e4c9a['toLowerCase']()){case _0x5adb('0x2'):switch(_0x49fc17[_0x5adb('0x3')]()){case _0x5adb('0x4'):_0x3d6340['push']({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x6')});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x8')});break;case _0x5adb('0x9'):_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x0'),'content':_0x5adb('0xa'),'variableName':null});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0xb')});break;}}return _0x3d6340;};exports[_0x5adb('0xc')]=function(_0x275428,_0x563d86){var _0x4c268d=[];switch(_0x275428[_0x5adb('0x3')]()){case _0x5adb('0x2'):switch(_0x563d86[_0x5adb('0x3')]()){case'inbound':_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x8')},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xe')},{'type':_0x5adb('0xd'),'content':'','key':'Call\x20To','keyType':_0x5adb('0x5'),'variableName':'destexten'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0xf'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x6')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':'Date','keyType':_0x5adb('0x5'),'variableName':'agentcalledAt'},{'type':_0x5adb('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x5adb('0x12')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x13'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xb')},{'type':'string','content':_0x5adb('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x15')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x16'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x17')},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x18')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x19'),'keyType':_0x5adb('0x5'),'variableName':'holdtime'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1a'),'keyType':'variable','variableName':_0x5adb('0x1b')}];break;case _0x5adb('0x9'):_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1c'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0xb')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1d'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x5adb('0x1f')},{'type':_0x5adb('0x0'),'content':_0x5adb('0x14')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x20'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x21')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x22'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x5adb('0xd'),'content':'','key':'Duration','keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x23')},{'type':'keyValue','content':'','key':_0x5adb('0x24'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x25')}];break;}}return _0x4c268d;}; \ No newline at end of file +var _0xb10b=['Complete\x20Time','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Answer\x20Time'];(function(_0x4845ca,_0x33b180){var _0x1cb08e=function(_0x587415){while(--_0x587415){_0x4845ca['push'](_0x4845ca['shift']());}};_0x1cb08e(++_0x33b180);}(_0xb10b,0x12a));var _0xbb10=function(_0x14634f,_0x5ed190){_0x14634f=_0x14634f-0x0;var _0x5021f9=_0xb10b[_0x14634f];return _0x5021f9;};'use strict';exports[_0xbb10('0x0')]=function(_0x4bb7bb,_0x390ae2){var _0x35bc5f=[{'type':_0xbb10('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4bb7bb[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x390ae2[_0xbb10('0x2')]()){case _0xbb10('0x4'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'queue'});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'calleridnum'});break;case _0xbb10('0x7'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x1'),'content':_0xbb10('0x8'),'variableName':null});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':_0xbb10('0x9')});break;}}return _0x35bc5f;};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){var _0x20bd61=[];switch(_0x5ab04a[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x4e47f8['toLowerCase']()){case _0xbb10('0x4'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0xd'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xe')},{'type':_0xbb10('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xf')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x10'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x11')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x12'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x13')},{'type':'keyValue','content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x16'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x17')},{'type':_0xbb10('0x1'),'content':_0xbb10('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x19')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1a'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x9')},{'type':'string','content':_0xbb10('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xbb10('0x17')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1c'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1d')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1e'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1f')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x20'),'keyType':_0xbb10('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x21')}];break;case _0xbb10('0x7'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x22'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x9')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x23'),'keyType':'variable','keyContent':'','variableName':_0xbb10('0x24')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':'Date','keyType':_0xbb10('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0xbb10('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x25'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xbb10('0x26'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x27'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x28')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x29'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x20bd61;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a97e0b9..d4d6fe9 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 _0x5732=['../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','Interaction','findOne','then','update','info','catch','error','query','body','omit','html','phone','fax','mobile','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5732,0xfb));var _0x2573=function(_0x524e09,_0x15f77c){_0x524e09=_0x524e09-0x0;var _0x5edcf6=_0x5732[_0x524e09];return _0x5edcf6;};'use strict';var _=require(_0x2573('0x0'));var db=require(_0x2573('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x2573('0x2'))(_0x2573('0x3')),'fax':require('../../config/logger')(_0x2573('0x4')),'sms':require(_0x2573('0x2'))(_0x2573('0x5')),'chat':require(_0x2573('0x2'))(_0x2573('0x6'))};function getInteractionId(_0x2064cc,_0xcafe30,_0x10ede1){if(_0x2064cc&&_0x2064cc[_[_0x2573('0x7')](_0x10ede1)+_0x2573('0x8')]){return _0x2064cc[_['upperFirst'](_0x10ede1)+_0x2573('0x8')];}else if(_0x2064cc&&_0x2064cc['id']){return _0x2064cc['id'];}else if(_0xcafe30&&_0xcafe30['id']){return _0xcafe30['id'];}else{return _0x2573('0x9');}}function log(_0x3b9025,_0xad7385,_0x13604e,_0xe1bac,_0x4537bc,_0x40fbff){loggers[_0x4537bc[_0x2573('0xa')]()][_0x3b9025](_0x2573('0xb'),_0x40fbff['toUpperCase'](),_0xad7385?_0xad7385['id']:null,_0xad7385?_0xad7385[_0x2573('0xc')]:null,_0xad7385?_0xad7385[_0x2573('0xd')]:null,getInteractionId(_0x13604e,_0xe1bac,_0x4537bc),_0x13604e?JSON['stringify'](_0x13604e):'null');}function updateUser(_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766){db[_[_0x2573('0x7')](_0x20e0ec)+_0x2573('0xe')][_0x2573('0xf')]({'where':{'id':getInteractionId(_0x4ed55f,_0x22f7fd,_0x20e0ec)}})[_0x2573('0x10')](function(_0x5bc53b){if(_0x5bc53b){return _0x5bc53b[_0x2573('0x11')]({'UserId':_0x2c7b72?_0x2c7b72['id']:null});}})[_0x2573('0x10')](function(_0x483671){if(_0x483671){log(_0x2573('0x12'),_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766);}})[_0x2573('0x13')](function(){log(_0x2573('0x14'),_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766);});}exports['tracked']=function(_0x2f70fc,_0x3f1e5b){return function(_0x20c0f7,_0x43a554,_0x590ab6){var _0x4594f6=_0x20c0f7['user'];var _0x2c572a={};var _0x1df74d=_0x20c0f7[_0x2573('0x15')];if(_0x2c572a){_0x2c572a=_['clone'](_0x20c0f7[_0x2573('0x16')]);_0x2c572a=_[_0x2573('0x17')](_0x2c572a,[_0x2573('0x16'),_0x2573('0x18'),_0x2573('0x19'),_0x2573('0x1a'),_0x2573('0x1b')]);}updateUser(_0x4594f6,_0x2c572a,_0x1df74d,_0x2f70fc,_0x3f1e5b);_0x590ab6(null);};}; \ No newline at end of file +var _0xb1a4=['toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','Interaction','findOne','then','update','info','catch','error','user','query','clone','body','phone','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0xb1a4,0x12e));var _0x4b1a=function(_0x17aa49,_0x345e4a){_0x17aa49=_0x17aa49-0x0;var _0x4b4b9c=_0xb1a4[_0x17aa49];return _0x4b4b9c;};'use strict';var _=require(_0x4b1a('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x4b1a('0x1'))(_0x4b1a('0x2')),'mail':require(_0x4b1a('0x1'))(_0x4b1a('0x3')),'fax':require(_0x4b1a('0x1'))(_0x4b1a('0x4')),'sms':require(_0x4b1a('0x1'))(_0x4b1a('0x5')),'chat':require('../../config/logger')(_0x4b1a('0x6'))};function getInteractionId(_0x30f694,_0x2afbac,_0x5b2eca){if(_0x30f694&&_0x30f694[_[_0x4b1a('0x7')](_0x5b2eca)+_0x4b1a('0x8')]){return _0x30f694[_[_0x4b1a('0x7')](_0x5b2eca)+_0x4b1a('0x8')];}else if(_0x30f694&&_0x30f694['id']){return _0x30f694['id'];}else if(_0x2afbac&&_0x2afbac['id']){return _0x2afbac['id'];}else{return _0x4b1a('0x9');}}function log(_0x20d051,_0x832896,_0x22c0e0,_0x72f367,_0x45b2a2,_0x235c08){loggers[_0x45b2a2[_0x4b1a('0xa')]()][_0x20d051](_0x4b1a('0xb'),_0x235c08[_0x4b1a('0xc')](),_0x832896?_0x832896['id']:null,_0x832896?_0x832896[_0x4b1a('0xd')]:null,_0x832896?_0x832896['role']:null,getInteractionId(_0x22c0e0,_0x72f367,_0x45b2a2),_0x22c0e0?JSON['stringify'](_0x22c0e0):'null');}function updateUser(_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7){db[_[_0x4b1a('0x7')](_0x362e49)+_0x4b1a('0xe')][_0x4b1a('0xf')]({'where':{'id':getInteractionId(_0x369b28,_0x40869b,_0x362e49)}})[_0x4b1a('0x10')](function(_0x103bb2){if(_0x103bb2){return _0x103bb2[_0x4b1a('0x11')]({'UserId':_0x4bbf8c?_0x4bbf8c['id']:null});}})[_0x4b1a('0x10')](function(_0x42ff64){if(_0x42ff64){log(_0x4b1a('0x12'),_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7);}})[_0x4b1a('0x13')](function(){log(_0x4b1a('0x14'),_0x4bbf8c,_0x369b28,_0x40869b,_0x362e49,_0x1af9e7);});}exports['tracked']=function(_0x197acc,_0x3813f6){return function(_0x471cd9,_0x591489,_0x2f8b7c){var _0x33df46=_0x471cd9[_0x4b1a('0x15')];var _0x53ecfb={};var _0x4ae729=_0x471cd9[_0x4b1a('0x16')];if(_0x53ecfb){_0x53ecfb=_[_0x4b1a('0x17')](_0x471cd9[_0x4b1a('0x18')]);_0x53ecfb=_['omit'](_0x53ecfb,['body','html',_0x4b1a('0x19'),'fax','mobile']);}updateUser(_0x33df46,_0x53ecfb,_0x4ae729,_0x197acc,_0x3813f6);_0x2f8b7c(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0fed94e..731ba1d 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 _0x2935=['user','isUserLimit','crypto','../../mysqldb','../../config/environment','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x15c19a,_0xd4667b){var _0x3290d9=function(_0x1c533d){while(--_0x1c533d){_0x15c19a['push'](_0x15c19a['shift']());}};_0x3290d9(++_0xd4667b);}(_0x2935,0xda));var _0x5293=function(_0x43c13c,_0x4f2ad5){_0x43c13c=_0x43c13c-0x0;var _0x5ecb8e=_0x2935[_0x43c13c];return _0x5ecb8e;};'use strict';var crypto=require(_0x5293('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x5293('0x1'))['db'];var config=require(_0x5293('0x2'));function getValueFromLicense(_0x1b55e1,_0x2bc31e){if(_0x1b55e1&&_0x2bc31e){if(_0x2bc31e['data1']&&_0x2bc31e[_0x5293('0x3')]){var _0x5875fa=_0x2bc31e['data1'];var _0x556479=_0x2bc31e[_0x5293('0x3')];var _0x5ef467=_0x5875fa[_0x5293('0x4')]('-')[0x4];var _0x2ab046=_0x5875fa[_0x5293('0x4')]('-')[0x0];var _0x4a8346=crypto['createDecipher'](_0x5293('0x5'),util[_0x5293('0x6')](_0x5293('0x7'),_0x5ef467,_0x5875fa,_0x2ab046));var _0x5b1fbf=_0x4a8346[_0x5293('0x8')](_0x556479,_0x5293('0x9'),_0x5293('0xa'));_0x5b1fbf+=_0x4a8346[_0x5293('0xb')](_0x5293('0xa'));var _0x87947=JSON[_0x5293('0xc')](_0x5b1fbf);return _0x87947['hasOwnProperty'](_0x1b55e1)?_0x87947[_0x1b55e1]:null;}}return null;}function isLimit(_0xb0d1c8,_0x344afc,_0x5594bb,_0x506d01){var _0x5c5f67=_0x344afc;return compose()[_0x5293('0xd')](function(_0x5f1f5c,_0x4b8cc8,_0x55ce52){return db['License'][_0x5293('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5293('0xf')](function(_0x5b07be){var _0x29d721=getValueFromLicense(_0xb0d1c8,_0x5b07be);return _0x29d721?_0x29d721:_0x5c5f67;})['then'](function(_0x1a55db){_0x5c5f67=_0x1a55db;return _0x5594bb['count'](_0x506d01);})[_0x5293('0xf')](function(_0x521279){if(_0x521279>=_0x5c5f67){return _0x4b8cc8[_0x5293('0x10')](0x193)[_0x5293('0x11')]({'message':util[_0x5293('0x6')](_0x5293('0x12'),_0xb0d1c8)});}_0x55ce52();})[_0x5293('0x13')](function(_0x337bb1){_0x55ce52(_0x337bb1);});});}function isUserLimit(){return isLimit(_0x5293('0x14'),0x1,db[_0x5293('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x5293('0x16')}]}});}exports[_0x5293('0x17')]=isUserLimit; \ No newline at end of file +var _0x3940=['catch','User','user','isUserLimit','crypto','util','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x546647,_0x4d0c63){var _0xc9d59d=function(_0x9b5e95){while(--_0x9b5e95){_0x546647['push'](_0x546647['shift']());}};_0xc9d59d(++_0x4d0c63);}(_0x3940,0xa6));var _0x0394=function(_0x3acc1f,_0x3cda5c){_0x3acc1f=_0x3acc1f-0x0;var _0x2bf4b8=_0x3940[_0x3acc1f];return _0x2bf4b8;};'use strict';var crypto=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var compose=require('composable-middleware');var db=require(_0x0394('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x166a6f,_0x35237f){if(_0x166a6f&&_0x35237f){if(_0x35237f['data1']&&_0x35237f[_0x0394('0x3')]){var _0x5697bd=_0x35237f[_0x0394('0x4')];var _0x307f10=_0x35237f['license'];var _0x289994=_0x5697bd[_0x0394('0x5')]('-')[0x4];var _0x510b8d=_0x5697bd[_0x0394('0x5')]('-')[0x0];var _0x4f6faa=crypto[_0x0394('0x6')](_0x0394('0x7'),util[_0x0394('0x8')](_0x0394('0x9'),_0x289994,_0x5697bd,_0x510b8d));var _0xf00b49=_0x4f6faa[_0x0394('0xa')](_0x307f10,_0x0394('0xb'),_0x0394('0xc'));_0xf00b49+=_0x4f6faa[_0x0394('0xd')](_0x0394('0xc'));var _0x569fb3=JSON[_0x0394('0xe')](_0xf00b49);return _0x569fb3[_0x0394('0xf')](_0x166a6f)?_0x569fb3[_0x166a6f]:null;}}return null;}function isLimit(_0x6f6c74,_0x46c0f8,_0x56fe9a,_0x10e241){var _0x7c3d40=_0x46c0f8;return compose()[_0x0394('0x10')](function(_0x51b215,_0x2762d7,_0x53cc66){return db[_0x0394('0x11')][_0x0394('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x0394('0x13')](function(_0x152622){var _0x401ed0=getValueFromLicense(_0x6f6c74,_0x152622);return _0x401ed0?_0x401ed0:_0x7c3d40;})[_0x0394('0x13')](function(_0x2d3caf){_0x7c3d40=_0x2d3caf;return _0x56fe9a['count'](_0x10e241);})[_0x0394('0x13')](function(_0x2ee844){if(_0x2ee844>=_0x7c3d40){return _0x2762d7[_0x0394('0x14')](0x193)[_0x0394('0x15')]({'message':util[_0x0394('0x8')](_0x0394('0x16'),_0x6f6c74)});}_0x53cc66();})[_0x0394('0x17')](function(_0x5d322e){_0x53cc66(_0x5d322e);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0394('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x0394('0x19')}]}});}exports[_0x0394('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 0dc2889..55af546 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 _0xef4e=['unset','hasOwnProperty','isNumeric','match','isEmail','lodash','moment','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','sort','map','indexOf','cast','col','priority','unsigned','substr','ASC','length','omit','isString'];(function(_0x7e6de,_0x4c3bcb){var _0x32d727=function(_0x4ddd32){while(--_0x4ddd32){_0x7e6de['push'](_0x7e6de['shift']());}};_0x32d727(++_0x4c3bcb);}(_0xef4e,0x171));var _0xeef4=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xef4e[_0x4551f6];return _0x581dc2;};'use strict';var _=require(_0xeef4('0x0'));var moment=require(_0xeef4('0x1'));var sequelize=require(_0xeef4('0x2'));var LIMIT_VALUE=0xfa;exports[_0xeef4('0x3')]=function(_0x597f1f){var _0x422745=null;if(_0x597f1f){_0x422745=_0x597f1f[_0xeef4('0x4')](',');}return _0x422745;};exports[_0xeef4('0x5')]=function(_0x214667){var _0x3097bd={};if(!_[_0xeef4('0x6')](_0x214667)){_0x3097bd={};_[_0xeef4('0x7')](_0x214667,function(_0x310fc3,_0x301139){try{_0x3097bd[_0x301139]=_[_0xeef4('0x8')](_0x310fc3)?_0x310fc3:JSON[_0xeef4('0x9')](_0x310fc3);}catch(_0x17123b){_0x3097bd[_0x301139]=_0x310fc3[_0xeef4('0x4')](',');}});}return _0x3097bd;};exports[_0xeef4('0xa')]=function(_0x33aab4){_0x33aab4=parseInt(_0x33aab4,0xa);if(!_0x33aab4||_0x33aab4<0x0){_0x33aab4=LIMIT_VALUE;}return _0x33aab4;};exports['offset']=function(_0x4e6f61){_0x4e6f61=parseInt(_0x4e6f61,0xa);if(!_0x4e6f61||_0x4e6f61<0x0){_0x4e6f61=0x0;}return _0x4e6f61;};exports[_0xeef4('0xb')]=function(_0x5c702c){var _0x3eff3d,_0x4e4986=null;if(_0x5c702c){_0x3eff3d=_0x5c702c[_0xeef4('0x4')](',');_0x4e4986=_[_0xeef4('0xc')](_0x3eff3d,function(_0x3bf5f6){if(_0x3bf5f6[_0xeef4('0xd')]('-')===0x0){return[_0x3bf5f6==='priority'?sequelize[_0xeef4('0xe')](sequelize[_0xeef4('0xf')](_0xeef4('0x10')),_0xeef4('0x11')):_0x3bf5f6[_0xeef4('0x12')](0x1),'DESC'];}else{return[_0x3bf5f6===_0xeef4('0x10')?sequelize[_0xeef4('0xe')](sequelize[_0xeef4('0xf')](_0xeef4('0x10')),_0xeef4('0x11')):_0x3bf5f6,_0xeef4('0x13')];}});}return _0x4e4986;};exports['omit']=function(_0x37df25,_0x55985a){if(_[_0xeef4('0x6')](_0x37df25)){return _0x37df25;}if(_[_0xeef4('0x8')](_0x37df25)){for(var _0x4f56bb=0x0;_0x4f56bb<_0x37df25[_0xeef4('0x14')];_0x4f56bb+=0x1){_0x37df25[_0x4f56bb]=this[_0xeef4('0x15')](_0x37df25[_0x4f56bb],_0x55985a);}return _0x37df25;}if(!_['isObject'](_0x37df25)){return _0x37df25;}if(_[_0xeef4('0x16')](_0x55985a)){_0x55985a=[_0x55985a];}if(!_[_0xeef4('0x8')](_0x55985a)){return _0x37df25;}for(var _0x37ef26=0x0;_0x37ef26<_0x55985a[_0xeef4('0x14')];_0x37ef26+=0x1){_[_0xeef4('0x17')](_0x37df25,_0x55985a[_0x37ef26]);}for(var _0x2c3052 in _0x37df25){if(_0x37df25[_0xeef4('0x18')](_0x2c3052)){_0x37df25[_0x2c3052]=this[_0xeef4('0x15')](_0x37df25[_0x2c3052],_0x55985a);}}return _0x37df25;};exports[_0xeef4('0x19')]=function(_0x27ef06){return _0x27ef06[_0xeef4('0x1a')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xeef4('0x1b')]=function(_0x4115ee){return _0x4115ee[_0xeef4('0x1a')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x1aaf=['map','indexOf','priority','col','unsigned','substr','DESC','ASC','length','isObject','isString','unset','hasOwnProperty','omit','isNumeric','match','^[0-9]*$','isEmail','lodash','moment','sequelize','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort'];(function(_0x5161fc,_0x37c5f6){var _0x38490b=function(_0x49ebd8){while(--_0x49ebd8){_0x5161fc['push'](_0x5161fc['shift']());}};_0x38490b(++_0x37c5f6);}(_0x1aaf,0x1b6));var _0xf1aa=function(_0x2ac626,_0x1688a2){_0x2ac626=_0x2ac626-0x0;var _0x24cd53=_0x1aaf[_0x2ac626];return _0x24cd53;};'use strict';var _=require(_0xf1aa('0x0'));var moment=require(_0xf1aa('0x1'));var sequelize=require(_0xf1aa('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x405767){var _0x407cc4=null;if(_0x405767){_0x407cc4=_0x405767[_0xf1aa('0x3')](',');}return _0x407cc4;};exports[_0xf1aa('0x4')]=function(_0xf5bedb){var _0x3fbbb0={};if(!_[_0xf1aa('0x5')](_0xf5bedb)){_0x3fbbb0={};_[_0xf1aa('0x6')](_0xf5bedb,function(_0x11aac5,_0x5b8c12){try{_0x3fbbb0[_0x5b8c12]=_[_0xf1aa('0x7')](_0x11aac5)?_0x11aac5:JSON[_0xf1aa('0x8')](_0x11aac5);}catch(_0x5a4a49){_0x3fbbb0[_0x5b8c12]=_0x11aac5['split'](',');}});}return _0x3fbbb0;};exports[_0xf1aa('0x9')]=function(_0x40083f){_0x40083f=parseInt(_0x40083f,0xa);if(!_0x40083f||_0x40083f<0x0){_0x40083f=LIMIT_VALUE;}return _0x40083f;};exports[_0xf1aa('0xa')]=function(_0x34cd5a){_0x34cd5a=parseInt(_0x34cd5a,0xa);if(!_0x34cd5a||_0x34cd5a<0x0){_0x34cd5a=0x0;}return _0x34cd5a;};exports[_0xf1aa('0xb')]=function(_0x46016a){var _0x535446,_0x4a8e34=null;if(_0x46016a){_0x535446=_0x46016a[_0xf1aa('0x3')](',');_0x4a8e34=_[_0xf1aa('0xc')](_0x535446,function(_0x4641a1){if(_0x4641a1[_0xf1aa('0xd')]('-')===0x0){return[_0x4641a1===_0xf1aa('0xe')?sequelize['cast'](sequelize[_0xf1aa('0xf')](_0xf1aa('0xe')),_0xf1aa('0x10')):_0x4641a1[_0xf1aa('0x11')](0x1),_0xf1aa('0x12')];}else{return[_0x4641a1===_0xf1aa('0xe')?sequelize['cast'](sequelize['col'](_0xf1aa('0xe')),_0xf1aa('0x10')):_0x4641a1,_0xf1aa('0x13')];}});}return _0x4a8e34;};exports['omit']=function(_0x4a2031,_0x18da62){if(_[_0xf1aa('0x5')](_0x4a2031)){return _0x4a2031;}if(_['isArray'](_0x4a2031)){for(var _0x494497=0x0;_0x494497<_0x4a2031[_0xf1aa('0x14')];_0x494497+=0x1){_0x4a2031[_0x494497]=this['omit'](_0x4a2031[_0x494497],_0x18da62);}return _0x4a2031;}if(!_[_0xf1aa('0x15')](_0x4a2031)){return _0x4a2031;}if(_[_0xf1aa('0x16')](_0x18da62)){_0x18da62=[_0x18da62];}if(!_[_0xf1aa('0x7')](_0x18da62)){return _0x4a2031;}for(var _0x1bc2d6=0x0;_0x1bc2d6<_0x18da62[_0xf1aa('0x14')];_0x1bc2d6+=0x1){_[_0xf1aa('0x17')](_0x4a2031,_0x18da62[_0x1bc2d6]);}for(var _0x597522 in _0x4a2031){if(_0x4a2031[_0xf1aa('0x18')](_0x597522)){_0x4a2031[_0x597522]=this[_0xf1aa('0x19')](_0x4a2031[_0x597522],_0x18da62);}}return _0x4a2031;};exports[_0xf1aa('0x1a')]=function(_0x481ea7){return _0x481ea7[_0xf1aa('0x1b')](RegExp(_0xf1aa('0x1c')))?!![]:![];};exports[_0xf1aa('0x1d')]=function(_0x1b485e){return _0x1b485e['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 14b9b29..f192a39 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file +var _0xa9e0=['50mb','express','serve-favicon','body-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','get','use','public','favicon.ico','set','appPath','join','root','client','json\x20replacer','toISOString','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded'];(function(_0x3401ce,_0x5d1579){var _0x1bb79d=function(_0x46985e){while(--_0x46985e){_0x3401ce['push'](_0x3401ce['shift']());}};_0x1bb79d(++_0x5d1579);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var express=require(_0x0a9e('0x0'));var favicon=require(_0x0a9e('0x1'));var bodyParser=require(_0x0a9e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x0a9e('0x3'));var path=require('path');var passport=require(_0x0a9e('0x4'));var cors=require(_0x0a9e('0x5'));var moment=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var db=require(_0x0a9e('0x8'))['db'];exports['default']=function(_0x219af0){var _0x441e3a=_0x219af0[_0x0a9e('0x9')]('env');if(_0x441e3a==='production'){_0x219af0[_0x0a9e('0xa')](favicon(path['join'](config['root'],_0x0a9e('0xb'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],'public'));}if(_0x441e3a==='development'||_0x441e3a==='test'){_0x219af0['use'](favicon(path[_0x0a9e('0xf')](config[_0x0a9e('0x10')],_0x0a9e('0x11'),_0x0a9e('0xc'))));_0x219af0[_0x0a9e('0xd')](_0x0a9e('0xe'),path['join'](config[_0x0a9e('0x10')],_0x0a9e('0x11')));_0x219af0[_0x0a9e('0xa')](errorHandler());}_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x12'),function(_0x4d5611,_0x52a03d){if(this[_0x4d5611]instanceof Date){_0x52a03d=this[_0x4d5611][_0x0a9e('0x13')]()['split']('.')[0x0]+'Z';}return _0x52a03d;});_0x219af0[_0x0a9e('0xa')](express['static'](_0x219af0[_0x0a9e('0x9')](_0x0a9e('0xe'))));_0x219af0['set'](_0x0a9e('0x14'),config['root']+_0x0a9e('0x15'));_0x219af0[_0x0a9e('0x16')](_0x0a9e('0x17'),require(_0x0a9e('0x18'))[_0x0a9e('0x19')]);_0x219af0[_0x0a9e('0xd')](_0x0a9e('0x1a'),_0x0a9e('0x17'));_0x219af0[_0x0a9e('0xa')](bodyParser[_0x0a9e('0x1b')]({'limit':_0x0a9e('0x1c'),'extended':!![]}));_0x219af0[_0x0a9e('0xa')](bodyParser['json']({'limit':_0x0a9e('0x1c')}));_0x219af0[_0x0a9e('0xa')](cors());_0x219af0['use'](methodOverride());_0x219af0[_0x0a9e('0xa')](cookieParser());_0x219af0['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 718676c..db055ca 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 _0x7ec6=['networkInterfaces','orderBy','keys','length','family','internal','head','mac','address','127.0.0.1','getFirstInterface','map','model','createHash','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','md5','substring','lodash','bimedia-machine-uuid','child_process','execSync'];(function(_0x44c3ca,_0xe00dfb){var _0x5ed281=function(_0x158b18){while(--_0x158b18){_0x44c3ca['push'](_0x44c3ca['shift']());}};_0x5ed281(++_0xe00dfb);}(_0x7ec6,0x132));var _0x67ec=function(_0x41db07,_0x57027e){_0x41db07=_0x41db07-0x0;var _0x4949c4=_0x7ec6[_0x41db07];return _0x4949c4;};'use strict';var _=require(_0x67ec('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x67ec('0x1'));var exec=require(_0x67ec('0x2'))[_0x67ec('0x3')];function getInterfaces(){var _0x3946ef=[];var _0x4e7b05=os[_0x67ec('0x4')]();var _0x292737=_[_0x67ec('0x5')](_[_0x67ec('0x6')](_0x4e7b05));for(var _0x4bb2b0=0x0;_0x4bb2b0<_0x292737[_0x67ec('0x7')];_0x4bb2b0++){var _0x32f2dc=_0x4e7b05[_0x292737[_0x4bb2b0]]['filter'](function(_0x5f261e){return _0x5f261e[_0x67ec('0x8')]==='IPv4'&&_0x5f261e[_0x67ec('0x9')]===![];});_0x3946ef=_0x3946ef['concat'](_0x32f2dc);}return _0x3946ef;}function getFirstInterface(){var _0x2d7fa8=_[_0x67ec('0xa')](getInterfaces());return{'macAddress':_0x2d7fa8&&_0x2d7fa8['mac']?_0x2d7fa8[_0x67ec('0xb')]:'00:00:00:00:00:00','ipAddress':_0x2d7fa8&&_0x2d7fa8[_0x67ec('0xc')]?_0x2d7fa8[_0x67ec('0xc')]:_0x67ec('0xd')};}exports[_0x67ec('0xe')]=getFirstInterface;function getCPUhash(){var _0x1ae4d2=_[_0x67ec('0x5')](os['cpus']()[_0x67ec('0xf')](function(_0x491a7d){return _0x491a7d[_0x67ec('0x10')];}))['join'](':');return crypto[_0x67ec('0x11')]('md5')[_0x67ec('0x12')](_0x1ae4d2)[_0x67ec('0x13')](_0x67ec('0x14'));}exports[_0x67ec('0x15')]=function(){switch(os[_0x67ec('0x16')]()){case _0x67ec('0x17'):return exec(_0x67ec('0x18'),{'encoding':_0x67ec('0x19')})[_0x67ec('0x1a')]('\x0d\x0a','');default:var _0x417f64=getFirstInterface();var _0x4006e6=getCPUhash();var _0x15efc5=_0x4006e6+'|'+os[_0x67ec('0x1b')]()+'|'+_0x417f64[_0x67ec('0x1c')]+'|'+_0x417f64['ipAddress'];var _0x3d7543=crypto[_0x67ec('0x11')](_0x67ec('0x1d'))[_0x67ec('0x12')](_0x15efc5)[_0x67ec('0x13')](_0x67ec('0x14'));return _0x3d7543[_0x67ec('0x1e')](0x0,0x8)+'-'+_0x3d7543[_0x67ec('0x1e')](0x8,0xc)+'-'+_0x3d7543[_0x67ec('0x1e')](0xc,0x10)+'-'+_0x3d7543[_0x67ec('0x1e')](0x10,0x14)+'-'+_0x3d7543[_0x67ec('0x1e')](0x14);}}; \ No newline at end of file +var _0xade4=['ipAddress','createHash','md5','substring','lodash','crypto','child_process','execSync','orderBy','keys','length','filter','family','IPv4','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','update','digest','hex','getUuid','platform','dmidecode\x20--string\x20system-uuid','replace','hostname'];(function(_0x1a7d43,_0x4aa2c7){var _0x4a94da=function(_0x50e5fd){while(--_0x50e5fd){_0x1a7d43['push'](_0x1a7d43['shift']());}};_0x4a94da(++_0x4aa2c7);}(_0xade4,0x159));var _0x4ade=function(_0x353afa,_0x4b9bd1){_0x353afa=_0x353afa-0x0;var _0x15cf5a=_0xade4[_0x353afa];return _0x15cf5a;};'use strict';var _=require(_0x4ade('0x0'));var os=require('os');var crypto=require(_0x4ade('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x4ade('0x2'))[_0x4ade('0x3')];function getInterfaces(){var _0x53aefe=[];var _0x36abbe=os['networkInterfaces']();var _0x4bcd01=_[_0x4ade('0x4')](_[_0x4ade('0x5')](_0x36abbe));for(var _0x285eae=0x0;_0x285eae<_0x4bcd01[_0x4ade('0x6')];_0x285eae++){var _0x31b92b=_0x36abbe[_0x4bcd01[_0x285eae]][_0x4ade('0x7')](function(_0x2c0f26){return _0x2c0f26[_0x4ade('0x8')]===_0x4ade('0x9')&&_0x2c0f26['internal']===![];});_0x53aefe=_0x53aefe[_0x4ade('0xa')](_0x31b92b);}return _0x53aefe;}function getFirstInterface(){var _0x3d06e=_[_0x4ade('0xb')](getInterfaces());return{'macAddress':_0x3d06e&&_0x3d06e[_0x4ade('0xc')]?_0x3d06e[_0x4ade('0xc')]:'00:00:00:00:00:00','ipAddress':_0x3d06e&&_0x3d06e[_0x4ade('0xd')]?_0x3d06e['address']:_0x4ade('0xe')};}exports[_0x4ade('0xf')]=getFirstInterface;function getCPUhash(){var _0x78bae3=_[_0x4ade('0x4')](os[_0x4ade('0x10')]()[_0x4ade('0x11')](function(_0x2cabcb){return _0x2cabcb[_0x4ade('0x12')];}))['join'](':');return crypto['createHash']('md5')[_0x4ade('0x13')](_0x78bae3)[_0x4ade('0x14')](_0x4ade('0x15'));}exports[_0x4ade('0x16')]=function(){switch(os[_0x4ade('0x17')]()){case'win32':return exec(_0x4ade('0x18'),{'encoding':'utf8'})[_0x4ade('0x19')]('\x0d\x0a','');default:var _0x3f69b2=getFirstInterface();var _0x4d7d8b=getCPUhash();var _0x7074a2=_0x4d7d8b+'|'+os[_0x4ade('0x1a')]()+'|'+_0x3f69b2['macAddress']+'|'+_0x3f69b2[_0x4ade('0x1b')];var _0x455572=crypto[_0x4ade('0x1c')](_0x4ade('0x1d'))['update'](_0x7074a2)[_0x4ade('0x14')]('hex');return _0x455572['substring'](0x0,0x8)+'-'+_0x455572[_0x4ade('0x1e')](0x8,0xc)+'-'+_0x455572[_0x4ade('0x1e')](0xc,0x10)+'-'+_0x455572[_0x4ade('0x1e')](0x10,0x14)+'-'+_0x455572[_0x4ade('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0d88743..8af8f53 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 _0xa1e1=['ipAddress','openIssue','Motion\x20License\x20Alert','Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','error','message','getUuid','spread','default','crypto','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','session','update','utf8','base64','final','createDecipher','secrets','||FIELD||VALUE||\x0a','User','admin','fullname','email','|reason|','|uuid|','|name|','|email|','getFirstInterface'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa1e1,0x180));var _0x1a1e=function(_0x1325cf,_0x1ad5c8){_0x1325cf=_0x1325cf-0x0;var _0xee4d0=_0xa1e1[_0x1325cf];return _0xee4d0;};'use strict';var util=require('util');var crypto=require(_0x1a1e('0x0'));var moment=require(_0x1a1e('0x1'));var rp=require(_0x1a1e('0x2'));var BPromise=require(_0x1a1e('0x3'));var pkginfo=require(_0x1a1e('0x4'))(module,_0x1a1e('0x5'));var db=require(_0x1a1e('0x6'))['db'];var config=require('../environment');var hardware=require(_0x1a1e('0x7'));var logger=require('../logger')(_0x1a1e('0x8'));var jira=require(_0x1a1e('0x9'));var HOST=_0x1a1e('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xa607b5){return new BPromise(function(_0x52be4e,_0x20388d){var _0x55775d=util[_0x1a1e('0xb')](_0x1a1e('0xc'),HOST,_0xa607b5,module[_0x1a1e('0xd')][_0x1a1e('0x5')]);if(oldToken){_0x55775d=util['format'](_0x1a1e('0xe'),HOST,_0xa607b5,module['exports'][_0x1a1e('0x5')],oldToken);}var _0x3004c0={'uri':_0x55775d,'method':_0x1a1e('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x3004c0)[_0x1a1e('0x10')](function(_0x475f13){_0x52be4e(_0x475f13);})[_0x1a1e('0x11')](function(_0x47b6e2){_0x20388d(_0x47b6e2);});});}function encryptDate(_0x539d7d){var _0x2ca4e5=crypto[_0x1a1e('0x12')]('aes-256-ctr',config['secrets'][_0x1a1e('0x13')]);var _0x5c6576=_0x2ca4e5[_0x1a1e('0x14')](_0x539d7d,_0x1a1e('0x15'),_0x1a1e('0x16'));_0x5c6576+=_0x2ca4e5[_0x1a1e('0x17')]('base64');return _0x5c6576;}function decryptDate(_0x140756){var _0xa16d53=crypto[_0x1a1e('0x18')]('aes-256-ctr',config[_0x1a1e('0x19')][_0x1a1e('0x13')]);var _0x463199=_0xa16d53[_0x1a1e('0x14')](_0x140756,_0x1a1e('0x16'),_0x1a1e('0x15'));_0x463199+=_0xa16d53['final'](_0x1a1e('0x15'));return _0x463199;}function sendJiraAlert(_0x543e5a,_0x2f2728,_0x282118){var _0x1cb048=_0x1a1e('0x1a');return db[_0x1a1e('0x1b')]['findOne']({'where':{'role':_0x1a1e('0x1c')},'attributes':[_0x1a1e('0x1d'),_0x1a1e('0x1e')],'raw':!![]})[_0x1a1e('0x10')](function(_0x5cf90f){ADMIN=_0x5cf90f;_0x1cb048+=_0x1a1e('0x1f')+_0x282118+'|\x0a';_0x1cb048+=_0x1a1e('0x20')+_0x543e5a+'|\x0a';_0x1cb048+='|machineUuid|'+_0x2f2728+'|\x0a';_0x1cb048+=_0x1a1e('0x21')+ADMIN[_0x1a1e('0x1d')]+'|\x0a';_0x1cb048+=_0x1a1e('0x22')+ADMIN[_0x1a1e('0x1e')]+'|\x0a';return _0x1cb048;})[_0x1a1e('0x10')](function(_0x1919ac){var _0x5ded94=hardware[_0x1a1e('0x23')]()[_0x1a1e('0x24')];return jira[_0x1a1e('0x25')]({'key':'MOTLICENSE','summary':_0x1a1e('0x26'),'description':_0x1919ac,'issuetype':_0x1a1e('0x27'),'oldToken':_0x543e5a,'newToken':_0x2f2728,'email':ADMIN[_0x1a1e('0x1e')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x5ded94});});}function manageLicense(_0x469bf7,_0x22abff){var _0x2a4c8d=_0x22abff[_0x1a1e('0x28')]({'plain':!![]});httpRequest(_0x469bf7)[_0x1a1e('0x10')](function(_0x17121d){if(oldToken){oldToken=undefined;}if(_0x17121d[_0x1a1e('0x29')]){if(!_0x2a4c8d[_0x1a1e('0x8')]&&_0x2a4c8d[_0x1a1e('0x8')]!=_0x17121d[_0x1a1e('0x8')]||_0x2a4c8d['license']&&_0x2a4c8d['data2']){logger[_0x1a1e('0x2a')](_0x1a1e('0x2b'));}if(_0x2a4c8d[_0x1a1e('0x8')]&&!_0x2a4c8d[_0x1a1e('0x2c')]&&_0x2a4c8d['license']!=_0x17121d['license']){logger[_0x1a1e('0x2a')](_0x1a1e('0x2d'));}if(_0x2a4c8d[_0x1a1e('0x8')]&&!_0x2a4c8d[_0x1a1e('0x2c')]&&_0x2a4c8d[_0x1a1e('0x8')]==_0x17121d[_0x1a1e('0x8')]){return _0x22abff;}return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':_0x17121d['license']});}else{if(_0x17121d[_0x1a1e('0x8')]||_0x2a4c8d[_0x1a1e('0x8')]){if(!_0x2a4c8d[_0x1a1e('0x2c')]){if(_0x2a4c8d[_0x1a1e('0x2e')]==_0x469bf7){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x1a1e('0x2f'));}else{GRAY_PERIOD_REASON=_0x1a1e('0x30');oldToken=_0x2a4c8d[_0x1a1e('0x2e')];logger[_0x1a1e('0x2a')](_0x1a1e('0x31'),_0x2a4c8d[_0x1a1e('0x2e')],_0x469bf7);}sendJiraAlert(_0x2a4c8d['data1'],_0x17121d[_0x1a1e('0x32')],GRAY_PERIOD_REASON);logger[_0x1a1e('0x2a')](_0x1a1e('0x33'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1a1e('0xb')](_0x1a1e('0x34')));return _0x22abff['update']({'data2':encryptDate(moment()[_0x1a1e('0xb')](_0x1a1e('0x34')))});}else{if(moment()[_0x1a1e('0x35')](decryptDate(_0x2a4c8d['data2']),_0x1a1e('0x36'))>DAYS){logger[_0x1a1e('0x2a')]('DEMO\x20START\x20AT\x20%s',moment()[_0x1a1e('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':null});}}}else{if(_0x2a4c8d['data1']!=_0x469bf7){logger[_0x1a1e('0x2a')](_0x1a1e('0x31'),_0x2a4c8d[_0x1a1e('0x2e')],_0x469bf7);return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':null});}}}return _0x22abff;})[_0x1a1e('0x10')](function(_0x18a998){_0x22abff=_0x18a998;})[_0x1a1e('0x11')](function(_0x5a0343){logger[_0x1a1e('0x37')](_0x5a0343[_0x1a1e('0x38')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x1a1e('0x39')](),_0x22abff);},TIME);});}function defaultLicense(){var _0x278b61=hardware[_0x1a1e('0x39')]();if(_0x278b61){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x278b61}})[_0x1a1e('0x3a')](function(_0x25d20b,_0x4089d5){logger[_0x1a1e('0x2a')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x278b61);manageLicense(_0x278b61,_0x25d20b);})[_0x1a1e('0x11')](function(_0x427be6){logger[_0x1a1e('0x37')](_0x427be6[_0x1a1e('0x38')]);});}}exports[_0x1a1e('0x3b')]=defaultLicense; \ No newline at end of file +var _0x9370=['DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','message','getUuid','License','spread','default','util','crypto','moment','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','format','exports','then','createCipher','aes-256-ctr','session','update','utf8','base64','final','createDecipher','secrets','User','findOne','admin','fullname','|uuid|','|machineUuid|','|name|','email','getFirstInterface','ipAddress','openIssue','Alert','get','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days'];(function(_0x26c9e4,_0xf6affd){var _0x2d7efa=function(_0x15f497){while(--_0x15f497){_0x26c9e4['push'](_0x26c9e4['shift']());}};_0x2d7efa(++_0xf6affd);}(_0x9370,0x83));var _0x0937=function(_0x4606fb,_0x482674){_0x4606fb=_0x4606fb-0x0;var _0xd1e979=_0x9370[_0x4606fb];return _0xd1e979;};'use strict';var util=require(_0x0937('0x0'));var crypto=require(_0x0937('0x1'));var moment=require(_0x0937('0x2'));var rp=require('request-promise');var BPromise=require(_0x0937('0x3'));var pkginfo=require(_0x0937('0x4'))(module,_0x0937('0x5'));var db=require(_0x0937('0x6'))['db'];var config=require(_0x0937('0x7'));var hardware=require(_0x0937('0x8'));var logger=require(_0x0937('0x9'))('license');var jira=require(_0x0937('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x33347c){return new BPromise(function(_0x4e7afa,_0x5750d5){var _0x5b4777=util[_0x0937('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x33347c,module[_0x0937('0xc')]['version']);if(oldToken){_0x5b4777=util[_0x0937('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x33347c,module[_0x0937('0xc')][_0x0937('0x5')],oldToken);}var _0x368597={'uri':_0x5b4777,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x368597)[_0x0937('0xd')](function(_0x48f74d){_0x4e7afa(_0x48f74d);})['catch'](function(_0xdaabd5){_0x5750d5(_0xdaabd5);});});}function encryptDate(_0x2949be){var _0x36afc1=crypto[_0x0937('0xe')](_0x0937('0xf'),config['secrets'][_0x0937('0x10')]);var _0x526a69=_0x36afc1[_0x0937('0x11')](_0x2949be,_0x0937('0x12'),_0x0937('0x13'));_0x526a69+=_0x36afc1[_0x0937('0x14')]('base64');return _0x526a69;}function decryptDate(_0x1bb534){var _0x4221da=crypto[_0x0937('0x15')](_0x0937('0xf'),config[_0x0937('0x16')][_0x0937('0x10')]);var _0x2df932=_0x4221da[_0x0937('0x11')](_0x1bb534,'base64',_0x0937('0x12'));_0x2df932+=_0x4221da['final'](_0x0937('0x12'));return _0x2df932;}function sendJiraAlert(_0x5642bd,_0x5b5cab,_0x1fd907){var _0x34076c='||FIELD||VALUE||\x0a';return db[_0x0937('0x17')][_0x0937('0x18')]({'where':{'role':_0x0937('0x19')},'attributes':[_0x0937('0x1a'),'email'],'raw':!![]})[_0x0937('0xd')](function(_0xa924b1){ADMIN=_0xa924b1;_0x34076c+='|reason|'+_0x1fd907+'|\x0a';_0x34076c+=_0x0937('0x1b')+_0x5642bd+'|\x0a';_0x34076c+=_0x0937('0x1c')+_0x5b5cab+'|\x0a';_0x34076c+=_0x0937('0x1d')+ADMIN[_0x0937('0x1a')]+'|\x0a';_0x34076c+='|email|'+ADMIN[_0x0937('0x1e')]+'|\x0a';return _0x34076c;})[_0x0937('0xd')](function(_0x52279d){var _0x45c5cf=hardware[_0x0937('0x1f')]()[_0x0937('0x20')];return jira[_0x0937('0x21')]({'key':'MOTLICENSE','summary':'Motion\x20License\x20Alert','description':_0x52279d,'issuetype':_0x0937('0x22'),'oldToken':_0x5642bd,'newToken':_0x5b5cab,'email':ADMIN[_0x0937('0x1e')],'name':ADMIN[_0x0937('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x45c5cf});});}function manageLicense(_0x1f32fa,_0x5c5ee4){var _0x190261=_0x5c5ee4[_0x0937('0x23')]({'plain':!![]});httpRequest(_0x1f32fa)['then'](function(_0x486c47){if(oldToken){oldToken=undefined;}if(_0x486c47[_0x0937('0x24')]){if(!_0x190261[_0x0937('0x25')]&&_0x190261[_0x0937('0x25')]!=_0x486c47[_0x0937('0x25')]||_0x190261[_0x0937('0x25')]&&_0x190261[_0x0937('0x26')]){logger[_0x0937('0x27')](_0x0937('0x28'));}if(_0x190261['license']&&!_0x190261[_0x0937('0x26')]&&_0x190261[_0x0937('0x25')]!=_0x486c47[_0x0937('0x25')]){logger[_0x0937('0x27')](_0x0937('0x29'));}if(_0x190261[_0x0937('0x25')]&&!_0x190261[_0x0937('0x26')]&&_0x190261[_0x0937('0x25')]==_0x486c47[_0x0937('0x25')]){return _0x5c5ee4;}return _0x5c5ee4[_0x0937('0x11')]({'data1':_0x1f32fa,'data2':null,'license':_0x486c47['license']});}else{if(_0x486c47[_0x0937('0x25')]||_0x190261[_0x0937('0x25')]){if(!_0x190261['data2']){if(_0x190261[_0x0937('0x2a')]==_0x1f32fa){GRAY_PERIOD_REASON=_0x0937('0x2b');logger[_0x0937('0x27')](_0x0937('0x2c'));}else{GRAY_PERIOD_REASON=_0x0937('0x2d');oldToken=_0x190261[_0x0937('0x2a')];logger[_0x0937('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x190261[_0x0937('0x2a')],_0x1f32fa);}sendJiraAlert(_0x190261['data1'],_0x486c47[_0x0937('0x2e')],GRAY_PERIOD_REASON);logger[_0x0937('0x27')](_0x0937('0x2f'),GRAY_PERIOD_REASON[_0x0937('0x30')](),moment()[_0x0937('0xb')](_0x0937('0x31')));return _0x5c5ee4[_0x0937('0x11')]({'data2':encryptDate(moment()[_0x0937('0xb')](_0x0937('0x31')))});}else{if(moment()[_0x0937('0x32')](decryptDate(_0x190261[_0x0937('0x26')]),_0x0937('0x33'))>DAYS){logger[_0x0937('0x27')](_0x0937('0x34'),moment()[_0x0937('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x5c5ee4['update']({'data1':_0x1f32fa,'data2':null,'license':null});}}}else{if(_0x190261[_0x0937('0x2a')]!=_0x1f32fa){logger['info'](_0x0937('0x35'),_0x190261[_0x0937('0x2a')],_0x1f32fa);return _0x5c5ee4[_0x0937('0x11')]({'data1':_0x1f32fa,'data2':null,'license':null});}}}return _0x5c5ee4;})[_0x0937('0xd')](function(_0x16eaab){_0x5c5ee4=_0x16eaab;})[_0x0937('0x36')](function(_0x23e538){logger[_0x0937('0x37')](_0x23e538[_0x0937('0x38')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0937('0x39')](),_0x5c5ee4);},TIME);});}function defaultLicense(){var _0x50342c=hardware['getUuid']();if(_0x50342c){return db[_0x0937('0x3a')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x50342c}})[_0x0937('0x3b')](function(_0x2a4363,_0x2074a1){logger[_0x0937('0x27')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x50342c);manageLicense(_0x50342c,_0x2a4363);})[_0x0937('0x36')](function(_0x3526ce){logger[_0x0937('0x37')](_0x3526ce['message']);});}}exports[_0x0937('0x3c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d3f4ac0..54b230c 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 _0x4ca1=['secrets','session','gray','deadline','days','grayReason','uuid','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','find','defaults','then','checkLicense','crypto','util','moment','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','getUuid'];(function(_0x45dd9d,_0x47e39d){var _0x3835ba=function(_0xbaf440){while(--_0xbaf440){_0x45dd9d['push'](_0x45dd9d['shift']());}};_0x3835ba(++_0x47e39d);}(_0x4ca1,0xca));var _0x14ca=function(_0x45fbc7,_0x2cf50d){_0x45fbc7=_0x45fbc7-0x0;var _0x392cfd=_0x4ca1[_0x45fbc7];return _0x392cfd;};'use strict';var crypto=require(_0x14ca('0x0'));var util=require(_0x14ca('0x1'));var _=require('lodash');var moment=require(_0x14ca('0x2'));var hardware=require('./hardware');var config=require('../environment');var db=require(_0x14ca('0x3'))['db'];function checkLicense(_0x2e603c,_0x5f2188){if(_0x2e603c){try{var _0x50e673=_0x5f2188||_0x2e603c[_0x14ca('0x4')];if(_[_0x14ca('0x5')](_0x50e673)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x552428=_0x2e603c[_0x14ca('0x6')];var _0x39add5=_0x2e603c[_0x14ca('0x7')];var _0x5132f8=_0x552428[_0x14ca('0x8')]('-')[0x4];var _0x361575=_0x552428[_0x14ca('0x8')]('-')[0x0];var _0x425c2a=crypto[_0x14ca('0x9')](_0x14ca('0xa'),util[_0x14ca('0xb')](_0x14ca('0xc'),_0x5132f8,_0x552428,_0x361575));var _0x1227fc=_0x425c2a[_0x14ca('0xd')](_0x50e673,_0x14ca('0xe'),_0x14ca('0xf'));_0x1227fc+=_0x425c2a[_0x14ca('0x10')](_0x14ca('0xf'));var _0x2f0f82=JSON[_0x14ca('0x11')](_0x1227fc);_0x2f0f82[_0x14ca('0x12')]=![];_0x2f0f82['uuid']=_0x552428;_0x2f0f82['machineUuid']=hardware[_0x14ca('0x13')]();if(_0x39add5){var _0x10d03e=crypto[_0x14ca('0x9')](_0x14ca('0xa'),config[_0x14ca('0x14')][_0x14ca('0x15')]);var _0x373db8=_0x10d03e['update'](_0x39add5,_0x14ca('0xe'),_0x14ca('0xf'));_0x373db8+=_0x10d03e[_0x14ca('0x10')](_0x14ca('0xf'));_0x2f0f82[_0x14ca('0x16')]=_0x373db8;_0x2f0f82[_0x14ca('0x17')]=moment(_0x373db8)['add'](0x7,_0x14ca('0x18'))[_0x14ca('0xb')]();_0x2f0f82[_0x14ca('0x19')]=_0x2f0f82[_0x14ca('0x1a')]!=_0x2f0f82[_0x14ca('0x1b')]?_0x14ca('0x1c'):_0x14ca('0x1d');}return _0x2f0f82;}catch(_0x3acb87){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x14ca('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2e603c[_0x14ca('0x6')],'machineUuid':hardware[_0x14ca('0x13')](),'message':_0x3acb87[_0x14ca('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x14ca('0x20'),'uuid':_0x2e603c[_0x14ca('0x6')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x28a4fb){return db['License'][_0x14ca('0x21')](_[_0x14ca('0x22')](_0x28a4fb,{'raw':!![],'where':{'id':0x1}}))[_0x14ca('0x23')](function(_0x41649a){return checkLicense(_0x41649a,null);});};exports[_0x14ca('0x24')]=checkLicense; \ No newline at end of file +var _0xf372=['isEmpty','data1','data2','createDecipher','format','%s:%s:%s','utf8','parse','demo','machineUuid','getUuid','secrets','session','update','gray','days','grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','Demo\x20license','getLicense','find','then','checkLicense','crypto','util','./hardware','../../mysqldb','license'];(function(_0x48191a,_0xa59be7){var _0x1bb46b=function(_0x5e8f6e){while(--_0x5e8f6e){_0x48191a['push'](_0x48191a['shift']());}};_0x1bb46b(++_0xa59be7);}(_0xf372,0x1bb));var _0x2f37=function(_0x1fb573,_0x138b81){_0x1fb573=_0x1fb573-0x0;var _0xa27e7c=_0xf372[_0x1fb573];return _0xa27e7c;};'use strict';var crypto=require(_0x2f37('0x0'));var util=require(_0x2f37('0x1'));var _=require('lodash');var moment=require('moment');var hardware=require(_0x2f37('0x2'));var config=require('../environment');var db=require(_0x2f37('0x3'))['db'];function checkLicense(_0x52cae7,_0x41c6dd){if(_0x52cae7){try{var _0x464824=_0x41c6dd||_0x52cae7[_0x2f37('0x4')];if(_[_0x2f37('0x5')](_0x464824)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x98acf2=_0x52cae7[_0x2f37('0x6')];var _0x49c776=_0x52cae7[_0x2f37('0x7')];var _0x5050e0=_0x98acf2['split']('-')[0x4];var _0x126254=_0x98acf2['split']('-')[0x0];var _0x8a842e=crypto[_0x2f37('0x8')]('aes-256-ctr',util[_0x2f37('0x9')](_0x2f37('0xa'),_0x5050e0,_0x98acf2,_0x126254));var _0x570022=_0x8a842e['update'](_0x464824,'base64','utf8');_0x570022+=_0x8a842e['final'](_0x2f37('0xb'));var _0x36c455=JSON[_0x2f37('0xc')](_0x570022);_0x36c455[_0x2f37('0xd')]=![];_0x36c455['uuid']=_0x98acf2;_0x36c455[_0x2f37('0xe')]=hardware[_0x2f37('0xf')]();if(_0x49c776){var _0x44f273=crypto['createDecipher']('aes-256-ctr',config[_0x2f37('0x10')][_0x2f37('0x11')]);var _0x2038a4=_0x44f273[_0x2f37('0x12')](_0x49c776,'base64',_0x2f37('0xb'));_0x2038a4+=_0x44f273['final'](_0x2f37('0xb'));_0x36c455[_0x2f37('0x13')]=_0x2038a4;_0x36c455['deadline']=moment(_0x2038a4)['add'](0x7,_0x2f37('0x14'))['format']();_0x36c455[_0x2f37('0x15')]=_0x36c455[_0x2f37('0x16')]!=_0x36c455[_0x2f37('0xe')]?_0x2f37('0x17'):_0x2f37('0x18');}return _0x36c455;}catch(_0x24cd54){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2f37('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2f37('0x1a'),'uuid':_0x52cae7[_0x2f37('0x6')],'machineUuid':hardware[_0x2f37('0xf')](),'message':_0x24cd54['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2f37('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2f37('0x1b'),'uuid':_0x52cae7[_0x2f37('0x6')],'machineUuid':hardware[_0x2f37('0xf')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x2f37('0x1c')]=function(_0x3ab720){return db['License'][_0x2f37('0x1d')](_['defaults'](_0x3ab720,{'raw':!![],'where':{'id':0x1}}))[_0x2f37('0x1e')](function(_0x2bf241){return checkLicense(_0x2bf241,null);});};exports[_0x2f37('0x1f')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index adf5c73..3074ebd 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 _0x49ac=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x5747e9,_0x1da002){var _0x381bf2=function(_0x4cf3d8){while(--_0x4cf3d8){_0x5747e9['push'](_0x5747e9['shift']());}};_0x381bf2(++_0x1da002);}(_0x49ac,0x19e));var _0xc49a=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x49ac[_0x207a02];return _0xd995c3;};'use strict';module[_0xc49a('0x0')]={'DOMAIN':_0xc49a('0x1'),'SESSION_SECRET':_0xc49a('0x2'),'GOOGLE_ID':_0xc49a('0x3'),'GOOGLE_SECRET':_0xc49a('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x13c0=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x7c4465,_0xcb0348){var _0x5a648a=function(_0x4350a8){while(--_0x4350a8){_0x7c4465['push'](_0x7c4465['shift']());}};_0x5a648a(++_0xcb0348);}(_0x13c0,0x79));var _0x013c=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0x13c0[_0x389c94];return _0x1455cb;};'use strict';module[_0x013c('0x0')]={'DOMAIN':_0x013c('0x1'),'SESSION_SECRET':_0x013c('0x2'),'GOOGLE_ID':_0x013c('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index a5c3605..6db908f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35ea=['error','%s-%s','info','env','debugLevel','moment','winston','INFO','join','/var','log','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','File'];(function(_0x2a0607,_0x5137f2){var _0xc365e1=function(_0x1c7a84){while(--_0x1c7a84){_0x2a0607['push'](_0x2a0607['shift']());}};_0xc365e1(++_0x5137f2);}(_0x35ea,0x64));var _0xa35e=function(_0x35d294,_0x3a9b4){_0x35d294=_0x35d294-0x0;var _0xb9ae9a=_0x35ea[_0x35d294];return _0xb9ae9a;};'use strict';var moment=require(_0xa35e('0x0'));var winston=require(_0xa35e('0x1'));var util=require('util');var path=require('path');var debugLevel=_0xa35e('0x2');function filename(_0x2d77e5,_0x204833){return path[_0xa35e('0x3')](_0xa35e('0x4'),_0xa35e('0x5'),'xcally',util[_0xa35e('0x6')](_0xa35e('0x7'),_0x2d77e5,_0x204833));}function formatter(_0x404918,_0x539368){return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xa35e('0x6')](_0xa35e('0x8')),_0x539368['level']['toUpperCase'](),_0x404918,_0x539368[_0xa35e('0x9')]);}module[_0xa35e('0xa')]=function(_0x4f9bb1){return new winston[(_0xa35e('0xb'))]({'transports':[new winston[(_0xa35e('0xc'))][(_0xa35e('0xd'))]({'name':util[_0xa35e('0x6')]('%s-%s',_0x4f9bb1,_0xa35e('0xe')),'filename':filename(_0x4f9bb1,_0xa35e('0xe')),'level':_0xa35e('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c2e94){return formatter(_0x4f9bb1,_0x4c2e94);}}),new winston[(_0xa35e('0xc'))]['File']({'name':util['format'](_0xa35e('0xf'),_0x4f9bb1,_0xa35e('0x10')),'filename':filename(_0x4f9bb1,_0xa35e('0x10')),'level':_0xa35e('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x44bf11){return formatter(_0x4f9bb1,_0x44bf11);}}),new winston[(_0xa35e('0xc'))]['Console']({'level':process[_0xa35e('0x11')][_0xa35e('0x12')]||debugLevel,'json':![],'formatter':function(_0x4e4ec9){return formatter(_0x4f9bb1,_0x4e4ec9);}})]});}; \ No newline at end of file +var _0xa20f=['moment','winston','path','INFO','join','/var','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel'];(function(_0x2fe22d,_0x1dfbea){var _0x206404=function(_0x4a739e){while(--_0x4a739e){_0x2fe22d['push'](_0x2fe22d['shift']());}};_0x206404(++_0x1dfbea);}(_0xa20f,0xd2));var _0xfa20=function(_0x401e83,_0xc6d9c5){_0x401e83=_0x401e83-0x0;var _0x3cc505=_0xa20f[_0x401e83];return _0x3cc505;};'use strict';var moment=require(_0xfa20('0x0'));var winston=require(_0xfa20('0x1'));var util=require('util');var path=require(_0xfa20('0x2'));var debugLevel=_0xfa20('0x3');function filename(_0x2b0d41,_0x38c03f){return path[_0xfa20('0x4')](_0xfa20('0x5'),'log',_0xfa20('0x6'),util[_0xfa20('0x7')](_0xfa20('0x8'),_0x2b0d41,_0x38c03f));}function formatter(_0x13e378,_0x17a9ab){return util['format'](_0xfa20('0x9'),moment()[_0xfa20('0x7')](_0xfa20('0xa')),_0x17a9ab['level'][_0xfa20('0xb')](),_0x13e378,_0x17a9ab['message']);}module[_0xfa20('0xc')]=function(_0x543725){return new winston[(_0xfa20('0xd'))]({'transports':[new winston[(_0xfa20('0xe'))][(_0xfa20('0xf'))]({'name':util['format'](_0xfa20('0x10'),_0x543725,_0xfa20('0x11')),'filename':filename(_0x543725,_0xfa20('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3edfad){return formatter(_0x543725,_0x3edfad);}}),new winston[(_0xfa20('0xe'))][(_0xfa20('0xf'))]({'name':util['format'](_0xfa20('0x10'),_0x543725,_0xfa20('0x12')),'filename':filename(_0x543725,_0xfa20('0x12')),'level':_0xfa20('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fb907){return formatter(_0x543725,_0x4fb907);}}),new winston[(_0xfa20('0xe'))][(_0xfa20('0x13'))]({'level':process['env'][_0xfa20('0x14')]||debugLevel,'json':![],'formatter':function(_0x121393){return formatter(_0x543725,_0x121393);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e87c44e..e7725f5 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 _0x7e62=['../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','express','join','../../services/express/index.js','../../services/ami/index.js','agi'];(function(_0x2ecc09,_0x39f700){var _0x384ff7=function(_0x39c9a2){while(--_0x39c9a2){_0x2ecc09['push'](_0x2ecc09['shift']());}};_0x384ff7(++_0x39f700);}(_0x7e62,0x69));var _0x27e6=function(_0x2b31c1,_0x3c88e4){_0x2b31c1=_0x2b31c1-0x0;var _0x3e4824=_0x7e62[_0x2b31c1];return _0x3e4824;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x27e6('0x0'),'script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x2'))},{'name':'ami','script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x3'))},{'name':_0x27e6('0x4'),'script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x5'))},{'name':_0x27e6('0x6'),'script':path['join'](__dirname,_0x27e6('0x7'))},{'name':'routing','script':path['join'](__dirname,_0x27e6('0x8'))},{'name':_0x27e6('0x9'),'script':path['join'](__dirname,_0x27e6('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0xba57=['path','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba57,0xd1));var _0x7ba5=function(_0x33801e,_0x1d6728){_0x33801e=_0x33801e-0x0;var _0x3f3768=_0xba57[_0x33801e];return _0x3f3768;};'use strict';var path=require(_0x7ba5('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x2'))},{'name':'ami','script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x3'))},{'name':_0x7ba5('0x4'),'script':path['join'](__dirname,_0x7ba5('0x5'))},{'name':_0x7ba5('0x6'),'script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x7'))},{'name':_0x7ba5('0x8'),'script':path[_0x7ba5('0x1')](__dirname,_0x7ba5('0x9'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x7ba5('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 312f13e..62bf898 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 _0x9957=['stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pm2=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var config=require(_0x7995('0x2'));function connect(){return new BPromise(function(_0x10a05d,_0x5b96eb){return pm2[_0x7995('0x3')](function(_0x3c58eb){if(_0x3c58eb){return _0x5b96eb(_0x3c58eb);}return _0x10a05d(_0x7995('0x4'));});});};exports[_0x7995('0x5')]=function(_0x576d89){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1a36d8,_0x137b6b){return pm2[_0x7995('0x5')](_0x576d89,function(_0xbda126,_0x326741){if(_0xbda126){return _0x137b6b(_0xbda126);}pm2['disconnect']();return _0x1a36d8(_0x326741);});});});};exports[_0x7995('0x7')]=function(_0x1cad37){return connect()['then'](function(){return new BPromise(function(_0xa2e5f0,_0x3116fb){return pm2[_0x7995('0x7')](_0x1cad37,function(_0x35b5fe,_0x3c1d19){if(_0x35b5fe){return _0x3116fb(_0x35b5fe);}pm2[_0x7995('0x8')]();return _0xa2e5f0(_0x3c1d19);});});});};exports[_0x7995('0x9')]=function(_0x524f7b){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x41c652,_0x581f22){return pm2[_0x7995('0x9')](_0x524f7b,function(_0x2cb37a,_0x19a27e){if(_0x2cb37a){return _0x581f22(_0x2cb37a);}pm2[_0x7995('0x8')]();return _0x41c652(_0x19a27e);});});});};exports[_0x7995('0xa')]=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2bbe7a,_0x4cc004){return pm2['list'](function(_0x2b4e94,_0x2233dd){if(_0x2b4e94){return _0x4cc004(_0x2b4e94);}pm2[_0x7995('0x8')]();return _0x2bbe7a(_0x2233dd);});});});};exports[_0x7995('0xb')]=function(_0x3f1d3e){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2202ce,_0x41cbf0){return pm2['describe'](_0x3f1d3e,function(_0x2eeacc,_0x565d97){if(_0x2eeacc){return _0x41cbf0(_0x2eeacc);}pm2[_0x7995('0x8')]();return _0x2202ce(_0x565d97);});});});};exports[_0x7995('0xc')]=function(_0x43d4b8){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1e1415,_0x37a7d4){return pm2['delete'](_0x43d4b8,function(_0x54c9ae,_0x2536c8){if(_0x54c9ae){return _0x37a7d4(_0x54c9ae);}pm2['disconnect']();return _0x1e1415(_0x2536c8);});});});};exports['dump']=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x3d463e,_0x4cbe10){return pm2[_0x7995('0xd')](function(_0x51f276){if(_0x51f276){return _0x4cbe10(_0x51f276);}return _0x3d463e('saved');});});});}; \ No newline at end of file +var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c1bd5cd..d91af51 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 _0x31af=['redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','../../mysqldb','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31af,0x7f));var _0xf31a=function(_0x6b9481,_0x5061ec){_0x6b9481=_0x6b9481-0x0;var _0x5e161f=_0x31af[_0x6b9481];return _0x5e161f;};'use strict';var _=require(_0xf31a('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require(_0xf31a('0x1'))['db'];var config=require(_0xf31a('0x2'));config[_0xf31a('0x3')]=_['defaults'](config[_0xf31a('0x3')],{'host':_0xf31a('0x4'),'port':0x18eb});var io=require(_0xf31a('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x17530b=0x0;var _0x5b56de=[];return db[_0xf31a('0x6')][_0xf31a('0x7')]({'raw':!![],'attributes':['id',_0xf31a('0x8')],'where':{'id':0x1}})[_0xf31a('0x9')](function(_0x5c5e4d){_0x17530b=_0x5c5e4d[_0xf31a('0x8')];if(_0x17530b){return db[_0xf31a('0xa')][_0xf31a('0xb')]({'raw':!![],'attributes':['id',_0xf31a('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf31a('0xd')](_0x5c5e4d['chatTimeout'],'minutes')}}});}else{return[];}})[_0xf31a('0x9')](function(_0x31347b){_0x5b56de=_0x31347b;if(_0x17530b){return db['ChatInteraction'][_0xf31a('0xe')]({'closeReason':_0xf31a('0xf'),'disposition':_0xf31a('0x10'),'closed':!![],'closedAt':moment()[_0xf31a('0x11')](_0xf31a('0x12'))},{'where':{'id':_[_0xf31a('0x13')](_0x5b56de||[],'id')}});}})[_0xf31a('0x9')](function(_0x3061aa){for(var _0x26808c=0x0;_0x26808c<_0x5b56de[_0xf31a('0x14')];_0x26808c++){io[_0xf31a('0x15')](_0xf31a('0x16'),{'id':_0x5b56de[_0x26808c]['id'],'closed':!![]});}})[_0xf31a('0x17')](function(_0x2b497e){console[_0xf31a('0x18')](_0x2b497e);});}exports[_0xf31a('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x115a=['update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','defaults','localhost','socket.io-emitter','redis','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes'];(function(_0x3a1b19,_0xa8744b){var _0x29b39d=function(_0x1410c3){while(--_0x1410c3){_0x3a1b19['push'](_0x3a1b19['shift']());}};_0x29b39d(++_0xa8744b);}(_0x115a,0x91));var _0xa115=function(_0x29cb5d,_0x3d90a0){_0x29cb5d=_0x29cb5d-0x0;var _0x213ec0=_0x115a[_0x29cb5d];return _0x213ec0;};'use strict';var _=require(_0xa115('0x0'));var moment=require(_0xa115('0x1'));var Redis=require(_0xa115('0x2'));var db=require(_0xa115('0x3'))['db'];var config=require(_0xa115('0x4'));config['redis']=_[_0xa115('0x5')](config['redis'],{'host':_0xa115('0x6'),'port':0x18eb});var io=require(_0xa115('0x7'))(new Redis(config[_0xa115('0x8')]));function closeInteractions(){var _0x40901a=0x0;var _0x1ab6f9=[];return db[_0xa115('0x9')]['find']({'raw':!![],'attributes':['id',_0xa115('0xa')],'where':{'id':0x1}})[_0xa115('0xb')](function(_0x291bec){_0x40901a=_0x291bec[_0xa115('0xa')];if(_0x40901a){return db[_0xa115('0xc')][_0xa115('0xd')]({'raw':!![],'attributes':['id',_0xa115('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa115('0xf')](_0x291bec[_0xa115('0xa')],_0xa115('0x10'))}}});}else{return[];}})[_0xa115('0xb')](function(_0x5683d6){_0x1ab6f9=_0x5683d6;if(_0x40901a){return db[_0xa115('0xc')][_0xa115('0x11')]({'closeReason':_0xa115('0x12'),'disposition':_0xa115('0x13'),'closed':!![],'closedAt':moment()['format'](_0xa115('0x14'))},{'where':{'id':_[_0xa115('0x15')](_0x1ab6f9||[],'id')}});}})[_0xa115('0xb')](function(_0x279a25){for(var _0xf71f3e=0x0;_0xf71f3e<_0x1ab6f9[_0xa115('0x16')];_0xf71f3e++){io[_0xa115('0x17')]('chatInteraction:update',{'id':_0x1ab6f9[_0xf71f3e]['id'],'closed':!![]});}})[_0xa115('0x18')](function(_0x427cd9){console[_0xa115('0x19')](_0x427cd9);});}exports[_0xa115('0x1a')]=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 e9129f9..2d3dd77 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 _0x5607=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','difference','length','exists','stop','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','run','path','lodash','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x5607,0x8f));var _0x7560=function(_0x4a648,_0x271276){_0x4a648=_0x4a648-0x0;var _0x2aafa6=_0x5607[_0x4a648];return _0x2aafa6;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x7560('0x0'));var _=require(_0x7560('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x7560('0x2'));var BPromise=require('bluebird');var logger=require(_0x7560('0x3'))(_0x7560('0x4'));var db=require(_0x7560('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7560('0x6'));var client=jayson[_0x7560('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5d7aa7,_0x3625bc){return function(){logger['info'](_0x7560('0x8'),_0x5d7aa7['email']);var _0x38bc22=!![];var _0x20de26={'tls':{'rejectUnauthorized':![]}};if(_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')]['service']){_0x20de26[_0x7560('0xb')]=_0x5d7aa7[_0x7560('0x9')]['Smtp'][_0x7560('0xb')];}else{_0x20de26[_0x7560('0xc')]=_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')]['host'];_0x20de26[_0x7560('0xd')]=_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')][_0x7560('0xd')];_0x20de26[_0x7560('0xe')]=_0x5d7aa7['MailAccount'][_0x7560('0xa')]['secure'];}if(_0x5d7aa7['MailAccount'][_0x7560('0xa')][_0x7560('0xf')]){_0x20de26[_0x7560('0x10')]={'user':_0x5d7aa7[_0x7560('0x9')]['Smtp'][_0x7560('0x11')],'pass':_0x5d7aa7['MailAccount']['Smtp'][_0x7560('0x12')]};}var _0x314b63={'account':_0x20de26,'message':{'from':util[_0x7560('0x13')](_0x7560('0x14'),_0x5d7aa7[_0x7560('0x9')][_0x7560('0x15')],_0x5d7aa7[_0x7560('0x9')][_0x7560('0x16')]||_0x5d7aa7[_0x7560('0x9')]['Smtp']['user']),'to':_0x5d7aa7[_0x7560('0x16')],'cc':_0x5d7aa7['cc'],'bcc':_0x5d7aa7[_0x7560('0x17')],'subject':util[_0x7560('0x13')](_0x7560('0x18'),_0x3625bc[_0x7560('0x15')],_0x5d7aa7[_0x7560('0x19')],_0x5d7aa7[_0x7560('0x1a')])}};var _0x482d5e=path[_0x7560('0x1b')](__dirname,_0x7560('0x1c'));var _0x320df1=_0x3625bc[_0x7560('0x1d')];var _0x3a290b=util['format'](_0x7560('0x1e'),path['basename'](_0x3625bc[_0x7560('0x1d')],path[_0x7560('0x1f')](_0x3625bc[_0x7560('0x1d')])),_0x7560('0x20'));var _0x3b74eb=path['join'](_0x482d5e,_0x320df1);var _0x4427f1=path[_0x7560('0x1b')](_0x482d5e,_0x3a290b);if(fs[_0x7560('0x21')](_0x3b74eb)){_0x3625bc[_0x7560('0x22')]='Sent';_0x314b63[_0x7560('0x23')][_0x7560('0x24')]=[{'filename':_0x320df1,'path':_0x3b74eb}];_0x314b63['message'][_0x7560('0x25')]=util[_0x7560('0x13')](_0x7560('0x26'),JSON['stringify'](_0x3625bc,null,0x2));}else if(fs[_0x7560('0x21')](_0x4427f1)){_0x3625bc[_0x7560('0x22')]='Sent';_0x314b63['message'][_0x7560('0x24')]=[{'filename':_0x3a290b,'path':_0x4427f1}];}else{_0x314b63['message'][_0x7560('0x25')]=_0x7560('0x27');if(!_0x5d7aa7[_0x7560('0x28')]){_0x38bc22=![];logger[_0x7560('0x29')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x38bc22){return client[_0x7560('0x2a')](_0x7560('0x2b'),_0x314b63)[_0x7560('0x2c')](function(_0x4d8a78){if(_0x4d8a78[_0x7560('0x2d')]){return logger[_0x7560('0x2d')](_0x7560('0x2e'),JSON[_0x7560('0x2f')](_0x4d8a78));}return logger['info']('email\x20sent');})[_0x7560('0x30')](function(_0x3234aa){return logger['error'](_0x7560('0x2e'),JSON[_0x7560('0x2f')](_0x3234aa));});}};}function handleError(){return function(_0x58bbff){return logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x58bbff));};}function handleResult(_0x340286){return function(_0x219e63){logger[_0x7560('0x29')](_0x7560('0x31'),JSON['stringify'](_0x219e63));if(_0x340286[_0x7560('0x9')]&&_0x340286[_0x7560('0x9')][_0x7560('0xa')]&&!_['isNil'](_0x340286[_0x7560('0x16')])){setTimeout(handleSendEmail(_0x340286,_0x219e63),0x3c*0x3e8);}};}function handleJob(_0x23444f){return function(){try{if(_[_0x7560('0x32')](_0x23444f['subtractNumber'])){return logger[_0x7560('0x29')](_0x7560('0x33'));}if(_[_0x7560('0x32')](_0x23444f['subtractUnit'])){return logger['info'](_0x7560('0x34'));}var _0x2de3ca={'startDate':moment()[_0x7560('0x35')](_0x23444f[_0x7560('0x19')],_0x23444f[_0x7560('0x1a')])[_0x7560('0x13')](_0x7560('0x36')),'endDate':moment()[_0x7560('0x13')](_0x7560('0x36')),'type':'scheduled','output':_0x23444f[_0x7560('0x37')],'name':_0x23444f[_0x7560('0x15')]};if(!_['isNil'](_0x23444f[_0x7560('0x38')])){logger[_0x7560('0x29')](_0x7560('0x39'),_0x23444f[_0x7560('0x38')]);return analyticDefaultReportController[_0x7560('0x3a')]({'id':_0x23444f[_0x7560('0x38')]},_0x2de3ca)[_0x7560('0x2c')](handleResult(_0x23444f))[_0x7560('0x30')](handleError());}if(!_[_0x7560('0x32')](_0x23444f[_0x7560('0x3b')])){logger[_0x7560('0x29')](_0x7560('0x3c'),_0x23444f[_0x7560('0x3b')]);return analyticCustomReportController[_0x7560('0x3a')]({'id':_0x23444f[_0x7560('0x3b')]},_0x2de3ca)[_0x7560('0x2c')](handleResult(_0x23444f))[_0x7560('0x30')](handleError());}}catch(_0x33c6f6){logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x33c6f6));}return logger[_0x7560('0x29')](_0x7560('0x3d'));};}function getJobs(_0x5d3913){var _0x2a572b={};if(_0x5d3913){_0x2a572b['id']=_0x5d3913;}return db[_0x7560('0x3e')][_0x7560('0x3f')]({'where':_0x2a572b,'include':[{'model':db[_0x7560('0x9')],'attributes':['id',_0x7560('0x15'),_0x7560('0x16')],'include':[{'model':db[_0x7560('0x40')],'as':_0x7560('0xa')}]}]})['then'](function(_0x140239){var _0x2d42c6=_[_0x7560('0x41')](manager[_0x7560('0x42')]);var _0x32ece1=_[_0x7560('0x43')](_0x140239,function(_0x3dd05b){return _0x3dd05b['id'][_0x7560('0x44')]();});var _0x49d614=_['keyBy'](_0x140239,function(_0x5d605b){return _0x5d605b['id'][_0x7560('0x44')]();});var _0x29b97f=_0x5d3913?_0x32ece1:_['difference'](_0x32ece1,_0x2d42c6);var _0xd4ece2=_[_0x7560('0x45')](_0x32ece1,_0x2d42c6);var _0x2f41e4=_[_0x7560('0x46')](_0x2d42c6,_0x32ece1);var _0x1166b1;var _0x5334a4;for(_0x1166b1=0x0;_0x1166b1<_0x2f41e4[_0x7560('0x47')]&&!_0x5d3913;_0x1166b1+=0x1){_0x5334a4=_0x2f41e4[_0x1166b1]['toString']();if(manager[_0x7560('0x48')](_0x5334a4)){manager[_0x7560('0x49')](_0x5334a4);manager['deleteJob'](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x4a'),_0x5334a4);}}logger['info']('toRun',JSON['stringify'](_0x29b97f));for(_0x1166b1=0x0;_0x1166b1<_0x29b97f[_0x7560('0x47')];_0x1166b1+=0x1){_0x5334a4=_0x29b97f[_0x1166b1][_0x7560('0x44')]();logger[_0x7560('0x29')]('index',_0x5334a4);if(_0x5d3913){logger[_0x7560('0x29')](_0x7560('0x4b'),_0x5d3913);logger[_0x7560('0x29')](JSON['stringify'](_0x49d614[_0x5334a4]));BPromise[_0x7560('0x4c')]()['then'](handleJob(_0x49d614[_0x5334a4]));logger[_0x7560('0x29')](_0x7560('0x4d'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4][_0x7560('0x4e')]);}else if(_0x49d614[_0x5334a4]['cron']&&_0x49d614[_0x5334a4][_0x7560('0x4f')]&&moment()[_0x7560('0x50')](_0x49d614[_0x5334a4][_0x7560('0x51')],_0x49d614[_0x5334a4][_0x7560('0x52')])){manager[_0x7560('0x53')](_0x5334a4,_0x49d614[_0x5334a4][_0x7560('0x4e')],handleJob(_0x49d614[_0x5334a4]));manager[_0x7560('0x54')](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x55'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4][_0x7560('0x4e')]);}else if(manager[_0x7560('0x48')](_0x5334a4)){manager[_0x7560('0x49')](_0x5334a4);manager[_0x7560('0x56')](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x57'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}}for(_0x1166b1=0x0,_0x5334a4;_0x1166b1<_0xd4ece2[_0x7560('0x47')]&&!_0x5d3913;_0x1166b1+=0x1){_0x5334a4=_0xd4ece2[_0x1166b1]['toString']();if(manager[_0x7560('0x48')](_0x5334a4)){if(_0x49d614[_0x5334a4][_0x7560('0x4e')]&&_0x49d614[_0x5334a4][_0x7560('0x4f')]&&moment()[_0x7560('0x50')](_0x49d614[_0x5334a4]['startAt'],_0x49d614[_0x5334a4][_0x7560('0x52')])){manager[_0x7560('0x58')](_0x5334a4,_0x49d614[_0x5334a4][_0x7560('0x4e')],handleJob(_0x49d614[_0x5334a4]));logger[_0x7560('0x29')](_0x7560('0x59'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}else{manager[_0x7560('0x49')](_0x5334a4);manager['deleteJob'](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x57'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}}}})[_0x7560('0x30')](function(_0x441a13){logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x441a13));});}exports[_0x7560('0x5a')]=function(_0x57b913){return getJobs(_0x57b913);};exports[_0x7560('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x87fe=['then','error','error\x20mail','info','email\x20sent','stringify','data','isNil','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','exists','stop','stop\x20cron','length','update','update\x20cron','deleteJob','run','lodash','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail'];(function(_0x12e007,_0x51646d){var _0x139821=function(_0x27d854){while(--_0x27d854){_0x12e007['push'](_0x12e007['shift']());}};_0x139821(++_0x51646d);}(_0x87fe,0x1ec));var _0xe87f=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x87fe[_0x2eac4f];return _0x58f73b;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xe87f('0x0'));var moment=require('moment');var CronJobManager=require(_0xe87f('0x1'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xe87f('0x2'))(_0xe87f('0x3'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe87f('0x4'));var analyticDefaultReportController=require(_0xe87f('0x5'));var client=jayson[_0xe87f('0x6')][_0xe87f('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xcf6fa6,_0x383a16){return function(){logger['info'](_0xe87f('0x8'),_0xcf6fa6[_0xe87f('0x9')]);var _0x11cfd9=!![];var _0x11d8dd={'tls':{'rejectUnauthorized':![]}};if(_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')]['service']){_0x11d8dd[_0xe87f('0xc')]=_0xcf6fa6['MailAccount'][_0xe87f('0xb')][_0xe87f('0xc')];}else{_0x11d8dd[_0xe87f('0xd')]=_0xcf6fa6['MailAccount'][_0xe87f('0xb')][_0xe87f('0xd')];_0x11d8dd[_0xe87f('0xe')]=_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')][_0xe87f('0xe')];_0x11d8dd[_0xe87f('0xf')]=_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')]['secure'];}if(_0xcf6fa6[_0xe87f('0xa')]['Smtp']['authentication']){_0x11d8dd['auth']={'user':_0xcf6fa6['MailAccount'][_0xe87f('0xb')]['user'],'pass':_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0xb')][_0xe87f('0x10')]};}var _0x30341d={'account':_0x11d8dd,'message':{'from':util['format'](_0xe87f('0x11'),_0xcf6fa6['MailAccount'][_0xe87f('0x12')],_0xcf6fa6[_0xe87f('0xa')][_0xe87f('0x9')]||_0xcf6fa6[_0xe87f('0xa')]['Smtp'][_0xe87f('0x13')]),'to':_0xcf6fa6['email'],'cc':_0xcf6fa6['cc'],'bcc':_0xcf6fa6[_0xe87f('0x14')],'subject':util[_0xe87f('0x15')](_0xe87f('0x16'),_0x383a16[_0xe87f('0x12')],_0xcf6fa6[_0xe87f('0x17')],_0xcf6fa6[_0xe87f('0x18')])}};var _0x2ba261=path[_0xe87f('0x19')](__dirname,'../../files/reports');var _0x1dcc91=_0x383a16[_0xe87f('0x1a')];var _0x25c71d=util[_0xe87f('0x15')](_0xe87f('0x1b'),path[_0xe87f('0x1c')](_0x383a16['savename'],path[_0xe87f('0x1d')](_0x383a16[_0xe87f('0x1a')])),_0xe87f('0x1e'));var _0x2965dd=path['join'](_0x2ba261,_0x1dcc91);var _0x1c96f9=path[_0xe87f('0x19')](_0x2ba261,_0x25c71d);if(fs[_0xe87f('0x1f')](_0x2965dd)){_0x383a16['status']=_0xe87f('0x20');_0x30341d[_0xe87f('0x21')]['attachments']=[{'filename':_0x1dcc91,'path':_0x2965dd}];_0x30341d[_0xe87f('0x21')][_0xe87f('0x22')]=util[_0xe87f('0x15')](_0xe87f('0x23'),JSON['stringify'](_0x383a16,null,0x2));}else if(fs[_0xe87f('0x1f')](_0x1c96f9)){_0x383a16[_0xe87f('0x24')]=_0xe87f('0x20');_0x30341d[_0xe87f('0x21')][_0xe87f('0x25')]=[{'filename':_0x25c71d,'path':_0x1c96f9}];}else{_0x30341d[_0xe87f('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xcf6fa6[_0xe87f('0x26')]){_0x11cfd9=![];logger['info'](_0xe87f('0x27'));}}if(_0x11cfd9){return client[_0xe87f('0x28')](_0xe87f('0x29'),_0x30341d)[_0xe87f('0x2a')](function(_0x56e7bc){if(_0x56e7bc[_0xe87f('0x2b')]){return logger[_0xe87f('0x2b')](_0xe87f('0x2c'),JSON['stringify'](_0x56e7bc));}return logger[_0xe87f('0x2d')](_0xe87f('0x2e'));})['catch'](function(_0x3feb55){return logger['error'](_0xe87f('0x2c'),JSON['stringify'](_0x3feb55));});}};}function handleError(){return function(_0xab30fa){return logger['error'](JSON[_0xe87f('0x2f')](_0xab30fa));};}function handleResult(_0x3645d1){return function(_0xe1a279){logger[_0xe87f('0x2d')](_0xe87f('0x30'),JSON[_0xe87f('0x2f')](_0xe1a279));if(_0x3645d1[_0xe87f('0xa')]&&_0x3645d1[_0xe87f('0xa')][_0xe87f('0xb')]&&!_[_0xe87f('0x31')](_0x3645d1[_0xe87f('0x9')])){setTimeout(handleSendEmail(_0x3645d1,_0xe1a279),0x3c*0x3e8);}};}function handleJob(_0x4cb83a){return function(){try{if(_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x17')])){return logger[_0xe87f('0x2d')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x18')])){return logger[_0xe87f('0x2d')]('subtractUnit\x20null\x20or\x20undefined');}var _0xeac7d4={'startDate':moment()['subtract'](_0x4cb83a['subtractNumber'],_0x4cb83a[_0xe87f('0x18')])[_0xe87f('0x15')](_0xe87f('0x32')),'endDate':moment()[_0xe87f('0x15')](_0xe87f('0x32')),'type':_0xe87f('0x33'),'output':_0x4cb83a[_0xe87f('0x34')],'name':_0x4cb83a[_0xe87f('0x12')]};if(!_['isNil'](_0x4cb83a[_0xe87f('0x35')])){logger[_0xe87f('0x2d')](_0xe87f('0x36'),_0x4cb83a[_0xe87f('0x35')]);return analyticDefaultReportController[_0xe87f('0x37')]({'id':_0x4cb83a['DefaultReportId']},_0xeac7d4)[_0xe87f('0x2a')](handleResult(_0x4cb83a))['catch'](handleError());}if(!_[_0xe87f('0x31')](_0x4cb83a[_0xe87f('0x38')])){logger[_0xe87f('0x2d')]('exec\x20custom\x20report\x20id:%s',_0x4cb83a[_0xe87f('0x38')]);return analyticCustomReportController['runReport']({'id':_0x4cb83a[_0xe87f('0x38')]},_0xeac7d4)[_0xe87f('0x2a')](handleResult(_0x4cb83a))[_0xe87f('0x39')](handleError());}}catch(_0x4b0a0d){logger[_0xe87f('0x2b')](JSON[_0xe87f('0x2f')](_0x4b0a0d));}return logger[_0xe87f('0x2d')](_0xe87f('0x3a'));};}function getJobs(_0x4839a5){var _0x51e95a={};if(_0x4839a5){_0x51e95a['id']=_0x4839a5;}return db[_0xe87f('0x3b')][_0xe87f('0x3c')]({'where':_0x51e95a,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe87f('0x12'),_0xe87f('0x9')],'include':[{'model':db[_0xe87f('0x3d')],'as':_0xe87f('0xb')}]}]})[_0xe87f('0x2a')](function(_0x2ecd3f){var _0x197a96=_[_0xe87f('0x3e')](manager[_0xe87f('0x3f')]);var _0xd9d4df=_[_0xe87f('0x40')](_0x2ecd3f,function(_0x1eec37){return _0x1eec37['id'][_0xe87f('0x41')]();});var _0x1e4f36=_[_0xe87f('0x42')](_0x2ecd3f,function(_0x2d66c4){return _0x2d66c4['id'][_0xe87f('0x41')]();});var _0x393fb1=_0x4839a5?_0xd9d4df:_[_0xe87f('0x43')](_0xd9d4df,_0x197a96);var _0x3eca72=_[_0xe87f('0x44')](_0xd9d4df,_0x197a96);var _0x308aeb=_[_0xe87f('0x43')](_0x197a96,_0xd9d4df);var _0x11d98e;var _0x2416cc;for(_0x11d98e=0x0;_0x11d98e<_0x308aeb['length']&&!_0x4839a5;_0x11d98e+=0x1){_0x2416cc=_0x308aeb[_0x11d98e][_0xe87f('0x41')]();if(manager['exists'](_0x2416cc)){manager['stop'](_0x2416cc);manager['deleteJob'](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x45'),_0x2416cc);}}logger[_0xe87f('0x2d')](_0xe87f('0x46'),JSON['stringify'](_0x393fb1));for(_0x11d98e=0x0;_0x11d98e<_0x393fb1['length'];_0x11d98e+=0x1){_0x2416cc=_0x393fb1[_0x11d98e][_0xe87f('0x41')]();logger['info']('index',_0x2416cc);if(_0x4839a5){logger[_0xe87f('0x2d')](_0xe87f('0x47'),_0x4839a5);logger[_0xe87f('0x2d')](JSON[_0xe87f('0x2f')](_0x1e4f36[_0x2416cc]));BPromise[_0xe87f('0x48')]()[_0xe87f('0x2a')](handleJob(_0x1e4f36[_0x2416cc]));logger[_0xe87f('0x2d')]('run\x20job',_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}else if(_0x1e4f36[_0x2416cc][_0xe87f('0x49')]&&_0x1e4f36[_0x2416cc][_0xe87f('0x4a')]&&moment()[_0xe87f('0x4b')](_0x1e4f36[_0x2416cc][_0xe87f('0x4c')],_0x1e4f36[_0x2416cc][_0xe87f('0x4d')])){manager[_0xe87f('0x4e')](_0x2416cc,_0x1e4f36[_0x2416cc][_0xe87f('0x49')],handleJob(_0x1e4f36[_0x2416cc]));manager[_0xe87f('0x4f')](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x50'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}else if(manager[_0xe87f('0x51')](_0x2416cc)){manager[_0xe87f('0x52')](_0x2416cc);manager['deleteJob'](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x53'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}}for(_0x11d98e=0x0,_0x2416cc;_0x11d98e<_0x3eca72[_0xe87f('0x54')]&&!_0x4839a5;_0x11d98e+=0x1){_0x2416cc=_0x3eca72[_0x11d98e][_0xe87f('0x41')]();if(manager[_0xe87f('0x51')](_0x2416cc)){if(_0x1e4f36[_0x2416cc]['cron']&&_0x1e4f36[_0x2416cc]['active']&&moment()['isBetween'](_0x1e4f36[_0x2416cc][_0xe87f('0x4c')],_0x1e4f36[_0x2416cc][_0xe87f('0x4d')])){manager[_0xe87f('0x55')](_0x2416cc,_0x1e4f36[_0x2416cc][_0xe87f('0x49')],handleJob(_0x1e4f36[_0x2416cc]));logger[_0xe87f('0x2d')](_0xe87f('0x56'),_0x1e4f36[_0x2416cc]['name'],_0x1e4f36[_0x2416cc]['cron']);}else{manager[_0xe87f('0x52')](_0x2416cc);manager[_0xe87f('0x57')](_0x2416cc);logger[_0xe87f('0x2d')](_0xe87f('0x53'),_0x1e4f36[_0x2416cc][_0xe87f('0x12')],_0x1e4f36[_0x2416cc][_0xe87f('0x49')]);}}}})[_0xe87f('0x39')](function(_0x3f48a6){logger[_0xe87f('0x2b')](JSON[_0xe87f('0x2f')](_0x3f48a6));});}exports[_0xe87f('0x58')]=function(_0x18b045){return getJobs(_0x18b045);};exports[_0xe87f('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 337bbc9..9d68ed5 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c49=['Innocenzo','@xcally.com','now','innocenzo.biondo','push','CmContact','destroy','then','bulkCreate','log','contacts1','hopper1','finished\x20populating','contacts2','CmHopper','catch','util','../mysqldb'];(function(_0xff7c05,_0x2456ca){var _0x1c1ab9=function(_0x187d56){while(--_0x187d56){_0xff7c05['push'](_0xff7c05['shift']());}};_0x1c1ab9(++_0x2456ca);}(_0x2c49,0x142));var _0x92c4=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x2c49[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require(_0x92c4('0x0'));var db=require(_0x92c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x92c4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x92c4('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x92c4('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x92c4('0x4')](),'updatedAt':Date[_0x92c4('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x92c4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x92c4('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x92c4('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x92c4('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x92c4('0x4')](),'updatedAt':Date[_0x92c4('0x4')]()});}db[_0x92c4('0x7')][_0x92c4('0x8')]({'where':{}})[_0x92c4('0x9')](function(){return db[_0x92c4('0x7')][_0x92c4('0xa')](contacts);})['then'](function(){console[_0x92c4('0xb')]('finished\x20populating',_0x92c4('0xc'));return db['CmHopper'][_0x92c4('0x8')]({'where':{}});})[_0x92c4('0x9')](function(){return db['CmHopper'][_0x92c4('0xa')](hopper);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')]('finished\x20populating',_0x92c4('0xd'));return db[_0x92c4('0x7')][_0x92c4('0xa')](contacts2);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')](_0x92c4('0xe'),_0x92c4('0xf'));return db[_0x92c4('0x10')][_0x92c4('0xa')](hopper2);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')](_0x92c4('0xe'),'hopper2');})[_0x92c4('0x11')](function(_0x4aab0c){console[_0x92c4('0xb')](_0x4aab0c);}); \ No newline at end of file +var _0xb9f6=['CmContact','bulkCreate','log','finished\x20populating','contacts1','destroy','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then'];(function(_0x5668a3,_0x363bf2){var _0x15b01e=function(_0x1b848b){while(--_0x1b848b){_0x5668a3['push'](_0x5668a3['shift']());}};_0x15b01e(++_0x363bf2);}(_0xb9f6,0x1c2));var _0x6b9f=function(_0x37a87a,_0x45f496){_0x37a87a=_0x37a87a-0x0;var _0x3b7124=_0xb9f6[_0x37a87a];return _0x3b7124;};'use strict';var util=require(_0x6b9f('0x0'));var db=require(_0x6b9f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6b9f('0x2')]({'id':i,'firstName':_0x6b9f('0x3')+i,'lastName':_0x6b9f('0x4')+i,'phone':0xf879fb460+i,'email':_0x6b9f('0x5')+i+_0x6b9f('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6b9f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b9f('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x6b9f('0x3')+i,'lastName':_0x6b9f('0x4')+i,'phone':0xf879fb460+i,'email':_0x6b9f('0x5')+i+_0x6b9f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6b9f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6b9f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b9f('0x7')](),'updatedAt':Date[_0x6b9f('0x7')]()});}db['CmContact']['destroy']({'where':{}})[_0x6b9f('0x8')](function(){return db[_0x6b9f('0x9')][_0x6b9f('0xa')](contacts);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')](_0x6b9f('0xc'),_0x6b9f('0xd'));return db['CmHopper'][_0x6b9f('0xe')]({'where':{}});})[_0x6b9f('0x8')](function(){return db['CmHopper'][_0x6b9f('0xa')](hopper);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')]('finished\x20populating','hopper1');return db[_0x6b9f('0x9')][_0x6b9f('0xa')](contacts2);})[_0x6b9f('0x8')](function(){console[_0x6b9f('0xb')]('finished\x20populating','contacts2');return db['CmHopper'][_0x6b9f('0xa')](hopper2);})['then'](function(){console['log'](_0x6b9f('0xc'),_0x6b9f('0xf'));})[_0x6b9f('0x10')](function(_0x328ec8){console[_0x6b9f('0xb')](_0x328ec8);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 07805ca..84c021c 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ade=['format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push'];(function(_0x19b0e2,_0x2670a6){var _0x3c9f7e=function(_0x55c440){while(--_0x55c440){_0x19b0e2['push'](_0x19b0e2['shift']());}};_0x3c9f7e(++_0x2670a6);}(_0x9ade,0x19c));var _0xe9ad=function(_0x4b88f8,_0x20ae18){_0x4b88f8=_0x4b88f8-0x0;var _0x15ecc5=_0x9ade[_0x4b88f8];return _0x15ecc5;};'use strict';var util=require(_0xe9ad('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe9ad('0x1')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0xe9ad('0x2')](_0xe9ad('0x3'),_0xe9ad('0x4'),i),'email':util[_0xe9ad('0x2')](_0xe9ad('0x5'),'agent',i),'role':_0xe9ad('0x4'),'password':_0xe9ad('0x6'),'internal':0xfa0+i,'type':_0xe9ad('0x7'),'transport':[_0xe9ad('0x8'),'ws',_0xe9ad('0x9')],'disallow':[_0xe9ad('0xa')],'allow':[_0xe9ad('0xb')],'defaultuser':util[_0xe9ad('0x2')]('%s%s','agent',i),'encryption':'yes','avpf':'yes','force_avp':_0xe9ad('0xc'),'icesupport':_0xe9ad('0xc'),'dtlsenable':_0xe9ad('0xc'),'dtlsverify':'no','dtlscertfile':_0xe9ad('0xd'),'dtlsprivatekey':_0xe9ad('0xe'),'dtlssetup':_0xe9ad('0xf'),'callerid':util[_0xe9ad('0x2')](_0xe9ad('0x10'),util['format']('%s%s',_0xe9ad('0x4'),i),0xfa0+i)});}db[_0xe9ad('0x11')][_0xe9ad('0x12')](users)[_0xe9ad('0x13')](function(){console[_0xe9ad('0x14')](_0xe9ad('0x15'));})[_0xe9ad('0x16')](function(_0x27eb2f){console[_0xe9ad('0x14')](_0x27eb2f);}); \ No newline at end of file +var _0x4a98=['udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','password','friend'];(function(_0x3b286e,_0x5c6129){var _0x428189=function(_0x5ed38b){while(--_0x5ed38b){_0x3b286e['push'](_0x3b286e['shift']());}};_0x428189(++_0x5c6129);}(_0x4a98,0x160));var _0x84a9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4a98[_0x5d2803];return _0xdcad2c;};'use strict';var util=require(_0x84a9('0x0'));var db=require(_0x84a9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x84a9('0x2')]({'name':util[_0x84a9('0x3')](_0x84a9('0x4'),_0x84a9('0x5'),i),'fullname':util[_0x84a9('0x3')](_0x84a9('0x4'),'agent',i),'email':util[_0x84a9('0x3')]('%s%s@xcally.com',_0x84a9('0x5'),i),'role':_0x84a9('0x5'),'password':_0x84a9('0x6'),'internal':0xfa0+i,'type':_0x84a9('0x7'),'transport':[_0x84a9('0x8'),'ws',_0x84a9('0x9')],'disallow':[_0x84a9('0xa')],'allow':['ulaw'],'defaultuser':util[_0x84a9('0x3')](_0x84a9('0x4'),'agent',i),'encryption':_0x84a9('0xb'),'avpf':'yes','force_avp':_0x84a9('0xb'),'icesupport':_0x84a9('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x84a9('0xc'),'dtlsprivatekey':_0x84a9('0xd'),'dtlssetup':'actpass','callerid':util[_0x84a9('0x3')](_0x84a9('0xe'),util['format'](_0x84a9('0x4'),'agent',i),0xfa0+i)});}db[_0x84a9('0xf')][_0x84a9('0x10')](users)[_0x84a9('0x11')](function(){console[_0x84a9('0x12')](_0x84a9('0x13'));})['catch'](function(_0x3ececd){console[_0x84a9('0x12')](_0x3ececd);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 31368e6..a15d0f7 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d02=['UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','user:%s','handshake','query','userProfileId','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteractions','voice:inbound','voice:outbound','include','VoiceQueue','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','voice','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','nsp','address','disconnect','util','bluebird','../mysqldb','./environment','User','name','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','findAll','Telephones','Trunks','IvrCampaigns'];(function(_0x3b9088,_0x2d7ad3){var _0x42201b=function(_0x3dd7e8){while(--_0x3dd7e8){_0x3b9088['push'](_0x3b9088['shift']());}};_0x42201b(++_0x2d7ad3);}(_0x7d02,0x193));var _0x27d0=function(_0x4777e9,_0x3a944f){_0x4777e9=_0x4777e9-0x0;var _0x411e09=_0x7d02[_0x4777e9];return _0x411e09;};'use strict';var _=require('lodash');var util=require(_0x27d0('0x0'));var BPromise=require(_0x27d0('0x1'));var db=require(_0x27d0('0x2'))['db'];var config=require(_0x27d0('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x27d0('0x4')],'attributes':['id',_0x27d0('0x5'),_0x27d0('0x6')],'raw':!![],'where':{'role':_0x27d0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x27d0('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x27d0('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x27d0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x27d0('0x5'),_0x27d0('0x8')],'where':{'type':_0x27d0('0x9')}};function getAssociatedResources(_0x1c440d,_0x561e10,_0x4921da){return db[_0x27d0('0xa')][_0x27d0('0xb')]({'where':{'name':_0x1c440d,'userProfileId':_0x561e10},'raw':!![]})[_0x27d0('0xc')](function(_0x4d8df8){if(_0x4d8df8){if(_0x4d8df8[_0x27d0('0xd')]){switch(_0x1c440d){case _0x27d0('0xe'):case _0x27d0('0xf'):case _0x27d0('0x10'):case _0x27d0('0x11'):case'MailQueues':case'OpenchannelQueues':return db[_0x4921da][_0x27d0('0x12')](queryQueues);case _0x27d0('0x13'):return db[_0x4921da]['findAll'](queryTelephones);case _0x27d0('0x14'):return db[_0x4921da][_0x27d0('0x12')](queryTrunks);case _0x27d0('0x15'):return db[_0x4921da][_0x27d0('0x12')](queryCampaigns);}}else{return db[_0x27d0('0x16')][_0x27d0('0x12')]({'attributes':[_0x27d0('0x17')],'where':{'sectionId':_0x4d8df8['id']},'raw':!![]})['then'](function(_0x1413b2){if(_0x1413b2){var _0x452a2d={'where':{'id':_[_0x27d0('0x18')](_0x1413b2,'resourceId')},'raw':!![]};switch(_0x4921da){case _0x27d0('0x4'):_0x452a2d[_0x27d0('0x19')]['role']='telephone';break;case _0x27d0('0x1a'):_0x452a2d[_0x27d0('0x19')]['type']=_0x27d0('0x9');break;}return db[_0x4921da][_0x27d0('0x12')](_0x452a2d);}else{return[];}});}}else{return[];}})['then'](function(_0x49585){return _0x49585;});}function joinOrLeaveQueues(_0x2ee937,_0x55cd40,_0x322056,_0x380bdc){_0x2ee937[_0x55cd40](util[_0x27d0('0x1b')](_0x27d0('0x1c'),_0x322056,_0x380bdc['name']));if(_0x380bdc['Agents']){for(var _0x135feb=0x0;_0x135feb<_0x380bdc[_0x27d0('0x1d')]['length'];_0x135feb+=0x1){_0x2ee937[_0x55cd40](util[_0x27d0('0x1b')](_0x27d0('0x1e'),_0x380bdc[_0x27d0('0x1d')][_0x135feb]['name']));}}}function joinOrLeave(_0x442d76,_0x435fd5,_0x2b9d8a){var _0x3c1996;if(_0x442d76[_0x27d0('0x1f')][_0x27d0('0x20')]['id']){db[_0x27d0('0x4')]['find']({'attributes':['id',_0x27d0('0x5'),_0x27d0('0x6'),_0x27d0('0x21')],'where':{'id':_0x442d76[_0x27d0('0x1f')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x27d0('0x22')],'as':_0x27d0('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x27d0('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x27d0('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x27d0('0x26'),'attributes':['id'],'raw':!![]}]})[_0x27d0('0xc')](function(_0x3d1d03){if(_0x3d1d03){_0x3c1996=_0x3d1d03;_0x442d76[_0x435fd5](util['format'](_0x27d0('0x1e'),_0x3d1d03[_0x27d0('0x5')]));var _0x31baba=[];switch(_0x3d1d03[_0x27d0('0x6')]){case'admin':_0x442d76[_0x435fd5](_0x27d0('0x27'));_0x442d76[_0x435fd5](_0x27d0('0x28'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x27d0('0x29')];}_0x31baba['push'](db[_0x27d0('0x2a')]['findAll'](queryQueues));_0x31baba[_0x27d0('0x2b')](db['ChatQueue'][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x2c')][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db['SmsQueue']['findAll'](queryQueues));_0x31baba['push'](db[_0x27d0('0x2d')][_0x27d0('0x12')](queryQueues));_0x31baba['push'](db[_0x27d0('0x2e')][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x4')][_0x27d0('0x12')](queryTelephones));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x2f')][_0x27d0('0x12')](queryTrunks));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x1a')][_0x27d0('0x12')](queryCampaigns));_0x31baba[_0x27d0('0x2b')](db['User']['findAll'](queryAgents));break;case _0x27d0('0x30'):_0x442d76[_0x435fd5](_0x27d0('0x27'));_0x442d76[_0x435fd5](_0x27d0('0x28'));_0x31baba['push'](getAssociatedResources('VoiceQueues',_0x3d1d03[_0x27d0('0x21')],_0x27d0('0x2a')));_0x31baba['push'](getAssociatedResources('ChatQueues',_0x3d1d03['userProfileId'],'ChatQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources('FaxQueues',_0x3d1d03[_0x27d0('0x21')],'FaxQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources(_0x27d0('0x11'),_0x3d1d03['userProfileId'],'SmsQueue'));_0x31baba['push'](getAssociatedResources('MailQueues',_0x3d1d03[_0x27d0('0x21')],'MailQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources('OpenchannelQueues',_0x3d1d03['userProfileId'],'OpenchannelQueue'));_0x31baba['push'](getAssociatedResources(_0x27d0('0x13'),_0x3d1d03['userProfileId'],_0x27d0('0x4')));_0x31baba['push'](getAssociatedResources(_0x27d0('0x14'),_0x3d1d03['userProfileId'],_0x27d0('0x2f')));_0x31baba['push'](getAssociatedResources(_0x27d0('0x15'),_0x3d1d03[_0x27d0('0x21')],_0x27d0('0x1a')));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x4')]['findAll'](queryAgents));break;case'agent':_0x442d76[_0x435fd5]('voice:inbound');_0x442d76[_0x435fd5](_0x27d0('0x28'));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x31')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba['push'](_0x3d1d03[_0x27d0('0x32')]({'attributes':['id','name']}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x33')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba['push'](_0x3d1d03[_0x27d0('0x34')]({'attributes':['id','name']}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x35')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x36')]({'attributes':['id',_0x27d0('0x5')]}));break;}return BPromise['all'](_0x31baba);}})[_0x27d0('0xc')](function(_0xb30d91){if(_0xb30d91&&_0xb30d91[_0x27d0('0x37')]){for(var _0x4f7b79=0x0;_0x4f7b79<_0xb30d91['length'];_0x4f7b79+=0x1){for(var _0x43df53=0x0;_0x43df53<_0xb30d91[_0x4f7b79][_0x27d0('0x37')];_0x43df53+=0x1){switch(_0x4f7b79){case 0x0:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x38'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x1:joinOrLeaveQueues(_0x442d76,_0x435fd5,'chat',_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x2:joinOrLeaveQueues(_0x442d76,_0x435fd5,'fax',_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x3:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x39'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x4:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x3a'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x5:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x3b'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x6:_0x442d76[_0x435fd5](util['format']('telephone:%s',_0xb30d91[_0x4f7b79][_0x43df53]['name']));break;case 0x7:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x3c'),_0xb30d91[_0x4f7b79][_0x43df53][_0x27d0('0x5')]));break;case 0x8:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x3d'),_0xb30d91[_0x4f7b79][_0x43df53]['type'],_0xb30d91[_0x4f7b79][_0x43df53][_0x27d0('0x5')]));break;case 0x9:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x1e'),_0xb30d91[_0x4f7b79][_0x43df53]['name']));break;}}}}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x5d23a0=_[_0x27d0('0x18')](_0x3c1996[_0x27d0('0x3f')],'id');return _0x3c1996['removeChatInteractions'](_0x5d23a0)[_0x27d0('0xc')](function(){for(var _0x50fff0=0x0;_0x50fff0<_0x5d23a0[_0x27d0('0x37')];_0x50fff0+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x41'),{'ChatInteractionId':Number(_0x5d23a0[_0x50fff0]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0xd48845=_['map'](_0x3c1996['MailInteractions'],'id');return _0x3c1996[_0x27d0('0x42')](_0xd48845)[_0x27d0('0xc')](function(){for(var _0x34c28=0x0;_0x34c28<_0xd48845['length'];_0x34c28+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x43'),{'MailInteractionId':Number(_0xd48845[_0x34c28]),'UserId':Number(_0x3c1996['id'])});}});}})['then'](function(){if(_0x435fd5==='leave'){var _0xf369c6=_[_0x27d0('0x18')](_0x3c1996[_0x27d0('0x24')],'id');return _0x3c1996['removeFaxInteractions'](_0xf369c6)[_0x27d0('0xc')](function(){for(var _0x4aa9eb=0x0;_0x4aa9eb<_0xf369c6['length'];_0x4aa9eb+=0x1){_0x2b9d8a['emit'](_0x27d0('0x44'),{'FaxInteractionId':Number(_0xf369c6[_0x4aa9eb]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x495d84=_['map'](_0x3c1996[_0x27d0('0x25')],'id');return _0x3c1996[_0x27d0('0x45')](_0x495d84)[_0x27d0('0xc')](function(){for(var _0x4e8ad1=0x0;_0x4e8ad1<_0x495d84[_0x27d0('0x37')];_0x4e8ad1+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x46'),{'SmsInteractionId':Number(_0x495d84[_0x4e8ad1]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x5ecd5f=_[_0x27d0('0x18')](_0x3c1996['OpenchannelInteractions'],'id');return _0x3c1996[_0x27d0('0x47')](_0x5ecd5f)[_0x27d0('0xc')](function(){for(var _0x1cea5b=0x0;_0x1cea5b<_0x5ecd5f['length'];_0x1cea5b+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x48'),{'OpenchannelInteractionId':Number(_0x5ecd5f[_0x1cea5b]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0x49')](function(_0x39302c){_0x442d76[_0x27d0('0x4a')](_0x39302c);});}}function onDisconnect(_0x2417f7,_0x49935f){joinOrLeave(_0x2417f7,'leave',_0x49935f);}function onConnect(_0x4e576e){joinOrLeave(_0x4e576e,_0x27d0('0x4b'));}exports[_0x27d0('0x4c')]=function(_0x7bd322){_0x7bd322['on'](_0x27d0('0x4d'),function(_0x470211){_0x470211[_0x27d0('0x4e')](0x0);_0x470211['address']=_0x470211[_0x27d0('0x4f')][_0x27d0('0x4d')][_0x27d0('0x50')]+':'+_0x470211[_0x27d0('0x4f')]['connection'][_0x27d0('0x51')];_0x470211['connectedAt']=new Date();_0x470211['log']=function(_0x3063d6){console[_0x27d0('0x4a')]('SocketIO\x20'+_0x470211[_0x27d0('0x52')][_0x27d0('0x5')]+'['+_0x470211[_0x27d0('0x53')]+']',_0x3063d6);};_0x470211['on'](_0x27d0('0x54'),function(){onDisconnect(_0x470211,_0x7bd322);_0x470211[_0x27d0('0x4a')]('DISCONNECTED');});onConnect(_0x470211);_0x470211[_0x27d0('0x4a')]('CONNECTED');});}; \ No newline at end of file +var _0x05af=['Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','length','find','userProfileId','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueues','SmsQueues','MailQueues','MailQueue','getVoiceQueues','getChatQueues','getSmsQueues','getOpenchannelQueues','chat','fax','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','OpenchannelQueues','findAll','Telephones'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x05af,0x174));var _0xf05a=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x05af[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0xf05a('0x0'));var util=require(_0xf05a('0x1'));var BPromise=require(_0xf05a('0x2'));var db=require(_0xf05a('0x3'))['db'];var config=require(_0xf05a('0x4'));var queryQueues={'attributes':['id',_0xf05a('0x5')],'include':[{'as':_0xf05a('0x6'),'model':db[_0xf05a('0x7')],'attributes':['id','name',_0xf05a('0x8')],'raw':!![],'where':{'role':_0xf05a('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf05a('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xf05a('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xf05a('0x5')],'where':{'role':_0xf05a('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xf05a('0x5'),_0xf05a('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x362e7b,_0x52b9da,_0x2845a6){return db[_0xf05a('0xb')][_0xf05a('0xc')]({'where':{'name':_0x362e7b,'userProfileId':_0x52b9da},'raw':!![]})[_0xf05a('0xd')](function(_0xdbb669){if(_0xdbb669){if(_0xdbb669[_0xf05a('0xe')]){switch(_0x362e7b){case _0xf05a('0xf'):case'ChatQueues':case _0xf05a('0x10'):case'SmsQueues':case'MailQueues':case _0xf05a('0x11'):return db[_0x2845a6][_0xf05a('0x12')](queryQueues);case _0xf05a('0x13'):return db[_0x2845a6][_0xf05a('0x12')](queryTelephones);case _0xf05a('0x14'):return db[_0x2845a6][_0xf05a('0x12')](queryTrunks);case _0xf05a('0x15'):return db[_0x2845a6]['findAll'](queryCampaigns);}}else{return db[_0xf05a('0x16')][_0xf05a('0x12')]({'attributes':[_0xf05a('0x17')],'where':{'sectionId':_0xdbb669['id']},'raw':!![]})[_0xf05a('0xd')](function(_0x33f108){if(_0x33f108){var _0xf6ac86={'where':{'id':_[_0xf05a('0x18')](_0x33f108,_0xf05a('0x17'))},'raw':!![]};switch(_0x2845a6){case _0xf05a('0x7'):_0xf6ac86[_0xf05a('0x19')][_0xf05a('0x8')]='telephone';break;case _0xf05a('0x1a'):_0xf6ac86['where'][_0xf05a('0xa')]=_0xf05a('0x1b');break;}return db[_0x2845a6]['findAll'](_0xf6ac86);}else{return[];}});}}else{return[];}})[_0xf05a('0xd')](function(_0x308ee9){return _0x308ee9;});}function joinOrLeaveQueues(_0x51c6f0,_0x21145c,_0x38df2f,_0x2de90f){_0x51c6f0[_0x21145c](util[_0xf05a('0x1c')](_0xf05a('0x1d'),_0x38df2f,_0x2de90f[_0xf05a('0x5')]));if(_0x2de90f[_0xf05a('0x6')]){for(var _0x29924d=0x0;_0x29924d<_0x2de90f[_0xf05a('0x6')][_0xf05a('0x1e')];_0x29924d+=0x1){_0x51c6f0[_0x21145c](util[_0xf05a('0x1c')]('user:%s',_0x2de90f['Agents'][_0x29924d]['name']));}}}function joinOrLeave(_0x3f0e43,_0x3392ff,_0x913315){var _0x3933f7;if(_0x3f0e43['handshake']['query']['id']){db[_0xf05a('0x7')][_0xf05a('0x1f')]({'attributes':['id',_0xf05a('0x5'),_0xf05a('0x8'),_0xf05a('0x20')],'where':{'id':_0x3f0e43['handshake'][_0xf05a('0x21')]['id']},'include':[{'model':db[_0xf05a('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x23')],'as':_0xf05a('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x25')],'as':_0xf05a('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf05a('0x28')],'as':_0xf05a('0x29'),'attributes':['id'],'raw':!![]}]})[_0xf05a('0xd')](function(_0x3a1dac){if(_0x3a1dac){_0x3933f7=_0x3a1dac;_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')]('user:%s',_0x3a1dac[_0xf05a('0x5')]));var _0x2ea80b=[];switch(_0x3a1dac[_0xf05a('0x8')]){case _0xf05a('0x2a'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff](_0xf05a('0x2c'));if(queryQueues[_0xf05a('0x2d')](_0xf05a('0x2e'))){delete queryQueues[_0xf05a('0x2e')];}_0x2ea80b[_0xf05a('0x2f')](db['VoiceQueue']['findAll'](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x30')][_0xf05a('0x12')](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x31')][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db[_0xf05a('0x32')][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db['MailQueue'][_0xf05a('0x12')](queryQueues));_0x2ea80b['push'](db[_0xf05a('0x33')][_0xf05a('0x12')](queryQueues));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x7')]['findAll'](queryTelephones));_0x2ea80b[_0xf05a('0x2f')](db[_0xf05a('0x34')][_0xf05a('0x12')](queryTrunks));_0x2ea80b['push'](db[_0xf05a('0x1a')][_0xf05a('0x12')](queryCampaigns));_0x2ea80b[_0xf05a('0x2f')](db['User'][_0xf05a('0x12')](queryAgents));break;case _0xf05a('0x35'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff]('voice:outbound');_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('VoiceQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x36')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x37'),_0x3a1dac[_0xf05a('0x20')],'ChatQueue'));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('FaxQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x31')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x38'),_0x3a1dac[_0xf05a('0x20')],'SmsQueue'));_0x2ea80b['push'](getAssociatedResources(_0xf05a('0x39'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x3a')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources('OpenchannelQueues',_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x33')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x13'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x7')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x14'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x34')));_0x2ea80b[_0xf05a('0x2f')](getAssociatedResources(_0xf05a('0x15'),_0x3a1dac[_0xf05a('0x20')],_0xf05a('0x1a')));_0x2ea80b[_0xf05a('0x2f')](db['User'][_0xf05a('0x12')](queryAgents));break;case _0xf05a('0x9'):_0x3f0e43[_0x3392ff](_0xf05a('0x2b'));_0x3f0e43[_0x3392ff](_0xf05a('0x2c'));_0x2ea80b['push'](_0x3a1dac[_0xf05a('0x3b')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac[_0xf05a('0x3c')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b['push'](_0x3a1dac['getFaxQueues']({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac[_0xf05a('0x3d')]({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b[_0xf05a('0x2f')](_0x3a1dac['getMailQueues']({'attributes':['id',_0xf05a('0x5')]}));_0x2ea80b['push'](_0x3a1dac[_0xf05a('0x3e')]({'attributes':['id',_0xf05a('0x5')]}));break;}return BPromise['all'](_0x2ea80b);}})['then'](function(_0x270d92){if(_0x270d92&&_0x270d92[_0xf05a('0x1e')]){for(var _0x8bb795=0x0;_0x8bb795<_0x270d92['length'];_0x8bb795+=0x1){for(var _0x453016=0x0;_0x453016<_0x270d92[_0x8bb795][_0xf05a('0x1e')];_0x453016+=0x1){switch(_0x8bb795){case 0x0:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,'voice',_0x270d92[_0x8bb795][_0x453016]);break;case 0x1:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x3f'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x2:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x40'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x3:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,'sms',_0x270d92[_0x8bb795][_0x453016]);break;case 0x4:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x41'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x5:joinOrLeaveQueues(_0x3f0e43,_0x3392ff,_0xf05a('0x42'),_0x270d92[_0x8bb795][_0x453016]);break;case 0x6:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x43'),_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x7:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x44'),_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x8:_0x3f0e43[_0x3392ff](util['format'](_0xf05a('0x45'),_0x270d92[_0x8bb795][_0x453016]['type'],_0x270d92[_0x8bb795][_0x453016][_0xf05a('0x5')]));break;case 0x9:_0x3f0e43[_0x3392ff](util[_0xf05a('0x1c')](_0xf05a('0x46'),_0x270d92[_0x8bb795][_0x453016]['name']));break;}}}}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x26b01b=_['map'](_0x3933f7[_0xf05a('0x48')],'id');return _0x3933f7[_0xf05a('0x49')](_0x26b01b)[_0xf05a('0xd')](function(){for(var _0x2d3499=0x0;_0x2d3499<_0x26b01b['length'];_0x2d3499+=0x1){_0x913315['emit'](_0xf05a('0x4a'),{'ChatInteractionId':Number(_0x26b01b[_0x2d3499]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff==='leave'){var _0x59d3f8=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x24')],'id');return _0x3933f7[_0xf05a('0x4b')](_0x59d3f8)[_0xf05a('0xd')](function(){for(var _0x2802eb=0x0;_0x2802eb<_0x59d3f8[_0xf05a('0x1e')];_0x2802eb+=0x1){_0x913315[_0xf05a('0x4c')](_0xf05a('0x4d'),{'MailInteractionId':Number(_0x59d3f8[_0x2802eb]),'UserId':Number(_0x3933f7['id'])});}});}})['then'](function(){if(_0x3392ff==='leave'){var _0x3484c4=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x26')],'id');return _0x3933f7[_0xf05a('0x4e')](_0x3484c4)['then'](function(){for(var _0x24de7b=0x0;_0x24de7b<_0x3484c4[_0xf05a('0x1e')];_0x24de7b+=0x1){_0x913315['emit'](_0xf05a('0x4f'),{'FaxInteractionId':Number(_0x3484c4[_0x24de7b]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x23dc62=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x50')],'id');return _0x3933f7[_0xf05a('0x51')](_0x23dc62)[_0xf05a('0xd')](function(){for(var _0x58aaac=0x0;_0x58aaac<_0x23dc62[_0xf05a('0x1e')];_0x58aaac+=0x1){_0x913315['emit'](_0xf05a('0x52'),{'SmsInteractionId':Number(_0x23dc62[_0x58aaac]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0xd')](function(){if(_0x3392ff===_0xf05a('0x47')){var _0x1f5b9e=_[_0xf05a('0x18')](_0x3933f7[_0xf05a('0x29')],'id');return _0x3933f7[_0xf05a('0x53')](_0x1f5b9e)[_0xf05a('0xd')](function(){for(var _0x11a561=0x0;_0x11a561<_0x1f5b9e[_0xf05a('0x1e')];_0x11a561+=0x1){_0x913315[_0xf05a('0x4c')](_0xf05a('0x54'),{'OpenchannelInteractionId':Number(_0x1f5b9e[_0x11a561]),'UserId':Number(_0x3933f7['id'])});}});}})[_0xf05a('0x55')](function(_0x5eca20){_0x3f0e43[_0xf05a('0x56')](_0x5eca20);});}}function onDisconnect(_0x47f407,_0x15b13f){joinOrLeave(_0x47f407,'leave',_0x15b13f);}function onConnect(_0x3c424b){joinOrLeave(_0x3c424b,'join');}exports[_0xf05a('0x57')]=function(_0x489a0c){_0x489a0c['on']('connection',function(_0x116438){_0x116438['setMaxListeners'](0x0);_0x116438['address']=_0x116438[_0xf05a('0x58')][_0xf05a('0x59')][_0xf05a('0x5a')]+':'+_0x116438[_0xf05a('0x58')][_0xf05a('0x59')][_0xf05a('0x5b')];_0x116438[_0xf05a('0x5c')]=new Date();_0x116438[_0xf05a('0x56')]=function(_0x24ff31){console[_0xf05a('0x56')](_0xf05a('0x5d')+_0x116438['nsp'][_0xf05a('0x5')]+'['+_0x116438[_0xf05a('0x5e')]+']',_0x24ff31);};_0x116438['on'](_0xf05a('0x5f'),function(){onDisconnect(_0x116438,_0x489a0c);_0x116438[_0xf05a('0x56')](_0xf05a('0x60'));});onConnect(_0x116438);_0x116438['log'](_0xf05a('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 2419a21..70616de 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 _0x8f23=['Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','info','EventManager','error','code','catch','Trigger,\x20%s','get','channel','event','UserId','User','find','name','interface','SIP/%s','opened','changed','closed','then','format','default','hasOwnProperty','model','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','closedinteraction','FaxInteraction'];(function(_0x4c6712,_0x2bc220){var _0x3dff9d=function(_0x2a7fd8){while(--_0x2a7fd8){_0x4c6712['push'](_0x4c6712['shift']());}};_0x3dff9d(++_0x2bc220);}(_0x8f23,0x1e3));var _0x38f2=function(_0x200007,_0x5c98c9){_0x200007=_0x200007-0x0;var _0xf81986=_0x8f23[_0x200007];return _0xf81986;};'use strict';var util=require('util');var db=require(_0x38f2('0x0'))['db'];var jayson=require(_0x38f2('0x1'));var logger=require(_0x38f2('0x2'))(_0x38f2('0x3'));var client=jayson[_0x38f2('0x4')][_0x38f2('0x5')]({'port':0x232a});var triggers=[{'channel':_0x38f2('0x6'),'model':_0x38f2('0x7'),'event':_0x38f2('0x8'),'condition':_0x38f2('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0x38f2('0x7'),'event':_0x38f2('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x38f2('0x6'),'model':_0x38f2('0xb'),'event':_0x38f2('0x8'),'condition':_0x38f2('0xc'),'callback':afterCreateMessage},{'channel':_0x38f2('0xd'),'model':_0x38f2('0xe'),'event':_0x38f2('0x8'),'condition':_0x38f2('0x9'),'callback':afterCreate},{'channel':_0x38f2('0xd'),'model':'SmsInteraction','event':_0x38f2('0xa'),'condition':_0x38f2('0xf'),'callback':afterUpdate},{'channel':_0x38f2('0xd'),'model':'SmsMessage','event':_0x38f2('0x8'),'condition':_0x38f2('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x38f2('0x10'),'event':_0x38f2('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x38f2('0x11'),'model':'FaxInteraction','event':_0x38f2('0xa'),'condition':_0x38f2('0xf'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x38f2('0x12'),'model':_0x38f2('0x13'),'event':_0x38f2('0x8'),'condition':_0x38f2('0x9'),'callback':afterCreate},{'channel':_0x38f2('0x12'),'model':'MailInteraction','event':_0x38f2('0xa'),'condition':_0x38f2('0xf'),'callback':afterUpdate},{'channel':'Mail','model':_0x38f2('0x14'),'event':_0x38f2('0x8'),'condition':_0x38f2('0xc'),'callback':afterCreateMessage},{'channel':_0x38f2('0x15'),'model':_0x38f2('0x16'),'event':'afterCreate','condition':_0x38f2('0x9'),'callback':afterCreate},{'channel':_0x38f2('0x15'),'model':_0x38f2('0x16'),'event':'afterUpdate','condition':_0x38f2('0xf'),'callback':afterUpdate},{'channel':_0x38f2('0x15'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x38f2('0xc'),'callback':afterCreateMessage}];function request(_0xd2db30){return client[_0x38f2('0x17')]('EventManager',_0xd2db30)['then'](function(_0x179c97){logger[_0x38f2('0x18')]('Trigger,\x20%s',_0x38f2('0x19'),_0x179c97);if(_0x179c97['error']){if(_0x179c97[_0x38f2('0x1a')][_0x38f2('0x1b')]===0x1f4){logger[_0x38f2('0x1a')]('Trigger,\x20%s',_0x38f2('0x19'),_0x179c97[_0x38f2('0x1a')]);}}})[_0x38f2('0x1c')](function(_0x2a11c5){logger[_0x38f2('0x1a')](_0x38f2('0x1d'),'EventManager',_0x2a11c5);});}function afterCreateMessage(_0x475392,_0x13592c){return function(_0x2c97a1,_0x3cee80){_0x2c97a1=_0x2c97a1[_0x38f2('0x1e')]({'plain':!![]});_0x2c97a1[_0x38f2('0x1f')]=_0x475392;_0x2c97a1[_0x38f2('0x20')]=_0x2c97a1['direction'];if(_0x2c97a1[_0x38f2('0x21')]){return db[_0x38f2('0x22')][_0x38f2('0x23')]({'where':{'id':_0x2c97a1[_0x38f2('0x21')]},'attributes':['id',_0x38f2('0x24')],'raw':!![]})['then'](function(_0xbbf0db){_0x2c97a1[_0x38f2('0x25')]=util['format'](_0x38f2('0x26'),_0xbbf0db[_0x38f2('0x24')]);_0x2c97a1[_0x38f2('0x1f')]=_0x475392;return request({'event':'incomingmessage','message':_0x2c97a1});})[_0x38f2('0x1c')](function(_0x4c656b){console['error'](_0x4c656b);});}else{return request({'event':'outgoingmessage','message':_0x2c97a1});}};}function afterCreate(_0x248269,_0x4794a4){return function(_0x2c4c76,_0x531ec2){_0x2c4c76=_0x2c4c76[_0x38f2('0x1e')]({'plain':!![]});_0x2c4c76[_0x38f2('0x1f')]=_0x248269;_0x2c4c76[_0x38f2('0x20')]=_0x38f2('0x27');return request({'event':_0x4794a4,'message':_0x2c4c76});};}function afterUpdate(_0x2d6cdd,_0x3771c2){return function(_0x596d85,_0x3b1e84){if(_0x596d85[_0x38f2('0x28')](_0x38f2('0x29'))&&_0x596d85[_0x38f2('0x29')]){_0x596d85=_0x596d85[_0x38f2('0x1e')]({'plain':!![]});_0x596d85['channel']=_0x2d6cdd;_0x596d85[_0x38f2('0x20')]='closed';if(_0x596d85[_0x38f2('0x21')]){return db['User']['find']({'where':{'id':_0x596d85[_0x38f2('0x21')]},'attributes':['id',_0x38f2('0x24')],'raw':!![]})[_0x38f2('0x2a')](function(_0x3638fc){_0x596d85[_0x38f2('0x25')]=util[_0x38f2('0x2b')](_0x38f2('0x26'),_0x3638fc[_0x38f2('0x24')]);return request({'event':_0x3771c2,'message':_0x596d85});})[_0x38f2('0x1c')](function(_0x718a4){console[_0x38f2('0x1a')](_0x718a4);});}else{return request({'event':_0x3771c2,'message':_0x596d85});}}};}exports[_0x38f2('0x2c')]=function(){for(var _0x279814=0x0;_0x279814 // Left iframe.className = 'motion-chat-iframe-left'; @@ -53,22 +53,22 @@ <% if (alignment == 'right') { -%> // Bottom, right topChat_set(iframe_h, verticalAlignment); document.body.appendChild(div_tab); - var html='CHAT'; + var html='
<
CHAT'; div_tab.innerHTML=html; document.getElementById("motion-chat-iframe-tab").addEventListener("click", function(){ if(tab_status%2==0) { div_tab.style.right = '295px'; iframe.style.right = '0px'; - document.getElementById("chat_tab_arrow").classList.add("mdi-chevron-right"); - document.getElementById("chat_tab_arrow").classList.remove("mdi-chevron-left"); + // document.getElementById("chat_tab_arrow").classList.add("mdi-chevron-right"); + // document.getElementById("chat_tab_arrow").classList.remove("mdi-chevron-left"); var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow.postMessage({"evt":"show"}, '*'); } else { div_tab.style.right = '0px'; iframe.style.right = '-312px'; - document.getElementById("chat_tab_arrow").classList.remove("mdi-chevron-right"); - document.getElementById("chat_tab_arrow").classList.add("mdi-chevron-left"); + // document.getElementById("chat_tab_arrow").classList.remove("mdi-chevron-right"); + // document.getElementById("chat_tab_arrow").classList.add("mdi-chevron-left"); var iframeEl = document.getElementById('motion-chat-iframe'); iframeEl.contentWindow.postMessage({"evt":"hide"}, '*'); } @@ -133,6 +133,7 @@ <% if (alignment == 'right' || alignment == 'left') { -%> // Bottom, right div_tab.style.backgroundColor=evt.data.div_color; document.getElementById("chat_tab_text").style.color=evt.data.text_color; + document.getElementById("chat_tab_arrow").style.color=evt.data.text_color; document.getElementById("motion-chat-iframe-tab").style.display="block"; <% } -%> case "offline": diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 7a75e0f..a36c8ac 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0f4=['FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','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','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/integration/integration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','UserId','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','HopperFinals','OpenchannelInteractions','FaxInteraction','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','user_has_fax_accounts','OpenchannelAccount','SmsAccounts','SquareProject','VoiceChanSpy','SpiedAgents','cascade','ChanSpyId','VoiceContext','VoiceExtension','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','IntervalId','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','List','ListId','mandatoryDispositionPause','user_has_mail_accounts','MailQueue','Agents','UserMailQueue','team_has_mail_queues','MailInteractionId','Contact','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','Account','restrict','TagId','Items','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxApplication','FaxInteractionId','Owner','fax_interaction_has_tags','Interaction','SmsAccountId','user_has_sms_accounts','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsite','ChatWebsiteId','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','Contacts','CompanyId','ChatInteractions','Company','cm_contact_has_tags','CampaignId','OwnerId','CmHopperBlack','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','Schedule','DefaultReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','CustomReportId','MetricId','SalesforceConfiguration','Configurations','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','AccountId','SubjectId','Description','Field','VariableId','Subject','DeskConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','int_vtiger_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','ToId','SessionId','SmsQueueReport','ProjectId','user_has_square_projects','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','Resources','exports','../config/environment','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxInteraction/faxInteraction.model'];(function(_0x2ebe0b,_0x200111){var _0x4d3d85=function(_0x1c45be){while(--_0x1c45be){_0x2ebe0b['push'](_0x2ebe0b['shift']());}};_0x4d3d85(++_0x200111);}(_0xf0f4,0x182));var _0x4f0f=function(_0xfc941f,_0xfb79f8){_0xfc941f=_0xfc941f-0x0;var _0x4a1e59=_0xf0f4[_0xfc941f];return _0x4a1e59;};'use strict';var path=require('path');var config=require(_0x4f0f('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x4f0f('0x1'));var timezone=jstz[_0x4f0f('0x2')]();config['sequelize']=_[_0x4f0f('0x3')](config[_0x4f0f('0x4')],{'database':_0x4f0f('0x5'),'username':_0x4f0f('0x6'),'password':_0x4f0f('0x7'),'options':{'host':_0x4f0f('0x8'),'port':0xcea,'dialect':_0x4f0f('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4f0f('0xa')](),'define':{'charset':_0x4f0f('0xb'),'collate':_0x4f0f('0xc')}}});config['sequelizeHistory']=_[_0x4f0f('0x3')](config[_0x4f0f('0xd')],{'database':_0x4f0f('0x5'),'username':_0x4f0f('0x6'),'password':_0x4f0f('0x7'),'options':{'host':_0x4f0f('0x8'),'port':0xcea,'dialect':_0x4f0f('0x9'),'dialectOptions':{'charset':_0x4f0f('0xe')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4f0f('0xb'),'collate':_0x4f0f('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f0f('0x4')][_0x4f0f('0xf')],config[_0x4f0f('0x4')][_0x4f0f('0x10')],config[_0x4f0f('0x4')][_0x4f0f('0x11')],config[_0x4f0f('0x4')][_0x4f0f('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f0f('0xd')]['database'],config[_0x4f0f('0xd')][_0x4f0f('0x10')],config[_0x4f0f('0xd')][_0x4f0f('0x11')],config['sequelizeHistory'][_0x4f0f('0x12')])};db[_0x4f0f('0x13')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x15'));db['VoiceChanSpy']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x16'));db['VoiceContext']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x17'));db['VoiceExtension']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x18'));db[_0x4f0f('0x19')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x4f0f('0x1a')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x1b'));db['VoiceRecording']=db['sequelize'][_0x4f0f('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x4f0f('0x1c')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x1d'));db[_0x4f0f('0x1e')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x1f'));db[_0x4f0f('0x20')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x21'));db[_0x4f0f('0x22')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x23'));db[_0x4f0f('0x24')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x25'));db['VoiceAgentReport']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x26'));db['VoiceQueueReport']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x27'));db[_0x4f0f('0x28')]=db['sequelize']['import'](_0x4f0f('0x29'));db['Trunk']=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/trunk/trunk.model');db[_0x4f0f('0x2a')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x2b'));db['UserVoiceQueueRt']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x2c'));db[_0x4f0f('0x2d')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x2e'));db[_0x4f0f('0x2f')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x30'));db['UserMailQueue']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x31'));db[_0x4f0f('0x32')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x33'));db[_0x4f0f('0x34')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x35'));db[_0x4f0f('0x36')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x37'));db[_0x4f0f('0x38')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x39'));db[_0x4f0f('0x3a')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x3b'));db[_0x4f0f('0x3c')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x3d'));db['MailQueue']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x3e'));db[_0x4f0f('0x3f')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x40'));db[_0x4f0f('0x41')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x42'));db[_0x4f0f('0x43')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x44'));db[_0x4f0f('0x45')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x46'));db[_0x4f0f('0x47')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x48'));db[_0x4f0f('0x49')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x4a'));db[_0x4f0f('0x4b')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x4c'));db[_0x4f0f('0x4d')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x4e'));db['FaxApplication']=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x4f'));db['FaxMessage']=db[_0x4f0f('0x4')]['import']('../api/faxMessage/faxMessage.model');db[_0x4f0f('0x50')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x51'));db[_0x4f0f('0x52')]=db[_0x4f0f('0x4')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x4f0f('0x53')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/smsAccount/smsAccount.model');db[_0x4f0f('0x54')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/smsApplication/smsApplication.model');db[_0x4f0f('0x55')]=db['sequelize'][_0x4f0f('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x4f0f('0x56')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x57'));db[_0x4f0f('0x58')]=db['sequelize']['import'](_0x4f0f('0x59'));db['OpenchannelAccount']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x5a'));db[_0x4f0f('0x5b')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x5c'));db[_0x4f0f('0x5d')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x5e'));db[_0x4f0f('0x5f')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x60'));db[_0x4f0f('0x61')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x62'));db['ChatWebsite']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x63'));db[_0x4f0f('0x64')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x65'));db[_0x4f0f('0x66')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x67'));db[_0x4f0f('0x68')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x4f0f('0x69')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x6a'));db[_0x4f0f('0x6b')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x6c'));db[_0x4f0f('0x6d')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x6e'));db[_0x4f0f('0x6f')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x70'));db[_0x4f0f('0x71')]=db['sequelize'][_0x4f0f('0x14')]('../api/cmCompany/cmCompany.model');db[_0x4f0f('0x72')]=db[_0x4f0f('0x4')]['import']('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x73'));db['CmHopperBlack']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x74'));db[_0x4f0f('0x75')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x76'));db[_0x4f0f('0x77')]=db[_0x4f0f('0x4')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x4f0f('0x78')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x4f0f('0x79')]=db['sequelize'][_0x4f0f('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x4f0f('0x7a')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x7b'));db[_0x4f0f('0x7c')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x7d'));db[_0x4f0f('0x7e')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x7f'));db[_0x4f0f('0x80')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/disposition/disposition.model');db[_0x4f0f('0x81')]=db[_0x4f0f('0x4')]['import']('../api/condition/condition.model');db[_0x4f0f('0x82')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x83'));db[_0x4f0f('0x84')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x85'));db[_0x4f0f('0x86')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x87'));db[_0x4f0f('0x88')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0x89'));db['Schedule']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x8a'));db[_0x4f0f('0x8b')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/sound/sound.model');db['Tag']=db['sequelize']['import']('../api/tag/tag.model');db[_0x4f0f('0x8c')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x8d'));db[_0x4f0f('0x8e')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x8f'));db[_0x4f0f('0x90')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x91'));db[_0x4f0f('0x92')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/integration/integration.model');db[_0x4f0f('0x93')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x94'));db[_0x4f0f('0x95')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x96'));db['AnalyticDefaultReport']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x97'));db[_0x4f0f('0x98')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0x99'));db[_0x4f0f('0x9a')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x9b'));db['AnalyticFieldReport']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x9c'));db[_0x4f0f('0x9d')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0x9e'));db[_0x4f0f('0x9f')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xa0'));db['SalesforceConfiguration']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xa1'));db['SalesforceField']=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xa2'));db[_0x4f0f('0xa3')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xa4'));db[_0x4f0f('0xa5')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xa6'));db[_0x4f0f('0xa7')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xa8'));db['DeskAccount']=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xa9'));db['DeskConfiguration']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xaa'));db[_0x4f0f('0xab')]=db[_0x4f0f('0x4')]['import']('../api/intDeskField/intDeskField.model');db[_0x4f0f('0xac')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xad'));db[_0x4f0f('0xae')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xaf'));db[_0x4f0f('0xb0')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xb1'));db[_0x4f0f('0xb2')]=db[_0x4f0f('0x4')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4f0f('0xb3')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4f0f('0xb4')]=db['sequelize']['import'](_0x4f0f('0xb5'));db[_0x4f0f('0xb6')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x4f0f('0xb7')]=db[_0x4f0f('0x4')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x4f0f('0xb8')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xb9'));db[_0x4f0f('0xba')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xbb'));db[_0x4f0f('0xbc')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xbd'));db[_0x4f0f('0xbe')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xbf'));db['ServicenowConfiguration']=db['sequelize']['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4f0f('0xc0')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xc1'));db['Dynamics365Account']=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xc2'));db[_0x4f0f('0xc3')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xc4'));db['Integration']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xc5'));db['Network']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xc6'));db[_0x4f0f('0xc7')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xc8'));db[_0x4f0f('0xc9')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xca'));db[_0x4f0f('0xcb')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xcc'));db['JscriptyQuestionReport']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xcd'));db[_0x4f0f('0xce')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xcf'));db['SmsQueueReport']=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xd0'));db[_0x4f0f('0xd1')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xd2'));db[_0x4f0f('0xd3')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xd4'));db[_0x4f0f('0xd5')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xd6'));db['Setting']=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/setting/setting.model');db[_0x4f0f('0xd7')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xd8'));db['SquareProject']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xd9'));db[_0x4f0f('0xda')]=db[_0x4f0f('0x4')]['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xdb'));db[_0x4f0f('0xdc')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xdd'));db[_0x4f0f('0xde')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xdf'));db[_0x4f0f('0xe0')]=db['sequelize']['import'](_0x4f0f('0xe1'));db[_0x4f0f('0xe2')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xe3'));db['Attachment']=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xe4'));db[_0x4f0f('0xe5')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xe6'));db[_0x4f0f('0xe7')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xe8'));db[_0x4f0f('0xe9')]=db['sequelize'][_0x4f0f('0x14')](_0x4f0f('0xea'));db[_0x4f0f('0xeb')]=db[_0x4f0f('0x4')]['import'](_0x4f0f('0xec'));db[_0x4f0f('0xed')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xee'));db[_0x4f0f('0xef')]=db[_0x4f0f('0x4')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x4f0f('0xf0')]=db['sequelize']['import'](_0x4f0f('0xf1'));db[_0x4f0f('0xf2')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0x4f0f('0xf3')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xf4'));db[_0x4f0f('0xf5')]=db[_0x4f0f('0x4')][_0x4f0f('0x14')](_0x4f0f('0xf6'));db[_0x4f0f('0xf7')]=db[_0x4f0f('0x4')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x4f0f('0x13')][_0x4f0f('0xf8')](db[_0x4f0f('0x1e')],{'as':_0x4f0f('0x1e'),'onDelete':'cascade','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0xfb')],{'as':_0x4f0f('0xfc'),'foreignKey':'UserId'});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0xfd')],{'as':_0x4f0f('0xfe'),'foreignKey':'UserId'});db['User'][_0x4f0f('0xfa')](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x4f0f('0x13')]['hasMany'](db[_0x4f0f('0x75')],{'as':_0x4f0f('0xff'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x77')],{'as':'HopperHistory','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x5d')],{'as':_0x4f0f('0x100'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x68')],{'as':'ChatInteractions','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x55')],{'as':'SmsInteractions','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')][_0x4f0f('0xfa')](db[_0x4f0f('0x101')],{'as':_0x4f0f('0x102'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x13')]['hasMany'](db[_0x4f0f('0x41')],{'as':_0x4f0f('0x103'),'foreignKey':'UserId'});db[_0x4f0f('0x13')][_0x4f0f('0x104')](db[_0x4f0f('0xf3')],{'as':_0x4f0f('0xf3'),'foreignKey':_0x4f0f('0x105')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db['ChatGroup'],{'as':_0x4f0f('0x107'),'through':_0x4f0f('0x108')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x72')],{'as':'Contacts','through':'cm_user_has_contacts'});db['User'][_0x4f0f('0x106')](db[_0x4f0f('0xf0')],{'as':'Lists','through':_0x4f0f('0x109')});db[_0x4f0f('0x13')]['belongsToMany'](db[_0x4f0f('0xdc')],{'through':_0x4f0f('0x10a')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x41')],{'as':_0x4f0f('0x103'),'through':'user_has_mail_interactions'});db['User'][_0x4f0f('0x106')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x4f0f('0x10b')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x101')],{'as':'FaxInteractions','through':_0x4f0f('0x10c')});db['User'][_0x4f0f('0x106')](db[_0x4f0f('0x55')],{'as':_0x4f0f('0x10d'),'through':'user_has_sms_interactions'});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db['OpenchannelInteraction'],{'as':_0x4f0f('0x100'),'through':_0x4f0f('0x10e')});db['User']['belongsToMany'](db[_0x4f0f('0x1a')],{'as':_0x4f0f('0x10f'),'through':'UserVoiceQueue','required':![]});db['User'][_0x4f0f('0x106')](db['MailQueue'],{'as':_0x4f0f('0x110'),'through':'UserMailQueue','required':![]});db['User']['belongsToMany'](db[_0x4f0f('0x111')],{'as':'ChatQueues','through':_0x4f0f('0x2f'),'required':![],'hooks':!![]});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db['FaxQueue'],{'as':_0x4f0f('0x112'),'through':'UserFaxQueue','required':![]});db['User'][_0x4f0f('0x106')](db['SmsQueue'],{'as':_0x4f0f('0x113'),'through':_0x4f0f('0x34'),'required':![]});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x61')],{'as':_0x4f0f('0x114'),'through':_0x4f0f('0x36'),'required':![]});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0xf0')],{'through':_0x4f0f('0x109')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0xf2')],{'as':_0x4f0f('0x115'),'through':_0x4f0f('0x116'),'required':![]});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db['ChatWebsite'],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x4d')],{'as':'FaxAccounts','through':_0x4f0f('0x117')});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x4f0f('0x13')][_0x4f0f('0x106')](db[_0x4f0f('0x118')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User'][_0x4f0f('0x106')](db[_0x4f0f('0x53')],{'as':_0x4f0f('0x119'),'through':'user_has_sms_accounts'});db[_0x4f0f('0x13')]['belongsToMany'](db[_0x4f0f('0x11a')],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0x4f0f('0x11b')][_0x4f0f('0xfa')](db['VoiceExtension'],{'as':_0x4f0f('0x11c'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x11e')});db[_0x4f0f('0x11f')][_0x4f0f('0xfa')](db[_0x4f0f('0x120')],{'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x120')][_0x4f0f('0xfa')](db[_0x4f0f('0x120')],{'as':_0x4f0f('0x121'),'onDelete':'cascade'});db[_0x4f0f('0x19')]['belongsToMany'](db[_0x4f0f('0x8b')],{'as':_0x4f0f('0x122'),'through':_0x4f0f('0x123')});db[_0x4f0f('0x1a')][_0x4f0f('0xfa')](db[_0x4f0f('0xfd')],{'as':_0x4f0f('0x124'),'foreignKey':_0x4f0f('0x125')});db[_0x4f0f('0x1a')]['hasMany'](db[_0x4f0f('0x126')],{'as':_0x4f0f('0x127'),'foreignKey':_0x4f0f('0x125')});db[_0x4f0f('0x1a')][_0x4f0f('0xfa')](db[_0x4f0f('0x75')],{'as':_0x4f0f('0xff'),'foreignKey':_0x4f0f('0x125')});db[_0x4f0f('0x1a')][_0x4f0f('0xfa')](db[_0x4f0f('0x77')],{'as':_0x4f0f('0x128'),'foreignKey':_0x4f0f('0x125')});db[_0x4f0f('0x1a')][_0x4f0f('0xfa')](db['ReportAgentPreview'],{'as':_0x4f0f('0x78'),'foreignKey':'VoiceQueueId'});db[_0x4f0f('0x1a')][_0x4f0f('0xfa')](db['CmHopperBlack'],{'as':_0x4f0f('0x129'),'foreignKey':_0x4f0f('0x125')});db[_0x4f0f('0x1a')]['hasMany'](db[_0x4f0f('0xce')],{'as':_0x4f0f('0x12a'),'foreignKey':'VoiceQueueId'});db[_0x4f0f('0x1a')][_0x4f0f('0x104')](db[_0x4f0f('0x12b')],{'as':_0x4f0f('0x12b'),'foreignKey':'TrunkId'});db[_0x4f0f('0x1a')][_0x4f0f('0x104')](db[_0x4f0f('0x12b')],{'as':_0x4f0f('0x12c'),'foreignKey':'TrunkBackupId'});db[_0x4f0f('0x1a')][_0x4f0f('0x104')](db['Interval'],{'as':'Interval','foreignKey':_0x4f0f('0x12d')});db[_0x4f0f('0x1a')][_0x4f0f('0x104')](db[_0x4f0f('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f0f('0x12e')});db[_0x4f0f('0x1a')][_0x4f0f('0x106')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x12f'),'through':_0x4f0f('0x130')});db[_0x4f0f('0x1a')]['belongsToMany'](db[_0x4f0f('0x13')],{'as':'Agents','through':_0x4f0f('0x2d')});db[_0x4f0f('0x1a')][_0x4f0f('0x106')](db[_0x4f0f('0xdc')],{'as':_0x4f0f('0x131'),'through':_0x4f0f('0x132')});db[_0x4f0f('0x1a')][_0x4f0f('0x106')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x133'),'through':_0x4f0f('0x134')});db[_0x4f0f('0xfb')]['belongsTo'](db[_0x4f0f('0x13')],{'as':'User','foreignKey':'UserId'});db['ScreenRecording'][_0x4f0f('0x104')](db['User'],{'as':'User','foreignKey':_0x4f0f('0xf9')});db['VoiceMail']['hasMany'](db[_0x4f0f('0x20')],{'as':_0x4f0f('0x135'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x136'),'sourceKey':_0x4f0f('0x137')});db[_0x4f0f('0x20')]['belongsTo'](db[_0x4f0f('0x1e')],{'foreignKey':_0x4f0f('0x136'),'targetKey':_0x4f0f('0x137')});db[_0x4f0f('0x22')][_0x4f0f('0xfa')](db[_0x4f0f('0x138')],{'as':_0x4f0f('0x139'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x4f0f('0xfa')](db[_0x4f0f('0x13a')],{'as':_0x4f0f('0x13b'),'foreignKey':_0x4f0f('0x13c'),'constraints':![]});db[_0x4f0f('0x22')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x13'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x22')]['belongsTo'](db[_0x4f0f('0x72')],{'as':'Contact','foreignKey':_0x4f0f('0x13d')});db['MailServerIn'][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{'as':_0x4f0f('0x3c'),'foreignKey':_0x4f0f('0x13e')});db[_0x4f0f('0x3a')][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{'as':_0x4f0f('0x3c'),'foreignKey':'MailAccountId'});db[_0x4f0f('0x3c')][_0x4f0f('0xf8')](db['MailServerIn'],{'as':_0x4f0f('0x13f'),'onDelete':'cascade'});db[_0x4f0f('0x3c')][_0x4f0f('0xf8')](db[_0x4f0f('0x3a')],{'as':_0x4f0f('0x140'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x3c')][_0x4f0f('0xfa')](db['Disposition'],{'as':_0x4f0f('0x141'),'foreignKey':_0x4f0f('0x13e')});db[_0x4f0f('0x3c')][_0x4f0f('0xfa')](db['CannedAnswer'],{'as':_0x4f0f('0x142'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x4f0f('0xfa')](db['MailMessage'],{'as':_0x4f0f('0x135'),'foreignKey':_0x4f0f('0x13e')});db[_0x4f0f('0x3c')][_0x4f0f('0xfa')](db[_0x4f0f('0x41')],{'as':'Interactions'});db[_0x4f0f('0x3c')][_0x4f0f('0xfa')](db['MailApplication'],{'as':'Applications'});db[_0x4f0f('0x3c')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144')});db['MailAccount'][_0x4f0f('0x104')](db[_0x4f0f('0x8c')],{'as':_0x4f0f('0x8c'),'foreignKey':'TemplateId'});db[_0x4f0f('0x3c')][_0x4f0f('0x104')](db[_0x4f0f('0x84')],{'as':_0x4f0f('0x145'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f0f('0x3c')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':'Agents','through':_0x4f0f('0x146')});db[_0x4f0f('0x147')][_0x4f0f('0x106')](db['User'],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x149')});db['MailQueue'][_0x4f0f('0x106')](db[_0x4f0f('0xdc')],{'through':_0x4f0f('0x14a'),'as':_0x4f0f('0x131')});db[_0x4f0f('0x41')][_0x4f0f('0xfa')](db[_0x4f0f('0x43')],{'as':'Messages','onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x14b')});db[_0x4f0f('0x41')][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{'as':'Account','foreignKey':_0x4f0f('0x13e')});db[_0x4f0f('0x41')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':'ContactId'});db[_0x4f0f('0x41')][_0x4f0f('0x104')](db['User'],{'as':'Owner','foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x41')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x14e'),'as':_0x4f0f('0x14f')});db[_0x4f0f('0x41')][_0x4f0f('0x106')](db['Tag'],{'through':_0x4f0f('0x14e'),'as':_0x4f0f('0x150')});db[_0x4f0f('0x41')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x152'),'foreignKey':_0x4f0f('0x14b')});db[_0x4f0f('0x43')][_0x4f0f('0xfa')](db[_0x4f0f('0x153')],{'as':_0x4f0f('0x154'),'onDelete':_0x4f0f('0x11d')});db['MailMessage']['belongsTo'](db[_0x4f0f('0x13')],{'as':'User'});db[_0x4f0f('0x43')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x14c')});db[_0x4f0f('0x43')]['belongsTo'](db[_0x4f0f('0x41')],{'as':'Interaction','foreignKey':_0x4f0f('0x14b')});db[_0x4f0f('0x43')][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x13e')});db['MailApplication']['belongsTo'](db[_0x4f0f('0x13')],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x45')][_0x4f0f('0x104')](db['MailQueue'],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x45')][_0x4f0f('0x104')](db['MailAccount'],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x45')][_0x4f0f('0x104')](db[_0x4f0f('0x82')],{'onDelete':_0x4f0f('0x156'),'foreignKey':'IntervalId'});db['MailApplication'][_0x4f0f('0x104')](db['Tag'],{'onDelete':_0x4f0f('0x156'),'foreignKey':_0x4f0f('0x157')});db[_0x4f0f('0x47')]['belongsTo'](db['MailAccount'],{});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db[_0x4f0f('0x41')],{});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db[_0x4f0f('0x43')],{});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db['User'],{});db[_0x4f0f('0x47')][_0x4f0f('0x104')](db['MailQueue'],{});db[_0x4f0f('0x49')][_0x4f0f('0xfa')](db[_0x4f0f('0x4b')],{'as':_0x4f0f('0x158'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x4d')][_0x4f0f('0xfa')](db[_0x4f0f('0x80')],{'as':_0x4f0f('0x141'),'foreignKey':_0x4f0f('0x159')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x4f0f('0x142'),'foreignKey':'FaxAccountId'});db[_0x4f0f('0x4d')][_0x4f0f('0xfa')](db['FaxInteraction'],{'as':_0x4f0f('0x15a')});db[_0x4f0f('0x4d')][_0x4f0f('0xfa')](db['FaxApplication'],{'as':_0x4f0f('0x121')});db[_0x4f0f('0x4d')][_0x4f0f('0xfa')](db[_0x4f0f('0x120')],{'as':_0x4f0f('0x15b'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x4d')][_0x4f0f('0xfa')](db[_0x4f0f('0x15c')],{'as':_0x4f0f('0x135')});db['FaxAccount'][_0x4f0f('0x104')](db[_0x4f0f('0x12b')],{'as':_0x4f0f('0x12b')});db[_0x4f0f('0x4d')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':'List','foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x4d')][_0x4f0f('0x104')](db[_0x4f0f('0x84')],{'as':_0x4f0f('0x145'),'foreignKey':_0x4f0f('0x12e')});db[_0x4f0f('0x4d')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x117')});db[_0x4f0f('0x15d')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'onDelete':_0x4f0f('0x156')});db['FaxApplication']['belongsTo'](db[_0x4f0f('0x50')],{'onDelete':'restrict'});db[_0x4f0f('0x15d')]['belongsTo'](db[_0x4f0f('0x4d')],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x15d')][_0x4f0f('0x104')](db[_0x4f0f('0x14d')],{'onDelete':_0x4f0f('0x156'),'foreignKey':_0x4f0f('0x157')});db[_0x4f0f('0x101')][_0x4f0f('0xfa')](db[_0x4f0f('0x15c')],{'as':_0x4f0f('0x135'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x15e')});db['FaxInteraction'][_0x4f0f('0x104')](db[_0x4f0f('0x4d')],{'as':_0x4f0f('0x155'),'foreignKey':'FaxAccountId'});db[_0x4f0f('0x101')][_0x4f0f('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0x4f0f('0x13d')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0x4f0f('0x15f'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x101')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':'fax_interaction_has_tags','as':_0x4f0f('0x14f')});db[_0x4f0f('0x101')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x160'),'as':_0x4f0f('0x150')});db[_0x4f0f('0x101')][_0x4f0f('0x106')](db['User'],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x10c'),'foreignKey':'FaxInteractionId'});db[_0x4f0f('0x15c')]['belongsTo'](db[_0x4f0f('0x13')],{'onDelete':'cascade','as':_0x4f0f('0x13')});db[_0x4f0f('0x15c')][_0x4f0f('0x104')](db[_0x4f0f('0x101')],{'as':_0x4f0f('0x161'),'foreignKey':_0x4f0f('0x15e')});db['FaxMessage']['belongsTo'](db[_0x4f0f('0x72')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x14c')});db[_0x4f0f('0x15c')][_0x4f0f('0x104')](db[_0x4f0f('0x153')],{'as':_0x4f0f('0x153'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x4f0f('0x4d')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x159')});db[_0x4f0f('0x50')]['belongsToMany'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':'UserFaxQueue'});db[_0x4f0f('0x50')][_0x4f0f('0x106')](db[_0x4f0f('0xdc')],{'through':'team_has_fax_queues','as':_0x4f0f('0x131')});db['FaxQueueReport']['belongsTo'](db[_0x4f0f('0x4d')],{});db[_0x4f0f('0x52')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':'List','foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x52')]['belongsTo'](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x52')][_0x4f0f('0x104')](db[_0x4f0f('0x101')],{});db[_0x4f0f('0x52')][_0x4f0f('0x104')](db[_0x4f0f('0x15c')],{});db[_0x4f0f('0x52')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{});db['FaxQueueReport'][_0x4f0f('0x104')](db[_0x4f0f('0x50')],{});db[_0x4f0f('0x53')]['hasMany'](db[_0x4f0f('0x80')],{'as':_0x4f0f('0x141'),'foreignKey':_0x4f0f('0x162')});db[_0x4f0f('0x53')][_0x4f0f('0xfa')](db['CannedAnswer'],{'as':_0x4f0f('0x142'),'foreignKey':_0x4f0f('0x162')});db[_0x4f0f('0x53')][_0x4f0f('0xfa')](db[_0x4f0f('0x56')],{'as':_0x4f0f('0x135'),'foreignKey':_0x4f0f('0x162')});db[_0x4f0f('0x53')][_0x4f0f('0xfa')](db['SmsInteraction'],{'as':_0x4f0f('0x15a')});db[_0x4f0f('0x53')][_0x4f0f('0xfa')](db[_0x4f0f('0x54')],{'as':'Applications'});db[_0x4f0f('0x53')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':'ListId'});db['SmsAccount'][_0x4f0f('0x104')](db[_0x4f0f('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f0f('0x12e')});db[_0x4f0f('0x53')][_0x4f0f('0x106')](db['User'],{'as':'Agents','through':_0x4f0f('0x163')});db[_0x4f0f('0x54')]['belongsTo'](db[_0x4f0f('0x13')],{'onDelete':_0x4f0f('0x156')});db['SmsApplication'][_0x4f0f('0x104')](db[_0x4f0f('0x58')],{'onDelete':_0x4f0f('0x156')});db['SmsApplication'][_0x4f0f('0x104')](db[_0x4f0f('0x53')],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x54')]['belongsTo'](db[_0x4f0f('0x82')],{'onDelete':'restrict','foreignKey':_0x4f0f('0x12d')});db[_0x4f0f('0x54')][_0x4f0f('0x104')](db[_0x4f0f('0x14d')],{'onDelete':_0x4f0f('0x156'),'foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0x4f0f('0x56')],{'as':_0x4f0f('0x135'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x4f0f('0x55')][_0x4f0f('0x104')](db[_0x4f0f('0x53')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x4f0f('0x55')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x55')]['belongsTo'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x15f'),'foreignKey':'UserId'});db[_0x4f0f('0x55')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x164'),'as':'Tags'});db[_0x4f0f('0x55')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':'sms_interaction_has_tags','as':_0x4f0f('0x150')});db[_0x4f0f('0x55')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x165'),'foreignKey':_0x4f0f('0x166')});db[_0x4f0f('0x56')][_0x4f0f('0x104')](db['User'],{'as':'User'});db[_0x4f0f('0x56')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x14c')});db['SmsMessage']['belongsTo'](db[_0x4f0f('0x55')],{'onDelete':'cascade','as':_0x4f0f('0x161'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x4f0f('0x104')](db[_0x4f0f('0x53')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x162')});db['SmsQueue']['belongsToMany'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x34'),'foreignKey':_0x4f0f('0x167')});db['SmsQueue']['belongsToMany'](db[_0x4f0f('0xdc')],{'through':_0x4f0f('0x168'),'as':'Teams'});db[_0x4f0f('0x118')][_0x4f0f('0xfa')](db[_0x4f0f('0x80')],{'as':_0x4f0f('0x141'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x4f0f('0xfa')](db[_0x4f0f('0x7e')],{'as':_0x4f0f('0x142'),'foreignKey':_0x4f0f('0x169')});db[_0x4f0f('0x118')][_0x4f0f('0xfa')](db[_0x4f0f('0x5d')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x4f0f('0x118')][_0x4f0f('0xfa')](db[_0x4f0f('0x5f')],{'as':_0x4f0f('0x135'),'foreignKey':_0x4f0f('0x169')});db[_0x4f0f('0x118')][_0x4f0f('0xfa')](db[_0x4f0f('0x5b')],{'as':_0x4f0f('0x121'),'foreignKey':_0x4f0f('0x169')});db[_0x4f0f('0x118')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x4f0f('0x104')](db['Pause'],{'as':_0x4f0f('0x145'),'foreignKey':_0x4f0f('0x12e')});db[_0x4f0f('0x118')][_0x4f0f('0x106')](db['User'],{'as':'Agents','through':_0x4f0f('0x16a')});db[_0x4f0f('0x5b')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x5b')][_0x4f0f('0x104')](db[_0x4f0f('0x61')],{'onDelete':_0x4f0f('0x156'),'foreignKey':_0x4f0f('0x16b')});db['OpenchannelApplication']['belongsTo'](db[_0x4f0f('0x118')],{'onDelete':'restrict','foreignKey':_0x4f0f('0x169')});db[_0x4f0f('0x5b')][_0x4f0f('0x104')](db[_0x4f0f('0x82')],{'onDelete':_0x4f0f('0x156'),'foreignKey':_0x4f0f('0x12d')});db['OpenchannelApplication'][_0x4f0f('0x104')](db[_0x4f0f('0x14d')],{'onDelete':_0x4f0f('0x156'),'foreignKey':'TagId'});db[_0x4f0f('0x5d')][_0x4f0f('0xfa')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x16c')});db[_0x4f0f('0x5d')]['belongsTo'](db[_0x4f0f('0x118')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x169')});db[_0x4f0f('0x5d')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db['OpenchannelInteraction']['belongsTo'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x15f'),'foreignKey':_0x4f0f('0xf9')});db[_0x4f0f('0x5d')]['belongsToMany'](db['Tag'],{'through':_0x4f0f('0x16d'),'as':_0x4f0f('0x14f')});db['OpenchannelInteraction']['belongsToMany'](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x16d'),'as':_0x4f0f('0x150')});db[_0x4f0f('0x5d')]['belongsToMany'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x10e'),'foreignKey':_0x4f0f('0x16c')});db[_0x4f0f('0x5f')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'onDelete':'cascade','as':_0x4f0f('0x13')});db[_0x4f0f('0x5f')]['belongsTo'](db[_0x4f0f('0x72')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x14c')});db['OpenchannelMessage'][_0x4f0f('0x104')](db[_0x4f0f('0x5d')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x161'),'foreignKey':_0x4f0f('0x16c')});db['OpenchannelMessage'][_0x4f0f('0x104')](db[_0x4f0f('0x153')],{'as':_0x4f0f('0x153'),'foreignKey':_0x4f0f('0x16e')});db[_0x4f0f('0x5f')][_0x4f0f('0x104')](db[_0x4f0f('0x118')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x4f0f('0x61')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x36'),'foreignKey':_0x4f0f('0x16b')});db[_0x4f0f('0x61')]['belongsToMany'](db[_0x4f0f('0xdc')],{'through':_0x4f0f('0x16f'),'as':'Teams'});db[_0x4f0f('0x170')]['hasMany'](db[_0x4f0f('0x80')],{'as':_0x4f0f('0x141'),'foreignKey':_0x4f0f('0x171')});db[_0x4f0f('0x170')][_0x4f0f('0xfa')](db['CannedAnswer'],{'as':_0x4f0f('0x142'),'foreignKey':_0x4f0f('0x171')});db[_0x4f0f('0x170')][_0x4f0f('0xfa')](db[_0x4f0f('0x6f')],{'as':'ProactiveActions'});db[_0x4f0f('0x170')][_0x4f0f('0xfa')](db[_0x4f0f('0x68')],{'as':'Interactions'});db['ChatWebsite'][_0x4f0f('0xfa')](db[_0x4f0f('0x66')],{'as':_0x4f0f('0x121')});db[_0x4f0f('0x170')][_0x4f0f('0xfa')](db[_0x4f0f('0x69')],{'as':_0x4f0f('0x135')});db['ChatWebsite']['belongsTo'](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x170')][_0x4f0f('0x104')](db[_0x4f0f('0x82')],{'as':_0x4f0f('0x82'),'foreignKey':'IntervalId'});db[_0x4f0f('0x170')][_0x4f0f('0x104')](db[_0x4f0f('0x84')],{'as':_0x4f0f('0x145'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f0f('0x170')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':'user_has_chat_websites'});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db[_0x4f0f('0x118')],{});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db['CmList'],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db['OpenchannelInteraction'],{});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db[_0x4f0f('0x5f')],{});db[_0x4f0f('0x64')][_0x4f0f('0x104')](db['User'],{});db['OpenchannelQueueReport'][_0x4f0f('0x104')](db[_0x4f0f('0x61')],{});db[_0x4f0f('0x66')][_0x4f0f('0x104')](db['User'],{'as':_0x4f0f('0x172'),'foreignKey':'UserId','onDelete':_0x4f0f('0x156')});db['ChatApplication'][_0x4f0f('0x104')](db[_0x4f0f('0x111')],{'as':_0x4f0f('0x173'),'foreignKey':_0x4f0f('0x174'),'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x66')][_0x4f0f('0x104')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x4f0f('0x171'),'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x66')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4f0f('0x157')});db[_0x4f0f('0x68')][_0x4f0f('0xfa')](db[_0x4f0f('0x69')],{'as':'Messages','onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x175')});db[_0x4f0f('0x68')][_0x4f0f('0x104')](db[_0x4f0f('0x170')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x171')});db[_0x4f0f('0x68')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x68')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x15f'),'foreignKey':'UserId'});db['ChatInteraction'][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x176'),'as':_0x4f0f('0x14f')});db[_0x4f0f('0x68')][_0x4f0f('0x106')](db['Tag'],{'through':_0x4f0f('0x176'),'as':_0x4f0f('0x150')});db[_0x4f0f('0x68')]['belongsToMany'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x10b'),'foreignKey':_0x4f0f('0x175')});db[_0x4f0f('0x69')]['belongsTo'](db[_0x4f0f('0x13')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x13')});db[_0x4f0f('0x69')]['belongsTo'](db[_0x4f0f('0x72')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x69')]['belongsTo'](db[_0x4f0f('0x68')],{'onDelete':'cascade','as':_0x4f0f('0x161'),'foreignKey':_0x4f0f('0x175')});db[_0x4f0f('0x69')][_0x4f0f('0x104')](db[_0x4f0f('0x153')],{'as':_0x4f0f('0x153'),'foreignKey':_0x4f0f('0x16e')});db[_0x4f0f('0x69')][_0x4f0f('0x104')](db['ChatWebsite'],{'as':_0x4f0f('0x155'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['belongsTo'](db[_0x4f0f('0x72')],{'onDelete':_0x4f0f('0x11d'),'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x6b')][_0x4f0f('0x104')](db[_0x4f0f('0x170')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x171')});db[_0x4f0f('0x111')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x2f'),'hooks':!![]});db['ChatQueue'][_0x4f0f('0x106')](db[_0x4f0f('0xdc')],{'through':_0x4f0f('0x177'),'as':_0x4f0f('0x131')});db[_0x4f0f('0x6d')][_0x4f0f('0xfa')](db[_0x4f0f('0xc9')],{'as':'Messages','foreignKey':_0x4f0f('0x178'),'onDelete':'cascade'});db[_0x4f0f('0x6d')]['belongsToMany'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x124'),'through':_0x4f0f('0x108')});db[_0x4f0f('0x6f')][_0x4f0f('0x104')](db[_0x4f0f('0x170')],{'as':_0x4f0f('0x179'),'foreignKey':_0x4f0f('0x171')});db[_0x4f0f('0x71')][_0x4f0f('0xfa')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x17a'),'foreignKey':_0x4f0f('0x17b')});db['CmContact']['hasMany'](db['CmHopper'],{'as':_0x4f0f('0x127'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x72')]['hasMany'](db[_0x4f0f('0x75')],{'as':_0x4f0f('0xff'),'foreignKey':_0x4f0f('0x13d')});db[_0x4f0f('0x72')][_0x4f0f('0xfa')](db[_0x4f0f('0x77')],{'as':_0x4f0f('0x128'),'foreignKey':_0x4f0f('0x13d')});db['CmContact'][_0x4f0f('0xfa')](db[_0x4f0f('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x4f0f('0x13d')});db['CmContact']['hasMany'](db['JscriptySessionReport'],{'as':_0x4f0f('0x12a'),'foreignKey':'ContactId'});db[_0x4f0f('0x72')][_0x4f0f('0xfa')](db['OpenchannelInteraction'],{'as':_0x4f0f('0x100'),'foreignKey':_0x4f0f('0x13d'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x4f0f('0x68')],{'as':_0x4f0f('0x17c'),'foreignKey':_0x4f0f('0x13d'),'onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x72')][_0x4f0f('0xfa')](db[_0x4f0f('0x55')],{'as':'SmsInteractions','foreignKey':_0x4f0f('0x13d'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x4f0f('0x101')],{'as':'FaxInteractions','foreignKey':_0x4f0f('0x13d'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x4f0f('0x41')],{'as':_0x4f0f('0x103'),'foreignKey':'ContactId','onDelete':_0x4f0f('0x156')});db[_0x4f0f('0x72')]['belongsTo'](db[_0x4f0f('0x71')],{'as':_0x4f0f('0x17d'),'foreignKey':'CompanyId'});db[_0x4f0f('0x72')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':'ListId','onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x72')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':'cm_user_has_contacts'});db[_0x4f0f('0x72')]['belongsToMany'](db[_0x4f0f('0x14d')],{'as':_0x4f0f('0x14f'),'through':'cm_contact_has_tags'});db[_0x4f0f('0x72')][_0x4f0f('0x106')](db['Tag'],{'through':_0x4f0f('0x17e'),'as':_0x4f0f('0x150')});db['CmHopper']['belongsTo'](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':_0x4f0f('0x13d'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x126')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':'List','foreignKey':_0x4f0f('0x144'),'onDelete':_0x4f0f('0x11d')});db['CmHopper']['belongsTo'](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x172'),'foreignKey':_0x4f0f('0xf9')});db['CmHopper'][_0x4f0f('0x104')](db[_0x4f0f('0x1a')],{'as':'Queue','foreignKey':_0x4f0f('0x125'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x126')][_0x4f0f('0x104')](db['Campaign'],{'as':_0x4f0f('0xe0'),'foreignKey':_0x4f0f('0x17f'),'onDelete':_0x4f0f('0x11d')});db['CmHopper'][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'as':'Owner','foreignKey':_0x4f0f('0x180')});db[_0x4f0f('0x181')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x14c'),'foreignKey':'ContactId','onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x181')]['belongsTo'](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x181')][_0x4f0f('0x104')](db[_0x4f0f('0x1a')],{'as':_0x4f0f('0x173'),'foreignKey':_0x4f0f('0x125'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x181')][_0x4f0f('0x104')](db[_0x4f0f('0xe0')],{'as':_0x4f0f('0xe0'),'foreignKey':_0x4f0f('0x17f'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x7c')][_0x4f0f('0xfa')](db['Condition'],{'as':{'plural':'All','singular':_0x4f0f('0x182')},'foreignKey':_0x4f0f('0x183'),'onDelete':_0x4f0f('0x11d'),'hooks':!![]});db[_0x4f0f('0x7c')]['hasMany'](db[_0x4f0f('0x81')],{'as':{'plural':'Any','singular':_0x4f0f('0x184')},'foreignKey':_0x4f0f('0x185'),'onDelete':_0x4f0f('0x11d'),'hooks':!![]});db[_0x4f0f('0x7c')][_0x4f0f('0xfa')](db['Action'],{'as':_0x4f0f('0x186'),'foreignKey':'AutomationId','onDelete':_0x4f0f('0x11d'),'hooks':!![]});db[_0x4f0f('0x82')][_0x4f0f('0xfa')](db[_0x4f0f('0x82')],{'as':_0x4f0f('0x187'),'foreignKey':_0x4f0f('0x12d'),'onDelete':_0x4f0f('0x11d'),'hooks':!![],'required':![]});db[_0x4f0f('0x82')][_0x4f0f('0xfa')](db[_0x4f0f('0x120')],{'as':_0x4f0f('0x188'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x4f0f('0x82')]['hasMany'](db[_0x4f0f('0x45')],{'as':_0x4f0f('0x189'),'foreignKey':_0x4f0f('0x12d')});db[_0x4f0f('0x82')]['hasMany'](db['ChatApplication'],{'as':_0x4f0f('0x18a'),'foreignKey':'IntervalId'});db['Interval'][_0x4f0f('0xfa')](db[_0x4f0f('0x15d')],{'as':'FaxApplications','foreignKey':_0x4f0f('0x12d')});db[_0x4f0f('0x82')][_0x4f0f('0xfa')](db[_0x4f0f('0x54')],{'as':_0x4f0f('0x18b'),'foreignKey':_0x4f0f('0x12d')});db[_0x4f0f('0x18c')][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{});db[_0x4f0f('0x18c')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x4f0f('0x18d')});db[_0x4f0f('0x18c')]['belongsTo'](db[_0x4f0f('0x95')],{'foreignKey':'CustomReportId'});db[_0x4f0f('0x8b')][_0x4f0f('0x106')](db[_0x4f0f('0x19')],{'as':'Mohs','through':_0x4f0f('0x123'),'onDelete':_0x4f0f('0x156')});db['Tag'][_0x4f0f('0x106')](db[_0x4f0f('0x72')],{'through':_0x4f0f('0x17e')});db[_0x4f0f('0x14d')][_0x4f0f('0x106')](db['ChatInteraction'],{'through':_0x4f0f('0x176')});db[_0x4f0f('0x14d')][_0x4f0f('0x106')](db['MailInteraction'],{'through':_0x4f0f('0x14e')});db['Tag'][_0x4f0f('0x106')](db[_0x4f0f('0x55')],{'through':_0x4f0f('0x164')});db[_0x4f0f('0x14d')][_0x4f0f('0x106')](db[_0x4f0f('0x101')],{'through':'fax_interaction_has_tags'});db[_0x4f0f('0x14d')][_0x4f0f('0x106')](db[_0x4f0f('0x5d')],{'through':'openchannel_interaction_has_tags'});db[_0x4f0f('0x8e')]['hasMany'](db[_0x4f0f('0x81')],{'as':{'plural':_0x4f0f('0x18e'),'singular':_0x4f0f('0x18f')},'foreignKey':_0x4f0f('0x190'),'onDelete':_0x4f0f('0x11d'),'hooks':!![]});db['Trigger'][_0x4f0f('0xfa')](db[_0x4f0f('0x81')],{'as':{'plural':_0x4f0f('0x191'),'singular':_0x4f0f('0x192')},'foreignKey':_0x4f0f('0x193'),'onDelete':'cascade','hooks':!![]});db[_0x4f0f('0x8e')][_0x4f0f('0xfa')](db[_0x4f0f('0x7a')],{'as':'Actions','foreignKey':_0x4f0f('0x194'),'onDelete':_0x4f0f('0x11d'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x4f0f('0x195')],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x197'),'hooks':!![]});db['AnalyticDefaultReport'][_0x4f0f('0xfa')](db[_0x4f0f('0x195')],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x18d')});db['AnalyticMetric'][_0x4f0f('0xfa')](db[_0x4f0f('0x195')],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x198')});db[_0x4f0f('0x195')]['belongsTo'](db[_0x4f0f('0x9a')],{'foreignKey':_0x4f0f('0x198')});db[_0x4f0f('0x9f')][_0x4f0f('0xfa')](db[_0x4f0f('0x199')],{'as':_0x4f0f('0x19a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':'AccountId'});db[_0x4f0f('0x199')][_0x4f0f('0xfa')](db[_0x4f0f('0x19b')],{'as':_0x4f0f('0x19c'),'onDelete':_0x4f0f('0x11d'),'foreignKey':'SubjectId'});db['SalesforceConfiguration']['hasMany'](db[_0x4f0f('0x19b')],{'as':_0x4f0f('0x19d'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0x199')][_0x4f0f('0xfa')](db['SalesforceField'],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0x199')][_0x4f0f('0x104')](db[_0x4f0f('0x9f')],{'as':'Account','foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0x19b')][_0x4f0f('0xfa')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x4f0f('0x1a1')});db['SalesforceField'][_0x4f0f('0xfa')](db[_0x4f0f('0x19b')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db['SalesforceField'][_0x4f0f('0xfa')](db[_0x4f0f('0x19b')],{'as':_0x4f0f('0x1a3'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0x19b')][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xa3')]['hasMany'](db[_0x4f0f('0xa5')],{'as':_0x4f0f('0x19a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':'AccountId'});db[_0x4f0f('0xa5')][_0x4f0f('0xfa')](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x19c'),'onDelete':'cascade','foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xa5')][_0x4f0f('0xfa')](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x19d'),'onDelete':_0x4f0f('0x11d'),'foreignKey':'DescriptionId'});db[_0x4f0f('0xa5')]['hasMany'](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x196'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x4f0f('0xa5')]['belongsTo'](db[_0x4f0f('0xa3')],{'as':'Account','foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xa7')][_0x4f0f('0xfa')](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xa7')][_0x4f0f('0xfa')](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xa7')][_0x4f0f('0xfa')](db[_0x4f0f('0xa7')],{'as':_0x4f0f('0x1a3'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xa7')][_0x4f0f('0x104')](db['Variable'],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db['DeskAccount'][_0x4f0f('0xfa')](db['DeskConfiguration'],{'as':_0x4f0f('0x19a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0x1a6')][_0x4f0f('0xfa')](db[_0x4f0f('0xab')],{'as':_0x4f0f('0x19c'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0x1a6')][_0x4f0f('0xfa')](db[_0x4f0f('0xab')],{'as':'Descriptions','onDelete':_0x4f0f('0x11d'),'foreignKey':'DescriptionId'});db[_0x4f0f('0x1a6')][_0x4f0f('0xfa')](db[_0x4f0f('0xab')],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0x1a6')][_0x4f0f('0x104')](db['DeskAccount'],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0x1a6')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x1a7')});db[_0x4f0f('0xab')][_0x4f0f('0xfa')](db['DeskField'],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db['DeskField'][_0x4f0f('0xfa')](db[_0x4f0f('0xab')],{'as':_0x4f0f('0x1a2'),'foreignKey':'DescriptionId'});db[_0x4f0f('0xab')]['hasMany'](db[_0x4f0f('0xab')],{'as':_0x4f0f('0x1a3'),'foreignKey':_0x4f0f('0x19f')});db['DeskField'][_0x4f0f('0x104')](db['Variable'],{'as':'Variable','foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xac')]['hasMany'](db[_0x4f0f('0xae')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xae')][_0x4f0f('0xfa')](db[_0x4f0f('0xb0')],{'as':_0x4f0f('0x19c'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xae')][_0x4f0f('0xfa')](db['ZohoField'],{'as':_0x4f0f('0x19d'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xae')]['hasMany'](db[_0x4f0f('0xb0')],{'as':_0x4f0f('0x196'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xae')]['belongsTo'](db[_0x4f0f('0xac')],{'as':_0x4f0f('0x155'),'foreignKey':'AccountId'});db[_0x4f0f('0xb0')][_0x4f0f('0xfa')](db[_0x4f0f('0xb0')],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xb0')][_0x4f0f('0xfa')](db[_0x4f0f('0xb0')],{'as':_0x4f0f('0x1a2'),'foreignKey':'DescriptionId'});db[_0x4f0f('0xb0')][_0x4f0f('0xfa')](db[_0x4f0f('0xb0')],{'as':_0x4f0f('0x1a3'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xb0')][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xb2')]['hasMany'](db[_0x4f0f('0xb3')],{'as':'Configurations','onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xb3')][_0x4f0f('0xfa')](db[_0x4f0f('0xb4')],{'as':_0x4f0f('0x19c'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xb3')][_0x4f0f('0xfa')](db[_0x4f0f('0xb4')],{'as':_0x4f0f('0x19d'),'foreignKey':_0x4f0f('0x19e')});db['ZendeskConfiguration'][_0x4f0f('0xfa')](db[_0x4f0f('0xb4')],{'as':_0x4f0f('0x196'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xb3')][_0x4f0f('0x104')](db[_0x4f0f('0xb2')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xb3')][_0x4f0f('0x106')](db[_0x4f0f('0x14d')],{'through':_0x4f0f('0x1a8')});db[_0x4f0f('0xb4')]['hasMany'](db['ZendeskField'],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xb4')]['hasMany'](db[_0x4f0f('0xb4')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xb4')]['hasMany'](db[_0x4f0f('0xb4')],{'as':'Field','foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xb4')][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xb6')][_0x4f0f('0xfa')](db[_0x4f0f('0xb7')],{'as':'Configurations','onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xb7')][_0x4f0f('0xfa')](db[_0x4f0f('0x1a9')],{'as':_0x4f0f('0x19c'),'onDelete':'cascade','foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xb7')][_0x4f0f('0xfa')](db['FreshdeskField'],{'as':_0x4f0f('0x19d'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xb7')][_0x4f0f('0xfa')](db[_0x4f0f('0x1a9')],{'as':_0x4f0f('0x196'),'onDelete':'cascade','foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x4f0f('0x104')](db[_0x4f0f('0xb6')],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xb7')]['belongsToMany'](db['Tag'],{'through':_0x4f0f('0x1aa')});db[_0x4f0f('0x1a9')][_0x4f0f('0xfa')](db[_0x4f0f('0x1a9')],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0x1a9')]['hasMany'](db[_0x4f0f('0x1a9')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0x1a9')][_0x4f0f('0xfa')](db[_0x4f0f('0x1a9')],{'as':'Field','foreignKey':_0x4f0f('0x19f')});db['FreshdeskField'][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xb8')][_0x4f0f('0xfa')](db['VtigerConfiguration'],{'as':_0x4f0f('0x19a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a0')});db['VtigerConfiguration'][_0x4f0f('0xfa')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xba')][_0x4f0f('0xfa')](db['VtigerField'],{'as':_0x4f0f('0x19d'),'foreignKey':'DescriptionId'});db[_0x4f0f('0xba')][_0x4f0f('0xfa')](db[_0x4f0f('0xbc')],{'as':_0x4f0f('0x196'),'foreignKey':_0x4f0f('0x19f')});db['VtigerConfiguration'][_0x4f0f('0x104')](db[_0x4f0f('0xb8')],{'as':'Account','foreignKey':'AccountId'});db[_0x4f0f('0xba')][_0x4f0f('0x106')](db['Tag'],{'through':_0x4f0f('0x1ab')});db[_0x4f0f('0xbc')][_0x4f0f('0xfa')](db[_0x4f0f('0xbc')],{'as':_0x4f0f('0x1a5'),'foreignKey':'SubjectId'});db[_0x4f0f('0xbc')][_0x4f0f('0xfa')](db[_0x4f0f('0xbc')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xbc')][_0x4f0f('0xfa')](db['VtigerField'],{'as':'Field','foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xbc')][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xbe')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x4f0f('0x19a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0x1ac')][_0x4f0f('0xfa')](db[_0x4f0f('0xc0')],{'as':'Subjects','foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0x1ac')]['hasMany'](db[_0x4f0f('0xc0')],{'as':_0x4f0f('0x19d'),'foreignKey':'DescriptionId'});db[_0x4f0f('0x1ac')]['hasMany'](db['ServicenowField'],{'as':_0x4f0f('0x196'),'foreignKey':_0x4f0f('0x19f')});db['ServicenowConfiguration'][_0x4f0f('0x104')](db['ServicenowAccount'],{'as':_0x4f0f('0x155'),'foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xc0')]['hasMany'](db[_0x4f0f('0xc0')],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xc0')]['hasMany'](db['ServicenowField'],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db['ServicenowField']['hasMany'](db[_0x4f0f('0xc0')],{'as':_0x4f0f('0x1a3'),'foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xc0')][_0x4f0f('0x104')](db['Variable'],{'as':_0x4f0f('0x90'),'foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0x1ad')]['hasMany'](db[_0x4f0f('0x1ae')],{'as':_0x4f0f('0x19a'),'onDelete':'cascade','foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0x1ae')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':_0x4f0f('0x19c'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4f0f('0x1ae')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':_0x4f0f('0x19d'),'onDelete':_0x4f0f('0x11d'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0x1ae')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':_0x4f0f('0x196'),'onDelete':'cascade','foreignKey':_0x4f0f('0x19f')});db['Dynamics365Configuration']['belongsTo'](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x4f0f('0x1a0')});db[_0x4f0f('0xc3')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':_0x4f0f('0x1a5'),'foreignKey':_0x4f0f('0x1a1')});db[_0x4f0f('0xc3')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':_0x4f0f('0x1a2'),'foreignKey':_0x4f0f('0x19e')});db[_0x4f0f('0xc3')][_0x4f0f('0xfa')](db[_0x4f0f('0xc3')],{'as':'Field','foreignKey':_0x4f0f('0x19f')});db[_0x4f0f('0xc3')][_0x4f0f('0x104')](db[_0x4f0f('0x90')],{'as':'Variable','foreignKey':_0x4f0f('0x1a4')});db[_0x4f0f('0xc7')]['belongsTo'](db['ChatWebsite'],{});db[_0x4f0f('0xc7')][_0x4f0f('0x104')](db['CmList'],{'as':_0x4f0f('0x143'),'foreignKey':'ListId'});db[_0x4f0f('0xc7')]['belongsTo'](db['CmContact'],{'as':_0x4f0f('0x14c'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x4f0f('0x104')](db['ChatInteraction'],{});db[_0x4f0f('0xc7')]['belongsTo'](db[_0x4f0f('0x69')],{});db[_0x4f0f('0xc7')]['belongsTo'](db[_0x4f0f('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0x4f0f('0x111')],{});db[_0x4f0f('0xc9')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x4f0f('0xc9')][_0x4f0f('0x104')](db['User'],{'onDelete':'cascade','foreignKey':_0x4f0f('0x1af')});db[_0x4f0f('0xce')][_0x4f0f('0xfa')](db['JscriptyQuestionReport'],{'foreignKey':_0x4f0f('0x1b0'),'onDelete':_0x4f0f('0x11d')});db['JscriptySessionReport']['hasMany'](db[_0x4f0f('0xcb')],{'foreignKey':_0x4f0f('0x1b0'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0x1b1')][_0x4f0f('0x104')](db[_0x4f0f('0x53')],{});db[_0x4f0f('0x1b1')][_0x4f0f('0x104')](db[_0x4f0f('0xf0')],{'as':_0x4f0f('0x143'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0x1b1')][_0x4f0f('0x104')](db[_0x4f0f('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f0f('0x1b1')][_0x4f0f('0x104')](db[_0x4f0f('0x55')],{});db[_0x4f0f('0x1b1')]['belongsTo'](db[_0x4f0f('0x56')],{});db['SmsQueueReport']['belongsTo'](db[_0x4f0f('0x13')],{});db[_0x4f0f('0x1b1')][_0x4f0f('0x104')](db[_0x4f0f('0x58')],{});db[_0x4f0f('0xd5')][_0x4f0f('0xfa')](db['JscriptySessionReport'],{'foreignKey':_0x4f0f('0x1b2')});db[_0x4f0f('0xd5')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x4f0f('0x1b2')});db[_0x4f0f('0xd5')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x4f0f('0x11a')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x151'),'through':_0x4f0f('0x1b3')});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':'user_has_teams'});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db['VoiceQueue'],{'through':_0x4f0f('0x132'),'as':_0x4f0f('0x10f')});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db[_0x4f0f('0x147')],{'through':_0x4f0f('0x14a'),'as':'MailQueues'});db[_0x4f0f('0xdc')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db[_0x4f0f('0x50')],{'through':'team_has_fax_queues','as':_0x4f0f('0x112')});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db[_0x4f0f('0x58')],{'through':_0x4f0f('0x168'),'as':_0x4f0f('0x113')});db[_0x4f0f('0xdc')][_0x4f0f('0x106')](db[_0x4f0f('0x61')],{'through':'team_has_openchannel_queues','as':_0x4f0f('0x114')});db[_0x4f0f('0xe0')][_0x4f0f('0xfa')](db[_0x4f0f('0x126')],{'as':_0x4f0f('0x127'),'foreignKey':_0x4f0f('0x17f')});db['Campaign'][_0x4f0f('0xfa')](db[_0x4f0f('0x75')],{'as':_0x4f0f('0xff'),'foreignKey':_0x4f0f('0x17f')});db[_0x4f0f('0xe0')][_0x4f0f('0xfa')](db[_0x4f0f('0x77')],{'as':_0x4f0f('0x128'),'foreignKey':_0x4f0f('0x17f')});db[_0x4f0f('0xe0')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x4f0f('0x17f')});db[_0x4f0f('0xe0')]['belongsTo'](db[_0x4f0f('0x12b')],{'as':_0x4f0f('0x12b'),'foreignKey':_0x4f0f('0x1b4')});db[_0x4f0f('0xe0')][_0x4f0f('0x104')](db[_0x4f0f('0x12b')],{'as':_0x4f0f('0x12c'),'foreignKey':_0x4f0f('0x1b5')});db[_0x4f0f('0xe0')][_0x4f0f('0x104')](db[_0x4f0f('0x82')],{'as':_0x4f0f('0x82'),'foreignKey':_0x4f0f('0x12d')});db['Campaign'][_0x4f0f('0x104')](db[_0x4f0f('0x11a')],{'as':_0x4f0f('0x11a'),'foreignKey':_0x4f0f('0x1b6')});db[_0x4f0f('0xe0')][_0x4f0f('0x106')](db[_0x4f0f('0xf0')],{'as':'Lists','through':_0x4f0f('0x1b7')});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0x4f0f('0x133'),'through':_0x4f0f('0x1b8')});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db[_0x4f0f('0x43')],{});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db[_0x4f0f('0x41')],{});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db['MailAccount'],{'foreignKey':_0x4f0f('0x1b9'),'as':_0x4f0f('0x1ba')});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bb'),'as':_0x4f0f('0x1bc')});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bd'),'as':_0x4f0f('0x1be')});db['MailTransferReport'][_0x4f0f('0x104')](db[_0x4f0f('0x147')],{'foreignKey':'ToMailQueueId','as':_0x4f0f('0x1bf')});db[_0x4f0f('0xe7')][_0x4f0f('0x104')](db[_0x4f0f('0x3c')],{'foreignKey':'ToMailAccountId','as':_0x4f0f('0x1c0')});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x69')],{});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x68')],{});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x170')],{'foreignKey':_0x4f0f('0x1c1'),'as':_0x4f0f('0x1ba')});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bb'),'as':_0x4f0f('0x1bc')});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bd'),'as':_0x4f0f('0x1be')});db['ChatTransferReport'][_0x4f0f('0x104')](db['ChatQueue'],{'foreignKey':_0x4f0f('0x1c2'),'as':_0x4f0f('0x1bf')});db[_0x4f0f('0xe9')][_0x4f0f('0x104')](db[_0x4f0f('0x170')],{'foreignKey':_0x4f0f('0x1c3'),'as':_0x4f0f('0x1c0')});db[_0x4f0f('0xeb')][_0x4f0f('0x104')](db[_0x4f0f('0x15c')],{});db[_0x4f0f('0xeb')][_0x4f0f('0x104')](db['FaxInteraction'],{});db[_0x4f0f('0xeb')][_0x4f0f('0x104')](db[_0x4f0f('0x4d')],{'foreignKey':_0x4f0f('0x1c4'),'as':'FromAccount'});db[_0x4f0f('0xeb')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bb'),'as':'FromAgent'});db['FaxTransferReport']['belongsTo'](db[_0x4f0f('0x13')],{'foreignKey':'ToUserId','as':_0x4f0f('0x1be')});db['FaxTransferReport'][_0x4f0f('0x104')](db[_0x4f0f('0x50')],{'foreignKey':_0x4f0f('0x1c5'),'as':_0x4f0f('0x1bf')});db[_0x4f0f('0xeb')][_0x4f0f('0x104')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x4f0f('0x1c0')});db[_0x4f0f('0xed')][_0x4f0f('0x104')](db[_0x4f0f('0x5f')],{});db[_0x4f0f('0xed')][_0x4f0f('0x104')](db[_0x4f0f('0x5d')],{});db[_0x4f0f('0xed')][_0x4f0f('0x104')](db['OpenchannelAccount'],{'foreignKey':_0x4f0f('0x1c6'),'as':_0x4f0f('0x1ba')});db[_0x4f0f('0xed')][_0x4f0f('0x104')](db['User'],{'foreignKey':_0x4f0f('0x1bb'),'as':_0x4f0f('0x1bc')});db[_0x4f0f('0xed')]['belongsTo'](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bd'),'as':_0x4f0f('0x1be')});db[_0x4f0f('0xed')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x4f0f('0x1c7'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x4f0f('0x104')](db[_0x4f0f('0x118')],{'foreignKey':_0x4f0f('0x1c8'),'as':_0x4f0f('0x1c0')});db[_0x4f0f('0xef')]['belongsTo'](db[_0x4f0f('0x56')],{});db[_0x4f0f('0xef')]['belongsTo'](db[_0x4f0f('0x55')],{});db[_0x4f0f('0xef')]['belongsTo'](db[_0x4f0f('0x53')],{'foreignKey':_0x4f0f('0x1c9'),'as':'FromAccount'});db['SmsTransferReport'][_0x4f0f('0x104')](db['User'],{'foreignKey':_0x4f0f('0x1bb'),'as':_0x4f0f('0x1bc')});db[_0x4f0f('0xef')][_0x4f0f('0x104')](db[_0x4f0f('0x13')],{'foreignKey':_0x4f0f('0x1bd'),'as':_0x4f0f('0x1be')});db[_0x4f0f('0xef')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x4f0f('0x1ca'),'as':_0x4f0f('0x1bf')});db[_0x4f0f('0xef')][_0x4f0f('0x104')](db['SmsAccount'],{'foreignKey':_0x4f0f('0x1cb'),'as':'ToAccount'});db[_0x4f0f('0xf0')][_0x4f0f('0xfa')](db[_0x4f0f('0x80')],{'as':'Dispositions','foreignKey':_0x4f0f('0x144')});db['CmList'][_0x4f0f('0xfa')](db['CmCustomField'],{'as':_0x4f0f('0x1cc'),'foreignKey':'ListId'});db[_0x4f0f('0xf0')][_0x4f0f('0xfa')](db[_0x4f0f('0x72')],{'as':_0x4f0f('0x17a'),'onDelete':_0x4f0f('0x11d'),'foreignKey':'ListId'});db[_0x4f0f('0xf0')]['hasMany'](db[_0x4f0f('0x75')],{'as':_0x4f0f('0xff'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0xf0')][_0x4f0f('0xfa')](db[_0x4f0f('0x77')],{'as':_0x4f0f('0x1cd'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0xf0')][_0x4f0f('0xfa')](db[_0x4f0f('0x78')],{'as':_0x4f0f('0x78'),'foreignKey':_0x4f0f('0x144')});db[_0x4f0f('0xf0')][_0x4f0f('0x106')](db[_0x4f0f('0x1a')],{'as':_0x4f0f('0x1ce'),'through':'voice_queues_has_cm_lists'});db[_0x4f0f('0xf0')][_0x4f0f('0x106')](db[_0x4f0f('0x13')],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x109')});db['VoicePrefix'][_0x4f0f('0xfa')](db[_0x4f0f('0x120')],{'as':_0x4f0f('0x188'),'onDelete':'restrict'});db[_0x4f0f('0xf2')][_0x4f0f('0x106')](db['User'],{'as':_0x4f0f('0x148'),'through':_0x4f0f('0x116')});db[_0x4f0f('0xf3')][_0x4f0f('0xfa')](db[_0x4f0f('0x13')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile'][_0x4f0f('0xfa')](db[_0x4f0f('0xf5')],{'as':_0x4f0f('0x1cf'),'foreignKey':_0x4f0f('0x105'),'onDelete':_0x4f0f('0x11d')});db[_0x4f0f('0xf5')][_0x4f0f('0xfa')](db[_0x4f0f('0xf7')],{'as':_0x4f0f('0x1d0'),'foreignKey':'sectionId','onDelete':_0x4f0f('0x11d')});module[_0x4f0f('0x1d1')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x5162=['JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteraction','MailInteractions','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','UserVoiceQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','MailAccountId','Smtp','Answers','Interactions','List','ListId','Template','TemplateId','ContactId','Owner','mail_interaction_has_tags','Tags','Users','user_has_mail_interactions','Attachments','Contact','Interaction','MailInteractionId','Account','restrict','TagId','Dashboard','Items','Dispositions','FaxAccountId','Applications','Exntensions','Messages','FaxQueue','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','Teams','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','cm_contact_has_tags','CampaignId','CmHopperBlack','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','Extensions','MailApplications','ChatApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','DescriptionId','Subject','SubjectId','Field','FieldId','SugarcrmConfiguration','SugarcrmField','Description','VariableId','DeskConfiguration','Descriptions','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','SquareProject','VoiceQueues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','Queues','user_has_voice_prefixes','UserProfileSections','Resources','exports','path','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/template/template.model','../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/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model'];(function(_0x29a08d,_0x551eca){var _0x10fc1a=function(_0x4a2117){while(--_0x4a2117){_0x29a08d['push'](_0x29a08d['shift']());}};_0x10fc1a(++_0x551eca);}(_0x5162,0x103));var _0x2516=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0x5162[_0x1f6fd5];return _0x587d12;};'use strict';var path=require(_0x2516('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x2516('0x1')]();config[_0x2516('0x2')]=_[_0x2516('0x3')](config[_0x2516('0x2')],{'database':_0x2516('0x4'),'username':_0x2516('0x5'),'password':_0x2516('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x2516('0x7')](),'define':{'charset':_0x2516('0x8'),'collate':_0x2516('0x9')}}});config[_0x2516('0xa')]=_[_0x2516('0x3')](config[_0x2516('0xa')],{'database':_0x2516('0x4'),'username':'xcall','password':_0x2516('0x6'),'options':{'host':_0x2516('0xb'),'port':0xcea,'dialect':_0x2516('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2516('0x2')][_0x2516('0xd')],config[_0x2516('0x2')][_0x2516('0xe')],config['sequelize'][_0x2516('0xf')],config[_0x2516('0x2')][_0x2516('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2516('0xa')][_0x2516('0xd')],config[_0x2516('0xa')][_0x2516('0xe')],config[_0x2516('0xa')][_0x2516('0xf')],config[_0x2516('0xa')][_0x2516('0x10')])};db[_0x2516('0x11')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x13'));db['VoiceChanSpy']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x14'));db['VoiceContext']=db[_0x2516('0x2')]['import']('../api/voiceContext/voiceContext.model');db[_0x2516('0x15')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x16'));db[_0x2516('0x17')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x18'));db[_0x2516('0x19')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x1a'));db[_0x2516('0x1b')]=db['sequelize']['import'](_0x2516('0x1c'));db[_0x2516('0x1d')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x1e'));db[_0x2516('0x1f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/voiceMail/voiceMail.model');db[_0x2516('0x20')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x21'));db['VoiceCallReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x22'));db[_0x2516('0x23')]=db[_0x2516('0x2')]['import'](_0x2516('0x24'));db[_0x2516('0x25')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x26'));db[_0x2516('0x27')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x28'));db['MemberReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x29'));db[_0x2516('0x2a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2b'));db[_0x2516('0x2c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2d'));db[_0x2516('0x2e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x2f'));db['UserVoiceQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x30'));db['UserChatQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x31'));db[_0x2516('0x32')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x33'));db[_0x2516('0x34')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x35'));db['UserSmsQueue']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x36'));db[_0x2516('0x37')]=db['sequelize']['import'](_0x2516('0x38'));db[_0x2516('0x39')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x3a'));db[_0x2516('0x3b')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x3c'));db[_0x2516('0x3d')]=db['sequelize']['import'](_0x2516('0x3e'));db[_0x2516('0x3f')]=db['sequelize']['import'](_0x2516('0x40'));db[_0x2516('0x41')]=db['sequelize'][_0x2516('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0x2516('0x42')]=db[_0x2516('0x2')]['import'](_0x2516('0x43'));db[_0x2516('0x44')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x45'));db[_0x2516('0x46')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x47'));db[_0x2516('0x48')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x49'));db['Dashboard']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/dashboard/dashboard.model');db[_0x2516('0x4a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x4b'));db[_0x2516('0x4c')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x4d'));db[_0x2516('0x4e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x4f'));db['FaxInteraction']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x50'));db[_0x2516('0x51')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x52'));db['FaxQueue']=db[_0x2516('0x2')]['import'](_0x2516('0x53'));db['FaxQueueReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x54'));db['SmsAccount']=db['sequelize'][_0x2516('0x12')](_0x2516('0x55'));db['SmsApplication']=db['sequelize'][_0x2516('0x12')](_0x2516('0x56'));db[_0x2516('0x57')]=db['sequelize'][_0x2516('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0x2516('0x58')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x59'));db['SmsQueue']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x5a'));db[_0x2516('0x5b')]=db[_0x2516('0x2')]['import'](_0x2516('0x5c'));db[_0x2516('0x5d')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0x2516('0x5e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x5f'));db[_0x2516('0x60')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x61'));db[_0x2516('0x62')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x63'));db['ChatWebsite']=db['sequelize']['import'](_0x2516('0x64'));db['OpenchannelQueueReport']=db['sequelize']['import'](_0x2516('0x65'));db[_0x2516('0x66')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x67'));db['ChatInteraction']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x68'));db['ChatMessage']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/chatMessage/chatMessage.model');db[_0x2516('0x69')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x6a'));db[_0x2516('0x6b')]=db['sequelize']['import'](_0x2516('0x6c'));db['ChatGroup']=db[_0x2516('0x2')]['import'](_0x2516('0x6d'));db[_0x2516('0x6e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x6f'));db[_0x2516('0x70')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x71'));db[_0x2516('0x72')]=db[_0x2516('0x2')]['import'](_0x2516('0x73'));db[_0x2516('0x74')]=db[_0x2516('0x2')]['import'](_0x2516('0x75'));db['CmHopperBlack']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x76'));db['CmHopperFinal']=db['sequelize']['import'](_0x2516('0x77'));db[_0x2516('0x78')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x2516('0x79')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x2516('0x7a')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7b'));db[_0x2516('0x7c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7d'));db[_0x2516('0x7e')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x7f'));db[_0x2516('0x80')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x81'));db[_0x2516('0x82')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x83'));db[_0x2516('0x84')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x85'));db[_0x2516('0x86')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x87'));db['Pause']=db['sequelize']['import'](_0x2516('0x88'));db[_0x2516('0x89')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x2516('0x2')]['import'](_0x2516('0x8a'));db[_0x2516('0x8b')]=db['sequelize'][_0x2516('0x12')](_0x2516('0x8c'));db[_0x2516('0x8d')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x8e'));db[_0x2516('0x8f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/tag/tag.model');db['Template']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x90'));db['Trigger']=db[_0x2516('0x2')]['import'](_0x2516('0x91'));db[_0x2516('0x92')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x93'));db[_0x2516('0x94')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x95'));db[_0x2516('0x96')]=db['sequelize']['import'](_0x2516('0x97'));db['AnalyticCustomReport']=db['sequelize'][_0x2516('0x12')](_0x2516('0x98'));db[_0x2516('0x99')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9a'));db[_0x2516('0x9b')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x2516('0x9c')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9d'));db['AnalyticFieldReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0x9e'));db[_0x2516('0x9f')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x2516('0xa0')]=db['sequelize']['import'](_0x2516('0xa1'));db[_0x2516('0xa2')]=db[_0x2516('0x2')]['import'](_0x2516('0xa3'));db[_0x2516('0xa4')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x2516('0xa5')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xa6'));db['SugarcrmConfiguration']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xa7'));db['SugarcrmField']=db[_0x2516('0x2')]['import'](_0x2516('0xa8'));db[_0x2516('0xa9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xaa'));db['DeskConfiguration']=db['sequelize']['import'](_0x2516('0xab'));db[_0x2516('0xac')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xad'));db[_0x2516('0xae')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xaf'));db['ZohoConfiguration']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb0'));db['ZohoField']=db['sequelize']['import'](_0x2516('0xb1'));db[_0x2516('0xb2')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0x2516('0x12')](_0x2516('0xb3'));db[_0x2516('0xb4')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb5'));db[_0x2516('0xb6')]=db[_0x2516('0x2')]['import'](_0x2516('0xb7'));db[_0x2516('0xb8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xb9'));db['FreshdeskField']=db[_0x2516('0x2')][_0x2516('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2516('0xba')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xbb'));db[_0x2516('0xbc')]=db[_0x2516('0x2')]['import'](_0x2516('0xbd'));db[_0x2516('0xbe')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xbf'));db[_0x2516('0xc0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc1'));db['ServicenowConfiguration']=db[_0x2516('0x2')]['import'](_0x2516('0xc2'));db[_0x2516('0xc3')]=db['sequelize']['import'](_0x2516('0xc4'));db[_0x2516('0xc5')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc6'));db[_0x2516('0xc7')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xc8'));db[_0x2516('0xc9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xca'));db[_0x2516('0x94')]=db[_0x2516('0x2')]['import']('../api/integration/integration.model');db[_0x2516('0xcb')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/network/network.model');db[_0x2516('0xcc')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xcd'));db[_0x2516('0xce')]=db[_0x2516('0x2')]['import'](_0x2516('0xcf'));db[_0x2516('0xd0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd1'));db[_0x2516('0xd2')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd3'));db[_0x2516('0xd4')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd5'));db[_0x2516('0xd6')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd7'));db[_0x2516('0xd8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xd9'));db[_0x2516('0xda')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xdb'));db[_0x2516('0xdc')]=db['sequelize'][_0x2516('0x12')]('../api/setting/setting.model');db[_0x2516('0xdd')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xde'));db['SquareProject']=db[_0x2516('0x2')]['import'](_0x2516('0xdf'));db[_0x2516('0xe0')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe1'));db[_0x2516('0xe2')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe3'));db['Team']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe4'));db[_0x2516('0xe5')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xe6'));db[_0x2516('0xe7')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/campaign/campaign.model');db[_0x2516('0xe8')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xe9'));db[_0x2516('0xea')]=db[_0x2516('0x2')]['import'](_0x2516('0xeb'));db['Plugin']=db[_0x2516('0x2')]['import']('../api/plugin/plugin.model');db[_0x2516('0xec')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x2516('0xed')]=db[_0x2516('0x2')]['import'](_0x2516('0xee'));db[_0x2516('0xef')]=db['sequelize']['import'](_0x2516('0xf0'));db[_0x2516('0xf1')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xf2'));db[_0x2516('0xf3')]=db['sequelize'][_0x2516('0x12')](_0x2516('0xf4'));db[_0x2516('0xf5')]=db[_0x2516('0x2')]['import'](_0x2516('0xf6'));db[_0x2516('0xf7')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x2516('0xf8')]=db[_0x2516('0x2')][_0x2516('0x12')]('../api/userProfile/userProfile.model');db[_0x2516('0xf9')]=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xfa'));db['UserProfileResource']=db[_0x2516('0x2')][_0x2516('0x12')](_0x2516('0xfb'));db[_0x2516('0x11')][_0x2516('0xfc')](db[_0x2516('0x1f')],{'as':'VoiceMail','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')]['hasMany'](db[_0x2516('0x1b')],{'as':_0x2516('0xff'),'foreignKey':'UserId'});db['User'][_0x2516('0x100')](db[_0x2516('0x2e')],{'as':_0x2516('0x101'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x15')],{'as':'Extensions','onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x102')],{'as':_0x2516('0x103'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x104'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')]['hasMany'](db[_0x2516('0x79')],{'as':_0x2516('0x79'),'foreignKey':'UserId'});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x5e')],{'as':_0x2516('0x105'),'foreignKey':_0x2516('0xfe')});db['User'][_0x2516('0x100')](db[_0x2516('0x106')],{'as':'ChatInteractions','foreignKey':_0x2516('0xfe')});db['User']['hasMany'](db[_0x2516('0x57')],{'as':_0x2516('0x107'),'foreignKey':_0x2516('0xfe')});db['User'][_0x2516('0x100')](db[_0x2516('0x108')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x2516('0x11')][_0x2516('0x100')](db[_0x2516('0x42')],{'as':_0x2516('0x109'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x11')][_0x2516('0x10a')](db[_0x2516('0xf8')],{'as':_0x2516('0xf8'),'foreignKey':'userProfileId'});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x10c')],{'as':_0x2516('0x10d'),'through':_0x2516('0x10e')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x72')],{'as':_0x2516('0x10f'),'through':_0x2516('0x110')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x111'),'through':_0x2516('0x112')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':_0x2516('0x114')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x42')],{'as':_0x2516('0x109'),'through':'user_has_mail_interactions'});db['User'][_0x2516('0x10b')](db[_0x2516('0x106')],{'as':_0x2516('0x115'),'through':_0x2516('0x116')});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x108')],{'as':_0x2516('0x117'),'through':_0x2516('0x118')});db[_0x2516('0x11')]['belongsToMany'](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x2516('0x119')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x5e')],{'as':'OpenchannelInteractions','through':_0x2516('0x11a')});db['User'][_0x2516('0x10b')](db[_0x2516('0x19')],{'as':'VoiceQueues','through':_0x2516('0x11b'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x3f')],{'as':_0x2516('0x11c'),'through':_0x2516('0x32'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x6b')],{'as':_0x2516('0x11d'),'through':_0x2516('0x11e'),'required':![],'hooks':!![]});db[_0x2516('0x11')][_0x2516('0x10b')](db['FaxQueue'],{'as':_0x2516('0x11f'),'through':_0x2516('0x34'),'required':![]});db[_0x2516('0x11')]['belongsToMany'](db[_0x2516('0x120')],{'as':_0x2516('0x121'),'through':_0x2516('0x122'),'required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x62')],{'as':_0x2516('0x123'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x2516('0x10b')](db[_0x2516('0xf5')],{'through':_0x2516('0x112')});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0xf7')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x2516('0x11')][_0x2516('0x10b')](db[_0x2516('0x124')],{'as':_0x2516('0x125'),'through':_0x2516('0x126')});db['User'][_0x2516('0x10b')](db[_0x2516('0x4c')],{'as':_0x2516('0x127'),'through':_0x2516('0x128')});db['User'][_0x2516('0x10b')](db['MailAccount'],{'as':_0x2516('0x129'),'through':'user_has_mail_accounts'});db['User'][_0x2516('0x10b')](db[_0x2516('0x5b')],{'as':'OpenchannelAccounts','through':_0x2516('0x12a')});db['User'][_0x2516('0x10b')](db[_0x2516('0x12b')],{'as':'SmsAccounts','through':_0x2516('0x12c')});db[_0x2516('0x11')]['belongsToMany'](db['SquareProject'],{'as':_0x2516('0x12d'),'through':_0x2516('0x12e')});db['VoiceChanSpy'][_0x2516('0x100')](db[_0x2516('0x15')],{'as':_0x2516('0x12f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x130')});db[_0x2516('0x131')][_0x2516('0x100')](db[_0x2516('0x15')],{'onDelete':_0x2516('0xfd')});db[_0x2516('0x15')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x2516('0xfd')});db[_0x2516('0x17')]['belongsToMany'](db[_0x2516('0x8d')],{'as':_0x2516('0x132'),'through':_0x2516('0x133')});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x2e')],{'as':_0x2516('0x134'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0x74')],{'as':_0x2516('0x136'),'foreignKey':_0x2516('0x135')});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x102')],{'as':_0x2516('0x103'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x2516('0x100')](db[_0x2516('0x79')],{'as':_0x2516('0x79'),'foreignKey':_0x2516('0x135')});db['VoiceQueue'][_0x2516('0x100')](db['CmHopperBlack'],{'as':_0x2516('0x138'),'foreignKey':'VoiceQueueId'});db[_0x2516('0x19')][_0x2516('0x100')](db[_0x2516('0xd4')],{'as':_0x2516('0x139'),'foreignKey':_0x2516('0x135')});db[_0x2516('0x19')][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x2a'),'foreignKey':_0x2516('0x13a')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x2a')],{'as':_0x2516('0x13b'),'foreignKey':_0x2516('0x13c')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x86')],{'as':_0x2516('0x86'),'foreignKey':_0x2516('0x13d')});db[_0x2516('0x19')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x111'),'through':_0x2516('0x141')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x11b')});db[_0x2516('0x19')][_0x2516('0x10b')](db[_0x2516('0x113')],{'as':'Teams','through':_0x2516('0x143')});db[_0x2516('0x19')]['belongsToMany'](db[_0x2516('0xf5')],{'as':_0x2516('0x144'),'through':_0x2516('0x145')});db[_0x2516('0x1b')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x11'),'foreignKey':'UserId'});db[_0x2516('0x1d')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x11'),'foreignKey':'UserId'});db[_0x2516('0x1f')][_0x2516('0x100')](db[_0x2516('0x20')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x146'),'sourceKey':_0x2516('0x147')});db[_0x2516('0x20')][_0x2516('0x10a')](db[_0x2516('0x1f')],{'foreignKey':_0x2516('0x146'),'targetKey':_0x2516('0x147')});db[_0x2516('0x148')]['hasMany'](db['VoiceQueueReport'],{'as':_0x2516('0x149'),'foreignKey':_0x2516('0x14a'),'constraints':![]});db[_0x2516('0x148')][_0x2516('0x100')](db[_0x2516('0x25')],{'as':'AgentReports','foreignKey':_0x2516('0x14a'),'constraints':![]});db[_0x2516('0x148')][_0x2516('0x10a')](db['User'],{'as':_0x2516('0x11'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x148')][_0x2516('0x10a')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailServerIn'][_0x2516('0x10a')](db['MailAccount'],{'as':_0x2516('0x3d'),'foreignKey':_0x2516('0x14b')});db['MailServerOut'][_0x2516('0x10a')](db[_0x2516('0x3d')],{'as':_0x2516('0x3d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')][_0x2516('0xfc')](db[_0x2516('0x39')],{'as':'Imap','onDelete':_0x2516('0xfd')});db[_0x2516('0x3d')][_0x2516('0xfc')](db['MailServerOut'],{'as':_0x2516('0x14c'),'onDelete':'cascade'});db[_0x2516('0x3d')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':'Dispositions','foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x80')],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x44')],{'as':'Messages','foreignKey':_0x2516('0x14b')});db[_0x2516('0x3d')][_0x2516('0x100')](db[_0x2516('0x42')],{'as':_0x2516('0x14e')});db[_0x2516('0x3d')]['hasMany'](db[_0x2516('0x46')],{'as':'Applications'});db[_0x2516('0x3d')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x3d')][_0x2516('0x10a')](db[_0x2516('0x151')],{'as':'Template','foreignKey':_0x2516('0x152')});db[_0x2516('0x3d')][_0x2516('0x10a')](db[_0x2516('0x13e')],{'as':'mandatoryDispositionPause','foreignKey':_0x2516('0x140')});db['MailAccount']['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserMailQueue'});db[_0x2516('0x3f')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':'team_has_mail_queues','as':'Teams'});db['MailInteraction'][_0x2516('0x100')](db[_0x2516('0x44')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0x2516('0x10a')](db[_0x2516('0x3d')],{'as':'Account','foreignKey':_0x2516('0x14b')});db[_0x2516('0x42')]['belongsTo'](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db['MailInteraction']['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'UserId'});db[_0x2516('0x42')]['belongsToMany'](db[_0x2516('0x8f')],{'through':_0x2516('0x155'),'as':_0x2516('0x156')});db[_0x2516('0x42')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x155'),'as':'ThroughTags'});db[_0x2516('0x42')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x158'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x2516('0x100')](db['Attachment'],{'as':_0x2516('0x159'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x44')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x11')});db[_0x2516('0x44')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15a')});db[_0x2516('0x44')][_0x2516('0x10a')](db[_0x2516('0x42')],{'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x15c')});db['MailMessage'][_0x2516('0x10a')](db['MailAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x14b')});db[_0x2516('0x46')][_0x2516('0x10a')](db['User'],{'onDelete':'restrict'});db['MailApplication'][_0x2516('0x10a')](db[_0x2516('0x3f')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x46')][_0x2516('0x10a')](db[_0x2516('0x3d')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x46')]['belongsTo'](db[_0x2516('0x86')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['MailApplication'][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':'restrict','foreignKey':_0x2516('0x15f')});db[_0x2516('0x48')][_0x2516('0x10a')](db['MailAccount'],{});db[_0x2516('0x48')][_0x2516('0x10a')](db['CmList'],{'as':'List','foreignKey':_0x2516('0x150')});db[_0x2516('0x48')]['belongsTo'](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['MailQueueReport'][_0x2516('0x10a')](db[_0x2516('0x42')],{});db[_0x2516('0x48')]['belongsTo'](db['MailMessage'],{});db[_0x2516('0x48')]['belongsTo'](db[_0x2516('0x11')],{});db[_0x2516('0x48')][_0x2516('0x10a')](db['MailQueue'],{});db[_0x2516('0x160')][_0x2516('0x100')](db[_0x2516('0x4a')],{'as':_0x2516('0x161'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x163')});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x80')],{'as':'Answers','foreignKey':_0x2516('0x163')});db[_0x2516('0x4c')][_0x2516('0x100')](db['FaxInteraction'],{'as':_0x2516('0x14e')});db[_0x2516('0x4c')][_0x2516('0x100')](db['FaxApplication'],{'as':_0x2516('0x164')});db['FaxAccount']['hasMany'](db[_0x2516('0x15')],{'as':_0x2516('0x165'),'onDelete':'cascade'});db[_0x2516('0x4c')][_0x2516('0x100')](db[_0x2516('0x51')],{'as':_0x2516('0x166')});db['FaxAccount'][_0x2516('0x10a')](db['Trunk'],{'as':_0x2516('0x2a')});db[_0x2516('0x4c')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x4c')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x4c')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x128')});db['FaxApplication'][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':'restrict'});db[_0x2516('0x4e')][_0x2516('0x10a')](db[_0x2516('0x167')],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x4e')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'onDelete':'restrict'});db[_0x2516('0x4e')]['belongsTo'](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':'TagId'});db[_0x2516('0x108')][_0x2516('0x100')](db[_0x2516('0x51')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x168')});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'as':'Account','foreignKey':_0x2516('0x163')});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':'ContactId'});db[_0x2516('0x108')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x169'),'as':_0x2516('0x156')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'fax_interaction_has_tags','as':_0x2516('0x16a')});db[_0x2516('0x108')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x118'),'foreignKey':_0x2516('0x168')});db[_0x2516('0x51')]['belongsTo'](db['User'],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0x2516('0x10a')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x2516('0x168')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':'cascade','as':_0x2516('0x15a')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0xea')],{'as':_0x2516('0xea'),'foreignKey':_0x2516('0x16b')});db[_0x2516('0x51')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x163')});db[_0x2516('0x167')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserFaxQueue'});db[_0x2516('0x167')]['belongsToMany'](db[_0x2516('0x113')],{'through':_0x2516('0x16c'),'as':_0x2516('0x16d')});db['FaxQueueReport'][_0x2516('0x10a')](db[_0x2516('0x4c')],{});db['FaxQueueReport'][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x2516('0x16e')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxInteraction'],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxMessage'],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0x16e')][_0x2516('0x10a')](db['FaxQueue'],{});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db['CannedAnswer'],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x58')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x12b')][_0x2516('0x100')](db[_0x2516('0x57')],{'as':'Interactions'});db[_0x2516('0x12b')]['hasMany'](db[_0x2516('0x170')],{'as':_0x2516('0x164')});db[_0x2516('0x12b')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x12b')]['belongsTo'](db[_0x2516('0x13e')],{'as':'mandatoryDispositionPause','foreignKey':_0x2516('0x140')});db[_0x2516('0x12b')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x12c')});db[_0x2516('0x170')]['belongsTo'](db[_0x2516('0x11')],{'onDelete':_0x2516('0x15e')});db['SmsApplication']['belongsTo'](db[_0x2516('0x120')],{'onDelete':_0x2516('0x15e')});db['SmsApplication'][_0x2516('0x10a')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0x2516('0x10a')](db[_0x2516('0x86')],{'onDelete':_0x2516('0x15e'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':_0x2516('0x15f')});db[_0x2516('0x57')]['hasMany'](db[_0x2516('0x58')],{'as':_0x2516('0x166'),'onDelete':'cascade','foreignKey':_0x2516('0x171')});db[_0x2516('0x57')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x16f')});db[_0x2516('0x57')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2516('0x57')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x57')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x172'),'as':_0x2516('0x156')});db[_0x2516('0x57')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x172'),'as':_0x2516('0x16a')});db[_0x2516('0x57')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x119'),'foreignKey':_0x2516('0x171')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x11')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':'Contact'});db['SmsMessage'][_0x2516('0x10a')](db[_0x2516('0x57')],{'onDelete':_0x2516('0xfd'),'as':'Interaction','foreignKey':_0x2516('0x171')});db[_0x2516('0x58')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'as':'Account','foreignKey':_0x2516('0x16f')});db['SmsQueue'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x122'),'foreignKey':_0x2516('0x173')});db[_0x2516('0x120')]['belongsToMany'](db[_0x2516('0x113')],{'through':'team_has_sms_queues','as':_0x2516('0x16d')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db['CannedAnswer'],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x5e')],{'as':_0x2516('0x14e'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')][_0x2516('0x100')](db[_0x2516('0x60')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x5b')]['hasMany'](db[_0x2516('0x5d')],{'as':_0x2516('0x164'),'foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5b')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':_0x2516('0x150')});db[_0x2516('0x5b')][_0x2516('0x10a')](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':_0x2516('0x140')});db[_0x2516('0x5b')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'user_has_openchannel_accounts'});db[_0x2516('0x5d')][_0x2516('0x10a')](db['User'],{'onDelete':_0x2516('0x15e')});db[_0x2516('0x5d')]['belongsTo'](db[_0x2516('0x62')],{'onDelete':'restrict','foreignKey':_0x2516('0x175')});db[_0x2516('0x5d')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5d')][_0x2516('0x10a')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x2516('0x13d')});db['OpenchannelApplication'][_0x2516('0x10a')](db['Tag'],{'onDelete':_0x2516('0x15e'),'foreignKey':_0x2516('0x15f')});db['OpenchannelInteraction'][_0x2516('0x100')](db[_0x2516('0x60')],{'as':_0x2516('0x166'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x176')});db[_0x2516('0x5e')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'as':_0x2516('0x15d'),'foreignKey':'OpenchannelAccountId'});db[_0x2516('0x5e')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':'Contact','foreignKey':_0x2516('0x153')});db[_0x2516('0x5e')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'UserId'});db[_0x2516('0x5e')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x177'),'as':_0x2516('0x156')});db[_0x2516('0x5e')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'openchannel_interaction_has_tags','as':_0x2516('0x16a')});db[_0x2516('0x5e')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':'user_has_openchannel_interactions','foreignKey':_0x2516('0x176')});db[_0x2516('0x60')][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':'cascade','as':_0x2516('0x11')});db[_0x2516('0x60')][_0x2516('0x10a')](db['CmContact'],{'onDelete':_0x2516('0xfd'),'as':'Contact'});db[_0x2516('0x60')][_0x2516('0x10a')](db[_0x2516('0x5e')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x176')});db['OpenchannelMessage'][_0x2516('0x10a')](db[_0x2516('0xea')],{'as':_0x2516('0xea'),'foreignKey':_0x2516('0x16b')});db[_0x2516('0x60')][_0x2516('0x10a')](db['OpenchannelAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x174')});db[_0x2516('0x62')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x37'),'foreignKey':_0x2516('0x175')});db[_0x2516('0x62')][_0x2516('0x10b')](db['Team'],{'through':_0x2516('0x178'),'as':_0x2516('0x16d')});db[_0x2516('0x124')]['hasMany'](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x80')],{'as':_0x2516('0x14d'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x6e')],{'as':_0x2516('0x17a')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x106')],{'as':_0x2516('0x14e')});db['ChatWebsite'][_0x2516('0x100')](db['ChatApplication'],{'as':_0x2516('0x164')});db[_0x2516('0x124')][_0x2516('0x100')](db[_0x2516('0x17b')],{'as':'Messages'});db['ChatWebsite'][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0x124')][_0x2516('0x10a')](db[_0x2516('0x86')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x2516('0x124')]['belongsTo'](db[_0x2516('0x13e')],{'as':_0x2516('0x13f'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Agents','through':_0x2516('0x126')});db[_0x2516('0x17c')]['belongsTo'](db[_0x2516('0x5b')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x2516('0x17c')][_0x2516('0x10a')](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x5e')],{});db[_0x2516('0x17c')]['belongsTo'](db[_0x2516('0x60')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0x17c')][_0x2516('0x10a')](db[_0x2516('0x62')],{});db['ChatApplication'][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x17d'),'foreignKey':_0x2516('0xfe'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x66')][_0x2516('0x10a')](db['ChatQueue'],{'as':_0x2516('0x17e'),'foreignKey':_0x2516('0x17f'),'onDelete':'restrict'});db[_0x2516('0x66')][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':_0x2516('0x180'),'foreignKey':_0x2516('0x179'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x66')][_0x2516('0x10a')](db[_0x2516('0x8f')],{'onDelete':_0x2516('0x15e'),'foreignKey':'TagId'});db[_0x2516('0x106')][_0x2516('0x100')](db[_0x2516('0x17b')],{'as':'Messages','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x181')});db['ChatInteraction'][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x179')});db['ChatInteraction'][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':'ContactId'});db[_0x2516('0x106')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':_0x2516('0xfe')});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x182'),'as':'Tags'});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x182'),'as':_0x2516('0x16a')});db[_0x2516('0x106')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x116'),'foreignKey':_0x2516('0x181')});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x11')],{'onDelete':_0x2516('0xfd'),'as':'User'});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':'cascade','as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x17b')][_0x2516('0x10a')](db[_0x2516('0x106')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15b'),'foreignKey':_0x2516('0x181')});db[_0x2516('0x17b')][_0x2516('0x10a')](db['Attachment'],{'as':_0x2516('0xea'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0x2516('0x124')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x69')][_0x2516('0x10a')](db[_0x2516('0x72')],{'onDelete':_0x2516('0xfd'),'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db[_0x2516('0x69')][_0x2516('0x10a')](db[_0x2516('0x124')],{'as':'Account','foreignKey':_0x2516('0x179')});db[_0x2516('0x6b')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'UserChatQueue','hooks':!![]});db[_0x2516('0x6b')][_0x2516('0x10b')](db[_0x2516('0x113')],{'through':_0x2516('0x183'),'as':'Teams'});db['ChatGroup'][_0x2516('0x100')](db[_0x2516('0xce')],{'as':_0x2516('0x166'),'foreignKey':_0x2516('0x184'),'onDelete':'cascade'});db['ChatGroup'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x134'),'through':_0x2516('0x10e')});db['ChatProactiveAction'][_0x2516('0x10a')](db['ChatWebsite'],{'as':_0x2516('0x180'),'foreignKey':_0x2516('0x179')});db[_0x2516('0x70')][_0x2516('0x100')](db[_0x2516('0x72')],{'as':_0x2516('0x10f'),'foreignKey':_0x2516('0x185')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x74')],{'as':'Hoppers','foreignKey':_0x2516('0x153')});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':'ContactId'});db['CmContact'][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':_0x2516('0x153')});db['CmContact'][_0x2516('0x100')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x2516('0x153')});db[_0x2516('0x72')]['hasMany'](db['JscriptySessionReport'],{'as':_0x2516('0x139'),'foreignKey':'ContactId'});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x5e')],{'as':_0x2516('0x105'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x106')],{'as':_0x2516('0x115'),'foreignKey':'ContactId','onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db[_0x2516('0x57')],{'as':_0x2516('0x107'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')]['hasMany'](db[_0x2516('0x108')],{'as':_0x2516('0x117'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x100')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0x15e')});db[_0x2516('0x72')][_0x2516('0x10a')](db[_0x2516('0x70')],{'as':'Company','foreignKey':_0x2516('0x185')});db[_0x2516('0x72')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db['CmContact'][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'through':_0x2516('0x110')});db['CmContact']['belongsToMany'](db[_0x2516('0x8f')],{'as':'Tags','through':_0x2516('0x186')});db[_0x2516('0x72')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'cm_contact_has_tags','as':_0x2516('0x16a')});db['CmHopper'][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')]['belongsTo'](db[_0x2516('0x11')],{'as':_0x2516('0x17d'),'foreignKey':'UserId'});db[_0x2516('0x74')][_0x2516('0x10a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x2516('0x135'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')]['belongsTo'](db[_0x2516('0xe7')],{'as':_0x2516('0xe7'),'foreignKey':_0x2516('0x187'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x74')][_0x2516('0x10a')](db[_0x2516('0x11')],{'as':_0x2516('0x154'),'foreignKey':'OwnerId'});db[_0x2516('0x188')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153'),'onDelete':'cascade'});db[_0x2516('0x188')]['belongsTo'](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x188')][_0x2516('0x10a')](db['VoiceQueue'],{'as':_0x2516('0x17e'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x2516('0x188')][_0x2516('0x10a')](db[_0x2516('0xe7')],{'as':_0x2516('0xe7'),'foreignKey':_0x2516('0x187'),'onDelete':_0x2516('0xfd')});db[_0x2516('0x7e')][_0x2516('0x100')](db[_0x2516('0x84')],{'as':{'plural':'All','singular':_0x2516('0x189')},'foreignKey':_0x2516('0x18a'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0x2516('0x84')],{'as':{'plural':_0x2516('0x18b'),'singular':_0x2516('0x18c')},'foreignKey':_0x2516('0x18d'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x7e')][_0x2516('0x100')](db['Action'],{'as':'Actions','foreignKey':_0x2516('0x18e'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db['Interval'][_0x2516('0x100')](db[_0x2516('0x86')],{'as':'Intervals','foreignKey':_0x2516('0x13d'),'onDelete':_0x2516('0xfd'),'hooks':!![],'required':![]});db[_0x2516('0x86')]['hasMany'](db[_0x2516('0x15')],{'as':_0x2516('0x18f'),'foreignKey':_0x2516('0x13d'),'onDelete':'restrict'});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x46')],{'as':_0x2516('0x190'),'foreignKey':_0x2516('0x13d')});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x66')],{'as':_0x2516('0x191'),'foreignKey':'IntervalId'});db['Interval'][_0x2516('0x100')](db[_0x2516('0x4e')],{'as':'FaxApplications','foreignKey':_0x2516('0x13d')});db[_0x2516('0x86')][_0x2516('0x100')](db[_0x2516('0x170')],{'as':_0x2516('0x192'),'foreignKey':'IntervalId'});db[_0x2516('0x8b')][_0x2516('0x10a')](db['MailAccount'],{});db[_0x2516('0x8b')][_0x2516('0x10a')](db[_0x2516('0x99')],{'foreignKey':_0x2516('0x193')});db[_0x2516('0x8b')][_0x2516('0x10a')](db[_0x2516('0x194')],{'foreignKey':_0x2516('0x195')});db[_0x2516('0x8d')][_0x2516('0x10b')](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x2516('0x15e')});db[_0x2516('0x8f')][_0x2516('0x10b')](db[_0x2516('0x72')],{'through':_0x2516('0x186')});db[_0x2516('0x8f')][_0x2516('0x10b')](db['ChatInteraction'],{'through':_0x2516('0x182')});db['Tag']['belongsToMany'](db[_0x2516('0x42')],{'through':_0x2516('0x155')});db['Tag'][_0x2516('0x10b')](db[_0x2516('0x57')],{'through':_0x2516('0x172')});db['Tag']['belongsToMany'](db[_0x2516('0x108')],{'through':_0x2516('0x169')});db[_0x2516('0x8f')][_0x2516('0x10b')](db[_0x2516('0x5e')],{'through':'openchannel_interaction_has_tags'});db[_0x2516('0x196')][_0x2516('0x100')](db[_0x2516('0x84')],{'as':{'plural':_0x2516('0x197'),'singular':_0x2516('0x198')},'foreignKey':_0x2516('0x199'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x196')][_0x2516('0x100')](db['Condition'],{'as':{'plural':_0x2516('0x19a'),'singular':_0x2516('0x19b')},'foreignKey':_0x2516('0x19c'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x196')][_0x2516('0x100')](db[_0x2516('0x7c')],{'as':'Actions','foreignKey':_0x2516('0x19d'),'onDelete':_0x2516('0xfd'),'hooks':!![]});db[_0x2516('0x194')]['hasMany'](db[_0x2516('0x19e')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x195'),'hooks':!![]});db[_0x2516('0x99')][_0x2516('0x100')](db[_0x2516('0x19e')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x193')});db['AnalyticMetric'][_0x2516('0x100')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x2516('0xfd'),'foreignKey':'MetricId'});db[_0x2516('0x19e')][_0x2516('0x10a')](db[_0x2516('0x9c')],{'foreignKey':_0x2516('0x1a0')});db[_0x2516('0xa0')][_0x2516('0x100')](db[_0x2516('0xa2')],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xa2')][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':'SubjectId'});db[_0x2516('0xa2')][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db['SalesforceConfiguration'][_0x2516('0x100')](db['SalesforceField'],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':'FieldId'});db[_0x2516('0xa2')]['belongsTo'](db[_0x2516('0xa0')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db['SalesforceField'][_0x2516('0x100')](db[_0x2516('0xa4')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xa4')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x2516('0x1a4')});db['SalesforceField'][_0x2516('0x100')](db['SalesforceField'],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xa4')]['belongsTo'](db['Variable'],{'as':_0x2516('0x92'),'foreignKey':'VariableId'});db[_0x2516('0xa5')][_0x2516('0x100')](db[_0x2516('0x1a9')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1a9')][_0x2516('0x100')](db['SugarcrmField'],{'as':_0x2516('0x1a3'),'onDelete':'cascade','foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1a9')]['hasMany'](db[_0x2516('0x1aa')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1a9')][_0x2516('0x100')](db['SugarcrmField'],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':'FieldId'});db[_0x2516('0x1a9')]['belongsTo'](db[_0x2516('0xa5')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1aa')][_0x2516('0x100')](db[_0x2516('0x1aa')],{'as':'Field','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1aa')]['belongsTo'](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xa9')][_0x2516('0x100')](db[_0x2516('0x1ad')],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['DeskConfiguration'][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':'SubjectId'});db[_0x2516('0x1ad')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1ae'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1ad')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1ad')][_0x2516('0x10a')](db['DeskAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db['DeskConfiguration'][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x1af')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':'Description','foreignKey':_0x2516('0x1a4')});db[_0x2516('0xac')][_0x2516('0x100')](db[_0x2516('0xac')],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xac')][_0x2516('0x10a')](db['Variable'],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xae')][_0x2516('0x100')](db['ZohoConfiguration'],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':'Descriptions','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1b0')][_0x2516('0x100')](db[_0x2516('0x1b1')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1b0')]['belongsTo'](db[_0x2516('0xae')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b1')][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1ab'),'foreignKey':'DescriptionId'});db[_0x2516('0x1b1')][_0x2516('0x100')](db['ZohoField'],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0x1b1')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xb2')][_0x2516('0x100')](db[_0x2516('0x1b2')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b2')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x1a3'),'foreignKey':_0x2516('0x1a6')});db['ZendeskConfiguration']['hasMany'](db[_0x2516('0xb4')],{'as':_0x2516('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2516('0x1b2')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x19f'),'foreignKey':'FieldId'});db[_0x2516('0x1b2')][_0x2516('0x10a')](db[_0x2516('0xb2')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b2')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':_0x2516('0x1b3')});db['ZendeskField'][_0x2516('0x100')](db['ZendeskField'],{'as':_0x2516('0x1a5'),'foreignKey':'SubjectId'});db[_0x2516('0xb4')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':'Description','foreignKey':_0x2516('0x1a4')});db[_0x2516('0xb4')][_0x2516('0x100')](db[_0x2516('0xb4')],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xb4')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x2516('0x100')](db[_0x2516('0xb8')],{'as':_0x2516('0x1a1'),'onDelete':'cascade','foreignKey':_0x2516('0x1a2')});db['FreshdeskConfiguration']['hasMany'](db[_0x2516('0x1b4')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xb8')]['hasMany'](db[_0x2516('0x1b4')],{'as':_0x2516('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2516('0xb8')][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x19f'),'onDelete':'cascade','foreignKey':_0x2516('0x1a8')});db[_0x2516('0xb8')][_0x2516('0x10a')](db[_0x2516('0xb6')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xb8')][_0x2516('0x10b')](db['Tag'],{'through':_0x2516('0x1b5')});db['FreshdeskField'][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0x1b4')][_0x2516('0x100')](db[_0x2516('0x1b4')],{'as':_0x2516('0x1ab'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x2516('0x1b4')],{'as':'Field','foreignKey':_0x2516('0x1a8')});db[_0x2516('0x1b4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x2516('0x1ac')});db[_0x2516('0xba')]['hasMany'](db[_0x2516('0xbc')],{'as':'Configurations','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['VtigerConfiguration'][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a3'),'foreignKey':_0x2516('0x1a6')});db[_0x2516('0xbc')]['hasMany'](db['VtigerField'],{'as':_0x2516('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2516('0xbc')][_0x2516('0x100')](db['VtigerField'],{'as':'Fields','foreignKey':_0x2516('0x1a8')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xbc')][_0x2516('0x10b')](db[_0x2516('0x8f')],{'through':'int_vtiger_configuration_has_tags'});db[_0x2516('0xbe')][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db['VtigerField']['hasMany'](db[_0x2516('0xbe')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xbe')][_0x2516('0x100')](db[_0x2516('0xbe')],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0xbe')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':'Variable','foreignKey':_0x2516('0x1ac')});db['ServicenowAccount'][_0x2516('0x100')](db[_0x2516('0x1b6')],{'as':'Configurations','onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0x1b6')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a3'),'foreignKey':'SubjectId'});db[_0x2516('0x1b6')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1ae'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0x1b6')]['hasMany'](db[_0x2516('0xc3')],{'as':_0x2516('0x19f'),'foreignKey':'FieldId'});db[_0x2516('0x1b6')][_0x2516('0x10a')](db[_0x2516('0xc0')],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xc3')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a5'),'foreignKey':_0x2516('0x1a6')});db['ServicenowField'][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xc3')][_0x2516('0x100')](db['ServicenowField'],{'as':_0x2516('0x1a7'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xc3')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xc5')][_0x2516('0x100')](db['Dynamics365Configuration'],{'as':_0x2516('0x1a1'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a2')});db['Dynamics365Configuration']['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x1a3'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a6')});db['Dynamics365Configuration'][_0x2516('0x100')](db[_0x2516('0xc9')],{'as':_0x2516('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2516('0xc7')]['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x19f'),'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1a8')});db[_0x2516('0xc7')][_0x2516('0x10a')](db['Dynamics365Account'],{'as':_0x2516('0x15d'),'foreignKey':_0x2516('0x1a2')});db[_0x2516('0xc9')]['hasMany'](db[_0x2516('0xc9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x2516('0xc9')]['hasMany'](db[_0x2516('0xc9')],{'as':_0x2516('0x1ab'),'foreignKey':_0x2516('0x1a4')});db[_0x2516('0xc9')][_0x2516('0x100')](db[_0x2516('0xc9')],{'as':_0x2516('0x1a7'),'foreignKey':'FieldId'});db[_0x2516('0xc9')][_0x2516('0x10a')](db[_0x2516('0x92')],{'as':_0x2516('0x92'),'foreignKey':_0x2516('0x1ac')});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x124')],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0xf5')],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x72')],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['ChatQueueReport'][_0x2516('0x10a')](db[_0x2516('0x106')],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db['ChatMessage'],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db['User'],{});db[_0x2516('0xcc')][_0x2516('0x10a')](db[_0x2516('0x6b')],{});db[_0x2516('0xce')]['belongsTo'](db[_0x2516('0x11')],{'onDelete':_0x2516('0xfd'),'foreignKey':_0x2516('0x1b7')});db[_0x2516('0xce')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x2516('0x1b8')});db[_0x2516('0xd4')]['hasMany'](db[_0x2516('0xd2')],{'foreignKey':_0x2516('0x1b9'),'onDelete':_0x2516('0xfd')});db[_0x2516('0xd4')]['hasMany'](db[_0x2516('0xd0')],{'foreignKey':'SessionId','onDelete':_0x2516('0xfd')});db[_0x2516('0xd6')]['belongsTo'](db[_0x2516('0x12b')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db['CmList'],{'as':_0x2516('0x14f'),'foreignKey':_0x2516('0x150')});db['SmsQueueReport'][_0x2516('0x10a')](db['CmContact'],{'as':_0x2516('0x15a'),'foreignKey':_0x2516('0x153')});db['SmsQueueReport']['belongsTo'](db[_0x2516('0x57')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x58')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x11')],{});db[_0x2516('0xd6')][_0x2516('0x10a')](db[_0x2516('0x120')],{});db[_0x2516('0xda')][_0x2516('0x100')](db['JscriptySessionReport'],{'foreignKey':_0x2516('0x1ba')});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x2516('0x1ba')});db[_0x2516('0xda')][_0x2516('0x100')](db[_0x2516('0xd0')],{'foreignKey':_0x2516('0x1ba')});db[_0x2516('0x1bb')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':'Users','through':_0x2516('0x12e')});db[_0x2516('0x113')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x2516('0x114')});db[_0x2516('0x113')]['belongsToMany'](db[_0x2516('0x19')],{'through':'team_has_voice_queues','as':_0x2516('0x1bc')});db[_0x2516('0x113')][_0x2516('0x10b')](db[_0x2516('0x3f')],{'through':'team_has_mail_queues','as':_0x2516('0x11c')});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0x2516('0x183'),'as':'ChatQueues'});db[_0x2516('0x113')][_0x2516('0x10b')](db[_0x2516('0x167')],{'through':_0x2516('0x16c'),'as':_0x2516('0x11f')});db['Team'][_0x2516('0x10b')](db[_0x2516('0x120')],{'through':'team_has_sms_queues','as':_0x2516('0x121')});db[_0x2516('0x113')]['belongsToMany'](db[_0x2516('0x62')],{'through':_0x2516('0x178'),'as':'OpenchannelQueues'});db['Campaign'][_0x2516('0x100')](db[_0x2516('0x74')],{'as':_0x2516('0x136'),'foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x78')],{'as':_0x2516('0x137'),'foreignKey':_0x2516('0x187')});db[_0x2516('0xe7')][_0x2516('0x100')](db[_0x2516('0x188')],{'as':_0x2516('0x138'),'foreignKey':'CampaignId'});db['Campaign'][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x2a'),'foreignKey':_0x2516('0x13a')});db['Campaign'][_0x2516('0x10a')](db[_0x2516('0x2a')],{'as':_0x2516('0x13b'),'foreignKey':_0x2516('0x13c')});db[_0x2516('0xe7')]['belongsTo'](db['Interval'],{'as':_0x2516('0x86'),'foreignKey':'IntervalId'});db[_0x2516('0xe7')][_0x2516('0x10a')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0x2516('0x1bd')});db['Campaign'][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x2516('0xe7')][_0x2516('0x10b')](db[_0x2516('0xf5')],{'as':_0x2516('0x144'),'through':_0x2516('0x1be')});db[_0x2516('0xec')]['belongsTo'](db[_0x2516('0x44')],{});db[_0x2516('0xec')][_0x2516('0x10a')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0x2516('0x3d')],{'foreignKey':_0x2516('0x1bf'),'as':_0x2516('0x1c0')});db['MailTransferReport'][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xec')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xec')][_0x2516('0x10a')](db[_0x2516('0x3f')],{'foreignKey':_0x2516('0x1c5'),'as':_0x2516('0x1c6')});db[_0x2516('0xec')]['belongsTo'](db[_0x2516('0x3d')],{'foreignKey':_0x2516('0x1c7'),'as':_0x2516('0x1c8')});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x17b')],{});db[_0x2516('0xed')][_0x2516('0x10a')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x2516('0x10a')](db[_0x2516('0x124')],{'foreignKey':_0x2516('0x1c9'),'as':_0x2516('0x1c0')});db[_0x2516('0xed')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xed')][_0x2516('0x10a')](db[_0x2516('0x6b')],{'foreignKey':_0x2516('0x1ca'),'as':'ToQueue'});db['ChatTransferReport'][_0x2516('0x10a')](db[_0x2516('0x124')],{'foreignKey':_0x2516('0x1cb'),'as':_0x2516('0x1c8')});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x51')],{});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x108')],{});db['FaxTransferReport'][_0x2516('0x10a')](db[_0x2516('0x4c')],{'foreignKey':_0x2516('0x1cc'),'as':_0x2516('0x1c0')});db[_0x2516('0xef')][_0x2516('0x10a')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2516('0xef')]['belongsTo'](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db['FaxTransferReport'][_0x2516('0x10a')](db[_0x2516('0x167')],{'foreignKey':_0x2516('0x1cd'),'as':_0x2516('0x1c6')});db[_0x2516('0xef')][_0x2516('0x10a')](db[_0x2516('0x4c')],{'foreignKey':_0x2516('0x1ce'),'as':'ToAccount'});db[_0x2516('0xf1')][_0x2516('0x10a')](db['OpenchannelMessage'],{});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5e')],{});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'foreignKey':_0x2516('0x1cf'),'as':_0x2516('0x1c0')});db[_0x2516('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':'ToUserId','as':_0x2516('0x1c4')});db[_0x2516('0xf1')][_0x2516('0x10a')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x2516('0xf1')][_0x2516('0x10a')](db[_0x2516('0x5b')],{'foreignKey':_0x2516('0x1d0'),'as':_0x2516('0x1c8')});db[_0x2516('0xf3')]['belongsTo'](db[_0x2516('0x58')],{});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x57')],{});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x12b')],{'foreignKey':'FromSmsAccountId','as':_0x2516('0x1c0')});db['SmsTransferReport'][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c1'),'as':_0x2516('0x1c2')});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x11')],{'foreignKey':_0x2516('0x1c3'),'as':_0x2516('0x1c4')});db[_0x2516('0xf3')][_0x2516('0x10a')](db[_0x2516('0x120')],{'foreignKey':_0x2516('0x1d1'),'as':_0x2516('0x1c6')});db['SmsTransferReport']['belongsTo'](db[_0x2516('0x12b')],{'foreignKey':'ToSmsAccountId','as':_0x2516('0x1c8')});db[_0x2516('0xf5')][_0x2516('0x100')](db[_0x2516('0x82')],{'as':_0x2516('0x162'),'foreignKey':'ListId'});db['CmList'][_0x2516('0x100')](db[_0x2516('0x7a')],{'as':'CustomFields','foreignKey':_0x2516('0x150')});db[_0x2516('0xf5')][_0x2516('0x100')](db['CmContact'],{'as':_0x2516('0x10f'),'onDelete':'cascade','foreignKey':_0x2516('0x150')});db['CmList'][_0x2516('0x100')](db[_0x2516('0x102')],{'as':'HopperFinals','foreignKey':_0x2516('0x150')});db[_0x2516('0xf5')]['hasMany'](db[_0x2516('0x78')],{'as':_0x2516('0x104'),'foreignKey':'ListId'});db['CmList'][_0x2516('0x100')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x2516('0x150')});db['CmList'][_0x2516('0x10b')](db[_0x2516('0x19')],{'as':_0x2516('0x1d2'),'through':'voice_queues_has_cm_lists'});db[_0x2516('0xf5')][_0x2516('0x10b')](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':'cm_user_has_lists'});db[_0x2516('0xf7')][_0x2516('0x100')](db[_0x2516('0x15')],{'as':_0x2516('0x18f'),'onDelete':_0x2516('0x15e')});db[_0x2516('0xf7')]['belongsToMany'](db[_0x2516('0x11')],{'as':_0x2516('0x142'),'through':_0x2516('0x1d3')});db[_0x2516('0xf8')]['hasMany'](db[_0x2516('0x11')],{'as':_0x2516('0x157'),'foreignKey':'userProfileId'});db[_0x2516('0xf8')]['hasMany'](db[_0x2516('0xf9')],{'as':_0x2516('0x1d4'),'foreignKey':'userProfileId','onDelete':_0x2516('0xfd')});db[_0x2516('0xf9')][_0x2516('0x100')](db['UserProfileResource'],{'as':_0x2516('0x1d5'),'foreignKey':'sectionId','onDelete':_0x2516('0xfd')});module[_0x2516('0x1d6')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 9b70979..136b9a0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb95=['/api/tags','/api/templates','./api/template','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/authLocal','/api/auth/google','./api/authGoogle','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/apidoc','join','/www','root','/demo','static','snippet','1.0.14','/plugins','/server/files/plugins','route','get','resolve','appPath','/index.html','path','express','./errors','./config/environment','api','use','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','./api/sound'];(function(_0x146395,_0x5df3b4){var _0x34c98b=function(_0x34ecad){while(--_0x34ecad){_0x146395['push'](_0x146395['shift']());}};_0x34c98b(++_0x5df3b4);}(_0xbb95,0x7f));var _0x5bb9=function(_0x5b6353,_0x17c692){_0x5b6353=_0x5b6353-0x0;var _0x5e940b=_0xbb95[_0x5b6353];return _0x5e940b;};'use strict';var path=require(_0x5bb9('0x0'));var express=require(_0x5bb9('0x1'));var ewinston=require('express-winston');var util=require('util');var errors=require(_0x5bb9('0x2'));var config=require(_0x5bb9('0x3'));var logger=require('./config/logger')(_0x5bb9('0x4'));var authLogger=require('./config/logger')('auth');exports['default']=function(_0x346d48){_0x346d48[_0x5bb9('0x5')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x180e69,_0x123a6a){return util[_0x5bb9('0x6')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x180e69[_0x5bb9('0x7')],_0x180e69[_0x5bb9('0x8')][_0x5bb9('0x9')]?_0x180e69[_0x5bb9('0x8')][_0x5bb9('0x9')]:_0x180e69[_0x5bb9('0xa')][_0x5bb9('0xb')]||_0x180e69['ip'],_0x180e69[_0x5bb9('0xc')],_0x123a6a[_0x5bb9('0xd')],_0x123a6a[_0x5bb9('0xe')],_0x180e69['user']?_0x180e69['user']['id']:null,_0x180e69[_0x5bb9('0xf')]?_0x180e69[_0x5bb9('0xf')][_0x5bb9('0x10')]:null,_0x180e69[_0x5bb9('0xf')]?_0x180e69[_0x5bb9('0xf')][_0x5bb9('0x11')]:null);}}));_0x346d48[_0x5bb9('0x5')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4b553d,_0x41eb45){var _0x407a7b=_0x5bb9('0x12');if(_0x4b553d['body']&&_0x4b553d[_0x5bb9('0x13')][_0x5bb9('0x14')]&&_0x4b553d['body'][_0x5bb9('0x15')]){_0x407a7b=_0x5bb9('0x16');}return util[_0x5bb9('0x6')](_0x407a7b,_0x4b553d[_0x5bb9('0x7')],_0x4b553d[_0x5bb9('0x8')][_0x5bb9('0x9')]?_0x4b553d[_0x5bb9('0x8')]['x-forwarded-for']:_0x4b553d[_0x5bb9('0xa')]['remoteAddress']||_0x4b553d['ip'],_0x4b553d[_0x5bb9('0xc')],_0x41eb45[_0x5bb9('0xd')],_0x41eb45[_0x5bb9('0xe')],_0x4b553d['user']?_0x4b553d[_0x5bb9('0xf')]['id']:null,_0x4b553d[_0x5bb9('0xf')]?_0x4b553d[_0x5bb9('0xf')][_0x5bb9('0x10')]:null,_0x4b553d[_0x5bb9('0xf')]?_0x4b553d[_0x5bb9('0xf')][_0x5bb9('0x11')]:null,_0x4b553d[_0x5bb9('0x13')]&&_0x4b553d[_0x5bb9('0x13')]['device']?_0x4b553d[_0x5bb9('0x13')]['device']:_0x5bb9('0x17'),_0x4b553d[_0x5bb9('0x13')]&&_0x4b553d['body'][_0x5bb9('0x15')]?_0x4b553d[_0x5bb9('0x13')]['agent_id']:'',_0x4b553d[_0x5bb9('0x13')]&&_0x4b553d['body'][_0x5bb9('0x18')]?_0x4b553d['body']['agent_name']:'');},'ignoreRoute':function(_0x1f0efa){var _0x13a50d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x13a50d[_0x5bb9('0x19')](_0x1f0efa[_0x5bb9('0xc')]);}}));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x1a'),require(_0x5bb9('0x1b')));_0x346d48['use'](_0x5bb9('0x1c'),require(_0x5bb9('0x1d')));_0x346d48['use'](_0x5bb9('0x1e'),require(_0x5bb9('0x1f')));_0x346d48[_0x5bb9('0x5')]('/api/voice/extensions',require('./api/voiceExtension'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x20'),require('./api/voiceMusicOnHold'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x21'),require(_0x5bb9('0x22')));_0x346d48[_0x5bb9('0x5')]('/api/voice/recordings',require('./api/voiceRecording'));_0x346d48['use']('/api/screen/recordings',require('./api/screenRecording'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x23'),require(_0x5bb9('0x24')));_0x346d48[_0x5bb9('0x5')]('/api/voice/mails/messages',require(_0x5bb9('0x25')));_0x346d48[_0x5bb9('0x5')]('/api/voice/calls/reports',require(_0x5bb9('0x26')));_0x346d48['use']('/api/voice/dials/reports',require(_0x5bb9('0x27')));_0x346d48[_0x5bb9('0x5')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x346d48['use'](_0x5bb9('0x28'),require(_0x5bb9('0x29')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x2a'),require(_0x5bb9('0x2b')));_0x346d48['use'](_0x5bb9('0x2c'),require(_0x5bb9('0x2d')));_0x346d48['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x346d48['use'](_0x5bb9('0x2e'),require(_0x5bb9('0x2f')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x30'),require('./api/mailAccount'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x31'),require(_0x5bb9('0x32')));_0x346d48[_0x5bb9('0x5')]('/api/mail/substatuses',require(_0x5bb9('0x33')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x34'),require(_0x5bb9('0x35')));_0x346d48[_0x5bb9('0x5')]('/api/mail/messages',require(_0x5bb9('0x36')));_0x346d48['use'](_0x5bb9('0x37'),require(_0x5bb9('0x38')));_0x346d48[_0x5bb9('0x5')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x346d48[_0x5bb9('0x5')]('/api/dashboards',require(_0x5bb9('0x39')));_0x346d48[_0x5bb9('0x5')]('/api/dashboards/items',require(_0x5bb9('0x3a')));_0x346d48['use'](_0x5bb9('0x3b'),require(_0x5bb9('0x3c')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x3d'),require('./api/faxApplication'));_0x346d48[_0x5bb9('0x5')]('/api/fax/interactions',require(_0x5bb9('0x3e')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x3f'),require('./api/faxMessage'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x40'),require(_0x5bb9('0x41')));_0x346d48[_0x5bb9('0x5')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x42'),require(_0x5bb9('0x43')));_0x346d48['use'](_0x5bb9('0x44'),require(_0x5bb9('0x45')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x46'),require(_0x5bb9('0x47')));_0x346d48[_0x5bb9('0x5')]('/api/sms/messages',require(_0x5bb9('0x48')));_0x346d48[_0x5bb9('0x5')]('/api/sms/queues',require(_0x5bb9('0x49')));_0x346d48['use'](_0x5bb9('0x4a'),require(_0x5bb9('0x4b')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x4c'),require(_0x5bb9('0x4d')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x4e'),require(_0x5bb9('0x4f')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x50'),require(_0x5bb9('0x51')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x52'),require('./api/openchannelQueue'));_0x346d48['use'](_0x5bb9('0x53'),require(_0x5bb9('0x54')));_0x346d48['use'](_0x5bb9('0x55'),require(_0x5bb9('0x56')));_0x346d48['use'](_0x5bb9('0x57'),require('./api/chatApplication'));_0x346d48[_0x5bb9('0x5')]('/api/chat/interactions',require(_0x5bb9('0x58')));_0x346d48['use']('/api/chat/messages',require(_0x5bb9('0x59')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x5a'),require(_0x5bb9('0x5b')));_0x346d48['use'](_0x5bb9('0x5c'),require('./api/chatQueue'));_0x346d48[_0x5bb9('0x5')]('/api/chat/groups',require(_0x5bb9('0x5d')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x5e'),require('./api/chatProactiveAction'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x5f'),require(_0x5bb9('0x60')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x61'),require('./api/cmContact'));_0x346d48['use'](_0x5bb9('0x62'),require(_0x5bb9('0x63')));_0x346d48[_0x5bb9('0x5')]('/api/cm/hopper_black',require(_0x5bb9('0x64')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x65'),require(_0x5bb9('0x66')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x67'),require(_0x5bb9('0x68')));_0x346d48['use'](_0x5bb9('0x69'),require('./api/cmCustomField'));_0x346d48[_0x5bb9('0x5')]('/api/actions',require('./api/action'));_0x346d48['use'](_0x5bb9('0x6a'),require('./api/automation'));_0x346d48['use'](_0x5bb9('0x6b'),require(_0x5bb9('0x6c')));_0x346d48['use']('/api/dispositions',require(_0x5bb9('0x6d')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x6e'),require(_0x5bb9('0x6f')));_0x346d48['use']('/api/intervals',require('./api/interval'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x70'),require(_0x5bb9('0x71')));_0x346d48['use']('/api/cdr',require(_0x5bb9('0x72')));_0x346d48[_0x5bb9('0x5')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x73'),require(_0x5bb9('0x74')));_0x346d48[_0x5bb9('0x5')]('/api/sounds',require(_0x5bb9('0x75')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x76'),require('./api/tag'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x77'),require(_0x5bb9('0x78')));_0x346d48['use']('/api/triggers',require('./api/trigger'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x79'),require(_0x5bb9('0x7a')));_0x346d48['use'](_0x5bb9('0x7b'),require(_0x5bb9('0x7c')));_0x346d48['use'](_0x5bb9('0x7d'),require(_0x5bb9('0x7e')));_0x346d48[_0x5bb9('0x5')]('/api/analytics/custom_reports',require(_0x5bb9('0x7f')));_0x346d48['use'](_0x5bb9('0x80'),require(_0x5bb9('0x81')));_0x346d48['use'](_0x5bb9('0x82'),require(_0x5bb9('0x83')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x84'),require(_0x5bb9('0x85')));_0x346d48['use'](_0x5bb9('0x86'),require(_0x5bb9('0x87')));_0x346d48['use'](_0x5bb9('0x88'),require(_0x5bb9('0x89')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x8a'),require(_0x5bb9('0x8b')));_0x346d48[_0x5bb9('0x5')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x346d48['use'](_0x5bb9('0x8c'),require(_0x5bb9('0x8d')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x8e'),require(_0x5bb9('0x8f')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x90'),require(_0x5bb9('0x91')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x92'),require('./api/intSugarcrmField'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x93'),require(_0x5bb9('0x94')));_0x346d48['use']('/api/integrations/desk/configurations',require(_0x5bb9('0x95')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x96'),require('./api/intDeskField'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x97'),require(_0x5bb9('0x98')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x99'),require(_0x5bb9('0x9a')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x9b'),require(_0x5bb9('0x9c')));_0x346d48['use'](_0x5bb9('0x9d'),require(_0x5bb9('0x9e')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0x9f'),require(_0x5bb9('0xa0')));_0x346d48[_0x5bb9('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x346d48[_0x5bb9('0x5')]('/api/integrations/freshdesk/accounts',require(_0x5bb9('0xa1')));_0x346d48['use'](_0x5bb9('0xa2'),require('./api/intFreshdeskConfiguration'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xa3'),require(_0x5bb9('0xa4')));_0x346d48[_0x5bb9('0x5')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xa5'),require(_0x5bb9('0xa6')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xa7'),require(_0x5bb9('0xa8')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xa9'),require('./api/intServicenowAccount'));_0x346d48['use'](_0x5bb9('0xaa'),require('./api/intServicenowConfiguration'));_0x346d48[_0x5bb9('0x5')]('/api/integrations/servicenow/fields',require(_0x5bb9('0xab')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xac'),require('./api/intDynamics365Account'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xad'),require('./api/intDynamics365Configuration'));_0x346d48['use'](_0x5bb9('0xae'),require(_0x5bb9('0xaf')));_0x346d48[_0x5bb9('0x5')]('/api/networks',require(_0x5bb9('0xb0')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xb1'),require('./api/chatQueueReport'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xb2'),require(_0x5bb9('0xb3')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xb4'),require(_0x5bb9('0xb5')));_0x346d48['use']('/api/jscripty/questions/reports',require(_0x5bb9('0xb6')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xb7'),require(_0x5bb9('0xb8')));_0x346d48['use'](_0x5bb9('0xb9'),require(_0x5bb9('0xba')));_0x346d48['use'](_0x5bb9('0xbb'),require(_0x5bb9('0xbc')));_0x346d48[_0x5bb9('0x5')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x346d48['use'](_0x5bb9('0xbd'),require(_0x5bb9('0xbe')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xbf'),require(_0x5bb9('0xc0')));_0x346d48[_0x5bb9('0x5')]('/api/square/odbc',require('./api/squareOdbc'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xc1'),require('./api/squareProject'));_0x346d48['use']('/api/square/recordings',require('./api/squareRecording'));_0x346d48[_0x5bb9('0x5')]('/api/square/messages',require(_0x5bb9('0xc2')));_0x346d48['use'](_0x5bb9('0xc3'),require(_0x5bb9('0xc4')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xc5'),require(_0x5bb9('0xc6')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xc7'),require('./api/campaign'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xc8'),require(_0x5bb9('0xc9')));_0x346d48['use']('/api/attachments',require('./api/attachment'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xca'),require(_0x5bb9('0xcb')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xcc'),require(_0x5bb9('0xcd')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xce'),require(_0x5bb9('0xcf')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xd0'),require(_0x5bb9('0xd1')));_0x346d48['use'](_0x5bb9('0xd2'),require(_0x5bb9('0xd3')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xd4'),require(_0x5bb9('0xd5')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xd6'),require('./api/cmList'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xd7'),require(_0x5bb9('0xd8')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xd9'),require('./api/userProfile'));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xda'),require(_0x5bb9('0xdb')));_0x346d48[_0x5bb9('0x5')]('/api/userProfile/resources',require(_0x5bb9('0xdc')));_0x346d48[_0x5bb9('0x5')]('/api/auth/local',require(_0x5bb9('0xdd')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xde'),require(_0x5bb9('0xdf')));_0x346d48[_0x5bb9('0x5')]('/api/jira',require('./api/jira'));_0x346d48[_0x5bb9('0x5')]('/api/rpc',require(_0x5bb9('0xe0')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xe1'),require(_0x5bb9('0xe2')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xe3'),require(_0x5bb9('0xe4')));_0x346d48['use']('/api/pm2',require(_0x5bb9('0xe5')));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xe6'),express['static'](path[_0x5bb9('0xe7')](config['root'],_0x5bb9('0xe6'))));_0x346d48['use'](_0x5bb9('0xe8'),express['static'](path[_0x5bb9('0xe7')](config[_0x5bb9('0xe9')],_0x5bb9('0xe8'))));_0x346d48[_0x5bb9('0x5')](_0x5bb9('0xea'),express[_0x5bb9('0xeb')](path['join'](config[_0x5bb9('0xe9')],'/demo')));_0x346d48[_0x5bb9('0x5')]('/snippet',express['static'](path[_0x5bb9('0xe7')](config[_0x5bb9('0xe9')],_0x5bb9('0xec'),_0x5bb9('0xed'))));_0x346d48['use'](_0x5bb9('0xee'),express[_0x5bb9('0xeb')](path[_0x5bb9('0xe7')](config[_0x5bb9('0xe9')],_0x5bb9('0xef'))));_0x346d48['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x346d48[_0x5bb9('0xf0')]('/*')[_0x5bb9('0xf1')](function(_0x48e7e9,_0x5782f2){_0x5782f2['sendFile'](path[_0x5bb9('0xf2')](_0x346d48['get'](_0x5bb9('0xf3'))+_0x5bb9('0xf4')));});}; \ No newline at end of file +var _0x7a2c=['./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations/reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/apidoc','static','join','root','/www','/snippet','snippet','1.0.14','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express-winston','util','./errors','./config/environment','./config/logger','api','auth','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','url','responseTime','user','name','role','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','other','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/tags'];(function(_0x4fdd28,_0x4b3c0a){var _0x9cdb=function(_0x1c6226){while(--_0x1c6226){_0x4fdd28['push'](_0x4fdd28['shift']());}};_0x9cdb(++_0x4b3c0a);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x13ef47,_0x5d272d){_0x13ef47=_0x13ef47-0x0;var _0x5ed135=_0x7a2c[_0x13ef47];return _0x5ed135;};'use strict';var path=require(_0xc7a2('0x0'));var express=require('express');var ewinston=require(_0xc7a2('0x1'));var util=require(_0xc7a2('0x2'));var errors=require(_0xc7a2('0x3'));var config=require(_0xc7a2('0x4'));var logger=require(_0xc7a2('0x5'))(_0xc7a2('0x6'));var authLogger=require(_0xc7a2('0x5'))(_0xc7a2('0x7'));exports['default']=function(_0x3a47c8){_0x3a47c8[_0xc7a2('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x481430,_0x48773c){return util[_0xc7a2('0x9')](_0xc7a2('0xa'),_0x481430[_0xc7a2('0xb')],_0x481430[_0xc7a2('0xc')]['x-forwarded-for']?_0x481430[_0xc7a2('0xc')][_0xc7a2('0xd')]:_0x481430[_0xc7a2('0xe')]['remoteAddress']||_0x481430['ip'],_0x481430[_0xc7a2('0xf')],_0x48773c['statusCode'],_0x48773c[_0xc7a2('0x10')],_0x481430[_0xc7a2('0x11')]?_0x481430[_0xc7a2('0x11')]['id']:null,_0x481430['user']?_0x481430[_0xc7a2('0x11')][_0xc7a2('0x12')]:null,_0x481430[_0xc7a2('0x11')]?_0x481430['user'][_0xc7a2('0x13')]:null);}}));_0x3a47c8[_0xc7a2('0x8')](ewinston[_0xc7a2('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2cbe93,_0x39929c){var _0x2af363=_0xc7a2('0x15');if(_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x17')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x18')]){_0x2af363=_0xc7a2('0x19');}return util[_0xc7a2('0x9')](_0x2af363,_0x2cbe93[_0xc7a2('0xb')],_0x2cbe93['headers'][_0xc7a2('0xd')]?_0x2cbe93['headers'][_0xc7a2('0xd')]:_0x2cbe93[_0xc7a2('0xe')][_0xc7a2('0x1a')]||_0x2cbe93['ip'],_0x2cbe93[_0xc7a2('0xf')],_0x39929c['statusCode'],_0x39929c['responseTime'],_0x2cbe93[_0xc7a2('0x11')]?_0x2cbe93[_0xc7a2('0x11')]['id']:null,_0x2cbe93['user']?_0x2cbe93['user']['name']:null,_0x2cbe93[_0xc7a2('0x11')]?_0x2cbe93['user'][_0xc7a2('0x13')]:null,_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93['body'][_0xc7a2('0x17')]?_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x17')]:_0xc7a2('0x1b'),_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x18')]?_0x2cbe93['body']['agent_id']:'',_0x2cbe93[_0xc7a2('0x16')]&&_0x2cbe93[_0xc7a2('0x16')]['agent_name']?_0x2cbe93[_0xc7a2('0x16')][_0xc7a2('0x1c')]:'');},'ignoreRoute':function(_0x19f69a){var _0x2c2281=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2c2281[_0xc7a2('0x1d')](_0x19f69a[_0xc7a2('0xf')]);}}));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x1e'),require('./api/user'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/chanspy',require(_0xc7a2('0x1f')));_0x3a47c8['use'](_0xc7a2('0x20'),require(_0xc7a2('0x21')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x22'),require('./api/voiceExtension'));_0x3a47c8['use'](_0xc7a2('0x23'),require(_0xc7a2('0x24')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x25'),require(_0xc7a2('0x26')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x27'),require('./api/voiceRecording'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x28'),require('./api/screenRecording'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x29'),require(_0xc7a2('0x2a')));_0x3a47c8['use'](_0xc7a2('0x2b'),require('./api/voiceMailMessage'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/voice/agents/reports',require(_0xc7a2('0x2c')));_0x3a47c8['use'](_0xc7a2('0x2d'),require(_0xc7a2('0x2e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x2f'),require(_0xc7a2('0x30')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x31'),require(_0xc7a2('0x32')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x33'),require('./api/voiceTransferReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x34'),require('./api/mailServerOut'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x35'),require(_0xc7a2('0x36')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x37'),require(_0xc7a2('0x38')));_0x3a47c8[_0xc7a2('0x8')]('/api/mail/substatuses',require(_0xc7a2('0x39')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3a'),require('./api/mailInteraction'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3b'),require('./api/mailMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3c'),require(_0xc7a2('0x3d')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x3e'),require(_0xc7a2('0x3f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x40'),require('./api/dashboard'));_0x3a47c8[_0xc7a2('0x8')]('/api/dashboards/items',require(_0xc7a2('0x41')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x42'),require(_0xc7a2('0x43')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x44'),require(_0xc7a2('0x45')));_0x3a47c8[_0xc7a2('0x8')]('/api/fax/interactions',require(_0xc7a2('0x46')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x47'),require(_0xc7a2('0x48')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x49'),require('./api/faxQueue'));_0x3a47c8['use']('/api/fax/reports/queue',require(_0xc7a2('0x4a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4b'),require(_0xc7a2('0x4c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4d'),require(_0xc7a2('0x4e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x4f'),require('./api/smsInteraction'));_0x3a47c8['use']('/api/sms/messages',require(_0xc7a2('0x50')));_0x3a47c8[_0xc7a2('0x8')]('/api/sms/queues',require(_0xc7a2('0x51')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x52'),require('./api/openchannelAccount'));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/applications',require(_0xc7a2('0x53')));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x54'),require('./api/openchannelMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x55'),require(_0xc7a2('0x56')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x57'),require(_0xc7a2('0x58')));_0x3a47c8['use'](_0xc7a2('0x59'),require(_0xc7a2('0x5a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5b'),require('./api/chatApplication'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5c'),require(_0xc7a2('0x5d')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x5e'),require(_0xc7a2('0x5f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x60'),require('./api/chatOfflineMessage'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x61'),require(_0xc7a2('0x62')));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/groups',require(_0xc7a2('0x63')));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/proactive_actions',require(_0xc7a2('0x64')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x65'),require(_0xc7a2('0x66')));_0x3a47c8[_0xc7a2('0x8')]('/api/cm/contacts',require(_0xc7a2('0x67')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x68'),require('./api/cmHopper'));_0x3a47c8['use'](_0xc7a2('0x69'),require('./api/cmHopperBlack'));_0x3a47c8['use'](_0xc7a2('0x6a'),require(_0xc7a2('0x6b')));_0x3a47c8['use']('/api/cm/hopper_history',require(_0xc7a2('0x6c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x6d'),require(_0xc7a2('0x6e')));_0x3a47c8[_0xc7a2('0x8')]('/api/actions',require(_0xc7a2('0x6f')));_0x3a47c8[_0xc7a2('0x8')]('/api/automations',require(_0xc7a2('0x70')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x71'),require(_0xc7a2('0x72')));_0x3a47c8[_0xc7a2('0x8')]('/api/dispositions',require(_0xc7a2('0x73')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x74'),require('./api/condition'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x75'),require(_0xc7a2('0x76')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x77'),require(_0xc7a2('0x78')));_0x3a47c8['use'](_0xc7a2('0x79'),require(_0xc7a2('0x7a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7b'),require(_0xc7a2('0x7c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7d'),require('./api/schedule'));_0x3a47c8[_0xc7a2('0x8')]('/api/sounds',require('./api/sound'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x7e'),require(_0xc7a2('0x7f')));_0x3a47c8['use'](_0xc7a2('0x80'),require('./api/template'));_0x3a47c8['use'](_0xc7a2('0x81'),require(_0xc7a2('0x82')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x83'),require(_0xc7a2('0x84')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations',require('./api/integration'));_0x3a47c8['use'](_0xc7a2('0x85'),require('./api/integrationReport'));_0x3a47c8['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x86'),require(_0xc7a2('0x87')));_0x3a47c8[_0xc7a2('0x8')]('/api/analytics/extracted_reports',require(_0xc7a2('0x88')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x89'),require(_0xc7a2('0x8a')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x8b'),require(_0xc7a2('0x8c')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x8d'),require(_0xc7a2('0x8e')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/salesforce/configurations',require(_0xc7a2('0x8f')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x90'),require(_0xc7a2('0x91')));_0x3a47c8['use'](_0xc7a2('0x92'),require(_0xc7a2('0x93')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x94'),require(_0xc7a2('0x95')));_0x3a47c8['use'](_0xc7a2('0x96'),require(_0xc7a2('0x97')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x98'),require(_0xc7a2('0x99')));_0x3a47c8['use'](_0xc7a2('0x9a'),require('./api/intDeskConfiguration'));_0x3a47c8['use'](_0xc7a2('0x9b'),require(_0xc7a2('0x9c')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zoho/accounts',require(_0xc7a2('0x9d')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zoho/configurations',require(_0xc7a2('0x9e')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0x9f'),require('./api/intZohoField'));_0x3a47c8['use']('/api/integrations/zendesk/accounts',require(_0xc7a2('0xa0')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zendesk/configurations',require(_0xc7a2('0xa1')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/zendesk/fields',require(_0xc7a2('0xa2')));_0x3a47c8['use'](_0xc7a2('0xa3'),require('./api/intFreshdeskAccount'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa4'),require('./api/intFreshdeskConfiguration'));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/freshdesk/fields',require(_0xc7a2('0xa5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa6'),require(_0xc7a2('0xa7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xa8'),require('./api/intVtigerConfiguration'));_0x3a47c8['use']('/api/integrations/vtiger/fields',require(_0xc7a2('0xa9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xaa'),require(_0xc7a2('0xab')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xac'),require(_0xc7a2('0xad')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xae'),require(_0xc7a2('0xaf')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb0'),require(_0xc7a2('0xb1')));_0x3a47c8[_0xc7a2('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb2'),require('./api/network'));_0x3a47c8[_0xc7a2('0x8')]('/api/chat/reports/queue',require(_0xc7a2('0xb3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb4'),require(_0xc7a2('0xb5')));_0x3a47c8['use'](_0xc7a2('0xb6'),require(_0xc7a2('0xb7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb8'),require('./api/jscriptyQuestionReport'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xb9'),require(_0xc7a2('0xba')));_0x3a47c8[_0xc7a2('0x8')]('/api/sms/reports/queue',require(_0xc7a2('0xbb')));_0x3a47c8['use']('/api/square/reports',require('./api/squareReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/square/details/reports',require(_0xc7a2('0xbc')));_0x3a47c8['use'](_0xc7a2('0xbd'),require(_0xc7a2('0xbe')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xbf'),require(_0xc7a2('0xc0')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc1'),require(_0xc7a2('0xc2')));_0x3a47c8[_0xc7a2('0x8')]('/api/square/projects',require(_0xc7a2('0xc3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc4'),require(_0xc7a2('0xc5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc6'),require(_0xc7a2('0xc7')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xc8'),require(_0xc7a2('0xc9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xca'),require(_0xc7a2('0xcb')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xcc'),require(_0xc7a2('0xcd')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xce'),require('./api/migration'));_0x3a47c8['use'](_0xc7a2('0xcf'),require(_0xc7a2('0xd0')));_0x3a47c8['use'](_0xc7a2('0xd1'),require(_0xc7a2('0xd2')));_0x3a47c8['use']('/api/mail/reports/transfer',require(_0xc7a2('0xd3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xd4'),require(_0xc7a2('0xd5')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xd6'),require('./api/faxTransferReport'));_0x3a47c8[_0xc7a2('0x8')]('/api/openchannel/reports/transfer',require(_0xc7a2('0xd7')));_0x3a47c8['use'](_0xc7a2('0xd8'),require(_0xc7a2('0xd9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xda'),require(_0xc7a2('0xdb')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xdc'),require(_0xc7a2('0xdd')));_0x3a47c8[_0xc7a2('0x8')]('/api/userProfiles',require('./api/userProfile'));_0x3a47c8['use'](_0xc7a2('0xde'),require(_0xc7a2('0xdf')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe0'),require(_0xc7a2('0xe1')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe2'),require(_0xc7a2('0xe3')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe4'),require('./api/authGoogle'));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xe5'),require(_0xc7a2('0xe6')));_0x3a47c8['use'](_0xc7a2('0xe7'),require(_0xc7a2('0xe8')));_0x3a47c8[_0xc7a2('0x8')]('/api/version',require(_0xc7a2('0xe9')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xea'),require(_0xc7a2('0xeb')));_0x3a47c8['use']('/api/pm2',require(_0xc7a2('0xec')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xed'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xed'))));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xf1'),express['static'](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xf1'))));_0x3a47c8[_0xc7a2('0x8')]('/demo',express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],'/demo')));_0x3a47c8[_0xc7a2('0x8')](_0xc7a2('0xf2'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config['root'],_0xc7a2('0xf3'),_0xc7a2('0xf4'))));_0x3a47c8['use'](_0xc7a2('0xf5'),express[_0xc7a2('0xee')](path[_0xc7a2('0xef')](config[_0xc7a2('0xf0')],_0xc7a2('0xf6'))));_0x3a47c8[_0xc7a2('0xf7')](_0xc7a2('0xf8'))[_0xc7a2('0xf9')](errors[0x194]);_0x3a47c8[_0xc7a2('0xf7')]('/*')[_0xc7a2('0xf9')](function(_0x48faa9,_0x42ff3f){_0x42ff3f[_0xc7a2('0xfa')](path['resolve'](_0x3a47c8[_0xc7a2('0xf9')](_0xc7a2('0xfb'))+_0xc7a2('0xfc')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5653b5e..7fe3385 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6fc4=['../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.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/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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','listen','merge'];(function(_0x2b03a4,_0x35ab65){var _0xe12b6e=function(_0x266d5f){while(--_0x266d5f){_0x2b03a4['push'](_0x2b03a4['shift']());}};_0xe12b6e(++_0x35ab65);}(_0x6fc4,0x1a0));var _0x46fc=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x6fc4[_0x58ae8a];return _0x2f0b6b;};'use strict';var jayson=require(_0x46fc('0x0'));var BPromise=require(_0x46fc('0x1'));var _=require('lodash');var config=require('../config/environment');exports[_0x46fc('0x2')]=function(){return new BPromise(function(_0x5caf97,_0x47e69d){var _0x4e3ca5={};_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x4')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x5')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x6')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x7')));_0x4e3ca5=_['merge'](_0x4e3ca5,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x8')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x9')));_0x4e3ca5=_['merge'](_0x4e3ca5,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0xa')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0xb')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0xc')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0xd')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0xe')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0xf')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x10')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x11')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x12')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x13')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x14')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/faxAccount/faxAccount.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x15')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x16')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/faxMessage/faxMessage.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x17')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x18')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x19')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x1a')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x1b')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x1c')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x1d')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x1e')));_0x4e3ca5=_['merge'](_0x4e3ca5,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x1f')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x20')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x21')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x22')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/cmContact/cmContact.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x23')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x24')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x25')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x26')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x27')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x28')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x29')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x2a')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x2b')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x2c')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x2d')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x2e')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x2f')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x30')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x31')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x32')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x33')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x34')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x35')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x36')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x37')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x38')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x39')));_0x4e3ca5=_['merge'](_0x4e3ca5,require(_0x46fc('0x3a')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x3b')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require(_0x46fc('0x3c')));_0x4e3ca5=_[_0x46fc('0x3')](_0x4e3ca5,require('../api/plugin/plugin.rpc'));var _0x208203=jayson[_0x46fc('0x3d')](_0x4e3ca5)[_0x46fc('0x3e')]();var _0x58ffa6=config[_0x46fc('0x3f')][_0x46fc('0x40')]||config[_0x46fc('0x40')]+0x1;var _0x2ba539=config[_0x46fc('0x3f')]['ip']||_0x46fc('0x41');_0x208203['on']('error',function(_0x272595){return _0x47e69d(_0x272595);});_0x208203[_0x46fc('0x2')](_0x58ffa6,_0x2ba539,function(){console[_0x46fc('0x42')](_0x46fc('0x43'),_0x2ba539,_0x58ffa6);require('../config/triggers')[_0x46fc('0x44')]();return _0x5caf97(_0x46fc('0x45')+_0x2ba539+':'+_0x58ffa6);});});}; \ No newline at end of file +var _0x624c=['../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','server','http','port','rpc','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc'];(function(_0x2dcccb,_0x125a4b){var _0x2aa0eb=function(_0x2c90d0){while(--_0x2c90d0){_0x2dcccb['push'](_0x2dcccb['shift']());}};_0x2aa0eb(++_0x125a4b);}(_0x624c,0x1ee));var _0xc624=function(_0x3e655a,_0x1a2097){_0x3e655a=_0x3e655a-0x0;var _0x40a6c5=_0x624c[_0x3e655a];return _0x40a6c5;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc624('0x0'));var _=require(_0xc624('0x1'));var config=require(_0xc624('0x2'));exports[_0xc624('0x3')]=function(){return new BPromise(function(_0x297040,_0x547db8){var _0x406db7={};_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x4')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x5')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x7')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x8')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x9')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0xa')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xb')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0xc')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/memberReport/memberReport.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xd')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xe')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0xf')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x10')));_0x406db7=_['merge'](_0x406db7,require('../api/mailQueue/mailQueue.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x11')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x12')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x13')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x14')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxAccount/faxAccount.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x15')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxInteraction/faxInteraction.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x16')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x17')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/smsAccount/smsAccount.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x18')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x19')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x1a')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1b')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x1c')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1d')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1e')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x1f')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x20')));_0x406db7=_['merge'](_0x406db7,require('../api/chatMessage/chatMessage.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x21')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x22')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x23')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x24')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x25')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x26')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x27')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x28')));_0x406db7=_['merge'](_0x406db7,require('../api/pause/pause.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x29')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2a')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2b')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2c')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2d')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x2e')));_0x406db7=_['merge'](_0x406db7,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x2f')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x30')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x31')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x32')));_0x406db7=_['merge'](_0x406db7,require(_0xc624('0x33')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x34')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x35')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x36')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x37')));_0x406db7=_['merge'](_0x406db7,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x38')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x39')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3a')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3b')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require(_0xc624('0x3c')));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/attachment/attachment.rpc'));_0x406db7=_[_0xc624('0x6')](_0x406db7,require('../api/plugin/plugin.rpc'));var _0x584f12=jayson[_0xc624('0x3d')](_0x406db7)[_0xc624('0x3e')]();var _0x2fa86c=config['rpc']['port']||config[_0xc624('0x3f')]+0x1;var _0x5f7f3a=config[_0xc624('0x40')]['ip']||'localhost';_0x584f12['on']('error',function(_0x12acf2){return _0x547db8(_0x12acf2);});_0x584f12['listen'](_0x2fa86c,_0x5f7f3a,function(){console[_0xc624('0x41')](_0xc624('0x42'),_0x5f7f3a,_0x2fa86c);require('../config/triggers')[_0xc624('0x43')]();return _0x297040('RPC\x20listening\x20on\x20'+_0x5f7f3a+':'+_0x2fa86c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 45789f2..3d2e3a6 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 _0x666f=['timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','ANSWER','getData','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','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','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','utf8','setEncoding','headers','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close'];(function(_0x17c283,_0x587fcc){var _0x4e0800=function(_0x537bc3){while(--_0x537bc3){_0x17c283['push'](_0x17c283['shift']());}};_0x4e0800(++_0x587fcc);}(_0x666f,0x110));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xf666('0x0'));var _=require(_0xf666('0x1'));var EventEmitter=require('events')[_0xf666('0x2')];var AGIReply=require(_0xf666('0x3'));var AGIError=require(_0xf666('0x4'));function AGIChannel(_0x4e77c8){var _0x388043=this,_0x51335b=new AGIReply(),_0x10e0b2=![],_0x1b5168={};EventEmitter['call'](_0x388043);_0x4e77c8['setEncoding'](_0xf666('0x5'));_0x4e77c8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x51335b[_0xf666('0x6')](_0xf666('0x5'));_0x51335b['on'](_0xf666('0x7'),function(_0x46e1b1){for(var _0x415226 in _0x46e1b1){_0x388043[_0x415226]=_0x46e1b1[_0x415226];}_0x388043['emit']('ready');});_0x51335b['on'](_0xf666('0x8'),function(_0x58d908){if(_0x58d908[_0xf666('0x9')]()==_0xf666('0xa')){_0x388043[_0xf666('0xb')](_0xf666('0xa'));return;}if(_0x58d908[_0xf666('0xc')](0x0,0xb)=='520-Invalid'){_0x10e0b2=!![];}if(_0x10e0b2){_0x1b5168['rx']+=_0x58d908+'\x0a';if(_0x58d908[_0xf666('0xd')](_0xf666('0xe'))!=-0x1){_0x10e0b2=![];}}else{_0x1b5168['rx']=_0x58d908;}if(_0x10e0b2){return;}if(typeof _0x1b5168['cb']==_0xf666('0xf')){var _0x44004c=_0x1b5168['rx'][_0xf666('0xc')](0x0,0x3),_0x425a58=null,_0x90f203=null;_0x44004c=parseInt(_0x44004c);if(isNaN(_0x44004c)){_0x1b5168['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf666('0x10')});return;}if(_0x44004c!=0xc8){_0x1b5168['cb'](null,{'code':_0x44004c,'result':-0x1,'extra':'KO'});return;}_0x425a58=_0x1b5168['rx'][_0xf666('0xc')](0x4)[_0xf666('0x11')](_0xf666('0x12'),'');if(_0x425a58['indexOf']('\x20')!=-0x1){_0x425a58=_0x425a58['substr'](0x0,_0x425a58[_0xf666('0x13')]('\x20'));}if(_[_0xf666('0x14')](_0x425a58,'-1')){_0x425a58=parseInt(_0x425a58);}_0x90f203=_0x1b5168['rx'][_0xf666('0x15')]('\x20');if(_0x90f203[_0xf666('0x16')]==0x3){_0x90f203=_0x90f203[0x2]['substring'](0x1,_0x90f203[0x2]['length']-0x1);}else if(_0x90f203['length']>0x3){var _0x469c10=/\((.+)\)/;var _0x227801=_0x1b5168['rx'][_0xf666('0x17')](_0x469c10);if(_0x227801){_0x90f203=_0x227801[0x1];}else{_0x90f203=null;}}else{_0x90f203=null;}_0x1b5168['cb'](null,{'code':_0x44004c,'result':_0x425a58,'extra':_0x90f203});}});_0x4e77c8['on']('error',function(_0x99c68c){_0x388043[_0xf666('0xb')](_0xf666('0x18'),new AGIError(_0xf666('0x19'),_0x99c68c[_0xf666('0x1a')]));});_0x4e77c8['on'](_0xf666('0x1b'),function(){_0x388043[_0xf666('0xb')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4e77c8['on'](_0xf666('0x1c'),function(){_0x388043[_0xf666('0xb')](_0xf666('0x1c'),new AGIError(_0xf666('0x1d')));_0x4e77c8[_0xf666('0x1e')]();});_0x4e77c8[_0xf666('0x1f')](_0x51335b);this[_0xf666('0x20')]=function(_0x440c2d,_0x458997){var _0x440c2d=_0x440c2d||'',_0x458997=typeof _0x458997==_0xf666('0xf')?_0x458997:new Function();_0x1b5168={'tx':_0x440c2d,'rx':'','cb':_0x458997};_0x4e77c8[_0xf666('0x21')](_0x440c2d+'\x0a');},this[_0xf666('0x1b')]=function(){_0x4e77c8[_0xf666('0x1e')]();};}util[_0xf666('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf666('0x23')][_0xf666('0x24')]=function(_0x16813c){return this[_0xf666('0x20')]['sync'](this,_0x16813c);};AGIChannel[_0xf666('0x23')][_0xf666('0x25')]=function(){return this[_0xf666('0x24')](_0xf666('0x26'));};AGIChannel[_0xf666('0x23')][_0xf666('0x27')]=function(_0x2fc656,_0x1f5cca,_0x522618){_0x2fc656=_0x2fc656===undefined?'beep':_0x2fc656;_0x1f5cca=_0x1f5cca===undefined?'5':_0x1f5cca;_0x522618=_0x522618===undefined?'1':_0x522618;return this[_0xf666('0x24')](util[_0xf666('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2fc656,_0x1f5cca*0x3e8,_0x522618));};AGIChannel[_0xf666('0x23')]['noop']=function(_0x1a05b9){_0x1a05b9=_0x1a05b9||_0xf666('0x29');return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x2a'),_0x1a05b9));};AGIChannel[_0xf666('0x23')]['exec']=function(_0x53b02c,_0x38a125){if(_[_0xf666('0x2b')](_0x38a125)){return this[_0xf666('0x24')](util[_0xf666('0x28')]('EXEC\x20%s\x20%s',_0x53b02c,_0x38a125[_0xf666('0x2c')](',')));}return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x2d'),_0x53b02c,_0x38a125));};AGIChannel[_0xf666('0x23')][_0xf666('0x2e')]=function(_0x1e3a6f){return this[_0xf666('0x24')](util['format']('SET\x20CONTEXT\x20%s',_0x1e3a6f));};AGIChannel[_0xf666('0x23')][_0xf666('0x2f')]=function(_0x16e323){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x30'),_0x16e323));};AGIChannel[_0xf666('0x23')][_0xf666('0x31')]=function(_0xa8f5b){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x32'),_0xa8f5b));};AGIChannel['prototype'][_0xf666('0xa')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xf666('0x23')][_0xf666('0x33')]=function(_0x5b64d2,_0x15f703){return this[_0xf666('0x24')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5b64d2,_0x15f703?_0x15f703[_0xf666('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xf666('0x35')]=function(_0x13ff99,_0x5416c1){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x36'),_0x13ff99,_0x5416c1));};AGIChannel[_0xf666('0x23')][_0xf666('0x37')]=function(_0x2cf9c8,_0x4c142a){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x38'),_0x2cf9c8,_0x4c142a));};AGIChannel[_0xf666('0x23')]['sayPhonetic']=function(_0x2a40b9,_0x53cfc8){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x39'),_0x2a40b9,_0x53cfc8));};AGIChannel['prototype'][_0xf666('0x3a')]=function(_0xc7190d,_0x5858a6,_0x3d0e34){_0x5858a6=_0x5858a6||this[_0xf666('0x3b')];_0x3d0e34=_0x3d0e34||0x1;this['setContext'](_0xc7190d);this[_0xf666('0x2f')](_0x5858a6);this[_0xf666('0x31')](_0x3d0e34);return this[_0xf666('0x3c')](util[_0xf666('0x28')]('GOTO\x20%s\x20%s\x20%s',_0xc7190d,_0x5858a6,_0x3d0e34));};AGIChannel['prototype']['getVariable']=function(_0x449801){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x3d'),_0x449801));};AGIChannel['prototype']['recordFile']=function(_0x325060,_0x5475b9,_0x2979b3,_0x3b7465,_0x1984ab,_0x286140){_0x5475b9=_0x5475b9||_0xf666('0x3e');_0x2979b3=_0x2979b3||'';_0x3b7465=_0x3b7465===undefined?-0x1:_0x3b7465==='-1'?-0x1:_0x3b7465*0x3e8;_0x1984ab=_0x1984ab===undefined?'':'s='+_0x1984ab;_0x286140=_0x286140?_0xf666('0x3f'):'';return this[_0xf666('0x24')](util['format'](_0xf666('0x40'),_0x325060,_0x5475b9,_0x2979b3,_0x3b7465,_0x286140,_0x1984ab));};AGIChannel[_0xf666('0x23')][_0xf666('0x41')]=function(_0x3618a6,_0x3121fe){_0x3121fe=_0x3121fe||'';return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x42'),_0x3618a6,_0x3121fe));};AGIChannel[_0xf666('0x23')][_0xf666('0x43')]=function(_0x45420b){return this[_0xf666('0x44')](_0xf666('0x45'),_0x45420b);};AGIChannel[_0xf666('0x23')][_0xf666('0x46')]=function(_0x1819b0){return this[_0xf666('0x44')](_0xf666('0x47'),_0x1819b0);};AGIChannel[_0xf666('0x23')][_0xf666('0x18')]=function(_0x4db29d,_0x5920d2){this[_0xf666('0x3c')](util['format'](_0xf666('0x48'),_0x4db29d['id'],_0x4db29d[_0xf666('0x49')],_0x5920d2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf666('0x4a')]=AGIChannel; \ No newline at end of file +var _0x8281=['recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','sync','answer','ANSWER','prototype','getData','beep','sendRequest','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x527452,_0x130cec){var _0x3a53a4=function(_0x320115){while(--_0x320115){_0x527452['push'](_0x527452['shift']());}};_0x3a53a4(++_0x130cec);}(_0x8281,0xab));var _0x1828=function(_0x5bae90,_0x4cfe5c){_0x5bae90=_0x5bae90-0x0;var _0x7bcd33=_0x8281[_0x5bae90];return _0x7bcd33;};'use strict';var util=require(_0x1828('0x0'));var _=require(_0x1828('0x1'));var EventEmitter=require(_0x1828('0x2'))['EventEmitter'];var AGIReply=require(_0x1828('0x3'));var AGIError=require(_0x1828('0x4'));function AGIChannel(_0x13c2bc){var _0x445f9f=this,_0x545bed=new AGIReply(),_0x2a321d=![],_0x58cc05={};EventEmitter[_0x1828('0x5')](_0x445f9f);_0x13c2bc[_0x1828('0x6')](_0x1828('0x7'));_0x13c2bc[_0x1828('0x8')](0x8*0x3c*0x3c*0x3e8);_0x545bed[_0x1828('0x6')](_0x1828('0x7'));_0x545bed['on'](_0x1828('0x9'),function(_0x195643){for(var _0x1e6f99 in _0x195643){_0x445f9f[_0x1e6f99]=_0x195643[_0x1e6f99];}_0x445f9f[_0x1828('0xa')](_0x1828('0xb'));});_0x545bed['on'](_0x1828('0xc'),function(_0x2b1b5c){if(_0x2b1b5c[_0x1828('0xd')]()==_0x1828('0xe')){_0x445f9f[_0x1828('0xa')](_0x1828('0xe'));return;}if(_0x2b1b5c[_0x1828('0xf')](0x0,0xb)==_0x1828('0x10')){_0x2a321d=!![];}if(_0x2a321d){_0x58cc05['rx']+=_0x2b1b5c+'\x0a';if(_0x2b1b5c['search'](_0x1828('0x11'))!=-0x1){_0x2a321d=![];}}else{_0x58cc05['rx']=_0x2b1b5c;}if(_0x2a321d){return;}if(typeof _0x58cc05['cb']=='function'){var _0x5cfe32=_0x58cc05['rx'][_0x1828('0xf')](0x0,0x3),_0x3e1050=null,_0x3dac7c=null;_0x5cfe32=parseInt(_0x5cfe32);if(isNaN(_0x5cfe32)){_0x58cc05['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5cfe32!=0xc8){_0x58cc05['cb'](null,{'code':_0x5cfe32,'result':-0x1,'extra':'KO'});return;}_0x3e1050=_0x58cc05['rx'][_0x1828('0xf')](0x4)[_0x1828('0x12')](_0x1828('0x13'),'');if(_0x3e1050[_0x1828('0x14')]('\x20')!=-0x1){_0x3e1050=_0x3e1050[_0x1828('0x15')](0x0,_0x3e1050['indexOf']('\x20'));}if(_[_0x1828('0x16')](_0x3e1050,'-1')){_0x3e1050=parseInt(_0x3e1050);}_0x3dac7c=_0x58cc05['rx'][_0x1828('0x17')]('\x20');if(_0x3dac7c['length']==0x3){_0x3dac7c=_0x3dac7c[0x2]['substring'](0x1,_0x3dac7c[0x2]['length']-0x1);}else if(_0x3dac7c[_0x1828('0x18')]>0x3){var _0x703290=/\((.+)\)/;var _0x2759ea=_0x58cc05['rx'][_0x1828('0x19')](_0x703290);if(_0x2759ea){_0x3dac7c=_0x2759ea[0x1];}else{_0x3dac7c=null;}}else{_0x3dac7c=null;}_0x58cc05['cb'](null,{'code':_0x5cfe32,'result':_0x3e1050,'extra':_0x3dac7c});}});_0x13c2bc['on'](_0x1828('0x1a'),function(_0x4ad82){_0x445f9f['emit'](_0x1828('0x1a'),new AGIError(_0x1828('0x1b'),_0x4ad82[_0x1828('0x1c')]));});_0x13c2bc['on'](_0x1828('0x1d'),function(){_0x445f9f['emit'](_0x1828('0x1d'),new AGIError(_0x1828('0x1e')));});_0x13c2bc['on'](_0x1828('0x1f'),function(){_0x445f9f[_0x1828('0xa')](_0x1828('0x1f'),new AGIError(_0x1828('0x20')));_0x13c2bc[_0x1828('0x21')]();});_0x13c2bc['pipe'](_0x545bed);this[_0x1828('0x22')]=function(_0x46ac87,_0x234d8d){var _0x46ac87=_0x46ac87||'',_0x234d8d=typeof _0x234d8d==_0x1828('0x23')?_0x234d8d:new Function();_0x58cc05={'tx':_0x46ac87,'rx':'','cb':_0x234d8d};_0x13c2bc[_0x1828('0x24')](_0x46ac87+'\x0a');},this[_0x1828('0x1d')]=function(){_0x13c2bc['destroy']();};}util[_0x1828('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x3fe560){return this[_0x1828('0x22')][_0x1828('0x26')](this,_0x3fe560);};AGIChannel['prototype'][_0x1828('0x27')]=function(){return this['sendRequest'](_0x1828('0x28'));};AGIChannel[_0x1828('0x29')][_0x1828('0x2a')]=function(_0x6a4d9b,_0x3d293c,_0xd0e966){_0x6a4d9b=_0x6a4d9b===undefined?_0x1828('0x2b'):_0x6a4d9b;_0x3d293c=_0x3d293c===undefined?'5':_0x3d293c;_0xd0e966=_0xd0e966===undefined?'1':_0xd0e966;return this[_0x1828('0x2c')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x6a4d9b,_0x3d293c*0x3e8,_0xd0e966));};AGIChannel[_0x1828('0x29')][_0x1828('0x2d')]=function(_0x59eb12){_0x59eb12=_0x59eb12||'NO\x20MESSAGE';return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x2f'),_0x59eb12));};AGIChannel['prototype'][_0x1828('0x30')]=function(_0x4d71e4,_0x1c5d33){if(_[_0x1828('0x31')](_0x1c5d33)){return this['sendRequest'](util[_0x1828('0x2e')](_0x1828('0x32'),_0x4d71e4,_0x1c5d33[_0x1828('0x33')](',')));}return this[_0x1828('0x2c')](util[_0x1828('0x2e')]('EXEC\x20%s\x20%s',_0x4d71e4,_0x1c5d33));};AGIChannel[_0x1828('0x29')][_0x1828('0x34')]=function(_0x335e87){return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x35'),_0x335e87));};AGIChannel['prototype'][_0x1828('0x36')]=function(_0x349d10){return this[_0x1828('0x2c')](util['format'](_0x1828('0x37'),_0x349d10));};AGIChannel[_0x1828('0x29')]['setPriority']=function(_0x3bc858){return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x38'),_0x3bc858));};AGIChannel[_0x1828('0x29')]['hangup']=function(){return this[_0x1828('0x2c')](_0x1828('0x39'));};AGIChannel['prototype'][_0x1828('0x3a')]=function(_0x4c19fc,_0x2be85d){return this[_0x1828('0x2c')](util['format'](_0x1828('0x3b'),_0x4c19fc,_0x2be85d?_0x2be85d[_0x1828('0x3c')]()[_0x1828('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x1828('0x3d')]=function(_0x6b3378,_0x585c03){return this['sendRequest'](util[_0x1828('0x2e')]('SAY\x20NUMBER\x20%s\x20%s',_0x6b3378,_0x585c03));};AGIChannel[_0x1828('0x29')]['sayDigits']=function(_0x3bb87b,_0x524cb3){return this[_0x1828('0x2c')](util['format'](_0x1828('0x3e'),_0x3bb87b,_0x524cb3));};AGIChannel[_0x1828('0x29')][_0x1828('0x3f')]=function(_0xc715a0,_0x1965ad){return this['sendRequest'](util['format'](_0x1828('0x40'),_0xc715a0,_0x1965ad));};AGIChannel[_0x1828('0x29')][_0x1828('0x41')]=function(_0x43bcd3,_0x4c7acc,_0x44dcf0){_0x4c7acc=_0x4c7acc||this[_0x1828('0x42')];_0x44dcf0=_0x44dcf0||0x1;this[_0x1828('0x34')](_0x43bcd3);this[_0x1828('0x36')](_0x4c7acc);this['setPriority'](_0x44dcf0);return this[_0x1828('0x2d')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x43bcd3,_0x4c7acc,_0x44dcf0));};AGIChannel['prototype'][_0x1828('0x43')]=function(_0x51e48e){return this['sendRequest'](util[_0x1828('0x2e')](_0x1828('0x44'),_0x51e48e));};AGIChannel[_0x1828('0x29')][_0x1828('0x45')]=function(_0x905af9,_0x3d49c4,_0xd79ef5,_0x5baf65,_0x232b47,_0x59a85f){_0x3d49c4=_0x3d49c4||_0x1828('0x46');_0xd79ef5=_0xd79ef5||'';_0x5baf65=_0x5baf65===undefined?-0x1:_0x5baf65==='-1'?-0x1:_0x5baf65*0x3e8;_0x232b47=_0x232b47===undefined?'':'s='+_0x232b47;_0x59a85f=_0x59a85f?_0x1828('0x47'):'';return this[_0x1828('0x2c')](util['format'](_0x1828('0x48'),_0x905af9,_0x3d49c4,_0xd79ef5,_0x5baf65,_0x59a85f,_0x232b47));};AGIChannel[_0x1828('0x29')][_0x1828('0x49')]=function(_0x24446c,_0x352af4){_0x352af4=_0x352af4||'';return this[_0x1828('0x2c')](util[_0x1828('0x2e')](_0x1828('0x4a'),_0x24446c,_0x352af4));};AGIChannel['prototype'][_0x1828('0x4b')]=function(_0xbe1df3){return this['exec'](_0x1828('0x4c'),_0xbe1df3);};AGIChannel[_0x1828('0x29')][_0x1828('0x4d')]=function(_0x5e4096){return this[_0x1828('0x30')]('WAIT',_0x5e4096);};AGIChannel['prototype']['error']=function(_0x5de9d0,_0x268f9f){this[_0x1828('0x2d')](util[_0x1828('0x2e')](_0x1828('0x4e'),_0x5de9d0['id'],_0x5de9d0[_0x1828('0x4f')],_0x268f9f));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5582ad2..e4a4090 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 _0xcc4e=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2db6e3,_0x38cbae){var _0x267caf=function(_0x367275){while(--_0x367275){_0x2db6e3['push'](_0x2db6e3['shift']());}};_0x267caf(++_0x38cbae);}(_0xcc4e,0x64));var _0xecc4=function(_0x1a90fc,_0x1f232f){_0x1a90fc=_0x1a90fc-0x0;var _0x48c470=_0xcc4e[_0x1a90fc];return _0x48c470;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xecc4('0x0'),'E_AGI_ARGUMENT_PORT':_0xecc4('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xecc4('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xecc4('0x3'),'E_AGI_SOCKET_ERROR':_0xecc4('0x4'),'E_AGI_SOCKET_CLOSE':_0xecc4('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xecc4('0x6'),'E_AGI_COMMAND_EMPTY':_0xecc4('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xecc4('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x44437a){var _0x44437a=_0x44437a||null,_0x1a0d9f=_0x1a0d9f||[],_0xc7f965=0x1,_0x545693='';if(!error[_0x44437a]){_0x44437a=_0xecc4('0x9');}_0x1a0d9f['push'](error[_0x44437a]);while(arguments[_0xc7f965]){_0x1a0d9f[_0xecc4('0xa')](arguments[_0xc7f965]);_0xc7f965++;}_0x545693=util[_0xecc4('0xb')][_0xecc4('0xc')](util,_0x1a0d9f);this['message']=_0x545693;this[_0xecc4('0xd')]=_0x44437a;}module[_0xecc4('0xe')]=AGIError; \ No newline at end of file +var _0xf34d=['push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf34d,0x14a));var _0xdf34=function(_0x423856,_0x4f35c0){_0x423856=_0x423856-0x0;var _0x54f272=_0xf34d[_0x423856];return _0x54f272;};'use strict';var util=require(_0xdf34('0x0'));var error={'E_AGI_UNDEFINED':_0xdf34('0x1'),'E_AGI_ARGUMENT_PORT':_0xdf34('0x2'),'E_AGI_SERVER_ERROR':_0xdf34('0x3'),'E_AGI_SERVER_CLOSE':_0xdf34('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xdf34('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xdf34('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xdf34('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xdf34('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xdf34('0x9'),'E_AGI_IVR_ENTRY':_0xdf34('0xa')};function AGIError(_0x94ce6c){var _0x94ce6c=_0x94ce6c||null,_0x56d420=_0x56d420||[],_0x3a37ab=0x1,_0x117c70='';if(!error[_0x94ce6c]){_0x94ce6c=_0xdf34('0xb');}_0x56d420[_0xdf34('0xc')](error[_0x94ce6c]);while(arguments[_0x3a37ab]){_0x56d420[_0xdf34('0xc')](arguments[_0x3a37ab]);_0x3a37ab++;}_0x117c70=util[_0xdf34('0xd')][_0xdf34('0xe')](util,_0x56d420);this[_0xdf34('0xf')]=_0x117c70;this[_0xdf34('0x10')]=_0x94ce6c;}module[_0xdf34('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 84a3695..8a7d78f 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 _0xeffd=['vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeffd,0x6b));var _0xdeff=function(_0x403f94,_0x1399b9){_0x403f94=_0x403f94-0x0;var _0x4af9ce=_0xeffd[_0x403f94];return _0x4af9ce;};'use strict';var _=require(_0xdeff('0x0'));var logger=require('../../../config/logger')(_0xdeff('0x1'));var verticesWithRetry=[_0xdeff('0x2'),_0xdeff('0x3'),_0xdeff('0x4')];var Graph=function(){this[_0xdeff('0x5')]={};this[_0xdeff('0x6')]={};this[_0xdeff('0x7')]=0x0;};Graph[_0xdeff('0x8')][_0xdeff('0x9')]=function(_0x1c4628){this[_0xdeff('0x5')][_0x1c4628['id']]=_0x1c4628;this[_0xdeff('0x6')][_0x1c4628['id']]=[];};Graph[_0xdeff('0x8')][_0xdeff('0xa')]=function(_0x39878e,_0x12e953,_0x24897a){this['edges'][_0x39878e][_0xdeff('0xb')]({'target':_0x12e953,'condition':_0x24897a});this[_0xdeff('0x7')]+=0x1;};Graph[_0xdeff('0x8')]['size']=function(){return _[_0xdeff('0xc')](this[_0xdeff('0x5')]);};Graph[_0xdeff('0x8')][_0xdeff('0xd')]=function(){return this[_0xdeff('0x7')];};Graph[_0xdeff('0x8')][_0xdeff('0xe')]=function(_0x402075){return this['vertices'][_0x402075];};Graph[_0xdeff('0x8')][_0xdeff('0xf')]=function(_0x4952f2,_0x2e614c){if(!this['vertices'][_0x4952f2]){return logger['info'](_0xdeff('0x10'));}var _0x47410f=_0x2e614c(this[_0xdeff('0x5')][_0x4952f2]);if(!_0x47410f){return logger[_0xdeff('0x11')]('stop\x20traverse');}if(this[_0xdeff('0x6')][_0x4952f2][_0xdeff('0x12')]===0x0){return logger[_0xdeff('0x11')](_0xdeff('0x13'));}for(var _0x3dbba1=0x0,_0x125659=[],_0x577244=![];_0x3dbba1\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','retry','addVertex','omit','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','agicommand','response','code','isUndefined','result','agicommand\x20not\x20found','finally','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','syncho','moment','../../config/environment','../../config/logger','./rpc','./graph','agi','127.0.0.1','nextTick','error'];(function(_0x165e43,_0xfcc9cb){var _0x4165e0=function(_0x2ae812){while(--_0x2ae812){_0x165e43['push'](_0x165e43['shift']());}};_0x4165e0(++_0xfcc9cb);}(_0x6947,0xa8));var _0x7694=function(_0x1b8d19,_0x44a4c3){_0x1b8d19=_0x1b8d19-0x0;var _0x45a0ff=_0x6947[_0x1b8d19];return _0x45a0ff;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x7694('0x0'));var util=require('util');var moment=require(_0x7694('0x1'));var config=require(_0x7694('0x2'));var logger=require(_0x7694('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x7694('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x7694('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x7694('0x6')],{'ip':_0x7694('0x7'),'port':0x11dd});function connectionHandler(_0x264ea2){process[_0x7694('0x8')](function(){syncho(function(){try{setChannelVariables(_0x264ea2);agiHandler(_0x264ea2);}catch(_0x4b32d0){logger[_0x7694('0x9')](_0x4b32d0[_0x7694('0xa')]);}});});}function listeningHandler(){console[_0x7694('0xb')](_0x7694('0xc'),config['agi'][_0x7694('0xd')]);logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x10'),config[_0x7694('0x6')]['ip'],config[_0x7694('0x6')][_0x7694('0xd')]));}function errorHandler(_0x1f529b){if(_0x1f529b&&_0x1f529b[_0x7694('0x11')]&&_0x1f529b[_0x7694('0x12')]){logger[_0x7694('0x9')](util[_0x7694('0xf')](_0x7694('0x13'),_0x1f529b[_0x7694('0x11')],_0x1f529b['message']));}else{logger[_0x7694('0x9')](util[_0x7694('0xf')](_0x7694('0x14'),_0x1f529b['stack']));}}function closeHandler(){logger[_0x7694('0xe')](util['format'](_0x7694('0x15'),this[_0x7694('0x16')],this[_0x7694('0x17')],this[_0x7694('0x18')],this['dnid'],this[_0x7694('0x19')]));try{createSquareReport(this);}catch(_0x44341c){logger[_0x7694('0x9')](_0x44341c[_0x7694('0xa')]);}}function timeoutHandler(){logger[_0x7694('0xe')](util['format'](_0x7694('0x1a'),this[_0x7694('0x16')],this[_0x7694('0x17')],this[_0x7694('0x18')],this['dnid'],this[_0x7694('0x19')]));}function hangupHandler(){logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x1b'),this[_0x7694('0x16')],this[_0x7694('0x17')],this['callerid'],this[_0x7694('0x1c')],this['uniqueid']));this[_0x7694('0x1d')]=!![];}function getRoot(_0xec45b2){return parser[_0x7694('0x1e')](_0xec45b2,{'object':!![]})[_0x7694('0x1f')][_0x7694('0x20')];}function addVertex(_0x2f9633,_0x8dfac6,_0x37e643){_0x8dfac6['agicommand']=_0x37e643;if(_0x8dfac6[_0x7694('0x21')]('retry')){_0x8dfac6[_0x7694('0x22')]=parseInt(_0x8dfac6[_0x7694('0x23')],0xa);}_0x2f9633[_0x7694('0x24')](_[_0x7694('0x25')](_0x8dfac6,'mxCell'));}function initGraph(_0x340458,_0x111230){var _0x263f37=new Graph();for(var _0x35742b in _0x340458){if(_0x340458[_0x7694('0x21')](_0x35742b)){if(_['isArray'](_0x340458[_0x35742b])){for(var _0xb0148c=0x0;_0xb0148c<_0x340458[_0x35742b][_0x7694('0x26')];_0xb0148c+=0x1){addVertex(_0x263f37,_0x340458[_0x35742b][_0xb0148c],_0x35742b);}}else{addVertex(_0x263f37,_0x340458[_0x35742b],_0x35742b);}}}for(var _0x253ba4=0x0;_0x253ba4<_0x111230['length'];_0x253ba4+=0x1){if(_0x111230[_0x253ba4][_0x7694('0x27')]&&_0x111230[_0x253ba4][_0x7694('0x28')]){_0x263f37[_0x7694('0x29')](_0x111230[_0x253ba4][_0x7694('0x27')],_0x111230[_0x253ba4]['target'],_0x111230[_0x253ba4][_0x7694('0x2a')]);}}return _0x263f37;}function getSquareProject(_0x520e93,_0x16ba9a){rpc[_0x7694('0x2b')](_0x520e93)[_0x7694('0x2c')](function(_0x200855){_0x16ba9a(null,_0x200855);})[_0x7694('0x2d')](function(_0x1bd2ff){_0x16ba9a(null,_0x1bd2ff);});}function createSquareReport(_0x5b6cc5,_0x1f8027){rpc[_0x7694('0x2e')](_0x5b6cc5)[_0x7694('0x2c')](function(_0x478cac){if(_0x1f8027){_0x1f8027(null,_0x478cac);}})[_0x7694('0x2d')](function(_0x15d34a){if(_0x1f8027){_0x1f8027(null,_0x15d34a);}});}function setChannelVariables(_0x42c0a2){for(var _0x5d03bd in _0x42c0a2){if(_0x42c0a2[_0x7694('0x21')](_0x5d03bd)){if(_0x5d03bd[_0x7694('0x2f')](_0x7694('0x30'))===0x0){_0x42c0a2[_0x5d03bd['substring'](0x4)]=_0x42c0a2[_0x5d03bd];delete _0x42c0a2[_0x5d03bd];}}}}function getLogFromObject(_0x569813){return util[_0x7694('0x31')](_0x569813,{'showHidden':![],'depth':null});}function agiHandler(_0x198a3c){var _0x24c7b7,_0x114976,_0xb5a484,_0x5b8312,_0x1f866c;logger[_0x7694('0x32')]('variables',JSON['stringify'](_0x198a3c,null,0x2));logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x33'),_0x198a3c[_0x7694('0x16')],_0x198a3c['calleridname'],_0x198a3c['callerid'],_0x198a3c[_0x7694('0x1c')],_0x198a3c[_0x7694('0x19')]));_0x198a3c['on']('error',errorHandler);_0x198a3c['on']('close',closeHandler);_0x198a3c['on'](_0x7694('0x34'),timeoutHandler);_0x198a3c[_0x7694('0x1d')]=![];_0x198a3c['on'](_0x7694('0x35'),hangupHandler);var _0x3da1cc=getSquareProject[_0x7694('0x36')](null,_0x198a3c[_0x7694('0x16')]);if(_0x3da1cc){if(_0x3da1cc[_0x7694('0x37')]){_0x24c7b7=getRoot(_0x3da1cc['production']);if(_0x24c7b7&&_0x24c7b7['start']){logger[_0x7694('0x32')]('root',JSON[_0x7694('0x38')](_0x24c7b7,null,0x2));_0x198a3c[_0x7694('0x39')]=moment()[_0x7694('0xf')](_0x7694('0x3a'));_0x114976=initGraph(_['omit'](_0x24c7b7,_0x7694('0x3b')),_0x24c7b7[_0x7694('0x3b')]);_0xb5a484=new Vertices(_0x198a3c,rpc,mailRpc);logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x3c'),_0x198a3c[_0x7694('0x16')],_0x198a3c[_0x7694('0x17')],_0x198a3c[_0x7694('0x18')],_0x198a3c['dnid'],_0x198a3c[_0x7694('0x19')]));_0x114976[_0x7694('0x3d')](_0x24c7b7[_0x7694('0x3e')]['id'],function(_0x1ffd03){try{_0x1ffd03=_0xb5a484[_0x7694('0x3f')](_0x1ffd03);logger['debug'](_0x7694('0x40'),JSON[_0x7694('0x38')](_0x1ffd03,null,0x2));if(_0x1ffd03['agicommand']===_0x7694('0x41')){logger[_0x7694('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x198a3c[_0x7694('0x42')]=_0x1ffd03[_0x7694('0x42')]||_0x198a3c[_0x7694('0x42')];_0x198a3c[_0x7694('0x43')]=_0x1ffd03['extension'];_0x198a3c[_0x7694('0x44')]=_0x1ffd03[_0x7694('0x44')]?_0x1ffd03[_0x7694('0x44')]-0x1:0x1;return null;}else if(_0x1ffd03&&_0xb5a484[_0x1ffd03[_0x7694('0x45')]]){_0x1f866c=_0xb5a484[_0x1ffd03[_0x7694('0x45')]](_0x1ffd03);logger[_0x7694('0xe')](_0x7694('0x46'),JSON[_0x7694('0x38')](_0x1f866c,null,0x2));if(_0x1f866c&&_0x1f866c[_0x7694('0x47')]===AGI_CODE_SUCCESS&&_0x1f866c['result']!==AGI_RESULT_ERROR&&!_0x198a3c[_0x7694('0x1d')]){logger[_0x7694('0x32')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return _[_0x7694('0x48')](_0x1f866c['result'])?null:_0x1f866c[_0x7694('0x49')]['toString']();}else{logger[_0x7694('0x9')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return null;}}else{logger['error'](_0x7694('0x4a'));return null;}}catch(_0x2a394b){logger[_0x7694('0x9')](_0x2a394b[_0x7694('0xa')]);return null;}});if(_0x24c7b7['finally']){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x198a3c[_0x7694('0x16')],_0x198a3c['calleridname'],_0x198a3c[_0x7694('0x18')],_0x198a3c[_0x7694('0x1c')],_0x198a3c[_0x7694('0x19')]));_0x114976[_0x7694('0x3d')](_0x24c7b7[_0x7694('0x4b')]['id'],function(_0x33bcf7){try{_0x33bcf7=_0xb5a484[_0x7694('0x3f')](_0x33bcf7);logger[_0x7694('0x32')](_0x7694('0x40'),JSON[_0x7694('0x38')](_0x33bcf7,null,0x2));if(_0x33bcf7&&_0xb5a484[_0x33bcf7[_0x7694('0x45')]]){_0x1f866c=_0xb5a484[_0x33bcf7[_0x7694('0x45')]](_0x33bcf7);if(_0x1f866c){logger[_0x7694('0x32')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return _['isUndefined'](_0x1f866c[_0x7694('0x49')])?null:_0x1f866c[_0x7694('0x49')][_0x7694('0x4c')]();}else{logger['error'](_0x7694('0x46'),getLogFromObject(_0x1f866c));return null;}}else{logger[_0x7694('0x9')](_0x7694('0x4a'));return null;}}catch(_0x28964b){logger[_0x7694('0x9')](_0x28964b[_0x7694('0xa')]);return null;}});}logger['info'](util[_0x7694('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x198a3c[_0x7694('0x16')],_0x198a3c[_0x7694('0x17')],_0x198a3c[_0x7694('0x18')],_0x198a3c[_0x7694('0x1c')],_0x198a3c['uniqueid']));logger['info'](util[_0x7694('0xf')](_0x7694('0x4d'),_0x198a3c[_0x7694('0x42')],_0x198a3c['extension'],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1));_0x198a3c[_0x7694('0x4e')](_0x198a3c['context'],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1);_0x198a3c[_0x7694('0x4f')]();}}else{logger['error'](util[_0x7694('0xf')](_0x7694('0x50'),_0x198a3c[_0x7694('0x16')]));_0x198a3c[_0x7694('0x4e')](_0x198a3c[_0x7694('0x42')],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c['priority'],0xa)+0x1);_0x198a3c['close']();}}else{logger[_0x7694('0x9')](util['format']('Project\x20%s\x20not\x20found',_0x198a3c[_0x7694('0x16')]));_0x198a3c[_0x7694('0x4e')](_0x198a3c[_0x7694('0x42')],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1);_0x198a3c[_0x7694('0x4f')]();}}function main(){var _0x4234fa;return utilLicense[_0x7694('0x51')]()[_0x7694('0x2c')](function(_0x3ac27c){if(_0x3ac27c){if(_0x3ac27c[_0x7694('0x52')]){if(_0x3ac27c['callysquare']&&_0x3ac27c[_0x7694('0x53')]>0x0){logger[_0x7694('0xe')](util['format'](_0x7694('0x54'),_0x3ac27c[_0x7694('0x53')]));_0x4234fa=_0x3ac27c[_0x7694('0x53')];}else{logger['info'](_0x7694('0x55'));}}else{logger[_0x7694('0xe')](_0x7694('0x56'));_0x4234fa=-0x1;}}})[_0x7694('0x2d')](function(_0x4014b9){logger[_0x7694('0x9')](_0x7694('0x57'),_0x4014b9['stack']);})['finally'](function(){var _0x20b396=require('./server')(config['agi'][_0x7694('0xd')],config[_0x7694('0x6')]['ip'],_0x4234fa);_0x20b396['on'](_0x7694('0x9'),errorHandler);_0x20b396['on'](_0x7694('0x58'),listeningHandler);_0x20b396['on']('connection',connectionHandler);_0x20b396['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x7b00=['createSquareReport','catch','indexOf','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','debug','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','lodash','syncho','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','name','message','[%s]\x20%s','format','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','target','addEdge','value','getSquareProject','then'];(function(_0x41bd14,_0x487433){var _0x5d5d10=function(_0x92374e){while(--_0x92374e){_0x41bd14['push'](_0x41bd14['shift']());}};_0x5d5d10(++_0x487433);}(_0x7b00,0x125));var _0x07b0=function(_0x366067,_0x3f8f22){_0x366067=_0x366067-0x0;var _0x363cd7=_0x7b00[_0x366067];return _0x363cd7;};'use strict';var parser=require('xml2json');var _=require(_0x07b0('0x0'));var syncho=require(_0x07b0('0x1'));var util=require('util');var moment=require(_0x07b0('0x2'));var config=require(_0x07b0('0x3'));var logger=require('../../config/logger')(_0x07b0('0x4'));var utilLicense=require(_0x07b0('0x5'));var rpc=require(_0x07b0('0x6'));var mailRpc=require(_0x07b0('0x7'));var Graph=require('./graph');var Vertices=require(_0x07b0('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x07b0('0x4')]=_['defaults'](config[_0x07b0('0x4')],{'ip':_0x07b0('0x9'),'port':0x11dd});function connectionHandler(_0x43ac6d){process[_0x07b0('0xa')](function(){syncho(function(){try{setChannelVariables(_0x43ac6d);agiHandler(_0x43ac6d);}catch(_0x40dc82){logger[_0x07b0('0xb')](_0x40dc82[_0x07b0('0xc')]);}});});}function listeningHandler(){console['log'](_0x07b0('0xd'),config[_0x07b0('0x4')][_0x07b0('0xe')]);logger[_0x07b0('0xf')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x5d3296){if(_0x5d3296&&_0x5d3296[_0x07b0('0x10')]&&_0x5d3296[_0x07b0('0x11')]){logger['error'](util['format'](_0x07b0('0x12'),_0x5d3296['name'],_0x5d3296[_0x07b0('0x11')]));}else{logger['error'](util[_0x07b0('0x13')](_0x07b0('0x14'),_0x5d3296[_0x07b0('0xc')]));}}function closeHandler(){logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x07b0('0x15')],this[_0x07b0('0x16')],this[_0x07b0('0x17')],this[_0x07b0('0x18')],this[_0x07b0('0x19')]));try{createSquareReport(this);}catch(_0xfdc024){logger[_0x07b0('0xb')](_0xfdc024[_0x07b0('0xc')]);}}function timeoutHandler(){logger['info'](util[_0x07b0('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x07b0('0x15')],this['calleridname'],this[_0x07b0('0x17')],this[_0x07b0('0x18')],this[_0x07b0('0x19')]));}function hangupHandler(){logger[_0x07b0('0xf')](util['format'](_0x07b0('0x1a'),this['arg_1'],this['calleridname'],this[_0x07b0('0x17')],this['dnid'],this['uniqueid']));this[_0x07b0('0x1b')]=!![];}function getRoot(_0x3a37b9){return parser[_0x07b0('0x1c')](_0x3a37b9,{'object':!![]})[_0x07b0('0x1d')][_0x07b0('0x1e')];}function addVertex(_0x50498a,_0x14f568,_0x24703a){_0x14f568['agicommand']=_0x24703a;if(_0x14f568[_0x07b0('0x1f')](_0x07b0('0x20'))){_0x14f568[_0x07b0('0x21')]=parseInt(_0x14f568['retry'],0xa);}_0x50498a['addVertex'](_[_0x07b0('0x22')](_0x14f568,_0x07b0('0x23')));}function initGraph(_0x4b912a,_0x144b88){var _0xc4f8a7=new Graph();for(var _0x3dd217 in _0x4b912a){if(_0x4b912a[_0x07b0('0x1f')](_0x3dd217)){if(_[_0x07b0('0x24')](_0x4b912a[_0x3dd217])){for(var _0x3927f6=0x0;_0x3927f6<_0x4b912a[_0x3dd217][_0x07b0('0x25')];_0x3927f6+=0x1){addVertex(_0xc4f8a7,_0x4b912a[_0x3dd217][_0x3927f6],_0x3dd217);}}else{addVertex(_0xc4f8a7,_0x4b912a[_0x3dd217],_0x3dd217);}}}for(var _0x4d69bb=0x0;_0x4d69bb<_0x144b88[_0x07b0('0x25')];_0x4d69bb+=0x1){if(_0x144b88[_0x4d69bb]['source']&&_0x144b88[_0x4d69bb][_0x07b0('0x26')]){_0xc4f8a7[_0x07b0('0x27')](_0x144b88[_0x4d69bb]['source'],_0x144b88[_0x4d69bb][_0x07b0('0x26')],_0x144b88[_0x4d69bb][_0x07b0('0x28')]);}}return _0xc4f8a7;}function getSquareProject(_0x45c48f,_0x47e9ad){rpc[_0x07b0('0x29')](_0x45c48f)[_0x07b0('0x2a')](function(_0x2b4e75){_0x47e9ad(null,_0x2b4e75);})['catch'](function(_0x2d9fa0){_0x47e9ad(null,_0x2d9fa0);});}function createSquareReport(_0x3dcefa,_0x20a7c3){rpc[_0x07b0('0x2b')](_0x3dcefa)['then'](function(_0x2b4841){if(_0x20a7c3){_0x20a7c3(null,_0x2b4841);}})[_0x07b0('0x2c')](function(_0x5a6748){if(_0x20a7c3){_0x20a7c3(null,_0x5a6748);}});}function setChannelVariables(_0x1b8994){for(var _0x353a20 in _0x1b8994){if(_0x1b8994['hasOwnProperty'](_0x353a20)){if(_0x353a20[_0x07b0('0x2d')]('agi_')===0x0){_0x1b8994[_0x353a20[_0x07b0('0x2e')](0x4)]=_0x1b8994[_0x353a20];delete _0x1b8994[_0x353a20];}}}}function getLogFromObject(_0x1b1f41){return util['inspect'](_0x1b1f41,{'showHidden':![],'depth':null});}function agiHandler(_0xcf17ca){var _0x55fbcb,_0x3ab3f1,_0x1878fd,_0x3d7498,_0x4d9812;logger['debug']('variables',JSON[_0x07b0('0x2f')](_0xcf17ca,null,0x2));logger[_0x07b0('0xf')](util['format'](_0x07b0('0x30'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca['calleridname'],_0xcf17ca['callerid'],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0xcf17ca['on'](_0x07b0('0xb'),errorHandler);_0xcf17ca['on'](_0x07b0('0x31'),closeHandler);_0xcf17ca['on'](_0x07b0('0x32'),timeoutHandler);_0xcf17ca[_0x07b0('0x1b')]=![];_0xcf17ca['on']('hangup',hangupHandler);var _0x541066=getSquareProject[_0x07b0('0x33')](null,_0xcf17ca['arg_1']);if(_0x541066){if(_0x541066[_0x07b0('0x34')]){_0x55fbcb=getRoot(_0x541066[_0x07b0('0x34')]);if(_0x55fbcb&&_0x55fbcb[_0x07b0('0x35')]){logger['debug']('root',JSON[_0x07b0('0x2f')](_0x55fbcb,null,0x2));_0xcf17ca[_0x07b0('0x36')]=moment()[_0x07b0('0x13')](_0x07b0('0x37'));_0x3ab3f1=initGraph(_[_0x07b0('0x22')](_0x55fbcb,_0x07b0('0x23')),_0x55fbcb[_0x07b0('0x23')]);_0x1878fd=new Vertices(_0xcf17ca,rpc,mailRpc);logger[_0x07b0('0xf')](util[_0x07b0('0x13')](_0x07b0('0x38'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0x3ab3f1['traverseBFS'](_0x55fbcb[_0x07b0('0x35')]['id'],function(_0x355aba){try{_0x355aba=_0x1878fd[_0x07b0('0x39')](_0x355aba);logger[_0x07b0('0x3a')]('vertex',JSON[_0x07b0('0x2f')](_0x355aba,null,0x2));if(_0x355aba[_0x07b0('0x3b')]===_0x07b0('0x3c')){logger[_0x07b0('0xf')](_0x07b0('0x3d'));_0xcf17ca[_0x07b0('0x3e')]=_0x355aba[_0x07b0('0x3e')]||_0xcf17ca[_0x07b0('0x3e')];_0xcf17ca[_0x07b0('0x3f')]=_0x355aba['extension'];_0xcf17ca[_0x07b0('0x40')]=_0x355aba['priority']?_0x355aba[_0x07b0('0x40')]-0x1:0x1;return null;}else if(_0x355aba&&_0x1878fd[_0x355aba[_0x07b0('0x3b')]]){_0x4d9812=_0x1878fd[_0x355aba[_0x07b0('0x3b')]](_0x355aba);logger[_0x07b0('0xf')](_0x07b0('0x41'),JSON['stringify'](_0x4d9812,null,0x2));if(_0x4d9812&&_0x4d9812[_0x07b0('0x42')]===AGI_CODE_SUCCESS&&_0x4d9812[_0x07b0('0x43')]!==AGI_RESULT_ERROR&&!_0xcf17ca[_0x07b0('0x1b')]){logger[_0x07b0('0x3a')]('response',getLogFromObject(_0x4d9812));return _[_0x07b0('0x44')](_0x4d9812[_0x07b0('0x43')])?null:_0x4d9812['result'][_0x07b0('0x45')]();}else{logger['error']('response',getLogFromObject(_0x4d9812));return null;}}else{logger[_0x07b0('0xb')](_0x07b0('0x46'));return null;}}catch(_0x3198af){logger[_0x07b0('0xb')](_0x3198af[_0x07b0('0xc')]);return null;}});if(_0x55fbcb[_0x07b0('0x47')]){logger['info'](util['format'](_0x07b0('0x48'),_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca[_0x07b0('0x18')],_0xcf17ca[_0x07b0('0x19')]));_0x3ab3f1[_0x07b0('0x49')](_0x55fbcb[_0x07b0('0x47')]['id'],function(_0x950691){try{_0x950691=_0x1878fd[_0x07b0('0x39')](_0x950691);logger['debug'](_0x07b0('0x4a'),JSON[_0x07b0('0x2f')](_0x950691,null,0x2));if(_0x950691&&_0x1878fd[_0x950691[_0x07b0('0x3b')]]){_0x4d9812=_0x1878fd[_0x950691[_0x07b0('0x3b')]](_0x950691);if(_0x4d9812){logger['debug'](_0x07b0('0x41'),getLogFromObject(_0x4d9812));return _[_0x07b0('0x44')](_0x4d9812[_0x07b0('0x43')])?null:_0x4d9812[_0x07b0('0x43')][_0x07b0('0x45')]();}else{logger[_0x07b0('0xb')](_0x07b0('0x41'),getLogFromObject(_0x4d9812));return null;}}else{logger[_0x07b0('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x4fa237){logger['error'](_0x4fa237[_0x07b0('0xc')]);return null;}});}logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xcf17ca[_0x07b0('0x15')],_0xcf17ca[_0x07b0('0x16')],_0xcf17ca[_0x07b0('0x17')],_0xcf17ca['dnid'],_0xcf17ca[_0x07b0('0x19')]));logger['info'](util[_0x07b0('0x13')](_0x07b0('0x4b'),_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca[_0x07b0('0x3f')],parseInt(_0xcf17ca[_0x07b0('0x40')],0xa)+0x1));_0xcf17ca['continueAt'](_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca['extension'],parseInt(_0xcf17ca[_0x07b0('0x40')],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}else{logger['error'](util[_0x07b0('0x13')](_0x07b0('0x4c'),_0xcf17ca[_0x07b0('0x15')]));_0xcf17ca['continueAt'](_0xcf17ca['context'],_0xcf17ca[_0x07b0('0x3f')],parseInt(_0xcf17ca['priority'],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}else{logger['error'](util[_0x07b0('0x13')]('Project\x20%s\x20not\x20found',_0xcf17ca['arg_1']));_0xcf17ca[_0x07b0('0x4d')](_0xcf17ca[_0x07b0('0x3e')],_0xcf17ca['extension'],parseInt(_0xcf17ca['priority'],0xa)+0x1);_0xcf17ca[_0x07b0('0x31')]();}}function main(){var _0x4c1413;return utilLicense[_0x07b0('0x4e')]()[_0x07b0('0x2a')](function(_0x4e58c9){if(_0x4e58c9){if(_0x4e58c9[_0x07b0('0x4f')]){if(_0x4e58c9[_0x07b0('0x50')]&&_0x4e58c9['callysquare']>0x0){logger[_0x07b0('0xf')](util[_0x07b0('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4e58c9[_0x07b0('0x50')]));_0x4c1413=_0x4e58c9[_0x07b0('0x50')];}else{logger['info'](_0x07b0('0x51'));}}else{logger[_0x07b0('0xf')](_0x07b0('0x52'));_0x4c1413=-0x1;}}})[_0x07b0('0x2c')](function(_0xf99e19){logger['error']('[LICENSE]',_0xf99e19['stack']);})['finally'](function(){var _0x19499e=require('./server')(config[_0x07b0('0x4')]['port'],config['agi']['ip'],_0x4c1413);_0x19499e['on'](_0x07b0('0xb'),errorHandler);_0x19499e['on'](_0x07b0('0x53'),listeningHandler);_0x19499e['on']('connection',connectionHandler);_0x19499e['on'](_0x07b0('0x31'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index e25225b..0f9afc5 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x559cd0,_0x38c74a){var _0x13b20e=function(_0x3e4d2c){while(--_0x3e4d2c){_0x559cd0['push'](_0x559cd0['shift']());}};_0x13b20e(++_0x38c74a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x5b8b3f,_0x4900c0){var _0x416d54=function(_0x37309c){while(--_0x37309c){_0x5b8b3f['push'](_0x5b8b3f['shift']());}};_0x416d54(++_0x4900c0);}(_0x814b,0x1a2));var _0xb814=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x814b[_0x3ef2d5];return _0x2fefb2;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b6cf06a..0a7826a 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x543f9f,_0x563bf5){var _0x23e5d3=function(_0x5cd0e0){while(--_0x5cd0e0){_0x543f9f['push'](_0x543f9f['shift']());}};_0x23e5d3(++_0x563bf5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x430678,_0x50ccc2){_0x430678=_0x430678-0x0;var _0xca6e8b=_0x5f2f[_0x430678];return _0xca6e8b;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xb10b,0x12a));var _0xbb10=function(_0x173336,_0x3f98c4){_0x173336=_0x173336-0x0;var _0x12dc79=_0xb10b[_0x173336];return _0x12dc79;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4f2dbad..fa01994 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 _0x438c=['production','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createSquareMessage','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','jayson/promise','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject'];(function(_0x338c8c,_0x19df14){var _0x371a9a=function(_0x4da3fe){while(--_0x4da3fe){_0x338c8c['push'](_0x338c8c['shift']());}};_0x371a9a(++_0x19df14);}(_0x438c,0x1e9));var _0xc438=function(_0x973bf2,_0x4aa2bf){_0x973bf2=_0x973bf2-0x0;var _0x1c2bb8=_0x438c[_0x973bf2];return _0x1c2bb8;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xc438('0x0'));var util=require('util');var jayson=require(_0xc438('0x1'));var client=jayson[_0xc438('0x2')][_0xc438('0x3')]({'port':0x2329});function request(_0x1720fb,_0x3d7323){return new BPromise(function(_0x190e3e,_0x3be04a){return client[_0xc438('0x4')](_0x1720fb,_0x3d7323)[_0xc438('0x5')](function(_0x59ddc1){if(_0x59ddc1[_0xc438('0x6')]){return _0x3be04a(_0x59ddc1[_0xc438('0x6')][_0xc438('0x7')]);}else{return _0x190e3e(_0x59ddc1[_0xc438('0x8')]);}})['catch'](function(_0x12c7a4){return _0x3be04a(_0x12c7a4);});});}exports[_0xc438('0x9')]=function(_0x29e2c3){return request(_0xc438('0xa'),{'options':{'raw':![],'where':{'name':_0x29e2c3},'attributes':[_0xc438('0xb')]}});};exports['getMailAccountById']=function(_0xccb9d3){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xccb9d3},'include':[{'model':'MailServerOut','as':_0xc438('0xc')}],'attributes':['id','name','email']}});};exports[_0xc438('0xd')]=function(_0x113bc9){return request(_0xc438('0xa'),{'options':{'where':{'id':_0x113bc9},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0xf')]=function(_0x5b6b79){return request(_0xc438('0x10'),{'options':{'where':{'id':_0x5b6b79},'attributes':[_0xc438('0xe')]}});};exports['getVariableById']=function(_0x3eb473){return request('ShowVariable',{'options':{'where':{'id':_0x3eb473},'attributes':['name']}});};exports[_0xc438('0x11')]=function(_0x436837){return request(_0xc438('0x12'),{'options':{'where':{'id':_0x436837},'attributes':[_0xc438('0x13')]}});};exports['getUserById']=function(_0x58a14b){return request('ShowUser',{'options':{'where':{'id':_0x58a14b},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0x14')]=function(_0x43b24b){return request(_0xc438('0x15'),{'options':{'where':{'id':_0x43b24b},'attributes':['name']}});};exports[_0xc438('0x16')]=function(_0x3b7230){return request(_0xc438('0x17'),{'options':{'where':{'id':_0x3b7230},'attributes':[_0xc438('0x18')]}});};exports['getIntervalById']=function(_0x5aeac9){return request(_0xc438('0x19'),{'options':{'raw':![],'where':{'id':_0x5aeac9},'include':[{'model':'Interval','as':_0xc438('0x1a')}]}});};exports[_0xc438('0x1b')]=function(_0x191f51){return request('ShowSmsAccount',{'options':{'where':{'id':_0x191f51},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x33c991){return request(_0xc438('0x1c'),{'body':_0x33c991});};exports[_0xc438('0x1d')]=function(_0x47b7cd){return request(_0xc438('0x1e'),{'body':_0x47b7cd});};exports[_0xc438('0x1f')]=function(_0x1da8fb){return request(_0xc438('0x20'),{'body':_[_0xc438('0x21')](_0x1da8fb,{'project_name':_0x1da8fb[_0xc438('0x22')],'prev_project_name':_0x1da8fb[_0xc438('0x23')]||'','is_subproject':_0x1da8fb[_0xc438('0x23')]?!![]:![],'leaveAt':moment()[_0xc438('0x24')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xc438('0x25')]=function(_0x2d3c05){return request('CreateSquareRecording',{'body':_0x2d3c05});};exports[_0xc438('0x26')]=function(_0x81a9e6){return request('CreateSquareMessage',{'body':_0x81a9e6});};exports['createCmContact']=function(_0x46e958){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x46e958[_0xc438('0x27')],'ListId':_0x46e958['ListId']}}})[_0xc438('0x5')](function(_0x427f0a){if(_0x427f0a){return _0x427f0a;}return request(_0xc438('0x28'),{'body':_0x46e958});});};exports[_0xc438('0x29')]=function(_0x3bee38){return request(_0xc438('0x2a'),{'options':{'where':{'id':_0x3bee38},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0x2b')]=function(_0x399eb6,_0x4a0178){return request(_0xc438('0x2c'),{'body':{'interface':_0x4a0178},'options':{'where':_0x399eb6}});};exports[_0xc438('0x2d')]=function(_0x26af5e,_0x55eb9d,_0x55fa6f){return request(_0xc438('0x2e'),{'body':{'type':_0x55eb9d,'uniqueid':_0x55fa6f},'options':{'where':_0x26af5e}});};exports[_0xc438('0x2f')]=function(_0x1db0d4){return request(_0xc438('0x30'),{'body':{},'options':{'where':_0x1db0d4}});};exports[_0xc438('0x31')]=function(_0x4e30a1){return request('LogoutUser',{'body':{},'options':{'where':_0x4e30a1}});}; \ No newline at end of file +var _0x79b0=['then','error','message','result','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','request'];(function(_0xc7c8e9,_0x4dabea){var _0xc65a78=function(_0x33b1dc){while(--_0x33b1dc){_0xc7c8e9['push'](_0xc7c8e9['shift']());}};_0xc65a78(++_0x4dabea);}(_0x79b0,0x9f));var _0x079b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x79b0[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x079b('0x0'));var moment=require(_0x079b('0x1'));var _=require(_0x079b('0x2'));var util=require(_0x079b('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x079b('0x4')]['http']({'port':0x2329});function request(_0x64d916,_0x5786bb){return new BPromise(function(_0x347d2c,_0x7f276c){return client[_0x079b('0x5')](_0x64d916,_0x5786bb)[_0x079b('0x6')](function(_0x355332){if(_0x355332[_0x079b('0x7')]){return _0x7f276c(_0x355332[_0x079b('0x7')][_0x079b('0x8')]);}else{return _0x347d2c(_0x355332[_0x079b('0x9')]);}})['catch'](function(_0x27a3ca){return _0x7f276c(_0x27a3ca);});});}exports[_0x079b('0xa')]=function(_0x15315a){return request(_0x079b('0xb'),{'options':{'raw':![],'where':{'name':_0x15315a},'attributes':['production']}});};exports[_0x079b('0xc')]=function(_0x14a2fa){return request(_0x079b('0xd'),{'options':{'raw':![],'where':{'id':_0x14a2fa},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x079b('0xe'),'email']}});};exports[_0x079b('0xf')]=function(_0x41c7e1){return request(_0x079b('0xb'),{'options':{'where':{'id':_0x41c7e1},'attributes':[_0x079b('0xe')]}});};exports[_0x079b('0x10')]=function(_0x5f2580){return request(_0x079b('0x11'),{'options':{'where':{'id':_0x5f2580},'attributes':['name']}});};exports['getVariableById']=function(_0x387c45){return request(_0x079b('0x12'),{'options':{'where':{'id':_0x387c45},'attributes':['name']}});};exports[_0x079b('0x13')]=function(_0x4529cc){return request(_0x079b('0x14'),{'options':{'where':{'id':_0x4529cc},'attributes':[_0x079b('0x15')]}});};exports[_0x079b('0x16')]=function(_0x25b51b){return request(_0x079b('0x17'),{'options':{'where':{'id':_0x25b51b},'attributes':['name']}});};exports[_0x079b('0x18')]=function(_0x289d2e){return request(_0x079b('0x19'),{'options':{'where':{'id':_0x289d2e},'attributes':[_0x079b('0xe')]}});};exports['getSoundById']=function(_0x52bba5){return request(_0x079b('0x1a'),{'options':{'where':{'id':_0x52bba5},'attributes':[_0x079b('0x1b')]}});};exports[_0x079b('0x1c')]=function(_0x4f8a8d){return request(_0x079b('0x1d'),{'options':{'raw':![],'where':{'id':_0x4f8a8d},'include':[{'model':_0x079b('0x1e'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0xfc5ddb){return request(_0x079b('0x1f'),{'options':{'where':{'id':_0xfc5ddb},'attributes':['id',_0x079b('0xe')]}});};exports[_0x079b('0x20')]=function(_0x479b38){return request(_0x079b('0x21'),{'body':_0x479b38});};exports['createSquareDetailsReport']=function(_0x125fc2){return request(_0x079b('0x22'),{'body':_0x125fc2});};exports['createSquareReport']=function(_0x5cdff6){return request(_0x079b('0x23'),{'body':_[_0x079b('0x24')](_0x5cdff6,{'project_name':_0x5cdff6[_0x079b('0x25')],'prev_project_name':_0x5cdff6[_0x079b('0x26')]||'','is_subproject':_0x5cdff6[_0x079b('0x26')]?!![]:![],'leaveAt':moment()[_0x079b('0x27')](_0x079b('0x28'))})});};exports['createSquareRecording']=function(_0x1c6630){return request(_0x079b('0x29'),{'body':_0x1c6630});};exports[_0x079b('0x2a')]=function(_0x38a10f){return request(_0x079b('0x2b'),{'body':_0x38a10f});};exports['createCmContact']=function(_0x2ae6e7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x2ae6e7[_0x079b('0x2c')],'ListId':_0x2ae6e7[_0x079b('0x2d')]}}})[_0x079b('0x6')](function(_0x3de50f){if(_0x3de50f){return _0x3de50f;}return request('CreateCmContact',{'body':_0x2ae6e7});});};exports[_0x079b('0x2e')]=function(_0x3675d8){return request('ShowPause',{'options':{'where':{'id':_0x3675d8},'attributes':['name']}});};exports[_0x079b('0x2f')]=function(_0x2f7b02,_0x383b6a){return request(_0x079b('0x30'),{'body':{'interface':_0x383b6a},'options':{'where':_0x2f7b02}});};exports[_0x079b('0x31')]=function(_0x33d26a,_0x337714,_0x4130b9){return request(_0x079b('0x32'),{'body':{'type':_0x337714,'uniqueid':_0x4130b9},'options':{'where':_0x33d26a}});};exports[_0x079b('0x33')]=function(_0x43faa2){return request(_0x079b('0x34'),{'body':{},'options':{'where':_0x43faa2}});};exports[_0x079b('0x35')]=function(_0x1de8aa){return request(_0x079b('0x36'),{'body':{},'options':{'where':_0x1de8aa}});}; \ 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 13d7402..62e1b37 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 _0xd986=['./polly'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xd986,0x79));var _0x6d98=function(_0x3c3be0,_0xa95b94){_0x3c3be0=_0x3c3be0-0x0;var _0x96bb90=_0xd986[_0x3c3be0];return _0x96bb90;};var polly=require(_0x6d98('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd337=['./lex','exports','./polly'];(function(_0x3bb45b,_0x2dcc0b){var _0x513162=function(_0x46f44b){while(--_0x46f44b){_0x3bb45b['push'](_0x3bb45b['shift']());}};_0x513162(++_0x2dcc0b);}(_0xd337,0x16a));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};var polly=require(_0x7d33('0x0'));var lex=require(_0x7d33('0x1'));module[_0x7d33('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index ecba4ba..3588109 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c37=['./lib/api','exports'];(function(_0x507458,_0x1096bf){var _0x5f43ad=function(_0x36cfb1){while(--_0x36cfb1){_0x507458['push'](_0x507458['shift']());}};_0x5f43ad(++_0x1096bf);}(_0x5c37,0x11e));var _0x75c3=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x5c37[_0x28a5ad];return _0x176b8a;};'use strict';var lex=require(_0x75c3('0x0'));module[_0x75c3('0x1')]=function(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1){return lex(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1);}; \ No newline at end of file +var _0xb7fc=['./lib/api'];(function(_0x248e9c,_0x1e6747){var _0x1ede8e=function(_0x50aa5d){while(--_0x50aa5d){_0x248e9c['push'](_0x248e9c['shift']());}};_0x1ede8e(++_0x1e6747);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x45bd84,_0x4a61bb){_0x45bd84=_0x45bd84-0x0;var _0x551b62=_0xb7fc[_0x45bd84];return _0x551b62;};'use strict';var lex=require(_0xcb7f('0x0'));module['exports']=function(_0x52c9f2,_0x189517,_0x2f2354,_0x12656f,_0x495101,_0x4b3408){return lex(_0x52c9f2,_0x189517,_0x2f2354,_0x12656f,_0x495101,_0x4b3408);}; \ 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 2c1c985..cc4fa2a 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 _0x917d=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x917d,0x17f));var _0xd917=function(_0x30e303,_0x38b41d){_0x30e303=_0x30e303-0x0;var _0x9997fc=_0x917d[_0x30e303];return _0x9997fc;};'use strict';var BPromise=require(_0xd917('0x0'));var AWS=require('aws-sdk');function lexResult(_0x32daa7,_0x5ce260){return new BPromise(function(_0x3b32eb,_0x49b221){_0x32daa7[_0xd917('0x1')](_0x5ce260,function(_0x16e78b,_0x2f94ee){if(_0x16e78b){_0x49b221(_0x16e78b);}if(_0x2f94ee[_0xd917('0x2')]){for(const _0x3b6532 in _0x2f94ee[_0xd917('0x2')]){if(_0x2f94ee[_0xd917('0x2')][_0xd917('0x3')](_0x3b6532)){var _0x21db5c=_0x2f94ee[_0xd917('0x2')][_0x3b6532];_0x2f94ee[_0xd917('0x4')+_0x3b6532]=_0x21db5c;}}}_0x3b32eb(_0x2f94ee);});});}module[_0xd917('0x5')]=function(_0x48d521,_0x4a7ee4,_0x19ce55,_0x3b2aae,_0x11d71b,_0x5920f0){var _0x1d3ae6=new AWS[(_0xd917('0x6'))]({'accessKeyId':_0x4a7ee4,'secretAccessKey':_0x19ce55,'region':_0x3b2aae});var _0x57fae8={'botAlias':_0xd917('0x7'),'botName':_0x5920f0,'inputText':_0x11d71b,'userId':_0x48d521};return lexResult(_0x1d3ae6,_0x57fae8);}; \ No newline at end of file +var _0x9b0b=['slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','postText'];(function(_0x7532e2,_0x3bb229){var _0xa42ad1=function(_0x51cc7e){while(--_0x51cc7e){_0x7532e2['push'](_0x7532e2['shift']());}};_0xa42ad1(++_0x3bb229);}(_0x9b0b,0x10e));var _0xb9b0=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0x9b0b[_0x51ab83];return _0x14b6de;};'use strict';var BPromise=require(_0xb9b0('0x0'));var AWS=require('aws-sdk');function lexResult(_0x50995e,_0x2c9d10){return new BPromise(function(_0x5ced10,_0xfffe71){_0x50995e[_0xb9b0('0x1')](_0x2c9d10,function(_0x295dd1,_0x19a0eb){if(_0x295dd1){_0xfffe71(_0x295dd1);}if(_0x19a0eb[_0xb9b0('0x2')]){for(const _0x49f20a in _0x19a0eb[_0xb9b0('0x2')]){if(_0x19a0eb[_0xb9b0('0x2')][_0xb9b0('0x3')](_0x49f20a)){var _0x4cee4c=_0x19a0eb[_0xb9b0('0x2')][_0x49f20a];_0x19a0eb[_0xb9b0('0x4')+_0x49f20a]=_0x4cee4c;}}}_0x5ced10(_0x19a0eb);});});}module[_0xb9b0('0x5')]=function(_0x21ff79,_0x4fb2e2,_0x499dbb,_0x14cb66,_0x108607,_0x3d80b5){var _0xc38494=new AWS[(_0xb9b0('0x6'))]({'accessKeyId':_0x4fb2e2,'secretAccessKey':_0x499dbb,'region':_0x14cb66});var _0x8bdd13={'botAlias':_0xb9b0('0x7'),'botName':_0x3d80b5,'inputText':_0x108607,'userId':_0x21ff79};return lexResult(_0xc38494,_0x8bdd13);}; \ 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 1ed77c7..31340a8 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 _0xcc49=['exports','./lib/api'];(function(_0xe2587d,_0x18eb7c){var _0x2a922b=function(_0x1b1904){while(--_0x1b1904){_0xe2587d['push'](_0xe2587d['shift']());}};_0x2a922b(++_0x18eb7c);}(_0xcc49,0x83));var _0x9cc4=function(_0x37e343,_0x5dbfea){_0x37e343=_0x37e343-0x0;var _0xf688dc=_0xcc49[_0x37e343];return _0xf688dc;};'use strict';var polly=require(_0x9cc4('0x0'));module[_0x9cc4('0x1')]=function(_0x3d79ae,_0x3c0c4e,_0x18b725,_0x41b973,_0x5cd621,_0x3ad015,_0xc92c4b){return polly(_0x3d79ae,_0x3c0c4e,_0x18b725,_0x41b973,_0x5cd621,_0x3ad015,_0xc92c4b);}; \ No newline at end of file +var _0x64eb=['exports','./lib/api'];(function(_0x472a96,_0x2d81d9){var _0x25b5fa=function(_0xc699d2){while(--_0xc699d2){_0x472a96['push'](_0x472a96['shift']());}};_0x25b5fa(++_0x2d81d9);}(_0x64eb,0x17f));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var polly=require(_0xb64e('0x0'));module[_0xb64e('0x1')]=function(_0x596daf,_0x1e01b2,_0x4d862e,_0x2047ed,_0x2e3437,_0x27aeb0,_0x3becb1){return polly(_0x596daf,_0x1e01b2,_0x4d862e,_0x2047ed,_0x2e3437,_0x27aeb0,_0x3becb1);}; \ 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 ab36192..d33454b 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 _0x3714=['path','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x1e9e10,_0x1b254a){var _0x5ef3f4=function(_0x45912e){while(--_0x45912e){_0x1e9e10['push'](_0x1e9e10['shift']());}};_0x5ef3f4(++_0x1b254a);}(_0x3714,0x160));var _0x4371=function(_0x35c28c,_0x513e24){_0x35c28c=_0x35c28c-0x0;var _0x34ab7b=_0x3714[_0x35c28c];return _0x34ab7b;};'use strict';var fs=require('fs');var path=require(_0x4371('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0xa9a054,_0x59cbc6,_0x110d3c){return new BPromise(function(_0x3e444e,_0x5ae732){_0xa9a054[_0x4371('0x1')](_0x59cbc6,function(_0x3a12e1,_0x3f2622){if(_0x3a12e1){_0x5ae732(_0x3a12e1);}else if(_0x3f2622){if(_0x3f2622[_0x4371('0x2')]instanceof Buffer){fs[_0x4371('0x3')](_0x110d3c,_0x3f2622[_0x4371('0x2')],function(_0x815e4b){if(_0x815e4b){_0x5ae732(_0x815e4b);}else{_0x3e444e();}});}else{_0x5ae732(new Error(_0x4371('0x4')));}}else{_0x5ae732(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x4371('0x5')]=function(_0x282099,_0x39621a,_0xad2fa2,_0x339d14,_0x512ce7,_0x28cfc0,_0x2103de){var _0x2626d5=new AWS[(_0x4371('0x6'))]({'accessKeyId':_0x282099,'secretAccessKey':_0x39621a,'region':_0xad2fa2});var _0x1208cb={'Text':_0x512ce7,'TextType':_0x28cfc0||'text','OutputFormat':_0x4371('0x7'),'VoiceId':_0x339d14};return pollyResult(_0x2626d5,_0x1208cb,_0x2103de);}; \ No newline at end of file +var _0x5ec9=['No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5ec9,0xae));var _0x95ec=function(_0x273432,_0x36f797){_0x273432=_0x273432-0x0;var _0x2b9bd6=_0x5ec9[_0x273432];return _0x2b9bd6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x95ec('0x0'));var AWS=require(_0x95ec('0x1'));function pollyResult(_0x428932,_0x22e7f5,_0x344b5b){return new BPromise(function(_0x118a65,_0x54ddb9){_0x428932[_0x95ec('0x2')](_0x22e7f5,function(_0x3cdba2,_0xaeccb5){if(_0x3cdba2){_0x54ddb9(_0x3cdba2);}else if(_0xaeccb5){if(_0xaeccb5[_0x95ec('0x3')]instanceof Buffer){fs[_0x95ec('0x4')](_0x344b5b,_0xaeccb5[_0x95ec('0x3')],function(_0x36c02e){if(_0x36c02e){_0x54ddb9(_0x36c02e);}else{_0x118a65();}});}else{_0x54ddb9(new Error(_0x95ec('0x5')));}}else{_0x54ddb9(new Error(_0x95ec('0x6')));}});});}module['exports']=function(_0x203222,_0x33f370,_0x433220,_0x585e44,_0x1ad151,_0x3202a9,_0x4f6810){var _0x558605=new AWS[(_0x95ec('0x7'))]({'accessKeyId':_0x203222,'secretAccessKey':_0x33f370,'region':_0x433220});var _0x1a7143={'Text':_0x1ad151,'TextType':_0x3202a9||'text','OutputFormat':_0x95ec('0x8'),'VoiceId':_0x585e44};return pollyResult(_0x558605,_0x1a7143,_0x4f6810);}; \ 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 859f4c1..d8d9653 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x15b8=['exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x15b8,0xcd));var _0x815b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x15b8[_0x5f1391];return _0x50ebe3;};'use strict';var asr=require('./lib/api');module[_0x815b('0x0')]=function(_0x440706,_0x2bb0ae,_0x47829c,_0x13a73e){return asr(_0x440706,_0x2bb0ae,_0x47829c);}; \ No newline at end of file +var _0x3aee=['exports','./lib/api'];(function(_0x4e5e6c,_0x959eb4){var _0xcf9053=function(_0x3bce18){while(--_0x3bce18){_0x4e5e6c['push'](_0x4e5e6c['shift']());}};_0xcf9053(++_0x959eb4);}(_0x3aee,0x131));var _0xe3ae=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3aee[_0x11a220];return _0x20d8fe;};'use strict';var asr=require(_0xe3ae('0x0'));module[_0xe3ae('0x1')]=function(_0x5c6962,_0x20aa4e,_0x2d16b7,_0x328af4){return asr(_0x5c6962,_0x20aa4e,_0x2d16b7);}; \ 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 dba20dc..833051f 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 _0xd7c4=['base64','POST','LINEAR16','url','bluebird','exports','string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c4,0x116));var _0x4d7c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd7c4[_0x14add3];return _0x4a174f;};'use strict';var url=require(_0x4d7c('0x0'));var BPromise=require(_0x4d7c('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4d7c('0x2')]=function(_0x22aa80,_0x17b833,_0x163823){return new BPromise(function(_0x394ec9,_0x318690){var _0x5ea0b1;if(typeof _0x22aa80!==_0x4d7c('0x3')||_0x22aa80['length']===0x0){return _0x318690('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x17b833!==_0x4d7c('0x3')||_0x17b833['length']===0x0){return _0x318690(_0x4d7c('0x4'));}if(typeof _0x163823!==_0x4d7c('0x5')&&(typeof _0x163823!==_0x4d7c('0x3')||_0x163823[_0x4d7c('0x6')]===0x0)){return _0x318690(_0x4d7c('0x7'));}try{_0x5ea0b1=fs['readFileSync'](_0x22aa80)['toString'](_0x4d7c('0x8'));}catch(_0x5e11b6){return _0x318690(_0x5e11b6);}return _0x394ec9({'method':_0x4d7c('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x17b833,'body':{'config':{'encoding':_0x4d7c('0xa'),'sampleRateHertz':'8000','languageCode':_0x163823},'audio':{'content':_0x5ea0b1}},'json':!![]});});}; \ No newline at end of file +var _0xfc1b=['LINEAR16','8000','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc1b,0x98));var _0xbfc1=function(_0x7f153,_0x3e1c8b){_0x7f153=_0x7f153-0x0;var _0x5a2157=_0xfc1b[_0x7f153];return _0x5a2157;};'use strict';var url=require(_0xbfc1('0x0'));var BPromise=require(_0xbfc1('0x1'));var fs=require('fs');var host=_0xbfc1('0x2');module['exports']=function(_0x171f09,_0x2f6798,_0xbe9a1a){return new BPromise(function(_0x12bab3,_0x45e453){var _0x31f832;if(typeof _0x171f09!=='string'||_0x171f09['length']===0x0){return _0x45e453(_0xbfc1('0x3'));}if(typeof _0x2f6798!==_0xbfc1('0x4')||_0x2f6798[_0xbfc1('0x5')]===0x0){return _0x45e453(_0xbfc1('0x6'));}if(typeof _0xbe9a1a!==_0xbfc1('0x7')&&(typeof _0xbe9a1a!=='string'||_0xbe9a1a[_0xbfc1('0x5')]===0x0)){return _0x45e453(_0xbfc1('0x8'));}try{_0x31f832=fs[_0xbfc1('0x9')](_0x171f09)[_0xbfc1('0xa')]('base64');}catch(_0x1659b2){return _0x45e453(_0x1659b2);}return _0x12bab3({'method':_0xbfc1('0xb'),'uri':host+_0xbfc1('0xc')+_0x2f6798,'body':{'config':{'encoding':_0xbfc1('0xd'),'sampleRateHertz':_0xbfc1('0xe'),'languageCode':_0xbe9a1a},'audio':{'content':_0x31f832}},'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 7cce56f..aaf0913 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 _0xedd9=['exports'];(function(_0x317a82,_0x124141){var _0x5a6b0a=function(_0x3a07dc){while(--_0x3a07dc){_0x317a82['push'](_0x317a82['shift']());}};_0x5a6b0a(++_0x124141);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a24c1,_0x3ed2ce){_0x1a24c1=_0x1a24c1-0x0;var _0xb355f3=_0xedd9[_0x1a24c1];return _0xb355f3;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0xeb80e,_0x337608){var _0x68e9d7=function(_0x50c896){while(--_0x50c896){_0xeb80e['push'](_0xeb80e['shift']());}};_0x68e9d7(++_0x337608);}(_0x34e8,0x12c));var _0x834e=function(_0x48bb77,_0x2a893c){_0x48bb77=_0x48bb77-0x0;var _0x3725f1=_0x34e8[_0x48bb77];return _0x3725f1;};var asr=require(_0x834e('0x0'));module[_0x834e('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 59803ec..4c07994 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 _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x86e9b8,_0x26b710){var _0x129fb4=function(_0x324d29){while(--_0x324d29){_0x86e9b8['push'](_0x86e9b8['shift']());}};_0x129fb4(++_0x26b710);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x3142c3,_0x328abe){var _0x1a548d=function(_0x486f28){while(--_0x486f28){_0x3142c3['push'](_0x3142c3['shift']());}};_0x1a548d(++_0x328abe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 789214e..34107f6 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 _0xfbaf=['exports','./nda'];(function(_0x15ed84,_0x589521){var _0x426d2b=function(_0x5d294a){while(--_0x5d294a){_0x15ed84['push'](_0x15ed84['shift']());}};_0x426d2b(++_0x589521);}(_0xfbaf,0xcb));var _0xffba=function(_0x3412a9,_0x1ff7fe){_0x3412a9=_0x3412a9-0x0;var _0x2633fa=_0xfbaf[_0x3412a9];return _0x2633fa;};var nda=require(_0xffba('0x0'));module[_0xffba('0x1')]={'nda':nda}; \ No newline at end of file +var _0x760c=['./nda','exports'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x760c,0x194));var _0xc760=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x760c[_0x122ef9];return _0x42fba0;};var nda=require(_0xc760('0x0'));module[_0xc760('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 9b465b4..3963d9a 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 _0x0155=['calleridname','extension','text','access_token','project','ProjectName','ndagenerate_audio','channelData','audio/wav','custom_action','body','CustomAction','custom_action_data','info','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x5cc3ba,_0x1eac8f){var _0x1c541f=function(_0x4f35e1){while(--_0x4f35e1){_0x5cc3ba['push'](_0x5cc3ba['shift']());}};_0x1c541f(++_0x1eac8f);}(_0x0155,0x182));var _0x5015=function(_0x22e455,_0x1ec884){_0x22e455=_0x22e455-0x0;var _0x139ff6=_0x0155[_0x22e455];return _0x139ff6;};'use strict';var rp=require('request-promise');var url=require(_0x5015('0x0'));var logger=require(_0x5015('0x1'))(_0x5015('0x2'));module[_0x5015('0x3')]=function(_0x4a5c40,_0x31baae){var _0x4e279f={'method':'POST','uri':url[_0x5015('0x4')](_0x31baae[_0x5015('0x5')],'/token'),'form':{'grant_type':_0x5015('0x6'),'username':_0x31baae[_0x5015('0x7')],'password':_0x31baae['password']},'json':!![]};return rp(_0x4e279f)[_0x5015('0x8')](function(_0x573261){var _0x1acba6={'method':_0x5015('0x9'),'uri':url['resolve'](_0x31baae[_0x5015('0xa')],_0x5015('0xb')),'body':{'type':_0x31baae[_0x5015('0xc')]||_0x5015('0xd'),'channelId':_0x5015('0xe'),'conversation':{'id':_0x4a5c40[_0x5015('0xf')]},'from':{'id':_0x4a5c40[_0x5015('0x10')],'name':_0x4a5c40[_0x5015('0x11')]},'recipient':{'id':_0x4a5c40['dnid'],'name':_0x4a5c40[_0x5015('0x12')]},'text':_0x31baae[_0x5015('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x573261[_0x5015('0x14')]},'json':!![]};if(_0x31baae[_0x5015('0x15')]){_0x1acba6['body']['channelData'][_0x5015('0x16')]=_0x31baae[_0x5015('0x15')];}if(_0x31baae[_0x5015('0x17')]=='1'){_0x1acba6['body'][_0x5015('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5015('0x19')};}if(_0x31baae[_0x5015('0x1a')]){_0x1acba6[_0x5015('0x1b')][_0x5015('0x18')][_0x5015('0x1c')]=_0x31baae[_0x5015('0x1a')];if(_0x31baae[_0x5015('0x1d')]){_0x1acba6[_0x5015('0x1b')][_0x5015('0x18')]['CustomActionData']=_0x31baae[_0x5015('0x1d')];}}logger[_0x5015('0x1e')](JSON['stringify'](_0x1acba6));return rp(_0x1acba6);});}; \ No newline at end of file +var _0x0f17=['request-promise','url','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify'];(function(_0x415ada,_0x2b7172){var _0x1bf0c7=function(_0x235627){while(--_0x235627){_0x415ada['push'](_0x415ada['shift']());}};_0x1bf0c7(++_0x2b7172);}(_0x0f17,0xe8));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x70f1('0x0'));var url=require(_0x70f1('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x70f1('0x2')]=function(_0x490c19,_0x2b3596){var _0x3f4486={'method':_0x70f1('0x3'),'uri':url[_0x70f1('0x4')](_0x2b3596[_0x70f1('0x5')],_0x70f1('0x6')),'form':{'grant_type':_0x70f1('0x7'),'username':_0x2b3596[_0x70f1('0x8')],'password':_0x2b3596[_0x70f1('0x7')]},'json':!![]};return rp(_0x3f4486)[_0x70f1('0x9')](function(_0x2f7c45){var _0x1c4834={'method':'POST','uri':url[_0x70f1('0x4')](_0x2b3596['ndassistant_url'],_0x70f1('0xa')),'body':{'type':_0x2b3596[_0x70f1('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x490c19[_0x70f1('0xc')]},'from':{'id':_0x490c19['callerid'],'name':_0x490c19[_0x70f1('0xd')]},'recipient':{'id':_0x490c19[_0x70f1('0xe')],'name':_0x490c19[_0x70f1('0xf')]},'text':_0x2b3596[_0x70f1('0x10')],'channelData':{}},'headers':{'Authorization':_0x70f1('0x11')+_0x2f7c45[_0x70f1('0x12')]},'json':!![]};if(_0x2b3596['project']){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')]['ProjectName']=_0x2b3596[_0x70f1('0x15')];}if(_0x2b3596[_0x70f1('0x16')]=='1'){_0x1c4834['body'][_0x70f1('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2b3596[_0x70f1('0x17')]){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')][_0x70f1('0x18')]=_0x2b3596[_0x70f1('0x17')];if(_0x2b3596['custom_action_data']){_0x1c4834[_0x70f1('0x13')][_0x70f1('0x14')][_0x70f1('0x19')]=_0x2b3596[_0x70f1('0x1a')];}}logger[_0x70f1('0x1b')](JSON[_0x70f1('0x1c')](_0x1c4834));return rp(_0x1c4834);});}; \ 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 2377c81..1325b57 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 _0xd9cf=['./lib/api'];(function(_0x3753bd,_0x5dc267){var _0x157872=function(_0x20fccd){while(--_0x20fccd){_0x3753bd['push'](_0x3753bd['shift']());}};_0x157872(++_0x5dc267);}(_0xd9cf,0xf8));var _0xfd9c=function(_0x11bb2e,_0x5b27ee){_0x11bb2e=_0x11bb2e-0x0;var _0x2bf0f4=_0xd9cf[_0x11bb2e];return _0x2bf0f4;};'use strict';var asr=require(_0xfd9c('0x0'));module['exports']=function(_0x3f4859,_0x541bad,_0x46d85e,_0x5e42f8){return asr(_0x3f4859,_0x541bad,_0x46d85e,_0x5e42f8);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x265a6d,_0x54aeac,_0x347560,_0xbd0b09){return asr(_0x265a6d,_0x54aeac,_0x347560,_0xbd0b09);}; \ 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 b6f8aa3..b7e0f29 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 _0x756f=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x756f,0x88));var _0xf756=function(_0x5674e9,_0x431b61){_0x5674e9=_0x5674e9-0x0;var _0x137491=_0x756f[_0x5674e9];return _0x137491;};'use strict';var BPromise=require(_0xf756('0x0'));var _=require(_0xf756('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xf756('0x2'))(_0xf756('0x3'));module[_0xf756('0x4')]=function(_0x11686f,_0x2e2479,_0x13ebf2,_0x40acad){return new BPromise(function(_0x270311,_0x2fc9ff){logger[_0xf756('0x5')](_0xf756('0x6'),_0x40acad||_0xf756('0x7'));var _0x256813=new WebSocket(_0x40acad||_0xf756('0x7'),{'perMessageDeflate':![]});var _0x1b6c05='';var _0x598864='0';var _0xfff1fd='1';var _0x4300fa=_0xf756('0x8');function _0x5e503c(_0x3d7ab9){var _0x26acfd=crypto[_0xf756('0x9')](_0xf756('0xa'));_0x26acfd[_0xf756('0xb')](_0x3d7ab9);return _0x26acfd[_0xf756('0xc')](_0xf756('0xd'));}function _0x1cf2dc(){try{logger['info'](_0xf756('0xe'));var _0x1906d2=moment()[_0xf756('0xf')]();var _0x2545c2=_0x5e503c(_0x1906d2+_0x2e2479+_0x13ebf2);_0x256813[_0xf756('0x10')](JSON[_0xf756('0x11')]({'appID':_0x2e2479,'timestamp':_0x1906d2,'appKey':_0x2545c2}));var _0x44f14e=fs[_0xf756('0x12')](_0x11686f);_0x44f14e['on'](_0xf756('0x13'),function(_0x1f83b2){_0x256813[_0xf756('0x10')](_0x1f83b2);});_0x44f14e['on'](_0xf756('0x14'),function(){_0x256813[_0xf756('0x10')](_0xf756('0x15'));});}catch(_0x33d5c5){logger[_0xf756('0x16')](_0xf756('0x17'),JSON[_0xf756('0x11')](_0x33d5c5));_0x256813['terminate']();}}function _0x52b26b(_0x59f3ae){try{if(_0x59f3ae){var _0xf91540=JSON[_0xf756('0x18')](_0x59f3ae);switch(_0xf91540[_0xf756('0x19')]){case 0x0:if(_0xf91540[_0xf756('0x1a')]){if(_0xf91540[_0xf756('0x1a')][_0xf756('0x1b')]){logger['info'](_0xf756('0x1c'),JSON[_0xf756('0x11')](_0xf91540[_0xf756('0x1a')][_0xf756('0x1d')]));_0x1b6c05=_0xf91540[_0xf756('0x1a')][_0xf756('0x1d')][0x0][_0xf756('0x1e')];_0x598864=_0xf91540['result'][_0xf756('0x1d')][0x0][_0xf756('0x1f')];_0xfff1fd='0';_0x4300fa=_0xf756('0x20');_0x256813['terminate']();}}break;case 0x1:logger[_0xf756('0x5')](_0xf756('0x8'));_0xfff1fd='1';_0x4300fa=_0xf756('0x8');break;case 0x2:logger[_0xf756('0x5')](_0xf756('0x21'));_0xfff1fd='2';_0x4300fa=_0xf756('0x21');break;case 0x9:logger[_0xf756('0x5')](_0xf756('0x22'));_0xfff1fd='9';_0x4300fa=_0xf756('0x22');break;case 0xa:logger[_0xf756('0x5')](_0xf756('0x23'));_0xfff1fd='10';_0x4300fa=_0xf756('0x23');break;case 0xb:logger[_0xf756('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xfff1fd='11';_0x4300fa=_0xf756('0x24');}}}catch(_0x28be9f){logger['error'](_0xf756('0x25'),JSON[_0xf756('0x11')](_0x28be9f));_0x256813['terminate']();}}function _0x15e34c(){logger[_0xf756('0x5')](_0xf756('0x26'));_0x270311({'transcript':_0x1b6c05,'confidence':_0x598864,'status':_0xfff1fd,'status_message':_0x4300fa});}function _0xf0d7d9(_0x28e8de){logger[_0xf756('0x16')](_0xf756('0x27'));if(!_[_0xf756('0x28')](_0x28e8de)){logger['error'](_[_0xf756('0x29')](_0x28e8de)?JSON['stringify'](_0x28e8de):_0x28e8de);}}_0x256813['on'](_0xf756('0x2a'),_0x1cf2dc);_0x256813['on']('message',_0x52b26b);_0x256813['on'](_0xf756('0x14'),_0x15e34c);_0x256813['on'](_0xf756('0x16'),_0xf0d7d9);});}; \ No newline at end of file +var _0x078c=['digest','hex','info','unix','send','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','message','bluebird','lodash','moment','crypto','agi','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'];(function(_0x7f36e0,_0x1a5ca5){var _0x3e1ce2=function(_0x46b485){while(--_0x46b485){_0x7f36e0['push'](_0x7f36e0['shift']());}};_0x3e1ce2(++_0x1a5ca5);}(_0x078c,0x171));var _0xc078=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x078c[_0x96f74c];return _0x379222;};'use strict';var BPromise=require(_0xc078('0x0'));var _=require(_0xc078('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc078('0x2'));var crypto=require(_0xc078('0x3'));var logger=require('../../../../../../config/logger')(_0xc078('0x4'));module['exports']=function(_0x1e2b39,_0x3e8dca,_0x4af830,_0x254fa2){return new BPromise(function(_0x440112,_0x10328a){logger['info'](_0xc078('0x5'),_0x254fa2||_0xc078('0x6'));var _0x54c87e=new WebSocket(_0x254fa2||_0xc078('0x6'),{'perMessageDeflate':![]});var _0x573f45='';var _0x600550='0';var _0x2c7204='1';var _0x34cb75=_0xc078('0x7');function _0x38e09d(_0x433c48){var _0x1fe49c=crypto[_0xc078('0x8')](_0xc078('0x9'));_0x1fe49c[_0xc078('0xa')](_0x433c48);return _0x1fe49c[_0xc078('0xb')](_0xc078('0xc'));}function _0x241192(){try{logger[_0xc078('0xd')]('Open\x20Tilde\x20ASR\x20socket');var _0x2b8af8=moment()[_0xc078('0xe')]();var _0x58b50f=_0x38e09d(_0x2b8af8+_0x3e8dca+_0x4af830);_0x54c87e[_0xc078('0xf')](JSON['stringify']({'appID':_0x3e8dca,'timestamp':_0x2b8af8,'appKey':_0x58b50f}));var _0x1a4c47=fs[_0xc078('0x10')](_0x1e2b39);_0x1a4c47['on'](_0xc078('0x11'),function(_0x520e3d){_0x54c87e[_0xc078('0xf')](_0x520e3d);});_0x1a4c47['on'](_0xc078('0x12'),function(){_0x54c87e[_0xc078('0xf')]('EOS');});}catch(_0x2b17e3){logger['error'](_0xc078('0x13'),JSON[_0xc078('0x14')](_0x2b17e3));_0x54c87e[_0xc078('0x15')]();}}function _0x31d20b(_0x1ce477){try{if(_0x1ce477){var _0x60420d=JSON[_0xc078('0x16')](_0x1ce477);switch(_0x60420d[_0xc078('0x17')]){case 0x0:if(_0x60420d[_0xc078('0x18')]){if(_0x60420d[_0xc078('0x18')][_0xc078('0x19')]){logger[_0xc078('0xd')](_0xc078('0x1a'),JSON[_0xc078('0x14')](_0x60420d[_0xc078('0x18')]['hypotheses']));_0x573f45=_0x60420d[_0xc078('0x18')][_0xc078('0x1b')][0x0][_0xc078('0x1c')];_0x600550=_0x60420d[_0xc078('0x18')][_0xc078('0x1b')][0x0]['likelihood'];_0x2c7204='0';_0x34cb75=_0xc078('0x1d');_0x54c87e[_0xc078('0x15')]();}}break;case 0x1:logger[_0xc078('0xd')](_0xc078('0x7'));_0x2c7204='1';_0x34cb75=_0xc078('0x7');break;case 0x2:logger[_0xc078('0xd')](_0xc078('0x1e'));_0x2c7204='2';_0x34cb75=_0xc078('0x1e');break;case 0x9:logger[_0xc078('0xd')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2c7204='9';_0x34cb75=_0xc078('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2c7204='10';_0x34cb75=_0xc078('0x20');break;case 0xb:logger[_0xc078('0xd')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2c7204='11';_0x34cb75='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x45b644){logger[_0xc078('0x21')](_0xc078('0x22'),JSON[_0xc078('0x14')](_0x45b644));_0x54c87e[_0xc078('0x15')]();}}function _0x1504d2(){logger[_0xc078('0xd')](_0xc078('0x23'));_0x440112({'transcript':_0x573f45,'confidence':_0x600550,'status':_0x2c7204,'status_message':_0x34cb75});}function _0xe9c3e3(_0x26ff6d){logger[_0xc078('0x21')](_0xc078('0x24'));if(!_['isNil'](_0x26ff6d)){logger[_0xc078('0x21')](_['isObject'](_0x26ff6d)?JSON[_0xc078('0x14')](_0x26ff6d):_0x26ff6d);}}_0x54c87e['on']('open',_0x241192);_0x54c87e['on'](_0xc078('0x25'),_0x31d20b);_0x54c87e['on']('close',_0x1504d2);_0x54c87e['on'](_0xc078('0x21'),_0xe9c3e3);});}; \ 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 13b076d..3e4febd 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 _0x34e8=['./asr','exports'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x34e8,0x12c));var _0x834e=function(_0x12ae53,_0x1a9bc1){_0x12ae53=_0x12ae53-0x0;var _0x169b0e=_0x34e8[_0x12ae53];return _0x169b0e;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x008c=['./asr','exports'];(function(_0x55b8ec,_0x11b8ed){var _0x1f3940=function(_0x3498fd){while(--_0x3498fd){_0x55b8ec['push'](_0x55b8ec['shift']());}};_0x1f3940(++_0x11b8ed);}(_0x008c,0x188));var _0xc008=function(_0x304471,_0x361864){_0x304471=_0x304471-0x0;var _0x2b6563=_0x008c[_0x304471];return _0x2b6563;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e0aa519..d353078 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 _0x7cc4=['code','close','nextTick','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','error','destroy','ready','E_AGI_SERVER_ERROR'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cc4,0x1a8));var _0x47cc=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x7cc4[_0xaf25ae];return _0x49732d;};'use strict';var util=require('util');var net=require(_0x47cc('0x0'));var EventEmitter=require(_0x47cc('0x1'))[_0x47cc('0x2')];var AGIError=require(_0x47cc('0x3'));var AGIChannel=require(_0x47cc('0x4'));var AGIServer=function(_0x138e40,_0x167543,_0x515da9){var _0x364ac6=this,_0x138e40=_0x138e40||0x11dd,_0x167543=_0x167543||_0x47cc('0x5'),_0x347672=null,_0x4aab27=0x0;EventEmitter[_0x47cc('0x6')](_0x364ac6);function _0x21f13e(){if(!_0x138e40){_0x364ac6[_0x47cc('0x7')]('error',new AGIError(_0x47cc('0x8')));return![];}_0x347672=net[_0x47cc('0x9')]();_0x347672['listen'](_0x138e40,_0x167543);_0x347672['on'](_0x47cc('0xa'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xa'));});_0x347672['on'](_0x47cc('0xb'),function(_0x221818){_0x347672[_0x47cc('0xc')](function(_0x933cea,_0x2ea168){if(_0x933cea){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x933cea));}else if(_0x515da9&&_0x515da9<0x0){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x221818['destroy']();}else if(_0x515da9&&_0x515da9>0x0&&_0x515da9<_0x2ea168){_0x4aab27+=0x1;_0x364ac6['emit'](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4aab27));_0x221818[_0x47cc('0xe')]();}else{var _0x4d2229=new AGIChannel(_0x221818);_0x4d2229['on'](_0x47cc('0xf'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xb'),_0x4d2229);});}});});_0x347672['on']('error',function(_0x672603){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError(_0x47cc('0x10'),_0x672603[_0x47cc('0x11')]));});_0x347672['on'](_0x47cc('0x12'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x47cc('0x13')](function(){_0x21f13e();});};util['inherits'](AGIServer,EventEmitter);module[_0x47cc('0x14')]=function(_0x56880a,_0x3f37ac,_0x1d81da){return new AGIServer(_0x56880a,_0x3f37ac,_0x1d81da);}; \ No newline at end of file +var _0x586b=['ready','code','close','nextTick','inherits','exports','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0x17a50b,_0x14fdd8){var _0xb4b92d=function(_0x3e177e){while(--_0x3e177e){_0x17a50b['push'](_0x17a50b['shift']());}};_0xb4b92d(++_0x14fdd8);}(_0x586b,0x1bb));var _0xb586=function(_0x8deda,_0x2a6fc6){_0x8deda=_0x8deda-0x0;var _0x2e98db=_0x586b[_0x8deda];return _0x2e98db;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0xb586('0x0'))[_0xb586('0x1')];var AGIError=require(_0xb586('0x2'));var AGIChannel=require(_0xb586('0x3'));var AGIServer=function(_0x23f7c8,_0x2f277f,_0xea2263){var _0x16579d=this,_0x23f7c8=_0x23f7c8||0x11dd,_0x2f277f=_0x2f277f||_0xb586('0x4'),_0x2c242b=null,_0x3cf312=0x0;EventEmitter[_0xb586('0x5')](_0x16579d);function _0x37b9a5(){if(!_0x23f7c8){_0x16579d[_0xb586('0x6')]('error',new AGIError(_0xb586('0x7')));return![];}_0x2c242b=net[_0xb586('0x8')]();_0x2c242b[_0xb586('0x9')](_0x23f7c8,_0x2f277f);_0x2c242b['on'](_0xb586('0xa'),function(){_0x16579d[_0xb586('0x6')](_0xb586('0xa'));});_0x2c242b['on'](_0xb586('0xb'),function(_0x167551){_0x2c242b['getConnections'](function(_0x34dba2,_0x4c2967){if(_0x34dba2){_0x16579d[_0xb586('0x6')](_0xb586('0xc'),new AGIError(_0xb586('0xd'),_0x34dba2));}else if(_0xea2263&&_0xea2263<0x0){_0x16579d['emit'](_0xb586('0xc'),new AGIError(_0xb586('0xe')));_0x167551[_0xb586('0xf')]();}else if(_0xea2263&&_0xea2263>0x0&&_0xea2263<_0x4c2967){_0x3cf312+=0x1;_0x16579d[_0xb586('0x6')]('error',new AGIError(_0xb586('0x10'),_0x3cf312));_0x167551['destroy']();}else{var _0x20c90a=new AGIChannel(_0x167551);_0x20c90a['on'](_0xb586('0x11'),function(){_0x16579d[_0xb586('0x6')](_0xb586('0xb'),_0x20c90a);});}});});_0x2c242b['on'](_0xb586('0xc'),function(_0xb6dd9){_0x16579d[_0xb586('0x6')](_0xb586('0xc'),new AGIError(_0xb586('0xd'),_0xb6dd9[_0xb586('0x12')]));});_0x2c242b['on']('close',function(){_0x16579d[_0xb586('0x6')](_0xb586('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xb586('0x14')](function(){_0x37b9a5();});};util[_0xb586('0x15')](AGIServer,EventEmitter);module[_0xb586('0x16')]=function(_0x2dfbea,_0x225173,_0x4e004f){return new AGIServer(_0x2dfbea,_0x225173,_0x4e004f);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e0c413e..d5df18b 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 _0x0dd6=['no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','no\x20text\x20configured','bot','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','.wav','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','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','isArray','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','recordingFormat','%s_%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','email','Smtp','bcc','subject','service','host','port','secure','authentication','pass','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','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','hasOwnProperty','isString','replaceAllVariables','length','split','replaceAll','extra','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','options','sestektts','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x0dd6,0xca));var _0x60dd=function(_0x1742df,_0x4b17a7){_0x1742df=_0x1742df-0x0;var _0x39c917=_0x0dd6[_0x1742df];return _0x39c917;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x60dd('0x0'));var sh=require(_0x60dd('0x1'));var odbc=require(_0x60dd('0x2'))();var rs=require(_0x60dd('0x3'));var moment=require(_0x60dd('0x4'));var Mustache=require(_0x60dd('0x5'));var logger=require(_0x60dd('0x6'))(_0x60dd('0x7'));var config=require(_0x60dd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x60dd('0x9');var verticesWithRetry=['menu',_0x60dd('0xa'),'getsecretdigits'];var AGIVertices=function(_0x30543f,_0x407a6c,_0x371079){this[_0x60dd('0xb')]=_0x30543f;this[_0x60dd('0xc')]=_0x407a6c;this[_0x60dd('0xd')]=_0x371079;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xf')]=function(_0x57eccd,_0x194991){this[_0x60dd('0xc')][_0x60dd('0x10')](_0x57eccd)[_0x60dd('0x11')](function(_0x26cc4a){_0x194991(null,_0x26cc4a?_0x26cc4a[_0x60dd('0x12')]:![]);})['catch'](function(_0x42cd27){_0x194991(_0x42cd27);});};AGIVertices[_0x60dd('0xe')]['getVoiceQueue']=function(_0xa8ecbf,_0x2925a0){this['rpc'][_0x60dd('0x13')](_0xa8ecbf)[_0x60dd('0x11')](function(_0x4ac100){_0x2925a0(null,_0x4ac100?_0x4ac100[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x1d41fb){_0x2925a0(_0x1d41fb);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x15')]=function(_0x5576b1,_0x1822e9){this[_0x60dd('0xc')][_0x60dd('0x16')](_0x5576b1)[_0x60dd('0x11')](function(_0x5a236f){_0x1822e9(null,_0x5a236f?_0x5a236f['name']:![]);})[_0x60dd('0x14')](function(_0x291845){_0x1822e9(_0x291845);});};AGIVertices[_0x60dd('0xe')]['getSquareOdbc']=function(_0x1a7b67,_0x417ba8){this['rpc'][_0x60dd('0x17')](_0x1a7b67)[_0x60dd('0x11')](function(_0x22c520){_0x417ba8(null,_0x22c520?_0x22c520[_0x60dd('0x18')]:![]);})[_0x60dd('0x14')](function(_0x31f49e){_0x417ba8(_0x31f49e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x19')]=function(_0x42e2c6,_0xb8118c){this['rpc'][_0x60dd('0x1a')](_0x42e2c6)[_0x60dd('0x11')](function(_0x41933a){_0xb8118c(null,_0x41933a?_0x41933a[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x5cee8e){_0xb8118c(_0x5cee8e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x1b')]=function(_0xd99117,_0x13356b){this[_0x60dd('0xc')][_0x60dd('0x1c')](_0xd99117)[_0x60dd('0x11')](function(_0x521284){_0x13356b(null,_0x521284?_0x521284[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x326c50){_0x13356b(_0x326c50);});};AGIVertices['prototype'][_0x60dd('0x1d')]=function(_0x41a4cd,_0x22dbcc){var _0xad92b8=this;this[_0x60dd('0xc')][_0x60dd('0x1e')](_0x41a4cd)[_0x60dd('0x11')](function(_0x2ce1b9){_0x22dbcc(null,_0x2ce1b9?_0xad92b8['getSoundPath'](_0x2ce1b9[_0x60dd('0x1f')]):![]);})[_0x60dd('0x14')](function(_0x3cc6d5){_0x22dbcc(_0x3cc6d5);});};AGIVertices['prototype'][_0x60dd('0x20')]=function(_0x2c691a,_0x5a4b46){this['rpc'][_0x60dd('0x21')](_0x2c691a)[_0x60dd('0x11')](function(_0x23bc5d){_0x5a4b46(null,_0x23bc5d?_0x23bc5d:![]);})[_0x60dd('0x14')](function(_0x22a49e){_0x5a4b46(_0x22a49e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x22')]=function(_0x45c2bc,_0x514325,_0x52e3d0){this['mailRpc']['sendMailMessage'](_0x45c2bc,_0x514325)[_0x60dd('0x11')](function(){_0x52e3d0(null);})[_0x60dd('0x14')](function(_0x11c518){_0x52e3d0(_0x11c518);});};AGIVertices[_0x60dd('0xe')]['getIntervals']=function(_0x196335,_0x1e588d){this['rpc']['getIntervalById'](_0x196335)[_0x60dd('0x11')](function(_0x4c0d31){if(_0x4c0d31){if(_0x4c0d31['IntervalId']){_0x1e588d(null,[_0x4c0d31[_0x60dd('0x23')]]);}else{_0x1e588d(null,_['map'](_0x4c0d31[_0x60dd('0x24')],_0x60dd('0x23')));}}else{_0x1e588d(null,![]);}})[_0x60dd('0x14')](function(_0x462242){_0x1e588d(_0x462242);});};AGIVertices['prototype'][_0x60dd('0x25')]=function(_0x5004ea){return util[_0x60dd('0x26')](_0x60dd('0x27'),FILES_PATH,_0x5004ea);};AGIVertices[_0x60dd('0xe')]['getQueryOdbc']=function(_0x572b54,_0x3e9920,_0x21d4b7){odbc['open'](_0x572b54,function(_0x3142ab){if(_0x3142ab){logger[_0x60dd('0x28')](_0x60dd('0x29'),_0x3142ab);_0x21d4b7(_0x3142ab);}else{logger[_0x60dd('0x2a')](_0x60dd('0x2b'));odbc[_0x60dd('0x2c')](_0x3e9920,function(_0x401276,_0x5efc44){if(_0x401276){logger['info'](_0x60dd('0x2d'),_0x3e9920);_0x21d4b7(_0x401276);}else{logger['info'](_0x60dd('0x2e'),_0x3e9920);odbc[_0x60dd('0x2f')](function(_0x4d653e){if(_0x4d653e){logger['error'](_0x60dd('0x30'),_0x4d653e);}_0x21d4b7(null,_0x5efc44);});}});}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x31')]=function(_0xd209e6,_0x3e6b5c){this[_0x60dd('0xc')][_0x60dd('0x32')](_0xd209e6)[_0x60dd('0x11')](function(_0x43795d){_0x3e6b5c(null,_0x43795d?_0x43795d:![]);})[_0x60dd('0x14')](function(_0xc0f02d){_0x3e6b5c(_0xc0f02d);});};AGIVertices['prototype']['createSmsMessage']=function(_0x23cf0c,_0x22a69b){this[_0x60dd('0xc')][_0x60dd('0x33')](_0x23cf0c)[_0x60dd('0x11')](function(_0x35de0d){_0x22a69b(null,_0x35de0d);})[_0x60dd('0x14')](function(_0x41feb0){_0x22a69b(_0x41feb0);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x34')]=function(_0x3b230a,_0x5428dc,_0x258b28){this[_0x60dd('0xc')][_0x60dd('0x34')]({'uniqueid':this[_0x60dd('0xb')]['uniqueid'],'node':_0x3b230a[_0x60dd('0x35')],'application':_0x3b230a[_0x60dd('0x36')],'data':_0x5428dc||null,'project_name':this[_0x60dd('0xb')][_0x60dd('0x37')],'callerid':this[_0x60dd('0xb')][_0x60dd('0x38')]})[_0x60dd('0x11')](function(_0x297ae0){if(_0x258b28){_0x258b28(null,_0x297ae0);}})[_0x60dd('0x14')](function(_0x32052e){if(_0x258b28){_0x258b28(_0x32052e);}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x39')]=function(_0xa9e153,_0x35ff9a,_0x3b1732,_0x1d808b){this[_0x60dd('0xc')][_0x60dd('0x39')]({'uniqueid':this[_0x60dd('0xb')][_0x60dd('0x3a')],'callerid':this[_0x60dd('0xb')][_0x60dd('0x38')],'calleridname':this[_0x60dd('0xb')][_0x60dd('0x3b')],'context':this[_0x60dd('0xb')][_0x60dd('0x3c')],'extension':this[_0x60dd('0xb')][_0x60dd('0x3d')],'priority':this[_0x60dd('0xb')][_0x60dd('0x3e')],'accountcode':this[_0x60dd('0xb')]['accountcode'],'dnid':this[_0x60dd('0xb')]['dnid'],'projectName':this[_0x60dd('0xb')][_0x60dd('0x37')],'saveName':_0x35ff9a,'filename':_0xa9e153['file']||_0x35ff9a,'savePath':_0x3b1732})[_0x60dd('0x11')](function(_0x46e4ce){_0x1d808b(null,_0x46e4ce);})[_0x60dd('0x14')](function(_0x11c1de){_0x1d808b(_0x11c1de);});};AGIVertices['prototype'][_0x60dd('0x3f')]=function(_0x2556e3,_0x54a122,_0x11b62e){this[_0x60dd('0xc')][_0x60dd('0x3f')]({'uniqueid':this[_0x60dd('0xb')]['uniqueid'],'body':_0x2556e3,'direction':_0x54a122})[_0x60dd('0x11')](function(_0x5d4e01){if(_0x11b62e){_0x11b62e(null,_0x5d4e01);}})[_0x60dd('0x14')](function(_0x50a5e6){if(_0x11b62e){_0x11b62e(_0x50a5e6);}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x40')]=function(_0x142855,_0x3add9a){this['rpc']['createCmContact']({'firstName':_[_0x60dd('0x41')](_0x142855[_0x60dd('0x12')])||_[_0x60dd('0x42')](_0x142855[_0x60dd('0x12')])?_0x60dd('0x43')+Math['random']():_0x142855[_0x60dd('0x12')],'lastName':_[_0x60dd('0x41')](_0x142855['lastName'])||_[_0x60dd('0x42')](_0x142855['lastName'])?null:_0x142855[_0x60dd('0x44')],'phone':_0x142855[_0x60dd('0x45')],'ListId':_0x142855[_0x60dd('0x46')],'scheduledAt':_0x142855[_0x60dd('0x47')],'callbackUniqueid':this[_0x60dd('0xb')][_0x60dd('0x3a')],'tags':'callback','description':_0x60dd('0x48')+_0x142855[_0x60dd('0x47')][_0x60dd('0x49')](),'priority':_0x142855['callback_priority']})[_0x60dd('0x11')](function(_0x3e3c0e){_0x3add9a(null,_0x3e3c0e);})['catch'](function(_0x4b6449){_0x3add9a(_0x4b6449);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4a')]=function(_0x5aceb4,_0x366c51){this[_0x60dd('0xc')][_0x60dd('0x4b')](_0x5aceb4)[_0x60dd('0x11')](function(_0x5b40af){_0x366c51(null,_0x5b40af?_0x5b40af[_0x60dd('0x12')]:![]);})['catch'](function(_0x41e98c){_0x366c51(_0x41e98c);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4c')]=function(_0x1fc454,_0x3e80ea,_0x43c1a8){var _0x30cc32={'role':_0x60dd('0x4d')};_0x30cc32[_0x1fc454]=this[_0x60dd('0xb')][_0x60dd('0x38')];this[_0x60dd('0xc')][_0x60dd('0x4c')](_0x30cc32,_0x3e80ea,this['channel'][_0x60dd('0x3a')])[_0x60dd('0x11')](function(_0x131dfc){_0x43c1a8(null,_[_0x60dd('0x42')](_0x131dfc)?![]:!![]);})['catch'](function(_0x4bdf94){logger['error'](_0x4bdf94);_0x43c1a8(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4e')]=function(_0x2ad1b8,_0x1861a0){var _0x2608d8={'role':_0x60dd('0x4d')};_0x2608d8[_0x2ad1b8]=this[_0x60dd('0xb')][_0x60dd('0x38')];this[_0x60dd('0xc')]['agentUnpause'](_0x2608d8)[_0x60dd('0x11')](function(_0x2d0fb5){_0x1861a0(null,_[_0x60dd('0x42')](_0x2d0fb5)?![]:!![]);})[_0x60dd('0x14')](function(_0x385376){logger['error'](_0x385376);_0x1861a0(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4f')]=function(_0x23bddb,_0x3011fd){var _0x2d965e={'role':'agent'};_0x2d965e[_0x23bddb]=this[_0x60dd('0xb')]['callerid'];this[_0x60dd('0xc')][_0x60dd('0x4f')](_0x2d965e)['then'](function(_0x4aac4b){_0x3011fd(null,_[_0x60dd('0x42')](_0x4aac4b)?![]:!![]);})['catch'](function(_0x3358c9){logger[_0x60dd('0x28')](_0x3358c9);_0x3011fd(null,![]);});};AGIVertices[_0x60dd('0xe')]['agentLogin']=function(_0x5272a9,_0x52bb8f){var _0x343324={'role':_0x60dd('0x4d')};_0x343324[_0x5272a9]=this[_0x60dd('0xb')][_0x60dd('0x38')];var _0x4dd17b=_0x5272a9!='internal'?util[_0x60dd('0x26')](_0x60dd('0x50'),'LOCAL',this['channel']['callerid']):undefined;this[_0x60dd('0xc')]['agentLogin'](_0x343324,_0x4dd17b)[_0x60dd('0x11')](function(_0x1f920b){_0x52bb8f(null,_[_0x60dd('0x42')](_0x1f920b)?![]:!![]);})[_0x60dd('0x14')](function(_0x3f4cb0){logger[_0x60dd('0x28')](_0x3f4cb0);_0x52bb8f(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x51')]=function(_0x52141a,_0x1cfc09){sh[_0x60dd('0x52')](_[_0x60dd('0x53')](_0x52141a),function(_0x6bf4c6,_0x13bc7d){var _0xc14180=_0x13bc7d[_0x60dd('0x54')](/(\r\n|\n|\r)/gm,'');_0x1cfc09(null,_0xc14180);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x55')]=function(_0x15a1a6,_0x935915){scripts[_0x60dd('0x55')](_0x15a1a6[_0x60dd('0x56')],_0x15a1a6[_0x60dd('0x57')]||'en',0x1)[_0x60dd('0x11')](function(_0x5b8388){_0x935915(null,_0x5b8388);})[_0x60dd('0x14')](function(_0x5035ef){_0x935915(_0x5035ef);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x58')]=function(_0x3b4c82,_0x5d34ca){scripts[_0x60dd('0x58')](this['channel'][_0x60dd('0x3a')],_0x3b4c82[_0x60dd('0x59')],_0x3b4c82['text'],_0x3b4c82[_0x60dd('0x5a')]||'en')[_0x60dd('0x11')](function(_0x477d9f){_0x5d34ca(null,_0x477d9f);})[_0x60dd('0x14')](function(_0x18a2da){_0x5d34ca(_0x18a2da);});};AGIVertices['prototype'][_0x60dd('0x5b')]=function(_0x5874fb,_0x550608){scripts[_0x60dd('0x5b')](this['channel'],_0x5874fb)[_0x60dd('0x11')](function(_0xd8542b){_0x550608(null,_0xd8542b);})['catch'](function(_0x19dffb){_0x550608(_0x19dffb);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x5c')]=function(_0xdffc6f,_0x1fa9d1){scripts[_0x60dd('0x5c')](_0xdffc6f['key'],_0xdffc6f[_0x60dd('0x56')],_0xdffc6f['ispeech_tts_language']||_0x60dd('0x5d'),_0xdffc6f[_0x60dd('0x5e')])['then'](function(_0x5dc258){_0x1fa9d1(null,_0x5dc258);})[_0x60dd('0x14')](function(_0x371432){_0x1fa9d1(_0x371432);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x5f')]=function(_0x7484f0,_0xfe90e5,_0x5a05c2){scripts['ispeechASR'](_0xfe90e5,_0x7484f0[_0x60dd('0x59')],_0x7484f0[_0x60dd('0x60')]||_0x60dd('0x5d'),this[_0x60dd('0x61')](_0x7484f0[_0x60dd('0x62')])?_0x7484f0[_0x60dd('0x62')]:undefined)[_0x60dd('0x11')](function(_0x4ca88b){_0x5a05c2(null,_0x4ca88b);})['catch'](function(_0x2f8f1d){_0x5a05c2(_0x2f8f1d);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x63')]=function(_0x26e9e6,_0x41e131){scripts['awsPolly'](_0x26e9e6['aws_access_key_id'],_0x26e9e6[_0x60dd('0x64')],_0x26e9e6['aws_polly_region'],_0x26e9e6[_0x60dd('0x65')]||'Amy',_0x26e9e6[_0x60dd('0x56')],_0x26e9e6[_0x60dd('0x66')]||_0x60dd('0x56'))[_0x60dd('0x11')](function(_0x3a72b4){_0x41e131(null,_0x3a72b4);})[_0x60dd('0x14')](function(_0x2abfbc){_0x41e131(_0x2abfbc);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x67')]=function(_0x1bc37c,_0x31ff35){scripts[_0x60dd('0x67')](this[_0x60dd('0xb')][_0x60dd('0x3a')],_0x1bc37c[_0x60dd('0x68')],_0x1bc37c[_0x60dd('0x64')],_0x1bc37c['aws_lex_region'],_0x1bc37c['text'],_0x1bc37c['aws_bot_name'])[_0x60dd('0x11')](function(_0x2aa7d0){_0x31ff35(null,_0x2aa7d0);})[_0x60dd('0x14')](function(_0x418d76){_0x31ff35(_0x418d76);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x69')]=function(_0x418e1c,_0x8ec75b,_0x5ba57){scripts[_0x60dd('0x69')](_0x8ec75b,_0x418e1c[_0x60dd('0x59')],_0x418e1c[_0x60dd('0x6a')]||'en-US')[_0x60dd('0x11')](function(_0x3680b0){_0x5ba57(null,_0x3680b0);})[_0x60dd('0x14')](function(_0x2fbfa4){_0x5ba57(_0x2fbfa4);});};AGIVertices[_0x60dd('0xe')]['tildeASR']=function(_0x468f00,_0x4bb4e5,_0x50c4a5){scripts[_0x60dd('0x6b')](_0x4bb4e5,_0x468f00[_0x60dd('0x6c')],_0x468f00[_0x60dd('0x6d')],_0x468f00[_0x60dd('0x6e')])[_0x60dd('0x11')](function(_0x85c612){_0x50c4a5(null,_0x85c612);})[_0x60dd('0x14')](function(_0x2537dc){_0x50c4a5(_0x2537dc);});};AGIVertices[_0x60dd('0xe')]['clear']=function(_0x1b899d){var _0x4ae2ab=_['includes'](verticesWithRetry,_0x1b899d['agicommand'])?_0x1b899d:_[_0x60dd('0x6f')](_0x1b899d);for(var _0x2e3ef9 in _0x4ae2ab){if(_0x4ae2ab[_0x60dd('0x70')](_0x2e3ef9)){if(_0x4ae2ab[_0x2e3ef9]&&_[_0x60dd('0x71')](_0x4ae2ab[_0x2e3ef9])){_0x4ae2ab[_0x2e3ef9]=this[_0x60dd('0x72')](_0x4ae2ab[_0x2e3ef9]);}}}return _0x4ae2ab;};AGIVertices[_0x60dd('0xe')]['replaceAllVariables']=function(_0x1689ac){var _0x5aa068=_0x1689ac['split']('{');for(var _0x517d12=0x1;_0x517d12<_0x5aa068[_0x60dd('0x73')];_0x517d12+=0x1){var _0x38ff45=_0x5aa068[_0x517d12][_0x60dd('0x74')]('}');if(_0x38ff45['length']>0x1){_0x1689ac=_0x1689ac[_0x60dd('0x75')]('{'+_0x38ff45[0x0]+'}',this['channel'][_0x60dd('0xf')](_0x38ff45[0x0])[_0x60dd('0x76')]||_0x38ff45[0x0]);}}if(_0x5aa068[_0x60dd('0x73')]===0x1){return _0x1689ac[_0x60dd('0x49')]();}return this[_0x60dd('0x72')](_0x1689ac);};AGIVertices[_0x60dd('0xe')]['getAndSetVariable']=function(_0x362898,_0xa008f){var _0x10089c=this[_0x60dd('0xb')]['getVariable'](_0x362898);if(_0x10089c['result']===-0x1){return _0x10089c;}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xa008f,_0x10089c['extra']));return this[_0x60dd('0xb')]['setVariable'](_0xa008f,_0x10089c[_0x60dd('0x76')]);};AGIVertices[_0x60dd('0xe')]['isConfigured']=function(_0x12886e){return _0x12886e&&_0x12886e!=='0'&&_0x12886e!=='-1'&&_0x12886e!=='';};AGIVertices['prototype'][_0x60dd('0x77')]=function(_0x3c5dc1){this['createSquareDetailsReport'][_0x60dd('0x78')](this,_0x3c5dc1,'-');_0x3c5dc1[_0x60dd('0x79')]=_0x3c5dc1[_0x60dd('0x77')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x60dd('0x7')]=function(_0x99e31e){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x7a'),_0x99e31e['label']));return this['channel']['agi']([_0x99e31e[_0x60dd('0x7b')],_0x99e31e['args']]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x7c')]=function(_0x59ec60){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x7d'),_0x59ec60['label']));if(this[_0x60dd('0x61')](_0x59ec60[_0x60dd('0x7e')])){logger['info'](util['format'](_0x60dd('0x7f'),_0x59ec60[_0x60dd('0x7e')]));var _0x3910c8=this[_0x60dd('0xb')][_0x60dd('0x80')](_0x59ec60['timeout']);if(_0x3910c8[_0x60dd('0x81')]===-0x1){return _0x3910c8;}}return this['channel'][_0x60dd('0x7c')]();};AGIVertices['prototype'][_0x60dd('0x82')]=function(_0xd06303){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x83'),_0xd06303[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0xd06303[_0x60dd('0x46')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0xd06303,_0x60dd('0x84'));}_0xd06303['scheduledAt']=moment();if(this[_0x60dd('0x61')](_0xd06303[_0x60dd('0x85')])){_0xd06303['scheduledAt']=moment()['add'](_0xd06303[_0x60dd('0x85')],_0x60dd('0x86'));}if(!this['isConfigured'](_0xd06303[_0x60dd('0x87')])){_0xd06303[_0x60dd('0x87')]=0x2;}this[_0x60dd('0x40')][_0x60dd('0x78')](this,_0xd06303);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x89'),_0xd06303['phone'],_0xd06303[_0x60dd('0x46')],_0xd06303[_0x60dd('0x47')]));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x8a')]=function(_0x1b5bff){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1b5bff[_0x60dd('0x35')]));var _0x23faf2=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x1b5bff[_0x60dd('0x8b')],_0x1b5bff['options']);if(_0x23faf2[_0x60dd('0x81')]===-0x1){return _0x23faf2;}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x1b5bff[_0x60dd('0x8b')],_0x1b5bff['options']));};AGIVertices['prototype'][_0x60dd('0x8d')]=function(_0x2de6fa){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x8e'),_0x2de6fa[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x2de6fa[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20text\x20configured');}var _0x4db3da='\x22'+_0x2de6fa[_0x60dd('0x56')]+'\x22';if(this[_0x60dd('0x61')](_0x2de6fa[_0x60dd('0x8f')])){_0x4db3da+=','+_0x2de6fa['options'];}var _0x41bb29=this[_0x60dd('0xb')][_0x60dd('0x52')]('MRCPSynth',_0x4db3da);if(_0x41bb29[_0x60dd('0x81')]===-0x1){return _0x41bb29;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4db3da));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x90')]=function(_0x5907a5){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5907a5[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5907a5[_0x60dd('0x56')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1a9c7d='\x22'+_0x5907a5[_0x60dd('0x56')]+'\x22';if(this[_0x60dd('0x61')](_0x5907a5[_0x60dd('0x8f')])){_0x1a9c7d+=','+_0x5907a5[_0x60dd('0x8f')];}var _0x1310af=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x91'),_0x1a9c7d);if(_0x1310af[_0x60dd('0x81')]===-0x1){return _0x1310af;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x92'),_0x1a9c7d));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x93')]=function(_0x4d0d29){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x94'),_0x4d0d29[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x4d0d29[_0x60dd('0x95')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x96'));}var _0x28906b=_0x4d0d29[_0x60dd('0x95')];if(this[_0x60dd('0x61')](_0x4d0d29['options'])){_0x28906b+=','+_0x4d0d29['options'];}var _0x74a704=this[_0x60dd('0xb')][_0x60dd('0x52')]('MRCPRecog',_0x28906b);if(_0x74a704[_0x60dd('0x81')]===-0x1){return _0x74a704;}var _0x37dcc9=this[_0x60dd('0x97')](_0x60dd('0x98'),_0x60dd('0x99'));if(_0x37dcc9[_0x60dd('0x81')]===-0x1){return _0x37dcc9;}var _0x16e004=this[_0x60dd('0x97')]('RECOG_INPUT()',_0x60dd('0x9a'));if(_0x16e004[_0x60dd('0x81')]===-0x1){return _0x16e004;}var _0x452fe3=this['getAndSetVariable'](_0x60dd('0x9b'),'LUMENVOX_ASR_INSTANCE');if(_0x452fe3['result']===-0x1){return _0x452fe3;}return this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x9c'),_0x28906b));};AGIVertices[_0x60dd('0xe')]['sestekasr']=function(_0x5918b2){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5918b2[_0x60dd('0x35')]));if(!this['isConfigured'](_0x5918b2[_0x60dd('0x95')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x96'));}var _0x312d97=_0x5918b2[_0x60dd('0x95')];if(this['isConfigured'](_0x5918b2[_0x60dd('0x8f')])){_0x312d97+=','+_0x5918b2[_0x60dd('0x8f')];}var _0x118e41=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x9d'),_0x312d97);if(_0x118e41['result']===-0x1){return _0x118e41;}var _0x9f6edd=this[_0x60dd('0x97')]('RECOG_CONFIDENCE()',_0x60dd('0x9e'));if(_0x9f6edd[_0x60dd('0x81')]===-0x1){return _0x9f6edd;}var _0x2c37e7=this['getAndSetVariable']('RECOG_INPUT()',_0x60dd('0x9f'));if(_0x2c37e7[_0x60dd('0x81')]===-0x1){return _0x2c37e7;}var _0x25df87=this[_0x60dd('0x97')](_0x60dd('0x9b'),_0x60dd('0xa0'));if(_0x25df87['result']===-0x1){return _0x25df87;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x9c'),_0x312d97));};AGIVertices[_0x60dd('0xe')]['database']=function(_0x19a82c){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xa1'),_0x19a82c[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0xa2')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa3'));}var _0x298961=this[_0x60dd('0xa4')]['sync'](this,_0x19a82c[_0x60dd('0xa2')]);if(!_0x298961){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa5'));}if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0x2c')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa6'));}var _0x412690=_0x19a82c[_0x60dd('0x2c')][_0x60dd('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xa7'),_0x412690));var _0x567ace=this[_0x60dd('0xa8')][_0x60dd('0x78')](this,_0x298961,_0x412690);this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x19a82c,_0x412690);if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0xa9')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xaa'));}var _0x8e0716=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x19a82c[_0x60dd('0xa9')]);if(!_0x8e0716){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xab'));}var _0xd21642=this;_0x567ace[_0x60dd('0xac')](function(_0x4e7ad8,_0x3c2d47){Object[_0x60dd('0xad')](_0x4e7ad8)[_0x60dd('0xac')](function(_0x34be91){_0xd21642[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')]('%s[%s][%s]',_0x8e0716,_0x3c2d47,_0x34be91),_0x4e7ad8[_0x34be91]);});});this[_0x60dd('0xb')]['setVariable'](util[_0x60dd('0x26')]('%s_ROWS_COUNT',_0x8e0716),_0x567ace[_0x60dd('0x73')]);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xaf'),_0x8e0716));};AGIVertices['prototype'][_0x60dd('0xb0')]=function(_0x2dd22d){logger[_0x60dd('0xb1')](util[_0x60dd('0x26')](_0x60dd('0xb2'),_0x2dd22d[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x2dd22d['sip_id'])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2dd22d,'no\x20user\x20selected');}var _0x258df5=this[_0x60dd('0x19')]['sync'](this,_0x2dd22d[_0x60dd('0xb3')]);if(!_0x258df5){return this['channel'][_0x60dd('0x28')](_0x2dd22d,_0x60dd('0xb4'));}var _0x47d325=this['channel']['exec']('DIAL',[util[_0x60dd('0x26')](_0x60dd('0xb5'),_0x258df5),_0x2dd22d[_0x60dd('0x7e')],_0x2dd22d[_0x60dd('0xb6')],_0x2dd22d[_0x60dd('0xb7')]]);if(_0x47d325[_0x60dd('0x81')]===-0x1){return _0x47d325;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xb8')]=function(_0x5784d4){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xb9'),_0x5784d4[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5784d4[_0x60dd('0x59')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xba'));}if(!this['isConfigured'](_0x5784d4[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20text\x20configured');}this[_0x60dd('0xb')]['bot']=!![];this[_0x60dd('0x34')](_0x5784d4);this['createSquareMessage'](_0x5784d4[_0x60dd('0x56')],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xbb'),_0x5784d4['text']));var _0x5320da=this['googleDialogflow'][_0x60dd('0x78')](this,_0x5784d4);if(_0x5320da){for(var _0x59c8ed in _0x5320da){if(_0x5320da[_0x60dd('0x70')](_0x59c8ed)){this[_0x60dd('0xb')]['setVariable'](util[_0x60dd('0x26')](_0x60dd('0xbc'),_0x59c8ed[_0x60dd('0xbd')]()),_0x5320da[_0x59c8ed]);}}this[_0x60dd('0x3f')](_0x5320da[_0x60dd('0xbe')],_0x60dd('0xbf'));return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xc0'),_0x5320da[_0x60dd('0xbe')]));}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x5784d4,_0x60dd('0xc1'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xc2')]=function(_0x548618){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x548618[_0x60dd('0x35')]));if(!this['isConfigured'](_0x548618['ndauth_url'])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xc3'));}if(!this[_0x60dd('0x61')](_0x548618['username'])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc4'));}if(!this['isConfigured'](_0x548618['password'])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc5'));}if(!this[_0x60dd('0x61')](_0x548618[_0x60dd('0xc6')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0xc8')]=!![];this[_0x60dd('0x34')](_0x548618);this['createSquareMessage'](_0x548618[_0x60dd('0x56')],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Trying\x20SestekNDA:\x20%s',_0x548618[_0x60dd('0x56')]));var _0x282b3f=this[_0x60dd('0x5b')][_0x60dd('0x78')](this,_0x548618);if(_0x282b3f){for(var _0x2709be in _0x282b3f){if(_0x282b3f['hasOwnProperty'](_0x2709be)){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xc9'),_0x2709be[_0x60dd('0xbd')]()),_0x282b3f[_0x2709be]);}}this['createSquareMessage'](_0x282b3f[_0x60dd('0xbe')],_0x60dd('0xbf'));if(_0x282b3f['audiofile']){this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x282b3f[_0x60dd('0xca')]));var _0x6306c2=this[_0x60dd('0xb')]['streamFile'](_0x282b3f[_0x60dd('0xca')]);try{fs[_0x60dd('0xcb')](_0x282b3f[_0x60dd('0xca')]+'.wav');}catch(_0x1750a9){logger['error'](_0x1750a9);}return _0x6306c2;}else{return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('SestekNDA\x20Result\x20%s',_0x282b3f[_0x60dd('0xbe')]));}}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x548618,_0x60dd('0xcc'));};AGIVertices[_0x60dd('0xe')]['end']=function(_0xf06702){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xcd'),_0xf06702[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['noop'](_0x60dd('0xce'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xcf')]=function(_0x2ea1d7){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xd0'),_0x2ea1d7[_0x60dd('0x35')]));var _0x5228ef='';if(_0x2ea1d7[_0x60dd('0xd1')]){if(!this[_0x60dd('0x61')](_0x2ea1d7[_0x60dd('0xd1')])){return this['channel'][_0x60dd('0x28')](_0x2ea1d7,_0x60dd('0xd2'));}else{var _0x31a849=parseInt(_0x2ea1d7[_0x60dd('0xd1')],0xa);if(isNaN(_0x31a849)){_0x5228ef=_0x2ea1d7[_0x60dd('0xd1')];}else{_0x5228ef=this['getTrunk'][_0x60dd('0x78')](this,_0x2ea1d7[_0x60dd('0xd1')]);if(!_0x5228ef){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2ea1d7,'no\x20trunk\x20found');}}}}else if(_0x2ea1d7[_0x60dd('0xd3')]){_0x5228ef=_0x2ea1d7[_0x60dd('0xd3')];}else{return this['channel'][_0x60dd('0x28')](_0x2ea1d7,_0x60dd('0xd2'));}var _0x22ddbd=this['channel'][_0x60dd('0x52')]('DIAL',[util['format'](_0x60dd('0xd4'),_0x5228ef,_0x2ea1d7['phone']),_0x2ea1d7[_0x60dd('0x7e')],_0x2ea1d7[_0x60dd('0xb6')],_0x2ea1d7[_0x60dd('0xb7')]]);if(_0x22ddbd[_0x60dd('0x81')]===-0x1){return _0x22ddbd;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xd5'),'DIAL'));};AGIVertices[_0x60dd('0xe')]['finally']=function(_0x481788){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xd6'),_0x481788[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x88')]('finally');};AGIVertices[_0x60dd('0xe')][_0x60dd('0xa')]=function(_0x34d2ce){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xd7'),_0x34d2ce[_0x60dd('0x35')]));if(_0x34d2ce[_0x60dd('0x79')]===0x0){return this[_0x60dd('0x77')](_0x34d2ce);}_0x34d2ce[_0x60dd('0x79')]-=0x1;if(!this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xd8')])){return this['channel'][_0x60dd('0x28')](_0x34d2ce,_0x60dd('0xd9'));}var _0x5b14f3=this['getSound']['sync'](this,_0x34d2ce[_0x60dd('0xd8')]);if(!_0x5b14f3){return this['channel']['error'](_0x34d2ce,'no\x20file\x20audio\x20found');}if(!this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xa9')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x60dd('0xaa'));}var _0x5d5792=this[_0x60dd('0xb')]['getData'](_0x5b14f3,_0x34d2ce[_0x60dd('0xda')],_0x34d2ce[_0x60dd('0xdb')]);var _0x4d3836=_0x5d5792['result']?_0x5d5792['result'][_0x60dd('0x49')]():'';logger[_0x60dd('0x2a')](_0x60dd('0xdc'),JSON[_0x60dd('0xdd')](_0x5d5792));if(_0x5d5792[_0x60dd('0x81')]===-0x1){this[_0x60dd('0x34')]['sync'](this,_0x34d2ce,_0x4d3836);return _0x5d5792;}else if(_0x5d5792['extra']===_0x60dd('0x7e')){_0x5d5792['result']=_0x4d3836[_0x60dd('0x73')]>=parseInt(_0x34d2ce['mindigit'])?'x':'i';}else{_0x5d5792[_0x60dd('0x81')]=_0x4d3836[_0x60dd('0x73')]>=parseInt(_0x34d2ce[_0x60dd('0xde')])&&_0x4d3836[_0x60dd('0x73')]<=parseInt(_0x34d2ce[_0x60dd('0xdb')])?'x':'i';}var _0x916900=this[_0x60dd('0xf')]['sync'](this,_0x34d2ce[_0x60dd('0xa9')]);if(!_0x916900){return this[_0x60dd('0xb')]['error'](_0x34d2ce,_0x60dd('0xab'));}this[_0x60dd('0xb')][_0x60dd('0xae')](_0x916900,_0x4d3836);if(this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xdf')])){var _0x820f41=parseInt(_0x34d2ce['hiddendigitsnum'],0xa);var _0x2af049=rs['generate']({'charset':'*','length':_0x820f41});var _0x17fbaa=_0x4d3836[_0x60dd('0x73')];if(_0x17fbaa>0x0){if(_0x17fbaa>_0x820f41){this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,_0x34d2ce['hiddendigitspos']===_0x60dd('0xe0')?_0x2af049+_0x4d3836[_0x60dd('0xe1')](_0x820f41):_0x4d3836[_0x60dd('0xe1')](0x0,_0x17fbaa-_0x820f41)+_0x2af049);}else{this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,rs[_0x60dd('0xe2')]({'charset':'*','length':_0x17fbaa}));}}else{this[_0x60dd('0x34')]['sync'](this,_0x34d2ce,'');}}else{this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,_0x4d3836);}return _0x5d5792;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xe3')]=function(_0x438296){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xe4'),_0x438296[_0x60dd('0x35')]));return this[_0x60dd('0xa')](_0x438296);};AGIVertices[_0x60dd('0xe')][_0x60dd('0xe5')]=function(_0x54f519){logger['info'](util['format'](_0x60dd('0xe6'),_0x54f519[_0x60dd('0x35')]));this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x54f519,_0x54f519['goalname']);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xe7'),_0x54f519['goalname']));};AGIVertices[_0x60dd('0xe')]['awspolly']=function(_0x35b5a1){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xe8'),_0x35b5a1['label']));if(!this['isConfigured'](_0x35b5a1['aws_access_key_id'])||!this['isConfigured'](_0x35b5a1[_0x60dd('0x64')])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xe9'));}if(!this['isConfigured'](_0x35b5a1[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xea'),_0x35b5a1[_0x60dd('0x56')]));var _0x1c6927=this[_0x60dd('0x63')][_0x60dd('0x78')](this,_0x35b5a1);if(_0x1c6927){this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xeb'),_0x1c6927));var _0x492cc0=this[_0x60dd('0xb')][_0x60dd('0xec')](_0x1c6927);try{fs['unlink'](_0x1c6927+'.wav');}catch(_0x351a8e){logger[_0x60dd('0x28')](_0x351a8e);}return _0x492cc0;}return this['channel'][_0x60dd('0x28')](_0x35b5a1,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x48d4f9){logger['info'](util['format'](_0x60dd('0xed'),_0x48d4f9[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0x68')])||!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0x64')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xe9'));}if(!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0xee')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xef'));}if(!this['isConfigured'](_0x48d4f9['text'])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0xc8')]=!![];this[_0x60dd('0x34')](_0x48d4f9);this[_0x60dd('0x3f')](_0x48d4f9['text'],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xf0'),_0x48d4f9[_0x60dd('0x56')]));var _0x54b35a=this[_0x60dd('0x67')][_0x60dd('0x78')](this,_0x48d4f9);if(_0x54b35a){for(var _0x3ea315 in _0x54b35a){if(_0x54b35a[_0x60dd('0x70')](_0x3ea315)&&_['isString'](_0x54b35a[_0x3ea315])){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xf1'),_0x3ea315[_0x60dd('0xbd')]()),_0x54b35a[_0x3ea315]);}}if(_[_0x60dd('0x42')](_0x54b35a[_0x60dd('0xf2')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xf3'));}else{this[_0x60dd('0x3f')](_0x54b35a['message'],_0x60dd('0xbf'));return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xf4'),_0x54b35a[_0x60dd('0xf2')]));}}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x48d4f9,_0x60dd('0xf5'));};AGIVertices[_0x60dd('0xe')]['googleasr']=function(_0x540f66){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xf6'),_0x540f66[_0x60dd('0x35')],_0x540f66['timeout']));if(!this['isConfigured'](_0x540f66['key'])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xba'));}var _0x33a7c9=_0x60dd('0xf7');var _0x54fae2=util['format'](_0x60dd('0xf8'),FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x35a321=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x54fae2,_0x33a7c9);var _0x195c4b=!![];if(_0x540f66['beep']===_0x60dd('0xfa')){_0x195c4b=![];}var _0x16bb5a=this[_0x60dd('0xb')]['recordFile'](_0x54fae2,_0x33a7c9,_0x540f66[_0x60dd('0xfb')],_0x540f66[_0x60dd('0x7e')],undefined,_0x195c4b);if(_0x16bb5a[_0x60dd('0x81')]!==-0x1){this['channel']['noop'](util[_0x60dd('0x26')](_0x60dd('0xfc'),_0x35a321));var _0x4ff98e=this['googleASR']['sync'](this,_0x540f66,_0x35a321);if(_0x4ff98e){for(var _0x2894ed in _0x4ff98e){if(_0x4ff98e[_0x60dd('0x70')](_0x2894ed)){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xfd'),_0x2894ed['toUpperCase']()),_0x4ff98e[_0x2894ed]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0xfe'),JSON[_0x60dd('0xdd')](_0x4ff98e)));}}return _0x16bb5a;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xff')]=function(_0x18f003){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x100'),_0x18f003[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x18f003[_0x60dd('0x6c')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x101'));}if(!this['isConfigured'](_0x18f003[_0x60dd('0x6d')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x102'));}var _0x237d0b=_0x60dd('0xf7');var _0x1c2dc9=util[_0x60dd('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x6bf505=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x1c2dc9,_0x237d0b);var _0x46d9af=!![];if(_0x18f003[_0x60dd('0x103')]===_0x60dd('0xfa')){_0x46d9af=![];}var _0x21b6da=this[_0x60dd('0xb')][_0x60dd('0x104')](_0x1c2dc9,_0x237d0b,_0x18f003[_0x60dd('0xfb')],_0x18f003['timeout'],undefined,_0x46d9af);if(_0x21b6da['result']!==-0x1){this['channel']['noop'](util['format'](_0x60dd('0x105'),_0x6bf505));var _0x2948f6=this[_0x60dd('0x6b')]['sync'](this,_0x18f003,_0x6bf505);if(_0x2948f6){for(var _0x402337 in _0x2948f6){if(_0x2948f6[_0x60dd('0x70')](_0x402337)){this['channel'][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0x106'),_0x402337[_0x60dd('0xbd')]()),_0x2948f6[_0x402337]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x107'),JSON[_0x60dd('0xdd')](_0x2948f6)));}}return _0x21b6da;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x108')]=function(_0x182b31){logger['info'](util['format'](_0x60dd('0x109'),_0x182b31[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['continueAt'](_0x182b31['context'],_0x182b31[_0x60dd('0x3d')],_0x182b31['priority']);};AGIVertices[_0x60dd('0xe')]['gotoif']=function(_0x154350){logger[_0x60dd('0x2a')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x154350['label']));if(!this['isConfigured'](_0x154350[_0x60dd('0x10a')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x154350,_0x60dd('0x10b'));}try{var _0xd2152e=eval(_0x154350['condition'])?_0x60dd('0x10c'):_0x60dd('0x10d');this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x10e'),_0x154350[_0x60dd('0x10a')],_0xd2152e));return{'code':0xc8,'result':_0xd2152e};}catch(_0x4225dc){return{'code':0xc8,'result':_0x60dd('0x10d')};}};AGIVertices[_0x60dd('0xe')]['gotoiftime']=function(_0x7ef20d){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x10f'),_0x7ef20d[_0x60dd('0x35')]));if(!this['isConfigured'](_0x7ef20d['interval_id'])){return this[_0x60dd('0xb')]['error'](_0x7ef20d,_0x60dd('0x110'));}var _0x4bf13d=this[_0x60dd('0x111')][_0x60dd('0x78')](this,_0x7ef20d[_0x60dd('0x112')]);if(!_0x4bf13d){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x7ef20d,_0x60dd('0x113'));}for(var _0x19f10d=0x0;_0x19f10d<_0x4bf13d['length'];_0x19f10d+=0x1){var _0x46307b=this['channel']['getVariable'](util[_0x60dd('0x26')](_0x60dd('0x114'),_0x4bf13d[_0x19f10d]));if(_0x46307b[_0x60dd('0x81')]===-0x1){return _0x46307b;}logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],_0x46307b[_0x60dd('0x76')]));if(_0x46307b[_0x60dd('0x76')]===_0x60dd('0x10c')){logger[_0x60dd('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x4bf13d[_0x19f10d],_0x60dd('0x10c')));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],'true'));return{'code':0xc8,'result':_0x60dd('0x10c')};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],_0x60dd('0x10d')));this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],'false'));}}return{'code':0xc8,'result':_0x60dd('0x10d')};};AGIVertices[_0x60dd('0xe')][_0x60dd('0x116')]=function(_0x255c8e){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x117'),_0x255c8e[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x116')]();};AGIVertices[_0x60dd('0xe')][_0x60dd('0x118')]=function(_0x21d93d){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x119'),_0x21d93d[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x21d93d[_0x60dd('0x59')])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xba'));}var _0x7aee8a=_0x60dd('0xf7');var _0x3cb38e=util['format'](_0x60dd('0xf8'),FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x123455=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x3cb38e,_0x7aee8a);var _0x978d0f=!![];if(_0x21d93d[_0x60dd('0x103')]===_0x60dd('0xfa')){_0x978d0f=![];}var _0x388865=this['channel'][_0x60dd('0x104')](_0x3cb38e,_0x7aee8a,_0x21d93d[_0x60dd('0xfb')],_0x21d93d[_0x60dd('0x7e')],undefined,_0x978d0f);if(_0x388865['result']!==-0x1){this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x11a'),_0x123455));var _0x4cfe21=this[_0x60dd('0x5f')][_0x60dd('0x78')](this,_0x21d93d,_0x123455);if(_0x4cfe21){for(var _0x5de786 in _0x4cfe21){if(_0x4cfe21[_0x60dd('0x70')](_0x5de786)){this['channel']['setVariable'](util[_0x60dd('0x26')](_0x60dd('0x11b'),_0x5de786[_0x60dd('0xbd')]()),_0x4cfe21[_0x5de786]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x11c'),JSON['stringify'](_0x4cfe21)));}}return _0x388865;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x11d')]=function(_0x4f95ce){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4f95ce[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x4f95ce[_0x60dd('0x59')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xba'));}if(!this[_0x60dd('0x61')](_0x4f95ce[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x11e'),_0x4f95ce[_0x60dd('0x56')]));var _0xfe191b=this[_0x60dd('0x5c')]['sync'](this,_0x4f95ce);if(_0xfe191b){this['channel'][_0x60dd('0x88')](util['format'](_0x60dd('0x11a'),_0xfe191b));var _0x316ae9=this[_0x60dd('0xb')][_0x60dd('0xec')](_0xfe191b,_0x4f95ce[_0x60dd('0xfb')]);try{fs[_0x60dd('0xcb')](_0xfe191b+_0x60dd('0x11f'));}catch(_0x556109){logger[_0x60dd('0x28')](_0x556109);}return _0x316ae9;}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x4f95ce,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x60dd('0xe')]['login']=function(_0x45a3d4){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x120'),_0x45a3d4[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x45a3d4[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x45a3d4,_0x60dd('0x122'));}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4[_0x60dd('0x121')]));var _0x896f5=this[_0x60dd('0x124')][_0x60dd('0x78')](this,_0x45a3d4[_0x60dd('0x121')]);if(_0x896f5){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x60dd('0xb')]['callerid'],_0x45a3d4[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x125'),this['channel']['callerid'],_0x45a3d4[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger['info'](util[_0x60dd('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4['findBy']));return{'code':0xc8,'result':_0x60dd('0x128')};}};AGIVertices[_0x60dd('0xe')][_0x60dd('0x129')]=function(_0x320748){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x12a'),_0x320748['label']));if(!this[_0x60dd('0x61')](_0x320748[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x320748,_0x60dd('0x122'));}logger['info'](util['format'](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748[_0x60dd('0x121')]));var _0x523c59=this[_0x60dd('0x4f')]['sync'](this,_0x320748[_0x60dd('0x121')]);if(_0x523c59){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')]['callerid'],_0x320748['findBy']));this['channel']['noop'](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748['findBy']));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')]['callerid'],_0x320748[_0x60dd('0x121')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x60dd('0x12b')]=function(_0xb6f46c){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x12c'),_0xb6f46c[_0x60dd('0x35')]));if(!this['isConfigured'](_0xb6f46c[_0x60dd('0x12d')])){return this['channel'][_0x60dd('0x28')](_0xb6f46c,'no\x20operation\x20configured');}this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x12e'),_0xb6f46c[_0x60dd('0x12d')]));var _0x81a948=eval(_0xb6f46c[_0x60dd('0x12d')]);if(!this[_0x60dd('0x61')](_0xb6f46c['variable_id'])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xaa'));}var _0x25bf67=this[_0x60dd('0xf')]['sync'](this,_0xb6f46c[_0x60dd('0xa9')]);if(!_0x25bf67){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0xb6f46c,_0x60dd('0xab'));}if(_[_0x60dd('0x12f')](_0x81a948)){var _0x49e61d=this;_0x81a948[_0x60dd('0xac')](function(_0x43366d,_0x2dbe11){_0x49e61d[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')]('%s[%s]',_0x25bf67,_0x2dbe11),_0x43366d);});return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x130'),_0x25bf67));}else{return this['channel'][_0x60dd('0xae')](_0x25bf67,_0x81a948);}};AGIVertices['prototype'][_0x60dd('0x131')]=function(_0x3e00b5){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x132'),_0x3e00b5[_0x60dd('0x35')]));if(_0x3e00b5[_0x60dd('0x79')]===0x0){return this['maxRetry'](_0x3e00b5);}_0x3e00b5[_0x60dd('0x79')]-=0x1;if(!this[_0x60dd('0x61')](_0x3e00b5['file_id'])){return this[_0x60dd('0xb')]['error'](_0x3e00b5,_0x60dd('0xd9'));}var _0x342b47=this[_0x60dd('0x1d')][_0x60dd('0x78')](this,_0x3e00b5[_0x60dd('0xd8')]);if(!_0x342b47){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x3e00b5,'no\x20file\x20audio\x20found');}var _0x44fd56=this[_0x60dd('0xb')]['getData'](_0x342b47,_0x3e00b5[_0x60dd('0xda')],_0x3e00b5[_0x60dd('0x133')]);var _0x5dee88=_0x44fd56['result'];if(_0x44fd56[_0x60dd('0x81')]===-0x1){this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x3e00b5,'-1');return _0x44fd56;}else if(_0x44fd56[_0x60dd('0x76')]===_0x60dd('0x7e')){_0x44fd56[_0x60dd('0x81')]=_0x44fd56['result']['length']>0x0?_0x44fd56['result']:'t';}else if(_[_0x60dd('0x41')](_0x44fd56[_0x60dd('0x81')])){_0x44fd56[_0x60dd('0x81')]='#';_0x5dee88='#';}if(!this[_0x60dd('0x61')](_0x3e00b5[_0x60dd('0xa9')])){this['channel'][_0x60dd('0x88')](_0x60dd('0xaa'));}else{var _0x305c64=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x3e00b5[_0x60dd('0xa9')]);if(!_0x305c64){return this['channel'][_0x60dd('0x28')](_0x3e00b5,_0x60dd('0xab'));}this[_0x60dd('0xb')][_0x60dd('0xae')](_0x305c64,_0x5dee88);}this['createSquareDetailsReport']['sync'](this,_0x3e00b5,_0x5dee88);return _0x44fd56;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x88')]=function(_0x15e8f6){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x15e8f6[_0x60dd('0x35')]));return this['channel']['noop'](_0x15e8f6['output']||_0x15e8f6['label']);};AGIVertices['prototype'][_0x60dd('0x134')]=function(_0x3e0bc9){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x135'),_0x3e0bc9[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x3e0bc9['findBy'])){return this[_0x60dd('0xb')]['error'](_0x3e0bc9,_0x60dd('0x122'));}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')]['callerid'],_0x3e0bc9[_0x60dd('0x121')]));var _0x415b74=this[_0x60dd('0x4a')]['sync'](this,_0x3e0bc9['pause_id']);var _0x4bdb61=this['agentPause'][_0x60dd('0x78')](this,_0x3e0bc9['findBy'],_0x415b74);if(_0x4bdb61){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x3e0bc9[_0x60dd('0x121')]));this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')]['callerid'],_0x3e0bc9['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')]['callerid'],_0x3e0bc9[_0x60dd('0x121')]));this['channel']['noop'](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x3e0bc9[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x128')};}};AGIVertices[_0x60dd('0xe')][_0x60dd('0x136')]=function(_0x2141d0){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x137'),_0x2141d0['label']));if(!this[_0x60dd('0x61')](_0x2141d0[_0x60dd('0xd8')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2141d0,'no\x20file\x20audio\x20selected');}var _0x3eca34=this['getSound']['sync'](this,_0x2141d0['file_id']);if(!_0x3eca34){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2141d0,_0x60dd('0x138'));}var _0x2c7fc4=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x139'),[_0x3eca34,_0x2141d0['opts']]);if(_0x2c7fc4[_0x60dd('0x81')]===-0x1){return _0x2c7fc4;}return this[_0x60dd('0xb')]['noop'](util['format'](_0x60dd('0x8c'),'PLAYBACK',_0x3eca34));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x13a')]=function(_0xc3c0f1){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x13b'),_0xc3c0f1[_0x60dd('0x35')]));if(!this['isConfigured'](_0xc3c0f1[_0x60dd('0x13c')])){return this['channel']['error'](_0xc3c0f1,'no\x20queue\x20selected');}var _0x573412='';var _0x2ffbd5=parseInt(_0xc3c0f1[_0x60dd('0x13c')],0xa);if(isNaN(_0x2ffbd5)){_0x573412=_0xc3c0f1[_0x60dd('0x13c')];}else{_0x573412=this['getVoiceQueue'][_0x60dd('0x78')](this,_0xc3c0f1[_0x60dd('0x13c')]);if(!_0x573412){return this[_0x60dd('0xb')]['error'](_0xc3c0f1,'no\x20queue\x20found');}}var _0x258e81='';if(this['isConfigured'](_0xc3c0f1['file_id'])){var _0x49cf44=this['getSound'][_0x60dd('0x78')](this,_0xc3c0f1[_0x60dd('0xd8')]);if(_0x49cf44){_0x258e81=_0x49cf44;}}this[_0x60dd('0x34')]['sync'](this,_0xc3c0f1,_0x573412);if(_0xc3c0f1[_0x60dd('0xb6')]['indexOf']('x')<0x0){_0xc3c0f1[_0x60dd('0xb6')]+='x';}if(_0xc3c0f1['opts'][_0x60dd('0x13d')]('X')<0x0){_0xc3c0f1['opts']+='X';}this['channel'][_0x60dd('0xae')](_0x60dd('0x13e'),_0x573412?_0x573412[_0x60dd('0x13f')]():'');var _0x39fe78=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x140'),[_0x573412,_0xc3c0f1[_0x60dd('0xb6')],_0xc3c0f1['url'],_0x258e81,_0xc3c0f1['timeout'],_0xc3c0f1[_0x60dd('0x7')],_0xc3c0f1[_0x60dd('0x141')],_0xc3c0f1[_0x60dd('0x142')],'',_0xc3c0f1['position']]);if(_0x39fe78['result']===-0x1){return _0x39fe78;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x60dd('0x140'),_0x573412));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x143')]=function(_0x5abf54){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5abf54[_0x60dd('0x35')]));var _0xc8f6c3=_0x5abf54[_0x60dd('0x144')]||_0x60dd('0xf7');var _0x3118a8=util['format'](_0x60dd('0x145'),this['channel'][_0x60dd('0x3a')],rs[_0x60dd('0xe2')](0x5));var _0x479659=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x3118a8,_0xc8f6c3);var _0x541e26=util[_0x60dd('0x26')](_0x60dd('0xf8'),FILES_PATH,_0x3118a8);this[_0x60dd('0x39')][_0x60dd('0x78')](this,_0x5abf54,_0x3118a8,_0x479659);this[_0x60dd('0xb')][_0x60dd('0xae')]('RECORDING_SAVENAME',_0x3118a8);logger[_0x60dd('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x541e26,_0xc8f6c3,_0x5abf54[_0x60dd('0x146')],_0x5abf54[_0x60dd('0x7e')]);return this[_0x60dd('0xb')][_0x60dd('0x104')](_0x541e26,_0xc8f6c3,_0x5abf54[_0x60dd('0x146')],_0x5abf54[_0x60dd('0x7e')],undefined,!![]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x147')]=function(_0x577eb2){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x148'),_0x577eb2[_0x60dd('0x35')]));return this['channel'][_0x60dd('0x149')](_0x577eb2[_0x60dd('0x14a')][_0x60dd('0x54')](/\s+/g,''),_0x577eb2[_0x60dd('0x146')]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x14b')]=function(_0x3c6dfe){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x14c'),_0x3c6dfe[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x14d')](_0x3c6dfe[_0x60dd('0x14e')][_0x60dd('0x54')](/\s+/g,''),_0x3c6dfe[_0x60dd('0x146')]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x14f')]=function(_0x5a206a){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5a206a[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x150')](_0x5a206a[_0x60dd('0x56')],_0x5a206a['escape_digits']);};AGIVertices['prototype'][_0x60dd('0x151')]=function(_0xadce6b){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x152'),_0xadce6b[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0xadce6b[_0x60dd('0x153')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20mail\x20account\x20configured');}var _0x53b5bd=this['getMailAccount'][_0x60dd('0x78')](this,_0xadce6b[_0x60dd('0x153')]);if(!_0x53b5bd||!_0x53b5bd['Smtp']){return this[_0x60dd('0xb')]['error'](_0xadce6b,_0x60dd('0x154'));}var _0xb62f2={'from':util[_0x60dd('0x26')]('\x22%s\x22\x20<%s>',_0x53b5bd[_0x60dd('0x12')],_0x53b5bd[_0x60dd('0x155')]||_0x53b5bd[_0x60dd('0x156')]['user']),'to':_0xadce6b['to']||'','cc':_0xadce6b['cc']||'','bcc':_0xadce6b[_0x60dd('0x157')]||'','subject':_0xadce6b[_0x60dd('0x158')],'html':_0xadce6b[_0x60dd('0x56')],'text':_0xadce6b['text']};var _0x4eed3a={'tls':{'rejectUnauthorized':![]}};if(_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x159')]){_0x4eed3a[_0x60dd('0x159')]=_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x159')];}else{_0x4eed3a[_0x60dd('0x15a')]=_0x53b5bd['Smtp'][_0x60dd('0x15a')];_0x4eed3a[_0x60dd('0x15b')]=_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x15b')];_0x4eed3a[_0x60dd('0x15c')]=_0x53b5bd['Smtp'][_0x60dd('0x15c')];}if(_0x53b5bd['Smtp'][_0x60dd('0x15d')]){_0x4eed3a['auth']={'user':_0x53b5bd[_0x60dd('0x156')]['user'],'pass':_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x15e')]};}if(this[_0x60dd('0x61')](_0xadce6b['template_id'])){}logger[_0x60dd('0xb1')]('sendMail\x20message',JSON[_0x60dd('0xdd')](_0xb62f2));this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0xadce6b,_0xadce6b[_0x60dd('0x153')]);this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x15f'),_0x53b5bd[_0x60dd('0x12')]));this[_0x60dd('0x22')][_0x60dd('0x78')](this,_0x4eed3a,_0xb62f2);return this[_0x60dd('0xb')]['noop'](_0x60dd('0x160'));};AGIVertices['prototype'][_0x60dd('0x161')]=function(_0x5bdae0){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x162'),_0x5bdae0[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['noop'](_0x60dd('0x163'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x164')]=function(_0x16cce7){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x165'),_0x16cce7[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x16cce7[_0x60dd('0x166')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0x167'));}var _0x224deb=this[_0x60dd('0x31')][_0x60dd('0x78')](this,_0x16cce7[_0x60dd('0x166')]);if(!_0x224deb){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x16cce7,'no\x20sms\x20account\x20found');}var _0xc69546={'body':_0x16cce7[_0x60dd('0x168')],'phone':_0x16cce7['to']||'','SmsAccountId':_0x224deb['id']};logger[_0x60dd('0xb1')]('sendSMS\x20message',JSON[_0x60dd('0xdd')](_0xc69546));this[_0x60dd('0x34')]['sync'](this,_0x16cce7,_0x16cce7[_0x60dd('0x166')]);this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x169'),_0x224deb[_0x60dd('0x12')]));this[_0x60dd('0x33')]['sync'](this,_0xc69546);return this[_0x60dd('0xb')]['noop'](_0x60dd('0x16a'));};AGIVertices['prototype']['set']=function(_0x3c6579){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x16b'),_0x3c6579[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x3c6579[_0x60dd('0xa9')])){return this['channel']['error'](_0x3c6579,_0x60dd('0x16c'));}var _0x40cf43=this['getVariable'][_0x60dd('0x78')](this,_0x3c6579[_0x60dd('0xa9')]);if(!_0x40cf43){return this['channel']['error'](_0x3c6579,_0x60dd('0xab'));}return this[_0x60dd('0xb')][_0x60dd('0xae')](_0x40cf43,_0x3c6579['variable_value']);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x16d')]=function(_0xba4977){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20START\x20(%s)\x20block',_0xba4977[_0x60dd('0x35')]));this['channel']['noop'](_0x60dd('0x16e'));if(_0xba4977[_0x60dd('0x7c')]==='yes'){this[_0x60dd('0xb')][_0x60dd('0x88')]('Answer');return this[_0x60dd('0xb')][_0x60dd('0x7c')]();}return this['channel'][_0x60dd('0x88')](_0x60dd('0x16f'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x170')]=function(_0x1c53b8){logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x171'),_0x1c53b8[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x1c53b8['project_id'])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x1c53b8,_0x60dd('0x172'));}var _0x25f245=this[_0x60dd('0x15')][_0x60dd('0x78')](this,_0x1c53b8[_0x60dd('0x173')]);if(!this[_0x60dd('0x61')](_0x25f245)){return this[_0x60dd('0xb')]['error'](_0x1c53b8,util['format'](_0x60dd('0x174'),_0x1c53b8[_0x60dd('0x173')]));}if(_0x25f245===this['channel'][_0x60dd('0x37')]){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x1c53b8,_0x60dd('0x175'));}this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x1c53b8,_0x25f245);var _0x31595f=this[_0x60dd('0xb')]['exec'](_0x60dd('0x176'),util[_0x60dd('0x26')](_0x60dd('0x177'),config[_0x60dd('0x7')][_0x60dd('0x15a')]||'127.0.0.1',_0x25f245,this[_0x60dd('0xb')][_0x60dd('0x37')]));if(_0x31595f[_0x60dd('0x81')]===-0x1){return _0x31595f;}return this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x60dd('0x176'),_0x25f245));};AGIVertices['prototype'][_0x60dd('0x178')]=function(_0x47db33){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x179'),_0x47db33[_0x60dd('0x35')]));var _0x3b042a=this[_0x60dd('0x51')][_0x60dd('0x78')](this,_0x47db33[_0x60dd('0x7b')]);this[_0x60dd('0x34')]['sync'](this,_0x47db33,_0x47db33[_0x60dd('0x7b')]);if(this[_0x60dd('0x61')](_0x47db33[_0x60dd('0xa9')])){var _0x492269=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x47db33[_0x60dd('0xa9')]);if(_0x492269){this[_0x60dd('0xb')][_0x60dd('0xae')](_0x492269,_0x3b042a);return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x17a'),_0x47db33[_0x60dd('0x7b')],_0x492269));}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x47db33['command']));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x17b')]=function(_0x5310de){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x17c'),_0x5310de[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5310de[_0x60dd('0x56')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x17d'),_0x5310de['text']));var _0x2aad0c=this['googleTTS'][_0x60dd('0x78')](this,_0x5310de);if(_0x2aad0c){this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x17e'),_0x2aad0c));var _0x165da4=this[_0x60dd('0xb')]['streamFile'](_0x2aad0c);try{fs[_0x60dd('0xcb')](_0x2aad0c+_0x60dd('0x11f'));}catch(_0x4acfd4){logger[_0x60dd('0x28')](_0x4acfd4);}return _0x165da4;}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x5310de,_0x60dd('0x17f'));};AGIVertices[_0x60dd('0xe')]['unpause']=function(_0x568f15){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x568f15[_0x60dd('0x35')]));if(!this['isConfigured'](_0x568f15[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x568f15,_0x60dd('0x122'));}logger['info'](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));var _0x3b47e5=this['agentUnpause']['sync'](this,_0x568f15[_0x60dd('0x121')]);if(_0x3b47e5){logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x46fe3b){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x180'),_0x46fe3b[_0x60dd('0x35')]));var _0x1366b9=this['channel'][_0x60dd('0x52')]('VOICEMAIL',[_0x46fe3b[_0x60dd('0x181')],_0x46fe3b['options']]);if(_0x1366b9[_0x60dd('0x81')]===-0x1){return _0x1366b9;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x46fe3b[_0x60dd('0x181')]));};AGIVertices[_0x60dd('0xe')]['vswitch']=function(_0x51ca53){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x182'),_0x51ca53[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x51ca53[_0x60dd('0xa9')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x51ca53,_0x60dd('0x16c'));}var _0x4a26ba=this['getVariable']['sync'](this,_0x51ca53[_0x60dd('0xa9')]);if(!_0x4a26ba){return this[_0x60dd('0xb')]['error'](_0x51ca53,_0x60dd('0xab'));}var _0x4b1875=this[_0x60dd('0xb')][_0x60dd('0xf')](_0x4a26ba);return{'code':0xc8,'result':_0x4b1875[_0x60dd('0x76')]?_0x4b1875[_0x60dd('0x76')]:'-'};};String['prototype'][_0x60dd('0x75')]=function(_0x13eb4b,_0xc697ae){return this[_0x60dd('0x74')](_0x13eb4b)[_0x60dd('0x183')](_0xc697ae);};module['exports']=AGIVertices; \ No newline at end of file +var _0xc21e=['sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','service','host','port','secure','authentication','auth','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','no\x20sms\x20account\x20configured','sms_account_id','sendSMS\x20message','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','catch','prototype','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getTrunk','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createCmContact','isEmpty','isNil','callback_','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','googleTTS','text','google_tts_language','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','key','ispeech_asr_language','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','google_asr_language','tildeASR','appid','appsecret','uri','includes','clone','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','createSquareDetailsReport','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','noop','phone','custom_app','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','options','Executed\x20command\x20MRCPSynth\x20%s','sestektts','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','no\x20database\x20selected','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','no\x20text\x20configured','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','createSquareMessage','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','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','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','getData','test','mindigit','maxdigit','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','stringify','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','no\x20find\x20by\x20configured','getPause','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block'];(function(_0x4c3717,_0x36af39){var _0x469d32=function(_0xc3b55c){while(--_0xc3b55c){_0x4c3717['push'](_0x4c3717['shift']());}};_0x469d32(++_0x36af39);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xec21('0x0'));var _=require(_0xec21('0x1'));var sh=require(_0xec21('0x2'));var odbc=require(_0xec21('0x3'))();var rs=require(_0xec21('0x4'));var moment=require(_0xec21('0x5'));var Mustache=require('mustache');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var scripts=require(_0xec21('0x9'));var FILES_PATH=_0xec21('0xa');var verticesWithRetry=[_0xec21('0xb'),_0xec21('0xc'),_0xec21('0xd')];var AGIVertices=function(_0x51f6dc,_0x2b1396,_0x3d74a2){this[_0xec21('0xe')]=_0x51f6dc;this[_0xec21('0xf')]=_0x2b1396;this[_0xec21('0x10')]=_0x3d74a2;};AGIVertices['prototype'][_0xec21('0x11')]=function(_0x1d5e4b,_0x25a1bc){this['rpc']['getVariableById'](_0x1d5e4b)[_0xec21('0x12')](function(_0x276437){_0x25a1bc(null,_0x276437?_0x276437['name']:![]);})[_0xec21('0x13')](function(_0x2efc12){_0x25a1bc(_0x2efc12);});};AGIVertices[_0xec21('0x14')][_0xec21('0x15')]=function(_0xc1cca0,_0x5ee9f6){this[_0xec21('0xf')]['getVoiceQueueById'](_0xc1cca0)[_0xec21('0x12')](function(_0x1987f4){_0x5ee9f6(null,_0x1987f4?_0x1987f4[_0xec21('0x16')]:![]);})['catch'](function(_0x168cbd){_0x5ee9f6(_0x168cbd);});};AGIVertices[_0xec21('0x14')][_0xec21('0x17')]=function(_0x2c3124,_0x324853){this[_0xec21('0xf')][_0xec21('0x18')](_0x2c3124)[_0xec21('0x12')](function(_0x4fdb21){_0x324853(null,_0x4fdb21?_0x4fdb21[_0xec21('0x16')]:![]);})[_0xec21('0x13')](function(_0x2fcbcc){_0x324853(_0x2fcbcc);});};AGIVertices[_0xec21('0x14')][_0xec21('0x19')]=function(_0x1d901e,_0x90c3f5){this[_0xec21('0xf')][_0xec21('0x1a')](_0x1d901e)[_0xec21('0x12')](function(_0x4f4b12){_0x90c3f5(null,_0x4f4b12?_0x4f4b12['dsn']:![]);})[_0xec21('0x13')](function(_0x2f4ef9){_0x90c3f5(_0x2f4ef9);});};AGIVertices['prototype']['getUser']=function(_0x176b59,_0xa3d694){this[_0xec21('0xf')]['getUserById'](_0x176b59)[_0xec21('0x12')](function(_0x1f86d2){_0xa3d694(null,_0x1f86d2?_0x1f86d2[_0xec21('0x16')]:![]);})['catch'](function(_0x20ede9){_0xa3d694(_0x20ede9);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1b')]=function(_0x46fd9e,_0x3afe77){this[_0xec21('0xf')]['getTrunkById'](_0x46fd9e)[_0xec21('0x12')](function(_0x26cdae){_0x3afe77(null,_0x26cdae?_0x26cdae['name']:![]);})[_0xec21('0x13')](function(_0x5bfe85){_0x3afe77(_0x5bfe85);});};AGIVertices[_0xec21('0x14')]['getSound']=function(_0x4ef840,_0x1f398f){var _0x199974=this;this[_0xec21('0xf')][_0xec21('0x1c')](_0x4ef840)[_0xec21('0x12')](function(_0x5521e3){_0x1f398f(null,_0x5521e3?_0x199974[_0xec21('0x1d')](_0x5521e3['save_name']):![]);})[_0xec21('0x13')](function(_0x233bf9){_0x1f398f(_0x233bf9);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1e')]=function(_0x4dd56b,_0x1eb6de){this[_0xec21('0xf')][_0xec21('0x1f')](_0x4dd56b)[_0xec21('0x12')](function(_0xa0dea2){_0x1eb6de(null,_0xa0dea2?_0xa0dea2:![]);})[_0xec21('0x13')](function(_0x361b28){_0x1eb6de(_0x361b28);});};AGIVertices[_0xec21('0x14')][_0xec21('0x20')]=function(_0x1bfc3c,_0x43a2de,_0x57e004){this[_0xec21('0x10')][_0xec21('0x20')](_0x1bfc3c,_0x43a2de)[_0xec21('0x12')](function(){_0x57e004(null);})[_0xec21('0x13')](function(_0x4742ee){_0x57e004(_0x4742ee);});};AGIVertices['prototype'][_0xec21('0x21')]=function(_0x5dfc34,_0x528061){this['rpc'][_0xec21('0x22')](_0x5dfc34)[_0xec21('0x12')](function(_0x18dff8){if(_0x18dff8){if(_0x18dff8[_0xec21('0x23')]){_0x528061(null,[_0x18dff8[_0xec21('0x24')]]);}else{_0x528061(null,_[_0xec21('0x25')](_0x18dff8[_0xec21('0x26')],_0xec21('0x24')));}}else{_0x528061(null,![]);}})[_0xec21('0x13')](function(_0x1a7586){_0x528061(_0x1a7586);});};AGIVertices[_0xec21('0x14')][_0xec21('0x1d')]=function(_0x4d1ae3){return util[_0xec21('0x27')](_0xec21('0x28'),FILES_PATH,_0x4d1ae3);};AGIVertices['prototype'][_0xec21('0x29')]=function(_0x4d5859,_0x5eaa14,_0x453db6){odbc['open'](_0x4d5859,function(_0x4556c2){if(_0x4556c2){logger['error'](_0xec21('0x2a'),_0x4556c2);_0x453db6(_0x4556c2);}else{logger[_0xec21('0x2b')]('ODBC\x20connection\x20successfully');odbc[_0xec21('0x2c')](_0x5eaa14,function(_0x14fa33,_0x1d0d8c){if(_0x14fa33){logger['info'](_0xec21('0x2d'),_0x5eaa14);_0x453db6(_0x14fa33);}else{logger[_0xec21('0x2b')](_0xec21('0x2e'),_0x5eaa14);odbc['close'](function(_0x192354){if(_0x192354){logger[_0xec21('0x2f')](_0xec21('0x30'),_0x192354);}_0x453db6(null,_0x1d0d8c);});}});}});};AGIVertices[_0xec21('0x14')][_0xec21('0x31')]=function(_0x49b429,_0x28558f){this[_0xec21('0xf')]['getSmsAccountById'](_0x49b429)[_0xec21('0x12')](function(_0x54e642){_0x28558f(null,_0x54e642?_0x54e642:![]);})[_0xec21('0x13')](function(_0x18e20d){_0x28558f(_0x18e20d);});};AGIVertices[_0xec21('0x14')]['createSmsMessage']=function(_0x3a8730,_0x146930){this[_0xec21('0xf')][_0xec21('0x32')](_0x3a8730)['then'](function(_0x575e99){_0x146930(null,_0x575e99);})[_0xec21('0x13')](function(_0x506f08){_0x146930(_0x506f08);});};AGIVertices[_0xec21('0x14')]['createSquareDetailsReport']=function(_0x16a794,_0x52e024,_0x46d4f4){this[_0xec21('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'node':_0x16a794['label'],'application':_0x16a794[_0xec21('0x34')],'data':_0x52e024||null,'project_name':this[_0xec21('0xe')][_0xec21('0x35')],'callerid':this[_0xec21('0xe')][_0xec21('0x36')]})[_0xec21('0x12')](function(_0x3e3835){if(_0x46d4f4){_0x46d4f4(null,_0x3e3835);}})[_0xec21('0x13')](function(_0x459bc3){if(_0x46d4f4){_0x46d4f4(_0x459bc3);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x3f73d9,_0x354d39,_0x3f2a5c,_0x49e76f){this[_0xec21('0xf')][_0xec21('0x37')]({'uniqueid':this[_0xec21('0xe')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0xec21('0xe')][_0xec21('0x38')],'context':this[_0xec21('0xe')][_0xec21('0x39')],'extension':this[_0xec21('0xe')][_0xec21('0x3a')],'priority':this[_0xec21('0xe')]['priority'],'accountcode':this[_0xec21('0xe')][_0xec21('0x3b')],'dnid':this[_0xec21('0xe')][_0xec21('0x3c')],'projectName':this[_0xec21('0xe')][_0xec21('0x35')],'saveName':_0x354d39,'filename':_0x3f73d9[_0xec21('0x3d')]||_0x354d39,'savePath':_0x3f2a5c})[_0xec21('0x12')](function(_0x58cd1f){_0x49e76f(null,_0x58cd1f);})[_0xec21('0x13')](function(_0x21e67f){_0x49e76f(_0x21e67f);});};AGIVertices[_0xec21('0x14')]['createSquareMessage']=function(_0x5afbab,_0x51e954,_0x165d2d){this[_0xec21('0xf')]['createSquareMessage']({'uniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'body':_0x5afbab,'direction':_0x51e954})[_0xec21('0x12')](function(_0x5d28ce){if(_0x165d2d){_0x165d2d(null,_0x5d28ce);}})[_0xec21('0x13')](function(_0x5e90eb){if(_0x165d2d){_0x165d2d(_0x5e90eb);}});};AGIVertices[_0xec21('0x14')]['createCmContact']=function(_0x251a68,_0x3f86a5){this[_0xec21('0xf')][_0xec21('0x3e')]({'firstName':_[_0xec21('0x3f')](_0x251a68['name'])||_[_0xec21('0x40')](_0x251a68['name'])?_0xec21('0x41')+Math['random']():_0x251a68[_0xec21('0x16')],'lastName':_[_0xec21('0x3f')](_0x251a68[_0xec21('0x42')])||_[_0xec21('0x40')](_0x251a68[_0xec21('0x42')])?null:_0x251a68[_0xec21('0x42')],'phone':_0x251a68['phone'],'ListId':_0x251a68[_0xec21('0x43')],'scheduledAt':_0x251a68[_0xec21('0x44')],'callbackUniqueid':this[_0xec21('0xe')][_0xec21('0x33')],'tags':'callback','description':_0xec21('0x45')+_0x251a68[_0xec21('0x44')][_0xec21('0x46')](),'priority':_0x251a68['callback_priority']})['then'](function(_0x674ba7){_0x3f86a5(null,_0x674ba7);})['catch'](function(_0x38873a){_0x3f86a5(_0x38873a);});};AGIVertices[_0xec21('0x14')]['getPause']=function(_0x5ab10b,_0x477ccb){this[_0xec21('0xf')][_0xec21('0x47')](_0x5ab10b)[_0xec21('0x12')](function(_0x21159c){_0x477ccb(null,_0x21159c?_0x21159c[_0xec21('0x16')]:![]);})[_0xec21('0x13')](function(_0x41e4f3){_0x477ccb(_0x41e4f3);});};AGIVertices['prototype'][_0xec21('0x48')]=function(_0x4d9339,_0x2d60e7,_0x47d734){var _0x3f2d3e={'role':_0xec21('0x49')};_0x3f2d3e[_0x4d9339]=this[_0xec21('0xe')][_0xec21('0x36')];this[_0xec21('0xf')]['agentPause'](_0x3f2d3e,_0x2d60e7,this['channel']['uniqueid'])[_0xec21('0x12')](function(_0x5a1be8){_0x47d734(null,_[_0xec21('0x40')](_0x5a1be8)?![]:!![]);})[_0xec21('0x13')](function(_0x16448c){logger[_0xec21('0x2f')](_0x16448c);_0x47d734(null,![]);});};AGIVertices[_0xec21('0x14')][_0xec21('0x4a')]=function(_0xfe9c9e,_0x155725){var _0x47636a={'role':'agent'};_0x47636a[_0xfe9c9e]=this[_0xec21('0xe')]['callerid'];this[_0xec21('0xf')][_0xec21('0x4a')](_0x47636a)[_0xec21('0x12')](function(_0x53729e){_0x155725(null,_['isNil'](_0x53729e)?![]:!![]);})[_0xec21('0x13')](function(_0x5a375e){logger['error'](_0x5a375e);_0x155725(null,![]);});};AGIVertices[_0xec21('0x14')][_0xec21('0x4b')]=function(_0x3280c7,_0x55ff27){var _0x10cfbd={'role':_0xec21('0x49')};_0x10cfbd[_0x3280c7]=this[_0xec21('0xe')][_0xec21('0x36')];this[_0xec21('0xf')][_0xec21('0x4b')](_0x10cfbd)['then'](function(_0x6db048){_0x55ff27(null,_[_0xec21('0x40')](_0x6db048)?![]:!![]);})[_0xec21('0x13')](function(_0x1b6078){logger['error'](_0x1b6078);_0x55ff27(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1c601f,_0x3e74b7){var _0x36eda1={'role':_0xec21('0x49')};_0x36eda1[_0x1c601f]=this[_0xec21('0xe')][_0xec21('0x36')];var _0x25dd98=_0x1c601f!=_0xec21('0x4c')?util[_0xec21('0x27')](_0xec21('0x4d'),_0xec21('0x4e'),this[_0xec21('0xe')][_0xec21('0x36')]):undefined;this[_0xec21('0xf')][_0xec21('0x4f')](_0x36eda1,_0x25dd98)['then'](function(_0x18113b){_0x3e74b7(null,_[_0xec21('0x40')](_0x18113b)?![]:!![]);})[_0xec21('0x13')](function(_0x9273d2){logger['error'](_0x9273d2);_0x3e74b7(null,![]);});};AGIVertices['prototype'][_0xec21('0x50')]=function(_0x3ee7ca,_0xd9050){sh[_0xec21('0x51')](_['trim'](_0x3ee7ca),function(_0x3e4b39,_0x481fdc){var _0x4674cb=_0x481fdc['replace'](/(\r\n|\n|\r)/gm,'');_0xd9050(null,_0x4674cb);});};AGIVertices[_0xec21('0x14')][_0xec21('0x52')]=function(_0x1d4627,_0x5ed61d){scripts['googleTTS'](_0x1d4627[_0xec21('0x53')],_0x1d4627[_0xec21('0x54')]||'en',0x1)['then'](function(_0x53a8c2){_0x5ed61d(null,_0x53a8c2);})[_0xec21('0x13')](function(_0x1d7b6c){_0x5ed61d(_0x1d7b6c);});};AGIVertices['prototype']['googleDialogflow']=function(_0xfc9ed4,_0x34ae3f){scripts['googleDialogflow'](this[_0xec21('0xe')]['uniqueid'],_0xfc9ed4['key'],_0xfc9ed4[_0xec21('0x53')],_0xfc9ed4[_0xec21('0x55')]||'en')['then'](function(_0x2f973b){_0x34ae3f(null,_0x2f973b);})[_0xec21('0x13')](function(_0x55fac0){_0x34ae3f(_0x55fac0);});};AGIVertices[_0xec21('0x14')]['sestekNDA']=function(_0x5d822f,_0xde9c74){scripts[_0xec21('0x56')](this[_0xec21('0xe')],_0x5d822f)[_0xec21('0x12')](function(_0x19ce61){_0xde9c74(null,_0x19ce61);})[_0xec21('0x13')](function(_0x3e6468){_0xde9c74(_0x3e6468);});};AGIVertices[_0xec21('0x14')][_0xec21('0x57')]=function(_0x4aab85,_0x46f1f8){scripts[_0xec21('0x57')](_0x4aab85['key'],_0x4aab85['text'],_0x4aab85[_0xec21('0x58')]||_0xec21('0x59'),_0x4aab85[_0xec21('0x5a')])[_0xec21('0x12')](function(_0x3513f4){_0x46f1f8(null,_0x3513f4);})[_0xec21('0x13')](function(_0x535b20){_0x46f1f8(_0x535b20);});};AGIVertices[_0xec21('0x14')][_0xec21('0x5b')]=function(_0x2d61ce,_0x2f1449,_0x1f1dd4){scripts[_0xec21('0x5b')](_0x2f1449,_0x2d61ce[_0xec21('0x5c')],_0x2d61ce[_0xec21('0x5d')]||_0xec21('0x59'),this[_0xec21('0x5e')](_0x2d61ce[_0xec21('0x5f')])?_0x2d61ce[_0xec21('0x5f')]:undefined)[_0xec21('0x12')](function(_0x50d547){_0x1f1dd4(null,_0x50d547);})['catch'](function(_0x318255){_0x1f1dd4(_0x318255);});};AGIVertices['prototype'][_0xec21('0x60')]=function(_0xf2227c,_0x3898e8){scripts[_0xec21('0x60')](_0xf2227c[_0xec21('0x61')],_0xf2227c[_0xec21('0x62')],_0xf2227c[_0xec21('0x63')],_0xf2227c[_0xec21('0x64')]||_0xec21('0x65'),_0xf2227c['text'],_0xf2227c[_0xec21('0x66')]||_0xec21('0x53'))['then'](function(_0xfee0b1){_0x3898e8(null,_0xfee0b1);})[_0xec21('0x13')](function(_0x1cbca1){_0x3898e8(_0x1cbca1);});};AGIVertices[_0xec21('0x14')][_0xec21('0x67')]=function(_0x1b5ecf,_0x1109cc){scripts[_0xec21('0x67')](this[_0xec21('0xe')][_0xec21('0x33')],_0x1b5ecf[_0xec21('0x61')],_0x1b5ecf[_0xec21('0x62')],_0x1b5ecf[_0xec21('0x68')],_0x1b5ecf[_0xec21('0x53')],_0x1b5ecf[_0xec21('0x69')])['then'](function(_0x138d1c){_0x1109cc(null,_0x138d1c);})[_0xec21('0x13')](function(_0x137c10){_0x1109cc(_0x137c10);});};AGIVertices[_0xec21('0x14')][_0xec21('0x6a')]=function(_0xaac4f7,_0x3f3bf0,_0x595f59){scripts[_0xec21('0x6a')](_0x3f3bf0,_0xaac4f7[_0xec21('0x5c')],_0xaac4f7[_0xec21('0x6b')]||_0xec21('0x59'))['then'](function(_0x40e19a){_0x595f59(null,_0x40e19a);})['catch'](function(_0x2db996){_0x595f59(_0x2db996);});};AGIVertices['prototype'][_0xec21('0x6c')]=function(_0x5b939c,_0x4b13a3,_0xc7ba9d){scripts[_0xec21('0x6c')](_0x4b13a3,_0x5b939c[_0xec21('0x6d')],_0x5b939c[_0xec21('0x6e')],_0x5b939c[_0xec21('0x6f')])[_0xec21('0x12')](function(_0x4dd684){_0xc7ba9d(null,_0x4dd684);})[_0xec21('0x13')](function(_0x2a606d){_0xc7ba9d(_0x2a606d);});};AGIVertices['prototype']['clear']=function(_0x2cbd81){var _0xfb706c=_[_0xec21('0x70')](verticesWithRetry,_0x2cbd81['agicommand'])?_0x2cbd81:_[_0xec21('0x71')](_0x2cbd81);for(var _0x2ddc2a in _0xfb706c){if(_0xfb706c['hasOwnProperty'](_0x2ddc2a)){if(_0xfb706c[_0x2ddc2a]&&_[_0xec21('0x72')](_0xfb706c[_0x2ddc2a])){_0xfb706c[_0x2ddc2a]=this[_0xec21('0x73')](_0xfb706c[_0x2ddc2a]);}}}return _0xfb706c;};AGIVertices[_0xec21('0x14')][_0xec21('0x73')]=function(_0x478f7a){var _0x45d2fc=_0x478f7a[_0xec21('0x74')]('{');for(var _0xb3f47b=0x1;_0xb3f47b<_0x45d2fc[_0xec21('0x75')];_0xb3f47b+=0x1){var _0x27a859=_0x45d2fc[_0xb3f47b]['split']('}');if(_0x27a859['length']>0x1){_0x478f7a=_0x478f7a[_0xec21('0x76')]('{'+_0x27a859[0x0]+'}',this['channel'][_0xec21('0x11')](_0x27a859[0x0])[_0xec21('0x77')]||_0x27a859[0x0]);}}if(_0x45d2fc[_0xec21('0x75')]===0x1){return _0x478f7a[_0xec21('0x46')]();}return this[_0xec21('0x73')](_0x478f7a);};AGIVertices[_0xec21('0x14')][_0xec21('0x78')]=function(_0x1b2205,_0x35bd80){var _0x58491e=this[_0xec21('0xe')][_0xec21('0x11')](_0x1b2205);if(_0x58491e[_0xec21('0x79')]===-0x1){return _0x58491e;}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x7a'),_0x35bd80,_0x58491e[_0xec21('0x77')]));return this['channel']['setVariable'](_0x35bd80,_0x58491e[_0xec21('0x77')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x5e')]=function(_0x43d13a){return _0x43d13a&&_0x43d13a!=='0'&&_0x43d13a!=='-1'&&_0x43d13a!=='';};AGIVertices['prototype'][_0xec21('0x7b')]=function(_0x37df7c){this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x37df7c,'-');_0x37df7c[_0xec21('0x7e')]=_0x37df7c[_0xec21('0x7b')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xec21('0x14')][_0xec21('0x7')]=function(_0x4b85e8){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x7f'),_0x4b85e8[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x7')]([_0x4b85e8[_0xec21('0x81')],_0x4b85e8[_0xec21('0x82')]]);};AGIVertices[_0xec21('0x14')][_0xec21('0x83')]=function(_0x148f67){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x148f67['label']));if(this[_0xec21('0x5e')](_0x148f67[_0xec21('0x84')])){logger['info'](util[_0xec21('0x27')](_0xec21('0x85'),_0x148f67[_0xec21('0x84')]));var _0x59eb56=this[_0xec21('0xe')][_0xec21('0x86')](_0x148f67[_0xec21('0x84')]);if(_0x59eb56[_0xec21('0x79')]===-0x1){return _0x59eb56;}}return this[_0xec21('0xe')][_0xec21('0x83')]();};AGIVertices[_0xec21('0x14')][_0xec21('0x87')]=function(_0x4c4eb5){logger['info'](util[_0xec21('0x27')](_0xec21('0x88'),_0x4c4eb5[_0xec21('0x80')]));if(!this['isConfigured'](_0x4c4eb5[_0xec21('0x43')])){return this['channel'][_0xec21('0x2f')](_0x4c4eb5,_0xec21('0x89'));}_0x4c4eb5[_0xec21('0x44')]=moment();if(this[_0xec21('0x5e')](_0x4c4eb5[_0xec21('0x8a')])){_0x4c4eb5[_0xec21('0x44')]=moment()['add'](_0x4c4eb5[_0xec21('0x8a')],_0xec21('0x8b'));}if(!this[_0xec21('0x5e')](_0x4c4eb5[_0xec21('0x8c')])){_0x4c4eb5['callback_priority']=0x2;}this[_0xec21('0x3e')][_0xec21('0x7d')](this,_0x4c4eb5);return this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4c4eb5[_0xec21('0x8e')],_0x4c4eb5[_0xec21('0x43')],_0x4c4eb5[_0xec21('0x44')]));};AGIVertices[_0xec21('0x14')][_0xec21('0x8f')]=function(_0x59237f){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x59237f[_0xec21('0x80')]));var _0x5cdce6=this[_0xec21('0xe')]['exec'](_0x59237f[_0xec21('0x90')],_0x59237f['options']);if(_0x5cdce6[_0xec21('0x79')]===-0x1){return _0x5cdce6;}return this['channel']['noop'](util[_0xec21('0x27')]('Executed\x20command\x20%s\x20%s',_0x59237f[_0xec21('0x90')],_0x59237f['options']));};AGIVertices[_0xec21('0x14')]['lumenvoxtts']=function(_0x11b1c2){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x91'),_0x11b1c2['label']));if(!this[_0xec21('0x5e')](_0x11b1c2['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x4fbb58='\x22'+_0x11b1c2[_0xec21('0x53')]+'\x22';if(this[_0xec21('0x5e')](_0x11b1c2['options'])){_0x4fbb58+=','+_0x11b1c2[_0xec21('0x92')];}var _0x37e4fe=this[_0xec21('0xe')][_0xec21('0x51')]('MRCPSynth',_0x4fbb58);if(_0x37e4fe[_0xec21('0x79')]===-0x1){return _0x37e4fe;}return this['channel']['noop'](util[_0xec21('0x27')](_0xec21('0x93'),_0x4fbb58));};AGIVertices['prototype'][_0xec21('0x94')]=function(_0x46400c){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x46400c['label']));if(!this[_0xec21('0x5e')](_0x46400c[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')]('no\x20text\x20configured');}var _0x7112c='\x22'+_0x46400c[_0xec21('0x53')]+'\x22';if(this[_0xec21('0x5e')](_0x46400c[_0xec21('0x92')])){_0x7112c+=','+_0x46400c[_0xec21('0x92')];}var _0x42be15=this['channel'][_0xec21('0x51')](_0xec21('0x95'),_0x7112c);if(_0x42be15[_0xec21('0x79')]===-0x1){return _0x42be15;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x93'),_0x7112c));};AGIVertices[_0xec21('0x14')][_0xec21('0x96')]=function(_0x607101){logger[_0xec21('0x2b')](util['format'](_0xec21('0x97'),_0x607101['label']));if(!this[_0xec21('0x5e')](_0x607101[_0xec21('0x98')])){return this[_0xec21('0xe')]['noop'](_0xec21('0x99'));}var _0x4ff3ee=_0x607101[_0xec21('0x98')];if(this[_0xec21('0x5e')](_0x607101[_0xec21('0x92')])){_0x4ff3ee+=','+_0x607101[_0xec21('0x92')];}var _0x2c90eb=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0x9a'),_0x4ff3ee);if(_0x2c90eb[_0xec21('0x79')]===-0x1){return _0x2c90eb;}var _0x4cf8e9=this[_0xec21('0x78')](_0xec21('0x9b'),_0xec21('0x9c'));if(_0x4cf8e9[_0xec21('0x79')]===-0x1){return _0x4cf8e9;}var _0x3e8a4f=this['getAndSetVariable'](_0xec21('0x9d'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e8a4f[_0xec21('0x79')]===-0x1){return _0x3e8a4f;}var _0x5af495=this[_0xec21('0x78')](_0xec21('0x9e'),'LUMENVOX_ASR_INSTANCE');if(_0x5af495[_0xec21('0x79')]===-0x1){return _0x5af495;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x9f'),_0x4ff3ee));};AGIVertices[_0xec21('0x14')][_0xec21('0xa0')]=function(_0x44da78){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x44da78[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x44da78[_0xec21('0x98')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x99'));}var _0x5e52e2=_0x44da78[_0xec21('0x98')];if(this[_0xec21('0x5e')](_0x44da78[_0xec21('0x92')])){_0x5e52e2+=','+_0x44da78[_0xec21('0x92')];}var _0x213e30=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0x9a'),_0x5e52e2);if(_0x213e30['result']===-0x1){return _0x213e30;}var _0x56f67d=this[_0xec21('0x78')](_0xec21('0x9b'),_0xec21('0xa1'));if(_0x56f67d[_0xec21('0x79')]===-0x1){return _0x56f67d;}var _0x45e14a=this[_0xec21('0x78')](_0xec21('0x9d'),_0xec21('0xa2'));if(_0x45e14a[_0xec21('0x79')]===-0x1){return _0x45e14a;}var _0x3f8bb4=this[_0xec21('0x78')](_0xec21('0x9e'),'SESTEK_ASR_INSTANCE');if(_0x3f8bb4['result']===-0x1){return _0x3f8bb4;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x9f'),_0x5e52e2));};AGIVertices['prototype'][_0xec21('0xa3')]=function(_0x4d473d){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x4d473d[_0xec21('0x80')]));if(!this['isConfigured'](_0x4d473d['odbc_id'])){return this['channel'][_0xec21('0x2f')](_0x4d473d,_0xec21('0xa4'));}var _0xffe99a=this[_0xec21('0x19')][_0xec21('0x7d')](this,_0x4d473d['odbc_id']);if(!_0xffe99a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,'no\x20odbc\x20database\x20found');}if(!this[_0xec21('0x5e')](_0x4d473d['query'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,'no\x20query\x20configured');}var _0x2b99ce=_0x4d473d[_0xec21('0x2c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0xa5'),_0x2b99ce));var _0x3c5a2a=this['getQueryOdbc'][_0xec21('0x7d')](this,_0xffe99a,_0x2b99ce);this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x4d473d,_0x2b99ce);if(!this[_0xec21('0x5e')](_0x4d473d[_0xec21('0xa6')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xa7'));}var _0x336ac0=this['getVariable'][_0xec21('0x7d')](this,_0x4d473d['variable_id']);if(!_0x336ac0){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4d473d,_0xec21('0xa8'));}var _0x239b81=this;_0x3c5a2a[_0xec21('0xa9')](function(_0x3201d3,_0x1c8360){Object[_0xec21('0xaa')](_0x3201d3)[_0xec21('0xa9')](function(_0x588c33){_0x239b81['channel']['setVariable'](util[_0xec21('0x27')](_0xec21('0xab'),_0x336ac0,_0x1c8360,_0x588c33),_0x3201d3[_0x588c33]);});});this['channel'][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0xad'),_0x336ac0),_0x3c5a2a['length']);return this['channel']['noop'](util[_0xec21('0x27')](_0xec21('0xae'),_0x336ac0));};AGIVertices[_0xec21('0x14')][_0xec21('0xaf')]=function(_0x3ef59f){logger[_0xec21('0xb0')](util['format'](_0xec21('0xb1'),_0x3ef59f[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x3ef59f[_0xec21('0xb2')])){return this['channel']['error'](_0x3ef59f,_0xec21('0xb3'));}var _0x17cbbf=this['getUser']['sync'](this,_0x3ef59f['sip_id']);if(!_0x17cbbf){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3ef59f,'no\x20user\x20found');}var _0x14d4f0=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0xb4'),[util[_0xec21('0x27')]('SIP/%s',_0x17cbbf),_0x3ef59f[_0xec21('0x84')],_0x3ef59f['opts'],_0x3ef59f[_0xec21('0xb5')]]);if(_0x14d4f0['result']===-0x1){return _0x14d4f0;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('Executed\x20command\x20%s',_0xec21('0xb4')));};AGIVertices[_0xec21('0x14')][_0xec21('0xb6')]=function(_0x242756){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xb7'),_0x242756[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x242756[_0xec21('0x5c')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}if(!this[_0xec21('0x5e')](_0x242756[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')][_0xec21('0xba')]=!![];this['createSquareDetailsReport'](_0x242756);this['createSquareMessage'](_0x242756['text'],'in');this['channel'][_0xec21('0x8d')](util['format'](_0xec21('0xbb'),_0x242756[_0xec21('0x53')]));var _0x11dd67=this['googleDialogflow']['sync'](this,_0x242756);if(_0x11dd67){for(var _0x51665c in _0x11dd67){if(_0x11dd67[_0xec21('0xbc')](_0x51665c)){this[_0xec21('0xe')]['setVariable'](util['format'](_0xec21('0xbd'),_0x51665c[_0xec21('0xbe')]()),_0x11dd67[_0x51665c]);}}this[_0xec21('0xbf')](_0x11dd67[_0xec21('0xc0')],_0xec21('0xc1'));return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0xc2'),_0x11dd67[_0xec21('0xc0')]));}return this[_0xec21('0xe')]['error'](_0x242756,_0xec21('0xc3'));};AGIVertices[_0xec21('0x14')][_0xec21('0xc4')]=function(_0x46b266){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x46b266[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x46b266[_0xec21('0xc5')])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x46b266[_0xec21('0xc6')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xc7'));}if(!this['isConfigured'](_0x46b266[_0xec21('0xc8')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xc9'));}if(!this['isConfigured'](_0x46b266[_0xec21('0xca')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')]['bot']=!![];this[_0xec21('0x7c')](_0x46b266);this[_0xec21('0xbf')](_0x46b266['text'],'in');this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xcb'),_0x46b266['text']));var _0x46703a=this['sestekNDA']['sync'](this,_0x46b266);if(_0x46703a){for(var _0x23a914 in _0x46703a){if(_0x46703a[_0xec21('0xbc')](_0x23a914)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0xcc'),_0x23a914[_0xec21('0xbe')]()),_0x46703a[_0x23a914]);}}this[_0xec21('0xbf')](_0x46703a[_0xec21('0xc0')],'out');if(_0x46703a[_0xec21('0xcd')]){this['channel']['noop'](util['format'](_0xec21('0xce'),_0x46703a[_0xec21('0xcd')]));var _0x1494c6=this[_0xec21('0xe')]['streamFile'](_0x46703a['audiofile']);try{fs[_0xec21('0xcf')](_0x46703a[_0xec21('0xcd')]+_0xec21('0xd0'));}catch(_0x382378){logger['error'](_0x382378);}return _0x1494c6;}else{return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0xd1'),_0x46703a[_0xec21('0xc0')]));}}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x46b266,_0xec21('0xd2'));};AGIVertices[_0xec21('0x14')][_0xec21('0xd3')]=function(_0x552c19){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xd4'),_0x552c19[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xd3'));};AGIVertices['prototype']['ext_dial']=function(_0x4a23c9){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xd5'),_0x4a23c9['label']));var _0x5d5e3c='';if(_0x4a23c9[_0xec21('0xd6')]){if(!this[_0xec21('0x5e')](_0x4a23c9[_0xec21('0xd6')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4a23c9,'no\x20trunk\x20selected');}else{var _0x2fbf81=parseInt(_0x4a23c9[_0xec21('0xd6')],0xa);if(isNaN(_0x2fbf81)){_0x5d5e3c=_0x4a23c9[_0xec21('0xd6')];}else{_0x5d5e3c=this[_0xec21('0x1b')][_0xec21('0x7d')](this,_0x4a23c9[_0xec21('0xd6')]);if(!_0x5d5e3c){return this['channel'][_0xec21('0x2f')](_0x4a23c9,'no\x20trunk\x20found');}}}}else if(_0x4a23c9[_0xec21('0xd7')]){_0x5d5e3c=_0x4a23c9[_0xec21('0xd7')];}else{return this[_0xec21('0xe')]['error'](_0x4a23c9,_0xec21('0xd8'));}var _0x559b97=this[_0xec21('0xe')][_0xec21('0x51')](_0xec21('0xb4'),[util[_0xec21('0x27')](_0xec21('0xd9'),_0x5d5e3c,_0x4a23c9['phone']),_0x4a23c9[_0xec21('0x84')],_0x4a23c9[_0xec21('0xda')],_0x4a23c9[_0xec21('0xb5')]]);if(_0x559b97[_0xec21('0x79')]===-0x1){return _0x559b97;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0xdb'),'DIAL'));};AGIVertices[_0xec21('0x14')][_0xec21('0xdc')]=function(_0x4b40df){logger[_0xec21('0x2b')](util['format'](_0xec21('0xdd'),_0x4b40df['label']));return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xdc'));};AGIVertices[_0xec21('0x14')]['getdigits']=function(_0x3f5a5a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xde'),_0x3f5a5a[_0xec21('0x80')]));if(_0x3f5a5a['retry']===0x0){return this[_0xec21('0x7b')](_0x3f5a5a);}_0x3f5a5a[_0xec21('0x7e')]-=0x1;if(!this[_0xec21('0x5e')](_0x3f5a5a[_0xec21('0xdf')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,_0xec21('0xe0'));}var _0x5d1971=this[_0xec21('0xe1')]['sync'](this,_0x3f5a5a[_0xec21('0xdf')]);if(!_0x5d1971){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3f5a5a[_0xec21('0xa6')])){return this[_0xec21('0xe')]['error'](_0xec21('0xa7'));}var _0x7944e5=this[_0xec21('0xe')][_0xec21('0xe2')](_0x5d1971,_0x3f5a5a['response'],_0x3f5a5a['maxdigit']);var _0x1f7719=_0x7944e5[_0xec21('0x79')]?_0x7944e5[_0xec21('0x79')][_0xec21('0x46')]():'';logger['info'](_0xec21('0xe3'),JSON['stringify'](_0x7944e5));if(_0x7944e5['result']===-0x1){this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,_0x1f7719);return _0x7944e5;}else if(_0x7944e5[_0xec21('0x77')]===_0xec21('0x84')){_0x7944e5[_0xec21('0x79')]=_0x1f7719[_0xec21('0x75')]>=parseInt(_0x3f5a5a[_0xec21('0xe4')])?'x':'i';}else{_0x7944e5[_0xec21('0x79')]=_0x1f7719[_0xec21('0x75')]>=parseInt(_0x3f5a5a[_0xec21('0xe4')])&&_0x1f7719['length']<=parseInt(_0x3f5a5a[_0xec21('0xe5')])?'x':'i';}var _0x2afee7=this['getVariable'][_0xec21('0x7d')](this,_0x3f5a5a[_0xec21('0xa6')]);if(!_0x2afee7){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x3f5a5a,_0xec21('0xa8'));}this[_0xec21('0xe')][_0xec21('0xac')](_0x2afee7,_0x1f7719);if(this[_0xec21('0x5e')](_0x3f5a5a['hiddendigitsnum'])){var _0x5d1268=parseInt(_0x3f5a5a['hiddendigitsnum'],0xa);var _0x4f8ed5=rs['generate']({'charset':'*','length':_0x5d1268});var _0x53d61b=_0x1f7719[_0xec21('0x75')];if(_0x53d61b>0x0){if(_0x53d61b>_0x5d1268){this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x3f5a5a,_0x3f5a5a[_0xec21('0xe6')]===_0xec21('0xe7')?_0x4f8ed5+_0x1f7719[_0xec21('0xe8')](_0x5d1268):_0x1f7719[_0xec21('0xe8')](0x0,_0x53d61b-_0x5d1268)+_0x4f8ed5);}else{this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,rs[_0xec21('0xe9')]({'charset':'*','length':_0x53d61b}));}}else{this[_0xec21('0x7c')]['sync'](this,_0x3f5a5a,'');}}else{this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x3f5a5a,_0x1f7719);}return _0x7944e5;};AGIVertices[_0xec21('0x14')]['getsecretdigits']=function(_0x18f3e5){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xea'),_0x18f3e5[_0xec21('0x80')]));return this[_0xec21('0xc')](_0x18f3e5);};AGIVertices['prototype'][_0xec21('0xeb')]=function(_0xadbf1a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xec'),_0xadbf1a['label']));this[_0xec21('0x7c')]['sync'](this,_0xadbf1a,_0xadbf1a['goalname']);return this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')]('GOAL\x20%s',_0xadbf1a['goalname']));};AGIVertices[_0xec21('0x14')][_0xec21('0xed')]=function(_0x20b693){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0xee'),_0x20b693['label']));if(!this[_0xec21('0x5e')](_0x20b693['aws_access_key_id'])||!this[_0xec21('0x5e')](_0x20b693[_0xec21('0x62')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xef'));}if(!this[_0xec21('0x5e')](_0x20b693['text'])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf0'),_0x20b693[_0xec21('0x53')]));var _0x394e73=this['awsPolly'][_0xec21('0x7d')](this,_0x20b693);if(_0x394e73){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf1'),_0x394e73));var _0x4c418a=this[_0xec21('0xe')][_0xec21('0xf2')](_0x394e73);try{fs[_0xec21('0xcf')](_0x394e73+'.wav');}catch(_0x35a82f){logger[_0xec21('0x2f')](_0x35a82f);}return _0x4c418a;}return this['channel'][_0xec21('0x2f')](_0x20b693,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xec21('0x14')][_0xec21('0xf3')]=function(_0x157cbe){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x157cbe[_0xec21('0x80')]));if(!this['isConfigured'](_0x157cbe[_0xec21('0x61')])||!this[_0xec21('0x5e')](_0x157cbe['aws_secret_access_key'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xef'));}if(!this[_0xec21('0x5e')](_0x157cbe[_0xec21('0x69')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xf4'));}if(!this[_0xec21('0x5e')](_0x157cbe[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')]['bot']=!![];this[_0xec21('0x7c')](_0x157cbe);this[_0xec21('0xbf')](_0x157cbe[_0xec21('0x53')],'in');this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0xf5'),_0x157cbe['text']));var _0x9379d6=this[_0xec21('0x67')]['sync'](this,_0x157cbe);if(_0x9379d6){for(var _0x31bf00 in _0x9379d6){if(_0x9379d6[_0xec21('0xbc')](_0x31bf00)&&_[_0xec21('0x72')](_0x9379d6[_0x31bf00])){this[_0xec21('0xe')]['setVariable'](util[_0xec21('0x27')](_0xec21('0xf6'),_0x31bf00[_0xec21('0xbe')]()),_0x9379d6[_0x31bf00]);}}if(_[_0xec21('0x40')](_0x9379d6['message'])){return this['channel'][_0xec21('0x8d')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xec21('0xbf')](_0x9379d6[_0xec21('0xf7')],_0xec21('0xc1'));return this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0xf8'),_0x9379d6[_0xec21('0xf7')]));}}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x157cbe,_0xec21('0xf9'));};AGIVertices[_0xec21('0x14')]['googleasr']=function(_0x785bc7){logger['info'](util['format'](_0xec21('0xfa'),_0x785bc7[_0xec21('0x80')],_0x785bc7[_0xec21('0x84')]));if(!this[_0xec21('0x5e')](_0x785bc7[_0xec21('0x5c')])){return this['channel'][_0xec21('0x8d')](_0xec21('0xb8'));}var _0x5f08b5=_0xec21('0xfb');var _0x7316a3=util['format'](_0xec21('0xfc'),FILES_PATH,rs['generate'](0x4));var _0x513e1=util['format'](_0xec21('0xfd'),_0x7316a3,_0x5f08b5);var _0x36d84c=!![];if(_0x785bc7[_0xec21('0xfe')]===_0xec21('0xff')){_0x36d84c=![];}var _0x14245a=this[_0xec21('0xe')]['recordFile'](_0x7316a3,_0x5f08b5,_0x785bc7[_0xec21('0x100')],_0x785bc7[_0xec21('0x84')],undefined,_0x36d84c);if(_0x14245a[_0xec21('0x79')]!==-0x1){this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x101'),_0x513e1));var _0x5f235e=this[_0xec21('0x6a')][_0xec21('0x7d')](this,_0x785bc7,_0x513e1);if(_0x5f235e){for(var _0x33f413 in _0x5f235e){if(_0x5f235e[_0xec21('0xbc')](_0x33f413)){this[_0xec21('0xe')][_0xec21('0xac')](util['format'](_0xec21('0x102'),_0x33f413[_0xec21('0xbe')]()),_0x5f235e[_0x33f413]);}}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0xec21('0x103')](_0x5f235e)));}}return _0x14245a;};AGIVertices[_0xec21('0x14')]['tildeasr']=function(_0x4c5829){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4c5829[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x4c5829[_0xec21('0x6d')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x104'));}if(!this[_0xec21('0x5e')](_0x4c5829[_0xec21('0x6e')])){return this[_0xec21('0xe')][_0xec21('0x8d')]('no\x20appsecret\x20configured');}var _0x5bff2a='wav';var _0x25d96f=util['format'](_0xec21('0xfc'),FILES_PATH,rs[_0xec21('0xe9')](0x4));var _0x358e4e=util['format']('%s.%s',_0x25d96f,_0x5bff2a);var _0x1a705e=!![];if(_0x4c5829['beep']===_0xec21('0xff')){_0x1a705e=![];}var _0x2fdf09=this[_0xec21('0xe')]['recordFile'](_0x25d96f,_0x5bff2a,_0x4c5829[_0xec21('0x100')],_0x4c5829[_0xec21('0x84')],undefined,_0x1a705e);if(_0x2fdf09[_0xec21('0x79')]!==-0x1){this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x105'),_0x358e4e));var _0x5d9d4d=this[_0xec21('0x6c')][_0xec21('0x7d')](this,_0x4c5829,_0x358e4e);if(_0x5d9d4d){for(var _0x4f0363 in _0x5d9d4d){if(_0x5d9d4d['hasOwnProperty'](_0x4f0363)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x106'),_0x4f0363[_0xec21('0xbe')]()),_0x5d9d4d[_0x4f0363]);}}return this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x107'),JSON[_0xec21('0x103')](_0x5d9d4d)));}}return _0x2fdf09;};AGIVertices[_0xec21('0x14')]['gotoc']=function(_0x5803e3){logger['info'](util['format'](_0xec21('0x108'),_0x5803e3['label']));return this[_0xec21('0xe')][_0xec21('0x109')](_0x5803e3[_0xec21('0x39')],_0x5803e3[_0xec21('0x3a')],_0x5803e3[_0xec21('0x10a')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x10b')]=function(_0x1fc31c){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x10c'),_0x1fc31c['label']));if(!this[_0xec21('0x5e')](_0x1fc31c[_0xec21('0x10d')])){return this['channel']['error'](_0x1fc31c,_0xec21('0x10e'));}try{var _0xfc82f=eval(_0x1fc31c[_0xec21('0x10d')])?_0xec21('0x10f'):_0xec21('0x110');this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x111'),_0x1fc31c[_0xec21('0x10d')],_0xfc82f));return{'code':0xc8,'result':_0xfc82f};}catch(_0x1631a5){return{'code':0xc8,'result':_0xec21('0x110')};}};AGIVertices['prototype'][_0xec21('0x112')]=function(_0x4ee0df){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4ee0df[_0xec21('0x80')]));if(!this['isConfigured'](_0x4ee0df['interval_id'])){return this['channel']['error'](_0x4ee0df,_0xec21('0x113'));}var _0x4638d0=this['getIntervals'][_0xec21('0x7d')](this,_0x4ee0df[_0xec21('0x114')]);if(!_0x4638d0){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ee0df,_0xec21('0x115'));}for(var _0x36e272=0x0;_0x36e272<_0x4638d0[_0xec21('0x75')];_0x36e272+=0x1){var _0x237783=this[_0xec21('0xe')]['getVariable'](util[_0xec21('0x27')]('IFTIME(%s?true:false)',_0x4638d0[_0x36e272]));if(_0x237783[_0xec21('0x79')]===-0x1){return _0x237783;}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0x237783['extra']));if(_0x237783[_0xec21('0x77')]===_0xec21('0x10f')){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x10f')));this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x10f')));return{'code':0xc8,'result':_0xec21('0x10f')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x110')));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x116'),_0x4638d0[_0x36e272],_0xec21('0x110')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xec21('0x14')][_0xec21('0x117')]=function(_0x419b5a){logger[_0xec21('0x2b')](util['format'](_0xec21('0x118'),_0x419b5a[_0xec21('0x80')]));return this[_0xec21('0xe')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x526cdb){logger[_0xec21('0x2b')](util['format'](_0xec21('0x119'),_0x526cdb[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x526cdb['key'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}var _0x2e6f28=_0xec21('0xfb');var _0x38d2ff=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xec21('0xe9')](0x4));var _0x3eb7d2=util[_0xec21('0x27')](_0xec21('0xfd'),_0x38d2ff,_0x2e6f28);var _0x61fd8e=!![];if(_0x526cdb['beep']===_0xec21('0xff')){_0x61fd8e=![];}var _0x12edea=this['channel']['recordFile'](_0x38d2ff,_0x2e6f28,_0x526cdb[_0xec21('0x100')],_0x526cdb[_0xec21('0x84')],undefined,_0x61fd8e);if(_0x12edea['result']!==-0x1){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11a'),_0x3eb7d2));var _0x44561c=this[_0xec21('0x5b')]['sync'](this,_0x526cdb,_0x3eb7d2);if(_0x44561c){for(var _0x3ce344 in _0x44561c){if(_0x44561c[_0xec21('0xbc')](_0x3ce344)){this[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x11b'),_0x3ce344[_0xec21('0xbe')]()),_0x44561c[_0x3ce344]);}}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x11c'),JSON['stringify'](_0x44561c)));}}return _0x12edea;};AGIVertices[_0xec21('0x14')][_0xec21('0x11d')]=function(_0x19989f){logger['info'](util[_0xec21('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x19989f[_0xec21('0x80')]));if(!this['isConfigured'](_0x19989f[_0xec21('0x5c')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb8'));}if(!this[_0xec21('0x5e')](_0x19989f[_0xec21('0x53')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xb9'));}this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11e'),_0x19989f[_0xec21('0x53')]));var _0x203f3e=this['ispeechTTS'][_0xec21('0x7d')](this,_0x19989f);if(_0x203f3e){this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x11a'),_0x203f3e));var _0x127fe6=this['channel'][_0xec21('0xf2')](_0x203f3e,_0x19989f[_0xec21('0x100')]);try{fs[_0xec21('0xcf')](_0x203f3e+_0xec21('0xd0'));}catch(_0x33c9c3){logger[_0xec21('0x2f')](_0x33c9c3);}return _0x127fe6;}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x19989f,_0xec21('0x11f'));};AGIVertices[_0xec21('0x14')][_0xec21('0x120')]=function(_0x562cd2){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x562cd2[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x562cd2['findBy'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x562cd2,'no\x20find\x20by\x20configured');}logger['info'](util[_0xec21('0x27')](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2[_0xec21('0x122')]));var _0x225df1=this[_0xec21('0x4f')][_0xec21('0x7d')](this,_0x562cd2['findBy']);if(_0x225df1){logger[_0xec21('0x2b')](util['format'](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')]['callerid'],_0x562cd2['findBy']));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util['format'](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x562cd2['findBy']));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')]['callerid'],_0x562cd2[_0xec21('0x122')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xec21('0x14')][_0xec21('0x126')]=function(_0x2802fc){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x127'),_0x2802fc[_0xec21('0x80')]));if(!this['isConfigured'](_0x2802fc[_0xec21('0x122')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2802fc,'no\x20find\x20by\x20configured');}logger[_0xec21('0x2b')](util['format'](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));var _0x72a3e9=this[_0xec21('0x4b')][_0xec21('0x7d')](this,_0x2802fc[_0xec21('0x122')]);if(_0x72a3e9){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc['findBy']));this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x125'),this['channel'][_0xec21('0x36')],_0x2802fc[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices['prototype'][_0xec21('0x129')]=function(_0x4ab574){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x12a'),_0x4ab574[_0xec21('0x80')]));if(!this['isConfigured'](_0x4ab574[_0xec21('0x12b')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ab574,_0xec21('0x12c'));}this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x12d'),_0x4ab574[_0xec21('0x12b')]));var _0x53aff4=eval(_0x4ab574[_0xec21('0x12b')]);if(!this[_0xec21('0x5e')](_0x4ab574[_0xec21('0xa6')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0xa7'));}var _0x3f6127=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x4ab574['variable_id']);if(!_0x3f6127){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4ab574,'no\x20variable\x20found');}if(_[_0xec21('0x12e')](_0x53aff4)){var _0xa4f8a9=this;_0x53aff4[_0xec21('0xa9')](function(_0x1f0abb,_0x5b757b){_0xa4f8a9[_0xec21('0xe')][_0xec21('0xac')](util[_0xec21('0x27')](_0xec21('0x12f'),_0x3f6127,_0x5b757b),_0x1f0abb);});return this['channel'][_0xec21('0x8d')](util['format'](_0xec21('0x130'),_0x3f6127));}else{return this[_0xec21('0xe')][_0xec21('0xac')](_0x3f6127,_0x53aff4);}};AGIVertices[_0xec21('0x14')][_0xec21('0xb')]=function(_0x10df3c){logger[_0xec21('0x2b')](util['format'](_0xec21('0x131'),_0x10df3c[_0xec21('0x80')]));if(_0x10df3c[_0xec21('0x7e')]===0x0){return this[_0xec21('0x7b')](_0x10df3c);}_0x10df3c[_0xec21('0x7e')]-=0x1;if(!this[_0xec21('0x5e')](_0x10df3c['file_id'])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x10df3c,_0xec21('0xe0'));}var _0x383b75=this[_0xec21('0xe1')]['sync'](this,_0x10df3c['file_id']);if(!_0x383b75){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x10df3c,_0xec21('0x132'));}var _0x1f6021=this[_0xec21('0xe')][_0xec21('0xe2')](_0x383b75,_0x10df3c[_0xec21('0x133')],_0x10df3c[_0xec21('0x134')]);var _0x12ae84=_0x1f6021[_0xec21('0x79')];if(_0x1f6021[_0xec21('0x79')]===-0x1){this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x10df3c,'-1');return _0x1f6021;}else if(_0x1f6021[_0xec21('0x77')]===_0xec21('0x84')){_0x1f6021[_0xec21('0x79')]=_0x1f6021[_0xec21('0x79')]['length']>0x0?_0x1f6021[_0xec21('0x79')]:'t';}else if(_['isEmpty'](_0x1f6021['result'])){_0x1f6021[_0xec21('0x79')]='#';_0x12ae84='#';}if(!this['isConfigured'](_0x10df3c[_0xec21('0xa6')])){this[_0xec21('0xe')]['noop'](_0xec21('0xa7'));}else{var _0x3df533=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x10df3c[_0xec21('0xa6')]);if(!_0x3df533){return this['channel'][_0xec21('0x2f')](_0x10df3c,_0xec21('0xa8'));}this[_0xec21('0xe')][_0xec21('0xac')](_0x3df533,_0x12ae84);}this[_0xec21('0x7c')][_0xec21('0x7d')](this,_0x10df3c,_0x12ae84);return _0x1f6021;};AGIVertices['prototype'][_0xec21('0x8d')]=function(_0x307cd4){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x135'),_0x307cd4['label']));return this['channel']['noop'](_0x307cd4[_0xec21('0x136')]||_0x307cd4[_0xec21('0x80')]);};AGIVertices[_0xec21('0x14')][_0xec21('0x137')]=function(_0x29e976){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x29e976['label']));if(!this['isConfigured'](_0x29e976['findBy'])){return this['channel'][_0xec21('0x2f')](_0x29e976,_0xec21('0x138'));}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x121'),this['channel'][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));var _0x2dac51=this[_0xec21('0x139')][_0xec21('0x7d')](this,_0x29e976['pause_id']);var _0x4a1800=this[_0xec21('0x48')][_0xec21('0x7d')](this,_0x29e976[_0xec21('0x122')],_0x2dac51);if(_0x4a1800){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x123'),this['channel'][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));this['channel'][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x29e976['findBy']));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x125'),this[_0xec21('0xe')][_0xec21('0x36')],_0x29e976[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xec21('0xe')]['callerid'],_0x29e976['findBy']));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices[_0xec21('0x14')][_0xec21('0x13a')]=function(_0x2ac748){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2ac748[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x2ac748[_0xec21('0xdf')])){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2ac748,_0xec21('0xe0'));}var _0x9e3709=this[_0xec21('0xe1')][_0xec21('0x7d')](this,_0x2ac748[_0xec21('0xdf')]);if(!_0x9e3709){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x2ac748,'no\x20file\x20audio\x20found');}var _0x32a8a8=this[_0xec21('0xe')]['exec'](_0xec21('0x13b'),[_0x9e3709,_0x2ac748[_0xec21('0xda')]]);if(_0x32a8a8[_0xec21('0x79')]===-0x1){return _0x32a8a8;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x13b'),_0x9e3709));};AGIVertices[_0xec21('0x14')][_0xec21('0x13d')]=function(_0x4f5f3b){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4f5f3b[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x4f5f3b[_0xec21('0x13e')])){return this[_0xec21('0xe')]['error'](_0x4f5f3b,_0xec21('0x13f'));}var _0x2ca1db='';var _0x1f5f48=parseInt(_0x4f5f3b[_0xec21('0x13e')],0xa);if(isNaN(_0x1f5f48)){_0x2ca1db=_0x4f5f3b[_0xec21('0x13e')];}else{_0x2ca1db=this['getVoiceQueue'][_0xec21('0x7d')](this,_0x4f5f3b[_0xec21('0x13e')]);if(!_0x2ca1db){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x4f5f3b,_0xec21('0x140'));}}var _0x3487d5='';if(this[_0xec21('0x5e')](_0x4f5f3b[_0xec21('0xdf')])){var _0x247989=this[_0xec21('0xe1')][_0xec21('0x7d')](this,_0x4f5f3b['file_id']);if(_0x247989){_0x3487d5=_0x247989;}}this['createSquareDetailsReport']['sync'](this,_0x4f5f3b,_0x2ca1db);if(_0x4f5f3b[_0xec21('0xda')][_0xec21('0x141')]('x')<0x0){_0x4f5f3b[_0xec21('0xda')]+='x';}if(_0x4f5f3b[_0xec21('0xda')][_0xec21('0x141')]('X')<0x0){_0x4f5f3b[_0xec21('0xda')]+='X';}this[_0xec21('0xe')][_0xec21('0xac')](_0xec21('0x142'),_0x2ca1db?_0x2ca1db[_0xec21('0x143')]():'');var _0x212bef=this[_0xec21('0xe')][_0xec21('0x51')]('QUEUE',[_0x2ca1db,_0x4f5f3b[_0xec21('0xda')],_0x4f5f3b[_0xec21('0xb5')],_0x3487d5,_0x4f5f3b[_0xec21('0x84')],_0x4f5f3b[_0xec21('0x7')],_0x4f5f3b[_0xec21('0x144')],_0x4f5f3b['gosub'],'',_0x4f5f3b['position']]);if(_0x212bef['result']===-0x1){return _0x212bef;}return this[_0xec21('0xe')][_0xec21('0x8d')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x2ca1db));};AGIVertices['prototype']['record']=function(_0x2e9d5a){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x145'),_0x2e9d5a['label']));var _0x3b83b6=_0x2e9d5a[_0xec21('0x146')]||_0xec21('0xfb');var _0x130fcb=util[_0xec21('0x27')](_0xec21('0x147'),this['channel'][_0xec21('0x33')],rs['generate'](0x5));var _0x372c84=util['format'](_0xec21('0x148'),FILES_PATH,_0x130fcb,_0x3b83b6);var _0x45e73e=util['format'](_0xec21('0xfc'),FILES_PATH,_0x130fcb);this['createSquareRecording'][_0xec21('0x7d')](this,_0x2e9d5a,_0x130fcb,_0x372c84);this['channel']['setVariable'](_0xec21('0x149'),_0x130fcb);logger[_0xec21('0x2b')](_0xec21('0x14a'),_0x45e73e,_0x3b83b6,_0x2e9d5a[_0xec21('0x14b')],_0x2e9d5a[_0xec21('0x84')]);return this[_0xec21('0xe')]['recordFile'](_0x45e73e,_0x3b83b6,_0x2e9d5a[_0xec21('0x14b')],_0x2e9d5a['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xec21('0x14c')]=function(_0x80c68d){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x14d'),_0x80c68d[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x14e')](_0x80c68d['digits']['replace'](/\s+/g,''),_0x80c68d[_0xec21('0x14b')]);};AGIVertices[_0xec21('0x14')]['saynumber']=function(_0x4b453b){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x14f'),_0x4b453b[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x150')](_0x4b453b[_0xec21('0x151')][_0xec21('0x152')](/\s+/g,''),_0x4b453b[_0xec21('0x14b')]);};AGIVertices['prototype'][_0xec21('0x153')]=function(_0x5dfc26){logger['info'](util['format'](_0xec21('0x154'),_0x5dfc26[_0xec21('0x80')]));return this[_0xec21('0xe')][_0xec21('0x155')](_0x5dfc26[_0xec21('0x53')],_0x5dfc26['escape_digits']);};AGIVertices[_0xec21('0x14')][_0xec21('0x156')]=function(_0x1dfa24){logger[_0xec21('0x2b')](util['format'](_0xec21('0x157'),_0x1dfa24['label']));if(!this[_0xec21('0x5e')](_0x1dfa24[_0xec21('0x158')])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x159'));}var _0x4c2de4=this[_0xec21('0x1e')]['sync'](this,_0x1dfa24[_0xec21('0x158')]);if(!_0x4c2de4||!_0x4c2de4[_0xec21('0x15a')]){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x1dfa24,_0xec21('0x15b'));}var _0x408d9e={'from':util[_0xec21('0x27')](_0xec21('0x15c'),_0x4c2de4['name'],_0x4c2de4[_0xec21('0x15d')]||_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15e')]),'to':_0x1dfa24['to']||'','cc':_0x1dfa24['cc']||'','bcc':_0x1dfa24['bcc']||'','subject':_0x1dfa24['subject'],'html':_0x1dfa24[_0xec21('0x53')],'text':_0x1dfa24[_0xec21('0x53')]};var _0x1dd0ca={'tls':{'rejectUnauthorized':![]}};if(_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15f')]){_0x1dd0ca['service']=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15f')];}else{_0x1dd0ca[_0xec21('0x160')]=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x160')];_0x1dd0ca[_0xec21('0x161')]=_0x4c2de4[_0xec21('0x15a')][_0xec21('0x161')];_0x1dd0ca[_0xec21('0x162')]=_0x4c2de4['Smtp'][_0xec21('0x162')];}if(_0x4c2de4[_0xec21('0x15a')][_0xec21('0x163')]){_0x1dd0ca[_0xec21('0x164')]={'user':_0x4c2de4[_0xec21('0x15a')][_0xec21('0x15e')],'pass':_0x4c2de4[_0xec21('0x15a')]['pass']};}if(this[_0xec21('0x5e')](_0x1dfa24[_0xec21('0x165')])){}logger['debug'](_0xec21('0x166'),JSON['stringify'](_0x408d9e));this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x1dfa24,_0x1dfa24[_0xec21('0x158')]);this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x167'),_0x4c2de4[_0xec21('0x16')]));this[_0xec21('0x20')][_0xec21('0x7d')](this,_0x1dd0ca,_0x408d9e);return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x168'));};AGIVertices[_0xec21('0x14')]['sendFax']=function(_0x556d66){logger['info'](util[_0xec21('0x27')](_0xec21('0x169'),_0x556d66[_0xec21('0x80')]));return this[_0xec21('0xe')]['noop'](_0xec21('0x16a'));};AGIVertices[_0xec21('0x14')][_0xec21('0x16b')]=function(_0x5036b3){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5036b3[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x5036b3['sms_account_id'])){return this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x16c'));}var _0x197445=this[_0xec21('0x31')][_0xec21('0x7d')](this,_0x5036b3[_0xec21('0x16d')]);if(!_0x197445){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x5036b3,'no\x20sms\x20account\x20found');}var _0x59e2ed={'body':_0x5036b3['sms_text'],'phone':_0x5036b3['to']||'','SmsAccountId':_0x197445['id']};logger[_0xec21('0xb0')](_0xec21('0x16e'),JSON[_0xec21('0x103')](_0x59e2ed));this[_0xec21('0x7c')]['sync'](this,_0x5036b3,_0x5036b3[_0xec21('0x16d')]);this['channel']['noop'](util[_0xec21('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x197445[_0xec21('0x16')]));this[_0xec21('0x32')]['sync'](this,_0x59e2ed);return this['channel']['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xec21('0x14')]['set']=function(_0x48f1f1){logger[_0xec21('0x2b')](util['format'](_0xec21('0x16f'),_0x48f1f1['label']));if(!this[_0xec21('0x5e')](_0x48f1f1[_0xec21('0xa6')])){return this['channel'][_0xec21('0x2f')](_0x48f1f1,_0xec21('0x170'));}var _0x82c13a=this[_0xec21('0x11')]['sync'](this,_0x48f1f1[_0xec21('0xa6')]);if(!_0x82c13a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x48f1f1,'no\x20variable\x20found');}return this[_0xec21('0xe')][_0xec21('0xac')](_0x82c13a,_0x48f1f1['variable_value']);};AGIVertices[_0xec21('0x14')]['start']=function(_0x46e68a){logger[_0xec21('0x2b')](util['format'](_0xec21('0x171'),_0x46e68a['label']));this[_0xec21('0xe')][_0xec21('0x8d')](_0xec21('0x172'));if(_0x46e68a['answer']===_0xec21('0x173')){this['channel'][_0xec21('0x8d')](_0xec21('0x174'));return this[_0xec21('0xe')][_0xec21('0x83')]();}return this['channel'][_0xec21('0x8d')](_0xec21('0x175'));};AGIVertices['prototype'][_0xec21('0x176')]=function(_0x495c3b){logger[_0xec21('0x2b')](util['format'](_0xec21('0x177'),_0x495c3b[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x495c3b[_0xec21('0x178')])){return this['channel'][_0xec21('0x2f')](_0x495c3b,_0xec21('0x179'));}var _0x9433e6=this[_0xec21('0x17')][_0xec21('0x7d')](this,_0x495c3b[_0xec21('0x178')]);if(!this['isConfigured'](_0x9433e6)){return this['channel'][_0xec21('0x2f')](_0x495c3b,util[_0xec21('0x27')](_0xec21('0x17a'),_0x495c3b['project_id']));}if(_0x9433e6===this[_0xec21('0xe')][_0xec21('0x35')]){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x495c3b,_0xec21('0x17b'));}this['createSquareDetailsReport'][_0xec21('0x7d')](this,_0x495c3b,_0x9433e6);var _0x696de2=this[_0xec21('0xe')]['exec'](_0xec21('0x17c'),util[_0xec21('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xec21('0x7')]['host']||_0xec21('0x17d'),_0x9433e6,this[_0xec21('0xe')][_0xec21('0x35')]));if(_0x696de2['result']===-0x1){return _0x696de2;}return this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x17c'),_0x9433e6));};AGIVertices[_0xec21('0x14')][_0xec21('0x17e')]=function(_0x1ca126){logger[_0xec21('0x2b')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1ca126[_0xec21('0x80')]));var _0x39fd15=this[_0xec21('0x50')]['sync'](this,_0x1ca126[_0xec21('0x81')]);this[_0xec21('0x7c')]['sync'](this,_0x1ca126,_0x1ca126[_0xec21('0x81')]);if(this['isConfigured'](_0x1ca126[_0xec21('0xa6')])){var _0xc6bb78=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x1ca126[_0xec21('0xa6')]);if(_0xc6bb78){this['channel']['setVariable'](_0xc6bb78,_0x39fd15);return this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x17f'),_0x1ca126[_0xec21('0x81')],_0xc6bb78));}}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1ca126[_0xec21('0x81')]));};AGIVertices[_0xec21('0x14')][_0xec21('0x180')]=function(_0x49805c){logger['info'](util[_0xec21('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x49805c[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x49805c['text'])){return this[_0xec21('0xe')]['noop']('no\x20text\x20configured');}this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x49805c[_0xec21('0x53')]));var _0x16080f=this['googleTTS'][_0xec21('0x7d')](this,_0x49805c);if(_0x16080f){this[_0xec21('0xe')]['noop'](util[_0xec21('0x27')](_0xec21('0x181'),_0x16080f));var _0x3ea65d=this[_0xec21('0xe')][_0xec21('0xf2')](_0x16080f);try{fs['unlink'](_0x16080f+_0xec21('0xd0'));}catch(_0x4c6d35){logger[_0xec21('0x2f')](_0x4c6d35);}return _0x3ea65d;}return this[_0xec21('0xe')][_0xec21('0x2f')](_0x49805c,_0xec21('0x182'));};AGIVertices[_0xec21('0x14')][_0xec21('0x183')]=function(_0x17bac6){logger[_0xec21('0x2b')](util['format'](_0xec21('0x184'),_0x17bac6[_0xec21('0x80')]));if(!this[_0xec21('0x5e')](_0x17bac6[_0xec21('0x122')])){return this[_0xec21('0xe')]['error'](_0x17bac6,_0xec21('0x138'));}logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x121'),this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));var _0x5270e7=this[_0xec21('0x4a')][_0xec21('0x7d')](this,_0x17bac6[_0xec21('0x122')]);if(_0x5270e7){logger[_0xec21('0x2b')](util[_0xec21('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));this[_0xec21('0xe')][_0xec21('0x8d')](util['format'](_0xec21('0x123'),this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6[_0xec21('0x122')]));return{'code':0xc8,'result':_0xec21('0x124')};}else{logger[_0xec21('0x2b')](util[_0xec21('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xec21('0xe')][_0xec21('0x36')],_0x17bac6['findBy']));this[_0xec21('0xe')]['noop'](util['format'](_0xec21('0x125'),this[_0xec21('0xe')]['callerid'],_0x17bac6['findBy']));return{'code':0xc8,'result':_0xec21('0x128')};}};AGIVertices[_0xec21('0x14')][_0xec21('0x185')]=function(_0x32cab7){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x186'),_0x32cab7['label']));var _0x528d58=this['channel'][_0xec21('0x51')](_0xec21('0x187'),[_0x32cab7['mailbox'],_0x32cab7[_0xec21('0x92')]]);if(_0x528d58[_0xec21('0x79')]===-0x1){return _0x528d58;}return this[_0xec21('0xe')][_0xec21('0x8d')](util[_0xec21('0x27')](_0xec21('0x13c'),_0xec21('0x187'),_0x32cab7['mailbox']));};AGIVertices[_0xec21('0x14')][_0xec21('0x188')]=function(_0x47bb4f){logger[_0xec21('0x2b')](util[_0xec21('0x27')](_0xec21('0x189'),_0x47bb4f[_0xec21('0x80')]));if(!this['isConfigured'](_0x47bb4f[_0xec21('0xa6')])){return this['channel'][_0xec21('0x2f')](_0x47bb4f,'no\x20variable\x20selected');}var _0x3ea49a=this[_0xec21('0x11')][_0xec21('0x7d')](this,_0x47bb4f['variable_id']);if(!_0x3ea49a){return this[_0xec21('0xe')][_0xec21('0x2f')](_0x47bb4f,_0xec21('0xa8'));}var _0x3e7f0f=this['channel'][_0xec21('0x11')](_0x3ea49a);return{'code':0xc8,'result':_0x3e7f0f[_0xec21('0x77')]?_0x3e7f0f['extra']:'-'};};String[_0xec21('0x14')]['replaceAll']=function(_0x31d57b,_0x3b7b8f){return this[_0xec21('0x74')](_0x31d57b)[_0xec21('0x18a')](_0x3b7b8f);};module[_0xec21('0x18b')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 397cf30..fcfa0cb 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 _0xf2ca=['[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','uniqueid','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid'];(function(_0x36888d,_0x22988e){var _0x14f524=function(_0x5cdbfe){while(--_0x5cdbfe){_0x36888d['push'](_0x36888d['shift']());}};_0x14f524(++_0x22988e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xf2ca[_0xf8886b];return _0x321bd5;};'use strict';var util=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var ami=require('../ami');var logger=require(_0xaf2c('0x3'))(_0xaf2c('0x4'));var RpcUser=require(_0xaf2c('0x5'));var RpcVoiceAgentReport=require(_0xaf2c('0x6'));function Acw(_0x3a724c){this[_0xaf2c('0x7')]=_0x3a724c['voiceQueues'];this[_0xaf2c('0x8')]=_0x3a724c[_0xaf2c('0x8')];this[_0xaf2c('0x9')]=_0x3a724c[_0xaf2c('0x9')];this['channels']={};ami['on'](_0xaf2c('0xa'),this[_0xaf2c('0xb')]['bind'](this));ami['on'](_0xaf2c('0xc'),this['syncHangupRequest'][_0xaf2c('0xd')](this));ami['on']('hangup',this[_0xaf2c('0xe')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0xf'),this[_0xaf2c('0x10')]['bind'](this));ami['on']('attendedtransfer',this[_0xaf2c('0x11')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0x12'),this[_0xaf2c('0x13')][_0xaf2c('0xd')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xaf2c('0xd')](this));}function getDiff(_0x8eaf9b){var _0x935959=moment()[_0xaf2c('0x14')](0x0);var _0x293ca6=moment(_0x8eaf9b)[_0xaf2c('0x14')](0x0);return _0x935959[_0xaf2c('0x15')](_0x293ca6,_0xaf2c('0x16'));}Acw[_0xaf2c('0x17')][_0xaf2c('0x18')]=function(_0x6ac8e){try{var _0x2b4d13=this;var _0x26bf7b=this[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x1a')];var _0x54c34a=this[_0xaf2c('0x19')][_0x6ac8e]['queue'];var _0x278a28=this[_0xaf2c('0x7')][_0x54c34a];var _0x1d544a=![];var _0x578492=_0xaf2c('0x1b');if(_0x278a28[_0xaf2c('0x1c')]){if(_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')]){_0x1d544a=!![];_0x578492=_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')];}}ami['Action']({'action':_0xaf2c('0x1f'),'interface':_0x26bf7b,'paused':!![],'reason':_0x578492})[_0xaf2c('0x20')](function(_0x8ffe13){if(_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b]){return RpcUser[_0xaf2c('0x21')](_0x2b4d13['agents'][_0x26bf7b]['id'])[_0xaf2c('0x20')](function(_0xbf6f62){if(_0xbf6f62&&!_0xbf6f62[_0xaf2c('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x26bf7b,_0x54c34a);var _0x29cbdf=_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x23')]&&_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e]['destlinkedid']?_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x24')]:_0x6ac8e;return RpcUser[_0xaf2c('0x25')](_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b],_0x578492,_0x29cbdf)[_0xaf2c('0x20')](function(_0xff396f){if(!_0x1d544a){_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]={};logger['info'](_0xaf2c('0x26'),_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')],_0x26bf7b,_0x54c34a);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']=setTimeout(_0x2b4d13[_0xaf2c('0x28')]['bind'](_0x2b4d13,_0x26bf7b),_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')]*0x3e8);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['lastPauseAt']=moment()[_0xaf2c('0x29')](_0xaf2c('0x2a'));_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid']=_0x6ac8e;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2b')]=_0x54c34a;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2c')]=function(){var _0x59d858=getDiff(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2d')]);clearTimeout(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']);_0x2b4d13['timers'][_0x26bf7b][_0xaf2c('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x59d858},_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid'],_0x26bf7b)[_0xaf2c('0x20')](function(_0x1e4de2){logger['info'](_0xaf2c('0x2f'),_0x6ac8e,_0x59d858,_0x1e4de2);})[_0xaf2c('0x30')](function(_0x54db57){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6ac8e,_0x54db57);});delete _0x2b4d13[_0xaf2c('0x9')][_0x26bf7b];};}});}else{logger[_0xaf2c('0x33')](_0xaf2c('0x34'),_0x6ac8e,_0x26bf7b,_0x54c34a);}});}})[_0xaf2c('0x30')](function(_0x5b1a7c){logger[_0xaf2c('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a]['acwTimeout'],_0x26bf7b,_0x54c34a);})[_0xaf2c('0x35')](function(){delete _0x2b4d13['channels'][_0x6ac8e];});}catch(_0x2f3d16){logger['error'](_0xaf2c('0x36'),_0x2f3d16['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x28')]=function(_0x1a6929){try{var _0x14ec58=this;if(_0x14ec58[_0xaf2c('0x9')][_0x1a6929]){_0x14ec58['timers'][_0x1a6929]['timer']=![];var _0x6f428d=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x37')];var _0xa44813=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x2b')];var _0x573db3=_0x14ec58[_0xaf2c('0x7')][_0xa44813][_0xaf2c('0x27')];logger['info'](_0xaf2c('0x38'),_0x1a6929);RpcUser[_0xaf2c('0x39')](this[_0xaf2c('0x8')][_0x1a6929]);RpcVoiceAgentReport[_0xaf2c('0x3a')]({'acwtime':_0x573db3,'agentacw':!![]},_0x6f428d,_0x1a6929)[_0xaf2c('0x20')](function(_0x1e8eaf){logger[_0xaf2c('0x33')](_0xaf2c('0x2f'),_0x6f428d,_0x573db3,_0x1e8eaf);})[_0xaf2c('0x30')](function(_0x106eb9){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6f428d,_0x106eb9);});}else{logger[_0xaf2c('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1a6929);if(_0x14ec58['timers']){logger['info'](_0xaf2c('0x3b'),JSON[_0xaf2c('0x3c')](_0x14ec58[_0xaf2c('0x9')]));}}}catch(_0x381502){logger[_0xaf2c('0x31')](_0xaf2c('0x3d'),_0x381502['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xb')]=function(_0xc59393){try{if(this['voiceQueues'][_0xc59393['queue']]&&(this[_0xaf2c('0x7')][_0xc59393['queue']][_0xaf2c('0x4')]||this[_0xaf2c('0x7')][_0xc59393[_0xaf2c('0x2b')]][_0xaf2c('0x1c')])){if(this['agents'][_0xc59393[_0xaf2c('0x1a')]]){this['channels'][_0xc59393[_0xaf2c('0x37')]]={'queue':_0xc59393[_0xaf2c('0x2b')],'interface':_0xc59393['interface'],'destlinkedid':_0xc59393[_0xaf2c('0x24')]};}}}catch(_0x4a2317){logger[_0xaf2c('0x31')](_0xaf2c('0x3e'),_0x4a2317[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x40')]=function(_0x98d9f3){try{if(this[_0xaf2c('0x7')][_0x98d9f3[_0xaf2c('0x2b')]]&&(this[_0xaf2c('0x7')][_0x98d9f3['queue']]['acw']||this[_0xaf2c('0x7')][_0x98d9f3['queue']]['mandatoryDisposition'])){if(this['agents'][_0x98d9f3[_0xaf2c('0x1a')]]){this[_0xaf2c('0x19')][_0x98d9f3[_0xaf2c('0x37')]]={'queue':_0x98d9f3[_0xaf2c('0x2b')],'interface':_0x98d9f3['interface']};}}}catch(_0x219ea3){logger['error'](_0xaf2c('0x41'),_0x219ea3['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x42')]=function(_0x2d01b7){try{if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]&&_['isUndefined'](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]['attended'])){logger['info'](_0xaf2c('0x43'),_0x2d01b7['uniqueid']);this[_0xaf2c('0x18')](_0x2d01b7[_0xaf2c('0x37')]);}else if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]]&&_[_0xaf2c('0x45')](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]][_0xaf2c('0x23')])){logger[_0xaf2c('0x33')](_0xaf2c('0x46'),_0x2d01b7[_0xaf2c('0x44')]);this['startAcw'](_0x2d01b7[_0xaf2c('0x44')]);}}catch(_0x57547e){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x57547e['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xe')]=function(_0x551061){try{if(this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x47'),_0x551061['uniqueid']);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x37')]);}else if(this['channels'][_0x551061[_0xaf2c('0x44')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x44')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x48'),_0x551061[_0xaf2c('0x44')]);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x44')]);}}catch(_0x300254){logger[_0xaf2c('0x31')](_0xaf2c('0x49'),_0x300254[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x11')]=function(_0x2d6677){try{if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4b')]])){this[_0xaf2c('0x18')](_0x2d6677['transfereeuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]]){this[_0xaf2c('0x19')][_0x2d6677['secondtransfereruniqueid']][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4d')]]=this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];}}else if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4d')]])){this[_0xaf2c('0x18')](_0x2d6677['transfertargetuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]]){this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4b')]]=this[_0xaf2c('0x19')][_0x2d6677['origtransfereruniqueid']];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]];}}}catch(_0x4b7070){logger['error'](_0xaf2c('0x4f'),_0x4b7070[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x13')]=function(_0x4cc55a){try{if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x50')]]){logger['info'](_0xaf2c('0x51'),JSON['stringify'](_0x4cc55a[_0xaf2c('0x50')]));this[_0xaf2c('0x18')](_0x4cc55a[_0xaf2c('0x50')]);}else if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x52')]]){logger[_0xaf2c('0x33')](_0xaf2c('0x53'),JSON[_0xaf2c('0x3c')](_0x4cc55a[_0xaf2c('0x52')]));this[_0xaf2c('0x18')](_0x4cc55a['transfererlinkedid']);}}catch(_0x79d962){logger[_0xaf2c('0x31')](_0xaf2c('0x54'),_0x79d962[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')]['syncAgentRingNoAnswer']=function(_0xbfb776){try{if(this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]&&this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]['autopause']==='all'){if(this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]]){logger['info'](_0xaf2c('0x55'),_0xbfb776[_0xaf2c('0x37')],_0xbfb776[_0xaf2c('0x1a')],_0xbfb776['queue']);return RpcUser[_0xaf2c('0x25')](this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]],_0xaf2c('0x56'),_0xbfb776['uniqueid']);}}}catch(_0x32d552){logger[_0xaf2c('0x31')](_0xaf2c('0x57'),_0x32d552[_0xaf2c('0x3f')]);}};module[_0xaf2c('0x58')]=Acw; \ No newline at end of file +var _0x7bae=['stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer'];(function(_0xfa91d6,_0x2731de){var _0x77cc1d=function(_0xe57e9e){while(--_0xe57e9e){_0xfa91d6['push'](_0xfa91d6['shift']());}};_0x77cc1d(++_0x2731de);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7bae[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7ba('0x0'));var ami=require(_0xe7ba('0x1'));var logger=require('../../../config/logger')(_0xe7ba('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe7ba('0x3'));function Acw(_0x10908b){this[_0xe7ba('0x4')]=_0x10908b[_0xe7ba('0x4')];this[_0xe7ba('0x5')]=_0x10908b[_0xe7ba('0x5')];this[_0xe7ba('0x6')]=_0x10908b[_0xe7ba('0x6')];this[_0xe7ba('0x7')]={};ami['on'](_0xe7ba('0x8'),this[_0xe7ba('0x9')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xb'),this[_0xe7ba('0xc')]['bind'](this));ami['on'](_0xe7ba('0xd'),this[_0xe7ba('0xe')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0xf'),this[_0xe7ba('0x10')][_0xe7ba('0xa')](this));ami['on'](_0xe7ba('0x11'),this[_0xe7ba('0x12')][_0xe7ba('0xa')](this));ami['on']('blindtransfer',this[_0xe7ba('0x13')]['bind'](this));ami['on'](_0xe7ba('0x14'),this[_0xe7ba('0x15')][_0xe7ba('0xa')](this));}function getDiff(_0x17e4e6){var _0x15d018=moment()[_0xe7ba('0x16')](0x0);var _0x561dbb=moment(_0x17e4e6)['milliseconds'](0x0);return _0x15d018[_0xe7ba('0x17')](_0x561dbb,_0xe7ba('0x18'));}Acw[_0xe7ba('0x19')]['startAcw']=function(_0x4390e3){try{var _0x4b20fd=this;var _0x590bab=this['channels'][_0x4390e3][_0xe7ba('0x1a')];var _0x4e87f5=this[_0xe7ba('0x7')][_0x4390e3]['queue'];var _0x4e3021=this['voiceQueues'][_0x4e87f5];var _0x3f326a=![];var _0x30086c=_0xe7ba('0x1b');if(_0x4e3021[_0xe7ba('0x1c')]){if(_0x4e3021[_0xe7ba('0x1d')]['name']){_0x3f326a=!![];_0x30086c=_0x4e3021[_0xe7ba('0x1d')][_0xe7ba('0x1e')];}}ami[_0xe7ba('0x1f')]({'action':_0xe7ba('0x20'),'interface':_0x590bab,'paused':!![],'reason':_0x30086c})['then'](function(_0x1076c5){if(_0x4b20fd[_0xe7ba('0x5')][_0x590bab]){return RpcUser['getAgent'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab]['id'])[_0xe7ba('0x21')](function(_0x27c882){if(_0x27c882&&!_0x27c882[_0xe7ba('0x22')]){logger[_0xe7ba('0x23')](_0xe7ba('0x24'),_0x4390e3,_0x590bab,_0x4e87f5);var _0x293b14=_0x4b20fd[_0xe7ba('0x7')][_0x4390e3][_0xe7ba('0x25')]&&_0x4b20fd[_0xe7ba('0x7')][_0x4390e3]['destlinkedid']?_0x4b20fd['channels'][_0x4390e3]['destlinkedid']:_0x4390e3;return RpcUser['savePause'](_0x4b20fd[_0xe7ba('0x5')][_0x590bab],_0x30086c,_0x293b14)['then'](function(_0x4ecc0d){if(!_0x3f326a){_0x4b20fd['timers'][_0x590bab]={};logger[_0xe7ba('0x23')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5][_0xe7ba('0x27')],_0x590bab,_0x4e87f5);_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x28')]=setTimeout(_0x4b20fd[_0xe7ba('0x29')][_0xe7ba('0xa')](_0x4b20fd,_0x590bab),_0x4b20fd['voiceQueues'][_0x4e87f5][_0xe7ba('0x27')]*0x3e8);_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]=moment()[_0xe7ba('0x2b')](_0xe7ba('0x2c'));_0x4b20fd['timers'][_0x590bab]['uniqueid']=_0x4390e3;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2d')]=_0x4e87f5;_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2e')]=function(){var _0x268308=getDiff(_0x4b20fd['timers'][_0x590bab][_0xe7ba('0x2a')]);clearTimeout(_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']);_0x4b20fd[_0xe7ba('0x6')][_0x590bab]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x268308},_0x4b20fd[_0xe7ba('0x6')][_0x590bab][_0xe7ba('0x2f')],_0x590bab)[_0xe7ba('0x21')](function(_0x52f90e){logger[_0xe7ba('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x4390e3,_0x268308,_0x52f90e);})[_0xe7ba('0x30')](function(_0x343cd2){logger[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x4390e3,_0x343cd2);});delete _0x4b20fd[_0xe7ba('0x6')][_0x590bab];};}});}else{logger['info'](_0xe7ba('0x33'),_0x4390e3,_0x590bab,_0x4e87f5);}});}})[_0xe7ba('0x30')](function(_0x4baf97){logger[_0xe7ba('0x31')](_0xe7ba('0x26'),_0x4390e3,_0x4b20fd[_0xe7ba('0x4')][_0x4e87f5]['acwTimeout'],_0x590bab,_0x4e87f5);})[_0xe7ba('0x34')](function(){delete _0x4b20fd[_0xe7ba('0x7')][_0x4390e3];});}catch(_0x5db8ab){logger[_0xe7ba('0x31')](_0xe7ba('0x35'),_0x5db8ab[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x29')]=function(_0x43b313){try{var _0x575f4b=this;if(_0x575f4b[_0xe7ba('0x6')][_0x43b313]){_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x28')]=![];var _0x582833=_0x575f4b['timers'][_0x43b313][_0xe7ba('0x2f')];var _0x2ebb27=_0x575f4b[_0xe7ba('0x6')][_0x43b313][_0xe7ba('0x2d')];var _0x3581ef=_0x575f4b['voiceQueues'][_0x2ebb27][_0xe7ba('0x27')];logger[_0xe7ba('0x23')](_0xe7ba('0x37'),_0x43b313);RpcUser[_0xe7ba('0x38')](this['agents'][_0x43b313]);RpcVoiceAgentReport[_0xe7ba('0x39')]({'acwtime':_0x3581ef,'agentacw':!![]},_0x582833,_0x43b313)[_0xe7ba('0x21')](function(_0x46e31a){logger[_0xe7ba('0x23')](_0xe7ba('0x3a'),_0x582833,_0x3581ef,_0x46e31a);})[_0xe7ba('0x30')](function(_0x124cc4){logger['error'](_0xe7ba('0x32'),_0x582833,_0x124cc4);});}else{logger[_0xe7ba('0x31')](_0xe7ba('0x3b'),_0x43b313);if(_0x575f4b[_0xe7ba('0x6')]){logger[_0xe7ba('0x23')](_0xe7ba('0x3c'),JSON[_0xe7ba('0x3d')](_0x575f4b[_0xe7ba('0x6')]));}}}catch(_0x39d903){logger['error'](_0xe7ba('0x3e'),_0x39d903[_0xe7ba('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x32053d){try{if(this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]]&&(this['voiceQueues'][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x32053d[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x32053d[_0xe7ba('0x1a')]]){this['channels'][_0x32053d[_0xe7ba('0x2f')]]={'queue':_0x32053d[_0xe7ba('0x2d')],'interface':_0x32053d[_0xe7ba('0x1a')],'destlinkedid':_0x32053d[_0xe7ba('0x3f')]};}}}catch(_0x3053a4){logger[_0xe7ba('0x31')](_0xe7ba('0x40'),_0x3053a4[_0xe7ba('0x36')]);}};Acw['prototype'][_0xe7ba('0x15')]=function(_0x4178b9){try{if(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]]&&(this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x2')]||this[_0xe7ba('0x4')][_0x4178b9[_0xe7ba('0x2d')]][_0xe7ba('0x1c')])){if(this['agents'][_0x4178b9[_0xe7ba('0x1a')]]){this['channels'][_0x4178b9[_0xe7ba('0x2f')]]={'queue':_0x4178b9[_0xe7ba('0x2d')],'interface':_0x4178b9[_0xe7ba('0x1a')]};}}}catch(_0x15177c){logger[_0xe7ba('0x31')](_0xe7ba('0x41'),_0x15177c['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xc')]=function(_0x3f17ed){try{if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x2f')]][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')](_0xe7ba('0x43'),_0x3f17ed['uniqueid']);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x3f17ed[_0xe7ba('0x45')]]&&_[_0xe7ba('0x42')](this[_0xe7ba('0x7')][_0x3f17ed['linkedid']][_0xe7ba('0x25')])){logger[_0xe7ba('0x23')]('[%s][HANGUP:LINKEDID]',_0x3f17ed[_0xe7ba('0x45')]);this[_0xe7ba('0x44')](_0x3f17ed[_0xe7ba('0x45')]);}}catch(_0x1b9a05){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x1b9a05[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')][_0xe7ba('0xe')]=function(_0x5af106){try{if(this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x2f')]][_0xe7ba('0x25')]){logger[_0xe7ba('0x23')](_0xe7ba('0x46'),_0x5af106['uniqueid']);this[_0xe7ba('0x44')](_0x5af106[_0xe7ba('0x2f')]);}else if(this[_0xe7ba('0x7')][_0x5af106['linkedid']]&&this[_0xe7ba('0x7')][_0x5af106[_0xe7ba('0x45')]]['attended']){logger[_0xe7ba('0x23')](_0xe7ba('0x47'),_0x5af106['linkedid']);this[_0xe7ba('0x44')](_0x5af106['linkedid']);}}catch(_0xe2cbba){logger[_0xe7ba('0x31')](_0xe7ba('0x48'),_0xe2cbba['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x12')]=function(_0x314549){try{if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549['transfereeuniqueid']])){this[_0xe7ba('0x44')](_0x314549[_0xe7ba('0x4a')]);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]]){this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]]=this[_0xe7ba('0x7')][_0x314549['secondtransfereruniqueid']];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4b')]];}}else if(!_[_0xe7ba('0x49')](this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4c')]])){this[_0xe7ba('0x44')](_0x314549['transfertargetuniqueid']);if(this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]]){this[_0xe7ba('0x7')][_0x314549['origtransfereruniqueid']][_0xe7ba('0x25')]=!![];this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4a')]]=this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];delete this[_0xe7ba('0x7')][_0x314549[_0xe7ba('0x4d')]];}}}catch(_0x3351d5){logger[_0xe7ba('0x31')](_0xe7ba('0x4e'),_0x3351d5[_0xe7ba('0x36')]);}};Acw[_0xe7ba('0x19')]['syncBlindTransfer']=function(_0x131331){try{if(this[_0xe7ba('0x7')][_0x131331[_0xe7ba('0x4f')]]){logger['info'](_0xe7ba('0x50'),JSON['stringify'](_0x131331[_0xe7ba('0x4f')]));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x4f')]);}else if(this['channels'][_0x131331['transfererlinkedid']]){logger[_0xe7ba('0x23')](_0xe7ba('0x51'),JSON[_0xe7ba('0x3d')](_0x131331['transfererlinkedid']));this[_0xe7ba('0x44')](_0x131331[_0xe7ba('0x52')]);}}catch(_0x3fe82a){logger[_0xe7ba('0x31')](_0xe7ba('0x53'),_0x3fe82a['message']);}};Acw[_0xe7ba('0x19')][_0xe7ba('0x10')]=function(_0x70ce9c){try{if(this['voiceQueues'][_0x70ce9c[_0xe7ba('0x2d')]]&&this[_0xe7ba('0x4')][_0x70ce9c[_0xe7ba('0x2d')]][_0xe7ba('0x54')]===_0xe7ba('0x55')){if(this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]]){logger[_0xe7ba('0x23')](_0xe7ba('0x56'),_0x70ce9c[_0xe7ba('0x2f')],_0x70ce9c['interface'],_0x70ce9c[_0xe7ba('0x2d')]);return RpcUser[_0xe7ba('0x57')](this[_0xe7ba('0x5')][_0x70ce9c[_0xe7ba('0x1a')]],'Auto-Pause',_0x70ce9c['uniqueid']);}}}catch(_0x103eb8){logger[_0xe7ba('0x31')](_0xe7ba('0x58'),_0x103eb8['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 081fe3b..bf602d5 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 _0x65f6=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','log','exports','asterisk-manager','util','lodash','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionSipPeerStatus'];(function(_0xb04564,_0x2e20b7){var _0x529be=function(_0x240266){while(--_0x240266){_0xb04564['push'](_0xb04564['shift']());}};_0x529be(++_0x2e20b7);}(_0x65f6,0x139));var _0x665f=function(_0x19d3f2,_0x20bd43){_0x19d3f2=_0x19d3f2-0x0;var _0x17bfca=_0x65f6[_0x19d3f2];return _0x17bfca;};'use strict';var Manager=require(_0x665f('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x665f('0x1'));var _=require(_0x665f('0x2'));var logger=require('../../config/logger')(_0x665f('0x3'));var config=require(_0x665f('0x4'));var ami=new Manager(config[_0x665f('0x5')][_0x665f('0x6')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x7')],config['asterisk']['password'],!![]);ami[_0x665f('0x8')]();ami[_0x665f('0x9')]=BPromise[_0x665f('0xa')](ami['action']);function error(_0x1e7090){logger[_0x665f('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')],util[_0x665f('0xc')](_0x1e7090,![],null)));}function close(){logger[_0x665f('0xb')](util[_0x665f('0xd')](_0x665f('0xe'),config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')]));}ami[_0x665f('0xf')]=function(){return function(){return ami[_0x665f('0x9')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x665f('0x9')]({'action':'devicestatelist'});};};ami[_0x665f('0x10')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x665f('0x11')]=function(){return function(){return ami[_0x665f('0x9')]({'action':_0x665f('0x12')});};};ami[_0x665f('0x13')]=function(){return function(){return ami[_0x665f('0x9')]({'action':_0x665f('0x14')});};};function connect(_0x3c079a){logger['info'](util[_0x665f('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x665f('0x5')][_0x665f('0x7')],config['asterisk']['ip'],config[_0x665f('0x5')]['port']));ami[_0x665f('0x15')](_0x665f('0xb'),error);ami['once'](_0x665f('0x16'),close);}ami['on'](_0x665f('0x17'),connect);ami['on']('shutdown',function(_0x12586f){logger['info'](util[_0x665f('0xd')](_0x665f('0x18'),config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')]['port'],util[_0x665f('0xc')](_0x12586f,![],null)));});ami['on'](_0x665f('0x19'),function(_0x11c17b){logger['info'](util[_0x665f('0xd')](_0x665f('0x1a'),config[_0x665f('0x5')]['username'],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')]));return BPromise[_0x665f('0x1b')]()[_0x665f('0x1c')](ami[_0x665f('0xf')]())[_0x665f('0x1c')](ami[_0x665f('0x1d')]())[_0x665f('0x1c')](ami[_0x665f('0x10')]())[_0x665f('0x1c')](ami[_0x665f('0x11')]())[_0x665f('0x1c')](ami[_0x665f('0x13')]())[_0x665f('0x1e')](function(_0x473a3f){console[_0x665f('0x1f')](_0x473a3f);});});ami['once'](_0x665f('0xb'),error);ami[_0x665f('0x15')](_0x665f('0x16'),close);module[_0x665f('0x20')]=ami; \ No newline at end of file +var _0x4d67=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x1ba3ca,_0x49958c){var _0x29d8c9=function(_0x4a94bf){while(--_0x4a94bf){_0x1ba3ca['push'](_0x1ba3ca['shift']());}};_0x29d8c9(++_0x49958c);}(_0x4d67,0xcf));var _0x74d6=function(_0x19433d,_0x283c41){_0x19433d=_0x19433d-0x0;var _0x30fa27=_0x4d67[_0x19433d];return _0x30fa27;};'use strict';var Manager=require(_0x74d6('0x0'));var BPromise=require(_0x74d6('0x1'));var moment=require(_0x74d6('0x2'));var util=require(_0x74d6('0x3'));var _=require(_0x74d6('0x4'));var logger=require(_0x74d6('0x5'))('ami');var config=require(_0x74d6('0x6'));var ami=new Manager(config['asterisk'][_0x74d6('0x7')],config[_0x74d6('0x8')]['ip'],config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk'][_0x74d6('0xa')],!![]);ami[_0x74d6('0xb')]();ami[_0x74d6('0xc')]=BPromise[_0x74d6('0xd')](ami[_0x74d6('0xe')]);function error(_0x58520c){logger['error'](util[_0x74d6('0xf')](_0x74d6('0x10'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config['asterisk'][_0x74d6('0x7')],util[_0x74d6('0x11')](_0x58520c,![],null)));}function close(){logger[_0x74d6('0x12')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x74d6('0xc')]({'action':_0x74d6('0x13')});};};ami[_0x74d6('0x14')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x74d6('0x15')]=function(){return function(){return ami[_0x74d6('0xc')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x74d6('0xc')]({'action':_0x74d6('0x16')});};};ami[_0x74d6('0x17')]=function(){return function(){return ami[_0x74d6('0xc')]({'action':'coreshowchannels'});};};function connect(_0x417142){logger[_0x74d6('0x18')](util[_0x74d6('0xf')](_0x74d6('0x19'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));ami['once']('error',error);ami[_0x74d6('0x1a')]('close',close);}ami['on'](_0x74d6('0x1b'),connect);ami['on'](_0x74d6('0x1c'),function(_0x2480ed){logger[_0x74d6('0x18')](util['format'](_0x74d6('0x1d'),config[_0x74d6('0x8')][_0x74d6('0x9')],config['asterisk']['ip'],config['asterisk']['port'],util[_0x74d6('0x11')](_0x2480ed,![],null)));});ami['on'](_0x74d6('0x1e'),function(_0x36a570){logger[_0x74d6('0x18')](util[_0x74d6('0xf')](_0x74d6('0x1f'),config['asterisk']['username'],config[_0x74d6('0x8')]['ip'],config[_0x74d6('0x8')][_0x74d6('0x7')]));return BPromise[_0x74d6('0x20')]()['then'](ami['actionSipShowRegistry']())[_0x74d6('0x21')](ami[_0x74d6('0x14')]())[_0x74d6('0x21')](ami[_0x74d6('0x15')]())[_0x74d6('0x21')](ami[_0x74d6('0x22')]())[_0x74d6('0x21')](ami['actionCoreShowChannels']())[_0x74d6('0x23')](function(_0x179c16){console[_0x74d6('0x24')](_0x179c16);});});ami[_0x74d6('0x1a')](_0x74d6('0x12'),error);ami[_0x74d6('0x1a')](_0x74d6('0x25'),close);module[_0x74d6('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7f7e1eb..9b59f4f 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 _0xd705=['exports','jayson/promise','bluebird','client','http','request','then','debug','error','rpc','memberReport','message'];(function(_0x1a1692,_0x737fbf){var _0x4703db=function(_0x3e37ee){while(--_0x3e37ee){_0x1a1692['push'](_0x1a1692['shift']());}};_0x4703db(++_0x737fbf);}(_0xd705,0x145));var _0x5d70=function(_0x281b60,_0x3e312d){_0x281b60=_0x281b60-0x0;var _0x24c49c=_0xd705[_0x281b60];return _0x24c49c;};'use strict';var jayson=require(_0x5d70('0x0'));var BPromise=require(_0x5d70('0x1'));var logger=require('../../config/logger')('ami');var client=jayson[_0x5d70('0x2')][_0x5d70('0x3')]({'port':0x2329});client['Request']=function(_0x476568,_0x5df7c5){return new BPromise(function(_0x47d6ab,_0x5dcfb7){return client[_0x5d70('0x4')](_0x476568,_0x5df7c5)[_0x5d70('0x5')](function(_0x4fca06){logger[_0x5d70('0x6')]('rpc','memberReport',_0x476568,_0x5df7c5,_0x4fca06);if(_0x4fca06[_0x5d70('0x7')]){logger['error'](_0x5d70('0x8'),_0x5d70('0x9'),_0x476568,_0x4fca06[_0x5d70('0x7')][_0x5d70('0xa')],_0x5df7c5);return _0x5dcfb7(_0x4fca06[_0x5d70('0x7')]['message']);}else{return _0x47d6ab(_0x4fca06['result']);}})['catch'](function(_0x29f475){logger[_0x5d70('0x7')](_0x5d70('0x8'),_0x5d70('0x9'),_0x476568,_0x29f475,_0x5df7c5);return _0x5dcfb7(_0x29f475);});});};module[_0x5d70('0xb')]=client; \ No newline at end of file +var _0x637e=['client','http','Request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x637e,0xdd));var _0xe637=function(_0x5c725f,_0x2bdf4a){_0x5c725f=_0x5c725f-0x0;var _0x1760e6=_0x637e[_0x5c725f];return _0x1760e6;};'use strict';var jayson=require(_0xe637('0x0'));var BPromise=require(_0xe637('0x1'));var logger=require(_0xe637('0x2'))(_0xe637('0x3'));var client=jayson[_0xe637('0x4')][_0xe637('0x5')]({'port':0x2329});client[_0xe637('0x6')]=function(_0x127808,_0x516de6){return new BPromise(function(_0x1aa339,_0x14a173){return client['request'](_0x127808,_0x516de6)[_0xe637('0x7')](function(_0xba364a){logger['debug'](_0xe637('0x8'),_0xe637('0x9'),_0x127808,_0x516de6,_0xba364a);if(_0xba364a[_0xe637('0xa')]){logger['error'](_0xe637('0x8'),'memberReport',_0x127808,_0xba364a[_0xe637('0xa')][_0xe637('0xb')],_0x516de6);return _0x14a173(_0xba364a['error'][_0xe637('0xb')]);}else{return _0x1aa339(_0xba364a[_0xe637('0xc')]);}})[_0xe637('0xd')](function(_0x224614){logger[_0xe637('0xa')](_0xe637('0x8'),'memberReport',_0x127808,_0x224614,_0x516de6);return _0x14a173(_0x224614);});});};module[_0xe637('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 94cd14e..827b060 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 _0x1d7e=['getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','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','number','substring'];(function(_0x11a3bb,_0x5c5466){var _0x3c3e36=function(_0x59f16f){while(--_0x59f16f){_0x11a3bb['push'](_0x11a3bb['shift']());}};_0x3c3e36(++_0x5c5466);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x1d7e[_0x9df060];return _0x338dfe;};'use strict';var util=require('util');var _=require(_0xe1d7('0x0'));var moment=require(_0xe1d7('0x1'));function checkNameSurname(_0x41bac0,_0x47c24f,_0x141274){var _0x4c39bd='';if(!_[_0xe1d7('0x2')](_0x47c24f)&&_0xe1d7('0x3')===typeof _0x47c24f){_0x4c39bd+=_0x47c24f;}if(!_[_0xe1d7('0x2')](_0x141274)&&_0xe1d7('0x3')===typeof _0x141274){_0x4c39bd+='\x20'+_0x141274;}if(_0x4c39bd!==''){return _0x4c39bd;}return _0x41bac0;}function Action(_0x1c8ace,_0x4058fe,_0x252026){this[_0xe1d7('0x4')]=_0x1c8ace;this[_0xe1d7('0x5')]=_0x252026||undefined;this[_0xe1d7('0x6')]=checkNameSurname(_0x4058fe[_0xe1d7('0x7')]['phone'],_0x4058fe[_0xe1d7('0x7')][_0xe1d7('0x8')],_0x4058fe['Contact'][_0xe1d7('0x9')]);this['number']=_0x4058fe[_0xe1d7('0x7')]['phone'];this[_0xe1d7('0xa')]=_0x1c8ace['name'];this['active']=_0x4058fe[_0xe1d7('0xb')]||![];this[_0xe1d7('0xc')]=_0x1c8ace[_0xe1d7('0xc')];this[_0xe1d7('0xd')]=_0x1c8ace[_0xe1d7('0xd')]||0x3;this[_0xe1d7('0xe')]=_0x4058fe[_0xe1d7('0xe')];this[_0xe1d7('0xf')]=_0x4058fe['countbusyretry'];this[_0xe1d7('0x10')]=_0x4058fe[_0xe1d7('0x10')];this[_0xe1d7('0x11')]=_0x4058fe[_0xe1d7('0x11')];this[_0xe1d7('0x12')]=_0x4058fe[_0xe1d7('0x12')];this[_0xe1d7('0x13')]=_0x4058fe['ListId'];this[_0xe1d7('0x14')]=_0x4058fe[_0xe1d7('0x14')];this[_0xe1d7('0x15')]=_0x4058fe['VoiceQueueId'];this[_0xe1d7('0x16')]=_0x4058fe[_0xe1d7('0x16')];this[_0xe1d7('0x17')]=_0x4058fe['id'];this[_0xe1d7('0x18')]=_0x4058fe[_0xe1d7('0x7')][_0xe1d7('0x8')]||'';this[_0xe1d7('0x19')]=moment()[_0xe1d7('0x1a')](_0xe1d7('0x1b'));this[_0xe1d7('0x1c')]=_0x4058fe[_0xe1d7('0x1c')];this[_0xe1d7('0x1d')]=_0x4058fe['callbackuniqueid'];this[_0xe1d7('0x1e')]=_0x4058fe[_0xe1d7('0x1e')];this[_0xe1d7('0x1f')]=_0x4058fe[_0xe1d7('0x1f')];this[_0xe1d7('0x20')]='';this['originatecalleridname']='';}Action[_0xe1d7('0x21')][_0xe1d7('0x22')]=function(){return util[_0xe1d7('0x1a')](_0xe1d7('0x23'),this[_0xe1d7('0x6')],this['voiceQueue'][_0xe1d7('0x24')]>0x0?this[_0xe1d7('0x25')][_0xe1d7('0x26')](this[_0xe1d7('0x4')][_0xe1d7('0x24')]):this[_0xe1d7('0x25')]);};Action[_0xe1d7('0x21')][_0xe1d7('0x27')]=function(){return this[_0xe1d7('0xa')];};module[_0xe1d7('0x28')]=Action; \ No newline at end of file +var _0xb957=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','moment','string','isNil','voiceQueue','uniqueid','name','Contact','firstName','lastName','queue','type'];(function(_0x39dee1,_0x3c3409){var _0x3ccebd=function(_0x321ba7){while(--_0x321ba7){_0x39dee1['push'](_0x39dee1['shift']());}};_0x3ccebd(++_0x3c3409);}(_0xb957,0x6d));var _0x7b95=function(_0x32d725,_0x35832f){_0x32d725=_0x32d725-0x0;var _0xd3a06=_0xb957[_0x32d725];return _0xd3a06;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7b95('0x0'));function checkNameSurname(_0x5012da,_0x477577,_0x24ded4){var _0xef509a='';if(!_['isNil'](_0x477577)&&_0x7b95('0x1')===typeof _0x477577){_0xef509a+=_0x477577;}if(!_[_0x7b95('0x2')](_0x24ded4)&&_0x7b95('0x1')===typeof _0x24ded4){_0xef509a+='\x20'+_0x24ded4;}if(_0xef509a!==''){return _0xef509a;}return _0x5012da;}function Action(_0x3ef8f4,_0x19ff14,_0x518099){this[_0x7b95('0x3')]=_0x3ef8f4;this[_0x7b95('0x4')]=_0x518099||undefined;this[_0x7b95('0x5')]=checkNameSurname(_0x19ff14['Contact']['phone'],_0x19ff14[_0x7b95('0x6')][_0x7b95('0x7')],_0x19ff14[_0x7b95('0x6')][_0x7b95('0x8')]);this['number']=_0x19ff14['Contact']['phone'];this[_0x7b95('0x9')]=_0x3ef8f4[_0x7b95('0x5')];this['active']=_0x19ff14['active']||![];this[_0x7b95('0xa')]=_0x3ef8f4[_0x7b95('0xa')];this[_0x7b95('0xb')]=_0x3ef8f4['dialQueueTimeout']||0x3;this['scheduledat']=_0x19ff14[_0x7b95('0xc')];this['countbusyretry']=_0x19ff14[_0x7b95('0xd')];this[_0x7b95('0xe')]=_0x19ff14[_0x7b95('0xe')];this[_0x7b95('0xf')]=_0x19ff14['countnoanswerretry'];this['ContactId']=_0x19ff14[_0x7b95('0x10')];this[_0x7b95('0x11')]=_0x19ff14[_0x7b95('0x11')];this[_0x7b95('0x12')]=_0x19ff14[_0x7b95('0x12')];this[_0x7b95('0x13')]=_0x19ff14[_0x7b95('0x13')];this[_0x7b95('0x14')]=_0x19ff14[_0x7b95('0x14')];this[_0x7b95('0x15')]=_0x19ff14['id'];this[_0x7b95('0x16')]=_0x19ff14['Contact'][_0x7b95('0x7')]||'';this[_0x7b95('0x17')]=moment()[_0x7b95('0x18')](_0x7b95('0x19'));this[_0x7b95('0x1a')]=_0x19ff14[_0x7b95('0x1a')];this[_0x7b95('0x1b')]=_0x19ff14[_0x7b95('0x1b')];this['callbackat']=_0x19ff14[_0x7b95('0x1c')];this[_0x7b95('0x1d')]=_0x19ff14[_0x7b95('0x1d')];this[_0x7b95('0x1e')]='';this[_0x7b95('0x1f')]='';}Action[_0x7b95('0x20')][_0x7b95('0x21')]=function(){return util[_0x7b95('0x18')](_0x7b95('0x22'),this[_0x7b95('0x5')],this[_0x7b95('0x3')][_0x7b95('0x23')]>0x0?this[_0x7b95('0x24')][_0x7b95('0x25')](this['voiceQueue'][_0x7b95('0x23')]):this[_0x7b95('0x24')]);};Action['prototype'][_0x7b95('0x26')]=function(){return this[_0x7b95('0x9')];};module[_0x7b95('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 39ae3de..f9099da 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 _0x94b2=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','queue','membername','reason','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x94b2,0x1e4));var _0x294b=function(_0x170ec6,_0x2ade62){_0x170ec6=_0x170ec6-0x0;var _0x47c7e2=_0x94b2[_0x170ec6];return _0x47c7e2;};'use strict';var util=require(_0x294b('0x0'));var _=require(_0x294b('0x1'));var moment=require('moment');function getSeconds(_0x1c6721,_0xc5edaf){var _0x4bb1e0=moment(_0x1c6721)[_0x294b('0x2')](0x0);var _0xce5476=moment(_0xc5edaf)['milliseconds'](0x0);return _0x4bb1e0[_0x294b('0x3')](_0xce5476,_0x294b('0x4'));}function AgentComplete(_0x87e565,_0x5661d5){this[_0x294b('0x5')]=0x4;this[_0x294b('0x6')]=_0x294b('0x7');this[_0x294b('0x8')]=_0x87e565[_0x294b('0x8')];this[_0x294b('0x9')]=_0x87e565['type'];this['campaigntype']=_0x87e565[_0x294b('0x9')]===_0x294b('0xa')?'queue':_0x87e565['type'];this[_0x294b('0xb')]=_0x87e565[_0x294b('0xb')];this['countcongestionretry']=_0x87e565[_0x294b('0xc')];this['countnoanswerretry']=_0x87e565[_0x294b('0xd')];this['countglobal']=_0x87e565[_0x294b('0xb')]+_0x87e565[_0x294b('0xc')]+_0x87e565[_0x294b('0xd')];this['uniqueid']=_0x5661d5[_0x294b('0xe')];this[_0x294b('0xf')]=_0x87e565[_0x294b('0x10')];this['calleridnum']=_0x87e565[_0x294b('0x11')];this[_0x294b('0x12')]=_0x87e565[_0x294b('0x12')];this[_0x294b('0x13')]=_0x87e565[_0x294b('0x13')];this['answertime']=_0x87e565[_0x294b('0x14')];this[_0x294b('0x15')]=moment()[_0x294b('0x16')](_0x294b('0x17'));this['ringtime']=getSeconds(_0x87e565[_0x294b('0x13')],_0x87e565[_0x294b('0x12')]);this[_0x294b('0x18')]=getSeconds(_0x87e565[_0x294b('0x14')],_0x87e565[_0x294b('0x13')]);this['talktime']=getSeconds(this[_0x294b('0x15')],_0x87e565[_0x294b('0x14')]);this['queue']=_0x5661d5[_0x294b('0x19')];this[_0x294b('0x1a')]=_0x5661d5[_0x294b('0x1a')];this[_0x294b('0x1b')]=_0x5661d5[_0x294b('0x1b')];this['callback']=_0x87e565[_0x294b('0x1c')];this[_0x294b('0x1d')]=_0x87e565[_0x294b('0x1d')];this['callbackat']=_0x87e565['callbackat'];this['recallme']=_0x87e565[_0x294b('0x1e')];this['ContactId']=_0x87e565['ContactId'];this['ListId']=_0x87e565[_0x294b('0x1f')];this[_0x294b('0x20')]=_0x87e565[_0x294b('0x20')];this[_0x294b('0x21')]=_0x87e565[_0x294b('0x21')];this[_0x294b('0x22')]=_0x87e565['CampaignId'];this[_0x294b('0x23')]=_0x87e565[_0x294b('0x23')]||'';this['originatecalleridname']=_0x87e565[_0x294b('0x24')]||'';}module[_0x294b('0x25')]=AgentComplete; \ No newline at end of file +var _0xbb26=['holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format'];(function(_0x29f429,_0x3df852){var _0x3234d6=function(_0x42e680){while(--_0x42e680){_0x29f429['push'](_0x29f429['shift']());}};_0x3234d6(++_0x3df852);}(_0xbb26,0xde));var _0x6bb2=function(_0x12988b,_0x4349eb){_0x12988b=_0x12988b-0x0;var _0x2050c2=_0xbb26[_0x12988b];return _0x2050c2;};'use strict';var util=require(_0x6bb2('0x0'));var _=require(_0x6bb2('0x1'));var moment=require('moment');function getSeconds(_0x54795d,_0x34dfcf){var _0x271996=moment(_0x54795d)[_0x6bb2('0x2')](0x0);var _0x4b9f96=moment(_0x34dfcf)[_0x6bb2('0x2')](0x0);return _0x271996[_0x6bb2('0x3')](_0x4b9f96,_0x6bb2('0x4'));}function AgentComplete(_0x2e12eb,_0x15b10d){this[_0x6bb2('0x5')]=0x4;this['statedesc']=_0x6bb2('0x6');this[_0x6bb2('0x7')]=_0x2e12eb['scheduledat'];this[_0x6bb2('0x8')]=_0x2e12eb[_0x6bb2('0x8')];this[_0x6bb2('0x9')]=_0x2e12eb[_0x6bb2('0x8')]==='outbound'?'queue':_0x2e12eb[_0x6bb2('0x8')];this[_0x6bb2('0xa')]=_0x2e12eb[_0x6bb2('0xa')];this['countcongestionretry']=_0x2e12eb[_0x6bb2('0xb')];this[_0x6bb2('0xc')]=_0x2e12eb[_0x6bb2('0xc')];this[_0x6bb2('0xd')]=_0x2e12eb['countbusyretry']+_0x2e12eb[_0x6bb2('0xb')]+_0x2e12eb['countnoanswerretry'];this[_0x6bb2('0xe')]=_0x15b10d[_0x6bb2('0xe')];this[_0x6bb2('0xf')]=_0x2e12eb[_0x6bb2('0x10')];this[_0x6bb2('0x11')]=_0x2e12eb[_0x6bb2('0x12')];this[_0x6bb2('0x13')]=_0x2e12eb[_0x6bb2('0x13')];this[_0x6bb2('0x14')]=_0x2e12eb[_0x6bb2('0x14')];this[_0x6bb2('0x15')]=_0x2e12eb['answertime'];this[_0x6bb2('0x16')]=moment()[_0x6bb2('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x2e12eb['responsetime'],_0x2e12eb[_0x6bb2('0x13')]);this[_0x6bb2('0x18')]=getSeconds(_0x2e12eb[_0x6bb2('0x15')],_0x2e12eb[_0x6bb2('0x14')]);this[_0x6bb2('0x19')]=getSeconds(this[_0x6bb2('0x16')],_0x2e12eb['answertime']);this[_0x6bb2('0x1a')]=_0x15b10d['queue'];this['membername']=_0x15b10d[_0x6bb2('0x1b')];this['reason']=_0x15b10d[_0x6bb2('0x1c')];this['callback']=_0x2e12eb[_0x6bb2('0x1d')];this[_0x6bb2('0x1e')]=_0x2e12eb['callbackuniqueid'];this[_0x6bb2('0x1f')]=_0x2e12eb['callbackat'];this['recallme']=_0x2e12eb[_0x6bb2('0x20')];this[_0x6bb2('0x21')]=_0x2e12eb[_0x6bb2('0x21')];this[_0x6bb2('0x22')]=_0x2e12eb[_0x6bb2('0x22')];this[_0x6bb2('0x23')]=_0x2e12eb[_0x6bb2('0x23')];this[_0x6bb2('0x24')]=_0x2e12eb[_0x6bb2('0x24')];this[_0x6bb2('0x25')]=_0x2e12eb['CampaignId'];this[_0x6bb2('0x26')]=_0x2e12eb[_0x6bb2('0x26')]||'';this[_0x6bb2('0x27')]=_0x2e12eb['originatecalleridname']||'';}module[_0x6bb2('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 475e356..c2be340 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 _0x6a0b=['countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x1caebb,_0x264a79){_0x1caebb=_0x1caebb-0x0;var _0x38c588=_0x6a0b[_0x1caebb];return _0x38c588;};'use strict';var util=require(_0xb6a0('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x138eef,_0x16eb4e){var _0x5762d5=moment(_0x138eef)[_0xb6a0('0x1')](0x0);var _0x3e5b73=moment(_0x16eb4e)[_0xb6a0('0x1')](0x0);return _0x5762d5[_0xb6a0('0x2')](_0x3e5b73,_0xb6a0('0x3'));}function Final(_0x4f77a1){this[_0xb6a0('0x4')]=_0x4f77a1[_0xb6a0('0x4')];this[_0xb6a0('0x5')]=_0x4f77a1[_0xb6a0('0x5')];this[_0xb6a0('0x6')]=_0x4f77a1[_0xb6a0('0x6')];this[_0xb6a0('0x7')]=_0x4f77a1[_0xb6a0('0x6')]===_0xb6a0('0x8')?'queue':_0x4f77a1['type'];this['countbusyretry']=_0x4f77a1['countbusyretry'];this['countcongestionretry']=_0x4f77a1[_0xb6a0('0x9')];this['countnoanswerretry']=_0x4f77a1[_0xb6a0('0xa')];this[_0xb6a0('0xb')]=_0x4f77a1['countbusyretry']+_0x4f77a1[_0xb6a0('0x9')]+_0x4f77a1[_0xb6a0('0xa')];this[_0xb6a0('0xc')]=_0x4f77a1[_0xb6a0('0xc')];this[_0xb6a0('0xd')]=_0x4f77a1[_0xb6a0('0xd')];this[_0xb6a0('0xe')]=_0x4f77a1[_0xb6a0('0xe')];this[_0xb6a0('0xf')]=_0x4f77a1[_0xb6a0('0xf')];this['responsetime']=_0x4f77a1[_0xb6a0('0x10')];this[_0xb6a0('0x11')]=_0x4f77a1[_0xb6a0('0x10')];this[_0xb6a0('0x12')]=_0x4f77a1[_0xb6a0('0x12')]||0x0;this[_0xb6a0('0x13')]=_0x4f77a1[_0xb6a0('0x13')]||0x0;this[_0xb6a0('0x14')]=_0x4f77a1[_0xb6a0('0x14')]||0x0;this['callback']=_0x4f77a1[_0xb6a0('0x15')];this[_0xb6a0('0x16')]=_0x4f77a1[_0xb6a0('0x16')];this['callbackat']=_0x4f77a1[_0xb6a0('0x17')];this[_0xb6a0('0x18')]=_0x4f77a1[_0xb6a0('0x18')];this[_0xb6a0('0x19')]=_0x4f77a1[_0xb6a0('0x19')];this['ListId']=_0x4f77a1['ListId'];this[_0xb6a0('0x1a')]=_0x4f77a1[_0xb6a0('0x1a')];this['VoiceQueueId']=_0x4f77a1[_0xb6a0('0x1b')];this['CampaignId']=_0x4f77a1[_0xb6a0('0x1c')];this[_0xb6a0('0x1d')]=_0x4f77a1[_0xb6a0('0x1d')]||'';this['originatecalleridname']=_0x4f77a1[_0xb6a0('0x1e')]||'';}module[_0xb6a0('0x1f')]=Final; \ No newline at end of file +var _0x2eba=['queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','diff','seconds','uniqueid','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eba,0xc7));var _0xa2eb=function(_0x57c45b,_0x2d6c69){_0x57c45b=_0x57c45b-0x0;var _0x3d127e=_0x2eba[_0x57c45b];return _0x3d127e;};'use strict';var util=require('util');var _=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));function getSeconds(_0x42f9dc,_0x2c5b95){var _0x55acba=moment(_0x42f9dc)['milliseconds'](0x0);var _0x45ff67=moment(_0x2c5b95)['milliseconds'](0x0);return _0x55acba[_0xa2eb('0x2')](_0x45ff67,_0xa2eb('0x3'));}function Final(_0x2d3a77){this[_0xa2eb('0x4')]=_0x2d3a77['uniqueid'];this['scheduledat']=_0x2d3a77['scheduledat'];this[_0xa2eb('0x5')]=_0x2d3a77['type'];this[_0xa2eb('0x6')]=_0x2d3a77[_0xa2eb('0x5')]===_0xa2eb('0x7')?'queue':_0x2d3a77['type'];this[_0xa2eb('0x8')]=_0x2d3a77[_0xa2eb('0x8')];this[_0xa2eb('0x9')]=_0x2d3a77['countcongestionretry'];this[_0xa2eb('0xa')]=_0x2d3a77[_0xa2eb('0xa')];this['countglobal']=_0x2d3a77[_0xa2eb('0x8')]+_0x2d3a77['countcongestionretry']+_0x2d3a77[_0xa2eb('0xa')];this[_0xa2eb('0xb')]=_0x2d3a77[_0xa2eb('0xb')];this[_0xa2eb('0xc')]=_0x2d3a77[_0xa2eb('0xc')];this[_0xa2eb('0xd')]=_0x2d3a77['calleridnum'];this[_0xa2eb('0xe')]=_0x2d3a77[_0xa2eb('0xe')];this[_0xa2eb('0xf')]=_0x2d3a77[_0xa2eb('0xf')];this[_0xa2eb('0x10')]=_0x2d3a77[_0xa2eb('0xf')];this[_0xa2eb('0x11')]=_0x2d3a77[_0xa2eb('0x11')]||0x0;this[_0xa2eb('0x12')]=_0x2d3a77[_0xa2eb('0x12')]||0x0;this[_0xa2eb('0x13')]=_0x2d3a77[_0xa2eb('0x13')]||0x0;this['callback']=_0x2d3a77['callback'];this[_0xa2eb('0x14')]=_0x2d3a77[_0xa2eb('0x14')];this[_0xa2eb('0x15')]=_0x2d3a77[_0xa2eb('0x15')];this[_0xa2eb('0x16')]=_0x2d3a77[_0xa2eb('0x16')];this[_0xa2eb('0x17')]=_0x2d3a77['ContactId'];this[_0xa2eb('0x18')]=_0x2d3a77[_0xa2eb('0x18')];this[_0xa2eb('0x19')]=_0x2d3a77[_0xa2eb('0x19')];this[_0xa2eb('0x1a')]=_0x2d3a77['VoiceQueueId'];this['CampaignId']=_0x2d3a77[_0xa2eb('0x1b')];this[_0xa2eb('0x1c')]=_0x2d3a77['originatecalleridnum']||'';this[_0xa2eb('0x1d')]=_0x2d3a77[_0xa2eb('0x1d')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 7bfabe2..39af764 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 _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x5156df,_0x13e151){var _0x54b529=function(_0xd3b93a){while(--_0xd3b93a){_0x5156df['push'](_0x5156df['shift']());}};_0x54b529(++_0x13e151);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x201fd9,_0x1671ee){var _0x42e7fe=function(_0x2608ee){while(--_0x2608ee){_0x201fd9['push'](_0x201fd9['shift']());}};_0x42e7fe(++_0x1671ee);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 1e66fb8..91d9237 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 _0x1794=['name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname'];(function(_0x5aaa11,_0x467d95){var _0x4c9328=function(_0x320736){while(--_0x320736){_0x5aaa11['push'](_0x5aaa11['shift']());}};_0x4c9328(++_0x467d95);}(_0x1794,0x110));var _0x4179=function(_0x2d17a5,_0x2bbbd7){_0x2d17a5=_0x2d17a5-0x0;var _0x5118b6=_0x1794[_0x2d17a5];return _0x5118b6;};'use strict';var util=require(_0x4179('0x0'));var _=require(_0x4179('0x1'));var moment=require(_0x4179('0x2'));function getSeconds(_0x36aa6c,_0x531ea7){var _0x254b2f=moment(_0x36aa6c)[_0x4179('0x3')](0x0);var _0x4d258f=moment(_0x531ea7)[_0x4179('0x3')](0x0);return _0x254b2f[_0x4179('0x4')](_0x4d258f,_0x4179('0x5'));}function History(_0x459ceb){this['uniqueid']=_0x459ceb[_0x4179('0x6')];this[_0x4179('0x7')]=_0x459ceb[_0x4179('0x7')]||undefined;this[_0x4179('0x8')]=_0x459ceb[_0x4179('0x8')];this['campaigntype']=_0x459ceb[_0x4179('0x8')]===_0x4179('0x9')?_0x4179('0xa'):_0x459ceb[_0x4179('0x8')];this[_0x4179('0xb')]=_0x459ceb[_0x4179('0xb')];this[_0x4179('0xc')]=_0x459ceb[_0x4179('0xc')];this[_0x4179('0xd')]=_0x459ceb[_0x4179('0xd')];this[_0x4179('0xe')]=_0x459ceb[_0x4179('0xb')]+_0x459ceb[_0x4179('0xc')]+_0x459ceb['countnoanswerretry'];this[_0x4179('0xa')]=_0x459ceb[_0x4179('0xa')];this[_0x4179('0xf')]=_0x459ceb[_0x4179('0x10')];this['calleridnum']=_0x459ceb[_0x4179('0x11')];this[_0x4179('0x12')]=_0x459ceb[_0x4179('0x12')];this[_0x4179('0x13')]=_0x459ceb[_0x4179('0x13')];this[_0x4179('0x14')]=_0x459ceb[_0x4179('0x13')];this[_0x4179('0x15')]=getSeconds(_0x459ceb['responsetime'],_0x459ceb[_0x4179('0x12')]);this[_0x4179('0x16')]=0x0;this[_0x4179('0x17')]=0x0;this[_0x4179('0x18')]=_0x459ceb[_0x4179('0x18')];this[_0x4179('0x19')]=_0x459ceb[_0x4179('0x19')];this[_0x4179('0x1a')]=_0x459ceb[_0x4179('0x1a')];this[_0x4179('0x1b')]=_0x459ceb['recallme'];this[_0x4179('0x1c')]=_0x459ceb[_0x4179('0x1c')];this[_0x4179('0x1d')]=_0x459ceb[_0x4179('0x1d')];this[_0x4179('0x1e')]=_0x459ceb['UserId'];this[_0x4179('0x1f')]=_0x459ceb[_0x4179('0x1f')];this['CampaignId']=_0x459ceb[_0x4179('0x20')];this[_0x4179('0x21')]=_0x459ceb[_0x4179('0x21')]||'';this[_0x4179('0x22')]=_0x459ceb[_0x4179('0x22')]||'';}module[_0x4179('0x23')]=History; \ No newline at end of file +var _0x23d3=['countbusyretry','countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x3bba35,_0x472df5){var _0x52512f=function(_0x41c188){while(--_0x41c188){_0x3bba35['push'](_0x3bba35['shift']());}};_0x52512f(++_0x472df5);}(_0x23d3,0x16a));var _0x323d=function(_0x2f2d58,_0x47377d){_0x2f2d58=_0x2f2d58-0x0;var _0x2f3f27=_0x23d3[_0x2f2d58];return _0x2f3f27;};'use strict';var util=require(_0x323d('0x0'));var _=require(_0x323d('0x1'));var moment=require('moment');function getSeconds(_0x2e1081,_0x11a792){var _0x8c47ad=moment(_0x2e1081)[_0x323d('0x2')](0x0);var _0xa794b1=moment(_0x11a792)[_0x323d('0x2')](0x0);return _0x8c47ad[_0x323d('0x3')](_0xa794b1,'seconds');}function History(_0x2d6e20){this[_0x323d('0x4')]=_0x2d6e20[_0x323d('0x4')];this[_0x323d('0x5')]=_0x2d6e20['scheduledat']||undefined;this[_0x323d('0x6')]=_0x2d6e20['type'];this[_0x323d('0x7')]=_0x2d6e20[_0x323d('0x6')]===_0x323d('0x8')?_0x323d('0x9'):_0x2d6e20[_0x323d('0x6')];this[_0x323d('0xa')]=_0x2d6e20[_0x323d('0xa')];this['countcongestionretry']=_0x2d6e20['countcongestionretry'];this[_0x323d('0xb')]=_0x2d6e20[_0x323d('0xb')];this[_0x323d('0xc')]=_0x2d6e20['countbusyretry']+_0x2d6e20['countcongestionretry']+_0x2d6e20['countnoanswerretry'];this[_0x323d('0x9')]=_0x2d6e20[_0x323d('0x9')];this[_0x323d('0xd')]=_0x2d6e20['name'];this[_0x323d('0xe')]=_0x2d6e20[_0x323d('0xf')];this[_0x323d('0x10')]=_0x2d6e20['starttime'];this[_0x323d('0x11')]=_0x2d6e20[_0x323d('0x11')];this[_0x323d('0x12')]=_0x2d6e20[_0x323d('0x11')];this[_0x323d('0x13')]=getSeconds(_0x2d6e20['responsetime'],_0x2d6e20[_0x323d('0x10')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x323d('0x14')]=_0x2d6e20[_0x323d('0x14')];this['callbackuniqueid']=_0x2d6e20['callbackuniqueid'];this[_0x323d('0x15')]=_0x2d6e20[_0x323d('0x15')];this[_0x323d('0x16')]=_0x2d6e20[_0x323d('0x16')];this[_0x323d('0x17')]=_0x2d6e20[_0x323d('0x17')];this[_0x323d('0x18')]=_0x2d6e20[_0x323d('0x18')];this['UserId']=_0x2d6e20[_0x323d('0x19')];this[_0x323d('0x1a')]=_0x2d6e20[_0x323d('0x1a')];this[_0x323d('0x1b')]=_0x2d6e20[_0x323d('0x1b')];this['originatecalleridnum']=_0x2d6e20[_0x323d('0x1c')]||'';this['originatecalleridname']=_0x2d6e20[_0x323d('0x1d')]||'';}module[_0x323d('0x1e')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 8d23d84..f2fe292 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 _0xdf70=['[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','queueCallerAbandonCreateState','predictiveIntervalDroppedCallsCallersExit','Abandoned','dropreason','CALLEREXIT','roundrobin','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','ListId','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','match','object','originate','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','check\x20failure','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangBusyFactor','Trunk','active','callerid','format','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','pick','ContactId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','saveInDb','moveContactManagedDialer','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]'];(function(_0x3d3cb3,_0x28c7f0){var _0x2393c1=function(_0x53d716){while(--_0x53d716){_0x3d3cb3['push'](_0x3d3cb3['shift']());}};_0x2393c1(++_0x28c7f0);}(_0xdf70,0xfc));var _0x0df7=function(_0x455a6e,_0x46a422){_0x455a6e=_0x455a6e-0x0;var _0x398121=_0xdf70[_0x455a6e];return _0x398121;};'use strict';var util=require(_0x0df7('0x0'));var _=require(_0x0df7('0x1'));var BPromise=require(_0x0df7('0x2'));var uuid=require('uuid');var moment=require(_0x0df7('0x3'));var rr=require('rr');var md5=require(_0x0df7('0x4'));var Redis=require(_0x0df7('0x5'));var config=require(_0x0df7('0x6'));var logger=require(_0x0df7('0x7'))(_0x0df7('0x8'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x0df7('0x7'))(_0x0df7('0x9'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x0df7('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x0df7('0xa')]=_['defaults'](config[_0x0df7('0xa')],{'host':_0x0df7('0xb'),'port':0x18eb});var io=require(_0x0df7('0xc'))(new Redis(config['redis']));var cmHopper=require(_0x0df7('0xd'));var cmHopperFinal=require(_0x0df7('0xe'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0df7('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x0df7('0x10'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x0df7('0x11'));var Hangup=require(_0x0df7('0x12'));var ipAgi=process[_0x0df7('0x13')][_0x0df7('0x14')]||_0x0df7('0x15');var strategy={'rrmemory':_0x0df7('0x16'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x0df7('0x17')][_0x0df7('0x18')]=function(_0x493bc7){this[_0x0df7('0x19')]=this[_0x0df7('0x19')]?this[_0x0df7('0x19')][_0x0df7('0x1a')](_0x493bc7):_0x493bc7();};function Dialer(_0xa66206,_0x20f039){this[_0x0df7('0x1b')]=new Sequence();this['preview']=_0x20f039;this[_0x0df7('0x1c')]=_0xa66206[_0x0df7('0x1c')];this['campaigns']=_0xa66206[_0x0df7('0x1d')];this[_0x0df7('0x1e')]=_0xa66206['agents'];this[_0x0df7('0x1f')]=_0xa66206[_0x0df7('0x1f')];this[_0x0df7('0x20')]=config[_0x0df7('0x20')]||0x2;this[_0x0df7('0x21')]={};this[_0x0df7('0x22')]={};this[_0x0df7('0x23')]={};this[_0x0df7('0x24')]={};this['optionPredictive']={};this[_0x0df7('0x25')]={};this[_0x0df7('0x26')]={};this[_0x0df7('0x27')]={};this[_0x0df7('0x28')]={};this[_0x0df7('0x29')]={};ami['on'](_0x0df7('0x2a'),this[_0x0df7('0x2b')][_0x0df7('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x2d'),this[_0x0df7('0x2e')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x2f'),this[_0x0df7('0x30')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x31'),this[_0x0df7('0x32')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x33'),this[_0x0df7('0x34')]['bind'](this));ami['on'](_0x0df7('0x35'),this[_0x0df7('0x36')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x37'),this[_0x0df7('0x38')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x39'),this[_0x0df7('0x3a')]['bind'](this));ami['on'](_0x0df7('0x3b'),this[_0x0df7('0x3c')][_0x0df7('0x2c')](this));this['loopCampaigns']();this[_0x0df7('0x3d')]();}function isNotNull(_0x1fff2b){return _0x1fff2b!==null&&!_[_0x0df7('0x3e')](_0x1fff2b);}function checkIsLoggedIn(_0x3f8a64,_0x2ab4d9){return function(){if(_0x2ab4d9<=0x0){_0x3f8a64[_0x0df7('0x3f')]='AGENTS_NOT_LOGGED';throw _0x3f8a64[_0x0df7('0x40')]+_0x0df7('0x41');}};}function isActive(_0x4cee7c){return _0x4cee7c;}function checkIsActive(_0x4a0221,_0x476e59){return function(){if(!isActive(_0x476e59)){_0x4a0221[_0x0df7('0x3f')]=_0x0df7('0x42');throw _0x4a0221[_0x0df7('0x40')]+_0x0df7('0x43');}};}function checkInterval(_0x1ea0eb){return function(){if(!isNotNull(_0x1ea0eb[_0x0df7('0x44')])){_0x1ea0eb['message']=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+_0x0df7('0x46');}if(!isNotNull(_0x1ea0eb[_0x0df7('0x44')][_0x0df7('0x47')])){_0x1ea0eb[_0x0df7('0x3f')]=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0df7('0x48')](_0x1ea0eb[_0x0df7('0x44')]['Intervals']))){_0x1ea0eb[_0x0df7('0x3f')]=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+_0x0df7('0x46');}};}function msgResponse(_0x3f0633,_0x1b5da7,_0x5ac2e4){return{'action':_0x3f0633,'response':_0x1b5da7,'message':_0x5ac2e4,'stack':_0x5ac2e4};}function myreject(_0x51d0a3){return function(_0x2c5458){return _0x51d0a3(msgResponse(_0x0df7('0x49'),_0x0df7('0x4a'),JSON[_0x0df7('0x4b')](_0x2c5458)));};}function getSeconds(_0x2b7da0,_0x285d6b){var _0x23ed8e=moment(_0x2b7da0)[_0x0df7('0x4c')](0x0);var _0x2eb747=moment(_0x285d6b)[_0x0df7('0x4c')](0x0);return _0x23ed8e[_0x0df7('0x4d')](_0x2eb747,'seconds');}function emit(_0x2c4737,_0x2520d8,_0x3ab167){io['to'](_0x2c4737)[_0x0df7('0x4e')](_0x2520d8,_0x3ab167);}function emitVoiceQueueSummary(_0x3cb05a){if(_0x3cb05a[_0x0df7('0x4f')]===_0x0df7('0x50')){var _0x1d5121={'id':_0x3cb05a['id'],'name':_0x3cb05a[_0x0df7('0x40')],'strategy':_0x3cb05a[_0x0df7('0x51')],'answered':_0x3cb05a[_0x0df7('0x52')],'available':_0x3cb05a[_0x0df7('0x53')],'loggedIn':_0x3cb05a[_0x0df7('0x54')],'pTalking':_0x3cb05a[_0x0df7('0x55')],'sumBillable':_0x3cb05a[_0x0df7('0x56')],'sumDuration':_0x3cb05a[_0x0df7('0x57')],'sumHoldTime':_0x3cb05a[_0x0df7('0x58')]||0x0,'talking':_0x3cb05a['talking'],'total':_0x3cb05a[_0x0df7('0x59')],'type':_0x3cb05a[_0x0df7('0x4f')],'unmanaged':_0x3cb05a['unmanaged'],'abandoned':_0x3cb05a[_0x0df7('0x5a')],'waiting':_0x3cb05a[_0x0df7('0x5b')],'loggedInDb':_0x3cb05a[_0x0df7('0x5c')],'dialActive':_0x3cb05a[_0x0df7('0x5d')],'dialMethod':_0x3cb05a[_0x0df7('0x5e')],'dialOriginateCallerIdName':_0x3cb05a[_0x0df7('0x5f')],'dialOriginateCallerIdNumber':_0x3cb05a[_0x0df7('0x60')],'dialOriginateTimeout':_0x3cb05a[_0x0df7('0x61')],'dialPrefix':_0x3cb05a['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3cb05a[_0x0df7('0x62')],'outboundAnswerCallsDay':_0x3cb05a[_0x0df7('0x63')],'outboundBlacklistCallsDay':_0x3cb05a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3cb05a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3cb05a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3cb05a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cb05a[_0x0df7('0x64')],'outboundDropCallsDayTimeout':_0x3cb05a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3cb05a[_0x0df7('0x65')],'outboundNoSuchCallsDay':_0x3cb05a['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3cb05a[_0x0df7('0x66')],'outboundReCallsDay':_0x3cb05a[_0x0df7('0x67')],'outboundRejectCallsDay':_0x3cb05a['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3cb05a[_0x0df7('0x68')],'predictiveIntervalAnsweredCalls':_0x3cb05a[_0x0df7('0x69')],'predictiveIntervalAvgHoldtime':_0x3cb05a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3cb05a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3cb05a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3cb05a[_0x0df7('0x6a')],'predictiveIntervalErlangCalls':_0x3cb05a[_0x0df7('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x3cb05a[_0x0df7('0x6c')],'predictiveIntervalHitRate':_0x3cb05a[_0x0df7('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x3cb05a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3cb05a[_0x0df7('0x6e')],'predictiveIntervalAvailable':_0x3cb05a[_0x0df7('0x6f')],'predictiveIntervalTotalCalls':_0x3cb05a[_0x0df7('0x70')],'message':_0x3cb05a['message'],'originated':_0x3cb05a[_0x0df7('0x71')],'erlangCalls':_0x3cb05a['erlangCalls'],'erlangCallToSecond':_0x3cb05a['erlangCallToSecond'],'erlangAbandonmentRate':_0x3cb05a['erlangAbandonmentRate'],'erlangBusyFactor':_0x3cb05a[_0x0df7('0x72')],'startPredictive':_0x3cb05a[_0x0df7('0x25')],'startProgressive':_0x3cb05a['startProgressive']};if(_0x3cb05a['Trunk']){_0x1d5121['Trunk']={'id':_0x3cb05a[_0x0df7('0x73')]['id'],'name':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x40')],'active':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x74')],'callerid':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x75')]};}if(_0x3cb05a[_0x0df7('0x44')]){_0x1d5121[_0x0df7('0x44')]={'id':_0x3cb05a['Interval']['id'],'name':_0x3cb05a['Interval'][_0x0df7('0x40')]};}var _0x56bb48=md5(JSON[_0x0df7('0x4b')](_0x1d5121));if(_0x3cb05a['md5']!==_0x56bb48){_0x3cb05a[_0x0df7('0x4')]=_0x56bb48;emit(util[_0x0df7('0x76')]('voice:queue:%s',_0x1d5121[_0x0df7('0x40')]),'voice_queue:save',_0x1d5121);}}}function emitCampaignSummary(_0xa6a2b6){if(_0xa6a2b6['type']==='ivr'){emit(util[_0x0df7('0x76')]('campaign:ivr:%s',_0xa6a2b6[_0x0df7('0x40')]),'campaign:save',_0xa6a2b6);}}function checkGetDataPredictive(_0x19eca4){if(isNotNull(_0x19eca4)){if(!_[_0x0df7('0x48')](_0x19eca4)){loggerPredictive[_0x0df7('0x77')](_0x0df7('0x78'));loggerPredictive['info'](_0x0df7('0x79'),_0x19eca4['predictiveIntervalTotalCalls']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7a'),_0x19eca4[_0x0df7('0x69')]);loggerPredictive[_0x0df7('0x77')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19eca4[_0x0df7('0x6a')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7b'),_0x19eca4['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7c'),_0x19eca4[_0x0df7('0x7d')]);loggerPredictive['info'](_0x0df7('0x7e'),_0x19eca4[_0x0df7('0x7f')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x80'));if(_0x19eca4[_0x0df7('0x70')]>0x0){if(!_[_0x0df7('0x3e')](_0x19eca4[_0x0df7('0x7f')])&&_0x19eca4['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x81'));}if(!_[_0x0df7('0x3e')](_0x19eca4[_0x0df7('0x7d')])&&_0x19eca4[_0x0df7('0x7d')]>0x0){return!![];}else{loggerPredictive[_0x0df7('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x82'));}}else{loggerPredictive[_0x0df7('0x77')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x83'));}return![];}function mergeDataErlangB(_0xc2e0a9){return function(_0x327588){loggerPredictive['info'](_0x0df7('0x84'));loggerPredictive[_0x0df7('0x77')](_0x0df7('0x85'),_0x327588['erlangCalls']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x86'),_0x327588['erlangCallToSecond']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x87'),_0x327588['erlangAbandonmentRate']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x88'),_0x327588['erlangBusyFactor']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x87'),_0x327588[_0x0df7('0x89')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x80'));_[_0x0df7('0x8a')](_0xc2e0a9,_0x327588);};}function getDiff(_0x3e91ca){var _0x2a74f3=moment()[_0x0df7('0x4c')](0x0);var _0x28fa99=moment(_0x3e91ca)['milliseconds'](0x0);return _0x2a74f3['diff'](_0x28fa99,_0x0df7('0x8b'));}function ifInterval(_0x498839,_0x4ab852){if(_[_0x0df7('0x3e')](_0x4ab852)){return![];}if(getDiff(_0x4ab852)<_0x498839*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5d7415){if(isNotNull(_0x5d7415)){if(!_[_0x0df7('0x3e')](_0x5d7415[_0x0df7('0x26')])){_0x5d7415[_0x0df7('0x26')]=undefined;loggerPredictive[_0x0df7('0x77')](_0x5d7415[_0x0df7('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x0df7('0x3e')](_0x5d7415[_0x0df7('0x25')])){_0x5d7415[_0x0df7('0x25')]=undefined;loggerPredictive['info'](_0x5d7415[_0x0df7('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0df7('0x3e')](_0x5d7415['handlePredictive'])){clearInterval(_0x5d7415[_0x0df7('0x8c')]);_0x5d7415[_0x0df7('0x8c')]=undefined;loggerPredictive[_0x0df7('0x77')](_0x5d7415[_0x0df7('0x40')],_0x0df7('0x8d'));}}}function erlangb(_0x48d36a,_0x10dd68){if(_0x10dd68===0x0){return 0x0;}var _0x27a1ec=0x1;for(var _0x528acf=0x1;_0x528acf<=_0x10dd68;_0x528acf+=0x1){_0x27a1ec=0x1+_0x27a1ec*_0x528acf/_0x48d36a;}return 0x1/_0x27a1ec;}function isVoiceQueueOutbound(_0x304050){return _0x304050==='outbound';}function isNotPreview(_0x1b4d12){return _0x1b4d12!==_0x0df7('0x8e');}function isCampaignIvr(_0x774c09){return _0x774c09===_0x0df7('0x8f');}function getCallerId(_0xbf8719,_0x56309f,_0x1b1327){if(!_[_0x0df7('0x3e')](_0x1b1327)&&_0x0df7('0x90')===typeof _0x1b1327&&!_[_0x0df7('0x48')](_0x1b1327)){if(!_['isUndefined'](_0x56309f)&&_0x0df7('0x90')===typeof _0x56309f&&!_['isEmpty'](_0x56309f)){return util[_0x0df7('0x76')](_0x0df7('0x91'),_0x56309f,_0x1b1327);}return util['format'](_0x0df7('0x91'),_0x1b1327,_0x1b1327);}if(!_[_0x0df7('0x3e')](_0xbf8719)&&_0x0df7('0x90')===typeof _0xbf8719&&!_[_0x0df7('0x48')](_0xbf8719)){return _0xbf8719;}return _0x0df7('0x92');}function loggerCatchQueueSummary(_0x503065,_0x2caf0d){return function(_0x29b4ae){freeVariablesPredictive(_0x2caf0d);emitVoiceQueueSummary(_0x2caf0d);emitCampaignSummary(_0x2caf0d);loggerSyncQueueSummary[_0x0df7('0x93')](_0x503065,util[_0x0df7('0x94')](_0x29b4ae,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24f890,_0x1786a6){return function(_0x2f06bc){loggerPredictive[_0x0df7('0x93')](_0x1786a6[_0x0df7('0x40')],_0x24f890);loggerPredictive['error'](_0x2f06bc[_0x0df7('0x95')]);freeVariablesPredictive(_0x1786a6);};}function loggerCatch(_0x4405e4){return function(_0x4f394d){logger['error'](_0x4405e4,util['inspect'](_0x4f394d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3f19e3){return _0x3f19e3&&!_[_0x0df7('0x3e')](_0x3f19e3)&&_0x3f19e3[_0x0df7('0x96')]>0x0;}function decremetOriginate(_0x32106d){if(!_[_0x0df7('0x3e')](_0x32106d)&&_0x32106d!==null){if(_0x32106d[_0x0df7('0x97')](_0x0df7('0x71'))){if(_0x32106d[_0x0df7('0x71')]>0x0){_0x32106d[_0x0df7('0x71')]-=0x1;}else{logger[_0x0df7('0x93')](_0x0df7('0x98'));}}}else{logger[_0x0df7('0x93')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x42a48a,_0x54a047,_0x5515dd){if(_0x54a047>_0x5515dd){for(var _0x35bfca=0x0;_0x35bfca<_0x54a047-_0x5515dd;_0x35bfca+=0x1){decremetOriginate(_0x42a48a);}}}function loggerGetContactDialer(_0x3ddc54,_0x3578f9,_0x285723){return function(_0x334a8b){checkContactLowerLimitOriginate(_0x3578f9,_0x285723,0x0);logger[_0x0df7('0x93')](_0x3ddc54,util['inspect'](_0x334a8b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2e13b3){return function(_0x527c23){if(isNotNull(_0x527c23)&&isNotNull(_0x527c23[0x0])){if(_0x527c23[0x0][_0x0df7('0x99')]>0x0){_0x2e13b3[_0x0df7('0x3f')]='RESCHEDULED_CONTACTS';logger[_0x0df7('0x77')](_0x0df7('0x9a')+_0x2e13b3['name'],_0x527c23[0x0][_0x0df7('0x99')],_0x0df7('0x9b'));}else{_0x2e13b3[_0x0df7('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x0df7('0x9c')+_0x2e13b3[_0x0df7('0x40')]);}}};}function notSendMessagesQueue(_0x1f7560){if(_0x1f7560[_0x0df7('0x9d')]){freeVariablesPredictive(_0x1f7560);if(_0x1f7560[_0x0df7('0x71')]===0x0&&_0x1f7560[_0x0df7('0x9e')]===0x0&&_0x1f7560[_0x0df7('0x5b')]===0x0&&(_0x1f7560[_0x0df7('0x55')]||0x0)===0x0){_0x1f7560[_0x0df7('0x9d')]=![];_0x1f7560[_0x0df7('0x53')]=0x0;_0x1f7560[_0x0df7('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1f7560[_0x0df7('0x40')],_0x0df7('0x9f'));}else{_0x1f7560['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x0df7('0x93')](_0x0df7('0xa0'),_0x1f7560['name'],_0x0df7('0xa1'));}emitVoiceQueueSummary(_0x1f7560);}}function notSendMessagesCampaign(_0x364df6){if(_0x364df6['sendMessageOneNotActive']){if(_0x364df6[_0x0df7('0x71')]===0x0){_0x364df6[_0x0df7('0x9d')]=![];_0x364df6['message']=_0x0df7('0x42');loggerSyncQueueSummary[_0x0df7('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x364df6[_0x0df7('0x40')],_0x0df7('0x9f'));}else{_0x364df6['message']=_0x0df7('0xa2');loggerSyncQueueSummary[_0x0df7('0x93')](_0x0df7('0xa3'),_0x364df6[_0x0df7('0x40')],'is\x20disactive');}emitCampaignSummary(_0x364df6);}}function createObjHistory(_0x5a317e,_0x38ba21,_0x576013,_0x590686,_0x3bcd96){_0x5a317e[_0x0df7('0x3f')]=_0x576013;var _0x458af7=new Action(_0x5a317e,_0x38ba21);var _0x4bd7f9=new History(_0x458af7);_0x4bd7f9['state']=_0x590686;_0x4bd7f9[_0x0df7('0xa4')]=_0x3bcd96;_0x4bd7f9[_0x0df7('0xa5')]=_0x458af7[_0x0df7('0xa6')];return _0x4bd7f9;}Dialer[_0x0df7('0x17')][_0x0df7('0x3d')]=function(){var _0xd628bb=this;setInterval(function(){_0xd628bb[_0x0df7('0xa7')](_0xd628bb[_0x0df7('0x24')],_0x0df7('0xa8'));_0xd628bb[_0x0df7('0xa7')](_0xd628bb[_0x0df7('0x22')],'[actions]');},0x32c8);};Dialer[_0x0df7('0x17')][_0x0df7('0xa7')]=function(_0x266909,_0x4cb395){var _0x236416=this;for(var _0x854aed in _0x266909){if(_0x266909['hasOwnProperty'](_0x854aed)){this[_0x0df7('0x1b')]['enqueue'](function(){if(!_[_0x0df7('0xa9')](_0x266909[_0x854aed])){return ami[_0x0df7('0xaa')]({'action':_0x0df7('0xab'),'channel':_0x266909[_0x854aed][_0x0df7('0xac')]})[_0x0df7('0xad')](function(_0x1495b5){if(_0x1495b5[_0x0df7('0x3f')]===_0x0df7('0xae')){setTimeout(function(){if(_0x266909[_0x854aed]&&_0x266909[_0x854aed][_0x0df7('0x4f')]!=='ivr'){_0x236416[_0x0df7('0xaf')](_0x236416['voiceQueues'][_0x266909[_0x854aed]['queue']]);logger[_0x0df7('0x93')](_0x0df7('0xb0'),_0x4cb395,_0x854aed,_0x266909[_0x854aed][_0x0df7('0xb1')]);delete _0x266909[_0x854aed];}if(_0x266909[_0x854aed]&&_0x266909[_0x854aed][_0x0df7('0x4f')]===_0x0df7('0x8f')){_0x236416[_0x0df7('0xaf')](_0x236416[_0x0df7('0x1d')][_0x266909[_0x854aed][_0x0df7('0xb1')]]);logger['error'](_0x0df7('0xb2'),_0x4cb395,_0x854aed,_0x266909[_0x854aed][_0x0df7('0xb1')]);delete _0x266909[_0x854aed];}},0x2328);}});}});}}};Dialer['prototype'][_0x0df7('0xb3')]=function(_0x2fb804){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper[_0x0df7('0xb3')](_0x2fb804))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb6')));};Dialer['prototype'][_0x0df7('0xb7')]=function(_0x4f2cb7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperBlack[_0x0df7('0xb7')](_0x4f2cb7))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb8')));};Dialer[_0x0df7('0x17')][_0x0df7('0xb9')]=function(_0x3440f7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperBlack[_0x0df7('0xb9')](_0x3440f7))[_0x0df7('0xad')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0df7('0x17')]['averageHandleTime']=function(_0x4af1d7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperHistory[_0x0df7('0xba')](_0x4af1d7))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xbb')));};Dialer[_0x0df7('0x17')][_0x0df7('0xbc')]=function(_0x319e0c){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper['rescheduleContact'](_0x319e0c))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xbd')));};Dialer[_0x0df7('0x17')][_0x0df7('0xbe')]=function(_0x59ee0d,_0x4e083b,_0x4fa11a,_0x30235e){return BPromise['resolve']()[_0x0df7('0xb5')](cmHopper[_0x0df7('0xbe')](_0x59ee0d,_0x4e083b,_0x4fa11a,_0x30235e))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x0df7('0x17')]['getContactDialerIvr']=function(_0x5e873a,_0x2dfd67,_0x2c6279){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x5e873a,_0x2dfd67,_0x2c6279))[_0x0df7('0xad')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x0df7('0xbf')]=function(_0x40bdb8){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](voiceQueueRt[_0x0df7('0xbf')](_0x40bdb8))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xc0')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1e83d9){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper['moveContactManagedDialer'](_0x1e83d9))[_0x0df7('0xad')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x0df7('0x17')][_0x0df7('0xc1')]=function(_0x325b85){return BPromise['resolve']()['then'](cmHopperHistory[_0x0df7('0xc1')](_0x325b85))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xc2')));};Dialer[_0x0df7('0x17')]['updateOriginated']=function(_0x229aa7){if(!_[_0x0df7('0x3e')](_0x229aa7)&&_0x229aa7!==null){if(_0x229aa7[_0x0df7('0x97')](_0x0df7('0x71'))){if(_0x229aa7['originated']>0x0){_0x229aa7[_0x0df7('0x71')]-=0x1;}else{logger[_0x0df7('0x93')](_0x0df7('0xc3'));}}}else{logger[_0x0df7('0x93')](_0x0df7('0xc4'));}};Dialer[_0x0df7('0x17')][_0x0df7('0xc5')]=function(_0x26ba73,_0x594407){var _0x238d46=this;return function(_0x9184a4){_0x238d46[_0x0df7('0xaf')](_0x594407);logger[_0x0df7('0x93')](_0x26ba73,util['inspect'](_0x9184a4,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x3e031a,_0x42dca1,_0x31f060){var _0x5910cb={'state':0x19,'statedesc':'notFound'};this[_0x0df7('0xaf')](_0x42dca1);this['saveInDb'](_['merge'](_0x5910cb,_[_0x0df7('0xc6')](_0x31f060,[_0x0df7('0xc7'),'ListId','UserId','VoiceQueueId',_0x0df7('0xc8')])),_0x0df7('0xc9'),'[emptyContact]');logger[_0x0df7('0x93')](_0x3e031a);};Dialer['prototype'][_0x0df7('0xca')]=function(_0xf1e997){return _0xf1e997===_0x0df7('0xcb');};Dialer[_0x0df7('0x17')][_0x0df7('0xcc')]=function(_0x6f6485){return!_['isUndefined'](_0x6f6485)&&_0x6f6485&&!_[_0x0df7('0x3e')](_0x6f6485[_0x0df7('0x40')])&&!_['isUndefined'](_0x6f6485[_0x0df7('0x74')])&&_0x6f6485[_0x0df7('0x74')]&&(this[_0x0df7('0x1f')][util[_0x0df7('0x76')]('SIP/%s',_0x6f6485[_0x0df7('0x40')])][_0x0df7('0xab')]===_0x0df7('0xcd')||this['trunks'][util[_0x0df7('0x76')](_0x0df7('0xce'),_0x6f6485[_0x0df7('0x40')])][_0x0df7('0xab')]===_0x0df7('0xcf'));};Dialer[_0x0df7('0x17')][_0x0df7('0xd0')]=function(_0x1ee1f1,_0x143c84,_0x392d76){this[_0x0df7('0xc1')](_0x1ee1f1)[_0x0df7('0xad')](loggerCatch(_0x143c84));this[_0x0df7('0xd1')](_0x1ee1f1)[_0x0df7('0xad')](loggerCatch(_0x392d76));};Dialer[_0x0df7('0x17')]['syncVarSet']=function(_0x1a7441){var _0x133e13=this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];var _0x28c6db;if(!_[_0x0df7('0xa9')](_0x1a7441)&&!_[_0x0df7('0xa9')](_0x1a7441[_0x0df7('0xd3')])&&!_[_0x0df7('0xa9')](_0x1a7441[_0x0df7('0xd3')][_0x0df7('0xd4')])&&_0x1a7441[_0x0df7('0xd5')]===_0x0df7('0xd6')&&_0x133e13){if(_0x133e13[_0x0df7('0x4f')]!=='ivr'&&this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441['value']===_0x0df7('0xd8')){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x133e13['queue']]);this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0x0df7('0x1c')][_0x133e13['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x12;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xda');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');this['saveInDb'](_0x28c6db,_0x0df7('0xdd'),_0x0df7('0xde'));}if(_0x133e13[_0x0df7('0x4f')]!==_0x0df7('0x8f')&&this[_0x0df7('0x1c')][_0x133e13['queue']][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]===_0x0df7('0xe0')){delete this['uniqueId'][_0x1a7441[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0x63')]+=0x1;this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0x62')]+=0x1;_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x13;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xe1');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');_0x28c6db[_0x0df7('0xe2')]=!![];this['saveInDb'](_0x28c6db,_0x0df7('0xe3'),_0x0df7('0xe4'));}if(_0x133e13[_0x0df7('0x4f')]===_0x0df7('0x8f')&&this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]===_0x0df7('0xd8')){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]]);_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db['state']=0x12;_0x28c6db['statedesc']=_0x0df7('0xda');_0x28c6db[_0x0df7('0xdb')]='AMD';this['saveInDb'](_0x28c6db,_0x0df7('0xe5'),_0x0df7('0xe6'));}if(_0x133e13[_0x0df7('0x4f')]===_0x0df7('0x8f')&&this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]==='MACHINE'){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x133e13['queue']]);_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x13;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xe1');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');_0x28c6db['amd']=!![];this[_0x0df7('0xd0')](_0x28c6db,_0x0df7('0xe7'),_0x0df7('0xe8'));}}};Dialer[_0x0df7('0x17')][_0x0df7('0x34')]=function(_0x4780de){var _0x1da651=this['uniqueId'][_0x4780de[_0x0df7('0xd2')]];var _0x5967ab=this;var _0x4f9b3e;if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]===_0x0df7('0x8f')){delete this['uniqueId'][_0x4780de[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1d')][_0x1da651['queue']][_0x0df7('0xe9')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);this[_0x0df7('0xc1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xea')));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xeb')));}if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]!=='ivr'&&isNotNull(this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0xec')])){delete this[_0x0df7('0x24')][_0x4780de[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x1da651['queue']][_0x0df7('0x63')]+=0x1;this['voiceQueues'][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0x62')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);_0x4f9b3e[_0x0df7('0xd9')]=0x10;_0x4f9b3e[_0x0df7('0xa4')]=_0x0df7('0xed');_0x4f9b3e[_0x0df7('0xdb')]='AGI';this['createHistory'](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xeb')));}if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]!==_0x0df7('0x8f')&&!isNotNull(this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0xec')])){delete this[_0x0df7('0x24')][_0x4780de[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0x68')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);_0x4f9b3e[_0x0df7('0xd9')]=0xc;_0x4f9b3e['statedesc']=_0x4780de['cause-txt'];_0x4f9b3e[_0x0df7('0xdb')]=_0x0df7('0xee');this[_0x0df7('0xc1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xea')));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x0df7('0x30')]=function(_0xb87fc6){var _0xd0816e=this['uniqueId'][_0xb87fc6[_0x0df7('0xd2')]];var _0x5319d2=this;if(this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]]){if(_0xd0816e&&_0xd0816e['type']!==_0x0df7('0x8f')){delete this[_0x0df7('0x24')][_0xb87fc6[_0x0df7('0xd2')]];this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x53a49d=new AgentComplete(_0xd0816e,_0xb87fc6);if(_0xb87fc6[_0x0df7('0xef')]===_0x0df7('0xf0')){_0x53a49d['agiafterat']=this[_0x0df7('0x1c')][_0xb87fc6[_0x0df7('0xb1')]][_0x0df7('0xf1')]&&this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]][_0x0df7('0xf2')]?moment()['format'](_0x0df7('0xf3')):undefined;}this[_0x0df7('0xc1')](_0x53a49d)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0df7('0xd1')](_0x53a49d)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xf4')));}}};Dialer[_0x0df7('0x17')]['syncAgentConnect']=function(_0x30cc00){if(this[_0x0df7('0x1c')][_0x30cc00['queue']]){if(this['uniqueId'][_0x30cc00[_0x0df7('0xd2')]]&&this[_0x0df7('0x24')][_0x30cc00[_0x0df7('0xd2')]][_0x0df7('0x4f')]!==_0x0df7('0x8f')){this['updateOriginated'](this[_0x0df7('0x1c')][_0x30cc00[_0x0df7('0xb1')]]);this[_0x0df7('0x24')][_0x30cc00['uniqueid']][_0x0df7('0xf5')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));}}};Dialer[_0x0df7('0x17')]['queueCallerAbandonCreateState']=function(_0x14234a){this[_0x0df7('0xc1')](_0x14234a)[_0x0df7('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0df7('0xd1')](_0x14234a)['catch'](loggerCatch(_0x0df7('0xf6')));};Dialer[_0x0df7('0x17')][_0x0df7('0xf7')]=function(_0x1f512e){var _0x390025=this[_0x0df7('0x24')][_0x1f512e[_0x0df7('0xd2')]];var _0x1b8b88=this;if(this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]){if(_0x390025&&_0x390025['type']!=='ivr'){delete this[_0x0df7('0x24')][_0x1f512e[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]);_0x390025[_0x0df7('0xf8')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5997aa=new QueueCallerAbandon(_0x390025,_0x1f512e);if(getSeconds(_0x390025[_0x0df7('0xf8')],_0x390025[_0x0df7('0xf9')])>=_0x390025[_0x0df7('0xfa')]){this[_0x0df7('0x1c')][_0x1f512e['queue']][_0x0df7('0x6a')]+=0x1;this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0x6c')]+=0x1;_0x5997aa['state']=0xa;_0x5997aa[_0x0df7('0xa4')]=_0x0df7('0xfb');_0x5997aa['dropreason']=_0x0df7('0xfc');_0x5997aa[_0x0df7('0xfd')]=this['voiceQueues'][_0x1f512e['queue']][_0x0df7('0xf1')]?moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x0df7('0xfe')](_0x5997aa);}else{this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0xff')]+=0x1;this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0x64')]+=0x1;_0x5997aa['state']=0xb;_0x5997aa[_0x0df7('0xa4')]=_0x0df7('0x100');_0x5997aa[_0x0df7('0x101')]=_0x0df7('0x102');this[_0x0df7('0xfe')](_0x5997aa);}}}};Dialer[_0x0df7('0x17')][_0x0df7('0x36')]=function(_0x1ad20e){if(this['actions'][_0x1ad20e['uniqueid']]){this[_0x0df7('0x22')][_0x1ad20e[_0x0df7('0xd2')]]['channel']=_0x1ad20e[_0x0df7('0xac')];}if(this['uniqueId'][_0x1ad20e[_0x0df7('0xd2')]]){this[_0x0df7('0x24')][_0x1ad20e['uniqueid']]['channel']=_0x1ad20e[_0x0df7('0xac')];}};Dialer['prototype']['syncQueueMember']=function(_0x490f63){if(strategy[this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x490f63['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]===_0x0df7('0x103')){if(this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]]&&_['isNil'](this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x105')])&&_0x490f63[_0x0df7('0xab')]==='1'&&_0x490f63[_0x0df7('0x106')]==='0'){if(this[_0x0df7('0x1e')][_0x490f63['stateinterface']]){if(!this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]][_0x0df7('0x105')]){this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]]['locked']=!![];this['actions'][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x105')]=!![];this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x107')]=_0x490f63[_0x0df7('0x107')];}}}}else if((strategy[this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0xb1')]][_0x0df7('0x51')]]||_0x0df7('0x16'))===_0x0df7('0x16')){if(this[_0x0df7('0x22')][_0x490f63['actionid']]){if(this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]]){this['actions'][_0x490f63['actionid']][_0x0df7('0x107')]=_0x490f63[_0x0df7('0x107')];if(_[_0x0df7('0xa9')](this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]]['queue']])){this['queueBooked'][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0xb1')]]=[];}this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x490f63['actionid']][_0x0df7('0xb1')]][_0x0df7('0x108')](_['merge'](_['pick'](this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]],[_0x0df7('0x109'),'stateinterface']),{'status':_0x490f63[_0x0df7('0xab')],'paused':_0x490f63[_0x0df7('0x106')]}));}}}};function unlockQueueStatus(_0x15d976,_0x1f656d){setTimeout(function(){if(_['isUndefined'](_0x15d976[_0x0df7('0x10a')])){loggerBooked[_0x0df7('0x93')](_0x0df7('0x10b'),_0x1f656d);}_0x15d976[_0x0df7('0x10a')]=!![];loggerBooked[_0x0df7('0x77')](_0x0df7('0x10c'),_0x1f656d,JSON[_0x0df7('0x4b')](_[_0x0df7('0xc6')](_0x15d976,[_0x0df7('0x40'),_0x0df7('0x10a')])));},0x1f3);}Dialer[_0x0df7('0x17')][_0x0df7('0x3c')]=function(_0x261265){var _0x34c458=this;var _0x44a413=_0x34c458[_0x0df7('0x1c')][_0x34c458['actions'][_0x261265['actionid']][_0x0df7('0xb1')]];if(strategy[this['voiceQueues'][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]===_0x0df7('0x103')){if(this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]&&this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x107')]){this['preview']['run'](this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0x109')],this['actions'][_0x261265['actionid']][_0x0df7('0x107')])[_0x0df7('0xad')](function(_0xdb1161){logger[_0x0df7('0x93')](_0x0df7('0x10d'),util['inspect'](_0xdb1161,{'showHidden':![],'depth':null}));})[_0x0df7('0x1a')](function(){_0x34c458[_0x0df7('0xaf')](_0x34c458[_0x0df7('0x1c')][_0x34c458[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]);_0x34c458['agents'][_0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x107')]]['locked']=![];delete _0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]];unlockQueueStatus(_0x44a413);});}else{this[_0x0df7('0xaf')](this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]['queue']]);this[_0x0df7('0xbc')]({'active':![],'ContactId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xc7')],'ListId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x10e')],'VoiceQueueId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x10f')]||undefined,'CampaignId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]['CampaignId']||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x110')));delete this['actions'][_0x261265[_0x0df7('0x104')]];unlockQueueStatus(_0x44a413);}}else if((strategy[this['voiceQueues'][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]||_0x0df7('0x16'))===_0x0df7('0x16')){var _0x3d2b39;if(this['actions'][_0x261265[_0x0df7('0x104')]]&&!_[_0x0df7('0x48')](this[_0x0df7('0x28')][this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]])){if(this[_0x0df7('0x29')][_0x34c458[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]){this[_0x0df7('0x29')][_0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]=this[_0x0df7('0x29')][this['actions'][_0x261265[_0x0df7('0x104')]]['queue']]?this['queueBookedRR'][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]:this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]?this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x111')]||0x0:0x0;}this[_0x0df7('0x28')][this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]['_rr']=this[_0x0df7('0x29')][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]];for(var _0x788416=0x0;_0x788416=0x0?!![]:![];})['catch'](myreject(_0x450e4a)));}}else{_0x4fc150[_0x0df7('0x108')](ami[_0x0df7('0xaa')]({'action':_0x0df7('0x125'),'command':util[_0x0df7('0x76')]('iftime\x20%s,%s',_0x43a38f,!_['isUndefined'](config[_0x0df7('0x123')][_0x381f0e])?_0x381f0e:'')})[_0x0df7('0xb5')](function(_0xa2b997){return _0xa2b997['content'][_0x0df7('0x129')](_0x0df7('0x12a'))>=0x0?!![]:![];})[_0x0df7('0xad')](myreject(_0x450e4a)));}BPromise['all'](_0x4fc150)['then'](function(_0x18491e){var _0x4ec63b=_[_0x0df7('0x12b')](_0x18491e);if(_0x4ec63b){return _0x1d9382(_0x4ec63b);}else{_0x243101[_0x0df7('0x3f')]=_0x1751c8?_0x0df7('0x12c'):'INTERVAL_IS_OVERTIME';return _0x450e4a(msgResponse(_0x0df7('0x12d'),_0x0df7('0x120'),_0x0df7('0x12e')+_0x1751c8+'\x20'+_0x16af3a+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x43a38f,{'showHidden':![],'depth':null})+_0x0df7('0x12f')+_0x381f0e));}})[_0x0df7('0xad')](function(_0x186638){return _0x450e4a(msgResponse(_0x0df7('0x11e'),_0x0df7('0x120'),JSON[_0x0df7('0x4b')](_0x186638)));});});};Dialer[_0x0df7('0x17')]['checkDialMethod']=function(_0x594ee6){var _0x590c0e=this;return function(){switch(_0x594ee6[_0x0df7('0x5e')]){case'progressive':freeVariablesPredictive(_0x594ee6);_0x590c0e[_0x0df7('0x130')](_0x594ee6,0x1);break;case _0x0df7('0x131'):freeVariablesPredictive(_0x594ee6);_0x590c0e[_0x0df7('0x130')](_0x594ee6,_0x594ee6[_0x0df7('0x132')]);break;case _0x0df7('0x9'):_0x590c0e[_0x0df7('0x9')](_0x594ee6);break;case _0x0df7('0x133'):freeVariablesPredictive(_0x594ee6);_0x590c0e['handlePower'](_0x594ee6,0x1);break;default:freeVariablesPredictive(_0x594ee6);logger[_0x0df7('0x93')](_0x0df7('0x134'),_0x594ee6['name'],_0x0df7('0x135'));}};};Dialer[_0x0df7('0x17')][_0x0df7('0x136')]=function(_0x53c4c0){var _0x1b9bc0=this;return function(){_0x1b9bc0[_0x0df7('0x137')](_0x53c4c0);};};Dialer[_0x0df7('0x17')]['syncQueueSummary']=function(_0x54fd10){var _0x348783=this;if(isNotPreview(_0x54fd10[_0x0df7('0x5e')])){if(isVoiceQueueOutbound(_0x54fd10[_0x0df7('0x4f')])&&isActive(_0x54fd10['dialActive'])){_0x54fd10[_0x0df7('0x9d')]=!![];BPromise['resolve']()[_0x0df7('0xb5')](checkIsLoggedIn(_0x54fd10,_0x54fd10[_0x0df7('0x54')]))['then'](checkIsActive(_0x54fd10,_0x54fd10[_0x0df7('0x5d')]))[_0x0df7('0xb5')](checkInterval(_0x54fd10))[_0x0df7('0xb5')](_0x348783['checkIsTrunkReachable'](_0x54fd10))['then'](_0x348783[_0x0df7('0x11d')](_0x54fd10[_0x0df7('0x138')],_0x54fd10[_0x0df7('0x139')],_0x54fd10['name'],_0x54fd10))['then'](_0x348783['checkIfTimeIntervals'](_0x54fd10[_0x0df7('0x44')],_0x54fd10[_0x0df7('0x139')],_0x54fd10[_0x0df7('0x40')],_0x54fd10))['then'](_0x348783['checkDialMethod'](_0x54fd10))['catch'](loggerCatchQueueSummary(_0x0df7('0x13a'),_0x54fd10));}else{notSendMessagesQueue(_0x54fd10);}}else{freeVariablesPredictive(_0x54fd10);}};Dialer['prototype'][_0x0df7('0x13b')]=function(){var _0x259515=this;var _0x573b34;for(var _0x4627cb in this[_0x0df7('0x1d')]){if(this[_0x0df7('0x1d')][_0x0df7('0x97')](_0x4627cb)){_0x573b34=this['campaigns'][_0x4627cb];if(isCampaignIvr(_0x573b34[_0x0df7('0x4f')])&&isActive(_0x573b34[_0x0df7('0x74')])){_0x573b34[_0x0df7('0x9d')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x573b34,_0x573b34[_0x0df7('0x74')]))['then'](checkInterval(_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x119')](_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x11d')](_0x573b34['dialGlobalInterval'],_0x573b34[_0x0df7('0x139')],_0x573b34[_0x0df7('0x40')],_0x573b34))[_0x0df7('0xb5')](_0x259515['checkIfTimeIntervals'](_0x573b34[_0x0df7('0x44')],_0x573b34['dialTimezone'],_0x573b34['name'],_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x136')](_0x573b34))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x573b34));}else{notSendMessagesCampaign(_0x573b34);}}}};function getCallerIdRandom(_0xbafec8,_0x5145fd){var _0x4a8d85,_0x1ffa00,_0x156f11;if(_0x5145fd<=0x0){_0x5145fd=0x1;}_0x4a8d85=new RegExp(_0x0df7('0x13c')+_0x5145fd+'}$');_0x1ffa00=Math[_0x0df7('0x13d')](0xa,_0x5145fd-0x1);_0x156f11=Math[_0x0df7('0x13d')](0xa,_0x5145fd)-0x1;return util[_0x0df7('0x76')]('%s',_['replace'](_0xbafec8,_0x4a8d85,_['random'](_0x1ffa00,_0x156f11)));}function extractCalleridName(_0x2ee095){var _0x20e761=_0x2ee095['match'](/"(.*?)"/);return _0x20e761?_0x20e761[0x1]:_0x2ee095;}function extractCalleridNumber(_0x4bb3a6){var _0x71a0ea=_0x4bb3a6[_0x0df7('0x13e')](/<(.*?)>/);return _0x71a0ea?_0x71a0ea[0x1]:_0x4bb3a6;}Dialer['prototype']['actionOriginate']=function(_0x1e79c8,_0x2ee7c9){var _0x8da59f=this;var _0x5656e0=uuid['v4']();this[_0x0df7('0x22')][_0x5656e0]=new Action(_0x1e79c8,_0x2ee7c9,_0x5656e0);return new BPromise(function(_0x2ed564,_0x341dbd){if(_[_0x0df7('0x3e')](_0x1e79c8)&&_0x0df7('0x13f')!==typeof _0x1e79c8){return _0x341dbd(msgResponse(_0x0df7('0x140'),_0x0df7('0x120'),'voiceQueue\x20is\x20undefine'));}if(_[_0x0df7('0x3e')](_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')])||_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]===null){return _0x341dbd(msgResponse(_0x0df7('0x140'),'Failure',_0x0df7('0x143')));}var _0xdd3a49={'XMD-CALLERID':_0x8da59f['actions'][_0x5656e0]['getCaller'](),'XMD-AGI':_0x1e79c8[_0x0df7('0xec')]?util['format'](_0x0df7('0x144'),ipAgi,_0x1e79c8['dialQueueProject']):_0x0df7('0x145'),'XMD-AGIAFTER':_0x1e79c8[_0x0df7('0xf1')]?util[_0x0df7('0x76')](_0x0df7('0x144'),ipAgi,_0x1e79c8[_0x0df7('0xf1')]):_0x0df7('0x145'),'XMD-QUEUE':_0x1e79c8[_0x0df7('0x4f')]===_0x0df7('0x50')?util['format'](_0x0df7('0x146'),_0x1e79c8[_0x0df7('0x40')],_0x1e79c8[_0x0df7('0x147')]||'',_0x1e79c8[_0x0df7('0xf2')]?'c':'',_0x1e79c8[_0x0df7('0xfa')]||0x3):'NONE','XMD-CONTACTID':_0x2ee7c9[_0x0df7('0xc7')],'XMD-CDRTYPE':_0x0df7('0x8'),'CALLERID(all)':_0x8da59f['actions'][_0x5656e0][_0x0df7('0x148')](),'XMD-AMD':_0x1e79c8[_0x0df7('0xd7')]?_0x0df7('0x149'):_0x0df7('0x145'),'XMD-DESTINATION':_0x0df7('0xd6')};if(_0x1e79c8[_0x0df7('0xd7')]){_0xdd3a49[_0x0df7('0x14a')]=_0x1e79c8['dialAMDInitialSilence']||0x9c4;_0xdd3a49[_0x0df7('0x14b')]=_0x1e79c8['dialAMDGreeting']||0x5dc;_0xdd3a49[_0x0df7('0x14c')]=_0x1e79c8[_0x0df7('0x14d')]||0x320;_0xdd3a49['XMD-AMDTOTALANALYSISTIME']=_0x1e79c8[_0x0df7('0x14e')]||0x1388;_0xdd3a49[_0x0df7('0x14f')]=_0x1e79c8['dialAMDMinWordLength']||0x64;_0xdd3a49[_0x0df7('0x150')]=_0x1e79c8['dialAMDBetweenWordsSilence']||0x32;_0xdd3a49[_0x0df7('0x151')]=_0x1e79c8[_0x0df7('0x152')]||0x3;_0xdd3a49[_0x0df7('0x153')]=_0x1e79c8[_0x0df7('0x154')]||0x100;_0xdd3a49[_0x0df7('0x155')]=_0x1e79c8[_0x0df7('0x156')]||0x1388;}if(_0x1e79c8[_0x0df7('0x4f')]===_0x0df7('0x50')){_0xdd3a49['XMD-VOICEQUEUEID']=_0x2ee7c9[_0x0df7('0x10f')];}else{_0xdd3a49[_0x0df7('0x157')]=_0x2ee7c9['CampaignId'];}for(var _0x17fe44 in _0x2ee7c9[_0x0df7('0x141')]){if(_0x2ee7c9[_0x0df7('0x141')]['hasOwnProperty'](_0x17fe44)){if(isNotNull(_0x2ee7c9['Contact'][_0x17fe44])&&_0x17fe44!=='id'&&_0x17fe44!==_0x0df7('0x158')&&_0x17fe44!==_0x0df7('0x159')&&_0x17fe44!=='updatedAt'){_0xdd3a49[util[_0x0df7('0x76')](_0x0df7('0x15a'),'XMD-',_['toUpper'](_0x17fe44))]=_0x2ee7c9[_0x0df7('0x141')][_0x17fe44];}}}var _0x2775de=_0x8da59f[_0x0df7('0xcc')](_0x1e79c8[_0x0df7('0x73')])?getCallerId(_0x1e79c8[_0x0df7('0x73')][_0x0df7('0x75')],_0x1e79c8['dialOriginateCallerIdName'],_0x1e79c8[_0x0df7('0x15b')]>0x0?getCallerIdRandom(_0x1e79c8[_0x0df7('0x60')],_0x1e79c8[_0x0df7('0x15b')]):_0x1e79c8[_0x0df7('0x60')]):getCallerId(_[_0x0df7('0xa9')](_0x1e79c8[_0x0df7('0x11a')])?_0x1e79c8[_0x0df7('0x73')]['callerid']:_0x1e79c8[_0x0df7('0x11a')]['callerid'],_0x1e79c8[_0x0df7('0x5f')],_0x1e79c8[_0x0df7('0x15b')]>0x0?getCallerIdRandom(_0x1e79c8[_0x0df7('0x60')],_0x1e79c8[_0x0df7('0x15b')]):_0x1e79c8[_0x0df7('0x60')]);if(_0x2775de){_0xdd3a49[_0x0df7('0x15c')]=_0x8da59f[_0x0df7('0x22')][_0x5656e0][_0x0df7('0x15d')]=extractCalleridName(_0x2775de);_0xdd3a49[_0x0df7('0x15e')]=_0x8da59f[_0x0df7('0x22')][_0x5656e0][_0x0df7('0x15f')]=extractCalleridNumber(_0x2775de);}return ami['Action']({'actionid':_0x5656e0,'action':'originate','channel':_0x8da59f['isTrunkReachable'](_0x1e79c8['Trunk'])?util['format']('SIP/%s/%s%s',_0x1e79c8[_0x0df7('0x73')][_0x0df7('0x40')],isNotNull(_0x1e79c8[_0x0df7('0x160')])?_0x1e79c8[_0x0df7('0x160')][_0x0df7('0x161')]()||'':'',_0x1e79c8[_0x0df7('0x162')]>0x0?_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]['substring'](_0x1e79c8[_0x0df7('0x162')]):_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]):util[_0x0df7('0x76')](_0x0df7('0x163'),_[_0x0df7('0xa9')](_0x1e79c8[_0x0df7('0x11a')])?_0x1e79c8[_0x0df7('0x73')]['name']:_0x1e79c8['TrunkBackup'][_0x0df7('0x40')],isNotNull(_0x1e79c8[_0x0df7('0x160')])?_0x1e79c8[_0x0df7('0x160')][_0x0df7('0x161')]()||'':'',_0x1e79c8[_0x0df7('0x162')]>0x0?_0x2ee7c9[_0x0df7('0x141')]['phone'][_0x0df7('0x164')](_0x1e79c8[_0x0df7('0x162')]):_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]),'callerid':_0x2775de,'Exten':_0x0df7('0xd6'),'Context':'from-sip','Priority':'1','variable':_0xdd3a49,'timeout':(_0x1e79c8[_0x0df7('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5656e0})[_0x0df7('0xb5')](function(_0x46a480){return _0x2ed564(_0x46a480);})[_0x0df7('0xad')](function(_0xba96ea){_0x1e79c8[_0x0df7('0x66')]+=0x1;var _0x1ab4e2=new History(_0x8da59f[_0x0df7('0x22')][_0x5656e0]);logger[_0x0df7('0x93')](util[_0x0df7('0x76')]('[originateError]:\x20%s',JSON['stringify'](_0xba96ea)));_0x1ab4e2[_0x0df7('0xd9')]=0xe;_0x1ab4e2[_0x0df7('0xa4')]=_0x0df7('0x165');_0x1ab4e2[_0x0df7('0xa6')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));_0x1ab4e2[_0x0df7('0xa5')]=_0x1ab4e2[_0x0df7('0xa6')];_0x8da59f[_0x0df7('0xc1')](_0x1ab4e2)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x166')));_0x8da59f[_0x0df7('0xd1')](_0x1ab4e2)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x166')))[_0x0df7('0x1a')](function(){delete _0x8da59f['actions'][_0x5656e0];return _0x341dbd(msgResponse(_0x0df7('0x140'),_0x0df7('0x4a'),'originate\x20action\x20Error'));});});});};Dialer[_0x0df7('0x17')][_0x0df7('0x2e')]=function(_0x506b2d){var _0x303475=this[_0x0df7('0x22')][_0x506b2d[_0x0df7('0x104')]];var _0x2f6259=this;if(_0x303475){delete this[_0x0df7('0x22')][_0x506b2d[_0x0df7('0x104')]];_0x303475[_0x0df7('0xf9')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x44ab97=_0x303475['type']===_0x0df7('0x8f')?this[_0x0df7('0x1d')][_0x303475[_0x0df7('0xb1')]]:this[_0x0df7('0x1c')][_0x303475['getQueue']()];if(!this[_0x0df7('0xca')](_0x506b2d[_0x0df7('0x167')])){this[_0x0df7('0xaf')](_0x44ab97);return this[_0x0df7('0x168')](_0x303475,_0x44ab97,_0x506b2d)['then'](function(_0x334e79){})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x169')));}else{this[_0x0df7('0x24')][_0x506b2d[_0x0df7('0xd2')]]=_0x303475;}}};Dialer[_0x0df7('0x17')][_0x0df7('0x16a')]=function(_0x555266,_0xe7abcb,_0x5a281){var _0x3fb8f8=new History(_0xe7abcb);if(_0x3fb8f8['countbusyretry']+_0x3fb8f8[_0x0df7('0x16b')]+_0x3fb8f8[_0x0df7('0x16c')]>=_0x5a281['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x555266){case 0x3:if(_0x3fb8f8[_0x0df7('0x16c')]>=_0x5a281[_0x0df7('0x16d')]-0x1){return!![];}else{this[_0x0df7('0xbc')]({'active':![],'countnoanswerretry':_0x3fb8f8[_0x0df7('0x16c')]+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281['dialNoAnswerRetryFrequency'],_0x0df7('0x16f'))[_0x0df7('0x76')](_0x0df7('0xf3')),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8['ListId'],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8[_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x170')));}break;case 0x5:if(_0x3fb8f8[_0x0df7('0x171')]>=_0x5a281[_0x0df7('0x172')]-0x1){return!![];}else{this[_0x0df7('0xbc')]({'active':![],'countbusyretry':_0x3fb8f8[_0x0df7('0x171')]+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281[_0x0df7('0x173')],_0x0df7('0x16f'))[_0x0df7('0x76')](_0x0df7('0xf3')),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8[_0x0df7('0x10e')],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8[_0x0df7('0xc8')]||undefined})['catch'](loggerCatch(_0x0df7('0x174')));}break;case 0x8:if(_0x3fb8f8[_0x0df7('0x16b')]>=_0x5a281[_0x0df7('0x175')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x3fb8f8['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281['dialCongestionRetryFrequency'],_0x0df7('0x16f'))[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8['ListId'],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8['CampaignId']||undefined})[_0x0df7('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x0df7('0x17')][_0x0df7('0x168')]=function(_0x207d78,_0x5dfbd5,_0x494905){var _0x3a5d8c=this;var _0x541267=new History(_0x207d78);return new BPromise(function(_0x8ecc9b,_0x47fa67){if(_[_0x0df7('0x3e')](_0x5dfbd5)&&'object'!==typeof _0x5dfbd5){return _0x47fa67(msgResponse(_0x0df7('0x176'),_0x0df7('0x120'),_0x0df7('0x177')));}if(_[_0x0df7('0x3e')](_0x494905)&&_0x0df7('0x13f')!==typeof _0x494905){return _0x47fa67(msgResponse(_0x0df7('0x176'),_0x0df7('0x120'),_0x0df7('0x178')));}switch(_0x494905[_0x0df7('0xef')]){case'0':_0x5dfbd5[_0x0df7('0x179')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x0;_0x541267[_0x0df7('0xa4')]='NoSuchNumber';_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x17a')));if(_0x3a5d8c['checkRetriveMax'](0x0,_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']+_0x541267[_0x0df7('0x16b')]+_0x541267[_0x0df7('0x16c')]>=_0x5dfbd5[_0x0df7('0x17b')]){_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x200\x20no\x20such\x20number....');}else{_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5dfbd5[_0x0df7('0x65')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x3;_0x541267[_0x0df7('0xa4')]=_0x0df7('0x17e');_0x541267[_0x0df7('0x16c')]+=0x1;_0x541267[_0x0df7('0x17f')]+=0x1;_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x180')));if(_0x3a5d8c[_0x0df7('0x16a')](0x3,_0x207d78,_0x5dfbd5)){if(_0x541267['countnoanswerretry']>=_0x5dfbd5[_0x0df7('0x16d')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x181'));}else{_0x3a5d8c['stateGlobal'](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x181'));}}break;case'5':_0x5dfbd5[_0x0df7('0x182')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x5;_0x541267[_0x0df7('0xa4')]=_0x0df7('0x183');_0x541267[_0x0df7('0x171')]+=0x1;_0x541267[_0x0df7('0x17f')]+=0x1;_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x184')));if(_0x3a5d8c[_0x0df7('0x16a')](0x5,_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']>=_0x5dfbd5[_0x0df7('0x172')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x205\x20busy');}else{_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x185'));}}break;case'8':_0x5dfbd5[_0x0df7('0x186')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x8;_0x541267[_0x0df7('0xa4')]='Congestion';_0x541267[_0x0df7('0x16b')]+=0x1;_0x541267['countglobal']+=0x1;_0x3a5d8c['createHistory'](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x187')));if(_0x3a5d8c[_0x0df7('0x16a')](0x8,_0x207d78,_0x5dfbd5)){if(_0x541267[_0x0df7('0x16b')]>=_0x5dfbd5[_0x0df7('0x175')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x208\x20congestion');}else{_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x208\x20congestion');}}break;default:_0x5dfbd5[_0x0df7('0x68')]+=0x1;_0x541267[_0x0df7('0xd9')]=0xc;_0x541267[_0x0df7('0xa4')]=_0x494905[_0x0df7('0xef')];_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x188')));if(_0x3a5d8c['checkRetriveMax'](_0x494905[_0x0df7('0xef')],_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']+_0x541267[_0x0df7('0x16b')]+_0x541267['countnoanswerretry']>=_0x5dfbd5[_0x0df7('0x17b')]){_0x3a5d8c['stateGlobal'](_0x541267,_0x8ecc9b,_0x47fa67,_0x494905[_0x0df7('0xef')]);}else{_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,_0x494905[_0x0df7('0xef')]);}}}});};Dialer[_0x0df7('0x17')][_0x0df7('0x17c')]=function(_0x396948,_0x52373d,_0x1c2b18,_0x191578){var _0x13439e=new Final(_0x396948);_0x13439e[_0x0df7('0xd9')]=0xf;_0x13439e[_0x0df7('0xa4')]=_0x0df7('0x189');this[_0x0df7('0x17d')](_0x13439e,_0x52373d,_0x1c2b18,_0x191578);};Dialer['prototype'][_0x0df7('0x17d')]=function(_0x3deb77,_0x22b935,_0x44bd1d,_0x4a818d){this['moveContactManagedDialer'](_0x3deb77)[_0x0df7('0xb5')](function(_0x431b0a){return _0x22b935(msgResponse(_0x0df7('0x176'),_0x0df7('0xcb'),_0x4a818d));})[_0x0df7('0xad')](function(_0xffc51c){return _0x44bd1d(msgResponse(_0x0df7('0x18a'),_0x0df7('0x120'),_0x0df7('0x18b')));});};Dialer[_0x0df7('0x17')][_0x0df7('0x9')]=function(_0x3fcea7){var _0x11b6a3=this;var _0x2367e5=_0x3fcea7[_0x0df7('0x18c')]/0x64;var _0x39f3e0=_0x3fcea7[_0x0df7('0x18d')]/(_0x3fcea7[_0x0df7('0x18d')]+_0x3fcea7[_0x0df7('0x63')]);var _0x381347=Math[_0x0df7('0x18e')](_0x3fcea7[_0x0df7('0x6f')]*(_0x3fcea7[_0x0df7('0x18f')]/0x64));var _0x4cd5c0=Math['round'](_0x3fcea7[_0x0df7('0x6f')]*(_0x3fcea7[_0x0df7('0x190')]/0x64));var _0x587f24=_0x3fcea7[_0x0df7('0x53')]+_0x3fcea7['talking'];var _0x2d45bf=Math[_0x0df7('0x191')](_0x3fcea7[_0x0df7('0x192')]*_0x3fcea7[_0x0df7('0x89')]*_0x3fcea7['predictiveIntervalHitRate']*_0x3fcea7['predictiveIntervalMultiplicativeFactor']);if(_[_0x0df7('0x3e')](_0x3fcea7['startProgressive'])){if(!_[_0x0df7('0x3e')](_0x3fcea7[_0x0df7('0x25')])){_0x3fcea7[_0x0df7('0x25')]=undefined;loggerPredictive[_0x0df7('0x93')](_0x0df7('0x193'),_0x0df7('0x194'));}if(!_['isUndefined'](_0x3fcea7[_0x0df7('0x8c')])){loggerPredictive['error'](_0x0df7('0x193'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3fcea7[_0x0df7('0x8c')]);_0x3fcea7[_0x0df7('0x8c')]=undefined;}_0x3fcea7[_0x0df7('0x26')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x3fcea7[_0x0df7('0x26')]);this[_0x0df7('0x130')](_0x3fcea7,0x1);}else if(ifInterval(_0x3fcea7[_0x0df7('0x195')],_0x3fcea7['startProgressive'])){this[_0x0df7('0x130')](_0x3fcea7,0x1);loggerPredictiveCalls['info'](_0x0df7('0x196'),_0x3fcea7[_0x0df7('0x26')],_0x3fcea7[_0x0df7('0x40')]);_0x3fcea7[_0x0df7('0x192')]=0x0;_0x3fcea7[_0x0df7('0x6c')]=0x0;}else if(_0x2367e5<_0x39f3e0&&_0x3fcea7['dialPredictiveOptimization']===_0x0df7('0x197')){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x198'),_0x0df7('0x199'),_0x39f3e0,_0x0df7('0x26'),_0x3fcea7['name']);}else if(_0x2d45bf<_0x3fcea7[_0x0df7('0x6c')]&&_0x3fcea7[_0x0df7('0x19a')]===_0x0df7('0x197')){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0df7('0x19b'),_0x2d45bf,'Drop\x20in\x20this\x20interval',_0x3fcea7['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3fcea7[_0x0df7('0x40')]);}else if(!ifInterval(_0x3fcea7['dialPredictiveInterval'],_0x3fcea7[_0x0df7('0x26')])&&_[_0x0df7('0x3e')](_0x3fcea7[_0x0df7('0x25')])&&!_['isUndefined'](_0x3fcea7[_0x0df7('0x26')])){_0x3fcea7[_0x0df7('0x25')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'started\x20in\x20predictive\x20at',_0x3fcea7[_0x0df7('0x25')]);this[_0x0df7('0x19c')](_0x3fcea7[_0x0df7('0x195')])[_0x0df7('0xb5')](this[_0x0df7('0x19d')](_0x3fcea7))[_0x0df7('0xb5')](mergeDataErlangB(_0x3fcea7))['then'](this[_0x0df7('0x19e')](_0x3fcea7))[_0x0df7('0xad')](loggerCatchPredictive(_0x0df7('0x19f'),_0x3fcea7));}else if(!ifInterval(_0x3fcea7[_0x0df7('0x195')],_0x3fcea7['startPredictive'])){_0x3fcea7[_0x0df7('0x6c')]=0x0;_0x3fcea7[_0x0df7('0x25')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'recalculate\x20predictive\x20at',_0x3fcea7[_0x0df7('0x25')]);clearInterval(_0x3fcea7[_0x0df7('0x8c')]);_0x3fcea7[_0x0df7('0x8c')]=undefined;this['averageHandleTime'](_0x3fcea7['dialPredictiveInterval'])[_0x0df7('0xb5')](this['getDataPredictive'](_0x3fcea7))['then'](mergeDataErlangB(_0x3fcea7))['then'](this[_0x0df7('0x19e')](_0x3fcea7))[_0x0df7('0xad')](loggerCatchPredictive(_0x0df7('0x1a0'),_0x3fcea7));}else if(_0x3fcea7[_0x0df7('0x6f')]&&_0x587f24<_0x3fcea7[_0x0df7('0x6f')]-_0x4cd5c0){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')](_0x3fcea7['name'],_0x0df7('0x1a1'),_0x587f24,_0x0df7('0x1a2'),_0x3fcea7[_0x0df7('0x6f')],'-',_0x4cd5c0,'=',_0x3fcea7[_0x0df7('0x6f')]-_0x4cd5c0,')');}else if(_0x3fcea7[_0x0df7('0x6f')]&&_0x587f24>_0x3fcea7[_0x0df7('0x6f')]+_0x381347){freeVariablesPredictive(_0x3fcea7);loggerPredictive['info'](_0x3fcea7[_0x0df7('0x40')],_0x0df7('0x1a1'),_0x587f24,_0x0df7('0x1a3'),_0x3fcea7['predictiveIntervalAvailable'],'+',_0x381347,'=',_0x3fcea7[_0x0df7('0x6f')]+_0x381347,')');}};Dialer[_0x0df7('0x17')][_0x0df7('0x19d')]=function(_0x3c0184){var _0x11ee53=this;return function(_0x520e10){return new BPromise(function(_0x2e1347,_0x3cb203){_[_0x0df7('0x8a')](_0x3c0184,_0x520e10[0x0]);if(checkGetDataPredictive(_0x520e10[0x0])){var _0x300b16=_0x3c0184[_0x0df7('0x6f')]=_0x3c0184[_0x0df7('0x9e')]+_0x3c0184['available'];var _0x40194e=_0x3c0184[_0x0df7('0x195')]*0x3c;var _0x90fa9=_0x520e10[0x0]['predictiveIntervalAvgTalktime']+_0x520e10[0x0]['predictiveIntervalAvgHoldtime'];var _0x2d1373=(_0x520e10[0x0]['predictiveIntervalAnsweredCalls']+_0x520e10[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x520e10[0x0][_0x0df7('0xff')])/_0x520e10[0x0][_0x0df7('0x70')];_0x3c0184[_0x0df7('0x6d')]=_0x2d1373>0x0?_0x2d1373:0x1;switch(_0x3c0184[_0x0df7('0x19a')]){case _0x0df7('0x197'):var _0x55f19c=_0x3c0184[_0x0df7('0x18c')]/0x64;return _0x11ee53[_0x0df7('0x1a4')](_0x300b16,_0x40194e,_0x90fa9,_0x2d1373,_0x55f19c)['then'](function(_0x415c41){return _0x2e1347(_0x415c41);});case _0x0df7('0x1a5'):var _0x21087d=_0x3c0184['dialPredictiveOptimizationPercentage']/0x64;return _0x11ee53['busyFactor'](_0x300b16,_0x40194e,_0x90fa9,_0x2d1373,_0x21087d)[_0x0df7('0xb5')](function(_0x2bc6ea){return _0x2e1347(_0x2bc6ea);});default:return _0x3cb203(msgResponse(_0x0df7('0x1a6'),'Failure',_0x0df7('0x1a7')));}}else{return _0x3cb203(msgResponse(_0x0df7('0x1a6'),_0x0df7('0x120'),'check\x20failure'));}});};};Dialer[_0x0df7('0x17')]['getDataPredictiveOld']=function(_0x5c2438){var _0xb01591=this;return function(_0x1fff7d){return new BPromise(function(_0x4afc71,_0x4dfe1e){_[_0x0df7('0x8a')](_0x5c2438,_0x1fff7d[0x0]);if(checkGetDataPredictive(_0x1fff7d[0x0])){loggerPredictive[_0x0df7('0x77')](JSON['stringify'](_0x1fff7d[0x0]));if(_0x5c2438[_0x0df7('0x19a')]===_0x0df7('0x197')){return _0xb01591['getVoiceQueueRtPauses'](_0x5c2438['id'])[_0x0df7('0xb5')](function(_0x1ce6ff){var _0x10f887=_0x5c2438['loggedIn']-_0x1ce6ff[0x0][_0x0df7('0x1a8')];var _0x378149=_0x5c2438[_0x0df7('0x195')]*0x3c;var _0x116cc0=_0x1fff7d[0x0][_0x0df7('0x7f')]+_0x1fff7d[0x0][_0x0df7('0x7d')];var _0x5c7264=(_0x1fff7d[0x0][_0x0df7('0x69')]+_0x1fff7d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1fff7d[0x0][_0x0df7('0xff')])/_0x1fff7d[0x0][_0x0df7('0x70')];var _0x2e5dba=_0x5c2438['dialPredictiveOptimizationPercentage']/0x64;_0x5c2438[_0x0df7('0x6e')]=_0x1ce6ff[0x0][_0x0df7('0x1a8')]||0x0;_0x5c2438[_0x0df7('0x6d')]=_0x5c7264>0x0?_0x5c7264:0x1;return _0xb01591[_0x0df7('0x1a4')](_0x10f887,_0x378149,_0x116cc0,_0x5c7264,_0x2e5dba);})[_0x0df7('0xb5')](function(_0x2656a2){return _0x4afc71(_0x2656a2);})[_0x0df7('0xad')](function(_0x2f9003){return _0x4dfe1e(msgResponse('[CatchErlangB]',_0x0df7('0x120'),JSON[_0x0df7('0x4b')](_0x2f9003)));});}if(_0x5c2438[_0x0df7('0x19a')]==='agentBusyFactor'){return _0xb01591[_0x0df7('0xbf')](_0x5c2438['id'])['then'](function(_0x536639){var _0x164a63=_0x5c2438[_0x0df7('0x54')]-_0x536639[0x0][_0x0df7('0x1a8')];var _0x4245b6=_0x5c2438['dialPredictiveInterval']*0x3c;var _0x3e4ca3=_0x1fff7d[0x0][_0x0df7('0x7f')]+_0x1fff7d[0x0][_0x0df7('0x7d')];var _0x26e36b=(_0x1fff7d[0x0][_0x0df7('0x69')]+_0x1fff7d[0x0][_0x0df7('0x6a')]+_0x1fff7d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1fff7d[0x0][_0x0df7('0x70')];var _0x58c562=_0x5c2438[_0x0df7('0x18c')]/0x64;_0x5c2438[_0x0df7('0x6e')]=_0x536639[0x0][_0x0df7('0x1a8')]||0x0;_0x5c2438[_0x0df7('0x6d')]=_0x26e36b>0x0?_0x26e36b:0x1;return _0xb01591['busyFactor'](_0x164a63,_0x4245b6,_0x3e4ca3,_0x26e36b,_0x58c562);})['then'](function(_0x3b5401){return _0x4afc71(_0x3b5401);})[_0x0df7('0xad')](function(_0xb789fc){return _0x4dfe1e(msgResponse('[CatchErlangB]',_0x0df7('0x120'),JSON['stringify'](_0xb789fc)));});}}else{return _0x4dfe1e(msgResponse(_0x0df7('0x1a6'),_0x0df7('0x120'),_0x0df7('0x1a9')));}});};};Dialer['prototype'][_0x0df7('0x19e')]=function(_0x2054ed){var _0x52d643=this;return function(){var _0x2938a3=0x0;var _0x362503=Math[_0x0df7('0x191')](_0x2054ed[_0x0df7('0x1aa')]*0x3e8);if(_0x362503>0x0){_0x362503=_0x362503<0x64?0x64:_0x362503;loggerPredictive['info'](_0x2054ed[_0x0df7('0x40')],'one\x20call\x20every:',_0x362503,_0x0df7('0x4c'));_0x2054ed[_0x0df7('0x8c')]=setInterval(function(){_0x52d643[_0x0df7('0x8c')](_0x2054ed);loggerPredictiveCalls[_0x0df7('0x77')](_0x0df7('0x1ab'),_0x2938a3+=0x1);},_0x362503);}else{loggerPredictive[_0x0df7('0x77')](_0x2054ed[_0x0df7('0x40')],_0x0df7('0x1ac'));}};};Dialer[_0x0df7('0x17')][_0x0df7('0x1ad')]=function(_0xc37e3,_0x3160a4){var _0x15a380=this;return function(_0x8100f1){if(_[_0x0df7('0x48')](_0x8100f1)){if(_[_0x0df7('0xa9')](_0x3160a4[_0x0df7('0x1ae')])||!_0x3160a4[_0x0df7('0x1af')]){if(_0xc37e3[_0x0df7('0x5e')]===_0x0df7('0x133')){_0xc37e3[_0x0df7('0x10a')]=_[_0x0df7('0x3e')](_0xc37e3[_0x0df7('0x10a')])?!![]:_0xc37e3['queueStatusComplete'];var _0xb171b0=uuid['v4']();_0x15a380[_0x0df7('0x22')][_0xb171b0]=new Action(_0xc37e3,_0x3160a4,_0xb171b0);loggerBooked[_0x0df7('0x77')](_0x0df7('0x1b0'),_0xb171b0,_0x0df7('0x1b1'),JSON[_0x0df7('0x4b')](_0xc37e3[_0x0df7('0x10a')]),_0x0df7('0x1b2'),_0xc37e3['name']);if(_0xc37e3['queueStatusComplete']){_0xc37e3['queueStatusComplete']=![];_0x15a380[_0x0df7('0x28')][_0x15a380[_0x0df7('0x22')][_0xb171b0]['queue']]=[];ami[_0x0df7('0xaa')]({'actionid':_0xb171b0,'action':'queuestatus','queue':_0xc37e3[_0x0df7('0x40')]})['catch'](function(_0x4144b9){_0x15a380[_0x0df7('0xaf')](_0xc37e3);_0x15a380[_0x0df7('0xbc')]({'active':![],'ContactId':_0x15a380[_0x0df7('0x22')][_0xb171b0]['ContactId'],'ListId':_0x15a380['actions'][_0xb171b0]['ListId'],'VoiceQueueId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10f')]||undefined,'CampaignId':_0x15a380['actions'][_0xb171b0]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x15a380['actions'][_0xb171b0];});}else{loggerBooked['info'](_0x0df7('0x1b3'),JSON[_0x0df7('0x4b')](_0xc37e3['queueStatusComplete']),'Queue:\x20',_0xc37e3[_0x0df7('0x40')]);_0x15a380[_0x0df7('0xaf')](_0xc37e3);_0x15a380[_0x0df7('0xbc')]({'active':![],'ContactId':_0x15a380['actions'][_0xb171b0][_0x0df7('0xc7')],'ListId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10e')],'VoiceQueueId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10f')]||undefined,'CampaignId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x1b4')));delete _0x15a380[_0x0df7('0x22')][_0xb171b0];}}else{return _0x15a380[_0x0df7('0x1b5')](_0xc37e3,_0x3160a4);}}else{if(getDiff(_0x3160a4[_0x0df7('0x1b6')])<_0xc37e3['dialRecallMeTimeout']*0x3c){_0x15a380[_0x0df7('0x8e')]['run'](_0x3160a4['id'])[_0x0df7('0x1a')](function(){_0x15a380['updateOriginated'](_0xc37e3);});}else{_0xc37e3['outboundReCallsDay']+=0x1;_0x15a380['updateOriginated'](_0xc37e3);if(_0xc37e3[_0x0df7('0x1b7')]){_0x15a380[_0x0df7('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3160a4[_0x0df7('0xc7')],'ListId':_0x3160a4[_0x0df7('0x10e')],'VoiceQueueId':_0x3160a4['VoiceQueueId']||undefined,'CampaignId':_0x3160a4[_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x1b8')));_0x15a380[_0x0df7('0xc1')](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1b9'),0x17,_0x0df7('0x1ba')))[_0x0df7('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x15a380[_0x0df7('0xd0')](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1bb'),0x16,_0x0df7('0x1bc')),_0x0df7('0x1bd'),_0x0df7('0x1be'));}}}}else{_0xc37e3[_0x0df7('0x1bf')]+=0x1;_0x15a380['saveInDb'](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1c0'),0xd,_0x0df7('0x1c1')),_0x0df7('0x1c2'),_0x0df7('0x1c3'));throw'inBlackList';}};};Dialer[_0x0df7('0x17')][_0x0df7('0x137')]=function(_0x3f7682){var _0x22648f=this;var _0xebfa5=[];var _0xff7d8e=_0x3f7682[_0x0df7('0x1c4')]-_0x3f7682['originated']-_0x3f7682['temp'];emitCampaignSummary(_0x3f7682);if(_0xff7d8e>0x0){if(_0xff7d8e>this[_0x0df7('0x20')]){_0xff7d8e=this['maxNumberOriginate'];}_0x3f7682[_0x0df7('0x1c5')]+=_0xff7d8e;this[_0x0df7('0x1c6')](_0x3f7682['id'],_0xff7d8e,_0x3f7682[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x75ebd6){_0x3f7682[_0x0df7('0x1c5')]-=_0xff7d8e;_0x3f7682[_0x0df7('0x1c5')]=_0x3f7682[_0x0df7('0x1c5')]>0x0?_0x3f7682['temp']:0x0;if(!checkContactEmpty(_0x75ebd6)){_0x3f7682[_0x0df7('0x3f')]=_0x0df7('0x1c8');logger[_0x0df7('0x77')](_0x0df7('0x1c9')+_0x3f7682[_0x0df7('0x40')]);}else{_0x3f7682[_0x0df7('0x71')]+=_0x75ebd6[_0x0df7('0x96')];_0x3f7682[_0x0df7('0x3f')]='RUNNING';for(var _0x5cd21c=0x0;_0x5cd21c<_0x75ebd6[_0x0df7('0x96')];_0x5cd21c+=0x1){_0x3f7682[_0x0df7('0x1ca')]+=0x1;if(_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c])||_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c]['Contact'])||_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c][_0x0df7('0x141')][_0x0df7('0x142')])){_0x22648f[_0x0df7('0x1cb')](_0x0df7('0x1cc'),_0x3f7682,_0x75ebd6[_0x5cd21c]);}else{_0x22648f[_0x0df7('0xb9')](_[_0x0df7('0xc6')](_0x75ebd6[_0x5cd21c],[_0x0df7('0xc8'),_0x0df7('0x1cd')]))[_0x0df7('0xb5')](_0x22648f[_0x0df7('0x1ad')](_0x3f7682,_0x75ebd6[_0x5cd21c]))['catch'](_0x22648f[_0x0df7('0xc5')]('[actionOriginateIvr]\x20',_0x3f7682));}}}})[_0x0df7('0xad')](loggerGetContactDialer(_0x0df7('0x1ce'),_0x3f7682,_0xff7d8e));}};Dialer['prototype'][_0x0df7('0x130')]=function(_0x5bcf44,_0xd95d5f){var _0x27bec9=this;var _0x11a54e=[];var _0x46123f=_0xd95d5f>=0x1?_0xd95d5f:0x1;var _0x479d5e=[];if(_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')){_0x46123f=0x1;}var _0x4185ec=Math[_0x0df7('0x191')](_0x5bcf44['available']*_0x46123f)-_0x5bcf44[_0x0df7('0x71')]-_0x5bcf44[_0x0df7('0x1c5')];emitVoiceQueueSummary(_0x5bcf44);if(_0x5bcf44['dialLimitQueue']>0x0){var _0x263d2e=_0x5bcf44['dialLimitQueue']-_0x5bcf44[_0x0df7('0x71')]-_0x5bcf44[_0x0df7('0x9e')]-_0x5bcf44[_0x0df7('0x1c5')]-_0x5bcf44[_0x0df7('0x55')];if(_0x4185ec>_0x263d2e){_0x4185ec=_0x263d2e;}}if(_0x4185ec>0x0){if(_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')){_0x4185ec=0x1;}if(_0x4185ec>this[_0x0df7('0x20')]){_0x4185ec=this['maxNumberOriginate'];}_0x5bcf44['temp']+=_0x4185ec;for(var _0x4fe560 in this[_0x0df7('0x1e')]){if(this['agents'][_0x0df7('0x97')](_0x4fe560)){if(this['agents'][_0x4fe560][_0x0df7('0xd9')]==='not_inuse'&&this[_0x0df7('0x1e')][_0x4fe560][_0x0df7('0xab')]==='reachable'){_0x11a54e[_0x0df7('0x108')](this[_0x0df7('0x1e')][_0x4fe560]['id']);}}}this[_0x0df7('0xbe')](_0x5bcf44['id'],_0x11a54e,_0x4185ec,_0x5bcf44[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x446844){_0x5bcf44[_0x0df7('0x1c5')]-=_0x4185ec;_0x5bcf44[_0x0df7('0x1c5')]=_0x5bcf44[_0x0df7('0x1c5')]>0x0?_0x5bcf44[_0x0df7('0x1c5')]:0x0;if(!checkContactEmpty(_0x446844)){_0x27bec9[_0x0df7('0xb3')](_0x5bcf44)[_0x0df7('0xb5')](sendMessageReschedule(_0x5bcf44))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb6')));}else{_0x5bcf44[_0x0df7('0x71')]+=_0x446844[_0x0df7('0x96')];_0x5bcf44[_0x0df7('0x3f')]=_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')?_0x0df7('0x149'):'RUNNING';for(var _0x2641b5=0x0;_0x2641b5<_0x446844[_0x0df7('0x96')];_0x2641b5+=0x1){if(_[_0x0df7('0xa9')](_0x446844[_0x2641b5])||_[_0x0df7('0xa9')](_0x446844[_0x2641b5][_0x0df7('0x141')])||_['isNil'](_0x446844[_0x2641b5][_0x0df7('0x141')][_0x0df7('0x142')])){_0x27bec9['emptyContact']('[actionOriginate]\x20',_0x5bcf44,_0x446844[_0x2641b5]);}else{_0x27bec9[_0x0df7('0xb7')](_['pick'](_0x446844[_0x2641b5],[_0x0df7('0x10f'),_0x0df7('0x1cd')]))[_0x0df7('0xb5')](_0x27bec9[_0x0df7('0x1ad')](_0x5bcf44,_0x446844[_0x2641b5]))[_0x0df7('0xad')](_0x27bec9['loggerHandler'](_0x0df7('0x1cc'),_0x5bcf44));}}}})['catch'](loggerGetContactDialer(_0x0df7('0x1cf'),_0x5bcf44,_0x4185ec));}};Dialer['prototype']['handlePredictive']=function(_0x51aa31){var _0x29aa51=this;if(_0x51aa31[_0x0df7('0x1d0')]>0x0){var _0x4a2e52=_0x51aa31[_0x0df7('0x1d0')]-_0x51aa31['originated']-_0x51aa31[_0x0df7('0x9e')];if(_0x4a2e52>0x0){this[_0x0df7('0x1d1')](_0x51aa31);}else{loggerPredictiveCalls[_0x0df7('0x77')](_0x0df7('0x1d2'));}}else{this[_0x0df7('0x1d1')](_0x51aa31);}};Dialer[_0x0df7('0x17')][_0x0df7('0x1d1')]=function(_0x28df5d){var _0x44af5a=this;var _0x3332fd=[];_0x28df5d[_0x0df7('0x71')]+=0x1;for(var _0x208948 in this[_0x0df7('0x1e')]){if(this['agents'][_0x0df7('0x97')](_0x208948)){if(this[_0x0df7('0x1e')][_0x208948][_0x0df7('0xd9')]===_0x0df7('0x1d3')&&this[_0x0df7('0x1e')][_0x208948]['status']==='reachable'){_0x3332fd['push'](this[_0x0df7('0x1e')][_0x208948]['id']);}}}this[_0x0df7('0xbe')](_0x28df5d['id'],_0x3332fd,0x1,_0x28df5d[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x5e35d2){if(!checkContactEmpty(_0x5e35d2)){checkContactLowerLimitOriginate(_0x28df5d,0x1,0x0);_0x44af5a[_0x0df7('0xb3')](_0x28df5d)['then'](sendMessageReschedule(_0x28df5d))[_0x0df7('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x28df5d[_0x0df7('0x3f')]='RUNNING';if(_['isNil'](_0x5e35d2[0x0])||_['isNil'](_0x5e35d2[0x0][_0x0df7('0x141')])||_[_0x0df7('0xa9')](_0x5e35d2[0x0][_0x0df7('0x141')]['phone'])){_0x44af5a[_0x0df7('0x1cb')](_0x0df7('0x1cc'),_0x28df5d,_0x5e35d2[0x0]);}else{_0x44af5a['checkIsBlackList'](_['pick'](_0x5e35d2[0x0],[_0x0df7('0x10f'),_0x0df7('0x1cd')]))['then'](_0x44af5a[_0x0df7('0x1ad')](_0x28df5d,_0x5e35d2[0x0]))[_0x0df7('0xad')](_0x44af5a['loggerHandler'](_0x0df7('0x1d4'),_0x28df5d));}}})[_0x0df7('0xad')](loggerGetContactDialer(_0x0df7('0x1d5'),_0x28df5d,0x1));emitVoiceQueueSummary(_0x28df5d);};Dialer[_0x0df7('0x17')][_0x0df7('0x1a4')]=function(_0x495c25,_0x32c050,_0x5c5124,_0x9aacbe,_0x1ac547,_0x5eb696){loggerPredictive['info'](_0x0df7('0x1d6'));loggerPredictive[_0x0df7('0x77')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x495c25);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1d7'),_0x32c050);loggerPredictive[_0x0df7('0x77')]('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',_0x5c5124);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',_0x9aacbe);loggerPredictive[_0x0df7('0x77')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ac547);loggerPredictive[_0x0df7('0x77')]('---------------------------');return new BPromise(function(_0x1b5b0a,_0x79a15f){if(_0x495c25<=0x0||isNaN(_0x495c25)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),_0x0df7('0x1d9')+_0x495c25));}if(_0x5c5124<=0x0||isNaN(_0x5c5124)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),'Error','Ts\x20=\x20'+_0x5c5124));}if(_0x9aacbe<=0x0||isNaN(_0x9aacbe)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),_0x0df7('0x1da')+_0x9aacbe));}if(_0x32c050<=0x0||isNaN(_0x32c050)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),'Error','interval\x20=\x20'+_0x32c050));}if(_0x1ac547<=0x0||isNaN(_0x1ac547)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),'Amax\x20=\x20'+_0x1ac547));}_0x5eb696=_0x5eb696||0x0;var _0x30d66e=0x1/_0x5c5124;var _0x3e466d=0x0;var _0x4ee2a5=0x0;var _0x66e989=0x0;var _0xf999d4=0x0;for(var _0x2b0468=0x0;_0x66e989<_0x1ac547;_0x2b0468+=0x1){_0x4ee2a5=_0x2b0468/_0x32c050;_0x3e466d=(_0x9aacbe*_0x4ee2a5+_0x5eb696)/_0x30d66e;_0x66e989=erlangb(_0x3e466d,_0x495c25);_0xf999d4=_0x3e466d/_0x495c25*(0x1-erlangb(_0x3e466d,_0x495c25));}return _0x1b5b0a({'erlangCalls':_0x2b0468,'erlangCallToSecond':_0x32c050/_0x2b0468,'erlangAbandonmentRate':_0x66e989,'erlangBusyFactor':_0xf999d4});});};Dialer['prototype'][_0x0df7('0x1db')]=function(_0x528a11,_0x389e23,_0x6b77da,_0x501e1e,_0x8f3f73,_0x2a289f){loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1dc'));loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1dd'),_0x528a11);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1d7'),_0x389e23);loggerPredictive[_0x0df7('0x77')]('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',_0x6b77da);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1de'),_0x501e1e);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8f3f73);loggerPredictive[_0x0df7('0x77')]('---------------------------');return new BPromise(function(_0x4bf011,_0xaf512a){if(_0x528a11<=0x0||isNaN(_0x528a11)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),'Error',_0x0df7('0x1d9')+_0x528a11));}if(_0x6b77da<=0x0||isNaN(_0x6b77da)){return _0xaf512a(msgResponse('[busyFactor]',_0x0df7('0x4a'),'Ts\x20=\x20'+_0x6b77da));}if(_0x501e1e<=0x0||isNaN(_0x501e1e)){return _0xaf512a(msgResponse('[busyFactor]',_0x0df7('0x4a'),_0x0df7('0x1da')+_0x501e1e));}if(_0x389e23<=0x0||isNaN(_0x389e23)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),_0x0df7('0x4a'),_0x0df7('0x1e0')+_0x389e23));}if(_0x8f3f73<=0x0||isNaN(_0x8f3f73)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),'Error',_0x0df7('0x1e1')+_0x8f3f73));}_0x2a289f=_0x2a289f||0x0;var _0x2d7333=0x1/_0x6b77da;var _0x2d2449=0x0;var _0x3bb0a5=0x0;var _0x20dfe3=0x0;var _0x5d098c=0x0;for(var _0x4943a7=0x0;_0x5d098c<_0x8f3f73;_0x4943a7+=0x1){_0x3bb0a5=_0x4943a7/_0x389e23;_0x2d2449=(_0x501e1e*_0x3bb0a5+_0x2a289f)/_0x2d7333;_0x20dfe3=erlangb(_0x2d2449,_0x528a11);_0x5d098c=_0x2d2449/_0x528a11*(0x1-erlangb(_0x2d2449,_0x528a11));}return _0x4bf011({'erlangCalls':_0x4943a7,'erlangCallToSecond':_0x389e23/_0x4943a7,'erlangAbandonmentRate':_0x20dfe3,'erlangBusyFactor':_0x5d098c});});};module[_0x0df7('0x1e2')]=Dialer; \ No newline at end of file +var _0xf8de=['syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','Abandoned','CALLEREXIT','actionid','locked','stateinterface','queueBooked','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','ContactId','[booked][unlock3]','loopCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','content','indexOf','true','command','iftime\x20%s,%s','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','pow','replace','random','match','actionOriginate','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','object','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalAvailable','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','loggedIn','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','inBlackList','limitCalls','temp','maxNumberOriginate','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','channels','actions','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','emit','type','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','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\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','ivr','string','\x22%s\x22\x20<%s>','error','inspect','stack','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','saveInDb','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','state','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','membername','amd','[syncMachine][createHistory]','uniqueid','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow'];(function(_0x187ae6,_0x4572d0){var _0x6be7c8=function(_0x3ac662){while(--_0x3ac662){_0x187ae6['push'](_0x187ae6['shift']());}};_0x6be7c8(++_0x4572d0);}(_0xf8de,0xf6));var _0xef8d=function(_0x19ade7,_0x4398e8){_0x19ade7=_0x19ade7-0x0;var _0x5547f3=_0xf8de[_0x19ade7];return _0x5547f3;};'use strict';var util=require('util');var _=require(_0xef8d('0x0'));var BPromise=require(_0xef8d('0x1'));var uuid=require(_0xef8d('0x2'));var moment=require(_0xef8d('0x3'));var rr=require('rr');var md5=require(_0xef8d('0x4'));var Redis=require(_0xef8d('0x5'));var config=require(_0xef8d('0x6'));var logger=require(_0xef8d('0x7'))(_0xef8d('0x8'));var loggerBooked=require('../../../config/logger')(_0xef8d('0x9'));var loggerPredictive=require(_0xef8d('0x7'))(_0xef8d('0xa'));var loggerPredictiveCalls=require(_0xef8d('0x7'))(_0xef8d('0xb'));var loggerSyncQueueSummary=require(_0xef8d('0x7'))(_0xef8d('0xc'));var ami=require('../ami');config[_0xef8d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xef8d('0xd')]));var cmHopper=require(_0xef8d('0xe'));var cmHopperFinal=require(_0xef8d('0xf'));var cmHopperHistory=require(_0xef8d('0x10'));var cmHopperBlack=require(_0xef8d('0x11'));var voiceQueueRt=require(_0xef8d('0x12'));var Action=require(_0xef8d('0x13'));var History=require(_0xef8d('0x14'));var Final=require(_0xef8d('0x15'));var AgentComplete=require(_0xef8d('0x16'));var QueueCallerAbandon=require(_0xef8d('0x17'));var Hangup=require(_0xef8d('0x18'));var ipAgi=process[_0xef8d('0x19')][_0xef8d('0x1a')]||_0xef8d('0x1b');var strategy={'rrmemory':_0xef8d('0x1c'),'roundrobin':_0xef8d('0x1d')};var Sequence=function(){};Sequence[_0xef8d('0x1e')][_0xef8d('0x1f')]=function(_0x5b5c9e){this[_0xef8d('0x20')]=this[_0xef8d('0x20')]?this[_0xef8d('0x20')][_0xef8d('0x21')](_0x5b5c9e):_0x5b5c9e();};function Dialer(_0x431eed,_0x12295a){this[_0xef8d('0x22')]=new Sequence();this[_0xef8d('0x23')]=_0x12295a;this[_0xef8d('0x24')]=_0x431eed[_0xef8d('0x24')];this[_0xef8d('0x25')]=_0x431eed[_0xef8d('0x25')];this[_0xef8d('0x26')]=_0x431eed[_0xef8d('0x26')];this[_0xef8d('0x27')]=_0x431eed[_0xef8d('0x27')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xef8d('0x28')]={};this[_0xef8d('0x29')]={};this['contactsId']={};this[_0xef8d('0x2a')]={};this[_0xef8d('0x2b')]={};this['startPredictive']={};this[_0xef8d('0x2c')]={};this[_0xef8d('0x2d')]={};this['queueBooked']={};this[_0xef8d('0x2e')]={};ami['on'](_0xef8d('0x2f'),this[_0xef8d('0x30')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x32'),this[_0xef8d('0x33')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x34'),this[_0xef8d('0x35')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x36'),this['syncAgentComplete'][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x37'),this[_0xef8d('0xc')][_0xef8d('0x31')](this));ami['on'](_0xef8d('0x38'),this[_0xef8d('0x39')]['bind'](this));ami['on'](_0xef8d('0x3a'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xef8d('0x3b')]['bind'](this));ami['on'](_0xef8d('0x3c'),this[_0xef8d('0x3d')]['bind'](this));ami['on'](_0xef8d('0x3e'),this[_0xef8d('0x3f')][_0xef8d('0x31')](this));this['loopCampaigns']();this[_0xef8d('0x40')]();}function isNotNull(_0x194b8e){return _0x194b8e!==null&&!_[_0xef8d('0x41')](_0x194b8e);}function checkIsLoggedIn(_0x40cc61,_0xe2810e){return function(){if(_0xe2810e<=0x0){_0x40cc61[_0xef8d('0x42')]=_0xef8d('0x43');throw _0x40cc61[_0xef8d('0x44')]+_0xef8d('0x45');}};}function isActive(_0x2f5eec){return _0x2f5eec;}function checkIsActive(_0x8b9f75,_0x1db3a5){return function(){if(!isActive(_0x1db3a5)){_0x8b9f75['message']=_0xef8d('0x46');throw _0x8b9f75[_0xef8d('0x44')]+'\x20NOT\x20Active';}};}function checkInterval(_0x1c0643){return function(){if(!isNotNull(_0x1c0643[_0xef8d('0x47')])){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643[_0xef8d('0x44')]+_0xef8d('0x49');}if(!isNotNull(_0x1c0643[_0xef8d('0x47')][_0xef8d('0x4a')])){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643['name']+_0xef8d('0x49');}if(!isNotNull(_[_0xef8d('0x4b')](_0x1c0643[_0xef8d('0x47')][_0xef8d('0x4a')]))){_0x1c0643[_0xef8d('0x42')]=_0xef8d('0x48');throw _0x1c0643['name']+_0xef8d('0x49');}};}function msgResponse(_0x38381e,_0x2b412d,_0x1200e8){return{'action':_0x38381e,'response':_0x2b412d,'message':_0x1200e8,'stack':_0x1200e8};}function myreject(_0x576e1c){return function(_0x436a65){return _0x576e1c(msgResponse(_0xef8d('0x4c'),_0xef8d('0x4d'),JSON['stringify'](_0x436a65)));};}function getSeconds(_0x345f31,_0x567d98){var _0x586896=moment(_0x345f31)[_0xef8d('0x4e')](0x0);var _0x17ccc0=moment(_0x567d98)[_0xef8d('0x4e')](0x0);return _0x586896[_0xef8d('0x4f')](_0x17ccc0,'seconds');}function emit(_0xc6dcd4,_0x361129,_0x596064){io['to'](_0xc6dcd4)[_0xef8d('0x50')](_0x361129,_0x596064);}function emitVoiceQueueSummary(_0x1e7b54){if(_0x1e7b54[_0xef8d('0x51')]==='outbound'){var _0x1f2e30={'id':_0x1e7b54['id'],'name':_0x1e7b54['name'],'strategy':_0x1e7b54[_0xef8d('0x52')],'answered':_0x1e7b54[_0xef8d('0x53')],'available':_0x1e7b54[_0xef8d('0x54')],'loggedIn':_0x1e7b54['loggedIn'],'pTalking':_0x1e7b54[_0xef8d('0x55')],'sumBillable':_0x1e7b54[_0xef8d('0x56')],'sumDuration':_0x1e7b54[_0xef8d('0x57')],'sumHoldTime':_0x1e7b54[_0xef8d('0x58')]||0x0,'talking':_0x1e7b54['talking'],'total':_0x1e7b54[_0xef8d('0x59')],'type':_0x1e7b54[_0xef8d('0x51')],'unmanaged':_0x1e7b54['unmanaged'],'abandoned':_0x1e7b54[_0xef8d('0x5a')],'waiting':_0x1e7b54[_0xef8d('0x5b')],'loggedInDb':_0x1e7b54[_0xef8d('0x5c')],'dialActive':_0x1e7b54[_0xef8d('0x5d')],'dialMethod':_0x1e7b54[_0xef8d('0x5e')],'dialOriginateCallerIdName':_0x1e7b54[_0xef8d('0x5f')],'dialOriginateCallerIdNumber':_0x1e7b54[_0xef8d('0x60')],'dialOriginateTimeout':_0x1e7b54[_0xef8d('0x61')],'dialPrefix':_0x1e7b54['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1e7b54['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1e7b54[_0xef8d('0x62')],'outboundBlacklistCallsDay':_0x1e7b54[_0xef8d('0x63')],'outboundBusyCallsDay':_0x1e7b54[_0xef8d('0x64')],'outboundCongestionCallsDay':_0x1e7b54[_0xef8d('0x65')],'outboundDropCallsDayACS':_0x1e7b54['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1e7b54[_0xef8d('0x66')],'outboundDropCallsDayTimeout':_0x1e7b54[_0xef8d('0x67')],'outboundNoAnswerCallsDay':_0x1e7b54[_0xef8d('0x68')],'outboundNoSuchCallsDay':_0x1e7b54[_0xef8d('0x69')],'outboundOriginateFailureCallsDay':_0x1e7b54[_0xef8d('0x6a')],'outboundReCallsDay':_0x1e7b54[_0xef8d('0x6b')],'outboundRejectCallsDay':_0x1e7b54[_0xef8d('0x6c')],'outboundUnknownCallsDay':_0x1e7b54[_0xef8d('0x6d')],'predictiveIntervalAnsweredCalls':_0x1e7b54[_0xef8d('0x6e')],'predictiveIntervalAvgHoldtime':_0x1e7b54[_0xef8d('0x6f')],'predictiveIntervalAvgTalktime':_0x1e7b54[_0xef8d('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x1e7b54[_0xef8d('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x1e7b54[_0xef8d('0x72')],'predictiveIntervalErlangCalls':_0x1e7b54[_0xef8d('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x1e7b54[_0xef8d('0x74')],'predictiveIntervalHitRate':_0x1e7b54[_0xef8d('0x75')],'predictiveIntervalMultiplicativeFactor':_0x1e7b54[_0xef8d('0x76')],'predictiveIntervalPauses':_0x1e7b54[_0xef8d('0x77')],'predictiveIntervalAvailable':_0x1e7b54['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1e7b54[_0xef8d('0x78')],'message':_0x1e7b54[_0xef8d('0x42')],'originated':_0x1e7b54[_0xef8d('0x79')],'erlangCalls':_0x1e7b54[_0xef8d('0x7a')],'erlangCallToSecond':_0x1e7b54[_0xef8d('0x7b')],'erlangAbandonmentRate':_0x1e7b54[_0xef8d('0x7c')],'erlangBusyFactor':_0x1e7b54[_0xef8d('0x7d')],'startPredictive':_0x1e7b54['startPredictive'],'startProgressive':_0x1e7b54['startProgressive']};if(_0x1e7b54[_0xef8d('0x7e')]){_0x1f2e30[_0xef8d('0x7e')]={'id':_0x1e7b54[_0xef8d('0x7e')]['id'],'name':_0x1e7b54[_0xef8d('0x7e')][_0xef8d('0x44')],'active':_0x1e7b54[_0xef8d('0x7e')][_0xef8d('0x7f')],'callerid':_0x1e7b54['Trunk'][_0xef8d('0x80')]};}if(_0x1e7b54['Interval']){_0x1f2e30[_0xef8d('0x47')]={'id':_0x1e7b54['Interval']['id'],'name':_0x1e7b54[_0xef8d('0x47')][_0xef8d('0x44')]};}var _0x3e9863=md5(JSON[_0xef8d('0x81')](_0x1f2e30));if(_0x1e7b54[_0xef8d('0x4')]!==_0x3e9863){_0x1e7b54[_0xef8d('0x4')]=_0x3e9863;emit(util[_0xef8d('0x82')](_0xef8d('0x83'),_0x1f2e30[_0xef8d('0x44')]),_0xef8d('0x84'),_0x1f2e30);}}}function emitCampaignSummary(_0x3bb112){if(_0x3bb112[_0xef8d('0x51')]==='ivr'){emit(util['format'](_0xef8d('0x85'),_0x3bb112[_0xef8d('0x44')]),_0xef8d('0x86'),_0x3bb112);}}function checkGetDataPredictive(_0x2d1070){if(isNotNull(_0x2d1070)){if(!_['isEmpty'](_0x2d1070)){loggerPredictive[_0xef8d('0x87')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xef8d('0x87')](_0xef8d('0x88'),_0x2d1070[_0xef8d('0x78')]);loggerPredictive[_0xef8d('0x87')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070[_0xef8d('0x6e')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x89'),_0x2d1070[_0xef8d('0x71')]);loggerPredictive[_0xef8d('0x87')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d1070[_0xef8d('0x6f')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8a'),_0x2d1070['predictiveIntervalAvgTalktime']);loggerPredictive[_0xef8d('0x87')]('---------------------------');if(_0x2d1070['predictiveIntervalTotalCalls']>0x0){if(!_[_0xef8d('0x41')](_0x2d1070[_0xef8d('0x70')])&&_0x2d1070[_0xef8d('0x70')]>0x0){return!![];}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8b'));}if(!_['isUndefined'](_0x2d1070['predictiveIntervalAvgHoldtime'])&&_0x2d1070[_0xef8d('0x6f')]>0x0){return!![];}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8c'));}}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8d'));}}else{loggerPredictive['info'](_0xef8d('0x8e'));}}else{loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8e'));}return![];}function mergeDataErlangB(_0x91e32e){return function(_0x3a6cf1){loggerPredictive[_0xef8d('0x87')](_0xef8d('0x8f'));loggerPredictive['info'](_0xef8d('0x90'),_0x3a6cf1[_0xef8d('0x7a')]);loggerPredictive[_0xef8d('0x87')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a6cf1['erlangCallToSecond']);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x91'),_0x3a6cf1[_0xef8d('0x7c')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x92'),_0x3a6cf1[_0xef8d('0x7d')]);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x91'),_0x3a6cf1[_0xef8d('0x7c')]);loggerPredictive[_0xef8d('0x87')]('---------------------------');_[_0xef8d('0x93')](_0x91e32e,_0x3a6cf1);};}function getDiff(_0x1ac1d3){var _0x153a29=moment()['milliseconds'](0x0);var _0x3aebcf=moment(_0x1ac1d3)[_0xef8d('0x4e')](0x0);return _0x153a29[_0xef8d('0x4f')](_0x3aebcf,_0xef8d('0x94'));}function ifInterval(_0x295565,_0x2a8b0e){if(_[_0xef8d('0x41')](_0x2a8b0e)){return![];}if(getDiff(_0x2a8b0e)<_0x295565*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x58d30f){if(isNotNull(_0x58d30f)){if(!_[_0xef8d('0x41')](_0x58d30f[_0xef8d('0x2c')])){_0x58d30f[_0xef8d('0x2c')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x95'));}if(!_[_0xef8d('0x41')](_0x58d30f[_0xef8d('0x96')])){_0x58d30f[_0xef8d('0x96')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x97'));}if(!_[_0xef8d('0x41')](_0x58d30f['handlePredictive'])){clearInterval(_0x58d30f[_0xef8d('0x98')]);_0x58d30f[_0xef8d('0x98')]=undefined;loggerPredictive[_0xef8d('0x87')](_0x58d30f[_0xef8d('0x44')],_0xef8d('0x99'));}}}function erlangb(_0x382ea9,_0x336ec9){if(_0x336ec9===0x0){return 0x0;}var _0x5711c2=0x1;for(var _0x270026=0x1;_0x270026<=_0x336ec9;_0x270026+=0x1){_0x5711c2=0x1+_0x5711c2*_0x270026/_0x382ea9;}return 0x1/_0x5711c2;}function isVoiceQueueOutbound(_0x38c9d8){return _0x38c9d8===_0xef8d('0x9a');}function isNotPreview(_0x4f52ca){return _0x4f52ca!==_0xef8d('0x23');}function isCampaignIvr(_0x9fafa1){return _0x9fafa1===_0xef8d('0x9b');}function getCallerId(_0x22e6b3,_0x36d26c,_0x478c43){if(!_[_0xef8d('0x41')](_0x478c43)&&_0xef8d('0x9c')===typeof _0x478c43&&!_[_0xef8d('0x4b')](_0x478c43)){if(!_[_0xef8d('0x41')](_0x36d26c)&&_0xef8d('0x9c')===typeof _0x36d26c&&!_[_0xef8d('0x4b')](_0x36d26c)){return util[_0xef8d('0x82')](_0xef8d('0x9d'),_0x36d26c,_0x478c43);}return util['format']('\x22%s\x22\x20<%s>',_0x478c43,_0x478c43);}if(!_[_0xef8d('0x41')](_0x22e6b3)&&'string'===typeof _0x22e6b3&&!_[_0xef8d('0x4b')](_0x22e6b3)){return _0x22e6b3;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x437d9c,_0x19a72f){return function(_0x373a92){freeVariablesPredictive(_0x19a72f);emitVoiceQueueSummary(_0x19a72f);emitCampaignSummary(_0x19a72f);loggerSyncQueueSummary[_0xef8d('0x9e')](_0x437d9c,util[_0xef8d('0x9f')](_0x373a92,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f45e7,_0x1ab1a4){return function(_0x156c41){loggerPredictive['error'](_0x1ab1a4[_0xef8d('0x44')],_0x2f45e7);loggerPredictive[_0xef8d('0x9e')](_0x156c41[_0xef8d('0xa0')]);freeVariablesPredictive(_0x1ab1a4);};}function loggerCatch(_0x461d12){return function(_0x37dd85){logger[_0xef8d('0x9e')](_0x461d12,util[_0xef8d('0x9f')](_0x37dd85,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x13ebcc){return _0x13ebcc&&!_[_0xef8d('0x41')](_0x13ebcc)&&_0x13ebcc['length']>0x0;}function decremetOriginate(_0x8bb1de){if(!_['isUndefined'](_0x8bb1de)&&_0x8bb1de!==null){if(_0x8bb1de['hasOwnProperty']('originated')){if(_0x8bb1de[_0xef8d('0x79')]>0x0){_0x8bb1de[_0xef8d('0x79')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5ebb14,_0x1fd01d,_0x2974f6){if(_0x1fd01d>_0x2974f6){for(var _0x4de9b0=0x0;_0x4de9b0<_0x1fd01d-_0x2974f6;_0x4de9b0+=0x1){decremetOriginate(_0x5ebb14);}}}function loggerGetContactDialer(_0x24dd54,_0x50c3c8,_0x5729b6){return function(_0x5c594e){checkContactLowerLimitOriginate(_0x50c3c8,_0x5729b6,0x0);logger['error'](_0x24dd54,util[_0xef8d('0x9f')](_0x5c594e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2daca7){return function(_0x5d6d71){if(isNotNull(_0x5d6d71)&&isNotNull(_0x5d6d71[0x0])){if(_0x5d6d71[0x0][_0xef8d('0xa1')]>0x0){_0x2daca7[_0xef8d('0x42')]=_0xef8d('0xa2');logger['info']('[getContactDialer2][ReScheduled]'+_0x2daca7[_0xef8d('0x44')],_0x5d6d71[0x0]['contactsRescheduled'],_0xef8d('0xa3'));}else{_0x2daca7[_0xef8d('0x42')]=_0xef8d('0xa4');logger[_0xef8d('0x87')]('[getContactDialer2][Empty]'+_0x2daca7['name']);}}};}function notSendMessagesQueue(_0x32c643){if(_0x32c643[_0xef8d('0xa5')]){freeVariablesPredictive(_0x32c643);if(_0x32c643['originated']===0x0&&_0x32c643[_0xef8d('0xa6')]===0x0&&_0x32c643[_0xef8d('0x5b')]===0x0&&(_0x32c643[_0xef8d('0x55')]||0x0)===0x0){_0x32c643['sendMessageOneNotActive']=![];_0x32c643['available']=0x0;_0x32c643[_0xef8d('0x42')]=_0xef8d('0x46');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xa7'),_0x32c643[_0xef8d('0x44')],'is\x20not\x20active');}else{_0x32c643['message']=_0xef8d('0xa8');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xa7'),_0x32c643[_0xef8d('0x44')],_0xef8d('0xa9'));}emitVoiceQueueSummary(_0x32c643);}}function notSendMessagesCampaign(_0x2a74e1){if(_0x2a74e1[_0xef8d('0xa5')]){if(_0x2a74e1[_0xef8d('0x79')]===0x0){_0x2a74e1[_0xef8d('0xa5')]=![];_0x2a74e1[_0xef8d('0x42')]=_0xef8d('0x46');loggerSyncQueueSummary[_0xef8d('0x9e')](_0xef8d('0xaa'),_0x2a74e1['name'],_0xef8d('0xab'));}else{_0x2a74e1['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xef8d('0xaa'),_0x2a74e1[_0xef8d('0x44')],'is\x20disactive');}emitCampaignSummary(_0x2a74e1);}}function createObjHistory(_0x1f7ad3,_0x498967,_0x179059,_0x314622,_0x276393){_0x1f7ad3[_0xef8d('0x42')]=_0x179059;var _0x503c50=new Action(_0x1f7ad3,_0x498967);var _0x4934a1=new History(_0x503c50);_0x4934a1['state']=_0x314622;_0x4934a1[_0xef8d('0xac')]=_0x276393;_0x4934a1[_0xef8d('0xad')]=_0x503c50['starttime'];return _0x4934a1;}Dialer[_0xef8d('0x1e')][_0xef8d('0x40')]=function(){var _0x3c9b11=this;setInterval(function(){_0x3c9b11[_0xef8d('0xae')](_0x3c9b11[_0xef8d('0x2a')],_0xef8d('0xaf'));_0x3c9b11[_0xef8d('0xae')](_0x3c9b11[_0xef8d('0x29')],_0xef8d('0xb0'));},0x32c8);};Dialer[_0xef8d('0x1e')][_0xef8d('0xae')]=function(_0x2df125,_0x50e802){var _0x5f0dfb=this;for(var _0x1e1e3a in _0x2df125){if(_0x2df125['hasOwnProperty'](_0x1e1e3a)){this['sequence'][_0xef8d('0x1f')](function(){if(!_[_0xef8d('0xb1')](_0x2df125[_0x1e1e3a])){return ami[_0xef8d('0xb2')]({'action':_0xef8d('0xb3'),'channel':_0x2df125[_0x1e1e3a][_0xef8d('0xb4')]})[_0xef8d('0xb5')](function(_0x55af62){if(_0x55af62[_0xef8d('0x42')]===_0xef8d('0xb6')){setTimeout(function(){if(_0x2df125[_0x1e1e3a]&&_0x2df125[_0x1e1e3a]['type']!==_0xef8d('0x9b')){_0x5f0dfb[_0xef8d('0xb7')](_0x5f0dfb['voiceQueues'][_0x2df125[_0x1e1e3a][_0xef8d('0xb8')]]);logger['error'](_0xef8d('0xb9'),_0x50e802,_0x1e1e3a,_0x2df125[_0x1e1e3a][_0xef8d('0xb8')]);delete _0x2df125[_0x1e1e3a];}if(_0x2df125[_0x1e1e3a]&&_0x2df125[_0x1e1e3a]['type']==='ivr'){_0x5f0dfb[_0xef8d('0xb7')](_0x5f0dfb[_0xef8d('0x25')][_0x2df125[_0x1e1e3a]['queue']]);logger[_0xef8d('0x9e')](_0xef8d('0xba'),_0x50e802,_0x1e1e3a,_0x2df125[_0x1e1e3a]['queue']);delete _0x2df125[_0x1e1e3a];}},0x2328);}});}});}}};Dialer[_0xef8d('0x1e')]['countReScheduled']=function(_0x1fd0b1){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopper[_0xef8d('0xbd')](_0x1fd0b1))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbe')));};Dialer[_0xef8d('0x1e')]['checkIsBlackList']=function(_0x30d5fc){return BPromise['resolve']()[_0xef8d('0xbc')](cmHopperBlack['checkIsBlackList'](_0x30d5fc))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbf')));};Dialer['prototype'][_0xef8d('0xc0')]=function(_0x3e71b4){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopperBlack[_0xef8d('0xc0')](_0x3e71b4))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc1')));};Dialer['prototype']['averageHandleTime']=function(_0x3c44ae){return BPromise['resolve']()['then'](cmHopperHistory[_0xef8d('0xc2')](_0x3c44ae))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc3')));};Dialer[_0xef8d('0x1e')][_0xef8d('0xc4')]=function(_0x33702e){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc4')](_0x33702e))[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xef8d('0x1e')]['getContactDialer']=function(_0x784cda,_0x230dba,_0x319853,_0x495628){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](cmHopper[_0xef8d('0xc5')](_0x784cda,_0x230dba,_0x319853,_0x495628))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc6')));};Dialer['prototype'][_0xef8d('0xc7')]=function(_0x3d555c,_0x34cb14,_0x2e99a9){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc7')](_0x3d555c,_0x34cb14,_0x2e99a9))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xc6')));};Dialer['prototype'][_0xef8d('0xc8')]=function(_0x1e84e7){return BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](voiceQueueRt[_0xef8d('0xc8')](_0x1e84e7))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['moveContactManagedDialer']=function(_0x12e0b8){return BPromise[_0xef8d('0xbb')]()['then'](cmHopper[_0xef8d('0xc9')](_0x12e0b8))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xca')));};Dialer['prototype'][_0xef8d('0xcb')]=function(_0x28c2c2){return BPromise[_0xef8d('0xbb')]()['then'](cmHopperHistory[_0xef8d('0xcb')](_0x28c2c2))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xcc')));};Dialer[_0xef8d('0x1e')][_0xef8d('0xb7')]=function(_0x3e7439){if(!_[_0xef8d('0x41')](_0x3e7439)&&_0x3e7439!==null){if(_0x3e7439['hasOwnProperty'](_0xef8d('0x79'))){if(_0x3e7439[_0xef8d('0x79')]>0x0){_0x3e7439[_0xef8d('0x79')]-=0x1;}else{logger[_0xef8d('0x9e')](_0xef8d('0xcd'));}}}else{logger[_0xef8d('0x9e')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xef8d('0x1e')][_0xef8d('0xce')]=function(_0x146d1e,_0x266c8d){var _0x18ff15=this;return function(_0x311f36){_0x18ff15[_0xef8d('0xb7')](_0x266c8d);logger[_0xef8d('0x9e')](_0x146d1e,util[_0xef8d('0x9f')](_0x311f36,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x198f69,_0x310d6e,_0x2b5276){var _0x5e4ef2={'state':0x19,'statedesc':'notFound'};this[_0xef8d('0xb7')](_0x310d6e);this[_0xef8d('0xcf')](_[_0xef8d('0x93')](_0x5e4ef2,_[_0xef8d('0xd0')](_0x2b5276,['ContactId',_0xef8d('0xd1'),_0xef8d('0xd2'),_0xef8d('0xd3'),_0xef8d('0xd4')])),'[emptyContact][createHistory]',_0xef8d('0xd5'));logger['error'](_0x198f69);};Dialer[_0xef8d('0x1e')][_0xef8d('0xd6')]=function(_0x1a37d6){return _0x1a37d6===_0xef8d('0xd7');};Dialer[_0xef8d('0x1e')][_0xef8d('0xd8')]=function(_0x5fd43c){return!_[_0xef8d('0x41')](_0x5fd43c)&&_0x5fd43c&&!_['isUndefined'](_0x5fd43c[_0xef8d('0x44')])&&!_['isUndefined'](_0x5fd43c[_0xef8d('0x7f')])&&_0x5fd43c[_0xef8d('0x7f')]&&(this['trunks'][util[_0xef8d('0x82')](_0xef8d('0xd9'),_0x5fd43c[_0xef8d('0x44')])][_0xef8d('0xb3')]===_0xef8d('0xda')||this['trunks'][util[_0xef8d('0x82')](_0xef8d('0xd9'),_0x5fd43c[_0xef8d('0x44')])][_0xef8d('0xb3')]===_0xef8d('0xdb'));};Dialer[_0xef8d('0x1e')]['saveInDb']=function(_0x239494,_0x5b90c4,_0x33ff7a){this[_0xef8d('0xcb')](_0x239494)[_0xef8d('0xb5')](loggerCatch(_0x5b90c4));this[_0xef8d('0xc9')](_0x239494)['catch'](loggerCatch(_0x33ff7a));};Dialer[_0xef8d('0x1e')]['syncVarSet']=function(_0x307231){var _0x306eda=this[_0xef8d('0x2a')][_0x307231['uniqueid']];var _0x3cc264;if(!_['isNil'](_0x307231)&&!_[_0xef8d('0xb1')](_0x307231[_0xef8d('0xdc')])&&!_[_0xef8d('0xb1')](_0x307231[_0xef8d('0xdc')]['amdstatus'])&&_0x307231[_0xef8d('0xdd')]==='xcally-motion-dialer'&&_0x306eda){if(_0x306eda[_0xef8d('0x51')]!==_0xef8d('0x9b')&&this[_0xef8d('0x24')][_0x306eda['queue']][_0xef8d('0xde')]&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe0')){delete this[_0xef8d('0x2a')][_0x307231['uniqueid']];this['updateOriginated'](this[_0xef8d('0x24')][_0x306eda[_0xef8d('0xb8')]]);this['voiceQueues'][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0x62')]+=0x1;this['voiceQueues'][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0xe1')]+=0x1;_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264[_0xef8d('0xe2')]=0x12;_0x3cc264['statedesc']=_0xef8d('0xe3');_0x3cc264['membername']=_0xef8d('0xe4');this[_0xef8d('0xcf')](_0x3cc264,_0xef8d('0xe5'),'[syncHangupInAMD]');}if(_0x306eda[_0xef8d('0x51')]!=='ivr'&&this['voiceQueues'][_0x306eda['queue']][_0xef8d('0xde')]&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe6')){delete this['uniqueId'][_0x307231['uniqueid']];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x306eda['queue']]);this[_0xef8d('0x24')][_0x306eda['queue']][_0xef8d('0x62')]+=0x1;this[_0xef8d('0x24')][_0x306eda[_0xef8d('0xb8')]][_0xef8d('0xe1')]+=0x1;_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264['state']=0x13;_0x3cc264['statedesc']=_0xef8d('0xe7');_0x3cc264[_0xef8d('0xe8')]=_0xef8d('0xe4');_0x3cc264[_0xef8d('0xe9')]=!![];this[_0xef8d('0xcf')](_0x3cc264,_0xef8d('0xea'),'[syncMachine]');}if(_0x306eda[_0xef8d('0x51')]==='ivr'&&this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]['dialAMDActive']&&_0x307231[_0xef8d('0xdf')]===_0xef8d('0xe0')){delete this[_0xef8d('0x2a')][_0x307231[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]);_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264[_0xef8d('0xe2')]=0x12;_0x3cc264[_0xef8d('0xac')]='HangupInAMD';_0x3cc264[_0xef8d('0xe8')]=_0xef8d('0xe4');this['saveInDb'](_0x3cc264,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x306eda[_0xef8d('0x51')]===_0xef8d('0x9b')&&this['campaigns'][_0x306eda[_0xef8d('0xb8')]]['dialAMDActive']&&_0x307231['value']===_0xef8d('0xe6')){delete this[_0xef8d('0x2a')][_0x307231[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x25')][_0x306eda[_0xef8d('0xb8')]]);_0x3cc264=new Hangup(_0x306eda,_0x307231);_0x3cc264['state']=0x13;_0x3cc264['statedesc']=_0xef8d('0xe7');_0x3cc264[_0xef8d('0xe8')]='AMD';_0x3cc264[_0xef8d('0xe9')]=!![];this[_0xef8d('0xcf')](_0x3cc264,'[syncMachineIvr][createHistory]',_0xef8d('0xec'));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x39')]=function(_0x110c00){var _0x31ae42=this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];var _0x41fd68=this;var _0x33bc33;if(_0x31ae42&&_0x31ae42[_0xef8d('0x51')]===_0xef8d('0x9b')){delete this['uniqueId'][_0x110c00[_0xef8d('0xeb')]];this['updateOriginated'](this['campaigns'][_0x31ae42['queue']]);this['campaigns'][_0x31ae42[_0xef8d('0xb8')]][_0xef8d('0xed')]+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);this['createHistory'](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xef')));}if(_0x31ae42&&_0x31ae42['type']!=='ivr'&&isNotNull(this[_0xef8d('0x24')][_0x31ae42['queue']][_0xef8d('0xf0')])){delete this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this['voiceQueues'][_0x31ae42[_0xef8d('0xb8')]]);this[_0xef8d('0x24')][_0x31ae42['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x31ae42[_0xef8d('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);_0x33bc33['state']=0x10;_0x33bc33[_0xef8d('0xac')]=_0xef8d('0xf1');_0x33bc33[_0xef8d('0xe8')]=_0xef8d('0xf2');this[_0xef8d('0xcb')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x31ae42&&_0x31ae42[_0xef8d('0x51')]!==_0xef8d('0x9b')&&!isNotNull(this['voiceQueues'][_0x31ae42['queue']]['dialQueueProject'])){delete this[_0xef8d('0x2a')][_0x110c00[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x31ae42[_0xef8d('0xb8')]]);this[_0xef8d('0x24')][_0x31ae42[_0xef8d('0xb8')]][_0xef8d('0x6d')]+=0x1;_0x33bc33=new Hangup(_0x31ae42,_0x110c00);_0x33bc33[_0xef8d('0xe2')]=0xc;_0x33bc33[_0xef8d('0xac')]=_0x110c00[_0xef8d('0xf3')];_0x33bc33[_0xef8d('0xe8')]=_0xef8d('0xf4');this[_0xef8d('0xcb')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xee')));this[_0xef8d('0xc9')](_0x33bc33)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xef')));}};Dialer[_0xef8d('0x1e')][_0xef8d('0xf5')]=function(_0x19f237){var _0x45bd20=this[_0xef8d('0x2a')][_0x19f237[_0xef8d('0xeb')]];var _0x4c44b2=this;if(this['voiceQueues'][_0x19f237[_0xef8d('0xb8')]]){if(_0x45bd20&&_0x45bd20[_0xef8d('0x51')]!==_0xef8d('0x9b')){delete this[_0xef8d('0x2a')][_0x19f237[_0xef8d('0xeb')]];this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0x62')]+=0x1;var _0x5857d7=new AgentComplete(_0x45bd20,_0x19f237);if(_0x19f237[_0xef8d('0xf6')]===_0xef8d('0xf7')){_0x5857d7[_0xef8d('0xf8')]=this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0xf9')]&&this[_0xef8d('0x24')][_0x19f237[_0xef8d('0xb8')]][_0xef8d('0xfa')]?moment()[_0xef8d('0x82')](_0xef8d('0xfb')):undefined;}this[_0xef8d('0xcb')](_0x5857d7)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xfc')));this['moveContactManagedDialer'](_0x5857d7)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xfd')));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x30')]=function(_0x20541b){if(this[_0xef8d('0x24')][_0x20541b[_0xef8d('0xb8')]]){if(this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]]&&this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]]['type']!==_0xef8d('0x9b')){this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x20541b[_0xef8d('0xb8')]]);this[_0xef8d('0x2a')][_0x20541b[_0xef8d('0xeb')]][_0xef8d('0xfe')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));}}};Dialer[_0xef8d('0x1e')][_0xef8d('0xff')]=function(_0x8e15){this[_0xef8d('0xcb')](_0x8e15)[_0xef8d('0xb5')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x8e15)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x100')));};Dialer[_0xef8d('0x1e')]['syncQueueCallerAbandon']=function(_0x4929fe){var _0x2c4fa0=this[_0xef8d('0x2a')][_0x4929fe[_0xef8d('0xeb')]];var _0x205e3c=this;if(this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]]){if(_0x2c4fa0&&_0x2c4fa0[_0xef8d('0x51')]!==_0xef8d('0x9b')){delete this['uniqueId'][_0x4929fe[_0xef8d('0xeb')]];this[_0xef8d('0xb7')](this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]]);_0x2c4fa0['droptime']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));var _0x1688db=new QueueCallerAbandon(_0x2c4fa0,_0x4929fe);if(getSeconds(_0x2c4fa0[_0xef8d('0x101')],_0x2c4fa0[_0xef8d('0x102')])>=_0x2c4fa0[_0xef8d('0x103')]){this[_0xef8d('0x24')][_0x4929fe['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0x67')]+=0x1;this['voiceQueues'][_0x4929fe['queue']][_0xef8d('0x74')]+=0x1;_0x1688db[_0xef8d('0xe2')]=0xa;_0x1688db[_0xef8d('0xac')]=_0xef8d('0x104');_0x1688db[_0xef8d('0x105')]='TIMEOUT';_0x1688db[_0xef8d('0xf8')]=this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0xf9')]?moment()['format'](_0xef8d('0xfb')):undefined;this[_0xef8d('0xff')](_0x1688db);}else{this[_0xef8d('0x24')][_0x4929fe['queue']][_0xef8d('0x71')]+=0x1;this[_0xef8d('0x24')][_0x4929fe[_0xef8d('0xb8')]][_0xef8d('0x66')]+=0x1;_0x1688db[_0xef8d('0xe2')]=0xb;_0x1688db[_0xef8d('0xac')]=_0xef8d('0x106');_0x1688db['dropreason']=_0xef8d('0x107');this[_0xef8d('0xff')](_0x1688db);}}}};Dialer[_0xef8d('0x1e')]['syncNewExten']=function(_0x396678){if(this[_0xef8d('0x29')][_0x396678['uniqueid']]){this[_0xef8d('0x29')][_0x396678[_0xef8d('0xeb')]]['channel']=_0x396678[_0xef8d('0xb4')];}if(this['uniqueId'][_0x396678[_0xef8d('0xeb')]]){this[_0xef8d('0x2a')][_0x396678[_0xef8d('0xeb')]][_0xef8d('0xb4')]=_0x396678[_0xef8d('0xb4')];}};Dialer[_0xef8d('0x1e')][_0xef8d('0x3d')]=function(_0x5885d7){if(strategy[this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x5885d7['actionid']][_0xef8d('0xb8')]][_0xef8d('0x52')]]===_0xef8d('0x1d')){if(this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]&&_['isNil'](this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x109')])&&_0x5885d7[_0xef8d('0xb3')]==='1'&&_0x5885d7['paused']==='0'){if(this[_0xef8d('0x26')][_0x5885d7['stateinterface']]){if(!this[_0xef8d('0x26')][_0x5885d7['stateinterface']][_0xef8d('0x109')]){this[_0xef8d('0x26')][_0x5885d7[_0xef8d('0x10a')]][_0xef8d('0x109')]=!![];this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x109')]=!![];this[_0xef8d('0x29')][_0x5885d7['actionid']]['stateinterface']=_0x5885d7[_0xef8d('0x10a')];}}}}else if((strategy[this[_0xef8d('0x24')][this['actions'][_0x5885d7[_0xef8d('0x108')]]['queue']][_0xef8d('0x52')]]||_0xef8d('0x1c'))===_0xef8d('0x1c')){if(this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]){if(this[_0xef8d('0x26')][_0x5885d7[_0xef8d('0x10a')]]){this['actions'][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0x10a')]=_0x5885d7['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]]['queue']])){this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x5885d7['actionid']][_0xef8d('0xb8')]]=[];}this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x10c')](_[_0xef8d('0x93')](_['pick'](this[_0xef8d('0x29')][_0x5885d7[_0xef8d('0x108')]],[_0xef8d('0x10d'),'stateinterface']),{'status':_0x5885d7[_0xef8d('0xb3')],'paused':_0x5885d7[_0xef8d('0x10e')]}));}}}};function unlockQueueStatus(_0x1fbb4c,_0x557435){setTimeout(function(){if(_[_0xef8d('0x41')](_0x1fbb4c[_0xef8d('0x10f')])){loggerBooked['error'](_0xef8d('0x110'),_0x557435);}_0x1fbb4c['queueStatusComplete']=!![];loggerBooked[_0xef8d('0x87')](_0xef8d('0x111'),_0x557435,JSON[_0xef8d('0x81')](_[_0xef8d('0xd0')](_0x1fbb4c,[_0xef8d('0x44'),_0xef8d('0x10f')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x589fdd){var _0x20d21e=this;var _0x4dfd17=_0x20d21e[_0xef8d('0x24')][_0x20d21e['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]];if(strategy[this[_0xef8d('0x24')][this['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x52')]]==='roundrobin'){if(this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]&&this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')]){this['preview'][_0xef8d('0x112')](this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['idHopper'],this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')])['catch'](function(_0x1843d2){logger[_0xef8d('0x9e')](_0xef8d('0x113'),util[_0xef8d('0x9f')](_0x1843d2,{'showHidden':![],'depth':null}));})[_0xef8d('0x21')](function(){_0x20d21e[_0xef8d('0xb7')](_0x20d21e[_0xef8d('0x24')][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]);_0x20d21e['agents'][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0x10a')]][_0xef8d('0x109')]=![];delete _0x20d21e['actions'][_0x589fdd[_0xef8d('0x108')]];unlockQueueStatus(_0x4dfd17);});}else{this[_0xef8d('0xb7')](this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]);this[_0xef8d('0xc4')]({'active':![],'ContactId':this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['ContactId'],'ListId':this['actions'][_0x589fdd['actionid']][_0xef8d('0xd1')],'VoiceQueueId':this['actions'][_0x589fdd['actionid']][_0xef8d('0xd3')]||undefined,'CampaignId':this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['CampaignId']||undefined})[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x114')));delete this['actions'][_0x589fdd[_0xef8d('0x108')]];unlockQueueStatus(_0x4dfd17);}}else if((strategy[this[_0xef8d('0x24')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x52')]]||_0xef8d('0x1c'))==='rrmemory'){var _0x12c9b8;if(this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]&&!_[_0xef8d('0x4b')](this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]])){if(this[_0xef8d('0x2e')][_0x20d21e[_0xef8d('0x29')][_0x589fdd['actionid']][_0xef8d('0xb8')]]){this[_0xef8d('0x2e')][_0x20d21e[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['queue']]=this['queueBookedRR'][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]?this[_0xef8d('0x2e')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]:this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]]['queue']]?this[_0xef8d('0x10b')][this[_0xef8d('0x29')][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]]['_rr']||0x0:0x0;}this[_0xef8d('0x10b')][this['actions'][_0x589fdd[_0xef8d('0x108')]][_0xef8d('0xb8')]][_0xef8d('0x115')]=this['queueBookedRR'][this[_0xef8d('0x29')][_0x589fdd['actionid']]['queue']];for(var _0x362a8d=0x0;_0x362a8d=0x0?!![]:![];})['catch'](myreject(_0x4ac408)));}}else{_0x5d2e2b[_0xef8d('0x10c')](ami[_0xef8d('0xb2')]({'action':_0xef8d('0x130'),'command':util['format'](_0xef8d('0x131'),_0x277ba9,!_[_0xef8d('0x41')](config[_0xef8d('0x128')][_0x42f59])?_0x42f59:'')})[_0xef8d('0xbc')](function(_0x3c6880){return _0x3c6880[_0xef8d('0x12d')]['indexOf'](_0xef8d('0x12f'))>=0x0?!![]:![];})['catch'](myreject(_0x4ac408)));}BPromise['all'](_0x5d2e2b)['then'](function(_0x1a7a36){var _0x4f1b86=_['some'](_0x1a7a36);if(_0x4f1b86){return _0x356b2c(_0x4f1b86);}else{_0x435027[_0xef8d('0x42')]=_0x5af0fc?_0xef8d('0x132'):'INTERVAL_IS_OVERTIME';return _0x4ac408(msgResponse(_0xef8d('0x133'),'Failure','Global:\x20'+_0x5af0fc+'\x20'+_0x452d8a+'\x20Interval\x20is\x20overtime:\x20'+util[_0xef8d('0x9f')](_0x277ba9,{'showHidden':![],'depth':null})+_0xef8d('0x134')+_0x42f59));}})[_0xef8d('0xb5')](function(_0x6c99d2){return _0x4ac408(msgResponse('ifTime',_0xef8d('0x125'),JSON[_0xef8d('0x81')](_0x6c99d2)));});});};Dialer[_0xef8d('0x1e')]['checkDialMethod']=function(_0x519811){var _0x26d29d=this;return function(){switch(_0x519811['dialMethod']){case'progressive':freeVariablesPredictive(_0x519811);_0x26d29d[_0xef8d('0x135')](_0x519811,0x1);break;case _0xef8d('0x136'):freeVariablesPredictive(_0x519811);_0x26d29d[_0xef8d('0x135')](_0x519811,_0x519811[_0xef8d('0x137')]);break;case'predictive':_0x26d29d[_0xef8d('0xa')](_0x519811);break;case _0xef8d('0x9'):freeVariablesPredictive(_0x519811);_0x26d29d['handlePower'](_0x519811,0x1);break;default:freeVariablesPredictive(_0x519811);logger['error']('Queue',_0x519811['name'],_0xef8d('0x138'));}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x139')]=function(_0x22cb27){var _0x57a1d5=this;return function(){_0x57a1d5[_0xef8d('0x13a')](_0x22cb27);};};Dialer['prototype'][_0xef8d('0xc')]=function(_0x18d686){var _0x21e249=this;if(isNotPreview(_0x18d686[_0xef8d('0x5e')])){if(isVoiceQueueOutbound(_0x18d686['type'])&&isActive(_0x18d686['dialActive'])){_0x18d686['sendMessageOneNotActive']=!![];BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](checkIsLoggedIn(_0x18d686,_0x18d686['loggedIn']))[_0xef8d('0xbc')](checkIsActive(_0x18d686,_0x18d686[_0xef8d('0x5d')]))['then'](checkInterval(_0x18d686))['then'](_0x21e249[_0xef8d('0x13b')](_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x122')](_0x18d686[_0xef8d('0x13c')],_0x18d686[_0xef8d('0x13d')],_0x18d686[_0xef8d('0x44')],_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x124')](_0x18d686[_0xef8d('0x47')],_0x18d686[_0xef8d('0x13d')],_0x18d686['name'],_0x18d686))[_0xef8d('0xbc')](_0x21e249[_0xef8d('0x13e')](_0x18d686))[_0xef8d('0xb5')](loggerCatchQueueSummary('[syncQueueSummary]',_0x18d686));}else{notSendMessagesQueue(_0x18d686);}}else{freeVariablesPredictive(_0x18d686);}};Dialer[_0xef8d('0x1e')]['syncCampaigns']=function(){var _0x22c87e=this;var _0x132571;for(var _0x224013 in this[_0xef8d('0x25')]){if(this[_0xef8d('0x25')]['hasOwnProperty'](_0x224013)){_0x132571=this['campaigns'][_0x224013];if(isCampaignIvr(_0x132571[_0xef8d('0x51')])&&isActive(_0x132571[_0xef8d('0x7f')])){_0x132571[_0xef8d('0xa5')]=!![];BPromise[_0xef8d('0xbb')]()[_0xef8d('0xbc')](checkIsActive(_0x132571,_0x132571['active']))[_0xef8d('0xbc')](checkInterval(_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x13b')](_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x122')](_0x132571[_0xef8d('0x13c')],_0x132571['dialTimezone'],_0x132571[_0xef8d('0x44')],_0x132571))['then'](_0x22c87e[_0xef8d('0x124')](_0x132571['Interval'],_0x132571['dialTimezone'],_0x132571[_0xef8d('0x44')],_0x132571))[_0xef8d('0xbc')](_0x22c87e[_0xef8d('0x139')](_0x132571))[_0xef8d('0xb5')](loggerCatchQueueSummary('[syncCampaigns]',_0x132571));}else{notSendMessagesCampaign(_0x132571);}}}};function getCallerIdRandom(_0x17529e,_0x27a536){var _0x51610e,_0xd0055b,_0x1b02da;if(_0x27a536<=0x0){_0x27a536=0x1;}_0x51610e=new RegExp('\x5cw{0,'+_0x27a536+'}$');_0xd0055b=Math[_0xef8d('0x13f')](0xa,_0x27a536-0x1);_0x1b02da=Math['pow'](0xa,_0x27a536)-0x1;return util[_0xef8d('0x82')]('%s',_[_0xef8d('0x140')](_0x17529e,_0x51610e,_[_0xef8d('0x141')](_0xd0055b,_0x1b02da)));}function extractCalleridName(_0x1fcedb){var _0x37ff8c=_0x1fcedb['match'](/"(.*?)"/);return _0x37ff8c?_0x37ff8c[0x1]:_0x1fcedb;}function extractCalleridNumber(_0x53131a){var _0x3f03a2=_0x53131a[_0xef8d('0x142')](/<(.*?)>/);return _0x3f03a2?_0x3f03a2[0x1]:_0x53131a;}Dialer[_0xef8d('0x1e')][_0xef8d('0x143')]=function(_0x5488b3,_0x137bf2){var _0x28efc5=this;var _0x5518c5=uuid['v4']();this[_0xef8d('0x29')][_0x5518c5]=new Action(_0x5488b3,_0x137bf2,_0x5518c5);return new BPromise(function(_0x475fb4,_0x40f750){if(_['isUndefined'](_0x5488b3)&&'object'!==typeof _0x5488b3){return _0x40f750(msgResponse(_0xef8d('0x144'),_0xef8d('0x125'),'voiceQueue\x20is\x20undefine'));}if(_[_0xef8d('0x41')](_0x137bf2['Contact'][_0xef8d('0x145')])||_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]===null){return _0x40f750(msgResponse(_0xef8d('0x144'),'Failure',_0xef8d('0x147')));}var _0x4378bf={'XMD-CALLERID':_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x148')](),'XMD-AGI':_0x5488b3[_0xef8d('0xf0')]?util[_0xef8d('0x82')](_0xef8d('0x149'),ipAgi,_0x5488b3['dialQueueProject']):_0xef8d('0x14a'),'XMD-AGIAFTER':_0x5488b3[_0xef8d('0xf9')]?util['format'](_0xef8d('0x149'),ipAgi,_0x5488b3[_0xef8d('0xf9')]):_0xef8d('0x14a'),'XMD-QUEUE':_0x5488b3[_0xef8d('0x51')]===_0xef8d('0x9a')?util[_0xef8d('0x82')](_0xef8d('0x14b'),_0x5488b3[_0xef8d('0x44')],_0x5488b3[_0xef8d('0x14c')]||'',_0x5488b3[_0xef8d('0xfa')]?'c':'',_0x5488b3['dialQueueTimeout']||0x3):_0xef8d('0x14a'),'XMD-CONTACTID':_0x137bf2['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x148')](),'XMD-AMD':_0x5488b3[_0xef8d('0xde')]?_0xef8d('0x14d'):_0xef8d('0x14a'),'XMD-DESTINATION':_0xef8d('0x14e')};if(_0x5488b3[_0xef8d('0xde')]){_0x4378bf[_0xef8d('0x14f')]=_0x5488b3['dialAMDInitialSilence']||0x9c4;_0x4378bf[_0xef8d('0x150')]=_0x5488b3['dialAMDGreeting']||0x5dc;_0x4378bf[_0xef8d('0x151')]=_0x5488b3['dialAMDAfterGreetingSilence']||0x320;_0x4378bf[_0xef8d('0x152')]=_0x5488b3['dialAMDTotalAnalysisTime']||0x1388;_0x4378bf[_0xef8d('0x153')]=_0x5488b3[_0xef8d('0x154')]||0x64;_0x4378bf[_0xef8d('0x155')]=_0x5488b3[_0xef8d('0x156')]||0x32;_0x4378bf[_0xef8d('0x157')]=_0x5488b3[_0xef8d('0x158')]||0x3;_0x4378bf[_0xef8d('0x159')]=_0x5488b3[_0xef8d('0x15a')]||0x100;_0x4378bf[_0xef8d('0x15b')]=_0x5488b3[_0xef8d('0x15c')]||0x1388;}if(_0x5488b3['type']===_0xef8d('0x9a')){_0x4378bf['XMD-VOICEQUEUEID']=_0x137bf2['VoiceQueueId'];}else{_0x4378bf[_0xef8d('0x15d')]=_0x137bf2[_0xef8d('0xd4')];}for(var _0x515e24 in _0x137bf2[_0xef8d('0x146')]){if(_0x137bf2['Contact'][_0xef8d('0x15e')](_0x515e24)){if(isNotNull(_0x137bf2[_0xef8d('0x146')][_0x515e24])&&_0x515e24!=='id'&&_0x515e24!==_0xef8d('0x15f')&&_0x515e24!=='createdAt'&&_0x515e24!==_0xef8d('0x160')){_0x4378bf[util[_0xef8d('0x82')](_0xef8d('0x161'),_0xef8d('0x162'),_[_0xef8d('0x163')](_0x515e24))]=_0x137bf2[_0xef8d('0x146')][_0x515e24];}}}var _0x180784=_0x28efc5[_0xef8d('0xd8')](_0x5488b3[_0xef8d('0x7e')])?getCallerId(_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x80')],_0x5488b3['dialOriginateCallerIdName'],_0x5488b3['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5488b3[_0xef8d('0x60')],_0x5488b3[_0xef8d('0x164')]):_0x5488b3[_0xef8d('0x60')]):getCallerId(_[_0xef8d('0xb1')](_0x5488b3[_0xef8d('0x120')])?_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x80')]:_0x5488b3[_0xef8d('0x120')][_0xef8d('0x80')],_0x5488b3[_0xef8d('0x5f')],_0x5488b3[_0xef8d('0x164')]>0x0?getCallerIdRandom(_0x5488b3[_0xef8d('0x60')],_0x5488b3[_0xef8d('0x164')]):_0x5488b3['dialOriginateCallerIdNumber']);if(_0x180784){_0x4378bf[_0xef8d('0x165')]=_0x28efc5[_0xef8d('0x29')][_0x5518c5][_0xef8d('0x166')]=extractCalleridName(_0x180784);_0x4378bf[_0xef8d('0x167')]=_0x28efc5[_0xef8d('0x29')][_0x5518c5]['originatecalleridnum']=extractCalleridNumber(_0x180784);}return ami[_0xef8d('0xb2')]({'actionid':_0x5518c5,'action':_0xef8d('0x144'),'channel':_0x28efc5[_0xef8d('0xd8')](_0x5488b3[_0xef8d('0x7e')])?util['format'](_0xef8d('0x168'),_0x5488b3[_0xef8d('0x7e')][_0xef8d('0x44')],isNotNull(_0x5488b3['dialPrefix'])?_0x5488b3[_0xef8d('0x169')][_0xef8d('0x16a')]()||'':'',_0x5488b3[_0xef8d('0x16b')]>0x0?_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')][_0xef8d('0x16c')](_0x5488b3[_0xef8d('0x16b')]):_0x137bf2['Contact']['phone']):util[_0xef8d('0x82')]('SIP/%s/%s%s',_['isNil'](_0x5488b3[_0xef8d('0x120')])?_0x5488b3[_0xef8d('0x7e')]['name']:_0x5488b3[_0xef8d('0x120')][_0xef8d('0x44')],isNotNull(_0x5488b3[_0xef8d('0x169')])?_0x5488b3['dialPrefix'][_0xef8d('0x16a')]()||'':'',_0x5488b3['dialCutDigit']>0x0?_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]['substring'](_0x5488b3['dialCutDigit']):_0x137bf2[_0xef8d('0x146')][_0xef8d('0x145')]),'callerid':_0x180784,'Exten':_0xef8d('0x14e'),'Context':_0xef8d('0x16d'),'Priority':'1','variable':_0x4378bf,'timeout':(_0x5488b3['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5518c5})[_0xef8d('0xbc')](function(_0x5e4502){return _0x475fb4(_0x5e4502);})[_0xef8d('0xb5')](function(_0x33dabb){_0x5488b3[_0xef8d('0x6a')]+=0x1;var _0x518078=new History(_0x28efc5[_0xef8d('0x29')][_0x5518c5]);logger[_0xef8d('0x9e')](util[_0xef8d('0x82')](_0xef8d('0x16e'),JSON[_0xef8d('0x81')](_0x33dabb)));_0x518078['state']=0xe;_0x518078[_0xef8d('0xac')]=_0xef8d('0x16f');_0x518078['starttime']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));_0x518078[_0xef8d('0xad')]=_0x518078[_0xef8d('0x170')];_0x28efc5[_0xef8d('0xcb')](_0x518078)[_0xef8d('0xb5')](loggerCatch('[originate][error]'));_0x28efc5[_0xef8d('0xc9')](_0x518078)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x171')))['finally'](function(){delete _0x28efc5['actions'][_0x5518c5];return _0x40f750(msgResponse(_0xef8d('0x144'),_0xef8d('0x4d'),_0xef8d('0x172')));});});});};Dialer[_0xef8d('0x1e')][_0xef8d('0x35')]=function(_0x358416){var _0x3d387a=this[_0xef8d('0x29')][_0x358416[_0xef8d('0x108')]];var _0x5c981e=this;if(_0x3d387a){delete this[_0xef8d('0x29')][_0x358416[_0xef8d('0x108')]];_0x3d387a[_0xef8d('0x102')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));var _0x2e4469=_0x3d387a[_0xef8d('0x51')]===_0xef8d('0x9b')?this[_0xef8d('0x25')][_0x3d387a[_0xef8d('0xb8')]]:this[_0xef8d('0x24')][_0x3d387a[_0xef8d('0x173')]()];if(!this[_0xef8d('0xd6')](_0x358416[_0xef8d('0x174')])){this[_0xef8d('0xb7')](_0x2e4469);return this[_0xef8d('0x175')](_0x3d387a,_0x2e4469,_0x358416)[_0xef8d('0xbc')](function(_0x3d12e0){})[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x176')));}else{this[_0xef8d('0x2a')][_0x358416[_0xef8d('0xeb')]]=_0x3d387a;}}};Dialer[_0xef8d('0x1e')][_0xef8d('0x177')]=function(_0x4de12e,_0x205621,_0x17ef6f){var _0xc9b787=new History(_0x205621);if(_0xc9b787[_0xef8d('0x178')]+_0xc9b787[_0xef8d('0x179')]+_0xc9b787['countnoanswerretry']>=_0x17ef6f['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x4de12e){case 0x3:if(_0xc9b787[_0xef8d('0x17a')]>=_0x17ef6f[_0xef8d('0x17b')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countnoanswerretry':_0xc9b787[_0xef8d('0x17a')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f[_0xef8d('0x17c')],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787['ListId'],'VoiceQueueId':_0xc9b787[_0xef8d('0xd3')]||undefined,'CampaignId':_0xc9b787[_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x17e')));}break;case 0x5:if(_0xc9b787[_0xef8d('0x178')]>=_0x17ef6f[_0xef8d('0x17f')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countbusyretry':_0xc9b787[_0xef8d('0x178')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f[_0xef8d('0x180')],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787[_0xef8d('0xd1')],'VoiceQueueId':_0xc9b787[_0xef8d('0xd3')]||undefined,'CampaignId':_0xc9b787['CampaignId']||undefined})[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0xc9b787['countcongestionretry']>=_0x17ef6f[_0xef8d('0x181')]-0x1){return!![];}else{this[_0xef8d('0xc4')]({'active':![],'countcongestionretry':_0xc9b787[_0xef8d('0x179')]+=0x1,'scheduledat':moment()['add'](_0x17ef6f['dialCongestionRetryFrequency'],_0xef8d('0x17d'))['format'](_0xef8d('0xfb')),'ContactId':_0xc9b787[_0xef8d('0x11d')],'ListId':_0xc9b787[_0xef8d('0xd1')],'VoiceQueueId':_0xc9b787['VoiceQueueId']||undefined,'CampaignId':_0xc9b787[_0xef8d('0xd4')]||undefined})[_0xef8d('0xb5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0xef8d('0x1e')][_0xef8d('0x175')]=function(_0x31f3d8,_0x5f36d4,_0x3fad4a){var _0x2c569f=this;var _0x1bc80e=new History(_0x31f3d8);return new BPromise(function(_0xba2d18,_0xd69773){if(_[_0xef8d('0x41')](_0x5f36d4)&&_0xef8d('0x182')!==typeof _0x5f36d4){return _0xd69773(msgResponse('[callProgressDetecting]',_0xef8d('0x125'),_0xef8d('0x183')));}if(_[_0xef8d('0x41')](_0x3fad4a)&&_0xef8d('0x182')!==typeof _0x3fad4a){return _0xd69773(msgResponse('[callProgressDetecting]',_0xef8d('0x125'),_0xef8d('0x184')));}switch(_0x3fad4a[_0xef8d('0xf6')]){case'0':_0x5f36d4['outboundNoSuchCallsDay']+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x0;_0x1bc80e[_0xef8d('0xac')]=_0xef8d('0x185');_0x2c569f['createHistory'](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x186')));if(_0x2c569f[_0xef8d('0x177')](0x0,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]+_0x1bc80e[_0xef8d('0x179')]+_0x1bc80e[_0xef8d('0x17a')]>=_0x5f36d4[_0xef8d('0x187')]){_0x2c569f['stateGlobal'](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x188'));}else{_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x188'));}}break;case'3':_0x5f36d4[_0xef8d('0x68')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x3;_0x1bc80e[_0xef8d('0xac')]=_0xef8d('0x18a');_0x1bc80e[_0xef8d('0x17a')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2c569f[_0xef8d('0x177')](0x3,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x17a')]>=_0x5f36d4[_0xef8d('0x17b')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18c'));}else{_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5f36d4[_0xef8d('0x64')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0x5;_0x1bc80e[_0xef8d('0xac')]='Busy';_0x1bc80e[_0xef8d('0x178')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2c569f[_0xef8d('0x177')](0x5,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]>=_0x5f36d4[_0xef8d('0x17f')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18e'));}else{_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x18e'));}}break;case'8':_0x5f36d4[_0xef8d('0x65')]+=0x1;_0x1bc80e['state']=0x8;_0x1bc80e[_0xef8d('0xac')]='Congestion';_0x1bc80e[_0xef8d('0x179')]+=0x1;_0x1bc80e[_0xef8d('0x18b')]+=0x1;_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x18f')));if(_0x2c569f[_0xef8d('0x177')](0x8,_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x179')]>=_0x5f36d4[_0xef8d('0x181')]){_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0xef8d('0x190'));}else{_0x2c569f['stateGlobal'](_0x1bc80e,_0xba2d18,_0xd69773,'reason\x208\x20congestion');}}break;default:_0x5f36d4[_0xef8d('0x6d')]+=0x1;_0x1bc80e[_0xef8d('0xe2')]=0xc;_0x1bc80e[_0xef8d('0xac')]=_0x3fad4a[_0xef8d('0xf6')];_0x2c569f[_0xef8d('0xcb')](_0x1bc80e)[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x191')));if(_0x2c569f[_0xef8d('0x177')](_0x3fad4a[_0xef8d('0xf6')],_0x31f3d8,_0x5f36d4)){if(_0x1bc80e[_0xef8d('0x178')]+_0x1bc80e['countcongestionretry']+_0x1bc80e['countnoanswerretry']>=_0x5f36d4['dialGlobalMaxRetry']){_0x2c569f[_0xef8d('0x18d')](_0x1bc80e,_0xba2d18,_0xd69773,_0x3fad4a[_0xef8d('0xf6')]);}else{_0x2c569f[_0xef8d('0x189')](_0x1bc80e,_0xba2d18,_0xd69773,_0x3fad4a[_0xef8d('0xf6')]);}}}});};Dialer['prototype'][_0xef8d('0x18d')]=function(_0x379283,_0x30709e,_0x5c9a85,_0x166e65){var _0x4b68af=new Final(_0x379283);_0x4b68af[_0xef8d('0xe2')]=0xf;_0x4b68af[_0xef8d('0xac')]=_0xef8d('0x192');this[_0xef8d('0x189')](_0x4b68af,_0x30709e,_0x5c9a85,_0x166e65);};Dialer['prototype']['createStateFinal']=function(_0x351a7b,_0xce816b,_0x26ad51,_0x3ee538){this[_0xef8d('0xc9')](_0x351a7b)[_0xef8d('0xbc')](function(_0x271a26){return _0xce816b(msgResponse(_0xef8d('0x193'),_0xef8d('0xd7'),_0x3ee538));})[_0xef8d('0xb5')](function(_0x4bcd7b){return _0x26ad51(msgResponse(_0xef8d('0x194'),_0xef8d('0x125'),_0xef8d('0x195')));});};Dialer['prototype']['predictive']=function(_0x30a410){var _0x5e50bb=this;var _0x23845a=_0x30a410['dialPredictiveOptimizationPercentage']/0x64;var _0x5b30d9=_0x30a410['outboundDropCallsDayTimeout']/(_0x30a410[_0xef8d('0x67')]+_0x30a410[_0xef8d('0x62')]);var _0x17a766=Math['round'](_0x30a410['predictiveIntervalAvailable']*(_0x30a410['predictiveIntervalMaxThreshold']/0x64));var _0x4c1a0c=Math['round'](_0x30a410[_0xef8d('0x196')]*(_0x30a410['predictiveIntervalMinThreshold']/0x64));var _0x1fda17=_0x30a410[_0xef8d('0x54')]+_0x30a410['talking'];var _0x9575e2=Math[_0xef8d('0x197')](_0x30a410[_0xef8d('0x7a')]*_0x30a410[_0xef8d('0x7c')]*_0x30a410['predictiveIntervalHitRate']*_0x30a410[_0xef8d('0x76')]);if(_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x2c')])){if(!_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x96')])){_0x30a410[_0xef8d('0x96')]=undefined;loggerPredictive[_0xef8d('0x9e')](_0xef8d('0x198'),_0xef8d('0x199'));}if(!_['isUndefined'](_0x30a410[_0xef8d('0x98')])){loggerPredictive['error'](_0xef8d('0x198'),_0xef8d('0x19a'));clearInterval(_0x30a410[_0xef8d('0x98')]);_0x30a410[_0xef8d('0x98')]=undefined;}_0x30a410[_0xef8d('0x2c')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive[_0xef8d('0x87')](_0x30a410[_0xef8d('0x44')],_0xef8d('0x19b'),_0x30a410['startProgressive']);this['handlePower'](_0x30a410,0x1);}else if(ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x2c')])){this[_0xef8d('0x135')](_0x30a410,0x1);loggerPredictiveCalls[_0xef8d('0x87')](_0xef8d('0x19d'),_0x30a410[_0xef8d('0x2c')],_0x30a410[_0xef8d('0x44')]);_0x30a410[_0xef8d('0x7a')]=0x0;_0x30a410[_0xef8d('0x74')]=0x0;}else if(_0x23845a<_0x5b30d9&&_0x30a410[_0xef8d('0x19e')]===_0xef8d('0x19f')){freeVariablesPredictive(_0x30a410);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1a0'),_0xef8d('0x1a1'),_0x5b30d9,_0xef8d('0x2c'),_0x30a410[_0xef8d('0x44')]);}else if(_0x9575e2<_0x30a410['predictiveIntervalErlangCallsDroppedCalls']&&_0x30a410[_0xef8d('0x19e')]===_0xef8d('0x19f')){freeVariablesPredictive(_0x30a410);loggerPredictive[_0xef8d('0x87')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xef8d('0x1a2'),_0x9575e2,_0xef8d('0x1a3'),_0x30a410[_0xef8d('0x74')],_0xef8d('0x2c'),_0x30a410[_0xef8d('0x44')]);}else if(!ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x2c')])&&_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x96')])&&!_[_0xef8d('0x41')](_0x30a410[_0xef8d('0x2c')])){_0x30a410['startPredictive']=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],'started\x20in\x20predictive\x20at',_0x30a410[_0xef8d('0x96')]);this[_0xef8d('0x1a4')](_0x30a410[_0xef8d('0x19c')])[_0xef8d('0xbc')](this[_0xef8d('0x1a5')](_0x30a410))[_0xef8d('0xbc')](mergeDataErlangB(_0x30a410))['then'](this[_0xef8d('0x1a6')](_0x30a410))[_0xef8d('0xb5')](loggerCatchPredictive(_0xef8d('0x1a7'),_0x30a410));}else if(!ifInterval(_0x30a410[_0xef8d('0x19c')],_0x30a410[_0xef8d('0x96')])){_0x30a410['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x30a410[_0xef8d('0x96')]=moment()[_0xef8d('0x82')](_0xef8d('0xfb'));loggerPredictive[_0xef8d('0x87')](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1a8'),_0x30a410[_0xef8d('0x96')]);clearInterval(_0x30a410[_0xef8d('0x98')]);_0x30a410[_0xef8d('0x98')]=undefined;this[_0xef8d('0x1a4')](_0x30a410[_0xef8d('0x19c')])[_0xef8d('0xbc')](this[_0xef8d('0x1a5')](_0x30a410))[_0xef8d('0xbc')](mergeDataErlangB(_0x30a410))[_0xef8d('0xbc')](this[_0xef8d('0x1a6')](_0x30a410))[_0xef8d('0xb5')](loggerCatchPredictive(_0xef8d('0x1a9'),_0x30a410));}else if(_0x30a410[_0xef8d('0x196')]&&_0x1fda17<_0x30a410['predictiveIntervalAvailable']-_0x4c1a0c){freeVariablesPredictive(_0x30a410);loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1aa'),_0x1fda17,')\x20are\x20less\x20than\x20threshold\x20(',_0x30a410[_0xef8d('0x196')],'-',_0x4c1a0c,'=',_0x30a410['predictiveIntervalAvailable']-_0x4c1a0c,')');}else if(_0x30a410[_0xef8d('0x196')]&&_0x1fda17>_0x30a410['predictiveIntervalAvailable']+_0x17a766){freeVariablesPredictive(_0x30a410);loggerPredictive['info'](_0x30a410[_0xef8d('0x44')],_0xef8d('0x1aa'),_0x1fda17,_0xef8d('0x1ab'),_0x30a410[_0xef8d('0x196')],'+',_0x17a766,'=',_0x30a410[_0xef8d('0x196')]+_0x17a766,')');}};Dialer[_0xef8d('0x1e')][_0xef8d('0x1a5')]=function(_0x58c379){var _0x57285c=this;return function(_0x39b341){return new BPromise(function(_0x1a0c72,_0x214cc0){_[_0xef8d('0x93')](_0x58c379,_0x39b341[0x0]);if(checkGetDataPredictive(_0x39b341[0x0])){var _0x4b9c88=_0x58c379[_0xef8d('0x196')]=_0x58c379[_0xef8d('0xa6')]+_0x58c379[_0xef8d('0x54')];var _0x4d6c55=_0x58c379[_0xef8d('0x19c')]*0x3c;var _0x9c06ad=_0x39b341[0x0][_0xef8d('0x70')]+_0x39b341[0x0][_0xef8d('0x6f')];var _0x402ad3=(_0x39b341[0x0][_0xef8d('0x6e')]+_0x39b341[0x0][_0xef8d('0x72')]+_0x39b341[0x0][_0xef8d('0x71')])/_0x39b341[0x0][_0xef8d('0x78')];_0x58c379[_0xef8d('0x75')]=_0x402ad3>0x0?_0x402ad3:0x1;switch(_0x58c379[_0xef8d('0x19e')]){case'dropRate':var _0x54729b=_0x58c379[_0xef8d('0x1ac')]/0x64;return _0x57285c['abandonmentRate'](_0x4b9c88,_0x4d6c55,_0x9c06ad,_0x402ad3,_0x54729b)[_0xef8d('0xbc')](function(_0x28b2cb){return _0x1a0c72(_0x28b2cb);});case'agentBusyFactor':var _0x9fc225=_0x58c379[_0xef8d('0x1ac')]/0x64;return _0x57285c[_0xef8d('0x1ad')](_0x4b9c88,_0x4d6c55,_0x9c06ad,_0x402ad3,_0x9fc225)['then'](function(_0x47f737){return _0x1a0c72(_0x47f737);});default:return _0x214cc0(msgResponse('[getDataPredictive]',_0xef8d('0x125'),_0xef8d('0x1ae')));}}else{return _0x214cc0(msgResponse(_0xef8d('0x1af'),_0xef8d('0x125'),_0xef8d('0x1b0')));}});};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1b1')]=function(_0x698409){var _0x1a36c8=this;return function(_0x433005){return new BPromise(function(_0x5efb2a,_0x509995){_[_0xef8d('0x93')](_0x698409,_0x433005[0x0]);if(checkGetDataPredictive(_0x433005[0x0])){loggerPredictive[_0xef8d('0x87')](JSON[_0xef8d('0x81')](_0x433005[0x0]));if(_0x698409[_0xef8d('0x19e')]===_0xef8d('0x19f')){return _0x1a36c8['getVoiceQueueRtPauses'](_0x698409['id'])['then'](function(_0x2a85f1){var _0x1b65ba=_0x698409['loggedIn']-_0x2a85f1[0x0][_0xef8d('0x1b2')];var _0x4dc0be=_0x698409[_0xef8d('0x19c')]*0x3c;var _0x4a54e6=_0x433005[0x0][_0xef8d('0x70')]+_0x433005[0x0][_0xef8d('0x6f')];var _0x20104f=(_0x433005[0x0][_0xef8d('0x6e')]+_0x433005[0x0][_0xef8d('0x72')]+_0x433005[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x433005[0x0][_0xef8d('0x78')];var _0x7d2635=_0x698409[_0xef8d('0x1ac')]/0x64;_0x698409[_0xef8d('0x77')]=_0x2a85f1[0x0]['outboundQueuePauses']||0x0;_0x698409[_0xef8d('0x75')]=_0x20104f>0x0?_0x20104f:0x1;return _0x1a36c8['abandonmentRate'](_0x1b65ba,_0x4dc0be,_0x4a54e6,_0x20104f,_0x7d2635);})[_0xef8d('0xbc')](function(_0x4eac5b){return _0x5efb2a(_0x4eac5b);})[_0xef8d('0xb5')](function(_0x45a766){return _0x509995(msgResponse(_0xef8d('0x1b3'),_0xef8d('0x125'),JSON['stringify'](_0x45a766)));});}if(_0x698409[_0xef8d('0x19e')]===_0xef8d('0x1b4')){return _0x1a36c8[_0xef8d('0xc8')](_0x698409['id'])[_0xef8d('0xbc')](function(_0x5bd38c){var _0x487f7c=_0x698409[_0xef8d('0x1b5')]-_0x5bd38c[0x0][_0xef8d('0x1b2')];var _0x3c4676=_0x698409['dialPredictiveInterval']*0x3c;var _0x574403=_0x433005[0x0][_0xef8d('0x70')]+_0x433005[0x0]['predictiveIntervalAvgHoldtime'];var _0x2ad07f=(_0x433005[0x0][_0xef8d('0x6e')]+_0x433005[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x433005[0x0][_0xef8d('0x71')])/_0x433005[0x0][_0xef8d('0x78')];var _0x263583=_0x698409[_0xef8d('0x1ac')]/0x64;_0x698409['predictiveIntervalPauses']=_0x5bd38c[0x0][_0xef8d('0x1b2')]||0x0;_0x698409[_0xef8d('0x75')]=_0x2ad07f>0x0?_0x2ad07f:0x1;return _0x1a36c8[_0xef8d('0x1ad')](_0x487f7c,_0x3c4676,_0x574403,_0x2ad07f,_0x263583);})[_0xef8d('0xbc')](function(_0x4066e1){return _0x5efb2a(_0x4066e1);})[_0xef8d('0xb5')](function(_0xb8c9ce){return _0x509995(msgResponse(_0xef8d('0x1b3'),_0xef8d('0x125'),JSON['stringify'](_0xb8c9ce)));});}}else{return _0x509995(msgResponse('[getDataPredictive]',_0xef8d('0x125'),_0xef8d('0x1b0')));}});};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1a6')]=function(_0x27e3f7){var _0x1fe0d6=this;return function(){var _0x5b9cbb=0x0;var _0x57f029=Math[_0xef8d('0x197')](_0x27e3f7['erlangCallToSecond']*0x3e8);if(_0x57f029>0x0){_0x57f029=_0x57f029<0x64?0x64:_0x57f029;loggerPredictive['info'](_0x27e3f7[_0xef8d('0x44')],'one\x20call\x20every:',_0x57f029,_0xef8d('0x4e'));_0x27e3f7[_0xef8d('0x98')]=setInterval(function(){_0x1fe0d6[_0xef8d('0x98')](_0x27e3f7);loggerPredictiveCalls[_0xef8d('0x87')]('[handlePredictive]',_0x5b9cbb+=0x1);},_0x57f029);}else{loggerPredictive['info'](_0x27e3f7[_0xef8d('0x44')],_0xef8d('0x1b6'));}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x1b7')]=function(_0x261859,_0x42a954){var _0x790130=this;return function(_0x22855c){if(_[_0xef8d('0x4b')](_0x22855c)){if(_[_0xef8d('0xb1')](_0x42a954[_0xef8d('0xd2')])||!_0x42a954['recallme']){if(_0x261859[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x261859[_0xef8d('0x10f')]=_[_0xef8d('0x41')](_0x261859[_0xef8d('0x10f')])?!![]:_0x261859[_0xef8d('0x10f')];var _0x151f15=uuid['v4']();_0x790130['actions'][_0x151f15]=new Action(_0x261859,_0x42a954,_0x151f15);loggerBooked[_0xef8d('0x87')](_0xef8d('0x1b8'),_0x151f15,'queueStatusComplete:\x20',JSON['stringify'](_0x261859['queueStatusComplete']),_0xef8d('0x1b9'),_0x261859[_0xef8d('0x44')]);if(_0x261859['queueStatusComplete']){_0x261859[_0xef8d('0x10f')]=![];_0x790130[_0xef8d('0x10b')][_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xb8')]]=[];ami[_0xef8d('0xb2')]({'actionid':_0x151f15,'action':_0xef8d('0x1ba'),'queue':_0x261859[_0xef8d('0x44')]})['catch'](function(_0x3802bf){_0x790130[_0xef8d('0xb7')](_0x261859);_0x790130[_0xef8d('0xc4')]({'active':![],'ContactId':_0x790130[_0xef8d('0x29')][_0x151f15]['ContactId'],'ListId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd1')],'VoiceQueueId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd3')]||undefined,'CampaignId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bb')));delete _0x790130[_0xef8d('0x29')][_0x151f15];});}else{loggerBooked[_0xef8d('0x87')](_0xef8d('0x1bc'),JSON[_0xef8d('0x81')](_0x261859['queueStatusComplete']),_0xef8d('0x1b9'),_0x261859['name']);_0x790130[_0xef8d('0xb7')](_0x261859);_0x790130[_0xef8d('0xc4')]({'active':![],'ContactId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0x11d')],'ListId':_0x790130['actions'][_0x151f15][_0xef8d('0xd1')],'VoiceQueueId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd3')]||undefined,'CampaignId':_0x790130[_0xef8d('0x29')][_0x151f15][_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bb')));delete _0x790130[_0xef8d('0x29')][_0x151f15];}}else{return _0x790130[_0xef8d('0x143')](_0x261859,_0x42a954);}}else{if(getDiff(_0x42a954['scheduledat'])<_0x261859[_0xef8d('0x1bd')]*0x3c){_0x790130[_0xef8d('0x23')][_0xef8d('0x112')](_0x42a954['id'])[_0xef8d('0x21')](function(){_0x790130[_0xef8d('0xb7')](_0x261859);});}else{_0x261859[_0xef8d('0x6b')]+=0x1;_0x790130['updateOriginated'](_0x261859);if(_0x261859[_0xef8d('0x1be')]){_0x790130[_0xef8d('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x42a954['ContactId'],'ListId':_0x42a954[_0xef8d('0xd1')],'VoiceQueueId':_0x42a954[_0xef8d('0xd3')]||undefined,'CampaignId':_0x42a954[_0xef8d('0xd4')]||undefined})['catch'](loggerCatch(_0xef8d('0x1bf')));_0x790130['createHistory'](createObjHistory(_0x261859,_0x42a954,'RECALLINQUEUE',0x17,_0xef8d('0x1c0')))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0x1c1')));}else{_0x790130[_0xef8d('0xcf')](createObjHistory(_0x261859,_0x42a954,_0xef8d('0x1c2'),0x16,_0xef8d('0x1c3')),_0xef8d('0x1c4'),_0xef8d('0x1c5'));}}}}else{_0x261859[_0xef8d('0x63')]+=0x1;_0x790130[_0xef8d('0xcf')](createObjHistory(_0x261859,_0x42a954,_0xef8d('0x1c6'),0xd,_0xef8d('0x1c7')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0xef8d('0x1c8');}};};Dialer[_0xef8d('0x1e')][_0xef8d('0x13a')]=function(_0x313d45){var _0x3edfd3=this;var _0x564ccb=[];var _0x14a6c0=_0x313d45[_0xef8d('0x1c9')]-_0x313d45[_0xef8d('0x79')]-_0x313d45[_0xef8d('0x1ca')];emitCampaignSummary(_0x313d45);if(_0x14a6c0>0x0){if(_0x14a6c0>this[_0xef8d('0x1cb')]){_0x14a6c0=this[_0xef8d('0x1cb')];}_0x313d45[_0xef8d('0x1ca')]+=_0x14a6c0;this['getContactDialerIvr'](_0x313d45['id'],_0x14a6c0,_0x313d45[_0xef8d('0x1cc')])[_0xef8d('0xbc')](function(_0x33c56d){_0x313d45[_0xef8d('0x1ca')]-=_0x14a6c0;_0x313d45['temp']=_0x313d45[_0xef8d('0x1ca')]>0x0?_0x313d45[_0xef8d('0x1ca')]:0x0;if(!checkContactEmpty(_0x33c56d)){_0x313d45[_0xef8d('0x42')]=_0xef8d('0xa4');logger[_0xef8d('0x87')](_0xef8d('0x1cd')+_0x313d45[_0xef8d('0x44')]);}else{_0x313d45['originated']+=_0x33c56d['length'];_0x313d45[_0xef8d('0x42')]=_0xef8d('0x1ce');for(var _0x4a2c37=0x0;_0x4a2c37<_0x33c56d['length'];_0x4a2c37+=0x1){_0x313d45['ivrTotalCallsDays']+=0x1;if(_[_0xef8d('0xb1')](_0x33c56d[_0x4a2c37])||_[_0xef8d('0xb1')](_0x33c56d[_0x4a2c37][_0xef8d('0x146')])||_['isNil'](_0x33c56d[_0x4a2c37][_0xef8d('0x146')][_0xef8d('0x145')])){_0x3edfd3[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x313d45,_0x33c56d[_0x4a2c37]);}else{_0x3edfd3[_0xef8d('0xc0')](_[_0xef8d('0xd0')](_0x33c56d[_0x4a2c37],[_0xef8d('0xd4'),_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x3edfd3[_0xef8d('0x1b7')](_0x313d45,_0x33c56d[_0x4a2c37]))[_0xef8d('0xb5')](_0x3edfd3[_0xef8d('0xce')](_0xef8d('0x1d2'),_0x313d45));}}}})[_0xef8d('0xb5')](loggerGetContactDialer(_0xef8d('0x1d3'),_0x313d45,_0x14a6c0));}};Dialer[_0xef8d('0x1e')]['handlePower']=function(_0x37b7ab,_0x23fcc){var _0x4f2101=this;var _0x12deaf=[];var _0x30ab24=_0x23fcc>=0x1?_0x23fcc:0x1;var _0x10525a=[];if(_0x37b7ab[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x30ab24=0x1;}var _0x3d0dd4=Math[_0xef8d('0x197')](_0x37b7ab[_0xef8d('0x54')]*_0x30ab24)-_0x37b7ab['originated']-_0x37b7ab[_0xef8d('0x1ca')];emitVoiceQueueSummary(_0x37b7ab);if(_0x37b7ab[_0xef8d('0x1d4')]>0x0){var _0x241eca=_0x37b7ab[_0xef8d('0x1d4')]-_0x37b7ab[_0xef8d('0x79')]-_0x37b7ab[_0xef8d('0xa6')]-_0x37b7ab[_0xef8d('0x1ca')]-_0x37b7ab[_0xef8d('0x55')];if(_0x3d0dd4>_0x241eca){_0x3d0dd4=_0x241eca;}}if(_0x3d0dd4>0x0){if(_0x37b7ab[_0xef8d('0x5e')]===_0xef8d('0x9')){_0x3d0dd4=0x1;}if(_0x3d0dd4>this[_0xef8d('0x1cb')]){_0x3d0dd4=this[_0xef8d('0x1cb')];}_0x37b7ab[_0xef8d('0x1ca')]+=_0x3d0dd4;for(var _0x691438 in this[_0xef8d('0x26')]){if(this[_0xef8d('0x26')][_0xef8d('0x15e')](_0x691438)){if(this[_0xef8d('0x26')][_0x691438][_0xef8d('0xe2')]==='not_inuse'&&this[_0xef8d('0x26')][_0x691438][_0xef8d('0xb3')]===_0xef8d('0xda')){_0x12deaf[_0xef8d('0x10c')](this[_0xef8d('0x26')][_0x691438]['id']);}}}this[_0xef8d('0xc5')](_0x37b7ab['id'],_0x12deaf,_0x3d0dd4,_0x37b7ab['dialOrderByScheduledAt'])['then'](function(_0x1834c8){_0x37b7ab[_0xef8d('0x1ca')]-=_0x3d0dd4;_0x37b7ab[_0xef8d('0x1ca')]=_0x37b7ab[_0xef8d('0x1ca')]>0x0?_0x37b7ab[_0xef8d('0x1ca')]:0x0;if(!checkContactEmpty(_0x1834c8)){_0x4f2101['countReScheduled'](_0x37b7ab)[_0xef8d('0xbc')](sendMessageReschedule(_0x37b7ab))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x37b7ab[_0xef8d('0x79')]+=_0x1834c8[_0xef8d('0x12c')];_0x37b7ab[_0xef8d('0x42')]=_0x37b7ab[_0xef8d('0x5e')]==='booked'?_0xef8d('0x14d'):_0xef8d('0x1ce');for(var _0x527baa=0x0;_0x527baa<_0x1834c8['length'];_0x527baa+=0x1){if(_[_0xef8d('0xb1')](_0x1834c8[_0x527baa])||_[_0xef8d('0xb1')](_0x1834c8[_0x527baa][_0xef8d('0x146')])||_[_0xef8d('0xb1')](_0x1834c8[_0x527baa][_0xef8d('0x146')][_0xef8d('0x145')])){_0x4f2101[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x37b7ab,_0x1834c8[_0x527baa]);}else{_0x4f2101[_0xef8d('0x1d5')](_[_0xef8d('0xd0')](_0x1834c8[_0x527baa],['VoiceQueueId',_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x4f2101[_0xef8d('0x1b7')](_0x37b7ab,_0x1834c8[_0x527baa]))['catch'](_0x4f2101['loggerHandler'](_0xef8d('0x1d0'),_0x37b7ab));}}}})[_0xef8d('0xb5')](loggerGetContactDialer(_0xef8d('0x1d6'),_0x37b7ab,_0x3d0dd4));}};Dialer[_0xef8d('0x1e')]['handlePredictive']=function(_0x109df5){var _0x5c5601=this;if(_0x109df5[_0xef8d('0x1d4')]>0x0){var _0x1410aa=_0x109df5[_0xef8d('0x1d4')]-_0x109df5[_0xef8d('0x79')]-_0x109df5[_0xef8d('0xa6')];if(_0x1410aa>0x0){this[_0xef8d('0x1d7')](_0x109df5);}else{loggerPredictiveCalls['info'](_0xef8d('0x1d8'));}}else{this['tryOriginatePredictive'](_0x109df5);}};Dialer[_0xef8d('0x1e')][_0xef8d('0x1d7')]=function(_0x1315b9){var _0x3bdf7c=this;var _0x2437a3=[];_0x1315b9[_0xef8d('0x79')]+=0x1;for(var _0x5c82cb in this['agents']){if(this[_0xef8d('0x26')][_0xef8d('0x15e')](_0x5c82cb)){if(this[_0xef8d('0x26')][_0x5c82cb][_0xef8d('0xe2')]===_0xef8d('0x1d9')&&this[_0xef8d('0x26')][_0x5c82cb][_0xef8d('0xb3')]===_0xef8d('0xda')){_0x2437a3[_0xef8d('0x10c')](this[_0xef8d('0x26')][_0x5c82cb]['id']);}}}this[_0xef8d('0xc5')](_0x1315b9['id'],_0x2437a3,0x1,_0x1315b9[_0xef8d('0x1cc')])[_0xef8d('0xbc')](function(_0x233666){if(!checkContactEmpty(_0x233666)){checkContactLowerLimitOriginate(_0x1315b9,0x1,0x0);_0x3bdf7c[_0xef8d('0xbd')](_0x1315b9)[_0xef8d('0xbc')](sendMessageReschedule(_0x1315b9))[_0xef8d('0xb5')](loggerCatch(_0xef8d('0xbe')));}else{_0x1315b9[_0xef8d('0x42')]='RUNNING';if(_[_0xef8d('0xb1')](_0x233666[0x0])||_[_0xef8d('0xb1')](_0x233666[0x0][_0xef8d('0x146')])||_[_0xef8d('0xb1')](_0x233666[0x0][_0xef8d('0x146')]['phone'])){_0x3bdf7c[_0xef8d('0x1cf')](_0xef8d('0x1d0'),_0x1315b9,_0x233666[0x0]);}else{_0x3bdf7c[_0xef8d('0x1d5')](_['pick'](_0x233666[0x0],['VoiceQueueId',_0xef8d('0x1d1')]))[_0xef8d('0xbc')](_0x3bdf7c[_0xef8d('0x1b7')](_0x1315b9,_0x233666[0x0]))[_0xef8d('0xb5')](_0x3bdf7c[_0xef8d('0xce')](_0xef8d('0x1da'),_0x1315b9));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x1315b9,0x1));emitVoiceQueueSummary(_0x1315b9);};Dialer[_0xef8d('0x1e')][_0xef8d('0x1db')]=function(_0x59614c,_0x4b745f,_0x19f709,_0x45bdf2,_0x4cff8a,_0x2892b8){loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1dc'));loggerPredictive['info'](_0xef8d('0x1dd'),_0x59614c);loggerPredictive[_0xef8d('0x87')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b745f);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1de'),_0x19f709);loggerPredictive[_0xef8d('0x87')]('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',_0x45bdf2);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',_0x4cff8a);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1df'));return new BPromise(function(_0x4755bd,_0x1fb2e1){if(_0x59614c<=0x0||isNaN(_0x59614c)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),'Error','m\x20=\x20'+_0x59614c));}if(_0x19f709<=0x0||isNaN(_0x19f709)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),_0xef8d('0x4d'),_0xef8d('0x1e1')+_0x19f709));}if(_0x45bdf2<=0x0||isNaN(_0x45bdf2)){return _0x1fb2e1(msgResponse('[abandonmentRate]',_0xef8d('0x4d'),_0xef8d('0x1e2')+_0x45bdf2));}if(_0x4b745f<=0x0||isNaN(_0x4b745f)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),_0xef8d('0x4d'),_0xef8d('0x1e3')+_0x4b745f));}if(_0x4cff8a<=0x0||isNaN(_0x4cff8a)){return _0x1fb2e1(msgResponse(_0xef8d('0x1e0'),'Error',_0xef8d('0x1e4')+_0x4cff8a));}_0x2892b8=_0x2892b8||0x0;var _0xd20f86=0x1/_0x19f709;var _0x231d97=0x0;var _0x43585c=0x0;var _0x21bdb1=0x0;var _0x2a6378=0x0;for(var _0x47879e=0x0;_0x21bdb1<_0x4cff8a;_0x47879e+=0x1){_0x43585c=_0x47879e/_0x4b745f;_0x231d97=(_0x45bdf2*_0x43585c+_0x2892b8)/_0xd20f86;_0x21bdb1=erlangb(_0x231d97,_0x59614c);_0x2a6378=_0x231d97/_0x59614c*(0x1-erlangb(_0x231d97,_0x59614c));}return _0x4755bd({'erlangCalls':_0x47879e,'erlangCallToSecond':_0x4b745f/_0x47879e,'erlangAbandonmentRate':_0x21bdb1,'erlangBusyFactor':_0x2a6378});});};Dialer['prototype'][_0xef8d('0x1ad')]=function(_0xf36faf,_0x32afb0,_0x512ea8,_0x36e6c4,_0x12a236,_0x1f6acd){loggerPredictive['info'](_0xef8d('0x1e5'));loggerPredictive[_0xef8d('0x87')]('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',_0xf36faf);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e6'),_0x32afb0);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1de'),_0x512ea8);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e7'),_0x36e6c4);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1e8'),_0x12a236);loggerPredictive[_0xef8d('0x87')](_0xef8d('0x1df'));return new BPromise(function(_0x302323,_0x2650ad){if(_0xf36faf<=0x0||isNaN(_0xf36faf)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),'m\x20=\x20'+_0xf36faf));}if(_0x512ea8<=0x0||isNaN(_0x512ea8)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),_0xef8d('0x1e1')+_0x512ea8));}if(_0x36e6c4<=0x0||isNaN(_0x36e6c4)){return _0x2650ad(msgResponse('[busyFactor]',_0xef8d('0x4d'),_0xef8d('0x1e2')+_0x36e6c4));}if(_0x32afb0<=0x0||isNaN(_0x32afb0)){return _0x2650ad(msgResponse('[busyFactor]',_0xef8d('0x4d'),'interval\x20=\x20'+_0x32afb0));}if(_0x12a236<=0x0||isNaN(_0x12a236)){return _0x2650ad(msgResponse(_0xef8d('0x1e9'),_0xef8d('0x4d'),'Umin\x20=\x20'+_0x12a236));}_0x1f6acd=_0x1f6acd||0x0;var _0x7c8c77=0x1/_0x512ea8;var _0x7816d7=0x0;var _0x5b0544=0x0;var _0x20e1a5=0x0;var _0x5dab69=0x0;for(var _0x2a84c9=0x0;_0x5dab69<_0x12a236;_0x2a84c9+=0x1){_0x5b0544=_0x2a84c9/_0x32afb0;_0x7816d7=(_0x36e6c4*_0x5b0544+_0x1f6acd)/_0x7c8c77;_0x20e1a5=erlangb(_0x7816d7,_0xf36faf);_0x5dab69=_0x7816d7/_0xf36faf*(0x1-erlangb(_0x7816d7,_0xf36faf));}return _0x302323({'erlangCalls':_0x2a84c9,'erlangCallToSecond':_0x32afb0/_0x2a84c9,'erlangAbandonmentRate':_0x20e1a5,'erlangBusyFactor':_0x5dab69});});};module[_0xef8d('0x1ea')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 67fcb2f..b646b23 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 _0x8827=['campaigntype','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat'];(function(_0x75e338,_0x5dbfe9){var _0x367cb2=function(_0xb116d3){while(--_0xb116d3){_0x75e338['push'](_0x75e338['shift']());}};_0x367cb2(++_0x5dbfe9);}(_0x8827,0x1e4));var _0x7882=function(_0x299402,_0x33278d){_0x299402=_0x299402-0x0;var _0x1bddfc=_0x8827[_0x299402];return _0x1bddfc;};'use strict';var util=require(_0x7882('0x0'));var _=require(_0x7882('0x1'));var moment=require('moment');function getSeconds(_0xaae6e9,_0x27c3d2){var _0x3b8ce6=moment(_0xaae6e9)[_0x7882('0x2')](0x0);var _0x2b474e=moment(_0x27c3d2)[_0x7882('0x2')](0x0);return _0x3b8ce6[_0x7882('0x3')](_0x2b474e,_0x7882('0x4'));}function QueueCallerAbandon(_0xf65a3d,_0x34e5bf){this['scheduledat']=_0xf65a3d[_0x7882('0x5')];this['type']=_0xf65a3d['type'];this[_0x7882('0x6')]=_0xf65a3d['type']==='outbound'?_0x7882('0x7'):_0xf65a3d[_0x7882('0x8')];this['countbusyretry']=_0xf65a3d[_0x7882('0x9')];this['countcongestionretry']=_0xf65a3d[_0x7882('0xa')];this[_0x7882('0xb')]=_0xf65a3d[_0x7882('0xb')];this['countglobal']=_0xf65a3d[_0x7882('0x9')]+_0xf65a3d[_0x7882('0xa')]+_0xf65a3d[_0x7882('0xb')];this['uniqueid']=_0x34e5bf[_0x7882('0xc')];this[_0x7882('0xd')]=_0xf65a3d[_0x7882('0xe')];this[_0x7882('0xf')]=_0xf65a3d[_0x7882('0x10')];this[_0x7882('0x11')]=_0xf65a3d[_0x7882('0x11')];this[_0x7882('0x12')]=_0xf65a3d[_0x7882('0x12')];this[_0x7882('0x13')]=_0xf65a3d[_0x7882('0x13')];this[_0x7882('0x14')]=this[_0x7882('0x13')];this['ringtime']=getSeconds(_0xf65a3d['responsetime'],_0xf65a3d[_0x7882('0x11')]);this['holdtime']=getSeconds(this['droptime'],_0xf65a3d['responsetime']);this['talktime']=0x0;this['queue']=_0x34e5bf[_0x7882('0x7')];this[_0x7882('0x15')]=_0x34e5bf[_0x7882('0x16')];this[_0x7882('0x17')]=_0x34e5bf[_0x7882('0x17')];this['callback']=_0xf65a3d['callback'];this[_0x7882('0x18')]=_0xf65a3d[_0x7882('0x18')];this[_0x7882('0x19')]=_0xf65a3d[_0x7882('0x19')];this[_0x7882('0x1a')]=_0xf65a3d['recallme'];this[_0x7882('0x1b')]=_0xf65a3d[_0x7882('0x1b')];this[_0x7882('0x1c')]=_0xf65a3d[_0x7882('0x1c')];this[_0x7882('0x1d')]=_0xf65a3d['UserId'];this[_0x7882('0x1e')]=_0xf65a3d[_0x7882('0x1e')];this['CampaignId']=_0xf65a3d[_0x7882('0x1f')];this[_0x7882('0x20')]=_0xf65a3d['originatecalleridnum']||'';this[_0x7882('0x21')]=_0xf65a3d[_0x7882('0x21')]||'';}module[_0x7882('0x22')]=QueueCallerAbandon; \ No newline at end of file +var _0x9fca=['droptime','ringtime','starttime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','responsetime'];(function(_0x5ff0c5,_0x23b78d){var _0x260424=function(_0x5c6077){while(--_0x5c6077){_0x5ff0c5['push'](_0x5ff0c5['shift']());}};_0x260424(++_0x23b78d);}(_0x9fca,0x1d0));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x233282,_0x338910){var _0x18ec71=moment(_0x233282)[_0xa9fc('0x0')](0x0);var _0x52890d=moment(_0x338910)[_0xa9fc('0x0')](0x0);return _0x18ec71[_0xa9fc('0x1')](_0x52890d,_0xa9fc('0x2'));}function QueueCallerAbandon(_0x3e2133,_0x57ec74){this[_0xa9fc('0x3')]=_0x3e2133['scheduledat'];this['type']=_0x3e2133['type'];this[_0xa9fc('0x4')]=_0x3e2133[_0xa9fc('0x5')]===_0xa9fc('0x6')?_0xa9fc('0x7'):_0x3e2133['type'];this[_0xa9fc('0x8')]=_0x3e2133['countbusyretry'];this[_0xa9fc('0x9')]=_0x3e2133['countcongestionretry'];this['countnoanswerretry']=_0x3e2133[_0xa9fc('0xa')];this['countglobal']=_0x3e2133[_0xa9fc('0x8')]+_0x3e2133[_0xa9fc('0x9')]+_0x3e2133[_0xa9fc('0xa')];this[_0xa9fc('0xb')]=_0x57ec74[_0xa9fc('0xb')];this[_0xa9fc('0xc')]=_0x3e2133[_0xa9fc('0xd')];this[_0xa9fc('0xe')]=_0x3e2133[_0xa9fc('0xf')];this['starttime']=_0x3e2133['starttime'];this[_0xa9fc('0x10')]=_0x3e2133['responsetime'];this[_0xa9fc('0x11')]=_0x3e2133[_0xa9fc('0x11')];this['endtime']=this[_0xa9fc('0x11')];this[_0xa9fc('0x12')]=getSeconds(_0x3e2133[_0xa9fc('0x10')],_0x3e2133[_0xa9fc('0x13')]);this[_0xa9fc('0x14')]=getSeconds(this['droptime'],_0x3e2133[_0xa9fc('0x10')]);this[_0xa9fc('0x15')]=0x0;this['queue']=_0x57ec74[_0xa9fc('0x7')];this[_0xa9fc('0x16')]=_0x57ec74[_0xa9fc('0x17')];this[_0xa9fc('0x18')]=_0x57ec74[_0xa9fc('0x18')];this[_0xa9fc('0x19')]=_0x3e2133['callback'];this['callbackuniqueid']=_0x3e2133[_0xa9fc('0x1a')];this['callbackat']=_0x3e2133[_0xa9fc('0x1b')];this['recallme']=_0x3e2133[_0xa9fc('0x1c')];this['ContactId']=_0x3e2133[_0xa9fc('0x1d')];this[_0xa9fc('0x1e')]=_0x3e2133['ListId'];this['UserId']=_0x3e2133[_0xa9fc('0x1f')];this[_0xa9fc('0x20')]=_0x3e2133['VoiceQueueId'];this[_0xa9fc('0x21')]=_0x3e2133['CampaignId'];this[_0xa9fc('0x22')]=_0x3e2133[_0xa9fc('0x22')]||'';this[_0xa9fc('0x23')]=_0x3e2133[_0xa9fc('0x23')]||'';}module[_0xa9fc('0x24')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d4eb27a..f7c180e 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 _0xf648=['name','localstationid','headerinfo','path','exports','util','lodash','uniqueid','channel','format','tech'];(function(_0x5de29b,_0x13e9ad){var _0x5f5156=function(_0x1b95ee){while(--_0x1b95ee){_0x5de29b['push'](_0x5de29b['shift']());}};_0x5f5156(++_0x13e9ad);}(_0xf648,0x1d3));var _0x8f64=function(_0x27da75,_0x26202b){_0x27da75=_0x27da75-0x0;var _0x44cf68=_0xf648[_0x27da75];return _0x44cf68;};'use strict';var util=require(_0x8f64('0x0'));var _=require(_0x8f64('0x1'));var moment=require('moment');function Action(_0x55829a,_0x3770a2,_0x350007){this[_0x8f64('0x2')]=_0x55829a||undefined;this[_0x8f64('0x3')]=util[_0x8f64('0x4')]('%s/%s/%s',_0x3770a2[_0x8f64('0x5')],_0x3770a2['Trunk'][_0x8f64('0x6')],_0x350007['fax']);this['localstationid']=_0x3770a2[_0x8f64('0x7')];this[_0x8f64('0x8')]=_0x3770a2[_0x8f64('0x8')];this[_0x8f64('0x9')]=_0x350007[_0x8f64('0x9')];this['AttachmentId']=_0x350007['AttachmentId'];}module[_0x8f64('0xa')]=Action; \ No newline at end of file +var _0x3aa7=['AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','name','fax','localstationid','headerinfo','path'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x3aa7,0x13d));var _0x73aa=function(_0x2f8c78,_0x21e252){_0x2f8c78=_0x2f8c78-0x0;var _0x48b64b=_0x3aa7[_0x2f8c78];return _0x48b64b;};'use strict';var util=require(_0x73aa('0x0'));var _=require(_0x73aa('0x1'));var moment=require(_0x73aa('0x2'));function Action(_0x5ba1aa,_0x178904,_0x344bb0){this[_0x73aa('0x3')]=_0x5ba1aa||undefined;this[_0x73aa('0x4')]=util[_0x73aa('0x5')](_0x73aa('0x6'),_0x178904[_0x73aa('0x7')],_0x178904['Trunk'][_0x73aa('0x8')],_0x344bb0[_0x73aa('0x9')]);this[_0x73aa('0xa')]=_0x178904[_0x73aa('0xa')];this['headerinfo']=_0x178904[_0x73aa('0xb')];this[_0x73aa('0xc')]=_0x344bb0[_0x73aa('0xc')];this[_0x73aa('0xd')]=_0x344bb0['AttachmentId'];}module[_0x73aa('0xe')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index ff58f8e..89bb025 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 _0x06ea=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','hangup','originateresponse','prototype','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./channel'];(function(_0x356abb,_0x4bf1d9){var _0x4c37b7=function(_0x695003){while(--_0x695003){_0x356abb['push'](_0x356abb['shift']());}};_0x4c37b7(++_0x4bf1d9);}(_0x06ea,0x6c));var _0xa06e=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x06ea[_0x304320];return _0xe607da;};'use strict';var util=require(_0xa06e('0x0'));var _=require(_0xa06e('0x1'));var BPromise=require(_0xa06e('0x2'));var uuid=require(_0xa06e('0x3'));var moment=require(_0xa06e('0x4'));var path=require(_0xa06e('0x5'));var tiff2pdf=require(_0xa06e('0x6'));var gs=require('./util/gs');var logger=require(_0xa06e('0x7'))(_0xa06e('0x8'));var ami=require(_0xa06e('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xa06e('0xa'));var ut=require(_0xa06e('0xb'));var Action=require(_0xa06e('0xc'));var faxAccount=require(_0xa06e('0xd'));var attachment=require(_0xa06e('0xe'));var faxMessage=require(_0xa06e('0xf'));function Fax(_0x49038c){this['channels']={};this[_0xa06e('0x10')]=_0x49038c[_0xa06e('0x10')];this[_0xa06e('0x11')]=_0x49038c[_0xa06e('0x11')];this[_0xa06e('0x12')]={};ami['on'](_0xa06e('0x13'),this[_0xa06e('0x14')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x16'),this[_0xa06e('0x17')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x18'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0xa06e('0x19')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1a'),this['syncFaxStatus'][_0xa06e('0x15')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1b'),this['syncHangup'][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1c'),this['syncOriginateResponse'][_0xa06e('0x15')](this));}Fax[_0xa06e('0x1d')][_0xa06e('0x14')]=function(_0x5602f3){if(_0x5602f3[_0xa06e('0x1e')]===_0xa06e('0x1f')){for(var _0x390a96 in this[_0xa06e('0x10')]){if(this['faxAccounts']['hasOwnProperty'](_0x390a96)){if(_0x5602f3[_0xa06e('0x20')]===this['faxAccounts'][_0x390a96][_0xa06e('0x21')]){this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]]={};this[_0xa06e('0x22')][_0x5602f3['uniqueid']]['channel']=_0x5602f3[_0xa06e('0x24')];this[_0xa06e('0x22')][_0x5602f3['uniqueid']]['id']=this[_0xa06e('0x10')][_0x390a96]['id'];this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]][_0xa06e('0x25')]=this[_0xa06e('0x10')][_0x390a96]['name'];logger['info'](_0x5602f3[_0xa06e('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0xa06e('0x12')][_0x5602f3[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]]={};this['channels'][_0x5602f3['uniqueid']][_0xa06e('0x24')]=_0x5602f3[_0xa06e('0x24')];logger[_0xa06e('0x26')](_0x5602f3[_0xa06e('0x23')],_0xa06e('0x27'));}};Fax['prototype']['syncVarSet']=function(_0x1c1ea8){if(this['channels'][_0x1c1ea8[_0xa06e('0x23')]]){for(var _0x4560f3 in _0x1c1ea8['variable']){if(_0x1c1ea8[_0xa06e('0x28')]['hasOwnProperty'](_0x4560f3)){this[_0xa06e('0x22')][_0x1c1ea8[_0xa06e('0x23')]][_0x4560f3]=_0x1c1ea8[_0xa06e('0x29')];}}}};Fax['prototype'][_0xa06e('0x2a')]=function(_0x10fbc9){if(this['channels'][_0x10fbc9[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x10fbc9['uniqueid']][_0xa06e('0x2b')]=_0x10fbc9['channelstate'];this['channels'][_0x10fbc9[_0xa06e('0x23')]][_0xa06e('0x2c')]=_0x10fbc9['channelstatedesc'];}};Fax[_0xa06e('0x1d')][_0xa06e('0x19')]=function(_0x4c9137){if(this[_0xa06e('0x22')][_0x4c9137[_0xa06e('0x23')]]){for(var _0x5bee8d in _0x4c9137[_0xa06e('0x28')]){if(_0x4c9137[_0xa06e('0x28')][_0xa06e('0x2d')](_0x5bee8d)){this[_0xa06e('0x22')][_0x4c9137['uniqueid']][_0x5bee8d]=_0x4c9137[_0xa06e('0x29')];}}}};Fax['prototype'][_0xa06e('0x2e')]=function(_0x42aea3){if(this['channels'][_0x42aea3[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x42aea3[_0xa06e('0x23')]][_0xa06e('0x2f')]=_0x42aea3[_0xa06e('0x2f')];this['channels'][_0x42aea3['uniqueid']][_0xa06e('0x30')]=_0x42aea3['status'];this['channels'][_0x42aea3[_0xa06e('0x23')]]['localstationid']=_0x42aea3[_0xa06e('0x21')];this['channels'][_0x42aea3[_0xa06e('0x23')]][_0xa06e('0x31')]=_0x42aea3[_0xa06e('0x31')];logger[_0xa06e('0x26')](_0x42aea3[_0xa06e('0x23')],_0xa06e('0x32'));}};Fax[_0xa06e('0x1d')]['syncReceiveFax']=function(_0x433818){var _0x136f51=this;if(this['channels'][_0x433818[_0xa06e('0x23')]]){var _0x525480=this[_0xa06e('0x22')][_0x433818['uniqueid']]['id'];this[_0xa06e('0x22')][_0x433818['uniqueid']][_0xa06e('0x33')]=_0x433818[_0xa06e('0x33')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x34')]=_0x433818[_0xa06e('0x34')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x21')]=_0x433818[_0xa06e('0x21')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x35')]=_0x433818['resolution'];this['channels'][_0x433818['uniqueid']][_0xa06e('0x36')]=_0x433818[_0xa06e('0x36')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x31')]=_0x433818[_0xa06e('0x31')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x37')]=_0x433818[_0xa06e('0x37')];if(this['channels'][_0x433818[_0xa06e('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x433818[_0xa06e('0x31')],_0xa06e('0x38'),function(_0x2c8702){logger[_0xa06e('0x26')](_0x433818[_0xa06e('0x23')],_0xa06e('0x39'),_0x2c8702[_0xa06e('0x3a')]);attachment[_0xa06e('0x3b')]({'name':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')],'basename':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')]+_0xa06e('0x3d'),'type':'application/pdf'})[_0xa06e('0x3e')](function(_0x479832){faxAccount['notify'](_0x525480,{'from':_0x433818[_0xa06e('0x37')],'mapKey':_0xa06e('0x8'),'body':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')]+_0xa06e('0x3d'),'AttachmentId':_0x479832['id']})[_0xa06e('0x3f')](function(_0x280c41){logger[_0xa06e('0x40')](_0x433818[_0xa06e('0x23')],_0xa06e('0x41'),JSON[_0xa06e('0x42')](_0x280c41));});})[_0xa06e('0x3f')](function(_0x595c92){logger[_0xa06e('0x40')](_0x433818[_0xa06e('0x23')],_0xa06e('0x43'),JSON[_0xa06e('0x42')](_0x595c92));});});}logger['info'](_0x433818[_0xa06e('0x23')],_0xa06e('0x43'));}};Fax[_0xa06e('0x1d')]['syncOriginateResponse']=function(_0x21304d){if(this[_0xa06e('0x12')][_0x21304d['uniqueid']]){_[_0xa06e('0x44')](this[_0xa06e('0x22')][_0x21304d[_0xa06e('0x23')]],_[_0xa06e('0x45')](_0x21304d,[_0xa06e('0x46'),_0xa06e('0x47')]));}};function updateStatus(_0x111837){if(_0x111837['AttachmentId']){faxMessage['update'](_0x111837[_0xa06e('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xa06e('0x3e')](function(_0x5d033f){ut['logger'](_0xa06e('0x49'),_0x5d033f);})[_0xa06e('0x3f')](function(_0x830593){ut[_0xa06e('0x4a')](_0xa06e('0x4b'),_0x830593);});}else{ut[_0xa06e('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa06e('0x1d')][_0xa06e('0x4c')]=function(_0x3a153f,_0x1c4b0b,_0x4510a7){var _0x483c1a=this;var _0x594f3e={};if(_0x1c4b0b){_0x594f3e={'read':_0x1c4b0b};}else{_0x594f3e={'failMessage':_0x4510a7};}if(this[_0xa06e('0x12')][_0x3a153f][_0xa06e('0x48')]){faxMessage[_0xa06e('0x4d')](this[_0xa06e('0x12')][_0x3a153f]['AttachmentId'],_0x594f3e)['then'](function(_0x282b67){ut['logger'](_0xa06e('0x4e'),_0x282b67);})[_0xa06e('0x3f')](function(_0xa974aa){ut[_0xa06e('0x4a')](_0xa06e('0x4f'),_0xa974aa);})[_0xa06e('0x50')](function(){delete _0x483c1a[_0xa06e('0x22')][_0x3a153f];delete _0x483c1a[_0xa06e('0x12')][_0x3a153f];});}else{ut[_0xa06e('0x4a')](_0xa06e('0x51'));delete this['channels'][_0x3a153f];delete this[_0xa06e('0x12')][_0x3a153f];}};Fax['prototype'][_0xa06e('0x52')]=function(_0x3ea519){var _0x45b0c7=this;if(this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]]){if(this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]){this['channels'][_0x3ea519[_0xa06e('0x23')]]['id']=this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]['id'];this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x25')]=this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x25')];}logger[_0xa06e('0x26')](_0x3ea519[_0xa06e('0x23')],this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]?_0xa06e('0x53'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x3ea519[_0xa06e('0x23')]]));if(this['actions'][_0x3ea519[_0xa06e('0x23')]]){if(this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x54')]>0x0&&this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]]['faxstatus']===_0xa06e('0x55')){this[_0xa06e('0x4c')](_0x3ea519[_0xa06e('0x23')],!![]);}else{this[_0xa06e('0x4c')](_0x3ea519[_0xa06e('0x23')],![],this[_0xa06e('0x22')][_0x3ea519['uniqueid']]['faxstatusstring']?_0xa06e('0x56')+this[_0xa06e('0x22')][_0x3ea519['uniqueid']][_0xa06e('0x57')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xa06e('0x58')]=function(_0x410a39){var _0x128b4e=this;return new BPromise(function(_0x33c68b,_0x2fbe65){_0x128b4e['execOriginate'](_0x410a39,_0x128b4e['faxAccounts'][_0x410a39[_0xa06e('0x59')]])[_0xa06e('0x3e')](function(_0x1cf62d){ut[_0xa06e('0x4a')](_0xa06e('0x5a'),_0x1cf62d);_0x33c68b(ut['message'](_0xa06e('0x5b')));})[_0xa06e('0x3f')](function(_0x373842){ut[_0xa06e('0x4a')](_0xa06e('0x5c'),_0x373842);updateStatus(_0x410a39);_0x2fbe65(ut[_0xa06e('0x3a')]('Fax\x20failed'));});});};Fax[_0xa06e('0x1d')][_0xa06e('0x5d')]=function(_0x1852b9){var _0x3f400b=this;return new BPromise(function(_0xde19aa,_0xc962a1){var _0x214dfd=_0x3f400b[_0xa06e('0x5e')](_0x3f400b[_0xa06e('0x10')][_0x1852b9[_0xa06e('0x59')]]['Trunk'],_0x1852b9);if(_0x214dfd[_0xa06e('0x5f')]){_0xde19aa(ut[_0xa06e('0x3a')](_0xa06e('0x60')));}else{_0xc962a1(ut[_0xa06e('0x3a')](_0x214dfd['message']));}});};function originate(_0x2b689b,_0x34e561,_0x5f2df9){return new BPromise(function(_0x4cee44,_0x11cd9e){if(_0x5f2df9){var _0x59dead=util['format'](_0xa06e('0x61'),path[_0xa06e('0x3c')](_0x2b689b[_0xa06e('0x5')])[_0xa06e('0x25')],_0x2b689b[_0xa06e('0x5')]);gs[_0xa06e('0x62')](_0x59dead)[_0xa06e('0x3e')](function(){_0x2b689b[_0xa06e('0x5')]=util[_0xa06e('0x63')](_0xa06e('0x64'),path['parse'](_0x2b689b[_0xa06e('0x5')])[_0xa06e('0x65')],path[_0xa06e('0x3c')](_0x2b689b[_0xa06e('0x5')])['name']);_0x34e561[_0xa06e('0x66')]=_0x2b689b[_0xa06e('0x5')];ut[_0xa06e('0x4a')](_0xa06e('0x67'),'');ami['Action'](ut[_0xa06e('0x68')](_0x2b689b,_0x34e561))[_0xa06e('0x3e')](function(_0x176667){_0x4cee44(_0x176667);})[_0xa06e('0x3f')](function(_0x3b78f6){_0x11cd9e(_0x3b78f6);});})['catch'](function(_0x5600a0){_0x11cd9e(_0x5600a0);});}else{ami[_0xa06e('0x69')](ut['variablesAction'](_0x2b689b,_0x34e561))[_0xa06e('0x3e')](function(_0x44f1e7){_0x4cee44(_0x44f1e7);})[_0xa06e('0x3f')](function(_0x20feab){_0x11cd9e(_0x20feab);});}});}Fax[_0xa06e('0x1d')][_0xa06e('0x6a')]=function(_0x417d81,_0xab0e0d){var _0xc46be=this;return new BPromise(function(_0x5577b5,_0x291ce7){var _0x12efb0=uuid['v4']();var _0x5bdbe4=ut['addVariables'](_0x417d81,_0xab0e0d);_0xc46be[_0xa06e('0x12')][_0x12efb0]=new Action(_0x12efb0,_0xab0e0d,_0x417d81);var _0x38b4b2=_0xc46be[_0xa06e('0x12')][_0x12efb0];if(path[_0xa06e('0x3c')](_0x417d81[_0xa06e('0x5')])[_0xa06e('0x6b')]===_0xa06e('0x3d')){originate(_0x38b4b2,_0x5bdbe4,!![])[_0xa06e('0x3e')](function(_0x525eb0){_0x5577b5(_0x525eb0);})[_0xa06e('0x3f')](function(_0x2644aa){_0x291ce7(_0x2644aa);});}else{originate(_0x38b4b2,_0x5bdbe4,![])[_0xa06e('0x3e')](function(_0x1cd709){_0x5577b5(_0x1cd709);})[_0xa06e('0x3f')](function(_0x28ec7a){_0x291ce7(_0x28ec7a);});}});};Fax[_0xa06e('0x1d')][_0xa06e('0x6c')]=function(_0x3a383f){return!_[_0xa06e('0x6d')](_0x3a383f)&&!_[_0xa06e('0x6d')](_0x3a383f['name'])&&!_['isNil'](_0x3a383f[_0xa06e('0x6e')])&&_0x3a383f[_0xa06e('0x6e')]&&!_[_0xa06e('0x6d')](this[_0xa06e('0x11')][util[_0xa06e('0x63')]('SIP/%s',_0x3a383f[_0xa06e('0x25')])])&&!_[_0xa06e('0x6d')](this['trunks'][util[_0xa06e('0x63')]('SIP/%s',_0x3a383f[_0xa06e('0x25')])]['status'])&&(this[_0xa06e('0x11')][util[_0xa06e('0x63')](_0xa06e('0x6f'),_0x3a383f[_0xa06e('0x25')])][_0xa06e('0x30')]===_0xa06e('0x70')||this[_0xa06e('0x11')][util[_0xa06e('0x63')](_0xa06e('0x6f'),_0x3a383f[_0xa06e('0x25')])][_0xa06e('0x30')]===_0xa06e('0x71'));};Fax[_0xa06e('0x1d')][_0xa06e('0x5e')]=function(_0x2f421c,_0xa12002){if(!this['isTrunkReachable'](_0x2f421c)){ut[_0xa06e('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xa06e('0x6d')](_0x2f421c)?'':_0x2f421c[_0xa06e('0x25')]+_0xa06e('0x72'));return{'isValid':![],'message':_0xa06e('0x73')};}if(_[_0xa06e('0x6d')](_0xa12002[_0xa06e('0x8')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xa06e('0x42')](_0xa12002));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xa06e('0x6d')](_0xa12002[_0xa06e('0x5')])){ut[_0xa06e('0x4a')](_0xa06e('0x74'),JSON[_0xa06e('0x42')](_0xa12002));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xa06e('0x75')};};module[_0xa06e('0x76')]=Fax; \ No newline at end of file +var _0x2fd5=['\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','then','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','AttachmentId','update','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','logger','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Action','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]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncOriginateResponse','prototype','from-voip-provider','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/'];(function(_0x4da39e,_0x47e3ed){var _0x2a8580=function(_0x555ce7){while(--_0x555ce7){_0x4da39e['push'](_0x4da39e['shift']());}};_0x2a8580(++_0x47e3ed);}(_0x2fd5,0xa9));var _0x52fd=function(_0x530682,_0x378309){_0x530682=_0x530682-0x0;var _0x445a23=_0x2fd5[_0x530682];return _0x445a23;};'use strict';var util=require(_0x52fd('0x0'));var _=require(_0x52fd('0x1'));var BPromise=require(_0x52fd('0x2'));var uuid=require(_0x52fd('0x3'));var moment=require(_0x52fd('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require(_0x52fd('0x5'));var logger=require(_0x52fd('0x6'))(_0x52fd('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x52fd('0x8'));var ut=require(_0x52fd('0x9'));var Action=require(_0x52fd('0xa'));var faxAccount=require(_0x52fd('0xb'));var attachment=require(_0x52fd('0xc'));var faxMessage=require(_0x52fd('0xd'));function Fax(_0x2428ac){this[_0x52fd('0xe')]={};this[_0x52fd('0xf')]=_0x2428ac[_0x52fd('0xf')];this[_0x52fd('0x10')]=_0x2428ac['trunks'];this[_0x52fd('0x11')]={};ami['on'](_0x52fd('0x12'),this[_0x52fd('0x13')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x15'),this[_0x52fd('0x16')][_0x52fd('0x14')](this));ami['on']('newstate',this[_0x52fd('0x17')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x18'),this[_0x52fd('0x19')][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1a'),this['syncFaxStatus'][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1b'),this['syncReceiveFax'][_0x52fd('0x14')](this));ami['on'](_0x52fd('0x1c'),this['syncHangup'][_0x52fd('0x14')](this));ami['on']('originateresponse',this[_0x52fd('0x1d')][_0x52fd('0x14')](this));}Fax[_0x52fd('0x1e')][_0x52fd('0x13')]=function(_0x50a946){if(_0x50a946['context']===_0x52fd('0x1f')){for(var _0x4bd90d in this['faxAccounts']){if(this[_0x52fd('0xf')]['hasOwnProperty'](_0x4bd90d)){if(_0x50a946['exten']===this[_0x52fd('0xf')][_0x4bd90d][_0x52fd('0x20')]){this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]={};this['channels'][_0x50a946[_0x52fd('0x21')]][_0x52fd('0x22')]=_0x50a946[_0x52fd('0x22')];this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]['id']=this['faxAccounts'][_0x4bd90d]['id'];this['channels'][_0x50a946['uniqueid']]['name']=this[_0x52fd('0xf')][_0x4bd90d]['name'];logger[_0x52fd('0x23')](_0x50a946[_0x52fd('0x21')],_0x52fd('0x24'));}}}}if(this[_0x52fd('0x11')][_0x50a946[_0x52fd('0x21')]]){this[_0x52fd('0xe')][_0x50a946[_0x52fd('0x21')]]={};this[_0x52fd('0xe')][_0x50a946['uniqueid']][_0x52fd('0x22')]=_0x50a946[_0x52fd('0x22')];logger[_0x52fd('0x23')](_0x50a946[_0x52fd('0x21')],'\x20syncNewchannel\x20');}};Fax[_0x52fd('0x1e')]['syncVarSet']=function(_0xf9a6f7){if(this[_0x52fd('0xe')][_0xf9a6f7[_0x52fd('0x21')]]){for(var _0x39b71a in _0xf9a6f7[_0x52fd('0x25')]){if(_0xf9a6f7[_0x52fd('0x25')]['hasOwnProperty'](_0x39b71a)){this[_0x52fd('0xe')][_0xf9a6f7['uniqueid']][_0x39b71a]=_0xf9a6f7[_0x52fd('0x26')];}}}};Fax[_0x52fd('0x1e')][_0x52fd('0x17')]=function(_0x11043f){if(this[_0x52fd('0xe')][_0x11043f['uniqueid']]){this[_0x52fd('0xe')][_0x11043f[_0x52fd('0x21')]][_0x52fd('0x27')]=_0x11043f[_0x52fd('0x27')];this[_0x52fd('0xe')][_0x11043f['uniqueid']][_0x52fd('0x28')]=_0x11043f[_0x52fd('0x28')];}};Fax[_0x52fd('0x1e')][_0x52fd('0x19')]=function(_0x285657){if(this['channels'][_0x285657[_0x52fd('0x21')]]){for(var _0x447b63 in _0x285657[_0x52fd('0x25')]){if(_0x285657[_0x52fd('0x25')][_0x52fd('0x29')](_0x447b63)){this[_0x52fd('0xe')][_0x285657[_0x52fd('0x21')]][_0x447b63]=_0x285657[_0x52fd('0x26')];}}}};Fax[_0x52fd('0x1e')][_0x52fd('0x2a')]=function(_0x34dffa){if(this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]]){this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2b')]=_0x34dffa[_0x52fd('0x2b')];this[_0x52fd('0xe')][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2c')]=_0x34dffa[_0x52fd('0x2c')];this['channels'][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x20')]=_0x34dffa['localstationid'];this['channels'][_0x34dffa[_0x52fd('0x21')]][_0x52fd('0x2d')]=_0x34dffa[_0x52fd('0x2d')];logger[_0x52fd('0x23')](_0x34dffa[_0x52fd('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x52fd('0x1e')][_0x52fd('0x2e')]=function(_0x12de12){var _0x729122=this;if(this['channels'][_0x12de12[_0x52fd('0x21')]]){var _0x53ac48=this['channels'][_0x12de12[_0x52fd('0x21')]]['id'];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x2f')]=_0x12de12['remotestationid'];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x30')]=_0x12de12[_0x52fd('0x30')];this[_0x52fd('0xe')][_0x12de12['uniqueid']][_0x52fd('0x20')]=_0x12de12[_0x52fd('0x20')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x31')]=_0x12de12[_0x52fd('0x31')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x32')]=_0x12de12[_0x52fd('0x32')];this[_0x52fd('0xe')][_0x12de12['uniqueid']][_0x52fd('0x2d')]=_0x12de12[_0x52fd('0x2d')];this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x33')]=_0x12de12[_0x52fd('0x33')];if(this[_0x52fd('0xe')][_0x12de12[_0x52fd('0x21')]][_0x52fd('0x30')]>0x0){tiff2pdf(_0x12de12[_0x52fd('0x2d')],_0x52fd('0x34'),function(_0x3991be){logger['info'](_0x12de12[_0x52fd('0x21')],_0x52fd('0x35'),_0x3991be[_0x52fd('0x36')]);attachment[_0x52fd('0x37')]({'name':path[_0x52fd('0x38')](_0x12de12['filename'])[_0x52fd('0x39')],'basename':path[_0x52fd('0x38')](_0x12de12[_0x52fd('0x2d')])[_0x52fd('0x39')]+_0x52fd('0x3a'),'type':'application/pdf'})[_0x52fd('0x3b')](function(_0x479a53){faxAccount['notify'](_0x53ac48,{'from':_0x12de12[_0x52fd('0x33')],'mapKey':'fax','body':path[_0x52fd('0x38')](_0x12de12[_0x52fd('0x2d')])[_0x52fd('0x39')]+_0x52fd('0x3a'),'AttachmentId':_0x479a53['id']})[_0x52fd('0x3c')](function(_0x45439e){logger['error'](_0x12de12['uniqueid'],_0x52fd('0x3d'),JSON[_0x52fd('0x3e')](_0x45439e));});})['catch'](function(_0x422994){logger[_0x52fd('0x3f')](_0x12de12[_0x52fd('0x21')],'\x20receiveFax\x20',JSON[_0x52fd('0x3e')](_0x422994));});});}logger[_0x52fd('0x23')](_0x12de12['uniqueid'],_0x52fd('0x40'));}};Fax[_0x52fd('0x1e')][_0x52fd('0x1d')]=function(_0x51c0ee){if(this[_0x52fd('0x11')][_0x51c0ee[_0x52fd('0x21')]]){_[_0x52fd('0x41')](this[_0x52fd('0xe')][_0x51c0ee[_0x52fd('0x21')]],_['pick'](_0x51c0ee,[_0x52fd('0x42'),'reason']));}};function updateStatus(_0x29474b){if(_0x29474b[_0x52fd('0x43')]){faxMessage[_0x52fd('0x44')](_0x29474b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x52fd('0x3b')](function(_0x4c1082){ut['logger']('[Fax][Message][Error][Updated]',_0x4c1082);})[_0x52fd('0x3c')](function(_0xe60dd5){ut['logger'](_0x52fd('0x45'),_0xe60dd5);});}else{ut['logger'](_0x52fd('0x46'));}}Fax['prototype'][_0x52fd('0x47')]=function(_0x22e7c5,_0x150721,_0x4b2d81){var _0x3e90c2=this;var _0x97d393={};if(_0x150721){_0x97d393={'read':_0x150721};}else{_0x97d393={'failMessage':_0x4b2d81};}if(this[_0x52fd('0x11')][_0x22e7c5]['AttachmentId']){faxMessage[_0x52fd('0x44')](this[_0x52fd('0x11')][_0x22e7c5][_0x52fd('0x43')],_0x97d393)['then'](function(_0x281cfa){ut[_0x52fd('0x48')]('[Fax][Message][Updated]',_0x281cfa);})[_0x52fd('0x3c')](function(_0x945d3c){ut[_0x52fd('0x48')](_0x52fd('0x49'),_0x945d3c);})[_0x52fd('0x4a')](function(){delete _0x3e90c2[_0x52fd('0xe')][_0x22e7c5];delete _0x3e90c2[_0x52fd('0x11')][_0x22e7c5];});}else{ut[_0x52fd('0x48')](_0x52fd('0x4b'));delete this[_0x52fd('0xe')][_0x22e7c5];delete this[_0x52fd('0x11')][_0x22e7c5];}};Fax['prototype'][_0x52fd('0x4c')]=function(_0x357337){var _0x388ca4=this;if(this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]){if(this['actions'][_0x357337[_0x52fd('0x21')]]){this['channels'][_0x357337[_0x52fd('0x21')]]['id']=this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]]['id'];this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]['name']=this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]][_0x52fd('0x39')];}logger[_0x52fd('0x23')](_0x357337[_0x52fd('0x21')],this[_0x52fd('0x11')][_0x357337['uniqueid']]?_0x52fd('0x4d'):_0x52fd('0x4e'),JSON[_0x52fd('0x3e')](this['channels'][_0x357337[_0x52fd('0x21')]]));if(this[_0x52fd('0x11')][_0x357337[_0x52fd('0x21')]]){if(this[_0x52fd('0xe')][_0x357337['uniqueid']][_0x52fd('0x4f')]>0x0&&this[_0x52fd('0xe')][_0x357337['uniqueid']][_0x52fd('0x1a')]==='SUCCESS'){this[_0x52fd('0x47')](_0x357337[_0x52fd('0x21')],!![]);}else{this[_0x52fd('0x47')](_0x357337[_0x52fd('0x21')],![],this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x52fd('0xe')][_0x357337[_0x52fd('0x21')]][_0x52fd('0x50')]:_0x52fd('0x51'));}}}};Fax[_0x52fd('0x1e')]['send']=function(_0x4384ae){var _0xa7d005=this;return new BPromise(function(_0x3e397e,_0x15d481){_0xa7d005[_0x52fd('0x52')](_0x4384ae,_0xa7d005[_0x52fd('0xf')][_0x4384ae[_0x52fd('0x53')]])[_0x52fd('0x3b')](function(_0x555c3e){ut[_0x52fd('0x48')]('[Fax][execOriginate][success]',_0x555c3e);_0x3e397e(ut[_0x52fd('0x36')](_0x52fd('0x54')));})[_0x52fd('0x3c')](function(_0x50c3cc){ut[_0x52fd('0x48')]('[Fax][execOriginate][failure]',_0x50c3cc);updateStatus(_0x4384ae);_0x15d481(ut[_0x52fd('0x36')](_0x52fd('0x55')));});});};Fax[_0x52fd('0x1e')][_0x52fd('0x56')]=function(_0x654821){var _0x5294af=this;return new BPromise(function(_0x23aaa8,_0x54ea51){var _0x1eb4fb=_0x5294af[_0x52fd('0x57')](_0x5294af[_0x52fd('0xf')][_0x654821['FaxAccountId']]['Trunk'],_0x654821);if(_0x1eb4fb[_0x52fd('0x58')]){_0x23aaa8(ut[_0x52fd('0x36')]('Trunk\x20Reachable'));}else{_0x54ea51(ut[_0x52fd('0x36')](_0x1eb4fb[_0x52fd('0x36')]));}});};function originate(_0xd45230,_0x918a51,_0x25228d){return new BPromise(function(_0x5a7493,_0x5ca600){if(_0x25228d){var _0x5910d0=util[_0x52fd('0x59')](_0x52fd('0x5a'),path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x39')],_0xd45230['path']);gs[_0x52fd('0x5c')](_0x5910d0)[_0x52fd('0x3b')](function(){_0xd45230['path']=util[_0x52fd('0x59')](_0x52fd('0x5d'),path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x5e')],path[_0x52fd('0x38')](_0xd45230[_0x52fd('0x5b')])[_0x52fd('0x39')]);_0x918a51[_0x52fd('0x5f')]=_0xd45230[_0x52fd('0x5b')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x52fd('0x60')](ut['variablesAction'](_0xd45230,_0x918a51))[_0x52fd('0x3b')](function(_0x63e61a){_0x5a7493(_0x63e61a);})['catch'](function(_0x2ee346){_0x5ca600(_0x2ee346);});})[_0x52fd('0x3c')](function(_0x1d690a){_0x5ca600(_0x1d690a);});}else{ami[_0x52fd('0x60')](ut['variablesAction'](_0xd45230,_0x918a51))[_0x52fd('0x3b')](function(_0x4d6ff3){_0x5a7493(_0x4d6ff3);})[_0x52fd('0x3c')](function(_0x337378){_0x5ca600(_0x337378);});}});}Fax[_0x52fd('0x1e')]['execOriginate']=function(_0x1ed7c1,_0x3b2110){var _0x5d1505=this;return new BPromise(function(_0x2dce02,_0x7ee309){var _0x458d9b=uuid['v4']();var _0x11d180=ut['addVariables'](_0x1ed7c1,_0x3b2110);_0x5d1505['actions'][_0x458d9b]=new Action(_0x458d9b,_0x3b2110,_0x1ed7c1);var _0x9472eb=_0x5d1505['actions'][_0x458d9b];if(path[_0x52fd('0x38')](_0x1ed7c1['path'])['ext']===_0x52fd('0x3a')){originate(_0x9472eb,_0x11d180,!![])[_0x52fd('0x3b')](function(_0x16f6b5){_0x2dce02(_0x16f6b5);})['catch'](function(_0x4be586){_0x7ee309(_0x4be586);});}else{originate(_0x9472eb,_0x11d180,![])[_0x52fd('0x3b')](function(_0x5d6775){_0x2dce02(_0x5d6775);})['catch'](function(_0x24d6a7){_0x7ee309(_0x24d6a7);});}});};Fax[_0x52fd('0x1e')][_0x52fd('0x61')]=function(_0x17e5ca){return!_[_0x52fd('0x62')](_0x17e5ca)&&!_[_0x52fd('0x62')](_0x17e5ca[_0x52fd('0x39')])&&!_[_0x52fd('0x62')](_0x17e5ca[_0x52fd('0x63')])&&_0x17e5ca[_0x52fd('0x63')]&&!_[_0x52fd('0x62')](this[_0x52fd('0x10')][util['format'](_0x52fd('0x64'),_0x17e5ca['name'])])&&!_[_0x52fd('0x62')](this[_0x52fd('0x10')][util['format']('SIP/%s',_0x17e5ca[_0x52fd('0x39')])][_0x52fd('0x2c')])&&(this[_0x52fd('0x10')][util['format'](_0x52fd('0x64'),_0x17e5ca[_0x52fd('0x39')])][_0x52fd('0x2c')]===_0x52fd('0x65')||this[_0x52fd('0x10')][util[_0x52fd('0x59')]('SIP/%s',_0x17e5ca['name'])][_0x52fd('0x2c')]===_0x52fd('0x66'));};Fax['prototype'][_0x52fd('0x57')]=function(_0x265838,_0x3868ab){if(!this['isTrunkReachable'](_0x265838)){ut[_0x52fd('0x48')](_0x52fd('0x67'),_[_0x52fd('0x62')](_0x265838)?'':_0x265838[_0x52fd('0x39')]+_0x52fd('0x68'));return{'isValid':![],'message':_0x52fd('0x69')};}if(_['isNil'](_0x3868ab['fax'])){ut[_0x52fd('0x48')](_0x52fd('0x6a'),JSON['stringify'](_0x3868ab));return{'isValid':![],'message':_0x52fd('0x6b')};}if(_[_0x52fd('0x62')](_0x3868ab['path'])){ut[_0x52fd('0x48')](_0x52fd('0x6c'),JSON['stringify'](_0x3868ab));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x52fd('0x6d')};};module[_0x52fd('0x6e')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index eada4f2..71da20c 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 _0xf939=['util','../../../config/logger','preview','lodash','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x2e806e,_0x5ed4c1){var _0x212123=function(_0x3e17bf){while(--_0x3e17bf){_0x2e806e['push'](_0x2e806e['shift']());}};_0x212123(++_0x5ed4c1);}(_0xf939,0x1b8));var _0x9f93=function(_0xefb683,_0x13c7c4){_0xefb683=_0xefb683-0x0;var _0x9eb59b=_0xf939[_0xefb683];return _0x9eb59b;};'use strict';var util=require(_0x9f93('0x0'));var BPromise=require('bluebird');var logger=require(_0x9f93('0x1'))(_0x9f93('0x2'));var _=require(_0x9f93('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x54a669){return function(_0x343cb9){logger[_0x9f93('0x4')](_0x54a669,util[_0x9f93('0x5')](_0x343cb9,{'showHidden':![],'depth':null}));};}exports[_0x9f93('0x6')]=function(_0x321e04,_0x4bac30){return BPromise[_0x9f93('0x7')]()[_0x9f93('0x8')](faxAccount['notify'](_0x321e04,_0x4bac30))[_0x9f93('0x9')](loggerCatch(_0x9f93('0xa')));}; \ No newline at end of file +var _0xf78f=['lodash','../rpc/faxAccount','then','notify','catch','[Notify]\x20','bluebird','../../../config/logger','preview'];(function(_0x162c62,_0x9c6779){var _0x2c4b08=function(_0x1fadcd){while(--_0x1fadcd){_0x162c62['push'](_0x162c62['shift']());}};_0x2c4b08(++_0x9c6779);}(_0xf78f,0x72));var _0xff78=function(_0x34838f,_0x406e59){_0x34838f=_0x34838f-0x0;var _0x5b1222=_0xf78f[_0x34838f];return _0x5b1222;};'use strict';var util=require('util');var BPromise=require(_0xff78('0x0'));var logger=require(_0xff78('0x1'))(_0xff78('0x2'));var _=require(_0xff78('0x3'));var faxAccount=require(_0xff78('0x4'));function loggerCatch(_0x2cf009){return function(_0x48df16){logger['error'](_0x2cf009,util['inspect'](_0x48df16,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5d11cd,_0x35f208){return BPromise['resolve']()[_0xff78('0x5')](faxAccount[_0xff78('0x6')](_0x5d11cd,_0x35f208))[_0xff78('0x7')](loggerCatch(_0xff78('0x8')));}; \ 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 ad970fe..091a819 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 _0xb5d5=['Exec\x20gs','inspect','util','bluebird','child_process','exec','execute','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5d5,0x11a));var _0x5b5d=function(_0x5b3cb2,_0x4aeaa8){_0x5b3cb2=_0x5b3cb2-0x0;var _0x553305=_0xb5d5[_0x5b3cb2];return _0x553305;};'use strict';var util=require(_0x5b5d('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x5b5d('0x1'));var exec=require(_0x5b5d('0x2'))[_0x5b5d('0x3')];exports[_0x5b5d('0x4')]=function(_0x61bbff){return new BPromise(function(_0x21a017,_0x43e179){exec(_0x61bbff,function(_0x37ac3e,_0x8563b4,_0xcf2a5d){logger[_0x5b5d('0x5')](_0x5b5d('0x6'),_0x8563b4);if(_0x37ac3e){logger[_0x5b5d('0x5')](_0x5b5d('0x6'),'\x20Error\x20:',util[_0x5b5d('0x7')](_0x37ac3e,{'showHidden':![],'depth':null}),_0x8563b4,_0xcf2a5d);_0x43e179(_0x37ac3e);}_0x21a017(_0x8563b4);});});}; \ No newline at end of file +var _0xd88f=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0xf10c98,_0x34e198){var _0x57fd53=function(_0x1a11b7){while(--_0x1a11b7){_0xf10c98['push'](_0xf10c98['shift']());}};_0x57fd53(++_0x34e198);}(_0xd88f,0x112));var _0xfd88=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xd88f[_0x88cd7b];return _0x56fcc8;};'use strict';var util=require(_0xfd88('0x0'));var logger=require(_0xfd88('0x1'))(_0xfd88('0x2'));var BPromise=require(_0xfd88('0x3'));var exec=require(_0xfd88('0x4'))[_0xfd88('0x5')];exports[_0xfd88('0x6')]=function(_0x486304){return new BPromise(function(_0x48b61b,_0x2820e0){exec(_0x486304,function(_0xf749b1,_0x274df2,_0x5d17ad){logger[_0xfd88('0x7')](_0xfd88('0x8'),_0x274df2);if(_0xf749b1){logger[_0xfd88('0x7')]('Exec\x20gs',_0xfd88('0x9'),util[_0xfd88('0xa')](_0xf749b1,{'showHidden':![],'depth':null}),_0x274df2,_0x5d17ad);_0x2820e0(_0xf749b1);}_0x48b61b(_0x274df2);});});}; \ 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 a4c4db1..0528caa 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 _0x0315=['channel','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','../../../../config/logger','fax','message','logger','addVariables','ecm','headerinfo','minrate','format','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','originate'];(function(_0x28ff21,_0x210624){var _0x610251=function(_0x225045){while(--_0x225045){_0x28ff21['push'](_0x28ff21['shift']());}};_0x610251(++_0x210624);}(_0x0315,0xeb));var _0x5031=function(_0x21b99d,_0x46fbc9){_0x21b99d=_0x21b99d-0x0;var _0x31335a=_0x0315[_0x21b99d];return _0x31335a;};'use strict';var util=require('util');var _=require(_0x5031('0x0'));var moment=require('moment');var logger=require(_0x5031('0x1'))(_0x5031('0x2'));exports[_0x5031('0x3')]=function(_0x2e1365){return{'message':_0x2e1365};};exports[_0x5031('0x4')]=function(_0x9a8bb3,_0x200786){logger['info'](_0x9a8bb3,util['inspect'](_0x200786,{'showHidden':![],'depth':null}));};exports[_0x5031('0x5')]=function(_0x43dda6,_0x580aef){var _0x4dbb20={'XMF-ECM':_0x580aef[_0x5031('0x6')],'XMF-HEADERINFO':_0x580aef[_0x5031('0x7')],'XMF-MINRATE':_0x580aef[_0x5031('0x8')],'XMF-MAXRATE':_0x580aef['maxrate'],'XMF-MODEM':util[_0x5031('0x9')]('\x22%s\x22',_0x580aef[_0x5031('0xa')]),'XMF-GATEWAY':_0x580aef['gateway'],'XMF-FAXDETECT':_0x580aef[_0x5031('0xb')],'XMF-T38TIMEOUT':_0x580aef[_0x5031('0xc')],'XMF-LOCALSTATIONID':_0x580aef['localstationid'],'XMF-PATH':_0x43dda6[_0x5031('0xd')]};return _0x4dbb20;};exports[_0x5031('0xe')]=function(_0x1b4d48,_0x5c4671){return{'actionid':_0x1b4d48[_0x5031('0xf')],'action':_0x5031('0x10'),'channel':_0x1b4d48[_0x5031('0x11')],'Exten':'xcally-motion-fax','Context':_0x5031('0x12'),'Priority':'1','callerid':util[_0x5031('0x9')](_0x5031('0x13'),_0x1b4d48[_0x5031('0x7')]?_0x1b4d48['headerinfo']:'',_0x1b4d48[_0x5031('0x14')]),'variable':_0x5c4671,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1b4d48[_0x5031('0xf')]};}; \ No newline at end of file +var _0x142a=['logger','info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','uniqueid','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x281ee5,_0x479f84){var _0x4a81d2=function(_0x253ba2){while(--_0x253ba2){_0x281ee5['push'](_0x281ee5['shift']());}};_0x4a81d2(++_0x479f84);}(_0x142a,0x159));var _0xa142=function(_0x46894c,_0x15c966){_0x46894c=_0x46894c-0x0;var _0x4938c0=_0x142a[_0x46894c];return _0x4938c0;};'use strict';var util=require(_0xa142('0x0'));var _=require(_0xa142('0x1'));var moment=require(_0xa142('0x2'));var logger=require(_0xa142('0x3'))(_0xa142('0x4'));exports[_0xa142('0x5')]=function(_0x54b5b8){return{'message':_0x54b5b8};};exports[_0xa142('0x6')]=function(_0x2c1d4a,_0x4f7e40){logger[_0xa142('0x7')](_0x2c1d4a,util[_0xa142('0x8')](_0x4f7e40,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2af575,_0x45e2cb){var _0x7f11ae={'XMF-ECM':_0x45e2cb[_0xa142('0x9')],'XMF-HEADERINFO':_0x45e2cb['headerinfo'],'XMF-MINRATE':_0x45e2cb[_0xa142('0xa')],'XMF-MAXRATE':_0x45e2cb[_0xa142('0xb')],'XMF-MODEM':util[_0xa142('0xc')](_0xa142('0xd'),_0x45e2cb[_0xa142('0xe')]),'XMF-GATEWAY':_0x45e2cb[_0xa142('0xf')],'XMF-FAXDETECT':_0x45e2cb[_0xa142('0x10')],'XMF-T38TIMEOUT':_0x45e2cb[_0xa142('0x11')],'XMF-LOCALSTATIONID':_0x45e2cb['localstationid'],'XMF-PATH':_0x2af575[_0xa142('0x12')]};return _0x7f11ae;};exports[_0xa142('0x13')]=function(_0x2477c9,_0x20d6f6){return{'actionid':_0x2477c9['uniqueid'],'action':_0xa142('0x14'),'channel':_0x2477c9[_0xa142('0x15')],'Exten':'xcally-motion-fax','Context':_0xa142('0x16'),'Priority':'1','callerid':util[_0xa142('0xc')](_0xa142('0x17'),_0x2477c9['headerinfo']?_0x2477c9[_0xa142('0x18')]:'',_0x2477c9[_0xa142('0x19')]),'variable':_0x20d6f6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2477c9[_0xa142('0x1a')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index eb8f1db..9f8912f 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 _0xf5c0=['getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','initAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x475641,_0x9cdf2f){var _0x54f4f0=function(_0x2be35a){while(--_0x2be35a){_0x475641['push'](_0x475641['shift']());}};_0x54f4f0(++_0x9cdf2f);}(_0xf5c0,0x172));var _0x0f5c=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0xf5c0[_0x3213b7];return _0xb960bf;};'use strict';var BPromise=require(_0x0f5c('0x0'));var util=require(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var server=require(_0x0f5c('0x3'));var Realtime=require(_0x0f5c('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x0f5c('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x0f5c('0x6'));var user=require(_0x0f5c('0x7'));var voiceQueue=require(_0x0f5c('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x0f5c('0x9'));var trunk=require(_0x0f5c('0xa'));var trigger=require(_0x0f5c('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x0f5c('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x0f5c('0xd'));var faxAccount=require(_0x0f5c('0xe'));var zendesk=require(_0x0f5c('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0f5c('0x10'));var zoho=require(_0x0f5c('0x11'));var vtiger=require(_0x0f5c('0x12'));var servicenow=require(_0x0f5c('0x13'));var dynamics365=require(_0x0f5c('0x14'));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()[_0x0f5c('0x15')](_0x0f5c('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0f5c('0x15')](_0x0f5c('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0f5c('0x17')]()['then'](user['getAgents']())['then'](realtime[_0x0f5c('0x18')]())[_0x0f5c('0x19')](user[_0x0f5c('0x1a')]())[_0x0f5c('0x19')](realtime['initTelephones']())[_0x0f5c('0x19')](trunk['getTrunks']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x1b')]())['then'](voiceQueue[_0x0f5c('0x1c')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x1d')]())[_0x0f5c('0x19')](trigger[_0x0f5c('0x1e')]())['then'](realtime[_0x0f5c('0x1f')]())[_0x0f5c('0x19')](template[_0x0f5c('0x20')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x21')]())['then'](zendesk[_0x0f5c('0x22')]())['then'](realtime[_0x0f5c('0x23')]())[_0x0f5c('0x19')](salesforce[_0x0f5c('0x24')]())[_0x0f5c('0x19')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x0f5c('0x25')]())['then'](realtime[_0x0f5c('0x26')]())[_0x0f5c('0x19')](freshdesk[_0x0f5c('0x27')]())[_0x0f5c('0x19')](realtime['initFreshdeskAccounts']())[_0x0f5c('0x19')](desk['getDeskAccounts']())['then'](realtime[_0x0f5c('0x28')]())[_0x0f5c('0x19')](zoho['getZohoAccounts']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x29')]())[_0x0f5c('0x19')](vtiger['getVtigerAccounts']())['then'](realtime[_0x0f5c('0x2a')]())[_0x0f5c('0x19')](servicenow[_0x0f5c('0x2b')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x2c')]())[_0x0f5c('0x19')](dynamics365[_0x0f5c('0x2d')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x2e')]())[_0x0f5c('0x19')](campaign[_0x0f5c('0x2f')]())[_0x0f5c('0x19')](realtime['initCampaigns']())['then'](voiceExtension[_0x0f5c('0x30')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x31')]())[_0x0f5c('0x19')](faxAccount[_0x0f5c('0x32')]())['then'](realtime[_0x0f5c('0x33')]())[_0x0f5c('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x0f5c('0x19')](voiceQueueReport[_0x0f5c('0x34')]())['then'](realtime[_0x0f5c('0x35')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x36')]())[_0x0f5c('0x19')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x0f5c('0x37')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x0f5c('0x38')]())['then'](function(_0x2128a8){})[_0x0f5c('0x39')](function(_0x424b86){console['log'](_0x424b86);});}function main(){return server['listen'](realtime,preview,fax)[_0x0f5c('0x19')](function(_0x458f74){return initRealtime();})['then'](function(){return initParams();})[_0x0f5c('0x19')](function(){report[_0x0f5c('0x3a')]();setInterval(initRealtime,0x1388);})[_0x0f5c('0x39')](function(_0x42b3b6){console[_0x0f5c('0x3b')](_0x42b3b6);});}main(); \ No newline at end of file +var _0x9b39=['initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports'];(function(_0x2de7ff,_0x2ce730){var _0x46f8dc=function(_0x1edd3c){while(--_0x1edd3c){_0x2de7ff['push'](_0x2de7ff['shift']());}};_0x46f8dc(++_0x2ce730);}(_0x9b39,0x90));var _0x99b3=function(_0x2b0c2e,_0x586346){_0x2b0c2e=_0x2b0c2e-0x0;var _0xd6c0aa=_0x9b39[_0x2b0c2e];return _0xd6c0aa;};'use strict';var BPromise=require(_0x99b3('0x0'));var util=require(_0x99b3('0x1'));var moment=require(_0x99b3('0x2'));var server=require(_0x99b3('0x3'));var Realtime=require(_0x99b3('0x4'));var Report=require(_0x99b3('0x5'));var Acw=require(_0x99b3('0x6'));var Trigger=require(_0x99b3('0x7'));var Dialer=require(_0x99b3('0x8'));var Preview=require(_0x99b3('0x9'));var Fax=require(_0x99b3('0xa'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x99b3('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0x99b3('0xc'));var cmHopperHistory=require(_0x99b3('0xd'));var campaign=require(_0x99b3('0xe'));var voiceExtension=require(_0x99b3('0xf'));var faxAccount=require(_0x99b3('0x10'));var zendesk=require(_0x99b3('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x99b3('0x12'));var freshdesk=require(_0x99b3('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x99b3('0x14'));var vtiger=require(_0x99b3('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x99b3('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x99b3('0x17')](_0x99b3('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x99b3('0x17')](_0x99b3('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x99b3('0x19')]()[_0x99b3('0x1a')](user[_0x99b3('0x1b')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x1c')]())[_0x99b3('0x1a')](user[_0x99b3('0x1d')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x1e')]())[_0x99b3('0x1a')](trunk[_0x99b3('0x1f')]())['then'](realtime[_0x99b3('0x20')]())[_0x99b3('0x1a')](voiceQueue['getVoiceQueues']())[_0x99b3('0x1a')](realtime[_0x99b3('0x21')]())[_0x99b3('0x1a')](trigger[_0x99b3('0x22')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x23')]())[_0x99b3('0x1a')](template['getTemplates']())[_0x99b3('0x1a')](realtime['initTemplates']())['then'](zendesk[_0x99b3('0x24')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x25')]())[_0x99b3('0x1a')](salesforce[_0x99b3('0x26')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x27')]())['then'](sugarcrm[_0x99b3('0x28')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x29')]())[_0x99b3('0x1a')](freshdesk[_0x99b3('0x2a')]())['then'](realtime[_0x99b3('0x2b')]())[_0x99b3('0x1a')](desk['getDeskAccounts']())[_0x99b3('0x1a')](realtime[_0x99b3('0x2c')]())[_0x99b3('0x1a')](zoho[_0x99b3('0x2d')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x2e')]())[_0x99b3('0x1a')](vtiger[_0x99b3('0x2f')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x30')]())['then'](servicenow['getServicenowAccounts']())[_0x99b3('0x1a')](realtime[_0x99b3('0x31')]())[_0x99b3('0x1a')](dynamics365[_0x99b3('0x32')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x33')]())[_0x99b3('0x1a')](campaign[_0x99b3('0x34')]())['then'](realtime['initCampaigns']())[_0x99b3('0x1a')](voiceExtension['getVoiceExtensions']())[_0x99b3('0x1a')](realtime[_0x99b3('0x35')]())[_0x99b3('0x1a')](faxAccount[_0x99b3('0x36')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x37')]())[_0x99b3('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x99b3('0x19')]()[_0x99b3('0x1a')](voiceQueueReport[_0x99b3('0x38')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x39')]())[_0x99b3('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x99b3('0x3a')]())[_0x99b3('0x1a')](cmHopperHistory[_0x99b3('0x3b')]())[_0x99b3('0x1a')](realtime[_0x99b3('0x3c')]())[_0x99b3('0x1a')](voiceCallReport[_0x99b3('0x3d')]())['then'](realtime[_0x99b3('0x3e')]())['then'](function(_0x353de3){})[_0x99b3('0x3f')](function(_0x17a803){console[_0x99b3('0x40')](_0x17a803);});}function main(){return server[_0x99b3('0x41')](realtime,preview,fax)['then'](function(_0x3ce76b){return initRealtime();})[_0x99b3('0x1a')](function(){return initParams();})[_0x99b3('0x1a')](function(){report[_0x99b3('0x42')]();setInterval(initRealtime,0x1388);})[_0x99b3('0x3f')](function(_0x34739c){console[_0x99b3('0x40')](_0x34739c);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 46a7951..e45cc1c 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 _0x4008=['voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','updateStatusRealtime','toLowerCase','idle','inuse','statePause','toNumber','email','status','stringify','format','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','accountcode','fullname','state','stateTime','unknown','address','phone','interface','online'];(function(_0x1ec00a,_0x2b9207){var _0x3fe47a=function(_0x1e6f56){while(--_0x1e6f56){_0x1ec00a['push'](_0x1ec00a['shift']());}};_0x3fe47a(++_0x2b9207);}(_0x4008,0x126));var _0x8400=function(_0x5c277d,_0x180ea3){_0x5c277d=_0x5c277d-0x0;var _0x5720b2=_0x4008[_0x5c277d];return _0x5720b2;};'use strict';var _=require(_0x8400('0x0'));var util=require(_0x8400('0x1'));var moment=require(_0x8400('0x2'));var md5=require('md5');var Redis=require(_0x8400('0x3'));var config=require(_0x8400('0x4'));config[_0x8400('0x5')]=_[_0x8400('0x6')](config[_0x8400('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8400('0x7'))(new Redis(config['redis']));function Agent(_0x18226d){this['id']=_0x18226d['id']||0x0;this['name']=_0x18226d[_0x8400('0x8')]||'';this['email']=_0x18226d['email']||'';this[_0x8400('0x9')]=_0x18226d[_0x8400('0x9')]||'';this[_0x8400('0xa')]=_0x18226d[_0x8400('0xa')]||'';this[_0x8400('0xb')]='unknown';this[_0x8400('0xc')]=0x0;this['status']=_0x8400('0xd');this[_0x8400('0xe')]='';this[_0x8400('0xf')]='';this['mobile']='';this[_0x8400('0x10')]='';this[_0x8400('0x11')]=_0x18226d[_0x8400('0x11')]||![];this[_0x8400('0x12')]=_0x8400('0xd');this[_0x8400('0x13')]=0x0;this[_0x8400('0x14')]='';this[_0x8400('0x15')]='';this[_0x8400('0x16')]=![];this[_0x8400('0x17')]=![];this[_0x8400('0x18')]='';}Agent['prototype'][_0x8400('0x19')]=function(_0x4f554a){var _0x108e20;if(_0x4f554a&&_0x4f554a[_0x8400('0xb')]){_0x108e20=_0x4f554a[_0x8400('0xb')][_0x8400('0x1a')]();switch(_0x108e20){case'not_inuse':_0x108e20=_0x8400('0x1b');break;case _0x8400('0x1c'):_0x108e20='talking';break;}}if(_0x108e20&&this[_0x8400('0x12')]!==_0x108e20||_0x4f554a[_0x8400('0x1d')]){this[_0x8400('0x13')]=_[_0x8400('0x1e')](moment()['format']('x'));}if(_0x108e20){this[_0x8400('0x12')]=_0x108e20;}var _0x5756e4={'id':this['id'],'name':this[_0x8400('0x8')],'email':this[_0x8400('0x1f')],'accountcode':this[_0x8400('0x9')],'fullname':this[_0x8400('0xa')],'state':this[_0x8400('0xb')],'stateTime':this['stateTime'],'status':this[_0x8400('0x20')],'address':this[_0x8400('0xe')],'online':this[_0x8400('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x8400('0x13')],'voiceStatusCallerIdNumber':this[_0x8400('0x14')],'voiceStatusQueue':this[_0x8400('0x15')],'interface':this[_0x8400('0x10')],'onhold':this[_0x8400('0x16')]};var _0x21cf0d=md5(JSON[_0x8400('0x21')](_0x5756e4));if(this[_0x8400('0x18')]!==_0x21cf0d){this[_0x8400('0x18')]=_0x21cf0d;io['to'](util[_0x8400('0x22')](_0x8400('0x23'),_0x5756e4['name']))[_0x8400('0x24')](_0x8400('0x25'),_0x5756e4);}};module[_0x8400('0x26')]=Agent; \ No newline at end of file +var _0x38df=['ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','stringify','user:%s','emit','user:save','exports','util'];(function(_0x5bbf15,_0x1afe73){var _0x4ed9a5=function(_0x583021){while(--_0x583021){_0x5bbf15['push'](_0x5bbf15['shift']());}};_0x4ed9a5(++_0x1afe73);}(_0x38df,0x117));var _0xf38d=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0x38df[_0xd93cbe];return _0xe0bb40;};'use strict';var _=require('lodash');var util=require(_0xf38d('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xf38d('0x1'));var config=require(_0xf38d('0x2'));config['redis']=_[_0xf38d('0x3')](config[_0xf38d('0x4')],{'host':_0xf38d('0x5'),'port':0x18eb});var io=require(_0xf38d('0x6'))(new Redis(config[_0xf38d('0x4')]));function Agent(_0x1e0710){this['id']=_0x1e0710['id']||0x0;this[_0xf38d('0x7')]=_0x1e0710[_0xf38d('0x7')]||'';this[_0xf38d('0x8')]=_0x1e0710[_0xf38d('0x8')]||'';this[_0xf38d('0x9')]=_0x1e0710[_0xf38d('0x9')]||'';this[_0xf38d('0xa')]=_0x1e0710[_0xf38d('0xa')]||'';this[_0xf38d('0xb')]=_0xf38d('0xc');this[_0xf38d('0xd')]=0x0;this[_0xf38d('0xe')]=_0xf38d('0xc');this[_0xf38d('0xf')]='';this['phone']='';this[_0xf38d('0x10')]='';this[_0xf38d('0x11')]='';this[_0xf38d('0x12')]=_0x1e0710[_0xf38d('0x12')]||![];this[_0xf38d('0x13')]=_0xf38d('0xc');this[_0xf38d('0x14')]=0x0;this[_0xf38d('0x15')]='';this[_0xf38d('0x16')]='';this[_0xf38d('0x17')]=![];this[_0xf38d('0x18')]=![];this[_0xf38d('0x19')]='';}Agent[_0xf38d('0x1a')][_0xf38d('0x1b')]=function(_0x430a89){var _0x44dc49;if(_0x430a89&&_0x430a89[_0xf38d('0xb')]){_0x44dc49=_0x430a89[_0xf38d('0xb')][_0xf38d('0x1c')]();switch(_0x44dc49){case _0xf38d('0x1d'):_0x44dc49=_0xf38d('0x1e');break;case _0xf38d('0x1f'):_0x44dc49=_0xf38d('0x20');break;}}if(_0x44dc49&&this['voiceStatus']!==_0x44dc49||_0x430a89[_0xf38d('0x21')]){this[_0xf38d('0x14')]=_['toNumber'](moment()[_0xf38d('0x22')]('x'));}if(_0x44dc49){this['voiceStatus']=_0x44dc49;}var _0x392549={'id':this['id'],'name':this[_0xf38d('0x7')],'email':this['email'],'accountcode':this[_0xf38d('0x9')],'fullname':this[_0xf38d('0xa')],'state':this[_0xf38d('0xb')],'stateTime':this['stateTime'],'status':this[_0xf38d('0xe')],'address':this['address'],'online':this[_0xf38d('0x12')],'voiceStatus':this[_0xf38d('0x13')],'voiceStatusTime':this[_0xf38d('0x14')],'voiceStatusCallerIdNumber':this[_0xf38d('0x15')],'voiceStatusQueue':this[_0xf38d('0x16')],'interface':this['interface'],'onhold':this['onhold']};var _0x95c7b1=md5(JSON[_0xf38d('0x23')](_0x392549));if(this[_0xf38d('0x19')]!==_0x95c7b1){this[_0xf38d('0x19')]=_0x95c7b1;io['to'](util[_0xf38d('0x22')](_0xf38d('0x24'),_0x392549[_0xf38d('0x7')]))[_0xf38d('0x25')](_0xf38d('0x26'),_0x392549);}};module[_0xf38d('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 716a862..5686f28 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 _0x073e=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x3318c3,_0x35066){var _0x15c002=function(_0xd82271){while(--_0xd82271){_0x3318c3['push'](_0x3318c3['shift']());}};_0x15c002(++_0x35066);}(_0x073e,0x181));var _0xe073=function(_0x684f90,_0x487c04){_0x684f90=_0x684f90-0x0;var _0x3b8070=_0x073e[_0x684f90];return _0x3b8070;};'use strict';function Campaign(_0xf70489){this['id']=_0xf70489['id']||0x0;this[_0xe073('0x0')]=_0xf70489[_0xe073('0x0')]||'';this[_0xe073('0x1')]=_0xf70489['type']||'campaign';this['originated']=0x0;this[_0xe073('0x2')]=0x0;this[_0xe073('0x3')]=0x0;this[_0xe073('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0xf70489[_0xe073('0x5')];this[_0xe073('0x6')]=_0xf70489[_0xe073('0x6')];this[_0xe073('0x7')]=_0xf70489[_0xe073('0x7')]||null;this[_0xe073('0x8')]=_0xf70489['dialGlobalInterval']?_0xf70489[_0xe073('0x8')]:null;this[_0xe073('0x9')]=_0xf70489[_0xe073('0x9')];this[_0xe073('0xa')]=_0xf70489['dialOriginateCallerIdNumber'];this[_0xe073('0xb')]=_0xf70489[_0xe073('0xb')]||0x1e;this[_0xe073('0xc')]=_0xf70489[_0xe073('0xc')];this[_0xe073('0xd')]=_0xf70489[_0xe073('0xd')];this['dialBusyMaxRetry']=_0xf70489[_0xe073('0xe')];this['dialBusyRetryFrequency']=_0xf70489[_0xe073('0xf')];this['dialNoAnswerMaxRetry']=_0xf70489[_0xe073('0x10')];this['dialNoAnswerRetryFrequency']=_0xf70489[_0xe073('0x11')];this[_0xe073('0x12')]=_0xf70489[_0xe073('0x12')];this[_0xe073('0x13')]=_0xf70489[_0xe073('0x13')]||_0xe073('0x14');this[_0xe073('0x15')]=_0xf70489[_0xe073('0x15')]||undefined;this[_0xe073('0x16')]=_0xf70489[_0xe073('0x16')]||undefined;this[_0xe073('0x17')]=_0xf70489['dialCutDigit']||undefined;this['TrunkBackup']=_0xf70489['TrunkBackup']?_0xf70489[_0xe073('0x18')]:undefined;this[_0xe073('0x19')]=_0xf70489[_0xe073('0x19')]?_0xf70489[_0xe073('0x19')]:undefined;this['Interval']=_0xf70489[_0xe073('0x1a')]?_0xf70489[_0xe073('0x1a')]:undefined;this[_0xe073('0x1b')]=_0xf70489['SquareProject']?_0xf70489[_0xe073('0x1b')]:undefined;this[_0xe073('0x1c')]=_0xf70489[_0xe073('0x1b')]?_0xf70489[_0xe073('0x1b')][_0xe073('0x0')]:undefined;this[_0xe073('0x1d')]=_0xf70489[_0xe073('0x1d')]||![];this[_0xe073('0x1e')]=_0xf70489[_0xe073('0x1e')];this[_0xe073('0x1f')]=_0xf70489['dialAMDGreeting'];this[_0xe073('0x20')]=_0xf70489[_0xe073('0x20')];this[_0xe073('0x21')]=_0xf70489[_0xe073('0x21')];this[_0xe073('0x22')]=_0xf70489[_0xe073('0x22')];this['dialAMDBetweenWordsSilence']=_0xf70489['dialAMDBetweenWordsSilence'];this[_0xe073('0x23')]=_0xf70489['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0xf70489['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xf70489['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x69d3=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0x69d3,0xda));var _0x369d=function(_0x20c688,_0x5edcff){_0x20c688=_0x20c688-0x0;var _0x27b921=_0x69d3[_0x20c688];return _0x27b921;};'use strict';function Campaign(_0x485606){this['id']=_0x485606['id']||0x0;this[_0x369d('0x0')]=_0x485606[_0x369d('0x0')]||'';this['type']=_0x485606[_0x369d('0x1')]||_0x369d('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x369d('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x369d('0x4')]=!![];this[_0x369d('0x5')]=_0x485606[_0x369d('0x5')];this[_0x369d('0x6')]=_0x485606[_0x369d('0x6')];this[_0x369d('0x7')]=_0x485606[_0x369d('0x7')]||null;this[_0x369d('0x8')]=_0x485606[_0x369d('0x8')]?_0x485606['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x485606[_0x369d('0x9')];this[_0x369d('0xa')]=_0x485606[_0x369d('0xa')];this[_0x369d('0xb')]=_0x485606['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x485606[_0x369d('0xc')];this[_0x369d('0xd')]=_0x485606[_0x369d('0xd')];this[_0x369d('0xe')]=_0x485606[_0x369d('0xe')];this[_0x369d('0xf')]=_0x485606['dialBusyRetryFrequency'];this[_0x369d('0x10')]=_0x485606[_0x369d('0x10')];this[_0x369d('0x11')]=_0x485606[_0x369d('0x11')];this[_0x369d('0x12')]=_0x485606['dialGlobalMaxRetry'];this['dialOrderByScheduledAt']=_0x485606['dialOrderByScheduledAt']||_0x369d('0x13');this[_0x369d('0x14')]=_0x485606[_0x369d('0x14')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x485606[_0x369d('0x15')]||undefined;this[_0x369d('0x16')]=_0x485606[_0x369d('0x16')]||undefined;this['TrunkBackup']=_0x485606[_0x369d('0x17')]?_0x485606[_0x369d('0x17')]:undefined;this['Trunk']=_0x485606['Trunk']?_0x485606['Trunk']:undefined;this[_0x369d('0x18')]=_0x485606[_0x369d('0x18')]?_0x485606[_0x369d('0x18')]:undefined;this['SquareProject']=_0x485606[_0x369d('0x19')]?_0x485606[_0x369d('0x19')]:undefined;this[_0x369d('0x1a')]=_0x485606[_0x369d('0x19')]?_0x485606[_0x369d('0x19')]['name']:undefined;this[_0x369d('0x1b')]=_0x485606[_0x369d('0x1b')]||![];this[_0x369d('0x1c')]=_0x485606[_0x369d('0x1c')];this[_0x369d('0x1d')]=_0x485606[_0x369d('0x1d')];this[_0x369d('0x1e')]=_0x485606[_0x369d('0x1e')];this['dialAMDTotalAnalysisTime']=_0x485606['dialAMDTotalAnalysisTime'];this[_0x369d('0x1f')]=_0x485606[_0x369d('0x1f')];this[_0x369d('0x20')]=_0x485606[_0x369d('0x20')];this[_0x369d('0x21')]=_0x485606[_0x369d('0x21')];this[_0x369d('0x22')]=_0x485606['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x485606[_0x369d('0x23')];}module[_0x369d('0x24')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 795742d..9ff2d6c 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 _0xf963=['unmanaged','abandoned','lastdata','duration','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','answered','endtime'];(function(_0x229d24,_0x40c4b9){var _0x4eec76=function(_0x403f9b){while(--_0x403f9b){_0x229d24['push'](_0x229d24['shift']());}};_0x4eec76(++_0x40c4b9);}(_0xf963,0x11d));var _0x3f96=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf963[_0x1035c1];return _0x308d67;};'use strict';function Channel(){this[_0x3f96('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x3f96('0x1')]=0x0;this[_0x3f96('0x2')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x3f96('0x3')]=0x0;this[_0x3f96('0x4')]='';this[_0x3f96('0x5')]=0x0;this[_0x3f96('0x6')]=0x0;this['exten']=0x0;this[_0x3f96('0x7')]=![];this['answertime']=null;this[_0x3f96('0x8')]=null;this[_0x3f96('0x9')]=![];this[_0x3f96('0xa')]=![];this['lastapplication']='';this[_0x3f96('0xb')]='';this[_0x3f96('0xc')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x3f96('0xd')]=null;this[_0x3f96('0xe')]=![];this[_0x3f96('0xf')]=null;this[_0x3f96('0x10')]=null;this[_0x3f96('0x11')]=[];this['transfercalleridnum']=undefined;this[_0x3f96('0x12')]=undefined;this[_0x3f96('0x13')]=0x0;}module[_0x3f96('0x14')]=Channel; \ No newline at end of file +var _0xb89c=['context','uniqueid','linkedid','answertime','endtime','unmanaged','lastapplication','lastdata','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb89c,0x198));var _0xcb89=function(_0x2c59bb,_0x2927bc){_0x2c59bb=_0x2c59bb-0x0;var _0x151825=_0xb89c[_0x2c59bb];return _0x151825;};'use strict';function Channel(){this[_0xcb89('0x0')]=null;this[_0xcb89('0x1')]='';this[_0xcb89('0x2')]='';this[_0xcb89('0x3')]=0x0;this['calleridname']='';this[_0xcb89('0x4')]=undefined;this[_0xcb89('0x5')]=undefined;this['accountcode']=0x0;this[_0xcb89('0x6')]='';this[_0xcb89('0x7')]=0x0;this[_0xcb89('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xcb89('0x9')]=null;this[_0xcb89('0xa')]=null;this[_0xcb89('0xb')]=![];this['abandoned']=![];this[_0xcb89('0xc')]='';this[_0xcb89('0xd')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xcb89('0xe')]=0x0;this['type']=null;this[_0xcb89('0xf')]=null;this[_0xcb89('0x10')]=null;this[_0xcb89('0x11')]=![];this[_0xcb89('0x12')]=null;this[_0xcb89('0x13')]=null;this[_0xcb89('0x14')]=[];this['transfercalleridnum']=undefined;this[_0xcb89('0x15')]=undefined;this['mohtime']=0x0;}module[_0xcb89('0x16')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e01dfb9..31f26ba 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 _0x4fa7=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x1abb94,_0xeb6704){var _0x37ed56=function(_0x26e6aa){while(--_0x26e6aa){_0x1abb94['push'](_0x1abb94['shift']());}};_0x37ed56(++_0xeb6704);}(_0x4fa7,0x127));var _0x74fa=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x4fa7[_0x2d9e27];return _0xd35381;};'use strict';function DeskAccount(_0xa5f114){this['id']=_0xa5f114['id']||0x0;this[_0x74fa('0x0')]=_0xa5f114[_0x74fa('0x0')]||'';this[_0x74fa('0x1')]=_0xa5f114[_0x74fa('0x1')]||'';this[_0x74fa('0x2')]=_0xa5f114[_0x74fa('0x2')]||'';this[_0x74fa('0x3')]=_0xa5f114[_0x74fa('0x3')]||'';this[_0x74fa('0x4')]=_0xa5f114[_0x74fa('0x4')]||'';this[_0x74fa('0x5')]=_0xa5f114[_0x74fa('0x5')]||'';this[_0x74fa('0x6')]=_0xa5f114[_0x74fa('0x6')]||'';this[_0x74fa('0x7')]=_0xa5f114['token']||'';this[_0x74fa('0x8')]=_0xa5f114[_0x74fa('0x8')]||'';this[_0x74fa('0x9')]=_0xa5f114[_0x74fa('0x9')]||'';this[_0x74fa('0xa')]=_0xa5f114[_0x74fa('0xa')]||'';this['Configurations']=_0xa5f114[_0x74fa('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xed9f=['type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x5c0368,_0x423cf2){var _0x5b31b9=function(_0x118b40){while(--_0x118b40){_0x5c0368['push'](_0x5c0368['shift']());}};_0x5b31b9(++_0x423cf2);}(_0xed9f,0x1a7));var _0xfed9=function(_0x5d24c1,_0xf7cd20){_0x5d24c1=_0x5d24c1-0x0;var _0x89701b=_0xed9f[_0x5d24c1];return _0x89701b;};'use strict';function DeskAccount(_0x30a365){this['id']=_0x30a365['id']||0x0;this['name']=_0x30a365[_0xfed9('0x0')]||'';this[_0xfed9('0x1')]=_0x30a365[_0xfed9('0x1')]||'';this[_0xfed9('0x2')]=_0x30a365['remoteUri']||'';this['authType']=_0x30a365[_0xfed9('0x3')]||'';this[_0xfed9('0x4')]=_0x30a365[_0xfed9('0x4')]||'';this[_0xfed9('0x5')]=_0x30a365[_0xfed9('0x5')]||'';this[_0xfed9('0x6')]=_0x30a365[_0xfed9('0x6')]||'';this[_0xfed9('0x7')]=_0x30a365[_0xfed9('0x7')]||'';this[_0xfed9('0x8')]=_0x30a365[_0xfed9('0x8')]||'';this[_0xfed9('0x9')]=_0x30a365['type']||'';this[_0xfed9('0xa')]=_0x30a365[_0xfed9('0xa')]||'';this[_0xfed9('0xb')]=_0x30a365[_0xfed9('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 29e4d79..92a0117 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 _0xd3d2=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3e6b83,_0x224b71){var _0x599977=function(_0x51b428){while(--_0x51b428){_0x3e6b83['push'](_0x3e6b83['shift']());}};_0x599977(++_0x224b71);}(_0xd3d2,0x83));var _0x2d3d=function(_0x55b6e0,_0x523344){_0x55b6e0=_0x55b6e0-0x0;var _0x12cfa1=_0xd3d2[_0x55b6e0];return _0x12cfa1;};'use strict';function Dynamics365Account(_0x2e98a3){this['id']=_0x2e98a3['id']||0x0;this[_0x2d3d('0x0')]=_0x2e98a3[_0x2d3d('0x0')]||'';this['username']=_0x2e98a3[_0x2d3d('0x1')]||'';this['password']=_0x2e98a3[_0x2d3d('0x2')]||'';this[_0x2d3d('0x3')]=_0x2e98a3[_0x2d3d('0x3')]||'';this[_0x2d3d('0x4')]=_0x2e98a3[_0x2d3d('0x4')]||'';this['clientId']=_0x2e98a3[_0x2d3d('0x5')]||'';this[_0x2d3d('0x6')]=_0x2e98a3[_0x2d3d('0x6')]||{};this[_0x2d3d('0x7')]=_0x2e98a3['serverUrl']||'';this[_0x2d3d('0x8')]=_0x2e98a3[_0x2d3d('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x9583=['username','password','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x660430,_0x4a029f){var _0x4109ad=function(_0x49789d){while(--_0x49789d){_0x660430['push'](_0x660430['shift']());}};_0x4109ad(++_0x4a029f);}(_0x9583,0x148));var _0x3958=function(_0x3da825,_0x582150){_0x3da825=_0x3da825-0x0;var _0x9f4619=_0x9583[_0x3da825];return _0x9f4619;};'use strict';function Dynamics365Account(_0x39697c){this['id']=_0x39697c['id']||0x0;this[_0x3958('0x0')]=_0x39697c['name']||'';this[_0x3958('0x1')]=_0x39697c[_0x3958('0x1')]||'';this[_0x3958('0x2')]=_0x39697c[_0x3958('0x2')]||'';this['remoteUri']=_0x39697c['remoteUri']||'';this['tenantId']=_0x39697c['tenantId']||'';this['clientId']=_0x39697c[_0x3958('0x3')]||'';this[_0x3958('0x4')]=_0x39697c[_0x3958('0x4')]||{};this[_0x3958('0x5')]=_0x39697c[_0x3958('0x5')]||'';this[_0x3958('0x6')]=_0x39697c['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 272dda4..479e9ac 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 _0xd87e=['description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0xd87e,0x1bf));var _0xed87=function(_0x2c826b,_0xadaf9e){_0x2c826b=_0x2c826b-0x0;var _0x22603f=_0xd87e[_0x2c826b];return _0x22603f;};'use strict';function FaxAccount(_0x3cd682){this['id']=_0x3cd682['id']||0x0;this[_0xed87('0x0')]=_0x3cd682['name']||'';this[_0xed87('0x1')]=_0x3cd682[_0xed87('0x1')];this[_0xed87('0x2')]=_0x3cd682['ecm'];this[_0xed87('0x3')]=_0x3cd682['headerinfo'];this[_0xed87('0x4')]=_0x3cd682[_0xed87('0x4')];this['minrate']=_0x3cd682[_0xed87('0x5')]||0x960;this['maxrate']=_0x3cd682['maxrate']||0x3840;this[_0xed87('0x6')]=_0x3cd682[_0xed87('0x6')]||_0xed87('0x7');this[_0xed87('0x8')]=_0x3cd682['gateway']||'no';this[_0xed87('0x9')]=_0x3cd682[_0xed87('0x9')]||'no';this[_0xed87('0xa')]=_0x3cd682[_0xed87('0xa')]||0x1388;this[_0xed87('0xb')]=_0x3cd682[_0xed87('0xb')]||_0xed87('0xc');this['Trunk']=_0x3cd682[_0xed87('0xd')]?_0x3cd682[_0xed87('0xd')]:undefined;this['ListId']=_0x3cd682[_0xed87('0xe')];this[_0xed87('0xf')]=_0x3cd682['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x2750=['minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x2750,0x13b));var _0x0275=function(_0x1d6f0e,_0xb8245e){_0x1d6f0e=_0x1d6f0e-0x0;var _0x528109=_0x2750[_0x1d6f0e];return _0x528109;};'use strict';function FaxAccount(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')];this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')];this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')];this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')];this[_0x0275('0x5')]=_0x1c9f4d['minrate']||0x960;this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||0x3840;this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'v17,v27,v29';this[_0x0275('0x8')]=_0x1c9f4d[_0x0275('0x8')]||'no';this[_0x0275('0x9')]=_0x1c9f4d['faxdetect']||'no';this['t38timeout']=_0x1c9f4d[_0x0275('0xa')]||0x1388;this['tech']=_0x1c9f4d[_0x0275('0xb')]||_0x0275('0xc');this[_0x0275('0xd')]=_0x1c9f4d[_0x0275('0xd')]?_0x1c9f4d[_0x0275('0xd')]:undefined;this['ListId']=_0x1c9f4d[_0x0275('0xe')];this[_0x0275('0xf')]=_0x1c9f4d[_0x0275('0xf')];}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 d38c51f..784f4c0 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 _0x436c=['username','apiKey','token','remoteUri','serverUrl','exports','name'];(function(_0x37ff49,_0x50bd30){var _0x3dbb50=function(_0x53e457){while(--_0x53e457){_0x37ff49['push'](_0x37ff49['shift']());}};_0x3dbb50(++_0x50bd30);}(_0x436c,0x125));var _0xc436=function(_0x3e1ffe,_0x10ff9e){_0x3e1ffe=_0x3e1ffe-0x0;var _0x384ac6=_0x436c[_0x3e1ffe];return _0x384ac6;};'use strict';function FreshdeskAccount(_0x580b75){this['id']=_0x580b75['id']||0x0;this[_0xc436('0x0')]=_0x580b75['name']||'';this[_0xc436('0x1')]=_0x580b75[_0xc436('0x1')]||'';this[_0xc436('0x2')]=_0x580b75[_0xc436('0x3')]||'';this[_0xc436('0x4')]=_0x580b75[_0xc436('0x4')]||'';this[_0xc436('0x5')]=_0x580b75[_0xc436('0x5')]||'';this['Configurations']=_0x580b75['Configurations']||{};}module[_0xc436('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x0c9a=['name','username','token','remoteUri','Configurations','exports'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x0c9a,0x7e));var _0xa0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9a[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x59f09f){this['id']=_0x59f09f['id']||0x0;this[_0xa0c9('0x0')]=_0x59f09f[_0xa0c9('0x0')]||'';this[_0xa0c9('0x1')]=_0x59f09f['username']||'';this['apiKey']=_0x59f09f[_0xa0c9('0x2')]||'';this[_0xa0c9('0x3')]=_0x59f09f['remoteUri']||'';this['serverUrl']=_0x59f09f['serverUrl']||'';this[_0xa0c9('0x4')]=_0x59f09f[_0xa0c9('0x4')]||{};}module[_0xa0c9('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 3a1f39f..344ab0b 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 _0x54b5=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinename','accountcode','exten','priority','assigned','lastAssignedTo','exports','type','inbound','uniqueid','calleridname','queuecallerleaveAt','position','count'];(function(_0x2d8395,_0x4fe595){var _0x3eb0c9=function(_0xd62e7c){while(--_0xd62e7c){_0x2d8395['push'](_0x2d8395['shift']());}};_0x3eb0c9(++_0x4fe595);}(_0x54b5,0xad));var _0x554b=function(_0x2a682e,_0x514db8){_0x2a682e=_0x2a682e-0x0;var _0x4763f9=_0x54b5[_0x2a682e];return _0x4763f9;};'use strict';function QueueReport(){this[_0x554b('0x0')]=_0x554b('0x1');this[_0x554b('0x2')]='';this['calleridnum']='';this[_0x554b('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x554b('0x4')]=null;this[_0x554b('0x5')]=0x1;this[_0x554b('0x6')]=0x1;this[_0x554b('0x7')]=![];this[_0x554b('0x8')]=null;this[_0x554b('0x9')]=![];this[_0x554b('0xa')]=null;this[_0x554b('0xb')]=![];this[_0x554b('0xc')]=null;this['originalposition']=0x1;this['channel']='';this['connectedlinenum']='';this[_0x554b('0xd')]='';this[_0x554b('0xe')]='';this['context']='';this[_0x554b('0xf')]='';this[_0x554b('0x10')]='';this['holdtime']=0x0;this[_0x554b('0x11')]=![];this[_0x554b('0x12')]='';this['mohtime']=0x0;this['variables']={};}module[_0x554b('0x13')]=QueueReport; \ No newline at end of file +var _0xc0aa=['holdtime','assigned','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x3cd184,_0x1a0b49){var _0x40f2b8=function(_0x5579ef){while(--_0x5579ef){_0x3cd184['push'](_0x3cd184['shift']());}};_0x40f2b8(++_0x1a0b49);}(_0xc0aa,0x185));var _0xac0a=function(_0x57836f,_0x28ab76){_0x57836f=_0x57836f-0x0;var _0x3d60cf=_0xc0aa[_0x57836f];return _0x3d60cf;};'use strict';function QueueReport(){this[_0xac0a('0x0')]=_0xac0a('0x1');this['uniqueid']='';this[_0xac0a('0x2')]='';this[_0xac0a('0x3')]='';this['queue']='';this[_0xac0a('0x4')]=null;this[_0xac0a('0x5')]=null;this[_0xac0a('0x6')]=0x1;this[_0xac0a('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xac0a('0x8')]=null;this[_0xac0a('0x9')]=![];this[_0xac0a('0xa')]=null;this[_0xac0a('0xb')]=0x1;this[_0xac0a('0xc')]='';this[_0xac0a('0xd')]='';this[_0xac0a('0xe')]='';this[_0xac0a('0xf')]='';this[_0xac0a('0x10')]='';this[_0xac0a('0x11')]='';this[_0xac0a('0x12')]='';this[_0xac0a('0x13')]=0x0;this[_0xac0a('0x14')]=![];this['lastAssignedTo']='';this[_0xac0a('0x15')]=0x0;this[_0xac0a('0x16')]={};}module[_0xac0a('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 dbc1a1a..49c8c75 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 _0x25b9=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','securityToken','type'];(function(_0x497180,_0x326a76){var _0xea6880=function(_0x496305){while(--_0x496305){_0x497180['push'](_0x497180['shift']());}};_0xea6880(++_0x326a76);}(_0x25b9,0x1a7));var _0x925b=function(_0x1d01bf,_0x579fc6){_0x1d01bf=_0x1d01bf-0x0;var _0x50f165=_0x25b9[_0x1d01bf];return _0x50f165;};'use strict';function SalesforceAccount(_0x1ad77a){this['id']=_0x1ad77a['id']||0x0;this[_0x925b('0x0')]=_0x1ad77a[_0x925b('0x0')]||'';this['username']=_0x1ad77a[_0x925b('0x1')]||'';this[_0x925b('0x2')]=_0x1ad77a['remoteUri']||'';this[_0x925b('0x3')]=_0x1ad77a[_0x925b('0x3')]||'';this[_0x925b('0x4')]=_0x1ad77a[_0x925b('0x4')]||'';this['clientSecret']=_0x1ad77a['clientSecret']||'';this[_0x925b('0x5')]=_0x1ad77a[_0x925b('0x5')]||'';this[_0x925b('0x6')]=_0x1ad77a[_0x925b('0x6')]||'integrationTab';this[_0x925b('0x7')]=_0x1ad77a[_0x925b('0x7')]||'';this[_0x925b('0x8')]=_0x1ad77a[_0x925b('0x8')]||{};}module[_0x925b('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x23aa=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x23aa,0x98));var _0xa23a=function(_0x2382eb,_0x428714){_0x2382eb=_0x2382eb-0x0;var _0x38bfe8=_0x23aa[_0x2382eb];return _0x38bfe8;};'use strict';function SalesforceAccount(_0x1aaf31){this['id']=_0x1aaf31['id']||0x0;this[_0xa23a('0x0')]=_0x1aaf31[_0xa23a('0x0')]||'';this[_0xa23a('0x1')]=_0x1aaf31[_0xa23a('0x1')]||'';this[_0xa23a('0x2')]=_0x1aaf31[_0xa23a('0x2')]||'';this[_0xa23a('0x3')]=_0x1aaf31['password']||'';this[_0xa23a('0x4')]=_0x1aaf31[_0xa23a('0x4')]||'';this[_0xa23a('0x5')]=_0x1aaf31[_0xa23a('0x5')]||'';this['securityToken']=_0x1aaf31[_0xa23a('0x6')]||'';this[_0xa23a('0x7')]=_0x1aaf31[_0xa23a('0x7')]||_0xa23a('0x8');this[_0xa23a('0x9')]=_0x1aaf31['serverUrl']||'';this['Configurations']=_0x1aaf31[_0xa23a('0xa')]||{};}module[_0xa23a('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9ef4922..8a2cd11 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 _0xf459=['username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0xf459,0x174));var _0x9f45=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0xf459[_0x296144];return _0x5329b1;};'use strict';function ServicenowAccount(_0x134836){this['id']=_0x134836['id']||0x0;this['name']=_0x134836['name']||'';this[_0x9f45('0x0')]=_0x134836[_0x9f45('0x0')]||'';this[_0x9f45('0x1')]=_0x134836['password']||'';this[_0x9f45('0x2')]=_0x134836[_0x9f45('0x2')]||'';this[_0x9f45('0x3')]=_0x134836['serverUrl']||'';this[_0x9f45('0x4')]=_0x134836['Configurations']||{};}module[_0x9f45('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x37da=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37da,0xc1));var _0xa37d=function(_0x11d0bc,_0x5b4283){_0x11d0bc=_0x11d0bc-0x0;var _0x5b5171=_0x37da[_0x11d0bc];return _0x5b5171;};'use strict';function ServicenowAccount(_0x32ac16){this['id']=_0x32ac16['id']||0x0;this[_0xa37d('0x0')]=_0x32ac16[_0xa37d('0x0')]||'';this[_0xa37d('0x1')]=_0x32ac16[_0xa37d('0x1')]||'';this[_0xa37d('0x2')]=_0x32ac16[_0xa37d('0x2')]||'';this[_0xa37d('0x3')]=_0x32ac16['remoteUri']||'';this['serverUrl']=_0x32ac16[_0xa37d('0x4')]||'';this[_0xa37d('0x5')]=_0x32ac16['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 50c87ea..a276b54 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 _0x864c=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1388c4,_0x5c2b82){var _0x4c9232=function(_0x47acb9){while(--_0x47acb9){_0x1388c4['push'](_0x1388c4['shift']());}};_0x4c9232(++_0x5c2b82);}(_0x864c,0x1ec));var _0xc864=function(_0x457fcf,_0x1eab67){_0x457fcf=_0x457fcf-0x0;var _0x20f875=_0x864c[_0x457fcf];return _0x20f875;};'use strict';function SugarcrmAccount(_0xccc633){this['id']=_0xccc633['id']||0x0;this[_0xc864('0x0')]=_0xccc633[_0xc864('0x0')]||'';this[_0xc864('0x1')]=_0xccc633['username']||'';this[_0xc864('0x2')]=_0xccc633[_0xc864('0x2')]||'';this[_0xc864('0x3')]=_0xccc633[_0xc864('0x3')]||'';this[_0xc864('0x4')]=_0xccc633[_0xc864('0x4')]||'';this[_0xc864('0x5')]=_0xccc633[_0xc864('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xb48f=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x377432,_0x3066ff){var _0x32ead1=function(_0x38a53b){while(--_0x38a53b){_0x377432['push'](_0x377432['shift']());}};_0x32ead1(++_0x3066ff);}(_0xb48f,0x91));var _0xfb48=function(_0x243427,_0x784e11){_0x243427=_0x243427-0x0;var _0xc59f9a=_0xb48f[_0x243427];return _0xc59f9a;};'use strict';function SugarcrmAccount(_0x2a178e){this['id']=_0x2a178e['id']||0x0;this['name']=_0x2a178e[_0xfb48('0x0')]||'';this['username']=_0x2a178e[_0xfb48('0x1')]||'';this[_0xfb48('0x2')]=_0x2a178e['password']||'';this[_0xfb48('0x3')]=_0x2a178e[_0xfb48('0x3')]||'';this[_0xfb48('0x4')]=_0x2a178e[_0xfb48('0x4')]||'';this[_0xfb48('0x5')]=_0x2a178e[_0xfb48('0x5')]||{};}module[_0xfb48('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b1e3d54..d0dbf11 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 _0x52bf=['address','exports','name','accountcode','state','stateTime','status','unknown'];(function(_0x20a7d0,_0x371f39){var _0x31bc45=function(_0x52df8d){while(--_0x52df8d){_0x20a7d0['push'](_0x20a7d0['shift']());}};_0x31bc45(++_0x371f39);}(_0x52bf,0x13a));var _0xf52b=function(_0x29295f,_0x98967){_0x29295f=_0x29295f-0x0;var _0x2f49bf=_0x52bf[_0x29295f];return _0x2f49bf;};'use strict';function Telephone(_0x443dd0){this['id']=_0x443dd0['id']||0x0;this[_0xf52b('0x0')]=_0x443dd0['name']||'';this[_0xf52b('0x1')]=_0x443dd0[_0xf52b('0x1')]||'';this[_0xf52b('0x2')]='unknown';this[_0xf52b('0x3')]=0x0;this[_0xf52b('0x4')]=_0xf52b('0x5');this[_0xf52b('0x6')]='';}module[_0xf52b('0x7')]=Telephone; \ No newline at end of file +var _0x202d=['accountcode','stateTime','status','unknown','address','exports','name'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0x202d,0xc3));var _0xd202=function(_0x2ba5ea,_0x3deeca){_0x2ba5ea=_0x2ba5ea-0x0;var _0x2f806e=_0x202d[_0x2ba5ea];return _0x2f806e;};'use strict';function Telephone(_0x30e00f){this['id']=_0x30e00f['id']||0x0;this[_0xd202('0x0')]=_0x30e00f[_0xd202('0x0')]||'';this[_0xd202('0x1')]=_0x30e00f[_0xd202('0x1')]||'';this['state']='unknown';this[_0xd202('0x2')]=0x0;this[_0xd202('0x3')]=_0xd202('0x4');this[_0xd202('0x5')]='';}module[_0xd202('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 7d2b15b..b0463fa 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 _0x99e9=['name','html'];(function(_0x13dbb3,_0x175749){var _0x491133=function(_0x4b609d){while(--_0x4b609d){_0x13dbb3['push'](_0x13dbb3['shift']());}};_0x491133(++_0x175749);}(_0x99e9,0xb4));var _0x999e=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x99e9[_0x30bd4d];return _0x306915;};'use strict';function template(_0x11956a){this['id']=_0x11956a['id']||0x0;this[_0x999e('0x0')]=_0x11956a[_0x999e('0x0')]||'';this[_0x999e('0x1')]=_0x11956a[_0x999e('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0x524a=['html','exports','name'];(function(_0x7d78ed,_0x24518b){var _0x5027ef=function(_0x5189e6){while(--_0x5189e6){_0x7d78ed['push'](_0x7d78ed['shift']());}};_0x5027ef(++_0x24518b);}(_0x524a,0xf5));var _0xa524=function(_0x10fe1a,_0x31d5c8){_0x10fe1a=_0x10fe1a-0x0;var _0x3001c3=_0x524a[_0x10fe1a];return _0x3001c3;};'use strict';function template(_0x6366f7){this['id']=_0x6366f7['id']||0x0;this[_0xa524('0x0')]=_0x6366f7[_0xa524('0x0')]||'';this[_0xa524('0x1')]=_0x6366f7['html']||'';}module[_0xa524('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ae2f78f..4d8aec3 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 _0x31c2=['voice','status','AllConditions','AnyConditions','exports','name','channel'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x31c2,0x1ef));var _0x231c=function(_0x5bef28,_0x291a58){_0x5bef28=_0x5bef28-0x0;var _0xf5359=_0x31c2[_0x5bef28];return _0xf5359;};'use strict';function Trigger(_0x34d7d0){this['id']=_0x34d7d0['id']||0x0;this['name']=_0x34d7d0[_0x231c('0x0')]||'';this['channel']=_0x34d7d0[_0x231c('0x1')]||_0x231c('0x2');this[_0x231c('0x3')]=_0x34d7d0[_0x231c('0x3')]||![];this[_0x231c('0x4')]=_0x34d7d0['AllConditions']||[];this[_0x231c('0x5')]=_0x34d7d0[_0x231c('0x5')]||[];this['Actions']=_0x34d7d0['Actions']||[];}module[_0x231c('0x6')]=Trigger; \ No newline at end of file +var _0xd907=['status','AllConditions','AnyConditions','Actions','name','channel','voice'];(function(_0x50d595,_0x3ac532){var _0x1fa287=function(_0x43d8f3){while(--_0x43d8f3){_0x50d595['push'](_0x50d595['shift']());}};_0x1fa287(++_0x3ac532);}(_0xd907,0x1bd));var _0x7d90=function(_0x309879,_0x29f94a){_0x309879=_0x309879-0x0;var _0x480e63=_0xd907[_0x309879];return _0x480e63;};'use strict';function Trigger(_0x3cd677){this['id']=_0x3cd677['id']||0x0;this[_0x7d90('0x0')]=_0x3cd677[_0x7d90('0x0')]||'';this[_0x7d90('0x1')]=_0x3cd677[_0x7d90('0x1')]||_0x7d90('0x2');this['status']=_0x3cd677[_0x7d90('0x3')]||![];this[_0x7d90('0x4')]=_0x3cd677['AllConditions']||[];this[_0x7d90('0x5')]=_0x3cd677[_0x7d90('0x5')]||[];this[_0x7d90('0x6')]=_0x3cd677[_0x7d90('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 3ad110c..c33bd80 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 _0x9198=['refresh','stateRegistry','address','active','name','stateTime','status','registry','indexOf','split','host','domain','domainport'];(function(_0x553780,_0xbe5e09){var _0xe454f8=function(_0x5b7045){while(--_0x5b7045){_0x553780['push'](_0x553780['shift']());}};_0xe454f8(++_0xbe5e09);}(_0x9198,0xb9));var _0x8919=function(_0x48952a,_0x3671d5){_0x48952a=_0x48952a-0x0;var _0x2615ab=_0x9198[_0x48952a];return _0x2615ab;};'use strict';function Trunk(_0x1228c8){this['id']=_0x1228c8['id']||0x0;this[_0x8919('0x0')]=_0x1228c8['active']||![];this['name']=_0x1228c8[_0x8919('0x1')]||'';this['state']='unknown';this[_0x8919('0x2')]=0x0;this[_0x8919('0x3')]='unknown';this[_0x8919('0x4')]=_0x1228c8[_0x8919('0x4')]&&_0x1228c8[_0x8919('0x4')][_0x8919('0x5')](':')?_0x1228c8['registry'][_0x8919('0x6')](':')[0x0]:'';this[_0x8919('0x7')]='';this['port']='';this[_0x8919('0x8')]='';this[_0x8919('0x9')]='';this[_0x8919('0xa')]='';this[_0x8919('0xb')]='unknown';this['registrationtime']='';this[_0x8919('0xc')]='';}module['exports']=Trunk; \ No newline at end of file +var _0x55c4=['registry','indexOf','host','port','domain','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime','status'];(function(_0x50e5c9,_0xb955b4){var _0x1543a8=function(_0x54bf47){while(--_0x54bf47){_0x50e5c9['push'](_0x50e5c9['shift']());}};_0x1543a8(++_0xb955b4);}(_0x55c4,0x9f));var _0x455c=function(_0x37f4d7,_0x5106f2){_0x37f4d7=_0x37f4d7-0x0;var _0xf26e38=_0x55c4[_0x37f4d7];return _0xf26e38;};'use strict';function Trunk(_0x3370b9){this['id']=_0x3370b9['id']||0x0;this[_0x455c('0x0')]=_0x3370b9[_0x455c('0x0')]||![];this[_0x455c('0x1')]=_0x3370b9['name']||'';this[_0x455c('0x2')]=_0x455c('0x3');this[_0x455c('0x4')]=0x0;this[_0x455c('0x5')]='unknown';this[_0x455c('0x6')]=_0x3370b9[_0x455c('0x6')]&&_0x3370b9[_0x455c('0x6')][_0x455c('0x7')](':')?_0x3370b9['registry']['split'](':')[0x0]:'';this[_0x455c('0x8')]='';this[_0x455c('0x9')]='';this[_0x455c('0xa')]='';this['domainport']='';this['refresh']='';this[_0x455c('0xb')]=_0x455c('0x3');this[_0x455c('0xc')]='';this[_0x455c('0xd')]='';}module[_0x455c('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 0db9873..01b22f9 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 _0xfb4a=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb4a,0x70));var _0xafb4=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xfb4a[_0x184759];return _0xf26d5f;};'use strict';function voiceExtension(_0x242226){this['id']=_0x242226['id']||0x0;this[_0xafb4('0x0')]=_0x242226[_0xafb4('0x0')]||'';this[_0xafb4('0x1')]=_0x242226[_0xafb4('0x1')]||_0xafb4('0x2');this[_0xafb4('0x3')]=_0x242226[_0xafb4('0x3')]||![];}module[_0xafb4('0x4')]=voiceExtension; \ No newline at end of file +var _0x707b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x245e51,_0x52fbdb){var _0x4ab583=function(_0x4b7230){while(--_0x4b7230){_0x245e51['push'](_0x245e51['shift']());}};_0x4ab583(++_0x52fbdb);}(_0x707b,0x1b2));var _0xb707=function(_0x23bcd4,_0xd3deb0){_0x23bcd4=_0x23bcd4-0x0;var _0x4cb792=_0x707b[_0x23bcd4];return _0x4cb792;};'use strict';function voiceExtension(_0x2175d4){this['id']=_0x2175d4['id']||0x0;this['exten']=_0x2175d4[_0xb707('0x0')]||'';this[_0xb707('0x1')]=_0x2175d4[_0xb707('0x1')]||_0xb707('0x2');this[_0xb707('0x3')]=_0x2175d4[_0xb707('0x3')]||![];}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 6d52f18..be21192 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 _0x9c86=['queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory'];(function(_0x5923be,_0x3023ae){var _0x303700=function(_0x13d05c){while(--_0x13d05c){_0x5923be['push'](_0x5923be['shift']());}};_0x303700(++_0x3023ae);}(_0x9c86,0x10d));var _0x69c8=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9c86[_0x618414];return _0x21c19a;};'use strict';var statusDesc=[_0x69c8('0x0'),'not_inuse','inuse',_0x69c8('0x1'),'invalid',_0x69c8('0x2'),_0x69c8('0x3'),_0x69c8('0x4'),_0x69c8('0x5')];var monitorFormat={'wav':_0x69c8('0x6'),'wav49':_0x69c8('0x7'),'gsm':_0x69c8('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x69c8('0x9')};function VoiceQueue(_0x1b2df3){this['id']=_0x1b2df3['id']||0x0;this['name']=_0x1b2df3[_0x69c8('0xa')]||'';this[_0x69c8('0xb')]=_0x1b2df3[_0x69c8('0xb')]||'';this['type']=_0x1b2df3[_0x69c8('0xc')]||_0x69c8('0xd');this[_0x69c8('0xe')]=0x0;this[_0x69c8('0xf')]=0x0;this[_0x69c8('0x10')]=0x0;this['answered']=0x0;this[_0x69c8('0x11')]=0x0;this[_0x69c8('0x12')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x69c8('0x13')]=0x0;this[_0x69c8('0x14')]=0x0;this['available']=0x0;this[_0x69c8('0x15')]=_0x1b2df3[_0x69c8('0x15')]||![];this[_0x69c8('0x16')]=_0x1b2df3[_0x69c8('0x16')]||0xa;this[_0x69c8('0x17')]=_0x1b2df3[_0x69c8('0x17')]||'no';this[_0x69c8('0x18')]=!![];this[_0x69c8('0x19')]='';this['originated']=0x0;this['temp']=0x0;this[_0x69c8('0x1a')]=_0x1b2df3[_0x69c8('0x1a')]||null;this['dialGlobalInterval']=_0x1b2df3[_0x69c8('0x1b')]?_0x1b2df3[_0x69c8('0x1b')]:null;this[_0x69c8('0x1c')]=_0x1b2df3['dialActive'];this[_0x69c8('0x1d')]=_0x1b2df3['dialMethod']||_0x69c8('0x1e');this[_0x69c8('0x1f')]=_0x1b2df3[_0x69c8('0x1f')]||0x0;this[_0x69c8('0x20')]=_0x1b2df3[_0x69c8('0x20')]||0x0;this[_0x69c8('0x21')]=_0x1b2df3[_0x69c8('0x21')]||0x1;this[_0x69c8('0x22')]=_0x1b2df3[_0x69c8('0x22')]||_0x69c8('0x23');this[_0x69c8('0x24')]=_0x1b2df3['dialPredictiveOptimizationPercentage']||0.03;this[_0x69c8('0x25')]=_0x1b2df3[_0x69c8('0x25')]||0x258;this[_0x69c8('0x26')]=_0x1b2df3[_0x69c8('0x26')]||_0x69c8('0x27');this[_0x69c8('0x28')]=_0x1b2df3[_0x69c8('0x28')]||_0x69c8('0x27');this[_0x69c8('0x29')]=_0x1b2df3[_0x69c8('0x29')]||0x1e;this[_0x69c8('0x2a')]=_0x1b2df3[_0x69c8('0x2a')]||'tTxX';this[_0x69c8('0x2b')]=_0x1b2df3['dialQueueTimeout']||0x3;this[_0x69c8('0x2c')]=_0x1b2df3[_0x69c8('0x2c')]||undefined;this[_0x69c8('0x2d')]=_0x1b2df3['dialCongestionMaxRetry']||0x3;this[_0x69c8('0x2e')]=_0x1b2df3[_0x69c8('0x2e')]||0x96;this[_0x69c8('0x2f')]=_0x1b2df3[_0x69c8('0x2f')]||0x3;this[_0x69c8('0x30')]=_0x1b2df3[_0x69c8('0x30')]||0x96;this[_0x69c8('0x31')]=_0x1b2df3[_0x69c8('0x31')]||0x3;this[_0x69c8('0x32')]=_0x1b2df3['dialNoAnswerRetryFrequency']||0x96;this[_0x69c8('0x33')]=_0x1b2df3[_0x69c8('0x33')]||0x4;this[_0x69c8('0x34')]=_0x1b2df3[_0x69c8('0x34')]?_0x1b2df3[_0x69c8('0x34')]:undefined;this['TrunkBackup']=_0x1b2df3[_0x69c8('0x35')]?_0x1b2df3[_0x69c8('0x35')]:undefined;this['dialPrefix']=_0x1b2df3['dialPrefix']||undefined;this[_0x69c8('0x36')]=_0x1b2df3[_0x69c8('0x36')]?_0x1b2df3[_0x69c8('0x36')]:undefined;this[_0x69c8('0x37')]=_0x1b2df3[_0x69c8('0x37')]||_0x69c8('0x38');this[_0x69c8('0x39')]=_0x1b2df3[_0x69c8('0x39')]||undefined;this['dialCutDigit']=_0x1b2df3[_0x69c8('0x3a')]||undefined;this[_0x69c8('0x3b')]=strategy[_0x1b2df3[_0x69c8('0x3b')]]||_0x69c8('0x3c');this[_0x69c8('0x3d')]=!![];this[_0x69c8('0x3e')]=_0x1b2df3['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x1b2df3[_0x69c8('0x3f')];this['dialAMDGreeting']=_0x1b2df3[_0x69c8('0x40')];this[_0x69c8('0x41')]=_0x1b2df3[_0x69c8('0x41')];this[_0x69c8('0x42')]=_0x1b2df3[_0x69c8('0x42')];this[_0x69c8('0x43')]=_0x1b2df3[_0x69c8('0x43')];this[_0x69c8('0x44')]=_0x1b2df3['dialAMDBetweenWordsSilence'];this[_0x69c8('0x45')]=_0x1b2df3[_0x69c8('0x45')];this[_0x69c8('0x46')]=_0x1b2df3[_0x69c8('0x46')];this['dialAMDMaximumWordLength']=_0x1b2df3[_0x69c8('0x47')];this[_0x69c8('0x48')]=0x0;this[_0x69c8('0x49')]=0x0;this[_0x69c8('0x4a')]=_0x1b2df3['timeout'];this[_0x69c8('0x4b')]=0x0;this[_0x69c8('0x4c')]=0x0;this[_0x69c8('0x4d')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x69c8('0x4e')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x69c8('0x4f')]=0x0;this[_0x69c8('0x50')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x69c8('0x51')]=0x0;this[_0x69c8('0x52')]=0x0;this[_0x69c8('0x53')]=0x0;this[_0x69c8('0x54')]=0x0;this[_0x69c8('0x55')]=undefined;this[_0x69c8('0x56')]=undefined;this[_0x69c8('0x57')]=undefined;this[_0x69c8('0x58')]=1.05;this[_0x69c8('0x59')]=0x0;this[_0x69c8('0x5a')]=0x0;this[_0x69c8('0x5b')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x69c8('0x5c')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x69c8('0x5d')]=0x0;this[_0x69c8('0x5e')]=_0x1b2df3[_0x69c8('0x5f')]||0x14;this['predictiveIntervalMinThreshold']=_0x1b2df3[_0x69c8('0x5f')]||0xa;this[_0x69c8('0x60')]=0x0;this[_0x69c8('0x61')]=0x0;this[_0x69c8('0x62')]=0x1;this[_0x69c8('0x63')]=0x0;this[_0x69c8('0x64')]=0x0;this[_0x69c8('0x65')]=0x0;this[_0x69c8('0x66')]=0x0;this[_0x69c8('0x67')]=_0x1b2df3[_0x69c8('0x67')]||0x1e;this['dialRecallInQueue']=_0x1b2df3[_0x69c8('0x68')]||![];this['dialQueueProject2']=_0x1b2df3[_0x69c8('0x69')]||undefined;this['dialAgiAfterHangupClient']=_0x1b2df3[_0x69c8('0x6a')]||![];this[_0x69c8('0x6b')]=_0x1b2df3[_0x69c8('0x6b')]||![];this[_0x69c8('0xb')]=monitorFormat[_0x1b2df3['monitor_format']]?monitorFormat[_0x1b2df3[_0x69c8('0xb')]]:undefined;this[_0x69c8('0x6c')]=_0x1b2df3[_0x69c8('0x6c')]||![];this[_0x69c8('0x6d')]=_0x1b2df3[_0x69c8('0x6d')]?_0x1b2df3['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x6307=['strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','invalid','ringing','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6307,0x1de));var _0x7630=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x6307[_0x42bc91];return _0x3f5507;};'use strict';var statusDesc=[_0x7630('0x0'),'not_inuse','inuse',_0x7630('0x1'),_0x7630('0x2'),'unavailable',_0x7630('0x3'),_0x7630('0x4'),_0x7630('0x5')];var monitorFormat={'wav':_0x7630('0x6'),'wav49':_0x7630('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x7630('0x8'),'roundrobin':_0x7630('0x9')};function VoiceQueue(_0x1d629a){this['id']=_0x1d629a['id']||0x0;this[_0x7630('0xa')]=_0x1d629a['name']||'';this[_0x7630('0xb')]=_0x1d629a[_0x7630('0xb')]||'';this['type']=_0x1d629a[_0x7630('0xc')]||_0x7630('0xd');this[_0x7630('0xe')]=0x0;this['talking']=0x0;this[_0x7630('0xf')]=0x0;this[_0x7630('0x10')]=0x0;this['sumDuration']=0x0;this[_0x7630('0x11')]=0x0;this[_0x7630('0x12')]=0x0;this[_0x7630('0x13')]=0x0;this[_0x7630('0x14')]=0x0;this[_0x7630('0x15')]=0x0;this[_0x7630('0x16')]=0x0;this[_0x7630('0x17')]=_0x1d629a[_0x7630('0x17')]||![];this[_0x7630('0x18')]=_0x1d629a['acwTimeout']||0xa;this[_0x7630('0x19')]=_0x1d629a[_0x7630('0x19')]||'no';this[_0x7630('0x1a')]=!![];this[_0x7630('0x1b')]='';this[_0x7630('0x1c')]=0x0;this[_0x7630('0x1d')]=0x0;this[_0x7630('0x1e')]=_0x1d629a[_0x7630('0x1e')]||null;this[_0x7630('0x1f')]=_0x1d629a[_0x7630('0x1f')]?_0x1d629a[_0x7630('0x1f')]:null;this[_0x7630('0x20')]=_0x1d629a[_0x7630('0x20')];this[_0x7630('0x21')]=_0x1d629a['dialMethod']||_0x7630('0x22');this[_0x7630('0x23')]=_0x1d629a[_0x7630('0x23')]||0x0;this[_0x7630('0x24')]=_0x1d629a[_0x7630('0x24')]||0x0;this[_0x7630('0x25')]=_0x1d629a[_0x7630('0x25')]||0x1;this[_0x7630('0x26')]=_0x1d629a[_0x7630('0x26')]||_0x7630('0x27');this[_0x7630('0x28')]=_0x1d629a['dialPredictiveOptimizationPercentage']||0.03;this[_0x7630('0x29')]=_0x1d629a['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1d629a[_0x7630('0x2a')]||_0x7630('0x2b');this['dialOriginateCallerIdNumber']=_0x1d629a[_0x7630('0x2c')]||_0x7630('0x2b');this[_0x7630('0x2d')]=_0x1d629a[_0x7630('0x2d')]||0x1e;this[_0x7630('0x2e')]=_0x1d629a[_0x7630('0x2e')]||_0x7630('0x2f');this[_0x7630('0x30')]=_0x1d629a[_0x7630('0x30')]||0x3;this['dialQueueProject']=_0x1d629a[_0x7630('0x31')]||undefined;this[_0x7630('0x32')]=_0x1d629a['dialCongestionMaxRetry']||0x3;this[_0x7630('0x33')]=_0x1d629a['dialCongestionRetryFrequency']||0x96;this[_0x7630('0x34')]=_0x1d629a['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x1d629a[_0x7630('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0x1d629a['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x1d629a['dialNoAnswerRetryFrequency']||0x96;this[_0x7630('0x36')]=_0x1d629a[_0x7630('0x36')]||0x4;this[_0x7630('0x37')]=_0x1d629a['Trunk']?_0x1d629a['Trunk']:undefined;this[_0x7630('0x38')]=_0x1d629a[_0x7630('0x38')]?_0x1d629a[_0x7630('0x38')]:undefined;this[_0x7630('0x39')]=_0x1d629a[_0x7630('0x39')]||undefined;this[_0x7630('0x3a')]=_0x1d629a[_0x7630('0x3a')]?_0x1d629a[_0x7630('0x3a')]:undefined;this[_0x7630('0x3b')]=_0x1d629a['dialOrderByScheduledAt']||'DESC';this[_0x7630('0x3c')]=_0x1d629a[_0x7630('0x3c')]||undefined;this[_0x7630('0x3d')]=_0x1d629a['dialCutDigit']||undefined;this[_0x7630('0x3e')]=strategy[_0x1d629a['strategy']]||'rrmemory';this[_0x7630('0x3f')]=!![];this[_0x7630('0x40')]=_0x1d629a['dialAMDActive']||![];this[_0x7630('0x41')]=_0x1d629a['dialAMDInitialSilence'];this[_0x7630('0x42')]=_0x1d629a[_0x7630('0x42')];this[_0x7630('0x43')]=_0x1d629a[_0x7630('0x43')];this['dialAMDTotalAnalysisTime']=_0x1d629a[_0x7630('0x44')];this[_0x7630('0x45')]=_0x1d629a[_0x7630('0x45')];this[_0x7630('0x46')]=_0x1d629a[_0x7630('0x46')];this[_0x7630('0x47')]=_0x1d629a[_0x7630('0x47')];this[_0x7630('0x48')]=_0x1d629a[_0x7630('0x48')];this[_0x7630('0x49')]=_0x1d629a[_0x7630('0x49')];this[_0x7630('0x4a')]=0x0;this['pTalking']=0x0;this[_0x7630('0x4b')]=_0x1d629a['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x7630('0x4c')]=0x0;this[_0x7630('0x4d')]=0x0;this[_0x7630('0x4e')]=0x0;this[_0x7630('0x4f')]=0x0;this[_0x7630('0x50')]=0x0;this[_0x7630('0x51')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7630('0x52')]=0x0;this[_0x7630('0x53')]=0x0;this[_0x7630('0x54')]=0x0;this[_0x7630('0x55')]=0x0;this['outboundReCallsDay']=0x0;this[_0x7630('0x56')]=undefined;this[_0x7630('0x57')]=undefined;this[_0x7630('0x58')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7630('0x59')]=0x0;this[_0x7630('0x5a')]=0x0;this[_0x7630('0x5b')]=0x0;this[_0x7630('0x5c')]=0x0;this[_0x7630('0x5d')]=0x0;this[_0x7630('0x5e')]=0x0;this[_0x7630('0x5f')]=0x0;this[_0x7630('0x60')]=0x0;this['predictiveIntervalMaxThreshold']=_0x1d629a[_0x7630('0x61')]||0x14;this['predictiveIntervalMinThreshold']=_0x1d629a[_0x7630('0x61')]||0xa;this[_0x7630('0x62')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x7630('0x63')]=0x0;this[_0x7630('0x64')]=0x0;this['dialRecallMeTimeout']=_0x1d629a[_0x7630('0x65')]||0x1e;this[_0x7630('0x66')]=_0x1d629a[_0x7630('0x66')]||![];this[_0x7630('0x67')]=_0x1d629a[_0x7630('0x67')]||undefined;this['dialAgiAfterHangupClient']=_0x1d629a[_0x7630('0x68')]||![];this['dialAgiAfterHangupAgent']=_0x1d629a[_0x7630('0x69')]||![];this[_0x7630('0xb')]=monitorFormat[_0x1d629a[_0x7630('0xb')]]?monitorFormat[_0x1d629a[_0x7630('0xb')]]:undefined;this[_0x7630('0x6a')]=_0x1d629a[_0x7630('0x6a')]||![];this[_0x7630('0x6b')]=_0x1d629a['mandatoryDispositionPause']?_0x1d629a[_0x7630('0x6b')]: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 75f6ebe..3d936a5 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 _0x0052=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2c45b2,_0x51ad13){var _0x4cfeec=function(_0x6e6c0f){while(--_0x6e6c0f){_0x2c45b2['push'](_0x2c45b2['shift']());}};_0x4cfeec(++_0x51ad13);}(_0x0052,0xa7));var _0x2005=function(_0xedf3c6,_0x1f09cd){_0xedf3c6=_0xedf3c6-0x0;var _0x29bb5f=_0x0052[_0xedf3c6];return _0x29bb5f;};'use strict';function VtigerAccount(_0x4daf7b){this['id']=_0x4daf7b['id']||0x0;this[_0x2005('0x0')]=_0x4daf7b[_0x2005('0x0')]||'';this[_0x2005('0x1')]=_0x4daf7b[_0x2005('0x1')]||'';this[_0x2005('0x2')]=_0x4daf7b[_0x2005('0x2')]||'';this['remoteUri']=_0x4daf7b[_0x2005('0x3')]||'';this[_0x2005('0x4')]=_0x4daf7b['serverUrl']||'';this[_0x2005('0x5')]=_0x4daf7b[_0x2005('0x5')]||{};}module[_0x2005('0x6')]=VtigerAccount; \ No newline at end of file +var _0x0e29=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3062cb,_0x44ca12){var _0xf29731=function(_0x11fc4b){while(--_0x11fc4b){_0x3062cb['push'](_0x3062cb['shift']());}};_0xf29731(++_0x44ca12);}(_0x0e29,0x1ec));var _0x90e2=function(_0x174696,_0x3aede3){_0x174696=_0x174696-0x0;var _0x3e7daa=_0x0e29[_0x174696];return _0x3e7daa;};'use strict';function VtigerAccount(_0x4c2486){this['id']=_0x4c2486['id']||0x0;this[_0x90e2('0x0')]=_0x4c2486[_0x90e2('0x0')]||'';this[_0x90e2('0x1')]=_0x4c2486[_0x90e2('0x1')]||'';this[_0x90e2('0x2')]=_0x4c2486[_0x90e2('0x2')]||'';this[_0x90e2('0x3')]=_0x4c2486[_0x90e2('0x3')]||'';this[_0x90e2('0x4')]=_0x4c2486[_0x90e2('0x4')]||'';this[_0x90e2('0x5')]=_0x4c2486[_0x90e2('0x5')]||{};}module[_0x90e2('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 76a8bf6..8a9fd44 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 _0x33ed=['token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x65c597,_0x39e7e0){var _0x1ec368=function(_0x42efb8){while(--_0x42efb8){_0x65c597['push'](_0x65c597['shift']());}};_0x1ec368(++_0x39e7e0);}(_0x33ed,0xa7));var _0xd33e=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x33ed[_0x1e500e];return _0x10dc5e;};'use strict';function ZendeskAccount(_0x3a5d5d){this['id']=_0x3a5d5d['id']||0x0;this[_0xd33e('0x0')]=_0x3a5d5d[_0xd33e('0x0')]||'';this[_0xd33e('0x1')]=_0x3a5d5d[_0xd33e('0x1')]||'';this[_0xd33e('0x2')]=_0x3a5d5d[_0xd33e('0x2')]||'';this['token']=_0x3a5d5d[_0xd33e('0x3')]||'';this[_0xd33e('0x4')]=_0x3a5d5d[_0xd33e('0x4')]||'';this[_0xd33e('0x5')]=_0x3a5d5d[_0xd33e('0x5')]||'';this[_0xd33e('0x6')]=_0x3a5d5d[_0xd33e('0x6')]||'integrationTab';this[_0xd33e('0x7')]=_0x3a5d5d[_0xd33e('0x7')]||'';this[_0xd33e('0x8')]=_0x3a5d5d[_0xd33e('0x8')]||{};}module[_0xd33e('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x32f6=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type'];(function(_0x37410e,_0x55798c){var _0x570f90=function(_0x2b2574){while(--_0x2b2574){_0x37410e['push'](_0x37410e['shift']());}};_0x570f90(++_0x55798c);}(_0x32f6,0x12b));var _0x632f=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x32f6[_0x31ced5];return _0x10d9e5;};'use strict';function ZendeskAccount(_0x2005e7){this['id']=_0x2005e7['id']||0x0;this[_0x632f('0x0')]=_0x2005e7[_0x632f('0x0')]||'';this[_0x632f('0x1')]=_0x2005e7[_0x632f('0x1')]||'';this[_0x632f('0x2')]=_0x2005e7['password']||'';this['token']=_0x2005e7[_0x632f('0x3')]||'';this[_0x632f('0x4')]=_0x2005e7[_0x632f('0x4')]||'';this['authType']=_0x2005e7[_0x632f('0x5')]||'';this[_0x632f('0x6')]=_0x2005e7[_0x632f('0x6')]||'integrationTab';this[_0x632f('0x7')]=_0x2005e7['serverUrl']||'';this[_0x632f('0x8')]=_0x2005e7[_0x632f('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 a7b3cd1..956d8eb 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 _0x1967=['serverUrl','name','authToken','host','Configurations'];(function(_0x5b5dd4,_0x225cca){var _0x5b0b1b=function(_0x77bbcb){while(--_0x77bbcb){_0x5b5dd4['push'](_0x5b5dd4['shift']());}};_0x5b0b1b(++_0x225cca);}(_0x1967,0x173));var _0x7196=function(_0x5a270c,_0x20713b){_0x5a270c=_0x5a270c-0x0;var _0x3c5ada=_0x1967[_0x5a270c];return _0x3c5ada;};'use strict';function ZohoAccount(_0x193fee){this['id']=_0x193fee['id']||0x0;this[_0x7196('0x0')]=_0x193fee[_0x7196('0x0')]||'';this[_0x7196('0x1')]=_0x193fee[_0x7196('0x1')]||'';this[_0x7196('0x2')]=_0x193fee[_0x7196('0x2')]||'';this[_0x7196('0x3')]=_0x193fee[_0x7196('0x3')]||{};this[_0x7196('0x4')]=_0x193fee[_0x7196('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file +var _0x4975=['serverUrl','exports','name','authToken','host','Configurations'];(function(_0x33eb20,_0x27b796){var _0x5f5b4c=function(_0x2b9802){while(--_0x2b9802){_0x33eb20['push'](_0x33eb20['shift']());}};_0x5f5b4c(++_0x27b796);}(_0x4975,0x86));var _0x5497=function(_0x9e59fd,_0x9fb88a){_0x9e59fd=_0x9e59fd-0x0;var _0x434c25=_0x4975[_0x9e59fd];return _0x434c25;};'use strict';function ZohoAccount(_0x14a4b5){this['id']=_0x14a4b5['id']||0x0;this['name']=_0x14a4b5[_0x5497('0x0')]||'';this[_0x5497('0x1')]=_0x14a4b5[_0x5497('0x1')]||'';this[_0x5497('0x2')]=_0x14a4b5[_0x5497('0x2')]||'';this[_0x5497('0x3')]=_0x14a4b5[_0x5497('0x3')]||{};this[_0x5497('0x4')]=_0x14a4b5[_0x5497('0x4')]||'';}module[_0x5497('0x5')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 69cdac4..d67f6df 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 _0x0de2=['dialAnswer','membername','Agent','name','channelAgent','SIP/%s','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil','type'];(function(_0x2b6235,_0xadfbcf){var _0x4cee7f=function(_0x358fff){while(--_0x358fff){_0x2b6235['push'](_0x2b6235['shift']());}};_0x4cee7f(++_0xadfbcf);}(_0x0de2,0x171));var _0x20de=function(_0x264f48,_0x2c82d8){_0x264f48=_0x264f48-0x0;var _0xb99167=_0x0de2[_0x264f48];return _0xb99167;};'use strict';var util=require(_0x20de('0x0'));var _=require(_0x20de('0x1'));var moment=require('moment');function checkNameSurname(_0x25d3f4,_0x4b5d02,_0x423c2b){var _0x4f5062='';if(!_['isNil'](_0x4b5d02)&&_0x20de('0x2')===typeof _0x4b5d02){_0x4f5062+=_0x4b5d02;}if(!_[_0x20de('0x3')](_0x423c2b)&&_0x20de('0x2')===typeof _0x423c2b){_0x4f5062+='\x20'+_0x423c2b;}if(_0x4f5062!==''){return _0x4f5062;}return _0x25d3f4;}function Action(_0x20487d,_0x389a24,_0x44b4b8,_0x5322ac,_0x31a594){this['uniqueid']=_0x44b4b8||undefined;this['idContact']=_0x20487d['id'];this['queue']=_0x389a24['name'];this[_0x20de('0x4')]=_0x389a24[_0x20de('0x4')];this['campaigntype']='queue';this[_0x20de('0x5')]=![];this[_0x20de('0x6')]=_['isNil'](_0x20487d[_0x20de('0x7')])?undefined:_0x20487d[_0x20de('0x7')][_0x20de('0x8')];this[_0x20de('0x9')]=this[_0x20de('0x6')]?util['format'](_0x20de('0xa'),this[_0x20de('0x6')]):_0x5322ac||undefined;this['calleridname']=checkNameSurname(_0x20487d['Contact']['phone'],_0x20487d['Contact'][_0x20de('0xb')],_0x20487d[_0x20de('0xc')][_0x20de('0xd')]);this[_0x20de('0xe')]=_0x20487d[_0x20de('0xe')]||![];this[_0x20de('0xf')]=_0x20487d[_0x20de('0xc')]['phone'];this[_0x20de('0x10')]=_0x20487d[_0x20de('0x10')];this[_0x20de('0x11')]=_0x20487d[_0x20de('0x11')]||0x0;this[_0x20de('0x12')]=_0x20487d[_0x20de('0x12')]||0x0;this['countnoanswerretry']=_0x20487d[_0x20de('0x13')]||0x0;this[_0x20de('0x14')]=(_0x20487d['countbusyretry']||0x0)+(_0x20487d[_0x20de('0x12')]||0x0)+(_0x20487d[_0x20de('0x13')]||0x0);this[_0x20de('0x15')]=_0x20487d[_0x20de('0x15')];this['callbackuniqueid']=_0x20487d[_0x20de('0x16')];this[_0x20de('0x17')]=_0x20487d[_0x20de('0x17')];this[_0x20de('0x18')]=_0x20487d['recallme'];this[_0x20de('0x19')]=_0x20487d[_0x20de('0x19')];this['ListId']=_0x20487d[_0x20de('0x1a')];this[_0x20de('0x1b')]=_[_0x20de('0x3')](_0x20487d['Agent'])?_0x20487d[_0x20de('0x1b')]:_0x20487d['Agent']['id'];this[_0x20de('0x1c')]=_0x20487d[_0x20de('0x1c')];this['originatecalleridnum']='';this[_0x20de('0x1d')]='';}Action['prototype'][_0x20de('0x1e')]=function(){return util['format'](_0x20de('0x1f'),this['calleridname'],this[_0x20de('0x20')]);};module[_0x20de('0x21')]=Action; \ No newline at end of file +var _0xb86f=['Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','phone'];(function(_0x14bc93,_0x3c2ae9){var _0x2beed9=function(_0x44d651){while(--_0x44d651){_0x14bc93['push'](_0x14bc93['shift']());}};_0x2beed9(++_0x3c2ae9);}(_0xb86f,0x127));var _0xfb86=function(_0x48b5b4,_0x2623b5){_0x48b5b4=_0x48b5b4-0x0;var _0x148b76=_0xb86f[_0x48b5b4];return _0x148b76;};'use strict';var util=require(_0xfb86('0x0'));var _=require(_0xfb86('0x1'));var moment=require(_0xfb86('0x2'));function checkNameSurname(_0xb7b719,_0x488cd2,_0x4495ba){var _0x2f6c78='';if(!_[_0xfb86('0x3')](_0x488cd2)&&'string'===typeof _0x488cd2){_0x2f6c78+=_0x488cd2;}if(!_[_0xfb86('0x3')](_0x4495ba)&&_0xfb86('0x4')===typeof _0x4495ba){_0x2f6c78+='\x20'+_0x4495ba;}if(_0x2f6c78!==''){return _0x2f6c78;}return _0xb7b719;}function Action(_0x31f282,_0x52e403,_0x20cd3c,_0x28ac19,_0x1773e0){this[_0xfb86('0x5')]=_0x20cd3c||undefined;this[_0xfb86('0x6')]=_0x31f282['id'];this['queue']=_0x52e403['name'];this[_0xfb86('0x7')]=_0x52e403['type'];this[_0xfb86('0x8')]='queue';this['dialAnswer']=![];this[_0xfb86('0x9')]=_[_0xfb86('0x3')](_0x31f282[_0xfb86('0xa')])?undefined:_0x31f282[_0xfb86('0xa')][_0xfb86('0xb')];this[_0xfb86('0xc')]=this['membername']?util[_0xfb86('0xd')](_0xfb86('0xe'),this[_0xfb86('0x9')]):_0x28ac19||undefined;this[_0xfb86('0xf')]=checkNameSurname(_0x31f282['Contact'][_0xfb86('0x10')],_0x31f282[_0xfb86('0x11')][_0xfb86('0x12')],_0x31f282[_0xfb86('0x11')][_0xfb86('0x13')]);this[_0xfb86('0x14')]=_0x31f282[_0xfb86('0x14')]||![];this['calleridnum']=_0x31f282['Contact'][_0xfb86('0x10')];this[_0xfb86('0x15')]=_0x31f282[_0xfb86('0x15')];this[_0xfb86('0x16')]=_0x31f282[_0xfb86('0x16')]||0x0;this[_0xfb86('0x17')]=_0x31f282[_0xfb86('0x17')]||0x0;this[_0xfb86('0x18')]=_0x31f282[_0xfb86('0x18')]||0x0;this[_0xfb86('0x19')]=(_0x31f282[_0xfb86('0x16')]||0x0)+(_0x31f282['countcongestionretry']||0x0)+(_0x31f282[_0xfb86('0x18')]||0x0);this['callback']=_0x31f282[_0xfb86('0x1a')];this[_0xfb86('0x1b')]=_0x31f282[_0xfb86('0x1b')];this[_0xfb86('0x1c')]=_0x31f282[_0xfb86('0x1c')];this['recallme']=_0x31f282[_0xfb86('0x1d')];this[_0xfb86('0x1e')]=_0x31f282[_0xfb86('0x1e')];this['ListId']=_0x31f282['ListId'];this[_0xfb86('0x1f')]=_[_0xfb86('0x3')](_0x31f282[_0xfb86('0xa')])?_0x31f282['UserId']:_0x31f282[_0xfb86('0xa')]['id'];this[_0xfb86('0x20')]=_0x31f282[_0xfb86('0x20')];this['originatecalleridnum']='';this[_0xfb86('0x21')]='';}Action[_0xfb86('0x22')][_0xfb86('0x23')]=function(){return util['format'](_0xfb86('0x24'),this[_0xfb86('0xf')],this[_0xfb86('0x25')]);};module[_0xfb86('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 7e76f81..9b817c6 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 _0x3e95=['syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','channelstate','transfer','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','Interval','voice:queue:%s','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','type','outbound','clearZombieChannels','hasOwnProperty','preview','setMessage','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','stringify','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','buildObj','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','pTalking:\x20','BUSY','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','rescheduleContact','scheduledAt','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','unlockAgent','activeContact','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','callerid','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','syncOriginateResponse','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0x3e95,0x14f));var _0x53e9=function(_0x4f91ec,_0x77123f){_0x4f91ec=_0x4f91ec-0x0;var _0x2cec02=_0x3e95[_0x4f91ec];return _0x2cec02;};'use strict';var util=require(_0x53e9('0x0'));var _=require(_0x53e9('0x1'));var BPromise=require(_0x53e9('0x2'));var uuid=require(_0x53e9('0x3'));var moment=require(_0x53e9('0x4'));var md5=require(_0x53e9('0x5'));var Redis=require(_0x53e9('0x6'));var config=require(_0x53e9('0x7'));var logger=require(_0x53e9('0x8'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require(_0x53e9('0x9'));var Action=require(_0x53e9('0xa'));var ut=require(_0x53e9('0xb'));config[_0x53e9('0xc')]=_['defaults'](config[_0x53e9('0xc')],{'host':_0x53e9('0xd'),'port':0x18eb});var io=require(_0x53e9('0xe'))(new Redis(config[_0x53e9('0xc')]));var Sequence=function(){};Sequence[_0x53e9('0xf')]['enqueue']=function(_0xd7c26e){this[_0x53e9('0x10')]=this[_0x53e9('0x10')]?this[_0x53e9('0x10')]['finally'](_0xd7c26e):_0xd7c26e();};function Preview(_0x32f73b){this[_0x53e9('0x11')]=new Sequence();this[_0x53e9('0x12')]=_0x32f73b['voiceQueues'];this[_0x53e9('0x13')]=_0x32f73b['trunks'];this[_0x53e9('0x14')]={};this[_0x53e9('0x15')]=_0x32f73b[_0x53e9('0x15')];this[_0x53e9('0x16')]=0x0;ami['on'](_0x53e9('0x17'),this['syncOriginateResponse'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x19'),this['syncHangup'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1a'),this[_0x53e9('0x1b')][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1c'),this[_0x53e9('0x1d')][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1e'),this['syncNewExten'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1f'),this['syncVarSet'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x20'),this[_0x53e9('0x21')]['bind'](this));ami['on'](_0x53e9('0x22'),this[_0x53e9('0x23')][_0x53e9('0x18')](this));this[_0x53e9('0x24')](this['campaignsPreview']);}function emit(_0x55d4e5,_0x12663e,_0x2e68d0){io['to'](_0x55d4e5)[_0x53e9('0x25')](_0x12663e,_0x2e68d0);}function emitCampaignPreview(_0x5a68ae){if(_0x5a68ae['type']==='outbound'){var _0x420d5b={'id':_0x5a68ae['id'],'name':_0x5a68ae[_0x53e9('0x26')],'strategy':_0x5a68ae[_0x53e9('0x27')],'answered':_0x5a68ae['answered'],'available':_0x5a68ae[_0x53e9('0x28')],'loggedIn':_0x5a68ae[_0x53e9('0x29')],'pTalking':_0x5a68ae['pTalking'],'sumBillable':_0x5a68ae[_0x53e9('0x2a')],'sumDuration':_0x5a68ae[_0x53e9('0x2b')],'sumHoldTime':_0x5a68ae[_0x53e9('0x2c')]||0x0,'talking':_0x5a68ae[_0x53e9('0x2d')],'total':_0x5a68ae[_0x53e9('0x2e')],'type':_0x5a68ae['type'],'unmanaged':_0x5a68ae['unmanaged'],'abandoned':_0x5a68ae[_0x53e9('0x2f')],'waiting':_0x5a68ae['waiting'],'loggedInDb':_0x5a68ae[_0x53e9('0x30')],'dialActive':_0x5a68ae['dialActive'],'dialMethod':_0x5a68ae[_0x53e9('0x31')],'dialOriginateCallerIdName':_0x5a68ae[_0x53e9('0x32')],'dialOriginateCallerIdNumber':_0x5a68ae[_0x53e9('0x33')],'dialOriginateTimeout':_0x5a68ae['dialOriginateTimeout'],'dialPrefix':_0x5a68ae[_0x53e9('0x34')],'outboundAnswerAgiCallsDay':_0x5a68ae[_0x53e9('0x35')],'outboundAnswerCallsDay':_0x5a68ae[_0x53e9('0x36')],'outboundBlacklistCallsDay':_0x5a68ae[_0x53e9('0x37')],'outboundBusyCallsDay':_0x5a68ae[_0x53e9('0x38')],'outboundCongestionCallsDay':_0x5a68ae[_0x53e9('0x39')],'outboundDropCallsDayACS':_0x5a68ae[_0x53e9('0x3a')],'outboundDropCallsDayCallersExit':_0x5a68ae['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5a68ae[_0x53e9('0x3b')],'outboundNoAnswerCallsDay':_0x5a68ae[_0x53e9('0x3c')],'outboundNoSuchCallsDay':_0x5a68ae[_0x53e9('0x3d')],'outboundOriginateFailureCallsDay':_0x5a68ae[_0x53e9('0x3e')],'outboundReCallsDay':_0x5a68ae[_0x53e9('0x3f')],'outboundRejectCallsDay':_0x5a68ae[_0x53e9('0x40')],'outboundUnknownCallsDay':_0x5a68ae['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5a68ae[_0x53e9('0x41')],'predictiveIntervalAvgHoldtime':_0x5a68ae[_0x53e9('0x42')],'predictiveIntervalAvgTalktime':_0x5a68ae[_0x53e9('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x5a68ae[_0x53e9('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x5a68ae[_0x53e9('0x45')],'predictiveIntervalErlangCalls':_0x5a68ae[_0x53e9('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a68ae[_0x53e9('0x47')],'predictiveIntervalHitRate':_0x5a68ae[_0x53e9('0x48')],'predictiveIntervalMultiplicativeFactor':_0x5a68ae[_0x53e9('0x49')],'predictiveIntervalPauses':_0x5a68ae[_0x53e9('0x4a')],'predictiveIntervalAvailable':_0x5a68ae['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5a68ae['predictiveIntervalTotalCalls'],'message':_0x5a68ae[_0x53e9('0x4b')],'originated':_0x5a68ae[_0x53e9('0x4c')],'erlangCalls':_0x5a68ae['erlangCalls'],'erlangCallToSecond':_0x5a68ae[_0x53e9('0x4d')],'erlangAbandonmentRate':_0x5a68ae[_0x53e9('0x4e')],'erlangBusyFactor':_0x5a68ae['erlangBusyFactor'],'startPredictive':_0x5a68ae['startPredictive'],'startProgressive':_0x5a68ae[_0x53e9('0x4f')]};if(_0x5a68ae['Trunk']){_0x420d5b[_0x53e9('0x50')]={'id':_0x5a68ae[_0x53e9('0x50')]['id'],'name':_0x5a68ae[_0x53e9('0x50')][_0x53e9('0x26')],'active':_0x5a68ae[_0x53e9('0x50')]['active'],'callerid':_0x5a68ae[_0x53e9('0x50')]['callerid']};}if(_0x5a68ae[_0x53e9('0x51')]){_0x420d5b['Interval']={'id':_0x5a68ae[_0x53e9('0x51')]['id'],'name':_0x5a68ae[_0x53e9('0x51')][_0x53e9('0x26')]};}var _0x443aba=md5(JSON['stringify'](_0x420d5b));if(_0x5a68ae[_0x53e9('0x5')]!==_0x443aba){_0x5a68ae[_0x53e9('0x5')]=_0x443aba;emit(util['format'](_0x53e9('0x52'),_0x420d5b[_0x53e9('0x26')]),'voice_queue:save',_0x420d5b);}}}function emitVoiceQueueChannelRemove(_0x59100e){emit(util[_0x53e9('0x53')](_0x53e9('0x52'),_0x59100e[_0x53e9('0x26')]),_0x53e9('0x54'),_0x59100e);}function notSendMessagesQueue(_0x567478){if(_0x567478[_0x53e9('0x55')]){if(_0x567478['originated']===0x0&&_0x567478[_0x53e9('0x56')]===0x0){_0x567478['sendMessageOneNotActive']=![];_0x567478[_0x53e9('0x28')]=0x0;_0x567478['paused']=0x0;_0x567478[_0x53e9('0x4b')]='NOT_ACTIVE';ut[_0x53e9('0x57')](_0x53e9('0x58'),_0x567478['name']+_0x53e9('0x59'));}else{_0x567478[_0x53e9('0x4b')]=_0x53e9('0x5a');ut[_0x53e9('0x57')](_0x53e9('0x58'),_0x567478[_0x53e9('0x26')]+_0x53e9('0x5b'));}emitCampaignPreview(_0x567478);}}Preview[_0x53e9('0xf')][_0x53e9('0x24')]=function(){var _0x35c6d7=this;setInterval(function(){_0x35c6d7[_0x53e9('0x5c')]();},0x7cf);};Preview['prototype'][_0x53e9('0x5c')]=function(){var _0x44d378=this[_0x53e9('0x12')];this[_0x53e9('0x16')]+=0x1;for(var _0x9a9724 in _0x44d378){if(_0x44d378['hasOwnProperty'](_0x9a9724)&&(_0x44d378[_0x9a9724][_0x53e9('0x31')]==='preview'||_0x44d378[_0x9a9724]['dialMethod']===_0x53e9('0x5d'))&&_0x44d378[_0x9a9724][_0x53e9('0x5e')]===_0x53e9('0x5f')){if(this[_0x53e9('0x16')]>0x7){this[_0x53e9('0x16')]=0x0;this[_0x53e9('0x60')]();}}if(_0x44d378[_0x53e9('0x61')](_0x9a9724)&&_0x44d378[_0x9a9724]['dialMethod']===_0x53e9('0x62')&&_0x44d378[_0x9a9724]['type']===_0x53e9('0x5f')){if(_0x44d378[_0x9a9724]['dialActive']){this[_0x53e9('0x63')](_0x44d378[_0x9a9724]);this[_0x53e9('0x64')](_0x44d378[_0x9a9724]);}else{notSendMessagesQueue(_0x44d378[_0x9a9724]);}}}};Preview[_0x53e9('0xf')][_0x53e9('0x65')]=function(_0x2cf907){var _0x1d9906=this;this['sequence'][_0x53e9('0x66')](function(){if(!_[_0x53e9('0x67')](_0x1d9906['actions'][_0x2cf907])){loggerAction[_0x53e9('0x68')]('[clearZombieChannels][talking]',_0x2cf907,_0x53e9('0x69'),_0x1d9906[_0x53e9('0x14')][_0x2cf907]['queue'],'originated:\x20',JSON[_0x53e9('0x6a')](_0x1d9906[_0x53e9('0x12')][_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6b')]]['originated']),'pTalking:\x20',JSON[_0x53e9('0x6a')](_0x1d9906['campaignsPreview'][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]][_0x53e9('0x56')]),JSON[_0x53e9('0x6a')](_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6c')]),JSON[_0x53e9('0x6a')](_[_0x53e9('0x6d')](_0x1d9906['actions'][_0x2cf907],[_0x53e9('0x6e'),_0x53e9('0x6f'),_0x53e9('0x70'),_0x53e9('0x71')])));return ami[_0x53e9('0x72')]({'action':_0x53e9('0x73'),'channel':_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x74')]})[_0x53e9('0x75')](function(_0x1cadd1){if(_0x1cadd1[_0x53e9('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1d9906[_0x53e9('0x14')][_0x2cf907]){ut[_0x53e9('0x76')](_0x1d9906[_0x53e9('0x12')][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]],_0x53e9('0x77'));if(_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6c')]===!![]){ut[_0x53e9('0x78')](_0x1d9906[_0x53e9('0x12')][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]],_0x53e9('0x77'));ut[_0x53e9('0x79')](_0x53e9('0x7a')+_0x2cf907,_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]);}ut[_0x53e9('0x79')](_0x53e9('0x7b')+_0x2cf907,_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6b')]);delete _0x1d9906[_0x53e9('0x14')][_0x2cf907];}},0x2328);}});}});};Preview[_0x53e9('0xf')]['clearZombieChannels']=function(){var _0x44f05c=this;loggerAction[_0x53e9('0x68')](_0x53e9('0x7c'),_[_0x53e9('0x7d')](this[_0x53e9('0x14')]));for(var _0x1465d8 in this['actions']){if(_0x44f05c[_0x53e9('0x14')][_0x53e9('0x61')](_0x1465d8)){_0x44f05c[_0x53e9('0x65')](_0x1465d8);}}};Preview[_0x53e9('0xf')][_0x53e9('0x64')]=function(_0x1e7f19){var _0x1c704c=this;rpcDb[_0x53e9('0x7e')](_0x1e7f19['id'],ut[_0x53e9('0x7f')](this[_0x53e9('0x15')]))['then'](function(_0x46b370){if(!_[_0x53e9('0x67')](_0x46b370)){for(var _0x20f44e=0x0;_0x20f44e<_0x46b370[_0x53e9('0x80')];_0x20f44e+=0x1){if(ut['getDiff'](_0x46b370[_0x20f44e][_0x53e9('0x81')])<_0x1e7f19[_0x53e9('0x82')]*0x3c){_0x1c704c[_0x53e9('0x83')](_0x46b370[_0x20f44e]['id'])['then'](ut[_0x53e9('0x84')](_0x53e9('0x85')))[_0x53e9('0x75')](ut['logger2'](_0x53e9('0x85')));}else{var _0x42fc7e=new Action(_0x46b370[_0x20f44e],_0x1e7f19);_0x42fc7e['starttime']=moment()['format'](_0x53e9('0x86'));_0x1e7f19[_0x53e9('0x3f')]+=0x1;ut['logCustomer'](_0x42fc7e,0x17,_0x53e9('0x87'));if(_0x1e7f19['dialRecallInQueue']){rpcDb[_0x53e9('0x88')](ut[_0x53e9('0x89')](_0x46b370[_0x20f44e]));rpcDb[_0x53e9('0x8a')](_0x42fc7e,_0x53e9('0x8b'));}else{ut[_0x53e9('0x8c')](_0x42fc7e,0x16,_0x53e9('0x8d'));rpcDb[_0x53e9('0x8a')](_0x42fc7e,_0x53e9('0x8e'));rpcDb['createCustomerFinal'](_0x42fc7e,_0x53e9('0x8e'));}}}}})[_0x53e9('0x75')](ut[_0x53e9('0x84')](_0x53e9('0x8f')));};Preview[_0x53e9('0xf')][_0x53e9('0x63')]=function(_0x54cbfd){_0x54cbfd[_0x53e9('0x55')]=!![];if(ut['IsNotLoggedIn'](_0x54cbfd[_0x53e9('0x29')])){_0x54cbfd['message']=_0x53e9('0x90');}else if(!ut[_0x53e9('0x91')](_0x54cbfd[_0x53e9('0x92')])){_0x54cbfd[_0x53e9('0x4b')]=_0x53e9('0x93');}else if(!this[_0x53e9('0x94')](_0x54cbfd[_0x53e9('0x50')])){if(!this[_0x53e9('0x94')](_0x54cbfd[_0x53e9('0x95')])){_0x54cbfd[_0x53e9('0x4b')]=_0x53e9('0x96');}else{_0x54cbfd['message']=_0x53e9('0x97');}}else{_0x54cbfd[_0x53e9('0x4b')]='ACTIVE';}emitCampaignPreview(_0x54cbfd);};Preview[_0x53e9('0xf')]['callProgressDetectingCustomer']=function(_0x541da7,_0x389c9c,_0x3b01bc){var _0x51252e=this;var _0x199b46=this[_0x53e9('0x14')][_0x389c9c];var _0xd28d75=this[_0x53e9('0x12')][_0x199b46[_0x53e9('0x6b')]];var _0x19bdbc;if(_0xd28d75){switch(_0x3b01bc){case'1':_0xd28d75[_0x53e9('0x3d')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x0,'NoSuchNumber');rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut['cloneAction'](_0x199b46,0xf,'Global');rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0x9c'));}else{rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0x9c'));}delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];break;case _0x53e9('0x9e'):var _0x5a4346=moment()[_0x53e9('0x53')](_0x53e9('0x86'));_0x199b46[_0x53e9('0x9f')]=_0x5a4346;_0x199b46['answertime']=_0x5a4346;_0x199b46[_0x53e9('0x6c')]=!![];_0xd28d75[_0x53e9('0x56')]+=0x1;logger['info'](_0x53e9('0xa0'),_0x199b46[_0x53e9('0xa1')],_0x53e9('0xa2'),_0xd28d75[_0x53e9('0x26')],'pTalking:\x20',_0xd28d75[_0x53e9('0x56')]);ami[_0x53e9('0x25')](_0x53e9('0xa3'),ut['buildObj'](_0x199b46,'connect'));if(_0xd28d75[_0x53e9('0xa4')]){ami[_0x53e9('0x25')](_0x53e9('0xa5'),ut[_0x53e9('0xa6')](_0x199b46));}break;case'16':ami['emit'](_0x53e9('0xa7'),ut['buildObj'](_0x199b46,_0x53e9('0xa8')));emitVoiceQueueChannelRemove(ut[_0x53e9('0xa9')](_0x199b46,'complete'));_0xd28d75[_0x53e9('0x36')]+=0x1;_0xd28d75[_0x53e9('0x2e')]+=0x1;_0xd28d75[_0x53e9('0xaa')]+=0x1;ut[_0x53e9('0x78')](_0xd28d75,_0x53e9('0xab'));_0x199b46[_0x53e9('0x98')]=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x4,'Answer');rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xac'));rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0xad'));rpcDb['crateCustomerReportQueue'](_0x199b46);_0xd28d75[_0x53e9('0x2b')]+=_0x199b46[_0x53e9('0xae')];_0xd28d75['sumBillable']+=_0x199b46[_0x53e9('0xae')];logger['info'](_0x53e9('0xaf'),_0x199b46[_0x53e9('0xa1')],_0x53e9('0xa2'),_0xd28d75['name'],_0x53e9('0xb0'),_0xd28d75[_0x53e9('0x56')]);delete this['actions'][_0x541da7[_0x53e9('0x9d')]];break;case _0x53e9('0xb1'):_0xd28d75[_0x53e9('0x38')]+=0x1;_0x199b46['countbusyretry']+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut['logCustomer'](_0x199b46,0x5,'Busy');rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xb2'));if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xb5'));}else{if(_0x199b46[_0x53e9('0xb6')]>=_0xd28d75['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0xb2'));}else{rpcDb[_0x53e9('0xb7')](ut[_0x53e9('0xb8')](_0x199b46,_0x53e9('0xb6'),_0xd28d75['dialBusyRetryFrequency']),_0x199b46['unlockAgent'],_0x199b46['activeContact']);}}break;case'NOANSWER':_0xd28d75[_0x53e9('0x3c')]+=0x1;_0x199b46[_0x53e9('0xb9')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x3,_0x53e9('0xba'));rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xbb'));if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xbc'));}else{if(_0x199b46[_0x53e9('0xb9')]>=_0xd28d75[_0x53e9('0xbd')]){rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xbb'));}else{rpcDb['rescheduleContact'](ut[_0x53e9('0xb8')](_0x199b46,'countnoanswerretry',_0xd28d75['dialNoAnswerRetryFrequency']),_0x199b46[_0x53e9('0xbe')],_0x199b46[_0x53e9('0xbf')]);}}break;case _0x53e9('0xc0'):_0xd28d75[_0x53e9('0x39')]+=0x1;_0x199b46[_0x53e9('0xc1')]+=0x1;_0x199b46['countglobal']=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x8,'Congestion');rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut['cloneAction'](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb['createCustomerFinal'](_0x19bdbc,_0x53e9('0xc2'));}else{if(_0x199b46[_0x53e9('0xc1')]>=_0xd28d75['dialCongestionMaxRetry']){rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xc3'));}else{rpcDb[_0x53e9('0xb7')](ut['scheduledAt'](_0x199b46,_0x53e9('0xc1'),_0xd28d75[_0x53e9('0xc4')]),_0x199b46[_0x53e9('0xbe')],_0x199b46['activeContact']);}}break;case'CANCEL':_0xd28d75[_0x53e9('0x40')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x14,_0x53e9('0xc5'));rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xc6'));if(_0x199b46[_0x53e9('0xbe')]){rpcDb[_0x53e9('0xc7')](_0x199b46[_0x53e9('0xc8')]);}if(_0x199b46['activeContact']){rpcDb['disableContact'](_0x199b46[_0x53e9('0xc8')]);}break;default:if(_0x199b46['dialAnswer']){ut[_0x53e9('0x78')](_0xd28d75,_0x53e9('0xc9'));ut[_0x53e9('0x79')](_0x53e9('0xca')+_0xd28d75[_0x53e9('0x26')],_0x541da7);}_0xd28d75[_0x53e9('0xcb')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0xc,_0x541da7[_0x53e9('0xcc')]||_0x541da7[_0x53e9('0xcd')]);rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75['dialGlobalMaxRetry']){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xce'));}else{rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xce'));}delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];}if(!(_0x199b46['dialAnswer']&&_0x3b01bc==='16')){ut[_0x53e9('0x76')](_0xd28d75,'[callProgressDetectingCustomer]');logger[_0x53e9('0x68')]('[originated][decrement][callProgressDetectingCustomer]',_0x199b46['uniqueid'],_0x53e9('0xa2'),_0xd28d75[_0x53e9('0x26')],'originated:\x20',_0xd28d75[_0x53e9('0x4c')]);}if(_0x3b01bc!==_0x53e9('0x9e')){delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0xcf')]];}}};Preview[_0x53e9('0xf')][_0x53e9('0xd0')]=function(_0x4c3796,_0x1935e7,_0x2c2905){if(_[_0x53e9('0xd1')](_0x1935e7)&&_0x53e9('0xd2')!==typeof _0x1935e7){return;}if(_['isUndefined'](_0x2c2905)&&_0x53e9('0xd2')!==typeof _0x2c2905){return;}switch(_0x2c2905[_0x53e9('0xd3')]){case'0':ut['logAgent'](_0x4c3796,0x0,_0x53e9('0xd4'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xd6'));break;case'3':ut[_0x53e9('0xd7')](_0x4c3796,0x3,_0x53e9('0xba'));rpcDb[_0x53e9('0xd5')](_0x4c3796,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x53e9('0xd7')](_0x4c3796,0x5,_0x53e9('0xd8'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xd9'));break;case'8':ut[_0x53e9('0xd7')](_0x4c3796,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4c3796,_0x53e9('0xda'));break;case'22':ut[_0x53e9('0xd7')](_0x4c3796,0x16,_0x53e9('0xdb'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xdc'));break;default:ut[_0x53e9('0xd7')](_0x4c3796,0xc,_0x2c2905['reason']);rpcDb[_0x53e9('0xd5')](_0x4c3796,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x1935e7,_0x53e9('0xdd'));logger[_0x53e9('0x68')](_0x53e9('0xde'),_0x4c3796['uniqueid'],'\x20Queue',_0x1935e7[_0x53e9('0x26')],_0x53e9('0xdf'),_0x1935e7[_0x53e9('0x4c')]);delete this[_0x53e9('0x14')][_0x4c3796[_0x53e9('0xa1')]];};Preview['prototype'][_0x53e9('0xe0')]=function(_0xa3d92d,_0x4f49e5,_0x1eaf64,_0x41b882,_0x375952){var _0x469383=this;return new BPromise(function(_0x2c49b4,_0x5a6298){if(_[_0x53e9('0x67')](_0x4f49e5)||_[_0x53e9('0x67')](_0x4f49e5[_0x53e9('0xe1')])||_[_0x53e9('0x67')](_0x4f49e5[_0x53e9('0xe1')][_0x53e9('0xe2')])||_[_0x53e9('0x67')](_0x4f49e5['VoiceQueueId'])){_0x5a6298(ut[_0x53e9('0x4b')](_0x53e9('0xe3'),_0x41b882,_0x375952));return;}var _0x1e01ec=uuid['v4']();var _0x575867=_0x469383[_0x53e9('0x12')][_0x4f49e5[_0x53e9('0x69')][_0x53e9('0x26')]];var _0x19fc49=_0x1eaf64?_0x469383[_0x53e9('0x15')][_0x1eaf64]['id']:undefined;_0x469383['actions'][_0x1e01ec]=new Action(_0x4f49e5,_0x575867,_0x1e01ec,_0x1eaf64,_0x19fc49);var _0x526a07=_0x469383['actions'][_0x1e01ec];_0x526a07['unlockAgent']=_0x41b882;_0x526a07['activeContact']=_0x375952;_0x526a07['lookAgent']=_0x1eaf64;if(_[_0x53e9('0xe4')](_0xa3d92d)){_0x469383[_0x53e9('0xe5')](_0x526a07,_0x575867,_0x4f49e5,_0x1eaf64)[_0x53e9('0xe6')](function(_0x5deba4){logger[_0x53e9('0x68')](_0x53e9('0xe7'),_0x53e9('0xe8')+_0x526a07[_0x53e9('0x6b')]+'\x20IdHopper:\x20'+_0x526a07['idContact'],JSON[_0x53e9('0x6a')](_0x5deba4));ami['emit'](_0x53e9('0xe9'),ut['buildObj'](_0x526a07,'called'));_0x2c49b4(ut[_0x53e9('0x4b')](_0x53e9('0xea')));})[_0x53e9('0x75')](function(_0x7d85c5){ut[_0x53e9('0x57')](_0x53e9('0xeb'),_0x7d85c5);_0x5a6298(ut[_0x53e9('0x4b')]('Call\x20failed',_0x41b882,_0x375952));});}else{_0x575867[_0x53e9('0x37')]+=0x1;ut[_0x53e9('0xec')](_0x526a07);rpcDb[_0x53e9('0xed')](_0x526a07,_0x53e9('0xee'));delete _0x469383[_0x53e9('0x14')][_0x1e01ec];_0x5a6298(ut[_0x53e9('0x4b')](_0x53e9('0xef'),_0x41b882,_0x375952));}});};Preview['prototype'][_0x53e9('0x94')]=function(_0x3a61ec){return!_['isNil'](_0x3a61ec)&&!_['isNil'](_0x3a61ec['name'])&&!_[_0x53e9('0x67')](_0x3a61ec[_0x53e9('0xf0')])&&_0x3a61ec[_0x53e9('0xf0')]&&!_[_0x53e9('0x67')](this[_0x53e9('0x13')][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])])&&!_[_0x53e9('0x67')](this['trunks'][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')])&&(this[_0x53e9('0x13')][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')]===_0x53e9('0xf2')||this[_0x53e9('0x13')][util['format']('SIP/%s',_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')]===_0x53e9('0xf3'));};Preview[_0x53e9('0xf')][_0x53e9('0x83')]=function(_0x50c20c,_0x162578){var _0x80678f=this;return new BPromise(function(_0x25c33d,_0x10be0a){_0x80678f[_0x53e9('0xf4')](_0x50c20c,_0x162578)[_0x53e9('0xe6')](function(_0x5ef506){_0x25c33d(_[_0x53e9('0x6d')](_0x5ef506,[_0x53e9('0x4b')]));})[_0x53e9('0x75')](function(_0x3748b8){if(_0x3748b8[_0x53e9('0xf5')]){rpcDb['unlockContact'](_0x50c20c);}if(_0x3748b8['active']){rpcDb[_0x53e9('0xf6')](_0x50c20c);}_0x10be0a(_[_0x53e9('0x6d')](_0x3748b8,[_0x53e9('0x4b')]));});});};Preview[_0x53e9('0xf')][_0x53e9('0xf4')]=function(_0x1d127f,_0x85f774){var _0x178c06=this;return new BPromise(function(_0x4e8ad1,_0x1d9816){var _0x4bc1ab,_0x493588;rpcDb[_0x53e9('0xf7')](_0x1d127f)[_0x53e9('0xe6')](function(_0x31c256){if(!_['isNil'](_0x31c256[0x0])){_0x493588=_0x31c256[0x0][_0x53e9('0xf8')]?![]:!![];_0x4bc1ab=_0x31c256[0x0]['recallme']?!![]:![];_0x4bc1ab=_0x85f774?!![]:_0x4bc1ab;}var _0x55f773=_0x178c06[_0x53e9('0xf9')](_0x31c256);if(_0x55f773[_0x53e9('0xfa')]){rpcDb[_0x53e9('0xfb')](_['pick'](_0x31c256[0x0],[_0x53e9('0x70'),'Contact.phone']))[_0x53e9('0xe6')](function(_0x38f81d){_0x178c06[_0x53e9('0xe0')](_0x38f81d,_0x31c256[0x0],_0x85f774,_0x493588,_0x4bc1ab)[_0x53e9('0xe6')](function(_0x3092db){_0x4e8ad1(_0x3092db);})[_0x53e9('0x75')](function(_0x3f08ab){_0x1d9816(_0x3f08ab);});})[_0x53e9('0x75')](function(_0x3e9107){ut['logger'](_0x53e9('0xfc'),_0x3e9107);_0x1d9816(ut[_0x53e9('0x4b')](_0x53e9('0xfd'),_0x493588,_0x4bc1ab));});}else{_0x1d9816(ut[_0x53e9('0x4b')](_0x55f773[_0x53e9('0x4b')],_0x493588,_0x4bc1ab));}})[_0x53e9('0x75')](function(_0x2ccc20){ut[_0x53e9('0x57')]('[Preview][getContactPreview]',_0x2ccc20);_0x1d9816(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x4f938a){if(_['isNil'](_0x4f938a)||_['isEmpty'](_0x4f938a)||!_[_0x53e9('0x67')](_0x4f938a[0x0][_0x53e9('0xfe')])&&_[_0x53e9('0x67')](_0x4f938a[0x0]['Agent']['name'])){ut[_0x53e9('0x57')](_0x53e9('0xff'),_0x4f938a);return{'isValid':![],'message':_0x53e9('0x100')};}var _0x25a58b=this[_0x53e9('0x12')][_0x4f938a[0x0][_0x53e9('0x69')][_0x53e9('0x26')]];_0x25a58b[_0x53e9('0x4b')]=_0x53e9('0x97');if(_[_0x53e9('0x67')](_0x25a58b)){ut[_0x53e9('0x57')](_0x53e9('0x101'),_0x25a58b);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x53e9('0x94')](_0x25a58b['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x25a58b['name']+_0x53e9('0x102'));if(!this[_0x53e9('0x94')](_0x25a58b['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x25a58b[_0x53e9('0x26')]+_0x53e9('0x103'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x25a58b[_0x53e9('0x92')])){ut[_0x53e9('0x57')](_0x53e9('0x104'),_0x25a58b['name']+_0x53e9('0x105'));return{'isValid':![],'message':_0x53e9('0x106')+_0x25a58b[_0x53e9('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x53e9('0x107')};};Preview[_0x53e9('0xf')][_0x53e9('0xe5')]=function(_0x3c7ffb,_0x94c833,_0x3998e5,_0x4cbe4b){var _0x4ff7f2=this;return new BPromise(function(_0x4c8ca4,_0x111bad){var _0x5c98e5=_0x3c7ffb['uniqueid'];var _0x5d6f34=_0x4ff7f2[_0x53e9('0x94')](_0x94c833[_0x53e9('0x50')])?util['format']('SIP/%s/%s%s',_0x94c833[_0x53e9('0x50')][_0x53e9('0x26')],_['isNil'](_0x94c833[_0x53e9('0x34')])?'':_0x94c833['dialPrefix']['trim']()||'',_0x94c833[_0x53e9('0x108')]>0x0?_0x3998e5[_0x53e9('0xe1')][_0x53e9('0xe2')][_0x53e9('0x109')](_0x94c833['dialCutDigit']):_0x3998e5['Contact'][_0x53e9('0xe2')]):util[_0x53e9('0x53')](_0x53e9('0x10a'),_[_0x53e9('0x67')](_0x94c833[_0x53e9('0x95')])?_0x94c833[_0x53e9('0x50')][_0x53e9('0x26')]:_0x94c833[_0x53e9('0x95')]['name'],_[_0x53e9('0x67')](_0x94c833['dialPrefix'])?'':_0x94c833['dialPrefix']['trim']()||'',_0x94c833[_0x53e9('0x108')]>0x0?_0x3998e5[_0x53e9('0xe1')]['phone'][_0x53e9('0x109')](_0x94c833[_0x53e9('0x108')]):_0x3998e5['Contact'][_0x53e9('0xe2')]);var _0xd3bbd3=_0x4ff7f2['isTrunkReachable'](_0x94c833[_0x53e9('0x50')])?ut[_0x53e9('0x10b')](_0x94c833['Trunk']['callerid'],_0x94c833[_0x53e9('0x32')],_0x94c833['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x53e9('0x10c')](_0x94c833[_0x53e9('0x33')],_0x94c833[_0x53e9('0x10d')]):_0x94c833[_0x53e9('0x33')]):ut['getCallerId'](_[_0x53e9('0x67')](_0x94c833[_0x53e9('0x95')])?_0x94c833[_0x53e9('0x50')]['callerid']:_0x94c833[_0x53e9('0x95')][_0x53e9('0x10e')],_0x94c833['dialOriginateCallerIdName'],_0x94c833[_0x53e9('0x10d')]>0x0?ut[_0x53e9('0x10c')](_0x94c833[_0x53e9('0x33')],_0x94c833[_0x53e9('0x10d')]):_0x94c833[_0x53e9('0x33')]);if(_0xd3bbd3){_0x3c7ffb[_0x53e9('0x10f')]=ut[_0x53e9('0x110')](_0xd3bbd3);_0x3c7ffb[_0x53e9('0x111')]=ut[_0x53e9('0x112')](_0xd3bbd3);}var _0x5ca30d=ut[_0x53e9('0x113')](_0x94c833,_0x3998e5,_0x5d6f34,_0xd3bbd3,_0x5c98e5,_0x3c7ffb);_[_0x53e9('0x114')](_0x3c7ffb,ut[_0x53e9('0x115')](_0x5ca30d));_0x3c7ffb[_0x53e9('0x116')]=moment()[_0x53e9('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x53e9('0x72')](ut[_0x53e9('0x117')](_0x3c7ffb,_0x94c833,_0x5ca30d,_0x3c7ffb[_0x53e9('0xbf')],_0x4cbe4b))[_0x53e9('0xe6')](function(_0x468142){_0x94c833[_0x53e9('0x4c')]+=0x1;logger['info'](_0x53e9('0x118'),_0x5c98e5,_0x53e9('0xa2'),_0x94c833[_0x53e9('0x26')],_0x53e9('0xdf'),_0x94c833[_0x53e9('0x4c')]);_0x4c8ca4(_0x468142);})[_0x53e9('0x75')](function(_0x26d2b3){ut[_0x53e9('0xd7')](_0x3c7ffb,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x3c7ffb,_0x53e9('0x119'));_0x111bad(_0x26d2b3);});});};Preview[_0x53e9('0xf')][_0x53e9('0x11a')]=function(_0x5a398d){if(this['actions'][_0x5a398d[_0x53e9('0x9d')]]){this[_0x53e9('0x14')][_0x5a398d[_0x53e9('0x9d')]][_0x53e9('0x74')]=_0x5a398d[_0x53e9('0x74')];}};Preview['prototype'][_0x53e9('0x11b')]=function(_0x5b3766){var _0xcf75ac=this;var _0x2c2f71=this[_0x53e9('0x14')][_0x5b3766[_0x53e9('0x11c')]];if(_0x2c2f71){if(_0x2c2f71[_0x53e9('0x11d')]&&this['agents'][_0x2c2f71[_0x53e9('0x11d')]]){ut[_0x53e9('0x11e')](_0x2c2f71,this[_0x53e9('0x15')][_0x2c2f71['lookAgent']]['name'],this[_0x53e9('0x15')][_0x2c2f71['lookAgent']]['id']);}var _0x22af54=_[_0x53e9('0x11f')](_0x2c2f71);_0x22af54[_0x53e9('0x9f')]=moment()['format'](_0x53e9('0x86'));var _0xb5dcf9=_0xcf75ac['campaignsPreview'][_0x2c2f71['queue']];if(ut[_0x53e9('0x120')](_0x5b3766[_0x53e9('0x121')])){if(_0x2c2f71[_0x53e9('0xbe')]){rpcDb['unlockContact'](_0x2c2f71[_0x53e9('0xc8')]);}if(_0x2c2f71[_0x53e9('0xbf')]){rpcDb[_0x53e9('0xf6')](_0x2c2f71[_0x53e9('0xc8')]);}ami[_0x53e9('0x25')](_0x53e9('0x122'),ut[_0x53e9('0xa9')](_0x2c2f71,_0x53e9('0x123')));this[_0x53e9('0xd0')](_0x22af54,_0xb5dcf9,_0x5b3766);}else{_0x2c2f71[_0x53e9('0x116')]=moment()[_0x53e9('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x53e9('0xd7')](_0x22af54,0x4,_0x53e9('0x124'));rpcDb['createAgentHistory'](_0x22af54,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x53e9('0x125')]=function(_0x31b70e){var _0x274a8f=this;var _0xb5346=this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]];var _0x200d8c;if(_0xb5346){_0x200d8c=this['campaignsPreview'][_0xb5346[_0x53e9('0x6b')]];logger['info'](_0x53e9('0x126'),_0x31b70e[_0x53e9('0x9d')],'\x20Queue',_0x200d8c['name'],_0x53e9('0xb0'),_0x200d8c[_0x53e9('0x56')]);}if(this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]]&&_0x31b70e[_0x53e9('0x9d')]!==_0x31b70e['uniqueid']){if(_0x31b70e[_0x53e9('0x127')]==='16'&&this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){this[_0x53e9('0x128')](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}else if(this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){logger[_0x53e9('0x68')](_0x53e9('0x129'),_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c['name'],_0x53e9('0xb0'),_0x200d8c[_0x53e9('0x56')]);this['callProgressDetectingCustomer'](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}}else if(_0xb5346&&_[_0x53e9('0x67')](_0xb5346[_0x53e9('0x12a')])&&_0x200d8c['dialQueueProject']&&_0x31b70e[_0x53e9('0x9d')]===_0x31b70e[_0x53e9('0xa1')]&&_[_0x53e9('0x67')](_0x31b70e[_0x53e9('0xd3')])&&_0x31b70e[_0x53e9('0x127')]==='16'&&_0x31b70e[_0x53e9('0x12b')]==='6'&&_['isUndefined'](_0xb5346[_0x53e9('0x12c')])){if(_0xb5346[_0x53e9('0xbe')]){rpcDb[_0x53e9('0xc7')](_0xb5346[_0x53e9('0xc8')]);}if(_0xb5346[_0x53e9('0xbf')]){rpcDb[_0x53e9('0xf6')](_0xb5346['idContact']);}_0x31b70e['reason']='22';this[_0x53e9('0xd0')](_0xb5346,_0x200d8c,_0x31b70e);}else if(_0xb5346&&_0xb5346[_0x53e9('0x12c')]){if(_0x31b70e['cause']==='16'&&this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){logger[_0x53e9('0x68')]('[syncHangup][talking][transfer]',_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c[_0x53e9('0x26')],'pTalking:\x20',_0x200d8c[_0x53e9('0x56')]);this['callProgressDetectingCustomer'](_0x31b70e,_0x31b70e['linkedid'],_0x31b70e[_0x53e9('0x127')]);}else if(this[_0x53e9('0x14')][_0x31b70e['linkedid']][_0x53e9('0x6c')]){logger[_0x53e9('0x68')](_0x53e9('0x129'),_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c[_0x53e9('0x26')],_0x53e9('0xb0'),_0x200d8c['pTalking']);this[_0x53e9('0x128')](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}}};Preview[_0x53e9('0xf')][_0x53e9('0x1d')]=function(_0x31757a){if(this[_0x53e9('0x14')][_0x31757a['destlinkedid']]&&_0x31757a[_0x53e9('0xcf')]!==_0x31757a[_0x53e9('0x12d')]){this[_0x53e9('0x128')](_0x31757a,_0x31757a[_0x53e9('0xcf')],_0x31757a['dialstatus']);}};Preview[_0x53e9('0xf')][_0x53e9('0x1b')]=function(_0x47406a){if(this['actions'][_0x47406a['linkedid']]&&_0x47406a['linkedid']!==_0x47406a[_0x53e9('0xa1')]&&!this[_0x53e9('0x14')][_0x47406a[_0x53e9('0x9d')]][_0x53e9('0x6c')]){if(_0x47406a['cause']==='1'){this['callProgressDetectingCustomer'](_0x47406a,_0x47406a[_0x53e9('0x9d')],_0x47406a['cause']);}}};Preview['prototype'][_0x53e9('0x12e')]=function(_0x163337,_0x4dc763,_0x232ab0){if(this[_0x53e9('0x14')][_0x163337]){if(_[_0x53e9('0x67')](this[_0x53e9('0x14')][_0x163337][_0x53e9('0x12f')])){this[_0x53e9('0x14')][_0x163337][_0x53e9('0x12f')]={};}this['actions'][_0x163337][_0x53e9('0x12f')][_0x4dc763]=_0x232ab0;}};Preview[_0x53e9('0xf')][_0x53e9('0x130')]=function(_0x33c68c){try{if(!_[_0x53e9('0x67')](_0x33c68c)){if(ut[_0x53e9('0x131')](_[_0x53e9('0x132')](_0x33c68c[_0x53e9('0x133')])[0x0])){this[_0x53e9('0x12e')](_0x33c68c['uniqueid'],_[_0x53e9('0x132')](_0x33c68c[_0x53e9('0x133')])[0x0],_0x33c68c[_0x53e9('0x134')]);}}}catch(_0x1ceca5){logger[_0x53e9('0x135')](_0x53e9('0x136'),util[_0x53e9('0x137')](_0x1ceca5,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x53e9('0x21')]=function(_0x5d50a1){if(_0x5d50a1){if(this[_0x53e9('0x14')][_0x5d50a1[_0x53e9('0x138')]]){this['actions'][_0x5d50a1['transfertargetlinkedid']][_0x53e9('0x12c')]=!![];}}};Preview[_0x53e9('0xf')][_0x53e9('0x23')]=function(_0xa945a5){if(_0xa945a5){if(this[_0x53e9('0x14')][_0xa945a5[_0x53e9('0x139')]]){this[_0x53e9('0x14')][_0xa945a5[_0x53e9('0x139')]][_0x53e9('0x12c')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x3db0=['activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','unlockAgent','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','execRun','pick','unlock','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','Action','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','exports','util','lodash','bluebird','moment','md5','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','preview','booked','setMessage','clearZombieChannel','enqueue','isNil','actions','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','rescheduleContact','scheduledAt','dialBusyRetryFrequency'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x3db0,0x7b));var _0x03db=function(_0x2c5919,_0x204c87){_0x2c5919=_0x2c5919-0x0;var _0x35b831=_0x3db0[_0x2c5919];return _0x35b831;};'use strict';var util=require(_0x03db('0x0'));var _=require(_0x03db('0x1'));var BPromise=require(_0x03db('0x2'));var uuid=require('uuid');var moment=require(_0x03db('0x3'));var md5=require(_0x03db('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x03db('0x5'))('preview');var loggerAction=require(_0x03db('0x5'))(_0x03db('0x6'));var ami=require(_0x03db('0x7'));var rpcDb=require(_0x03db('0x8'));var Action=require(_0x03db('0x9'));var ut=require(_0x03db('0xa'));config[_0x03db('0xb')]=_[_0x03db('0xc')](config['redis'],{'host':_0x03db('0xd'),'port':0x18eb});var io=require(_0x03db('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x03db('0xf')]['enqueue']=function(_0x5950ff){this[_0x03db('0x10')]=this[_0x03db('0x10')]?this['tail'][_0x03db('0x11')](_0x5950ff):_0x5950ff();};function Preview(_0x45fb33){this[_0x03db('0x12')]=new Sequence();this[_0x03db('0x13')]=_0x45fb33[_0x03db('0x14')];this[_0x03db('0x15')]=_0x45fb33[_0x03db('0x15')];this['actions']={};this['agents']=_0x45fb33[_0x03db('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x03db('0x17'),this[_0x03db('0x18')]['bind'](this));ami['on'](_0x03db('0x19'),this[_0x03db('0x1a')][_0x03db('0x1b')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x03db('0x1b')](this));ami['on'](_0x03db('0x1c'),this[_0x03db('0x1d')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x1e'),this[_0x03db('0x1f')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x20'),this[_0x03db('0x21')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x22'),this[_0x03db('0x23')][_0x03db('0x1b')](this));ami['on'](_0x03db('0x24'),this['syncBlindTransfer'][_0x03db('0x1b')](this));this[_0x03db('0x25')](this['campaignsPreview']);}function emit(_0x16a385,_0x4d42b6,_0x56990c){io['to'](_0x16a385)[_0x03db('0x26')](_0x4d42b6,_0x56990c);}function emitCampaignPreview(_0x50918a){if(_0x50918a[_0x03db('0x27')]===_0x03db('0x28')){var _0x3c9d9b={'id':_0x50918a['id'],'name':_0x50918a[_0x03db('0x29')],'strategy':_0x50918a[_0x03db('0x2a')],'answered':_0x50918a[_0x03db('0x2b')],'available':_0x50918a[_0x03db('0x2c')],'loggedIn':_0x50918a['loggedIn'],'pTalking':_0x50918a[_0x03db('0x2d')],'sumBillable':_0x50918a['sumBillable'],'sumDuration':_0x50918a[_0x03db('0x2e')],'sumHoldTime':_0x50918a[_0x03db('0x2f')]||0x0,'talking':_0x50918a[_0x03db('0x30')],'total':_0x50918a[_0x03db('0x31')],'type':_0x50918a['type'],'unmanaged':_0x50918a[_0x03db('0x32')],'abandoned':_0x50918a[_0x03db('0x33')],'waiting':_0x50918a[_0x03db('0x34')],'loggedInDb':_0x50918a[_0x03db('0x35')],'dialActive':_0x50918a[_0x03db('0x36')],'dialMethod':_0x50918a[_0x03db('0x37')],'dialOriginateCallerIdName':_0x50918a[_0x03db('0x38')],'dialOriginateCallerIdNumber':_0x50918a[_0x03db('0x39')],'dialOriginateTimeout':_0x50918a[_0x03db('0x3a')],'dialPrefix':_0x50918a[_0x03db('0x3b')],'outboundAnswerAgiCallsDay':_0x50918a[_0x03db('0x3c')],'outboundAnswerCallsDay':_0x50918a[_0x03db('0x3d')],'outboundBlacklistCallsDay':_0x50918a[_0x03db('0x3e')],'outboundBusyCallsDay':_0x50918a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x50918a[_0x03db('0x3f')],'outboundDropCallsDayACS':_0x50918a[_0x03db('0x40')],'outboundDropCallsDayCallersExit':_0x50918a['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x50918a[_0x03db('0x41')],'outboundNoAnswerCallsDay':_0x50918a['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x50918a[_0x03db('0x42')],'outboundOriginateFailureCallsDay':_0x50918a[_0x03db('0x43')],'outboundReCallsDay':_0x50918a['outboundReCallsDay'],'outboundRejectCallsDay':_0x50918a[_0x03db('0x44')],'outboundUnknownCallsDay':_0x50918a[_0x03db('0x45')],'predictiveIntervalAnsweredCalls':_0x50918a[_0x03db('0x46')],'predictiveIntervalAvgHoldtime':_0x50918a[_0x03db('0x47')],'predictiveIntervalAvgTalktime':_0x50918a[_0x03db('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x50918a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x50918a[_0x03db('0x49')],'predictiveIntervalErlangCalls':_0x50918a[_0x03db('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x50918a[_0x03db('0x4b')],'predictiveIntervalHitRate':_0x50918a[_0x03db('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x50918a[_0x03db('0x4d')],'predictiveIntervalPauses':_0x50918a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x50918a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x50918a[_0x03db('0x4e')],'message':_0x50918a[_0x03db('0x4f')],'originated':_0x50918a[_0x03db('0x50')],'erlangCalls':_0x50918a['erlangCalls'],'erlangCallToSecond':_0x50918a[_0x03db('0x51')],'erlangAbandonmentRate':_0x50918a[_0x03db('0x52')],'erlangBusyFactor':_0x50918a[_0x03db('0x53')],'startPredictive':_0x50918a[_0x03db('0x54')],'startProgressive':_0x50918a['startProgressive']};if(_0x50918a[_0x03db('0x55')]){_0x3c9d9b[_0x03db('0x55')]={'id':_0x50918a[_0x03db('0x55')]['id'],'name':_0x50918a['Trunk'][_0x03db('0x29')],'active':_0x50918a[_0x03db('0x55')][_0x03db('0x56')],'callerid':_0x50918a['Trunk'][_0x03db('0x57')]};}if(_0x50918a[_0x03db('0x58')]){_0x3c9d9b['Interval']={'id':_0x50918a[_0x03db('0x58')]['id'],'name':_0x50918a[_0x03db('0x58')]['name']};}var _0x57a761=md5(JSON[_0x03db('0x59')](_0x3c9d9b));if(_0x50918a[_0x03db('0x4')]!==_0x57a761){_0x50918a[_0x03db('0x4')]=_0x57a761;emit(util[_0x03db('0x5a')]('voice:queue:%s',_0x3c9d9b[_0x03db('0x29')]),_0x03db('0x5b'),_0x3c9d9b);}}}function emitVoiceQueueChannelRemove(_0x40d946){emit(util[_0x03db('0x5a')]('voice:queue:%s',_0x40d946['name']),_0x03db('0x5c'),_0x40d946);}function notSendMessagesQueue(_0x20d660){if(_0x20d660[_0x03db('0x5d')]){if(_0x20d660['originated']===0x0&&_0x20d660[_0x03db('0x2d')]===0x0){_0x20d660[_0x03db('0x5d')]=![];_0x20d660[_0x03db('0x2c')]=0x0;_0x20d660['paused']=0x0;_0x20d660[_0x03db('0x4f')]=_0x03db('0x5e');ut[_0x03db('0x5f')](_0x03db('0x60'),_0x20d660[_0x03db('0x29')]+_0x03db('0x61'));}else{_0x20d660['message']=_0x03db('0x62');ut[_0x03db('0x5f')](_0x03db('0x60'),_0x20d660[_0x03db('0x29')]+_0x03db('0x63'));}emitCampaignPreview(_0x20d660);}}Preview[_0x03db('0xf')][_0x03db('0x25')]=function(){var _0x44953b=this;setInterval(function(){_0x44953b[_0x03db('0x64')]();},0x7cf);};Preview[_0x03db('0xf')][_0x03db('0x64')]=function(){var _0x203851=this['campaignsPreview'];this[_0x03db('0x65')]+=0x1;for(var _0x595459 in _0x203851){if(_0x203851[_0x03db('0x66')](_0x595459)&&(_0x203851[_0x595459][_0x03db('0x37')]===_0x03db('0x67')||_0x203851[_0x595459]['dialMethod']===_0x03db('0x68'))&&_0x203851[_0x595459][_0x03db('0x27')]==='outbound'){if(this[_0x03db('0x65')]>0x7){this[_0x03db('0x65')]=0x0;this['clearZombieChannels']();}}if(_0x203851[_0x03db('0x66')](_0x595459)&&_0x203851[_0x595459][_0x03db('0x37')]===_0x03db('0x67')&&_0x203851[_0x595459][_0x03db('0x27')]===_0x03db('0x28')){if(_0x203851[_0x595459][_0x03db('0x36')]){this[_0x03db('0x69')](_0x203851[_0x595459]);this['recallMe'](_0x203851[_0x595459]);}else{notSendMessagesQueue(_0x203851[_0x595459]);}}}};Preview[_0x03db('0xf')][_0x03db('0x6a')]=function(_0x2a5de5){var _0xac66dc=this;this['sequence'][_0x03db('0x6b')](function(){if(!_[_0x03db('0x6c')](_0xac66dc[_0x03db('0x6d')][_0x2a5de5])){loggerAction[_0x03db('0x6e')](_0x03db('0x6f'),_0x2a5de5,_0x03db('0x70'),_0xac66dc['actions'][_0x2a5de5][_0x03db('0x71')],_0x03db('0x72'),JSON[_0x03db('0x59')](_0xac66dc[_0x03db('0x13')][_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]][_0x03db('0x50')]),_0x03db('0x73'),JSON[_0x03db('0x59')](_0xac66dc['campaignsPreview'][_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['queue']][_0x03db('0x2d')]),JSON[_0x03db('0x59')](_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['dialAnswer']),JSON['stringify'](_['pick'](_0xac66dc['actions'][_0x2a5de5],[_0x03db('0x74'),_0x03db('0x75'),_0x03db('0x76'),_0x03db('0x77')])));return ami['Action']({'action':_0x03db('0x78'),'channel':_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x79')]})[_0x03db('0x7a')](function(_0x30e4eb){if(_0x30e4eb[_0x03db('0x4f')]===_0x03db('0x7b')){setTimeout(function(){if(_0xac66dc[_0x03db('0x6d')][_0x2a5de5]){ut['updateOriginated'](_0xac66dc[_0x03db('0x13')][_0xac66dc['actions'][_0x2a5de5]['queue']],_0x03db('0x7c'));if(_0xac66dc['actions'][_0x2a5de5][_0x03db('0x7d')]===!![]){ut[_0x03db('0x7e')](_0xac66dc['campaignsPreview'][_0xac66dc[_0x03db('0x6d')][_0x2a5de5]['queue']],_0x03db('0x7c'));ut[_0x03db('0x7f')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2a5de5,_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]);}ut[_0x03db('0x7f')](_0x03db('0x80')+_0x2a5de5,_0xac66dc[_0x03db('0x6d')][_0x2a5de5][_0x03db('0x71')]);delete _0xac66dc[_0x03db('0x6d')][_0x2a5de5];}},0x2328);}});}});};Preview[_0x03db('0xf')][_0x03db('0x81')]=function(){var _0x1f2a48=this;loggerAction[_0x03db('0x6e')](_0x03db('0x82'),_[_0x03db('0x83')](this[_0x03db('0x6d')]));for(var _0x5a2082 in this[_0x03db('0x6d')]){if(_0x1f2a48[_0x03db('0x6d')][_0x03db('0x66')](_0x5a2082)){_0x1f2a48['clearZombieChannel'](_0x5a2082);}}};Preview[_0x03db('0xf')][_0x03db('0x84')]=function(_0x28f0d1){var _0x19f0ae=this;rpcDb[_0x03db('0x85')](_0x28f0d1['id'],ut[_0x03db('0x86')](this[_0x03db('0x16')]))[_0x03db('0x87')](function(_0x176b19){if(!_['isNil'](_0x176b19)){for(var _0x5a5189=0x0;_0x5a5189<_0x176b19[_0x03db('0x88')];_0x5a5189+=0x1){if(ut[_0x03db('0x89')](_0x176b19[_0x5a5189][_0x03db('0x8a')])<_0x28f0d1[_0x03db('0x8b')]*0x3c){_0x19f0ae['run'](_0x176b19[_0x5a5189]['id'])[_0x03db('0x87')](ut[_0x03db('0x8c')](_0x03db('0x8d')))[_0x03db('0x7a')](ut[_0x03db('0x8c')]('[RecallMe]'));}else{var _0x3a82c7=new Action(_0x176b19[_0x5a5189],_0x28f0d1);_0x3a82c7['starttime']=moment()[_0x03db('0x5a')](_0x03db('0x8e'));_0x28f0d1['outboundReCallsDay']+=0x1;ut[_0x03db('0x8f')](_0x3a82c7,0x17,'RecallInQueue');if(_0x28f0d1[_0x03db('0x90')]){rpcDb[_0x03db('0x91')](ut[_0x03db('0x92')](_0x176b19[_0x5a5189]));rpcDb[_0x03db('0x93')](_0x3a82c7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x03db('0x8f')](_0x3a82c7,0x16,_0x03db('0x94'));rpcDb['createCustomerHistory'](_0x3a82c7,_0x03db('0x95'));rpcDb['createCustomerFinal'](_0x3a82c7,_0x03db('0x95'));}}}}})[_0x03db('0x7a')](ut[_0x03db('0x8c')]('[getContactRecallMe]'));};Preview[_0x03db('0xf')][_0x03db('0x69')]=function(_0x7223a3){_0x7223a3[_0x03db('0x5d')]=!![];if(ut[_0x03db('0x96')](_0x7223a3[_0x03db('0x97')])){_0x7223a3['message']=_0x03db('0x98');}else if(!ut[_0x03db('0x99')](_0x7223a3[_0x03db('0x36')])){_0x7223a3[_0x03db('0x4f')]=_0x03db('0x5e');}else if(!this[_0x03db('0x9a')](_0x7223a3[_0x03db('0x55')])){if(!this[_0x03db('0x9a')](_0x7223a3[_0x03db('0x9b')])){_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9c');}else{_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9d');}}else{_0x7223a3[_0x03db('0x4f')]=_0x03db('0x9d');}emitCampaignPreview(_0x7223a3);};Preview[_0x03db('0xf')]['callProgressDetectingCustomer']=function(_0x275f86,_0x365a08,_0x2a422e){var _0xcb97d4=this;var _0x42c1cb=this[_0x03db('0x6d')][_0x365a08];var _0x4529c7=this['campaignsPreview'][_0x42c1cb['queue']];var _0x897d3c;if(_0x4529c7){switch(_0x2a422e){case'1':_0x4529c7[_0x03db('0x42')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x0,_0x03db('0xa0'));rpcDb[_0x03db('0x93')](_0x42c1cb,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut['cloneAction'](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xa3'));}delete this[_0x03db('0x6d')][_0x275f86[_0x03db('0xa4')]];break;case _0x03db('0xa5'):var _0x2bf4de=moment()[_0x03db('0x5a')](_0x03db('0x8e'));_0x42c1cb['responsetime']=_0x2bf4de;_0x42c1cb[_0x03db('0xa6')]=_0x2bf4de;_0x42c1cb[_0x03db('0x7d')]=!![];_0x4529c7['pTalking']+=0x1;logger[_0x03db('0x6e')](_0x03db('0xa7'),_0x42c1cb[_0x03db('0xa8')],_0x03db('0xa9'),_0x4529c7['name'],_0x03db('0x73'),_0x4529c7['pTalking']);ami[_0x03db('0x26')]('custom:agentconnect',ut[_0x03db('0xaa')](_0x42c1cb,_0x03db('0xab')));if(_0x4529c7['acw']){ami[_0x03db('0x26')](_0x03db('0xac'),ut[_0x03db('0xad')](_0x42c1cb));}break;case'16':ami['emit'](_0x03db('0xae'),ut[_0x03db('0xaa')](_0x42c1cb,'complete'));emitVoiceQueueChannelRemove(ut[_0x03db('0xaa')](_0x42c1cb,_0x03db('0xaf')));_0x4529c7[_0x03db('0x3d')]+=0x1;_0x4529c7[_0x03db('0x31')]+=0x1;_0x4529c7[_0x03db('0x2b')]+=0x1;ut[_0x03db('0x7e')](_0x4529c7,_0x03db('0xb0'));_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x4,_0x03db('0xb1'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xb2'));rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xb3'));rpcDb[_0x03db('0xb4')](_0x42c1cb);_0x4529c7['sumDuration']+=_0x42c1cb[_0x03db('0xb5')];_0x4529c7[_0x03db('0xb6')]+=_0x42c1cb[_0x03db('0xb5')];logger[_0x03db('0x6e')](_0x03db('0xb7'),_0x42c1cb[_0x03db('0xa8')],_0x03db('0xa9'),_0x4529c7[_0x03db('0x29')],_0x03db('0x73'),_0x4529c7['pTalking']);delete this[_0x03db('0x6d')][_0x275f86['linkedid']];break;case'BUSY':_0x4529c7[_0x03db('0xb8')]+=0x1;_0x42c1cb[_0x03db('0xb9')]+=0x1;_0x42c1cb['countglobal']=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x5,'Busy');rpcDb['createCustomerHistory'](_0x42c1cb,_0x03db('0xba'));if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7['dialGlobalMaxRetry']){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,_0x03db('0xbc'));}else{if(_0x42c1cb[_0x03db('0xb9')]>=_0x4529c7['dialBusyMaxRetry']){rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xba'));}else{rpcDb[_0x03db('0xbd')](ut[_0x03db('0xbe')](_0x42c1cb,_0x03db('0xb9'),_0x4529c7[_0x03db('0xbf')]),_0x42c1cb['unlockAgent'],_0x42c1cb[_0x03db('0xc0')]);}}break;case _0x03db('0xc1'):_0x4529c7[_0x03db('0xc2')]+=0x1;_0x42c1cb[_0x03db('0xc3')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0x3,_0x03db('0xc4'));rpcDb[_0x03db('0x93')](_0x42c1cb,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut['cloneAction'](_0x42c1cb,0xf,_0x03db('0xc5'));rpcDb['createCustomerFinal'](_0x897d3c,_0x03db('0xc6'));}else{if(_0x42c1cb[_0x03db('0xc3')]>=_0x4529c7[_0x03db('0xc7')]){rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xc8'));}else{rpcDb[_0x03db('0xbd')](ut[_0x03db('0xbe')](_0x42c1cb,_0x03db('0xc3'),_0x4529c7['dialNoAnswerRetryFrequency']),_0x42c1cb[_0x03db('0xc9')],_0x42c1cb['activeContact']);}}break;case _0x03db('0xca'):_0x4529c7['outboundCongestionCallsDay']+=0x1;_0x42c1cb[_0x03db('0xcb')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x8,_0x03db('0xcc'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xcd'));if(ut[_0x03db('0x9f')](_0x42c1cb)>=_0x4529c7['dialGlobalMaxRetry']){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,_0x03db('0xc5'));rpcDb[_0x03db('0xa2')](_0x897d3c,_0x03db('0xce'));}else{if(_0x42c1cb[_0x03db('0xcb')]>=_0x4529c7[_0x03db('0xcf')]){rpcDb['createCustomerFinal'](_0x42c1cb,_0x03db('0xcd'));}else{rpcDb[_0x03db('0xbd')](ut['scheduledAt'](_0x42c1cb,_0x03db('0xcb'),_0x4529c7['dialBusyRetryFrequency']),_0x42c1cb[_0x03db('0xc9')],_0x42c1cb[_0x03db('0xc0')]);}}break;case _0x03db('0xd0'):_0x4529c7[_0x03db('0x44')]+=0x1;_0x42c1cb['countglobal']=ut[_0x03db('0x9f')](_0x42c1cb);ut['logCustomer'](_0x42c1cb,0x14,_0x03db('0xd1'));rpcDb[_0x03db('0x93')](_0x42c1cb,_0x03db('0xd2'));if(_0x42c1cb[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x42c1cb[_0x03db('0xd4')]);}if(_0x42c1cb[_0x03db('0xc0')]){rpcDb[_0x03db('0xd5')](_0x42c1cb[_0x03db('0xd4')]);}break;default:if(_0x42c1cb[_0x03db('0x7d')]){ut[_0x03db('0x7e')](_0x4529c7,_0x03db('0xd6'));ut[_0x03db('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4529c7['name'],_0x275f86);}_0x4529c7[_0x03db('0x45')]+=0x1;_0x42c1cb[_0x03db('0x9e')]=ut[_0x03db('0x9f')](_0x42c1cb);ut[_0x03db('0x8f')](_0x42c1cb,0xc,_0x275f86['cause-txt']||_0x275f86[_0x03db('0xd7')]);rpcDb['createCustomerHistory'](_0x42c1cb,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x42c1cb)>=_0x4529c7[_0x03db('0xa1')]){_0x897d3c=ut[_0x03db('0xbb')](_0x42c1cb,0xf,'Global');rpcDb[_0x03db('0xa2')](_0x897d3c,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x03db('0xa2')](_0x42c1cb,_0x03db('0xd8'));}delete this[_0x03db('0x6d')][_0x275f86[_0x03db('0xa4')]];}if(!(_0x42c1cb['dialAnswer']&&_0x2a422e==='16')){ut[_0x03db('0xd9')](_0x4529c7,'[callProgressDetectingCustomer]');logger[_0x03db('0x6e')](_0x03db('0xda'),_0x42c1cb[_0x03db('0xa8')],'\x20Queue',_0x4529c7[_0x03db('0x29')],'originated:\x20',_0x4529c7[_0x03db('0x50')]);}if(_0x2a422e!=='ANSWER'){delete this['actions'][_0x275f86[_0x03db('0xa4')]];delete this['actions'][_0x275f86['destlinkedid']];}}};Preview[_0x03db('0xf')]['callProgressDetectingAgent']=function(_0x14c879,_0x24ce1a,_0x282a97){if(_[_0x03db('0xdb')](_0x24ce1a)&&_0x03db('0xdc')!==typeof _0x24ce1a){return;}if(_[_0x03db('0xdb')](_0x282a97)&&_0x03db('0xdc')!==typeof _0x282a97){return;}switch(_0x282a97[_0x03db('0xdd')]){case'0':ut[_0x03db('0xde')](_0x14c879,0x0,_0x03db('0xa0'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe0'));break;case'3':ut['logAgent'](_0x14c879,0x3,_0x03db('0xc4'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe1'));break;case'5':ut[_0x03db('0xde')](_0x14c879,0x5,'Busy');rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe2'));break;case'8':ut[_0x03db('0xde')](_0x14c879,0x8,_0x03db('0xcc'));rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe3'));break;case'22':ut[_0x03db('0xde')](_0x14c879,0x16,'AnswerAGI');rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe4'));break;default:ut[_0x03db('0xde')](_0x14c879,0xc,_0x282a97[_0x03db('0xdd')]);rpcDb[_0x03db('0xdf')](_0x14c879,_0x03db('0xe3'));}ut['updateOriginated'](_0x24ce1a,_0x03db('0xe5'));logger[_0x03db('0x6e')](_0x03db('0xe6'),_0x14c879[_0x03db('0xa8')],_0x03db('0xa9'),_0x24ce1a['name'],'originated:\x20',_0x24ce1a[_0x03db('0x50')]);delete this['actions'][_0x14c879[_0x03db('0xa8')]];};Preview[_0x03db('0xf')][_0x03db('0xe7')]=function(_0x157653,_0x9486a4,_0x130c33,_0x10abca,_0x4c8a92){var _0x406913=this;return new BPromise(function(_0x536c76,_0x10e611){if(_[_0x03db('0x6c')](_0x9486a4)||_['isNil'](_0x9486a4[_0x03db('0xe8')])||_[_0x03db('0x6c')](_0x9486a4[_0x03db('0xe8')]['phone'])||_[_0x03db('0x6c')](_0x9486a4[_0x03db('0x76')])){_0x10e611(ut[_0x03db('0x4f')](_0x03db('0xe9'),_0x10abca,_0x4c8a92));return;}var _0x29522d=uuid['v4']();var _0x3bd892=_0x406913[_0x03db('0x13')][_0x9486a4[_0x03db('0x70')]['name']];var _0x171d1c=_0x130c33?_0x406913[_0x03db('0x16')][_0x130c33]['id']:undefined;_0x406913[_0x03db('0x6d')][_0x29522d]=new Action(_0x9486a4,_0x3bd892,_0x29522d,_0x130c33,_0x171d1c);var _0x4298c2=_0x406913['actions'][_0x29522d];_0x4298c2[_0x03db('0xc9')]=_0x10abca;_0x4298c2['activeContact']=_0x4c8a92;_0x4298c2[_0x03db('0xea')]=_0x130c33;if(_[_0x03db('0xeb')](_0x157653)){_0x406913[_0x03db('0xec')](_0x4298c2,_0x3bd892,_0x9486a4,_0x130c33)[_0x03db('0x87')](function(_0x105fc0){logger[_0x03db('0x6e')](_0x03db('0xed'),'Queue:\x20'+_0x4298c2[_0x03db('0x71')]+'\x20IdHopper:\x20'+_0x4298c2['idContact'],JSON[_0x03db('0x59')](_0x105fc0));ami[_0x03db('0x26')](_0x03db('0xee'),ut['buildObj'](_0x4298c2,_0x03db('0xef')));_0x536c76(ut['message'](_0x03db('0xf0')));})['catch'](function(_0x2e1aaa){ut[_0x03db('0x5f')](_0x03db('0xf1'),_0x2e1aaa);_0x10e611(ut[_0x03db('0x4f')]('Call\x20failed',_0x10abca,_0x4c8a92));});}else{_0x3bd892[_0x03db('0x3e')]+=0x1;ut[_0x03db('0xf2')](_0x4298c2);rpcDb[_0x03db('0xf3')](_0x4298c2,'[Blacklist][error]');delete _0x406913[_0x03db('0x6d')][_0x29522d];_0x10e611(ut[_0x03db('0x4f')](_0x03db('0xf4'),_0x10abca,_0x4c8a92));}});};Preview[_0x03db('0xf')]['isTrunkReachable']=function(_0x4dad07){return!_[_0x03db('0x6c')](_0x4dad07)&&!_['isNil'](_0x4dad07['name'])&&!_[_0x03db('0x6c')](_0x4dad07[_0x03db('0x56')])&&_0x4dad07[_0x03db('0x56')]&&!_[_0x03db('0x6c')](this[_0x03db('0x15')][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07[_0x03db('0x29')])])&&!_[_0x03db('0x6c')](this[_0x03db('0x15')][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07[_0x03db('0x29')])][_0x03db('0x78')])&&(this[_0x03db('0x15')][util[_0x03db('0x5a')]('SIP/%s',_0x4dad07['name'])]['status']==='reachable'||this['trunks'][util[_0x03db('0x5a')](_0x03db('0xf5'),_0x4dad07['name'])]['status']===_0x03db('0xf6'));};Preview['prototype'][_0x03db('0xf7')]=function(_0x5e44b5,_0x5ae3da){var _0x587f1f=this;return new BPromise(function(_0x8a43b2,_0x51e16f){_0x587f1f[_0x03db('0xf8')](_0x5e44b5,_0x5ae3da)[_0x03db('0x87')](function(_0x2ed445){_0x8a43b2(_[_0x03db('0xf9')](_0x2ed445,[_0x03db('0x4f')]));})[_0x03db('0x7a')](function(_0x5357b6){if(_0x5357b6[_0x03db('0xfa')]){rpcDb['unlockContact'](_0x5e44b5);}if(_0x5357b6[_0x03db('0x56')]){rpcDb[_0x03db('0xd5')](_0x5e44b5);}_0x51e16f(_[_0x03db('0xf9')](_0x5357b6,[_0x03db('0x4f')]));});});};Preview['prototype'][_0x03db('0xf8')]=function(_0x52efef,_0x370219){var _0x55d2d7=this;return new BPromise(function(_0x2b141b,_0x46b6ae){var _0x1c6a59,_0x5b14ff;rpcDb['getContactPreview'](_0x52efef)[_0x03db('0x87')](function(_0x58e43e){if(!_['isNil'](_0x58e43e[0x0])){_0x5b14ff=_0x58e43e[0x0][_0x03db('0xfb')]?![]:!![];_0x1c6a59=_0x58e43e[0x0][_0x03db('0xfb')]?!![]:![];_0x1c6a59=_0x370219?!![]:_0x1c6a59;}var _0x515f02=_0x55d2d7['validateContact'](_0x58e43e);if(_0x515f02[_0x03db('0xfc')]){rpcDb[_0x03db('0xfd')](_[_0x03db('0xf9')](_0x58e43e[0x0],[_0x03db('0x76'),_0x03db('0xfe')]))['then'](function(_0x4ac0d7){_0x55d2d7[_0x03db('0xe7')](_0x4ac0d7,_0x58e43e[0x0],_0x370219,_0x5b14ff,_0x1c6a59)[_0x03db('0x87')](function(_0x112ef8){_0x2b141b(_0x112ef8);})[_0x03db('0x7a')](function(_0x476dda){_0x46b6ae(_0x476dda);});})[_0x03db('0x7a')](function(_0x4e6369){ut[_0x03db('0x5f')](_0x03db('0xff'),_0x4e6369);_0x46b6ae(ut['message'](_0x03db('0x100'),_0x5b14ff,_0x1c6a59));});}else{_0x46b6ae(ut['message'](_0x515f02[_0x03db('0x4f')],_0x5b14ff,_0x1c6a59));}})[_0x03db('0x7a')](function(_0x45fdc5){ut[_0x03db('0x5f')]('[Preview][getContactPreview]',_0x45fdc5);_0x46b6ae(ut[_0x03db('0x4f')](_0x03db('0x100'),![],!![]));});});};Preview[_0x03db('0xf')][_0x03db('0x101')]=function(_0x16c31a){if(_[_0x03db('0x6c')](_0x16c31a)||_[_0x03db('0xeb')](_0x16c31a)||!_['isNil'](_0x16c31a[0x0]['Agent'])&&_[_0x03db('0x6c')](_0x16c31a[0x0]['Agent'][_0x03db('0x29')])){ut[_0x03db('0x5f')](_0x03db('0x102'),_0x16c31a);return{'isValid':![],'message':_0x03db('0x103')};}var _0x1d24ad=this[_0x03db('0x13')][_0x16c31a[0x0][_0x03db('0x70')][_0x03db('0x29')]];_0x1d24ad['message']='ACTIVE';if(_['isNil'](_0x1d24ad)){ut[_0x03db('0x5f')](_0x03db('0x104'),_0x1d24ad);return{'isValid':![],'message':_0x03db('0x105')};}if(!this['isTrunkReachable'](_0x1d24ad[_0x03db('0x55')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x03db('0x106')+_0x1d24ad[_0x03db('0x29')]+_0x03db('0x107'));if(!this[_0x03db('0x9a')](_0x1d24ad[_0x03db('0x9b')])){ut[_0x03db('0x5f')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1d24ad['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x03db('0x108')};}}if(!ut['isActive'](_0x1d24ad['dialActive'])){ut[_0x03db('0x5f')](_0x03db('0x109'),_0x1d24ad[_0x03db('0x29')]+_0x03db('0x10a'));return{'isValid':![],'message':_0x03db('0x106')+_0x1d24ad[_0x03db('0x29')]+_0x03db('0x10a')};}return{'isValid':!![],'message':_0x03db('0x10b')};};Preview[_0x03db('0xf')][_0x03db('0xec')]=function(_0x5d45e6,_0x12ff61,_0x3d3019,_0x5da8d1){var _0x49edfa=this;return new BPromise(function(_0x471296,_0x4c4c1e){var _0x15d0f5=_0x5d45e6[_0x03db('0xa8')];var _0x311cf8=_0x49edfa[_0x03db('0x9a')](_0x12ff61['Trunk'])?util[_0x03db('0x5a')](_0x03db('0x10c'),_0x12ff61[_0x03db('0x55')][_0x03db('0x29')],_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x3b')])?'':_0x12ff61[_0x03db('0x3b')][_0x03db('0x10d')]()||'',_0x12ff61[_0x03db('0x10e')]>0x0?_0x3d3019['Contact']['phone'][_0x03db('0x10f')](_0x12ff61[_0x03db('0x10e')]):_0x3d3019[_0x03db('0xe8')][_0x03db('0x110')]):util[_0x03db('0x5a')](_0x03db('0x10c'),_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x9b')])?_0x12ff61[_0x03db('0x55')]['name']:_0x12ff61[_0x03db('0x9b')]['name'],_['isNil'](_0x12ff61[_0x03db('0x3b')])?'':_0x12ff61[_0x03db('0x3b')]['trim']()||'',_0x12ff61['dialCutDigit']>0x0?_0x3d3019[_0x03db('0xe8')][_0x03db('0x110')]['substring'](_0x12ff61[_0x03db('0x10e')]):_0x3d3019['Contact'][_0x03db('0x110')]);var _0x2e50fb=_0x49edfa[_0x03db('0x9a')](_0x12ff61[_0x03db('0x55')])?ut[_0x03db('0x111')](_0x12ff61[_0x03db('0x55')][_0x03db('0x57')],_0x12ff61['dialOriginateCallerIdName'],_0x12ff61[_0x03db('0x112')]>0x0?ut['getCallerIdRandom'](_0x12ff61[_0x03db('0x39')],_0x12ff61[_0x03db('0x112')]):_0x12ff61[_0x03db('0x39')]):ut[_0x03db('0x111')](_[_0x03db('0x6c')](_0x12ff61[_0x03db('0x9b')])?_0x12ff61[_0x03db('0x55')][_0x03db('0x57')]:_0x12ff61[_0x03db('0x9b')][_0x03db('0x57')],_0x12ff61[_0x03db('0x38')],_0x12ff61[_0x03db('0x112')]>0x0?ut[_0x03db('0x113')](_0x12ff61[_0x03db('0x39')],_0x12ff61['dialRandomLastDigitCallerIdNumber']):_0x12ff61[_0x03db('0x39')]);if(_0x2e50fb){_0x5d45e6[_0x03db('0x114')]=ut['extractCalleridName'](_0x2e50fb);_0x5d45e6[_0x03db('0x115')]=ut['extractCalleridNumber'](_0x2e50fb);}var _0x187ffe=ut[_0x03db('0x116')](_0x12ff61,_0x3d3019,_0x311cf8,_0x2e50fb,_0x15d0f5,_0x5d45e6);_[_0x03db('0x117')](_0x5d45e6,ut[_0x03db('0x118')](_0x187ffe));_0x5d45e6[_0x03db('0x119')]=moment()[_0x03db('0x5a')](_0x03db('0x8e'));ami[_0x03db('0x11a')](ut[_0x03db('0x11b')](_0x5d45e6,_0x12ff61,_0x187ffe,_0x5d45e6[_0x03db('0xc0')],_0x5da8d1))[_0x03db('0x87')](function(_0x167873){_0x12ff61[_0x03db('0x50')]+=0x1;logger[_0x03db('0x6e')](_0x03db('0x11c'),_0x15d0f5,_0x03db('0xa9'),_0x12ff61['name'],_0x03db('0x72'),_0x12ff61[_0x03db('0x50')]);_0x471296(_0x167873);})['catch'](function(_0x1a88b7){ut[_0x03db('0xde')](_0x5d45e6,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x5d45e6,_0x03db('0x11d'));_0x4c4c1e(_0x1a88b7);});});};Preview[_0x03db('0xf')][_0x03db('0x1f')]=function(_0x278886){if(this[_0x03db('0x6d')][_0x278886[_0x03db('0xa4')]]){this[_0x03db('0x6d')][_0x278886[_0x03db('0xa4')]][_0x03db('0x79')]=_0x278886[_0x03db('0x79')];}};Preview[_0x03db('0xf')][_0x03db('0x18')]=function(_0x2d01ea){var _0x41c399=this;var _0x28ee72=this[_0x03db('0x6d')][_0x2d01ea[_0x03db('0x11e')]];if(_0x28ee72){if(_0x28ee72[_0x03db('0xea')]&&this[_0x03db('0x16')][_0x28ee72[_0x03db('0xea')]]){ut[_0x03db('0x11f')](_0x28ee72,this[_0x03db('0x16')][_0x28ee72[_0x03db('0xea')]][_0x03db('0x29')],this['agents'][_0x28ee72[_0x03db('0xea')]]['id']);}var _0x4248c5=_[_0x03db('0x120')](_0x28ee72);_0x4248c5[_0x03db('0x121')]=moment()['format'](_0x03db('0x8e'));var _0x19d0e1=_0x41c399[_0x03db('0x13')][_0x28ee72[_0x03db('0x71')]];if(ut['isFailure'](_0x2d01ea[_0x03db('0x122')])){if(_0x28ee72[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x28ee72[_0x03db('0xd4')]);}if(_0x28ee72[_0x03db('0xc0')]){rpcDb[_0x03db('0xd5')](_0x28ee72[_0x03db('0xd4')]);}ami[_0x03db('0x26')](_0x03db('0x123'),ut[_0x03db('0xaa')](_0x28ee72,'rejected'));this[_0x03db('0x124')](_0x4248c5,_0x19d0e1,_0x2d01ea);}else{_0x28ee72[_0x03db('0x119')]=moment()[_0x03db('0x5a')](_0x03db('0x8e'));ut[_0x03db('0xde')](_0x4248c5,0x4,_0x03db('0xb1'));rpcDb[_0x03db('0xdf')](_0x4248c5,_0x03db('0x125'));}}};Preview[_0x03db('0xf')][_0x03db('0x1a')]=function(_0x1cd259){var _0x3c41fd=this;var _0x2e8e0f=this['actions'][_0x1cd259['linkedid']];var _0x5adc87;if(_0x2e8e0f){_0x5adc87=this[_0x03db('0x13')][_0x2e8e0f['queue']];logger['info']('[syncHangup][talking]',_0x1cd259[_0x03db('0xa4')],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87[_0x03db('0x2d')]);}if(this['actions'][_0x1cd259[_0x03db('0xa4')]]&&_0x1cd259[_0x03db('0xa4')]!==_0x1cd259[_0x03db('0xa8')]){if(_0x1cd259[_0x03db('0x126')]==='16'&&this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]][_0x03db('0x7d')]){this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}else if(this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]]['dialAnswer']){logger[_0x03db('0x6e')](_0x03db('0x128'),_0x1cd259['linkedid'],_0x1cd259[_0x03db('0x126')],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}}else if(_0x2e8e0f&&_[_0x03db('0x6c')](_0x2e8e0f[_0x03db('0x129')])&&_0x5adc87[_0x03db('0x12a')]&&_0x1cd259[_0x03db('0xa4')]===_0x1cd259[_0x03db('0xa8')]&&_[_0x03db('0x6c')](_0x1cd259[_0x03db('0xdd')])&&_0x1cd259[_0x03db('0x126')]==='16'&&_0x1cd259['channelstate']==='6'&&_['isUndefined'](_0x2e8e0f[_0x03db('0x12b')])){if(_0x2e8e0f[_0x03db('0xc9')]){rpcDb[_0x03db('0xd3')](_0x2e8e0f[_0x03db('0xd4')]);}if(_0x2e8e0f[_0x03db('0xc0')]){rpcDb['disableContact'](_0x2e8e0f[_0x03db('0xd4')]);}_0x1cd259['reason']='22';this[_0x03db('0x124')](_0x2e8e0f,_0x5adc87,_0x1cd259);}else if(_0x2e8e0f&&_0x2e8e0f[_0x03db('0x12b')]){if(_0x1cd259[_0x03db('0x126')]==='16'&&this[_0x03db('0x6d')][_0x1cd259[_0x03db('0xa4')]][_0x03db('0x7d')]){logger[_0x03db('0x6e')](_0x03db('0x12c'),_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause'],_0x03db('0xa9'),_0x5adc87[_0x03db('0x29')],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause']);}else if(this['actions'][_0x1cd259['linkedid']][_0x03db('0x7d')]){logger[_0x03db('0x6e')](_0x03db('0x128'),_0x1cd259[_0x03db('0xa4')],_0x1cd259['cause'],_0x03db('0xa9'),_0x5adc87['name'],_0x03db('0x73'),_0x5adc87['pTalking']);this[_0x03db('0x127')](_0x1cd259,_0x1cd259[_0x03db('0xa4')],_0x1cd259[_0x03db('0x126')]);}}};Preview[_0x03db('0xf')][_0x03db('0x1d')]=function(_0x475b1e){if(this[_0x03db('0x6d')][_0x475b1e['destlinkedid']]&&_0x475b1e[_0x03db('0x12d')]!==_0x475b1e[_0x03db('0x12e')]){this[_0x03db('0x127')](_0x475b1e,_0x475b1e[_0x03db('0x12d')],_0x475b1e['dialstatus']);}};Preview['prototype']['syncHangupRequest']=function(_0x26fb72){if(this['actions'][_0x26fb72[_0x03db('0xa4')]]&&_0x26fb72[_0x03db('0xa4')]!==_0x26fb72['uniqueid']&&!this[_0x03db('0x6d')][_0x26fb72['linkedid']]['dialAnswer']){if(_0x26fb72[_0x03db('0x126')]==='1'){this['callProgressDetectingCustomer'](_0x26fb72,_0x26fb72[_0x03db('0xa4')],_0x26fb72[_0x03db('0x126')]);}}};Preview[_0x03db('0xf')][_0x03db('0x12f')]=function(_0x31e743,_0x12f70f,_0x52b7ce){if(this[_0x03db('0x6d')][_0x31e743]){if(_[_0x03db('0x6c')](this[_0x03db('0x6d')][_0x31e743]['variables'])){this[_0x03db('0x6d')][_0x31e743]['variables']={};}this[_0x03db('0x6d')][_0x31e743][_0x03db('0x130')][_0x12f70f]=_0x52b7ce;}};Preview[_0x03db('0xf')][_0x03db('0x21')]=function(_0x4a5630){try{if(!_[_0x03db('0x6c')](_0x4a5630)){if(ut[_0x03db('0x131')](_[_0x03db('0x132')](_0x4a5630[_0x03db('0x133')])[0x0])){this[_0x03db('0x12f')](_0x4a5630[_0x03db('0xa8')],_[_0x03db('0x132')](_0x4a5630['variable'])[0x0],_0x4a5630[_0x03db('0x134')]);}}}catch(_0x2d2203){logger[_0x03db('0x135')](_0x03db('0x136'),util[_0x03db('0x137')](_0x2d2203,{'showHidden':![],'depth':null}));}};Preview[_0x03db('0xf')][_0x03db('0x23')]=function(_0x4bb71f){if(_0x4bb71f){if(this[_0x03db('0x6d')][_0x4bb71f[_0x03db('0x138')]]){this[_0x03db('0x6d')][_0x4bb71f[_0x03db('0x138')]][_0x03db('0x12b')]=!![];}}};Preview[_0x03db('0xf')][_0x03db('0x139')]=function(_0x595fd5){if(_0x595fd5){if(this['actions'][_0x595fd5['transfererlinkedid']]){this['actions'][_0x595fd5['transfererlinkedid']][_0x03db('0x12b')]=!![];}}};module[_0x03db('0x13a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d7be612..da5b44c 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 _0x7fb0=['create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED'];(function(_0x4ed55c,_0x575fcc){var _0x409cfd=function(_0x27ffa3){while(--_0x27ffa3){_0x4ed55c['push'](_0x4ed55c['shift']());}};_0x409cfd(++_0x575fcc);}(_0x7fb0,0x155));var _0x07fb=function(_0x1ecd2d,_0x3e247a){_0x1ecd2d=_0x1ecd2d-0x0;var _0x17aba7=_0x7fb0[_0x1ecd2d];return _0x17aba7;};'use strict';var util=require('util');var BPromise=require(_0x07fb('0x0'));var logger=require(_0x07fb('0x1'))(_0x07fb('0x2'));var _=require('lodash');var cmHopper=require(_0x07fb('0x3'));var cmHopperFinal=require(_0x07fb('0x4'));var cmHopperHistory=require(_0x07fb('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x07fb('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x07fb('0x7'));function loggerCatch(_0x5862c4){return function(_0x4d8433){logger[_0x07fb('0x8')](_0x5862c4,util[_0x07fb('0x9')](_0x4d8433,{'showHidden':![],'depth':null}));};}function create(_0x4d3e7f){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopperHistory[_0x07fb('0xc')](_0x4d3e7f))[_0x07fb('0xd')](loggerCatch(_0x07fb('0xe')));}function createAgent(_0x3bae46){return BPromise[_0x07fb('0xa')]()['then'](agentReportPreview[_0x07fb('0xc')](_0x3bae46))['catch'](loggerCatch(_0x07fb('0xe')));}function moveContact(_0x27bd5d){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0xf')](_0x27bd5d,!![]))['catch'](loggerCatch(_0x07fb('0x10')));}exports[_0x07fb('0x11')]=function(_0x3368b3){return BPromise['resolve']()['then'](cmHopperBlack[_0x07fb('0x11')](_0x3368b3))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x12')));};exports['getContactPreview']=function(_0x2c4c56){return BPromise[_0x07fb('0xa')]()['then'](cmHopper[_0x07fb('0x13')](_0x2c4c56))[_0x07fb('0xd')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x5bdc3f,_0x42b2ec){create(_0x5bdc3f)[_0x07fb('0xd')](loggerCatch(_0x42b2ec));moveContact(_0x5bdc3f)[_0x07fb('0xd')](loggerCatch(_0x42b2ec));};exports['createAgentHistory']=function(_0x202328,_0xbae940){createAgent(_0x202328)[_0x07fb('0xd')](loggerCatch(_0xbae940));};exports[_0x07fb('0x14')]=function(_0x94565,_0x5195f4){create(_0x94565)['catch'](loggerCatch(_0x5195f4));};exports[_0x07fb('0x15')]=function(_0x1059b8,_0x413298){moveContact(_0x1059b8)[_0x07fb('0xd')](loggerCatch(_0x413298));};exports['rescheduleContact']=function(_0x3b57e3,_0x227c92,_0x4210ab){if(_0x227c92){_0x3b57e3[_0x07fb('0x16')]=null;}if(_0x4210ab){_0x3b57e3['active']=![];}return BPromise[_0x07fb('0xa')]()['then'](cmHopper[_0x07fb('0x17')](_0x3b57e3))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x18')));};exports[_0x07fb('0x19')]=function(_0x54e27){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0x19')](_0x54e27))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x07fb('0x1a')]=function(_0x536fbb){return BPromise['resolve']()['then'](cmHopper[_0x07fb('0x1a')]({'UserId':null},_0x536fbb,0x1))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x1b')));};exports[_0x07fb('0x1c')]=function(_0x17755f){return BPromise['resolve']()[_0x07fb('0xb')](cmHopper[_0x07fb('0x1a')]({'active':![]},_0x17755f,0x1))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x1d')));};exports[_0x07fb('0x1e')]=function(_0xc11070){var _0x5aac44={};_0x5aac44[_0x07fb('0x1f')]=_0xc11070[_0x07fb('0x1f')];_0x5aac44['uniqueid']=_0xc11070[_0x07fb('0x20')];_0x5aac44['calleridnum']=_0xc11070[_0x07fb('0x21')];_0x5aac44[_0x07fb('0x22')]=_0xc11070[_0x07fb('0x22')];_0x5aac44['queue']=_0xc11070[_0x07fb('0x23')];_0x5aac44[_0x07fb('0x24')]=_0xc11070[_0x07fb('0x25')];_0x5aac44[_0x07fb('0x26')]=_0xc11070['answertime'];_0x5aac44[_0x07fb('0x27')]=0x1;_0x5aac44['queuecallercompleteAt']=_0xc11070[_0x07fb('0x28')];_0x5aac44[_0x07fb('0x29')]=_0xc11070[_0x07fb('0x2a')];_0x5aac44[_0x07fb('0x2b')]=_0x07fb('0x2c');_0x5aac44[_0x07fb('0x2d')]='xcally-motion-preview';_0x5aac44[_0x07fb('0x2e')]=0x0;_0x5aac44[_0x07fb('0x2f')]=0x1;_0x5aac44[_0x07fb('0x30')]=_0xc11070[_0x07fb('0x2a')];_0x5aac44[_0x07fb('0x31')]=_0x07fb('0x32');return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](voiceQueueReport[_0x07fb('0x33')](_0x5aac44))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x34')));};exports[_0x07fb('0x35')]=function(_0x43f975,_0x5bd80a){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0x35')](_0x43f975,_0x5bd80a))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x36')));};exports[_0x07fb('0x37')]=function(_0x12da85){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper['rescheduleContact'](_0x12da85,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x6dd5=['rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dd5,0x15c));var _0x56dd=function(_0x46cad2,_0x2835ad){_0x46cad2=_0x46cad2-0x0;var _0x4ae5f5=_0x6dd5[_0x46cad2];return _0x4ae5f5;};'use strict';var util=require(_0x56dd('0x0'));var BPromise=require(_0x56dd('0x1'));var logger=require(_0x56dd('0x2'))(_0x56dd('0x3'));var _=require(_0x56dd('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x56dd('0x5'));var voiceQueueRt=require(_0x56dd('0x6'));var agentReportPreview=require(_0x56dd('0x7'));var voiceQueueReport=require(_0x56dd('0x8'));function loggerCatch(_0x4c34bc){return function(_0x5793c1){logger[_0x56dd('0x9')](_0x4c34bc,util['inspect'](_0x5793c1,{'showHidden':![],'depth':null}));};}function create(_0x3b81af){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopperHistory['createHistory'](_0x3b81af))[_0x56dd('0xc')](loggerCatch(_0x56dd('0xd')));}function createAgent(_0x381c95){return BPromise['resolve']()[_0x56dd('0xb')](agentReportPreview['createHistory'](_0x381c95))[_0x56dd('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x809e8d){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper[_0x56dd('0xe')](_0x809e8d,!![]))['catch'](loggerCatch(_0x56dd('0xf')));}exports[_0x56dd('0x10')]=function(_0x1ba590){return BPromise['resolve']()[_0x56dd('0xb')](cmHopperBlack[_0x56dd('0x10')](_0x1ba590))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x11')));};exports[_0x56dd('0x12')]=function(_0x1192bc){return BPromise['resolve']()[_0x56dd('0xb')](cmHopper[_0x56dd('0x12')](_0x1192bc))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x13')));};exports['createHistory']=function(_0x3c7c92,_0x218f59){create(_0x3c7c92)['catch'](loggerCatch(_0x218f59));moveContact(_0x3c7c92)[_0x56dd('0xc')](loggerCatch(_0x218f59));};exports[_0x56dd('0x14')]=function(_0x3a8e9e,_0x4d7e82){createAgent(_0x3a8e9e)[_0x56dd('0xc')](loggerCatch(_0x4d7e82));};exports[_0x56dd('0x15')]=function(_0x228e57,_0x228bd8){create(_0x228e57)[_0x56dd('0xc')](loggerCatch(_0x228bd8));};exports[_0x56dd('0x16')]=function(_0x3d1a30,_0x35ddd9){moveContact(_0x3d1a30)[_0x56dd('0xc')](loggerCatch(_0x35ddd9));};exports[_0x56dd('0x17')]=function(_0x4c2007,_0xa21062,_0x5b6305){if(_0xa21062){_0x4c2007[_0x56dd('0x18')]=null;}if(_0x5b6305){_0x4c2007[_0x56dd('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x4c2007))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1a')));};exports['countReScheduled']=function(_0x5f493c){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper[_0x56dd('0x1b')](_0x5f493c))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1c')));};exports[_0x56dd('0x1d')]=function(_0x458d7f){return BPromise[_0x56dd('0xa')]()['then'](cmHopper['unlockContact']({'UserId':null},_0x458d7f,0x1))[_0x56dd('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x56dd('0x1e')]=function(_0x4073bb){return BPromise[_0x56dd('0xa')]()['then'](cmHopper[_0x56dd('0x1d')]({'active':![]},_0x4073bb,0x1))[_0x56dd('0xc')](loggerCatch(_0x56dd('0x1f')));};exports['crateCustomerReportQueue']=function(_0x1ad8bb){var _0x819540={};_0x819540[_0x56dd('0x20')]=_0x1ad8bb['type'];_0x819540[_0x56dd('0x21')]=_0x1ad8bb[_0x56dd('0x21')];_0x819540[_0x56dd('0x22')]=_0x1ad8bb[_0x56dd('0x22')];_0x819540[_0x56dd('0x23')]=_0x1ad8bb[_0x56dd('0x23')];_0x819540[_0x56dd('0x24')]=_0x1ad8bb[_0x56dd('0x24')];_0x819540[_0x56dd('0x25')]=_0x1ad8bb[_0x56dd('0x26')];_0x819540['queuecallerleaveAt']=_0x1ad8bb['answertime'];_0x819540[_0x56dd('0x27')]=0x1;_0x819540[_0x56dd('0x28')]=_0x1ad8bb['endtime'];_0x819540[_0x56dd('0x29')]=_0x1ad8bb[_0x56dd('0x2a')];_0x819540[_0x56dd('0x2b')]=_0x56dd('0x2c');_0x819540[_0x56dd('0x2d')]=_0x56dd('0x2e');_0x819540[_0x56dd('0x2f')]=0x0;_0x819540[_0x56dd('0x30')]=0x1;_0x819540[_0x56dd('0x31')]=_0x1ad8bb[_0x56dd('0x2a')];_0x819540[_0x56dd('0x32')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x819540))['catch'](loggerCatch(_0x56dd('0x33')));};exports['getContactRecallMe']=function(_0x5b5823,_0x1f79be){return BPromise[_0x56dd('0xa')]()[_0x56dd('0xb')](cmHopper['getContactRecallMe'](_0x5b5823,_0x1f79be))[_0x56dd('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x56dd('0x34')]=function(_0x47cfbd){return BPromise['resolve']()[_0x56dd('0xb')](cmHopper[_0x56dd('0x17')](_0x47cfbd,!![],!![]))[_0x56dd('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 0021c05..cdbd171 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 _0x1330=['uniqueid','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','format','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','timeout'];(function(_0x4504a7,_0x563a15){var _0x1b3b76=function(_0xb0f30d){while(--_0xb0f30d){_0x4504a7['push'](_0x4504a7['shift']());}};_0x1b3b76(++_0x563a15);}(_0x1330,0x1f4));var _0x0133=function(_0x156b03,_0x238b09){_0x156b03=_0x156b03-0x0;var _0x302cc5=_0x1330[_0x156b03];return _0x302cc5;};'use strict';var util=require('util');var _=require(_0x0133('0x0'));var moment=require(_0x0133('0x1'));var logger=require(_0x0133('0x2'))(_0x0133('0x3'));var ipAgi=process['env'][_0x0133('0x4')]||_0x0133('0x5');function getSeconds(_0x12e24d,_0xf95880){var _0x2ecd9d=moment(_0x12e24d)[_0x0133('0x6')](0x0);var _0x519efa=moment(_0xf95880)[_0x0133('0x6')](0x0);return _0x2ecd9d[_0x0133('0x7')](_0x519efa,_0x0133('0x8'));}exports[_0x0133('0x9')]=function(_0x10d7c8){return function(_0x206cf1){logger[_0x0133('0xa')](_0x10d7c8,util[_0x0133('0xb')](_0x206cf1,{'showHidden':![],'depth':null}));};};exports[_0x0133('0xc')]=function(_0x278b80,_0x57a9dc){logger[_0x0133('0xd')](_0x278b80,util[_0x0133('0xb')](_0x57a9dc,{'showHidden':![],'depth':null}));};exports[_0x0133('0xe')]=function(_0x5d4ac0,_0x21c9f2){logger[_0x0133('0xa')](_0x5d4ac0,util[_0x0133('0xb')](_0x21c9f2,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x52b72b){return function(_0x1742b2){logger[_0x0133('0xd')](_0x52b72b,util[_0x0133('0xb')](_0x1742b2,{'showHidden':![],'depth':null}));};};exports[_0x0133('0xf')]=function(_0xe2f077,_0x19bf18,_0x1e7901){return{'message':_0xe2f077,'unlock':_0x19bf18,'active':_0x1e7901};};exports[_0x0133('0x10')]=function(_0x2a9860,_0xeefcc4,_0x457650){if(!_[_0x0133('0x11')](_0x457650)&&_0x0133('0x12')===typeof _0x457650&&!_[_0x0133('0x13')](_0x457650)){if(!_[_0x0133('0x11')](_0xeefcc4)&&_0x0133('0x12')===typeof _0xeefcc4&&!_[_0x0133('0x13')](_0xeefcc4)){return util['format'](_0x0133('0x14'),_0xeefcc4,_0x457650);}return util['format'](_0x0133('0x14'),_0x457650,_0x457650);}if(!_[_0x0133('0x11')](_0x2a9860)&&_0x0133('0x12')===typeof _0x2a9860&&!_[_0x0133('0x13')](_0x2a9860)){return _0x2a9860;}return _0x0133('0x15');};exports['isActive']=function(_0x2a95e9){if(_[_0x0133('0x16')](_0x2a95e9)){return![];}return _0x2a95e9;};exports[_0x0133('0x17')]=function(_0x12a494,_0x49503a,_0x4ce0c5,_0x2bac3c,_0x52a05f,_0x3b2324){var _0x15e0b4={'XMD-QUEUE':_0x49503a[_0x0133('0x18')]?_0x49503a[_0x0133('0x18')][_0x0133('0x19')]:'','XMD-CALLERID':_0x2bac3c,'XMD-CALLERID-PREVIEW':_0x3b2324?util[_0x0133('0x1a')]('\x22%s\x22\x20<%s>',_0x3b2324[_0x0133('0x1b')],_0x3b2324[_0x0133('0x1c')]):_0x2bac3c,'XMD-DIALID':_0x52a05f,'XMD-CONTACTID':_0x49503a['ContactId'],'XMD-CDRTYPE':_0x0133('0x1d'),'CALLERID(all)':_0x2bac3c,'XMD-VOICEQUEUEID':_0x49503a[_0x0133('0x1e')],'XMD-DIALCHANNEL':_0x4ce0c5,'XMD-DIALTIMEOUT':_0x12a494[_0x0133('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x0133('0x20'),_0x12a494['dialQueueProject2']?'g':'',_[_0x0133('0x13')](_0x12a494['monitor_format'])?'':_0x0133('0x21')),'XMD-DIALURL':_0x12a494[_0x0133('0x22')]||'','XMD-AGI':_0x12a494[_0x0133('0x23')]?util[_0x0133('0x1a')](_0x0133('0x24'),ipAgi,_0x12a494[_0x0133('0x23')]):_0x0133('0x25'),'XMD-AGIAFTER':_0x12a494[_0x0133('0x26')]?util['format'](_0x0133('0x24'),ipAgi,_0x12a494['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3b2324?_0x3b2324[_0x0133('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x3b2324?_0x3b2324[_0x0133('0x28')]:'','XMD-DESTINATION':_0x0133('0x29')};if(!_[_0x0133('0x13')](_0x12a494[_0x0133('0x2a')])){_0x15e0b4[util[_0x0133('0x1a')]('%s',_0x0133('0x2b'))]=_0x12a494[_0x0133('0x2a')];_0x15e0b4[util[_0x0133('0x1a')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x52a05f;}if(_0x49503a&&_0x49503a[_0x0133('0x2c')]){for(var _0x35754f in _0x49503a['Contact']){if(_0x49503a[_0x0133('0x2c')][_0x0133('0x2d')](_0x35754f)){if(!_[_0x0133('0x16')](_0x49503a[_0x0133('0x2c')][_0x35754f])&&_0x35754f!=='id'&&_0x35754f!=='tags'&&_0x35754f!==_0x0133('0x2e')&&_0x35754f!==_0x0133('0x2f')){_0x15e0b4[util['format'](_0x0133('0x30'),_0x0133('0x31'),_[_0x0133('0x32')](_0x35754f))]=_0x49503a[_0x0133('0x2c')][_0x35754f];}}}}return _0x15e0b4;};exports[_0x0133('0x33')]=function(_0x2420de){var _0x4ae110={};for(var _0x351420 in _0x2420de){if(_0x2420de[_0x0133('0x2d')](_0x351420)){_0x4ae110[util['format']('%s',_[_0x0133('0x34')](_0x351420))]=_0x2420de[_0x351420];}}return{'variables':_0x4ae110};};exports[_0x0133('0x35')]=function(_0x1c5f79,_0x296ddb){if(!_[_0x0133('0x16')](_0x1c5f79)){if(_0x1c5f79['hasOwnProperty'](_0x0133('0x36'))){if(_0x1c5f79[_0x0133('0x36')]>0x0){_0x1c5f79[_0x0133('0x36')]-=0x1;}else{logger[_0x0133('0xa')](_0x0133('0x37'),_0x296ddb);}}}else{logger[_0x0133('0xa')](_0x0133('0x38'),_0x296ddb);}};exports['logBlacklist']=function(_0x3514cf){var _0x3d2664=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x3514cf['state']=0xd;_0x3514cf['statedesc']=_0x0133('0x3a');_0x3514cf[_0x0133('0x3b')]=_0x3d2664;_0x3514cf[_0x0133('0x3c')]=_0x3d2664;_0x3514cf[_0x0133('0x3d')]=_0x3d2664;};exports[_0x0133('0x3e')]=function(_0x5bb0dd,_0x4b3b95,_0xa2513b){var _0x580730=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x5bb0dd['state']=_0x4b3b95;_0x5bb0dd[_0x0133('0x3f')]=_0xa2513b;_0x5bb0dd[_0x0133('0x3c')]=_0x580730;_0x5bb0dd[_0x0133('0x40')]=getSeconds(_0x5bb0dd['responsetime'],_0x5bb0dd['starttime']);};exports[_0x0133('0x41')]=function(_0x5c2669,_0x481c3c,_0x2e03d5){_0x5c2669[_0x0133('0x42')]=_0x481c3c;_0x5c2669[_0x0133('0x43')]=_0x2e03d5;};exports[_0x0133('0x44')]=function(_0x5ea321,_0x2b7464,_0xeaf6aa){var _0x5027d0=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x5ea321[_0x0133('0x45')]=_0x2b7464;_0x5ea321[_0x0133('0x3f')]=_0xeaf6aa;_0x5ea321[_0x0133('0x3c')]=_0x5ea321[_0x0133('0x3c')]?_0x5ea321[_0x0133('0x3c')]:_0x5027d0;_0x5ea321[_0x0133('0x3d')]=_0x5ea321[_0x0133('0x3d')]?_0x5ea321[_0x0133('0x3d')]:_0x5027d0;_0x5ea321[_0x0133('0x40')]=getSeconds(_0x5ea321[_0x0133('0x3c')]||0x0,_0x5ea321['starttime']||0x0);_0x5ea321[_0x0133('0x46')]=_0x5ea321[_0x0133('0x47')]?getSeconds(_0x5ea321[_0x0133('0x3d')],_0x5ea321[_0x0133('0x47')]):0x0;};exports[_0x0133('0x48')]=function(_0x25d8cd){return _0x25d8cd==='Failure';};exports[_0x0133('0x49')]=function(_0x503a5e,_0x59f68f,_0x2219f0,_0x303c30,_0x1c756d){var _0x360cca=_0x303c30?_0x0133('0x4a'):_0x503a5e[_0x0133('0x1b')];_0x360cca=_0x1c756d?_0x0133('0x4b'):_0x360cca;return{'actionid':_0x503a5e['uniqueid'],'action':_0x0133('0x4c'),'channel':_0x503a5e[_0x0133('0x4d')],'callerid':util[_0x0133('0x1a')](_0x0133('0x14'),_0x360cca,_0x503a5e[_0x0133('0x1c')]),'Exten':_0x0133('0x29'),'Context':_0x0133('0x4e'),'Priority':'1','variable':_0x2219f0,'timeout':(_0x59f68f[_0x0133('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x503a5e[_0x0133('0x50')]};};exports[_0x0133('0x51')]=function(_0x1ee014){return _0x1ee014[_0x0133('0x52')]+_0x1ee014['countcongestionretry']+_0x1ee014[_0x0133('0x53')];};exports[_0x0133('0x54')]=function(_0x3b4b12){var _0x533f13=_[_0x0133('0x55')](_0x3b4b12);_0x533f13['state']=0xf;_0x533f13[_0x0133('0x3f')]=_0x0133('0x56');return _0x533f13;};exports[_0x0133('0x57')]=function(_0xbae95,_0x483752,_0x40c198){var _0x4dbe20={};_0x4dbe20[_0x483752]=_0xbae95[_0x483752];_0x4dbe20[_0x0133('0x58')]=![];_0x4dbe20['scheduledat']=moment()['add'](_0x40c198,'minutes')['format'](_0x0133('0x39'));_0x4dbe20[_0x0133('0x59')]=_0xbae95[_0x0133('0x59')];_0x4dbe20[_0x0133('0x5a')]=_0xbae95[_0x0133('0x5a')];_0x4dbe20[_0x0133('0x1e')]=_0xbae95[_0x0133('0x1e')]||undefined;return _0x4dbe20;};exports[_0x0133('0x5b')]=function(_0x2fdef6,_0x2b37c4){if(!_['isNil'](_0x2fdef6)){if(_0x2fdef6['pTalking']>0x0){_0x2fdef6['pTalking']-=0x1;}else{logger['error'](_0x2b37c4,_0x0133('0x5c'));}}else{logger[_0x0133('0xa')](_0x2b37c4,_0x0133('0x5d'));}};exports[_0x0133('0x5e')]=function(_0x20f39e){if(_0x20f39e<=0x0){return!![];}return![];};exports[_0x0133('0x5f')]=function(_0x278734,_0x1d5db4){_0x278734[_0x0133('0x60')]=_0x1d5db4;_0x278734['name']=_0x278734[_0x0133('0x61')];_0x278734[_0x0133('0x62')]=_0x278734['channelAgent'];return _0x278734;};exports[_0x0133('0x63')]=function(_0x54838f){var _0x5d12fc={};_0x5d12fc['queue']=_0x54838f['queue'];_0x5d12fc[_0x0133('0x62')]=_0x54838f['channelAgent'];_0x5d12fc[_0x0133('0x50')]=_0x54838f[_0x0133('0x50')];return _0x5d12fc;};exports[_0x0133('0x64')]=function(_0x6eeab9){var _0x5b3234=[];for(var _0x3d4dc4 in _0x6eeab9){if(_0x6eeab9['hasOwnProperty'](_0x3d4dc4)){if(!_[_0x0133('0x16')](_0x6eeab9[_0x3d4dc4])&&_0x6eeab9[_0x3d4dc4]['state']===_0x0133('0x65')&&_0x6eeab9[_0x3d4dc4]['status']===_0x0133('0x66')){_0x5b3234[_0x0133('0x67')](_0x6eeab9[_0x3d4dc4]['id']);}}}return _0x5b3234;};exports[_0x0133('0x68')]=function(_0x2a69c6){var _0x5d9c33=moment()['milliseconds'](0x0);var _0xfe8728=moment(_0x2a69c6)[_0x0133('0x6')](0x0);return _0x5d9c33[_0x0133('0x7')](_0xfe8728,_0x0133('0x8'));};exports['createBody']=function(_0x5309f8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5309f8[_0x0133('0x59')],'ListId':_0x5309f8['ListId'],'VoiceQueueId':_0x5309f8[_0x0133('0x1e')]||undefined,'CampaignId':_0x5309f8[_0x0133('0x69')]||undefined};};exports[_0x0133('0x6a')]=function(_0x5a57e8){if(_0x5a57e8===_0x0133('0x50')||_0x5a57e8===_0x0133('0x6b')||_0x5a57e8===_0x0133('0x61')||_0x5a57e8===_0x0133('0x6c')||_0x5a57e8===_0x0133('0x6d')||_0x5a57e8===_0x0133('0x6e')||_0x5a57e8==='membername'||_0x5a57e8==='channelAgent'||_0x5a57e8===_0x0133('0x1b')||_0x5a57e8===_0x0133('0x58')||_0x5a57e8===_0x0133('0x1c')||_0x5a57e8===_0x0133('0x6f')||_0x5a57e8==='countbusyretry'||_0x5a57e8==='countcongestionretry'||_0x5a57e8===_0x0133('0x53')||_0x5a57e8===_0x0133('0x70')||_0x5a57e8==='callback'||_0x5a57e8===_0x0133('0x71')||_0x5a57e8===_0x0133('0x72')||_0x5a57e8===_0x0133('0x73')||_0x5a57e8===_0x0133('0x59')||_0x5a57e8===_0x0133('0x5a')||_0x5a57e8==='UserId'||_0x5a57e8===_0x0133('0x1e')||_0x5a57e8===_0x0133('0x74')||_0x5a57e8===_0x0133('0x75')||_0x5a57e8===_0x0133('0x76')||_0x5a57e8===_0x0133('0x77')||_0x5a57e8===_0x0133('0x78')||_0x5a57e8===_0x0133('0x79')||_0x5a57e8===_0x0133('0x7a')||_0x5a57e8===_0x0133('0x7b')||_0x5a57e8==='xmd-dialid'||_0x5a57e8===_0x0133('0x7c')||_0x5a57e8===_0x0133('0x7d')||_0x5a57e8===_0x0133('0x7e')||_0x5a57e8===_0x0133('0x7f')||_0x5a57e8===_0x0133('0x80')||_0x5a57e8===_0x0133('0x81')||_0x5a57e8===_0x0133('0x82')||_0x5a57e8===_0x0133('0x83')||_0x5a57e8===_0x0133('0x84')||_0x5a57e8===_0x0133('0x85')||_0x5a57e8===_0x0133('0x86')||_0x5a57e8===_0x0133('0x87')||_0x5a57e8===_0x0133('0x88')||_0x5a57e8===_0x0133('0x89')||_0x5a57e8===_0x0133('0x82')||_0x5a57e8===_0x0133('0x83')||_0x5a57e8===_0x0133('0x84')||_0x5a57e8==='rtpaudioqosjitterbridged'||_0x5a57e8===_0x0133('0x86')||_0x5a57e8===_0x0133('0x87')||_0x5a57e8==='rtpaudioqosrtt'||_0x5a57e8===_0x0133('0x89')||_0x5a57e8===_0x0133('0x8a')||_0x5a57e8===_0x0133('0x8b')||_0x5a57e8===_0x0133('0x45')||_0x5a57e8===_0x0133('0x3f')){return![];}return!![];};exports[_0x0133('0x8c')]=function(_0x1a5f70,_0x42f008){var _0x3dbe99,_0x4d454f,_0x3b1c6a;if(_0x42f008<=0x0){_0x42f008=0x1;}_0x3dbe99=new RegExp('\x5cw{0,'+_0x42f008+'}$');_0x4d454f=Math[_0x0133('0x8d')](0xa,_0x42f008-0x1);_0x3b1c6a=Math[_0x0133('0x8d')](0xa,_0x42f008)-0x1;return util[_0x0133('0x1a')]('%s',_[_0x0133('0x8e')](_0x1a5f70,_0x3dbe99,_['random'](_0x4d454f,_0x3b1c6a)));};exports['extractCalleridName']=function(_0x2ef1f9){var _0x46c838=_0x2ef1f9[_0x0133('0x8f')](/"(.*?)"/);return _0x46c838?_0x46c838[0x1]:_0x2ef1f9;};exports[_0x0133('0x90')]=function(_0x50d8be){var _0x576aaa=_0x50d8be['match'](/<(.*?)>/);return _0x576aaa?_0x576aaa[0x1]:_0x50d8be;}; \ No newline at end of file +var _0xcd92=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','loggerError','error','logger2','info','message','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','XMD-','toUpper','toLowerVariables','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','statedesc','ringtime','logLookAgent','logCustomer','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','membername','active','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd92,0x1b3));var _0x2cd9=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xcd92[_0x42bdad];return _0x122626;};'use strict';var util=require(_0x2cd9('0x0'));var _=require(_0x2cd9('0x1'));var moment=require(_0x2cd9('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x2cd9('0x3')][_0x2cd9('0x4')]||_0x2cd9('0x5');function getSeconds(_0x37e34f,_0x154d6a){var _0x303fa7=moment(_0x37e34f)['milliseconds'](0x0);var _0x2dc09d=moment(_0x154d6a)[_0x2cd9('0x6')](0x0);return _0x303fa7[_0x2cd9('0x7')](_0x2dc09d,'seconds');}exports[_0x2cd9('0x8')]=function(_0x2dd561){return function(_0x41ea3e){logger['error'](_0x2dd561,util[_0x2cd9('0x9')](_0x41ea3e,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x41c241,_0x9cf4b7){logger['info'](_0x41c241,util['inspect'](_0x9cf4b7,{'showHidden':![],'depth':null}));};exports[_0x2cd9('0xa')]=function(_0x3bc039,_0x444b36){logger[_0x2cd9('0xb')](_0x3bc039,util['inspect'](_0x444b36,{'showHidden':![],'depth':null}));};exports[_0x2cd9('0xc')]=function(_0x31a968){return function(_0x9b9853){logger[_0x2cd9('0xd')](_0x31a968,util[_0x2cd9('0x9')](_0x9b9853,{'showHidden':![],'depth':null}));};};exports[_0x2cd9('0xe')]=function(_0xd94aae,_0x2d4d13,_0x580c92){return{'message':_0xd94aae,'unlock':_0x2d4d13,'active':_0x580c92};};exports['getCallerId']=function(_0x459429,_0x36b807,_0xab8f9){if(!_[_0x2cd9('0xf')](_0xab8f9)&&_0x2cd9('0x10')===typeof _0xab8f9&&!_['isEmpty'](_0xab8f9)){if(!_[_0x2cd9('0xf')](_0x36b807)&&_0x2cd9('0x10')===typeof _0x36b807&&!_['isEmpty'](_0x36b807)){return util[_0x2cd9('0x11')]('\x22%s\x22\x20<%s>',_0x36b807,_0xab8f9);}return util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0xab8f9,_0xab8f9);}if(!_[_0x2cd9('0xf')](_0x459429)&&_0x2cd9('0x10')===typeof _0x459429&&!_[_0x2cd9('0x13')](_0x459429)){return _0x459429;}return _0x2cd9('0x14');};exports[_0x2cd9('0x15')]=function(_0xb038ad){if(_['isNil'](_0xb038ad)){return![];}return _0xb038ad;};exports[_0x2cd9('0x16')]=function(_0x2c3ee1,_0xb71440,_0x2d3060,_0x4d7b99,_0x43f160,_0x103233){var _0x381fa5={'XMD-QUEUE':_0xb71440['Queue']?_0xb71440[_0x2cd9('0x17')][_0x2cd9('0x18')]:'','XMD-CALLERID':_0x4d7b99,'XMD-CALLERID-PREVIEW':_0x103233?util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0x103233[_0x2cd9('0x19')],_0x103233['calleridnum']):_0x4d7b99,'XMD-DIALID':_0x43f160,'XMD-CONTACTID':_0xb71440['ContactId'],'XMD-CDRTYPE':_0x2cd9('0x1a'),'CALLERID(all)':_0x4d7b99,'XMD-VOICEQUEUEID':_0xb71440['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2d3060,'XMD-DIALTIMEOUT':_0x2c3ee1[_0x2cd9('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x2cd9('0x1c'),_0x2c3ee1[_0x2cd9('0x1d')]?'g':'',_[_0x2cd9('0x13')](_0x2c3ee1[_0x2cd9('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2c3ee1['dialPreviewUrl']||'','XMD-AGI':_0x2c3ee1[_0x2cd9('0x1f')]?util[_0x2cd9('0x11')](_0x2cd9('0x20'),ipAgi,_0x2c3ee1[_0x2cd9('0x1f')]):_0x2cd9('0x21'),'XMD-AGIAFTER':_0x2c3ee1['dialQueueProject2']?util[_0x2cd9('0x11')](_0x2cd9('0x20'),ipAgi,_0x2c3ee1['dialQueueProject2']):_0x2cd9('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x103233?_0x103233[_0x2cd9('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x103233?_0x103233[_0x2cd9('0x23')]:'','XMD-DESTINATION':_0x2cd9('0x24')};if(!_[_0x2cd9('0x13')](_0x2c3ee1[_0x2cd9('0x1e')])){_0x381fa5[util[_0x2cd9('0x11')]('%s',_0x2cd9('0x25'))]=_0x2c3ee1[_0x2cd9('0x1e')];_0x381fa5[util['format']('%s',_0x2cd9('0x26'))]=_0x43f160;}if(_0xb71440&&_0xb71440[_0x2cd9('0x27')]){for(var _0x4b448b in _0xb71440[_0x2cd9('0x27')]){if(_0xb71440[_0x2cd9('0x27')][_0x2cd9('0x28')](_0x4b448b)){if(!_['isNil'](_0xb71440[_0x2cd9('0x27')][_0x4b448b])&&_0x4b448b!=='id'&&_0x4b448b!=='tags'&&_0x4b448b!=='createdAt'&&_0x4b448b!==_0x2cd9('0x29')){_0x381fa5[util['format']('%s%s',_0x2cd9('0x2a'),_[_0x2cd9('0x2b')](_0x4b448b))]=_0xb71440[_0x2cd9('0x27')][_0x4b448b];}}}}return _0x381fa5;};exports[_0x2cd9('0x2c')]=function(_0x45cc1a){var _0x18387a={};for(var _0x26c419 in _0x45cc1a){if(_0x45cc1a[_0x2cd9('0x28')](_0x26c419)){_0x18387a[util[_0x2cd9('0x11')]('%s',_['toLower'](_0x26c419))]=_0x45cc1a[_0x26c419];}}return{'variables':_0x18387a};};exports[_0x2cd9('0x2d')]=function(_0x4fe07f,_0x5adbd9){if(!_[_0x2cd9('0x2e')](_0x4fe07f)){if(_0x4fe07f['hasOwnProperty']('originated')){if(_0x4fe07f[_0x2cd9('0x2f')]>0x0){_0x4fe07f[_0x2cd9('0x2f')]-=0x1;}else{logger[_0x2cd9('0xb')](_0x2cd9('0x30'),_0x5adbd9);}}}else{logger[_0x2cd9('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5adbd9);}};exports[_0x2cd9('0x31')]=function(_0x431a32){var _0x1c0b41=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x431a32[_0x2cd9('0x32')]=0xd;_0x431a32['statedesc']='Blacklist';_0x431a32[_0x2cd9('0x33')]=_0x1c0b41;_0x431a32[_0x2cd9('0x34')]=_0x1c0b41;_0x431a32['endtime']=_0x1c0b41;};exports[_0x2cd9('0x35')]=function(_0x285cb3,_0x238db2,_0x2adb8f){var _0x2d638d=moment()[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x285cb3[_0x2cd9('0x32')]=_0x238db2;_0x285cb3[_0x2cd9('0x37')]=_0x2adb8f;_0x285cb3[_0x2cd9('0x34')]=_0x2d638d;_0x285cb3[_0x2cd9('0x38')]=getSeconds(_0x285cb3[_0x2cd9('0x34')],_0x285cb3[_0x2cd9('0x33')]);};exports[_0x2cd9('0x39')]=function(_0x505936,_0x10c934,_0x194213){_0x505936['membername']=_0x10c934;_0x505936['UserId']=_0x194213;};exports[_0x2cd9('0x3a')]=function(_0x2ed459,_0x2e5ab5,_0x40fa81){var _0x3e2f13=moment()[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x2ed459[_0x2cd9('0x32')]=_0x2e5ab5;_0x2ed459['statedesc']=_0x40fa81;_0x2ed459[_0x2cd9('0x34')]=_0x2ed459[_0x2cd9('0x34')]?_0x2ed459['responsetime']:_0x3e2f13;_0x2ed459[_0x2cd9('0x3b')]=_0x2ed459['endtime']?_0x2ed459['endtime']:_0x3e2f13;_0x2ed459[_0x2cd9('0x38')]=getSeconds(_0x2ed459[_0x2cd9('0x34')]||0x0,_0x2ed459[_0x2cd9('0x33')]||0x0);_0x2ed459[_0x2cd9('0x3c')]=_0x2ed459[_0x2cd9('0x3d')]?getSeconds(_0x2ed459[_0x2cd9('0x3b')],_0x2ed459['answertime']):0x0;};exports['isFailure']=function(_0x53a36a){return _0x53a36a===_0x2cd9('0x3e');};exports[_0x2cd9('0x3f')]=function(_0xf0ff98,_0x32d165,_0x55476d,_0x168b3a,_0x1e7e78){var _0x34c387=_0x168b3a?_0x2cd9('0x40'):_0xf0ff98['calleridname'];_0x34c387=_0x1e7e78?_0x2cd9('0x41'):_0x34c387;return{'actionid':_0xf0ff98[_0x2cd9('0x42')],'action':'originate','channel':_0xf0ff98[_0x2cd9('0x43')],'callerid':util[_0x2cd9('0x11')](_0x2cd9('0x12'),_0x34c387,_0xf0ff98[_0x2cd9('0x44')]),'Exten':'xcally-motion-preview','Context':_0x2cd9('0x45'),'Priority':'1','variable':_0x55476d,'timeout':(_0x32d165[_0x2cd9('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0xf0ff98[_0x2cd9('0x42')]};};exports[_0x2cd9('0x47')]=function(_0x26b2fb){return _0x26b2fb[_0x2cd9('0x48')]+_0x26b2fb[_0x2cd9('0x49')]+_0x26b2fb[_0x2cd9('0x4a')];};exports[_0x2cd9('0x4b')]=function(_0x19e946){var _0xcc1170=_[_0x2cd9('0x4c')](_0x19e946);_0xcc1170['state']=0xf;_0xcc1170['statedesc']='Global';return _0xcc1170;};exports[_0x2cd9('0x4d')]=function(_0x10672c,_0x3189bd,_0xbd380a){var _0x3c67e5={};_0x3c67e5[_0x3189bd]=_0x10672c[_0x3189bd];_0x3c67e5['active']=![];_0x3c67e5[_0x2cd9('0x4e')]=moment()[_0x2cd9('0x4f')](_0xbd380a,_0x2cd9('0x50'))[_0x2cd9('0x11')](_0x2cd9('0x36'));_0x3c67e5[_0x2cd9('0x51')]=_0x10672c[_0x2cd9('0x51')];_0x3c67e5[_0x2cd9('0x52')]=_0x10672c[_0x2cd9('0x52')];_0x3c67e5[_0x2cd9('0x53')]=_0x10672c['VoiceQueueId']||undefined;return _0x3c67e5;};exports[_0x2cd9('0x54')]=function(_0x528f8d,_0x13415a){if(!_[_0x2cd9('0x2e')](_0x528f8d)){if(_0x528f8d[_0x2cd9('0x55')]>0x0){_0x528f8d[_0x2cd9('0x55')]-=0x1;}else{logger[_0x2cd9('0xb')](_0x13415a,_0x2cd9('0x56'));}}else{logger['error'](_0x13415a,_0x2cd9('0x57'));}};exports[_0x2cd9('0x58')]=function(_0x38a94a){if(_0x38a94a<=0x0){return!![];}return![];};exports['buildObj']=function(_0x225dc7,_0x8c0d71){_0x225dc7[_0x2cd9('0x59')]=_0x8c0d71;_0x225dc7[_0x2cd9('0x18')]=_0x225dc7[_0x2cd9('0x5a')];_0x225dc7[_0x2cd9('0x5b')]=_0x225dc7[_0x2cd9('0x43')];return _0x225dc7;};exports[_0x2cd9('0x5c')]=function(_0x3ad217){var _0x35c2bd={};_0x35c2bd[_0x2cd9('0x5a')]=_0x3ad217[_0x2cd9('0x5a')];_0x35c2bd['interface']=_0x3ad217[_0x2cd9('0x43')];_0x35c2bd[_0x2cd9('0x42')]=_0x3ad217[_0x2cd9('0x42')];return _0x35c2bd;};exports[_0x2cd9('0x5d')]=function(_0x4bf9a2){var _0x27e098=[];for(var _0x3b88a9 in _0x4bf9a2){if(_0x4bf9a2[_0x2cd9('0x28')](_0x3b88a9)){if(!_['isNil'](_0x4bf9a2[_0x3b88a9])&&_0x4bf9a2[_0x3b88a9][_0x2cd9('0x32')]==='not_inuse'&&_0x4bf9a2[_0x3b88a9][_0x2cd9('0x5e')]===_0x2cd9('0x5f')){_0x27e098[_0x2cd9('0x60')](_0x4bf9a2[_0x3b88a9]['id']);}}}return _0x27e098;};exports[_0x2cd9('0x61')]=function(_0xdef023){var _0x408d5f=moment()[_0x2cd9('0x6')](0x0);var _0x156caf=moment(_0xdef023)[_0x2cd9('0x6')](0x0);return _0x408d5f[_0x2cd9('0x7')](_0x156caf,_0x2cd9('0x62'));};exports[_0x2cd9('0x63')]=function(_0x151bac){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x151bac['ContactId'],'ListId':_0x151bac[_0x2cd9('0x52')],'VoiceQueueId':_0x151bac['VoiceQueueId']||undefined,'CampaignId':_0x151bac[_0x2cd9('0x64')]||undefined};};exports[_0x2cd9('0x65')]=function(_0x4be004){if(_0x4be004===_0x2cd9('0x42')||_0x4be004==='idContact'||_0x4be004==='queue'||_0x4be004===_0x2cd9('0x66')||_0x4be004===_0x2cd9('0x67')||_0x4be004===_0x2cd9('0x68')||_0x4be004===_0x2cd9('0x69')||_0x4be004===_0x2cd9('0x43')||_0x4be004===_0x2cd9('0x19')||_0x4be004===_0x2cd9('0x6a')||_0x4be004===_0x2cd9('0x44')||_0x4be004==='scheduledat'||_0x4be004===_0x2cd9('0x48')||_0x4be004==='countcongestionretry'||_0x4be004===_0x2cd9('0x4a')||_0x4be004===_0x2cd9('0x6b')||_0x4be004===_0x2cd9('0x6c')||_0x4be004===_0x2cd9('0x6d')||_0x4be004==='callbackat'||_0x4be004==='recallme'||_0x4be004===_0x2cd9('0x51')||_0x4be004===_0x2cd9('0x52')||_0x4be004==='UserId'||_0x4be004===_0x2cd9('0x53')||_0x4be004===_0x2cd9('0x6e')||_0x4be004===_0x2cd9('0x6f')||_0x4be004===_0x2cd9('0x70')||_0x4be004===_0x2cd9('0x71')||_0x4be004===_0x2cd9('0x72')||_0x4be004==='xmd-dialurl'||_0x4be004===_0x2cd9('0x73')||_0x4be004===_0x2cd9('0x74')||_0x4be004===_0x2cd9('0x75')||_0x4be004===_0x2cd9('0x76')||_0x4be004==='xmd-contactid'||_0x4be004===_0x2cd9('0x77')||_0x4be004===_0x2cd9('0x78')||_0x4be004===_0x2cd9('0x79')||_0x4be004===_0x2cd9('0x7a')||_0x4be004===_0x2cd9('0x7b')||_0x4be004===_0x2cd9('0x7c')||_0x4be004===_0x2cd9('0x7d')||_0x4be004===_0x2cd9('0x7e')||_0x4be004==='rtpaudioqosloss'||_0x4be004===_0x2cd9('0x7f')||_0x4be004==='rtpaudioqosrtt'||_0x4be004===_0x2cd9('0x80')||_0x4be004==='rtpaudioqos'||_0x4be004===_0x2cd9('0x7c')||_0x4be004===_0x2cd9('0x7d')||_0x4be004===_0x2cd9('0x7e')||_0x4be004===_0x2cd9('0x81')||_0x4be004===_0x2cd9('0x7f')||_0x4be004===_0x2cd9('0x82')||_0x4be004===_0x2cd9('0x80')||_0x4be004===_0x2cd9('0x83')||_0x4be004===_0x2cd9('0x84')||_0x4be004==='state'||_0x4be004===_0x2cd9('0x37')){return![];}return!![];};exports[_0x2cd9('0x85')]=function(_0x3809b4,_0x227cb0){var _0x1444f5,_0x165751,_0x364149;if(_0x227cb0<=0x0){_0x227cb0=0x1;}_0x1444f5=new RegExp(_0x2cd9('0x86')+_0x227cb0+'}$');_0x165751=Math[_0x2cd9('0x87')](0xa,_0x227cb0-0x1);_0x364149=Math[_0x2cd9('0x87')](0xa,_0x227cb0)-0x1;return util['format']('%s',_['replace'](_0x3809b4,_0x1444f5,_[_0x2cd9('0x88')](_0x165751,_0x364149)));};exports[_0x2cd9('0x89')]=function(_0x1bbbe5){var _0x43540b=_0x1bbbe5[_0x2cd9('0x8a')](/"(.*?)"/);return _0x43540b?_0x43540b[0x1]:_0x1bbbe5;};exports[_0x2cd9('0x8b')]=function(_0x2a16a2){var _0x470fdf=_0x2a16a2['match'](/<(.*?)>/);return _0x470fdf?_0x470fdf[0x1]:_0x2a16a2;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c8667f4..6da991d 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 _0x0c02=['number','boolean','queueremove','queuepause','reload','voicequeuechannelhangup','string'];(function(_0x8c3e66,_0x58f6cf){var _0x7d5abd=function(_0x5546ab){while(--_0x5546ab){_0x8c3e66['push'](_0x8c3e66['shift']());}};_0x7d5abd(++_0x58f6cf);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':_0x20c0('0x0'),'required':!![]},'interface':{'type':_0x20c0('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x20c0('0x1'),'required':![]},'paused':{'type':_0x20c0('0x2'),'required':![]}};exports[_0x20c0('0x3')]={'queue':{'type':_0x20c0('0x0'),'required':!![]},'interface':{'type':_0x20c0('0x0'),'required':!![]}};exports[_0x20c0('0x4')]={'interface':{'type':_0x20c0('0x0'),'required':!![]},'paused':{'type':_0x20c0('0x2')},'reason':{'type':_0x20c0('0x0'),'required':![]}};exports[_0x20c0('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x20c0('0x0'),'required':!![]},'filename':{'type':_0x20c0('0x0')},'format':{'type':_0x20c0('0x0')},'mixmonitorid':{'type':_0x20c0('0x0')}};exports[_0x20c0('0x6')]={'uniqueid':{'type':_0x20c0('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x4f29=['voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0xba7530,_0x4c5f41){var _0x1dc93a=function(_0x1a6aca){while(--_0x1a6aca){_0xba7530['push'](_0xba7530['shift']());}};_0x1dc93a(++_0x4c5f41);}(_0x4f29,0xfd));var _0x94f2=function(_0x2a58b,_0x3eb11e){_0x2a58b=_0x2a58b-0x0;var _0x3d8e32=_0x4f29[_0x2a58b];return _0x3d8e32;};'use strict';exports['queueadd']={'queue':{'type':_0x94f2('0x0'),'required':!![]},'interface':{'type':_0x94f2('0x0'),'required':!![]},'membername':{'type':_0x94f2('0x0'),'required':!![]},'penalty':{'type':_0x94f2('0x1'),'required':![]},'paused':{'type':_0x94f2('0x2'),'required':![]}};exports[_0x94f2('0x3')]={'queue':{'type':_0x94f2('0x0'),'required':!![]},'interface':{'type':_0x94f2('0x0'),'required':!![]}};exports[_0x94f2('0x4')]={'interface':{'type':_0x94f2('0x0'),'required':!![]},'paused':{'type':_0x94f2('0x2')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x94f2('0x0'),'required':![]}};exports[_0x94f2('0x5')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]}};exports[_0x94f2('0x6')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x94f2('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x94f2('0x8')]={'uniqueid':{'type':_0x94f2('0x0'),'required':!![]},'exten':{'type':_0x94f2('0x0'),'required':!![]},'context':{'type':_0x94f2('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b323ae3..d3e37ac 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 _0x6c50=['vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','answered','sumDuration','isEmpty','ivrTotalCallsDays','total','unmanaged','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','initVoiceQueues','initTriggers','initTemplates','templates','salesforceAccounts','initFreshdeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts'];(function(_0x142d4f,_0x31f574){var _0x240cb3=function(_0x3a926b){while(--_0x3a926b){_0x142d4f['push'](_0x142d4f['shift']());}};_0x240cb3(++_0x31f574);}(_0x6c50,0xe2));var _0x06c5=function(_0x5d7283,_0x17e0ec){_0x5d7283=_0x5d7283-0x0;var _0x34266c=_0x6c50[_0x5d7283];return _0x34266c;};'use strict';var BPromise=require(_0x06c5('0x0'));var util=require('util');var _=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var Agent=require(_0x06c5('0x3'));var Telephone=require(_0x06c5('0x4'));var Trunk=require(_0x06c5('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x06c5('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x06c5('0x7'));var ZendeskAccount=require(_0x06c5('0x8'));var SalesforceAccount=require(_0x06c5('0x9'));var FreshdeskAccount=require(_0x06c5('0xa'));var SugarcrmAccount=require(_0x06c5('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x06c5('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x06c5('0xd'));var Realtime=function(){this[_0x06c5('0xe')]={};this[_0x06c5('0xf')]={};this[_0x06c5('0x10')]={};this[_0x06c5('0x11')]={};this[_0x06c5('0x12')]={};this[_0x06c5('0x13')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x06c5('0x14')]={};this[_0x06c5('0x15')]={};this[_0x06c5('0x16')]={};this[_0x06c5('0x17')]={};this[_0x06c5('0x18')]={};this[_0x06c5('0x19')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x06c5('0x1a')]={};this[_0x06c5('0x1b')]={};this[_0x06c5('0x1c')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x06c5('0x1d')]={};this[_0x06c5('0x1e')]={};};function freeIsNotKey(_0x5eb3db,_0x3cfc25,_0x2b2f66){var _0x221b7b=_[_0x06c5('0x1f')](_0x5eb3db,function(_0x5754d0,_0xcd7877){return _0x5754d0[_0x2b2f66];});for(var _0x30a83f in _0x3cfc25){if(_0x3cfc25[_0x06c5('0x20')](_0x30a83f)){if(!_0x221b7b[_0x30a83f]){delete _0x3cfc25[_0x30a83f];}}}}function freeIsNotKeySip(_0x4c2a92,_0x3f3306){var _0x24cd51=_[_0x06c5('0x1f')](_0x4c2a92,function(_0x42a29b,_0x216b39){return util['format'](_0x06c5('0x21'),_0x42a29b[_0x06c5('0x22')]);});for(var _0x54ac16 in _0x3f3306){if(_0x3f3306[_0x06c5('0x20')](_0x54ac16)){if(!_0x24cd51[_0x54ac16]){delete _0x3f3306[_0x54ac16];}}}}function freeIsNotKeyAgent(_0x4c3eb8,_0x42c3f7){var _0x569624=_['mapKeys'](_0x4c3eb8,function(_0x573327,_0x446eb5){var _0x42340f=_[_0x06c5('0x23')](_0x573327[_0x06c5('0x24')])?util[_0x06c5('0x25')](_0x06c5('0x21'),_0x573327[_0x06c5('0x22')]):_0x573327[_0x06c5('0x24')];return _0x42340f;});for(var _0x4b7e83 in _0x42c3f7){if(_0x42c3f7[_0x06c5('0x20')](_0x4b7e83)){if(!_0x569624[_0x4b7e83]){delete _0x42c3f7[_0x4b7e83];}}}}function clearVoiceCallReports(_0x3dab1e){_0x3dab1e['total']=0x0;_0x3dab1e[_0x06c5('0x26')]=0x0;_0x3dab1e['sumHoldTime']=0x0;_0x3dab1e[_0x06c5('0x27')]=0x0;_0x3dab1e['sumBillable']=0x0;}function clearCampaigns(_0x4842cf){if(!_[_0x06c5('0x28')](_0x4842cf)){for(var _0x41c486 in _0x4842cf){if(_0x4842cf[_0x06c5('0x20')](_0x41c486)){_0x4842cf[_0x41c486][_0x06c5('0x29')]=0x0;_0x4842cf[_0x41c486]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x33e4a8){if(!_[_0x06c5('0x28')](_0x33e4a8)){for(var _0x4cd165 in _0x33e4a8){if(_0x33e4a8[_0x06c5('0x20')](_0x4cd165)){_0x33e4a8[_0x4cd165][_0x06c5('0x2a')]=0x0;_0x33e4a8[_0x4cd165]['answered']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2b')]=0x0;_0x33e4a8[_0x4cd165]['abandoned']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2c')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x27')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2d')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2e')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2f')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x30')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x31')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x32')]=0x0;_0x33e4a8[_0x4cd165]['outboundUnknownCallsDay']=0x0;_0x33e4a8[_0x4cd165]['outboundDropCallsDayTimeout']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x33')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x34')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x35')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x36')]=0x0;_0x33e4a8[_0x4cd165]['outboundReCallsDay']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2e')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x37')]=0x0;_0x33e4a8[_0x4cd165]['queueStatusComplete']=!![];}}}}Realtime[_0x06c5('0x38')][_0x06c5('0x39')]=function(_0x1fbcb3,_0x1d55c6){for(var _0x5970e1 in _0x1d55c6){if(_0x1fbcb3[_0x06c5('0x20')](_0x5970e1)){_0x1fbcb3[_0x5970e1]=_0x1d55c6[_0x5970e1];}}};Realtime[_0x06c5('0x38')][_0x06c5('0x3a')]=function(){var _0x340e65=this;return function(_0x408996){if(_0x408996){freeIsNotKeyAgent(_0x408996,_0x340e65[_0x06c5('0xe')]);for(var _0x4c484c=0x0,_0x483480={},_0x1b4a0c={};_0x4c484c<_0x408996['length'];_0x4c484c+=0x1){_0x483480=_0x408996[_0x4c484c];var _0xcf48b6=_['isNil'](_0x483480[_0x06c5('0x24')])?util[_0x06c5('0x25')](_0x06c5('0x21'),_0x483480[_0x06c5('0x22')]):_0x483480[_0x06c5('0x24')];if(_[_0x06c5('0x3b')](_0x340e65[_0x06c5('0xe')][_0xcf48b6])){_0x340e65[_0x06c5('0xe')][_0xcf48b6]=new Agent(_0x483480);}else{_0x340e65['mergeFromDatabase'](_0x340e65[_0x06c5('0xe')][_0xcf48b6],_0x483480);}}}return _0x340e65['agents'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3c')]=function(){var _0x5d8d44=this;return function(_0x1e55ed){if(_0x1e55ed){freeIsNotKeySip(_0x1e55ed,_0x5d8d44[_0x06c5('0xf')]);for(var _0x1b96a6=0x0,_0x3d0da4={},_0x399822={};_0x1b96a6<_0x1e55ed['length'];_0x1b96a6+=0x1){_0x3d0da4=_0x1e55ed[_0x1b96a6];if(_['isUndefined'](_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x3d0da4[_0x06c5('0x22')])])){_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x3d0da4['name'])]=new Telephone(_0x3d0da4);}else{_0x5d8d44['mergeFromDatabase'](_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')]('SIP/%s',_0x3d0da4['name'])],_0x3d0da4);}}}return _0x5d8d44['telephones'];};};Realtime[_0x06c5('0x38')]['initTrunks']=function(){var _0x2cf0aa=this;return function(_0x24cc7e){if(_0x24cc7e){freeIsNotKeySip(_0x24cc7e,_0x2cf0aa['trunks']);for(var _0x159875=0x0,_0x6f4259={},_0x5c009f={};_0x159875<_0x24cc7e[_0x06c5('0x3d')];_0x159875+=0x1){_0x6f4259=_0x24cc7e[_0x159875];if(_[_0x06c5('0x3b')](_0x2cf0aa[_0x06c5('0x10')][util[_0x06c5('0x25')]('SIP/%s',_0x6f4259[_0x06c5('0x22')])])){_0x2cf0aa[_0x06c5('0x10')][util[_0x06c5('0x25')]('SIP/%s',_0x6f4259['name'])]=new Trunk(_0x6f4259);}else{_0x2cf0aa[_0x06c5('0x39')](_0x2cf0aa['trunks'][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x6f4259[_0x06c5('0x22')])],_0x6f4259);}}}return _0x2cf0aa[_0x06c5('0x10')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3e')]=function(){var _0x27e4d1=this;return function(_0x5b9492){if(_0x5b9492){freeIsNotKey(_0x5b9492,_0x27e4d1[_0x06c5('0x11')],'name');for(var _0x33a921=0x0,_0xdfa773={},_0x6e7383={};_0x33a921<_0x5b9492[_0x06c5('0x3d')];_0x33a921+=0x1){_0xdfa773=_0x5b9492[_0x33a921];if(_[_0x06c5('0x3b')](_0x27e4d1['voiceQueues'][_0xdfa773[_0x06c5('0x22')]])){_0x27e4d1[_0x06c5('0x11')][_0xdfa773[_0x06c5('0x22')]]=new VoiceQueue(_0xdfa773);}else{_0x27e4d1['mergeFromDatabase'](_0x27e4d1[_0x06c5('0x11')][_0xdfa773[_0x06c5('0x22')]],_0xdfa773);}}}return _0x27e4d1['voiceQueues'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3f')]=function(){var _0x45d415=this;return function(_0x3cff70){if(_0x3cff70){freeIsNotKey(_0x3cff70,_0x45d415[_0x06c5('0x12')],'id');for(var _0x4c277d=0x0,_0x1c8c2d={},_0x20226d={};_0x4c277d<_0x3cff70['length'];_0x4c277d+=0x1){_0x1c8c2d=_0x3cff70[_0x4c277d];if(_['isUndefined'](_0x45d415['triggers'][_0x1c8c2d['id']])){_0x45d415[_0x06c5('0x12')][_0x1c8c2d['id']]=new Trigger(_0x1c8c2d);}else{_0x45d415[_0x06c5('0x39')](_0x45d415[_0x06c5('0x12')][_0x1c8c2d['id']],_0x1c8c2d);}}}return _0x45d415[_0x06c5('0x12')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x40')]=function(){var _0x3cf136=this;return function(_0x2d41c3){if(_0x2d41c3){freeIsNotKey(_0x2d41c3,_0x3cf136[_0x06c5('0x41')],'id');for(var _0x459769=0x0,_0x21440b={},_0x1d10a4={};_0x459769<_0x2d41c3[_0x06c5('0x3d')];_0x459769+=0x1){_0x21440b=_0x2d41c3[_0x459769];if(_[_0x06c5('0x3b')](_0x3cf136[_0x06c5('0x41')][_0x21440b['id']])){_0x3cf136['templates'][_0x21440b['id']]=new Template(_0x21440b);}else{_0x3cf136[_0x06c5('0x39')](_0x3cf136['templates'][_0x21440b['id']],_0x21440b);}}}return _0x3cf136['templates'];};};Realtime[_0x06c5('0x38')]['initZendeskAccounts']=function(){var _0xc14378=this;return function(_0x60814){if(_0x60814){freeIsNotKey(_0x60814,_0xc14378[_0x06c5('0x19')],'id');for(var _0x21e5f5=0x0,_0x356909={},_0x29cfff={};_0x21e5f5<_0x60814[_0x06c5('0x3d')];_0x21e5f5+=0x1){_0x356909=_0x60814[_0x21e5f5];if(_[_0x06c5('0x3b')](_0xc14378[_0x06c5('0x19')][_0x356909['id']])){_0xc14378[_0x06c5('0x19')][_0x356909['id']]=new ZendeskAccount(_0x356909);}else{_0xc14378[_0x06c5('0x39')](_0xc14378['zendeskAccounts'][_0x356909['id']],_0x356909);}}}return _0xc14378[_0x06c5('0x19')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x50e154=this;return function(_0x53dea7){if(_0x53dea7){freeIsNotKey(_0x53dea7,_0x50e154[_0x06c5('0x42')],'id');for(var _0x5cec64=0x0,_0x3a7c30={},_0x36766c={};_0x5cec64<_0x53dea7[_0x06c5('0x3d')];_0x5cec64+=0x1){_0x3a7c30=_0x53dea7[_0x5cec64];if(_['isUndefined'](_0x50e154['salesforceAccounts'][_0x3a7c30['id']])){_0x50e154['salesforceAccounts'][_0x3a7c30['id']]=new SalesforceAccount(_0x3a7c30);}else{_0x50e154[_0x06c5('0x39')](_0x50e154[_0x06c5('0x42')][_0x3a7c30['id']],_0x3a7c30);}}}return _0x50e154[_0x06c5('0x42')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x43')]=function(){var _0x1e83d0=this;return function(_0x2e1035){if(_0x2e1035){freeIsNotKey(_0x2e1035,_0x1e83d0[_0x06c5('0x1a')],'id');for(var _0x14ecd0=0x0,_0x4e0ff9={},_0x2cb49a={};_0x14ecd0<_0x2e1035[_0x06c5('0x3d')];_0x14ecd0+=0x1){_0x4e0ff9=_0x2e1035[_0x14ecd0];if(_[_0x06c5('0x3b')](_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']])){_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']]=new FreshdeskAccount(_0x4e0ff9);}else{_0x1e83d0[_0x06c5('0x39')](_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']],_0x4e0ff9);}}}return _0x1e83d0['freshdeskAccounts'];};};Realtime[_0x06c5('0x38')]['initZohoAccounts']=function(){var _0x5d8a7d=this;return function(_0xd188fb){if(_0xd188fb){freeIsNotKey(_0xd188fb,_0x5d8a7d[_0x06c5('0x1b')],'id');for(var _0x38c16d=0x0,_0x128faa={},_0x1240e7={};_0x38c16d<_0xd188fb[_0x06c5('0x3d')];_0x38c16d+=0x1){_0x128faa=_0xd188fb[_0x38c16d];if(_[_0x06c5('0x3b')](_0x5d8a7d[_0x06c5('0x1b')][_0x128faa['id']])){_0x5d8a7d['zohoAccounts'][_0x128faa['id']]=new ZohoAccount(_0x128faa);}else{_0x5d8a7d[_0x06c5('0x39')](_0x5d8a7d[_0x06c5('0x1b')][_0x128faa['id']],_0x128faa);}}}return _0x5d8a7d[_0x06c5('0x1b')];};};Realtime[_0x06c5('0x38')]['initDeskAccounts']=function(){var _0x316fa8=this;return function(_0x45961a){if(_0x45961a){freeIsNotKey(_0x45961a,_0x316fa8[_0x06c5('0x1c')],'id');for(var _0x520223=0x0,_0x38205d={},_0x1d8b75={};_0x520223<_0x45961a[_0x06c5('0x3d')];_0x520223+=0x1){_0x38205d=_0x45961a[_0x520223];if(_[_0x06c5('0x3b')](_0x316fa8[_0x06c5('0x1c')][_0x38205d['id']])){_0x316fa8[_0x06c5('0x1c')][_0x38205d['id']]=new DeskAccount(_0x38205d);}else{_0x316fa8[_0x06c5('0x39')](_0x316fa8['deskAccounts'][_0x38205d['id']],_0x38205d);}}}return _0x316fa8[_0x06c5('0x1c')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x44')]=function(){var _0xc2980a=this;return function(_0xae5471){if(_0xae5471){freeIsNotKey(_0xae5471,_0xc2980a[_0x06c5('0x45')],'id');for(var _0x466c4a=0x0,_0x1ba985={},_0x1001a7={};_0x466c4a<_0xae5471[_0x06c5('0x3d')];_0x466c4a+=0x1){_0x1ba985=_0xae5471[_0x466c4a];if(_[_0x06c5('0x3b')](_0xc2980a[_0x06c5('0x45')][_0x1ba985['id']])){_0xc2980a[_0x06c5('0x45')][_0x1ba985['id']]=new SugarcrmAccount(_0x1ba985);}else{_0xc2980a['mergeFromDatabase'](_0xc2980a['sugarcrmAccounts'][_0x1ba985['id']],_0x1ba985);}}}return _0xc2980a[_0x06c5('0x45')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x46')]=function(){var _0x4b76be=this;return function(_0xd5ea32){if(_0xd5ea32){freeIsNotKey(_0xd5ea32,_0x4b76be[_0x06c5('0x47')],'id');for(var _0x8ef938=0x0,_0x4f8b5a={},_0x10a7fb={};_0x8ef938<_0xd5ea32['length'];_0x8ef938+=0x1){_0x4f8b5a=_0xd5ea32[_0x8ef938];if(_[_0x06c5('0x3b')](_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']])){_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']]=new VtigerAccount(_0x4f8b5a);}else{_0x4b76be[_0x06c5('0x39')](_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']],_0x4f8b5a);}}}return _0x4b76be['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x193b85=this;return function(_0xc11de8){if(_0xc11de8){freeIsNotKey(_0xc11de8,_0x193b85[_0x06c5('0x48')],'id');for(var _0x1ed6fd=0x0,_0x1e692c={},_0x548df9={};_0x1ed6fd<_0xc11de8[_0x06c5('0x3d')];_0x1ed6fd+=0x1){_0x1e692c=_0xc11de8[_0x1ed6fd];if(_[_0x06c5('0x3b')](_0x193b85[_0x06c5('0x48')][_0x1e692c['id']])){_0x193b85[_0x06c5('0x48')][_0x1e692c['id']]=new ServicenowAccount(_0x1e692c);}else{_0x193b85[_0x06c5('0x39')](_0x193b85[_0x06c5('0x48')][_0x1e692c['id']],_0x1e692c);}}}return _0x193b85['servicenowAccounts'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x49')]=function(){var _0x5c79f7=this;return function(_0x5c8ad3){if(_0x5c8ad3){freeIsNotKey(_0x5c8ad3,_0x5c79f7['dynamics365Accounts'],'id');for(var _0x5a054e=0x0,_0x60b631={},_0x53b8d0={};_0x5a054e<_0x5c8ad3[_0x06c5('0x3d')];_0x5a054e+=0x1){_0x60b631=_0x5c8ad3[_0x5a054e];if(_[_0x06c5('0x3b')](_0x5c79f7['dynamics365Accounts'][_0x60b631['id']])){_0x5c79f7[_0x06c5('0x1d')][_0x60b631['id']]=new Dynamics365Account(_0x60b631);}else{_0x5c79f7[_0x06c5('0x39')](_0x5c79f7[_0x06c5('0x1d')][_0x60b631['id']],_0x60b631);}}}return _0x5c79f7[_0x06c5('0x1d')];};};Realtime[_0x06c5('0x38')]['initVoiceQueueHopperHistory']=function(){var _0x3968d4=this;return function(_0x18107e){for(var _0xa1b6b=0x0;_0xa1b6b<_0x18107e[_0x06c5('0x3d')];_0xa1b6b+=0x1){_['merge'](_0x3968d4[_0x06c5('0x11')][_0x18107e[_0xa1b6b]['name']],_0x18107e[_0xa1b6b]);}return _0x3968d4['voiceQueues'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x4a')]=function(){var _0x293e27=this;return function(_0x4557eb){clearVoiceQueues(_0x293e27[_0x06c5('0x11')]);if(_0x4557eb){_0x4557eb=_[_0x06c5('0x4b')](_0x4557eb,_0x06c5('0x4c'));for(var _0x3b5bf8 in _0x4557eb){if(_0x4557eb[_0x06c5('0x20')](_0x3b5bf8)){var _0x301306={};for(var _0x19a463=0x0;_0x19a463<_0x4557eb[_0x3b5bf8][_0x06c5('0x3d')];_0x19a463+=0x1){var _0x752485=_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4d')];if(_0x293e27['voiceQueues'][_0x752485]){if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4e')]){_0x293e27['voiceQueues'][_0x752485]['unmanaged']+=0x1;}if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4f')]){_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x50')]+=0x1;}_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2c')]+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x51')])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x53')]),_0x06c5('0x54'))||0x0;if(_0x19a463===_0x4557eb[_0x3b5bf8][_0x06c5('0x3d')]-0x1){_0x293e27[_0x06c5('0x11')][_0x752485]['sumDuration']+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x55')]||_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x56')]||_0x4557eb[_0x3b5bf8][_0x19a463]['queuecallerexitAt'])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x53')]),_0x06c5('0x54'))||0x0;_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2a')]+=0x1;if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x57')]){_0x293e27['voiceQueues'][_0x752485][_0x06c5('0x26')]+=0x1;_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2d')]+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x55')])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x51')]),_0x06c5('0x54'))||0x0;}}else{_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x27')]+=_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2c')]||0x0;}}}}}}return _0x293e27[_0x06c5('0x11')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x58')]=function(){var _0x1e7e43=this;return function(_0x4b7fe9){clearVoiceCallReports(_0x1e7e43[_0x06c5('0x59')]);if(_0x4b7fe9){for(var _0x29ae2d=0x0;_0x29ae2d<_0x4b7fe9[_0x06c5('0x3d')];_0x29ae2d+=0x1){_0x1e7e43[_0x06c5('0x59')]['total']+=0x1;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x27')]+=_0x4b7fe9[_0x29ae2d][_0x06c5('0x5a')];if(_0x4b7fe9[_0x29ae2d][_0x06c5('0x5b')]===_0x06c5('0x5c')){_0x1e7e43['outbound'][_0x06c5('0x26')]+=0x1;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x2c')]+=_0x4b7fe9[_0x29ae2d][_0x06c5('0x5a')]-_0x4b7fe9[_0x29ae2d][_0x06c5('0x5d')]||0x0;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x2d')]+=_0x4b7fe9[_0x29ae2d]['billableseconds'];}}}return _0x1e7e43[_0x06c5('0x59')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x5e')]=function(){var _0x34d5dc=this;return function(_0xcb5b9f){if(_0xcb5b9f){freeIsNotKey(_0xcb5b9f,_0x34d5dc[_0x06c5('0x13')],_0x06c5('0x22'));for(var _0x37734e=0x0,_0x579940={};_0x37734e<_0xcb5b9f[_0x06c5('0x3d')];_0x37734e+=0x1){_0x579940=_0xcb5b9f[_0x37734e];if(_[_0x06c5('0x3b')](_0x34d5dc[_0x06c5('0x13')][_0x579940[_0x06c5('0x22')]])){_0x34d5dc['campaigns'][_0x579940[_0x06c5('0x22')]]=new Campaign(_0x579940);}else{_0x34d5dc['mergeFromDatabase'](_0x34d5dc['campaigns'][_0x579940[_0x06c5('0x22')]],_0x579940);}}}return _0x34d5dc[_0x06c5('0x13')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x5f')]=function(){var _0x3f87a7=this;return function(_0x23663d){if(_0x23663d){freeIsNotKey(_0x23663d,_0x3f87a7[_0x06c5('0x14')],'id');for(var _0x172335=0x0,_0x41c6de={};_0x172335<_0x23663d[_0x06c5('0x3d')];_0x172335+=0x1){_0x41c6de=_0x23663d[_0x172335];if(_[_0x06c5('0x3b')](_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']])){_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']]=new VoiceExtension(_0x41c6de);}else{_0x3f87a7[_0x06c5('0x39')](_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']],_0x41c6de);}}}return _0x3f87a7['voiceExtensions'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x60')]=function(){var _0x104fb6=this;return function(_0x28b8ae){clearCampaigns(_0x104fb6[_0x06c5('0x13')]);for(var _0x7fa9cf=0x0;_0x7fa9cf<_0x28b8ae[_0x06c5('0x3d')];_0x7fa9cf+=0x1){_['merge'](_0x104fb6[_0x06c5('0x13')][_0x28b8ae[_0x7fa9cf][_0x06c5('0x22')]],_0x28b8ae[_0x7fa9cf]);}return _0x104fb6[_0x06c5('0x13')];};};Realtime['prototype'][_0x06c5('0x61')]=function(){var _0x53caab=this;return function(_0x4f481d){if(_0x4f481d){freeIsNotKey(_0x4f481d,_0x53caab[_0x06c5('0x1e')],'id');for(var _0x36ef79=0x0,_0x3ce1e4={},_0x3f6cbb={};_0x36ef79<_0x4f481d[_0x06c5('0x3d')];_0x36ef79+=0x1){_0x3ce1e4=_0x4f481d[_0x36ef79];if(_['isUndefined'](_0x53caab[_0x06c5('0x1e')][_0x3ce1e4['id']])){_0x53caab[_0x06c5('0x1e')][_0x3ce1e4['id']]=new FaxAccount(_0x3ce1e4);}else{_0x53caab['mergeFromDatabase'](_0x53caab['faxAccounts'][_0x3ce1e4['id']],_0x3ce1e4);}}}return _0x53caab[_0x06c5('0x1e')];};};module[_0x06c5('0x62')]=Realtime; \ No newline at end of file +var _0x46b3=['voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../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','templates','outbound','channels','queueChannels','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','isUndefined','initTelephones','length','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','diff','initVoiceCallReports','duration','ANSWERED','billableseconds','campaigns'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x46b3,0x194));var _0x346b=function(_0x6c2468,_0x506ac0){_0x6c2468=_0x6c2468-0x0;var _0x5d6fb7=_0x46b3[_0x6c2468];return _0x5d6fb7;};'use strict';var BPromise=require(_0x346b('0x0'));var util=require(_0x346b('0x1'));var _=require(_0x346b('0x2'));var moment=require(_0x346b('0x3'));var Agent=require(_0x346b('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x346b('0x5'));var VoiceQueue=require(_0x346b('0x6'));var Trigger=require(_0x346b('0x7'));var Template=require(_0x346b('0x8'));var Campaign=require(_0x346b('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x346b('0xa'));var SalesforceAccount=require(_0x346b('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x346b('0xc'));var ZohoAccount=require(_0x346b('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x346b('0xe'));var ServicenowAccount=require(_0x346b('0xf'));var Dynamics365Account=require(_0x346b('0x10'));var FaxAccount=require(_0x346b('0x11'));var Realtime=function(){this[_0x346b('0x12')]={};this[_0x346b('0x13')]={};this[_0x346b('0x14')]={};this[_0x346b('0x15')]={};this[_0x346b('0x16')]={};this['campaigns']={};this[_0x346b('0x17')]={};this[_0x346b('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x346b('0x19')]={};this[_0x346b('0x1a')]={};this['outboundChannels']={};this[_0x346b('0x1b')]={};this[_0x346b('0x1c')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x346b('0x1d')]={};this[_0x346b('0x1e')]={};this[_0x346b('0x1f')]={};this[_0x346b('0x20')]={};this[_0x346b('0x21')]={};this[_0x346b('0x22')]={};this[_0x346b('0x23')]={};};function freeIsNotKey(_0x15acda,_0x1919d2,_0x216ef3){var _0x5708f2=_[_0x346b('0x24')](_0x15acda,function(_0x539b0b,_0x1ab499){return _0x539b0b[_0x216ef3];});for(var _0x1b9c19 in _0x1919d2){if(_0x1919d2[_0x346b('0x25')](_0x1b9c19)){if(!_0x5708f2[_0x1b9c19]){delete _0x1919d2[_0x1b9c19];}}}}function freeIsNotKeySip(_0x57977c,_0x572e63){var _0xb75198=_['mapKeys'](_0x57977c,function(_0xd41d73,_0x29be83){return util[_0x346b('0x26')](_0x346b('0x27'),_0xd41d73[_0x346b('0x28')]);});for(var _0x3db379 in _0x572e63){if(_0x572e63['hasOwnProperty'](_0x3db379)){if(!_0xb75198[_0x3db379]){delete _0x572e63[_0x3db379];}}}}function freeIsNotKeyAgent(_0x1e2647,_0x261734){var _0x47d8ab=_['mapKeys'](_0x1e2647,function(_0x43cf75,_0x125959){var _0x222d1a=_['isNil'](_0x43cf75[_0x346b('0x29')])?util[_0x346b('0x26')](_0x346b('0x27'),_0x43cf75['name']):_0x43cf75[_0x346b('0x29')];return _0x222d1a;});for(var _0x4996ef in _0x261734){if(_0x261734[_0x346b('0x25')](_0x4996ef)){if(!_0x47d8ab[_0x4996ef]){delete _0x261734[_0x4996ef];}}}}function clearVoiceCallReports(_0x5af763){_0x5af763[_0x346b('0x2a')]=0x0;_0x5af763[_0x346b('0x2b')]=0x0;_0x5af763[_0x346b('0x2c')]=0x0;_0x5af763[_0x346b('0x2d')]=0x0;_0x5af763['sumBillable']=0x0;}function clearCampaigns(_0x2d4e29){if(!_[_0x346b('0x2e')](_0x2d4e29)){for(var _0x5b62e5 in _0x2d4e29){if(_0x2d4e29['hasOwnProperty'](_0x5b62e5)){_0x2d4e29[_0x5b62e5][_0x346b('0x2f')]=0x0;_0x2d4e29[_0x5b62e5][_0x346b('0x30')]=0x0;}}}}function clearVoiceQueues(_0x53b3b6){if(!_[_0x346b('0x2e')](_0x53b3b6)){for(var _0x523d7d in _0x53b3b6){if(_0x53b3b6[_0x346b('0x25')](_0x523d7d)){_0x53b3b6[_0x523d7d][_0x346b('0x2a')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x2b')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x31')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x32')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x2c')]=0x0;_0x53b3b6[_0x523d7d]['sumDuration']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x33')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x34')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x35')]=0x0;_0x53b3b6[_0x523d7d]['outboundBusyCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundCongestionCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundNoSuchCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundUnknownCallsDay']=0x0;_0x53b3b6[_0x523d7d]['outboundDropCallsDayTimeout']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x36')]=0x0;_0x53b3b6[_0x523d7d]['outboundBlacklistCallsDay']=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x37')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x38')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x39')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x34')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x3a')]=0x0;_0x53b3b6[_0x523d7d][_0x346b('0x3b')]=!![];}}}}Realtime[_0x346b('0x3c')]['mergeFromDatabase']=function(_0x5baa95,_0xbe772f){for(var _0x140b66 in _0xbe772f){if(_0x5baa95[_0x346b('0x25')](_0x140b66)){_0x5baa95[_0x140b66]=_0xbe772f[_0x140b66];}}};Realtime[_0x346b('0x3c')]['initAgents']=function(){var _0x44a1fa=this;return function(_0x1badc9){if(_0x1badc9){freeIsNotKeyAgent(_0x1badc9,_0x44a1fa['agents']);for(var _0x462dac=0x0,_0xb21d54={},_0x1764f8={};_0x462dac<_0x1badc9['length'];_0x462dac+=0x1){_0xb21d54=_0x1badc9[_0x462dac];var _0x623810=_['isNil'](_0xb21d54[_0x346b('0x29')])?util[_0x346b('0x26')](_0x346b('0x27'),_0xb21d54[_0x346b('0x28')]):_0xb21d54[_0x346b('0x29')];if(_[_0x346b('0x3d')](_0x44a1fa[_0x346b('0x12')][_0x623810])){_0x44a1fa[_0x346b('0x12')][_0x623810]=new Agent(_0xb21d54);}else{_0x44a1fa['mergeFromDatabase'](_0x44a1fa[_0x346b('0x12')][_0x623810],_0xb21d54);}}}return _0x44a1fa['agents'];};};Realtime[_0x346b('0x3c')][_0x346b('0x3e')]=function(){var _0xaf4b5b=this;return function(_0x2d26f9){if(_0x2d26f9){freeIsNotKeySip(_0x2d26f9,_0xaf4b5b[_0x346b('0x13')]);for(var _0x11e44a=0x0,_0x51db43={},_0x1fe5ab={};_0x11e44a<_0x2d26f9[_0x346b('0x3f')];_0x11e44a+=0x1){_0x51db43=_0x2d26f9[_0x11e44a];if(_[_0x346b('0x3d')](_0xaf4b5b['telephones'][util[_0x346b('0x26')]('SIP/%s',_0x51db43['name'])])){_0xaf4b5b[_0x346b('0x13')][util[_0x346b('0x26')](_0x346b('0x27'),_0x51db43['name'])]=new Telephone(_0x51db43);}else{_0xaf4b5b[_0x346b('0x40')](_0xaf4b5b[_0x346b('0x13')][util['format']('SIP/%s',_0x51db43[_0x346b('0x28')])],_0x51db43);}}}return _0xaf4b5b[_0x346b('0x13')];};};Realtime[_0x346b('0x3c')][_0x346b('0x41')]=function(){var _0x517248=this;return function(_0x319283){if(_0x319283){freeIsNotKeySip(_0x319283,_0x517248['trunks']);for(var _0x20487f=0x0,_0x481dd2={},_0x40b198={};_0x20487f<_0x319283[_0x346b('0x3f')];_0x20487f+=0x1){_0x481dd2=_0x319283[_0x20487f];if(_[_0x346b('0x3d')](_0x517248['trunks'][util['format'](_0x346b('0x27'),_0x481dd2['name'])])){_0x517248[_0x346b('0x14')][util['format']('SIP/%s',_0x481dd2['name'])]=new Trunk(_0x481dd2);}else{_0x517248[_0x346b('0x40')](_0x517248['trunks'][util[_0x346b('0x26')](_0x346b('0x27'),_0x481dd2[_0x346b('0x28')])],_0x481dd2);}}}return _0x517248['trunks'];};};Realtime[_0x346b('0x3c')][_0x346b('0x42')]=function(){var _0x2d69c1=this;return function(_0x5b54b9){if(_0x5b54b9){freeIsNotKey(_0x5b54b9,_0x2d69c1[_0x346b('0x15')],_0x346b('0x28'));for(var _0x30c585=0x0,_0x4e05aa={},_0x14b701={};_0x30c585<_0x5b54b9[_0x346b('0x3f')];_0x30c585+=0x1){_0x4e05aa=_0x5b54b9[_0x30c585];if(_['isUndefined'](_0x2d69c1[_0x346b('0x15')][_0x4e05aa[_0x346b('0x28')]])){_0x2d69c1['voiceQueues'][_0x4e05aa['name']]=new VoiceQueue(_0x4e05aa);}else{_0x2d69c1['mergeFromDatabase'](_0x2d69c1['voiceQueues'][_0x4e05aa['name']],_0x4e05aa);}}}return _0x2d69c1['voiceQueues'];};};Realtime['prototype'][_0x346b('0x43')]=function(){var _0x48fc11=this;return function(_0x5501e0){if(_0x5501e0){freeIsNotKey(_0x5501e0,_0x48fc11[_0x346b('0x16')],'id');for(var _0x122c20=0x0,_0x3c7011={},_0x29e8bd={};_0x122c20<_0x5501e0[_0x346b('0x3f')];_0x122c20+=0x1){_0x3c7011=_0x5501e0[_0x122c20];if(_[_0x346b('0x3d')](_0x48fc11[_0x346b('0x16')][_0x3c7011['id']])){_0x48fc11[_0x346b('0x16')][_0x3c7011['id']]=new Trigger(_0x3c7011);}else{_0x48fc11['mergeFromDatabase'](_0x48fc11[_0x346b('0x16')][_0x3c7011['id']],_0x3c7011);}}}return _0x48fc11[_0x346b('0x16')];};};Realtime[_0x346b('0x3c')]['initTemplates']=function(){var _0x5c6054=this;return function(_0x4f84be){if(_0x4f84be){freeIsNotKey(_0x4f84be,_0x5c6054[_0x346b('0x17')],'id');for(var _0x3c62fc=0x0,_0x52b83c={},_0x2fa5e8={};_0x3c62fc<_0x4f84be[_0x346b('0x3f')];_0x3c62fc+=0x1){_0x52b83c=_0x4f84be[_0x3c62fc];if(_[_0x346b('0x3d')](_0x5c6054[_0x346b('0x17')][_0x52b83c['id']])){_0x5c6054[_0x346b('0x17')][_0x52b83c['id']]=new Template(_0x52b83c);}else{_0x5c6054[_0x346b('0x40')](_0x5c6054[_0x346b('0x17')][_0x52b83c['id']],_0x52b83c);}}}return _0x5c6054[_0x346b('0x17')];};};Realtime[_0x346b('0x3c')][_0x346b('0x44')]=function(){var _0x26b320=this;return function(_0x47af04){if(_0x47af04){freeIsNotKey(_0x47af04,_0x26b320[_0x346b('0x1c')],'id');for(var _0xcecc1b=0x0,_0x25c1b5={},_0x3fd47d={};_0xcecc1b<_0x47af04[_0x346b('0x3f')];_0xcecc1b+=0x1){_0x25c1b5=_0x47af04[_0xcecc1b];if(_[_0x346b('0x3d')](_0x26b320[_0x346b('0x1c')][_0x25c1b5['id']])){_0x26b320[_0x346b('0x1c')][_0x25c1b5['id']]=new ZendeskAccount(_0x25c1b5);}else{_0x26b320[_0x346b('0x40')](_0x26b320['zendeskAccounts'][_0x25c1b5['id']],_0x25c1b5);}}}return _0x26b320['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x332548=this;return function(_0x2c9790){if(_0x2c9790){freeIsNotKey(_0x2c9790,_0x332548[_0x346b('0x45')],'id');for(var _0x407dcf=0x0,_0x3f56a7={},_0x2581ff={};_0x407dcf<_0x2c9790[_0x346b('0x3f')];_0x407dcf+=0x1){_0x3f56a7=_0x2c9790[_0x407dcf];if(_[_0x346b('0x3d')](_0x332548[_0x346b('0x45')][_0x3f56a7['id']])){_0x332548[_0x346b('0x45')][_0x3f56a7['id']]=new SalesforceAccount(_0x3f56a7);}else{_0x332548[_0x346b('0x40')](_0x332548[_0x346b('0x45')][_0x3f56a7['id']],_0x3f56a7);}}}return _0x332548[_0x346b('0x45')];};};Realtime[_0x346b('0x3c')][_0x346b('0x46')]=function(){var _0x126164=this;return function(_0x32831c){if(_0x32831c){freeIsNotKey(_0x32831c,_0x126164['freshdeskAccounts'],'id');for(var _0x5bb2ed=0x0,_0x446b4e={},_0x54ed0a={};_0x5bb2ed<_0x32831c[_0x346b('0x3f')];_0x5bb2ed+=0x1){_0x446b4e=_0x32831c[_0x5bb2ed];if(_['isUndefined'](_0x126164[_0x346b('0x1d')][_0x446b4e['id']])){_0x126164[_0x346b('0x1d')][_0x446b4e['id']]=new FreshdeskAccount(_0x446b4e);}else{_0x126164[_0x346b('0x40')](_0x126164[_0x346b('0x1d')][_0x446b4e['id']],_0x446b4e);}}}return _0x126164[_0x346b('0x1d')];};};Realtime[_0x346b('0x3c')][_0x346b('0x47')]=function(){var _0xc1bde=this;return function(_0x7891ee){if(_0x7891ee){freeIsNotKey(_0x7891ee,_0xc1bde[_0x346b('0x1e')],'id');for(var _0x3011bc=0x0,_0x2765ae={},_0x83dd8f={};_0x3011bc<_0x7891ee[_0x346b('0x3f')];_0x3011bc+=0x1){_0x2765ae=_0x7891ee[_0x3011bc];if(_['isUndefined'](_0xc1bde[_0x346b('0x1e')][_0x2765ae['id']])){_0xc1bde['zohoAccounts'][_0x2765ae['id']]=new ZohoAccount(_0x2765ae);}else{_0xc1bde[_0x346b('0x40')](_0xc1bde[_0x346b('0x1e')][_0x2765ae['id']],_0x2765ae);}}}return _0xc1bde[_0x346b('0x1e')];};};Realtime[_0x346b('0x3c')][_0x346b('0x48')]=function(){var _0x2ea4cd=this;return function(_0x414ce4){if(_0x414ce4){freeIsNotKey(_0x414ce4,_0x2ea4cd['deskAccounts'],'id');for(var _0x28f325=0x0,_0x39b9f2={},_0x76ac3f={};_0x28f325<_0x414ce4['length'];_0x28f325+=0x1){_0x39b9f2=_0x414ce4[_0x28f325];if(_['isUndefined'](_0x2ea4cd['deskAccounts'][_0x39b9f2['id']])){_0x2ea4cd['deskAccounts'][_0x39b9f2['id']]=new DeskAccount(_0x39b9f2);}else{_0x2ea4cd[_0x346b('0x40')](_0x2ea4cd[_0x346b('0x1f')][_0x39b9f2['id']],_0x39b9f2);}}}return _0x2ea4cd[_0x346b('0x1f')];};};Realtime[_0x346b('0x3c')][_0x346b('0x49')]=function(){var _0x30b0d5=this;return function(_0x55b2e4){if(_0x55b2e4){freeIsNotKey(_0x55b2e4,_0x30b0d5[_0x346b('0x4a')],'id');for(var _0x42bf5e=0x0,_0x26584a={},_0x31d005={};_0x42bf5e<_0x55b2e4['length'];_0x42bf5e+=0x1){_0x26584a=_0x55b2e4[_0x42bf5e];if(_[_0x346b('0x3d')](_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']])){_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']]=new SugarcrmAccount(_0x26584a);}else{_0x30b0d5['mergeFromDatabase'](_0x30b0d5[_0x346b('0x4a')][_0x26584a['id']],_0x26584a);}}}return _0x30b0d5[_0x346b('0x4a')];};};Realtime['prototype'][_0x346b('0x4b')]=function(){var _0x1da1f4=this;return function(_0x148425){if(_0x148425){freeIsNotKey(_0x148425,_0x1da1f4[_0x346b('0x20')],'id');for(var _0x2e5db5=0x0,_0xc97c92={},_0x590c1a={};_0x2e5db5<_0x148425[_0x346b('0x3f')];_0x2e5db5+=0x1){_0xc97c92=_0x148425[_0x2e5db5];if(_[_0x346b('0x3d')](_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']])){_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']]=new VtigerAccount(_0xc97c92);}else{_0x1da1f4[_0x346b('0x40')](_0x1da1f4[_0x346b('0x20')][_0xc97c92['id']],_0xc97c92);}}}return _0x1da1f4[_0x346b('0x20')];};};Realtime[_0x346b('0x3c')]['initServicenowAccounts']=function(){var _0x52c15a=this;return function(_0xe49d7f){if(_0xe49d7f){freeIsNotKey(_0xe49d7f,_0x52c15a[_0x346b('0x21')],'id');for(var _0x537f6b=0x0,_0x181283={},_0x26dde8={};_0x537f6b<_0xe49d7f['length'];_0x537f6b+=0x1){_0x181283=_0xe49d7f[_0x537f6b];if(_[_0x346b('0x3d')](_0x52c15a['servicenowAccounts'][_0x181283['id']])){_0x52c15a['servicenowAccounts'][_0x181283['id']]=new ServicenowAccount(_0x181283);}else{_0x52c15a[_0x346b('0x40')](_0x52c15a[_0x346b('0x21')][_0x181283['id']],_0x181283);}}}return _0x52c15a['servicenowAccounts'];};};Realtime[_0x346b('0x3c')][_0x346b('0x4c')]=function(){var _0x33fd58=this;return function(_0x568718){if(_0x568718){freeIsNotKey(_0x568718,_0x33fd58[_0x346b('0x22')],'id');for(var _0x197b14=0x0,_0x490b35={},_0x2f617f={};_0x197b14<_0x568718[_0x346b('0x3f')];_0x197b14+=0x1){_0x490b35=_0x568718[_0x197b14];if(_[_0x346b('0x3d')](_0x33fd58[_0x346b('0x22')][_0x490b35['id']])){_0x33fd58[_0x346b('0x22')][_0x490b35['id']]=new Dynamics365Account(_0x490b35);}else{_0x33fd58[_0x346b('0x40')](_0x33fd58[_0x346b('0x22')][_0x490b35['id']],_0x490b35);}}}return _0x33fd58[_0x346b('0x22')];};};Realtime['prototype'][_0x346b('0x4d')]=function(){var _0x25d378=this;return function(_0x467681){for(var _0x5a23e8=0x0;_0x5a23e8<_0x467681[_0x346b('0x3f')];_0x5a23e8+=0x1){_[_0x346b('0x4e')](_0x25d378[_0x346b('0x15')][_0x467681[_0x5a23e8]['name']],_0x467681[_0x5a23e8]);}return _0x25d378['voiceQueues'];};};Realtime[_0x346b('0x3c')][_0x346b('0x4f')]=function(){var _0x3498a4=this;return function(_0x20def4){clearVoiceQueues(_0x3498a4[_0x346b('0x15')]);if(_0x20def4){_0x20def4=_[_0x346b('0x50')](_0x20def4,'uniqueid');for(var _0x145c54 in _0x20def4){if(_0x20def4[_0x346b('0x25')](_0x145c54)){var _0x200d46={};for(var _0x30f1b6=0x0;_0x30f1b6<_0x20def4[_0x145c54][_0x346b('0x3f')];_0x30f1b6+=0x1){var _0x5ce969=_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x51')];if(_0x3498a4[_0x346b('0x15')][_0x5ce969]){if(_0x20def4[_0x145c54][_0x30f1b6]['queuecallerexit']){_0x3498a4['voiceQueues'][_0x5ce969]['unmanaged']+=0x1;}if(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x52')]){_0x3498a4['voiceQueues'][_0x5ce969][_0x346b('0x32')]+=0x1;}_0x3498a4[_0x346b('0x15')][_0x5ce969]['sumHoldTime']+=moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x53')])['diff'](moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x54')]),_0x346b('0x55'))||0x0;if(_0x30f1b6===_0x20def4[_0x145c54]['length']-0x1){_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2d')]+=moment(_0x20def4[_0x145c54][_0x30f1b6]['queuecallercompleteAt']||_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x56')]||_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x57')])['diff'](moment(_0x20def4[_0x145c54][_0x30f1b6]['queuecallerjoinAt']),_0x346b('0x55'))||0x0;_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2a')]+=0x1;if(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x58')]){_0x3498a4[_0x346b('0x15')][_0x5ce969]['answered']+=0x1;_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x33')]+=moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x59')])[_0x346b('0x5a')](moment(_0x20def4[_0x145c54][_0x30f1b6][_0x346b('0x53')]),'seconds')||0x0;}}else{_0x3498a4[_0x346b('0x15')][_0x5ce969][_0x346b('0x2d')]+=_0x3498a4[_0x346b('0x15')][_0x5ce969]['sumHoldTime']||0x0;}}}}}}return _0x3498a4['voiceQueues'];};};Realtime['prototype'][_0x346b('0x5b')]=function(){var _0x17c1ec=this;return function(_0x1b8619){clearVoiceCallReports(_0x17c1ec[_0x346b('0x18')]);if(_0x1b8619){for(var _0x390d6c=0x0;_0x390d6c<_0x1b8619[_0x346b('0x3f')];_0x390d6c+=0x1){_0x17c1ec['outbound'][_0x346b('0x2a')]+=0x1;_0x17c1ec[_0x346b('0x18')][_0x346b('0x2d')]+=_0x1b8619[_0x390d6c][_0x346b('0x5c')];if(_0x1b8619[_0x390d6c]['disposition']===_0x346b('0x5d')){_0x17c1ec['outbound'][_0x346b('0x2b')]+=0x1;_0x17c1ec[_0x346b('0x18')][_0x346b('0x2c')]+=_0x1b8619[_0x390d6c]['duration']-_0x1b8619[_0x390d6c]['billableseconds']||0x0;_0x17c1ec['outbound'][_0x346b('0x33')]+=_0x1b8619[_0x390d6c][_0x346b('0x5e')];}}}return _0x17c1ec[_0x346b('0x18')];};};Realtime[_0x346b('0x3c')]['initCampaigns']=function(){var _0xc241f4=this;return function(_0x2d281d){if(_0x2d281d){freeIsNotKey(_0x2d281d,_0xc241f4['campaigns'],_0x346b('0x28'));for(var _0x778aa=0x0,_0x2625d5={};_0x778aa<_0x2d281d['length'];_0x778aa+=0x1){_0x2625d5=_0x2d281d[_0x778aa];if(_[_0x346b('0x3d')](_0xc241f4[_0x346b('0x5f')][_0x2625d5[_0x346b('0x28')]])){_0xc241f4[_0x346b('0x5f')][_0x2625d5['name']]=new Campaign(_0x2625d5);}else{_0xc241f4[_0x346b('0x40')](_0xc241f4['campaigns'][_0x2625d5[_0x346b('0x28')]],_0x2625d5);}}}return _0xc241f4[_0x346b('0x5f')];};};Realtime[_0x346b('0x3c')]['initVoiceExtensions']=function(){var _0x596102=this;return function(_0x459219){if(_0x459219){freeIsNotKey(_0x459219,_0x596102['voiceExtensions'],'id');for(var _0x56eedd=0x0,_0x584d83={};_0x56eedd<_0x459219[_0x346b('0x3f')];_0x56eedd+=0x1){_0x584d83=_0x459219[_0x56eedd];if(_[_0x346b('0x3d')](_0x596102[_0x346b('0x60')][_0x584d83['id']])){_0x596102[_0x346b('0x60')][_0x584d83['id']]=new VoiceExtension(_0x584d83);}else{_0x596102[_0x346b('0x40')](_0x596102[_0x346b('0x60')][_0x584d83['id']],_0x584d83);}}}return _0x596102[_0x346b('0x60')];};};Realtime[_0x346b('0x3c')][_0x346b('0x61')]=function(){var _0x29560a=this;return function(_0x5b94cd){clearCampaigns(_0x29560a[_0x346b('0x5f')]);for(var _0x3249dc=0x0;_0x3249dc<_0x5b94cd[_0x346b('0x3f')];_0x3249dc+=0x1){_[_0x346b('0x4e')](_0x29560a[_0x346b('0x5f')][_0x5b94cd[_0x3249dc][_0x346b('0x28')]],_0x5b94cd[_0x3249dc]);}return _0x29560a[_0x346b('0x5f')];};};Realtime[_0x346b('0x3c')][_0x346b('0x62')]=function(){var _0x4f4a1e=this;return function(_0x553faa){if(_0x553faa){freeIsNotKey(_0x553faa,_0x4f4a1e[_0x346b('0x23')],'id');for(var _0x983053=0x0,_0x24ceb4={},_0x402576={};_0x983053<_0x553faa[_0x346b('0x3f')];_0x983053+=0x1){_0x24ceb4=_0x553faa[_0x983053];if(_[_0x346b('0x3d')](_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']])){_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']]=new FaxAccount(_0x24ceb4);}else{_0x4f4a1e['mergeFromDatabase'](_0x4f4a1e[_0x346b('0x23')][_0x24ceb4['id']],_0x24ceb4);}}}return _0x4f4a1e[_0x346b('0x23')];};};module[_0x346b('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 18964e4..5978b54 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 _0xf280=['queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','voiceCallReport','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','\x22%s\x22\x20<%s>','calleridname','length','monitorFilename','monitors','filename','createdAt','connectedlinename','create','voiceAgentReport','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','voiceDialReport','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','name','find','accountcode','format','SIP/%s','connectedlinenum','lastAssignedTo','interface','isNil','queuecallercomplete'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xf280,0x174));var _0x0f28=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xf280[_0x2fb87c];return _0x43038b;};'use strict';var BPromise=require(_0x0f28('0x0'));var _=require(_0x0f28('0x1'));var moment=require(_0x0f28('0x2'));var util=require(_0x0f28('0x3'));var config=require('../../../config/environment');var logger=require(_0x0f28('0x4'))(_0x0f28('0x5'));var ami=require(_0x0f28('0x6'));var RpcVoiceAgentReport=require(_0x0f28('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x0f28('0x8'));var RpcMemberReport=require(_0x0f28('0x9'));var RpcVoiceQueueReport=require(_0x0f28('0xa'));var RpcVoiceRecording=require(_0x0f28('0xb'));var RpcVoiceTransferReport=require(_0x0f28('0xc'));var VoiceQueueReport=require(_0x0f28('0xd'));var VoiceCallReport=require(_0x0f28('0xe'));var VoiceAgentReport=require(_0x0f28('0xf'));var VoiceDialReport=require(_0x0f28('0x10'));var UserReport=require('./userReport');function Report(_0x562bc9){this[_0x0f28('0x11')]=_0x562bc9;this[_0x0f28('0x12')]=_0x562bc9[_0x0f28('0x12')];this[_0x0f28('0x13')]=_0x562bc9['telephones'];}Report[_0x0f28('0x14')][_0x0f28('0x15')]=function(_0x5d973b){var _0x296c72=new VoiceQueueReport(this[_0x0f28('0x11')]);var _0x3741d3=new VoiceAgentReport(this[_0x0f28('0x11')]);var _0x4927cf=new VoiceDialReport(this['realtime']);var _0x2ba119=new VoiceCallReport(this[_0x0f28('0x11')]);var _0x14fe46=new UserReport(this[_0x0f28('0x11')]);if(config['xdr']&&config[_0x0f28('0x16')][_0x0f28('0x17')]){ami['on'](_0x0f28('0x18'),this[_0x0f28('0x19')][_0x0f28('0x1a')](this));ami['on'](_0x0f28('0x1b'),this['voiceCallReport'][_0x0f28('0x1a')](this));ami['on'](_0x0f28('0x1c'),this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this['voiceDialReport']['bind'](this));ami['on'](_0x0f28('0x1d'),this[_0x0f28('0x1e')][_0x0f28('0x1a')](this));ami['on']('attendedtransfer',this[_0x0f28('0x1f')][_0x0f28('0x1a')](this));}};Report['prototype'][_0x0f28('0x20')]=function(_0x8b1f97){var _0x5aff8e=undefined;_0x5aff8e=_['find'](this[_0x0f28('0x12')],function(_0x3d69d6){return _0x3d69d6['accountcode']==_0x8b1f97||_0x3d69d6[_0x0f28('0x21')]==_0x8b1f97;});if(_['isNil'](_0x5aff8e)){var _0x141172=_[_0x0f28('0x22')](this[_0x0f28('0x13')],function(_0x411004){return _0x411004[_0x0f28('0x23')]==_0x8b1f97||_0x411004[_0x0f28('0x21')]==_0x8b1f97;});if(_0x141172){_0x5aff8e=_[_0x0f28('0x22')](this[_0x0f28('0x12')],function(_0x5460da){return _0x5460da['interface']==util[_0x0f28('0x24')](_0x0f28('0x25'),_0x141172[_0x0f28('0x21')]);});}}return _0x5aff8e;};Report[_0x0f28('0x14')][_0x0f28('0x19')]=function(_0x32a290){for(var _0x442b92=0x0;_0x442b92<_0x32a290['length'];_0x442b92+=0x1){var _0x225348=this[_0x0f28('0x20')](_0x32a290[_0x442b92][_0x0f28('0x26')]);if(_0x225348){_0x32a290[_0x442b92][_0x0f28('0x23')]=_0x225348[_0x0f28('0x23')];_0x32a290[_0x442b92]['assigned']=!![];_0x32a290[_0x442b92][_0x0f28('0x27')]=_0x225348[_0x0f28('0x21')];_0x32a290[_0x442b92][_0x0f28('0x28')]=_[_0x0f28('0x29')](_0x225348[_0x0f28('0x28')])?util[_0x0f28('0x24')](_0x0f28('0x25'),_0x225348[_0x0f28('0x21')]):_0x225348[_0x0f28('0x28')];if(_0x32a290[_0x442b92][_0x0f28('0x2a')]){_0x32a290[_0x442b92][_0x0f28('0x2b')]=moment()[_0x0f28('0x24')](_0x0f28('0x2c'));}if(_0x32a290[_0x442b92][_0x0f28('0x2d')]){_0x32a290[_0x442b92][_0x0f28('0x2e')]=moment()[_0x0f28('0x24')](_0x0f28('0x2c'));}RpcMemberReport[_0x0f28('0x19')](_0x32a290[_0x442b92]);}RpcVoiceQueueReport['create'](_0x32a290[_0x442b92]);}};function extractCalleridNumber(_0x2f5430){var _0xf50aae=_0x2f5430[_0x0f28('0x2f')](/<(.*?)>/);return _0xf50aae?_0xf50aae[0x1]:_0x2f5430;}Report[_0x0f28('0x14')][_0x0f28('0x30')]=function(_0x161c08){_0x161c08[_0x0f28('0x31')]=_0x161c08[_0x0f28('0x31')]||_0x161c08[_0x0f28('0x32')];if(_0x161c08[_0x0f28('0x33')]=='dialer'){_0x161c08[_0x0f28('0x34')]=_0x0f28('0x35');_0x161c08[_0x0f28('0x36')]=_0x161c08[_0x0f28('0x35')];if(_0x161c08['context']==_0x0f28('0x37')){_0x161c08[_0x0f28('0x23')]='';_0x161c08[_0x0f28('0x31')]=extractCalleridNumber(_0x161c08[_0x0f28('0x38')]);}else if(_0x161c08[_0x0f28('0x39')]=='from-sip'){if(_0x161c08[_0x0f28('0x31')]=='xcally-motion-preview'){_0x161c08[_0x0f28('0x31')]=extractCalleridNumber(_0x161c08[_0x0f28('0x3a')]);_0x161c08[_0x0f28('0x3b')]=_0x161c08['originatecalleridnum'];_0x161c08[_0x0f28('0x3c')]=[_0x161c08[_0x0f28('0x3d')],_0x161c08[_0x0f28('0x3d')]=_0x161c08[_0x0f28('0x3c')]][0x0];_0x161c08[_0x0f28('0x38')]=_0x161c08['calleridpreview'];}else{_0x161c08[_0x0f28('0x31')]=_0x161c08[_0x0f28('0x3b')];_0x161c08[_0x0f28('0x3b')]=_0x161c08[_0x0f28('0x3e')];if(_0x161c08[_0x0f28('0x3f')]=='ANSWERED'){_0x161c08[_0x0f28('0x23')]=_0x161c08[_0x0f28('0x26')];}else{_0x161c08[_0x0f28('0x23')]='';}}}}else{_0x161c08[_0x0f28('0x38')]=util[_0x0f28('0x24')](_0x0f28('0x40'),_0x161c08[_0x0f28('0x41')],_0x161c08['calleridnum']);}RpcVoiceCallReport['create'](_0x161c08);if(_0x161c08['monitor']){for(var _0x5e00bb=0x0;_0x5e00bb<_0x161c08['monitors'][_0x0f28('0x42')];_0x5e00bb+=0x1){_0x161c08[_0x0f28('0x43')]=_0x161c08[_0x0f28('0x44')][_0x5e00bb][_0x0f28('0x45')];_0x161c08['createdAt']=_0x161c08[_0x0f28('0x44')][_0x5e00bb][_0x0f28('0x46')];if(_0x161c08[_0x0f28('0x32')]=='xcally-motion-preview'){_0x161c08['calleridnum']=_0x161c08[_0x0f28('0x26')];_0x161c08[_0x0f28('0x41')]=_0x161c08[_0x0f28('0x47')];_0x161c08['connectedlinenum']=_0x161c08['accountcode'];_0x161c08[_0x0f28('0x47')]=_0x161c08['membername'];_0x161c08['exten']=_0x161c08[_0x0f28('0x3e')];}else if(_0x161c08[_0x0f28('0x32')]=='xcally-motion-dialer'){_0x161c08['calleridnum']=_0x161c08[_0x0f28('0x31')];_0x161c08[_0x0f28('0x32')]=_0x161c08[_0x0f28('0x3e')];}RpcVoiceRecording[_0x0f28('0x48')](_0x161c08);}}};Report['prototype'][_0x0f28('0x49')]=function(_0x286c26){if(_['isArray'](_0x286c26)){_0x286c26['forEach'](function(_0x46d4b2){RpcVoiceAgentReport[_0x0f28('0x48')](_0x46d4b2);});}else{RpcVoiceAgentReport[_0x0f28('0x48')](_0x286c26);}};Report[_0x0f28('0x14')]['voiceDialReport']=function(_0x1a323d){RpcVoiceDialReport[_0x0f28('0x48')](_0x1a323d);var _0x3593d3=undefined;var _0x20a884=_0x1a323d[_0x0f28('0x3d')];if(_['startsWith'](_0x20a884,_0x0f28('0x4a'))){var _0x255447=_0x20a884[_0x0f28('0x4b')](_0x20a884['indexOf']('/')+0x1,_0x20a884[_0x0f28('0x4c')]('@'));_0x3593d3=_[_0x0f28('0x22')](this[_0x0f28('0x12')],function(_0x3a31b8){return _0x3a31b8[_0x0f28('0x4d')]==_0x255447||_0x3a31b8[_0x0f28('0x4e')]==_0x255447||_0x3a31b8[_0x0f28('0x23')]==_0x255447;});}else{var _0x255447=_0x20a884[_0x0f28('0x4b')](_0x20a884[_0x0f28('0x4c')]('/')+0x1,_0x20a884[_0x0f28('0x4f')]('-'));_0x3593d3=this[_0x0f28('0x20')](_0x255447);}if(_0x3593d3){_0x1a323d[_0x0f28('0x28')]=_[_0x0f28('0x29')](_0x3593d3[_0x0f28('0x28')])?util['format'](_0x0f28('0x25'),_0x3593d3[_0x0f28('0x21')]):_0x3593d3[_0x0f28('0x28')];_0x1a323d[_0x0f28('0x50')]=_0x3593d3[_0x0f28('0x21')];_0x1a323d[_0x0f28('0x23')]=_0x3593d3[_0x0f28('0x23')];RpcMemberReport[_0x0f28('0x51')](_0x1a323d);}};Report[_0x0f28('0x14')][_0x0f28('0x1e')]=function(_0x2c2e46){RpcVoiceTransferReport[_0x0f28('0x1e')](_0x2c2e46);};Report[_0x0f28('0x14')][_0x0f28('0x1f')]=function(_0x2f13a4){RpcVoiceTransferReport[_0x0f28('0x1f')](_0x2f13a4);};module[_0x0f28('0x52')]=Report; \ No newline at end of file +var _0x935a=['interface','format','SIP/%s','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','destinationchannel','channel','calleridpreview','originatecalleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','monitor','monitors','length','monitorFilename','filename','calleridname','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','voiceDialReport','startsWith','Local','indexOf','substring','lastIndexOf','membername','attendedTransfer','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','agents','accountcode','isNil','name'];(function(_0x21eec5,_0x247273){var _0x324d22=function(_0x2e7baf){while(--_0x2e7baf){_0x21eec5['push'](_0x21eec5['shift']());}};_0x324d22(++_0x247273);}(_0x935a,0x8a));var _0xa935=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x935a[_0x255d5b];return _0x3e141a;};'use strict';var BPromise=require(_0xa935('0x0'));var _=require('lodash');var moment=require(_0xa935('0x1'));var util=require(_0xa935('0x2'));var config=require(_0xa935('0x3'));var logger=require(_0xa935('0x4'))(_0xa935('0x5'));var ami=require(_0xa935('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xa935('0x7'));var RpcVoiceDialReport=require(_0xa935('0x8'));var RpcMemberReport=require(_0xa935('0x9'));var RpcVoiceQueueReport=require(_0xa935('0xa'));var RpcVoiceRecording=require(_0xa935('0xb'));var RpcVoiceTransferReport=require(_0xa935('0xc'));var VoiceQueueReport=require(_0xa935('0xd'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa935('0xe'));var VoiceDialReport=require(_0xa935('0xf'));var UserReport=require(_0xa935('0x10'));function Report(_0x4502c1){this['realtime']=_0x4502c1;this['agents']=_0x4502c1['agents'];this[_0xa935('0x11')]=_0x4502c1[_0xa935('0x11')];}Report[_0xa935('0x12')][_0xa935('0x13')]=function(_0x379b51){var _0x504e06=new VoiceQueueReport(this['realtime']);var _0x173b58=new VoiceAgentReport(this[_0xa935('0x14')]);var _0xbc3671=new VoiceDialReport(this[_0xa935('0x14')]);var _0x1230a9=new VoiceCallReport(this[_0xa935('0x14')]);var _0x5914a4=new UserReport(this[_0xa935('0x14')]);if(config[_0xa935('0x15')]&&config['xdr']['disabled']){ami['on'](_0xa935('0x16'),this[_0xa935('0x17')]['bind'](this));ami['on'](_0xa935('0x18'),this['voiceCallReport'][_0xa935('0x19')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0xa935('0x1a'),this['voiceDialReport'][_0xa935('0x19')](this));ami['on'](_0xa935('0x1b'),this[_0xa935('0x1c')][_0xa935('0x19')](this));ami['on'](_0xa935('0x1d'),this['attendedTransfer'][_0xa935('0x19')](this));}};Report[_0xa935('0x12')][_0xa935('0x1e')]=function(_0xb848b5){var _0xaad704=undefined;_0xaad704=_[_0xa935('0x1f')](this[_0xa935('0x20')],function(_0x9f3d7b){return _0x9f3d7b[_0xa935('0x21')]==_0xb848b5||_0x9f3d7b['name']==_0xb848b5;});if(_[_0xa935('0x22')](_0xaad704)){var _0x3183a5=_[_0xa935('0x1f')](this['telephones'],function(_0x3e5002){return _0x3e5002[_0xa935('0x21')]==_0xb848b5||_0x3e5002[_0xa935('0x23')]==_0xb848b5;});if(_0x3183a5){_0xaad704=_[_0xa935('0x1f')](this['agents'],function(_0xc950f0){return _0xc950f0[_0xa935('0x24')]==util[_0xa935('0x25')](_0xa935('0x26'),_0x3183a5['name']);});}}return _0xaad704;};Report[_0xa935('0x12')][_0xa935('0x17')]=function(_0x5826ef){for(var _0x5646ae=0x0;_0x5646ae<_0x5826ef['length'];_0x5646ae+=0x1){var _0x17bea7=this['findAgent'](_0x5826ef[_0x5646ae]['connectedlinenum']);if(_0x17bea7){_0x5826ef[_0x5646ae][_0xa935('0x21')]=_0x17bea7[_0xa935('0x21')];_0x5826ef[_0x5646ae][_0xa935('0x27')]=!![];_0x5826ef[_0x5646ae][_0xa935('0x28')]=_0x17bea7[_0xa935('0x23')];_0x5826ef[_0x5646ae][_0xa935('0x24')]=_[_0xa935('0x22')](_0x17bea7[_0xa935('0x24')])?util[_0xa935('0x25')]('SIP/%s',_0x17bea7[_0xa935('0x23')]):_0x17bea7[_0xa935('0x24')];if(_0x5826ef[_0x5646ae][_0xa935('0x29')]){_0x5826ef[_0x5646ae]['queuecallercompleteAt']=moment()[_0xa935('0x25')](_0xa935('0x2a'));}if(_0x5826ef[_0x5646ae][_0xa935('0x2b')]){_0x5826ef[_0x5646ae]['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xa935('0x17')](_0x5826ef[_0x5646ae]);}RpcVoiceQueueReport[_0xa935('0x2c')](_0x5826ef[_0x5646ae]);}};function extractCalleridNumber(_0x13e068){var _0x5db943=_0x13e068[_0xa935('0x2d')](/<(.*?)>/);return _0x5db943?_0x5db943[0x1]:_0x13e068;}Report['prototype'][_0xa935('0x2e')]=function(_0x584f7a){_0x584f7a[_0xa935('0x2f')]=_0x584f7a[_0xa935('0x2f')]||_0x584f7a[_0xa935('0x30')];if(_0x584f7a[_0xa935('0x31')]==_0xa935('0x32')){_0x584f7a[_0xa935('0x33')]=_0xa935('0x34');_0x584f7a[_0xa935('0x35')]=_0x584f7a[_0xa935('0x34')];if(_0x584f7a[_0xa935('0x36')]==_0xa935('0x37')){_0x584f7a[_0xa935('0x21')]='';_0x584f7a[_0xa935('0x2f')]=extractCalleridNumber(_0x584f7a[_0xa935('0x38')]);}else if(_0x584f7a[_0xa935('0x36')]==_0xa935('0x39')){if(_0x584f7a[_0xa935('0x2f')]==_0xa935('0x3a')){_0x584f7a[_0xa935('0x2f')]=extractCalleridNumber(_0x584f7a['calleridpreview']);_0x584f7a[_0xa935('0x3b')]=_0x584f7a['originatecalleridnum'];_0x584f7a[_0xa935('0x3c')]=[_0x584f7a[_0xa935('0x3d')],_0x584f7a['channel']=_0x584f7a['destinationchannel']][0x0];_0x584f7a[_0xa935('0x38')]=_0x584f7a[_0xa935('0x3e')];}else{_0x584f7a[_0xa935('0x2f')]=_0x584f7a[_0xa935('0x3b')];_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x3f')];if(_0x584f7a[_0xa935('0x40')]==_0xa935('0x41')){_0x584f7a[_0xa935('0x21')]=_0x584f7a[_0xa935('0x42')];}else{_0x584f7a[_0xa935('0x21')]='';}}}}else{_0x584f7a[_0xa935('0x38')]=util[_0xa935('0x25')](_0xa935('0x43'),_0x584f7a['calleridname'],_0x584f7a['calleridnum']);}RpcVoiceCallReport[_0xa935('0x2c')](_0x584f7a);if(_0x584f7a[_0xa935('0x44')]){for(var _0x1d9f2a=0x0;_0x1d9f2a<_0x584f7a[_0xa935('0x45')][_0xa935('0x46')];_0x1d9f2a+=0x1){_0x584f7a[_0xa935('0x47')]=_0x584f7a['monitors'][_0x1d9f2a][_0xa935('0x48')];_0x584f7a['createdAt']=_0x584f7a[_0xa935('0x45')][_0x1d9f2a]['createdAt'];if(_0x584f7a[_0xa935('0x30')]==_0xa935('0x3a')){_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x42')];_0x584f7a[_0xa935('0x49')]=_0x584f7a[_0xa935('0x4a')];_0x584f7a[_0xa935('0x42')]=_0x584f7a[_0xa935('0x21')];_0x584f7a[_0xa935('0x4a')]=_0x584f7a['membername'];_0x584f7a[_0xa935('0x30')]=_0x584f7a[_0xa935('0x3f')];}else if(_0x584f7a[_0xa935('0x30')]==_0xa935('0x4b')){_0x584f7a[_0xa935('0x3b')]=_0x584f7a[_0xa935('0x2f')];_0x584f7a[_0xa935('0x30')]=_0x584f7a[_0xa935('0x3f')];}RpcVoiceRecording[_0xa935('0x2c')](_0x584f7a);}}};Report['prototype'][_0xa935('0x4c')]=function(_0x33b863){if(_['isArray'](_0x33b863)){_0x33b863[_0xa935('0x4d')](function(_0x434cb8){RpcVoiceAgentReport[_0xa935('0x2c')](_0x434cb8);});}else{RpcVoiceAgentReport[_0xa935('0x2c')](_0x33b863);}};Report['prototype'][_0xa935('0x4e')]=function(_0x32892d){RpcVoiceDialReport[_0xa935('0x2c')](_0x32892d);var _0x295312=undefined;var _0x907a3e=_0x32892d[_0xa935('0x3d')];if(_[_0xa935('0x4f')](_0x907a3e,_0xa935('0x50'))){var _0x5efc60=_0x907a3e['substring'](_0x907a3e['indexOf']('/')+0x1,_0x907a3e[_0xa935('0x51')]('@'));_0x295312=_[_0xa935('0x1f')](this[_0xa935('0x20')],function(_0x23f1fb){return _0x23f1fb['mobile']==_0x5efc60||_0x23f1fb['phone']==_0x5efc60||_0x23f1fb[_0xa935('0x21')]==_0x5efc60;});}else{var _0x5efc60=_0x907a3e[_0xa935('0x52')](_0x907a3e[_0xa935('0x51')]('/')+0x1,_0x907a3e[_0xa935('0x53')]('-'));_0x295312=this['findAgent'](_0x5efc60);}if(_0x295312){_0x32892d[_0xa935('0x24')]=_[_0xa935('0x22')](_0x295312[_0xa935('0x24')])?util[_0xa935('0x25')](_0xa935('0x26'),_0x295312[_0xa935('0x23')]):_0x295312[_0xa935('0x24')];_0x32892d[_0xa935('0x54')]=_0x295312['name'];_0x32892d[_0xa935('0x21')]=_0x295312[_0xa935('0x21')];RpcMemberReport[_0xa935('0x4e')](_0x32892d);}};Report['prototype'][_0xa935('0x1c')]=function(_0x52a750){RpcVoiceTransferReport['blindTransfer'](_0x52a750);};Report[_0xa935('0x12')][_0xa935('0x55')]=function(_0x31d2f9){RpcVoiceTransferReport['attendedTransfer'](_0x31d2f9);};module[_0xa935('0x56')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2bfe349..866ae84 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 _0x4761=['syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username','state','merge','event','actionid','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','trunks','trunk:save','startsWith','Queue','Local','substring','indexOf','mobile','peer','registered','address','status','util','ioredis','../../../config/logger','ami','../ami','defaults','socket.io-emitter','redis','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange'];(function(_0xaa5be9,_0x3e59fb){var _0x30a168=function(_0x1a0796){while(--_0x1a0796){_0xaa5be9['push'](_0xaa5be9['shift']());}};_0x30a168(++_0x3e59fb);}(_0x4761,0x1e9));var _0x1476=function(_0xa2d7cc,_0x25e17e){_0xa2d7cc=_0xa2d7cc-0x0;var _0x3cfb61=_0x4761[_0xa2d7cc];return _0x3cfb61;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x1476('0x0'));var Redis=require(_0x1476('0x1'));var config=require('../../../config/environment');var logger=require(_0x1476('0x2'))(_0x1476('0x3'));var ami=require(_0x1476('0x4'));config['redis']=_[_0x1476('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1476('0x6'))(new Redis(config[_0x1476('0x7')]));function UserReport(_0x17849f){this['trunks']=_0x17849f['trunks'];this[_0x1476('0x8')]=_0x17849f[_0x1476('0x8')];this[_0x1476('0x9')]=_0x17849f['telephones'];ami['on'](_0x1476('0xa'),this['syncRegistry'][_0x1476('0xb')](this));ami['on'](_0x1476('0xc'),this[_0x1476('0xd')][_0x1476('0xb')](this));ami['on'](_0x1476('0xe'),this[_0x1476('0xf')][_0x1476('0xb')](this));ami['on'](_0x1476('0x10'),this[_0x1476('0x11')]['bind'](this));this[_0x1476('0x12')]();return BPromise[_0x1476('0x13')]()[_0x1476('0x14')](ami[_0x1476('0x15')]())[_0x1476('0x14')](ami[_0x1476('0x16')]())['then'](ami[_0x1476('0x17')]())[_0x1476('0x18')](loggerCatch(_0x1476('0x19')));}function loggerCatch(_0x2149f2){return function(_0x2d02dc){logger[_0x1476('0x1a')](_0x2149f2,util[_0x1476('0x1b')](_0x2d02dc,{'showHidden':![],'depth':null}));};}UserReport[_0x1476('0x1c')][_0x1476('0x12')]=function(){setInterval(function(){BPromise[_0x1476('0x13')]()[_0x1476('0x14')](ami[_0x1476('0x15')]())['then'](ami['actionDeviceStateList']())[_0x1476('0x14')](ami[_0x1476('0x17')]())[_0x1476('0x18')](loggerCatch(_0x1476('0x19')));},0x32c8);};UserReport[_0x1476('0x1c')][_0x1476('0x1d')]=function(_0x4bded9){return _0x4bded9!==null&&!_[_0x1476('0x1e')](_0x4bded9);};UserReport[_0x1476('0x1c')][_0x1476('0x1f')]=function(_0x2a1957,_0x186222,_0x449c1b){io['to'](_0x2a1957)[_0x1476('0x1f')](_0x186222,_0x449c1b);};UserReport[_0x1476('0x1c')][_0x1476('0xd')]=function(_0x46633a){try{if(this[_0x1476('0x1d')](_0x46633a)){var _0xec8e2=_[_0x1476('0x20')](this['trunks'],{'registry':_0x46633a[_0x1476('0x21')]});if(_0xec8e2){_0x46633a['stateRegistry']=_0x46633a[_0x1476('0x22')];_[_0x1476('0x23')](_0xec8e2,_['omit'](_0x46633a,[_0x1476('0x24'),_0x1476('0x25'),'username',_0x1476('0x22')]));this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),_0xec8e2[_0x1476('0x28')]),'trunk:save',_0xec8e2);}}}catch(_0x25b8d2){logger[_0x1476('0x1a')](_0x1476('0x29'),util[_0x1476('0x1b')](_0x25b8d2,{'showHidden':![],'depth':null}));}};UserReport[_0x1476('0x1c')][_0x1476('0xf')]=function(_0x58c701){try{if(this[_0x1476('0x1d')](_0x58c701)){if(this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]]){if(!this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2b')]||_0x58c701['state'][_0x1476('0x2c')]()==_0x1476('0x2d')){this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2b')]=![];if(this[_0x1476('0x8')][_0x58c701['device']][_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()['format']('x'));}this[_0x1476('0x8')][_0x58c701['device']][_0x1476('0x22')]=_0x58c701['state'][_0x1476('0x2c')]();this['agents'][_0x58c701['device']][_0x1476('0x30')](_0x58c701);}}else if(this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]]){if(this[_0x1476('0x9')][_0x58c701['device']][_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')]['toLowerCase']()){this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()[_0x1476('0x26')]('x'));}this['telephones'][_0x58c701[_0x1476('0x2a')]][_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x31'),this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x28')]),_0x1476('0x32'),this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]]);}else if(this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]]){if(this['trunks'][_0x58c701[_0x1476('0x2a')]]['state']!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()['format']('x'));}this[_0x1476('0x33')][_0x58c701['device']][_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),this[_0x1476('0x33')][_0x58c701['device']]['name']),_0x1476('0x34'),this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]]);}else if(_[_0x1476('0x35')](_0x58c701[_0x1476('0x2a')],_0x1476('0x36'))){}else if(_[_0x1476('0x35')](_0x58c701[_0x1476('0x2a')],_0x1476('0x37'))){var _0x36c805=_0x58c701['device'];var _0x1e0249=_0x36c805[_0x1476('0x38')](_0x36c805[_0x1476('0x39')]('/')+0x1,_0x36c805[_0x1476('0x39')]('@'));var _0x52ffdf=_['find'](this[_0x1476('0x8')],function(_0x2dee69){return _0x2dee69[_0x1476('0x3a')]==_0x1e0249||_0x2dee69['phone']==_0x1e0249||_0x2dee69['accountcode']==_0x1e0249;});if(_0x52ffdf){if(_0x52ffdf[_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){_0x52ffdf['stateTime']=_[_0x1476('0x2f')](moment()['format']('x'));}_0x52ffdf[_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();_0x52ffdf['local']=!![];_0x52ffdf[_0x1476('0x30')](_0x58c701);}}else{}}}catch(_0x4f4498){logger[_0x1476('0x1a')]('[syncDeviceState][UserReport]',util[_0x1476('0x1b')](_0x4f4498,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1476('0x11')]=function(_0x5be111){try{if(this[_0x1476('0x1d')](_0x5be111)&&this[_0x1476('0x1d')](_0x5be111[_0x1476('0x10')])){if(this['agents'][_0x5be111[_0x1476('0x3b')]]){if(!this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x2b')]||_0x5be111[_0x1476('0x10')][_0x1476('0x2c')]()==_0x1476('0x3c')){this['agents'][_0x5be111[_0x1476('0x3b')]][_0x1476('0x2b')]=![];this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]]['status']=_0x5be111[_0x1476('0x10')]['toLowerCase']();this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]]['address']=_0x5be111[_0x1476('0x3d')];this['agents'][_0x5be111[_0x1476('0x3b')]][_0x1476('0x30')](_0x5be111);}}else if(this[_0x1476('0x9')][_0x5be111[_0x1476('0x3b')]]){this[_0x1476('0x9')][_0x5be111['peer']]['status']=_0x5be111[_0x1476('0x10')]['toLowerCase']();this['telephones'][_0x5be111['peer']][_0x1476('0x3d')]=_0x5be111[_0x1476('0x3d')];this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x31'),this[_0x1476('0x9')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x28')]),_0x1476('0x32'),this[_0x1476('0x9')][_0x5be111['peer']]);}else if(this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]]){this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x3e')]=_0x5be111['peerstatus'][_0x1476('0x2c')]();this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x3d')]=_0x5be111['address'];this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x28')]),'trunk:save',this[_0x1476('0x33')][_0x5be111['peer']]);}else{}}}catch(_0x2e724d){logger[_0x1476('0x1a')]('[syncPeerStatus][UserReport]',util[_0x1476('0x1b')](_0x2e724d,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x5f3d=['address','[syncPeerStatus][UserReport]','exports','bluebird','util','ioredis','../../../config/environment','../ami','defaults','localhost','socket.io-emitter','redis','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipPeerStatus','[loopSyncRealTimeShow]','prototype','loopSyncRealTimeShow','actionSipShowRegistry','actionDeviceStateList','isUndefined','emit','find','username','stateRegistry','merge','omit','event','actionid','trunk:%s','trunk:save','error','inspect','isNotNull','device','local','toLowerCase','inuse','state','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','startsWith','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','syncPeerStatus','peer','registered','status'];(function(_0x5e0e90,_0x1c8363){var _0x33cfe3=function(_0x44f842){while(--_0x44f842){_0x5e0e90['push'](_0x5e0e90['shift']());}};_0x33cfe3(++_0x1c8363);}(_0x5f3d,0x189));var _0xd5f3=function(_0x5b4c0a,_0x92d53b){_0x5b4c0a=_0x5b4c0a-0x0;var _0x5c9dda=_0x5f3d[_0x5b4c0a];return _0x5c9dda;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xd5f3('0x0'));var util=require(_0xd5f3('0x1'));var Redis=require(_0xd5f3('0x2'));var config=require(_0xd5f3('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xd5f3('0x4'));config['redis']=_[_0xd5f3('0x5')](config['redis'],{'host':_0xd5f3('0x6'),'port':0x18eb});var io=require(_0xd5f3('0x7'))(new Redis(config[_0xd5f3('0x8')]));function UserReport(_0x2319b8){this[_0xd5f3('0x9')]=_0x2319b8[_0xd5f3('0x9')];this[_0xd5f3('0xa')]=_0x2319b8[_0xd5f3('0xa')];this[_0xd5f3('0xb')]=_0x2319b8['telephones'];ami['on'](_0xd5f3('0xc'),this[_0xd5f3('0xd')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0xf'),this[_0xd5f3('0xd')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0x10'),this[_0xd5f3('0x11')][_0xd5f3('0xe')](this));ami['on'](_0xd5f3('0x12'),this['syncPeerStatus'][_0xd5f3('0xe')](this));this['loopSyncRealTimeShow']();return BPromise[_0xd5f3('0x13')]()[_0xd5f3('0x14')](ami['actionSipShowRegistry']())[_0xd5f3('0x14')](ami['actionDeviceStateList']())[_0xd5f3('0x14')](ami[_0xd5f3('0x15')]())['catch'](loggerCatch(_0xd5f3('0x16')));}function loggerCatch(_0x19dae7){return function(_0x2496ce){logger['error'](_0x19dae7,util['inspect'](_0x2496ce,{'showHidden':![],'depth':null}));};}UserReport[_0xd5f3('0x17')][_0xd5f3('0x18')]=function(){setInterval(function(){BPromise[_0xd5f3('0x13')]()['then'](ami[_0xd5f3('0x19')]())[_0xd5f3('0x14')](ami[_0xd5f3('0x1a')]())[_0xd5f3('0x14')](ami[_0xd5f3('0x15')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xd5f3('0x17')]['isNotNull']=function(_0x5395b8){return _0x5395b8!==null&&!_[_0xd5f3('0x1b')](_0x5395b8);};UserReport[_0xd5f3('0x17')][_0xd5f3('0x1c')]=function(_0x17bf22,_0x2d4eb2,_0x3b6a4d){io['to'](_0x17bf22)[_0xd5f3('0x1c')](_0x2d4eb2,_0x3b6a4d);};UserReport[_0xd5f3('0x17')]['syncRegistry']=function(_0xe9a054){try{if(this['isNotNull'](_0xe9a054)){var _0x4d796f=_[_0xd5f3('0x1d')](this['trunks'],{'registry':_0xe9a054[_0xd5f3('0x1e')]});if(_0x4d796f){_0xe9a054[_0xd5f3('0x1f')]=_0xe9a054['state'];_[_0xd5f3('0x20')](_0x4d796f,_[_0xd5f3('0x21')](_0xe9a054,[_0xd5f3('0x22'),_0xd5f3('0x23'),'username','state']));this[_0xd5f3('0x1c')](util['format'](_0xd5f3('0x24'),_0x4d796f['name']),_0xd5f3('0x25'),_0x4d796f);}}}catch(_0x23ee46){logger[_0xd5f3('0x26')]('[syncRegistry][UserReport]',util[_0xd5f3('0x27')](_0x23ee46,{'showHidden':![],'depth':null}));}};UserReport[_0xd5f3('0x17')]['syncDeviceState']=function(_0x29e0fc){try{if(this[_0xd5f3('0x28')](_0x29e0fc)){if(this['agents'][_0x29e0fc[_0xd5f3('0x29')]]){if(!this[_0xd5f3('0xa')][_0x29e0fc['device']][_0xd5f3('0x2a')]||_0x29e0fc['state'][_0xd5f3('0x2b')]()==_0xd5f3('0x2c')){this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2a')]=![];if(this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]]['state']!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this[_0xd5f3('0xa')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0xa')][_0x29e0fc['device']][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();this['agents'][_0x29e0fc['device']][_0xd5f3('0x31')](_0x29e0fc);}}else if(this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]]){if(this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this['telephones'][_0x29e0fc['device']][_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')]['toLowerCase']();this[_0xd5f3('0x1c')](util[_0xd5f3('0x30')](_0xd5f3('0x32'),this[_0xd5f3('0xb')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x33')]),'telephone:save',this[_0xd5f3('0xb')][_0x29e0fc['device']]);}else if(this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]){if(this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]()){this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]['stateTime']=_['toNumber'](moment()[_0xd5f3('0x30')]('x'));}this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]][_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();this[_0xd5f3('0x1c')](util[_0xd5f3('0x30')](_0xd5f3('0x24'),this[_0xd5f3('0x9')][_0x29e0fc['device']][_0xd5f3('0x33')]),_0xd5f3('0x25'),this[_0xd5f3('0x9')][_0x29e0fc[_0xd5f3('0x29')]]);}else if(_[_0xd5f3('0x34')](_0x29e0fc['device'],'Queue')){}else if(_[_0xd5f3('0x34')](_0x29e0fc[_0xd5f3('0x29')],'Local')){var _0x177ca3=_0x29e0fc[_0xd5f3('0x29')];var _0x536272=_0x177ca3[_0xd5f3('0x35')](_0x177ca3[_0xd5f3('0x36')]('/')+0x1,_0x177ca3[_0xd5f3('0x36')]('@'));var _0x3990d5=_[_0xd5f3('0x1d')](this[_0xd5f3('0xa')],function(_0x37bb53){return _0x37bb53[_0xd5f3('0x37')]==_0x536272||_0x37bb53[_0xd5f3('0x38')]==_0x536272||_0x37bb53['accountcode']==_0x536272;});if(_0x3990d5){if(_0x3990d5[_0xd5f3('0x2d')]!==_0x29e0fc[_0xd5f3('0x2d')]['toLowerCase']()){_0x3990d5[_0xd5f3('0x2e')]=_[_0xd5f3('0x2f')](moment()[_0xd5f3('0x30')]('x'));}_0x3990d5[_0xd5f3('0x2d')]=_0x29e0fc[_0xd5f3('0x2d')][_0xd5f3('0x2b')]();_0x3990d5[_0xd5f3('0x2a')]=!![];_0x3990d5[_0xd5f3('0x31')](_0x29e0fc);}}else{}}}catch(_0x561998){logger['error'](_0xd5f3('0x39'),util[_0xd5f3('0x27')](_0x561998,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xd5f3('0x3a')]=function(_0x2268ac){try{if(this['isNotNull'](_0x2268ac)&&this[_0xd5f3('0x28')](_0x2268ac[_0xd5f3('0x12')])){if(this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]]){if(!this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x2a')]||_0x2268ac[_0xd5f3('0x12')]['toLowerCase']()==_0xd5f3('0x3c')){this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x2a')]=![];this['agents'][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this[_0xd5f3('0xa')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x31')](_0x2268ac);}}else if(this['telephones'][_0x2268ac[_0xd5f3('0x3b')]]){this[_0xd5f3('0xb')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this['telephones'][_0x2268ac['peer']][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this['emit'](util[_0xd5f3('0x30')](_0xd5f3('0x32'),this[_0xd5f3('0xb')][_0x2268ac['peer']][_0xd5f3('0x33')]),'telephone:save',this[_0xd5f3('0xb')][_0x2268ac[_0xd5f3('0x3b')]]);}else if(this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]]){this[_0xd5f3('0x9')][_0x2268ac['peer']][_0xd5f3('0x3d')]=_0x2268ac[_0xd5f3('0x12')][_0xd5f3('0x2b')]();this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x3e')]=_0x2268ac[_0xd5f3('0x3e')];this['emit'](util['format']('trunk:%s',this['trunks'][_0x2268ac[_0xd5f3('0x3b')]][_0xd5f3('0x33')]),_0xd5f3('0x25'),this[_0xd5f3('0x9')][_0x2268ac[_0xd5f3('0x3b')]]);}else{}}}catch(_0x282a46){logger['error'](_0xd5f3('0x3f'),util[_0xd5f3('0x27')](_0x282a46,{'showHidden':![],'depth':null}));}};module[_0xd5f3('0x40')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 22e634f..91d3e03 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 _0x4c24=['destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','membername','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','error','inspect','rejected','custom:agentringnoanswer','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','complete','talktime','agent','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','custom:voiceAgentReport','transfereeuniqueid','origtransfereruniqueid','transfer','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','substring','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','../../../config/environment','../ami','redis','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid'];(function(_0x1d91ea,_0xfcb61a){var _0x5a8d06=function(_0x3e69df){while(--_0x3e69df){_0x1d91ea['push'](_0x1d91ea['shift']());}};_0x5a8d06(++_0xfcb61a);}(_0x4c24,0xc4));var _0x44c2=function(_0x5e61aa,_0x500cf0){_0x5e61aa=_0x5e61aa-0x0;var _0x41a3f2=_0x4c24[_0x5e61aa];return _0x41a3f2;};'use strict';var _=require(_0x44c2('0x0'));var moment=require(_0x44c2('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x44c2('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0x44c2('0x3'));config[_0x44c2('0x4')]=_['defaults'](config[_0x44c2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x44c2('0x5'))(new Redis(config[_0x44c2('0x4')]));function VoiceAgentReport(_0x3d8bac){this[_0x44c2('0x6')]={};this[_0x44c2('0x7')]=_0x3d8bac[_0x44c2('0x7')];this[_0x44c2('0x8')]=_0x3d8bac['agents'];this[_0x44c2('0x9')]={};ami['on'](_0x44c2('0xa'),this[_0x44c2('0xb')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0xd'),this[_0x44c2('0xe')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0xf'),this[_0x44c2('0x10')][_0x44c2('0xc')](this));ami['on']('queuecallerabandon',this[_0x44c2('0x11')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x12'),this[_0x44c2('0x13')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x14'),this[_0x44c2('0x15')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x16'),this[_0x44c2('0x17')][_0x44c2('0xc')](this));ami['on']('musiconholdstart',this[_0x44c2('0x18')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x19'),this[_0x44c2('0x1a')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x1b'),this[_0x44c2('0x1c')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x1d'),this[_0x44c2('0x1e')]['bind'](this));}VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x20')]=function(_0x5ada45,_0x4619e4,_0x472c90){io['to'](_0x5ada45)[_0x44c2('0x20')](_0x4619e4,_0x472c90);};VoiceAgentReport['prototype'][_0x44c2('0x21')]=function(_0x352896){return _0x352896!==null&&!_[_0x44c2('0x22')](_0x352896);};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentCalled']=function(_0x269a79){try{if(this[_0x44c2('0x21')](_0x269a79)){if(_[_0x44c2('0x22')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]])){this[_0x44c2('0x6')][_0x269a79['uniqueid']]={};}if(_[_0x44c2('0x22')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]])){this['channels'][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]]={'agentcalledAt':moment()[_0x44c2('0x25')](_0x44c2('0x26')),'lastevent':'called','variables':this[_0x44c2('0x9')][_0x269a79['uniqueid']],'type':this[_0x44c2('0x7')][_0x269a79[_0x44c2('0x27')]]?this['voiceQueues'][_0x269a79['queue']][_0x44c2('0x28')]||_0x44c2('0x29'):_0x44c2('0x29')};}_[_0x44c2('0x2a')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]],_[_0x44c2('0x2b')](_0x269a79,[_0x44c2('0x2c'),_0x44c2('0x2d')]));ami[_0x44c2('0x20')](_0x44c2('0x2e'),this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]]);this['emit'](util[_0x44c2('0x25')](_0x44c2('0x2f'),_0x269a79['membername']),'user:called',this[_0x44c2('0x6')][_0x269a79['uniqueid']][_0x269a79[_0x44c2('0x24')]]);}}catch(_0x2fe5a2){logger['error'](_0x44c2('0x30'),util['inspect'](_0x2fe5a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentConnect']=function(_0xda1113){try{if(this[_0x44c2('0x21')](_0xda1113)){if(this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]]){for(var _0x4489b6 in this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]]){if(this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x44c2('0x31')](_0x4489b6)){if(_0xda1113[_0x44c2('0x24')]===_0x4489b6){this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x32')]=moment()['format'](_0x44c2('0x26'));this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x33')]=_0x44c2('0x34');this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x35')]=_0xda1113[_0x44c2('0x35')];this[_0x44c2('0x6')][_0xda1113['uniqueid']][_0x4489b6][_0x44c2('0x36')]=_0xda1113[_0x44c2('0x36')];this['channels'][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x37')]=_0xda1113[_0x44c2('0x37')];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x38')]=_0xda1113[_0x44c2('0x38')];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x39')]=_0xda1113['destchannelstatedesc'];_['merge'](this[_0x44c2('0x8')][_0xda1113[_0x44c2('0x3a')]],_['pick'](_0xda1113,[_0x44c2('0x27'),'destconnectedlinenum']));this[_0x44c2('0x20')](util[_0x44c2('0x25')](_0x44c2('0x2f'),_0xda1113[_0x44c2('0x3b')]),_0x44c2('0x3c'),this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0xda1113['destuniqueid']]);ami[_0x44c2('0x20')](_0x44c2('0x3d'),this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]);}else if(!this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]['agentringnoanswer']&&!this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0xf')]=!![];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x3e')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x3f')]=_0x44c2('0x40');this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x33')]=_0x44c2('0x40');this[_0x44c2('0x6')][_0xda1113['uniqueid']][_0x4489b6]['answeredelsewheredestinationuniqueid']=_0xda1113[_0x44c2('0x24')];this['channels'][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x41')]=_0xda1113['membername'];ami[_0x44c2('0x20')]('custom:agentansweredelsewhere',this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]);}}}}}}catch(_0x4fa415){logger[_0x44c2('0x42')]('[syncAgentConnect][VoiceAgentReport]',util[_0x44c2('0x43')](_0x4fa415,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentRingNoAnswer']=function(_0x2f82c5){try{if(this[_0x44c2('0x21')](_0x2f82c5)){if(this[_0x44c2('0x6')][_0x2f82c5['uniqueid']]&&this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5['destuniqueid']]){this[_0x44c2('0x6')][_0x2f82c5['uniqueid']][_0x2f82c5['destuniqueid']][_0x44c2('0xf')]=!![];this['channels'][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5['destuniqueid']][_0x44c2('0x3e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5[_0x44c2('0x24')]]['reason']=_0x44c2('0x44');this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5[_0x44c2('0x24')]]['lastevent']='rejected';ami['emit'](_0x44c2('0x45'),this['channels'][_0x2f82c5['uniqueid']][_0x2f82c5[_0x44c2('0x24')]]);}}}catch(_0x3d11f3){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x44c2('0x43')](_0x3d11f3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x11')]=function(_0x395273){try{if(this['isNotNull'](_0x395273)){if(this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]]){for(var _0x3818d6 in this['channels'][_0x395273[_0x44c2('0x23')]]){if(this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x44c2('0x31')](_0x3818d6)&&!this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6]['agentringnoanswer']&&!this[_0x44c2('0x6')][_0x395273['uniqueid']][_0x3818d6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0xf')]=!![];this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0x3e')]=moment()['format'](_0x44c2('0x26'));this['channels'][_0x395273['uniqueid']][_0x3818d6][_0x44c2('0x3f')]=_0x44c2('0x46');this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0x33')]=_0x44c2('0x46');ami['emit'](_0x44c2('0x47'),this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6]);}}}}}catch(_0x53205c){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x53205c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentComplete']=function(_0x2389c4){try{if(this[_0x44c2('0x21')](_0x2389c4)){if(this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]]){for(var _0x945ed6 in this[_0x44c2('0x6')][_0x2389c4['uniqueid']]){if(this[_0x44c2('0x6')][_0x2389c4['uniqueid']][_0x44c2('0x31')](_0x945ed6)){if(this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x32')]&&!this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]['agentcomplete']=!![];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]['lastevent']=_0x44c2('0x49');this[_0x44c2('0x6')][_0x2389c4['uniqueid']][_0x945ed6]['talktime']=_0x2389c4[_0x44c2('0x4a')];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x3f')]=_0x2389c4[_0x44c2('0x3f')]=='transfer'?_0x44c2('0x4b'):_0x2389c4['reason'];if(this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]]&&this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]][_0x44c2('0x4c')]){this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x4d')]=!![];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x4e')]=this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]][_0x44c2('0x4f')];}this[_0x44c2('0x8')][_0x2389c4[_0x44c2('0x3a')]]=_['omit'](this[_0x44c2('0x8')][_0x2389c4[_0x44c2('0x3a')]],[_0x44c2('0x27'),'destconnectedlinenum']);this[_0x44c2('0x20')](util['format']('user:%s',_0x2389c4['membername']),_0x44c2('0x50'),this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]);ami[_0x44c2('0x20')](_0x44c2('0x51'),this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]);}}}}}}catch(_0x2eca1c){logger[_0x44c2('0x42')]('[syncAgentComplete][VoiceAgentReport]',util[_0x44c2('0x43')](_0x2eca1c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x44c2('0x15')]=function(_0x3bc5f9){try{if(this[_0x44c2('0x21')](_0x3bc5f9)){this['addVariable'](_0x3bc5f9[_0x44c2('0x23')],_[_0x44c2('0x52')](_0x3bc5f9[_0x44c2('0x53')])[0x0],_0x3bc5f9[_0x44c2('0x54')]);if(this['channels'][_0x3bc5f9[_0x44c2('0x23')]]){for(var _0x545075 in this[_0x44c2('0x6')][_0x3bc5f9['uniqueid']]){if(this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x44c2('0x31')](_0x545075)){if(_['isUndefined'](this[_0x44c2('0x6')][_0x3bc5f9['uniqueid']][_0x545075]['variables'])){this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x545075][_0x44c2('0x9')]={};}this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x545075]['variables']=this[_0x44c2('0x9')][_0x3bc5f9['uniqueid']];}}}}}catch(_0xe0ab91){logger[_0x44c2('0x42')]('[syncVarSet][VoiceAgentReport]',util[_0x44c2('0x43')](_0xe0ab91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x211ca1,_0x401327,_0x5b8671){var _0x1fe0c3=[_0x44c2('0x55'),_0x44c2('0x56'),_0x44c2('0x57'),_0x44c2('0x58'),_0x44c2('0x59'),_0x44c2('0x5a'),'rtpaudioqosrtt',_0x44c2('0x5b'),_0x44c2('0x5c'),_0x44c2('0x5d'),'bridgepeer',_0x44c2('0x5e'),'membercalls',_0x44c2('0x5f'),_0x44c2('0x60'),_0x44c2('0x61'),_0x44c2('0x3b'),_0x44c2('0x62'),'memberrealtime'];if(!_['isNil'](_0x401327)&&!_[_0x44c2('0x63')](_0x1fe0c3,_0x401327)){if(_[_0x44c2('0x22')](this[_0x44c2('0x9')][_0x211ca1])){this[_0x44c2('0x9')][_0x211ca1]={};}this['variables'][_0x211ca1][_0x401327]=_0x5b8671;}};VoiceAgentReport['prototype'][_0x44c2('0x17')]=function(_0x5e1167){try{if(this['isNotNull'](_0x5e1167)){if(this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]]){for(var _0x32434e in this['channels'][_0x5e1167[_0x44c2('0x23')]]){if(this['channels'][_0x5e1167['uniqueid']]['hasOwnProperty'](_0x32434e)){if(this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x3f')]=='transfer'&&this['channels'][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));}}}ami[_0x44c2('0x20')](_0x44c2('0x64'),_['values'](this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]]));delete this[_0x44c2('0x6')][_0x5e1167['uniqueid']];}if(this['variables'][_0x5e1167[_0x44c2('0x23')]]){delete this['variables'][_0x5e1167[_0x44c2('0x23')]];}}}catch(_0x17751b){logger['error']('[syncHangup][VoiceAgentReport]',util[_0x44c2('0x43')](_0x17751b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x1c')]=function(_0x4feea3){try{if(this[_0x44c2('0x21')](_0x4feea3)){if(this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]]){for(var _0x15352e in this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]]){if(this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x44c2('0x31')](_0x15352e)){if(_0x4feea3[_0x44c2('0x66')]===_0x15352e){var _0xa06282=moment();this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x12')]=!![];this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x15352e][_0x44c2('0x3f')]=_0x44c2('0x67');this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x33')]=_0x44c2('0x49');this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x4a')]=_0xa06282[_0x44c2('0x68')](this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x15352e][_0x44c2('0x32')],_0x44c2('0x69'));}}}}if(this['channels'][_0x4feea3[_0x44c2('0x6a')]]){var _0x1e8f76=this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x6a')]];this['channels'][_0x4feea3[_0x44c2('0x6a')]]=this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']];this['channels'][_0x4feea3['transfereeuniqueid']]=_0x1e8f76;}}}catch(_0x16257c){logger['error'](_0x44c2('0x6b'),util[_0x44c2('0x43')](_0x16257c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncBlindTransfer']=function(_0x125891){try{if(this[_0x44c2('0x21')](_0x125891)){if(this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]){for(var _0x597d76 in this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]){if(this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]['hasOwnProperty'](_0x597d76)){if(_0x125891[_0x44c2('0x6c')]===_0x597d76){var _0x50ee89=moment();this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x12')]=!![];this['channels'][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x48')]=_0x50ee89;this['channels'][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x3f')]=_0x44c2('0x67');this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x33')]=_0x44c2('0x49');this[_0x44c2('0x6')][_0x125891['transfereeuniqueid']][_0x597d76][_0x44c2('0x4a')]=_0x50ee89[_0x44c2('0x68')](this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x32')],_0x44c2('0x69'));}}}}}}catch(_0x200098){logger[_0x44c2('0x42')](_0x44c2('0x6d'),util[_0x44c2('0x43')](_0x200098,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x18')]=function(_0x1ca898){var _0x1359b9='';try{if(this[_0x44c2('0x21')](_0x1ca898)){if(_0x1ca898['channel']){_0x1359b9=_0x1ca898['channel'][_0x44c2('0x6e')](0x0,_0x1ca898[_0x44c2('0x6f')][_0x44c2('0x70')]('-'));if(this[_0x44c2('0x8')][_0x1359b9]){this[_0x44c2('0x8')][_0x1359b9][_0x44c2('0x71')]=!![];}}}}catch(_0xe122a8){logger[_0x44c2('0x42')](_0x44c2('0x72'),util[_0x44c2('0x43')](_0xe122a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x23697b){var _0x4b6ca2='';try{if(this[_0x44c2('0x21')](_0x23697b)){if(_0x23697b[_0x44c2('0x6f')]){_0x4b6ca2=_0x23697b[_0x44c2('0x6f')][_0x44c2('0x6e')](0x0,_0x23697b[_0x44c2('0x6f')][_0x44c2('0x70')]('-'));if(this[_0x44c2('0x8')][_0x4b6ca2]){this[_0x44c2('0x8')][_0x4b6ca2][_0x44c2('0x71')]=![];}}}}catch(_0x5623e1){logger['error'](_0x44c2('0x73'),util['inspect'](_0x5623e1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x2798=['bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','transfereruniqueid','complete','seconds','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','isNotNull','isUndefined','destuniqueid','uniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','emit','custom:agentcalled','format','user:%s','membername','user:called','error','inspect','syncAgentConnect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','rejected','custom:agentringnoanswer','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x2798,0x112));var _0x8279=function(_0x28a6f6,_0x42bfa9){_0x28a6f6=_0x28a6f6-0x0;var _0x1f66e6=_0x2798[_0x28a6f6];return _0x1f66e6;};'use strict';var _=require('lodash');var moment=require(_0x8279('0x0'));var util=require(_0x8279('0x1'));var Redis=require(_0x8279('0x2'));var config=require(_0x8279('0x3'));var logger=require(_0x8279('0x4'))(_0x8279('0x5'));var ami=require(_0x8279('0x6'));config[_0x8279('0x7')]=_[_0x8279('0x8')](config[_0x8279('0x7')],{'host':_0x8279('0x9'),'port':0x18eb});var io=require(_0x8279('0xa'))(new Redis(config[_0x8279('0x7')]));function VoiceAgentReport(_0x559984){this[_0x8279('0xb')]={};this[_0x8279('0xc')]=_0x559984[_0x8279('0xc')];this[_0x8279('0xd')]=_0x559984['agents'];this[_0x8279('0xe')]={};ami['on'](_0x8279('0xf'),this[_0x8279('0x10')][_0x8279('0x11')](this));ami['on'](_0x8279('0x12'),this['syncAgentConnect'][_0x8279('0x11')](this));ami['on'](_0x8279('0x13'),this[_0x8279('0x14')][_0x8279('0x11')](this));ami['on'](_0x8279('0x15'),this[_0x8279('0x16')][_0x8279('0x11')](this));ami['on'](_0x8279('0x17'),this[_0x8279('0x18')][_0x8279('0x11')](this));ami['on'](_0x8279('0x19'),this[_0x8279('0x1a')][_0x8279('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x8279('0x11')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x8279('0x11')](this));ami['on'](_0x8279('0x1b'),this[_0x8279('0x1c')]['bind'](this));ami['on'](_0x8279('0x1d'),this[_0x8279('0x1e')][_0x8279('0x11')](this));ami['on'](_0x8279('0x1f'),this[_0x8279('0x20')][_0x8279('0x11')](this));}VoiceAgentReport[_0x8279('0x21')]['emit']=function(_0x116794,_0x5601b1,_0x3ea64a){io['to'](_0x116794)['emit'](_0x5601b1,_0x3ea64a);};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x22')]=function(_0x5d45eb){return _0x5d45eb!==null&&!_[_0x8279('0x23')](_0x5d45eb);};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x10')]=function(_0x4014ac){try{if(this[_0x8279('0x22')](_0x4014ac)){if(_['isUndefined'](this['channels'][_0x4014ac['uniqueid']])){this[_0x8279('0xb')][_0x4014ac['uniqueid']]={};}if(_[_0x8279('0x23')](this[_0x8279('0xb')][_0x4014ac['uniqueid']][_0x4014ac[_0x8279('0x24')]])){this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac[_0x8279('0x24')]]={'agentcalledAt':moment()['format'](_0x8279('0x26')),'lastevent':_0x8279('0x27'),'variables':this[_0x8279('0xe')][_0x4014ac['uniqueid']],'type':this[_0x8279('0xc')][_0x4014ac[_0x8279('0x28')]]?this['voiceQueues'][_0x4014ac[_0x8279('0x28')]][_0x8279('0x29')]||_0x8279('0x2a'):'inbound'};}_[_0x8279('0x2b')](this['channels'][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']],_[_0x8279('0x2c')](_0x4014ac,[_0x8279('0x2d'),'privilege']));ami[_0x8279('0x2e')](_0x8279('0x2f'),this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']]);this[_0x8279('0x2e')](util[_0x8279('0x30')](_0x8279('0x31'),_0x4014ac[_0x8279('0x32')]),_0x8279('0x33'),this[_0x8279('0xb')][_0x4014ac[_0x8279('0x25')]][_0x4014ac['destuniqueid']]);}}catch(_0xa41d2e){logger[_0x8279('0x34')]('[syncAgentCalled][VoiceAgentReport]',util[_0x8279('0x35')](_0xa41d2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x36')]=function(_0x56d1d9){try{if(this[_0x8279('0x22')](_0x56d1d9)){if(this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]]){for(var _0x3b8982 in this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x8279('0x37')](_0x3b8982)){if(_0x56d1d9[_0x8279('0x24')]===_0x3b8982){this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x38')]=moment()[_0x8279('0x30')](_0x8279('0x26'));this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x39')]=_0x8279('0x3a');this['channels'][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x3b')]=_0x56d1d9[_0x8279('0x3b')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['connectedlinenum']=_0x56d1d9[_0x8279('0x3c')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x3d')]=_0x56d1d9['connectedlinename'];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x3e')]=_0x56d1d9[_0x8279('0x3e')];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['destchannelstatedesc']=_0x56d1d9[_0x8279('0x3f')];_[_0x8279('0x2b')](this[_0x8279('0xd')][_0x56d1d9[_0x8279('0x40')]],_[_0x8279('0x41')](_0x56d1d9,['queue',_0x8279('0x42')]));this[_0x8279('0x2e')](util[_0x8279('0x30')](_0x8279('0x31'),_0x56d1d9[_0x8279('0x32')]),'user:agentconnect',this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x56d1d9[_0x8279('0x24')]]);ami['emit']('custom:agentconnect',this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982]);}else if(!this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x13')]&&!this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x17')]){this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['agentringnoanswer']=!![];this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x43')]=moment()[_0x8279('0x30')](_0x8279('0x26'));this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982][_0x8279('0x44')]=_0x8279('0x45');this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['lastevent']=_0x8279('0x45');this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]['answeredelsewheredestinationuniqueid']=_0x56d1d9['destuniqueid'];this[_0x8279('0xb')][_0x56d1d9['uniqueid']][_0x3b8982][_0x8279('0x46')]=_0x56d1d9[_0x8279('0x32')];ami[_0x8279('0x2e')](_0x8279('0x47'),this[_0x8279('0xb')][_0x56d1d9[_0x8279('0x25')]][_0x3b8982]);}}}}}}catch(_0x525bbd){logger[_0x8279('0x34')]('[syncAgentConnect][VoiceAgentReport]',util[_0x8279('0x35')](_0x525bbd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x14')]=function(_0xeb0844){try{if(this[_0x8279('0x22')](_0xeb0844)){if(this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]]&&this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]){this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]][_0x8279('0x13')]=!![];this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]['agentringnoanswerAt']=moment()['format'](_0x8279('0x26'));this[_0x8279('0xb')][_0xeb0844['uniqueid']][_0xeb0844[_0x8279('0x24')]][_0x8279('0x44')]=_0x8279('0x48');this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]][_0x8279('0x39')]='rejected';ami[_0x8279('0x2e')](_0x8279('0x49'),this[_0x8279('0xb')][_0xeb0844[_0x8279('0x25')]][_0xeb0844[_0x8279('0x24')]]);}}}catch(_0x2d3f35){logger[_0x8279('0x34')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util['inspect'](_0x2d3f35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x16')]=function(_0x3dba61){try{if(this[_0x8279('0x22')](_0x3dba61)){if(this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]){for(var _0x5f1753 in this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]]['hasOwnProperty'](_0x5f1753)&&!this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753][_0x8279('0x13')]&&!this[_0x8279('0xb')][_0x3dba61['uniqueid']][_0x5f1753][_0x8279('0x17')]){this['channels'][_0x3dba61[_0x8279('0x25')]][_0x5f1753]['agentringnoanswer']=!![];this['channels'][_0x3dba61[_0x8279('0x25')]][_0x5f1753]['agentringnoanswerAt']=moment()[_0x8279('0x30')](_0x8279('0x26'));this['channels'][_0x3dba61['uniqueid']][_0x5f1753]['reason']='abandoned';this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753][_0x8279('0x39')]=_0x8279('0x4a');ami['emit']('custom:agentqueuecallerabandon',this[_0x8279('0xb')][_0x3dba61[_0x8279('0x25')]][_0x5f1753]);}}}}}catch(_0x5e9ce5){logger[_0x8279('0x34')](_0x8279('0x4b'),util[_0x8279('0x35')](_0x5e9ce5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')]['syncAgentComplete']=function(_0x552ffa){try{if(this[_0x8279('0x22')](_0x552ffa)){if(this['channels'][_0x552ffa[_0x8279('0x25')]]){for(var _0xd09bef in this[_0x8279('0xb')][_0x552ffa['uniqueid']]){if(this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0x8279('0x37')](_0xd09bef)){if(this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x38')]&&!this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x17')]){this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef]['agentcomplete']=!![];this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x4c')]=moment()['format'](_0x8279('0x26'));this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x39')]='complete';this['channels'][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x4d')]=_0x552ffa[_0x8279('0x4d')];this['channels'][_0x552ffa['uniqueid']][_0xd09bef]['reason']=_0x552ffa[_0x8279('0x44')]==_0x8279('0x4e')?'agent':_0x552ffa[_0x8279('0x44')];if(this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]]&&this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]][_0x8279('0x4f')]){this['channels'][_0x552ffa['uniqueid']][_0xd09bef][_0x8279('0x50')]=!![];this[_0x8279('0xb')][_0x552ffa[_0x8279('0x25')]][_0xd09bef][_0x8279('0x51')]=this[_0x8279('0xc')][_0x552ffa[_0x8279('0x28')]][_0x8279('0x52')];}this[_0x8279('0xd')][_0x552ffa[_0x8279('0x40')]]=_[_0x8279('0x2c')](this[_0x8279('0xd')][_0x552ffa[_0x8279('0x40')]],[_0x8279('0x28'),_0x8279('0x42')]);this['emit'](util[_0x8279('0x30')](_0x8279('0x31'),_0x552ffa[_0x8279('0x32')]),_0x8279('0x53'),this['channels'][_0x552ffa[_0x8279('0x25')]][_0xd09bef]);ami[_0x8279('0x2e')](_0x8279('0x54'),this[_0x8279('0xb')][_0x552ffa['uniqueid']][_0xd09bef]);}}}}}}catch(_0x55e241){logger[_0x8279('0x34')](_0x8279('0x55'),util[_0x8279('0x35')](_0x55e241,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x1a')]=function(_0x1ca8b6){try{if(this[_0x8279('0x22')](_0x1ca8b6)){this[_0x8279('0x56')](_0x1ca8b6[_0x8279('0x25')],_[_0x8279('0x57')](_0x1ca8b6[_0x8279('0x58')])[0x0],_0x1ca8b6[_0x8279('0x59')]);if(this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]]){for(var _0x3175c3 in this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x8279('0x37')](_0x3175c3)){if(_['isUndefined'](this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x3175c3][_0x8279('0xe')])){this[_0x8279('0xb')][_0x1ca8b6['uniqueid']][_0x3175c3][_0x8279('0xe')]={};}this[_0x8279('0xb')][_0x1ca8b6[_0x8279('0x25')]][_0x3175c3]['variables']=this[_0x8279('0xe')][_0x1ca8b6[_0x8279('0x25')]];}}}}}catch(_0x19077b){logger[_0x8279('0x34')](_0x8279('0x5a'),util['inspect'](_0x19077b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x56')]=function(_0x25fa01,_0x7084d,_0x54ffb4){var _0x1fa509=['rtpaudioqos',_0x8279('0x5b'),_0x8279('0x5c'),_0x8279('0x5d'),'rtpaudioqosloss',_0x8279('0x5e'),_0x8279('0x5f'),_0x8279('0x60'),'sipcallid',_0x8279('0x61'),_0x8279('0x62'),_0x8279('0x63'),'membercalls','memberdynamic',_0x8279('0x64'),_0x8279('0x65'),'membername',_0x8279('0x66'),_0x8279('0x67')];if(!_[_0x8279('0x68')](_0x7084d)&&!_[_0x8279('0x69')](_0x1fa509,_0x7084d)){if(_[_0x8279('0x23')](this[_0x8279('0xe')][_0x25fa01])){this[_0x8279('0xe')][_0x25fa01]={};}this['variables'][_0x25fa01][_0x7084d]=_0x54ffb4;}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x6a')]=function(_0x59833a){try{if(this[_0x8279('0x22')](_0x59833a)){if(this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]){for(var _0x5556fe in this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]){if(this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]]['hasOwnProperty'](_0x5556fe)){if(this['channels'][_0x59833a['uniqueid']][_0x5556fe][_0x8279('0x44')]==_0x8279('0x4e')&&this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]][_0x5556fe]['agentcomplete']){this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]][_0x5556fe][_0x8279('0x4c')]=moment()[_0x8279('0x30')](_0x8279('0x26'));}}}ami[_0x8279('0x2e')](_0x8279('0x6b'),_[_0x8279('0x6c')](this['channels'][_0x59833a[_0x8279('0x25')]]));delete this[_0x8279('0xb')][_0x59833a[_0x8279('0x25')]];}if(this[_0x8279('0xe')][_0x59833a['uniqueid']]){delete this['variables'][_0x59833a[_0x8279('0x25')]];}}}catch(_0x49e302){logger[_0x8279('0x34')](_0x8279('0x6d'),util['inspect'](_0x49e302,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')][_0x8279('0x1e')]=function(_0x156614){try{if(this[_0x8279('0x22')](_0x156614)){if(this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]]){for(var _0x8a67ca in this['channels'][_0x156614['transfereeuniqueid']]){if(this['channels'][_0x156614['transfereeuniqueid']][_0x8279('0x37')](_0x8a67ca)){if(_0x156614[_0x8279('0x6f')]===_0x8a67ca){var _0x22ec81=moment();this['channels'][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x17')]=!![];this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x4c')]=moment()[_0x8279('0x30')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x44')]='transfer';this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca][_0x8279('0x39')]='complete';this[_0x8279('0xb')][_0x156614[_0x8279('0x6e')]][_0x8a67ca]['talktime']=_0x22ec81[_0x8279('0x70')](this['channels'][_0x156614['transfereeuniqueid']][_0x8a67ca][_0x8279('0x38')],'seconds');}}}}if(this[_0x8279('0xb')][_0x156614[_0x8279('0x71')]]){var _0x30ee66=this[_0x8279('0xb')][_0x156614['secondtransfereruniqueid']];this[_0x8279('0xb')][_0x156614['secondtransfereruniqueid']]=this['channels'][_0x156614[_0x8279('0x6e')]];this['channels'][_0x156614[_0x8279('0x6e')]]=_0x30ee66;}}}catch(_0x57b862){logger[_0x8279('0x34')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0x8279('0x35')](_0x57b862,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8279('0x21')]['syncBlindTransfer']=function(_0x1e41f3){try{if(this['isNotNull'](_0x1e41f3)){if(this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']]){for(var _0x1d8d98 in this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']]){if(this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x8279('0x37')](_0x1d8d98)){if(_0x1e41f3[_0x8279('0x72')]===_0x1d8d98){var _0x10213c=moment();this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x17')]=!![];this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']][_0x1d8d98][_0x8279('0x4c')]=_0x10213c;this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x44')]=_0x8279('0x4e');this[_0x8279('0xb')][_0x1e41f3['transfereeuniqueid']][_0x1d8d98][_0x8279('0x39')]=_0x8279('0x73');this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98]['talktime']=_0x10213c[_0x8279('0x70')](this[_0x8279('0xb')][_0x1e41f3[_0x8279('0x6e')]][_0x1d8d98][_0x8279('0x38')],_0x8279('0x74'));}}}}}}catch(_0x44df04){logger[_0x8279('0x34')](_0x8279('0x75'),util[_0x8279('0x35')](_0x44df04,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x76')]=function(_0x23c46c){var _0x78a9a8='';try{if(this[_0x8279('0x22')](_0x23c46c)){if(_0x23c46c[_0x8279('0x77')]){_0x78a9a8=_0x23c46c[_0x8279('0x77')][_0x8279('0x78')](0x0,_0x23c46c['channel']['lastIndexOf']('-'));if(this[_0x8279('0xd')][_0x78a9a8]){this['agents'][_0x78a9a8][_0x8279('0x79')]=!![];}}}}catch(_0x36f5da){logger[_0x8279('0x34')](_0x8279('0x7a'),util['inspect'](_0x36f5da,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8279('0x1c')]=function(_0x39564f){var _0x386e41='';try{if(this[_0x8279('0x22')](_0x39564f)){if(_0x39564f[_0x8279('0x77')]){_0x386e41=_0x39564f[_0x8279('0x77')][_0x8279('0x78')](0x0,_0x39564f[_0x8279('0x77')]['lastIndexOf']('-'));if(this[_0x8279('0xd')][_0x386e41]){this[_0x8279('0xd')][_0x386e41][_0x8279('0x79')]=![];}}}}catch(_0x45f42c){logger[_0x8279('0x34')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x8279('0x35')](_0x45f42c,{'showHidden':![],'depth':null}));}};module[_0x8279('0x7b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index a96c3c6..1652b21 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 _0xe829=['transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','mohstarttime','syncMusicOnHoldStop','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','ioredis','../../../config/environment','ami','../ami','../model/channel','not_inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','keys','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','merge','context','from-sip','split','destconnectedlinenum','user:%s','name','user:agentconnect','exten','[syncNewChannel][VoiceCallReport]','application','applicationdata','toLowerCase','duration','seconds','includes','lastapplication','lastdata','startsWith','match','error','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','disposition','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','inspect','omit','user:agentcomplete','accountcode','custom:voiceCallReport','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid'];(function(_0x80ab9e,_0x32c636){var _0x7605e6=function(_0x207f0d){while(--_0x207f0d){_0x80ab9e['push'](_0x80ab9e['shift']());}};_0x7605e6(++_0x32c636);}(_0xe829,0x139));var _0x9e82=function(_0x4651ae,_0x3d2bc0){_0x4651ae=_0x4651ae-0x0;var _0x29a97c=_0xe829[_0x4651ae];return _0x29a97c;};'use strict';var BPromise=require(_0x9e82('0x0'));var _=require(_0x9e82('0x1'));var moment=require('moment');var util=require(_0x9e82('0x2'));var path=require('path');var Redis=require(_0x9e82('0x3'));var config=require(_0x9e82('0x4'));var logger=require('../../../config/logger')(_0x9e82('0x5'));var ami=require(_0x9e82('0x6'));var Channel=require(_0x9e82('0x7'));var statusDesc=['unknown',_0x9e82('0x8'),'inuse',_0x9e82('0x9'),_0x9e82('0xa'),_0x9e82('0xb'),_0x9e82('0xc'),'ringinuse',_0x9e82('0xd')];var applications=[_0x9e82('0xe'),_0x9e82('0xf'),_0x9e82('0x10'),'dial',_0x9e82('0x11'),_0x9e82('0x12')];var dispositions=[_0x9e82('0x13'),_0x9e82('0x14'),_0x9e82('0x14'),_0x9e82('0x13'),'NO\x20ANSWER',_0x9e82('0x13'),_0x9e82('0x15'),_0x9e82('0x16'),'FAILED',_0x9e82('0x14'),_0x9e82('0x14')];var actions={};config[_0x9e82('0x17')]=_[_0x9e82('0x18')](config[_0x9e82('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e82('0x17')]));function VoiceCallReport(_0x3320dd){this[_0x9e82('0x19')]=_0x3320dd['channels'];this[_0x9e82('0x1a')]=_0x3320dd['agents'];ami['on'](_0x9e82('0x1b'),this[_0x9e82('0x1c')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x1e'),this['syncNewExten'][_0x9e82('0x1d')](this));ami['on']('newchannel',this[_0x9e82('0x1f')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x20'),this[_0x9e82('0x21')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x22'),this[_0x9e82('0x23')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x24'),this[_0x9e82('0x25')][_0x9e82('0x1d')](this));ami['on']('newcallerid',this[_0x9e82('0x26')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x27'),this[_0x9e82('0x28')]['bind'](this));ami['on'](_0x9e82('0x29'),this[_0x9e82('0x2a')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x2b'),this[_0x9e82('0x2c')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x2d'),this['syncMusicOnHoldStop'][_0x9e82('0x1d')](this));return BPromise[_0x9e82('0x2e')]()[_0x9e82('0x2f')](ami[_0x9e82('0x30')]())[_0x9e82('0x31')](function(_0x2deb86){console[_0x9e82('0x32')](_0x2deb86);});}VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x34')]=function(_0x22b937){return _0x22b937!==null&&!_[_0x9e82('0x35')](_0x22b937);};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x36')]=function(_0x3fa282,_0x7bc1e1,_0x155fb2){io['to'](_0x3fa282)['emit'](_0x7bc1e1,_0x155fb2);};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x26')]=function(_0x243438){try{if(this[_0x9e82('0x34')](_0x243438)){if(_0x243438[_0x9e82('0x37')]===_0x243438[_0x9e82('0x38')]){if(!_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x243438[_0x9e82('0x37')]])){_['merge'](this[_0x9e82('0x19')][_0x243438['uniqueid']],_[_0x9e82('0x39')](_0x243438,_[_0x9e82('0x3a')](this[_0x9e82('0x19')][_0x243438[_0x9e82('0x37')]])));}}}}catch(_0x5ad3c5){logger['error'](_0x9e82('0x3b'),util['inspect'](_0x5ad3c5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x1f')]=function(_0x1726f3){try{if(this[_0x9e82('0x34')](_0x1726f3)){if(_0x1726f3[_0x9e82('0x37')]===_0x1726f3[_0x9e82('0x38')]&&_0x1726f3[_0x9e82('0x3c')]!=_0x9e82('0x3d')){if(_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x1726f3['uniqueid']])){this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]]=new Channel();this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]][_0x9e82('0x3e')]=moment()[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]]['disposition']=dispositions[_[_0x9e82('0x41')](_0x1726f3[_0x9e82('0x42')])];_[_0x9e82('0x43')](this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]],_['pick'](_0x1726f3,_[_0x9e82('0x3a')](this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]])));if(_0x1726f3[_0x9e82('0x44')]===_0x9e82('0x45')){if(this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x47')]=_0x1726f3['exten'];this['emit'](util['format'](_0x9e82('0x48'),this[_0x9e82('0x1a')][_0x1726f3['channel'][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x49')]),_0x9e82('0x4a'),{'destaccountcode':this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1726f3[_0x9e82('0x4b')]});}}}}}}catch(_0xbfcdc5){logger['error'](_0x9e82('0x4c'),util['inspect'](_0xbfcdc5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e82('0x1c')]=function(_0x3780b8){try{if(this[_0x9e82('0x34')](_0x3780b8)){if(_0x3780b8[_0x9e82('0x37')]===_0x3780b8[_0x9e82('0x38')]&&_0x3780b8[_0x9e82('0x4b')]!='h'&&_0x3780b8[_0x9e82('0x3c')]!=_0x9e82('0x3d')){_0x3780b8[_0x9e82('0x4d')]=_0x3780b8['application']['toLowerCase']();_0x3780b8[_0x9e82('0x4e')]=(_0x3780b8['appdata']||_0x3780b8[_0x9e82('0x4e')])[_0x9e82('0x4f')]();if(_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]])){this['channels'][_0x3780b8[_0x9e82('0x37')]]=new Channel();this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0x3e')]=_0x3780b8[_0x9e82('0x50')]?moment()['subtract'](moment[_0x9e82('0x50')](_0x3780b8['duration'])['seconds'](),_0x9e82('0x51'))['format'](_0x9e82('0x40')):moment()[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]]['disposition']=_0x9e82('0x13');}_[_0x9e82('0x43')](this['channels'][_0x3780b8[_0x9e82('0x37')]],_['pick'](_0x3780b8,_['keys'](this['channels'][_0x3780b8['uniqueid']])));if(_[_0x9e82('0x52')](applications,_0x3780b8['application'])){this['channels'][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0x53')]=_0x3780b8[_0x9e82('0x4d')];this[_0x9e82('0x19')][_0x3780b8['uniqueid']][_0x9e82('0x54')]=_0x3780b8[_0x9e82('0x4e')];if(_0x3780b8[_0x9e82('0x4d')]===_0x9e82('0xe')&&_[_0x9e82('0x55')](_0x3780b8[_0x9e82('0x4e')],'cdr(')){var _0x5668d7=_0x3780b8[_0x9e82('0x4e')][_0x9e82('0x46')]('=');var _0x59143b=_0x5668d7[0x0][_0x9e82('0x56')](/cdr\((.*)\)/);if(_0x59143b){this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x59143b[0x1]]=_0x5668d7[0x1];}}else if(_0x3780b8[_0x9e82('0x4d')]===_0x9e82('0xf')){this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x3780b8[_0x9e82('0x4e')][_0x9e82('0x46')](',')[0x0];}}}}}catch(_0xeaa8cb){logger[_0x9e82('0x57')](_0x9e82('0x58'),util['inspect'](_0xeaa8cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x21')]=function(_0x11f716){try{if(this[_0x9e82('0x34')](_0x11f716)){if(_0x11f716[_0x9e82('0x37')]!==_0x11f716[_0x9e82('0x38')]){if(this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]){if(_0x11f716[_0x9e82('0x42')]==='6'){if(!this['channels'][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x59')]){var _0x429e2a=moment();this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x59')]=!![];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5a')]=_0x429e2a[_0x9e82('0x3f')](_0x9e82('0x40'));if(this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]['starttime']){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5b')]=_0x429e2a[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x3e')],_0x9e82('0x51'));}}this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x38')]=_0x11f716[_0x9e82('0x37')];if(_0x11f716[_0x9e82('0x5d')]!==_0x9e82('0x5e')){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5f')]=_0x11f716['calleridnum'];}this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x60')]=_0x11f716[_0x9e82('0x61')];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x62')]=_0x11f716[_0x9e82('0x3c')];this['channels'][_0x11f716['linkedid']][_0x9e82('0x63')]=dispositions[_[_0x9e82('0x41')](_0x11f716[_0x9e82('0x42')])];if(this['agents'][_0x11f716['channel'][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]['UserId']=this['agents'][_0x11f716['channel'][_0x9e82('0x46')]('-')[0x0]]['id'];this['channels'][_0x11f716[_0x9e82('0x38')]]['membername']=this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')]['split']('-')[0x0]][_0x9e82('0x49')];}}}}else{if(this['channels'][_0x11f716[_0x9e82('0x37')]]){if(_0x11f716['channelstate']==='6'){if(this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x19')][_0x11f716['uniqueid']][_0x9e82('0x64')]=this['agents'][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['id'];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x37')]]['membername']=this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['name'];}}}}}}catch(_0x571de7){logger[_0x9e82('0x57')](_0x9e82('0x65'),util['inspect'](_0x571de7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x66')]=function(_0x35f4b7,_0x1e1e25){if(this[_0x9e82('0x19')][_0x35f4b7]){this[_0x9e82('0x19')][_0x35f4b7][_0x9e82('0x67')]=!![];if(_['endsWith'](_0x1e1e25,_0x9e82('0x68'))){_0x1e1e25=_0x1e1e25[_0x9e82('0x69')](_0x9e82('0x68'),_0x9e82('0x6a'));}this['channels'][_0x35f4b7][_0x9e82('0x6b')]=_0x1e1e25;var _0x19a3f5=_[_0x9e82('0x6c')](this['channels'][_0x35f4b7]['monitors'],{'filename':_0x1e1e25});if(_[_0x9e82('0x6d')](_0x19a3f5)){this[_0x9e82('0x19')][_0x35f4b7][_0x9e82('0x6e')][_0x9e82('0x6f')]({'filename':_0x1e1e25,'createdAt':moment()['format'](_0x9e82('0x40')),'mixmonitorid':'','status':_0x9e82('0x70')});}}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x23')]=function(_0x40734d){try{if(this[_0x9e82('0x34')](_0x40734d)){if(this[_0x9e82('0x19')][_0x40734d['uniqueid']]&&_0x40734d[_0x9e82('0x3c')]!='OutgoingSpoolFailed'){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')])){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x72')])){this['syncMixMonitorFilename'](_0x40734d['uniqueid'],_0x40734d[_0x9e82('0x73')]);}else if(this['isNotNull'](_0x40734d[_0x9e82('0x71')]['xmd-phone'])){this['channels'][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x5d')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d['variable'][_0x9e82('0x74')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x75')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x76')])){this['channels'][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x77')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')]['xmd-queue'])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x40734d['value']['split'](',')[0x0];}else if(this[_0x9e82('0x34')](_0x40734d['variable']['xmd-originatecalleridnum'])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]]['originatecalleridnum']=_0x40734d[_0x9e82('0x73')];}else if(this['isNotNull'](_0x40734d['variable'][_0x9e82('0x78')])){this[_0x9e82('0x19')][_0x40734d['uniqueid']][_0x9e82('0x79')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7a')])){this[_0x9e82('0x19')][_0x40734d['uniqueid']][_0x9e82('0x7b')]=_0x40734d['value'];}else if(this['isNotNull'](_0x40734d['variable'][_0x9e82('0x7c')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7d')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x7e')]=_0x40734d[_0x9e82('0x73')];}}}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')]['mixmonitor_filename'])){if(_0x40734d[_0x9e82('0x73')]){var _0x3c7235=path[_0x9e82('0x7f')](_0x40734d[_0x9e82('0x73')])[_0x9e82('0x49')];this['syncMixMonitorFilename'](_0x3c7235,_0x40734d['value']);}}else if(this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x38')]]){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')])){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7d')])){this['channels'][_0x40734d['linkedid']][_0x9e82('0x80')]=_0x40734d['value'];}}}}}catch(_0x3c96b6){logger[_0x9e82('0x57')](_0x9e82('0x81'),util[_0x9e82('0x82')](_0x3c96b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x25')]=function(_0x57d659){try{if(this[_0x9e82('0x34')](_0x57d659)){if(this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]){var _0xc92ceb=moment();this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['endtime']=_0xc92ceb[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x57d659['uniqueid']][_0x9e82('0x50')]=_0xc92ceb[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x3e')],'seconds');if(this[_0x9e82('0x19')][_0x57d659['uniqueid']][_0x9e82('0x59')]){this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['billableseconds']=_0xc92ceb[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x5a')],'seconds');this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x5b')]=this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x50')]-this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['billableseconds'];}if(_0x57d659[_0x9e82('0x44')]==='from-sip'){if(this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')]['split']('-')[0x0]]){this['agents'][_0x57d659[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]=_[_0x9e82('0x83')](this[_0x9e82('0x1a')][_0x57d659['channel'][_0x9e82('0x46')]('-')[0x0]],[_0x9e82('0x47')]);this[_0x9e82('0x36')](util[_0x9e82('0x3f')](_0x9e82('0x48'),this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x49')]),_0x9e82('0x84'),{'destaccountcode':this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')]['split']('-')[0x0]][_0x9e82('0x85')]});}}ami[_0x9e82('0x36')](_0x9e82('0x86'),this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]);delete this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]];}}}catch(_0x3ae737){logger[_0x9e82('0x57')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x3ae737,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x37ee99){try{if(this[_0x9e82('0x34')](_0x37ee99)){if(this['channels'][_0x37ee99[_0x9e82('0x87')]]){this[_0x9e82('0x19')][_0x37ee99['transfereeuniqueid']]['transfercalleridnum']=_0x37ee99[_0x9e82('0x88')];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]][_0x9e82('0x89')]=_0x37ee99[_0x9e82('0x8a')];if(this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8b')]]){var _0x56b2f7=this['channels'][_0x37ee99[_0x9e82('0x8b')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8b')]]=this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]]=_0x56b2f7;}}else if(this[_0x9e82('0x19')][_0x37ee99['transfertargetuniqueid']]){this[_0x9e82('0x19')][_0x37ee99['transfertargetuniqueid']]['transfercalleridnum']=_0x37ee99['origtransferercalleridnum'];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]][_0x9e82('0x89')]=_0x37ee99[_0x9e82('0x8a')];if(this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8d')]]){var _0x56b2f7=this['channels'][_0x37ee99[_0x9e82('0x8d')]];this['channels'][_0x37ee99[_0x9e82('0x8d')]]=this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]]=_0x56b2f7;}}}}catch(_0x1ffeb2){logger['error'](_0x9e82('0x8e'),util[_0x9e82('0x82')](_0x1ffeb2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x2a')]=function(_0x3590b2){try{if(this['isNotNull'](_0x3590b2)){if(this[_0x9e82('0x19')][_0x3590b2[_0x9e82('0x87')]]){this[_0x9e82('0x19')][_0x3590b2[_0x9e82('0x87')]]['transfercalleridnum']=_0x3590b2[_0x9e82('0x8f')];this[_0x9e82('0x19')][_0x3590b2['transfereeuniqueid']][_0x9e82('0x89')]=_0x3590b2[_0x9e82('0x90')];this[_0x9e82('0x25')]({'event':_0x9e82('0x91'),'uniqueid':_0x3590b2[_0x9e82('0x87')],'context':_0x3590b2[_0x9e82('0x44')],'channel':_0x3590b2[_0x9e82('0x92')]});}}}catch(_0x2406b9){logger[_0x9e82('0x57')]('[syncBlindTransfer][VoiceCallReport]',util[_0x9e82('0x82')](_0x2406b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x2c')]=function(_0x1a3bd3){try{if(this[_0x9e82('0x34')](_0x1a3bd3)){if(this[_0x9e82('0x19')][_0x1a3bd3['uniqueid']]){if(!_[_0x9e82('0x6d')](this[_0x9e82('0x19')][_0x1a3bd3[_0x9e82('0x37')]][_0x9e82('0x5a')])){this[_0x9e82('0x19')][_0x1a3bd3[_0x9e82('0x37')]][_0x9e82('0x93')]=moment()[_0x9e82('0x3f')](_0x9e82('0x40'));}}}}catch(_0x231b4d){logger[_0x9e82('0x57')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x9e82('0x82')](_0x231b4d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e82('0x94')]=function(_0x1bf823){try{if(this[_0x9e82('0x34')](_0x1bf823)){if(this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]]){if(!_[_0x9e82('0x6d')](this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x93')])){this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x95')]+=moment()['milliseconds'](0x0)[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]]['mohstarttime'],_0x9e82('0x51'));delete this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x93')];}}}}catch(_0x39525b){logger[_0x9e82('0x57')](_0x9e82('0x96'),util[_0x9e82('0x82')](_0x39525b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xc5ec=['[syncNewExten][VoiceCallReport]','syncNewState','answered','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','xmd-destination','destination','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','answertime','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','context','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','resolve','then','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','linkedid','uniqueid','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','split','destconnectedlinenum','exten','emit','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','starttime','subtract','duration','seconds','pick','includes','lastapplication','lastdata','startsWith','match'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5ec,0x17e));var _0xcc5e=function(_0x30ba3a,_0x282bbe){_0x30ba3a=_0x30ba3a-0x0;var _0x4bdf7a=_0xc5ec[_0x30ba3a];return _0x4bdf7a;};'use strict';var BPromise=require(_0xcc5e('0x0'));var _=require(_0xcc5e('0x1'));var moment=require(_0xcc5e('0x2'));var util=require(_0xcc5e('0x3'));var path=require(_0xcc5e('0x4'));var Redis=require(_0xcc5e('0x5'));var config=require(_0xcc5e('0x6'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0xcc5e('0x7'),_0xcc5e('0x8'),_0xcc5e('0x9'),_0xcc5e('0xa'),_0xcc5e('0xb'),_0xcc5e('0xc'),'ringing',_0xcc5e('0xd'),_0xcc5e('0xe')];var applications=[_0xcc5e('0xf'),_0xcc5e('0x10'),_0xcc5e('0x11'),_0xcc5e('0x12'),_0xcc5e('0x13'),_0xcc5e('0x14')];var dispositions=[_0xcc5e('0x15'),_0xcc5e('0x16'),_0xcc5e('0x16'),_0xcc5e('0x15'),_0xcc5e('0x15'),'NO\x20ANSWER',_0xcc5e('0x17'),_0xcc5e('0x18'),_0xcc5e('0x16'),_0xcc5e('0x16'),_0xcc5e('0x16')];var actions={};config[_0xcc5e('0x19')]=_['defaults'](config[_0xcc5e('0x19')],{'host':_0xcc5e('0x1a'),'port':0x18eb});var io=require(_0xcc5e('0x1b'))(new Redis(config[_0xcc5e('0x19')]));function VoiceCallReport(_0x302086){this['channels']=_0x302086[_0xcc5e('0x1c')];this['agents']=_0x302086[_0xcc5e('0x1d')];ami['on'](_0xcc5e('0x1e'),this[_0xcc5e('0x1f')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x21'),this[_0xcc5e('0x1f')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x22'),this[_0xcc5e('0x23')][_0xcc5e('0x20')](this));ami['on']('newstate',this['syncNewState'][_0xcc5e('0x20')](this));ami['on']('varset',this[_0xcc5e('0x24')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x25'),this[_0xcc5e('0x26')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x27'),this[_0xcc5e('0x28')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x29'),this[_0xcc5e('0x2a')][_0xcc5e('0x20')](this));ami['on']('blindtransfer',this[_0xcc5e('0x2b')][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x2c'),this['syncMusicOnHoldStart'][_0xcc5e('0x20')](this));ami['on'](_0xcc5e('0x2d'),this['syncMusicOnHoldStop'][_0xcc5e('0x20')](this));return BPromise[_0xcc5e('0x2e')]()[_0xcc5e('0x2f')](ami[_0xcc5e('0x30')]())['catch'](function(_0x3b5627){console[_0xcc5e('0x31')](_0x3b5627);});}VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x33')]=function(_0x2b535d){return _0x2b535d!==null&&!_[_0xcc5e('0x34')](_0x2b535d);};VoiceCallReport[_0xcc5e('0x32')]['emit']=function(_0x370e1b,_0x39d4cd,_0x5e0a0a){io['to'](_0x370e1b)['emit'](_0x39d4cd,_0x5e0a0a);};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x28')]=function(_0x44a197){try{if(this[_0xcc5e('0x33')](_0x44a197)){if(_0x44a197['uniqueid']===_0x44a197[_0xcc5e('0x35')]){if(!_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0x44a197[_0xcc5e('0x36')]])){_['merge'](this['channels'][_0x44a197[_0xcc5e('0x36')]],_['pick'](_0x44a197,_[_0xcc5e('0x37')](this[_0xcc5e('0x1c')][_0x44a197[_0xcc5e('0x36')]])));}}}}catch(_0x2150a0){logger[_0xcc5e('0x38')](_0xcc5e('0x39'),util[_0xcc5e('0x3a')](_0x2150a0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')]['syncNewChannel']=function(_0x523363){try{if(this[_0xcc5e('0x33')](_0x523363)){if(_0x523363['uniqueid']===_0x523363[_0xcc5e('0x35')]&&_0x523363[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){if(_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]])){this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]]=new Channel();this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]]['starttime']=moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]][_0xcc5e('0x3f')]=dispositions[_['toNumber'](_0x523363[_0xcc5e('0x40')])];_[_0xcc5e('0x41')](this[_0xcc5e('0x1c')][_0x523363[_0xcc5e('0x36')]],_['pick'](_0x523363,_[_0xcc5e('0x37')](this['channels'][_0x523363[_0xcc5e('0x36')]])));if(_0x523363['context']==='from-sip'){if(this[_0xcc5e('0x1d')][_0x523363[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1d')][_0x523363[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x43')]=_0x523363[_0xcc5e('0x44')];this[_0xcc5e('0x45')](util['format'](_0xcc5e('0x46'),this['agents'][_0x523363['channel'][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')]),_0xcc5e('0x48'),{'destaccountcode':this['agents'][_0x523363['channel'][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x49')],'destconnectedlinenum':_0x523363[_0xcc5e('0x44')]});}}}}}}catch(_0x1f6928){logger[_0xcc5e('0x38')](_0xcc5e('0x4a'),util[_0xcc5e('0x3a')](_0x1f6928,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x1f')]=function(_0xa5aa9b){try{if(this[_0xcc5e('0x33')](_0xa5aa9b)){if(_0xa5aa9b[_0xcc5e('0x36')]===_0xa5aa9b[_0xcc5e('0x35')]&&_0xa5aa9b['exten']!='h'&&_0xa5aa9b[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){_0xa5aa9b[_0xcc5e('0x4b')]=_0xa5aa9b[_0xcc5e('0x4b')][_0xcc5e('0x4c')]();_0xa5aa9b[_0xcc5e('0x4d')]=(_0xa5aa9b[_0xcc5e('0x4e')]||_0xa5aa9b[_0xcc5e('0x4d')])[_0xcc5e('0x4c')]();if(_[_0xcc5e('0x34')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]])){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]]=new Channel();this[_0xcc5e('0x1c')][_0xa5aa9b['uniqueid']][_0xcc5e('0x4f')]=_0xa5aa9b['duration']?moment()[_0xcc5e('0x50')](moment[_0xcc5e('0x51')](_0xa5aa9b[_0xcc5e('0x51')])[_0xcc5e('0x52')](),_0xcc5e('0x52'))[_0xcc5e('0x3d')](_0xcc5e('0x3e')):moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x3f')]=_0xcc5e('0x15');}_[_0xcc5e('0x41')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]],_[_0xcc5e('0x53')](_0xa5aa9b,_[_0xcc5e('0x37')](this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]])));if(_[_0xcc5e('0x54')](applications,_0xa5aa9b[_0xcc5e('0x4b')])){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x55')]=_0xa5aa9b[_0xcc5e('0x4b')];this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x56')]=_0xa5aa9b['applicationdata'];if(_0xa5aa9b[_0xcc5e('0x4b')]===_0xcc5e('0xf')&&_[_0xcc5e('0x57')](_0xa5aa9b[_0xcc5e('0x4d')],'cdr(')){var _0x257a25=_0xa5aa9b['applicationdata'][_0xcc5e('0x42')]('=');var _0x2b9e54=_0x257a25[0x0][_0xcc5e('0x58')](/cdr\((.*)\)/);if(_0x2b9e54){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0x2b9e54[0x1]]=_0x257a25[0x1];}}else if(_0xa5aa9b[_0xcc5e('0x4b')]===_0xcc5e('0x10')){this[_0xcc5e('0x1c')][_0xa5aa9b[_0xcc5e('0x36')]][_0xcc5e('0x10')]=_0xa5aa9b[_0xcc5e('0x4d')]['split'](',')[0x0];}}}}}catch(_0xa97336){logger[_0xcc5e('0x38')](_0xcc5e('0x59'),util[_0xcc5e('0x3a')](_0xa97336,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x5a')]=function(_0x52639d){try{if(this[_0xcc5e('0x33')](_0x52639d)){if(_0x52639d['uniqueid']!==_0x52639d[_0xcc5e('0x35')]){if(this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]){if(_0x52639d[_0xcc5e('0x40')]==='6'){if(!this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5b')]){var _0x5ca5c3=moment();this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5b')]=!![];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['answertime']=_0x5ca5c3[_0xcc5e('0x3d')](_0xcc5e('0x3e'));if(this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['starttime']){this[_0xcc5e('0x1c')][_0x52639d['linkedid']][_0xcc5e('0x5c')]=_0x5ca5c3[_0xcc5e('0x5d')](this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x4f')],_0xcc5e('0x52'));}}this['channels'][_0x52639d[_0xcc5e('0x35')]]['linkedid']=_0x52639d[_0xcc5e('0x36')];if(_0x52639d[_0xcc5e('0x5e')]!=='xcally-motion-preview'){this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x5f')]=_0x52639d[_0xcc5e('0x5e')];}this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x60')]=_0x52639d[_0xcc5e('0x61')];this[_0xcc5e('0x1c')][_0x52639d['linkedid']][_0xcc5e('0x62')]=_0x52639d[_0xcc5e('0x3b')];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x35')]]['disposition']=dispositions[_[_0xcc5e('0x63')](_0x52639d[_0xcc5e('0x40')])];if(this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x64')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]['id'];this['channels'][_0x52639d[_0xcc5e('0x35')]][_0xcc5e('0x65')]=this['agents'][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')];}}}}else{if(this['channels'][_0x52639d['uniqueid']]){if(_0x52639d['channelstate']==='6'){if(this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x36')]][_0xcc5e('0x64')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]['id'];this[_0xcc5e('0x1c')][_0x52639d[_0xcc5e('0x36')]][_0xcc5e('0x65')]=this[_0xcc5e('0x1d')][_0x52639d[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')];}}}}}}catch(_0x3bea5b){logger[_0xcc5e('0x38')](_0xcc5e('0x66'),util['inspect'](_0x3bea5b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x67')]=function(_0x5e439a,_0x297007){if(this['channels'][_0x5e439a]){this[_0xcc5e('0x1c')][_0x5e439a]['monitor']=!![];if(_[_0xcc5e('0x68')](_0x297007,_0xcc5e('0x69'))){_0x297007=_0x297007[_0xcc5e('0x6a')](_0xcc5e('0x69'),'.WAV');}this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6b')]=_0x297007;var _0x142fa3=_[_0xcc5e('0x6c')](this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6d')],{'filename':_0x297007});if(_[_0xcc5e('0x6e')](_0x142fa3)){this[_0xcc5e('0x1c')][_0x5e439a][_0xcc5e('0x6d')][_0xcc5e('0x6f')]({'filename':_0x297007,'createdAt':moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e')),'mixmonitorid':'','status':_0xcc5e('0x70')});}}};VoiceCallReport['prototype'][_0xcc5e('0x24')]=function(_0xc6e598){try{if(this[_0xcc5e('0x33')](_0xc6e598)){if(this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]]&&_0xc6e598[_0xcc5e('0x3b')]!=_0xcc5e('0x3c')){if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')])){if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x72')])){this[_0xcc5e('0x67')](_0xc6e598[_0xcc5e('0x36')],_0xc6e598[_0xcc5e('0x73')]);}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x74')])){this['channels'][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x5e')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x75')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x76')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['xmd-cdrtype'])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x77')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x78')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x36')]][_0xcc5e('0x10')]=_0xc6e598['value'][_0xcc5e('0x42')](',')[0x0];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x79')])){this['channels'][_0xc6e598[_0xcc5e('0x36')]]['originatecalleridnum']=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x7a')])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x7b')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['xmd-callerid-preview'])){this['channels'][_0xc6e598['uniqueid']][_0xcc5e('0x7c')]=_0xc6e598['value'];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x7d')])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x10')]=_0xc6e598[_0xcc5e('0x73')];}else if(this[_0xcc5e('0x33')](_0xc6e598[_0xcc5e('0x71')]['sipcallid'])){this[_0xcc5e('0x1c')][_0xc6e598['uniqueid']][_0xcc5e('0x7e')]=_0xc6e598[_0xcc5e('0x73')];}}}else if(this[_0xcc5e('0x33')](_0xc6e598['variable'][_0xcc5e('0x72')])){if(_0xc6e598[_0xcc5e('0x73')]){var _0x2a638d=path[_0xcc5e('0x7f')](_0xc6e598[_0xcc5e('0x73')])['name'];this[_0xcc5e('0x67')](_0x2a638d,_0xc6e598[_0xcc5e('0x73')]);}}else if(this['channels'][_0xc6e598[_0xcc5e('0x35')]]){if(this['isNotNull'](_0xc6e598[_0xcc5e('0x71')])){if(this['isNotNull'](_0xc6e598[_0xcc5e('0x71')][_0xcc5e('0x80')])){this[_0xcc5e('0x1c')][_0xc6e598[_0xcc5e('0x35')]][_0xcc5e('0x81')]=_0xc6e598[_0xcc5e('0x73')];}}}}}catch(_0x3e6a0e){logger[_0xcc5e('0x38')](_0xcc5e('0x82'),util[_0xcc5e('0x3a')](_0x3e6a0e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcc5e('0x26')]=function(_0x2bf866){try{if(this[_0xcc5e('0x33')](_0x2bf866)){if(this['channels'][_0x2bf866[_0xcc5e('0x36')]]){var _0x8113eb=moment();this['channels'][_0x2bf866[_0xcc5e('0x36')]]['endtime']=_0x8113eb[_0xcc5e('0x3d')](_0xcc5e('0x3e'));this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x51')]=_0x8113eb['diff'](this['channels'][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x4f')],_0xcc5e('0x52'));if(this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x5b')]){this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x83')]=_0x8113eb[_0xcc5e('0x5d')](this['channels'][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x84')],_0xcc5e('0x52'));this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]][_0xcc5e('0x5c')]=this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]]['duration']-this[_0xcc5e('0x1c')][_0x2bf866['uniqueid']][_0xcc5e('0x83')];}if(_0x2bf866['context']==='from-sip'){if(this['agents'][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]]){this[_0xcc5e('0x1d')][_0x2bf866['channel'][_0xcc5e('0x42')]('-')[0x0]]=_[_0xcc5e('0x85')](this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]],['destconnectedlinenum']);this[_0xcc5e('0x45')](util[_0xcc5e('0x3d')](_0xcc5e('0x46'),this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')][_0xcc5e('0x42')]('-')[0x0]][_0xcc5e('0x47')]),_0xcc5e('0x86'),{'destaccountcode':this[_0xcc5e('0x1d')][_0x2bf866[_0xcc5e('0x3b')]['split']('-')[0x0]][_0xcc5e('0x49')]});}}ami['emit'](_0xcc5e('0x87'),this['channels'][_0x2bf866[_0xcc5e('0x36')]]);delete this[_0xcc5e('0x1c')][_0x2bf866[_0xcc5e('0x36')]];}}}catch(_0x506fe5){logger[_0xcc5e('0x38')](_0xcc5e('0x88'),util[_0xcc5e('0x3a')](_0x506fe5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x2a')]=function(_0x33362d){try{if(this[_0xcc5e('0x33')](_0x33362d)){if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]]){this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]]['transfercalleridnum']=_0x33362d[_0xcc5e('0x8a')];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]][_0xcc5e('0x8b')]=_0x33362d[_0xcc5e('0x8c')];if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8d')]]){var _0x32d6ac=this[_0xcc5e('0x1c')][_0x33362d['secondtransfereruniqueid']];this['channels'][_0x33362d[_0xcc5e('0x8d')]]=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x89')]];this[_0xcc5e('0x1c')][_0x33362d['transfereeuniqueid']]=_0x32d6ac;}}else if(this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]]){this[_0xcc5e('0x1c')][_0x33362d['transfertargetuniqueid']][_0xcc5e('0x8f')]=_0x33362d['origtransferercalleridnum'];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]][_0xcc5e('0x8b')]=_0x33362d['transfertargetcalleridnum'];if(this[_0xcc5e('0x1c')][_0x33362d['origtransfereruniqueid']]){var _0x32d6ac=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x90')]];this['channels'][_0x33362d[_0xcc5e('0x90')]]=this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]];this[_0xcc5e('0x1c')][_0x33362d[_0xcc5e('0x8e')]]=_0x32d6ac;}}}}catch(_0x348267){logger[_0xcc5e('0x38')](_0xcc5e('0x91'),util[_0xcc5e('0x3a')](_0x348267,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xcc5e('0x2b')]=function(_0x312794){try{if(this[_0xcc5e('0x33')](_0x312794)){if(this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]]){this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]][_0xcc5e('0x8f')]=_0x312794[_0xcc5e('0x92')];this[_0xcc5e('0x1c')][_0x312794[_0xcc5e('0x89')]]['transferconnectedlinenum']=_0x312794[_0xcc5e('0x93')];this[_0xcc5e('0x26')]({'event':_0xcc5e('0x94'),'uniqueid':_0x312794[_0xcc5e('0x89')],'context':_0x312794[_0xcc5e('0x95')],'channel':_0x312794['transfererchannel']});}}}catch(_0x182404){logger[_0xcc5e('0x38')](_0xcc5e('0x96'),util['inspect'](_0x182404,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x97')]=function(_0x2be71c){try{if(this[_0xcc5e('0x33')](_0x2be71c)){if(this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]]){if(!_[_0xcc5e('0x6e')](this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]][_0xcc5e('0x84')])){this[_0xcc5e('0x1c')][_0x2be71c[_0xcc5e('0x36')]][_0xcc5e('0x98')]=moment()[_0xcc5e('0x3d')](_0xcc5e('0x3e'));}}}}catch(_0x3e8fe0){logger[_0xcc5e('0x38')](_0xcc5e('0x99'),util['inspect'](_0x3e8fe0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcc5e('0x32')][_0xcc5e('0x9a')]=function(_0xdf05d1){try{if(this[_0xcc5e('0x33')](_0xdf05d1)){if(this['channels'][_0xdf05d1['uniqueid']]){if(!_[_0xcc5e('0x6e')](this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x98')])){this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x9b')]+=moment()[_0xcc5e('0x9c')](0x0)[_0xcc5e('0x5d')](this['channels'][_0xdf05d1['uniqueid']][_0xcc5e('0x98')],'seconds');delete this[_0xcc5e('0x1c')][_0xdf05d1[_0xcc5e('0x36')]][_0xcc5e('0x98')];}}}}catch(_0x305f26){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xcc5e('0x3a')](_0x305f26,{'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 1d4613a..c35b67c 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 _0x5c1f=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','complete','total','answered','holdtime','seconds','billableseconds','sumDuration','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','isNotNull','isUndefined','prototype','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','emit','voice:outbound','voice_outbound_channel:save','error','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','outboundrouteid','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged'];(function(_0x57c7a8,_0x497e8c){var _0x70c788=function(_0x4be826){while(--_0x4be826){_0x57c7a8['push'](_0x57c7a8['shift']());}};_0x70c788(++_0x497e8c);}(_0x5c1f,0x1d5));var _0xf5c1=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x5c1f[_0x260f28];return _0x3aefcc;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0xf5c1('0x0'));var config=require(_0xf5c1('0x1'));var logger=require(_0xf5c1('0x2'))('ami');var ami=require(_0xf5c1('0x3'));config[_0xf5c1('0x4')]=_['defaults'](config[_0xf5c1('0x4')],{'host':_0xf5c1('0x5'),'port':0x18eb});var io=require(_0xf5c1('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x77d808){this[_0xf5c1('0x7')]=_0x77d808[_0xf5c1('0x8')];this[_0xf5c1('0x9')]=_0x77d808[_0xf5c1('0x9')];this[_0xf5c1('0xa')]={};ami['on'](_0xf5c1('0xb'),this[_0xf5c1('0xc')]['bind'](this));ami['on'](_0xf5c1('0xd'),this[_0xf5c1('0xe')][_0xf5c1('0xf')](this));ami['on'](_0xf5c1('0x10'),this[_0xf5c1('0x11')][_0xf5c1('0xf')](this));ami['on'](_0xf5c1('0x12'),this['syncHangup'][_0xf5c1('0xf')](this));}VoiceDialReport['prototype'][_0xf5c1('0x13')]=function(_0x16bb7e){return _0x16bb7e!==null&&!_[_0xf5c1('0x14')](_0x16bb7e);};VoiceDialReport[_0xf5c1('0x15')]['emit']=function(_0x544f46,_0x507a48,_0x26d26c){io['to'](_0x544f46)['emit'](_0x507a48,_0x26d26c);};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0xc')]=function(_0xffbaad){try{if(this[_0xf5c1('0x13')](_0xffbaad)){if(this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]){_['merge'](this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]],{'starttime':moment()[_0xf5c1('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf5c1('0x18'),'interface':_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1a')](0x0,_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1b')]('-')),'membername':_0xffbaad['channel']['substring'](_0xffbaad[_0xf5c1('0x19')]['lastIndexOf']('/')+0x1,_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1b')]('-'))},_[_0xf5c1('0x1c')](_0xffbaad,[_0xf5c1('0x1d'),_0xf5c1('0x1e')]));this[_0xf5c1('0x1f')](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]);ami['emit']('custom:dialbegin',this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]);}}}catch(_0x1d63f5){logger[_0xf5c1('0x22')]('[syncDialBegin][VoiceDialReport]',util[_0xf5c1('0x23')](_0x1d63f5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0xe')]=function(_0x3b80b0){try{if(this[_0xf5c1('0x13')](_0x3b80b0)){if(this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]){this['channels'][_0x3b80b0['uniqueid']][_0xf5c1('0x24')]=_0x3b80b0[_0xf5c1('0x24')];if(_0x3b80b0[_0xf5c1('0x24')]===_0xf5c1('0x25')){this[_0xf5c1('0x7')][_0x3b80b0['uniqueid']][_0xf5c1('0x26')]=_0x3b80b0[_0xf5c1('0x26')];this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]][_0xf5c1('0x27')]=_0x3b80b0[_0xf5c1('0x27')];this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]][_0xf5c1('0x28')]=moment()[_0xf5c1('0x17')](_0xf5c1('0x29'));this[_0xf5c1('0x7')][_0x3b80b0['uniqueid']]['lastevent']=_0xf5c1('0x2a');ami[_0xf5c1('0x1f')](_0xf5c1('0x2b'),this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]);}this['emit'](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]);}}}catch(_0x319147){logger[_0xf5c1('0x22')](_0xf5c1('0x2c'),util[_0xf5c1('0x23')](_0x319147,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0x11')]=function(_0x30d50d){try{if(this['isNotNull'](_0x30d50d)){this[_0xf5c1('0x2d')](_0x30d50d['uniqueid'],_[_0xf5c1('0x2e')](_0x30d50d[_0xf5c1('0x2f')])[0x0],_0x30d50d['value']);if(this['isNotNull'](_0x30d50d['variable'])&&this['isNotNull'](_0x30d50d[_0xf5c1('0x2f')][_0xf5c1('0x30')])){if(_[_0xf5c1('0x14')](this['channels'][_0x30d50d['uniqueid']])){this[_0xf5c1('0x7')][_0x30d50d['uniqueid']]={'routeId':_0x30d50d[_0xf5c1('0x31')],'variables':this['variables'][_0x30d50d[_0xf5c1('0x16')]]};this[_0xf5c1('0x1f')](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0x30d50d[_0xf5c1('0x16')]]);}}}}catch(_0x10023d){logger[_0xf5c1('0x22')](_0xf5c1('0x32'),util['inspect'](_0x10023d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')]['addVariable']=function(_0x462402,_0x1bf736,_0x204d60){var _0x3c71e5=[_0xf5c1('0x33'),_0xf5c1('0x34'),_0xf5c1('0x35'),_0xf5c1('0x36'),_0xf5c1('0x37'),_0xf5c1('0x38'),_0xf5c1('0x39'),_0xf5c1('0x3a'),_0xf5c1('0x3b'),_0xf5c1('0x3c'),_0xf5c1('0x3d'),_0xf5c1('0x3e'),_0xf5c1('0x3f'),_0xf5c1('0x40'),_0xf5c1('0x41'),'memberlastcall',_0xf5c1('0x42'),_0xf5c1('0x43'),_0xf5c1('0x44')];if(!_[_0xf5c1('0x45')](_0x1bf736)&&!_[_0xf5c1('0x46')](_0x3c71e5,_0x1bf736)){if(_[_0xf5c1('0x14')](this[_0xf5c1('0xa')][_0x462402])){this[_0xf5c1('0xa')][_0x462402]={};}this[_0xf5c1('0xa')][_0x462402][_0x1bf736]=_0x204d60;}};VoiceDialReport['prototype']['syncHangup']=function(_0x2f5621){try{if(this[_0xf5c1('0x13')](_0x2f5621)){if(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]){this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x47')]=moment()['format'](_0xf5c1('0x29'));this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x48')]=moment(this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x47')])[_0xf5c1('0x49')](this['channels'][_0x2f5621['uniqueid']][_0xf5c1('0x4a')],'seconds');this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['lastevent']=_0xf5c1('0x4b');this['outbound'][_0xf5c1('0x4c')]+=0x1;if(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x28')]){this['outbound'][_0xf5c1('0x4d')]+=0x1;this[_0xf5c1('0x7')][_0x2f5621['uniqueid']][_0xf5c1('0x4e')]=moment(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['answertime'])[_0xf5c1('0x49')](this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['starttime'],_0xf5c1('0x4f'));this[_0xf5c1('0x7')][_0x2f5621['uniqueid']][_0xf5c1('0x50')]=moment(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['endtime'])[_0xf5c1('0x49')](this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x28')],_0xf5c1('0x4f'));this[_0xf5c1('0x9')]['sumHoldTime']+=this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x4e')]||0x0;this[_0xf5c1('0x9')]['sumBillable']+=this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x50')];}this[_0xf5c1('0x9')][_0xf5c1('0x51')]+=this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['duration'];ami['emit']('custom:voiceDialReport',this['channels'][_0x2f5621[_0xf5c1('0x16')]]);ami[_0xf5c1('0x1f')](_0xf5c1('0x52'),this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]);this[_0xf5c1('0x1f')]('voice:outbound',_0xf5c1('0x53'),this[_0xf5c1('0x9')]);this['emit'](_0xf5c1('0x20'),_0xf5c1('0x54'),this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]);delete this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]];}if(this['variables'][_0x2f5621[_0xf5c1('0x16')]]){delete this[_0xf5c1('0xa')][_0x2f5621[_0xf5c1('0x16')]];}}}catch(_0x350fa9){logger['error'](_0xf5c1('0x55'),util[_0xf5c1('0x23')](_0x350fa9,{'showHidden':![],'depth':null}));}};module[_0xf5c1('0x56')]=VoiceDialReport; \ No newline at end of file +var _0xe0ab=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','duration','endtime','diff','starttime','seconds','lastevent','complete','outbound','total','answered','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss'];(function(_0x5b20e7,_0x4fdd80){var _0x38a218=function(_0x3a6c61){while(--_0x3a6c61){_0x5b20e7['push'](_0x5b20e7['shift']());}};_0x38a218(++_0x4fdd80);}(_0xe0ab,0x7a));var _0xbe0a=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe0ab[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var moment=require(_0xbe0a('0x0'));var util=require(_0xbe0a('0x1'));var Redis=require(_0xbe0a('0x2'));var config=require(_0xbe0a('0x3'));var logger=require(_0xbe0a('0x4'))('ami');var ami=require('../ami');config[_0xbe0a('0x5')]=_[_0xbe0a('0x6')](config[_0xbe0a('0x5')],{'host':_0xbe0a('0x7'),'port':0x18eb});var io=require(_0xbe0a('0x8'))(new Redis(config[_0xbe0a('0x5')]));function VoiceDialReport(_0x15c142){this[_0xbe0a('0x9')]=_0x15c142[_0xbe0a('0xa')];this['outbound']=_0x15c142['outbound'];this[_0xbe0a('0xb')]={};ami['on'](_0xbe0a('0xc'),this[_0xbe0a('0xd')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0xf'),this[_0xbe0a('0x10')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0x11'),this[_0xbe0a('0x12')][_0xbe0a('0xe')](this));ami['on'](_0xbe0a('0x13'),this[_0xbe0a('0x14')][_0xbe0a('0xe')](this));}VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x16')]=function(_0x2b5068){return _0x2b5068!==null&&!_[_0xbe0a('0x17')](_0x2b5068);};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x18')]=function(_0x10990b,_0x1019bc,_0x23175a){io['to'](_0x10990b)[_0xbe0a('0x18')](_0x1019bc,_0x23175a);};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0xd')]=function(_0x271410){try{if(this['isNotNull'](_0x271410)){if(this[_0xbe0a('0x9')][_0x271410[_0xbe0a('0x19')]]){_['merge'](this[_0xbe0a('0x9')][_0x271410[_0xbe0a('0x19')]],{'starttime':moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b')),'lastevent':_0xbe0a('0x1c'),'interface':_0x271410['channel'][_0xbe0a('0x1d')](0x0,_0x271410['channel']['lastIndexOf']('-')),'membername':_0x271410[_0xbe0a('0x1e')][_0xbe0a('0x1d')](_0x271410[_0xbe0a('0x1e')]['lastIndexOf']('/')+0x1,_0x271410['channel']['lastIndexOf']('-'))},_[_0xbe0a('0x1f')](_0x271410,[_0xbe0a('0x20'),_0xbe0a('0x21')]));this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x23'),this['channels'][_0x271410[_0xbe0a('0x19')]]);ami[_0xbe0a('0x18')](_0xbe0a('0x24'),this['channels'][_0x271410[_0xbe0a('0x19')]]);}}}catch(_0x83d2eb){logger['error'](_0xbe0a('0x25'),util[_0xbe0a('0x26')](_0x83d2eb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')]['syncDialEnd']=function(_0x36ac20){try{if(this[_0xbe0a('0x16')](_0x36ac20)){if(this[_0xbe0a('0x9')][_0x36ac20['uniqueid']]){this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x27')]=_0x36ac20[_0xbe0a('0x27')];if(_0x36ac20['dialstatus']===_0xbe0a('0x28')){this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]]['connectedlinenum']=_0x36ac20[_0xbe0a('0x29')];this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x2a')]=_0x36ac20['connectedlinename'];this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]][_0xbe0a('0x2b')]=moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b'));this[_0xbe0a('0x9')][_0x36ac20[_0xbe0a('0x19')]]['lastevent']='connect';ami[_0xbe0a('0x18')](_0xbe0a('0x2c'),this['channels'][_0x36ac20[_0xbe0a('0x19')]]);}this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x23'),this[_0xbe0a('0x9')][_0x36ac20['uniqueid']]);}}}catch(_0x2d4767){logger[_0xbe0a('0x2d')](_0xbe0a('0x2e'),util[_0xbe0a('0x26')](_0x2d4767,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')]['syncVarSet']=function(_0x582868){try{if(this[_0xbe0a('0x16')](_0x582868)){this[_0xbe0a('0x2f')](_0x582868['uniqueid'],_[_0xbe0a('0x30')](_0x582868[_0xbe0a('0x31')])[0x0],_0x582868[_0xbe0a('0x32')]);if(this[_0xbe0a('0x16')](_0x582868[_0xbe0a('0x31')])&&this[_0xbe0a('0x16')](_0x582868[_0xbe0a('0x31')][_0xbe0a('0x33')])){if(_['isUndefined'](this[_0xbe0a('0x9')][_0x582868['uniqueid']])){this[_0xbe0a('0x9')][_0x582868['uniqueid']]={'routeId':_0x582868['value'],'variables':this['variables'][_0x582868['uniqueid']]};this[_0xbe0a('0x18')]('voice:outbound',_0xbe0a('0x23'),this[_0xbe0a('0x9')][_0x582868['uniqueid']]);}}}}catch(_0x4c47e0){logger['error'](_0xbe0a('0x34'),util[_0xbe0a('0x26')](_0x4c47e0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbe0a('0x15')][_0xbe0a('0x2f')]=function(_0x3ba232,_0x31846b,_0x2d81a6){var _0x260cdc=[_0xbe0a('0x35'),_0xbe0a('0x36'),_0xbe0a('0x37'),_0xbe0a('0x38'),_0xbe0a('0x39'),_0xbe0a('0x3a'),_0xbe0a('0x3b'),_0xbe0a('0x3c'),_0xbe0a('0x3d'),_0xbe0a('0x3e'),_0xbe0a('0x3f'),_0xbe0a('0x40'),_0xbe0a('0x41'),'memberdynamic',_0xbe0a('0x42'),_0xbe0a('0x43'),_0xbe0a('0x44'),_0xbe0a('0x45'),_0xbe0a('0x46')];if(!_[_0xbe0a('0x47')](_0x31846b)&&!_[_0xbe0a('0x48')](_0x260cdc,_0x31846b)){if(_[_0xbe0a('0x17')](this[_0xbe0a('0xb')][_0x3ba232])){this[_0xbe0a('0xb')][_0x3ba232]={};}this[_0xbe0a('0xb')][_0x3ba232][_0x31846b]=_0x2d81a6;}};VoiceDialReport[_0xbe0a('0x15')]['syncHangup']=function(_0x4edbd5){try{if(this[_0xbe0a('0x16')](_0x4edbd5)){if(this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]){this['channels'][_0x4edbd5[_0xbe0a('0x19')]]['endtime']=moment()[_0xbe0a('0x1a')](_0xbe0a('0x1b'));this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x49')]=moment(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4a')])[_0xbe0a('0x4b')](this['channels'][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4c')],_0xbe0a('0x4d'));this['channels'][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4e')]=_0xbe0a('0x4f');this[_0xbe0a('0x50')][_0xbe0a('0x51')]+=0x1;if(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x2b')]){this[_0xbe0a('0x50')][_0xbe0a('0x52')]+=0x1;this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['holdtime']=moment(this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]['answertime'])['diff'](this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']][_0xbe0a('0x4c')],'seconds');this['channels'][_0x4edbd5['uniqueid']][_0xbe0a('0x53')]=moment(this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x4a')])['diff'](this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x2b')],_0xbe0a('0x4d'));this[_0xbe0a('0x50')]['sumHoldTime']+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['holdtime']||0x0;this[_0xbe0a('0x50')]['sumBillable']+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]][_0xbe0a('0x53')];}this['outbound'][_0xbe0a('0x54')]+=this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]['duration'];ami['emit'](_0xbe0a('0x55'),this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]);ami[_0xbe0a('0x18')](_0xbe0a('0x56'),this[_0xbe0a('0x9')][_0x4edbd5['uniqueid']]);this[_0xbe0a('0x18')]('voice:outbound',_0xbe0a('0x57'),this[_0xbe0a('0x50')]);this[_0xbe0a('0x18')](_0xbe0a('0x22'),_0xbe0a('0x58'),this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]]);delete this[_0xbe0a('0x9')][_0x4edbd5[_0xbe0a('0x19')]];}if(this[_0xbe0a('0xb')][_0x4edbd5[_0xbe0a('0x19')]]){delete this[_0xbe0a('0xb')][_0x4edbd5[_0xbe0a('0x19')]];}}}catch(_0x3e974b){logger[_0xbe0a('0x2d')]('[syncHangup][VoiceDialReport]',util[_0xbe0a('0x26')](_0x3e974b,{'showHidden':![],'depth':null}));}};module[_0xbe0a('0x59')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 5c129ae..e4f7856 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 _0x8d97=['message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','variables','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emitVoiceQueueChannelSave','voice:queue:%s','name','emit','format','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumHoldTime','total','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','queues','[queues]','then','[queuesummary]','queue','callers','loggedin','toNumber','loggedIn','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncAgentConnect][VoiceQueueReport]','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','reason','transfer','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','length','unmanaged','diff','sumDuration','milliseconds','lastevent','custom:queuecallerunmanaged','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','enqueue','tail','finally','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','talking','pTalking','waiting','unlockRR','prototype','clearZombieChannels','switch','sequence','isNil','Action','status','channel','catch'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x8d97,0x8e));var _0x78d9=function(_0x4ff0f5,_0x1e691a){_0x4ff0f5=_0x4ff0f5-0x0;var _0x5bd56c=_0x8d97[_0x4ff0f5];return _0x5bd56c;};'use strict';var _=require(_0x78d9('0x0'));var moment=require(_0x78d9('0x1'));var BPromise=require(_0x78d9('0x2'));var util=require(_0x78d9('0x3'));var md5=require(_0x78d9('0x4'));var Redis=require(_0x78d9('0x5'));var config=require(_0x78d9('0x6'));var logger=require('../../../config/logger')(_0x78d9('0x7'));var ami=require(_0x78d9('0x8'));var QueueReport=require(_0x78d9('0x9'));config[_0x78d9('0xa')]=_[_0x78d9('0xb')](config[_0x78d9('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x78d9('0xc'))(new Redis(config[_0x78d9('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x78d9('0xd')]=function(_0x4891c3){this['tail']=this[_0x78d9('0xe')]?this[_0x78d9('0xe')][_0x78d9('0xf')](_0x4891c3):_0x4891c3();};function VoiceQueueReport(_0x4a61ba){this['sequence']=new Sequence();this['queueReports']={};this['agents']=_0x4a61ba[_0x78d9('0x10')];this[_0x78d9('0x11')]=_0x4a61ba['queueChannels'];this[_0x78d9('0x12')]=_0x4a61ba[_0x78d9('0x12')];this[_0x78d9('0x13')]=!![];this[_0x78d9('0x14')]=_0x4a61ba['campaigns'];this['variables']={};ami['on'](_0x78d9('0x15'),this[_0x78d9('0x16')][_0x78d9('0x17')](this));ami['on']('queuesummarycomplete',this[_0x78d9('0x18')]['bind'](this));ami['on'](_0x78d9('0x19'),this[_0x78d9('0x1a')][_0x78d9('0x17')](this));ami['on'](_0x78d9('0x1b'),this[_0x78d9('0x1c')][_0x78d9('0x17')](this));ami['on']('queuecallerleave',this[_0x78d9('0x1d')][_0x78d9('0x17')](this));ami['on']('agentcomplete',this[_0x78d9('0x1e')]['bind'](this));ami['on'](_0x78d9('0x1f'),this[_0x78d9('0x20')][_0x78d9('0x17')](this));ami['on'](_0x78d9('0x21'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x78d9('0x22')][_0x78d9('0x17')](this));ami['on'](_0x78d9('0x23'),this[_0x78d9('0x24')]['bind'](this));ami['on']('musiconholdstart',this[_0x78d9('0x25')][_0x78d9('0x17')](this));ami['on'](_0x78d9('0x26'),this[_0x78d9('0x27')][_0x78d9('0x17')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x78d9('0x17')](this));ami['on'](_0x78d9('0x28'),this[_0x78d9('0x29')][_0x78d9('0x17')](this));this[_0x78d9('0x2a')]();this['loopQueueShow']();}function isNotNull(_0xfe50c3){return _0xfe50c3!==null&&!_[_0x78d9('0x2b')](_0xfe50c3);}function clearChannels(_0x261c04){if(!_[_0x78d9('0x2c')](_0x261c04)){for(var _0x124e60 in _0x261c04){if(_0x261c04[_0x78d9('0x2d')](_0x124e60)){delete _0x261c04[_0x124e60];}}}}function clearCampaigns(_0x124f70){if(!_['isEmpty'](_0x124f70)){for(var _0x56df5b in _0x124f70){if(_0x124f70[_0x78d9('0x2d')](_0x56df5b)){_0x124f70[_0x56df5b]['originated']=0x0;}}}}function clearVoiceQueues(_0x555931){if(!_[_0x78d9('0x2c')](_0x555931)){for(var _0x366a7c in _0x555931){if(_0x555931[_0x78d9('0x2d')](_0x366a7c)){_0x555931[_0x366a7c]['originated']=0x0;_0x555931[_0x366a7c][_0x78d9('0x2e')]=0x0;_0x555931[_0x366a7c][_0x78d9('0x2f')]=0x0;_0x555931[_0x366a7c][_0x78d9('0x30')]=0x0;_0x555931[_0x366a7c]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x38ff66){if(!_[_0x78d9('0x2c')](_0x38ff66)){for(var _0x5b8730 in _0x38ff66){if(_0x38ff66['hasOwnProperty'](_0x5b8730)){_0x38ff66[_0x5b8730][_0x78d9('0x31')]=!![];}}}}VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x33')]=function(){var _0x6fc74d=this;for(var _0x2d0c33 in this[_0x78d9('0x11')]){if(this['channels'][_0x78d9('0x2d')](_0x2d0c33)&&!this[_0x78d9('0x11')][_0x2d0c33][_0x78d9('0x34')]){this[_0x78d9('0x35')]['enqueue'](function(){if(!_[_0x78d9('0x36')](_0x6fc74d[_0x78d9('0x11')][_0x2d0c33])){return ami[_0x78d9('0x37')]({'action':_0x78d9('0x38'),'channel':_0x6fc74d['channels'][_0x2d0c33][_0x78d9('0x39')]})[_0x78d9('0x3a')](function(_0x1fd891){if(_0x1fd891[_0x78d9('0x3b')]===_0x78d9('0x3c')){setTimeout(function(){if(_0x6fc74d[_0x78d9('0x11')][_0x2d0c33]){delete _0x6fc74d[_0x78d9('0x11')][_0x2d0c33];logger[_0x78d9('0x3d')](_0x78d9('0x3e'),_0x2d0c33);}if(_0x6fc74d[_0x78d9('0x3f')][_0x2d0c33]){delete _0x6fc74d[_0x78d9('0x3f')][_0x2d0c33];logger['error'](_0x78d9('0x40'),_0x2d0c33);}if(_0x6fc74d[_0x78d9('0x41')][_0x2d0c33]){delete _0x6fc74d[_0x78d9('0x41')][_0x2d0c33];logger[_0x78d9('0x3d')](_0x78d9('0x42'),_0x2d0c33);}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x78d9('0x3d')](_0x78d9('0x43'));clearChannels(this['channels']);this[_0x78d9('0x44')](this[_0x78d9('0x3f')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x78d9('0x14')]);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x44')]=function(_0x9502dc){var _0x5e5f5e=this;if(!_[_0x78d9('0x2c')](_0x9502dc)){for(var _0x3052bb in _0x9502dc){if(_0x9502dc[_0x78d9('0x2d')](_0x3052bb)){_0x5e5f5e[_0x78d9('0x45')](_0x9502dc[_0x3052bb]);delete _0x9502dc[_0x3052bb];}}}};function loggerCatch(_0x17de0a){return function(_0x24fd28){logger['error'](_0x17de0a,util[_0x78d9('0x46')](_0x24fd28,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x78d9('0x32')]['emit']=function(_0x1e1c8c,_0x58b110,_0x118813){io['to'](_0x1e1c8c)['emit'](_0x58b110,_0x118813);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x47')]=function(_0x43b155){this['emit'](util['format'](_0x78d9('0x48'),_0x43b155[_0x78d9('0x49')]),'voice_queue_channel:save',_0x43b155);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x45')]=function(_0x49912e){this[_0x78d9('0x4a')](util[_0x78d9('0x4b')](_0x78d9('0x48'),_0x49912e[_0x78d9('0x49')]),_0x78d9('0x4c'),_0x49912e);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x4d')]=function(_0x22fdea){if(_0x22fdea[_0x78d9('0x4e')]===_0x78d9('0x4f')){var _0x564822={'id':_0x22fdea['id'],'name':_0x22fdea[_0x78d9('0x49')],'strategy':_0x22fdea[_0x78d9('0x50')],'answered':_0x22fdea[_0x78d9('0x51')],'available':_0x22fdea[_0x78d9('0x52')],'loggedIn':_0x22fdea['loggedIn'],'pTalking':_0x22fdea[_0x78d9('0x2f')],'sumBillable':_0x22fdea[_0x78d9('0x53')],'sumDuration':_0x22fdea['sumDuration'],'sumHoldTime':_0x22fdea[_0x78d9('0x54')]||0x0,'talking':_0x22fdea['talking'],'total':_0x22fdea[_0x78d9('0x55')],'type':_0x22fdea[_0x78d9('0x4e')],'unmanaged':_0x22fdea['unmanaged'],'abandoned':_0x22fdea[_0x78d9('0x56')],'waiting':_0x22fdea[_0x78d9('0x30')]};if(_0x22fdea[_0x78d9('0x57')]){_0x564822[_0x78d9('0x57')]={'id':_0x22fdea[_0x78d9('0x57')]['id'],'name':_0x22fdea[_0x78d9('0x57')]['name'],'active':_0x22fdea[_0x78d9('0x57')][_0x78d9('0x58')],'callerid':_0x22fdea[_0x78d9('0x57')][_0x78d9('0x59')]};}if(_0x22fdea[_0x78d9('0x5a')]){_0x564822[_0x78d9('0x5a')]={'id':_0x22fdea[_0x78d9('0x5a')]['id'],'name':_0x22fdea['Interval'][_0x78d9('0x49')]};}var _0x3ee99a=md5(JSON[_0x78d9('0x5b')](_0x564822));if(_0x22fdea[_0x78d9('0x4')]!==_0x3ee99a){_0x22fdea[_0x78d9('0x4')]=_0x3ee99a;this[_0x78d9('0x4a')](util[_0x78d9('0x4b')](_0x78d9('0x48'),_0x564822[_0x78d9('0x49')]),_0x78d9('0x5c'),_0x564822);}}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x5d')]=function(_0x85aca9){return _0x85aca9!==null&&!_[_0x78d9('0x2b')](_0x85aca9);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x5e')]=function(){var _0x351ed5=this;setInterval(function(){_0x351ed5[_0x78d9('0x33')]();ami[_0x78d9('0x37')]({'action':_0x78d9('0x5f')})[_0x78d9('0x3a')](loggerCatch(_0x78d9('0x60')));},0x2710);};VoiceQueueReport['prototype'][_0x78d9('0x2a')]=function(){var _0x3820cc=this;setInterval(function(){if(_0x3820cc[_0x78d9('0x13')]){return ami[_0x78d9('0x37')]({'action':_0x78d9('0x15')})[_0x78d9('0x61')](function(_0x4f53ca){_0x3820cc[_0x78d9('0x13')]=![];})['catch'](loggerCatch(_0x78d9('0x62')));}},0x3e8);};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x16')]=function(_0x24ccda){try{if(this[_0x78d9('0x5d')](_0x24ccda)&&this[_0x78d9('0x5d')](_0x24ccda[_0x78d9('0x63')])){if(this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]){var _0x373572=_['countBy'](this[_0x78d9('0x11')],_0x78d9('0x63'))[_0x24ccda[_0x78d9('0x63')]]||0x0;var _0x24acac=_0x373572-_0x24ccda[_0x78d9('0x64')];if(this['voiceQueues'][_0x24ccda[_0x78d9('0x63')]]['waiting']!==_['toNumber'](_0x24ccda[_0x78d9('0x64')])||this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]['loggedIn']!==_['toNumber'](_0x24ccda[_0x78d9('0x65')])||this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x52')]!==_[_0x78d9('0x66')](_0x24ccda[_0x78d9('0x52')])||this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')]!==_0x24acac){this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]['waiting']=_[_0x78d9('0x66')](_0x24ccda[_0x78d9('0x64')]);this[_0x78d9('0x12')][_0x24ccda['queue']][_0x78d9('0x67')]=_['toNumber'](_0x24ccda[_0x78d9('0x65')]);this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x52')]=_[_0x78d9('0x66')](_0x24ccda['available']);this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]['talking']=_0x24acac>0x0?_0x24acac:0x0;this['voiceQueues'][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')]=this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')]>_['toNumber'](_0x24ccda[_0x78d9('0x65')])?_[_0x78d9('0x66')](_0x24ccda[_0x78d9('0x65')]):this['voiceQueues'][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')];this[_0x78d9('0x4d')](this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]);}ami[_0x78d9('0x4a')](_0x78d9('0x68'),this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]);}}}catch(_0x2f13cb){logger[_0x78d9('0x3d')](_0x78d9('0x69'),util[_0x78d9('0x46')](_0x2f13cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x18')]=function(_0x57dc2e){this[_0x78d9('0x13')]=!![];};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x6a')]=function(_0x5edf43){};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1a')]=function(_0x51b785){try{if(this['isNotNull'](_0x51b785)){if(_['isUndefined'](this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]])){this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]]=[];this[_0x78d9('0x11')][_0x51b785[_0x78d9('0x6b')]]={};}var _0x10623d=new QueueReport();_0x10623d[_0x78d9('0x49')]=_0x51b785[_0x78d9('0x63')];_0x10623d['type']=this[_0x78d9('0x12')][_0x10623d['name']]&&this['voiceQueues'][_0x10623d['name']][_0x78d9('0x4e')]?this[_0x78d9('0x12')][_0x10623d['name']][_0x78d9('0x4e')]||'inbound':'inbound';_0x10623d['queue']=_0x51b785['queue'];_0x10623d[_0x78d9('0x6c')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x10623d[_0x78d9('0x6e')]=_0x51b785[_0x78d9('0x6e')];_0x10623d[_0x78d9('0x6f')]=_0x51b785[_0x78d9('0x6f')];_[_0x78d9('0x70')](_0x10623d,_[_0x78d9('0x71')](_0x51b785,_[_0x78d9('0x72')](_0x10623d)));this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]][_0x78d9('0x73')](_0x10623d);this[_0x78d9('0x11')][_0x51b785[_0x78d9('0x6b')]]=_0x10623d;this[_0x78d9('0x47')](_0x10623d);}}catch(_0x3bdc44){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x78d9('0x46')](_0x3bdc44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1c')]=function(_0x36d3aa){try{if(this[_0x78d9('0x5d')](_0x36d3aa)){if(this[_0x78d9('0x3f')][_0x36d3aa[_0x78d9('0x6b')]]){var _0x334f03=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x36d3aa[_0x78d9('0x6b')]]);_0x334f03[_0x78d9('0x75')]=![];_0x334f03[_0x78d9('0x76')]=null;_0x334f03[_0x78d9('0x77')]=_0x36d3aa[_0x78d9('0x77')];_0x334f03[_0x78d9('0x78')]=_0x36d3aa['originalposition'];_0x334f03[_0x78d9('0x1b')]=!![];_0x334f03[_0x78d9('0x79')]=moment()[_0x78d9('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x334f03[_0x78d9('0x7a')]=_0x78d9('0x7b');_0x334f03['lastAssignedTo']=null;this['channels'][_0x36d3aa['uniqueid']]=_0x334f03;this['emitVoiceQueueChannelRemove'](_0x334f03);}}}catch(_0xa71238){logger[_0x78d9('0x3d')](_0x78d9('0x7c'),util[_0x78d9('0x46')](_0xa71238,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1d')]=function(_0x1dd6ea){try{if(this[_0x78d9('0x5d')](_0x1dd6ea)){if(this[_0x78d9('0x3f')][_0x1dd6ea[_0x78d9('0x6b')]]){var _0x3ee789=_[_0x78d9('0x74')](this['queueReports'][_0x1dd6ea[_0x78d9('0x6b')]]);_0x3ee789[_0x78d9('0x7d')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x3ee789['connectedlinenum']=_0x1dd6ea[_0x78d9('0x7e')];_0x3ee789[_0x78d9('0x7f')]=_0x1dd6ea['connectedlinename'];this[_0x78d9('0x11')][_0x1dd6ea['uniqueid']]=_0x3ee789;this[_0x78d9('0x47')](_0x3ee789);}}}catch(_0x15e649){logger['error']('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x78d9('0x46')](_0x15e649,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x20')]=function(_0x15755e){try{if(this['isNotNull'](_0x15755e)){if(this['queueReports'][_0x15755e[_0x78d9('0x6b')]]){var _0x34a9ce=_[_0x78d9('0x74')](this['queueReports'][_0x15755e['uniqueid']]);_0x34a9ce[_0x78d9('0x75')]=!![];_0x34a9ce['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x2d419a){logger[_0x78d9('0x3d')](_0x78d9('0x80'),util[_0x78d9('0x46')](_0x2d419a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1e')]=function(_0x3bc592){try{if(this['isNotNull'](_0x3bc592)){if(this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]){var _0x16b16e=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]);_0x16b16e[_0x78d9('0x1b')]=![];_0x16b16e[_0x78d9('0x79')]=null;_0x16b16e[_0x78d9('0x81')]=!![];_0x16b16e[_0x78d9('0x82')]=_0x3bc592[_0x78d9('0x83')];_0x16b16e[_0x78d9('0x77')]=_0x3bc592['holdtime'];_0x16b16e[_0x78d9('0x75')]=!![];_0x16b16e[_0x78d9('0x84')]=![];_0x16b16e[_0x78d9('0x85')]=null;if(!_0x16b16e['transfer']){if(_0x3bc592[_0x78d9('0x86')]==_0x78d9('0x87')){_0x16b16e['queuecallerexitreason']='COMPLETED';}else{if(_[_0x78d9('0x88')](_0x3bc592[_0x78d9('0x39')][_0x78d9('0x89')](),_0x78d9('0x8a'))){if(this[_0x78d9('0x3f')][_0x3bc592['linkedid']]){var _0x3e500e=_['last'](this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x8b')]]);_0x3e500e[_0x78d9('0x75')]=![];_0x3e500e[_0x78d9('0x84')]=!![];_0x3e500e[_0x78d9('0x85')]=moment(_0x16b16e['queuecallerjoinAt'])[_0x78d9('0x8c')](_0x3bc592[_0x78d9('0x77')],_0x78d9('0x8d'))['format'](_0x78d9('0x6d'));_0x3e500e[_0x78d9('0x7a')]=_0x78d9('0x8e');_0x3e500e[_0x78d9('0x87')]=!![];_0x3e500e[_0x78d9('0x8f')]=_0x78d9('0x90');_0x3e500e[_0x78d9('0x91')]=_0x3bc592[_0x78d9('0x92')];_0x3e500e['transferuniqueid']=_0x3bc592['uniqueid'];var _0x43c8b3=this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x8b')]];this['queueReports'][_0x3bc592[_0x78d9('0x8b')]]=this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]];this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]=_0x43c8b3;}}else{_0x16b16e[_0x78d9('0x7a')]=_0x78d9('0x93')+_0x3bc592[_0x78d9('0x86')][_0x78d9('0x94')]();}}}this['channels'][_0x3bc592[_0x78d9('0x6b')]]=_0x16b16e;this[_0x78d9('0x45')](_0x16b16e);}}}catch(_0x4e9922){logger[_0x78d9('0x3d')](_0x78d9('0x95'),util[_0x78d9('0x46')](_0x4e9922,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')]['syncVarSet']=function(_0x508ae3){try{if(this[_0x78d9('0x5d')](_0x508ae3)){this[_0x78d9('0x96')](_0x508ae3[_0x78d9('0x6b')],_[_0x78d9('0x72')](_0x508ae3['variable'])[0x0],_0x508ae3['value']);if(this['queueReports'][_0x508ae3[_0x78d9('0x6b')]]){var _0x428d8f=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x508ae3[_0x78d9('0x6b')]]);if(_0x428d8f){if(this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')])&&this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')]['queuestatus'])){switch(_0x508ae3[_0x78d9('0x98')]){case _0x78d9('0x99'):_0x428d8f['queuecallerexit']=![];_0x428d8f[_0x78d9('0x85')]=null;break;default:_0x428d8f[_0x78d9('0x84')]=!![];_0x428d8f[_0x78d9('0x85')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x428d8f[_0x78d9('0x7d')]=moment()['format'](_0x78d9('0x6d'));}_0x428d8f[_0x78d9('0x1b')]=![];_0x428d8f[_0x78d9('0x79')]=null;_0x428d8f['queuecallerexitreason']=_0x508ae3['value'];this['channels'][_0x508ae3[_0x78d9('0x6b')]]=_0x428d8f;this[_0x78d9('0x45')](_0x428d8f);}else if(this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')])&&this['isNotNull'](_0x508ae3[_0x78d9('0x97')][_0x78d9('0x9a')])){if(!_0x428d8f[_0x78d9('0x1b')]){_0x428d8f[_0x78d9('0x84')]=!![];_0x428d8f[_0x78d9('0x85')]=moment()['format'](_0x78d9('0x6d'));_0x428d8f[_0x78d9('0x7a')]=_0x78d9('0x9b');_0x428d8f['queuecallerleaveAt']=moment()['format'](_0x78d9('0x6d'));this[_0x78d9('0x11')][_0x508ae3[_0x78d9('0x6b')]]=_0x428d8f;}}_0x428d8f[_0x78d9('0x41')]=this['variables'][_0x508ae3['uniqueid']];}}}}catch(_0x1c4b66){logger[_0x78d9('0x3d')](_0x78d9('0x9c'),util[_0x78d9('0x46')](_0x1c4b66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x96')]=function(_0xa6406d,_0x29b61e,_0x3b158d){var _0x5e15ad=[_0x78d9('0x9d'),_0x78d9('0x9e'),_0x78d9('0x9f'),_0x78d9('0xa0'),_0x78d9('0xa1'),_0x78d9('0xa2'),_0x78d9('0xa3'),_0x78d9('0xa4'),'sipcallid',_0x78d9('0xa5'),_0x78d9('0xa6'),_0x78d9('0xa7'),_0x78d9('0xa8'),_0x78d9('0xa9'),'memberinterface',_0x78d9('0xaa'),_0x78d9('0x83'),'memberpenalty',_0x78d9('0xab')];if(!_[_0x78d9('0x36')](_0x29b61e)&&!_['includes'](_0x5e15ad,_0x29b61e)){if(_[_0x78d9('0x2b')](this['variables'][_0xa6406d])){this[_0x78d9('0x41')][_0xa6406d]={};}this[_0x78d9('0x41')][_0xa6406d][_0x29b61e]=_0x3b158d;}};VoiceQueueReport['prototype'][_0x78d9('0x22')]=function(_0x4a3945){try{if(this[_0x78d9('0x5d')](_0x4a3945)){if(this['queueReports'][_0x4a3945['uniqueid']]){for(var _0xbd0e4c=0x0,_0x60de4f={};_0xbd0e4c0x0?_0x264b80:0x0;this['voiceQueues'][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]=this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]][_0xbcf3('0x2e')]>_[_0xbcf3('0x5d')](_0x5813b7[_0xbcf3('0x5e')])?_['toNumber'](_0x5813b7[_0xbcf3('0x5e')]):this[_0xbcf3('0x13')][_0x5813b7['queue']][_0xbcf3('0x2e')];this[_0xbcf3('0x44')](this[_0xbcf3('0x13')][_0x5813b7['queue']]);}ami[_0xbcf3('0x3d')](_0xbcf3('0x5f'),this[_0xbcf3('0x13')][_0x5813b7[_0xbcf3('0x5b')]]);}}}catch(_0x5ef36b){logger[_0xbcf3('0x38')]('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x5ef36b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x18')]=function(_0x36497c){this['flagQueueSummary']=!![];};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x60')]=function(_0x59cc93){};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1a')]=function(_0x24a2c4){try{if(this[_0xbcf3('0x53')](_0x24a2c4)){if(_[_0xbcf3('0x2a')](this['queueReports'][_0x24a2c4['uniqueid']])){this[_0xbcf3('0xf')][_0x24a2c4['uniqueid']]=[];this[_0xbcf3('0x11')][_0x24a2c4['uniqueid']]={};}var _0x459150=new QueueReport();_0x459150[_0xbcf3('0x41')]=_0x24a2c4[_0xbcf3('0x5b')];_0x459150['type']=this[_0xbcf3('0x13')][_0x459150[_0xbcf3('0x41')]]&&this['voiceQueues'][_0x459150[_0xbcf3('0x41')]][_0xbcf3('0x61')]?this[_0xbcf3('0x13')][_0x459150[_0xbcf3('0x41')]][_0xbcf3('0x61')]||_0xbcf3('0x45'):_0xbcf3('0x45');_0x459150[_0xbcf3('0x5b')]=_0x24a2c4[_0xbcf3('0x5b')];_0x459150[_0xbcf3('0x62')]=moment()[_0xbcf3('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x459150['position']=_0x24a2c4['position'];_0x459150[_0xbcf3('0x63')]=_0x24a2c4[_0xbcf3('0x63')];_[_0xbcf3('0x64')](_0x459150,_['pick'](_0x24a2c4,_[_0xbcf3('0x65')](_0x459150)));this['queueReports'][_0x24a2c4[_0xbcf3('0x66')]][_0xbcf3('0x67')](_0x459150);this[_0xbcf3('0x11')][_0x24a2c4['uniqueid']]=_0x459150;this[_0xbcf3('0x3e')](_0x459150);}}catch(_0x1ec634){logger[_0xbcf3('0x38')](_0xbcf3('0x68'),util[_0xbcf3('0x69')](_0x1ec634,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1b')]=function(_0x57225b){try{if(this[_0xbcf3('0x53')](_0x57225b)){if(this[_0xbcf3('0xf')][_0x57225b[_0xbcf3('0x66')]]){var _0x30bc6d=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x57225b[_0xbcf3('0x66')]]);_0x30bc6d[_0xbcf3('0x6b')]=![];_0x30bc6d[_0xbcf3('0x6c')]=null;_0x30bc6d['holdtime']=_0x57225b[_0xbcf3('0x6d')];_0x30bc6d['originalposition']=_0x57225b[_0xbcf3('0x6e')];_0x30bc6d[_0xbcf3('0x6f')]=!![];_0x30bc6d[_0xbcf3('0x70')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x30bc6d[_0xbcf3('0x72')]=_0xbcf3('0x73');_0x30bc6d[_0xbcf3('0x74')]=null;this[_0xbcf3('0x11')][_0x57225b[_0xbcf3('0x66')]]=_0x30bc6d;this[_0xbcf3('0x3c')](_0x30bc6d);}}}catch(_0x14a058){logger[_0xbcf3('0x38')](_0xbcf3('0x75'),util[_0xbcf3('0x69')](_0x14a058,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['syncQueueCallerLeave']=function(_0x2d7bb2){try{if(this[_0xbcf3('0x53')](_0x2d7bb2)){if(this[_0xbcf3('0xf')][_0x2d7bb2[_0xbcf3('0x66')]]){var _0x48a34a=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x2d7bb2[_0xbcf3('0x66')]]);_0x48a34a[_0xbcf3('0x76')]=moment()['format'](_0xbcf3('0x71'));_0x48a34a[_0xbcf3('0x77')]=_0x2d7bb2['connectedlinenum'];_0x48a34a[_0xbcf3('0x78')]=_0x2d7bb2[_0xbcf3('0x78')];this[_0xbcf3('0x11')][_0x2d7bb2[_0xbcf3('0x66')]]=_0x48a34a;this[_0xbcf3('0x3e')](_0x48a34a);}}}catch(_0x545670){logger[_0xbcf3('0x38')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xbcf3('0x69')](_0x545670,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x1aa8a3){try{if(this[_0xbcf3('0x53')](_0x1aa8a3)){if(this[_0xbcf3('0xf')][_0x1aa8a3[_0xbcf3('0x66')]]){var _0x23a815=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x1aa8a3[_0xbcf3('0x66')]]);_0x23a815[_0xbcf3('0x6b')]=!![];_0x23a815[_0xbcf3('0x72')]=_0xbcf3('0x79');}}}catch(_0x2cf7a3){logger[_0xbcf3('0x38')](_0xbcf3('0x7a'),util[_0xbcf3('0x69')](_0x2cf7a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')][_0xbcf3('0x1f')]=function(_0x4e354a){try{if(this[_0xbcf3('0x53')](_0x4e354a)){if(this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x66')]]){var _0x27a44a=_['last'](this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x66')]]);_0x27a44a[_0xbcf3('0x6f')]=![];_0x27a44a[_0xbcf3('0x70')]=null;_0x27a44a[_0xbcf3('0x7b')]=!![];_0x27a44a[_0xbcf3('0x74')]=_0x4e354a[_0xbcf3('0x7c')];_0x27a44a['holdtime']=_0x4e354a[_0xbcf3('0x6d')];_0x27a44a[_0xbcf3('0x6b')]=!![];_0x27a44a[_0xbcf3('0x7d')]=![];_0x27a44a['queuecallerexitAt']=null;if(!_0x27a44a[_0xbcf3('0x7e')]){if(_0x4e354a[_0xbcf3('0x7f')]==_0xbcf3('0x7e')){_0x27a44a[_0xbcf3('0x72')]=_0xbcf3('0x80');}else{if(_[_0xbcf3('0x81')](_0x4e354a['channel'][_0xbcf3('0x82')](),_0xbcf3('0x83'))){if(this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]]){var _0x4a04f3=_[_0xbcf3('0x6a')](this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]]);_0x4a04f3[_0xbcf3('0x6b')]=![];_0x4a04f3[_0xbcf3('0x7d')]=!![];_0x4a04f3['queuecallerexitAt']=moment(_0x27a44a[_0xbcf3('0x62')])[_0xbcf3('0x85')](_0x4e354a['holdtime'],_0xbcf3('0x86'))[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x4a04f3['queuecallerexitreason']=_0xbcf3('0x87');_0x4a04f3[_0xbcf3('0x7e')]=!![];_0x4a04f3[_0xbcf3('0x88')]=_0xbcf3('0x89');_0x4a04f3[_0xbcf3('0x8a')]=_0x4e354a[_0xbcf3('0x8b')];_0x4a04f3['transferuniqueid']=_0x4e354a['uniqueid'];var _0x407433=this[_0xbcf3('0xf')][_0x4e354a[_0xbcf3('0x84')]];this[_0xbcf3('0xf')][_0x4e354a['linkedid']]=this[_0xbcf3('0xf')][_0x4e354a['uniqueid']];this[_0xbcf3('0xf')][_0x4e354a['uniqueid']]=_0x407433;}}else{_0x27a44a[_0xbcf3('0x72')]='COMPLETEDBY'+_0x4e354a[_0xbcf3('0x7f')]['toUpperCase']();}}}this['channels'][_0x4e354a[_0xbcf3('0x66')]]=_0x27a44a;this[_0xbcf3('0x3c')](_0x27a44a);}}}catch(_0x61264b){logger[_0xbcf3('0x38')](_0xbcf3('0x8c'),util[_0xbcf3('0x69')](_0x61264b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['syncVarSet']=function(_0xc2a923){try{if(this[_0xbcf3('0x53')](_0xc2a923)){this[_0xbcf3('0x8d')](_0xc2a923[_0xbcf3('0x66')],_[_0xbcf3('0x65')](_0xc2a923[_0xbcf3('0x8e')])[0x0],_0xc2a923[_0xbcf3('0x8f')]);if(this['queueReports'][_0xc2a923['uniqueid']]){var _0x36a40a=_[_0xbcf3('0x6a')](this['queueReports'][_0xc2a923[_0xbcf3('0x66')]]);if(_0x36a40a){if(this[_0xbcf3('0x53')](_0xc2a923['variable'])&&this['isNotNull'](_0xc2a923[_0xbcf3('0x8e')][_0xbcf3('0x90')])){switch(_0xc2a923[_0xbcf3('0x8f')]){case'CONTINUE':_0x36a40a[_0xbcf3('0x7d')]=![];_0x36a40a['queuecallerexitAt']=null;break;default:_0x36a40a[_0xbcf3('0x7d')]=!![];_0x36a40a[_0xbcf3('0x91')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x36a40a[_0xbcf3('0x76')]=moment()['format'](_0xbcf3('0x71'));}_0x36a40a[_0xbcf3('0x6f')]=![];_0x36a40a['queuecallerabandonAt']=null;_0x36a40a[_0xbcf3('0x72')]=_0xc2a923['value'];this[_0xbcf3('0x11')][_0xc2a923[_0xbcf3('0x66')]]=_0x36a40a;this[_0xbcf3('0x3c')](_0x36a40a);}else if(this['isNotNull'](_0xc2a923[_0xbcf3('0x8e')])&&this[_0xbcf3('0x53')](_0xc2a923[_0xbcf3('0x8e')][_0xbcf3('0x92')])){if(!_0x36a40a[_0xbcf3('0x6f')]){_0x36a40a[_0xbcf3('0x7d')]=!![];_0x36a40a[_0xbcf3('0x91')]=moment()[_0xbcf3('0x3f')](_0xbcf3('0x71'));_0x36a40a[_0xbcf3('0x72')]=_0xbcf3('0x93');_0x36a40a[_0xbcf3('0x76')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xbcf3('0x11')][_0xc2a923['uniqueid']]=_0x36a40a;}}_0x36a40a['variables']=this[_0xbcf3('0x39')][_0xc2a923[_0xbcf3('0x66')]];}}}}catch(_0x2b1f2f){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0xbcf3('0x69')](_0x2b1f2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbcf3('0xa')]['addVariable']=function(_0xaf4f04,_0x3c9881,_0x49175b){var _0x2f4803=[_0xbcf3('0x94'),'rtpaudioqosbridged',_0xbcf3('0x95'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xbcf3('0x96'),_0xbcf3('0x97'),_0xbcf3('0x98'),_0xbcf3('0x99'),_0xbcf3('0x9a'),_0xbcf3('0x9b'),_0xbcf3('0x9c'),_0xbcf3('0x9d'),'memberinterface',_0xbcf3('0x9e'),'membername','memberpenalty','memberrealtime'];if(!_[_0xbcf3('0x34')](_0x3c9881)&&!_[_0xbcf3('0x9f')](_0x2f4803,_0x3c9881)){if(_['isUndefined'](this[_0xbcf3('0x39')][_0xaf4f04])){this[_0xbcf3('0x39')][_0xaf4f04]={};}this['variables'][_0xaf4f04][_0x3c9881]=_0x49175b;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x4c8fd8){try{if(this[_0xbcf3('0x53')](_0x4c8fd8)){if(this[_0xbcf3('0xf')][_0x4c8fd8[_0xbcf3('0x66')]]){for(var _0x1e04fd=0x0,_0x5c20bb={};_0x1e04fd=0x0?moment(_0x3c6e49[_0x66d9('0x19')])[_0x66d9('0x1a')](_0x3c6e49[_0x66d9('0x18')],_0x66d9('0x1b')):null,'data1':_0x66d9('0x1c'),'data2':_0x3c6e49[_0x66d9('0x13')],'data3':_0x3c6e49[_0x66d9('0x11')],'data4':_0x3c6e49[_0x66d9('0x1d')]||null,'role':'agent','internal':_0x3c6e49[_0x66d9('0x13')]?_[_0x66d9('0x14')](_0x3c6e49[_0x66d9('0x13')]):undefined,'uniqueid':_0x3c6e49[_0x66d9('0x15')]},'log':_0x66d9('0x7')});}; \ No newline at end of file +var _0xf80b=['exten','dialstring','uniqueid','moment','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','membername','starttime','endtime','outbound'];(function(_0xb75426,_0x2d8a2b){var _0x4d32f0=function(_0x25dbda){while(--_0x25dbda){_0xb75426['push'](_0xb75426['shift']());}};_0x4d32f0(++_0x2d8a2b);}(_0xf80b,0x153));var _0xbf80=function(_0x39589,_0x25b6f3){_0x39589=_0x39589-0x0;var _0x903fc1=_0xf80b[_0x39589];return _0x903fc1;};'use strict';var moment=require(_0xbf80('0x0'));var _=require('lodash');var util=require(_0xbf80('0x1'));var client=require(_0xbf80('0x2'));exports[_0xbf80('0x3')]=function(_0x3aa929){var _0x8f5bd3=_0x3aa929['queuecallercompleteAt']||_0x3aa929[_0xbf80('0x4')];return client[_0xbf80('0x5')](_0xbf80('0x6'),{'body':{'channel':_0xbf80('0x7'),'membername':_0x3aa929['lastAssignedTo'],'interface':_[_0xbf80('0x8')](_0x3aa929[_0xbf80('0x9')])?util[_0xbf80('0xa')](_0xbf80('0xb'),_0x3aa929['lastAssignedTo']):_0x3aa929[_0xbf80('0x9')],'type':_0xbf80('0xc'),'enterAt':_0x3aa929[_0xbf80('0xd')],'exitAt':_0x8f5bd3,'duration':moment(_0x8f5bd3)['diff'](_0x3aa929[_0xbf80('0xd')],_0xbf80('0xe')),'data1':_0xbf80('0xf'),'data2':_0x3aa929[_0xbf80('0x10')],'data3':_0x3aa929['exten'],'data4':null,'data5':_0x3aa929[_0xbf80('0x11')],'role':_0xbf80('0x12'),'internal':_0x3aa929[_0xbf80('0x13')]?_[_0xbf80('0x14')](_0x3aa929[_0xbf80('0x13')]):undefined,'uniqueid':_0x3aa929['uniqueid']},'log':_0xbf80('0x6')});};exports['voiceDialReport']=function(_0x2268fc){return client[_0xbf80('0x5')](_0xbf80('0x6'),{'body':{'channel':_0xbf80('0x7'),'membername':_0x2268fc[_0xbf80('0x15')],'interface':_0x2268fc['interface'],'type':'TALKING','enterAt':_0x2268fc[_0xbf80('0x16')],'exitAt':_0x2268fc['endtime'],'duration':moment(_0x2268fc[_0xbf80('0x17')])['diff'](_0x2268fc[_0xbf80('0x16')],_0xbf80('0xe'))>=0x0?moment(_0x2268fc[_0xbf80('0x17')])['diff'](_0x2268fc[_0xbf80('0x16')],_0xbf80('0xe')):null,'data1':_0xbf80('0x18'),'data2':_0x2268fc['accountcode'],'data3':_0x2268fc[_0xbf80('0x19')],'data4':_0x2268fc[_0xbf80('0x1a')]||null,'role':'agent','internal':_0x2268fc['accountcode']?_[_0xbf80('0x14')](_0x2268fc[_0xbf80('0x13')]):undefined,'uniqueid':_0x2268fc[_0xbf80('0x1b')]},'log':_0xbf80('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f5fe597..dffcc67 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 _0x3e52=['getTemplates','Request','GetTemplate','../client'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x3e52,0x1af));var _0x23e5=function(_0x55380f,_0x334be7){_0x55380f=_0x55380f-0x0;var _0x52839c=_0x3e52[_0x55380f];return _0x52839c;};'use strict';var client=require(_0x23e5('0x0'));exports[_0x23e5('0x1')]=function(_0x34e3bc){return function(_0x437fcc){return client[_0x23e5('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x23e5('0x3')});};}; \ No newline at end of file +var _0xc564=['html','../client','getTemplates','GetTemplate'];(function(_0x1ee2c3,_0x1ee21e){var _0x352d97=function(_0x215b77){while(--_0x215b77){_0x1ee2c3['push'](_0x1ee2c3['shift']());}};_0x352d97(++_0x1ee21e);}(_0xc564,0x145));var _0x4c56=function(_0x24b75b,_0x19b7fc){_0x24b75b=_0x24b75b-0x0;var _0x1c63f4=_0xc564[_0x24b75b];return _0x1c63f4;};'use strict';var client=require(_0x4c56('0x0'));exports[_0x4c56('0x1')]=function(_0x5815b0){return function(_0x35d3e8){return client['Request'](_0x4c56('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x4c56('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 5b13958..776c090 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x247967,_0x583f62){var _0x148861=function(_0x21117d){while(--_0x21117d){_0x247967['push'](_0x247967['shift']());}};_0x148861(++_0x583f62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x1584ae,_0x5270a4){var _0x417d41=function(_0x3ca67f){while(--_0x3ca67f){_0x1584ae['push'](_0x1584ae['shift']());}};_0x417d41(++_0x5270a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 97feef8..20ab77e 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 _0x87a4=['name','registry','getTrunks','Request','GetTrunk'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x87a4,0xc0));var _0x487a=function(_0x5289c3,_0x56714c){_0x5289c3=_0x5289c3-0x0;var _0x30f1a2=_0x87a4[_0x5289c3];return _0x30f1a2;};'use strict';var client=require('../client');exports[_0x487a('0x0')]=function(_0x40a4ad){return function(_0x11fed0){return client[_0x487a('0x1')](_0x487a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x487a('0x3'),_0x487a('0x4')]},'log':_0x487a('0x2')});};}; \ No newline at end of file +var _0x0014=['GetTrunk','name','getTrunks'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0014,0x1ca));var _0x4001=function(_0x10d2a8,_0xefc4dc){_0x10d2a8=_0x10d2a8-0x0;var _0xbc0636=_0x0014[_0x10d2a8];return _0xbc0636;};'use strict';var client=require('../client');exports[_0x4001('0x0')]=function(_0x10ef3b){return function(_0x872343){return client['Request'](_0x4001('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4001('0x2'),'registry']},'log':_0x4001('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 78cb039..c3f5d3c 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 _0xf155=['Request','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','accountcode','interface','../client','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','getAgents','getTelephones'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xf155,0x169));var _0x5f15=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf155[_0x4ff09b];return _0x3f5c2e;};'use strict';var client=require(_0x5f15('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x5f15('0x1'),{'options':{'raw':![],'where':{'role':_0x5f15('0x2')},'attributes':['id',_0x5f15('0x3'),_0x5f15('0x4'),'accountcode',_0x5f15('0x5'),_0x5f15('0x6'),_0x5f15('0x7'),_0x5f15('0x8'),_0x5f15('0x9'),_0x5f15('0xa'),'phone','mobile','interface']},'log':_0x5f15('0xb')});};};exports[_0x5f15('0xc')]=function(){return function(){return client[_0x5f15('0xd')](_0x5f15('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name','accountcode',_0x5f15('0xe')]},'log':'getTelephones'});};};exports[_0x5f15('0xf')]=function(_0x38a04b,_0x5bbc64,_0x4a9915){return client['Request'](_0x5f15('0x10'),{'body':{'type':_0x5bbc64,'uniqueid':_0x4a9915},'options':{'where':{'id':_0x38a04b['id']}},'log':_0x5f15('0xf')});};exports[_0x5f15('0x11')]=function(_0x2c69b4){return client['Request'](_0x5f15('0x12'),{'body':{},'options':{'where':{'id':_0x2c69b4['id']}},'log':_0x5f15('0xf')});};exports[_0x5f15('0x13')]=function(_0x48ea96){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x5f15('0x2'),'id':_0x48ea96},'attributes':['id','name',_0x5f15('0x4'),_0x5f15('0x14'),_0x5f15('0x5'),_0x5f15('0x6'),_0x5f15('0x7'),'pauseType','lastPauseAt','voicePause',_0x5f15('0x15')]},'log':'getAgent'});}; \ No newline at end of file +var _0xc33d=['phone','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','getAgent','voicePause','getAgents','Request','agent','name','email','accountcode','online','lastLoginAt','pauseType','lastPauseAt'];(function(_0x1476df,_0x4ed81f){var _0x2cf680=function(_0x85d227){while(--_0x85d227){_0x1476df['push'](_0x1476df['shift']());}};_0x2cf680(++_0x4ed81f);}(_0xc33d,0x96));var _0xdc33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc33d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xdc33('0x0')]=function(){return function(){return client[_0xdc33('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':_0xdc33('0x2')},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x4'),_0xdc33('0x5'),'fullname',_0xdc33('0x6'),_0xdc33('0x7'),_0xdc33('0x8'),_0xdc33('0x9'),'voicePause',_0xdc33('0xa'),'mobile',_0xdc33('0xb')]},'log':_0xdc33('0x0')});};};exports[_0xdc33('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xdc33('0xd')},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x5'),_0xdc33('0xe')]},'log':'getTelephones'});};};exports[_0xdc33('0xf')]=function(_0x489104,_0x92dc73,_0xe0c4ac){return client[_0xdc33('0x1')](_0xdc33('0x10'),{'body':{'type':_0x92dc73,'uniqueid':_0xe0c4ac},'options':{'where':{'id':_0x489104['id']}},'log':_0xdc33('0xf')});};exports[_0xdc33('0x11')]=function(_0x198015){return client['Request']('UnpauseUser',{'body':{},'options':{'where':{'id':_0x198015['id']}},'log':_0xdc33('0xf')});};exports[_0xdc33('0x12')]=function(_0x40810e){return client[_0xdc33('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0xdc33('0x2'),'id':_0x40810e},'attributes':['id',_0xdc33('0x3'),_0xdc33('0x4'),'accountcode','fullname',_0xdc33('0x6'),_0xdc33('0x7'),_0xdc33('0x8'),_0xdc33('0x9'),_0xdc33('0x13'),'interface']},'log':_0xdc33('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 3821554..b7d0b98 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 _0x7fef=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update','Request'];(function(_0x10204c,_0x5da425){var _0x61345d=function(_0x2a8c56){while(--_0x2a8c56){_0x10204c['push'](_0x10204c['shift']());}};_0x61345d(++_0x5da425);}(_0x7fef,0x141));var _0xf7fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fef[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf7fe('0x0')]=function(_0x2244ab){return client['Request'](_0xf7fe('0x1'),{'body':_0x2244ab,'log':'CreateVoiceAgentReport'});};exports[_0xf7fe('0x2')]=function(_0x52eb69,_0x5138db,_0x51d7f9){return client[_0xf7fe('0x3')](_0xf7fe('0x4'),{'body':_0x52eb69,'options':{'where':{'uniqueid':_0x5138db,'interface':_0x51d7f9}},'log':_0xf7fe('0x4')});}; \ No newline at end of file +var _0x825a=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x825a,0x187));var _0xa825=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x825a[_0x10791d];return _0x1b4f9c;};'use strict';var client=require(_0xa825('0x0'));exports[_0xa825('0x1')]=function(_0x2da3a2){return client[_0xa825('0x2')](_0xa825('0x3'),{'body':_0x2da3a2,'log':'CreateVoiceAgentReport'});};exports[_0xa825('0x4')]=function(_0x3cf26d,_0xd43259,_0x8af563){return client['Request'](_0xa825('0x5'),{'body':_0x3cf26d,'options':{'where':{'uniqueid':_0xd43259,'interface':_0x8af563}},'log':_0xa825('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a0d9128..1305f4d 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 _0x0823=['duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type'];(function(_0x304aca,_0x4f8e0b){var _0x3b811c=function(_0x3f6c71){while(--_0x3f6c71){_0x304aca['push'](_0x304aca['shift']());}};_0x3b811c(++_0x4f8e0b);}(_0x0823,0x12f));var _0x3082=function(_0x4c4ca2,_0x30d812){_0x4c4ca2=_0x4c4ca2-0x0;var _0x17dac3=_0x0823[_0x4c4ca2];return _0x17dac3;};'use strict';var moment=require('moment');var util=require(_0x3082('0x0'));var _=require(_0x3082('0x1'));var client=require(_0x3082('0x2'));exports[_0x3082('0x3')]=function(_0x2be000){return client[_0x3082('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x2be000,{'source':_0x2be000[_0x3082('0x5')],'destinationcontext':_0x2be000[_0x3082('0x6')],'callerid':_0x2be000[_0x3082('0x7')],'amaflags':_0x3082('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x3082('0x9')]=function(){return function(){return client[_0x3082('0x4')](_0x3082('0xa'),{'options':{'where':{'type':[_0x3082('0xb')],'createdAt':{'$between':[moment()[_0x3082('0xc')]('day')[_0x3082('0xd')](_0x3082('0xe')),moment()['endOf'](_0x3082('0xf'))[_0x3082('0xd')](_0x3082('0xe'))]}},'attributes':[_0x3082('0x10'),'disposition',_0x3082('0x11'),_0x3082('0x12')]},'log':_0x3082('0x13')});};}; \ No newline at end of file +var _0x3a21=['DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','callerid'];(function(_0x11d965,_0x463c0e){var _0x16db5b=function(_0x376893){while(--_0x376893){_0x11d965['push'](_0x11d965['shift']());}};_0x16db5b(++_0x463c0e);}(_0x3a21,0xca));var _0x13a2=function(_0x1c7968,_0x4ef3d9){_0x1c7968=_0x1c7968-0x0;var _0x1432b2=_0x3a21[_0x1c7968];return _0x1432b2;};'use strict';var moment=require('moment');var util=require(_0x13a2('0x0'));var _=require(_0x13a2('0x1'));var client=require(_0x13a2('0x2'));exports['create']=function(_0x1dca05){return client['Request'](_0x13a2('0x3'),{'body':_[_0x13a2('0x4')](_0x1dca05,{'source':_0x1dca05[_0x13a2('0x5')],'destinationcontext':_0x1dca05[_0x13a2('0x6')],'callerid':_0x1dca05[_0x13a2('0x7')],'amaflags':_0x13a2('0x8')}),'log':_0x13a2('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x13a2('0x9')](_0x13a2('0xa'),{'options':{'where':{'type':[_0x13a2('0xb')],'createdAt':{'$between':[moment()[_0x13a2('0xc')](_0x13a2('0xd'))[_0x13a2('0xe')](_0x13a2('0xf')),moment()[_0x13a2('0x10')]('day')['format'](_0x13a2('0xf'))]}},'attributes':[_0x13a2('0x11'),_0x13a2('0x12'),'duration',_0x13a2('0x13')]},'log':_0x13a2('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 027e629..96ad23d 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 _0x075b=['CreateVoiceDialReport','create','Request'];(function(_0xf8e8f0,_0xad0cd7){var _0x47956a=function(_0x341cfd){while(--_0x341cfd){_0xf8e8f0['push'](_0xf8e8f0['shift']());}};_0x47956a(++_0xad0cd7);}(_0x075b,0x142));var _0xb075=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x075b[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0xb075('0x0')]=function(_0x4d6b53){return client[_0xb075('0x1')](_0xb075('0x2'),{'body':_0x4d6b53,'log':_0xb075('0x2')});}; \ No newline at end of file +var _0x1eb6=['../client','create','CreateVoiceDialReport'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0x1eb6,0xcc));var _0x61eb=function(_0x36fd2f,_0x94d493){_0x36fd2f=_0x36fd2f-0x0;var _0x130db9=_0x1eb6[_0x36fd2f];return _0x130db9;};'use strict';var client=require(_0x61eb('0x0'));exports[_0x61eb('0x1')]=function(_0x4e1b2c){return client['Request'](_0x61eb('0x2'),{'body':_0x4e1b2c,'log':_0x61eb('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2e5882d..f0db0c9 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 _0xac12=['recordingFormat','getVoiceExtensions','../client','GetVoiceExtension','exten'];(function(_0x383ac6,_0x48711c){var _0x3cbabd=function(_0xa328a7){while(--_0xa328a7){_0x383ac6['push'](_0x383ac6['shift']());}};_0x3cbabd(++_0x48711c);}(_0xac12,0xc0));var _0x2ac1=function(_0x2519cb,_0x139ade){_0x2519cb=_0x2519cb-0x0;var _0x28aab8=_0xac12[_0x2519cb];return _0x28aab8;};'use strict';var client=require(_0x2ac1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x2ac1('0x1'),{'options':{'raw':!![],'attributes':['id',_0x2ac1('0x2'),_0x2ac1('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x2ac1('0x4')});};}; \ No newline at end of file +var _0xe0da=['exten','recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x4b4983,_0xa9ee1f){var _0x5ceab7=function(_0x308324){while(--_0x308324){_0x4b4983['push'](_0x4b4983['shift']());}};_0x5ceab7(++_0xa9ee1f);}(_0xe0da,0x16f));var _0xae0d=function(_0xeebb33,_0xf4e7c4){_0xeebb33=_0xeebb33-0x0;var _0x57209d=_0xe0da[_0xeebb33];return _0x57209d;};'use strict';var client=require('../client');exports[_0xae0d('0x0')]=function(){return function(){return client[_0xae0d('0x1')](_0xae0d('0x2'),{'options':{'raw':!![],'attributes':['id',_0xae0d('0x3'),_0xae0d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xae0d('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 5742d7d..4d3a7f3 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 _0x1849=['dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1849,0x19e));var _0x9184=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1849[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x9184('0x0'));exports[_0x9184('0x1')]=function(){return function(){return client[_0x9184('0x2')](_0x9184('0x3'),{'options':{'raw':![],'attributes':['id',_0x9184('0x4'),_0x9184('0x5'),_0x9184('0x6'),_0x9184('0x7'),_0x9184('0x8'),_0x9184('0x9'),'dialActive',_0x9184('0xa'),_0x9184('0xb'),_0x9184('0xc'),'dialPowerLevel',_0x9184('0xd'),_0x9184('0xe'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x9184('0xf'),_0x9184('0x10'),'dialQueueTimeout',_0x9184('0x11'),_0x9184('0x12'),_0x9184('0x13'),'dialBusyMaxRetry',_0x9184('0x14'),_0x9184('0x15'),_0x9184('0x16'),_0x9184('0x17'),_0x9184('0x18'),_0x9184('0x19'),'dialPrefix',_0x9184('0x1a'),_0x9184('0x1b'),'dialAMDInitialSilence',_0x9184('0x1c'),_0x9184('0x1d'),_0x9184('0x1e'),_0x9184('0x1f'),_0x9184('0x20'),'dialAMDMaximumNumberOfWords',_0x9184('0x21'),_0x9184('0x22'),_0x9184('0x23'),_0x9184('0x24'),_0x9184('0x25'),'dialOrderByScheduledAt',_0x9184('0x26'),'dialAgiAfterHangupClient',_0x9184('0x27'),_0x9184('0x8'),_0x9184('0x28'),_0x9184('0x29'),_0x9184('0x2a'),_0x9184('0x2b'),_0x9184('0x2c'),_0x9184('0x2d')],'include':[{'model':_0x9184('0x2e'),'as':_0x9184('0x2e'),'attributes':['id','name',_0x9184('0x2f'),_0x9184('0x30')]},{'model':'Pause','as':_0x9184('0x31'),'attributes':['id',_0x9184('0x4')]},{'model':_0x9184('0x2e'),'as':'TrunkBackup','attributes':['id',_0x9184('0x4'),_0x9184('0x2f'),_0x9184('0x30')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':_0x9184('0x32'),'as':_0x9184('0x33'),'attributes':['id',_0x9184('0x4'),_0x9184('0x34')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x65cb=['dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel'];(function(_0x44be6d,_0x1cbcb5){var _0x540b5b=function(_0x80459f){while(--_0x80459f){_0x44be6d['push'](_0x44be6d['shift']());}};_0x540b5b(++_0x1cbcb5);}(_0x65cb,0xa4));var _0xb65c=function(_0xc9ab53,_0x424948){_0xc9ab53=_0xc9ab53-0x0;var _0x410bcd=_0x65cb[_0xc9ab53];return _0x410bcd;};'use strict';var client=require(_0xb65c('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb65c('0x1')](_0xb65c('0x2'),{'options':{'raw':![],'attributes':['id',_0xb65c('0x3'),'acw',_0xb65c('0x4'),_0xb65c('0x5'),_0xb65c('0x6'),_0xb65c('0x7'),_0xb65c('0x8'),'dialMethod',_0xb65c('0x9'),_0xb65c('0xa'),_0xb65c('0xb'),_0xb65c('0xc'),_0xb65c('0xd'),_0xb65c('0xe'),_0xb65c('0xf'),_0xb65c('0x10'),'dialOriginateTimeout',_0xb65c('0x11'),_0xb65c('0x12'),_0xb65c('0x13'),_0xb65c('0x14'),'dialCongestionRetryFrequency',_0xb65c('0x15'),'dialBusyRetryFrequency',_0xb65c('0x16'),_0xb65c('0x17'),_0xb65c('0x18'),_0xb65c('0x19'),_0xb65c('0x1a'),_0xb65c('0x1b'),'dialCheckDuplicateType',_0xb65c('0x1c'),_0xb65c('0x1d'),_0xb65c('0x1e'),_0xb65c('0x1f'),_0xb65c('0x20'),_0xb65c('0x21'),_0xb65c('0x22'),'dialAMDMaximumNumberOfWords',_0xb65c('0x23'),_0xb65c('0x24'),'timeout',_0xb65c('0x25'),'dialRecallInQueue',_0xb65c('0x26'),_0xb65c('0x27'),_0xb65c('0x28'),_0xb65c('0x29'),_0xb65c('0x6'),_0xb65c('0x2a'),_0xb65c('0x2b'),_0xb65c('0x2c'),_0xb65c('0x2d'),_0xb65c('0x2e'),_0xb65c('0x2f')],'include':[{'model':_0xb65c('0x30'),'as':_0xb65c('0x30'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x31'),'active']},{'model':_0xb65c('0x32'),'as':_0xb65c('0x33'),'attributes':['id',_0xb65c('0x3')]},{'model':_0xb65c('0x30'),'as':_0xb65c('0x34'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x31'),_0xb65c('0x35')]},{'model':_0xb65c('0x36'),'as':_0xb65c('0x36'),'attributes':['id',_0xb65c('0x3')],'include':[{'model':_0xb65c('0x36'),'as':_0xb65c('0x37'),'attributes':['id',_0xb65c('0x3'),_0xb65c('0x38')]}]}]},'log':_0xb65c('0x39')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 6f77d25..d848933 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 _0x8453=['endOf','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5293c8,_0xab0c3c){var _0x3623fb=function(_0x23ef99){while(--_0x23ef99){_0x5293c8['push'](_0x5293c8['shift']());}};_0x3623fb(++_0xab0c3c);}(_0x8453,0xf2));var _0x3845=function(_0xcabb0a,_0x20707c){_0xcabb0a=_0xcabb0a-0x0;var _0x462917=_0x8453[_0xcabb0a];return _0x462917;};'use strict';var moment=require(_0x3845('0x0'));var _=require(_0x3845('0x1'));var client=require('../client');exports[_0x3845('0x2')]=function(_0x1a8ba3){return client[_0x3845('0x3')](_0x3845('0x4'),{'body':_0x1a8ba3,'log':_0x3845('0x4')});};exports[_0x3845('0x5')]=function(){return function(){return client[_0x3845('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x3845('0x6')](_0x3845('0x7'))[_0x3845('0x8')](_0x3845('0x9')),moment()[_0x3845('0xa')](_0x3845('0x7'))['format'](_0x3845('0x9'))]}},'attributes':['uniqueid','queue','queuecallerjoinAt',_0x3845('0xb'),'queuecallercomplete',_0x3845('0xc'),_0x3845('0xd'),_0x3845('0xe'),_0x3845('0xf'),_0x3845('0x10')]},'log':_0x3845('0x11')});};}; \ No newline at end of file +var _0x25e1=['Request','GetVoiceQueueReport','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','queuecallerleaveAt','queuecallercomplete','queuecallerexit','queuecallerabandon','queuecallerabandonAt','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25e1,0x14f));var _0x125e=function(_0x4d2a99,_0x3649d6){_0x4d2a99=_0x4d2a99-0x0;var _0x888f3a=_0x25e1[_0x4d2a99];return _0x888f3a;};'use strict';var moment=require('moment');var _=require(_0x125e('0x0'));var client=require(_0x125e('0x1'));exports[_0x125e('0x2')]=function(_0x585ae6){return client['Request']('CreateVoiceQueueReport',{'body':_0x585ae6,'log':_0x125e('0x3')});};exports[_0x125e('0x4')]=function(){return function(){return client[_0x125e('0x5')](_0x125e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x125e('0x7')]('day')[_0x125e('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x125e('0x9')](_0x125e('0xa'))[_0x125e('0x8')](_0x125e('0xb'))]}},'attributes':['uniqueid','queue','queuecallerjoinAt',_0x125e('0xc'),_0x125e('0xd'),'queuecallercompleteAt',_0x125e('0xe'),'queuecallerexitAt',_0x125e('0xf'),_0x125e('0x10')]},'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 960a12a..9228166 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 _0x1552=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x3cc170,_0x152e82){var _0x5e1291=function(_0x22edeb){while(--_0x22edeb){_0x3cc170['push'](_0x3cc170['shift']());}};_0x5e1291(++_0x152e82);}(_0x1552,0x19b));var _0x2155=function(_0x3fb743,_0x2b6886){_0x3fb743=_0x3fb743-0x0;var _0x135901=_0x1552[_0x3fb743];return _0x135901;};'use strict';var client=require(_0x2155('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4b8731){return function(){return client[_0x2155('0x1')](_0x2155('0x2'),{'options':{'where':{'VoiceQueueId':_0x4b8731,'paused':!![]},'raw':!![]},'log':_0x2155('0x3')});};}; \ No newline at end of file +var _0xf215=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3525d4,_0xc765c4){var _0x29d535=function(_0x403741){while(--_0x403741){_0x3525d4['push'](_0x3525d4['shift']());}};_0x29d535(++_0xc765c4);}(_0xf215,0xec));var _0x5f21=function(_0x1e5725,_0x3f4e13){_0x1e5725=_0x1e5725-0x0;var _0x4b5cf8=_0xf215[_0x1e5725];return _0x4b5cf8;};'use strict';var client=require(_0x5f21('0x0'));exports[_0x5f21('0x1')]=function(_0x56aa5d){return function(){return client[_0x5f21('0x2')](_0x5f21('0x3'),{'options':{'where':{'VoiceQueueId':_0x56aa5d,'paused':!![]},'raw':!![]},'log':_0x5f21('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d937607..bbb7e27 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 _0x3c9c=['../client','CreateVoiceRecording','merge','monitorFilename'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x3c9c,0x19c));var _0xc3c9=function(_0x465809,_0x599a35){_0x465809=_0x465809-0x0;var _0x1812fd=_0x3c9c[_0x465809];return _0x1812fd;};'use strict';var _=require('lodash');var client=require(_0xc3c9('0x0'));exports['create']=function(_0x32e802){return client['Request'](_0xc3c9('0x1'),{'body':_[_0xc3c9('0x2')](_0x32e802,{'value':_0x32e802[_0xc3c9('0x3')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0xf2a2=['lodash','create','CreateVoiceRecording','merge'];(function(_0x369d9e,_0x571572){var _0x5a21d1=function(_0x506dc7){while(--_0x506dc7){_0x369d9e['push'](_0x369d9e['shift']());}};_0x5a21d1(++_0x571572);}(_0xf2a2,0x104));var _0x2f2a=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xf2a2[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0x2f2a('0x0'));var client=require('../client');exports[_0x2f2a('0x1')]=function(_0x16fbad){return client['Request'](_0x2f2a('0x2'),{'body':_[_0x2f2a('0x3')](_0x16fbad,{'value':_0x16fbad['monitorFilename']}),'log':_0x2f2a('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index de0af33..c7ddb06 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 _0xbdbd=['origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbdbd,0x11b));var _0xdbdb=function(_0x507fa0,_0x2c7822){_0x507fa0=_0x507fa0-0x0;var _0x454e3b=_0xbdbd[_0x507fa0];return _0x454e3b;};'use strict';var client=require(_0xdbdb('0x0'));exports[_0xdbdb('0x1')]=function(_0x45694d){return client[_0xdbdb('0x2')](_0xdbdb('0x3'),{'body':{'result':_0x45694d[_0xdbdb('0x4')],'transfererchannel':_0x45694d['transfererchannel'],'transferercalleridnum':_0x45694d['transferercalleridnum'],'transferercalleridname':_0x45694d[_0xdbdb('0x5')],'transfererconnectedlinenum':_0x45694d[_0xdbdb('0x6')],'transfererconnectedlinename':_0x45694d[_0xdbdb('0x7')],'transfereraccountcode':_0x45694d[_0xdbdb('0x8')],'transferercontext':_0x45694d[_0xdbdb('0x9')],'transfererexten':_0x45694d['transfererexten'],'transfererlinkedid':_0x45694d['transfererlinkedid'],'transfereechannel':_0x45694d[_0xdbdb('0xa')],'transfereecalleridnum':_0x45694d['transfereecalleridnum'],'transfereecalleridname':_0x45694d[_0xdbdb('0xb')],'transfereeconnectedlinenum':_0x45694d[_0xdbdb('0xc')],'transfereeconnectedlinename':_0x45694d[_0xdbdb('0xd')],'transfereeaccountcode':_0x45694d[_0xdbdb('0xe')],'transfereecontext':_0x45694d[_0xdbdb('0xf')],'transfereeexten':_0x45694d[_0xdbdb('0x10')],'transfereelinkedid':_0x45694d[_0xdbdb('0x11')],'isexternal':_0x45694d[_0xdbdb('0x12')],'context':_0x45694d['context'],'extension':_0x45694d[_0xdbdb('0x13')],'type':'blind'},'log':_0xdbdb('0x3')});};exports[_0xdbdb('0x14')]=function(_0x44932f){return client['Request'](_0xdbdb('0x3'),{'body':{'result':_0x44932f[_0xdbdb('0x4')],'transfererchannel':_0x44932f[_0xdbdb('0x15')],'transferercalleridnum':_0x44932f['origtransferercalleridnum'],'transferercalleridname':_0x44932f[_0xdbdb('0x16')],'transfererconnectedlinenum':_0x44932f[_0xdbdb('0x17')],'transfererconnectedlinename':_0x44932f[_0xdbdb('0x18')],'transfereraccountcode':_0x44932f[_0xdbdb('0x19')],'transferercontext':_0x44932f[_0xdbdb('0x1a')],'transfererexten':_0x44932f[_0xdbdb('0x1b')],'transfererlinkedid':_0x44932f[_0xdbdb('0x1c')],'transfereechannel':_0x44932f[_0xdbdb('0x1d')],'transfereecalleridnum':_0x44932f['transfertargetcalleridnum'],'transfereecalleridname':_0x44932f[_0xdbdb('0x1e')],'transfereeconnectedlinenum':_0x44932f[_0xdbdb('0x1f')],'transfereeconnectedlinename':_0x44932f[_0xdbdb('0x20')],'transfereeaccountcode':_0x44932f[_0xdbdb('0x21')],'transfereecontext':_0x44932f[_0xdbdb('0x22')],'transfereeexten':_0x44932f[_0xdbdb('0x23')],'transfereelinkedid':_0x44932f[_0xdbdb('0x24')],'isexternal':_0x44932f[_0xdbdb('0x12')],'context':_0x44932f[_0xdbdb('0x25')],'extension':_0x44932f[_0xdbdb('0x26')],'type':_0xdbdb('0x27')},'log':_0xdbdb('0x3')});}; \ No newline at end of file +var _0x149a=['extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal'];(function(_0x2c306a,_0x2a57f8){var _0xacc447=function(_0xca9f8c){while(--_0xca9f8c){_0x2c306a['push'](_0x2c306a['shift']());}};_0xacc447(++_0x2a57f8);}(_0x149a,0x93));var _0xa149=function(_0x7f6293,_0x3398b5){_0x7f6293=_0x7f6293-0x0;var _0x268e97=_0x149a[_0x7f6293];return _0x268e97;};'use strict';var client=require(_0xa149('0x0'));exports['blindTransfer']=function(_0x5e14d0){return client[_0xa149('0x1')](_0xa149('0x2'),{'body':{'result':_0x5e14d0[_0xa149('0x3')],'transfererchannel':_0x5e14d0[_0xa149('0x4')],'transferercalleridnum':_0x5e14d0['transferercalleridnum'],'transferercalleridname':_0x5e14d0['transferercalleridname'],'transfererconnectedlinenum':_0x5e14d0[_0xa149('0x5')],'transfererconnectedlinename':_0x5e14d0['transfererconnectedlinename'],'transfereraccountcode':_0x5e14d0[_0xa149('0x6')],'transferercontext':_0x5e14d0[_0xa149('0x7')],'transfererexten':_0x5e14d0[_0xa149('0x8')],'transfererlinkedid':_0x5e14d0[_0xa149('0x9')],'transfereechannel':_0x5e14d0[_0xa149('0xa')],'transfereecalleridnum':_0x5e14d0[_0xa149('0xb')],'transfereecalleridname':_0x5e14d0['transfereecalleridname'],'transfereeconnectedlinenum':_0x5e14d0[_0xa149('0xc')],'transfereeconnectedlinename':_0x5e14d0[_0xa149('0xd')],'transfereeaccountcode':_0x5e14d0[_0xa149('0xe')],'transfereecontext':_0x5e14d0[_0xa149('0xf')],'transfereeexten':_0x5e14d0[_0xa149('0x10')],'transfereelinkedid':_0x5e14d0['transfereelinkedid'],'isexternal':_0x5e14d0[_0xa149('0x11')],'context':_0x5e14d0['context'],'extension':_0x5e14d0[_0xa149('0x12')],'type':_0xa149('0x13')},'log':_0xa149('0x2')});};exports['attendedTransfer']=function(_0x42404a){return client[_0xa149('0x1')](_0xa149('0x2'),{'body':{'result':_0x42404a[_0xa149('0x3')],'transfererchannel':_0x42404a[_0xa149('0x14')],'transferercalleridnum':_0x42404a[_0xa149('0x15')],'transferercalleridname':_0x42404a['origtransferercalleridname'],'transfererconnectedlinenum':_0x42404a[_0xa149('0x16')],'transfererconnectedlinename':_0x42404a[_0xa149('0x17')],'transfereraccountcode':_0x42404a[_0xa149('0x18')],'transferercontext':_0x42404a['secondtransferercontext'],'transfererexten':_0x42404a[_0xa149('0x19')],'transfererlinkedid':_0x42404a['origtransfererlinkedid'],'transfereechannel':_0x42404a[_0xa149('0x1a')],'transfereecalleridnum':_0x42404a['transfertargetcalleridnum'],'transfereecalleridname':_0x42404a[_0xa149('0x1b')],'transfereeconnectedlinenum':_0x42404a[_0xa149('0x1c')],'transfereeconnectedlinename':_0x42404a[_0xa149('0x1d')],'transfereeaccountcode':_0x42404a[_0xa149('0x1e')],'transfereecontext':_0x42404a[_0xa149('0x1f')],'transfereeexten':_0x42404a['transfertargetexten'],'transfereelinkedid':_0x42404a['transfertargetlinkedid'],'isexternal':_0x42404a[_0xa149('0x11')],'context':_0x42404a[_0xa149('0x20')],'extension':_0x42404a['origtransfererexten'],'type':'attended'},'log':_0xa149('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8b35a59..30212dc 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 _0x4460=['push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','../properties','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','username','content','voiceQueues','hasOwnProperty','strategy','answered','pTalking','sumDuration','type','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','values','find','channels','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','isNil','monitors'];(function(_0x103f5d,_0xb26b06){var _0x4900eb=function(_0x118376){while(--_0x118376){_0x103f5d['push'](_0x103f5d['shift']());}};_0x4900eb(++_0xb26b06);}(_0x4460,0x123));var _0x0446=function(_0x429b61,_0x4089f9){_0x429b61=_0x429b61-0x0;var _0x3a70c9=_0x4460[_0x429b61];return _0x3a70c9;};'use strict';var _=require(_0x0446('0x0'));var util=require(_0x0446('0x1'));var jayson=require('jayson/promise');var schema=require(_0x0446('0x2'));var BPromise=require(_0x0446('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x0446('0x4'));var ami=require('../ami');exports[_0x0446('0x5')]=function(_0x43990f,_0x457c07,_0x3f6160){return new BPromise(function(_0x12c793,_0x465363){var _0x1e62cb={'QueuePause':function(_0x982169){return new Promise(function(_0x56bada,_0x580e40){var _0x4e066d=util[_0x0446('0x6')](_0x0446('0x7'),_0x0446('0x8'),_0x982169[_0x0446('0x9')]);if(_0x43990f[_0x0446('0xa')]&&_0x43990f[_0x0446('0xa')][_0x4e066d]&&_0x43990f['timers'][_0x4e066d]['timer']){_0x43990f['timers'][_0x4e066d][_0x0446('0xb')]();}if(_0x43990f[_0x0446('0xc')][_0x4e066d]){_0x43990f[_0x0446('0xc')][_0x4e066d][_0x0446('0xd')]({'statePause':_0x982169[_0x0446('0xe')]?!![]:![]});}_0x56bada({'code':0xc8,'message':_0x0446('0xf')});});},'Reload':function(_0x2edc58){var _0x4693ac=this;return new Promise(function(_0x429995,_0x4605a4){if(ami[_0x0446('0x10')]()==![]){return _0x4605a4(_0x4693ac[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk']['username'],_0x0446('0x13')][_0x0446('0x14')]('\x20')));}_0x2edc58=_[_0x0446('0x15')](_0x2edc58,_['keys'](properties[_0x0446('0x16')]));_0x2edc58[_0x0446('0x17')]=_0x0446('0x18');return ami[_0x0446('0x19')](_0x2edc58)[_0x0446('0x1a')](function(_0x2b54fb){_0x429995({'code':0xc8,'message':_0x2b54fb[_0x0446('0x1b')]});})[_0x0446('0x1c')](function(_0x4e341d){_0x4605a4(_0x4693ac[_0x0446('0x11')](0x1f5,_0x4e341d[_0x0446('0x1b')]));});});},'Command':function(_0x43c9ed){var _0x5c1c5d=this;return new Promise(function(_0x373f6b,_0x5aff09){if(ami[_0x0446('0x10')]()==![]){return _0x5aff09(_0x5c1c5d[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk'][_0x0446('0x1d')],_0x0446('0x13')]['join']('\x20')));}_0x43c9ed=_['pick'](_0x43c9ed,'command');_0x43c9ed[_0x0446('0x17')]='Command';return ami[_0x0446('0x19')](_0x43c9ed)[_0x0446('0x1a')](function(_0x5832af){_0x373f6b({'code':0xc8,'message':_0x5832af[_0x0446('0x1e')]});})[_0x0446('0x1c')](function(_0x56dd9c){_0x5aff09(_0x5c1c5d[_0x0446('0x11')](0x1f5,_0x56dd9c[_0x0446('0x1b')]));});});},'VoiceQueues':function(_0x2bad65){return new Promise(function(_0xd7e42a,_0x50ce7f){var _0x2e1772=[];for(var _0x3e7019 in _0x43990f[_0x0446('0x1f')]){if(_0x43990f[_0x0446('0x1f')][_0x0446('0x20')](_0x3e7019)){var _0x2d4f1b=_0x43990f['voiceQueues'][_0x3e7019];var _0x148b32={'id':_0x2d4f1b['id'],'name':_0x2d4f1b[_0x0446('0x9')],'strategy':_0x2d4f1b[_0x0446('0x21')],'answered':_0x2d4f1b[_0x0446('0x22')],'available':_0x2d4f1b['available'],'loggedIn':_0x2d4f1b['loggedIn'],'pTalking':_0x2d4f1b[_0x0446('0x23')],'sumBillable':_0x2d4f1b['sumBillable'],'sumDuration':_0x2d4f1b[_0x0446('0x24')],'sumHoldTime':_0x2d4f1b['sumHoldTime']||0x0,'talking':_0x2d4f1b['talking'],'total':_0x2d4f1b['total'],'type':_0x2d4f1b[_0x0446('0x25')],'unmanaged':_0x2d4f1b['unmanaged'],'abandoned':_0x2d4f1b[_0x0446('0x26')],'waiting':_0x2d4f1b[_0x0446('0x27')],'loggedInDb':_0x2d4f1b[_0x0446('0x28')]};if(_0x2d4f1b[_0x0446('0x25')]==='outbound'){_0x148b32['dialActive']=_0x2d4f1b['dialActive'];_0x148b32[_0x0446('0x29')]=_0x2d4f1b[_0x0446('0x29')];_0x148b32[_0x0446('0x2a')]=_0x2d4f1b[_0x0446('0x2a')];_0x148b32[_0x0446('0x2b')]=_0x2d4f1b[_0x0446('0x2b')];_0x148b32[_0x0446('0x2c')]=_0x2d4f1b[_0x0446('0x2c')];_0x148b32[_0x0446('0x2d')]=_0x2d4f1b[_0x0446('0x2d')];_0x148b32[_0x0446('0x2e')]=_0x2d4f1b[_0x0446('0x2e')];_0x148b32[_0x0446('0x2f')]=_0x2d4f1b[_0x0446('0x2f')];_0x148b32[_0x0446('0x30')]=_0x2d4f1b[_0x0446('0x30')];_0x148b32[_0x0446('0x31')]=_0x2d4f1b[_0x0446('0x31')];_0x148b32[_0x0446('0x32')]=_0x2d4f1b[_0x0446('0x32')];_0x148b32[_0x0446('0x33')]=_0x2d4f1b[_0x0446('0x33')];_0x148b32[_0x0446('0x34')]=_0x2d4f1b['outboundDropCallsDayCallersExit'];_0x148b32['outboundDropCallsDayTimeout']=_0x2d4f1b[_0x0446('0x35')];_0x148b32[_0x0446('0x36')]=_0x2d4f1b[_0x0446('0x36')];_0x148b32[_0x0446('0x37')]=_0x2d4f1b[_0x0446('0x37')];_0x148b32[_0x0446('0x38')]=_0x2d4f1b['outboundOriginateFailureCallsDay'];_0x148b32[_0x0446('0x39')]=_0x2d4f1b['outboundReCallsDay'];_0x148b32[_0x0446('0x3a')]=_0x2d4f1b[_0x0446('0x3a')];_0x148b32[_0x0446('0x3b')]=_0x2d4f1b[_0x0446('0x3b')];_0x148b32['predictiveIntervalAnsweredCalls']=_0x2d4f1b[_0x0446('0x3c')];_0x148b32[_0x0446('0x3d')]=_0x2d4f1b[_0x0446('0x3d')];_0x148b32[_0x0446('0x3e')]=_0x2d4f1b[_0x0446('0x3e')];_0x148b32[_0x0446('0x3f')]=_0x2d4f1b['predictiveIntervalDroppedCallsCallersExit'];_0x148b32[_0x0446('0x40')]=_0x2d4f1b[_0x0446('0x40')];_0x148b32[_0x0446('0x41')]=_0x2d4f1b['predictiveIntervalErlangCalls'];_0x148b32[_0x0446('0x42')]=_0x2d4f1b['predictiveIntervalErlangCallsDroppedCalls'];_0x148b32['predictiveIntervalHitRate']=_0x2d4f1b[_0x0446('0x43')];_0x148b32[_0x0446('0x44')]=_0x2d4f1b[_0x0446('0x44')];_0x148b32['predictiveIntervalPauses']=_0x2d4f1b[_0x0446('0x45')];_0x148b32[_0x0446('0x46')]=_0x2d4f1b[_0x0446('0x46')];_0x148b32[_0x0446('0x47')]=_0x2d4f1b[_0x0446('0x47')];_0x148b32[_0x0446('0x1b')]=_0x2d4f1b[_0x0446('0x1b')];_0x148b32[_0x0446('0x48')]=_0x2d4f1b[_0x0446('0x48')];_0x148b32[_0x0446('0x49')]=_0x2d4f1b[_0x0446('0x49')];_0x148b32[_0x0446('0x4a')]=_0x2d4f1b[_0x0446('0x4a')];_0x148b32[_0x0446('0x4b')]=_0x2d4f1b[_0x0446('0x4b')];_0x148b32[_0x0446('0x4c')]=_0x2d4f1b[_0x0446('0x4c')];_0x148b32[_0x0446('0x4d')]=_0x2d4f1b['startPredictive'];_0x148b32[_0x0446('0x4e')]=_0x2d4f1b['startProgressive'];}if(_0x2d4f1b['Trunk']){_0x148b32['Trunk']={'id':_0x2d4f1b['Trunk']['id'],'name':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x9')],'active':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x50')],'callerid':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x51')]};}if(_0x2d4f1b[_0x0446('0x52')]){_0x148b32['Interval']={'id':_0x2d4f1b[_0x0446('0x52')]['id'],'name':_0x2d4f1b[_0x0446('0x52')][_0x0446('0x9')]};}_0x2e1772['push'](_0x148b32);}}_0xd7e42a({'count':_0x2e1772[_0x0446('0x53')],'rows':_0x2e1772});});},'VoiceChannels':function(_0x963b0e){return new Promise(function(_0x2fbbc5,_0x85bb8e){var _0x518ae5=_[_0x0446('0x54')](_0x43990f['channels']);_0x2fbbc5({'count':_0x518ae5[_0x0446('0x53')],'rows':_0x518ae5});});},'VoiceChannelMixMonitor':function(_0x14f6be){var _0x5cd770=this;return new Promise(function(_0x3558c0,_0x39ee9a){if(ami[_0x0446('0x10')]()==![]){return _0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk'][_0x0446('0x1d')],_0x0446('0x13')][_0x0446('0x14')]('\x20')));}var _0xf746a9=schema(properties['voicechannel'])[_0x0446('0x2')](_0x14f6be);if(_0xf746a9[_0x0446('0x53')]>0x0){return _0x39ee9a(_0x5cd770['error'](0x1f4,_['map'](_0xf746a9,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x9fa0ba=_[_0x0446('0x55')](_0x43990f[_0x0446('0x56')],{'uniqueid':_0x14f6be['uniqueid']});if(_0x9fa0ba&&_0x9fa0ba[_0x0446('0x57')]){var _0x16c63f=util[_0x0446('0x6')](_0x0446('0x58'),_0x14f6be[_0x0446('0x59')]||_0x14f6be[_0x0446('0x5a')],_0x14f6be[_0x0446('0x6')]||_0x0446('0x5b'));return ami[_0x0446('0x19')]({'action':_0x0446('0x5c'),'channel':_0x9fa0ba[_0x0446('0x57')],'file':_0x16c63f,'options':_0x0446('0x5d')})['then'](function(_0x10f106){var _0x5eb93b=_[_0x0446('0x55')](_0x9fa0ba['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x16c63f['toLowerCase']()});if(_[_0x0446('0x5e')](_0x5eb93b)){_0x9fa0ba[_0x0446('0x5f')][_0x0446('0x60')]({'filename':'/var/spool/asterisk/monitor/'+_0x16c63f[_0x0446('0x61')](),'createdAt':moment()['format'](_0x0446('0x62')),'mixmonitorid':_0x10f106['mixmonitorid'],'status':_0x0446('0x63')});}else{_0x5eb93b[_0x0446('0x64')]=_0x10f106[_0x0446('0x64')];_0x5eb93b[_0x0446('0x65')]='rec';}_0x3558c0({'code':0xc8,'message':[_0x14f6be[_0x0446('0x5a')],_0x0446('0x66'),_0x10f106[_0x0446('0x64')]][_0x0446('0x14')]('\x20'),'mixmonitorid':_0x10f106[_0x0446('0x64')]});})['catch'](function(_0x5e6d80){_0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f5,[_0x14f6be[_0x0446('0x5a')],_0x5e6d80[_0x0446('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x36c633){var _0x3fe8dd=this;return new Promise(function(_0x46084d,_0x4bc3b1){if(ami[_0x0446('0x10')]()==![]){return _0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x0446('0x12')][_0x0446('0x1d')],'ami\x20disconnected'][_0x0446('0x14')]('\x20')));}var _0x559e8d=schema(properties['voicechannel'])['validate'](_0x36c633);if(_0x559e8d[_0x0446('0x53')]>0x0){return _0x4bc3b1(_0x3fe8dd['error'](0x1f4,_[_0x0446('0x68')](_0x559e8d,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x5bdf4f=_['find'](_0x43990f[_0x0446('0x56')],{'uniqueid':_0x36c633[_0x0446('0x5a')]});if(_0x5bdf4f){return BPromise[_0x0446('0x69')]()['then'](function(){if(_0x5bdf4f[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':'StopMixMonitor','channel':_0x5bdf4f[_0x0446('0x57')],'mixmonitorid':_0x36c633[_0x0446('0x64')]})[_0x0446('0x1c')](function(_0x47a698){});}})[_0x0446('0x1a')](function(){if(_0x5bdf4f['destinationchannel']){return ami[_0x0446('0x19')]({'action':_0x0446('0x6a'),'channel':_0x5bdf4f[_0x0446('0x6b')],'mixmonitorid':_0x36c633[_0x0446('0x64')]})[_0x0446('0x1c')](function(_0x61f011){});}})[_0x0446('0x1a')](function(_0x26b6ba){var _0x2f7d3b=_[_0x0446('0x55')](_0x5bdf4f[_0x0446('0x5f')],{'mixmonitorid':_0x36c633['mixmonitorid']});if(_0x2f7d3b){_0x2f7d3b[_0x0446('0x65')]=_0x0446('0x6c');}})['then'](function(){var _0x185f5d=util['format']('%s.%s',_0x36c633['filename']||_0x36c633[_0x0446('0x5a')],_0x36c633[_0x0446('0x6')]||_0x0446('0x5b'));var _0x210e49=_[_0x0446('0x55')](_0x5bdf4f['monitors'],{'filename':_0x0446('0x6d')+_0x185f5d['toLowerCase']()});if(_0x210e49){_0x210e49[_0x0446('0x65')]=_0x0446('0x6c');}})[_0x0446('0x1a')](function(){_0x46084d({'code':0xc8,'message':[_0x36c633[_0x0446('0x5a')],_0x0446('0x6e')]['join']('\x20')});})[_0x0446('0x1c')](function(_0x5956c0){_0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f5,[_0x36c633[_0x0446('0x5a')],_0x5956c0['message'][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannels':function(_0x214b34){return new Promise(function(_0x1bd778,_0x1a7a3e){var _0x39c492=_[_0x0446('0x54')](_0x43990f[_0x0446('0x6f')]);_0x1bd778({'count':_0x39c492[_0x0446('0x53')],'rows':_0x39c492});});},'VoiceQueuesChannel':function(_0x235f2f){var _0x550d4e=this;return new Promise(function(_0x133ebf,_0x55be59){var _0x444106=schema(properties['voicequeuechannel'])['validate'](_0x235f2f);if(_0x444106[_0x0446('0x53')]>0x0){return _0x55be59(_0x550d4e['error'](0x1f4,_[_0x0446('0x68')](_0x444106,'message')[_0x0446('0x14')](',\x20')));}var _0x1e7bed=_[_0x0446('0x55')](_0x43990f['queueChannels'],{'uniqueid':_0x235f2f[_0x0446('0x5a')]});if(_0x1e7bed){_0x133ebf(_0x1e7bed);}else{return _0x55be59(_0x550d4e[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x3e5c21){var _0x14f5ba=this;return new Promise(function(_0x183dc2,_0x1738e4){if(ami['isConnected']()==![]){return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x0446('0x14')]('\x20')));}var _0xf51372=schema(properties['voicequeuechannelhangup'])[_0x0446('0x2')](_0x3e5c21);if(_0xf51372[_0x0446('0x53')]>0x0){return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f4,_[_0x0446('0x68')](_0xf51372,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x4f1bd8=_['find'](_0x43990f['queueChannels'],{'uniqueid':_0x3e5c21[_0x0446('0x5a')]});if(_0x4f1bd8&&_0x4f1bd8[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':'Hangup','channel':_0x4f1bd8['channel']})[_0x0446('0x1a')](function(_0x5d801b){_0x183dc2({'code':0xc8,'message':[_0x3e5c21[_0x0446('0x5a')],_0x5d801b[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')});})[_0x0446('0x1c')](function(_0x1662a2){_0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f5,[_0x3e5c21[_0x0446('0x5a')],_0x1662a2[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannelRedirect':function(_0x526673){var _0x5c1af1=this;return new Promise(function(_0x820a0a,_0x1ae806){if(ami[_0x0446('0x10')]()==![]){return _0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config[_0x0446('0x12')][_0x0446('0x1d')],_0x0446('0x13')]['join']('\x20')));}var _0x32c1b3=schema(properties[_0x0446('0x70')])[_0x0446('0x2')](_0x526673);if(_0x32c1b3[_0x0446('0x53')]>0x0){return _0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f4,_[_0x0446('0x68')](_0x32c1b3,_0x0446('0x1b'))['join'](',\x20')));}var _0x2132e5=_['find'](_0x43990f[_0x0446('0x6f')],{'uniqueid':_0x526673[_0x0446('0x5a')]});if(_0x2132e5&&_0x2132e5[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':_0x0446('0x71'),'channel':_0x2132e5[_0x0446('0x57')],'exten':_0x526673[_0x0446('0x72')],'context':_0x526673['context']||_0x2132e5['context'],'priority':0x1})[_0x0446('0x1a')](function(_0x2dad10){_0x820a0a({'code':0xc8,'message':[_0x526673[_0x0446('0x5a')],_0x2dad10[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')});})[_0x0446('0x1c')](function(_0x195175){_0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f5,[_0x526673[_0x0446('0x5a')],_0x195175[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x1ae806(_0x5c1af1['error'](0x1f5,_0x0446('0x67')));}});},'Agents':function(_0x45f010){return new Promise(function(_0x1e5442,_0xa3503d){var _0x3537c0=_[_0x0446('0x54')](_0x43990f[_0x0446('0xc')]);_0x1e5442({'count':_0x3537c0[_0x0446('0x53')],'rows':_0x3537c0});});},'Telephones':function(_0x12a365){return new Promise(function(_0x527969,_0x3cd410){var _0x39e7b6=_['values'](_0x43990f[_0x0446('0x73')]);_0x527969({'count':_0x39e7b6[_0x0446('0x53')],'rows':_0x39e7b6});});},'Trunks':function(_0x4a5182){return new Promise(function(_0xad076e,_0x1a7bd8){var _0x3b0ad4=_[_0x0446('0x54')](_0x43990f[_0x0446('0x74')]);_0xad076e({'count':_0x3b0ad4['length'],'rows':_0x3b0ad4});});},'OutboundChannels':function(_0x31f715){return new Promise(function(_0x4b0320,_0x17fe3d){var _0x5b5e9d=_[_0x0446('0x54')](_0x43990f[_0x0446('0x75')]);_0x4b0320({'count':_0x5b5e9d[_0x0446('0x53')],'rows':_0x5b5e9d});});},'Outbound':function(_0x4ec51a){return new Promise(function(_0x41adaf,_0x3bd129){_0x41adaf(_0x43990f[_0x0446('0x76')]);});},'Campaigns':function(_0x14b78a){return new Promise(function(_0x4e0584,_0x1083ee){var _0x5e6dba=_[_0x0446('0x54')](_0x43990f['campaigns']);_0x4e0584({'count':_0x5e6dba[_0x0446('0x53')],'rows':_0x5e6dba});});},'VoiceQueuesPreview':function(_0x4f2b9b){var _0x1e409e=this;return new Promise(function(_0x556dbe,_0x3a5558){_0x457c07[_0x0446('0x77')](_0x4f2b9b['id'])[_0x0446('0x1a')](function(_0x2aaedc){_0x556dbe({'code':0xc8,'message':_0x2aaedc[_0x0446('0x1b')]});})[_0x0446('0x1c')](function(_0x57fad4){_0x3a5558(_0x1e409e[_0x0446('0x11')](0x1f4,_0x57fad4[_0x0446('0x1b')]));});});},'EventManager':function(_0x26fe50){var _0x34d371=this;return new Promise(function(_0xa6122f,_0x5795ff){if(!_0x26fe50[_0x0446('0x78')]){return _0x5795ff(_0x34d371[_0x0446('0x11')](0x1f4,_0x0446('0x79')));}ami['emit']('custom:'+_0x26fe50['event'],_0x26fe50['message']);_0xa6122f({'code':0xc8,'message':_0x26fe50});});},'FaxAccounts':function(_0x38fa76){return new Promise(function(_0x1c1d12,_0x132aa0){var _0x9fdcee=_[_0x0446('0x54')](_0x43990f['faxAccounts']);_0x1c1d12({'count':_0x9fdcee[_0x0446('0x53')],'rows':_0x9fdcee});});},'SendFax':function(_0x4dae71){var _0x47d174=this;return new Promise(function(_0x3ad9aa,_0x370a9b){_0x3f6160[_0x0446('0x7a')](_0x4dae71)['then'](function(_0x38d750){_0x3ad9aa({'code':0xc8,'message':_0x38d750['message']});})['catch'](function(_0x238591){_0x370a9b(_0x47d174[_0x0446('0x11')](0x1f4,_0x238591['message']));});});},'CheckAfterSend':function(_0x4a367b){var _0x5ea4ce=this;return new Promise(function(_0x5d21eb,_0x5f2fb8){_0x3f6160[_0x0446('0x7b')](_0x4a367b)[_0x0446('0x1a')](function(_0x3c3c92){_0x5d21eb({'code':0xc8,'message':_0x3c3c92[_0x0446('0x1b')]});})['catch'](function(_0x32d5be){_0x5f2fb8(_0x5ea4ce['error'](0x1f4,_0x32d5be[_0x0446('0x1b')]));});});}};var _0x2d3c17=jayson[_0x0446('0x7c')](_0x1e62cb)[_0x0446('0x7d')]();_0x2d3c17['on']('error',function(_0x10aba9){return _0x465363(_0x10aba9);});_0x2d3c17[_0x0446('0x5')](0x232a,_0x0446('0x7e'),function(){console['log'](_0x0446('0x7f'),0x232a);return _0x12c793(_0x0446('0x80')+0x232a);});});}; \ No newline at end of file +var _0xf64b=['monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','pick','keys','module','Action','then','message','catch','isConnected','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','type','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','validate','find','uniqueid','channel','%s.%s','wav','MixMonitor'];(function(_0x34f9e3,_0x39c8b4){var _0x1f614a=function(_0xedc06a){while(--_0xedc06a){_0x34f9e3['push'](_0x34f9e3['shift']());}};_0x1f614a(++_0x39c8b4);}(_0xf64b,0x12e));var _0xbf64=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xf64b[_0xc87d08];return _0x30a714;};'use strict';var _=require(_0xbf64('0x0'));var util=require(_0xbf64('0x1'));var jayson=require(_0xbf64('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0xbf64('0x3'));var config=require('../../../config/environment');var properties=require(_0xbf64('0x4'));var ami=require(_0xbf64('0x5'));exports[_0xbf64('0x6')]=function(_0x29552c,_0x314b17,_0x2a4518){return new BPromise(function(_0x5e5c3c,_0x404e0a){var _0x31421c={'QueuePause':function(_0x53c2a7){return new Promise(function(_0x3d0ee4,_0x383b78){var _0x10db22=util[_0xbf64('0x7')]('%s/%s',_0xbf64('0x8'),_0x53c2a7[_0xbf64('0x9')]);if(_0x29552c['timers']&&_0x29552c[_0xbf64('0xa')][_0x10db22]&&_0x29552c[_0xbf64('0xa')][_0x10db22][_0xbf64('0xb')]){_0x29552c[_0xbf64('0xa')][_0x10db22][_0xbf64('0xc')]();}if(_0x29552c[_0xbf64('0xd')][_0x10db22]){_0x29552c[_0xbf64('0xd')][_0x10db22][_0xbf64('0xe')]({'statePause':_0x53c2a7[_0xbf64('0xf')]?!![]:![]});}_0x3d0ee4({'code':0xc8,'message':_0xbf64('0x10')});});},'Reload':function(_0x231f9a){var _0x5549f4=this;return new Promise(function(_0x17b14d,_0x3f6280){if(ami['isConnected']()==![]){return _0x3f6280(_0x5549f4[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],_0xbf64('0x14')]['join']('\x20')));}_0x231f9a=_[_0xbf64('0x15')](_0x231f9a,_[_0xbf64('0x16')](properties[_0xbf64('0x17')]));_0x231f9a['action']='Reload';return ami[_0xbf64('0x18')](_0x231f9a)[_0xbf64('0x19')](function(_0x4a1a9b){_0x17b14d({'code':0xc8,'message':_0x4a1a9b[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x990794){_0x3f6280(_0x5549f4[_0xbf64('0x11')](0x1f5,_0x990794[_0xbf64('0x1a')]));});});},'Command':function(_0x36950d){var _0xe0be3d=this;return new Promise(function(_0x113014,_0x1edbc4){if(ami[_0xbf64('0x1c')]()==![]){return _0x1edbc4(_0xe0be3d[_0xbf64('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}_0x36950d=_[_0xbf64('0x15')](_0x36950d,_0xbf64('0x1e'));_0x36950d['action']=_0xbf64('0x1f');return ami[_0xbf64('0x18')](_0x36950d)[_0xbf64('0x19')](function(_0x340819){_0x113014({'code':0xc8,'message':_0x340819[_0xbf64('0x20')]});})['catch'](function(_0x4bf8cb){_0x1edbc4(_0xe0be3d['error'](0x1f5,_0x4bf8cb[_0xbf64('0x1a')]));});});},'VoiceQueues':function(_0x3c28b6){return new Promise(function(_0x4f3ceb,_0x598e5d){var _0x2609c1=[];for(var _0x598ac8 in _0x29552c[_0xbf64('0x21')]){if(_0x29552c[_0xbf64('0x21')][_0xbf64('0x22')](_0x598ac8)){var _0x5a7e93=_0x29552c[_0xbf64('0x21')][_0x598ac8];var _0x31d3e1={'id':_0x5a7e93['id'],'name':_0x5a7e93['name'],'strategy':_0x5a7e93[_0xbf64('0x23')],'answered':_0x5a7e93['answered'],'available':_0x5a7e93[_0xbf64('0x24')],'loggedIn':_0x5a7e93[_0xbf64('0x25')],'pTalking':_0x5a7e93[_0xbf64('0x26')],'sumBillable':_0x5a7e93[_0xbf64('0x27')],'sumDuration':_0x5a7e93[_0xbf64('0x28')],'sumHoldTime':_0x5a7e93['sumHoldTime']||0x0,'talking':_0x5a7e93['talking'],'total':_0x5a7e93['total'],'type':_0x5a7e93[_0xbf64('0x29')],'unmanaged':_0x5a7e93[_0xbf64('0x2a')],'abandoned':_0x5a7e93[_0xbf64('0x2b')],'waiting':_0x5a7e93[_0xbf64('0x2c')],'loggedInDb':_0x5a7e93['loggedInDb']};if(_0x5a7e93[_0xbf64('0x29')]==='outbound'){_0x31d3e1['dialActive']=_0x5a7e93[_0xbf64('0x2d')];_0x31d3e1['dialMethod']=_0x5a7e93['dialMethod'];_0x31d3e1['dialOriginateCallerIdName']=_0x5a7e93[_0xbf64('0x2e')];_0x31d3e1[_0xbf64('0x2f')]=_0x5a7e93[_0xbf64('0x2f')];_0x31d3e1[_0xbf64('0x30')]=_0x5a7e93[_0xbf64('0x30')];_0x31d3e1[_0xbf64('0x31')]=_0x5a7e93[_0xbf64('0x31')];_0x31d3e1['outboundAnswerAgiCallsDay']=_0x5a7e93[_0xbf64('0x32')];_0x31d3e1['outboundAnswerCallsDay']=_0x5a7e93['outboundAnswerCallsDay'];_0x31d3e1[_0xbf64('0x33')]=_0x5a7e93[_0xbf64('0x33')];_0x31d3e1[_0xbf64('0x34')]=_0x5a7e93[_0xbf64('0x34')];_0x31d3e1[_0xbf64('0x35')]=_0x5a7e93[_0xbf64('0x35')];_0x31d3e1['outboundDropCallsDayACS']=_0x5a7e93[_0xbf64('0x36')];_0x31d3e1[_0xbf64('0x37')]=_0x5a7e93['outboundDropCallsDayCallersExit'];_0x31d3e1[_0xbf64('0x38')]=_0x5a7e93['outboundDropCallsDayTimeout'];_0x31d3e1[_0xbf64('0x39')]=_0x5a7e93[_0xbf64('0x39')];_0x31d3e1[_0xbf64('0x3a')]=_0x5a7e93['outboundNoSuchCallsDay'];_0x31d3e1[_0xbf64('0x3b')]=_0x5a7e93[_0xbf64('0x3b')];_0x31d3e1['outboundReCallsDay']=_0x5a7e93[_0xbf64('0x3c')];_0x31d3e1['outboundRejectCallsDay']=_0x5a7e93['outboundRejectCallsDay'];_0x31d3e1[_0xbf64('0x3d')]=_0x5a7e93[_0xbf64('0x3d')];_0x31d3e1[_0xbf64('0x3e')]=_0x5a7e93['predictiveIntervalAnsweredCalls'];_0x31d3e1[_0xbf64('0x3f')]=_0x5a7e93[_0xbf64('0x3f')];_0x31d3e1[_0xbf64('0x40')]=_0x5a7e93[_0xbf64('0x40')];_0x31d3e1[_0xbf64('0x41')]=_0x5a7e93[_0xbf64('0x41')];_0x31d3e1[_0xbf64('0x42')]=_0x5a7e93['predictiveIntervalDroppedCallsTimeout'];_0x31d3e1[_0xbf64('0x43')]=_0x5a7e93[_0xbf64('0x43')];_0x31d3e1[_0xbf64('0x44')]=_0x5a7e93['predictiveIntervalErlangCallsDroppedCalls'];_0x31d3e1['predictiveIntervalHitRate']=_0x5a7e93[_0xbf64('0x45')];_0x31d3e1['predictiveIntervalMultiplicativeFactor']=_0x5a7e93['predictiveIntervalMultiplicativeFactor'];_0x31d3e1[_0xbf64('0x46')]=_0x5a7e93[_0xbf64('0x46')];_0x31d3e1[_0xbf64('0x47')]=_0x5a7e93[_0xbf64('0x47')];_0x31d3e1[_0xbf64('0x48')]=_0x5a7e93[_0xbf64('0x48')];_0x31d3e1[_0xbf64('0x1a')]=_0x5a7e93[_0xbf64('0x1a')];_0x31d3e1['originated']=_0x5a7e93['originated'];_0x31d3e1[_0xbf64('0x49')]=_0x5a7e93[_0xbf64('0x49')];_0x31d3e1[_0xbf64('0x4a')]=_0x5a7e93['erlangCallToSecond'];_0x31d3e1[_0xbf64('0x4b')]=_0x5a7e93[_0xbf64('0x4b')];_0x31d3e1[_0xbf64('0x4c')]=_0x5a7e93[_0xbf64('0x4c')];_0x31d3e1['startPredictive']=_0x5a7e93['startPredictive'];_0x31d3e1[_0xbf64('0x4d')]=_0x5a7e93['startProgressive'];}if(_0x5a7e93['Trunk']){_0x31d3e1[_0xbf64('0x4e')]={'id':_0x5a7e93[_0xbf64('0x4e')]['id'],'name':_0x5a7e93[_0xbf64('0x4e')][_0xbf64('0x9')],'active':_0x5a7e93[_0xbf64('0x4e')][_0xbf64('0x4f')],'callerid':_0x5a7e93['Trunk'][_0xbf64('0x50')]};}if(_0x5a7e93[_0xbf64('0x51')]){_0x31d3e1[_0xbf64('0x51')]={'id':_0x5a7e93[_0xbf64('0x51')]['id'],'name':_0x5a7e93['Interval'][_0xbf64('0x9')]};}_0x2609c1[_0xbf64('0x52')](_0x31d3e1);}}_0x4f3ceb({'count':_0x2609c1[_0xbf64('0x53')],'rows':_0x2609c1});});},'VoiceChannels':function(_0x53177d){return new Promise(function(_0x48d989,_0x2feb2e){var _0x19b303=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x55')]);_0x48d989({'count':_0x19b303[_0xbf64('0x53')],'rows':_0x19b303});});},'VoiceChannelMixMonitor':function(_0x4cf72c){var _0x4a235e=this;return new Promise(function(_0x2797a1,_0x26ef48){if(ami[_0xbf64('0x1c')]()==![]){return _0x26ef48(_0x4a235e[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],'ami\x20disconnected'][_0xbf64('0x1d')]('\x20')));}var _0x1c5b74=schema(properties[_0xbf64('0x56')])[_0xbf64('0x57')](_0x4cf72c);if(_0x1c5b74[_0xbf64('0x53')]>0x0){return _0x26ef48(_0x4a235e['error'](0x1f4,_['map'](_0x1c5b74,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0xbb83c4=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x55')],{'uniqueid':_0x4cf72c[_0xbf64('0x59')]});if(_0xbb83c4&&_0xbb83c4[_0xbf64('0x5a')]){var _0x465fb4=util[_0xbf64('0x7')](_0xbf64('0x5b'),_0x4cf72c['filename']||_0x4cf72c[_0xbf64('0x59')],_0x4cf72c[_0xbf64('0x7')]||_0xbf64('0x5c'));return ami[_0xbf64('0x18')]({'action':_0xbf64('0x5d'),'channel':_0xbb83c4[_0xbf64('0x5a')],'file':_0x465fb4,'options':'ai(mixmonitorid)'})[_0xbf64('0x19')](function(_0x26be7d){var _0x37be84=_[_0xbf64('0x58')](_0xbb83c4[_0xbf64('0x5e')],{'filename':_0xbf64('0x5f')+_0x465fb4[_0xbf64('0x60')]()});if(_[_0xbf64('0x61')](_0x37be84)){_0xbb83c4['monitors']['push']({'filename':'/var/spool/asterisk/monitor/'+_0x465fb4['toLowerCase'](),'createdAt':moment()[_0xbf64('0x7')](_0xbf64('0x62')),'mixmonitorid':_0x26be7d[_0xbf64('0x63')],'status':'rec'});}else{_0x37be84[_0xbf64('0x63')]=_0x26be7d[_0xbf64('0x63')];_0x37be84[_0xbf64('0x64')]='rec';}_0x2797a1({'code':0xc8,'message':[_0x4cf72c['uniqueid'],'MixMonitor\x20Success',_0x26be7d[_0xbf64('0x63')]][_0xbf64('0x1d')]('\x20'),'mixmonitorid':_0x26be7d[_0xbf64('0x63')]});})[_0xbf64('0x1b')](function(_0x40c89f){_0x26ef48(_0x4a235e[_0xbf64('0x11')](0x1f5,[_0x4cf72c[_0xbf64('0x59')],_0x40c89f[_0xbf64('0x1a')][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x26ef48(_0x4a235e['error'](0x1f5,_0xbf64('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0xff13bc){var _0x552149=this;return new Promise(function(_0x1f3b9a,_0x6d2790){if(ami[_0xbf64('0x1c')]()==![]){return _0x6d2790(_0x552149[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0x45c41a=schema(properties[_0xbf64('0x56')])[_0xbf64('0x57')](_0xff13bc);if(_0x45c41a['length']>0x0){return _0x6d2790(_0x552149['error'](0x1f4,_[_0xbf64('0x66')](_0x45c41a,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x2e5675=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x55')],{'uniqueid':_0xff13bc[_0xbf64('0x59')]});if(_0x2e5675){return BPromise[_0xbf64('0x67')]()['then'](function(){if(_0x2e5675[_0xbf64('0x5a')]){return ami[_0xbf64('0x18')]({'action':'StopMixMonitor','channel':_0x2e5675['channel'],'mixmonitorid':_0xff13bc[_0xbf64('0x63')]})[_0xbf64('0x1b')](function(_0x20dbb5){});}})[_0xbf64('0x19')](function(){if(_0x2e5675[_0xbf64('0x68')]){return ami[_0xbf64('0x18')]({'action':_0xbf64('0x69'),'channel':_0x2e5675['destinationchannel'],'mixmonitorid':_0xff13bc[_0xbf64('0x63')]})['catch'](function(_0x3b0036){});}})[_0xbf64('0x19')](function(_0x45acc3){var _0x45249c=_[_0xbf64('0x58')](_0x2e5675[_0xbf64('0x5e')],{'mixmonitorid':_0xff13bc[_0xbf64('0x63')]});if(_0x45249c){_0x45249c[_0xbf64('0x64')]=_0xbf64('0x6a');}})['then'](function(){var _0x1a80d5=util[_0xbf64('0x7')](_0xbf64('0x5b'),_0xff13bc[_0xbf64('0x6b')]||_0xff13bc[_0xbf64('0x59')],_0xff13bc[_0xbf64('0x7')]||_0xbf64('0x5c'));var _0x38c952=_['find'](_0x2e5675[_0xbf64('0x5e')],{'filename':_0xbf64('0x5f')+_0x1a80d5[_0xbf64('0x60')]()});if(_0x38c952){_0x38c952['status']=_0xbf64('0x6a');}})[_0xbf64('0x19')](function(){_0x1f3b9a({'code':0xc8,'message':[_0xff13bc['uniqueid'],_0xbf64('0x6c')][_0xbf64('0x1d')]('\x20')});})[_0xbf64('0x1b')](function(_0x5760c5){_0x6d2790(_0x552149[_0xbf64('0x11')](0x1f5,[_0xff13bc[_0xbf64('0x59')],_0x5760c5['message'][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x6d2790(_0x552149[_0xbf64('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x323875){return new Promise(function(_0x8c4a88,_0x590ca3){var _0x427c93=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x6d')]);_0x8c4a88({'count':_0x427c93[_0xbf64('0x53')],'rows':_0x427c93});});},'VoiceQueuesChannel':function(_0x45710b){var _0x135177=this;return new Promise(function(_0x4c661a,_0x636b98){var _0x2e2ac8=schema(properties['voicequeuechannel'])[_0xbf64('0x57')](_0x45710b);if(_0x2e2ac8['length']>0x0){return _0x636b98(_0x135177[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0x2e2ac8,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x134af2=_[_0xbf64('0x58')](_0x29552c['queueChannels'],{'uniqueid':_0x45710b[_0xbf64('0x59')]});if(_0x134af2){_0x4c661a(_0x134af2);}else{return _0x636b98(_0x135177[_0xbf64('0x11')](0x1f5,_0xbf64('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x2ff80e){var _0x3a9d33=this;return new Promise(function(_0x2fcf6e,_0x59ac48){if(ami[_0xbf64('0x1c')]()==![]){return _0x59ac48(_0x3a9d33[_0xbf64('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xbf64('0x12')][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0x54e35f=schema(properties[_0xbf64('0x6e')])[_0xbf64('0x57')](_0x2ff80e);if(_0x54e35f[_0xbf64('0x53')]>0x0){return _0x59ac48(_0x3a9d33[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0x54e35f,_0xbf64('0x1a'))[_0xbf64('0x1d')](',\x20')));}var _0x103ac1=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x6d')],{'uniqueid':_0x2ff80e[_0xbf64('0x59')]});if(_0x103ac1&&_0x103ac1[_0xbf64('0x5a')]){return ami[_0xbf64('0x18')]({'action':'Hangup','channel':_0x103ac1[_0xbf64('0x5a')]})['then'](function(_0x18a23e){_0x2fcf6e({'code':0xc8,'message':[_0x2ff80e['uniqueid'],_0x18a23e[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')});})[_0xbf64('0x1b')](function(_0x56e29a){_0x59ac48(_0x3a9d33['error'](0x1f5,[_0x2ff80e[_0xbf64('0x59')],_0x56e29a[_0xbf64('0x1a')][_0xbf64('0x60')]()][_0xbf64('0x1d')]('\x20')));});}else{return _0x59ac48(_0x3a9d33['error'](0x1f5,_0xbf64('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x3d9fba){var _0x5ee76b=this;return new Promise(function(_0x5b5236,_0x9a7921){if(ami[_0xbf64('0x1c')]()==![]){return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f4,[config[_0xbf64('0x12')]['ip'],config['asterisk'][_0xbf64('0x13')],_0xbf64('0x14')][_0xbf64('0x1d')]('\x20')));}var _0xa318df=schema(properties[_0xbf64('0x6f')])[_0xbf64('0x57')](_0x3d9fba);if(_0xa318df[_0xbf64('0x53')]>0x0){return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f4,_[_0xbf64('0x66')](_0xa318df,_0xbf64('0x1a'))['join'](',\x20')));}var _0x11065b=_[_0xbf64('0x58')](_0x29552c[_0xbf64('0x6d')],{'uniqueid':_0x3d9fba[_0xbf64('0x59')]});if(_0x11065b&&_0x11065b['channel']){return ami['Action']({'action':'Redirect','channel':_0x11065b[_0xbf64('0x5a')],'exten':_0x3d9fba[_0xbf64('0x70')],'context':_0x3d9fba[_0xbf64('0x71')]||_0x11065b[_0xbf64('0x71')],'priority':0x1})['then'](function(_0x5e6afe){_0x5b5236({'code':0xc8,'message':[_0x3d9fba['uniqueid'],_0x5e6afe[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')});})[_0xbf64('0x1b')](function(_0x54bdd2){_0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f5,[_0x3d9fba[_0xbf64('0x59')],_0x54bdd2[_0xbf64('0x1a')][_0xbf64('0x60')]()]['join']('\x20')));});}else{return _0x9a7921(_0x5ee76b[_0xbf64('0x11')](0x1f5,_0xbf64('0x65')));}});},'Agents':function(_0x3d5ca0){return new Promise(function(_0x19db67,_0xf86118){var _0x110835=_['values'](_0x29552c[_0xbf64('0xd')]);_0x19db67({'count':_0x110835['length'],'rows':_0x110835});});},'Telephones':function(_0x17dcc7){return new Promise(function(_0x3ed982,_0x59c7a1){var _0x49585e=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x72')]);_0x3ed982({'count':_0x49585e[_0xbf64('0x53')],'rows':_0x49585e});});},'Trunks':function(_0xb2e41b){return new Promise(function(_0x2b5c4c,_0x341d07){var _0x243e57=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x73')]);_0x2b5c4c({'count':_0x243e57['length'],'rows':_0x243e57});});},'OutboundChannels':function(_0x47ce75){return new Promise(function(_0x589488,_0x4e8623){var _0x59fb68=_[_0xbf64('0x54')](_0x29552c['outboundChannels']);_0x589488({'count':_0x59fb68[_0xbf64('0x53')],'rows':_0x59fb68});});},'Outbound':function(_0x51bc00){return new Promise(function(_0x46d8ab,_0x2a79ac){_0x46d8ab(_0x29552c[_0xbf64('0x74')]);});},'Campaigns':function(_0x568b74){return new Promise(function(_0x3d3f8b,_0x37acfc){var _0xf2607c=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x75')]);_0x3d3f8b({'count':_0xf2607c[_0xbf64('0x53')],'rows':_0xf2607c});});},'VoiceQueuesPreview':function(_0x5edeb4){var _0x17f22b=this;return new Promise(function(_0x11fe51,_0x11cf06){_0x314b17[_0xbf64('0x76')](_0x5edeb4['id'])[_0xbf64('0x19')](function(_0xa251ae){_0x11fe51({'code':0xc8,'message':_0xa251ae[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x48bcf9){_0x11cf06(_0x17f22b[_0xbf64('0x11')](0x1f4,_0x48bcf9[_0xbf64('0x1a')]));});});},'EventManager':function(_0x3ff28d){var _0x2b353b=this;return new Promise(function(_0x12ee7e,_0x2a2612){if(!_0x3ff28d[_0xbf64('0x77')]){return _0x2a2612(_0x2b353b['error'](0x1f4,_0xbf64('0x78')));}ami[_0xbf64('0x79')](_0xbf64('0x7a')+_0x3ff28d['event'],_0x3ff28d[_0xbf64('0x1a')]);_0x12ee7e({'code':0xc8,'message':_0x3ff28d});});},'FaxAccounts':function(_0xf37689){return new Promise(function(_0x2f04e0,_0x26da6a){var _0x54fe93=_[_0xbf64('0x54')](_0x29552c[_0xbf64('0x7b')]);_0x2f04e0({'count':_0x54fe93[_0xbf64('0x53')],'rows':_0x54fe93});});},'SendFax':function(_0x15eb44){var _0x5a99a5=this;return new Promise(function(_0x9d87de,_0x46ae0b){_0x2a4518[_0xbf64('0x7c')](_0x15eb44)['then'](function(_0x494390){_0x9d87de({'code':0xc8,'message':_0x494390[_0xbf64('0x1a')]});})['catch'](function(_0x4acbf8){_0x46ae0b(_0x5a99a5[_0xbf64('0x11')](0x1f4,_0x4acbf8[_0xbf64('0x1a')]));});});},'CheckAfterSend':function(_0x4ad833){var _0x1f425e=this;return new Promise(function(_0x3a6cc8,_0x4c417b){_0x2a4518[_0xbf64('0x7d')](_0x4ad833)['then'](function(_0x4f5840){_0x3a6cc8({'code':0xc8,'message':_0x4f5840[_0xbf64('0x1a')]});})[_0xbf64('0x1b')](function(_0x5e258c){_0x4c417b(_0x1f425e['error'](0x1f4,_0x5e258c[_0xbf64('0x1a')]));});});}};var _0x2f881b=jayson[_0xbf64('0x7e')](_0x31421c)[_0xbf64('0x7f')]();_0x2f881b['on'](_0xbf64('0x11'),function(_0x32bb42){return _0x404e0a(_0x32bb42);});_0x2f881b[_0xbf64('0x6')](0x232a,_0xbf64('0x80'),function(){console[_0xbf64('0x81')](_0xbf64('0x82'),0x232a);return _0x5e5c3c(_0xbf64('0x83')+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 018af77..a021eb5 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 _0x4303=['socket.io-emitter','emit','exec','autoCreate','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','resolve','then','showContact','omit','user:%s','name','format','action','toLowerCase','merge','xmd-contactid2','trigger:%s','Error\x20creating\x20contact','stringify','bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x4303,0xda));var _0x3430=function(_0x3f6439,_0x17de7c){_0x3f6439=_0x3f6439-0x0;var _0x143eb8=_0x4303[_0x3f6439];return _0x143eb8;};'use strict';var BPromise=require(_0x3430('0x0'));var util=require('util');var _=require(_0x3430('0x1'));var Redis=require(_0x3430('0x2'));var config=require(_0x3430('0x3'));var logger=require(_0x3430('0x4'))(_0x3430('0x5'));var cmContactRpc=require(_0x3430('0x6'));config[_0x3430('0x7')]=_[_0x3430('0x8')](config[_0x3430('0x7')],{'host':_0x3430('0x9'),'port':0x18eb});var io=require(_0x3430('0xa'))(new Redis(config[_0x3430('0x7')]));function emit(_0x44ce3f,_0x26ac21,_0x321634){logger['info'](_0x44ce3f,_0x26ac21,JSON['stringify'](_0x321634));io['to'](_0x44ce3f)[_0x3430('0xb')](_0x26ac21,_0x321634);}exports[_0x3430('0xc')]=function(_0x19fe37,_0xdf7a68,_0x9fe9e9){_0x9fe9e9[_0x3430('0xd')]=0x0;if(_0xdf7a68['data2']&&parseInt(_0xdf7a68['data2'],0xa)){var _0xd25f51={'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa),'phone':_0x9fe9e9[_0x3430('0xf')]};if(_[_0x3430('0x10')](_0x9fe9e9[_0x3430('0x11')])){_0xd25f51[_0x3430('0x12')]=_0x9fe9e9[_0x3430('0x13')]&&_0x9fe9e9['calleridname']!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x13')]:_0x9fe9e9[_0x3430('0xf')]||_0x9fe9e9[_0x3430('0x15')];}else{_0xd25f51['firstName']=_0x9fe9e9[_0x3430('0x16')]&&_0x9fe9e9[_0x3430('0x16')]!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x16')]:_0x9fe9e9['destcalleridnum']||_0x9fe9e9[_0x3430('0x15')];_0xd25f51['phone']=_0x9fe9e9[_0x3430('0x16')]&&_0x9fe9e9[_0x3430('0x16')]!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x16')]:_0x9fe9e9[_0x3430('0x17')]||_0x9fe9e9[_0x3430('0x15')];}BPromise[_0x3430('0x18')]()[_0x3430('0x19')](cmContactRpc[_0x3430('0x1a')]({'where':_[_0x3430('0x1b')](_0xd25f51,[_0x3430('0x12')])}))[_0x3430('0x19')](function(_0x2a2267){if(_0x2a2267){_0x9fe9e9['xmd-contactid2']=_0x2a2267['id'];emit(util['format'](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')]('trigger:%s',_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')](_0x9fe9e9,{'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)}));return;}else{return BPromise[_0x3430('0x18')]()[_0x3430('0x19')](cmContactRpc['createContact'](_0xd25f51));}})[_0x3430('0x19')](function(_0x386f88){if(_0x386f88){_0x9fe9e9[_0x3430('0x22')]=_0x386f88['id'];emit(util[_0x3430('0x1e')](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')](_0x3430('0x23'),_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')](_0x9fe9e9,{'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)}));}})['catch'](function(_0x4400f9){logger['error'](_0x3430('0x24'),JSON[_0x3430('0x25')](_0x4400f9));});}else{if(_0x19fe37){emit(util['format'](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')](_0x3430('0x23'),_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')]({'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)},_0x9fe9e9));}}}; \ No newline at end of file +var _0x3ee6=['calleridnum','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','toLowerCase','action','merge','catch','error','Error\x20creating\x20contact','bluebird','lodash','ioredis','../../../../config/logger','trigger','redis','socket.io-emitter','info','stringify','emit','autoCreate','data2','data1','routeId','calleridname',''];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3ee6,0xc8));var _0x63ee=function(_0x24b479,_0x339a4d){_0x24b479=_0x24b479-0x0;var _0x33f092=_0x3ee6[_0x24b479];return _0x33f092;};'use strict';var BPromise=require(_0x63ee('0x0'));var util=require('util');var _=require(_0x63ee('0x1'));var Redis=require(_0x63ee('0x2'));var config=require('../../../../config/environment');var logger=require(_0x63ee('0x3'))(_0x63ee('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x63ee('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x63ee('0x6'))(new Redis(config[_0x63ee('0x5')]));function emit(_0x3d0098,_0x29f929,_0x4f3c93){logger[_0x63ee('0x7')](_0x3d0098,_0x29f929,JSON[_0x63ee('0x8')](_0x4f3c93));io['to'](_0x3d0098)[_0x63ee('0x9')](_0x29f929,_0x4f3c93);}exports['exec']=function(_0x32efe8,_0xc70d55,_0xa83642){_0xa83642[_0x63ee('0xa')]=0x0;if(_0xc70d55[_0x63ee('0xb')]&&parseInt(_0xc70d55[_0x63ee('0xb')],0xa)){var _0x3df6cd={'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa),'phone':_0xa83642['calleridnum']};if(_['isNil'](_0xa83642[_0x63ee('0xd')])){_0x3df6cd['firstName']=_0xa83642[_0x63ee('0xe')]&&_0xa83642[_0x63ee('0xe')]!==_0x63ee('0xf')?_0xa83642[_0x63ee('0xe')]:_0xa83642[_0x63ee('0x10')]||_0xa83642[_0x63ee('0x11')];}else{_0x3df6cd[_0x63ee('0x12')]=_0xa83642[_0x63ee('0x13')]&&_0xa83642['destcalleridname']!==_0x63ee('0xf')?_0xa83642[_0x63ee('0x13')]:_0xa83642[_0x63ee('0x14')]||_0xa83642[_0x63ee('0x11')];_0x3df6cd[_0x63ee('0x15')]=_0xa83642['destcalleridname']&&_0xa83642[_0x63ee('0x13')]!==''?_0xa83642[_0x63ee('0x13')]:_0xa83642[_0x63ee('0x14')]||_0xa83642[_0x63ee('0x11')];}BPromise[_0x63ee('0x16')]()['then'](cmContactRpc[_0x63ee('0x17')]({'where':_[_0x63ee('0x18')](_0x3df6cd,[_0x63ee('0x12')])}))['then'](function(_0x2f47db){if(_0x2f47db){_0xa83642[_0x63ee('0x19')]=_0x2f47db['id'];emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8[_0x63ee('0x1c')]),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55['action'][_0x63ee('0x1e')]()),_['merge'](_0xa83642,{'ListId':parseInt(_0xc70d55['data1'],0xa)}));return;}else{return BPromise[_0x63ee('0x16')]()['then'](cmContactRpc['createContact'](_0x3df6cd));}})['then'](function(_0x309add){if(_0x309add){_0xa83642[_0x63ee('0x19')]=_0x309add['id'];emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8[_0x63ee('0x1c')]),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55[_0x63ee('0x1f')]['toLowerCase']()),_[_0x63ee('0x20')](_0xa83642,{'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa)}));}})[_0x63ee('0x21')](function(_0x46ff11){logger[_0x63ee('0x22')](_0x63ee('0x23'),JSON['stringify'](_0x46ff11));});}else{if(_0x32efe8){emit(util[_0x63ee('0x1a')](_0x63ee('0x1b'),_0x32efe8['name']),util[_0x63ee('0x1a')](_0x63ee('0x1d'),_0xc70d55[_0x63ee('0x1f')][_0x63ee('0x1e')]()),_['merge']({'ListId':parseInt(_0xc70d55[_0x63ee('0xc')],0xa)},_0xa83642));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2b9ee1e..ebc2e2c 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 _0x1d0d=['checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','data1','trigger:%s','exec','integration','queue','routeId','script','parse','query','AllConditions','checkConditions','channel','some','field','account','chat','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','value','operator','agent','lastevent','exports','lodash','url','./cmContact','./script','../rpc/cmContact','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','bind','syncCustomEvent','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','hasOwnProperty'];(function(_0xafa6cf,_0x55c974){var _0x44cff5=function(_0x21208f){while(--_0x21208f){_0xafa6cf['push'](_0xafa6cf['shift']());}};_0x44cff5(++_0x55c974);}(_0x1d0d,0x183));var _0xd1d0=function(_0x341d8b,_0x135476){_0x341d8b=_0x341d8b-0x0;var _0x1e6609=_0x1d0d[_0x341d8b];return _0x1e6609;};'use strict';var util=require('util');var _=require(_0xd1d0('0x0'));var url=require(_0xd1d0('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xd1d0('0x2'));var script=require(_0xd1d0('0x3'));var cmContactRpc=require(_0xd1d0('0x4'));var config=require(_0xd1d0('0x5'));var logger=require('../../../config/logger')(_0xd1d0('0x6'));var ami=require(_0xd1d0('0x7'));config[_0xd1d0('0x8')]=_[_0xd1d0('0x9')](config[_0xd1d0('0x8')],{'host':_0xd1d0('0xa'),'port':0x18eb});var io=require(_0xd1d0('0xb'))(new Redis(config['redis']));var operators={'equals':function(_0x51a343,_0x4988a1){return _0x51a343==_0x4988a1;},'not_equals':function(_0x1412a4,_0x5e8c0a){return _0x1412a4!=_0x5e8c0a;}};var barAndWebActions=[_0xd1d0('0xc'),_0xd1d0('0x1'),_0xd1d0('0xd')];function Trigger(_0x45e2fd){this[_0xd1d0('0xe')]=_0x45e2fd[_0xd1d0('0xe')];this[_0xd1d0('0xf')]=_0x45e2fd[_0xd1d0('0xf')];this['voiceQueues']=_0x45e2fd[_0xd1d0('0x10')];this[_0xd1d0('0x11')]=_0x45e2fd[_0xd1d0('0x11')];this[_0xd1d0('0x12')]=_0x45e2fd[_0xd1d0('0x12')];this[_0xd1d0('0x13')]=_0x45e2fd[_0xd1d0('0x13')];this[_0xd1d0('0x14')]=_0x45e2fd[_0xd1d0('0x14')];this['salesforceAccounts']=_0x45e2fd[_0xd1d0('0x15')];this[_0xd1d0('0x16')]=_0x45e2fd[_0xd1d0('0x16')];this['zohoAccounts']=_0x45e2fd[_0xd1d0('0x17')];this['deskAccounts']=_0x45e2fd[_0xd1d0('0x18')];this['vtigerAccounts']=_0x45e2fd[_0xd1d0('0x19')];this[_0xd1d0('0x1a')]=_0x45e2fd[_0xd1d0('0x1a')];this[_0xd1d0('0x1b')]=_0x45e2fd[_0xd1d0('0x1b')];this[_0xd1d0('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xd1d0('0x15')],'freshdesk':this[_0xd1d0('0x14')],'sugarcrm':this[_0xd1d0('0x16')],'zoho':this[_0xd1d0('0x17')],'desk':this[_0xd1d0('0x18')],'vtiger':this[_0xd1d0('0x19')],'servicenow':this[_0xd1d0('0x1a')],'dynamics365':this[_0xd1d0('0x1b')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xd1d0('0x1d')](this));ami['on']('custom:agentconnect',this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));ami['on']('custom:agentringnoanswer',this[_0xd1d0('0x1e')]['bind'](this));ami['on'](_0xd1d0('0x1f'),this['syncCustomEvent'][_0xd1d0('0x1d')](this));ami['on'](_0xd1d0('0x20'),this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));ami['on'](_0xd1d0('0x21'),this['syncAgentDial'][_0xd1d0('0x1d')](this));ami['on']('custom:dialconnect',this[_0xd1d0('0x22')][_0xd1d0('0x1d')](this));ami['on'](_0xd1d0('0x23'),this[_0xd1d0('0x22')]['bind'](this));ami['on'](_0xd1d0('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd1d0('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd1d0('0x26'),this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));ami['on'](_0xd1d0('0x27'),this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));ami['on']('custom:acceptmessage',this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));ami['on'](_0xd1d0('0x28'),this[_0xd1d0('0x1e')][_0xd1d0('0x1d')](this));}Trigger[_0xd1d0('0x29')][_0xd1d0('0x2a')]=function(_0xe7d8b,_0x449ae6,_0x26ff9d){logger[_0xd1d0('0x2b')](_0xe7d8b,_0x449ae6,JSON[_0xd1d0('0x2c')](_0x26ff9d));io['to'](_0xe7d8b)[_0xd1d0('0x2a')](_0x449ae6,_0x26ff9d);};Trigger[_0xd1d0('0x29')]['syncCustomEvent']=function(_0x3d2bce){var _0x3a2717=_[_0xd1d0('0x2d')](_0x3d2bce);this[_0xd1d0('0x2e')](_0x3a2717);};Trigger[_0xd1d0('0x29')][_0xd1d0('0x22')]=function(_0x3f8bb7){if(this[_0xd1d0('0xf')][_0x3f8bb7[_0xd1d0('0x2f')]]){this[_0xd1d0('0x1e')](_0x3f8bb7);}};Trigger['prototype'][_0xd1d0('0x2e')]=function(_0x3f26db){var _0x692838;for(var _0x305467 in this[_0xd1d0('0xe')]){if(this[_0xd1d0('0xe')][_0xd1d0('0x30')](_0x305467)){if(this[_0xd1d0('0xe')][_0x305467]['status']){_0x692838=this[_0xd1d0('0x31')](this['triggers'][_0x305467],_0x3f26db);if(_0x692838){_[_0xd1d0('0x32')](_0x3f26db,_0x3f26db[_0xd1d0('0x33')]);for(var _0x45af6a=0x0,_0x589aed,_0xac3db6,_0x172911;_0x45af6a0x0){_0x3a929c=_[_0x00f0('0x2b')](_0x401e9b,_0x2271ad);}return _0x3a929c;}function getCustomFields(_0x385a7a,_0x16f2dc){var _0x234fab=[];var _0xe82f3={'custom_fields':{}};if(_0x385a7a['length']>0x0){_[_0x00f0('0x2c')](_0x385a7a,function(_0xcbf323){if(_0xcbf323[_0x00f0('0x2d')]===_0x00f0('0x2e')&&_0xcbf323[_0x00f0('0x2f')]&&!_0xcbf323['customField']){_0xe82f3[_0xcbf323[_0x00f0('0x2f')][_0x00f0('0x30')]()]=_0xcbf323[_0x00f0('0x31')]['toString']();}else if(_0xcbf323[_0x00f0('0x2d')]===_0x00f0('0x2e')&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0xcbf323[_0x00f0('0x31')][_0x00f0('0x33')]();}else if(_0xcbf323[_0x00f0('0x2d')]==='variable'&&_0xcbf323[_0x00f0('0x34')]&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0x16f2dc[_0xcbf323['variableName']]&&(_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0x16f2dc[_0xcbf323[_0x00f0('0x34')]][_0x00f0('0x33')]());}else if(_0xcbf323['type']==='customVariable'&&_0xcbf323['Variable']&&_0xcbf323[_0x00f0('0x35')][_0x00f0('0x36')]&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0x16f2dc[_0xcbf323[_0x00f0('0x35')][_0x00f0('0x36')]['toLowerCase']()]&&(_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0x16f2dc[_0xcbf323['Variable']['name'][_0x00f0('0x30')]()][_0x00f0('0x33')]());}});}if(_0xe82f3[_0x00f0('0x37')]){_0xe82f3[_0x00f0('0x37')]=Number(_0xe82f3[_0x00f0('0x37')]);}return _0xe82f3;}function getTicket(_0x1c12a2,_0x477a0c,_0x1b1235,_0x437aa1,_0x3be760){logger['info'](_0x00f0('0x38'));var _0x4f452=_[_0x00f0('0x39')]({'subject':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x3b')],_0x3be760,'\x20'),'type':_0x00f0('0x3c'),'status':_0x00f0('0x3d'),'labels':[_0x00f0('0x3e'),_0x00f0('0x3f'),_0x00f0('0x40')]['concat'](getTags(_0x437aa1['Tags'],_0x00f0('0x36'))),'description':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x41')],_0x3be760,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x477a0c['id']),'class':_0x00f0('0x42')}},'message':{'direction':'in','body':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x41')],_0x3be760,'\x0a')}},getCustomFields(_0x437aa1[_0x00f0('0x43')],_0x3be760));return request({'uri':util[_0x00f0('0xf')](_0x00f0('0x44'),_0x1c12a2[_0x00f0('0x19')],_0x1b1235['id']),'method':'POST','body':_0x4f452});}exports[_0x00f0('0x45')]=function(_0x49dc5f,_0x3705a2,_0x22a2df,_0x499da3,_0x6cb323,_0x53a79f){var _0x534791,_0x4b6486;_0x53a79f[_0x00f0('0x19')]=intUtil['stripTrailingSlash'](_0x53a79f['remoteUri']);_0x53a79f[_0x00f0('0x46')]=intUtil[_0x00f0('0x47')](_0x53a79f['serverUrl']);if(_0x6cb323&&_0x6cb323['monitor_format']){logger[_0x00f0('0xd')]('[QUEUE]',_0x00f0('0x48'));_0x3705a2[_0x00f0('0x49')]=util[_0x00f0('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53a79f[_0x00f0('0x46')],_0x3705a2['uniqueid'],md5(_0x3705a2[_0x00f0('0x4a')]));}else{_0x3705a2[_0x00f0('0x49')]='';}headers[_0x00f0('0x4b')]=getAuth(_0x53a79f);return getUser(_0x53a79f,_0x499da3['email'])[_0x00f0('0x11')](function(_0x5df721){_0x534791=_0x5df721;logger[_0x00f0('0xd')](_0x00f0('0x4c'),_0x534791['id']);return getEndUser(_0x53a79f,_0x3705a2[_0x00f0('0x4d')],_0x3705a2[_0x00f0('0x4e')]);})[_0x00f0('0x11')](function(_0x154afe){_0x4b6486=_0x154afe;logger[_0x00f0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4b6486['id']);return getTicket(_0x53a79f,_0x534791,_0x4b6486,_0x22a2df,_0x3705a2);})[_0x00f0('0x11')](function(_0x1baa2b){if(_0x1baa2b){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x1baa2b['id']);switch(_0x53a79f['type']){case'integrationTab':logger['info'](_0x00f0('0x51'),_0x00f0('0x52'));emit(util[_0x00f0('0xf')]('user:%s',_0x499da3['name']),'trigger:desk:display',{'recordId':_0x1baa2b['id']});break;case _0x00f0('0x53'):logger['info'](_0x00f0('0x51'),_0x00f0('0x54'));emit(util[_0x00f0('0xf')](_0x00f0('0x55'),_0x499da3[_0x00f0('0x36')]),'trigger:browser:url',{'uri':util[_0x00f0('0xf')](_0x00f0('0x56'),_0x1baa2b['id'])});break;default:logger[_0x00f0('0x57')](_0x00f0('0x51'),_0x00f0('0x58'));}}})[_0x00f0('0x59')](function(_0x122a5b){console[_0x00f0('0x57')](_0x122a5b);logger[_0x00f0('0x57')](_0x00f0('0x51'),JSON[_0x00f0('0x1c')](_0x122a5b));});};exports[_0x00f0('0x5a')]=function(_0x5667a5,_0x1282df,_0x2a0530,_0x27349d,_0x2fea91,_0xc43b05,_0x1f13f7){var _0x5d316a,_0x721bd8;_0xc43b05[_0x00f0('0x19')]=intUtil[_0x00f0('0x47')](_0xc43b05[_0x00f0('0x19')]);_0xc43b05[_0x00f0('0x46')]=intUtil['stripTrailingSlash'](_0xc43b05[_0x00f0('0x46')]);if(_0x1f13f7&&_0x1f13f7[_0x00f0('0x5b')]&&_0x1f13f7[_0x00f0('0x5b')]!==_0x00f0('0x5c')){logger['info']('[OUTBOUND]',_0x00f0('0x48'));_0x1282df['recordingURL']=util['format'](_0x00f0('0x5d'),_0xc43b05[_0x00f0('0x46')],_0x1282df[_0x00f0('0x4a')],md5(_0x1282df['uniqueid']));}headers[_0x00f0('0x4b')]=getAuth(_0xc43b05);return getUser(_0xc43b05,_0x27349d[_0x00f0('0x5e')])[_0x00f0('0x11')](function(_0x443685){_0x5d316a=_0x443685;logger['info'](_0x00f0('0x4c'),_0x5d316a['id']);return getEndUser(_0xc43b05,_0x1282df[_0x00f0('0x5f')],_0x1282df[_0x00f0('0x60')]);})['then'](function(_0x3842bd){_0x721bd8=_0x3842bd;logger[_0x00f0('0xd')](_0x00f0('0x61'),_0x721bd8['id']);return getTicket(_0xc43b05,_0x5d316a,_0x721bd8,_0x2a0530,_0x1282df);})['then'](function(_0x5e4644){if(_0x5e4644){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x5e4644['id']);switch(_0xc43b05[_0x00f0('0x2d')]){case _0x00f0('0x62'):logger['info'](_0x00f0('0x51'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x00f0('0xf')]('user:%s',_0x27349d[_0x00f0('0x36')]),_0x00f0('0x63'),{'recordId':_0x5e4644['id']});break;case _0x00f0('0x53'):logger[_0x00f0('0xd')](_0x00f0('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x00f0('0xf')](_0x00f0('0x55'),_0x27349d[_0x00f0('0x36')]),_0x00f0('0x64'),{'uri':util['format'](_0x00f0('0x65'),_0xc43b05[_0x00f0('0x19')],_0x5e4644['id'])});break;default:logger[_0x00f0('0x57')](_0x00f0('0x66'),_0x00f0('0x58'));}}})[_0x00f0('0x59')](function(_0x2b6551){logger[_0x00f0('0x57')](_0x00f0('0x66'),JSON[_0x00f0('0x1c')](_0x2b6551));});};exports['abandoned']=function(_0x741a90,_0x5a3219,_0x444d63,_0x13e9d4,_0x3dd1d8,_0x2c6bee){var _0x5d7622,_0x25e9ac;_0x2c6bee[_0x00f0('0x19')]=intUtil['stripTrailingSlash'](_0x2c6bee['remoteUri']);_0x2c6bee[_0x00f0('0x46')]=intUtil[_0x00f0('0x47')](_0x2c6bee[_0x00f0('0x46')]);if(_0x3dd1d8&&_0x3dd1d8['monitor_format']){logger[_0x00f0('0xd')](_0x00f0('0x67'),'Recording\x20is\x20enabled!');_0x5a3219[_0x00f0('0x49')]=util[_0x00f0('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c6bee['serverUrl'],_0x5a3219[_0x00f0('0x4a')],md5(_0x5a3219['uniqueid']));}else{_0x5a3219[_0x00f0('0x49')]='';}headers[_0x00f0('0x4b')]=getAuth(_0x2c6bee);return getUser(_0x2c6bee)[_0x00f0('0x11')](function(_0x286753){_0x5d7622=_0x286753;logger[_0x00f0('0xd')](_0x00f0('0x4c'),_0x5d7622['id']);return getEndUser(_0x2c6bee,_0x5a3219[_0x00f0('0x4d')],_0x5a3219['calleridnum']);})[_0x00f0('0x11')](function(_0xeed15a){_0x25e9ac=_0xeed15a;logger[_0x00f0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x25e9ac['id']);return getTicket(_0x2c6bee,_0x5d7622,_0x25e9ac,_0x444d63,_0x5a3219);})['then'](function(_0x32ec8c){if(_0x32ec8c){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x32ec8c['id']);}})[_0x00f0('0x59')](function(_0x71a67b){logger[_0x00f0('0x57')]('[ABANDONED]',JSON['stringify'](_0x71a67b));});}; \ No newline at end of file +var _0x0334=['Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variableName','Variable','name','priority','getString','phone','new','Motion','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','then','total_entries','find','_embedded','Agent\x20found!','format','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0334,0xb1));var _0x4033=function(_0x7b2c6c,_0x5b5f08){_0x7b2c6c=_0x7b2c6c-0x0;var _0x189b13=_0x0334[_0x7b2c6c];return _0x189b13;};'use strict';var _=require(_0x4033('0x0'));var rp=require(_0x4033('0x1'));var md5=require(_0x4033('0x2'));var util=require(_0x4033('0x3'));var Redis=require(_0x4033('0x4'));var intUtil=require('./util');var config=require(_0x4033('0x5'));var logger=require(_0x4033('0x6'))(_0x4033('0x7'));config[_0x4033('0x8')]=_[_0x4033('0x9')](config['redis'],{'host':_0x4033('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4033('0x8')]));function emit(_0x33cc04,_0xad12d3,_0x207fa4){io['to'](_0x33cc04)['emit'](_0xad12d3,_0x207fa4);}var headers={'Content-Type':_0x4033('0xb'),'Accept':_0x4033('0xb')};function getUser(_0x26ae05,_0x29dbdb){if(intUtil[_0x4033('0xc')](_0x29dbdb)===!![]){logger[_0x4033('0xd')](_0x4033('0xe'),_0x29dbdb);return request({'uri':util['format'](_0x4033('0xf'),_0x26ae05[_0x4033('0x10')])})[_0x4033('0x11')](function(_0x682ddf){if(_0x682ddf[_0x4033('0x12')]){return _[_0x4033('0x13')](_0x682ddf[_0x4033('0x14')]['entries'],{'email':_0x29dbdb});}})['then'](function(_0x336dad){if(_0x336dad){logger[_0x4033('0xd')](_0x4033('0x15'));return _0x336dad;}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4033('0x16')](_0x4033('0x17'),_0x26ae05[_0x4033('0x10')])});}});}else{logger[_0x4033('0xd')](_0x4033('0x18'));return request({'uri':util[_0x4033('0x16')](_0x4033('0x17'),_0x26ae05['remoteUri'])});}}function request(_0x37c393){logger[_0x4033('0x19')]('[HTTP]',JSON[_0x4033('0x1a')](_0x37c393));return rp(_[_0x4033('0x9')](_0x37c393,{'method':_0x4033('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x1a24b6){var _0x2cd8b9;if(_0x1a24b6[_0x4033('0x1c')]===_0x4033('0x1d')){_0x2cd8b9=util[_0x4033('0x16')](_0x4033('0x1e'),_0x1a24b6[_0x4033('0x1f')],_0x1a24b6[_0x4033('0x20')]);}else if(_0x1a24b6[_0x4033('0x1c')]===_0x4033('0x21')){_0x2cd8b9=util[_0x4033('0x16')](_0x4033('0x22'),_0x1a24b6[_0x4033('0x1f')],_0x1a24b6[_0x4033('0x21')]);}return util['format'](_0x4033('0x23'),new Buffer(_0x2cd8b9)[_0x4033('0x24')](_0x4033('0x25')));}function getEndUser(_0x266cf2,_0x47fd61,_0x4b6ea4){logger['info'](_0x4033('0x26'),_0x4b6ea4);return request({'uri':util[_0x4033('0x16')](_0x4033('0x27'),_0x266cf2[_0x4033('0x10')]),'qs':{'phone':_0x4b6ea4}})[_0x4033('0x11')](function(_0x4f3afe){if(_0x4f3afe[_0x4033('0x12')]){logger[_0x4033('0xd')](_0x4033('0x28'));return _0x4f3afe[_0x4033('0x14')][_0x4033('0x29')][0x0];}else{logger[_0x4033('0xd')](_0x4033('0x2a'));return request({'uri':util[_0x4033('0x16')](_0x4033('0x2b'),_0x266cf2['remoteUri']),'method':_0x4033('0x2c'),'body':{'first_name':_0x47fd61,'title':_0x47fd61,'phone_numbers':[{'type':_0x4033('0x2d'),'value':_0x4b6ea4}]}});}});}function getTags(_0x42ae4d,_0x33bbb4){var _0x4c6460=[];if(_0x42ae4d&&_0x42ae4d[_0x4033('0x2e')]>0x0){_0x4c6460=_[_0x4033('0x2f')](_0x42ae4d,_0x33bbb4);}return _0x4c6460;}function getCustomFields(_0x1597cc,_0x587eb8){var _0x49e3ab=[];var _0x373a23={'custom_fields':{}};if(_0x1597cc['length']>0x0){_[_0x4033('0x30')](_0x1597cc,function(_0x1ac186){if(_0x1ac186[_0x4033('0x31')]===_0x4033('0x32')&&_0x1ac186['nameField']&&!_0x1ac186['customField']){_0x373a23[_0x1ac186[_0x4033('0x33')][_0x4033('0x34')]()]=_0x1ac186[_0x4033('0x35')][_0x4033('0x24')]();}else if(_0x1ac186[_0x4033('0x31')]===_0x4033('0x32')&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x373a23[_0x4033('0x38')][_0x1ac186[_0x4033('0x36')]]=_0x1ac186[_0x4033('0x35')][_0x4033('0x24')]();}else if(_0x1ac186[_0x4033('0x31')]==='variable'&&_0x1ac186[_0x4033('0x39')]&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x587eb8[_0x1ac186[_0x4033('0x39')]]&&(_0x373a23['custom_fields'][_0x1ac186[_0x4033('0x36')]]=_0x587eb8[_0x1ac186[_0x4033('0x39')]][_0x4033('0x24')]());}else if(_0x1ac186['type']==='customVariable'&&_0x1ac186[_0x4033('0x3a')]&&_0x1ac186[_0x4033('0x3a')][_0x4033('0x3b')]&&_0x1ac186[_0x4033('0x36')]&&_0x1ac186[_0x4033('0x37')]){_0x587eb8[_0x1ac186[_0x4033('0x3a')][_0x4033('0x3b')][_0x4033('0x34')]()]&&(_0x373a23[_0x4033('0x38')][_0x1ac186['idField']]=_0x587eb8[_0x1ac186['Variable'][_0x4033('0x3b')][_0x4033('0x34')]()][_0x4033('0x24')]());}});}if(_0x373a23[_0x4033('0x3c')]){_0x373a23['priority']=Number(_0x373a23[_0x4033('0x3c')]);}return _0x373a23;}function getTicket(_0x41d64b,_0x2e2c8c,_0x5dc304,_0x5345a5,_0x45d3da){logger[_0x4033('0xd')]('Creating\x20new\x20ticket...');var _0x7a1c3e=_['merge']({'subject':intUtil[_0x4033('0x3d')](_0x5345a5['Subjects'],_0x45d3da,'\x20'),'type':_0x4033('0x3e'),'status':_0x4033('0x3f'),'labels':['xCALLY',_0x4033('0x40'),_0x4033('0x41')][_0x4033('0x42')](getTags(_0x5345a5[_0x4033('0x43')],_0x4033('0x3b'))),'description':intUtil[_0x4033('0x3d')](_0x5345a5[_0x4033('0x44')],_0x45d3da,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x4033('0x45'),_0x2e2c8c['id']),'class':_0x4033('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0x5345a5[_0x4033('0x44')],_0x45d3da,'\x0a')}},getCustomFields(_0x5345a5[_0x4033('0x47')],_0x45d3da));return request({'uri':util[_0x4033('0x16')](_0x4033('0x48'),_0x41d64b[_0x4033('0x10')],_0x5dc304['id']),'method':'POST','body':_0x7a1c3e});}exports[_0x4033('0x49')]=function(_0x1eb8cf,_0x4ee97c,_0x21c0d8,_0x27fd9a,_0x27811c,_0x24aaca){var _0x289ed7,_0x10d51c;_0x24aaca[_0x4033('0x10')]=intUtil['stripTrailingSlash'](_0x24aaca[_0x4033('0x10')]);_0x24aaca[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x24aaca[_0x4033('0x4a')]);if(_0x27811c&&_0x27811c[_0x4033('0x4c')]){logger[_0x4033('0xd')]('[QUEUE]',_0x4033('0x4d'));_0x4ee97c[_0x4033('0x4e')]=util[_0x4033('0x16')](_0x4033('0x4f'),_0x24aaca['serverUrl'],_0x4ee97c['uniqueid'],md5(_0x4ee97c[_0x4033('0x50')]));}else{_0x4ee97c[_0x4033('0x4e')]='';}headers[_0x4033('0x51')]=getAuth(_0x24aaca);return getUser(_0x24aaca,_0x27fd9a[_0x4033('0x52')])[_0x4033('0x11')](function(_0x506655){_0x289ed7=_0x506655;logger[_0x4033('0xd')](_0x4033('0x53'),_0x289ed7['id']);return getEndUser(_0x24aaca,_0x4ee97c[_0x4033('0x54')],_0x4ee97c[_0x4033('0x55')]);})[_0x4033('0x11')](function(_0x4ccbe3){_0x10d51c=_0x4ccbe3;logger[_0x4033('0xd')]('The\x20Enduser\x20ID\x20is:',_0x10d51c['id']);return getTicket(_0x24aaca,_0x289ed7,_0x10d51c,_0x21c0d8,_0x4ee97c);})[_0x4033('0x11')](function(_0x568b02){if(_0x568b02){logger[_0x4033('0xd')]('Ticket\x20created!');logger['info'](_0x4033('0x56'),_0x568b02['id']);switch(_0x24aaca[_0x4033('0x31')]){case'integrationTab':logger['info'](_0x4033('0x57'),_0x4033('0x58'));emit(util[_0x4033('0x16')](_0x4033('0x59'),_0x27fd9a['name']),_0x4033('0x5a'),{'recordId':_0x568b02['id']});break;case _0x4033('0x5b'):logger[_0x4033('0xd')](_0x4033('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4033('0x16')]('user:%s',_0x27fd9a['name']),_0x4033('0x5c'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x568b02['id'])});break;default:logger[_0x4033('0x5d')](_0x4033('0x57'),_0x4033('0x5e'));}}})[_0x4033('0x5f')](function(_0x304914){console[_0x4033('0x5d')](_0x304914);logger[_0x4033('0x5d')]('[QUEUE]',JSON['stringify'](_0x304914));});};exports[_0x4033('0x60')]=function(_0x566a1f,_0x9093b7,_0x502679,_0x28d946,_0x386d44,_0x3dd503,_0x2b4b7f){var _0x435e66,_0xea614d;_0x3dd503[_0x4033('0x10')]=intUtil[_0x4033('0x4b')](_0x3dd503['remoteUri']);_0x3dd503[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x3dd503[_0x4033('0x4a')]);if(_0x2b4b7f&&_0x2b4b7f[_0x4033('0x61')]&&_0x2b4b7f['recordingFormat']!=='none'){logger[_0x4033('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x9093b7[_0x4033('0x4e')]=util[_0x4033('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3dd503[_0x4033('0x4a')],_0x9093b7[_0x4033('0x50')],md5(_0x9093b7[_0x4033('0x50')]));}headers[_0x4033('0x51')]=getAuth(_0x3dd503);return getUser(_0x3dd503,_0x28d946[_0x4033('0x52')])[_0x4033('0x11')](function(_0x469bb3){_0x435e66=_0x469bb3;logger[_0x4033('0xd')]('The\x20User\x20ID\x20is:',_0x435e66['id']);return getEndUser(_0x3dd503,_0x9093b7[_0x4033('0x62')],_0x9093b7[_0x4033('0x63')]);})[_0x4033('0x11')](function(_0x5719d9){_0xea614d=_0x5719d9;logger[_0x4033('0xd')](_0x4033('0x64'),_0xea614d['id']);return getTicket(_0x3dd503,_0x435e66,_0xea614d,_0x502679,_0x9093b7);})['then'](function(_0x3a37f0){if(_0x3a37f0){logger['info'](_0x4033('0x65'));logger[_0x4033('0xd')](_0x4033('0x56'),_0x3a37f0['id']);switch(_0x3dd503[_0x4033('0x31')]){case _0x4033('0x66'):logger['info'](_0x4033('0x57'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x4033('0x16')](_0x4033('0x59'),_0x28d946['name']),'trigger:desk:display',{'recordId':_0x3a37f0['id']});break;case _0x4033('0x5b'):logger['info'](_0x4033('0x57'),_0x4033('0x67'));emit(util[_0x4033('0x16')]('user:%s',_0x28d946[_0x4033('0x3b')]),'trigger:browser:url',{'uri':util[_0x4033('0x16')]('%s/agent/tickets/%s',_0x3dd503[_0x4033('0x10')],_0x3a37f0['id'])});break;default:logger['error']('[OUTBOUND]',_0x4033('0x5e'));}}})[_0x4033('0x5f')](function(_0x458344){logger['error']('[OUTBOUND]',JSON['stringify'](_0x458344));});};exports[_0x4033('0x68')]=function(_0x4d0434,_0x291847,_0x28d56b,_0x27b4cf,_0x54a0d0,_0x347537){var _0x1ddf03,_0x1eeef3;_0x347537[_0x4033('0x10')]=intUtil['stripTrailingSlash'](_0x347537['remoteUri']);_0x347537[_0x4033('0x4a')]=intUtil[_0x4033('0x4b')](_0x347537[_0x4033('0x4a')]);if(_0x54a0d0&&_0x54a0d0[_0x4033('0x4c')]){logger[_0x4033('0xd')]('[ABANDONED]',_0x4033('0x4d'));_0x291847[_0x4033('0x4e')]=util[_0x4033('0x16')](_0x4033('0x4f'),_0x347537['serverUrl'],_0x291847[_0x4033('0x50')],md5(_0x291847[_0x4033('0x50')]));}else{_0x291847['recordingURL']='';}headers[_0x4033('0x51')]=getAuth(_0x347537);return getUser(_0x347537)[_0x4033('0x11')](function(_0x378433){_0x1ddf03=_0x378433;logger[_0x4033('0xd')](_0x4033('0x53'),_0x1ddf03['id']);return getEndUser(_0x347537,_0x291847[_0x4033('0x54')],_0x291847['calleridnum']);})[_0x4033('0x11')](function(_0x23ebe3){_0x1eeef3=_0x23ebe3;logger['info'](_0x4033('0x64'),_0x1eeef3['id']);return getTicket(_0x347537,_0x1ddf03,_0x1eeef3,_0x28d56b,_0x291847);})[_0x4033('0x11')](function(_0xcfbe2e){if(_0xcfbe2e){logger[_0x4033('0xd')]('Ticket\x20created!');logger[_0x4033('0xd')]('The\x20Ticket\x20ID\x20is:',_0xcfbe2e['id']);}})[_0x4033('0x5f')](function(_0x11b658){logger[_0x4033('0x5d')](_0x4033('0x69'),JSON[_0x4033('0x1a')](_0x11b658));});}; \ 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 25e087c..db4a363 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 _0xc9f4=['catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','message','toLowerCase','destcalleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','calleridnum','telephone1','contactid','type','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecalls','Subjects','callDirection','queue','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token'];(function(_0x41a531,_0x563fa6){var _0x164b35=function(_0x5db756){while(--_0x5db756){_0x41a531['push'](_0x41a531['shift']());}};_0x164b35(++_0x563fa6);}(_0xc9f4,0x1cc));var _0x4c9f=function(_0xbbb22,_0x4d6a3c){_0xbbb22=_0xbbb22-0x0;var _0x5c6905=_0xc9f4[_0xbbb22];return _0x5c6905;};'use strict';var _=require(_0x4c9f('0x0'));var BPromise=require('bluebird');var rp=require(_0x4c9f('0x1'));var util=require(_0x4c9f('0x2'));var intUtil=require(_0x4c9f('0x3'));var md5=require(_0x4c9f('0x4'));var Redis=require(_0x4c9f('0x5'));var logger=require(_0x4c9f('0x6'))(_0x4c9f('0x7'));var config=require(_0x4c9f('0x8'));config['redis']=_[_0x4c9f('0x9')](config[_0x4c9f('0xa')],{'host':_0x4c9f('0xb'),'port':0x18eb});var io=require(_0x4c9f('0xc'))(new Redis(config['redis']));function getAuthToken(_0x39a70a,_0x47c142,_0x3c7f92){var _0x55745c={'method':_0x4c9f('0xd'),'uri':_0x47c142,'form':{'client_id':_0x39a70a[_0x4c9f('0xe')],'resource':_0x39a70a[_0x4c9f('0xf')],'username':_0x39a70a['username'],'password':_0x39a70a[_0x4c9f('0x10')],'grant_type':_0x4c9f('0x10'),'client_secret':_0x39a70a[_0x4c9f('0x11')]},'json':!![]};return rp(_0x55745c)[_0x4c9f('0x12')](function(_0x4cbce7){return _0x4cbce7[_0x4c9f('0x13')];})[_0x4c9f('0x14')](function(_0x4bd5ae){logger[_0x4c9f('0x15')]('['+[_0x3c7f92[_0x4c9f('0x16')]()]+_0x4c9f('0x17'));return _0x4bd5ae['message'];});}function getUser(_0x5534ce,_0x2f6499,_0x4e870f,_0x118578,_0x5a23a0,_0x1238cd){return new BPromise(function(_0x4dfd2c,_0x3d5789){return getAuthToken(_0x2f6499,_0x118578,_0x1238cd)[_0x4c9f('0x12')](function(_0x2573ff){var _0x831d02={'method':_0x4c9f('0x18'),'uri':_0x5a23a0+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x2573ff,'OData-Version':_0x4c9f('0x19')},'json':!![]};return rp(_0x831d02);})[_0x4c9f('0x12')](function(_0x559597){var _0x55a217=_0x559597[_0x4c9f('0x1a')];var _0x1a2f49=![];var _0x2f816f=null;if(!_[_0x4c9f('0x1b')](_0x4e870f)){if(intUtil[_0x4c9f('0x1c')](_0x4e870f[_0x4c9f('0x1d')])){_0x5534ce['userEmail']=_0x4e870f[_0x4c9f('0x1d')];for(_0x2f816f=0x0;_0x2f816f<_0x55a217[_0x4c9f('0x1e')];_0x2f816f++){if(_0x55a217[_0x2f816f][_0x4c9f('0x1f')]===_0x4e870f['email']&&!_0x55a217[_0x2f816f][_0x4c9f('0x20')]){_0x1a2f49=!![];logger['info']('['+[_0x1238cd[_0x4c9f('0x16')]()]+_0x4c9f('0x21')+_0x55a217[_0x2f816f][_0x4c9f('0x22')]+'!');_0x5534ce[_0x4c9f('0x23')]=_0x55a217[_0x2f816f][_0x4c9f('0x22')];}}}}if(!_0x1a2f49){logger[_0x4c9f('0x24')]('['+[_0x1238cd['toUpperCase']()]+_0x4c9f('0x25'));_0x5534ce[_0x4c9f('0x26')]=_0x2f6499[_0x4c9f('0x27')];for(_0x2f816f=0x0;_0x2f816f<_0x55a217['length'];_0x2f816f++){if(_0x55a217[_0x2f816f][_0x4c9f('0x1f')]===_0x2f6499[_0x4c9f('0x27')]){_0x5534ce[_0x4c9f('0x23')]=_0x55a217[_0x2f816f]['systemuserid'];}}}_0x4dfd2c(_0x5534ce);})[_0x4c9f('0x14')](function(_0x1cb1f7){_0x3d5789(_0x1cb1f7[_0x4c9f('0x28')]);});});}function createEndUser(_0x13c13e,_0x3af35d,_0x263459,_0x5a524d,_0x262f5c,_0x27e663){return new BPromise(function(_0x2f81ff,_0x1fcf19){return getAuthToken(_0x3af35d,_0x263459,_0x27e663)[_0x4c9f('0x12')](function(_0x126ccc){var _0x5ebb7b=_0x27e663[_0x4c9f('0x29')]()==='outbound'?_0x262f5c[_0x4c9f('0x2a')]:_0x262f5c['calleridnum'];var _0x5d73ff={'method':'POST','uri':_0x5a524d+'contacts','body':{'telephone1':_0x5ebb7b,'fullname':_0x5ebb7b,'firstname':_0x5ebb7b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4c9f('0x2b')+_0x13c13e['userId']+')'},'headers':{'Authorization':_0x4c9f('0x2c')+_0x126ccc,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5d73ff);})[_0x4c9f('0x12')](function(_0x24f396){var _0x5a4620=_0x24f396[_0x4c9f('0x2d')][_0x4c9f('0x2e')];var _0x84451e=_0x5a4620[_0x4c9f('0x2f')](_0x5a4620[_0x4c9f('0x30')]('(')+0x1,_0x5a4620[_0x4c9f('0x30')](')'));_0x13c13e[_0x4c9f('0x31')]=_0x84451e;_0x2f81ff(_0x13c13e);})[_0x4c9f('0x14')](function(_0x5adf01){_0x1fcf19(_0x5adf01[_0x4c9f('0x28')]);});});}function getEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1){return new BPromise(function(_0x9b9a03,_0x251710){return getAuthToken(_0x4aaff5,_0x5ce0b3,_0x54c2a1)[_0x4c9f('0x12')](function(_0x5b1f4f){var _0x3289c1={'method':_0x4c9f('0x18'),'uri':_0x400ecb+_0x4c9f('0x32'),'headers':{'Authorization':_0x4c9f('0x2c')+_0x5b1f4f,'If-None-Match':null,'OData-Version':_0x4c9f('0x19')},'json':!![]};return rp(_0x3289c1);})['then'](function(_0x1fa541){var _0x8f326a=null;if(_0x1fa541){var _0x2919a8=_0x1fa541[_0x4c9f('0x1a')];var _0xde2eb3=![];for(_0x8f326a=0x0;_0x8f326a<_0x2919a8['length'];_0x8f326a++){var _0x2fc58e=_0x54c2a1[_0x4c9f('0x29')]()===_0x4c9f('0x33')?_0x444d4f[_0x4c9f('0x2a')]:_0x444d4f[_0x4c9f('0x34')];if(_0x2919a8[_0x8f326a][_0x4c9f('0x35')]===_0x2fc58e){_0xde2eb3=!![];_0x452f9d[_0x4c9f('0x31')]=_0x2919a8[_0x8f326a][_0x4c9f('0x36')];}}if(_0xde2eb3){_0x9b9a03(_0x452f9d);}else{return createEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1)[_0x4c9f('0x12')](function(_0x4db790){logger[_0x4c9f('0x24')]('['+[_0x54c2a1['toUpperCase']()]+']\x20Enduser\x20created!',_0x4db790[_0x4c9f('0x31')]);_0x9b9a03(_0x4db790);});}}else{return createEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1)['then'](function(_0x6b1214){logger[_0x4c9f('0x24')]('['+[_0x54c2a1[_0x4c9f('0x16')]()]+']\x20Enduser\x20Created!',_0x6b1214['enduserId']);_0x9b9a03(_0x6b1214);});}});});}function getCustomFields(_0x26ccba,_0x5851d7,_0x572cc1){var _0x478b9f={};if(_0x26ccba[_0x4c9f('0x1e')]>0x0){_['forEach'](_0x26ccba,function(_0x3b6f2d){if(_0x3b6f2d[_0x4c9f('0x37')]==='string'&&_0x3b6f2d[_0x4c9f('0x38')]&&!_0x3b6f2d['customField']){var _0x46946b=_0x3b6f2d['idField'][_0x4c9f('0x29')]();var _0x4d4f2b=_0x46946b[_0x4c9f('0x2f')](0x0,_0x46946b[_0x4c9f('0x39')]('_'));var _0x225af2=_0x46946b[_0x4c9f('0x2f')](_0x46946b[_0x4c9f('0x39')]('_')+0x1);if(_0x4d4f2b===_0x572cc1){_0x478b9f[_0x225af2]=_0x3b6f2d[_0x4c9f('0x3a')];}}});}return _0x478b9f;}function getTicket(_0x151eda,_0x4c5596,_0x40a932,_0x55feef,_0x1eb361,_0x136c97,_0x223b11){return new BPromise(function(_0x31e2c7,_0xe2b9ad){var _0x17cca9;return getAuthToken(_0x4c5596,_0x40a932,_0x223b11)['then'](function(_0x189735){if(_0x136c97[_0x4c9f('0x3b')]===_0x4c9f('0x3c')){_0x17cca9={'method':_0x4c9f('0xd'),'uri':_0x55feef+_0x4c9f('0x3d'),'body':Object[_0x4c9f('0x3e')]({},{'title':intUtil['getString'](_0x136c97['Subjects'],_0x1eb361,'\x20'),'description':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x40')],_0x1eb361,'\x0a'),'customerid_contact@odata.bind':_0x4c9f('0x41')+_0x151eda[_0x4c9f('0x31')]+')','ownerid@odata.bind':_0x4c9f('0x2b')+_0x151eda['userId']+')','caseorigincode':'1'},getCustomFields(_0x136c97[_0x4c9f('0x42')],_0x1eb361,_0x136c97[_0x4c9f('0x3b')])),'headers':{'Authorization':_0x4c9f('0x2c')+_0x189735,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x136c97[_0x4c9f('0x3b')]==='phonecall'){_0x17cca9={'method':'POST','uri':_0x55feef+_0x4c9f('0x43'),'body':Object[_0x4c9f('0x3e')]({},{'subject':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x44')],_0x1eb361,'\x20'),'phonenumber':String(_0x1eb361[_0x4c9f('0x34')]),'description':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x40')],_0x1eb361,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4c9f('0x41')+_0x151eda[_0x4c9f('0x31')]+')','ownerid@odata.bind':_0x4c9f('0x2b')+_0x151eda[_0x4c9f('0x23')]+')','directioncode':_0x151eda[_0x4c9f('0x45')]===_0x4c9f('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4c9f('0x2b')+_0x151eda['userId']+')','participationtypemask':_0x151eda[_0x4c9f('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x151eda[_0x4c9f('0x31')]+')','participationtypemask':_0x151eda[_0x4c9f('0x45')]===_0x4c9f('0x46')?0x1:0x2}]},getCustomFields(_0x136c97['Fields'],_0x1eb361,_0x136c97[_0x4c9f('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x189735,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x17cca9);})['then'](function(_0x13cb65){var _0x2ab3a4=_0x13cb65[_0x4c9f('0x2d')]['odata-entityid'];var _0x1eed62=_0x2ab3a4[_0x4c9f('0x2f')](_0x2ab3a4['lastIndexOf']('(')+0x1,_0x2ab3a4['lastIndexOf'](')'));_0x151eda[_0x4c9f('0x47')]=_0x1eed62;_0x31e2c7(_0x151eda);})[_0x4c9f('0x14')](function(_0x14f403){_0xe2b9ad(_0x14f403[_0x4c9f('0x28')]);});});}function emit(_0x5512dc,_0x47c741,_0x213522,_0x1e23ea){var _0x19dc35={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5512dc,_0x213522,_0x1e23ea)};io['to'](util[_0x4c9f('0x48')](_0x4c9f('0x49'),_0x47c741))[_0x4c9f('0x4a')](_0x4c9f('0x4b'),_0x19dc35);}exports['cs']=function(_0x7b8c57,_0x88b9f2,_0x376987,_0x5016fc,_0x50e827,_0x576f7a,_0xe5155e,_0x35e9be){var _0x5b98cd={};_0x576f7a[_0x4c9f('0xf')]=intUtil['stripTrailingSlash'](_0x576f7a['remoteUri']);_0x576f7a[_0x4c9f('0x4c')]=intUtil['stripTrailingSlash'](_0x576f7a[_0x4c9f('0x4c')]);_0x5b98cd['callDirection']=_0x35e9be===_0x4c9f('0x46')||_0x35e9be===_0x4c9f('0x4d')?_0x4c9f('0x46'):_0x4c9f('0x33');var _0x2c92e6=util[_0x4c9f('0x48')](_0x4c9f('0x4e'),_0x576f7a[_0x4c9f('0xf')]);var _0xcd972=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x576f7a[_0x4c9f('0x4f')]);var _0x474066=util[_0x4c9f('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x576f7a[_0x4c9f('0x4c')],_0x88b9f2['uniqueid'],md5(_0x88b9f2['uniqueid']));if(_0x50e827&&_0x50e827['monitor_format']){logger[_0x4c9f('0x24')](_0x4c9f('0x50'),_0x4c9f('0x51'));_0x88b9f2[_0x4c9f('0x52')]=_0x474066;}else if(_0xe5155e&&_0xe5155e[_0x4c9f('0x53')]&&_0xe5155e[_0x4c9f('0x53')]!==_0x4c9f('0x54')){logger[_0x4c9f('0x24')](_0x4c9f('0x55'),_0x4c9f('0x51'));_0x88b9f2[_0x4c9f('0x52')]=_0x474066;}else{_0x88b9f2[_0x4c9f('0x52')]='';}return getUser(_0x5b98cd,_0x576f7a,_0x5016fc,_0xcd972,_0x2c92e6,_0x35e9be)[_0x4c9f('0x12')](function(_0x26682c){logger[_0x4c9f('0x24')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x56'),_0x26682c[_0x4c9f('0x23')]);logger[_0x4c9f('0x24')]('['+_0x35e9be['toUpperCase']()+_0x4c9f('0x57'),_0x26682c['userEmail']);return getEndUser(_0x26682c,_0x576f7a,_0xcd972,_0x2c92e6,_0x88b9f2,_0x35e9be);})[_0x4c9f('0x12')](function(_0x4a4801){logger['info']('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x58'),_0x4a4801[_0x4c9f('0x31')]);logger['info']('['+_0x35e9be['toUpperCase']()+_0x4c9f('0x59'),_0x88b9f2[_0x4c9f('0x34')]);return getTicket(_0x4a4801,_0x576f7a,_0xcd972,_0x2c92e6,_0x88b9f2,_0x376987,_0x35e9be);})[_0x4c9f('0x12')](function(_0x3b06cc){logger['info'](util[_0x4c9f('0x48')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5a'),_0x376987['ticketType'],_0x3b06cc[_0x4c9f('0x47')]));logger[_0x4c9f('0x24')](util[_0x4c9f('0x48')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5b'),_0x35e9be));if(_0x35e9be!==_0x4c9f('0x4d')){logger[_0x4c9f('0x24')]('['+_0x35e9be['toUpperCase']()+']',_0x4c9f('0x5c'));emit(_0x576f7a['remoteUri'],_0x5016fc[_0x4c9f('0x5d')],_0x376987['ticketType'],_0x3b06cc[_0x4c9f('0x47')]);}})[_0x4c9f('0x14')](function(_0x5c4775){logger['error']('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5e'),util[_0x4c9f('0x5f')](_0x5c4775,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4b49=['content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','phonecall','phonecalls','Subjects','callDirection','queue','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','dynamics365','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','GET','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf'];(function(_0x4d886a,_0x1980d3){var _0x3fa895=function(_0x3731f8){while(--_0x3731f8){_0x4d886a['push'](_0x4d886a['shift']());}};_0x3fa895(++_0x1980d3);}(_0x4b49,0xef));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x94b4('0x0'));var BPromise=require(_0x94b4('0x1'));var rp=require(_0x94b4('0x2'));var util=require('util');var intUtil=require(_0x94b4('0x3'));var md5=require(_0x94b4('0x4'));var Redis=require(_0x94b4('0x5'));var logger=require('../../../../config/logger')(_0x94b4('0x6'));var config=require('../../../../config/environment');config[_0x94b4('0x7')]=_['defaults'](config['redis'],{'host':_0x94b4('0x8'),'port':0x18eb});var io=require(_0x94b4('0x9'))(new Redis(config[_0x94b4('0x7')]));function getAuthToken(_0x26eace,_0x1ff3e2,_0x1ce3ba){var _0x7705ce={'method':_0x94b4('0xa'),'uri':_0x1ff3e2,'form':{'client_id':_0x26eace['clientId'],'resource':_0x26eace[_0x94b4('0xb')],'username':_0x26eace[_0x94b4('0xc')],'password':_0x26eace[_0x94b4('0xd')],'grant_type':'password','client_secret':_0x26eace[_0x94b4('0xe')]},'json':!![]};return rp(_0x7705ce)[_0x94b4('0xf')](function(_0x3a492d){return _0x3a492d[_0x94b4('0x10')];})[_0x94b4('0x11')](function(_0x310147){logger['error']('['+[_0x1ce3ba[_0x94b4('0x12')]()]+_0x94b4('0x13'));return _0x310147[_0x94b4('0x14')];});}function getUser(_0x31b8a6,_0x248df6,_0x404ce8,_0x38057f,_0x5bdce7,_0x519c1c){return new BPromise(function(_0x5e1ed3,_0x5f428e){return getAuthToken(_0x248df6,_0x38057f,_0x519c1c)[_0x94b4('0xf')](function(_0x4c2d2c){var _0x1d8348={'method':'GET','uri':_0x5bdce7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x94b4('0x15')+_0x4c2d2c,'OData-Version':_0x94b4('0x16')},'json':!![]};return rp(_0x1d8348);})['then'](function(_0x1d5403){var _0x2f4cf5=_0x1d5403[_0x94b4('0x17')];var _0x246a9f=![];var _0x4744b5=null;if(!_[_0x94b4('0x18')](_0x404ce8)){if(intUtil[_0x94b4('0x19')](_0x404ce8[_0x94b4('0x1a')])){_0x31b8a6[_0x94b4('0x1b')]=_0x404ce8['email'];for(_0x4744b5=0x0;_0x4744b5<_0x2f4cf5[_0x94b4('0x1c')];_0x4744b5++){if(_0x2f4cf5[_0x4744b5]['internalemailaddress']===_0x404ce8[_0x94b4('0x1a')]&&!_0x2f4cf5[_0x4744b5]['isdisabled']){_0x246a9f=!![];logger[_0x94b4('0x1d')]('['+[_0x519c1c[_0x94b4('0x12')]()]+_0x94b4('0x1e')+_0x2f4cf5[_0x4744b5][_0x94b4('0x1f')]+'!');_0x31b8a6['userId']=_0x2f4cf5[_0x4744b5][_0x94b4('0x1f')];}}}}if(!_0x246a9f){logger[_0x94b4('0x1d')]('['+[_0x519c1c[_0x94b4('0x12')]()]+_0x94b4('0x20'));_0x31b8a6['userEmail']=_0x248df6['username'];for(_0x4744b5=0x0;_0x4744b5<_0x2f4cf5[_0x94b4('0x1c')];_0x4744b5++){if(_0x2f4cf5[_0x4744b5][_0x94b4('0x21')]===_0x248df6[_0x94b4('0xc')]){_0x31b8a6[_0x94b4('0x22')]=_0x2f4cf5[_0x4744b5]['systemuserid'];}}}_0x5e1ed3(_0x31b8a6);})[_0x94b4('0x11')](function(_0x3d93c4){_0x5f428e(_0x3d93c4[_0x94b4('0x14')]);});});}function createEndUser(_0x50797d,_0x245ddf,_0x4ad4c7,_0x3b3453,_0x247ec8,_0x4bc14d){return new BPromise(function(_0x5bffb0,_0x467301){return getAuthToken(_0x245ddf,_0x4ad4c7,_0x4bc14d)[_0x94b4('0xf')](function(_0x215658){var _0x1f7273=_0x4bc14d[_0x94b4('0x23')]()===_0x94b4('0x24')?_0x247ec8[_0x94b4('0x25')]:_0x247ec8[_0x94b4('0x26')];var _0x44246d={'method':_0x94b4('0xa'),'uri':_0x3b3453+_0x94b4('0x27'),'body':{'telephone1':_0x1f7273,'fullname':_0x1f7273,'firstname':_0x1f7273,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x94b4('0x28')+_0x50797d[_0x94b4('0x22')]+')'},'headers':{'Authorization':_0x94b4('0x15')+_0x215658,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44246d);})[_0x94b4('0xf')](function(_0x4e2b8c){var _0x8487f9=_0x4e2b8c[_0x94b4('0x29')][_0x94b4('0x2a')];var _0x53305d=_0x8487f9[_0x94b4('0x2b')](_0x8487f9['lastIndexOf']('(')+0x1,_0x8487f9[_0x94b4('0x2c')](')'));_0x50797d['enduserId']=_0x53305d;_0x5bffb0(_0x50797d);})['catch'](function(_0x503c3c){_0x467301(_0x503c3c[_0x94b4('0x14')]);});});}function getEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7){return new BPromise(function(_0x4c1107,_0xfaffee){return getAuthToken(_0xf21fe0,_0x5c02ab,_0x1716e7)[_0x94b4('0xf')](function(_0x19be52){var _0x5de553={'method':_0x94b4('0x2d'),'uri':_0x250344+'contacts?$select=telephone1','headers':{'Authorization':'Bearer\x20'+_0x19be52,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5de553);})[_0x94b4('0xf')](function(_0x21e9cb){var _0x301817=null;if(_0x21e9cb){var _0xd9f6a0=_0x21e9cb[_0x94b4('0x17')];var _0x254977=![];for(_0x301817=0x0;_0x301817<_0xd9f6a0[_0x94b4('0x1c')];_0x301817++){var _0x31b84d=_0x1716e7[_0x94b4('0x23')]()===_0x94b4('0x24')?_0xa7a18a[_0x94b4('0x25')]:_0xa7a18a[_0x94b4('0x26')];if(_0xd9f6a0[_0x301817][_0x94b4('0x2e')]===_0x31b84d){_0x254977=!![];_0x5a6d85['enduserId']=_0xd9f6a0[_0x301817][_0x94b4('0x2f')];}}if(_0x254977){_0x4c1107(_0x5a6d85);}else{return createEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7)[_0x94b4('0xf')](function(_0x34aca0){logger[_0x94b4('0x1d')]('['+[_0x1716e7[_0x94b4('0x12')]()]+_0x94b4('0x30'),_0x34aca0[_0x94b4('0x31')]);_0x4c1107(_0x34aca0);});}}else{return createEndUser(_0x5a6d85,_0xf21fe0,_0x5c02ab,_0x250344,_0xa7a18a,_0x1716e7)['then'](function(_0x3089f6){logger['info']('['+[_0x1716e7['toUpperCase']()]+_0x94b4('0x32'),_0x3089f6[_0x94b4('0x31')]);_0x4c1107(_0x3089f6);});}});});}function getCustomFields(_0x1d01c3,_0x19fcbd,_0x591c68){var _0x38ae70={};if(_0x1d01c3['length']>0x0){_[_0x94b4('0x33')](_0x1d01c3,function(_0x388da2){if(_0x388da2[_0x94b4('0x34')]===_0x94b4('0x35')&&_0x388da2[_0x94b4('0x36')]&&!_0x388da2[_0x94b4('0x37')]){var _0x8c9fbe=_0x388da2[_0x94b4('0x38')][_0x94b4('0x23')]();var _0x3f604f=_0x8c9fbe[_0x94b4('0x2b')](0x0,_0x8c9fbe['indexOf']('_'));var _0x2c3e0d=_0x8c9fbe[_0x94b4('0x2b')](_0x8c9fbe[_0x94b4('0x39')]('_')+0x1);if(_0x3f604f===_0x591c68){_0x38ae70[_0x2c3e0d]=_0x388da2[_0x94b4('0x3a')];}}});}return _0x38ae70;}function getTicket(_0x3232bf,_0x7e3c37,_0x13e8d1,_0x15bc00,_0x6a5b59,_0xe61265,_0x5e59bc){return new BPromise(function(_0x46c638,_0x5cb08c){var _0x40110a;return getAuthToken(_0x7e3c37,_0x13e8d1,_0x5e59bc)[_0x94b4('0xf')](function(_0x3d6da2){if(_0xe61265[_0x94b4('0x3b')]===_0x94b4('0x3c')){_0x40110a={'method':_0x94b4('0xa'),'uri':_0x15bc00+_0x94b4('0x3d'),'body':Object[_0x94b4('0x3e')]({},{'title':intUtil[_0x94b4('0x3f')](_0xe61265['Subjects'],_0x6a5b59,'\x20'),'description':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x40')],_0x6a5b59,'\x0a'),'customerid_contact@odata.bind':_0x94b4('0x41')+_0x3232bf[_0x94b4('0x31')]+')','ownerid@odata.bind':_0x94b4('0x28')+_0x3232bf['userId']+')','caseorigincode':'1'},getCustomFields(_0xe61265['Fields'],_0x6a5b59,_0xe61265[_0x94b4('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x3d6da2,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xe61265[_0x94b4('0x3b')]===_0x94b4('0x42')){_0x40110a={'method':_0x94b4('0xa'),'uri':_0x15bc00+_0x94b4('0x43'),'body':Object[_0x94b4('0x3e')]({},{'subject':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x44')],_0x6a5b59,'\x20'),'phonenumber':String(_0x6a5b59[_0x94b4('0x26')]),'description':intUtil[_0x94b4('0x3f')](_0xe61265[_0x94b4('0x40')],_0x6a5b59,'\x0a'),'regardingobjectid_contact@odata.bind':_0x94b4('0x41')+_0x3232bf[_0x94b4('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x3232bf[_0x94b4('0x22')]+')','directioncode':_0x3232bf[_0x94b4('0x45')]===_0x94b4('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x94b4('0x28')+_0x3232bf['userId']+')','participationtypemask':_0x3232bf['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3232bf[_0x94b4('0x31')]+')','participationtypemask':_0x3232bf[_0x94b4('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0xe61265[_0x94b4('0x47')],_0x6a5b59,_0xe61265[_0x94b4('0x3b')])),'headers':{'Authorization':_0x94b4('0x15')+_0x3d6da2,'OData-Version':_0x94b4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x40110a);})[_0x94b4('0xf')](function(_0x1df567){var _0x3fab65=_0x1df567[_0x94b4('0x29')][_0x94b4('0x2a')];var _0x493c6e=_0x3fab65['substring'](_0x3fab65['lastIndexOf']('(')+0x1,_0x3fab65[_0x94b4('0x2c')](')'));_0x3232bf[_0x94b4('0x48')]=_0x493c6e;_0x46c638(_0x3232bf);})[_0x94b4('0x11')](function(_0x52571a){_0x5cb08c(_0x52571a[_0x94b4('0x14')]);});});}function emit(_0x4f5def,_0x3e65f7,_0x375fa9,_0x53adeb){var _0x5c6eba={'uri':util['format'](_0x94b4('0x49'),_0x4f5def,_0x375fa9,_0x53adeb)};io['to'](util[_0x94b4('0x4a')](_0x94b4('0x4b'),_0x3e65f7))['emit'](_0x94b4('0x4c'),_0x5c6eba);}exports['cs']=function(_0x31ac55,_0x4b43eb,_0x300d13,_0x4c530f,_0x5b7ac2,_0x25dfe1,_0x3edc9e,_0x33b66c){var _0x37f57a={};_0x25dfe1[_0x94b4('0xb')]=intUtil[_0x94b4('0x4d')](_0x25dfe1['remoteUri']);_0x25dfe1[_0x94b4('0x4e')]=intUtil[_0x94b4('0x4d')](_0x25dfe1['serverUrl']);_0x37f57a[_0x94b4('0x45')]=_0x33b66c===_0x94b4('0x46')||_0x33b66c===_0x94b4('0x4f')?'queue':'outbound';var _0x275c84=util[_0x94b4('0x4a')]('%s/api/data/v9.0/',_0x25dfe1[_0x94b4('0xb')]);var _0x32190d=util['format'](_0x94b4('0x50'),_0x25dfe1[_0x94b4('0x51')]);var _0x2ea479=util['format'](_0x94b4('0x52'),_0x25dfe1['serverUrl'],_0x4b43eb['uniqueid'],md5(_0x4b43eb[_0x94b4('0x53')]));if(_0x5b7ac2&&_0x5b7ac2['monitor_format']){logger['info'](_0x94b4('0x54'),_0x94b4('0x55'));_0x4b43eb['recordingURL']=_0x2ea479;}else if(_0x3edc9e&&_0x3edc9e[_0x94b4('0x56')]&&_0x3edc9e[_0x94b4('0x56')]!==_0x94b4('0x57')){logger[_0x94b4('0x1d')](_0x94b4('0x58'),'Recording\x20is\x20enabled!');_0x4b43eb['recordingURL']=_0x2ea479;}else{_0x4b43eb['recordingURL']='';}return getUser(_0x37f57a,_0x25dfe1,_0x4c530f,_0x32190d,_0x275c84,_0x33b66c)[_0x94b4('0xf')](function(_0x56d3ce){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+_0x94b4('0x59'),_0x56d3ce['userId']);logger[_0x94b4('0x1d')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5a'),_0x56d3ce['userEmail']);return getEndUser(_0x56d3ce,_0x25dfe1,_0x32190d,_0x275c84,_0x4b43eb,_0x33b66c);})[_0x94b4('0xf')](function(_0xd93dfe){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+_0x94b4('0x5b'),_0xd93dfe[_0x94b4('0x31')]);logger[_0x94b4('0x1d')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5c'),_0x4b43eb[_0x94b4('0x26')]);return getTicket(_0xd93dfe,_0x25dfe1,_0x32190d,_0x275c84,_0x4b43eb,_0x300d13,_0x33b66c);})[_0x94b4('0xf')](function(_0x54d66f){logger[_0x94b4('0x1d')](util[_0x94b4('0x4a')]('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5d'),_0x300d13[_0x94b4('0x3b')],_0x54d66f[_0x94b4('0x48')]));logger[_0x94b4('0x1d')](util['format']('['+_0x33b66c[_0x94b4('0x12')]()+_0x94b4('0x5e'),_0x33b66c));if(_0x33b66c!==_0x94b4('0x4f')){logger[_0x94b4('0x1d')]('['+_0x33b66c['toUpperCase']()+']',_0x94b4('0x5f'));emit(_0x25dfe1['remoteUri'],_0x4c530f[_0x94b4('0x60')],_0x300d13[_0x94b4('0x3b')],_0x54d66f['ticketId']);}})[_0x94b4('0x11')](function(_0xe97df9){logger[_0x94b4('0x61')]('['+_0x33b66c[_0x94b4('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x94b4('0x62')](_0xe97df9,{'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 104b858..16d0fe3 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 _0x9f34=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','user:%s','abandoned','Recording\x20is\x20enabled!','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','format','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','forEach','type','string','nameField','customField','toLowerCase','content','push','idField','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x47a2cb,_0x170391){var _0x4bddcc=function(_0x33a9d4){while(--_0x33a9d4){_0x47a2cb['push'](_0x47a2cb['shift']());}};_0x4bddcc(++_0x170391);}(_0x9f34,0x162));var _0x49f3=function(_0x5947e2,_0x1abef5){_0x5947e2=_0x5947e2-0x0;var _0x295a86=_0x9f34[_0x5947e2];return _0x295a86;};'use strict';var _=require(_0x49f3('0x0'));var rp=require('request-promise');var md5=require(_0x49f3('0x1'));var util=require(_0x49f3('0x2'));var Redis=require(_0x49f3('0x3'));var intUtil=require(_0x49f3('0x4'));var config=require(_0x49f3('0x5'));var logger=require('../../../../config/logger')('freshdesk');config[_0x49f3('0x6')]=_['defaults'](config[_0x49f3('0x6')],{'host':_0x49f3('0x7'),'port':0x18eb});var io=require(_0x49f3('0x8'))(new Redis(config[_0x49f3('0x6')]));var headers={'Content-Type':_0x49f3('0x9'),'Accept':'application/json'};function emit(_0x3add84,_0x25f040,_0x3416d9){io['to'](_0x3add84)[_0x49f3('0xa')](_0x25f040,_0x3416d9);}function getTicket(_0x57b3fe,_0x324706,_0x502c3f,_0x588cd5,_0x579c4c){logger[_0x49f3('0xb')](_0x49f3('0xc'));var _0xb8e174=_['merge']({'responder_id':_0x324706['id'],'requester_id':_0x502c3f['id'],'name':util['format'](_0x49f3('0xd'),_0x579c4c[_0x49f3('0xe')]),'phone':_0x579c4c[_0x49f3('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x49f3('0x10')](_0x588cd5[_0x49f3('0x11')],_0x579c4c,'\x20'),'description':intUtil[_0x49f3('0x10')](_0x588cd5[_0x49f3('0x12')],_0x579c4c,_0x49f3('0x13')),'tags':getTags(_0x588cd5[_0x49f3('0x14')],_0x49f3('0x15'))},getCustomFields(_0x588cd5[_0x49f3('0x16')],_0x579c4c));_0xb8e174[_0x49f3('0x17')]=_['mapValues'](_[_0x49f3('0x18')](_0xb8e174[_0x49f3('0x17')],'id'),'value');return request({'uri':util['format'](_0x49f3('0x19'),_0x57b3fe[_0x49f3('0x1a')]),'method':_0x49f3('0x1b'),'body':_0xb8e174})[_0x49f3('0x1c')](function(_0x3206ff){logger[_0x49f3('0xb')](_0x49f3('0x1d'));return _0x3206ff;});}function getUser(_0x13af67,_0xcedc9b){if(intUtil['validateEmail'](_0xcedc9b)){return request({'uri':util[_0x49f3('0x1e')](_0x49f3('0x1f'),_0x13af67[_0x49f3('0x1a')]),'qs':{'email':_0xcedc9b}})[_0x49f3('0x1c')](function(_0x575171){if(_0x575171[_0x49f3('0x20')]){logger[_0x49f3('0xb')]('Agent\x20found!');return _[_0x49f3('0x21')](_0x575171,function(_0x3d2e3b){return _0x3d2e3b[_0x49f3('0x22')][_0x49f3('0x23')]===_0xcedc9b;});}else{logger[_0x49f3('0xb')](_0x49f3('0x24'));return request({'uri':util['format'](_0x49f3('0x25'),_0x13af67[_0x49f3('0x1a')])})[_0x49f3('0x1c')](function(_0x359090){logger['info'](_0x49f3('0x26'));return _0x359090;});}});}else{logger[_0x49f3('0xb')](_0x49f3('0x27'));return request({'uri':util['format'](_0x49f3('0x25'),_0x13af67[_0x49f3('0x1a')])})[_0x49f3('0x1c')](function(_0x3b873f){logger['info'](_0x49f3('0x26'));return _0x3b873f;});}}function getEndUser(_0x31f50e,_0x35d441,_0x41a267){logger[_0x49f3('0xb')](_0x49f3('0x28'),_0x41a267);return request({'uri':util[_0x49f3('0x1e')]('%s/api/v2/contacts',_0x31f50e['remoteUri']),'qs':{'phone':_0x41a267}})[_0x49f3('0x1c')](function(_0x26a2f9){if(_0x26a2f9[_0x49f3('0x20')]){logger[_0x49f3('0xb')](_0x49f3('0x29'));return _[_0x49f3('0x21')](_0x26a2f9,{'phone':_0x41a267});}else{logger['info'](_0x49f3('0x2a'));return request({'uri':util[_0x49f3('0x1e')]('%s/api/v2/contacts',_0x31f50e[_0x49f3('0x1a')]),'method':_0x49f3('0x1b'),'body':{'name':_0x35d441,'phone':_0x41a267}})[_0x49f3('0x1c')](function(_0x466dc5){logger[_0x49f3('0xb')]('Enduser\x20created.');return _0x466dc5;});}});}function getAuth(_0x3e80b2){return util[_0x49f3('0x1e')](_0x49f3('0x2b'),new Buffer(_0x3e80b2[_0x49f3('0x2c')]+':X')[_0x49f3('0x2d')](_0x49f3('0x2e')));}function request(_0x5b39f6){logger[_0x49f3('0x2f')](_0x49f3('0x30'),JSON[_0x49f3('0x31')](_0x5b39f6));return rp(_[_0x49f3('0x32')](_0x5b39f6,{'method':_0x49f3('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x50adab,_0x2f223d){var _0x163868=[];if(_0x50adab&&_0x50adab[_0x49f3('0x20')]>0x0){_0x163868=_['map'](_0x50adab,_0x2f223d);}return _0x163868;}function getCustomFields(_0x24983a,_0x30b946){var _0xed920d=[];var _0x1a0b55={'custom_fields':[]};if(_0x24983a[_0x49f3('0x20')]>0x0){_[_0x49f3('0x34')](_0x24983a,function(_0x253f5c){if(_0x253f5c[_0x49f3('0x35')]===_0x49f3('0x36')&&_0x253f5c[_0x49f3('0x37')]&&!_0x253f5c[_0x49f3('0x38')]){_0x1a0b55[_0x253f5c[_0x49f3('0x37')][_0x49f3('0x39')]()]=_0x253f5c[_0x49f3('0x3a')][_0x49f3('0x2d')]();}else if(_0x253f5c[_0x49f3('0x35')]===_0x49f3('0x36')&&_0x253f5c['idField']&&_0x253f5c['customField']){_0x1a0b55['custom_fields'][_0x49f3('0x3b')]({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x253f5c[_0x49f3('0x3a')][_0x49f3('0x2d')]()});}else if(_0x253f5c[_0x49f3('0x35')]==='variable'&&_0x253f5c['variableName']&&_0x253f5c[_0x49f3('0x3c')]&&_0x253f5c[_0x49f3('0x38')]){_0x30b946[_0x253f5c['variableName']]&&_0x1a0b55[_0x49f3('0x17')][_0x49f3('0x3b')]({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x30b946[_0x253f5c[_0x49f3('0x3d')]]['toString']()});}else if(_0x253f5c[_0x49f3('0x35')]==='customVariable'&&_0x253f5c[_0x49f3('0x3e')]&&_0x253f5c[_0x49f3('0x3e')][_0x49f3('0x15')]&&_0x253f5c[_0x49f3('0x3c')]&&_0x253f5c['customField']){_0x30b946[_0x253f5c['Variable'][_0x49f3('0x15')][_0x49f3('0x39')]()]&&_0x1a0b55[_0x49f3('0x17')]['push']({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x30b946[_0x253f5c[_0x49f3('0x3e')]['name']['toLowerCase']()][_0x49f3('0x2d')]()});}});}return _0x1a0b55;}exports[_0x49f3('0x3f')]=function(_0xd3483f,_0x501dba,_0x53a251,_0xed7b61,_0x230e0d,_0x3aa2e8){var _0x18bbee,_0xa0a163;_0x3aa2e8[_0x49f3('0x1a')]=intUtil['stripTrailingSlash'](_0x3aa2e8[_0x49f3('0x1a')]);_0x3aa2e8[_0x49f3('0x40')]=intUtil[_0x49f3('0x41')](_0x3aa2e8[_0x49f3('0x40')]);if(_0x230e0d&&_0x230e0d[_0x49f3('0x42')]){logger[_0x49f3('0xb')](_0x49f3('0x43'),'Recording\x20is\x20enabled!');_0x501dba[_0x49f3('0x44')]=util[_0x49f3('0x1e')](_0x49f3('0x45'),_0x3aa2e8[_0x49f3('0x40')],_0x501dba[_0x49f3('0x46')],md5(_0x501dba[_0x49f3('0x46')]));}else{_0x501dba['recordingURL']='';}headers['Authorization']=getAuth(_0x3aa2e8);return getUser(_0x3aa2e8,_0xed7b61[_0x49f3('0x23')])[_0x49f3('0x1c')](function(_0x56e93b){_0x18bbee=_0x56e93b;logger[_0x49f3('0xb')]('The\x20User\x20ID\x20is:',_0x18bbee['id']);return getEndUser(_0x3aa2e8,_0x501dba[_0x49f3('0xe')],_0x501dba[_0x49f3('0xf')]);})[_0x49f3('0x1c')](function(_0x2a3ffa){_0xa0a163=_0x2a3ffa;logger['info'](_0x49f3('0x47'),_0xa0a163['id']);return getTicket(_0x3aa2e8,_0x18bbee,_0xa0a163,_0x53a251,_0x501dba);})['then'](function(_0x46eed4){if(_0x46eed4&&_0x46eed4['id']){logger[_0x49f3('0xb')](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x46eed4['id']);logger[_0x49f3('0xb')](_0x49f3('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x49f3('0x1e')]('user:%s',_0xed7b61['name']),_0x49f3('0x49'),{'uri':util[_0x49f3('0x1e')](_0x49f3('0x4a'),_0x3aa2e8[_0x49f3('0x1a')],_0x46eed4['id'])});}})[_0x49f3('0x4b')](function(_0x1ee20a){logger[_0x49f3('0x4c')](_0x49f3('0x43'),JSON[_0x49f3('0x31')](_0x1ee20a));});};exports[_0x49f3('0x4d')]=function(_0x41bdf3,_0x4aab8c,_0x27b565,_0x5a7636,_0x1e5312,_0x3300ad,_0x20d70e){var _0x2c3fca,_0x54e1b1;_0x3300ad[_0x49f3('0x1a')]=intUtil[_0x49f3('0x41')](_0x3300ad[_0x49f3('0x1a')]);_0x3300ad[_0x49f3('0x40')]=intUtil[_0x49f3('0x41')](_0x3300ad[_0x49f3('0x40')]);if(_0x20d70e&&_0x20d70e[_0x49f3('0x4e')]&&_0x20d70e[_0x49f3('0x4e')]!=='none'){logger['info'](_0x49f3('0x4f'),'Recording\x20is\x20enabled!');_0x4aab8c[_0x49f3('0x44')]=util['format'](_0x49f3('0x45'),_0x3300ad[_0x49f3('0x40')],_0x4aab8c[_0x49f3('0x46')],md5(_0x4aab8c[_0x49f3('0x46')]));}headers['Authorization']=getAuth(_0x3300ad);return getUser(_0x3300ad,_0x5a7636['email'])[_0x49f3('0x1c')](function(_0x554000){_0x2c3fca=_0x554000;logger[_0x49f3('0xb')](_0x49f3('0x50'),_0x2c3fca['id']);return getEndUser(_0x3300ad,_0x4aab8c['destcalleridname'],_0x4aab8c[_0x49f3('0x51')]);})[_0x49f3('0x1c')](function(_0x3a927a){_0x54e1b1=_0x3a927a;logger[_0x49f3('0xb')](_0x49f3('0x47'),_0x54e1b1['id']);return getTicket(_0x3300ad,_0x2c3fca,_0x54e1b1,_0x27b565,_0x4aab8c);})[_0x49f3('0x1c')](function(_0x2aa65d){if(_0x2aa65d&&_0x2aa65d['id']){logger[_0x49f3('0xb')](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x2aa65d['id']);logger[_0x49f3('0xb')](_0x49f3('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x49f3('0x52'),_0x5a7636[_0x49f3('0x15')]),_0x49f3('0x49'),{'uri':util[_0x49f3('0x1e')]('%s/helpdesk/tickets/%d',_0x3300ad['remoteUri'],_0x2aa65d['id'])});}})[_0x49f3('0x4b')](function(_0x15c5e1){logger[_0x49f3('0x4c')]('[OUTBOUND]',JSON['stringify'](_0x15c5e1));});};exports[_0x49f3('0x53')]=function(_0x3ace22,_0x77d1ee,_0x443af0,_0x4e9d02,_0x48e237,_0x5ee815){var _0x43befb,_0xcaac66;_0x5ee815['remoteUri']=intUtil[_0x49f3('0x41')](_0x5ee815['remoteUri']);_0x5ee815['serverUrl']=intUtil[_0x49f3('0x41')](_0x5ee815['serverUrl']);if(_0x48e237&&_0x48e237[_0x49f3('0x42')]){logger[_0x49f3('0xb')]('[ABANDONED]',_0x49f3('0x54'));_0x77d1ee['recordingURL']=util[_0x49f3('0x1e')](_0x49f3('0x45'),_0x5ee815[_0x49f3('0x40')],_0x77d1ee['uniqueid'],md5(_0x77d1ee[_0x49f3('0x46')]));}else{_0x77d1ee[_0x49f3('0x44')]='';}headers['Authorization']=getAuth(_0x5ee815);return getUser(_0x5ee815,'')[_0x49f3('0x1c')](function(_0x2f0bf1){_0x43befb=_0x2f0bf1;logger[_0x49f3('0xb')](_0x49f3('0x50'),_0x43befb['id']);return getEndUser(_0x5ee815,_0x77d1ee[_0x49f3('0xe')],_0x77d1ee['calleridnum']);})['then'](function(_0x1efe6d){_0xcaac66=_0x1efe6d;logger['info']('The\x20Enduser\x20ID\x20is:',_0xcaac66['id']);return getTicket(_0x5ee815,_0x43befb,_0xcaac66,_0x443af0,_0x77d1ee);})[_0x49f3('0x1c')](function(_0x45c577){if(_0x45c577){logger['info'](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x45c577['id']);}})[_0x49f3('0x4b')](function(_0x114dbd){logger[_0x49f3('0x4c')]('[ABANDONED]',JSON[_0x49f3('0x31')](_0x114dbd));});}; \ No newline at end of file +var _0x1e71=['POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','[HTTP]','GET','map','forEach','string','toLowerCase','content','type','idField','customField','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','stringify','abandoned','md5','util','ioredis','./util','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri'];(function(_0x37cdd4,_0x57c7b9){var _0x167bb1=function(_0xbbc6f2){while(--_0xbbc6f2){_0x37cdd4['push'](_0x37cdd4['shift']());}};_0x167bb1(++_0x57c7b9);}(_0x1e71,0x194));var _0x11e7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1e71[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x11e7('0x0'));var util=require(_0x11e7('0x1'));var Redis=require(_0x11e7('0x2'));var intUtil=require(_0x11e7('0x3'));var config=require('../../../../config/environment');var logger=require(_0x11e7('0x4'))(_0x11e7('0x5'));config['redis']=_[_0x11e7('0x6')](config[_0x11e7('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x11e7('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x156a6d,_0x87127f,_0x3820ab){io['to'](_0x156a6d)[_0x11e7('0x9')](_0x87127f,_0x3820ab);}function getTicket(_0x84bfe6,_0x5c319c,_0x3ff14b,_0x334e4a,_0x7d5add){logger[_0x11e7('0xa')](_0x11e7('0xb'));var _0x3a19f2=_[_0x11e7('0xc')]({'responder_id':_0x5c319c['id'],'requester_id':_0x3ff14b['id'],'name':util[_0x11e7('0xd')]('Caller\x20-\x20%s',_0x7d5add['calleridname']),'phone':_0x7d5add[_0x11e7('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x11e7('0xf')](_0x334e4a[_0x11e7('0x10')],_0x7d5add,'\x20'),'description':intUtil[_0x11e7('0xf')](_0x334e4a[_0x11e7('0x11')],_0x7d5add,_0x11e7('0x12')),'tags':getTags(_0x334e4a[_0x11e7('0x13')],'name')},getCustomFields(_0x334e4a[_0x11e7('0x14')],_0x7d5add));_0x3a19f2[_0x11e7('0x15')]=_[_0x11e7('0x16')](_[_0x11e7('0x17')](_0x3a19f2['custom_fields'],'id'),'value');return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x18'),_0x84bfe6[_0x11e7('0x19')]),'method':_0x11e7('0x1a'),'body':_0x3a19f2})[_0x11e7('0x1b')](function(_0x502c73){logger[_0x11e7('0xa')](_0x11e7('0x1c'));return _0x502c73;});}function getUser(_0x3b3353,_0x283031){if(intUtil['validateEmail'](_0x283031)){return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x1d'),_0x3b3353[_0x11e7('0x19')]),'qs':{'email':_0x283031}})[_0x11e7('0x1b')](function(_0x435c30){if(_0x435c30[_0x11e7('0x1e')]){logger['info'](_0x11e7('0x1f'));return _[_0x11e7('0x20')](_0x435c30,function(_0x2ba3fb){return _0x2ba3fb[_0x11e7('0x21')][_0x11e7('0x22')]===_0x283031;});}else{logger[_0x11e7('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x23'),_0x3b3353['remoteUri'])})[_0x11e7('0x1b')](function(_0x529a60){logger[_0x11e7('0xa')](_0x11e7('0x24'));return _0x529a60;});}});}else{logger[_0x11e7('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x11e7('0xd')]('%s/api/v2/agents/me',_0x3b3353[_0x11e7('0x19')])})[_0x11e7('0x1b')](function(_0x439f25){logger['info'](_0x11e7('0x24'));return _0x439f25;});}}function getEndUser(_0x39b53d,_0x5285be,_0x18bbe2){logger[_0x11e7('0xa')](_0x11e7('0x25'),_0x18bbe2);return request({'uri':util[_0x11e7('0xd')](_0x11e7('0x26'),_0x39b53d[_0x11e7('0x19')]),'qs':{'phone':_0x18bbe2}})[_0x11e7('0x1b')](function(_0x10b9ad){if(_0x10b9ad['length']){logger[_0x11e7('0xa')]('Enduser\x20found!');return _[_0x11e7('0x20')](_0x10b9ad,{'phone':_0x18bbe2});}else{logger[_0x11e7('0xa')](_0x11e7('0x27'));return request({'uri':util['format'](_0x11e7('0x26'),_0x39b53d[_0x11e7('0x19')]),'method':_0x11e7('0x1a'),'body':{'name':_0x5285be,'phone':_0x18bbe2}})[_0x11e7('0x1b')](function(_0x43bccb){logger[_0x11e7('0xa')]('Enduser\x20created.');return _0x43bccb;});}});}function getAuth(_0x37ea00){return util[_0x11e7('0xd')]('Basic\x20%s',new Buffer(_0x37ea00[_0x11e7('0x28')]+':X')[_0x11e7('0x29')](_0x11e7('0x2a')));}function request(_0x3b96b0){logger['debug'](_0x11e7('0x2b'),JSON['stringify'](_0x3b96b0));return rp(_[_0x11e7('0x6')](_0x3b96b0,{'method':_0x11e7('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x31f192,_0x18f9a5){var _0x4f7e87=[];if(_0x31f192&&_0x31f192[_0x11e7('0x1e')]>0x0){_0x4f7e87=_[_0x11e7('0x2d')](_0x31f192,_0x18f9a5);}return _0x4f7e87;}function getCustomFields(_0x4ea26d,_0x191a47){var _0x3f8a0c=[];var _0x4b1d57={'custom_fields':[]};if(_0x4ea26d[_0x11e7('0x1e')]>0x0){_[_0x11e7('0x2e')](_0x4ea26d,function(_0x53c6fa){if(_0x53c6fa['type']===_0x11e7('0x2f')&&_0x53c6fa['nameField']&&!_0x53c6fa['customField']){_0x4b1d57[_0x53c6fa['nameField'][_0x11e7('0x30')]()]=_0x53c6fa[_0x11e7('0x31')][_0x11e7('0x29')]();}else if(_0x53c6fa[_0x11e7('0x32')]===_0x11e7('0x2f')&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa[_0x11e7('0x34')]){_0x4b1d57['custom_fields'][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x53c6fa[_0x11e7('0x31')][_0x11e7('0x29')]()});}else if(_0x53c6fa[_0x11e7('0x32')]==='variable'&&_0x53c6fa[_0x11e7('0x36')]&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa[_0x11e7('0x34')]){_0x191a47[_0x53c6fa[_0x11e7('0x36')]]&&_0x4b1d57[_0x11e7('0x15')][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x191a47[_0x53c6fa[_0x11e7('0x36')]]['toString']()});}else if(_0x53c6fa[_0x11e7('0x32')]===_0x11e7('0x37')&&_0x53c6fa[_0x11e7('0x38')]&&_0x53c6fa['Variable'][_0x11e7('0x39')]&&_0x53c6fa[_0x11e7('0x33')]&&_0x53c6fa['customField']){_0x191a47[_0x53c6fa[_0x11e7('0x38')][_0x11e7('0x39')][_0x11e7('0x30')]()]&&_0x4b1d57['custom_fields'][_0x11e7('0x35')]({'id':_0x53c6fa[_0x11e7('0x33')],'value':_0x191a47[_0x53c6fa[_0x11e7('0x38')][_0x11e7('0x39')][_0x11e7('0x30')]()][_0x11e7('0x29')]()});}});}return _0x4b1d57;}exports[_0x11e7('0x3a')]=function(_0x5340ee,_0x1b1181,_0x1ab493,_0x37ca88,_0x47e699,_0xc646c0){var _0x2ee2c9,_0x76df71;_0xc646c0[_0x11e7('0x19')]=intUtil[_0x11e7('0x3b')](_0xc646c0[_0x11e7('0x19')]);_0xc646c0[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0xc646c0[_0x11e7('0x3c')]);if(_0x47e699&&_0x47e699[_0x11e7('0x3d')]){logger['info'](_0x11e7('0x3e'),_0x11e7('0x3f'));_0x1b1181['recordingURL']=util['format'](_0x11e7('0x40'),_0xc646c0['serverUrl'],_0x1b1181[_0x11e7('0x41')],md5(_0x1b1181[_0x11e7('0x41')]));}else{_0x1b1181[_0x11e7('0x42')]='';}headers['Authorization']=getAuth(_0xc646c0);return getUser(_0xc646c0,_0x37ca88['email'])[_0x11e7('0x1b')](function(_0x2ee7b5){_0x2ee2c9=_0x2ee7b5;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0x2ee2c9['id']);return getEndUser(_0xc646c0,_0x1b1181[_0x11e7('0x44')],_0x1b1181[_0x11e7('0xe')]);})[_0x11e7('0x1b')](function(_0x55f640){_0x76df71=_0x55f640;logger[_0x11e7('0xa')]('The\x20Enduser\x20ID\x20is:',_0x76df71['id']);return getTicket(_0xc646c0,_0x2ee2c9,_0x76df71,_0x1ab493,_0x1b1181);})[_0x11e7('0x1b')](function(_0x291555){if(_0x291555&&_0x291555['id']){logger[_0x11e7('0xa')](_0x11e7('0x1c'));logger[_0x11e7('0xa')](_0x11e7('0x45'),_0x291555['id']);logger[_0x11e7('0xa')](_0x11e7('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x11e7('0xd')](_0x11e7('0x46'),_0x37ca88[_0x11e7('0x39')]),_0x11e7('0x47'),{'uri':util[_0x11e7('0xd')](_0x11e7('0x48'),_0xc646c0['remoteUri'],_0x291555['id'])});}})['catch'](function(_0x581077){logger[_0x11e7('0x49')](_0x11e7('0x3e'),JSON['stringify'](_0x581077));});};exports[_0x11e7('0x4a')]=function(_0x40b829,_0x1d0dfa,_0x3ba97f,_0x12626b,_0x57859c,_0x58d984,_0x383a99){var _0xbc03a7,_0x1f2303;_0x58d984['remoteUri']=intUtil['stripTrailingSlash'](_0x58d984[_0x11e7('0x19')]);_0x58d984[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0x58d984['serverUrl']);if(_0x383a99&&_0x383a99[_0x11e7('0x4b')]&&_0x383a99[_0x11e7('0x4b')]!==_0x11e7('0x4c')){logger[_0x11e7('0xa')](_0x11e7('0x4d'),_0x11e7('0x3f'));_0x1d0dfa['recordingURL']=util['format'](_0x11e7('0x40'),_0x58d984[_0x11e7('0x3c')],_0x1d0dfa['uniqueid'],md5(_0x1d0dfa[_0x11e7('0x41')]));}headers[_0x11e7('0x4e')]=getAuth(_0x58d984);return getUser(_0x58d984,_0x12626b[_0x11e7('0x22')])[_0x11e7('0x1b')](function(_0xd2b63f){_0xbc03a7=_0xd2b63f;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0xbc03a7['id']);return getEndUser(_0x58d984,_0x1d0dfa[_0x11e7('0x4f')],_0x1d0dfa[_0x11e7('0x50')]);})['then'](function(_0x4cc8a8){_0x1f2303=_0x4cc8a8;logger['info'](_0x11e7('0x51'),_0x1f2303['id']);return getTicket(_0x58d984,_0xbc03a7,_0x1f2303,_0x3ba97f,_0x1d0dfa);})['then'](function(_0x298715){if(_0x298715&&_0x298715['id']){logger[_0x11e7('0xa')](_0x11e7('0x1c'));logger[_0x11e7('0xa')]('The\x20Ticket\x20ID\x20is:',_0x298715['id']);logger['info']('[OUTBOUND]',_0x11e7('0x52'));emit(util[_0x11e7('0xd')](_0x11e7('0x46'),_0x12626b[_0x11e7('0x39')]),_0x11e7('0x47'),{'uri':util['format'](_0x11e7('0x48'),_0x58d984['remoteUri'],_0x298715['id'])});}})[_0x11e7('0x53')](function(_0x596745){logger[_0x11e7('0x49')](_0x11e7('0x4d'),JSON[_0x11e7('0x54')](_0x596745));});};exports[_0x11e7('0x55')]=function(_0x585055,_0xe08b3b,_0x34ba58,_0x3223ef,_0x2da851,_0x1b743d){var _0x2d63d8,_0x3a9741;_0x1b743d[_0x11e7('0x19')]=intUtil['stripTrailingSlash'](_0x1b743d['remoteUri']);_0x1b743d[_0x11e7('0x3c')]=intUtil['stripTrailingSlash'](_0x1b743d['serverUrl']);if(_0x2da851&&_0x2da851[_0x11e7('0x3d')]){logger[_0x11e7('0xa')]('[ABANDONED]',_0x11e7('0x3f'));_0xe08b3b['recordingURL']=util['format'](_0x11e7('0x40'),_0x1b743d[_0x11e7('0x3c')],_0xe08b3b[_0x11e7('0x41')],md5(_0xe08b3b['uniqueid']));}else{_0xe08b3b[_0x11e7('0x42')]='';}headers[_0x11e7('0x4e')]=getAuth(_0x1b743d);return getUser(_0x1b743d,'')[_0x11e7('0x1b')](function(_0x57c26a){_0x2d63d8=_0x57c26a;logger[_0x11e7('0xa')](_0x11e7('0x43'),_0x2d63d8['id']);return getEndUser(_0x1b743d,_0xe08b3b[_0x11e7('0x44')],_0xe08b3b[_0x11e7('0xe')]);})[_0x11e7('0x1b')](function(_0x346444){_0x3a9741=_0x346444;logger['info'](_0x11e7('0x51'),_0x3a9741['id']);return getTicket(_0x1b743d,_0x2d63d8,_0x3a9741,_0x34ba58,_0xe08b3b);})[_0x11e7('0x1b')](function(_0x1ec158){if(_0x1ec158){logger[_0x11e7('0xa')]('Ticket\x20created!');logger['info'](_0x11e7('0x45'),_0x1ec158['id']);}})[_0x11e7('0x53')](function(_0x417b92){logger['error']('[ABANDONED]',JSON['stringify'](_0x417b92));});}; \ 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 4f1aae1..e974467 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 _0x4dc8=['toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','abandoned','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1'];(function(_0x46ef9f,_0x49cf7f){var _0x21e1f4=function(_0x38d857){while(--_0x38d857){_0x46ef9f['push'](_0x46ef9f['shift']());}};_0x21e1f4(++_0x49cf7f);}(_0x4dc8,0x1b5));var _0x84dc=function(_0xf5bf7b,_0x55c643){_0xf5bf7b=_0xf5bf7b-0x0;var _0x4a0321=_0x4dc8[_0xf5bf7b];return _0x4a0321;};'use strict';var _=require(_0x84dc('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x84dc('0x1'));var freshdesk=require(_0x84dc('0x2'));var zoho=require(_0x84dc('0x3'));var desk=require(_0x84dc('0x4'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x84dc('0x5'));var integrations=[_0x84dc('0x6'),_0x84dc('0x7'),_0x84dc('0x8'),_0x84dc('0x9'),_0x84dc('0xa'),_0x84dc('0xb'),_0x84dc('0xc'),_0x84dc('0xd'),_0x84dc('0xe')];exports[_0x84dc('0xf')]=function(_0x107bf4,_0x5d1244,_0x4f4682,_0x4051ce,_0xc0bce9,_0x4c9521){if(_0x4f4682){if(_[_0x84dc('0x10')](integrations,_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')]())){try{var _0x33ed21=null;var _0x5c9e34='';var _0x37af6c=_0x4f4682[_0x107bf4['data1'][_0x84dc('0x12')]()];if(_0x37af6c){var _0x37a84d=_0x37af6c[_0x107bf4[_0x84dc('0x13')]];if(_0x37a84d){var _0x52bd7c=_[_0x84dc('0x14')](_0x37a84d[_0x84dc('0x15')],{'id':parseInt(_0x107bf4['data3'],0xa)});if(_0x52bd7c){if(_0x4051ce){if(_0xc0bce9&&_0x5d1244[_0x84dc('0x16')]){_0x5c9e34=_0x84dc('0x16');}else if(_0x5d1244[_0x84dc('0x17')]){_0x5c9e34=_0x84dc('0x18');}else{console[_0x84dc('0x19')](_0x84dc('0x1a'),_0x5d1244);}}else{_0x5c9e34=_0x84dc('0x1b');}switch(_0x107bf4[_0x84dc('0x11')]['toLowerCase']()){case'zendesk':zendesk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0x7'):salesforce[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0x8'):sugarcrm[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'freshdesk':freshdesk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'zoho':zoho[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0xb'):desk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'vtiger':vtiger[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0xd'):servicenow['cs'](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521,_0x5c9e34);break;case _0x84dc('0xe'):dynamics365['cs'](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521,_0x5c9e34);break;default:console[_0x84dc('0x19')]('unknown\x20integration');}}else{_0x33ed21=require('../../../../config/logger')(_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')]());_0x33ed21[_0x84dc('0x1c')](_0x84dc('0x1d'),util[_0x84dc('0x1e')](_0x84dc('0x1f'),_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')](),_0x107bf4[_0x84dc('0x20')]));}}else{_0x33ed21=require(_0x84dc('0x21'))(_0x107bf4['data1']['toLowerCase']());_0x33ed21[_0x84dc('0x1c')]('[EXEC]',util[_0x84dc('0x1e')](_0x84dc('0x22'),_0x107bf4[_0x84dc('0x11')]['toLowerCase'](),_0x107bf4[_0x84dc('0x13')]));}}else{}}catch(_0x547041){console['error'](_0x547041);}}}}; \ No newline at end of file +var _0x656f=['find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','abandoned','sugarcrm','zoho','dynamics365','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','desk','vtiger','servicenow','exec','data1','toLowerCase','data2'];(function(_0x3688d7,_0x25728b){var _0x2d0d5b=function(_0x2f7fbe){while(--_0x2f7fbe){_0x3688d7['push'](_0x3688d7['shift']());}};_0x2d0d5b(++_0x25728b);}(_0x656f,0xa1));var _0xf656=function(_0x1a3d8d,_0x21e8ad){_0x1a3d8d=_0x1a3d8d-0x0;var _0x1a3328=_0x656f[_0x1a3d8d];return _0x1a3328;};'use strict';var _=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var zendesk=require(_0xf656('0x2'));var salesforce=require(_0xf656('0x3'));var sugarcrm=require(_0xf656('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xf656('0x5'));var desk=require(_0xf656('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xf656('0x7'));var dynamics365=require(_0xf656('0x8'));var integrations=[_0xf656('0x9'),_0xf656('0xa'),'sugarcrm',_0xf656('0xb'),'zoho',_0xf656('0xc'),_0xf656('0xd'),_0xf656('0xe'),'dynamics365'];exports[_0xf656('0xf')]=function(_0x3f6926,_0x4e9dc3,_0x2c3c25,_0x109c13,_0x26f307,_0x10a3ea){if(_0x2c3c25){if(_['includes'](integrations,_0x3f6926[_0xf656('0x10')][_0xf656('0x11')]())){try{var _0x5a176c=null;var _0x34f298='';var _0x4a9fd4=_0x2c3c25[_0x3f6926[_0xf656('0x10')]['toLowerCase']()];if(_0x4a9fd4){var _0x1c43a5=_0x4a9fd4[_0x3f6926[_0xf656('0x12')]];if(_0x1c43a5){var _0x4b7139=_[_0xf656('0x13')](_0x1c43a5[_0xf656('0x14')],{'id':parseInt(_0x3f6926[_0xf656('0x15')],0xa)});if(_0x4b7139){if(_0x109c13){if(_0x26f307&&_0x4e9dc3[_0xf656('0x16')]){_0x34f298='queue';}else if(_0x4e9dc3[_0xf656('0x17')]){_0x34f298='outbound';}else{console[_0xf656('0x18')](_0xf656('0x19'),_0x4e9dc3);}}else{_0x34f298=_0xf656('0x1a');}switch(_0x3f6926['data1'][_0xf656('0x11')]()){case _0xf656('0x9'):zendesk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xa'):salesforce[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0x1b'):sugarcrm[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xb'):freshdesk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0x1c'):zoho[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xc'):desk[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case'vtiger':vtiger[_0x34f298](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea);break;case _0xf656('0xe'):servicenow['cs'](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea,_0x34f298);break;case _0xf656('0x1d'):dynamics365['cs'](_0x3f6926,_0x4e9dc3,_0x4b7139,_0x109c13,_0x26f307,_0x1c43a5,_0x10a3ea,_0x34f298);break;default:console[_0xf656('0x18')](_0xf656('0x1e'));}}else{_0x5a176c=require('../../../../config/logger')(_0x3f6926[_0xf656('0x10')][_0xf656('0x11')]());_0x5a176c[_0xf656('0x1f')]('[EXEC]',util[_0xf656('0x20')](_0xf656('0x21'),_0x3f6926['data1'][_0xf656('0x11')](),_0x3f6926[_0xf656('0x15')]));}}else{_0x5a176c=require('../../../../config/logger')(_0x3f6926[_0xf656('0x10')]['toLowerCase']());_0x5a176c[_0xf656('0x1f')](_0xf656('0x22'),util[_0xf656('0x20')](_0xf656('0x23'),_0x3f6926[_0xf656('0x10')][_0xf656('0x11')](),_0x3f6926[_0xf656('0x12')]));}}else{}}catch(_0x3f3628){console['error'](_0x3f3628);}}}}; \ 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 e8d02c4..d89cd77 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 _0x0713=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','getString','Descriptions','assign','Subjects','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','lead','Lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var md5=require(_0x3071('0x2'));var jsforce=require(_0x3071('0x3'));var util=require(_0x3071('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var io=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));function emit(_0x3e9a5e,_0x2fce7a,_0x1a868e){io['to'](_0x3e9a5e)['emit'](_0x2fce7a,_0x1a868e);}function getTicket(_0x3457cd,_0x2610b4,_0x937259,_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){var _0x401b4d={};if(_0xff9a29[_0x3071('0xd')]===_0x3071('0xe')){_0x401b4d=Object['assign']({},{'OwnerId':_0x2610b4['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3071('0xf')](_0xff9a29['Subjects'],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d['WhoId']=_0x937259['id'];}}else if(_0xff9a29[_0x3071('0xd')]==='Case'){_0x401b4d=Object[_0x3071('0x11')]({},{'OwnerId':_0x2610b4['id'],'Subject':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x12')],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d[_0x3071('0x13')]=_0x937259['id'];}}return _0x2ace21[_0x3071('0x14')](_0xff9a29[_0x3071('0xd')])[_0x3071('0x15')](_0x401b4d);}function getUser(_0x344ea6,_0x5f3c22,_0x224996){if(!_[_0x3071('0x16')](_0x5f3c22)&&intUtil[_0x3071('0x17')](_0x5f3c22)){var _0x108a83={'Email':_0x5f3c22};var _0x3acf0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224996[_0x3071('0x14')](_0x3071('0x18'))[_0x3071('0x19')](_0x108a83,_0x3acf0e)['execute']()[_0x3071('0x1a')](function(_0x2bfa33){if(_0x2bfa33[_0x3071('0x1b')]){var _0x56c267=_[_0x3071('0x19')](_0x2bfa33,function(_0x5cd80d){return _0x5cd80d[_0x3071('0x1c')]===_0x5f3c22;});if(_0x56c267){logger[_0x3071('0x1d')](_0x3071('0x1e'),_0x5f3c22);return BPromise[_0x3071('0x1f')]({'id':_0x56c267['Id'],'name':_0x56c267[_0x3071('0x20')]});}}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()['then'](function(_0x481a51){return BPromise[_0x3071('0x1f')]({'id':_0x481a51[_0x3071('0x23')],'name':_0x481a51[_0x3071('0x24')]});});}});}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()[_0x3071('0x1a')](function(_0x1fe727){return BPromise[_0x3071('0x1f')]({'id':_0x1fe727['user_id'],'name':_0x1fe727[_0x3071('0x24')]});});}}function getEndUser(_0x3f1e6e,_0x177138,_0x4d5c4b,_0x4fb1ca,_0x28792d){var _0x163604={'Phone':_0x4fb1ca};var _0x950fde={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3071('0x1f')]()[_0x3071('0x1a')](function(){if(_0x177138[_0x3071('0xd')]===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x177138[_0x3071('0x26')]);switch(_0x177138['moduleSearch']){case'contact_lead':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)[_0x3071('0x28')]()[_0x3071('0x1a')](function(_0x29538c){if(_0x29538c&&_0x29538c[_0x3071('0x1b')]){return _0x29538c;}else{return _0x28792d[_0x3071('0x14')]('Lead')['find'](_0x163604,_0x950fde);}});case'contact':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))['find'](_0x163604,_0x950fde)[_0x3071('0x28')]();case _0x3071('0x29'):return _0x28792d[_0x3071('0x14')](_0x3071('0x2a'))['find'](_0x163604,_0x950fde);default:return null;}}else if(_0x177138[_0x3071('0xd')]===_0x3071('0x2b')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x3071('0x2c'));return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)['execute']();}})[_0x3071('0x1a')](function(_0x54e52f){if(_0x54e52f&&_0x54e52f['length']){var _0x1a1a64=_[_0x3071('0x19')](_0x54e52f,function(_0x54d9c3){return _0x54d9c3[_0x3071('0x2d')]===_0x4fb1ca;});if(_0x1a1a64){return BPromise[_0x3071('0x1f')]({'id':_0x1a1a64['Id'],'name':_0x1a1a64[_0x3071('0x20')],'phone':_0x1a1a64[_0x3071('0x2d')]});}}})[_0x3071('0x1a')](function(_0x232235){if(_0x232235){logger['info'](_0x3071('0x2e'),_0x4fb1ca);return BPromise[_0x3071('0x1f')](_0x232235);}else{logger['info'](_0x3071('0x2f'),_0x4fb1ca);var _0x5b1392={'LastName':_0x4d5c4b!==_0x3071('0x30')?_0x4d5c4b:util[_0x3071('0x31')]('Caller\x20-\x20%s',_0x4fb1ca),'Phone':_0x4fb1ca};if(_0x177138['moduleCreate']){if(_0x177138[_0x3071('0x32')]===_0x3071('0x2c')){logger[_0x3071('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb1ca,_0x177138[_0x3071('0x32')]);}else if(_0x177138['moduleCreate']===_0x3071('0x29')&&_0x177138['ticketType']===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x33'),_0x4fb1ca,_0x177138[_0x3071('0x32')]);_0x5b1392[_0x3071('0x34')]='No\x20Company';}else{return null;}}return _0x28792d['sobject'](_[_0x3071('0x35')](_0x177138[_0x3071('0x32')]))[_0x3071('0x15')](_0x5b1392);}});}function getCustomFields(_0x1f69a6,_0x525389){var _0x3cfc05={};if(_0x1f69a6[_0x3071('0x1b')]>0x0){_[_0x3071('0x36')](_0x1f69a6,function(_0x25c29f){if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x38')&&_0x25c29f['idField']){_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x25c29f['content']['toString']();}else if(_0x25c29f['type']==='variable'&&_0x25c29f[_0x3071('0x3a')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3a')]]&&(_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x525389[_0x25c29f[_0x3071('0x3a')]][_0x3071('0x3b')]());}else if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x3c')&&_0x25c29f['Variable']&&_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]['toLowerCase']()]&&(_0x3cfc05[_0x25c29f['idField']]=_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')][_0x3071('0x3f')]()][_0x3071('0x3b')]());}});}return _0x3cfc05;}function getConnection(_0x606ef8){var _0x5db437=_0x606ef8[_0x3071('0x40')]['concat'](_0x606ef8[_0x3071('0x41')]);var _0x509178=new jsforce['Connection']({'oauth2':{'loginUrl':_0x606ef8[_0x3071('0x42')]||'https://login.salesforce.com','clientId':_0x606ef8[_0x3071('0x43')],'clientSecret':_0x606ef8['clientSecret']}});return _0x509178[_0x3071('0x44')](_0x606ef8[_0x3071('0x45')],_0x5db437)[_0x3071('0x1a')](function(){logger[_0x3071('0x1d')]('Connection\x20established.');return _0x509178;});}exports[_0x3071('0x46')]=function(_0x575c12,_0xd273ec,_0x4b6bbb,_0x46924d,_0x2060e9,_0x4d395a){var _0x131ae6,_0x117e73,_0x224a70,_0x38bcc2;_0x4d395a[_0x3071('0x47')]=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x47')]);_0x4d395a['remoteUri']=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x42')]);if(_0x2060e9&&_0x2060e9[_0x3071('0x49')]){logger[_0x3071('0x1d')]('[QUEUE]',_0x3071('0x4a'));_0xd273ec[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x4d395a[_0x3071('0x47')],_0xd273ec[_0x3071('0x4d')],md5(_0xd273ec[_0x3071('0x4d')]));}else{_0xd273ec[_0x3071('0x4b')]='';}return getConnection(_0x4d395a)[_0x3071('0x1a')](function(_0x886f7){_0x38bcc2=_0x886f7;return getUser(_0x4d395a,_0x46924d[_0x3071('0x4e')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x24977b){_0x131ae6=_0x24977b;return getEndUser(_0x4d395a,_0x4b6bbb,_0xd273ec[_0x3071('0x4f')],_0xd273ec[_0x3071('0x50')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x596cdd){_0x117e73=_0x596cdd;return getTicket(_0x4d395a,_0x131ae6,_0x117e73,_0x4b6bbb,_0xd273ec,_0x4b6bbb['Fields'],_0x38bcc2,_0x3071('0x46'));})['then'](function(_0x403761){_0x224a70=_0x403761;logger[_0x3071('0x1d')](_0x3071('0x51'),_0x224a70['id']);logger['info'](_0x3071('0x52'),_0x224a70['id'],_0x46924d[_0x3071('0x3e')],_0x4d395a['type']);switch(_0x4d395a['type']){case _0x3071('0x53'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),'trigger:salesforce:display',{'recordId':_0x224a70['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),_0x3071('0x56'),{'uri':util['format'](_0x3071('0x57'),_0x38bcc2[_0x3071('0x58')],_0x224a70['id'])});break;default:logger[_0x3071('0x59')](_0x3071('0x5a'));}})[_0x3071('0x5b')](function(_0x24f429){logger[_0x3071('0x59')]('[QUEUE]',JSON['stringify'](_0x24f429));});};exports[_0x3071('0x5c')]=function(_0x4de4f3,_0xe96994,_0x26ba8a,_0x499b6a,_0x19dc95,_0x1bf911,_0x4d3886){var _0x108b14,_0x1878e2,_0x180344,_0x6e96c7;_0x1bf911[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x1bf911[_0x3071('0x47')]);_0x1bf911[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x1bf911['remoteUri']);if(_0x4d3886&&_0x4d3886[_0x3071('0x5d')]&&_0x4d3886[_0x3071('0x5d')]!==_0x3071('0x5e')){logger[_0x3071('0x1d')](_0x3071('0x5f'),_0x3071('0x4a'));_0xe96994[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x1bf911['serverUrl'],_0xe96994[_0x3071('0x4d')],md5(_0xe96994[_0x3071('0x4d')]));}return getConnection(_0x1bf911)[_0x3071('0x1a')](function(_0x26ecb2){_0x6e96c7=_0x26ecb2;return getUser(_0x1bf911,_0x499b6a[_0x3071('0x4e')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x389dca){_0x108b14=_0x389dca;return getEndUser(_0x1bf911,_0x26ba8a,_0xe96994[_0x3071('0x60')],_0xe96994[_0x3071('0x61')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x195d03){_0x1878e2=_0x195d03;return getTicket(_0x1bf911,_0x108b14,_0x1878e2,_0x26ba8a,_0xe96994,_0x26ba8a['Fields'],_0x6e96c7,_0x3071('0x5c'));})[_0x3071('0x1a')](function(_0x279594){_0x180344=_0x279594;logger[_0x3071('0x1d')](_0x3071('0x62'),_0x180344['id']);logger[_0x3071('0x1d')](_0x3071('0x63'),_0x180344['id'],_0x499b6a[_0x3071('0x3e')],_0x1bf911['type']);switch(_0x1bf911[_0x3071('0x37')]){case _0x3071('0x53'):emit(util['format']('user:%s',_0x499b6a[_0x3071('0x3e')]),_0x3071('0x64'),{'recordId':_0x180344['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')]('user:%s',_0x499b6a['name']),_0x3071('0x56'),{'uri':util['format']('%s/%s/e',_0x6e96c7['instanceUrl'],_0x180344['id'])});break;default:logger['error'](_0x3071('0x5f'),_0x3071('0x65'));}})[_0x3071('0x5b')](function(_0x567d19){logger[_0x3071('0x59')](_0x3071('0x5f'),JSON[_0x3071('0x66')](_0x567d19));});};exports[_0x3071('0x67')]=function(_0x5a0c1b,_0x2103a4,_0x29841a,_0x588406,_0x1b35d3,_0x29ee70){var _0x388cd1,_0x40c258,_0x4edd23,_0x11ffdd;_0x29ee70[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x29ee70['serverUrl']);_0x29ee70[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x29ee70[_0x3071('0x42')]);if(_0x1b35d3&&_0x1b35d3['monitor_format']){logger['info'](_0x3071('0x68'),_0x3071('0x4a'));_0x2103a4[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x29ee70[_0x3071('0x47')],_0x2103a4[_0x3071('0x4d')],md5(_0x2103a4[_0x3071('0x4d')]));}else{_0x2103a4['recordingURL']='';}return getConnection(_0x29ee70)[_0x3071('0x1a')](function(_0x5ea33f){_0x11ffdd=_0x5ea33f;if(!_[_0x3071('0x16')](_0x588406)){return getUser(_0x29ee70,_0x588406[_0x3071('0x3e')],_0x11ffdd);}else{return getUser(_0x29ee70,null,_0x11ffdd);}})[_0x3071('0x1a')](function(_0x2fbac7){_0x388cd1=_0x2fbac7;return getEndUser(_0x29ee70,_0x29841a,_0x2103a4[_0x3071('0x4f')],_0x2103a4[_0x3071('0x50')],_0x11ffdd);})[_0x3071('0x1a')](function(_0x2ae053){_0x40c258=_0x2ae053;return getTicket(_0x29ee70,_0x388cd1,_0x40c258,_0x29841a,_0x2103a4,_0x29841a['Fields'],_0x11ffdd);})[_0x3071('0x1a')](function(_0x138a94){_0x4edd23=_0x138a94;logger[_0x3071('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4edd23['id']);logger[_0x3071('0x1d')](_0x3071('0x69'),_0x29ee70[_0x3071('0x37')]);})['catch'](function(_0x521ee6){logger[_0x3071('0x59')]('[ABANDONED]',JSON[_0x3071('0x66')](_0x521ee6));});}; \ No newline at end of file +var _0x0713=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','getString','Descriptions','assign','Subjects','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','lead','Lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e'];(function(_0x1b88fd,_0x3fc359){var _0x287cd1=function(_0x5aa428){while(--_0x5aa428){_0x1b88fd['push'](_0x1b88fd['shift']());}};_0x287cd1(++_0x3fc359);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var md5=require(_0x3071('0x2'));var jsforce=require(_0x3071('0x3'));var util=require(_0x3071('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var io=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));function emit(_0x3e9a5e,_0x2fce7a,_0x1a868e){io['to'](_0x3e9a5e)['emit'](_0x2fce7a,_0x1a868e);}function getTicket(_0x3457cd,_0x2610b4,_0x937259,_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){var _0x401b4d={};if(_0xff9a29[_0x3071('0xd')]===_0x3071('0xe')){_0x401b4d=Object['assign']({},{'OwnerId':_0x2610b4['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3071('0xf')](_0xff9a29['Subjects'],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d['WhoId']=_0x937259['id'];}}else if(_0xff9a29[_0x3071('0xd')]==='Case'){_0x401b4d=Object[_0x3071('0x11')]({},{'OwnerId':_0x2610b4['id'],'Subject':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x12')],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d[_0x3071('0x13')]=_0x937259['id'];}}return _0x2ace21[_0x3071('0x14')](_0xff9a29[_0x3071('0xd')])[_0x3071('0x15')](_0x401b4d);}function getUser(_0x344ea6,_0x5f3c22,_0x224996){if(!_[_0x3071('0x16')](_0x5f3c22)&&intUtil[_0x3071('0x17')](_0x5f3c22)){var _0x108a83={'Email':_0x5f3c22};var _0x3acf0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224996[_0x3071('0x14')](_0x3071('0x18'))[_0x3071('0x19')](_0x108a83,_0x3acf0e)['execute']()[_0x3071('0x1a')](function(_0x2bfa33){if(_0x2bfa33[_0x3071('0x1b')]){var _0x56c267=_[_0x3071('0x19')](_0x2bfa33,function(_0x5cd80d){return _0x5cd80d[_0x3071('0x1c')]===_0x5f3c22;});if(_0x56c267){logger[_0x3071('0x1d')](_0x3071('0x1e'),_0x5f3c22);return BPromise[_0x3071('0x1f')]({'id':_0x56c267['Id'],'name':_0x56c267[_0x3071('0x20')]});}}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()['then'](function(_0x481a51){return BPromise[_0x3071('0x1f')]({'id':_0x481a51[_0x3071('0x23')],'name':_0x481a51[_0x3071('0x24')]});});}});}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()[_0x3071('0x1a')](function(_0x1fe727){return BPromise[_0x3071('0x1f')]({'id':_0x1fe727['user_id'],'name':_0x1fe727[_0x3071('0x24')]});});}}function getEndUser(_0x3f1e6e,_0x177138,_0x4d5c4b,_0x4fb1ca,_0x28792d){var _0x163604={'Phone':_0x4fb1ca};var _0x950fde={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3071('0x1f')]()[_0x3071('0x1a')](function(){if(_0x177138[_0x3071('0xd')]===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x177138[_0x3071('0x26')]);switch(_0x177138['moduleSearch']){case'contact_lead':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)[_0x3071('0x28')]()[_0x3071('0x1a')](function(_0x29538c){if(_0x29538c&&_0x29538c[_0x3071('0x1b')]){return _0x29538c;}else{return _0x28792d[_0x3071('0x14')]('Lead')['find'](_0x163604,_0x950fde);}});case'contact':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))['find'](_0x163604,_0x950fde)[_0x3071('0x28')]();case _0x3071('0x29'):return _0x28792d[_0x3071('0x14')](_0x3071('0x2a'))['find'](_0x163604,_0x950fde);default:return null;}}else if(_0x177138[_0x3071('0xd')]===_0x3071('0x2b')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x3071('0x2c'));return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)['execute']();}})[_0x3071('0x1a')](function(_0x54e52f){if(_0x54e52f&&_0x54e52f['length']){var _0x1a1a64=_[_0x3071('0x19')](_0x54e52f,function(_0x54d9c3){return _0x54d9c3[_0x3071('0x2d')]===_0x4fb1ca;});if(_0x1a1a64){return BPromise[_0x3071('0x1f')]({'id':_0x1a1a64['Id'],'name':_0x1a1a64[_0x3071('0x20')],'phone':_0x1a1a64[_0x3071('0x2d')]});}}})[_0x3071('0x1a')](function(_0x232235){if(_0x232235){logger['info'](_0x3071('0x2e'),_0x4fb1ca);return BPromise[_0x3071('0x1f')](_0x232235);}else{logger['info'](_0x3071('0x2f'),_0x4fb1ca);var _0x5b1392={'LastName':_0x4d5c4b!==_0x3071('0x30')?_0x4d5c4b:util[_0x3071('0x31')]('Caller\x20-\x20%s',_0x4fb1ca),'Phone':_0x4fb1ca};if(_0x177138['moduleCreate']){if(_0x177138[_0x3071('0x32')]===_0x3071('0x2c')){logger[_0x3071('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb1ca,_0x177138[_0x3071('0x32')]);}else if(_0x177138['moduleCreate']===_0x3071('0x29')&&_0x177138['ticketType']===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x33'),_0x4fb1ca,_0x177138[_0x3071('0x32')]);_0x5b1392[_0x3071('0x34')]='No\x20Company';}else{return null;}}return _0x28792d['sobject'](_[_0x3071('0x35')](_0x177138[_0x3071('0x32')]))[_0x3071('0x15')](_0x5b1392);}});}function getCustomFields(_0x1f69a6,_0x525389){var _0x3cfc05={};if(_0x1f69a6[_0x3071('0x1b')]>0x0){_[_0x3071('0x36')](_0x1f69a6,function(_0x25c29f){if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x38')&&_0x25c29f['idField']){_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x25c29f['content']['toString']();}else if(_0x25c29f['type']==='variable'&&_0x25c29f[_0x3071('0x3a')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3a')]]&&(_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x525389[_0x25c29f[_0x3071('0x3a')]][_0x3071('0x3b')]());}else if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x3c')&&_0x25c29f['Variable']&&_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]['toLowerCase']()]&&(_0x3cfc05[_0x25c29f['idField']]=_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')][_0x3071('0x3f')]()][_0x3071('0x3b')]());}});}return _0x3cfc05;}function getConnection(_0x606ef8){var _0x5db437=_0x606ef8[_0x3071('0x40')]['concat'](_0x606ef8[_0x3071('0x41')]);var _0x509178=new jsforce['Connection']({'oauth2':{'loginUrl':_0x606ef8[_0x3071('0x42')]||'https://login.salesforce.com','clientId':_0x606ef8[_0x3071('0x43')],'clientSecret':_0x606ef8['clientSecret']}});return _0x509178[_0x3071('0x44')](_0x606ef8[_0x3071('0x45')],_0x5db437)[_0x3071('0x1a')](function(){logger[_0x3071('0x1d')]('Connection\x20established.');return _0x509178;});}exports[_0x3071('0x46')]=function(_0x575c12,_0xd273ec,_0x4b6bbb,_0x46924d,_0x2060e9,_0x4d395a){var _0x131ae6,_0x117e73,_0x224a70,_0x38bcc2;_0x4d395a[_0x3071('0x47')]=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x47')]);_0x4d395a['remoteUri']=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x42')]);if(_0x2060e9&&_0x2060e9[_0x3071('0x49')]){logger[_0x3071('0x1d')]('[QUEUE]',_0x3071('0x4a'));_0xd273ec[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x4d395a[_0x3071('0x47')],_0xd273ec[_0x3071('0x4d')],md5(_0xd273ec[_0x3071('0x4d')]));}else{_0xd273ec[_0x3071('0x4b')]='';}return getConnection(_0x4d395a)[_0x3071('0x1a')](function(_0x886f7){_0x38bcc2=_0x886f7;return getUser(_0x4d395a,_0x46924d[_0x3071('0x4e')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x24977b){_0x131ae6=_0x24977b;return getEndUser(_0x4d395a,_0x4b6bbb,_0xd273ec[_0x3071('0x4f')],_0xd273ec[_0x3071('0x50')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x596cdd){_0x117e73=_0x596cdd;return getTicket(_0x4d395a,_0x131ae6,_0x117e73,_0x4b6bbb,_0xd273ec,_0x4b6bbb['Fields'],_0x38bcc2,_0x3071('0x46'));})['then'](function(_0x403761){_0x224a70=_0x403761;logger[_0x3071('0x1d')](_0x3071('0x51'),_0x224a70['id']);logger['info'](_0x3071('0x52'),_0x224a70['id'],_0x46924d[_0x3071('0x3e')],_0x4d395a['type']);switch(_0x4d395a['type']){case _0x3071('0x53'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),'trigger:salesforce:display',{'recordId':_0x224a70['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),_0x3071('0x56'),{'uri':util['format'](_0x3071('0x57'),_0x38bcc2[_0x3071('0x58')],_0x224a70['id'])});break;default:logger[_0x3071('0x59')](_0x3071('0x5a'));}})[_0x3071('0x5b')](function(_0x24f429){logger[_0x3071('0x59')]('[QUEUE]',JSON['stringify'](_0x24f429));});};exports[_0x3071('0x5c')]=function(_0x4de4f3,_0xe96994,_0x26ba8a,_0x499b6a,_0x19dc95,_0x1bf911,_0x4d3886){var _0x108b14,_0x1878e2,_0x180344,_0x6e96c7;_0x1bf911[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x1bf911[_0x3071('0x47')]);_0x1bf911[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x1bf911['remoteUri']);if(_0x4d3886&&_0x4d3886[_0x3071('0x5d')]&&_0x4d3886[_0x3071('0x5d')]!==_0x3071('0x5e')){logger[_0x3071('0x1d')](_0x3071('0x5f'),_0x3071('0x4a'));_0xe96994[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x1bf911['serverUrl'],_0xe96994[_0x3071('0x4d')],md5(_0xe96994[_0x3071('0x4d')]));}return getConnection(_0x1bf911)[_0x3071('0x1a')](function(_0x26ecb2){_0x6e96c7=_0x26ecb2;return getUser(_0x1bf911,_0x499b6a[_0x3071('0x4e')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x389dca){_0x108b14=_0x389dca;return getEndUser(_0x1bf911,_0x26ba8a,_0xe96994[_0x3071('0x60')],_0xe96994[_0x3071('0x61')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x195d03){_0x1878e2=_0x195d03;return getTicket(_0x1bf911,_0x108b14,_0x1878e2,_0x26ba8a,_0xe96994,_0x26ba8a['Fields'],_0x6e96c7,_0x3071('0x5c'));})[_0x3071('0x1a')](function(_0x279594){_0x180344=_0x279594;logger[_0x3071('0x1d')](_0x3071('0x62'),_0x180344['id']);logger[_0x3071('0x1d')](_0x3071('0x63'),_0x180344['id'],_0x499b6a[_0x3071('0x3e')],_0x1bf911['type']);switch(_0x1bf911[_0x3071('0x37')]){case _0x3071('0x53'):emit(util['format']('user:%s',_0x499b6a[_0x3071('0x3e')]),_0x3071('0x64'),{'recordId':_0x180344['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')]('user:%s',_0x499b6a['name']),_0x3071('0x56'),{'uri':util['format']('%s/%s/e',_0x6e96c7['instanceUrl'],_0x180344['id'])});break;default:logger['error'](_0x3071('0x5f'),_0x3071('0x65'));}})[_0x3071('0x5b')](function(_0x567d19){logger[_0x3071('0x59')](_0x3071('0x5f'),JSON[_0x3071('0x66')](_0x567d19));});};exports[_0x3071('0x67')]=function(_0x5a0c1b,_0x2103a4,_0x29841a,_0x588406,_0x1b35d3,_0x29ee70){var _0x388cd1,_0x40c258,_0x4edd23,_0x11ffdd;_0x29ee70[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x29ee70['serverUrl']);_0x29ee70[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x29ee70[_0x3071('0x42')]);if(_0x1b35d3&&_0x1b35d3['monitor_format']){logger['info'](_0x3071('0x68'),_0x3071('0x4a'));_0x2103a4[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x29ee70[_0x3071('0x47')],_0x2103a4[_0x3071('0x4d')],md5(_0x2103a4[_0x3071('0x4d')]));}else{_0x2103a4['recordingURL']='';}return getConnection(_0x29ee70)[_0x3071('0x1a')](function(_0x5ea33f){_0x11ffdd=_0x5ea33f;if(!_[_0x3071('0x16')](_0x588406)){return getUser(_0x29ee70,_0x588406[_0x3071('0x3e')],_0x11ffdd);}else{return getUser(_0x29ee70,null,_0x11ffdd);}})[_0x3071('0x1a')](function(_0x2fbac7){_0x388cd1=_0x2fbac7;return getEndUser(_0x29ee70,_0x29841a,_0x2103a4[_0x3071('0x4f')],_0x2103a4[_0x3071('0x50')],_0x11ffdd);})[_0x3071('0x1a')](function(_0x2ae053){_0x40c258=_0x2ae053;return getTicket(_0x29ee70,_0x388cd1,_0x40c258,_0x29841a,_0x2103a4,_0x29841a['Fields'],_0x11ffdd);})[_0x3071('0x1a')](function(_0x138a94){_0x4edd23=_0x138a94;logger[_0x3071('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4edd23['id']);logger[_0x3071('0x1d')](_0x3071('0x69'),_0x29ee70[_0x3071('0x37')]);})['catch'](function(_0x521ee6){logger[_0x3071('0x59')]('[ABANDONED]',JSON[_0x3071('0x66')](_0x521ee6));});}; \ 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 bdf401e..8068652 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 _0x3036=['?sysparm_query=name%3D','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','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','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','email','calleridnum','callDirection','abandoned','queue','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','md5','./util','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','toLowerCase','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label'];(function(_0x5deea5,_0x230d81){var _0x3d1998=function(_0x39341d){while(--_0x39341d){_0x5deea5['push'](_0x5deea5['shift']());}};_0x3d1998(++_0x230d81);}(_0x3036,0x1a9));var _0x6303=function(_0x5cc228,_0x57c8e3){_0x5cc228=_0x5cc228-0x0;var _0x52bd2f=_0x3036[_0x5cc228];return _0x52bd2f;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x6303('0x0'));var util=require(_0x6303('0x1'));var md5=require(_0x6303('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6303('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x6303('0x4')]=_['defaults'](config[_0x6303('0x4')],{'host':_0x6303('0x5'),'port':0x18eb});var io=require(_0x6303('0x6'))(new Redis(config['redis']));function getAdminUser(_0x8a0038,_0x420da8,_0x2e2be8,_0x469401,_0x7f88f,_0x2684ac){return new Promise(function(_0x23b326,_0x179151){var _0x3eccd5={'method':'GET','uri':_0x469401+_0x6303('0x7')+'&'+_0x7f88f+'&'+_0x2684ac,'auth':_0x420da8,'json':!![]};return rp(_0x3eccd5)[_0x6303('0x8')](function(_0x3ac7ef){if(_0x3ac7ef[_0x6303('0x9')][_0x6303('0xa')]>0x0){_0x2e2be8['adminId']=_0x3ac7ef[_0x6303('0x9')][0x0][_0x6303('0xb')];}logger[_0x6303('0xc')]('['+[_0x8a0038[_0x6303('0xd')]()]+_0x6303('0xe'),_0x2e2be8);_0x23b326(_0x2e2be8);})['catch'](function(_0x5ef678){logger['error']('['+[_0x8a0038[_0x6303('0xd')]()]+']',_0x5ef678[_0x6303('0xf')]);_0x179151(_0x5ef678[_0x6303('0xf')]);});});}function getUser(_0x3e72aa,_0x2bbc57,_0x43526d,_0x3395e0,_0x2c4cbd){return function(_0x13874f){logger['info']('['+[_0x3e72aa['toUpperCase']()]+_0x6303('0x10'),_0x13874f);return new Promise(function(_0xc26f2c,_0x46c724){if(intUtil[_0x6303('0x11')](_0x13874f[_0x6303('0x12')])){var _0x4fe5cf={'method':_0x6303('0x13'),'uri':_0x43526d+_0x6303('0x14')+_0x13874f[_0x6303('0x12')]+'&'+_0x3395e0+'&'+_0x2c4cbd,'auth':_0x2bbc57,'json':!![]};logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+_0x6303('0x15'),_0x4fe5cf);return rp(_0x4fe5cf)[_0x6303('0x8')](function(_0x1211b4){logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+_0x6303('0x16'),_0x1211b4);if(_0x1211b4['result']['length']>0x0&&String(_0x1211b4[_0x6303('0x9')][0x0][_0x6303('0x17')])===_0x6303('0x18')){_0x13874f[_0x6303('0x19')]=_0x1211b4['result'][0x0][_0x6303('0xb')];}else{_0x13874f[_0x6303('0x19')]=_0x13874f[_0x6303('0x1a')];_0x13874f[_0x6303('0x12')]=_0x13874f[_0x6303('0x1b')];}logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+'],\x20getUser\x20crm',_0x13874f);_0xc26f2c(_0x13874f);})['catch'](function(_0x135434){logger[_0x6303('0x1c')]('['+[_0x3e72aa['toUpperCase']()]+']',_0x135434[_0x6303('0xf')]);_0x46c724(_0x135434[_0x6303('0xf')]);});}else{logger[_0x6303('0xc')]('['+[_0x3e72aa['toUpperCase']()]+_0x6303('0x1d'));_0x13874f[_0x6303('0x19')]=_0x13874f[_0x6303('0x1a')];_0x13874f[_0x6303('0x12')]=_0x13874f[_0x6303('0x1b')];_0xc26f2c(_0x13874f);}});};}function createEndUser(_0x24b2fc,_0x411c12,_0x3bcf79,_0x62e4b,_0x29cd61){logger[_0x6303('0xc')]('['+[_0x24b2fc['toUpperCase']()]+_0x6303('0x1e'),_0x3bcf79);return new Promise(function(_0x4d1e98,_0x206878){var _0x544107={'method':'POST','uri':_0x62e4b+_0x6303('0x1f')+_0x29cd61,'body':{'user_name':_0x3bcf79[_0x6303('0x20')],'roles':_0x6303('0x21'),'first_name':_0x3bcf79['endUserNumber'],'active':'true','date_format':_0x6303('0x22'),'phone':_0x3bcf79['endUserNumber']},'auth':_0x411c12,'json':!![]};return rp(_0x544107)['then'](function(_0x57f803){logger[_0x6303('0xc')]('['+[_0x24b2fc[_0x6303('0xd')]()]+_0x6303('0x23'),_0x57f803[_0x6303('0x9')]);_0x3bcf79['endUserId']=_0x57f803[_0x6303('0x9')][_0x6303('0xb')];_0x4d1e98(_0x3bcf79);})[_0x6303('0x24')](function(_0x591fdb){logger['error']('['+[_0x24b2fc[_0x6303('0xd')]()]+']',_0x591fdb['message']);_0x206878(_0x591fdb[_0x6303('0xf')]);});});}function getEndUser(_0x11b368,_0x3e4767,_0x2db401,_0x470f56,_0x57dc5d){return function(_0x12878f){logger[_0x6303('0xc')]('['+[_0x11b368[_0x6303('0xd')]()]+_0x6303('0x25'),_0x12878f);return new Promise(function(_0x2fee5c,_0x50731e){var _0xfeaac9={'method':_0x6303('0x13'),'uri':_0x2db401+_0x6303('0x26')+_0x12878f[_0x6303('0x20')]+'&'+_0x470f56+'&'+_0x57dc5d,'auth':_0x3e4767,'json':!![]};return rp(_0xfeaac9)[_0x6303('0x8')](function(_0x540eb5){if(_0x540eb5[_0x6303('0x9')]['length']>0x0){_0x12878f[_0x6303('0x27')]=_0x540eb5[_0x6303('0x9')][0x0][_0x6303('0xb')];logger['info']('['+[_0x11b368['toUpperCase']()]+_0x6303('0x28'),_0x12878f);_0x2fee5c(_0x12878f);}else{return createEndUser(_0x11b368,_0x3e4767,_0x12878f,_0x2db401,_0x470f56)['then'](function(_0x2e099d){logger[_0x6303('0xc')]('['+[_0x11b368[_0x6303('0xd')]()]+'],\x20createEndUser\x20crm',_0x2e099d);_0x2fee5c(_0x2e099d);});}})['catch'](function(_0x1f0857){logger[_0x6303('0x1c')]('['+[_0x11b368[_0x6303('0xd')]()]+']',_0x1f0857[_0x6303('0xf')]);_0x50731e(_0x1f0857[_0x6303('0xf')]);});});};}function getCustomFields(_0x38f4b6,_0x54861c){var _0x375379={};if(_0x38f4b6['length']>0x0){_[_0x6303('0x29')](_0x38f4b6,function(_0x5c466f){if(_0x5c466f[_0x6303('0x2a')]===_0x6303('0x2b')&&_0x5c466f[_0x6303('0x2c')]&&!_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField'][_0x6303('0x2e')]()]=_0x5c466f['content'][_0x6303('0x2f')]();}else if(_0x5c466f[_0x6303('0x2a')]==='string'&&_0x5c466f[_0x6303('0x30')]&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField'][_0x6303('0x2e')]()]=_0x5c466f['content'][_0x6303('0x2f')]();}else if(_0x5c466f['type']==='variable'&&_0x5c466f['variableName']&&_0x5c466f[_0x6303('0x30')]&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField']['toLowerCase']()]=_0x54861c[_0x5c466f[_0x6303('0x31')]][_0x6303('0x2f')]();}else if(_0x5c466f['type']===_0x6303('0x32')&&_0x5c466f[_0x6303('0x33')]&&_0x5c466f[_0x6303('0x33')][_0x6303('0x34')]&&_0x5c466f['idField']&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f[_0x6303('0x30')][_0x6303('0x2e')]()]=_0x54861c[_0x5c466f['Variable'][_0x6303('0x34')][_0x6303('0x2e')]()][_0x6303('0x2f')]();}});}return _0x375379;}function getTicket(_0x2c19fd,_0x692daa,_0x26558c,_0x548270,_0x4c78d7,_0x46c1b8){return function(_0x3e8366){logger['info']('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x35'),_0x3e8366);return new Promise(function(_0x362fee,_0x3cbf35){var _0x4a5a84=_0x2c19fd[_0x6303('0x2e')]()===_0x6303('0x36')?_0x3e8366[_0x6303('0x19')]:_0x3e8366[_0x6303('0x27')];var _0x4b5e69={'method':_0x6303('0x37'),'uri':_0x26558c+_0x6303('0x38')+'?'+_0x46c1b8,'body':Object['assign']({},{'active':_0x6303('0x18'),'caller_id':_0x4a5a84,'assigned_to':_0x3e8366[_0x6303('0x19')],'short_description':intUtil[_0x6303('0x39')](_0x548270[_0x6303('0x3a')],_0x4c78d7,'\x20'),'description':intUtil[_0x6303('0x39')](_0x548270[_0x6303('0x3b')],_0x4c78d7,'\x0a')},getCustomFields(_0x548270[_0x6303('0x3c')],_0x4c78d7)),'auth':_0x692daa,'json':!![]};return rp(_0x4b5e69)[_0x6303('0x8')](function(_0x36ab4e){logger[_0x6303('0xc')]('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x3d'),_0x36ab4e[_0x6303('0x9')]);_0x3e8366['ticketId']=_0x36ab4e[_0x6303('0x9')]['sys_id'];_0x3e8366[_0x6303('0x3e')]=_0x36ab4e[_0x6303('0x9')]['number'];logger['info']('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x3f'),_0x3e8366);_0x362fee(_0x3e8366);})[_0x6303('0x24')](function(_0x3707af){logger[_0x6303('0x1c')]('['+[_0x2c19fd[_0x6303('0xd')]()]+']',_0x3707af[_0x6303('0xf')]);_0x3cbf35(_0x3707af[_0x6303('0xf')]);});});};}function createRemoteTag(_0x6a4ef2,_0x47705a,_0x21315d,_0x24d56d){return new Promise(function(_0xcd7bd0,_0x5db7b0){var _0x3370a2={'method':'POST','uri':_0x21315d+'label'+'?'+_0x24d56d,'body':{'short_description':_0x6a4ef2,'global':!![],'active':!![],'name':_0x6a4ef2},'auth':_0x47705a,'json':!![]};return rp(_0x3370a2)['then'](function(_0x4a6bde){var _0x4a01ac=_0x4a6bde['result']['sys_id'];_0xcd7bd0(_0x4a01ac);});});}function getRemoteTag(_0x451289,_0x1c297b,_0x519701,_0x1c0935,_0x5be5f5){return new Promise(function(_0x47cc7e,_0x11414b){var _0x1cd73d={'method':_0x6303('0x13'),'uri':_0x519701+_0x6303('0x40')+_0x6303('0x41')+_0x451289+'&'+_0x1c0935,'auth':_0x1c297b,'json':!![]};return rp(_0x1cd73d)[_0x6303('0x8')](function(_0x36ff1e){if(_0x36ff1e[_0x6303('0x9')][_0x6303('0xa')]>0x0){var _0x1be9bd=_0x36ff1e['result'][0x0][_0x6303('0xb')];_0x47cc7e(_0x1be9bd);}else{return createRemoteTag(_0x451289,_0x1c297b,_0x519701,_0x1c0935)['then'](function(_0x6925dd){_0x47cc7e(_0x6925dd);});}});});}function assignTagToIncident(_0x2aa59c,_0x6c6ebc,_0x22bb6a,_0x370044,_0x4beaad){return new Promise(function(_0x5883bb,_0x3de3a4){var _0x502eb0={'method':_0x6303('0x37'),'uri':_0x22bb6a+'label_entry'+'?'+_0x4beaad,'body':{'label':_0x2aa59c,'table':_0x6303('0x38'),'id_type':'Incident','table_key':_0x370044['ticketId'],'title':_0x6303('0x42')+_0x370044[_0x6303('0x3e')],'id_display':_0x370044['ticketNumber']},'auth':_0x6c6ebc,'json':!![]};return rp(_0x502eb0)[_0x6303('0x8')](function(_0x22132e){_0x5883bb();})[_0x6303('0x24')](function(){_0x5883bb();});});}function manageTags(_0x3f77c7,_0x50879d,_0x1e63c7,_0x19ef9b,_0x2b4469,_0x24e1d3,_0x1bbdf9){return new Promise(function(_0x4d3d24,_0x5d8bea){var _0x3f9fb4=[];_0x50879d[_0x6303('0x29')](function(_0x2f9aec){_0x3f9fb4['push'](getRemoteTag(_0x2f9aec,_0x1e63c7,_0x19ef9b,_0x24e1d3,_0x1bbdf9));});return Promise[_0x6303('0x43')](_0x3f9fb4)[_0x6303('0x8')](function(_0x35c787){if(_0x35c787[_0x6303('0xa')]){logger[_0x6303('0xc')]('['+[_0x3f77c7[_0x6303('0xd')]()]+_0x6303('0x44'),_0x35c787);var _0x4eaa6c=[];_0x35c787[_0x6303('0x29')](function(_0x141367){_0x4eaa6c[_0x6303('0x45')](assignTagToIncident(_0x141367,_0x1e63c7,_0x19ef9b,_0x2b4469,_0x24e1d3));});return Promise['all'](_0x4eaa6c)[_0x6303('0x8')](function(){_0x4d3d24();})[_0x6303('0x24')](function(){_0x4d3d24();});}else{_0x4d3d24();}});});}function getTags(_0x561830,_0xfd4139,_0x2335ef,_0x5c8adf,_0x10c643,_0x41631c){return function(_0x420b4c){return new Promise(function(_0xe30024,_0x24e5fd){var _0x3c7161=[];var _0x452c5d=_0x5c8adf[_0x6303('0x46')];if(_0x452c5d&&_0x452c5d['length']>0x0){_0x3c7161=_[_0x6303('0x47')](_0x452c5d,_0x6303('0x34'));}if(_0x3c7161[_0x6303('0xa')]>0x0){return manageTags(_0x561830,_0x3c7161,_0xfd4139,_0x2335ef,_0x420b4c,_0x10c643,_0x41631c)[_0x6303('0x8')](function(){_0xe30024(_0x420b4c);});}else{_0xe30024(_0x420b4c);}});};}function emit(_0x2f01e5,_0xe708ef,_0x5b99a9){var _0x531f11=_0x6303('0x48')+_0x6303('0x49')+_0x6303('0x4a')+'%255EORDERBYDESCnumber';var _0x571e25={'uri':_0x2f01e5+_0x6303('0x4b')+_0x5b99a9+_0x531f11};io['to'](util[_0x6303('0x4c')](_0x6303('0x4d'),_0xe708ef))['emit']('trigger:browser:url',_0x571e25);}exports['cs']=function(_0x9f2209,_0xce52e,_0x4cc4f2,_0x3095c1,_0x5d43e8,_0x1cbcb1,_0x2641eb,_0x4f0277){var _0x4876a2={};var _0x289885={'user':_0x1cbcb1['username'],'pass':_0x1cbcb1[_0x6303('0x4e')]};var _0x2d66a5=_0x6303('0x4f');var _0x12c84c='sysparm_display_value=true';_0x1cbcb1['remoteUri']=intUtil[_0x6303('0x50')](_0x1cbcb1[_0x6303('0x51')]);_0x1cbcb1[_0x6303('0x52')]=intUtil[_0x6303('0x50')](_0x1cbcb1['serverUrl']);var _0x4f9466=util['format']('%s/api/now/table/',_0x1cbcb1[_0x6303('0x51')]);_0x4876a2[_0x6303('0x12')]=!_['isNil'](_0x3095c1)?_0x3095c1[_0x6303('0x53')]:null;_0x4876a2[_0x6303('0x1b')]=_0x1cbcb1[_0x6303('0x53')];_0x4876a2[_0x6303('0x20')]=_0x4f0277[_0x6303('0x2e')]()==='outbound'?_0xce52e['destcalleridnum']:_0xce52e[_0x6303('0x54')];_0x4876a2[_0x6303('0x55')]=_0x4f0277==='queue'||_0x4f0277===_0x6303('0x56')?_0x6303('0x57'):_0x6303('0x36');var _0x3b4d1c=util[_0x6303('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cbcb1['serverUrl'],_0xce52e[_0x6303('0x58')],md5(_0xce52e[_0x6303('0x58')]));if(_0x5d43e8&&_0x5d43e8['monitor_format']){logger['info']('[QUEUE]',_0x6303('0x59'));_0xce52e['recordingURL']=_0x3b4d1c;}else if(_0x2641eb&&_0x2641eb[_0x6303('0x5a')]&&_0x2641eb[_0x6303('0x5a')]!==_0x6303('0x5b')){logger[_0x6303('0xc')](_0x6303('0x5c'),'Recording\x20is\x20enabled!');_0xce52e[_0x6303('0x5d')]=_0x3b4d1c;}else{_0xce52e['recordingURL']='';}return getAdminUser(_0x4f0277,_0x289885,_0x4876a2,_0x4f9466,_0x12c84c,_0x2d66a5)[_0x6303('0x8')](getUser(_0x4f0277,_0x289885,_0x4f9466,_0x12c84c,_0x2d66a5))['then'](getEndUser(_0x4f0277,_0x289885,_0x4f9466,_0x12c84c,_0x2d66a5))[_0x6303('0x8')](getTicket(_0x4f0277,_0x289885,_0x4f9466,_0x4cc4f2,_0xce52e,_0x12c84c))[_0x6303('0x8')](function(_0x3df9d1){logger['info'](util[_0x6303('0x4c')](_0x6303('0x5e'),_0x3df9d1[_0x6303('0x5f')]));logger[_0x6303('0xc')](util[_0x6303('0x4c')](_0x6303('0x60'),_0x4f0277));if(_0x4f0277!==_0x6303('0x56')){logger['info']('['+[_0x4f0277[_0x6303('0xd')]()]+']',_0x6303('0x61'));emit(_0x1cbcb1[_0x6303('0x51')],_0x3095c1[_0x6303('0x34')],_0x3df9d1[_0x6303('0x5f')]);}})[_0x6303('0x24')](function(_0x41bde9){logger['error']('['+[_0x4f0277[_0x6303('0xd')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x41bde9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb2b5=['sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','type','string','nameField','idField','customField','content','variable','toLowerCase','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','md5','ioredis','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId'];(function(_0x45c001,_0x38db9a){var _0x2603a6=function(_0x5903a0){while(--_0x5903a0){_0x45c001['push'](_0x45c001['shift']());}};_0x2603a6(++_0x38db9a);}(_0xb2b5,0xa3));var _0x5b2b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xb2b5[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require('util');var md5=require(_0x5b2b('0x0'));var Redis=require(_0x5b2b('0x1'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x5b2b('0x2'))(_0x5b2b('0x3'));config[_0x5b2b('0x4')]=_[_0x5b2b('0x5')](config['redis'],{'host':_0x5b2b('0x6'),'port':0x18eb});var io=require(_0x5b2b('0x7'))(new Redis(config['redis']));function getAdminUser(_0x54389e,_0x1e08e6,_0x8e6e14,_0x2a7fa8,_0x168af6,_0x6cc9ab){return new Promise(function(_0x29d7be,_0x15425f){var _0xa39fc6={'method':'GET','uri':_0x2a7fa8+_0x5b2b('0x8')+'&'+_0x168af6+'&'+_0x6cc9ab,'auth':_0x1e08e6,'json':!![]};return rp(_0xa39fc6)[_0x5b2b('0x9')](function(_0x53e4ca){if(_0x53e4ca[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){_0x8e6e14['adminId']=_0x53e4ca[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];}logger[_0x5b2b('0xd')]('['+[_0x54389e[_0x5b2b('0xe')]()]+_0x5b2b('0xf'),_0x8e6e14);_0x29d7be(_0x8e6e14);})[_0x5b2b('0x10')](function(_0x235bae){logger['error']('['+[_0x54389e[_0x5b2b('0xe')]()]+']',_0x235bae['message']);_0x15425f(_0x235bae[_0x5b2b('0x11')]);});});}function getUser(_0x36e1bc,_0x3f5236,_0x2611a3,_0x4ff4ba,_0x310060){return function(_0x57b38f){logger[_0x5b2b('0xd')]('['+[_0x36e1bc['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x57b38f);return new Promise(function(_0x44be6d,_0x16e49b){if(intUtil['validateEmail'](_0x57b38f[_0x5b2b('0x12')])){var _0x2db9ee={'method':_0x5b2b('0x13'),'uri':_0x2611a3+_0x5b2b('0x14')+_0x57b38f[_0x5b2b('0x12')]+'&'+_0x4ff4ba+'&'+_0x310060,'auth':_0x3f5236,'json':!![]};logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x15'),_0x2db9ee);return rp(_0x2db9ee)[_0x5b2b('0x9')](function(_0x318e05){logger[_0x5b2b('0xd')]('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x16'),_0x318e05);if(_0x318e05[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0&&String(_0x318e05[_0x5b2b('0xa')][0x0][_0x5b2b('0x17')])===_0x5b2b('0x18')){_0x57b38f[_0x5b2b('0x19')]=_0x318e05[_0x5b2b('0xa')][0x0]['sys_id'];}else{_0x57b38f['userId']=_0x57b38f[_0x5b2b('0x1a')];_0x57b38f['userEmail']=_0x57b38f[_0x5b2b('0x1b')];}logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x1c'),_0x57b38f);_0x44be6d(_0x57b38f);})[_0x5b2b('0x10')](function(_0x37cbd8){logger[_0x5b2b('0x1d')]('['+[_0x36e1bc['toUpperCase']()]+']',_0x37cbd8[_0x5b2b('0x11')]);_0x16e49b(_0x37cbd8[_0x5b2b('0x11')]);});}else{logger['info']('['+[_0x36e1bc[_0x5b2b('0xe')]()]+_0x5b2b('0x1e'));_0x57b38f['userId']=_0x57b38f[_0x5b2b('0x1a')];_0x57b38f[_0x5b2b('0x12')]=_0x57b38f[_0x5b2b('0x1b')];_0x44be6d(_0x57b38f);}});};}function createEndUser(_0x1bfd12,_0x3e3ca7,_0x94d866,_0x57284a,_0x2c80be){logger[_0x5b2b('0xd')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+_0x5b2b('0x1f'),_0x94d866);return new Promise(function(_0x45a0cd,_0x5930ef){var _0x3ff027={'method':_0x5b2b('0x20'),'uri':_0x57284a+_0x5b2b('0x21')+_0x2c80be,'body':{'user_name':_0x94d866[_0x5b2b('0x22')],'roles':_0x5b2b('0x23'),'first_name':_0x94d866[_0x5b2b('0x22')],'active':'true','date_format':_0x5b2b('0x24'),'phone':_0x94d866[_0x5b2b('0x22')]},'auth':_0x3e3ca7,'json':!![]};return rp(_0x3ff027)[_0x5b2b('0x9')](function(_0x1127b0){logger[_0x5b2b('0xd')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+_0x5b2b('0x25'),_0x1127b0[_0x5b2b('0xa')]);_0x94d866[_0x5b2b('0x26')]=_0x1127b0[_0x5b2b('0xa')]['sys_id'];_0x45a0cd(_0x94d866);})[_0x5b2b('0x10')](function(_0xd2cc6){logger[_0x5b2b('0x1d')]('['+[_0x1bfd12[_0x5b2b('0xe')]()]+']',_0xd2cc6[_0x5b2b('0x11')]);_0x5930ef(_0xd2cc6[_0x5b2b('0x11')]);});});}function getEndUser(_0x39821a,_0x1adc11,_0x2ea8f2,_0x508ea5,_0x124a42){return function(_0x349e56){logger[_0x5b2b('0xd')]('['+[_0x39821a[_0x5b2b('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x349e56);return new Promise(function(_0x531054,_0x2ea56b){var _0x5a9572={'method':_0x5b2b('0x13'),'uri':_0x2ea8f2+_0x5b2b('0x27')+_0x349e56[_0x5b2b('0x22')]+'&'+_0x508ea5+'&'+_0x124a42,'auth':_0x1adc11,'json':!![]};return rp(_0x5a9572)[_0x5b2b('0x9')](function(_0x5cdf37){if(_0x5cdf37[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){_0x349e56[_0x5b2b('0x26')]=_0x5cdf37[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];logger[_0x5b2b('0xd')]('['+[_0x39821a[_0x5b2b('0xe')]()]+'],\x20getEndUser\x20crm',_0x349e56);_0x531054(_0x349e56);}else{return createEndUser(_0x39821a,_0x1adc11,_0x349e56,_0x2ea8f2,_0x508ea5)['then'](function(_0x411857){logger[_0x5b2b('0xd')]('['+[_0x39821a['toUpperCase']()]+_0x5b2b('0x28'),_0x411857);_0x531054(_0x411857);});}})[_0x5b2b('0x10')](function(_0x501615){logger['error']('['+[_0x39821a['toUpperCase']()]+']',_0x501615[_0x5b2b('0x11')]);_0x2ea56b(_0x501615[_0x5b2b('0x11')]);});});};}function getCustomFields(_0x2317ca,_0xe2238e){var _0x49aeca={};if(_0x2317ca['length']>0x0){_[_0x5b2b('0x29')](_0x2317ca,function(_0x5ee112){if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x2b')&&_0x5ee112[_0x5b2b('0x2c')]&&!_0x5ee112['customField']){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')]['toLowerCase']()]=_0x5ee112['content']['toString']();}else if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x2b')&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')]['toLowerCase']()]=_0x5ee112[_0x5b2b('0x2f')]['toString']();}else if(_0x5ee112[_0x5b2b('0x2a')]===_0x5b2b('0x30')&&_0x5ee112['variableName']&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112['idField'][_0x5b2b('0x31')]()]=_0xe2238e[_0x5ee112[_0x5b2b('0x32')]][_0x5b2b('0x33')]();}else if(_0x5ee112['type']===_0x5b2b('0x34')&&_0x5ee112[_0x5b2b('0x35')]&&_0x5ee112[_0x5b2b('0x35')][_0x5b2b('0x36')]&&_0x5ee112[_0x5b2b('0x2d')]&&_0x5ee112[_0x5b2b('0x2e')]){_0x49aeca[_0x5ee112[_0x5b2b('0x2d')][_0x5b2b('0x31')]()]=_0xe2238e[_0x5ee112[_0x5b2b('0x35')]['name'][_0x5b2b('0x31')]()][_0x5b2b('0x33')]();}});}return _0x49aeca;}function getTicket(_0x1de131,_0x33efee,_0x541953,_0x2e8832,_0x57ebea,_0x4a7d7b){return function(_0x4f4a57){logger['info']('['+[_0x1de131[_0x5b2b('0xe')]()]+_0x5b2b('0x37'),_0x4f4a57);return new Promise(function(_0x24b948,_0x3ee657){var _0x21451e=_0x1de131[_0x5b2b('0x31')]()===_0x5b2b('0x38')?_0x4f4a57['userId']:_0x4f4a57[_0x5b2b('0x26')];var _0x1f814c={'method':'POST','uri':_0x541953+'incident'+'?'+_0x4a7d7b,'body':Object[_0x5b2b('0x39')]({},{'active':'true','caller_id':_0x21451e,'assigned_to':_0x4f4a57['userId'],'short_description':intUtil[_0x5b2b('0x3a')](_0x2e8832[_0x5b2b('0x3b')],_0x57ebea,'\x20'),'description':intUtil[_0x5b2b('0x3a')](_0x2e8832[_0x5b2b('0x3c')],_0x57ebea,'\x0a')},getCustomFields(_0x2e8832['Fields'],_0x57ebea)),'auth':_0x33efee,'json':!![]};return rp(_0x1f814c)[_0x5b2b('0x9')](function(_0x2d14cc){logger['info']('['+[_0x1de131['toUpperCase']()]+_0x5b2b('0x3d'),_0x2d14cc[_0x5b2b('0xa')]);_0x4f4a57[_0x5b2b('0x3e')]=_0x2d14cc['result']['sys_id'];_0x4f4a57[_0x5b2b('0x3f')]=_0x2d14cc[_0x5b2b('0xa')]['number'];logger[_0x5b2b('0xd')]('['+[_0x1de131[_0x5b2b('0xe')]()]+']\x20getTicket\x20crm',_0x4f4a57);_0x24b948(_0x4f4a57);})[_0x5b2b('0x10')](function(_0x4f3a07){logger['error']('['+[_0x1de131[_0x5b2b('0xe')]()]+']',_0x4f3a07[_0x5b2b('0x11')]);_0x3ee657(_0x4f3a07[_0x5b2b('0x11')]);});});};}function createRemoteTag(_0x2fe144,_0x585789,_0xa7da0d,_0x57e376){return new Promise(function(_0x44b2b8,_0x498c27){var _0x341816={'method':_0x5b2b('0x20'),'uri':_0xa7da0d+_0x5b2b('0x40')+'?'+_0x57e376,'body':{'short_description':_0x2fe144,'global':!![],'active':!![],'name':_0x2fe144},'auth':_0x585789,'json':!![]};return rp(_0x341816)[_0x5b2b('0x9')](function(_0x503d2b){var _0x1d0efe=_0x503d2b[_0x5b2b('0xa')][_0x5b2b('0xc')];_0x44b2b8(_0x1d0efe);});});}function getRemoteTag(_0x593501,_0x42fac9,_0x5a0e86,_0x536648,_0x420c4d){return new Promise(function(_0xfdcbf1,_0xb9eb98){var _0x35733d={'method':_0x5b2b('0x13'),'uri':_0x5a0e86+_0x5b2b('0x40')+_0x5b2b('0x41')+_0x593501+'&'+_0x536648,'auth':_0x42fac9,'json':!![]};return rp(_0x35733d)['then'](function(_0x45cf58){if(_0x45cf58[_0x5b2b('0xa')][_0x5b2b('0xb')]>0x0){var _0x5959ea=_0x45cf58[_0x5b2b('0xa')][0x0][_0x5b2b('0xc')];_0xfdcbf1(_0x5959ea);}else{return createRemoteTag(_0x593501,_0x42fac9,_0x5a0e86,_0x536648)['then'](function(_0x4eceb9){_0xfdcbf1(_0x4eceb9);});}});});}function assignTagToIncident(_0x26e063,_0x530d99,_0x37f4fa,_0x106409,_0xe71e33){return new Promise(function(_0x27e68b,_0x37f78b){var _0x1d914f={'method':_0x5b2b('0x20'),'uri':_0x37f4fa+_0x5b2b('0x42')+'?'+_0xe71e33,'body':{'label':_0x26e063,'table':_0x5b2b('0x43'),'id_type':_0x5b2b('0x44'),'table_key':_0x106409[_0x5b2b('0x3e')],'title':_0x5b2b('0x45')+_0x106409[_0x5b2b('0x3f')],'id_display':_0x106409[_0x5b2b('0x3f')]},'auth':_0x530d99,'json':!![]};return rp(_0x1d914f)['then'](function(_0x48f869){_0x27e68b();})[_0x5b2b('0x10')](function(){_0x27e68b();});});}function manageTags(_0x35a0d6,_0x5f3c42,_0x581a72,_0x3a91cf,_0x477578,_0x24e47d,_0x1be3e0){return new Promise(function(_0x40af7b,_0x135d8c){var _0xa9c28c=[];_0x5f3c42['forEach'](function(_0x573200){_0xa9c28c['push'](getRemoteTag(_0x573200,_0x581a72,_0x3a91cf,_0x24e47d,_0x1be3e0));});return Promise[_0x5b2b('0x46')](_0xa9c28c)[_0x5b2b('0x9')](function(_0x90f792){if(_0x90f792[_0x5b2b('0xb')]){logger[_0x5b2b('0xd')]('['+[_0x35a0d6['toUpperCase']()]+_0x5b2b('0x47'),_0x90f792);var _0x5a523b=[];_0x90f792[_0x5b2b('0x29')](function(_0x197bda){_0x5a523b['push'](assignTagToIncident(_0x197bda,_0x581a72,_0x3a91cf,_0x477578,_0x24e47d));});return Promise[_0x5b2b('0x46')](_0x5a523b)['then'](function(){_0x40af7b();})[_0x5b2b('0x10')](function(){_0x40af7b();});}else{_0x40af7b();}});});}function getTags(_0x467624,_0x56e334,_0x394401,_0x7e1906,_0x2e8260,_0x24f79c){return function(_0x4ff350){return new Promise(function(_0x203ab1,_0x494a6d){var _0x45ffdc=[];var _0x33c4e5=_0x7e1906['Tags'];if(_0x33c4e5&&_0x33c4e5[_0x5b2b('0xb')]>0x0){_0x45ffdc=_[_0x5b2b('0x48')](_0x33c4e5,'name');}if(_0x45ffdc['length']>0x0){return manageTags(_0x467624,_0x45ffdc,_0x56e334,_0x394401,_0x4ff350,_0x2e8260,_0x24f79c)[_0x5b2b('0x9')](function(){_0x203ab1(_0x4ff350);});}else{_0x203ab1(_0x4ff350);}});};}function emit(_0x255de4,_0x282a6d,_0x1c29ed){var _0x4edbf1=_0x5b2b('0x49')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x9f803b={'uri':_0x255de4+_0x5b2b('0x4a')+_0x1c29ed+_0x4edbf1};io['to'](util['format'](_0x5b2b('0x4b'),_0x282a6d))[_0x5b2b('0x4c')]('trigger:browser:url',_0x9f803b);}exports['cs']=function(_0x54a55f,_0x154a5b,_0x30a14c,_0xb2b53c,_0x5a6a0f,_0x5e2a7f,_0x1127ae,_0x4c8053){var _0x2e5fcb={};var _0x29af50={'user':_0x5e2a7f[_0x5b2b('0x4d')],'pass':_0x5e2a7f[_0x5b2b('0x4e')]};var _0x2d19cb=_0x5b2b('0x4f');var _0x3f79e9='sysparm_display_value=true';_0x5e2a7f[_0x5b2b('0x50')]=intUtil[_0x5b2b('0x51')](_0x5e2a7f['remoteUri']);_0x5e2a7f['serverUrl']=intUtil[_0x5b2b('0x51')](_0x5e2a7f[_0x5b2b('0x52')]);var _0x55e1d1=util[_0x5b2b('0x53')](_0x5b2b('0x54'),_0x5e2a7f['remoteUri']);_0x2e5fcb[_0x5b2b('0x12')]=!_[_0x5b2b('0x55')](_0xb2b53c)?_0xb2b53c[_0x5b2b('0x56')]:null;_0x2e5fcb[_0x5b2b('0x1b')]=_0x5e2a7f[_0x5b2b('0x56')];_0x2e5fcb[_0x5b2b('0x22')]=_0x4c8053[_0x5b2b('0x31')]()===_0x5b2b('0x38')?_0x154a5b[_0x5b2b('0x57')]:_0x154a5b['calleridnum'];_0x2e5fcb['callDirection']=_0x4c8053===_0x5b2b('0x58')||_0x4c8053===_0x5b2b('0x59')?_0x5b2b('0x58'):_0x5b2b('0x38');var _0x5a6333=util[_0x5b2b('0x53')](_0x5b2b('0x5a'),_0x5e2a7f['serverUrl'],_0x154a5b[_0x5b2b('0x5b')],md5(_0x154a5b['uniqueid']));if(_0x5a6a0f&&_0x5a6a0f['monitor_format']){logger['info'](_0x5b2b('0x5c'),_0x5b2b('0x5d'));_0x154a5b[_0x5b2b('0x5e')]=_0x5a6333;}else if(_0x1127ae&&_0x1127ae['recordingFormat']&&_0x1127ae[_0x5b2b('0x5f')]!=='none'){logger[_0x5b2b('0xd')](_0x5b2b('0x60'),_0x5b2b('0x5d'));_0x154a5b[_0x5b2b('0x5e')]=_0x5a6333;}else{_0x154a5b['recordingURL']='';}return getAdminUser(_0x4c8053,_0x29af50,_0x2e5fcb,_0x55e1d1,_0x3f79e9,_0x2d19cb)[_0x5b2b('0x9')](getUser(_0x4c8053,_0x29af50,_0x55e1d1,_0x3f79e9,_0x2d19cb))[_0x5b2b('0x9')](getEndUser(_0x4c8053,_0x29af50,_0x55e1d1,_0x3f79e9,_0x2d19cb))[_0x5b2b('0x9')](getTicket(_0x4c8053,_0x29af50,_0x55e1d1,_0x30a14c,_0x154a5b,_0x3f79e9))[_0x5b2b('0x9')](function(_0x3c5e07){logger[_0x5b2b('0xd')](util[_0x5b2b('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3c5e07[_0x5b2b('0x3e')]));logger['info'](util[_0x5b2b('0x53')](_0x5b2b('0x61'),_0x4c8053));if(_0x4c8053!==_0x5b2b('0x59')){logger[_0x5b2b('0xd')]('['+[_0x4c8053[_0x5b2b('0xe')]()]+']',_0x5b2b('0x62'));emit(_0x5e2a7f[_0x5b2b('0x50')],_0xb2b53c['name'],_0x3c5e07[_0x5b2b('0x3e')]);}})['catch'](function(_0x4c6954){logger[_0x5b2b('0x1d')]('['+[_0x4c8053['toUpperCase']()]+_0x5b2b('0x63'),util[_0x5b2b('0x64')](_0x4c6954,{'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 fbbadbf..4937f37 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 _0xf6d6=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','uri','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','Outbound','error','abandoned','[ABANDONED]','calleridnum','Inbound','Ticket\x20created!','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','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','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','customField','nameField','type','string','custom_fields','content','Variable','toLowerCase','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x5f4e17,_0x21bebd){var _0x2820af=function(_0x1b8b51){while(--_0x1b8b51){_0x5f4e17['push'](_0x5f4e17['shift']());}};_0x2820af(++_0x21bebd);}(_0xf6d6,0x10b));var _0x6f6d=function(_0x569d04,_0x435ded){_0x569d04=_0x569d04-0x0;var _0x3c4b0f=_0xf6d6[_0x569d04];return _0x3c4b0f;};'use strict';var _=require('lodash');var rp=require(_0x6f6d('0x0'));var BPromise=require(_0x6f6d('0x1'));var md5=require(_0x6f6d('0x2'));var util=require(_0x6f6d('0x3'));var Redis=require(_0x6f6d('0x4'));var intUtil=require(_0x6f6d('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6f6d('0x6'))(_0x6f6d('0x7'));config[_0x6f6d('0x8')]=_[_0x6f6d('0x9')](config[_0x6f6d('0x8')],{'host':_0x6f6d('0xa'),'port':0x18eb});var io=require(_0x6f6d('0xb'))(new Redis(config[_0x6f6d('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x3e9cef,_0x57c947,_0x114f5f){io['to'](_0x3e9cef)[_0x6f6d('0xc')](_0x57c947,_0x114f5f);}function getTicket(_0x174cdd,_0x4c6858,_0x126f4d,_0x49f6ba,_0x2a08fb,_0x2cf9b9,_0x3804de,_0x40aa1e){logger[_0x6f6d('0xd')](_0x6f6d('0xe'));var _0x4431ce=new Date();var _0x3bcc98=[{'name':_0x6f6d('0xf'),'value':intUtil[_0x6f6d('0x10')](_0x49f6ba[_0x6f6d('0x11')],_0x2a08fb,'\x20')},{'name':'assigned_user_id','value':_0x4c6858['id']},{'name':_0x6f6d('0x12'),'value':_0x4c6858['id']},{'name':'description','value':intUtil[_0x6f6d('0x10')](_0x49f6ba[_0x6f6d('0x13')],_0x2a08fb,'\x0a')},{'name':_0x6f6d('0x14'),'value':_0x4431ce[_0x6f6d('0x15')]()[_0x6f6d('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x6f6d('0x17'),'value':'15'},{'name':_0x6f6d('0x18'),'value':_0x126f4d['id']},{'name':_0x6f6d('0x19'),'value':_0x6f6d('0x1a')},{'name':_0x6f6d('0x1b'),'value':_0x126f4d[_0x6f6d('0xf')]},{'name':'direction','value':_0x40aa1e}];if(_0x2cf9b9[_0x6f6d('0x1c')]){_[_0x6f6d('0x1d')](_0x2cf9b9,function(_0x2ac207){if(_0x2a08fb[_0x2ac207['variableName']]){_0x3bcc98[_0x6f6d('0x1e')]({'name':_0x2ac207[_0x6f6d('0x1f')],'value':_0x2a08fb[_0x2ac207[_0x6f6d('0x20')]]});}});}return request({'form':{'method':_0x6f6d('0x21'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x3804de['id'],'module_name':_0x6f6d('0x24'),'name_value_list':_0x3bcc98})}});}function getAuth(_0x5cede9){return util[_0x6f6d('0x25')]('Basic\x20%s',new Buffer(_0x5cede9[_0x6f6d('0x26')]+':X')[_0x6f6d('0x27')](_0x6f6d('0x28')));}function getServerInfo(_0x13e5ee){return request({'form':{'method':_0x6f6d('0x29'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x13e5ee['id']})}});}function getUser(_0x5dab63,_0x37620b,_0x40d1a4){if(!_[_0x6f6d('0x2a')](_0x37620b)){logger[_0x6f6d('0xd')](_0x6f6d('0x2b'),_0x37620b);return request({'form':{'method':_0x6f6d('0x2c'),'input_type':'JSON','response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x40d1a4['id'],'module_name':_0x6f6d('0x2d'),'query':util[_0x6f6d('0x25')](_0x6f6d('0x2e'),_0x37620b),'order_by':'','offset':'0','select_fields':['id',_0x6f6d('0xf'),_0x6f6d('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6f6d('0x30')](function(_0xebd23){if(_0xebd23[_0x6f6d('0x31')][_0x6f6d('0x1c')]){var _0xf963ae=_['find'](_0xebd23[_0x6f6d('0x31')],function(_0x29a85d){return _0x29a85d['name_value_list'][_0x6f6d('0x2f')][_0x6f6d('0x32')]===_0x37620b;});if(_0xf963ae){logger[_0x6f6d('0xd')](_0x6f6d('0x33'));return BPromise[_0x6f6d('0x34')]({'id':_0xf963ae[_0x6f6d('0x35')]['id'][_0x6f6d('0x32')],'name':_0xf963ae[_0x6f6d('0x35')]['name']['value']});}}logger[_0x6f6d('0xd')](_0x6f6d('0x36'));return BPromise[_0x6f6d('0x34')]({'id':_0x40d1a4['name_value_list'][_0x6f6d('0x37')][_0x6f6d('0x32')],'name':_0x40d1a4[_0x6f6d('0x35')][_0x6f6d('0x2f')][_0x6f6d('0x32')]});});}else{logger[_0x6f6d('0xd')](_0x6f6d('0x38'));return BPromise[_0x6f6d('0x34')]({'id':_0x40d1a4[_0x6f6d('0x35')][_0x6f6d('0x37')]['value'],'name':_0x40d1a4[_0x6f6d('0x35')]['user_name'][_0x6f6d('0x32')]});}}function getEndUser(_0x45adff,_0x5330f9,_0x52fb7f,_0x4416ad){logger[_0x6f6d('0xd')](_0x6f6d('0x39'),_0x52fb7f);return request({'form':{'method':'get_entry_list','input_type':_0x6f6d('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4416ad['id'],'module_name':'Contacts','query':util[_0x6f6d('0x25')](_0x6f6d('0x3a'),_0x52fb7f),'order_by':'','offset':'0','select_fields':['id','name',_0x6f6d('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6f6d('0x30')](function(_0x2e5245){if(_0x2e5245[_0x6f6d('0x31')]['length']){var _0x1abb98=_[_0x6f6d('0x3c')](_0x2e5245[_0x6f6d('0x31')],function(_0x2cda7a){return _0x2cda7a[_0x6f6d('0x35')][_0x6f6d('0x3b')]['value']===_0x52fb7f;});if(_0x1abb98){logger[_0x6f6d('0xd')](_0x6f6d('0x3d'));return BPromise[_0x6f6d('0x34')]({'id':_0x1abb98[_0x6f6d('0x35')]['id'][_0x6f6d('0x32')],'name':_0x1abb98[_0x6f6d('0x35')][_0x6f6d('0xf')][_0x6f6d('0x32')],'phone':_0x1abb98[_0x6f6d('0x35')][_0x6f6d('0x3b')]['value']});}}else{logger['info'](_0x6f6d('0x3e'));return request({'form':{'method':_0x6f6d('0x21'),'input_type':'JSON','response_type':_0x6f6d('0x22'),'rest_data':JSON['stringify']({'session':_0x4416ad['id'],'module_name':'Contacts','name_value_list':[{'name':_0x6f6d('0x3f'),'value':_0x5330f9!==_0x6f6d('0x40')?_0x5330f9:util[_0x6f6d('0x25')](_0x6f6d('0x41'),_0x52fb7f)},{'name':_0x6f6d('0x3b'),'value':_0x52fb7f}]})}})[_0x6f6d('0x30')](function(_0x48e2d5){logger['info'](_0x6f6d('0x42'));return BPromise[_0x6f6d('0x34')]({'id':_0x48e2d5['id'],'name':_0x48e2d5[_0x6f6d('0x31')][_0x6f6d('0x3f')][_0x6f6d('0x32')],'phone':_0x48e2d5[_0x6f6d('0x31')][_0x6f6d('0x3b')][_0x6f6d('0x32')]});});}});}function request(_0x36f24d){logger[_0x6f6d('0x43')](_0x6f6d('0x44'),JSON[_0x6f6d('0x23')](_0x36f24d));return rp(_[_0x6f6d('0x45')](def,_0x36f24d));}function getTags(_0x2322fe,_0x5039bd){var _0x1d15b3=[];if(_0x2322fe&&_0x2322fe[_0x6f6d('0x1c')]>0x0){_0x1d15b3=_[_0x6f6d('0x46')](_0x2322fe,_0x5039bd);}return _0x1d15b3;}function getCustomFields(_0xc92f0f,_0x1d085c){var _0x509536=[];var _0x193179={'custom_fields':[]};if(_0xc92f0f[_0x6f6d('0x1c')]>0x0){_[_0x6f6d('0x1d')](_0xc92f0f,function(_0x3f5982){if(_0x3f5982['type']==='string'&&_0x3f5982['nameField']&&!_0x3f5982[_0x6f6d('0x47')]){_0x193179[_0x3f5982[_0x6f6d('0x48')]['toLowerCase']()]=_0x3f5982['content'][_0x6f6d('0x27')]();}else if(_0x3f5982[_0x6f6d('0x49')]===_0x6f6d('0x4a')&&_0x3f5982['idField']&&_0x3f5982[_0x6f6d('0x47')]){_0x193179[_0x6f6d('0x4b')][_0x6f6d('0x1e')]({'id':_0x3f5982[_0x6f6d('0x1f')],'value':_0x3f5982[_0x6f6d('0x4c')]['toString']()});}else if(_0x3f5982[_0x6f6d('0x49')]==='variable'&&_0x3f5982[_0x6f6d('0x20')]&&_0x3f5982[_0x6f6d('0x1f')]&&_0x3f5982[_0x6f6d('0x47')]){_0x1d085c[_0x3f5982[_0x6f6d('0x20')]]&&_0x193179['custom_fields'][_0x6f6d('0x1e')]({'id':_0x3f5982['idField'],'value':_0x1d085c[_0x3f5982[_0x6f6d('0x20')]]['toString']()});}else if(_0x3f5982[_0x6f6d('0x49')]==='customVariable'&&_0x3f5982[_0x6f6d('0x4d')]&&_0x3f5982[_0x6f6d('0x4d')]['name']&&_0x3f5982[_0x6f6d('0x1f')]&&_0x3f5982[_0x6f6d('0x47')]){_0x1d085c[_0x3f5982['Variable'][_0x6f6d('0xf')][_0x6f6d('0x4e')]()]&&_0x193179[_0x6f6d('0x4b')]['push']({'id':_0x3f5982['idField'],'value':_0x1d085c[_0x3f5982['Variable']['name'][_0x6f6d('0x4e')]()][_0x6f6d('0x27')]()});}});}return _0x193179;}function getConnection(_0x3fa88f){return request({'method':_0x6f6d('0x4f'),'form':{'method':_0x6f6d('0x50'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3fa88f[_0x6f6d('0x51')],'password':_0x3fa88f[_0x6f6d('0x52')],'encryption':_0x6f6d('0x53')},'application':_0x6f6d('0x54')})}})['then'](function(_0x253608){var _0x453781=_0x253608;if(_0x453781['id']){def[_0x6f6d('0x55')]=_0x453781['id'];return BPromise['resolve'](_0x453781);}else{throw new Error(util['format'](_0x6f6d('0x56'),_0x3fa88f['id']));}});}function setRelationship(_0x300449,_0xed0125,_0x4f346e,_0x5bf669){return request({'form':{'method':'set_relationship','input_type':_0x6f6d('0x22'),'response_type':'JSON','rest_data':JSON[_0x6f6d('0x23')]({'session':_0x300449['id'],'module_name':'Calls','module_id':_0x4f346e['id'],'link_field_name':_0x5bf669,'related_ids':[_0xed0125['id']]})}});}exports[_0x6f6d('0x57')]=function(_0x30c18e,_0x506e4d,_0x18d0d0,_0x326c57,_0x59babe,_0xc46e33){var _0x21a50c,_0x4a8b27,_0x3c695d,_0x1513a9;_0xc46e33[_0x6f6d('0x58')]=intUtil['stripTrailingSlash'](_0xc46e33[_0x6f6d('0x58')]);_0xc46e33['serverUrl']=intUtil['stripTrailingSlash'](_0xc46e33[_0x6f6d('0x59')]);def['uri']=util['format'](_0x6f6d('0x5a'),_0xc46e33[_0x6f6d('0x58')]);if(_0x59babe&&_0x59babe[_0x6f6d('0x5b')]){logger[_0x6f6d('0xd')](_0x6f6d('0x5c'),_0x6f6d('0x5d'));_0x506e4d['recordingURL']=util['format'](_0x6f6d('0x5e'),_0xc46e33[_0x6f6d('0x59')],_0x506e4d[_0x6f6d('0x5f')],md5(_0x506e4d[_0x6f6d('0x5f')]));}else{_0x506e4d[_0x6f6d('0x60')]='';}return getConnection(_0xc46e33)[_0x6f6d('0x30')](function(_0x4e6b30){_0x1513a9=_0x4e6b30;return getUser(_0xc46e33,_0x326c57[_0x6f6d('0xf')],_0x1513a9);})[_0x6f6d('0x30')](function(_0x1b1922){_0x21a50c=_0x1b1922;logger[_0x6f6d('0xd')]('The\x20User\x20ID\x20is:',_0x21a50c['id']);return getEndUser(_0xc46e33,_0x506e4d[_0x6f6d('0x61')],_0x506e4d['calleridnum'],_0x1513a9);})['then'](function(_0x39f412){_0x4a8b27=_0x39f412;logger[_0x6f6d('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4a8b27['id']);return getTicket(_0xc46e33,_0x21a50c,_0x4a8b27,_0x18d0d0,_0x506e4d,_0x18d0d0[_0x6f6d('0x62')],_0x1513a9,'Inbound');})['then'](function(_0xce1ad2){_0x3c695d=_0xce1ad2;logger[_0x6f6d('0xd')]('Ticket\x20created!');logger['info'](_0x6f6d('0x63'),_0x3c695d['id']);return setRelationship(_0x1513a9,_0x21a50c,_0x3c695d,_0x6f6d('0x64'));})['then'](function(){return setRelationship(_0x1513a9,_0x4a8b27,_0x3c695d,_0x6f6d('0x65'));})['then'](function(){return getServerInfo(_0x1513a9);})[_0x6f6d('0x30')](function(_0xf71132){var _0x59a4bb=parseInt(_0xf71132[_0x6f6d('0x66')][_0x6f6d('0x67')](0x0));var _0x3bf18b=util[_0x6f6d('0x25')](_0x6f6d('0x68'),_0xc46e33[_0x6f6d('0x58')],_0x3c695d['id']);if(_0x59a4bb>0x6){_0x3bf18b=util[_0x6f6d('0x25')](_0x6f6d('0x69'),_0xc46e33['remoteUri'],_0x3c695d['id']);}logger[_0x6f6d('0xd')](_0x6f6d('0x5c'),_0x6f6d('0x6a'));emit(util[_0x6f6d('0x25')](_0x6f6d('0x6b'),_0x326c57[_0x6f6d('0xf')]),_0x6f6d('0x6c'),{'uri':_0x3bf18b});})[_0x6f6d('0x6d')](function(_0x110067){logger['error'](_0x6f6d('0x5c'),JSON[_0x6f6d('0x23')](_0x110067));});};exports[_0x6f6d('0x6e')]=function(_0x39318d,_0x4125ed,_0xb5ad4c,_0x1e09c2,_0x103eb9,_0x2caa70,_0x169e62){var _0x118787,_0xc25716,_0x1e480a,_0x518c3e;_0x2caa70[_0x6f6d('0x58')]=intUtil[_0x6f6d('0x6f')](_0x2caa70[_0x6f6d('0x58')]);_0x2caa70['serverUrl']=intUtil['stripTrailingSlash'](_0x2caa70['serverUrl']);def[_0x6f6d('0x70')]=util[_0x6f6d('0x25')]('%s/service/v4_1/rest.php',_0x2caa70['remoteUri']);if(_0x169e62&&_0x169e62['recordingFormat']&&_0x169e62[_0x6f6d('0x71')]!==_0x6f6d('0x72')){logger[_0x6f6d('0xd')](_0x6f6d('0x73'),_0x6f6d('0x5d'));_0x4125ed['recordingURL']=util[_0x6f6d('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2caa70[_0x6f6d('0x59')],_0x4125ed[_0x6f6d('0x5f')],md5(_0x4125ed[_0x6f6d('0x5f')]));}return getConnection(_0x2caa70)[_0x6f6d('0x30')](function(_0x433114){_0x518c3e=_0x433114;return getUser(_0x2caa70,_0x1e09c2[_0x6f6d('0xf')],_0x518c3e);})['then'](function(_0xd0ae92){_0x118787=_0xd0ae92;logger['info']('The\x20User\x20ID\x20is:',_0x118787['id']);return getEndUser(_0x2caa70,_0x4125ed['destcalleridname'],_0x4125ed['destcalleridnum'],_0x518c3e);})[_0x6f6d('0x30')](function(_0xaee0ed){_0xc25716=_0xaee0ed;logger[_0x6f6d('0xd')](_0x6f6d('0x74'),_0xc25716['id']);return getTicket(_0x2caa70,_0x118787,_0xc25716,_0xb5ad4c,_0x4125ed,_0xb5ad4c[_0x6f6d('0x62')],_0x518c3e,_0x6f6d('0x75'));})[_0x6f6d('0x30')](function(_0x3342f1){_0x1e480a=_0x3342f1;logger[_0x6f6d('0xd')]('Ticket\x20created!');logger[_0x6f6d('0xd')](_0x6f6d('0x63'),_0x1e480a['id']);return setRelationship(_0x518c3e,_0x118787,_0x1e480a,_0x6f6d('0x64'));})[_0x6f6d('0x30')](function(){return setRelationship(_0x518c3e,_0xc25716,_0x1e480a,_0x6f6d('0x65'));})[_0x6f6d('0x30')](function(){return getServerInfo(_0x518c3e);})[_0x6f6d('0x30')](function(_0x9d14b5){var _0x833d80=parseInt(_0x9d14b5[_0x6f6d('0x66')][_0x6f6d('0x67')](0x0));var _0x481b8c=util[_0x6f6d('0x25')](_0x6f6d('0x68'),_0x2caa70[_0x6f6d('0x58')],_0x1e480a['id']);if(_0x833d80>0x6){_0x481b8c=util['format'](_0x6f6d('0x69'),_0x2caa70[_0x6f6d('0x58')],_0x1e480a['id']);}logger['info'](_0x6f6d('0x73'),_0x6f6d('0x6a'));emit(util[_0x6f6d('0x25')](_0x6f6d('0x6b'),_0x1e09c2[_0x6f6d('0xf')]),_0x6f6d('0x6c'),{'uri':_0x481b8c});})[_0x6f6d('0x6d')](function(_0x1b48d9){logger[_0x6f6d('0x76')]('[OUTBOUND]',JSON[_0x6f6d('0x23')](_0x1b48d9));});};exports[_0x6f6d('0x77')]=function(_0xdb0cd4,_0x341e7e,_0x1eb1d1,_0x315ec6,_0x36af57,_0x3c6b05){var _0xba119d,_0x53fa6c,_0x458b07,_0x54f0f0;_0x3c6b05[_0x6f6d('0x58')]=intUtil[_0x6f6d('0x6f')](_0x3c6b05[_0x6f6d('0x58')]);_0x3c6b05[_0x6f6d('0x59')]=intUtil[_0x6f6d('0x6f')](_0x3c6b05[_0x6f6d('0x59')]);def[_0x6f6d('0x70')]=util['format'](_0x6f6d('0x5a'),_0x3c6b05['remoteUri']);if(_0x36af57&&_0x36af57[_0x6f6d('0x5b')]){logger['info'](_0x6f6d('0x78'),_0x6f6d('0x5d'));_0x341e7e['recordingURL']=util[_0x6f6d('0x25')](_0x6f6d('0x5e'),_0x3c6b05[_0x6f6d('0x59')],_0x341e7e['uniqueid'],md5(_0x341e7e[_0x6f6d('0x5f')]));}else{_0x341e7e[_0x6f6d('0x60')]='';}return getConnection(_0x3c6b05)['then'](function(_0x5f4658){_0x54f0f0=_0x5f4658;if(!_['isNil'](_0x315ec6)){return getUser(_0x3c6b05,_0x315ec6[_0x6f6d('0xf')],_0x54f0f0);}else{return getUser(_0x3c6b05,null,_0x54f0f0);}})[_0x6f6d('0x30')](function(_0x6d036e){_0xba119d=_0x6d036e;logger['info']('The\x20User\x20ID\x20is:',_0xba119d['id']);return getEndUser(_0x3c6b05,_0x341e7e[_0x6f6d('0x61')],_0x341e7e[_0x6f6d('0x79')],_0x54f0f0);})[_0x6f6d('0x30')](function(_0x4adf4c){_0x53fa6c=_0x4adf4c;logger[_0x6f6d('0xd')](_0x6f6d('0x74'),_0x53fa6c['id']);return getTicket(_0x3c6b05,_0xba119d,_0x53fa6c,_0x1eb1d1,_0x341e7e,_0x1eb1d1[_0x6f6d('0x62')],_0x54f0f0,_0x6f6d('0x7a'));})['then'](function(_0x288b4e){_0x458b07=_0x288b4e;logger[_0x6f6d('0xd')](_0x6f6d('0x7b'));logger[_0x6f6d('0xd')](_0x6f6d('0x63'),_0x458b07['id']);return setRelationship(_0x54f0f0,_0xba119d,_0x458b07,_0x6f6d('0x64'));})[_0x6f6d('0x30')](function(){return setRelationship(_0x54f0f0,_0x53fa6c,_0x458b07,'contacts');})['then'](function(){return getServerInfo(_0x54f0f0);})[_0x6f6d('0x6d')](function(_0x240118){logger[_0x6f6d('0x76')](_0x6f6d('0x78'),JSON[_0x6f6d('0x23')](_0x240118));});}; \ No newline at end of file +var _0x5194=['duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','customField','custom_fields','idField','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','catch','abandoned','[ABANDONED]','request-promise','util','./util','../../../../config/environment','redis','defaults','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','slice'];(function(_0x535c32,_0x1474c8){var _0x478b3b=function(_0x436ba2){while(--_0x436ba2){_0x535c32['push'](_0x535c32['shift']());}};_0x478b3b(++_0x1474c8);}(_0x5194,0xd5));var _0x4519=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5194[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var rp=require(_0x4519('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x4519('0x1'));var Redis=require('ioredis');var intUtil=require(_0x4519('0x2'));var config=require(_0x4519('0x3'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x4519('0x4')]=_[_0x4519('0x5')](config[_0x4519('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4519('0x4')]));var def={'method':_0x4519('0x6'),'json':!![]};function emit(_0x35f7b7,_0x42a70e,_0x1b4a06){io['to'](_0x35f7b7)[_0x4519('0x7')](_0x42a70e,_0x1b4a06);}function getTicket(_0x1dc914,_0x2f19d7,_0x46d023,_0x839b2d,_0x997d93,_0x2e77dd,_0x4c325f,_0xf79cd5){logger[_0x4519('0x8')](_0x4519('0x9'));var _0x27131d=new Date();var _0x37defe=[{'name':'name','value':intUtil[_0x4519('0xa')](_0x839b2d[_0x4519('0xb')],_0x997d93,'\x20')},{'name':_0x4519('0xc'),'value':_0x2f19d7['id']},{'name':'created_by','value':_0x2f19d7['id']},{'name':_0x4519('0xd'),'value':intUtil[_0x4519('0xa')](_0x839b2d[_0x4519('0xe')],_0x997d93,'\x0a')},{'name':'date_start','value':_0x27131d[_0x4519('0xf')]()[_0x4519('0x10')](0x0,0x13)['replace']('T','\x20')},{'name':_0x4519('0x11'),'value':'0'},{'name':_0x4519('0x12'),'value':'15'},{'name':_0x4519('0x13'),'value':_0x46d023['id']},{'name':_0x4519('0x14'),'value':_0x4519('0x15')},{'name':_0x4519('0x16'),'value':_0x46d023[_0x4519('0x17')]},{'name':_0x4519('0x18'),'value':_0xf79cd5}];if(_0x2e77dd[_0x4519('0x19')]){_[_0x4519('0x1a')](_0x2e77dd,function(_0x49aa30){if(_0x997d93[_0x49aa30[_0x4519('0x1b')]]){_0x37defe[_0x4519('0x1c')]({'name':_0x49aa30['idField'],'value':_0x997d93[_0x49aa30[_0x4519('0x1b')]]});}});}return request({'form':{'method':_0x4519('0x1d'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x4c325f['id'],'module_name':_0x4519('0x20'),'name_value_list':_0x37defe})}});}function getAuth(_0x2e7ce6){return util[_0x4519('0x21')]('Basic\x20%s',new Buffer(_0x2e7ce6[_0x4519('0x22')]+':X')[_0x4519('0x23')](_0x4519('0x24')));}function getServerInfo(_0x4dc6ca){return request({'form':{'method':_0x4519('0x25'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x4dc6ca['id']})}});}function getUser(_0x21e480,_0x373ff5,_0x1f7db3){if(!_[_0x4519('0x26')](_0x373ff5)){logger['info'](_0x4519('0x27'),_0x373ff5);return request({'form':{'method':_0x4519('0x28'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x1f7db3['id'],'module_name':'Employees','query':util['format'](_0x4519('0x29'),_0x373ff5),'order_by':'','offset':'0','select_fields':['id',_0x4519('0x17'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4519('0x2a')](function(_0xf5af91){if(_0xf5af91[_0x4519('0x2b')][_0x4519('0x19')]){var _0x54f1d6=_[_0x4519('0x2c')](_0xf5af91[_0x4519('0x2b')],function(_0x1bc619){return _0x1bc619[_0x4519('0x2d')][_0x4519('0x2e')]['value']===_0x373ff5;});if(_0x54f1d6){logger[_0x4519('0x8')](_0x4519('0x2f'));return BPromise[_0x4519('0x30')]({'id':_0x54f1d6[_0x4519('0x2d')]['id']['value'],'name':_0x54f1d6[_0x4519('0x2d')][_0x4519('0x17')]['value']});}}logger[_0x4519('0x8')](_0x4519('0x31'));return BPromise[_0x4519('0x30')]({'id':_0x1f7db3[_0x4519('0x2d')][_0x4519('0x32')]['value'],'name':_0x1f7db3['name_value_list'][_0x4519('0x2e')][_0x4519('0x33')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4519('0x30')]({'id':_0x1f7db3[_0x4519('0x2d')][_0x4519('0x32')][_0x4519('0x33')],'name':_0x1f7db3[_0x4519('0x2d')]['user_name'][_0x4519('0x33')]});}}function getEndUser(_0x27536d,_0x28ce2f,_0x59dc63,_0x5994ea){logger['info'](_0x4519('0x34'),_0x59dc63);return request({'form':{'method':_0x4519('0x28'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x5994ea['id'],'module_name':_0x4519('0x15'),'query':util[_0x4519('0x21')](_0x4519('0x35'),_0x59dc63),'order_by':'','offset':'0','select_fields':['id','name',_0x4519('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4519('0x2a')](function(_0x51caa3){if(_0x51caa3[_0x4519('0x2b')]['length']){var _0x4e5c54=_[_0x4519('0x2c')](_0x51caa3['entry_list'],function(_0x9d52b8){return _0x9d52b8[_0x4519('0x2d')][_0x4519('0x36')][_0x4519('0x33')]===_0x59dc63;});if(_0x4e5c54){logger[_0x4519('0x8')](_0x4519('0x37'));return BPromise[_0x4519('0x30')]({'id':_0x4e5c54[_0x4519('0x2d')]['id']['value'],'name':_0x4e5c54[_0x4519('0x2d')][_0x4519('0x17')][_0x4519('0x33')],'phone':_0x4e5c54[_0x4519('0x2d')][_0x4519('0x36')][_0x4519('0x33')]});}}else{logger['info'](_0x4519('0x38'));return request({'form':{'method':_0x4519('0x1d'),'input_type':_0x4519('0x1e'),'response_type':_0x4519('0x1e'),'rest_data':JSON[_0x4519('0x1f')]({'session':_0x5994ea['id'],'module_name':_0x4519('0x15'),'name_value_list':[{'name':_0x4519('0x39'),'value':_0x28ce2f!==_0x4519('0x3a')?_0x28ce2f:util['format'](_0x4519('0x3b'),_0x59dc63)},{'name':_0x4519('0x36'),'value':_0x59dc63}]})}})[_0x4519('0x2a')](function(_0x11d34e){logger[_0x4519('0x8')]('Enduser\x20created.');return BPromise[_0x4519('0x30')]({'id':_0x11d34e['id'],'name':_0x11d34e['entry_list'][_0x4519('0x39')][_0x4519('0x33')],'phone':_0x11d34e[_0x4519('0x2b')]['phone_home']['value']});});}});}function request(_0x1baae9){logger[_0x4519('0x3c')](_0x4519('0x3d'),JSON[_0x4519('0x1f')](_0x1baae9));return rp(_[_0x4519('0x3e')](def,_0x1baae9));}function getTags(_0x549098,_0x4e7a89){var _0x58fce2=[];if(_0x549098&&_0x549098[_0x4519('0x19')]>0x0){_0x58fce2=_[_0x4519('0x3f')](_0x549098,_0x4e7a89);}return _0x58fce2;}function getCustomFields(_0xb9ebd0,_0x344b9c){var _0x2fc769=[];var _0x25fc55={'custom_fields':[]};if(_0xb9ebd0[_0x4519('0x19')]>0x0){_['forEach'](_0xb9ebd0,function(_0x12459d){if(_0x12459d[_0x4519('0x40')]===_0x4519('0x41')&&_0x12459d['nameField']&&!_0x12459d['customField']){_0x25fc55[_0x12459d[_0x4519('0x42')][_0x4519('0x43')]()]=_0x12459d[_0x4519('0x44')][_0x4519('0x23')]();}else if(_0x12459d[_0x4519('0x40')]===_0x4519('0x41')&&_0x12459d['idField']&&_0x12459d[_0x4519('0x45')]){_0x25fc55[_0x4519('0x46')][_0x4519('0x1c')]({'id':_0x12459d[_0x4519('0x47')],'value':_0x12459d[_0x4519('0x44')]['toString']()});}else if(_0x12459d[_0x4519('0x40')]==='variable'&&_0x12459d[_0x4519('0x1b')]&&_0x12459d[_0x4519('0x47')]&&_0x12459d[_0x4519('0x45')]){_0x344b9c[_0x12459d[_0x4519('0x1b')]]&&_0x25fc55[_0x4519('0x46')]['push']({'id':_0x12459d['idField'],'value':_0x344b9c[_0x12459d[_0x4519('0x1b')]][_0x4519('0x23')]()});}else if(_0x12459d[_0x4519('0x40')]==='customVariable'&&_0x12459d['Variable']&&_0x12459d[_0x4519('0x48')][_0x4519('0x17')]&&_0x12459d[_0x4519('0x47')]&&_0x12459d[_0x4519('0x45')]){_0x344b9c[_0x12459d[_0x4519('0x48')][_0x4519('0x17')][_0x4519('0x43')]()]&&_0x25fc55['custom_fields'][_0x4519('0x1c')]({'id':_0x12459d[_0x4519('0x47')],'value':_0x344b9c[_0x12459d[_0x4519('0x48')][_0x4519('0x17')][_0x4519('0x43')]()][_0x4519('0x23')]()});}});}return _0x25fc55;}function getConnection(_0x58ee0c){return request({'method':_0x4519('0x6'),'form':{'method':_0x4519('0x49'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'user_auth':{'user_name':_0x58ee0c['username'],'password':_0x58ee0c['password'],'encryption':_0x4519('0x4a')},'application':_0x4519('0x4b')})}})['then'](function(_0x466910){var _0x2df287=_0x466910;if(_0x2df287['id']){def[_0x4519('0x4c')]=_0x2df287['id'];return BPromise[_0x4519('0x30')](_0x2df287);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x58ee0c['id']));}});}function setRelationship(_0x12529e,_0x416da5,_0x412dcc,_0x945a45){return request({'form':{'method':_0x4519('0x4d'),'input_type':_0x4519('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4519('0x1f')]({'session':_0x12529e['id'],'module_name':_0x4519('0x20'),'module_id':_0x412dcc['id'],'link_field_name':_0x945a45,'related_ids':[_0x416da5['id']]})}});}exports[_0x4519('0x4e')]=function(_0x4155ce,_0x110d1b,_0x1c8d1c,_0x59ce84,_0x28723f,_0x212473){var _0x35f61b,_0x3e919f,_0x579f6c,_0xfeaf0b;_0x212473[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0x212473[_0x4519('0x4f')]);_0x212473[_0x4519('0x51')]=intUtil['stripTrailingSlash'](_0x212473[_0x4519('0x51')]);def['uri']=util[_0x4519('0x21')]('%s/service/v4_1/rest.php',_0x212473[_0x4519('0x4f')]);if(_0x28723f&&_0x28723f[_0x4519('0x52')]){logger[_0x4519('0x8')]('[QUEUE]',_0x4519('0x53'));_0x110d1b[_0x4519('0x54')]=util[_0x4519('0x21')](_0x4519('0x55'),_0x212473[_0x4519('0x51')],_0x110d1b['uniqueid'],md5(_0x110d1b[_0x4519('0x56')]));}else{_0x110d1b[_0x4519('0x54')]='';}return getConnection(_0x212473)[_0x4519('0x2a')](function(_0x3af0bd){_0xfeaf0b=_0x3af0bd;return getUser(_0x212473,_0x59ce84[_0x4519('0x17')],_0xfeaf0b);})[_0x4519('0x2a')](function(_0x596200){_0x35f61b=_0x596200;logger[_0x4519('0x8')](_0x4519('0x57'),_0x35f61b['id']);return getEndUser(_0x212473,_0x110d1b[_0x4519('0x58')],_0x110d1b[_0x4519('0x59')],_0xfeaf0b);})[_0x4519('0x2a')](function(_0x495fcb){_0x3e919f=_0x495fcb;logger[_0x4519('0x8')]('The\x20Enduser\x20ID\x20is:',_0x3e919f['id']);return getTicket(_0x212473,_0x35f61b,_0x3e919f,_0x1c8d1c,_0x110d1b,_0x1c8d1c['Fields'],_0xfeaf0b,_0x4519('0x5a'));})[_0x4519('0x2a')](function(_0x5ea3ae){_0x579f6c=_0x5ea3ae;logger['info'](_0x4519('0x5b'));logger[_0x4519('0x8')](_0x4519('0x5c'),_0x579f6c['id']);return setRelationship(_0xfeaf0b,_0x35f61b,_0x579f6c,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0xfeaf0b,_0x3e919f,_0x579f6c,'contacts');})[_0x4519('0x2a')](function(){return getServerInfo(_0xfeaf0b);})[_0x4519('0x2a')](function(_0x429142){var _0x50f28d=parseInt(_0x429142[_0x4519('0x5e')][_0x4519('0x5f')](0x0));var _0x22134b=util['format'](_0x4519('0x60'),_0x212473['remoteUri'],_0x579f6c['id']);if(_0x50f28d>0x6){_0x22134b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x212473['remoteUri'],_0x579f6c['id']);}logger['info'](_0x4519('0x61'),_0x4519('0x62'));emit(util[_0x4519('0x21')](_0x4519('0x63'),_0x59ce84[_0x4519('0x17')]),_0x4519('0x64'),{'uri':_0x22134b});})['catch'](function(_0x1cb492){logger[_0x4519('0x65')](_0x4519('0x61'),JSON[_0x4519('0x1f')](_0x1cb492));});};exports['outbound']=function(_0x333796,_0x488351,_0x2e272c,_0x18a048,_0x1327c3,_0xb24e5a,_0x1acb3b){var _0x1f8cb0,_0x5e9ab6,_0x6ce677,_0x3fc9f6;_0xb24e5a[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0xb24e5a[_0x4519('0x4f')]);_0xb24e5a['serverUrl']=intUtil[_0x4519('0x50')](_0xb24e5a[_0x4519('0x51')]);def[_0x4519('0x66')]=util[_0x4519('0x21')](_0x4519('0x67'),_0xb24e5a[_0x4519('0x4f')]);if(_0x1acb3b&&_0x1acb3b[_0x4519('0x68')]&&_0x1acb3b[_0x4519('0x68')]!=='none'){logger['info'](_0x4519('0x69'),'Recording\x20is\x20enabled!');_0x488351[_0x4519('0x54')]=util[_0x4519('0x21')](_0x4519('0x55'),_0xb24e5a['serverUrl'],_0x488351[_0x4519('0x56')],md5(_0x488351[_0x4519('0x56')]));}return getConnection(_0xb24e5a)[_0x4519('0x2a')](function(_0x136fc5){_0x3fc9f6=_0x136fc5;return getUser(_0xb24e5a,_0x18a048[_0x4519('0x17')],_0x3fc9f6);})[_0x4519('0x2a')](function(_0x40452a){_0x1f8cb0=_0x40452a;logger[_0x4519('0x8')]('The\x20User\x20ID\x20is:',_0x1f8cb0['id']);return getEndUser(_0xb24e5a,_0x488351['destcalleridname'],_0x488351[_0x4519('0x6a')],_0x3fc9f6);})['then'](function(_0x2822c0){_0x5e9ab6=_0x2822c0;logger[_0x4519('0x8')](_0x4519('0x6b'),_0x5e9ab6['id']);return getTicket(_0xb24e5a,_0x1f8cb0,_0x5e9ab6,_0x2e272c,_0x488351,_0x2e272c[_0x4519('0x6c')],_0x3fc9f6,_0x4519('0x6d'));})[_0x4519('0x2a')](function(_0x1a596b){_0x6ce677=_0x1a596b;logger[_0x4519('0x8')](_0x4519('0x5b'));logger['info'](_0x4519('0x5c'),_0x6ce677['id']);return setRelationship(_0x3fc9f6,_0x1f8cb0,_0x6ce677,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0x3fc9f6,_0x5e9ab6,_0x6ce677,_0x4519('0x6e'));})[_0x4519('0x2a')](function(){return getServerInfo(_0x3fc9f6);})[_0x4519('0x2a')](function(_0x11c119){var _0x3dfe0c=parseInt(_0x11c119[_0x4519('0x5e')]['charAt'](0x0));var _0x22c0d8=util[_0x4519('0x21')](_0x4519('0x60'),_0xb24e5a[_0x4519('0x4f')],_0x6ce677['id']);if(_0x3dfe0c>0x6){_0x22c0d8=util['format'](_0x4519('0x6f'),_0xb24e5a['remoteUri'],_0x6ce677['id']);}logger['info'](_0x4519('0x69'),_0x4519('0x62'));emit(util['format'](_0x4519('0x63'),_0x18a048[_0x4519('0x17')]),_0x4519('0x64'),{'uri':_0x22c0d8});})[_0x4519('0x70')](function(_0x36dc6b){logger[_0x4519('0x65')](_0x4519('0x69'),JSON[_0x4519('0x1f')](_0x36dc6b));});};exports[_0x4519('0x71')]=function(_0x3a745b,_0x5322bb,_0x4c1e01,_0x45efbf,_0x112668,_0x2eb1df){var _0x46fe57,_0x4c2628,_0x255dcb,_0x473c0c;_0x2eb1df[_0x4519('0x4f')]=intUtil[_0x4519('0x50')](_0x2eb1df[_0x4519('0x4f')]);_0x2eb1df['serverUrl']=intUtil[_0x4519('0x50')](_0x2eb1df['serverUrl']);def[_0x4519('0x66')]=util[_0x4519('0x21')]('%s/service/v4_1/rest.php',_0x2eb1df[_0x4519('0x4f')]);if(_0x112668&&_0x112668[_0x4519('0x52')]){logger[_0x4519('0x8')](_0x4519('0x72'),'Recording\x20is\x20enabled!');_0x5322bb[_0x4519('0x54')]=util[_0x4519('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2eb1df[_0x4519('0x51')],_0x5322bb[_0x4519('0x56')],md5(_0x5322bb[_0x4519('0x56')]));}else{_0x5322bb[_0x4519('0x54')]='';}return getConnection(_0x2eb1df)['then'](function(_0x52d26){_0x473c0c=_0x52d26;if(!_[_0x4519('0x26')](_0x45efbf)){return getUser(_0x2eb1df,_0x45efbf[_0x4519('0x17')],_0x473c0c);}else{return getUser(_0x2eb1df,null,_0x473c0c);}})[_0x4519('0x2a')](function(_0x59fb81){_0x46fe57=_0x59fb81;logger[_0x4519('0x8')](_0x4519('0x57'),_0x46fe57['id']);return getEndUser(_0x2eb1df,_0x5322bb[_0x4519('0x58')],_0x5322bb[_0x4519('0x59')],_0x473c0c);})[_0x4519('0x2a')](function(_0x431868){_0x4c2628=_0x431868;logger[_0x4519('0x8')](_0x4519('0x6b'),_0x4c2628['id']);return getTicket(_0x2eb1df,_0x46fe57,_0x4c2628,_0x4c1e01,_0x5322bb,_0x4c1e01[_0x4519('0x6c')],_0x473c0c,_0x4519('0x5a'));})['then'](function(_0x3a7a22){_0x255dcb=_0x3a7a22;logger[_0x4519('0x8')](_0x4519('0x5b'));logger[_0x4519('0x8')](_0x4519('0x5c'),_0x255dcb['id']);return setRelationship(_0x473c0c,_0x46fe57,_0x255dcb,_0x4519('0x5d'));})[_0x4519('0x2a')](function(){return setRelationship(_0x473c0c,_0x4c2628,_0x255dcb,_0x4519('0x6e'));})[_0x4519('0x2a')](function(){return getServerInfo(_0x473c0c);})[_0x4519('0x70')](function(_0x218da){logger['error'](_0x4519('0x72'),JSON[_0x4519('0x1f')](_0x218da));});}; \ 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 abb096f..03639a7 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 _0xa4d5=['keyValue','key','%s:\x20%s','keyType','format','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','type','variable','variableName','push','customVariable','name','Variable','toLowerCase','toString'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xa4d5,0xc9));var _0x5a4d=function(_0x1ee96e,_0x531a4b){_0x1ee96e=_0x1ee96e-0x0;var _0x3f378a=_0xa4d5[_0x1ee96e];return _0x3f378a;};'use strict';var _=require(_0x5a4d('0x0'));var util=require(_0x5a4d('0x1'));exports[_0x5a4d('0x2')]=function(_0x4b9c33,_0x3d41d8,_0x1d8665){var _0x30239e=[];if(_0x4b9c33[_0x5a4d('0x3')]>0x0){var _0x4db121=_[_0x5a4d('0x4')](_0x4b9c33,['id']);for(var _0xd95bcd=0x0;_0xd95bcd<_0x4db121[_0x5a4d('0x3')];_0xd95bcd++){var _0x26e726=_0x4db121[_0xd95bcd];if(_0x26e726['type']===_0x5a4d('0x5')){_0x30239e['push'](_0x26e726['content']);}else if(_0x26e726[_0x5a4d('0x6')]===_0x5a4d('0x7')&&_0x26e726[_0x5a4d('0x8')]){_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]&&_0x30239e[_0x5a4d('0x9')](_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]['toString']());}else if(_0x26e726[_0x5a4d('0x6')]===_0x5a4d('0xa')&&_0x26e726['Variable']&&_0x26e726['Variable'][_0x5a4d('0xb')]){_0x3d41d8[_0x26e726[_0x5a4d('0xc')]['name'][_0x5a4d('0xd')]()]&&_0x30239e[_0x5a4d('0x9')](_0x3d41d8[_0x26e726['Variable'][_0x5a4d('0xb')][_0x5a4d('0xd')]()][_0x5a4d('0xe')]());}else if(_0x26e726['type']===_0x5a4d('0xf')){if(_0x26e726['keyType']===_0x5a4d('0x5')&&_0x26e726[_0x5a4d('0x10')]){_0x30239e[_0x5a4d('0x9')](util['format'](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x26e726['keyContent']));}else if(_0x26e726['keyType']===_0x5a4d('0x7')&&_0x26e726['variableName']&&_0x26e726[_0x5a4d('0x10')]){_0x3d41d8[_0x26e726['variableName']]&&_0x30239e[_0x5a4d('0x9')](util['format'](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]));}else if(_0x26e726[_0x5a4d('0x12')]===_0x5a4d('0xa')&&_0x26e726[_0x5a4d('0xc')]&&_0x26e726[_0x5a4d('0xc')][_0x5a4d('0xb')]&&_0x26e726[_0x5a4d('0x10')]){_0x3d41d8[_0x26e726['Variable'][_0x5a4d('0xb')][_0x5a4d('0xd')]()]&&_0x30239e['push'](util[_0x5a4d('0x13')](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x3d41d8[_0x26e726[_0x5a4d('0xc')][_0x5a4d('0xb')]['toLowerCase']()]));}}}}return _0x30239e[_0x5a4d('0x14')](_0x1d8665);};exports['stripTrailingSlash']=function(_0x41d964){var _0x58b20c=_0x41d964[_0x5a4d('0x15')](-0x1);if(_0x58b20c==='/'){_0x41d964=_0x41d964[_0x5a4d('0x16')](0x0,_0x41d964[_0x5a4d('0x17')](_0x58b20c));}return _0x41d964;};exports[_0x5a4d('0x18')]=function(_0x4235cb){if(!_[_0x5a4d('0x19')](_0x4235cb)&&_0x4235cb!==''){var _0x4722ee=/^(([^<>()\[\]\\.,;:\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 _0x4722ee[_0x5a4d('0x1a')](String(_0x4235cb)[_0x5a4d('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xf6f3=['validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','format','%s:\x20%s','keyContent','key','join','stripTrailingSlash','slice','lastIndexOf'];(function(_0x9d8e04,_0x5b81de){var _0x32042f=function(_0x5de028){while(--_0x5de028){_0x9d8e04['push'](_0x9d8e04['shift']());}};_0x32042f(++_0x5b81de);}(_0xf6f3,0x77));var _0x3f6f=function(_0x33bccf,_0x24a5f8){_0x33bccf=_0x33bccf-0x0;var _0x1a62c1=_0xf6f3[_0x33bccf];return _0x1a62c1;};'use strict';var _=require(_0x3f6f('0x0'));var util=require(_0x3f6f('0x1'));exports[_0x3f6f('0x2')]=function(_0x4405af,_0x5c901c,_0x1300b4){var _0x4cb7c7=[];if(_0x4405af[_0x3f6f('0x3')]>0x0){var _0x30700e=_[_0x3f6f('0x4')](_0x4405af,['id']);for(var _0x19714b=0x0;_0x19714b<_0x30700e[_0x3f6f('0x3')];_0x19714b++){var _0x5f21b4=_0x30700e[_0x19714b];if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x6')){_0x4cb7c7[_0x3f6f('0x7')](_0x5f21b4[_0x3f6f('0x8')]);}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x9')&&_0x5f21b4[_0x3f6f('0xa')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]&&_0x4cb7c7[_0x3f6f('0x7')](_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]['toString']());}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0xb')&&_0x5f21b4[_0x3f6f('0xc')]&&_0x5f21b4['Variable'][_0x3f6f('0xd')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xc')][_0x3f6f('0xd')][_0x3f6f('0xe')]()]&&_0x4cb7c7[_0x3f6f('0x7')](_0x5c901c[_0x5f21b4[_0x3f6f('0xc')]['name'][_0x3f6f('0xe')]()][_0x3f6f('0xf')]());}else if(_0x5f21b4[_0x3f6f('0x5')]===_0x3f6f('0x10')){if(_0x5f21b4[_0x3f6f('0x11')]===_0x3f6f('0x6')&&_0x5f21b4['key']){_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4['key'],_0x5f21b4[_0x3f6f('0x14')]));}else if(_0x5f21b4['keyType']===_0x3f6f('0x9')&&_0x5f21b4[_0x3f6f('0xa')]&&_0x5f21b4[_0x3f6f('0x15')]){_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]&&_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4[_0x3f6f('0x15')],_0x5c901c[_0x5f21b4[_0x3f6f('0xa')]]));}else if(_0x5f21b4[_0x3f6f('0x11')]==='customVariable'&&_0x5f21b4['Variable']&&_0x5f21b4['Variable']['name']&&_0x5f21b4['key']){_0x5c901c[_0x5f21b4['Variable'][_0x3f6f('0xd')][_0x3f6f('0xe')]()]&&_0x4cb7c7[_0x3f6f('0x7')](util[_0x3f6f('0x12')](_0x3f6f('0x13'),_0x5f21b4['key'],_0x5c901c[_0x5f21b4['Variable']['name'][_0x3f6f('0xe')]()]));}}}}return _0x4cb7c7[_0x3f6f('0x16')](_0x1300b4);};exports[_0x3f6f('0x17')]=function(_0x5ca3a7){var _0x356dd3=_0x5ca3a7[_0x3f6f('0x18')](-0x1);if(_0x356dd3==='/'){_0x5ca3a7=_0x5ca3a7['substring'](0x0,_0x5ca3a7[_0x3f6f('0x19')](_0x356dd3));}return _0x5ca3a7;};exports[_0x3f6f('0x1a')]=function(_0x3d74f5){if(!_[_0x3f6f('0x1b')](_0x3d74f5)&&_0x3d74f5!==''){var _0x366346=/^(([^<>()\[\]\\.,;:\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 _0x366346[_0x3f6f('0x1c')](String(_0x3d74f5)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 82f7f11..9a85ee4 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 _0xe9ad=['queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','trigger:browser:url','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','Open','getString','Descriptions','POST','format','%s/webservice.php','remoteUri','create','admin','sessionName','HelpDesk','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','createTicket','info','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','userId','catch','[vTiger],\x20%s,\x20%s,\x20%s','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','getConnection'];(function(_0x10cb39,_0x4f2f75){var _0x8699a5=function(_0x4f5bb3){while(--_0x4f5bb3){_0x10cb39['push'](_0x10cb39['shift']());}};_0x8699a5(++_0x4f2f75);}(_0xe9ad,0x82));var _0xde9a=function(_0x4b6bee,_0x23f984){_0x4b6bee=_0x4b6bee-0x0;var _0x167259=_0xe9ad[_0x4b6bee];return _0x167259;};'use strict';var _=require(_0xde9a('0x0'));var rp=require(_0xde9a('0x1'));var BPromise=require(_0xde9a('0x2'));var md5=require(_0xde9a('0x3'));var util=require(_0xde9a('0x4'));var Redis=require(_0xde9a('0x5'));var intUtil=require(_0xde9a('0x6'));var config=require('../../../../config/environment');var logger=require(_0xde9a('0x7'))(_0xde9a('0x8'));config[_0xde9a('0x9')]=_[_0xde9a('0xa')](config['redis'],{'host':_0xde9a('0xb'),'port':0x18eb});var io=require(_0xde9a('0xc'))(new Redis(config[_0xde9a('0x9')]));function emit(_0x5d4412,_0x45d4a7,_0x17f89b){io['to'](_0x5d4412)[_0xde9a('0xd')](_0x45d4a7,_0x17f89b);}function getCustomFields(_0x1fac02,_0x297975){var _0x34cd1a={};if(_0x1fac02[_0xde9a('0xe')]>0x0){_[_0xde9a('0xf')](_0x1fac02,function(_0x2fe8b2){if(_0x2fe8b2['type']===_0xde9a('0x10')&&_0x2fe8b2[_0xde9a('0x11')]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x2fe8b2[_0xde9a('0x12')][_0xde9a('0x13')]();}else if(_0x2fe8b2[_0xde9a('0x14')]===_0xde9a('0x15')&&_0x2fe8b2[_0xde9a('0x16')]&&_0x2fe8b2[_0xde9a('0x11')]&&_0x297975[_0x2fe8b2['variableName']]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x297975[_0x2fe8b2[_0xde9a('0x16')]][_0xde9a('0x13')]();}else if(_0x2fe8b2[_0xde9a('0x14')]===_0xde9a('0x17')&&_0x2fe8b2[_0xde9a('0x18')]&&_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')]&&_0x2fe8b2[_0xde9a('0x11')]&&_0x297975[_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')][_0xde9a('0x1a')]()]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x297975[_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')][_0xde9a('0x1a')]()]['toString']();}});}return _0x34cd1a;}function createTicket(_0x12ba7f,_0x2714a9,_0x3b89ef,_0x57613b,_0x2e96ee,_0x52e5ea,_0x8f481a){logger['info'](_0xde9a('0x1b'));var _0x5b2a41=_[_0xde9a('0x1c')]({'parent_id':'','assigned_user_id':_0x2714a9['id'],'ticketpriorities':'Normal','ticketstatus':_0xde9a('0x1d'),'ticket_title':intUtil[_0xde9a('0x1e')](_0x57613b['Subjects'],_0x2e96ee,'\x20'),'description':intUtil['getString'](_0x57613b[_0xde9a('0x1f')],_0x2e96ee,'\x0a'),'contact_id':_0x3b89ef['id']},getCustomFields(_0x52e5ea,_0x2e96ee));var _0x416b36={'method':_0xde9a('0x20'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x12ba7f[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x24'),'username':_0xde9a('0x25'),'sessionName':_0x8f481a[_0xde9a('0x26')],'elementType':_0xde9a('0x27'),'element':JSON[_0xde9a('0x28')](_0x5b2a41)},'json':!![]};return request(_0x416b36)[_0xde9a('0x29')](function(_0x2fa60c){if(_0x2fa60c[_0xde9a('0x2a')]){return BPromise[_0xde9a('0x2b')]({'id':_0x2fa60c[_0xde9a('0x2c')]['id']});}else{throw new Error(util[_0xde9a('0x21')](_0xde9a('0x2d'),JSON[_0xde9a('0x28')](_0x2fa60c['error'])));}})['catch'](function(_0x1ee39e){var _0x42ba56=_0x1ee39e[_0xde9a('0x2e')]||0x1f4;logger[_0xde9a('0x2f')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xde9a('0x30'),_0x42ba56,JSON[_0xde9a('0x28')](_0x1ee39e));});}function getUser(_0x467ce2,_0x51806d,_0x3bd254){if(intUtil['validateEmail'](_0x51806d)){logger[_0xde9a('0x31')]('Getting\x20agent\x20with\x20email',_0x51806d);return request({'method':_0xde9a('0x32'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x467ce2[_0xde9a('0x23')]),'qs':{'operation':_0xde9a('0x33'),'username':_0xde9a('0x25'),'sessionName':_0x3bd254[_0xde9a('0x26')],'query':util['format'](_0xde9a('0x34'),_0x51806d)},'json':!![]})[_0xde9a('0x29')](function(_0x25d7f1){if(_0x25d7f1[_0xde9a('0x2a')]&&_0x25d7f1[_0xde9a('0x2c')][_0xde9a('0xe')]){logger[_0xde9a('0x31')](_0xde9a('0x35'));return BPromise[_0xde9a('0x2b')]({'id':_0x25d7f1[_0xde9a('0x2c')][0x0]['id'],'email':_0x25d7f1[_0xde9a('0x2c')][0x0][_0xde9a('0x36')],'name':_0x25d7f1[_0xde9a('0x2c')][0x0][_0xde9a('0x37')]+'\x20'+_0x25d7f1['result']['last_name']});}else{logger[_0xde9a('0x31')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xde9a('0x2b')]({'id':_0x3bd254[_0xde9a('0x38')],'email':_0x467ce2['username'],'name':_0xde9a('0x25')});}})[_0xde9a('0x39')](function(_0x29579e){var _0x4d45a2=_0x29579e['statusCode']||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),'getUser',_0x4d45a2,JSON[_0xde9a('0x28')](_0x29579e));});}else{logger[_0xde9a('0x31')](_0xde9a('0x3b'));return BPromise[_0xde9a('0x2b')]({'id':_0x3bd254[_0xde9a('0x38')],'email':_0x467ce2[_0xde9a('0x3c')],'name':_0xde9a('0x25')})[_0xde9a('0x39')](function(_0x32c6f0){var _0x463dc5=_0x32c6f0['statusCode']||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),_0xde9a('0x3d'),_0x463dc5,JSON[_0xde9a('0x28')](_0x32c6f0));});}}function getEndUser(_0x4e67e7,_0x40a62f,_0xbdfe73,_0x1bc86d){logger[_0xde9a('0x31')](_0xde9a('0x3e'),_0xbdfe73);return request({'method':_0xde9a('0x32'),'uri':util['format'](_0xde9a('0x22'),_0x4e67e7[_0xde9a('0x23')]),'qs':{'operation':'query','username':_0xde9a('0x25'),'sessionName':_0x1bc86d[_0xde9a('0x26')],'query':util[_0xde9a('0x21')](_0xde9a('0x3f'),_0xbdfe73,_0xbdfe73,_0xbdfe73,_0xbdfe73,_0xbdfe73)},'json':!![]})[_0xde9a('0x29')](function(_0x5ccb51){if(_0x5ccb51[_0xde9a('0x2a')]&&_0x5ccb51[_0xde9a('0x2c')][_0xde9a('0xe')]){logger[_0xde9a('0x31')](_0xde9a('0x40'));return BPromise[_0xde9a('0x2b')]({'id':_0x5ccb51[_0xde9a('0x2c')][0x0]['id'],'name':_0x5ccb51[_0xde9a('0x2c')][0x0]['firstname']+'\x20'+_0x5ccb51[_0xde9a('0x2c')][0x0][_0xde9a('0x41')],'phone':_0xbdfe73});}else{logger['info'](_0xde9a('0x42'));return request({'method':'POST','uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x4e67e7[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x24'),'sessionName':_0x1bc86d[_0xde9a('0x26')],'elementType':_0xde9a('0x43'),'element':JSON[_0xde9a('0x28')]({'lastname':_0x40a62f,'phone':_0xbdfe73,'assigned_user_id':'\x20'})},'json':!![]})[_0xde9a('0x29')](function(_0x57fbf8){logger['info'](_0xde9a('0x44'));return BPromise[_0xde9a('0x2b')]({'id':_0x57fbf8['result']['id'],'name':_0x57fbf8['result'][_0xde9a('0x41')],'phone':_0x57fbf8[_0xde9a('0x2c')][_0xde9a('0x45')]});})[_0xde9a('0x39')](function(_0x10a645){var _0x5b9d60=_0x10a645[_0xde9a('0x2e')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xde9a('0x46'),_0x5b9d60,JSON[_0xde9a('0x28')](_0x10a645));});}});}function getConnection(_0x5b6d34){var _0x34f550=_0x5b6d34[_0xde9a('0x3c')];var _0x4f1a07=_0x5b6d34[_0xde9a('0x47')];return request({'method':_0xde9a('0x32'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x5b6d34[_0xde9a('0x23')]),'qs':{'operation':_0xde9a('0x48'),'username':_0x34f550},'json':!![]})[_0xde9a('0x29')](function(_0x58c343){if(_0x58c343[_0xde9a('0x2a')]){return request({'method':'POST','uri':util['format'](_0xde9a('0x22'),_0x5b6d34[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x49'),'username':_0xde9a('0x25'),'accessKey':md5(_0x58c343[_0xde9a('0x2c')][_0xde9a('0x4a')]+_0x4f1a07)},'json':!![]});}})[_0xde9a('0x29')](function(_0x95b412){if(_0x95b412[_0xde9a('0x2a')]){return BPromise[_0xde9a('0x2b')](_0x95b412[_0xde9a('0x2c')]);}else{throw new Error(util[_0xde9a('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x5b6d34['id']));}})[_0xde9a('0x39')](function(_0x21ac07){var _0x3c2cdf=_0x21ac07[_0xde9a('0x2e')]||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),_0xde9a('0x4b'),_0x3c2cdf,JSON[_0xde9a('0x28')](_0x21ac07));});}function request(_0x222044){logger[_0xde9a('0x31')]('[HTTP]',JSON['stringify'](_0x222044));return rp(_0x222044);}exports[_0xde9a('0x4c')]=function(_0x426ea9,_0x397264,_0x210fcd,_0x52c59b,_0x8c11ca,_0x816717){var _0x60e342,_0x4872f6,_0x31dc15,_0x3d5f70;_0x816717['remoteUri']=intUtil[_0xde9a('0x4d')](_0x816717[_0xde9a('0x23')]);if(_0x8c11ca&&_0x8c11ca[_0xde9a('0x4e')]){logger[_0xde9a('0x31')](_0xde9a('0x4f'),_0xde9a('0x50'));_0x397264['recordingURL']=util['format'](_0xde9a('0x51'),_0x816717[_0xde9a('0x52')],_0x397264['uniqueid'],md5(_0x397264[_0xde9a('0x53')]));}else{_0x397264['recordingURL']='';}return getConnection(_0x816717)[_0xde9a('0x29')](function(_0x4be605){_0x3d5f70=_0x4be605;return getUser(_0x816717,_0x52c59b[_0xde9a('0x54')],_0x3d5f70);})[_0xde9a('0x29')](function(_0x5368ca){_0x60e342=_0x5368ca;logger['info'](_0xde9a('0x55'),_0x60e342['id']);return getEndUser(_0x816717,_0x397264[_0xde9a('0x56')],_0x397264[_0xde9a('0x57')],_0x3d5f70);})[_0xde9a('0x29')](function(_0x1a1786){_0x4872f6=_0x1a1786;logger[_0xde9a('0x31')](_0xde9a('0x58'),_0x4872f6['id']);return createTicket(_0x816717,_0x60e342,_0x4872f6,_0x210fcd,_0x397264,_0x210fcd['Fields'],_0x3d5f70);})[_0xde9a('0x29')](function(_0x7481fd){_0x31dc15=_0x7481fd;logger[_0xde9a('0x31')](_0xde9a('0x59'));logger['info'](_0xde9a('0x5a'),_0x31dc15['id']);var _0x472d6e=util[_0xde9a('0x21')](_0xde9a('0x5b'),_0x816717[_0xde9a('0x23')],_[_0xde9a('0x5c')](_0x31dc15['id'],'x')[0x1]);logger[_0xde9a('0x31')]('[QUEUE]',_0xde9a('0x5d'));emit(util[_0xde9a('0x21')](_0xde9a('0x5e'),_0x52c59b['name']),'trigger:browser:url',{'uri':_0x472d6e});})[_0xde9a('0x39')](function(_0x40cf79){logger['error'](_0xde9a('0x4f'),JSON[_0xde9a('0x28')](_0x40cf79));});};exports[_0xde9a('0x5f')]=function(_0x2ef673,_0x53cb96,_0x19b1a2,_0x5e3195,_0x57e8ca,_0x589360,_0x35250c){var _0x2a4ba0,_0x4a1164,_0x509efb,_0x286203;_0x589360[_0xde9a('0x23')]=intUtil[_0xde9a('0x4d')](_0x589360[_0xde9a('0x23')]);_0x589360[_0xde9a('0x52')]=intUtil['stripTrailingSlash'](_0x589360['serverUrl']);if(_0x35250c&&_0x35250c['recordingFormat']&&_0x35250c[_0xde9a('0x60')]!=='none'){logger[_0xde9a('0x31')](_0xde9a('0x61'),_0xde9a('0x50'));_0x53cb96[_0xde9a('0x62')]=util['format'](_0xde9a('0x51'),_0x589360[_0xde9a('0x52')],_0x53cb96['uniqueid'],md5(_0x53cb96['uniqueid']));}return getConnection(_0x589360)[_0xde9a('0x29')](function(_0x23c830){_0x286203=_0x23c830;return getUser(_0x589360,_0x5e3195[_0xde9a('0x54')],_0x286203);})[_0xde9a('0x29')](function(_0x4b4a93){_0x2a4ba0=_0x4b4a93;logger[_0xde9a('0x31')](_0xde9a('0x55'),_0x2a4ba0['id']);return getEndUser(_0x589360,_0x53cb96[_0xde9a('0x63')],_0x53cb96[_0xde9a('0x64')],_0x286203);})[_0xde9a('0x29')](function(_0x5f17ab){_0x4a1164=_0x5f17ab;logger[_0xde9a('0x31')](_0xde9a('0x58'),_0x4a1164['id']);return createTicket(_0x589360,_0x2a4ba0,_0x4a1164,_0x19b1a2,_0x53cb96,_0x19b1a2['Fields'],_0x286203);})[_0xde9a('0x29')](function(_0x1cd288){_0x509efb=_0x1cd288;logger['info'](_0xde9a('0x59'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x509efb['id']);var _0x1dc2ec=util[_0xde9a('0x21')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x589360['remoteUri'],_[_0xde9a('0x5c')](_0x509efb['id'],'x')[0x1]);logger[_0xde9a('0x31')](_0xde9a('0x61'),_0xde9a('0x5d'));emit(util['format']('user:%s',_0x5e3195[_0xde9a('0x19')]),_0xde9a('0x65'),{'uri':_0x1dc2ec});})[_0xde9a('0x39')](function(_0x283451){logger[_0xde9a('0x2f')]('[OUTBOUND]',JSON[_0xde9a('0x28')](_0x283451));});};exports['abandoned']=function(_0x59ccb4,_0x1a082a,_0x3d5386,_0x326f77,_0x49d70a,_0x112af4){var _0x3a5f74,_0x44aeac,_0xe412ed,_0x40161f;_0x112af4[_0xde9a('0x23')]=intUtil[_0xde9a('0x4d')](_0x112af4[_0xde9a('0x23')]);_0x112af4[_0xde9a('0x52')]=intUtil[_0xde9a('0x4d')](_0x112af4['serverUrl']);if(_0x49d70a&&_0x49d70a['monitor_format']){logger[_0xde9a('0x31')](_0xde9a('0x66'),_0xde9a('0x50'));_0x1a082a[_0xde9a('0x62')]=util[_0xde9a('0x21')](_0xde9a('0x51'),_0x112af4[_0xde9a('0x52')],_0x1a082a[_0xde9a('0x53')],md5(_0x1a082a['uniqueid']));}else{_0x1a082a['recordingURL']='';}return getConnection(_0x112af4)[_0xde9a('0x29')](function(_0x200ce6){_0x40161f=_0x200ce6;return getUser(_0x112af4,'',_0x40161f);})[_0xde9a('0x29')](function(_0x451107){_0x3a5f74=_0x451107;logger[_0xde9a('0x31')](_0xde9a('0x55'),_0x3a5f74['id']);return getEndUser(_0x112af4,_0x1a082a[_0xde9a('0x56')],_0x1a082a[_0xde9a('0x57')],_0x40161f);})[_0xde9a('0x29')](function(_0x19f88d){_0x44aeac=_0x19f88d;logger[_0xde9a('0x31')]('The\x20Enduser\x20ID\x20is:',_0x44aeac['id']);return createTicket(_0x112af4,_0x3a5f74,_0x44aeac,_0x3d5386,_0x1a082a,_0x3d5386['Fields'],_0x40161f);})[_0xde9a('0x29')](function(_0x43ae23){_0xe412ed=_0x43ae23;logger['info'](_0xde9a('0x59'));logger[_0xde9a('0x31')](_0xde9a('0x5a'),_0xe412ed['id']);})[_0xde9a('0x39')](function(_0x501876){logger[_0xde9a('0x2f')](_0xde9a('0x66'),JSON[_0xde9a('0x28')](_0x501876));});}; \ No newline at end of file +var _0xbf1a=['token','Account\x20%d\x20is\x20not\x20valid','queue','monitor_format','recordingURL','uniqueid','email','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[QUEUE]','outbound','serverUrl','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','user:%s','trigger:browser:url','Recording\x20is\x20enabled!','calleridname','calleridnum','lodash','request-promise','bluebird','md5','util','./util','../../../../config/logger','vTiger','redis','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','sessionName','success','result','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','admin','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','Contacts','Enduser\x20created.','phone','getEndUser','accessKey'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0xbf1a,0x7c));var _0xabf1=function(_0x135497,_0x23fcac){_0x135497=_0x135497-0x0;var _0x418b82=_0xbf1a[_0x135497];return _0x418b82;};'use strict';var _=require(_0xabf1('0x0'));var rp=require(_0xabf1('0x1'));var BPromise=require(_0xabf1('0x2'));var md5=require(_0xabf1('0x3'));var util=require(_0xabf1('0x4'));var Redis=require('ioredis');var intUtil=require(_0xabf1('0x5'));var config=require('../../../../config/environment');var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));config[_0xabf1('0x8')]=_['defaults'](config['redis'],{'host':_0xabf1('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xabf1('0x8')]));function emit(_0x1cc1f6,_0x1f48f5,_0x3eb992){io['to'](_0x1cc1f6)[_0xabf1('0xa')](_0x1f48f5,_0x3eb992);}function getCustomFields(_0x3d2234,_0x59a7a2){var _0x94a69={};if(_0x3d2234[_0xabf1('0xb')]>0x0){_[_0xabf1('0xc')](_0x3d2234,function(_0x3aff77){if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0xe')&&_0x3aff77['idField']){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x3aff77[_0xabf1('0x10')][_0xabf1('0x11')]();}else if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0x12')&&_0x3aff77[_0xabf1('0x13')]&&_0x3aff77[_0xabf1('0xf')]&&_0x59a7a2[_0x3aff77[_0xabf1('0x13')]]){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x59a7a2[_0x3aff77[_0xabf1('0x13')]]['toString']();}else if(_0x3aff77[_0xabf1('0xd')]===_0xabf1('0x14')&&_0x3aff77[_0xabf1('0x15')]&&_0x3aff77['Variable'][_0xabf1('0x16')]&&_0x3aff77[_0xabf1('0xf')]&&_0x59a7a2[_0x3aff77[_0xabf1('0x15')][_0xabf1('0x16')]['toLowerCase']()]){_0x94a69[_0x3aff77[_0xabf1('0xf')]]=_0x59a7a2[_0x3aff77['Variable'][_0xabf1('0x16')][_0xabf1('0x17')]()][_0xabf1('0x11')]();}});}return _0x94a69;}function createTicket(_0x363c21,_0x26e9f8,_0xd5dc16,_0x3cfc35,_0x2d8fac,_0x8a5df5,_0x18f315){logger[_0xabf1('0x18')](_0xabf1('0x19'));var _0x1e0d23=_[_0xabf1('0x1a')]({'parent_id':'','assigned_user_id':_0x26e9f8['id'],'ticketpriorities':_0xabf1('0x1b'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x3cfc35[_0xabf1('0x1c')],_0x2d8fac,'\x20'),'description':intUtil[_0xabf1('0x1d')](_0x3cfc35[_0xabf1('0x1e')],_0x2d8fac,'\x0a'),'contact_id':_0xd5dc16['id']},getCustomFields(_0x8a5df5,_0x2d8fac));var _0x53e531={'method':_0xabf1('0x1f'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x363c21['remoteUri']),'form':{'operation':_0xabf1('0x22'),'username':'admin','sessionName':_0x18f315[_0xabf1('0x23')],'elementType':'HelpDesk','element':JSON['stringify'](_0x1e0d23)},'json':!![]};return request(_0x53e531)['then'](function(_0x29d5bf){if(_0x29d5bf[_0xabf1('0x24')]){return BPromise['resolve']({'id':_0x29d5bf[_0xabf1('0x25')]['id']});}else{throw new Error(util[_0xabf1('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON['stringify'](_0x29d5bf[_0xabf1('0x26')])));}})[_0xabf1('0x27')](function(_0x3e58f6){var _0x420590=_0x3e58f6[_0xabf1('0x28')]||0x1f4;logger['error'](_0xabf1('0x29'),'createTicket',_0x420590,JSON[_0xabf1('0x2a')](_0x3e58f6));});}function getUser(_0x5ddf0d,_0xb54b63,_0x582fbf){if(intUtil[_0xabf1('0x2b')](_0xb54b63)){logger[_0xabf1('0x18')](_0xabf1('0x2c'),_0xb54b63);return request({'method':_0xabf1('0x2d'),'uri':util['format'](_0xabf1('0x21'),_0x5ddf0d[_0xabf1('0x2e')]),'qs':{'operation':'query','username':_0xabf1('0x2f'),'sessionName':_0x582fbf['sessionName'],'query':util['format']('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0xb54b63)},'json':!![]})[_0xabf1('0x30')](function(_0x1a5745){if(_0x1a5745[_0xabf1('0x24')]&&_0x1a5745[_0xabf1('0x25')]['length']){logger[_0xabf1('0x18')](_0xabf1('0x31'));return BPromise[_0xabf1('0x32')]({'id':_0x1a5745[_0xabf1('0x25')][0x0]['id'],'email':_0x1a5745['result'][0x0][_0xabf1('0x33')],'name':_0x1a5745['result'][0x0][_0xabf1('0x34')]+'\x20'+_0x1a5745['result']['last_name']});}else{logger[_0xabf1('0x18')](_0xabf1('0x35'));return BPromise[_0xabf1('0x32')]({'id':_0x582fbf[_0xabf1('0x36')],'email':_0x5ddf0d[_0xabf1('0x37')],'name':_0xabf1('0x2f')});}})[_0xabf1('0x27')](function(_0x476841){var _0x58f5b7=_0x476841[_0xabf1('0x28')]||0x1f4;logger[_0xabf1('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x58f5b7,JSON['stringify'](_0x476841));});}else{logger[_0xabf1('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xabf1('0x32')]({'id':_0x582fbf[_0xabf1('0x36')],'email':_0x5ddf0d[_0xabf1('0x37')],'name':_0xabf1('0x2f')})['catch'](function(_0xd23acf){var _0x49bb46=_0xd23acf[_0xabf1('0x28')]||0x1f4;logger[_0xabf1('0x26')](_0xabf1('0x29'),_0xabf1('0x38'),_0x49bb46,JSON['stringify'](_0xd23acf));});}}function getEndUser(_0x24ae53,_0x336ca6,_0x2066c7,_0x284a36){logger[_0xabf1('0x18')](_0xabf1('0x39'),_0x2066c7);return request({'method':_0xabf1('0x2d'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x24ae53[_0xabf1('0x2e')]),'qs':{'operation':'query','username':'admin','sessionName':_0x284a36[_0xabf1('0x23')],'query':util[_0xabf1('0x20')](_0xabf1('0x3a'),_0x2066c7,_0x2066c7,_0x2066c7,_0x2066c7,_0x2066c7)},'json':!![]})[_0xabf1('0x30')](function(_0x3548e5){if(_0x3548e5['success']&&_0x3548e5[_0xabf1('0x25')]['length']){logger[_0xabf1('0x18')](_0xabf1('0x3b'));return BPromise[_0xabf1('0x32')]({'id':_0x3548e5[_0xabf1('0x25')][0x0]['id'],'name':_0x3548e5[_0xabf1('0x25')][0x0][_0xabf1('0x3c')]+'\x20'+_0x3548e5['result'][0x0]['lastname'],'phone':_0x2066c7});}else{logger[_0xabf1('0x18')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0xabf1('0x1f'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x24ae53[_0xabf1('0x2e')]),'form':{'operation':_0xabf1('0x22'),'sessionName':_0x284a36['sessionName'],'elementType':_0xabf1('0x3d'),'element':JSON[_0xabf1('0x2a')]({'lastname':_0x336ca6,'phone':_0x2066c7,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x379d8a){logger[_0xabf1('0x18')](_0xabf1('0x3e'));return BPromise[_0xabf1('0x32')]({'id':_0x379d8a['result']['id'],'name':_0x379d8a[_0xabf1('0x25')]['lastname'],'phone':_0x379d8a[_0xabf1('0x25')][_0xabf1('0x3f')]});})[_0xabf1('0x27')](function(_0x556e45){var _0x326fab=_0x556e45[_0xabf1('0x28')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xabf1('0x40'),_0x326fab,JSON[_0xabf1('0x2a')](_0x556e45));});}});}function getConnection(_0x1be0a9){var _0x57c238=_0x1be0a9['username'];var _0x55d635=_0x1be0a9[_0xabf1('0x41')];return request({'method':_0xabf1('0x2d'),'uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x1be0a9['remoteUri']),'qs':{'operation':'getchallenge','username':_0x57c238},'json':!![]})[_0xabf1('0x30')](function(_0x3c4453){if(_0x3c4453[_0xabf1('0x24')]){return request({'method':'POST','uri':util[_0xabf1('0x20')](_0xabf1('0x21'),_0x1be0a9['remoteUri']),'form':{'operation':'login','username':'admin','accessKey':md5(_0x3c4453['result'][_0xabf1('0x42')]+_0x55d635)},'json':!![]});}})[_0xabf1('0x30')](function(_0x40dad7){if(_0x40dad7[_0xabf1('0x24')]){return BPromise[_0xabf1('0x32')](_0x40dad7[_0xabf1('0x25')]);}else{throw new Error(util[_0xabf1('0x20')](_0xabf1('0x43'),_0x1be0a9['id']));}})[_0xabf1('0x27')](function(_0x5de2b8){var _0x522769=_0x5de2b8['statusCode']||0x1f4;logger['error'](_0xabf1('0x29'),'getConnection',_0x522769,JSON[_0xabf1('0x2a')](_0x5de2b8));});}function request(_0x59b48a){logger['info']('[HTTP]',JSON['stringify'](_0x59b48a));return rp(_0x59b48a);}exports[_0xabf1('0x44')]=function(_0x204c51,_0x2d8259,_0x390f9b,_0x529a08,_0x2dace7,_0x3ee213){var _0x1cd6d8,_0x40210b,_0x2aa7c0,_0x1e7e10;_0x3ee213[_0xabf1('0x2e')]=intUtil['stripTrailingSlash'](_0x3ee213[_0xabf1('0x2e')]);if(_0x2dace7&&_0x2dace7[_0xabf1('0x45')]){logger[_0xabf1('0x18')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2d8259[_0xabf1('0x46')]=util[_0xabf1('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ee213['serverUrl'],_0x2d8259[_0xabf1('0x47')],md5(_0x2d8259[_0xabf1('0x47')]));}else{_0x2d8259[_0xabf1('0x46')]='';}return getConnection(_0x3ee213)[_0xabf1('0x30')](function(_0x2533d0){_0x1e7e10=_0x2533d0;return getUser(_0x3ee213,_0x529a08[_0xabf1('0x48')],_0x1e7e10);})[_0xabf1('0x30')](function(_0x110853){_0x1cd6d8=_0x110853;logger['info']('The\x20User\x20ID\x20is:',_0x1cd6d8['id']);return getEndUser(_0x3ee213,_0x2d8259['calleridname'],_0x2d8259['calleridnum'],_0x1e7e10);})[_0xabf1('0x30')](function(_0x41b431){_0x40210b=_0x41b431;logger[_0xabf1('0x18')]('The\x20Enduser\x20ID\x20is:',_0x40210b['id']);return createTicket(_0x3ee213,_0x1cd6d8,_0x40210b,_0x390f9b,_0x2d8259,_0x390f9b[_0xabf1('0x49')],_0x1e7e10);})['then'](function(_0x4b7659){_0x2aa7c0=_0x4b7659;logger[_0xabf1('0x18')]('Ticket\x20created!');logger[_0xabf1('0x18')](_0xabf1('0x4a'),_0x2aa7c0['id']);var _0x342ade=util[_0xabf1('0x20')](_0xabf1('0x4b'),_0x3ee213[_0xabf1('0x2e')],_[_0xabf1('0x4c')](_0x2aa7c0['id'],'x')[0x1]);logger[_0xabf1('0x18')]('[QUEUE]',_0xabf1('0x4d'));emit(util[_0xabf1('0x20')]('user:%s',_0x529a08[_0xabf1('0x16')]),'trigger:browser:url',{'uri':_0x342ade});})['catch'](function(_0x2e7dd4){logger['error'](_0xabf1('0x4e'),JSON[_0xabf1('0x2a')](_0x2e7dd4));});};exports[_0xabf1('0x4f')]=function(_0x26739c,_0x2fa775,_0x4527dc,_0x5e1e40,_0x18cc78,_0x748830,_0x285c79){var _0x51c220,_0x3a67fd,_0x5e98f2,_0x58308b;_0x748830[_0xabf1('0x2e')]=intUtil['stripTrailingSlash'](_0x748830[_0xabf1('0x2e')]);_0x748830[_0xabf1('0x50')]=intUtil[_0xabf1('0x51')](_0x748830[_0xabf1('0x50')]);if(_0x285c79&&_0x285c79['recordingFormat']&&_0x285c79[_0xabf1('0x52')]!==_0xabf1('0x53')){logger['info'](_0xabf1('0x54'),'Recording\x20is\x20enabled!');_0x2fa775[_0xabf1('0x46')]=util[_0xabf1('0x20')](_0xabf1('0x55'),_0x748830[_0xabf1('0x50')],_0x2fa775[_0xabf1('0x47')],md5(_0x2fa775[_0xabf1('0x47')]));}return getConnection(_0x748830)[_0xabf1('0x30')](function(_0x3baf37){_0x58308b=_0x3baf37;return getUser(_0x748830,_0x5e1e40[_0xabf1('0x48')],_0x58308b);})[_0xabf1('0x30')](function(_0x3b32b8){_0x51c220=_0x3b32b8;logger[_0xabf1('0x18')](_0xabf1('0x56'),_0x51c220['id']);return getEndUser(_0x748830,_0x2fa775['destcalleridname'],_0x2fa775[_0xabf1('0x57')],_0x58308b);})['then'](function(_0x1589e3){_0x3a67fd=_0x1589e3;logger[_0xabf1('0x18')](_0xabf1('0x58'),_0x3a67fd['id']);return createTicket(_0x748830,_0x51c220,_0x3a67fd,_0x4527dc,_0x2fa775,_0x4527dc[_0xabf1('0x49')],_0x58308b);})['then'](function(_0x4c2099){_0x5e98f2=_0x4c2099;logger['info'](_0xabf1('0x59'));logger[_0xabf1('0x18')]('The\x20Ticket\x20ID\x20is:',_0x5e98f2['id']);var _0xe54cf2=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x748830[_0xabf1('0x2e')],_[_0xabf1('0x4c')](_0x5e98f2['id'],'x')[0x1]);logger[_0xabf1('0x18')](_0xabf1('0x54'),_0xabf1('0x4d'));emit(util['format'](_0xabf1('0x5a'),_0x5e1e40['name']),_0xabf1('0x5b'),{'uri':_0xe54cf2});})[_0xabf1('0x27')](function(_0x4b0ec9){logger[_0xabf1('0x26')](_0xabf1('0x54'),JSON[_0xabf1('0x2a')](_0x4b0ec9));});};exports['abandoned']=function(_0x2e15d2,_0x2c0580,_0x23309b,_0x7f2e66,_0x156556,_0x316301){var _0x437a1b,_0x3e106e,_0x5b3edd,_0x480245;_0x316301[_0xabf1('0x2e')]=intUtil[_0xabf1('0x51')](_0x316301[_0xabf1('0x2e')]);_0x316301['serverUrl']=intUtil[_0xabf1('0x51')](_0x316301[_0xabf1('0x50')]);if(_0x156556&&_0x156556[_0xabf1('0x45')]){logger['info']('[ABANDONED]',_0xabf1('0x5c'));_0x2c0580[_0xabf1('0x46')]=util[_0xabf1('0x20')](_0xabf1('0x55'),_0x316301[_0xabf1('0x50')],_0x2c0580[_0xabf1('0x47')],md5(_0x2c0580['uniqueid']));}else{_0x2c0580[_0xabf1('0x46')]='';}return getConnection(_0x316301)[_0xabf1('0x30')](function(_0x7b891e){_0x480245=_0x7b891e;return getUser(_0x316301,'',_0x480245);})['then'](function(_0x4a0c54){_0x437a1b=_0x4a0c54;logger['info'](_0xabf1('0x56'),_0x437a1b['id']);return getEndUser(_0x316301,_0x2c0580[_0xabf1('0x5d')],_0x2c0580[_0xabf1('0x5e')],_0x480245);})[_0xabf1('0x30')](function(_0xbd7194){_0x3e106e=_0xbd7194;logger[_0xabf1('0x18')](_0xabf1('0x58'),_0x3e106e['id']);return createTicket(_0x316301,_0x437a1b,_0x3e106e,_0x23309b,_0x2c0580,_0x23309b[_0xabf1('0x49')],_0x480245);})['then'](function(_0x50683a){_0x5b3edd=_0x50683a;logger[_0xabf1('0x18')](_0xabf1('0x59'));logger[_0xabf1('0x18')](_0xabf1('0x4a'),_0x5b3edd['id']);})[_0xabf1('0x27')](function(_0x4f2143){logger['error']('[ABANDONED]',JSON[_0xabf1('0x2a')](_0x4f2143));});}; \ 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 de93901..4425821 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 _0x1291=['trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','md5','ioredis','./util','../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','format','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','GET','forEach','type','string','nameField','content','idField','customField','push','variable','variableName','custom_fields','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','serverUrl','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x1291,0x149));var _0x1129=function(_0xc6c2e1,_0x50010a){_0xc6c2e1=_0xc6c2e1-0x0;var _0x5bb521=_0x1291[_0xc6c2e1];return _0x5bb521;};'use strict';var _=require(_0x1129('0x0'));var rp=require('request-promise');var md5=require(_0x1129('0x1'));var util=require('util');var Redis=require(_0x1129('0x2'));var intUtil=require(_0x1129('0x3'));var config=require('../../../../config/environment');var logger=require(_0x1129('0x4'))(_0x1129('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x1129('0x6'),'port':0x18eb});var io=require(_0x1129('0x7'))(new Redis(config[_0x1129('0x8')]));function emit(_0x22a735,_0x2b9ad0,_0x2e5ba1){io['to'](_0x22a735)['emit'](_0x2b9ad0,_0x2e5ba1);}var headers={'Content-Type':_0x1129('0x9'),'Accept':'application/json'};function getTicket(_0x1e537c,_0x1d324e,_0x40b7be,_0x515850,_0xc52e7f){logger[_0x1129('0xa')](_0x1129('0xb'));return request({'uri':util[_0x1129('0xc')]('%s/tickets.json',_0x1e537c['remoteUri']),'method':_0x1129('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x40b7be['id'],'submitter_id':_0x1d324e?_0x1d324e['id']:undefined,'assignee_id':_0x1d324e?_0x1d324e['id']:undefined,'tags':getTags(_0x515850[_0x1129('0xe')],_0x1129('0xf')),'subject':intUtil[_0x1129('0x10')](_0x515850[_0x1129('0x11')],_0xc52e7f,'\x20'),'description':intUtil['getString'](_0x515850[_0x1129('0x12')],_0xc52e7f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x515850['Descriptions'],_0xc52e7f,'\x0a')}},getCustomFields(_0x515850[_0x1129('0x13')],_0xc52e7f))}})[_0x1129('0x14')](function(_0x147545){logger[_0x1129('0xa')]('Ticket\x20created!');return _0x147545[_0x1129('0x15')];});}function getUser(_0x305e5d,_0x483156){if(intUtil[_0x1129('0x16')](_0x483156)){logger[_0x1129('0xa')](_0x1129('0x17'),_0x483156);return request({'uri':util[_0x1129('0xc')](_0x1129('0x18'),_0x305e5d[_0x1129('0x19')]),'qs':{'query':util[_0x1129('0xc')](_0x1129('0x1a'),_0x483156)}})[_0x1129('0x14')](function(_0x54cac5){if(_0x54cac5['count']){logger[_0x1129('0xa')]('Agent\x20found!');return _[_0x1129('0x1b')](_0x54cac5[_0x1129('0x1c')],{'email':_0x483156,'role':_0x1129('0x1d')});}else{logger[_0x1129('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1129('0xc')]('%s/users/me.json',_0x305e5d[_0x1129('0x19')])})[_0x1129('0x14')](function(_0x311aa6){logger[_0x1129('0xa')](_0x1129('0x1e'));return _0x311aa6[_0x1129('0x1f')];});}});}else{logger['info'](_0x1129('0x20'));return request({'uri':util[_0x1129('0xc')]('%s/users/me.json',_0x305e5d[_0x1129('0x19')])})[_0x1129('0x14')](function(_0xb4310f){logger['info'](_0x1129('0x1e'));return _0xb4310f['user'];});}}function getEndUser(_0xdaeed8,_0x59feb3,_0x24b4a0){logger[_0x1129('0xa')]('Searching\x20enduser\x20with\x20phone',_0x24b4a0);return request({'uri':util[_0x1129('0xc')](_0x1129('0x18'),_0xdaeed8[_0x1129('0x19')]),'qs':{'query':util['format'](_0x1129('0x21'),_0x24b4a0)}})[_0x1129('0x14')](function(_0xed0d87){var _0x2591f7;if(_0xed0d87[_0x1129('0x1c')][_0x1129('0x22')]){_0xed0d87['results']=_[_0x1129('0x23')](_0xed0d87[_0x1129('0x1c')],{'suspended':![],'role':_0x1129('0x24')});if(_0xed0d87[_0x1129('0x1c')][_0x1129('0x22')]){_0x2591f7=_[_0x1129('0x25')](_0xed0d87[_0x1129('0x1c')]);}}if(_0x2591f7){logger[_0x1129('0xa')](_0x1129('0x26'));return _0x2591f7;}else{logger[_0x1129('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x1129('0x27'),_0xdaeed8['remoteUri']),'method':_0x1129('0xd'),'body':{'user':{'role':_0x1129('0x24'),'name':util[_0x1129('0xc')](_0x1129('0x28'),_0x59feb3||_0x24b4a0),'phone':_0x24b4a0}}})[_0x1129('0x14')](function(_0x41a85e){logger['info']('Enduser\x20created.');return _0x41a85e['user'];});}});}function getAuth(_0x3ced59){var _0x551f7f;if(_0x3ced59['authType']===_0x1129('0x29')){_0x551f7f=util[_0x1129('0xc')](_0x1129('0x2a'),_0x3ced59[_0x1129('0x2b')],_0x3ced59[_0x1129('0x29')]);}else if(_0x3ced59[_0x1129('0x2c')]===_0x1129('0x2d')){_0x551f7f=util[_0x1129('0xc')](_0x1129('0x2e'),_0x3ced59[_0x1129('0x2b')],_0x3ced59['token']);}return util[_0x1129('0xc')](_0x1129('0x2f'),new Buffer(_0x551f7f)[_0x1129('0x30')](_0x1129('0x31')));}function request(_0x4a3823){logger[_0x1129('0x32')](_0x1129('0x33'),JSON['stringify'](_0x4a3823));return rp(_[_0x1129('0x34')](_0x4a3823,{'method':_0x1129('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x149b3d,_0x23b7b6){var _0x14eb07=[];if(_0x149b3d&&_0x149b3d[_0x1129('0x22')]>0x0){_0x14eb07=_['map'](_0x149b3d,_0x23b7b6);}return _0x14eb07;}function getCustomFields(_0x518730,_0x48e68f){var _0xa2b35e=[];var _0x40a1de={'custom_fields':[]};if(_0x518730['length']>0x0){_[_0x1129('0x36')](_0x518730,function(_0x30e005){if(_0x30e005[_0x1129('0x37')]===_0x1129('0x38')&&_0x30e005['nameField']&&!_0x30e005['customField']){_0x40a1de[_0x30e005[_0x1129('0x39')]['toLowerCase']()]=_0x30e005[_0x1129('0x3a')][_0x1129('0x30')]();}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x38')&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x40a1de['custom_fields'][_0x1129('0x3d')]({'id':_0x30e005['idField'],'value':_0x30e005['content'][_0x1129('0x30')]()});}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x3e')&&_0x30e005[_0x1129('0x3f')]&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x48e68f[_0x30e005[_0x1129('0x3f')]]&&_0x40a1de[_0x1129('0x40')]['push']({'id':_0x30e005['idField'],'value':_0x48e68f[_0x30e005[_0x1129('0x3f')]][_0x1129('0x30')]()});}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x41')&&_0x30e005[_0x1129('0x42')]&&_0x30e005[_0x1129('0x42')]['name']&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x48e68f[_0x30e005['Variable']['name'][_0x1129('0x43')]()]&&_0x40a1de[_0x1129('0x40')][_0x1129('0x3d')]({'id':_0x30e005['idField'],'value':_0x48e68f[_0x30e005['Variable'][_0x1129('0xf')][_0x1129('0x43')]()][_0x1129('0x30')]()});}});}return _0x40a1de;}exports[_0x1129('0x44')]=function(_0x34cd83,_0x239fce,_0x87f4f2,_0x36710c,_0x2aa73a,_0x12a604){var _0x39d93a,_0x4dec0f;_0x12a604[_0x1129('0x19')]=intUtil[_0x1129('0x45')](_0x12a604[_0x1129('0x19')]);_0x12a604['serverUrl']=intUtil[_0x1129('0x45')](_0x12a604['serverUrl']);if(_0x2aa73a&&_0x2aa73a[_0x1129('0x46')]){logger[_0x1129('0xa')](_0x1129('0x47'),'Recording\x20is\x20enabled!');_0x239fce['recordingURL']=util[_0x1129('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12a604[_0x1129('0x48')],_0x239fce['uniqueid'],md5(_0x239fce[_0x1129('0x49')]));}else{_0x239fce[_0x1129('0x4a')]='';}headers[_0x1129('0x4b')]=getAuth(_0x12a604);return getUser(_0x12a604,_0x36710c[_0x1129('0x4c')])[_0x1129('0x14')](function(_0x6d3ac6){_0x39d93a=_0x6d3ac6;logger[_0x1129('0xa')](_0x1129('0x4d'),_0x39d93a['id']);return getEndUser(_0x12a604,_0x239fce[_0x1129('0x4e')],_0x239fce['calleridnum']);})[_0x1129('0x14')](function(_0x5e8236){_0x4dec0f=_0x5e8236;logger['info'](_0x1129('0x4f'),_0x4dec0f['id']);return getTicket(_0x12a604,_0x39d93a,_0x4dec0f,_0x87f4f2,_0x239fce);})[_0x1129('0x14')](function(_0x202480){if(_0x202480){logger[_0x1129('0xa')](_0x1129('0x50'),_0x202480['id']);switch(_0x12a604[_0x1129('0x37')]){case _0x1129('0x51'):logger[_0x1129('0xa')](_0x1129('0x47'),_0x1129('0x52'));return request({'uri':util[_0x1129('0xc')](_0x1129('0x53'),_0x12a604[_0x1129('0x19')],_0x39d93a['id'],_0x202480['id']),'method':'POST'});case _0x1129('0x54'):logger[_0x1129('0xa')](_0x1129('0x47'),_0x1129('0x55'));emit(util['format'](_0x1129('0x56'),_0x36710c[_0x1129('0xf')]),_0x1129('0x57'),{'uri':util['format'](_0x1129('0x58'),_0x12a604[_0x1129('0x19')],_0x202480['id'])});break;default:logger['error']('[QUEUE]',_0x1129('0x59'));}}})[_0x1129('0x5a')](function(_0x2ae69f){logger[_0x1129('0x5b')](_0x1129('0x5c'),util[_0x1129('0x5d')](_0x2ae69f,{'showHidden':!![],'depth':null}));});};exports[_0x1129('0x5e')]=function(_0x913cae,_0x28ee20,_0x32facc,_0x150509,_0x3689a7,_0x1a6bbb,_0x27016a){var _0x21fca4,_0x4097a1;_0x1a6bbb[_0x1129('0x19')]=intUtil['stripTrailingSlash'](_0x1a6bbb['remoteUri']);_0x1a6bbb['serverUrl']=intUtil['stripTrailingSlash'](_0x1a6bbb[_0x1129('0x48')]);if(_0x27016a&&_0x27016a['recordingFormat']&&_0x27016a[_0x1129('0x5f')]!=='none'){logger[_0x1129('0xa')](_0x1129('0x60'),'Recording\x20is\x20enabled!');_0x28ee20['recordingURL']=util[_0x1129('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a6bbb[_0x1129('0x48')],_0x28ee20['uniqueid'],md5(_0x28ee20[_0x1129('0x49')]));}headers['Authorization']=getAuth(_0x1a6bbb);return getUser(_0x1a6bbb,_0x150509[_0x1129('0x4c')])[_0x1129('0x14')](function(_0x19abce){_0x21fca4=_0x19abce;logger[_0x1129('0xa')](_0x1129('0x4d'),_0x21fca4['id']);return getEndUser(_0x1a6bbb,_0x28ee20['destcalleridname'],_0x28ee20[_0x1129('0x61')]);})[_0x1129('0x14')](function(_0x4c0f50){_0x4097a1=_0x4c0f50;logger['info'](_0x1129('0x4f'),_0x4097a1['id']);return getTicket(_0x1a6bbb,_0x21fca4,_0x4097a1,_0x32facc,_0x28ee20);})['then'](function(_0x5d48ac){if(_0x5d48ac){logger[_0x1129('0xa')](_0x1129('0x50'),_0x5d48ac['id']);switch(_0x1a6bbb[_0x1129('0x37')]){case'integrationTab':logger[_0x1129('0xa')](_0x1129('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x1129('0x53'),_0x1a6bbb[_0x1129('0x19')],_0x21fca4['id'],_0x5d48ac['id']),'method':'POST'});case'newTab':logger[_0x1129('0xa')](_0x1129('0x60'),_0x1129('0x55'));emit(util[_0x1129('0xc')](_0x1129('0x56'),_0x150509['name']),_0x1129('0x57'),{'uri':util[_0x1129('0xc')]('%s/agent/tickets/%s',_0x1a6bbb[_0x1129('0x19')],_0x5d48ac['id'])});break;default:logger[_0x1129('0x5b')](_0x1129('0x60'),_0x1129('0x59'));}}})['catch'](function(_0x315f6d){logger[_0x1129('0x5b')](_0x1129('0x62'),util[_0x1129('0x5d')](_0x315f6d,{'showHidden':!![],'depth':null}));});};exports[_0x1129('0x63')]=function(_0x68e7bc,_0x40f33a,_0x53ce33,_0x894ffb,_0xf900d2,_0x2adbe2){var _0x2c8d19,_0xcff002;_0x2adbe2['remoteUri']=intUtil[_0x1129('0x45')](_0x2adbe2[_0x1129('0x19')]);_0x2adbe2[_0x1129('0x48')]=intUtil[_0x1129('0x45')](_0x2adbe2[_0x1129('0x48')]);if(_0xf900d2&&_0xf900d2[_0x1129('0x46')]){logger[_0x1129('0xa')](_0x1129('0x64'),_0x1129('0x65'));_0x40f33a[_0x1129('0x4a')]=util['format'](_0x1129('0x66'),_0x2adbe2[_0x1129('0x48')],_0x40f33a[_0x1129('0x49')],md5(_0x40f33a[_0x1129('0x49')]));}else{_0x40f33a[_0x1129('0x4a')]='';}headers[_0x1129('0x4b')]=getAuth(_0x2adbe2);return getUser(_0x2adbe2)[_0x1129('0x14')](function(_0x1fcf7d){_0x2c8d19=_0x1fcf7d;logger['info']('The\x20User\x20ID\x20is:',_0x2c8d19['id']);return getEndUser(_0x2adbe2,_0x40f33a['calleridname'],_0x40f33a[_0x1129('0x67')]);})[_0x1129('0x14')](function(_0x40d565){_0xcff002=_0x40d565;logger[_0x1129('0xa')](_0x1129('0x4f'),_0xcff002['id']);return getTicket(_0x2adbe2,_0x2c8d19,_0xcff002,_0x53ce33,_0x40f33a);})[_0x1129('0x14')](function(_0x11875a){if(_0x11875a){logger['info'](_0x1129('0x50'),_0x11875a['id']);}})['catch'](function(_0x256a4b){logger[_0x1129('0x5b')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x1129('0x5d')](_0x256a4b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1ae9=['%s/agent/tickets/%s','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','newTab','user:%s','error','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/logger','zendesk','redis','defaults','localhost','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','password','%s:%s','username','authType','token','Basic\x20%s','base64','[HTTP]','stringify','map','forEach','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','custom_fields','customVariable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url'];(function(_0x30788e,_0x5398bf){var _0x2fb93a=function(_0x5ab7ec){while(--_0x5ab7ec){_0x30788e['push'](_0x30788e['shift']());}};_0x2fb93a(++_0x5398bf);}(_0x1ae9,0xe3));var _0x91ae=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x1ae9[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x91ae('0x0'));var rp=require(_0x91ae('0x1'));var md5=require('md5');var util=require(_0x91ae('0x2'));var Redis=require('ioredis');var intUtil=require(_0x91ae('0x3'));var config=require('../../../../config/environment');var logger=require(_0x91ae('0x4'))(_0x91ae('0x5'));config[_0x91ae('0x6')]=_[_0x91ae('0x7')](config[_0x91ae('0x6')],{'host':_0x91ae('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91ae('0x6')]));function emit(_0x49e941,_0xfe19fc,_0x5496bf){io['to'](_0x49e941)['emit'](_0xfe19fc,_0x5496bf);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x206633,_0x30968e,_0x3cd582,_0x1e91b2,_0x187bdd){logger['info'](_0x91ae('0x9'));return request({'uri':util['format'](_0x91ae('0xa'),_0x206633[_0x91ae('0xb')]),'method':_0x91ae('0xc'),'body':{'ticket':_[_0x91ae('0xd')]({'requester_id':_0x3cd582['id'],'submitter_id':_0x30968e?_0x30968e['id']:undefined,'assignee_id':_0x30968e?_0x30968e['id']:undefined,'tags':getTags(_0x1e91b2['Tags'],_0x91ae('0xe')),'subject':intUtil[_0x91ae('0xf')](_0x1e91b2[_0x91ae('0x10')],_0x187bdd,'\x20'),'description':intUtil[_0x91ae('0xf')](_0x1e91b2[_0x91ae('0x11')],_0x187bdd,'\x0a'),'comment':{'public':![],'body':intUtil[_0x91ae('0xf')](_0x1e91b2['Descriptions'],_0x187bdd,'\x0a')}},getCustomFields(_0x1e91b2[_0x91ae('0x12')],_0x187bdd))}})['then'](function(_0x15f885){logger['info'](_0x91ae('0x13'));return _0x15f885['ticket'];});}function getUser(_0x507725,_0x52fbaa){if(intUtil[_0x91ae('0x14')](_0x52fbaa)){logger[_0x91ae('0x15')](_0x91ae('0x16'),_0x52fbaa);return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x18'),_0x507725[_0x91ae('0xb')]),'qs':{'query':util['format'](_0x91ae('0x19'),_0x52fbaa)}})[_0x91ae('0x1a')](function(_0x2005dd){if(_0x2005dd[_0x91ae('0x1b')]){logger[_0x91ae('0x15')](_0x91ae('0x1c'));return _[_0x91ae('0x1d')](_0x2005dd['results'],{'email':_0x52fbaa,'role':_0x91ae('0x1e')});}else{logger[_0x91ae('0x15')](_0x91ae('0x1f'));return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x20'),_0x507725[_0x91ae('0xb')])})[_0x91ae('0x1a')](function(_0x186f36){logger['info']('Admin\x20account\x20selected.');return _0x186f36[_0x91ae('0x21')];});}});}else{logger[_0x91ae('0x15')](_0x91ae('0x1f'));return request({'uri':util['format'](_0x91ae('0x20'),_0x507725[_0x91ae('0xb')])})[_0x91ae('0x1a')](function(_0x33f496){logger[_0x91ae('0x15')]('Admin\x20account\x20selected.');return _0x33f496[_0x91ae('0x21')];});}}function getEndUser(_0x5d26a2,_0xa66a8b,_0x2a1589){logger[_0x91ae('0x15')](_0x91ae('0x22'),_0x2a1589);return request({'uri':util['format'](_0x91ae('0x18'),_0x5d26a2[_0x91ae('0xb')]),'qs':{'query':util[_0x91ae('0x17')](_0x91ae('0x23'),_0x2a1589)}})[_0x91ae('0x1a')](function(_0x29b9e1){var _0x1428cf;if(_0x29b9e1[_0x91ae('0x24')][_0x91ae('0x25')]){_0x29b9e1[_0x91ae('0x24')]=_[_0x91ae('0x26')](_0x29b9e1['results'],{'suspended':![],'role':_0x91ae('0x27')});if(_0x29b9e1['results'][_0x91ae('0x25')]){_0x1428cf=_['first'](_0x29b9e1['results']);}}if(_0x1428cf){logger[_0x91ae('0x15')](_0x91ae('0x28'));return _0x1428cf;}else{logger[_0x91ae('0x15')](_0x91ae('0x29'));return request({'uri':util[_0x91ae('0x17')]('%s/users.json',_0x5d26a2[_0x91ae('0xb')]),'method':'POST','body':{'user':{'role':_0x91ae('0x27'),'name':util[_0x91ae('0x17')]('Caller\x20-\x20%s',_0xa66a8b||_0x2a1589),'phone':_0x2a1589}}})[_0x91ae('0x1a')](function(_0x22331c){logger[_0x91ae('0x15')]('Enduser\x20created.');return _0x22331c['user'];});}});}function getAuth(_0x307d46){var _0x3f6845;if(_0x307d46['authType']===_0x91ae('0x2a')){_0x3f6845=util['format'](_0x91ae('0x2b'),_0x307d46[_0x91ae('0x2c')],_0x307d46['password']);}else if(_0x307d46[_0x91ae('0x2d')]===_0x91ae('0x2e')){_0x3f6845=util['format']('%s/token:%s',_0x307d46[_0x91ae('0x2c')],_0x307d46[_0x91ae('0x2e')]);}return util[_0x91ae('0x17')](_0x91ae('0x2f'),new Buffer(_0x3f6845)['toString'](_0x91ae('0x30')));}function request(_0x1d05d9){logger['debug'](_0x91ae('0x31'),JSON[_0x91ae('0x32')](_0x1d05d9));return rp(_[_0x91ae('0x7')](_0x1d05d9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2f0a64,_0x428f30){var _0x38ecd5=[];if(_0x2f0a64&&_0x2f0a64[_0x91ae('0x25')]>0x0){_0x38ecd5=_[_0x91ae('0x33')](_0x2f0a64,_0x428f30);}return _0x38ecd5;}function getCustomFields(_0x396f57,_0x53314c){var _0x4078a9=[];var _0x2c525c={'custom_fields':[]};if(_0x396f57['length']>0x0){_[_0x91ae('0x34')](_0x396f57,function(_0x5d638c){if(_0x5d638c[_0x91ae('0x35')]==='string'&&_0x5d638c[_0x91ae('0x36')]&&!_0x5d638c[_0x91ae('0x37')]){_0x2c525c[_0x5d638c[_0x91ae('0x36')][_0x91ae('0x38')]()]=_0x5d638c[_0x91ae('0x39')][_0x91ae('0x3a')]();}else if(_0x5d638c['type']===_0x91ae('0x3b')&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c['customField']){_0x2c525c['custom_fields']['push']({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x5d638c[_0x91ae('0x39')]['toString']()});}else if(_0x5d638c[_0x91ae('0x35')]===_0x91ae('0x3d')&&_0x5d638c['variableName']&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c[_0x91ae('0x37')]){_0x53314c[_0x5d638c[_0x91ae('0x3e')]]&&_0x2c525c[_0x91ae('0x3f')]['push']({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x53314c[_0x5d638c['variableName']]['toString']()});}else if(_0x5d638c[_0x91ae('0x35')]===_0x91ae('0x40')&&_0x5d638c['Variable']&&_0x5d638c['Variable'][_0x91ae('0xe')]&&_0x5d638c[_0x91ae('0x3c')]&&_0x5d638c['customField']){_0x53314c[_0x5d638c['Variable'][_0x91ae('0xe')][_0x91ae('0x38')]()]&&_0x2c525c['custom_fields'][_0x91ae('0x41')]({'id':_0x5d638c[_0x91ae('0x3c')],'value':_0x53314c[_0x5d638c['Variable'][_0x91ae('0xe')][_0x91ae('0x38')]()]['toString']()});}});}return _0x2c525c;}exports['queue']=function(_0x310eee,_0x24a1d8,_0x3ffab,_0x341d4f,_0x1b9842,_0x1983c1){var _0x16b5bb,_0x5cc5f2;_0x1983c1['remoteUri']=intUtil[_0x91ae('0x42')](_0x1983c1[_0x91ae('0xb')]);_0x1983c1[_0x91ae('0x43')]=intUtil['stripTrailingSlash'](_0x1983c1['serverUrl']);if(_0x1b9842&&_0x1b9842[_0x91ae('0x44')]){logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x46'));_0x24a1d8[_0x91ae('0x47')]=util[_0x91ae('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1983c1[_0x91ae('0x43')],_0x24a1d8[_0x91ae('0x48')],md5(_0x24a1d8[_0x91ae('0x48')]));}else{_0x24a1d8[_0x91ae('0x47')]='';}headers['Authorization']=getAuth(_0x1983c1);return getUser(_0x1983c1,_0x341d4f[_0x91ae('0x49')])[_0x91ae('0x1a')](function(_0x3a7913){_0x16b5bb=_0x3a7913;logger[_0x91ae('0x15')](_0x91ae('0x4a'),_0x16b5bb['id']);return getEndUser(_0x1983c1,_0x24a1d8[_0x91ae('0x4b')],_0x24a1d8['calleridnum']);})[_0x91ae('0x1a')](function(_0x16df29){_0x5cc5f2=_0x16df29;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x5cc5f2['id']);return getTicket(_0x1983c1,_0x16b5bb,_0x5cc5f2,_0x3ffab,_0x24a1d8);})['then'](function(_0x47cfc5){if(_0x47cfc5){logger[_0x91ae('0x15')]('The\x20Ticket\x20ID\x20is:',_0x47cfc5['id']);switch(_0x1983c1['type']){case _0x91ae('0x4d'):logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x4e'));return request({'uri':util[_0x91ae('0x17')](_0x91ae('0x4f'),_0x1983c1['remoteUri'],_0x16b5bb['id'],_0x47cfc5['id']),'method':_0x91ae('0xc')});case'newTab':logger[_0x91ae('0x15')](_0x91ae('0x45'),_0x91ae('0x50'));emit(util['format']('user:%s',_0x341d4f[_0x91ae('0xe')]),_0x91ae('0x51'),{'uri':util[_0x91ae('0x17')](_0x91ae('0x52'),_0x1983c1[_0x91ae('0xb')],_0x47cfc5['id'])});break;default:logger['error'](_0x91ae('0x45'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x91ae('0x53')](function(_0x5c714d){logger['error'](_0x91ae('0x54'),util[_0x91ae('0x55')](_0x5c714d,{'showHidden':!![],'depth':null}));});};exports[_0x91ae('0x56')]=function(_0x416634,_0x120b08,_0x405a38,_0x431b36,_0x4ece85,_0x4cb13a,_0x29ff2c){var _0x376fbb,_0x24c0ff;_0x4cb13a[_0x91ae('0xb')]=intUtil[_0x91ae('0x42')](_0x4cb13a[_0x91ae('0xb')]);_0x4cb13a[_0x91ae('0x43')]=intUtil[_0x91ae('0x42')](_0x4cb13a[_0x91ae('0x43')]);if(_0x29ff2c&&_0x29ff2c[_0x91ae('0x57')]&&_0x29ff2c[_0x91ae('0x57')]!=='none'){logger[_0x91ae('0x15')]('[OUTBOUND]',_0x91ae('0x46'));_0x120b08[_0x91ae('0x47')]=util[_0x91ae('0x17')](_0x91ae('0x58'),_0x4cb13a[_0x91ae('0x43')],_0x120b08[_0x91ae('0x48')],md5(_0x120b08[_0x91ae('0x48')]));}headers[_0x91ae('0x59')]=getAuth(_0x4cb13a);return getUser(_0x4cb13a,_0x431b36[_0x91ae('0x49')])['then'](function(_0x391bc){_0x376fbb=_0x391bc;logger[_0x91ae('0x15')]('The\x20User\x20ID\x20is:',_0x376fbb['id']);return getEndUser(_0x4cb13a,_0x120b08[_0x91ae('0x5a')],_0x120b08[_0x91ae('0x5b')]);})[_0x91ae('0x1a')](function(_0x3148e1){_0x24c0ff=_0x3148e1;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x24c0ff['id']);return getTicket(_0x4cb13a,_0x376fbb,_0x24c0ff,_0x405a38,_0x120b08);})[_0x91ae('0x1a')](function(_0x5ba452){if(_0x5ba452){logger[_0x91ae('0x15')](_0x91ae('0x5c'),_0x5ba452['id']);switch(_0x4cb13a[_0x91ae('0x35')]){case'integrationTab':logger[_0x91ae('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x91ae('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4cb13a['remoteUri'],_0x376fbb['id'],_0x5ba452['id']),'method':'POST'});case _0x91ae('0x5d'):logger[_0x91ae('0x15')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x91ae('0x5e'),_0x431b36[_0x91ae('0xe')]),_0x91ae('0x51'),{'uri':util[_0x91ae('0x17')](_0x91ae('0x52'),_0x4cb13a[_0x91ae('0xb')],_0x5ba452['id'])});break;default:logger[_0x91ae('0x5f')](_0x91ae('0x60'),_0x91ae('0x61'));}}})[_0x91ae('0x53')](function(_0x5c1306){logger[_0x91ae('0x5f')](_0x91ae('0x62'),util[_0x91ae('0x55')](_0x5c1306,{'showHidden':!![],'depth':null}));});};exports[_0x91ae('0x63')]=function(_0x2328d0,_0x466e91,_0x4ca810,_0xdde247,_0x2d911f,_0x528a46){var _0x1fa203,_0x3ff607;_0x528a46['remoteUri']=intUtil['stripTrailingSlash'](_0x528a46[_0x91ae('0xb')]);_0x528a46[_0x91ae('0x43')]=intUtil[_0x91ae('0x42')](_0x528a46[_0x91ae('0x43')]);if(_0x2d911f&&_0x2d911f[_0x91ae('0x44')]){logger[_0x91ae('0x15')](_0x91ae('0x64'),_0x91ae('0x46'));_0x466e91['recordingURL']=util[_0x91ae('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x528a46[_0x91ae('0x43')],_0x466e91[_0x91ae('0x48')],md5(_0x466e91['uniqueid']));}else{_0x466e91[_0x91ae('0x47')]='';}headers[_0x91ae('0x59')]=getAuth(_0x528a46);return getUser(_0x528a46)[_0x91ae('0x1a')](function(_0x5b345f){_0x1fa203=_0x5b345f;logger[_0x91ae('0x15')](_0x91ae('0x4a'),_0x1fa203['id']);return getEndUser(_0x528a46,_0x466e91[_0x91ae('0x4b')],_0x466e91[_0x91ae('0x65')]);})['then'](function(_0x1d9d68){_0x3ff607=_0x1d9d68;logger[_0x91ae('0x15')](_0x91ae('0x4c'),_0x3ff607['id']);return getTicket(_0x528a46,_0x1fa203,_0x3ff607,_0x4ca810,_0x466e91);})[_0x91ae('0x1a')](function(_0x3b03e9){if(_0x3b03e9){logger[_0x91ae('0x15')](_0x91ae('0x5c'),_0x3b03e9['id']);}})[_0x91ae('0x53')](function(_0x1920ff){logger['error'](_0x91ae('0x66'),util[_0x91ae('0x55')](_0x1920ff,{'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 8b8d365..2538e67 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 _0xfe6d=['user','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','GET','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridnum','Outbound','catch','[ABANDONED]','request-promise','md5','./util','xml2json','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','getString','Subjects','Descriptions','Fields','called','Called','complete','Call\x20Result','Answered','Rejected','abandoned','talktime','Call\x20Duration','utc','format','mm:ss','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','starttime','CONTACTID','SEID','LEADID','','hasOwnProperty','encodeXML','POST','host','authToken','crmapi','then','parse','toJson','response','result','recorddetail','Call\x20created!','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','log','users','isArrayLikeObject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe6d,0x1de));var _0xdfe6=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xfe6d[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var rp=require(_0xdfe6('0x0'));var md5=require(_0xdfe6('0x1'));var util=require('util');var intUtil=require(_0xdfe6('0x2'));var parser=require(_0xdfe6('0x3'));var entities=require(_0xdfe6('0x4'));var moment=require(_0xdfe6('0x5'));var Redis=require(_0xdfe6('0x6'));var config=require(_0xdfe6('0x7'));var logger=require(_0xdfe6('0x8'))(_0xdfe6('0x9'));config['redis']=_[_0xdfe6('0xa')](config[_0xdfe6('0xb')],{'host':_0xdfe6('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4980e5,_0x37dc02,_0x19b334){io['to'](_0x4980e5)[_0xdfe6('0xd')](_0x37dc02,_0x19b334);}var headers={'Content-Type':_0xdfe6('0xe'),'Accept':_0xdfe6('0xe')};function getCall(_0x5b065c,_0x18b4c6,_0x50edb1,_0x3b04b6,_0x3f9b02,_0x62ab50){logger[_0xdfe6('0xf')](_0xdfe6('0x10'));var _0x1777a1=_[_0xdfe6('0x11')]({'SMOWNERID':_0x18b4c6['id'],'Call Type':_0x62ab50||_0xdfe6('0x12'),'Call Start Time':(_0x62ab50===_0xdfe6('0x13')?_0x3f9b02['starttime']:_0x3f9b02['agentcalledAt'])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0xdfe6('0x14')](_0x3b04b6[_0xdfe6('0x15')],_0x3f9b02,'\x20'),'Description':intUtil[_0xdfe6('0x14')](_0x3b04b6[_0xdfe6('0x16')],_0x3f9b02,'\x0a')},getCustomFields(_0x3b04b6[_0xdfe6('0x17')],_0x3f9b02));switch(_0x3f9b02['lastevent']){case _0xdfe6('0x18'):_0x1777a1['Call\x20Result']=_0xdfe6('0x19');break;case _0xdfe6('0x1a'):case'connect':_0x1777a1[_0xdfe6('0x1b')]=_0xdfe6('0x1c');break;case'rejected':_0x1777a1['Call\x20Result']=_0xdfe6('0x1d');break;case _0xdfe6('0x1e'):_0x1777a1[_0xdfe6('0x1b')]='Abandoned';break;default:}if(_0x3f9b02[_0xdfe6('0x1f')]){_0x1777a1[_0xdfe6('0x20')]=moment[_0xdfe6('0x21')](parseInt(_0x3f9b02[_0xdfe6('0x1f')])*0x3e8)[_0xdfe6('0x22')](_0xdfe6('0x23'));}else if(_0x3f9b02['answertime']&&_0x3f9b02['endtime']){_0x1777a1[_0xdfe6('0x20')]=moment[_0xdfe6('0x21')](moment(_0x3f9b02[_0xdfe6('0x24')],_0xdfe6('0x25'))[_0xdfe6('0x26')](moment(_0x3f9b02[_0xdfe6('0x27')],'YYYY-MM-DD\x20HH:mm:ss')))[_0xdfe6('0x22')](_0xdfe6('0x23'));}if(_0x50edb1[_0xdfe6('0x28')]){_0x1777a1[_0xdfe6('0x28')]=_0x50edb1['CONTACTID'];}else if(_0x50edb1['LEADID']){_0x1777a1['SEMODULE']='Leads';_0x1777a1[_0xdfe6('0x29')]=_0x50edb1[_0xdfe6('0x2a')];}var _0x185341=_0xdfe6('0x2b');for(var _0x3909e2 in _0x1777a1){if(_0x1777a1[_0xdfe6('0x2c')](_0x3909e2)){_0x185341+=util[_0xdfe6('0x22')]('%s',entities[_0xdfe6('0x2d')](_0x3909e2),entities[_0xdfe6('0x2d')](_0x1777a1[_0x3909e2]));}}_0x185341+='';return request({'method':_0xdfe6('0x2e'),'uri':util['format']('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x5b065c[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x5b065c[_0xdfe6('0x30')],'scope':_0xdfe6('0x31'),'xmlData':_0x185341},'json':!![]})[_0xdfe6('0x32')](function(_0x35d939){_0x35d939=JSON[_0xdfe6('0x33')](parser[_0xdfe6('0x34')](_0x35d939));if(_0x35d939[_0xdfe6('0x35')]){if(_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')]&&_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x37')]){logger[_0xdfe6('0xf')](_0xdfe6('0x38'));return{'id':_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON['stringify'](_0x35d939));});}function getUser(_0x2c8edc,_0x25d672){return request({'method':'GET','uri':util['format'](_0xdfe6('0x39'),_0x2c8edc[_0xdfe6('0x2f')]),'qs':{'type':_0xdfe6('0x3a'),'authtoken':_0x2c8edc['authToken'],'scope':_0xdfe6('0x31')},'json':!![]})[_0xdfe6('0x32')](function(_0x5b9812){if(_0x5b9812['users']&&_0x5b9812['users']['user']){var _0x2a9913;console[_0xdfe6('0x3b')]('zoho\x20data\x20users',_0x5b9812[_0xdfe6('0x3c')]['user']);if(_[_0xdfe6('0x3d')](_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')])){console['log']('zoho\x20data\x20users',_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')]);if(!_[_0xdfe6('0x3f')](_0x25d672)){_0x2a9913=_[_0xdfe6('0x40')](_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')],{'email':_0x25d672,'profile':_0xdfe6('0x41'),'status':_0xdfe6('0x42')});}if(!_[_0xdfe6('0x3f')](_0x2a9913)){logger[_0xdfe6('0xf')](_0xdfe6('0x43'));}else{logger[_0xdfe6('0xf')](_0xdfe6('0x44'));_0x2a9913=_[_0xdfe6('0x40')](_0x5b9812[_0xdfe6('0x3c')]['user'],{'profile':_0xdfe6('0x45')});}console['log']('zoho\x20user',_0x2a9913);return _0x2a9913;}else{if(_0x5b9812['users'][_0xdfe6('0x3e')][_0xdfe6('0x46')]===_0xdfe6('0x45')){logger[_0xdfe6('0xf')](_0xdfe6('0x44'));_0x2a9913=_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')];return _0x2a9913;}else{logger[_0xdfe6('0x47')](_0xdfe6('0x48'),JSON[_0xdfe6('0x49')](_0x5b9812));throw new Error(_0xdfe6('0x4a')+JSON[_0xdfe6('0x49')](_0x5b9812));}}}else{logger[_0xdfe6('0x47')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x5b9812));throw new Error(_0xdfe6('0x4a')+JSON[_0xdfe6('0x49')](_0x5b9812));}});}function getEndUser(_0x1ae636,_0x5538b2,_0x7fa05){logger[_0xdfe6('0xf')](_0xdfe6('0x4b'),_0x7fa05);return request({'method':'GET','uri':util[_0xdfe6('0x22')](_0xdfe6('0x4c'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636['authToken'],'scope':_0xdfe6('0x31'),'criteria':util[_0xdfe6('0x22')](_0xdfe6('0x4d'),_0x7fa05)},'json':!![]})[_0xdfe6('0x32')](function(_0x381ede){if(_0x381ede['response']&&_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')]){logger['info'](_0xdfe6('0x4e'));var _0x50ae0b={};var _0x4ca9a1=_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x4f')]['row']['no']?_0x381ede[_0xdfe6('0x35')]['result']['Contacts']['row']['FL']:_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x4f')][_0xdfe6('0x50')][0x0]['FL'];for(var _0xe1d34a=0x0,_0x52727c=_0x4ca9a1[_0xdfe6('0x51')];_0xe1d34a<_0x52727c;_0xe1d34a++){_0x50ae0b[_0x4ca9a1[_0xe1d34a][_0xdfe6('0x52')]]=_0x4ca9a1[_0xe1d34a][_0xdfe6('0x53')];}return _0x50ae0b;}else{return request({'method':_0xdfe6('0x54'),'uri':util[_0xdfe6('0x22')](_0xdfe6('0x55'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636[_0xdfe6('0x30')],'scope':_0xdfe6('0x31'),'criteria':util[_0xdfe6('0x22')](_0xdfe6('0x4d'),_0x7fa05)},'json':!![]})['then'](function(_0x56b0ca){if(_0x56b0ca[_0xdfe6('0x35')]&&_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')]){logger[_0xdfe6('0xf')](_0xdfe6('0x56'));var _0x7ac1f5={};var _0x6ba71c=_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['no']?_0x56b0ca['response'][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['FL']:_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')]['Leads'][_0xdfe6('0x50')][0x0]['FL'];for(var _0x415632=0x0,_0x141b13=_0x6ba71c[_0xdfe6('0x51')];_0x415632<_0x141b13;_0x415632++){_0x7ac1f5[_0x6ba71c[_0x415632][_0xdfe6('0x52')]]=_0x6ba71c[_0x415632][_0xdfe6('0x53')];}return _0x7ac1f5;}else{logger[_0xdfe6('0xf')](_0xdfe6('0x58'));_0x5538b2=getName(_0x5538b2);return request({'method':_0xdfe6('0x2e'),'uri':util[_0xdfe6('0x22')](_0xdfe6('0x59'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636[_0xdfe6('0x30')],'scope':'crmapi','xmlData':util['format'](_0xdfe6('0x5a'),entities[_0xdfe6('0x2d')](_0x5538b2[0x0]),entities[_0xdfe6('0x2d')](_0x5538b2[0x1]),_0x7fa05)},'json':!![]})[_0xdfe6('0x32')](function(_0x45061){_0x45061=JSON[_0xdfe6('0x33')](parser['toJson'](_0x45061));if(_0x45061['response']){if(_0x45061[_0xdfe6('0x35')][_0xdfe6('0x36')]&&_0x45061['response']['result']['recorddetail']){logger[_0xdfe6('0xf')](_0xdfe6('0x5b'));return request({'method':'GET','uri':util[_0xdfe6('0x22')](_0xdfe6('0x5c'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636['authToken'],'scope':_0xdfe6('0x31'),'id':_0x45061['response']['result'][_0xdfe6('0x37')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0xdfe6('0x49')](_0x45061));})['then'](function(_0x574788){if(_0x574788['response']){if(_0x574788['response'][_0xdfe6('0x36')]){var _0x5276c3={};for(var _0x2cec2e=0x0,_0x590a7e=_0x574788[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x57')]['row']['FL'][_0xdfe6('0x51')];_0x2cec2e<_0x590a7e;_0x2cec2e++){_0x5276c3[_0x574788['response'][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['FL'][_0x2cec2e][_0xdfe6('0x52')]]=_0x574788[_0xdfe6('0x35')][_0xdfe6('0x36')]['Leads'][_0xdfe6('0x50')]['FL'][_0x2cec2e][_0xdfe6('0x53')];}return _0x5276c3;}}throw new Error(_0xdfe6('0x5d')+JSON[_0xdfe6('0x49')](_0x574788));});}});}});}function request(_0x2f721e){logger[_0xdfe6('0x5e')](_0xdfe6('0x5f'),JSON[_0xdfe6('0x49')](_0x2f721e));return rp(_0x2f721e);}function getCustomFields(_0x48c5ae,_0x964883){var _0x2755e3={};if(_0x48c5ae[_0xdfe6('0x51')]>0x0){_[_0xdfe6('0x60')](_0x48c5ae,function(_0x1aef40){if(_0x1aef40[_0xdfe6('0x61')]==='string'&&_0x1aef40[_0xdfe6('0x62')]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x1aef40[_0xdfe6('0x53')]['toString']();}else if(_0x1aef40[_0xdfe6('0x61')]===_0xdfe6('0x63')&&_0x1aef40[_0xdfe6('0x64')]&&_0x1aef40['idField']&&_0x964883[_0x1aef40[_0xdfe6('0x64')]]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x964883[_0x1aef40[_0xdfe6('0x64')]][_0xdfe6('0x65')]();}else if(_0x1aef40[_0xdfe6('0x61')]===_0xdfe6('0x66')&&_0x1aef40['Variable']&&_0x1aef40[_0xdfe6('0x67')][_0xdfe6('0x68')]&&_0x1aef40[_0xdfe6('0x62')]&&_0x964883[_0x1aef40[_0xdfe6('0x67')]['name'][_0xdfe6('0x69')]()]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x964883[_0x1aef40[_0xdfe6('0x67')][_0xdfe6('0x68')][_0xdfe6('0x69')]()][_0xdfe6('0x65')]();}});}return _0x2755e3;}function getName(_0x3135db){if(_0x3135db[_0xdfe6('0x6a')]('\x20')>0x0){var _0xc4d49f=_0x3135db[_0xdfe6('0x6b')](/ (.+)/);if(_0xc4d49f[0x1]){return _0xc4d49f;}}return[_0x3135db,_0x3135db];}exports[_0xdfe6('0x6c')]=function(_0x2f5293,_0x3f590f,_0x57dc52,_0x3b8712,_0x43eaca,_0xb57bc2){var _0x126823,_0x426b7a;_0xb57bc2[_0xdfe6('0x2f')]=intUtil['stripTrailingSlash'](_0xb57bc2[_0xdfe6('0x2f')]);_0xb57bc2[_0xdfe6('0x6d')]=intUtil['stripTrailingSlash'](_0xb57bc2['serverUrl']);if(_0x43eaca&&_0x43eaca[_0xdfe6('0x6e')]){logger[_0xdfe6('0xf')](_0xdfe6('0x6f'),'Recording\x20is\x20enabled!');_0x3f590f[_0xdfe6('0x70')]=util[_0xdfe6('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb57bc2[_0xdfe6('0x6d')],_0x3f590f['uniqueid'],md5(_0x3f590f[_0xdfe6('0x71')]));}else{_0x3f590f[_0xdfe6('0x70')]='';}return getUser(_0xb57bc2,_0x3b8712['email'])[_0xdfe6('0x32')](function(_0x4b01d8){_0x126823=_0x4b01d8;logger[_0xdfe6('0xf')](_0xdfe6('0x72'),_0x126823['id']);return getEndUser(_0xb57bc2,_0x3f590f[_0xdfe6('0x73')],_0x3f590f[_0xdfe6('0x74')]);})[_0xdfe6('0x32')](function(_0x28ffad){_0x426b7a=_0x28ffad;logger['info'](_0xdfe6('0x75'),_0x426b7a[_0xdfe6('0x28')]||_0x426b7a[_0xdfe6('0x2a')]);return getCall(_0xb57bc2,_0x126823,_0x426b7a,_0x57dc52,_0x3f590f,_0xdfe6('0x76'));})[_0xdfe6('0x32')](function(_0x4d4b22){if(_0x4d4b22){logger[_0xdfe6('0xf')](_0xdfe6('0x77'),_0x4d4b22['id']);logger[_0xdfe6('0xf')](_0xdfe6('0x6f'),_0xdfe6('0x78'));emit(util[_0xdfe6('0x22')](_0xdfe6('0x79'),_0x3b8712[_0xdfe6('0x68')]),_0xdfe6('0x7a'),{'uri':util[_0xdfe6('0x22')](_0xdfe6('0x7b'),_0xb57bc2[_0xdfe6('0x2f')],_0x4d4b22['id'])});}})['catch'](function(_0x110166){logger[_0xdfe6('0x47')]('[QUEUE]',JSON['stringify'](_0x110166));});};exports[_0xdfe6('0x13')]=function(_0x2c992e,_0x392d8d,_0x9c301c,_0x4780e5,_0x180a5f,_0x469209,_0x4c2d9b){var _0x1bd11b,_0x2f5524;_0x469209[_0xdfe6('0x2f')]=intUtil[_0xdfe6('0x7c')](_0x469209['host']);_0x469209[_0xdfe6('0x6d')]=intUtil[_0xdfe6('0x7c')](_0x469209[_0xdfe6('0x6d')]);if(_0x4c2d9b&&_0x4c2d9b[_0xdfe6('0x7d')]&&_0x4c2d9b[_0xdfe6('0x7d')]!==_0xdfe6('0x7e')){logger[_0xdfe6('0xf')](_0xdfe6('0x7f'),_0xdfe6('0x80'));_0x392d8d[_0xdfe6('0x70')]=util[_0xdfe6('0x22')](_0xdfe6('0x81'),_0x469209['serverUrl'],_0x392d8d['uniqueid'],md5(_0x392d8d[_0xdfe6('0x71')]));}return getUser(_0x469209,_0x4780e5[_0xdfe6('0x82')])[_0xdfe6('0x32')](function(_0x26505e){_0x1bd11b=_0x26505e;logger[_0xdfe6('0xf')](_0xdfe6('0x72'),_0x1bd11b['id']);return getEndUser(_0x469209,_0x392d8d['destcalleridname'],_0x392d8d[_0xdfe6('0x83')]);})[_0xdfe6('0x32')](function(_0xaa88e3){_0x2f5524=_0xaa88e3;logger['info'](_0xdfe6('0x75'),_0x2f5524['CONTACTID']||_0x2f5524[_0xdfe6('0x2a')]);return getCall(_0x469209,_0x1bd11b,_0x2f5524,_0x9c301c,_0x392d8d,_0xdfe6('0x84'));})[_0xdfe6('0x32')](function(_0x266b65){if(_0x266b65){logger['info'](_0xdfe6('0x77'),_0x266b65['id']);logger[_0xdfe6('0xf')](_0xdfe6('0x7f'),_0xdfe6('0x78'));emit(util[_0xdfe6('0x22')]('user:%s',_0x4780e5[_0xdfe6('0x68')]),_0xdfe6('0x7a'),{'uri':util['format'](_0xdfe6('0x7b'),_0x469209[_0xdfe6('0x2f')],_0x266b65['id'])});}})['catch'](function(_0x217ac2){logger['error'](_0xdfe6('0x7f'),JSON[_0xdfe6('0x49')](_0x217ac2));});};exports[_0xdfe6('0x1e')]=function(_0x28aeec,_0x5844c6,_0x16c478,_0x3b26b5,_0x1bcd80,_0xb4fe51){var _0x408012,_0x595ffb;_0xb4fe51[_0xdfe6('0x2f')]=intUtil[_0xdfe6('0x7c')](_0xb4fe51[_0xdfe6('0x2f')]);_0xb4fe51[_0xdfe6('0x6d')]=intUtil[_0xdfe6('0x7c')](_0xb4fe51['serverUrl']);if(_0x1bcd80&&_0x1bcd80['monitor_format']){logger[_0xdfe6('0xf')]('[ABANDONED]',_0xdfe6('0x80'));_0x5844c6[_0xdfe6('0x70')]=util['format'](_0xdfe6('0x81'),_0xb4fe51[_0xdfe6('0x6d')],_0x5844c6[_0xdfe6('0x71')],md5(_0x5844c6[_0xdfe6('0x71')]));}else{_0x5844c6[_0xdfe6('0x70')]='';}return getUser(_0xb4fe51)[_0xdfe6('0x32')](function(_0x11ce4f){_0x408012=_0x11ce4f;logger['info'](_0xdfe6('0x72'),_0x408012['id']);return getEndUser(_0xb4fe51,_0x5844c6[_0xdfe6('0x73')],_0x5844c6['calleridnum']);})[_0xdfe6('0x32')](function(_0x5b0bbf){_0x595ffb=_0x5b0bbf;logger['info'](_0xdfe6('0x75'),_0x595ffb[_0xdfe6('0x28')]||_0x595ffb[_0xdfe6('0x2a')]);return getCall(_0xb4fe51,_0x408012,_0x595ffb,_0x16c478,_0x5844c6,_0xdfe6('0x76'));})['then'](function(_0x1cb71d){if(_0x1cb71d){logger[_0xdfe6('0xf')](_0xdfe6('0x77'),_0x1cb71d['id']);}})[_0xdfe6('0x85')](function(_0x7c9d89){logger[_0xdfe6('0x47')](_0xdfe6('0x86'),JSON[_0xdfe6('0x49')](_0x7c9d89));});}; \ No newline at end of file +var _0x79bb=['Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','endtime','Call\x20Duration','YYYY-MM-DD\x20HH:mm:ss','diff','format','mm:ss','CONTACTID','LEADID','SEMODULE','SEID','hasOwnProperty','%s','encodeXML','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','parse','response','result','recorddetail','Call\x20created!','GET','host','AllUsers','users','user','log','zoho\x20data\x20users','find','Standard','isNil','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','row','Contacts','length','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','[ABANDONED]','lodash','util','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','inbound','starttime','agentcalledAt','getString','Descriptions','Fields','lastevent','Call\x20Result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79bb,0xee));var _0xb79b=function(_0x139071,_0x5bf029){_0x139071=_0x139071-0x0;var _0x200300=_0x79bb[_0x139071];return _0x200300;};'use strict';var _=require(_0xb79b('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xb79b('0x1'));var intUtil=require('./util');var parser=require('xml2json');var entities=require('entities');var moment=require(_0xb79b('0x2'));var Redis=require(_0xb79b('0x3'));var config=require(_0xb79b('0x4'));var logger=require('../../../../config/logger')(_0xb79b('0x5'));config[_0xb79b('0x6')]=_[_0xb79b('0x7')](config['redis'],{'host':_0xb79b('0x8'),'port':0x18eb});var io=require(_0xb79b('0x9'))(new Redis(config[_0xb79b('0x6')]));function emit(_0x2e074b,_0x328b60,_0x44248d){io['to'](_0x2e074b)[_0xb79b('0xa')](_0x328b60,_0x44248d);}var headers={'Content-Type':_0xb79b('0xb'),'Accept':_0xb79b('0xb')};function getCall(_0x5ed79c,_0x32996e,_0x12296d,_0x44e6d7,_0x1e7be1,_0x38f126){logger[_0xb79b('0xc')](_0xb79b('0xd'));var _0x1bb960=_['merge']({'SMOWNERID':_0x32996e['id'],'Call Type':_0x38f126||_0xb79b('0xe'),'Call Start Time':(_0x38f126==='outbound'?_0x1e7be1[_0xb79b('0xf')]:_0x1e7be1[_0xb79b('0x10')])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0xb79b('0x11')](_0x44e6d7['Subjects'],_0x1e7be1,'\x20'),'Description':intUtil[_0xb79b('0x11')](_0x44e6d7[_0xb79b('0x12')],_0x1e7be1,'\x0a')},getCustomFields(_0x44e6d7[_0xb79b('0x13')],_0x1e7be1));switch(_0x1e7be1[_0xb79b('0x14')]){case'called':_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x16');break;case _0xb79b('0x17'):case'connect':_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x18');break;case _0xb79b('0x19'):_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x1a');break;case _0xb79b('0x1b'):_0x1bb960[_0xb79b('0x15')]=_0xb79b('0x1c');break;default:}if(_0x1e7be1[_0xb79b('0x1d')]){_0x1bb960['Call\x20Duration']=moment[_0xb79b('0x1e')](parseInt(_0x1e7be1[_0xb79b('0x1d')])*0x3e8)['format']('mm:ss');}else if(_0x1e7be1['answertime']&&_0x1e7be1[_0xb79b('0x1f')]){_0x1bb960[_0xb79b('0x20')]=moment[_0xb79b('0x1e')](moment(_0x1e7be1['endtime'],_0xb79b('0x21'))[_0xb79b('0x22')](moment(_0x1e7be1[_0xb79b('0xf')],_0xb79b('0x21'))))[_0xb79b('0x23')](_0xb79b('0x24'));}if(_0x12296d[_0xb79b('0x25')]){_0x1bb960[_0xb79b('0x25')]=_0x12296d['CONTACTID'];}else if(_0x12296d[_0xb79b('0x26')]){_0x1bb960[_0xb79b('0x27')]='Leads';_0x1bb960[_0xb79b('0x28')]=_0x12296d['LEADID'];}var _0x2c710d='';for(var _0xadbbb4 in _0x1bb960){if(_0x1bb960[_0xb79b('0x29')](_0xadbbb4)){_0x2c710d+=util[_0xb79b('0x23')](_0xb79b('0x2a'),entities[_0xb79b('0x2b')](_0xadbbb4),entities[_0xb79b('0x2b')](_0x1bb960[_0xadbbb4]));}}_0x2c710d+='';return request({'method':_0xb79b('0x2c'),'uri':util[_0xb79b('0x23')](_0xb79b('0x2d'),_0x5ed79c['host']),'qs':{'authtoken':_0x5ed79c[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'xmlData':_0x2c710d},'json':!![]})[_0xb79b('0x30')](function(_0x535b52){_0x535b52=JSON[_0xb79b('0x31')](parser['toJson'](_0x535b52));if(_0x535b52[_0xb79b('0x32')]){if(_0x535b52[_0xb79b('0x32')]['result']&&_0x535b52[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x34')]){logger['info'](_0xb79b('0x35'));return{'id':_0x535b52['response'][_0xb79b('0x33')][_0xb79b('0x34')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON['stringify'](_0x535b52));});}function getUser(_0x3810c8,_0x1ccaaa){return request({'method':_0xb79b('0x36'),'uri':util[_0xb79b('0x23')]('https://crm.%s/crm/private/json/Users/getUsers',_0x3810c8[_0xb79b('0x37')]),'qs':{'type':_0xb79b('0x38'),'authtoken':_0x3810c8[_0xb79b('0x2e')],'scope':'crmapi'},'json':!![]})[_0xb79b('0x30')](function(_0x26b0e8){if(_0x26b0e8['users']&&_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]){var _0x9dee80;console[_0xb79b('0x3b')](_0xb79b('0x3c'),_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]);if(_['isArrayLikeObject'](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')])){console[_0xb79b('0x3b')](_0xb79b('0x3c'),_0x26b0e8[_0xb79b('0x39')]['user']);if(!_['isNil'](_0x1ccaaa)){_0x9dee80=_[_0xb79b('0x3d')](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')],{'email':_0x1ccaaa,'profile':_0xb79b('0x3e'),'status':'active'});}if(!_[_0xb79b('0x3f')](_0x9dee80)){logger[_0xb79b('0xc')]('Agent\x20found!');}else{logger[_0xb79b('0xc')](_0xb79b('0x40'));_0x9dee80=_[_0xb79b('0x3d')](_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')],{'profile':_0xb79b('0x41')});}console[_0xb79b('0x3b')](_0xb79b('0x42'),_0x9dee80);return _0x9dee80;}else{if(_0x26b0e8[_0xb79b('0x39')][_0xb79b('0x3a')]['profile']===_0xb79b('0x41')){logger[_0xb79b('0xc')](_0xb79b('0x40'));_0x9dee80=_0x26b0e8[_0xb79b('0x39')]['user'];return _0x9dee80;}else{logger['error'](_0xb79b('0x43'),JSON['stringify'](_0x26b0e8));throw new Error(_0xb79b('0x44')+JSON[_0xb79b('0x45')](_0x26b0e8));}}}else{logger['error'](_0xb79b('0x43'),JSON[_0xb79b('0x45')](_0x26b0e8));throw new Error(_0xb79b('0x44')+JSON[_0xb79b('0x45')](_0x26b0e8));}});}function getEndUser(_0x54ab7f,_0x3dc4ff,_0x37fbf9){logger[_0xb79b('0xc')](_0xb79b('0x46'),_0x37fbf9);return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x47'),_0x54ab7f[_0xb79b('0x37')]),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':'crmapi','criteria':util[_0xb79b('0x23')]('((Phone:%s))',_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x4dea22){if(_0x4dea22[_0xb79b('0x32')]&&_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')]){logger[_0xb79b('0xc')]('Enduser\x20found\x20in\x20Contacts!');var _0x5a18a8={};var _0x176ae3=_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')]['Contacts'][_0xb79b('0x48')]['no']?_0x4dea22['response']['result'][_0xb79b('0x49')][_0xb79b('0x48')]['FL']:_0x4dea22[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x49')][_0xb79b('0x48')][0x0]['FL'];for(var _0x1e968b=0x0,_0xcb7910=_0x176ae3[_0xb79b('0x4a')];_0x1e968b<_0xcb7910;_0x1e968b++){_0x5a18a8[_0x176ae3[_0x1e968b][_0xb79b('0x4b')]]=_0x176ae3[_0x1e968b][_0xb79b('0x4c')];}return _0x5a18a8;}else{return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x4d'),_0x54ab7f['host']),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'criteria':util['format'](_0xb79b('0x4e'),_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x18ac70){if(_0x18ac70[_0xb79b('0x32')]&&_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')]){logger[_0xb79b('0xc')](_0xb79b('0x4f'));var _0x40f21d={};var _0x32bb81=_0x18ac70['response'][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['no']?_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')]['Leads'][_0xb79b('0x48')]['FL']:_0x18ac70[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')][0x0]['FL'];for(var _0x59f358=0x0,_0x5b3483=_0x32bb81[_0xb79b('0x4a')];_0x59f358<_0x5b3483;_0x59f358++){_0x40f21d[_0x32bb81[_0x59f358]['val']]=_0x32bb81[_0x59f358][_0xb79b('0x4c')];}return _0x40f21d;}else{logger[_0xb79b('0xc')](_0xb79b('0x51'));_0x3dc4ff=getName(_0x3dc4ff);return request({'method':_0xb79b('0x2c'),'uri':util[_0xb79b('0x23')](_0xb79b('0x52'),_0x54ab7f['host']),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'xmlData':util['format'](_0xb79b('0x53'),entities[_0xb79b('0x2b')](_0x3dc4ff[0x0]),entities['encodeXML'](_0x3dc4ff[0x1]),_0x37fbf9)},'json':!![]})[_0xb79b('0x30')](function(_0x48ca31){_0x48ca31=JSON[_0xb79b('0x31')](parser['toJson'](_0x48ca31));if(_0x48ca31[_0xb79b('0x32')]){if(_0x48ca31[_0xb79b('0x32')][_0xb79b('0x33')]&&_0x48ca31[_0xb79b('0x32')]['result'][_0xb79b('0x34')]){logger[_0xb79b('0xc')](_0xb79b('0x54'));return request({'method':'GET','uri':util[_0xb79b('0x23')](_0xb79b('0x55'),_0x54ab7f[_0xb79b('0x37')]),'qs':{'authtoken':_0x54ab7f[_0xb79b('0x2e')],'scope':_0xb79b('0x2f'),'id':_0x48ca31['response'][_0xb79b('0x33')][_0xb79b('0x34')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xb79b('0x56')+JSON['stringify'](_0x48ca31));})[_0xb79b('0x30')](function(_0x1e53ac){if(_0x1e53ac[_0xb79b('0x32')]){if(_0x1e53ac['response']['result']){var _0x5eaaf6={};for(var _0x1316b7=0x0,_0x1bc793=_0x1e53ac[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0xb79b('0x4a')];_0x1316b7<_0x1bc793;_0x1316b7++){_0x5eaaf6[_0x1e53ac['response']['result'][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0x1316b7][_0xb79b('0x4b')]]=_0x1e53ac[_0xb79b('0x32')][_0xb79b('0x33')][_0xb79b('0x50')][_0xb79b('0x48')]['FL'][_0x1316b7][_0xb79b('0x4c')];}return _0x5eaaf6;}}throw new Error(_0xb79b('0x57')+JSON[_0xb79b('0x45')](_0x1e53ac));});}});}});}function request(_0x250034){logger[_0xb79b('0x58')](_0xb79b('0x59'),JSON[_0xb79b('0x45')](_0x250034));return rp(_0x250034);}function getCustomFields(_0x466edd,_0xb3426c){var _0x3218a4={};if(_0x466edd['length']>0x0){_[_0xb79b('0x5a')](_0x466edd,function(_0x31ac46){if(_0x31ac46['type']===_0xb79b('0x5b')&&_0x31ac46[_0xb79b('0x5c')]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0x31ac46[_0xb79b('0x4c')][_0xb79b('0x5d')]();}else if(_0x31ac46[_0xb79b('0x5e')]===_0xb79b('0x5f')&&_0x31ac46[_0xb79b('0x60')]&&_0x31ac46[_0xb79b('0x5c')]&&_0xb3426c[_0x31ac46[_0xb79b('0x60')]]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0xb3426c[_0x31ac46['variableName']]['toString']();}else if(_0x31ac46[_0xb79b('0x5e')]===_0xb79b('0x61')&&_0x31ac46[_0xb79b('0x62')]&&_0x31ac46['Variable'][_0xb79b('0x63')]&&_0x31ac46['idField']&&_0xb3426c[_0x31ac46['Variable'][_0xb79b('0x63')][_0xb79b('0x64')]()]){_0x3218a4[_0x31ac46[_0xb79b('0x5c')]]=_0xb3426c[_0x31ac46[_0xb79b('0x62')][_0xb79b('0x63')][_0xb79b('0x64')]()][_0xb79b('0x5d')]();}});}return _0x3218a4;}function getName(_0x53d309){if(_0x53d309[_0xb79b('0x65')]('\x20')>0x0){var _0xf7b51f=_0x53d309[_0xb79b('0x66')](/ (.+)/);if(_0xf7b51f[0x1]){return _0xf7b51f;}}return[_0x53d309,_0x53d309];}exports['queue']=function(_0x515579,_0x13fe56,_0xbc73ec,_0x13b1de,_0x51522a,_0xd2f7e7){var _0x24efa7,_0xcddebc;_0xd2f7e7['host']=intUtil['stripTrailingSlash'](_0xd2f7e7['host']);_0xd2f7e7[_0xb79b('0x67')]=intUtil[_0xb79b('0x68')](_0xd2f7e7[_0xb79b('0x67')]);if(_0x51522a&&_0x51522a['monitor_format']){logger[_0xb79b('0xc')]('[QUEUE]',_0xb79b('0x69'));_0x13fe56['recordingURL']=util[_0xb79b('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd2f7e7[_0xb79b('0x67')],_0x13fe56[_0xb79b('0x6a')],md5(_0x13fe56['uniqueid']));}else{_0x13fe56[_0xb79b('0x6b')]='';}return getUser(_0xd2f7e7,_0x13b1de[_0xb79b('0x6c')])['then'](function(_0x42d56b){_0x24efa7=_0x42d56b;logger['info']('The\x20User\x20ID\x20is:',_0x24efa7['id']);return getEndUser(_0xd2f7e7,_0x13fe56[_0xb79b('0x6d')],_0x13fe56[_0xb79b('0x6e')]);})[_0xb79b('0x30')](function(_0xe2c01d){_0xcddebc=_0xe2c01d;logger['info'](_0xb79b('0x6f'),_0xcddebc[_0xb79b('0x25')]||_0xcddebc[_0xb79b('0x26')]);return getCall(_0xd2f7e7,_0x24efa7,_0xcddebc,_0xbc73ec,_0x13fe56,_0xb79b('0x70'));})['then'](function(_0x57524e){if(_0x57524e){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x57524e['id']);logger[_0xb79b('0xc')](_0xb79b('0x72'),_0xb79b('0x73'));emit(util[_0xb79b('0x23')]('user:%s',_0x13b1de[_0xb79b('0x63')]),_0xb79b('0x74'),{'uri':util['format'](_0xb79b('0x75'),_0xd2f7e7[_0xb79b('0x37')],_0x57524e['id'])});}})[_0xb79b('0x76')](function(_0x188c70){logger[_0xb79b('0x77')](_0xb79b('0x72'),JSON['stringify'](_0x188c70));});};exports[_0xb79b('0x78')]=function(_0x350ea2,_0x3f0afa,_0x168f00,_0x277f9d,_0x52c363,_0xd84941,_0x161daf){var _0x4da46c,_0x6ccdb3;_0xd84941[_0xb79b('0x37')]=intUtil[_0xb79b('0x68')](_0xd84941['host']);_0xd84941[_0xb79b('0x67')]=intUtil['stripTrailingSlash'](_0xd84941[_0xb79b('0x67')]);if(_0x161daf&&_0x161daf['recordingFormat']&&_0x161daf[_0xb79b('0x79')]!==_0xb79b('0x7a')){logger['info'](_0xb79b('0x7b'),_0xb79b('0x69'));_0x3f0afa[_0xb79b('0x6b')]=util['format'](_0xb79b('0x7c'),_0xd84941[_0xb79b('0x67')],_0x3f0afa[_0xb79b('0x6a')],md5(_0x3f0afa[_0xb79b('0x6a')]));}return getUser(_0xd84941,_0x277f9d['email'])[_0xb79b('0x30')](function(_0x48ac3b){_0x4da46c=_0x48ac3b;logger[_0xb79b('0xc')](_0xb79b('0x7d'),_0x4da46c['id']);return getEndUser(_0xd84941,_0x3f0afa[_0xb79b('0x7e')],_0x3f0afa[_0xb79b('0x7f')]);})[_0xb79b('0x30')](function(_0x53592b){_0x6ccdb3=_0x53592b;logger[_0xb79b('0xc')](_0xb79b('0x6f'),_0x6ccdb3[_0xb79b('0x25')]||_0x6ccdb3[_0xb79b('0x26')]);return getCall(_0xd84941,_0x4da46c,_0x6ccdb3,_0x168f00,_0x3f0afa,'Outbound');})[_0xb79b('0x30')](function(_0x1ac157){if(_0x1ac157){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x1ac157['id']);logger[_0xb79b('0xc')](_0xb79b('0x7b'),_0xb79b('0x73'));emit(util['format'](_0xb79b('0x80'),_0x277f9d[_0xb79b('0x63')]),_0xb79b('0x74'),{'uri':util['format'](_0xb79b('0x75'),_0xd84941[_0xb79b('0x37')],_0x1ac157['id'])});}})[_0xb79b('0x76')](function(_0x4711f3){logger[_0xb79b('0x77')](_0xb79b('0x7b'),JSON[_0xb79b('0x45')](_0x4711f3));});};exports[_0xb79b('0x1b')]=function(_0x59033f,_0x523691,_0x4560c4,_0x576dcb,_0x25fc5d,_0x4bab37){var _0x2221e1,_0xcae95c;_0x4bab37[_0xb79b('0x37')]=intUtil[_0xb79b('0x68')](_0x4bab37[_0xb79b('0x37')]);_0x4bab37[_0xb79b('0x67')]=intUtil[_0xb79b('0x68')](_0x4bab37['serverUrl']);if(_0x25fc5d&&_0x25fc5d['monitor_format']){logger[_0xb79b('0xc')](_0xb79b('0x81'),_0xb79b('0x69'));_0x523691[_0xb79b('0x6b')]=util['format'](_0xb79b('0x7c'),_0x4bab37['serverUrl'],_0x523691['uniqueid'],md5(_0x523691[_0xb79b('0x6a')]));}else{_0x523691[_0xb79b('0x6b')]='';}return getUser(_0x4bab37)[_0xb79b('0x30')](function(_0x46d980){_0x2221e1=_0x46d980;logger['info'](_0xb79b('0x7d'),_0x2221e1['id']);return getEndUser(_0x4bab37,_0x523691[_0xb79b('0x6d')],_0x523691[_0xb79b('0x6e')]);})['then'](function(_0x2cb8f9){_0xcae95c=_0x2cb8f9;logger[_0xb79b('0xc')](_0xb79b('0x6f'),_0xcae95c[_0xb79b('0x25')]||_0xcae95c[_0xb79b('0x26')]);return getCall(_0x4bab37,_0x2221e1,_0xcae95c,_0x4560c4,_0x523691,_0xb79b('0x70'));})[_0xb79b('0x30')](function(_0x5795aa){if(_0x5795aa){logger[_0xb79b('0xc')](_0xb79b('0x71'),_0x5795aa['id']);}})['catch'](function(_0x4dc026){logger[_0xb79b('0x77')](_0xb79b('0x81'),JSON['stringify'](_0x4dc026));});}; \ 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 e4ff123..18968a3 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x2cf785,_0x4f3be2){var _0x5e4177=function(_0xb301cd){while(--_0xb301cd){_0x2cf785['push'](_0x2cf785['shift']());}};_0x5e4177(++_0x4f3be2);}(_0x7a54,0x106));var _0x47a5=function(_0x561e3f,_0x36ae34){_0x561e3f=_0x561e3f-0x0;var _0x282282=_0x7a54[_0x561e3f];return _0x282282;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x301278,_0x19fe5e){var _0xa71b0=function(_0x32d666){while(--_0x32d666){_0x301278['push'](_0x301278['shift']());}};_0xa71b0(++_0x19fe5e);}(_0x7a54,0x106));var _0x47a5=function(_0x4497f9,_0x4e68e7){_0x4497f9=_0x4497f9-0x0;var _0x3afc68=_0x7a54[_0x4497f9];return _0x3afc68;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 20407bb..6edd24a 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 _0xfe9d=['parse','error','stack','toUpperCase','GET','POST','PUT','data7','render','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','data2','data6'];(function(_0x4f00e9,_0x619dee){var _0x3cfffc=function(_0x3fc689){while(--_0x3fc689){_0x4f00e9['push'](_0x4f00e9['shift']());}};_0x3cfffc(++_0x619dee);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x59d623,_0x554126){_0x59d623=_0x59d623-0x0;var _0x13b87a=_0xfe9d[_0x59d623];return _0x13b87a;};'use strict';var rp=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var _=require(_0xdfe9('0x2'));var Mustache=require(_0xdfe9('0x3'));var logger=require(_0xdfe9('0x4'))('trigger');exports[_0xdfe9('0x5')]=function(_0x4c71d5,_0x1144b0){var _0x1256ab,_0x2e5fd8;var _0x6dd8ce={'method':_0x4c71d5[_0xdfe9('0x6')]['toUpperCase'](),'uri':encodeURI(Mustache['render'](_0x4c71d5[_0xdfe9('0x7')],_0x1144b0)),'json':!![],'resolveWithFullResponse':!![]};try{_0x6dd8ce['headers']=_0x4c71d5[_0xdfe9('0x8')]?JSON[_0xdfe9('0x9')](Mustache['render'](_0x4c71d5[_0xdfe9('0x8')],_0x1144b0)):{};}catch(_0x36f0c6){logger[_0xdfe9('0xa')](_0x36f0c6[_0xdfe9('0xb')]);}switch(_0x4c71d5['data1'][_0xdfe9('0xc')]()){case _0xdfe9('0xd'):_0x6dd8ce['qs']=_0x1144b0;break;case _0xdfe9('0xe'):case _0xdfe9('0xf'):_0x1256ab={};if(_0x4c71d5[_0xdfe9('0x10')]){_0x1256ab=Mustache[_0xdfe9('0x11')](_0x4c71d5[_0xdfe9('0x10')],_0x1144b0);}else{_0x1256ab=_0x1144b0;}_0x6dd8ce[_0xdfe9('0x12')]=JSON[_0xdfe9('0x9')](_0x1256ab);break;}logger[_0xdfe9('0x13')](util['format'](_0xdfe9('0x14'),_0x4c71d5['data1'],_0x4c71d5['data2'],JSON[_0xdfe9('0x15')](_0x6dd8ce)));rp(_0x6dd8ce)[_0xdfe9('0x16')](function(_0x531409){_0x1256ab=!_[_0xdfe9('0x17')](_0x1256ab)?_0xdfe9('0x18')+_0x1256ab:'';_0x2e5fd8=typeof _0x531409['body']===_0xdfe9('0x19')?JSON['stringify'](_0x531409[_0xdfe9('0x12')]):_0x531409[_0xdfe9('0x12')];logger[_0xdfe9('0x13')](util[_0xdfe9('0x1a')](_0xdfe9('0x1b'),_0x4c71d5[_0xdfe9('0x6')],_0x4c71d5['data2'],_0x531409['statusCode'],_0x2e5fd8));})[_0xdfe9('0x1c')](function(_0x4fd892){logger[_0xdfe9('0xa')](util[_0xdfe9('0x1a')](_0xdfe9('0x1d'),_0x4c71d5['data1'],_0x4c71d5['data2'],_0x4fd892[_0xdfe9('0x1e')],_0x4fd892['name'],_0x4fd892['message']));});}; \ No newline at end of file +var _0x0ffc=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','body','object','stringify','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','exec','data1','toUpperCase','render','headers','data6','parse','error','stack','GET','PUT','data7','info'];(function(_0x26662e,_0x208144){var _0x1cb1b6=function(_0x52aae3){while(--_0x52aae3){_0x26662e['push'](_0x26662e['shift']());}};_0x1cb1b6(++_0x208144);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x479464,_0x47e3ca){_0x479464=_0x479464-0x0;var _0x16005a=_0x0ffc[_0x479464];return _0x16005a;};'use strict';var rp=require('request-promise');var util=require(_0xc0ff('0x0'));var _=require(_0xc0ff('0x1'));var Mustache=require('mustache');var logger=require(_0xc0ff('0x2'))('trigger');exports[_0xc0ff('0x3')]=function(_0x114cd6,_0x145a1b){var _0x46319b,_0x2c6126;var _0x275e00={'method':_0x114cd6[_0xc0ff('0x4')][_0xc0ff('0x5')](),'uri':encodeURI(Mustache[_0xc0ff('0x6')](_0x114cd6['data2'],_0x145a1b)),'json':!![],'resolveWithFullResponse':!![]};try{_0x275e00[_0xc0ff('0x7')]=_0x114cd6[_0xc0ff('0x8')]?JSON[_0xc0ff('0x9')](Mustache[_0xc0ff('0x6')](_0x114cd6[_0xc0ff('0x8')],_0x145a1b)):{};}catch(_0x380604){logger[_0xc0ff('0xa')](_0x380604[_0xc0ff('0xb')]);}switch(_0x114cd6['data1']['toUpperCase']()){case _0xc0ff('0xc'):_0x275e00['qs']=_0x145a1b;break;case'POST':case _0xc0ff('0xd'):_0x46319b={};if(_0x114cd6[_0xc0ff('0xe')]){_0x46319b=Mustache[_0xc0ff('0x6')](_0x114cd6[_0xc0ff('0xe')],_0x145a1b);}else{_0x46319b=_0x145a1b;}_0x275e00['body']=JSON[_0xc0ff('0x9')](_0x46319b);break;}logger[_0xc0ff('0xf')](util['format'](_0xc0ff('0x10'),_0x114cd6['data1'],_0x114cd6['data2'],JSON['stringify'](_0x275e00)));rp(_0x275e00)[_0xc0ff('0x11')](function(_0xa91369){_0x46319b=!_[_0xc0ff('0x12')](_0x46319b)?',\x20request\x20body:\x20'+_0x46319b:'';_0x2c6126=typeof _0xa91369[_0xc0ff('0x13')]===_0xc0ff('0x14')?JSON[_0xc0ff('0x15')](_0xa91369[_0xc0ff('0x13')]):_0xa91369[_0xc0ff('0x13')];logger[_0xc0ff('0xf')](util[_0xc0ff('0x16')](_0xc0ff('0x17'),_0x114cd6[_0xc0ff('0x4')],_0x114cd6[_0xc0ff('0x18')],_0xa91369[_0xc0ff('0x19')],_0x2c6126));})['catch'](function(_0x21b852){logger['error'](util[_0xc0ff('0x16')](_0xc0ff('0x1a'),_0x114cd6[_0xc0ff('0x4')],_0x114cd6['data2'],_0x21b852[_0xc0ff('0x19')],_0x21b852[_0xc0ff('0x1b')],_0x21b852[_0xc0ff('0x1c')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index ab09e88..29df568 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 _0xb138=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','rpc','error','message','result','catch'];(function(_0x8ce474,_0x5929bf){var _0x411432=function(_0x18c146){while(--_0x18c146){_0x8ce474['push'](_0x8ce474['shift']());}};_0x411432(++_0x5929bf);}(_0xb138,0x1dd));var _0x8b13=function(_0x13b2a7,_0x3fc11a){_0x13b2a7=_0x13b2a7-0x0;var _0x282bff=_0xb138[_0x13b2a7];return _0x282bff;};'use strict';var jayson=require(_0x8b13('0x0'));var BPromise=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var client=jayson[_0x8b13('0x4')][_0x8b13('0x5')]({'port':0x2329});client[_0x8b13('0x6')]=function(_0x5369d4,_0x4411a0){return new BPromise(function(_0x241acb,_0x3af81a){return client['request'](_0x5369d4,_0x4411a0)[_0x8b13('0x7')](function(_0x13f7bd){logger['debug'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x4411a0,_0x13f7bd);if(_0x13f7bd[_0x8b13('0x9')]){logger['error'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x13f7bd['error']['message'],_0x4411a0);return _0x3af81a(_0x13f7bd[_0x8b13('0x9')][_0x8b13('0xa')]);}else{return _0x241acb(_0x13f7bd[_0x8b13('0xb')]);}})[_0x8b13('0xc')](function(_0x3e8eca){logger['error'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x3e8eca,_0x4411a0);return _0x3af81a(_0x3e8eca);});});};module[_0x8b13('0xd')]=client; \ No newline at end of file +var _0x3164=['request','then','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request'];(function(_0x332835,_0x4fb907){var _0x2a7fae=function(_0x2609d0){while(--_0x2609d0){_0x332835['push'](_0x332835['shift']());}};_0x2a7fae(++_0x4fb907);}(_0x3164,0x182));var _0x4316=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x3164[_0x21bfab];return _0x4db318;};'use strict';var jayson=require(_0x4316('0x0'));var BPromise=require(_0x4316('0x1'));var logger=require(_0x4316('0x2'))(_0x4316('0x3'));var client=jayson[_0x4316('0x4')]['http']({'port':0x2329});client[_0x4316('0x5')]=function(_0x2355a6,_0x1235d9){return new BPromise(function(_0x56124c,_0x5ee7e6){return client[_0x4316('0x6')](_0x2355a6,_0x1235d9)[_0x4316('0x7')](function(_0xf88ba4){logger[_0x4316('0x8')](_0x4316('0x9'),_0x4316('0x3'),_0x2355a6,_0x1235d9,_0xf88ba4);if(_0xf88ba4[_0x4316('0xa')]){logger[_0x4316('0xa')](_0x4316('0x9'),_0x4316('0x3'),_0x2355a6,_0xf88ba4[_0x4316('0xa')][_0x4316('0xb')],_0x1235d9);return _0x5ee7e6(_0xf88ba4[_0x4316('0xa')][_0x4316('0xb')]);}else{return _0x56124c(_0xf88ba4['result']);}})[_0x4316('0xc')](function(_0x446361){logger[_0x4316('0xa')](_0x4316('0x9'),'routing',_0x2355a6,_0x446361,_0x1235d9);return _0x5ee7e6(_0x446361);});});};module[_0x4316('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index fa02168..4cdd641 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 _0x7e03=['./realtime','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','catch','log','bluebird','./server'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7e03,0x12a));var _0x37e0=function(_0x4e3899,_0x20a9bf){_0x4e3899=_0x4e3899-0x0;var _0x96f85d=_0x7e03[_0x4e3899];return _0x96f85d;};'use strict';var BPromise=require(_0x37e0('0x0'));var server=require(_0x37e0('0x1'));var Realtime=require(_0x37e0('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x37e0('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x37e0('0x4')]()[_0x37e0('0x5')](mailAccount[_0x37e0('0x6')]())[_0x37e0('0x5')](realtime[_0x37e0('0x7')]())[_0x37e0('0x5')](function(){email[_0x37e0('0x8')](realtime[_0x37e0('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x2a8b12){return initRealtime();})[_0x37e0('0x5')](function(_0x427755){return setInterval(initRealtime,0x2710);})[_0x37e0('0xa')](function(_0x4ff5cd){console[_0x37e0('0xb')](_0x4ff5cd);});}main(); \ No newline at end of file +var _0xc8eb=['mailAccounts','listen','catch','./server','./realtime','./lib/email','resolve','then','initMailAccounts','refresh'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc8eb,0xcb));var _0xbc8e=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xc8eb[_0x3ec333];return _0x15ccb8;};'use strict';var BPromise=require('bluebird');var server=require(_0xbc8e('0x0'));var Realtime=require(_0xbc8e('0x1'));var EmailChannel=require(_0xbc8e('0x2'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xbc8e('0x3')]()[_0xbc8e('0x4')](mailAccount['getMailAccounts']())[_0xbc8e('0x4')](realtime[_0xbc8e('0x5')]())[_0xbc8e('0x4')](function(){email[_0xbc8e('0x6')](realtime[_0xbc8e('0x7')]);return realtime;});}function main(){return server[_0xbc8e('0x8')](realtime,email)['then'](function(_0x5bbdbf){return initRealtime();})[_0xbc8e('0x4')](function(_0x316012){return setInterval(initRealtime,0x2710);})[_0xbc8e('0x9')](function(_0x581294){console['log'](_0x581294);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 55633b9..efd7db8 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 _0x6343=['Imap','status','messageStatus','total','isNil','stringify','emit','prototype','refresh','hasOwnProperty','email','handleImapBox','bind','handleImapEnd','handleImapError','disabled','connected','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','send','verifySmtp','Smtp','verify','exports','bluebird','md5','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','active'];(function(_0x33823b,_0x3aedea){var _0x10f7e5=function(_0x5f19a9){while(--_0x5f19a9){_0x33823b['push'](_0x33823b['shift']());}};_0x10f7e5(++_0x3aedea);}(_0x6343,0x168));var _0x3634=function(_0x1c20c8,_0x40832e){_0x1c20c8=_0x1c20c8-0x0;var _0x39c05c=_0x6343[_0x1c20c8];return _0x39c05c;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x3634('0x0'));var md5=require(_0x3634('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('email');config[_0x3634('0x2')]=_[_0x3634('0x3')](config['redis'],{'host':_0x3634('0x4'),'port':0x18eb});var io=require(_0x3634('0x5'))(new Redis(config['redis']));var EmailImap=require(_0x3634('0x6'));var EmailSmtp=require(_0x3634('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5affba){logger[_0x3634('0x8')](_0x3634('0x9'));this[_0x3634('0xa')]=_0x5affba[_0x3634('0xa')];this[_0x3634('0xb')]={};this[_0x3634('0xc')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x31bcfc){var _0x364e60=this['mailAccounts'][_0x31bcfc];var _0x2bb4db={'id':_0x364e60['id'],'name':_0x364e60[_0x3634('0xd')],'key':_0x364e60[_0x3634('0xe')],'active':_0x364e60[_0x3634('0xf')],'Imap':{'status':_0x364e60[_0x3634('0x10')][_0x3634('0x11')],'messageStatus':_0x364e60[_0x3634('0x10')][_0x3634('0x12')],'total':_0x364e60[_0x3634('0x10')][_0x3634('0x13')]}};if(_[_0x3634('0x14')](md5Accounts[_0x31bcfc])){md5Accounts[_0x31bcfc]={};}var _0x71d09b=md5(JSON[_0x3634('0x15')](_0x2bb4db));if(md5Accounts[_0x31bcfc][_0x3634('0x1')]!==_0x71d09b){md5Accounts[_0x31bcfc]['md5']=_0x71d09b;io[_0x3634('0x16')]('mailAccount:update',_0x2bb4db);}};EmailChannel[_0x3634('0x17')][_0x3634('0x18')]=function(_0x2fc628){for(var _0x78f93f in _0x2fc628){if(_0x2fc628[_0x3634('0x19')](_0x78f93f)){if(_0x2fc628[_0x78f93f]['Imap']&&_0x2fc628[_0x78f93f][_0x3634('0xf')]){var _0x4b8ec8=_0x2fc628[_0x78f93f]['Imap'];if(!this[_0x3634('0xb')]['hasOwnProperty'](_0x4b8ec8['id'])){this[_0x3634('0xb')][_0x4b8ec8['id']]=new EmailImap(_0x4b8ec8,_0x2fc628[_0x78f93f][_0x3634('0x1a')]);this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('box',this[_0x3634('0x1b')][_0x3634('0x1c')](this,_0x78f93f));this['imapAccounts'][_0x4b8ec8['id']]['on'](_0x3634('0x1a'),this['handleImapEmail'][_0x3634('0x1c')](this,_0x78f93f));this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('end',this[_0x3634('0x1d')][_0x3634('0x1c')](this,_0x78f93f));this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('error',this[_0x3634('0x1e')][_0x3634('0x1c')](this,_0x78f93f));}}else{if(_['isNil'](this[_0x3634('0xa')][_0x78f93f]['Imap'])){this['mailAccounts'][_0x78f93f][_0x3634('0x10')]={};}this[_0x3634('0xa')][_0x78f93f]['Imap'][_0x3634('0x11')]=_0x3634('0x1f');this[_0x3634('0xa')][_0x78f93f][_0x3634('0x10')][_0x3634('0x12')]='';this[_0x3634('0x16')](_0x78f93f);}}}};EmailChannel[_0x3634('0x17')][_0x3634('0x1b')]=function(_0x22f1f1,_0x52e9ae){if(this[_0x3634('0xa')][_0x22f1f1]){this['mailAccounts'][_0x22f1f1]['Imap']['status']=_0x3634('0x20');this['mailAccounts'][_0x22f1f1][_0x3634('0x10')][_0x3634('0x12')]=_0x52e9ae['name'];if(_0x52e9ae['messages']){this[_0x3634('0xa')][_0x22f1f1]['Imap'][_0x3634('0x13')]=_0x52e9ae['messages'][_0x3634('0x13')];}return this[_0x3634('0x16')](_0x22f1f1);}};EmailChannel[_0x3634('0x17')][_0x3634('0x21')]=function(_0x1f46d9,_0x20b062){logger[_0x3634('0x8')](_0x3634('0x22'),_0x20b062['firstName'],_0x20b062['lastName'],_0x20b062['from'],_0x1f46d9);if(this[_0x3634('0xa')][_0x1f46d9]){return mailAccount['notify'](_0x1f46d9,_0x20b062)[_0x3634('0x23')](function(_0x15b0a4){if(_0x15b0a4){logger[_0x3634('0x8')](_0x3634('0x24'));}})[_0x3634('0x25')](function(_0x293e52){logger['error'](_0x3634('0x26'),JSON[_0x3634('0x15')](_0x293e52));});}};EmailChannel[_0x3634('0x17')][_0x3634('0x1d')]=function(_0x424825){if(this[_0x3634('0xa')][_0x424825]&&this[_0x3634('0xa')][_0x424825][_0x3634('0x10')]){if(this[_0x3634('0xb')][this['mailAccounts'][_0x424825][_0x3634('0x10')]['id']]){delete this[_0x3634('0xb')][this[_0x3634('0xa')][_0x424825][_0x3634('0x10')]['id']];}this['mailAccounts'][_0x424825][_0x3634('0x10')][_0x3634('0x27')]=moment();this[_0x3634('0x16')](_0x424825);}};EmailChannel['prototype']['handleImapError']=function(_0x55b8d8,_0x4204fe){if(this[_0x3634('0xa')][_0x55b8d8]){this['mailAccounts'][_0x55b8d8][_0x3634('0x10')][_0x3634('0x11')]=_0x3634('0x28');this[_0x3634('0xa')][_0x55b8d8][_0x3634('0x10')][_0x3634('0x12')]=_0x4204fe;return this[_0x3634('0x16')](_0x55b8d8);}};EmailChannel['prototype'][_0x3634('0x29')]=function(_0x59dbf2,_0x35b71e){return this[_0x3634('0xc')][_0x3634('0x2a')](_0x59dbf2,_0x35b71e);};EmailChannel[_0x3634('0x17')][_0x3634('0x2b')]=function(_0x597511){var _0x10ff70=this;if(this[_0x3634('0xa')][_0x597511['id']]){if(_[_0x3634('0x14')](this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')])){this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')]={};}this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')]['lastSync']=moment();return new BPromise(function(_0x4c1e6a,_0x14586d){return _0x10ff70['smtp']['verify'](_0x597511)['then'](function(_0x80f1a2){_0x10ff70['mailAccounts'][_0x597511['id']][_0x3634('0x2c')][_0x3634('0x11')]='verified';_0x10ff70['mailAccounts'][_0x597511['id']]['Smtp'][_0x3634('0x12')]='';_0x10ff70[_0x3634('0x16')](_0x597511['id']);_0x4c1e6a(_0x80f1a2);})['catch'](function(_0x37144c){_0x10ff70[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')][_0x3634('0x11')]=_0x3634('0x28');_0x10ff70['mailAccounts'][_0x597511['id']]['Smtp'][_0x3634('0x12')]=_0x37144c;_0x10ff70[_0x3634('0x16')](_0x597511['id']);_0x14586d(_0x37144c);});});}return this[_0x3634('0xc')][_0x3634('0x2d')](_0x597511);};module[_0x3634('0x2e')]=EmailChannel; \ No newline at end of file +var _0x5f2f=['lastSync','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','box','bind','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','name','messages','handleImapEmail','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54bcab,_0x562e4d){_0x54bcab=_0x54bcab-0x0;var _0xd0a7fc=_0x5f2f[_0x54bcab];return _0xd0a7fc;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var md5=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var config=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));config['redis']=_['defaults'](config[_0xf5f2('0x8')],{'host':_0xf5f2('0x9'),'port':0x18eb});var io=require(_0xf5f2('0xa'))(new Redis(config[_0xf5f2('0x8')]));var EmailImap=require(_0xf5f2('0xb'));var EmailSmtp=require(_0xf5f2('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x466882){logger[_0xf5f2('0xd')](_0xf5f2('0xe'));this['mailAccounts']=_0x466882[_0xf5f2('0xf')];this[_0xf5f2('0x10')]={};this[_0xf5f2('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xf5f2('0x12')]=function(_0x4ebbbe){var _0x53fb33=this[_0xf5f2('0xf')][_0x4ebbbe];var _0x151aba={'id':_0x53fb33['id'],'name':_0x53fb33['name'],'key':_0x53fb33[_0xf5f2('0x13')],'active':_0x53fb33[_0xf5f2('0x14')],'Imap':{'status':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x16')],'messageStatus':_0x53fb33[_0xf5f2('0x15')][_0xf5f2('0x17')],'total':_0x53fb33['Imap'][_0xf5f2('0x18')]}};if(_[_0xf5f2('0x19')](md5Accounts[_0x4ebbbe])){md5Accounts[_0x4ebbbe]={};}var _0x269909=md5(JSON[_0xf5f2('0x1a')](_0x151aba));if(md5Accounts[_0x4ebbbe][_0xf5f2('0x3')]!==_0x269909){md5Accounts[_0x4ebbbe]['md5']=_0x269909;io[_0xf5f2('0x12')](_0xf5f2('0x1b'),_0x151aba);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x1d')]=function(_0x23e23a){for(var _0x3a9dbb in _0x23e23a){if(_0x23e23a[_0xf5f2('0x1e')](_0x3a9dbb)){if(_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')]&&_0x23e23a[_0x3a9dbb][_0xf5f2('0x14')]){var _0x228ace=_0x23e23a[_0x3a9dbb][_0xf5f2('0x15')];if(!this[_0xf5f2('0x10')][_0xf5f2('0x1e')](_0x228ace['id'])){this[_0xf5f2('0x10')][_0x228ace['id']]=new EmailImap(_0x228ace,_0x23e23a[_0x3a9dbb][_0xf5f2('0x7')]);this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x1f'),this['handleImapBox'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('email',this['handleImapEmail'][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on']('end',this[_0xf5f2('0x21')][_0xf5f2('0x20')](this,_0x3a9dbb));this[_0xf5f2('0x10')][_0x228ace['id']]['on'](_0xf5f2('0x22'),this[_0xf5f2('0x23')]['bind'](this,_0x3a9dbb));}}else{if(_[_0xf5f2('0x19')](this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')])){this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')]={};}this['mailAccounts'][_0x3a9dbb]['Imap'][_0xf5f2('0x16')]=_0xf5f2('0x24');this[_0xf5f2('0xf')][_0x3a9dbb][_0xf5f2('0x15')][_0xf5f2('0x17')]='';this[_0xf5f2('0x12')](_0x3a9dbb);}}}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x25')]=function(_0x294414,_0x4ab014){if(this[_0xf5f2('0xf')][_0x294414]){this[_0xf5f2('0xf')][_0x294414][_0xf5f2('0x15')][_0xf5f2('0x16')]=_0xf5f2('0x26');this[_0xf5f2('0xf')][_0x294414]['Imap']['messageStatus']=_0x4ab014[_0xf5f2('0x27')];if(_0x4ab014[_0xf5f2('0x28')]){this[_0xf5f2('0xf')][_0x294414]['Imap']['total']=_0x4ab014[_0xf5f2('0x28')][_0xf5f2('0x18')];}return this[_0xf5f2('0x12')](_0x294414);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x29')]=function(_0x54c0c8,_0x52e959){logger[_0xf5f2('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x52e959[_0xf5f2('0x2a')],_0x52e959['lastName'],_0x52e959[_0xf5f2('0x2b')],_0x54c0c8);if(this[_0xf5f2('0xf')][_0x54c0c8]){return mailAccount[_0xf5f2('0x2c')](_0x54c0c8,_0x52e959)[_0xf5f2('0x2d')](function(_0x256bd9){if(_0x256bd9){logger[_0xf5f2('0xd')](_0xf5f2('0x2e'));}})[_0xf5f2('0x2f')](function(_0x5ca917){logger[_0xf5f2('0x22')](_0xf5f2('0x30'),JSON[_0xf5f2('0x1a')](_0x5ca917));});}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x21')]=function(_0x27c0e7){if(this[_0xf5f2('0xf')][_0x27c0e7]&&this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]){if(this[_0xf5f2('0x10')][this['mailAccounts'][_0x27c0e7][_0xf5f2('0x15')]['id']]){delete this['imapAccounts'][this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['id']];}this[_0xf5f2('0xf')][_0x27c0e7][_0xf5f2('0x15')]['lastSync']=moment();this['emit'](_0x27c0e7);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x23')]=function(_0x20eb74,_0x4ec8fb){if(this[_0xf5f2('0xf')][_0x20eb74]){this['mailAccounts'][_0x20eb74][_0xf5f2('0x15')]['status']=_0xf5f2('0x22');this[_0xf5f2('0xf')][_0x20eb74]['Imap'][_0xf5f2('0x17')]=_0x4ec8fb;return this[_0xf5f2('0x12')](_0x20eb74);}};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x31')]=function(_0x542cd6,_0x5d2d82){return this[_0xf5f2('0x11')][_0xf5f2('0x32')](_0x542cd6,_0x5d2d82);};EmailChannel[_0xf5f2('0x1c')][_0xf5f2('0x33')]=function(_0x2c7f65){var _0xe62b57=this;if(this[_0xf5f2('0xf')][_0x2c7f65['id']]){if(_['isNil'](this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')])){this['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')]={};}this[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x35')]=moment();return new BPromise(function(_0xd10701,_0x3b6372){return _0xe62b57[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65)['then'](function(_0x31c3c){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')]['status']='verified';_0xe62b57['mailAccounts'][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]='';_0xe62b57['emit'](_0x2c7f65['id']);_0xd10701(_0x31c3c);})[_0xf5f2('0x2f')](function(_0xeed03d){_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x16')]=_0xf5f2('0x22');_0xe62b57[_0xf5f2('0xf')][_0x2c7f65['id']][_0xf5f2('0x34')][_0xf5f2('0x17')]=_0xeed03d;_0xe62b57[_0xf5f2('0x12')](_0x2c7f65['id']);_0x3b6372(_0xeed03d);});});}return this[_0xf5f2('0x11')][_0xf5f2('0x36')](_0x2c7f65);};module[_0xf5f2('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f1c8f38..93e2513 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 _0xa179=['autotls','required','getHost','email','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','upperFirst','exports','path','util','lodash','randomstring','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','imap','once','handleReady','bind','end','handleEnd','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xa179,0x1c1));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var Imap=require('imap');var _=require(_0x9a17('0x2'));var rs=require(_0x9a17('0x3'));var simpleParser=require('mailparser')[_0x9a17('0x4')];var Iconv=require('iconv')[_0x9a17('0x5')];var EventEmitter=require(_0x9a17('0x6'))[_0x9a17('0x7')];var utils=require(_0x9a17('0x8'));var logger=require(_0x9a17('0x9'))('email');function EmailImap(_0x40206b,_0x3149b7){this[_0x9a17('0xa')]=_0x9a17('0xb');this[_0x9a17('0xc')]=this[_0x9a17('0xd')](_0x40206b,_0x3149b7);this[_0x9a17('0xe')]=new Imap(this[_0x9a17('0xc')]);this[_0x9a17('0xe')][_0x9a17('0xf')]('ready',this[_0x9a17('0x10')][_0x9a17('0x11')](this));this['imap'][_0x9a17('0xf')](_0x9a17('0x12'),this[_0x9a17('0x13')][_0x9a17('0x11')](this));this[_0x9a17('0xe')]['on']('error',this['handleError'][_0x9a17('0x11')](this));this[_0x9a17('0xe')]['connect']();}util[_0x9a17('0x14')](EmailImap,EventEmitter);EmailImap[_0x9a17('0x15')][_0x9a17('0xd')]=function(_0x13c62b,_0x3aa8f8){var _0x15e569={'connTimeout':_0x13c62b[_0x9a17('0x16')]?_0x13c62b[_0x9a17('0x16')]*0x3e8:0x2710,'authTimeout':_0x13c62b[_0x9a17('0x17')]?_0x13c62b[_0x9a17('0x17')]*0x3e8:0x1388};if(_[_0x9a17('0x18')](_0x13c62b['service'])){if(_0x13c62b[_0x9a17('0x19')]){_0x15e569[_0x9a17('0x1a')]=_0x13c62b['user'];_0x15e569['password']=_0x13c62b[_0x9a17('0x1b')];}_0x15e569[_0x9a17('0x1c')]=_0x13c62b[_0x9a17('0x1c')];_0x15e569[_0x9a17('0x1d')]=_0x13c62b[_0x9a17('0x1d')]||0x3e1;if(_0x13c62b[_0x9a17('0x1e')]){_0x15e569[_0x9a17('0x1e')]=!![];}else{_0x15e569[_0x9a17('0x1e')]=![];_0x15e569[_0x9a17('0x1f')]=_0x9a17('0x20');}}else{_0x15e569[_0x9a17('0x1a')]=_0x13c62b[_0x9a17('0x1a')];_0x15e569[_0x9a17('0x1b')]=_0x13c62b['password'];_0x15e569['host']=utils[_0x9a17('0x21')](_0x13c62b['service']);_0x15e569[_0x9a17('0x1d')]=0x3e1;_0x15e569[_0x9a17('0x1e')]=!![];}_0x15e569[_0x9a17('0x22')]=_0x3aa8f8||_0x13c62b[_0x9a17('0x1a')]||_0x9a17('0x23');return _0x15e569;};EmailImap[_0x9a17('0x15')]['handleReady']=function(){this['imap'][_0x9a17('0x24')](this[_0x9a17('0xa')],![],this[_0x9a17('0x25')][_0x9a17('0x11')](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x25')]=function(_0xbef18a,_0x5158f7){if(_0xbef18a){this[_0x9a17('0x26')](_0xbef18a,!![]);}else{this[_0x9a17('0x27')]('box',_0x5158f7);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x355f5a){if(_0x355f5a){this[_0x9a17('0x26')](_0x355f5a,!![]);}else{this[_0x9a17('0xe')][_0x9a17('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x9a17('0xe')][_0x9a17('0x28')]([_0x9a17('0x29')],this[_0x9a17('0x2a')]['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x2a')]=function(_0x105a79,_0x4d0b6f){if(_0x105a79){this[_0x9a17('0x26')](_0x105a79,!![]);}else{if(_0x4d0b6f['length']){try{var _0x5da93b=this[_0x9a17('0xe')][_0x9a17('0x2b')](_0x4d0b6f,{'bodies':'','markSeen':!![]});_0x5da93b['on'](_0x9a17('0x2c'),this[_0x9a17('0x2d')]['bind'](this));_0x5da93b[_0x9a17('0xf')](_0x9a17('0x2e'),this[_0x9a17('0x2f')][_0x9a17('0x11')](this));_0x5da93b[_0x9a17('0xf')]('end',this['handleFetchEnd'][_0x9a17('0x11')](this));}catch(_0x1fcd0c){logger[_0x9a17('0x2e')](_0x1fcd0c);}}else{this[_0x9a17('0xe')][_0x9a17('0x30')](!![],this[_0x9a17('0x31')][_0x9a17('0x11')](this));}}};EmailImap['prototype'][_0x9a17('0x2d')]=function(_0x4c1ced,_0x23fae8){_0x4c1ced['on']('body',this[_0x9a17('0x32')][_0x9a17('0x11')](this));_0x4c1ced[_0x9a17('0xf')](_0x9a17('0x33'),this[_0x9a17('0x34')]['bind'](this));_0x4c1ced[_0x9a17('0xf')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x32')]=function(_0x3bd788,_0x3d1d1e){simpleParser(_0x3bd788,{'Iconv':Iconv},this[_0x9a17('0x35')]['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x34')]=function(_0x404590){};EmailImap[_0x9a17('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x9a17('0x15')][_0x9a17('0x35')]=function(_0x2552a9,_0xc83341){if(_0x2552a9){logger['error'](_0x2552a9);}else{var _0x354eb0=this;utils[_0x9a17('0x36')](this['account'],_0xc83341,function(_0x2e8625){_0x354eb0['emit'](_0x9a17('0x22'),_0x2e8625);});}};EmailImap[_0x9a17('0x15')][_0x9a17('0x37')]=function(){this['imap'][_0x9a17('0x30')](!![],this[_0x9a17('0x31')][_0x9a17('0x11')](this));};EmailImap['prototype'][_0x9a17('0x2f')]=function(_0x3623e3){this[_0x9a17('0x26')](_0x3623e3);this[_0x9a17('0xe')][_0x9a17('0x30')](!![],this['handleCloseBox'][_0x9a17('0x11')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x9a17('0x27')](_0x9a17('0x12'));};EmailImap[_0x9a17('0x15')][_0x9a17('0x26')]=function(_0x41ab5a,_0x5260a8){logger['error'](_0x9a17('0x26'),this[_0x9a17('0xc')][_0x9a17('0x22')],JSON[_0x9a17('0x38')](_0x41ab5a));var _0xaa8b0f='';if(_0x41ab5a){if(_0x41ab5a[_0x9a17('0x39')]){_0xaa8b0f=_0x41ab5a['textCode'];}else{for(var _0x24c072 in _0x41ab5a){if(_0x41ab5a['hasOwnProperty'](_0x24c072)){_0xaa8b0f+=_[_0x9a17('0x3a')](_0x24c072)+':\x20'+_0x41ab5a[_0x24c072]+'\x0a';}}}}if(_0x5260a8){this[_0x9a17('0xe')]['end']();}else{this[_0x9a17('0x27')](_0x9a17('0x2e'),_0xaa8b0f);this[_0x9a17('0x27')](_0x9a17('0x12'));}};module[_0x9a17('0x3b')]=EmailImap; \ No newline at end of file +var _0x2697=['prototype','connTimeout','authTimeout','isNil','authentication','user','password','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','error','handleFetchError','handleFetchMessage','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleFetchEnd','closeBox','emit','textCode','hasOwnProperty','upperFirst','exports','util','imap','lodash','randomstring','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','bind','once','handleEnd','handleError','connect','inherits'];(function(_0x317b07,_0x5628b5){var _0x37f1f4=function(_0xccbd55){while(--_0xccbd55){_0x317b07['push'](_0x317b07['shift']());}};_0x37f1f4(++_0x5628b5);}(_0x2697,0x120));var _0x7269=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x2697[_0x57975f];return _0x4793b8;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x7269('0x0'));var Imap=require(_0x7269('0x1'));var _=require(_0x7269('0x2'));var rs=require(_0x7269('0x3'));var simpleParser=require(_0x7269('0x4'))['simpleParser'];var Iconv=require(_0x7269('0x5'))['Iconv'];var EventEmitter=require(_0x7269('0x6'))[_0x7269('0x7')];var utils=require(_0x7269('0x8'));var logger=require(_0x7269('0x9'))(_0x7269('0xa'));function EmailImap(_0x1e47e3,_0x20ddbf){this[_0x7269('0xb')]=_0x7269('0xc');this[_0x7269('0xd')]=this[_0x7269('0xe')](_0x1e47e3,_0x20ddbf);this['imap']=new Imap(this[_0x7269('0xd')]);this[_0x7269('0x1')]['once'](_0x7269('0xf'),this['handleReady'][_0x7269('0x10')](this));this['imap'][_0x7269('0x11')]('end',this[_0x7269('0x12')][_0x7269('0x10')](this));this[_0x7269('0x1')]['on']('error',this[_0x7269('0x13')][_0x7269('0x10')](this));this['imap'][_0x7269('0x14')]();}util[_0x7269('0x15')](EmailImap,EventEmitter);EmailImap[_0x7269('0x16')]['getAccount']=function(_0x2ba8ec,_0x4eeb9b){var _0x2d78a0={'connTimeout':_0x2ba8ec[_0x7269('0x17')]?_0x2ba8ec[_0x7269('0x17')]*0x3e8:0x2710,'authTimeout':_0x2ba8ec[_0x7269('0x18')]?_0x2ba8ec[_0x7269('0x18')]*0x3e8:0x1388};if(_[_0x7269('0x19')](_0x2ba8ec['service'])){if(_0x2ba8ec[_0x7269('0x1a')]){_0x2d78a0[_0x7269('0x1b')]=_0x2ba8ec[_0x7269('0x1b')];_0x2d78a0[_0x7269('0x1c')]=_0x2ba8ec['password'];}_0x2d78a0['host']=_0x2ba8ec['host'];_0x2d78a0[_0x7269('0x1d')]=_0x2ba8ec[_0x7269('0x1d')]||0x3e1;if(_0x2ba8ec[_0x7269('0x1e')]){_0x2d78a0[_0x7269('0x1e')]=!![];}else{_0x2d78a0[_0x7269('0x1e')]=![];_0x2d78a0[_0x7269('0x1f')]=_0x7269('0x20');}}else{_0x2d78a0['user']=_0x2ba8ec['user'];_0x2d78a0['password']=_0x2ba8ec[_0x7269('0x1c')];_0x2d78a0['host']=utils[_0x7269('0x21')](_0x2ba8ec['service']);_0x2d78a0[_0x7269('0x1d')]=0x3e1;_0x2d78a0[_0x7269('0x1e')]=!![];}_0x2d78a0['email']=_0x4eeb9b||_0x2ba8ec[_0x7269('0x1b')]||_0x7269('0x22');return _0x2d78a0;};EmailImap['prototype'][_0x7269('0x23')]=function(){this[_0x7269('0x1')][_0x7269('0x24')](this[_0x7269('0xb')],![],this['handleOpenBox'][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x25')]=function(_0x2e6c02,_0x3392ec){if(_0x2e6c02){this[_0x7269('0x13')](_0x2e6c02,!![]);}else{this['emit'](_0x7269('0x26'),_0x3392ec);this[_0x7269('0x27')]();}};EmailImap[_0x7269('0x16')][_0x7269('0x28')]=function(_0x43f33d){if(_0x43f33d){this['handleError'](_0x43f33d,!![]);}else{this[_0x7269('0x1')][_0x7269('0x29')]();}};EmailImap['prototype'][_0x7269('0x27')]=function(){this['imap'][_0x7269('0x2a')]([_0x7269('0x2b')],this[_0x7269('0x2c')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')]['handleReadUnseen']=function(_0x43e363,_0x12448b){if(_0x43e363){this[_0x7269('0x13')](_0x43e363,!![]);}else{if(_0x12448b[_0x7269('0x2d')]){try{var _0x4a213c=this[_0x7269('0x1')][_0x7269('0x2e')](_0x12448b,{'bodies':'','markSeen':!![]});_0x4a213c['on']('message',this['handleFetchMessage'][_0x7269('0x10')](this));_0x4a213c[_0x7269('0x11')](_0x7269('0x2f'),this[_0x7269('0x30')][_0x7269('0x10')](this));_0x4a213c[_0x7269('0x11')]('end',this['handleFetchEnd'][_0x7269('0x10')](this));}catch(_0x46e31d){logger['error'](_0x46e31d);}}else{this[_0x7269('0x1')]['closeBox'](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));}}};EmailImap[_0x7269('0x16')][_0x7269('0x31')]=function(_0xb20df,_0x287452){_0xb20df['on'](_0x7269('0x32'),this['handleMessageBody'][_0x7269('0x10')](this));_0xb20df[_0x7269('0x11')]('attributes',this[_0x7269('0x33')][_0x7269('0x10')](this));_0xb20df[_0x7269('0x11')]('end',this[_0x7269('0x34')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x35')]=function(_0x487f25,_0x285274){simpleParser(_0x487f25,{'Iconv':Iconv},this[_0x7269('0x36')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x33')]=function(_0x53ccc5){};EmailImap[_0x7269('0x16')][_0x7269('0x34')]=function(){};EmailImap[_0x7269('0x16')]['handleSimpleParser']=function(_0x588b9d,_0x399efe){if(_0x588b9d){logger['error'](_0x588b9d);}else{var _0x2873fa=this;utils['parser'](this[_0x7269('0xd')],_0x399efe,function(_0x4d4a04){_0x2873fa['emit']('email',_0x4d4a04);});}};EmailImap[_0x7269('0x16')][_0x7269('0x37')]=function(){this[_0x7269('0x1')][_0x7269('0x38')](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x30')]=function(_0x1f6ae5){this[_0x7269('0x13')](_0x1f6ae5);this[_0x7269('0x1')]['closeBox'](!![],this[_0x7269('0x28')][_0x7269('0x10')](this));};EmailImap[_0x7269('0x16')][_0x7269('0x12')]=function(){this[_0x7269('0x39')](_0x7269('0x29'));};EmailImap[_0x7269('0x16')][_0x7269('0x13')]=function(_0x5ebeb7,_0x5dc295){logger[_0x7269('0x2f')](_0x7269('0x13'),this['account']['email'],JSON['stringify'](_0x5ebeb7));var _0x451725='';if(_0x5ebeb7){if(_0x5ebeb7[_0x7269('0x3a')]){_0x451725=_0x5ebeb7['textCode'];}else{for(var _0x3ae2af in _0x5ebeb7){if(_0x5ebeb7[_0x7269('0x3b')](_0x3ae2af)){_0x451725+=_[_0x7269('0x3c')](_0x3ae2af)+':\x20'+_0x5ebeb7[_0x3ae2af]+'\x0a';}}}}if(_0x5dc295){this[_0x7269('0x1')][_0x7269('0x29')]();}else{this['emit']('error',_0x451725);this[_0x7269('0x39')](_0x7269('0x29'));}};module[_0x7269('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index c554422..2c2d35e 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 _0x83b7=['use','compile','sendMail','toString','prototype','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x549490,_0xea5dd0){var _0x3a8791=function(_0x4930d4){while(--_0x4930d4){_0x549490['push'](_0x549490['shift']());}};_0x3a8791(++_0xea5dd0);}(_0x83b7,0xf8));var _0x783b=function(_0x5f1bb2,_0x3d0ec3){_0x5f1bb2=_0x5f1bb2-0x0;var _0x5b0d1e=_0x83b7[_0x5f1bb2];return _0x5b0d1e;};'use strict';var nodemailer=require(_0x783b('0x0'));var BPromise=require(_0x783b('0x1'));var inlineBase64=require(_0x783b('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x783b('0x3')]=function(_0xd35d42,_0x4945ca){return new BPromise(function(_0x51c72,_0x1fb968){var _0x31d0a3=nodemailer[_0x783b('0x4')](_0xd35d42);_0x31d0a3[_0x783b('0x5')](_0x783b('0x6'),inlineBase64());_0x31d0a3[_0x783b('0x7')](_0x4945ca,function(_0x4cf436,_0x412c64){if(_0x4cf436){_0x1fb968(_0x4cf436[_0x783b('0x8')]());}else{_0x51c72(_0x412c64);}});});};EmailSmtp[_0x783b('0x9')]['verify']=function(_0x51e3a1){return new BPromise(function(_0x366c02,_0x4ca8ea){var _0xd26ade=nodemailer[_0x783b('0x4')](_0x51e3a1);_0xd26ade['verify'](function(_0x125458,_0xb0eafc){if(_0x125458){_0x4ca8ea(_0x125458[_0x783b('0x8')]());}else{if(_0xb0eafc){_0x366c02(_0xb0eafc);}else{_0x4ca8ea('Not\x20verifired');}}});});};module[_0x783b('0xa')]=EmailSmtp; \ No newline at end of file +var _0xb3d0=['use','compile','sendMail','verify','createTransport','toString','exports','nodemailer','bluebird','send'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3d0,0xa7));var _0x0b3d=function(_0x439e2e,_0x580431){_0x439e2e=_0x439e2e-0x0;var _0x118c49=_0xb3d0[_0x439e2e];return _0x118c49;};'use strict';var nodemailer=require(_0x0b3d('0x0'));var BPromise=require(_0x0b3d('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x0b3d('0x2')]=function(_0xf24e94,_0x43c751){return new BPromise(function(_0x39b6c5,_0x10994c){var _0x4c0175=nodemailer['createTransport'](_0xf24e94);_0x4c0175[_0x0b3d('0x3')](_0x0b3d('0x4'),inlineBase64());_0x4c0175[_0x0b3d('0x5')](_0x43c751,function(_0x5c6861,_0x57e3b1){if(_0x5c6861){_0x10994c(_0x5c6861['toString']());}else{_0x39b6c5(_0x57e3b1);}});});};EmailSmtp['prototype'][_0x0b3d('0x6')]=function(_0x4fa328){return new BPromise(function(_0x4eecd9,_0x4aabeb){var _0x139fc8=nodemailer[_0x0b3d('0x7')](_0x4fa328);_0x139fc8[_0x0b3d('0x6')](function(_0x4c3c85,_0x28ea97){if(_0x4c3c85){_0x4aabeb(_0x4c3c85[_0x0b3d('0x8')]());}else{if(_0x28ea97){_0x4eecd9(_0x28ea97);}else{_0x4aabeb('Not\x20verifired');}}});});};module[_0x0b3d('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 76c7ded..23e216d 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 _0x0e3e=['date','format','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','Attachments','push','Data','getHost','gmail','yahoo','hotmail','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','html','test','replace','body','textAsHtml','0x1?_0x185fe3['pop']():'';}return'';}function getMails(_0x290266,_0x45db46){var _0xef15c8='';for(var _0x3ce4ac=0x0;_0x3ce4ac<_0x45db46[_0xe0e3('0x9')][_0xe0e3('0x10')];_0x3ce4ac+=0x1){if(_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xa')]!==_0x290266){if(!_['isEmpty'](_0xef15c8)){_0xef15c8+=',';}_0xef15c8+=_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xe')]||_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xa')]||'';_0xef15c8+='\x20<';_0xef15c8+=_0x45db46[_0xe0e3('0x9')][_0x3ce4ac]['address']?_0x45db46[_0xe0e3('0x9')][_0x3ce4ac]['address']:_0xe0e3('0xb')+random[_0xe0e3('0xc')](0x6)+'@xcally.com';_0xef15c8+='>';}}return _0xef15c8;}function parseEmail(_0x17cd83,_0x5c3401,_0x42bcd4){if(_0x5c3401[_0xe0e3('0x14')]){var _0x58fc07=/)<[^<]*)*<\/script>/gi;while(_0x58fc07[_0xe0e3('0x15')](_0x5c3401[_0xe0e3('0x14')])){_0x5c3401[_0xe0e3('0x14')]=_0x5c3401[_0xe0e3('0x14')][_0xe0e3('0x16')](_0x58fc07,'');}_0x42bcd4['body']=_0x5c3401[_0xe0e3('0x14')];}else{_0x42bcd4[_0xe0e3('0x17')]=_0x5c3401[_0xe0e3('0x18')];}if(_0x42bcd4[_0xe0e3('0x17')]){_0x42bcd4[_0xe0e3('0x17')]=_0x42bcd4[_0xe0e3('0x17')][_0xe0e3('0x16')](/Empty\x20message

';if(_0x40ed0e['Attachments']){for(var _0x152761=0x0;_0x152761<_0x40ed0e[_0xe0e3('0x34')]['length'];_0x152761++){var _0x2f5f67=_0x40ed0e[_0xe0e3('0x34')][_0x152761];_0xd0778a[_0xe0e3('0x1a')][_0xe0e3('0x20')][_0xe0e3('0x35')]({'filename':_0x2f5f67['Title'],'content':new Buffer(_0x2f5f67[_0xe0e3('0x36')])});}}}_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));});}else{_0x548d9b[_0xe0e3('0x14')]='

Empty\x20message

';_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));}}else{_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));}};exports[_0xe0e3('0x37')]=function(_0x90d7a){switch(_0x90d7a){case _0xe0e3('0x38'):return'imap.gmail.com';case _0xe0e3('0x39'):return'imap.mail.yahoo.com';case _0xe0e3('0x3a'):return'imap-mail.outlook.com';case'outlook365':return _0xe0e3('0x3b');}return _0xe0e3('0x3c');}; \ No newline at end of file +var _0xdd72=['slice','join','Anonymous','split','pop','@xcally.com','test','html','replace','body','textAsHtml','Empty\x20message

','Attachments','push','Title','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name','length'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xdd72,0xb4));var _0x2dd7=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xdd72[_0x403115];return _0x596ef3;};'use strict';var _=require(_0x2dd7('0x0'));var moment=require(_0x2dd7('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2dd7('0x2'));var util=require(_0x2dd7('0x3'));var tnef=require(_0x2dd7('0x4'));var logger=require(_0x2dd7('0x5'))(_0x2dd7('0x6'));var config=require(_0x2dd7('0x7'));function getAddress(_0x19d79b){var _0x47f7c0=_[_0x2dd7('0x8')](_0x19d79b['value']);return _0x47f7c0&&_0x47f7c0[_0x2dd7('0x9')]?_0x47f7c0[_0x2dd7('0x9')]:_0x2dd7('0xa')+random[_0x2dd7('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x48592a){var _0x42e173=_[_0x2dd7('0x8')](_0x48592a[_0x2dd7('0xc')]);if(_0x42e173&&_0x42e173[_0x2dd7('0xd')]){var _0x42eb61=_0x42e173[_0x2dd7('0xd')]['split'](/\s+/);return _0x42eb61[_0x2dd7('0xe')]?_0x42eb61[_0x2dd7('0xf')](0x0,-0x1)[_0x2dd7('0x10')]('\x20'):_0x42e173[_0x2dd7('0xd')];}return _0x2dd7('0x11');}function getLastName(_0x269984){var _0x274229=_[_0x2dd7('0x8')](_0x269984[_0x2dd7('0xc')]);if(_0x274229&&_0x274229[_0x2dd7('0xd')]){var _0x231079=_0x274229['name'][_0x2dd7('0x12')](/\s+/);return _0x231079[_0x2dd7('0xe')]>0x1?_0x231079[_0x2dd7('0x13')]():'';}return'';}function getMails(_0x436586,_0xd41ec0){var _0x1f2d65='';for(var _0x496860=0x0;_0x496860<_0xd41ec0['value']['length'];_0x496860+=0x1){if(_0xd41ec0['value'][_0x496860][_0x2dd7('0x9')]!==_0x436586){if(!_['isEmpty'](_0x1f2d65)){_0x1f2d65+=',';}_0x1f2d65+=_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0xd')]||_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]||'';_0x1f2d65+='\x20<';_0x1f2d65+=_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]?_0xd41ec0[_0x2dd7('0xc')][_0x496860][_0x2dd7('0x9')]:_0x2dd7('0xa')+random[_0x2dd7('0xb')](0x6)+_0x2dd7('0x14');_0x1f2d65+='>';}}return _0x1f2d65;}function parseEmail(_0xf1bf27,_0x1deccd,_0x545f1a){if(_0x1deccd['html']){var _0xf2d674=/)<[^<]*)*<\/script>/gi;while(_0xf2d674[_0x2dd7('0x15')](_0x1deccd[_0x2dd7('0x16')])){_0x1deccd['html']=_0x1deccd[_0x2dd7('0x16')][_0x2dd7('0x17')](_0xf2d674,'');}_0x545f1a[_0x2dd7('0x18')]=_0x1deccd[_0x2dd7('0x16')];}else{_0x545f1a[_0x2dd7('0x18')]=_0x1deccd[_0x2dd7('0x19')];}if(_0x545f1a['body']){_0x545f1a[_0x2dd7('0x18')]=_0x545f1a['body']['replace'](/0x0){if(this[_0x441d0a+_0x9260('0x20')]>0x0&&this[_0x441d0a+_0x9260('0x21')]>=this[_0x441d0a+_0x9260('0x20')]){return _0x9260('0x22');}else{return'working';}}else{return _0x9260('0x23');}};Agent[_0x9260('0x1e')][_0x9260('0x1d')]=function(){var _0x65672f=[_0x9260('0x24'),_0x9260('0x25'),'openchannel',_0x9260('0x26'),'sms'];for(var _0x39f9c3=0x0;_0x39f9c3<_0x65672f[_0x9260('0x27')];_0x39f9c3+=0x1){var _0x521d4e=this[_0x9260('0x1f')](_0x65672f[_0x39f9c3]);if(this[_0x65672f[_0x39f9c3]+_0x9260('0x28')]!==_0x521d4e){this[_0x65672f[_0x39f9c3]+'StatusTime']=_[_0x9260('0x29')](moment()['format']('x'));}this[_0x65672f[_0x39f9c3]+_0x9260('0x28')]=_0x521d4e;}var _0x364459={'id':this['id'],'name':this[_0x9260('0x9')],'online':this[_0x9260('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x9260('0xc')],'mailPause':this[_0x9260('0xd')],'smsPause':this[_0x9260('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9260('0x10')],'chatStatus':this[_0x9260('0x11')],'chatStatusTime':this[_0x9260('0x13')],'chatCapacity':this[_0x9260('0x14')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x9260('0x2a')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x9260('0x2b')],'mailCurrentCapacity':this[_0x9260('0x2c')],'faxStatus':this[_0x9260('0x16')],'faxStatusTime':this[_0x9260('0x17')],'faxCapacity':this[_0x9260('0x2d')],'faxCurrentCapacity':this[_0x9260('0x2e')],'smsStatus':this[_0x9260('0x18')],'smsStatusTime':this[_0x9260('0x2f')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9260('0x30')],'openchannelCapacity':this[_0x9260('0x1b')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x9260('0x31')],'busyQueue':this[_0x9260('0x1c')]};var _0x2e694b=md5(JSON[_0x9260('0x32')](_0x364459));if(this[_0x9260('0x2')]!==_0x2e694b){this[_0x9260('0x2')]=_0x2e694b;io['emit'](_0x9260('0x33'),_0x364459);}};module[_0x9260('0x34')]=Agent; \ No newline at end of file +var _0xe530=['unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','working','idle','prototype','chat','openchannel','fax','StatusTime','toNumber','format','Status','smsStatusTime','busy','stringify','user:save','lodash','moment','md5','ioredis','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus'];(function(_0x5a68e0,_0x538ad0){var _0x20e260=function(_0xe21285){while(--_0xe21285){_0x5a68e0['push'](_0x5a68e0['shift']());}};_0x20e260(++_0x538ad0);}(_0xe530,0x1b3));var _0x0e53=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe530[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0e53('0x0'));var moment=require(_0x0e53('0x1'));var md5=require(_0x0e53('0x2'));var Redis=require(_0x0e53('0x3'));var config=require('../../../config/environment');config[_0x0e53('0x4')]=_[_0x0e53('0x5')](config[_0x0e53('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0e53('0x4')]));function Agent(_0x3a1373){this['id']=_0x3a1373['id']||0x0;this[_0x0e53('0x6')]=_0x3a1373[_0x0e53('0x6')]||'';this[_0x0e53('0x7')]=_0x3a1373[_0x0e53('0x7')]||!![];this[_0x0e53('0x8')]=_0x3a1373[_0x0e53('0x8')]||![];this['chatPause']=_0x3a1373[_0x0e53('0x9')]||![];this['mailPause']=_0x3a1373[_0x0e53('0xa')]||![];this[_0x0e53('0xb')]=_0x3a1373[_0x0e53('0xb')]||![];this[_0x0e53('0xc')]=_0x3a1373[_0x0e53('0xc')]||![];this[_0x0e53('0xd')]=_0x3a1373['openchannelPause']||![];this[_0x0e53('0xe')]=_0x0e53('0xf');this[_0x0e53('0x10')]=0x0;this['chatCapacity']=_0x3a1373['chatCapacity']||0x0;this[_0x0e53('0x11')]=0x0;this[_0x0e53('0x12')]=_0x0e53('0xf');this[_0x0e53('0x13')]=0x0;this[_0x0e53('0x14')]=_0x3a1373[_0x0e53('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x0e53('0x15')]=_0x0e53('0xf');this[_0x0e53('0x16')]=0x0;this[_0x0e53('0x17')]=_0x3a1373[_0x0e53('0x17')]||0x0;this[_0x0e53('0x18')]=0x0;this['smsStatus']=_0x0e53('0xf');this['smsStatusTime']=0x0;this[_0x0e53('0x19')]=_0x3a1373[_0x0e53('0x19')]||0x0;this[_0x0e53('0x1a')]=0x0;this[_0x0e53('0x1b')]='unknown';this[_0x0e53('0x1c')]=0x0;this[_0x0e53('0x1d')]=_0x3a1373[_0x0e53('0x1d')]||0x0;this[_0x0e53('0x1e')]=0x0;this['busy']=![];this[_0x0e53('0x1f')]=undefined;this[_0x0e53('0x2')]='';this[_0x0e53('0x20')]();}Agent['prototype'][_0x0e53('0x21')]=function(_0x48cc4c){if(this[_0x48cc4c+_0x0e53('0x22')]>0x0){if(this[_0x48cc4c+_0x0e53('0x23')]>0x0&&this[_0x48cc4c+'CurrentCapacity']>=this[_0x48cc4c+_0x0e53('0x23')]){return'maxcapacity';}else{return _0x0e53('0x24');}}else{return _0x0e53('0x25');}};Agent[_0x0e53('0x26')][_0x0e53('0x20')]=function(){var _0x3a6701=['mail',_0x0e53('0x27'),_0x0e53('0x28'),_0x0e53('0x29'),'sms'];for(var _0x38d359=0x0;_0x38d359<_0x3a6701['length'];_0x38d359+=0x1){var _0x7cb09b=this[_0x0e53('0x21')](_0x3a6701[_0x38d359]);if(this[_0x3a6701[_0x38d359]+'Status']!==_0x7cb09b){this[_0x3a6701[_0x38d359]+_0x0e53('0x2a')]=_[_0x0e53('0x2b')](moment()[_0x0e53('0x2c')]('x'));}this[_0x3a6701[_0x38d359]+_0x0e53('0x2d')]=_0x7cb09b;}var _0x4120b1={'id':this['id'],'name':this[_0x0e53('0x6')],'online':this[_0x0e53('0x7')],'voicePause':this[_0x0e53('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x0e53('0xa')],'smsPause':this[_0x0e53('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x0e53('0xd')],'chatStatus':this[_0x0e53('0xe')],'chatStatusTime':this[_0x0e53('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x0e53('0x11')],'mailStatus':this[_0x0e53('0x12')],'mailStatusTime':this[_0x0e53('0x13')],'mailCapacity':this[_0x0e53('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x0e53('0x17')],'faxCurrentCapacity':this[_0x0e53('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x0e53('0x2e')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x0e53('0x1a')],'openchannelStatus':this[_0x0e53('0x1b')],'openchannelStatusTime':this[_0x0e53('0x1c')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x0e53('0x1e')],'busy':this[_0x0e53('0x2f')],'busyQueue':this['busyQueue']};var _0x515008=md5(JSON[_0x0e53('0x30')](_0x4120b1));if(this[_0x0e53('0x2')]!==_0x515008){this[_0x0e53('0x2')]=_0x515008;io['emit'](_0x0e53('0x31'),_0x4120b1);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 66d7fd9..b7565ac 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 _0xf2ee=['strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','online','chatPause','available','stringify','chat:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x1d432d,_0x401149){var _0x338acb=function(_0x194623){while(--_0x194623){_0x1d432d['push'](_0x1d432d['shift']());}};_0x338acb(++_0x401149);}(_0xf2ee,0x84));var _0xef2e=function(_0x289f62,_0x8a1eec){_0x289f62=_0x289f62-0x0;var _0x2630c5=_0xf2ee[_0x289f62];return _0x2630c5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xef2e('0x0'));var Redis=require(_0xef2e('0x1'));var config=require(_0xef2e('0x2'));config[_0xef2e('0x3')]=_['defaults'](config[_0xef2e('0x3')],{'host':_0xef2e('0x4'),'port':0x18eb});var io=require(_0xef2e('0x5'))(new Redis(config[_0xef2e('0x3')]));function ChatQueue(_0x189cd9){this['id']=_0x189cd9['id']||0x0;this[_0xef2e('0x6')]=_0x189cd9[_0xef2e('0x6')]||'';this['timeout']=_0x189cd9[_0xef2e('0x7')]||0xa;this[_0xef2e('0x8')]=_0x189cd9[_0xef2e('0x8')]||_0xef2e('0x9');this[_0xef2e('0xa')]=_0x189cd9[_0xef2e('0xa')];this[_0xef2e('0xb')]={};this[_0xef2e('0xc')]=0x0;this[_0xef2e('0xd')]='';this['updateRouting']();this[_0xef2e('0xe')]();}ChatQueue[_0xef2e('0xf')][_0xef2e('0x10')]=function(){var _0x13bd9b=this[_0xef2e('0xb')]['_rr'];this[_0xef2e('0xb')]=_[_0xef2e('0x11')](this[_0xef2e('0xa')],'id');this['mapAgentsId'][_0xef2e('0x12')]=_0x13bd9b;};ChatQueue[_0xef2e('0xf')][_0xef2e('0xe')]=function(){this[_0xef2e('0x13')]=0x0;this[_0xef2e('0x14')]=0x0;for(var _0x2e3c15=0x0;_0x2e3c15=0x0?this['available']:0x0;var _0x143907={'id':this['id'],'available':this[_0xef2e('0x17')],'loggedIn':this[_0xef2e('0x13')],'name':this[_0xef2e('0x6')],'paused':this[_0xef2e('0x14')],'waiting':this[_0xef2e('0xc')]};var _0x492ee7=md5(JSON[_0xef2e('0x18')](_0x143907));if(this[_0xef2e('0xd')]!==_0x492ee7){this[_0xef2e('0xd')]=_0x492ee7;io['to'](util['format'](_0xef2e('0x19'),_0x143907['name']))[_0xef2e('0x1a')]('chat_queue:save',_0x143907);}};module[_0xef2e('0x1b')]=ChatQueue; \ No newline at end of file +var _0x5cdb=['chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x5759d2,_0x1ce909){var _0x5d10df=function(_0x4fc64f){while(--_0x4fc64f){_0x5759d2['push'](_0x5759d2['shift']());}};_0x5d10df(++_0x1ce909);}(_0x5cdb,0x1d8));var _0xb5cd=function(_0x40a121,_0x2d6b96){_0x40a121=_0x40a121-0x0;var _0x501d92=_0x5cdb[_0x40a121];return _0x501d92;};'use strict';var _=require('lodash');var md5=require(_0xb5cd('0x0'));var util=require(_0xb5cd('0x1'));var Redis=require(_0xb5cd('0x2'));var config=require(_0xb5cd('0x3'));config[_0xb5cd('0x4')]=_['defaults'](config[_0xb5cd('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb5cd('0x5'))(new Redis(config[_0xb5cd('0x4')]));function ChatQueue(_0x1f0319){this['id']=_0x1f0319['id']||0x0;this[_0xb5cd('0x6')]=_0x1f0319[_0xb5cd('0x6')]||'';this[_0xb5cd('0x7')]=_0x1f0319[_0xb5cd('0x7')]||0xa;this['strategy']=_0x1f0319['strategy']||_0xb5cd('0x8');this[_0xb5cd('0x9')]=_0x1f0319['Agents'];this[_0xb5cd('0xa')]={};this[_0xb5cd('0xb')]=0x0;this[_0xb5cd('0x0')]='';this[_0xb5cd('0xc')]();this[_0xb5cd('0xd')]();}ChatQueue[_0xb5cd('0xe')][_0xb5cd('0xc')]=function(){var _0x45c9c2=this['mapAgentsId'][_0xb5cd('0xf')];this[_0xb5cd('0xa')]=_[_0xb5cd('0x10')](this[_0xb5cd('0x9')],'id');this[_0xb5cd('0xa')][_0xb5cd('0xf')]=_0x45c9c2;};ChatQueue[_0xb5cd('0xe')][_0xb5cd('0xd')]=function(){this[_0xb5cd('0x11')]=0x0;this[_0xb5cd('0x12')]=0x0;for(var _0x562cf0=0x0;_0x562cf0=0x0?this[_0xb5cd('0x16')]:0x0;var _0x583129={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xb5cd('0x6')],'paused':this[_0xb5cd('0x12')],'waiting':this['waiting']};var _0x2075bb=md5(JSON[_0xb5cd('0x17')](_0x583129));if(this['md5']!==_0x2075bb){this[_0xb5cd('0x0')]=_0x2075bb;io['to'](util[_0xb5cd('0x18')](_0xb5cd('0x19'),_0x583129['name']))[_0xb5cd('0x1a')](_0xb5cd('0x1b'),_0x583129);}};module[_0xb5cd('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 a54a484..98d6d9a 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 _0x3b25=['paused','waiting','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','online','faxPause','available'];(function(_0x5c7649,_0x5ef05f){var _0x26f229=function(_0x3f0e83){while(--_0x3f0e83){_0x5c7649['push'](_0x5c7649['shift']());}};_0x26f229(++_0x5ef05f);}(_0x3b25,0x13b));var _0x53b2=function(_0x51df41,_0x2d43bd){_0x51df41=_0x51df41-0x0;var _0x29d21a=_0x3b25[_0x51df41];return _0x29d21a;};'use strict';var _=require(_0x53b2('0x0'));var md5=require(_0x53b2('0x1'));var util=require(_0x53b2('0x2'));var Redis=require(_0x53b2('0x3'));var config=require(_0x53b2('0x4'));config['redis']=_[_0x53b2('0x5')](config[_0x53b2('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53b2('0x6')]));function FaxQueue(_0x34fa19){this['id']=_0x34fa19['id']||0x0;this[_0x53b2('0x7')]=_0x34fa19[_0x53b2('0x7')]||'';this[_0x53b2('0x8')]=_0x34fa19[_0x53b2('0x8')]||0xa;this[_0x53b2('0x9')]=_0x34fa19[_0x53b2('0x9')]||_0x53b2('0xa');this[_0x53b2('0xb')]=_0x34fa19[_0x53b2('0xb')];this[_0x53b2('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x53b2('0xd')]();this[_0x53b2('0xe')]();}FaxQueue[_0x53b2('0xf')][_0x53b2('0xd')]=function(){var _0x55699e=this[_0x53b2('0xc')][_0x53b2('0x10')];this[_0x53b2('0xc')]=_['map'](this['Agents'],'id');this[_0x53b2('0xc')][_0x53b2('0x10')]=_0x55699e;};FaxQueue[_0x53b2('0xf')][_0x53b2('0xe')]=function(){this[_0x53b2('0x11')]=0x0;this['paused']=0x0;for(var _0x41b86d=0x0;_0x41b86d=0x0?this[_0x53b2('0x14')]:0x0;var _0x2b8a6b={'id':this['id'],'available':this[_0x53b2('0x14')],'loggedIn':this[_0x53b2('0x11')],'name':this[_0x53b2('0x7')],'paused':this[_0x53b2('0x15')],'waiting':this[_0x53b2('0x16')]};var _0x249840=md5(JSON[_0x53b2('0x17')](_0x2b8a6b));if(this[_0x53b2('0x1')]!==_0x249840){this[_0x53b2('0x1')]=_0x249840;io['to'](util[_0x53b2('0x18')](_0x53b2('0x19'),_0x2b8a6b[_0x53b2('0x7')]))[_0x53b2('0x1a')]('fax_queue:save',_0x2b8a6b);}};module[_0x53b2('0x1b')]=FaxQueue; \ No newline at end of file +var _0x4ae9=['paused','available','waiting','stringify','format','fax:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','faxPause'];(function(_0x4889b9,_0x291cbc){var _0x246b53=function(_0x177f47){while(--_0x177f47){_0x4889b9['push'](_0x4889b9['shift']());}};_0x246b53(++_0x291cbc);}(_0x4ae9,0x164));var _0x94ae=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0x4ae9[_0x18d710];return _0x54f4eb;};'use strict';var _=require('lodash');var md5=require(_0x94ae('0x0'));var util=require(_0x94ae('0x1'));var Redis=require(_0x94ae('0x2'));var config=require(_0x94ae('0x3'));config['redis']=_[_0x94ae('0x4')](config['redis'],{'host':_0x94ae('0x5'),'port':0x18eb});var io=require(_0x94ae('0x6'))(new Redis(config['redis']));function FaxQueue(_0x10a5d9){this['id']=_0x10a5d9['id']||0x0;this[_0x94ae('0x7')]=_0x10a5d9[_0x94ae('0x7')]||'';this['timeout']=_0x10a5d9[_0x94ae('0x8')]||0xa;this[_0x94ae('0x9')]=_0x10a5d9[_0x94ae('0x9')]||_0x94ae('0xa');this[_0x94ae('0xb')]=_0x10a5d9[_0x94ae('0xb')];this[_0x94ae('0xc')]={};this['waiting']=0x0;this[_0x94ae('0x0')]='';this[_0x94ae('0xd')]();this[_0x94ae('0xe')]();}FaxQueue[_0x94ae('0xf')][_0x94ae('0xd')]=function(){var _0x41a083=this['mapAgentsId'][_0x94ae('0x10')];this[_0x94ae('0xc')]=_[_0x94ae('0x11')](this[_0x94ae('0xb')],'id');this[_0x94ae('0xc')][_0x94ae('0x10')]=_0x41a083;};FaxQueue[_0x94ae('0xf')][_0x94ae('0xe')]=function(){this[_0x94ae('0x12')]=0x0;this['paused']=0x0;for(var _0x3a8da9=0x0;_0x3a8da9=0x0?this['available']:0x0;var _0x36fe77={'id':this['id'],'available':this[_0x94ae('0x16')],'loggedIn':this[_0x94ae('0x12')],'name':this[_0x94ae('0x7')],'paused':this[_0x94ae('0x15')],'waiting':this[_0x94ae('0x17')]};var _0x53780b=md5(JSON[_0x94ae('0x18')](_0x36fe77));if(this['md5']!==_0x53780b){this['md5']=_0x53780b;io['to'](util[_0x94ae('0x19')](_0x94ae('0x1a'),_0x36fe77['name']))[_0x94ae('0x1b')]('fax_queue:save',_0x36fe77);}};module[_0x94ae('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b82c1b6..fd43df7 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 _0xbd72=['Intervals','exports'];(function(_0x435cb6,_0x152acc){var _0x1dc78e=function(_0x41768a){while(--_0x41768a){_0x435cb6['push'](_0x435cb6['shift']());}};_0x1dc78e(++_0x152acc);}(_0xbd72,0xc6));var _0x2bd7=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xbd72[_0x2fd69d];return _0x5d5ef3;};'use strict';function Interval(_0x58dd59){this['id']=_0x58dd59['id']||0x0;this['name']=_0x58dd59['name']||'';this[_0x2bd7('0x0')]=_0x58dd59[_0x2bd7('0x0')]||{};}module[_0x2bd7('0x1')]=Interval; \ No newline at end of file +var _0xbcae=['exports','name','Intervals'];(function(_0x4fccad,_0x3447af){var _0x9646ea=function(_0xde4e5f){while(--_0xde4e5f){_0x4fccad['push'](_0x4fccad['shift']());}};_0x9646ea(++_0x3447af);}(_0xbcae,0xa9));var _0xebca=function(_0x3f2360,_0xe2994f){_0x3f2360=_0x3f2360-0x0;var _0x5a56e0=_0xbcae[_0x3f2360];return _0x5a56e0;};'use strict';function Interval(_0x368872){this['id']=_0x368872['id']||0x0;this[_0xebca('0x0')]=_0x368872[_0xebca('0x0')]||'';this[_0xebca('0x1')]=_0x368872[_0xebca('0x1')]||{};}module[_0xebca('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 c0e5dc4..5ec7e64 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 _0x36f3=['available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','loggedIn','paused','length','online','mailPause'];(function(_0x4c9a82,_0x757638){var _0x1ffeab=function(_0x1f93e8){while(--_0x1f93e8){_0x4c9a82['push'](_0x4c9a82['shift']());}};_0x1ffeab(++_0x757638);}(_0x36f3,0xe6));var _0x336f=function(_0x4dddcc,_0x5dae19){_0x4dddcc=_0x4dddcc-0x0;var _0x2e9da1=_0x36f3[_0x4dddcc];return _0x2e9da1;};'use strict';var _=require('lodash');var md5=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var Redis=require(_0x336f('0x2'));var config=require(_0x336f('0x3'));config[_0x336f('0x4')]=_[_0x336f('0x5')](config[_0x336f('0x4')],{'host':_0x336f('0x6'),'port':0x18eb});var io=require(_0x336f('0x7'))(new Redis(config['redis']));function MailQueue(_0x40df1c){this['id']=_0x40df1c['id']||0x0;this[_0x336f('0x8')]=_0x40df1c[_0x336f('0x8')]||'';this['timeout']=_0x40df1c['timeout']||0xa;this[_0x336f('0x9')]=_0x40df1c[_0x336f('0x9')]||_0x336f('0xa');this[_0x336f('0xb')]=_0x40df1c[_0x336f('0xb')];this[_0x336f('0xc')]={};this[_0x336f('0xd')]=0x0;this[_0x336f('0x0')]='';this['updateRouting']();this[_0x336f('0xe')]();}MailQueue[_0x336f('0xf')][_0x336f('0x10')]=function(){var _0x15db54=this['mapAgentsId']['_rr'];this[_0x336f('0xc')]=_['map'](this[_0x336f('0xb')],'id');this[_0x336f('0xc')]['_rr']=_0x15db54;};MailQueue[_0x336f('0xf')][_0x336f('0xe')]=function(){this[_0x336f('0x11')]=0x0;this[_0x336f('0x12')]=0x0;for(var _0x12c5e0=0x0;_0x12c5e0=0x0?this[_0x336f('0x16')]:0x0;var _0x2d89d5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x336f('0x11')],'name':this[_0x336f('0x8')],'paused':this[_0x336f('0x12')],'waiting':this['waiting']};var _0x1eb065=md5(JSON[_0x336f('0x17')](_0x2d89d5));if(this['md5']!==_0x1eb065){this[_0x336f('0x0')]=_0x1eb065;io['to'](util[_0x336f('0x18')](_0x336f('0x19'),_0x2d89d5[_0x336f('0x8')]))['emit'](_0x336f('0x1a'),_0x2d89d5);}};module[_0x336f('0x1b')]=MailQueue; \ No newline at end of file +var _0x0b78=['mail_queue:save','exports','md5','util','ioredis','redis','defaults','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','paused','mailPause','available','stringify','format','mail:queue:%s','emit'];(function(_0x11547d,_0x56e3c0){var _0x243747=function(_0x24bf71){while(--_0x24bf71){_0x11547d['push'](_0x11547d['shift']());}};_0x243747(++_0x56e3c0);}(_0x0b78,0x1d6));var _0x80b7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0b78[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var md5=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var Redis=require(_0x80b7('0x2'));var config=require('../../../config/environment');config[_0x80b7('0x3')]=_[_0x80b7('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x80b7('0x3')]));function MailQueue(_0x1de182){this['id']=_0x1de182['id']||0x0;this[_0x80b7('0x5')]=_0x1de182[_0x80b7('0x5')]||'';this[_0x80b7('0x6')]=_0x1de182[_0x80b7('0x6')]||0xa;this['strategy']=_0x1de182[_0x80b7('0x7')]||_0x80b7('0x8');this[_0x80b7('0x9')]=_0x1de182['Agents'];this['mapAgentsId']={};this[_0x80b7('0xa')]=0x0;this['md5']='';this[_0x80b7('0xb')]();this[_0x80b7('0xc')]();}MailQueue['prototype'][_0x80b7('0xb')]=function(){var _0x33da41=this[_0x80b7('0xd')][_0x80b7('0xe')];this['mapAgentsId']=_['map'](this[_0x80b7('0x9')],'id');this[_0x80b7('0xd')][_0x80b7('0xe')]=_0x33da41;};MailQueue[_0x80b7('0xf')][_0x80b7('0xc')]=function(){this[_0x80b7('0x10')]=0x0;this[_0x80b7('0x11')]=0x0;for(var _0x32cecc=0x0;_0x32cecc=0x0?this[_0x80b7('0x13')]:0x0;var _0x3b27ac={'id':this['id'],'available':this[_0x80b7('0x13')],'loggedIn':this[_0x80b7('0x10')],'name':this[_0x80b7('0x5')],'paused':this['paused'],'waiting':this[_0x80b7('0xa')]};var _0xa1d6c6=md5(JSON[_0x80b7('0x14')](_0x3b27ac));if(this[_0x80b7('0x0')]!==_0xa1d6c6){this[_0x80b7('0x0')]=_0xa1d6c6;io['to'](util[_0x80b7('0x15')](_0x80b7('0x16'),_0x3b27ac[_0x80b7('0x5')]))[_0x80b7('0x17')](_0x80b7('0x18'),_0x3b27ac);}};module[_0x80b7('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 77b1b79..d53e2cb 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 _0xe3f5=['lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRealtime','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xe3f5,0x118));var _0x5e3f=function(_0x562cb9,_0x52752d){_0x562cb9=_0x562cb9-0x0;var _0x4de0e3=_0xe3f5[_0x562cb9];return _0x4de0e3;};'use strict';var _=require(_0x5e3f('0x0'));var md5=require('md5');var util=require(_0x5e3f('0x1'));var Redis=require(_0x5e3f('0x2'));var config=require(_0x5e3f('0x3'));config[_0x5e3f('0x4')]=_[_0x5e3f('0x5')](config['redis'],{'host':_0x5e3f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e3f('0x4')]));function OpenchannelQueue(_0x3ecfee){this['id']=_0x3ecfee['id']||0x0;this['name']=_0x3ecfee[_0x5e3f('0x7')]||'';this['timeout']=_0x3ecfee[_0x5e3f('0x8')]||0xa;this[_0x5e3f('0x9')]=_0x3ecfee[_0x5e3f('0x9')]||_0x5e3f('0xa');this['Agents']=_0x3ecfee[_0x5e3f('0xb')];this[_0x5e3f('0xc')]={};this['waiting']=0x0;this[_0x5e3f('0xd')]='';this['updateRouting']();this[_0x5e3f('0xe')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x2ef445=this[_0x5e3f('0xc')][_0x5e3f('0xf')];this[_0x5e3f('0xc')]=_[_0x5e3f('0x10')](this[_0x5e3f('0xb')],'id');this[_0x5e3f('0xc')][_0x5e3f('0xf')]=_0x2ef445;};OpenchannelQueue['prototype'][_0x5e3f('0xe')]=function(){this[_0x5e3f('0x11')]=0x0;this[_0x5e3f('0x12')]=0x0;for(var _0x3c7427=0x0;_0x3c7427=0x0?this['available']:0x0;var _0x244c5a={'id':this['id'],'available':this[_0x5e3f('0x16')],'loggedIn':this[_0x5e3f('0x11')],'name':this[_0x5e3f('0x7')],'paused':this[_0x5e3f('0x12')],'waiting':this['waiting']};var _0x5b4169=md5(JSON[_0x5e3f('0x17')](_0x244c5a));if(this[_0x5e3f('0xd')]!==_0x5b4169){this[_0x5e3f('0xd')]=_0x5b4169;io['to'](util[_0x5e3f('0x18')](_0x5e3f('0x19'),_0x244c5a[_0x5e3f('0x7')]))[_0x5e3f('0x1a')](_0x5e3f('0x1b'),_0x244c5a);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x2d76=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','length','online','loggedIn','paused','available','md5','format','openchannel_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x2d76,0x146));var _0x62d7=function(_0x85fdb5,_0x3186cb){_0x85fdb5=_0x85fdb5-0x0;var _0x1eb3d9=_0x2d76[_0x85fdb5];return _0x1eb3d9;};'use strict';var _=require(_0x62d7('0x0'));var md5=require('md5');var util=require(_0x62d7('0x1'));var Redis=require('ioredis');var config=require(_0x62d7('0x2'));config[_0x62d7('0x3')]=_[_0x62d7('0x4')](config['redis'],{'host':_0x62d7('0x5'),'port':0x18eb});var io=require(_0x62d7('0x6'))(new Redis(config[_0x62d7('0x3')]));function OpenchannelQueue(_0x437d3f){this['id']=_0x437d3f['id']||0x0;this[_0x62d7('0x7')]=_0x437d3f[_0x62d7('0x7')]||'';this[_0x62d7('0x8')]=_0x437d3f['timeout']||0xa;this[_0x62d7('0x9')]=_0x437d3f[_0x62d7('0x9')]||_0x62d7('0xa');this['Agents']=_0x437d3f[_0x62d7('0xb')];this[_0x62d7('0xc')]={};this[_0x62d7('0xd')]=0x0;this['md5']='';this[_0x62d7('0xe')]();this[_0x62d7('0xf')]();}OpenchannelQueue[_0x62d7('0x10')]['updateRouting']=function(){var _0x31b1df=this[_0x62d7('0xc')][_0x62d7('0x11')];this[_0x62d7('0xc')]=_[_0x62d7('0x12')](this[_0x62d7('0xb')],'id');this[_0x62d7('0xc')][_0x62d7('0x11')]=_0x31b1df;};OpenchannelQueue[_0x62d7('0x10')][_0x62d7('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x438781=0x0;_0x438781=0x0?this[_0x62d7('0x17')]:0x0;var _0x5e28cf={'id':this['id'],'available':this[_0x62d7('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x62d7('0x7')],'paused':this[_0x62d7('0x16')],'waiting':this[_0x62d7('0xd')]};var _0x59d397=md5(JSON['stringify'](_0x5e28cf));if(this[_0x62d7('0x18')]!==_0x59d397){this[_0x62d7('0x18')]=_0x59d397;io['to'](util[_0x62d7('0x19')]('openchannel:queue:%s',_0x5e28cf[_0x62d7('0x7')]))['emit'](_0x62d7('0x1a'),_0x5e28cf);}};module[_0x62d7('0x1b')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 70a9d1a..922e8a7 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 _0xbad1=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','format','sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy'];(function(_0xc383be,_0x194a13){var _0x4fa994=function(_0x4ecb85){while(--_0x4ecb85){_0xc383be['push'](_0xc383be['shift']());}};_0x4fa994(++_0x194a13);}(_0xbad1,0x197));var _0x1bad=function(_0x4e0a01,_0x7d15ff){_0x4e0a01=_0x4e0a01-0x0;var _0x1aa533=_0xbad1[_0x4e0a01];return _0x1aa533;};'use strict';var _=require(_0x1bad('0x0'));var md5=require(_0x1bad('0x1'));var util=require(_0x1bad('0x2'));var Redis=require('ioredis');var config=require(_0x1bad('0x3'));config[_0x1bad('0x4')]=_['defaults'](config[_0x1bad('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x1bad('0x5'))(new Redis(config[_0x1bad('0x4')]));function SmsQueue(_0x868451){this['id']=_0x868451['id']||0x0;this[_0x1bad('0x6')]=_0x868451[_0x1bad('0x6')]||'';this['timeout']=_0x868451[_0x1bad('0x7')]||0xa;this[_0x1bad('0x8')]=_0x868451[_0x1bad('0x8')]||_0x1bad('0x9');this[_0x1bad('0xa')]=_0x868451[_0x1bad('0xa')];this[_0x1bad('0xb')]={};this[_0x1bad('0xc')]=0x0;this[_0x1bad('0x1')]='';this[_0x1bad('0xd')]();this[_0x1bad('0xe')]();}SmsQueue[_0x1bad('0xf')][_0x1bad('0xd')]=function(){var _0x5709bf=this[_0x1bad('0xb')][_0x1bad('0x10')];this['mapAgentsId']=_[_0x1bad('0x11')](this['Agents'],'id');this[_0x1bad('0xb')]['_rr']=_0x5709bf;};SmsQueue['prototype'][_0x1bad('0xe')]=function(){this[_0x1bad('0x12')]=0x0;this[_0x1bad('0x13')]=0x0;for(var _0x33b513=0x0;_0x33b513=0x0?this[_0x1bad('0x16')]:0x0;var _0x4b0c9a={'id':this['id'],'available':this[_0x1bad('0x16')],'loggedIn':this[_0x1bad('0x12')],'name':this[_0x1bad('0x6')],'paused':this[_0x1bad('0x13')],'waiting':this[_0x1bad('0xc')]};var _0x199109=md5(JSON['stringify'](_0x4b0c9a));if(this[_0x1bad('0x1')]!==_0x199109){this[_0x1bad('0x1')]=_0x199109;io['to'](util[_0x1bad('0x17')]('sms:queue:%s',_0x4b0c9a['name']))['emit'](_0x1bad('0x18'),_0x4b0c9a);}};module[_0x1bad('0x19')]=SmsQueue; \ No newline at end of file +var _0xb44a=['format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','smsPause','available'];(function(_0x96dc84,_0x4cc9a3){var _0xb5baed=function(_0x16ce18){while(--_0x16ce18){_0x96dc84['push'](_0x96dc84['shift']());}};_0xb5baed(++_0x4cc9a3);}(_0xb44a,0x138));var _0xab44=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0xb44a[_0x4664db];return _0x5615b4;};'use strict';var _=require(_0xab44('0x0'));var md5=require(_0xab44('0x1'));var util=require(_0xab44('0x2'));var Redis=require(_0xab44('0x3'));var config=require(_0xab44('0x4'));config[_0xab44('0x5')]=_['defaults'](config[_0xab44('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xab44('0x6'))(new Redis(config[_0xab44('0x5')]));function SmsQueue(_0x2ecf98){this['id']=_0x2ecf98['id']||0x0;this['name']=_0x2ecf98[_0xab44('0x7')]||'';this[_0xab44('0x8')]=_0x2ecf98['timeout']||0xa;this[_0xab44('0x9')]=_0x2ecf98['strategy']||_0xab44('0xa');this[_0xab44('0xb')]=_0x2ecf98[_0xab44('0xb')];this[_0xab44('0xc')]={};this[_0xab44('0xd')]=0x0;this['md5']='';this[_0xab44('0xe')]();this[_0xab44('0xf')]();}SmsQueue['prototype'][_0xab44('0xe')]=function(){var _0x380e53=this[_0xab44('0xc')][_0xab44('0x10')];this[_0xab44('0xc')]=_[_0xab44('0x11')](this[_0xab44('0xb')],'id');this[_0xab44('0xc')]['_rr']=_0x380e53;};SmsQueue[_0xab44('0x12')][_0xab44('0xf')]=function(){this[_0xab44('0x13')]=0x0;this[_0xab44('0x14')]=0x0;for(var _0x5de838=0x0;_0x5de838=0x0?this[_0xab44('0x17')]:0x0;var _0x4d5aec={'id':this['id'],'available':this['available'],'loggedIn':this[_0xab44('0x13')],'name':this[_0xab44('0x7')],'paused':this[_0xab44('0x14')],'waiting':this[_0xab44('0xd')]};var _0x33b5d1=md5(JSON['stringify'](_0x4d5aec));if(this[_0xab44('0x1')]!==_0x33b5d1){this[_0xab44('0x1')]=_0x33b5d1;io['to'](util[_0xab44('0x18')](_0xab44('0x19'),_0x4d5aec['name']))['emit'](_0xab44('0x1a'),_0x4d5aec);}};module[_0xab44('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 6ca77ec..524a946 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 _0xd3c0=['initFaxQueues','exports','util','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','hasOwnProperty','length','isUndefined','mergeFromDatabase','initIntervals','intervals','initOpenchannelQueues','updateRouting','updateRealtime','chatQueues','initSmsQueues','initMailQueues'];(function(_0x439845,_0x2b5861){var _0x19bf9b=function(_0x3dd6b6){while(--_0x3dd6b6){_0x439845['push'](_0x439845['shift']());}};_0x19bf9b(++_0x2b5861);}(_0xd3c0,0x160));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x0d3c('0x0'));var _=require(_0x0d3c('0x1'));var moment=require(_0x0d3c('0x2'));var Agent=require(_0x0d3c('0x3'));var Interval=require(_0x0d3c('0x4'));var OpenchannelQueue=require(_0x0d3c('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x0d3c('0x6'));var MailQueue=require(_0x0d3c('0x7'));var FaxQueue=require(_0x0d3c('0x8'));var Realtime=function(){this[_0x0d3c('0x9')]={};this['intervals']={};this[_0x0d3c('0xa')]={};this['chatQueues']={};this[_0x0d3c('0xb')]={};this[_0x0d3c('0xc')]={};this[_0x0d3c('0xd')]={};this[_0x0d3c('0xe')]={};this[_0x0d3c('0xf')]={};this[_0x0d3c('0x10')]={};this[_0x0d3c('0x11')]={};this[_0x0d3c('0x12')]={};};function freeIsNotKey(_0x489e63,_0x1b08a9,_0x4e3b51){var _0xaeebae=_[_0x0d3c('0x13')](_0x489e63,function(_0x5db01e,_0x29f977){return _0x5db01e[_0x4e3b51];});for(var _0x95474a in _0x1b08a9){if(_0x1b08a9['hasOwnProperty'](_0x95474a)){if(!_0xaeebae[_0x95474a]){delete _0x1b08a9[_0x95474a];}}}}Realtime[_0x0d3c('0x14')]['mergeFromDatabase']=function(_0x37b0d0,_0x4c9084){for(var _0x2ab9ef in _0x4c9084){if(_0x37b0d0[_0x0d3c('0x15')](_0x2ab9ef)){_0x37b0d0[_0x2ab9ef]=_0x4c9084[_0x2ab9ef];}}};Realtime[_0x0d3c('0x14')]['initAgents']=function(){var _0x4bd59b=this;return function(_0x4a8f99){if(_0x4a8f99){freeIsNotKey(_0x4a8f99,_0x4bd59b[_0x0d3c('0x9')],'id');for(var _0x4c2dea=0x0,_0x44d46f={},_0x4cfce9={};_0x4c2dea<_0x4a8f99[_0x0d3c('0x16')];_0x4c2dea+=0x1){_0x44d46f=_0x4a8f99[_0x4c2dea];if(_[_0x0d3c('0x17')](_0x4bd59b['agents'][_0x44d46f['id']])){_0x4bd59b[_0x0d3c('0x9')][_0x44d46f['id']]=new Agent(_0x44d46f);}else{_0x4bd59b[_0x0d3c('0x18')](_0x4bd59b[_0x0d3c('0x9')][_0x44d46f['id']],_0x44d46f);}}}return _0x4bd59b['agents'];};};Realtime['prototype'][_0x0d3c('0x19')]=function(){var _0xf2bca4=this;return function(_0x295c15){if(_0x295c15){freeIsNotKey(_0x295c15,_0xf2bca4['intervals'],'id');for(var _0x58162e=0x0,_0xce6307={},_0x20ed88={};_0x58162e<_0x295c15[_0x0d3c('0x16')];_0x58162e+=0x1){_0xce6307=_0x295c15[_0x58162e];if(_['isUndefined'](_0xf2bca4[_0x0d3c('0x1a')][_0xce6307['id']])){_0xf2bca4[_0x0d3c('0x1a')][_0xce6307['id']]=new Interval(_0xce6307);}else{_0xf2bca4['mergeFromDatabase'](_0xf2bca4['intervals'][_0xce6307['id']],_0xce6307);}}}return _0xf2bca4[_0x0d3c('0x1a')];};};Realtime['prototype'][_0x0d3c('0x1b')]=function(){var _0x3147fe=this;return function(_0x1283a9){if(_0x1283a9){freeIsNotKey(_0x1283a9,_0x3147fe[_0x0d3c('0xa')],'id');for(var _0x2ed3fb=0x0,_0x26083a={},_0x180286={};_0x2ed3fb<_0x1283a9['length'];_0x2ed3fb+=0x1){_0x26083a=_0x1283a9[_0x2ed3fb];if(_[_0x0d3c('0x17')](_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']])){_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']]=new OpenchannelQueue(_0x26083a);}else{_0x3147fe[_0x0d3c('0x18')](_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']],_0x26083a);}_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']][_0x0d3c('0x1c')]();_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']][_0x0d3c('0x1d')]();}}return _0x3147fe[_0x0d3c('0xa')];};};Realtime['prototype']['initChatQueues']=function(){var _0x39aa32=this;return function(_0x11ebe0){if(_0x11ebe0){freeIsNotKey(_0x11ebe0,_0x39aa32[_0x0d3c('0x1e')],'id');for(var _0x18668e=0x0,_0x3a4dad={},_0x36f11e={};_0x18668e<_0x11ebe0[_0x0d3c('0x16')];_0x18668e+=0x1){_0x3a4dad=_0x11ebe0[_0x18668e];if(_[_0x0d3c('0x17')](_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']])){_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']]=new ChatQueue(_0x3a4dad);}else{_0x39aa32[_0x0d3c('0x18')](_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']],_0x3a4dad);}_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']][_0x0d3c('0x1c')]();_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']]['updateRealtime']();}}return _0x39aa32[_0x0d3c('0x1e')];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x1f')]=function(){var _0x1ba1ed=this;return function(_0x24f84f){if(_0x24f84f){freeIsNotKey(_0x24f84f,_0x1ba1ed[_0x0d3c('0xb')],'id');for(var _0x1e1e69=0x0,_0x2cce60={},_0x54becd={};_0x1e1e69<_0x24f84f[_0x0d3c('0x16')];_0x1e1e69+=0x1){_0x2cce60=_0x24f84f[_0x1e1e69];if(_[_0x0d3c('0x17')](_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']])){_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']]=new SmsQueue(_0x2cce60);}else{_0x1ba1ed[_0x0d3c('0x18')](_0x1ba1ed['smsQueues'][_0x2cce60['id']],_0x2cce60);}_0x1ba1ed['smsQueues'][_0x2cce60['id']]['updateRouting']();_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']][_0x0d3c('0x1d')]();}}return _0x1ba1ed['smsQueues'];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x20')]=function(){var _0x432d37=this;return function(_0x422bd1){if(_0x422bd1){freeIsNotKey(_0x422bd1,_0x432d37[_0x0d3c('0xc')],'id');for(var _0x11085d=0x0,_0x30985={},_0x4c9bfd={};_0x11085d<_0x422bd1[_0x0d3c('0x16')];_0x11085d+=0x1){_0x30985=_0x422bd1[_0x11085d];if(_['isUndefined'](_0x432d37['mailQueues'][_0x30985['id']])){_0x432d37[_0x0d3c('0xc')][_0x30985['id']]=new MailQueue(_0x30985);}else{_0x432d37[_0x0d3c('0x18')](_0x432d37[_0x0d3c('0xc')][_0x30985['id']],_0x30985);}_0x432d37[_0x0d3c('0xc')][_0x30985['id']][_0x0d3c('0x1c')]();_0x432d37[_0x0d3c('0xc')][_0x30985['id']][_0x0d3c('0x1d')]();}}return _0x432d37['mailQueues'];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x21')]=function(){var _0x1cdacf=this;return function(_0x6d66a8){if(_0x6d66a8){freeIsNotKey(_0x6d66a8,_0x1cdacf['faxQueues'],'id');for(var _0x33dbc8=0x0,_0x2c9c9f={},_0x21e9fe={};_0x33dbc8<_0x6d66a8[_0x0d3c('0x16')];_0x33dbc8+=0x1){_0x2c9c9f=_0x6d66a8[_0x33dbc8];if(_[_0x0d3c('0x17')](_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']])){_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']]=new FaxQueue(_0x2c9c9f);}else{_0x1cdacf[_0x0d3c('0x18')](_0x1cdacf['faxQueues'][_0x2c9c9f['id']],_0x2c9c9f);}_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']][_0x0d3c('0x1c')]();_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']][_0x0d3c('0x1d')]();}}return _0x1cdacf['faxQueues'];};};module[_0x0d3c('0x22')]=Realtime; \ No newline at end of file +var _0x4ab0=['chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRouting','initChatQueues','updateRealtime','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/interval','../model/smsQueue','../model/mailQueue','intervals','openchannelQueues'];(function(_0x5975f2,_0x5525f2){var _0x15179b=function(_0xdf4139){while(--_0xdf4139){_0x5975f2['push'](_0x5975f2['shift']());}};_0x15179b(++_0x5525f2);}(_0x4ab0,0x177));var _0x04ab=function(_0x146582,_0x589b3b){_0x146582=_0x146582-0x0;var _0x22ab26=_0x4ab0[_0x146582];return _0x22ab26;};'use strict';var BPromise=require(_0x04ab('0x0'));var util=require(_0x04ab('0x1'));var _=require(_0x04ab('0x2'));var moment=require(_0x04ab('0x3'));var Agent=require(_0x04ab('0x4'));var Interval=require(_0x04ab('0x5'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x04ab('0x6'));var MailQueue=require(_0x04ab('0x7'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this['agents']={};this[_0x04ab('0x8')]={};this[_0x04ab('0x9')]={};this[_0x04ab('0xa')]={};this['smsQueues']={};this[_0x04ab('0xb')]={};this[_0x04ab('0xc')]={};this[_0x04ab('0xd')]={};this[_0x04ab('0xe')]={};this[_0x04ab('0xf')]={};this[_0x04ab('0x10')]={};this[_0x04ab('0x11')]={};};function freeIsNotKey(_0x1e3ac0,_0x82a41a,_0x9d9bb4){var _0x55b098=_[_0x04ab('0x12')](_0x1e3ac0,function(_0x57927d,_0x3fa15a){return _0x57927d[_0x9d9bb4];});for(var _0x434bda in _0x82a41a){if(_0x82a41a[_0x04ab('0x13')](_0x434bda)){if(!_0x55b098[_0x434bda]){delete _0x82a41a[_0x434bda];}}}}Realtime[_0x04ab('0x14')][_0x04ab('0x15')]=function(_0x517052,_0x283c1e){for(var _0x477073 in _0x283c1e){if(_0x517052[_0x04ab('0x13')](_0x477073)){_0x517052[_0x477073]=_0x283c1e[_0x477073];}}};Realtime[_0x04ab('0x14')][_0x04ab('0x16')]=function(){var _0x334acc=this;return function(_0x16234b){if(_0x16234b){freeIsNotKey(_0x16234b,_0x334acc[_0x04ab('0x17')],'id');for(var _0x146867=0x0,_0x23d528={},_0x16b335={};_0x146867<_0x16234b['length'];_0x146867+=0x1){_0x23d528=_0x16234b[_0x146867];if(_[_0x04ab('0x18')](_0x334acc[_0x04ab('0x17')][_0x23d528['id']])){_0x334acc['agents'][_0x23d528['id']]=new Agent(_0x23d528);}else{_0x334acc['mergeFromDatabase'](_0x334acc[_0x04ab('0x17')][_0x23d528['id']],_0x23d528);}}}return _0x334acc[_0x04ab('0x17')];};};Realtime[_0x04ab('0x14')][_0x04ab('0x19')]=function(){var _0x5956d2=this;return function(_0x5effae){if(_0x5effae){freeIsNotKey(_0x5effae,_0x5956d2['intervals'],'id');for(var _0x3b963d=0x0,_0x19b962={},_0x2ee00f={};_0x3b963d<_0x5effae[_0x04ab('0x1a')];_0x3b963d+=0x1){_0x19b962=_0x5effae[_0x3b963d];if(_[_0x04ab('0x18')](_0x5956d2['intervals'][_0x19b962['id']])){_0x5956d2[_0x04ab('0x8')][_0x19b962['id']]=new Interval(_0x19b962);}else{_0x5956d2['mergeFromDatabase'](_0x5956d2[_0x04ab('0x8')][_0x19b962['id']],_0x19b962);}}}return _0x5956d2[_0x04ab('0x8')];};};Realtime[_0x04ab('0x14')][_0x04ab('0x1b')]=function(){var _0x2eead7=this;return function(_0x4a327a){if(_0x4a327a){freeIsNotKey(_0x4a327a,_0x2eead7[_0x04ab('0x9')],'id');for(var _0x248a80=0x0,_0x1583b4={},_0x1d8e50={};_0x248a80<_0x4a327a[_0x04ab('0x1a')];_0x248a80+=0x1){_0x1583b4=_0x4a327a[_0x248a80];if(_[_0x04ab('0x18')](_0x2eead7[_0x04ab('0x9')][_0x1583b4['id']])){_0x2eead7[_0x04ab('0x9')][_0x1583b4['id']]=new OpenchannelQueue(_0x1583b4);}else{_0x2eead7[_0x04ab('0x15')](_0x2eead7['openchannelQueues'][_0x1583b4['id']],_0x1583b4);}_0x2eead7[_0x04ab('0x9')][_0x1583b4['id']][_0x04ab('0x1c')]();_0x2eead7[_0x04ab('0x9')][_0x1583b4['id']]['updateRealtime']();}}return _0x2eead7[_0x04ab('0x9')];};};Realtime['prototype'][_0x04ab('0x1d')]=function(){var _0x3af87a=this;return function(_0x3fc2f3){if(_0x3fc2f3){freeIsNotKey(_0x3fc2f3,_0x3af87a[_0x04ab('0xa')],'id');for(var _0x16b3c2=0x0,_0x28b34c={},_0x479044={};_0x16b3c2<_0x3fc2f3[_0x04ab('0x1a')];_0x16b3c2+=0x1){_0x28b34c=_0x3fc2f3[_0x16b3c2];if(_['isUndefined'](_0x3af87a[_0x04ab('0xa')][_0x28b34c['id']])){_0x3af87a[_0x04ab('0xa')][_0x28b34c['id']]=new ChatQueue(_0x28b34c);}else{_0x3af87a[_0x04ab('0x15')](_0x3af87a[_0x04ab('0xa')][_0x28b34c['id']],_0x28b34c);}_0x3af87a[_0x04ab('0xa')][_0x28b34c['id']]['updateRouting']();_0x3af87a[_0x04ab('0xa')][_0x28b34c['id']][_0x04ab('0x1e')]();}}return _0x3af87a[_0x04ab('0xa')];};};Realtime[_0x04ab('0x14')]['initSmsQueues']=function(){var _0x2b64cd=this;return function(_0x22b6b8){if(_0x22b6b8){freeIsNotKey(_0x22b6b8,_0x2b64cd[_0x04ab('0x1f')],'id');for(var _0x4d642a=0x0,_0x16a698={},_0x1bcc7a={};_0x4d642a<_0x22b6b8[_0x04ab('0x1a')];_0x4d642a+=0x1){_0x16a698=_0x22b6b8[_0x4d642a];if(_[_0x04ab('0x18')](_0x2b64cd[_0x04ab('0x1f')][_0x16a698['id']])){_0x2b64cd[_0x04ab('0x1f')][_0x16a698['id']]=new SmsQueue(_0x16a698);}else{_0x2b64cd['mergeFromDatabase'](_0x2b64cd[_0x04ab('0x1f')][_0x16a698['id']],_0x16a698);}_0x2b64cd[_0x04ab('0x1f')][_0x16a698['id']][_0x04ab('0x1c')]();_0x2b64cd[_0x04ab('0x1f')][_0x16a698['id']][_0x04ab('0x1e')]();}}return _0x2b64cd[_0x04ab('0x1f')];};};Realtime['prototype'][_0x04ab('0x20')]=function(){var _0x3fd026=this;return function(_0x235a64){if(_0x235a64){freeIsNotKey(_0x235a64,_0x3fd026[_0x04ab('0xb')],'id');for(var _0x4170fc=0x0,_0x24ee4a={},_0x48dd35={};_0x4170fc<_0x235a64['length'];_0x4170fc+=0x1){_0x24ee4a=_0x235a64[_0x4170fc];if(_['isUndefined'](_0x3fd026[_0x04ab('0xb')][_0x24ee4a['id']])){_0x3fd026[_0x04ab('0xb')][_0x24ee4a['id']]=new MailQueue(_0x24ee4a);}else{_0x3fd026[_0x04ab('0x15')](_0x3fd026[_0x04ab('0xb')][_0x24ee4a['id']],_0x24ee4a);}_0x3fd026[_0x04ab('0xb')][_0x24ee4a['id']][_0x04ab('0x1c')]();_0x3fd026[_0x04ab('0xb')][_0x24ee4a['id']][_0x04ab('0x1e')]();}}return _0x3fd026[_0x04ab('0xb')];};};Realtime['prototype'][_0x04ab('0x21')]=function(){var _0x10969e=this;return function(_0x51fdcc){if(_0x51fdcc){freeIsNotKey(_0x51fdcc,_0x10969e[_0x04ab('0xc')],'id');for(var _0x97b860=0x0,_0x4a0dc0={},_0x237f25={};_0x97b860<_0x51fdcc[_0x04ab('0x1a')];_0x97b860+=0x1){_0x4a0dc0=_0x51fdcc[_0x97b860];if(_['isUndefined'](_0x10969e['faxQueues'][_0x4a0dc0['id']])){_0x10969e['faxQueues'][_0x4a0dc0['id']]=new FaxQueue(_0x4a0dc0);}else{_0x10969e[_0x04ab('0x15')](_0x10969e['faxQueues'][_0x4a0dc0['id']],_0x4a0dc0);}_0x10969e['faxQueues'][_0x4a0dc0['id']]['updateRouting']();_0x10969e[_0x04ab('0xc')][_0x4a0dc0['id']][_0x04ab('0x1e')]();}}return _0x10969e[_0x04ab('0xc')];};};module[_0x04ab('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 12b6595..0144e2c 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 _0x9174=['addTagsToChatInteraction','../client','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x3f5a0a,_0x440d14){var _0x3ba695=function(_0x118125){while(--_0x118125){_0x3f5a0a['push'](_0x3f5a0a['shift']());}};_0x3ba695(++_0x440d14);}(_0x9174,0xcd));var _0x4917=function(_0x3c884b,_0x2984d6){_0x3c884b=_0x3c884b-0x0;var _0x158008=_0x9174[_0x3c884b];return _0x158008;};'use strict';var client=require(_0x4917('0x0'));exports['update']=function(_0x9e5283,_0x291cc0){return client['Request']('UpdateChatInteraction',{'body':_0x291cc0,'options':{'where':{'id':_0x9e5283}},'log':_0x4917('0x1')});};exports[_0x4917('0x2')]=function(_0x5f231c,_0x4920b3){return client[_0x4917('0x3')](_0x4917('0x4'),{'body':_0x4920b3,'options':{'where':{'id':_0x5f231c}},'log':_0x4917('0x5')});}; \ No newline at end of file +var _0xd897=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x1dea01,_0x1a6953){var _0x367592=function(_0x1cadd1){while(--_0x1cadd1){_0x1dea01['push'](_0x1dea01['shift']());}};_0x367592(++_0x1a6953);}(_0xd897,0x12d));var _0x7d89=function(_0x39dfd9,_0x5d3d9e){_0x39dfd9=_0x39dfd9-0x0;var _0x4954b0=_0xd897[_0x39dfd9];return _0x4954b0;};'use strict';var client=require(_0x7d89('0x0'));exports[_0x7d89('0x1')]=function(_0x524c69,_0x23b85d){return client[_0x7d89('0x2')](_0x7d89('0x3'),{'body':_0x23b85d,'options':{'where':{'id':_0x524c69}},'log':_0x7d89('0x4')});};exports[_0x7d89('0x5')]=function(_0x1a0588,_0x499363){return client[_0x7d89('0x2')](_0x7d89('0x6'),{'body':_0x499363,'options':{'where':{'id':_0x1a0588}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 6a7d4e8..2ce2c5f 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 _0x36e0=['CreateChatMessage','create','Request'];(function(_0x460f79,_0x1af962){var _0x57a93e=function(_0x327ed2){while(--_0x327ed2){_0x460f79['push'](_0x460f79['shift']());}};_0x57a93e(++_0x1af962);}(_0x36e0,0x11b));var _0x036e=function(_0x13d09f,_0x894f95){_0x13d09f=_0x13d09f-0x0;var _0x3d3ab9=_0x36e0[_0x13d09f];return _0x3d3ab9;};'use strict';var client=require('../client');exports[_0x036e('0x0')]=function(_0x30ca45){return client[_0x036e('0x1')](_0x036e('0x2'),{'body':_0x30ca45,'log':'createChatMessage'});}; \ No newline at end of file +var _0xf7cc=['Request','createChatMessage','create'];(function(_0x1622e1,_0x3bb5a6){var _0x49e6e5=function(_0x59e662){while(--_0x59e662){_0x1622e1['push'](_0x1622e1['shift']());}};_0x49e6e5(++_0x3bb5a6);}(_0xf7cc,0x128));var _0xcf7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf7cc[_0xfae23b];return _0x200640;};'use strict';var client=require('../client');exports[_0xcf7c('0x0')]=function(_0x32ba81){return client[_0xcf7c('0x1')]('CreateChatMessage',{'body':_0x32ba81,'log':_0xcf7c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 717016e..4fb900a 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 _0xaa28=['User','Agents','online','Request','GetChatQueue','name','timeout','strategy'];(function(_0x1d8f6,_0x2e6807){var _0x36ae00=function(_0xe01cc3){while(--_0xe01cc3){_0x1d8f6['push'](_0x1d8f6['shift']());}};_0x36ae00(++_0x2e6807);}(_0xaa28,0x18b));var _0x8aa2=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xaa28[_0x547add];return _0x2ed1f3;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x8aa2('0x0')](_0x8aa2('0x1'),{'options':{'raw':![],'attributes':['id',_0x8aa2('0x2'),_0x8aa2('0x3'),_0x8aa2('0x4')],'include':[{'model':_0x8aa2('0x5'),'as':_0x8aa2('0x6'),'attributes':['id',_0x8aa2('0x2'),_0x8aa2('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xe290=['timeout','strategy','User','Agents','name','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x1922ff,_0x1d9db8){var _0x3b6ba7=function(_0x34d935){while(--_0x34d935){_0x1922ff['push'](_0x1922ff['shift']());}};_0x3b6ba7(++_0x1d9db8);}(_0xe290,0xee));var _0x0e29=function(_0x2d8ca8,_0x22bcb6){_0x2d8ca8=_0x2d8ca8-0x0;var _0x268164=_0xe290[_0x2d8ca8];return _0x268164;};'use strict';var client=require(_0x0e29('0x0'));exports[_0x0e29('0x1')]=function(){return function(){return client[_0x0e29('0x2')](_0x0e29('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0e29('0x4'),_0x0e29('0x5')],'include':[{'model':_0x0e29('0x6'),'as':_0x0e29('0x7'),'attributes':['id',_0x0e29('0x8'),_0x0e29('0x9'),_0x0e29('0xa')]}]},'log':_0x0e29('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 932f2e3..311b9af 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 _0xd73a=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xd73a,0x171));var _0xad73=function(_0x2873bd,_0x3a8504){_0x2873bd=_0x2873bd-0x0;var _0x53cded=_0xd73a[_0x2873bd];return _0x53cded;};'use strict';var client=require(_0xad73('0x0'));exports[_0xad73('0x1')]=function(_0x138ac){return client[_0xad73('0x2')](_0xad73('0x3'),{'body':_0x138ac,'log':'CreateChatQueueReport'});};exports['update']=function(_0x1b0cd2,_0x216563){return client[_0xad73('0x2')](_0xad73('0x4'),{'body':_0x216563,'options':{'where':{'uniqueid':_0x1b0cd2},'order':[['id',_0xad73('0x5')]],'limit':0x1},'log':_0xad73('0x4')});}; \ No newline at end of file +var _0xaa19=['DESC','../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0xaa19,0x79));var _0x9aa1=function(_0x307c64,_0x370d72){_0x307c64=_0x307c64-0x0;var _0x2e9baa=_0xaa19[_0x307c64];return _0x2e9baa;};'use strict';var client=require(_0x9aa1('0x0'));exports[_0x9aa1('0x1')]=function(_0xa7aed3){return client[_0x9aa1('0x2')]('CreateChatQueueReport',{'body':_0xa7aed3,'log':_0x9aa1('0x3')});};exports['update']=function(_0x15dd20,_0x58fb46){return client[_0x9aa1('0x2')](_0x9aa1('0x4'),{'body':_0x58fb46,'options':{'where':{'uniqueid':_0x15dd20},'order':[['id',_0x9aa1('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8685d42..b694d19 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 _0x1966=['addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x5426b8,_0x535f41){var _0x58bf6c=function(_0x3c6b8c){while(--_0x3c6b8c){_0x5426b8['push'](_0x5426b8['shift']());}};_0x58bf6c(++_0x535f41);}(_0x1966,0x15a));var _0x6196=function(_0x58e3cd,_0x3fac55){_0x58e3cd=_0x58e3cd-0x0;var _0x2be4fd=_0x1966[_0x58e3cd];return _0x2be4fd;};'use strict';var client=require('../client');exports[_0x6196('0x0')]=function(_0x1765d0,_0x39318a){return client[_0x6196('0x1')](_0x6196('0x2'),{'body':_0x39318a,'options':{'where':{'id':_0x1765d0}},'log':_0x6196('0x3')});};exports[_0x6196('0x4')]=function(_0x5a2c6a,_0x490b6e){return client[_0x6196('0x1')](_0x6196('0x5'),{'body':_0x490b6e,'options':{'where':{'id':_0x5a2c6a}},'log':_0x6196('0x6')});}; \ No newline at end of file +var _0xdcc9=['AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdcc9,0x1bb));var _0x9dcc=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xdcc9[_0x49e584];return _0x58b1be;};'use strict';var client=require(_0x9dcc('0x0'));exports['update']=function(_0x3f47cd,_0x164051){return client[_0x9dcc('0x1')](_0x9dcc('0x2'),{'body':_0x164051,'options':{'where':{'id':_0x3f47cd}},'log':_0x9dcc('0x3')});};exports[_0x9dcc('0x4')]=function(_0x29c56f,_0xcf97dc){return client['Request'](_0x9dcc('0x5'),{'body':_0xcf97dc,'options':{'where':{'id':_0x29c56f}},'log':_0x9dcc('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a410693..f8c511c 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 _0xa353=['../client','create','Request','CreateFaxMessage'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xa353,0x160));var _0x3a35=function(_0x21c218,_0xe204e){_0x21c218=_0x21c218-0x0;var _0xebff61=_0xa353[_0x21c218];return _0xebff61;};'use strict';var client=require(_0x3a35('0x0'));exports[_0x3a35('0x1')]=function(_0x327b8d){return client[_0x3a35('0x2')](_0x3a35('0x3'),{'body':_0x327b8d,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xf8c6=['CreateFaxMessage','createFaxMessage','create','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf8c6,0xba));var _0x6f8c=function(_0x221fdf,_0x4dcbaa){_0x221fdf=_0x221fdf-0x0;var _0x2e3cc1=_0xf8c6[_0x221fdf];return _0x2e3cc1;};'use strict';var client=require('../client');exports[_0x6f8c('0x0')]=function(_0x65f159){return client[_0x6f8c('0x1')](_0x6f8c('0x2'),{'body':_0x65f159,'log':_0x6f8c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 36c7260..5a7d3cb 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 _0x2ee7=['Request','GetFaxQueue','name','timeout','strategy','online','faxPause','getFaxQueues','../client'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x2ee7,0x6b));var _0x72ee=function(_0x17bd48,_0x21cff6){_0x17bd48=_0x17bd48-0x0;var _0x114e3b=_0x2ee7[_0x17bd48];return _0x114e3b;};'use strict';var client=require(_0x72ee('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x72ee('0x1')](_0x72ee('0x2'),{'options':{'raw':![],'attributes':['id',_0x72ee('0x3'),_0x72ee('0x4'),_0x72ee('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x72ee('0x3'),_0x72ee('0x6'),_0x72ee('0x7')]}]},'log':_0x72ee('0x8')});};}; \ No newline at end of file +var _0xf9c9=['online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x12b4d4,_0x2134e9){var _0x32604e=function(_0x32a791){while(--_0x32a791){_0x12b4d4['push'](_0x12b4d4['shift']());}};_0x32604e(++_0x2134e9);}(_0xf9c9,0x197));var _0x9f9c=function(_0x31dd7e,_0x72d5da){_0x31dd7e=_0x31dd7e-0x0;var _0x2a6bfd=_0xf9c9[_0x31dd7e];return _0x2a6bfd;};'use strict';var client=require('../client');exports[_0x9f9c('0x0')]=function(){return function(){return client[_0x9f9c('0x1')](_0x9f9c('0x2'),{'options':{'raw':![],'attributes':['id',_0x9f9c('0x3'),_0x9f9c('0x4'),_0x9f9c('0x5')],'include':[{'model':_0x9f9c('0x6'),'as':'Agents','attributes':['id',_0x9f9c('0x3'),_0x9f9c('0x7'),_0x9f9c('0x8')]}]},'log':_0x9f9c('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index b608905..127c697 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 _0x7f5e=['UpdateFaxQueueReport','CreateFaxQueueReport','Request'];(function(_0x43529b,_0xd0752e){var _0x312adb=function(_0x649fb7){while(--_0x649fb7){_0x43529b['push'](_0x43529b['shift']());}};_0x312adb(++_0xd0752e);}(_0x7f5e,0x18d));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['create']=function(_0x53acb3){return client['Request'](_0xe7f5('0x0'),{'body':_0x53acb3,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x1daa29,_0x591852){return client[_0xe7f5('0x1')](_0xe7f5('0x2'),{'body':_0x591852,'options':{'where':{'uniqueid':_0x1daa29},'order':[['id','DESC']],'limit':0x1},'log':_0xe7f5('0x2')});}; \ No newline at end of file +var _0x6819=['update','UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x56fb43,_0x170198){var _0x7816ff=function(_0x11facc){while(--_0x11facc){_0x56fb43['push'](_0x56fb43['shift']());}};_0x7816ff(++_0x170198);}(_0x6819,0x93));var _0x9681=function(_0x1fa5f3,_0xc56719){_0x1fa5f3=_0x1fa5f3-0x0;var _0x5c1204=_0x6819[_0x1fa5f3];return _0x5c1204;};'use strict';var client=require('../client');exports[_0x9681('0x0')]=function(_0x205b99){return client[_0x9681('0x1')](_0x9681('0x2'),{'body':_0x205b99,'log':_0x9681('0x2')});};exports[_0x9681('0x3')]=function(_0x51fdaf,_0x1cb65a){return client[_0x9681('0x1')](_0x9681('0x4'),{'body':_0x1cb65a,'options':{'where':{'uniqueid':_0x51fdaf},'order':[['id',_0x9681('0x5')]],'limit':0x1},'log':_0x9681('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e52b4d5..79ca8b8 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 _0xe5b5=['Interval','Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x423ae4,_0x2d8a48){var _0x15402e=function(_0x2099ea){while(--_0x2099ea){_0x423ae4['push'](_0x423ae4['shift']());}};_0x15402e(++_0x2d8a48);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xe5b5[_0x4d67b8];return _0x55af3b;};'use strict';var client=require(_0x5e5b('0x0'));exports[_0x5e5b('0x1')]=function(){return function(){return client[_0x5e5b('0x2')](_0x5e5b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5e5b('0x4')],'include':[{'model':_0x5e5b('0x5'),'as':_0x5e5b('0x6'),'attributes':['id',_0x5e5b('0x4'),_0x5e5b('0x7')]}]},'log':_0x5e5b('0x1')});};}; \ No newline at end of file +var _0x9d5b=['GetInterval','name','Interval','getIntervals','Request'];(function(_0x2e4856,_0x608298){var _0x11f0e8=function(_0xc28838){while(--_0xc28838){_0x2e4856['push'](_0x2e4856['shift']());}};_0x11f0e8(++_0x608298);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x777a68,_0x526ba2){_0x777a68=_0x777a68-0x0;var _0x5796e6=_0x9d5b[_0x777a68];return _0x5796e6;};'use strict';var client=require('../client');exports[_0xb9d5('0x0')]=function(){return function(){return client[_0xb9d5('0x1')](_0xb9d5('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb9d5('0x3')],'include':[{'model':_0xb9d5('0x4'),'as':'Intervals','attributes':['id',_0xb9d5('0x3'),'interval']}]},'log':_0xb9d5('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 5768d26..8b334d3 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 _0x760b=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x559434,_0x2f9870){var _0x252834=function(_0x548490){while(--_0x548490){_0x559434['push'](_0x559434['shift']());}};_0x252834(++_0x2f9870);}(_0x760b,0x19f));var _0xb760=function(_0x58997f,_0x5a9f7c){_0x58997f=_0x58997f-0x0;var _0x248748=_0x760b[_0x58997f];return _0x248748;};'use strict';var client=require(_0xb760('0x0'));exports['update']=function(_0x1d6b09,_0x57e7a7){return client[_0xb760('0x1')](_0xb760('0x2'),{'body':_0x57e7a7,'options':{'where':{'id':_0x1d6b09}},'log':_0xb760('0x3')});};exports[_0xb760('0x4')]=function(_0xba6ae3,_0x57c249){return client[_0xb760('0x1')](_0xb760('0x5'),{'body':_0x57c249,'options':{'where':{'id':_0xba6ae3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2391=['addTags','AddTagsToMailInteraction','update','Request','updateMailInteraction'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x2391,0x7f));var _0x1239=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2391[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports[_0x1239('0x0')]=function(_0x317dad,_0x259bd6){return client[_0x1239('0x1')]('UpdateMailInteraction',{'body':_0x259bd6,'options':{'where':{'id':_0x317dad}},'log':_0x1239('0x2')});};exports[_0x1239('0x3')]=function(_0x14e236,_0x8f1732){return client[_0x1239('0x1')](_0x1239('0x4'),{'body':_0x8f1732,'options':{'where':{'id':_0x14e236}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index cde9344..7a0cb3b 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 _0x1e1d=['create','Request','createMailMessage'];(function(_0x4052b2,_0x32b19c){var _0x10c53c=function(_0x403b62){while(--_0x403b62){_0x4052b2['push'](_0x4052b2['shift']());}};_0x10c53c(++_0x32b19c);}(_0x1e1d,0xa8));var _0xd1e1=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x1e1d[_0x4b2863];return _0x567d67;};'use strict';var client=require('../client');exports[_0xd1e1('0x0')]=function(_0x3fd548){return client[_0xd1e1('0x1')]('CreateMailMessage',{'body':_0x3fd548,'log':_0xd1e1('0x2')});}; \ No newline at end of file +var _0x14d4=['CreateMailMessage','../client','create','Request'];(function(_0xbf4ae7,_0x1044b0){var _0x18cb4e=function(_0xea6d34){while(--_0xea6d34){_0xbf4ae7['push'](_0xbf4ae7['shift']());}};_0x18cb4e(++_0x1044b0);}(_0x14d4,0x1d9));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x414d('0x0'));exports[_0x414d('0x1')]=function(_0x2cb691){return client[_0x414d('0x2')](_0x414d('0x3'),{'body':_0x2cb691,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0ff57bc..d646369 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 _0xeb09=['online','mailPause','../client','getMailQueues','name','timeout','User','Agents'];(function(_0x2edd87,_0x4b49e8){var _0x2ad924=function(_0x4e8920){while(--_0x4e8920){_0x2edd87['push'](_0x2edd87['shift']());}};_0x2ad924(++_0x4b49e8);}(_0xeb09,0x7a));var _0x9eb0=function(_0x35662f,_0x1d682d){_0x35662f=_0x35662f-0x0;var _0x10ad70=_0xeb09[_0x35662f];return _0x10ad70;};'use strict';var client=require(_0x9eb0('0x0'));exports[_0x9eb0('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x9eb0('0x2'),_0x9eb0('0x3'),'strategy'],'include':[{'model':_0x9eb0('0x4'),'as':_0x9eb0('0x5'),'attributes':['id',_0x9eb0('0x2'),_0x9eb0('0x6'),_0x9eb0('0x7')]}]},'log':_0x9eb0('0x1')});};}; \ No newline at end of file +var _0xabaf=['online','mailPause','name','timeout','strategy','Agents'];(function(_0x116d0b,_0x3fdb1f){var _0xf6199a=function(_0xb1af8a){while(--_0xb1af8a){_0x116d0b['push'](_0x116d0b['shift']());}};_0xf6199a(++_0x3fdb1f);}(_0xabaf,0x12e));var _0xfaba=function(_0x5bfc07,_0x4d1d15){_0x5bfc07=_0x5bfc07-0x0;var _0x55bbb9=_0xabaf[_0x5bfc07];return _0x55bbb9;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xfaba('0x0'),_0xfaba('0x1'),_0xfaba('0x2')],'include':[{'model':'User','as':_0xfaba('0x3'),'attributes':['id',_0xfaba('0x0'),_0xfaba('0x4'),_0xfaba('0x5')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d5d5c1f..82d6100 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 _0xee6b=['update','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xee6b,0x7a));var _0xbee6=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0xee6b[_0x4ec7f2];return _0x118004;};'use strict';var client=require(_0xbee6('0x0'));exports[_0xbee6('0x1')]=function(_0x94f922){return client[_0xbee6('0x2')](_0xbee6('0x3'),{'body':_0x94f922,'log':_0xbee6('0x3')});};exports[_0xbee6('0x4')]=function(_0x14e8ce,_0x1d522a){return client[_0xbee6('0x2')](_0xbee6('0x5'),{'body':_0x1d522a,'options':{'where':{'uniqueid':_0x14e8ce},'order':[['id','DESC']],'limit':0x1},'log':_0xbee6('0x5')});}; \ No newline at end of file +var _0xe2d8=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x1fcea1,_0x4052fa){var _0x453124=function(_0x50677c){while(--_0x50677c){_0x1fcea1['push'](_0x1fcea1['shift']());}};_0x453124(++_0x4052fa);}(_0xe2d8,0xd6));var _0x8e2d=function(_0x31113c,_0x239ad4){_0x31113c=_0x31113c-0x0;var _0x1e22c5=_0xe2d8[_0x31113c];return _0x1e22c5;};'use strict';var client=require(_0x8e2d('0x0'));exports[_0x8e2d('0x1')]=function(_0x33f380){return client[_0x8e2d('0x2')](_0x8e2d('0x3'),{'body':_0x33f380,'log':_0x8e2d('0x3')});};exports[_0x8e2d('0x4')]=function(_0x533e54,_0x223df2){return client[_0x8e2d('0x2')]('UpdateMailQueueReport',{'body':_0x223df2,'options':{'where':{'uniqueid':_0x533e54},'order':[['id',_0x8e2d('0x5')]],'limit':0x1},'log':_0x8e2d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b9b9bc8..f69fe1d 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 _0xa2a4=['update','Request','UpdateOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xa2a4,0x135));var _0x4a2a=function(_0x5a90b1,_0x5758cf){_0x5a90b1=_0x5a90b1-0x0;var _0x495257=_0xa2a4[_0x5a90b1];return _0x495257;};'use strict';var client=require(_0x4a2a('0x0'));exports[_0x4a2a('0x1')]=function(_0x32a0aa,_0x2ef012){return client[_0x4a2a('0x2')](_0x4a2a('0x3'),{'body':_0x2ef012,'options':{'where':{'id':_0x32a0aa}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3abf6f,_0x4d8bac){return client[_0x4a2a('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4d8bac,'options':{'where':{'id':_0x3abf6f}},'log':_0x4a2a('0x4')});}; \ No newline at end of file +var _0xbab1=['UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction','Request'];(function(_0x8248e9,_0x3fc3ea){var _0x211509=function(_0x34a2fa){while(--_0x34a2fa){_0x8248e9['push'](_0x8248e9['shift']());}};_0x211509(++_0x3fc3ea);}(_0xbab1,0xab));var _0x1bab=function(_0x1d7278,_0x390306){_0x1d7278=_0x1d7278-0x0;var _0x30ef92=_0xbab1[_0x1d7278];return _0x30ef92;};'use strict';var client=require('../client');exports['update']=function(_0x52f465,_0x451ace){return client[_0x1bab('0x0')](_0x1bab('0x1'),{'body':_0x451ace,'options':{'where':{'id':_0x52f465}},'log':'updateOpenchannelInteraction'});};exports[_0x1bab('0x2')]=function(_0x2d2a81,_0x5357fb){return client[_0x1bab('0x0')]('AddTagsToOpenchannelInteraction',{'body':_0x5357fb,'options':{'where':{'id':_0x2d2a81}},'log':_0x1bab('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d45d0ec..15971ce 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 _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fcd40,_0x241fcb){_0x1fcd40=_0x1fcd40-0x0;var _0x56f968=_0xedd9[_0x1fcd40];return _0x56f968;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file +var _0x9c44=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x597b2e,_0x326816){var _0x131ff8=function(_0x24a1ae){while(--_0x24a1ae){_0x597b2e['push'](_0x597b2e['shift']());}};_0x131ff8(++_0x326816);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 096871d..e3d45e9 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 _0xa23d=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client'];(function(_0xf5541e,_0x53a22f){var _0x3aed8e=function(_0x1ee74c){while(--_0x1ee74c){_0xf5541e['push'](_0xf5541e['shift']());}};_0x3aed8e(++_0x53a22f);}(_0xa23d,0xef));var _0xda23=function(_0x422230,_0x1964a8){_0x422230=_0x422230-0x0;var _0x2c8f10=_0xa23d[_0x422230];return _0x2c8f10;};'use strict';var client=require(_0xda23('0x0'));exports[_0xda23('0x1')]=function(){return function(){return client[_0xda23('0x2')](_0xda23('0x3'),{'options':{'raw':![],'attributes':['id',_0xda23('0x4'),_0xda23('0x5'),_0xda23('0x6')],'include':[{'model':'User','as':_0xda23('0x7'),'attributes':['id',_0xda23('0x4'),_0xda23('0x8'),_0xda23('0x9')]}]},'log':_0xda23('0x1')});};}; \ No newline at end of file +var _0x2e05=['getOpenchannelQueues','name','timeout','strategy','User','Agents','openchannelPause','../client'];(function(_0x1a5b2b,_0x5c2965){var _0x2735c5=function(_0x15ac13){while(--_0x15ac13){_0x1a5b2b['push'](_0x1a5b2b['shift']());}};_0x2735c5(++_0x5c2965);}(_0x2e05,0x77));var _0x52e0=function(_0x4a574d,_0x6e4e34){_0x4a574d=_0x4a574d-0x0;var _0x5bb259=_0x2e05[_0x4a574d];return _0x5bb259;};'use strict';var client=require(_0x52e0('0x0'));exports[_0x52e0('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x52e0('0x2'),_0x52e0('0x3'),_0x52e0('0x4')],'include':[{'model':_0x52e0('0x5'),'as':_0x52e0('0x6'),'attributes':['id',_0x52e0('0x2'),'online',_0x52e0('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 0b72df2..b55c554 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 _0xbfcf=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x39ce33,_0x21db1e){var _0x384a32=function(_0x37a728){while(--_0x37a728){_0x39ce33['push'](_0x39ce33['shift']());}};_0x384a32(++_0x21db1e);}(_0xbfcf,0x1e9));var _0xfbfc=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0xbfcf[_0x10791d];return _0x1b4f9c;};'use strict';var client=require(_0xfbfc('0x0'));exports[_0xfbfc('0x1')]=function(_0x2ae493){return client[_0xfbfc('0x2')](_0xfbfc('0x3'),{'body':_0x2ae493,'log':_0xfbfc('0x3')});};exports[_0xfbfc('0x4')]=function(_0x1477e0,_0x29a85d){return client[_0xfbfc('0x2')](_0xfbfc('0x5'),{'body':_0x29a85d,'options':{'where':{'uniqueid':_0x1477e0},'order':[['id',_0xfbfc('0x6')]],'limit':0x1},'log':_0xfbfc('0x5')});}; \ No newline at end of file +var _0x5e1e=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create','Request'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x5e1e,0x190));var _0xe5e1=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5e1e[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports[_0xe5e1('0x0')]=function(_0x2f4a62){return client[_0xe5e1('0x1')](_0xe5e1('0x2'),{'body':_0x2f4a62,'log':_0xe5e1('0x2')});};exports[_0xe5e1('0x3')]=function(_0x3886e4,_0x415efe){return client[_0xe5e1('0x1')](_0xe5e1('0x4'),{'body':_0x415efe,'options':{'where':{'uniqueid':_0x3886e4},'order':[['id',_0xe5e1('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a238ac5..378413f 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 _0x3f6b=['AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f6b,0x10b));var _0xb3f6=function(_0x20f092,_0x492711){_0x20f092=_0x20f092-0x0;var _0x47bbec=_0x3f6b[_0x20f092];return _0x47bbec;};'use strict';var client=require(_0xb3f6('0x0'));exports[_0xb3f6('0x1')]=function(_0x2cc152,_0x3be137){return client[_0xb3f6('0x2')](_0xb3f6('0x3'),{'body':_0x3be137,'options':{'where':{'id':_0x2cc152}},'log':_0xb3f6('0x4')});};exports[_0xb3f6('0x5')]=function(_0x1100a8,_0x3a29d0){return client[_0xb3f6('0x2')](_0xb3f6('0x6'),{'body':_0x3a29d0,'options':{'where':{'id':_0x1100a8}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x4e45=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x15390c,_0x1e7e84){var _0x212b13=function(_0x4c659a){while(--_0x4c659a){_0x15390c['push'](_0x15390c['shift']());}};_0x212b13(++_0x1e7e84);}(_0x4e45,0x124));var _0x54e4=function(_0x145af7,_0x6b0258){_0x145af7=_0x145af7-0x0;var _0x45e218=_0x4e45[_0x145af7];return _0x45e218;};'use strict';var client=require(_0x54e4('0x0'));exports[_0x54e4('0x1')]=function(_0x3fcb1f,_0x428ef4){return client[_0x54e4('0x2')](_0x54e4('0x3'),{'body':_0x428ef4,'options':{'where':{'id':_0x3fcb1f}},'log':_0x54e4('0x4')});};exports[_0x54e4('0x5')]=function(_0x14f19a,_0x4d69aa){return client[_0x54e4('0x2')](_0x54e4('0x6'),{'body':_0x4d69aa,'options':{'where':{'id':_0x14f19a}},'log':_0x54e4('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c739adb..96ea1dd 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 _0x6e86=['create','../client'];(function(_0x236ee0,_0x460e9f){var _0x5b05ae=function(_0x2238d6){while(--_0x2238d6){_0x236ee0['push'](_0x236ee0['shift']());}};_0x5b05ae(++_0x460e9f);}(_0x6e86,0x1e5));var _0x66e8=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x6e86[_0x16bb4b];return _0x8aeb84;};'use strict';var client=require(_0x66e8('0x0'));exports[_0x66e8('0x1')]=function(_0x4384e3){return client['Request']('CreateSmsMessage',{'body':_0x4384e3,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x4669=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x21ed84,_0xa915bc){var _0x3a30ca=function(_0xddcd1c){while(--_0xddcd1c){_0x21ed84['push'](_0x21ed84['shift']());}};_0x3a30ca(++_0xa915bc);}(_0x4669,0xb5));var _0x9466=function(_0x5bee28,_0x1dc7e2){_0x5bee28=_0x5bee28-0x0;var _0x395d1d=_0x4669[_0x5bee28];return _0x395d1d;};'use strict';var client=require(_0x9466('0x0'));exports[_0x9466('0x1')]=function(_0x58eea9){return client[_0x9466('0x2')](_0x9466('0x3'),{'body':_0x58eea9,'log':_0x9466('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 90a9318..8d67644 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 _0xf34b=['User','Agents','online','../client','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy'];(function(_0x4be58d,_0x36b7bb){var _0x19f0f5=function(_0x1f7473){while(--_0x1f7473){_0x4be58d['push'](_0x4be58d['shift']());}};_0x19f0f5(++_0x36b7bb);}(_0xf34b,0xa3));var _0xbf34=function(_0x1c14a4,_0x48ca5b){_0x1c14a4=_0x1c14a4-0x0;var _0x486007=_0xf34b[_0x1c14a4];return _0x486007;};'use strict';var client=require(_0xbf34('0x0'));exports[_0xbf34('0x1')]=function(){return function(){return client[_0xbf34('0x2')](_0xbf34('0x3'),{'options':{'raw':![],'attributes':['id',_0xbf34('0x4'),_0xbf34('0x5'),_0xbf34('0x6')],'include':[{'model':_0xbf34('0x7'),'as':_0xbf34('0x8'),'attributes':['id',_0xbf34('0x4'),_0xbf34('0x9'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xc139=['getSmsQueues','../client','GetSmsQueue','name','timeout','strategy','User','Agents','online','smsPause'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xc139,0x1b9));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9c13('0x0'));exports['getSmsQueues']=function(){return function(){return client['Request'](_0x9c13('0x1'),{'options':{'raw':![],'attributes':['id',_0x9c13('0x2'),_0x9c13('0x3'),_0x9c13('0x4')],'include':[{'model':_0x9c13('0x5'),'as':_0x9c13('0x6'),'attributes':['id',_0x9c13('0x2'),_0x9c13('0x7'),_0x9c13('0x8')]}]},'log':_0x9c13('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index b8ce068..9233ad4 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 _0xb6db=['UpdateSmsQueueReport','DESC','Request','CreateSmsQueueReport','update'];(function(_0x4a4c3d,_0x4581f0){var _0x525a81=function(_0x24060e){while(--_0x24060e){_0x4a4c3d['push'](_0x4a4c3d['shift']());}};_0x525a81(++_0x4581f0);}(_0xb6db,0x16a));var _0xbb6d=function(_0x3cdad3,_0x3bc5b2){_0x3cdad3=_0x3cdad3-0x0;var _0x5486bd=_0xb6db[_0x3cdad3];return _0x5486bd;};'use strict';var client=require('../client');exports['create']=function(_0x33c766){return client[_0xbb6d('0x0')](_0xbb6d('0x1'),{'body':_0x33c766,'log':_0xbb6d('0x1')});};exports[_0xbb6d('0x2')]=function(_0x5a473f,_0xe084d6){return client[_0xbb6d('0x0')](_0xbb6d('0x3'),{'body':_0xe084d6,'options':{'where':{'uniqueid':_0x5a473f},'order':[['id',_0xbb6d('0x4')]],'limit':0x1},'log':_0xbb6d('0x3')});}; \ No newline at end of file +var _0x784b=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x232b21,_0x3c5d54){var _0x100280=function(_0x5e3214){while(--_0x5e3214){_0x232b21['push'](_0x232b21['shift']());}};_0x100280(++_0x3c5d54);}(_0x784b,0x149));var _0xb784=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x784b[_0x2390bd];return _0x3a969d;};'use strict';var client=require(_0xb784('0x0'));exports[_0xb784('0x1')]=function(_0x487cc7){return client[_0xb784('0x2')]('CreateSmsQueueReport',{'body':_0x487cc7,'log':_0xb784('0x3')});};exports[_0xb784('0x4')]=function(_0xcee403,_0x5aeb97){return client[_0xb784('0x2')](_0xb784('0x5'),{'body':_0x5aeb97,'options':{'where':{'uniqueid':_0xcee403},'order':[['id',_0xb784('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 717b019..ae05122 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 _0x49ae=['online','pauseType','lastPauseAt','voicePause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent'];(function(_0x536822,_0x8954cd){var _0x4e72d0=function(_0x5a0bae){while(--_0x5a0bae){_0x536822['push'](_0x536822['shift']());}};_0x4e72d0(++_0x8954cd);}(_0x49ae,0x1a0));var _0xe49a=function(_0x508911,_0x26e1d2){_0x508911=_0x508911-0x0;var _0x47ced5=_0x49ae[_0x508911];return _0x47ced5;};'use strict';var client=require('../client');exports[_0xe49a('0x0')]=function(){return function(){return client[_0xe49a('0x1')](_0xe49a('0x2'),{'options':{'raw':!![],'where':{'role':_0xe49a('0x3')},'attributes':['id','name',_0xe49a('0x4'),_0xe49a('0x5'),_0xe49a('0x6'),_0xe49a('0x7'),'chatPause','mailPause',_0xe49a('0x8'),_0xe49a('0x9'),_0xe49a('0xa'),'chatCapacity',_0xe49a('0xb'),_0xe49a('0xc'),_0xe49a('0xd'),_0xe49a('0xe')]},'log':_0xe49a('0x0')});};}; \ No newline at end of file +var _0xe54e=['agent','name','online','lastPauseAt','chatPause','mailPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','openchannelCapacity','getAgents','../client','GetUser'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xe54e,0x10c));var _0xee54=function(_0x28ec10,_0x4b3c8b){_0x28ec10=_0x28ec10-0x0;var _0x45ea61=_0xe54e[_0x28ec10];return _0x45ea61;};'use strict';var client=require(_0xee54('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0xee54('0x1'),{'options':{'raw':!![],'where':{'role':_0xee54('0x2')},'attributes':['id',_0xee54('0x3'),_0xee54('0x4'),'pauseType',_0xee54('0x5'),'voicePause',_0xee54('0x6'),_0xee54('0x7'),'faxPause',_0xee54('0x8'),_0xee54('0x9'),_0xee54('0xa'),_0xee54('0xb'),_0xee54('0xc'),'smsCapacity',_0xee54('0xd')]},'log':_0xee54('0xe')});};}; \ 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 284a607..753d2c4 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 _0xeab3=['lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20END','agent','log','stack','validate'];(function(_0x30144e,_0x1c9bc3){var _0xe15c6c=function(_0x50dd17){while(--_0x50dd17){_0x30144e['push'](_0x30144e['shift']());}};_0xe15c6c(++_0x1c9bc3);}(_0xeab3,0xdd));var _0x3eab=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0xeab3[_0x209581];return _0x2fed45;};'use strict';var schema=require(_0x3eab('0x0'));var _=require(_0x3eab('0x1'));var util=require(_0x3eab('0x2'));var seqqueue=require(_0x3eab('0x3'));var logger=require(_0x3eab('0x4'))(_0x3eab('0x5'));var strategy=require(_0x3eab('0x6'));var queue=schema({'name':{'type':_0x3eab('0x7'),'required':!![],'message':_0x3eab('0x8')},'timeout':{'type':_0x3eab('0x9'),'message':_0x3eab('0xa')}});function writeLog(_0x53a083,_0x1e1005,_0x161c3f){return logger[_0x3eab('0xb')](util[_0x3eab('0xc')](_0x3eab('0xd'),_0x53a083,_0x1e1005[_0x3eab('0xe')],_0x161c3f));}function handleFindAgent(_0x3dc0d1){return function(_0xc4a421){return _0xc4a421[_0x3eab('0xe')][_0x3eab('0xf')]()===_0x3dc0d1['toLowerCase']();};}exports[_0x3eab('0x10')]=function(_0x3b43b2,_0x931e80,_0x37085d,_0xc652b8){return function(_0x13626c){try{var _0x11a9b7={'name':_0x931e80[0x0],'timeout':_0x931e80[0x1]};var _0x2b4f34=queue['validate'](_0x11a9b7,{'typecast':!![]});if(_0x2b4f34[_0x3eab('0x11')]){logger[_0x3eab('0x12')](_0x3eab('0x13'),_0x3b43b2,_[_0x3eab('0x14')](_0x2b4f34,_0x3eab('0x15'))[_0x3eab('0x16')](',\x20'));_0x13626c[_0x3eab('0x17')]();}else{var _0x49aa7a=_[_0x3eab('0x18')](_0x37085d[_0x3eab('0x19')],handleFindAgent(_0x11a9b7[_0x3eab('0xe')]));if(_0x49aa7a){var _0x42afa3=(_0x11a9b7['timeout']||0xa)*0x3e8;var _0x19e3f5,_0x3ce95e;var _0x3c8e1c=seqqueue[_0x3eab('0x1a')](_0x42afa3);_0x3c8e1c['id']=_0x3b43b2;_0x3c8e1c[_0x3eab('0x1b')]=_0x42afa3;_0x3c8e1c[_0x3eab('0x1c')]=_0xc652b8[_0x3eab('0x1c')];writeLog(_0x3b43b2,_0x49aa7a,util['format'](_0x3eab('0x1d'),_0x42afa3));_0x37085d['rules'][_0x3b43b2]['on'](_0x3eab('0x1e'),function(){_0x3c8e1c[_0x3eab('0x1f')]();clearTimeout(_0x3ce95e);_0x3ce95e=undefined;if(_0x37085d[_0x3eab('0x20')][_0x3b43b2]){delete _0x37085d['rules'][_0x3b43b2];}logger[_0x3eab('0xb')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3b43b2);_0x13626c['stop']();});_0x3ce95e=setTimeout(function(){clearTimeout(_0x3ce95e);_0x3c8e1c[_0x3eab('0x1f')]();logger[_0x3eab('0xb')](_0x3eab('0x21'),_0x3b43b2);_0x13626c['next']();},_0x42afa3);strategy[_0x3eab('0x22')](_0x3c8e1c,_0x49aa7a,_0x37085d,_0xc652b8);}else{logger[_0x3eab('0x12')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3b43b2,_0x11a9b7['name']);_0x13626c[_0x3eab('0x17')]();}}}catch(_0x32b7bf){console[_0x3eab('0x23')](_0x32b7bf);logger['error']('[%s][QUEUE]\x20%s',_0x3b43b2,_0x32b7bf[_0x3eab('0x24')]);_0x13626c[_0x3eab('0x17')]();}};}; \ No newline at end of file +var _0x877c=['stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','stop','agents','timeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20END','next','agent'];(function(_0x5ae12b,_0x3b76ca){var _0x575755=function(_0x341a6f){while(--_0x341a6f){_0x5ae12b['push'](_0x5ae12b['shift']());}};_0x575755(++_0x3b76ca);}(_0x877c,0x1f0));var _0xc877=function(_0x15394b,_0x24f000){_0x15394b=_0x15394b-0x0;var _0x1f3b07=_0x877c[_0x15394b];return _0x1f3b07;};'use strict';var schema=require(_0xc877('0x0'));var _=require(_0xc877('0x1'));var util=require(_0xc877('0x2'));var seqqueue=require(_0xc877('0x3'));var logger=require(_0xc877('0x4'))('routing');var strategy=require(_0xc877('0x5'));var queue=schema({'name':{'type':_0xc877('0x6'),'required':!![],'message':_0xc877('0x7')},'timeout':{'type':_0xc877('0x8'),'message':_0xc877('0x9')}});function writeLog(_0x40eb1f,_0x465f74,_0x4b39b0){return logger[_0xc877('0xa')](util[_0xc877('0xb')](_0xc877('0xc'),_0x40eb1f,_0x465f74[_0xc877('0xd')],_0x4b39b0));}function handleFindAgent(_0x4eca41){return function(_0x35d0a0){return _0x35d0a0['name'][_0xc877('0xe')]()===_0x4eca41[_0xc877('0xe')]();};}exports[_0xc877('0xf')]=function(_0x312cbd,_0x34e32a,_0x7d38dc,_0x43b05a){return function(_0x479506){try{var _0x19272c={'name':_0x34e32a[0x0],'timeout':_0x34e32a[0x1]};var _0x49c9de=queue[_0xc877('0x0')](_0x19272c,{'typecast':!![]});if(_0x49c9de[_0xc877('0x10')]){logger[_0xc877('0x11')]('[%s][AGENT]\x20%s',_0x312cbd,_[_0xc877('0x12')](_0x49c9de,_0xc877('0x13'))[_0xc877('0x14')](',\x20'));_0x479506[_0xc877('0x15')]();}else{var _0x14f52e=_['find'](_0x7d38dc[_0xc877('0x16')],handleFindAgent(_0x19272c[_0xc877('0xd')]));if(_0x14f52e){var _0x3dfa30=(_0x19272c[_0xc877('0x17')]||0xa)*0x3e8;var _0x453c06,_0x1abd69;var _0x1f5c51=seqqueue['createQueue'](_0x3dfa30);_0x1f5c51['id']=_0x312cbd;_0x1f5c51['atimeout']=_0x3dfa30;_0x1f5c51[_0xc877('0x18')]=_0x43b05a[_0xc877('0x18')];writeLog(_0x312cbd,_0x14f52e,util[_0xc877('0xb')](_0xc877('0x19'),_0x3dfa30));_0x7d38dc[_0xc877('0x1a')][_0x312cbd]['on'](_0xc877('0x1b'),function(){_0x1f5c51[_0xc877('0x1c')]();clearTimeout(_0x1abd69);_0x1abd69=undefined;if(_0x7d38dc['rules'][_0x312cbd]){delete _0x7d38dc[_0xc877('0x1a')][_0x312cbd];}logger[_0xc877('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x312cbd);_0x479506['stop']();});_0x1abd69=setTimeout(function(){clearTimeout(_0x1abd69);_0x1f5c51[_0xc877('0x1c')]();logger[_0xc877('0xa')](_0xc877('0x1d'),_0x312cbd);_0x479506[_0xc877('0x1e')]();},_0x3dfa30);strategy[_0xc877('0x1f')](_0x1f5c51,_0x14f52e,_0x7d38dc,_0x43b05a);}else{logger[_0xc877('0x11')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x312cbd,_0x19272c[_0xc877('0xd')]);_0x479506['stop']();}}}catch(_0x4021a7){console['log'](_0x4021a7);logger[_0xc877('0x11')]('[%s][QUEUE]\x20%s',_0x312cbd,_0x4021a7[_0xc877('0x20')]);_0x479506[_0xc877('0x15')]();}};}; \ 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 fac1e30..cd9ccdf 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 _0xe742=['interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','stop','$LATEST','message','toString','postText','amazonlex','dialogState','Failed','stringify','moment','aws-sdk','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence'];(function(_0x5a4bfa,_0x87f1fd){var _0x31c1e4=function(_0x41bc8c){while(--_0x41bc8c){_0x5a4bfa['push'](_0x5a4bfa['shift']());}};_0x31c1e4(++_0x87f1fd);}(_0xe742,0xde));var _0x2e74=function(_0x4b5c09,_0x56814b){_0x4b5c09=_0x4b5c09-0x0;var _0x1456d7=_0xe742[_0x4b5c09];return _0x1456d7;};'use strict';var _=require('lodash');var moment=require(_0x2e74('0x0'));var AWS=require(_0x2e74('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x2e74('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2e74('0x3')),'mailMessage':require(_0x2e74('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x2e74('0x5')]=function(_0x23c236,_0x3ce619){return function(_0x38e4e3){try{if(!_['isNil'](this[_0x2e74('0x6')]['UserId'])){logger[_0x2e74('0x7')](_0x2e74('0x8'),_0x23c236,_0x2e74('0x9'));return _0x38e4e3[_0x2e74('0xa')]();}var _0x57b6f7={'ContactId':this[_0x2e74('0xb')]['id'],'sentAt':moment()[_0x2e74('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x535c8f=this[_0x2e74('0xd')];if(_0x535c8f===_0x2e74('0xe')){_0x57b6f7[_0x2e74('0xf')]=this['account']['id'];}else{_0x57b6f7[_[_0x2e74('0x10')](_0x535c8f)+'AccountId']=this[_0x2e74('0x11')]['id'];}_0x57b6f7[_['upperFirst'](_0x535c8f)+_0x2e74('0x12')]=this[_0x2e74('0x6')]['id'];if(this[_0x2e74('0x6')][_0x2e74('0x13')]){var _0x357bb7=_0x3ce619[0x4];if(!_[_0x2e74('0x14')](_0x357bb7)){_0x57b6f7[_0x2e74('0x15')]=utils[_0x2e74('0x16')](_0x357bb7,this);return rpc[_0x535c8f+_0x2e74('0x17')][_0x2e74('0x18')](_0x57b6f7)[_0x2e74('0x19')](function(_0x31b3f4){logger['info']('[%s][AMAZONLEX]\x20%s',_0x23c236,_0x57b6f7['body']);})[_0x2e74('0x1a')](function(_0x2fb763){logger[_0x2e74('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x23c236,JSON['stringify'](_0x2fb763));})[_0x2e74('0x1c')](function(){logger[_0x2e74('0x7')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x23c236);_0x38e4e3[_0x2e74('0x1d')]();});}else{logger[_0x2e74('0x7')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x23c236);_0x38e4e3['stop']();}}else{var _0x4277d9=this;var _0x468e55=new AWS['LexRuntime']({'accessKeyId':_0x3ce619[0x0],'secretAccessKey':_0x3ce619[0x1],'region':_0x3ce619[0x2]});var _0x1a9813={'botAlias':_0x2e74('0x1e'),'botName':_0x3ce619[0x3],'inputText':this[_0x2e74('0x1f')][_0x2e74('0x15')],'userId':this['interaction']['id'][_0x2e74('0x20')]()};_0x468e55[_0x2e74('0x21')](_0x1a9813,function(_0x4665dd,_0x1ef631){if(_0x4665dd){logger['error'](_0x2e74('0x8'),_0x23c236,_0x4665dd[_0x2e74('0x1f')]);_0x38e4e3['next']();}else if(_0x1ef631&&_0x1ef631[_0x2e74('0x1f')]){_0x4277d9['body'][_0x2e74('0x22')]=_0x1ef631;_0x57b6f7[_0x2e74('0x15')]=_0x1ef631[_0x2e74('0x1f')];return rpc[_0x535c8f+_0x2e74('0x17')][_0x2e74('0x18')](_0x57b6f7)['then'](function(_0x3c5458){logger[_0x2e74('0x7')](_0x2e74('0x8'),_0x23c236,_0x57b6f7[_0x2e74('0x15')]);if(_0x1ef631[_0x2e74('0x23')]==_0x2e74('0x24')){_0x38e4e3['next']();}else{_0x38e4e3[_0x2e74('0x1d')]();}})[_0x2e74('0x1a')](function(_0x4f38f6){logger[_0x2e74('0x1b')](_0x2e74('0x8'),_0x23c236,JSON['stringify'](_0x4f38f6));_0x38e4e3[_0x2e74('0xa')]();});}else{_0x38e4e3[_0x2e74('0xa')]();}});}}catch(_0x21d873){logger[_0x2e74('0x1b')](_0x2e74('0x8'),_0x23c236,JSON[_0x2e74('0x25')](_0x21d873));_0x38e4e3['stop']();}};}; \ No newline at end of file +var _0x5016=['dialogState','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','$LATEST','message','postText','amazonlex','then'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x5016,0x160));var _0x6501=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x5016[_0x589f71];return _0x5763bd;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x6501('0x0'));var utils=require(_0x6501('0x1'));var logger=require(_0x6501('0x2'))('routing');var rpc={'chatMessage':require(_0x6501('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6501('0x4')),'smsMessage':require(_0x6501('0x5')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x4c1813,_0x3a1e2b){return function(_0x36df4f){try{if(!_[_0x6501('0x6')](this[_0x6501('0x7')]['UserId'])){logger[_0x6501('0x8')](_0x6501('0x9'),_0x4c1813,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x36df4f[_0x6501('0xa')]();}var _0x4e11d4={'ContactId':this[_0x6501('0xb')]['id'],'sentAt':moment()[_0x6501('0xc')](_0x6501('0xd')),'direction':_0x6501('0xe')};var _0x11eb68=this[_0x6501('0xf')];if(_0x11eb68===_0x6501('0x10')){_0x4e11d4[_0x6501('0x11')]=this[_0x6501('0x12')]['id'];}else{_0x4e11d4[_[_0x6501('0x13')](_0x11eb68)+_0x6501('0x14')]=this[_0x6501('0x12')]['id'];}_0x4e11d4[_[_0x6501('0x13')](_0x11eb68)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x6501('0x15')]){var _0x2dbb9d=_0x3a1e2b[0x4];if(!_[_0x6501('0x16')](_0x2dbb9d)){_0x4e11d4[_0x6501('0x17')]=utils[_0x6501('0x18')](_0x2dbb9d,this);return rpc[_0x11eb68+_0x6501('0x19')][_0x6501('0x1a')](_0x4e11d4)['then'](function(_0xfdf3e1){logger[_0x6501('0x8')](_0x6501('0x9'),_0x4c1813,_0x4e11d4[_0x6501('0x17')]);})[_0x6501('0x1b')](function(_0x38a864){logger[_0x6501('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x4c1813,JSON[_0x6501('0x1d')](_0x38a864));})[_0x6501('0x1e')](function(){logger[_0x6501('0x8')](_0x6501('0x1f'),_0x4c1813);_0x36df4f[_0x6501('0x20')]();});}else{logger[_0x6501('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4c1813);_0x36df4f[_0x6501('0x20')]();}}else{var _0x4e0cc3=this;var _0x3c8453=new AWS['LexRuntime']({'accessKeyId':_0x3a1e2b[0x0],'secretAccessKey':_0x3a1e2b[0x1],'region':_0x3a1e2b[0x2]});var _0x1aeca2={'botAlias':_0x6501('0x21'),'botName':_0x3a1e2b[0x3],'inputText':this[_0x6501('0x22')][_0x6501('0x17')],'userId':this['interaction']['id']['toString']()};_0x3c8453[_0x6501('0x23')](_0x1aeca2,function(_0xa2cce6,_0x4779c7){if(_0xa2cce6){logger[_0x6501('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x4c1813,_0xa2cce6['message']);_0x36df4f['next']();}else if(_0x4779c7&&_0x4779c7[_0x6501('0x22')]){_0x4e0cc3[_0x6501('0x17')][_0x6501('0x24')]=_0x4779c7;_0x4e11d4[_0x6501('0x17')]=_0x4779c7[_0x6501('0x22')];return rpc[_0x11eb68+_0x6501('0x19')][_0x6501('0x1a')](_0x4e11d4)[_0x6501('0x25')](function(_0x396860){logger['info'](_0x6501('0x9'),_0x4c1813,_0x4e11d4[_0x6501('0x17')]);if(_0x4779c7[_0x6501('0x26')]=='Failed'){_0x36df4f[_0x6501('0xa')]();}else{_0x36df4f[_0x6501('0x20')]();}})[_0x6501('0x1b')](function(_0x37cf9b){logger[_0x6501('0x1c')](_0x6501('0x9'),_0x4c1813,JSON[_0x6501('0x1d')](_0x37cf9b));_0x36df4f[_0x6501('0xa')]();});}else{_0x36df4f[_0x6501('0xa')]();}});}}catch(_0x4e7507){logger[_0x6501('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x4c1813,JSON[_0x6501('0x1d')](_0x4e7507));_0x36df4f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 41b328b..af0cf7d 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +var _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x4b97d9,_0x4c508e){var _0x511b39=function(_0x30db55){while(--_0x30db55){_0x4b97d9['push'](_0x4b97d9['shift']());}};_0x511b39(++_0x4c508e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index fed6a26..6e4ab30 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 _0xed3c=['finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','format','Interaction','channel','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x41b164,_0x48d6f1){var _0x635742=function(_0x182dcc){while(--_0x182dcc){_0x41b164['push'](_0x41b164['shift']());}};_0x635742(++_0x48d6f1);}(_0xed3c,0x1a6));var _0xced3=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xed3c[_0x65d12e];return _0x4274e0;};'use strict';var moment=require(_0xced3('0x0'));var logger=require(_0xced3('0x1'))(_0xced3('0x2'));var rpc={'chatInteraction':require(_0xced3('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xced3('0x4')),'mailInteraction':require(_0xced3('0x5')),'faxInteraction':require(_0xced3('0x6'))};exports['consequence']=function(_0x51e500,_0x3d3aa0,_0x1ada18,_0x2f92f8){return function(_0x1cd694){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x51e500,_0x3d3aa0[0x0]);var _0x5ca701={'closed':0x1,'closedAt':moment()[_0xced3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x3d3aa0[0x0]};if(rpc[_0x2f92f8['channel']+_0xced3('0x8')]){rpc[_0x2f92f8[_0xced3('0x9')]+_0xced3('0x8')][_0xced3('0xa')](_0x2f92f8[_0xced3('0xb')]['id'],_0x5ca701)['then'](function(_0x36ea7f){logger[_0xced3('0xc')](_0xced3('0xd'),_0x51e500,_0x2f92f8['interaction']['id']);})[_0xced3('0xe')](function(_0x19b8c2){logger[_0xced3('0xf')](_0xced3('0x10'),_0x51e500,JSON[_0xced3('0x11')](_0x19b8c2));})[_0xced3('0x12')](function(){_0x1cd694[_0xced3('0x13')]();});}}catch(_0x5aadb6){logger[_0xced3('0xf')]('[%s][CLOSE]\x20%s',_0x51e500,JSON[_0xced3('0x11')](_0x5aadb6));_0x1cd694[_0xced3('0x13')]();}};}; \ No newline at end of file +var _0xa446=['update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa446,0xc6));var _0x6a44=function(_0x48ae0a,_0x456c82){_0x48ae0a=_0x48ae0a-0x0;var _0x582a77=_0xa446[_0x48ae0a];return _0x582a77;};'use strict';var moment=require(_0x6a44('0x0'));var logger=require(_0x6a44('0x1'))('routing');var rpc={'chatInteraction':require(_0x6a44('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6a44('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x6a44('0x4'))};exports['consequence']=function(_0x3a8c6f,_0x7b088d,_0x2701a9,_0x1bcc30){return function(_0x1fc85d){try{logger[_0x6a44('0x5')]('[%s][CLOSE]\x20reason\x20%s',_0x3a8c6f,_0x7b088d[0x0]);var _0x1569ec={'closed':0x1,'closedAt':moment()[_0x6a44('0x6')](_0x6a44('0x7')),'closeReason':_0x6a44('0x8'),'disposition':_0x7b088d[0x0]};if(rpc[_0x1bcc30[_0x6a44('0x9')]+'Interaction']){rpc[_0x1bcc30[_0x6a44('0x9')]+_0x6a44('0xa')][_0x6a44('0xb')](_0x1bcc30[_0x6a44('0xc')]['id'],_0x1569ec)[_0x6a44('0xd')](function(_0x159d5d){logger[_0x6a44('0x5')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x3a8c6f,_0x1bcc30[_0x6a44('0xc')]['id']);})[_0x6a44('0xe')](function(_0x4a7ab2){logger[_0x6a44('0xf')](_0x6a44('0x10'),_0x3a8c6f,JSON[_0x6a44('0x11')](_0x4a7ab2));})['finally'](function(){_0x1fc85d[_0x6a44('0x12')]();});}}catch(_0x3fcead){logger[_0x6a44('0xf')](_0x6a44('0x10'),_0x3a8c6f,JSON[_0x6a44('0x11')](_0x3fcead));_0x1fc85d[_0x6a44('0x12')]();}};}; \ 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 6191833..56facd1 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 _0x4745=['../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','isEmpty','body','getMustacheRender','Message','create','catch','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','then','metadata','error','stringify','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x5a6e4e,_0xa59e83){var _0x2f89f=function(_0x17072a){while(--_0x17072a){_0x5a6e4e['push'](_0x5a6e4e['shift']());}};_0x2f89f(++_0xa59e83);}(_0x4745,0x84));var _0x5474=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4745[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x5474('0x0'));var moment=require('moment');var apiai=require(_0x5474('0x1'));var md5=require(_0x5474('0x2'));var utils=require(_0x5474('0x3'));var logger=require(_0x5474('0x4'))('routing');var rpc={'chatMessage':require(_0x5474('0x5')),'openchannelMessage':require(_0x5474('0x6')),'mailMessage':require(_0x5474('0x7')),'smsMessage':require(_0x5474('0x8')),'faxMessage':require(_0x5474('0x9'))};exports[_0x5474('0xa')]=function(_0x55594b,_0xb3a654){return function(_0x5ec268){try{if(!_[_0x5474('0xb')](this['interaction'][_0x5474('0xc')])){logger[_0x5474('0xd')](_0x5474('0xe'),_0x55594b,_0x5474('0xf'));return _0x5ec268[_0x5474('0x10')]();}var _0x6f6869={'ContactId':this[_0x5474('0x11')]['id'],'sentAt':moment()[_0x5474('0x12')](_0x5474('0x13')),'direction':_0x5474('0x14')};var _0x131a3e=this[_0x5474('0x15')];if(_0x131a3e===_0x5474('0x16')){_0x6f6869[_0x5474('0x17')]=this[_0x5474('0x18')]['id'];}else{_0x6f6869[_[_0x5474('0x19')](_0x131a3e)+_0x5474('0x1a')]=this[_0x5474('0x18')]['id'];}_0x6f6869[_[_0x5474('0x19')](_0x131a3e)+_0x5474('0x1b')]=this[_0x5474('0x1c')]['id'];if(this[_0x5474('0x1c')]['created']){var _0x4ed932=_0xb3a654[0x2];if(!_[_0x5474('0x1d')](_0x4ed932)){_0x6f6869[_0x5474('0x1e')]=utils[_0x5474('0x1f')](_0x4ed932,this);return rpc[_0x131a3e+_0x5474('0x20')][_0x5474('0x21')](_0x6f6869)['then'](function(_0x3ccd3d){logger[_0x5474('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x55594b,_0x6f6869[_0x5474('0x1e')]);})[_0x5474('0x22')](function(_0x98b7de){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x55594b,JSON['stringify'](_0x98b7de));})['finally'](function(){logger[_0x5474('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x55594b);_0x5ec268[_0x5474('0x23')]();});}else{logger[_0x5474('0xd')](_0x5474('0x24'),_0x55594b);_0x5ec268['stop']();}}else{var _0x3e8483=this;var _0x3ab021=apiai(_0xb3a654[0x0],{'language':_0xb3a654[0x1]||'en'});return _0x3ab021[_0x5474('0x25')](this[_0x5474('0x26')][_0x5474('0x1e')],{'sessionId':md5(this[_0x5474('0x1c')]['id'])})['then'](function(_0x57baf6){_0x3e8483['body'][_0x5474('0x27')]=_0x57baf6;_0x6f6869['body']=_0x57baf6[_0x5474('0x28')][_0x5474('0x29')][_0x5474('0x2a')];return rpc[_0x131a3e+'Message'][_0x5474('0x21')](_0x6f6869)[_0x5474('0x2b')](function(_0x2e7120){logger[_0x5474('0xd')](_0x5474('0xe'),_0x55594b,_0x6f6869[_0x5474('0x1e')]);if(_0x57baf6[_0x5474('0x28')][_0x5474('0x2c')]['endConversation']){_0x5ec268[_0x5474('0x10')]();}else{_0x5ec268[_0x5474('0x23')]();}})['catch'](function(_0x1f2206){logger[_0x5474('0x2d')](_0x5474('0xe'),_0x55594b,JSON[_0x5474('0x2e')](_0x1f2206));_0x5ec268[_0x5474('0x10')]();});})[_0x5474('0x22')](function(_0x5cb75a){logger['error'](_0x5474('0xe'),_0x55594b,_0x5cb75a[_0x5474('0x26')]);_0x5ec268[_0x5474('0x10')]();});}}catch(_0x20dc0a){logger[_0x5474('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x55594b,JSON[_0x5474('0x2e')](_0x20dc0a));_0x5ec268[_0x5474('0x23')]();}};}; \ No newline at end of file +var _0x4073=['AccountId','isEmpty','body','getMustacheRender','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','endConversation','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','ChatWebsiteId','account','upperFirst'];(function(_0x2c9e1d,_0x5b4849){var _0x2a3594=function(_0x2b9610){while(--_0x2b9610){_0x2c9e1d['push'](_0x2c9e1d['shift']());}};_0x2a3594(++_0x5b4849);}(_0x4073,0x17c));var _0x3407=function(_0x544e92,_0x10ca56){_0x544e92=_0x544e92-0x0;var _0x521ca1=_0x4073[_0x544e92];return _0x521ca1;};'use strict';var _=require('lodash');var moment=require(_0x3407('0x0'));var apiai=require(_0x3407('0x1'));var md5=require(_0x3407('0x2'));var utils=require(_0x3407('0x3'));var logger=require(_0x3407('0x4'))(_0x3407('0x5'));var rpc={'chatMessage':require(_0x3407('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3407('0x7')),'smsMessage':require(_0x3407('0x8')),'faxMessage':require(_0x3407('0x9'))};exports['consequence']=function(_0x4fae20,_0x570eda){return function(_0x374ff9){try{if(!_['isNil'](this[_0x3407('0xa')][_0x3407('0xb')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4fae20,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x374ff9[_0x3407('0xc')]();}var _0x244c9e={'ContactId':this[_0x3407('0xd')]['id'],'sentAt':moment()['format'](_0x3407('0xe')),'direction':_0x3407('0xf')};var _0x3adb02=this[_0x3407('0x10')];if(_0x3adb02==='chat'){_0x244c9e[_0x3407('0x11')]=this[_0x3407('0x12')]['id'];}else{_0x244c9e[_[_0x3407('0x13')](_0x3adb02)+_0x3407('0x14')]=this[_0x3407('0x12')]['id'];}_0x244c9e[_[_0x3407('0x13')](_0x3adb02)+'InteractionId']=this['interaction']['id'];if(this['interaction']['created']){var _0x30651f=_0x570eda[0x2];if(!_[_0x3407('0x15')](_0x30651f)){_0x244c9e[_0x3407('0x16')]=utils[_0x3407('0x17')](_0x30651f,this);return rpc[_0x3adb02+'Message'][_0x3407('0x18')](_0x244c9e)[_0x3407('0x19')](function(_0x33bb49){logger['info'](_0x3407('0x1a'),_0x4fae20,_0x244c9e[_0x3407('0x16')]);})[_0x3407('0x1b')](function(_0x1859cd){logger[_0x3407('0x1c')](_0x3407('0x1a'),_0x4fae20,JSON[_0x3407('0x1d')](_0x1859cd));})['finally'](function(){logger[_0x3407('0x1e')](_0x3407('0x1f'),_0x4fae20);_0x374ff9[_0x3407('0x20')]();});}else{logger[_0x3407('0x1e')](_0x3407('0x21'),_0x4fae20);_0x374ff9[_0x3407('0x20')]();}}else{var _0x94dbb6=this;var _0x3fc181=apiai(_0x570eda[0x0],{'language':_0x570eda[0x1]||'en'});return _0x3fc181['textRequest'](this[_0x3407('0x22')][_0x3407('0x16')],{'sessionId':md5(this[_0x3407('0xa')]['id'])})['then'](function(_0x2a688f){_0x94dbb6[_0x3407('0x16')][_0x3407('0x23')]=_0x2a688f;_0x244c9e[_0x3407('0x16')]=_0x2a688f[_0x3407('0x24')][_0x3407('0x25')][_0x3407('0x26')];return rpc[_0x3adb02+'Message'][_0x3407('0x18')](_0x244c9e)[_0x3407('0x19')](function(_0x54096e){logger[_0x3407('0x1e')](_0x3407('0x1a'),_0x4fae20,_0x244c9e[_0x3407('0x16')]);if(_0x2a688f[_0x3407('0x24')]['metadata'][_0x3407('0x27')]){_0x374ff9[_0x3407('0xc')]();}else{_0x374ff9[_0x3407('0x20')]();}})['catch'](function(_0x1cda93){logger[_0x3407('0x1c')](_0x3407('0x1a'),_0x4fae20,JSON['stringify'](_0x1cda93));_0x374ff9[_0x3407('0xc')]();});})[_0x3407('0x1b')](function(_0xc745db){logger[_0x3407('0x1c')](_0x3407('0x1a'),_0x4fae20,_0xc745db[_0x3407('0x22')]);_0x374ff9[_0x3407('0xc')]();});}}catch(_0x34fa65){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4fae20,JSON['stringify'](_0x34fa65));_0x374ff9[_0x3407('0x20')]();}};}; \ 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 3372205..387ea24 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 _0xd665=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x30f790,_0x37bb95){var _0x3f4dea=function(_0x19a37d){while(--_0x19a37d){_0x30f790['push'](_0x30f790['shift']());}};_0x3f4dea(++_0x37bb95);}(_0xd665,0xca));var _0x5d66=function(_0x4177e8,_0x5a313b){_0x4177e8=_0x4177e8-0x0;var _0x35ced7=_0xd665[_0x4177e8];return _0x35ced7;};'use strict';var schema=require(_0x5d66('0x0'));var _=require(_0x5d66('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x5d66('0x2'));var logger=require('../../../../config/logger')(_0x5d66('0x3'));var gotoif=schema({'condition':{'type':_0x5d66('0x4'),'required':!![],'message':_0x5d66('0x5')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x5d66('0x6')}});exports[_0x5d66('0x7')]=function(_0x4b247f,_0x3a25e3){return function(_0x6bcdc2){try{var _0xedf3a2={'condition':htmlToText[_0x5d66('0x8')](utils['getMustacheRender'](_0x3a25e3[0x0],this),{'wordwrap':![]})[_0x5d66('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3a25e3[0x1],'priorityFalse':_0x3a25e3[0x2]};var _0x4ae203=gotoif[_0x5d66('0x0')](_0xedf3a2,{'typecast':!![]});if(_0x4ae203[_0x5d66('0xa')]){logger[_0x5d66('0xb')]('[%s][GOTOIF]\x20%s',_0x4b247f,_[_0x5d66('0xc')](_0x4ae203,_0x5d66('0xd'))[_0x5d66('0xe')](',\x20'));_0x6bcdc2['stop']();}else{try{var _0x40f53d=eval('('+_0xedf3a2[_0x5d66('0xf')]+')');var _0x464b31=_0x40f53d?_0xedf3a2[_0x5d66('0x10')]:_0xedf3a2[_0x5d66('0x11')];logger[_0x5d66('0x12')](_0x5d66('0x13'),_0x4b247f,_0xedf3a2[_0x5d66('0xf')],_0x40f53d,_0x464b31||_0x5d66('0x14'));if(_0x464b31){var _0xa8d4e0=_[_0x5d66('0x15')](_0x6bcdc2[_0x5d66('0x16')](),{'p':_0x464b31});if(_0xa8d4e0>=0x0){logger[_0x5d66('0x12')](_0x5d66('0x17'),_0x4b247f,_0x464b31||_0x5d66('0x14'),_0xa8d4e0);_0x6bcdc2[_0x5d66('0x14')](_0xa8d4e0);}else{logger[_0x5d66('0x12')](_0x5d66('0x18'),_0x4b247f,_0x464b31||_0x5d66('0x14'));_0x6bcdc2[_0x5d66('0x19')]();}}else{_0x6bcdc2[_0x5d66('0x14')]();}}catch(_0x320132){logger[_0x5d66('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4b247f,_0x320132[_0x5d66('0xd')]);_0x6bcdc2[_0x5d66('0x19')]();}}}catch(_0x10255e){logger[_0x5d66('0xb')](_0x5d66('0x1a'),_0x4b247f,JSON[_0x5d66('0x1b')](_0x10255e));_0x6bcdc2[_0x5d66('0x19')]();}};}; \ No newline at end of file +var _0x1b3a=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','string'];(function(_0x10f531,_0x271281){var _0x4d269b=function(_0x28ffd3){while(--_0x28ffd3){_0x10f531['push'](_0x10f531['shift']());}};_0x4d269b(++_0x271281);}(_0x1b3a,0x1ab));var _0xa1b3=function(_0x41b8b7,_0x1a8562){_0x41b8b7=_0x41b8b7-0x0;var _0x445992=_0x1b3a[_0x41b8b7];return _0x445992;};'use strict';var schema=require(_0xa1b3('0x0'));var _=require('lodash');var htmlToText=require(_0xa1b3('0x1'));var utils=require(_0xa1b3('0x2'));var logger=require(_0xa1b3('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xa1b3('0x4'),'required':!![],'message':_0xa1b3('0x5')},'priorityTrue':{'type':'number','message':_0xa1b3('0x6')},'priorityFalse':{'type':_0xa1b3('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa1b3('0x8')]=function(_0x40db63,_0x2cd80f){return function(_0x3e48f3){try{var _0x580ed7={'condition':htmlToText[_0xa1b3('0x9')](utils[_0xa1b3('0xa')](_0x2cd80f[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2cd80f[0x1],'priorityFalse':_0x2cd80f[0x2]};var _0x567130=gotoif[_0xa1b3('0x0')](_0x580ed7,{'typecast':!![]});if(_0x567130[_0xa1b3('0xb')]){logger['error'](_0xa1b3('0xc'),_0x40db63,_[_0xa1b3('0xd')](_0x567130,_0xa1b3('0xe'))[_0xa1b3('0xf')](',\x20'));_0x3e48f3[_0xa1b3('0x10')]();}else{try{var _0x42fc20=eval('('+_0x580ed7[_0xa1b3('0x11')]+')');var _0x192dd5=_0x42fc20?_0x580ed7['priorityTrue']:_0x580ed7['priorityFalse'];logger[_0xa1b3('0x12')](_0xa1b3('0x13'),_0x40db63,_0x580ed7[_0xa1b3('0x11')],_0x42fc20,_0x192dd5||_0xa1b3('0x14'));if(_0x192dd5){var _0x522766=_[_0xa1b3('0x15')](_0x3e48f3['rules'](),{'p':_0x192dd5});if(_0x522766>=0x0){logger[_0xa1b3('0x12')](_0xa1b3('0x16'),_0x40db63,_0x192dd5||_0xa1b3('0x14'),_0x522766);_0x3e48f3[_0xa1b3('0x14')](_0x522766);}else{logger[_0xa1b3('0x12')](_0xa1b3('0x17'),_0x40db63,_0x192dd5||_0xa1b3('0x14'));_0x3e48f3[_0xa1b3('0x10')]();}}else{_0x3e48f3[_0xa1b3('0x14')]();}}catch(_0x1bca2){logger[_0xa1b3('0x18')](_0xa1b3('0x19'),_0x40db63,_0x1bca2[_0xa1b3('0xe')]);_0x3e48f3[_0xa1b3('0x10')]();}}}catch(_0x52f4ff){logger[_0xa1b3('0x18')](_0xa1b3('0xc'),_0x40db63,JSON[_0xa1b3('0x1a')](_0x52f4ff));_0x3e48f3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 7a80761..2a770c8 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 _0x9226=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info'];(function(_0x24d4e8,_0x4611f3){var _0x3ff886=function(_0x2d34aa){while(--_0x2d34aa){_0x24d4e8['push'](_0x24d4e8['shift']());}};_0x3ff886(++_0x4611f3);}(_0x9226,0xae));var _0x6922=function(_0x3030a8,_0x2b34fd){_0x3030a8=_0x3030a8-0x0;var _0x22f252=_0x9226[_0x3030a8];return _0x22f252;};'use strict';var schema=require(_0x6922('0x0'));var _=require(_0x6922('0x1'));var logger=require(_0x6922('0x2'))(_0x6922('0x3'));var gotop=schema({'priority':{'type':_0x6922('0x4'),'required':!![],'message':_0x6922('0x5')}});exports[_0x6922('0x6')]=function(_0x418e2d,_0x1f4474){return function(_0x5a95ef){try{var _0x58f48f={'priority':_0x1f4474[0x0]};var _0x1266ad=gotop[_0x6922('0x0')](_0x58f48f,{'typecast':!![]});if(_0x1266ad['length']){logger[_0x6922('0x7')](_0x6922('0x8'),_0x418e2d,_['map'](_0x1266ad,'message')[_0x6922('0x9')](',\x20'));_0x5a95ef[_0x6922('0xa')]();}else{logger['info'](_0x6922('0xb'),_0x418e2d,_0x58f48f[_0x6922('0xc')]);if(_0x58f48f[_0x6922('0xc')]){var _0x5e3d9f=_[_0x6922('0xd')](_0x5a95ef[_0x6922('0xe')](),{'p':_0x58f48f[_0x6922('0xc')]});if(_0x5e3d9f>=0x0){logger[_0x6922('0xf')](_0x6922('0x10'),_0x418e2d,_0x58f48f[_0x6922('0xc')]||_0x6922('0x11'),_0x5e3d9f);_0x5a95ef[_0x6922('0x11')](_0x5e3d9f);}else{logger[_0x6922('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x418e2d,_0x58f48f[_0x6922('0xc')]||'next');_0x5a95ef[_0x6922('0xa')]();}}else{_0x5a95ef['next']();}}}catch(_0x491713){logger[_0x6922('0x7')](_0x6922('0x8'),_0x418e2d,JSON[_0x6922('0x12')](_0x491713));_0x5a95ef[_0x6922('0xa')]();}};}; \ No newline at end of file +var _0x6ad6=['join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','validate','lodash','../../../../config/logger','routing','number','consequence','length','map','message'];(function(_0x1a8e6d,_0x4296fc){var _0x312091=function(_0x14259f){while(--_0x14259f){_0x1a8e6d['push'](_0x1a8e6d['shift']());}};_0x312091(++_0x4296fc);}(_0x6ad6,0x14d));var _0x66ad=function(_0xf6c43a,_0x466ec7){_0xf6c43a=_0xf6c43a-0x0;var _0x24e4f8=_0x6ad6[_0xf6c43a];return _0x24e4f8;};'use strict';var schema=require(_0x66ad('0x0'));var _=require(_0x66ad('0x1'));var logger=require(_0x66ad('0x2'))(_0x66ad('0x3'));var gotop=schema({'priority':{'type':_0x66ad('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x66ad('0x5')]=function(_0x3a5121,_0x448d4b){return function(_0x24a91b){try{var _0x4dbbc9={'priority':_0x448d4b[0x0]};var _0x53d469=gotop['validate'](_0x4dbbc9,{'typecast':!![]});if(_0x53d469[_0x66ad('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x3a5121,_[_0x66ad('0x7')](_0x53d469,_0x66ad('0x8'))[_0x66ad('0x9')](',\x20'));_0x24a91b[_0x66ad('0xa')]();}else{logger[_0x66ad('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x3a5121,_0x4dbbc9[_0x66ad('0xc')]);if(_0x4dbbc9['priority']){var _0x227af4=_[_0x66ad('0xd')](_0x24a91b[_0x66ad('0xe')](),{'p':_0x4dbbc9['priority']});if(_0x227af4>=0x0){logger[_0x66ad('0xb')](_0x66ad('0xf'),_0x3a5121,_0x4dbbc9[_0x66ad('0xc')]||_0x66ad('0x10'),_0x227af4);_0x24a91b[_0x66ad('0x10')](_0x227af4);}else{logger[_0x66ad('0xb')](_0x66ad('0x11'),_0x3a5121,_0x4dbbc9[_0x66ad('0xc')]||_0x66ad('0x10'));_0x24a91b[_0x66ad('0xa')]();}}else{_0x24a91b['next']();}}}catch(_0x4dda0b){logger['error'](_0x66ad('0x12'),_0x3a5121,JSON['stringify'](_0x4dda0b));_0x24a91b[_0x66ad('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index d76dc39..4de0fcd 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 _0xbfc3=['[%s][MESSAGE]\x20%s','next','error','stop','stringify','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','info'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xbfc3,0x18c));var _0x3bfc=function(_0x268881,_0x554bed){_0x268881=_0x268881-0x0;var _0x2a1326=_0xbfc3[_0x268881];return _0x2a1326;};'use strict';var _=require(_0x3bfc('0x0'));var utils=require('./utils');var logger=require(_0x3bfc('0x1'))(_0x3bfc('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3bfc('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3bfc('0x4')),'faxMessage':require(_0x3bfc('0x5'))};exports[_0x3bfc('0x6')]=function(_0x1495f2,_0x5c4df3){return function(_0x2a4b6d){try{var _0x58fb74={'body':utils[_0x3bfc('0x7')](_0x5c4df3[0x0],this),'ContactId':this[_0x3bfc('0x8')]['id']};if(this[_0x3bfc('0x9')]===_0x3bfc('0xa')){_0x58fb74[_0x3bfc('0xb')]=this[_0x3bfc('0xc')]['id'];}else{_0x58fb74[_[_0x3bfc('0xd')](this[_0x3bfc('0x9')])+'AccountId']=this['account']['id'];}_0x58fb74[_[_0x3bfc('0xd')](this[_0x3bfc('0x9')])+_0x3bfc('0xe')]=this[_0x3bfc('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x3bfc('0x9')]+'Message'][_0x3bfc('0x10')](_0x58fb74)['then'](function(_0x2a8995){logger[_0x3bfc('0x11')](_0x3bfc('0x12'),_0x1495f2,_0x58fb74['body']);_0x2a4b6d[_0x3bfc('0x13')]();})['catch'](function(_0xbe3ea8){logger[_0x3bfc('0x14')](_0x3bfc('0x12'),_0x1495f2,JSON['stringify'](_0xbe3ea8));_0x2a4b6d[_0x3bfc('0x15')]();});}}catch(_0x18d892){logger[_0x3bfc('0x14')]('[%s][MESSAGE]\x20%s',_0x1495f2,JSON[_0x3bfc('0x16')](_0x18d892));_0x2a4b6d[_0x3bfc('0x15')]();}};}; \ No newline at end of file +var _0xd5a5=['../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','then','next','error','stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x89b8a7,_0x3a7315){var _0x41d798=function(_0x1830ff){while(--_0x1830ff){_0x89b8a7['push'](_0x89b8a7['shift']());}};_0x41d798(++_0x3a7315);}(_0xd5a5,0x85));var _0x5d5a=function(_0x273ae2,_0x22968b){_0x273ae2=_0x273ae2-0x0;var _0x1c0cf4=_0xd5a5[_0x273ae2];return _0x1c0cf4;};'use strict';var _=require(_0x5d5a('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x5d5a('0x1'));var rpc={'chatMessage':require(_0x5d5a('0x2')),'openchannelMessage':require(_0x5d5a('0x3')),'mailMessage':require(_0x5d5a('0x4')),'smsMessage':require(_0x5d5a('0x5')),'faxMessage':require(_0x5d5a('0x6'))};exports[_0x5d5a('0x7')]=function(_0xb89046,_0x390c3b){return function(_0x18a1e7){try{var _0x3718cc={'body':utils[_0x5d5a('0x8')](_0x390c3b[0x0],this),'ContactId':this[_0x5d5a('0x9')]['id']};if(this[_0x5d5a('0xa')]==='chat'){_0x3718cc[_0x5d5a('0xb')]=this['account']['id'];}else{_0x3718cc[_[_0x5d5a('0xc')](this['channel'])+_0x5d5a('0xd')]=this[_0x5d5a('0xe')]['id'];}_0x3718cc[_[_0x5d5a('0xc')](this[_0x5d5a('0xa')])+_0x5d5a('0xf')]=this[_0x5d5a('0x10')]['id'];if(rpc[this['channel']+_0x5d5a('0x11')]){return rpc[this[_0x5d5a('0xa')]+'Message']['create'](_0x3718cc)[_0x5d5a('0x12')](function(_0x2a234e){logger['info']('[%s][MESSAGE]\x20%s',_0xb89046,_0x3718cc['body']);_0x18a1e7[_0x5d5a('0x13')]();})['catch'](function(_0x2dd376){logger[_0x5d5a('0x14')]('[%s][MESSAGE]\x20%s',_0xb89046,JSON[_0x5d5a('0x15')](_0x2dd376));_0x18a1e7[_0x5d5a('0x16')]();});}}catch(_0x56eb2d){logger[_0x5d5a('0x14')]('[%s][MESSAGE]\x20%s',_0xb89046,JSON[_0x5d5a('0x15')](_0x56eb2d));_0x18a1e7[_0x5d5a('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index d3451cd..f444af2 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 _0x5094=['info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0xe6cbe9,_0xe9c426){var _0x4d6230=function(_0x3976a0){while(--_0x3976a0){_0xe6cbe9['push'](_0xe6cbe9['shift']());}};_0x4d6230(++_0xe9c426);}(_0x5094,0x1b4));var _0x4509=function(_0x3285d4,_0x136036){_0x3285d4=_0x3285d4-0x0;var _0x5408c9=_0x5094[_0x3285d4];return _0x5408c9;};'use strict';var utils=require(_0x4509('0x0'));var logger=require(_0x4509('0x1'))(_0x4509('0x2'));exports[_0x4509('0x3')]=function(_0x191e2d,_0x488536){return function(_0x2a5998){try{logger[_0x4509('0x4')]('[%s][NOOP]\x20%s',_0x191e2d,utils[_0x4509('0x5')](_0x488536[0x0],this));_0x2a5998[_0x4509('0x6')]();}catch(_0x2e64b6){logger[_0x4509('0x7')](_0x4509('0x8'),_0x191e2d,JSON[_0x4509('0x9')](_0x2e64b6));_0x2a5998['stop']();}};}; \ No newline at end of file +var _0x394e=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','../../../../config/logger','routing','consequence'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0x394e,0x11d));var _0xe394=function(_0x205d4f,_0x1551d7){_0x205d4f=_0x205d4f-0x0;var _0x2a740b=_0x394e[_0x205d4f];return _0x2a740b;};'use strict';var utils=require('./utils');var logger=require(_0xe394('0x0'))(_0xe394('0x1'));exports[_0xe394('0x2')]=function(_0x114e1f,_0x549188){return function(_0x57a35e){try{logger[_0xe394('0x3')](_0xe394('0x4'),_0x114e1f,utils[_0xe394('0x5')](_0x549188[0x0],this));_0x57a35e[_0xe394('0x6')]();}catch(_0x3c50be){logger['error'](_0xe394('0x4'),_0x114e1f,JSON[_0xe394('0x7')](_0x3c50be));_0x57a35e['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 10e22d3..e72be2b 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 _0x100a=['emit','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x100a,0x128));var _0xa100=function(_0x50a818,_0x39b486){_0x50a818=_0x50a818-0x0;var _0x50859d=_0x100a[_0x50a818];return _0x50859d;};'use strict';var schema=require(_0xa100('0x0'));var _=require('lodash');var util=require(_0xa100('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xa100('0x2'));var Redis=require('ioredis');var config=require(_0xa100('0x3'));var logger=require(_0xa100('0x4'))(_0xa100('0x5'));var strategy=require(_0xa100('0x6'));config[_0xa100('0x7')]=_[_0xa100('0x8')](config['redis'],{'host':_0xa100('0x9'),'port':0x18eb});var io=require(_0xa100('0xa'))(new Redis(config[_0xa100('0x7')]));var attributes=['id',_0xa100('0xb'),_0xa100('0xc'),_0xa100('0xd'),_0xa100('0xe'),_0xa100('0xf')];function emit(_0x4055ae,_0x42ee34,_0x3e5de4){io['to'](_0x4055ae)[_0xa100('0x10')](_0x42ee34,_0x3e5de4);}function emitChannelQueueInteraction(_0x504785,_0x27cc28,_0x2c51c9,_0x55f1ac,_0x42b029,_0x50ec2d,_0x3891dd,_0x19bd7d){_0x2c51c9[_0xa100('0xb')]=_0x19bd7d;_0x2c51c9['queue']=_0x27cc28;_0x2c51c9[_0xa100('0xc')]=_0x55f1ac;_0x2c51c9['id']=_0x42b029;if(_0x50ec2d){_0x3891dd[util['format'](_0xa100('0x11'),_0x504785)][_0x42b029]=_[_0xa100('0x12')](_0x2c51c9,attributes);}else{delete _0x3891dd[util[_0xa100('0x13')](_0xa100('0x11'),_0x504785)][_0x42b029];}emit(util[_0xa100('0x13')]('%s:queue:%s',_0x504785,_0x27cc28),util[_0xa100('0x13')](_0xa100('0x14'),_0x504785,_0x50ec2d?_0xa100('0x15'):_0xa100('0x16')),_[_0xa100('0x12')](_0x2c51c9,attributes));}var rpc={'openchannelQueueReport':require(_0xa100('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa100('0x18')),'faxQueueReport':require(_0xa100('0x19'))};var queue=schema({'name':{'type':_0xa100('0x1a'),'required':!![],'message':_0xa100('0x1b')},'timeout':{'type':_0xa100('0x1c'),'message':_0xa100('0x1d')}});function startRouting(_0x20c568,_0x29e8d5,_0x28ac3c,_0x3c51d2){if(_0x20c568&&_0x29e8d5&&_0x28ac3c){_0x29e8d5[_0xa100('0x1e')]+=0x1;var _0x2ab49d={'uniqueid':_0x20c568,'from':_0x28ac3c[_0xa100('0x1f')]?_0x28ac3c[_0xa100('0x1f')][_0xa100('0xe')]:'','joinAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'ContactId':_0x28ac3c['contact']?_0x28ac3c[_0xa100('0x21')]['id']:null,'ListId':_0x28ac3c['list']?_0x28ac3c['list']['id']:null};_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+'QueueId']=_0x29e8d5['id']||null;_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+_0xa100('0x23')]=_0x28ac3c['interaction']?_0x28ac3c[_0xa100('0x24')]['id']:null;_0x2ab49d[_[_0xa100('0x25')](_0x28ac3c[_0xa100('0x22')])+_0xa100('0x26')]=_0x28ac3c[_0xa100('0x27')]?_0x28ac3c[_0xa100('0x27')]['id']:null;_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+(_0x28ac3c[_0xa100('0x22')]!==_0xa100('0x28')?_0xa100('0x29'):_0xa100('0x2a'))]=_0x28ac3c[_0xa100('0xc')]?_0x28ac3c[_0xa100('0xc')]['id']:null;logger[_0xa100('0x2b')](util[_0xa100('0x13')](_0xa100('0x2c'),_0x20c568,_0x29e8d5['name']));emitChannelQueueInteraction(_0x28ac3c[_0xa100('0x22')],_0x29e8d5['name'],_0x2ab49d,_0x28ac3c[_0xa100('0xc')][_0xa100('0x2d')],_0x28ac3c[_0xa100('0x27')]['id'],!![],_0x3c51d2,_0x29e8d5['id']);if(rpc[_0x28ac3c[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x28ac3c[_0xa100('0x22')]+_0xa100('0x2e')][_0xa100('0x2f')](_0x2ab49d)['catch'](function(_0x1d5467){logger[_0xa100('0x30')](_0xa100('0x31'));});}}}function stopRouting(_0x336db9,_0x56828,_0x2e9160,_0xd0ea0c){if(_0x336db9&&_0x56828){_0x56828[_0xa100('0x1e')]-=0x1;var _0x2fa154={'leaveAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'acceptAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'reason':_0xa100('0x32')};logger[_0xa100('0x2b')](util[_0xa100('0x13')](_0xa100('0x33'),_0x336db9,_0x56828[_0xa100('0x2d')]));emitChannelQueueInteraction(_0x2e9160[_0xa100('0x22')],_0x56828['name'],_0x2e9160[_0xa100('0x1f')],_0x2e9160['account'][_0xa100('0x2d')],_0x2e9160[_0xa100('0x27')]['id'],![],_0xd0ea0c,_0x56828['id']);if(rpc[_0x2e9160[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x2e9160[_0xa100('0x22')]+'QueueReport'][_0xa100('0x34')](_0x336db9,_0x2fa154)[_0xa100('0x35')](function(_0x2f892d){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x3e6852,_0x349069,_0x42e2ae,_0x33731a){if(_0x3e6852&&_0x349069){_0x349069[_0xa100('0x1e')]-=0x1;var _0x48532d={'leaveAt':moment()[_0xa100('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'reason':_0xa100('0x36')};logger[_0xa100('0x2b')](util['format'](_0xa100('0x37'),_0x3e6852,_0x349069[_0xa100('0x2d')]));emitChannelQueueInteraction(_0x42e2ae['channel'],_0x349069['name'],_0x42e2ae['body'],_0x42e2ae['account'][_0xa100('0x2d')],_0x42e2ae[_0xa100('0x27')]['id'],![],_0x33731a);if(rpc[_0x42e2ae[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x42e2ae[_0xa100('0x22')]+_0xa100('0x2e')][_0xa100('0x34')](_0x3e6852,_0x48532d)[_0xa100('0x35')](function(_0x21b7db){logger['error'](_0xa100('0x38'));});}}}function handleFindQueue(_0x1cb738){return function(_0x29a8cf){return _0x29a8cf['name']['toLowerCase']()===_0x1cb738['toLowerCase']();};}exports[_0xa100('0x39')]=function(_0x20d6ce,_0x44f99f,_0x5ae3d7,_0x63ddca){return function(_0x4161a1){try{var _0x2a9c5f={'name':_0x44f99f[0x0],'timeout':_0x44f99f[0x1]};var _0x44f86f=queue['validate'](_0x2a9c5f,{'typecast':!![]});if(_0x44f86f[_0xa100('0x3a')]){logger[_0xa100('0x30')](_0xa100('0x3b'),_0x20d6ce,_[_0xa100('0x3c')](_0x44f86f,_0xa100('0x27'))['join'](',\x20'));_0x4161a1[_0xa100('0x3d')]();}else{var _0x158043=_[_0xa100('0x3e')](_0x5ae3d7[_0x63ddca[_0xa100('0x22')]+_0xa100('0x3f')],handleFindQueue(_0x2a9c5f['name']));if(_0x158043){startRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);var _0x25d85d=(_0x158043['timeout']||0xa)*0x3e8;var _0x2729ca=(_0x2a9c5f[_0xa100('0x36')]||0x14)*0x3e8;var _0x2a5ff6,_0x26248b;if(_0x25d85d>_0x2729ca){_0x2729ca=_0x25d85d;}var _0x235466=seqqueue[_0xa100('0x40')](_0x25d85d);_0x235466['id']=_0x20d6ce;_0x235466[_0xa100('0x41')]=_0x25d85d;_0x235466[_0xa100('0x42')]=_0x2729ca;_0x235466['channel']=_0x63ddca[_0xa100('0x22')];_0x5ae3d7['rules'][_0x20d6ce]['on']('end',function(){stopRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);_0x235466[_0xa100('0x43')](!![]);clearTimeout(_0x2a5ff6);_0x2a5ff6=undefined;if(_0x5ae3d7[_0xa100('0x44')][_0x20d6ce]){delete _0x5ae3d7[_0xa100('0x44')][_0x20d6ce];}logger[_0xa100('0x2b')](_0xa100('0x45'),_0x20d6ce);_0x4161a1['stop']();});_0x2a5ff6=setTimeout(function(){endRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);clearTimeout(_0x2a5ff6);_0x235466['close'](!![]);logger[_0xa100('0x2b')](_0xa100('0x46'),_0x20d6ce);_0x4161a1[_0xa100('0x47')]();},_0x2729ca);switch(_0x158043[_0xa100('0x48')]){case _0xa100('0x49'):strategy['rrmemory'](_0x235466,_0x158043,_0x5ae3d7,_0x63ddca);break;default:strategy[_0xa100('0x4a')](_0x235466,_0x158043,_0x5ae3d7,_0x63ddca);}}else{logger[_0xa100('0x30')](_0xa100('0x4b'),_0x20d6ce,_0x2a9c5f[_0xa100('0x2d')]);_0x4161a1[_0xa100('0x3d')]();}}}catch(_0x1763c7){console[_0xa100('0x4c')](_0x1763c7);logger[_0xa100('0x30')](_0xa100('0x3b'),_0x20d6ce,_0x1763c7[_0xa100('0x4d')]);_0x4161a1[_0xa100('0x3d')]();}};}; \ No newline at end of file +var _0xec92=['list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','join','Queues','atimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20ROUTING\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','from','emit','queue','account','%sQueuesWaitingInteractions','pick','format','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact'];(function(_0x346fe2,_0x878958){var _0xa61a0a=function(_0x43e4a0){while(--_0x43e4a0){_0x346fe2['push'](_0x346fe2['shift']());}};_0xa61a0a(++_0x878958);}(_0xec92,0x154));var _0x2ec9=function(_0x57d734,_0x22f36f){_0x57d734=_0x57d734-0x0;var _0x664fd3=_0xec92[_0x57d734];return _0x664fd3;};'use strict';var schema=require(_0x2ec9('0x0'));var _=require(_0x2ec9('0x1'));var util=require(_0x2ec9('0x2'));var seqqueue=require(_0x2ec9('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x2ec9('0x4'));var logger=require(_0x2ec9('0x5'))(_0x2ec9('0x6'));var strategy=require(_0x2ec9('0x7'));config[_0x2ec9('0x8')]=_[_0x2ec9('0x9')](config[_0x2ec9('0x8')],{'host':_0x2ec9('0xa'),'port':0x18eb});var io=require(_0x2ec9('0xb'))(new Redis(config[_0x2ec9('0x8')]));var attributes=['id',_0x2ec9('0xc'),'account','queue',_0x2ec9('0xd'),'joinAt'];function emit(_0x5dd2fd,_0x235ebe,_0x4a4200){io['to'](_0x5dd2fd)[_0x2ec9('0xe')](_0x235ebe,_0x4a4200);}function emitChannelQueueInteraction(_0x3fc0fb,_0x3ee3d1,_0x1bcc2d,_0x43352a,_0x17cfc6,_0x5a1a94,_0x52000d,_0x111936){_0x1bcc2d[_0x2ec9('0xc')]=_0x111936;_0x1bcc2d[_0x2ec9('0xf')]=_0x3ee3d1;_0x1bcc2d[_0x2ec9('0x10')]=_0x43352a;_0x1bcc2d['id']=_0x17cfc6;if(_0x5a1a94){_0x52000d[util['format'](_0x2ec9('0x11'),_0x3fc0fb)][_0x17cfc6]=_[_0x2ec9('0x12')](_0x1bcc2d,attributes);}else{delete _0x52000d[util[_0x2ec9('0x13')](_0x2ec9('0x11'),_0x3fc0fb)][_0x17cfc6];}emit(util[_0x2ec9('0x13')]('%s:queue:%s',_0x3fc0fb,_0x3ee3d1),util[_0x2ec9('0x13')]('%s_queue_waiting_interaction:%s',_0x3fc0fb,_0x5a1a94?_0x2ec9('0x14'):_0x2ec9('0x15')),_[_0x2ec9('0x12')](_0x1bcc2d,attributes));}var rpc={'openchannelQueueReport':require(_0x2ec9('0x16')),'mailQueueReport':require(_0x2ec9('0x17')),'chatQueueReport':require(_0x2ec9('0x18')),'smsQueueReport':require(_0x2ec9('0x19')),'faxQueueReport':require(_0x2ec9('0x1a'))};var queue=schema({'name':{'type':_0x2ec9('0x1b'),'required':!![],'message':_0x2ec9('0x1c')},'timeout':{'type':_0x2ec9('0x1d'),'message':_0x2ec9('0x1e')}});function startRouting(_0x1d257d,_0x240002,_0x580a1a,_0x35e2b4){if(_0x1d257d&&_0x240002&&_0x580a1a){_0x240002[_0x2ec9('0x1f')]+=0x1;var _0xb0d73f={'uniqueid':_0x1d257d,'from':_0x580a1a[_0x2ec9('0x20')]?_0x580a1a['body'][_0x2ec9('0xd')]:'','joinAt':moment()[_0x2ec9('0x13')](_0x2ec9('0x21')),'ContactId':_0x580a1a[_0x2ec9('0x22')]?_0x580a1a[_0x2ec9('0x22')]['id']:null,'ListId':_0x580a1a[_0x2ec9('0x23')]?_0x580a1a['list']['id']:null};_0xb0d73f[_[_0x2ec9('0x24')](_0x580a1a[_0x2ec9('0x25')])+_0x2ec9('0x26')]=_0x240002['id']||null;_0xb0d73f[_[_0x2ec9('0x24')](_0x580a1a[_0x2ec9('0x25')])+'InteractionId']=_0x580a1a[_0x2ec9('0x27')]?_0x580a1a[_0x2ec9('0x27')]['id']:null;_0xb0d73f[_[_0x2ec9('0x24')](_0x580a1a[_0x2ec9('0x25')])+_0x2ec9('0x28')]=_0x580a1a[_0x2ec9('0x29')]?_0x580a1a[_0x2ec9('0x29')]['id']:null;_0xb0d73f[_[_0x2ec9('0x24')](_0x580a1a[_0x2ec9('0x25')])+(_0x580a1a[_0x2ec9('0x25')]!==_0x2ec9('0x2a')?_0x2ec9('0x2b'):_0x2ec9('0x2c'))]=_0x580a1a[_0x2ec9('0x10')]?_0x580a1a[_0x2ec9('0x10')]['id']:null;logger[_0x2ec9('0x2d')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x1d257d,_0x240002[_0x2ec9('0x2e')]));emitChannelQueueInteraction(_0x580a1a[_0x2ec9('0x25')],_0x240002[_0x2ec9('0x2e')],_0xb0d73f,_0x580a1a[_0x2ec9('0x10')][_0x2ec9('0x2e')],_0x580a1a['message']['id'],!![],_0x35e2b4,_0x240002['id']);if(rpc[_0x580a1a[_0x2ec9('0x25')]+_0x2ec9('0x2f')]){return rpc[_0x580a1a[_0x2ec9('0x25')]+_0x2ec9('0x2f')][_0x2ec9('0x30')](_0xb0d73f)[_0x2ec9('0x31')](function(_0x502d69){logger[_0x2ec9('0x32')](_0x2ec9('0x33'));});}}}function stopRouting(_0x4ea28c,_0x502a54,_0x2df761,_0x3ac8b5){if(_0x4ea28c&&_0x502a54){_0x502a54[_0x2ec9('0x1f')]-=0x1;var _0x3959e8={'leaveAt':moment()['format'](_0x2ec9('0x21')),'acceptAt':moment()[_0x2ec9('0x13')](_0x2ec9('0x21')),'reason':_0x2ec9('0x34')};logger[_0x2ec9('0x2d')](util['format'](_0x2ec9('0x35'),_0x4ea28c,_0x502a54[_0x2ec9('0x2e')]));emitChannelQueueInteraction(_0x2df761[_0x2ec9('0x25')],_0x502a54[_0x2ec9('0x2e')],_0x2df761['body'],_0x2df761[_0x2ec9('0x10')]['name'],_0x2df761[_0x2ec9('0x29')]['id'],![],_0x3ac8b5,_0x502a54['id']);if(rpc[_0x2df761['channel']+_0x2ec9('0x2f')]){return rpc[_0x2df761[_0x2ec9('0x25')]+_0x2ec9('0x2f')][_0x2ec9('0x36')](_0x4ea28c,_0x3959e8)['catch'](function(_0x16cef8){logger['error'](_0x2ec9('0x37'));});}}}function endRouting(_0x1ad0ae,_0x24c37d,_0x190311,_0x198472){if(_0x1ad0ae&&_0x24c37d){_0x24c37d[_0x2ec9('0x1f')]-=0x1;var _0x244036={'leaveAt':moment()[_0x2ec9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x2ec9('0x13')](_0x2ec9('0x21')),'reason':_0x2ec9('0x38')};logger[_0x2ec9('0x2d')](util[_0x2ec9('0x13')](_0x2ec9('0x39'),_0x1ad0ae,_0x24c37d[_0x2ec9('0x2e')]));emitChannelQueueInteraction(_0x190311[_0x2ec9('0x25')],_0x24c37d['name'],_0x190311[_0x2ec9('0x20')],_0x190311[_0x2ec9('0x10')][_0x2ec9('0x2e')],_0x190311['message']['id'],![],_0x198472);if(rpc[_0x190311['channel']+_0x2ec9('0x2f')]){return rpc[_0x190311['channel']+_0x2ec9('0x2f')][_0x2ec9('0x36')](_0x1ad0ae,_0x244036)[_0x2ec9('0x31')](function(_0x438d03){logger[_0x2ec9('0x32')](_0x2ec9('0x37'));});}}}function handleFindQueue(_0x4a640f){return function(_0x34bca5){return _0x34bca5[_0x2ec9('0x2e')][_0x2ec9('0x3a')]()===_0x4a640f[_0x2ec9('0x3a')]();};}exports[_0x2ec9('0x3b')]=function(_0x538af7,_0x5584ad,_0x51def3,_0x134c65){return function(_0x159cab){try{var _0x46d15f={'name':_0x5584ad[0x0],'timeout':_0x5584ad[0x1]};var _0x1f7753=queue['validate'](_0x46d15f,{'typecast':!![]});if(_0x1f7753['length']){logger[_0x2ec9('0x32')]('[%s][QUEUE]\x20%s',_0x538af7,_[_0x2ec9('0x3c')](_0x1f7753,_0x2ec9('0x29'))[_0x2ec9('0x3d')](',\x20'));_0x159cab['stop']();}else{var _0x5a2641=_['find'](_0x51def3[_0x134c65[_0x2ec9('0x25')]+_0x2ec9('0x3e')],handleFindQueue(_0x46d15f[_0x2ec9('0x2e')]));if(_0x5a2641){startRouting(_0x538af7,_0x5a2641,_0x134c65,_0x51def3);var _0x2a074e=(_0x5a2641[_0x2ec9('0x38')]||0xa)*0x3e8;var _0x2aff6f=(_0x46d15f[_0x2ec9('0x38')]||0x14)*0x3e8;var _0x1dda12,_0x2250db;if(_0x2a074e>_0x2aff6f){_0x2aff6f=_0x2a074e;}var _0x25c8a7=seqqueue['createQueue'](_0x2a074e);_0x25c8a7['id']=_0x538af7;_0x25c8a7[_0x2ec9('0x3f')]=_0x2a074e;_0x25c8a7['qtimeout']=_0x2aff6f;_0x25c8a7[_0x2ec9('0x25')]=_0x134c65[_0x2ec9('0x25')];_0x51def3['rules'][_0x538af7]['on'](_0x2ec9('0x40'),function(){stopRouting(_0x538af7,_0x5a2641,_0x134c65,_0x51def3);_0x25c8a7[_0x2ec9('0x41')](!![]);clearTimeout(_0x1dda12);_0x1dda12=undefined;if(_0x51def3[_0x2ec9('0x42')][_0x538af7]){delete _0x51def3['rules'][_0x538af7];}logger['info'](_0x2ec9('0x43'),_0x538af7);_0x159cab[_0x2ec9('0x44')]();});_0x1dda12=setTimeout(function(){endRouting(_0x538af7,_0x5a2641,_0x134c65,_0x51def3);clearTimeout(_0x1dda12);_0x25c8a7[_0x2ec9('0x41')](!![]);logger[_0x2ec9('0x2d')](_0x2ec9('0x45'),_0x538af7);_0x159cab['next']();},_0x2aff6f);switch(_0x5a2641['strategy']){case'rrmemory':strategy[_0x2ec9('0x46')](_0x25c8a7,_0x5a2641,_0x51def3,_0x134c65);break;default:strategy[_0x2ec9('0x47')](_0x25c8a7,_0x5a2641,_0x51def3,_0x134c65);}}else{logger[_0x2ec9('0x32')](_0x2ec9('0x48'),_0x538af7,_0x46d15f[_0x2ec9('0x2e')]);_0x159cab['stop']();}}}catch(_0x3ecd40){console[_0x2ec9('0x49')](_0x3ecd40);logger['error'](_0x2ec9('0x4a'),_0x538af7,_0x3ecd40['stack']);_0x159cab[_0x2ec9('0x44')]();}};}; \ 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 ea35aa8..8cec2fd 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 _0xbf0b=['agents','channel','busy','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','agent','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','isAgentAvailable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x55ba56,_0x19a08d){_0x55ba56=_0x55ba56-0x0;var _0x47bd94=_0xbf0b[_0x55ba56];return _0x47bd94;};'use strict';var _=require(_0xbbf0('0x0'));var uuid=require(_0xbbf0('0x1'));var util=require(_0xbbf0('0x2'));var logger=require(_0xbbf0('0x3'))('routing');var Agent=function(_0x3f50b5,_0x161e7c,_0x5ca1bd,_0x234e38){this[_0xbbf0('0x4')]=uuid['v4']();this['squeue']=_0x3f50b5;this[_0xbbf0('0x5')]=_0x161e7c;this['realtime']=_0x5ca1bd;this['routing']=_0x234e38;this[_0xbbf0('0x6')]['push'](this[_0xbbf0('0x7')]['bind'](this),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));this['squeue']['on'](_0xbbf0('0xa'),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));this[_0xbbf0('0x6')]['on'](_0xbbf0('0xb'),this[_0xbbf0('0xc')][_0xbbf0('0x9')](this));};Agent[_0xbbf0('0xd')][_0xbbf0('0xe')]=function(){this['squeue'][_0xbbf0('0xe')](this[_0xbbf0('0x7')]['bind'](this),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));};Agent[_0xbbf0('0xd')][_0xbbf0('0xc')]=function(){this[_0xbbf0('0x8')](!![]);};Agent[_0xbbf0('0xd')][_0xbbf0('0x7')]=function(_0x3b5f7d){logger[_0xbbf0('0xf')](_0xbbf0('0x10'),this['squeue']['id'],this[_0xbbf0('0x5')]['id']);if(_[_0xbbf0('0x11')](this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']])){logger[_0xbbf0('0xf')](_0xbbf0('0x13'),this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);setTimeout(this[_0xbbf0('0xe')]['bind'](this),0x3e8);}else{if(this[_0xbbf0('0x14')]['forcedOwnership']||util[_0xbbf0('0x15')](this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],this[_0xbbf0('0x6')][_0xbbf0('0x17')],![])){this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']][_0xbbf0('0x18')]=!![];this[_0xbbf0('0x12')][_0xbbf0('0x16')][this['agent']['id']][_0xbbf0('0x19')]=undefined;util[_0xbbf0('0x1a')](this[_0xbbf0('0x4')],this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']],null,this[_0xbbf0('0x14')]);util['writeLog'](this[_0xbbf0('0x6')]['id'],this['realtime'][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],'RINGING'+(this['routing']['forcedOwnership']?_0xbbf0('0x1b'):''));}else{logger['info'](_0xbbf0('0x1c'),this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);setTimeout(this['push'][_0xbbf0('0x9')](this),0x3e8);}}};Agent[_0xbbf0('0xd')][_0xbbf0('0x8')]=function(_0x199cd2){if(_[_0xbbf0('0x11')](this['realtime'][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']])){return logger[_0xbbf0('0xf')](_0xbbf0('0x13'),this[_0xbbf0('0x6')]['id'],this['agent']['id']);}else{logger[_0xbbf0('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);util['hideNotification'](this[_0xbbf0('0x4')],this['squeue']['id'],this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']],null,this[_0xbbf0('0x14')]);this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']][_0xbbf0('0x18')]=![];this[_0xbbf0('0x12')][_0xbbf0('0x16')][this['agent']['id']][_0xbbf0('0x19')]=undefined;util[_0xbbf0('0x1d')](this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],_0x199cd2?_0xbbf0('0x1e'):_0xbbf0('0x1f'));}if(!_0x199cd2){setTimeout(this[_0xbbf0('0xe')][_0xbbf0('0x9')](this),0x3e8);}};function agent(_0xaca152,_0x6f4162,_0x55a538,_0x559919){return new Agent(_0xaca152,_0x6f4162,_0x55a538,_0x559919);}module['exports']=agent; \ No newline at end of file +var _0x3c7b=['drained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout'];(function(_0x13714f,_0x46e9ad){var _0x402913=function(_0x8b9b06){while(--_0x8b9b06){_0x13714f['push'](_0x13714f['shift']());}};_0x402913(++_0x46e9ad);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x2fef32,_0x3d7fe1){_0x2fef32=_0x2fef32-0x0;var _0xf0735b=_0x3c7b[_0x2fef32];return _0xf0735b;};'use strict';var _=require(_0xb3c7('0x0'));var uuid=require(_0xb3c7('0x1'));var util=require(_0xb3c7('0x2'));var logger=require(_0xb3c7('0x3'))(_0xb3c7('0x4'));var Agent=function(_0x4e4405,_0x4a83a4,_0x500bea,_0x5b34ef){this[_0xb3c7('0x5')]=uuid['v4']();this[_0xb3c7('0x6')]=_0x4e4405;this['agent']=_0x4a83a4;this[_0xb3c7('0x7')]=_0x500bea;this['routing']=_0x5b34ef;this[_0xb3c7('0x6')][_0xb3c7('0x8')](this[_0xb3c7('0x9')][_0xb3c7('0xa')](this),this[_0xb3c7('0xb')]['bind'](this));this[_0xb3c7('0x6')]['on']('timeout',this[_0xb3c7('0xb')][_0xb3c7('0xa')](this));this[_0xb3c7('0x6')]['on'](_0xb3c7('0xc'),this['handleDrained'][_0xb3c7('0xa')](this));};Agent[_0xb3c7('0xd')]['push']=function(){this[_0xb3c7('0x6')][_0xb3c7('0x8')](this[_0xb3c7('0x9')][_0xb3c7('0xa')](this),this[_0xb3c7('0xb')][_0xb3c7('0xa')](this));};Agent[_0xb3c7('0xd')]['handleDrained']=function(){this[_0xb3c7('0xb')](!![]);};Agent[_0xb3c7('0xd')]['handleRun']=function(_0x1d9860){logger[_0xb3c7('0xe')](_0xb3c7('0xf'),this[_0xb3c7('0x6')]['id'],this[_0xb3c7('0x10')]['id']);if(_[_0xb3c7('0x11')](this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']])){logger[_0xb3c7('0xe')](_0xb3c7('0x13'),this[_0xb3c7('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0xb3c7('0xa')](this),0x3e8);}else{if(this[_0xb3c7('0x4')][_0xb3c7('0x14')]||util[_0xb3c7('0x15')](this[_0xb3c7('0x6')]['id'],this['realtime'][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']],this[_0xb3c7('0x6')][_0xb3c7('0x16')],![])){this['realtime']['agents'][this[_0xb3c7('0x10')]['id']][_0xb3c7('0x17')]=!![];this['realtime'][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']][_0xb3c7('0x18')]=undefined;util[_0xb3c7('0x19')](this['notificationId'],this['squeue']['id'],this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']],null,this[_0xb3c7('0x4')]);util[_0xb3c7('0x1a')](this['squeue']['id'],this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']],_0xb3c7('0x1b')+(this['routing'][_0xb3c7('0x14')]?_0xb3c7('0x1c'):''));}else{logger[_0xb3c7('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xb3c7('0x6')]['id'],this[_0xb3c7('0x10')]['id']);setTimeout(this[_0xb3c7('0x8')][_0xb3c7('0xa')](this),0x3e8);}}};Agent[_0xb3c7('0xd')]['handleTimeout']=function(_0x42a817){if(_[_0xb3c7('0x11')](this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']])){return logger[_0xb3c7('0xe')](_0xb3c7('0x13'),this[_0xb3c7('0x6')]['id'],this[_0xb3c7('0x10')]['id']);}else{logger['info'](_0xb3c7('0x1d'),this[_0xb3c7('0x6')]['id'],this[_0xb3c7('0x10')]['id']);util['hideNotification'](this[_0xb3c7('0x5')],this['squeue']['id'],this['realtime']['agents'][this[_0xb3c7('0x10')]['id']],null,this[_0xb3c7('0x4')]);this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']]['busy']=![];this[_0xb3c7('0x7')][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0xb3c7('0x6')]['id'],this['realtime'][_0xb3c7('0x12')][this[_0xb3c7('0x10')]['id']],_0x42a817?_0xb3c7('0x1e'):_0xb3c7('0x1f'));}if(!_0x42a817){setTimeout(this[_0xb3c7('0x8')][_0xb3c7('0xa')](this),0x3e8);}};function agent(_0x4756d8,_0x1271dd,_0x3fc9d9,_0x10e200){return new Agent(_0x4756d8,_0x1271dd,_0x3fc9d9,_0x10e200);}module[_0xb3c7('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 2405bfb..b4d8845 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 _0x4147=['info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','routing','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4147,0xf6));var _0x7414=function(_0x3f3c3c,_0x5244df){_0x3f3c3c=_0x3f3c3c-0x0;var _0x2f3422=_0x4147[_0x3f3c3c];return _0x2f3422;};'use strict';var _=require(_0x7414('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x7414('0x1'))(_0x7414('0x2'));var Beepall=function(_0xc9b509,_0x4f8836,_0x46edeb,_0xa1c3c9){this['notificationId']=uuid['v4']();this[_0x7414('0x3')]=_0xc9b509;this[_0x7414('0x4')]=_0x4f8836;this[_0x7414('0x5')]=_0x46edeb;this[_0x7414('0x2')]=_0xa1c3c9;this[_0x7414('0x3')][_0x7414('0x6')](this['handleRun'][_0x7414('0x7')](this),this[_0x7414('0x8')]['bind'](this));this[_0x7414('0x3')]['on'](_0x7414('0x9'),this['handleTimeout'][_0x7414('0x7')](this));this[_0x7414('0x3')]['on'](_0x7414('0xa'),this[_0x7414('0xb')][_0x7414('0x7')](this));};Beepall[_0x7414('0xc')][_0x7414('0x6')]=function(){this[_0x7414('0x3')][_0x7414('0x6')](this[_0x7414('0xd')][_0x7414('0x7')](this),this['handleTimeout'][_0x7414('0x7')](this));};Beepall['prototype']['handleDrained']=function(_0x54b395){this['handleTimeout'](!![]);};Beepall[_0x7414('0xc')][_0x7414('0xd')]=function(_0x47101e){var _0x4c11f8=!![];if(!_[_0x7414('0xe')](this[_0x7414('0x4')])&&!_[_0x7414('0xe')](this[_0x7414('0x4')][_0x7414('0xf')])&&this['queue'][_0x7414('0xf')][_0x7414('0x10')]>0x0){for(var _0x18c49c=0x0,_0x1576ed;_0x18c49c0x0){for(var _0x52a6c7=0x0,_0x202e28;_0x52a6c70x0&&_0x2e0a14[_0x5cac7e+_0x5f65('0x28')]>=_0x2e0a14[_0x5cac7e+'Capacity']){writeLog(_0x529058,_0x2e0a14,_0x5cac7e[_0x5f65('0x29')]()+_0x5f65('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x3f6f41,_0x13dacc,_0x79ac47,_0x27767e,_0x54518d){return sendNotification(!![],_0x3f6f41,_0x13dacc,_0x79ac47,_0x27767e,_0x54518d);};exports[_0x5f65('0x2b')]=function(_0x5d776f,_0x4ac086,_0x1484f2,_0x575bbf,_0x333640){return sendNotification(![],_0x5d776f,_0x4ac086,_0x1484f2,_0x575bbf,_0x333640);};exports[_0x5f65('0x2c')]=writeLog; \ No newline at end of file +var _0x0e5d=['redis','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','message','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','hasOwnProperty','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','localhost','socket.io-emitter'];(function(_0x4c2f82,_0x2ea700){var _0x12eee2=function(_0x363479){while(--_0x363479){_0x4c2f82['push'](_0x4c2f82['shift']());}};_0x12eee2(++_0x2ea700);}(_0x0e5d,0xed));var _0xd0e5=function(_0x4b0d02,_0x546611){_0x4b0d02=_0x4b0d02-0x0;var _0x1eebc3=_0x0e5d[_0x4b0d02];return _0x1eebc3;};'use strict';var _=require(_0xd0e5('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0xd0e5('0x1'));var Redis=require(_0xd0e5('0x2'));var config=require(_0xd0e5('0x3'));var logger=require(_0xd0e5('0x4'))(_0xd0e5('0x5'));config['redis']=_[_0xd0e5('0x6')](config['redis'],{'host':_0xd0e5('0x7'),'port':0x18eb});var io=require(_0xd0e5('0x8'))(new Redis(config[_0xd0e5('0x9')]));function emit(_0xf0671b,_0x3a41cb,_0x5d4c31){io['to'](_0xf0671b)[_0xd0e5('0xa')](_0x3a41cb,_0x5d4c31);}function sendNotification(_0x231624,_0xd6bafd,_0x1d7524,_0xc4f064,_0x3d5f65,_0xc54baf){io['to'](util[_0xd0e5('0xb')](_0xd0e5('0xc'),_0xc4f064[_0xd0e5('0xd')]))[_0xd0e5('0xa')](_0xd0e5('0xe'),_0xc4f064);var _0x1d768a=_0xc54baf||{};var _0x3784e0=_0x1d7524[_0xd0e5('0xf')]('.');var _0x207f7c={'uniqueid':_0xd6bafd,'channel':_0x3784e0[0x0],'id':_0x3784e0[0x1],'title':_0x3784e0[0x0]+_0xd0e5('0x10'),'interactionId':_0x3784e0[0x2],'queue':_0x3d5f65?_0x3d5f65[_0xd0e5('0xd')]:null,'sound':_0x1d768a[_0xd0e5('0x11')][_0xd0e5('0x12')],'shake':_0x1d768a[_0xd0e5('0x11')][_0xd0e5('0x13')]};try{if(!_0x1d768a[_0xd0e5('0x14')]){_0x1d768a['body']={};}if(_0x3d5f65){_0x1d768a[_0xd0e5('0x14')][_0xd0e5('0x15')]=_0x3d5f65;}else if(_0x1d768a[_0xd0e5('0x14')][_0xd0e5('0x15')]){delete _0x1d768a[_0xd0e5('0x14')][_0xd0e5('0x15')];}_0x207f7c['msg']=utils[_0xd0e5('0x16')](_0x1d768a[_0xd0e5('0x11')]['notificationTemplate'],_0x1d768a);}catch(_0x3ac2f7){_0x207f7c['msg']=_0xd0e5('0x17');logger[_0xd0e5('0x18')](util[_0xd0e5('0xb')]('[%s][QUEUE]\x20%s',_0xd6bafd,_0x3ac2f7[_0xd0e5('0x19')]));}io['to'](util[_0xd0e5('0xb')](_0xd0e5('0xc'),_0xc4f064[_0xd0e5('0xd')]))[_0xd0e5('0xa')](util[_0xd0e5('0xb')]('notification:%s',_0x231624?_0xd0e5('0x1a'):'remove'),_0x207f7c);}function writeLog(_0x72a5d,_0x936b36,_0x5bcede){return logger[_0xd0e5('0x1b')](util[_0xd0e5('0xb')](_0xd0e5('0x1c'),_0x72a5d,_0x936b36[_0xd0e5('0xd')],_0x5bcede));}exports[_0xd0e5('0x1d')]=function(_0x42842d,_0xb88af0,_0x4dc552,_0x4506f0){if(_0xb88af0[_0xd0e5('0x1e')]){writeLog(_0x42842d,_0xb88af0,'BUSY');return![];}if(!_0xb88af0[_0xd0e5('0x1f')]){writeLog(_0x42842d,_0xb88af0,_0xd0e5('0x20'));return![];}if(_0xb88af0[_0x4dc552+_0xd0e5('0x21')]){writeLog(_0x42842d,_0xb88af0,'PAUSE');return![];}if(_0x4506f0&&_0xb88af0[_0xd0e5('0x22')](_0x4dc552+'Capacity')&&_0xb88af0['hasOwnProperty'](_0x4dc552+'CurrentCapacity')){if(_0xb88af0[_0x4dc552+_0xd0e5('0x23')]>0x0&&_0xb88af0[_0x4dc552+'CurrentCapacity']>=_0xb88af0[_0x4dc552+'Capacity']){writeLog(_0x42842d,_0xb88af0,_0x4dc552[_0xd0e5('0x24')]()+_0xd0e5('0x25'));return![];}}return!![];};exports[_0xd0e5('0x26')]=function(_0x10833d,_0x290c66,_0x59e654,_0x5cc9fa,_0x5e08b4){return sendNotification(!![],_0x10833d,_0x290c66,_0x59e654,_0x5cc9fa,_0x5e08b4);};exports[_0xd0e5('0x27')]=function(_0x431d35,_0x17be87,_0x52c121,_0x306d23,_0x31752d){return sendNotification(![],_0x431d35,_0x17be87,_0x52c121,_0x306d23,_0x31752d);};exports[_0xd0e5('0x28')]=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 ca8fd92..f01756a 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 _0x3cfa=['getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cfa,0xc9));var _0xa3cf=function(_0x264755,_0x44b561){_0x264755=_0x264755-0x0;var _0x38db02=_0x3cfa[_0x264755];return _0x38db02;};'use strict';var schema=require(_0xa3cf('0x0'));var sh=require(_0xa3cf('0x1'));var _=require(_0xa3cf('0x2'));var utils=require(_0xa3cf('0x3'));var logger=require(_0xa3cf('0x4'))(_0xa3cf('0x5'));var system=schema({'command':{'type':_0xa3cf('0x6'),'required':!![],'message':_0xa3cf('0x7')}});exports[_0xa3cf('0x8')]=function(_0x499ee7,_0x27bc5c){return function(_0x389289){try{var _0x3f6f94={'command':_0x27bc5c[0x0]};var _0x5c6d70=system[_0xa3cf('0x0')](_0x3f6f94,{'typecast':!![]});if(_0x5c6d70['length']){logger['error'](_0xa3cf('0x9'),_0x499ee7,_[_0xa3cf('0xa')](_0x5c6d70,_0xa3cf('0xb'))['join'](',\x20'));logger[_0xa3cf('0xc')](_0xa3cf('0xd'),_0x499ee7);_0x389289[_0xa3cf('0xe')]();}else{var _0x5f3ac3=this;var _0x57cd42=utils[_0xa3cf('0xf')](_0x27bc5c[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x499ee7,_0x57cd42);sh[_0xa3cf('0x10')](_[_0xa3cf('0x11')](_0x57cd42),function(_0x54d6fa,_0x43cf6f){logger[_0xa3cf('0xc')](_0xa3cf('0x12'),_0x499ee7,_0x54d6fa);if(_0x54d6fa==0x0){var _0x33d4d7=_0x43cf6f[_0xa3cf('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xa3cf('0x14')](_0x27bc5c[0x1])||_[_0xa3cf('0x15')](_0x27bc5c[0x1])){logger[_0xa3cf('0xc')](_0xa3cf('0x16'),_0x499ee7);_0x5f3ac3['body'][_0x27bc5c[0x1]]=_0x33d4d7;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x499ee7,_0x27bc5c[0x1],_0x33d4d7);_0x5f3ac3[_0xa3cf('0x17')][_0x27bc5c[0x1]]=_0x33d4d7;}}_0x389289[_0xa3cf('0xe')]();});}}catch(_0x1ea9c7){logger[_0xa3cf('0x18')](_0xa3cf('0x9'),_0x499ee7,_[_0xa3cf('0x19')](_0x1ea9c7)?JSON[_0xa3cf('0x1a')](_0x1ea9c7):_0x1ea9c7);logger[_0xa3cf('0xc')](_0xa3cf('0xd'),_0x499ee7);_0x389289[_0xa3cf('0xe')]();}};}; \ No newline at end of file +var _0xaee5=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0xaee5,0x151));var _0x5aee=function(_0x2e877f,_0x491d9d){_0x2e877f=_0x2e877f-0x0;var _0x336436=_0xaee5[_0x2e877f];return _0x336436;};'use strict';var schema=require(_0x5aee('0x0'));var sh=require(_0x5aee('0x1'));var _=require('lodash');var utils=require(_0x5aee('0x2'));var logger=require(_0x5aee('0x3'))(_0x5aee('0x4'));var system=schema({'command':{'type':_0x5aee('0x5'),'required':!![],'message':_0x5aee('0x6')}});exports[_0x5aee('0x7')]=function(_0x24c933,_0x285932){return function(_0x3da484){try{var _0x409c2a={'command':_0x285932[0x0]};var _0x365fc6=system['validate'](_0x409c2a,{'typecast':!![]});if(_0x365fc6[_0x5aee('0x8')]){logger[_0x5aee('0x9')](_0x5aee('0xa'),_0x24c933,_['map'](_0x365fc6,_0x5aee('0xb'))[_0x5aee('0xc')](',\x20'));logger[_0x5aee('0xd')](_0x5aee('0xe'),_0x24c933);_0x3da484[_0x5aee('0xf')]();}else{var _0x5129c5=this;var _0x20e6b0=utils[_0x5aee('0x10')](_0x285932[0x0],this);logger['info'](_0x5aee('0x11'),_0x24c933,_0x20e6b0);sh['exec'](_[_0x5aee('0x12')](_0x20e6b0),function(_0xf7b2ab,_0x4faecd){logger[_0x5aee('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x24c933,_0xf7b2ab);if(_0xf7b2ab==0x0){var _0x322876=_0x4faecd['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x5aee('0x13')](_0x285932[0x1])||_[_0x5aee('0x14')](_0x285932[0x1])){logger['info'](_0x5aee('0x15'),_0x24c933);_0x5129c5[_0x5aee('0x16')][_0x285932[0x1]]=_0x322876;}else{logger[_0x5aee('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x24c933,_0x285932[0x1],_0x322876);_0x5129c5[_0x5aee('0x16')][_0x285932[0x1]]=_0x322876;}}_0x3da484[_0x5aee('0xf')]();});}}catch(_0x55c84a){logger[_0x5aee('0x9')](_0x5aee('0xa'),_0x24c933,_[_0x5aee('0x17')](_0x55c84a)?JSON[_0x5aee('0x18')](_0x55c84a):_0x55c84a);logger[_0x5aee('0xd')](_0x5aee('0xe'),_0x24c933);_0x3da484['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 54e5735..5e30851 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 _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x43f53c,_0x368dae){var _0x4d56a9=function(_0x502b60){while(--_0x502b60){_0x43f53c['push'](_0x43f53c['shift']());}};_0x4d56a9(++_0x368dae);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ 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 e5cfe4a..1847c17 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 _0x142c=['account','list','mustache','exports','merge','body'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x142c,0x86));var _0xc142=function(_0x8377ed,_0x5d4c1a){_0x8377ed=_0x8377ed-0x0;var _0x1a71ae=_0x142c[_0x8377ed];return _0x1a71ae;};'use strict';var Mustache=require(_0xc142('0x0'));var _=require('lodash');module[_0xc142('0x1')]={'getMustacheRender':function(_0x146a30,_0x10367){return Mustache['render'](_0x146a30,_[_0xc142('0x2')](_0x10367[_0xc142('0x3')],{'contact':_0x10367['contact'],'message':_0x10367['message'],'account':_0x10367[_0xc142('0x4')],'interaction':_0x10367['interaction'],'list':_0x10367[_0xc142('0x5')]}))||'';}}; \ No newline at end of file +var _0xe739=['message','account','interaction','mustache','exports','contact'];(function(_0xd22792,_0x3deea5){var _0x20563a=function(_0x27a095){while(--_0x27a095){_0xd22792['push'](_0xd22792['shift']());}};_0x20563a(++_0x3deea5);}(_0xe739,0x105));var _0x9e73=function(_0x4304ea,_0x4c9d0e){_0x4304ea=_0x4304ea-0x0;var _0x1e59b2=_0xe739[_0x4304ea];return _0x1e59b2;};'use strict';var Mustache=require(_0x9e73('0x0'));var _=require('lodash');module[_0x9e73('0x1')]={'getMustacheRender':function(_0x1620a4,_0x2dc1a9){return Mustache['render'](_0x1620a4,_['merge'](_0x2dc1a9['body'],{'contact':_0x2dc1a9[_0x9e73('0x2')],'message':_0x2dc1a9[_0x9e73('0x3')],'account':_0x2dc1a9[_0x9e73('0x4')],'interaction':_0x2dc1a9[_0x9e73('0x5')],'list':_0x2dc1a9['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ea7f960..5624cb2 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 _0xc340=['appdata','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','No\x20applications\x20to\x20execute','stack','emit','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','agent','agents','busy','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','chatQueues','loggedIn','name','paused','mailQueues','available','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','push','slice'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xc340,0x1d1));var _0x0c34=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc340[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x0c34('0x0'));var util=require(_0x0c34('0x1'));var path=require(_0x0c34('0x2'));var fs=require('fs');var jayson=require(_0x0c34('0x3'));var BPromise=require(_0x0c34('0x4'));var uuid=require(_0x0c34('0x5'));var config=require(_0x0c34('0x6'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x0c34('0x7'))};var rpc={'openchannelQueueReport':require(_0x0c34('0x7')),'mailQueueReport':require(_0x0c34('0x8')),'chatQueueReport':require(_0x0c34('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x3a0449,_0x274666,_0x4c751d){return util[_0x0c34('0xa')](_0x0c34('0xb'),_0x3a0449,_0x274666||0x0,_0x4c751d||0x0);}function getIntervals(_0x2dd18a,_0x11475b){var _0x38682a=[];if(!_[_0x0c34('0xc')](_0x11475b[_0x0c34('0xd')])&&!_[_0x0c34('0xc')](_0x2dd18a[_0x11475b[_0x0c34('0xd')]])&&!_[_0x0c34('0xc')](_0x2dd18a[_0x11475b[_0x0c34('0xd')]][_0x0c34('0xe')])){_0x38682a=_['map'](_0x2dd18a[_0x11475b[_0x0c34('0xd')]][_0x0c34('0xe')],'interval');}else if(!_[_0x0c34('0xc')](_0x11475b[_0x0c34('0xf')])){_0x38682a=[_0x11475b[_0x0c34('0xf')]];}return _0x38682a;}exports[_0x0c34('0x10')]=function(_0x1abe70){_0x1abe70[_0x0c34('0x11')]={};return new BPromise(function(_0x33d66c,_0x54df6f){var _0x2ab1df={'Start':function(_0x4661e1){var _0x1542ce=this;return new Promise(function(_0x5c7299,_0x4dd7f8){if(_0x4661e1){try{var _0x372e34=[];var _0x3d60c3=getId(_0x4661e1[_0x0c34('0x12')],_0x4661e1[_0x0c34('0x13')]?_0x4661e1[_0x0c34('0x13')]['id']:0x0,_0x4661e1['interaction']?_0x4661e1[_0x0c34('0x14')]['id']:0x0);if(_0x4661e1[_0x0c34('0x15')]&&_[_0x0c34('0x16')](_0x4661e1['applications'])&&_0x4661e1['applications']['length']){for(var _0x35c78b=0x0;_0x35c78b<_0x4661e1[_0x0c34('0x15')][_0x0c34('0x17')];_0x35c78b+=0x1){var _0x5423d9=_0x4661e1[_0x0c34('0x15')][_0x35c78b];if(fs[_0x0c34('0x18')](path[_0x0c34('0x19')](__dirname,'applications',_0x5423d9[_0x0c34('0x1a')]+_0x0c34('0x1b')))){var _0x4351e5=[];switch(_0x5423d9['app'][_0x0c34('0x1c')]()){case _0x0c34('0x1d'):var _0x311ff3=_0x5423d9['appdata'][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5['push'](_0x311ff3[_0x0c34('0x20')](0x1,_0x311ff3[_0x0c34('0x17')])[_0x0c34('0x19')](','));break;case'dialogflow':var _0x311ff3=_0x5423d9[_0x0c34('0x21')][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x1]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[_0x0c34('0x20')](0x2,_0x311ff3['length'])[_0x0c34('0x19')](','));break;case'amazonlex':var _0x311ff3=_0x5423d9[_0x0c34('0x21')][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x1]);_0x4351e5['push'](_0x311ff3[0x2]);_0x4351e5['push'](_0x311ff3[0x3]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[_0x0c34('0x20')](0x4,_0x311ff3[_0x0c34('0x17')])['join'](','));break;case'message':_0x4351e5[_0x0c34('0x1f')](_0x5423d9[_0x0c34('0x21')]);break;case'tag':_0x4351e5[_0x0c34('0x1f')](_0x5423d9['TagId']);_0x4351e5[_0x0c34('0x1f')](_0x5423d9[_0x0c34('0x21')]);break;default:_0x4351e5=_[_0x0c34('0xc')](_0x5423d9[_0x0c34('0x21')])?[]:_0x5423d9[_0x0c34('0x21')]['split'](',');}var _0x10a323={'id':util[_0x0c34('0xa')]('%s:%s:%s',_0x3d60c3,_0x5423d9['id'],_0x5423d9[_0x0c34('0x1a')]),'condition':require('./interval')[_0x0c34('0x22')](_0x3d60c3,getIntervals(_0x1abe70[_0x0c34('0x23')],_0x5423d9),_0x1abe70),'consequence':require(_0x0c34('0x24')+_0x5423d9[_0x0c34('0x1a')])[_0x0c34('0x25')](_0x3d60c3,_0x4351e5,_0x1abe70,_0x4661e1),'p':_0x5423d9[_0x0c34('0x26')]||0x0};logger[_0x0c34('0x27')]('Push\x20new\x20rule',_0x10a323['id'],_0x0c34('0x28'),getIntervals(_0x1abe70[_0x0c34('0x23')],_0x5423d9)['join'](_0x0c34('0x29')));_0x372e34['push'](_0x10a323);}else{logger[_0x0c34('0x2a')](_0x0c34('0x2b'),path[_0x0c34('0x19')](__dirname,_0x0c34('0x15'),_0x5423d9[_0x0c34('0x1a')]+_0x0c34('0x1b')));}}_0x1abe70[_0x0c34('0x11')][_0x3d60c3]=new RuleEngine(_0x372e34);_0x1abe70[_0x0c34('0x11')][_0x3d60c3][_0x0c34('0x2c')](_0x4661e1,function(_0x4986ec){logger[_0x0c34('0x27')](_0x0c34('0x2d'),JSON['stringify'](_0x4986ec[_0x0c34('0x2e')]));if(_0x1abe70[_0x0c34('0x11')][_0x3d60c3]){_0x1abe70[_0x0c34('0x11')][_0x3d60c3]['emit']('end');}});return _0x5c7299({'code':0xc8,'message':_0x4661e1});}else{logger[_0x0c34('0x27')](_0x0c34('0x2f'));return _0x5c7299({'code':0xc8,'message':_0x4661e1});}}catch(_0x513001){logger[_0x0c34('0x2a')](_0x513001[_0x0c34('0x30')]);return _0x4dd7f8(_0x1542ce[_0x0c34('0x2a')](0x1f4,_0x513001));}}return _0x4dd7f8('routing\x20is\x20empty');});},'AcceptMessage':function(_0x358a46){var _0x31559e=this;return new Promise(function(_0x2c9441,_0x2a8b35){if(_0x358a46['message']&&_0x358a46[_0x0c34('0x13')]['id']){try{var _0x2a5a46=getId(_0x358a46[_0x0c34('0x12')],_0x358a46[_0x0c34('0x13')]?_0x358a46[_0x0c34('0x13')]['id']:0x0,_0x358a46[_0x0c34('0x14')]?_0x358a46[_0x0c34('0x14')]['id']:0x0);if(_0x1abe70['rules'][_0x2a5a46]){_0x1abe70['rules'][_0x2a5a46][_0x0c34('0x31')](_0x0c34('0x32'));if(rpc[_0x358a46['channel']+_0x0c34('0x33')]){rpc[_0x358a46[_0x0c34('0x12')]+_0x0c34('0x33')][_0x0c34('0x34')](_0x2a5a46,{'UserId':_0x358a46[_0x0c34('0x13')][_0x0c34('0x35')]})['catch'](function(_0x113147){logger[_0x0c34('0x2a')](_0x0c34('0x36'));});}}return _0x2c9441({'code':0xc8,'message':_0x358a46});}catch(_0x36dbc3){logger['error'](_0x36dbc3[_0x0c34('0x30')]);return _0x2a8b35(_0x31559e[_0x0c34('0x2a')](0x1f4,_0x36dbc3));}}logger[_0x0c34('0x2a')]('message\x20is\x20empty');return _0x2a8b35(_0x31559e[_0x0c34('0x2a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x1192f3){var _0x5b9247=this;return new Promise(function(_0x477727,_0x25e2b1){if(_0x1192f3[_0x0c34('0x37')]&&_0x1192f3[_0x0c34('0x37')]['id']){try{if(_0x1abe70[_0x0c34('0x38')][_0x1192f3[_0x0c34('0x37')]['id']]){_0x1abe70[_0x0c34('0x38')][_0x1192f3[_0x0c34('0x37')]['id']][_0x0c34('0x39')]=![];_0x1abe70['agents'][_0x1192f3[_0x0c34('0x37')]['id']]['busyQueue']=undefined;}return _0x477727({'code':0xc8,'message':_0x1192f3});}catch(_0x1e8c2c){logger[_0x0c34('0x2a')](_0x1e8c2c[_0x0c34('0x30')]);return _0x25e2b1(_0x5b9247[_0x0c34('0x2a')](0x1f4,_0x1e8c2c));}}logger[_0x0c34('0x2a')](_0x0c34('0x3a'));return _0x25e2b1(_0x5b9247[_0x0c34('0x2a')](0x1f4,_0x0c34('0x3a')));});},'AbandonInteraction':function(_0x5bcbd1){var _0x13726f=this;return new Promise(function(_0x1d4f12,_0x4b5ea9){if(_0x5bcbd1[_0x0c34('0x12')]&&_0x5bcbd1[_0x0c34('0x14')]&&_0x5bcbd1['interaction']['id']){try{var _0x362789=getId(_0x5bcbd1[_0x0c34('0x12')],_0x5bcbd1['message']?_0x5bcbd1[_0x0c34('0x13')]['id']:0x0,_0x5bcbd1[_0x0c34('0x14')]?_0x5bcbd1[_0x0c34('0x14')]['id']:0x0);if(_0x1abe70['rules'][_0x362789]){_0x1abe70[_0x0c34('0x11')][_0x362789][_0x0c34('0x31')](_0x0c34('0x32'));}return _0x1d4f12({'code':0xc8,'message':_0x5bcbd1});}catch(_0x468de0){logger[_0x0c34('0x2a')](_0x468de0[_0x0c34('0x30')]);return _0x4b5ea9(_0x13726f[_0x0c34('0x2a')](0x1f4,_0x468de0));}}logger['error'](_0x0c34('0x3a'));return _0x4b5ea9(_0x13726f[_0x0c34('0x2a')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x38fdd1){var _0x3aa7ca=this;return new Promise(function(_0x4aa819,_0x5238ed){if(_0x1abe70['agents']['hasOwnProperty'](_0x38fdd1['id'])){for(var _0x353210 in _0x38fdd1[_0x0c34('0x3b')]){if(_0x38fdd1[_0x0c34('0x3b')][_0x0c34('0x3c')](_0x353210)){if(_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']][_0x0c34('0x3c')](_0x353210+_0x0c34('0x3d'))){_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']][_0x353210+_0x0c34('0x3d')]=parseInt(_0x38fdd1[_0x0c34('0x3b')][_0x353210],0xa);}}}_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']]['updateRealtime']();return _0x4aa819({'code':0xc8,'message':_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']]});}else{return _0x5238ed(_0x3aa7ca[_0x0c34('0x2a')](0x1f4,_0x0c34('0x3e')));}});},'Agents':function(_0x9c81b4){return new Promise(function(_0x46ddc1,_0x2e3f2a){var _0x681338=_['values'](_0x1abe70[_0x0c34('0x38')]);_0x46ddc1({'count':_0x681338[_0x0c34('0x17')],'rows':_0x681338});});},'ChatQueues':function(_0x2cf5a8){return new Promise(function(_0x12afad,_0x18a0a4){var _0x1c00e5=[];for(var _0x13bd30 in _0x1abe70['chatQueues']){if(_0x1abe70[_0x0c34('0x3f')][_0x0c34('0x3c')](_0x13bd30)){var _0x3ad91e=_0x1abe70[_0x0c34('0x3f')][_0x13bd30];var _0x12c4f5={'id':_0x3ad91e['id'],'available':_0x3ad91e['available'],'loggedIn':_0x3ad91e[_0x0c34('0x40')],'name':_0x3ad91e[_0x0c34('0x41')],'paused':_0x3ad91e[_0x0c34('0x42')],'waiting':_0x3ad91e['waiting']};_0x1c00e5[_0x0c34('0x1f')](_0x12c4f5);}}_0x12afad({'count':_0x1c00e5[_0x0c34('0x17')],'rows':_0x1c00e5});});},'MailQueues':function(_0x20c83b){return new Promise(function(_0x2f2223,_0x580b98){var _0x10d9fd=[];for(var _0x326645 in _0x1abe70[_0x0c34('0x43')]){if(_0x1abe70[_0x0c34('0x43')][_0x0c34('0x3c')](_0x326645)){var _0x15766c=_0x1abe70[_0x0c34('0x43')][_0x326645];var _0x492b55={'id':_0x15766c['id'],'available':_0x15766c[_0x0c34('0x44')],'loggedIn':_0x15766c[_0x0c34('0x40')],'name':_0x15766c[_0x0c34('0x41')],'paused':_0x15766c[_0x0c34('0x42')],'waiting':_0x15766c[_0x0c34('0x45')]};_0x10d9fd['push'](_0x492b55);}}_0x2f2223({'count':_0x10d9fd[_0x0c34('0x17')],'rows':_0x10d9fd});});},'OpenchannelQueues':function(_0x34d47c){return new Promise(function(_0x37ec3b,_0x2c1de0){var _0x3e2202=[];for(var _0x36c053 in _0x1abe70['openchannelQueues']){if(_0x1abe70[_0x0c34('0x46')]['hasOwnProperty'](_0x36c053)){var _0x521513=_0x1abe70[_0x0c34('0x46')][_0x36c053];var _0x420131={'id':_0x521513['id'],'available':_0x521513['available'],'loggedIn':_0x521513[_0x0c34('0x40')],'name':_0x521513[_0x0c34('0x41')],'paused':_0x521513[_0x0c34('0x42')],'waiting':_0x521513[_0x0c34('0x45')]};_0x3e2202[_0x0c34('0x1f')](_0x420131);}}_0x37ec3b({'count':_0x3e2202[_0x0c34('0x17')],'rows':_0x3e2202});});},'SmsQueues':function(_0x5a9a02){return new Promise(function(_0x4bfe6e,_0x3ac7af){var _0x3c3674=[];for(var _0x1f27f7 in _0x1abe70[_0x0c34('0x47')]){if(_0x1abe70[_0x0c34('0x47')]['hasOwnProperty'](_0x1f27f7)){var _0x21fd29=_0x1abe70['smsQueues'][_0x1f27f7];var _0x4c7a89={'id':_0x21fd29['id'],'available':_0x21fd29['available'],'loggedIn':_0x21fd29[_0x0c34('0x40')],'name':_0x21fd29['name'],'paused':_0x21fd29[_0x0c34('0x42')],'waiting':_0x21fd29['waiting']};_0x3c3674[_0x0c34('0x1f')](_0x4c7a89);}}_0x4bfe6e({'count':_0x3c3674[_0x0c34('0x17')],'rows':_0x3c3674});});},'FaxQueues':function(_0x3d20ca){return new Promise(function(_0x188120,_0x277043){var _0x3f38f0=[];for(var _0x3e9bc4 in _0x1abe70[_0x0c34('0x48')]){if(_0x1abe70[_0x0c34('0x48')][_0x0c34('0x3c')](_0x3e9bc4)){var _0x484669=_0x1abe70['faxQueues'][_0x3e9bc4];var _0x2544e9={'id':_0x484669['id'],'available':_0x484669['available'],'loggedIn':_0x484669[_0x0c34('0x40')],'name':_0x484669[_0x0c34('0x41')],'paused':_0x484669[_0x0c34('0x42')],'waiting':_0x484669['waiting']};_0x3f38f0['push'](_0x2544e9);}}_0x188120({'count':_0x3f38f0[_0x0c34('0x17')],'rows':_0x3f38f0});});},'ChatQueuesWaitingInteractions':function(_0x3d049d){return new Promise(function(_0x3797c4,_0x418336){var _0x4774e4=_['values'](_0x1abe70[_0x0c34('0x49')]);_0x3797c4({'count':_0x4774e4[_0x0c34('0x17')],'rows':_0x4774e4});});},'MailQueuesWaitingInteractions':function(_0x19b70e){return new Promise(function(_0x355728,_0x2c2c63){var _0x4b19a2=_[_0x0c34('0x4a')](_0x1abe70[_0x0c34('0x4b')]);_0x355728({'count':_0x4b19a2[_0x0c34('0x17')],'rows':_0x4b19a2});});},'OpenchannelQueuesWaitingInteractions':function(_0xadc3b4){return new Promise(function(_0x51acb6,_0x3ad526){var _0x434312=_['values'](_0x1abe70[_0x0c34('0x4c')]);_0x51acb6({'count':_0x434312[_0x0c34('0x17')],'rows':_0x434312});});},'SmsQueuesWaitingInteractions':function(_0x5103d5){return new Promise(function(_0x3ff722,_0x4e2600){var _0x180951=_['values'](_0x1abe70['smsQueuesWaitingInteractions']);_0x3ff722({'count':_0x180951[_0x0c34('0x17')],'rows':_0x180951});});},'FaxQueuesWaitingInteractions':function(_0x52edb2){return new Promise(function(_0x4fa743,_0xf60311){var _0x249661=_['values'](_0x1abe70[_0x0c34('0x4d')]);_0x4fa743({'count':_0x249661['length'],'rows':_0x249661});});}};var _0x80a2b8=jayson[_0x0c34('0x4e')](_0x2ab1df)[_0x0c34('0x4f')]();_0x80a2b8['on'](_0x0c34('0x2a'),function(_0x118223){logger[_0x0c34('0x2a')](JSON['stringify'](_0x118223));return _0x54df6f(_0x118223);});_0x80a2b8[_0x0c34('0x10')](0x232c,_0x0c34('0x50'),function(){console[_0x0c34('0x51')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x33d66c(_0x0c34('0x52')+0x232c);});});}; \ No newline at end of file +var _0x8c5b=['info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','stringify','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','.js','toLowerCase','autoreply','appdata','split','push','slice','tag','TagId','%s:%s:%s','app','./interval','condition','intervals','priority'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x8c5b,0x13c));var _0xb8c5=function(_0x1ec6b3,_0x4d613c){_0x1ec6b3=_0x1ec6b3-0x0;var _0x7f842c=_0x8c5b[_0x1ec6b3];return _0x7f842c;};'use strict';var _=require(_0xb8c5('0x0'));var util=require('util');var path=require(_0xb8c5('0x1'));var fs=require('fs');var jayson=require(_0xb8c5('0x2'));var BPromise=require(_0xb8c5('0x3'));var uuid=require(_0xb8c5('0x4'));var config=require(_0xb8c5('0x5'));var logger=require(_0xb8c5('0x6'))(_0xb8c5('0x7'));var rpc={'openchannelQueueReport':require(_0xb8c5('0x8'))};var rpc={'openchannelQueueReport':require(_0xb8c5('0x8')),'mailQueueReport':require(_0xb8c5('0x9')),'chatQueueReport':require(_0xb8c5('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xb8c5('0xb'))};var RuleEngine=require(_0xb8c5('0xc'));function getId(_0x5e58de,_0x5b2a93,_0x357933){return util[_0xb8c5('0xd')](_0xb8c5('0xe'),_0x5e58de,_0x5b2a93||0x0,_0x357933||0x0);}function getIntervals(_0x38922c,_0x46d4c9){var _0x2294a1=[];if(!_['isNil'](_0x46d4c9[_0xb8c5('0xf')])&&!_[_0xb8c5('0x10')](_0x38922c[_0x46d4c9[_0xb8c5('0xf')]])&&!_[_0xb8c5('0x10')](_0x38922c[_0x46d4c9[_0xb8c5('0xf')]][_0xb8c5('0x11')])){_0x2294a1=_[_0xb8c5('0x12')](_0x38922c[_0x46d4c9[_0xb8c5('0xf')]][_0xb8c5('0x11')],_0xb8c5('0x13'));}else if(!_[_0xb8c5('0x10')](_0x46d4c9[_0xb8c5('0x13')])){_0x2294a1=[_0x46d4c9[_0xb8c5('0x13')]];}return _0x2294a1;}exports['listen']=function(_0x89f7dd){_0x89f7dd[_0xb8c5('0x14')]={};return new BPromise(function(_0x533d6e,_0x256a32){var _0x39a41c={'Start':function(_0x336551){var _0x39eef0=this;return new Promise(function(_0x4e21b8,_0x6ff368){if(_0x336551){try{var _0x14d1b0=[];var _0x4df22b=getId(_0x336551[_0xb8c5('0x15')],_0x336551[_0xb8c5('0x16')]?_0x336551['message']['id']:0x0,_0x336551[_0xb8c5('0x17')]?_0x336551[_0xb8c5('0x17')]['id']:0x0);if(_0x336551[_0xb8c5('0x18')]&&_[_0xb8c5('0x19')](_0x336551[_0xb8c5('0x18')])&&_0x336551[_0xb8c5('0x18')][_0xb8c5('0x1a')]){for(var _0xf299d1=0x0;_0xf299d1<_0x336551[_0xb8c5('0x18')]['length'];_0xf299d1+=0x1){var _0x38bd92=_0x336551[_0xb8c5('0x18')][_0xf299d1];if(fs[_0xb8c5('0x1b')](path[_0xb8c5('0x1c')](__dirname,_0xb8c5('0x18'),_0x38bd92['app']+_0xb8c5('0x1d')))){var _0x28350f=[];switch(_0x38bd92['app'][_0xb8c5('0x1e')]()){case _0xb8c5('0x1f'):var _0x4dc5e2=_0x38bd92[_0xb8c5('0x20')][_0xb8c5('0x21')](',');_0x28350f[_0xb8c5('0x22')](_0x4dc5e2[0x0]);_0x28350f[_0xb8c5('0x22')](_0x4dc5e2['slice'](0x1,_0x4dc5e2[_0xb8c5('0x1a')])[_0xb8c5('0x1c')](','));break;case'dialogflow':var _0x4dc5e2=_0x38bd92[_0xb8c5('0x20')][_0xb8c5('0x21')](',');_0x28350f['push'](_0x4dc5e2[0x0]);_0x28350f['push'](_0x4dc5e2[0x1]);_0x28350f[_0xb8c5('0x22')](_0x4dc5e2[_0xb8c5('0x23')](0x2,_0x4dc5e2[_0xb8c5('0x1a')])[_0xb8c5('0x1c')](','));break;case'amazonlex':var _0x4dc5e2=_0x38bd92[_0xb8c5('0x20')][_0xb8c5('0x21')](',');_0x28350f['push'](_0x4dc5e2[0x0]);_0x28350f[_0xb8c5('0x22')](_0x4dc5e2[0x1]);_0x28350f[_0xb8c5('0x22')](_0x4dc5e2[0x2]);_0x28350f[_0xb8c5('0x22')](_0x4dc5e2[0x3]);_0x28350f['push'](_0x4dc5e2[_0xb8c5('0x23')](0x4,_0x4dc5e2[_0xb8c5('0x1a')])[_0xb8c5('0x1c')](','));break;case _0xb8c5('0x16'):_0x28350f[_0xb8c5('0x22')](_0x38bd92['appdata']);break;case _0xb8c5('0x24'):_0x28350f['push'](_0x38bd92[_0xb8c5('0x25')]);_0x28350f[_0xb8c5('0x22')](_0x38bd92[_0xb8c5('0x20')]);break;default:_0x28350f=_[_0xb8c5('0x10')](_0x38bd92[_0xb8c5('0x20')])?[]:_0x38bd92[_0xb8c5('0x20')]['split'](',');}var _0x41bb83={'id':util[_0xb8c5('0xd')](_0xb8c5('0x26'),_0x4df22b,_0x38bd92['id'],_0x38bd92[_0xb8c5('0x27')]),'condition':require(_0xb8c5('0x28'))[_0xb8c5('0x29')](_0x4df22b,getIntervals(_0x89f7dd[_0xb8c5('0x2a')],_0x38bd92),_0x89f7dd),'consequence':require('./applications/'+_0x38bd92[_0xb8c5('0x27')])['consequence'](_0x4df22b,_0x28350f,_0x89f7dd,_0x336551),'p':_0x38bd92[_0xb8c5('0x2b')]||0x0};logger[_0xb8c5('0x2c')](_0xb8c5('0x2d'),_0x41bb83['id'],_0xb8c5('0x2e'),getIntervals(_0x89f7dd[_0xb8c5('0x2a')],_0x38bd92)[_0xb8c5('0x1c')]('\x20|\x20'));_0x14d1b0['push'](_0x41bb83);}else{logger[_0xb8c5('0x2f')](_0xb8c5('0x30'),path['join'](__dirname,_0xb8c5('0x18'),_0x38bd92[_0xb8c5('0x27')]+_0xb8c5('0x1d')));}}_0x89f7dd['rules'][_0x4df22b]=new RuleEngine(_0x14d1b0);_0x89f7dd[_0xb8c5('0x14')][_0x4df22b][_0xb8c5('0x31')](_0x336551,function(_0x18611c){logger['info'](_0xb8c5('0x32'),JSON['stringify'](_0x18611c[_0xb8c5('0x33')]));if(_0x89f7dd['rules'][_0x4df22b]){_0x89f7dd[_0xb8c5('0x14')][_0x4df22b][_0xb8c5('0x34')](_0xb8c5('0x35'));}});return _0x4e21b8({'code':0xc8,'message':_0x336551});}else{logger['info'](_0xb8c5('0x36'));return _0x4e21b8({'code':0xc8,'message':_0x336551});}}catch(_0x5bc4ed){logger[_0xb8c5('0x2f')](_0x5bc4ed[_0xb8c5('0x37')]);return _0x6ff368(_0x39eef0[_0xb8c5('0x2f')](0x1f4,_0x5bc4ed));}}return _0x6ff368(_0xb8c5('0x38'));});},'AcceptMessage':function(_0x3e8d86){var _0x8f73d1=this;return new Promise(function(_0x49eb10,_0x5525f4){if(_0x3e8d86[_0xb8c5('0x16')]&&_0x3e8d86[_0xb8c5('0x16')]['id']){try{var _0x7b1685=getId(_0x3e8d86[_0xb8c5('0x15')],_0x3e8d86[_0xb8c5('0x16')]?_0x3e8d86[_0xb8c5('0x16')]['id']:0x0,_0x3e8d86[_0xb8c5('0x17')]?_0x3e8d86['interaction']['id']:0x0);if(_0x89f7dd[_0xb8c5('0x14')][_0x7b1685]){_0x89f7dd['rules'][_0x7b1685][_0xb8c5('0x34')]('end');if(rpc[_0x3e8d86['channel']+_0xb8c5('0x39')]){rpc[_0x3e8d86['channel']+_0xb8c5('0x39')][_0xb8c5('0x3a')](_0x7b1685,{'UserId':_0x3e8d86[_0xb8c5('0x16')]['UserId']})[_0xb8c5('0x3b')](function(_0x21ffce){logger[_0xb8c5('0x2f')](_0xb8c5('0x3c'));});}}return _0x49eb10({'code':0xc8,'message':_0x3e8d86});}catch(_0x27ee87){logger[_0xb8c5('0x2f')](_0x27ee87['stack']);return _0x5525f4(_0x8f73d1[_0xb8c5('0x2f')](0x1f4,_0x27ee87));}}logger[_0xb8c5('0x2f')]('message\x20is\x20empty');return _0x5525f4(_0x8f73d1[_0xb8c5('0x2f')](0x1f4,_0xb8c5('0x3d')));});},'RejectMessage':function(_0x48affe){var _0x363375=this;return new Promise(function(_0x56ca93,_0x25280a){if(_0x48affe[_0xb8c5('0x3e')]&&_0x48affe[_0xb8c5('0x3e')]['id']){try{if(_0x89f7dd[_0xb8c5('0x3f')][_0x48affe[_0xb8c5('0x3e')]['id']]){_0x89f7dd['agents'][_0x48affe[_0xb8c5('0x3e')]['id']][_0xb8c5('0x40')]=![];_0x89f7dd['agents'][_0x48affe[_0xb8c5('0x3e')]['id']][_0xb8c5('0x41')]=undefined;}return _0x56ca93({'code':0xc8,'message':_0x48affe});}catch(_0x3d86be){logger[_0xb8c5('0x2f')](_0x3d86be[_0xb8c5('0x37')]);return _0x25280a(_0x363375[_0xb8c5('0x2f')](0x1f4,_0x3d86be));}}logger[_0xb8c5('0x2f')](_0xb8c5('0x3d'));return _0x25280a(_0x363375[_0xb8c5('0x2f')](0x1f4,_0xb8c5('0x3d')));});},'AbandonInteraction':function(_0x1d4934){var _0x5ea4c3=this;return new Promise(function(_0x1ef4b2,_0x5d0aa4){if(_0x1d4934[_0xb8c5('0x15')]&&_0x1d4934[_0xb8c5('0x17')]&&_0x1d4934[_0xb8c5('0x17')]['id']){try{var _0x505eb5=getId(_0x1d4934[_0xb8c5('0x15')],_0x1d4934[_0xb8c5('0x16')]?_0x1d4934[_0xb8c5('0x16')]['id']:0x0,_0x1d4934[_0xb8c5('0x17')]?_0x1d4934['interaction']['id']:0x0);if(_0x89f7dd[_0xb8c5('0x14')][_0x505eb5]){_0x89f7dd[_0xb8c5('0x14')][_0x505eb5][_0xb8c5('0x34')](_0xb8c5('0x35'));}return _0x1ef4b2({'code':0xc8,'message':_0x1d4934});}catch(_0x463b94){logger['error'](_0x463b94[_0xb8c5('0x37')]);return _0x5d0aa4(_0x5ea4c3[_0xb8c5('0x2f')](0x1f4,_0x463b94));}}logger[_0xb8c5('0x2f')](_0xb8c5('0x3d'));return _0x5d0aa4(_0x5ea4c3[_0xb8c5('0x2f')](0x1f4,_0xb8c5('0x3d')));});},'AgentCapacity':function(_0x31d697){var _0x424b3d=this;return new Promise(function(_0x4fe75d,_0x2bd7a5){if(_0x89f7dd[_0xb8c5('0x3f')]['hasOwnProperty'](_0x31d697['id'])){for(var _0x29b9c0 in _0x31d697[_0xb8c5('0x42')]){if(_0x31d697[_0xb8c5('0x42')]['hasOwnProperty'](_0x29b9c0)){if(_0x89f7dd[_0xb8c5('0x3f')][_0x31d697['id']][_0xb8c5('0x43')](_0x29b9c0+'CurrentCapacity')){_0x89f7dd[_0xb8c5('0x3f')][_0x31d697['id']][_0x29b9c0+_0xb8c5('0x44')]=parseInt(_0x31d697[_0xb8c5('0x42')][_0x29b9c0],0xa);}}}_0x89f7dd['agents'][_0x31d697['id']]['updateRealtime']();return _0x4fe75d({'code':0xc8,'message':_0x89f7dd[_0xb8c5('0x3f')][_0x31d697['id']]});}else{return _0x2bd7a5(_0x424b3d['error'](0x1f4,_0xb8c5('0x45')));}});},'Agents':function(_0x4a2fff){return new Promise(function(_0x5cf23f,_0x162fe7){var _0x5d9c73=_[_0xb8c5('0x46')](_0x89f7dd[_0xb8c5('0x3f')]);_0x5cf23f({'count':_0x5d9c73[_0xb8c5('0x1a')],'rows':_0x5d9c73});});},'ChatQueues':function(_0x2329fb){return new Promise(function(_0x5622af,_0x25f53a){var _0x5a840d=[];for(var _0x505508 in _0x89f7dd[_0xb8c5('0x47')]){if(_0x89f7dd['chatQueues'][_0xb8c5('0x43')](_0x505508)){var _0x1e11df=_0x89f7dd[_0xb8c5('0x47')][_0x505508];var _0x33e229={'id':_0x1e11df['id'],'available':_0x1e11df[_0xb8c5('0x48')],'loggedIn':_0x1e11df[_0xb8c5('0x49')],'name':_0x1e11df[_0xb8c5('0x4a')],'paused':_0x1e11df['paused'],'waiting':_0x1e11df['waiting']};_0x5a840d[_0xb8c5('0x22')](_0x33e229);}}_0x5622af({'count':_0x5a840d['length'],'rows':_0x5a840d});});},'MailQueues':function(_0x3820ee){return new Promise(function(_0x250f72,_0x18fe3e){var _0x5c97d4=[];for(var _0x59bd30 in _0x89f7dd['mailQueues']){if(_0x89f7dd['mailQueues'][_0xb8c5('0x43')](_0x59bd30)){var _0x7c33d5=_0x89f7dd[_0xb8c5('0x4b')][_0x59bd30];var _0x3c63c9={'id':_0x7c33d5['id'],'available':_0x7c33d5['available'],'loggedIn':_0x7c33d5[_0xb8c5('0x49')],'name':_0x7c33d5[_0xb8c5('0x4a')],'paused':_0x7c33d5[_0xb8c5('0x4c')],'waiting':_0x7c33d5[_0xb8c5('0x4d')]};_0x5c97d4[_0xb8c5('0x22')](_0x3c63c9);}}_0x250f72({'count':_0x5c97d4[_0xb8c5('0x1a')],'rows':_0x5c97d4});});},'OpenchannelQueues':function(_0x5c2566){return new Promise(function(_0x1ac383,_0x2722ae){var _0x59c1e8=[];for(var _0x1e620c in _0x89f7dd[_0xb8c5('0x4e')]){if(_0x89f7dd[_0xb8c5('0x4e')][_0xb8c5('0x43')](_0x1e620c)){var _0x3b67db=_0x89f7dd[_0xb8c5('0x4e')][_0x1e620c];var _0x294e22={'id':_0x3b67db['id'],'available':_0x3b67db['available'],'loggedIn':_0x3b67db['loggedIn'],'name':_0x3b67db[_0xb8c5('0x4a')],'paused':_0x3b67db['paused'],'waiting':_0x3b67db[_0xb8c5('0x4d')]};_0x59c1e8[_0xb8c5('0x22')](_0x294e22);}}_0x1ac383({'count':_0x59c1e8[_0xb8c5('0x1a')],'rows':_0x59c1e8});});},'SmsQueues':function(_0xc43da9){return new Promise(function(_0x5d51e8,_0x3a1f84){var _0x120ec3=[];for(var _0x321f91 in _0x89f7dd['smsQueues']){if(_0x89f7dd[_0xb8c5('0x4f')][_0xb8c5('0x43')](_0x321f91)){var _0x434a87=_0x89f7dd[_0xb8c5('0x4f')][_0x321f91];var _0x537a42={'id':_0x434a87['id'],'available':_0x434a87[_0xb8c5('0x48')],'loggedIn':_0x434a87[_0xb8c5('0x49')],'name':_0x434a87[_0xb8c5('0x4a')],'paused':_0x434a87['paused'],'waiting':_0x434a87[_0xb8c5('0x4d')]};_0x120ec3[_0xb8c5('0x22')](_0x537a42);}}_0x5d51e8({'count':_0x120ec3[_0xb8c5('0x1a')],'rows':_0x120ec3});});},'FaxQueues':function(_0x237b18){return new Promise(function(_0x2e5588,_0x35ac76){var _0x8e77af=[];for(var _0x4877c4 in _0x89f7dd['faxQueues']){if(_0x89f7dd[_0xb8c5('0x50')][_0xb8c5('0x43')](_0x4877c4)){var _0x4d92a6=_0x89f7dd[_0xb8c5('0x50')][_0x4877c4];var _0x58680f={'id':_0x4d92a6['id'],'available':_0x4d92a6[_0xb8c5('0x48')],'loggedIn':_0x4d92a6[_0xb8c5('0x49')],'name':_0x4d92a6['name'],'paused':_0x4d92a6[_0xb8c5('0x4c')],'waiting':_0x4d92a6[_0xb8c5('0x4d')]};_0x8e77af[_0xb8c5('0x22')](_0x58680f);}}_0x2e5588({'count':_0x8e77af[_0xb8c5('0x1a')],'rows':_0x8e77af});});},'ChatQueuesWaitingInteractions':function(_0xeacd5e){return new Promise(function(_0x4e848e,_0xe82a23){var _0xa0106a=_['values'](_0x89f7dd['chatQueuesWaitingInteractions']);_0x4e848e({'count':_0xa0106a[_0xb8c5('0x1a')],'rows':_0xa0106a});});},'MailQueuesWaitingInteractions':function(_0x53b11d){return new Promise(function(_0x705fe1,_0x429a83){var _0x5e1b1a=_[_0xb8c5('0x46')](_0x89f7dd['mailQueuesWaitingInteractions']);_0x705fe1({'count':_0x5e1b1a[_0xb8c5('0x1a')],'rows':_0x5e1b1a});});},'OpenchannelQueuesWaitingInteractions':function(_0x436825){return new Promise(function(_0x15b6a7,_0x457236){var _0x383bd7=_[_0xb8c5('0x46')](_0x89f7dd[_0xb8c5('0x51')]);_0x15b6a7({'count':_0x383bd7[_0xb8c5('0x1a')],'rows':_0x383bd7});});},'SmsQueuesWaitingInteractions':function(_0x14608a){return new Promise(function(_0x60c28e,_0x304a03){var _0x55243a=_[_0xb8c5('0x46')](_0x89f7dd[_0xb8c5('0x52')]);_0x60c28e({'count':_0x55243a[_0xb8c5('0x1a')],'rows':_0x55243a});});},'FaxQueuesWaitingInteractions':function(_0x330082){return new Promise(function(_0x493eb1,_0x3ccb63){var _0x3e839b=_['values'](_0x89f7dd['faxQueuesWaitingInteractions']);_0x493eb1({'count':_0x3e839b[_0xb8c5('0x1a')],'rows':_0x3e839b});});}};var _0x4440e7=jayson[_0xb8c5('0x53')](_0x39a41c)['http']();_0x4440e7['on'](_0xb8c5('0x2f'),function(_0x439331){logger[_0xb8c5('0x2f')](JSON[_0xb8c5('0x54')](_0x439331));return _0x256a32(_0x439331);});_0x4440e7[_0xb8c5('0x55')](0x232c,_0xb8c5('0x56'),function(){console[_0xb8c5('0x57')](_0xb8c5('0x58'),0x232c);return _0x533d6e(_0xb8c5('0x59')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7cc2d14..c40f20c 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 _0x134d=['push','Command','format','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x134d,0x1c0));var _0xd134=function(_0xa29d3c,_0x23499b){_0xa29d3c=_0xa29d3c-0x0;var _0x310c3f=_0x134d[_0xa29d3c];return _0x310c3f;};'use strict';var util=require('util');var BPromise=require(_0xd134('0x0'));var jayson=require(_0xd134('0x1'));var _=require(_0xd134('0x2'));var logger=require(_0xd134('0x3'))(_0xd134('0x4'));var client=jayson[_0xd134('0x5')][_0xd134('0x6')]({'port':0x232a});function request(_0x1ea92d,_0x2fa9c8){return new BPromise(function(_0x2fc9cc,_0x4f50c9){return client['request'](_0x1ea92d,_0x2fa9c8)[_0xd134('0x7')](function(_0x4364f9){if(_0x4364f9['error']){return _0x4f50c9(_0x4364f9[_0xd134('0x8')][_0xd134('0x9')]);}else{return _0x2fc9cc(_0x4364f9[_0xd134('0xa')]);}})[_0xd134('0xb')](function(_0x409e8b){return _0x4f50c9(_0x409e8b);});});}exports['condition']=function(_0x191bcb,_0x4636b3,_0x19f550){return function(_0x2ec1b6){if(_0x19f550[_0xd134('0xc')]&&!_0x19f550[_0xd134('0xc')][_0x191bcb]){logger['info'](_0xd134('0xd'),_0x191bcb);return _0x2ec1b6[_0xd134('0xe')]();}var _0x970ecf=[];for(var _0x4ea720=0x0;_0x4ea720<_0x4636b3[_0xd134('0xf')];_0x4ea720+=0x1){_0x970ecf[_0xd134('0x10')](request(_0xd134('0x11'),{'command':util[_0xd134('0x12')]('iftime\x20%s',_0x4636b3[_0x4ea720])})['then'](function(_0x4a9334){return _0x4a9334&&_0x4a9334[_0xd134('0x9')]&&_0x4a9334['message']['indexOf'](_0xd134('0x13'))>=0x0?!![]:![];})[_0xd134('0xb')](function(_0x5075f5){logger[_0xd134('0x8')](_0xd134('0x14'),_0x191bcb,_0x4636b3[_0x4ea720]);}));}BPromise[_0xd134('0x15')](_0x970ecf)[_0xd134('0x7')](function(_0x3df249){var _0x3e3e46=_[_0xd134('0x16')](_0x3df249);logger[_0xd134('0x17')](_0xd134('0x18'),_0x191bcb,_0x4636b3[_0xd134('0x19')](_0xd134('0x1a')),_0x3e3e46);_0x2ec1b6[_0xd134('0x1b')](_0x3e3e46);})['catch'](function(_0x1247bd){console['log'](_0x1247bd);logger['error'](_0xd134('0x18'),_0x191bcb,_0x4636b3['join']('\x20|\x20'),_0x1247bd[_0xd134('0x1c')]);_0x2ec1b6[_0xd134('0xe')]();});};}; \ No newline at end of file +var _0xada8=['when','log','jayson/promise','routing','client','request','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','[%s][INTERVAL]\x20%s','all','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x3255df,_0x31408a){var _0x4ca64e=function(_0x2811d2){while(--_0x2811d2){_0x3255df['push'](_0x3255df['shift']());}};_0x4ca64e(++_0x31408a);}(_0xada8,0x1b7));var _0x8ada=function(_0x2f0626,_0x516214){_0x2f0626=_0x2f0626-0x0;var _0x4b8565=_0xada8[_0x2f0626];return _0x4b8565;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x8ada('0x0'));var _=require('lodash');var logger=require('../../../config/logger')(_0x8ada('0x1'));var client=jayson[_0x8ada('0x2')]['http']({'port':0x232a});function request(_0x14d1af,_0x21cf3a){return new BPromise(function(_0x1a62cc,_0x2465b4){return client[_0x8ada('0x3')](_0x14d1af,_0x21cf3a)[_0x8ada('0x4')](function(_0x1020e1){if(_0x1020e1[_0x8ada('0x5')]){return _0x2465b4(_0x1020e1[_0x8ada('0x5')][_0x8ada('0x6')]);}else{return _0x1a62cc(_0x1020e1['result']);}})[_0x8ada('0x7')](function(_0x1f41ee){return _0x2465b4(_0x1f41ee);});});}exports[_0x8ada('0x8')]=function(_0x45ca03,_0x5e10c4,_0x5a836b){return function(_0x13f3e3){if(_0x5a836b[_0x8ada('0x9')]&&!_0x5a836b[_0x8ada('0x9')][_0x45ca03]){logger['info'](_0x8ada('0xa'),_0x45ca03);return _0x13f3e3['stop']();}var _0x87d3be=[];for(var _0x3dc47e=0x0;_0x3dc47e<_0x5e10c4[_0x8ada('0xb')];_0x3dc47e+=0x1){_0x87d3be[_0x8ada('0xc')](request('Command',{'command':util[_0x8ada('0xd')](_0x8ada('0xe'),_0x5e10c4[_0x3dc47e])})[_0x8ada('0x4')](function(_0x43ba3f){return _0x43ba3f&&_0x43ba3f[_0x8ada('0x6')]&&_0x43ba3f[_0x8ada('0x6')]['indexOf']('true')>=0x0?!![]:![];})[_0x8ada('0x7')](function(_0xede026){logger[_0x8ada('0x5')](_0x8ada('0xf'),_0x45ca03,_0x5e10c4[_0x3dc47e]);}));}BPromise[_0x8ada('0x10')](_0x87d3be)[_0x8ada('0x4')](function(_0x5e558e){var _0x438ccb=_['some'](_0x5e558e);logger[_0x8ada('0x11')](_0x8ada('0x12'),_0x45ca03,_0x5e10c4[_0x8ada('0x13')](_0x8ada('0x14')),_0x438ccb);_0x13f3e3[_0x8ada('0x15')](_0x438ccb);})['catch'](function(_0x131c6c){console[_0x8ada('0x16')](_0x131c6c);logger[_0x8ada('0x5')](_0x8ada('0x12'),_0x45ca03,_0x5e10c4[_0x8ada('0x13')]('\x20|\x20'),_0x131c6c['stack']);_0x13f3e3['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 997730f..39cbbdf 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 _0x4cd0=['stack','agentringnoanswer','rejected','reason','holdtime','ringtime','talktime','forIn','agentringnoanswerAt','abandoned','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','complete','isNil','transfereruniqueid','transfer','blind','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','transfertargetuniqueid','calleridname','hangup','agentcomplete','diffTime','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','error'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x4cd0,0xf0));var _0x04cd=function(_0x581fd4,_0x4a81ea){_0x581fd4=_0x581fd4-0x0;var _0x43ce49=_0x4cd0[_0x581fd4];return _0x43ce49;};'use strict';var _=require(_0x04cd('0x0'));var util=require(_0x04cd('0x1'));var utils=require(_0x04cd('0x2'));var agents={};var transfers={};function writeDB(_0x1e1f83,_0x44c5ca){utils[_0x04cd('0x3')](util[_0x04cd('0x4')](_0x04cd('0x5'),_0x1e1f83[_0x04cd('0x6')],_0x1e1f83[_0x04cd('0x7')],_0x1e1f83[_0x04cd('0x8')],_0x1e1f83[_0x04cd('0x9')],_0x1e1f83[_0x04cd('0xa')],_0x1e1f83[_0x04cd('0xb')],_0x1e1f83[_0x04cd('0xc')],_0x1e1f83[_0x04cd('0xd')]));if(_0x1e1f83['queue']){utils[_0x04cd('0xe')](_0x1e1f83['queue'])[_0x04cd('0xf')](function(_0x324f2f){if(_0x324f2f){_0x1e1f83['type']=_0x324f2f[_0x04cd('0x10')];_0x1e1f83[_0x04cd('0x11')]=_0x1e1f83['agentcomplete']?_0x324f2f[_0x04cd('0x12')]:![];_0x1e1f83[_0x04cd('0x13')]=_0x1e1f83[_0x04cd('0x11')]?_0x324f2f[_0x04cd('0x14')]:0x0;}utils[_0x04cd('0x15')](_0x04cd('0x16'),_0x1e1f83);});}else{utils['request']('CreateVoiceAgentReport',_0x1e1f83);}if(_0x44c5ca){delete transfers[_0x1e1f83['uniqueid']];}else{delete agents[_0x1e1f83[_0x04cd('0x17')]];}}exports['agentcalled']=function(_0x3ccb2c){try{agents[_0x3ccb2c[_0x04cd('0x17')]]=_0x3ccb2c;agents[_0x3ccb2c['destuniqueid']][_0x04cd('0x18')]=utils[_0x04cd('0x19')]();agents[_0x3ccb2c['destuniqueid']][_0x04cd('0xd')]=_0x04cd('0x1a');agents[_0x3ccb2c['destuniqueid']][_0x04cd('0xc')]=null;agents[_0x3ccb2c[_0x04cd('0x17')]]['connectedlinename']=null;}catch(_0x4f7dc2){utils[_0x04cd('0x1b')](_0x4f7dc2[_0x04cd('0x1c')]);}};exports[_0x04cd('0x1d')]=function(_0x1e55e1){try{if(!_['isNil'](agents[_0x1e55e1[_0x04cd('0x17')]])){agents[_0x1e55e1[_0x04cd('0x17')]]['agentringnoanswer']=!![];agents[_0x1e55e1[_0x04cd('0x17')]]['agentringnoanswerAt']=utils[_0x04cd('0x19')]();agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0xd')]=_0x04cd('0x1e');agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x1f')]=_0x04cd('0x1e');agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x20')]=_0x1e55e1['ringtime']?parseInt(_0x1e55e1[_0x04cd('0x21')])/0x3e8:0x0;agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x22')]=0x0;writeDB(agents[_0x1e55e1[_0x04cd('0x17')]]);}}catch(_0x664414){utils[_0x04cd('0x1b')](_0x664414[_0x04cd('0x1c')]);}};exports['queuecallerabandon']=function(_0xceceff){try{_[_0x04cd('0x23')](agents,function(_0x1049f8,_0x9bbf6a){if(_0x1049f8[_0x04cd('0x6')]==_0xceceff[_0x04cd('0x6')]){_0x1049f8[_0x04cd('0x1d')]=!![];_0x1049f8[_0x04cd('0x24')]=utils[_0x04cd('0x19')]();_0x1049f8['lastevent']='abandoned';_0x1049f8[_0x04cd('0x1f')]=_0x04cd('0x25');_0x1049f8['holdtime']=_0xceceff['holdtime'];_0x1049f8[_0x04cd('0x22')]=0x0;writeDB(_0x1049f8);}});}catch(_0x2c7e83){utils['error'](_0x2c7e83[_0x04cd('0x1c')]);}};exports[_0x04cd('0x26')]=function(_0x5a8b70){try{if(agents[_0x5a8b70['destuniqueid']]){agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x27')]=utils[_0x04cd('0x19')]();agents[_0x5a8b70[_0x04cd('0x17')]]['connectedlinenum']=_0x5a8b70[_0x04cd('0xc')];agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x28')]=_0x5a8b70[_0x04cd('0x28')];agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x20')]=_0x5a8b70['ringtime'];agents[_0x5a8b70[_0x04cd('0x17')]]['lastevent']='connect';_[_0x04cd('0x23')](agents,function(_0x1ea463,_0x5b5c46){if(_0x1ea463[_0x04cd('0x17')]!=_0x5a8b70['destuniqueid']&&_0x1ea463['uniqueid']==_0x5a8b70[_0x04cd('0x6')]){_0x1ea463[_0x04cd('0x22')]=0x0;_0x1ea463[_0x04cd('0x20')]=_0x5a8b70[_0x04cd('0x21')];_0x1ea463['agentringnoanswer']=!![];_0x1ea463[_0x04cd('0x24')]=utils[_0x04cd('0x19')]();_0x1ea463[_0x04cd('0xd')]=_0x04cd('0x29');_0x1ea463[_0x04cd('0x1f')]='answered_elsewhere';_0x1ea463[_0x04cd('0x2a')]=_0x5a8b70[_0x04cd('0x17')];_0x1ea463['answeredelsewheremembername']=_0x5a8b70[_0x04cd('0x9')];writeDB(_0x1ea463);}});}}catch(_0x1088f4){utils[_0x04cd('0x1b')](_0x1088f4[_0x04cd('0x1c')]);}};exports['agentcomplete']=function(_0x494d62){try{if(!_['isNil'](agents[_0x494d62[_0x04cd('0x17')]])){agents[_0x494d62[_0x04cd('0x17')]]['agentcomplete']=!![];agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x2b')]=utils[_0x04cd('0x19')]();agents[_0x494d62[_0x04cd('0x17')]]['talktime']=utils['diffTime'](agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x2b')],agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x27')]);agents[_0x494d62[_0x04cd('0x17')]]['reason']=_0x494d62['reason'];agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0xd')]=_0x04cd('0x2c');writeDB(agents[_0x494d62[_0x04cd('0x17')]]);}}catch(_0x2b257a){utils['error'](_0x2b257a[_0x04cd('0x1c')]);}};exports['blindtransfer']=function(_0x1e5b60){try{if(!_[_0x04cd('0x2d')](agents[_0x1e5b60[_0x04cd('0x2e')]])){agents[_0x1e5b60[_0x04cd('0x2e')]][_0x04cd('0x2f')]=!![];agents[_0x1e5b60['transfereruniqueid']]['transfertype']=_0x04cd('0x30');agents[_0x1e5b60[_0x04cd('0x2e')]]['transferexten']=_0x1e5b60[_0x04cd('0x31')];agents[_0x1e5b60[_0x04cd('0x2e')]]['transferuniqueid']=agents[_0x1e5b60[_0x04cd('0x2e')]][_0x04cd('0x6')];}}catch(_0x54ea1c){utils[_0x04cd('0x1b')](_0x54ea1c[_0x04cd('0x1c')]);}};exports[_0x04cd('0x32')]=function(_0x5c9262){try{if(_0x5c9262[_0x04cd('0x33')]==_0x5c9262[_0x04cd('0x34')]){if(!_['isNil'](agents[_0x5c9262[_0x04cd('0x35')]])){agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x2f')]=!![];agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x36')]=_0x04cd('0x37');agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x38')]=_0x5c9262['origtransfererexten'];agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x39')]=_0x5c9262[_0x04cd('0x33')];}if(_0x5c9262[_0x04cd('0x3a')]&&agents[_0x5c9262[_0x04cd('0x3a')]]){agents[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x3b')]=0x1;transfers[_0x5c9262[_0x04cd('0x3a')]]=_[_0x04cd('0x3c')](agents[_0x5c9262['transfereeuniqueid']]);transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0xb')]=agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0xb')];transfers[_0x5c9262[_0x04cd('0x3a')]]['calleridname']=agents[_0x5c9262['secondtransfereruniqueid']]['calleridname'];transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x18')]=utils['now']();transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x27')]=utils[_0x04cd('0x19')]();transfers[_0x5c9262['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x5c9262['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x5c9262['secondtransfereruniqueid']==_0x5c9262['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x5c9262[_0x04cd('0x33')]])){agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0x2f')]=!![];agents[_0x5c9262[_0x04cd('0x33')]]['transfertype']=_0x04cd('0x37');agents[_0x5c9262[_0x04cd('0x33')]][_0x04cd('0x38')]=_0x5c9262['secondtransfererexten'];agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0x39')]=_0x5c9262['secondtransfereruniqueid'];}if(_0x5c9262[_0x04cd('0x3d')]&&agents[_0x5c9262[_0x04cd('0x3d')]]){agents[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x3b')]=0x1;transfers[_0x5c9262['transfertargetuniqueid']]=_[_0x04cd('0x3c')](agents[_0x5c9262['transfertargetuniqueid']]);transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0xb')]=agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0xb')];transfers[_0x5c9262[_0x04cd('0x3d')]]['calleridname']=agents[_0x5c9262[_0x04cd('0x33')]][_0x04cd('0x3e')];transfers[_0x5c9262[_0x04cd('0x3d')]]['agentcalledAt']=utils[_0x04cd('0x19')]();transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x27')]=utils['now']();transfers[_0x5c9262[_0x04cd('0x3d')]]['holdtime']=0x0;transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x3b')]=0x2;}}}catch(_0x218d40){utils[_0x04cd('0x1b')](_0x218d40[_0x04cd('0x1c')]);}};exports[_0x04cd('0x3f')]=function(_0x2270d9){try{if(transfers[_0x2270d9[_0x04cd('0x6')]]){transfers[_0x2270d9['uniqueid']][_0x04cd('0x40')]=!![];transfers[_0x2270d9['uniqueid']][_0x04cd('0x2b')]=utils['now']();transfers[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x22')]=utils[_0x04cd('0x41')](transfers[_0x2270d9[_0x04cd('0x6')]]['agentcompleteAt'],transfers[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]);transfers[_0x2270d9['uniqueid']][_0x04cd('0x1f')]='agent';transfers[_0x2270d9[_0x04cd('0x6')]]['lastevent']=_0x04cd('0x2c');writeDB(transfers[_0x2270d9[_0x04cd('0x6')]],!![]);}if(agents[_0x2270d9[_0x04cd('0x6')]]&&agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]){agents[_0x2270d9[_0x04cd('0x6')]]['agentcomplete']=!![];agents[_0x2270d9['uniqueid']][_0x04cd('0x2b')]=utils[_0x04cd('0x19')]();agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x22')]=utils[_0x04cd('0x41')](agents[_0x2270d9['uniqueid']]['agentcompleteAt'],agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]);agents[_0x2270d9[_0x04cd('0x6')]]['reason']=agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x2f')]?_0x04cd('0x2f'):_0x04cd('0x42');agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0xd')]=_0x04cd('0x2c');writeDB(agents[_0x2270d9[_0x04cd('0x6')]]);}}catch(_0x468fd0){utils[_0x04cd('0x1b')](_0x468fd0[_0x04cd('0x1c')]);}}; \ No newline at end of file +var _0xf43f=['attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agent','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','type','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','called','connectedlinenum','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','now','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid'];(function(_0x19e38e,_0xb15cc7){var _0x14bec3=function(_0xd38dd3){while(--_0xd38dd3){_0x19e38e['push'](_0x19e38e['shift']());}};_0x14bec3(++_0xb15cc7);}(_0xf43f,0x93));var _0xff43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf43f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xff43('0x0'));var util=require(_0xff43('0x1'));var utils=require(_0xff43('0x2'));var agents={};var transfers={};function writeDB(_0x2ec703,_0x5ee939){utils[_0xff43('0x3')](util['format'](_0xff43('0x4'),_0x2ec703[_0xff43('0x5')],_0x2ec703[_0xff43('0x6')],_0x2ec703['queue'],_0x2ec703[_0xff43('0x7')],_0x2ec703[_0xff43('0x8')],_0x2ec703[_0xff43('0x9')],_0x2ec703['connectedlinenum'],_0x2ec703[_0xff43('0xa')]));if(_0x2ec703[_0xff43('0xb')]){utils[_0xff43('0xc')](_0x2ec703[_0xff43('0xb')])['then'](function(_0x42a1c3){if(_0x42a1c3){_0x2ec703[_0xff43('0xd')]=_0x42a1c3[_0xff43('0xd')];_0x2ec703['agentacw']=_0x2ec703[_0xff43('0xe')]?_0x42a1c3[_0xff43('0xf')]:![];_0x2ec703['acwtime']=_0x2ec703['agentacw']?_0x42a1c3['acwTimeout']:0x0;}utils[_0xff43('0x10')]('CreateVoiceAgentReport',_0x2ec703);});}else{utils[_0xff43('0x10')](_0xff43('0x11'),_0x2ec703);}if(_0x5ee939){delete transfers[_0x2ec703[_0xff43('0x5')]];}else{delete agents[_0x2ec703[_0xff43('0x12')]];}}exports[_0xff43('0x13')]=function(_0xe58fb8){try{agents[_0xe58fb8[_0xff43('0x12')]]=_0xe58fb8;agents[_0xe58fb8[_0xff43('0x12')]][_0xff43('0x14')]=utils['now']();agents[_0xe58fb8[_0xff43('0x12')]]['lastevent']=_0xff43('0x15');agents[_0xe58fb8[_0xff43('0x12')]][_0xff43('0x16')]=null;agents[_0xe58fb8['destuniqueid']]['connectedlinename']=null;}catch(_0x3c4563){utils[_0xff43('0x17')](_0x3c4563[_0xff43('0x18')]);}};exports[_0xff43('0x19')]=function(_0x472ad2){try{if(!_[_0xff43('0x1a')](agents[_0x472ad2[_0xff43('0x12')]])){agents[_0x472ad2[_0xff43('0x12')]][_0xff43('0x19')]=!![];agents[_0x472ad2['destuniqueid']][_0xff43('0x1b')]=utils[_0xff43('0x1c')]();agents[_0x472ad2[_0xff43('0x12')]][_0xff43('0xa')]=_0xff43('0x1d');agents[_0x472ad2[_0xff43('0x12')]][_0xff43('0x1e')]=_0xff43('0x1d');agents[_0x472ad2[_0xff43('0x12')]][_0xff43('0x1f')]=_0x472ad2[_0xff43('0x20')]?parseInt(_0x472ad2['ringtime'])/0x3e8:0x0;agents[_0x472ad2[_0xff43('0x12')]][_0xff43('0x21')]=0x0;writeDB(agents[_0x472ad2[_0xff43('0x12')]]);}}catch(_0x3b5042){utils[_0xff43('0x17')](_0x3b5042['stack']);}};exports[_0xff43('0x22')]=function(_0x2f7f5a){try{_[_0xff43('0x23')](agents,function(_0x56c5b5,_0x440747){if(_0x56c5b5['uniqueid']==_0x2f7f5a['uniqueid']){_0x56c5b5['agentringnoanswer']=!![];_0x56c5b5[_0xff43('0x1b')]=utils[_0xff43('0x1c')]();_0x56c5b5[_0xff43('0xa')]=_0xff43('0x24');_0x56c5b5[_0xff43('0x1e')]='abandoned';_0x56c5b5[_0xff43('0x1f')]=_0x2f7f5a[_0xff43('0x1f')];_0x56c5b5[_0xff43('0x21')]=0x0;writeDB(_0x56c5b5);}});}catch(_0x57e7b7){utils[_0xff43('0x17')](_0x57e7b7[_0xff43('0x18')]);}};exports[_0xff43('0x25')]=function(_0x400d27){try{if(agents[_0x400d27['destuniqueid']]){agents[_0x400d27[_0xff43('0x12')]]['agentconnectAt']=utils[_0xff43('0x1c')]();agents[_0x400d27['destuniqueid']][_0xff43('0x16')]=_0x400d27[_0xff43('0x16')];agents[_0x400d27['destuniqueid']][_0xff43('0x26')]=_0x400d27[_0xff43('0x26')];agents[_0x400d27[_0xff43('0x12')]][_0xff43('0x1f')]=_0x400d27[_0xff43('0x20')];agents[_0x400d27[_0xff43('0x12')]][_0xff43('0xa')]='connect';_[_0xff43('0x23')](agents,function(_0x1362f6,_0x25347f){if(_0x1362f6['destuniqueid']!=_0x400d27[_0xff43('0x12')]&&_0x1362f6[_0xff43('0x5')]==_0x400d27[_0xff43('0x5')]){_0x1362f6[_0xff43('0x21')]=0x0;_0x1362f6[_0xff43('0x1f')]=_0x400d27[_0xff43('0x20')];_0x1362f6['agentringnoanswer']=!![];_0x1362f6[_0xff43('0x1b')]=utils[_0xff43('0x1c')]();_0x1362f6[_0xff43('0xa')]=_0xff43('0x27');_0x1362f6[_0xff43('0x1e')]=_0xff43('0x27');_0x1362f6[_0xff43('0x28')]=_0x400d27['destuniqueid'];_0x1362f6[_0xff43('0x29')]=_0x400d27[_0xff43('0x7')];writeDB(_0x1362f6);}});}}catch(_0x3c16dd){utils[_0xff43('0x17')](_0x3c16dd['stack']);}};exports[_0xff43('0xe')]=function(_0x498df5){try{if(!_[_0xff43('0x1a')](agents[_0x498df5[_0xff43('0x12')]])){agents[_0x498df5[_0xff43('0x12')]]['agentcomplete']=!![];agents[_0x498df5[_0xff43('0x12')]][_0xff43('0x2a')]=utils[_0xff43('0x1c')]();agents[_0x498df5[_0xff43('0x12')]][_0xff43('0x21')]=utils[_0xff43('0x2b')](agents[_0x498df5[_0xff43('0x12')]]['agentcompleteAt'],agents[_0x498df5[_0xff43('0x12')]][_0xff43('0x2c')]);agents[_0x498df5[_0xff43('0x12')]][_0xff43('0x1e')]=_0x498df5['reason'];agents[_0x498df5['destuniqueid']][_0xff43('0xa')]=_0xff43('0x2d');writeDB(agents[_0x498df5[_0xff43('0x12')]]);}}catch(_0x19ced5){utils[_0xff43('0x17')](_0x19ced5[_0xff43('0x18')]);}};exports[_0xff43('0x2e')]=function(_0x12502e){try{if(!_[_0xff43('0x1a')](agents[_0x12502e[_0xff43('0x2f')]])){agents[_0x12502e[_0xff43('0x2f')]][_0xff43('0x30')]=!![];agents[_0x12502e['transfereruniqueid']][_0xff43('0x31')]=_0xff43('0x32');agents[_0x12502e[_0xff43('0x2f')]][_0xff43('0x33')]=_0x12502e[_0xff43('0x34')];agents[_0x12502e['transfereruniqueid']][_0xff43('0x35')]=agents[_0x12502e[_0xff43('0x2f')]][_0xff43('0x5')];}}catch(_0x5df3d8){utils[_0xff43('0x17')](_0x5df3d8[_0xff43('0x18')]);}};exports[_0xff43('0x36')]=function(_0x3eb252){try{if(_0x3eb252[_0xff43('0x37')]==_0x3eb252[_0xff43('0x38')]){if(!_[_0xff43('0x1a')](agents[_0x3eb252['secondtransfereruniqueid']])){agents[_0x3eb252[_0xff43('0x39')]]['transfer']=!![];agents[_0x3eb252[_0xff43('0x39')]][_0xff43('0x31')]=_0xff43('0x3a');agents[_0x3eb252[_0xff43('0x39')]]['transferexten']=_0x3eb252['origtransfererexten'];agents[_0x3eb252[_0xff43('0x39')]][_0xff43('0x35')]=_0x3eb252[_0xff43('0x37')];}if(_0x3eb252['transfereeuniqueid']&&agents[_0x3eb252['transfereeuniqueid']]){agents[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x3c')]=0x1;transfers[_0x3eb252['transfereeuniqueid']]=_[_0xff43('0x3d')](agents[_0x3eb252[_0xff43('0x3b')]]);transfers[_0x3eb252['transfereeuniqueid']][_0xff43('0x9')]=agents[_0x3eb252[_0xff43('0x39')]][_0xff43('0x9')];transfers[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x3e')]=agents[_0x3eb252[_0xff43('0x39')]][_0xff43('0x3e')];transfers[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x14')]=utils[_0xff43('0x1c')]();transfers[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x2c')]=utils['now']();transfers[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x1f')]=0x0;transfers[_0x3eb252[_0xff43('0x3b')]][_0xff43('0x3c')]=0x2;}}else if(_0x3eb252['secondtransfereruniqueid']==_0x3eb252[_0xff43('0x3f')]){if(!_['isNil'](agents[_0x3eb252[_0xff43('0x37')]])){agents[_0x3eb252['origtransfereruniqueid']][_0xff43('0x30')]=!![];agents[_0x3eb252[_0xff43('0x37')]][_0xff43('0x31')]=_0xff43('0x3a');agents[_0x3eb252[_0xff43('0x37')]][_0xff43('0x33')]=_0x3eb252[_0xff43('0x40')];agents[_0x3eb252['origtransfereruniqueid']]['transferuniqueid']=_0x3eb252[_0xff43('0x39')];}if(_0x3eb252[_0xff43('0x41')]&&agents[_0x3eb252[_0xff43('0x41')]]){agents[_0x3eb252[_0xff43('0x41')]][_0xff43('0x3c')]=0x1;transfers[_0x3eb252['transfertargetuniqueid']]=_[_0xff43('0x3d')](agents[_0x3eb252['transfertargetuniqueid']]);transfers[_0x3eb252[_0xff43('0x41')]][_0xff43('0x9')]=agents[_0x3eb252['origtransfereruniqueid']][_0xff43('0x9')];transfers[_0x3eb252[_0xff43('0x41')]]['calleridname']=agents[_0x3eb252[_0xff43('0x37')]][_0xff43('0x3e')];transfers[_0x3eb252[_0xff43('0x41')]][_0xff43('0x14')]=utils[_0xff43('0x1c')]();transfers[_0x3eb252[_0xff43('0x41')]][_0xff43('0x2c')]=utils[_0xff43('0x1c')]();transfers[_0x3eb252[_0xff43('0x41')]][_0xff43('0x1f')]=0x0;transfers[_0x3eb252['transfertargetuniqueid']][_0xff43('0x3c')]=0x2;}}}catch(_0x31266b){utils[_0xff43('0x17')](_0x31266b[_0xff43('0x18')]);}};exports['hangup']=function(_0x34d483){try{if(transfers[_0x34d483[_0xff43('0x5')]]){transfers[_0x34d483['uniqueid']][_0xff43('0xe')]=!![];transfers[_0x34d483[_0xff43('0x5')]][_0xff43('0x2a')]=utils[_0xff43('0x1c')]();transfers[_0x34d483[_0xff43('0x5')]][_0xff43('0x21')]=utils['diffTime'](transfers[_0x34d483[_0xff43('0x5')]][_0xff43('0x2a')],transfers[_0x34d483[_0xff43('0x5')]][_0xff43('0x2c')]);transfers[_0x34d483[_0xff43('0x5')]][_0xff43('0x1e')]=_0xff43('0x42');transfers[_0x34d483['uniqueid']][_0xff43('0xa')]=_0xff43('0x2d');writeDB(transfers[_0x34d483[_0xff43('0x5')]],!![]);}if(agents[_0x34d483[_0xff43('0x5')]]&&agents[_0x34d483[_0xff43('0x5')]][_0xff43('0x2c')]){agents[_0x34d483[_0xff43('0x5')]][_0xff43('0xe')]=!![];agents[_0x34d483[_0xff43('0x5')]][_0xff43('0x2a')]=utils[_0xff43('0x1c')]();agents[_0x34d483['uniqueid']][_0xff43('0x21')]=utils[_0xff43('0x2b')](agents[_0x34d483[_0xff43('0x5')]][_0xff43('0x2a')],agents[_0x34d483['uniqueid']]['agentconnectAt']);agents[_0x34d483[_0xff43('0x5')]]['reason']=agents[_0x34d483[_0xff43('0x5')]][_0xff43('0x30')]?_0xff43('0x30'):_0xff43('0x42');agents[_0x34d483[_0xff43('0x5')]]['lastevent']=_0xff43('0x2d');writeDB(agents[_0x34d483['uniqueid']]);}}catch(_0x2d5628){utils[_0xff43('0x17')](_0x2d5628[_0xff43('0x18')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 697d709..a03a79b 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 _0x58d0=['calleridname','calleridnum','endtime','duration','diffTime','billableseconds','error','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-phone','value','callerid','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','queue','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','application','toLowerCase','lastdata','lodash','util','./utils','FAILED','NO\x20ANSWER','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','accountcode','source','destination','disposition','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','linkedid','channel','OutgoingSpoolFailed','exten','context','now','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','ANSWERED','stack','hangup'];(function(_0x459d34,_0x5cc6c9){var _0x1d220f=function(_0x137d1d){while(--_0x137d1d){_0x459d34['push'](_0x459d34['shift']());}};_0x1d220f(++_0x5cc6c9);}(_0x58d0,0x177));var _0x058d=function(_0x234cdb,_0x28750b){_0x234cdb=_0x234cdb-0x0;var _0x1d18bb=_0x58d0[_0x234cdb];return _0x1d18bb;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var utils=require(_0x058d('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x058d('0x3'),_0x058d('0x4'),_0x058d('0x4'),'NO\x20ANSWER','ANSWERED',_0x058d('0x5'),_0x058d('0x3'),_0x058d('0x3'),_0x058d('0x3')];var channels={};function writeDB(_0x45f98d){utils[_0x058d('0x6')](util['format'](_0x058d('0x7'),_0x45f98d[_0x058d('0x8')],_0x45f98d['channel'],_0x45f98d['type'],_0x45f98d[_0x058d('0x9')],_0x45f98d[_0x058d('0xa')],_0x45f98d[_0x058d('0xb')],_0x45f98d['callerid'],_0x45f98d[_0x058d('0xc')]));if(_0x45f98d[_0x058d('0x9')]){utils[_0x058d('0xd')](_0x45f98d[_0x058d('0x9')])[_0x058d('0xe')](function(_0x521606){if(_0x521606){_0x45f98d['UserId']=_0x521606['id'];}utils['request']('CreateVoiceCallReport',_0x45f98d);});}else{utils[_0x058d('0xf')](_0x058d('0x10'),_0x45f98d);}if(channels[_0x45f98d['uniqueid']]){delete channels[_0x45f98d['uniqueid']];}}exports[_0x058d('0x11')]=function(_0x4d4cc1){try{if(_0x4d4cc1[_0x058d('0x8')]==_0x4d4cc1[_0x058d('0x12')]&&_0x4d4cc1[_0x058d('0x13')]!=_0x058d('0x14')){channels[_0x4d4cc1[_0x058d('0x8')]]={'uniqueid':_0x4d4cc1['uniqueid'],'accountcode':_0x4d4cc1[_0x058d('0x9')],'source':_0x4d4cc1['calleridnum'],'destination':_0x4d4cc1[_0x058d('0x15')],'destinationcontext':_0x4d4cc1[_0x058d('0x16')],'channel':_0x4d4cc1[_0x058d('0x13')],'starttime':utils[_0x058d('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x9b5446){utils['error'](_0x9b5446['stack']);}};exports[_0x058d('0x18')]=function(_0xf144d8){try{if(!_[_0x058d('0x19')](channels[_0xf144d8['uniqueid']])&&_0xf144d8[_0x058d('0x1a')]==0x6){if(_[_0x058d('0x19')](channels[_0xf144d8[_0x058d('0x8')]][_0x058d('0x1b')])){channels[_0xf144d8[_0x058d('0x8')]][_0x058d('0x1b')]=utils[_0x058d('0x17')]();}}else if(!_[_0x058d('0x19')](channels[_0xf144d8['linkedid']])&&_0xf144d8[_0x058d('0x1a')]==0x6&&_0xf144d8[_0x058d('0x16')]!=_0x058d('0x1c')){channels[_0xf144d8[_0x058d('0x12')]]['accountcode']=_0xf144d8['accountcode'];channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1d')]=_0xf144d8[_0x058d('0x13')];if(_[_0x058d('0x19')](channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1e')])){channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1e')]=utils['now']();}channels[_0xf144d8['linkedid']][_0x058d('0xc')]=dispositions[_[_0x058d('0x1f')](_0xf144d8[_0x058d('0x1a')])]||_0x058d('0x20');}}catch(_0x2ee776){utils['error'](_0x2ee776[_0x058d('0x21')]);}};exports[_0x058d('0x22')]=function(_0x5a7d86){try{if(!_[_0x058d('0x19')](channels[_0x5a7d86[_0x058d('0x8')]])){if(_['isNil'](channels[_0x5a7d86[_0x058d('0x8')]]['callerid'])){channels[_0x5a7d86[_0x058d('0x8')]]['callerid']=_0x5a7d86[_0x058d('0x23')]+'\x20<'+_0x5a7d86[_0x058d('0x24')]+'>';}channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')]=utils['now']();channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x26')]=utils[_0x058d('0x27')](channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')],channels[_0x5a7d86['uniqueid']]['starttime']);channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x28')]=channels[_0x5a7d86['uniqueid']]['answertime']?utils['diffTime'](channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')],channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x1e')]):0x0;writeDB(channels[_0x5a7d86[_0x058d('0x8')]]);}}catch(_0x4070eb){utils[_0x058d('0x29')](_0x4070eb[_0x058d('0x21')]);}};exports[_0x058d('0x2a')]=function(_0x135d09){try{if(!_[_0x058d('0x19')](channels[_0x135d09[_0x058d('0x2b')]])){if(channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x13')]==_0x135d09['transfereechannel']){channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x1d')]=_0x135d09[_0x058d('0x2c')];channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x2d')]=_0x058d('0x2e');}else if(channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x13')]=_0x135d09[_0x058d('0x2f')]){channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x1d')]=_0x135d09['origtransfererchannel'];channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x2d')]=_0x058d('0x2e');}}}catch(_0x256d7a){utils[_0x058d('0x29')](_0x256d7a[_0x058d('0x21')]);}};exports['musiconholdstart']=function(_0x1dd4d8){try{if(!_[_0x058d('0x19')](channels[_0x1dd4d8[_0x058d('0x8')]])){channels[_0x1dd4d8[_0x058d('0x8')]][_0x058d('0x30')]=utils[_0x058d('0x17')]();}}catch(_0x2aa9d8){utils['error'](_0x2aa9d8[_0x058d('0x21')]);}};exports[_0x058d('0x31')]=function(_0x482a87){try{if(!_[_0x058d('0x19')](channels[_0x482a87[_0x058d('0x8')]])){if(!_[_0x058d('0x19')](channels[_0x482a87['uniqueid']][_0x058d('0x30')])){channels[_0x482a87['uniqueid']][_0x058d('0x32')]+=utils['diffTime'](utils[_0x058d('0x17')](),channels[_0x482a87[_0x058d('0x8')]][_0x058d('0x30')]);delete channels[_0x482a87['uniqueid']][_0x058d('0x30')];}}}catch(_0x4fc23c){utils[_0x058d('0x29')](_0x4fc23c[_0x058d('0x21')]);}};exports[_0x058d('0x33')]=function(_0x1ca3ea){try{if(!_[_0x058d('0x19')](channels[_0x1ca3ea[_0x058d('0x8')]])){if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-originatecalleridnum'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0xa')]=_0x1ca3ea['value'];}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x35')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0xb')]=_0x1ca3ea[_0x058d('0x36')];channels[_0x1ca3ea['uniqueid']][_0x058d('0x37')]='\x22'+_0x1ca3ea[_0x058d('0x36')]+_0x058d('0x38')+_0x1ca3ea[_0x058d('0x36')]+'>';}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x39')])||!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-callerid'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x37')]=_0x1ca3ea[_0x058d('0x36')];}if(!_['isNil'](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x3a')])||!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x3b')])){channels[_0x1ca3ea['uniqueid']][_0x058d('0x3c')]=_0x058d('0x3d');channels[_0x1ca3ea[_0x058d('0x8')]]['lastdata']=_0x1ca3ea[_0x058d('0x36')];channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x3e')]=!![];}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-contactid'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x3f')]=_0x1ca3ea[_0x058d('0x36')];}if(!_[_0x058d('0x19')](_0x1ca3ea['variable'][_0x058d('0x40')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x41')]=_0x1ca3ea[_0x058d('0x36')];}if(!_[_0x058d('0x19')](_0x1ca3ea['variable'][_0x058d('0x42')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x43')]=_0x1ca3ea[_0x058d('0x36')];}if(!_['isNil'](_0x1ca3ea['variable'][_0x058d('0x44')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x44')]=_0x1ca3ea['value'];}}}catch(_0x15b1b9){utils['error'](_0x15b1b9[_0x058d('0x21')]);}};exports[_0x058d('0x45')]=function(_0x336fea){try{if(!_[_0x058d('0x19')](channels[_0x336fea['uniqueid']])){if(_0x336fea['application']['toLowerCase']()==_0x058d('0x46')&&_[_0x058d('0x47')](_0x336fea[_0x058d('0x48')]['toLowerCase'](),_0x058d('0x49'))){var _0x30210d=_0x336fea[_0x058d('0x48')][_0x058d('0x4a')]('=');var _0x55fb3f=_0x30210d[0x0][_0x058d('0x4b')](_0x30210d[0x0][_0x058d('0x4c')]('(')+0x1,_0x30210d[0x0][_0x058d('0x4c')](')'));var _0x4a1082=_0x30210d[0x1];channels[_0x336fea[_0x058d('0x8')]][_0x55fb3f]=_0x4a1082;}if(!_['includes'](['hangup',_0x058d('0x4d'),_0x058d('0x4e'),'set','gotoif'],_0x336fea[_0x058d('0x4f')][_0x058d('0x50')]())){channels[_0x336fea[_0x058d('0x8')]][_0x058d('0x3c')]=_0x336fea['application'];channels[_0x336fea[_0x058d('0x8')]][_0x058d('0x51')]=_0x336fea[_0x058d('0x48')];}}}catch(_0x3b384c){utils['error'](_0x3b384c['stack']);}}; \ No newline at end of file +var _0x3ab2=['value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','execif','gotoif','lastapplication','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','uniqueid','channel','type','source','destination','callerid','disposition','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','transfer','answertime','toNumber','hangup','calleridname','endtime','diffTime','starttime','billableseconds','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','varset','variable'];(function(_0x5d5671,_0x521066){var _0x33d23a=function(_0x52801a){while(--_0x52801a){_0x5d5671['push'](_0x5d5671['shift']());}};_0x33d23a(++_0x521066);}(_0x3ab2,0x6c));var _0x23ab=function(_0x37b7c5,_0x56e0d3){_0x37b7c5=_0x37b7c5-0x0;var _0x54ef29=_0x3ab2[_0x37b7c5];return _0x54ef29;};'use strict';var _=require(_0x23ab('0x0'));var util=require(_0x23ab('0x1'));var utils=require('./utils');var dispositions=[_0x23ab('0x2'),_0x23ab('0x3'),'FAILED',_0x23ab('0x2'),_0x23ab('0x2'),_0x23ab('0x2'),_0x23ab('0x4'),_0x23ab('0x5'),_0x23ab('0x3'),_0x23ab('0x3'),_0x23ab('0x3')];var channels={};function writeDB(_0x4421f3){utils[_0x23ab('0x6')](util[_0x23ab('0x7')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x4421f3[_0x23ab('0x8')],_0x4421f3[_0x23ab('0x9')],_0x4421f3[_0x23ab('0xa')],_0x4421f3['accountcode'],_0x4421f3[_0x23ab('0xb')],_0x4421f3[_0x23ab('0xc')],_0x4421f3[_0x23ab('0xd')],_0x4421f3[_0x23ab('0xe')]));if(_0x4421f3[_0x23ab('0xf')]){utils['getUserByInternal'](_0x4421f3[_0x23ab('0xf')])[_0x23ab('0x10')](function(_0x303fed){if(_0x303fed){_0x4421f3[_0x23ab('0x11')]=_0x303fed['id'];}utils[_0x23ab('0x12')](_0x23ab('0x13'),_0x4421f3);});}else{utils[_0x23ab('0x12')](_0x23ab('0x13'),_0x4421f3);}if(channels[_0x4421f3['uniqueid']]){delete channels[_0x4421f3['uniqueid']];}}exports[_0x23ab('0x14')]=function(_0x436964){try{if(_0x436964[_0x23ab('0x8')]==_0x436964[_0x23ab('0x15')]&&_0x436964[_0x23ab('0x9')]!=_0x23ab('0x16')){channels[_0x436964[_0x23ab('0x8')]]={'uniqueid':_0x436964[_0x23ab('0x8')],'accountcode':_0x436964[_0x23ab('0xf')],'source':_0x436964[_0x23ab('0x17')],'destination':_0x436964[_0x23ab('0x18')],'destinationcontext':_0x436964['context'],'channel':_0x436964[_0x23ab('0x9')],'starttime':utils[_0x23ab('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x23ab('0x1a')};}}catch(_0x4bf64c){utils[_0x23ab('0x1b')](_0x4bf64c[_0x23ab('0x1c')]);}};exports[_0x23ab('0x1d')]=function(_0x477aa5){try{if(!_[_0x23ab('0x1e')](channels[_0x477aa5[_0x23ab('0x8')]])&&_0x477aa5[_0x23ab('0x1f')]==0x6){if(_[_0x23ab('0x1e')](channels[_0x477aa5[_0x23ab('0x8')]][_0x23ab('0x20')])){channels[_0x477aa5[_0x23ab('0x8')]][_0x23ab('0x20')]=utils[_0x23ab('0x19')]();}}else if(!_[_0x23ab('0x1e')](channels[_0x477aa5[_0x23ab('0x15')]])&&_0x477aa5['channelstate']==0x6&&_0x477aa5['context']!=_0x23ab('0x21')){channels[_0x477aa5[_0x23ab('0x15')]][_0x23ab('0xf')]=_0x477aa5[_0x23ab('0xf')];channels[_0x477aa5['linkedid']]['destinationchannel']=_0x477aa5[_0x23ab('0x9')];if(_[_0x23ab('0x1e')](channels[_0x477aa5[_0x23ab('0x15')]][_0x23ab('0x22')])){channels[_0x477aa5[_0x23ab('0x15')]][_0x23ab('0x22')]=utils[_0x23ab('0x19')]();}channels[_0x477aa5[_0x23ab('0x15')]][_0x23ab('0xe')]=dispositions[_[_0x23ab('0x23')](_0x477aa5[_0x23ab('0x1f')])]||'ANSWERED';}}catch(_0x4763e8){utils[_0x23ab('0x1b')](_0x4763e8[_0x23ab('0x1c')]);}};exports[_0x23ab('0x24')]=function(_0x5d8d97){try{if(!_['isNil'](channels[_0x5d8d97[_0x23ab('0x8')]])){if(_[_0x23ab('0x1e')](channels[_0x5d8d97[_0x23ab('0x8')]][_0x23ab('0xd')])){channels[_0x5d8d97[_0x23ab('0x8')]][_0x23ab('0xd')]=_0x5d8d97[_0x23ab('0x25')]+'\x20<'+_0x5d8d97[_0x23ab('0x17')]+'>';}channels[_0x5d8d97[_0x23ab('0x8')]][_0x23ab('0x26')]=utils[_0x23ab('0x19')]();channels[_0x5d8d97[_0x23ab('0x8')]]['duration']=utils[_0x23ab('0x27')](channels[_0x5d8d97['uniqueid']][_0x23ab('0x26')],channels[_0x5d8d97['uniqueid']][_0x23ab('0x28')]);channels[_0x5d8d97['uniqueid']][_0x23ab('0x29')]=channels[_0x5d8d97[_0x23ab('0x8')]][_0x23ab('0x22')]?utils[_0x23ab('0x27')](channels[_0x5d8d97['uniqueid']][_0x23ab('0x26')],channels[_0x5d8d97[_0x23ab('0x8')]]['answertime']):0x0;writeDB(channels[_0x5d8d97[_0x23ab('0x8')]]);}}catch(_0x88b43d){utils[_0x23ab('0x1b')](_0x88b43d[_0x23ab('0x1c')]);}};exports['attendedtransfer']=function(_0x2ce4b8){try{if(!_['isNil'](channels[_0x2ce4b8['localtwolinkedid']])){if(channels[_0x2ce4b8[_0x23ab('0x2a')]][_0x23ab('0x9')]==_0x2ce4b8[_0x23ab('0x2b')]){channels[_0x2ce4b8[_0x23ab('0x2a')]]['destinationchannel']=_0x2ce4b8[_0x23ab('0x2c')];channels[_0x2ce4b8['localtwolinkedid']][_0x23ab('0x2d')]=_0x23ab('0x2e');}else if(channels[_0x2ce4b8[_0x23ab('0x2a')]][_0x23ab('0x9')]=_0x2ce4b8[_0x23ab('0x2f')]){channels[_0x2ce4b8[_0x23ab('0x2a')]]['destinationchannel']=_0x2ce4b8[_0x23ab('0x30')];channels[_0x2ce4b8[_0x23ab('0x2a')]][_0x23ab('0x2d')]='_attended';}}}catch(_0x5e4ad7){utils[_0x23ab('0x1b')](_0x5e4ad7[_0x23ab('0x1c')]);}};exports[_0x23ab('0x31')]=function(_0x30817c){try{if(!_[_0x23ab('0x1e')](channels[_0x30817c['uniqueid']])){channels[_0x30817c[_0x23ab('0x8')]][_0x23ab('0x32')]=utils[_0x23ab('0x19')]();}}catch(_0x1d6beb){utils[_0x23ab('0x1b')](_0x1d6beb[_0x23ab('0x1c')]);}};exports[_0x23ab('0x33')]=function(_0xec82a2){try{if(!_[_0x23ab('0x1e')](channels[_0xec82a2[_0x23ab('0x8')]])){if(!_[_0x23ab('0x1e')](channels[_0xec82a2[_0x23ab('0x8')]]['musiconholdstartAt'])){channels[_0xec82a2[_0x23ab('0x8')]]['mohtime']+=utils[_0x23ab('0x27')](utils['now'](),channels[_0xec82a2[_0x23ab('0x8')]]['musiconholdstartAt']);delete channels[_0xec82a2[_0x23ab('0x8')]]['musiconholdstartAt'];}}}catch(_0x5edb59){utils[_0x23ab('0x1b')](_0x5edb59[_0x23ab('0x1c')]);}};exports[_0x23ab('0x34')]=function(_0x5646fd){try{if(!_['isNil'](channels[_0x5646fd[_0x23ab('0x8')]])){if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')]['xmd-originatecalleridnum'])){channels[_0x5646fd['uniqueid']][_0x23ab('0xb')]=_0x5646fd[_0x23ab('0x36')];}if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x37')])){channels[_0x5646fd[_0x23ab('0x8')]][_0x23ab('0xc')]=_0x5646fd[_0x23ab('0x36')];channels[_0x5646fd[_0x23ab('0x8')]]['callerid']='\x22'+_0x5646fd[_0x23ab('0x36')]+_0x23ab('0x38')+_0x5646fd[_0x23ab('0x36')]+'>';}if(!_['isNil'](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x39')])||!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x3a')])){channels[_0x5646fd[_0x23ab('0x8')]]['callerid']=_0x5646fd[_0x23ab('0x36')];}if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x3b')])||!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')]['xmcs-queue'])){channels[_0x5646fd[_0x23ab('0x8')]]['lastapplication']=_0x23ab('0x3c');channels[_0x5646fd[_0x23ab('0x8')]][_0x23ab('0x3d')]=_0x5646fd[_0x23ab('0x36')];channels[_0x5646fd['uniqueid']][_0x23ab('0x3e')]=!![];}if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x3f')])){channels[_0x5646fd[_0x23ab('0x8')]][_0x23ab('0x40')]=_0x5646fd[_0x23ab('0x36')];}if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')][_0x23ab('0x41')])){channels[_0x5646fd[_0x23ab('0x8')]][_0x23ab('0xa')]=_0x5646fd[_0x23ab('0x36')];}if(!_[_0x23ab('0x1e')](_0x5646fd[_0x23ab('0x35')]['outboundrouteid'])){channels[_0x5646fd[_0x23ab('0x8')]]['routeid']=_0x5646fd[_0x23ab('0x36')];}if(!_[_0x23ab('0x1e')](_0x5646fd['variable'][_0x23ab('0x42')])){channels[_0x5646fd[_0x23ab('0x8')]][_0x23ab('0x42')]=_0x5646fd['value'];}}}catch(_0x12b6ec){utils[_0x23ab('0x1b')](_0x12b6ec[_0x23ab('0x1c')]);}};exports[_0x23ab('0x43')]=function(_0x3ead97){try{if(!_[_0x23ab('0x1e')](channels[_0x3ead97[_0x23ab('0x8')]])){if(_0x3ead97[_0x23ab('0x44')][_0x23ab('0x45')]()==_0x23ab('0x46')&&_[_0x23ab('0x47')](_0x3ead97[_0x23ab('0x48')]['toLowerCase'](),_0x23ab('0x49'))){var _0x419212=_0x3ead97[_0x23ab('0x48')][_0x23ab('0x4a')]('=');var _0x4109a6=_0x419212[0x0][_0x23ab('0x4b')](_0x419212[0x0][_0x23ab('0x4c')]('(')+0x1,_0x419212[0x0]['lastIndexOf'](')'));var _0x39a882=_0x419212[0x1];channels[_0x3ead97[_0x23ab('0x8')]][_0x4109a6]=_0x39a882;}if(!_[_0x23ab('0x4d')]([_0x23ab('0x24'),'noop',_0x23ab('0x4e'),_0x23ab('0x46'),_0x23ab('0x4f')],_0x3ead97[_0x23ab('0x44')][_0x23ab('0x45')]())){channels[_0x3ead97[_0x23ab('0x8')]][_0x23ab('0x50')]=_0x3ead97[_0x23ab('0x44')];channels[_0x3ead97[_0x23ab('0x8')]][_0x23ab('0x3d')]=_0x3ead97['appdata'];}}}catch(_0x29a71c){utils[_0x23ab('0x1b')](_0x29a71c['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 546229b..8ff7c42 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 _0x24ca=['FULLYBOOTED','error','CLOSE','managerevent','./utils','info','shutdown','SHUTDOWN'];(function(_0x3e5b00,_0x11648d){var _0x4c81d3=function(_0x1d0ada){while(--_0x1d0ada){_0x3e5b00['push'](_0x3e5b00['shift']());}};_0x4c81d3(++_0x11648d);}(_0x24ca,0x8c));var _0xa24c=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x24ca[_0x256e32];return _0x464070;};'use strict';var utils=require(_0xa24c('0x0'));var _=require('lodash');exports['connect']=function(){utils[_0xa24c('0x1')]('CONNECTED');};exports[_0xa24c('0x2')]=function(){utils[_0xa24c('0x1')](_0xa24c('0x3'));};exports['fullybooted']=function(){utils[_0xa24c('0x1')](_0xa24c('0x4'));};exports[_0xa24c('0x5')]=function(_0x5a37ae){utils['error'](_0x5a37ae);};exports['close']=function(){utils[_0xa24c('0x1')](_0xa24c('0x6'));};exports[_0xa24c('0x7')]=function(_0x3c3959){}; \ No newline at end of file +var _0xdbf5=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','lodash','CONNECTED','shutdown','info'];(function(_0x29af0e,_0x35f669){var _0x349e39=function(_0x251fba){while(--_0x251fba){_0x29af0e['push'](_0x29af0e['shift']());}};_0x349e39(++_0x35f669);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xae28d7,_0x461528){_0xae28d7=_0xae28d7-0x0;var _0x409f73=_0xdbf5[_0xae28d7];return _0x409f73;};'use strict';var utils=require('./utils');var _=require(_0x5dbf('0x0'));exports['connect']=function(){utils['info'](_0x5dbf('0x1'));};exports[_0x5dbf('0x2')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x4'));};exports[_0x5dbf('0x5')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x6'));};exports[_0x5dbf('0x7')]=function(_0x3f8628){utils[_0x5dbf('0x7')](_0x3f8628);};exports[_0x5dbf('0x8')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x9'));};exports['managerevent']=function(_0x134810){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 33d7e97..f3ded53 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 _0xe82b=['dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','appdata','cdr(routeid)','stack','isNil','outboundrouteid','value','error','dialbegin','assign','now','lastevent','dialend','ANSWER','answertime','hangup','complete','duration','diffTime','endtime','starttime','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel'];(function(_0x427fd4,_0x2248d1){var _0x4361ff=function(_0x43969d){while(--_0x43969d){_0x427fd4['push'](_0x427fd4['shift']());}};_0x4361ff(++_0x2248d1);}(_0xe82b,0xfc));var _0xbe82=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe82b[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var utils=require(_0xbe82('0x2'));var dials={};function writeDB(_0x492ad3){utils[_0xbe82('0x3')](util['format'](_0xbe82('0x4'),_0x492ad3[_0xbe82('0x5')],_0x492ad3[_0xbe82('0x6')],_0x492ad3[_0xbe82('0x7')],_0x492ad3[_0xbe82('0x8')],_0x492ad3[_0xbe82('0x9')],_0x492ad3[_0xbe82('0xa')]));utils[_0xbe82('0xb')](_0xbe82('0xc'),_0x492ad3);delete dials[_0x492ad3['uniqueid']];}exports[_0xbe82('0xd')]=function(_0x139da8){try{if(_0x139da8[_0xbe82('0xe')][_0xbe82('0xf')]()==_0xbe82('0x10')&&_['startsWith'](_0x139da8[_0xbe82('0x11')][_0xbe82('0xf')](),_0xbe82('0x12'))){var _0x3a2635=_0x139da8[_0xbe82('0x11')]['split']('=');dials[_0x139da8['uniqueid']]={'routeId':_0x3a2635[0x1]};}}catch(_0xc62762){utils['error'](_0xc62762[_0xbe82('0x13')]);}};exports['varset']=function(_0x2338c0){try{if(!_[_0xbe82('0x14')](_0x2338c0['variable'][_0xbe82('0x15')])){dials[_0x2338c0[_0xbe82('0x5')]]={'routeId':_0x2338c0[_0xbe82('0x16')]};}}catch(_0x4cc840){utils[_0xbe82('0x17')](_0x4cc840[_0xbe82('0x13')]);}};exports[_0xbe82('0x18')]=function(_0x33ca4a){try{if(!_['isNil'](dials[_0x33ca4a['uniqueid']])){dials[_0x33ca4a[_0xbe82('0x5')]]=_[_0xbe82('0x19')](dials[_0x33ca4a[_0xbe82('0x5')]],_0x33ca4a);dials[_0x33ca4a[_0xbe82('0x5')]]['starttime']=utils[_0xbe82('0x1a')]();dials[_0x33ca4a[_0xbe82('0x5')]][_0xbe82('0x1b')]='called';}}catch(_0x583385){utils[_0xbe82('0x17')](_0x583385[_0xbe82('0x13')]);}};exports[_0xbe82('0x1c')]=function(_0x43491b){try{if(!_[_0xbe82('0x14')](dials[_0x43491b[_0xbe82('0x5')]])){dials[_0x43491b['uniqueid']][_0xbe82('0xa')]=_0x43491b[_0xbe82('0xa')];if(_0x43491b['dialstatus']==_0xbe82('0x1d')){dials[_0x43491b[_0xbe82('0x5')]]=_['assign'](dials[_0x43491b[_0xbe82('0x5')]],_0x43491b);dials[_0x43491b[_0xbe82('0x5')]][_0xbe82('0x1e')]=utils['now']();dials[_0x43491b[_0xbe82('0x5')]][_0xbe82('0x1b')]='connect';}}}catch(_0x94f861){utils[_0xbe82('0x17')](_0x94f861[_0xbe82('0x13')]);}};exports[_0xbe82('0x1f')]=function(_0x2d94f0){try{if(!_['isNil'](dials[_0x2d94f0['uniqueid']])){dials[_0x2d94f0[_0xbe82('0x5')]]=_[_0xbe82('0x19')](dials[_0x2d94f0['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xbe82('0x20')});dials[_0x2d94f0['uniqueid']][_0xbe82('0x21')]=utils[_0xbe82('0x22')](dials[_0x2d94f0['uniqueid']][_0xbe82('0x23')],dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x24')]);dials[_0x2d94f0[_0xbe82('0x5')]]['holdtime']=utils['diffTime'](dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x1e')]||dials[_0x2d94f0[_0xbe82('0x5')]]['endtime'],dials[_0x2d94f0['uniqueid']]['starttime']);dials[_0x2d94f0[_0xbe82('0x5')]]['billableseconds']=dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x1e')]?utils[_0xbe82('0x22')](dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x23')],dials[_0x2d94f0['uniqueid']][_0xbe82('0x1e')]):0x0;writeDB(dials[_0x2d94f0[_0xbe82('0x5')]]);}}catch(_0x3b7eb6){utils['error'](_0x3b7eb6[_0xbe82('0x13')]);}}; \ No newline at end of file +var _0x9468=['hangup','complete','duration','diffTime','endtime','answertime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','request','uniqueid','application','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','value','stack','dialbegin','assign','now','lastevent','called','dialstatus','ANSWER','connect'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x9468,0x1e7));var _0x8946=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x9468[_0x1678c8];return _0x387aa9;};'use strict';var _=require(_0x8946('0x0'));var util=require(_0x8946('0x1'));var utils=require(_0x8946('0x2'));var dials={};function writeDB(_0x15ec89){utils[_0x8946('0x3')](util[_0x8946('0x4')](_0x8946('0x5'),_0x15ec89['uniqueid'],_0x15ec89[_0x8946('0x6')],_0x15ec89[_0x8946('0x7')],_0x15ec89[_0x8946('0x8')],_0x15ec89[_0x8946('0x9')],_0x15ec89['dialstatus']));utils[_0x8946('0xa')]('CreateVoiceDialReport',_0x15ec89);delete dials[_0x15ec89[_0x8946('0xb')]];}exports['newexten']=function(_0x4483b2){try{if(_0x4483b2[_0x8946('0xc')][_0x8946('0xd')]()=='set'&&_[_0x8946('0xe')](_0x4483b2[_0x8946('0xf')][_0x8946('0xd')](),_0x8946('0x10'))){var _0xcd59f4=_0x4483b2[_0x8946('0xf')][_0x8946('0x11')]('=');dials[_0x4483b2[_0x8946('0xb')]]={'routeId':_0xcd59f4[0x1]};}}catch(_0x454bd4){utils[_0x8946('0x12')](_0x454bd4['stack']);}};exports[_0x8946('0x13')]=function(_0x5cc286){try{if(!_[_0x8946('0x14')](_0x5cc286[_0x8946('0x15')][_0x8946('0x16')])){dials[_0x5cc286[_0x8946('0xb')]]={'routeId':_0x5cc286[_0x8946('0x17')]};}}catch(_0x2579d6){utils[_0x8946('0x12')](_0x2579d6[_0x8946('0x18')]);}};exports[_0x8946('0x19')]=function(_0x381e74){try{if(!_[_0x8946('0x14')](dials[_0x381e74[_0x8946('0xb')]])){dials[_0x381e74[_0x8946('0xb')]]=_[_0x8946('0x1a')](dials[_0x381e74[_0x8946('0xb')]],_0x381e74);dials[_0x381e74[_0x8946('0xb')]]['starttime']=utils[_0x8946('0x1b')]();dials[_0x381e74[_0x8946('0xb')]][_0x8946('0x1c')]=_0x8946('0x1d');}}catch(_0x405d39){utils[_0x8946('0x12')](_0x405d39[_0x8946('0x18')]);}};exports['dialend']=function(_0x4c232e){try{if(!_[_0x8946('0x14')](dials[_0x4c232e[_0x8946('0xb')]])){dials[_0x4c232e[_0x8946('0xb')]][_0x8946('0x1e')]=_0x4c232e['dialstatus'];if(_0x4c232e[_0x8946('0x1e')]==_0x8946('0x1f')){dials[_0x4c232e[_0x8946('0xb')]]=_['assign'](dials[_0x4c232e['uniqueid']],_0x4c232e);dials[_0x4c232e[_0x8946('0xb')]]['answertime']=utils[_0x8946('0x1b')]();dials[_0x4c232e[_0x8946('0xb')]][_0x8946('0x1c')]=_0x8946('0x20');}}}catch(_0x3b7022){utils[_0x8946('0x12')](_0x3b7022[_0x8946('0x18')]);}};exports[_0x8946('0x21')]=function(_0x165903){try{if(!_[_0x8946('0x14')](dials[_0x165903['uniqueid']])){dials[_0x165903[_0x8946('0xb')]]=_[_0x8946('0x1a')](dials[_0x165903['uniqueid']],{'endtime':utils[_0x8946('0x1b')](),'lastevent':_0x8946('0x22')});dials[_0x165903[_0x8946('0xb')]][_0x8946('0x23')]=utils[_0x8946('0x24')](dials[_0x165903[_0x8946('0xb')]][_0x8946('0x25')],dials[_0x165903[_0x8946('0xb')]]['starttime']);dials[_0x165903[_0x8946('0xb')]]['holdtime']=utils[_0x8946('0x24')](dials[_0x165903[_0x8946('0xb')]][_0x8946('0x26')]||dials[_0x165903[_0x8946('0xb')]]['endtime'],dials[_0x165903[_0x8946('0xb')]]['starttime']);dials[_0x165903['uniqueid']][_0x8946('0x27')]=dials[_0x165903[_0x8946('0xb')]][_0x8946('0x26')]?utils[_0x8946('0x24')](dials[_0x165903[_0x8946('0xb')]][_0x8946('0x25')],dials[_0x165903[_0x8946('0xb')]][_0x8946('0x26')]):0x0;writeDB(dials[_0x165903[_0x8946('0xb')]]);}}catch(_0x176368){utils['error'](_0x176368['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 4b2afd0..61f2653 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 _0x2589=['username','password','xdr','info','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port'];(function(_0x397027,_0x5c02d4){var _0x3d2682=function(_0xa7b034){while(--_0xa7b034){_0x397027['push'](_0x397027['shift']());}};_0x3d2682(++_0x5c02d4);}(_0x2589,0xc3));var _0x9258=function(_0x258c7f,_0x5142ee){_0x258c7f=_0x258c7f-0x0;var _0x441272=_0x2589[_0x258c7f];return _0x441272;};var AsteriskManager=require(_0x9258('0x0'));var config=require(_0x9258('0x1'));var utils=require(_0x9258('0x2'));var ami=new AsteriskManager(config[_0x9258('0x3')][_0x9258('0x4')],config[_0x9258('0x3')]['ip'],config[_0x9258('0x3')][_0x9258('0x5')],config[_0x9258('0x3')][_0x9258('0x6')],!![]);ami['keepConnected']();if(config[_0x9258('0x7')]&&config[_0x9258('0x7')]['disabled']){utils[_0x9258('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require(_0x9258('0x9'));var queues=require(_0x9258('0xa'));var recordings=require(_0x9258('0xb'));var members=require('./members.controller');var dials=require(_0x9258('0xc'));var transfers=require(_0x9258('0xd'));var core=require(_0x9258('0xe'));ami['on']('connect',core[_0x9258('0xf')]);ami['on'](_0x9258('0x10'),core['shutdown']);ami['on']('fullybooted',core[_0x9258('0x11')]);ami['on']('error',core[_0x9258('0x12')]);ami['on'](_0x9258('0x13'),core[_0x9258('0x13')]);ami['on'](_0x9258('0x14'),core[_0x9258('0x14')]);ami['on'](_0x9258('0x15'),function(_0x49360a){try{members[_0x9258('0x15')](_0x49360a);}catch(_0x4234a4){utils['error'](_0x4234a4);}});ami['on'](_0x9258('0x16'),function(_0x3439ce){try{agents[_0x9258('0x16')](_0x3439ce);}catch(_0x1afa8){utils[_0x9258('0x12')](_0x1afa8);}});ami['on']('agentringnoanswer',function(_0x4ace96){try{agents['agentringnoanswer'](_0x4ace96);}catch(_0xe60aae){utils[_0x9258('0x12')](_0xe60aae);}});ami['on'](_0x9258('0x17'),function(_0x56173e){try{agents[_0x9258('0x17')](_0x56173e);queues[_0x9258('0x17')](_0x56173e);}catch(_0xca4d7d){utils[_0x9258('0x12')](_0xca4d7d);}});ami['on'](_0x9258('0x18'),function(_0x39c9a5){try{agents[_0x9258('0x18')](_0x39c9a5);queues[_0x9258('0x18')](_0x39c9a5);members[_0x9258('0x18')](_0x39c9a5);}catch(_0x1c811e){utils[_0x9258('0x12')](_0x1c811e);}});ami['on'](_0x9258('0x19'),function(_0x45b700){try{agents['queuecallerabandon'](_0x45b700);queues[_0x9258('0x19')](_0x45b700);}catch(_0x207b3e){utils[_0x9258('0x12')](_0x207b3e);}});ami['on']('queuecallerjoin',function(_0x17514e){try{queues[_0x9258('0x1a')](_0x17514e);recordings[_0x9258('0x1a')](_0x17514e);}catch(_0xaeb0c9){utils['error'](_0xaeb0c9);}});ami['on'](_0x9258('0x1b'),function(_0x52f2df){try{queues[_0x9258('0x1b')](_0x52f2df);}catch(_0x56983f){utils[_0x9258('0x12')](_0x56983f);}});ami['on'](_0x9258('0x1c'),function(_0x140b12){try{queues['musiconholdstart'](_0x140b12);calls[_0x9258('0x1c')](_0x140b12);}catch(_0x224222){utils[_0x9258('0x12')](_0x224222);}});ami['on'](_0x9258('0x1d'),function(_0x46891f){try{queues[_0x9258('0x1d')](_0x46891f);calls[_0x9258('0x1d')](_0x46891f);}catch(_0x2d1203){utils[_0x9258('0x12')](_0x2d1203);}});ami['on'](_0x9258('0x1e'),function(_0x3d3422){try{calls[_0x9258('0x1e')](_0x3d3422);recordings[_0x9258('0x1e')](_0x3d3422);}catch(_0x190eee){utils[_0x9258('0x12')](_0x190eee);}});ami['on']('hangup',function(_0x13ad49){try{calls[_0x9258('0x1f')](_0x13ad49);recordings[_0x9258('0x1f')](_0x13ad49);dials[_0x9258('0x1f')](_0x13ad49);agents[_0x9258('0x1f')](_0x13ad49);queues['hangup'](_0x13ad49);}catch(_0x4e1c8e){utils[_0x9258('0x12')](_0x4e1c8e);}});ami['on'](_0x9258('0x20'),function(_0x155662){try{members[_0x9258('0x20')](_0x155662);}catch(_0x59ce9e){utils[_0x9258('0x12')](_0x59ce9e);}});ami['on'](_0x9258('0x21'),function(_0x5cc0dd){try{queues[_0x9258('0x21')](_0x5cc0dd);agents['blindtransfer'](_0x5cc0dd);transfers[_0x9258('0x21')](_0x5cc0dd);}catch(_0x11a0bb){utils[_0x9258('0x12')](_0x11a0bb);}});ami['on']('attendedtransfer',function(_0x7f63b2){try{queues[_0x9258('0x22')](_0x7f63b2);transfers[_0x9258('0x22')](_0x7f63b2);agents[_0x9258('0x22')](_0x7f63b2);calls['attendedtransfer'](_0x7f63b2);}catch(_0xa0f691){utils[_0x9258('0x12')](_0xa0f691);}});ami['on'](_0x9258('0x23'),function(_0x21d04b){try{queues['varset'](_0x21d04b);recordings['varset'](_0x21d04b);calls['varset'](_0x21d04b);dials[_0x9258('0x23')](_0x21d04b);}catch(_0x563d5c){utils[_0x9258('0x12')](_0x563d5c);}});ami['on'](_0x9258('0x24'),function(_0x966859){try{calls[_0x9258('0x24')](_0x966859);recordings[_0x9258('0x24')](_0x966859);dials[_0x9258('0x24')](_0x966859);}catch(_0x4b3f45){utils[_0x9258('0x12')](_0x4b3f45);}});ami['on']('newchannel',function(_0x363e7a){try{calls[_0x9258('0x25')](_0x363e7a);recordings[_0x9258('0x25')](_0x363e7a);}catch(_0x3c6962){utils[_0x9258('0x12')](_0x3c6962);}});ami['on'](_0x9258('0x26'),function(_0x11b0d7){try{dials[_0x9258('0x26')](_0x11b0d7);}catch(_0x437af6){utils[_0x9258('0x12')](_0x437af6);}});ami['on'](_0x9258('0x27'),function(_0x424509){try{dials['dialend'](_0x424509);}catch(_0x584dfe){utils[_0x9258('0x12')](_0x584dfe);}});} \ No newline at end of file +var _0xbd99=['./recordings.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller'];(function(_0x2e0854,_0x52544a){var _0x4d0ff9=function(_0x3647fb){while(--_0x3647fb){_0x2e0854['push'](_0x2e0854['shift']());}};_0x4d0ff9(++_0x52544a);}(_0xbd99,0x1df));var _0x9bd9=function(_0x16df28,_0x23d408){_0x16df28=_0x16df28-0x0;var _0x1a904c=_0xbd99[_0x16df28];return _0x1a904c;};var AsteriskManager=require(_0x9bd9('0x0'));var config=require(_0x9bd9('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x9bd9('0x2')][_0x9bd9('0x3')],config['asterisk']['ip'],config[_0x9bd9('0x2')][_0x9bd9('0x4')],config[_0x9bd9('0x2')][_0x9bd9('0x5')],!![]);ami[_0x9bd9('0x6')]();if(config[_0x9bd9('0x7')]&&config[_0x9bd9('0x7')]['disabled']){utils[_0x9bd9('0x8')](_0x9bd9('0x9'));}else{var agents=require(_0x9bd9('0xa'));var calls=require(_0x9bd9('0xb'));var queues=require(_0x9bd9('0xc'));var recordings=require(_0x9bd9('0xd'));var members=require('./members.controller');var dials=require(_0x9bd9('0xe'));var transfers=require('./transfers.controller');var core=require(_0x9bd9('0xf'));ami['on'](_0x9bd9('0x10'),core[_0x9bd9('0x10')]);ami['on'](_0x9bd9('0x11'),core[_0x9bd9('0x11')]);ami['on'](_0x9bd9('0x12'),core[_0x9bd9('0x12')]);ami['on']('error',core[_0x9bd9('0x13')]);ami['on']('close',core['close']);ami['on'](_0x9bd9('0x14'),core['managerevent']);ami['on'](_0x9bd9('0x15'),function(_0x2893ea){try{members[_0x9bd9('0x15')](_0x2893ea);}catch(_0x5198f0){utils[_0x9bd9('0x13')](_0x5198f0);}});ami['on']('agentcalled',function(_0xc28b0d){try{agents[_0x9bd9('0x16')](_0xc28b0d);}catch(_0x4bab02){utils[_0x9bd9('0x13')](_0x4bab02);}});ami['on'](_0x9bd9('0x17'),function(_0x36ceaa){try{agents[_0x9bd9('0x17')](_0x36ceaa);}catch(_0x49f9fe){utils['error'](_0x49f9fe);}});ami['on'](_0x9bd9('0x18'),function(_0x221d94){try{agents[_0x9bd9('0x18')](_0x221d94);queues[_0x9bd9('0x18')](_0x221d94);}catch(_0x3cba37){utils[_0x9bd9('0x13')](_0x3cba37);}});ami['on'](_0x9bd9('0x19'),function(_0x4296aa){try{agents[_0x9bd9('0x19')](_0x4296aa);queues[_0x9bd9('0x19')](_0x4296aa);members['agentcomplete'](_0x4296aa);}catch(_0x2ae130){utils[_0x9bd9('0x13')](_0x2ae130);}});ami['on'](_0x9bd9('0x1a'),function(_0x1820e3){try{agents[_0x9bd9('0x1a')](_0x1820e3);queues[_0x9bd9('0x1a')](_0x1820e3);}catch(_0x4ae7ef){utils['error'](_0x4ae7ef);}});ami['on']('queuecallerjoin',function(_0x4f05dc){try{queues[_0x9bd9('0x1b')](_0x4f05dc);recordings[_0x9bd9('0x1b')](_0x4f05dc);}catch(_0x2bb4df){utils[_0x9bd9('0x13')](_0x2bb4df);}});ami['on'](_0x9bd9('0x1c'),function(_0x50fd9e){try{queues[_0x9bd9('0x1c')](_0x50fd9e);}catch(_0x4b6bec){utils[_0x9bd9('0x13')](_0x4b6bec);}});ami['on']('musiconholdstart',function(_0x2a06e9){try{queues[_0x9bd9('0x1d')](_0x2a06e9);calls['musiconholdstart'](_0x2a06e9);}catch(_0x31340d){utils[_0x9bd9('0x13')](_0x31340d);}});ami['on'](_0x9bd9('0x1e'),function(_0x1fbb40){try{queues[_0x9bd9('0x1e')](_0x1fbb40);calls[_0x9bd9('0x1e')](_0x1fbb40);}catch(_0x48cd59){utils[_0x9bd9('0x13')](_0x48cd59);}});ami['on'](_0x9bd9('0x1f'),function(_0x52880d){try{calls[_0x9bd9('0x1f')](_0x52880d);recordings[_0x9bd9('0x1f')](_0x52880d);}catch(_0x16bbcf){utils['error'](_0x16bbcf);}});ami['on']('hangup',function(_0x52e4b7){try{calls[_0x9bd9('0x20')](_0x52e4b7);recordings[_0x9bd9('0x20')](_0x52e4b7);dials[_0x9bd9('0x20')](_0x52e4b7);agents[_0x9bd9('0x20')](_0x52e4b7);queues[_0x9bd9('0x20')](_0x52e4b7);}catch(_0x29a10c){utils['error'](_0x29a10c);}});ami['on'](_0x9bd9('0x21'),function(_0x3e311c){try{members[_0x9bd9('0x21')](_0x3e311c);}catch(_0x125f67){utils[_0x9bd9('0x13')](_0x125f67);}});ami['on'](_0x9bd9('0x22'),function(_0x407499){try{queues['blindtransfer'](_0x407499);agents['blindtransfer'](_0x407499);transfers[_0x9bd9('0x22')](_0x407499);}catch(_0x4ec29b){utils['error'](_0x4ec29b);}});ami['on']('attendedtransfer',function(_0x324da3){try{queues[_0x9bd9('0x23')](_0x324da3);transfers['attendedtransfer'](_0x324da3);agents['attendedtransfer'](_0x324da3);calls[_0x9bd9('0x23')](_0x324da3);}catch(_0x2a4094){utils['error'](_0x2a4094);}});ami['on']('varset',function(_0x5caa95){try{queues[_0x9bd9('0x24')](_0x5caa95);recordings['varset'](_0x5caa95);calls['varset'](_0x5caa95);dials[_0x9bd9('0x24')](_0x5caa95);}catch(_0x48d734){utils['error'](_0x48d734);}});ami['on'](_0x9bd9('0x25'),function(_0x193086){try{calls[_0x9bd9('0x25')](_0x193086);recordings[_0x9bd9('0x25')](_0x193086);dials[_0x9bd9('0x25')](_0x193086);}catch(_0x55c40f){utils['error'](_0x55c40f);}});ami['on'](_0x9bd9('0x26'),function(_0x2b72c1){try{calls[_0x9bd9('0x26')](_0x2b72c1);recordings[_0x9bd9('0x26')](_0x2b72c1);}catch(_0x12b8bd){utils[_0x9bd9('0x13')](_0x12b8bd);}});ami['on'](_0x9bd9('0x27'),function(_0x69f496){try{dials[_0x9bd9('0x27')](_0x69f496);}catch(_0x1211db){utils[_0x9bd9('0x13')](_0x1211db);}});ami['on'](_0x9bd9('0x28'),function(_0x31bf2f){try{dials[_0x9bd9('0x28')](_0x31bf2f);}catch(_0x10dc61){utils[_0x9bd9('0x13')](_0x10dc61);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b258ce3..3d3aeae 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 _0xfe7c=['diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','source','data3','destination','destinationchannel','lodash','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','data2','type','interface','membername','name','request','CreateMemberReport','getUserByName','split','then','internal','catch','error','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xfe7c,0x1cd));var _0xcfe7=function(_0x36e8d6,_0x142639){_0x36e8d6=_0x36e8d6-0x0;var _0x347069=_0xfe7c[_0x36e8d6];return _0x347069;};'use strict';var _=require(_0xcfe7('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xcfe7('0x1'),_0xcfe7('0x2')];function writeDB(_0x410fcc){utils[_0xcfe7('0x3')](util[_0xcfe7('0x4')](_0xcfe7('0x5'),_0x410fcc[_0xcfe7('0x6')],_0x410fcc['interface'],_0x410fcc[_0xcfe7('0x7')],_0x410fcc[_0xcfe7('0x8')],_0x410fcc['membername'],_0x410fcc[_0xcfe7('0x9')]));if(_0x410fcc[_0xcfe7('0xa')]){utils['getUserByInterface'](_0x410fcc[_0xcfe7('0xa')])['then'](function(_0x4e61fd){if(_0x4e61fd){_0x410fcc[_0xcfe7('0xb')]=_0x4e61fd[_0xcfe7('0xc')];_0x410fcc['internal']=_0x4e61fd['internal'];utils[_0xcfe7('0xd')](_0xcfe7('0xe'),_0x410fcc);}else{utils[_0xcfe7('0xf')](_0x410fcc[_0xcfe7('0xa')][_0xcfe7('0x10')]('/')[0x1])[_0xcfe7('0x11')](function(_0x43c9c1){if(_0x43c9c1){_0x410fcc[_0xcfe7('0xb')]=_0x43c9c1[_0xcfe7('0xc')];_0x410fcc[_0xcfe7('0x12')]=_0x43c9c1[_0xcfe7('0x12')];utils[_0xcfe7('0xd')](_0xcfe7('0xe'),_0x410fcc);}});}})[_0xcfe7('0x13')](function(_0x14beb3){utils[_0xcfe7('0x14')](_0x14beb3);});}delete members[_0x410fcc['interface']];}function startsWith(_0x4e7c08,_0x42f6b8){return _['some'](_0x4e7c08,function(_0x15e217){return _[_0xcfe7('0x15')](_0x42f6b8,_0x15e217);});}exports[_0xcfe7('0x16')]=function(_0xcc760){switch(_0xcc760[_0xcfe7('0x17')]){case'INUSE':case _0xcfe7('0x18'):if(!startsWith(exclude,_0xcc760[_0xcfe7('0x19')])){members[_0xcc760[_0xcfe7('0x19')]]={'channel':_0xcfe7('0x1a'),'interface':_0xcc760[_0xcfe7('0x19')],'type':_0xcfe7('0x1b'),'enterAt':utils[_0xcfe7('0x1c')](),'role':_0xcfe7('0x1d')};}break;case _0xcfe7('0x1e'):if(!_[_0xcfe7('0x1f')](members[_0xcc760[_0xcfe7('0x19')]])){members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x20')]=utils['now']();members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x21')]=utils[_0xcfe7('0x22')](members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x20')],members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x23')]);if(members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x6')]){writeDB(members[_0xcc760['device']]);}}default:break;}};exports[_0xcfe7('0x24')]=function(_0x402c51){if(!_['isNil'](members[_0x402c51['interface']])){members[_0x402c51['interface']]=_[_0xcfe7('0x25')](members[_0x402c51[_0xcfe7('0xa')]],{'data4':_0x402c51[_0xcfe7('0x26')],'uniqueid':_0x402c51[_0xcfe7('0x6')]});}};exports[_0xcfe7('0x27')]=function(_0x3c739d){if(_0x3c739d[_0xcfe7('0x7')]){var _0x541fed=_0x3c739d[_0xcfe7('0x7')][_0xcfe7('0x10')]('-')[0x0];if(!_['isNil'](members[_0x541fed])){members[_0x541fed]=_[_0xcfe7('0x25')](members[_0x541fed],{'data1':members[_0x541fed][_0xcfe7('0x28')]||_0x3c739d[_0xcfe7('0x9')],'data2':members[_0x541fed][_0xcfe7('0x8')]||_0x3c739d[_0xcfe7('0x29')],'data3':members[_0x541fed][_0xcfe7('0x2a')]||_0x3c739d[_0xcfe7('0x2b')],'uniqueid':members[_0x541fed][_0xcfe7('0x6')]||_0x3c739d['uniqueid']});if(members[_0x541fed]['exitAt']){writeDB(members[_0x541fed]);}}}if(_0x3c739d[_0xcfe7('0x2c')]){var _0x10cef0=_0x3c739d[_0xcfe7('0x2c')][_0xcfe7('0x10')]('-')[0x0];if(!_[_0xcfe7('0x1f')](members[_0x10cef0])){members[_0x10cef0]=_[_0xcfe7('0x25')](members[_0x10cef0],{'data1':members[_0x10cef0][_0xcfe7('0x28')]||_0x3c739d[_0xcfe7('0x9')],'data2':members[_0x10cef0][_0xcfe7('0x8')]||_0x3c739d['source'],'data3':members[_0x10cef0][_0xcfe7('0x2a')]||_0x3c739d['destination'],'uniqueid':members[_0x10cef0]['uniqueid']||_0x3c739d['uniqueid']});if(members[_0x10cef0]['exitAt']){writeDB(members[_0x10cef0]);}}}}; \ No newline at end of file +var _0xeb62=['name','CreateMemberReport','catch','devicestatechange','state','device','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','assign','queue','cdr','channel','data1','data2','destination','destinationchannel','data3','util','./utils','Queue:','info','format','uniqueid','interface','membername','type','getUserByInterface','then','internal','request','getUserByName','split'];(function(_0xccc0d4,_0x2f6bf7){var _0x27a653=function(_0x285e63){while(--_0x285e63){_0xccc0d4['push'](_0xccc0d4['shift']());}};_0x27a653(++_0x2f6bf7);}(_0xeb62,0x19e));var _0x2eb6=function(_0x2d2677,_0x5cf9f1){_0x2d2677=_0x2d2677-0x0;var _0x35d758=_0xeb62[_0x2d2677];return _0x35d758;};'use strict';var _=require('lodash');var util=require(_0x2eb6('0x0'));var utils=require(_0x2eb6('0x1'));var members={};var exclude=['Local/_attended@transfer',_0x2eb6('0x2')];function writeDB(_0x3cdfe6){utils[_0x2eb6('0x3')](util[_0x2eb6('0x4')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x3cdfe6[_0x2eb6('0x5')],_0x3cdfe6[_0x2eb6('0x6')],_0x3cdfe6['channel'],_0x3cdfe6['data2'],_0x3cdfe6[_0x2eb6('0x7')],_0x3cdfe6[_0x2eb6('0x8')]));if(_0x3cdfe6[_0x2eb6('0x6')]){utils[_0x2eb6('0x9')](_0x3cdfe6[_0x2eb6('0x6')])[_0x2eb6('0xa')](function(_0x2e6f09){if(_0x2e6f09){_0x3cdfe6['membername']=_0x2e6f09['name'];_0x3cdfe6[_0x2eb6('0xb')]=_0x2e6f09[_0x2eb6('0xb')];utils[_0x2eb6('0xc')]('CreateMemberReport',_0x3cdfe6);}else{utils[_0x2eb6('0xd')](_0x3cdfe6[_0x2eb6('0x6')][_0x2eb6('0xe')]('/')[0x1])['then'](function(_0x362c93){if(_0x362c93){_0x3cdfe6[_0x2eb6('0x7')]=_0x362c93[_0x2eb6('0xf')];_0x3cdfe6[_0x2eb6('0xb')]=_0x362c93[_0x2eb6('0xb')];utils[_0x2eb6('0xc')](_0x2eb6('0x10'),_0x3cdfe6);}});}})[_0x2eb6('0x11')](function(_0x2e5c8e){utils['error'](_0x2e5c8e);});}delete members[_0x3cdfe6[_0x2eb6('0x6')]];}function startsWith(_0x338789,_0x959b51){return _['some'](_0x338789,function(_0x4dd05a){return _['startsWith'](_0x959b51,_0x4dd05a);});}exports[_0x2eb6('0x12')]=function(_0x11fb95){switch(_0x11fb95[_0x2eb6('0x13')]){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x11fb95[_0x2eb6('0x14')])){members[_0x11fb95[_0x2eb6('0x14')]]={'channel':'voice','interface':_0x11fb95[_0x2eb6('0x14')],'type':'TALKING','enterAt':utils[_0x2eb6('0x15')](),'role':_0x2eb6('0x16')};}break;case _0x2eb6('0x17'):if(!_['isNil'](members[_0x11fb95[_0x2eb6('0x14')]])){members[_0x11fb95[_0x2eb6('0x14')]][_0x2eb6('0x18')]=utils[_0x2eb6('0x15')]();members[_0x11fb95[_0x2eb6('0x14')]][_0x2eb6('0x19')]=utils[_0x2eb6('0x1a')](members[_0x11fb95['device']][_0x2eb6('0x18')],members[_0x11fb95[_0x2eb6('0x14')]][_0x2eb6('0x1b')]);if(members[_0x11fb95[_0x2eb6('0x14')]][_0x2eb6('0x5')]){writeDB(members[_0x11fb95['device']]);}}default:break;}};exports[_0x2eb6('0x1c')]=function(_0x40b02c){if(!_[_0x2eb6('0x1d')](members[_0x40b02c[_0x2eb6('0x6')]])){members[_0x40b02c['interface']]=_[_0x2eb6('0x1e')](members[_0x40b02c[_0x2eb6('0x6')]],{'data4':_0x40b02c[_0x2eb6('0x1f')],'uniqueid':_0x40b02c[_0x2eb6('0x5')]});}};exports[_0x2eb6('0x20')]=function(_0x146069){if(_0x146069[_0x2eb6('0x21')]){var _0x47a1a9=_0x146069[_0x2eb6('0x21')]['split']('-')[0x0];if(!_[_0x2eb6('0x1d')](members[_0x47a1a9])){members[_0x47a1a9]=_['assign'](members[_0x47a1a9],{'data1':members[_0x47a1a9][_0x2eb6('0x22')]||_0x146069[_0x2eb6('0x8')],'data2':members[_0x47a1a9][_0x2eb6('0x23')]||_0x146069['source'],'data3':members[_0x47a1a9]['data3']||_0x146069[_0x2eb6('0x24')],'uniqueid':members[_0x47a1a9][_0x2eb6('0x5')]||_0x146069[_0x2eb6('0x5')]});if(members[_0x47a1a9][_0x2eb6('0x18')]){writeDB(members[_0x47a1a9]);}}}if(_0x146069[_0x2eb6('0x25')]){var _0x3f40e5=_0x146069['destinationchannel'][_0x2eb6('0xe')]('-')[0x0];if(!_['isNil'](members[_0x3f40e5])){members[_0x3f40e5]=_[_0x2eb6('0x1e')](members[_0x3f40e5],{'data1':members[_0x3f40e5]['data1']||_0x146069[_0x2eb6('0x8')],'data2':members[_0x3f40e5][_0x2eb6('0x23')]||_0x146069['source'],'data3':members[_0x3f40e5][_0x2eb6('0x26')]||_0x146069['destination'],'uniqueid':members[_0x3f40e5][_0x2eb6('0x5')]||_0x146069[_0x2eb6('0x5')]});if(members[_0x3f40e5][_0x2eb6('0x18')]){writeDB(members[_0x3f40e5]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 962338a..1025525 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 _0xe04a=['accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','queuestatus','queuecallerexitAt','value','variable','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','membername','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfertype','BLIND','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','lastAssignedTo','calleridnum'];(function(_0x103d83,_0x31d755){var _0x2a0ecd=function(_0xf30445){while(--_0xf30445){_0x103d83['push'](_0x103d83['shift']());}};_0x2a0ecd(++_0x31d755);}(_0xe04a,0xef));var _0xae04=function(_0x1b17e4,_0x3493e4){_0x1b17e4=_0x1b17e4-0x0;var _0x4e26b8=_0xe04a[_0x1b17e4];return _0x4e26b8;};'use strict';var _=require(_0xae04('0x0'));var util=require(_0xae04('0x1'));var utils=require(_0xae04('0x2'));var queues={};function writeDB(_0x37a138){utils[_0xae04('0x3')](util[_0xae04('0x4')](_0xae04('0x5'),_0x37a138[_0xae04('0x6')],_0x37a138['channel'],_0x37a138[_0xae04('0x7')],_0x37a138[_0xae04('0x8')],_0x37a138[_0xae04('0x9')],_0x37a138[_0xae04('0xa')],_0x37a138[_0xae04('0xb')]));if(_0x37a138['queue']){utils[_0xae04('0xc')](_0x37a138[_0xae04('0x7')])[_0xae04('0xd')](function(_0x1849f3){if(_0x1849f3){_0x37a138['type']=_0x1849f3[_0xae04('0xe')];}utils[_0xae04('0xf')](_0xae04('0x10'),_0x37a138);});}else{utils[_0xae04('0xf')](_0xae04('0x10'),_0x37a138);}if(_0x37a138[_0xae04('0x11')]){delete queues[_0x37a138[_0xae04('0x11')]];}else{delete queues[_0x37a138['uniqueid']];}}exports[_0xae04('0x12')]=function(_0x330fcb){queues[_0x330fcb[_0xae04('0x6')]]=_['assign'](_0x330fcb,{'originalposition':_0x330fcb[_0xae04('0x13')],'queuecallerjoinAt':utils[_0xae04('0x14')](),'mohtime':0x0});};exports[_0xae04('0x15')]=function(_0x7f46fc){if(!_[_0xae04('0x16')](queues[_0x7f46fc[_0xae04('0x6')]])){if(queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x17')]){if(!queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x18')]&&!queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x19')]){queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x1a')]=!![];queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x1b')]=utils['now']();queues[_0x7f46fc['uniqueid']]['queuecallerexitreason']=_0xae04('0x1c');}writeDB(queues[_0x7f46fc[_0xae04('0x6')]]);}else{if(queues[_0x7f46fc['uniqueid']][_0xae04('0x11')]){queues[queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x11')]]=queues[_0x7f46fc['uniqueid']];queues[queues[_0x7f46fc['uniqueid']]['transfereduniqueid']][_0xae04('0x1d')]=0x2;delete queues[_0x7f46fc['uniqueid']];}}}};exports[_0xae04('0x1e')]=function(_0x51aded){if(!_['isNil'](_0x51aded['variable'][_0xae04('0x1f')])){if(!_['isNil'](queues[_0x51aded[_0xae04('0x6')]])){queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x51aded[_0xae04('0x6')]]['queuecallerabandonAt']=null;queues[_0x51aded[_0xae04('0x6')]]['queuecallerexit']=!![];queues[_0x51aded['uniqueid']][_0xae04('0x20')]=utils[_0xae04('0x14')]();queues[_0x51aded['uniqueid']]['queuecallerexitreason']=_0x51aded[_0xae04('0x21')]['toUpperCase']();writeDB(queues[_0x51aded['uniqueid']]);}}else if(!_['isNil'](_0x51aded[_0xae04('0x22')][_0xae04('0x23')])){if(!_[_0xae04('0x16')](queues[_0x51aded[_0xae04('0x6')]])&&!queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]){queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x51aded['uniqueid']][_0xae04('0x24')]=null;queues[_0x51aded['uniqueid']][_0xae04('0x19')]=!![];queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x20')]=utils[_0xae04('0x14')]();queues[_0x51aded[_0xae04('0x6')]]['queuecallerexitreason']=_0xae04('0x25');}}};exports[_0xae04('0x18')]=function(_0xe4011a){if(!_[_0xae04('0x16')](queues[_0xe4011a[_0xae04('0x6')]])){queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x18')]=!![];queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x24')]=utils[_0xae04('0x14')]();queues[_0xe4011a['uniqueid']][_0xae04('0xb')]=_0xae04('0x26');}};exports[_0xae04('0x27')]=function(_0x5cebf1){if(!_['isNil'](queues[_0x5cebf1['uniqueid']])){queues[_0x5cebf1[_0xae04('0x6')]]['queuecallerleave']=!![];queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x17')]=utils[_0xae04('0x14')]();queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x28')]=utils[_0xae04('0x29')](queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x17')],queues[_0x5cebf1['uniqueid']]['queuecallerjoinAt']);queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x13')]=_0x5cebf1[_0xae04('0x13')];queues[_0x5cebf1[_0xae04('0x6')]]['count']=_0x5cebf1[_0xae04('0x2a')];queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x2b')]=_0x5cebf1['connectedlinenum'];queues[_0x5cebf1['uniqueid']][_0xae04('0x2c')]=_0x5cebf1[_0xae04('0x2c')];}};exports[_0xae04('0x2d')]=function(_0x27e3b9){if(!_[_0xae04('0x16')](queues[_0x27e3b9[_0xae04('0x6')]])){queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x24')]=null;queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x2e')]=!![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0xa')]=_0x27e3b9[_0xae04('0x2f')];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x8')]=_0x27e3b9['membername'];}};exports[_0xae04('0x30')]=function(_0x545659){if(!_[_0xae04('0x16')](queues[_0x545659[_0xae04('0x6')]])){if(queues[_0x545659['uniqueid']][_0xae04('0x17')]){queues[_0x545659[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x24')]=null;queues[_0x545659[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0x545659[_0xae04('0x6')]][_0xae04('0x2e')]=!![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x8')]=_0x545659[_0xae04('0x31')];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x1a')]=!![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x1b')]=utils['now']();if(_0x545659[_0xae04('0x32')]==_0xae04('0x33')){if(!queues[_0x545659[_0xae04('0x6')]][_0xae04('0x33')]){queues[_0x545659[_0xae04('0x6')]][_0xae04('0xb')]=_0xae04('0x34');}}else{queues[_0x545659['uniqueid']][_0xae04('0xb')]=_0xae04('0x35')+_0x545659[_0xae04('0x32')]['toUpperCase']();}writeDB(queues[_0x545659[_0xae04('0x6')]]);}}};exports[_0xae04('0x36')]=function(_0xa332c4){if(!_[_0xae04('0x16')](queues[_0xa332c4['transfereeuniqueid']])){queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x33')]=!![];queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x37')]=_0xae04('0x38');queues[_0xa332c4[_0xae04('0x39')]][_0xae04('0x3a')]=_0xa332c4[_0xae04('0x3b')];queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x3c')]=_0xa332c4[_0xae04('0x39')];queues[_0xa332c4[_0xae04('0x39')]]['queuecallerexitreason']=_0xae04('0x3d');}};exports[_0xae04('0x3e')]=function(_0x1dc48c){try{if(_0x1dc48c[_0xae04('0x3f')]==_0x1dc48c[_0xae04('0x40')]){if(!_[_0xae04('0x16')](queues[_0x1dc48c['secondtransfererlinkedid']])){queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0x33')]=!![];queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x37')]=_0xae04('0x42');queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x3a')]=_0x1dc48c[_0xae04('0x43')];queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x3c')]=_0x1dc48c[_0xae04('0x3f')];queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0xb')]=_0xae04('0x44');}if(!_[_0xae04('0x16')](queues[_0x1dc48c[_0xae04('0x40')]])){if(_0x1dc48c[_0xae04('0x45')]&&queues[_0x1dc48c[_0xae04('0x45')]]){queues[_0x1dc48c[_0xae04('0x45')]][_0xae04('0x1d')]=0x1;queues[_0x1dc48c[_0xae04('0x39')]]=_[_0xae04('0x46')](queues[_0x1dc48c[_0xae04('0x45')]]);queues[_0x1dc48c[_0xae04('0x39')]]['transfereduniqueid']=_0x1dc48c[_0xae04('0x47')];queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x1d')]=0x2;queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x9')]=queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0x9')];queues[_0x1dc48c['transfereeuniqueid']][_0xae04('0x48')]=queues[_0x1dc48c['secondtransfererlinkedid']]['calleridname'];queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x49')]=utils[_0xae04('0x14')]();queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x17')]=utils[_0xae04('0x14')]();queues[_0x1dc48c['transfereeuniqueid']][_0xae04('0x28')]=0x0;queues[_0x1dc48c['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0x1dc48c[_0xae04('0x40')]]['transfereduniqueid']=_0x1dc48c['secondtransfererlinkedid'];}}}else if(_0x1dc48c[_0xae04('0x4a')]==_0x1dc48c['secondtransfererlinkedid']){if(!_[_0xae04('0x16')](queues[_0x1dc48c[_0xae04('0x40')]])){queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x33')]=!![];queues[_0x1dc48c[_0xae04('0x40')]]['transfertype']=_0xae04('0x42');queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x3a')]=_0x1dc48c[_0xae04('0x4b')];queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x3c')]=_0x1dc48c[_0xae04('0x4a')];queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xae04('0x16')](queues[_0x1dc48c['secondtransfererlinkedid']])){if(_0x1dc48c[_0xae04('0x4c')]&&queues[_0x1dc48c[_0xae04('0x4c')]]){queues[_0x1dc48c['transfertargetlinkedid']][_0xae04('0x1d')]=0x1;queues[_0x1dc48c['transfertargetuniqueid']]=_[_0xae04('0x46')](queues[_0x1dc48c['transfertargetlinkedid']]);queues[_0x1dc48c['transfertargetuniqueid']]['transfereduniqueid']=_0x1dc48c['transfertargetuniqueid'];queues[_0x1dc48c[_0xae04('0x47')]]['queuecallerenterreason']=0x2;queues[_0x1dc48c['transfertargetuniqueid']][_0xae04('0x9')]=queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x9')];queues[_0x1dc48c['transfertargetuniqueid']][_0xae04('0x48')]=queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x48')];queues[_0x1dc48c[_0xae04('0x47')]][_0xae04('0x49')]=utils['now']();queues[_0x1dc48c['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xae04('0x14')]();queues[_0x1dc48c[_0xae04('0x47')]][_0xae04('0x28')]=0x0;queues[_0x1dc48c[_0xae04('0x47')]]['mohtime']=0x0;}else{queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x11')]=_0x1dc48c['origtransfererlinkedid'];}}}}catch(_0x2252a3){utils[_0xae04('0x4d')](_0x2252a3[_0xae04('0x4e')]);}};exports[_0xae04('0x4f')]=function(_0x1c4993){if(!_['isNil'](queues[_0x1c4993[_0xae04('0x6')]])){queues[_0x1c4993[_0xae04('0x6')]][_0xae04('0x50')]=utils[_0xae04('0x14')]();}};exports[_0xae04('0x51')]=function(_0x441bbe){if(!_[_0xae04('0x16')](queues[_0x441bbe[_0xae04('0x6')]])){if(!_[_0xae04('0x16')](queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')])){queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x52')]+=utils['diffTime'](utils[_0xae04('0x14')](),queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')]);delete queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')];}}}; \ No newline at end of file +var _0x3868=['origtransfereruniqueid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','transfertargetlinkedid','queuecallerjoinAt','stack','musiconholdstartAt','musiconholdstop','lodash','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','queuestatus','queuecallerabandon','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','queuecallerabandonAt','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','membername','agentcomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3868,0x18e));var _0x8386=function(_0x2e4546,_0x304b74){_0x2e4546=_0x2e4546-0x0;var _0x5a57c6=_0x3868[_0x2e4546];return _0x5a57c6;};'use strict';var _=require(_0x8386('0x0'));var util=require('util');var utils=require(_0x8386('0x1'));var queues={};function writeDB(_0x7f02c0){utils[_0x8386('0x2')](util['format'](_0x8386('0x3'),_0x7f02c0[_0x8386('0x4')],_0x7f02c0[_0x8386('0x5')],_0x7f02c0['queue'],_0x7f02c0[_0x8386('0x6')],_0x7f02c0[_0x8386('0x7')],_0x7f02c0['accountcode'],_0x7f02c0[_0x8386('0x8')]));if(_0x7f02c0[_0x8386('0x9')]){utils['getVoiceQueueByName'](_0x7f02c0[_0x8386('0x9')])[_0x8386('0xa')](function(_0x4e0b71){if(_0x4e0b71){_0x7f02c0['type']=_0x4e0b71[_0x8386('0xb')];}utils['request'](_0x8386('0xc'),_0x7f02c0);});}else{utils[_0x8386('0xd')](_0x8386('0xc'),_0x7f02c0);}if(_0x7f02c0[_0x8386('0xe')]){delete queues[_0x7f02c0[_0x8386('0xe')]];}else{delete queues[_0x7f02c0[_0x8386('0x4')]];}}exports[_0x8386('0xf')]=function(_0x51ee1d){queues[_0x51ee1d[_0x8386('0x4')]]=_[_0x8386('0x10')](_0x51ee1d,{'originalposition':_0x51ee1d[_0x8386('0x11')],'queuecallerjoinAt':utils[_0x8386('0x12')](),'mohtime':0x0});};exports[_0x8386('0x13')]=function(_0x32ac5d){if(!_[_0x8386('0x14')](queues[_0x32ac5d[_0x8386('0x4')]])){if(queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0x15')]){if(!queues[_0x32ac5d['uniqueid']]['queuecallerabandon']&&!queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0x16')]){queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0x17')]=!![];queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0x18')]=utils[_0x8386('0x12')]();queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0x8')]=_0x8386('0x19');}writeDB(queues[_0x32ac5d['uniqueid']]);}else{if(queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0xe')]){queues[queues[_0x32ac5d[_0x8386('0x4')]][_0x8386('0xe')]]=queues[_0x32ac5d[_0x8386('0x4')]];queues[queues[_0x32ac5d[_0x8386('0x4')]]['transfereduniqueid']][_0x8386('0x1a')]=0x2;delete queues[_0x32ac5d['uniqueid']];}}}};exports[_0x8386('0x1b')]=function(_0x2080f3){if(!_[_0x8386('0x14')](_0x2080f3['variable'][_0x8386('0x1c')])){if(!_['isNil'](queues[_0x2080f3['uniqueid']])){queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x1d')]=![];queues[_0x2080f3[_0x8386('0x4')]]['queuecallerabandonAt']=null;queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x16')]=!![];queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x1e')]=utils['now']();queues[_0x2080f3[_0x8386('0x4')]]['queuecallerexitreason']=_0x2080f3['value'][_0x8386('0x1f')]();writeDB(queues[_0x2080f3[_0x8386('0x4')]]);}}else if(!_['isNil'](_0x2080f3['variable'][_0x8386('0x20')])){if(!_[_0x8386('0x14')](queues[_0x2080f3[_0x8386('0x4')]])&&!queues[_0x2080f3[_0x8386('0x4')]]['queuecallerabandon']){queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x1d')]=![];queues[_0x2080f3[_0x8386('0x4')]]['queuecallerabandonAt']=null;queues[_0x2080f3['uniqueid']][_0x8386('0x16')]=!![];queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x1e')]=utils[_0x8386('0x12')]();queues[_0x2080f3[_0x8386('0x4')]][_0x8386('0x8')]=_0x8386('0x21');}}};exports[_0x8386('0x1d')]=function(_0x59c0e7){if(!_[_0x8386('0x14')](queues[_0x59c0e7[_0x8386('0x4')]])){queues[_0x59c0e7[_0x8386('0x4')]][_0x8386('0x16')]=![];queues[_0x59c0e7[_0x8386('0x4')]][_0x8386('0x1e')]=null;queues[_0x59c0e7[_0x8386('0x4')]][_0x8386('0x1d')]=!![];queues[_0x59c0e7[_0x8386('0x4')]][_0x8386('0x22')]=utils['now']();queues[_0x59c0e7[_0x8386('0x4')]][_0x8386('0x8')]=_0x8386('0x23');}};exports[_0x8386('0x24')]=function(_0x350fe6){if(!_['isNil'](queues[_0x350fe6[_0x8386('0x4')]])){queues[_0x350fe6[_0x8386('0x4')]]['queuecallerleave']=!![];queues[_0x350fe6[_0x8386('0x4')]][_0x8386('0x15')]=utils['now']();queues[_0x350fe6[_0x8386('0x4')]][_0x8386('0x25')]=utils[_0x8386('0x26')](queues[_0x350fe6[_0x8386('0x4')]][_0x8386('0x15')],queues[_0x350fe6[_0x8386('0x4')]]['queuecallerjoinAt']);queues[_0x350fe6[_0x8386('0x4')]]['position']=_0x350fe6[_0x8386('0x11')];queues[_0x350fe6[_0x8386('0x4')]][_0x8386('0x27')]=_0x350fe6[_0x8386('0x27')];queues[_0x350fe6['uniqueid']]['connectedlinenum']=_0x350fe6[_0x8386('0x28')];queues[_0x350fe6[_0x8386('0x4')]][_0x8386('0x29')]=_0x350fe6[_0x8386('0x29')];}};exports[_0x8386('0x2a')]=function(_0x310729){if(!_[_0x8386('0x14')](queues[_0x310729[_0x8386('0x4')]])){queues[_0x310729[_0x8386('0x4')]][_0x8386('0x1d')]=![];queues[_0x310729['uniqueid']][_0x8386('0x1d')]=![];queues[_0x310729[_0x8386('0x4')]][_0x8386('0x22')]=null;queues[_0x310729['uniqueid']][_0x8386('0x16')]=![];queues[_0x310729['uniqueid']][_0x8386('0x1e')]=null;queues[_0x310729[_0x8386('0x4')]][_0x8386('0x2b')]=!![];queues[_0x310729['uniqueid']][_0x8386('0x2c')]=_0x310729['destaccountcode'];queues[_0x310729[_0x8386('0x4')]][_0x8386('0x6')]=_0x310729[_0x8386('0x2d')];}};exports[_0x8386('0x2e')]=function(_0x3f6751){if(!_[_0x8386('0x14')](queues[_0x3f6751[_0x8386('0x4')]])){if(queues[_0x3f6751['uniqueid']][_0x8386('0x15')]){queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x1d')]=![];queues[_0x3f6751['uniqueid']]['queuecallerabandon']=![];queues[_0x3f6751['uniqueid']][_0x8386('0x22')]=null;queues[_0x3f6751['uniqueid']][_0x8386('0x16')]=![];queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x1e')]=null;queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x2b')]=!![];queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x6')]=_0x3f6751[_0x8386('0x2d')];queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x17')]=!![];queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x18')]=utils[_0x8386('0x12')]();if(_0x3f6751[_0x8386('0x2f')]==_0x8386('0x30')){if(!queues[_0x3f6751[_0x8386('0x4')]][_0x8386('0x30')]){queues[_0x3f6751[_0x8386('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x3f6751[_0x8386('0x4')]]['queuecallerexitreason']=_0x8386('0x31')+_0x3f6751['reason'][_0x8386('0x1f')]();}writeDB(queues[_0x3f6751[_0x8386('0x4')]]);}}};exports[_0x8386('0x32')]=function(_0x4d1f22){if(!_['isNil'](queues[_0x4d1f22[_0x8386('0x33')]])){queues[_0x4d1f22['transfereeuniqueid']]['transfer']=!![];queues[_0x4d1f22['transfereeuniqueid']][_0x8386('0x34')]=_0x8386('0x35');queues[_0x4d1f22[_0x8386('0x33')]]['transferexten']=_0x4d1f22[_0x8386('0x36')];queues[_0x4d1f22[_0x8386('0x33')]][_0x8386('0x37')]=_0x4d1f22['transfereeuniqueid'];queues[_0x4d1f22['transfereeuniqueid']][_0x8386('0x8')]=_0x8386('0x38');}};exports[_0x8386('0x39')]=function(_0x9c25e1){try{if(_0x9c25e1[_0x8386('0x3a')]==_0x9c25e1['origtransfererlinkedid']){if(!_[_0x8386('0x14')](queues[_0x9c25e1[_0x8386('0x3b')]])){queues[_0x9c25e1['secondtransfererlinkedid']][_0x8386('0x30')]=!![];queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0x34')]=_0x8386('0x3c');queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0x3d')]=_0x9c25e1[_0x8386('0x3e')];queues[_0x9c25e1[_0x8386('0x3b')]]['transferuniqueid']=_0x9c25e1[_0x8386('0x3a')];queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0x8')]=_0x8386('0x3f');}if(!_[_0x8386('0x14')](queues[_0x9c25e1[_0x8386('0x40')]])){if(_0x9c25e1['transfereelinkedid']&&queues[_0x9c25e1[_0x8386('0x41')]]){queues[_0x9c25e1[_0x8386('0x41')]][_0x8386('0x1a')]=0x1;queues[_0x9c25e1[_0x8386('0x33')]]=_[_0x8386('0x42')](queues[_0x9c25e1[_0x8386('0x41')]]);queues[_0x9c25e1[_0x8386('0x33')]][_0x8386('0xe')]=_0x9c25e1[_0x8386('0x43')];queues[_0x9c25e1[_0x8386('0x33')]][_0x8386('0x1a')]=0x2;queues[_0x9c25e1['transfereeuniqueid']][_0x8386('0x7')]=queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0x7')];queues[_0x9c25e1['transfereeuniqueid']]['calleridname']=queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0x44')];queues[_0x9c25e1['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x8386('0x12')]();queues[_0x9c25e1[_0x8386('0x33')]]['queuecallerleaveAt']=utils[_0x8386('0x12')]();queues[_0x9c25e1[_0x8386('0x33')]][_0x8386('0x25')]=0x0;queues[_0x9c25e1[_0x8386('0x33')]][_0x8386('0x45')]=0x0;}else{queues[_0x9c25e1[_0x8386('0x40')]][_0x8386('0xe')]=_0x9c25e1[_0x8386('0x3b')];}}}else if(_0x9c25e1[_0x8386('0x46')]==_0x9c25e1[_0x8386('0x3b')]){if(!_[_0x8386('0x14')](queues[_0x9c25e1[_0x8386('0x40')]])){queues[_0x9c25e1[_0x8386('0x40')]]['transfer']=!![];queues[_0x9c25e1['origtransfererlinkedid']][_0x8386('0x34')]=_0x8386('0x3c');queues[_0x9c25e1[_0x8386('0x40')]][_0x8386('0x3d')]=_0x9c25e1['secondtransfererexten'];queues[_0x9c25e1[_0x8386('0x40')]][_0x8386('0x37')]=_0x9c25e1[_0x8386('0x46')];queues[_0x9c25e1['origtransfererlinkedid']][_0x8386('0x8')]=_0x8386('0x3f');}if(!_['isNil'](queues[_0x9c25e1[_0x8386('0x3b')]])){if(_0x9c25e1[_0x8386('0x47')]&&queues[_0x9c25e1[_0x8386('0x47')]]){queues[_0x9c25e1[_0x8386('0x47')]]['queuecallerenterreason']=0x1;queues[_0x9c25e1[_0x8386('0x43')]]=_[_0x8386('0x42')](queues[_0x9c25e1[_0x8386('0x47')]]);queues[_0x9c25e1[_0x8386('0x43')]][_0x8386('0xe')]=_0x9c25e1[_0x8386('0x43')];queues[_0x9c25e1[_0x8386('0x43')]]['queuecallerenterreason']=0x2;queues[_0x9c25e1['transfertargetuniqueid']][_0x8386('0x7')]=queues[_0x9c25e1[_0x8386('0x40')]]['calleridnum'];queues[_0x9c25e1['transfertargetuniqueid']][_0x8386('0x44')]=queues[_0x9c25e1['origtransfererlinkedid']]['calleridname'];queues[_0x9c25e1[_0x8386('0x43')]][_0x8386('0x48')]=utils['now']();queues[_0x9c25e1[_0x8386('0x43')]]['queuecallerleaveAt']=utils[_0x8386('0x12')]();queues[_0x9c25e1[_0x8386('0x43')]][_0x8386('0x25')]=0x0;queues[_0x9c25e1['transfertargetuniqueid']][_0x8386('0x45')]=0x0;}else{queues[_0x9c25e1[_0x8386('0x3b')]][_0x8386('0xe')]=_0x9c25e1[_0x8386('0x40')];}}}}catch(_0x426802){utils['error'](_0x426802[_0x8386('0x49')]);}};exports['musiconholdstart']=function(_0x2c0277){if(!_[_0x8386('0x14')](queues[_0x2c0277[_0x8386('0x4')]])){queues[_0x2c0277[_0x8386('0x4')]][_0x8386('0x4a')]=utils[_0x8386('0x12')]();}};exports[_0x8386('0x4b')]=function(_0x483c5b){if(!_[_0x8386('0x14')](queues[_0x483c5b['uniqueid']])){if(!_[_0x8386('0x14')](queues[_0x483c5b[_0x8386('0x4')]][_0x8386('0x4a')])){queues[_0x483c5b['uniqueid']][_0x8386('0x45')]+=utils[_0x8386('0x26')](utils['now'](),queues[_0x483c5b['uniqueid']]['musiconholdstartAt']);delete queues[_0x483c5b[_0x8386('0x4')]][_0x8386('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d60a12f..ef9401e 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 _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x4066f0,_0x5a9af0){var _0x35e6bb=function(_0x3f5c6c){while(--_0x3f5c6c){_0x4066f0['push'](_0x4066f0['shift']());}};_0x35e6bb(++_0x5a9af0);}(_0x70e0,0x17b));var _0x070e=function(_0x22f603,_0x15cae6){_0x22f603=_0x22f603-0x0;var _0x242d22=_0x70e0[_0x22f603];return _0x242d22;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x192d6b,_0xfa3a38){var _0x509d1f=function(_0x381c3a){while(--_0x381c3a){_0x192d6b['push'](_0x192d6b['shift']());}};_0x509d1f(++_0xfa3a38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xcb91[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 477906a..b53f952 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 _0xddf7=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','error','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x549610,_0x2a23a7){var _0x44d899=function(_0x4c2272){while(--_0x4c2272){_0x549610['push'](_0x549610['shift']());}};_0x44d899(++_0x2a23a7);}(_0xddf7,0x184));var _0x7ddf=function(_0x2f52ad,_0x1778f5){_0x2f52ad=_0x2f52ad-0x0;var _0x10ea07=_0xddf7[_0x2f52ad];return _0x10ea07;};'use strict';var _=require(_0x7ddf('0x0'));var util=require(_0x7ddf('0x1'));var utils=require(_0x7ddf('0x2'));function writeDB(_0x4b25c3){utils[_0x7ddf('0x3')](util[_0x7ddf('0x4')](_0x7ddf('0x5'),_0x4b25c3[_0x7ddf('0x6')]));utils[_0x7ddf('0x7')](_0x7ddf('0x8'),_0x4b25c3);}exports[_0x7ddf('0x9')]=function(_0xc3d96e){try{_0xc3d96e['type']='blind';writeDB(_0xc3d96e);}catch(_0x22075e){utils[_0x7ddf('0xa')](_0x22075e['stack']);}};exports[_0x7ddf('0xb')]=function(_0x207224){try{_0x207224=_[_0x7ddf('0xc')](_0x207224,{'transfererchannel':_0x207224[_0x7ddf('0xd')],'transferercalleridnum':_0x207224[_0x7ddf('0xe')],'transferercalleridname':_0x207224['origtransferercalleridname'],'transfererconnectedlinenum':_0x207224[_0x7ddf('0xf')],'transfererconnectedlinename':_0x207224[_0x7ddf('0x10')],'transfereraccountcode':_0x207224[_0x7ddf('0x11')],'transferercontext':_0x207224['secondtransferercontext'],'transfererexten':_0x207224[_0x7ddf('0x12')],'transfererlinkedid':_0x207224[_0x7ddf('0x13')],'context':_0x207224[_0x7ddf('0x14')],'extension':_0x207224['origtransfererexten'],'type':'attended'});if(_[_0x7ddf('0x15')](_0x207224[_0x7ddf('0x16')])){_0x207224=_[_0x7ddf('0xc')](_0x207224,{'transfereechannel':_0x207224[_0x7ddf('0x17')],'transfereecalleridnum':_0x207224[_0x7ddf('0x18')],'transfereecalleridname':_0x207224[_0x7ddf('0x19')],'transfereeconnectedlinenum':_0x207224[_0x7ddf('0x1a')],'transfereeconnectedlinename':_0x207224[_0x7ddf('0x1b')],'transfereeaccountcode':_0x207224[_0x7ddf('0x1c')],'transfereecontext':_0x207224[_0x7ddf('0x1d')],'transfereeexten':_0x207224[_0x7ddf('0x1e')],'transfereelinkedid':_0x207224[_0x7ddf('0x1f')]});}writeDB(_0x207224);}catch(_0x34ae4a){utils[_0x7ddf('0xa')](_0x34ae4a['stack']);}}; \ No newline at end of file +var _0x1dfb=['stack','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','format','request','blindtransfer','type','error'];(function(_0x1c97b1,_0x200697){var _0x51f5dc=function(_0xc12306){while(--_0xc12306){_0x1c97b1['push'](_0x1c97b1['shift']());}};_0x51f5dc(++_0x200697);}(_0x1dfb,0x107));var _0xb1df=function(_0x10450c,_0x26f712){_0x10450c=_0x10450c-0x0;var _0x1a1a00=_0x1dfb[_0x10450c];return _0x1a1a00;};'use strict';var _=require(_0xb1df('0x0'));var util=require('util');var utils=require(_0xb1df('0x1'));function writeDB(_0x3a3a50){utils['info'](util[_0xb1df('0x2')]('TRANSFER|%s',_0x3a3a50['type']));utils[_0xb1df('0x3')]('CreateVoiceTransferReport',_0x3a3a50);}exports[_0xb1df('0x4')]=function(_0xffa77a){try{_0xffa77a[_0xb1df('0x5')]='blind';writeDB(_0xffa77a);}catch(_0x281080){utils[_0xb1df('0x6')](_0x281080[_0xb1df('0x7')]);}};exports[_0xb1df('0x8')]=function(_0x91876c){try{_0x91876c=_[_0xb1df('0x9')](_0x91876c,{'transfererchannel':_0x91876c['origtransfererchannel'],'transferercalleridnum':_0x91876c[_0xb1df('0xa')],'transferercalleridname':_0x91876c['origtransferercalleridname'],'transfererconnectedlinenum':_0x91876c[_0xb1df('0xb')],'transfererconnectedlinename':_0x91876c[_0xb1df('0xc')],'transfereraccountcode':_0x91876c[_0xb1df('0xd')],'transferercontext':_0x91876c['secondtransferercontext'],'transfererexten':_0x91876c['secondtransfererexten'],'transfererlinkedid':_0x91876c[_0xb1df('0xe')],'context':_0x91876c[_0xb1df('0xf')],'extension':_0x91876c[_0xb1df('0x10')],'type':_0xb1df('0x11')});if(_[_0xb1df('0x12')](_0x91876c[_0xb1df('0x13')])){_0x91876c=_[_0xb1df('0x9')](_0x91876c,{'transfereechannel':_0x91876c[_0xb1df('0x14')],'transfereecalleridnum':_0x91876c['transfertargetcalleridnum'],'transfereecalleridname':_0x91876c[_0xb1df('0x15')],'transfereeconnectedlinenum':_0x91876c[_0xb1df('0x16')],'transfereeconnectedlinename':_0x91876c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x91876c[_0xb1df('0x17')],'transfereecontext':_0x91876c[_0xb1df('0x18')],'transfereeexten':_0x91876c[_0xb1df('0x19')],'transfereelinkedid':_0x91876c[_0xb1df('0x1a')]});}writeDB(_0x91876c);}catch(_0x5879b3){utils[_0xb1df('0x6')](_0x5879b3[_0xb1df('0x7')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 76a5074..c0d427a 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 _0x5a0e=['moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0xe99866,_0x2713a8){var _0xc8c671=function(_0x1a511e){while(--_0x1a511e){_0xe99866['push'](_0xe99866['shift']());}};_0xc8c671(++_0x2713a8);}(_0x5a0e,0x102));var _0xe5a0=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0x5a0e[_0x9105f4];return _0x57a818;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xe5a0('0x0'));var BPromise=require(_0xe5a0('0x1'));var client=jayson[_0xe5a0('0x2')][_0xe5a0('0x3')]({'port':0x2329});var logger=require(_0xe5a0('0x4'))(_0xe5a0('0x5'));exports[_0xe5a0('0x6')]=function(_0x49073e){logger[_0xe5a0('0x6')](_0x49073e);};exports[_0xe5a0('0x7')]=function(_0x2aa71b){logger['debug'](JSON[_0xe5a0('0x8')](_0x2aa71b));};exports['error']=function(_0x40bcff){logger[_0xe5a0('0x9')](_0x40bcff[_0xe5a0('0xa')]);};exports['request']=function(_0x36b592,_0x2c0e3d){return client[_0xe5a0('0xb')](_0x36b592,{'body':_0x2c0e3d})[_0xe5a0('0xc')](function(_0x4516b3){logger[_0xe5a0('0x7')](JSON['stringify'](_0x4516b3));})[_0xe5a0('0xd')](function(_0x312213){logger[_0xe5a0('0x9')](_0x312213[_0xe5a0('0xa')]);});};function getUser(_0x24e0a0){return client[_0xe5a0('0xb')](_0xe5a0('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xe5a0('0xf'),_0xe5a0('0x10')],'where':_0x24e0a0,'limit':0x1}})['then'](function(_0x43e44b){logger[_0xe5a0('0x6')](_0xe5a0('0x11')+JSON[_0xe5a0('0x8')](_0x24e0a0)+'|'+(_0x43e44b[_0xe5a0('0x12')][_0xe5a0('0x13')]?_0xe5a0('0x14'):_0xe5a0('0x15')));return _0x43e44b['result']['length']?_0x43e44b[_0xe5a0('0x12')][0x0]:null;});}exports[_0xe5a0('0x16')]=function(_0x4b0414){return new BPromise(function(_0x3beadf,_0x226217){if(_0x4b0414){return getUser({'internal':_0x4b0414})['then'](function(_0x1e6f55){return _0x3beadf(_0x1e6f55);})[_0xe5a0('0xd')](function(_0x5c0786){logger[_0xe5a0('0x9')](_0x5c0786[_0xe5a0('0xa')]);return _0x3beadf(null);});}else{return _0x3beadf(null);}});};exports[_0xe5a0('0x17')]=function(_0x2f8a1a){return new BPromise(function(_0x340393,_0x4f1c5a){if(_0x2f8a1a){return getUser({'interface':_0x2f8a1a})[_0xe5a0('0xc')](function(_0xee7da2){return _0x340393(_0xee7da2);})['catch'](function(_0x5d8b66){logger[_0xe5a0('0x9')](_0x5d8b66[_0xe5a0('0xa')]);return _0x340393(null);});}else{return _0x340393(null);}});};exports[_0xe5a0('0x18')]=function(_0x324161){return new BPromise(function(_0x19bcc3,_0x3c0a84){if(_0x324161){return getUser({'name':_0x324161})[_0xe5a0('0xc')](function(_0x7ead4d){return _0x19bcc3(_0x7ead4d);})[_0xe5a0('0xd')](function(_0x5268db){logger['error'](_0x5268db[_0xe5a0('0xa')]);return _0x19bcc3(null);});}else{return _0x19bcc3(null);}});};exports[_0xe5a0('0x19')]=function(_0x5566e0){return new BPromise(function(_0x132959,_0x2db9a8){if(_0x5566e0){return client[_0xe5a0('0xb')](_0xe5a0('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xe5a0('0xf'),'type',_0xe5a0('0x1b'),_0xe5a0('0x1c')],'where':{'name':_0x5566e0},'limit':0x1}})[_0xe5a0('0xc')](function(_0x10c5d0){logger['info'](_0xe5a0('0x1d')+_0x5566e0+'|'+(_0x10c5d0[_0xe5a0('0x12')][_0xe5a0('0x13')]?'FOUND':_0xe5a0('0x15')));return _0x132959(_0x10c5d0['result']['length']?_0x10c5d0[_0xe5a0('0x12')][0x0]:null);})[_0xe5a0('0xd')](function(_0x5d33d3){logger[_0xe5a0('0x9')](_0x5d33d3['stack']);return _0x132959(null);});}else{return _0x132959(null);}});};exports[_0xe5a0('0x1e')]=function(_0x3683b6,_0x5e3627){return moment(_0x3683b6)[_0xe5a0('0x1f')](_0x5e3627,_0xe5a0('0x20'))[_0xe5a0('0x21')](_0xe5a0('0x22'));};exports[_0xe5a0('0x23')]=function(_0x3a5487,_0x1af866){return moment(_0x3a5487)[_0xe5a0('0x24')](_0x1af866,_0xe5a0('0x20'))[_0xe5a0('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe5a0('0x25')]=function(_0x528732,_0x22d68f){return moment(_0x528732)[_0xe5a0('0x26')](moment(_0x22d68f),_0xe5a0('0x20'));};exports[_0xe5a0('0x27')]=function(_0x403436,_0x35587d){return parseInt(_0x403436,0xa)+parseInt(_0x35587d,0xa);};exports[_0xe5a0('0x28')]=function(){return moment()[_0xe5a0('0x21')](_0xe5a0('0x22'));};exports[_0xe5a0('0x29')]=function(_0x1de507,_0x4267f8){if(_0x4267f8){return moment(_0x1de507)['isAfter'](_0x4267f8);}else{return!![];}};exports[_0xe5a0('0x2a')]=function(_0xdcb38a,_0x3ebd3d){if(_0x3ebd3d){return moment(_0xdcb38a)[_0xe5a0('0x2a')](_0x3ebd3d);}else if(_0xdcb38a){return!![];}else{return![];}}; \ No newline at end of file +var _0x249e=['getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','sumTime','format','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','interface','GETUSER|','length','FOUND','NOTFOUND','result','getUserByInternal'];(function(_0x4a8269,_0xe70d34){var _0x30be98=function(_0x75fbc5){while(--_0x75fbc5){_0x4a8269['push'](_0x4a8269['shift']());}};_0x30be98(++_0xe70d34);}(_0x249e,0x1d7));var _0xe249=function(_0x35916e,_0x18dd2d){_0x35916e=_0x35916e-0x0;var _0xfaa647=_0x249e[_0x35916e];return _0xfaa647;};'use strict';var jayson=require(_0xe249('0x0'));var moment=require(_0xe249('0x1'));var BPromise=require(_0xe249('0x2'));var client=jayson[_0xe249('0x3')][_0xe249('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xe249('0x5'));exports['info']=function(_0xd3f601){logger[_0xe249('0x6')](_0xd3f601);};exports[_0xe249('0x7')]=function(_0x137702){logger['debug'](JSON[_0xe249('0x8')](_0x137702));};exports[_0xe249('0x9')]=function(_0x10fdcc){logger[_0xe249('0x9')](_0x10fdcc[_0xe249('0xa')]);};exports['request']=function(_0x3d85b5,_0x30ee51){return client[_0xe249('0xb')](_0x3d85b5,{'body':_0x30ee51})[_0xe249('0xc')](function(_0xb86be5){logger[_0xe249('0x7')](JSON['stringify'](_0xb86be5));})[_0xe249('0xd')](function(_0x1e1162){logger[_0xe249('0x9')](_0x1e1162[_0xe249('0xa')]);});};function getUser(_0x392504){return client[_0xe249('0xb')](_0xe249('0xe'),{'options':{'raw':!![],'attributes':['id',_0xe249('0xf'),'name',_0xe249('0x10')],'where':_0x392504,'limit':0x1}})[_0xe249('0xc')](function(_0xf5c606){logger['info'](_0xe249('0x11')+JSON['stringify'](_0x392504)+'|'+(_0xf5c606['result'][_0xe249('0x12')]?_0xe249('0x13'):_0xe249('0x14')));return _0xf5c606[_0xe249('0x15')]['length']?_0xf5c606[_0xe249('0x15')][0x0]:null;});}exports[_0xe249('0x16')]=function(_0x2217f6){return new BPromise(function(_0x54bedc,_0x302aca){if(_0x2217f6){return getUser({'internal':_0x2217f6})['then'](function(_0x53bb09){return _0x54bedc(_0x53bb09);})[_0xe249('0xd')](function(_0x49ba6){logger[_0xe249('0x9')](_0x49ba6['stack']);return _0x54bedc(null);});}else{return _0x54bedc(null);}});};exports[_0xe249('0x17')]=function(_0xe86843){return new BPromise(function(_0x39c457,_0x5df6e4){if(_0xe86843){return getUser({'interface':_0xe86843})[_0xe249('0xc')](function(_0x26ba3b){return _0x39c457(_0x26ba3b);})[_0xe249('0xd')](function(_0x429d4a){logger[_0xe249('0x9')](_0x429d4a[_0xe249('0xa')]);return _0x39c457(null);});}else{return _0x39c457(null);}});};exports[_0xe249('0x18')]=function(_0x33a91f){return new BPromise(function(_0x33bb96,_0x34b62d){if(_0x33a91f){return getUser({'name':_0x33a91f})[_0xe249('0xc')](function(_0x57b47d){return _0x33bb96(_0x57b47d);})[_0xe249('0xd')](function(_0x23c7ea){logger[_0xe249('0x9')](_0x23c7ea[_0xe249('0xa')]);return _0x33bb96(null);});}else{return _0x33bb96(null);}});};exports[_0xe249('0x19')]=function(_0x223490){return new BPromise(function(_0x476e08,_0x30e200){if(_0x223490){return client[_0xe249('0xb')](_0xe249('0x1a'),{'options':{'raw':!![],'attributes':['id','name',_0xe249('0x1b'),_0xe249('0x1c'),_0xe249('0x1d')],'where':{'name':_0x223490},'limit':0x1}})[_0xe249('0xc')](function(_0x52fc76){logger[_0xe249('0x6')](_0xe249('0x1e')+_0x223490+'|'+(_0x52fc76[_0xe249('0x15')][_0xe249('0x12')]?_0xe249('0x13'):'NOTFOUND'));return _0x476e08(_0x52fc76['result']['length']?_0x52fc76['result'][0x0]:null);})[_0xe249('0xd')](function(_0x1e8663){logger['error'](_0x1e8663[_0xe249('0xa')]);return _0x476e08(null);});}else{return _0x476e08(null);}});};exports['addTime']=function(_0x385a0c,_0x157538){return moment(_0x385a0c)['add'](_0x157538,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe249('0x1f')]=function(_0x571d9a,_0x3b5586){return moment(_0x571d9a)[_0xe249('0x20')](_0x3b5586,'seconds')['format'](_0xe249('0x21'));};exports['diffTime']=function(_0x1c6294,_0x179bce){return moment(_0x1c6294)['diff'](moment(_0x179bce),'seconds');};exports[_0xe249('0x22')]=function(_0x4f66e9,_0x54d356){return parseInt(_0x4f66e9,0xa)+parseInt(_0x54d356,0xa);};exports['now']=function(){return moment()[_0xe249('0x23')](_0xe249('0x21'));};exports[_0xe249('0x24')]=function(_0x2bb8f2,_0xd7f39c){if(_0xd7f39c){return moment(_0x2bb8f2)[_0xe249('0x24')](_0xd7f39c);}else{return!![];}};exports[_0xe249('0x25')]=function(_0x12f4e5,_0x40b8e7){if(_0x40b8e7){return moment(_0x12f4e5)[_0xe249('0x25')](_0x40b8e7);}else if(_0x12f4e5){return!![];}else{return![];}}; \ No newline at end of file